posthog-js 1.455.0 → 1.455.1

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.
Files changed (42) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.no-external.js +1 -1
  11. package/dist/customizations.full.js +1 -1
  12. package/dist/customizations.js +1 -1
  13. package/dist/default-extensions.js +1 -1
  14. package/dist/exception-autocapture.d.ts +4 -3
  15. package/dist/exception-autocapture.js +1 -1
  16. package/dist/exception-autocapture.js.map +1 -1
  17. package/dist/extension-bundles.js +1 -1
  18. package/dist/external-scripts-loader.js +1 -1
  19. package/dist/integrity.json +28 -28
  20. package/dist/lazy-recorder.js +1 -1
  21. package/dist/main.js +1 -1
  22. package/dist/module.full.cjs +1 -1
  23. package/dist/module.full.js +1 -1
  24. package/dist/module.full.js.map +1 -1
  25. package/dist/module.full.no-external.cjs +1 -1
  26. package/dist/module.full.no-external.js +1 -1
  27. package/dist/module.full.no-external.js.map +1 -1
  28. package/dist/module.js +1 -1
  29. package/dist/module.mjs +1 -1
  30. package/dist/module.no-external.cjs +1 -1
  31. package/dist/module.no-external.js +1 -1
  32. package/dist/module.slim.js +1 -1
  33. package/dist/module.slim.no-external.js +1 -1
  34. package/dist/posthog-recorder.js +1 -1
  35. package/dist/src/entrypoints/exception-autocapture.d.ts +4 -3
  36. package/dist/surveys-preview.js +1 -1
  37. package/dist/surveys.js +1 -1
  38. package/lib/package.json +1 -1
  39. package/lib/src/entrypoints/exception-autocapture.d.ts +4 -3
  40. package/lib/src/entrypoints/exception-autocapture.js +92 -42
  41. package/lib/src/entrypoints/exception-autocapture.js.map +1 -1
  42. package/package.json +4 -4
