agenttwin 0.3.12 → 0.3.13
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.
- package/dist/cli.js +1 -15
- package/dist/dashboard/assets/next/static/{1OFptRW9eKBlZCmD85D2C → BbTZs0rKnsmj45peSnlwJ}/_buildManifest.js +1 -1
- package/dist/dashboard/assets/next/static/chunks/1981-2ce2c5edd154524a.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/{4055.1056568a41510e92.js → 2442.9a266da6229b8ae0.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/2529.07927d0600506985.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/{8975.5be81ec8b09e3b45.js → 3454.d29ee7a49c2a4fba.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/{7772-425e96278b46f6c9.js → 3916-2698a1a3ecb8649f.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/4705-a6d249b4a5dcde26.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/4816-45f42396ec2135cc.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/{b468fba8.437b212aae4abcf8.js → 48a1527b.6d52e40c5e62d9d5.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/{6751.613adb085c9a5b06.js → 5490.0d5d8d5ea3577f20.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/650-3092bf29ff938e12.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/6f3ce29d-af1469ba72f5d3e4.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/{9013.0f2be1cc70029afa.js → 7280.01b3f749332bb075.js} +2 -2
- package/dist/dashboard/assets/next/static/chunks/794.a624e6be9e42a62b.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/_not-found/page-471a6c74344187f9.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/account/password/page-aaee6711085b485d.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/dashboard/layout-09cb13657f62384f.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/dashboard/page-945c916b24f48675.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/demo/page-3cba0aab460c8677.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/docs/[[...slug]]/page-9f7b8dca8b973b15.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/enterprise/page-4986698442bddc6b.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/layout-09868e53e4f0541f.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/login/page-2e29d4b17645c34c.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/onboarding/page-af2c4768dc34ec92.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/page-507229409812cedd.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/pricing/{page-757fd3f59cd253fb.js → page-c27282cd7bfb0fcf.js} +1 -1
- package/dist/dashboard/assets/next/static/chunks/app/signup/page-2e29d4b17645c34c.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/sitemap.xml/route-36bcc482b50fcb46.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/layout-77a57cd622171076.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/page-df34bcef0394d10d.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/layout-d1d715b5b2dae3cd.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/login/page-4f60d050bf954194.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/onboarding/page-abfe2f36213848d7.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/page-df6a34eff716d18e.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/app/v2/signup/page-4f60d050bf954194.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/framework-cb37e134fe056fa5.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/main-app-c83f3671ad6b824a.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/main-b7d6352ee94d0dba.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/pages/_app-9dd167be58cf5cbd.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/pages/_error-5a8b1eb076dd7c95.js +1 -0
- package/dist/dashboard/assets/next/static/chunks/webpack-44457f45df749a89.js +1 -0
- package/dist/dashboard/assets/next/static/css/0856ee8c880d8b92.css +1 -0
- package/dist/dashboard/assets/next/static/css/0cf03e33b963e5cb.css +1 -0
- package/dist/dashboard/assets/next/static/css/11f70fd04660da57.css +1 -0
- package/dist/dashboard/assets/next/static/css/14ef6d1b7f922ef2.css +1 -0
- package/dist/dashboard/assets/next/static/css/27bc5d721d729e4d.css +1 -0
- package/dist/dashboard/assets/next/static/css/{d99eecb7633d1200.css → 3f585d63d4bf0043.css} +1 -1
- package/dist/dashboard/assets/next/static/css/5d8899aaed08d7f2.css +1 -0
- package/dist/dashboard/assets/next/static/css/6b8edde77e493a51.css +1 -0
- package/dist/dashboard/assets/next/static/css/{32d869ddee6d2dc1.css → 766bc384d3febae4.css} +1 -1
- package/dist/dashboard/assets/next/static/css/81a1668ab34a36e8.css +1 -0
- package/dist/dashboard/assets/next/static/css/b15fa8a0e168d625.css +1 -0
- package/dist/dashboard/assets/next/static/css/d5d08788c3435fdf.css +1 -0
- package/dist/dashboard/assets/next/static/css/eea0966f05042bde.css +1 -0
- package/dist/dashboard/assets/next/static/css/f14e187b236cb6fb.css +1 -0
- package/dist/dashboard/assets/next/static/css/f57206a163d6b5be.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/package.json +1 -1
- package/dist/dashboard/assets/next/static/chunks/1255-b815b974120825e7.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/3050-a8f395e3fe36d7b9.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/4343.023a18f52318dbad.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/4542.0327d0da1c3ea200.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/4bd1b696-f785427dddbba9fb.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/6787-6a8909259d0ac26c.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/9819-f4092ab03f2f8081.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/_not-found/page-43db8aef3fa81958.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/account/password/page-c2ce3c796c817ca1.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/dashboard/layout-28ee3093f86fc075.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/dashboard/page-256847cee82d65f9.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/demo/page-4dc63755e0013e7c.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/docs/[[...slug]]/page-db473994608d5c77.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/enterprise/page-9a33a4aec43377e0.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/layout-936e4569a1d1bf81.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/login/page-d6d4276397724d29.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/onboarding/page-1b066c493c248f29.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/page-950c663fd42544c0.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/signup/page-d6d4276397724d29.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/sitemap.xml/route-83b9d0f0ad5575d4.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/layout-a5cf565e017886d3.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/dashboard/page-0a9d4a8730592fce.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/layout-abbd9f3b8811f559.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/login/page-4f4a342a4c28f9de.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/onboarding/page-f04c0b236abaead3.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/page-cf8af0afd0589c71.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/app/v2/signup/page-4f4a342a4c28f9de.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/framework-e54b663a2888b5de.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/main-app-1ec13ceef4a34729.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/main-d1fa84e2f669be1c.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/pages/_app-6c8c2371b16a04b8.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/pages/_error-94812ad32cad7365.js +0 -1
- package/dist/dashboard/assets/next/static/chunks/webpack-7c1fd2c82a2ee8c9.js +0 -1
- package/dist/dashboard/assets/next/static/css/138b575a572b2958.css +0 -1
- package/dist/dashboard/assets/next/static/css/1f0bd0855bbd1a14.css +0 -1
- package/dist/dashboard/assets/next/static/css/311920319a51fc90.css +0 -1
- package/dist/dashboard/assets/next/static/css/3f003235629d65a0.css +0 -1
- package/dist/dashboard/assets/next/static/css/448fc71b62e29403.css +0 -1
- package/dist/dashboard/assets/next/static/css/45513ebc8c6ae800.css +0 -1
- package/dist/dashboard/assets/next/static/css/4fa51ab33fbc7e1b.css +0 -1
- package/dist/dashboard/assets/next/static/css/61ec74d503f353d4.css +0 -1
- package/dist/dashboard/assets/next/static/css/807e07644631d8e2.css +0 -1
- package/dist/dashboard/assets/next/static/css/97d686ac80c4018f.css +0 -1
- package/dist/dashboard/assets/next/static/css/c1117da59daa6ba9.css +0 -1
- package/dist/dashboard/assets/next/static/css/c5ac36ef5726e746.css +0 -1
- package/dist/dashboard/assets/next/static/css/ec9722ff890f136c.css +0 -1
- /package/dist/dashboard/assets/next/static/{1OFptRW9eKBlZCmD85D2C → BbTZs0rKnsmj45peSnlwJ}/_ssgManifest.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9432],{7385:(e,t,i)=>{let s,r,n,o,a,l;i.d(t,{default:()=>uM});var u,h=i(5704);let c="u">typeof window?window:void 0,d="u">typeof globalThis?globalThis:c,p=null==d?void 0:d.navigator,f=null==d?void 0:d.document,g=null==d?void 0:d.location,v=null==d?void 0:d.fetch,_=(null==d?void 0:d.XMLHttpRequest)&&"withCredentials"in new d.XMLHttpRequest?d.XMLHttpRequest:void 0,m=null==d?void 0:d.AbortController,y=null==d?void 0:d.CompressionStream,b=null==p?void 0:p.userAgent,w="undefined"!=typeof globalThis?globalThis:c;w&&"undefined"==typeof self&&(w.self=w),w&&"undefined"==typeof File&&(w.File=function(){});let x=null!=c?c:{},k="0.9.5",$={DEBUG:!1,LIB_VERSION:k,LIB_NAME:"browser-common",JS_SDK_VERSION:k};var E=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),S=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({});let P=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],M=["token"];function O(e,t){return -1!==e.indexOf(t)}let I=function(e){return e.trim()},F=function(e){return e.replace(/^\$/,"")};function C(e){var t;let i=[];return null!=(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(t))return"[Circular]";i.push(t)}return t}}))?t:"null"}let A=Object.prototype,T=A.hasOwnProperty,R=A.toString,L=Array.isArray||function(e){return"[object Array]"===R.call(e)},D=e=>"function"==typeof e,N=e=>e===Object(e)&&!L(e),j=e=>{if(N(e)){for(let t in e)if(T.call(e,t))return!1;return!0}return!1},q=e=>void 0===e,H=e=>"[object String]"==R.call(e),B=e=>H(e)&&0===e.trim().length,z=e=>null===e,U=e=>q(e)||z(e),V=e=>"[object Number]"==R.call(e)&&e==e,W=e=>V(e)&&e>0,G=e=>"[object Boolean]"===R.call(e),J=e=>O(P,e),K=e=>O(M,e);function Q(e){return null===e||"object"!=typeof e}function Y(e,t){return({}).toString.call(e)===`[object ${t}]`}function X(e){switch(({}).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return ee(e,Error)}}function Z(e){return"u">typeof Event&&ee(e,Event)}function ee(e,t){try{return e instanceof t}catch(e){return!1}}let et=[!0,"true",1,"1","yes"],ei=e=>O(et,e),es=[!1,"false",0,"0","no"];function er(e,t,i,s,r,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(s,r)}function en(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function o(e){er(n,s,r,o,a,"next",e)}function a(e){er(n,s,r,o,a,"throw",e)}o(void 0)})}}let eo=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],ea=new Map,el=function(e,t=[]){if(!e)return!1;let i=function(e,t){let i="";for(let e=0;t.length>e;e++){let s=t[e];i+=s.length+":"+s}return e.length+":"+e+"|"+t.length+":"+i}(e,t),s=ea.get(i);if(void 0!==s)return s;let r=e.toLowerCase(),n=eo.concat(t).some(e=>-1!==r.indexOf(e.toLowerCase()));return 256>ea.size||ea.clear(),ea.set(i,n),n};function eu(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),V(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),eu(null!=r?r:i,t,i,s))}var eh=class{constructor(e){this.C={},this.I=e.I,this.R=eu(e.bucketSize,0,100,e.A),this.$=eu(e.refillRate,0,this.R,e.A),this.O=eu(e.refillInterval,0,864e5,e.A)}F(e,t){let i=Math.floor((t-e.lastAccess)/this.O);i>0&&(e.tokens=Math.min(e.tokens+i*this.$,this.R),e.lastAccess=e.lastAccess+i*this.O)}consumeRateLimit(e){var t;let i=Date.now(),s=String(e),r=this.C[s];return r?this.F(r,i):(r={tokens:this.R,lastAccess:i},this.C[s]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.I)||t.call(this,e)),0===r.tokens)}stop(){this.C={}}};let ec="Mobile",ed="Android",ep="Tablet",ef="Android Tablet",eg="iPad",ev="Apple Watch",e_="Safari",em="BlackBerry",ey="Samsung Internet",eb="Chrome",ew="Chrome iOS",ex="Internet Explorer",ek="Internet Explorer Mobile",e$="Opera",eE="Microsoft Edge",eS="Firefox",eP="Firefox iOS",eM="Nintendo",eO="PlayStation",eI="Xbox",eF="Android Mobile",eC="Mobile Safari",eA="Windows",eT="Windows Phone",eR="Nokia",eL="Ouya",eD="Generic "+ec.toLowerCase(),eN="Generic "+ep.toLowerCase(),ej="Konqueror",eq="Oculus Browser",eH="Vivaldi",eB="Yandex",ez="Whale",eU="DuckDuckGo",eV="Pale Moon",eW="Waterfox",eG="Brave",eJ="Claude",eK="Codex",eQ="ChatGPT",eY="Google Search App",eX=RegExp("Version/(\\d+(\\.\\d+)?)"),eZ=RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),e0=RegExp(eI,"i"),e1=RegExp("PlayStation \\w+","i"),e2=RegExp("Nintendo \\w+","i"),e3=RegExp("BlackBerry|PlayBook|BB10","i"),e5={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},e4=function(e,t,i,s){var r;return t=t||"",((null==i?void 0:i.brave)?eG:null)||((null==s?void 0:s.detectGoogleSearchApp)&&O(e,"GSA/")?eY:O(e," OPR/")&&O(e,"Mini")?"Opera Mini":O(e," OPR/")?e$:e3.test(e)?em:O(e,"IEMobile")||O(e,"WPDesktop")?ek:O(e,"OculusBrowser")?eq:O(e,"SamsungBrowser")?ey:O(e,"Edge")||O(e,"Edg/")?eE:O(e,"Vivaldi/")?eH:O(e,"YaBrowser/")?eB:O(e,"Whale/")?ez:O(e,"DuckDuckGo/")||O(e,"Ddg/")?eU:O(e,"Claude/")?eJ:O(e,"Codex/")?eK:O(e,"ChatGPT/")?eQ:O(e,"FBIOS")?"Facebook Mobile":O(e,"UCWEB")||O(e,"UCBrowser")?"UC Browser":O(e,"CriOS")?ew:O(e,"CrMo")||O(e,eb)?eb:O(e,ed)&&O(e,e_)?eF:O(e,"FxiOS")?eP:O(e.toLowerCase(),ej.toLowerCase())?ej:O(e,"Brave/")?eG:(r=t)&&O(r,"Apple")||O(e,e_)&&!O(e,eb)&&!O(e,ed)?O(e,ec)?eC:e_:O(e,"PaleMoon/")?eV:O(e,"Waterfox/")?eW:O(e,eS)?eS:O(e,"MSIE")||O(e,"Trident/")?ex:O(e,"Gecko")?eS:"")},e6={[ek]:[RegExp("rv:(\\d+(\\.\\d+)?)")],[eE]:[RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[eb]:[RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[ew]:[RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[e_]:[eX],[eC]:[eX],[e$]:[RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[eS]:[RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[eP]:[RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[ej]:[RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[em]:[RegExp("BlackBerry (\\d+(\\.\\d+)?)"),eX],[eF]:[RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ey]:[RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[eq]:[RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[eH]:[RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[eB]:[RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[ez]:[RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[eG]:[RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[eJ]:[eZ],[eK]:[eZ],[eQ]:[eZ],[eU]:[RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[eV]:[RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[eW]:[RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[eY]:[RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[ex]:[RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[RegExp("rv:(\\d+(\\.\\d+)?)")]},e8=function(e,t,i,s){let r=e6[e4(e,t,i,s)];if(q(r))return null;for(let t=0;r.length>t;t++){let i=e.match(r[t]);if(i)return parseFloat(i[i.length-2])}return null},e9=[[RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[eI,e&&e[1]||""]],[RegExp(eM,"i"),[eM,""]],[RegExp(eO,"i"),[eO,""]],[e3,[em,""]],[RegExp(eA,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eT,""];if(new RegExp(ec).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];let i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){let e=e5[i[1]]||"";return/arm/i.test(t)&&(e="RT"),[eA,e]}return[eA,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=q(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[ed,[e[2],e[3],e[4]||"0"].join(".")]:[ed,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{let t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],e7=function(e){for(let t=0;e9.length>t;t++){let[i,s]=e9[t],r=i.exec(e),n=r&&(D(s)?s(r,e):s);if(n)return n}return["",""]},te=function(e){return e2.test(e)?eM:e1.test(e)?eO:e0.test(e)?eI:RegExp(eL,"i").test(e)?eL:RegExp("(Windows Phone|WPDesktop)","i").test(e)?eT:/iPad/.test(e)?eg:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ev:e3.test(e)?em:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eR,"i").test(e)?eR:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(ec).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ed:ef:RegExp("(pda|Mobile)","i").test(e)?eD:RegExp(ep,"i").test(e)&&!RegExp("Tablet pc","i").test(e)?eN:""},tt=function(e,t){var i,s,r,n;let o=te(e);return o===eg||o===ef||"Kobo"===o||"Kindle Fire"===o||o===eN?ep:o===eM||o===eI||o===eO||o===eL?"Console":o===ev?"Wearable":o?ec:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!=(n=null==t?void 0:t.maxTouchPoints)?n:0)>0?600>Math.min(null!=(i=null==t?void 0:t.screenWidth)?i:0,null!=(s=null==t?void 0:t.screenHeight)?s:0)/(null!=(r=null==t?void 0:t.devicePixelRatio)?r:1)?ec:ep:"Desktop"},ti=/\bFBAV\/(\d+(?:\.\d+)*)/i,ts=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",ti],[/\bFBAN\/EMA\b/i,"Facebook Lite",ti],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",ti],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],tr="[Truncated]",tn="[Unserializable]";function to(e){let t="";for(let i=0;e.length>i;i++){let s=e.charCodeAt(i);if(55296>s||s>56319)t+=56320>s||s>57343?e[i]:"�";else{let s=e.charCodeAt(i+1);56320>s||s>57343?t+="�":(t+=e[i]+e[i+1],i++)}}return t}function ta(e,t){if(!t)return e;let i=[];try{i=Object.keys(t)}catch(e){i=[]}for(let s of i){let i;try{i=t[s]}catch(e){i=tn}Object.defineProperty(e,s,{value:i,enumerable:!0,writable:!0,configurable:!0})}return e}var tl=class{record(e){if("too-large"===e.kind)return;if("retry-later"!==e.kind)return void this.reset();if(!e.retryAfterMs)return;let t=this.isOpen(),i=Date.now(),s=Math.min(e.retryAfterMs,3e5);if(!t)return this.ts=i,void(this.es=i+s);this.es=Math.max(this.es,Math.min(i+s,this.ts+3e5))}remainingMs(){let e=Date.now();if(this.ts-5e3>e)return this.reset(),0;let t=Math.min(3e5,Math.max(0,this.es-e));return 0===t&&this.reset(),t}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};let tu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function th(e,t){return"string"==typeof e&&tu.test(e)?e:t()}function tc(e,t){let i=Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function td(e){return e?e.split("#")[0]:e}function tp(e){try{return e()}catch(e){return}}function tf(e,t){let i=setTimeout(e,t);return null!=i&&i.unref&&(null==i||i.unref()),i}function tg(e,t,i){return tv.apply(this,arguments)}function tv(){return(tv=en(function*(e,t,i){let s;try{return yield Promise.race([e,new Promise((e,r)=>{s=tf(()=>{try{null==i||i(),e()}catch(e){r(e)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}function t_(e){return(t_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tm(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,s)}return i}function ty(e){for(var t=1;arguments.length>t;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?tm(Object(i),!0).forEach(function(t){!function(e,t,i){var s;(s=function(e){if("object"!=t_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=t_(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==t_(s)?s:s+"")in e)?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):tm(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function tb(e,t,i){return e&&i?t.length===Object.keys(i).length&&t.every(t=>e[t]===i[t]):e===i}var tw=class{constructor(e,t,i=[]){this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t={}){let i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),r=this.buildParsingContext(t),n=this.parseStacktrace(s,r);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return en(function*(){for(let i of e)i.stacktrace&&i.stacktrace.frames&&L(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i;let s,r;if(null!=e.cause&&(s=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack)try{r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch(e){}return ty(ty({},e),{},{cause:s,stack:r,errors:null==(i=e.errors)?void 0:i.map(e=>this.parseStacktrace(e,t))})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(let i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return en(function*(){let i=e;for(let e of t.modifiers)i=yield e(i);return i})()}convertToExceptionList(e,t){let i=[],s=(e,r,n)=>{var o;let a=i.length,l=void 0===r?ty(ty({type:"string"==typeof t.type&&t.type.length>0?t.type:"generic"},"boolean"==typeof t.handled?{handled:t.handled}:void 0===t.handled?{handled:!0}:{}),{},{synthetic:"boolean"==typeof t.synthetic?t.synthetic:e.synthetic,exception_id:a}):{type:"chained",source:n,synthetic:e.synthetic,exception_id:a,parent_id:r},u={type:e.type,value:e.value,mechanism:l};for(let t of(e.stack&&(u.stacktrace={type:"raw",frames:e.stack}),i.push(u),e.cause&&s(e.cause,a,"cause"),null!=(o=e.errors)?o:[]))s(t,a,"member")};return s(e),i}buildParsingContext(e){var t;return{chunkIdMap:function(e){let t=globalThis._posthogChunkIds,i=globalThis._debugIds;if(!t&&!i)return;let a=t?Object.keys(t):[],l=i?Object.keys(i):[];if(o&&tb(t,a,r)&&tb(i,l,n))return o;r=t?ty({},t):void 0,n=i?ty({},i):void 0,o={},null!=s||(s={});let u=(t,i)=>{for(let n of t){let t=i[n];if(!t)continue;let a=null==s?void 0:s[n];if(a){o[a]=t;continue}let l=e(n);for(let e=l.length-1;e>=0;e--){var r;let i=null==(r=l[e])?void 0:r.filename;if(i){o[i]=t,s[n]=i;break}}}};return i&&u(l,i),t&&u(a,t),o}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}getAggregateErrors(e){try{if(X(e)){let i=Object.getPrototypeOf(e);for(let s=0;i&&100>s;s++){var t;let s=null==(t=Object.getOwnPropertyDescriptor(i,"constructor"))?void 0:t.value;if("function"==typeof s&&"AggregateError"===s.name){let t=e.errors;return L(t)?t:void 0}i=Object.getPrototypeOf(i)}}}catch(e){}}buildCoercingContext(e,t,i=0){let s=0,r=0,n=!1,o=new Set,a=[],l={},u=(e,t,i=0)=>{let u,c,d=h(t,i),p=d.apply;if(d.apply=t=>{a.push(e);try{return p(t)}finally{a.pop()}},i>4||i>0&&-1!==a.indexOf(e))return this.coerceFallback(d);let f="object"==typeof e&&null!==e||"function"==typeof e;if(0===i&&s>=50||f&&o.has(e))return;f&&o.add(e),0===i&&s++;let g=this.getAggregateErrors(e);n||(n=!!g);try{if(!(u=this.applyCoercers(e,d)))throw l}catch(e){if(e===l)return void(0===i&&s--);if(!n)throw e;u=this.coerceFallback(d)}if(!g||s>=50)return u;try{c=g.length}catch(e){return u}if(!Number.isInteger(c)||0>c||c>0xffffffff)return u;let v=[];for(let e=0;50>s&&1e3>r&&c>e;e++){let i;r++;try{i=d.next(g[e])}catch(e){s++,i=this.coerceFallback(h(t+1))}i&&v.push(i)}return ty(ty({},u),{},{errors:v})},h=(i,s=0)=>ty(ty({},t),{},{syntheticException:0==i?t.syntheticException:void 0,mechanism:0==i?e:{},apply(e){let t=u(e,i,s+1);if(!t)throw l;return t},next:e=>u(e,i+1)}),c=h(i);return ty(ty({},c),{},{apply:e=>{var t;return null!=(t=u(e,i))?t:this.coerceFallback(c)}})}};let tx=/^([a-z][a-z0-9.+-]+):/i,tk=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function t$(e,t,i,s,r){let n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:function(e){if(!e||"<anonymous>"===e)return!1;let t=tx.exec(e);return!t||tk.includes(t[1].toLowerCase())}(t)};return q(s)||(n.lineno=s),q(r)||(n.colno=r),n}let tE=(e,t)=>{let i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},tS=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tP=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tM=/\((\S*)(?::(\d+))(?::(\d+))\)/,tO=(e,t)=>{let i=tS.exec(e);if(i){let[,e,s,r]=i;return t$(t,e,"?",+s,+r)}let s=tP.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){let e=tM.exec(s[2]);e&&(s[2]=e[1],s[3]=e[2],s[4]=e[3])}let[e,i]=tE(s[1]||"?",s[2]);return t$(t,i,e,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},tI=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tF=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tC=(e,t)=>{let i=tI.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){let e=tF.exec(i[3]);e&&(i[1]=i[1]||"eval",i[3]=e[1],i[4]=e[2],i[5]="")}let e=i[3],s=i[1]||"?";return[s,e]=tE(s,e),t$(t,e,s,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tA=/\(error: (.*)\)/;function tT(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function tR(e,t){let i=t.start;for(;i>0&&tT(e[i-1],e[i-1+t.length]);)i--;return t.start-i}function tL(e,t){let i=t.start+t.length,s=i;for(;e.length>s&&tT(e[s],e[s-t.length]);)s++;return s-i}var tD=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){let i=H(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){let t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return Y(e,"DOMException")}isDOMError(e){return Y(e,"DOMError")}},tN=class{match(e){return X(e)}coerce(e,t){var i;let s=this.getStack(e),r=void 0===s?null==(i=t.syntheticException)?void 0:i.stack:void 0;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=s?s:r,cause:e.cause?t.next(e.cause):void 0,synthetic:!!r}}getType(e){return e.name||e.constructor.name}getMessage(e,t){let i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){try{let t=e.stacktrace;if("string"==typeof t&&t.length>0)return t;let i=e.stack;return"string"==typeof i&&i.length>0?i:void 0}catch(e){return}}},tj=class{match(e){return!!Y(e,"ErrorEvent")&&(null!=e.error||this.ar(e))}coerce(e,t){var i;if(null!=e.error)return t.apply(e.error);let s=t.apply(e.message);return ty(ty({},s),{},{stack:null!=(i=this.lr(e))?i:s.stack,synthetic:!0})}ar(e){return H(e.message)&&e.message.length>0}lr(e){var t,i;let s=null!=(t=e.lineno)?t:0,r=null!=(i=e.colno)?i:0;if(H(e.filename)&&0!==e.filename.length&&0!==s)return`Error
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[911],{2156:(e,t,i)=>{let s,r,n,o,a,l;i.d(t,{default:()=>uM});var u,h=i(949);let c="u">typeof window?window:void 0,d="u">typeof globalThis?globalThis:c,p=null==d?void 0:d.navigator,f=null==d?void 0:d.document,g=null==d?void 0:d.location,v=null==d?void 0:d.fetch,_=(null==d?void 0:d.XMLHttpRequest)&&"withCredentials"in new d.XMLHttpRequest?d.XMLHttpRequest:void 0,m=null==d?void 0:d.AbortController,y=null==d?void 0:d.CompressionStream,b=null==p?void 0:p.userAgent,w="undefined"!=typeof globalThis?globalThis:c;w&&"undefined"==typeof self&&(w.self=w),w&&"undefined"==typeof File&&(w.File=function(){});let x=null!=c?c:{},k="0.9.5",$={DEBUG:!1,LIB_VERSION:k,LIB_NAME:"browser-common",JS_SDK_VERSION:k};var E=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.AiCaptureQueue="ai_capture_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.PushRegistered="push_registered",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysInProgress="surveys_in_progress",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),S=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({});let P=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],M=["token"];function O(e,t){return -1!==e.indexOf(t)}let I=function(e){return e.trim()},F=function(e){return e.replace(/^\$/,"")};function C(e){var t;let i=[];return null!=(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(t))return"[Circular]";i.push(t)}return t}}))?t:"null"}let A=Object.prototype,T=A.hasOwnProperty,R=A.toString,L=Array.isArray||function(e){return"[object Array]"===R.call(e)},D=e=>"function"==typeof e,N=e=>e===Object(e)&&!L(e),j=e=>{if(N(e)){for(let t in e)if(T.call(e,t))return!1;return!0}return!1},q=e=>void 0===e,H=e=>"[object String]"==R.call(e),B=e=>H(e)&&0===e.trim().length,z=e=>null===e,U=e=>q(e)||z(e),V=e=>"[object Number]"==R.call(e)&&e==e,W=e=>V(e)&&e>0,G=e=>"[object Boolean]"===R.call(e),J=e=>O(P,e),K=e=>O(M,e);function Q(e){return null===e||"object"!=typeof e}function Y(e,t){return({}).toString.call(e)===`[object ${t}]`}function X(e){switch(({}).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return ee(e,Error)}}function Z(e){return"u">typeof Event&&ee(e,Event)}function ee(e,t){try{return e instanceof t}catch(e){return!1}}let et=[!0,"true",1,"1","yes"],ei=e=>O(et,e),es=[!1,"false",0,"0","no"];function er(e,t,i,s,r,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(s,r)}function en(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function o(e){er(n,s,r,o,a,"next",e)}function a(e){er(n,s,r,o,a,"throw",e)}o(void 0)})}}let eo=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],ea=new Map,el=function(e,t=[]){if(!e)return!1;let i=function(e,t){let i="";for(let e=0;t.length>e;e++){let s=t[e];i+=s.length+":"+s}return e.length+":"+e+"|"+t.length+":"+i}(e,t),s=ea.get(i);if(void 0!==s)return s;let r=e.toLowerCase(),n=eo.concat(t).some(e=>-1!==r.indexOf(e.toLowerCase()));return 256>ea.size||ea.clear(),ea.set(i,n),n};function eu(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),V(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),eu(null!=r?r:i,t,i,s))}var eh=class{constructor(e){this.C={},this.I=e.I,this.R=eu(e.bucketSize,0,100,e.A),this.$=eu(e.refillRate,0,this.R,e.A),this.O=eu(e.refillInterval,0,864e5,e.A)}F(e,t){let i=Math.floor((t-e.lastAccess)/this.O);i>0&&(e.tokens=Math.min(e.tokens+i*this.$,this.R),e.lastAccess=e.lastAccess+i*this.O)}consumeRateLimit(e){var t;let i=Date.now(),s=String(e),r=this.C[s];return r?this.F(r,i):(r={tokens:this.R,lastAccess:i},this.C[s]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.I)||t.call(this,e)),0===r.tokens)}stop(){this.C={}}};let ec="Mobile",ed="Android",ep="Tablet",ef="Android Tablet",eg="iPad",ev="Apple Watch",e_="Safari",em="BlackBerry",ey="Samsung Internet",eb="Chrome",ew="Chrome iOS",ex="Internet Explorer",ek="Internet Explorer Mobile",e$="Opera",eE="Microsoft Edge",eS="Firefox",eP="Firefox iOS",eM="Nintendo",eO="PlayStation",eI="Xbox",eF="Android Mobile",eC="Mobile Safari",eA="Windows",eT="Windows Phone",eR="Nokia",eL="Ouya",eD="Generic "+ec.toLowerCase(),eN="Generic "+ep.toLowerCase(),ej="Konqueror",eq="Oculus Browser",eH="Vivaldi",eB="Yandex",ez="Whale",eU="DuckDuckGo",eV="Pale Moon",eW="Waterfox",eG="Brave",eJ="Claude",eK="Codex",eQ="ChatGPT",eY="Google Search App",eX=RegExp("Version/(\\d+(\\.\\d+)?)"),eZ=RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),e0=RegExp(eI,"i"),e1=RegExp("PlayStation \\w+","i"),e2=RegExp("Nintendo \\w+","i"),e3=RegExp("BlackBerry|PlayBook|BB10","i"),e5={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},e4=function(e,t,i,s){var r;return t=t||"",((null==i?void 0:i.brave)?eG:null)||((null==s?void 0:s.detectGoogleSearchApp)&&O(e,"GSA/")?eY:O(e," OPR/")&&O(e,"Mini")?"Opera Mini":O(e," OPR/")?e$:e3.test(e)?em:O(e,"IEMobile")||O(e,"WPDesktop")?ek:O(e,"OculusBrowser")?eq:O(e,"SamsungBrowser")?ey:O(e,"Edge")||O(e,"Edg/")?eE:O(e,"Vivaldi/")?eH:O(e,"YaBrowser/")?eB:O(e,"Whale/")?ez:O(e,"DuckDuckGo/")||O(e,"Ddg/")?eU:O(e,"Claude/")?eJ:O(e,"Codex/")?eK:O(e,"ChatGPT/")?eQ:O(e,"FBIOS")?"Facebook Mobile":O(e,"UCWEB")||O(e,"UCBrowser")?"UC Browser":O(e,"CriOS")?ew:O(e,"CrMo")||O(e,eb)?eb:O(e,ed)&&O(e,e_)?eF:O(e,"FxiOS")?eP:O(e.toLowerCase(),ej.toLowerCase())?ej:O(e,"Brave/")?eG:(r=t)&&O(r,"Apple")||O(e,e_)&&!O(e,eb)&&!O(e,ed)?O(e,ec)?eC:e_:O(e,"PaleMoon/")?eV:O(e,"Waterfox/")?eW:O(e,eS)?eS:O(e,"MSIE")||O(e,"Trident/")?ex:O(e,"Gecko")?eS:"")},e6={[ek]:[RegExp("rv:(\\d+(\\.\\d+)?)")],[eE]:[RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[eb]:[RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[ew]:[RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[e_]:[eX],[eC]:[eX],[e$]:[RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[eS]:[RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[eP]:[RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[ej]:[RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[em]:[RegExp("BlackBerry (\\d+(\\.\\d+)?)"),eX],[eF]:[RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[ey]:[RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[eq]:[RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[eH]:[RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[eB]:[RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[ez]:[RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[eG]:[RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[eJ]:[eZ],[eK]:[eZ],[eQ]:[eZ],[eU]:[RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[eV]:[RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[eW]:[RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[eY]:[RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[ex]:[RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[RegExp("rv:(\\d+(\\.\\d+)?)")]},e8=function(e,t,i,s){let r=e6[e4(e,t,i,s)];if(q(r))return null;for(let t=0;r.length>t;t++){let i=e.match(r[t]);if(i)return parseFloat(i[i.length-2])}return null},e9=[[RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[eI,e&&e[1]||""]],[RegExp(eM,"i"),[eM,""]],[RegExp(eO,"i"),[eO,""]],[e3,[em,""]],[RegExp(eA,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eT,""];if(new RegExp(ec).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];let i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){let e=e5[i[1]]||"";return/arm/i.test(t)&&(e="RT"),[eA,e]}return[eA,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{let t="";return e&&e.length>=3&&(t=q(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[ed,[e[2],e[3],e[4]||"0"].join(".")]:[ed,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{let t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],e7=function(e){for(let t=0;e9.length>t;t++){let[i,s]=e9[t],r=i.exec(e),n=r&&(D(s)?s(r,e):s);if(n)return n}return["",""]},te=function(e){return e2.test(e)?eM:e1.test(e)?eO:e0.test(e)?eI:RegExp(eL,"i").test(e)?eL:RegExp("(Windows Phone|WPDesktop)","i").test(e)?eT:/iPad/.test(e)?eg:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ev:e3.test(e)?em:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eR,"i").test(e)?eR:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(ec).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ed:ef:RegExp("(pda|Mobile)","i").test(e)?eD:RegExp(ep,"i").test(e)&&!RegExp("Tablet pc","i").test(e)?eN:""},tt=function(e,t){var i,s,r,n;let o=te(e);return o===eg||o===ef||"Kobo"===o||"Kindle Fire"===o||o===eN?ep:o===eM||o===eI||o===eO||o===eL?"Console":o===ev?"Wearable":o?ec:"Android"===(null==t?void 0:t.userAgentDataPlatform)&&(null!=(n=null==t?void 0:t.maxTouchPoints)?n:0)>0?600>Math.min(null!=(i=null==t?void 0:t.screenWidth)?i:0,null!=(s=null==t?void 0:t.screenHeight)?s:0)/(null!=(r=null==t?void 0:t.devicePixelRatio)?r:1)?ec:ep:"Desktop"},ti=/\bFBAV\/(\d+(?:\.\d+)*)/i,ts=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",ti],[/\bFBAN\/EMA\b/i,"Facebook Lite",ti],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",ti],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],tr="[Truncated]",tn="[Unserializable]";function to(e){let t="";for(let i=0;e.length>i;i++){let s=e.charCodeAt(i);if(55296>s||s>56319)t+=56320>s||s>57343?e[i]:"�";else{let s=e.charCodeAt(i+1);56320>s||s>57343?t+="�":(t+=e[i]+e[i+1],i++)}}return t}function ta(e,t){if(!t)return e;let i=[];try{i=Object.keys(t)}catch(e){i=[]}for(let s of i){let i;try{i=t[s]}catch(e){i=tn}Object.defineProperty(e,s,{value:i,enumerable:!0,writable:!0,configurable:!0})}return e}var tl=class{record(e){if("too-large"===e.kind)return;if("retry-later"!==e.kind)return void this.reset();if(!e.retryAfterMs)return;let t=this.isOpen(),i=Date.now(),s=Math.min(e.retryAfterMs,3e5);if(!t)return this.ts=i,void(this.es=i+s);this.es=Math.max(this.es,Math.min(i+s,this.ts+3e5))}remainingMs(){let e=Date.now();if(this.ts-5e3>e)return this.reset(),0;let t=Math.min(3e5,Math.max(0,this.es-e));return 0===t&&this.reset(),t}isOpen(){return this.remainingMs()>0}reset(){this.es=0,this.ts=0}constructor(){this.es=0,this.ts=0}};let tu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function th(e,t){return"string"==typeof e&&tu.test(e)?e:t()}function tc(e,t){let i=Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function td(e){return e?e.split("#")[0]:e}function tp(e){try{return e()}catch(e){return}}function tf(e,t){let i=setTimeout(e,t);return null!=i&&i.unref&&(null==i||i.unref()),i}function tg(e,t,i){return tv.apply(this,arguments)}function tv(){return(tv=en(function*(e,t,i){let s;try{return yield Promise.race([e,new Promise((e,r)=>{s=tf(()=>{try{null==i||i(),e()}catch(e){r(e)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}function t_(e){return(t_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tm(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,s)}return i}function ty(e){for(var t=1;arguments.length>t;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?tm(Object(i),!0).forEach(function(t){!function(e,t,i){var s;(s=function(e){if("object"!=t_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=t_(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==t_(s)?s:s+"")in e)?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i}(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):tm(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function tb(e,t,i){return e&&i?t.length===Object.keys(i).length&&t.every(t=>e[t]===i[t]):e===i}var tw=class{constructor(e,t,i=[]){this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t={}){let i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),r=this.buildParsingContext(t),n=this.parseStacktrace(s,r);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return en(function*(){for(let i of e)i.stacktrace&&i.stacktrace.frames&&L(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i;let s,r;if(null!=e.cause&&(s=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack)try{r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)}catch(e){}return ty(ty({},e),{},{cause:s,stack:r,errors:null==(i=e.errors)?void 0:i.map(e=>this.parseStacktrace(e,t))})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(let i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return en(function*(){let i=e;for(let e of t.modifiers)i=yield e(i);return i})()}convertToExceptionList(e,t){let i=[],s=(e,r,n)=>{var o;let a=i.length,l=void 0===r?ty(ty({type:"string"==typeof t.type&&t.type.length>0?t.type:"generic"},"boolean"==typeof t.handled?{handled:t.handled}:void 0===t.handled?{handled:!0}:{}),{},{synthetic:"boolean"==typeof t.synthetic?t.synthetic:e.synthetic,exception_id:a}):{type:"chained",source:n,synthetic:e.synthetic,exception_id:a,parent_id:r},u={type:e.type,value:e.value,mechanism:l};for(let t of(e.stack&&(u.stacktrace={type:"raw",frames:e.stack}),i.push(u),e.cause&&s(e.cause,a,"cause"),null!=(o=e.errors)?o:[]))s(t,a,"member")};return s(e),i}buildParsingContext(e){var t;return{chunkIdMap:function(e){let t=globalThis._posthogChunkIds,i=globalThis._debugIds;if(!t&&!i)return;let a=t?Object.keys(t):[],l=i?Object.keys(i):[];if(o&&tb(t,a,r)&&tb(i,l,n))return o;r=t?ty({},t):void 0,n=i?ty({},i):void 0,o={},null!=s||(s={});let u=(t,i)=>{for(let n of t){let t=i[n];if(!t)continue;let a=null==s?void 0:s[n];if(a){o[a]=t;continue}let l=e(n);for(let e=l.length-1;e>=0;e--){var r;let i=null==(r=l[e])?void 0:r.filename;if(i){o[i]=t,s[n]=i;break}}}};return i&&u(l,i),t&&u(a,t),o}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}getAggregateErrors(e){try{if(X(e)){let i=Object.getPrototypeOf(e);for(let s=0;i&&100>s;s++){var t;let s=null==(t=Object.getOwnPropertyDescriptor(i,"constructor"))?void 0:t.value;if("function"==typeof s&&"AggregateError"===s.name){let t=e.errors;return L(t)?t:void 0}i=Object.getPrototypeOf(i)}}}catch(e){}}buildCoercingContext(e,t,i=0){let s=0,r=0,n=!1,o=new Set,a=[],l={},u=(e,t,i=0)=>{let u,c,d=h(t,i),p=d.apply;if(d.apply=t=>{a.push(e);try{return p(t)}finally{a.pop()}},i>4||i>0&&-1!==a.indexOf(e))return this.coerceFallback(d);let f="object"==typeof e&&null!==e||"function"==typeof e;if(0===i&&s>=50||f&&o.has(e))return;f&&o.add(e),0===i&&s++;let g=this.getAggregateErrors(e);n||(n=!!g);try{if(!(u=this.applyCoercers(e,d)))throw l}catch(e){if(e===l)return void(0===i&&s--);if(!n)throw e;u=this.coerceFallback(d)}if(!g||s>=50)return u;try{c=g.length}catch(e){return u}if(!Number.isInteger(c)||0>c||c>0xffffffff)return u;let v=[];for(let e=0;50>s&&1e3>r&&c>e;e++){let i;r++;try{i=d.next(g[e])}catch(e){s++,i=this.coerceFallback(h(t+1))}i&&v.push(i)}return ty(ty({},u),{},{errors:v})},h=(i,s=0)=>ty(ty({},t),{},{syntheticException:0==i?t.syntheticException:void 0,mechanism:0==i?e:{},apply(e){let t=u(e,i,s+1);if(!t)throw l;return t},next:e=>u(e,i+1)}),c=h(i);return ty(ty({},c),{},{apply:e=>{var t;return null!=(t=u(e,i))?t:this.coerceFallback(c)}})}};let tx=/^([a-z][a-z0-9.+-]+):/i,tk=["http","https","file","blob","app","capacitor","ionic","webpack","webpack-internal","ng"];function t$(e,t,i,s,r){let n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:function(e){if(!e||"<anonymous>"===e)return!1;let t=tx.exec(e);return!t||tk.includes(t[1].toLowerCase())}(t)};return q(s)||(n.lineno=s),q(r)||(n.colno=r),n}let tE=(e,t)=>{let i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},tS=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tP=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tM=/\((\S*)(?::(\d+))(?::(\d+))\)/,tO=(e,t)=>{let i=tS.exec(e);if(i){let[,e,s,r]=i;return t$(t,e,"?",+s,+r)}let s=tP.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){let e=tM.exec(s[2]);e&&(s[2]=e[1],s[3]=e[2],s[4]=e[3])}let[e,i]=tE(s[1]||"?",s[2]);return t$(t,i,e,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},tI=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tF=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tC=(e,t)=>{let i=tI.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){let e=tF.exec(i[3]);e&&(i[1]=i[1]||"eval",i[3]=e[1],i[4]=e[2],i[5]="")}let e=i[3],s=i[1]||"?";return[s,e]=tE(s,e),t$(t,e,s,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tA=/\(error: (.*)\)/;function tT(e,t){return e.filename===t.filename&&e.function===t.function&&e.module===t.module&&e.lineno===t.lineno&&e.colno===t.colno}function tR(e,t){let i=t.start;for(;i>0&&tT(e[i-1],e[i-1+t.length]);)i--;return t.start-i}function tL(e,t){let i=t.start+t.length,s=i;for(;e.length>s&&tT(e[s],e[s-t.length]);)s++;return s-i}var tD=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){let i=H(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){let t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?`${t}: ${e.message}`:t}isDOMException(e){return Y(e,"DOMException")}isDOMError(e){return Y(e,"DOMError")}},tN=class{match(e){return X(e)}coerce(e,t){var i;let s=this.getStack(e),r=void 0===s?null==(i=t.syntheticException)?void 0:i.stack:void 0;return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=s?s:r,cause:e.cause?t.next(e.cause):void 0,synthetic:!!r}}getType(e){return e.name||e.constructor.name}getMessage(e,t){let i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){try{let t=e.stacktrace;if("string"==typeof t&&t.length>0)return t;let i=e.stack;return"string"==typeof i&&i.length>0?i:void 0}catch(e){return}}},tj=class{match(e){return!!Y(e,"ErrorEvent")&&(null!=e.error||this.ar(e))}coerce(e,t){var i;if(null!=e.error)return t.apply(e.error);let s=t.apply(e.message);return ty(ty({},s),{},{stack:null!=(i=this.lr(e))?i:s.stack,synthetic:!0})}ar(e){return H(e.message)&&e.message.length>0}lr(e){var t,i;let s=null!=(t=e.lineno)?t:0,r=null!=(i=e.colno)?i:0;if(H(e.filename)&&0!==e.filename.length&&0!==s)return`Error
|
|
2
2
|
at ${e.filename}:${s}:${r}`}};let tq=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var tH=class{match(e){return"string"==typeof e}coerce(e,t){var i;let[s,r]=this.getInfos(e);return{type:null!=s?s:"Error",value:null!=r?r:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){let t="Error",i=e,s=e.match(tq);return s&&(t=s[1],i=s[2]),[t,i]}};let tB=["fatal","error","warning","log","info","debug"];function tz(e,t=40){let i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(let e=i.length;e>0;e--){let s=i.slice(0,e).join(", ");if(t>=s.length)return e===i.length?s:s.length>t?`${s.slice(0,t)}...`:s}return""}var tU=class{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s;let r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null!=(i=this.getStack(e))?i:null==(s=t.syntheticException)?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(Z(e))return e.constructor.name;let t="name"in e?e.name:void 0;return H(t)&&!B(t)?t:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){let t=`'${e.name}' captured as exception`;return"message"in e&&"string"==typeof e.message&&(t+=` with message: '${e.message}'`),t}if("message"in e&&"string"==typeof e.message)return e.message;let t=this.getObjectClassName(e);return`${t&&"Object"!==t?`'${t}'`:"Object"} captured as exception with keys: ${tz(e)}`}isSeverityLevel(e){return H(e)&&!B(e)&&tB.indexOf(e)>=0}getStack(e){try{return H(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:H(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(let t in e)if(({}).hasOwnProperty.call(e,t)){let i=e[t];if(X(i))return i}}getObjectClassName(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},tV=class{match(e){return Z(e)}coerce(e,t){var i;let s=e.constructor.name;return{type:s,value:`${s} captured as exception with keys: ${tz(e)}`,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}},tW=class{match(e){return Q(e)}coerce(e,t){var i;return{type:"Error",value:`Primitive value captured as exception: ${String(e)}`,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}},tG=class{match(e){return Y(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Z(e))return!1;try{let t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var i;let s=this.getUnhandledRejectionReason(e);return Q(s)?{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(s)}`,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}};let tJ="$message",tK="$timestamp",tQ=new Set([tJ,tK]),tY={enabled:!0,max_bytes:32768};function tX(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tY.enabled,max_bytes:function(e,t){if(!V(e)||1/0===e||-1/0===e)return t;let i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tY.max_bytes)}:ty({},tY)}var tZ=class{constructor(e){this.ns=[],this.ss=0,this.Mr=tX(e)}setConfig(e){this.Mr=tX(e),this.rs()}add(e){let t=function(e){let t;try{t=C(e)}catch(e){return}try{let e=JSON.parse(t);if(!N(e))return;let i=e[tJ],s=e[tK];if(!H(i)||0===i.trim().length||!H(s)&&!V(s))return;return{step:e,json:t}}catch(e){return}}(e);if(!t)return;let i=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;let t=encodeURIComponent(e),i=0;for(let e=0;t.length>e;e++)"%"===t[e]?(i+=1,e+=2):i+=1;return i}(t.json);i>this.Mr.max_bytes||(this.ns.push({step:t.step,bytes:i}),this.ss+=i,this.rs())}getAttachable(){return this.ns.map(e=>e.step)}clear(){this.ns=[],this.ss=0}size(){return this.ns.length}rs(){for(;this.ss>this.Mr.max_bytes&&this.ns.length>0;){let e=this.ns.shift();e&&(this.ss-=e.bytes)}}};let t0=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function t1(e){return"string"==typeof e||e}function t2(e){return"string"==typeof e?e:void 0}let t3=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],t5="NativeGzipValidationError",t4=e=>e.length>=2&&31===e[0]&&139===e[1],t6=(e,t)=>e===S.GZipJS||t===S.GZipJS||"gzip"===t,t8=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),t9=e=>{throw tc(t5,`Native gzip produced invalid output: ${e}`)},t7=(u=en(function*(e,t){18>e.size&&t9("too-short");let i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));t4(i)&&8===i[2]||t9("invalid-header");let s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{let t=(()=>{if(a)return a;a=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)t=1&t?0xedb88320^t>>>1:t>>>1;a[e]=t>>>0}return a})(),i=0xffffffff;for(let s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&t9("invalid-crc");let r=t.length>>>0;s.getUint32(4,!0)!==r&&t9("invalid-size")}),function(e,t){return u.apply(this,arguments)});function ie(){return(ie=en(function*(e,t=!0,i){var s;try{let t=(new TextEncoder).encode(e),i=new globalThis.CompressionStream("gzip"),r=i.writable.getWriter(),n=r.write(t).then(()=>r.close()).catch((s=en(function*(e){try{yield r.abort(e)}catch(e){}throw e}),function(e){return s.apply(this,arguments)})),o=new Response(i.readable).blob(),[a]=yield Promise.all([o,n]);return yield t7(a,t),a}catch(e){if(null==i?void 0:i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}function it(e,t){if(null==e)return{};var i,s,r=function(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(t.includes(s))continue;i[s]=e[s]}return i}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(s=0;n.length>s;s++)t.includes(i=n[s])||({}).propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}let ii="[redacted]",is=/^[A-Za-z0-9+/\n\r]+=*$/,ir=/^[A-Za-z0-9_-]+={0,2}$/,io=/[-_]/,ia=/^data:[^,\s]*;base64,/i,il=/^[A-Za-z0-9+/_-]+={0,2}$/,iu=/\bph[a-z]_[A-Za-z0-9_-]{20,}\b/g,ih=/^(authorization|cookie|set-cookie|x-api-key|api[-_]?key|api[-_]?token|access[-_]?token|refresh[-_]?token|token|password|secret|client[-_]?secret|private[-_]?key)$/i,ic=/[a-z][a-z0-9+.-]{0,63}:[^\s<>"]+/gi,id=/[\s<>"]/,ip=RegExp(ic.source,"i"),ig=/[a-z][a-z0-9+.-]{0,63}:\/\//i,iv=RegExp(`^${ig.source}`,"i"),i_=RegExp(ig.source,"gi"),im=/(^|[-_./;])(auth|token|secret|password|passwd|pwd|credential|signature|sig|key|hmac|sas|bearer|jwt|session|sessionid)([-_./;]|$)/i,iy=/^(code|AWSAccessKeyId|GoogleAccessId|Policy)$/i,ib=/[\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]/g,iw=/[A-Za-z0-9._%+-]{1,64}@[A-Za-z0-9.-]{1,255}\.[A-Za-z]{2,24}/g,ix=/\b(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\b/g,ik=/(^|[^\w:])((?:(?:[0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(?:[0-9A-Fa-f]{1,4}:){1,7}:|(?:[0-9A-Fa-f]{1,4}:){1,6}:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,5}|::(?:[0-9A-Fa-f]{1,4}(?::[0-9A-Fa-f]{1,4}){0,6})))(?=$|[^\w:])/g,i$=/\b\d{3}[ .-]\d{2}[ .-]\d{4}\b/g,iE=/\b\d(?:[ ./-]?\d){12,}\b/g,iS=/\d+/g,iP=/(^|[^\w+])((?:\+?1[ ./-]?)?(?:\(\d{3}\)[ ./-]?|\d{3}[ ./-])\d{3}[ ./-]\d{4})(?![\w])/g,iM=/(^|[^\w])(\+\d{1,3}(?:[ ./()-]{0,2}\d){7,13})(?![\w])/g;function iO(e){return ih.test(e)||im.test(e)||iy.test(e)}function iI(e){return e.split("&",129).length>128}function iF(e,t){let i=new URLSearchParams,s=!1,r=!1;for(let[l,u]of new URLSearchParams(e)){var n,o,a;let e=iR(l),h=iR(u);s||(s=e!==l||h!==u);let c=(n=e,o=h,a=t,iO(n)||o.includes(";")&&o.split(";").some(e=>iO(e.split("=",1)[0]))?ii:ip.test(o)?a?iT(o,{allowNestedUrls:!1,stripPunctuation:!0}):ii:o);s||(s=c!==h),r=iO(e)||c!==h,i.append(e,c)}return{changed:s,lastFieldSensitive:r,serialized:i.toString()}}function iC(e,t){if(!e.includes("=")){var i;return{value:(i=e,t?iT(i,{allowNestedUrls:!1,stripPunctuation:!0}):ip.test(i)?ii:i),lastFieldSensitive:!1}}let s=iF(e,t);return{value:s.changed?s.serialized:e,lastFieldSensitive:s.lastFieldSensitive}}function iA(e,t){var i,s;let r;if(e.length>8192&&iv.test(e))return ii;let{address:n,suffix:o}=t.stripPunctuation?function(e){let t=e.length;for(;t>0&&".,;:!?)]}'".includes(e[t-1]);)t--;return{address:e.slice(0,t),suffix:e.slice(t)}}(e):{address:e,suffix:""};try{r=new URL(n)}catch(e){return ii+o}let a=r.search.slice(1),l=""!==r.hash,u=function(e){let t=e.slice(1),i=t.indexOf("?");return 0>i?{head:t,tail:null}:{head:t.slice(0,i),tail:t.slice(i+1)}}(r.hash);if(iI(a)||iI(u.head)||iI(null!=(i=u.tail)?i:""))return ii+o;let h=!1;(r.username||r.password)&&(r.username=ii,r.password="",h=!0);let c=iF(a,t.allowNestedUrls);c.changed&&(r.search=c.serialized,h=!0);let d=iC(u.head,t.allowNestedUrls),p=null===u.tail?null:(s=u.tail,d.lastFieldSensitive?{value:""===s?"":ii,lastFieldSensitive:!0}:iC(s,t.allowNestedUrls)),f=null===p?d.value:`${d.value}?${p.value}`;f!==r.hash.slice(1)&&(r.hash=f,h=!0);let g=l?null!=p?p:d:c;return(h?iR(r.toString()):n)+(g.lastFieldSensitive?"":o)}function iT(e,t){return e.replace(ic,i=>(function(e,t){let i=function(e){if(!e.includes("://"))return[];let t=[...e.matchAll(i_)].map(e=>e.index),i=[],s={query:!1,fragment:!1,fragmentQuery:!1},r=0,n=!1,o="";for(let l=0;e.length>l&&t.length>r;l++){var a;t[r]===l&&(l>0&&"="!==o&&i.push(l),r++);let u=e[l];(a=o,"#"===u?!s.fragment&&(s.fragment=!0):"?"===u&&(s.fragment?"="!==a&&!s.fragmentQuery&&(s.fragmentQuery=!0):!s.query&&(s.query=!0)))?(o=u,n=!0):n&&"=&".includes(u)&&(o=u)}return i}(e);if(0===i.length)return iA(e,t);let s="",r=0;for(let n of i)s+=iA(e.slice(r,n),ty(ty({},t),{},{stripPunctuation:!1})),r=n;return s+iA(e.slice(r),t)})(i,ty(ty({},t),{},{stripPunctuation:t.stripPunctuation&&i.length!==e.length})))}function iR(e){return e.replace(iu,ii)}function iL(e,t){return e.length>=10240&&(is.test(e)||function(e){let t,i=ia.exec(e);if(!i)return!1;try{t=decodeURIComponent(e.slice(i[0].length))}catch(e){return!1}return il.test(t.replace(/[\r\n]/g,""))}(e)||io.test(e)&&ir.test(e))?"[binary data redacted - not supported by PostHog MCP analytics]":function(e,t,i){let s=4*i.maxStringLength;if(e.length>s){let r=t(e.slice(0,function(e,t){let i=t;for(;i>0&&!id.test(e[i-1]);)i--;return i}(e,s)));if(r.length>=2*i.maxStringLength)return r+i.truncationSuffix}return t(e)}(e,e=>iT(iR(e).replace(ib," ").replace(iw,ii).replace(ix,ii).replace(ik,`$1${ii}`).replace(iE,iD).replace(i$,ii).replace(iP,`$1${ii}`).replace(iM,`$1${ii}`),{allowNestedUrls:!0,stripPunctuation:!0}),t)}function iD(e){let t=[];for(let i=iS.exec(e);null!==i;i=iS.exec(e))t.push({digits:i[0],start:i.index,end:i.index+i[0].length});let i="",s=0,r=0;for(;t.length>r;){let n="",o=-1;for(let e=r;t.length>e&&19>=(n+=t[e].digits).length;e++)n.length>=13&&function(e){let t=0,i=!1;for(let s=e.length-1;s>=0;s--){let r=e.charCodeAt(s)-48;if(0>r||r>9)return!1;i&&(r*=2)>9&&(r-=9),t+=r,i=!i}return t%10==0}(n)&&(o=e);0>o?r++:(i+=e.slice(s,t[r].start)+ii,s=t[o].end,r=o+1)}return i+e.slice(s)}let iN={}.propertyIsEnumerable;function ij(e,t){try{return iq(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function iq(e,t,i,s){let r=[];for(let n in e)if(iN.call(e,n)){if(!n){null==t||t.debug("Dropping an attribute with an empty key");continue}if(r.length>=1e3||0>=i.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{let o=e[n];if(z(o)||q(o))continue;r.push({key:to(n),value:function e(t,i,s,r){if(0>=s.remainingNodes)return{stringValue:tr};if(s.remainingNodes--,G(t))return{boolValue:t};if("bigint"==typeof t){let e=t.toString(),s=BigInt("9223372036854775808");return t>=s||-s>t?(null==i||i.debug(`Attribute ${e} is outside the int64 range; encoding it as a string`),{stringValue:e}):{intValue:e}}if("number"==typeof t){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};let e=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>t?(null==i||i.debug(`Attribute ${e} is outside the int64 range; encoding it as a string`),{stringValue:e}):{intValue:e}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:to(t)};if("function"==typeof t)return{stringValue:"[Function]"};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(s.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:tr};if(t instanceof Date){let e=Number.isFinite(t.getTime())?t.toISOString():String(t);return{stringValue:"string"==typeof e?to(e):String(e)}}s.ancestors.add(t);try{try{let n=t.toJSON;if("function"==typeof n)return e(n.call(t),i,s,r+1)}catch(e){}return L(t)?{arrayValue:{values:function(t,i,s,r){let n=[],o=Math.min(t.length,1e3),a=0;for(;o>a&&s.remainingNodes>0;a++)try{let o=a in t?t[a]:void 0;if(U(o))continue;n.push(e(o,i,s,r))}catch(e){n.push({stringValue:tn})}return t.length>a&&n.push({stringValue:tr}),n}(t,i,s,r+1)}}:{kvlistValue:{values:iq(t,i,s,r+1)}}}finally{s.ancestors.delete(t)}}return{stringValue:to(String(t))}}(o,t,i,s)})}catch(e){r.push({key:to(n),value:{stringValue:tn}})}}return r}function iH(e,t,i){return ty(ty(ty(ty({},ta({},e.resourceAttributes)),{},{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment}),e.serviceVersion&&{"service.version":e.serviceVersion}),{},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}let iB=["service.name","deployment.environment","service.version","telemetry.sdk.name","telemetry.sdk.version"];function iz(e,t){let i=ta({},e),s={};for(let e of iB)({}).hasOwnProperty.call(i,e)&&(s[e]=i[e],delete i[e]);return[...ij(i,t),...ij(s,t)]}let iU={darwin:"macOS",win32:"Windows",cygwin:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",netbsd:"NetBSD",sunos:"SunOS",aix:"AIX",haiku:"Haiku","Mac OS X":"macOS"},iV={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},iW=iV.info;function iG(e,t,i,s){return{resourceLogs:[{resource:{attributes:iz(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}var iJ=class{constructor(e){this.ls=e,this.us=0}get pending(){return!!this.cs}arm(e){this.clear(),this.us=Date.now()+e,this.cs=tf(()=>{this.cs=void 0,this.ls()},e)}armNoEarlierThan(e){this.cs&&Date.now()+e<=this.us||this.arm(e)}clear(){this.cs&&(clearTimeout(this.cs),this.cs=void 0)}};function iK(){return .75+.5*Math.random()}function iQ(e,t,i,s){let r=e*Math.pow(2,Math.min(Math.max(0,t-1),6));return Math.round((void 0===s?r:Math.min(r,Math.max(s,e)))*i)}var iY=class{constructor(e,t,i,s,r,n=()=>Promise.resolve(),o){var a;this._instance=e,this.Mr=t,this.A=i,this.hs=s,this.ds=r,this.vs=n,this.fs=o,this.ps=new iJ(()=>this.gs()),this.ys=null,this.bs=0,this._s=0,this.ws=new tl,this.ks=0,this.Ss=1,this.xs=0,this.$s=0,this.Cs=!1,this.Ts=t.maxBufferSize,this.Is=Math.max(null!=(a=t.maxQueueSize)?a:t.maxBufferSize,t.maxBufferSize),this.Ms=t.flushIntervalMs,this.Es=t.maxBatchRecordsPerPost,this.Ps=t.rateCapWindowMs,this.Rs=t.maxLogsPerInterval}clearQueue(){this._s++,this._instance.setPersistedProperty(E.LogsQueue,[])}reset(){this.ps.clear(),this.xs=0,this.$s=0,this.Cs=!1,this.ks=0,this.Ss=1,this.ws.reset(),this.Es=this.Mr.maxBatchRecordsPerPost}onReconnect(){this.ks=0,this.Ss=1,this.ws.isOpen()?this.As()&&this.Fs():this.gs()}captureLog(e,t){var i;if(this._instance.isDisabled||this._instance.optedOut||!(null==e?void 0:e.body))return;let s=this.Os(e);if(null===s)return;if(!s.body)return void this.A.info("Log was rejected in beforeSend function");if(!this.Ds())return;let r={record:function(e,t,i,s){let{text:r,number:n}=iV[e.level||"info"]||iW,o=function(e=Date.now()){return String(e)+"000000"}(V(s)?s:void 0),a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a["window.id"]=t.windowId),U(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),U(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);let l=ty({},a),u=e.attributes;if(u){let e=[];try{e=Object.keys(u)}catch(t){e=[]}for(let t of e){let e;try{e=u[t]}catch(t){e=tn}Object.defineProperty(l,t,{value:e,enumerable:!0,writable:!0,configurable:!0})}}let h={timeUnixNano:o,observedTimeUnixNano:o,severityNumber:n,severityText:r,body:{stringValue:function(e){try{return to(String(e))}catch(e){return tn}}(e.body)},attributes:ij(l,i)};return e.trace_id&&(h.traceId=e.trace_id),e.span_id&&(h.spanId=e.span_id),q(e.trace_flags)||(h.flags=e.trace_flags),h}(s,null!=(i=null==t?void 0:t.context)?i:this.hs(),this.A,null==t?void 0:t.occurredAtMs)};this.ds(()=>this.Ls(r))}Os(e){let t=this.Mr.beforeSend;if(!t)return e;let i=L(t)?t:[t],s=e;for(let e of i)try{let t=e(s);if(!t)return this.A.info("Log was rejected in beforeSend function"),null;s=t}catch(e){return this.A.error("Error in beforeSend function for log:",e),null}return s}Ds(){if(void 0===this.Rs)return!0;let e=Date.now(),t=e-this.xs;return this.Ps>t&&t>=0||(this.xs=e,this.$s=0,this.Cs=!1),this.Rs>this.$s?(this.$s++,!0):(this.Cs||(this.A.warn(`captureLog dropping logs: exceeded ${this.Rs} logs per ${this.Ps}ms`),this.Cs=!0),!1)}flush(){var e=this;return en(function*(){if(!e._instance.isDisabled)return e.ys||(e.ys=e.Ns().finally(()=>{e.ys=null})),e.ys})()}Ns(){var e=this;return en(function*(){var t,i,s;e.ps.clear();let r=null!=(t=e._instance.getPersistedProperty(E.LogsQueue))?t:[];if(0===r.length)return;let n=r.length,o=0;for(;r.length>0&&n>o;){let t=e._s;e.bs=0;let n=Math.min(r.length,e.Es),a=r.slice(0,n),l=iG(a.map(e=>e.record),e.qs(),null!=(i=e.fs)?i:e._instance.getLibraryId(),e._instance.getLibraryVersion()),u=yield e._instance.js(l);if(e._s!==t)return;if("too-large"===u.kind&&a.length>1)e.Es=Math.max(1,Math.floor(a.length/2)),e.A.warn(`Logs batch of size ${a.length} was too large for the ingestion endpoint, reducing batch size to ${e.Es}`);else if(e.ws.record(u),e.ps.pending&&e.ps.arm(Math.max(e.Ms,e.ws.remainingMs())),"retry-later"===u.kind||("too-large"===u.kind?e.A.warn("Dropping a single log record with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===u.kind&&e.Mr.maxBatchRecordsPerPost>e.Es&&(e.Es=Math.min(e.Mr.maxBatchRecordsPerPost,e.Es+1)),yield e.Bs(a.length),r=null!=(s=e._instance.getPersistedProperty(E.LogsQueue))?s:[],o+=a.length,"fatal"===u.kind))throw u.error}})()}Bs(e){var t=this;return en(function*(){var i;let s=Math.max(0,e-t.bs),r=null!=(i=t._instance.getPersistedProperty(E.LogsQueue))?i:[];t._instance.setPersistedProperty(E.LogsQueue,r.slice(s)),yield t.vs()})()}qs(){var e;return e=this.Mr,iH(e,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ls(e){var t;if(this._instance.optedOut)return;let i=null!=(t=this._instance.getPersistedProperty(E.LogsQueue))?t:[];this.Is>i.length||(i.shift(),this.bs++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(E.LogsQueue,i),this.Ts>i.length||this.ws.isOpen()?this.Fs():this.gs()}Fs(){this.ps.pending||this.ps.arm(Math.max(this.Ms,this.ws.remainingMs()))}zs(){return Math.max(iQ(this.Ms,this.ks,this.Ss,3e4),this.ws.remainingMs())}As(){let e=this._instance.getPersistedProperty(E.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return en(function*(){t.ps.clear();let i=t.flush().catch(()=>{});void 0!==e?yield tg(i,e):yield i})()}flushWithTimeout(e){var t=this;return en(function*(){let i=t.flush();yield tg(i,e,()=>{i.catch(()=>{})})})()}gs(){this.flush().then(()=>{this.ks=0,this.Ss=1},e=>{this.ks++,this.Ss=iK(),this.A.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.As()&&this.ps.armNoEarlierThan(this.zs())})}};let iX=/^[0-9a-f]+$/;function iZ(e,t,i){return"string"==typeof e&&e.length===t&&e!==i&&iX.test(e)}let i0=/^([0-9a-f]{2})-([0-9a-f]{32})-([0-9a-f]{16})-([0-9a-f]{2})(-.*)?$/,i1=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function i2(e){return String(e)+"000000"}function i3(e,t,i,s){let r="";return s&&(r=Object.keys(s).sort().map(e=>`${JSON.stringify(e)}:${JSON.stringify(s[e])}`).join(",")),`${e}\0${t}\0${null!=i?i:""}\0${r}`}var i5=class{constructor(e,t,i){this._instance=e,this.Mr=t,this.A=i,this.Hs=new Map,this.ps=new iJ(()=>this.flush().catch(e=>{this.A.error("Metrics flush failed:",e)})),this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.ws=new tl,this.ks=0,this.Ss=1,this.Gs=0}count(e,t=1,i){this.Qs({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(e,t,i){this.Qs({name:e,type:"gauge",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(e,t,i){this.Qs({name:e,type:"histogram",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var e,t=this;let i=this.ys,s=(e=en(function*(){i&&(yield i.catch(()=>{})),yield t.Zs()}),function(){return e.apply(this,arguments)})().finally(()=>{this.ys===s&&(this.ys=null)});return this.ys=s,s}drainWindow(){if(0===this.Hs.size)return null;let e=this.Hs;return this.Hs=new Map,this.Us=!1,this.Ws=new Map,this.Vs=new Set,this.Js(e)}reset(){this.Gs++,this.ws.reset(),this.ks=0,this.Ss=1,this.ps.clear(),this.Hs=new Map,this.ys=null,this.Us=!1,this.Ws=new Map,this.Vs=new Set}Qs(e){let t,i;if(this._instance.isDisabled||this._instance.optedOut)return;let s=this.Os(e);if(null===s)return;if(!s.name||"string"!=typeof s.name)return void this.A.warn("Dropping metric with empty name");if("number"!=typeof s.value||!Number.isFinite(s.value))return void this.A.warn(`Dropping metric '${s.name}': value must be a finite number`);if("count"===s.type&&0>s.value)return void this.A.warn(`Dropping count '${s.name}': counters are monotonic, value must be >= 0`);try{t=s.attributes?ty({},s.attributes):void 0,i=i3(s.type,s.name,s.unit,t)}catch(e){return void this.A.warn(`Dropping metric '${s.name}': attributes could not be serialized`,e)}let r=this.Hs.get(i);if(!r){if(!this.Ks())return;r={name:s.name,type:s.type,unit:s.unit,attributes:t,windowStartMs:Date.now()},this.Hs.set(i,r)}let n=this.Ws.get(s.name);void 0===n?this.Ws.set(s.name,s.type):n===s.type||this.Vs.has(s.name)||(this.Vs.add(s.name),this.A.warn(`Metric name '${s.name}' is already used as a ${n}; recording it as a ${s.type} too will blend both series in charts. Use a distinct name.`)),this.Xs(r,s.value);let o=this.Ys();o&&(r.exemplar=ty(ty({},o),{},{value:s.value,timeMs:Date.now()})),this.Fs()}Ys(){try{var e,t;let i=function(e){var t;let i=function(e){if("string"!=typeof e)return;let t=i0.exec(e.trim());if(!t)return;let[,i,s,r,n,o]=t;return"ff"!==i&&("00"!==i||!o)&&iZ(s,32,"00000000000000000000000000000000")&&iZ(r,16,"0000000000000000")?{version:i,traceId:s,spanId:r,flags:n}:void 0}(e);return i&&{traceId:i.traceId,spanId:i.spanId,flags:(t=i.flags,1&parseInt(t,16)?"01":"00")}}(null==(e=(t=this._instance).getActiveSpan)||null==(e=e.call(t))?void 0:e.traceparent());if(i&&"01"===i.flags)return{traceId:i.traceId,spanId:i.spanId}}catch(e){}}Ks(){return this.Mr.maxSeriesPerFlush>this.Hs.size||(this.Us||(this.Us=!0,this.A.warn(`Metric series cap reached (${this.Mr.maxSeriesPerFlush} per flush window); dropping new series until the next flush. Reduce attribute cardinality.`)),!1)}Xs(e,t){switch(e.type){case"count":var i;e.total=(null!=(i=e.total)?i:0)+t;break;case"gauge":e.last=t;break;case"histogram":{e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:Array(i1.length+1).fill(0)});let i=e.hist;i.count+=1,i.sum+=t,i.min=Math.min(i.min,t),i.max=Math.max(i.max,t),i.bucketCounts[function(e,t){for(let i=0;t.length>i;i++)if(t[i]>=e)return i;return t.length}(t,i1)]+=1}}}Os(e){let t=this.Mr.beforeSend;if(!t)return e;let i=L(t)?t:[t],s=e;for(let e of i)try{let t=e(s);if(!t)return this.A.info("Metric was rejected in beforeSend function"),null;s=t}catch(e){return this.A.error("Error in beforeSend function for metric:",e),null}return s}Fs(){this.ps.pending||this.ps.arm(this.zs())}zs(){return Math.max(iQ(this.Mr.flushIntervalMs,this.ks,this.Ss,3e4),this.ws.remainingMs())}Zs(){var e=this;return en(function*(){if(e.ps.clear(),0===e.Hs.size)return;let t=e.Hs;e.Hs=new Map,e.Us=!1,e.Ws=new Map,e.Vs=new Set;let i=e.Gs,s=yield e._instance.co(e.Js(t));if(i===e.Gs)switch(e.ws.record(s),"retry-later"===s.kind?(e.ks++,e.Ss=iK()):(e.ks=0,e.Ss=1),e.ps.pending&&e.ps.arm(e.zs()),s.kind){case"ok":return;case"retry-later":return e.ho(t),void e.ps.armNoEarlierThan(e.zs());case"too-large":return void e.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.A.error("Failed to send metrics batch:",s.error)}})()}Js(e){var t,i,s,r;return t=this.do(e),i=iH(this.Mr,this._instance.getLibraryId(),this._instance.getLibraryVersion()),s=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:iz(i)},scopeMetrics:[{scope:{name:s,version:r},metrics:t}]}]}}do(e){let t=i2(Date.now()),i=new Map;for(let a of e.values()){var s,r,n,o;let e=i3(a.type,a.name,a.unit,void 0),l=i.get(e);l||(l=ty({name:a.name},a.unit&&{unit:a.unit}),"count"===a.type?l.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===a.type?l.gauge={dataPoints:[]}:l.histogram={aggregationTemporality:1,dataPoints:[]},i.set(e,l));let u=ij(null!=(s=a.attributes)?s:{},this.A),h=i2(a.windowStartMs),c=(o=a.exemplar)?{exemplars:[{filteredAttributes:[],timeUnixNano:i2(o.timeMs),asDouble:o.value,traceId:o.traceId,spanId:o.spanId}]}:{};if("count"===a.type){let e=ty({attributes:u,startTimeUnixNano:h,timeUnixNano:t,asDouble:null!=(r=a.total)?r:0},c);l.sum.dataPoints.push(e)}else if("gauge"===a.type){let e=ty({attributes:u,timeUnixNano:t,asDouble:null!=(n=a.last)?n:0},c);l.gauge.dataPoints.push(e)}else if(a.hist){let e=ty({attributes:u,startTimeUnixNano:h,timeUnixNano:t,count:a.hist.count,sum:a.hist.sum,min:a.hist.min,max:a.hist.max,bucketCounts:a.hist.bucketCounts,explicitBounds:i1},c);l.histogram.dataPoints.push(e)}}return Array.from(i.values())}ho(e){for(let[r,n]of e){var t,i,s;let e=this.Hs.get(r);if(e)switch(e.windowStartMs=Math.min(e.windowStartMs,n.windowStartMs),e.exemplar=null!=(t=e.exemplar)?t:n.exemplar,e.type){case"count":e.total=(null!=(i=e.total)?i:0)+(null!=(s=n.total)?s:0);break;case"gauge":break;case"histogram":if(n.hist)if(e.hist){e.hist.count+=n.hist.count,e.hist.sum+=n.hist.sum,e.hist.min=Math.min(e.hist.min,n.hist.min),e.hist.max=Math.max(e.hist.max,n.hist.max);for(let t=0;e.hist.bucketCounts.length>t;t++)e.hist.bucketCounts[t]+=n.hist.bucketCounts[t]}else e.hist=n.hist}else this.Ks()&&this.Hs.set(r,n)}}};let i4=(e,{debugEnabled:t}={})=>{let i={N(i,...s){let r;try{r=typeof window>"u"?void 0:window}catch(e){return}r&&($.DEBUG||r.POSTHOG_DEBUG||t)&&!q(r.console)&&r.console&&("__rrweb_original__"in r.console[i]?r.console[i].__rrweb_original__:r.console[i])(e,...s)},debug(...e){i.N("debug",...e)},info(...e){i.N("log",...e)},warn(...e){i.N("warn",...e)},error(...e){i.N("error",...e)},critical(...t){console.error(e,...t)},uninitializedWarning(e){i.error(`You must initialize PostHog before calling ${e}`)},createLogger:(t,i)=>i4(`${e} ${t}`,i)};return i},i6=i4("[PostHog.js]"),i8=i6.createLogger,i9=i8("[ExternalScriptsLoader]"),i7=e=>{let t=null==f?void 0:f.querySelectorAll("script");if(t){for(let i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]}},se=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return i9.warn(`${t} was requested but loading of external scripts is disabled.`),i("Loading of external scripts is disabled");let s=i7(t);if(s){if(s.__posthog_loading_callback_fired)return i();let e=s.__posthog_loading_error;return e?i(e):(s.addEventListener("load",e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)}),void s.addEventListener("error",e=>{s.__posthog_loading_error=e,i(e)}))}let r=()=>{if(!f)return i("document not found");if(i7(t))return se(e,t,i);let s=f.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>{s.__posthog_loading_error=e,i(e)},e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)f.head.appendChild(s);else{var r;let e=f.querySelectorAll("body > script");e.length>0?null==(r=e[0].parentNode)||r.insertBefore(s,e[0]):f.body.appendChild(s)}};(null==f?void 0:f.body)?r():null==f||f.addEventListener("DOMContentLoaded",r)},st={},si=(e,t)=>{let i=`/static/${t}.js?v=${e.version}`;return"toolbar"===t&&(i=`${i}&t=${3e5*Math.floor(Date.now()/3e5)}`),e.requestRouter.endpointFor("assets",i)};x.__PosthogExtensions__=x.__PosthogExtensions__||{},x.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"===t){let t=e.requestRouter.endpointFor("assets",`/array/${e.config.token}/config.js`);return void se(e,t,i)}let s=e.config.strict_script_versioning;if(s){let r=e.requestRouter.endpointFor("assets",`/static/${e.version}/${t}.js`),n=st[r];if("fallback"===s&&n){if(i7(n))return void se(e,n,i);delete st[r]}return void se(e,r,"fallback"===s?(s,n)=>{if(s)if("string"==typeof s)i(s);else{var o;let s=si(e,t);st[r]=s;let n=i7(r);null==n||null==(o=n.parentNode)||o.removeChild(n),se(e,s,i)}else i(void 0,n)}:i)}se(e,si(e,t),i)},x.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{let s=e.requestRouter.endpointFor("api",t);se(e,s,i)},$.DEBUG=!1,$.LIB_VERSION="1.438.12",$.LIB_NAME="web";let ss="$early_access_features",sr="$active_feature_flags",sn="$feature_flag_details",so="$feature_flag_errors",sa="$feature_flag_evaluated_at",sl="$feature_flag_request_id",su="$minimal_flag_called_events",sh="$enabled_feature_flags",sc="$stored_group_properties",sd="$stored_person_properties",sp="$flag_call_reported",sf="$flag_call_reported_session_id",sg="$feature_flag_payloads",sv="$override_feature_flags",s_="$override_feature_flag_payloads",sm="visibilitychange",sy="distinct_id",sb="$device_id",sw="$device_model",sx="__alias",sk="$fbc",s$="$fbc_persistence",sE="$fbp",sS="$fbp_persistence",sP="__timers",sM="$autocapture_disabled_server_side",sO="$heatmaps_enabled_server_side",sI="$exception_capture_enabled_server_side",sF="$error_tracking_suppression_rules",sC="$error_tracking_capture_extension_exceptions",sA="$web_vitals_enabled_server_side",sT="$dead_clicks_enabled_server_side",sR="$product_tours_enabled_server_side",sL="$logs_capture_enabled_server_side",sD="$web_vitals_allowed_metrics",sN="$session_recording_remote_config",sj="$sesid",sq="$session_is_sampled",sH="$groups",sB="$surveys",sz="$surveys_loaded_at",sU="$surveys_activated",sV="$surveys_activated_session",sW="$surveys_activated_timestamps",sG="ph_product_tours",sJ="$user_state",sK="$client_session_props",sQ="$initial_campaign_params",sY="$initial_referrer_info",sX="$initial_person_info",sZ="$epp",s0="$posthog_cookieless",s1="$cookieless_mode",s2="$sdk_debug_extensions_init_method",s3="$sdk_debug_extensions_init_time_ms",s5="$sdk_debug_recording_script_not_loaded",s4="$sdk_debug_replay_stale_config",s6="$sdk_debug_replay_event_trigger_status",s8="$sdk_debug_replay_linked_flag_trigger_status",s9="$sdk_debug_replay_matched_recording_trigger_groups",s7="$sdk_debug_replay_pending_trigger_conditions",re="$sdk_debug_replay_remote_trigger_matching_config",rt="$sdk_debug_replay_trigger_groups_count",ri="$sdk_debug_replay_url_trigger_status",rs="PostHog loadExternalDependency extension not found.",rr="anonymous",rn="identified",ro="identified_only",ra="beforeunload",rl="$pageview",ru="$pageleave",rh="$identify",rc="$groupidentify";function rd(e,t){L(e)&&e.forEach(t)}function rp(e,t){if(!U(e))if(L(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(let i in e)T.call(e,i)&&t(e[i],i)}let rf=function(e,...t){for(let i of t)for(let t in i)void 0!==i[t]&&(e[t]=i[t]);return e};function rg(e){let t=Object.keys(e),i=t.length,s=Array(i);for(;i--;)s[i]=[t[i],e[t[i]]];return s}let rv=function(e){return function(...t){try{return e.apply(this,t)}catch(e){i6.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),i6.critical(e)}}},r_=function(e){let t={};return rp(e,function(e,i){(H(e)&&e.length>0||V(e))&&(t[i]=e)}),t};function rm(e){let t=ty({},e);for(let i of["name","message","stack","cause","errors"])try{i in e&&(t[i]=e[i])}catch(e){}return t}let ry=["herokuapp.com","vercel.app","netlify.app"];function rb(e,t,i,s){let{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}function rw(e){return"ph_toolbar_internal"===e.name}let rx=e=>{if(f){try{let t=e+"=",i=f.cookie.split(";").filter(e=>e.length);for(let e=0;i.length>e;e++){let s=i[e];for(;" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return V(e)&&isFinite(e)&&Math.floor(e)===e});var rk=class e{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(t,i,s,r){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||!Number.isInteger(r)||0>t||0>i||0>s||0>r||t>0xffffffffffff||i>4095||s>0x3fffffff||r>0xffffffff)throw RangeError("invalid field value");let n=new Uint8Array(16);return n[0]=t/0x10000000000,n[1]=t/0x100000000,n[2]=t/0x1000000,n[3]=t/65536,n[4]=t/256,n[5]=t,n[6]=112|i>>>8,n[7]=i,n[8]=128|s>>>24,n[9]=s>>>16,n[10]=s>>>8,n[11]=s,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new e(n)}toString(){let e="";for(let t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new e(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(let t=0;16>t;t++){let i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}},r$=class{generate(){let e=this.generateOrAbort();if(!q(e))return e;{this.Ct=0;let e=this.generateOrAbort();if(q(e))throw Error("Could not generate UUID after timestamp reset");return e}}generateOrAbort(){let e=(()=>{let e=Date.now();return V(e)&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0})();if(e>this.Ct)this.Ct=e,this.It();else{if(this.Ct>=e+1e4)return;this.Mt++,this.Mt>0x3ffffffffff&&(this.Ct++,this.It())}return rk.fromFieldsV7(this.Ct,Math.trunc(this.Mt/0x40000000),0x3fffffff&this.Mt,this.Tt.nextUint32())}It(){this.Mt=1024*this.Tt.nextUint32()+(1023&this.Tt.nextUint32())}constructor(){this.Ct=0,this.Mt=0,this.Tt=new rS}};let rE=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(let t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};c&&!q(c.crypto)&&crypto.getRandomValues&&(rE=e=>crypto.getRandomValues(e));var rS=class{nextUint32(){return this.Rt.length>this.Et||(rE(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=new Uint32Array(8),this.Et=1/0}};let rP=()=>rM().toString(),rM=()=>(l||(l=new r$)).generate(),rO="",rI=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,rF=null,rC={At(){if(!z(rF))return rF;if(rF=!1,f)try{let e=`__ph_cookie_support_${rP()}`;rC.$t(e,"xyz"),rF='"xyz"'===rx(e),rC.Pt(e)}catch(e){rF=!1}return rF},Lt(e){i6.error("cookieStore error: "+e)},Ot:rx,Dt(e){let t;try{t=JSON.parse(rC.Ot(e))||{}}catch(e){}return t},$t(e,t,i,s,r){if(!f)return!1;try{let n="",o="",a=function(e,t){if(t){let t=function(e,t=f){if(rO)return rO;if(!t||["localhost","127.0.0.1"].includes(e))return"";let i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+rP();for(;!rO&&s--;){let e=i.slice(s).join("."),n=r+"=1;domain=."+e+";path=/";t.cookie=n+";max-age=3",t.cookie.includes(r)&&(t.cookie=n+";max-age=0",rO=e)}return rO}(e);if(!t){let i=(e=>{let t=e.match(rI);return t?t[0]:""})(e);i!==t&&i6.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}(f.location.hostname,s);if(i){let e=new Date;e.setTime(e.getTime()+864e5*i),n="; expires="+e.toUTCString()}r&&(o="; secure");let l=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+a+o;return l.length>3686.4&&i6.warn("cookieStore warning: large cookie, len="+l.length),f.cookie=l,!0}catch(e){return!1}},Pt(e,t){if((null==f?void 0:f.cookie)&&(!t||!z(rx(e))))try{rC.$t(e,"",-1,t)}catch(e){return}}},rA=null,rT={At(){if(!z(rA))return rA;let e=!0;if(q(c))e=!1;else try{let t="__mplssupport__";rT.$t(t,"xyz"),'"xyz"'!==rT.Ot(t)&&(e=!1),rT.Pt(t)}catch(t){e=!1}return e||i6.error("localStorage unsupported; falling back to cookie store"),rA=e,e},Lt(e){i6.error("localStorage error: "+e)},Ot(e){try{return null==c?void 0:c.localStorage.getItem(e)}catch(e){rT.Lt(e)}return null},Dt(e){try{return JSON.parse(rT.Ot(e))||{}}catch(e){}return null},$t(e,t){try{return null==c||c.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){rT.Lt(e)}return!1},Pt(e){try{null==c||c.localStorage.removeItem(e)}catch(e){rT.Lt(e)}}},rR=[sd,sr,sh,sn,sg,sl,sa,so,sp],rL=[sb,sy,sj,sq,sZ,sX,s$,sJ],rD=["__proto__","constructor","prototype"],rN=e=>{if(!N(e))return{};let t={};return Object.keys(e).forEach(i=>{-1===rD.indexOf(i)&&(t[i]=e[i])}),t},rj=(e,t=[])=>{let i={};return[...rL,...t].forEach(t=>{let s=e[t];q(s)||z(s)||""===s||(i[t]=s)}),i},rq=e=>{let t=5381,i=0x811c9dc5;for(let s=0;e.length>s;s++){let r=e.charCodeAt(s);t=33*t^r,i=Math.imul(i^r,0x1000193)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},rH=(e,t)=>({p:t,f:rq(JSON.stringify(e))}),rB=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{let i=rC.Dt(e+"_cpm"),s=(null==i?void 0:i.f)===rq(t)&&L(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},rz=(e,t)=>t+"|"+(rC.Ot(e+"_cpm")||""),rU={},rV={At:()=>!0,Lt(e){i6.error("memoryStorage error: "+e)},Ot:e=>e in rU?rU[e]:null,Dt:e=>e in rU?rU[e]:null,$t:(e,t)=>(rU[e]=t,!0),Pt(e){delete rU[e]}},rW=null,rG={At(){if(!z(rW))return rW;if(rW=!0,q(c))rW=!1;else try{let e="__support__";rG.$t(e,"xyz"),'"xyz"'!==rG.Ot(e)&&(rW=!1),rG.Pt(e)}catch(e){rW=!1}return rW},Lt(e){i6.error("sessionStorage error: ",e)},Ot(e){try{return null==c?void 0:c.sessionStorage.getItem(e)}catch(e){rG.Lt(e)}return null},Dt(e){try{return JSON.parse(rG.Ot(e))||null}catch(e){}return null},$t(e,t){try{return null==c||c.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){rG.Lt(e)}return!1},Pt(e){try{null==c||c.sessionStorage.removeItem(e)}catch(e){rG.Lt(e)}}};var rJ=class{constructor(e){this._instance=e}get Mr(){return this._instance.config}get consent(){return this.Lo()?0:this.No}isOptedOut(){return"always"===this.Mr.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Mr.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Mr.opt_out_capturing_by_default}optInOut(e){this.qo.$t(this.jo,+!!e,this.Mr.cookie_expiration,this.Mr.cross_subdomain_cookie,this.Mr.secure_cookie)}reset(){this.qo.Pt(this.jo,this.Mr.cross_subdomain_cookie)}get jo(){let{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get No(){let e=this.qo.Ot(this.jo);return ei(e)?1:O(es,e)?0:-1}get qo(){let e=this.Mr.opt_out_capturing_persistence_type,t="localStorage"===e?rT:rC,i=t.At()?t:rV;if(!this.Bo||this.Bo!==i){this.Bo=i;let t="localStorage"===e?rC:rT;t.Ot(this.jo)&&(this.Bo.Ot(this.jo)||this.optInOut(ei(t.Ot(this.jo))),t.Pt(this.jo,this.Mr.cross_subdomain_cookie))}return this.Bo}Lo(){return!!this.Mr.respect_dnt&&[null==p?void 0:p.doNotTrack,null==p?void 0:p.msDoNotTrack,x.doNotTrack,null==p?void 0:p.globalPrivacyControl].some(e=>ei(e))}};function rK(e,t){var i;let s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!D(s))return t;try{let e=s(t);return H(e)&&e?e:t}catch(e){return i6.error("Error in get_current_url, falling back to window.location.href",e),t}}function rQ(e){var t;return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!!(null==(t=e.closest)?void 0:t.call(e,".toolbar-global-fade-container")))}function rY(e){return!!e&&1===e.nodeType}function rX(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function rZ(e){return!!e&&3===e.nodeType}function r0(e){return!!e&&11===e.nodeType&&rY(e.host)}function r1(e){return e?I(e).split(/\s+/):[]}function r2(e,t){let i=function(e){var t;let i=null==c||null==(t=c.location)?void 0:t.href;return q(i)?void 0:rK(e,i)}(t);return!!(i&&e&&e.some(e=>i.match(e)))}function r3(e){let t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return r1(t)}function r5(e){return U(e)?null:I(e).split(/(\s+)/).filter(e=>nk(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function r4(e){let t="";return ng(e)&&!nv(e)&&e.childNodes&&e.childNodes.length&&rp(e.childNodes,function(e){var i;rZ(e)&&e.textContent&&(t+=null!=(i=r5(e.textContent))?i:"")}),I(t)}function r6(e){var t;return q(e.target)?e.srcElement||null:(null==(t=e.target)?void 0:t.shadowRoot)?e.composedPath()[0]||null:e.target||null}let r8=["a","button","form","input","select","textarea","label"];function r9(e,t){let i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch(e){return!1}}function r7(e,t){if(q(t))return!0;for(let i of e)if(t.some(e=>r9(i,e)))return!0;return!1}function ne(e){let t=e.parentNode;return!(!t||!rY(t))&&t}let nt=[".ph-no-autocapture","[data-ph-no-autocapture]"],ni=["next","previous","prev",">","<","→","←","›","‹","\xbb","\xab","▶","◀","❯","❮"],ns=[...ni,"+","-","−","–"],nr=ns.length+10,nn=["button","a","input","select","textarea","label"],no=["button","link","tab","menuitem","option"],na=(e,t)=>/[a-z0-9]/i.test(t)?O(ns,t)?RegExp(`\\b${t}\\b`).test(e):e.includes(t):e===t,nl=e=>O(nn,e.tagName.toLowerCase())||O(no,(e.getAttribute("role")||"").toLowerCase());function nu(e){let t="",i="",s=e=>{rY(e)&&ng(e)&&!nv(e)&&(t+=` ${r4(e)}`,i=i||e.getAttribute("aria-label")||"",rp(e.childNodes,s))};s(e);let r=(nk(t=I(t.replace(/\s+/g," ")))?t:"").toLowerCase(),n=e.getAttribute("aria-label")||(r?"":i);return{safeText:r,ariaLabel:I(n).toLowerCase()}}let nh=[".ph-no-rageclick",".ph-no-capture"],nc=["","text","search","email","password","url","tel","number"];function nd(e,t){var i,s,r;let n,o,a;if(!c||np(e)||(G(t)?(n=!!t&&nh,o=void 0,a=!1):(n=null!=(i=null==t?void 0:t.css_selector_ignorelist)?i:nh,o=null==t?void 0:t.content_ignorelist,a=null!=(s=null==t?void 0:t.ignore_text_selection)&&s),!1===n)||a&&!(!(r=e)||!rY(r))&&(rX(r,"textarea")||(rX(r,"input")?O(nc,(r.getAttribute("type")||"").toLowerCase()):function(e){var t;if(e.isContentEditable)return!0;let i=null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return"true"===i||""===i}(r))))return!1;let{targetElementList:l}=nf(e,!1);return!(o&&function(e,{safeText:t,ariaLabel:i}){let s;if(!0===e)s=ni;else{if(!L(e))return!1;if(e.length>nr)return i6.error(`[PostHog] content_ignorelist array cannot exceed ${nr} items. Use css_selector_ignorelist for more complex matching.`),!1;s=e.map(e=>e.toLowerCase())}return s.some(e=>na(t,e)||na(i,e))}(o,function(e,t){for(let e of t)if(nl(e))return nu(e);for(let e of t){try{if("pointer"!==(null==c?void 0:c.getComputedStyle(e).getPropertyValue("cursor")))break}catch(e){break}let t=nu(e);if(t.safeText||t.ariaLabel)return t}return nu(e)}(e,l))||r7(l,n))}let np=e=>!e||rX(e,"html")||!rY(e),nf=(e,t)=>{if(!c||np(e))return{parentIsUsefulElement:!1,targetElementList:[]};let i=!1,s=[e],r=e;for(;r.parentNode&&!rX(r,"body");){if(r0(r.parentNode)){s.push(r.parentNode.host),r=r.parentNode.host;continue}let e=ne(r);if(!e)break;if(t||r8.indexOf(e.tagName.toLowerCase())>-1)i=!0;else try{let t=c.getComputedStyle(e);t&&"pointer"===t.getPropertyValue("cursor")&&(i=!0)}catch(e){}s.push(e),r=e}return{parentIsUsefulElement:i,targetElementList:s}};function ng(e){let t=new Set,i=0;for(let s=e;s.parentNode&&!rX(s,"body");s=s.parentNode){if(i++>=1e3||t.has(s))return!1;t.add(s);let e=r3(s);if(O(e,"ph-sensitive")||O(e,"ph-no-capture"))return!1}if(O(r3(e),"ph-include"))return!0;let s=e.type||"";if(H(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}let r=e.name||e.id||"";return!H(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function nv(e){return!!(rX(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||rX(e,"select")||rX(e,"textarea")||"true"===e.getAttribute("contenteditable"))}let n_=RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),nm=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,ny=[16,15,14,13],nb=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),nw=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),nx=/[0-9A-Za-z_]/;function nk(e,t=!0){return!(U(e)||H(e)&&(e=I(e),(t?n_.test((e||"").replace(/[- ]/g,"")):function(e){let t;for(nm.lastIndex=0;t=nm.exec(e);){let e=t[2];if(!e)continue;let i=e.replace(/[- ]/g,"");for(let e=0;i.length>e;e++)for(let t of ny){let s=e+t;if(i.length>=s){let t=i.slice(e,s);if(n_.test(t)&&function(e){let t=0,i=!1;for(let s=e.length-1;s>=0;s--){let r=e.charCodeAt(s)-48;i&&(r*=2)>9&&(r-=9),t+=r,i=!i}return t%10==0}(t))return!0}}}return!1}(e))||(t?nb.test(e):function(e){let t;for(nw.lastIndex=0;t=nw.exec(e);){let e=t[1],i=t[3];if(!(e&&i&&nx.test(e)&&nx.test(i)))return!0}return!1}(e))))&&!0}function n$(e){let t=r4(e);return nk(t=`${t} ${(function e(t){let i="";return t&&t.childNodes&&t.childNodes.length&&rp(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{let s=r4(t);i=`${i} ${s}`.trim(),t.childNodes&&t.childNodes.length&&(i=`${i} ${e(t)}`.trim())}catch(e){i6.error("[AutoCapture]",e)}}),i})(e)}`.trim())?t:""}function nE(e){return e.replace(/"|\\"/g,'\\"')}let nS=i8("[Dead Clicks]"),nP=()=>!0,nM=e=>{var t;let i=!!(null==(t=e.instance.persistence)?void 0:t.get_property(sT)),s=e.instance.config.capture_dead_clicks;return G(s)?s:!!N(s)||i};var nO=class{get lazyLoadedDeadClicksAutocapture(){return this.zo}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(!e.ok)return;let t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[sT]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Ho(()=>{this.Uo()}):this.stop()}Ho(e){var t,i,s;(null==(t=x.__PosthogExtensions__)?void 0:t.initDeadClicksAutocapture)?e():null==(i=x.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this.instance,"dead-clicks-autocapture",t=>{t?nS.error("failed to load script",t):e()})}Uo(){var e;if(f){if(!this.zo&&(null==(e=x.__PosthogExtensions__)?void 0:e.initDeadClicksAutocapture)){let e=N(this.instance.config.capture_dead_clicks)?ty({},this.instance.config.capture_dead_clicks):{};e.__onCapture=this.onCapture,this.onCapture&&(e.capture_dead_swipes=!1),this.zo=x.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,e),this.zo.start(f),nS.info("starting...")}}else nS.error("`document` not found. Cannot start.")}stop(){this.zo&&(this.zo.stop(),this.zo=void 0,nS.info("stopping..."))}};let nI=i8("[SegmentIntegration]");function nF(e,t,i=!0){let s=e.config.segment;if(!s)return t();let{analytics:r,filterProperties:n}=D(s.register)?{analytics:s}:s,o=s=>{var o;let a=()=>s.anonymousId()||rP();e.config.get_device_id=a,i&&s.id()&&(e.register({distinct_id:s.id(),$device_id:a()}),e.persistence.set_property(sJ,rn)),o=i?void 0:s.anonymousId()||void 0,r.register(((e,t,{filterProperties:i}={})=>{"undefined"!=typeof Promise&&Promise.resolve||nI.warn("This browser does not have Promise support, and can not use the segment integration");let s=(s,r)=>{if(!r)return s;let n=!!t&&s.event.anonymousId===t&&!s.event.userId;n||s.event.userId||s.event.anonymousId===e.get_distinct_id()||(nI.info("No userId set, resetting PostHog"),e.reset()),n||(t=void 0),s.event.userId&&s.event.userId!==e.get_distinct_id()&&(nI.info("UserId set, identifying with PostHog"),e.identify(s.event.userId));let o=e.calculateEventProperties(r,s.event.properties);if(!U(i)){let e=s.event.properties||{},t={};for(let i of Object.keys(o))T.call(e,i)||(t[i]=o[i]);let r=((e,t)=>{let i=L(e)?e:[e],s=ty({},t);for(let e of i)try{if(s=e(s),U(s))return null}catch(e){return nI.error("Error in Segment filterProperties:",e),null}return s})(i,t);if(U(r))return s;o=r}return s.event.properties=Object.assign({},o,s.event.properties),s};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,rl),identify:e=>s(e,rh),screen:e=>s(e,"$screen")}})(e,o,{filterProperties:n})).then(()=>{t()},e=>{nI.error("Failed to register the Segment integration",e),t()})},a=r.user();"then"in a&&D(a.then)?a.then(o):o(a)}let nC="posthog-js";function nA(e,{organization:t,projectId:i,prefix:s,severityAllowList:r=["error"],sendExceptionsToPostHog:n=!0}={}){return o=>{var a,l,u,h,c,d;if("*"!==r&&!r.includes(o.level)||!e.__loaded)return o;o.tags||(o.tags={});let p=e.requestRouter.endpointFor("ui",`/project/${e.config.token}/person/${e.get_distinct_id()}`);o.tags["PostHog Person URL"]=p,e.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));let f=(null==(a=o.exception)?void 0:a.values)||[],g=f.map(e=>ty(ty({},e),{},{stacktrace:e.stacktrace?ty(ty({},e.stacktrace),{},{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>ty(ty({},e),{},{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null==(l=f[0])?void 0:l.value)||o.message,$exception_type:null==(u=f[0])?void 0:u.type,$exception_level:o.level,$exception_list:g,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:(null==(h=f[0])?void 0:h.value)||o.message,$sentry_exception_type:null==(c=f[0])?void 0:c.type,$sentry_tags:o.tags};return t&&i&&(v.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+o.event_id),n&&(null==(d=e.exceptions)||d.sendExceptionEvent(v)),o}}var nT=class{constructor(e,t,i,s,r,n){this.name=nC,this.setupOnce=function(o){o(nA(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}},nR=class{constructor(e){this.Wo=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(i6.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Vo=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Go()}Go(){var e;this.Qo=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Wo)}destroy(){var e;null==(e=this.Qo)||e.call(this),this.Qo=void 0}doPageView(e,t){var i;let s=this.Zo(e,t);return this.Vo={pathname:null!=(i=null==c?void 0:c.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Zo(e,null==(t=this.Vo)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Vo)?void 0:e.pageViewId}}Zo(e,t){let i=this.Vo;if(!i)return{$pageview_id:t};let s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){let{maxScrollHeight:e,lastScrollY:t,maxScrollY:i,maxContentHeight:n,lastContentY:o,maxContentY:a}=r;if(!(q(e)||q(t)||q(i)||q(n)||q(o)||q(a))){e=Math.ceil(e),t=Math.ceil(t),i=Math.ceil(i),n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a);let r=e>1?eu(t/e,0,1,i6):1,l=e>1?eu(i/e,0,1,i6):1,u=n>1?eu(o/n,0,1,i6):1,h=n>1?eu(a/n,0,1,i6):1;s=rf(s,{$prev_pageview_last_scroll:t,$prev_pageview_last_scroll_percentage:r,$prev_pageview_max_scroll:i,$prev_pageview_max_scroll_percentage:l,$prev_pageview_last_content:o,$prev_pageview_last_content_percentage:u,$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:h})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}};let nL=["flags","surveys"],nD={$people_distinct_id:{exposure:"hidden"},[sx]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[sP]:{exposure:"hidden"},[s$]:{exposure:"hidden"},[sS]:{exposure:"hidden"},[sM]:{exposure:"event"},[sO]:{exposure:"hidden"},[sL]:{exposure:"hidden"},[sI]:{exposure:"event"},[sF]:{exposure:"hidden"},[sC]:{exposure:"event"},[sA]:{exposure:"event"},[sT]:{exposure:"event"},[sR]:{exposure:"hidden"},[sD]:{exposure:"event"},[sN]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[sj]:{exposure:"hidden"},[sq]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:e=>z(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[sh]:{exposure:"hidden",storageGroup:"flags"},[sr]:{exposure:"hidden",storageGroup:"flags"},[ss]:{exposure:"hidden"},[sn]:{exposure:"hidden",storageGroup:"flags"},[sg]:{exposure:"hidden",storageGroup:"flags"},[sl]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[su]:{exposure:"hidden",storageGroup:"flags"},[sv]:{exposure:"hidden"},[s_]:{exposure:"hidden"},[sd]:{exposure:"hidden"},[sc]:{exposure:"hidden"},[sB]:{exposure:"hidden",storageGroup:"surveys"},[sz]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[sU]:{exposure:"event"},[sV]:{exposure:"hidden"},[sW]:{exposure:"hidden"},[sG]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[sp]:{exposure:"hidden"},[sf]:{exposure:"hidden"},[sH]:{exposure:"event"},[so]:{exposure:"hidden"},[sa]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[sJ]:{exposure:"hidden"},[sK]:{exposure:"hidden"},$capture_rate_limit:{exposure:"hidden"},[sQ]:{exposure:"hidden"},[sY]:{exposure:"hidden"},[sX]:{exposure:"hidden"},[sZ]:{exposure:"hidden"},$replay_override_sampling:{exposure:"event"},$replay_override_linked_flag:{exposure:"event"},$replay_override_url_trigger:{exposure:"event"},$replay_override_event_trigger:{exposure:"event"},[s2]:{exposure:"event"},[s3]:{exposure:"event"},[s5]:{exposure:"hidden"},[s4]:{exposure:"hidden"},[s6]:{exposure:"hidden"},[s8]:{exposure:"hidden"},[s9]:{exposure:"hidden"},[s7]:{exposure:"hidden"},[re]:{exposure:"hidden"},[rt]:{exposure:"hidden"},[ri]:{exposure:"hidden"},$session_recording_start_reason:{exposure:"event"}},nN=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],nj=e=>{let t=nD[e];if(t)return t;for(let[t,i]of nN)if(0===e.indexOf(t))return i};function nq(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}let nH=()=>{try{return"u">typeof window&&!1!==window.navigator.onLine}catch(e){return!1}},nB=(e,t)=>e>=t&&nH(),nz=(e,t,i,s)=>{if(0===e){if(nH()){let e=t+1;return e===i&&s(),e}return t}return 0},nU=(e,t)=>{try{let i;return JSON.stringify(e,(e,t)=>X(t)?(null!=i||(i=new WeakMap),i.has(t)||i.set(t,rm(t)),i.get(t)):"bigint"==typeof t?t.toString():t,t)}catch(t){return C(e)}},nV=e=>{let t=null==f?void 0:f.createElement("a");return q(t)?null:(t.href=e,t)},nW=function(e,t){let i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&");for(let e=0;s.length>e;e++){let r=s[e].split("=");if(r[0]===t){i=r;break}}if(!L(i)||2>i.length)return"";{let e=i[1];try{e=decodeURIComponent(e)}catch(t){i6.error("Skipping decoding for malformed query param: "+e)}return e.replace(/\+/g," ")}},nG=function(e,t,i){if(!e||!t||!t.length)return e;let s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),o=n[1],a=n[0],l=(o||"").split("&"),u=[];for(let e=0;l.length>e;e++){let s=l[e].split("=");L(s)&&(t.includes(s[0])?u.push(s[0]+"="+i):u.push(l[e]))}let h=a;return null!=o&&(h+="?"+u.join("&")),null!=r&&(h+="#"+r),h},nJ=function(e,t){let i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},nK=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],nQ=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...nK],nY="<masked>",nX=["li_fat_id"];function nZ(e,t,i){if(!f)return{};let s=t?[...nK,...i||[]]:[],r=n0(nG(f.URL,s,nY),e);return rf(function(){let e={};return rp(nX,function(t){let i=rx(t);e[t]=i||null}),e}(),r)}function n0(e,t){let i=nQ.concat(t||[]),s={};return rp(i,function(t){let i=nW(e,t);s[t]=i||null}),s}function n1(e){let t=e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null,i={};if(!z(t)){i.$search_engine=t;let e=f?nW(f.referrer,"yahoo"!=t?"q":"p"):"";e.length&&(i.ph_keyword=e)}return i}function n2(){return navigator.language||navigator.userLanguage}let n3="$direct";function n5(){return(null==f?void 0:f.referrer)||n3}function n4(e,t,i=!1){let s=e?[...nK,...t||[]]:[],r=i?td(null==g?void 0:g.href):null==g?void 0:g.href,n=null==r?void 0:r.substring(0,1e3);return{r:n5().substring(0,1e3),u:n?nG(n,s,nY):void 0}}function n6(e,t=!1){var i;let{r:s,u:r}=e,n=t?td(r):r,o={$referrer:s,$referring_domain:null==s?void 0:s==n3?n3:null==(i=nV(s))?void 0:i.host};if(n){o.$current_url=n;let e=nV(n);o.$host=null==e?void 0:e.host,o.$pathname=null==e?void 0:e.pathname,rf(o,n0(n))}return s&&rf(o,n1(s)),o}let n8={flags:sa,surveys:sz},n9=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],n7=e=>`${e}_cookie_identity_change_pending`,oe=e=>{let t="",i=0;for(let s of e){let e=encodeURIComponent(JSON.stringify(s).slice(1,-1)).length;if(i+e>1e3)break;t+=s,i+=e}return t},ot="main",oi=[sh,sr,sn,sg,sl,sa,su,sd],os=e=>-1!==oi.indexOf(e),or=[s$,sS],on=e=>-1!==or.indexOf(e),oo=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch(i){return e===t}},oa=e=>{if(!e)return{};let t=JSON.parse(e);return N(t)?t:{}},ol=(e,t)=>{rp(e,(i,s)=>{let r=nj(s);r&&"event"!==r.exposure||({}).hasOwnProperty.call(t,s)||delete e[s]})};var ou=class{constructor(e,t,i=!0,s=!e.cookieless_mode){if(this.Jo={},this.Ko=!1,this.Xo=!1,this.Yo=!1,this.ta=!1,this.ea=!1,this.ia=new Map,this.na=!1,this.sa=!1,this.ra=!1,this.oa=new Set,this.aa=new Set,this.Mr=e,this.la=i,this.props={},this.ua=void 0,this.ca=(e=>{let t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.hi=e.disable_persistence||!!t,this.qo=this.ha(e),this.Yo=this.da(e),this.load(s),this.va(),e.debug&&i6.info("Persistence loaded",e.persistence,ty({},this.props)),this.update_config(e,e,t),this.save(),c){let e=()=>this.flush();rb(c,"beforeunload",e,{capture:!1}),rb(c,"pagehide",e,{capture:!1}),this.fa=e=>{if(this.Ko&&(!e.storageArea||e.storageArea===(null==c?void 0:c.localStorage))&&e.key)if(e.key!==this.ca){if(this.Yo){let t=nL.find(t=>e.key===this.pa(t));t&&this.ga(e.key,t)}}else this.ga(e.key,ot)},rb(c,"storage",this.fa)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(([e,t])=>{let i=this.ia.get(e);if(!os(e)||!0===i)return;if(!0===t)return void this.ma(e,!0);let s=new Set(i||[]);t.forEach(e=>s.add(e)),s.size&&this.ma(e,s)})}onCrossTabFeatureFlagChange(e){return this.aa.add(e),()=>this.aa.delete(e)}destroy(){this.fa&&c&&(c.removeEventListener("storage",this.fa),this.fa=void 0),this.aa.clear()}ga(e,t,i=!0){let s,r;if(this.hi)return!1;try{if(r=rT.Ot(e),z(r)){let e=this.ya(t);return e.storageValue=null,t!==ot&&(e.persisted=!1),!1}s=oa(r)}catch(e){return!1}let n=t===ot?s:rT.Dt(this.ca);if(n&&this.ba(n))return!1;let o=this._a(s,t,i);return t===ot&&this.Yo&&!oo(this.wa().main,s)||this.ka(s,t,!0,r),o}ba(e){let t=this.props[sy],i=e[sy];return!q(t)&&!q(i)&&t!==i}ka(e,t,i,s){let r=this.ya(t);r.storageValue=s,t!==ot&&(r.persisted=i);try{r.fingerprint=this.Sa(e,t)}catch(e){r.fingerprint=void 0}}_a(e,t,i){let s=!1;return oi.forEach(i=>{var r;let n=null==(r=nj(i))?void 0:r.storageGroup;if(t===ot&&this.Yo&&n||t!==ot&&n!==t)return;let o=i in e,a=this.xa(i,o?e[i]:void 0),l=this.ia.has(i)?i in this.props:o;l===i in this.props&&oo(a,this.props[i])||(l?this.$a(i,a,!1):this.Ca(i,!1),s=!0)}),s&&i&&this.aa.forEach(e=>e()),s}Ta(){if(!this.Ko)return!1;try{this.ra=!1;let e=rT.Ot(this.ca),t=this.ya(ot),i,s=!1,r=!1;if(e!==t.storageValue)if(z(e))t.storageValue=null;else{if(i=oa(e),this.ra=!this.sa&&this.ba(i),this.ra)return!1;r=this._a(i,ot,!1),!this.Yo||oo(this.wa().main,i)?this.ka(i,ot,!0,e):t.storageValue=e,s=!0}return this.Yo&&nL.forEach(e=>{let t=rT.Ot(this.pa(e)),n=this.ya(e),o=i||{},a=s&&oi.some(t=>{var i;return(null==(i=nj(t))?void 0:i.storageGroup)===e&&t in o});if(t===n.storageValue&&!a)return;if(z(t))return n.storageValue=null,n.persisted=!1,void(a&&(r=this._a(o,e,!1)||r));let l=oa(t);r=this._a(l,e,!1)||r,this.ka(l,e,!0,t)}),r}catch(e){return!1}}ma(e,t){this.ia.set(e,t);let i=nj(e);(null==i?void 0:i.volatile)||(this.ya((this.Yo?null==i?void 0:i.storageGroup:void 0)||ot).fingerprint=void 0,this.Ia(e))}Ma(){oi.forEach(e=>this.ia.set(e,!0))}va(){if(this.Ko)try{let e=rT.Ot(this.ca),t=oa(e);this.ya(ot).storageValue=e,oi.forEach(e=>{var i;let s=this.Yo?null==(i=nj(e))?void 0:i.storageGroup:void 0,r=s?rT.Ot(this.pa(s)):null;if(s){let e=this.ya(s);e.storageValue=r,e.persisted=!z(r)}let n=s&&!z(r)?oa(r):t;e in this.props?this.Ea(e,n[e],this.props[e]):e in n&&this.ma(e,!0)})}catch(e){}}xa(e,t){let i=this.ia.get(e);if(!i)return t;if(!0===i)return this.props[e];if("$active_feature_flags"===e){let s=new Set(L(t)?t:[]),r=new Set(L(this.props[e])?this.props[e]:[]);return i.forEach(e=>r.has(e)?s.add(e):s.delete(e)),Array.from(s)}let s=N(t)?ty({},t):{},r=N(this.props[e])?this.props[e]:{};return i.forEach(e=>{e in r?s[e]=r[e]:delete s[e]}),s}Ea(e,t,i){if(!os(e))return;let s=this.ia.get(e);if(!0===s)return;let r=t;if(this.Ko)try{var n;let t=this.Yo?null==(n=nj(e))?void 0:n.storageGroup:void 0,i=t?this.pa(t):this.ca;r=oa(rT.Ot(i))[e]}catch(e){}let o=new Set(s||[]);if("$active_feature_flags"===e){if(!q(t)&&!L(t)||!q(r)&&!L(r)||!L(i))return void this.ma(e,!0);let s=new Set(t||[]),n=new Set(r||[]),a=new Set(i);new Set([...s,...a]).forEach(e=>{s.has(e)!==a.has(e)&&o.add(e)}),o.forEach(e=>{n.has(e)===a.has(e)&&o.delete(e)})}else{if(!N(i))return void(oo(r,i)?this.ia.delete(e):this.ma(e,!0));{if(!q(t)&&!N(t)||q(t)&&j(i)&&q(r))return void this.ma(e,!0);let s=N(t)?t:{},n=N(r)?r:{};new Set([...Object.keys(s),...Object.keys(i)]).forEach(e=>{e in s==e in i&&oo(s[e],i[e])||o.add(e)}),o.forEach(e=>{e in n==e in i&&oo(n[e],i[e])&&o.delete(e)})}}o.size?this.ma(e,o):this.ia.delete(e)}Pa(){var e;let t=null==(e=this.Mr)?void 0:e.persistence_save_debounce_ms;return V(t)&&t>0?t:0}Ra(e){if(this.Mr.cookieWinsOnConflict&&"localstorage+cookie"===this.Mr.persistence.toLowerCase())if(e)try{let t=rj(e,this.Mr.cookie_persisted_properties||[]),i=rH(t,this.Mr.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=rC.Ot(this.ca)||void 0;r&&rz(this.ca,r)===s&&(this.Aa=s,this.Fa=r)}catch(e){}else try{let e=rC.Ot(this.ca)||void 0;this.Aa=e?rz(this.ca,e):void 0,this.Fa=e}catch(e){}}syncCookieProperties(){return this.Oa(this.Mr)}Oa(e,t=!1){let i,s;if(this.hi&&!t||this.ea||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{i=rC.Ot(this.ca)||void 0}catch(e){}if(!i||i===this.Fa)return!1;let r=rz(this.ca,i);try{s=rN(JSON.parse(i))}catch(e){return!1}if((rC.Ot(this.ca)||void 0)!==i)return!1;this.Aa=r,this.Fa=i;let n=rB(this.ca,i),o=[...rL,...n.properties],a={};if(Object.keys(s).forEach(e=>{let t=s[e];(q(t)||z(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(a[e]=!0,delete s[e])}),j(s))return!1;let l="distinct_id"in s||"anonymous"===s.$user_state||"identified"===s.$user_state,u=this.props,h=u[sy],c=u[sJ],d=rf({},u);[...rL,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==o.indexOf(e)&&!(e in s)&&!a[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){let t=d[e];(n.isValid||-1===rL.indexOf(e)||!1!==t&&0!==t)&&delete d[e]}}),this.props=rf(d,s),oi.forEach(e=>{let t=e in this.props;e in u===t&&oo(u[e],this.props[e])||(t?this.Ea(e,u[e],this.props[e]):this.ma(e,!0))}),!l||"$user_state"in s||"$user_state"in this.props||this.$a(sJ,rr);let p=this.props[sy],f=this.props[sJ];return l&&(p!==h||f!==c)&&(this.sa=!0,this.ta=!0,rG.$t(n7(this.ca),!0),this.Ca(sd),this.Ca(sr),this.Ca(sh),this.Ca(sn),this.Ca(sg),this.Ca(sl),this.Ca(sa),this.Ca(so),this.Ca(sp),"anonymous"!==f||"identified"!==c&&"anonymous"!==s.$user_state&&(q(h)||p===h)||(ol(this.props,s),this.Ca(sc)),"identified"===f?this.props.$user_id=p:delete this.props.$user_id,this.Ca(sx)),!0}consumeCookieIdentityChange(){let e=n7(this.ca),t=this.ta||!!rG.Ot(e);return this.ta=!1,t&&rG.Pt(e),t}Da(e=!1){return!(this.ea||this.hi&&!e||!this.Mr.cookieWinsOnConflict||"localstorage+cookie"!==this.Mr.persistence.toLowerCase()||(this.ea=!0,0))}La(){this.ea&&(q(this.Na)||(clearTimeout(this.Na),this.Na=void 0),delete this.Jo[ot],this.qa(!0))}ja(e=!0){if(this.ea)try{e?this.La():q(this.Na)||(clearTimeout(this.Na),this.Na=void 0)}finally{this.ea=!1}}isDisabled(){return!!this.hi}ha(e){-1===n9.indexOf(e.persistence.toLowerCase())&&(i6.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");let t=((e=[],t=!1,i=()=>!1)=>{let s=[...rL,...e];return ty(ty({},rT),{},{Dt(e){try{let n,o,a={};try{a=(o=rC.Ot(e)||void 0)?rN(JSON.parse(o)):{}}catch(e){}let l=JSON.parse(rT.Ot(e)||"{}");if(t){let t=rB(e,o),i=[...rL,...t.properties],u={};Object.keys(a).forEach(e=>{let t=a[e];z(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t||(u[e]=t)});let h="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var r;let e=l[sy],n=null!=(r=l.$user_state)?r:rr;s.forEach(e=>{if(-1!==i.indexOf(e)&&!(e in a)&&(h||"distinct_id"!==e&&"$user_state"!==e)){let i=l[e];(t.isValid||-1===rL.indexOf(e)||!1!==i&&0!==i)&&delete l[e]}}),!h||"$user_state"in a||"$user_state"in l||(l[sJ]=rr),h&&(("distinct_id"in u?u[sy]:l[sy])!==e||("$user_state"in u?u[sJ]:l[sJ])!==n)&&(rR.forEach(e=>delete l[e]),"identified"===u.$user_state&&"distinct_id"in u?l.$user_id=u[sy]:delete l.$user_id,"identified"!==u.$user_state&&(delete l[sH],delete l[sc]),delete l.__alias)}n=rf(l,u)}else n=rf(a,l);return i()||rT.$t(e,n),n}catch(e){}return null},$t(i,s,r,n,o,a){let l=rT.$t(i,s,void 0,void 0,a);try{let u=rj(s,e);if(Object.keys(u).length){if(t){let t=i+"_cpm",h=rH(u,e);if(rC.$t(t,h,r,n,o,a),rC.Ot(t)!==JSON.stringify(h)){rC.Pt(t,n);let e=rj(s);return rC.$t(i,e,r,n,o,a),l}}rC.$t(i,u,r,n,o,a)}}catch(e){rT.Lt(e)}return l},Pt(e,t){try{null==c||c.localStorage.removeItem(e),rC.Pt(e,t),rC.Pt(e+"_cpm",t)}catch(e){rT.Lt(e)}}})})(e.cookie_persisted_properties||[],e.cookieWinsOnConflict,()=>!!this.hi),i,s=!1,r=!1,n=e.persistence.toLowerCase();return"localstorage"===n&&rT.At()?(i=rT,r=!0):"localstorage+cookie"===n&&t.At()?(i=t,r=!0,s=!0):"sessionstorage"===n&&rG.At()?i=rG:"memory"===n?i=rV:"cookie"===n&&rC.At()?(i=rC,s=!0):t.At()?(i=t,r=!0,s=!0):rC.At()?(i=rC,s=!0):i=rV,this.Ko=r,this.Xo=s,i}pa(e){return`${this.ca}__${e}`}da(e){return this.Ko&&!!e.split_storage}properties(){let e={};return rp(this.props,(t,i)=>{let s=nj(i);if(!s||"event"===s.exposure){var r;if(null==s||null==(r=s.shouldSkipFromEventProperties)?void 0:r.call(s,t))return;e[i]=t}}),e}load(e=!1){if(this.hi&&!e)return;let t=this.Mr.cookieWinsOnConflict&&"localstorage+cookie"===this.Mr.persistence.toLowerCase(),i=t?rT.Dt(this.ca):null,s={};if(t)try{s=rN(rC.Dt(this.ca)),rp(s,(e,t)=>{(q(e)||z(e)||""===e)&&delete s[t]})}catch(e){}let r=this.qo.Dt(this.ca);if(r&&(this.props=rf({},r)),this.Yo&&this.Ba(),t&&r){var n,o;let e=null==i?void 0:i[sy],t=null!=(n=null==i?void 0:i.$user_state)?n:rr,a=r[sy],l=null!=(o=r.$user_state)?o:rr;if(a!==e||l!==t){this.ta=!0,this.hi||rG.$t(n7(this.ca),!0);let i=rf({},this.props);rR.forEach(e=>delete i[e]),"anonymous"!==l||"identified"!==t&&"anonymous"!==s.$user_state&&(q(e)||a===e)||(ol(i,s),delete i[sc]),this.props=i;let r=new Set;rR.forEach(e=>{var t;let i=null==(t=nj(e))?void 0:t.storageGroup;i&&r.add(i)}),r.forEach(e=>{if(this.hi)return;let t={};rp(this.props,(i,s)=>{var r;(null==(r=nj(s))?void 0:r.storageGroup)===e&&(t[s]=i)}),j(t)?(rT.Pt(this.pa(e)),this.Jo[e]={}):rT.$t(this.pa(e),t)&&(this.Jo[e]={persisted:!0,fingerprint:this.Sa(t,e)})})}}rG.Ot(n7(this.ca))&&(this.ta=!0)}Ba(){for(let e of nL){let t=rT.Dt(this.pa(e));if(t&&!j(t)){let i=this.ya(e);i.persisted=!0,this.za(e)||(i.fingerprint=this.Sa(t,e)),this.Ha(e,t)||rf(this.props,t)}}}za(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=nj(t))?void 0:i.storageGroup)===e})}Ha(e,t){let i=n8[e];if(!i)return!1;let s=t[i],r=this.props[i];return V(s)&&V(r)&&r>s}refreshKey(e){var t;if(this.hi||this.oa.has(e))return;let i=this.Yo?null==(t=nj(e))?void 0:t.storageGroup:void 0,s=i?rT.Dt(this.pa(i)):this.qo.Dt(this.ca);if(s&&e in s)this.$a(e,s[e],!1);else{if(i){let t=this.qo.Dt(this.ca);if(t&&e in t)return void this.$a(e,t[e],!1)}this.Ca(e,!1)}}save(){if(this.hi)return;let e=this.Pa();e>0?q(this.Na)&&(this.Na=setTimeout(()=>{this.Na=void 0,this.qa()},e)):this.qa()}flush(){q(this.Na)||(clearTimeout(this.Na),this.Na=void 0,this.qa())}qa(e=!1){if(this.hi||this.ea&&!e)return;e||(this.syncCookieProperties(),this.Mr.cookieWinsOnConflict&&"localstorage+cookie"===this.Mr.persistence.toLowerCase()||or.forEach(e=>this.refreshKey(e)));let t=!e&&!this.na;t||(this.ra=!1);let i=!!t&&this.Ta();if(this.ra)return void(this.Mr.debug&&i6.warn("skipping persistence write because storage belongs to a different distinct ID"));if(this.Yo)return this.Ua(),void(i&&this.aa.forEach(e=>e()));let s=this.Wa(this.qo,this.ca,this.props,ot);"written"===s&&this.Ra(this.props),"failed"!==s&&(this.ia.clear(),this.sa=!1,this.oa.clear()),i&&this.aa.forEach(e=>e())}Ua(){let{main:e,groups:t}=this.wa(),i=this.Wa(this.qo,this.ca,e,ot);for(let r of("written"===i&&this.Ra(e),"failed"!==i&&(this.sa=!1,this.oa.clear(),oi.forEach(e=>{var t;(null==(t=nj(e))?void 0:t.storageGroup)||this.ia.delete(e)})),nL)){var s;let e=t[r];if(j(e)&&!(null==(s=this.Jo[r])?void 0:s.persisted)){oi.forEach(e=>{var t;(null==(t=nj(e))?void 0:t.storageGroup)===r&&this.ia.delete(e)});continue}let i=this.Wa(rT,this.pa(r),e,r);"failed"!==i&&oi.forEach(e=>{let t=nj(e);(null==t?void 0:t.storageGroup)!==r||"written"!==i&&t.volatile||this.ia.delete(e)})}}wa(){let e={},t={flags:{},surveys:{}};return rp(this.props,(i,s)=>{var r;let n=null==(r=nj(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}Sa(e,t){if(t===ot)return JSON.stringify(e)+"|"+this.Va+"|"+this.Ga+"|"+this.Qa;let i={};return rp(e,(e,t)=>{var s;i[t]=(null==(s=nj(t))?void 0:s.volatile)?"__volatile__":e}),JSON.stringify(i)}Wa(e,t,i,s){let r,n=this.ya(s);if(s!==ot&&!n.dirty&&!q(n.fingerprint))return"skipped";try{if((r=this.Sa(i,s))===n.fingerprint)return n.dirty=!1,"skipped"}catch(e){r=void 0}return e.$t(t,i,this.Va,this.Ga,this.Qa,this.Mr.debug)?(n.dirty=!1,s!==ot&&(n.persisted=!0),q(r)||(n.fingerprint=r),this.Ko&&(n.storageValue=rT.Ot(t)),"written"):(this.Mr.debug&&i6.warn(`failed to persist storage entry "${t}"; will retry on next save`),"failed")}remove({keepGroupEntries:e=!1}={}){if(this.Ma(),q(this.Na)||(clearTimeout(this.Na),this.Na=void 0),this.qo.Pt(this.ca,!1),this.qo.Pt(this.ca,!0),!e&&this.la)for(let e of nL)rT.Pt(this.pa(e));e?delete this.Jo[ot]:this.Jo={},this.Aa=void 0,this.Fa=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(N(e)){this.syncCookieProperties(),q(t)&&(t="None"),this.Va=q(i)?this.Za:i;let s=!1;if(rp(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.$a(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(N(e)){this.syncCookieProperties(),this.Va=q(t)?this.Za:t;let i=!1;if(rp(e,(t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||N(t)||L(t))&&(this.$a(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();let t=!1;for(let i of"string"==typeof e?[e]:e)i in this.props&&(this.Ca(i),t=!0);t&&this.save()}update_campaign_params(){let e=null==f?void 0:f.URL;if(e===this.ua)return;let t=nZ(this.Mr.custom_campaign_params,this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties),i=!j(r_(t));return i&&this.register(t),this.ua=e,i?t:void 0}update_search_keyword(){this.register(function(){let e=null==f?void 0:f.referrer;return e?n1(e):{}}())}update_referrer_info(){var e;this.register_once({$referrer:n5(),$referring_domain:(null==f?void 0:f.referrer)&&(null==(e=nV(f.referrer))?void 0:e.host)||n3},void 0)}set_initial_person_info(){if(this.props.$initial_campaign_params||this.props.$initial_referrer_info)return;let e=n4(this.Mr.mask_personal_data_properties,this.Mr.custom_personal_data_properties,this.Mr.disable_capture_url_hashes);this.register_once({[sX]:this.Xo?{r:oe(e.r),u:e.u?oe(e.u):void 0}:e},void 0)}get_initial_props(){let e={};rp([sY,sQ],t=>{let i=this.props[t];i&&rp(i,function(t,i){e["$initial_"+F(i)]=t})});let t=this.props[sX];return t&&rf(e,function(e,t=!1){let i=n6(e,t),s={};return rp(i,function(e,t){s[`$initial_${F(t)}`]=e}),s}(t,this.Mr.disable_capture_url_hashes)),e}safe_merge(e){return rp(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){let s=e.persistence!==t.persistence,r=!((e,t)=>{if(e.length!==t.length)return!1;let i=[...e].sort(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=s||r,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!i,l=!!this.hi&&!a;a||this.Oa(t,l),this.Mr=e,!a&&(s||r||o)&&(this.Aa=void 0,this.Fa=void 0,this.Oa(ty(ty({},e),{},{cookie_persisted_properties:t.cookie_persisted_properties}),l));let u=n||o?this.ha(e):this.qo;this.Ja();let h=this.da(e),c=n||h!==this.Yo,d=!a&&(c||e.cross_subdomain_cookie!==this.Ga||e.secure_cookie!==this.Qa)&&this.Da(l);this.na=c;try{if(this.Za=this.Va=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),c){let e=this.props;this.clear(),this.qo=u,this.Yo=h,this.props=e,this.save()}else o&&(this.qo=u,a||(delete this.Jo[ot],this.qa()))}finally{this.na=!1,d&&this.ja()}}Ja(){let e=this.props[sX];if(!this.Xo||!N(e)||"string"!=typeof e.r)return;let t=oe(e.r),i="string"==typeof e.u?oe(e.u):e.u;t===e.r&&i===e.u||this.$a(sX,ty(ty({},e),{},{r:t,u:i}))}set_disabled(e){this.hi=e,this.hi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ga&&(this.Ga=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Qa&&(this.Qa=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){let i=this.props.__timers||{};i[e]=t,this.$a(sP,i),this.save()}remove_event_timer(e){let t=this.props.__timers||{},i=t[e];return q(i)||(delete t[e],this.$a(sP,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.$a(e,t),this.save()}$a(e,t,i=!0){var s;let r=this.props[e];this.props[e]=t,i&&("distinct_id"!==e&&"$user_state"!==e||r===t||(this.sa=!0),on(e)&&!oo(r,t)&&this.oa.add(e),this.Ea(e,r,t),(null==(s=nj(e))?void 0:s.volatile)||this.Ia(e))}Ca(e,t=!0){delete this.props[e],t&&(os(e)&&this.ma(e,!0),on(e)&&this.oa.add(e),this.Ia(e))}Ia(e){var t;let i=null==(t=nj(e))?void 0:t.storageGroup;i&&(this.ya(i).dirty=!0)}ya(e){return this.Jo[e]||(this.Jo[e]={})}};let oh={GZipJS:"gzip-js",Base64:"base64"},oc={Activation:"events",Cancellation:"cancelEvents"},od={Popover:"popover",API:"api",Widget:"widget"},op={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},of={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},og={Popover:"popover",Inline:"inline"};function ov(e){let t=!0;return{dispose(){if(t){t=!1;let i=e();i&&D(i.then)&&i.then(void 0,()=>{})}}}}let o_={SHOWN:"product tour shown"},om={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},oy=i8("[RateLimiter]");var ob=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{let t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{oy.info(`${e||"events"} is quota limited.`),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void oy.warn(`could not rate limit - continuing. Error: "${null==e?void 0:e.message}"`,{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e=!1){var t,i,s;let{captureEventsBurstLimit:r,captureEventsPerSecond:n}=this,o=(new Date).getTime(),a=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property("$capture_rate_limit"))?t:{tokens:r,last:o};a.tokens+=Math.max(0,o-a.last)/1e3*n,a.last=Math.max(a.last,o),a.tokens>r&&(a.tokens=r);let l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){let e=(V(a.dropped)?a.dropped:0)+1;a.dropped=e,!this.lastEventRateLimited&&this.Ka(e)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property("$capture_rate_limit",a),{isRateLimited:l,remainingTokens:a.tokens}}Xa(e){let t=this.instance.config.property_denylist;return!L(t)||!t.includes(e)}Ya(){var e;if(this.Xa("$current_url")&&this.Xa("$pathname")&&(null==g?void 0:g.pathname))return`${null!=(e=g.origin)?e:""}${g.pathname}`}Ka(e){var t,i;let{captureEventsBurstLimit:s,captureEventsPerSecond:r}=this,n=this.Ya(),o=this.Xa("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,a=[`${e} event(s) dropped since the last warning`,n?`triggered on ${n}`:void 0,o?`session ${o}`:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:`posthog-js client rate limited: ${a}. Config is set to ${r} events per second and ${s} events burst limit.`},{skip_client_rate_limiting:!0})}isServerRateLimited(e){let t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}};let ow=i8("[RemoteConfig]");var ox=class{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=x._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}tl(e){var t,i,s;(null==(t=x.__PosthogExtensions__)?void 0:t.loadExternalDependency)?null==(i=x.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this._instance,"remote-config",()=>e(this.remoteConfig)):e()}el(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets",`/array/${this._instance.config.token}/config`),callback:e})}load(){try{if(this.remoteConfig)return ow.info("Using preloaded remote config",this.remoteConfig),void this.il(this.remoteConfig);if(this._instance.nl())return void ow.warn("Remote config is disabled. Falling back to local config.");this.tl(e=>{if(!e)return ow.info("No config found after loading remote JS config. Falling back to JSON."),void this.el(e=>{this.il(e.json,e)});this.il(e)})}catch(e){ow.error("Error loading remote config",e),this.il()}}il(e,t){!e&&t&&(0===t.statusCode?t.error||ow.warn("Failed to fetch remote config from PostHog."):ow.error("Failed to fetch remote config from PostHog."));try{this._instance.il(e?{ok:!0,config:e}:{ok:!1})}catch(e){ow.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){ow.error("Error loading feature flags",e)}}},ok=Uint8Array,o$=Uint16Array,oE=Uint32Array,oS=new ok([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),oP=new ok([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),oM=new ok([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),oO=function(e,t){for(var i=new o$(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new oE(i[30]);for(s=1;30>s;++s)for(var n=i[s];i[s+1]>n;++n)r[n]=n-i[s]<<5|s;return[i,r]},oI=oO(oS,2),oF=oI[1];oI[0][28]=258,oF[258]=28;for(var oC=oO(oP,0)[1],oA=new o$(32768),oT=0;32768>oT;++oT){var oR=(43690&oT)>>>1|(21845&oT)<<1;oA[oT]=((65280&(oR=(61680&(oR=(52428&oR)>>>2|(13107&oR)<<2))>>>4|(3855&oR)<<4))>>>8|(255&oR)<<8)>>>1}var oL=function(e,t,i){for(var s=e.length,r=0,n=new o$(t);s>r;++r)++n[e[r]-1];var o,a=new o$(t);for(r=0;t>r;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new o$(1<<t);var l=15-t;for(r=0;s>r;++r)if(e[r])for(var u=r<<4|e[r],h=t-e[r],c=a[e[r]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)o[oA[c]>>>l]=u}else for(o=new o$(s),r=0;s>r;++r)o[r]=oA[a[e[r]-1]++]>>>15-e[r];return o},oD=new ok(288);for(oT=0;144>oT;++oT)oD[oT]=8;for(oT=144;256>oT;++oT)oD[oT]=9;for(oT=256;280>oT;++oT)oD[oT]=7;for(oT=280;288>oT;++oT)oD[oT]=8;var oN=new ok(32);for(oT=0;32>oT;++oT)oN[oT]=5;var oj=oL(oD,9,0),oq=oL(oN,5,0),oH=function(e){return(e/8|0)+(7&e&&1)},oB=function(e,t,i){(null==t||0>t)&&(t=0),(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof o$?o$:e instanceof oE?oE:ok)(i-t);return s.set(e.subarray(t,i)),s},oz=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},oU=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},oV=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new ok(0),0];if(1==r){var o=new ok(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};h!=r-1;)a=i[i[c].f>i[u].f?u++:c++],l=i[u!=h&&i[c].f>i[u].f?u++:c++],i[h++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var p=new o$(d+1),f=oW(i[h-1],p,0);if(f>t){s=0;var g=0,v=f-t,_=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r>s;++s){var m=n[s].s;if(t>=p[m])break;g+=_-(1<<f-p[m]),p[m]=t}for(g>>>=v;g>0;){var y=n[s].s;t>p[y]?g-=1<<t-p[y]++-1:++s}for(;s>=0&&g;--s){var b=n[s].s;p[b]==t&&(--p[b],++g)}f=t}return[new ok(p),f]},oW=function(e,t,i){return -1==e.s?Math.max(oW(e.l,t,i+1),oW(e.r,t,i+1)):t[e.s]=i},oG=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new o$(++t),s=0,r=e[0],n=1,o=function(e){i[s++]=e},a=1;t>=a;++a)if(e[a]==r&&a!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(r),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(r);n=1,r=e[a]}return[i.subarray(0,s),t]},oJ=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},oK=function(e,t,i){var s=i.length,r=oH(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;s>n;++n)e[r+n+4]=i[n];return 8*(r+4+s)},oQ=function(e,t,i,s,r,n,o,a,l,u,h){oz(t,h++,i),++r[256];for(var c=oV(r,15),d=c[0],p=c[1],f=oV(n,15),g=f[0],v=f[1],_=oG(d),m=_[0],y=_[1],b=oG(g),w=b[0],x=b[1],k=new o$(19),$=0;m.length>$;++$)k[31&m[$]]++;for($=0;w.length>$;++$)k[31&w[$]]++;for(var E=oV(k,7),S=E[0],P=E[1],M=19;M>4&&!S[oM[M-1]];--M);var O,I,F,C,A=u+5<<3,T=oJ(r,oD)+oJ(n,oN)+o,R=oJ(r,d)+oJ(n,g)+o+14+3*M+oJ(k,S)+(2*k[16]+3*k[17]+7*k[18]);if(T>=A&&R>=A)return oK(t,h,e.subarray(l,l+u));if(oz(t,h,1+(T>R)),h+=2,T>R){O=oL(d,p,0),I=d,F=oL(g,v,0),C=g;var L=oL(S,P,0);for(oz(t,h,y-257),oz(t,h+5,x-1),oz(t,h+10,M-4),h+=14,$=0;M>$;++$)oz(t,h+3*$,S[oM[$]]);h+=3*M;for(var D=[m,w],N=0;2>N;++N){var j=D[N];for($=0;j.length>$;++$)oz(t,h,L[q=31&j[$]]),h+=S[q],q>15&&(oz(t,h,j[$]>>>5&127),h+=j[$]>>>12)}}else O=oj,I=oD,F=oq,C=oN;for($=0;a>$;++$)if(s[$]>255){oU(t,h,O[257+(q=s[$]>>>18&31)]),h+=I[q+257],q>7&&(oz(t,h,s[$]>>>23&31),h+=oS[q]);var q,H=31&s[$];oU(t,h,F[H]),h+=C[H],H>3&&(oU(t,h,s[$]>>>5&8191),h+=oP[H])}else oU(t,h,O[s[$]]),h+=I[s[$]];return oU(t,h,O[256]),h+I[256]},oY=new oE([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oX=new ok(0),oZ=function(){for(var e=new oE(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),o0=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8};let o1=!!_||!!v,o2=new WeakMap,o3="text/plain",o5=0,o4=!1,o6=(e,t)=>{let[i,s]=e.split("#"),[r,n]=i.split("?");if(!n)return e;let o=n.split("&").filter(e=>e.split("=")[0]!==t).join("&");return`${r}${o?`?${o}`:""}${s?`#${s}`:""}`},o8=(e,t,i=!0)=>{var s;let[r,n]=e.split("?"),o=ty({},t),a=null!=(s=null==n?void 0:n.split("&").map(e=>{var t;let[s,r]=e.split("="),n=i&&null!=(t=o[s])?t:r;return delete o[s],`${s}=${n}`}))?s:[],l=function(e,t="&"){let i,s,r=[];return rp(e,function(e,t){q(e)||q(t)||"undefined"===t||(i=encodeURIComponent(e instanceof File?e.name:e.toString()),s=encodeURIComponent(t),r[r.length]=s+"="+i)}),r.join(t)}(o);return l&&a.push(l),a.length>0?`${r}?${a.join("&")}`:r},o9=e=>{if(e.sl)return e.sl;let{data:t,compression:i}=e;if(!t)return;if(i===oh.GZipJS){let e=function(e,t){void 0===t&&(t={});var i=(r=0xffffffff,{p(e){for(var t=r,i=0;e.length>i;++i)t=oZ[255&t^e[i]]^t>>>8;r=t},d:()=>0xffffffff^r}),s=e.length;i.p(e);var r,n,o,a,l,u=(a=10+((n=t).filename&&n.filename.length+1||0),function(e,t,i,s,r,n){var o=e.length,a=new ok(s+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(s,a.length-8),u=0;if(!t||8>o)for(var h=0;o>=h;h+=65535){var c=h+65535;o>c?u=oK(l,u,e.subarray(h,c)):(l[h]=n,u=oK(l,u,e.subarray(h,o)))}else{for(var d=oY[t-1],p=d>>>13,f=8191&d,g=(1<<i)-1,v=new o$(32768),_=new o$(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new oE(25e3),x=new o$(288),k=new o$(32),$=0,E=0,S=(h=0,0),P=0,M=0;o>h;++h){var O=b(h),I=32767&h,F=_[O];if(v[I]=F,_[O]=I,h>=P){var C=o-h;if(($>7e3||S>24576)&&C>423){u=oQ(e,l,0,w,x,k,E,S,M,h-M,u),S=$=E=0,M=h;for(var A=0;286>A;++A)x[A]=0;for(A=0;30>A;++A)k[A]=0}var T=2,R=0,L=f,D=I-F&32767;if(C>2&&O==b(h-D))for(var N=Math.min(p,C)-1,j=Math.min(32767,h),q=Math.min(258,C);j>=D&&--L&&I!=F;){if(e[h+T]==e[h+T-D]){for(var H=0;q>H&&e[h+H]==e[h+H-D];++H);if(H>T){if(T=H,R=D,H>N)break;var B=Math.min(D,H-2),z=0;for(A=0;B>A;++A){var U=h-D+A+32768&32767,V=U-v[U]+32768&32767;V>z&&(z=V,F=U)}}}D+=(I=F)-(F=v[I])+32768&32767}if(R){w[S++]=0x10000000|oF[T]<<18|oC[R];var W=31&oF[T],G=31&oC[R];E+=oS[W]+oP[G],++x[257+W],++k[G],P=h+T,++$}else w[S++]=e[h],++x[e[h]]}}u=oQ(e,l,n,w,x,k,E,S,M,h-M,u),n||(u=oK(l,u,oX))}return oB(a,0,s+oH(u)+r)}(e,null==(o=t).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+o.mem,a,8,!l)),h=u.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&o0(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;i.length>=s;++s)e[s+10]=i.charCodeAt(s)}}(u,t),o0(u,h-8,i.d()),o0(u,h-4,s),u}(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new ok(e.length+(e.length>>>1)),s=0,r=function(e){i[s++]=e},n=0;t>n;++n){if(s+5>i.length){var o=new ok(s+8+(t-n<<1));o.set(i),i=o}var a=e.charCodeAt(n);128>a?r(a):(2048>a?r(192|a>>>6):(a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++n))>>>18),r(128|a>>>12&63)):r(224|a>>>12),r(128|a>>>6&63)),r(128|63&a))}return oB(i,0,s)}(nU(t)),{mtime:0});return{contentType:o3,body:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),estimatedSize:e.byteLength}}if(i===oh.Base64){let e=(e=>"data="+encodeURIComponent("string"==typeof e?e:nU(e)))(function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):e}(nU(t)));return{contentType:"application/x-www-form-urlencoded",body:e,estimatedSize:new Blob([e]).size}}let s=nU(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}},o7=e=>{var t;let i,s=()=>"sendBeacon"===e.transport?{url:o8(e.url,{compression:oh.Base64}),encodedBody:o9(ty(ty({},e),{},{compression:oh.Base64,sl:void 0}))}:{url:o6(e.url,"compression"),encodedBody:o9(ty(ty({},e),{},{compression:void 0,sl:void 0}))};try{i=o9(e)}catch(t){if(t6(e.compression,nW(e.url,"compression")))return i6.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(i&&t6(e.compression,nW(e.url,"compression")))||((t=i.body)instanceof ArrayBuffer?t4(new Uint8Array(t)):ArrayBuffer.isView(t)&&t4(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))?{url:e.url,encodedBody:i}:(o4=!0,s())},ae=e=>{try{return o7(e)}catch(i){var t;return i6.error(i),void(null==(t=e.callback)||t.call(e,{statusCode:0,error:i}))}},at=function(){var e=en(function*(e){let t=yield function(e){return ie.apply(this,arguments)}(nU(e.data),$.DEBUG,{rethrow:!0});if(!t)return e;let i=yield t.arrayBuffer();return ty(ty({},e),{},{sl:{contentType:o3,body:i,estimatedSize:i.byteLength}})});return function(t){return e.apply(this,arguments)}}(),ai=/Failed to fetch|NetworkError|Load failed/i,as=e=>"TypeError"===(null==e?void 0:e.name)&&ai.test((null==e?void 0:e.message)||""),ar=e=>{try{let t=function(e,t=Date.now()){if("string"!=typeof e||!e)return;let i=e.trim(),s=/^\d+\s*,/.test(i)?i.slice(0,i.indexOf(",")).trim():i;if(/^\d+$/.test(s)){let e=1e3*Math.min(Number(s),300);return e>0?e:void 0}if(!/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(s))return;let r=/^\w{3} \w{3} /.test(s)?s+" GMT":s,n=Date.parse(r)-t;return Number.isFinite(n)&&n>0?Math.min(n,3e5):void 0}(e());return q(t)?void 0:Math.min(t,3e4)}catch(e){return}},an=e=>{let t=ae(e);if(!t)return;let i=new _;o2.set(i,!0);let{url:s,encodedBody:r}=t;i.open(e.method||"GET",s,!0);let{contentType:n,body:o}=null!=r?r:{};rp(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t;let s={statusCode:i.status,text:i.responseText};if(200===i.status)try{s.json=JSON.parse(i.responseText)}catch(e){}null==(t=e.callback)||t.call(e,s,ar(()=>i.getResponseHeader("Retry-After")))}},i.send(o)},ao=e=>{let t=ae(e);if(!t)return;let{url:i,encodedBody:s}=t,{contentType:r,body:n,estimatedSize:o}=null!=s?s:{},a=new Headers;rp(e.headers,function(e,t){a.append(t,e)}),r&&a.append("Content-Type",r);let l=null,u=!1;if(m){let t=new m;l={signal:t.signal,timeout:setTimeout(()=>{var i;u=!0;try{t.abort(tc("AbortError","PostHog request timed out"+((i=e.timeout)?` after ${i}ms`:"")))}catch(e){c(e)}},e.timeout)}}let h=!1,c=t=>{var i;h||(h=!0,u&&"AbortError"===(null==t?void 0:t.name)||as(t)?i6.warn(t):i6.error(t),null==(i=e.callback)||i.call(e,{statusCode:0,error:t}))},d=0,p=()=>{o5-=d,d=0,l&&clearTimeout(l.timeout)};try{let t=ty({method:(null==e?void 0:e.method)||"GET",headers:a,referrerPolicy:"strict-origin",body:n,signal:null==l?void 0:l.signal},e.fetchOptions),s=null!=o?o:q(n)?0:void 0;t.keepalive="POST"===t.method&&!e.rl&&!1!==t.keepalive&&t.body===n&&!q(s)&&s>=0&&52428.8>o5+s,t.keepalive&&(d=s,o5+=d),v(i,t).then(t=>t.text().then(i=>{var s;if(h)return;let r={statusCode:t.status,text:i};if(200===t.status)try{r.json=JSON.parse(i)}catch(e){i6.error(e)}h=!0,p(),null==(s=e.callback)||s.call(e,r,ar(()=>t.headers.get("Retry-After")))})).catch(e=>{p(),c(e)}).finally(p)}catch(e){p(),c(e)}},aa=e=>{try{var t;let{url:i,encodedBody:s}=o7(e),{contentType:r,body:n,estimatedSize:o}=null!=s?s:{};if(!n)return;let a=n instanceof Blob?n:new Blob([n],{type:r});if(p.sendBeacon(i,a))return;let l=L(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(L(l)&&l.length>1&&(null!=o?o:0)>16384){let t=Math.ceil(l.length/2),i=t=>L(e.data)?t:ty(ty({},e.data),{},{batch:t});return aa(ty(ty({},e),{},{data:i(l.slice(0,t))})),void aa(ty(ty({},e),{},{data:i(l.slice(t))}))}i6.warn(`Beacon of ~${null!=o?o:0} bytes was rejected by the browser, falling back to ${v?"fetch":"XHR"}`),v?ao(ty(ty({},e),{},{rl:!0})):an(e)}catch(e){i6.warn("Beacon send failed",e)}},al=(e,t,i,s)=>{let r="query"===s?"POST"===t?"sent_at":"_":void 0;return o8(i===oh.GZipJS?o6(e,"compression"):e,ty(ty({},r?{[r]:Date.now().toString()}:{}),i===oh.GZipJS?{}:{compression:i}))},au=(()=>{let e=[];return v&&e.push({transport:"fetch",method:ao}),_&&e.push({transport:"XHR",method:an}),(null==p?void 0:p.sendBeacon)&&e.push({transport:"sendBeacon",method:aa}),e})(),ah=!o1&&-1===(null==b?void 0:b.indexOf("MSIE"))&&-1===(null==b?void 0:b.indexOf("Mozilla"));function ac(e,t,i){var s,r,n;i&&(t=ty(ty({},t),{},{callback:e=>i(e)})),e.__loaded?ah?e.__request_queue.push(t):e.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==(r=t.callback)||r.call(t,{statusCode:429})):(t.transport=t.transport||e.config.api_transport,t.headers=ty(ty({},e.config.request_headers),t.headers),t.compression="best-available"===t.compression?null!=(s=e.compression)?s:t.compressionFallback:t.compression,(q(e.config.disable_beacon)?e.config.__preview_disable_beacon:e.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||e.config.fetch_options,((e,t)=>{var i,s,r;let n=ty(ty({},e),{},{callback:null!=t?t:t=>{var i;return null==(i=e.callback)?void 0:i.call(e,t)}});n.timeout=n.timeout||6e4;let o=null!=(i=n.transport)?i:"fetch";"sendBeacon"===o&&q(n.compression)&&n.data&&(n.compression=oh.Base64),"POST"===n.method&&n.data&&("capture-body"===n.timestampMode?n.data=(e=>{var t,i;let s=(L(e)?e:[e]).map(e=>ty(ty({},e),e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})),r=s[0];return{api_key:null!=(t=null==r||null==(i=r.properties)?void 0:i.token)?t:null==r?void 0:r.token,batch:s,sent_at:(new Date).toISOString()}})(n.data):"body"===n.timestampMode&&(n.data=((e,t=(new Date).toISOString())=>L(e)?e.map(e=>ty(ty({},e),{},{sent_at:t})):ty(ty({},e),{},{sent_at:t}))(n.data))),n.url=al(n.url,n.method,n.compression,n.timestampMode);let a=au.filter(e=>!n.disableTransport||!e.transport||!n.disableTransport.includes(e.transport)),l=null!=(s=null==(r=function(e,t){for(let i=0;e.length>i;i++)if(t(e[i]))return e[i]}(a,e=>e.transport===o))?void 0:r.method)?s:a[0].method;if(!l)throw Error("No available transport method");let u=e=>{try{l(e)}catch(e){var t;as(e)?i6.warn(e):i6.error(e),null==(t=n.callback)||t.call(n,{statusCode:0,error:e})}};"sendBeacon"!==o&&!n.preferSyncCompression&&n.data&&n.compression===oh.GZipJS&&y&&"undefined"!=typeof Promise&&!o4?at(n).then(e=>{u(e)}).catch(t=>{if(t8(t))return o4=!0,void u(ty(ty({},n),{},{compression:void 0,url:al(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||"object"!=typeof e)return!1;let t="name"in e?String(e.name):"";return t8(e)||t===t5})(t)&&(o4=!0),u(n)}):u(n)})(t,(s,r)=>{var n,o,a;e.rateLimiter.checkForLimiting(s),400>s.statusCode||null==(n=(o=e.config).on_request_error)||n.call(o,s),i?i(s,r):null==(a=t.callback)||a.call(t,s)})):t.fireCallbackOnDrop&&(null==(n=t.callback)||n.call(t,{statusCode:0}))}var ad=class{constructor(e,t){this.ol=!0,this.al=[],this.ll=eu((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,i6.createLogger("flush interval"),3e3),this.ul=e}enqueue(e){this.al.push(e),this.cl||this.hl()}unload(){this.dl();let e=Object.values(this.al.length>0?this.vl():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.fl(ty(ty({},e),{},{callback:void 0}),"sendBeacon")})}enable(){this.ol=!1,this.hl()}hl(){this.ol||(this.cl=setTimeout(()=>{this.dl(),this.pl()},this.ll))}pl(){if(this.al.length>0){let e=this.vl();for(let t in e)this.fl(e[t])}}fl(e,t){try{this.ul(e,t)}catch(e){i6.error(e)}}dl(){clearTimeout(this.cl),this.cl=void 0}vl(){let e={},t={};for(let i in rp(this.al,i=>{var s;let r=((i?i.batchKey:null)||i.url)+(i.batchGroup?`:${i.batchGroup}`:"");q(e[r])&&(e[r]=ty(ty({},i),{},{data:[],callback:void 0,fireCallbackOnDrop:void 0}),t[r]=[]),null==(s=e[r].data)||s.push(i.data),i.callback&&t[r].push(i.callback)}),t){let s=t[i];s.length&&(e[i].callback=e=>{for(let t of s)t(e)})}return this.al=[],e}};let ap=["retriesPerformedSoFar"];var af=class{constructor(e){this._instance=e,this.gl=!1,this.ml=3e3,this.al=[],this.al=[],this.yl=!0,this.resume()}resume(){!q(c)&&"onLine"in c.navigator&&(this.yl=c.navigator.onLine,this.bl||(this.bl=()=>{this.yl=!0,this.pl()},this._l=()=>{this.yl=!1},rb(c,"online",this.bl),rb(c,"offline",this._l)))}get length(){return this.al.length}retriableRequest(e,t){let{retriesPerformedSoFar:i}=e,s=it(e,ap);W(i)&&(s.url=o8(s.url,{retry_count:i})),ac(this._instance,t?ty(ty({},s),{},{transport:t}):s,(e,t)=>{var r;if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=i?i:0))return void this.Ls(ty({retriesPerformedSoFar:i},s),t);0===e.statusCode&&i6.warn(`Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after ${null!=i?i:0} retries.`)}null==(r=s.callback)||r.call(s,e)})}Ls(e,t){let i=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=i+1;let s=Math.max(function(e){let t=3e3*Math.pow(2,e),i=Math.min(18e5,t),s=(Math.random()-.5)*(i-t/2);return Math.ceil(i+s)}(i),null!=t?t:0),r=Date.now()+s;this.al.push({retryAt:r,requestOptions:e});let n=`Enqueued failed request for retry in ${s}`;navigator.onLine||(n+=" (Browser is offline)"),i6.warn(n),this.gl||(this.gl=!0,this.wl())}wl(){if(this.kl&&clearTimeout(this.kl),0===this.al.length)return this.gl=!1,void(this.kl=void 0);this.kl=setTimeout(()=>{this.yl&&this.al.length>0&&this.pl(),this.wl()},this.ml)}pl(){let e=Date.now(),t=[],i=this.al.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.al=t,i.length>0)for(let{requestOptions:e}of i)this.retriableRequest(e)}unload(){for(let{requestOptions:e}of(this.kl&&(clearTimeout(this.kl),this.kl=void 0),this.gl=!1,q(c)||(this.bl&&(c.removeEventListener("online",this.bl),this.bl=void 0),this._l&&(c.removeEventListener("offline",this._l),this._l=void 0)),this.al))try{this._instance._send_request(ty(ty({},e),{},{callback:L(e.data)?void 0:e.callback,transport:"sendBeacon"}))}catch(e){i6.error(e)}this.al=[]}},ag=class{constructor(e){this._instance=e,this.Sl=()=>{var e,t,i,s;this.xl||(this.xl={});let r=this.scrollElement(),n=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.xl.lastScrollY=Math.ceil(n),this.xl.maxScrollY=Math.max(n,null!=(e=this.xl.maxScrollY)?e:0),this.xl.maxScrollHeight=Math.max(o,null!=(t=this.xl.maxScrollHeight)?t:0),this.xl.lastContentY=a,this.xl.maxContentY=Math.max(a,null!=(i=this.xl.maxContentY)?i:0),this.xl.maxContentHeight=Math.max(l,null!=(s=this.xl.maxContentHeight)?s:0)}}get $l(){return this._instance.config.scroll_root_selector}getContext(){return this.xl}resetContext(){let e=this.xl;return this.xl=void 0,setTimeout(this.Sl,0),e}startMeasuringScrollPosition(){rb(c,"scroll",this.Sl,{capture:!0}),rb(c,"scrollend",this.Sl,{capture:!0}),rb(c,"resize",this.Sl)}scrollElement(){var e,t;if(this.$l){for(let t of L(this.$l)?this.$l:[this.$l]){let i=null==c||null==(e=c.document)?void 0:e.querySelector(t);if(i)return i}return}return null==c||null==(t=c.document)?void 0:t.documentElement}Cl(e){var t,i;if(this.$l){let t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return c?"y"===e?c.scrollY||c.pageYOffset||(null==(t=c.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:c.scrollX||c.pageXOffset||(null==(i=c.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.Cl("y")}scrollX(){return this.Cl("x")}};let av=e=>n4(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);var a_=class{constructor(e,t,i,s){this.qe=e=>{let t=this.Tl();if(t&&t.sessionId===e)return;let i={sessionId:e,props:this.Il(this._instance)};this.Ml.register({[sK]:i})},this._instance=e,this.El=t,this.Ml=i,this.Il=s||av,this.El.onSessionId(this.qe)}Tl(){return this.Ml.props[sK]}getSetOnceProps(){var e;let t=null==(e=this.Tl())?void 0:e.props;return t?"r"in t?n6(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){let e={};return rp(r_(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e[`$session_entry_${F(i)}`]=t}),e}},am=class{on(e,t){return this.Pl[e]||(this.Pl[e]=[]),this.Pl[e].push(t),()=>{this.Pl[e]=this.Pl[e].filter(e=>e!==t)}}emit(e,t){for(let i of this.Pl[e]||[])i(t);for(let i of this.Pl["*"]||[])i(e,t)}constructor(){this.Pl={}}};let ay=i8("[SessionId]");var ab=class{on(e,t){return this.Rl.on(e,t)}constructor(e,t,i){var s;if(this.Al=null,this.Fl=null,this.Ol=[],this.Dl=void 0,this.Ll=!1,this.Rl=new am,this.Nl=(e,t)=>!(!W(e)||!W(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Mr=e.config,this.Ml=e.persistence,this.je=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.ql=void 0,this._sessionActivityTimestamp=null,this.jl=t||rP,this.Bl=i||rP;let r=this.Mr.persistence_name||this.Mr.token;if(this._sessionTimeoutMs=1e3*eu(this.Mr.session_idle_timeout_seconds||1800,60,36e3,ay.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.zl(),this.Hl="ph_"+r+"_window_id",this.Ul="ph_"+r+"_primary_window_exists",this.Wl()){let e=rG.Dt(this.Hl),t=rG.Dt(this.Ul);e&&!t?this.je=e:rG.Pt(this.Hl),rG.$t(this.Ul,!0)}(null==(s=this.Mr.bootstrap)?void 0:s.sessionID)&&this.setBootstrapSessionId(this.Mr.bootstrap.sessionID),this.Vl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return q(this.Ol)&&(this.Ol=[]),this.Ol.push(e),this.Xt&&e(this.Xt,this.je),()=>{this.Ol=this.Ol.filter(t=>t!==e)}}Wl(){return"memory"!==this.Mr.persistence&&!this.Ml.hi&&rG.At()}Gl(e){e!==this.je&&(this.je=e,this.Wl()&&rG.$t(this.Hl,e))}Ql(){return this.je?this.je:this.Wl()?rG.Dt(this.Hl):null}Zl(e){let t=this.Al;return!z(t)&&!z(e)&&5e3>Math.abs(e-t)}Jl(e,t,i){let s=t!==this._sessionActivityTimestamp,r=e===this.Xt&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Xt=e,r&&!s||r&&this.Zl(t)||(this.Al=t,this.Ml.register({[sj]:[t,e,i]}))}Kl(){var e;let t=null==(e=this.Mr)?void 0:e.persistence_save_debounce_ms;return W(t)&&t>0}Xl(){this.Kl()?this.Ml.refreshKey(sj):(this.Ml.flush(),this.Ml.load())}Yl(){var e;if(z(this._sessionActivityTimestamp)||this._sessionActivityTimestamp===this.Al)return;this.Xl();let[,t,i]=this.tu();t===this.Xt&&i===this._sessionStartTimestamp&&(this.Al=this._sessionActivityTimestamp,this.Ml.register({[sj]:[this._sessionActivityTimestamp,null!=(e=this.Xt)?e:null,this._sessionStartTimestamp]}),this.Ml.flush())}eu(){let[e]=this.tu();return Math.max(W(e)?e:0,W(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}iu(e){return this.Xl(),this.Nl(e,this.eu())}tu(){let e=this.Ml.props[sj];return L(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Al=null,this.ql=void 0,clearTimeout(this.nu),this.nu=void 0,this.Jl(null,null,null)}setBootstrapSessionId(e,t=!1){let i=((e,t=(new Date).getTime())=>{try{let i=(e=>{let t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return i>t+6e4?void ay.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void ay.error("Invalid sessionID in bootstrap",e)}})(e);return!q(i)&&(t?this.ql={sessionId:e,sessionStartTimestamp:i}:this.Jl(e,(new Date).getTime(),i),!0)}destroy(){this.Ll=!0,this.Yl(),clearTimeout(this.nu),this.nu=void 0,this.Dl&&c&&(c.removeEventListener(ra,this.Dl,{capture:!1}),this.Dl=void 0),this.Ol=[]}Vl(){this.Dl=()=>{this.Yl(),this.Wl()&&rG.Pt(this.Ul)},rb(c,ra,this.Dl,{capture:!1})}checkAndGetSessionAndWindowId(e=!1,t=null,i=!1){if("always"===this.Mr.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');let s=t||(new Date).getTime(),r=this.Xt;if(i)this.Fl=s;else if(z(this.Fl)||this.Fl>s||s-this.Fl>=1e3){var n,o;null==(n=(o=this.Ml).syncCookieProperties)||n.call(o),this.Fl=s}let[,a,l]=this.tu(),u=!q(r)&&a!==r,h=this.eu(),c=this.Ql(),d=this.ql,p=!!d&&(d.sessionStartTimestamp>s+6e4||s-d.sessionStartTimestamp>864e5),f=d?p:W(l)&&Math.abs(s-l)>864e5,g=!1,v=u,_=!a||!!d,m=a,y=!_&&!e&&this.Nl(s,h);if(y&&((y=this.iu(s))||ay.info("cross-tab refresh kept the session alive",{sessionId:a}),[,a,l]=this.tu(),y||(_=!a||!!d)),_||y||f){v=!1;let e=d&&!p;a=e?d.sessionId:this.jl(),c=this.Bl(),ay.info("new session ID assigned",{sessionId:a,windowId:c,bootstrapped:!!e,changeReason:{noSessionId:_,activityTimeout:y,sessionPastMaximumLength:f}}),l=e?d.sessionStartTimestamp:s,this.ql=void 0,g=!0}else c||(c=this.Bl(),g=!0),(v=v||a!==m)&&(ay.info("adopted cross-tab session id",{sessionId:a,windowId:c}),g=!0);let b=W(h)&&e&&!f?h:s,w=W(l)?l:(new Date).getTime();this.Gl(c),this.Jl(a,b,w),e||this.zl();let x={noSessionId:_,activityTimeout:y,sessionPastMaximumLength:f,crossTabAdoption:v};return g&&this.Ol.forEach(e=>e(a,c,x)),{sessionId:a,windowId:c,sessionStartTimestamp:w,changeReason:g?x:void 0,lastActivityTimestamp:h}}zl(){this.Ll||(clearTimeout(this.nu),this.nu=setTimeout(()=>{if(!this.Ll)if(this.iu((new Date).getTime())){let e=this.Xt;this.resetSessionId(),this.Rl.emit("forcedIdleReset",{idleSessionId:e})}else this.zl()},1.1*this.sessionTimeoutMs))}};let aw=function(e,t){if(!e)return!1;let i=e.userAgent;if(i&&el(i,t))return!0;try{let i=null==e?void 0:e.userAgentData;if((null==i?void 0:i.brands)&&i.brands.some(e=>el(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function ax(){return(ax=en(function*(){let e=null==p?void 0:p.userAgentData;if(null==e?void 0:e.getHighEntropyValues)try{let t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return H(i)&&i.length>0?i:void 0}catch(e){return void i6.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function ak(e){var t;return!!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)?void 0:t.length)}let a$=(e,t)=>{if(!(e=>{try{new RegExp(e)}catch(e){return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}},aE=e=>e.toLowerCase(),aS={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>a$(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!a$(t,e))),icontains:(e,t)=>t.map(aE).some(t=>e.map(aE).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(aE).every(t=>e.map(aE).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{let i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{let i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})};function aP(e,t){return!e||Object.entries(e).every(([e,i])=>{let s=null==t?void 0:t[e];if(null==s)return!1;let r=aS[i.operator];return!!r&&r(i.values.map(String),[String(s)])})}function aM(e,t,i){return nU({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}let aO="custom",aI="i.posthog.com",aF=/^\/static\//,aC=["/s/","/e/","/i/"];var aA=class{constructor(e){this.su={},this.instance=e}get apiHost(){let e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){let e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e;let t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(`.${aI}`,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.su[this.apiHost]||(this.su[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":aO),this.su[this.apiHost]}ru(e){if(!aF.test(e))return;let t=this.instance.config.asset_host;return"string"==typeof t&&t.trim().replace(/\/$/,"")||void 0}ou(e){let t=nV(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}au(e,t,i){if("ui"===e)return i;let s=i,r=this.instance.config.rewriteRequestPath;if(r){var n;s=r(new URL((null==(n=nV(i))?void 0:n.href)||i)).toString()}if(r&&"api"===e&&aC.some(e=>0===t.indexOf(e))){let e=this.ou(s);if(e){let t=this.apiHost,i=this.lu;(null==i?void 0:i.apiHost)===t&&i.rewriteRequestPath===r||(i={apiHost:t,rewriteRequestPath:r,urls:new Set},this.lu=i),i.urls.add(e)}}return s}isIngestionEndpoint(e){let t=this.lu,i=this.ou(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t=""){if(t&&(t="/"===t[0]?t:`/${t}`),"ui"===e)return this.au(e,t,this.uiHost+t);if("flags"===e)return this.au(e,t,this.flagsApiHost+t);if("assets"===e){let i=this.ru(t);if(i)return this.au(e,t,`${i}${t}`)}if(this.region===aO)return this.au(e,t,this.apiHost+t);let i=aI+t;switch(e){case"assets":return this.au(e,t,`https://${this.region}-assets.${i}`);case"api":return this.au(e,t,`https://${this.region}.${i}`)}}};let aT=i8("[Surveys]"),aR=e=>{try{let t=(e=>`seenSurvey_${function(e){return e.current_iteration&&e.current_iteration>0?`${e.id}_${e.current_iteration}`:e.id}(e)}`)(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){aT.error("Failed to persist survey seen state",e)}},aL=[od.Popover,od.Widget,od.API],aD={ignoreConditions:!1,ignoreDelay:!1,displayType:og.Popover},aN=i8("[PostHog ExternalIntegrations]"),aj={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};var aq=class{constructor(e){this._instance=e}Ho(e,t){var i,s;null==(i=x.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this._instance,e,e=>{if(e)return aN.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t,i,s;for(let[r,n]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))!n||(null==(t=x.__PosthogExtensions__)||null==(t=t.integrations)?void 0:t[r])||this.Ho(aj[r],()=>{var e;null==(e=x.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[r])||e.start(this._instance)}),!n&&(null==(i=x.__PosthogExtensions__)||null==(i=i.integrations)?void 0:i[r])&&(null==(s=x.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[r])||s.stop())}};let aH="autocapture",aB="featureFlags",az="logs",aU="surveys";var aV=class{constructor(e){this._instance=e}initialize(){}get(e){let t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);let i={};for(let s of e){let e=null==t?void 0:t.get_property(s);q(e)||(i[s]=e)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}},aW=class{constructor(e){this.instance=e,this.A=i6,this.kv=new aV(e),this.onEvent=e=>ov(this.instance._addCaptureHook((t,i)=>{if(i)try{e({event:t,properties:i.properties})}catch(e){this.A.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{let t=t=>{try{e(t)}catch(e){this.A.error("Browser extension remote config listener failed",e)}},i=this.instance.uu.on("extensionsRemoteConfig",t);return this.instance.cu&&t(this.instance.cu),ov(i)}}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!=(e=this.instance.get_property("$device_id"))?e:this.distinctId}get deviceId(){let e=this.instance.get_property(sb);return"string"==typeof e?e:void 0}get library(){return{name:$.LIB_NAME,version:$.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!=(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s,r;let n=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!=(t=null==n?void 0:n.sessionId)?t:"",windowId:null!=(i=null==n?void 0:n.windowId)?i:"",sessionStartTimestamp:null!=(s=null==n?void 0:n.sessionStartTimestamp)?s:0,lastActivityTimestamp:null!=(r=null==n?void 0:n.lastActivityTimestamp)?r:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return D(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get projectToken(){return this.instance.config.token}getExtension(e){let t;switch(e){case aB:case"featureFlagsCommon":t=this.instance.featureFlags;break;case az:t=this.instance.logs;break;case aU:t=this.instance.surveys;break;case aH:t=this.instance.autocapture}return t}capture(e,t,i){i?this.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):this.instance.capture(e,t)}registerDynamicEventProperties(e){return ov(this.instance.hu(e))}sendRequest(e){var t=this;return en(function*(e,i={}){var s;let r=null!=(s=i.target)?s:"api",n=t.instance.requestRouter.endpointFor(r,e),o="api"===r&&"/i/v1/logs"===e,a={method:i.method,url:i.query?o8(n,i.query):n,data:i.body,headers:i.headers,timeout:i.timeoutMs,fireCallbackOnDrop:!0,transport:i.transport,compression:i.compression,compressionFallback:"flags"===i.target&&"best-available"===i.compression?S.Base64:void 0,timestampMode:i.sentAt};return o&&(a.batchKey="logs"),"sendBeacon"===i.transport?(t.instance._send_request(a),{statusCode:202}):new Promise(e=>{a.callback=e,t.instance._send_request(a)})}).apply(this,arguments)}};let aG={},aJ=0,aK=()=>{},aQ='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',aY="Surveys module not available",aX="sanitize_properties is deprecated. Use before_send instead",aZ="Invalid value for property_denylist config: ",a0=["$recording_status","$sdk_debug_recording_script_not_loaded","$sdk_debug_replay_url_trigger_status","$sdk_debug_replay_event_trigger_status","$sdk_debug_replay_linked_flag_trigger_status","$sdk_debug_replay_rrweb_error","$sdk_debug_replay_internal_buffer_length","$sdk_debug_replay_flushed_size"],a1=["$feature_flag_called","$$heatmap","$snapshot"],a2=e=>"$"===e.charAt(0)&&!O(a1,e),a3=/^[A-Za-z0-9_-]{1,400}$/,a5=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,a4=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,a6=["token","distinct_id",s1],a8="posthog",a9=e=>{var t;return ty({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){let t=null==e?void 0:e.hostname;if(!H(t))return!1;let i=t.split(".").slice(-2).join(".");for(let e of ry)if(i===e)return!1;return!0}(null==f?void 0:f.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:aK,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:g&&H(null==g?void 0:g.search)&&-1!==g.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==c||null==(t=c.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,feature_flag_request_max_retries:1,surveys_request_timeout_ms:1e4,on_request_error(e){i6.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:ro,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:aK},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:ns,ignore_text_selection:!0}:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:(e=>{let t={};return e&&"unset"!==e&&("2025-11-30">e||(t.strictMinimumDuration=!0),"2026-05-30">e||(t.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(t.streamNetworkBody=!0),"2026-08-30">e||(t.captureJsonLd=!0)),t})(e),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)}))(e))},a7=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],le=e=>{let t={};for(let[i,s]of a7)q(e[i])||(t[s]=e[i]);let i=rf({},t,e),s=e.__preview_external_dependency_versioned_paths;return q(s)||(q(e.strict_script_versioning)&&(i.strict_script_versioning=!!s),H(s)&&q(e.asset_host)&&(i.asset_host=s)),L(e.property_blacklist)&&(q(e.property_denylist)?i.property_denylist=e.property_blacklist:L(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:i6.error(aZ+e.property_denylist)),i};var lt=class{constructor(){this.__forceAllowLocalhost=!1}get du(){return this.__forceAllowLocalhost}set du(e){i6.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},li=class e{vu(e){if(!e)return;let t=this.fu.indexOf(e);-1!==t&&this.fu.splice(t,1)}pu(e,t){var i;return this.vu(e),this.fu.push(t),null==(i=t.initialize)||i.call(t),t}gu(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}mu(){let e,t,i;if(this.yu||this.config.reuseAnonymousId||this.config.segment||this.gu())return;let s="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(s||this.config.disable_persistence)&&(this.bu||(s?(e=`persistence is set to '${this.config.persistence}'`,t="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.yu=!0,console.warn("[PostHog.js]",`${e} but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID ${t}, so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. ${i}`)))}_u(){let e=this.persistence;if(!e||this.wu)return;if(this.gu())return void("on_reject"===this.config.cookieless_mode&&"$posthog_cookieless"!==this.get_distinct_id()&&(this.ku(),this.Su()));if("$posthog_cookieless"!==this.get_distinct_id())return;this.xu()||e.load(!0);let t=this.get_distinct_id();if(!t||"$posthog_cookieless"===t){let t=this.config.get_device_id(rP());this.register({distinct_id:t,$device_id:t}),e.set_property(sJ,rr)}this.ku()}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){var t;this.$u=!1,this.Cu=!1,this.webPerformance=new lt,this.Tu=!1,this.version=$.LIB_VERSION,this.Iu=new Set,this.Mu="",this.uu=new am,this.fu=[],this.Eu=[],this.Pu=!1,this.bu=!1,this.yu=!1,this.wu=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=a9(),this.SentryIntegration=nT,this.sentryIntegration=e=>(function(e,t){let i=nA(e,t);return{name:nC,processEvent:e=>i(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ru=!1,this.Au=null,this.Fu=null,this.Ou=null,this.scrollManager=new ag(this),this.pageViewManager=new nR(this),this.rateLimiter=new ob(this),this.requestRouter=new aA(this),this.consent=new rJ(this),this.externalIntegrations=new aq(this);let i=null!=(t=e.__defaultExtensionClasses)?t:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(e,t,i)=>{let s=H(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{let s=H(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>i6.info(`send "${null==e?void 0:e.event}"`,e))}init(t,i,s){if(s&&s!==a8){var r;let n=null!=(r=aG[s])?r:new e;return n._init(t,i,s),aG[s]=n,aG[a8][s]=n,n}return this._init(t,i,s)}_init(e,t={},i){var s,r,n,o;let a=H(e)?e.trim():"";if(!a)return i6.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return a!==(null==(o=this.config)?void 0:o.token)?console.warn("[PostHog.js]",`You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('${a}', { ... }, 'project2')`):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=a9(t.defaults),t.debug=this.Du(t.debug),this.Lu=t,this.Nu=[],t.person_profiles?this.Fu=t.person_profiles:t.process_person&&(this.Fu=t.process_person);let l=a9(t.defaults),u=le(t),h=rf({},l,u,{name:i,token:a});N(l.rageclick)&&N(u.rageclick)&&(h.rageclick=rf({},l.rageclick,u.rageclick)),N(l.session_recording)&&N(u.session_recording)&&(h.session_recording=rf({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&i6.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:oh.GZipJS;let d=this.xu(),p=!this.gu();if(this.persistence=new ou(this.config,d,!0,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new ou(ty(ty({},this.config),{},{persistence:"sessionStorage"}),d,!1,p),this.Mu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!d&&rG.At()){let e=rG.Dt(this.Mu);L(e)&&e.forEach(e=>{H(e)&&this.Iu.add(e)})}else rG.Pt(this.Mu);let f=ty({},this.persistence.props),g=ty({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.qu=new ad((e,t)=>this.ju(e,t),this.config.request_queue_config),this.Bu=new af(this),this.__request_queue=[];let v=this.gu();v||(this.sessionManager=new ab(this),this.sessionPropsManager=new a_(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{((null==i?void 0:i.activityTimeout)||(null==i?void 0:i.sessionPastMaximumLength)||(null==i?void 0:i.crossTabAdoption))&&this.zu()})),this.Hu(),this.config.__preview_deferred_init_extensions?(i6.info("Deferring extension initialization to improve startup performance"),this.Uu=setTimeout(()=>{this.Uu=void 0,this.Wu(v)},0)):(i6.info("Initializing extensions synchronously"),this.Wu(v)),$.DEBUG=$.DEBUG||this.config.debug,$.DEBUG&&i6.info("Starting in debug mode",{this:this,config:t,thisC:ty({},this.config),p:f,s:g}),!this.config.identity_distinct_id||(null==(s=t.bootstrap)?void 0:s.distinctID)||(t.bootstrap=ty(ty({},t.bootstrap),{},{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));let _=null==(r=t.bootstrap)?void 0:r.distinctID;if(this.bu=!!_&&!B(_),null==(n=t.bootstrap)?void 0:n.distinctID){let e=t.bootstrap.distinctID,i=this.get_distinct_id(),s=this.persistence.get_property(sJ);if(t.bootstrap.isIdentifiedID&&null!=i&&i!==e&&"anonymous"===s)this.identify(e);else if(t.bootstrap.isIdentifiedID&&null!=i&&i!==e&&"identified"===s)i6.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{let i=this.config.get_device_id(rP()),s=t.bootstrap.isIdentifiedID?i:e;this.persistence.set_property(sJ,t.bootstrap.isIdentifiedID?rn:rr),this.register({distinct_id:e,$device_id:s})}}if(v)this.register_once({distinct_id:s0,$device_id:null},"");else if(!this.get_distinct_id()){let e=this.config.get_device_id(rP());this.register_once({distinct_id:e,$device_id:e},""),this.persistence.set_property(sJ,rr)}return rb(c,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),rb(c,"pageshow",()=>{var e;this.$u=!1,this.Cu||null==(e=this.Bu)||e.resume()}),t.segment?nF(this,()=>this.Vu()):this.Vu(),D(this.config._onCapture)&&this.config._onCapture!==aK&&(i6.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&i6.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return ax.apply(this,arguments)})().then(e=>{e&&this.register({[sw]:e})}).catch(aK),this}Gu(e){return H(e.name)&&D(e.setup)}Qu(e,t){var i=this;this.Gu(e)?t.push(en(function*(){try{yield e.setup(i.Zu())}catch(i){i6.error(`Failed to set up extension "${e.name}"`,i);try{var t;yield null==(t=e.dispose)?void 0:t.call(e)}catch(t){i6.error(`Failed to dispose extension "${e.name}"`,t)}}})):this.fu.push(e)}Hu(){var t,i,s,r,n,o,a=this;let l=null!=(r=null==(n=this.config.__extensionClasses)?void 0:n.featureFlags)?r:null==(o=e.__defaultExtensionClasses)?void 0:o.featureFlags;if(l)if(this.featureFlags&&this.featureFlags instanceof l||(null==(t=this.Ju)||t.call(this),this.Ju=void 0,this.featureFlags=new l(this)),D(this.featureFlags.onReloading)&&D(this.featureFlags.setup)){if(!this.Ju){this.Ju=this.featureFlags.onReloading(()=>{this.uu.emit("featureFlagsReloading",!0)});let e=this.featureFlags;en(function*(){try{yield e.setup(a.Zu())}catch(i){i6.error("Failed to set up feature flags",i);let t=a.Ju;a.Ju=void 0;try{null==t||t()}catch(e){i6.error("Failed to unsubscribe feature flag reloading",e)}try{yield e.dispose()}catch(e){i6.error("Failed to dispose feature flags",e)}}})()}}else null==(i=(s=this.featureFlags).initialize)||i.call(s)}Wu(t){var i,s,r,n,o,a,l,u;let h=performance.now(),c=ty(ty({},e.__defaultExtensionClasses),this.config.__extensionClasses),d=[];c.exceptions&&this.fu.push(this.exceptions=null!=(i=this.exceptions)?i:new c.exceptions(this)),c.historyAutocapture&&this.fu.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this.fu.push(this.tracingHeaders=new c.tracingHeaders(this)),c.siteApps&&this.fu.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!t&&this.fu.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||d.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),c.autocapture&&this.Qu(this.autocapture=new c.autocapture(this),d),c.surveys&&this.Qu(this.surveys=null!=(s=this.surveys)?s:new c.surveys(this),d),c.logs&&this.Qu(this.logs=null!=(r=this.logs)?r:new c.logs(this),d),c.metrics&&this.fu.push(this.metrics=null!=(n=this.metrics)?n:new c.metrics(this)),c.conversations&&this.fu.push(this.conversations=null!=(o=this.conversations)?o:new c.conversations(this)),c.productTours&&this.fu.push(this.productTours=new c.productTours(this)),c.heatmaps&&this.fu.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this.fu.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this.fu.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this.fu.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,nM)),c.toolbar&&this.fu.push(this.toolbar=null!=(a=this.toolbar)?a:new c.toolbar(this)),c.experiments&&this.fu.push(this.experiments=null!=(l=this.experiments)?l:new c.experiments(this)),c.webMCP&&this.fu.push(this.webMCP=null!=(u=this.webMCP)?u:new c.webMCP(this)),this.fu.forEach(e=>{e.initialize&&d.push(()=>{var t;null==(t=e.initialize)||t.call(e)})}),d.push(()=>{if(this.Ku){let e=this.Ku;this.Ku=void 0,this.fu.forEach(t=>{var i;return null==(i=t.onRemoteConfig)?void 0:i.call(t,e)})}}),this.Xu(d,h)}Xu(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void(this.Uu=setTimeout(()=>{this.Uu=void 0,this.Xu(e,t)},0));let i=e.shift();if(i)try{i()}catch(e){i6.error("Error initializing extension:",e)}}let i=Math.round(performance.now()-t);this.register_for_session({[s2]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[s3]:i}),this.config.__preview_deferred_init_extensions&&i6.info(`PostHog extensions initialized (${i}ms)`)}il(e){if(!f||!f.body)return i6.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.il(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Ku=e),this.cu=e,this.compression=void 0,e.ok){var t;let i=e.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=O(i.supportedCompression,oh.GZipJS)?oh.GZipJS:O(i.supportedCompression,oh.Base64)?oh.Base64:void 0),(null==(t=i.analytics)?void 0:t.endpoint)&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.Fu?this.Fu:ro}),this.uu.emit("extensionsRemoteConfig",e),this.fu.forEach(t=>{var i;return null==(i=t.onRemoteConfig)?void 0:i.call(t,e)})}Vu(){try{this.config.loaded(this)}catch(e){i6.critical("`loaded` function failed",e)}if(this.Yu(),this.config.internal_or_test_user_hostname&&(null==g?void 0:g.hostname)){let e=g.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.gu())&&this.tc()},1),this.ec=new ox(this),this.ec.load()}Yu(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.qu)||e.enable())}_dom_loaded(){this.is_capturing()&&rd(this.__request_queue,e=>this.ju(e)),this.__request_queue=[],this.Yu()}_handle_unload(){var e,t,i,s,r,n;this.$u=!0,null==(e=this.surveys)||null==(t=e.handlePageUnload)||t.call(e),null==(i=this.metrics)||i.flush("sendBeacon"),this.config.request_batching?(this.nc()&&this.capture(ru),null==(s=this.logs)||s.flushLogs("sendBeacon"),null==(r=this.qu)||r.unload(),null==(n=this.Bu)||n.unload()):this.nc()&&this.capture(ru,null,{transport:"sendBeacon"})}_send_request(e){ac(this,e)}ju(e,t){this.Bu?this.Bu.retriableRequest(e,t):this._send_request(t?ty(ty({},e),{},{transport:t}):e)}_execute_array(e){aJ++;try{let t,i=[],s=[],r=[];rd(e,e=>{if(e)if(t=e[0],L(t))r.push(e);else if(D(e))try{e.call(this)}catch(t){i6.error("Error executing queued PostHog call",e,t)}else L(e)&&"alias"===t?i.push(e):L(e)&&-1!==t.indexOf("capture")&&D(this[t])?r.push(e):s.push(e)});let n=function(e,t){rd(e,function(e){try{if(L(e[0])){let i=t;rp(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){i6.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{aJ--}}push(t){if(aJ>0&&L(t)&&H(t[0])){let i=e.prototype[t[0]];return void(D(i)&&i.apply(this,t.slice(1)))}this._execute_array([t])}get sc(){return{property:sk,persistenceKey:s$,cookieName:"_fbc",pattern:a5,register:(e,t)=>{var i;return null==(i=this.persistence)?void 0:i.register({[s$]:{value:e,delivered:t}})},unregister:()=>{var e;return null==(e=this.persistence)?void 0:e.unregister(s$)}}}get rc(){return{property:sE,persistenceKey:sS,cookieName:"_fbp",pattern:a4,register:(e,t)=>{var i;return null==(i=this.persistence)?void 0:i.register({[sS]:{value:e,delivered:t}})},unregister:()=>{var e;return null==(e=this.persistence)?void 0:e.unregister(sS)}}}oc(e){var t;let i=null==(t=this.persistence)?void 0:t.get_property(e.persistenceKey);return H(i)&&e.pattern.test(i)?{value:i,delivered:!1}:N(i)&&H(i.value)&&e.pattern.test(i.value)?{value:i.value,delivered:!0===i.delivered}:void 0}ac(e,t,i){return t===(null==i?void 0:i.value)?{value:t,pending:!i.delivered}:(e.register(t,!1),{value:t,pending:!0})}lc(e){if(!this.config.save_campaign_params||this.gu())return;let t=rx(e.cookieName);return H(t)&&e.pattern.test(t)?t:void 0}uc(e,t,i,s){if(!this.persistence)return;let r=this.sc;this.persistence.refreshKey(r.persistenceKey);let n=this.oc(r);if(s)return void r.unregister();if(i)return H(t)&&a5.test(t)?this.ac(r,t,n):void r.unregister();let o=H(e)&&a3.test(e)?e:void 0,a=this.lc(r);return a&&((e,t,i)=>{let s=e.split(".");if(t)return s[3]===t;if(!i)return!0;let r=i.value.split(".");return s[3]===r[3]||Number(s[2])>Number(r[2])})(a,o,n)?this.ac(r,a,n):o?(null==n?void 0:n.value.split(".")[3])===o?{value:n.value,pending:!n.delivered}:this.ac(r,`fb.1.${Date.now()}.${o}`,n):n?{value:n.value,pending:!n.delivered}:void 0}cc(e,t,i){if(!this.persistence)return;let s=this.rc;this.persistence.refreshKey(s.persistenceKey);let r=this.oc(s);if(i)return void s.unregister();if(t)return H(e)&&a4.test(e)?this.ac(s,e,r):void s.unregister();let n=this.lc(s);return n?this.ac(s,n,r):r?{value:r.value,pending:!r.delivered}:void 0}hc(e,t){if(!this.persistence)return;this.persistence.refreshKey(e.persistenceKey);let i=this.oc(e);(null==i?void 0:i.value)!==t||i.delivered||e.register(t,!0)}capture(e,t,i){var s,r,n,o,a,l;let u;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this.qu))return void i6.uninitializedWarning("posthog.capture");if(!this.is_capturing())return;if(q(e)||!H(e))return void i6.error("No event name provided to posthog.capture");if(this._u(),"$snapshot"===e&&this.gu())return;let h=!this.config.opt_out_useragent_filter&&this._is_bot();if(h&&!this.config.__preview_capture_bot_pageviews)return;let c=(null==i?void 0:i.skip_client_rate_limiting)?void 0:this.rateLimiter.clientRateLimitContext();if(null==c?void 0:c.isRateLimited)return void i6.critical("This capture call is ignored due to client rate limiting.");(null==t?void 0:t.$current_url)&&!H(null==t?void 0:t.$current_url)&&(i6.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||(null==i?void 0:i.dc)||i6.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(u=this.sessionPersistence.update_campaign_params()),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();let d=new Date,p=(null==i?void 0:i.timestamp)||d,f=th(null==i?void 0:i.uuid,rP),g={uuid:f,event:e,properties:this.calculateEventProperties(e,t||{},p,f)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&h&&(g.event="$bot_pageview",g.properties.$browser_type="bot"),c&&(g.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);let v="$feature_flag_called"===e&&!1===g.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");(null==i?void 0:i.$set)&&!v&&(g.$set=null==i?void 0:i.$set);let _=N(null==t?void 0:t.$set)?t.$set:void 0,m=L(null==t?void 0:t.$unset)?t.$unset:[],y=(null==i?void 0:i.$unset)||[],b=e=>{var t;let s=!!(null==i?void 0:i.$set)&&e in i.$set;return{hasProvided:s||!!_&&e in _,provided:s?null==i||null==(t=i.$set)?void 0:t[e]:null==_?void 0:_[e],unset:-1!==m.indexOf(e)||-1!==y.indexOf(e)}},w=b(sk),x=b(sE),k=[{channel:this.sc,hasProvided:w.hasProvided,update:this.uc(null==u?void 0:u.fbclid,w.provided,w.hasProvided,w.unset)},{channel:this.rc,hasProvided:x.hasProvided,update:this.cc(x.provided,x.hasProvided,x.unset)}];for(let{channel:e,hasProvided:t,update:i}of k)i&&!0===g.properties.$process_person_profile&&i.pending&&!t&&!v&&(g.$set=ty({[e.property]:i.value},g.$set));let $=null==i?void 0:i.$unset;$&&(g.$unset=$);let E=v?void 0:this.vc(null==i?void 0:i.$set_once,e!==rc,e===rh);if(E&&(g.$set_once=E),(null==i?void 0:i._noTruncate)||(n=this.config.properties_string_max_length,g=function(e,t){let i=new Set;return function e(s,r){let n;if(s!==Object(s))return t?t(s):s;if(!i.has(s)){if(i.add(s),L(s))n=[],rd(s,t=>{n.push(e(t))});else{let t={};rp(X(s)?rm(s):s,(s,r)=>{i.has(s)||(t[r]=e(s,r))}),n=t}return n}}(e)}(g,e=>H(e)?e.slice(0,n):e)),g.timestamp=p,q(null==i?void 0:i.timestamp)||(g.properties.$event_time_override_provided=!0,g.properties.$event_time_override_system_time=d),v&&(g.properties=((e,t=[])=>{let i={},s=t=>{void 0!==e[t]&&(i[t]=e[t])};return t3.forEach(s),t.forEach(s),i})(g.properties,a6)),e===op.DISMISSED||e===op.SENT){let i,s=null==t?void 0:t[of.SURVEY_ID],r=null==t?void 0:t[of.SURVEY_ITERATION];aR({id:s,current_iteration:r}),g.$set=ty(ty({},g.$set),{},{[(a={id:s,current_iteration:r},l=e===op.SENT?"responded":"dismissed",i=`$survey_${l}/${a.id}`,a.current_iteration&&a.current_iteration>0&&(i=`$survey_${l}/${a.id}/${a.current_iteration}`),i)]:!0})}else e===op.SHOWN&&(g.$set=ty(ty({},g.$set),{},{[of.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(e===o_.SHOWN){let e=null==t?void 0:t[om.TOUR_TYPE];e&&(g.$set=ty(ty({},g.$set),{},{[`${om.TOUR_LAST_SEEN_DATE}/${e}`]:(new Date).toISOString()}))}let S=ty(ty({},g.properties.$set),g.$set);if(j(S)||this.setPersonPropertiesForFlags(S),!U(this.config.before_send)){let e=this.Os(g);if(!e)return;(g=e).uuid=th(g.uuid,rP)}this.sessionRecording&&!this.Pu&&a2(e)&&(this.Pu=!0,setTimeout(()=>this.Pu=!1,3e4));let P=k.filter(({channel:e,update:t})=>{var i,s,r;let n=null!=(i=null==(s=g.$set)?void 0:s[e.property])?i:N(null==(r=g.properties)?void 0:r.$set)?g.properties.$set[e.property]:void 0;return(null==t?void 0:t.pending)&&n===t.value});this.uu.emit("eventCaptured",g);let M=null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),O="recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(M),I=ty(ty(ty({method:"POST",url:M,data:g,compression:"best-available",preferSyncCompression:null==i?void 0:i.send_instantly,timestampMode:O?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},O&&(null==(r=g.properties)?void 0:r.$session_id)?{batchGroup:g.properties.$session_id+(g.properties.$window_id?`-${g.properties.$window_id}`:"")}:{}),(null==i?void 0:i.transport)?{transport:i.transport}:{}),P.length?{fireCallbackOnDrop:!0,callback:e=>{if(e.statusCode>=200&&300>e.statusCode)for(let{channel:e,update:t}of P)this.hc(e,t.value)}}:{});if(!this.config.request_batching||i&&!(null==i?void 0:i._batchKey)||(null==i?void 0:i.send_instantly)){let e;!I.transport&&!I.callback&&j(null!=(o=this.config.request_headers)?o:{})&&this.$u&&(e="sendBeacon"),this.ju(I,e)}else this.qu.enqueue(I);return g}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}getExtension(e){var t;return null==(t=this.fc)?void 0:t.getExtension(e)}Zu(){var e;return null!=(e=this.fc)?e:this.fc=new aW(this)}hu(e){this.Eu.push(e);let t=!0;return()=>{if(!t)return;t=!1;let i=this.Eu.indexOf(e);-1!==i&&this.Eu.splice(i,1)}}gc(e=!0){var t,i,s;return!!(null==(t=this.persistence)?void 0:t.consumeCookieIdentityChange())&&(this.Ou=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(s=this.sessionPersistence)||s.clear(),this.Iu.clear(),this.mc()),null==(i=this.featureFlags)||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,i,s,r){let n;if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;this._u(),this.persistence.syncCookieProperties(),this.gc();let o=r?void 0:this.persistence.remove_event_timer(e),a=ty({},t);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.gu()&&(a[s1]=!0),"$snapshot"===e){let e=ty(ty({},this.persistence.properties()),this.sessionPersistence.properties());return a.distinct_id=e.distinct_id,(!H(a.distinct_id)&&!V(a.distinct_id)||B(a.distinct_id))&&i6.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}let l=function(e,t,i,s=!1){var r,n,o,a;if(!b)return{};let l=e?[...nK,...t||[]]:[],[u,h]=e7(b),[d,p]=function(e){for(let t=0;ts.length>t;t++){let[i,s,r]=ts[t],n=e.match(i);if(n){let t=r&&e.match(r)||n;return[s,(null==t?void 0:t[1])||""]}}return["",""]}(b),f=function(){let e="u">typeof navigator?navigator:void 0;return(null==e?void 0:e.brave)?{brave:!0}:{}}(),v={};q(i)||(v.detectGoogleSearchApp=i);let _={},m=null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,y=null==(n=navigator)?void 0:n.maxTouchPoints,w=null==c||null==(o=c.screen)?void 0:o.width,x=null==c||null==(a=c.screen)?void 0:a.height,k=null==c?void 0:c.devicePixelRatio;q(m)||(_.userAgentDataPlatform=m),q(y)||(_.maxTouchPoints=y),q(w)||(_.screenWidth=w),q(x)||(_.screenHeight=x),q(k)||(_.devicePixelRatio=k);let E=rf(r_({$os:u,$os_version:h,$browser:e4(b,navigator.vendor,f,v),$webview_app:d,$webview_app_version:p,$device:te(b),$device_type:tt(b,_),$timezone:nq(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:nG(s?td(null==g?void 0:g.href):null==g?void 0:g.href,l,nY),$host:null==g?void 0:g.host,$pathname:null==g?void 0:g.pathname,$raw_user_agent:b.length>1e3?b.substring(0,997)+"...":b,$browser_version:e8(b,navigator.vendor,f,v),$browser_language:n2(),$browser_language_prefix:function(){let e=n2();return"string"==typeof e?e.split("-")[0]:void 0}(),$screen_height:null==c?void 0:c.screen.height,$screen_width:null==c?void 0:c.screen.width,$viewport_height:null==c?void 0:c.innerHeight,$viewport_width:null==c?void 0:c.innerWidth,$lib:$.LIB_NAME,$lib_version:$.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return $.SDK_DIST_CHANNEL&&(E.$sdk_dist_channel=$.SDK_DIST_CHANNEL),E}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){let{sessionId:e,windowId:t}=this.sessionManager.checkAndGetSessionAndWindowId(r,i.getTime(),!0);a.$session_id=e,a.$window_id=t}this.sessionPropsManager&&rf(a,this.sessionPropsManager.getSessionProps());try{var u;if(this.sessionRecording){let t=this.sessionRecording.sdkDebugProperties,i=!this.Pu&&a2(e);for(let e in t)(i||O(a0,e))&&(a[e]=t[e])}a.$sdk_debug_retry_queue_size=null==(u=this.Bu)?void 0:u.length}catch(e){a.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===aO&&(a.$lib_custom_api_host=this.config.api_host),n="$pageview"!==e||r?"$pageleave"!==e||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),a=rf(a,n),"$pageview"===e&&f&&(a.title=f.title),!q(o)){let e=i.getTime()-o;a.$duration=parseFloat((e/1e3).toFixed(3))}b&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser");let h=this.persistence.properties(),d=this.sessionPersistence.properties(),p=a.$groups,v=h.$groups;N(p)&&!j(p)&&(a.$groups=ty(ty({},N(v)?v:{}),p)),rp(["$referrer","$referring_domain"],e=>{e in h&&delete d[e]});let _={};if(this.Eu.length>0)for(let e of this.Eu.slice())try{rf(_,e())}catch(e){i6.error("Failed to produce browser extension event properties",e)}(a=rf({},l,h,d,ty(ty({},_),a))).$is_identified=this._isIdentified(),L(this.config.property_denylist)?rp(this.config.property_denylist,function(e){delete a[e]}):i6.error(aZ+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);let m=this.config.sanitize_properties;m&&(i6.error(aX),a=m(a,e));let y=this.yc();return a.$process_person_profile=y,y&&!r&&this.bc("_calculate_event_properties"),a}vc(e,t=!0,i=!1){var s;if(!this.persistence||!this.yc()||this.Tu&&!i)return e;let r=rf({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(i6.error(aX),r=n(r,"$set_once")),t&&(this.Tu=!0),j(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t,i;null==(t=this.persistence)||t.syncCookieProperties(),this.gc(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e=>this.Iu.add(e)),this.mc()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this.Iu.delete(e),this.mc()}_c(e,t){this.register({[e]:t})}zu(){this.Iu.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.Iu.clear(),this.mc()}mc(){var e;if(!this.Mu)return;if("memory"===this.config.persistence||(null==(e=this.sessionPersistence)?void 0:e.hi)||!rG.At())return void rG.Pt(this.Mu);let t=[];this.Iu.forEach(e=>t.push(e)),t.length>0?rG.$t(this.Mu,t):rG.Pt(this.Mu)}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())?e:[]}isFeatureEnabled(e,t){var i,s;return null!=(i=null==(s=this.featureFlags)?void 0:s.isFeatureEnabled(e,t))?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var s;null==(s=this.featureFlags)||s.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t=!1,i){var s;return null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.uu.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:aY}),()=>{})}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t=!1){this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:aY})}getActiveMatchingSurveys(e,t=!1){this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:aY})}onActiveMatchingSurveysChanged(e){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(e):(e([],{isLoaded:!1,error:aY}),()=>{})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t=aD){var i;null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!=(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))?t:{visible:!1,disabledReason:aY}}canRenderSurveyAsync(e,t=!1){var i,s;return null!=(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:aY})}wc(e){return!e||B(e)?(i6.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(i6.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.`),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(i6.critical(`The string "${e}" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.`),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return i6.uninitializedWarning("posthog.identify");if(V(e)&&(e=e.toString(),i6.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),!this.wc(e)||!this.bc("posthog.identify"))return;this._u();let s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this.gc(!1),o=this.persistence.Da(),a=!1;try{let s=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property("__alias")&&(this.unregister(sx),this.register({distinct_id:e}));let o=(this.persistence.get_property("$user_state")||"anonymous")===rr,u=e!==s,h=!u&&o;if(u&&o){var l;let r=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:s};this.persistence.set_property(sJ,rn),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$identify",r,{$set:t||{},$set_once:i||{}})&&(this.Ou=aM(e,t,i)),null==(l=this.featureFlags)||l.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:s)}else if(h){this.persistence.set_property(sJ,rn);let s=t||{},r=i||{};this.setPersonPropertiesForFlags({$set:s,$set_once:r},!1),this.config.cookieWinsOnConflict&&this.persistence.La(),this.capture("$set",{$set:s,$set_once:r})&&(this.Ou=aM(e,t,i))}else(t||i)&&this.setPersonProperties(t,i);u||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(sp)):h&&(t||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.ja(a)}}setPersonProperties(e,t){if(!e&&!t||!this.bc("posthog.setPersonProperties"))return;let i=aM(this.get_distinct_id(),e,t);this.Ou!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}})&&(this.Ou=i)):i6.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}unsetPersonProperties(e){var t;let i=(L(e)?e:[e]).filter(e=>H(e)&&e.length>0);0!==i.length&&this.bc("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Ou=null)}group(e,t,i){var s;if(!e||!t)return void i6.error("posthog.group requires a group type and group key");null==(s=this.persistence)||s.syncCookieProperties(),this.gc();let r=this.getGroups(),n=r[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:ty(ty({},r),{},{[e]:t})}),(n||i)&&this.yc()){let s={$group_type:e,$group_key:t};i&&(s.$group_set=i),this.capture(rc,s)}i&&this.setGroupPropertiesForFlags({[e]:i}),n&&!i&&this.reloadFeatureFlags()}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t=!0){var i;null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e=!0){var t;null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t=!0){var i;this.bc("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){let t=G(e)?e:null==e?void 0:e.resetDeviceID,i=G(e)||null==e?void 0:e.bootstrap;this.kc(t,!1,i)}kc(e,t=!1,i){var s,r,n,o,a,l,u,h,c,d,p,f,g,v,_,m,y,b,w,x,k;if(i6.info("reset"),!this.__loaded)return i6.uninitializedWarning("posthog.reset");let $=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(s=this.Lu)?void 0:s.bootstrap)||{},null==(r=this.featureFlags)||null==(n=r.updateConfig)||n.call(r,this.config,this.nl());let E=this.get_property(sb),S=this.get_property(sw),P=this.get_property(sN);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();let M=this.is_capturing();t||this.consent.reset(),t||!M||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");let O=null==(a=this.persistence)||null==(l=a.Da)?void 0:l.call(a),I=this.wu;this.wu=I||t;let F=!1;try{if(null==(u=this.persistence)||u.clear(),null==(h=this.sessionPersistence)||h.clear(),this.Iu.clear(),this.mc(),q(P)||null==(m=this.persistence)||m.register({$session_recording_remote_config:P}),null==(c=this.surveys)||c.reset(),null==(d=this.featureFlags)||d.reset(),null==(p=this.conversations)||p.reset(),null==(f=this.logs)||f.reset(),null==(g=this.metrics)||g.reset(),null==(v=this.persistence)||v.set_property("$user_state","anonymous"),null==(_=this.sessionManager)||_.resetSessionId(),this.Ou=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:s0,$device_id:null},"");else{let t=this.config.get_device_id(rP());this.register_once({distinct_id:t,$device_id:e?t:E},""),e||q(S)||this.register({[sw]:S})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(i.distinctID&&!this.gu()&&(null==(w=this.persistence)||w.set_property("$user_state",i.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:i.distinctID})),null==(y=this.featureFlags)||y.initialize(),!U($)&&!(null==(b=this.sessionManager)?void 0:b.setBootstrapSessionId($,!0)))){let e=ty({},i);delete e.sessionID,this.config.bootstrap=e}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,F=!0}finally{this.wu=I,O&&(null==(x=this.persistence)||null==(k=x.ja)||k.call(x,F))}this.reloadFeatureFlags()}shutdown(e){var t=this;return en(function*(){if(!t.__loaded)return void i6.uninitializedWarning("posthog.shutdown");t.Cu=!0,clearTimeout(t.Uu),t.Uu=void 0;let e=t.Ju;for(let i of(t.Ju=void 0,[()=>{var e;return null==(e=t.sessionRecording)?void 0:e.dispose()},()=>{var e;return null==(e=t.logs)?void 0:e.flushLogs("sendBeacon")},()=>{var e;return null==(e=t.metrics)?void 0:e.flush("sendBeacon")},()=>{var e;return null==(e=t.metrics)?void 0:e.dispose()},()=>{var e;return null==(e=t.logs)?void 0:e.dispose()},()=>{var e;return null==(e=t.surveys)?void 0:e.dispose()},()=>{var e;return null==(e=t.autocapture)?void 0:e.dispose()},()=>null==e?void 0:e(),()=>{var e;return null==(e=t.qu)?void 0:e.unload()},()=>{var e;return null==(e=t.Bu)?void 0:e.unload()},()=>{var e;return null==(e=t.featureFlags)?void 0:e.destroy()},()=>{var e;return null==(e=t.persistence)?void 0:e.destroy()},()=>{var e;return null==(e=t.sessionPersistence)?void 0:e.destroy()}]))try{let e=i();e&&D(e.then)&&e.then(void 0,e=>{i6.error("Error during shutdown",e)})}catch(e){i6.error("Error during shutdown",e)}})()}setIdentity(e,t){var i;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.Sc()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(e=this.conversations)||e.xc()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";let{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui",`/project/${this.config.token}/replay/${t}`);if((null==e?void 0:e.withTimestamp)&&i){var r;let t=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+=`?t=${Math.max(Math.floor(((new Date).getTime()-i)/1e3)-t,0)}`}return s}alias(e,t){return e===this.get_property("$people_distinct_id")?(i6.critical("Attempting to create alias for existing People user - aborting."),-2):this.bc("posthog.alias")?(q(t)&&(t=this.get_distinct_id()),e!==t?(this._c(sx,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(i6.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){let t=ty({},this.config);if(N(e)){var i,s,r,n,o,a,l,u,h,c,d,p,f,g,v,_,m,y;rf(this.config,le(e));let b=this.xu();if(this.persistence){let e="sessionStorage"===this.config.persistence||"memory"===this.config.persistence;(e&&this.sessionPersistence!==this.persistence&&(null==(v=this.sessionPersistence)||v.remove(),null==(_=this.sessionPersistence)||_.destroy()),this.persistence.update_config(this.config,t,b),e)?this.sessionPersistence=this.persistence:this.sessionPersistence===this.persistence?this.sessionPersistence=new ou(ty(ty({},this.config),{},{persistence:"sessionStorage"}),b,!1):null==(m=this.sessionPersistence)||m.update_config(ty(ty({},this.config),{},{persistence:"sessionStorage"}),ty(ty({},t),{},{persistence:"sessionStorage"}),b)}let w=this.Du(this.config.debug);G(w)&&(this.config.debug=w),G(this.config.debug)&&(this.config.debug?($.DEBUG=!0,rT.At()&&rT.$t("ph_debug",!0),i6.info("set_config",{config:e,oldConfig:t,newConfig:ty({},this.config)})):($.DEBUG=!1,rT.At()&&rT.Pt("ph_debug"))),null==(i=this.featureFlags)||null==(s=i.updateConfig)||s.call(i,this.config,this.nl()),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(n=this.exceptions)||n.onConfigChange(),null==(o=this.metrics)||o.onConfigChange(),null==(a=this.webMCP)||a.startIfEnabled(),null==(l=this.sessionRecording)||l.startIfEnabledOrStop(),null==(u=this.tracingHeaders)||u.startIfEnabledOrStop(),null==(h=this.autocapture)||h.startIfEnabled(),null==(c=this.heatmaps)||c.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(y=this.historyAutocapture)||y.startIfEnabledOrStop()),null==(d=this.exceptionObserver)||d.startIfEnabledOrStop(),null==(p=this.deadClicksAutocapture)||p.startIfEnabledOrStop(),null==(f=this.surveys)||f.loadIfEnabled(),this.ku(),null==(g=this.externalIntegrations)||g.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&nF(this,aK,!1)}}_overrideSDKInfo(e,t){$.LIB_NAME=e,$.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,n;let o=!0===e,a={sampling:o||!!(null==e?void 0:e.sampling),linked_flag:o||!!(null==e?void 0:e.linked_flag),url_trigger:o||!!(null==e?void 0:e.url_trigger),event_trigger:o||!!(null==e?void 0:e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!!(null==(e=this.sessionRecording)?void 0:e.started)}captureException(e,t){try{if(!this.exceptions)return;let i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(ty(ty({},i),t))}catch(e){return}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var t,i;return null!=(t=null==(i=this.logs)?void 0:i.logger)?t:e.$c}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!=(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e;let t=null!=(e=this.config.name)?e:a8;return t!==a8&&(t="posthog."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property("$user_state"))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property("$user_state"))}yc(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&j(this.getGroups())&&!(null==(e=this.persistence)||null==(e=e.props)?void 0:e.__alias)&&!(null==(t=this.persistence)||null==(t=t.props)?void 0:t.$epp))}nc(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.yc()||this.bc("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.bc("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}bc(e){return"never"===this.config.person_profiles?(i6.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.mu(),this._c(sZ,!0),!0)}xu(){if("always"===this.config.cookieless_mode)return!0;let e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)}ku(){var e,t,i,s,r;let n=this.xu();return this.is_capturing()||null==(i=this.logs)||i.Cc(),(null==(e=this.persistence)?void 0:e.hi)!==n&&(null==(s=this.persistence)||s.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t.hi)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),this.mc(),n}opt_in_capturing(t){var i,s,r,n,o,a,l,u,h,c,d;if("always"!==this.config.cookieless_mode){if(this.gu()){null==(s=this.sessionRecording)||s.dispose({discardBufferedEvents:!0}),this.kc(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new ab(this),this.pageViewManager=new nR(this),this.persistence&&(this.sessionPropsManager=new a_(this,this.sessionManager,this.persistence));let t=null!=(o=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)?o:null==(l=e.__defaultExtensionClasses)?void 0:l.sessionRecording;t&&(this.sessionRecording=this.pu(this.sessionRecording,new t(this)),this.cu&&(null==(u=this.sessionRecording)||null==(h=u.onRemoteConfig)||h.call(u,this.cu)))}this.consent.optInOut(!0),this.ku(),this.Yu(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(c=this.surveys)||c.loadIfEnabled()),(q(null==t?void 0:t.captureEventName)||(null==t?void 0:t.captureEventName))&&this.capture(null!=(d=null==t?void 0:t.captureEventName)?d:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.tc()}else i6.warn(aQ)}opt_out_capturing(){"always"!==this.config.cookieless_mode?(this.consent.optInOut(!1),this.ku(),"on_reject"===this.config.cookieless_mode&&this.Su()):i6.warn(aQ)}Su(){var e,t;let i=this.sessionRecording;null==i||i.dispose({discardBufferedEvents:!0}),"$posthog_cookieless"!==this.get_distinct_id()&&this.kc(!0,!0),this.register({distinct_id:s0,$device_id:null}),this.vu(i),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.tc(),this.Yu()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){let e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return!this.wu&&("always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing()))}clear_opt_in_out_capturing(){this.consent.reset(),this.ku()}_is_bot(){return p?aw(p,this.config.custom_blocked_useragents):void 0}tc(){f&&("visible"===f.visibilityState?this.Ru||(this.Ru=!0,this.capture(rl,{title:f.title},{send_instantly:!0}),this.Au&&(f.removeEventListener(sm,this.Au),this.Au=null)):this.Au||(this.Au=this.tc.bind(this),rb(f,sm,this.Au)))}debug(e){!1===e?(null==c||c.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==c||c.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}nl(){let e=this.Lu||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(i6.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(e,t,i,s,r){let n=t in e&&!U(e[t]),o=i in e&&!U(e[i]);return n?e[t]:!!o&&(r&&r.warn(`Config field '${i}' is deprecated. Please use '${t}' instead. The old field will be removed in a future major version.`),e[i])}(e,"advanced_disable_flags","advanced_disable_decide",0,i6)}Os(e){var t;if(U(this.config.before_send))return e;let i=Object.keys(null!=(t=e.properties)?t:{}).filter(K),s=L(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(let t of s)try{if(r=t(r),U(r)){let t=`Event '${e.event}' was rejected in beforeSend function`;return J(e.event)?i6.warn(`${t}. This can cause unexpected behavior.`):i6.info(t),null}r.properties&&!j(r.properties)||i6.warn(`Event '${e.event}' has no properties after beforeSend function, this is likely an error.`)}catch(t){return i6.error(`Error in beforeSend function for event '${e.event}':`,t),null}for(let t of i)if(r.properties&&U(r.properties[t]))return i6.warn(`Event '${e.event}' had its '${t}' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped.`),null;return r}getPageViewId(){var e;return null==(e=this.pageViewManager.Vo)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}Du(e){let t=G(e)&&!e,i=rT.At()&&"true"===rT.Ot("ph_debug");return!t&&(!!i||e)}};li.__defaultExtensionClasses={},li.$c=(()=>{let e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(let i=0;t.length>i;i++)e.prototype[t[i]]=rv(e.prototype[t[i]])}(li,["identify"]);var ls=class{constructor(e){this.disabled=!1===e;let t=N(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;let s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<this.thresholdPx&&this.timeoutMs>i-s.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}};let lr="$copy_autocapture",ln=i8("[AutoCapture]");function lo(e,t){return t.length>e?t.slice(0,e)+"...":t}var la=class{vo(){this.fo=void 0,clearTimeout(this.po),this.po=void 0}mo(e){var t;if(!ng(e))return!0;let i=null!=(t=this.yo().css_selector_ignorelist)?t:nt,s=new Set,r=e;for(;r;){if(s.size>=1e3||s.has(r))return!0;s.add(r);let e=r,t=r3(e);if(O(t,"ph-no-capture")||O(t,"ph-sensitive")||nv(e)||i.some(t=>r9(e,t)))return!0;let n=r.parentNode;r=r0(n)?n.host:n&&rY(n)?n:null}return!1}bo(e){if(!this.isEnabled||"pointercancel"===e.type)return void this.vo();if("pointerdown"===e.type){var t;this.vo();let i=r6(e);return void(e.isPrimary&&0===e.button&&!e.ctrlKey&&i&&rY(i)&&(this.fo={target:i,excluded:this.mo(i),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:null==(t=this._o)?void 0:t.distinctId}))}let i=this.fo;i&&(e.pointerId!==i.id||Math.abs(e.clientX-i.x)>5||Math.abs(e.clientY-i.y)>5?this.vo():"pointerup"===e.type&&(i.released=!0,this.po=setTimeout(()=>this.vo(),0)))}wo(e){var t,i;let s=this.fo;this.vo();let r=r6(e);if((null==s?void 0:s.released)&&s.target.isConnected&&s.distinctId===(null==(t=this._o)?void 0:t.distinctId)&&e.pointerId===s.id&&(e.detail>0||"touch"===e.pointerType||"pen"===e.pointerType)&&0===e.button&&5>=Math.abs(e.clientX-s.x)&&5>=Math.abs(e.clientY-s.y)&&r&&(rX(r,"html")||rX(r,"body"))){if(s.excluded)return null;let e=null!=(i=this.yo().css_selector_ignorelist)?i:nt;return[r,null==f?void 0:f.documentElement,null==f?void 0:f.body].some(t=>{if(!t)return!1;let i=r3(t);return O(i,"ph-no-capture")||O(i,"ph-sensitive")||!ng(t)||nv(t)||e.some(e=>r9(t,e))})?null:s.target}}constructor(e){this.ko=e,this.name=aH,this.So=!1,this.xo=null,this.$o=!1,this.Co=new Map,this.To=!1,this.Mr={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.Io=!1,this.ko.refresh(this.Mr),this.rageclicks=new ls(this.Mr.rageclick),this.Mo=null}setup(e){this.Eo(),this._o=e;let t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.Io?t.dispose():(this.Po=t,this.startIfEnabled())}dispose(){var e;this.Io||(this.Io=!0,this._o=void 0,null==(e=this.Po)||e.dispose(),this.Po=void 0,this.Co.clear(),this.Mo=null,this.Ro())}yo(){return this.ko.refresh(this.Mr),this.Mr}Eo(){var e,t;return this.yo(),this.Mr.url_allowlist=null==(e=this.Mr.url_allowlist)?void 0:e.map(e=>new RegExp(e)),this.Mr.url_ignorelist=null==(t=this.Mr.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),this.Mr}Ao(){if(!this.isBrowserSupported())return void ln.info("Disabling Automatic Event Collection because this browser is not supported");if(!c||!f)return;let e=this.Fo=e=>{e=e||(null==c?void 0:c.event);try{if("blur"===e.type)return void this.vo();if(0===e.type.indexOf("pointer"))return void this.bo(e);let t="click"===e.type?this.wo(e):void 0;if(z(t))return;this.Oo(e,"$autocapture",t)}catch(e){ln.error("Failed to capture event",e)}};if(rb(c,"blur",e),rb(f,"submit",e,{capture:!0}),rb(f,"change",e,{capture:!0}),rb(f,"click",e,{capture:!0}),rp(["pointerdown","pointermove","pointerup","pointercancel"],t=>{rb(f,t,e,{capture:!0})}),this.yo().capture_copied_text){let e=this.Do=e=>{e=e||(null==c?void 0:c.event);try{this.Oo(e,lr)}catch(e){ln.error("Failed to capture clipboard event",e)}};rb(f,"copy",e,{capture:!0}),rb(f,"cut",e,{capture:!0}),rb(f,"paste",e,{capture:!0})}}Ro(){this.vo(),this.Fo&&(null==c||c.removeEventListener("blur",this.Fo),rp(["pointerdown","pointermove","pointerup","pointercancel"],e=>{null==f||f.removeEventListener(e,this.Fo,!0)}),null==f||f.removeEventListener("submit",this.Fo,!0),null==f||f.removeEventListener("change",this.Fo,!0),null==f||f.removeEventListener("click",this.Fo,!0),this.Fo=void 0),this.Do&&(null==f||f.removeEventListener("copy",this.Do,!0),null==f||f.removeEventListener("cut",this.Do,!0),null==f||f.removeEventListener("paste",this.Do,!0),this.Do=void 0),this.So=!1}startIfEnabled(){this.isEnabled||this.vo(),!this.Io&&this._o&&this.isEnabled&&!this.So&&(this.Ao(),this.So=!0)}onRemoteConfig(e){var t;if(this.Io)return;if(this.$o=!0,!e.ok)return void this.startIfEnabled();let i=e.config;i.elementsChainAsString&&(this.To=i.elementsChainAsString);let s=i.autocapture_opt_out;G(s)&&(null==(t=this._o)||t.kv.set("$autocapture_disabled_server_side",s),this.xo=s),this.startIfEnabled()}setElementSelectors(e,t=this){if(this.Io)return;e.size?this.Co.set(t,new Set(e)):this.Co.delete(t);let i=new Set;this.Co.forEach(e=>{e.forEach(e=>i.add(e))}),this.Mo=i}getElementSelectors(e,t){var i;let s=[];return null==(i=this.Mo)||i.forEach(i=>{let r=null==f?void 0:f.querySelectorAll(i);null==r||r.forEach(r=>{e!==r&&t!==r||O(s,i)||s.push(i)})}),s}get isEnabled(){var e,t;if(this.Io)return!1;let i=null==(e=this._o)?void 0:e.kv.get(sM),s=this.xo,r=this.yo();if(!r.remoteRequestsDisabled&&!this.$o)return!1;let n=r.remoteRequestsDisabled&&!this.$o;if(z(s)&&!G(i)&&!n)return!1;let o=null!=(t=this.xo)?t:!!i;return!!r.enabled&&!o}Oo(e,t="$autocapture",i){var s,r,n,o;if(!this.isEnabled)return void this.vo();let a=i||r6(e);rZ(a)&&(a=a.parentNode||null);let l=this.Eo();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&l.rageclick&&(null==(s=this.rageclicks)?void 0:s.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime()))&&nd(a,l.rageclick)&&this.Oo(e,"$rageclick",i);let u=t===lr,h=u?ty(ty({},l),{},{dom_event_allowlist:void 0}):l;if(a&&function(e,t,i,s,r,n){var o;if(!c||np(e)||(null==i?void 0:i.url_allowlist)&&!r2(i.url_allowlist,n)||(null==i?void 0:i.url_ignorelist)&&r2(i.url_ignorelist,n))return!1;if(null==i?void 0:i.dom_event_allowlist){let e=i.dom_event_allowlist;if(e&&!e.some(e=>t.type===e))return!1}let{parentIsUsefulElement:a,targetElementList:l}=nf(e,s);if(!function(e,t){let i=null==t?void 0:t.element_allowlist;if(q(i))return!0;for(let t of e)if(i.some(e=>t.tagName.toLowerCase()===e))return!0;return!1}(l,i)||!r7(l,null==i?void 0:i.css_selector_allowlist)||r7(l,null!=(o=null==i?void 0:i.css_selector_ignorelist)?o:nt))return!1;try{let i=c.getComputedStyle(e);if(i&&"pointer"===i.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}let u=e.tagName.toLowerCase();switch(u){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return a?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(r8.indexOf(u)>-1||"true"===e.getAttribute("contenteditable"))}}(a,e,h,u,u?["copy","cut","paste"]:void 0,{config:{get_current_url:l.getCurrentUrl}})){let{props:i,explicitNoCapture:s,target:u}=function(e,{e:t,maskAllElementAttributes:i,maskAllText:s,elementAttributeIgnoreList:r,elementsChainAsString:n,disableCaptureUrlHashes:o}){var a,l,u,h;if(!rY(e))return{props:{}};let d=[e],p=new Set([e]),f=e;for(;f.parentNode&&!rX(f,"body")&&1e3>d.length;){if(r0(f.parentNode)){let e=f.parentNode.host;if(p.has(e))break;p.add(e),d.push(e),f=e;continue}if(!rY(f.parentNode)||p.has(f.parentNode))break;p.add(f.parentNode),d.push(f.parentNode),f=f.parentNode}let g="click"===t.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?d.findIndex(e=>rX(e,"button")||rX(e,"a")):-1;g>0&&(s=s||d.slice(0,g+1).some(e=>!ng(e)||nv(e)));let v=[],_={},m,y=!1,b=!1;if(rp(d,e=>{let t=ng(e);if(rX(e,"a")&&!i&&!(null==r?void 0:r.includes("href"))){let i=e.getAttribute("href");y=!!(t&&i&&nk(i))&&(o?td(i):i)}O(r3(e),"ph-no-capture")&&(b=!0),v.push(function(e,t,i,s,r=!1){let n=e.tagName.toLowerCase(),o={tag_name:n};r8.indexOf(n)>-1&&!i&&(o.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?lo(1024,n$(e)):lo(1024,r4(e)));let a=r3(e);t||(null==s?void 0:s.includes("class"))||0>=a.length||(o.classes=a.filter(function(e){return""!==e})),rp(e.attributes,function(i){var n;if((!nv(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&!(null==s?void 0:s.includes(i.name))&&!t&&nk(i.value)&&(!H(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){let e=i.value;"class"===i.name&&(e=r1(e).join(" ")),o["attr__"+i.name]=lo(1024,"href"===i.name&&r?td(e):e)}});let l=1,u=1,h=e;for(;h=function(e){if(e.previousElementSibling)return e.previousElementSibling;let t=e;do t=t.previousSibling;while(t&&!rY(t));return t}(h);)l++,h.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}(e,i,s,r,o)),rp(function(e){if(!ng(e))return{};let t={};return rp(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){let i=e.name.replace("data-ph-capture-attribute-",""),s=e.value;i&&s&&nk(s)&&(t[i]=s)}}),t}(e),(e,t)=>{({}).hasOwnProperty.call(_,t)||(_[t]=e)})}),b)return{props:{},explicitNoCapture:b};if(g>0&&(e=d[g],v.splice(0,g)),s||(v[0].$el_text=rX(e,"a")||rX(e,"button")?n$(e):r4(e)),y){v[0].attr__href=y;let e=null==(u=nV(y))?void 0:u.host,t=null==c||null==(h=c.location)?void 0:h.host;e&&t&&e!==t&&(m=y)}return{props:rf({$event_type:t.type,$ce_version:1},n?{}:{$elements:v},{$elements_chain:L(v)?v.map(e=>{var t,i;let s={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:function(e){let t=e.attr__class;if(t)return L(t)?t:r1(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return rg(e).filter(([e])=>0===e.indexOf("attr__")).forEach(([e,t])=>s.attributes[e]=t),s}).map(e=>{var t,i;let s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(let t of(e.attr_class.sort(),e.attr_class))s+=`.${t.replace(/"/g,"")}`;let r=ty(ty(ty(ty({},e.text?{text:e.text}:{}),{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),n={};return rg(r).sort(([e],[t])=>t>e?-1:+(e>t)).forEach(([e,t])=>n[nE(e.toString())]=nE(t.toString())),s+=":",s+=rg(n).map(([e,t])=>`${e}="${t}"`).join("")}).join(";"):""},(null==(a=v[0])?void 0:a.$el_text)?{$el_text:null==(l=v[0])?void 0:l.$el_text}:{},m&&"click"===t.type?{$external_click_url:m}:{},_),target:e}}(a,{e:e,maskAllElementAttributes:l.maskAllElementAttributes,maskAllText:l.maskAllText,elementAttributeIgnoreList:l.element_attribute_ignorelist,elementsChainAsString:this.To,disableCaptureUrlHashes:l.disableCaptureUrlHashes});if(s)return!1;let h=this.getElementSelectors(a,u);if(h&&h.length>0&&(i.$element_selectors=h),t===lr){let t=e.type||"clipboard";if("paste"!==t){let e=null==c||null==(n=c.getSelection())?void 0:n.toString(),t=r5(e);if(!t)return!1;i.$selected_content=t,i.$clipboard_text_length=null!=(o=null==e?void 0:e.length)?o:0}i.$copy_type=t}return null==(r=this._o)||r.capture(t,i),!0}}isBrowserSupported(){return D(null==f?void 0:f.querySelectorAll)}},ll=class{constructor(e){this._instance=e}refresh(e){let t=this._instance.config,i=N(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance.nl(),e.url_allowlist=null==i?void 0:i.url_allowlist,e.url_ignorelist=null==i?void 0:i.url_ignorelist,e.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,e.element_allowlist=null==i?void 0:i.element_allowlist,e.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,e.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,e.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,e.capture_copied_text=null==i?void 0:i.capture_copied_text}};let lu=i8("[ExceptionAutocapture]"),lh=()=>{},lc=e=>{var t;if(D(e))return null!=(t=e.__posthog_layer__)?t:e.__rrweb_layer__};function ld(e,t,i){try{if(!(t in e))return lh;let s={next:e[t]},r=i(function(...e){return s.next.apply(this,e)});return D(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),e[t]=r,()=>{if(e[t]===r)return void(e[t]=s.next);let i=e[t],n=lc(i);for(;n;){if(n.next===r)return void(n.next=s.next);i=n.next,n=lc(i)}}}catch(e){return lh}}let lp=i8("[TracingHeaders]"),lf=i8("[Web Vitals]"),lg=["CLS","FCP","INP","LCP"],lv=["INP","LCP"],l_=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],lm="disabled",ly="lazy_loading",lb=i8("[SessionRecording]"),lw=[s5,s4,s6,s8,s9,s7,re,rt,ri],lx=i8("[Heatmaps]");function lk(e){return N(e)&&"clientX"in e&&"clientY"in e&&V(e.clientX)&&V(e.clientY)}let l$=i8("[Product Tours]"),lE=e=>{var t;return!e.config.disable_product_tours&&!!(null==(t=e.persistence)?void 0:t.get_property(sR))},lS=["$set_once","$set"],lP=i8("[SiteApps]"),lM="Error while initializing PostHog app with config id ",lO=(e,t)=>(null==e?void 0:e.then)?e.then(t):t(e),lI="SDK is not enabled or survey functionality is not yet loaded",lF="Disabled. Not loading surveys.";var lC=class{constructor(e,t){this.ko=e,this.Tc=t,this.name=aU,this._surveyEventReceiver=null,this._surveyManager=null,this.Ic=!1,this.Mc=!1,this.Ec=[],this.Pc=[],this.Rc=null,this.Ac=null,this.Io=!1,this.Fc=new Set,this.onRemoteConfig=e=>{if(this.Io||this.Mr.disableSurveys)return;if(!e.ok)return this.Mc=!0,this.Oc({isLoaded:!1,error:"Remote config unavailable. Not loading surveys."}),aT.warn("Remote config unavailable. Not loading surveys.");let t=e.config.surveys;if(U(t))return aT.warn("Flags not loaded yet. Not loading surveys.");this.Dc=G(t)?t:t.length>0,aT.info(`flags response received, isSurveysEnabled: ${this.Dc}`),this.loadIfEnabled()},this.Oc=e=>{this.Pc.slice().forEach(t=>this.Lc(t,e))}}setup(e){if(!this.Io)return this.Nc=e,lO(e.kv.initialize(),()=>{if(this.Nc!==e||this.Io)return;this.Nc=void 0,this._o=e;let t=e.onRemoteConfig(this.onRemoteConfig);this.Io?t.dispose():(this.Po=t,this.loadIfEnabled())})}dispose(){var e,t,i,s,r;this.Io||(this.Io=!0,this.Nc=void 0,this._o=void 0,null==(e=this.Po)||e.dispose(),this.Po=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==(s=i.dispose)||s.call(i),this._surveyManager=null,this.Ec=[],this.Pc.forEach(e=>{e.active=!1}),this.Pc=[],null==(r=this.qc)||r.call(this),this.qc=void 0,this.Rc=null,this.Fc.forEach(e=>clearTimeout(e)),this.Fc.clear())}get Mr(){return this.ko.get()}initialize(){this.loadIfEnabled()}reset(){var e,t,i;null==(e=this._surveyManager)||null==(t=e.clearInMemoryInProgressSurveyState)||t.call(e);try{null==(i=this._surveyEventReceiver)||i.reset(),localStorage.removeItem("lastSeenSurveyDate");let e=[];for(let t=0;t<localStorage.length;t++){let i=localStorage.key(t);((null==i?void 0:i.startsWith("seenSurvey_"))||(null==i?void 0:i.startsWith("inProgressSurvey_")))&&e.push(i)}e.forEach(e=>localStorage.removeItem(e))}catch(e){}this.Oc()}loadIfEnabled(){if(this.Io||!this._o)return;let e=this.Mr;if(this._surveyManager)return;if(this.Ic)return void aT.info("Already initializing surveys, skipping...");if(e.disableSurveys)return void aT.info(lF);if(e.cookielessMode&&this.ko.isOptedOut())return void aT.info("Not loading surveys in cookieless mode without consent.");let t=this.ko.getExtensions();if(!t)return void this.jc("PostHog Extensions not found.");if(q(this.Dc)&&!e.advancedEnableSurveys)return;let i=this.Dc||e.advancedEnableSurveys;this.Ic=!0,this.Mc=!1;try{let e=t.generateSurveys;if(e)return this.Bc(e,i),void(this.Ic=!1);let s=t.loadExternalDependency;if(!s)return this.jc(rs),void(this.Ic=!1);s(e=>{try{if(this.Io)return;let t=this.ko.getExtensions();!e&&(null==t?void 0:t.generateSurveys)?this.Bc(t.generateSurveys,i):this.jc("Could not load surveys script",e)}finally{this.Ic=!1}})}catch(e){throw this.Ic=!1,this.jc("Error initializing surveys",e),e}}Bc(e,t){var i,s;if(this.Io)return;this._surveyManager=e(t),this._surveyEventReceiver=this.ko.createEventReceiver(this.Oc);let r=null==(i=null!=(s=this._o)?s:this.Tc)?void 0:i.kv.get(sB);r&&this.zc(r),aT.info("Surveys loaded successfully"),this.Hc(),this.Oc(),this.Uc({isLoaded:!0})}jc(e,t){this.Mc=!0,aT.error(e,t),this.Oc({isLoaded:!1,error:e}),this.Uc({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Ec.push(e),this._surveyManager&&this.Uc({isLoaded:!0}),()=>{this.Ec=this.Ec.filter(t=>t!==e)}}getSurveys(e,t=!1){var i;let s=null!=(i=this._o)?i:this.Tc;if(!s||this.Io)return;if(this.Mr.disableSurveys)return aT.info(lF),e([]);let r=s.kv.get(sB);if(r&&!t)return e(r,{isLoaded:!0}),void(this.Wc()&&this.getSurveys(()=>{},!0));if(this.Rc)return void this.Rc.then(({surveys:t,context:i})=>{this.Io||e(t,i)}).catch(e=>aT.error("Error in survey callback",e));let n=this.Vc("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.Mr.requestTimeoutMs}).then(e=>{try{return this.Gc(s,e)}catch(e){return aT.error("Error processing surveys response",e),this.Gc(s,{statusCode:0,error:e})}},e=>this.Gc(s,{statusCode:0,error:e}));this.Rc=n;let o=()=>{this.Rc===n&&(this.Rc=null)};n.then(t=>{o(),this.Io||(this.Oc(t.context),e(t.surveys,t.context))},o).catch(e=>aT.error("Error in survey callback",e))}Vc(e,t){let i=this._o;return i?i.sendRequest(e,t):new Promise(e=>e({statusCode:0,error:Error(lI)}))}Gc(e,t){if(this.Io)return{surveys:[],context:{isLoaded:!1,error:lI}};let i=t.statusCode;if(200!==i||!t.json){let e=`Surveys API could not be loaded, status: ${i}`;return 0!==i?aT.error(e):t.error||aT.warn(e),this.Ac=Date.now(),{surveys:[],context:{isLoaded:!1,error:e}}}this.Ac=null;let s=t.json.surveys||[];return e.kv.set({[sB]:s,[sz]:Date.now()}),this.zc(s),{surveys:s,context:{isLoaded:!0}}}zc(e){var t;let i=e.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(ak(e)||!!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length))});null==(t=this._surveyEventReceiver)||t.replace(i)}Wc(){return this.Qc()&&!this.Rc&&!this.Zc()}Qc(){var e,t;let i=null==(e=null!=(t=this._o)?t:this.Tc)?void 0:e.kv.get(sz);return V(i)&&Date.now()-i>3e5}Zc(){return V(this.Ac)&&3e5>Date.now()-this.Ac}markSurveyAsSeen(e,t){var i;aR({id:e,current_iteration:null!=(i=null==t?void 0:t.iteration)?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}this.Oc()}Uc(e){for(let t of this.Ec)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){aT.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t=!1){if(!U(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);aT.warn("init was not called")}onActiveMatchingSurveysChanged(e){var t,i;if(this.Io)return()=>{};let s={callback:e,active:!0,revision:0};this.Pc.push(s),this.Hc();let r=null==(t=null!=(i=this._o)?i:this.Tc)?void 0:t.kv.get(sB);return!this.Mr.disableSurveys&&(this._surveyManager||!this.Mc||this.Ic)&&(r||U(this.Ac)||this.Rc)?this._surveyManager&&this.Lc(s):this.Lc(s,{isLoaded:!1}),()=>{var e;s.active=!1,this.Pc=this.Pc.filter(e=>e!==s),0===this.Pc.length&&(null==(e=this.qc)||e.call(this),this.qc=void 0)}}Hc(){var e,t;this._surveyManager&&this.Pc.length>0&&(null!=this.qc||(this.qc=null==(e=(t=this.ko).onMatchingConditionsChanged)?void 0:e.call(t,this.Oc)))}Lc(e,t){if(this.Io||!e.active)return;let i=++e.revision,s=s=>{if(!this.Io&&e.active&&i===e.revision)try{let i=null!=t?t:{isLoaded:!0},r=JSON.stringify([s,i]);if(r===e.lastResult)return;e.lastResult=r,e.callback(s,i)}catch(e){aT.error("Error in active matching surveys callback",e)}};try{t&&!t.isLoaded?s([]):this.getActiveMatchingSurveys(s)}catch(e){aT.error("Error in active matching surveys callback",e)}}Jc(e){let t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}Kc(e){if(U(this._surveyManager))return{eligible:!1,reason:lI};let t="string"==typeof e?this.Jc(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Xc(e){if(!this.ko.isCapturing())return{eligible:!1,reason:"PostHog is not capturing, so a survey response cannot be recorded"};if(U(this._surveyManager))return{eligible:!1,reason:lI};let t="string"==typeof e?this.Jc(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(U(this._surveyManager))return aT.warn("init was not called"),{visible:!1,disabledReason:lI};let t=this.Xc(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return U(this._surveyManager)?(aT.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:lI})):new Promise(i=>{this.getSurveys(t=>{var s;let r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){let e=this.Xc(r);i({visible:e.eligible,disabledReason:e.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(!this.ko.isCapturing())return;if(U(this._surveyManager))return void aT.warn("init was not called");let r="string"==typeof e?this.Jc(e):e;if(!(null==r?void 0:r.id))return void aT.warn("Survey not found");if(!aL.includes(r.type))return void aT.warn(`Surveys of type ${r.type} cannot be rendered in the app`);let n=null==f?void 0:f.querySelector(t);if(n){if(null==(s=r.appearance)?void 0:s.surveyPopupDelaySeconds){aT.info(`Rendering survey ${r.id} with delay of ${r.appearance.surveyPopupDelaySeconds} seconds`);let e=setTimeout(()=>{var t,s;this.Fc.delete(e),!this.Io&&this.ko.isCapturing()&&(aT.info(`Rendering survey ${r.id} with delay of ${null==(t=r.appearance)?void 0:t.surveyPopupDelaySeconds} seconds`),null==(s=this._surveyManager)||s.renderSurvey(r,n,i),aT.info(`Survey ${r.id} rendered`))},1e3*r.appearance.surveyPopupDelaySeconds);return void this.Fc.add(e)}this._surveyManager.renderSurvey(r,n,i)}else aT.warn("Survey element not found")}displaySurvey(e,t){var i;if(!this.ko.isCapturing())return;if(U(this._surveyManager))return void aT.warn("init was not called");let s=this.Jc(e);if(!s)return void aT.warn("Survey not found");let r=s;if((null==(i=s.appearance)?void 0:i.surveyPopupDelaySeconds)&&t.ignoreDelay&&(r=ty(ty({},s),{},{appearance:ty(ty({},s.appearance),{},{surveyPopupDelaySeconds:0})})),t.displayType!==og.Popover&&t.initialResponses&&aT.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){let e=this.Kc(s);if(!e.eligible)return void aT.warn("Survey is not eligible to be displayed: ",e.reason)}t.displayType!==og.Inline?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}cancelPendingSurvey(e){U(this._surveyManager)?aT.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e,t;null==(e=this._surveyManager)||null==(t=e.handlePageUnload)||t.call(e)}};function lA(e,t,i){if(U(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}var lT=class{constructor(e){this._instance=e,this.Yc=new Set,this.th=new Set,this.eh=new am,this.ih=(e,t)=>this.nh(e,t)&&this.sh(e,t)&&this.rh(e,t)&&this.oh(e,t),this.nh=(e,t)=>!(null==t?void 0:t.event)||(null==e?void 0:e.event)===(null==t?void 0:t.event)}init(){var e,t;q(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.ah=null==(t=this._instance)?void 0:t._addCaptureHook((e,t)=>{this.on(e,t)}))}dispose(){var e,t;null==(e=this.ah)||e.call(this),this.ah=void 0,null==(t=this._instance)||null==(t=t.autocapture)||t.setElementSelectors(new Set,this),this.eh=new am}register(e){var t,i;if(!q(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t;this.Yc.add(e),null==(t=e.steps)||t.forEach(e=>{this.th.add((null==e?void 0:e.event)||"")})}),null==(i=this._instance)?void 0:i.autocapture)){let e=new Set;this.Yc.forEach(t=>{var i;null==(i=t.steps)||i.forEach(t=>{(null==t?void 0:t.selector)&&e.add(t.selector)})}),this._instance.autocapture.setElementSelectors(e,this)}}replace(e){this.Yc.clear(),this.th.clear(),this.register(e)}on(e,t){null!=t&&0!=e.length&&(this.th.has(e)||this.th.has(t.event))&&this.Yc.forEach(e=>{this.uh(t,e)&&this.eh.emit("actionCaptured",e.name)})}hh(e){this.onAction("actionCaptured",t=>e(t))}uh(e,t){if(null==(null==t?void 0:t.steps))return!1;for(let i of t.steps)if(this.ih(e,i))return!0;return!1}onAction(e,t){return this.eh.on(e,t)}sh(e,t){if(null==t?void 0:t.url){var i;let s=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!s||"string"!=typeof s||!lA(s,t.url,t.url_matching||"contains"))return!1}return!0}rh(e,t){return!!this.dh(e,t)&&!!this.fh(e,t)&&!!this.ph(e,t)}dh(e,t){var i;if(!(null==t?void 0:t.href))return!0;let s=this.gh(e);if(s.length>0)return s.some(e=>lA(e.href,t.href,t.href_matching||"exact"));let r=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";return!!r&&lA(function(e){let t=e.match(/(?::|")href="(.*?)"/);return t?t[1]:""}(r),t.href,t.href_matching||"exact")}fh(e,t){var i,s,r,n;if(!(null==t?void 0:t.text))return!0;let o=this.gh(e);if(o.length>0)return o.some(e=>lA(e.text,t.text,t.text_matching||"exact")||lA(e.$el_text,t.text,t.text_matching||"exact"));let a=(null==e||null==(n=e.properties)?void 0:n.$elements_chain)||"";return!!a&&(i=function(e){let t,i=[],s=/(?::|")text="(.*?)"/g;for(;!U(t=s.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(a),s=t.text,r=t.text_matching||"exact",i.some(e=>lA(e,s,r)))}ph(e,t){var i,s;if(!(null==t?void 0:t.selector))return!0;let r=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null==r?void 0:r.includes(t.selector))return!0;let n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}gh(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}oh(e,t){return!(null==t?void 0:t.properties)||0===t.properties.length||aP(t.properties.reduce((e,t)=>{let i=L(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}},lR=class{constructor(e,t){var i,s;this.mh=[],this._instance=e,this.yh=t,this.bh=new Map,this._h=new Map,this.wh=new Map,this.kh=null==(i=this._instance)||null==(s=i.onSessionId)?void 0:s.call(i,e=>this.Sh(e))}xh(e){return!1}$h(){return null}Ch(e){}Th(){}Ih(e,t){return!!e&&aP(e.propertyFilters,null==t?void 0:t.properties)}Mh(e,t){let i=new Map;return e.forEach(e=>{var s;null==(s=e.conditions)||null==(s=s[t])||null==(s=s.values)||s.forEach(t=>{if(null==t?void 0:t.name){let s=i.get(t.name)||[];s.push(e.id),i.set(t.name,s)}})}),i}Eh(e,t,i){let s=(i===oc.Activation?this.bh:this._h).get(e),r=[];return this.Ph(e=>{r=e.filter(e=>null==s?void 0:s.includes(e.id))}),r.filter(s=>{var r;let n=null==(r=s.conditions)||null==(r=r[i])||null==(r=r.values)?void 0:r.find(t=>t.name===e);return this.Ih(n,t)})}register(e){this.Rh(e,!1)}replace(e){this.Rh(e,!0)}Rh(e,t){var i;q(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Ah(e,t),this.Fh(e,t))}Fh(e,t){var i;let s=e.filter(e=>{var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length});if(t&&this.wh.clear(),0===s.length)return void(t&&(null==(i=this.Oh)||i.replace([])));this.Oh||(this.Oh=new lT(this._instance),this.Oh.init(),this.Oh.hh(e=>this.onAction(e)));let r=[];s.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(t=>{if(r.push(t),t.name){var i;let s=null!=(i=this.wh.get(t.name))?i:[];s.includes(e.id)||s.push(e.id),this.wh.set(t.name,s)}})}),t?this.Oh.replace(r):this.Oh.register(r)}Dh(e,t){t.forEach((t,i)=>{var s;let r=null!=(s=e.get(i))?s:[];t.forEach(e=>{r.includes(e)||r.push(e)}),e.set(i,r)})}Ah(e,t){var i;let s=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),r=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0}),n=this.Mh(e,oc.Activation),o=this.Mh(e,oc.Cancellation);t?(this.bh=n,this._h=o):(this.Dh(this.bh,n),this.Dh(this._h,o)),(0!==s.length||0!==r.length||e.some(e=>{var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length}))&&(null!=this.ah||(this.ah=null==(i=this._instance)?void 0:i._addCaptureHook((e,t)=>{this.onEvent(e,t)})))}onEvent(e,t){var i,s;let r=this.Lh(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(s=t.properties)?void 0:s.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){let i=this.Nh(e,n,t);if("consume"===i)return r.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.qh([n]);if("persist"===i)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.jh(n),void this.Bh([n])}if(this._h.has(e)){let i=this.Eh(e,t,oc.Cancellation);i.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:i.map(e=>e.id)}),this.qh(i.map(e=>e.id)),i.forEach(e=>this.zh(e.id)))}if(!this.bh.has(e))return;r.info("event name matched",{event:e,eventPayload:t,items:this.bh.get(e)});let o=this.Eh(e,t,oc.Activation);this.Hh(o.map(e=>e.id))}onAction(e){this.wh.has(e)&&this.Hh(this.wh.get(e)||[])}Hh(e){var t,i;if(0===e.length)return;let s=!!(null==(t=this._instance)||null==(i=t.get_session_id)?void 0:i.call(t)),r=[];for(let t of e)s&&this.xh(t)?this.jh(t)&&this.Uh(t):r.push(t);r.length>0&&(this.mh=[...new Set([...this.mh,...r])]),this.Lh().info("updating activated items",{activatedItems:this.getActivatedIds()}),this.Wh()}jh(e){this.mh=this.mh.filter(t=>t!==e);let t=this.Vh();return!t.includes(e)&&(this.Gh([...t,e]),this.Qh(),!0)}qh(e){let t=new Set(e);this.mh=this.mh.filter(e=>!t.has(e));let i=this.Zh(),s=i.filter(e=>!t.has(e));s.length!==i.length&&(this.Gh(s),0===s.length&&this.Jh()),this.Bh(e),this.Wh()}Wh(){try{var e;null==(e=this.yh)||e.call(this)}catch(e){this.Lh().error("Error while handling activated items change",e)}}Kh(){var e;let t=this.$h();if(!t)return{};let i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}Uh(e){if(!this.$h())return;let t=this.Kh();this.Ch(ty(ty({},t),{},{[e]:Date.now()}))}Bh(e){if(!this.$h())return;let t=this.Kh(),i={},s=!1;for(let[r,n]of Object.entries(t))e.includes(r)?s=!0:i[r]=n;s&&(j(i)?this.Th():this.Ch(i))}Xh(){this.$h()&&this.Th()}getActivationTimestamp(e){if(!this.Vh().includes(e))return;let t=this.Kh()[e];return V(t)?t:void 0}Zh(){var e;let t=this.Yh();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}Vh(){var e,t,i;let s=this.Zh();if(0===s.length)return[];let r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.td()],n=null==(t=this._instance)||null==(i=t.get_session_id)?void 0:i.call(t);return n&&r===n?s:[]}Qh(){var e,t;let i=null==(e=this._instance)||null==(t=e.get_session_id)?void 0:t.call(e);i&&this.ed(i)}Jh(){this.nd()}Sh(e){var t;let i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.td()];if(i&&i!==e){let e=this.Zh(),t=this.Kh();e.length>0&&(this.Gh([]),e.filter(e=>V(t[e])).forEach(e=>this.zh(e))),this.Jh(),this.Xh(),e.length>0&&this.Wh()}}getActivatedIds(){return[...new Set([...this.Vh(),...this.mh])].filter(e=>!this.sd(e))}dispose(){var e,t,i;null==(e=this.kh)||e.call(this),this.kh=void 0,null==(t=this.ah)||t.call(this),this.ah=void 0,null==(i=this.Oh)||i.dispose(),this.Oh=void 0}reset(){this.mh=[],this.Zh().length>0&&this.Gh([]),this.Jh(),this.Xh(),this.Wh()}getEventToItemsMap(){return this.bh}rd(){return this.Oh}},lL=class extends lR{constructor(e,t){super(e,t)}Yh(){return sU}td(){return sV}$h(){return sW}Ch(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({$surveys_activated_timestamps:e})}Th(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister("$surveys_activated_timestamps")}xh(e){var t;let i;this.Ph(t=>{i=t.find(t=>t.id===e)});let s=null==i||null==(t=i.appearance)?void 0:t.surveyPopupDelaySeconds;return V(s)&&s>0}od(){return op.SHOWN}Ph(e){var t;null==(t=this._instance)||t.getSurveys(e)}zh(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Lh(){return aT}Gh(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({$surveys_activated:e})}ed(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({$surveys_activated_session:e})}nd(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister("$surveys_activated_session")}sd(){return!1}Nh(e,t,i){var s,r,n;let o;return e===op.SENT&&!1===(null==i||null==(s=i.properties)?void 0:s.$survey_completed)?"ignore":(this.Ph(e=>{o=e.find(e=>e.id===t)}),!o||ak(r=o)&&(null==(n=r.conditions)||null==(n=n.events)?void 0:n.repeatedActivation)||"always"===r.schedule?e===op.SHOWN?"consume":"ignore":e===op.SHOWN?"persist":e===op.DISMISSED||e===op.SENT?"consume":"ignore")}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},lD=class{constructor(e){this._instance=e}initialize(){}get(e){if("string"==typeof e)return this._instance.get_property(e);let t={};for(let i of e){let e=this._instance.get_property(i);q(e)||(t[i]=e)}return t}set(e,t){this._instance.register("string"==typeof e?{[e]:t}:e)}remove(e){"string"!=typeof e?e.forEach(e=>this._instance.unregister(e)):this._instance.unregister(e)}},lN=class{constructor(e){this._instance=e}get(){let e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}isCapturing(){return this._instance.is_capturing()}getExtensions(){let e=null==x?void 0:x.__PosthogExtensions__;if(!e)return;let{generateSurveys:t,loadExternalDependency:i}=e;return{generateSurveys:t?e=>t(this._instance,e):void 0,loadExternalDependency:i?e=>i(this._instance,"surveys",e):void 0}}createEventReceiver(e){return new lL(this._instance,e)}onMatchingConditionsChanged(e){let t=this._instance._addCaptureHook(t=>{"$pageview"!==t&&t!==op.SHOWN&&t!==op.DISMISSED&&t!==op.SENT||e()}),i=()=>e();rb(c,"PHSurveyShown",i);let s=!1,r=this._instance.onFeatureFlags(()=>{s&&e()});return s=!0,()=>{s=!1,t(),r(),null==c||c.removeEventListener("PHSurveyShown",i)}}};let lj=(null==c?void 0:c.location)?nJ(c.location.hash,"__posthog")||nJ(location.hash,"state"):null,lq="_postHogToolbarParams",lH=i8("[Toolbar]"),lB=i8("[FeatureFlags]"),lz=i8("[FeatureFlags]",{debugEnabled:!0}),lU="\" failed. Feature flags didn't load in time.",lV=[502,504],lW=["click","keydown","wheel","touchstart","pointerdown"],lG="connection_error",lJ=e=>{let t={};for(let i=0;e.length>i;i++)t[e[i]]=!0;return t},lK=e=>{let t={};for(let[i,s]of rg(e||{}))s&&(t[i]=s);return t};var lQ=class{constructor(e){this.name="featureFlags",this.ad=!1,this.featureFlagEventHandlers=[],this.A=lB,this.ld={},this.ud={},this.hd=[],this.dd=new Set,this.vd=new Set,this.fd=!1,this.pd=!1,this.gd=0,this.md=!1,this.yd=!1,this.bd=!1,this._d=!1,this.wd=0,this.kd=!1,this.rn=()=>{let e=this.Sd();this.wd=0,e&&this.reloadFeatureFlags()},this.xd=()=>{var e,t;let i=this.$d,s=null!=(e=this.Cd)?e:i;q(i)||q(s)||this.Mr.remoteRequestsDisabled||!this.Td||"hidden"===this.Td.visibilityState||Date.now()-(null!=(t=this.Id)?t:0)<s||(this.Cd=this.kd||!this.Mr.idleRefreshBackoff?i:Math.min(2*s,36e5),this.kd=!1,this.reloadFeatureFlags(),this.Md())},this.Ed=()=>{this.kd&&this.Cd===this.$d||this.Pd()},this.sn=()=>{var e;"visible"===(null==(e=this.Td)?void 0:e.visibilityState)&&this.Pd()},this.ko=e}get Rd(){}Ad(){this._o&&this.Fd()}setup(e){try{this.Od=typeof window>"u"?void 0:window,this.Td=typeof document>"u"?void 0:document}catch(e){this.Od=void 0,this.Td=void 0}return this.Nc=e,this.A=e.logger.createLogger("[FeatureFlags]"),lO(e.kv.initialize(),()=>{this.Nc===e&&(this.Nc=void 0,this._o=e,this.Dd(e))})}Dd(e){var t;if(this._o===e)return this.Od&&rb(this.Od,"online",this.rn),this.Fd(),this.Ld=e.registerDynamicEventProperties(()=>this.Nd()?this.ld:this.ud),this.qd=null==(t=this.Rd)?void 0:t.onCrossTabFeatureFlagChange(()=>{this.jd(),this.Bd(),this.zd()}),this.Bd(),this.initialize()}Pd(){this.kd=!0,this.Cd=this.$d,this.xd()}Fd(){var e;let t=this.Mr.refreshIntervalMs,i=!this.Mr.remoteRequestsDisabled&&this.Td&&!q(t)&&t>0?t:void 0;this.Mr.idleRefreshBackoff||(this.Cd=i),i!==this.$d&&(this.Hd(),q(i)||(this.$d=i,this.Cd=i,this.Md(),(null==(e=this.Td)?void 0:e.addEventListener)&&(rb(this.Td,sm,this.sn),rd(lW,e=>{rb(this.Td,e,this.Ed,{capture:!0})}))))}Md(){q(this.$d)||(q(this.Ud)||clearInterval(this.Ud),this.Id=Date.now(),this.Ud=setInterval(this.xd,this.$d))}Hd(){var e,t;q(this.Ud)||(clearInterval(this.Ud),this.Ud=void 0,null==(e=this.Td)||null==(t=e.removeEventListener)||t.call(e,"visibilitychange",this.sn),rd(lW,e=>{var t,i;null==(t=this.Td)||null==(i=t.removeEventListener)||i.call(t,e,this.Ed,{capture:!0})})),this.$d=void 0,this.Cd=void 0,this.kd=!1,this.Id=void 0}destroy(){this.Wd()}dispose(){this.Wd()}Wd(){var e,t,i;this.Hd(),this.gd++,this.yd=!1,this.Nc=void 0,this.Vd(this.dd,"cancelled"),this.Vd(this.vd,"cancelled"),this._o&&(this.Gd(),null==(e=this.Ld)||e.dispose(),this.Ld=void 0,null==(t=this.qd)||t.call(this),this.qd=void 0,this.hd=[],null==(i=this.Od)||i.removeEventListener("online",this.rn),this._o=void 0)}get Mr(){return this.ko.get()}Qd(e){var t;return this.Zd&&e in this.Zd?this.Zd[e]:null==(t=this._o)?void 0:t.kv.get(e)}jd(){return!!this.Zd&&(this.Zd=void 0,!0)}Jd(){var e;return!q(null==(e=this._o)?void 0:e.kv.get("$enabled_feature_flags"))&&this.jd()}$t(e){this.Kd(()=>{var t;return null==(t=this._o)?void 0:t.kv.set(e)})}Xd(e,t,i){if(!this.Rd||!e.$enabled_feature_flags)return;let s=this.Qd("$enabled_feature_flags")||{},r=e.$enabled_feature_flags||{},n=t.flags||t.featureFlags,o=t.flags?Object.entries(t.flags).filter(([,e])=>!(null==e?void 0:e.failed)).map(([e])=>e):[],a=!!t.errorsWhileComputingFlags&&!!t.flags,l=a?o:i&&!L(n)?Object.keys(n||{}):Array.from(new Set([...Object.keys(s),...Object.keys(r)])),u=this.Qd("$feature_flag_payloads")||{},h=e.$feature_flag_payloads||{},c=a||i?l:Array.from(new Set([...Object.keys(u),...Object.keys(h)])),d=!a&&!i,p=!!d||l,f={[sr]:p,[sh]:p,[sg]:!!d||c};for(let t of(e.$feature_flag_details&&(f[sn]=p),[sl,sa,su]))q(e[t])||(f[t]=!0);this.Rd.markCrossTabFeatureFlagChanges(f)}Pt(e){this.Kd(()=>{var t;return null==(t=this._o)?void 0:t.kv.remove(e)})}Kd(e){try{e()}catch(e){this.A.error("Failed to update feature flag persistence",e)}}Bd(){let e={};for(let t of[sr,sg,sl,sv]){let i=this.Qd(t);q(i)||(e[t]=i)}this.ld=e;let t=ty({},e),i=this.Qd(sh);if(i)for(let[e,s]of Object.entries(i))t[`$feature/${e}`]=s;this.ud=t}Nd(){let e=this.Mr.cacheTtlMs;if(!e||0>=e)return!1;let t=this.Qd(sa);return"number"!=typeof t||Date.now()-t>e}Yd(){return!!this.Nd()&&(this._d||this.pd||(this._d=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}tv(){let e=this.Mr.evaluationContexts;return(null==e?void 0:e.length)?e.filter(e=>{let t=e&&"string"==typeof e&&e.trim().length>0;return t||this.A.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}ev(){let e=this.Mr.flagKeys;if(!q(e))return e.filter(e=>{let t=e&&"string"==typeof e&&e.trim().length>0;return t||this.A.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t,i,s;let r=this.Mr,n=null!=(e=null==(t=r.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(n).length){let e=null!=(i=null==(s=r.bootstrap)?void 0:s.featureFlagPayloads)?i:{},t=Object.keys(n).filter(e=>!q(n[e])).reduce((e,t)=>(e[t]=n[t],e),{}),o=Object.keys(e).filter(e=>t[e]).reduce((t,i)=>(t[i]=e[i],t),{});return this.iv({featureFlags:t,featureFlagPayloads:o},void 0,{persist:!1})}}updateFlags(e,t,i){var s,r;let n=(null==i?void 0:i.merge)&&null!=(s=this.Qd("$enabled_feature_flags"))?s:{},o=(null==i?void 0:i.merge)&&null!=(r=this.Qd("$feature_flag_payloads"))?r:{},a=ty(ty({},n),e),l=ty(ty({},o),t),u={};for(let[e,t]of Object.entries(a))u[e]={key:e,enabled:t1(t),variant:t2(t),reason:void 0,metadata:q(null==l?void 0:l[e])?void 0:{id:0,version:void 0,description:void 0,payload:l[e]}};this.iv({flags:u})}get hasLoadedFlags(){return this.fd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){let e=this.Qd(sn),t=this.Qd(sv),i=this.Qd(s_);if(!i&&!t)return e||{};let s=rf({},e||{});for(let e of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var r,n;let o=s[e],a=null==t?void 0:t[e],l=q(a)?null!=(r=null==o?void 0:o.enabled)&&r:!!a,u=q(a)?null==o?void 0:o.variant:"string"==typeof a?a:void 0,h=null==i?void 0:i[e],c=ty(ty({},o),{},{enabled:l,variant:l?null!=u?u:null==o?void 0:o.variant:void 0});l!==(null==o?void 0:o.enabled)&&(c.original_enabled=null==o?void 0:o.enabled),u!==(null==o?void 0:o.variant)&&(c.original_variant=null==o?void 0:o.variant),h&&(c.metadata=ty(ty({},null==o?void 0:o.metadata),{},{payload:h,original_payload:null==o||null==(n=o.metadata)?void 0:n.payload})),s[e]=c}return this.ad||(this.A.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.ad=!0),s}getAllFeatureFlags(){let e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{let s=e[i];return{key:i,enabled:t1(s),variant:t2(s),payload:t0(t[i])}})}getFlagVariants(){let e=this.Qd(sh),t=this.Qd(sv);if(!t)return e||{};let i=rf({},e||{}),s=Object.keys(t);for(let e=0;s.length>e;e++)i[s[e]]=t[s[e]];return this.ad||(this.A.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ad=!0),i}getFlagPayloads(){let e=this.Qd(sg),t=this.Qd(s_);if(!t)return e||{};let i=rf({},e||{}),s=Object.keys(t);for(let e=0;s.length>e;e++)i[s[e]]=t[s[e]];return this.ad||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ad=!0),i}reloadFeatureFlags(){this.md||this.Mr.featureFlagsDisabled||this.Sd()||(this.pd&&(this.yd=!0),this.nv||(this.hd.slice().forEach(e=>{try{e()}catch(e){this.A.error("Error while running feature flags reloading callback",e)}}),this.nv=setTimeout(()=>{this.sv()},5)))}reloadFeatureFlagsAsync(){return!this._o||this.md||this.Mr.featureFlagsDisabled||this.Mr.remoteRequestsDisabled||this.Sd()?Promise.resolve({status:"skipped"}):new Promise(e=>{this.dd.add(e),this.reloadFeatureFlags()})}Vd(e,t){e.forEach(e=>e({status:t})),e.clear()}Gd(){clearTimeout(this.nv),this.nv=void 0}onReloading(e){return this.hd.push(e),()=>{this.hd=this.hd.filter(t=>t!==e)}}ensureFlagsLoaded(){this.fd||this.pd||this.nv||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.md=e}resetFlagCallReported(){this.Pt(sp)}sv(e){var t;this.Gd();let i=this._o;if(!i||this.Mr.remoteRequestsDisabled||this.Sd())return void this.Vd(this.dd,"skipped");if(this.pd)return void(this.yd=!0);let s={token:i.projectToken,distinct_id:i.distinctId,groups:i.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:ty(ty(ty({},i.initialPersonProperties),this.Qd("$stored_person_properties")||{}),{},{$lib:i.library.name,$lib_version:i.library.version}),group_properties:this.Qd(sc),timezone:nq()};q(i.deviceId)||(s.$device_id=i.deviceId),((null==e?void 0:e.disableFlags)||this.Mr.featureFlagsDisabled)&&(s.disable_flags=!0);let r=this.tv();r.length&&(s.evaluation_contexts=r);let n=this.ev();q(n)||(s.flag_keys=n);let o=this.Mr.onlyEvaluateSurveyFeatureFlags,a="/flags/?v=2"+(o?"&only_evaluate_survey_feature_flags=true":""),l=this.gd,u=this.dd;this.dd=new Set,this.vd=u,this.pd=!0;let h=()=>{this.yd&&(this.yd=!1,this.sv())},c=e=>{var t,i;let r=null!=(t=e.json)?t:{},n=200!==e.statusCode;if(this.pd=!1,l!==this.gd)return void h();if(this.rv(e.statusCode),n||this.yd||(this.$anon_distinct_id=void 0),s.disable_flags&&!this.yd)return void this.Vd(u,"skipped");this.bd=!n;let a=[];e.error?a.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?lG:"unknown_error"):200!==e.statusCode&&a.push(`api_error_${e.statusCode}`),r.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");let c=!!(null==(i=r.quotaLimited)?void 0:i.includes("feature_flags"));c&&a.push("quota_limited"),this.$t({[so]:a}),c?this.A.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):s.disable_flags||this.iv(r,n,{partialResponse:o}),this.Vd(u,s.disable_flags?"skipped":!a.length&&(r.flags||r.featureFlags)?"loaded":"error"),h()},d=e=>{this.pd=!1,l===this.gd&&(this.$t({[so]:[lG]}),this.A.error("Feature flag request failed",e),this.Jd()&&this.zd(!0),this.Vd(u,"error")),h()},p=null!=(t=this.Mr.requestMaxRetries)?t:1,f=()=>p>0&&l===this.gd,g=()=>{if(l!==this.gd||!this._o||this.Mr.remoteRequestsDisabled)return this.pd=!1,this.Vd(u,"skipped"),void h();try{i.sendRequest(a,{target:"flags",method:"POST",body:s,compression:this.Mr.compression,sentAt:"body",timeoutMs:this.Mr.requestTimeoutMs}).then(e=>{if((lV.includes(e.statusCode)||0===e.statusCode&&e.error instanceof Error&&"AbortError"===e.error.name)&&f())return p--,void setTimeout(g,500);c(e)}).catch(d)}catch(e){d(e)}};g()}Sd(){return nB(this.wd,3)}rv(e){this.wd=nz(e,this.wd,3,()=>this.A.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t={}){var i;if(t.fresh&&!this.bd)return;if(!(this.fd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlag for key "'+e+lU);if(this.Yd())return;let s=this.getFeatureFlagResult(e,t);return null!=(i=null==s?void 0:s.variant)?i:null==s?void 0:s.enabled}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){let t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t={}){var i,s,r,n,o,a,l,u,h,c,d,p,f,g;if(t.fresh&&!this.bd)return;if(!(this.fd||this.getFlags()&&this.getFlags().length>0))return void this.A.warn('getFeatureFlagResult for key "'+e+lU);if(this.Yd())return;let v=this.getFlagVariants(),_=e in v,m=v[e],y=this.getFlagPayloads()[e],b=String(m),w=this.Qd("$feature_flag_request_id")||void 0,x=this.Qd("$feature_flag_evaluated_at")||void 0,k,$=this.Qd("$flag_call_reported")||{};if(this.Mr.deduplicateCallsPerSession){let e=null==(i=this._o)||null==(i=i.session)?void 0:i.sessionId,t=this.Qd(sf);e&&e!==t&&($={},k=e)}if(!t.send_event&&"send_event"in t)k&&this.$t({[sp]:$,[sf]:k});else if(e in $&&$[e].includes(b))k&&this.$t({[sp]:$,[sf]:k});else{L($[e])?$[e].push(b):$[e]=[b],this.$t(ty({[sp]:$},k?{[sf]:k}:{}));let t=this.getFeatureFlagDetails(e),i=[...null!=(s=this.Qd("$feature_flag_errors"))?s:[]];q(m)&&i.push("flag_missing");let v={$feature_flag:e,$feature_flag_response:m,$feature_flag_payload:null!=y?y:null,$feature_flag_request_id:w,$feature_flag_evaluated_at:x,$feature_flag_bootstrapped_response:null!=(r=null==(n=this.Mr.bootstrap)||null==(n=n.featureFlags)?void 0:n[e])?r:null,$feature_flag_bootstrapped_payload:null!=(o=null==(a=this.Mr.bootstrap)||null==(a=a.featureFlagPayloads)?void 0:a[e])?o:null,$used_bootstrap_value:!this.bd};q(null==t||null==(l=t.metadata)?void 0:l.has_experiment)||(v.$feature_flag_has_experiment=t.metadata.has_experiment),q(null==t||null==(u=t.metadata)?void 0:u.version)||(v.$feature_flag_version=t.metadata.version);let _=null!=(h=null==t||null==(c=t.reason)?void 0:c.description)?h:null==t||null==(d=t.reason)?void 0:d.code;_&&(v.$feature_flag_reason=_),(null==t||null==(p=t.metadata)?void 0:p.id)&&(v.$feature_flag_id=t.metadata.id),q(null==t?void 0:t.original_variant)&&q(null==t?void 0:t.original_enabled)||(v.$feature_flag_original_response=q(t.original_variant)?t.original_enabled:t.original_variant),(null==t||null==(f=t.metadata)?void 0:f.original_payload)&&(v.$feature_flag_original_payload=null==t||null==(g=t.metadata)?void 0:g.original_payload),i.length&&(v.$feature_flag_error=i.join(",")),this.ov(v)}return _?{key:e,enabled:!!m,variant:"string"==typeof m?m:void 0,payload:t0(y)}:void 0}ov(e){try{var t;null==(t=this._o)||t.capture("$feature_flag_called",e)}catch(e){this.A.error("Failed to capture feature flag call",e)}}getRemoteConfigPayload(e,t){this.av(e,t)}av(e,t){var i=this;return en(function*(){let s,r=i._o;if(!r)return;let n={distinct_id:r.distinctId,token:r.projectToken,person_properties:{$lib:r.library.name,$lib_version:r.library.version}},o=i.tv();o.length&&(n.evaluation_contexts=o);let a=i.ev();q(a)||(n.flag_keys=a);try{var l;let t=null==(l=(yield r.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.Mr.compression,sentAt:"body",timeoutMs:i.Mr.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;s=(null==t?void 0:t[e])||void 0}catch(e){return void i.A.error("Remote config feature flag request failed",e)}try{t(s)}catch(e){i.A.error("Remote config feature flag callback failed",e)}})()}isFeatureEnabled(e,t={}){if(t.fresh&&!this.bd)return t.defaultValue;if(!(this.fd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+e+lU),t.defaultValue;let i=this.getFeatureFlag(e,t);return q(i)?t.defaultValue:!!i}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){this.iv(e,t,i)}iv(e,t,i){if(!this._o)return;this.fd=!0;let s=((e,t={},i={},s={},r,n=lB)=>{let o=((e,t)=>{let i=e.flags;if(i){let t=Object.fromEntries(Object.keys(i).map(e=>{var t;return[e,null!=(t=i[e].variant)?t:i[e].enabled]})),s=Object.fromEntries(Object.keys(i).filter(e=>i[e].enabled).filter(e=>{var t;return!q(null==(t=i[e].metadata)?void 0:t.payload)}).map(e=>{var t;return[e,null==(t=i[e].metadata)?void 0:t.payload]}));return ty(ty({},e),{},{featureFlags:t,featureFlagPayloads:s})}return e.featureFlags&&t.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e,n),a=o.flags,l=o.featureFlags,u=o.featureFlagPayloads;if(!l)return;let h=e.requestId,c=e.evaluatedAt;if(L(l)){n.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");let e={};if(l)for(let t=0;l.length>t;t++)e[l[t]]=!0;return{[sr]:l,[sh]:e,[su]:!1}}let d=l,p=u,f=a;if(null==r?void 0:r.partialResponse){let e=Object.keys(d),r=p||{};d=ty(ty({},t),d),p=ty(ty({},i),r),e.forEach(e=>{e in r||null==p||delete p[e]}),f=ty(ty({},s),f)}else if(e.errorsWhileComputingFlags)if(a){let e=new Set(Object.keys(a).filter(e=>{var t;return!(null==(t=a[e])?void 0:t.failed)}));d=ty(ty({},t),Object.fromEntries(Object.entries(d).filter(([t])=>e.has(t))));let r=Object.fromEntries(Object.entries(p||{}).filter(([t])=>e.has(t)));p=ty(ty({},i),r),e.forEach(e=>{e in r||null==p||delete p[e]}),f=ty(ty({},s),Object.fromEntries(Object.entries(f||{}).filter(([t])=>e.has(t))))}else d=ty(ty({},t),d),p=ty(ty({},i),p),f=ty(ty({},s),f);return ty(ty({[sr]:Object.keys(lK(d)),[sh]:d||{},[sg]:p||{},[sn]:f||{},[su]:!0===e.minimalFlagCalledEvents},h?{[sl]:h}:{}),c?{[sa]:c}:{})})(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(s)if(!1===(null==i?void 0:i.persist)){let e=!q(this._o.kv.get(sh));this.Zd=s,e||this.$t(s)}else this.jd(),this.Xd(s,e,!!(null==i?void 0:i.partialResponse)),this.$t(s);else t&&this.Jd();t||(this._d=!1),this.zd(t)}override(e,t=!1){this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.lv(e)}lv(e){if(this._o){if(!1===e)return this.Pt([sv,s_]),this.zd(),void lz.info("All overrides cleared");if(L(e))return this.$t({[sv]:lJ(e)}),this.zd(),void lz.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;this.ad=!!(null!=(t=e.suppressWarning)&&t);let i={},s=e.flags,r=e.payloads;return s&&(i[sv]=L(s)?lJ(s):s),r&&(i[s_]=r),Object.keys(i).length&&this.$t(i),!1===s&&!1===r?this.Pt([sv,s_]):!1===s?this.Pt(sv):!1===r&&this.Pt(s_),this.zd(),!1===s?lz.info("Flag overrides cleared"):s&&lz.info("Flag overrides set",{flags:s}),void(!1===r?lz.info("Payload overrides cleared"):r&&lz.info("Payload overrides set",{payloads:r}))}if(e&&"object"==typeof e)return this.$t({[sv]:e}),this.zd(),void lz.info("Flag overrides set",{flags:e});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.fd){let{flags:t,flagVariants:i}=this.uv();try{e(t,i)}catch(e){this.A.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r;let n=(this.Qd("$early_access_features")||[]).find(t=>t.flagKey===e),o={[`$feature_enrollment/${e}`]:t},a={$feature_flag:e,$feature_enrollment:t,$set:o};n&&(a.$early_access_feature_name=n.name),i&&(a.$feature_enrollment_stage=i);let l=ty(ty({},this.getFlagVariants()),{},{[e]:t});null==(s=this.Rd)||s.markCrossTabFeatureFlagChanges({$active_feature_flags:[e],$enabled_feature_flags:[e],$stored_person_properties:Object.keys(o)}),this.$t({[sr]:Object.keys(lK(l)),[sh]:l,[sd]:ty(ty({},this.Qd("$stored_person_properties")||{}),o)}),this.zd();try{null==(r=this._o)||r.capture("$feature_enrollment_update",a)}catch(e){this.A.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t=!1,i){let s=this.Qd(ss);!s||t?this.hv(e,i):e(s)}hv(e,t){var i=this;return en(function*(){let s,r=i._o;if(!r)return;let n=t?`&${t.map(e=>`stage=${e}`).join("&")}`:"";try{let e=yield r.sendRequest(`/api/early_access_features/?token=${r.projectToken}${n}`,{target:"api",method:"GET",sentAt:"query"});if(!e.json)return;s=e.json.earlyAccessFeatures,i.$t({[ss]:s})}catch(e){return void i.A.error("Early access feature request failed",e)}try{e(s)}catch(e){i.A.error("Early access feature callback failed",e)}})()}uv(){let e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}zd(e){this.Bd();let{flags:t,flagVariants:i}=this.uv();this.featureFlagEventHandlers.forEach(s=>{try{s(t,i,{errorsLoading:e})}catch(e){this.A.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t=!0){this.dv(e,t)}dv(e,t=!0){let i=this.Qd("$stored_person_properties")||{},s=(null==e?void 0:e.$set)||((null==e?void 0:e.$set_once)?{}:e),r=null==e?void 0:e.$set_once,n={};if(r)for(let e in r)({}).hasOwnProperty.call(r,e)&&(e in i||(n[e]=r[e]));this.$t({[sd]:ty(ty(ty({},i),n),s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t=!0){let i=ty({},this.Qd("$stored_person_properties")||{});e.forEach(e=>{delete i[e]}),this.$t({[sd]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e=!0){this.Pt(sd),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t=!0){let i=this.Qd("$stored_group_properties")||{},s=ty({},i);for(let t of Object.keys(e))s[t]=ty(ty({},i[t]),e[t]);this.$t({[sc]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){let t=this.Qd("$stored_group_properties")||{};this.$t({[sc]:ty(ty({},t),{},{[e]:{}})})}else this.Pt(sc)}reset(){this.gd++,this.Vd(this.dd,"cancelled"),this.Vd(this.vd,"cancelled"),this.yd=!1,this.ld={},this.ud={},this.Zd=void 0,this.fd=!1,this.md=!1,this.bd=!1,this.$anon_distinct_id=void 0,this.Gd(),this.ad=!1,this.wd=0}};let lY=i8("[FeatureFlags]");var lX=class{constructor(e,t=!1){this.vv=!1,this.update(e,t)}update(e,t){var i,s,r,n,o,a,l,u;this.fv={bootstrap:{featureFlags:null!=(i=null==(s=e.bootstrap)?void 0:s.featureFlags)?i:void 0,featureFlagPayloads:null!=(r=null==(n=e.bootstrap)?void 0:n.featureFlagPayloads)?r:void 0},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,refreshIntervalMs:null!=(o=e.remote_config_refresh_interval_ms)?o:3e5,idleRefreshBackoff:q(e.remote_config_refresh_interval_ms),requestTimeoutMs:e.feature_flag_request_timeout_ms,requestMaxRetries:Math.max(0,null!=(a=e.feature_flag_request_max_retries)?a:1),compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!=(l=null!=(u=e.evaluation_contexts)?u:e.evaluation_environments)?l:[],flagKeys:L(e.flag_keys)?e.flag_keys:void 0},!e.evaluation_environments||e.evaluation_contexts||this.vv||(lY.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.vv=!0),q(e.flag_keys)||L(e.flag_keys)||lY.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.fv}};let lZ=e=>X(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message),l0=i8("[Error tracking]"),l1="webkit-masked-url:",l2=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],l3=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",l1],l5=["__firefox__","__gCrWeb"],l4="Refusing to render web experiment since the viewer is a likely bot",l6={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>a$(t,e),not_regex:(e,t)=>!a$(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e},l8=i8("[Conversations]"),l9="Conversations not available yet.";function l7(e,t){var i,s,r,n,o,a,l;let u=null!=(i=null==e?void 0:e.flushIntervalMs)?i:3e3,h=null!=(s=null==e?void 0:e.maxBufferSize)?s:100,c=(null==t?void 0:t.consoleCapture)?void 0:null!=(r=null==e?void 0:e.maxLogsPerInterval)?r:1e3,d=q(c)?Math.max(h,2048):Math.max(h,c),p=ty(ty({},function(){let e="",t="";try{var i;let s="u">typeof globalThis?globalThis:"u">typeof window?window:void 0,r=null==s||null==(i=s.navigator)?void 0:i.userAgent;r&&([e,t]=e7(r))}catch(e){}var s=t;let r=function(e){if(e)return({}).hasOwnProperty.call(iU,e)?iU[e]:e}(e);return ty(ty({},r?{"os.name":r}:{}),s?{"os.version":s}:{})}()),null==e?void 0:e.resourceAttributes);return{serviceName:null!=(n=null!=(o=null==p?void 0:p["service.name"])?o:null==e?void 0:e.serviceName)?n:null==t?void 0:t.serviceNameDefault,serviceVersion:null!=(a=null==p?void 0:p["service.version"])?a:null==e?void 0:e.serviceVersion,environment:null!=(l=null==p?void 0:p["deployment.environment"])?l:null==e?void 0:e.environment,resourceAttributes:p,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:d,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}let ue=["debug","log","warn","error","info"],ut=e=>{for(;null==e?void 0:e.__rrweb_original__;)e=e.__rrweb_original__;return e},ui="console",us="__posthogHandledLogsRequestError",ur=(e,t)=>{let i=e instanceof Error?e:Error(t);return i[us]=!0,i},un=e=>!!e&&"object"==typeof e&&!0===e[us];var uo=class{get pv(){return ty(ty({},this.A),{},{error:(...e)=>{e.some(un)||this.A.error(...e)}})}constructor(e,t){var i;this.ko=e,this.gv=t,this.name="logs",this.mv=!1,this.yv=!1,this.bv=!1,this.A=i8("[logs]"),this.al=[],this._v=[],this.wd=0,this.wv=!1,this.Io=!1,this.Sv=[],this.xv=[],this.$v=!1,this.Cv=!1,this.Tv=!1,this.Iv=()=>{var e,t;this.Io||(this.wd=0,null==(e=this.Mv)||e.onReconnect(),null==(t=this.Ev)||t.onReconnect())},this.mv=!!(null==(i=e.get())?void 0:i.captureConsoleLogs)}get Pv(){return!0}Rv(){}Av(){if(!this.Tv){try{this.Od=typeof window>"u"?void 0:window}catch(e){this.Od=void 0}this.Od&&(rb(this.Od,"online",this.Iv),this.Tv=!0)}}Fv(e,t,i,s){this.Av();let r=l7(this.ko.get(),i);return[new iY(this.Ov(e,t),r,this.pv,()=>this.gv(),e=>e(),void 0,s),r]}Dv(){var e;let t=this.ko.get();return this.Mv&&this.Lv===t||(null==(e=this.Mv)||e.reset(),this.Lv=t,[this.Mv,this.Nv]=this.Fv(()=>this.al,e=>{this.al=e})),this.Mv}qv(){var e;let t=this.ko.get();return this.Ev&&this.jv===t||(null==(e=this.Ev)||e.reset(),this.jv=t,[this.Ev,this.Bv]=this.Fv(()=>this._v,e=>{this._v=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ui)),this.Ev}setup(e){if(!this.Io&&!this.wv)return this.wv=!0,this._o=e,this.A=e.logger.createLogger("[logs]"),lO(e.kv.initialize(),()=>{this.Io||this.Dd(e)})}Dd(e){var t;this.Av(),(null==(t=this.ko.get())?void 0:t.captureConsoleLogs)&&(this.mv=!0),(this.mv||this.ko.remoteConfigWillArrive&&e.kv.get(this.ko.captureHintKey))&&this.zv();let i=!1,s=e.onRemoteConfig(e=>{var t;i=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),this.onRemoteConfig(e)});this.Io?s.dispose():(this.Po=s,i||this.loadIfEnabled())}dispose(){var e,t,i,s,r,n,o;this.Io||(this.Io=!0,this.Hv(),null==(e=this.Po)||e.dispose(),this.Po=void 0,this._o=void 0,this.bv=!1,null==(t=this.Od)||t.removeEventListener("online",this.Iv),null==(i=this.Uv)||i.call(this),this.Uv=void 0,null==(s=this.Mv)||s.clearQueue(),null==(r=this.Ev)||r.clearQueue(),null==(n=this.Mv)||n.reset(),null==(o=this.Ev)||o.reset())}onRemoteConfig(e){var t,i;if(this.Io)return;let s=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;U(s)?this.Wv():(null==(i=this._o)||i.kv.set(this.ko.captureHintKey,!!s),s?(this.mv=!0,this.yv||this.zv(),this.loadIfEnabled()):this.Wv())}reset(){var e,t,i,s;this.Hv(),null==(e=this.Mv)||e.clearQueue(),this.al=[],null==(t=this.Mv)||t.reset(),null==(i=this.Ev)||i.clearQueue(),this._v=[],null==(s=this.Ev)||s.reset(),this.wd=0}captureLog(e){!this.Io&&this._o&&this.Dv().captureLog(e)}captureConsoleLog(e){!this.Io&&this._o&&this.qv().captureLog(e)}captureBufferedConsoleLog(e,t,i){!this.Io&&this._o&&this.qv().captureLog(e,{context:t,occurredAtMs:i})}Cc(){var e;this.Hv(),null==(e=this.Ev)||e.clearQueue(),this._v=[]}Wv(){this.mv||this.Hv()}zv(){var e;if(this.$v||!(null==(e=this.Od)?void 0:e.console))return;let t=l7(this.ko.get()).maxBufferSize,i=!0;for(let e of(this.xv.push(()=>{i=!1}),ue)){let s;try{s=ut(this.Od.console[e])}catch(e){continue}s&&this.xv.push(ld(this.Od.console,e,r=>{let n=(...s)=>{try{i&&this.Vv(e,s,t)}catch(e){}return r.apply(this.Od.console,s)};return n.__rrweb_original__=s,n}))}this.$v=!0,this.Gv=setTimeout(()=>{this.Hv()},3e4)}Vv(e,t,i){var s;if(this.$v&&!this.Cv&&0!==t.length)if(null==(s=this._o)?void 0:s.canCapture){if(i>this.Sv.length){this.Cv=!0;try{this.Sv.push({level:e,args:t,occurredAtMs:Date.now(),context:this.gv()})}finally{this.Cv=!1}}}else this.Hv()}Hv(){if(this.Sv=[],this.$v){for(let e of(this.$v=!1,this.Gv&&(clearTimeout(this.Gv),this.Gv=void 0),this.xv))e();this.xv=[]}}Qv(){let e=this.Sv;return this.Hv(),e}get logger(){return this.Zv||(this.Zv={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Zv}flushLogs(e){this._o&&(e?this.Jv(e):(this.Mv&&this.Mv.flush().catch(e=>this.Kv(e)),this.Ev&&this.Ev.flush().catch(e=>this.Kv(e))))}flush(){var e=this;return en(function*(){var t,i;let s=null==(t=e.Mv)?void 0:t.flush().catch(t=>e.Kv(t)),r=null==(i=e.Ev)?void 0:i.flush().catch(t=>e.Kv(t));yield s,yield r})()}Kv(e){un(e)||this.A.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.Io||!this.mv||this.yv||this.bv)return;let e=this.Rv();if(e){this.bv=!0;try{e((e,t)=>{if(this.bv=!1,!this.Io&&this.mv)if(e||!t)this.A.error("Could not load logs script",e),this.Hv();else{let e=this.Qv();this.Uv=t.initialize(this._o),this.yv=!0,e.length>0&&t.replay(this._o,e)}})}catch(e){throw this.bv=!1,e}}else this.Hv()}Ov(e,t){let i=this._o;return{get isDisabled(){return!1},get optedOut(){return!i.canCapture},getPersistedProperty:t=>t===E.LogsQueue?e():void 0,setPersistedProperty(e,i){e===E.LogsQueue&&t(null!=i?i:[])},js:e=>this.js(e),getLibraryId:()=>i.library.name,getLibraryVersion:()=>i.library.version}}js(e){return new Promise(t=>{if(nB(this.wd,3))return void t({kind:"fatal",error:ur(void 0,"logs endpoint is unreachable, dropping batch")});let i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:ur(void 0,"logs request timed out")})},9e4),n=this.Pv;this._o.sendRequest("/i/v1/logs",{method:"POST",query:{token:this._o.projectToken},body:e,compression:"best-available",timeoutMs:6e4}).then(e=>{var t;let i=e.statusCode;this.Xv(i,n),i>=200&&300>i?s({kind:"ok"}):413===i?s({kind:"too-large"}):0!==i&&408!==i&&429!==i&&500>i?s({kind:"fatal",error:Error(`logs request failed with status ${i}`)}):0===i?(e.error||this.A.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:ur(e.error,"logs request failed before receiving an HTTP response")})):s({kind:"retry-later",error:null!=(t=e.error)?t:Error(`logs request failed with status ${i}`)})},e=>{s({kind:"retry-later",error:e})})})}Xv(e,t){(0!==e||t)&&(this.wd=nz(e,this.wd,3,()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Jv(e){this.al.length>0&&this.Yv(e,this.al,this.Nv,this._o.library.name,e=>{this.al=e}),this._v.length>0&&this.Yv(e,this._v,this.Bv,ui,e=>{this._v=e})}Yv(e,t,i,s,r){if(0===t.length)return;let n=t.map(e=>e.record);r([]);let o=iG(n,iH(i,this._o.library.name,this._o.library.version),s,this._o.library.version);this._o.sendRequest("/i/v1/logs",{method:"POST",query:{token:this._o.projectToken},body:o,compression:"best-available",transport:e,timeoutMs:6e4}).catch(e=>this.Kv(e))}};let ua=i8("[NetworkMetrics]"),ul=()=>{var e;return(null==c||null==(e=c.performance)?void 0:e.now)?c.performance.now():Date.now()},uu={"http:":80,"https:":443},uh=new Set(["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"]),uc=(e,t)=>{var i;let s=String(t);return{method:String(e).toUpperCase(),url:(null==(i=nV(s))?void 0:i.href)||s}},ud=(e,t,i,s,r,n,o=!1)=>{try{var a,l;let u=r();if(!u)return;let h=i||void 0,c=ul()-s,d=nV(t.url);if(d&&"http:"!==d.protocol&&"https:"!==d.protocol)return;let p={url:(null==d?void 0:d.href)||t.url,method:t.method},f=D(u.name)?u.name(p):H(u.name)?u.name:"http.client.request.duration";if(!f)return;let g=o&&!h?void 0:((e,t)=>e?400>e?void 0:String(e):(null==t?void 0:t.name)||"_OTHER")(h,n),v=ty(ty(ty(ty(ty({},(e=>{let t=uh.has(e)?e:"_OTHER";return ty({"http.request.method":t},"_OTHER"===t&&e!==t?{"http.request.method_original":e}:{})})(p.method)),d?(e=>({"server.address":e.hostname.startsWith("[")&&e.hostname.endsWith("]")?e.hostname.slice(1,-1):e.hostname,"server.port":Number(e.port)||uu[e.protocol],"url.scheme":e.protocol.slice(0,-1),"url.template":e.pathname.split("/").map(e=>(e=>/^\d+$/.test(e)||e.length>=8&&/^[0-9a-f-]*\d[0-9a-f-]*$/i.test(e))(e)?":id":e).join("/")}))(d):{}),h?{"http.response.status_code":h}:{}),g?{"error.type":g}:{}),null==(a=u.attributes)?void 0:a.call(u,p,{status:h,durationMs:c}));null==(l=e.metrics)||l.histogram(f,c,{unit:"ms",attributes:v})}catch(e){ua.error("Failed to record network metric",e)}},up=()=>{},uf=new WeakMap,ug=new Set(["$comment","$defs","$id","$schema","additionalProperties","default","definitions","deprecated","description","examples","minProperties","properties","readOnly","required","title","type","writeOnly"]),uv={maxStringLength:2048,truncationSuffix:"..."},u_={maxStringLength:2048,truncationSuffix:"..."};function um(e){if(e)return!0===e?{intent:!0,model:!0}:{intent:!1!==e.intent,model:!1!==e.model}}function uy(e,t){return({}).hasOwnProperty.call(e,t)}function ub(e,t){let i=Object.create(e);return t&&Object.defineProperty(i,"inputSchema",{configurable:!0,enumerable:!0,writable:!0,value:t}),i}function uw(e,t,i=!1){if(!H(e))return;let s=e.trim();return s?(i?iL(s,uv):s).slice(0,t):void 0}function ux(e){try{return N(e)&&!0===e.isError}catch(e){return!1}}function uk(e){return iL(e||"Unknown error",u_).slice(0,2048)}let u$={featureFlags:class extends lQ{constructor(e){let t=new lX(e.config,e.nl());super(t),this.name=aB,this._instance=e,this.tf=t}get Rd(){return this._instance.persistence}updateConfig(e,t){this.tf.update(e,t),this.Ad()}}},uE=ty({productTours:class{get Ml(){return this._instance.persistence}constructor(e){this.yp=null,this.bp=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if("productTours"in t){var i,s;if(this.Ml&&this.Ml.register({[sR]:!!t.productTours}),!lE(this._instance))return!this.yp&&U(null==(i=this.Ml)?void 0:i.props.ph_product_tours)||l$.info("product tours disabled; stopping and clearing cached tours"),null==(s=this.yp)||s.stop(),this.yp=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.yp&&lE(this._instance)&&this.Ho(()=>this._p())}Ho(e){var t,i,s;(null==(t=x.__PosthogExtensions__)?void 0:t.generateProductTours)?e():null==(i=x.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this._instance,"product-tours",t=>{t?l$.error("Could not load product tours script",t):e()})}_p(){var e;!this.yp&&(null==(e=x.__PosthogExtensions__)?void 0:e.generateProductTours)&&(this.yp=x.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t=!1){if(L(this.bp)&&!t)return void e(this.bp,{isLoaded:!0});let i=this.Ml;if(i){let s=i.props[sG];if(L(s)&&!t)return this.bp=s,void e(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/product_tours/?token=${this._instance.config.token}`),method:"GET",timestampMode:"query",callback:t=>{if(!lE(this._instance))return void e([],{isLoaded:!0});let s=t.statusCode;if(200!==s||!t.json){let i=`Product Tours API could not be loaded, status: ${s}`;return 0===s?t.error||l$.warn(i):l$.error(i),void e([],{isLoaded:!1,error:i})}let r=L(t.json.product_tours)?t.json.product_tours:[];this.bp=r,i&&i.register({[sG]:r}),e(r,{isLoaded:!0})}})}getActiveProductTours(e){U(this.yp)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.yp.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.yp)||t.showTourById(e)}previewTour(e){this.yp?this.yp.previewTour(e):this.Ho(()=>{var t;this._p(),null==(t=this.yp)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.yp)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.yp)||e.nextStep()}previousStep(){var e;null==(e=this.yp)||e.previousStep()}clearCache(){var e;this.bp=null,null==(e=this.Ml)||e.unregister("ph_product_tours")}resetTour(e){var t;null==(t=this.yp)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.yp)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.yp)||t.cancelPendingTour(e)}}},u$),uS=ty({surveys:class extends lC{constructor(e){super(new lN(e),{get projectToken(){return e.config.token},kv:new lD(e)}),this._instance=e}Vc(e,t){let i=t.query?o8(e,t.query):e;return new Promise(e=>{var s;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor(null!=(s=t.target)?s:"api",i),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})})}}},u$),uP=ty({experiments:class e{get Mr(){return this._instance.config}constructor(t){this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=(t=!1)=>{this.getWebExperiments(t=>{e.Bp("retrieved web experiments from the server"),this.zp=new Map,t.forEach(t=>{if(t.feature_flag_key){var i;this.zp&&(e.Bp("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(i=this.zp)||i.set(t.feature_flag_key,t));let s=this._instance.getFeatureFlag(t.feature_flag_key);H(s)&&t.variants[s]&&this.Hp(t.name,s,t.variants[s].transforms)}else if(t.variants)for(let i in t.variants){let s=t.variants[i];e.Up(s,this._instance)&&this.Hp(t.name,i,s.transforms)}})},t)},this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(t){if(this._is_bot())e.Bp(l4);else if(!this.Mr.disable_web_experiments){if(U(this.zp))return this.zp=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.Bp("applying feature flags",t),t.forEach(e=>{var t,i;if(this.zp&&(null==(t=this.zp)?void 0:t.has(e))){let t=this._instance.getFeatureFlag(e),s=null==(i=this.zp)?void 0:i.get(e);t&&(null==s?void 0:s.variants[t])&&this.Hp(s.name,t,s.variants[t].transforms)}})}}previewWebExperiment(){let t=e.getWindowLocation();if(null==t?void 0:t.search){let i=nW(null==t?void 0:t.search,"__experiment_id"),s=nW(null==t?void 0:t.search,"__experiment_variant");i&&s&&(e.Bp(`previewing web experiments ${i} && ${s}`),this.getWebExperiments(e=>{this.Wp(parseInt(i),s,e)},!1,!0))}}loadIfEnabled(){this.Mr.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Mr.disable_web_experiments&&!i)return e([]);let s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api",`/api/web_experiments/?token=${this.Mr.token}`),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Wp(t,i,s){let r=s.filter(e=>e.id===t);r&&r.length>0&&(e.Bp(`Previewing web experiment [${r[0].name}] with variant [${i}]`),this.Hp(r[0].name,i,r[0].variants[i].transforms))}static Up(t,i){return!U(t.conditions)&&e.Vp(t,i)&&e.Gp(t)}static Vp(t,i){var s,r,n,o;if(U(t.conditions)||U(null==(s=t.conditions)?void 0:s.url))return!0;let a=e.getWindowLocation();if(a){let e=rK(i,a.href);return!(null==(r=t.conditions)?void 0:r.url)||l6[null!=(n=null==(o=t.conditions)?void 0:o.urlMatchType)?n:"icontains"](t.conditions.url,e)}return!1}static getWindowLocation(){return null==c?void 0:c.location}static Gp(e){var t,i,s,r,n,o,a,l,u;if(U(e.conditions)||U(null==(t=e.conditions)?void 0:t.utm))return!0;let h=nZ();if(h.utm_source){let t=!(null==(i=e.conditions)||null==(i=i.utm)?void 0:i.utm_campaign)||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==h.utm_campaign,c=!(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_source)||(null==(n=e.conditions)||null==(n=n.utm)?void 0:n.utm_source)==h.utm_source,d=!(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_medium)||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_medium)==h.utm_medium,p=!(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_term)||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==h.utm_term;return t&&d&&p&&c}return!1}static Bp(e,...t){i6.info(`[WebExperiments] ${e}`,t)}Hp(t,i,s){this._is_bot()?e.Bp(l4):"control"!==i?s.forEach(s=>{if(s.selector){var r;e.Bp(`applying transform of variant ${i} for experiment ${t} `,s);let n=null==(r=document)?void 0:r.querySelectorAll(s.selector);null==n||n.forEach(e=>{s.html&&(e.innerHTML=s.html),s.css&&e.setAttribute("style",s.css)})}}):e.Bp("Control variants leave the page unmodified.")}_is_bot(){return p&&this._instance?aw(p,this.Mr.custom_blocked_useragents):void 0}}},u$);li.__defaultExtensionClasses=ty({},ty(ty(ty(ty(ty(ty(ty(ty(ty(ty(ty(ty(ty(ty({},u$),{sessionRecording:class{get Mr(){return this._instance.config}get Ml(){return this._instance.persistence}get started(){var e;return!!(null==(e=this.ef)?void 0:e.isStarted)}get status(){var e,t;return"awaiting_config"===this.if||"missing_config"===this.if?this.if:null!=(e=null==(t=this.ef)?void 0:t.status)?e:this.if}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.if=lm,this.nf=void 0,this.sf=!1,this.Je=(()=>{var e,t;if(!(null==f?void 0:f.visibilityState)||"visible"===f.visibilityState)return!0;let i=null==c||null==(e=c.performance)||null==(t=e.getEntriesByType)?void 0:t.call(e,"visibility-state");return!(null==i?void 0:i.length)||i.some(e=>"visible"===e.name)})(),this.sn=()=>{var e,t;"visible"===(null==f?void 0:f.visibilityState)&&(this.Je=!0,null==(e=this.ef)||null==(t=e.setDocumentWasEverVisible)||t.call(e,!0))},!this._instance.sessionManager)throw lb.error("started without valid sessionManager"),Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.Mr.cookieless_mode)throw Error('[SessionRecording] cannot be used with cookieless_mode="always"');(null==f?void 0:f.addEventListener)&&rb(f,"visibilitychange",this.sn)}initialize(){this.startIfEnabledOrStop()}dispose({discardBufferedEvents:e=!1}={}){var t;this.sf=!0,null==f||null==(t=f.removeEventListener)||t.call(f,"visibilitychange",this.sn),e?this.rf(!0):this.stopRecording()}get af(){var e;let t=!!(null==(e=this._instance.get_property("$session_recording_remote_config"))?void 0:e.enabled),i=!this.Mr.disable_session_recording,s=this.Mr.disable_session_recording||this._instance.consent.isOptedOut();return c&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(this.sf||this.af&&(null==(t=this.ef)?void 0:t.isStarted))return;let i=!q(Object.assign)&&!q(Array.from);this.af&&i?(this.lf(e),lb.info("starting")):(this.if=lm,this.stopRecording())}lf(e){var t,i,s,r;if(this.af)if("awaiting_config"!==this.if&&"missing_config"!==this.if&&(this.if=ly),(null==x||null==(t=x.__PosthogExtensions__)||null==(t=t.rrweb)?void 0:t.record)&&(null==(i=x.__PosthogExtensions__)?void 0:i.initSessionRecording))this.uf(e);else{let t=this._instance.sessionManager;null==(s=x.__PosthogExtensions__)||null==(r=s.loadExternalDependency)||r.call(s,this._instance,this.cf,i=>{if(!this.sf&&this.af&&this._instance.sessionManager===t)return i?(this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0}),lb.error("could not load recorder",i)):void this.uf(e);this.if="disabled"})}}stopRecording(){var e,t;null==(e=this.nf)||e.call(this),this.nf=void 0,null==(t=this.ef)||t.stop()}rf(e=!1){var t,i;null==(t=this.nf)||t.call(this),this.nf=void 0,null==(i=this.ef)||i.discard({discardProducerEvents:e})}hf(){var e,t;null==(e=this.Ml)||e.unregister("$session_is_sampled"),null==(t=this.Ml)||t.unregister("$replay_sample_rate")}df(e,t){if(U(e))return null;let i=V(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(lb.warn(`${t} must be between 0 and 1. Ignoring invalid value:`,e),null):i}vf(e){if(this.Ml){var t,i;let s=this.Ml,r=()=>{var t;let i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.df(null==(t=this.Mr.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.df(null==i?void 0:i.sampleRate,"remote config sampleRate"),o=null!=r?r:n;U(o)&&this.hf();let a=null==i?void 0:i.minimumDurationMilliseconds;s.register({[sN]:ty(ty({cache_timestamp:Date.now(),enabled:!!i},i),{},{networkPayloadCapture:ty({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:o,minimumDurationMilliseconds:q(a)?null:a,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};r(),null==(t=this.nf)||t.call(this),this.nf=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){let t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.vf(t),void this.rf()):(this.vf(t),void this.startIfEnabledOrStop()):("awaiting_config"===this.if&&(this.if="missing_config",this._instance.register_for_session({[s4]:!0}),lb.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t="log"){var i;(null==(i=this.ef)?void 0:i.log)?this.ef.log(e,t):lb.warn("log called before recorder was ready")}get cf(){var e,t;let i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(sN);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}ff(){let e,t=this._instance.get_property(sN);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return lb.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}return!U(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}uf(e){var t,i,s,r;if(!this.sf&&this.af&&this._instance.sessionManager){if(!(null==(t=x.__PosthogExtensions__)?void 0:t.initSessionRecording))return lb.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[s5]:!0});if(this.ef||(this.ef=null==(r=x.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance,this.Je),this.ef._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ff()){if("missing_config"===this.if||"awaiting_config"===this.if)return;return this.if="awaiting_config",lb.info("persisted remote config is stale, requesting fresh config before starting"),void new ox(this._instance).load()}this.if=ly,null==(i=(s=this.ef).setDocumentWasEverVisible)||i.call(s,this.Je),this.ef.start(e)}else this.if=lm}onRRwebEmit(e){var t,i;null==(t=this.ef)||null==(i=t.onRRwebEmit)||i.call(t,e)}overrideLinkedFlag(){var e,t;this.ef||null==(t=this.Ml)||t.register({$replay_override_linked_flag:!0}),null==(e=this.ef)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ef||null==(t=this.Ml)||t.register({$replay_override_sampling:!0}),null==(e=this.ef)||e.overrideSampling()}overrideTrigger(e){var t,i;this.ef||null==(i=this.Ml)||i.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),null==(t=this.ef)||t.overrideTrigger(e)}get sdkDebugProperties(){var e,t;let i={};for(let e of lw){let s=null==(t=this._instance.sessionPersistence)?void 0:t.get_property(e);q(s)||(i[e]=s)}return ty(ty({},i),(null==(e=this.ef)?void 0:e.sdkDebugProperties)||{$recording_status:this.status})}tryAddCustomEvent(e,t){var i;return!!(null==(i=this.ef)?void 0:i.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e,t;null==(e=this.ef)||null==(t=e.flushBeforeIdentityReset)||t.call(e)}}}),{autocapture:class extends la{constructor(e){super(new ll(e)),this.instance=e}},historyAutocapture:class{constructor(e){this.pf=!1,this._instance=e,this.gf=this.mf()}initialize(){this.startIfEnabled()}get isEnabled(){let e=this.yf();return!!(e.path||e.search||this.bf(e))}startIfEnabled(){this.isEnabled&&(i6.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.gf=this.mf(),this.startIfEnabled()}stop(){this._f&&this._f(),this._f=void 0,this.wf&&this.wf(),this.wf=void 0,i6.info("History API monitoring stopped")}monitorHistoryChanges(){c&&c.history&&(this.kf("pushState"),this.kf("replaceState"),this.Sf(),this.bf()&&this.xf())}kf(e){var t;if(!c||(null==(t=c.history[e])?void 0:t.__posthog_wrapped__))return;let i=this;ld(c.history,e,t=>function(s,r,n){var o;i.$f(n)&&i.Cf(),t.call(this,s,r,n),i.Tf(e,!i.pf&&"popstate"!==(null==c||null==(o=c.event)?void 0:o.type))})}mf(){let e=null==c?void 0:c.location;if(null==e?void 0:e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}yf(){let e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:N(e)?e:{}}bf(e=this.yf()){return!!e.hash&&!this._instance.config.disable_capture_url_hashes}If(e){let t=this.yf(),i=this.gf;return!(!i||!(t.path&&e.pathname!==i.pathname||t.search&&e.search!==i.search||this.bf(t)&&e.hash!==i.hash))}Tf(e,t=!1){try{t||this.Cf();let i=this.mf();if(!i)return;if(this.If(i)){let i=()=>this._instance.capture(rl,{navigation_type:e});t?(this.Mf=i,Promise.resolve().then(()=>this.Cf())):i()}this.gf=i}catch(t){i6.error(`Error capturing ${e} pageview`,t)}}$f(e){var t,i;return!(U(e)||!c)&&(null==(t=nV(String(e)))?void 0:t.href)!==(null==(i=c.location)?void 0:i.href)}Cf(){let e=this.Mf;if(e){this.Mf=void 0,this.pf=!0;try{e()}catch(e){i6.error("Error capturing deferred pageview",e)}finally{this.pf=!1}this.gf=this.mf()}}Sf(){if(this._f)return;let e=()=>{this.Tf("popstate")};rb(c,"popstate",e),this._f=()=>{c&&c.removeEventListener("popstate",e)}}xf(){if(this.wf)return;let e=()=>{this.Tf("hashchange")};rb(c,"hashchange",e),this.wf=()=>{c&&c.removeEventListener("hashchange",e)}}},heatmaps:class{get Mr(){return this.instance.config}constructor(e){var t;this.Ef=!1,this.So=!1,this.Pf=null,this.instance=e,this.Ef=!!(null==(t=this.instance.persistence)?void 0:t.props[sO]),this.rageclicks=new ls(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){let e=5e3;return N(this.Mr.capture_heatmaps)&&this.Mr.capture_heatmaps.flush_interval_milliseconds&&(e=this.Mr.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return U(this.Mr.capture_heatmaps)?U(this.Mr.enable_heatmaps)?this.Ef:this.Mr.enable_heatmaps:!1!==this.Mr.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.So||(lx.info("starting..."),this.Rf(),this.sn());else{var e;clearInterval(null!=(e=this.Pf)?e:void 0),this.Af(),this.getAndClearBuffer()}}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if(!("heatmaps"in t))return;let i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[sO]:i}),this.Ef=i,this.startIfEnabled()}getAndClearBuffer(){let e=this.Rt;return this.Rt=void 0,e}Ff(e){lk(e.originalEvent)&&this.Ir(e.originalEvent,"deadclick")}sn(){this.Pf&&clearInterval(this.Pf),this.Pf="visible"===(null==f?void 0:f.visibilityState)?setInterval(this.pl.bind(this),this.flushIntervalMilliseconds):null}Rf(){c&&f&&(this.Of=this.pl.bind(this),rb(c,ra,this.Of),this.Df=e=>this.Ir(e||(null==c?void 0:c.event)),rb(f,"click",this.Df,{capture:!0}),this.Lf=e=>this.Nf(e||(null==c?void 0:c.event)),rb(f,"mousemove",this.Lf,{capture:!0}),this.qf=new nO(this.instance,nP,this.Ff.bind(this)),this.qf.startIfEnabledOrStop(),this.jf=this.sn.bind(this),rb(f,sm,this.jf),this.So=!0)}Af(){var e;c&&f&&(this.Of&&c.removeEventListener(ra,this.Of),this.Df&&f.removeEventListener("click",this.Df,{capture:!0}),this.Lf&&f.removeEventListener("mousemove",this.Lf,{capture:!0}),this.jf&&f.removeEventListener(sm,this.jf),clearTimeout(this.Bf),null==(e=this.qf)||e.stop(),this.So=!1)}zf(e,t){let i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),n=function(e,t,i){let s=e;for(;s&&rY(s)&&!rX(s,"body");){let e;if(s===i)break;try{var r,n,o;e=null==(r=null!=(n=null==(o=s.ownerDocument)?void 0:o.defaultView)?n:c)?void 0:r.getComputedStyle(s).position}catch(e){break}if(O(t,e))return!0;s=ne(s)}return!1}(r6(e),["fixed","sticky"],r);return{x:e.clientX+(n?0:s),y:e.clientY+(n?0:i),target_fixed:n,type:t}}Ir(e,t="click"){var i;if(rQ(e.target)||!lk(e))return;let s=this.zf(e,t);(null==(i=this.rageclicks)?void 0:i.isRageClick(e.clientX,e.clientY,(new Date).getTime()))&&nd(r6(e),this.instance.config.rageclick)&&this.Qs(ty(ty({},s),{},{type:"rageclick"})),this.Qs(s)}Nf(e){!rQ(e.target)&&lk(e)&&(clearTimeout(this.Bf),this.Bf=setTimeout(()=>{this.Qs(this.zf(e,"mousemove"))},500))}Qs(e){if(!c)return;let t=this.Mr.disable_capture_url_hashes?td(c.location.href):c.location.href,i=this.Mr.custom_personal_data_properties,s=nG(t,this.Mr.mask_personal_data_properties?[...nK,...i||[]]:[],nY);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(e)}pl(){this.Rt&&!j(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:nO,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.Ef=!1,this.So=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Hf=()=>{clearTimeout(this.Uf),this.Uf=void 0,0!==this.Rt.metrics.length&&(this._instance.capture("$web_vitals",ty({$current_url:this.Rt.url},this.Rt.metrics.reduce((e,t)=>ty(ty({},e),{},{[`$web_vitals_${t.name}_event`]:ty({},t),[`$web_vitals_${t.name}_value`]:t.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Wf=e=>{var t;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},U(null==e?void 0:e.name)||U(null==e?void 0:e.value))return void lf.error("Invalid metric received",e);let i="string"==typeof e.navigationURL?e.navigationURL:void 0,s=this.Vf(i);if(q(s))return;let r=V(e.navigationId)||"string"==typeof e.navigationId?`navigation:${e.navigationId}`:`url:${s}`;if(this.Gf&&e.value>=this.Gf)return void lf.error("Ignoring metric with value >= "+this.Gf,e);this.Rt.navigationKey!==r&&(this.Hf(),this.Uf=setTimeout(this.Hf,this.flushToCaptureTimeoutMs)),q(this.Rt.navigationKey)&&(this.Rt.navigationKey=r,this.Rt.url=s),this.Rt.firstMetricTimestamp=q(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;let n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),o=ty(ty(ty({},e),i?{navigationURL:s}:{}),{},{$current_url:s,timestamp:Date.now()});if(delete o.entries,N(e.attribution)&&this.attributionMetrics.indexOf(e.name)>-1){let t={};for(let i of l_){let s="url"===i&&"string"==typeof e.attribution[i]?this.Vf(e.attribution[i]):e.attribution[i];q(s)||(t[i]=s)}o.attribution=t}else delete o.attribution;q(n)||(o.$session_id=n.sessionId,o.$window_id=n.windowId),this.Rt.metrics.push(o),this.Rt.metrics.length===this.allowedMetrics.length&&this.Hf()},this.Qf=()=>{if(this.So)return;let e,t,i,s,r=!1,n=x.__PosthogExtensions__,o=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor,a=(null==o?void 0:o[this.Zf])||("web-vitals"===this.Zf&&q(o)?null==n?void 0:n.postHogWebVitalsCallbacks:void 0);if(!q(a)){let n=a.withoutAttribution,o=this.attributionMetrics;r=!q(n),e=o.indexOf("LCP")>-1?a.onLCP:(null==n?void 0:n.onLCP)||a.onLCP,t=o.indexOf("CLS")>-1?a.onCLS:(null==n?void 0:n.onCLS)||a.onCLS,i=o.indexOf("FCP")>-1?a.onFCP:(null==n?void 0:n.onFCP)||a.onFCP,s=o.indexOf("INP")>-1?a.onINP:(null==n?void 0:n.onINP)||a.onINP}if(!(e&&t&&i&&s))return void lf.error("web vitals callbacks not loaded - not starting");let l={reportSoftNavs:this.useSoftNavs},u=r&&this.attributionMetrics.indexOf("INP")>-1?ty(ty({},l),{},{includeProcessedEventEntries:!1}):l;this.allowedMetrics.indexOf("LCP")>-1&&e(this.Wf.bind(this),l),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Wf.bind(this),l),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Wf.bind(this),l),this.allowedMetrics.indexOf("INP")>-1&&s(this.Wf.bind(this),u),this.So=!0},this.Ef=!!(null==(t=this._instance.persistence)?void 0:t.props[sA]),this.startIfEnabled()}get Jf(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t;let i=N(this.Jf)?null==(e=this.Jf)?void 0:e.web_vitals_allowed_metrics:void 0;return U(i)?(null==(t=this._instance.persistence)?void 0:t.props.$web_vitals_allowed_metrics)||lg:i}get flushToCaptureTimeoutMs(){return(N(this.Jf)?this.Jf.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){let e=N(this.Jf)?this.Jf.web_vitals_attribution:void 0;return G(e)?e?lg:[]:L(e)?e:lv}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){let e=N(this.Jf)?this.Jf.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}get Gf(){let e=N(this.Jf)&&V(this.Jf.__web_vitals_max_value)?this.Jf.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){let e=null==g?void 0:g.protocol;if("http:"!==e&&"https:"!==e)return lf.info("Web Vitals are disabled on non-http/https protocols"),!1;let t=N(this.Jf)?this.Jf.web_vitals:G(this.Jf)?this.Jf:void 0;return G(t)?t:this.Ef}startIfEnabled(){this.isEnabled&&!this.So&&(lf.info("enabled, starting..."),this.Ho(this.Qf))}onRemoteConfig(e){if(!e.ok)return;let t=e.config;if(!("capturePerformance"in t))return;let i=N(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=N(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[sA]:i}),this._instance.persistence.register({[sD]:s})),this.Ef=i,this.startIfEnabled()}get Zf(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}Ho(e){var t;let i=x.__PosthogExtensions__,s=this.Zf,r=null==i?void 0:i.postHogWebVitalsCallbacksByFlavor;(null==r?void 0:r[s])||"web-vitals"===s&&q(r)&&(null==i?void 0:i.postHogWebVitalsCallbacks)?e():null==i||null==(t=i.loadExternalDependency)||t.call(i,this._instance,s,t=>{t?lf.error("failed to load script",t):e()})}Vf(e){let t=e||(null==c?void 0:c.location.href);if(!t)return void lf.error("Could not determine current URL");let i=this._instance.config.disable_capture_url_hashes?td(t):t,s=this._instance.config.custom_personal_data_properties;return nG(i,this._instance.config.mask_personal_data_properties?[...nK,...s||[]]:[],nY)}}}),{exceptionObserver:class{constructor(e){var t;this.Qf=()=>{var e;if(!c||!this.isEnabled||!(null==(e=x.__PosthogExtensions__)?void 0:e.errorWrappingFunctions))return;let t=x.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=x.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=x.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Kf&&this.Mr.capture_unhandled_errors&&(this.Kf=t(this.captureException.bind(this))),!this.Xf&&this.Mr.capture_unhandled_rejections&&(this.Xf=i(this.captureException.bind(this))),!this.Yf&&this.Mr.capture_console_errors&&(this.Yf=s(this.captureException.bind(this)))}catch(e){lu.error("failed to start",e),this.tp()}},this._instance=e,this.ep=!!(null==(t=this._instance.persistence)?void 0:t.props[sI]),this.wt=new eh(ty(ty({},function(e={}){var t,i,s,r;return{refillRate:null!=(t=null!=(i=e.exceptionRateLimiterRefillRate)?i:e.__exceptionRateLimiterRefillRate)?t:1,bucketSize:null!=(s=null!=(r=e.exceptionRateLimiterBucketSize)?r:e.__exceptionRateLimiterBucketSize)?s:10}}(this._instance.config.error_tracking)),{},{refillInterval:1e4,A:lu})),this.Mr=this.np(),this.startIfEnabledOrStop()}np(){let e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return N(e)?t=ty(ty({},t),e):(q(e)?this.ep:e)&&(t=ty(ty({},t),{},{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Mr.capture_console_errors||this.Mr.capture_unhandled_errors||this.Mr.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(lu.info("enabled"),this.tp(),this.Ho(this.Qf)):this.tp()}Ho(e){var t,i,s;(null==(t=x.__PosthogExtensions__)?void 0:t.errorWrappingFunctions)?e():null==(i=x.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this._instance,"exception-autocapture",t=>{if(t)return lu.error("failed to load script",t);e()})}tp(){var e,t,i;null==(e=this.Kf)||e.call(this),this.Kf=void 0,null==(t=this.Xf)||t.call(this),this.Xf=void 0,null==(i=this.Yf)||i.call(this),this.Yf=void 0}onRemoteConfig(e){if(!e.ok)return;let t=e.config;"autocaptureExceptions"in t&&(this.ep=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[sI]:this.ep}),this.Mr=this.np(),this.startIfEnabledOrStop())}onConfigChange(){this.Mr=this.np()}captureException(e){try{var t,i,s;let r=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";if(this.wt.consumeRateLimit(r))return void lu.info("Skipping exception capture because of client rate limiting.",{exception:r});null==(s=this._instance.exceptions)||s.sendExceptionEvent(e)}catch(e){}}},exceptions:class{constructor(e){var t,i;this.sp=[],this.rp=new tw([new tD,new tG,new tj,new tN,new tV,new tU,new tH,new tW],function(e,...t){return(i,s=0)=>{let r=[],n=i.split("\n"),o=Math.min(n.length,s+1e3),a=[];for(let i=s;o>i;i++){let s=n[i];if(s.length>1024)continue;let o=tA.test(s)?s.replace(tA,"$1"):s;if(!o.match(/\S*Error: /)){for(let i of t){let t=i(o,e);if(t){r.push(t);let e=function(e){for(let t=1;10>=t;t++){let i=e.length-2*t;if(0>i)break;let s=!0;for(let r=0;t>r;r++)if(!tT(e[i+r],e[i+t+r])){s=!1;break}if(s){for(let s=0;t>s;s++)e[i+s]=e[i+t+s];return e.length=i+t,{start:i,length:t}}}}(r);if(e){for(let t=a.length-1;t>=0;t--){let i=a[t];if(e.start>=i.start+i.length)break;a.pop()}a.push(e)}break}}if(function(e,t){let i=t[0],s=e.length-(i?tR(e,i):0);for(let i of t)s-=tL(e,i);return s}(r,a)>=50)break}}let l=[...a].sort((e,t)=>t.start-e.start),u=l[l.length-1];if(u){let e=tR(r,u);for(let t of(r.splice(u.start-e,e),l))t.start-=e}for(let e of l){let t=e.start+e.length,i=tL(r,e);i&&r.splice(t+i===r.length?t:e.start,i)}return a.some(e=>0===e.start&&r.length===e.length)&&function(e){let t=e.map(e=>`${e.function}|${e.filename}|${e.lineno}|${e.colno}|${e.module}`),i=0;for(let e=1;t.length>e;e++)(function(e,t,i){for(let s=0;e.length>s;s++){let r=e[(t+s)%e.length],n=e[(i+s)%e.length];if(r!==n)return n>r}return!1})(t,e,i)&&(i=e);e.push(...e.splice(0,i))}(r),function(e){if(!e.length)return[];let t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>ty(ty({},e),{},{filename:e.filename||(t[t.length-1]||{}).filename,function:e.function||"?"}))}(r)}}("web:javascript",tO,tC)),this._instance=e,this.sp=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))?t:[],this.op=tX(this.ap()),this.lp=new tZ(this.op)}onConfigChange(){this.op=tX(this.ap()),this.lp.setConfig(this.op)}onRemoteConfig(e){var t,i,s;if(!e.ok)return;let r=e.config;if(!("errorTracking"in r))return;let n=null!=(t=null==(i=r.errorTracking)?void 0:i.suppressionRules)?t:[],o=null==(s=r.errorTracking)?void 0:s.captureExtensionExceptions;this.sp=n,this._instance.persistence&&this._instance.persistence.register({[sF]:this.sp,[sC]:o})}get up(){var e;let t=!!this._instance.get_property(sC),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.rp.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.op.enabled)try{if(!H(e)||0===e.trim().length)return void l0.warn("Ignoring exception step because message must be a non-empty string");let{sanitizedProperties:i,droppedKeys:s}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};let t=[];return{sanitizedProperties:Object.keys(e).reduce((i,s)=>(tQ.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(this.cp(t));s.length>0&&l0.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.lp.add(ty({[tJ]:e,[tK]:(new Date).toISOString()},i))}catch(e){l0.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{let t=e.$exception_list;if(this.hp(t)){if(this.dp(t))return this.vp("Exception dropped: matched a suppression rule"),void l0.info("Skipping exception capture because a suppression rule matched");if(!this.up&&this.fp(t))return this.vp("Exception dropped: thrown by a browser extension"),void l0.info("Skipping exception capture because it was thrown by an extension");if(!this.up&&this.pp(t))return this.vp("Exception dropped: thrown by an injected browser script"),void l0.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.gp(t))return this.vp("Exception dropped: thrown by the PostHog SDK"),void l0.info("Skipping exception capture because it was thrown by the PostHog SDK")}let i=this.op.enabled&&U(e.$exception_steps)?this.mp(e):e,s=function(){if("u">typeof h){var e;let t=null==(e=h.env.POSTHOG_RELEASE_ID)?void 0:e.trim();if(t)return t}let t=globalThis._posthogReleaseId;return"string"==typeof t&&t.length>0?t:void 0}();s&&(i.$release_id=s);try{let e=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",dc:!0});return e&&this.lp.clear(),e}catch(e){return lZ(e)||l0.error("Failed to capture exception event. Dropping this exception.",e),void this.lp.clear()}}catch(e){return void(lZ(e)||l0.error("Failed to process exception event. Ignoring this exception.",e))}}mp(e){try{let t=this.lp.getAttachable();return 0===t.length?e:ty(ty({},e),{},{$exception_steps:t})}catch(t){return l0.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}vp(e){this.op.enabled&&this.lp.add({[tJ]:e,[tK]:(new Date).toISOString()})}cp(e){return N(e)?ty({},e):{}}ap(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}dp(e){if(0===e.length)return!1;try{let t=e.reduce((e,{type:t,value:i})=>(H(t)&&t.length>0&&e.$exception_types.push(t),H(i)&&i.length>0&&e.$exception_values.push(i),e),{$exception_types:[],$exception_values:[]});return this.sp.some(e=>{let i=e.values.map(e=>{let i=aS[e.operator],s=t[e.key];if(!i||!s)return!1;let r=L(e.value)?e.value:[e.value];return r.length>0&&i(r,s)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}catch(e){return l0.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}fp(e){let t=e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}),i=t.filter(({filename:e})=>!!e&&l3.some(t=>e.startsWith(t)));return 0!==i.length&&(!i.every(({filename:e})=>!!e&&e.startsWith(l1))||e.some(({type:e,value:t})=>"NoResponse"===e||H(t)&&l2.some(({value:e,exact:i})=>i?t===e:t.includes(e)))&&!t.some(({in_app:e,filename:t})=>e&&!(null==t?void 0:t.startsWith(l1))))}pp(e){return e.some(({value:e})=>H(e)&&l5.some(t=>e.includes(t)))}gp(e){if(e.length>0){var t,i,s,r;let n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],o=n[n.length-1];return null!=(s=null==o||null==(r=o.filename)?void 0:r.includes("posthog.com/static"))&&s}return!1}hp(e){return!U(e)&&L(e)}}}),uE),{siteApps:class{constructor(e){this._instance=e,this.wp=0,this.kp=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Sp(e,t){if(!t)return;let i=this.globalsForEvent(t);this.kp.push(i),this.kp.length>1e3&&(this.kp=this.kp.slice(10))}get siteAppLoaders(){var e;return null==(e=x._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){let e=this._instance._addCaptureHook(this.Sp.bind(this));this.xp=()=>{e(),this.kp=[],this.xp=void 0}}}globalsForEvent(e){var t,i,s,r,n,o,a;if(!e)throw Error("Event payload is required");let l={},u=this._instance.get_property("$groups")||[];for(let[e,t]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[e]={id:u[e],type:e,properties:t};let{$set_once:h,$set:c}=e;return{event:ty(ty({},it(e,lS)),{},{properties:ty(ty(ty({},e.properties),c?{$set:ty(ty({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{}),c)}:{}),h?{$set_once:ty(ty({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{}),h)}:{}),elements_chain:null!=(n=null==(o=e.properties)?void 0:o.$elements_chain)?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}$p(e){var t;let i=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(lP.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(lP.error("prepare_external_dependency_script returned null"),null):e}Cp(){var e,t,i,s,r,n,o,a;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};let l=null==f?void 0:f.defaultView,u=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!u)return()=>{};if(this.wp++,this.Tp)return this.Ip();let h=[],c=this,d=new WeakSet,p=(e,t,i)=>{if(!(null==e?void 0:e[t]))return;let s=e[t];e[t]=i(s),h.push(()=>{e[t]=s})},g=e=>{if(d.has(e))return e;let t=c.$p(e);return t&&d.add(t),t},v=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!z(e));return p(u,"appendChild",e=>function(t){let i=g(t);return i?e.call(this,i):t}),p(u,"insertBefore",e=>function(t,i){let s=g(t);return s?e.call(this,s,i):t}),p(u,"replaceChild",e=>function(t,i){let s=g(t);return s?e.call(this,s,i):i}),[null==(t=l.Element)?void 0:t.prototype,null==(i=l.Document)?void 0:i.prototype,null==(s=l.DocumentFragment)?void 0:s.prototype].forEach(e=>{p(e,"append",e=>function(...t){return e.apply(this,v(t))}),p(e,"prepend",e=>function(...t){return e.apply(this,v(t))})}),[null==(r=l.Element)?void 0:r.prototype,null==(n=l.CharacterData)?void 0:n.prototype,null==(o=l.DocumentType)?void 0:o.prototype].forEach(e=>{p(e,"before",e=>function(...t){return e.apply(this,v(t))}),p(e,"after",e=>function(...t){return e.apply(this,v(t))}),p(e,"replaceWith",e=>function(...t){let i=v(t);return t.length&&!i.length?void 0:e.apply(this,i)})}),p(null==(a=l.Element)?void 0:a.prototype,"insertAdjacentElement",e=>function(t,i){let s=g(i);return s?e.call(this,t,s):null}),this.Tp=()=>{h.forEach(e=>e()),this.Tp=void 0},this.Ip()}Ip(){let e=!1;return()=>{var t;e||(e=!0,this.wp--,0===this.wp&&(null==(t=this.Tp)||t.call(this)))}}Mp(e,t=!0){let i=this.Cp();try{let s=e(i);return t&&i(),s}catch(e){throw i(),e}}setupSiteApp(e){let t=this.apps[e.id],i=()=>{var i;!t.errored&&this.kp.length&&(lP.info(`Processing ${this.kp.length} events for site app with id ${e.id}`),this.kp.forEach(e=>this.Mp(()=>{var i;return null==(i=t.processEvent)?void 0:i.call(t,e)})),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.xp)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,lP.info(`Site app with id ${e.id} ${r?"loaded":"errored"}`),s&&i()};try{let{processEvent:i}=this.Mp(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1);i&&(t.processEvent=i),s=!0}catch(t){lP.error(lM+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){lP.error(`Error while processing buffered events PostHog app with config id ${e.id}`,i),t.errored=!0}}Ep(){let e=this.siteAppLoaders||[];for(let t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(let t of e)this.setupSiteApp(t)}Pp(e){if(0===Object.keys(this.apps).length)return;let t=this.globalsForEvent(e);for(let i of Object.values(this.apps))try{this.Mp(()=>{var e;return null==(e=i.processEvent)?void 0:e.call(i,t)})}catch(t){lP.error(`Error while processing event ${e.event} for site app ${i.id}`,t)}}onRemoteConfig(e){var t,i,s,r,n;if(null==(t=this.siteAppLoaders)?void 0:t.length)return this.isEnabled?(this.Ep(),void this._instance.on("eventCaptured",e=>this.Pp(e))):void lP.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.xp)||i.call(this),!e.ok)return;let o=e.config;if(null==(s=o.siteApps)?void 0:s.length)if(this.isEnabled)for(let{id:e,url:t}of o.siteApps)x[`__$$ph_site_app_${e}`]=this._instance,null==(r=x.__PosthogExtensions__)||null==(n=r.loadSiteApp)||n.call(r,this._instance,t,t=>{if(t)return lP.error(lM+e,t)});else lP.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}),uS),{tracingHeaders:class{constructor(e){this._instance=e,this.Rp=void 0,this.Ap=void 0,this.Fp=void 0,this.Qf=()=>{var e,t;let i=this.Op();i?(q(this.Rp)&&(this.Rp=null==(e=x.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),q(this.Ap)&&(this.Ap=null==(t=x.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.tp()}}initialize(){this.startIfEnabledOrStop()}Ho(e){var t,i,s;(null==(t=x.__PosthogExtensions__)?void 0:t.tracingHeadersPatchFns)?e():null==(i=x.__PosthogExtensions__)||null==(s=i.loadExternalDependency)||s.call(i,this._instance,"tracing-headers",t=>{if(t)return lp.error("failed to load script",t);e()})}Dp(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}Op(){let e=this.Dp();return L(e)?(L(this.Fp)?this.Fp.splice(0,this.Fp.length,...e):this.Fp=[...e],e.length>0?this.Fp:void 0):(L(this.Fp)&&this.Fp.splice(0),this.Fp=e||void 0,this.Fp)}tp(){var e,t;null==(e=this.Rp)||e.call(this),null==(t=this.Ap)||t.call(this),this.Rp=void 0,this.Ap=void 0}startIfEnabledOrStop(){this.Op()?this.Ho(this.Qf):this.tp()}}}),{toolbar:class{constructor(e){this.instance=e}Lp(e){x.ph_toolbar_state=e}Np(){var e;return null!=(e=x.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,i){var s,r;if(rw(this.instance.config)||!c||!f)return!1;e=null!=(s=e)?s:c.location,i=null!=(r=i)?r:c.history;try{let s;if(!t){try{c.localStorage.setItem("test","test"),c.localStorage.removeItem("test")}catch(e){return!1}t=null==c?void 0:c.localStorage}let r=lj||nJ(e.hash,"__posthog")||nJ(e.hash,"state"),n=r?tp(()=>JSON.parse(atob(decodeURIComponent(r))))||tp(()=>JSON.parse(decodeURIComponent(r))):null;return n&&"ph_authorize"===n.action?((s=n).source="url",s&&Object.keys(s).length>0&&(n.desiredHash?e.hash=n.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(lq)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}qp(e){let t=x.ph_load_toolbar||x.ph_load_editor;!U(t)&&D(t)?t(e,this.instance):lH.warn("No toolbar load function found")}loadToolbar(e){let t=!!(null==f?void 0:f.getElementById("__POSTHOG_TOOLBAR__"));if(!c||t)return!1;let i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=ty(ty({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(c.localStorage.setItem(lq,JSON.stringify(ty(ty({},s),{},{source:void 0}))),2===this.Np())this.qp(s);else if(0===this.Np()){var r,n;this.Lp(1),null==(r=x.__PosthogExtensions__)||null==(n=r.loadExternalDependency)||n.call(r,this.instance,"toolbar",e=>{if(e)return lH.error("[Toolbar] Failed to load",e),void this.Lp(0);this.Lp(2),this.qp(s)}),rb(c,"turbolinks:load",()=>{this.Lp(0),this.loadToolbar(s)})}return!0}jp(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return this.maybeLoadToolbar(e,t,i)}}}),uP),{conversations:class{constructor(e){this._instance=e,this.Qp=void 0,this._conversationsManager=null,this.Zp=!1,this.ne=null,this.Jp=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(this._instance.config.disable_conversations||(this.Kp=e.ok,!e.ok))return;let t=e.config.conversations;U(t)||(G(t)?this.Qp=t:(this.Qp=t.enabled,this.ne=t),this.loadIfEnabled())}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Qp=void 0,this.ne=null,this.Kp=void 0,this.Jp=!1}loadIfEnabled(){if(this._conversationsManager||this.Zp||this._instance.config.disable_conversations||rw(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())return;let e=null==x?void 0:x.__PosthogExtensions__;if(e&&!q(this.Qp)&&this.Qp)if(this.ne&&this.ne.token){this.Zp=!0;try{let t=e.initConversations;if(t)return this.Xp(t),void(this.Zp=!1);let i=e.loadExternalDependency;if(!i)return void this.Yp(rs);i(this._instance,"conversations",t=>{t||!e.initConversations?this.Yp("Could not load conversations script",t):this.Xp(e.initConversations),this.Zp=!1})}catch(e){this.Yp("Error initializing conversations",e),this.Zp=!1}}else l8.error("Conversations enabled but missing token in remote config.")}Xp(e){if(this.ne)try{this._conversationsManager=e(this.ne,this._instance),this.Jp=!1,l8.info("Conversations loaded successfully")}catch(e){this.Yp("Error completing conversations initialization",e)}else l8.error("Cannot complete initialization: remote config is null")}Yp(e,t){l8.error(e,t),this._conversationsManager=null,this.Zp=!1,this.Jp=!0}show(){this._conversationsManager?this._conversationsManager.show():l8.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Qp&&!z(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":rw(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Kp?"remote_config_failed":q(this.Qp)?this.Kp?"disabled_in_project":"remote_config_pending":this.Qp?U(this.ne)||!this.ne.token?"missing_token":(null==x?void 0:x.__PosthogExtensions__)?this.Zp?"initializing":this.Jp?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var s=this;return en(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(l8.warn(l9),null)})()}getMessages(e,t){var i=this;return en(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(l8.warn(l9),null)})()}markAsRead(e){var t=this;return en(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(l8.warn(l9),null)})()}getTickets(e){var t=this;return en(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(l8.warn(l9),null)})()}requestRestoreLink(e){var t=this;return en(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(l8.warn(l9),null)})()}restoreFromToken(e){var t=this;return en(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(l8.warn(l9),null)})()}restoreFromUrlToken(){var e=this;return en(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(l8.warn(l9),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}Sc(){var e;null==(e=this._conversationsManager)||e.setIdentity()}xc(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}}),{logs:class extends uo{constructor(e){super({get(){var t;return null==e||null==(t=e.config)?void 0:t.logs},captureHintKey:sL,get remoteConfigWillArrive(){var t,i;return!(null==(t=e.nl)?void 0:t.call(e))||!!(null==(i=x._POSTHOG_REMOTE_CONFIG)||null==(i=i[e.config.token])?void 0:i.config)}},()=>(function(e){var t;let i={};if(i.distinctId=e.get_distinct_id(),e.sessionManager){let{sessionId:t,windowId:s,sessionStartTimestamp:r,lastActivityTimestamp:n}=e.sessionManager.checkAndGetSessionAndWindowId(!0);i.sessionId=t,i.windowId=s,U(r)||(i.sessionStartTimestamp=r),U(n)||(i.lastActivityTimestamp=n)}if((null==x||null==(t=x.location)?void 0:t.href)&&(i.currentUrl=e.config.disable_capture_url_hashes?td(x.location.href):x.location.href),e.featureFlags){let t=e.featureFlags.getFlags();t&&t.length>0&&(i.activeFeatureFlags=t)}return i})(e)),this._instance=e,this.name=az,this.Av()}get Pv(){return this._instance.__loaded}Rv(){let e=i8("[logs]"),t=null==x?void 0:x.__PosthogExtensions__;if(!t)return void e.error("PostHog Extensions not found.");let i=t.loadExternalDependency;if(i)return e=>{i(this._instance,"logs",i=>{let s=t.logs;e(i,(null==s?void 0:s.initializeLogs)?{initialize:e=>s.initializeLogs(e),replay(e,t){var i;return null==(i=s.replayConsoleBuffer)?void 0:i.call(s,e,t)}}:void 0)})};e.error(rs)}}}),{metrics:class{constructor(e){this._instance=e,this.A=i8("[metrics]"),this.Io=!1}initialize(){this.onConfigChange()}onConfigChange(){var e;if(this.Io)return;let t=!!(null==(e=this._instance.config.metrics)?void 0:e.network);t&&!this.tg?this.tg=(e=>{let t=!0,i=()=>t?(e=>{var t;let i=null==(t=e.config.metrics)?void 0:t.network;return!0===i?{}:i||void 0})(e):void 0,s=D(null==c?void 0:c.fetch)?ld(c,"fetch",t=>function(...s){let r=ul(),n=t.apply(this,s);if(!i())return n;try{var o,a,l;let[t,u]=s,h=uc(null!=(o=null!=(a=null==u?void 0:u.method)?a:null==t?void 0:t.method)?o:"GET",null!=(l=null==t?void 0:t.url)?l:t);return n.then(t=>(ud(e,h,null==t?void 0:t.status,r,i,void 0,!0),t),t=>{throw ud(e,h,void 0,r,i,t),t})}catch(e){return ua.error("Failed to observe fetch",e),n}}):up,r=((e,t)=>{var i;let s=null==c||null==(i=c.XMLHttpRequest)?void 0:i.prototype;if(!s)return up;let r=new WeakMap,n=ld(s,"open",e=>function(...t){try{o2.has(this)||r.set(this,uc(t[0],t[1]))}catch(e){ua.error("Failed to observe XHR open",e)}return e.apply(this,t)}),o=ld(s,"send",i=>function(...s){let n;try{let i=r.get(this);if(i&&t()){let s=ul();n=()=>{this.removeEventListener("loadend",n),ud(e,i,this.status,s,t)},rb(this,"loadend",n)}}catch(e){ua.error("Failed to observe XHR send",e)}try{return i.apply(this,s)}catch(e){throw n&&this.removeEventListener("loadend",n),e}});return()=>{n(),o()}})(e,i);return()=>{t=!1,s(),r()}})(this._instance):!t&&this.tg&&(this.tg(),this.tg=void 0)}Dv(){var e,t;let i=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this.Mv&&this.Lv===i||(null==(t=this.Mv)||t.reset(),this.Lv=i,this.Mv=new i5(this.Ov(),function(e){var t,i,s,r,n;let o=null==e?void 0:e.resourceAttributes;return{serviceName:null!=(t=null==o?void 0:o["service.name"])?t:null==e?void 0:e.serviceName,serviceVersion:null!=(i=null==o?void 0:o["service.version"])?i:null==e?void 0:e.serviceVersion,environment:null!=(s=null==o?void 0:o["deployment.environment"])?s:null==e?void 0:e.environment,resourceAttributes:o,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!=(r=null==e?void 0:e.flushIntervalMs)?r:1e4,maxSeriesPerFlush:null!=(n=null==e?void 0:e.maxSeriesPerFlush)?n:1e3}}(i),this.A)),this.Mv}count(e,t=1,i){this.Dv().count(e,t,i)}gauge(e,t,i){this.Dv().gauge(e,t,i)}histogram(e,t,i){this.Dv().histogram(e,t,i)}flush(e){if(!this.Mv)return Promise.resolve();if(e){let t=this.Mv.drainWindow();return t&&this.co(t,e),Promise.resolve()}return this.Mv.flush().catch(e=>this.A.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.Mv)||e.reset()}dispose(){var e,t;this.Io=!0,null==(e=this.tg)||e.call(this),this.tg=void 0,null==(t=this.Mv)||t.reset()}Ov(){let e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},co:e=>t.co(e),getLibraryId:()=>$.LIB_NAME,getLibraryVersion:()=>$.LIB_VERSION}}co(e,t){return new Promise(i=>{let s=!1,r=e=>{s||(s=!0,clearTimeout(n),i(e))},n=setTimeout(()=>r({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(ty(ty({method:"POST",url:this.eg(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t}),{},{fireCallbackOnDrop:!0,callback(e){let t=e.statusCode;if(t>=200&&300>t)r({kind:"ok"});else if(413===t)r({kind:"too-large"});else if(0!==t&&408!==t&&429!==t&&500>t)r({kind:"fatal",error:Error(`metrics request failed with status ${t}`)});else{var i;r({kind:"retry-later",error:null!=(i=e.error)?i:Error(`metrics request failed with status ${t}`)})}}}))})}eg(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}}),{webMCP:class{constructor(e){this._instance=e,this.ig=!1}initialize(){this.startIfEnabled()}startIfEnabled(){if(!this._instance.config.capture_webmcp||this.ig)return;let e=null==f?void 0:f.modelContext;if(!e||!D(e.registerTool))return;let t=uf.get(e);if(t)return t.instances.add(this._instance),void(this.ig=!0);let i={instances:new Set([this._instance])},s=e.registerTool,r=this;ld(e,"registerTool",e=>function(t,...s){let n=t;try{n=r.ng(t,i)}catch(i){return e.call(this,t,...s)}return e.call(this,n,...s)}),e.registerTool!==s&&(uf.set(e,i),this.ig=!0)}ng(e,t){if(!e||!D(e.execute))return e;let i=e.execute,s=this,{tool:r,injected:n}=function(e,t){let i={intent:!1,model:!1},s=e.inputSchema;if(!(q(s)||N(s)&&Object.keys(s).every(e=>ug.has(e)||e.startsWith("x-"))&&!0!==s.additionalProperties&&!N(s.additionalProperties)&&(!s.type||"object"===s.type)&&(!s.properties||N(s.properties))&&(!s.required||L(s.required))))return{tool:ub(e),injected:i};let r=(null==s?void 0:s.properties)||{},n=e=>uy(r,e)||L(null==s?void 0:s.required)&&s.required.includes(e);if(i.intent=t.intent&&!n("context"),i.model=t.model&&!n("llm_model"),!i.intent&&!i.model)return{tool:ub(e),injected:i};let o=ty({},r),a=L(null==s?void 0:s.required)?[...s.required]:[];return i.intent&&(o.context={type:"string",description:'Explain why this tool is called and how it supports the user\'s goal. Describe the abstract purpose only. Do not include personal or identifying information. Generalize specific entities as roles such as "a customer".'},a.includes("context")||a.push("context")),i.model&&(o.llm_model={type:"string",description:'The exact model identifier you are running as, taken from your system prompt or environment. Pass "unknown" if you do not know it. Never guess.'},a.includes("llm_model")||a.push("llm_model")),{tool:ub(e,ty(ty({},s),{},{type:(null==s?void 0:s.type)||"object",properties:o,required:a})),injected:i}}(e,function(e){let t={intent:!1,model:!1};for(let i of e.instances){let e=um(i.config.capture_webmcp);t.intent||(t.intent=!0===(null==e?void 0:e.intent)),t.model||(t.model=!0===(null==e?void 0:e.model))}return t}(t));return Object.defineProperty(r,"execute",{configurable:!0,enumerable:!0,writable:!0,value(...o){var a;let l,u=new Date,h=function(e,t){if(!N(e))return{};try{let i=t.intent?uw(e.context,2048,!0):void 0,s=t.model?uw(e.llm_model,256):void 0;return ty(ty({},i&&"{}"!==i?{intent:i}:{}),s&&"unknown"!==s.toLowerCase()?{model:s}:{})}catch(e){return{}}}(o[0],n),c=function(e,t){let i=e[0];if(!N(i))return e;try{let s=t.intent&&uy(i,"context"),r=t.model&&uy(i,"llm_model");if(!s&&!r)return e;let n=ty({},i);return s&&delete n.context,r&&delete n.llm_model,[n,...e.slice(1)]}catch(t){return e}}(o,n);try{l=i.apply(this===r?e:this,c)}catch(e){throw s.sg(t,r,u,{error:e,errorResult:!1},h),e}if((a=l)&&"function"==typeof a.then)return Promise.resolve(l).then(e=>{let i=ux(e)?{error:e,errorResult:!0}:void 0;return s.sg(t,r,u,i,h),e},e=>{throw s.sg(t,r,u,{error:e,errorResult:!1},h),e});let d=ux(l)?{error:l,errorResult:!0}:void 0;return s.sg(t,r,u,d,h),l}}),r}sg(e,t,i,s,r){let n,o=Date.now()-i.getTime();for(let d of e.instances){var a,l,u,h,c;let e=um(d.config.capture_webmcp);if(e){s&&!n&&(n={message:function(e,t){try{return uk(t?function(e){try{if(!N(e)||!L(e.content))return;return e.content.filter(e=>N(e)&&"text"===e.type&&H(e.text)).map(e=>e.text).join(" ").trim()||void 0}catch(e){return}}(e):N(e)&&H(e.message)?e.message:H(e)?e:String(e))}catch(e){return"Unknown error"}}(l=s.error,u=s.errorResult),type:function(e,t){if(t)return"Error";try{if(!N(e))return"Error";let t=H(e.name)?e.name.trim():"",i=e.constructor;return t&&"Error"!==t||!D(i)||"Error"===i.name||(t=i.name),(t||"Error").slice(0,256)}catch(e){return"Error"}}(l,u)});try{d.capture("$mcp_tool_call",ty(ty(ty({$mcp_source:"posthog_mcp_analytics",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:null==g?void 0:g.hostname,$mcp_duration_ms:o,$mcp_is_error:!!s},n?{$mcp_error_type:n.type,$mcp_error_message:n.message}:{}),e.intent&&r.intent?{$mcp_intent:r.intent,$mcp_intent_source:"context_parameter"}:{}),e.model&&r.model?{$mcp_llm_model:r.model,$mcp_llm_model_source:"self_reported"}:{}),{timestamp:i})}catch(e){continue}if(s&&n&&d.exceptions&&(null==(a=d.exceptionObserver)?void 0:a.isEnabled))try{let e={$exception_list:(h=d.exceptions,c=n.message,s.errorResult?[{type:"Error",value:c,mechanism:{type:"generic",handled:!0,synthetic:!0,exception_id:0}}]:h.buildProperties(s.error,{handled:!0}).$exception_list.map(e=>ty(ty({},e),{},{value:uk(e.value)}))),$exception_level:"error",$exception_source:"mcp.tool_call",$mcp_interface:"webmcp",$mcp_tool_name:t.name,$mcp_resource_name:t.name,$mcp_tool_description:t.description,$mcp_server_name:null==g?void 0:g.hostname};d.exceptionObserver.captureException(e)}catch(e){}}}}}}));var uM=function(){$.SDK_DIST_CHANNEL="npm";let e=aG[a8]=new li;return function(){function e(){e.done||(e.done=!0,ah=!1,rp(aG,function(e){e._dom_loaded()}))}(null==f?void 0:f.addEventListener)?"complete"===f.readyState?e():rb(f,"DOMContentLoaded",e,{capture:!1}):c&&i6.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}()}}]);
|