rudder-sdk-js 2.52.23 → 2.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(null,arguments)}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&1===Object.keys(e).length?e.default:e}var s,i={exports:{}};function o(){return s||(s=1,function(t){function n(t){if(t)return function(t){return e(t,n.prototype),t._callbacks=new Map,t}(t);this._callbacks=new Map}n.prototype.on=function(e,t){const n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},n.prototype.once=function(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},n.prototype.off=function(e,t){if(void 0===e&&void 0===t)return this._callbacks.clear(),this;if(void 0===t)return this._callbacks.delete(e),this;const n=this._callbacks.get(e);if(n){for(const[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}0===n.length?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},n.prototype.emit=function(e,...t){const n=this._callbacks.get(e);if(n){const e=[...n];for(const n of e)n.apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks.get(e)??[]},n.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(const e of this._callbacks.values())t+=e.length;return t},n.prototype.hasListeners=function(e){return this.listenerCount(e)>0},n.prototype.addEventListener=n.prototype.on,n.prototype.removeListener=n.prototype.off,n.prototype.removeEventListener=n.prototype.off,n.prototype.removeAllListeners=n.prototype.off,t.exports=n}(i)),i.exports}var a=n(o());function c(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function u(e){return function t(n){return 0===arguments.length||c(n)?t:e.apply(this,arguments)}}function l(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return c(n)?t:u(function(t){return e(n,t)});default:return c(n)&&c(r)?t:c(n)?u(function(t){return e(t,r)}):c(r)?u(function(t){return e(n,t)}):e(n,r)}}}function h(e){return function t(n,r,s){switch(arguments.length){case 0:return t;case 1:return c(n)?t:l(function(t,r){return e(n,t,r)});case 2:return c(n)&&c(r)?t:c(n)?l(function(t,n){return e(t,r,n)}):c(r)?l(function(t,r){return e(n,t,r)}):u(function(t){return e(n,r,t)});default:return c(n)&&c(r)&&c(s)?t:c(n)&&c(r)?l(function(t,n){return e(t,n,s)}):c(n)&&c(s)?l(function(t,n){return e(t,r,n)}):c(r)&&c(s)?l(function(t,r){return e(n,t,r)}):c(n)?u(function(t){return e(t,r,s)}):c(r)?u(function(t){return e(n,t,s)}):c(s)?u(function(t){return e(n,r,t)}):e(n,r,s)}}}function d(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var f=u(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function p(e){return"[object Object]"===Object.prototype.toString.call(e)}function g(e,t,n){if(n||(n=new y),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var r,s=function(t){var r=n.get(e);if(r)return r;for(var s in n.set(e,t),e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=g(e[s],!0,n));return t};switch(f(e)){case"Object":return s(Object.create(Object.getPrototypeOf(e)));case"Array":return s(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return r=e,new RegExp(r.source,r.flags?r.flags:(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.sticky?"y":"")+(r.unicode?"u":"")+(r.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var y=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var n=this.hash(e),r=this.map[n];r||(this.map[n]=r=[]),r.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var n in e)t.push(Object.prototype.toString.call(e[n]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var n=this.map[t],r=0;r<n.length;r+=1){if((i=n[r])[0]===e)return i[1]}else{var s=this.hash(e);if(n=this.map[s])for(r=0;r<n.length;r+=1){var i;if((i=n[r])[0]===e)return i[1]}}},e}(),m=u(function(e){return null!=e&&"function"==typeof e.clone?e.clone():g(e)}),v=h(function(e,t,n){var r,s={};for(r in n=n||{},t=t||{})d(r,t)&&(s[r]=d(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)d(r,n)&&!d(r,s)&&(s[r]=n[r]);return s}),I=h(function e(t,n,r){return v(function(n,r,s){return p(r)&&p(s)?e(t,r,s):t(n,r,s)},n,r)}),A=h(function(e,t,n){return I(function(t,n,r){return e(n,r)},t,n)});const b={HS:"HubSpot",GA:"GA",HOTJAR:"Hotjar",GOOGLEADS:"GoogleAds",VWO:"VWO",GTM:"GoogleTagManager",BRAZE:"Braze",INTERCOM:"INTERCOM",KEEN:"Keen",KISSMETRICS:"Kissmetrics",CUSTOMERIO:"CustomerIO",CHARTBEAT:"Chartbeat",FACEBOOK_PIXEL:"FacebookPixel",LOTAME:"Lotame",OPTIMIZELY:"Optimizely",BUGSNAG:"Bugsnag",FULLSTORY:"Fullstory",TVSQUARED:"TVSquared",GA4:"GA4",GA4_V2:"GA4_V2",MOENGAGE:"MoEngage",AM:"Amplitude",PENDO:"Pendo",LYTICS:"Lytics",APPCUES:"Appcues",POSTHOG:"Posthog",KLAVIYO:"Klaviyo",CLEVERTAP:"Clevertap",BINGADS:"BingAds",PINTEREST_TAG:"PinterestTag",ADOBE_ANALYTICS:"AdobeAnalytics",LINKEDIN_INSIGHT_TAG:"LinkedInInsightTag",REDDIT_PIXEL:"RedditPixel",DRIP:"Drip",HEAP:"Heap",CRITEO:"Criteo",MP:"Mixpanel",QUALTRICS:"Qualtrics",PROFITWELL:"ProfitWell",SENTRY:"Sentry",QUANTUMMETRIC:"QuantumMetric",SNAP_PIXEL:"SnapPixel",POST_AFFILIATE_PRO:"PostAffiliatePro",GOOGLE_OPTIMIZE:"GoogleOptimize",LAUNCHDARKLY:"LaunchDarkly",GA360:"GA360",ADROLL:"Adroll",DCM_FLOODLIGHT:"DCMFloodlight",MATOMO:"Matomo",VERO:"Vero",MOUSEFLOW:"Mouseflow",ROCKERBOX:"Rockerbox",CONVERTFLOW:"ConvertFlow",SNAPENGAGE:"SnapEngage",LIVECHAT:"LiveChat",SHYNET:"Shynet",WOOPRA:"Woopra",ROLLBAR:"RollBar",QUORA_PIXEL:"QuoraPixel",JUNE:"June",ENGAGE:"Engage",ITERABLE:"Iterable",YANDEX_METRICA:"YandexMetrica",REFINER:"Refiner",QUALAROO:"Qualaroo",PODSIGHTS:"Podsights",AXEPTIO:"Axeptio",SATISMETER:"Satismeter",MICROSOFT_CLARITY:"MicrosoftClarity",SENDINBLUE:"Sendinblue",OLARK:"Olark",LEMNISK:"Lemnisk",OPENAI_ADS:"OpenAIAds",TIKTOK_ADS:"TiktokAds",ACTIVE_CAMPAIGN:"ActiveCampaign",SPRIG:"Sprig",SPOTIFYPIXEL:"SpotifyPixel",COMMANDBAR:"CommandBar",NINETAILED:"Ninetailed",XPIXEL:"XPixel",GAINSIGHT_PX:"Gainsight_PX",USERPILOT:"Userpilot",COMSCORE:"Comscore"},E="ACTIVE_CAMPAIGN",S="ADOBE_ANALYTICS",k="ADROLL",w="AM",T="APPCUES",O="AXEPTIO",_="BINGADS",R="BRAZE",C="BUGSNAG",P="CHARTBEAT",x="CLEVERTAP",D="COMMANDBAR",L="COMSCORE",M="CONVERTFLOW",N="CRITEO",B="CUSTOMERIO",G="DCM_FLOODLIGHT",U="DRIP",j="ENGAGE",F="FACEBOOK_PIXEL",$="FULLSTORY",z="GA",K="GA360",H="GA4",Q="GA4_V2",V="GAINSIGHT_PX",q="GOOGLE_OPTIMIZE",X="GOOGLEADS",W="GTM",Y="HEAP",J="HOTJAR",Z="HS",ee="INTERCOM",te="ITERABLE",ne="JUNE",re="KEEN",se="KISSMETRICS",ie="KLAVIYO",oe="LAUNCHDARKLY",ae="LEMNISK",ce="LINKEDIN_INSIGHT_TAG",ue="LIVECHAT",le="LOTAME",he="LYTICS",de="MATOMO",fe="MICROSOFT_CLARITY",pe="MOENGAGE",ge="MOUSEFLOW",ye="MP",me="NINETAILED",ve="OLARK",Ie="OPTIMIZELY",Ae="PENDO",be="PINTEREST_TAG",Ee="PODSIGHTS",Se="POST_AFFILIATE_PRO",ke="POSTHOG",we="PROFITWELL",Te="QUALAROO",Oe="QUALTRICS",_e="QUANTUMMETRIC",Re="QUORA_PIXEL",Ce="REDDIT_PIXEL",Pe="REFINER",xe="ROCKERBOX",De="ROLLBAR",Le="SATISMETER",Me="SENDINBLUE",Ne="SENTRY",Be="SHYNET",Ge="SNAP_PIXEL",Ue="SNAPENGAGE",je="SPOTIFYPIXEL",Fe="SPRIG",$e="TIKTOK_ADS",ze="TVSQUARED",Ke="USERPILOT",He="VERO",Qe="VWO",Ve="WOOPRA",qe="XPIXEL",Xe="YANDEX_METRICA",We={"Adobe Analytics":S,ADOBEANALYTICS:S,"ADOBE ANALYTICS":S,[S]:S,AdobeAnalytics:S,adobeanalytics:S,"adobe analytics":S,"Adobe analytics":S,"adobe Analytics":S},Ye={[w]:w,AMPLITUDE:w,Amplitude:w,am:w},Je={[T]:T,Appcues:T,"App Cues":T,appcues:T},Ze={[_]:_,BingAds:_,bingads:_,"Bing Ads":_,"Bing ads":_,"bing Ads":_,"bing ads":_},et={[R]:R,Braze:R,braze:R},tt={[C]:C,bugsnag:C,Bugsnag:C},nt={[P]:P,Chartbeat:P,chartbeat:P,"Chart Beat":P,"chart beat":P},rt={[x]:x,Clevertap:x,clevertap:x},st={[N]:N,Criteo:N,criteo:N},it={[B]:B,Customerio:B,"Customer.io":B,"CUSTOMER.IO":B,"customer.io":B},ot={[U]:U,Drip:U,drip:U},at={[F]:F,"FB Pixel":F,"Facebook Pixel":F,"facebook pixel":F,fbpixel:F,FBPIXEL:F,FB_PIXEL:F},ct={[$]:$,Fullstory:$,FullStory:$,"full Story":$,"Full Story":$,"Full story":$,"full story":$,fullstory:$},ut={[z]:z,"Google Analytics":z,GoogleAnalytics:z,"GOOGLE ANALYTICS":z,"google analytics":z},lt={[H]:H,"Google Analytics 4":H,"Google analytics 4":H,"google analytics 4":H,"Google Analytics4":H,"Google analytics4":H,"google analytics4":H,"Google Analytics 4 (GA4)":H,"google analytics 4 (ga4)":H,GoogleAnalytics4:H},ht={[Q]:Q,"Google Analytics 4 V2":Q,"Google analytics 4 V2":Q,"google analytics 4 V2":Q,"Google Analytics4 V2":Q,"Google analytics4 V2":Q,"google analytics4 V2":Q,"Google Analytics 4 (GA4) V2":Q,"google analytics 4 (ga4) V2":Q,GoogleAnalytics4V2:Q},dt={[X]:X,"Google Ads":X,GoogleAds:X,"GOOGLE ADS":X,"google ads":X,googleads:X},ft={[q]:q,"Google Optimize":q,GoogleOptimize:q,Googleoptimize:q,GOOGLEOPTIMIZE:q,"google optimize":q,"Google optimize":q,"GOOGLE OPTIMIZE":q},pt={[W]:W,"Google Tag Manager":W,"google tag manager":W,"googletag manager":W,googletagmanager:W},gt={[Y]:Y,Heap:Y,heap:Y,"Heap.io":Y},yt={[J]:J,Hotjar:J,hotjar:J,"Hot Jar":J,"hot jar":J},mt={[Z]:Z,Hubspot:Z,HUBSPOT:Z,"hub spot":Z,"Hub Spot":Z,"Hub spot":Z},vt={[ee]:ee,Intercom:ee,intercom:ee},It={[re]:re,Keen:re,"Keen.io":re,keen:re,"keen.io":re},At={[se]:se,Kissmetrics:se,kissmetrics:se},bt={[ie]:ie,Klaviyo:ie,klaviyo:ie},Et={[oe]:oe,LaunchDarkly:oe,Launch_Darkly:oe,"Launch Darkly":oe,launchDarkly:oe,"launch darkly":oe},St={[ce]:ce,"LinkedIn Insight Tag":ce,"LinkedIn insight tag":ce,"linkedIn insight tag":ce,Linkedin_insight_tag:ce,LinkedinInsighttag:ce,LinkedinInsightTag:ce,LinkedInInsightTag:ce,Linkedininsighttag:ce,LINKEDININSIGHTTAG:ce,linkedininsighttag:ce},kt={[le]:le,Lotame:le,lotame:le},wt={[he]:he,Lytics:he,lytics:he},Tt={[ye]:ye,MIXPANEL:ye,Mixpanel:ye,"MIX PANEL":ye,"Mix panel":ye,"Mix Panel":ye},Ot={[pe]:pe,MoEngage:pe,moengage:pe,Moengage:pe,"Mo Engage":pe,"mo engage":pe,"Mo engage":pe},_t={[Ie]:Ie,Optimizely:Ie,optimizely:Ie},Rt={[Ae]:Ae,Pendo:Ae,pendo:Ae},Ct={[be]:be,PinterestTag:be,Pinterest_Tag:be,PINTERESTTAG:be,pinterest:be,PinterestAds:be,Pinterest_Ads:be,Pinterest:be,"Pinterest Tag":be,"Pinterest tag":be,"PINTEREST TAG":be,"pinterest tag":be,"Pinterest Ads":be,"Pinterest ads":be},Pt={[Se]:Se,PostAffiliatePro:Se,Post_affiliate_pro:Se,"Post Affiliate Pro":Se,"Post affiliate pro":Se,"post affiliate pro":Se,postaffiliatepro:Se,POSTAFFILIATEPRO:Se},xt={[ke]:ke,PostHog:ke,Posthog:ke,posthog:ke,"Post Hog":ke,"Post hog":ke,"post hog":ke},Dt={[we]:we,ProfitWell:we,profitwell:we,Profitwell:we,"Profit Well":we,"profit well":we,"Profit well":we},Lt={[Oe]:Oe,Qualtrics:Oe,qualtrics:Oe},Mt={[_e]:_e,"Quantum Metric":_e,"quantum Metric":_e,"quantum metric":_e,QuantumMetric:_e,quantumMetric:_e,quantummetric:_e,Quantum_Metric:_e},Nt={[Ce]:Ce,Reddit_Pixel:Ce,RedditPixel:Ce,REDDITPIXEL:Ce,redditpixel:Ce,"Reddit Pixel":Ce,"REDDIT PIXEL":Ce,"reddit pixel":Ce},Bt={[Ne]:Ne,sentry:Ne,Sentry:Ne},Gt={[Ge]:Ge,Snap_Pixel:Ge,SnapPixel:Ge,SNAPPIXEL:Ge,snappixel:Ge,"Snap Pixel":Ge,"SNAP PIXEL":Ge,"snap pixel":Ge},Ut={[ze]:ze,TVSquared:ze,tvsquared:ze,tvSquared:ze,TvSquared:ze,Tvsquared:ze,"TV Squared":ze,"tv squared":ze,"tv Squared":ze},jt={[Qe]:Qe,VisualWebsiteOptimizer:Qe,Visualwebsiteoptimizer:Qe,visualwebsiteoptimizer:Qe,vwo:Qe,"Visual Website Optimizer":Qe,"Visual website optimizer":Qe,"visual website optimizer":Qe},Ft={[K]:K,"Google Analytics 360":K,"Google analytics 360":K,"google analytics 360":K,"Google Analytics360":K,"Google analytics360":K,"google analytics360":K,GoogleAnalytics360:K,"GA 360":K},$t={[k]:k,Adroll:k,"Ad roll":k,"ad roll":k,adroll:k},zt={[G]:G,"DCM Floodlight":G,"dcm floodlight":G,"Dcm Floodlight":G,DCMFloodlight:G,dcmfloodlight:G,DcmFloodlight:G,dcm_floodlight:G,DCM_Floodlight:G},Kt={[de]:de,Matomo:de,matomo:de},Ht={[He]:He,Vero:He,vero:He},Qt={[ge]:ge,Mouseflow:ge,mouseflow:ge,mouseFlow:ge,MouseFlow:ge,"Mouse flow":ge,"mouse flow":ge,"mouse Flow":ge,"Mouse Flow":ge},Vt={[xe]:xe,Rockerbox:xe,rockerbox:xe,RockerBox:xe,"Rocker box":xe,"rocker box":xe,"Rocker Box":xe},qt={[M]:M,Convertflow:M,convertflow:M,convertFlow:M,ConvertFlow:M,"Convert flow":M,"convert flow":M,"convert Flow":M,"Convert Flow":M,"CONVERT FLOW":M},Xt={[Ue]:Ue,SnapEngage:Ue,Snap_Engage:Ue,snapengage:Ue,"SNAP ENGAGE":Ue,"Snap Engage":Ue,"snap engage":Ue},Wt={[ue]:ue,LiveChat:ue,Live_Chat:ue,livechat:ue,"LIVE CHAT":ue,"Live Chat":ue,"live chat":ue},Yt={[Be]:Be,shynet:Be,ShyNet:Be,shyNet:Be,Shynet:Be,"shy net":Be,"Shy Net":Be,"shy Net":Be,"Shy net":Be},Jt={[Ve]:Ve,Woopra:Ve,woopra:Ve},Zt={[De]:De,RollBar:De,Roll_Bar:De,rollbar:De,Rollbar:De,"ROLL BAR":De,"Roll Bar":De,"roll bar":De},en={[Re]:Re,"Quora Pixel":Re,"Quora pixel":Re,"QUORA PIXEL":Re,QuoraPixel:Re,Quorapixel:Re,QUORAPIXEL:Re,Quora_Pixel:Re,quora_pixel:Re,Quora:Re},tn={[ne]:ne,June:ne,june:ne},nn={[j]:j,Engage:j,engage:j},rn={[te]:te,Iterable:te,iterable:te},sn={[Xe]:Xe,Yandexmetrica:Xe,yandexmetrica:Xe,yandexMetrica:Xe,YandexMetrica:Xe},on={[Pe]:Pe,Refiner:Pe,refiner:Pe},an={[Te]:Te,Qualaroo:Te,qualaroo:Te},cn={[Ee]:Ee,Podsights:Ee,PodSights:Ee,"pod Sights":Ee,"Pod Sights":Ee,"pod sights":Ee,"POD SIGHTS":Ee,"Pod sights":Ee},un={[O]:O,Axeptio:O,axeptio:O},ln={[Le]:Le,Satismeter:Le,SatisMeter:Le},hn={[fe]:fe,"Microsoft Clarity":fe,"Microsoft clarity":fe,"microsoft clarity":fe,Microsoft_clarity:fe,MicrosoftClarity:fe,MICROSOFTCLARITY:fe,microsoftclarity:fe,microsoftClarity:fe},dn={[Me]:Me,Sendinblue:Me,sendinblue:Me,SendinBlue:Me},fn={[ve]:ve,Olark:ve,olark:ve},pn={[ae]:ae,LEMNISK_MARKETING_AUTOMATION:ae,"Lemnisk Marketing Automation":ae,LemniskMarketingAutomation:ae,lemniskmarketingautomation:ae,lemniskMarketingAutomation:ae,lemnisk:ae,Lemnisk:ae},gn={[$e]:$e,TiktokAds:$e,"Tiktok ads":$e,"Tiktok Ads":$e,"Tik Tok Ads":$e,"tik tok ads":$e,tiktokads:$e},yn={ActiveCampaign:E,"Active Campaign":E,"ACTIVE CAMPAIGN":E,[E]:E,activecampaign:E,"active campaign":E,"Active campaign":E,"active Campaign":E,active_campaign:E},mn={[Fe]:Fe,Sprig:Fe,sprig:Fe},vn={[je]:je,"Spotify Pixel":je,"spotify pixel":je,SPOTIFY_PIXEL:je},In={All:"All",...We,...Ye,...Je,...Ze,...et,...tt,...{[D]:D,"Command Bar":D,Commandbar:D,COMMAND_BAR:D,commandbar:D},...nt,...rt,...st,...it,...ot,...at,...ct,...ut,...lt,...ht,...Ft,...dt,...ft,...pt,...gt,...yt,...mt,...vt,...It,...At,...bt,...Et,...St,...kt,...wt,...Tt,...Ot,...{[me]:me,Ninetailed:me,ninetailed:me,NineTailed:me},..._t,...Rt,...Ct,...Pt,...xt,...Dt,...Lt,...Mt,...Nt,...Bt,...Gt,...Ut,...jt,...$t,...zt,...Kt,...Ht,...Qt,...qt,...Xt,...Wt,...Yt,...Jt,...Zt,...en,...tn,...nn,...rn,...Vt,...sn,...on,...an,...cn,...un,...ln,...hn,...dn,...fn,...pn,...gn,...yn,...mn,...vn,...{[qe]:qe,XPixel:qe,Xpixel:qe,xpixel:qe,xPixel:qe},...{[V]:V,Gainsight_PX:V},...{[Ke]:Ke,userpilot:Ke,Userpilot:Ke},...{[L]:L,Comscore:L,comscore:L,comScore:L}};let An=3;const bn={setLogLevel(e){switch(e.toUpperCase()){case"INFO":An=1;break;case"DEBUG":An=2;break;default:An=3}},info(...e){An<=1&&console.info(...e)},debug(...e){An<=2&&console.log(...e)},warn(...e){An<=3&&console.warn(...e)},error(...e){An<=4&&console.error(...e)}},En=["anonymous_id","id","sent_at","received_at","timestamp","original_timestamp","event_text","event"],Sn="https://api.rudderstack.com/sourceConfig/?p=npm&v=2.52.23",kn="v1.1",wn="js-integrations",Tn=`https://cdn.rudderlabs.com/${kn}/${wn}`,On=["Lax","None","Strict"],_n=["US","EU"],Rn=["oneTrust","ketch"],Cn=["library","consentManagement"],Pn=["none","default","full"],xn={All:!0},Dn="Request failed with status:",Ln=[Dn],Mn="errorReporting",Nn=e=>{const t=window.RudderStackGlobals?.[Mn];t&&e instanceof Error&&t.notify(e)},Bn=e=>{const t=[];return function(n,r){if(!e||null!=r){if("object"!=typeof r||null===r)return r;for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?(bn.debug(`Circular Reference detected for key: ${n}`),"[Circular Reference]"):(t.push(r),r)}}},Gn=(e,t)=>{try{return JSON.stringify(e,Bn(t))}catch(e){return bn.warn("Failed to convert the value to a JSON string."),null}},Un=e=>null===e,jn=(e,t)=>{if(!Array.isArray(e)||!Array.isArray(t))return m(t);const n=m(e);return t.forEach((e,t)=>{n[t]=Array.isArray(e)||(e=>!Un(e)&&(e=>"object"==typeof e)(e)&&!Array.isArray(e))(e)?Fn(n[t],e):e}),n},Fn=(e,t)=>A(jn,e,t),$n=e=>(e=>!Un(e)&&"[object Object]"===Object.prototype.toString.call(e))(e)&&Object.keys(e).length>0,zn=1e4,Kn=1e3,Hn="RS_JS_SDK",Qn=(e,t,n)=>{let r;try{r=((e,t,n)=>{let r;try{r="string"==typeof e?e:e instanceof Error||e.message?e.message:Gn(e)}catch(e){r=""}if("object"==typeof(s=e)&&null!==s&&"target"in s){if(e.target&&"script"!==e.target.localName)return"";if(e.target.dataset&&(e.target.dataset.loader!==Hn||"true"!==e.target.dataset.isnonnativesdk))return"";if(r=`error in script loading:: src:: ${e.target.src} id:: ${e.target.id}`,"ad-block"===e.target.id)return n.page("RudderJS-Initiated","ad-block page request",{path:"/ad-blocked",title:r},n.sendAdblockPageOptions),""}var s;return`[handleError]::${t||""} "${r}"`})(e,t,n)}catch(t){bn.error("[handleError] Exception:: ",t),bn.error("[handleError] Original error:: ",Gn(e)),Nn(t)}r&&(bn.error(r),(e=>!e.message||!Ln.some(t=>e.message.includes(t)))(e)&&Nn(e))};var Vn={exports:{}};var qn,Xn={exports:{}},Wn=r(Object.freeze({__proto__:null,default:{}}));function Yn(){return qn||(qn=1,Xn.exports=(e=e||function(e,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!==t&&t.crypto&&(r=t.crypto),!r)try{r=Wn}catch(e){}var s=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},a=o.lib={},c=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=t!=n?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,s=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<s;i++){var o=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=o<<24-(r+i)%4*8}else for(var a=0;a<s;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(s());return new u.init(t,e)}}),l=o.enc={},h=l.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],s=0;s<n;s++){var i=t[s>>>2]>>>24-s%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],s=0;s<n;s++){var i=t[s>>>2]>>>24-s%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,s=r.words,i=r.sigBytes,o=this.blockSize,a=i/(4*o),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,l=e.min(4*c,i);if(c){for(var h=0;h<c;h+=o)this._doProcessBlock(s,h);n=s.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=p.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=o.algo={};return o}(Math),e)),Xn.exports;var e}var Jn,Zn={exports:{}};function er(){return Jn?Zn.exports:(Jn=1,Zn.exports=(e=Yn(),function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var s=[],i=0,o=0;o<t;o++)if(o%4){var a=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;s[i>>>2]|=a<<24-i%4*8,i++}return n.create(s,i)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var s=[],i=0;i<n;i+=3)for(var o=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<n;a++)s.push(r.charAt(o>>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;s.length%4;)s.push(c);return s.join("")},parse:function(e){var t=e.length,n=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var i=0;i<n.length;i++)s[n.charCodeAt(i)]=i}var o=n.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return r(e,t,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64));var e}var tr,nr={exports:{}};function rr(){return tr||(tr=1,nr.exports=(e=Yn(),function(t){var n=e,r=n.lib,s=r.WordArray,i=r.Hasher,o=n.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=o.MD5=i.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,s=e[r];e[r]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var i=this._hash.words,o=e[t+0],c=e[t+1],f=e[t+2],p=e[t+3],g=e[t+4],y=e[t+5],m=e[t+6],v=e[t+7],I=e[t+8],A=e[t+9],b=e[t+10],E=e[t+11],S=e[t+12],k=e[t+13],w=e[t+14],T=e[t+15],O=i[0],_=i[1],R=i[2],C=i[3];O=u(O,_,R,C,o,7,a[0]),C=u(C,O,_,R,c,12,a[1]),R=u(R,C,O,_,f,17,a[2]),_=u(_,R,C,O,p,22,a[3]),O=u(O,_,R,C,g,7,a[4]),C=u(C,O,_,R,y,12,a[5]),R=u(R,C,O,_,m,17,a[6]),_=u(_,R,C,O,v,22,a[7]),O=u(O,_,R,C,I,7,a[8]),C=u(C,O,_,R,A,12,a[9]),R=u(R,C,O,_,b,17,a[10]),_=u(_,R,C,O,E,22,a[11]),O=u(O,_,R,C,S,7,a[12]),C=u(C,O,_,R,k,12,a[13]),R=u(R,C,O,_,w,17,a[14]),O=l(O,_=u(_,R,C,O,T,22,a[15]),R,C,c,5,a[16]),C=l(C,O,_,R,m,9,a[17]),R=l(R,C,O,_,E,14,a[18]),_=l(_,R,C,O,o,20,a[19]),O=l(O,_,R,C,y,5,a[20]),C=l(C,O,_,R,b,9,a[21]),R=l(R,C,O,_,T,14,a[22]),_=l(_,R,C,O,g,20,a[23]),O=l(O,_,R,C,A,5,a[24]),C=l(C,O,_,R,w,9,a[25]),R=l(R,C,O,_,p,14,a[26]),_=l(_,R,C,O,I,20,a[27]),O=l(O,_,R,C,k,5,a[28]),C=l(C,O,_,R,f,9,a[29]),R=l(R,C,O,_,v,14,a[30]),O=h(O,_=l(_,R,C,O,S,20,a[31]),R,C,y,4,a[32]),C=h(C,O,_,R,I,11,a[33]),R=h(R,C,O,_,E,16,a[34]),_=h(_,R,C,O,w,23,a[35]),O=h(O,_,R,C,c,4,a[36]),C=h(C,O,_,R,g,11,a[37]),R=h(R,C,O,_,v,16,a[38]),_=h(_,R,C,O,b,23,a[39]),O=h(O,_,R,C,k,4,a[40]),C=h(C,O,_,R,o,11,a[41]),R=h(R,C,O,_,p,16,a[42]),_=h(_,R,C,O,m,23,a[43]),O=h(O,_,R,C,A,4,a[44]),C=h(C,O,_,R,S,11,a[45]),R=h(R,C,O,_,T,16,a[46]),O=d(O,_=h(_,R,C,O,f,23,a[47]),R,C,o,6,a[48]),C=d(C,O,_,R,v,10,a[49]),R=d(R,C,O,_,w,15,a[50]),_=d(_,R,C,O,y,21,a[51]),O=d(O,_,R,C,S,6,a[52]),C=d(C,O,_,R,p,10,a[53]),R=d(R,C,O,_,b,15,a[54]),_=d(_,R,C,O,c,21,a[55]),O=d(O,_,R,C,I,6,a[56]),C=d(C,O,_,R,T,10,a[57]),R=d(R,C,O,_,m,15,a[58]),_=d(_,R,C,O,k,21,a[59]),O=d(O,_,R,C,g,6,a[60]),C=d(C,O,_,R,E,10,a[61]),R=d(R,C,O,_,f,15,a[62]),_=d(_,R,C,O,A,21,a[63]),i[0]=i[0]+O|0,i[1]=i[1]+_|0,i[2]=i[2]+R|0,i[3]=i[3]+C|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,s=8*e.sigBytes;n[s>>>5]|=128<<24-s%32;var i=t.floor(r/4294967296),o=r;n[15+(s+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(s+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,r,s,i,o){var a=e+(t&n|~t&r)+s+o;return(a<<i|a>>>32-i)+t}function l(e,t,n,r,s,i,o){var a=e+(t&r|n&~r)+s+o;return(a<<i|a>>>32-i)+t}function h(e,t,n,r,s,i,o){var a=e+(t^n^r)+s+o;return(a<<i|a>>>32-i)+t}function d(e,t,n,r,s,i,o){var a=e+(n^(t|~r))+s+o;return(a<<i|a>>>32-i)+t}n.MD5=i._createHelper(c),n.HmacMD5=i._createHmacHelper(c)}(Math),e.MD5)),nr.exports;var e}var sr,ir={exports:{}},or={exports:{}};function ar(){return sr||(sr=1,or.exports=(a=Yn(),t=(e=a).lib,n=t.WordArray,r=t.Hasher,s=e.algo,i=[],o=s.SHA1=r.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],s=n[1],o=n[2],a=n[3],c=n[4],u=0;u<80;u++){if(u<16)i[u]=0|e[t+u];else{var l=i[u-3]^i[u-8]^i[u-14]^i[u-16];i[u]=l<<1|l>>>31}var h=(r<<5|r>>>27)+c+i[u];h+=u<20?1518500249+(s&o|~s&a):u<40?1859775393+(s^o^a):u<60?(s&o|s&a|o&a)-1894007588:(s^o^a)-899497514,c=a,a=o,o=s<<30|s>>>2,s=r,r=h}n[0]=n[0]+r|0,n[1]=n[1]+s|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}}),e.SHA1=r._createHelper(o),e.HmacSHA1=r._createHmacHelper(o),a.SHA1)),or.exports;var e,t,n,r,s,i,o,a}var cr,ur={exports:{}};var lr;function hr(){return lr||(lr=1,ir.exports=function(e){return n=(t=e).lib,r=n.Base,s=n.WordArray,i=t.algo,o=i.MD5,a=i.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,i=r.hasher.create(),o=s.create(),a=o.words,c=r.keySize,u=r.iterations;a.length<c;){n&&i.update(n),n=i.update(e).finalize(t),i.reset();for(var l=1;l<u;l++)n=i.finalize(n),i.reset();o.concat(n)}return o.sigBytes=4*c,o}}),t.EvpKDF=function(e,t,n){return a.create(n).compute(e,t)},e.EvpKDF;var t,n,r,s,i,o,a}(Yn(),ar(),cr||(cr=1,ur.exports=(e=Yn(),void function(){var t=e,n=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,s=4*n;t.sigBytes>s&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),a=i.words,c=o.words,u=0;u<n;u++)a[u]^=1549556828,c[u]^=909522486;i.sigBytes=o.sigBytes=s,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}())))),ir.exports;var e}var dr,fr={exports:{}};var pr;var gr,yr,mr=(pr||(pr=1,Vn.exports=function(e){return function(){var t=e,n=t.lib.BlockCipher,r=t.algo,s=[],i=[],o=[],a=[],c=[],u=[],l=[],h=[],d=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var p=r^r<<1^r<<2^r<<3^r<<4;p=p>>>8^255&p^99,s[n]=p,i[p]=n;var g=e[n],y=e[g],m=e[y],v=257*e[p]^16843008*p;o[n]=v<<24|v>>>8,a[n]=v<<16|v>>>16,c[n]=v<<8|v>>>24,u[n]=v,v=16843009*m^65537*y^257*g^16843008*n,l[p]=v<<24|v>>>8,h[p]=v<<16|v>>>16,d[p]=v<<8|v>>>24,f[p]=v,n?(n=g^e[e[e[m^g]]],r^=e[e[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],o=0;o<r;o++)o<n?i[o]=t[o]:(u=i[o-1],o%n?n>6&&o%n==4&&(u=s[u>>>24]<<24|s[u>>>16&255]<<16|s[u>>>8&255]<<8|s[255&u]):(u=s[(u=u<<8|u>>>24)>>>24]<<24|s[u>>>16&255]<<16|s[u>>>8&255]<<8|s[255&u],u^=p[o/n|0]<<24),i[o]=i[o-n]^u);for(var a=this._invKeySchedule=[],c=0;c<r;c++){if(o=r-c,c%4)var u=i[o];else u=i[o-4];a[c]=c<4||o<=4?u:l[s[u>>>24]]^h[s[u>>>16&255]]^d[s[u>>>8&255]]^f[s[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,c,u,s)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,h,d,f,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,s,i,o,a){for(var c=this._nRounds,u=e[t]^n[0],l=e[t+1]^n[1],h=e[t+2]^n[2],d=e[t+3]^n[3],f=4,p=1;p<c;p++){var g=r[u>>>24]^s[l>>>16&255]^i[h>>>8&255]^o[255&d]^n[f++],y=r[l>>>24]^s[h>>>16&255]^i[d>>>8&255]^o[255&u]^n[f++],m=r[h>>>24]^s[d>>>16&255]^i[u>>>8&255]^o[255&l]^n[f++],v=r[d>>>24]^s[u>>>16&255]^i[l>>>8&255]^o[255&h]^n[f++];u=g,l=y,h=m,d=v}g=(a[u>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^n[f++],y=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^n[f++],m=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&l])^n[f++],v=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^n[f++],e[t]=g,e[t+1]=y,e[t+2]=m,e[t+3]=v},keySize:8});t.AES=n._createHelper(g)}(),e.AES}(Yn(),er(),rr(),hr(),dr||(dr=1,fr.exports=(gr=Yn(),hr(),void(gr.lib.Cipher||function(e){var t=gr,n=t.lib,r=n.Base,s=n.WordArray,i=n.BufferedBlockAlgorithm,o=t.enc;o.Utf8;var a=o.Base64,c=t.algo.EvpKDF,u=n.Cipher=i.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?v:y}return function(t){return{encrypt:function(n,r,s){return e(r).encrypt(t,n,r,s)},decrypt:function(n,r,s){return e(r).decrypt(t,n,r,s)}}}}()});n.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=t.mode={},h=n.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),d=l.CBC=function(){var t=h.extend();function n(t,n,r){var s,i=this._iv;i?(s=i,this._iv=e):s=this._prevBlock;for(var o=0;o<r;o++)t[n+o]^=s[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,s=r.blockSize;n.call(this,e,t,s),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+s)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,s=r.blockSize,i=e.slice(t,t+s);r.decryptBlock(e,t),n.call(this,e,t,s),this._prevBlock=i}}),t}(),f=(t.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],a=0;a<r;a+=4)o.push(i);var c=s.create(o,r);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};n.BlockCipher=u.extend({cfg:u.cfg.extend({mode:d,padding:f}),reset:function(){var e;u.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var p=n.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?s.create([1398893684,1701076831]).concat(n).concat(t):t).toString(a)},parse:function(e){var t,n=a.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=s.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),p.create({ciphertext:n,salt:t})}},y=n.SerializableCipher=r.extend({cfg:r.extend({format:g}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var s=e.createEncryptor(n,r),i=s.finalize(t),o=s.cfg;return p.create({ciphertext:i,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),m=(t.kdf={}).OpenSSL={execute:function(e,t,n,r,i){if(r||(r=s.random(8)),i)o=c.create({keySize:t+n,hasher:i}).compute(e,r);else var o=c.create({keySize:t+n}).compute(e,r);var a=s.create(o.words.slice(t),4*n);return o.sigBytes=4*t,p.create({key:o,iv:a,salt:r})}},v=n.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:m}),encrypt:function(e,t,n,r){var s=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=s.iv;var i=y.encrypt.call(this,e,t,s.key,r);return i.mixIn(s),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var s=r.kdf.execute(n,e.keySize,e.ivSize,t.salt,r.hasher);return r.iv=s.iv,y.decrypt.call(this,e,t,s.key,r)}})}()))))),Vn.exports),vr=n(mr),Ir={exports:{}};var Ar,br,Er,Sr,kr,wr,Tr=(yr||(yr=1,Ir.exports=function(e){return e.enc.Utf8}(Yn())),Ir.exports),Or=n(Tr),_r=Object.defineProperty,Rr=(e,t)=>_r(e,"name",{value:t,configurable:!0}),Cr=Rr(e=>null!==e&&"object"==typeof e,"isObject"),Pr=Rr((e,t,n)=>"function"==typeof n.join?n.join(e):e[0]+t+e[1],"join"),xr=Rr((e,t,n)=>"function"==typeof n.split?n.split(e):e.split(t),"split"),Dr=Rr((e,t={},n)=>"function"!=typeof n?.isValid||n.isValid(e,t),"isValid"),Lr=Rr(e=>Cr(e)||"function"==typeof e,"isValidObject"),Mr=Rr((e,t,n={})=>{if(Cr(n)||(n={default:n}),!Lr(e))return void 0!==n.default?n.default:e;"number"==typeof t&&(t=String(t));const r=Array.isArray(t),s="string"==typeof t,i=n.separator||".",o=n.joinChar||("string"==typeof i?i:".");if(!s&&!r)return e;let a=e[t];if(void 0===a&&"function"==typeof e.get&&(a=e.get(t)),void 0!==a)return Dr(t,e,n)?a:n.default;const c=r?t:xr(t,i,n),u=c.length;let l=0;do{let t=c[l];for("string"!=typeof t&&(t=String(t));t&&"\\"===t.slice(-1);)t=Pr([t.slice(0,-1),c[++l]||""],o,n);if(a=e[t],void 0===a&&"function"==typeof e.get&&(a=e.get(t)),void 0!==a){if(!Dr(t,e,n))return n.default;e=a}else{let r=!1,s=l+1;for(;s<u;)if(t=Pr([t,c[s++]],o,n),a=e[t],void 0===a&&"function"==typeof e.get&&(a=e.get(t)),r=void 0!==a){if(!Dr(t,e,n))return n.default;e=a,l=s-1;break}if(!r)return n.default}}while(++l<u&&Lr(e));return l===u?e:n.default},"getValue"),Nr={exports:{}},Br={exports:{}};function Gr(){if(br)return Ar;br=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=365.25*r;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return Ar=function(o,a){a=a||{};var c=typeof o;if("string"===c&&o.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!o)return;var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(o);if("number"===c&&!1===isNaN(o))return a.long?function(s){return i(s,r,"day")||i(s,n,"hour")||i(s,t,"minute")||i(s,e,"second")||s+" ms"}(o):function(s){if(s>=r)return Math.round(s/r)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},Ar}function Ur(){return Er||(Er=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,s=+new Date,i=s-(n||s);e.diff=i,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var s=t.formatters[r];if("function"==typeof s){var i=o[c];n=s.call(e,i),o.splice(c,1),c--}return n}),t.formatArgs.call(e,o),(r.log||t.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=Br.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,s=0;s<r;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Gr(),t.names=[],t.skips=[],t.formatters={}}(0,Br.exports)),Br.exports}var jr,Fr,$r,zr,Kr,Hr,Qr,Vr=function(){if(wr)return kr;wr=1;var e=(Sr||(Sr=1,function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=Nr.exports=Ur()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(0,Nr.exports)),Nr.exports)("cookie");function t(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},s=e.split(/ *; */);if(""==s[0])return n;for(var i=0;i<s.length;++i)n[r((t=s[i].split("="))[0])]=r(t[1]);return n}(e)}function n(t){try{return encodeURIComponent(t)}catch(n){e("error `encode(%o)` - %o",t,n)}}function r(t){try{return decodeURIComponent(t)}catch(n){e("error `decode(%o)` - %o",t,n)}}return kr=function(e,r,s){switch(arguments.length){case 3:case 2:return function(e,t,r){r=r||{};var s=n(e)+"="+n(t);null==t&&(r.maxage=-1);r.maxage&&(r.expires=new Date(+new Date+r.maxage));r.path&&(s+="; path="+r.path);r.domain&&(s+="; domain="+r.domain);r.expires&&(s+="; expires="+r.expires.toUTCString());r.samesite&&(s+="; samesite="+r.samesite);r.secure&&(s+="; secure");document.cookie=s}(e,r,s);case 1:return function(e){return t()[e]}(e);default:return t()}}}(),qr=n(Vr),Xr={exports:{}},Wr={exports:{}},Yr={exports:{}};function Jr(){if(Fr)return jr;Fr=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=365.25*r;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return jr=function(o,a){a=a||{};var c=typeof o;if("string"===c&&o.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!o)return;var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(o);if("number"===c&&!1===isNaN(o))return a.long?function(s){return i(s,r,"day")||i(s,n,"hour")||i(s,t,"minute")||i(s,e,"second")||s+" ms"}(o):function(s){if(s>=r)return Math.round(s/r)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},jr}function Zr(){return $r||($r=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,s=+new Date,i=s-(n||s);e.diff=i,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var s=t.formatters[r];if("function"==typeof s){var i=o[c];n=s.call(e,i),o.splice(c,1),c--}return n}),t.formatArgs.call(e,o),(r.log||t.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=Yr.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,s=0;s<r;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Jr(),t.names=[],t.skips=[],t.formatters={}}(0,Yr.exports)),Yr.exports}function es(){if(Hr)return Kr;Hr=1;var e=(zr||(zr=1,function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=Wr.exports=Zr()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(0,Wr.exports)),Wr.exports)("cookie");function t(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},s=e.split(/ *; */);if(""==s[0])return n;for(var i=0;i<s.length;++i)n[r((t=s[i].split("="))[0])]=r(t[1]);return n}(e)}function n(t){try{return encodeURIComponent(t)}catch(n){e("error `encode(%o)` - %o",t,n)}}function r(t){try{return decodeURIComponent(t)}catch(n){e("error `decode(%o)` - %o",t,n)}}return Kr=function(e,r,s){switch(arguments.length){case 3:case 2:return function(e,t,r){r=r||{};var s=n(e)+"="+n(t);null==t&&(r.maxage=-1);r.maxage&&(r.expires=new Date(+new Date+r.maxage));r.path&&(s+="; path="+r.path);r.domain&&(s+="; domain="+r.domain);r.expires&&(s+="; expires="+r.expires.toUTCString());r.secure&&(s+="; secure");document.cookie=s}(e,r,s);case 1:return function(e){return t()[e]}(e);default:return t()}},Kr}var ts=(Qr||(Qr=1,function(e,t){var n=es();function r(e){for(var n=t.cookie,r=t.levels(e),s=0;s<r.length;++s){var i="__tld__",o=r[s],a={domain:"."+o};if(n(i,1,a),n(i))return n(i,null,a),o}return""}r.levels=function(e){var t=("function"!=typeof window.URL?function(e){const t=document.createElement("a");return t.href=e,t.hostname}(e):new URL(e).hostname).split("."),n=t[t.length-1],r=[];if(4===t.length&&n===parseInt(n,10))return r;if(t.length<=1)return r;for(var s=t.length-2;s>=0;--s)r.push(t.slice(s).join("."));return r},r.cookie=n,t=e.exports=r}(Xr,Xr.exports)),Xr.exports),ns=n(ts);const rs=new class{constructor(e){this.cOpts={},this.options(e),this.isSupportAvailable=this.checkSupportAvailability()}options(e={}){if(0===arguments.length)return this.cOpts;let t=`.${ns(window.location.href)}`;return"."===t&&(t=null),this.cOpts=Fn({maxage:31536e6,path:"/",domain:t,samesite:"Lax"},e),e.sameDomainCookiesOnly&&delete this.cOpts.domain,this.cOpts}set(e,t){try{return qr(e,t,m(this.cOpts)),!0}catch(e){return bn.error(e),!1}}get(e){return qr(e)}remove(e){try{return qr(e,null,m(this.cOpts)),!0}catch(e){return!1}}checkSupportAvailability(){const e="test_rudder_cookie";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}}({});var ss,is={exports:{}};var os=(ss||(ss=1,is.exports=function(){function e(e){return e=JSON.stringify(e),!!/^\{[\s\S]*\}$/.test(e)}function t(e){return void 0===e||"function"==typeof e?e+"":JSON.stringify(e)}function n(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}}function r(e){return"[object Function]"==={}.toString.call(e)}function s(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){var t="_Is_Incognit",n="yes";try{e||(e=window.localStorage),e.setItem(t,n),e.removeItem(t)}catch(t){var r={_data:{},setItem:function(e,t){return r._data[e]=String(t)},getItem:function(e){return r._data.hasOwnProperty(e)?r._data[e]:void 0},removeItem:function(e){return delete r._data[e]},clear:function(){return r._data={}}};e=r}finally{e.getItem(t)===n&&e.removeItem(t)}return e}var o=i();function a(){if(!(this instanceof a))return new a}a.prototype={set:function(n,r){if(n&&!e(n))o.setItem(n,t(r));else if(e(n))for(var s in n)this.set(s,n[s]);return this},get:function(e){if(void 0===e){var t={};return this.forEach(function(e,n){return t[e]=n}),t}if("?"===e.charAt(0))return this.has(e.substr(1));var r=arguments;if(r.length>1){for(var s={},i=0,a=r.length;i<a;i++){var c=n(o.getItem(r[i]));this.has(r[i])&&(s[r[i]]=c)}return s}return n(o.getItem(e))},clear:function(){return o.clear(),this},remove:function(e){var t=this.get(e);return o.removeItem(e),t},has:function(e){return{}.hasOwnProperty.call(this.get(),e)},keys:function(){var e=[];return this.forEach(function(t){e.push(t)}),e},forEach:function(e){for(var t=0,n=o.length;t<n;t++){var r=o.key(t);e(r,this.get(r))}return this},search:function(e){for(var t=this.keys(),n={},r=0,s=t.length;r<s;r++)t[r].indexOf(e)>-1&&(n[t[r]]=this.get(t[r]));return n},len:function(){return o.length}};var c=null;function u(t,n){var i=arguments,o=null;if(c||(c=a()),0===i.length)return c.get();if(1===i.length){if("string"==typeof t)return c.get(t);if(e(t))return c.set(t)}if(2===i.length&&"string"==typeof t){if(!n)return c.remove(t);if(n&&"string"==typeof n)return c.set(t,n);n&&r(n)&&(o=null,o=n(t,c.get(t)),u.set(t,o))}if(2===i.length&&s(t)&&r(n))for(var l=0,h=t.length;l<h;l++)o=n(t[l],c.get(t[l])),u.set(t[l],o);return u}for(var l in a.prototype)u[l]=a.prototype[l];return u}()),is.exports),as=n(os);const cs=new class{constructor(e){this.sOpts={},this.enabled=this.checkSupportAvailability(),this.options(e)}options(e={}){return 0===arguments.length||(this.sOpts=Fn({enabled:!0},e),this.enabled=this.sOpts.enabled&&this.enabled),this.sOpts}set(e,t){return as.set(e,t)}get(e){return as.get(e)}remove(e){return as.remove(e)}checkSupportAvailability(){try{const e="test_rudder_ls";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}catch(e){return!1}}}({}),us=e=>(new TextDecoder).decode((e=>{const t=globalThis.atob(e).split("").map(e=>e.charCodeAt(0));return new Uint8Array(t)})(e)),ls="rl_user_id",hs="rl_trait",ds="rl_anonymous_id",fs="rl_group_id",ps="rl_group_trait",gs="rl_page_init_referrer",ys="rl_page_init_referring_domain",ms="rl_session",vs="rl_auth_token",Is="RudderEncrypt:",As="RS_ENC_v3_",bs="Rudder",Es={segment:"ajs_anonymous_id"};function Ss(e){return e.replace(/^\s+|\s+$/gm,"")}function ks(e){return e&&"string"==typeof e&&""!==Ss(e)?e.startsWith(Is)?vr.decrypt(e.substring(Is.length),bs).toString(Or):e.startsWith(As)?us(e.substring(As.length)):e:e}const ws=new class{constructor(){rs.isSupportAvailable?this.storage=rs:(cs.enabled&&(this.storage=cs),this.storage||bn.error("No storage is available :: initializing the SDK without storage"))}options(e={}){this.storage.options(e)}setItem(e,t){const n=Gn(t);null!==n&&this.storage.set(e,function(e){return""===Ss(e)?e:`${Is}${vr.encrypt(e,bs).toString()}`}(n))}setStringItem(e,t){"string"==typeof t?this.setItem(e,t):bn.error(`[Storage] ${e} should be string`)}setUserId(e){this.setStringItem(ls,e)}setUserTraits(e){this.setItem(hs,e)}setGroupId(e){this.setStringItem(fs,e)}setGroupTraits(e){this.setItem(ps,e)}setAnonymousId(e){this.setStringItem(ds,e)}setInitialReferrer(e){this.setItem(gs,e)}setInitialReferringDomain(e){this.setItem(ys,e)}setSessionInfo(e){this.setItem(ms,e)}setAuthToken(e){this.setItem(vs,e)}getItem(e){try{let t=this.storage.get(e),n=ks(t);for(t=n?JSON.parse(n):null;"string"==typeof t&&(n=ks(t),n!==t);)t=JSON.parse(n);return t}catch(t){return bn.error((e=>`Unable to retrieve the cookie data for ${e}. The data is dropped. This can potentially stem from using SDK v3 on other sites or web pages that can share cookies with this webpage. Please use the same SDK (v3) version everywhere as soon as possible.`)(e),t),null}}getUserId(){return this.getItem(ls)}getUserTraits(){return this.getItem(hs)}getGroupId(){return this.getItem(fs)}getGroupTraits(){return this.getItem(ps)}fetchExternalAnonymousId(e){let t;const n=e.toLowerCase();return Object.keys(Es).includes(n)&&"segment"===n?(cs.enabled&&(t=cs.get(Es[n])),!t&&rs.isSupportAvailable&&(t=rs.get(Es[n])),t):t}getAnonymousId(e){const t=this.getItem(ds);if(t)return t;const n=Mr(e,"autoCapture.source");if(!0===Mr(e,"autoCapture.enabled")&&"string"==typeof n){const e=this.fetchExternalAnonymousId(n);if(e)return e}return t}getInitialReferrer(){return this.getItem(gs)}getInitialReferringDomain(){return this.getItem(ys)}getSessionInfo(){return this.getItem(ms)}getAuthToken(){return this.getItem(vs)}removeItem(e){return this.storage.remove(e)}removeSessionInfo(){this.removeItem(ms)}clear(e){this.storage.remove(ls),this.storage.remove(hs),this.storage.remove(fs),this.storage.remove(ps),this.storage.remove(vs),e&&this.storage.remove(ds)}};for(var Ts,Os=256,_s=[];Os--;)_s[Os]=(Os+256).toString(16).substring(1);for(var Rs,Cs=[],Ps=0;Ps<256;Ps++)Cs[Ps]=(Ps+256).toString(16).substring(1);function xs(){var e;(!Rs||Ps+16>4096)&&(e=4096,Rs=crypto.getRandomValues(new Uint8Array(e)),Ps=0);for(var t,n=0,r="";n<16;n++)t=Rs[Ps+n],r+=6==n?Cs[15&t|64]:8==n?Cs[63&t|128]:Cs[t],1&n&&n>1&&n<11&&(r+="-");return Ps+=16,r}const Ds={All:"All",GA:"Google Analytics",GOOGLEADS:"Google Ads",BRAZE:"Braze",CHARTBEAT:"Chartbeat",CUSTOMERIO:"Customer IO",DCM_Floodlight:"DCM Floodlight",FACEBOOK_PIXEL:"Facebook Pixel",GTM:"Google Tag Manager",HOTJAR:"Hotjar",HS:"HubSpot",INTERCOM:"Intercom",KEEN:"Keen",KISSMETRICS:"Kiss Metrics",LOTAME:"Lotame",VWO:"VWO",OPTIMIZELY:"Optimizely Web",FULLSTORY:"Fullstory",TVSQUARED:"TVSquared",GA4:"Google Analytics 4 (GA4)",GA4_V2:"Google Analytics 4 (GA4) V2",MOENGAGE:"MoEngage",AM:"Amplitude",PENDO:"Pendo",LYTICS:"Lytics",APPCUES:"Appcues",POSTHOG:"PostHog",PROFITWELL:"ProfitWell",KLAVIYO:"Klaviyo",CLEVERTAP:"CleverTap",BINGADS:"Bing Ads",PINTEREST_TAG:"Pinterest Tag",SNAP_PIXEL:"Snap Pixel",LINKEDIN_INSIGHT_TAG:"Linkedin Insight Tag",REDDIT_PIXEL:"Reddit Pixel",DRIP:"Drip",HEAP:"Heap.io",CRITEO:"Criteo",MP:"Mixpanel",QUALTRICS:"Qualtrics",SENTRY:"Sentry",GOOGLE_OPTIMIZE:"Google Optimize",POST_AFFILIATE_PRO:"Post Affiliate Pro",LAUNCHDARKLY:"LaunchDarkly",GA360:"Google Analytics 360",ADROLL:"Adroll",VERO:"Vero",MATOMO:"Matomo",MOUSEFLOW:"Mouseflow",ROCKERBOX:"Rockerbox",CONVERTFLOW:"ConvertFlow",SNAPENGAGE:"SnapEngage",LIVECHAT:"LiveChat",SHYNET:"Shynet",WOOPRA:"Woopra",ROLLBAR:"RollBar",QUORA_PIXEL:"Quora Pixel",JUNE:"June",ENGAGE:"Engage",ITERABLE:"Iterable",YANDEX_METRICA:"Yandex.Metrica",REFINER:"Refiner",QUALAROO:"Qualaroo",PODSIGHTS:"Podsights",AXEPTIO:"Axeptio",SATISMETER:"Satismeter",MICROSOFT_CLARITY:"Microsoft Clarity",SENDINBLUE:"Sendinblue",OLARK:"Olark",LEMNISK:"Lemnisk",TIKTOK_ADS:"TikTok Ads",ACTIVE_CAMPAIGN:"ActiveCampaign",SPRIG:"Sprig",SPOTIFYPIXEL:"Spotify Pixel",COMMANDBAR:"CommandBar",NINETAILED:"Ninetailed",XPIXEL:"XPixel",GAINSIGHT_PX:"Gainsight PX",USERPILOT:"Userpilot",COMSCORE:"Comscore"};function Ls(e){return e?.endsWith("/")?e.replace(/\/+$/,""):e}function Ms(){return window.crypto&&"function"==typeof window.crypto.getRandomValues?xs():function(){var e,t=0,n="";if(!Ts||Os+16>256){for(Ts=Array(t=256);t--;)Ts[t]=256*Math.random()|0;t=Os=0}for(;t<16;t++)e=Ts[Os+t],n+=6==t?_s[15&e|64]:8==t?_s[63&e|128]:_s[e],1&t&&t>1&&t<11&&(n+="-");return Os++,n}()}function Ns(){return(new Date).toISOString()}function Bs(e,t){Object.keys(e).forEach(n=>{e.hasOwnProperty(n)&&(t[n]&&(e[t[n]]=e[n]),"All"!==n&&void 0!==t[n]&&t[n]!==n&&delete e[n])})}function Gs(e){Bs(e,In)}function Us(e){Bs(e,Ds)}function js(e,t){const n=[];if(!t||0===t.length)return n;let r=!0;void 0!==e.All&&(r=e.All);const s=[];return"string"==typeof t[0]?t.forEach(e=>{s.push({intgName:e,intObj:e})}):"object"==typeof t[0]&&t.forEach(e=>{s.push({intgName:e.name,intObj:e})}),s.forEach(({intgName:t,intObj:s})=>{if(r){let r=!0;void 0!==e[t]&&!1===Boolean(e[t])&&(r=!1),r&&n.push(s)}else void 0!==e[t]&&!0===Boolean(e[t])&&n.push(s)}),n}const Fs=e=>"string"==typeof e||null==e?e:Gn(e),$s=e=>"string"==typeof e&&e.trim().length>0,zs=(e,t,n)=>{try{const r=e.source.dataplanes||{};if(Object.keys(r).length>0){const e=(e=>{const t=e?e.residencyServer:void 0;if(t)return"string"==typeof t&&_n.includes(t.toUpperCase())?t.toUpperCase():void bn.error("Invalid residencyServer input")})(n),t=r[e]||r.US;if(t){const e=(e=>{if(Array.isArray(e)&&e.length>0){const t=e.find(e=>!0===e.default);if(t&&$s(t.url))return t.url}})(t);if(e)return e}}if($s(t))return t;throw Error("Unable to load the SDK due to invalid data plane url")}catch(e){throw Error(e)}};function Ks(){return document?.referrer||"$direct"}function Hs(e){const t=e.split("/");return t.length>=3?t[2]:""}function Qs(){const e=document.getElementsByTagName("link");for(let t=0;e[t];t+=1){const n=e[t];if("canonical"===n.getAttribute("rel"))return n.getAttribute("href")}}function Vs(){const e=Qs();let t=window.location.pathname;if(e)try{t=new URL(e).pathname}catch(e){}const{search:n,href:r}=window.location,{title:s}=document,i=function(e){const t=Qs();let n;n=t?t.includes("?")?t:t+e:window.location.href;const r=n.indexOf("#");return r>-1?n.slice(0,r):n}(n),o=r,a=Ks();return{path:t,referrer:a,referring_domain:Hs(a),search:n,title:s,url:i,tab_url:o,initial_referrer:ws.getInitialReferrer()||"",initial_referring_domain:ws.getInitialReferringDomain()||""}}class qs{constructor(){this.name="RudderLabs JavaScript SDK",this.namespace="com.rudderlabs.javascript",this.version="2.52.23"}}class Xs{constructor(){this.name="RudderLabs JavaScript SDK",this.version="2.52.23"}}class Ws{constructor(){this.name="",this.version=""}}class Ys{constructor(){this.density=0,this.width=0,this.height=0,this.innerWidth=0,this.innerHeight=0}}class Js{constructor(){this.app=new qs,this.traits=null,this.library=new Xs,this.userAgent=(()=>{if("undefined"==typeof navigator)return null;let{userAgent:e}=navigator;const{brave:t}=navigator;if(t&&Object.getPrototypeOf(t).isBrave){const t=e.match(/(chrome)\/([\w.]+)/i);t&&(e=`${e} Brave/${t[2]}`)}return e})(),this.device=null,this.network=null,this.os=new Ws,this.locale="undefined"==typeof navigator?null:navigator.language||navigator.browserLanguage,this.screen=(()=>{const e=new Ys;return"undefined"==typeof window||(e.width=window.screen.width,e.height=window.screen.height,e.density=window.devicePixelRatio,e.innerWidth=window.innerWidth,e.innerHeight=window.innerHeight),e})(),this.timezone=(()=>{const e=/([A-Z]+[+-]\d+)/.exec((new Date).toString());return e?.[1]?e[1]:"NA"})()}}class Zs{constructor(){this.channel="web",this.context=new Js,this.type=null,this.messageId=Ms(),this.originalTimestamp=(new Date).toISOString(),this.anonymousId=null,this.userId=null,this.event=null,this.properties={}}getProperty(e){return this.properties[e]}addProperty(e,t){this.properties[e]=t}}class ei{constructor(){this.message=new Zs}setType(e){this.message.type=e}setProperty(e){this.message.properties=e}setUserProperty(e){this.message.user_properties=e}setUserId(e){this.message.userId=e}setEventName(e){this.message.event=e}getElementContent(){return this.message}}class ti{constructor(){this.rudderProperty=null,this.rudderUserProperty=null,this.event=null,this.userId=null,this.type=null}setType(e){return this.type=e,this}build(){const e=new ei;return e.setUserId(this.userId),e.setType(this.type),e.setEventName(this.event),e.setProperty(this.rudderProperty),e.setUserProperty(this.rudderUserProperty),e}}var ni,ri={};function si(){if(ni)return ri;ni=1;for(var e,t=256,n=[];t--;)n[t]=(t+256).toString(16).substring(1);return ri.v4=function(){var r,s=0,i="";if(!e||t+16>256){for(e=Array(s=256);s--;)e[s]=256*Math.random()|0;s=t=0}for(;s<16;s++)r=e[t+s],i+=6==s?n[15&r|64]:8==s?n[63&r|128]:n[r],1&s&&s>1&&s<11&&(i+="-");return t++,i},ri}var ii,oi,ai,ci,ui,li,hi,di,fi,pi={};function gi(){if(oi)return ii;oi=1;var e=Object.prototype.hasOwnProperty,t=String.prototype.charAt,n=Object.prototype.toString,r=function(e,n){return t.call(e,n)},s=function(t,n){return e.call(t,n)},i=function(e,t){t=t||s;for(var n=[],r=0,i=e.length;r<i;r+=1)t(e,r)&&n.push(String(r));return n};return ii=function(e){return null==e?[]:(t=e,"[object String]"===n.call(t)?i(e,r):function(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length}(e)?i(e,s):function(e,t){t=t||s;var n=[];for(var r in e)t(e,r)&&n.push(String(r));return n}(e));var t}}function yi(){if(ai)return pi;ai=1;var e=gi(),t=si().v4,n={_data:{},length:0,setItem:function(t,n){return this._data[t]=n,this.length=e(this._data).length,n},getItem:function(e){return e in this._data?this._data[e]:null},removeItem:function(t){return t in this._data&&delete this._data[t],this.length=e(this._data).length,null},clear:function(){this._data={},this.length=0},key:function(t){return e(this._data)[t]}};return pi.defaultEngine=function(){try{if(!window.localStorage)return!1;var e=t();window.localStorage.setItem(e,"test_value");var n=window.localStorage.getItem(e);return window.localStorage.removeItem(e),"test_value"===n}catch(e){return!1}}()?window.localStorage:n,pi.inMemoryEngine=n,pi}function mi(){if(ui)return ci;ui=1;var e=gi(),t=Object.prototype.toString,n="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===t.call(e)},r=function(e){return null!=e&&(n(e)||"function"!==e&&function(e){var n=typeof e;return"number"===n||"object"===n&&"[object Number]"===t.call(e)}(e.length))},s=function(e,t){for(var n=0;n<t.length&&!1!==e(t[n],n,t);n+=1);},i=function(t,n){for(var r=e(n),s=0;s<r.length&&!1!==t(n[r[s]],r[s],n);s+=1);};return ci=function(e,t){return(r(t)?s:i).call(this,e,t)}}function vi(){if(hi)return li;hi=1;var e=yi().defaultEngine,t=yi().inMemoryEngine,n=mi(),r=gi(),s=JSON;function i(t,n,r,s){this.id=n,this.name=t,this.keys=r||{},this.engine=s||e,this.originalEngine=this.engine}return i.prototype.set=function(e,t){var n=this._createValidKey(e);if(n)try{this.engine.setItem(n,function(e){try{return JSON.stringify(e,function(){const e=[];return function(t,n){if("object"!=typeof n||null===n)return n;for(;e.length>0&&e[e.length-1]!==this;)e.pop();return e.includes(n)?"[Circular Reference]":(e.push(n),n)}}())}catch(e){return null}}(t))}catch(n){(function(e){var t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(n)&&(this._swapEngine(),this.set(e,t))}},i.prototype.get=function(e){try{var t=this.engine.getItem(this._createValidKey(e));return null===t?null:s.parse(t)}catch(e){return null}},i.prototype.getOriginalEngine=function(){return this.originalEngine},i.prototype.remove=function(e){this.engine.removeItem(this._createValidKey(e))},i.prototype._createValidKey=function(e){var t,s=this.name,i=this.id;return r(this.keys).length?(n(function(n){n===e&&(t=[s,i,e].join("."))},this.keys),t):[s,i,e].join(".")},i.prototype._swapEngine=function(){var e=this;n(function(n){var r=e.get(n);t.setItem([e.name,e.id,n].join("."),r),e.remove(n)},this.keys),this.engine=t},li=i}var Ii,Ai,bi,Ei,Si={exports:{}},ki={exports:{}};function wi(){if(Ai)return Ii;Ai=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=365.25*r;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return Ii=function(o,a){a=a||{};var c=typeof o;if("string"===c&&o.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!o)return;var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(o);if("number"===c&&!1===isNaN(o))return a.long?function(s){return i(s,r,"day")||i(s,n,"hour")||i(s,t,"minute")||i(s,e,"second")||s+" ms"}(o):function(s){if(s>=r)return Math.round(s/r)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},Ii}function Ti(){return bi||(bi=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,s=+new Date,i=s-(n||s);e.diff=i,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var s=t.formatters[r];if("function"==typeof s){var i=o[c];n=s.call(e,i),o.splice(c,1),c--}return n}),t.formatArgs.call(e,o),(r.log||t.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=ki.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,s=0;s<r;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=wi(),t.names=[],t.skips=[],t.formatters={}}(0,ki.exports)),ki.exports}var Oi,_i,Ri,Ci={exports:{}};function Pi(){return Oi||(Oi=1,function(){function e(t){if(t)return function(t){for(var n in e.prototype)t[n]=e.prototype[n];return t}(t)}Ci.exports=e,e.prototype.on=e.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},e.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<r.length;s++)if((n=r[s])===t||n.fn===t){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},e.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var s=(n=n.slice(0)).length;r<s;++r)n[r].apply(this,t)}return this},e.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},e.prototype.hasListeners=function(e){return!!this.listeners(e).length}}()),Ci.exports}var xi=function(){if(Ri)return _i;Ri=1;var e=si().v4,t=vi(),n=mi(),r=function(){if(fi)return di;fi=1;var e=mi(),t={setTimeout:function(e,t){return window.setTimeout(e,t)},clearTimeout:function(e){return window.clearTimeout(e)},Date:window.Date},n=t,r={ASAP:1,RESCHEDULE:2,ABANDON:3};function s(){this.tasks={},this.nextId=1}return s.prototype.now=function(){return+new n.Date},s.prototype.run=function(e,t,s){var i=this.nextId++;return this.tasks[i]=n.setTimeout(this._handle(i,e,t,s||r.ASAP),t),i},s.prototype.cancel=function(e){this.tasks[e]&&(n.clearTimeout(this.tasks[e]),delete this.tasks[e])},s.prototype.cancelAll=function(){e(n.clearTimeout,this.tasks),this.tasks={}},s.prototype._handle=function(e,t,n,s){var i=this,o=i.now();return function(){if(delete i.tasks[e],!(s>=r.RESCHEDULE&&o+2*n<i.now()))return t();s===r.RESCHEDULE&&i.run(t,n,s)}},s.setClock=function(e){n=e},s.resetClock=function(){n=t},s.Modes=r,di=s}(),s=(Ei||(Ei=1,function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=Si.exports=Ti()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(0,Si.exports)),Si.exports)("localstorage-retry");function i(e,t){return function(){return e.apply(t,arguments)}}function o(n,s,o){"function"==typeof s&&(o=s),this.name=n,this.id=e(),this.fn=o,this.maxItems=s.maxItems||1/0,this.maxAttempts=s.maxAttempts||1/0,this.backoff={MIN_RETRY_DELAY:s.minRetryDelay||1e3,MAX_RETRY_DELAY:s.maxRetryDelay||3e4,FACTOR:s.backoffFactor||2,JITTER:s.backoffJitter||0},this.timeouts={ACK_TIMER:1e3,RECLAIM_TIMER:3e3,RECLAIM_TIMEOUT:1e4,RECLAIM_WAIT:500},this.keys={IN_PROGRESS:"inProgress",QUEUE:"queue",RECLAIM_START:"reclaimStart",RECLAIM_END:"reclaimEnd",ACK:"ack"},this._schedule=new r,this._processId=0,this._store=new t(this.name,this.id,this.keys),this._store.set(this.keys.IN_PROGRESS,{}),this._store.set(this.keys.QUEUE,[]),this._ack=i(this._ack,this),this._checkReclaim=i(this._checkReclaim,this),this._processHead=i(this._processHead,this),this._running=!1}return Pi()(o.prototype),o.prototype.start=function(){this._running&&this.stop(),this._running=!0,this._ack(),this._checkReclaim(),this._processHead()},o.prototype.stop=function(){this._schedule.cancelAll(),this._running=!1},o.prototype.shouldRetry=function(e,t){return!(t>this.maxAttempts)},o.prototype.getDelay=function(e){var t=this.backoff.MIN_RETRY_DELAY*Math.pow(this.backoff.FACTOR,e);if(this.backoff.JITTER){var n=Math.random(),r=Math.floor(n*this.backoff.JITTER*t);Math.floor(10*n)<5?t-=r:t+=r}return Number(Math.min(t,this.backoff.MAX_RETRY_DELAY).toPrecision(1))},o.prototype.addItem=function(t){this._enqueue({item:t,attemptNumber:0,time:this._schedule.now(),id:e()})},o.prototype.requeue=function(t,n,r,s){this.shouldRetry(t,n,r)?this._enqueue({item:t,attemptNumber:n,time:this._schedule.now()+this.getDelay(n),id:s||e()}):this.emit("discard",t,n)},o.prototype._enqueue=function(e){var t=this._store.get(this.keys.QUEUE)||[];(t=t.slice(-(this.maxItems-1))).push(e),t=t.sort(function(e,t){return e.time-t.time}),this._store.set(this.keys.QUEUE,t),this._running&&this._processHead()},o.prototype._processHead=function(){var t=this,i=this._store;this._schedule.cancel(this._processId);var o=i.get(this.keys.QUEUE)||[],a=i.get(this.keys.IN_PROGRESS)||{},c=this._schedule.now(),u=[];function l(e,n){u.push({item:e.item,done:function(r,s){var o=i.get(t.keys.IN_PROGRESS)||{};delete o[n],i.set(t.keys.IN_PROGRESS,o),t.emit("processed",r,s,e.item),r&&t.requeue(e.item,e.attemptNumber+1,r,e.id)}})}for(var h=Object.keys(a).length;o.length&&o[0].time<=c&&h++<t.maxItems;){var d=o.shift(),f=e();a[f]={item:d.item,attemptNumber:d.attemptNumber,time:t._schedule.now()},l(d,f)}i.set(this.keys.QUEUE,o),i.set(this.keys.IN_PROGRESS,a),n(function(e){try{t.fn(e.item,e.done)}catch(e){s("Process function threw error: "+e)}},u),o=i.get(this.keys.QUEUE)||[],this._schedule.cancel(this._processId),o.length>0&&(this._processId=this._schedule.run(this._processHead,o[0].time-c,r.Modes.ASAP))},o.prototype._ack=function(){this._store.set(this.keys.ACK,this._schedule.now()),this._store.set(this.keys.RECLAIM_START,null),this._store.set(this.keys.RECLAIM_END,null),this._schedule.run(this._ack,this.timeouts.ACK_TIMER,r.Modes.ASAP)},o.prototype._checkReclaim=function(){var e=this;n(function(t){t.id!==e.id&&(e._schedule.now()-t.get(e.keys.ACK)<e.timeouts.RECLAIM_TIMEOUT||function(t){t.set(e.keys.RECLAIM_START,e.id),t.set(e.keys.ACK,e._schedule.now()),e._schedule.run(function(){t.get(e.keys.RECLAIM_START)===e.id&&(t.set(e.keys.RECLAIM_END,e.id),e._schedule.run(function(){t.get(e.keys.RECLAIM_END)===e.id&&t.get(e.keys.RECLAIM_START)===e.id&&e._reclaim(t.id)},e.timeouts.RECLAIM_WAIT,r.Modes.ABANDON))},e.timeouts.RECLAIM_WAIT,r.Modes.ABANDON)}(t))},function(n){for(var r=[],s=e._store.getOriginalEngine(),i=0;i<s.length;i++){var o=s.key(i);if(null!==o){var a=o.split(".");3===a.length&&a[0]===n&&"ack"===a[2]&&r.push(new t(n,a[1],e.keys))}}return r}(this.name)),this._schedule.run(this._checkReclaim,this.timeouts.RECLAIM_TIMER,r.Modes.RESCHEDULE)},o.prototype._reclaim=function(r){var s=this,i=new t(this.name,r,this.keys),o={queue:this._store.get(this.keys.QUEUE)||[]},a={inProgress:i.get(this.keys.IN_PROGRESS)||{},queue:i.get(this.keys.QUEUE)||[]},c=[],u=function(t,r){n(function(t){var n=t.id||e();c.indexOf(n)>=0?s.emit("duplication",t.item,t.attemptNumber):(o.queue.push({item:t.item,attemptNumber:t.attemptNumber+r,time:s._schedule.now(),id:n}),c.push(n))},t)};u(a.queue,0),u(a.inProgress,1),o.queue=o.queue.sort(function(e,t){return e.time-t.time}),this._store.set(this.keys.QUEUE,o.queue);try{this._clearOtherQueue(i,1)}catch(e){if("NS_ERROR_STORAGE_BUSY"===e.name||"NS_ERROR_STORAGE_BUSY"===e.code||2153971713===e.code)try{this._clearOtherQueue(i,40)}catch(e){console.error(e)}else console.error(e)}this._processHead()},o.prototype._clearOtherQueue=function(e,t){setTimeout(()=>{e.remove(this.keys.IN_PROGRESS),setTimeout(()=>{e.remove(this.keys.QUEUE),setTimeout(()=>{e.remove(this.keys.RECLAIM_START),setTimeout(()=>{e.remove(this.keys.RECLAIM_END),setTimeout(()=>{e.remove(this.keys.ACK)},t)},t)},t)},t)},t)},_i=o}(),Di=n(xi);const Li={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:10,maxItems:100};class Mi{constructor(){this.url="",this.writeKey=""}init(t,n,r){this.url=n,this.writeKey=t,r&&e(Li,r),this.payloadQueue=new Di("rudder",Li,(e,t)=>{e.message.sentAt=Ns(),this.processQueueElement(e.url,e.headers,e.message,3e4,(e,n)=>{if(e)return t(e);t(null,n)})}),this.payloadQueue.start()}processQueueElement(e,t,n,r,s){try{const i=new XMLHttpRequest;i.open("POST",e,!0);for(const e in t)i.setRequestHeader(e,t[e]);i.timeout=r,i.ontimeout=s,i.onerror=s,i.onreadystatechange=function(){if(4===i.readyState)if(429===i.status||i.status>=500&&i.status<600){const t=`${Dn} "${i.status}" status text: "${i.statusText}" for URL: "${e}"`,n=new Error(t);Qn(n),s(n)}else s(null,i.status)};const o=Gn(n,!0);o?i.send(o):bn.error("Invalid payload: Event dropped")}catch(e){s(e)}}enqueue(e,t){const n={"Content-Type":"application/json",Authorization:`Basic ${btoa(`${this.writeKey}:`)}`,AnonymousId:btoa(e.anonymousId)};this.payloadQueue.addItem({url:`${this.url}/v1/${t}`,headers:n,message:e})}}const Ni="queue",Bi=64e3;class Gi{constructor(){this.storage=cs,this.maxItems=10,this.flushQueueTimeOut=void 0,this.timeOutActive=!1,this.flushQueueTimeOutInterval=6e5,this.url="",this.writekey="",this.queueName=`${Ni}.${Date.now()}`}sendQueueDataForBeacon(){this.sendDataFromQueueAndDestroyQueue()}init(e,t,n){this.url=t,this.writekey=e,n.maxItems&&(this.maxItems=n.maxItems),n.flushQueueInterval&&(this.flushQueueTimeOutInterval=n.flushQueueInterval),this.sendQueueDataForBeacon=this.sendQueueDataForBeacon.bind(this),this.attachListeners()}attachListeners(){window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.sendQueueDataForBeacon()})}getQueue(){return this.storage.get(this.queueName)}setQueue(e){this.storage.set(this.queueName,e)}enqueue(e){let t=this.getQueue()||[];t=t.slice(-(this.maxItems-1)),t.push(e);let n=t.slice(0);const r={batch:n,sentAt:Ns()},s=Gn(r,!0);s&&s.length>Bi&&(n=t.slice(0,t.length-1),this.flushQueue(n),t=this.getQueue(),t.push(e)),this.setQueue(t),this.setTimer(),t.length===this.maxItems&&this.flushQueue(n)}sendDataFromQueueAndDestroyQueue(){this.sendDataFromQueue(),this.storage.remove(this.queueName)}sendDataFromQueue(){const e=this.getQueue();if(e&&e.length>0){const t=e.slice(0,e.length);this.flushQueue(t)}}flushQueue(e){if(e&&e.length>0){const t=Ns();e.forEach(e=>{e.sentAt=t});const n=Gn({batch:e,sentAt:t},!0);if(null!==n){const e=new Blob([n],{type:"text/plain"}),t=`${this.url}?writeKey=${this.writekey}`;try{"function"!=typeof navigator.sendBeacon&&Qn(new Error("Beacon API is not supported by browser"));navigator.sendBeacon(t,e)||Qn(new Error("Unable to queue data to browser's beacon queue"))}catch(e){e.message=`${e.message} - While sending Beacon data to: ${t}`,Qn(e)}}else bn.error("Invalid payload: Event dropped")}this.setQueue([]),this.clearTimer()}setTimer(){this.timeOutActive||(this.flushQueueTimeOut=setTimeout(this.sendDataFromQueue.bind(this),this.flushQueueTimeOutInterval),this.timeOutActive=!0)}clearTimer(){this.timeOutActive&&(clearTimeout(this.flushQueueTimeOut),this.timeOutActive=!1)}}const Ui=new class{constructor(){this.queue=void 0}initialize(e,t,n){let r={},s=Ls(t);n?.useBeacon&&navigator.sendBeacon?(n.beaconQueueOptions&&null!=n.beaconQueueOptions&&"object"==typeof n.beaconQueueOptions&&(r=n.beaconQueueOptions),s=`${s}/beacon/v1/batch`,this.queue=new Gi):(n?.useBeacon&&bn.info("[EventRepository] sendBeacon feature not available in this browser :: fallback to XHR"),n?.queueOptions&&null!=n.queueOptions&&"object"==typeof n.queueOptions&&(r=n.queueOptions),this.queue=new Mi),this.queue.init(e,s,r)}enqueue(e,t){const n=e.getElementContent();n.originalTimestamp=n.originalTimestamp||Ns(),n.sentAt=Ns();const r=Gn(n,!0);r&&r.length>32e3&&bn.error("[EventRepository] enqueue:: message length greater 32 Kb ",n),this.queue.enqueue(n,t)}},ji={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:1/0};class Fi{constructor(){this.callback=void 0,this.processQueueElements=!1}init(t,n){t&&e(ji,t),n&&(this.callback=n),this.payloadQueue=new Di("rs_events",ji,(e,t)=>{this.processQueueElement(e.type,e.rudderElement,(e,n)=>{if(e)return t(e);t(null,n)})}),this.payloadQueue.start()}activateProcessor(){this.processQueueElements=!0}processQueueElement(e,t,n){try{this.processQueueElements?(Object.setPrototypeOf(t,ei.prototype),this.callback(e,t),n(null)):n(new Error("The queue elements are not ready to be processed yet"))}catch(e){n(e)}}enqueue(e,t){this.payloadQueue.addItem({type:e,rudderElement:t})}}const $i=()=>navigator&&navigator.language,zi=()=>navigator&&navigator.userAgent;function Ki(e=""){return e=e.endsWith("..")?e.substr(0,e.length-2):e,decodeURIComponent(atob(e).split("").map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""))}const Hi=/^[\w.-]+$/,Qi="*";function Vi(e,t,n,r){const s=function(e,t){return[e,(new Date).getTimezoneOffset(),t].join(Qi)}(n,r),i=t||0;return function(e){const t=function(){const e=[];let t;for(let n=0;n<256;n++){t=n;for(let e=0;e<8;e++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();let n=-1;for(let r=0;r<e.length;r++)n=n>>>8^t[255&(n^e.charCodeAt(r))];return(-1^n)>>>0}([s,Math.floor(Date.now()/6e4)-i,e].join(Qi)).toString(36)}function qi(e){const t=function(e){const t=e.split(Qi),n=t.length%2==0;return t.length<4||!n||1!==Number(t.shift())?null:{checksum:t.shift(),serializedIds:t.join(Qi)}}(e);if(!t)return null;const{checksum:n,serializedIds:r}=t;return function(e,t){const n=zi(),r=$i();for(let s=0;s<=1;s+=1)if(Vi(e,s,n,r)===t)return!0;return!1}(r,n)?function(e){const t={},n=e.split(Qi);for(let e=0;e<n.length;e+=2){const r=n[e];if(Hi.test(r)){const s=Ki(n[e+1]);t[r]=s}}return t}(r):null}class Xi{isInitialized=!1;constructor(){if(!window.OneTrust||!window.OnetrustActiveGroups)return void bn.error("OneTrust resources are not accessible.");this.userSetConsentGroupIds=window.OnetrustActiveGroups.split(",").filter(e=>e);const e=window.OneTrust.GetDomainData().Groups;this.userSetConsentGroupNames=[],this.userDeniedConsentGroupIds=[],e.forEach(e=>{const{CustomGroupId:t,GroupName:n}=e;this.userSetConsentGroupIds.includes(t)?this.userSetConsentGroupNames.push(n.toUpperCase().trim()):this.userDeniedConsentGroupIds.push(t)}),this.userSetConsentGroupIds=this.userSetConsentGroupIds.map(e=>e.toUpperCase()),this.isInitialized=!0}isEnabled(e){try{if(!this.isInitialized)return!0;const{oneTrustCookieCategories:t}=e;if(!t)return!0;const n=t.map(e=>e.oneTrustCookieCategory).filter(e=>e);let r=!0;return r=n.every(e=>this.userSetConsentGroupIds.includes(e.toUpperCase().trim())||this.userSetConsentGroupNames.includes(e.toUpperCase().trim())),r}catch(e){return bn.error(`Error during onetrust cookie consent management ${e}`),!0}}getDeniedList(){return this.isInitialized?this.userDeniedConsentGroupIds:[]}}class Wi{constructor(){if(this.userConsentedPurposes=[],this.userDeniedPurposes=[],window.updateKetchConsent=e=>{e&&(this.userConsentedPurposes=[],this.userDeniedPurposes=[],this.updatePurposes(e))},window.getKetchUserConsentedPurposes=()=>this.userConsentedPurposes.slice(),window.getKetchUserDeniedPurposes=()=>this.userDeniedPurposes.slice(),window.ketchConsent)this.updatePurposes(window.ketchConsent);else{const e=this.getConsent();this.updatePurposes(e)}}updatePurposes=e=>{e&&Object.entries(e).forEach(e=>{const t=e[0];e[1]?this.userConsentedPurposes.push(t):this.userDeniedPurposes.push(t)})};isEnabled(e){try{const{ketchConsentPurposes:t}=e;if(!t||0===t.length)return!0;const n=t.map(e=>e.purpose).filter(e=>e);let r=!0;return r=n.some(e=>this.userConsentedPurposes.includes(e.trim())),r}catch(e){return bn.error(`Error occured checking ketch consent state ${e}`),!0}}getDeniedList(){return this.userDeniedPurposes}getConsent(){const e=rs.get("_ketch_consent_v1_");if(!e)return;let t;try{t=JSON.parse(atob(e))}catch(e){return void bn.error(`Error occurred while parsing consent cookie ${e}`)}if(!t)return;const n={};return Object.entries(t).forEach(e=>{const t=e[0],r=e[1];r?.status&&(n[t]="granted"===r.status)}),n}}const Yi={initialize:e=>e?.oneTrust?.enabled?new Xi:e?.ketch?.enabled?new Wi:null};const Ji=new class{constructor(){this.storage=ws,this.timeout=18e5,this.sessionInfo=this.storage.getSessionInfo()||{autoTrack:!0}}initialize(e){try{if(this.sessionInfo.autoTrack=!(!1===e?.sessions?.autoTrack||this.sessionInfo.manualTrack),e?.sessions&&!isNaN(e.sessions.timeout)){const{timeout:t}=e.sessions;0===t&&(bn.warn("[Session]:: Provided timeout value 0 will disable the auto session tracking feature."),this.sessionInfo.autoTrack=!1),t>0&&t<1e4&&bn.warn('[Session]:: It is not advised to set "timeout" less than 10 seconds'),this.timeout=t}this.sessionInfo.autoTrack?this.startAutoTracking():!1!==this.sessionInfo.autoTrack||this.sessionInfo.manualTrack||this.end()}catch(e){Qn(e)}}isValidSession(e){return e<=this.sessionInfo.expiresAt}generateSessionId(){return Date.now()}startAutoTracking(){const e=Date.now();this.isValidSession(e)||(this.sessionInfo={},this.sessionInfo.id=e,this.sessionInfo.expiresAt=e+this.timeout,this.sessionInfo.sessionStart=!0,this.sessionInfo.autoTrack=!0),this.storage.setSessionInfo(this.sessionInfo)}validateSessionId(e){if("number"==typeof e&&e%1==0){var t;if(!(((t=e)?t.toString().length:0)<10))return e;bn.error('[Session]:: "sessionId" should at least be "10" digits long')}else bn.error('[Session]:: "sessionId" should only be a positive integer')}start(e){const t=e?this.validateSessionId(e):this.generateSessionId();this.sessionInfo={id:t||this.generateSessionId(),sessionStart:!0,manualTrack:!0},this.storage.setSessionInfo(this.sessionInfo)}getSessionId(){return this.sessionInfo.autoTrack&&this.isValidSession(Date.now())||this.sessionInfo.manualTrack?this.sessionInfo.id:null}end(){this.sessionInfo={},this.storage.removeSessionInfo()}getSessionInfo(){const e={};if(this.sessionInfo.autoTrack||this.sessionInfo.manualTrack){if(this.sessionInfo.autoTrack){const e=Date.now();this.isValidSession(e)?this.sessionInfo.expiresAt=e+this.timeout:this.startAutoTracking()}this.sessionInfo.sessionStart&&(e.sessionStart=!0,this.sessionInfo.sessionStart=!1),e.sessionId=this.sessionInfo.id,this.storage.setSessionInfo(this.sessionInfo)}return e}reset(){const{manualTrack:e,autoTrack:t}=this.sessionInfo;t?(this.sessionInfo={},this.startAutoTracking()):e&&this.start()}},Zi=["integrations","anonymousId","originalTimestamp"],eo=(e,t,n)=>{let r="";if(n){if(r=Ls(n),!r){const e="CDN base URL for integrations is not valid";throw Qn({message:`[Analytics] load:: ${e}`}),Error(`Failed to load Rudder SDK: ${e}`)}return r}const{sdkURL:s}=(()=>{const e=document.getElementsByTagName("script");let t;for(let n=0;n<e.length;n+=1){const r=Ls(e[n].getAttribute("src"));if(r&&r.match(/^.*rudder-analytics?(\.min)?\.js$/)){t=r;break}}return{sdkURL:t}})();return r=s?s.split("/").slice(0,-1).concat(wn).join("/"):Tn,t&&(r=r.replace(kn,e)),r},to="rs-bugsnag",no=["rudder-analytics.min.js","rudder-analytics.js",...Object.keys(b).map(e=>`${b[e]}.min.js`),...Object.keys(b).map(e=>`${b[e]}.js`)],ro=()=>{const e=window.location.hostname;return e&&["www.test-host.com","localhost","127.0.0.1","[::1]"].includes(e)?"development":"production"};class so{constructor(e,t,n){this.pluginName=to,this.sourceId=e,this.writeKey=t,this.onClientReady=n,this.initClientOnLibReadyInterval=void 0,this.init()}init(){window.RudderStackGlobals}initClient(){const e=window.bugsnag;this.client=e({apiKey:"0d96a60df267f4a13f808bbaa54e535c",appVersion:"2.52.23",metaData:{SDK:{name:"JS",installType:"npm"}},beforeSend:this.onError(),autoTrackSessions:!1,collectUserIp:!1,enabledBreadcrumbTypes:["error","log","user"],maxEvents:100,releaseStage:ro(),networkBreadcrumbsEnabled:!1,user:{id:this.writeKey}}),this.onClientReady()}onError(){const e=this.sourceId;return t=>{try{return!!(e=>{const t=Mr(e,"stacktrace.0.file");if(!t||"string"!=typeof t)return!1;const n=t.substring(t.lastIndexOf("/")+1);return no.includes(n)})(t)&&(((e,t)=>{e.updateMetaData("source",{metadataSource:t});const{errorMessage:n}=e;e.context=n,n.includes("error in script loading")&&(e.context="Script load failures"),e.severity="error"})(t,e),!0)}catch{return!1}}}notify(e){this.client&&this.client.notify(e)}leaveBreadcrumb(e){this.client&&this.client.leaveBreadcrumb(e)}}const io=to,oo=[to];class ao{constructor(e){this.isEnabled=!1,this.providerName=io,this.provider=void 0,this.logger=e,this.onClientReady=this.onClientReady.bind(this),this.exposeToGlobal=this.exposeToGlobal.bind(this)}init(e,t,n){e&&t?!0===(e=>Mr(e,"statsCollection.errors.enabled")||!1)(e)?(this.enable(),this.setProviderName((e=>Mr(e,"statsCollection.errors.provider"))(e)),this.initProvider(e,t,n)):this.disable():this.logger.error("[Analytics] ErrorReporting :: Invalid configuration or missing source id provided.")}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}setProviderName(e){e?!e||oo.includes(e)?this.providerName=e:this.logger.error(`[Analytics] ErrorReporting :: Invalid error reporting provider value. Value should be one of: ${oo.join(",")}`):this.providerName=io}initProvider(e,t,n){if(this.providerName===to)this.provider=new so(t,n,this.onClientReady)}onClientReady(){this.exposeToGlobal()}exposeToGlobal(){window.RudderStackGlobals||(window.RudderStackGlobals={}),window.RudderStackGlobals[Mn]=this}leaveBreadcrumb(e){if(this.provider)try{this.provider.leaveBreadcrumb(e)}catch(e){this.logger.error(`[Analytics] ErrorReporting :: leaveBreadcrumb method ${e.toString()}`)}}notify(e){if(this.provider)try{this.provider.notify(e)}catch(e){this.logger.error(`[Analytics] ErrorReporting :: notify method ${e.toString()}`)}}}const co=new class{constructor(){this.retryAttempt=3,this.queue=[],this.isTransformationProcessing=!1,this.authToken=null}init(e,t,n){this.dataPlaneUrl=Ls(t),this.writeKey=e,this.authToken=n||this.authToken,this.start()}enqueue(e,t,n){this.queue.push({event:e,destinationIds:t,cb:n})}sendEventForTransformation(e,t){return new Promise((n,r)=>{const s=`${this.dataPlaneUrl}/transform`,i={"Content-Type":"application/json",Authorization:`Basic ${btoa(`${this.writeKey}:`)}`};try{const o=new XMLHttpRequest;o.open("POST",s,!0),Object.keys(i).forEach(e=>o.setRequestHeader(e,i[e])),o.timeout=1e4,o.onreadystatechange=()=>{if(4===o.readyState)try{const{status:s}=o;let{response:i}=o;switch(s){case 200:return i=JSON.parse(i),void n({status:s,transformedPayload:i.transformedBatch});case 400:return void n({status:s,errorMessage:i?`${i}`:"Invalid request payload"});case 404:return void n({status:s});default:if(t>0){const s=t-1;setTimeout(()=>this.sendEventForTransformation(e,s).then(n).catch(r),500*2**(this.retryAttempt-s))}else n({status:s,errorMessage:"Retries exhausted"})}}catch(e){r(e)}};const a=Gn(e,!0);a?o.send(a):bn.error("Invalid payload: Event dropped")}catch(e){r(e)}})}checkQueueLengthAndProcess(){this.queue.length>0&&this.process()}process(){this.isTransformationProcessing=!0;const e=this.queue.shift(),t=(n=e.event,r=e.destinationIds,{metadata:{"Custom-Authorization":this.authToken},batch:[{orderNo:Date.now(),destinationIds:r,event:n.message}]});var n,r;this.sendEventForTransformation(t,this.retryAttempt).then(t=>{this.isTransformationProcessing=!1,e.cb(t),this.checkQueueLengthAndProcess()}).catch(t=>{Qn("string"==typeof t?t:t.message),this.isTransformationProcessing=!1,e.cb({status:0}),this.checkQueueLengthAndProcess()})}start(){setInterval(()=>{this.isTransformationProcessing||this.checkQueueLengthAndProcess()},100)}setAuthToken(e){this.authToken=e}};const uo=new class{constructor(){this.initialized=!1,this.clientIntegrations=[],this.loadOnlyIntegrations={},this.clientIntegrationObjects=void 0,this.successfullyLoadedIntegration=[],this.failedToBeLoadedIntegration=[],this.toBeProcessedArray=[],this.toBeProcessedByIntegrationArray=[],this.storage=ws,this.eventRepository=Ui,this.preProcessQueue=new Fi,this.sendAdblockPage=!1,this.sendAdblockPageOptions={},this.clientSuppliedCallbacks={},this.readyCallbacks=[],this.methodToCallbackMapping={syncPixel:"syncPixelCallback"},this.loaded=!1,this.loadIntegration=!0,this.bufferDataPlaneEventsUntilReady=!1,this.dataPlaneEventsBufferTimeout=1e4,this.integrationsData={},this.dynamicallyLoadedIntegrations={},this.destSDKBaseURL=Tn,this.cookieConsentOptions={},this.logLevel=void 0,this.clientIntegrationsReady=!1,this.uSession=Ji,this.version="2.52.23",this.lockIntegrationsVersion=!1,this.errorReporting=new ao(bn),this.deniedConsentIds=[],this.transformationHandler=co}initializeUser(e){this.userId=this.storage.getUserId()||"",this.storage.setUserId(this.userId),this.userTraits={};const t=this.storage.getUserTraits();null===t||"object"!=typeof t||Array.isArray(t)||(this.userTraits=t),this.storage.setUserTraits(this.userTraits),this.groupId=this.storage.getGroupId()||"",this.storage.setGroupId(this.groupId),this.groupTraits={};const n=this.storage.getGroupTraits();null===n||"object"!=typeof n||Array.isArray(n)||(this.groupTraits=n),this.storage.setGroupTraits(this.groupTraits),this.anonymousId=this.getAnonymousId(e),this.storage.setAnonymousId(this.anonymousId)}setInitialPageProperties(){if(null==this.storage.getInitialReferrer()&&null==this.storage.getInitialReferringDomain()){const e=Ks();this.storage.setInitialReferrer(e),this.storage.setInitialReferringDomain(Hs(e))}}allModulesInitialized(e=0){return new Promise(t=>{this.clientIntegrations.every(e=>null!=this.dynamicallyLoadedIntegrations[`${b[e.name]}_RS`])||e>=2e4?t(this):this.pause(Kn).then(()=>this.allModulesInitialized(e+Kn).then(t))})}executeReadyCallback(){this.readyCallbacks.forEach(e=>e())}integrationSDKLoaded(e,t){return window[e]?.[t]?.prototype&&void 0!==window[e][t].prototype.constructor}processResponse(e,t){try{let e=t;try{if("string"==typeof t&&(e=JSON.parse(t)),!e||"object"!=typeof e||Array.isArray(e))return void bn.error("Invalid source configuration")}catch(e){return void Qn(e)}try{window.chrome?.runtime?.id||this.errorReporting.init(e.source.config,e.source.id,this.writeKey)}catch(e){Qn(e)}if(this.serverUrl=zs(e,this.serverUrl,this.options),this.eventRepository.initialize(this.writeKey,this.serverUrl,this.options),this.transformationHandler.init(this.writeKey,this.serverUrl,this.storage.getAuthToken()),e.source.destinations.forEach(function(e){e.enabled&&this.clientIntegrations.push({name:e.destinationDefinition.name,config:e.config,destinationInfo:{shouldApplyDeviceModeTransformation:e.shouldApplyDeviceModeTransformation||!1,propagateEventsUntransformedOnError:e.propagateEventsUntransformedOnError||!1,destinationId:e.id}})},this),this.clientIntegrations=js(this.loadOnlyIntegrations,this.clientIntegrations),Object.keys(this.cookieConsentOptions).length>0)try{const e=Yi.initialize(this.cookieConsentOptions);this.deniedConsentIds=e?.getDeniedList(),this.clientIntegrations=this.clientIntegrations.filter(t=>!e||e&&e.isEnabled(t.config))}catch(e){Qn(e)}this.loaded=!0,this.options&&"function"==typeof this.options.onLoaded&&this.options.onLoaded(this),function(e){if(e.toBeProcessedArray.length>0)for(;e.toBeProcessedArray.length>0;){const t=[...e.toBeProcessedArray[0]];e.toBeProcessedArray.shift();const n=t[0];t.shift(),e[n](...t)}}(this),this.clientIntegrations=this.clientIntegrations.filter(e=>!!b[e.name]||(bn.error(`[Analytics] Integration:: ${e.name} not available for initialization`),!1)),this.bufferDataPlaneEventsUntilReady&&setTimeout(()=>{this.processBufferedCloudModeEvents()},this.dataPlaneEventsBufferTimeout),this.errorReporting.leaveBreadcrumb("Starting device-mode initialization"),this.clientIntegrations.forEach(e=>{const t=b[e.name],n=`${t}_RS`,r=`${this.destSDKBaseURL}/${t}.min.js`;window.hasOwnProperty(n)||((e,t,n={})=>{if(document.getElementById(e))return;const r=document.createElement("script");r.src=t,r.async=void 0===n.async||n.async,r.type="text/javascript",r.id=e,!0!==n.skipDatasetAttributes&&(r.setAttribute("data-loader",Hn),void 0!==n.isNonNativeSDK&&r.setAttribute("data-isNonNativeSDK",n.isNonNativeSDK));const s=document.getElementsByTagName("head");if(s.length>0)s[0].insertBefore(r,s[0].firstChild);else{const e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(r,e)}})(n,r,{isNonNativeSDK:!0});const s=this,i=setInterval(()=>{if(s.integrationSDKLoaded(n,t)){const r=window[n];let o;clearInterval(i);try{const i=`[Analytics] processResponse :: trying to initialize integration name:: ${n}`;this.errorReporting.leaveBreadcrumb(i),o=new r[t](e.config,s,e.destinationInfo),o.init(),s.isInitialized(o).then(()=>{s.dynamicallyLoadedIntegrations[n]=r[t]})}catch(e){const t=`[Analytics] 'integration.init()' failed :: ${n} :: ${e.message}`;Qn(e,t),s.failedToBeLoadedIntegration.push(o)}}},100);setTimeout(()=>{clearInterval(i)},zn)});const n=this;this.allModulesInitialized().then(()=>{if(!n.clientIntegrations||0===n.clientIntegrations.length)return this.clientIntegrationsReady=!0,this.executeReadyCallback(),void(this.toBeProcessedByIntegrationArray=[]);n.replayEvents(n)})}catch(e){Qn(e)}}sendDataToDestination(e,t,n){try{if(e[n]){const r=m(t);e[n](r)}}catch(t){const n=`[sendToNative]:: [Destination: ${e.name}]:: `;Qn(t,n)}}sendTransformedDataToDestination(e,t,n){try{Us(t.message.integrations);const r=e.map(e=>e.destinationId);this.transformationHandler.enqueue(t,r,({status:r,transformedPayload:s,errorMessage:i})=>{e.forEach(e=>{try{switch(r){case 200:{const r=s.find(t=>t.id===e.destinationId),i=[];r?.payload.forEach(n=>{if("200"===n.status)i.push(n);else{const r=`[DMT]:: Event transformation unsuccessful for destination "${e.name}". Reason: `;let s="Unknown";"410"===n.status&&(s="Transformation is not available");let o="Dropping the event",a=bn.error;!0===e.propagateEventsUntransformedOnError&&(o="Sending untransformed event to the destination",a=bn.warn,i.push({event:t.message}));a(`${r} ${s}. ${o}.`)}}),i?.forEach(t=>{$n(t.event)&&this.sendDataToDestination(e,{message:t.event},n)});break}case 404:bn.warn("[DMT]:: Transformation server access is denied. The configuration data seems to be out of sync. Sending untransformed event to the destination."),this.sendDataToDestination(e,t,n);break;default:!0===e.propagateEventsUntransformedOnError?(bn.warn(`[DMT]::[Destination: ${e.name}] :: Transformation request failed with status: ${r} ${i}. Sending untransformed event.`),this.sendDataToDestination(e,t,n)):bn.error(`[DMT]::[Destination: ${e.name}] :: Transformation request failed with status: ${r} ${i}. Dropping the event.`)}}catch(t){t instanceof Error&&(t.message=`[DMT]::[Destination:${e.name}]:: ${t.message}`),Qn(t)}})})}catch(e){e instanceof Error&&(e.message=`[DMT]:: ${e.message}`),Qn(e)}}processAndSendEventsToDeviceMode(e,t,n){const r=[],s=[];e.forEach(e=>{try{!this.IsEventBlackListed(t.message.event,e.name)&&(e.shouldApplyDeviceModeTransformation?s.push(e):r.push(e))}catch(e){Qn(e)}}),r.forEach(e=>{this.sendDataToDestination(e,t,n)}),s.length>0&&this.sendTransformedDataToDestination(s,t,n)}queueEventForDataPlane(e,t){const n=t.message.integrations||{All:!0};t.message.integrations=((e,t)=>{const n=m(e),r=Object.keys(t).filter(e=>!(!0===t[e]&&n[e])).reduce((e,n)=>(e[n]=t[n],e),{});return Fn(n,r)})(this.integrationsData,n),this.eventRepository.enqueue(t,e)}processBufferedCloudModeEvents(){this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.activateProcessor()}replayEvents(e){this.errorReporting.leaveBreadcrumb("Started replaying buffered events"),e.clientIntegrationObjects=[],e.clientIntegrationObjects=e.successfullyLoadedIntegration;try{e.clientIntegrationObjects.every(e=>!e.isReady||e.isReady())&&(this.integrationsData=((e,t)=>{let n=m(e);return t.forEach(e=>{if(e.getDataForIntegrationsObject)try{n=Fn(n,e.getDataForIntegrationsObject())}catch(e){bn.debug("[Analytics: prepareDataForIntegrationsObj]",e)}}),n})(this.integrationsData,e.clientIntegrationObjects),e.clientIntegrationsReady=!0,e.executeReadyCallback())}catch(e){Qn(e,"Replay buffered cloud mode events")}this.processBufferedCloudModeEvents(),e.toBeProcessedByIntegrationArray.forEach(t=>{const n=t[0];t.shift(),Object.keys(t[0].message.integrations).length>0&&Gs(t[0].message.integrations);const r=js(t[0].message.integrations,e.clientIntegrationObjects);this.processAndSendEventsToDeviceMode(r,t[0],n)}),e.toBeProcessedByIntegrationArray=[]}pause(e){return new Promise(t=>{setTimeout(t,e)})}isInitialized(e,t=0){return new Promise(n=>{e.isLoaded()?(this.successfullyLoadedIntegration.push(e),n(this)):t>=zn?(this.failedToBeLoadedIntegration.push(e),n(this)):this.pause(Kn).then(()=>this.isInitialized(e,t+Kn).then(n))})}page(e,t,n,r,s){if(this.errorReporting.leaveBreadcrumb("Page event"),!this.loaded)return void this.toBeProcessedArray.push(["page",...arguments]);"function"==typeof r&&(s=r,r=null),"function"==typeof n&&(s=n,r=n=null),"function"==typeof t&&(s=t,r=n=t=null),"function"==typeof e&&(s=e,r=n=t=e=null),"object"==typeof e&&null!=e&&null!=e&&(r=t,n=e,t=e=null),"object"==typeof t&&null!=t&&null!=t&&(r=n,n=t,t=null),"string"==typeof e&&"string"!=typeof t&&(t=e,e=null),this.sendAdblockPage&&"RudderJS-Initiated"!==e&&this.sendSampleRequest();let i=m(n);const o=m(r),a=(new ti).setType("page").build();i||(i={}),t&&(a.message.name=i.name=t),e&&(a.message.category=i.category=e),a.message.properties=this.getPageProperties(i),this.processAndSendDataToDestinations("page",a,o,s)}track(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Track event"),!this.loaded)return void this.toBeProcessedArray.push(["track",...arguments]);"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null);const s=m(t),i=m(n),o=(new ti).setType("track").build();e&&o.setEventName(e),o.setProperty(s||{}),this.processAndSendDataToDestinations("track",o,i,r)}identify(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Identify event"),!this.loaded)return void this.toBeProcessedArray.push(["identify",...arguments]);"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"object"==typeof e&&(n=t,t=e,e=this.userId);const s=Fs(e);s&&this.userId&&s!==this.userId&&this.reset(),this.userId=s,this.storage.setUserId(this.userId);const i=m(t),o=m(n);if(i){for(const e in i)this.userTraits[e]=i[e];this.storage.setUserTraits(this.userTraits)}const a=(new ti).setType("identify").build();this.processAndSendDataToDestinations("identify",a,o,r)}alias(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Alias event"),!this.loaded)return void this.toBeProcessedArray.push(["alias",...arguments]);"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"function"==typeof e&&(r=e,n=null,t=null,e=null),"object"==typeof t&&(n=t,t=null),"object"==typeof e&&(n=e,t=null,e=null);const s=(new ti).setType("alias").build();s.message.previousId=Fs(t)||(this.userId?this.userId:this.getAnonymousId()),s.message.userId=Fs(e);const i=m(n);this.processAndSendDataToDestinations("alias",s,i,r)}group(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Group event"),!this.loaded)return void this.toBeProcessedArray.push(["group",...arguments]);if(0===arguments.length)return;"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"object"==typeof e&&(n=t,t=e,e=this.groupId),"function"==typeof e&&(r=e,n=null,t=null,e=this.groupId),this.groupId=Fs(e),this.storage.setGroupId(this.groupId);const s=m(t),i=m(n),o=(new ti).setType("group").build();if(s)for(const e in s)this.groupTraits[e]=s[e];else this.groupTraits={};this.storage.setGroupTraits(this.groupTraits),this.processAndSendDataToDestinations("group",o,i,r)}IsEventBlackListed(e,t){if(!e||"string"!=typeof e)return!1;const n=In[t],r=this.clientIntegrations.find(e=>e.name===n),{blacklistedEvents:s,whitelistedEvents:i,eventFilteringOption:o}=r.config;if(!o)return!1;const a=e.trim().toUpperCase();switch(o){case"disable":default:return!1;case"blacklistedEvents":return!!Array.isArray(s)&&s.some(e=>e.eventName.trim().toUpperCase()===a);case"whitelistedEvents":return!Array.isArray(i)||!i.some(e=>e.eventName.trim().toUpperCase()===a)}}shouldUseGlobalIntegrationsConfigInEvents(){return this.useGlobalIntegrationsConfigInEvents&&this.loadOnlyIntegrations&&Object.keys(this.loadOnlyIntegrations).length>0}processAndSendDataToDestinations(e,t,n,r){try{this.anonymousId||this.setAnonymousId(),this.errorReporting.leaveBreadcrumb("Started sending data to destinations"),t.message.context.traits={...this.userTraits},t.message.anonymousId=this.anonymousId,t.message.userId=t.message.userId?t.message.userId:this.userId,"group"==e&&(this.groupId&&(t.message.groupId=this.groupId),this.groupTraits&&(t.message.traits={...this.groupTraits}));try{const{sessionId:e,sessionStart:n}=this.uSession.getSessionInfo();t.message.context.sessionId=e,n&&(t.message.context.sessionStart=!0)}catch(e){Qn(e)}(e=>{let t=!1;return Object.keys(e).forEach(n=>{Rn.includes(n)&&"boolean"==typeof e[n].enabled&&!0===e[n].enabled&&(t=!0)}),t})(this.cookieConsentOptions)&&(t.message.context.consentManagement={deniedConsentIds:this.deniedConsentIds||[]}),this.processOptionsParam(t,n),function(e,t){const{properties:n,traits:r,context:s}=e;n&&Object.keys(n).forEach(e=>{En.indexOf(e.toLowerCase())>=0&&bn.error(`Warning! : Reserved keyword used in properties--\x3e ${e} with ${t} call`)}),r&&Object.keys(r).forEach(e=>{En.indexOf(e.toLowerCase())>=0&&bn.error(`Warning! : Reserved keyword used in traits--\x3e ${e} with ${t} call`)});const i=s.traits;i&&Object.keys(i).forEach(e=>{En.indexOf(e.toLowerCase())>=0&&bn.error(`Warning! : Reserved keyword used in traits --\x3e ${e} with ${t} call`)})}(t.message,e);let s=t.message.integrations;s?Gs(s):s=this.shouldUseGlobalIntegrationsConfigInEvents()?this.loadOnlyIntegrations:xn,t.message.integrations=s;try{t.message.context["ua-ch"]=this.uach}catch(e){Qn(e)}try{if(this.clientIntegrationObjects){const n=js(s,this.clientIntegrationObjects);this.processAndSendEventsToDeviceMode(n,t,e)}else this.toBeProcessedByIntegrationArray.push([e,t])}catch(e){Qn(e,"processAndSendEventsToDeviceMode::")}const i=m(t);Us(i.message.integrations);!this.bufferDataPlaneEventsUntilReady||this.clientIntegrationObjects?this.queueEventForDataPlane(e,i):this.preProcessQueue.enqueue(e,i),r&&"function"==typeof r&&r(i)}catch(e){Qn(e)}}utm(e){const t={};try{const n=new URL(e),r="utm_";n.searchParams.forEach((e,n)=>{if(n.startsWith(r)){let s=n.substring(r.length);"campaign"===s&&(s="name"),t[s]=e}})}catch(e){}return t}addCampaignInfo(e){const t=e.message.context;t&&"object"==typeof t&&(e.message.context.campaign=this.utm(window.location.href))}processOptionsParam(e,t){const{type:n,properties:r}=e.message;this.addCampaignInfo(e),e.message.context.page=this.getContextPageProperties("page"===n?r:void 0),((e,t={})=>{"object"==typeof t&&null!==t&&Object.keys(t).forEach(n=>{Zi.includes(n)&&(e[n]=t[n])})})(e.message,t),e.message.context=((e,t={})=>{let{context:n}=e;return"object"!=typeof t||null===t||Object.keys(t).forEach(e=>{if(!Zi.includes(e)&&!Cn.includes(e))if("context"!==e)n=Fn(n,{[e]:t[e]});else if("object"==typeof t[e]&&null!==t[e]){const r={};Object.keys(t[e]).forEach(n=>{Cn.includes(n)||(r[n]=t[e][n])}),n=Fn(n,{...r})}else bn.error(`[Analytics: processOptionsParam] context passed in options ${e} is not object.`)}),n})(e.message,t)}getPageProperties(e,t){const n=Vs(),r=t?.page||{};for(const t in n)void 0===e[t]&&(e[t]=r[t]||n[t]);return e}getContextPageProperties(e){const t=Vs(),n={};for(const r in t)n[r]=e?.[r]?e[r]:t[r];return n}reset(e){this.errorReporting.leaveBreadcrumb(`reset API :: flag: ${e}`),this.loaded?(e&&(this.anonymousId=""),this.userId="",this.userTraits={},this.groupId="",this.groupTraits={},this.uSession.reset(),this.storage.clear(e)):this.toBeProcessedArray.push(["reset",e])}getAnonymousId(e){return this.anonymousId=this.storage.getAnonymousId(e),this.anonymousId||this.setAnonymousId(),this.anonymousId}getUserId(){return this.userId}getSessionId(){return this.uSession.getSessionId()}getUserTraits(){return this.userTraits}getGroupId(){return this.groupId}getGroupTraits(){return this.groupTraits}setAnonymousId(e,t){const n=t?qi(t):null,r=n?n.rs_amp_id:null;this.anonymousId=e||r||Ms(),this.storage.setAnonymousId(this.anonymousId)}isValidWriteKey(e){return e&&"string"==typeof e&&e.trim().length>0}isValidServerUrl(e){return e&&"string"==typeof e&&e.trim().length>0}isDatasetAvailable(){const e=document.createElement("div");return e.setAttribute("data-a-b","c"),!!e.dataset&&"c"===e.dataset.aB}loadAfterPolyfill(t,n,r){if("object"==typeof n&&null!==n&&(r=n,n=null),r?.logLevel&&(this.logLevel=r.logLevel,bn.setLogLevel(r.logLevel)),!this.isValidWriteKey(t))throw Error("Unable to load the SDK due to invalid writeKey");if(!this.storage||0===Object.keys(this.storage).length)throw Error("Cannot proceed as no storage is available");r?.cookieConsentManager&&(this.cookieConsentOptions=r.cookieConsentManager),this.writeKey=t,this.serverUrl=n,this.options=r;let s={};r?.setCookieDomain&&(s={...s,domain:r.setCookieDomain}),r&&"boolean"==typeof r.secureCookie&&(s={...s,secure:r.secureCookie}),r&&"boolean"==typeof r.sameDomainCookiesOnly&&(s={...s,sameDomainCookiesOnly:r.sameDomainCookiesOnly}),r&&-1!==On.indexOf(r.sameSiteCookie)&&(s={...s,samesite:r.sameSiteCookie}),this.storage.options(s);if(r&&"string"==typeof r.uaChTrackLevel&&Pn.includes(r.uaChTrackLevel)&&(this.uaChTrackLevel=r.uaChTrackLevel),navigator.userAgentData&&((e,t="none")=>{"none"===t&&e(void 0),"default"===t&&e(navigator.userAgentData),"full"===t&&navigator.userAgentData.getHighEntropyValues(["architecture","bitness","brands","mobile","model","platform","platformVersion","uaFullVersion","fullVersionList","wow64"]).then(t=>{e(t)})})(e=>{this.uach=e},this.uaChTrackLevel),r?.integrations&&(e(this.loadOnlyIntegrations,r.integrations),Gs(this.loadOnlyIntegrations)),this.useGlobalIntegrationsConfigInEvents=r&&!0===r.useGlobalIntegrationsConfigInEvents,r?.sendAdblockPage&&(this.sendAdblockPage=!0),r?.sendAdblockPageOptions&&"object"==typeof r.sendAdblockPageOptions&&(this.sendAdblockPageOptions=r.sendAdblockPageOptions),this.uSession.initialize(r),r?.clientSuppliedCallbacks){const t={};Object.keys(this.methodToCallbackMapping).forEach(e=>{this.methodToCallbackMapping.hasOwnProperty(e)&&r.clientSuppliedCallbacks[this.methodToCallbackMapping[e]]&&(t[e]=r.clientSuppliedCallbacks[this.methodToCallbackMapping[e]])}),e(this.clientSuppliedCallbacks,t),this.registerCallbacks(!0)}if(null!=r?.loadIntegration&&(this.loadIntegration=!!r.loadIntegration),r&&"boolean"==typeof r.bufferDataPlaneEventsUntilReady&&(this.bufferDataPlaneEventsUntilReady=!0===r.bufferDataPlaneEventsUntilReady,this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.init(this.options,this.queueEventForDataPlane.bind(this))),r&&"number"==typeof r.dataPlaneEventsBufferTimeout&&(this.dataPlaneEventsBufferTimeout=r.dataPlaneEventsBufferTimeout),r&&void 0!==r.lockIntegrationsVersion&&(this.lockIntegrationsVersion=!0===r.lockIntegrationsVersion),this.initializeUser(r?r.anonymousIdOptions:void 0),this.setInitialPageProperties(),this.destSDKBaseURL=eo(this.version,this.lockIntegrationsVersion,r?.destSDKBaseURL),r?.getSourceConfig){if("function"!=typeof r.getSourceConfig)Qn(new Error('option "getSourceConfig" must be a function'));else{const e=r.getSourceConfig();e instanceof Promise?e.then(e=>this.processResponse(200,e)).catch(Qn):this.processResponse(200,e)}return}let i=((e,t)=>{let n=Sn;const r=[];return e&&r.push(`writeKey=${e}`),t&&r.push(`lockIntegrationsVersion=${t}`),r.length>0&&(n=Sn.concat(Sn.includes("?")?"&":"?"),n=n.concat(r.join("&"))),n})(t,this.lockIntegrationsVersion);r?.configUrl&&(i=function(e,t){let n=e;-1===n.indexOf("sourceConfig")&&(n=`${Ls(n)}/sourceConfig/`),n="/"===n.slice(-1)?n:`${n}/`;const r=t.split("?")[1],s=n.split("?");return n=s.length>1&&s[1]!==r?`${s[0]}?${r}`:`${n}?${r}`,n}(r.configUrl,i));try{!function(e,t,n,r){const s=r.bind(e),i=new XMLHttpRequest;i.open("GET",t,!0),i.setRequestHeader("Authorization",`Basic ${btoa(`${n}:`)}`),i.onload=function(){const{status:e,responseText:n}=i;200===e?s(200,n):(Qn(new Error(`${Dn} ${e} for url: ${t}`)),s(e))},i.send()}(this,i,t,this.processResponse)}catch(e){Qn(e)}}arePolyfillsRequired(e){return(!e||"boolean"!=typeof e.polyfillIfRequired||e.polyfillIfRequired)&&(!String.prototype.endsWith||!String.prototype.startsWith||!String.prototype.includes||!Array.prototype.find||!Array.prototype.includes||"function"!=typeof window.URL||"undefined"==typeof Promise||!Object.entries||!Object.values||!String.prototype.replaceAll||!this.isDatasetAvailable()||"function"!=typeof TextDecoder||"function"!=typeof TextEncoder)}load(e,t,n){if(this.loaded)return;const r=m(n);this.arePolyfillsRequired(r),this.loadAfterPolyfill(e,t,r)}ready(e){this.loaded?"function"!=typeof e?bn.error("ready callback is not a function"):this.clientIntegrationsReady?e():this.readyCallbacks.push(e):this.toBeProcessedArray.push(["ready",e])}initializeCallbacks(){Object.keys(this.methodToCallbackMapping).forEach(e=>{this.methodToCallbackMapping.hasOwnProperty(e)&&this.on(e,()=>{})})}registerCallbacks(e){e||Object.keys(this.methodToCallbackMapping).forEach(e=>{this.methodToCallbackMapping.hasOwnProperty(e)&&window.rudderanalytics&&"function"==typeof window.rudderanalytics[this.methodToCallbackMapping[e]]&&(this.clientSuppliedCallbacks[e]=window.rudderanalytics[this.methodToCallbackMapping[e]])}),Object.keys(this.clientSuppliedCallbacks).forEach(e=>{this.clientSuppliedCallbacks.hasOwnProperty(e)&&this.on(e,this.clientSuppliedCallbacks[e])})}sendSampleRequest(){}startSession(e){this.uSession.start(e)}endSession(){this.uSession.end()}setAuthToken(e){"string"==typeof e?(this.storage.setAuthToken(e),this.transformationHandler.setAuthToken(e)):bn.error("Provided input should be in string format")}};a(uo),window.addEventListener("error",e=>{Qn(e,void 0,uo)},!0),uo.initializeCallbacks(),uo.registerCallbacks(!1);const lo="load",ho=window.rudderanalytics,fo=Array.isArray(ho);let po;if(fo){let e=0;for(;e<ho.length;){if(ho[e]&&ho[e][0]===lo){po=ho[e],ho.splice(e,1);break}e+=1}}!function(e){const t="ajs_trait_",n="ajs_prop_";function r(e,t){const n={};return Object.keys(e).forEach(r=>{r.startsWith(t)&&(n[r.substr(t.length)]=e[r])}),n}const s=(e=>{const t={};try{new URL(e).searchParams.forEach((e,n)=>{t[n]=e})}catch(e){}return t})(e);s.ajs_aid&&uo.toBeProcessedArray.push(["setAnonymousId",s.ajs_aid]),s.ajs_uid&&uo.toBeProcessedArray.push(["identify",s.ajs_uid,r(s,t)]),s.ajs_event&&uo.toBeProcessedArray.push(["track",s.ajs_event,r(s,n)])}(window.location.href),fo&&ho.forEach(e=>uo.toBeProcessedArray.push(e)),po&&po.length>0&&(po.shift(),uo[lo](...po));const go=uo.ready.bind(uo),yo=uo.identify.bind(uo),mo=uo.page.bind(uo),vo=uo.track.bind(uo),Io=uo.alias.bind(uo),Ao=uo.group.bind(uo),bo=uo.reset.bind(uo),Eo=uo.load.bind(uo),So=uo.initialized=!0,ko=uo.getUserId.bind(uo),wo=uo.getSessionId.bind(uo),To=uo.getUserTraits.bind(uo),Oo=uo.getAnonymousId.bind(uo),_o=uo.setAnonymousId.bind(uo),Ro=uo.getGroupId.bind(uo),Co=uo.getGroupTraits.bind(uo),Po=uo.startSession.bind(uo),xo=uo.endSession.bind(uo),Do=uo.setAuthToken.bind(uo);bn.error("This RudderStack JavaScript SDK package is deprecated and no longer maintained. While your events are still being tracked and delivered, we strongly recommend you to migrate to the latest [@rudderstack/analytics-js](https://www.npmjs.com/package/@rudderstack/analytics-js) package for enhanced features, security updates, and ongoing support. For more details, visit the migration guide: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/migration-guide/."),exports.alias=Io,exports.endSession=xo,exports.getAnonymousId=Oo,exports.getGroupId=Ro,exports.getGroupTraits=Co,exports.getSessionId=wo,exports.getUserId=ko,exports.getUserTraits=To,exports.group=Ao,exports.identify=yo,exports.initialized=So,exports.load=Eo,exports.page=mo,exports.ready=go,exports.reset=bo,exports.setAnonymousId=_o,exports.setAuthToken=Do,exports.startSession=Po,exports.track=vo;
1
+ "use strict";function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(null,arguments)}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&1===Object.keys(e).length?e.default:e}var s,i={exports:{}};function o(){return s||(s=1,function(t){function n(t){if(t)return function(t){return e(t,n.prototype),t._callbacks=new Map,t}(t);this._callbacks=new Map}n.prototype.on=function(e,t){const n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},n.prototype.once=function(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},n.prototype.off=function(e,t){if(void 0===e&&void 0===t)return this._callbacks.clear(),this;if(void 0===t)return this._callbacks.delete(e),this;const n=this._callbacks.get(e);if(n){for(const[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}0===n.length?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},n.prototype.emit=function(e,...t){const n=this._callbacks.get(e);if(n){const e=[...n];for(const n of e)n.apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks.get(e)??[]},n.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(const e of this._callbacks.values())t+=e.length;return t},n.prototype.hasListeners=function(e){return this.listenerCount(e)>0},n.prototype.addEventListener=n.prototype.on,n.prototype.removeListener=n.prototype.off,n.prototype.removeEventListener=n.prototype.off,n.prototype.removeAllListeners=n.prototype.off,t.exports=n}(i)),i.exports}var a=n(o());function c(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function u(e){return function t(n){return 0===arguments.length||c(n)?t:e.apply(this,arguments)}}function l(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return c(n)?t:u(function(t){return e(n,t)});default:return c(n)&&c(r)?t:c(n)?u(function(t){return e(t,r)}):c(r)?u(function(t){return e(n,t)}):e(n,r)}}}function h(e){return function t(n,r,s){switch(arguments.length){case 0:return t;case 1:return c(n)?t:l(function(t,r){return e(n,t,r)});case 2:return c(n)&&c(r)?t:c(n)?l(function(t,n){return e(t,r,n)}):c(r)?l(function(t,r){return e(n,t,r)}):u(function(t){return e(n,r,t)});default:return c(n)&&c(r)&&c(s)?t:c(n)&&c(r)?l(function(t,n){return e(t,n,s)}):c(n)&&c(s)?l(function(t,n){return e(t,r,n)}):c(r)&&c(s)?l(function(t,r){return e(n,t,r)}):c(n)?u(function(t){return e(t,r,s)}):c(r)?u(function(t){return e(n,t,s)}):c(s)?u(function(t){return e(n,r,t)}):e(n,r,s)}}}function d(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var f=u(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function p(e){return"[object Object]"===Object.prototype.toString.call(e)}function g(e,t,n){if(n||(n=new y),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var r,s=function(t){var r=n.get(e);if(r)return r;for(var s in n.set(e,t),e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=g(e[s],!0,n));return t};switch(f(e)){case"Object":return s(Object.create(Object.getPrototypeOf(e)));case"Array":return s(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return r=e,new RegExp(r.source,r.flags?r.flags:(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.sticky?"y":"")+(r.unicode?"u":"")+(r.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var y=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var n=this.hash(e),r=this.map[n];r||(this.map[n]=r=[]),r.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var n in e)t.push(Object.prototype.toString.call(e[n]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var n=this.map[t],r=0;r<n.length;r+=1){if((i=n[r])[0]===e)return i[1]}else{var s=this.hash(e);if(n=this.map[s])for(r=0;r<n.length;r+=1){var i;if((i=n[r])[0]===e)return i[1]}}},e}(),m=u(function(e){return null!=e&&"function"==typeof e.clone?e.clone():g(e)}),v=h(function(e,t,n){var r,s={};for(r in n=n||{},t=t||{})d(r,t)&&(s[r]=d(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)d(r,n)&&!d(r,s)&&(s[r]=n[r]);return s}),I=h(function e(t,n,r){return v(function(n,r,s){return p(r)&&p(s)?e(t,r,s):t(n,r,s)},n,r)}),A=h(function(e,t,n){return I(function(t,n,r){return e(n,r)},t,n)});const b={HS:"HubSpot",GA:"GA",HOTJAR:"Hotjar",GOOGLEADS:"GoogleAds",VWO:"VWO",GTM:"GoogleTagManager",BRAZE:"Braze",INTERCOM:"INTERCOM",KEEN:"Keen",KISSMETRICS:"Kissmetrics",CUSTOMERIO:"CustomerIO",CHARTBEAT:"Chartbeat",FACEBOOK_PIXEL:"FacebookPixel",LOTAME:"Lotame",OPTIMIZELY:"Optimizely",BUGSNAG:"Bugsnag",FULLSTORY:"Fullstory",TVSQUARED:"TVSquared",GA4:"GA4",GA4_V2:"GA4_V2",MOENGAGE:"MoEngage",AM:"Amplitude",PENDO:"Pendo",LYTICS:"Lytics",APPCUES:"Appcues",POSTHOG:"Posthog",KLAVIYO:"Klaviyo",CLEVERTAP:"Clevertap",BINGADS:"BingAds",PINTEREST_TAG:"PinterestTag",ADOBE_ANALYTICS:"AdobeAnalytics",LINKEDIN_INSIGHT_TAG:"LinkedInInsightTag",REDDIT_PIXEL:"RedditPixel",DRIP:"Drip",HEAP:"Heap",CRITEO:"Criteo",MP:"Mixpanel",QUALTRICS:"Qualtrics",PROFITWELL:"ProfitWell",SENTRY:"Sentry",QUANTUMMETRIC:"QuantumMetric",SNAP_PIXEL:"SnapPixel",POST_AFFILIATE_PRO:"PostAffiliatePro",GOOGLE_OPTIMIZE:"GoogleOptimize",LAUNCHDARKLY:"LaunchDarkly",GA360:"GA360",ADROLL:"Adroll",DCM_FLOODLIGHT:"DCMFloodlight",MATOMO:"Matomo",VERO:"Vero",MOUSEFLOW:"Mouseflow",ROCKERBOX:"Rockerbox",CONVERTFLOW:"ConvertFlow",SNAPENGAGE:"SnapEngage",LIVECHAT:"LiveChat",SHYNET:"Shynet",WOOPRA:"Woopra",ROLLBAR:"RollBar",QUORA_PIXEL:"QuoraPixel",JUNE:"June",ENGAGE:"Engage",ITERABLE:"Iterable",YANDEX_METRICA:"YandexMetrica",REFINER:"Refiner",QUALAROO:"Qualaroo",PODSIGHTS:"Podsights",AXEPTIO:"Axeptio",SATISMETER:"Satismeter",MICROSOFT_CLARITY:"MicrosoftClarity",SENDINBLUE:"Sendinblue",OLARK:"Olark",LEMNISK:"Lemnisk",OPENAI_ADS:"OpenAIAds",TIKTOK_ADS:"TiktokAds",ACTIVE_CAMPAIGN:"ActiveCampaign",SPRIG:"Sprig",SPOTIFYPIXEL:"SpotifyPixel",COMMANDBAR:"CommandBar",NINETAILED:"Ninetailed",XPIXEL:"XPixel",GAINSIGHT_PX:"Gainsight_PX",USERPILOT:"Userpilot",COMSCORE:"Comscore"},E="ACTIVE_CAMPAIGN",S="ADOBE_ANALYTICS",k="ADROLL",w="AM",T="APPCUES",O="AXEPTIO",_="BINGADS",R="BRAZE",C="BUGSNAG",P="CHARTBEAT",x="CLEVERTAP",D="COMMANDBAR",L="COMSCORE",M="CONVERTFLOW",N="CRITEO",B="CUSTOMERIO",G="DCM_FLOODLIGHT",U="DRIP",j="ENGAGE",F="FACEBOOK_PIXEL",$="FULLSTORY",z="GA",K="GA360",H="GA4",Q="GA4_V2",V="GAINSIGHT_PX",q="GOOGLE_OPTIMIZE",X="GOOGLEADS",W="GTM",Y="HEAP",J="HOTJAR",Z="HS",ee="INTERCOM",te="ITERABLE",ne="JUNE",re="KEEN",se="KISSMETRICS",ie="KLAVIYO",oe="LAUNCHDARKLY",ae="LEMNISK",ce="LINKEDIN_INSIGHT_TAG",ue="LIVECHAT",le="LOTAME",he="LYTICS",de="MATOMO",fe="MICROSOFT_CLARITY",pe="MOENGAGE",ge="MOUSEFLOW",ye="MP",me="NINETAILED",ve="OLARK",Ie="OPTIMIZELY",Ae="PENDO",be="PINTEREST_TAG",Ee="PODSIGHTS",Se="POST_AFFILIATE_PRO",ke="POSTHOG",we="PROFITWELL",Te="QUALAROO",Oe="QUALTRICS",_e="QUANTUMMETRIC",Re="QUORA_PIXEL",Ce="REDDIT_PIXEL",Pe="REFINER",xe="ROCKERBOX",De="ROLLBAR",Le="SATISMETER",Me="SENDINBLUE",Ne="SENTRY",Be="SHYNET",Ge="SNAP_PIXEL",Ue="SNAPENGAGE",je="SPOTIFYPIXEL",Fe="SPRIG",$e="TIKTOK_ADS",ze="TVSQUARED",Ke="USERPILOT",He="VERO",Qe="VWO",Ve="WOOPRA",qe="XPIXEL",Xe="YANDEX_METRICA",We={"Adobe Analytics":S,ADOBEANALYTICS:S,"ADOBE ANALYTICS":S,[S]:S,AdobeAnalytics:S,adobeanalytics:S,"adobe analytics":S,"Adobe analytics":S,"adobe Analytics":S},Ye={[w]:w,AMPLITUDE:w,Amplitude:w,am:w},Je={[T]:T,Appcues:T,"App Cues":T,appcues:T},Ze={[_]:_,BingAds:_,bingads:_,"Bing Ads":_,"Bing ads":_,"bing Ads":_,"bing ads":_},et={[R]:R,Braze:R,braze:R},tt={[C]:C,bugsnag:C,Bugsnag:C},nt={[P]:P,Chartbeat:P,chartbeat:P,"Chart Beat":P,"chart beat":P},rt={[x]:x,Clevertap:x,clevertap:x},st={[N]:N,Criteo:N,criteo:N},it={[B]:B,Customerio:B,"Customer.io":B,"CUSTOMER.IO":B,"customer.io":B},ot={[U]:U,Drip:U,drip:U},at={[F]:F,"FB Pixel":F,"Facebook Pixel":F,"facebook pixel":F,fbpixel:F,FBPIXEL:F,FB_PIXEL:F},ct={[$]:$,Fullstory:$,FullStory:$,"full Story":$,"Full Story":$,"Full story":$,"full story":$,fullstory:$},ut={[z]:z,"Google Analytics":z,GoogleAnalytics:z,"GOOGLE ANALYTICS":z,"google analytics":z},lt={[H]:H,"Google Analytics 4":H,"Google analytics 4":H,"google analytics 4":H,"Google Analytics4":H,"Google analytics4":H,"google analytics4":H,"Google Analytics 4 (GA4)":H,"google analytics 4 (ga4)":H,GoogleAnalytics4:H},ht={[Q]:Q,"Google Analytics 4 V2":Q,"Google analytics 4 V2":Q,"google analytics 4 V2":Q,"Google Analytics4 V2":Q,"Google analytics4 V2":Q,"google analytics4 V2":Q,"Google Analytics 4 (GA4) V2":Q,"google analytics 4 (ga4) V2":Q,GoogleAnalytics4V2:Q},dt={[X]:X,"Google Ads":X,GoogleAds:X,"GOOGLE ADS":X,"google ads":X,googleads:X},ft={[q]:q,"Google Optimize":q,GoogleOptimize:q,Googleoptimize:q,GOOGLEOPTIMIZE:q,"google optimize":q,"Google optimize":q,"GOOGLE OPTIMIZE":q},pt={[W]:W,"Google Tag Manager":W,"google tag manager":W,"googletag manager":W,googletagmanager:W},gt={[Y]:Y,Heap:Y,heap:Y,"Heap.io":Y},yt={[J]:J,Hotjar:J,hotjar:J,"Hot Jar":J,"hot jar":J},mt={[Z]:Z,Hubspot:Z,HUBSPOT:Z,"hub spot":Z,"Hub Spot":Z,"Hub spot":Z},vt={[ee]:ee,Intercom:ee,intercom:ee},It={[re]:re,Keen:re,"Keen.io":re,keen:re,"keen.io":re},At={[se]:se,Kissmetrics:se,kissmetrics:se},bt={[ie]:ie,Klaviyo:ie,klaviyo:ie},Et={[oe]:oe,LaunchDarkly:oe,Launch_Darkly:oe,"Launch Darkly":oe,launchDarkly:oe,"launch darkly":oe},St={[ce]:ce,"LinkedIn Insight Tag":ce,"LinkedIn insight tag":ce,"linkedIn insight tag":ce,Linkedin_insight_tag:ce,LinkedinInsighttag:ce,LinkedinInsightTag:ce,LinkedInInsightTag:ce,Linkedininsighttag:ce,LINKEDININSIGHTTAG:ce,linkedininsighttag:ce},kt={[le]:le,Lotame:le,lotame:le},wt={[he]:he,Lytics:he,lytics:he},Tt={[ye]:ye,MIXPANEL:ye,Mixpanel:ye,"MIX PANEL":ye,"Mix panel":ye,"Mix Panel":ye},Ot={[pe]:pe,MoEngage:pe,moengage:pe,Moengage:pe,"Mo Engage":pe,"mo engage":pe,"Mo engage":pe},_t={[Ie]:Ie,Optimizely:Ie,optimizely:Ie},Rt={[Ae]:Ae,Pendo:Ae,pendo:Ae},Ct={[be]:be,PinterestTag:be,Pinterest_Tag:be,PINTERESTTAG:be,pinterest:be,PinterestAds:be,Pinterest_Ads:be,Pinterest:be,"Pinterest Tag":be,"Pinterest tag":be,"PINTEREST TAG":be,"pinterest tag":be,"Pinterest Ads":be,"Pinterest ads":be},Pt={[Se]:Se,PostAffiliatePro:Se,Post_affiliate_pro:Se,"Post Affiliate Pro":Se,"Post affiliate pro":Se,"post affiliate pro":Se,postaffiliatepro:Se,POSTAFFILIATEPRO:Se},xt={[ke]:ke,PostHog:ke,Posthog:ke,posthog:ke,"Post Hog":ke,"Post hog":ke,"post hog":ke},Dt={[we]:we,ProfitWell:we,profitwell:we,Profitwell:we,"Profit Well":we,"profit well":we,"Profit well":we},Lt={[Oe]:Oe,Qualtrics:Oe,qualtrics:Oe},Mt={[_e]:_e,"Quantum Metric":_e,"quantum Metric":_e,"quantum metric":_e,QuantumMetric:_e,quantumMetric:_e,quantummetric:_e,Quantum_Metric:_e},Nt={[Ce]:Ce,Reddit_Pixel:Ce,RedditPixel:Ce,REDDITPIXEL:Ce,redditpixel:Ce,"Reddit Pixel":Ce,"REDDIT PIXEL":Ce,"reddit pixel":Ce},Bt={[Ne]:Ne,sentry:Ne,Sentry:Ne},Gt={[Ge]:Ge,Snap_Pixel:Ge,SnapPixel:Ge,SNAPPIXEL:Ge,snappixel:Ge,"Snap Pixel":Ge,"SNAP PIXEL":Ge,"snap pixel":Ge},Ut={[ze]:ze,TVSquared:ze,tvsquared:ze,tvSquared:ze,TvSquared:ze,Tvsquared:ze,"TV Squared":ze,"tv squared":ze,"tv Squared":ze},jt={[Qe]:Qe,VisualWebsiteOptimizer:Qe,Visualwebsiteoptimizer:Qe,visualwebsiteoptimizer:Qe,vwo:Qe,"Visual Website Optimizer":Qe,"Visual website optimizer":Qe,"visual website optimizer":Qe},Ft={[K]:K,"Google Analytics 360":K,"Google analytics 360":K,"google analytics 360":K,"Google Analytics360":K,"Google analytics360":K,"google analytics360":K,GoogleAnalytics360:K,"GA 360":K},$t={[k]:k,Adroll:k,"Ad roll":k,"ad roll":k,adroll:k},zt={[G]:G,"DCM Floodlight":G,"dcm floodlight":G,"Dcm Floodlight":G,DCMFloodlight:G,dcmfloodlight:G,DcmFloodlight:G,dcm_floodlight:G,DCM_Floodlight:G},Kt={[de]:de,Matomo:de,matomo:de},Ht={[He]:He,Vero:He,vero:He},Qt={[ge]:ge,Mouseflow:ge,mouseflow:ge,mouseFlow:ge,MouseFlow:ge,"Mouse flow":ge,"mouse flow":ge,"mouse Flow":ge,"Mouse Flow":ge},Vt={[xe]:xe,Rockerbox:xe,rockerbox:xe,RockerBox:xe,"Rocker box":xe,"rocker box":xe,"Rocker Box":xe},qt={[M]:M,Convertflow:M,convertflow:M,convertFlow:M,ConvertFlow:M,"Convert flow":M,"convert flow":M,"convert Flow":M,"Convert Flow":M,"CONVERT FLOW":M},Xt={[Ue]:Ue,SnapEngage:Ue,Snap_Engage:Ue,snapengage:Ue,"SNAP ENGAGE":Ue,"Snap Engage":Ue,"snap engage":Ue},Wt={[ue]:ue,LiveChat:ue,Live_Chat:ue,livechat:ue,"LIVE CHAT":ue,"Live Chat":ue,"live chat":ue},Yt={[Be]:Be,shynet:Be,ShyNet:Be,shyNet:Be,Shynet:Be,"shy net":Be,"Shy Net":Be,"shy Net":Be,"Shy net":Be},Jt={[Ve]:Ve,Woopra:Ve,woopra:Ve},Zt={[De]:De,RollBar:De,Roll_Bar:De,rollbar:De,Rollbar:De,"ROLL BAR":De,"Roll Bar":De,"roll bar":De},en={[Re]:Re,"Quora Pixel":Re,"Quora pixel":Re,"QUORA PIXEL":Re,QuoraPixel:Re,Quorapixel:Re,QUORAPIXEL:Re,Quora_Pixel:Re,quora_pixel:Re,Quora:Re},tn={[ne]:ne,June:ne,june:ne},nn={[j]:j,Engage:j,engage:j},rn={[te]:te,Iterable:te,iterable:te},sn={[Xe]:Xe,Yandexmetrica:Xe,yandexmetrica:Xe,yandexMetrica:Xe,YandexMetrica:Xe},on={[Pe]:Pe,Refiner:Pe,refiner:Pe},an={[Te]:Te,Qualaroo:Te,qualaroo:Te},cn={[Ee]:Ee,Podsights:Ee,PodSights:Ee,"pod Sights":Ee,"Pod Sights":Ee,"pod sights":Ee,"POD SIGHTS":Ee,"Pod sights":Ee},un={[O]:O,Axeptio:O,axeptio:O},ln={[Le]:Le,Satismeter:Le,SatisMeter:Le},hn={[fe]:fe,"Microsoft Clarity":fe,"Microsoft clarity":fe,"microsoft clarity":fe,Microsoft_clarity:fe,MicrosoftClarity:fe,MICROSOFTCLARITY:fe,microsoftclarity:fe,microsoftClarity:fe},dn={[Me]:Me,Sendinblue:Me,sendinblue:Me,SendinBlue:Me},fn={[ve]:ve,Olark:ve,olark:ve},pn={[ae]:ae,LEMNISK_MARKETING_AUTOMATION:ae,"Lemnisk Marketing Automation":ae,LemniskMarketingAutomation:ae,lemniskmarketingautomation:ae,lemniskMarketingAutomation:ae,lemnisk:ae,Lemnisk:ae},gn={[$e]:$e,TiktokAds:$e,"Tiktok ads":$e,"Tiktok Ads":$e,"Tik Tok Ads":$e,"tik tok ads":$e,tiktokads:$e},yn={ActiveCampaign:E,"Active Campaign":E,"ACTIVE CAMPAIGN":E,[E]:E,activecampaign:E,"active campaign":E,"Active campaign":E,"active Campaign":E,active_campaign:E},mn={[Fe]:Fe,Sprig:Fe,sprig:Fe},vn={[je]:je,"Spotify Pixel":je,"spotify pixel":je,SPOTIFY_PIXEL:je},In={All:"All",...We,...Ye,...Je,...Ze,...et,...tt,...{[D]:D,"Command Bar":D,Commandbar:D,COMMAND_BAR:D,commandbar:D},...nt,...rt,...st,...it,...ot,...at,...ct,...ut,...lt,...ht,...Ft,...dt,...ft,...pt,...gt,...yt,...mt,...vt,...It,...At,...bt,...Et,...St,...kt,...wt,...Tt,...Ot,...{[me]:me,Ninetailed:me,ninetailed:me,NineTailed:me},..._t,...Rt,...Ct,...Pt,...xt,...Dt,...Lt,...Mt,...Nt,...Bt,...Gt,...Ut,...jt,...$t,...zt,...Kt,...Ht,...Qt,...qt,...Xt,...Wt,...Yt,...Jt,...Zt,...en,...tn,...nn,...rn,...Vt,...sn,...on,...an,...cn,...un,...ln,...hn,...dn,...fn,...pn,...gn,...yn,...mn,...vn,...{[qe]:qe,XPixel:qe,Xpixel:qe,xpixel:qe,xPixel:qe},...{[V]:V,Gainsight_PX:V},...{[Ke]:Ke,userpilot:Ke,Userpilot:Ke},...{[L]:L,Comscore:L,comscore:L,comScore:L}};let An=3;const bn={setLogLevel(e){switch(e.toUpperCase()){case"INFO":An=1;break;case"DEBUG":An=2;break;default:An=3}},info(...e){An<=1&&console.info(...e)},debug(...e){An<=2&&console.log(...e)},warn(...e){An<=3&&console.warn(...e)},error(...e){An<=4&&console.error(...e)}},En=["anonymous_id","id","sent_at","received_at","timestamp","original_timestamp","event_text","event"],Sn="https://api.rudderstack.com/sourceConfig/?p=npm&v=2.53.0",kn="v1.1",wn="js-integrations",Tn=`https://cdn.rudderlabs.com/${kn}/${wn}`,On=["Lax","None","Strict"],_n=["US","EU"],Rn=["oneTrust","ketch"],Cn=["library","consentManagement"],Pn=["none","default","full"],xn={All:!0},Dn="Request failed with status:",Ln=[Dn],Mn="errorReporting",Nn=e=>{const t=window.RudderStackGlobals?.[Mn];t&&e instanceof Error&&t.notify(e)},Bn=e=>{const t=[];return function(n,r){if(!e||null!=r){if("object"!=typeof r||null===r)return r;for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?(bn.debug(`Circular Reference detected for key: ${n}`),"[Circular Reference]"):(t.push(r),r)}}},Gn=(e,t)=>{try{return JSON.stringify(e,Bn(t))}catch(e){return bn.warn("Failed to convert the value to a JSON string."),null}},Un=e=>null===e,jn=(e,t)=>{if(!Array.isArray(e)||!Array.isArray(t))return m(t);const n=m(e);return t.forEach((e,t)=>{n[t]=Array.isArray(e)||(e=>!Un(e)&&(e=>"object"==typeof e)(e)&&!Array.isArray(e))(e)?Fn(n[t],e):e}),n},Fn=(e,t)=>A(jn,e,t),$n=e=>(e=>!Un(e)&&"[object Object]"===Object.prototype.toString.call(e))(e)&&Object.keys(e).length>0,zn=1e4,Kn=1e3,Hn="RS_JS_SDK",Qn=(e,t,n)=>{let r;try{r=((e,t,n)=>{let r;try{r="string"==typeof e?e:e instanceof Error||e.message?e.message:Gn(e)}catch(e){r=""}if("object"==typeof(s=e)&&null!==s&&"target"in s){if(e.target&&"script"!==e.target.localName)return"";if(e.target.dataset&&(e.target.dataset.loader!==Hn||"true"!==e.target.dataset.isnonnativesdk))return"";if(r=`error in script loading:: src:: ${e.target.src} id:: ${e.target.id}`,"ad-block"===e.target.id)return n.page("RudderJS-Initiated","ad-block page request",{path:"/ad-blocked",title:r},n.sendAdblockPageOptions),""}var s;return`[handleError]::${t||""} "${r}"`})(e,t,n)}catch(t){bn.error("[handleError] Exception:: ",t),bn.error("[handleError] Original error:: ",Gn(e)),Nn(t)}r&&(bn.error(r),(e=>!e.message||!Ln.some(t=>e.message.includes(t)))(e)&&Nn(e))};var Vn={exports:{}};var qn,Xn={exports:{}},Wn=r(Object.freeze({__proto__:null,default:{}}));function Yn(){return qn||(qn=1,Xn.exports=(e=e||function(e,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!==t&&t.crypto&&(r=t.crypto),!r)try{r=Wn}catch(e){}var s=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},a=o.lib={},c=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=t!=n?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,s=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<s;i++){var o=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=o<<24-(r+i)%4*8}else for(var a=0;a<s;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(s());return new u.init(t,e)}}),l=o.enc={},h=l.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],s=0;s<n;s++){var i=t[s>>>2]>>>24-s%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],s=0;s<n;s++){var i=t[s>>>2]>>>24-s%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,s=r.words,i=r.sigBytes,o=this.blockSize,a=i/(4*o),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,l=e.min(4*c,i);if(c){for(var h=0;h<c;h+=o)this._doProcessBlock(s,h);n=s.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=p.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=o.algo={};return o}(Math),e)),Xn.exports;var e}var Jn,Zn={exports:{}};function er(){return Jn?Zn.exports:(Jn=1,Zn.exports=(e=Yn(),function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var s=[],i=0,o=0;o<t;o++)if(o%4){var a=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;s[i>>>2]|=a<<24-i%4*8,i++}return n.create(s,i)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var s=[],i=0;i<n;i+=3)for(var o=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<n;a++)s.push(r.charAt(o>>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;s.length%4;)s.push(c);return s.join("")},parse:function(e){var t=e.length,n=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var i=0;i<n.length;i++)s[n.charCodeAt(i)]=i}var o=n.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return r(e,t,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64));var e}var tr,nr={exports:{}};function rr(){return tr||(tr=1,nr.exports=(e=Yn(),function(t){var n=e,r=n.lib,s=r.WordArray,i=r.Hasher,o=n.algo,a=[];!function(){for(var e=0;e<64;e++)a[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=o.MD5=i.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,s=e[r];e[r]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var i=this._hash.words,o=e[t+0],c=e[t+1],f=e[t+2],p=e[t+3],g=e[t+4],y=e[t+5],m=e[t+6],v=e[t+7],I=e[t+8],A=e[t+9],b=e[t+10],E=e[t+11],S=e[t+12],k=e[t+13],w=e[t+14],T=e[t+15],O=i[0],_=i[1],R=i[2],C=i[3];O=u(O,_,R,C,o,7,a[0]),C=u(C,O,_,R,c,12,a[1]),R=u(R,C,O,_,f,17,a[2]),_=u(_,R,C,O,p,22,a[3]),O=u(O,_,R,C,g,7,a[4]),C=u(C,O,_,R,y,12,a[5]),R=u(R,C,O,_,m,17,a[6]),_=u(_,R,C,O,v,22,a[7]),O=u(O,_,R,C,I,7,a[8]),C=u(C,O,_,R,A,12,a[9]),R=u(R,C,O,_,b,17,a[10]),_=u(_,R,C,O,E,22,a[11]),O=u(O,_,R,C,S,7,a[12]),C=u(C,O,_,R,k,12,a[13]),R=u(R,C,O,_,w,17,a[14]),O=l(O,_=u(_,R,C,O,T,22,a[15]),R,C,c,5,a[16]),C=l(C,O,_,R,m,9,a[17]),R=l(R,C,O,_,E,14,a[18]),_=l(_,R,C,O,o,20,a[19]),O=l(O,_,R,C,y,5,a[20]),C=l(C,O,_,R,b,9,a[21]),R=l(R,C,O,_,T,14,a[22]),_=l(_,R,C,O,g,20,a[23]),O=l(O,_,R,C,A,5,a[24]),C=l(C,O,_,R,w,9,a[25]),R=l(R,C,O,_,p,14,a[26]),_=l(_,R,C,O,I,20,a[27]),O=l(O,_,R,C,k,5,a[28]),C=l(C,O,_,R,f,9,a[29]),R=l(R,C,O,_,v,14,a[30]),O=h(O,_=l(_,R,C,O,S,20,a[31]),R,C,y,4,a[32]),C=h(C,O,_,R,I,11,a[33]),R=h(R,C,O,_,E,16,a[34]),_=h(_,R,C,O,w,23,a[35]),O=h(O,_,R,C,c,4,a[36]),C=h(C,O,_,R,g,11,a[37]),R=h(R,C,O,_,v,16,a[38]),_=h(_,R,C,O,b,23,a[39]),O=h(O,_,R,C,k,4,a[40]),C=h(C,O,_,R,o,11,a[41]),R=h(R,C,O,_,p,16,a[42]),_=h(_,R,C,O,m,23,a[43]),O=h(O,_,R,C,A,4,a[44]),C=h(C,O,_,R,S,11,a[45]),R=h(R,C,O,_,T,16,a[46]),O=d(O,_=h(_,R,C,O,f,23,a[47]),R,C,o,6,a[48]),C=d(C,O,_,R,v,10,a[49]),R=d(R,C,O,_,w,15,a[50]),_=d(_,R,C,O,y,21,a[51]),O=d(O,_,R,C,S,6,a[52]),C=d(C,O,_,R,p,10,a[53]),R=d(R,C,O,_,b,15,a[54]),_=d(_,R,C,O,c,21,a[55]),O=d(O,_,R,C,I,6,a[56]),C=d(C,O,_,R,T,10,a[57]),R=d(R,C,O,_,m,15,a[58]),_=d(_,R,C,O,k,21,a[59]),O=d(O,_,R,C,g,6,a[60]),C=d(C,O,_,R,E,10,a[61]),R=d(R,C,O,_,f,15,a[62]),_=d(_,R,C,O,A,21,a[63]),i[0]=i[0]+O|0,i[1]=i[1]+_|0,i[2]=i[2]+R|0,i[3]=i[3]+C|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,s=8*e.sigBytes;n[s>>>5]|=128<<24-s%32;var i=t.floor(r/4294967296),o=r;n[15+(s+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(s+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,r,s,i,o){var a=e+(t&n|~t&r)+s+o;return(a<<i|a>>>32-i)+t}function l(e,t,n,r,s,i,o){var a=e+(t&r|n&~r)+s+o;return(a<<i|a>>>32-i)+t}function h(e,t,n,r,s,i,o){var a=e+(t^n^r)+s+o;return(a<<i|a>>>32-i)+t}function d(e,t,n,r,s,i,o){var a=e+(n^(t|~r))+s+o;return(a<<i|a>>>32-i)+t}n.MD5=i._createHelper(c),n.HmacMD5=i._createHmacHelper(c)}(Math),e.MD5)),nr.exports;var e}var sr,ir={exports:{}},or={exports:{}};function ar(){return sr||(sr=1,or.exports=(a=Yn(),t=(e=a).lib,n=t.WordArray,r=t.Hasher,s=e.algo,i=[],o=s.SHA1=r.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],s=n[1],o=n[2],a=n[3],c=n[4],u=0;u<80;u++){if(u<16)i[u]=0|e[t+u];else{var l=i[u-3]^i[u-8]^i[u-14]^i[u-16];i[u]=l<<1|l>>>31}var h=(r<<5|r>>>27)+c+i[u];h+=u<20?1518500249+(s&o|~s&a):u<40?1859775393+(s^o^a):u<60?(s&o|s&a|o&a)-1894007588:(s^o^a)-899497514,c=a,a=o,o=s<<30|s>>>2,s=r,r=h}n[0]=n[0]+r|0,n[1]=n[1]+s|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}}),e.SHA1=r._createHelper(o),e.HmacSHA1=r._createHmacHelper(o),a.SHA1)),or.exports;var e,t,n,r,s,i,o,a}var cr,ur={exports:{}};var lr;function hr(){return lr||(lr=1,ir.exports=function(e){return n=(t=e).lib,r=n.Base,s=n.WordArray,i=t.algo,o=i.MD5,a=i.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,i=r.hasher.create(),o=s.create(),a=o.words,c=r.keySize,u=r.iterations;a.length<c;){n&&i.update(n),n=i.update(e).finalize(t),i.reset();for(var l=1;l<u;l++)n=i.finalize(n),i.reset();o.concat(n)}return o.sigBytes=4*c,o}}),t.EvpKDF=function(e,t,n){return a.create(n).compute(e,t)},e.EvpKDF;var t,n,r,s,i,o,a}(Yn(),ar(),cr||(cr=1,ur.exports=(e=Yn(),void function(){var t=e,n=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,s=4*n;t.sigBytes>s&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),a=i.words,c=o.words,u=0;u<n;u++)a[u]^=1549556828,c[u]^=909522486;i.sigBytes=o.sigBytes=s,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}())))),ir.exports;var e}var dr,fr={exports:{}};var pr;var gr,yr,mr=(pr||(pr=1,Vn.exports=function(e){return function(){var t=e,n=t.lib.BlockCipher,r=t.algo,s=[],i=[],o=[],a=[],c=[],u=[],l=[],h=[],d=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var p=r^r<<1^r<<2^r<<3^r<<4;p=p>>>8^255&p^99,s[n]=p,i[p]=n;var g=e[n],y=e[g],m=e[y],v=257*e[p]^16843008*p;o[n]=v<<24|v>>>8,a[n]=v<<16|v>>>16,c[n]=v<<8|v>>>24,u[n]=v,v=16843009*m^65537*y^257*g^16843008*n,l[p]=v<<24|v>>>8,h[p]=v<<16|v>>>16,d[p]=v<<8|v>>>24,f[p]=v,n?(n=g^e[e[e[m^g]]],r^=e[e[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],o=0;o<r;o++)o<n?i[o]=t[o]:(u=i[o-1],o%n?n>6&&o%n==4&&(u=s[u>>>24]<<24|s[u>>>16&255]<<16|s[u>>>8&255]<<8|s[255&u]):(u=s[(u=u<<8|u>>>24)>>>24]<<24|s[u>>>16&255]<<16|s[u>>>8&255]<<8|s[255&u],u^=p[o/n|0]<<24),i[o]=i[o-n]^u);for(var a=this._invKeySchedule=[],c=0;c<r;c++){if(o=r-c,c%4)var u=i[o];else u=i[o-4];a[c]=c<4||o<=4?u:l[s[u>>>24]]^h[s[u>>>16&255]]^d[s[u>>>8&255]]^f[s[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,c,u,s)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,h,d,f,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,s,i,o,a){for(var c=this._nRounds,u=e[t]^n[0],l=e[t+1]^n[1],h=e[t+2]^n[2],d=e[t+3]^n[3],f=4,p=1;p<c;p++){var g=r[u>>>24]^s[l>>>16&255]^i[h>>>8&255]^o[255&d]^n[f++],y=r[l>>>24]^s[h>>>16&255]^i[d>>>8&255]^o[255&u]^n[f++],m=r[h>>>24]^s[d>>>16&255]^i[u>>>8&255]^o[255&l]^n[f++],v=r[d>>>24]^s[u>>>16&255]^i[l>>>8&255]^o[255&h]^n[f++];u=g,l=y,h=m,d=v}g=(a[u>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^n[f++],y=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^n[f++],m=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&l])^n[f++],v=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^n[f++],e[t]=g,e[t+1]=y,e[t+2]=m,e[t+3]=v},keySize:8});t.AES=n._createHelper(g)}(),e.AES}(Yn(),er(),rr(),hr(),dr||(dr=1,fr.exports=(gr=Yn(),hr(),void(gr.lib.Cipher||function(e){var t=gr,n=t.lib,r=n.Base,s=n.WordArray,i=n.BufferedBlockAlgorithm,o=t.enc;o.Utf8;var a=o.Base64,c=t.algo.EvpKDF,u=n.Cipher=i.extend({cfg:r.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?v:y}return function(t){return{encrypt:function(n,r,s){return e(r).encrypt(t,n,r,s)},decrypt:function(n,r,s){return e(r).decrypt(t,n,r,s)}}}}()});n.StreamCipher=u.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=t.mode={},h=n.BlockCipherMode=r.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),d=l.CBC=function(){var t=h.extend();function n(t,n,r){var s,i=this._iv;i?(s=i,this._iv=e):s=this._prevBlock;for(var o=0;o<r;o++)t[n+o]^=s[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,s=r.blockSize;n.call(this,e,t,s),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+s)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,s=r.blockSize,i=e.slice(t,t+s);r.decryptBlock(e,t),n.call(this,e,t,s),this._prevBlock=i}}),t}(),f=(t.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],a=0;a<r;a+=4)o.push(i);var c=s.create(o,r);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};n.BlockCipher=u.extend({cfg:u.cfg.extend({mode:d,padding:f}),reset:function(){var e;u.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var p=n.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?s.create([1398893684,1701076831]).concat(n).concat(t):t).toString(a)},parse:function(e){var t,n=a.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=s.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),p.create({ciphertext:n,salt:t})}},y=n.SerializableCipher=r.extend({cfg:r.extend({format:g}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var s=e.createEncryptor(n,r),i=s.finalize(t),o=s.cfg;return p.create({ciphertext:i,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),m=(t.kdf={}).OpenSSL={execute:function(e,t,n,r,i){if(r||(r=s.random(8)),i)o=c.create({keySize:t+n,hasher:i}).compute(e,r);else var o=c.create({keySize:t+n}).compute(e,r);var a=s.create(o.words.slice(t),4*n);return o.sigBytes=4*t,p.create({key:o,iv:a,salt:r})}},v=n.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:m}),encrypt:function(e,t,n,r){var s=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=s.iv;var i=y.encrypt.call(this,e,t,s.key,r);return i.mixIn(s),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var s=r.kdf.execute(n,e.keySize,e.ivSize,t.salt,r.hasher);return r.iv=s.iv,y.decrypt.call(this,e,t,s.key,r)}})}()))))),Vn.exports),vr=n(mr),Ir={exports:{}};var Ar,br,Er,Sr,kr,wr,Tr=(yr||(yr=1,Ir.exports=function(e){return e.enc.Utf8}(Yn())),Ir.exports),Or=n(Tr),_r=Object.defineProperty,Rr=(e,t)=>_r(e,"name",{value:t,configurable:!0}),Cr=Rr(e=>null!==e&&"object"==typeof e,"isObject"),Pr=Rr((e,t,n)=>"function"==typeof n.join?n.join(e):e[0]+t+e[1],"join"),xr=Rr((e,t,n)=>"function"==typeof n.split?n.split(e):e.split(t),"split"),Dr=Rr((e,t={},n)=>"function"!=typeof n?.isValid||n.isValid(e,t),"isValid"),Lr=Rr(e=>Cr(e)||"function"==typeof e,"isValidObject"),Mr=Rr((e,t,n={})=>{if(Cr(n)||(n={default:n}),!Lr(e))return void 0!==n.default?n.default:e;"number"==typeof t&&(t=String(t));const r=Array.isArray(t),s="string"==typeof t,i=n.separator||".",o=n.joinChar||("string"==typeof i?i:".");if(!s&&!r)return e;let a=e[t];if(void 0===a&&"function"==typeof e.get&&(a=e.get(t)),void 0!==a)return Dr(t,e,n)?a:n.default;const c=r?t:xr(t,i,n),u=c.length;let l=0;do{let t=c[l];for("string"!=typeof t&&(t=String(t));t&&"\\"===t.slice(-1);)t=Pr([t.slice(0,-1),c[++l]||""],o,n);if(a=e[t],void 0===a&&"function"==typeof e.get&&(a=e.get(t)),void 0!==a){if(!Dr(t,e,n))return n.default;e=a}else{let r=!1,s=l+1;for(;s<u;)if(t=Pr([t,c[s++]],o,n),a=e[t],void 0===a&&"function"==typeof e.get&&(a=e.get(t)),r=void 0!==a){if(!Dr(t,e,n))return n.default;e=a,l=s-1;break}if(!r)return n.default}}while(++l<u&&Lr(e));return l===u?e:n.default},"getValue"),Nr={exports:{}},Br={exports:{}};function Gr(){if(br)return Ar;br=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=365.25*r;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return Ar=function(o,a){a=a||{};var c=typeof o;if("string"===c&&o.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!o)return;var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(o);if("number"===c&&!1===isNaN(o))return a.long?function(s){return i(s,r,"day")||i(s,n,"hour")||i(s,t,"minute")||i(s,e,"second")||s+" ms"}(o):function(s){if(s>=r)return Math.round(s/r)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},Ar}function Ur(){return Er||(Er=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,s=+new Date,i=s-(n||s);e.diff=i,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var s=t.formatters[r];if("function"==typeof s){var i=o[c];n=s.call(e,i),o.splice(c,1),c--}return n}),t.formatArgs.call(e,o),(r.log||t.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=Br.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,s=0;s<r;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Gr(),t.names=[],t.skips=[],t.formatters={}}(0,Br.exports)),Br.exports}var jr,Fr,$r,zr,Kr,Hr,Qr,Vr=function(){if(wr)return kr;wr=1;var e=(Sr||(Sr=1,function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=Nr.exports=Ur()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(0,Nr.exports)),Nr.exports)("cookie");function t(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},s=e.split(/ *; */);if(""==s[0])return n;for(var i=0;i<s.length;++i)n[r((t=s[i].split("="))[0])]=r(t[1]);return n}(e)}function n(t){try{return encodeURIComponent(t)}catch(n){e("error `encode(%o)` - %o",t,n)}}function r(t){try{return decodeURIComponent(t)}catch(n){e("error `decode(%o)` - %o",t,n)}}return kr=function(e,r,s){switch(arguments.length){case 3:case 2:return function(e,t,r){r=r||{};var s=n(e)+"="+n(t);null==t&&(r.maxage=-1);r.maxage&&(r.expires=new Date(+new Date+r.maxage));r.path&&(s+="; path="+r.path);r.domain&&(s+="; domain="+r.domain);r.expires&&(s+="; expires="+r.expires.toUTCString());r.samesite&&(s+="; samesite="+r.samesite);r.secure&&(s+="; secure");document.cookie=s}(e,r,s);case 1:return function(e){return t()[e]}(e);default:return t()}}}(),qr=n(Vr),Xr={exports:{}},Wr={exports:{}},Yr={exports:{}};function Jr(){if(Fr)return jr;Fr=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=365.25*r;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return jr=function(o,a){a=a||{};var c=typeof o;if("string"===c&&o.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!o)return;var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(o);if("number"===c&&!1===isNaN(o))return a.long?function(s){return i(s,r,"day")||i(s,n,"hour")||i(s,t,"minute")||i(s,e,"second")||s+" ms"}(o):function(s){if(s>=r)return Math.round(s/r)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},jr}function Zr(){return $r||($r=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,s=+new Date,i=s-(n||s);e.diff=i,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var s=t.formatters[r];if("function"==typeof s){var i=o[c];n=s.call(e,i),o.splice(c,1),c--}return n}),t.formatArgs.call(e,o),(r.log||t.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=Yr.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,s=0;s<r;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Jr(),t.names=[],t.skips=[],t.formatters={}}(0,Yr.exports)),Yr.exports}function es(){if(Hr)return Kr;Hr=1;var e=(zr||(zr=1,function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=Wr.exports=Zr()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(0,Wr.exports)),Wr.exports)("cookie");function t(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},s=e.split(/ *; */);if(""==s[0])return n;for(var i=0;i<s.length;++i)n[r((t=s[i].split("="))[0])]=r(t[1]);return n}(e)}function n(t){try{return encodeURIComponent(t)}catch(n){e("error `encode(%o)` - %o",t,n)}}function r(t){try{return decodeURIComponent(t)}catch(n){e("error `decode(%o)` - %o",t,n)}}return Kr=function(e,r,s){switch(arguments.length){case 3:case 2:return function(e,t,r){r=r||{};var s=n(e)+"="+n(t);null==t&&(r.maxage=-1);r.maxage&&(r.expires=new Date(+new Date+r.maxage));r.path&&(s+="; path="+r.path);r.domain&&(s+="; domain="+r.domain);r.expires&&(s+="; expires="+r.expires.toUTCString());r.secure&&(s+="; secure");document.cookie=s}(e,r,s);case 1:return function(e){return t()[e]}(e);default:return t()}},Kr}var ts=(Qr||(Qr=1,function(e,t){var n=es();function r(e){for(var n=t.cookie,r=t.levels(e),s=0;s<r.length;++s){var i="__tld__",o=r[s],a={domain:"."+o};if(n(i,1,a),n(i))return n(i,null,a),o}return""}r.levels=function(e){var t=("function"!=typeof window.URL?function(e){const t=document.createElement("a");return t.href=e,t.hostname}(e):new URL(e).hostname).split("."),n=t[t.length-1],r=[];if(4===t.length&&n===parseInt(n,10))return r;if(t.length<=1)return r;for(var s=t.length-2;s>=0;--s)r.push(t.slice(s).join("."));return r},r.cookie=n,t=e.exports=r}(Xr,Xr.exports)),Xr.exports),ns=n(ts);const rs=new class{constructor(e){this.cOpts={},this.options(e),this.isSupportAvailable=this.checkSupportAvailability()}options(e={}){if(0===arguments.length)return this.cOpts;let t=`.${ns(window.location.href)}`;return"."===t&&(t=null),this.cOpts=Fn({maxage:31536e6,path:"/",domain:t,samesite:"Lax"},e),e.sameDomainCookiesOnly&&delete this.cOpts.domain,this.cOpts}set(e,t){try{return qr(e,t,m(this.cOpts)),!0}catch(e){return bn.error(e),!1}}get(e){return qr(e)}remove(e){try{return qr(e,null,m(this.cOpts)),!0}catch(e){return!1}}checkSupportAvailability(){const e="test_rudder_cookie";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}}({});var ss,is={exports:{}};var os=(ss||(ss=1,is.exports=function(){function e(e){return e=JSON.stringify(e),!!/^\{[\s\S]*\}$/.test(e)}function t(e){return void 0===e||"function"==typeof e?e+"":JSON.stringify(e)}function n(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}}function r(e){return"[object Function]"==={}.toString.call(e)}function s(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){var t="_Is_Incognit",n="yes";try{e||(e=window.localStorage),e.setItem(t,n),e.removeItem(t)}catch(t){var r={_data:{},setItem:function(e,t){return r._data[e]=String(t)},getItem:function(e){return r._data.hasOwnProperty(e)?r._data[e]:void 0},removeItem:function(e){return delete r._data[e]},clear:function(){return r._data={}}};e=r}finally{e.getItem(t)===n&&e.removeItem(t)}return e}var o=i();function a(){if(!(this instanceof a))return new a}a.prototype={set:function(n,r){if(n&&!e(n))o.setItem(n,t(r));else if(e(n))for(var s in n)this.set(s,n[s]);return this},get:function(e){if(void 0===e){var t={};return this.forEach(function(e,n){return t[e]=n}),t}if("?"===e.charAt(0))return this.has(e.substr(1));var r=arguments;if(r.length>1){for(var s={},i=0,a=r.length;i<a;i++){var c=n(o.getItem(r[i]));this.has(r[i])&&(s[r[i]]=c)}return s}return n(o.getItem(e))},clear:function(){return o.clear(),this},remove:function(e){var t=this.get(e);return o.removeItem(e),t},has:function(e){return{}.hasOwnProperty.call(this.get(),e)},keys:function(){var e=[];return this.forEach(function(t){e.push(t)}),e},forEach:function(e){for(var t=0,n=o.length;t<n;t++){var r=o.key(t);e(r,this.get(r))}return this},search:function(e){for(var t=this.keys(),n={},r=0,s=t.length;r<s;r++)t[r].indexOf(e)>-1&&(n[t[r]]=this.get(t[r]));return n},len:function(){return o.length}};var c=null;function u(t,n){var i=arguments,o=null;if(c||(c=a()),0===i.length)return c.get();if(1===i.length){if("string"==typeof t)return c.get(t);if(e(t))return c.set(t)}if(2===i.length&&"string"==typeof t){if(!n)return c.remove(t);if(n&&"string"==typeof n)return c.set(t,n);n&&r(n)&&(o=null,o=n(t,c.get(t)),u.set(t,o))}if(2===i.length&&s(t)&&r(n))for(var l=0,h=t.length;l<h;l++)o=n(t[l],c.get(t[l])),u.set(t[l],o);return u}for(var l in a.prototype)u[l]=a.prototype[l];return u}()),is.exports),as=n(os);const cs=new class{constructor(e){this.sOpts={},this.enabled=this.checkSupportAvailability(),this.options(e)}options(e={}){return 0===arguments.length||(this.sOpts=Fn({enabled:!0},e),this.enabled=this.sOpts.enabled&&this.enabled),this.sOpts}set(e,t){return as.set(e,t)}get(e){return as.get(e)}remove(e){return as.remove(e)}checkSupportAvailability(){try{const e="test_rudder_ls";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}catch(e){return!1}}}({}),us=e=>(new TextDecoder).decode((e=>{const t=globalThis.atob(e).split("").map(e=>e.charCodeAt(0));return new Uint8Array(t)})(e)),ls="rl_user_id",hs="rl_trait",ds="rl_anonymous_id",fs="rl_group_id",ps="rl_group_trait",gs="rl_page_init_referrer",ys="rl_page_init_referring_domain",ms="rl_session",vs="rl_auth_token",Is="RudderEncrypt:",As="RS_ENC_v3_",bs="Rudder",Es={segment:"ajs_anonymous_id"};function Ss(e){return e.replace(/^\s+|\s+$/gm,"")}function ks(e){return e&&"string"==typeof e&&""!==Ss(e)?e.startsWith(Is)?vr.decrypt(e.substring(Is.length),bs).toString(Or):e.startsWith(As)?us(e.substring(As.length)):e:e}const ws=new class{constructor(){rs.isSupportAvailable?this.storage=rs:(cs.enabled&&(this.storage=cs),this.storage||bn.error("No storage is available :: initializing the SDK without storage"))}options(e={}){this.storage.options(e)}setItem(e,t){const n=Gn(t);null!==n&&this.storage.set(e,function(e){return""===Ss(e)?e:`${Is}${vr.encrypt(e,bs).toString()}`}(n))}setStringItem(e,t){"string"==typeof t?this.setItem(e,t):bn.error(`[Storage] ${e} should be string`)}setUserId(e){this.setStringItem(ls,e)}setUserTraits(e){this.setItem(hs,e)}setGroupId(e){this.setStringItem(fs,e)}setGroupTraits(e){this.setItem(ps,e)}setAnonymousId(e){this.setStringItem(ds,e)}setInitialReferrer(e){this.setItem(gs,e)}setInitialReferringDomain(e){this.setItem(ys,e)}setSessionInfo(e){this.setItem(ms,e)}setAuthToken(e){this.setItem(vs,e)}getItem(e){try{let t=this.storage.get(e),n=ks(t);for(t=n?JSON.parse(n):null;"string"==typeof t&&(n=ks(t),n!==t);)t=JSON.parse(n);return t}catch(t){return bn.error((e=>`Unable to retrieve the cookie data for ${e}. The data is dropped. This can potentially stem from using SDK v3 on other sites or web pages that can share cookies with this webpage. Please use the same SDK (v3) version everywhere as soon as possible.`)(e),t),null}}getUserId(){return this.getItem(ls)}getUserTraits(){return this.getItem(hs)}getGroupId(){return this.getItem(fs)}getGroupTraits(){return this.getItem(ps)}fetchExternalAnonymousId(e){let t;const n=e.toLowerCase();return Object.keys(Es).includes(n)&&"segment"===n?(cs.enabled&&(t=cs.get(Es[n])),!t&&rs.isSupportAvailable&&(t=rs.get(Es[n])),t):t}getAnonymousId(e){const t=this.getItem(ds);if(t)return t;const n=Mr(e,"autoCapture.source");if(!0===Mr(e,"autoCapture.enabled")&&"string"==typeof n){const e=this.fetchExternalAnonymousId(n);if(e)return e}return t}getInitialReferrer(){return this.getItem(gs)}getInitialReferringDomain(){return this.getItem(ys)}getSessionInfo(){return this.getItem(ms)}getAuthToken(){return this.getItem(vs)}removeItem(e){return this.storage.remove(e)}removeSessionInfo(){this.removeItem(ms)}clear(e){this.storage.remove(ls),this.storage.remove(hs),this.storage.remove(fs),this.storage.remove(ps),this.storage.remove(vs),e&&this.storage.remove(ds)}};for(var Ts,Os=256,_s=[];Os--;)_s[Os]=(Os+256).toString(16).substring(1);for(var Rs,Cs=[],Ps=0;Ps<256;Ps++)Cs[Ps]=(Ps+256).toString(16).substring(1);function xs(){var e;(!Rs||Ps+16>4096)&&(e=4096,Rs=crypto.getRandomValues(new Uint8Array(e)),Ps=0);for(var t,n=0,r="";n<16;n++)t=Rs[Ps+n],r+=6==n?Cs[15&t|64]:8==n?Cs[63&t|128]:Cs[t],1&n&&n>1&&n<11&&(r+="-");return Ps+=16,r}const Ds={All:"All",GA:"Google Analytics",GOOGLEADS:"Google Ads",BRAZE:"Braze",CHARTBEAT:"Chartbeat",CUSTOMERIO:"Customer IO",DCM_Floodlight:"DCM Floodlight",FACEBOOK_PIXEL:"Facebook Pixel",GTM:"Google Tag Manager",HOTJAR:"Hotjar",HS:"HubSpot",INTERCOM:"Intercom",KEEN:"Keen",KISSMETRICS:"Kiss Metrics",LOTAME:"Lotame",VWO:"VWO",OPTIMIZELY:"Optimizely Web",FULLSTORY:"Fullstory",TVSQUARED:"TVSquared",GA4:"Google Analytics 4 (GA4)",GA4_V2:"Google Analytics 4 (GA4) V2",MOENGAGE:"MoEngage",AM:"Amplitude",PENDO:"Pendo",LYTICS:"Lytics",APPCUES:"Appcues",POSTHOG:"PostHog",PROFITWELL:"ProfitWell",KLAVIYO:"Klaviyo",CLEVERTAP:"CleverTap",BINGADS:"Bing Ads",PINTEREST_TAG:"Pinterest Tag",SNAP_PIXEL:"Snap Pixel",LINKEDIN_INSIGHT_TAG:"Linkedin Insight Tag",REDDIT_PIXEL:"Reddit Pixel",DRIP:"Drip",HEAP:"Heap.io",CRITEO:"Criteo",MP:"Mixpanel",QUALTRICS:"Qualtrics",SENTRY:"Sentry",GOOGLE_OPTIMIZE:"Google Optimize",POST_AFFILIATE_PRO:"Post Affiliate Pro",LAUNCHDARKLY:"LaunchDarkly",GA360:"Google Analytics 360",ADROLL:"Adroll",VERO:"Vero",MATOMO:"Matomo",MOUSEFLOW:"Mouseflow",ROCKERBOX:"Rockerbox",CONVERTFLOW:"ConvertFlow",SNAPENGAGE:"SnapEngage",LIVECHAT:"LiveChat",SHYNET:"Shynet",WOOPRA:"Woopra",ROLLBAR:"RollBar",QUORA_PIXEL:"Quora Pixel",JUNE:"June",ENGAGE:"Engage",ITERABLE:"Iterable",YANDEX_METRICA:"Yandex.Metrica",REFINER:"Refiner",QUALAROO:"Qualaroo",PODSIGHTS:"Podsights",AXEPTIO:"Axeptio",SATISMETER:"Satismeter",MICROSOFT_CLARITY:"Microsoft Clarity",SENDINBLUE:"Sendinblue",OLARK:"Olark",LEMNISK:"Lemnisk",TIKTOK_ADS:"TikTok Ads",ACTIVE_CAMPAIGN:"ActiveCampaign",SPRIG:"Sprig",SPOTIFYPIXEL:"Spotify Pixel",COMMANDBAR:"CommandBar",NINETAILED:"Ninetailed",XPIXEL:"XPixel",GAINSIGHT_PX:"Gainsight PX",USERPILOT:"Userpilot",COMSCORE:"Comscore"};function Ls(e){return e?.endsWith("/")?e.replace(/\/+$/,""):e}function Ms(){return window.crypto&&"function"==typeof window.crypto.getRandomValues?xs():function(){var e,t=0,n="";if(!Ts||Os+16>256){for(Ts=Array(t=256);t--;)Ts[t]=256*Math.random()|0;t=Os=0}for(;t<16;t++)e=Ts[Os+t],n+=6==t?_s[15&e|64]:8==t?_s[63&e|128]:_s[e],1&t&&t>1&&t<11&&(n+="-");return Os++,n}()}function Ns(){return(new Date).toISOString()}function Bs(e,t){Object.keys(e).forEach(n=>{e.hasOwnProperty(n)&&(t[n]&&(e[t[n]]=e[n]),"All"!==n&&void 0!==t[n]&&t[n]!==n&&delete e[n])})}function Gs(e){Bs(e,In)}function Us(e){Bs(e,Ds)}function js(e,t){const n=[];if(!t||0===t.length)return n;let r=!0;void 0!==e.All&&(r=e.All);const s=[];return"string"==typeof t[0]?t.forEach(e=>{s.push({intgName:e,intObj:e})}):"object"==typeof t[0]&&t.forEach(e=>{s.push({intgName:e.name,intObj:e})}),s.forEach(({intgName:t,intObj:s})=>{if(r){let r=!0;void 0!==e[t]&&!1===Boolean(e[t])&&(r=!1),r&&n.push(s)}else void 0!==e[t]&&!0===Boolean(e[t])&&n.push(s)}),n}const Fs=e=>"string"==typeof e||null==e?e:Gn(e),$s=e=>"string"==typeof e&&e.trim().length>0,zs=(e,t,n)=>{try{const r=e.source.dataplanes||{};if(Object.keys(r).length>0){const e=(e=>{const t=e?e.residencyServer:void 0;if(t)return"string"==typeof t&&_n.includes(t.toUpperCase())?t.toUpperCase():void bn.error("Invalid residencyServer input")})(n),t=r[e]||r.US;if(t){const e=(e=>{if(Array.isArray(e)&&e.length>0){const t=e.find(e=>!0===e.default);if(t&&$s(t.url))return t.url}})(t);if(e)return e}}if($s(t))return t;throw Error("Unable to load the SDK due to invalid data plane url")}catch(e){throw Error(e)}};function Ks(){return document?.referrer||"$direct"}function Hs(e){const t=e.split("/");return t.length>=3?t[2]:""}function Qs(){const e=document.getElementsByTagName("link");for(let t=0;e[t];t+=1){const n=e[t];if("canonical"===n.getAttribute("rel"))return n.getAttribute("href")}}function Vs(){const e=Qs();let t=window.location.pathname;if(e)try{t=new URL(e).pathname}catch(e){}const{search:n,href:r}=window.location,{title:s}=document,i=function(e){const t=Qs();let n;n=t?t.includes("?")?t:t+e:window.location.href;const r=n.indexOf("#");return r>-1?n.slice(0,r):n}(n),o=r,a=Ks();return{path:t,referrer:a,referring_domain:Hs(a),search:n,title:s,url:i,tab_url:o,initial_referrer:ws.getInitialReferrer()||"",initial_referring_domain:ws.getInitialReferringDomain()||""}}class qs{constructor(){this.name="RudderLabs JavaScript SDK",this.namespace="com.rudderlabs.javascript",this.version="2.53.0"}}class Xs{constructor(){this.name="RudderLabs JavaScript SDK",this.version="2.53.0"}}class Ws{constructor(){this.name="",this.version=""}}class Ys{constructor(){this.density=0,this.width=0,this.height=0,this.innerWidth=0,this.innerHeight=0}}class Js{constructor(){this.app=new qs,this.traits=null,this.library=new Xs,this.userAgent=(()=>{if("undefined"==typeof navigator)return null;let{userAgent:e}=navigator;const{brave:t}=navigator;if(t&&Object.getPrototypeOf(t).isBrave){const t=e.match(/(chrome)\/([\w.]+)/i);t&&(e=`${e} Brave/${t[2]}`)}return e})(),this.device=null,this.network=null,this.os=new Ws,this.locale="undefined"==typeof navigator?null:navigator.language||navigator.browserLanguage,this.screen=(()=>{const e=new Ys;return"undefined"==typeof window||(e.width=window.screen.width,e.height=window.screen.height,e.density=window.devicePixelRatio,e.innerWidth=window.innerWidth,e.innerHeight=window.innerHeight),e})(),this.timezone=(()=>{const e=/([A-Z]+[+-]\d+)/.exec((new Date).toString());return e?.[1]?e[1]:"NA"})()}}class Zs{constructor(){this.channel="web",this.context=new Js,this.type=null,this.messageId=Ms(),this.originalTimestamp=(new Date).toISOString(),this.anonymousId=null,this.userId=null,this.event=null,this.properties={}}getProperty(e){return this.properties[e]}addProperty(e,t){this.properties[e]=t}}class ei{constructor(){this.message=new Zs}setType(e){this.message.type=e}setProperty(e){this.message.properties=e}setUserProperty(e){this.message.user_properties=e}setUserId(e){this.message.userId=e}setEventName(e){this.message.event=e}getElementContent(){return this.message}}class ti{constructor(){this.rudderProperty=null,this.rudderUserProperty=null,this.event=null,this.userId=null,this.type=null}setType(e){return this.type=e,this}build(){const e=new ei;return e.setUserId(this.userId),e.setType(this.type),e.setEventName(this.event),e.setProperty(this.rudderProperty),e.setUserProperty(this.rudderUserProperty),e}}var ni,ri={};function si(){if(ni)return ri;ni=1;for(var e,t=256,n=[];t--;)n[t]=(t+256).toString(16).substring(1);return ri.v4=function(){var r,s=0,i="";if(!e||t+16>256){for(e=Array(s=256);s--;)e[s]=256*Math.random()|0;s=t=0}for(;s<16;s++)r=e[t+s],i+=6==s?n[15&r|64]:8==s?n[63&r|128]:n[r],1&s&&s>1&&s<11&&(i+="-");return t++,i},ri}var ii,oi,ai,ci,ui,li,hi,di,fi,pi={};function gi(){if(oi)return ii;oi=1;var e=Object.prototype.hasOwnProperty,t=String.prototype.charAt,n=Object.prototype.toString,r=function(e,n){return t.call(e,n)},s=function(t,n){return e.call(t,n)},i=function(e,t){t=t||s;for(var n=[],r=0,i=e.length;r<i;r+=1)t(e,r)&&n.push(String(r));return n};return ii=function(e){return null==e?[]:(t=e,"[object String]"===n.call(t)?i(e,r):function(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length}(e)?i(e,s):function(e,t){t=t||s;var n=[];for(var r in e)t(e,r)&&n.push(String(r));return n}(e));var t}}function yi(){if(ai)return pi;ai=1;var e=gi(),t=si().v4,n={_data:{},length:0,setItem:function(t,n){return this._data[t]=n,this.length=e(this._data).length,n},getItem:function(e){return e in this._data?this._data[e]:null},removeItem:function(t){return t in this._data&&delete this._data[t],this.length=e(this._data).length,null},clear:function(){this._data={},this.length=0},key:function(t){return e(this._data)[t]}};return pi.defaultEngine=function(){try{if(!window.localStorage)return!1;var e=t();window.localStorage.setItem(e,"test_value");var n=window.localStorage.getItem(e);return window.localStorage.removeItem(e),"test_value"===n}catch(e){return!1}}()?window.localStorage:n,pi.inMemoryEngine=n,pi}function mi(){if(ui)return ci;ui=1;var e=gi(),t=Object.prototype.toString,n="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===t.call(e)},r=function(e){return null!=e&&(n(e)||"function"!==e&&function(e){var n=typeof e;return"number"===n||"object"===n&&"[object Number]"===t.call(e)}(e.length))},s=function(e,t){for(var n=0;n<t.length&&!1!==e(t[n],n,t);n+=1);},i=function(t,n){for(var r=e(n),s=0;s<r.length&&!1!==t(n[r[s]],r[s],n);s+=1);};return ci=function(e,t){return(r(t)?s:i).call(this,e,t)}}function vi(){if(hi)return li;hi=1;var e=yi().defaultEngine,t=yi().inMemoryEngine,n=mi(),r=gi(),s=JSON;function i(t,n,r,s){this.id=n,this.name=t,this.keys=r||{},this.engine=s||e,this.originalEngine=this.engine}return i.prototype.set=function(e,t){var n=this._createValidKey(e);if(n)try{this.engine.setItem(n,function(e){try{return JSON.stringify(e,function(){const e=[];return function(t,n){if("object"!=typeof n||null===n)return n;for(;e.length>0&&e[e.length-1]!==this;)e.pop();return e.includes(n)?"[Circular Reference]":(e.push(n),n)}}())}catch(e){return null}}(t))}catch(n){(function(e){var t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(n)&&(this._swapEngine(),this.set(e,t))}},i.prototype.get=function(e){try{var t=this.engine.getItem(this._createValidKey(e));return null===t?null:s.parse(t)}catch(e){return null}},i.prototype.getOriginalEngine=function(){return this.originalEngine},i.prototype.remove=function(e){this.engine.removeItem(this._createValidKey(e))},i.prototype._createValidKey=function(e){var t,s=this.name,i=this.id;return r(this.keys).length?(n(function(n){n===e&&(t=[s,i,e].join("."))},this.keys),t):[s,i,e].join(".")},i.prototype._swapEngine=function(){var e=this;n(function(n){var r=e.get(n);t.setItem([e.name,e.id,n].join("."),r),e.remove(n)},this.keys),this.engine=t},li=i}var Ii,Ai,bi,Ei,Si={exports:{}},ki={exports:{}};function wi(){if(Ai)return Ii;Ai=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=365.25*r;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return Ii=function(o,a){a=a||{};var c=typeof o;if("string"===c&&o.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!o)return;var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(o);if("number"===c&&!1===isNaN(o))return a.long?function(s){return i(s,r,"day")||i(s,n,"hour")||i(s,t,"minute")||i(s,e,"second")||s+" ms"}(o):function(s){if(s>=r)return Math.round(s/r)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},Ii}function Ti(){return bi||(bi=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,s=+new Date,i=s-(n||s);e.diff=i,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var s=t.formatters[r];if("function"==typeof s){var i=o[c];n=s.call(e,i),o.splice(c,1),c--}return n}),t.formatArgs.call(e,o),(r.log||t.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=ki.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,s=0;s<r;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=wi(),t.names=[],t.skips=[],t.formatters={}}(0,ki.exports)),ki.exports}var Oi,_i,Ri,Ci={exports:{}};function Pi(){return Oi||(Oi=1,function(){function e(t){if(t)return function(t){for(var n in e.prototype)t[n]=e.prototype[n];return t}(t)}Ci.exports=e,e.prototype.on=e.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},e.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<r.length;s++)if((n=r[s])===t||n.fn===t){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},e.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var s=(n=n.slice(0)).length;r<s;++r)n[r].apply(this,t)}return this},e.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},e.prototype.hasListeners=function(e){return!!this.listeners(e).length}}()),Ci.exports}var xi=function(){if(Ri)return _i;Ri=1;var e=si().v4,t=vi(),n=mi(),r=function(){if(fi)return di;fi=1;var e=mi(),t={setTimeout:function(e,t){return window.setTimeout(e,t)},clearTimeout:function(e){return window.clearTimeout(e)},Date:window.Date},n=t,r={ASAP:1,RESCHEDULE:2,ABANDON:3};function s(){this.tasks={},this.nextId=1}return s.prototype.now=function(){return+new n.Date},s.prototype.run=function(e,t,s){var i=this.nextId++;return this.tasks[i]=n.setTimeout(this._handle(i,e,t,s||r.ASAP),t),i},s.prototype.cancel=function(e){this.tasks[e]&&(n.clearTimeout(this.tasks[e]),delete this.tasks[e])},s.prototype.cancelAll=function(){e(n.clearTimeout,this.tasks),this.tasks={}},s.prototype._handle=function(e,t,n,s){var i=this,o=i.now();return function(){if(delete i.tasks[e],!(s>=r.RESCHEDULE&&o+2*n<i.now()))return t();s===r.RESCHEDULE&&i.run(t,n,s)}},s.setClock=function(e){n=e},s.resetClock=function(){n=t},s.Modes=r,di=s}(),s=(Ei||(Ei=1,function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=Si.exports=Ti()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(0,Si.exports)),Si.exports)("localstorage-retry");function i(e,t){return function(){return e.apply(t,arguments)}}function o(n,s,o){"function"==typeof s&&(o=s),this.name=n,this.id=e(),this.fn=o,this.maxItems=s.maxItems||1/0,this.maxAttempts=s.maxAttempts||1/0,this.backoff={MIN_RETRY_DELAY:s.minRetryDelay||1e3,MAX_RETRY_DELAY:s.maxRetryDelay||3e4,FACTOR:s.backoffFactor||2,JITTER:s.backoffJitter||0},this.timeouts={ACK_TIMER:1e3,RECLAIM_TIMER:3e3,RECLAIM_TIMEOUT:1e4,RECLAIM_WAIT:500},this.keys={IN_PROGRESS:"inProgress",QUEUE:"queue",RECLAIM_START:"reclaimStart",RECLAIM_END:"reclaimEnd",ACK:"ack"},this._schedule=new r,this._processId=0,this._store=new t(this.name,this.id,this.keys),this._store.set(this.keys.IN_PROGRESS,{}),this._store.set(this.keys.QUEUE,[]),this._ack=i(this._ack,this),this._checkReclaim=i(this._checkReclaim,this),this._processHead=i(this._processHead,this),this._running=!1}return Pi()(o.prototype),o.prototype.start=function(){this._running&&this.stop(),this._running=!0,this._ack(),this._checkReclaim(),this._processHead()},o.prototype.stop=function(){this._schedule.cancelAll(),this._running=!1},o.prototype.shouldRetry=function(e,t){return!(t>this.maxAttempts)},o.prototype.getDelay=function(e){var t=this.backoff.MIN_RETRY_DELAY*Math.pow(this.backoff.FACTOR,e);if(this.backoff.JITTER){var n=Math.random(),r=Math.floor(n*this.backoff.JITTER*t);Math.floor(10*n)<5?t-=r:t+=r}return Number(Math.min(t,this.backoff.MAX_RETRY_DELAY).toPrecision(1))},o.prototype.addItem=function(t){this._enqueue({item:t,attemptNumber:0,time:this._schedule.now(),id:e()})},o.prototype.requeue=function(t,n,r,s){this.shouldRetry(t,n,r)?this._enqueue({item:t,attemptNumber:n,time:this._schedule.now()+this.getDelay(n),id:s||e()}):this.emit("discard",t,n)},o.prototype._enqueue=function(e){var t=this._store.get(this.keys.QUEUE)||[];(t=t.slice(-(this.maxItems-1))).push(e),t=t.sort(function(e,t){return e.time-t.time}),this._store.set(this.keys.QUEUE,t),this._running&&this._processHead()},o.prototype._processHead=function(){var t=this,i=this._store;this._schedule.cancel(this._processId);var o=i.get(this.keys.QUEUE)||[],a=i.get(this.keys.IN_PROGRESS)||{},c=this._schedule.now(),u=[];function l(e,n){u.push({item:e.item,done:function(r,s){var o=i.get(t.keys.IN_PROGRESS)||{};delete o[n],i.set(t.keys.IN_PROGRESS,o),t.emit("processed",r,s,e.item),r&&t.requeue(e.item,e.attemptNumber+1,r,e.id)}})}for(var h=Object.keys(a).length;o.length&&o[0].time<=c&&h++<t.maxItems;){var d=o.shift(),f=e();a[f]={item:d.item,attemptNumber:d.attemptNumber,time:t._schedule.now()},l(d,f)}i.set(this.keys.QUEUE,o),i.set(this.keys.IN_PROGRESS,a),n(function(e){try{t.fn(e.item,e.done)}catch(e){s("Process function threw error: "+e)}},u),o=i.get(this.keys.QUEUE)||[],this._schedule.cancel(this._processId),o.length>0&&(this._processId=this._schedule.run(this._processHead,o[0].time-c,r.Modes.ASAP))},o.prototype._ack=function(){this._store.set(this.keys.ACK,this._schedule.now()),this._store.set(this.keys.RECLAIM_START,null),this._store.set(this.keys.RECLAIM_END,null),this._schedule.run(this._ack,this.timeouts.ACK_TIMER,r.Modes.ASAP)},o.prototype._checkReclaim=function(){var e=this;n(function(t){t.id!==e.id&&(e._schedule.now()-t.get(e.keys.ACK)<e.timeouts.RECLAIM_TIMEOUT||function(t){t.set(e.keys.RECLAIM_START,e.id),t.set(e.keys.ACK,e._schedule.now()),e._schedule.run(function(){t.get(e.keys.RECLAIM_START)===e.id&&(t.set(e.keys.RECLAIM_END,e.id),e._schedule.run(function(){t.get(e.keys.RECLAIM_END)===e.id&&t.get(e.keys.RECLAIM_START)===e.id&&e._reclaim(t.id)},e.timeouts.RECLAIM_WAIT,r.Modes.ABANDON))},e.timeouts.RECLAIM_WAIT,r.Modes.ABANDON)}(t))},function(n){for(var r=[],s=e._store.getOriginalEngine(),i=0;i<s.length;i++){var o=s.key(i);if(null!==o){var a=o.split(".");3===a.length&&a[0]===n&&"ack"===a[2]&&r.push(new t(n,a[1],e.keys))}}return r}(this.name)),this._schedule.run(this._checkReclaim,this.timeouts.RECLAIM_TIMER,r.Modes.RESCHEDULE)},o.prototype._reclaim=function(r){var s=this,i=new t(this.name,r,this.keys),o={queue:this._store.get(this.keys.QUEUE)||[]},a={inProgress:i.get(this.keys.IN_PROGRESS)||{},queue:i.get(this.keys.QUEUE)||[]},c=[],u=function(t,r){n(function(t){var n=t.id||e();c.indexOf(n)>=0?s.emit("duplication",t.item,t.attemptNumber):(o.queue.push({item:t.item,attemptNumber:t.attemptNumber+r,time:s._schedule.now(),id:n}),c.push(n))},t)};u(a.queue,0),u(a.inProgress,1),o.queue=o.queue.sort(function(e,t){return e.time-t.time}),this._store.set(this.keys.QUEUE,o.queue);try{this._clearOtherQueue(i,1)}catch(e){if("NS_ERROR_STORAGE_BUSY"===e.name||"NS_ERROR_STORAGE_BUSY"===e.code||2153971713===e.code)try{this._clearOtherQueue(i,40)}catch(e){console.error(e)}else console.error(e)}this._processHead()},o.prototype._clearOtherQueue=function(e,t){setTimeout(()=>{e.remove(this.keys.IN_PROGRESS),setTimeout(()=>{e.remove(this.keys.QUEUE),setTimeout(()=>{e.remove(this.keys.RECLAIM_START),setTimeout(()=>{e.remove(this.keys.RECLAIM_END),setTimeout(()=>{e.remove(this.keys.ACK)},t)},t)},t)},t)},t)},_i=o}(),Di=n(xi);const Li={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:10,maxItems:100};class Mi{constructor(){this.url="",this.writeKey=""}init(t,n,r){this.url=n,this.writeKey=t,r&&e(Li,r),this.payloadQueue=new Di("rudder",Li,(e,t)=>{e.message.sentAt=Ns(),this.processQueueElement(e.url,e.headers,e.message,3e4,(e,n)=>{if(e)return t(e);t(null,n)})}),this.payloadQueue.start()}processQueueElement(e,t,n,r,s){try{const i=new XMLHttpRequest;i.open("POST",e,!0);for(const e in t)i.setRequestHeader(e,t[e]);i.timeout=r,i.ontimeout=s,i.onerror=s,i.onreadystatechange=function(){if(4===i.readyState)if(429===i.status||i.status>=500&&i.status<600){const t=`${Dn} "${i.status}" status text: "${i.statusText}" for URL: "${e}"`,n=new Error(t);Qn(n),s(n)}else s(null,i.status)};const o=Gn(n,!0);o?i.send(o):bn.error("Invalid payload: Event dropped")}catch(e){s(e)}}enqueue(e,t){const n={"Content-Type":"application/json",Authorization:`Basic ${btoa(`${this.writeKey}:`)}`,AnonymousId:btoa(e.anonymousId)};this.payloadQueue.addItem({url:`${this.url}/v1/${t}`,headers:n,message:e})}}const Ni="queue",Bi=64e3;class Gi{constructor(){this.storage=cs,this.maxItems=10,this.flushQueueTimeOut=void 0,this.timeOutActive=!1,this.flushQueueTimeOutInterval=6e5,this.url="",this.writekey="",this.queueName=`${Ni}.${Date.now()}`}sendQueueDataForBeacon(){this.sendDataFromQueueAndDestroyQueue()}init(e,t,n){this.url=t,this.writekey=e,n.maxItems&&(this.maxItems=n.maxItems),n.flushQueueInterval&&(this.flushQueueTimeOutInterval=n.flushQueueInterval),this.sendQueueDataForBeacon=this.sendQueueDataForBeacon.bind(this),this.attachListeners()}attachListeners(){window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.sendQueueDataForBeacon()})}getQueue(){return this.storage.get(this.queueName)}setQueue(e){this.storage.set(this.queueName,e)}enqueue(e){let t=this.getQueue()||[];t=t.slice(-(this.maxItems-1)),t.push(e);let n=t.slice(0);const r={batch:n,sentAt:Ns()},s=Gn(r,!0);s&&s.length>Bi&&(n=t.slice(0,t.length-1),this.flushQueue(n),t=this.getQueue(),t.push(e)),this.setQueue(t),this.setTimer(),t.length===this.maxItems&&this.flushQueue(n)}sendDataFromQueueAndDestroyQueue(){this.sendDataFromQueue(),this.storage.remove(this.queueName)}sendDataFromQueue(){const e=this.getQueue();if(e&&e.length>0){const t=e.slice(0,e.length);this.flushQueue(t)}}flushQueue(e){if(e&&e.length>0){const t=Ns();e.forEach(e=>{e.sentAt=t});const n=Gn({batch:e,sentAt:t},!0);if(null!==n){const e=new Blob([n],{type:"text/plain"}),t=`${this.url}?writeKey=${this.writekey}`;try{"function"!=typeof navigator.sendBeacon&&Qn(new Error("Beacon API is not supported by browser"));navigator.sendBeacon(t,e)||Qn(new Error("Unable to queue data to browser's beacon queue"))}catch(e){e.message=`${e.message} - While sending Beacon data to: ${t}`,Qn(e)}}else bn.error("Invalid payload: Event dropped")}this.setQueue([]),this.clearTimer()}setTimer(){this.timeOutActive||(this.flushQueueTimeOut=setTimeout(this.sendDataFromQueue.bind(this),this.flushQueueTimeOutInterval),this.timeOutActive=!0)}clearTimer(){this.timeOutActive&&(clearTimeout(this.flushQueueTimeOut),this.timeOutActive=!1)}}const Ui=new class{constructor(){this.queue=void 0}initialize(e,t,n){let r={},s=Ls(t);n?.useBeacon&&navigator.sendBeacon?(n.beaconQueueOptions&&null!=n.beaconQueueOptions&&"object"==typeof n.beaconQueueOptions&&(r=n.beaconQueueOptions),s=`${s}/beacon/v1/batch`,this.queue=new Gi):(n?.useBeacon&&bn.info("[EventRepository] sendBeacon feature not available in this browser :: fallback to XHR"),n?.queueOptions&&null!=n.queueOptions&&"object"==typeof n.queueOptions&&(r=n.queueOptions),this.queue=new Mi),this.queue.init(e,s,r)}enqueue(e,t){const n=e.getElementContent();n.originalTimestamp=n.originalTimestamp||Ns(),n.sentAt=Ns();const r=Gn(n,!0);r&&r.length>32e3&&bn.error("[EventRepository] enqueue:: message length greater 32 Kb ",n),this.queue.enqueue(n,t)}},ji={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:1/0};class Fi{constructor(){this.callback=void 0,this.processQueueElements=!1}init(t,n){t&&e(ji,t),n&&(this.callback=n),this.payloadQueue=new Di("rs_events",ji,(e,t)=>{this.processQueueElement(e.type,e.rudderElement,(e,n)=>{if(e)return t(e);t(null,n)})}),this.payloadQueue.start()}activateProcessor(){this.processQueueElements=!0}processQueueElement(e,t,n){try{this.processQueueElements?(Object.setPrototypeOf(t,ei.prototype),this.callback(e,t),n(null)):n(new Error("The queue elements are not ready to be processed yet"))}catch(e){n(e)}}enqueue(e,t){this.payloadQueue.addItem({type:e,rudderElement:t})}}const $i=()=>navigator&&navigator.language,zi=()=>navigator&&navigator.userAgent;function Ki(e=""){return e=e.endsWith("..")?e.substr(0,e.length-2):e,decodeURIComponent(atob(e).split("").map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""))}const Hi=/^[\w.-]+$/,Qi="*";function Vi(e,t,n,r){const s=function(e,t){return[e,(new Date).getTimezoneOffset(),t].join(Qi)}(n,r),i=t||0;return function(e){const t=function(){const e=[];let t;for(let n=0;n<256;n++){t=n;for(let e=0;e<8;e++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();let n=-1;for(let r=0;r<e.length;r++)n=n>>>8^t[255&(n^e.charCodeAt(r))];return(-1^n)>>>0}([s,Math.floor(Date.now()/6e4)-i,e].join(Qi)).toString(36)}function qi(e){const t=function(e){const t=e.split(Qi),n=t.length%2==0;return t.length<4||!n||1!==Number(t.shift())?null:{checksum:t.shift(),serializedIds:t.join(Qi)}}(e);if(!t)return null;const{checksum:n,serializedIds:r}=t;return function(e,t){const n=zi(),r=$i();for(let s=0;s<=1;s+=1)if(Vi(e,s,n,r)===t)return!0;return!1}(r,n)?function(e){const t={},n=e.split(Qi);for(let e=0;e<n.length;e+=2){const r=n[e];if(Hi.test(r)){const s=Ki(n[e+1]);t[r]=s}}return t}(r):null}class Xi{isInitialized=!1;constructor(){if(!window.OneTrust||!window.OnetrustActiveGroups)return void bn.error("OneTrust resources are not accessible.");this.userSetConsentGroupIds=window.OnetrustActiveGroups.split(",").filter(e=>e);const e=window.OneTrust.GetDomainData().Groups;this.userSetConsentGroupNames=[],this.userDeniedConsentGroupIds=[],e.forEach(e=>{const{CustomGroupId:t,GroupName:n}=e;this.userSetConsentGroupIds.includes(t)?this.userSetConsentGroupNames.push(n.toUpperCase().trim()):this.userDeniedConsentGroupIds.push(t)}),this.userSetConsentGroupIds=this.userSetConsentGroupIds.map(e=>e.toUpperCase()),this.isInitialized=!0}isEnabled(e){try{if(!this.isInitialized)return!0;const{oneTrustCookieCategories:t}=e;if(!t)return!0;const n=t.map(e=>e.oneTrustCookieCategory).filter(e=>e);let r=!0;return r=n.every(e=>this.userSetConsentGroupIds.includes(e.toUpperCase().trim())||this.userSetConsentGroupNames.includes(e.toUpperCase().trim())),r}catch(e){return bn.error(`Error during onetrust cookie consent management ${e}`),!0}}getDeniedList(){return this.isInitialized?this.userDeniedConsentGroupIds:[]}}class Wi{constructor(){if(this.userConsentedPurposes=[],this.userDeniedPurposes=[],window.updateKetchConsent=e=>{e&&(this.userConsentedPurposes=[],this.userDeniedPurposes=[],this.updatePurposes(e))},window.getKetchUserConsentedPurposes=()=>this.userConsentedPurposes.slice(),window.getKetchUserDeniedPurposes=()=>this.userDeniedPurposes.slice(),window.ketchConsent)this.updatePurposes(window.ketchConsent);else{const e=this.getConsent();this.updatePurposes(e)}}updatePurposes=e=>{e&&Object.entries(e).forEach(e=>{const t=e[0];e[1]?this.userConsentedPurposes.push(t):this.userDeniedPurposes.push(t)})};isEnabled(e){try{const{ketchConsentPurposes:t}=e;if(!t||0===t.length)return!0;const n=t.map(e=>e.purpose).filter(e=>e);let r=!0;return r=n.some(e=>this.userConsentedPurposes.includes(e.trim())),r}catch(e){return bn.error(`Error occured checking ketch consent state ${e}`),!0}}getDeniedList(){return this.userDeniedPurposes}getConsent(){const e=rs.get("_ketch_consent_v1_");if(!e)return;let t;try{t=JSON.parse(atob(e))}catch(e){return void bn.error(`Error occurred while parsing consent cookie ${e}`)}if(!t)return;const n={};return Object.entries(t).forEach(e=>{const t=e[0],r=e[1];r?.status&&(n[t]="granted"===r.status)}),n}}const Yi={initialize:e=>e?.oneTrust?.enabled?new Xi:e?.ketch?.enabled?new Wi:null};const Ji=new class{constructor(){this.storage=ws,this.timeout=18e5,this.sessionInfo=this.storage.getSessionInfo()||{autoTrack:!0}}initialize(e){try{if(this.sessionInfo.autoTrack=!(!1===e?.sessions?.autoTrack||this.sessionInfo.manualTrack),e?.sessions&&!isNaN(e.sessions.timeout)){const{timeout:t}=e.sessions;0===t&&(bn.warn("[Session]:: Provided timeout value 0 will disable the auto session tracking feature."),this.sessionInfo.autoTrack=!1),t>0&&t<1e4&&bn.warn('[Session]:: It is not advised to set "timeout" less than 10 seconds'),this.timeout=t}this.sessionInfo.autoTrack?this.startAutoTracking():!1!==this.sessionInfo.autoTrack||this.sessionInfo.manualTrack||this.end()}catch(e){Qn(e)}}isValidSession(e){return e<=this.sessionInfo.expiresAt}generateSessionId(){return Date.now()}startAutoTracking(){const e=Date.now();this.isValidSession(e)||(this.sessionInfo={},this.sessionInfo.id=e,this.sessionInfo.expiresAt=e+this.timeout,this.sessionInfo.sessionStart=!0,this.sessionInfo.autoTrack=!0),this.storage.setSessionInfo(this.sessionInfo)}validateSessionId(e){if("number"==typeof e&&e%1==0){var t;if(!(((t=e)?t.toString().length:0)<10))return e;bn.error('[Session]:: "sessionId" should at least be "10" digits long')}else bn.error('[Session]:: "sessionId" should only be a positive integer')}start(e){const t=e?this.validateSessionId(e):this.generateSessionId();this.sessionInfo={id:t||this.generateSessionId(),sessionStart:!0,manualTrack:!0},this.storage.setSessionInfo(this.sessionInfo)}getSessionId(){return this.sessionInfo.autoTrack&&this.isValidSession(Date.now())||this.sessionInfo.manualTrack?this.sessionInfo.id:null}end(){this.sessionInfo={},this.storage.removeSessionInfo()}getSessionInfo(){const e={};if(this.sessionInfo.autoTrack||this.sessionInfo.manualTrack){if(this.sessionInfo.autoTrack){const e=Date.now();this.isValidSession(e)?this.sessionInfo.expiresAt=e+this.timeout:this.startAutoTracking()}this.sessionInfo.sessionStart&&(e.sessionStart=!0,this.sessionInfo.sessionStart=!1),e.sessionId=this.sessionInfo.id,this.storage.setSessionInfo(this.sessionInfo)}return e}reset(){const{manualTrack:e,autoTrack:t}=this.sessionInfo;t?(this.sessionInfo={},this.startAutoTracking()):e&&this.start()}},Zi=["integrations","anonymousId","originalTimestamp"],eo=(e,t,n)=>{let r="";if(n){if(r=Ls(n),!r){const e="CDN base URL for integrations is not valid";throw Qn({message:`[Analytics] load:: ${e}`}),Error(`Failed to load Rudder SDK: ${e}`)}return r}const{sdkURL:s}=(()=>{const e=document.getElementsByTagName("script");let t;for(let n=0;n<e.length;n+=1){const r=Ls(e[n].getAttribute("src"));if(r&&r.match(/^.*rudder-analytics?(\.min)?\.js$/)){t=r;break}}return{sdkURL:t}})();return r=s?s.split("/").slice(0,-1).concat(wn).join("/"):Tn,t&&(r=r.replace(kn,e)),r},to="rs-bugsnag",no=["rudder-analytics.min.js","rudder-analytics.js",...Object.keys(b).map(e=>`${b[e]}.min.js`),...Object.keys(b).map(e=>`${b[e]}.js`)],ro=()=>{const e=window.location.hostname;return e&&["www.test-host.com","localhost","127.0.0.1","[::1]"].includes(e)?"development":"production"};class so{constructor(e,t,n){this.pluginName=to,this.sourceId=e,this.writeKey=t,this.onClientReady=n,this.initClientOnLibReadyInterval=void 0,this.init()}init(){window.RudderStackGlobals}initClient(){const e=window.bugsnag;this.client=e({apiKey:"0d96a60df267f4a13f808bbaa54e535c",appVersion:"2.53.0",metaData:{SDK:{name:"JS",installType:"npm"}},beforeSend:this.onError(),autoTrackSessions:!1,collectUserIp:!1,enabledBreadcrumbTypes:["error","log","user"],maxEvents:100,releaseStage:ro(),networkBreadcrumbsEnabled:!1,user:{id:this.writeKey}}),this.onClientReady()}onError(){const e=this.sourceId;return t=>{try{return!!(e=>{const t=Mr(e,"stacktrace.0.file");if(!t||"string"!=typeof t)return!1;const n=t.substring(t.lastIndexOf("/")+1);return no.includes(n)})(t)&&(((e,t)=>{e.updateMetaData("source",{metadataSource:t});const{errorMessage:n}=e;e.context=n,n.includes("error in script loading")&&(e.context="Script load failures"),e.severity="error"})(t,e),!0)}catch{return!1}}}notify(e){this.client&&this.client.notify(e)}leaveBreadcrumb(e){this.client&&this.client.leaveBreadcrumb(e)}}const io=to,oo=[to];class ao{constructor(e){this.isEnabled=!1,this.providerName=io,this.provider=void 0,this.logger=e,this.onClientReady=this.onClientReady.bind(this),this.exposeToGlobal=this.exposeToGlobal.bind(this)}init(e,t,n){e&&t?!0===(e=>Mr(e,"statsCollection.errors.enabled")||!1)(e)?(this.enable(),this.setProviderName((e=>Mr(e,"statsCollection.errors.provider"))(e)),this.initProvider(e,t,n)):this.disable():this.logger.error("[Analytics] ErrorReporting :: Invalid configuration or missing source id provided.")}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}setProviderName(e){e?!e||oo.includes(e)?this.providerName=e:this.logger.error(`[Analytics] ErrorReporting :: Invalid error reporting provider value. Value should be one of: ${oo.join(",")}`):this.providerName=io}initProvider(e,t,n){if(this.providerName===to)this.provider=new so(t,n,this.onClientReady)}onClientReady(){this.exposeToGlobal()}exposeToGlobal(){window.RudderStackGlobals||(window.RudderStackGlobals={}),window.RudderStackGlobals[Mn]=this}leaveBreadcrumb(e){if(this.provider)try{this.provider.leaveBreadcrumb(e)}catch(e){this.logger.error(`[Analytics] ErrorReporting :: leaveBreadcrumb method ${e.toString()}`)}}notify(e){if(this.provider)try{this.provider.notify(e)}catch(e){this.logger.error(`[Analytics] ErrorReporting :: notify method ${e.toString()}`)}}}const co=new class{constructor(){this.retryAttempt=3,this.queue=[],this.isTransformationProcessing=!1,this.authToken=null}init(e,t,n){this.dataPlaneUrl=Ls(t),this.writeKey=e,this.authToken=n||this.authToken,this.start()}enqueue(e,t,n){this.queue.push({event:e,destinationIds:t,cb:n})}sendEventForTransformation(e,t){return new Promise((n,r)=>{const s=`${this.dataPlaneUrl}/transform`,i={"Content-Type":"application/json",Authorization:`Basic ${btoa(`${this.writeKey}:`)}`};try{const o=new XMLHttpRequest;o.open("POST",s,!0),Object.keys(i).forEach(e=>o.setRequestHeader(e,i[e])),o.timeout=1e4,o.onreadystatechange=()=>{if(4===o.readyState)try{const{status:s}=o;let{response:i}=o;switch(s){case 200:return i=JSON.parse(i),void n({status:s,transformedPayload:i.transformedBatch});case 400:return void n({status:s,errorMessage:i?`${i}`:"Invalid request payload"});case 404:return void n({status:s});default:if(t>0){const s=t-1;setTimeout(()=>this.sendEventForTransformation(e,s).then(n).catch(r),500*2**(this.retryAttempt-s))}else n({status:s,errorMessage:"Retries exhausted"})}}catch(e){r(e)}};const a=Gn(e,!0);a?o.send(a):bn.error("Invalid payload: Event dropped")}catch(e){r(e)}})}checkQueueLengthAndProcess(){this.queue.length>0&&this.process()}process(){this.isTransformationProcessing=!0;const e=this.queue.shift(),t=(n=e.event,r=e.destinationIds,{metadata:{"Custom-Authorization":this.authToken},batch:[{orderNo:Date.now(),destinationIds:r,event:n.message}]});var n,r;this.sendEventForTransformation(t,this.retryAttempt).then(t=>{this.isTransformationProcessing=!1,e.cb(t),this.checkQueueLengthAndProcess()}).catch(t=>{Qn("string"==typeof t?t:t.message),this.isTransformationProcessing=!1,e.cb({status:0}),this.checkQueueLengthAndProcess()})}start(){setInterval(()=>{this.isTransformationProcessing||this.checkQueueLengthAndProcess()},100)}setAuthToken(e){this.authToken=e}};const uo=new class{constructor(){this.initialized=!1,this.clientIntegrations=[],this.loadOnlyIntegrations={},this.clientIntegrationObjects=void 0,this.successfullyLoadedIntegration=[],this.failedToBeLoadedIntegration=[],this.toBeProcessedArray=[],this.toBeProcessedByIntegrationArray=[],this.storage=ws,this.eventRepository=Ui,this.preProcessQueue=new Fi,this.sendAdblockPage=!1,this.sendAdblockPageOptions={},this.clientSuppliedCallbacks={},this.readyCallbacks=[],this.methodToCallbackMapping={syncPixel:"syncPixelCallback"},this.loaded=!1,this.loadIntegration=!0,this.bufferDataPlaneEventsUntilReady=!1,this.dataPlaneEventsBufferTimeout=1e4,this.integrationsData={},this.dynamicallyLoadedIntegrations={},this.destSDKBaseURL=Tn,this.cookieConsentOptions={},this.logLevel=void 0,this.clientIntegrationsReady=!1,this.uSession=Ji,this.version="2.53.0",this.lockIntegrationsVersion=!1,this.errorReporting=new ao(bn),this.deniedConsentIds=[],this.transformationHandler=co}initializeUser(e){this.userId=this.storage.getUserId()||"",this.storage.setUserId(this.userId),this.userTraits={};const t=this.storage.getUserTraits();null===t||"object"!=typeof t||Array.isArray(t)||(this.userTraits=t),this.storage.setUserTraits(this.userTraits),this.groupId=this.storage.getGroupId()||"",this.storage.setGroupId(this.groupId),this.groupTraits={};const n=this.storage.getGroupTraits();null===n||"object"!=typeof n||Array.isArray(n)||(this.groupTraits=n),this.storage.setGroupTraits(this.groupTraits),this.anonymousId=this.getAnonymousId(e),this.storage.setAnonymousId(this.anonymousId)}setInitialPageProperties(){if(null==this.storage.getInitialReferrer()&&null==this.storage.getInitialReferringDomain()){const e=Ks();this.storage.setInitialReferrer(e),this.storage.setInitialReferringDomain(Hs(e))}}allModulesInitialized(e=0){return new Promise(t=>{this.clientIntegrations.every(e=>null!=this.dynamicallyLoadedIntegrations[`${b[e.name]}_RS`])||e>=2e4?t(this):this.pause(Kn).then(()=>this.allModulesInitialized(e+Kn).then(t))})}executeReadyCallback(){this.readyCallbacks.forEach(e=>e())}integrationSDKLoaded(e,t){return window[e]?.[t]?.prototype&&void 0!==window[e][t].prototype.constructor}processResponse(e,t){try{let e=t;try{if("string"==typeof t&&(e=JSON.parse(t)),!e||"object"!=typeof e||Array.isArray(e))return void bn.error("Invalid source configuration")}catch(e){return void Qn(e)}try{window.chrome?.runtime?.id||this.errorReporting.init(e.source.config,e.source.id,this.writeKey)}catch(e){Qn(e)}if(this.serverUrl=zs(e,this.serverUrl,this.options),this.eventRepository.initialize(this.writeKey,this.serverUrl,this.options),this.transformationHandler.init(this.writeKey,this.serverUrl,this.storage.getAuthToken()),e.source.destinations.forEach(function(e){e.enabled&&this.clientIntegrations.push({name:e.destinationDefinition.name,config:e.config,destinationInfo:{shouldApplyDeviceModeTransformation:e.shouldApplyDeviceModeTransformation||!1,propagateEventsUntransformedOnError:e.propagateEventsUntransformedOnError||!1,destinationId:e.id}})},this),this.clientIntegrations=js(this.loadOnlyIntegrations,this.clientIntegrations),Object.keys(this.cookieConsentOptions).length>0)try{const e=Yi.initialize(this.cookieConsentOptions);this.deniedConsentIds=e?.getDeniedList(),this.clientIntegrations=this.clientIntegrations.filter(t=>!e||e&&e.isEnabled(t.config))}catch(e){Qn(e)}this.loaded=!0,this.options&&"function"==typeof this.options.onLoaded&&this.options.onLoaded(this),function(e){if(e.toBeProcessedArray.length>0)for(;e.toBeProcessedArray.length>0;){const t=[...e.toBeProcessedArray[0]];e.toBeProcessedArray.shift();const n=t[0];t.shift(),e[n](...t)}}(this),this.clientIntegrations=this.clientIntegrations.filter(e=>!!b[e.name]||(bn.error(`[Analytics] Integration:: ${e.name} not available for initialization`),!1)),this.bufferDataPlaneEventsUntilReady&&setTimeout(()=>{this.processBufferedCloudModeEvents()},this.dataPlaneEventsBufferTimeout),this.errorReporting.leaveBreadcrumb("Starting device-mode initialization"),this.clientIntegrations.forEach(e=>{const t=b[e.name],n=`${t}_RS`,r=`${this.destSDKBaseURL}/${t}.min.js`;window.hasOwnProperty(n)||((e,t,n={})=>{if(document.getElementById(e))return;const r=document.createElement("script");r.src=t,r.async=void 0===n.async||n.async,r.type="text/javascript",r.id=e,!0!==n.skipDatasetAttributes&&(r.setAttribute("data-loader",Hn),void 0!==n.isNonNativeSDK&&r.setAttribute("data-isNonNativeSDK",n.isNonNativeSDK));const s=document.getElementsByTagName("head");if(s.length>0)s[0].insertBefore(r,s[0].firstChild);else{const e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(r,e)}})(n,r,{isNonNativeSDK:!0});const s=this,i=setInterval(()=>{if(s.integrationSDKLoaded(n,t)){const r=window[n];let o;clearInterval(i);try{const i=`[Analytics] processResponse :: trying to initialize integration name:: ${n}`;this.errorReporting.leaveBreadcrumb(i),o=new r[t](e.config,s,e.destinationInfo),o.init(),s.isInitialized(o).then(()=>{s.dynamicallyLoadedIntegrations[n]=r[t]})}catch(e){const t=`[Analytics] 'integration.init()' failed :: ${n} :: ${e.message}`;Qn(e,t),s.failedToBeLoadedIntegration.push(o)}}},100);setTimeout(()=>{clearInterval(i)},zn)});const n=this;this.allModulesInitialized().then(()=>{if(!n.clientIntegrations||0===n.clientIntegrations.length)return this.clientIntegrationsReady=!0,this.executeReadyCallback(),void(this.toBeProcessedByIntegrationArray=[]);n.replayEvents(n)})}catch(e){Qn(e)}}sendDataToDestination(e,t,n){try{if(e[n]){const r=m(t);e[n](r)}}catch(t){const n=`[sendToNative]:: [Destination: ${e.name}]:: `;Qn(t,n)}}sendTransformedDataToDestination(e,t,n){try{Us(t.message.integrations);const r=e.map(e=>e.destinationId);this.transformationHandler.enqueue(t,r,({status:r,transformedPayload:s,errorMessage:i})=>{e.forEach(e=>{try{switch(r){case 200:{const r=s.find(t=>t.id===e.destinationId),i=[];r?.payload.forEach(n=>{if("200"===n.status)i.push(n);else{const r=`[DMT]:: Event transformation unsuccessful for destination "${e.name}". Reason: `;let s="Unknown";"410"===n.status&&(s="Transformation is not available");let o="Dropping the event",a=bn.error;!0===e.propagateEventsUntransformedOnError&&(o="Sending untransformed event to the destination",a=bn.warn,i.push({event:t.message}));a(`${r} ${s}. ${o}.`)}}),i?.forEach(t=>{$n(t.event)&&this.sendDataToDestination(e,{message:t.event},n)});break}case 404:bn.warn("[DMT]:: Transformation server access is denied. The configuration data seems to be out of sync. Sending untransformed event to the destination."),this.sendDataToDestination(e,t,n);break;default:!0===e.propagateEventsUntransformedOnError?(bn.warn(`[DMT]::[Destination: ${e.name}] :: Transformation request failed with status: ${r} ${i}. Sending untransformed event.`),this.sendDataToDestination(e,t,n)):bn.error(`[DMT]::[Destination: ${e.name}] :: Transformation request failed with status: ${r} ${i}. Dropping the event.`)}}catch(t){t instanceof Error&&(t.message=`[DMT]::[Destination:${e.name}]:: ${t.message}`),Qn(t)}})})}catch(e){e instanceof Error&&(e.message=`[DMT]:: ${e.message}`),Qn(e)}}processAndSendEventsToDeviceMode(e,t,n){const r=[],s=[];e.forEach(e=>{try{!this.IsEventBlackListed(t.message.event,e.name)&&(e.shouldApplyDeviceModeTransformation?s.push(e):r.push(e))}catch(e){Qn(e)}}),r.forEach(e=>{this.sendDataToDestination(e,t,n)}),s.length>0&&this.sendTransformedDataToDestination(s,t,n)}queueEventForDataPlane(e,t){const n=t.message.integrations||{All:!0};t.message.integrations=((e,t)=>{const n=m(e),r=Object.keys(t).filter(e=>!(!0===t[e]&&n[e])).reduce((e,n)=>(e[n]=t[n],e),{});return Fn(n,r)})(this.integrationsData,n),this.eventRepository.enqueue(t,e)}processBufferedCloudModeEvents(){this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.activateProcessor()}replayEvents(e){this.errorReporting.leaveBreadcrumb("Started replaying buffered events"),e.clientIntegrationObjects=[],e.clientIntegrationObjects=e.successfullyLoadedIntegration;try{e.clientIntegrationObjects.every(e=>!e.isReady||e.isReady())&&(this.integrationsData=((e,t)=>{let n=m(e);return t.forEach(e=>{if(e.getDataForIntegrationsObject)try{n=Fn(n,e.getDataForIntegrationsObject())}catch(e){bn.debug("[Analytics: prepareDataForIntegrationsObj]",e)}}),n})(this.integrationsData,e.clientIntegrationObjects),e.clientIntegrationsReady=!0,e.executeReadyCallback())}catch(e){Qn(e,"Replay buffered cloud mode events")}this.processBufferedCloudModeEvents(),e.toBeProcessedByIntegrationArray.forEach(t=>{const n=t[0];t.shift(),Object.keys(t[0].message.integrations).length>0&&Gs(t[0].message.integrations);const r=js(t[0].message.integrations,e.clientIntegrationObjects);this.processAndSendEventsToDeviceMode(r,t[0],n)}),e.toBeProcessedByIntegrationArray=[]}pause(e){return new Promise(t=>{setTimeout(t,e)})}isInitialized(e,t=0){return new Promise(n=>{e.isLoaded()?(this.successfullyLoadedIntegration.push(e),n(this)):t>=zn?(this.failedToBeLoadedIntegration.push(e),n(this)):this.pause(Kn).then(()=>this.isInitialized(e,t+Kn).then(n))})}page(e,t,n,r,s){if(this.errorReporting.leaveBreadcrumb("Page event"),!this.loaded)return void this.toBeProcessedArray.push(["page",...arguments]);"function"==typeof r&&(s=r,r=null),"function"==typeof n&&(s=n,r=n=null),"function"==typeof t&&(s=t,r=n=t=null),"function"==typeof e&&(s=e,r=n=t=e=null),"object"==typeof e&&null!=e&&null!=e&&(r=t,n=e,t=e=null),"object"==typeof t&&null!=t&&null!=t&&(r=n,n=t,t=null),"string"==typeof e&&"string"!=typeof t&&(t=e,e=null),this.sendAdblockPage&&"RudderJS-Initiated"!==e&&this.sendSampleRequest();let i=m(n);const o=m(r),a=(new ti).setType("page").build();i||(i={}),t&&(a.message.name=i.name=t),e&&(a.message.category=i.category=e),a.message.properties=this.getPageProperties(i),this.processAndSendDataToDestinations("page",a,o,s)}track(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Track event"),!this.loaded)return void this.toBeProcessedArray.push(["track",...arguments]);"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null);const s=m(t),i=m(n),o=(new ti).setType("track").build();e&&o.setEventName(e),o.setProperty(s||{}),this.processAndSendDataToDestinations("track",o,i,r)}identify(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Identify event"),!this.loaded)return void this.toBeProcessedArray.push(["identify",...arguments]);"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"object"==typeof e&&(n=t,t=e,e=this.userId);const s=Fs(e);s&&this.userId&&s!==this.userId&&this.reset(),this.userId=s,this.storage.setUserId(this.userId);const i=m(t),o=m(n);if(i){for(const e in i)this.userTraits[e]=i[e];this.storage.setUserTraits(this.userTraits)}const a=(new ti).setType("identify").build();this.processAndSendDataToDestinations("identify",a,o,r)}alias(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Alias event"),!this.loaded)return void this.toBeProcessedArray.push(["alias",...arguments]);"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"function"==typeof e&&(r=e,n=null,t=null,e=null),"object"==typeof t&&(n=t,t=null),"object"==typeof e&&(n=e,t=null,e=null);const s=(new ti).setType("alias").build();s.message.previousId=Fs(t)||(this.userId?this.userId:this.getAnonymousId()),s.message.userId=Fs(e);const i=m(n);this.processAndSendDataToDestinations("alias",s,i,r)}group(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Group event"),!this.loaded)return void this.toBeProcessedArray.push(["group",...arguments]);if(0===arguments.length)return;"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"object"==typeof e&&(n=t,t=e,e=this.groupId),"function"==typeof e&&(r=e,n=null,t=null,e=this.groupId),this.groupId=Fs(e),this.storage.setGroupId(this.groupId);const s=m(t),i=m(n),o=(new ti).setType("group").build();if(s)for(const e in s)this.groupTraits[e]=s[e];else this.groupTraits={};this.storage.setGroupTraits(this.groupTraits),this.processAndSendDataToDestinations("group",o,i,r)}IsEventBlackListed(e,t){if(!e||"string"!=typeof e)return!1;const n=In[t],r=this.clientIntegrations.find(e=>e.name===n),{blacklistedEvents:s,whitelistedEvents:i,eventFilteringOption:o}=r.config;if(!o)return!1;const a=e.trim().toUpperCase();switch(o){case"disable":default:return!1;case"blacklistedEvents":return!!Array.isArray(s)&&s.some(e=>e.eventName.trim().toUpperCase()===a);case"whitelistedEvents":return!Array.isArray(i)||!i.some(e=>e.eventName.trim().toUpperCase()===a)}}shouldUseGlobalIntegrationsConfigInEvents(){return this.useGlobalIntegrationsConfigInEvents&&this.loadOnlyIntegrations&&Object.keys(this.loadOnlyIntegrations).length>0}processAndSendDataToDestinations(e,t,n,r){try{this.anonymousId||this.setAnonymousId(),this.errorReporting.leaveBreadcrumb("Started sending data to destinations"),t.message.context.traits={...this.userTraits},t.message.anonymousId=this.anonymousId,t.message.userId=t.message.userId?t.message.userId:this.userId,"group"==e&&(this.groupId&&(t.message.groupId=this.groupId),this.groupTraits&&(t.message.traits={...this.groupTraits}));try{const{sessionId:e,sessionStart:n}=this.uSession.getSessionInfo();t.message.context.sessionId=e,n&&(t.message.context.sessionStart=!0)}catch(e){Qn(e)}(e=>{let t=!1;return Object.keys(e).forEach(n=>{Rn.includes(n)&&"boolean"==typeof e[n].enabled&&!0===e[n].enabled&&(t=!0)}),t})(this.cookieConsentOptions)&&(t.message.context.consentManagement={deniedConsentIds:this.deniedConsentIds||[]}),this.processOptionsParam(t,n),function(e,t){const{properties:n,traits:r,context:s}=e;n&&Object.keys(n).forEach(e=>{En.indexOf(e.toLowerCase())>=0&&bn.error(`Warning! : Reserved keyword used in properties--\x3e ${e} with ${t} call`)}),r&&Object.keys(r).forEach(e=>{En.indexOf(e.toLowerCase())>=0&&bn.error(`Warning! : Reserved keyword used in traits--\x3e ${e} with ${t} call`)});const i=s.traits;i&&Object.keys(i).forEach(e=>{En.indexOf(e.toLowerCase())>=0&&bn.error(`Warning! : Reserved keyword used in traits --\x3e ${e} with ${t} call`)})}(t.message,e);let s=t.message.integrations;s?Gs(s):s=this.shouldUseGlobalIntegrationsConfigInEvents()?this.loadOnlyIntegrations:xn,t.message.integrations=s;try{t.message.context["ua-ch"]=this.uach}catch(e){Qn(e)}try{if(this.clientIntegrationObjects){const n=js(s,this.clientIntegrationObjects);this.processAndSendEventsToDeviceMode(n,t,e)}else this.toBeProcessedByIntegrationArray.push([e,t])}catch(e){Qn(e,"processAndSendEventsToDeviceMode::")}const i=m(t);Us(i.message.integrations);!this.bufferDataPlaneEventsUntilReady||this.clientIntegrationObjects?this.queueEventForDataPlane(e,i):this.preProcessQueue.enqueue(e,i),r&&"function"==typeof r&&r(i)}catch(e){Qn(e)}}utm(e){const t={};try{const n=new URL(e),r="utm_";n.searchParams.forEach((e,n)=>{if(n.startsWith(r)){let s=n.substring(r.length);"campaign"===s&&(s="name"),t[s]=e}})}catch(e){}return t}addCampaignInfo(e){const t=e.message.context;t&&"object"==typeof t&&(e.message.context.campaign=this.utm(window.location.href))}processOptionsParam(e,t){const{type:n,properties:r}=e.message;this.addCampaignInfo(e),e.message.context.page=this.getContextPageProperties("page"===n?r:void 0),((e,t={})=>{"object"==typeof t&&null!==t&&Object.keys(t).forEach(n=>{Zi.includes(n)&&(e[n]=t[n])})})(e.message,t),e.message.context=((e,t={})=>{let{context:n}=e;return"object"!=typeof t||null===t||Object.keys(t).forEach(e=>{if(!Zi.includes(e)&&!Cn.includes(e))if("context"!==e)n=Fn(n,{[e]:t[e]});else if("object"==typeof t[e]&&null!==t[e]){const r={};Object.keys(t[e]).forEach(n=>{Cn.includes(n)||(r[n]=t[e][n])}),n=Fn(n,{...r})}else bn.error(`[Analytics: processOptionsParam] context passed in options ${e} is not object.`)}),n})(e.message,t)}getPageProperties(e,t){const n=Vs(),r=t?.page||{};for(const t in n)void 0===e[t]&&(e[t]=r[t]||n[t]);return e}getContextPageProperties(e){const t=Vs(),n={};for(const r in t)n[r]=e?.[r]?e[r]:t[r];return n}reset(e){this.errorReporting.leaveBreadcrumb(`reset API :: flag: ${e}`),this.loaded?(e&&(this.anonymousId=""),this.userId="",this.userTraits={},this.groupId="",this.groupTraits={},this.uSession.reset(),this.storage.clear(e)):this.toBeProcessedArray.push(["reset",e])}getAnonymousId(e){return this.anonymousId=this.storage.getAnonymousId(e),this.anonymousId||this.setAnonymousId(),this.anonymousId}getUserId(){return this.userId}getSessionId(){return this.uSession.getSessionId()}getUserTraits(){return this.userTraits}getGroupId(){return this.groupId}getGroupTraits(){return this.groupTraits}setAnonymousId(e,t){const n=t?qi(t):null,r=n?n.rs_amp_id:null;this.anonymousId=e||r||Ms(),this.storage.setAnonymousId(this.anonymousId)}isValidWriteKey(e){return e&&"string"==typeof e&&e.trim().length>0}isValidServerUrl(e){return e&&"string"==typeof e&&e.trim().length>0}isDatasetAvailable(){const e=document.createElement("div");return e.setAttribute("data-a-b","c"),!!e.dataset&&"c"===e.dataset.aB}loadAfterPolyfill(t,n,r){if("object"==typeof n&&null!==n&&(r=n,n=null),r?.logLevel&&(this.logLevel=r.logLevel,bn.setLogLevel(r.logLevel)),!this.isValidWriteKey(t))throw Error("Unable to load the SDK due to invalid writeKey");if(!this.storage||0===Object.keys(this.storage).length)throw Error("Cannot proceed as no storage is available");r?.cookieConsentManager&&(this.cookieConsentOptions=r.cookieConsentManager),this.writeKey=t,this.serverUrl=n,this.options=r;let s={};r?.setCookieDomain&&(s={...s,domain:r.setCookieDomain}),r&&"boolean"==typeof r.secureCookie&&(s={...s,secure:r.secureCookie}),r&&"boolean"==typeof r.sameDomainCookiesOnly&&(s={...s,sameDomainCookiesOnly:r.sameDomainCookiesOnly}),r&&-1!==On.indexOf(r.sameSiteCookie)&&(s={...s,samesite:r.sameSiteCookie}),this.storage.options(s);if(r&&"string"==typeof r.uaChTrackLevel&&Pn.includes(r.uaChTrackLevel)&&(this.uaChTrackLevel=r.uaChTrackLevel),navigator.userAgentData&&((e,t="none")=>{"none"===t&&e(void 0),"default"===t&&e(navigator.userAgentData),"full"===t&&navigator.userAgentData.getHighEntropyValues(["architecture","bitness","brands","mobile","model","platform","platformVersion","uaFullVersion","fullVersionList","wow64"]).then(t=>{e(t)})})(e=>{this.uach=e},this.uaChTrackLevel),r?.integrations&&(e(this.loadOnlyIntegrations,r.integrations),Gs(this.loadOnlyIntegrations)),this.useGlobalIntegrationsConfigInEvents=r&&!0===r.useGlobalIntegrationsConfigInEvents,r?.sendAdblockPage&&(this.sendAdblockPage=!0),r?.sendAdblockPageOptions&&"object"==typeof r.sendAdblockPageOptions&&(this.sendAdblockPageOptions=r.sendAdblockPageOptions),this.uSession.initialize(r),r?.clientSuppliedCallbacks){const t={};Object.keys(this.methodToCallbackMapping).forEach(e=>{this.methodToCallbackMapping.hasOwnProperty(e)&&r.clientSuppliedCallbacks[this.methodToCallbackMapping[e]]&&(t[e]=r.clientSuppliedCallbacks[this.methodToCallbackMapping[e]])}),e(this.clientSuppliedCallbacks,t),this.registerCallbacks(!0)}if(null!=r?.loadIntegration&&(this.loadIntegration=!!r.loadIntegration),r&&"boolean"==typeof r.bufferDataPlaneEventsUntilReady&&(this.bufferDataPlaneEventsUntilReady=!0===r.bufferDataPlaneEventsUntilReady,this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.init(this.options,this.queueEventForDataPlane.bind(this))),r&&"number"==typeof r.dataPlaneEventsBufferTimeout&&(this.dataPlaneEventsBufferTimeout=r.dataPlaneEventsBufferTimeout),r&&void 0!==r.lockIntegrationsVersion&&(this.lockIntegrationsVersion=!0===r.lockIntegrationsVersion),this.initializeUser(r?r.anonymousIdOptions:void 0),this.setInitialPageProperties(),this.destSDKBaseURL=eo(this.version,this.lockIntegrationsVersion,r?.destSDKBaseURL),r?.getSourceConfig){if("function"!=typeof r.getSourceConfig)Qn(new Error('option "getSourceConfig" must be a function'));else{const e=r.getSourceConfig();e instanceof Promise?e.then(e=>this.processResponse(200,e)).catch(Qn):this.processResponse(200,e)}return}let i=((e,t)=>{let n=Sn;const r=[];return e&&r.push(`writeKey=${e}`),t&&r.push(`lockIntegrationsVersion=${t}`),r.length>0&&(n=Sn.concat(Sn.includes("?")?"&":"?"),n=n.concat(r.join("&"))),n})(t,this.lockIntegrationsVersion);r?.configUrl&&(i=function(e,t){let n=e;-1===n.indexOf("sourceConfig")&&(n=`${Ls(n)}/sourceConfig/`),n="/"===n.slice(-1)?n:`${n}/`;const r=t.split("?")[1],s=n.split("?");return n=s.length>1&&s[1]!==r?`${s[0]}?${r}`:`${n}?${r}`,n}(r.configUrl,i));try{!function(e,t,n,r){const s=r.bind(e),i=new XMLHttpRequest;i.open("GET",t,!0),i.setRequestHeader("Authorization",`Basic ${btoa(`${n}:`)}`),i.onload=function(){const{status:e,responseText:n}=i;200===e?s(200,n):(Qn(new Error(`${Dn} ${e} for url: ${t}`)),s(e))},i.send()}(this,i,t,this.processResponse)}catch(e){Qn(e)}}arePolyfillsRequired(e){return(!e||"boolean"!=typeof e.polyfillIfRequired||e.polyfillIfRequired)&&(!String.prototype.endsWith||!String.prototype.startsWith||!String.prototype.includes||!Array.prototype.find||!Array.prototype.includes||"function"!=typeof window.URL||"undefined"==typeof Promise||!Object.entries||!Object.values||!String.prototype.replaceAll||!this.isDatasetAvailable()||"function"!=typeof TextDecoder||"function"!=typeof TextEncoder)}load(e,t,n){if(this.loaded)return;const r=m(n);this.arePolyfillsRequired(r),this.loadAfterPolyfill(e,t,r)}ready(e){this.loaded?"function"!=typeof e?bn.error("ready callback is not a function"):this.clientIntegrationsReady?e():this.readyCallbacks.push(e):this.toBeProcessedArray.push(["ready",e])}initializeCallbacks(){Object.keys(this.methodToCallbackMapping).forEach(e=>{this.methodToCallbackMapping.hasOwnProperty(e)&&this.on(e,()=>{})})}registerCallbacks(e){e||Object.keys(this.methodToCallbackMapping).forEach(e=>{this.methodToCallbackMapping.hasOwnProperty(e)&&window.rudderanalytics&&"function"==typeof window.rudderanalytics[this.methodToCallbackMapping[e]]&&(this.clientSuppliedCallbacks[e]=window.rudderanalytics[this.methodToCallbackMapping[e]])}),Object.keys(this.clientSuppliedCallbacks).forEach(e=>{this.clientSuppliedCallbacks.hasOwnProperty(e)&&this.on(e,this.clientSuppliedCallbacks[e])})}sendSampleRequest(){}startSession(e){this.uSession.start(e)}endSession(){this.uSession.end()}setAuthToken(e){"string"==typeof e?(this.storage.setAuthToken(e),this.transformationHandler.setAuthToken(e)):bn.error("Provided input should be in string format")}};a(uo),window.addEventListener("error",e=>{Qn(e,void 0,uo)},!0),uo.initializeCallbacks(),uo.registerCallbacks(!1);const lo="load",ho=window.rudderanalytics,fo=Array.isArray(ho);let po;if(fo){let e=0;for(;e<ho.length;){if(ho[e]&&ho[e][0]===lo){po=ho[e],ho.splice(e,1);break}e+=1}}!function(e){const t="ajs_trait_",n="ajs_prop_";function r(e,t){const n={};return Object.keys(e).forEach(r=>{r.startsWith(t)&&(n[r.substr(t.length)]=e[r])}),n}const s=(e=>{const t={};try{new URL(e).searchParams.forEach((e,n)=>{t[n]=e})}catch(e){}return t})(e);s.ajs_aid&&uo.toBeProcessedArray.push(["setAnonymousId",s.ajs_aid]),s.ajs_uid&&uo.toBeProcessedArray.push(["identify",s.ajs_uid,r(s,t)]),s.ajs_event&&uo.toBeProcessedArray.push(["track",s.ajs_event,r(s,n)])}(window.location.href),fo&&ho.forEach(e=>uo.toBeProcessedArray.push(e)),po&&po.length>0&&(po.shift(),uo[lo](...po));const go=uo.ready.bind(uo),yo=uo.identify.bind(uo),mo=uo.page.bind(uo),vo=uo.track.bind(uo),Io=uo.alias.bind(uo),Ao=uo.group.bind(uo),bo=uo.reset.bind(uo),Eo=uo.load.bind(uo),So=uo.initialized=!0,ko=uo.getUserId.bind(uo),wo=uo.getSessionId.bind(uo),To=uo.getUserTraits.bind(uo),Oo=uo.getAnonymousId.bind(uo),_o=uo.setAnonymousId.bind(uo),Ro=uo.getGroupId.bind(uo),Co=uo.getGroupTraits.bind(uo),Po=uo.startSession.bind(uo),xo=uo.endSession.bind(uo),Do=uo.setAuthToken.bind(uo);bn.error("This RudderStack JavaScript SDK package is deprecated and no longer maintained. While your events are still being tracked and delivered, we strongly recommend you to migrate to the latest [@rudderstack/analytics-js](https://www.npmjs.com/package/@rudderstack/analytics-js) package for enhanced features, security updates, and ongoing support. For more details, visit the migration guide: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/migration-guide/."),exports.alias=Io,exports.endSession=xo,exports.getAnonymousId=Oo,exports.getGroupId=Ro,exports.getGroupTraits=Co,exports.getSessionId=wo,exports.getUserId=ko,exports.getUserTraits=To,exports.group=Ao,exports.identify=yo,exports.initialized=So,exports.load=Eo,exports.page=mo,exports.ready=go,exports.reset=bo,exports.setAnonymousId=_o,exports.setAuthToken=Do,exports.startSession=Po,exports.track=vo;