@@ -1,4 +1,4 @@
1
- var t,e=["retriesPerformedSoFar"];function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},i.apply(null,arguments)}function r(t,e,i,r,s,n,o){try{var a=t[n](o),h=a.value}catch(t){return void i(t)}a.done?e(h):Promise.resolve(h).then(r,s)}function s(t){return function(){var e=this,i=arguments;return new Promise(function(s,n){var o=t.apply(e,i);function a(t){r(o,s,n,a,h,"next",t)}function h(t){r(o,s,n,a,h,"throw",t)}a(void 0)})}}var n="u">typeof window?window:void 0,o="u">typeof globalThis?globalThis:n,a=null==o?void 0:o.navigator,h=null==o?void 0:o.document,l=null==o?void 0:o.location,u=null==o?void 0:o.fetch,d=null!=o&&o.XMLHttpRequest&&"withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:void 0,v=null==o?void 0:o.AbortController,c=null==o?void 0:o.CompressionStream,_=null==a?void 0:a.userAgent,p="undefined"!=typeof globalThis?globalThis:n;p&&"undefined"==typeof self&&(p.self=p),p&&"undefined"==typeof File&&(p.File=function(){});var f=null!=n?n:{},g="0.14.1",m={DEBUG:!1,LIB_VERSION:g,LIB_NAME:"browser-common",JS_SDK_VERSION:g},b=/*#__PURE__*/function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),y=["$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"],w=["token"];function S(t,e){return-1!==t.indexOf(e)}var x=function(t){return t.replace(/^\$/,"")},E=Object.prototype,T=E.hasOwnProperty,k=E.toString,I=Array.isArray||function(t){return"[object Array]"===k.call(t)},P=t=>"function"==typeof t,O=t=>t===Object(t)&&!I(t),R=t=>{if(O(t)){for(var e in t)if(T.call(t,e))return!1;return!0}return!1},C=t=>void 0===t,A=t=>"[object String]"==k.call(t),M=t=>A(t)&&0===t.trim().length,N=t=>null===t,D=t=>C(t)||N(t),F=t=>"[object Number]"==k.call(t)&&t==t,B=t=>F(t)&&t>0,U=t=>"[object Boolean]"===k.call(t),j=t=>S(y,t),L=t=>S(w,t);function z(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Error)}}var q=[!0,"true",1,"1","yes"],W=t=>S(q,t),H=[!1,"false",0,"0","no"],G=["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","lightpanda","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"],V=/* @__PURE__ */new Map,J=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=function(t,e){for(var i="",r=0;e.length>r;r++){var s=e[r];i+=s.length+":"+s}return t.length+":"+t+"|"+e.length+":"+i}(t,e),r=V.get(i);if(void 0!==r)return r;var s=t.toLowerCase(),n=G.concat(e).some(t=>-1!==s.indexOf(t.toLowerCase()));return 256>V.size||V.clear(),V.set(i,n),n};function K(t,e,i,r,s){return e>i&&(r.warn("min cannot be greater than max."),e=i),F(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+s),K(null!=s?s:i,e,i,r))}var Y="Mobile",X="Android",Q="Tablet",Z="Android Tablet",tt="iPad",et="Apple Watch",it="Safari",rt="BlackBerry",st="Samsung Internet",nt="Chrome",ot="Chrome iOS",at="Internet Explorer",ht="Internet Explorer Mobile",lt="Opera",ut="Microsoft Edge",dt="Firefox",vt="Firefox iOS",ct="Nintendo",_t="PlayStation",pt="Xbox",ft="Android Mobile",gt="Mobile Safari",mt="Windows",bt="Windows Phone",yt="Nokia",wt="Ouya",$t="Generic tablet",St="Konqueror",xt="Oculus Browser",Et="Vivaldi",Tt="Yandex",kt="Whale",It="DuckDuckGo",Pt="Pale Moon",Ot="Waterfox",Rt="Brave",Ct="Claude",At="Codex",Mt="ChatGPT",Nt="Google Search App",Dt=/* @__PURE__ */new RegExp("Version/(\\d+(\\.\\d+)?)"),Ft=/* @__PURE__ */new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Bt=/* @__PURE__ */new RegExp(pt,"i"),Ut=/* @__PURE__ */new RegExp("PlayStation \\w+","i"),jt=/* @__PURE__ */new RegExp("Nintendo \\w+","i"),Lt=/* @__PURE__ */new RegExp("BlackBerry|PlayBook|BB10","i"),zt={"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"},qt=function(t,e,i,r){e=e||"";var s=function(t){return null!=t&&t.brave?Rt:null}(i);return s||(null!=r&&r.detectGoogleSearchApp&&S(t,"GSA/")?Nt:S(t," OPR/")&&S(t,"Mini")?"Opera Mini":S(t," OPR/")?lt:Lt.test(t)?rt:S(t,"IEMobile")||S(t,"WPDesktop")?ht:S(t,"OculusBrowser")?xt:S(t,"SamsungBrowser")?st:S(t,"Edge")||S(t,"Edg/")?ut:S(t,"Vivaldi/")?Et:S(t,"YaBrowser/")?Tt:S(t,"Whale/")?kt:S(t,"DuckDuckGo/")||S(t,"Ddg/")?It:S(t,"Claude/")?Ct:S(t,"Codex/")?At:S(t,"ChatGPT/")?Mt:S(t,"FBIOS")?"Facebook Mobile":S(t,"UCWEB")||S(t,"UCBrowser")?"UC Browser":S(t,"CriOS")?ot:S(t,"CrMo")||S(t,nt)?nt:S(t,X)&&S(t,it)?ft:S(t,"FxiOS")?vt:S(t.toLowerCase(),St.toLowerCase())?St:S(t,"Brave/")?Rt:((t,e)=>e&&S(e,"Apple")||function(t){return S(t,it)&&!S(t,nt)&&!S(t,X)}(t))(t,e)?S(t,Y)?gt:it:S(t,"PaleMoon/")?Pt:S(t,"Waterfox/")?Ot:S(t,dt)?dt:S(t,"MSIE")||S(t,"Trident/")?at:S(t,"Gecko")?dt:"")},Wt={[ht]:[/* @__PURE__ */new RegExp("rv:(\\d+(\\.\\d+)?)")],[ut]:[/* @__PURE__ */new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[nt]:[/* @__PURE__ */new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[ot]:[/* @__PURE__ */new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[/* @__PURE__ */new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[it]:[Dt],[gt]:[Dt],[lt]:[/* @__PURE__ */new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[dt]:[/* @__PURE__ */new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[vt]:[/* @__PURE__ */new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[St]:[/* @__PURE__ */new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[rt]:[/* @__PURE__ */new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Dt],[ft]:[/* @__PURE__ */new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[st]:[/* @__PURE__ */new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[xt]:[/* @__PURE__ */new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Et]:[/* @__PURE__ */new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[Tt]:[/* @__PURE__ */new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[kt]:[/* @__PURE__ */new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Rt]:[/* @__PURE__ */new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Ct]:[Ft],[At]:[Ft],[Mt]:[Ft],[It]:[/* @__PURE__ */new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[Pt]:[/* @__PURE__ */new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[Ot]:[/* @__PURE__ */new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[Nt]:[/* @__PURE__ */new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[at]:[/* @__PURE__ */new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[/* @__PURE__ */new RegExp("rv:(\\d+(\\.\\d+)?)")]},Ht=function(t,e,i,r){var s=Wt[qt(t,e,i,r)];if(C(s))return null;for(var n=0;s.length>n;n++){var o=t.match(s[n]);if(o)return parseFloat(o[o.length-2])}return null},Gt=[[/* @__PURE__ */new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[pt,t&&t[1]||""]],[/* @__PURE__ */new RegExp(ct,"i"),[ct,""]],[/* @__PURE__ */new RegExp(_t,"i"),[_t,""]],[Lt,[rt,""]],[/* @__PURE__ */new RegExp(mt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[bt,""];if(new RegExp(Y).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=zt[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[mt,r]}return[mt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=C(t[2])?t[3]:t[2]),["watchOS",e]}],[/* @__PURE__ */new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[X,[t[2],t[3],t[4]||"0"].join(".")]:[X,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Vt=function(t){return jt.test(t)?ct:Ut.test(t)?_t:Bt.test(t)?pt:new RegExp(wt,"i").test(t)?wt:/* @__PURE__ */new RegExp("(Windows Phone|WPDesktop)","i").test(t)?bt:/iPad/.test(t)?tt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?et:Lt.test(t)?rt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(yt,"i").test(t)?yt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Y).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?X:Z:/* @__PURE__ */new RegExp("(pda|Mobile)","i").test(t)?"Generic mobile":new RegExp(Q,"i").test(t)&&!/* @__PURE__ */new RegExp("Tablet pc","i").test(t)?$t:""},Jt=/\bFBAV\/(\d+(?:\.\d+)*)/i,Kt=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Jt],[/\bFBAN\/EMA\b/i,"Facebook Lite",Jt],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Jt],[/\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"]],Yt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Xt(t,e){return"string"==typeof(i=t)&&Yt.test(i)?t:e();var i}function Qt(t,e){var i=new Error(e);try{Object.defineProperty(i,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return i}function Zt(t){return t?t.split("#")[0]:t}var te,ee=["$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"],ie="NativeGzipValidationError",re=t=>t.length>=2&&31===t[0]&&139===t[1],se=(t,e)=>t===b.GZipJS||e===b.GZipJS||"gzip"===e,ne=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),oe=t=>{throw Qt(ie,"Native gzip produced invalid output: "+t)},ae=0,he=!1,le=/*#__PURE__*/function(){var t=s(function*(t,e){18>t.size&&oe("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());re(i)&&8===i[2]||oe("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer()),s=e.length>>>0;r.getUint32(4,!0)!==s&&oe("invalid-size"),(he||3>ae)&&(r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(te)return te;te=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;te[t]=e>>>0}return te})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&(he=!0,oe("invalid-crc")),ae++)});return function(e,i){return t.apply(this,arguments)}}();function ue(){return ue=s(function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(r).then(()=>o.close()).catch(/*#__PURE__*/function(){var t=s(function*(t){try{yield o.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),h=new Response(n.readable).blob(),l=(yield Promise.all([h,a]))[0];return yield le(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),ue.apply(this,arguments)}var de,ve=function(t,e){var i=(void 0===e?{}:e).debugEnabled,r={N(e){var r;try{r=typeof window>"u"?void 0:window}catch(t){return}for(var s=arguments.length,n=new Array(s>1?s-1:0),o=1;s>o;o++)n[o-1]=arguments[o];r&&(m.DEBUG||r.POSTHOG_DEBUG||i)&&!C(r.console)&&r.console&&("__rrweb_original__"in r.console[e]?r.console[e].__rrweb_original__:r.console[e])(t,...n)},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>ve(t+" "+e,i)};return r},ce=/* @__PURE__ */ve("[PostHog.js]"),_e=(t,e)=>ce.createLogger(t,e),pe={"conversations.js":"sha384-8fPy3IASBzA8AWqnw4GisFo+FugHLE1xLpCaDmKKa+sdTroMj7fsaSQxeJdciOoP","crisp-chat-integration.js":"sha384-qVSPPiM5PHJlVNpiLPyETnf0VXOGevtCqjm2K8EmWnKpLQnY/TMu+iLJ8wWLW8iA","dead-clicks-autocapture.js":"sha384-MYefNCyD6/XLhTOKa8DavuGsgGJvAJO/X4iqoFkAqgGk7H9qgcIoysU9F2qVGMk1","exception-autocapture.js":"sha384-Ot3PAv2xl7Vye6W3KF/aQEiQCB6EmsnQVaLKN/6s0WyUBnPoJUdyyEzh1gGYgqGY","intercom-integration.js":"sha384-gWEoUxf+HEPSZ4GZthxep/3LlEectgXxzj8uWkW7dnvRRV6AKkHXtZEmcb0OqOvn","lazy-recorder.js":"sha384-wvfcx3cUmMBWsygl+eSTZvGBcUaZjgCJcoYUNRc+gUcUy8NfZZV11pqEVwCQ975g","logs.js":"sha384-HGXa+FeVH5JwY3bwubM1EJrP+LG95rh6oU9TbtzHZLs1ECpl5mCXv5FcYF8SgNjk","product-tours.js":"sha384-TlWlQfnDBI1yB3+CuhSTePe38C4bKqQwtK1m0/T6kk/EAsKbWvIya0UeuVkDmSV7","recorder.js":"sha384-t08QiFh+RHB6Jdz9IrPZ5yxf3Dzwdz92Mz0l8Ga/nox8o5+oO0I0gosm16hHDlCF","surveys.js":"sha384-YzGVGUYhh29eFCBFPwTkXhwXFO/T1ZmnwGr4caQVpv1GZg84B0VxXGH7LlB2Gw7g","tracing-headers.js":"sha384-Zb7V2jbC5lJGl7yFzBe8HpCvO3xgJln/lEcqY5xAQ9Z1LLCnbi2glbsfvRPRIYcD","web-vitals-soft-navs.js":"sha384-recN8i2tLQWaeNtCAnErAmFlgg4+33FAHvs8l84aE+SHr6oqLAPwhFVZdP4SfKT6","web-vitals-with-attribution-soft-navs.js":"sha384-f9L4YQQre9lKeUzyvy2Kt4dHLIXECipeMmbr7SPQAOqLi+ZCHbh1I1g/OwsK/zrp","web-vitals-with-attribution.js":"sha384-QVSLDmgzPE1K6g6gBB8QKx/YDQbI2ot0gAcajFIAkGf34SWA3oe6m+WzcmbzpVjD","web-vitals.js":"sha384-wNvgQ2MIesvfVwpUOblaIO/5weiMjR0Ld1eSNtW14MURV24BwfW8Svo6TsBJ3Bk9"},fe=/^sha384-[A-Za-z0-9+/]{64}$/,ge=t=>{var e;return null!=t&&t.config.require_subresource_integrity?t.__loadExternalDependency:null==(e=f.__PosthogExtensions__)?void 0:e.loadExternalDependency},me=_e("[ExternalScriptsLoader]"),be=t=>{var e=null==h?void 0:h.querySelectorAll("script");if(e)for(var i=0;e.length>i;i++)if(e[i].src===t||e[i].getAttribute("src")===t)return e[i]},ye=(t,e,i)=>{i?me.critical(e):me.warn(e),t(e)},we=(t,e,i,r)=>{if(t.config.disable_external_dependency_loading)return me.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=()=>{if(null==h||h.removeEventListener("DOMContentLoaded",s),t.config.disable_external_dependency_loading)return i("Loading of external scripts is disabled");if(!h)return i("document not found");var o=h.createElement("script");if(o.type="text/javascript",o.crossOrigin="anonymous",r&&(o.integrity=r),o.src=e,o.onload=t=>{o.__posthog_loading_callback_fired=!0,i(void 0,t)},o.onerror=t=>{o.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(o=t.config.prepare_external_dependency_script(o)),!o)return i("prepare_external_dependency_script returned null");if(r&&(!o.src||o.integrity!==r||"anonymous"!==o.crossOrigin))return ye(i,"prepare_external_dependency_script must keep src, integrity and crossOrigin 'anonymous' for "+e,!0);if(t.config.disable_external_dependency_loading)return i("Loading of external scripts is disabled");var a=be(o.src);if(a){if(a.integrity!==o.integrity||a.crossOrigin!==o.crossOrigin||a.nonce!==o.nonce)return i("Existing script conflicts with prepared script policy");if(a.__posthog_loading_callback_fired)return i();var l=a.__posthog_loading_error;return l?i(l):(a.addEventListener("load",t=>{a.__posthog_loading_callback_fired=!0,i(void 0,t)}),void a.addEventListener("error",t=>{a.__posthog_loading_error=t,i(t)}))}if(!h.body)return n();if("head"===t.config.external_scripts_inject_target)h.head.appendChild(o);else{var u,d=h.querySelectorAll("body > script");d.length>0?null==(u=d[0].parentNode)||u.insertBefore(o,d[0]):h.body.appendChild(o)}},n=()=>{null==h||h.addEventListener("DOMContentLoaded",s)};null!=h&&h.body||be(e)?s():n()},$e={},Se=(t,e)=>{var i="/static/"+e+".js?v="+t.version;if("toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",i)};f.__PosthogExtensions__=f.__PosthogExtensions__||{};var xe=(t,e,i)=>{if(t.config.require_subresource_integrity){if("remote-config"===e||"toolbar"===e)return ye(i,e+" can't be integrity-verified, so it is not loaded with require_subresource_integrity");if(!h||!("integrity"in h.createElement("script")))return ye(i,"This browser does not support Subresource Integrity",!0);var r=e+".js",s=pe[r];return A(s)&&fe.test(s)?void we(t,t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+r),i,s):ye(i,"No integrity hash for "+r,!0)}if("remote-config"!==e){var n=t.config.strict_script_versioning;if(n){var o=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),a=$e[o];if("fallback"===n&&a){if(be(a))return void we(t,a,i);delete $e[o]}we(t,o,"fallback"===n?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var n,a=Se(t,e);$e[o]=a;var h=be(o);null==h||null==(n=h.parentNode)||n.removeChild(h),we(t,a,i)}else i(void 0,s)}:i)}else we(t,Se(t,e),i)}else we(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)};de=xe,f.__PosthogExtensions__.loadExternalDependency=xe,f.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{if(t.config.require_subresource_integrity)return ye(i,"Site apps can't be integrity-verified, so "+e+" is not loaded with require_subresource_integrity");we(t,t.requestRouter.endpointFor("api",e),i)},m.DEBUG=!1,m.LIB_VERSION="1.455.0",m.LIB_NAME="web";var Ee=m,Te="$early_access_features",ke="$active_feature_flags",Ie="$feature_flag_details",Pe="$feature_flag_errors",Oe="$feature_flag_evaluated_at",Re="$feature_flag_request_id",Ce="$minimal_flag_called_events",Ae="$enabled_feature_flags",Me="$stored_group_properties",Ne="$stored_person_properties",De="$flag_call_reported",Fe="$flag_call_reported_session_id",Be="$feature_flag_payloads",Ue="$override_feature_flags",je="$override_feature_flag_payloads",Le="visibilitychange",ze="$autocapture_disabled_server_side",qe="$surveys",We="$surveys_loaded_at",He="$surveys_activated",Ge="$surveys_activated_session",Ve="$surveys_activated_timestamps",Je="$people_distinct_id",Ke="distinct_id",Ye="$device_id",Xe="$device_model",Qe="__alias",Ze="__cmpns",ti="$fbc",ei="$fbc_persistence",ii="$fbp",ri="$fbp_persistence",si="__timers",ni="$heatmaps_enabled_server_side",oi="$exception_capture_enabled_server_side",ai="$error_tracking_suppression_rules",hi="$error_tracking_capture_extension_exceptions",li="$web_vitals_enabled_server_side",ui="$dead_clicks_enabled_server_side",di="$product_tours_enabled_server_side",vi="$logs_capture_enabled_server_side",ci="$web_vitals_allowed_metrics",_i="$session_recording_remote_config",pi="$session_recording_enabled_server_side",fi="$replay_sample_rate",gi="$replay_override_sampling",mi="$replay_override_linked_flag",bi="$replay_override_url_trigger",yi="$replay_override_event_trigger",wi="$sesid",$i="$session_is_sampled",Si="$session_past_minimum_duration",xi="$session_recording_url_trigger_activated_session",Ei="$session_recording_event_trigger_activated_session",Ti="$debug_first_full_snapshot_timestamp",ki="$sess_rec_flush_size",Ii="$groups",Pi="ph_product_tours",Oi="$product_tours_activated",Ri="$product_tours_activated_session",Ci="$conversations_widget_session_id",Ai="$conversations_ticket_id",Mi="$conversations_widget_state",Ni="$conversations_user_traits",Di="$user_state",Fi="$client_session_props",Bi="$capture_rate_limit",Ui="$initial_campaign_params",ji="$initial_referrer_info",Li="$initial_person_info",zi="$epp",qi="$posthog_cookieless",Wi="$cookieless_mode",Hi="$sdk_debug_extensions_init_method",Gi="$sdk_debug_extensions_init_time_ms",Vi="$sdk_debug_recording_script_not_loaded",Ji="$sdk_debug_replay_stale_config",Ki="$sdk_debug_replay_event_trigger_status",Yi="$sdk_debug_replay_linked_flag_trigger_status",Xi="$sdk_debug_replay_matched_recording_trigger_groups",Qi="$sdk_debug_replay_pending_trigger_conditions",Zi="$sdk_debug_replay_remote_trigger_matching_config",tr="$sdk_debug_replay_trigger_groups_count",er="$sdk_debug_replay_url_trigger_status",ir="$session_recording_start_reason",rr="anonymous",sr="identified",nr="identified_only",or="beforeunload",ar="$pageview",hr="$pageleave",lr="$identify",ur="$groupidentify";function dr(t,e){I(t)&&t.forEach(e)}function vr(t,e){if(!D(t))if(I(t))t.forEach(e);else if((t=>t instanceof FormData)(t))t.forEach((t,i)=>e(t,i));else for(var i in t)T.call(t,i)&&e(t[i],i)}var cr=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var s of i)for(var n in s)void 0!==s[n]&&(t[n]=s[n]);return t},_r=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){ce.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ce.critical(t)}}},pr=function(t){var e={};return vr(t,function(t,i){(A(t)&&t.length>0||F(t))&&(e[i]=t)}),e};function fr(t){var e=i({},t);for(var r of["name","message","stack","cause","errors"])try{r in t&&(e[r]=t[r])}catch(t){}return e}var gr=["herokuapp.com","vercel.app","netlify.app"];function mr(t){var e=null==t?void 0:t.hostname;if(!A(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of gr)if(i===r)return!1;return!0}function br(t,e,i,r){var s=null!=r?r:{},n=s.capture,o=s.passive;null==t||t.addEventListener(e,i,{capture:void 0!==n&&n,passive:void 0===o||o})}var yr,wr,$r=t=>{if(h){try{for(var e=t+"=",i=h.cookie.split(";").filter(t=>t.length),r=0;i.length>r;r++){for(var s=i[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(e))return decodeURIComponent(s.substring(e.length,s.length))}}catch(t){}return null}},Sr=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,i,r,s){if(!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>i||0>r||0>s||e>0xffffffffffff||i>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var n=/* @__PURE__ */new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/256,n[5]=e,n[6]=112|i>>>8,n[7]=i,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new t(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new t(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}},xr=class{generate(){var t=this.generateOrAbort();if(!C(t))return t;this.Mt=0;var e=this.generateOrAbort();if(C(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=(()=>{var t=Date.now();return F(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(t>this.Mt)this.Mt=t,this.Tt();else{if(this.Mt>=t+1e4)return;this.It++,this.It>4398046511103&&(this.Mt++,this.Tt())}return Sr.fromFieldsV7(this.Mt,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.At.nextUint32())}Tt(){this.It=1024*this.At.nextUint32()+(1023&this.At.nextUint32())}constructor(){this.Mt=0,this.It=0,this.At=new Tr}},Er=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t},Tr=class{nextUint32(){return this.Rt.length>this.Et||((null!=yr?yr:yr="u">typeof window&&!C(window.crypto)&&crypto.getRandomValues?t=>{try{return crypto.getRandomValues(t)}catch(e){return Er(t)}}:Er)(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=/* @__PURE__ */new Uint32Array(8),this.Et=1/0}},kr=()=>Ir().toString(),Ir=()=>(wr||(wr=new xr)).generate(),Pr="",Or=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Rr=null,Cr={Ot(){if(!N(Rr))return Rr;if(Rr=!1,h)try{var t="__ph_cookie_support_"+kr();Cr.$t(t,"xyz"),Rr='"xyz"'===$r(t),Cr.Dt(t)}catch(t){Rr=!1}return Rr},Ft(t){ce.error("cookieStore error: "+t)},Lt:$r,Pt(t){var e;try{e=JSON.parse(Cr.Lt(t))||{}}catch(t){}return e},$t(t,e,i,r,s){if(!h)return!1;try{var n="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=h),Pr)return Pr;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),s="dmn_chk_"+kr();!Pr&&r--;){var n=i.slice(r).join("."),o=s+"=1;domain=."+n+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(s)&&(e.cookie=o+";max-age=0",Pr=n)}return Pr}(t);if(!i){var r=(t=>{var e=t.match(Or);return e?e[0]:""})(t);r!==i&&ce.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(h.location.hostname,r);if(i){var l=/* @__PURE__ */new Date;l.setTime(l.getTime()+864e5*i),n="; expires="+l.toUTCString()}s&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ce.warn("cookieStore warning: large cookie, len="+u.length),h.cookie=u,!0}catch(t){return!1}},Dt(t,e){if(null!=h&&h.cookie&&(!e||!N($r(t))))try{Cr.$t(t,"",-1,e)}catch(t){return}}},Ar=null,Mr={Ot(){if(!N(Ar))return Ar;var t=!0;if(C(n))t=!1;else try{var e="__mplssupport__";Mr.$t(e,"xyz"),'"xyz"'!==Mr.Lt(e)&&(t=!1),Mr.Dt(e)}catch(e){t=!1}return t||ce.error("localStorage unsupported; falling back to cookie store"),Ar=t,t},Ft(t){ce.error("localStorage error: "+t)},Lt(t){try{return null==n?void 0:n.localStorage.getItem(t)}catch(t){Mr.Ft(t)}return null},Pt(t){try{return JSON.parse(Mr.Lt(t))||{}}catch(t){}return null},$t(t,e){try{return null==n||n.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Mr.Ft(t)}return!1},Dt(t){try{null==n||n.localStorage.removeItem(t)}catch(t){Mr.Ft(t)}}},Nr=[Ne,ke,Ae,Ie,Be,Re,Oe,Pe,De],Dr=[Ye,Ke,wi,$i,zi,Li,ei,Di],Fr=t=>t+"_cpm",Br=["__proto__","constructor","prototype"],Ur=t=>{if(!O(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===Br.indexOf(i)&&(e[i]=t[i])}),e},jr=function(t,e){void 0===e&&(e=[]);var i={};return[...Dr,...e].forEach(e=>{var r=t[e];C(r)||N(r)||""===r||(i[e]=r)}),i},Lr=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var s=t.charCodeAt(r);e=33*e^s,i=Math.imul(i^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},zr=(t,e)=>({p:e,f:Lr(JSON.stringify(t))}),qr=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=Cr.Pt(Fr(t)),r=(null==i?void 0:i.f)===Lr(e)&&I(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Wr=(t,e)=>e+"|"+(Cr.Lt(Fr(t))||""),Hr={},Gr={Ot:()=>!0,Ft(t){ce.error("memoryStorage error: "+t)},Lt:t=>t in Hr?Hr[t]:null,Pt:t=>t in Hr?Hr[t]:null,$t:(t,e)=>(Hr[t]=e,!0),Dt(t){delete Hr[t]}},Vr=null,Jr={Ot(){if(!N(Vr))return Vr;if(Vr=!0,C(n))Vr=!1;else try{var t="__support__";Jr.$t(t,"xyz"),'"xyz"'!==Jr.Lt(t)&&(Vr=!1),Jr.Dt(t)}catch(t){Vr=!1}return Vr},Ft(t){ce.error("sessionStorage error: ",t)},Lt(t){try{return null==n?void 0:n.sessionStorage.getItem(t)}catch(t){Jr.Ft(t)}return null},Pt(t){try{return JSON.parse(Jr.Lt(t))||null}catch(t){}return null},$t(t,e){try{return null==n||n.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Jr.Ft(t)}return!1},Dt(t){try{null==n||n.sessionStorage.removeItem(t)}catch(t){Jr.Ft(t)}}},Kr=class{constructor(t){this._instance=t}get Yr(){return this._instance.config}get consent(){return this.eu()?0:this.iu}isOptedOut(){return"always"===this.Yr.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Yr.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Yr.opt_out_capturing_by_default}optInOut(t){this.nu.$t(this.su,t?1:0,this.Yr.cookie_expiration,this.Yr.cross_subdomain_cookie,this.Yr.secure_cookie)}reset(){this.nu.Dt(this.su,this.Yr.cross_subdomain_cookie)}get su(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get iu(){var t=this.nu.Lt(this.su);return W(t)?1:S(H,t)?0:-1}get nu(){var t=this.Yr.opt_out_capturing_persistence_type,e="localStorage"===t?Mr:Cr,i=e.Ot()?e:Gr;if(!this.ru||this.ru!==i){this.ru=i;var r="localStorage"===t?Cr:Mr;r.Lt(this.su)&&(this.ru.Lt(this.su)||this.optInOut(W(r.Lt(this.su))),r.Dt(this.su,this.Yr.cross_subdomain_cookie))}return this.ru}eu(){return!!this.Yr.respect_dnt&&[null==a?void 0:a.doNotTrack,null==a?void 0:a.msDoNotTrack,f.doNotTrack,null==a?void 0:a.globalPrivacyControl].some(t=>W(t))}},Yr=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],Xr=/* @__PURE__ */(()=>[...Yr,"+","-","−","–"])(),Qr=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(ui)),r=t.instance.config.capture_dead_clicks;return U(r)?r:!!O(r)||i},Zr=_e("[SegmentIntegration]");function ts(t,e,r){void 0===r&&(r=!0);var s=t.config.segment;if(!s)return e();var n,o=(t=>P(t.register))(n=s)?{analytics:n}:n,a=o.analytics,h=o.filterProperties;!function(t,e,i,r){var s=e=>{var s=()=>e.anonymousId()||kr();t.config.get_device_id=s,r&&e.id()&&(t.register({distinct_id:e.id(),$device_id:s()}),t.persistence.set_property(Di,sr)),i(r?void 0:e.anonymousId()||void 0)},n=e.user();"then"in n&&P(n.then)?n.then(s):s(n)}(t,a,r=>{a.register(function(t,e,r){var s=(void 0===r?{}:r).filterProperties;"undefined"!=typeof Promise&&Promise.resolve||Zr.warn("This browser does not have Promise support, and can not use the segment integration");var n=(r,n)=>{if(!n)return r;var o=!!e&&r.event.anonymousId===e&&!r.event.userId;o||r.event.userId||r.event.anonymousId===t.get_distinct_id()||(Zr.info("No userId set, resetting PostHog"),t.reset()),o||(e=void 0),r.event.userId&&r.event.userId!==t.get_distinct_id()&&(Zr.info("UserId set, identifying with PostHog"),t.identify(r.event.userId));var a=t.calculateEventProperties(n,r.event.properties);if(!D(s)){var h=r.event.properties||{},l={};for(var u of Object.keys(a))T.call(h,u)||(l[u]=a[u]);var d=((t,e)=>{var r=I(t)?t:[t],s=i({},e);for(var n of r)try{if(s=n(s),D(s))return null}catch(t){return Zr.error("Error in Segment filterProperties:",t),null}return s})(s,l);if(D(d))return r;a=d}return r.event.properties=Object.assign({},a,r.event.properties),r};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return n(t,t.event.event)},page(t){return n(t,ar)},identify(t){return n(t,lr)},screen(t){return n(t,"$screen")}}}(t,r,{filterProperties:h})).then(()=>{e()},t=>{Zr.error("Failed to register the Segment integration",t),e()})},r)}var es="posthog-js";function is(t,e){var r=void 0===e?{}:e,s=r.organization,n=r.projectId,o=r.prefix,a=r.severityAllowList,h=void 0===a?["error"]:a,l=r.sendExceptionsToPostHog,u=void 0===l||l;return e=>{var r,a,l,d,v,c;if("*"!==h&&!h.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var _=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=_,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var p=(null==(r=e.exception)?void 0:r.values)||[],f=p.map(t=>i({},t,{stacktrace:t.stacktrace?i({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map(t=>i({},t,{platform:"web:javascript"}))}):void 0})),g={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(l=p[0])?void 0:l.type,$exception_level:e.level,$exception_list:f,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(v=p[0])?void 0:v.type,$sentry_tags:e.tags};return s&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+s+"/issues/?project="+n+"&query="+e.event_id),u&&(null==(c=t.exceptions)||c.sendExceptionEvent(g)),e}}var rs=class{constructor(t,e,i,r,s,n){this.name=es,this.setupOnce=function(o){o(is(t,{organization:e,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}},ss=class{constructor(t){this.uu=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ce.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.cu=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.hu()}hu(){var t;this.du=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.uu)}destroy(){var t;null==(t=this.du)||t.call(this),this.du=void 0}doPageView(t,e){var i,r=this.vu(t,e);return this.cu={pathname:null!==(i=null==n?void 0:n.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.vu(t,null==(e=this.cu)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.cu)?void 0:t.pageViewId}}vu(t,e){var i=this.cu;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var n=s.maxScrollHeight,o=s.lastScrollY,a=s.maxScrollY,h=s.maxContentHeight,l=s.lastContentY,u=s.maxContentY;if(!(C(n)||C(o)||C(a)||C(h)||C(l)||C(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),h=Math.ceil(h),l=Math.ceil(l),u=Math.ceil(u);var d=n>1?K(o/n,0,1,ce):1,v=n>1?K(a/n,0,1,ce):1,c=h>1?K(l/h,0,1,ce):1,_=h>1?K(u/h,0,1,ce):1;r=cr(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}},ns=["flags","surveys"],os={[Je]:{exposure:"hidden"},[Qe]:{exposure:"hidden"},[Ze]:{exposure:"hidden"},[si]:{exposure:"hidden"},[ei]:{exposure:"hidden"},[ri]:{exposure:"hidden"},[ze]:{exposure:"event"},[ni]:{exposure:"hidden"},[vi]:{exposure:"hidden"},[oi]:{exposure:"event"},[ai]:{exposure:"hidden"},[hi]:{exposure:"event"},[li]:{exposure:"event"},[ui]:{exposure:"event"},[di]:{exposure:"hidden"},[ci]:{exposure:"event"},[_i]:{exposure:"hidden"},[pi]:{exposure:"hidden"},[wi]:{exposure:"hidden"},[$i]:{exposure:"event"},[fi]:{exposure:"event",shouldSkipFromEventProperties:t=>N(t)},[Si]:{exposure:"event"},[xi]:{exposure:"event"},[Ei]:{exposure:"event"},[Ti]:{exposure:"event"},[ki]:{exposure:"hidden"},[Ae]:{exposure:"hidden",storageGroup:"flags"},[ke]:{exposure:"hidden",storageGroup:"flags"},[Te]:{exposure:"hidden"},[Ie]:{exposure:"hidden",storageGroup:"flags"},[Be]:{exposure:"hidden",storageGroup:"flags"},[Re]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ce]:{exposure:"hidden",storageGroup:"flags"},[Ue]:{exposure:"hidden"},[je]:{exposure:"hidden"},[Ne]:{exposure:"hidden"},[Me]:{exposure:"hidden"},[qe]:{exposure:"hidden",storageGroup:"surveys"},[We]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[He]:{exposure:"event"},[Ge]:{exposure:"hidden"},[Ve]:{exposure:"hidden"},[Pi]:{exposure:"hidden"},[Oi]:{exposure:"hidden"},[Ri]:{exposure:"hidden"},[Ci]:{exposure:"event"},[Ai]:{exposure:"event"},[Mi]:{exposure:"event"},[Ni]:{exposure:"event"},[De]:{exposure:"hidden"},[Fe]:{exposure:"hidden"},[Ii]:{exposure:"event"},[Pe]:{exposure:"hidden"},[Oe]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Di]:{exposure:"hidden"},[Fi]:{exposure:"hidden"},[Bi]:{exposure:"hidden"},[Ui]:{exposure:"hidden"},[ji]:{exposure:"hidden"},[Li]:{exposure:"hidden"},[zi]:{exposure:"hidden"},[gi]:{exposure:"event"},[mi]:{exposure:"event"},[bi]:{exposure:"event"},[yi]:{exposure:"event"},[Hi]:{exposure:"event"},[Gi]:{exposure:"event"},[Vi]:{exposure:"hidden"},[Ji]:{exposure:"hidden"},[Ki]:{exposure:"hidden"},[Yi]:{exposure:"hidden"},[Xi]:{exposure:"hidden"},[Qi]:{exposure:"hidden"},[Zi]:{exposure:"hidden"},[tr]:{exposure:"hidden"},[er]:{exposure:"hidden"},[ir]:{exposure:"event"}},as=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],hs=t=>{var e=os[t];if(e)return e;for(var i of as){var r=i[1];if(0===t.indexOf(i[0]))return r}};function ls(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}var us=t=>{var e,i=null==(e=typeof document>"u"?void 0:document)?void 0:e.createElement("a");return C(i)?null:(i.href=t,i)},ds=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>z(e)?(null!=i||(i=/* @__PURE__ */new WeakMap),i.has(e)||i.set(e,fr(e)),i.get(e)):"bigint"==typeof e?e.toString():e,e)}catch(e){return s=[],null!==(r=JSON.stringify(t,function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(e))return"[Circular]";s.push(e)}return e}}))&&void 0!==r?r:"null"}var r,s},vs=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var n=r[s].split(/=(.*)/);if(n[0]===e){i=n;break}}if(!I(i)||2>i.length)return"";var o=i[1].replace(/\+/g," ");try{o=decodeURIComponent(o)}catch(t){ce.error("Skipping decoding for malformed query param: "+o)}return o},cs=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split(/#(.*)/),s=r[1],n=(r[0]||"").split(/\?(.*)/),o=n[1],a=n[0],h=(o||"").split("&"),l=[],u=0;h.length>u;u++){for(var d=h[u].split("?"),v=0;d.length>v&&!e.includes(d[v].split("=")[0]);)v++;l.push(d.length>v?d.slice(0,v).concat(d[v].split("=")[0]+"="+i).join("?"):h[u])}var c=a;return null!=o&&(c+="?"+l.join("&")),null!=s&&(c+="#"+s),c},_s=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],ps=["ScCid","SsCid"],fs={sccid:ps},gs=/* @__PURE__ */(()=>[..._s,...ps,"sscid"])(),ms=/* @__PURE__ */(()=>["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",..._s])(),bs="<masked>",ys=["li_fat_id"];function ws(t,e){var i=ms.concat(e||[]),r={};return vr(i,function(e){var i=vs(t,e);!i&&T.call(fs,e)&&dr(fs[e],function(e){i=i||vs(t,e)}),r[e]=i||null}),r}function $s(t){var e=function(t){return t?0===t.search("https?://(.*)google.([^/?]*)")?"google":0===t.search("https?://(.*)bing.com")?"bing":0===t.search("https?://(.*)yahoo.com")?"yahoo":0===t.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!N(e)){r.$search_engine=e;var s=h?vs(h.referrer,i):"";s.length&&(r.ph_keyword=s)}return r}function Ss(){return navigator.language||navigator.userLanguage}var xs="$direct";function Es(){return(null==h?void 0:h.referrer)||xs}function Ts(t,e,i){var r;void 0===i&&(i=!1);var s=t?[...gs,...e||[]]:[],n=null==(r=i?Zt(null==l?void 0:l.href):null==l?void 0:l.href)?void 0:r.substring(0,1e3);return{r:Es().substring(0,1e3),u:n?cs(n,s,bs):void 0}}function ks(t,e,i,r){var s;void 0===e&&(e=!1);var n=t.r,o=t.u,a=e?Zt(o):o,h=a&&i?cs(a,[...gs,...r||[]],bs):a,l={$referrer:n,$referring_domain:null==n?void 0:n==xs?xs:null==(s=us(n))?void 0:s.host};if(h){l.$current_url=h;var u=us(h);l.$host=null==u?void 0:u.host,l.$pathname=null==u?void 0:u.pathname,cr(l,ws(h))}return n&&cr(l,$s(n)),l}function Is(){try{/* @__PURE__ */
1
+ var t,e=["retriesPerformedSoFar"];function i(){return i=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var i=arguments[e];for(var r in i)({}).hasOwnProperty.call(i,r)&&(t[r]=i[r])}return t},i.apply(null,arguments)}function r(t,e,i,r,s,n,o){try{var a=t[n](o),h=a.value}catch(t){return void i(t)}a.done?e(h):Promise.resolve(h).then(r,s)}function s(t){return function(){var e=this,i=arguments;return new Promise(function(s,n){var o=t.apply(e,i);function a(t){r(o,s,n,a,h,"next",t)}function h(t){r(o,s,n,a,h,"throw",t)}a(void 0)})}}var n="u">typeof window?window:void 0,o="u">typeof globalThis?globalThis:n,a=null==o?void 0:o.navigator,h=null==o?void 0:o.document,l=null==o?void 0:o.location,u=null==o?void 0:o.fetch,d=null!=o&&o.XMLHttpRequest&&"withCredentials"in new o.XMLHttpRequest?o.XMLHttpRequest:void 0,v=null==o?void 0:o.AbortController,c=null==o?void 0:o.CompressionStream,_=null==a?void 0:a.userAgent,p="undefined"!=typeof globalThis?globalThis:n;p&&"undefined"==typeof self&&(p.self=p),p&&"undefined"==typeof File&&(p.File=function(){});var f=null!=n?n:{},g="0.14.1",m={DEBUG:!1,LIB_VERSION:g,LIB_NAME:"browser-common",JS_SDK_VERSION:g},b=/*#__PURE__*/function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),y=["$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"],w=["token"];function S(t,e){return-1!==t.indexOf(e)}var x=function(t){return t.replace(/^\$/,"")},E=Object.prototype,T=E.hasOwnProperty,k=E.toString,I=Array.isArray||function(t){return"[object Array]"===k.call(t)},P=t=>"function"==typeof t,O=t=>t===Object(t)&&!I(t),R=t=>{if(O(t)){for(var e in t)if(T.call(t,e))return!1;return!0}return!1},C=t=>void 0===t,A=t=>"[object String]"==k.call(t),M=t=>A(t)&&0===t.trim().length,N=t=>null===t,D=t=>C(t)||N(t),F=t=>"[object Number]"==k.call(t)&&t==t,B=t=>F(t)&&t>0,U=t=>"[object Boolean]"===k.call(t),j=t=>S(y,t),L=t=>S(w,t);function z(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Error)}}var q=[!0,"true",1,"1","yes"],W=t=>S(q,t),H=[!1,"false",0,"0","no"],G=["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","lightpanda","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"],V=/* @__PURE__ */new Map,J=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=function(t,e){for(var i="",r=0;e.length>r;r++){var s=e[r];i+=s.length+":"+s}return t.length+":"+t+"|"+e.length+":"+i}(t,e),r=V.get(i);if(void 0!==r)return r;var s=t.toLowerCase(),n=G.concat(e).some(t=>-1!==s.indexOf(t.toLowerCase()));return 256>V.size||V.clear(),V.set(i,n),n};function K(t,e,i,r,s){return e>i&&(r.warn("min cannot be greater than max."),e=i),F(t)?t>i?(r.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e>t?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+s),K(null!=s?s:i,e,i,r))}var Y="Mobile",X="Android",Q="Tablet",Z="Android Tablet",tt="iPad",et="Apple Watch",it="Safari",rt="BlackBerry",st="Samsung Internet",nt="Chrome",ot="Chrome iOS",at="Internet Explorer",ht="Internet Explorer Mobile",lt="Opera",ut="Microsoft Edge",dt="Firefox",vt="Firefox iOS",ct="Nintendo",_t="PlayStation",pt="Xbox",ft="Android Mobile",gt="Mobile Safari",mt="Windows",bt="Windows Phone",yt="Nokia",wt="Ouya",$t="Generic tablet",St="Konqueror",xt="Oculus Browser",Et="Vivaldi",Tt="Yandex",kt="Whale",It="DuckDuckGo",Pt="Pale Moon",Ot="Waterfox",Rt="Brave",Ct="Claude",At="Codex",Mt="ChatGPT",Nt="Google Search App",Dt=/* @__PURE__ */new RegExp("Version/(\\d+(\\.\\d+)?)"),Ft=/* @__PURE__ */new RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),Bt=/* @__PURE__ */new RegExp(pt,"i"),Ut=/* @__PURE__ */new RegExp("PlayStation \\w+","i"),jt=/* @__PURE__ */new RegExp("Nintendo \\w+","i"),Lt=/* @__PURE__ */new RegExp("BlackBerry|PlayBook|BB10","i"),zt={"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"},qt=function(t,e,i,r){e=e||"";var s=function(t){return null!=t&&t.brave?Rt:null}(i);return s||(null!=r&&r.detectGoogleSearchApp&&S(t,"GSA/")?Nt:S(t," OPR/")&&S(t,"Mini")?"Opera Mini":S(t," OPR/")?lt:Lt.test(t)?rt:S(t,"IEMobile")||S(t,"WPDesktop")?ht:S(t,"OculusBrowser")?xt:S(t,"SamsungBrowser")?st:S(t,"Edge")||S(t,"Edg/")?ut:S(t,"Vivaldi/")?Et:S(t,"YaBrowser/")?Tt:S(t,"Whale/")?kt:S(t,"DuckDuckGo/")||S(t,"Ddg/")?It:S(t,"Claude/")?Ct:S(t,"Codex/")?At:S(t,"ChatGPT/")?Mt:S(t,"FBIOS")?"Facebook Mobile":S(t,"UCWEB")||S(t,"UCBrowser")?"UC Browser":S(t,"CriOS")?ot:S(t,"CrMo")||S(t,nt)?nt:S(t,X)&&S(t,it)?ft:S(t,"FxiOS")?vt:S(t.toLowerCase(),St.toLowerCase())?St:S(t,"Brave/")?Rt:((t,e)=>e&&S(e,"Apple")||function(t){return S(t,it)&&!S(t,nt)&&!S(t,X)}(t))(t,e)?S(t,Y)?gt:it:S(t,"PaleMoon/")?Pt:S(t,"Waterfox/")?Ot:S(t,dt)?dt:S(t,"MSIE")||S(t,"Trident/")?at:S(t,"Gecko")?dt:"")},Wt={[ht]:[/* @__PURE__ */new RegExp("rv:(\\d+(\\.\\d+)?)")],[ut]:[/* @__PURE__ */new RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[nt]:[/* @__PURE__ */new RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[ot]:[/* @__PURE__ */new RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[/* @__PURE__ */new RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[it]:[Dt],[gt]:[Dt],[lt]:[/* @__PURE__ */new RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[dt]:[/* @__PURE__ */new RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[vt]:[/* @__PURE__ */new RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[St]:[/* @__PURE__ */new RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[rt]:[/* @__PURE__ */new RegExp("BlackBerry (\\d+(\\.\\d+)?)"),Dt],[ft]:[/* @__PURE__ */new RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[st]:[/* @__PURE__ */new RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[xt]:[/* @__PURE__ */new RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[Et]:[/* @__PURE__ */new RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[Tt]:[/* @__PURE__ */new RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[kt]:[/* @__PURE__ */new RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[Rt]:[/* @__PURE__ */new RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[Ct]:[Ft],[At]:[Ft],[Mt]:[Ft],[It]:[/* @__PURE__ */new RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[Pt]:[/* @__PURE__ */new RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[Ot]:[/* @__PURE__ */new RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[Nt]:[/* @__PURE__ */new RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[at]:[/* @__PURE__ */new RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[/* @__PURE__ */new RegExp("rv:(\\d+(\\.\\d+)?)")]},Ht=function(t,e,i,r){var s=Wt[qt(t,e,i,r)];if(C(s))return null;for(var n=0;s.length>n;n++){var o=t.match(s[n]);if(o)return parseFloat(o[o.length-2])}return null},Gt=[[/* @__PURE__ */new RegExp("Xbox; Xbox (.*?)[);]","i"),t=>[pt,t&&t[1]||""]],[/* @__PURE__ */new RegExp(ct,"i"),[ct,""]],[/* @__PURE__ */new RegExp(_t,"i"),[_t,""]],[Lt,[rt,""]],[/* @__PURE__ */new RegExp(mt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[bt,""];if(new RegExp(Y).test(e)&&!/IEMobile\b/.test(e))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=zt[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[mt,r]}return[mt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?["iOS",[t[3],t[4],t[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=C(t[2])?t[3]:t[2]),["watchOS",e]}],[/* @__PURE__ */new RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),t=>t&&t[2]?[X,[t[2],t[3],t[4]||"0"].join(".")]:[X,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];return t&&t[1]&&(e[1]=[t[1],t[2],t[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],Vt=function(t){return jt.test(t)?ct:Ut.test(t)?_t:Bt.test(t)?pt:new RegExp(wt,"i").test(t)?wt:/* @__PURE__ */new RegExp("(Windows Phone|WPDesktop)","i").test(t)?bt:/iPad/.test(t)?tt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?et:Lt.test(t)?rt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(yt,"i").test(t)?yt:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Y).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?X:Z:/* @__PURE__ */new RegExp("(pda|Mobile)","i").test(t)?"Generic mobile":new RegExp(Q,"i").test(t)&&!/* @__PURE__ */new RegExp("Tablet pc","i").test(t)?$t:""},Jt=/\bFBAV\/(\d+(?:\.\d+)*)/i,Kt=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",Jt],[/\bFBAN\/EMA\b/i,"Facebook Lite",Jt],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",Jt],[/\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"]],Yt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Xt(t,e){return"string"==typeof(i=t)&&Yt.test(i)?t:e();var i}function Qt(t,e){var i=new Error(e);try{Object.defineProperty(i,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return i}function Zt(t){return t?t.split("#")[0]:t}var te,ee=["$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"],ie="NativeGzipValidationError",re=t=>t.length>=2&&31===t[0]&&139===t[1],se=(t,e)=>t===b.GZipJS||e===b.GZipJS||"gzip"===e,ne=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),oe=t=>{throw Qt(ie,"Native gzip produced invalid output: "+t)},ae=0,he=!1,le=/*#__PURE__*/function(){var t=s(function*(t,e){18>t.size&&oe("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());re(i)&&8===i[2]||oe("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer()),s=e.length>>>0;r.getUint32(4,!0)!==s&&oe("invalid-size"),(he||3>ae)&&(r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(te)return te;te=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;te[t]=e>>>0}return te})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&(he=!0,oe("invalid-crc")),ae++)});return function(e,i){return t.apply(this,arguments)}}();function ue(){return ue=s(function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),n=new globalThis.CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(r).then(()=>o.close()).catch(/*#__PURE__*/function(){var t=s(function*(t){try{yield o.abort(t)}catch(t){}throw t});return function(e){return t.apply(this,arguments)}}()),h=new Response(n.readable).blob(),l=(yield Promise.all([h,a]))[0];return yield le(l,r),l}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),ue.apply(this,arguments)}var de,ve=function(t,e){var i=(void 0===e?{}:e).debugEnabled,r={N(e){var r;try{r=typeof window>"u"?void 0:window}catch(t){return}for(var s=arguments.length,n=new Array(s>1?s-1:0),o=1;s>o;o++)n[o-1]=arguments[o];r&&(m.DEBUG||r.POSTHOG_DEBUG||i)&&!C(r.console)&&r.console&&("__rrweb_original__"in r.console[e]?r.console[e].__rrweb_original__:r.console[e])(t,...n)},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];r.N("error",...e)},critical(){for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];console.error(t,...i)},uninitializedWarning(t){r.error("You must initialize PostHog before calling "+t)},createLogger:(e,i)=>ve(t+" "+e,i)};return r},ce=/* @__PURE__ */ve("[PostHog.js]"),_e=(t,e)=>ce.createLogger(t,e),pe={"conversations.js":"sha384-8fPy3IASBzA8AWqnw4GisFo+FugHLE1xLpCaDmKKa+sdTroMj7fsaSQxeJdciOoP","crisp-chat-integration.js":"sha384-qVSPPiM5PHJlVNpiLPyETnf0VXOGevtCqjm2K8EmWnKpLQnY/TMu+iLJ8wWLW8iA","dead-clicks-autocapture.js":"sha384-MYefNCyD6/XLhTOKa8DavuGsgGJvAJO/X4iqoFkAqgGk7H9qgcIoysU9F2qVGMk1","exception-autocapture.js":"sha384-miJNvXEqyiBQpQrLVO7Yfby3J/doNarkjZX+a1eOKpGkF23r0WwtkxSSPyz/ngDx","intercom-integration.js":"sha384-gWEoUxf+HEPSZ4GZthxep/3LlEectgXxzj8uWkW7dnvRRV6AKkHXtZEmcb0OqOvn","lazy-recorder.js":"sha384-Ge58ONxarh9k88Xh0cuyu9EsN4wEhFQkA+e2lQbzD6COVKkGG/s1EeLkGhaXCZf1","logs.js":"sha384-HGXa+FeVH5JwY3bwubM1EJrP+LG95rh6oU9TbtzHZLs1ECpl5mCXv5FcYF8SgNjk","product-tours.js":"sha384-TlWlQfnDBI1yB3+CuhSTePe38C4bKqQwtK1m0/T6kk/EAsKbWvIya0UeuVkDmSV7","recorder.js":"sha384-t08QiFh+RHB6Jdz9IrPZ5yxf3Dzwdz92Mz0l8Ga/nox8o5+oO0I0gosm16hHDlCF","surveys.js":"sha384-voLXJFCjNwKYjWdB/DrH+XOQ4hYyH7Vi7xz/L+k8Z3WqCkKR6AnlC/ypiOR3UVIT","tracing-headers.js":"sha384-Zb7V2jbC5lJGl7yFzBe8HpCvO3xgJln/lEcqY5xAQ9Z1LLCnbi2glbsfvRPRIYcD","web-vitals-soft-navs.js":"sha384-recN8i2tLQWaeNtCAnErAmFlgg4+33FAHvs8l84aE+SHr6oqLAPwhFVZdP4SfKT6","web-vitals-with-attribution-soft-navs.js":"sha384-f9L4YQQre9lKeUzyvy2Kt4dHLIXECipeMmbr7SPQAOqLi+ZCHbh1I1g/OwsK/zrp","web-vitals-with-attribution.js":"sha384-QVSLDmgzPE1K6g6gBB8QKx/YDQbI2ot0gAcajFIAkGf34SWA3oe6m+WzcmbzpVjD","web-vitals.js":"sha384-wNvgQ2MIesvfVwpUOblaIO/5weiMjR0Ld1eSNtW14MURV24BwfW8Svo6TsBJ3Bk9"},fe=/^sha384-[A-Za-z0-9+/]{64}$/,ge=t=>{var e;return null!=t&&t.config.require_subresource_integrity?t.__loadExternalDependency:null==(e=f.__PosthogExtensions__)?void 0:e.loadExternalDependency},me=_e("[ExternalScriptsLoader]"),be=t=>{var e=null==h?void 0:h.querySelectorAll("script");if(e)for(var i=0;e.length>i;i++)if(e[i].src===t||e[i].getAttribute("src")===t)return e[i]},ye=(t,e,i)=>{i?me.critical(e):me.warn(e),t(e)},we=(t,e,i,r)=>{if(t.config.disable_external_dependency_loading)return me.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=()=>{if(null==h||h.removeEventListener("DOMContentLoaded",s),t.config.disable_external_dependency_loading)return i("Loading of external scripts is disabled");if(!h)return i("document not found");var o=h.createElement("script");if(o.type="text/javascript",o.crossOrigin="anonymous",r&&(o.integrity=r),o.src=e,o.onload=t=>{o.__posthog_loading_callback_fired=!0,i(void 0,t)},o.onerror=t=>{o.__posthog_loading_error=t,i(t)},t.config.prepare_external_dependency_script&&(o=t.config.prepare_external_dependency_script(o)),!o)return i("prepare_external_dependency_script returned null");if(r&&(!o.src||o.integrity!==r||"anonymous"!==o.crossOrigin))return ye(i,"prepare_external_dependency_script must keep src, integrity and crossOrigin 'anonymous' for "+e,!0);if(t.config.disable_external_dependency_loading)return i("Loading of external scripts is disabled");var a=be(o.src);if(a){if(a.integrity!==o.integrity||a.crossOrigin!==o.crossOrigin||a.nonce!==o.nonce)return i("Existing script conflicts with prepared script policy");if(a.__posthog_loading_callback_fired)return i();var l=a.__posthog_loading_error;return l?i(l):(a.addEventListener("load",t=>{a.__posthog_loading_callback_fired=!0,i(void 0,t)}),void a.addEventListener("error",t=>{a.__posthog_loading_error=t,i(t)}))}if(!h.body)return n();if("head"===t.config.external_scripts_inject_target)h.head.appendChild(o);else{var u,d=h.querySelectorAll("body > script");d.length>0?null==(u=d[0].parentNode)||u.insertBefore(o,d[0]):h.body.appendChild(o)}},n=()=>{null==h||h.addEventListener("DOMContentLoaded",s)};null!=h&&h.body||be(e)?s():n()},$e={},Se=(t,e)=>{var i="/static/"+e+".js?v="+t.version;if("toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",i)};f.__PosthogExtensions__=f.__PosthogExtensions__||{};var xe=(t,e,i)=>{if(t.config.require_subresource_integrity){if("remote-config"===e||"toolbar"===e)return ye(i,e+" can't be integrity-verified, so it is not loaded with require_subresource_integrity");if(!h||!("integrity"in h.createElement("script")))return ye(i,"This browser does not support Subresource Integrity",!0);var r=e+".js",s=pe[r];return A(s)&&fe.test(s)?void we(t,t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+r),i,s):ye(i,"No integrity hash for "+r,!0)}if("remote-config"!==e){var n=t.config.strict_script_versioning;if(n){var o=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),a=$e[o];if("fallback"===n&&a){if(be(a))return void we(t,a,i);delete $e[o]}we(t,o,"fallback"===n?(r,s)=>{if(r)if("string"==typeof r)i(r);else{var n,a=Se(t,e);$e[o]=a;var h=be(o);null==h||null==(n=h.parentNode)||n.removeChild(h),we(t,a,i)}else i(void 0,s)}:i)}else we(t,Se(t,e),i)}else we(t,t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js"),i)};de=xe,f.__PosthogExtensions__.loadExternalDependency=xe,f.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{if(t.config.require_subresource_integrity)return ye(i,"Site apps can't be integrity-verified, so "+e+" is not loaded with require_subresource_integrity");we(t,t.requestRouter.endpointFor("api",e),i)},m.DEBUG=!1,m.LIB_VERSION="1.455.1",m.LIB_NAME="web";var Ee=m,Te="$early_access_features",ke="$active_feature_flags",Ie="$feature_flag_details",Pe="$feature_flag_errors",Oe="$feature_flag_evaluated_at",Re="$feature_flag_request_id",Ce="$minimal_flag_called_events",Ae="$enabled_feature_flags",Me="$stored_group_properties",Ne="$stored_person_properties",De="$flag_call_reported",Fe="$flag_call_reported_session_id",Be="$feature_flag_payloads",Ue="$override_feature_flags",je="$override_feature_flag_payloads",Le="visibilitychange",ze="$autocapture_disabled_server_side",qe="$surveys",We="$surveys_loaded_at",He="$surveys_activated",Ge="$surveys_activated_session",Ve="$surveys_activated_timestamps",Je="$people_distinct_id",Ke="distinct_id",Ye="$device_id",Xe="$device_model",Qe="__alias",Ze="__cmpns",ti="$fbc",ei="$fbc_persistence",ii="$fbp",ri="$fbp_persistence",si="__timers",ni="$heatmaps_enabled_server_side",oi="$exception_capture_enabled_server_side",ai="$error_tracking_suppression_rules",hi="$error_tracking_capture_extension_exceptions",li="$web_vitals_enabled_server_side",ui="$dead_clicks_enabled_server_side",di="$product_tours_enabled_server_side",vi="$logs_capture_enabled_server_side",ci="$web_vitals_allowed_metrics",_i="$session_recording_remote_config",pi="$session_recording_enabled_server_side",fi="$replay_sample_rate",gi="$replay_override_sampling",mi="$replay_override_linked_flag",bi="$replay_override_url_trigger",yi="$replay_override_event_trigger",wi="$sesid",$i="$session_is_sampled",Si="$session_past_minimum_duration",xi="$session_recording_url_trigger_activated_session",Ei="$session_recording_event_trigger_activated_session",Ti="$debug_first_full_snapshot_timestamp",ki="$sess_rec_flush_size",Ii="$groups",Pi="ph_product_tours",Oi="$product_tours_activated",Ri="$product_tours_activated_session",Ci="$conversations_widget_session_id",Ai="$conversations_ticket_id",Mi="$conversations_widget_state",Ni="$conversations_user_traits",Di="$user_state",Fi="$client_session_props",Bi="$capture_rate_limit",Ui="$initial_campaign_params",ji="$initial_referrer_info",Li="$initial_person_info",zi="$epp",qi="$posthog_cookieless",Wi="$cookieless_mode",Hi="$sdk_debug_extensions_init_method",Gi="$sdk_debug_extensions_init_time_ms",Vi="$sdk_debug_recording_script_not_loaded",Ji="$sdk_debug_replay_stale_config",Ki="$sdk_debug_replay_event_trigger_status",Yi="$sdk_debug_replay_linked_flag_trigger_status",Xi="$sdk_debug_replay_matched_recording_trigger_groups",Qi="$sdk_debug_replay_pending_trigger_conditions",Zi="$sdk_debug_replay_remote_trigger_matching_config",tr="$sdk_debug_replay_trigger_groups_count",er="$sdk_debug_replay_url_trigger_status",ir="$session_recording_start_reason",rr="anonymous",sr="identified",nr="identified_only",or="beforeunload",ar="$pageview",hr="$pageleave",lr="$identify",ur="$groupidentify";function dr(t,e){I(t)&&t.forEach(e)}function vr(t,e){if(!D(t))if(I(t))t.forEach(e);else if((t=>t instanceof FormData)(t))t.forEach((t,i)=>e(t,i));else for(var i in t)T.call(t,i)&&e(t[i],i)}var cr=function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),r=1;e>r;r++)i[r-1]=arguments[r];for(var s of i)for(var n in s)void 0!==s[n]&&(t[n]=s[n]);return t},_r=function(t){return function(){try{for(var e=arguments.length,i=new Array(e),r=0;e>r;r++)i[r]=arguments[r];return t.apply(this,i)}catch(t){ce.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ce.critical(t)}}},pr=function(t){var e={};return vr(t,function(t,i){(A(t)&&t.length>0||F(t))&&(e[i]=t)}),e};function fr(t){var e=i({},t);for(var r of["name","message","stack","cause","errors"])try{r in t&&(e[r]=t[r])}catch(t){}return e}var gr=["herokuapp.com","vercel.app","netlify.app"];function mr(t){var e=null==t?void 0:t.hostname;if(!A(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of gr)if(i===r)return!1;return!0}function br(t,e,i,r){var s=null!=r?r:{},n=s.capture,o=s.passive;null==t||t.addEventListener(e,i,{capture:void 0!==n&&n,passive:void 0===o||o})}var yr,wr,$r=t=>{if(h){try{for(var e=t+"=",i=h.cookie.split(";").filter(t=>t.length),r=0;i.length>r;r++){for(var s=i[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(e))return decodeURIComponent(s.substring(e.length,s.length))}}catch(t){}return null}},Sr=class t{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,i,r,s){if(!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>i||0>r||0>s||e>0xffffffffffff||i>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var n=/* @__PURE__ */new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/256,n[5]=e,n[6]=112|i>>>8,n[7]=i,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new t(n)}toString(){for(var t="",e=0;this.bytes.length>e;e++)t=t+(this.bytes[e]>>>4).toString(16)+(15&this.bytes[e]).toString(16),3!==e&&5!==e&&7!==e&&9!==e||(t+="-");if(36!==t.length)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new t(this.bytes.slice(0))}equals(t){return 0===this.compareTo(t)}compareTo(t){for(var e=0;16>e;e++){var i=this.bytes[e]-t.bytes[e];if(0!==i)return Math.sign(i)}return 0}},xr=class{generate(){var t=this.generateOrAbort();if(!C(t))return t;this.Mt=0;var e=this.generateOrAbort();if(C(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t=(()=>{var t=Date.now();return F(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0})();if(t>this.Mt)this.Mt=t,this.Tt();else{if(this.Mt>=t+1e4)return;this.It++,this.It>4398046511103&&(this.Mt++,this.Tt())}return Sr.fromFieldsV7(this.Mt,Math.trunc(this.It/Math.pow(2,30)),this.It&Math.pow(2,30)-1,this.At.nextUint32())}Tt(){this.It=1024*this.At.nextUint32()+(1023&this.At.nextUint32())}constructor(){this.Mt=0,this.It=0,this.At=new Tr}},Er=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t},Tr=class{nextUint32(){return this.Rt.length>this.Et||((null!=yr?yr:yr="u">typeof window&&!C(window.crypto)&&crypto.getRandomValues?t=>{try{return crypto.getRandomValues(t)}catch(e){return Er(t)}}:Er)(this.Rt),this.Et=0),this.Rt[this.Et++]}constructor(){this.Rt=/* @__PURE__ */new Uint32Array(8),this.Et=1/0}},kr=()=>Ir().toString(),Ir=()=>(wr||(wr=new xr)).generate(),Pr="",Or=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Rr=null,Cr={Ot(){if(!N(Rr))return Rr;if(Rr=!1,h)try{var t="__ph_cookie_support_"+kr();Cr.$t(t,"xyz"),Rr='"xyz"'===$r(t),Cr.Dt(t)}catch(t){Rr=!1}return Rr},Ft(t){ce.error("cookieStore error: "+t)},Lt:$r,Pt(t){var e;try{e=JSON.parse(Cr.Lt(t))||{}}catch(t){}return e},$t(t,e,i,r,s){if(!h)return!1;try{var n="",o="",a=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=h),Pr)return Pr;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),r=Math.min(i.length,8),s="dmn_chk_"+kr();!Pr&&r--;){var n=i.slice(r).join("."),o=s+"=1;domain=."+n+";path=/";e.cookie=o+";max-age=3",e.cookie.includes(s)&&(e.cookie=o+";max-age=0",Pr=n)}return Pr}(t);if(!i){var r=(t=>{var e=t.match(Or);return e?e[0]:""})(t);r!==i&&ce.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(h.location.hostname,r);if(i){var l=/* @__PURE__ */new Date;l.setTime(l.getTime()+864e5*i),n="; expires="+l.toUTCString()}s&&(o="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&ce.warn("cookieStore warning: large cookie, len="+u.length),h.cookie=u,!0}catch(t){return!1}},Dt(t,e){if(null!=h&&h.cookie&&(!e||!N($r(t))))try{Cr.$t(t,"",-1,e)}catch(t){return}}},Ar=null,Mr={Ot(){if(!N(Ar))return Ar;var t=!0;if(C(n))t=!1;else try{var e="__mplssupport__";Mr.$t(e,"xyz"),'"xyz"'!==Mr.Lt(e)&&(t=!1),Mr.Dt(e)}catch(e){t=!1}return t||ce.error("localStorage unsupported; falling back to cookie store"),Ar=t,t},Ft(t){ce.error("localStorage error: "+t)},Lt(t){try{return null==n?void 0:n.localStorage.getItem(t)}catch(t){Mr.Ft(t)}return null},Pt(t){try{return JSON.parse(Mr.Lt(t))||{}}catch(t){}return null},$t(t,e){try{return null==n||n.localStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Mr.Ft(t)}return!1},Dt(t){try{null==n||n.localStorage.removeItem(t)}catch(t){Mr.Ft(t)}}},Nr=[Ne,ke,Ae,Ie,Be,Re,Oe,Pe,De],Dr=[Ye,Ke,wi,$i,zi,Li,ei,Di],Fr=t=>t+"_cpm",Br=["__proto__","constructor","prototype"],Ur=t=>{if(!O(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===Br.indexOf(i)&&(e[i]=t[i])}),e},jr=function(t,e){void 0===e&&(e=[]);var i={};return[...Dr,...e].forEach(e=>{var r=t[e];C(r)||N(r)||""===r||(i[e]=r)}),i},Lr=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var s=t.charCodeAt(r);e=33*e^s,i=Math.imul(i^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},zr=(t,e)=>({p:e,f:Lr(JSON.stringify(t))}),qr=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=Cr.Pt(Fr(t)),r=(null==i?void 0:i.f)===Lr(e)&&I(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Wr=(t,e)=>e+"|"+(Cr.Lt(Fr(t))||""),Hr={},Gr={Ot:()=>!0,Ft(t){ce.error("memoryStorage error: "+t)},Lt:t=>t in Hr?Hr[t]:null,Pt:t=>t in Hr?Hr[t]:null,$t:(t,e)=>(Hr[t]=e,!0),Dt(t){delete Hr[t]}},Vr=null,Jr={Ot(){if(!N(Vr))return Vr;if(Vr=!0,C(n))Vr=!1;else try{var t="__support__";Jr.$t(t,"xyz"),'"xyz"'!==Jr.Lt(t)&&(Vr=!1),Jr.Dt(t)}catch(t){Vr=!1}return Vr},Ft(t){ce.error("sessionStorage error: ",t)},Lt(t){try{return null==n?void 0:n.sessionStorage.getItem(t)}catch(t){Jr.Ft(t)}return null},Pt(t){try{return JSON.parse(Jr.Lt(t))||null}catch(t){}return null},$t(t,e){try{return null==n||n.sessionStorage.setItem(t,JSON.stringify(e)),!0}catch(t){Jr.Ft(t)}return!1},Dt(t){try{null==n||n.sessionStorage.removeItem(t)}catch(t){Jr.Ft(t)}}},Kr=class{constructor(t){this._instance=t}get Yr(){return this._instance.config}get consent(){return this.eu()?0:this.iu}isOptedOut(){return"always"===this.Yr.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Yr.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Yr.opt_out_capturing_by_default}optInOut(t){this.nu.$t(this.su,t?1:0,this.Yr.cookie_expiration,this.Yr.cross_subdomain_cookie,this.Yr.secure_cookie)}reset(){this.nu.Dt(this.su,this.Yr.cross_subdomain_cookie)}get su(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get iu(){var t=this.nu.Lt(this.su);return W(t)?1:S(H,t)?0:-1}get nu(){var t=this.Yr.opt_out_capturing_persistence_type,e="localStorage"===t?Mr:Cr,i=e.Ot()?e:Gr;if(!this.ru||this.ru!==i){this.ru=i;var r="localStorage"===t?Cr:Mr;r.Lt(this.su)&&(this.ru.Lt(this.su)||this.optInOut(W(r.Lt(this.su))),r.Dt(this.su,this.Yr.cross_subdomain_cookie))}return this.ru}eu(){return!!this.Yr.respect_dnt&&[null==a?void 0:a.doNotTrack,null==a?void 0:a.msDoNotTrack,f.doNotTrack,null==a?void 0:a.globalPrivacyControl].some(t=>W(t))}},Yr=["next","previous","prev",">","<","→","←","›","‹","»","«","▶","◀","❯","❮"],Xr=/* @__PURE__ */(()=>[...Yr,"+","-","−","–"])(),Qr=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(ui)),r=t.instance.config.capture_dead_clicks;return U(r)?r:!!O(r)||i},Zr=_e("[SegmentIntegration]");function ts(t,e,r){void 0===r&&(r=!0);var s=t.config.segment;if(!s)return e();var n,o=(t=>P(t.register))(n=s)?{analytics:n}:n,a=o.analytics,h=o.filterProperties;!function(t,e,i,r){var s=e=>{var s=()=>e.anonymousId()||kr();t.config.get_device_id=s,r&&e.id()&&(t.register({distinct_id:e.id(),$device_id:s()}),t.persistence.set_property(Di,sr)),i(r?void 0:e.anonymousId()||void 0)},n=e.user();"then"in n&&P(n.then)?n.then(s):s(n)}(t,a,r=>{a.register(function(t,e,r){var s=(void 0===r?{}:r).filterProperties;"undefined"!=typeof Promise&&Promise.resolve||Zr.warn("This browser does not have Promise support, and can not use the segment integration");var n=(r,n)=>{if(!n)return r;var o=!!e&&r.event.anonymousId===e&&!r.event.userId;o||r.event.userId||r.event.anonymousId===t.get_distinct_id()||(Zr.info("No userId set, resetting PostHog"),t.reset()),o||(e=void 0),r.event.userId&&r.event.userId!==t.get_distinct_id()&&(Zr.info("UserId set, identifying with PostHog"),t.identify(r.event.userId));var a=t.calculateEventProperties(n,r.event.properties);if(!D(s)){var h=r.event.properties||{},l={};for(var u of Object.keys(a))T.call(h,u)||(l[u]=a[u]);var d=((t,e)=>{var r=I(t)?t:[t],s=i({},e);for(var n of r)try{if(s=n(s),D(s))return null}catch(t){return Zr.error("Error in Segment filterProperties:",t),null}return s})(s,l);if(D(d))return r;a=d}return r.event.properties=Object.assign({},a,r.event.properties),r};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return n(t,t.event.event)},page(t){return n(t,ar)},identify(t){return n(t,lr)},screen(t){return n(t,"$screen")}}}(t,r,{filterProperties:h})).then(()=>{e()},t=>{Zr.error("Failed to register the Segment integration",t),e()})},r)}var es="posthog-js";function is(t,e){var r=void 0===e?{}:e,s=r.organization,n=r.projectId,o=r.prefix,a=r.severityAllowList,h=void 0===a?["error"]:a,l=r.sendExceptionsToPostHog,u=void 0===l||l;return e=>{var r,a,l,d,v,c;if("*"!==h&&!h.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var _=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=_,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var p=(null==(r=e.exception)?void 0:r.values)||[],f=p.map(t=>i({},t,{stacktrace:t.stacktrace?i({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map(t=>i({},t,{platform:"web:javascript"}))}):void 0})),g={$exception_message:(null==(a=p[0])?void 0:a.value)||e.message,$exception_type:null==(l=p[0])?void 0:l.type,$exception_level:e.level,$exception_list:f,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(d=p[0])?void 0:d.value)||e.message,$sentry_exception_type:null==(v=p[0])?void 0:v.type,$sentry_tags:e.tags};return s&&n&&(g.$sentry_url=(o||"https://sentry.io/organizations/")+s+"/issues/?project="+n+"&query="+e.event_id),u&&(null==(c=t.exceptions)||c.sendExceptionEvent(g)),e}}var rs=class{constructor(t,e,i,r,s,n){this.name=es,this.setupOnce=function(o){o(is(t,{organization:e,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}},ss=class{constructor(t){this.uu=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ce.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.cu=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.hu()}hu(){var t;this.du=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.uu)}destroy(){var t;null==(t=this.du)||t.call(this),this.du=void 0}doPageView(t,e){var i,r=this.vu(t,e);return this.cu={pathname:null!==(i=null==n?void 0:n.location.pathname)&&void 0!==i?i:"",pageViewId:e,timestamp:t},this._instance.scrollManager.resetContext(),r}doPageLeave(t){var e;return this.vu(t,null==(e=this.cu)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.cu)?void 0:t.pageViewId}}vu(t,e){var i=this.cu;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var n=s.maxScrollHeight,o=s.lastScrollY,a=s.maxScrollY,h=s.maxContentHeight,l=s.lastContentY,u=s.maxContentY;if(!(C(n)||C(o)||C(a)||C(h)||C(l)||C(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),h=Math.ceil(h),l=Math.ceil(l),u=Math.ceil(u);var d=n>1?K(o/n,0,1,ce):1,v=n>1?K(a/n,0,1,ce):1,c=h>1?K(l/h,0,1,ce):1,_=h>1?K(u/h,0,1,ce):1;r=cr(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}},ns=["flags","surveys"],os={[Je]:{exposure:"hidden"},[Qe]:{exposure:"hidden"},[Ze]:{exposure:"hidden"},[si]:{exposure:"hidden"},[ei]:{exposure:"hidden"},[ri]:{exposure:"hidden"},[ze]:{exposure:"event"},[ni]:{exposure:"hidden"},[vi]:{exposure:"hidden"},[oi]:{exposure:"event"},[ai]:{exposure:"hidden"},[hi]:{exposure:"event"},[li]:{exposure:"event"},[ui]:{exposure:"event"},[di]:{exposure:"hidden"},[ci]:{exposure:"event"},[_i]:{exposure:"hidden"},[pi]:{exposure:"hidden"},[wi]:{exposure:"hidden"},[$i]:{exposure:"event"},[fi]:{exposure:"event",shouldSkipFromEventProperties:t=>N(t)},[Si]:{exposure:"event"},[xi]:{exposure:"event"},[Ei]:{exposure:"event"},[Ti]:{exposure:"event"},[ki]:{exposure:"hidden"},[Ae]:{exposure:"hidden",storageGroup:"flags"},[ke]:{exposure:"hidden",storageGroup:"flags"},[Te]:{exposure:"hidden"},[Ie]:{exposure:"hidden",storageGroup:"flags"},[Be]:{exposure:"hidden",storageGroup:"flags"},[Re]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ce]:{exposure:"hidden",storageGroup:"flags"},[Ue]:{exposure:"hidden"},[je]:{exposure:"hidden"},[Ne]:{exposure:"hidden"},[Me]:{exposure:"hidden"},[qe]:{exposure:"hidden",storageGroup:"surveys"},[We]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[He]:{exposure:"event"},[Ge]:{exposure:"hidden"},[Ve]:{exposure:"hidden"},[Pi]:{exposure:"hidden"},[Oi]:{exposure:"hidden"},[Ri]:{exposure:"hidden"},[Ci]:{exposure:"event"},[Ai]:{exposure:"event"},[Mi]:{exposure:"event"},[Ni]:{exposure:"event"},[De]:{exposure:"hidden"},[Fe]:{exposure:"hidden"},[Ii]:{exposure:"event"},[Pe]:{exposure:"hidden"},[Oe]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Di]:{exposure:"hidden"},[Fi]:{exposure:"hidden"},[Bi]:{exposure:"hidden"},[Ui]:{exposure:"hidden"},[ji]:{exposure:"hidden"},[Li]:{exposure:"hidden"},[zi]:{exposure:"hidden"},[gi]:{exposure:"event"},[mi]:{exposure:"event"},[bi]:{exposure:"event"},[yi]:{exposure:"event"},[Hi]:{exposure:"event"},[Gi]:{exposure:"event"},[Vi]:{exposure:"hidden"},[Ji]:{exposure:"hidden"},[Ki]:{exposure:"hidden"},[Yi]:{exposure:"hidden"},[Xi]:{exposure:"hidden"},[Qi]:{exposure:"hidden"},[Zi]:{exposure:"hidden"},[tr]:{exposure:"hidden"},[er]:{exposure:"hidden"},[ir]:{exposure:"event"}},as=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],hs=t=>{var e=os[t];if(e)return e;for(var i of as){var r=i[1];if(0===t.indexOf(i[0]))return r}};function ls(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}var us=t=>{var e,i=null==(e=typeof document>"u"?void 0:document)?void 0:e.createElement("a");return C(i)?null:(i.href=t,i)},ds=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>z(e)?(null!=i||(i=/* @__PURE__ */new WeakMap),i.has(e)||i.set(e,fr(e)),i.get(e)):"bigint"==typeof e?e.toString():e,e)}catch(e){return s=[],null!==(r=JSON.stringify(t,function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(e))return"[Circular]";s.push(e)}return e}}))&&void 0!==r?r:"null"}var r,s},vs=function(t,e){for(var i,r=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var n=r[s].split(/=(.*)/);if(n[0]===e){i=n;break}}if(!I(i)||2>i.length)return"";var o=i[1].replace(/\+/g," ");try{o=decodeURIComponent(o)}catch(t){ce.error("Skipping decoding for malformed query param: "+o)}return o},cs=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split(/#(.*)/),s=r[1],n=(r[0]||"").split(/\?(.*)/),o=n[1],a=n[0],h=(o||"").split("&"),l=[],u=0;h.length>u;u++){for(var d=h[u].split("?"),v=0;d.length>v&&!e.includes(d[v].split("=")[0]);)v++;l.push(d.length>v?d.slice(0,v).concat(d[v].split("=")[0]+"="+i).join("?"):h[u])}var c=a;return null!=o&&(c+="?"+l.join("&")),null!=s&&(c+="#"+s),c},_s=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","oppref","bfcid","irclid","_kx"],ps=["ScCid","SsCid"],fs={sccid:ps},gs=/* @__PURE__ */(()=>[..._s,...ps,"sscid"])(),ms=/* @__PURE__ */(()=>["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",..._s])(),bs="<masked>",ys=["li_fat_id"];function ws(t,e){var i=ms.concat(e||[]),r={};return vr(i,function(e){var i=vs(t,e);!i&&T.call(fs,e)&&dr(fs[e],function(e){i=i||vs(t,e)}),r[e]=i||null}),r}function $s(t){var e=function(t){return t?0===t.search("https?://(.*)google.([^/?]*)")?"google":0===t.search("https?://(.*)bing.com")?"bing":0===t.search("https?://(.*)yahoo.com")?"yahoo":0===t.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",r={};if(!N(e)){r.$search_engine=e;var s=h?vs(h.referrer,i):"";s.length&&(r.ph_keyword=s)}return r}function Ss(){return navigator.language||navigator.userLanguage}var xs="$direct";function Es(){return(null==h?void 0:h.referrer)||xs}function Ts(t,e,i){var r;void 0===i&&(i=!1);var s=t?[...gs,...e||[]]:[],n=null==(r=i?Zt(null==l?void 0:l.href):null==l?void 0:l.href)?void 0:r.substring(0,1e3);return{r:Es().substring(0,1e3),u:n?cs(n,s,bs):void 0}}function ks(t,e,i,r){var s;void 0===e&&(e=!1);var n=t.r,o=t.u,a=e?Zt(o):o,h=a&&i?cs(a,[...gs,...r||[]],bs):a,l={$referrer:n,$referring_domain:null==n?void 0:n==xs?xs:null==(s=us(n))?void 0:s.host};if(h){l.$current_url=h;var u=us(h);l.$host=null==u?void 0:u.host,l.$pathname=null==u?void 0:u.pathname,cr(l,ws(h))}return n&&cr(l,$s(n)),l}function Is(){try{/* @__PURE__ */
2
2
  return(new Date).getTimezoneOffset()}catch(t){return}}var Ps={flags:Oe,surveys:We},Os=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Rs=t=>t+"_cookie_identity_change_pending",Cs=t=>{var e="",i=0;for(var r of t){var s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+s>1e3)break;e+=r,i+=s}return e},As="main",Ms=[Ae,ke,Ie,Be,Re,Oe,Ce,Ne],Ns=t=>-1!==Ms.indexOf(t),Ds=[ei,ri],Fs=t=>-1!==Ds.indexOf(t),Bs=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},Us=t=>{if(!t)return{};var e=JSON.parse(t);return O(e)?e:{}},js=t=>{var e=t[Ie];return O(e)?i({},t,{[Ie]:Object.fromEntries(Object.entries(e).map(t=>{var e,r=t[0],s=t[1];if(!O(s)||!("value"in s)||1!==(null==(e=s.metadata)?void 0:e.config_version))return[r,s];var n=i({},s,{metadata:i({},s.metadata)});for(var o of(delete n.value,["config_version","rule_type","rule_id","variant_key","forced_variant"]))delete n.metadata[o];return[r,n]}))}):t},Ls=(t,e)=>{vr(t,(i,r)=>{var s=hs(r);s&&"event"!==s.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})},zs=class{constructor(t,e,r,s){if(void 0===r&&(r=!0),void 0===s&&(s=!t.cookieless_mode),this.fu={},this.pu=!1,this.gu=!1,this.mu=!1,this.yu=!1,this.bu=!1,this._u=/* @__PURE__ */new Map,this.wu=!1,this.ku=!1,this.Su=!1,this.xu=/* @__PURE__ */new Set,this.$u=/* @__PURE__ */new Set,this.Yr=t,this.Cu=r,this.props={},this.Tu=void 0,this.Mu=(t=>{var e="";return t.token&&(e=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+e+"_posthog"})(t),this.Ai=t.disable_persistence||!!e,this.nu=this.Iu(t),this.mu=this.Eu(t),this.load(s),this.Au(),t.debug&&ce.info("Persistence loaded",t.persistence,i({},this.props)),this.update_config(t,t,e),this.save(),n){var o=()=>this.flush();br(n,"beforeunload",o,{capture:!1}),br(n,"pagehide",o,{capture:!1}),this.Ru=t=>{if(this.pu&&(!t.storageArea||t.storageArea===(null==n?void 0:n.localStorage))&&t.key)if(t.key!==this.Mu){if(this.mu){var e=ns.find(e=>t.key===this.Pu(e));e&&this.Ou(t.key,e)}}else this.Ou(t.key,As)},br(n,"storage",this.Ru)}}reconcileFeatureFlagsBeforeMerge(){return!(this.Ai||this.bu||this.wu)&&this.Fu()}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this._u.get(e);if(Ns(e)&&!0!==r)if(!0!==i){var s=new Set(r||[]);i.forEach(t=>s.add(t)),s.size&&this.Lu(e,s)}else this.Lu(e,!0)})}onCrossTabFeatureFlagChange(t){return this.$u.add(t),()=>this.$u.delete(t)}destroy(){this.Ru&&n&&(n.removeEventListener("storage",this.Ru),this.Ru=void 0),this.$u.clear()}Ou(t,e,i){if(void 0===i&&(i=!0),this.Ai)return!1;var r,s;try{if(s=Mr.Lt(t),N(s)){var n=this.Du(e);return n.storageValue=null,e!==As?n.persisted=!1:this.Nu({}),!1}r=Us(s)}catch(t){return!1}e===As&&this.Nu(r);var o=e===As?r:Mr.Pt(this.Mu);if(o&&this.ju(o))return!1;var a=this.qu(r,e,i);return e===As&&this.mu&&!Bs(this.Bu().main,r)||this.zu(r,e,!0,s),a}ju(t){var e=this.props[Ke],i=t[Ke];return!C(e)&&!C(i)&&e!==i}zu(t,e,i,r){var s=this.Du(e);s.storageValue=r,e!==As&&(s.persisted=i);try{s.fingerprint=this.Hu(t,e)}catch(t){s.fingerprint=void 0}}qu(t,e,i){var r=!1;return Ms.forEach(i=>{var s,n=null==(s=hs(i))?void 0:s.storageGroup;if(!(e===As&&this.mu&&n||e!==As&&n!==e)){var o=i in t,a=this.Uu(i,o?t[i]:void 0),h=this._u.has(i)?i in this.props:o;h===i in this.props&&Bs(a,this.props[i])||(h?this.Wu(i,a,!1):this.Vu(i,!1),r=!0)}}),r&&i&&this.$u.forEach(t=>t()),r}Nu(t){var e=this.gu&&this.Yr.cookieWinsOnConflict?[...Dr,...this.Yr.cookie_persisted_properties||[]]:[];Ds.forEach(i=>{this.xu.has(i)||-1!==e.indexOf(i)||(i in t?Bs(t[i],this.props[i])||this.Wu(i,t[i],!1):i in this.props&&this.Vu(i,!1))})}Gu(){return this.gu&&this.pu&&!this.Yr.cookieWinsOnConflict}Ju(){if(this.Gu()){var t;try{t=Cr.Lt(this.Mu)||void 0}catch(t){return}if(t&&t!==this.Qu){var e;this.Qu=t;try{e=Ur(JSON.parse(t))}catch(t){return}Ds.forEach(t=>{!(t in e)||t in this.props||this.xu.has(t)||this.Wu(t,e[t],!1)})}}}Zu(t){if(this.Gu())try{var e=JSON.stringify(jr(t,this.Yr.cookie_persisted_properties||[])),i=Cr.Lt(this.Mu)||void 0;i===e&&(this.Qu=i)}catch(t){}}Fu(){if(!this.pu)return!1;try{this.Su=!1;var t,e=Mr.Lt(this.Mu),i=this.Du(As),r=!1,s=!1;if(e!==i.storageValue)if(N(e))A(i.storageValue)&&this.Nu({}),i.storageValue=null;else{if(t=Us(e),this.Nu(t),this.Su=!this.ku&&this.ju(t),this.Su)return!1;s=this.qu(t,As,!1),!this.mu||Bs(this.Bu().main,t)?this.zu(t,As,!0,e):i.storageValue=e,r=!0}return this.mu&&ns.forEach(e=>{var i=Mr.Lt(this.Pu(e)),n=this.Du(e),o=t||{},a=r&&Ms.some(t=>{var i;return(null==(i=hs(t))?void 0:i.storageGroup)===e&&t in o});if(i!==n.storageValue||a){if(N(i))return n.storageValue=null,n.persisted=!1,void(a&&(s=this.qu(o,e,!1)||s));var h=Us(i);s=this.qu(h,e,!1)||s,this.zu(h,e,!0,i)}}),s}catch(t){return!1}}Lu(t,e){this._u.set(t,e);var i=hs(t);null!=i&&i.volatile||(this.Du((this.mu?null==i?void 0:i.storageGroup:void 0)||As).fingerprint=void 0,this.Ku(t))}Yu(){Ms.forEach(t=>this._u.set(t,!0))}Au(){if(this.pu)try{var t=Mr.Lt(this.Mu),e=Us(t);this.Du(As).storageValue=t,Ms.forEach(t=>{var i,r=this.mu?null==(i=hs(t))?void 0:i.storageGroup:void 0,s=r?Mr.Lt(this.Pu(r)):null;if(r){var n=this.Du(r);n.storageValue=s,n.persisted=!N(s)}var o=r&&!N(s)?Us(s):e;t in this.props?this.Xu(t,o[t],this.props[t]):t in o&&this.Lu(t,!0)})}catch(t){}}Uu(t,e){var r=this._u.get(t);if(!r)return e;if(!0===r)return this.props[t];if("$active_feature_flags"===t){var s=new Set(I(e)?e:[]),n=new Set(I(this.props[t])?this.props[t]:[]);return r.forEach(t=>n.has(t)?s.add(t):s.delete(t)),Array.from(s)}var o=O(e)?i({},e):{},a=O(this.props[t])?this.props[t]:{};return r.forEach(t=>{t in a?o[t]=a[t]:delete o[t]}),o}Xu(t,e,i){if(Ns(t)){var r=this._u.get(t);if(!0!==r){var s=e;if(this.pu)try{var n,o=this.mu?null==(n=hs(t))?void 0:n.storageGroup:void 0,a=o?this.Pu(o):this.Mu;s=Us(Mr.Lt(a))[t]}catch(t){}var h=new Set(r||[]);if("$active_feature_flags"===t){if(!C(e)&&!I(e)||!C(s)&&!I(s)||!I(i))return void this.Lu(t,!0);var l=new Set(e||[]),u=new Set(s||[]),d=new Set(i);
3
3
  /* @__PURE__ */new Set([...l,...d]).forEach(t=>{l.has(t)!==d.has(t)&&h.add(t)}),h.forEach(t=>{u.has(t)===d.has(t)&&h.delete(t)})}else{if(!O(i))return void(Bs(s,i)?this._u.delete(t):this.Lu(t,!0));if(!C(e)&&!O(e)||C(e)&&R(i)&&C(s))return void this.Lu(t,!0);var v=O(e)?e:{},c=O(s)?s:{};
4
4
  /* @__PURE__ */new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&Bs(v[t],i[t])||h.add(t)}),h.forEach(t=>{t in c==t in i&&Bs(c[t],i[t])&&h.delete(t)})}h.size?this.Lu(t,h):this._u.delete(t)}}}tc(){var t,e=null==(t=this.Yr)?void 0:t.persistence_save_debounce_ms;return F(e)&&e>0?e:0}ec(t){if(this.Yr.cookieWinsOnConflict&&"localstorage+cookie"===this.Yr.persistence.toLowerCase())if(t)try{var e=jr(t,this.Yr.cookie_persisted_properties||[]),i=zr(e,this.Yr.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),s=Cr.Lt(this.Mu)||void 0;s&&Wr(this.Mu,s)===r&&(this.nc=r,this.sc=s)}catch(t){}else try{var n=Cr.Lt(this.Mu)||void 0;this.nc=n?Wr(this.Mu,n):void 0,this.sc=n}catch(t){}}syncCookieProperties(){return this.rc(this.Yr)}rc(t,e){if(void 0===e&&(e=!1),this.Ai&&!e||this.bu||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=Cr.Lt(this.Mu)||void 0}catch(t){}if(!i||i===this.sc)return!1;var r,s=Wr(this.Mu,i);try{r=Ur(JSON.parse(i))}catch(t){return!1}if((Cr.Lt(this.Mu)||void 0)!==i)return!1;this.nc=s,this.sc=i;var n=qr(this.Mu,i),o=[...Dr,...n.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(C(e)||N(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e)&&(a[t]=!0,delete r[t])}),R(r))return!1;var h="distinct_id"in r||"anonymous"===r.$user_state||"identified"===r.$user_state,l=this.props,u=l[Ke],d=l[Di],v=cr({},l);[...Dr,...t.cookie_persisted_properties||[]].forEach(t=>{if(-1!==o.indexOf(t)&&!(t in r)&&!a[t]&&(h||"distinct_id"!==t&&"$user_state"!==t)){var e=v[t];(n.isValid||-1===Dr.indexOf(t)||!1!==e&&0!==e)&&delete v[t]}}),this.props=cr(v,r),Ms.forEach(t=>{var e=t in this.props;t in l===e&&Bs(l[t],this.props[t])||(e?this.Xu(t,l[t],this.props[t]):this.Lu(t,!0))}),!h||"$user_state"in r||"$user_state"in this.props||this.Wu(Di,rr);var c=this.props[Ke],_=this.props[Di];return!h||c===u&&_===d||(this.ku=!0,this.yu=!0,Jr.$t(Rs(this.Mu),!0),this.Vu(Ne),this.Vu(ke),this.Vu(Ae),this.Vu(Ie),this.Vu(Be),this.Vu(Re),this.Vu(Oe),this.Vu(Pe),this.Vu(De),"anonymous"!==_||"identified"!==d&&"anonymous"!==r.$user_state&&(C(u)||c===u)||(Ls(this.props,r),this.Vu(Me)),"identified"===_?this.props.$user_id=c:delete this.props.$user_id,this.Vu(Qe)),!0}consumeCookieIdentityChange(){var t=Rs(this.Mu),e=this.yu||!!Jr.Lt(t);return this.yu=!1,e&&Jr.Dt(t),e}oc(t){return void 0===t&&(t=!1),!(this.bu||this.Ai&&!t||!this.Yr.cookieWinsOnConflict||"localstorage+cookie"!==this.Yr.persistence.toLowerCase()||(this.bu=!0,0))}lc(){this.bu&&(C(this.ac)||(clearTimeout(this.ac),this.ac=void 0),delete this.fu[As],this.uc(!0))}cc(t){if(void 0===t&&(t=!0),this.bu)try{t?this.lc():C(this.ac)||(clearTimeout(this.ac),this.ac=void 0)}finally{this.bu=!1}}isDisabled(){return!!this.Ai}Iu(t){-1===Os.indexOf(t.persistence.toLowerCase())&&(ce.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var e,r=function(t,e,r){void 0===t&&(t=[]),void 0===e&&(e=!1),void 0===r&&(r=()=>!1);var s=[...Dr,...t];return i({},Mr,{Pt(t){try{var i,n={};try{i=Cr.Lt(t)||void 0,n=i?Ur(JSON.parse(i)):{}}catch(t){}var o,a=JSON.parse(Mr.Lt(t)||"{}");if(e){var h=qr(t,i),l=[...Dr,...h.properties],u={};Object.keys(n).forEach(t=>{var e=n[t];N(e)||""===e||"$user_state"===t&&"anonymous"!==e&&"identified"!==e||(u[t]=e)});var d="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var v,c=a[Ke],_=null!==(v=a.$user_state)&&void 0!==v?v:"anonymous";s.forEach(t=>{if(-1!==l.indexOf(t)&&!(t in n)&&(d||"distinct_id"!==t&&"$user_state"!==t)){var e=a[t];(h.isValid||-1===Dr.indexOf(t)||!1!==e&&0!==e)&&delete a[t]}}),!d||"$user_state"in n||"$user_state"in a||(a[Di]=rr),!d||("distinct_id"in u?u[Ke]:a[Ke])===c&&("$user_state"in u?u[Di]:a[Di])===_||(Nr.forEach(t=>delete a[t]),"identified"===u.$user_state&&"distinct_id"in u?a.$user_id=u[Ke]:delete a.$user_id,"identified"!==u.$user_state&&(delete a[Ii],delete a[Me]),delete a.__alias)}o=cr(a,u)}else o=cr(n,a);return r()||Mr.$t(t,o),o}catch(t){}return null},$t(i,r,s,n,o,a){var h=Mr.$t(i,r,void 0,void 0,a);try{var l=jr(r,t);if(Object.keys(l).length){if(e){var u=Fr(i),d=zr(l,t);if(Cr.$t(u,d,s,n,o,a),Cr.Lt(u)!==JSON.stringify(d)){Cr.Dt(u,n);var v=jr(r);return Cr.$t(i,v,s,n,o,a),h}}Cr.$t(i,l,s,n,o,a)}}catch(t){Mr.Ft(t)}return h},Dt(t,e){try{null==n||n.localStorage.removeItem(t),Cr.Dt(t,e),Cr.Dt(Fr(t),e)}catch(t){Mr.Ft(t)}}})}(t.cookie_persisted_properties||[],t.cookieWinsOnConflict,()=>!!this.Ai),s=!1,o=!1,a=t.persistence.toLowerCase();return"localstorage"===a&&Mr.Ot()?(e=Mr,o=!0):"localstorage+cookie"===a&&r.Ot()?(e=r,o=!0,s=!0):"sessionstorage"===a&&Jr.Ot()?e=Jr:"memory"===a?e=Gr:"cookie"===a&&Cr.Ot()?(e=Cr,s=!0):r.Ot()?(e=r,o=!0,s=!0):Cr.Ot()?(e=Cr,s=!0):e=Gr,this.pu=o,this.gu=s,e}Pu(t){return this.Mu+"__"+t}Eu(t){return this.pu&&!!t.split_storage}properties(){var t={};return vr(this.props,(e,i)=>{var r=hs(i);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e))return;t[i]=e}}),t}load(t){if(void 0===t&&(t=!1),!this.Ai||t){var e=this.Yr.cookieWinsOnConflict&&"localstorage+cookie"===this.Yr.persistence.toLowerCase(),i=e?Mr.Pt(this.Mu):null,r={};if(e)try{vr(r=Ur(Cr.Pt(this.Mu)),(t,e)=>{(C(t)||N(t)||""===t)&&delete r[e]})}catch(t){}var s=this.nu.Pt(this.Mu);if(s&&(this.props=cr({},s)),this.mu&&this.hc(),e&&s){var n,o,a=null==i?void 0:i[Ke],h=null!==(n=null==i?void 0:i.$user_state)&&void 0!==n?n:"anonymous",l=s[Ke],u=null!==(o=s.$user_state)&&void 0!==o?o:"anonymous",d=Jr.Pt(this.Mu),v=!C(a)||!C(null==i?void 0:i.$user_state)||!!d&&!R(d);if(l!==a||u!==h){v&&(this.yu=!0,this.Ai||Jr.$t(Rs(this.Mu),!0));var c=cr({},this.props);Nr.forEach(t=>delete c[t]),v&&"anonymous"===u&&("identified"===h||"anonymous"===r.$user_state||!C(a)&&l!==a)&&(Ls(c,r),delete c[Me]),this.props=c;var _=/* @__PURE__ */new Set;Nr.forEach(t=>{var e,i=null==(e=hs(t))?void 0:e.storageGroup;i&&_.add(i)}),_.forEach(t=>{if(!this.Ai){var e={};vr(this.props,(i,r)=>{var s;(null==(s=hs(r))?void 0:s.storageGroup)===t&&(e[r]=i)});var i=js(e);R(e)?(Mr.Dt(this.Pu(t)),this.fu[t]={}):Mr.$t(this.Pu(t),i)&&(this.fu[t]={persisted:!0,fingerprint:this.Hu(i,t)})}})}}Jr.Lt(Rs(this.Mu))&&(this.yu=!0)}}hc(){for(var t of ns){var e=Mr.Pt(this.Pu(t));if(e&&!R(e)){var i=this.Du(t);i.persisted=!0,this.dc(t)||(i.fingerprint=this.Hu(e,t)),this.vc(t,e)||cr(this.props,e)}}}dc(t){return Object.keys(this.props).some(e=>{var i;return(null==(i=hs(e))?void 0:i.storageGroup)===t})}vc(t,e){var i=Ps[t];if(!i)return!1;var r=e[i],s=this.props[i];return F(r)&&F(s)&&s>r}refreshKey(t){this.fc([t])}fc(t){if(!this.Ai){var e,i=!1,r=()=>(i||(e=this.nu.Pt(this.Mu),i=!0),e);t.forEach(t=>{var e;if(!this.xu.has(t)){var i=this.mu?null==(e=hs(t))?void 0:e.storageGroup:void 0,s=i?Mr.Pt(this.Pu(i)):r();if(s&&t in s)this.Wu(t,s[t],!1);else{if(i){var n=r();if(n&&t in n)return void this.Wu(t,n[t],!1)}this.Vu(t,!1)}}})}}refreshMetaIdentifiers(){this.Ai||(this.gc()?this.mc():this.fc(Ds))}mc(){var t=this.yc();(C(t)||t!==this.bc)&&(this.fc(Ds),this._c(t))}_c(t){void 0===t&&(t=this.yc()),this.bc=0===this.xu.size?t:void 0}refreshMetaIdentifiersBeforeCapture(){this.Ai||this.bu||(this.gc()||this.Ju(),this.mc())}gc(){return this.nu===Cr||this.nu===Jr||this.nu===Gr}yc(){var t=this.nu.Lt(this.Mu);return A(t)?t:void 0}save(){if(!this.Ai){var t=this.tc();t>0?C(this.ac)&&(this.ac=setTimeout(()=>{this.ac=void 0,this.uc()},t)):this.uc()}}flush(){C(this.ac)||(clearTimeout(this.ac),this.ac=void 0,this.uc())}uc(t){if(void 0===t&&(t=!1),!(this.Ai||this.bu&&!t)){t||(this.syncCookieProperties(),this.gc()&&this.refreshMetaIdentifiers());var e=!t&&!this.wu;e||(this.Su=!1);var i=!!e&&this.Fu();if(this.Su)this.Yr.debug&&ce.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(t||this.Ju(),this.mu)return this.wc(),void(i&&this.$u.forEach(t=>t()));var r=this.kc(this.nu,this.Mu,this.props,As);"written"===r&&(this.ec(this.props),this.Zu(this.props)),"failed"!==r&&(this._u.clear(),this.ku=!1,this.xu.clear()),"written"===r&&this._c(),i&&this.$u.forEach(t=>t())}}}wc(){var t=this,e=this.Bu(),i=e.main,r=e.groups,s=this.kc(this.nu,this.Mu,i,As);"written"===s&&(this.ec(i),this.Zu(i)),"failed"!==s&&(this.ku=!1,this.xu.clear(),Ms.forEach(t=>{var e;null!=(e=hs(t))&&e.storageGroup||this._u.delete(t)})),"written"===s&&this._c();var n=function(e){var i,s=r[e];if(R(s)&&(null==(i=t.fu[e])||!i.persisted))return Ms.forEach(i=>{var r;(null==(r=hs(i))?void 0:r.storageGroup)===e&&t._u.delete(i)}),1;var n=t.kc(Mr,t.Pu(e),s,e);"failed"!==n&&Ms.forEach(i=>{var r=hs(i);(null==r?void 0:r.storageGroup)!==e||"written"!==n&&r.volatile||t._u.delete(i)})};for(var o of ns)if(n(o))continue}Bu(){var t={},e={flags:{},surveys:{}};return vr(this.props,(i,r)=>{var s,n=null==(s=hs(r))?void 0:s.storageGroup;n?e[n][r]=i:t[r]=i}),{main:t,groups:e}}Hu(t,e){if(e===As)return JSON.stringify(t)+"|"+this.Sc+"|"+this.xc+"|"+this.$c;var i={};return vr(t,(t,e)=>{var r;i[e]=null!=(r=hs(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}kc(t,e,i,r){var s=this.Du(r);if(r!==As&&!s.dirty&&!C(s.fingerprint))return"skipped";var n,o=i;try{if(o=js(i),(n=this.Hu(o,r))===s.fingerprint)return s.dirty=!1,"skipped"}catch(t){n=void 0}return t.$t(e,o,this.Sc,this.xc,this.$c,this.Yr.debug)?(s.dirty=!1,r!==As&&(s.persisted=!0),C(n)||(s.fingerprint=n),this.pu&&(s.storageValue=Mr.Lt(e)),"written"):(this.Yr.debug&&ce.warn('failed to persist storage entry "'+e+'"; will retry on next save'),"failed")}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(this.Yu(),C(this.ac)||(clearTimeout(this.ac),this.ac=void 0),this.nu.Dt(this.Mu,!1),this.nu.Dt(this.Mu,!0),!i&&this.Cu)for(var r of ns)Mr.Dt(this.Pu(r));i?delete this.fu[As]:this.fu={},this.nc=void 0,this.sc=void 0,this.Qu=void 0}clear(){this.remove(),this.props={},this.Tu=void 0}register_once(t,e,i){if(O(t)){this.syncCookieProperties(),C(e)&&(e="None"),this.Sc=C(i)?this.Cc:i;var r=!1;if(vr(t,(t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Wu(i,t),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(O(t)){this.syncCookieProperties(),this.Sc=C(e)?this.Cc:e;var i=!1;if(vr(t,(e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||O(e)||I(e))&&(this.Wu(r,e),i=!0)}),i)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();var e="string"==typeof t?[t]:t,i=!1;for(var r of e)r in this.props&&(this.Vu(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==h?void 0:h.URL;if(t!==this.Tu){var e=function(t,e,i){if(!h)return{};var r,s=e?[...gs,...i||[]]:[],n=ws(cs(h.URL,s,bs),t);return cr((r={},vr(ys,function(t){var e=$r(t);r[t]=e||null}),r),n)}(this.Yr.custom_campaign_params,this.Yr.mask_personal_data_properties,this.Yr.custom_personal_data_properties),i=!R(pr(e));return i&&this.register(e),this.Tu=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==h?void 0:h.referrer)?$s(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Es(),$referring_domain:null!=h&&h.referrer&&(null==(t=us(h.referrer))?void 0:t.host)||xs},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var t=Ts(this.Yr.mask_personal_data_properties,this.Yr.custom_personal_data_properties,this.Yr.disable_capture_url_hashes);this.register_once({[Li]:this.gu?{r:Cs(t.r),u:t.u?Cs(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};vr([ji,Ui],e=>{var i=this.props[e];i&&vr(i,function(e,i){t["$initial_"+x(i)]=e})});var e=this.props[Li];return e&&cr(t,function(t,e,i,r){void 0===e&&(e=!1);var s=ks(t,e,i,r),n={};return vr(s,function(t,e){n["$initial_"+x(e)]=t}),n}(e,this.Yr.disable_capture_url_hashes,this.Yr.mask_personal_data_properties,this.Yr.custom_personal_data_properties)),t}safe_merge(t){return vr(this.props,function(e,i){i in t||(t[i]=e)}),t}update_config(t,e,r){var s=t.persistence!==e.persistence,n=!((t,e)=>{if(t.length!==e.length)return!1;var i=[...t].sort(),r=[...e].sort();return i.every((t,e)=>t===r[e])})(t.cookie_persisted_properties||[],e.cookie_persisted_properties||[]),o=s||n,a=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,h=t.disable_persistence||!!r,l=!!this.Ai&&!h;h||this.rc(e,l),this.Yr=t,!h&&(s||n||a)&&(this.nc=void 0,this.sc=void 0,this.Qu=void 0,this.rc(i({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),l));var u=o||a?this.Iu(t):this.nu;this.Tc();var d=this.Eu(t),v=o||d!==this.mu,c=!h&&(v||t.cross_subdomain_cookie!==this.xc||t.secure_cookie!==this.$c)&&this.oc(l);this.wu=v;try{if(this.Cc=this.Sc=t.cookie_expiration,this.set_disabled(h),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),v){var _=this.props;this.clear(),this.nu=u,this.mu=d,this.props=_,this.save()}else a&&(this.nu=u,h||(delete this.fu[As],this.uc()))}finally{this.wu=!1,c&&this.cc()}}Tc(){var t=this.props[Li];if(this.gu&&O(t)&&"string"==typeof t.r){var e=Cs(t.r),r="string"==typeof t.u?Cs(t.u):t.u;e===t.r&&r===t.u||this.Wu(Li,i({},t,{r:e,u:r}))}}set_disabled(t){this.Ai=t,this.Ai?this.remove():this.save()}set_cross_subdomain(t){t!==this.xc&&(this.xc=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.$c&&(this.$c=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props.__timers||{};i[t]=e,this.Wu(si,i),this.save()}remove_event_timer(t){var e=this.props.__timers||{},i=e[t];return C(i)||(delete e[t],this.Wu(si,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Wu(t,e),this.save()}Wu(t,e,i){var r;void 0===i&&(i=!0);var s=this.props[t];this.props[t]=e,i&&("distinct_id"!==t&&"$user_state"!==t||s===e||(this.ku=!0),Fs(t)&&!Bs(s,e)&&this.xu.add(t),this.Xu(t,s,e),null!=(r=hs(t))&&r.volatile||this.Ku(t))}Vu(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(Ns(t)&&this.Lu(t,!0),Fs(t)&&this.xu.add(t),this.Ku(t))}Ku(t){var e,i=null==(e=hs(t))?void 0:e.storageGroup;i&&(this.Du(i).dirty=!0)}Du(t){return this.fu[t]||(this.fu[t]={})}},qs={GZipJS:"gzip-js",Base64:"base64"},Ws={Activation:"events",Cancellation:"cancelEvents"},Hs={Button:"button",Tab:"tab",Selector:"selector"},Gs={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},Vs={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Js={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Ks={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Ys={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Xs={Once:"once",Recurring:"recurring",Always:"always"},Qs={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Zs={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},tn={Popover:"popover",Inline:"inline"};function en(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&P(i.then)&&i.then(void 0,()=>{})}}}}var rn={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},sn={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},nn={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},on=_e("[RateLimiter]"),an=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var e=t.text;if(e&&e.length)try{(JSON.parse(e).quota_limited||[]).forEach(t=>{on.info((t||"events")+" is quota limited."),this.serverLimits[t]=/* @__PURE__ */(new Date).getTime()+6e4})}catch(t){return void on.warn('could not rate limit - continuing. Error: "'+(null==t?void 0:t.message)+'"',{text:e})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return(null==(t=this.instance.config.rate_limiting)?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max((null==(t=this.instance.config.rate_limiting)?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}get isClientRateLimited(){return 1>this.Mc().tokens}clientRateLimitContext(t){var e;void 0===t&&(t=!1);var i=this.Mc(),r=1>i.tokens;if(r||t||(i.tokens=Math.max(0,i.tokens-1)),r&&!t){var s=(F(i.dropped)?i.dropped:0)+1;i.dropped=s,!this.lastEventRateLimited&&this.Ic(s)&&(i.dropped=0)}return this.lastEventRateLimited=r,null==(e=this.instance.persistence)||e.set_property(Bi,i),{isRateLimited:r,remainingTokens:i.tokens}}Mc(){var t,e=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,s=/* @__PURE__ */(new Date).getTime(),n=null==(t=this.instance.persistence)?void 0:t.get_property(Bi),o=n?i({},n):{tokens:e,last:s};return o.tokens+=Math.max(0,s-o.last)/1e3*r,o.last=Math.max(o.last,s),o.tokens>e&&(o.tokens=e),o}Ec(t){var e=this.instance.config.property_denylist;return!I(e)||!e.includes(t)}Ac(){var t;if(this.Ec("$current_url")&&this.Ec("$pathname")&&null!=l&&l.pathname)return""+(null!==(t=l.origin)&&void 0!==t?t:"")+l.pathname}Ic(t){var e,i,r=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,n=this.Ac(),o=this.Ec("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,a=[t+" 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 "+s+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&/* @__PURE__ */(new Date).getTime()<e}},hn=/* @__PURE__ */_e("[RemoteConfig]"),ln=class{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=f._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Rc(t){var e=ge(this._instance);e?e(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Pc(t){var e=this._instance.__pending_remote_config_callbacks;if(e)e.push(t);else{var i=[t];this._instance.__pending_remote_config_callbacks=i;try{this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),batchKey:"remote_config",fireCallbackOnDrop:!0,callback:t=>{this._instance.__pending_remote_config_callbacks=void 0,i.forEach(e=>e(t))}})}catch(t){throw this._instance.__pending_remote_config_callbacks=void 0,t}}}load(){try{if(this.remoteConfig)return hn.info("Using preloaded remote config",this.remoteConfig),void this.Oc(this.remoteConfig);if(this._instance._shouldDisableFlags())return void hn.warn("Remote config is disabled. Falling back to local config.");if(!this._instance.config.opt_in_site_apps)return void this.Pc(t=>{this.Oc(t.json,t)});this.Rc(t=>{if(!t)return hn.info("No config found after loading remote JS config. Falling back to JSON."),void this.Pc(t=>{this.Oc(t.json,t)});this.Oc(t)})}catch(t){hn.error("Error loading remote config",t),this.Oc()}}Oc(t,e){!t&&e&&(0===e.statusCode?e.error||hn.warn("Failed to fetch remote config from PostHog."):hn.error("Failed to fetch remote config from PostHog."));try{this._instance.Oc(t?{ok:!0,config:t}:{ok:!1})}catch(t){hn.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(t){hn.error("Error loading feature flags",t)}}},un=["fatal","error","warning","log","info","debug"],dn=Uint8Array,vn=Uint16Array,cn=Uint32Array,_n=new dn([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]),pn=new dn([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]),fn=new dn([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),gn=function(t,e){for(var i=new vn(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var s=new cn(i[30]);for(r=1;30>r;++r)for(var n=i[r];i[r+1]>n;++n)s[n]=n-i[r]<<5|r;return[i,s]},mn=gn(_n,2),bn=mn[1];mn[0][28]=258,bn[258]=28;for(var yn=gn(pn,0)[1],wn=new vn(32768),$n=0;32768>$n;++$n){var Sn=(43690&$n)>>>1|(21845&$n)<<1;wn[$n]=((65280&(Sn=(61680&(Sn=(52428&Sn)>>>2|(13107&Sn)<<2))>>>4|(3855&Sn)<<4))>>>8|(255&Sn)<<8)>>>1}var xn=function(t,e,i){for(var r=t.length,s=0,n=new vn(e);r>s;++s)++n[t[s]-1];var o,a=new vn(e);for(s=0;e>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new vn(1<<e);var h=15-e;for(s=0;r>s;++s)if(t[s])for(var l=s<<4|t[s],u=e-t[s],d=a[t[s]-1]++<<u,v=d|(1<<u)-1;v>=d;++d)o[wn[d]>>>h]=l}else for(o=new vn(r),s=0;r>s;++s)o[s]=wn[a[t[s]-1]++]>>>15-t[s];return o},En=new dn(288);for($n=0;144>$n;++$n)En[$n]=8;for($n=144;256>$n;++$n)En[$n]=9;for($n=256;280>$n;++$n)En[$n]=7;for($n=280;288>$n;++$n)En[$n]=8;var Tn=new dn(32);for($n=0;32>$n;++$n)Tn[$n]=5;var kn=/*#__PURE__*/xn(En,9,0),In=/*#__PURE__*/xn(Tn,5,0),Pn=function(t){return(t/8|0)+(7&t&&1)},On=function(t,e,i){(null==e||0>e)&&(e=0),(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof vn?vn:t instanceof cn?cn:dn)(i-e);return r.set(t.subarray(e,i)),r},Rn=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Cn=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},An=function(t,e){for(var i=[],r=0;t.length>r;++r)t[r]&&i.push({s:r,f:t[r]});var s=i.length,n=i.slice();if(!s)return[new dn(0),0];if(1==s){var o=new dn(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(t,e){return t.f-e.f}),i.push({s:-1,f:25001});var a=i[0],h=i[1],l=0,u=1,d=2;for(i[0]={s:-1,f:a.f+h.f,l:a,r:h};u!=s-1;)a=i[i[d].f>i[l].f?l++:d++],h=i[l!=u&&i[d].f>i[l].f?l++:d++],i[u++]={s:-1,f:a.f+h.f,l:a,r:h};var v=n[0].s;for(r=1;s>r;++r)n[r].s>v&&(v=n[r].s);var c=new vn(v+1),_=Mn(i[u-1],c,0);if(_>e){r=0;var p=0,f=_-e,g=1<<f;for(n.sort(function(t,e){return c[e.s]-c[t.s]||t.f-e.f});s>r;++r){var m=n[r].s;if(e>=c[m])break;p+=g-(1<<_-c[m]),c[m]=e}for(p>>>=f;p>0;){var b=n[r].s;e>c[b]?p-=1<<e-c[b]++-1:++r}for(;r>=0&&p;--r){var y=n[r].s;c[y]==e&&(--c[y],++p)}_=e}return[new dn(c),_]},Mn=function(t,e,i){return-1==t.s?Math.max(Mn(t.l,e,i+1),Mn(t.r,e,i+1)):e[t.s]=i},Nn=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new vn(++e),r=0,s=t[0],n=1,o=function(t){i[r++]=t},a=1;e>=a;++a)if(t[a]==s&&a!=e)++n;else{if(!s&&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(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=t[a]}return[i.subarray(0,r),e]},Dn=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Fn=function(t,e,i){var r=i.length,s=Pn(e+2);t[s]=255&r,t[s+1]=r>>>8,t[s+2]=255^t[s],t[s+3]=255^t[s+1];for(var n=0;r>n;++n)t[s+n+4]=i[n];return 8*(s+4+r)},Bn=function(t,e,i,r,s,n,o,a,h,l,u){Rn(e,u++,i),++s[256];for(var d=An(s,15),v=d[0],c=d[1],_=An(n,15),p=_[0],f=_[1],g=Nn(v),m=g[0],b=g[1],y=Nn(p),w=y[0],S=y[1],x=new vn(19),E=0;m.length>E;++E)x[31&m[E]]++;for(E=0;w.length>E;++E)x[31&w[E]]++;for(var T=An(x,7),k=T[0],I=T[1],P=19;P>4&&!k[fn[P-1]];--P);var O,R,C,A,M=l+5<<3,N=Dn(s,En)+Dn(n,Tn)+o,D=Dn(s,v)+Dn(n,p)+o+14+3*P+Dn(x,k)+(2*x[16]+3*x[17]+7*x[18]);if(N>=M&&D>=M)return Fn(e,u,t.subarray(h,h+l));if(Rn(e,u,1+(N>D)),u+=2,N>D){O=xn(v,c,0),R=v,C=xn(p,f,0),A=p;var F=xn(k,I,0);for(Rn(e,u,b-257),Rn(e,u+5,S-1),Rn(e,u+10,P-4),u+=14,E=0;P>E;++E)Rn(e,u+3*E,k[fn[E]]);u+=3*P;for(var B=[m,w],U=0;2>U;++U){var j=B[U];for(E=0;j.length>E;++E)Rn(e,u,F[L=31&j[E]]),u+=k[L],L>15&&(Rn(e,u,j[E]>>>5&127),u+=j[E]>>>12)}}else O=kn,R=En,C=In,A=Tn;for(E=0;a>E;++E)if(r[E]>255){var L;Cn(e,u,O[257+(L=r[E]>>>18&31)]),u+=R[L+257],L>7&&(Rn(e,u,r[E]>>>23&31),u+=_n[L]);var z=31&r[E];Cn(e,u,C[z]),u+=A[z],z>3&&(Cn(e,u,r[E]>>>5&8191),u+=pn[z])}else Cn(e,u,O[r[E]]),u+=R[r[E]];return Cn(e,u,O[256]),u+R[256]},Un=/*#__PURE__*/new cn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),jn=/*#__PURE__*/new dn(0),Ln=/*#__PURE__*/function(){for(var t=new cn(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),zn=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function qn(t,e){void 0===e&&(e={});var i=function(){var t=4294967295;return{p(e){for(var i=t,r=0;e.length>r;++r)i=Ln[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var s,n,o,a,h,l,u=(a=10+((s=e).filename&&s.filename.length+1||0),h=8,function(t,e,i,r,s,n){var o=t.length,a=new dn(r+o+5*(1+Math.floor(o/7e3))+s),h=a.subarray(r,a.length-s),l=0;if(!e||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=Fn(h,l,t.subarray(u,d)):(h[u]=n,l=Fn(h,l,t.subarray(u,o)))}else{for(var v=Un[e-1],c=v>>>13,_=8191&v,p=(1<<i)-1,f=new vn(32768),g=new vn(p+1),m=Math.ceil(i/3),b=2*m,y=function(e){return(t[e]^t[e+1]<<m^t[e+2]<<b)&p},w=new cn(25e3),S=new vn(288),x=new vn(32),E=0,T=0,k=(u=0,0),I=0,P=0;o>u;++u){var O=y(u),R=32767&u,C=g[O];if(f[R]=C,g[O]=R,u>=I){var A=o-u;if((E>7e3||k>24576)&&A>423){l=Bn(t,h,0,w,S,x,T,k,P,u-P,l),k=E=T=0,P=u;for(var M=0;286>M;++M)S[M]=0;for(M=0;30>M;++M)x[M]=0}var N=2,D=0,F=_,B=R-C&32767;if(A>2&&O==y(u-B))for(var U=Math.min(c,A)-1,j=Math.min(32767,u),L=Math.min(258,A);j>=B&&--F&&R!=C;){if(t[u+N]==t[u+N-B]){for(var z=0;L>z&&t[u+z]==t[u+z-B];++z);if(z>N){if(N=z,D=B,z>U)break;var q=Math.min(B,z-2),W=0;for(M=0;q>M;++M){var H=u-B+M+32768&32767,G=H-f[H]+32768&32767;G>W&&(W=G,C=H)}}}B+=(R=C)-(C=f[R])+32768&32767}if(D){w[k++]=268435456|bn[N]<<18|yn[D];var V=31&bn[N],J=31&yn[D];T+=_n[V]+pn[J],++S[257+V],++x[J],I=u+N,++E}else w[k++]=t[u],++S[t[u]]}}l=Bn(t,h,n,w,S,x,T,k,P,u-P,l),n||(l=Fn(h,l,jn))}return On(a,0,r+Pn(l)+s)}(n=t,null==(o=e).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+o.mem,a,h,!l)),d=u.length;return function(t,e){var i=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=2>e.level?4:9==e.level?2:0,t[9]=3,0!=e.mtime&&zn(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),i){t[3]=8;for(var r=0;i.length>=r;++r)t[r+10]=i.charCodeAt(r)}}(u,e),zn(u,d-8,i.d()),zn(u,d-4,r),u}var Wn=!!d||!!u,Hn=/* @__PURE__ */new WeakMap,Gn="text/plain",Vn=0,Jn=!1,Kn=(t,e)=>{var i=t.split("#"),r=i[1],s=i[0].split("?"),n=s[0],o=s[1];if(!o)return t;var a=o.split("&").filter(t=>t.split("=")[0]!==e).join("&");return n+(a?"?"+a:"")+(r?"#"+r:"")},Yn=function(t,e,r){void 0===r&&(r=!0);var s=t.indexOf("#"),n=-1===s?"":t.slice(s),o=-1===s?t:t.slice(0,s),a=o.indexOf("?"),h=-1===a?o:o.slice(0,a),l=-1===a?"":o.slice(a+1),u=i({},e),d=l.split("&").filter(t=>""!==t).map(t=>{var e=t.indexOf("="),i=-1===e?t:t.slice(0,e),s=r?u[i]:void 0;return delete u[i],D(s)?t:i+"="+s}),v=function(t,e){var i,r;void 0===e&&(e="&");var s=[];return vr(t,function(t,e){C(t)||C(e)||"undefined"===e||(i=encodeURIComponent((t=>t instanceof File)(t)?t.name:t.toString()),r=encodeURIComponent(e),s[s.length]=r+"="+i)}),s.join(e)}(u);return v&&d.push(v),""+(d.length>0?h+"?"+d.join("&"):h)+n},Xn=t=>{if(t.Mr)return t.Mr;var e=t.data,i=t.compression;if(e){if(i===qs.GZipJS){var r=qn(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new dn(t.length+(t.length>>>1)),r=0,s=function(t){i[r++]=t},n=0;e>n;++n){if(r+5>i.length){var o=new dn(r+8+(e-n<<1));o.set(i),i=o}var a=t.charCodeAt(n);128>a?s(a):2048>a?(s(192|a>>>6),s(128|63&a)):a>55295&&57344>a?(s(240|(a=65536+(1047552&a)|1023&t.charCodeAt(++n))>>>18),s(128|a>>>12&63),s(128|a>>>6&63),s(128|63&a)):(s(224|a>>>12),s(128|a>>>6&63),s(128|63&a))}return On(i,0,r)}(ds(e)),{mtime:0});return{contentType:Gn,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===qs.Base64){var s=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(ds(e)),n="sendBeacon"===t.transport,o=n?s:(t=>"data="+encodeURIComponent("string"==typeof t?t:ds(t)))(s);return{contentType:n?Gn:"application/x-www-form-urlencoded",body:o,estimatedSize:new Blob([o]).size}}var a=ds(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Qn=t=>{var e,r,s=()=>"sendBeacon"===t.transport?{url:Yn(t.url,{compression:qs.Base64}),encodedBody:Xn(i({},t,{compression:qs.Base64,Mr:void 0}))}:{url:Kn(t.url,"compression"),encodedBody:Xn(i({},t,{compression:void 0,Mr:void 0}))};try{e=Xn(t)}catch(e){if(se(t.compression,vs(t.url,"compression")))return ce.error("Failed to gzip request body, sending uncompressed payload",e),s();throw e}return e&&se(t.compression,vs(t.url,"compression"))&&!((r=e.body)instanceof ArrayBuffer?re(new Uint8Array(r)):ArrayBuffer.isView(r)&&re(new Uint8Array(r.buffer,r.byteOffset,r.byteLength)))?(Jn=!0,s()):{url:t.url,encodedBody:e}},Zn=t=>{try{return Qn(t)}catch(e){return ce.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},to=/*#__PURE__*/function(){var t=s(function*(t){var e=yield function(t,e,i){return ue.apply(this,arguments)}(ds(t.data),Ee.DEBUG,{rethrow:!0});if(!e)return t;var r=yield e.arrayBuffer();return i({},t,{Mr:{contentType:Gn,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}}(),eo=t=>Qt("AbortError","PostHog request timed out"+(t?" after "+t+"ms":"")),io=/Failed to fetch|NetworkError|Load failed/i,ro=t=>"TypeError"===(null==t?void 0:t.name)&&io.test((null==t?void 0:t.message)||""),so=t=>{try{var e=function(t,e,i){if(void 0===e&&(e=Date.now()),void 0===i&&(i=3e5),"string"==typeof t&&t){var r=t.trim(),s=/^\d+\s*,/.test(r)?r.slice(0,r.indexOf(",")).trim():r;if(/^\d+$/.test(s)){var n=1e3*Math.min(Number(s),i/1e3);return n>0?n:void 0}if(/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[a-z]*[ ,]/.test(s)){var o=/^\w{3} \w{3} /.test(s)?s+" GMT":s,a=Date.parse(o)-e;if(Number.isFinite(a)&&a>0)return Math.min(a,i)}}}(t());return C(e)?void 0:Math.min(e,3e4)}catch(t){return}},no=t=>{var e=Zn(t);if(e){var i=new d;Hn.set(i,!0);var r=e.url,s=e.encodedBody;i.open(t.method||"GET",r,!0);var n=null!=s?s:{},o=n.contentType,a=n.body;vr(t.headers,function(t,e){i.setRequestHeader(e,t)}),o&&i.setRequestHeader("Content-Type",o),t.timeout&&(i.timeout=t.timeout);var h=!1;i.ontimeout=()=>{h=!0},i.onloadend=()=>{if(h){var e=eo(t.timeout);return ce.warn(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}var r={statusCode:i.status,text:i.responseText};if(200===i.status)try{r.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(r,so(()=>i.getResponseHeader("Retry-After")))},null==t.onSend||t.onSend(r),i.send(a)}},oo=t=>{var e=Zn(t);if(e){var r=e.url,s=e.encodedBody,n=null!=s?s:{},o=n.contentType,a=n.body,h=n.estimatedSize,l=new Headers;vr(t.headers,function(t,e){l.append(e,t)}),o&&l.append("Content-Type",o);var d=null,c=!1;if(v){var _=new v;d={signal:_.signal,timeout:setTimeout(()=>{c=!0;try{_.abort(eo(t.timeout))}catch(t){f(t)}},t.timeout)}}var p=!1,f=e=>{p||(p=!0,c&&"AbortError"===(null==e?void 0:e.name)||ro(e)?ce.warn(e):ce.error(e),null==t.callback||t.callback({statusCode:0,error:e}))},g=0,m=()=>{Vn-=g,g=0,d&&clearTimeout(d.timeout)};try{var b,y=i({method:(null==t?void 0:t.method)||"GET",headers:l,referrerPolicy:"strict-origin",body:a,signal:null==(b=d)?void 0:b.signal},t.fetchOptions);null==t.onSend||t.onSend(r);var w=null!=h?h:C(a)?0:void 0;y.keepalive="POST"===y.method&&!t.tu&&!1!==y.keepalive&&y.body===a&&!C(w)&&w>=0&&52428.8>Vn+w,y.keepalive&&(Vn+=g=w),u(r,y).then(e=>e.text().then(i=>{if(!p){var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){ce.error(t)}p=!0,m(),null==t.callback||t.callback(r,so(()=>e.headers.get("Retry-After")))}})).catch(t=>{m(),f(t)}).finally(m)}catch(t){m(),f(t)}}},ao=t=>{try{var e,r=Qn(t),s=r.url,n=r.encodedBody,o=null!=n?n:{},h=o.body,l=o.estimatedSize;if(!h)return;var d=h instanceof Blob?h:new Blob([h],{type:o.contentType});if(a.sendBeacon(s,d))return;var v=I(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(I(v)&&v.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(v.length/2),_=e=>I(t.data)?e:i({},t.data,{batch:e});return ao(i({},t,{data:_(v.slice(0,c))})),void ao(i({},t,{data:_(v.slice(c))}))}ce.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to "+(u?"fetch":"XHR")),u?oo(i({},t,{tu:!0})):no(t)}catch(t){ce.warn("Beacon send failed",t)}},ho=(t,e,r,s)=>{var n="query"===s?"POST"===e?"sent_at":"_":void 0;return Yn(r===qs.GZipJS?Kn(t,"compression"):t,i({},n?{[n]:Date.now().toString()}:{},r===qs.GZipJS?{}:{compression:r}))},lo=/* @__PURE__ */(()=>{var t=[];return u&&t.push({transport:"fetch",method:oo}),d&&t.push({transport:"XHR",method:no}),null!=a&&a.sendBeacon&&t.push({transport:"sendBeacon",method:ao}),t})(),uo=!Wn&&-1===(null==_?void 0:_.indexOf("MSIE"))&&-1===(null==_?void 0:_.indexOf("Mozilla"));function vo(t,e,r){var s;r&&(e=i({},e,{callback:t=>r(t)})),t.__loaded?uo?t.__request_queue.push(e):t.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||t.config.api_transport,e.headers=i({},t.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!==(s=t.compression)&&void 0!==s?s:e.compressionFallback:e.compression,(C(t.config.disable_beacon)?t.config.__preview_disable_beacon:t.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||t.config.fetch_options,null==e.onDispatch||e.onDispatch(),((t,e)=>{var r,s,n,o=i({},t,{callback:null!=e?e:e=>null==t.callback?void 0:t.callback(e)});o.timeout=o.timeout||6e4;var a,h,l,u,d,v=null!==(r=o.transport)&&void 0!==r?r:"fetch";"sendBeacon"===v&&C(o.compression)&&o.data&&(o.compression=qs.Base64),"POST"===o.method&&o.data&&("capture-body"===o.timestampMode?o.data={api_key:null!==(h=null==(d=(u=(I(a=o.data)?a:[a]).map(t=>i({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{})))[0])||null==(l=d.properties)?void 0:l.token)&&void 0!==h?h:null==d?void 0:d.token,batch:u,sent_at:/* @__PURE__ */(new Date).toISOString()}:"body"===o.timestampMode&&(o.data=function(t,e){return void 0===e&&(e=/* @__PURE__ */(new Date).toISOString()),I(t)?t.map(t=>i({},t,{sent_at:e})):i({},t,{sent_at:e})}(o.data))),o.url=ho(o.url,o.method,o.compression,o.timestampMode);var _=lo.filter(t=>!o.disableTransport||!t.transport||!o.disableTransport.includes(t.transport)),p=null!==(s=null==(n=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(_,t=>t.transport===v))?void 0:n.method)&&void 0!==s?s:_[0].method;if(!p)throw new Error("No available transport method");var f=t=>{try{p(t)}catch(t){ro(t)?ce.warn(t):ce.error(t),null==o.callback||o.callback({statusCode:0,error:t})}};"sendBeacon"!==v&&!o.preferSyncCompression&&o.data&&o.compression===qs.GZipJS&&c&&"undefined"!=typeof Promise&&!Jn?to(o).then(t=>{f(t)}).catch(e=>{if(ne(e))return Jn=!0,void f(i({},o,{compression:void 0,url:ho(t.url,t.method,void 0,t.timestampMode)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return ne(t)||e===ie})(e)&&(Jn=!0),f(o)}):f(o)})(e,(i,s)=>{t.rateLimiter.checkForLimiting(i),400>i.statusCode||null==t.config.on_request_error||t.config.on_request_error(i),r?r(i,s):null==e.callback||e.callback(i)})):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}var co=class{constructor(t,e){this.Lc=!0,this.Dc=[],this.Nc=K((null==e?void 0:e.flush_interval_ms)||3e3,250,5e3,ce.createLogger("flush interval"),3e3),this.jc=t}enqueue(t){this.Dc.push(t),this.qc||this.Bc()}unload(){this.zc();var t=this.Dc.length>0?this.Hc():{},e=Object.values(t);[...e.filter(t=>0===t.url.indexOf("/e")),...e.filter(t=>0!==t.url.indexOf("/e"))].map(t=>{this.Uc(i({},t,{callback:void 0}),"sendBeacon")})}enable(){this.Lc=!1,this.Bc()}Bc(){this.Lc||(this.qc=setTimeout(()=>{this.zc(),this.Wc()},this.Nc))}Wc(){if(this.Dc.length>0){var t=this.Hc();for(var e in t)this.Uc(t[e])}}Uc(t,e){try{this.jc(t,e)}catch(t){ce.error(t)}}zc(){clearTimeout(this.qc),this.qc=void 0}Hc(){var t={},e={};vr(this.Dc,r=>{var s,n=r,o=((n?n.batchKey:null)||n.url)+(n.batchGroup?":"+n.batchGroup:"");C(t[o])&&(t[o]=i({},n,{data:[],callback:void 0,fireCallbackOnDrop:void 0}),e[o]=[]),null==(s=t[o].data)||s.push(n.data),n.callback&&e[o].push(n.callback)});var r=function(){var i=e[s];i.length&&(t[s].callback=t=>{for(var e of i)e(t)})};for(var s in e)r();return this.Dc=[],t}},_o=class{constructor(t){this._instance=t,this.Vc=!1,this.Gc=3e3,this.Dc=[],this.Dc=[],this.Jc=!0,this.resume()}resume(){if(!C(n)&&"onLine"in n.navigator){if(this.Jc=n.navigator.onLine,this.Qc)return;this.Qc=()=>{this.Jc=!0,this.Wc()},this.Zc=()=>{this.Jc=!1},br(n,"online",this.Qc),br(n,"offline",this.Zc)}}get length(){return this.Dc.length}retriableRequest(t,r){var s=t.retriesPerformedSoFar,n=function(t,e){if(null==t)return{};var i={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(-1!==e.indexOf(r))continue;i[r]=t[r]}return i}(t,e);B(s)&&(n.url=Yn(n.url,{retry_count:s})),vo(this._instance,r?i({},n,{transport:r}):n,(t,e)=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=s?s:0))return void this.js(i({retriesPerformedSoFar:s},n),e);0===t.statusCode&&ce.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!=s?s:0)+" retries.")}null==n.callback||n.callback(t)})}js(t,e){var i=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=i+1;var r=Math.max(function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),s=(Math.random()-.5)*(r-i);return Math.ceil(r+s)}(i),null!=e?e:0),s=Date.now()+r;this.Dc.push({retryAt:s,requestOptions:t});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),ce.warn(n),this.Vc||(this.Vc=!0,this.Kc())}Kc(){if(this.Yc&&clearTimeout(this.Yc),0===this.Dc.length)return this.Vc=!1,void(this.Yc=void 0);this.Yc=setTimeout(()=>{this.Jc&&this.Dc.length>0&&this.Wc(),this.Kc()},this.Gc)}Wc(){var t=Date.now(),e=[],i=this.Dc.filter(i=>t>i.retryAt||(e.push(i),!1));if(this.Dc=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var t of(this.Yc&&(clearTimeout(this.Yc),this.Yc=void 0),this.Vc=!1,C(n)||(this.Qc&&(n.removeEventListener("online",this.Qc),this.Qc=void 0),this.Zc&&(n.removeEventListener("offline",this.Zc),this.Zc=void 0)),this.Dc)){var e=t.requestOptions;try{this._instance._send_request(i({},e,{callback:I(e.data)?void 0:e.callback,transport:"sendBeacon"}))}catch(t){ce.error(t)}}this.Dc=[]}},po=class{constructor(t){this._instance=t,this.Xc=()=>{var t,e,i,r;this.eh||(this.eh={});var s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),h=(null==s?void 0:s.scrollHeight)||0;this.eh.lastScrollY=Math.ceil(n),this.eh.maxScrollY=Math.max(n,null!==(t=this.eh.maxScrollY)&&void 0!==t?t:0),this.eh.maxScrollHeight=Math.max(o,null!==(e=this.eh.maxScrollHeight)&&void 0!==e?e:0),this.eh.lastContentY=a,this.eh.maxContentY=Math.max(a,null!==(i=this.eh.maxContentY)&&void 0!==i?i:0),this.eh.maxContentHeight=Math.max(h,null!==(r=this.eh.maxContentHeight)&&void 0!==r?r:0)}}get ih(){return this._instance.config.scroll_root_selector}getContext(){return this.eh}resetContext(){var t=this.eh;return this.eh=void 0,setTimeout(this.Xc,0),t}startMeasuringScrollPosition(){br(n,"scroll",this.Xc,{capture:!0}),br(n,"scrollend",this.Xc,{capture:!0}),br(n,"resize",this.Xc)}scrollElement(){var t;if(!this.ih)return null==n||null==(t=n.document)?void 0:t.documentElement;for(var e of I(this.ih)?this.ih:[this.ih]){var i,r=null==n||null==(i=n.document)?void 0:i.querySelector(e);if(r)return r}}nh(t){var e,i,r="y"===t?"scrollTop":"scrollLeft";if(this.ih){var s=this.scrollElement();return s&&s[r]||0}return n?"y"===t?n.scrollY||n.pageYOffset||(null==(e=n.document)||null==(e=e.documentElement)?void 0:e.scrollTop)||0:n.scrollX||n.pageXOffset||(null==(i=n.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.nh("y")}scrollX(){return this.nh("x")}},fo=t=>Ts(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes),go=class{constructor(t,e,i,r){this.Je=t=>{var e=this.sh();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.rh(this._instance)};this.oh.register({[Fi]:i})}},this._instance=t,this.ah=e,this.oh=i,this.rh=r||fo,this.ah.onSessionId(this.Je)}sh(){return this.oh.props[Fi]}getSetOnceProps(){var t,e=null==(t=this.sh())?void 0:t.props;return e?"r"in e?ks(e,this._instance.config.disable_capture_url_hashes,this._instance.config.mask_personal_data_properties,this._instance.config.custom_personal_data_properties):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return vr(pr(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+x(i)]=e}),t}},mo=class{on(t,e){return this.Zo[t]||(this.Zo[t]=[]),this.Zo[t].push(e),()=>{this.Zo[t]=this.Zo[t].filter(t=>t!==e)}}emit(t,e){for(var i of this.Zo[t]||[])i(e);for(var r of this.Zo["*"]||[])r(t,e)}constructor(){this.Zo={}}},bo=_e("[SessionId]"),yo=864e5,wo=class{on(t,e){return this.uh.on(t,e)}constructor(t,e,i){var r;if(this.hh=null,this.dh=null,this.fh=[],this.ph=void 0,this.gh=!1,this.uh=new mo,this.mh=(t,e)=>!(!B(t)||!B(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if("always"===t.config.cookieless_mode)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Yr=t.config,this.oh=t.persistence,this.Ye=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.yh=void 0,this._sessionActivityTimestamp=null,this.bh=e||kr,this._h=i||kr;var s=this.Yr.persistence_name||this.Yr.token;if(this._sessionTimeoutMs=1e3*K(this.Yr.session_idle_timeout_seconds||1800,60,36e3,bo.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.wh(),this.kh="ph_"+s+"_window_id",this.Sh="ph_"+s+"_primary_window_exists",this.xh()){var n=Jr.Pt(this.kh),o=Jr.Pt(this.Sh);n&&!o?this.Ye=n:Jr.Dt(this.kh),Jr.$t(this.Sh,!0)}null!=(r=this.Yr.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.Yr.bootstrap.sessionID),this.$h()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return C(this.fh)&&(this.fh=[]),this.fh.push(t),this.Xt&&t(this.Xt,this.Ye),()=>{this.fh=this.fh.filter(e=>e!==t)}}xh(){return"memory"!==this.Yr.persistence&&!this.oh.Ai&&Jr.Ot()}Ch(t){t!==this.Ye&&(this.Ye=t,this.xh()&&Jr.$t(this.kh,t))}Th(){return this.Ye?this.Ye:this.xh()?Jr.Pt(this.kh):null}Mh(t){var e=this.hh;return!N(e)&&!N(t)&&5e3>Math.abs(t-e)}Ih(t,e,i){var r=e!==this._sessionActivityTimestamp,s=!(t!==this.Xt||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Xt=t,s&&!r||s&&this.Mh(e)||(this.hh=e,this.oh.register({[wi]:[e,t,i]}))}Eh(){var t,e=null==(t=this.Yr)?void 0:t.persistence_save_debounce_ms;return B(e)&&e>0}Ah(){this.Eh()?this.oh.refreshKey(wi):(this.oh.flush(),this.oh.load())}Rh(){var t;if(!N(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.hh){this.Ah();var e=this.Ph();e[1]===this.Xt&&e[2]===this._sessionStartTimestamp&&(this.hh=this._sessionActivityTimestamp,this.oh.register({[wi]:[this._sessionActivityTimestamp,null!==(t=this.Xt)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.oh.flush())}}Oh(){var t=this.Ph()[0],e=B(t)?t:0,i=B(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}Fh(t){return this.Ah(),this.mh(t,this.Oh())}Ph(){var t=this.oh.props[wi];return I(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.hh=null,this.yh=void 0,clearTimeout(this.Lh),this.Lh=void 0,this.Ih(null,null,null)}setBootstrapSessionId(t,e){void 0===e&&(e=!1);var i=function(t,e){void 0===e&&(e=/* @__PURE__ */(new Date).getTime());try{var i=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(t);return i>e+6e4?void bo.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void bo.error("Invalid sessionID in bootstrap",t)}}(t);return!C(i)&&(e?this.yh={sessionId:t,sessionStartTimestamp:i}:this.Ih(t,/* @__PURE__ */(new Date).getTime(),i),!0)}destroy(){this.gh=!0,this.Rh(),clearTimeout(this.Lh),this.Lh=void 0,this.ph&&n&&(n.removeEventListener(or,this.ph,{capture:!1}),this.ph=void 0),this.fh=[]}$h(){this.ph=()=>{this.Rh(),this.xh()&&Jr.Dt(this.Sh)},br(n,or,this.ph,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),"always"===this.Yr.cookieless_mode)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||/* @__PURE__ */(new Date).getTime(),s=this.Xt;if(i)this.dh=r;else if(N(this.dh)||this.dh>r||r-this.dh>=1e3){var n,o;null==(n=(o=this.oh).syncCookieProperties)||n.call(o),this.dh=r}var a=this.Ph(),h=a[1],l=a[2],u=!C(s)&&h!==s,d=this.Oh(),v=this.Th(),c=this.yh,_=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>yo),p=c?_:B(l)&&Math.abs(r-l)>yo,f=!1,g=u,m=!h||!!c,b=h,y=!m&&!t&&this.mh(r,d);if(y){(y=this.Fh(r))||bo.info("cross-tab refresh kept the session alive",{sessionId:h});var w=this.Ph();h=w[1],l=w[2],y||(m=!h||!!c)}if(m||y||p){g=!1;var S=c&&!_;h=S?c.sessionId:this.bh(),v=this._h(),bo.info("new session ID assigned",{sessionId:h,windowId:v,bootstrapped:!!S,changeReason:{noSessionId:m,activityTimeout:y,sessionPastMaximumLength:p}}),l=S?c.sessionStartTimestamp:r,this.yh=void 0,f=!0}else v||(v=this._h(),f=!0),(g=g||h!==b)&&(bo.info("adopted cross-tab session id",{sessionId:h,windowId:v}),f=!0);var x=B(d)&&t&&!p?d:r,E=B(l)?l:/* @__PURE__ */(new Date).getTime();this.Ch(v),this.Ih(h,x,E),t||this.wh();var T={noSessionId:m,activityTimeout:y,sessionPastMaximumLength:p,crossTabAdoption:g};return f&&this.fh.forEach(t=>t(h,v,T)),{sessionId:h,windowId:v,sessionStartTimestamp:E,changeReason:f?T:void 0,lastActivityTimestamp:d}}wh(){this.gh||(clearTimeout(this.Lh),this.Lh=setTimeout(()=>{if(!this.gh)if(this.Fh(/* @__PURE__ */(new Date).getTime())){var t=this.Xt;this.resetSessionId(),this.uh.emit("forcedIdleReset",{idleSessionId:t})}else this.wh()},1.1*this.sessionTimeoutMs))}},$o=Object.freeze(["2026-08-30","2026-08-29","2026-06-25","2026-05-30","2026-01-30","2025-11-30","2025-05-24"]);function So(){return(So=s(function*(){var t=null==a?void 0:a.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e,i=null==(e=yield t.getHighEntropyValues(["model"]))?void 0:e.model;return A(i)&&i.length>0?i:void 0}catch(t){return void ce.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})).apply(this,arguments)}function xo(t,e){var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i}function Eo(t,e,i){return ds({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var To,ko="custom",Io="i.posthog.com",Po=/^\/static\//,Oo=["/s/","/e/","/i/"],Ro=class{constructor(t){this.Dh={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,e=null==(t=this.instance.config.ui_host)?void 0:t.replace(/\/$/,"");return e||(e=this.apiHost.replace("."+Io,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.Dh[this.apiHost]||(this.Dh[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":ko),this.Dh[this.apiHost]}Nh(t){if(Po.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}jh(t){var e=us(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}qh(t,e,i){if("ui"===t)return i;var r=i,s=this.instance.config.rewriteRequestPath;if(s){var n,o=(null==(n=us(i))?void 0:n.href)||i;r=s(new URL(o)).toString()}if(s&&"api"===t&&Oo.some(t=>0===e.indexOf(t))){var a=this.jh(r);if(a){var h,l=this.apiHost,u=this.Bh;(null==(h=u)?void 0:h.apiHost)===l&&u.rewriteRequestPath===s||(this.Bh=u={apiHost:l,rewriteRequestPath:s,urls:/* @__PURE__ */new Set}),u.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Bh,i=this.jh(t);return(null==e?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&e.urls.has(i)}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.qh(t,e,this.uiHost+e);if("flags"===t)return this.qh(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.Nh(e);if(i)return this.qh(t,e,""+i+e)}if(this.region===ko)return this.qh(t,e,this.apiHost+e);var r=Io+e;switch(t){case"assets":return this.qh(t,e,"https://"+this.region+"-assets."+r);case"api":return this.qh(t,e,"https://"+this.region+"."+r)}}},Co=/* @__PURE__ */_e("[Surveys]"),Ao={ignoreConditions:!1,ignoreDelay:!1,displayType:tn.Popover},Mo=_e("[PostHog ExternalIntegrations]"),No={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Do=class{constructor(t){this._instance=t}lu(t,e){var i;null==(i=ge(this._instance))||i(this._instance,t,t=>{if(t)return Mo.error("failed to load script",t);e()})}startIfEnabledOrStop(){var t=this,e=function(){var e,r,s,n=i[0],o=i[1];!o||null!=(e=f.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.lu(No[n],()=>{var e;null==(e=f.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!o&&null!=(r=f.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[n]&&(null==(s=f.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[n])||s.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;e()}}},Fo=()=>{var t;return null!=n&&null!=(t=n.performance)&&t.now?n.performance.now():Date.now()},Bo=[],Uo=[50,75,100,150,200,300,400,500,750,1e3,1500,2e3,3e3,5e3,1e4],jo=[5,10,25,...Uo],Lo=class{constructor(t){this._instance=t}initialize(){}get(t){var e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);var i={};for(var r of t){var s=null==e?void 0:e.get_property(r);C(s)||(i[r]=s)}return i}set(t,e){var i;null==(i=this._instance.persistence)||i.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}},zo=class{constructor(t){this.instance=t,this.R=ce,this.kv=new Lo(t),this.onSession=t=>en(this.instance.onSessionId(e=>{try{t(e)}catch(t){this.R.error("Browser extension session listener failed",t)}})),this.onEvent=t=>en(this.instance._addCaptureHook((e,i)=>{if(i)try{t({event:e,properties:i.properties})}catch(t){this.R.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{var e=e=>{try{t(e)}catch(t){this.R.error("Browser extension remote config listener failed",t)}},i=this.instance.Tr.on("extensionsRemoteConfig",e);return this.instance.Ir&&e(this.instance.Ir),en(i)}}get logger(){return this.R}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property("$device_id"))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(Ye);return"string"==typeof t?t:void 0}get library(){return{name:Ee.LIB_NAME,version:Ee.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null==(e=this.instance.persistence)?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,i,r,s,n=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==n?void 0:n.sessionId)&&void 0!==e?e:"",windowId:null!==(i=null==n?void 0:n.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(r=null==n?void 0:n.sessionStartTimestamp)&&void 0!==r?r:0,lastActivityTimestamp:null!==(s=null==n?void 0:n.lastActivityTimestamp)&&void 0!==s?s:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0,lastActivityTimestamp:0}}}get isOptedOut(){return this.instance.has_opted_out_capturing()}get canCapture(){return P(this.instance.is_capturing)?this.instance.is_capturing():!this.isOptedOut}get isRateLimited(){var t;return!(null==(t=this.instance.rateLimiter)||!t.isClientRateLimited)}get projectToken(){return this.instance.config.token}getExtension(t){var e;switch(t){case"featureFlags":case"featureFlagsCommon":e=this.instance.featureFlags;break;case"logs":e=this.instance.logs;break;case"surveys":e=this.instance.surveys;break;case"autocapture":e=this.instance.autocapture}return e}capture(t,e,r){if(!r)return this.Ar(this.instance.capture(t,e));var s=i({timestamp:r.timestamp,uuid:r.uuid,$set:r.set,$set_once:r.setOnce},"unload"===r.delivery?{transport:"sendBeacon",send_instantly:!0}:{},"immediate"===r.delivery?{send_instantly:!0}:{});return this.Ar(this.instance.capture(t,e,s))}Ar(t){var e;return!C(t)||!(null!=(e=this.instance.rateLimiter)&&e.lastEventRateLimited)}registerDynamicEventProperties(t){return en(this.instance.Rr(t))}sendRequest(t,e){var i=this;return s(function*(){var r;void 0===e&&(e={});var s=null!==(r=e.target)&&void 0!==r?r:"api",o=e.query?Yn(t,e.query):t,a=i.instance.requestRouter.endpointFor(s,o),h={method:e.method,url:a,data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,compressionFallback:"flags"===e.target&&"best-available"===e.compression?b.Base64:void 0,timestampMode:e.sentAt};return"api"===s&&"/i/v1/logs"===t&&(h.batchKey="logs"),"sendBeacon"===e.transport?(i.instance._send_request(h),{statusCode:202}):new Promise(t=>{var e,r,o;h.callback=t,"flags"===s&&null!=(e=i.instance.config.metrics)&&e.flags&&(h.onDispatch=()=>{r=Fo()},h.onSend=t=>{o=(t=>{try{return(t=>{var e,i=null==n?void 0:n.PerformanceObserver,r=null==(e=us(t))?void 0:e.href;if(i&&r){var s,o,a,h=Fo(),l={name:r,before:1/0,inFlight:!0},u=1/0,d=!1,v=()=>{d||(d=!0,clearTimeout(a),p.disconnect(),Bo.splice(Bo.indexOf(l),1))},c=!1,_=t=>{for(var e of t){var i=e.startTime;e.name!==r||(c?h>=i:h>i)||i>=l.before||s&&i>=s.startTime||(s=e)}if(s&&o&&u>=s.startTime){var n=o;v(),n(s)}},p=new i(t=>_(t.getEntriesByName(r,"resource")));for(var f of(p.observe({entryTypes:["resource"]}),Bo))f.name===r&&(f.before=Math.min(f.before,h),c=c||f.inFlight);return Bo.push(l),{take(t,e){d||(u=t,l.inFlight=!1,o=e,a=setTimeout(v,5e3),P(p.takeRecords)&&_(p.takeRecords()))},stop:v}}})(t)}catch(t){return}})(t)},h.callback=e=>{var s;if(t(e),!C(r)){var n=r,h=Fo();try{var l=((t,e)=>{var i,r,s=e.statusCode||void 0,n={"server.address":(null!==(i=null==(r=us(t))?void 0:r.hostname)&&void 0!==i?i:t).replace(/^\[(.*)\]$/,"$1")};s&&(n["http.response.status_code"]=s);var o=((t,e)=>t?400>t?void 0:String(t):"AbortError"===(null==e?void 0:e.name)?"timeout":"_OTHER")(s,e.error);o&&(n["error.type"]=o);var a=ls();return a&&(n["client.timezone"]=a),n})(a,e);if(i.Er("posthog.flags.request.duration",h-n,Uo,l),e.statusCode&&o)return void o.take(h,t=>i.Or(t,n,h,l))}catch(t){ce.error("Failed to record the /flags request timing",t)}null==(s=o)||s.stop()}}),i.instance._send_request(h)})})()}Or(t,e,i,r){if(t.responseEnd>=t.startTime)try{var s=Math.min(t.responseEnd,i);this.Er("posthog.flags.request.pre_send_duration",t.startTime-e,jo,r),this.Er("posthog.flags.request.network_duration",s-t.startTime,Uo,r),this.Er("posthog.flags.request.main_thread_duration",i-s,jo,r)}catch(t){ce.error("Failed to record the /flags request timing split",t)}}Er(t,e,r,s){var n;null==(n=this.instance.metrics)||n.histogram(t,e,{unit:"ms",attributes:i({},s),bounds:r})}},qo={},Wo=0,Ho=()=>{},Go='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Vo="Surveys module not available",Jo="sanitize_properties is deprecated. Use before_send instead",Ko="Invalid value for property_denylist config: ",Yo=["$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"],Xo=["$feature_flag_called","$$heatmap","$snapshot"],Qo=t=>"$"===t.charAt(0)&&!S(Xo,t),Zo=/^[A-Za-z0-9_-]{1,400}$/,ta=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,ea=/^fb\.[0-9]+\.[0-9]+\.[0-9]+$/,ia=["token","distinct_id",Wi],ra="posthog",sa=[...$o].sort()[$o.length-1],na=t=>{var e={};return t&&"unset"!==t?("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0),e):e},oa=t=>{var e;return i({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:mr(null==h?void 0:h.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ho,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=t?t:"unset",__preview_deferred_init_extensions:!1,__preview_replay_sync_fetch:!0,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:l&&A(null==l?void 0:l.search)&&-1!==l.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==n||null==(e=n.location)?void 0:e.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(t){ce.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:nr,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:Ho},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Xr,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:na(t),external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t),cookieWinsOnConflict:!(!t||"unset"===t||"2026-08-29">t)}))(t))},aa=[["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"]],ha=t=>{var e={};for(var i of aa){var r=i[0],s=i[1];C(t[r])||(e[s]=t[r])}var n=cr({},e,t),o=t.__preview_external_dependency_versioned_paths;return C(o)||(C(t.strict_script_versioning)&&(n.strict_script_versioning=!!o),A(o)&&C(t.asset_host)&&(n.asset_host=o)),I(t.property_blacklist)&&(C(t.property_denylist)?n.property_denylist=t.property_blacklist:I(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:ce.error(Ko+t.property_denylist)),n},la=class{constructor(){this.__forceAllowLocalhost=!1}get zh(){return this.__forceAllowLocalhost}set zh(t){ce.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}},ua=(t=class t{Hh(t){if(t){var e=this.Uh.indexOf(t);-1!==e&&this.Uh.splice(e,1)}}Wh(t,e){return this.Hh(t),this.Uh.push(e),null==e.initialize||e.initialize(),e}Vh(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}Gh(){if(!this.Jh&&this.Qh&&"capture_pageview"in this.Qh&&!i({},t.__defaultExtensionClasses,this.config.__extensionClasses).historyAutocapture){var e=this.config.capture_pageview;("history_change"===e||O(e)&&(e.path||e.search||e.hash&&!this.config.disable_capture_url_hashes))&&(this.Jh=!0,ce.warn("capture_pageview is set to capture history changes, but the history autocapture extension is not loaded, so only the first pageview of each page load is captured. With the slim bundle, pass __extensionClasses: { historyAutocapture: AnalyticsExtensions.historyAutocapture } from 'posthog-js/dist/extension-bundles', or set capture_pageview: true to capture page loads only."))}}Zh(){if(!(this.Kh||this.config.reuseAnonymousId||this.config.segment||this.Vh())){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.Yh||(r?(t="persistence is set to '"+this.config.persistence+"'",e="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."):(t="persistence is disabled (disable_persistence is true)",e="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.Kh=!0,console.warn("[PostHog.js]",t+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+e+", 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)))}}Xh(){var t=this.persistence;if(t&&!this.ed)if(this.Vh())"on_reject"===this.config.cookieless_mode&&"$posthog_cookieless"!==this.get_distinct_id()&&(this.nd(),this.sd());else if("$posthog_cookieless"===this.get_distinct_id()){this.rd()||t.load(!0);var e=this.get_distinct_id();if(!e||"$posthog_cookieless"===e){var i=this.config.get_device_id(kr());this.register({distinct_id:i,$device_id:i}),t.set_property(Di,rr)}this.nd()}}get decideEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}get flagsEndpointWasHit(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.hasLoadedFlags)&&void 0!==t&&t}constructor(){var e;this.od=!1,this.ld=!1,this.ad=!1,this.webPerformance=new la,this.ud=!1,this.version=Ee.LIB_VERSION,this.__loadExternalDependency=de,this.hd=/* @__PURE__ */new Set,this.dd="",this.Tr=new mo,this.Uh=[],this.vd=[],this.fd=!1,this.Yh=!1,this.Kh=!1,this.Jh=!1,this.ed=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=oa(),this.SentryIntegration=rs,this.sentryIntegration=t=>function(t,e){var i=is(t,e);return{name:es,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.pd=!1,this.gd=null,this.md=null,this.yd=null,this.scrollManager=new po(this),this.pageViewManager=new ss(this),this.rateLimiter=new an(this),this.requestRouter=new Ro(this),this.consent=new Kr(this),this.externalIntegrations=new Do(this);var i=null!==(e=t.__defaultExtensionClasses)&&void 0!==e?e:{};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:(t,e,i)=>{var r=A(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=A(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>ce.info('send "'+(null==t?void 0:t.event)+'"',t))}init(e,i,r){if(r&&r!==ra){var s,n=null!==(s=qo[r])&&void 0!==s?s:new t;return n._init(e,i,r),qo[r]=n,qo[ra][r]=n,n}return this._init(e,i,r)}_init(t,e,r){var s,o,a;void 0===e&&(e={});var h,l=A(t)?t.trim():"";if(!l)return ce.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 l!==(null==(h=this.config)?void 0:h.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('"+l+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=oa(e.defaults),e.debug=this.bd(e.debug),this.Qh=e,this._d=[],e.person_profiles?this.md=e.person_profiles:e.process_person&&(this.md=e.process_person);var u=oa(e.defaults),d=ha(e),v=cr({},u,d,{name:r,token:l});O(u.rageclick)&&O(d.rageclick)&&(v.rageclick=cr({},u.rageclick,d.rageclick)),O(u.session_recording)&&O(d.session_recording)&&(v.session_recording=cr({},u.session_recording,d.session_recording)),this.set_config(v),this.config.on_xhr_error&&ce.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=e.disable_compression?void 0:qs.GZipJS;var c=this.rd(),_=!this.Vh();if(this.persistence=new zs(this.config,c,!0,_),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new zs(i({},this.config,{persistence:"sessionStorage"}),c,!1,_),this.dd="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&Jr.Ot()){var p=Jr.Pt(this.dd);I(p)&&p.forEach(t=>{A(t)&&this.hd.add(t)})}else Jr.Dt(this.dd);var f=i({},this.persistence.props),g=i({},this.sessionPersistence.props);this.register({$initialization_time:/* @__PURE__ */(new Date).toISOString()}),this.wd=new co((t,e)=>this.kd(t,e),this.config.request_queue_config),this.Sd=new _o(this),this.__request_queue=[];var m=this.Vh();m||(this.sessionManager=new wo(this),this.sessionPropsManager=new go(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.xd()})),this.$d(),this.config.__preview_deferred_init_extensions?(ce.info("Deferring extension initialization to improve startup performance"),this.Cd=setTimeout(()=>{this.Cd=void 0,this.Td(m)},0)):(ce.info("Initializing extensions synchronously"),this.Td(m)),Ee.DEBUG=Ee.DEBUG||this.config.debug,Ee.DEBUG&&ce.info("Starting in debug mode",{this:this,config:e,thisC:i({},this.config),p:f,s:g}),!this.config.identity_distinct_id||null!=(s=e.bootstrap)&&s.distinctID||(e.bootstrap=i({},e.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var b=null==(o=e.bootstrap)?void 0:o.distinctID;if(this.Yh=!!b&&!M(b),null!=(a=e.bootstrap)&&a.distinctID){var y=e.bootstrap.distinctID,w=this.get_distinct_id(),S=this.persistence.get_property(Di);if(e.bootstrap.isIdentifiedID&&null!=w&&w!==y&&"anonymous"===S)this.identify(y);else if(e.bootstrap.isIdentifiedID&&null!=w&&w!==y&&"identified"===S)ce.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{var x=this.config.get_device_id(kr()),E=e.bootstrap.isIdentifiedID?x:y;this.persistence.set_property(Di,e.bootstrap.isIdentifiedID?sr:rr),this.register({distinct_id:y,$device_id:E})}}if(m)this.register_once({distinct_id:qi,$device_id:null},"");else if(!this.get_distinct_id()){var T=this.config.get_device_id(kr());this.register_once({distinct_id:T,$device_id:T},""),this.persistence.set_property(Di,rr)}return br(n,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),br(n,"pageshow",t=>{if(this.ld=!1,!this.ad){var e;if(t.persisted&&this.persistence){var i=this.persistence.get_property(Ke),r=this.persistence.get_property(Di);this.persistence.load(),this.Md()||i===this.persistence.get_property("distinct_id")&&r===this.persistence.get_property("$user_state")||this.Id()}null==(e=this.Sd)||e.resume()}}),e.segment?ts(this,()=>this.Ed()):this.Ed(),P(this.config._onCapture)&&this.config._onCapture!==Ho&&(ce.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&ce.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 So.apply(this,arguments)}().then(t=>{t&&this.register({[Xe]:t})}).catch(Ho),this}Ad(t){var e=t;return A(e.name)&&P(e.setup)}Rd(t,e){var i=this;this.Ad(t)?e.push(/*#__PURE__*/s(function*(){try{yield t.setup(i.Pd())}catch(e){ce.error('Failed to set up extension "'+t.name+'"',e);try{yield null==t.dispose?void 0:t.dispose()}catch(e){ce.error('Failed to dispose extension "'+t.name+'"',e)}}})):this.Uh.push(t)}$d(){var e,i,r,n,o,a,h=this,l=null!==(e=null==(i=this.config.__extensionClasses)?void 0:i.featureFlags)&&void 0!==e?e:null==(r=t.__defaultExtensionClasses)?void 0:r.featureFlags;if(l)if(this.featureFlags&&this.featureFlags instanceof l||(null==(a=this.Od)||a.call(this),this.Od=void 0,this.featureFlags=new l(this)),P(this.featureFlags.onReloading)&&P(this.featureFlags.setup)){if(!this.Od){this.Od=this.featureFlags.onReloading(()=>{this.Tr.emit("featureFlagsReloading",!0)});var u=this.featureFlags;s(function*(){try{yield u.setup(h.Pd())}catch(e){ce.error("Failed to set up feature flags",e);var t=h.Od;h.Od=void 0;try{null==t||t()}catch(t){ce.error("Failed to unsubscribe feature flag reloading",t)}try{yield u.dispose()}catch(t){ce.error("Failed to dispose feature flags",t)}}})()}}else null==(n=(o=this.featureFlags).initialize)||n.call(o)}Td(e){var r,s,n,o,a,h,l,u,d=performance.now(),v=i({},t.__defaultExtensionClasses,this.config.__extensionClasses),c=[];v.exceptions&&this.Uh.push(this.exceptions=null!==(r=this.exceptions)&&void 0!==r?r:new v.exceptions(this)),v.historyAutocapture&&this.Uh.push(this.historyAutocapture=new v.historyAutocapture(this)),this.Gh(),v.tracingHeaders&&this.Uh.push(this.tracingHeaders=new v.tracingHeaders(this)),v.siteApps&&this.Uh.push(this.siteApps=new v.siteApps(this)),v.sessionRecording&&!e&&this.Uh.push(this.sessionRecording=new v.sessionRecording(this)),v.autocapture&&this.Rd(this.autocapture=new v.autocapture(this),c),v.surveys&&this.Rd(this.surveys=null!==(s=this.surveys)&&void 0!==s?s:new v.surveys(this),c),v.logs&&this.Rd(this.logs=null!==(n=this.logs)&&void 0!==n?n:new v.logs(this),c),v.metrics&&this.Uh.push(this.metrics=null!==(o=this.metrics)&&void 0!==o?o:new v.metrics(this)),v.conversations&&this.Uh.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new v.conversations(this)),v.productTours&&this.Uh.push(this.productTours=new v.productTours(this)),v.heatmaps&&this.Uh.push(this.heatmaps=new v.heatmaps(this)),v.webVitalsAutocapture&&this.Uh.push(this.webVitalsAutocapture=new v.webVitalsAutocapture(this)),v.exceptionObserver&&this.Uh.push(this.exceptionObserver=new v.exceptionObserver(this)),v.deadClicksAutocapture&&this.Uh.push(this.deadClicksAutocapture=new v.deadClicksAutocapture(this,Qr)),v.toolbar&&this.Uh.push(this.toolbar=null!==(h=this.toolbar)&&void 0!==h?h:new v.toolbar(this)),v.experiments&&this.Uh.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new v.experiments(this)),v.webMCP&&this.Uh.push(this.webMCP=null!==(u=this.webMCP)&&void 0!==u?u:new v.webMCP(this));var _=this.Uh.length>0||c.length>0;this.config.disable_scroll_properties||c.unshift(()=>{this.scrollManager.startMeasuringScrollPosition()}),this.Uh.forEach(t=>{t.initialize&&c.push(()=>{null==t.initialize||t.initialize()})}),c.push(()=>{if(this.Fd){var t=this.Fd;this.Fd=void 0,this.Uh.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}}),this.Ld(c,d,_)}Ld(t,e,i){for(var r,s;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void(this.Cd=setTimeout(()=>{this.Cd=void 0,this.Ld(t,e,i)},0));var n=t.shift();if(n)try{n()}catch(t){ce.error("Error initializing extension:",t)}}var o=Math.round(performance.now()-e);i&&o>0?this.register_for_session({[Hi]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Gi]:o}):C(null==(r=this.sessionPersistence)?void 0:r.props.$sdk_debug_extensions_init_method)&&C(null==(s=this.sessionPersistence)?void 0:s.props.$sdk_debug_extensions_init_time_ms)||(this.unregister_for_session(Hi),this.unregister_for_session(Gi)),this.config.__preview_deferred_init_extensions&&ce.info("PostHog extensions initialized ("+o+"ms)")}Oc(t){if(!h||!h.body)return ce.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Oc(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Fd=t),this.Ir=t,this.compression=void 0,t.ok){var e,i=t.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=S(i.supportedCompression,qs.GZipJS)?qs.GZipJS:S(i.supportedCompression,qs.Base64)?qs.Base64:void 0),null!=(e=i.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.md?this.md:nr}),this.Tr.emit("extensionsRemoteConfig",t),this.Uh.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}Ed(){try{this.config.loaded(this)}catch(t){ce.critical("`loaded` function failed",t)}if(this.Dd(),this.config.internal_or_test_user_hostname&&null!=l&&l.hostname){var t=l.hostname,e=this.config.internal_or_test_user_hostname;("string"==typeof e?t===e:e.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Vh())&&this.Nd()},1),this.jd=new ln(this),this.jd.load()}Dd(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.wd)||t.enable())}_dom_loaded(){this.is_capturing()&&dr(this.__request_queue,t=>this.kd(t)),this.__request_queue=[],this.Dd()}_handle_unload(){var t,e,i,r,s;this.ld=!0,null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.qd()&&this.capture(hr),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.wd)||r.unload(),null==(s=this.Sd)||s.unload()):this.qd()&&this.capture(hr,null,{transport:"sendBeacon"})}_send_request(t){vo(this,t)}kd(t,e){this.Sd?this.Sd.retriableRequest(t,e):this._send_request(e?i({},t,{transport:e}):t)}_execute_array(t){Wo++;try{var e,i=[],r=[],s=[];dr(t,t=>{if(t)if(I(e=t[0]))s.push(t);else if(P(t))try{t.call(this)}catch(e){ce.error("Error executing queued PostHog call",t,e)}else I(t)&&"alias"===e?i.push(t):I(t)&&-1!==e.indexOf("capture")&&P(this[e])?s.push(t):r.push(t)});var n=function(t,e){dr(t,function(t){try{if(I(t[0])){var i=e;vr(t,function(t){i=i[t[0]].apply(i,t.slice(1))})}else e[t[0]].apply(e,t.slice(1))}catch(e){ce.error("Error executing queued PostHog call",t,e)}})};n(i,this),n(r,this),n(s,this)}finally{Wo--}}push(e){if(Wo>0&&I(e)&&A(e[0])){var i=t.prototype[e[0]];P(i)&&i.apply(this,e.slice(1))}else this._execute_array([e])}get Bd(){return{property:ti,persistenceKey:ei,cookieName:"_fbc",pattern:ta,register:(t,e)=>{var i;return null==(i=this.persistence)?void 0:i.register({[ei]:{value:t,delivered:e}})},unregister:()=>{var t;return null==(t=this.persistence)?void 0:t.unregister(ei)}}}get zd(){return{property:ii,persistenceKey:ri,cookieName:"_fbp",pattern:ea,register:(t,e)=>{var i;return null==(i=this.persistence)?void 0:i.register({[ri]:{value:t,delivered:e}})},unregister:()=>{var t;return null==(t=this.persistence)?void 0:t.unregister(ri)}}}Hd(t){var e,i=null==(e=this.persistence)?void 0:e.get_property(t.persistenceKey);return A(i)&&t.pattern.test(i)?{value:i,delivered:!1}:O(i)&&A(i.value)&&t.pattern.test(i.value)?{value:i.value,delivered:!0===i.delivered}:void 0}Ud(t,e,i){return e===(null==i?void 0:i.value)?{value:e,pending:!i.delivered}:(t.register(e,!1),{value:e,pending:!0})}Wd(t){if(this.config.save_campaign_params&&!this.Vh()){var e=$r(t.cookieName);return A(e)&&t.pattern.test(e)?e:void 0}}Vd(t,e,i,r){if(this.persistence){var s=this.Bd,n=this.Hd(s);if(!r){if(i)return A(e)&&ta.test(e)?this.Ud(s,e,n):void s.unregister();var o=A(t)&&Zo.test(t)?t:void 0,a=this.Wd(s);return a&&((t,e,i)=>{var r=t.split(".");if(e)return r[3]===e;if(!i)return!0;var s=i.value.split(".");return r[3]===s[3]||Number(r[2])>Number(s[2])})(a,o,n)?this.Ud(s,a,n):o?(null==n?void 0:n.value.split(".")[3])===o?{value:n.value,pending:!n.delivered}:this.Ud(s,"fb.1."+Date.now()+"."+o,n):n?{value:n.value,pending:!n.delivered}:void 0}s.unregister()}}Gd(t,e,i){if(this.persistence){var r=this.zd,s=this.Hd(r);if(!i){if(e)return A(t)&&ea.test(t)?this.Ud(r,t,s):void r.unregister();var n=this.Wd(r);return n?this.Ud(r,n,s):s?{value:s.value,pending:!s.delivered}:void 0}r.unregister()}}Jd(t){if(this.persistence){var e=t=>{var e=t.value,i=this.Hd(t.channel);return(null==i?void 0:i.value)===e&&!i.delivered},i=t.filter(e);i.length&&(this.persistence.refreshMetaIdentifiers(),i.filter(e).forEach(t=>t.channel.register(t.value,!0)))}}capture(t,e,r){var s,n,o,a,h,l,u,d,v;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.wd)if(this.is_capturing())if(!C(t)&&A(t)){if(this.Xh(),"$snapshot"!==t||!this.Vh()){var c=!this.config.opt_out_useragent_filter&&this._is_bot();if(c&&!this.config.__preview_capture_bot_pageviews)return this.od||(this.od=!0,console.warn("[PostHog.js] Events are being dropped because the user agent looks like a bot. Set `opt_out_useragent_filter: true` to capture them, e.g. in end-to-end tests. Note that logs from `captureLog` are not subject to this filter.")),void ce.info('Event "'+t+'" was not captured because the user agent looks like a bot. Set `opt_out_useragent_filter: true` to capture it.');var _=null!=r&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null!=_&&_.isRateLimited)ce.critical("This capture call is ignored due to client rate limiting.");else{var p;null!=e&&e.$current_url&&!A(null==e?void 0:e.$current_url)&&(ce.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==e||delete e.$current_url),"$exception"!==t||null!=r&&r._originatedFromCaptureException||ce.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.persistence.syncCookieProperties(),this.Md(),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(p=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();var f=/* @__PURE__ */new Date,g=(null==r?void 0:r.timestamp)||f,m=Xt(null==r?void 0:r.uuid,kr),b={uuid:m,event:t,properties:this.Zd(t,e||{},g,m,!1,!0)},y=null==(s=this.featureFlags)||null==s.flagEventCapture?void 0:s.flagEventCapture(e);if(!y||(vr(y.omit,t=>{delete b.properties[t]}),!1!==(null==y.resolved?void 0:y.resolved(b.properties)))){"$pageview"===t&&this.config.__preview_capture_bot_pageviews&&c&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),_&&(b.properties.$lib_rate_limit_remaining_tokens=_.remainingTokens);var w="$feature_flag_called"===t&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=r&&r.$set&&!w&&(b.$set=null==r?void 0:r.$set);var S=O(null==e?void 0:e.$set)?e.$set:void 0,x=I(null==e?void 0:e.$unset)?e.$unset:[],E=(null==r?void 0:r.$unset)||[],T=t=>{var e,i=!(null==r||!r.$set)&&t in r.$set;return{hasProvided:i||!!S&&t in S,provided:i?null==r||null==(e=r.$set)?void 0:e[t]:null==S?void 0:S[t],unset:-1!==x.indexOf(t)||-1!==E.indexOf(t)}};this.persistence.refreshMetaIdentifiersBeforeCapture();var k=T(ti),P=T(ii),M=[{channel:this.Bd,hasProvided:k.hasProvided,update:this.Vd(null==(n=p)?void 0:n.fbclid,k.provided,k.hasProvided,k.unset)},{channel:this.zd,hasProvided:P.hasProvided,update:this.Gd(P.provided,P.hasProvided,P.unset)}];for(var N of M){var F=N.channel,B=N.update;B&&!0===b.properties.$process_person_profile&&B.pending&&!N.hasProvided&&!w&&(b.$set=i({[F.property]:B.value},b.$set))}var U=null==r?void 0:r.$unset;U&&(b.$unset=U);var j=w?void 0:this.Kd(null==r?void 0:r.$set_once,t!==ur,t===lr);if(j&&(b.$set_once=j),null!=r&&r._noTruncate||(l=this.config.properties_string_max_length,u=b,d=t=>A(t)?t.slice(0,l):t,v=/* @__PURE__ */new Set,b=function t(e,i){if(e!==Object(e))return d?d(e):e;if(!v.has(e)){var r;if(v.add(e),I(e))r=[],dr(e,e=>{r.push(t(e))});else{var s={};vr(z(e)?fr(e):e,(e,i)=>{v.has(e)||(s[i]=t(e,i))}),r=s}return r}}(u)),b.timestamp=g,C(null==r?void 0:r.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=f),w&&(b.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return ee.forEach(r),e.forEach(r),i}(b.properties,y?ia.concat(y.keep):ia)),t===Qs.DISMISSED||t===Qs.SENT){var L=null==e?void 0:e[Zs.SURVEY_ID],q=null==e?void 0:e[Zs.SURVEY_ITERATION];(t=>{try{var e=(t=>((t,e)=>"seenSurvey_"+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e))(0,t))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){Co.error("Failed to persist survey seen state",t)}})({id:L,current_iteration:q}),b.$set=i({},b.$set,{[xo({id:L,current_iteration:q},t===Qs.SENT?"responded":"dismissed")]:!0})}else t===Qs.SHOWN&&(b.$set=i({},b.$set,{[Zs.SURVEY_LAST_SEEN_DATE]:/* @__PURE__ */(new Date).toISOString()}));if(t===sn.SHOWN){var W=null==e?void 0:e[nn.TOUR_TYPE];W&&(b.$set=i({},b.$set,{[nn.TOUR_LAST_SEEN_DATE+"/"+W]:/* @__PURE__ */(new Date).toISOString()}))}var H=i({},b.properties.$set,b.$set);if(R(H)||this.setPersonPropertiesForFlags(H),!D(this.config.before_send)){var G=this.Ds(b,null==y?void 0:y.failed);if(!G)return;(b=G).uuid=Xt(b.uuid,kr)}this.sessionRecording&&!this.sessionRecording.isReplayOff&&!this.fd&&Qo(t)&&(this.fd=!0,setTimeout(()=>this.fd=!1,3e4));var V=[];M.forEach(t=>{var e,i,r,s=t.channel,n=t.update,o=null!==(e=null==(i=b.$set)?void 0:i[s.property])&&void 0!==e?e:O(null==(r=b.properties)?void 0:r.$set)?b.properties.$set[s.property]:void 0;null!=n&&n.pending&&o===n.value&&V.push({channel:s,value:n.value})}),this.Tr.emit("eventCaptured",b);var J,K,Y=null!==(o=null==r?void 0:r._url)&&void 0!==o?o:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),X="recordings"===(null==r?void 0:r._batchKey)||/\/s\/(?:\?|$)/.test(Y),Q=i({method:"POST",url:Y,data:b,compression:"best-available",preferSyncCompression:null==r?void 0:r.send_instantly,timestampMode:X?"body":"capture-body",batchKey:null==r?void 0:r._batchKey},X&&null!=(a=b.properties)&&a.$session_id?{batchGroup:b.properties.$session_id+(b.properties.$window_id?"-"+b.properties.$window_id:"")}:{},null!=r&&r.transport?{transport:r.transport}:{},V.length?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.Jd(V)}}:{});return!this.config.request_batching||r&&(null==r||!r._batchKey)||null!=r&&r.send_instantly?(!Q.transport&&!Q.callback&&R(null!==(J=this.config.request_headers)&&void 0!==J?J:{})&&this.ld&&(K="sendBeacon"),this.kd(Q,K)):this.wd.enqueue(Q),null==(h=this.featureFlags)||h.sendFlagCallsPendingCapture(),b}}}}else ce.error("No event name provided to posthog.capture");else ce.info('Event "'+t+'" was not captured because capturing is disabled (opted out or consent pending).');else ce.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",e=>t(e.event,e))}getExtension(t){var e;return null==(e=this.Yd)?void 0:e.getExtension(t)}Pd(){var t;return null!==(t=this.Yd)&&void 0!==t?t:this.Yd=new zo(this)}Rr(t){this.vd.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.vd.indexOf(t);-1!==i&&this.vd.splice(i,1)}}}Md(t){var e;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange()||(this.Id(t),0))}Id(t){var e,i,r;void 0===t&&(t=!0),this.yd=null,"anonymous"===(null==(e=this.persistence)?void 0:e.get_property("$user_state"))&&(null==(r=this.sessionPersistence)||r.clear(),this.hd.clear(),this.Xd()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags()}calculateEventProperties(t,e,i,r,s){return this.Zd(t,e,i,r,s,!1)}Zd(t,e,r,s,o,a){if(void 0===a&&(a=!1),r=r||/* @__PURE__ */new Date,!this.persistence||!this.sessionPersistence)return e;this.Xh(),a||(this.persistence.syncCookieProperties(),this.Md());var u=o?void 0:this.persistence.remove_event_timer(t),d=i({},e);if(d.token=this.config.token,d.$config_defaults="latest"===this.config.defaults?sa:this.config.defaults,this.Vh()&&(d[Wi]=!0),"$snapshot"===t){var v=i({},this.persistence.properties(),this.sessionPersistence.properties());return d.distinct_id=v.distinct_id,(!A(d.distinct_id)&&!F(d.distinct_id)||M(d.distinct_id))&&ce.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),d}var c,p,f=function(t,e,i,r){var s,o,a,h;if(void 0===r&&(r=!1),!_)return{};var u,d=t?[...gs,...e||[]]:[],v=function(t){for(var e=0;Gt.length>e;e++){var i=Gt[e],r=i[1],s=i[0].exec(t),n=s&&(P(r)?r(s,t):r);if(n)return n}return["",""]}(_),c=v[0],p=v[1],f=function(t){for(var e=0;Kt.length>e;e++){var i,r=Kt[e],s=r[1],n=r[2],o=t.match(r[0]);if(o)return[s,(null==(i=n&&t.match(n)||o)?void 0:i[1])||""]}return["",""]}(_),g=f[0],b=f[1],y=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},w={};C(i)||(w.detectGoogleSearchApp=i);var S={},x=null==(s=navigator)||null==(s=s.userAgentData)?void 0:s.platform,E=null==(o=navigator)?void 0:o.maxTouchPoints,T=null==n||null==(a=n.screen)?void 0:a.width,k=null==n||null==(h=n.screen)?void 0:h.height,I=null==n?void 0:n.devicePixelRatio;C(x)||(S.userAgentDataPlatform=x),C(E)||(S.maxTouchPoints=E),C(T)||(S.screenWidth=T),C(k)||(S.screenHeight=k),C(I)||(S.devicePixelRatio=I);var O,R,A,M,N,D,F,B,U=cr(pr({$os:c,$os_version:p,$browser:qt(_,navigator.vendor,y,w),$webview_app:g,$webview_app_version:b,$device:Vt(_),$device_type:(R=_,A=S,B=Vt(R),B===tt||B===Z||"Kobo"===B||"Kindle Fire"===B||B===$t?Q:B===ct||B===pt||B===_t||B===wt?"Console":B===et?"Wearable":B?Y:"Android"===(null==A?void 0:A.userAgentDataPlatform)&&(null!==(M=null==A?void 0:A.maxTouchPoints)&&void 0!==M?M:0)>0?600>Math.min(null!==(N=null==A?void 0:A.screenWidth)&&void 0!==N?N:0,null!==(D=null==A?void 0:A.screenHeight)&&void 0!==D?D:0)/(null!==(F=null==A?void 0:A.devicePixelRatio)&&void 0!==F?F:1)?Y:Q:"Desktop"),$timezone:ls(),$timezone_offset:Is()}),{$current_url:cs(r?Zt(null==l?void 0:l.href):null==l?void 0:l.href,d,bs),$host:null==l?void 0:l.host,$pathname:null==l?void 0:l.pathname,$raw_user_agent:_.length>1e3?_.substring(0,997)+"...":_,$browser_version:Ht(_,navigator.vendor,y,w),$browser_language:Ss(),$browser_language_prefix:(O=Ss(),"string"==typeof O?O.split("-")[0]:void 0),$screen_height:null==n?void 0:n.screen.height,$screen_width:null==n?void 0:n.screen.width,$viewport_height:null==n?void 0:n.innerHeight,$viewport_width:null==n?void 0:n.innerWidth,$lib:m.LIB_NAME,$lib_version:m.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return m.SDK_DIST_CHANNEL&&(U.$sdk_dist_channel=m.SDK_DIST_CHANNEL),U}(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){var g=this.sessionManager.checkAndGetSessionAndWindowId(o,r.getTime(),!0),b=g.windowId;d.$session_id=g.sessionId,d.$window_id=b}this.sessionPropsManager&&cr(d,this.sessionPropsManager.getSessionProps());try{var y;if(this.sessionRecording){var w=this.sessionRecording.sdkDebugProperties,x=!this.fd&&Qo(t);for(var E in w)(x||S(Yo,E))&&(d[E]=w[E])}c=null==(y=this.Sd)?void 0:y.length}catch(t){d.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===ko&&(d.$lib_custom_api_host=this.config.api_host),p="$pageview"!==t||o?"$pageleave"!==t||o?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),d=cr(d,p),"$pageview"===t&&h&&(d.title=h.title),!C(u)){var T=r.getTime()-u;d.$duration=parseFloat((T/1e3).toFixed(3))}_&&this.config.opt_out_useragent_filter&&(d.$browser_type=this._is_bot()?"bot":"browser");var k=this.persistence.properties(),N=this.sessionPersistence.properties(),D=d.$groups,B=k.$groups;O(D)&&!R(D)&&(d.$groups=i({},O(B)?B:{},D)),vr(["$referrer","$referring_domain"],t=>{t in k&&delete N[t]});var U={};if(this.vd.length>0)for(var j of this.vd.slice())try{cr(U,j())}catch(t){ce.error("Failed to produce browser extension event properties",t)}d=cr({},f,k,N,i({},U,d)),c?d.$sdk_debug_retry_queue_size=c:delete d.$sdk_debug_retry_queue_size,d.$is_identified=this._isIdentified(),I(this.config.property_denylist)?vr(this.config.property_denylist,function(t){delete d[t]}):ce.error(Ko+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var L=this.config.sanitize_properties;L&&(ce.error(Jo),d=L(d,t));var z=this.tv();return d.$process_person_profile=z,z&&!o&&this.ev("_calculate_event_properties"),d}Kd(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.tv())return t;if(this.ud&&!i)return t;var s=cr({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},t||{}),n=this.config.sanitize_properties;return n&&(ce.error(Jo),s=n(s,"$set_once")),e&&(this.ud=!0),R(s)?void 0:s}register(t,e){var i;null==(i=this.persistence)||i.register(t,e)}register_once(t,e,i){var r;null==(r=this.persistence)||r.register_once(t,e,i)}register_for_session(t){var e,i;null==(e=this.persistence)||e.syncCookieProperties(),this.Md(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach(t=>this.hd.add(t)),this.Xd()}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t),this.hd.delete(t),this.Xd()}iv(t,e){this.register({[t]:e})}xd(){this.hd.forEach(t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)}),this.hd.clear(),this.Xd()}Xd(){var t;if(this.dd)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.Ai||!Jr.Ot())Jr.Dt(this.dd);else{var e=[];this.hd.forEach(t=>e.push(t)),e.length>0?Jr.$t(this.dd,e):Jr.Dt(this.dd)}}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e))&&void 0!==i?i:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.Tr.on(t,e)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Vo}),()=>{})}onSessionId(t){var e,i;return null!==(e=null==(i=this.sessionManager)?void 0:i.onSessionId(t))&&void 0!==e?e:()=>{}}getSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getSurveys(t,e):t([],{isLoaded:!1,error:Vo})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Vo})}onActiveMatchingSurveysChanged(t){return this.surveys?this.surveys.onActiveMatchingSurveysChanged(t):(t([],{isLoaded:!1,error:Vo}),()=>{})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=Ao),null==(i=this.surveys)||i.displaySurvey(t,e)}cancelPendingSurvey(t){var e;null==(e=this.surveys)||e.cancelPendingSurvey(t)}canRenderSurvey(t){var e,i;return null!==(e=null==(i=this.surveys)?void 0:i.canRenderSurvey(t))&&void 0!==e?e:{visible:!1,disabledReason:Vo}}canRenderSurveyAsync(t,e){var i,r;return void 0===e&&(e=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(t,e))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:Vo})}nv(t){return!t||M(t)?(ce.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===t?(ce.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(ce.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,e,i){if(!this.__loaded||!this.persistence)return ce.uninitializedWarning("posthog.identify");if(F(t)&&(t=t.toString(),ce.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.nv(t)&&this.ev("posthog.identify")){this.Xh();var r=this.get_distinct_id(),s=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,n=this.Md(!1),o=this.persistence.oc(),a=!1;try{var h=this.get_distinct_id();this.register({$user_id:t}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:h},""),t!==h&&t!==this.get_property("__alias")&&(this.unregister(Qe),this.register({distinct_id:t}));var l=(this.persistence.get_property("$user_state")||"anonymous")===rr,u=t!==h,d=!u&&l;if(u&&l){var v,c=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:h};this.persistence.set_property(Di,sr),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.lc(),this.capture("$identify",c,{$set:e||{},$set_once:i||{}})&&(this.yd=Eo(t,e,i)),null==(v=this.featureFlags)||v.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:h)}else if(d){this.persistence.set_property(Di,sr);var _=e||{},p=i||{};this.setPersonPropertiesForFlags({$set:_,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.lc(),this.capture("$set",{$set:_,$set_once:p})&&(this.yd=Eo(t,e,i))}else(e||i)&&this.setPersonProperties(e,i);u||s||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(De)):d&&(e||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.cc(a)}}}setPersonProperties(t,e){if((t||e)&&this.ev("posthog.setPersonProperties")){var i=Eo(this.get_distinct_id(),t,e);this.yd!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}})&&(this.yd=i)):ce.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(I(t)?t:[t]).filter(t=>A(t)&&t.length>0);0!==i.length&&this.ev("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.yd=null)}group(t,e,r){var s;if(t&&e){null==(s=this.persistence)||s.syncCookieProperties(),this.Md();var n=this.getGroups(),o=n[t]!==e;if(o&&this.resetGroupPropertiesForFlags(t),this.register({$groups:i({},n,{[t]:e})}),(o||r)&&this.tv()){var a={$group_type:t,$group_key:e};r&&(a.$group_set=r),this.capture(ur,a)}r&&this.setGroupPropertiesForFlags({[t]:r}),o&&!r&&this.reloadFeatureFlags()}else ce.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(t,e)}resetPersonPropertiesForFlags(t){var e;void 0===t&&(t=!0),null==(e=this.featureFlags)||e.resetPersonPropertiesForFlags(t)}setGroupPropertiesForFlags(t,e){var i;void 0===e&&(e=!0),this.ev("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e=U(t)?t:null==t?void 0:t.resetDeviceID,i=U(t)||null==t?void 0:t.bootstrap;this.sv(e,!1,i)}sv(t,e,r){var s,n,o,a,h;if(void 0===e&&(e=!1),ce.info("reset"),!this.__loaded)return ce.uninitializedWarning("posthog.reset");var l=null==r?void 0:r.sessionID;this.config.bootstrap=r||(null==(s=this.Qh)?void 0:s.bootstrap)||{},null==(n=this.featureFlags)||null==n.updateConfig||n.updateConfig(this.config,this._shouldDisableFlags());var u=this.get_property(Ye),d=this.get_property(Xe),v=this.get_property(_i);null==(o=this.sessionRecording)||o.flushBeforeIdentityReset();var c=this.is_capturing();e||this.consent.reset(),e||!c||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.");var _=null==(a=this.persistence)||null==a.oc?void 0:a.oc(),p=this.ed;this.ed=p||e;var f=!1;try{var g,m,b,y,w,S,x,E,T,k,I,P,O;if(null==(g=this.persistence)||g.clear(),null==(m=this.sessionPersistence)||m.clear(),this.hd.clear(),this.Xd(),C(v)||null==(b=this.persistence)||b.register({[_i]:v}),null==(y=this.surveys)||y.reset(),null==(w=this.featureFlags)||w.reset(),null==(S=this.conversations)||S.reset(),null==(x=this.logs)||x.reset(),null==(E=this.metrics)||E.reset(),null==(T=this.persistence)||T.set_property(Di,rr),null==(k=this.sessionManager)||k.resetSessionId(),this.yd=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:qi,$device_id:null},"");else{var R=this.config.get_device_id(kr());this.register_once({distinct_id:R,$device_id:t?R:u},""),t||C(d)||this.register({[Xe]:d})}if(this.register({$last_posthog_reset:/* @__PURE__ */(new Date).toISOString()},1),r)if(r.distinctID&&!this.Vh()&&(null==(O=this.persistence)||O.set_property(Di,r.isIdentifiedID?sr:rr),this.register({distinct_id:r.distinctID})),null==(I=this.featureFlags)||I.initialize(),!(D(l)||null!=(P=this.sessionManager)&&P.setBootstrapSessionId(l,!0))){var A=i({},r);delete A.sessionID,this.config.bootstrap=A}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,f=!0}finally{var M;this.ed=p,_&&(null==(M=this.persistence)||null==M.cc||M.cc(f))}this.Ir&&(null==(h=this.conversations)||h.onRemoteConfig(this.Ir)),this.reloadFeatureFlags()}shutdown(t){var e=this;return s(function*(){if(e.__loaded){e.ad=!0,clearTimeout(e.Cd),e.Cd=void 0;var t=e.Od;for(var i of(e.Od=void 0,[()=>{var t;return null==(t=e.sessionRecording)?void 0:t.dispose()},()=>{var t;return null==(t=e.logs)?void 0:t.flushLogs("sendBeacon")},()=>{var t;return null==(t=e.metrics)?void 0:t.flush("sendBeacon")},()=>{var t;return null==(t=e.metrics)?void 0:t.dispose()},()=>{var t;return null==(t=e.logs)?void 0:t.dispose()},()=>{var t;return null==(t=e.surveys)?void 0:t.dispose()},()=>{var t;return null==(t=e.autocapture)?void 0:t.dispose()},()=>null==t?void 0:t(),()=>{var t;return null==(t=e.wd)?void 0:t.unload()},()=>{var t;return null==(t=e.Sd)?void 0:t.unload()},()=>{var t;return null==(t=e.featureFlags)?void 0:t.destroy()},()=>{var t;return null==(t=e.persistence)?void 0:t.destroy()},()=>{var t;return null==(t=e.sessionPersistence)?void 0:t.destroy()}]))try{var r=i();r&&P(r.then)&&r.then(void 0,t=>{ce.error("Error during shutdown",t)})}catch(t){ce.error("Error during shutdown",t)}}else ce.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,e){var i;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i._onIdentityChanged()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t._onIdentityCleared()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=e.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&i){var s,n=null!==(s=t.timestampLookBack)&&void 0!==s?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(/* @__PURE__ */((new Date).getTime()-i)/1e3)-n,0)}return r}alias(t,e){return t===this.get_property("$people_distinct_id")?(ce.critical("Attempting to create alias for existing People user - aborting."),-2):this.ev("posthog.alias")?(C(e)&&(e=this.get_distinct_id()),t!==e?(this.iv(Qe,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ce.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=i({},this.config);if(O(t)){var r,s,n,o,a,h,l,u,d,v,c,_,p,f;cr(this.config,ha(t));var g=this.rd();if(this.persistence){var m,b,y,w="sessionStorage"===this.config.persistence||"memory"===this.config.persistence;w&&this.sessionPersistence!==this.persistence&&(null==(b=this.sessionPersistence)||b.remove(),null==(y=this.sessionPersistence)||y.destroy()),this.persistence.update_config(this.config,e,g),w?this.sessionPersistence=this.persistence:this.sessionPersistence===this.persistence?this.sessionPersistence=new zs(i({},this.config,{persistence:"sessionStorage"}),g,!1):null==(m=this.sessionPersistence)||m.update_config(i({},this.config,{persistence:"sessionStorage"}),i({},e,{persistence:"sessionStorage"}),g)}var S=this.bd(this.config.debug);U(S)&&(this.config.debug=S),U(this.config.debug)&&(this.config.debug?(Ee.DEBUG=!0,Mr.Ot()&&Mr.$t("ph_debug",!0),ce.info("set_config",{config:t,oldConfig:e,newConfig:i({},this.config)})):(Ee.DEBUG=!1,Mr.Ot()&&Mr.Dt("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this._shouldDisableFlags()),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(n=this.exceptions)||n.onConfigChange(),null==(o=this.metrics)||o.onConfigChange(),null==(a=this.webMCP)||a.startIfEnabled(),null==(h=this.sessionRecording)||h.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(d=this.heatmaps)||d.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(v=this.historyAutocapture)||v.startIfEnabledOrStop()),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(_=this.deadClicksAutocapture)||_.startIfEnabledOrStop(),null==(p=this.surveys)||p.loadIfEnabled(),this.nd(),null==(f=this.externalIntegrations)||f.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&ts(this,Ho,!1)}}_overrideSDKInfo(t,e){Ee.LIB_NAME=t,Ee.LIB_VERSION=e}startSessionRecording(t){var e,i,r,s,n,o=!0===t,a={sampling:o||!(null==t||!t.sampling),linked_flag:o||!(null==t||!t.linked_flag),url_trigger:o||!(null==t||!t.url_trigger),event_trigger:o||!(null==t||!t.event_trigger)};Object.values(a).some(Boolean)&&(null==(e=this.sessionManager)||e.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(s=this.sessionRecording)||s.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 t;return!(null==(t=this.sessionRecording)||!t.started)}captureException(t,e){try{if(!this.exceptions)return;var r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:/* @__PURE__ */new Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(i({},r,e))}catch(t){return}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var e,i;return null!==(e=null==(i=this.logs)?void 0:i.logger)&&void 0!==e?e:t.lv}startExceptionAutocapture(t){this.set_config({capture_exceptions:null==t||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var e,i;return null!==(e=null==(i=this.toolbar)?void 0:i.loadToolbar(t))&&void 0!==e&&e}get_property(t){var e;return null==(e=this.persistence)?void 0:e.props[t]}getSessionProperty(t){var e;return null==(e=this.sessionPersistence)?void 0:e.props[t]}toString(){var t,e=null!==(t=this.config.name)&&void 0!==t?t:ra;return e!==ra&&(e="posthog."+e),e}_isIdentified(){var t,e;return"identified"===(null==(t=this.persistence)?void 0:t.get_property("$user_state"))||"identified"===(null==(e=this.sessionPersistence)?void 0:e.get_property("$user_state"))}tv(){var t,e;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&R(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t.__alias)&&(null==(e=this.persistence)||null==(e=e.props)||!e.$epp))}qd(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.tv()||this.ev("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ev("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ev(t){return"never"===this.config.person_profiles?(ce.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Zh(),this.iv(zi,!0),!0)}rd(){if("always"===this.config.cookieless_mode)return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)}nd(){var t,e,i,r,s,n,o=this.rd();return this.is_capturing()||(null==(s=this.logs)||s._onOptOut(),null==(n=this.heatmaps)||n.discardPending()),(null==(t=this.persistence)?void 0:t.Ai)!==o&&(null==(e=this.persistence)||e.set_disabled(o)),(null==(i=this.sessionPersistence)?void 0:i.Ai)!==o&&(null==(r=this.sessionPersistence)||r.set_disabled(o)),this.Xd(),o}opt_in_capturing(e){var i,r,s,n,o;if("always"!==this.config.cookieless_mode){if(this.Vh()){var a,h,l,u,d,v;null==(a=this.sessionRecording)||a.dispose({discardBufferedEvents:!0}),this.sv(!0,!0),null==(h=this.sessionManager)||h.destroy(),null==(l=this.pageViewManager)||l.destroy(),this.sessionManager=new wo(this),this.pageViewManager=new ss(this),this.persistence&&(this.sessionPropsManager=new go(this,this.sessionManager,this.persistence));var c,_=null!==(u=null==(d=this.config.__extensionClasses)?void 0:d.sessionRecording)&&void 0!==u?u:null==(v=t.__defaultExtensionClasses)?void 0:v.sessionRecording;_&&(this.sessionRecording=this.Wh(this.sessionRecording,new _(this)),this.Ir&&(null==(c=this.sessionRecording)||null==c.onRemoteConfig||c.onRemoteConfig(this.Ir)))}var p,f,g=1===this.consent.consent;g?this.Xh():null==(i=this.heatmaps)||i.discardPending(),this.consent.optInOut(!0),this.nd(),this.Dd(),null==(r=this.sessionRecording)||r.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(p=this.surveys)||p.loadIfEnabled(),null==(f=this.conversations)||f.loadIfEnabled()),!g&&(C(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(s=null==e?void 0:e.captureEventName)&&void 0!==s?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),null==(n=this.persistence)||n.syncCookieProperties(),this.Md(),null==(o=this.featureFlags)||o.sendFlagCallsPendingCapture(),this.config.capture_pageview&&this.Nd()}else ce.warn(Go)}opt_out_capturing(){"always"!==this.config.cookieless_mode?(this.consent.optInOut(!1),this.nd(),"on_reject"===this.config.cookieless_mode&&this.sd()):ce.warn(Go)}sd(){var t,e,i,r=this.sessionRecording;null==r||r.dispose({discardBufferedEvents:!0}),null==(t=this.heatmaps)||t.discardPending(),"$posthog_cookieless"!==this.get_distinct_id()&&this.sv(!0,!0),this.register({distinct_id:qi,$device_id:null}),this.Hh(r),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Nd(),this.Dd()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return 1===t?"granted":0===t?"denied":"pending"}is_capturing(){return!this.ed&&("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.nd()}_is_bot(){return a?function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&J(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>J(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver}(a,this.config.custom_blocked_useragents):void 0}Nd(){h&&("visible"===h.visibilityState?this.pd||(this.pd=!0,this.capture(ar,{title:h.title},{send_instantly:!0}),this.gd&&(h.removeEventListener(Le,this.gd),this.gd=null)):this.gd||(this.gd=this.Nd.bind(this),br(h,Le,this.gd)))}debug(t){!1===t?(null==n||n.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==n||n.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}))}_shouldDisableFlags(){var t=this.Qh||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ce.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(t,e,i,r,s){var n=e in t&&!D(t[e]),o=i in t&&!D(t[i]);return n?t[e]:!!o&&(s&&s.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,ce)}Ds(t,e){var i;if(D(this.config.before_send))return t;var r=Object.keys(null!==(i=t.properties)&&void 0!==i?i:{}).filter(L),s=I(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var o of s)try{if(n=o(n),D(n)){var a="Event '"+t.event+"' was rejected in beforeSend function";return j(t.event)?ce.warn(a+". This can cause unexpected behavior."):ce.info(a),null}n.properties&&!R(n.properties)||ce.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(i){return ce.error("Error in beforeSend function for event '"+t.event+"':",i),null==e||e(),null}for(var h of r)if(n.properties&&D(n.properties[h]))return ce.warn("Event '"+t.event+"' had its '"+h+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var t;return null==(t=this.pageViewManager.cu)?void 0:t.pageViewId}captureTraceFeedback(t,e){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:e})}captureTraceMetric(t,e,i){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:e,$ai_metric_value:String(i)})}bd(t){var e=U(t)&&!t,i=Mr.Ot()&&"true"===Mr.Lt("ph_debug");return!e&&(!!i||t)}},t.__defaultExtensionClasses={},t.lv={trace:To=()=>{},debug:To,info:To,warn:To,error:To,fatal:To},t);!function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=_r(t.prototype[e[i]])}(ua,["identify"]);var da=function(){Ee.SDK_DIST_CHANNEL="npm";var t=qo[ra]=new ua;return function(){function t(){t.done||(t.done=!0,uo=!1,vr(qo,function(t){t._dom_loaded()}))}null!=h&&h.addEventListener?"complete"===h.readyState?t():br(h,"DOMContentLoaded",t,{capture:!1}):n&&ce.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),t}();export{qs as Compression,rn as DEFAULT_PRODUCT_TOUR_APPEARANCE,tn as DisplaySurveyType,ua as PostHog,sn as ProductTourEventName,nn as ProductTourEventProperties,Qs as SurveyEventName,Zs as SurveyEventProperties,Ws as SurveyEventType,Gs as SurveyPosition,Ys as SurveyQuestionBranchingType,Ks as SurveyQuestionType,Xs as SurveySchedule,Vs as SurveyTabPosition,Js as SurveyType,Hs as SurveyWidgetType,da as default,da as posthog,un as severityLevels};