posthog-js 1.393.4 → 1.393.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.js +1 -1
- package/dist/array.full.js.map +1 -1
- package/dist/array.full.no-external.js +1 -1
- package/dist/array.full.no-external.js.map +1 -1
- package/dist/array.js +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/dead-clicks-autocapture.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/logs.js +1 -1
- package/dist/logs.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/module.full.js +1 -1
- package/dist/module.full.js.map +1 -1
- package/dist/module.full.no-external.js +1 -1
- package/dist/module.full.no-external.js.map +1 -1
- package/dist/module.js +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.slim.js +1 -1
- package/dist/module.slim.no-external.js +1 -1
- package/dist/posthog-recorder.js +1 -1
- package/lib/package.json +1 -1
- package/lib/src/entrypoints/logs.js +71 -55
- package/lib/src/entrypoints/logs.js.map +1 -1
- package/package.json +4 -4
package/dist/module.slim.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t;"undefined"==typeof self&&(e.self=e),"undefined"==typeof File&&(e.File=function(){});var i=null==e?void 0:e.navigator,r=null==e?void 0:e.document,s=null==e?void 0:e.location,n=null==e?void 0:e.fetch,o=null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest?e.XMLHttpRequest:void 0,a=null==e?void 0:e.AbortController,u=null==e?void 0:e.CompressionStream,l=null==i?void 0:i.userAgent,h=null!=t?t:{},d="1.393.4",v={DEBUG:!1,LIB_VERSION:d,LIB_NAME:"web",JS_SDK_VERSION:d};function c(t,e,i,r,s,n,o){try{var a=t[n](o),u=a.value}catch(t){return void i(t)}a.done?e(u):Promise.resolve(u).then(r,s)}function _(t){return function(){var e=this,i=arguments;return new Promise((function(r,s){var n=t.apply(e,i);function o(t){c(n,r,s,o,a,"next",t)}function a(t){c(n,r,s,o,a,"throw",t)}o(void 0)}))}}function p(){return p=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},p.apply(null,arguments)}var f,g=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),m=["$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"],b="NativeGzipValidationError",y=t=>t.length>=2&&31===t[0]&&139===t[1],x=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),E=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=b,e},S=function(){var t=_((function*(t,e){18>t.size&&E("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());y(i)&&8===i[2]||E("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(f)return f;f=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;f[t]=e>>>0}return f})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&E("invalid-crc");var s=e.length>>>0;r.getUint32(4,!0)!==s&&E("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function T(){return T=_((function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),s=new CompressionStream("gzip"),n=s.writable.getWriter(),o=n.write(r).then((()=>n.close())).catch(function(){var t=_((function*(t){try{yield n.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),a=new Response(s.readable).blob(),[u]=yield Promise.all([a,o]);return yield S(u,r),u}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),T.apply(this,arguments)}var R=["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","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],P=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return R.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function k(t,e){return-1!==t.indexOf(e)}var O=function(t){return t.replace(/^\$/,"")},I=Object.prototype,M=I.hasOwnProperty,A=I.toString,C=Array.isArray||function(t){return"[object Array]"===A.call(t)},U=t=>"function"==typeof t,D=t=>t===Object(t)&&!C(t),N=t=>{if(D(t)){for(var e in t)if(M.call(t,e))return!1;return!0}return!1},L=t=>void 0===t,B=t=>"[object String]"==A.call(t),F=t=>B(t)&&0===t.trim().length,z=t=>null===t,q=t=>L(t)||z(t),j=t=>"[object Number]"==A.call(t)&&t==t,G=t=>j(t)&&t>0,H=t=>"[object Boolean]"===A.call(t),W=t=>t instanceof FormData,Y=t=>k(m,t),V=t=>k(w,t),J=[!0,"true",1,"1","yes"],K=t=>k(J,t),X=[!1,"false",0,"0","no"];function Q(t,e,i,r,s){return e>i&&(r.warn("min cannot be greater than max."),e=i),j(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),Q(s||i,e,i,r))}var Z="Mobile",tt="iOS",et="Android",it="Tablet",rt=et+" "+it,st="iPad",nt="Apple",ot=nt+" Watch",at="Safari",ut="BlackBerry",lt="Samsung",ht=lt+"Browser",dt=lt+" Internet",vt="Chrome",ct=vt+" OS",_t=vt+" "+tt,pt="Internet Explorer",ft=pt+" "+Z,gt="Opera",mt=gt+" Mini",wt="Edge",bt="Microsoft "+wt,yt="Firefox",xt=yt+" "+tt,Et="Nintendo",$t="PlayStation",St="Xbox",Tt=et+" "+Z,Rt=Z+" "+at,Pt="Windows",kt=Pt+" Phone",Ot="Nokia",It="Ouya",Mt="Generic",At=Mt+" "+Z.toLowerCase(),Ct=Mt+" "+it.toLowerCase(),Ut="Konqueror",Dt="Oculus Browser",Nt="Vivaldi",Lt="Yandex",Bt="Whale",Ft="DuckDuckGo",zt="Pale Moon",qt="Waterfox",jt="Brave",Gt="Google Search App",Ht="(\\d+(\\.\\d+)?)",Wt=new RegExp("Version/"+Ht),Yt=new RegExp(St,"i"),Vt=new RegExp($t+" \\w+","i"),Jt=new RegExp(Et+" \\w+","i"),Kt=new RegExp(ut+"|PlayBook|BB10","i"),Xt={"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?jt:null}(i);return s||(null!=r&&r.detectGoogleSearchApp&&k(t,"GSA/")?Gt:k(t," OPR/")&&k(t,"Mini")?mt:k(t," OPR/")?gt:Kt.test(t)?ut:k(t,"IE"+Z)||k(t,"WPDesktop")?ft:k(t,"OculusBrowser")?Dt:k(t,ht)?dt:k(t,wt)||k(t,"Edg/")?bt:k(t,Nt+"/")?Nt:k(t,"YaBrowser/")?Lt:k(t,Bt+"/")?Bt:k(t,Ft+"/")||k(t,"Ddg/")?Ft:k(t,"FBIOS")?"Facebook "+Z:k(t,"UCWEB")||k(t,"UCBrowser")?"UC Browser":k(t,"CriOS")?_t:k(t,"CrMo")||k(t,vt)?vt:k(t,et)&&k(t,at)?Tt:k(t,"FxiOS")?xt:k(t.toLowerCase(),Ut.toLowerCase())?Ut:k(t,jt+"/")?jt:((t,e)=>e&&k(e,nt)||function(t){return k(t,at)&&!k(t,vt)&&!k(t,et)}(t))(t,e)?k(t,Z)?Rt:at:k(t,"PaleMoon/")?zt:k(t,qt+"/")?qt:k(t,yt)?yt:k(t,"MSIE")||k(t,"Trident/")?pt:k(t,"Gecko")?yt:"")},Zt={[ft]:[new RegExp("rv:"+Ht)],[bt]:[new RegExp(wt+"?\\/"+Ht)],[vt]:[new RegExp("("+vt+"|CrMo)\\/"+Ht)],[_t]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[at]:[Wt],[Rt]:[Wt],[gt]:[new RegExp("(Opera|OPR)\\/"+Ht)],[yt]:[new RegExp(yt+"\\/"+Ht)],[xt]:[new RegExp("FxiOS\\/"+Ht)],[Ut]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[ut]:[new RegExp(ut+" "+Ht),Wt],[Tt]:[new RegExp("android\\s"+Ht,"i")],[dt]:[new RegExp(ht+"\\/"+Ht)],[Dt]:[new RegExp("OculusBrowser\\/"+Ht)],[Nt]:[new RegExp(Nt+"\\/"+Ht)],[Lt]:[new RegExp("YaBrowser\\/"+Ht)],[Bt]:[new RegExp(Bt+"\\/"+Ht)],[jt]:[new RegExp(jt+"\\/"+Ht)],[Ft]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Ht)],[zt]:[new RegExp("PaleMoon\\/"+Ht)],[qt]:[new RegExp(qt+"\\/"+Ht)],[Gt]:[new RegExp("GSA\\/"+Ht)],[pt]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},te=function(t,e,i,r){var s=Qt(t,e,i,r),n=Zt[s];if(L(n))return null;for(var o=0;n.length>o;o++){var a=t.match(n[o]);if(a)return parseFloat(a[a.length-2])}return null},ee=[[new RegExp(St+"; "+St+" (.*?)[);]","i"),t=>[St,t&&t[1]||""]],[new RegExp(Et,"i"),[Et,""]],[new RegExp($t,"i"),[$t,""]],[Kt,[ut,""]],[new RegExp(Pt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[kt,""];if(new RegExp(Z).test(e)&&!/IEMobile\b/.test(e))return[Pt+" "+Z,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Xt[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[Pt,r]}return[Pt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[tt,[t[3],t[4],t[5]||"0"].join(".")]:[tt,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=L(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+et+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+et+")","i"),t=>t&&t[2]?[et,[t[2],t[3],t[4]||"0"].join(".")]:[et,""]],[/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/,[ct,""]],[/Linux|debian/i,["Linux",""]]],ie=function(t){return Jt.test(t)?Et:Vt.test(t)?$t:Yt.test(t)?St:new RegExp(It,"i").test(t)?It:new RegExp("("+kt+"|WPDesktop)","i").test(t)?kt:/iPad/.test(t)?st:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ot:Kt.test(t)?ut:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ot,"i").test(t)?Ot:/(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(Z).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)?et:rt:new RegExp("(pda|"+Z+")","i").test(t)?At:new RegExp(it,"i").test(t)&&!new RegExp(it+" pc","i").test(t)?Ct:""},re=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function se(t,e){return"string"==typeof(i=t)&&re.test(i)?t:e();var i}function ne(t){return t?t.split("#")[0]:t}var oe=function(e,i){var{debugEnabled:r}=void 0===i?{}:i,s={k(i){if(t&&(v.DEBUG||h.POSTHOG_DEBUG||r)&&!L(t.console)&&t.console){for(var s=("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i]),n=arguments.length,o=new Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];s(e,...o)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("error",...e)},critical(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(t){s.error("You must initialize PostHog before calling "+t)},createLogger:(t,i)=>oe(e+" "+t,i)};return s},ae=oe("[PostHog.js]"),ue=ae.createLogger,le=ue("[ExternalScriptsLoader]"),he=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return le.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==r?void 0:r.querySelectorAll("script");if(s)for(var n,o=function(){if(s[a].src===e){var t=s[a];return t.__posthog_loading_callback_fired?{v:i()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,i(void 0,e)})),t.onerror=t=>i(t),{v:void 0})}},a=0;s.length>a;a++)if(n=o())return n.v;var u=()=>{if(!r)return i("document not found");var s=r.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=e,s.onload=t=>{s.__posthog_loading_callback_fired=!0,i(void 0,t)},s.onerror=t=>i(t),t.config.prepare_external_dependency_script&&(s=t.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)r.head.appendChild(s);else{var n,o=r.querySelectorAll("body > script");o.length>0?null==(n=o[0].parentNode)||n.insertBefore(s,o[0]):r.body.appendChild(s)}};null!=r&&r.body?u():null==r||r.addEventListener("DOMContentLoaded",u)};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r;if(t.config.strict_script_versioning)r=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+t.version;if("toolbar"===e){var n=3e5;s=s+"&t="+Math.floor(Date.now()/n)*n}r=t.requestRouter.endpointFor("assets",s)}he(t,r,i)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");he(t,o,i)}},h.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);he(t,r,i)};var de="$people_distinct_id",ve="$device_id",ce="__alias",_e="__timers",pe="$dead_clicks_enabled_server_side",fe="$session_recording_remote_config",ge="$sesid",me="$session_is_sampled",we="$enabled_feature_flags",be="$surveys_loaded_at",ye="$flag_call_reported",xe="$feature_flag_evaluated_at",Ee="$user_state",$e="$client_session_props",Se="$capture_rate_limit",Te="$initial_campaign_params",Re="$initial_referrer_info",Pe="$initial_person_info",ke="$epp",Oe="$posthog_cookieless",Ie="$sdk_debug_extensions_init_method",Me="$sdk_debug_extensions_init_time_ms",Ae="on_reject",Ce="always",Ue="anonymous",De="identified",Ne="identified_only",Le="visibilitychange",Be="beforeunload",Fe="$pageview",ze="$pageleave",qe="$identify",je="$groupidentify";function Ge(t,e){C(t)&&t.forEach(e)}function He(t,e){if(!q(t))if(C(t))t.forEach(e);else if(W(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)M.call(t,i)&&e(t[i],i)}var We=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},Ye=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){ae.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ae.critical(t)}}},Ve=function(t){var e={};return He(t,(function(t,i){(B(t)&&t.length>0||j(t))&&(e[i]=t)})),e};var Je=["herokuapp.com","vercel.app","netlify.app"];function Ke(t){var e=null==t?void 0:t.hostname;if(!B(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Je)if(i===r)return!1;return!0}function Xe(t,e,i,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==t||t.addEventListener(e,i,{capture:s,passive:n})}Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return j(t)&&isFinite(t)&&Math.floor(t)===t});class Qe{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|e>>>8,s[7]=e,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new Qe(s)}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 Qe(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}}class Ze{constructor(){this.S=0,this.C=0,this.I=new ii}generate(){var t=this.generateOrAbort();if(L(t)){this.S=0;var e=this.generateOrAbort();if(L(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.M();else{if(this.S>=t+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return Qe.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var ti,ei=t=>{if("undefined"!=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};t&&!L(t.crypto)&&crypto.getRandomValues&&(ei=t=>crypto.getRandomValues(t));class ii{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(ei(this.R),this.O=0),this.R[this.O++]}}var ri=()=>si().toString(),si=()=>(ti||(ti=new Ze)).generate(),ni="",oi=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var ai={N:()=>!!r,D(t){ae.error("cookieStore error: "+t)},P(t){if(r){try{for(var e=t+"=",i=r.cookie.split(";").filter((t=>t.length)),s=0;i.length>s;s++){for(var n=i[s];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},F(t){var e;try{e=JSON.parse(ai.P(t))||{}}catch(t){}return e},q(t,e,i,s,n){if(!r)return!1;try{var o="",a="",u=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),ni)return ni;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),s=Math.min(i.length,8),n="dmn_chk_"+ri();!ni&&s--;){var o=i.slice(s).join("."),a=n+"=1;domain=."+o+";path=/";e.cookie=a+";max-age=3",e.cookie.includes(n)&&(e.cookie=a+";max-age=0",ni=o)}return ni}(t);if(!i){var s=(t=>{var e=t.match(oi);return e?e[0]:""})(t);s!==i&&ae.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(r.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),o="; expires="+l.toUTCString()}n&&(a="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+u+a;return h.length>3686.4&&ae.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},A(t,e){if(null!=r&&r.cookie)try{ai.q(t,"",-1,e)}catch(t){return}}},ui=null,li={N(){if(!z(ui))return ui;var e=!0;if(L(t))e=!1;else try{var i="__mplssupport__";li.q(i,"xyz"),'"xyz"'!==li.P(i)&&(e=!1),li.A(i)}catch(t){e=!1}return e||ae.error("localStorage unsupported; falling back to cookie store"),ui=e,e},D(t){ae.error("localStorage error: "+t)},P(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){li.D(t)}return null},F(t){try{return JSON.parse(li.P(t))||{}}catch(t){}return null},q(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){li.D(t)}return!1},A(e){try{null==t||t.localStorage.removeItem(e)}catch(t){li.D(t)}}},hi=[ve,"distinct_id",ge,me,ke,Pe,Ee],di={},vi={N:()=>!0,D(t){ae.error("memoryStorage error: "+t)},P:t=>di[t]||null,F:t=>di[t]||null,q:(t,e)=>(di[t]=e,!0),A(t){delete di[t]}},ci=null,_i={N(){if(!z(ci))return ci;if(ci=!0,L(t))ci=!1;else try{var e="__support__";_i.q(e,"xyz"),'"xyz"'!==_i.P(e)&&(ci=!1),_i.A(e)}catch(t){ci=!1}return ci},D(t){ae.error("sessionStorage error: ",t)},P(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){_i.D(t)}return null},F(t){try{return JSON.parse(_i.P(t))||null}catch(t){}return null},q(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){_i.D(t)}return!1},A(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){_i.D(t)}}};class pi{constructor(t){this._instance=t}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}isOptedOut(){return this.Se.cookieless_mode===Ce||this.isRejected()||-1===this.consent&&this.Se.cookieless_mode===Ae}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Se.opt_out_capturing_by_default}optInOut(t){this.Ct.q(this.It,t?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.A(this.It,this.Se.cross_subdomain_cookie)}get It(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:i}=this._instance.config;return i||(e?e+t:"__ph_opt_in_out_"+t)}get St(){var t=this.Ct.P(this.It);return K(t)?1:k(X,t)?0:-1}get Ct(){var t=this.Se.opt_out_capturing_persistence_type,e="localStorage"===t?li:ai;if(!this.Tt||this.Tt!==e){this.Tt=e;var i="localStorage"===t?ai:li;i.P(this.It)&&(this.Tt.P(this.It)||this.optInOut(K(i.P(this.It))),i.A(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,h.doNotTrack].some((t=>K(t)))}}var fi=["next","previous","prev",">","<","+","-","−","–"];ue("[Dead Clicks]");var gi=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(pe)),r=t.instance.config.capture_dead_clicks;return H(r)?r:!!D(r)||i},mi=ue("[SegmentIntegration]");var wi="posthog-js";function bi(t,e){var{organization:i,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===e?{}:e;return e=>{var a,u,l,h,d;if("*"!==n&&!n.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var c,_=(null==(a=e.exception)?void 0:a.values)||[],f=_.map((t=>p({},t,{stacktrace:t.stacktrace?p({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>p({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(u=_[0])?void 0:u.value)||e.message,$exception_type:null==(l=_[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==(h=_[0])?void 0:h.value)||e.message,$sentry_exception_type:null==(d=_[0])?void 0:d.type,$sentry_tags:e.tags};return i&&r&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+e.event_id),o&&(null==(c=t.exceptions)||c.sendExceptionEvent(g)),e}}class yi{constructor(t,e,i,r,s,n){this.name=wi,this.setupOnce=function(o){o(bi(t,{organization:e,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class xi{constructor(t){this.Rt=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ae.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Lt()}Lt(){var t;this.Ft=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Rt)}destroy(){var t;null==(t=this.Ft)||t.call(this),this.Ft=void 0}doPageView(e,i){var r,s=this.At(e,i);return this.Ot={pathname:null!==(r=null==t?void 0:t.location.pathname)&&void 0!==r?r:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(t){var e;return this.At(t,null==(e=this.Ot)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ot)?void 0:t.pageViewId}}At(t,e){var i=this.Ot;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{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:u,lastContentY:l,maxContentY:h}=s;if(!(L(n)||L(o)||L(a)||L(u)||L(l)||L(h))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),h=Math.ceil(h);var d=n>1?Q(o/n,0,1,ae):1,v=n>1?Q(a/n,0,1,ae):1,c=u>1?Q(l/u,0,1,ae):1,_=u>1?Q(h/u,0,1,ae):1;r=We(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:h,$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}}var Ei=["flags","surveys"],$i={[de]:{exposure:"hidden"},[ce]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[_e]:{exposure:"hidden"},$autocapture_disabled_server_side:{exposure:"event"},$heatmaps_enabled_server_side:{exposure:"hidden"},$exception_capture_enabled_server_side:{exposure:"event"},$error_tracking_suppression_rules:{exposure:"hidden"},$error_tracking_capture_extension_exceptions:{exposure:"event"},$web_vitals_enabled_server_side:{exposure:"event"},[pe]:{exposure:"event"},$product_tours_enabled_server_side:{exposure:"hidden"},$web_vitals_allowed_metrics:{exposure:"event"},[fe]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ge]:{exposure:"hidden"},[me]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:t=>z(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[we]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!D(t))return{};for(var e={},i=Object.keys(t),r=0;i.length>r;r++)e["$feature/"+i[r]]=t[i[r]];return e}},$active_feature_flags:{exposure:"event",storageGroup:"flags"},$early_access_features:{exposure:"hidden"},$feature_flag_details:{exposure:"hidden",storageGroup:"flags"},$feature_flag_payloads:{exposure:"event",storageGroup:"flags"},$feature_flag_request_id:{exposure:"event",storageGroup:"flags",volatile:!0},$override_feature_flags:{exposure:"event"},$override_feature_flag_payloads:{exposure:"hidden"},$stored_person_properties:{exposure:"hidden"},$stored_group_properties:{exposure:"hidden"},$surveys:{exposure:"hidden",storageGroup:"surveys"},[be]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},$surveys_activated:{exposure:"event"},ph_product_tours:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ye]:{exposure:"hidden"},$flag_call_reported_session_id:{exposure:"hidden"},$feature_flag_errors:{exposure:"hidden"},[xe]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ee]:{exposure:"hidden"},[$e]:{exposure:"hidden"},[Se]:{exposure:"hidden"},[Te]:{exposure:"hidden"},[Re]:{exposure:"hidden"},[Pe]:{exposure:"hidden"},[ke]:{exposure:"hidden"},$replay_override_sampling:{exposure:"event"},$replay_override_linked_flag:{exposure:"event"},$replay_override_url_trigger:{exposure:"event"},$replay_override_event_trigger:{exposure:"event"},[Ie]:{exposure:"event"},[Me]:{exposure:"event"},$sdk_debug_recording_script_not_loaded:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Si=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Ti=t=>{var e=$i[t];if(e)return e;for(var[i,r]of Si)if(0===t.indexOf(i))return r},Ri=t=>{var e=null==r?void 0:r.createElement("a");return L(e)?null:(e.href=t,e)},Pi=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(!C(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){ae.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},ki=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],u=(o||"").split("&"),l=[],h=0;u.length>h;h++){var d=u[h].split("=");C(d)&&(e.includes(d[0])?l.push(d[0]+"="+i):l.push(u[h]))}var v=a;return null!=o&&(v+="?"+l.join("&")),null!=s&&(v+="#"+s),v},Oi="https?://(.*)",Ii=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Mi=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ii],Ai="<masked>",Ci=["li_fat_id"];function Ui(t,e){var i=Mi.concat(e||[]),r={};return He(i,(function(e){var i=Pi(t,e);r[e]=i||null})),r}function Di(t){var e=function(t){return t?0===t.search(Oi+"google.([^/?]*)")?"google":0===t.search(Oi+"bing.com")?"bing":0===t.search(Oi+"yahoo.com")?"yahoo":0===t.search(Oi+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",s={};if(!z(e)){s.$search_engine=e;var n=r?Pi(r.referrer,i):"";n.length&&(s.ph_keyword=n)}return s}function Ni(){return navigator.language||navigator.userLanguage}var Li="$direct";function Bi(){return(null==r?void 0:r.referrer)||Li}function Fi(t,e,i){void 0===i&&(i=!1);var r=t?[...Ii,...e||[]]:[],n=i?ne(null==s?void 0:s.href):null==s?void 0:s.href,o=null==n?void 0:n.substring(0,1e3);return{r:Bi().substring(0,1e3),u:o?ki(o,r,Ai):void 0}}function zi(t,e){var i;void 0===e&&(e=!1);var{r:r,u:s}=t,n=e?ne(s):s,o={$referrer:r,$referring_domain:null==r?void 0:r==Li?Li:null==(i=Ri(r))?void 0:i.host};if(n){o.$current_url=n;var a=Ri(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var u=Ui(n);We(o,u)}if(r){var l=Di(r);We(o,l)}return o}function qi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function ji(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Gi={flags:xe,surveys:be},Hi=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Wi="main";class Yi{constructor(e,i,r){if(void 0===r&&(r=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=e,this.qt=r,this.props={},this.Bt=!1,this.jt=(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"})(e),this.Ct=this.Ht(e),this.Nt=this.Ut(e),this.load(),e.debug&&ae.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var s=()=>this.flush();Xe(t,"beforeunload",s,{capture:!1}),Xe(t,"pagehide",s,{capture:!1})}}zt(){var t,e=null==(t=this.Se)?void 0:t.persistence_save_debounce_ms;return j(e)&&e>0?e:0}isDisabled(){return!!this.Vt}Ht(e){-1===Hi.indexOf(e.persistence.toLowerCase())&&(ae.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i,r=function(e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var r=[...hi,...e];return p({},li,{F(t){try{var e={};try{e=ai.F(t)||{}}catch(t){}var r,s=JSON.parse(li.P(t)||"{}");if(i){var n={};for(var o in e){var a=e[o];z(a)||""===a||(n[o]=a)}r=We(s,n)}else r=We(e,s);return li.q(t,r),r}catch(t){}return null},q(t,e,i,s,n,o){var a=li.q(t,e,void 0,void 0,o);try{var u={};r.forEach((t=>{e[t]&&(u[t]=e[t])})),Object.keys(u).length&&ai.q(t,u,i,s,n,o)}catch(t){li.D(t)}return a},A(e,i){try{null==t||t.localStorage.removeItem(e),ai.A(e,i)}catch(t){li.D(t)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,n=e.persistence.toLowerCase();return"localstorage"===n&&li.N()?(i=li,s=!0):"localstorage+cookie"===n&&r.N()?(i=r,s=!0):"sessionstorage"===n&&_i.N()?i=_i:"memory"===n?i=vi:"cookie"===n?i=ai:r.N()?(i=r,s=!0):i=ai,this.Dt=s,i}Wt(t){return this.jt+"__"+t}Ut(t){return this.Dt&&!!t.split_storage}Gt(t){var e=null!=t?t:this.Se.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var i=this.props[xe];return!i||"number"!=typeof i||Date.now()-i>e}properties(){var t={};return He(this.props,((e,i)=>{var r=Ti(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,i===we?()=>this.Gt():()=>!1))return;r.transformToEventProperties&&We(t,r.transformToEventProperties(e))}else if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,(()=>!1)))return;t[i]=e}})),t}load(){if(!this.Vt){var t=this.Ct.F(this.jt);t&&(this.props=We({},t)),this.Nt&&this.Zt()}}Zt(){for(var t of Ei){var e=li.F(this.Wt(t));if(e&&!N(e)){var i=this.Qt(t);i.persisted=!0,this.Jt(t)||(i.fingerprint=this.Yt(e,t)),this.Kt(t,e)||We(this.props,e)}}}Jt(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Ti(e))?void 0:i.storageGroup)===t}))}Kt(t,e){var i=Gi[t];if(!i)return!1;var r=e[i],s=this.props[i];return j(r)&&j(s)&&s>r}refreshKey(t){var e;if(!this.Vt){var i=this.Nt?null==(e=Ti(t))?void 0:e.storageGroup:void 0,r=i?li.F(this.Wt(i)):this.Ct.F(this.jt);if(r&&t in r)this.Xt(t,r[t]);else{if(i){var s=this.Ct.F(this.jt);if(s&&t in s)return void this.Xt(t,s[t])}this.er(t)}}}save(){if(!this.Vt){var t=this.zt();t>0?L(this.tr)&&(this.tr=setTimeout((()=>{this.tr=void 0,this.rr()}),t)):this.rr()}}flush(){L(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.jt,this.props,Wi))}ir(){var{main:t,groups:e}=this.sr();for(var i of(this.nr(this.Ct,this.jt,t,Wi),Ei)){var r,s=e[i];(!N(s)||null!=(r=this.$t[i])&&r.persisted)&&this.nr(li,this.Wt(i),s,i)}}sr(){var t={},e={};for(var i of Ei)e[i]={};return He(this.props,((i,r)=>{var s,n=null==(s=Ti(r))?void 0:s.storageGroup;n?e[n][r]=i:t[r]=i})),{main:t,groups:e}}Yt(t,e){if(e===Wi)return JSON.stringify(t)+"|"+this.ar+"|"+this.lr+"|"+this.ur;var i={};return He(t,((t,e)=>{var r;i[e]=null!=(r=Ti(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}nr(t,e,i,r){var s=this.Qt(r);if(r===Wi||s.dirty||L(s.fingerprint)){var n;try{if((n=this.Yt(i,r))===s.fingerprint)return void(s.dirty=!1)}catch(t){n=void 0}t.q(e,i,this.ar,this.lr,this.ur,this.Se.debug)?(s.dirty=!1,r!==Wi&&(s.persisted=!0),L(n)||(s.fingerprint=n)):this.Se.debug&&ae.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var{keepGroupEntries:e=!1}=void 0===t?{}:t;if(L(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.A(this.jt,!1),this.Ct.A(this.jt,!0),!e&&this.qt)for(var i of Ei)li.A(this.Wt(i));e?delete this.$t[Wi]:this.$t={}}clear(){this.remove(),this.props={}}register_once(t,e,i){if(D(t)){L(e)&&(e="None"),this.ar=L(i)?this.hr:i;var r=!1;if(He(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Xt(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(D(t)){this.ar=L(e)?this.hr:e;var i=!1;if(He(t,((e,r)=>{t.hasOwnProperty(r)&&this.props[r]!==e&&(this.Xt(r,e),i=!0)})),i)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.er(t),this.save())}update_campaign_params(){if(!this.Bt){var t=function(t,e,i){if(!r)return{};var s,n=e?[...Ii,...i||[]]:[],o=Ui(ki(r.URL,n,Ai),t),a=(s={},He(Ci,(function(t){var e=ai.P(t);s[t]=e||null})),s);return We(a,o)}(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);N(Ve(t))||this.register(t),this.Bt=!0}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Di(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Bi(),$referring_domain:null!=r&&r.referrer&&(null==(t=Ri(r.referrer))?void 0:t.host)||Li},void 0)}set_initial_person_info(){this.props[Te]||this.props[Re]||this.register_once({[Pe]:Fi(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};He([Re,Te],(e=>{var i=this.props[e];i&&He(i,(function(e,i){t["$initial_"+O(i)]=e}))}));var e=this.props[Pe];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=zi(t,e),r={};return He(i,(function(t,e){r["$initial_"+O(e)]=t})),r}(e,this.Se.disable_capture_url_hashes);We(t,i)}return t}safe_merge(t){return He(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){this.hr=this.ar=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!i),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var r=t.persistence!==e.persistence||!((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||[]),s=r?this.Ht(t):this.Ct,n=this.Ut(t);if(r||n!==this.Nt){var o=this.props;this.clear(),this.Ct=s,this.Nt=n,this.props=o,this.save()}}set_disabled(t){this.Vt=t,this.Vt?this.remove():this.save()}set_cross_subdomain(t){t!==this.lr&&(this.lr=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.ur&&(this.ur=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[_e]||{};i[t]=e,this.Xt(_e,i),this.save()}remove_event_timer(t){var e=this.props[_e]||{},i=e[t];return L(i)||(delete e[t],this.Xt(_e,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Xt(t,e),this.save()}Xt(t,e){var i;this.props[t]=e,null!=(i=Ti(t))&&i.volatile||this.dr(t)}er(t){delete this.props[t],this.dr(t)}dr(t){var e,i=null==(e=Ti(t))?void 0:e.storageGroup;i&&(this.Qt(i).dirty=!0)}Qt(t){return this.$t[t]||(this.$t[t]={})}}var Vi={Activation:"events",Cancellation:"cancelEvents"},Ji={Button:"button",Tab:"tab",Selector:"selector"},Ki={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"},Xi={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Qi={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Zi={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},tr={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},er={Once:"once",Recurring:"recurring",Always:"always"},ir={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},rr={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"},sr={Popover:"popover",Inline:"inline"},nr={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},or={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"},ar={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"},ur=ue("[RateLimiter]");class lr{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=>{ur.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void ur.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)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(Se))&&void 0!==e?e:{tokens:s,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>s&&(a.tokens=s);var u=1>a.tokens;return u||t||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(r=this.instance.persistence)||r.set_property(Se,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var hr=ue("[RemoteConfig]");class dr{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=h._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}cr(t){var e,i;null!=(e=h.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=h.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}vr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(e){t(e.json)}})}load(){try{if(this.remoteConfig)return hr.info("Using preloaded remote config",this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void hr.warn("Remote config is disabled. Falling back to local config.");this.cr((t=>{if(!t)return hr.info("No config found after loading remote JS config. Falling back to JSON."),void this.vr((t=>{this.pr(t),this.gr()}));this.pr(t),this.gr()}))}catch(t){hr.error("Error loading remote config",t)}}stop(){this.yr&&(clearInterval(this.yr),this.yr=void 0)}refresh(){!this._instance.mr()&&r&&"hidden"!==r.visibilityState&&this._instance.reloadFeatureFlags()}gr(){var t;if(!this.yr){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.yr=setInterval((()=>{this.refresh()}),e))}}pr(t){var e;t||hr.error("Failed to fetch remote config from PostHog."),this._instance.pr(null!=t?t:{}),!1!==(null==t?void 0:t.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(e=this._instance.featureFlags)||e.ensureFlagsLoaded())}}var vr=["fatal","error","warning","log","info","debug"],cr={GZipJS:"gzip-js",Base64:"base64"},_r=Uint8Array,pr=Uint16Array,fr=Uint32Array,gr=new _r([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]),mr=new _r([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]),wr=new _r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),br=function(t,e){for(var i=new pr(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var s=new fr(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]},yr=br(gr,2),xr=yr[1];yr[0][28]=258,xr[258]=28;for(var Er=br(mr,0)[1],$r=new pr(32768),Sr=0;32768>Sr;++Sr){var Tr=(43690&Sr)>>>1|(21845&Sr)<<1;$r[Sr]=((65280&(Tr=(61680&(Tr=(52428&Tr)>>>2|(13107&Tr)<<2))>>>4|(3855&Tr)<<4))>>>8|(255&Tr)<<8)>>>1}var Rr=function(t,e,i){for(var r=t.length,s=0,n=new pr(e);r>s;++s)++n[t[s]-1];var o,a=new pr(e);for(s=0;e>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new pr(1<<e);var u=15-e;for(s=0;r>s;++s)if(t[s])for(var l=s<<4|t[s],h=e-t[s],d=a[t[s]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[$r[d]>>>u]=l}else for(o=new pr(r),s=0;r>s;++s)o[s]=$r[a[t[s]-1]++]>>>15-t[s];return o},Pr=new _r(288);for(Sr=0;144>Sr;++Sr)Pr[Sr]=8;for(Sr=144;256>Sr;++Sr)Pr[Sr]=9;for(Sr=256;280>Sr;++Sr)Pr[Sr]=7;for(Sr=280;288>Sr;++Sr)Pr[Sr]=8;var kr=new _r(32);for(Sr=0;32>Sr;++Sr)kr[Sr]=5;var Or=Rr(Pr,9,0),Ir=Rr(kr,5,0),Mr=function(t){return(t/8>>0)+(7&t&&1)},Ar=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof pr?pr:t instanceof fr?fr:_r)(i-e);return r.set(t.subarray(e,i)),r},Cr=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Ur=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Dr=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 _r(0),0];if(1==s){var o=new _r(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],u=i[1],l=0,h=1,d=2;for(i[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=s-1;)a=i[i[d].f>i[l].f?l++:d++],u=i[l!=h&&i[d].f>i[l].f?l++:d++],i[h++]={s:-1,f:a.f+u.f,l:a,r:u};var v=n[0].s;for(r=1;s>r;++r)n[r].s>v&&(v=n[r].s);var c=new pr(v+1),_=Nr(i[h-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 w=n[r].s;e>c[w]?p-=1<<e-c[w]++-1:++r}for(;r>=0&&p;--r){var b=n[r].s;c[b]==e&&(--c[b],++p)}_=e}return[new _r(c),_]},Nr=function(t,e,i){return-1==t.s?Math.max(Nr(t.l,e,i+1),Nr(t.r,e,i+1)):e[t.s]=i},Lr=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new pr(++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]},Br=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Fr=function(t,e,i){var r=i.length,s=Mr(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)},zr=function(t,e,i,r,s,n,o,a,u,l,h){Cr(e,h++,i),++s[256];for(var d=Dr(s,15),v=d[0],c=d[1],_=Dr(n,15),p=_[0],f=_[1],g=Lr(v),m=g[0],w=g[1],b=Lr(p),y=b[0],x=b[1],E=new pr(19),S=0;m.length>S;++S)E[31&m[S]]++;for(S=0;y.length>S;++S)E[31&y[S]]++;for(var T=Dr(E,7),R=T[0],P=T[1],k=19;k>4&&!R[wr[k-1]];--k);var O,I,M,A,C=l+5<<3,U=Br(s,Pr)+Br(n,kr)+o,D=Br(s,v)+Br(n,p)+o+14+3*k+Br(E,R)+(2*E[16]+3*E[17]+7*E[18]);if(U>=C&&D>=C)return Fr(e,h,t.subarray(u,u+l));if(Cr(e,h,1+(U>D)),h+=2,U>D){O=Rr(v,c,0),I=v,M=Rr(p,f,0),A=p;var N=Rr(R,P,0);for(Cr(e,h,w-257),Cr(e,h+5,x-1),Cr(e,h+10,k-4),h+=14,S=0;k>S;++S)Cr(e,h+3*S,R[wr[S]]);h+=3*k;for(var L=[m,y],B=0;2>B;++B){var F=L[B];for(S=0;F.length>S;++S)Cr(e,h,N[z=31&F[S]]),h+=R[z],z>15&&(Cr(e,h,F[S]>>>5&127),h+=F[S]>>>12)}}else O=Or,I=Pr,M=Ir,A=kr;for(S=0;a>S;++S)if(r[S]>255){var z;Ur(e,h,O[257+(z=r[S]>>>18&31)]),h+=I[z+257],z>7&&(Cr(e,h,r[S]>>>23&31),h+=gr[z]);var q=31&r[S];Ur(e,h,M[q]),h+=A[q],q>3&&(Ur(e,h,r[S]>>>5&8191),h+=mr[q])}else Ur(e,h,O[r[S]]),h+=I[r[S]];return Ur(e,h,O[256]),h+I[256]},qr=new fr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),jr=function(){for(var t=new fr(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Gr=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Hr(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=jr[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var s,n,o,a,u,l=(a=10+((s=e).filename&&s.filename.length+1||0),u=8,function(t,e,i,r,s,n){var o=t.length,a=new _r(r+o+5*(1+Math.floor(o/7e3))+s),u=a.subarray(r,a.length-s),l=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?l=Fr(u,l,t.subarray(h,d)):(u[h]=!0,l=Fr(u,l,t.subarray(h,o)))}else{for(var v=qr[e-1],c=v>>>13,_=8191&v,p=(1<<i)-1,f=new pr(32768),g=new pr(p+1),m=Math.ceil(i/3),w=2*m,b=function(e){return(t[e]^t[e+1]<<m^t[e+2]<<w)&p},y=new fr(25e3),x=new pr(288),E=new pr(32),S=0,T=0,R=(h=0,0),P=0,k=0;o>h;++h){var O=b(h),I=32767&h,M=g[O];if(f[I]=M,g[O]=I,h>=P){var A=o-h;if((S>7e3||R>24576)&&A>423){l=zr(t,u,0,y,x,E,T,R,k,h-k,l),R=S=T=0,k=h;for(var C=0;286>C;++C)x[C]=0;for(C=0;30>C;++C)E[C]=0}var U=2,D=0,N=_,L=I-M&32767;if(A>2&&O==b(h-L))for(var B=Math.min(c,A)-1,F=Math.min(32767,h),z=Math.min(258,A);F>=L&&--N&&I!=M;){if(t[h+U]==t[h+U-L]){for(var q=0;z>q&&t[h+q]==t[h+q-L];++q);if(q>U){if(U=q,D=L,q>B)break;var j=Math.min(L,q-2),G=0;for(C=0;j>C;++C){var H=h-L+C+32768&32767,W=H-f[H]+32768&32767;W>G&&(G=W,M=H)}}}L+=(I=M)-(M=f[I])+32768&32767}if(D){y[R++]=268435456|xr[U]<<18|Er[D];var Y=31&xr[U],V=31&Er[D];T+=gr[Y]+mr[V],++x[257+Y],++E[V],P=h+U,++S}else y[R++]=t[h],++x[t[h]]}}l=zr(t,u,!0,y,x,E,T,R,k,h-k,l)}return Ar(a,0,r+Mr(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,u)),h=l.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&&Gr(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)}}(l,e),Gr(l,h-8,i.d()),Gr(l,h-4,r),l}var Wr=!!o||!!n,Yr="text/plain",Vr=!1,Jr=(t,e)=>{var[i,r]=t.split("#"),[s,n]=i.split("?");if(!n)return t;var o=n.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},Kr=function(t,e,i){var r;void 0===i&&(i=!0);var[s,n]=t.split("?"),o=p({},e),a=null!==(r=null==n?void 0:n.split("&").map((t=>{var e,[r,s]=t.split("="),n=i&&null!==(e=o[r])&&void 0!==e?e:s;return delete o[r],r+"="+n})))&&void 0!==r?r:[],u=function(t,e){var i,r;void 0===e&&(e="&");var s=[];return He(t,(function(t,e){L(t)||L(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)}(o);return u&&a.push(u),s+"?"+a.join("&")},Xr=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Qr=t=>{if(t.xt)return t.xt;var{data:e,compression:i}=t;if(e){if(i===cr.GZipJS){var r=Hr(function(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new _r(t.length+(t.length>>>1)),s=0,n=function(t){r[s++]=t},o=0;i>o;++o){if(s+5>r.length){var a=new _r(s+8+(i-o<<1));a.set(r),r=a}var u=t.charCodeAt(o);128>u?n(u):2048>u?(n(192|u>>>6),n(128|63&u)):u>55295&&57344>u?(n(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++o))>>>18),n(128|u>>>12&63),n(128|u>>>6&63),n(128|63&u)):(n(224|u>>>12),n(128|u>>>6&63),n(128|63&u))}return Ar(r,0,s)}(Xr(e)),{mtime:0});return{contentType:Yr,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===cr.Base64){var s=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Xr(e)),n=(t=>"data="+encodeURIComponent("string"==typeof t?t:Xr(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=Xr(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Zr=t=>{var e,i,r,s=Qr(t);return!s||(i=t.compression,r=Pi(t.url,"compression"),i!==g.GZipJS&&r!==g.GZipJS&&"gzip"!==r)||((e=s.body)instanceof ArrayBuffer?y(new Uint8Array(e)):ArrayBuffer.isView(e)&&y(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))?{url:t.url,encodedBody:s}:(Vr=!0,{url:Jr(t.url,"compression"),encodedBody:Qr(p({},t,{compression:void 0,xt:void 0}))})},ts=function(){var t=_((function*(t){var e=Xr(t.data),i=yield function(t,e,i){return T.apply(this,arguments)}(e,v.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{xt:{contentType:Yr,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),es=(t,e)=>Kr(t,{_:(new Date).getTime().toString(),ver:v.JS_SDK_VERSION,compression:e}),is=[];n&&is.push({transport:"fetch",method(t){var e,{url:i,encodedBody:r}=Zr(t),{contentType:s,body:o,estimatedSize:u}=null!=r?r:{},l=new Headers;He(t.headers,(function(t,e){l.append(e,t)})),s&&l.append("Content-Type",s);var h=null,d=null;if(a){var v=new a;h={signal:v.signal,timeout:setTimeout((()=>{var e,i;e=t.timeout,(i=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",v.abort(d=i)}),t.timeout)}}n(i,p({method:(null==t?void 0:t.method)||"GET",headers:l,keepalive:"POST"===t.method&&52428.8>(u||0),body:o,signal:null==(e=h)?void 0:e.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){ae.error(t)}null==t.callback||t.callback(r)})))).catch((e=>{e===d?ae.warn(e):ae.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>h?clearTimeout(h.timeout):null))}}),o&&is.push({transport:"XHR",method(t){var e=new o,{url:i,encodedBody:r}=Zr(t);e.open(t.method||"GET",i,!0);var{contentType:s,body:n}=null!=r?r:{};He(t.headers,(function(t,i){e.setRequestHeader(i,t)})),s&&e.setRequestHeader("Content-Type",s),t.timeout&&(e.timeout=t.timeout),e.onreadystatechange=()=>{if(4===e.readyState){var i={statusCode:e.status,text:e.responseText};if(200===e.status)try{i.json=JSON.parse(e.responseText)}catch(t){}null==t.callback||t.callback(i)}},e.send(n)}}),null!=i&&i.sendBeacon&&is.push({transport:"sendBeacon",method(t){try{var{url:e,encodedBody:r}=Zr(t),{contentType:s,body:n}=null!=r?r:{};if(!n)return;var o=n instanceof Blob?n:new Blob([n],{type:s});i.sendBeacon(e,o)}catch(t){}}});var rs=3e3;class ss{constructor(t,e){this.br=!0,this._r=[],this.wr=Q((null==e?void 0:e.flush_interval_ms)||rs,250,5e3,ae.createLogger("flush interval"),rs),this.kr=t}enqueue(t){this._r.push(t),this.Sr||this.Cr()}unload(){this.Ir();var t=this._r.length>0?this.Tr():{},e=Object.values(t);[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))].map((t=>{this.kr(p({},t,{transport:"sendBeacon"}))}))}enable(){this.br=!1,this.Cr()}Cr(){var t=this;this.br||(this.Sr=setTimeout((()=>{if(this.Ir(),this._r.length>0){var e=this.Tr(),i=function(){var i=e[r],s=(new Date).getTime();i.data&&C(i.data)&&He(i.data,(t=>{t.offset=Math.abs(t.timestamp-s),delete t.timestamp})),t.kr(i)};for(var r in e)i()}}),this.wr))}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var t={};return He(this._r,(e=>{var i,r=e,s=(r?r.batchKey:null)||r.url;L(t[s])&&(t[s]=p({},r,{data:[]})),null==(i=t[s].data)||i.push(r.data)})),this._r=[],t}}var ns=["retriesPerformedSoFar"];class os{constructor(e){this.Er=!1,this.Mr=3e3,this._r=[],this._instance=e,this._r=[],this.Pr=!0,!L(t)&&"onLine"in t.navigator&&(this.Pr=t.navigator.onLine,this.Rr=()=>{this.Pr=!0,this.Or()},this.Lr=()=>{this.Pr=!1},Xe(t,"online",this.Rr),Xe(t,"offline",this.Lr))}get length(){return this._r.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,i=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,ns);G(e)&&(i.url=Kr(i.url,{retry_count:e})),this._instance._send_request(p({},i,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.st(p({retriesPerformedSoFar:e},i));0===t.statusCode&&ae.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!=e?e:0)+" retries.")}null==i.callback||i.callback(t)}}))}st(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),s=Math.random()-.5;return Math.ceil(r+s*(r-i))}(e),r=Date.now()+i;this._r.push({retryAt:r,requestOptions:t});var s="Enqueued failed request for retry in "+i;navigator.onLine||(s+=" (Browser is offline)"),ae.warn(s),this.Er||(this.Er=!0,this.Fr())}Fr(){if(this.Ar&&clearTimeout(this.Ar),0===this._r.length)return this.Er=!1,void(this.Ar=void 0);this.Ar=setTimeout((()=>{this.Pr&&this._r.length>0&&this.Or(),this.Fr()}),this.Mr)}Or(){var t=Date.now(),e=[],i=this._r.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this._r=e,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Ar&&(clearTimeout(this.Ar),this.Ar=void 0),this.Er=!1,L(t)||(this.Rr&&(t.removeEventListener("online",this.Rr),this.Rr=void 0),this.Lr&&(t.removeEventListener("offline",this.Lr),this.Lr=void 0)),this._r))try{this._instance._send_request(p({},e,{transport:"sendBeacon"}))}catch(t){ae.error(t)}this._r=[]}}class as{constructor(t){this.$r=()=>{var t,e,i,r;this.Dr||(this.Dr={});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),u=(null==s?void 0:s.scrollHeight)||0;this.Dr.lastScrollY=Math.ceil(n),this.Dr.maxScrollY=Math.max(n,null!==(t=this.Dr.maxScrollY)&&void 0!==t?t:0),this.Dr.maxScrollHeight=Math.max(o,null!==(e=this.Dr.maxScrollHeight)&&void 0!==e?e:0),this.Dr.lastContentY=a,this.Dr.maxContentY=Math.max(a,null!==(i=this.Dr.maxContentY)&&void 0!==i?i:0),this.Dr.maxContentHeight=Math.max(u,null!==(r=this.Dr.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get Nr(){return this._instance.config.scroll_root_selector}getContext(){return this.Dr}resetContext(){var t=this.Dr;return setTimeout(this.$r,0),t}startMeasuringScrollPosition(){Xe(t,"scroll",this.$r,{capture:!0}),Xe(t,"scrollend",this.$r,{capture:!0}),Xe(t,"resize",this.$r)}scrollElement(){if(!this.Nr)return null==t?void 0:t.document.documentElement;var e=C(this.Nr)?this.Nr:[this.Nr];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}qr(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.Nr){var r=this.scrollElement();return r&&r[i]||0}return t?"y"===e?t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop||0:t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft||0:0}scrollY(){return this.qr("y")}scrollX(){return this.qr("x")}}var us=t=>Fi(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);class ls{constructor(t,e,i,r){this.Br=t=>{var e=this.jr();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Hr(this._instance)};this.Ur.register({[$e]:i})}},this._instance=t,this.zr=e,this.Ur=i,this.Hr=r||us,this.zr.onSessionId(this.Br)}jr(){return this.Ur.props[$e]}getSetOnceProps(){var t,e=null==(t=this.jr())?void 0:t.props;return e?"r"in e?zi(e,this._instance.config.disable_capture_url_hashes):{$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 He(Ve(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+O(i)]=e})),t}}class hs{constructor(){this.Vr={}}on(t,e){return this.Vr[t]||(this.Vr[t]=[]),this.Vr[t].push(e),()=>{this.Vr[t]=this.Vr[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Vr[t]||[])i(e);for(var r of this.Vr["*"]||[])r(t,e)}}var ds=ue("[SessionId]");class vs{on(t,e){return this.Wr.on(t,e)}constructor(t,e,i){var r;if(this.Gr=null,this.Zr=[],this.Qr=void 0,this.Jr=!1,this.Wr=new hs,this.Yr=(t,e)=>!(!G(t)||!G(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Ce)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=t.config,this.Ur=t.persistence,this.Kr=void 0,this.Xr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ei=e||ri,this.ti=i||ri;var s=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*Q(this.Se.session_idle_timeout_seconds||1800,60,36e3,ds.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ri(),this.ii="ph_"+s+"_window_id",this.ni="ph_"+s+"_primary_window_exists",this.si()){var n=_i.F(this.ii),o=_i.F(this.ni);n&&!o?this.Kr=n:_i.A(this.ii),_i.q(this.ni,!0)}if(null!=(r=this.Se.bootstrap)&&r.sessionID)try{var a=(t=>{var e=this.Se.bootstrap.sessionID.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)})();this.oi(this.Se.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){ds.error("Invalid sessionID in bootstrap",t)}this.ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return L(this.Zr)&&(this.Zr=[]),this.Zr.push(t),this.Xr&&t(this.Xr,this.Kr),()=>{this.Zr=this.Zr.filter((e=>e!==t))}}si(){return"memory"!==this.Se.persistence&&!this.Ur.Vt&&_i.N()}li(t){t!==this.Kr&&(this.Kr=t,this.si()&&_i.q(this.ii,t))}ui(){return this.Kr?this.Kr:this.si()?_i.F(this.ii):null}hi(t){var e=this.Gr;return!z(e)&&!z(t)&&5e3>Math.abs(t-e)}oi(t,e,i){var r=e!==this._sessionActivityTimestamp,s=!(t!==this.Xr||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Xr=t,s&&!r||s&&this.hi(e)||(this.Gr=e,this.Ur.register({[ge]:[e,t,i]}))}di(){var t,e=null==(t=this.Se)?void 0:t.persistence_save_debounce_ms;return G(e)&&e>0}ci(){this.di()?this.Ur.refreshKey(ge):(this.Ur.flush(),this.Ur.load())}vi(){var t;if(!z(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Gr){this.ci();var[,e,i]=this.fi();e===this.Xr&&i===this._sessionStartTimestamp&&(this.Gr=this._sessionActivityTimestamp,this.Ur.register({[ge]:[this._sessionActivityTimestamp,null!==(t=this.Xr)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Ur.flush())}}pi(){var[t]=this.fi(),e=G(t)?t:0,i=G(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}gi(t){return this.ci(),this.Yr(t,this.pi())}fi(){var t=this.Ur.props[ge];return C(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Gr=null,clearTimeout(this.mi),this.mi=void 0,this.oi(null,null,null)}destroy(){this.Jr=!0,this.vi(),clearTimeout(this.mi),this.mi=void 0,this.Qr&&t&&(t.removeEventListener(Be,this.Qr,{capture:!1}),this.Qr=void 0),this.Zr=[]}ai(){this.Qr=()=>{this.vi(),this.si()&&_i.A(this.ni)},Xe(t,Be,this.Qr,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Se.cookieless_mode===Ce)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=e||(new Date).getTime(),[,r,s]=this.fi(),n=this.pi(),o=this.ui(),a=G(s)&&Math.abs(i-s)>864e5,u=!1,l=!1,h=!r,d=r,v=!h&&!t&&this.Yr(i,n);v&&((v=this.gi(i))||ds.info("cross-tab refresh kept the session alive",{sessionId:r}),[,r,s]=this.fi()),h||v||a?(r=this.ei(),o=this.ti(),ds.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:h,activityTimeout:v,sessionPastMaximumLength:a}}),s=i,u=!0):(o||(o=this.ti(),u=!0),(l=r!==d)&&(ds.info("adopted cross-tab session id",{sessionId:r,windowId:o}),u=!0));var c=G(n)&&t&&!a?n:i,_=G(s)?s:(new Date).getTime();this.li(o),this.oi(r,c,_),t||this.ri();var p={noSessionId:h,activityTimeout:v,sessionPastMaximumLength:a,crossTabAdoption:l};return u&&this.Zr.forEach((t=>t(r,o,p))),{sessionId:r,windowId:o,sessionStartTimestamp:_,changeReason:u?p:void 0,lastActivityTimestamp:n}}ri(){this.Jr||(clearTimeout(this.mi),this.mi=setTimeout((()=>{if(!this.Jr)if(this.gi((new Date).getTime())){var t=this.Xr;this.resetSessionId(),this.Wr.emit("forcedIdleReset",{idleSessionId:t})}else this.ri()}),1.1*this.sessionTimeoutMs))}}function cs(t,e,i){return Xr({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var _s="custom",ps="i.posthog.com",fs=/^\/static\//;class gs{constructor(t){this.yi={},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("."+ps,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.yi[this.apiHost]||(this.yi[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":_s),this.yi[this.apiHost]}bi(t){if(fs.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if("assets"===t){var i=this.bi(e);if(i)return""+i+e}if(this.region===_s)return this.apiHost+e;var r=ps+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var ms=ue("[Surveys]"),ws={ignoreConditions:!1,ignoreDelay:!1,displayType:sr.Popover},bs=ue("[PostHog ExternalIntegrations]"),ys={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class xs{constructor(t){this._instance=t}Mt(t,e){var i;null==(i=h.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return bs.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var i,s,n;!r||null!=(i=h.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.Mt(ys[e],(()=>{var i;null==(i=h.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)})),!r&&null!=(s=h.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=h.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[i,r]of Object.entries(null!==(s=this._instance.config.integrations)&&void 0!==s?s:{})){var s;e(i)}}}var Es,$s={},Ss=0,Ts=()=>{},Rs='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Ps="Surveys module not available",ks="sanitize_properties is deprecated. Use before_send instead",Os="Invalid value for property_denylist config: ",Is="posthog",Ms=!Wr&&-1===(null==l?void 0:l.indexOf("MSIE"))&&-1===(null==l?void 0:l.indexOf("Mozilla")),As=e=>{var i;return p({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ke(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ts,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:s&&B(null==s?void 0:s.search)&&-1!==s.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,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==t||null==(i=t.location)?void 0:i.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,surveys_request_timeout_ms:1e4,on_request_error(t){ae.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:Ne,before_send:void 0,request_queue_config:{flush_interval_ms:rs},error_tracking:{},_onCapture:Ts},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:fi,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},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)}))(e))},Cs=[["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"]],Us=t=>{var e={};for(var[i,r]of Cs)L(t[i])||(e[r]=t[i]);var s=We({},e,t),n=t.__preview_external_dependency_versioned_paths;return L(n)||(L(t.strict_script_versioning)&&(s.strict_script_versioning=!!n),B(n)&&L(t.asset_host)&&(s.asset_host=n)),C(t.property_blacklist)&&(L(t.property_denylist)?s.property_denylist=t.property_blacklist:C(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:ae.error(Os+t.property_denylist)),s};class Ds{constructor(){this.__forceAllowLocalhost=!1}get wi(){return this.__forceAllowLocalhost}set wi(t){ae.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Ns{xi(t,e){if(t){var i=this.ki.indexOf(t);-1!==i&&this.ki.splice(i,1)}return this.ki.push(e),null==e.initialize||e.initialize(),e}Si(){return this.config.cookieless_mode===Ce||this.config.cookieless_mode===Ae&&this.consent.isRejected()}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 t;this.webPerformance=new Ds,this.Ci=!1,this.version=v.LIB_VERSION,this.Ii=new hs,this.ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=As(),this.SentryIntegration=yi,this.sentryIntegration=t=>function(t,e){var i=bi(t,e);return{name:wi,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ti=!1,this.Ei=null,this.Mi=null,this.Pi=null,this.scrollManager=new as(this),this.pageViewManager=new xi(this),this.rateLimiter=new lr(this),this.requestRouter=new gs(this),this.consent=new pi(this),this.externalIntegrations=new xs(this);var e=null!==(t=Ns.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=B(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=B(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>ae.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==Is){var r,s=null!==(r=$s[i])&&void 0!==r?r:new Ns;return s._init(t,e,i),$s[i]=s,$s[Is][i]=s,s}return this._init(t,e,i)}_init(e,i,r){var s,n;void 0===i&&(i={});var o=B(e)?e.trim():"";if(!o)return ae.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 console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},i.debug=this.Ri(i.debug),this.Oi=i,this.Li=[],i.person_profiles?this.Mi=i.person_profiles:i.process_person&&(this.Mi=i.process_person);var a=As(i.defaults),u=Us(i),l=We({},a,u,{name:r,token:o});D(a.rageclick)&&D(u.rageclick)&&(l.rageclick=We({},a.rageclick,u.rageclick)),D(a.session_recording)&&D(u.session_recording)&&(l.session_recording=We({},a.session_recording,u.session_recording)),this.set_config(l),this.config.on_xhr_error&&ae.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:cr.GZipJS;var h=this.Fi();this.persistence=new Yi(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Yi(p({},this.config,{persistence:"sessionStorage"}),h,!1);var d=p({},this.persistence.props),c=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ai=new ss((t=>this.$i(t)),this.config.request_queue_config),this.Di=new os(this),this.__request_queue=[];var _=this.Si();if(_||(this.sessionManager=new vs(this),this.sessionPropsManager=new ls(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ae.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Ni(_)}),0)):(ae.info("Initializing extensions synchronously"),this.Ni(_)),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&ae.info("Starting in debug mode",{this:this,config:i,thisC:p({},this.config),p:d,s:c}),!this.config.identity_distinct_id||null!=(s=i.bootstrap)&&s.distinctID||(i.bootstrap=p({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(n=i.bootstrap)?void 0:n.distinctID)){var f=i.bootstrap.distinctID,g=this.get_distinct_id(),m=this.persistence.get_property(Ee);if(i.bootstrap.isIdentifiedID&&null!=g&&g!==f&&m===Ue)this.identify(f);else if(i.bootstrap.isIdentifiedID&&null!=g&&g!==f&&m===De)ae.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 w=this.config.get_device_id(ri()),b=i.bootstrap.isIdentifiedID?w:f;this.persistence.set_property(Ee,i.bootstrap.isIdentifiedID?De:Ue),this.register({distinct_id:f,$device_id:b})}}if(_)this.register_once({distinct_id:Oe,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(ri());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(Ee,Ue)}return Xe(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||ri();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(Ee,De)),e()},s=i.user();"then"in s&&U(s.then)?s.then(r):r(s)}(t,(()=>{i.register((t=>{Promise&&Promise.resolve||mi.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(mi.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(mi.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,Fe),identify:t=>e(t,qe),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.qi())):this.qi(),U(this.config._onCapture)&&this.config._onCapture!==Ts&&(ae.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&ae.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}Ni(t){var e,i,r,s,n,o,a,u=performance.now(),l=p({},Ns.__defaultExtensionClasses,this.config.__extensionClasses),h=[];l.featureFlags&&this.ki.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new l.featureFlags(this)),l.exceptions&&this.ki.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new l.exceptions(this)),l.historyAutocapture&&this.ki.push(this.historyAutocapture=new l.historyAutocapture(this)),l.tracingHeaders&&this.ki.push(this.tracingHeaders=new l.tracingHeaders(this)),l.siteApps&&this.ki.push(this.siteApps=new l.siteApps(this)),l.sessionRecording&&!t&&this.ki.push(this.sessionRecording=new l.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),l.autocapture&&this.ki.push(this.autocapture=new l.autocapture(this)),l.surveys&&this.ki.push(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new l.surveys(this)),l.logs&&this.ki.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new l.logs(this)),l.conversations&&this.ki.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new l.conversations(this)),l.productTours&&this.ki.push(this.productTours=new l.productTours(this)),l.heatmaps&&this.ki.push(this.heatmaps=new l.heatmaps(this)),l.webVitalsAutocapture&&this.ki.push(this.webVitalsAutocapture=new l.webVitalsAutocapture(this)),l.exceptionObserver&&this.ki.push(this.exceptionObserver=new l.exceptionObserver(this)),l.deadClicksAutocapture&&this.ki.push(this.deadClicksAutocapture=new l.deadClicksAutocapture(this,gi)),l.toolbar&&this.ki.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new l.toolbar(this)),l.experiments&&this.ki.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new l.experiments(this)),this.ki.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.Bi){var t=this.Bi;this.Bi=void 0,this.pr(t)}})),this.ji(h,u)}ji(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.ji(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){ae.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Ie]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Me]:r}),this.config.__preview_deferred_init_extensions&&ae.info("PostHog extensions initialized ("+r+"ms)")}pr(t){var e;if(!r||!r.body)return ae.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.pr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Bi=t),this.Hi=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=k(t.supportedCompression,cr.GZipJS)?cr.GZipJS:k(t.supportedCompression,cr.Base64)?cr.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Mi?this.Mi:Ne}),this.ki.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}qi(){try{this.config.loaded(this)}catch(t){ae.critical("`loaded` function failed",t)}if(this.Ui(),this.config.internal_or_test_user_hostname&&null!=s&&s.hostname){var t=s.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.Si())&&this.zi()}),1),this.Vi=new dr(this),this.Vi.load()}Ui(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Ai)||t.enable())}_dom_loaded(){this.is_capturing()&&Ge(this.__request_queue,(t=>this.$i(t))),this.__request_queue=[],this.Ui()}_handle_unload(){var t,e,i,r;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),this.config.request_batching?(this.Wi()&&this.capture(ze),null==(e=this.logs)||e.flushLogs("sendBeacon"),null==(i=this.Ai)||i.unload(),null==(r=this.Di)||r.unload()):this.Wi()&&this.capture(ze,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?Ms?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=p({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(L(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,r,s=p({},t);s.timeout=s.timeout||6e4,s.url=es(s.url,s.compression);var n=null!==(e=s.transport)&&void 0!==e?e:"fetch",o=is.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),a=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(t[i].transport===n)return t[i]}(o))?void 0:r.method)&&void 0!==i?i:o[0].method;if(!a)throw new Error("No available transport method");"sendBeacon"!==n&&s.data&&s.compression===cr.GZipJS&&u&&!Vr?ts(s).then((t=>{a(t)})).catch((e=>{if(x(e))return Vr=!0,void a(p({},s,{compression:void 0,url:es(t.url,void 0)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return x(t)||e===b})(e)&&(Vr=!0),a(s)})):a(s)})(p({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}$i(t){this.Di?this.Di.retriableRequest(t):this._send_request(t)}_execute_array(t){Ss++;try{var e,i=[],r=[],s=[];Ge(t,(t=>{if(t)if(C(e=t[0]))s.push(t);else if(U(t))try{t.call(this)}catch(e){ae.error("Error executing queued PostHog call",t,e)}else C(t)&&"alias"===e?i.push(t):C(t)&&-1!==e.indexOf("capture")&&U(this[e])?s.push(t):r.push(t)}));var n=function(t,e){Ge(t,(function(t){try{if(C(t[0])){var i=e;He(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){ae.error("Error executing queued PostHog call",t,e)}}))};n(i,this),n(r,this),n(s,this)}finally{Ss--}}push(t){if(Ss>0&&C(t)&&B(t[0])){var e=Ns.prototype[t[0]];U(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var r,s,n,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ai){if(this.is_capturing())if(!L(t)&&B(t)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var l=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==l||!l.isRateLimited){null!=e&&e.$current_url&&!B(null==e?void 0:e.$current_url)&&(ae.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!=i&&i.Gi||ae.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&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 h=new Date,d=(null==i?void 0:i.timestamp)||h,v=se(null==i?void 0:i.uuid,ri),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Fe&&this.config.__preview_capture_bot_pageviews&&u&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),l&&(c.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var _=null==i?void 0:i.$unset;_&&(c.$unset=_);var f,g,m,w=this.Zi(null==i?void 0:i.$set_once,t!==je,t===qe);if(w&&(c.$set_once=w),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,n=c,o=t=>B(t)?t.slice(0,s):t,a=new Set,c=function t(e,i){return e!==Object(e)?o?o(e):e:a.has(e)?void 0:(a.add(e),C(e)?(r=[],Ge(e,(e=>{r.push(t(e))}))):(r={},He(e,((e,i)=>{a.has(e)||(r[i]=t(e,i))}))),r);var r}(n)),c.timestamp=d,L(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=h),t===ir.DISMISSED||t===ir.SENT){var b=null==e?void 0:e[rr.SURVEY_ID],y=null==e?void 0:e[rr.SURVEY_ITERATION];(t=>{try{var e=(t=>((t,e)=>{var i=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(i=""+t+e.id+"_"+e.current_iteration),i})("seenSurvey_",t))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){ms.error("Failed to persist survey seen state",t)}})({id:b,current_iteration:y}),c.$set=p({},c.$set,{[(f={id:b,current_iteration:y},g=t===ir.SENT?"responded":"dismissed",m="$survey_"+g+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(m="$survey_"+g+"/"+f.id+"/"+f.current_iteration),m)]:!0})}else t===ir.SHOWN&&(c.$set=p({},c.$set,{[rr.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===or.SHOWN){var x=null==e?void 0:e[ar.TOUR_TYPE];x&&(c.$set=p({},c.$set,{[ar.TOUR_LAST_SEEN_DATE+"/"+x]:(new Date).toISOString()}))}var E=p({},c.properties.$set,c.$set);if(N(E)||this.setPersonPropertiesForFlags(E),!q(this.config.before_send)){var S=this.it(c);if(!S)return;(c=S).uuid=se(c.uuid,ri)}this.Ii.emit("eventCaptured",c);var T={method:"POST",url:null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.$i(T):this.Ai.enqueue(T),c}ae.critical("This capture call is ignored due to client rate limiting.")}}else ae.error("No event name provided to posthog.capture")}else ae.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(e,i,n,o,a){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return i;var u=a?void 0:this.persistence.remove_event_timer(e),h=p({},i);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Si()&&(h.$cookieless_mode=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!B(h.distinct_id)&&!j(h.distinct_id)||F(h.distinct_id))&&ae.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var c,_=function(e,i,r,n){var o,a,u,h;if(void 0===n&&(n=!1),!l)return{};var d,c,_,p,f,g,m,w,b,y=e?[...Ii,...i||[]]:[],[x,E]=function(t){for(var e=0;ee.length>e;e++){var[i,r]=ee[e],s=i.exec(t),n=s&&(U(r)?r(s,t):r);if(n)return n}return["",""]}(l),S=null!=(d="undefined"!=typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},T={detectGoogleSearchApp:r},R=We(Ve({$os:x,$os_version:E,$browser:Qt(l,navigator.vendor,S,T),$device:ie(l),$device_type:(_=l,p={userAgentDataPlatform:null==(o=navigator)||null==(o=o.userAgentData)?void 0:o.platform,maxTouchPoints:null==(a=navigator)?void 0:a.maxTouchPoints,screenWidth:null==t||null==(u=t.screen)?void 0:u.width,screenHeight:null==t||null==(h=t.screen)?void 0:h.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio},b=ie(_),b===st||b===rt||"Kobo"===b||"Kindle Fire"===b||b===Ct?it:b===Et||b===St||b===$t||b===It?"Console":b===ot?"Wearable":b?Z:"Android"===(null==p?void 0:p.userAgentDataPlatform)&&(null!==(f=null==p?void 0:p.maxTouchPoints)&&void 0!==f?f:0)>0?600>Math.min(null!==(g=null==p?void 0:p.screenWidth)&&void 0!==g?g:0,null!==(m=null==p?void 0:p.screenHeight)&&void 0!==m?m:0)/(null!==(w=null==p?void 0:p.devicePixelRatio)&&void 0!==w?w:1)?Z:it:"Desktop"),$timezone:qi(),$timezone_offset:ji()}),{$current_url:ki(n?ne(null==s?void 0:s.href):null==s?void 0:s.href,y,Ai),$host:null==s?void 0:s.host,$pathname:null==s?void 0:s.pathname,$raw_user_agent:l.length>1e3?l.substring(0,997)+"...":l,$browser_version:te(l,navigator.vendor,S,T),$browser_language:Ni(),$browser_language_prefix:(c=Ni(),"string"==typeof c?c.split("-")[0]:void 0),$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:v.LIB_NAME,$lib_version:v.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return v.SDK_DIST_CHANNEL&&(R.$sdk_dist_channel=v.SDK_DIST_CHANNEL),R}(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{sessionId:f,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(a,n.getTime());h.$session_id=f,h.$window_id=g}this.sessionPropsManager&&We(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&We(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.Di)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===_s&&(h.$lib_custom_api_host=this.config.api_host),c=e!==Fe||a?e!==ze||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,o),h=We(h,c),e===Fe&&r&&(h.title=r.title),!L(u)){var w=n.getTime()-u;h.$duration=parseFloat((w/1e3).toFixed(3))}l&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser"),(h=We({},_,this.persistence.properties(),this.sessionPersistence.properties(),h)).$is_identified=this._isIdentified(),C(this.config.property_denylist)?He(this.config.property_denylist,(function(t){delete h[t]})):ae.error(Os+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(ae.error(ks),h=b(h,e));var y=this.Qi();return h.$process_person_profile=y,y&&!a&&this.Ji("_calculate_event_properties"),h}Zi(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Qi())return t;if(this.Ci&&!i)return t;var s=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=We({},s,n||{},t||{}),a=this.config.sanitize_properties;return a&&(ae.error(ks),o=a(o,"$set_once")),e&&(this.Ci=!0),N(o)?void 0:o}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;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}Yi(t,e){this.register({[t]:e})}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)}isFeatureEnabled(t,e){var i;return null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(t,e)}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.Ii.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:Ps}),()=>{})}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:Ps})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Ps})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=ws),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:Ps}}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:Ps})}Ki(t){return!t||F(t)?(ae.critical("Unique user id has not been set in posthog.identify"),!1):t===Oe?(ae.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())||(ae.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 ae.uninitializedWarning("posthog.identify");if(j(t)&&(t=t.toString(),ae.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Ki(t)&&this.Ji("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:t}),this.get_property(ve)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),t!==r&&t!==this.get_property(ce)&&(this.unregister(ce),this.register({distinct_id:t}));var s,n=(this.persistence.get_property(Ee)||Ue)===Ue;t!==r&&n?(this.persistence.set_property(Ee,De),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.capture(qe,{distinct_id:t,$anon_distinct_id:r},{$set:e||{},$set_once:i||{}}),this.Pi=cs(t,e,i),null==(s=this.featureFlags)||s.setAnonymousDistinctId(r)):(e||i)&&this.setPersonProperties(e,i),t!==r&&(this.reloadFeatureFlags(),this.unregister(ye))}}setPersonProperties(t,e){if((t||e)&&this.Ji("posthog.setPersonProperties")){var i=cs(this.get_distinct_id(),t,e);this.Pi!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Pi=i):ae.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(C(t)?t:[t]).filter((t=>B(t)&&t.length>0));0!==i.length&&this.Ji("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Pi=null)}group(t,e,i){if(t&&e){var r=this.getGroups(),s=r[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},r,{[t]:e})}),s||i){var n={$group_type:t,$group_key:e};i&&(n.$group_set=i),this.capture(je,n)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else ae.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.Ji("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,i,r,s,n,o,a,u,l;if(ae.info("reset"),!this.__loaded)return ae.uninitializedWarning("posthog.reset");var h,d=this.get_property(ve),v=this.get_property(fe);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(i=this.sessionPersistence)||i.clear(),L(v)||null==(h=this.persistence)||h.register({[fe]:v}),null==(r=this.surveys)||r.reset(),null==(s=this.Vi)||s.stop(),null==(n=this.featureFlags)||n.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(u=this.persistence)||u.set_property(Ee,Ue),null==(l=this.sessionManager)||l.resetSessionId(),this.Pi=null,this.config.cookieless_mode===Ce)this.register_once({distinct_id:Oe,$device_id:null},"");else{var c=this.config.get_device_id(ri());this.register_once({distinct_id:c,$device_id:t?c:d},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Xi()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.en()}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{sessionId:e,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);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(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(t,e){return t===this.get_property(de)?(ae.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ji("posthog.alias")?(L(e)&&(e=this.get_distinct_id()),t!==e?(this.Yi(ce,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ae.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(D(t)){var i,r,s,n,o,a,u,l,h,d,c;We(this.config,Us(t));var _=this.Fi();null==(i=this.persistence)||i.update_config(this.config,e,_),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Yi(p({},this.config,{persistence:"sessionStorage"}),_,!1);var f=this.Ri(this.config.debug);H(f)&&(this.config.debug=f),H(this.config.debug)&&(this.config.debug?(v.DEBUG=!0,li.N()&&li.q("ph_debug",!0),ae.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(v.DEBUG=!1,li.N()&&li.A("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this.tn(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){v.LIB_NAME=t,v.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){if(this.exceptions){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(p({},r,e))}}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 t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:Ns.rn}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:Is;return e!==Is&&(e=Is+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Ee))===De||(null==(e=this.sessionPersistence)?void 0:e.get_property(Ee))===De}Qi(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Ne&&!this._isIdentified()&&N(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[ce])&&(null==(e=this.persistence)||null==(e=e.props)||!e[ke]))}Wi(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Qi()||this.Ji("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Ji("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Ji(t){return"never"===this.config.person_profiles?(ae.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Yi(ke,!0),!0)}Fi(){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&&this.config.cookieless_mode!==Ae)}tn(){var t,e,i,r,s=this.Fi();return(null==(t=this.persistence)?void 0:t.Vt)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.Vt)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Ce){if(this.Si()){var i,r,s,n,o;this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new vs(this),this.pageViewManager=new xi(this),this.persistence&&(this.sessionPropsManager=new ls(this,this.sessionManager,this.persistence));var a,u=null!==(s=null==(n=this.config.__extensionClasses)?void 0:n.sessionRecording)&&void 0!==s?s:null==(o=Ns.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.xi(this.sessionRecording,new u(this)),this.Hi&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Hi)))}var l,h;this.consent.optInOut(!0),this.tn(),this.Ui(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ae&&(null==(l=this.surveys)||l.loadIfEnabled()),(L(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.zi()}else ae.warn(Rs)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==Ce?(this.config.cookieless_mode===Ae&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.tn(),this.config.cookieless_mode===Ae&&(this.register({distinct_id:Oe,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),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.zi(),this.Ui())):ae.warn(Rs)}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.config.cookieless_mode===Ce||(this.config.cookieless_mode===Ae?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.tn()}_is_bot(){return i?function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&P(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>P(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver}(i,this.config.custom_blocked_useragents):void 0}zi(){r&&("visible"===r.visibilityState?this.Ti||(this.Ti=!0,this.capture(Fe,{title:r.title},{send_instantly:!0}),this.Ei&&(r.removeEventListener(Le,this.Ei),this.Ei=null)):this.Ei||(this.Ei=this.zi.bind(this),Xe(r,Le,this.Ei)))}debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==t||t.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}))}mr(){var t,e,i,r,s,n,o=this.Oi||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ae.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):(i="advanced_disable_decide",!1,r=ae,s=(e="advanced_disable_flags")in(t=o)&&!q(t[e]),n=i in t&&!q(t[i]),s?t[e]:!!n&&(r&&r.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i]))}it(t){var e;if(q(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(V),r=C(this.config.before_send)?this.config.before_send:[this.config.before_send],s=t;for(var n of r){if(s=n(s),q(s)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Y(t.event)?ae.warn(o+". This can cause unexpected behavior."):ae.info(o),null}s.properties&&!N(s.properties)||ae.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of i)if(s.properties&&q(s.properties[a]))return ae.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var t;return null==(t=this.pageViewManager.Ot)?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)})}Ri(t){var e=H(t)&&!t,i=li.N()&&"true"===li.P("ph_debug");return!e&&(!!i||t)}}Ns.__defaultExtensionClasses={},Ns.rn={trace:Es=()=>{},debug:Es,info:Es,warn:Es,error:Es,fatal:Es},function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Ye(t.prototype[e[i]])}(Ns,["identify"]);var Ls=function(){v.SDK_DIST_CHANNEL="npm";var e=$s[Is]=new Ns;return function(){function e(){e.done||(e.done=!0,Ms=!1,He($s,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():Xe(r,"DOMContentLoaded",e,{capture:!1}):t&&ae.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}();export{cr as Compression,nr as DEFAULT_PRODUCT_TOUR_APPEARANCE,sr as DisplaySurveyType,Ns as PostHog,or as ProductTourEventName,ar as ProductTourEventProperties,ir as SurveyEventName,rr as SurveyEventProperties,Vi as SurveyEventType,Ki as SurveyPosition,tr as SurveyQuestionBranchingType,Zi as SurveyQuestionType,er as SurveySchedule,Xi as SurveyTabPosition,Qi as SurveyType,Ji as SurveyWidgetType,Ls as default,Ls as posthog,vr as severityLevels};
|
|
1
|
+
var t="undefined"!=typeof window?window:void 0,e="undefined"!=typeof globalThis?globalThis:t;"undefined"==typeof self&&(e.self=e),"undefined"==typeof File&&(e.File=function(){});var i=null==e?void 0:e.navigator,r=null==e?void 0:e.document,s=null==e?void 0:e.location,n=null==e?void 0:e.fetch,o=null!=e&&e.XMLHttpRequest&&"withCredentials"in new e.XMLHttpRequest?e.XMLHttpRequest:void 0,a=null==e?void 0:e.AbortController,u=null==e?void 0:e.CompressionStream,l=null==i?void 0:i.userAgent,h=null!=t?t:{},d="1.393.5",v={DEBUG:!1,LIB_VERSION:d,LIB_NAME:"web",JS_SDK_VERSION:d};function c(t,e,i,r,s,n,o){try{var a=t[n](o),u=a.value}catch(t){return void i(t)}a.done?e(u):Promise.resolve(u).then(r,s)}function _(t){return function(){var e=this,i=arguments;return new Promise((function(r,s){var n=t.apply(e,i);function o(t){c(n,r,s,o,a,"next",t)}function a(t){c(n,r,s,o,a,"throw",t)}o(void 0)}))}}function p(){return p=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},p.apply(null,arguments)}var f,g=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),m=["$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"],b="NativeGzipValidationError",y=t=>t.length>=2&&31===t[0]&&139===t[1],x=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),E=t=>{var e=new Error("Native gzip produced invalid output: "+t);throw e.name=b,e},S=function(){var t=_((function*(t,e){18>t.size&&E("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());y(i)&&8===i[2]||E("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(f)return f;f=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;f[t]=e>>>0}return f})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&E("invalid-crc");var s=e.length>>>0;r.getUint32(4,!0)!==s&&E("invalid-size")}));return function(e,i){return t.apply(this,arguments)}}();function T(){return T=_((function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),s=new CompressionStream("gzip"),n=s.writable.getWriter(),o=n.write(r).then((()=>n.close())).catch(function(){var t=_((function*(t){try{yield n.abort(t)}catch(t){}throw t}));return function(e){return t.apply(this,arguments)}}()),a=new Response(s.readable).blob(),[u]=yield Promise.all([a,o]);return yield S(u,r),u}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}})),T.apply(this,arguments)}var R=["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","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],P=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return R.concat(e).some((t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)}))};function k(t,e){return-1!==t.indexOf(e)}var O=function(t){return t.replace(/^\$/,"")},I=Object.prototype,M=I.hasOwnProperty,A=I.toString,C=Array.isArray||function(t){return"[object Array]"===A.call(t)},U=t=>"function"==typeof t,D=t=>t===Object(t)&&!C(t),N=t=>{if(D(t)){for(var e in t)if(M.call(t,e))return!1;return!0}return!1},L=t=>void 0===t,B=t=>"[object String]"==A.call(t),F=t=>B(t)&&0===t.trim().length,z=t=>null===t,q=t=>L(t)||z(t),j=t=>"[object Number]"==A.call(t)&&t==t,G=t=>j(t)&&t>0,H=t=>"[object Boolean]"===A.call(t),W=t=>t instanceof FormData,Y=t=>k(m,t),V=t=>k(w,t),J=[!0,"true",1,"1","yes"],K=t=>k(J,t),X=[!1,"false",0,"0","no"];function Q(t,e,i,r,s){return e>i&&(r.warn("min cannot be greater than max."),e=i),j(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),Q(s||i,e,i,r))}var Z="Mobile",tt="iOS",et="Android",it="Tablet",rt=et+" "+it,st="iPad",nt="Apple",ot=nt+" Watch",at="Safari",ut="BlackBerry",lt="Samsung",ht=lt+"Browser",dt=lt+" Internet",vt="Chrome",ct=vt+" OS",_t=vt+" "+tt,pt="Internet Explorer",ft=pt+" "+Z,gt="Opera",mt=gt+" Mini",wt="Edge",bt="Microsoft "+wt,yt="Firefox",xt=yt+" "+tt,Et="Nintendo",$t="PlayStation",St="Xbox",Tt=et+" "+Z,Rt=Z+" "+at,Pt="Windows",kt=Pt+" Phone",Ot="Nokia",It="Ouya",Mt="Generic",At=Mt+" "+Z.toLowerCase(),Ct=Mt+" "+it.toLowerCase(),Ut="Konqueror",Dt="Oculus Browser",Nt="Vivaldi",Lt="Yandex",Bt="Whale",Ft="DuckDuckGo",zt="Pale Moon",qt="Waterfox",jt="Brave",Gt="Google Search App",Ht="(\\d+(\\.\\d+)?)",Wt=new RegExp("Version/"+Ht),Yt=new RegExp(St,"i"),Vt=new RegExp($t+" \\w+","i"),Jt=new RegExp(Et+" \\w+","i"),Kt=new RegExp(ut+"|PlayBook|BB10","i"),Xt={"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?jt:null}(i);return s||(null!=r&&r.detectGoogleSearchApp&&k(t,"GSA/")?Gt:k(t," OPR/")&&k(t,"Mini")?mt:k(t," OPR/")?gt:Kt.test(t)?ut:k(t,"IE"+Z)||k(t,"WPDesktop")?ft:k(t,"OculusBrowser")?Dt:k(t,ht)?dt:k(t,wt)||k(t,"Edg/")?bt:k(t,Nt+"/")?Nt:k(t,"YaBrowser/")?Lt:k(t,Bt+"/")?Bt:k(t,Ft+"/")||k(t,"Ddg/")?Ft:k(t,"FBIOS")?"Facebook "+Z:k(t,"UCWEB")||k(t,"UCBrowser")?"UC Browser":k(t,"CriOS")?_t:k(t,"CrMo")||k(t,vt)?vt:k(t,et)&&k(t,at)?Tt:k(t,"FxiOS")?xt:k(t.toLowerCase(),Ut.toLowerCase())?Ut:k(t,jt+"/")?jt:((t,e)=>e&&k(e,nt)||function(t){return k(t,at)&&!k(t,vt)&&!k(t,et)}(t))(t,e)?k(t,Z)?Rt:at:k(t,"PaleMoon/")?zt:k(t,qt+"/")?qt:k(t,yt)?yt:k(t,"MSIE")||k(t,"Trident/")?pt:k(t,"Gecko")?yt:"")},Zt={[ft]:[new RegExp("rv:"+Ht)],[bt]:[new RegExp(wt+"?\\/"+Ht)],[vt]:[new RegExp("("+vt+"|CrMo)\\/"+Ht)],[_t]:[new RegExp("CriOS\\/"+Ht)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ht)],[at]:[Wt],[Rt]:[Wt],[gt]:[new RegExp("(Opera|OPR)\\/"+Ht)],[yt]:[new RegExp(yt+"\\/"+Ht)],[xt]:[new RegExp("FxiOS\\/"+Ht)],[Ut]:[new RegExp("Konqueror[:/]?"+Ht,"i")],[ut]:[new RegExp(ut+" "+Ht),Wt],[Tt]:[new RegExp("android\\s"+Ht,"i")],[dt]:[new RegExp(ht+"\\/"+Ht)],[Dt]:[new RegExp("OculusBrowser\\/"+Ht)],[Nt]:[new RegExp(Nt+"\\/"+Ht)],[Lt]:[new RegExp("YaBrowser\\/"+Ht)],[Bt]:[new RegExp(Bt+"\\/"+Ht)],[jt]:[new RegExp(jt+"\\/"+Ht)],[Ft]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Ht)],[zt]:[new RegExp("PaleMoon\\/"+Ht)],[qt]:[new RegExp(qt+"\\/"+Ht)],[Gt]:[new RegExp("GSA\\/"+Ht)],[pt]:[new RegExp("(rv:|MSIE )"+Ht)],Mozilla:[new RegExp("rv:"+Ht)]},te=function(t,e,i,r){var s=Qt(t,e,i,r),n=Zt[s];if(L(n))return null;for(var o=0;n.length>o;o++){var a=t.match(n[o]);if(a)return parseFloat(a[a.length-2])}return null},ee=[[new RegExp(St+"; "+St+" (.*?)[);]","i"),t=>[St,t&&t[1]||""]],[new RegExp(Et,"i"),[Et,""]],[new RegExp($t,"i"),[$t,""]],[Kt,[ut,""]],[new RegExp(Pt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[kt,""];if(new RegExp(Z).test(e)&&!/IEMobile\b/.test(e))return[Pt+" "+Z,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Xt[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[Pt,r]}return[Pt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[tt,[t[3],t[4],t[5]||"0"].join(".")]:[tt,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=L(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+et+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+et+")","i"),t=>t&&t[2]?[et,[t[2],t[3],t[4]||"0"].join(".")]:[et,""]],[/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/,[ct,""]],[/Linux|debian/i,["Linux",""]]],ie=function(t){return Jt.test(t)?Et:Vt.test(t)?$t:Yt.test(t)?St:new RegExp(It,"i").test(t)?It:new RegExp("("+kt+"|WPDesktop)","i").test(t)?kt:/iPad/.test(t)?st:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ot:Kt.test(t)?ut:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ot,"i").test(t)?Ot:/(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(Z).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)?et:rt:new RegExp("(pda|"+Z+")","i").test(t)?At:new RegExp(it,"i").test(t)&&!new RegExp(it+" pc","i").test(t)?Ct:""},re=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function se(t,e){return"string"==typeof(i=t)&&re.test(i)?t:e();var i}function ne(t){return t?t.split("#")[0]:t}var oe=function(e,i){var{debugEnabled:r}=void 0===i?{}:i,s={k(i){if(t&&(v.DEBUG||h.POSTHOG_DEBUG||r)&&!L(t.console)&&t.console){for(var s=("__rrweb_original__"in t.console[i]?t.console[i].__rrweb_original__:t.console[i]),n=arguments.length,o=new Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];s(e,...o)}},debug(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.k("error",...e)},critical(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(t){s.error("You must initialize PostHog before calling "+t)},createLogger:(t,i)=>oe(e+" "+t,i)};return s},ae=oe("[PostHog.js]"),ue=ae.createLogger,le=ue("[ExternalScriptsLoader]"),he=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return le.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==r?void 0:r.querySelectorAll("script");if(s)for(var n,o=function(){if(s[a].src===e){var t=s[a];return t.__posthog_loading_callback_fired?{v:i()}:(t.addEventListener("load",(e=>{t.__posthog_loading_callback_fired=!0,i(void 0,e)})),t.onerror=t=>i(t),{v:void 0})}},a=0;s.length>a;a++)if(n=o())return n.v;var u=()=>{if(!r)return i("document not found");var s=r.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=e,s.onload=t=>{s.__posthog_loading_callback_fired=!0,i(void 0,t)},s.onerror=t=>i(t),t.config.prepare_external_dependency_script&&(s=t.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===t.config.external_scripts_inject_target)r.head.appendChild(s);else{var n,o=r.querySelectorAll("body > script");o.length>0?null==(n=o[0].parentNode)||n.insertBefore(s,o[0]):r.body.appendChild(s)}};null!=r&&r.body?u():null==r||r.addEventListener("DOMContentLoaded",u)};h.__PosthogExtensions__=h.__PosthogExtensions__||{},h.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r;if(t.config.strict_script_versioning)r=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+t.version;if("toolbar"===e){var n=3e5;s=s+"&t="+Math.floor(Date.now()/n)*n}r=t.requestRouter.endpointFor("assets",s)}he(t,r,i)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");he(t,o,i)}},h.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);he(t,r,i)};var de="$people_distinct_id",ve="$device_id",ce="__alias",_e="__timers",pe="$dead_clicks_enabled_server_side",fe="$session_recording_remote_config",ge="$sesid",me="$session_is_sampled",we="$enabled_feature_flags",be="$surveys_loaded_at",ye="$flag_call_reported",xe="$feature_flag_evaluated_at",Ee="$user_state",$e="$client_session_props",Se="$capture_rate_limit",Te="$initial_campaign_params",Re="$initial_referrer_info",Pe="$initial_person_info",ke="$epp",Oe="$posthog_cookieless",Ie="$sdk_debug_extensions_init_method",Me="$sdk_debug_extensions_init_time_ms",Ae="on_reject",Ce="always",Ue="anonymous",De="identified",Ne="identified_only",Le="visibilitychange",Be="beforeunload",Fe="$pageview",ze="$pageleave",qe="$identify",je="$groupidentify";function Ge(t,e){C(t)&&t.forEach(e)}function He(t,e){if(!q(t))if(C(t))t.forEach(e);else if(W(t))t.forEach(((t,i)=>e(t,i)));else for(var i in t)M.call(t,i)&&e(t[i],i)}var We=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},Ye=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){ae.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ae.critical(t)}}},Ve=function(t){var e={};return He(t,(function(t,i){(B(t)&&t.length>0||j(t))&&(e[i]=t)})),e};var Je=["herokuapp.com","vercel.app","netlify.app"];function Ke(t){var e=null==t?void 0:t.hostname;if(!B(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of Je)if(i===r)return!1;return!0}function Xe(t,e,i,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==t||t.addEventListener(e,i,{capture:s,passive:n})}Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return j(t)&&isFinite(t)&&Math.floor(t)===t});class Qe{constructor(t){if(this.bytes=t,16!==t.length)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,e,i,r){if(!Number.isInteger(t)||!Number.isInteger(e)||!Number.isInteger(i)||!Number.isInteger(r)||0>t||0>e||0>i||0>r||t>0xffffffffffff||e>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|e>>>8,s[7]=e,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new Qe(s)}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 Qe(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}}class Ze{constructor(){this.S=0,this.C=0,this.I=new ii}generate(){var t=this.generateOrAbort();if(L(t)){this.S=0;var e=this.generateOrAbort();if(L(e))throw new Error("Could not generate UUID after timestamp reset");return e}return t}generateOrAbort(){var t=Date.now();if(t>this.S)this.S=t,this.M();else{if(this.S>=t+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return Qe.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var ti,ei=t=>{if("undefined"!=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};t&&!L(t.crypto)&&crypto.getRandomValues&&(ei=t=>crypto.getRandomValues(t));class ii{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(ei(this.R),this.O=0),this.R[this.O++]}}var ri=()=>si().toString(),si=()=>(ti||(ti=new Ze)).generate(),ni="",oi=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var ai={N:()=>!!r,D(t){ae.error("cookieStore error: "+t)},P(t){if(r){try{for(var e=t+"=",i=r.cookie.split(";").filter((t=>t.length)),s=0;i.length>s;s++){for(var n=i[s];" "==n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(e))return decodeURIComponent(n.substring(e.length,n.length))}}catch(t){}return null}},F(t){var e;try{e=JSON.parse(ai.P(t))||{}}catch(t){}return e},q(t,e,i,s,n){if(!r)return!1;try{var o="",a="",u=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),ni)return ni;if(!e)return"";if(["localhost","127.0.0.1"].includes(t))return"";for(var i=t.split("."),s=Math.min(i.length,8),n="dmn_chk_"+ri();!ni&&s--;){var o=i.slice(s).join("."),a=n+"=1;domain=."+o+";path=/";e.cookie=a+";max-age=3",e.cookie.includes(n)&&(e.cookie=a+";max-age=0",ni=o)}return ni}(t);if(!i){var s=(t=>{var e=t.match(oi);return e?e[0]:""})(t);s!==i&&ae.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(r.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),o="; expires="+l.toUTCString()}n&&(a="; secure");var h=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+u+a;return h.length>3686.4&&ae.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},A(t,e){if(null!=r&&r.cookie)try{ai.q(t,"",-1,e)}catch(t){return}}},ui=null,li={N(){if(!z(ui))return ui;var e=!0;if(L(t))e=!1;else try{var i="__mplssupport__";li.q(i,"xyz"),'"xyz"'!==li.P(i)&&(e=!1),li.A(i)}catch(t){e=!1}return e||ae.error("localStorage unsupported; falling back to cookie store"),ui=e,e},D(t){ae.error("localStorage error: "+t)},P(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){li.D(t)}return null},F(t){try{return JSON.parse(li.P(t))||{}}catch(t){}return null},q(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){li.D(t)}return!1},A(e){try{null==t||t.localStorage.removeItem(e)}catch(t){li.D(t)}}},hi=[ve,"distinct_id",ge,me,ke,Pe,Ee],di={},vi={N:()=>!0,D(t){ae.error("memoryStorage error: "+t)},P:t=>di[t]||null,F:t=>di[t]||null,q:(t,e)=>(di[t]=e,!0),A(t){delete di[t]}},ci=null,_i={N(){if(!z(ci))return ci;if(ci=!0,L(t))ci=!1;else try{var e="__support__";_i.q(e,"xyz"),'"xyz"'!==_i.P(e)&&(ci=!1),_i.A(e)}catch(t){ci=!1}return ci},D(t){ae.error("sessionStorage error: ",t)},P(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){_i.D(t)}return null},F(t){try{return JSON.parse(_i.P(t))||null}catch(t){}return null},q(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){_i.D(t)}return!1},A(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){_i.D(t)}}};class pi{constructor(t){this._instance=t}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}isOptedOut(){return this.Se.cookieless_mode===Ce||this.isRejected()||-1===this.consent&&this.Se.cookieless_mode===Ae}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Se.opt_out_capturing_by_default}optInOut(t){this.Ct.q(this.It,t?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.A(this.It,this.Se.cross_subdomain_cookie)}get It(){var{token:t,opt_out_capturing_cookie_prefix:e,consent_persistence_name:i}=this._instance.config;return i||(e?e+t:"__ph_opt_in_out_"+t)}get St(){var t=this.Ct.P(this.It);return K(t)?1:k(X,t)?0:-1}get Ct(){var t=this.Se.opt_out_capturing_persistence_type,e="localStorage"===t?li:ai;if(!this.Tt||this.Tt!==e){this.Tt=e;var i="localStorage"===t?ai:li;i.P(this.It)&&(this.Tt.P(this.It)||this.optInOut(K(i.P(this.It))),i.A(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,h.doNotTrack].some((t=>K(t)))}}var fi=["next","previous","prev",">","<","+","-","−","–"];ue("[Dead Clicks]");var gi=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(pe)),r=t.instance.config.capture_dead_clicks;return H(r)?r:!!D(r)||i},mi=ue("[SegmentIntegration]");var wi="posthog-js";function bi(t,e){var{organization:i,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===e?{}:e;return e=>{var a,u,l,h,d;if("*"!==n&&!n.includes(e.level)||!t.__loaded)return e;e.tags||(e.tags={});var v=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());e.tags["PostHog Person URL"]=v,t.sessionRecordingStarted()&&(e.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var c,_=(null==(a=e.exception)?void 0:a.values)||[],f=_.map((t=>p({},t,{stacktrace:t.stacktrace?p({},t.stacktrace,{type:"raw",frames:(t.stacktrace.frames||[]).map((t=>p({},t,{platform:"web:javascript"})))}):void 0}))),g={$exception_message:(null==(u=_[0])?void 0:u.value)||e.message,$exception_type:null==(l=_[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==(h=_[0])?void 0:h.value)||e.message,$sentry_exception_type:null==(d=_[0])?void 0:d.type,$sentry_tags:e.tags};return i&&r&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+e.event_id),o&&(null==(c=t.exceptions)||c.sendExceptionEvent(g)),e}}class yi{constructor(t,e,i,r,s,n){this.name=wi,this.setupOnce=function(o){o(bi(t,{organization:e,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class xi{constructor(t){this.Rt=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(ae.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Lt()}Lt(){var t;this.Ft=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Rt)}destroy(){var t;null==(t=this.Ft)||t.call(this),this.Ft=void 0}doPageView(e,i){var r,s=this.At(e,i);return this.Ot={pathname:null!==(r=null==t?void 0:t.location.pathname)&&void 0!==r?r:"",pageViewId:i,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(t){var e;return this.At(t,null==(e=this.Ot)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Ot)?void 0:t.pageViewId}}At(t,e){var i=this.Ot;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{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:u,lastContentY:l,maxContentY:h}=s;if(!(L(n)||L(o)||L(a)||L(u)||L(l)||L(h))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),u=Math.ceil(u),l=Math.ceil(l),h=Math.ceil(h);var d=n>1?Q(o/n,0,1,ae):1,v=n>1?Q(a/n,0,1,ae):1,c=u>1?Q(l/u,0,1,ae):1,_=u>1?Q(h/u,0,1,ae):1;r=We(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:h,$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}}var Ei=["flags","surveys"],$i={[de]:{exposure:"hidden"},[ce]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[_e]:{exposure:"hidden"},$autocapture_disabled_server_side:{exposure:"event"},$heatmaps_enabled_server_side:{exposure:"hidden"},$exception_capture_enabled_server_side:{exposure:"event"},$error_tracking_suppression_rules:{exposure:"hidden"},$error_tracking_capture_extension_exceptions:{exposure:"event"},$web_vitals_enabled_server_side:{exposure:"event"},[pe]:{exposure:"event"},$product_tours_enabled_server_side:{exposure:"hidden"},$web_vitals_allowed_metrics:{exposure:"event"},[fe]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ge]:{exposure:"hidden"},[me]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:t=>z(t)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[we]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(t,e)=>e(),transformToEventProperties(t){if(!D(t))return{};for(var e={},i=Object.keys(t),r=0;i.length>r;r++)e["$feature/"+i[r]]=t[i[r]];return e}},$active_feature_flags:{exposure:"event",storageGroup:"flags"},$early_access_features:{exposure:"hidden"},$feature_flag_details:{exposure:"hidden",storageGroup:"flags"},$feature_flag_payloads:{exposure:"event",storageGroup:"flags"},$feature_flag_request_id:{exposure:"event",storageGroup:"flags",volatile:!0},$override_feature_flags:{exposure:"event"},$override_feature_flag_payloads:{exposure:"hidden"},$stored_person_properties:{exposure:"hidden"},$stored_group_properties:{exposure:"hidden"},$surveys:{exposure:"hidden",storageGroup:"surveys"},[be]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},$surveys_activated:{exposure:"event"},ph_product_tours:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ye]:{exposure:"hidden"},$flag_call_reported_session_id:{exposure:"hidden"},$feature_flag_errors:{exposure:"hidden"},[xe]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ee]:{exposure:"hidden"},[$e]:{exposure:"hidden"},[Se]:{exposure:"hidden"},[Te]:{exposure:"hidden"},[Re]:{exposure:"hidden"},[Pe]:{exposure:"hidden"},[ke]:{exposure:"hidden"},$replay_override_sampling:{exposure:"event"},$replay_override_linked_flag:{exposure:"event"},$replay_override_url_trigger:{exposure:"event"},$replay_override_event_trigger:{exposure:"event"},[Ie]:{exposure:"event"},[Me]:{exposure:"event"},$sdk_debug_recording_script_not_loaded:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Si=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Ti=t=>{var e=$i[t];if(e)return e;for(var[i,r]of Si)if(0===t.indexOf(i))return r},Ri=t=>{var e=null==r?void 0:r.createElement("a");return L(e)?null:(e.href=t,e)},Pi=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(!C(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){ae.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},ki=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],u=(o||"").split("&"),l=[],h=0;u.length>h;h++){var d=u[h].split("=");C(d)&&(e.includes(d[0])?l.push(d[0]+"="+i):l.push(u[h]))}var v=a;return null!=o&&(v+="?"+l.join("&")),null!=s&&(v+="#"+s),v},Oi="https?://(.*)",Ii=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Mi=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Ii],Ai="<masked>",Ci=["li_fat_id"];function Ui(t,e){var i=Mi.concat(e||[]),r={};return He(i,(function(e){var i=Pi(t,e);r[e]=i||null})),r}function Di(t){var e=function(t){return t?0===t.search(Oi+"google.([^/?]*)")?"google":0===t.search(Oi+"bing.com")?"bing":0===t.search(Oi+"yahoo.com")?"yahoo":0===t.search(Oi+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",s={};if(!z(e)){s.$search_engine=e;var n=r?Pi(r.referrer,i):"";n.length&&(s.ph_keyword=n)}return s}function Ni(){return navigator.language||navigator.userLanguage}var Li="$direct";function Bi(){return(null==r?void 0:r.referrer)||Li}function Fi(t,e,i){void 0===i&&(i=!1);var r=t?[...Ii,...e||[]]:[],n=i?ne(null==s?void 0:s.href):null==s?void 0:s.href,o=null==n?void 0:n.substring(0,1e3);return{r:Bi().substring(0,1e3),u:o?ki(o,r,Ai):void 0}}function zi(t,e){var i;void 0===e&&(e=!1);var{r:r,u:s}=t,n=e?ne(s):s,o={$referrer:r,$referring_domain:null==r?void 0:r==Li?Li:null==(i=Ri(r))?void 0:i.host};if(n){o.$current_url=n;var a=Ri(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var u=Ui(n);We(o,u)}if(r){var l=Di(r);We(o,l)}return o}function qi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function ji(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var Gi={flags:xe,surveys:be},Hi=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Wi="main";class Yi{constructor(e,i,r){if(void 0===r&&(r=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=e,this.qt=r,this.props={},this.Bt=!1,this.jt=(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"})(e),this.Ct=this.Ht(e),this.Nt=this.Ut(e),this.load(),e.debug&&ae.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var s=()=>this.flush();Xe(t,"beforeunload",s,{capture:!1}),Xe(t,"pagehide",s,{capture:!1})}}zt(){var t,e=null==(t=this.Se)?void 0:t.persistence_save_debounce_ms;return j(e)&&e>0?e:0}isDisabled(){return!!this.Vt}Ht(e){-1===Hi.indexOf(e.persistence.toLowerCase())&&(ae.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var i,r=function(e,i){void 0===e&&(e=[]),void 0===i&&(i=!1);var r=[...hi,...e];return p({},li,{F(t){try{var e={};try{e=ai.F(t)||{}}catch(t){}var r,s=JSON.parse(li.P(t)||"{}");if(i){var n={};for(var o in e){var a=e[o];z(a)||""===a||(n[o]=a)}r=We(s,n)}else r=We(e,s);return li.q(t,r),r}catch(t){}return null},q(t,e,i,s,n,o){var a=li.q(t,e,void 0,void 0,o);try{var u={};r.forEach((t=>{e[t]&&(u[t]=e[t])})),Object.keys(u).length&&ai.q(t,u,i,s,n,o)}catch(t){li.D(t)}return a},A(e,i){try{null==t||t.localStorage.removeItem(e),ai.A(e,i)}catch(t){li.D(t)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,n=e.persistence.toLowerCase();return"localstorage"===n&&li.N()?(i=li,s=!0):"localstorage+cookie"===n&&r.N()?(i=r,s=!0):"sessionstorage"===n&&_i.N()?i=_i:"memory"===n?i=vi:"cookie"===n?i=ai:r.N()?(i=r,s=!0):i=ai,this.Dt=s,i}Wt(t){return this.jt+"__"+t}Ut(t){return this.Dt&&!!t.split_storage}Gt(t){var e=null!=t?t:this.Se.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var i=this.props[xe];return!i||"number"!=typeof i||Date.now()-i>e}properties(){var t={};return He(this.props,((e,i)=>{var r=Ti(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,i===we?()=>this.Gt():()=>!1))return;r.transformToEventProperties&&We(t,r.transformToEventProperties(e))}else if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,(()=>!1)))return;t[i]=e}})),t}load(){if(!this.Vt){var t=this.Ct.F(this.jt);t&&(this.props=We({},t)),this.Nt&&this.Zt()}}Zt(){for(var t of Ei){var e=li.F(this.Wt(t));if(e&&!N(e)){var i=this.Qt(t);i.persisted=!0,this.Jt(t)||(i.fingerprint=this.Yt(e,t)),this.Kt(t,e)||We(this.props,e)}}}Jt(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Ti(e))?void 0:i.storageGroup)===t}))}Kt(t,e){var i=Gi[t];if(!i)return!1;var r=e[i],s=this.props[i];return j(r)&&j(s)&&s>r}refreshKey(t){var e;if(!this.Vt){var i=this.Nt?null==(e=Ti(t))?void 0:e.storageGroup:void 0,r=i?li.F(this.Wt(i)):this.Ct.F(this.jt);if(r&&t in r)this.Xt(t,r[t]);else{if(i){var s=this.Ct.F(this.jt);if(s&&t in s)return void this.Xt(t,s[t])}this.er(t)}}}save(){if(!this.Vt){var t=this.zt();t>0?L(this.tr)&&(this.tr=setTimeout((()=>{this.tr=void 0,this.rr()}),t)):this.rr()}}flush(){L(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.jt,this.props,Wi))}ir(){var{main:t,groups:e}=this.sr();for(var i of(this.nr(this.Ct,this.jt,t,Wi),Ei)){var r,s=e[i];(!N(s)||null!=(r=this.$t[i])&&r.persisted)&&this.nr(li,this.Wt(i),s,i)}}sr(){var t={},e={};for(var i of Ei)e[i]={};return He(this.props,((i,r)=>{var s,n=null==(s=Ti(r))?void 0:s.storageGroup;n?e[n][r]=i:t[r]=i})),{main:t,groups:e}}Yt(t,e){if(e===Wi)return JSON.stringify(t)+"|"+this.ar+"|"+this.lr+"|"+this.ur;var i={};return He(t,((t,e)=>{var r;i[e]=null!=(r=Ti(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}nr(t,e,i,r){var s=this.Qt(r);if(r===Wi||s.dirty||L(s.fingerprint)){var n;try{if((n=this.Yt(i,r))===s.fingerprint)return void(s.dirty=!1)}catch(t){n=void 0}t.q(e,i,this.ar,this.lr,this.ur,this.Se.debug)?(s.dirty=!1,r!==Wi&&(s.persisted=!0),L(n)||(s.fingerprint=n)):this.Se.debug&&ae.warn('failed to persist storage entry "'+e+'"; will retry on next save')}}remove(t){var{keepGroupEntries:e=!1}=void 0===t?{}:t;if(L(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.A(this.jt,!1),this.Ct.A(this.jt,!0),!e&&this.qt)for(var i of Ei)li.A(this.Wt(i));e?delete this.$t[Wi]:this.$t={}}clear(){this.remove(),this.props={}}register_once(t,e,i){if(D(t)){L(e)&&(e="None"),this.ar=L(i)?this.hr:i;var r=!1;if(He(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Xt(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(D(t)){this.ar=L(e)?this.hr:e;var i=!1;if(He(t,((e,r)=>{t.hasOwnProperty(r)&&this.props[r]!==e&&(this.Xt(r,e),i=!0)})),i)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.er(t),this.save())}update_campaign_params(){if(!this.Bt){var t=function(t,e,i){if(!r)return{};var s,n=e?[...Ii,...i||[]]:[],o=Ui(ki(r.URL,n,Ai),t),a=(s={},He(Ci,(function(t){var e=ai.P(t);s[t]=e||null})),s);return We(a,o)}(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);N(Ve(t))||this.register(t),this.Bt=!0}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Di(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Bi(),$referring_domain:null!=r&&r.referrer&&(null==(t=Ri(r.referrer))?void 0:t.host)||Li},void 0)}set_initial_person_info(){this.props[Te]||this.props[Re]||this.register_once({[Pe]:Fi(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var t={};He([Re,Te],(e=>{var i=this.props[e];i&&He(i,(function(e,i){t["$initial_"+O(i)]=e}))}));var e=this.props[Pe];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=zi(t,e),r={};return He(i,(function(t,e){r["$initial_"+O(e)]=t})),r}(e,this.Se.disable_capture_url_hashes);We(t,i)}return t}safe_merge(t){return He(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){this.hr=this.ar=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!i),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie);var r=t.persistence!==e.persistence||!((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||[]),s=r?this.Ht(t):this.Ct,n=this.Ut(t);if(r||n!==this.Nt){var o=this.props;this.clear(),this.Ct=s,this.Nt=n,this.props=o,this.save()}}set_disabled(t){this.Vt=t,this.Vt?this.remove():this.save()}set_cross_subdomain(t){t!==this.lr&&(this.lr=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.ur&&(this.ur=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[_e]||{};i[t]=e,this.Xt(_e,i),this.save()}remove_event_timer(t){var e=this.props[_e]||{},i=e[t];return L(i)||(delete e[t],this.Xt(_e,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Xt(t,e),this.save()}Xt(t,e){var i;this.props[t]=e,null!=(i=Ti(t))&&i.volatile||this.dr(t)}er(t){delete this.props[t],this.dr(t)}dr(t){var e,i=null==(e=Ti(t))?void 0:e.storageGroup;i&&(this.Qt(i).dirty=!0)}Qt(t){return this.$t[t]||(this.$t[t]={})}}var Vi={Activation:"events",Cancellation:"cancelEvents"},Ji={Button:"button",Tab:"tab",Selector:"selector"},Ki={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"},Xi={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Qi={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Zi={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},tr={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},er={Once:"once",Recurring:"recurring",Always:"always"},ir={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},rr={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"},sr={Popover:"popover",Inline:"inline"},nr={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},or={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"},ar={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"},ur=ue("[RateLimiter]");class lr{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=>{ur.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void ur.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)}clientRateLimitContext(t){var e,i,r;void 0===t&&(t=!1);var{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(Se))&&void 0!==e?e:{tokens:s,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>s&&(a.tokens=s);var u=1>a.tokens;return u||t||(a.tokens=Math.max(0,a.tokens-1)),!u||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,null==(r=this.instance.persistence)||r.set_property(Se,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var hr=ue("[RemoteConfig]");class dr{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=h._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}cr(t){var e,i;null!=(e=h.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=h.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}vr(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(e){t(e.json)}})}load(){try{if(this.remoteConfig)return hr.info("Using preloaded remote config",this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void hr.warn("Remote config is disabled. Falling back to local config.");this.cr((t=>{if(!t)return hr.info("No config found after loading remote JS config. Falling back to JSON."),void this.vr((t=>{this.pr(t),this.gr()}));this.pr(t),this.gr()}))}catch(t){hr.error("Error loading remote config",t)}}stop(){this.yr&&(clearInterval(this.yr),this.yr=void 0)}refresh(){!this._instance.mr()&&r&&"hidden"!==r.visibilityState&&this._instance.reloadFeatureFlags()}gr(){var t;if(!this.yr){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.yr=setInterval((()=>{this.refresh()}),e))}}pr(t){var e;t||hr.error("Failed to fetch remote config from PostHog."),this._instance.pr(null!=t?t:{}),!1!==(null==t?void 0:t.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(e=this._instance.featureFlags)||e.ensureFlagsLoaded())}}var vr=["fatal","error","warning","log","info","debug"],cr={GZipJS:"gzip-js",Base64:"base64"},_r=Uint8Array,pr=Uint16Array,fr=Uint32Array,gr=new _r([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]),mr=new _r([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]),wr=new _r([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),br=function(t,e){for(var i=new pr(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var s=new fr(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]},yr=br(gr,2),xr=yr[1];yr[0][28]=258,xr[258]=28;for(var Er=br(mr,0)[1],$r=new pr(32768),Sr=0;32768>Sr;++Sr){var Tr=(43690&Sr)>>>1|(21845&Sr)<<1;$r[Sr]=((65280&(Tr=(61680&(Tr=(52428&Tr)>>>2|(13107&Tr)<<2))>>>4|(3855&Tr)<<4))>>>8|(255&Tr)<<8)>>>1}var Rr=function(t,e,i){for(var r=t.length,s=0,n=new pr(e);r>s;++s)++n[t[s]-1];var o,a=new pr(e);for(s=0;e>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new pr(1<<e);var u=15-e;for(s=0;r>s;++s)if(t[s])for(var l=s<<4|t[s],h=e-t[s],d=a[t[s]-1]++<<h,v=d|(1<<h)-1;v>=d;++d)o[$r[d]>>>u]=l}else for(o=new pr(r),s=0;r>s;++s)o[s]=$r[a[t[s]-1]++]>>>15-t[s];return o},Pr=new _r(288);for(Sr=0;144>Sr;++Sr)Pr[Sr]=8;for(Sr=144;256>Sr;++Sr)Pr[Sr]=9;for(Sr=256;280>Sr;++Sr)Pr[Sr]=7;for(Sr=280;288>Sr;++Sr)Pr[Sr]=8;var kr=new _r(32);for(Sr=0;32>Sr;++Sr)kr[Sr]=5;var Or=Rr(Pr,9,0),Ir=Rr(kr,5,0),Mr=function(t){return(t/8>>0)+(7&t&&1)},Ar=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof pr?pr:t instanceof fr?fr:_r)(i-e);return r.set(t.subarray(e,i)),r},Cr=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},Ur=function(t,e,i){var r=e/8>>0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},Dr=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 _r(0),0];if(1==s){var o=new _r(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],u=i[1],l=0,h=1,d=2;for(i[0]={s:-1,f:a.f+u.f,l:a,r:u};h!=s-1;)a=i[i[d].f>i[l].f?l++:d++],u=i[l!=h&&i[d].f>i[l].f?l++:d++],i[h++]={s:-1,f:a.f+u.f,l:a,r:u};var v=n[0].s;for(r=1;s>r;++r)n[r].s>v&&(v=n[r].s);var c=new pr(v+1),_=Nr(i[h-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 w=n[r].s;e>c[w]?p-=1<<e-c[w]++-1:++r}for(;r>=0&&p;--r){var b=n[r].s;c[b]==e&&(--c[b],++p)}_=e}return[new _r(c),_]},Nr=function(t,e,i){return-1==t.s?Math.max(Nr(t.l,e,i+1),Nr(t.r,e,i+1)):e[t.s]=i},Lr=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new pr(++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]},Br=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Fr=function(t,e,i){var r=i.length,s=Mr(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)},zr=function(t,e,i,r,s,n,o,a,u,l,h){Cr(e,h++,i),++s[256];for(var d=Dr(s,15),v=d[0],c=d[1],_=Dr(n,15),p=_[0],f=_[1],g=Lr(v),m=g[0],w=g[1],b=Lr(p),y=b[0],x=b[1],E=new pr(19),S=0;m.length>S;++S)E[31&m[S]]++;for(S=0;y.length>S;++S)E[31&y[S]]++;for(var T=Dr(E,7),R=T[0],P=T[1],k=19;k>4&&!R[wr[k-1]];--k);var O,I,M,A,C=l+5<<3,U=Br(s,Pr)+Br(n,kr)+o,D=Br(s,v)+Br(n,p)+o+14+3*k+Br(E,R)+(2*E[16]+3*E[17]+7*E[18]);if(U>=C&&D>=C)return Fr(e,h,t.subarray(u,u+l));if(Cr(e,h,1+(U>D)),h+=2,U>D){O=Rr(v,c,0),I=v,M=Rr(p,f,0),A=p;var N=Rr(R,P,0);for(Cr(e,h,w-257),Cr(e,h+5,x-1),Cr(e,h+10,k-4),h+=14,S=0;k>S;++S)Cr(e,h+3*S,R[wr[S]]);h+=3*k;for(var L=[m,y],B=0;2>B;++B){var F=L[B];for(S=0;F.length>S;++S)Cr(e,h,N[z=31&F[S]]),h+=R[z],z>15&&(Cr(e,h,F[S]>>>5&127),h+=F[S]>>>12)}}else O=Or,I=Pr,M=Ir,A=kr;for(S=0;a>S;++S)if(r[S]>255){var z;Ur(e,h,O[257+(z=r[S]>>>18&31)]),h+=I[z+257],z>7&&(Cr(e,h,r[S]>>>23&31),h+=gr[z]);var q=31&r[S];Ur(e,h,M[q]),h+=A[q],q>3&&(Ur(e,h,r[S]>>>5&8191),h+=mr[q])}else Ur(e,h,O[r[S]]),h+=I[r[S]];return Ur(e,h,O[256]),h+I[256]},qr=new fr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),jr=function(){for(var t=new fr(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),Gr=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Hr(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=jr[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var s,n,o,a,u,l=(a=10+((s=e).filename&&s.filename.length+1||0),u=8,function(t,e,i,r,s,n){var o=t.length,a=new _r(r+o+5*(1+Math.floor(o/7e3))+s),u=a.subarray(r,a.length-s),l=0;if(!e||8>o)for(var h=0;o>=h;h+=65535){var d=h+65535;o>d?l=Fr(u,l,t.subarray(h,d)):(u[h]=!0,l=Fr(u,l,t.subarray(h,o)))}else{for(var v=qr[e-1],c=v>>>13,_=8191&v,p=(1<<i)-1,f=new pr(32768),g=new pr(p+1),m=Math.ceil(i/3),w=2*m,b=function(e){return(t[e]^t[e+1]<<m^t[e+2]<<w)&p},y=new fr(25e3),x=new pr(288),E=new pr(32),S=0,T=0,R=(h=0,0),P=0,k=0;o>h;++h){var O=b(h),I=32767&h,M=g[O];if(f[I]=M,g[O]=I,h>=P){var A=o-h;if((S>7e3||R>24576)&&A>423){l=zr(t,u,0,y,x,E,T,R,k,h-k,l),R=S=T=0,k=h;for(var C=0;286>C;++C)x[C]=0;for(C=0;30>C;++C)E[C]=0}var U=2,D=0,N=_,L=I-M&32767;if(A>2&&O==b(h-L))for(var B=Math.min(c,A)-1,F=Math.min(32767,h),z=Math.min(258,A);F>=L&&--N&&I!=M;){if(t[h+U]==t[h+U-L]){for(var q=0;z>q&&t[h+q]==t[h+q-L];++q);if(q>U){if(U=q,D=L,q>B)break;var j=Math.min(L,q-2),G=0;for(C=0;j>C;++C){var H=h-L+C+32768&32767,W=H-f[H]+32768&32767;W>G&&(G=W,M=H)}}}L+=(I=M)-(M=f[I])+32768&32767}if(D){y[R++]=268435456|xr[U]<<18|Er[D];var Y=31&xr[U],V=31&Er[D];T+=gr[Y]+mr[V],++x[257+Y],++E[V],P=h+U,++S}else y[R++]=t[h],++x[t[h]]}}l=zr(t,u,!0,y,x,E,T,R,k,h-k,l)}return Ar(a,0,r+Mr(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,u)),h=l.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&&Gr(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)}}(l,e),Gr(l,h-8,i.d()),Gr(l,h-4,r),l}var Wr=!!o||!!n,Yr="text/plain",Vr=!1,Jr=(t,e)=>{var[i,r]=t.split("#"),[s,n]=i.split("?");if(!n)return t;var o=n.split("&").filter((t=>t.split("=")[0]!==e)).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},Kr=function(t,e,i){var r;void 0===i&&(i=!0);var[s,n]=t.split("?"),o=p({},e),a=null!==(r=null==n?void 0:n.split("&").map((t=>{var e,[r,s]=t.split("="),n=i&&null!==(e=o[r])&&void 0!==e?e:s;return delete o[r],r+"="+n})))&&void 0!==r?r:[],u=function(t,e){var i,r;void 0===e&&(e="&");var s=[];return He(t,(function(t,e){L(t)||L(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)}(o);return u&&a.push(u),s+"?"+a.join("&")},Xr=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Qr=t=>{if(t.xt)return t.xt;var{data:e,compression:i}=t;if(e){if(i===cr.GZipJS){var r=Hr(function(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new _r(t.length+(t.length>>>1)),s=0,n=function(t){r[s++]=t},o=0;i>o;++o){if(s+5>r.length){var a=new _r(s+8+(i-o<<1));a.set(r),r=a}var u=t.charCodeAt(o);128>u?n(u):2048>u?(n(192|u>>>6),n(128|63&u)):u>55295&&57344>u?(n(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++o))>>>18),n(128|u>>>12&63),n(128|u>>>6&63),n(128|63&u)):(n(224|u>>>12),n(128|u>>>6&63),n(128|63&u))}return Ar(r,0,s)}(Xr(e)),{mtime:0});return{contentType:Yr,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===cr.Base64){var s=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Xr(e)),n=(t=>"data="+encodeURIComponent("string"==typeof t?t:Xr(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=Xr(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Zr=t=>{var e,i,r,s=Qr(t);return!s||(i=t.compression,r=Pi(t.url,"compression"),i!==g.GZipJS&&r!==g.GZipJS&&"gzip"!==r)||((e=s.body)instanceof ArrayBuffer?y(new Uint8Array(e)):ArrayBuffer.isView(e)&&y(new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))?{url:t.url,encodedBody:s}:(Vr=!0,{url:Jr(t.url,"compression"),encodedBody:Qr(p({},t,{compression:void 0,xt:void 0}))})},ts=function(){var t=_((function*(t){var e=Xr(t.data),i=yield function(t,e,i){return T.apply(this,arguments)}(e,v.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{xt:{contentType:Yr,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),es=(t,e)=>Kr(t,{_:(new Date).getTime().toString(),ver:v.JS_SDK_VERSION,compression:e}),is=[];n&&is.push({transport:"fetch",method(t){var e,{url:i,encodedBody:r}=Zr(t),{contentType:s,body:o,estimatedSize:u}=null!=r?r:{},l=new Headers;He(t.headers,(function(t,e){l.append(e,t)})),s&&l.append("Content-Type",s);var h=null,d=null;if(a){var v=new a;h={signal:v.signal,timeout:setTimeout((()=>{var e,i;e=t.timeout,(i=new Error("PostHog request timed out"+(e?" after "+e+"ms":""))).name="AbortError",v.abort(d=i)}),t.timeout)}}n(i,p({method:(null==t?void 0:t.method)||"GET",headers:l,keepalive:"POST"===t.method&&52428.8>(u||0),body:o,signal:null==(e=h)?void 0:e.signal},t.fetchOptions)).then((e=>e.text().then((i=>{var r={statusCode:e.status,text:i};if(200===e.status)try{r.json=JSON.parse(i)}catch(t){ae.error(t)}null==t.callback||t.callback(r)})))).catch((e=>{e===d?ae.warn(e):ae.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>h?clearTimeout(h.timeout):null))}}),o&&is.push({transport:"XHR",method(t){var e=new o,{url:i,encodedBody:r}=Zr(t);e.open(t.method||"GET",i,!0);var{contentType:s,body:n}=null!=r?r:{};He(t.headers,(function(t,i){e.setRequestHeader(i,t)})),s&&e.setRequestHeader("Content-Type",s),t.timeout&&(e.timeout=t.timeout),e.onreadystatechange=()=>{if(4===e.readyState){var i={statusCode:e.status,text:e.responseText};if(200===e.status)try{i.json=JSON.parse(e.responseText)}catch(t){}null==t.callback||t.callback(i)}},e.send(n)}}),null!=i&&i.sendBeacon&&is.push({transport:"sendBeacon",method(t){try{var{url:e,encodedBody:r}=Zr(t),{contentType:s,body:n}=null!=r?r:{};if(!n)return;var o=n instanceof Blob?n:new Blob([n],{type:s});i.sendBeacon(e,o)}catch(t){}}});var rs=3e3;class ss{constructor(t,e){this.br=!0,this._r=[],this.wr=Q((null==e?void 0:e.flush_interval_ms)||rs,250,5e3,ae.createLogger("flush interval"),rs),this.kr=t}enqueue(t){this._r.push(t),this.Sr||this.Cr()}unload(){this.Ir();var t=this._r.length>0?this.Tr():{},e=Object.values(t);[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))].map((t=>{this.kr(p({},t,{transport:"sendBeacon"}))}))}enable(){this.br=!1,this.Cr()}Cr(){var t=this;this.br||(this.Sr=setTimeout((()=>{if(this.Ir(),this._r.length>0){var e=this.Tr(),i=function(){var i=e[r],s=(new Date).getTime();i.data&&C(i.data)&&He(i.data,(t=>{t.offset=Math.abs(t.timestamp-s),delete t.timestamp})),t.kr(i)};for(var r in e)i()}}),this.wr))}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var t={};return He(this._r,(e=>{var i,r=e,s=(r?r.batchKey:null)||r.url;L(t[s])&&(t[s]=p({},r,{data:[]})),null==(i=t[s].data)||i.push(r.data)})),this._r=[],t}}var ns=["retriesPerformedSoFar"];class os{constructor(e){this.Er=!1,this.Mr=3e3,this._r=[],this._instance=e,this._r=[],this.Pr=!0,!L(t)&&"onLine"in t.navigator&&(this.Pr=t.navigator.onLine,this.Rr=()=>{this.Pr=!0,this.Or()},this.Lr=()=>{this.Pr=!1},Xe(t,"online",this.Rr),Xe(t,"offline",this.Lr))}get length(){return this._r.length}retriableRequest(t){var{retriesPerformedSoFar:e}=t,i=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,ns);G(e)&&(i.url=Kr(i.url,{retry_count:e})),this._instance._send_request(p({},i,{callback:t=>{if(200!==t.statusCode&&(400>t.statusCode||t.statusCode>=500)){if((0===t.statusCode?3:10)>(null!=e?e:0))return void this.st(p({retriesPerformedSoFar:e},i));0===t.statusCode&&ae.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!=e?e:0)+" retries.")}null==i.callback||i.callback(t)}}))}st(t){var e=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=e+1;var i=function(t){var e=3e3*Math.pow(2,t),i=e/2,r=Math.min(18e5,e),s=Math.random()-.5;return Math.ceil(r+s*(r-i))}(e),r=Date.now()+i;this._r.push({retryAt:r,requestOptions:t});var s="Enqueued failed request for retry in "+i;navigator.onLine||(s+=" (Browser is offline)"),ae.warn(s),this.Er||(this.Er=!0,this.Fr())}Fr(){if(this.Ar&&clearTimeout(this.Ar),0===this._r.length)return this.Er=!1,void(this.Ar=void 0);this.Ar=setTimeout((()=>{this.Pr&&this._r.length>0&&this.Or(),this.Fr()}),this.Mr)}Or(){var t=Date.now(),e=[],i=this._r.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this._r=e,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Ar&&(clearTimeout(this.Ar),this.Ar=void 0),this.Er=!1,L(t)||(this.Rr&&(t.removeEventListener("online",this.Rr),this.Rr=void 0),this.Lr&&(t.removeEventListener("offline",this.Lr),this.Lr=void 0)),this._r))try{this._instance._send_request(p({},e,{transport:"sendBeacon"}))}catch(t){ae.error(t)}this._r=[]}}class as{constructor(t){this.$r=()=>{var t,e,i,r;this.Dr||(this.Dr={});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),u=(null==s?void 0:s.scrollHeight)||0;this.Dr.lastScrollY=Math.ceil(n),this.Dr.maxScrollY=Math.max(n,null!==(t=this.Dr.maxScrollY)&&void 0!==t?t:0),this.Dr.maxScrollHeight=Math.max(o,null!==(e=this.Dr.maxScrollHeight)&&void 0!==e?e:0),this.Dr.lastContentY=a,this.Dr.maxContentY=Math.max(a,null!==(i=this.Dr.maxContentY)&&void 0!==i?i:0),this.Dr.maxContentHeight=Math.max(u,null!==(r=this.Dr.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get Nr(){return this._instance.config.scroll_root_selector}getContext(){return this.Dr}resetContext(){var t=this.Dr;return setTimeout(this.$r,0),t}startMeasuringScrollPosition(){Xe(t,"scroll",this.$r,{capture:!0}),Xe(t,"scrollend",this.$r,{capture:!0}),Xe(t,"resize",this.$r)}scrollElement(){if(!this.Nr)return null==t?void 0:t.document.documentElement;var e=C(this.Nr)?this.Nr:[this.Nr];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}qr(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.Nr){var r=this.scrollElement();return r&&r[i]||0}return t?"y"===e?t.scrollY||t.pageYOffset||t.document.documentElement.scrollTop||0:t.scrollX||t.pageXOffset||t.document.documentElement.scrollLeft||0:0}scrollY(){return this.qr("y")}scrollX(){return this.qr("x")}}var us=t=>Fi(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);class ls{constructor(t,e,i,r){this.Br=t=>{var e=this.jr();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Hr(this._instance)};this.Ur.register({[$e]:i})}},this._instance=t,this.zr=e,this.Ur=i,this.Hr=r||us,this.zr.onSessionId(this.Br)}jr(){return this.Ur.props[$e]}getSetOnceProps(){var t,e=null==(t=this.jr())?void 0:t.props;return e?"r"in e?zi(e,this._instance.config.disable_capture_url_hashes):{$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 He(Ve(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+O(i)]=e})),t}}class hs{constructor(){this.Vr={}}on(t,e){return this.Vr[t]||(this.Vr[t]=[]),this.Vr[t].push(e),()=>{this.Vr[t]=this.Vr[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Vr[t]||[])i(e);for(var r of this.Vr["*"]||[])r(t,e)}}var ds=ue("[SessionId]");class vs{on(t,e){return this.Wr.on(t,e)}constructor(t,e,i){var r;if(this.Gr=null,this.Zr=[],this.Qr=void 0,this.Jr=!1,this.Wr=new hs,this.Yr=(t,e)=>!(!G(t)||!G(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Ce)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=t.config,this.Ur=t.persistence,this.Kr=void 0,this.Xr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ei=e||ri,this.ti=i||ri;var s=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*Q(this.Se.session_idle_timeout_seconds||1800,60,36e3,ds.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ri(),this.ii="ph_"+s+"_window_id",this.ni="ph_"+s+"_primary_window_exists",this.si()){var n=_i.F(this.ii),o=_i.F(this.ni);n&&!o?this.Kr=n:_i.A(this.ii),_i.q(this.ni,!0)}if(null!=(r=this.Se.bootstrap)&&r.sessionID)try{var a=(t=>{var e=this.Se.bootstrap.sessionID.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)})();this.oi(this.Se.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){ds.error("Invalid sessionID in bootstrap",t)}this.ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return L(this.Zr)&&(this.Zr=[]),this.Zr.push(t),this.Xr&&t(this.Xr,this.Kr),()=>{this.Zr=this.Zr.filter((e=>e!==t))}}si(){return"memory"!==this.Se.persistence&&!this.Ur.Vt&&_i.N()}li(t){t!==this.Kr&&(this.Kr=t,this.si()&&_i.q(this.ii,t))}ui(){return this.Kr?this.Kr:this.si()?_i.F(this.ii):null}hi(t){var e=this.Gr;return!z(e)&&!z(t)&&5e3>Math.abs(t-e)}oi(t,e,i){var r=e!==this._sessionActivityTimestamp,s=!(t!==this.Xr||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.Xr=t,s&&!r||s&&this.hi(e)||(this.Gr=e,this.Ur.register({[ge]:[e,t,i]}))}di(){var t,e=null==(t=this.Se)?void 0:t.persistence_save_debounce_ms;return G(e)&&e>0}ci(){this.di()?this.Ur.refreshKey(ge):(this.Ur.flush(),this.Ur.load())}vi(){var t;if(!z(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Gr){this.ci();var[,e,i]=this.fi();e===this.Xr&&i===this._sessionStartTimestamp&&(this.Gr=this._sessionActivityTimestamp,this.Ur.register({[ge]:[this._sessionActivityTimestamp,null!==(t=this.Xr)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Ur.flush())}}pi(){var[t]=this.fi(),e=G(t)?t:0,i=G(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}gi(t){return this.ci(),this.Yr(t,this.pi())}fi(){var t=this.Ur.props[ge];return C(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Gr=null,clearTimeout(this.mi),this.mi=void 0,this.oi(null,null,null)}destroy(){this.Jr=!0,this.vi(),clearTimeout(this.mi),this.mi=void 0,this.Qr&&t&&(t.removeEventListener(Be,this.Qr,{capture:!1}),this.Qr=void 0),this.Zr=[]}ai(){this.Qr=()=>{this.vi(),this.si()&&_i.A(this.ni)},Xe(t,Be,this.Qr,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Se.cookieless_mode===Ce)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=e||(new Date).getTime(),[,r,s]=this.fi(),n=this.pi(),o=this.ui(),a=G(s)&&Math.abs(i-s)>864e5,u=!1,l=!1,h=!r,d=r,v=!h&&!t&&this.Yr(i,n);v&&((v=this.gi(i))||ds.info("cross-tab refresh kept the session alive",{sessionId:r}),[,r,s]=this.fi()),h||v||a?(r=this.ei(),o=this.ti(),ds.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:h,activityTimeout:v,sessionPastMaximumLength:a}}),s=i,u=!0):(o||(o=this.ti(),u=!0),(l=r!==d)&&(ds.info("adopted cross-tab session id",{sessionId:r,windowId:o}),u=!0));var c=G(n)&&t&&!a?n:i,_=G(s)?s:(new Date).getTime();this.li(o),this.oi(r,c,_),t||this.ri();var p={noSessionId:h,activityTimeout:v,sessionPastMaximumLength:a,crossTabAdoption:l};return u&&this.Zr.forEach((t=>t(r,o,p))),{sessionId:r,windowId:o,sessionStartTimestamp:_,changeReason:u?p:void 0,lastActivityTimestamp:n}}ri(){this.Jr||(clearTimeout(this.mi),this.mi=setTimeout((()=>{if(!this.Jr)if(this.gi((new Date).getTime())){var t=this.Xr;this.resetSessionId(),this.Wr.emit("forcedIdleReset",{idleSessionId:t})}else this.ri()}),1.1*this.sessionTimeoutMs))}}function cs(t,e,i){return Xr({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var _s="custom",ps="i.posthog.com",fs=/^\/static\//;class gs{constructor(t){this.yi={},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("."+ps,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.yi[this.apiHost]||(this.yi[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":_s),this.yi[this.apiHost]}bi(t){if(fs.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.uiHost+e;if("flags"===t)return this.flagsApiHost+e;if("assets"===t){var i=this.bi(e);if(i)return""+i+e}if(this.region===_s)return this.apiHost+e;var r=ps+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var ms=ue("[Surveys]"),ws={ignoreConditions:!1,ignoreDelay:!1,displayType:sr.Popover},bs=ue("[PostHog ExternalIntegrations]"),ys={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class xs{constructor(t){this._instance=t}Mt(t,e){var i;null==(i=h.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return bs.error("failed to load script",t);e()}))}startIfEnabledOrStop(){var t=this,e=function(e){var i,s,n;!r||null!=(i=h.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.Mt(ys[e],(()=>{var i;null==(i=h.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)})),!r&&null!=(s=h.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=h.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[i,r]of Object.entries(null!==(s=this._instance.config.integrations)&&void 0!==s?s:{})){var s;e(i)}}}var Es,$s={},Ss=0,Ts=()=>{},Rs='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Ps="Surveys module not available",ks="sanitize_properties is deprecated. Use before_send instead",Os="Invalid value for property_denylist config: ",Is="posthog",Ms=!Wr&&-1===(null==l?void 0:l.indexOf("MSIE"))&&-1===(null==l?void 0:l.indexOf("Mozilla")),As=e=>{var i;return p({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Ke(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ts,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:s&&B(null==s?void 0:s.search)&&-1!==s.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,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==t||null==(i=t.location)?void 0:i.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,surveys_request_timeout_ms:1e4,on_request_error(t){ae.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:Ne,before_send:void 0,request_queue_config:{flush_interval_ms:rs},error_tracking:{},_onCapture:Ts},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:fi,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},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)}))(e))},Cs=[["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"]],Us=t=>{var e={};for(var[i,r]of Cs)L(t[i])||(e[r]=t[i]);var s=We({},e,t),n=t.__preview_external_dependency_versioned_paths;return L(n)||(L(t.strict_script_versioning)&&(s.strict_script_versioning=!!n),B(n)&&L(t.asset_host)&&(s.asset_host=n)),C(t.property_blacklist)&&(L(t.property_denylist)?s.property_denylist=t.property_blacklist:C(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:ae.error(Os+t.property_denylist)),s};class Ds{constructor(){this.__forceAllowLocalhost=!1}get wi(){return this.__forceAllowLocalhost}set wi(t){ae.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Ns{xi(t,e){if(t){var i=this.ki.indexOf(t);-1!==i&&this.ki.splice(i,1)}return this.ki.push(e),null==e.initialize||e.initialize(),e}Si(){return this.config.cookieless_mode===Ce||this.config.cookieless_mode===Ae&&this.consent.isRejected()}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 t;this.webPerformance=new Ds,this.Ci=!1,this.version=v.LIB_VERSION,this.Ii=new hs,this.ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=As(),this.SentryIntegration=yi,this.sentryIntegration=t=>function(t,e){var i=bi(t,e);return{name:wi,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ti=!1,this.Ei=null,this.Mi=null,this.Pi=null,this.scrollManager=new as(this),this.pageViewManager=new xi(this),this.rateLimiter=new lr(this),this.requestRouter=new gs(this),this.consent=new pi(this),this.externalIntegrations=new xs(this);var e=null!==(t=Ns.__defaultExtensionClasses)&&void 0!==t?t:{};this.featureFlags=e.featureFlags&&new e.featureFlags(this),this.toolbar=e.toolbar&&new e.toolbar(this),this.surveys=e.surveys&&new e.surveys(this),this.conversations=e.conversations&&new e.conversations(this),this.logs=e.logs&&new e.logs(this),this.experiments=e.experiments&&new e.experiments(this),this.exceptions=e.exceptions&&new e.exceptions(this),this.people={set:(t,e,i)=>{var r=B(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=B(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",(t=>ae.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==Is){var r,s=null!==(r=$s[i])&&void 0!==r?r:new Ns;return s._init(t,e,i),$s[i]=s,$s[Is][i]=s,s}return this._init(t,e,i)}_init(e,i,r){var s,n;void 0===i&&(i={});var o=B(e)?e.trim():"";if(!o)return ae.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 console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},i.debug=this.Ri(i.debug),this.Oi=i,this.Li=[],i.person_profiles?this.Mi=i.person_profiles:i.process_person&&(this.Mi=i.process_person);var a=As(i.defaults),u=Us(i),l=We({},a,u,{name:r,token:o});D(a.rageclick)&&D(u.rageclick)&&(l.rageclick=We({},a.rageclick,u.rageclick)),D(a.session_recording)&&D(u.session_recording)&&(l.session_recording=We({},a.session_recording,u.session_recording)),this.set_config(l),this.config.on_xhr_error&&ae.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:cr.GZipJS;var h=this.Fi();this.persistence=new Yi(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Yi(p({},this.config,{persistence:"sessionStorage"}),h,!1);var d=p({},this.persistence.props),c=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Ai=new ss((t=>this.$i(t)),this.config.request_queue_config),this.Di=new os(this),this.__request_queue=[];var _=this.Si();if(_||(this.sessionManager=new vs(this),this.sessionPropsManager=new ls(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ae.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Ni(_)}),0)):(ae.info("Initializing extensions synchronously"),this.Ni(_)),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&ae.info("Starting in debug mode",{this:this,config:i,thisC:p({},this.config),p:d,s:c}),!this.config.identity_distinct_id||null!=(s=i.bootstrap)&&s.distinctID||(i.bootstrap=p({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(n=i.bootstrap)?void 0:n.distinctID)){var f=i.bootstrap.distinctID,g=this.get_distinct_id(),m=this.persistence.get_property(Ee);if(i.bootstrap.isIdentifiedID&&null!=g&&g!==f&&m===Ue)this.identify(f);else if(i.bootstrap.isIdentifiedID&&null!=g&&g!==f&&m===De)ae.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 w=this.config.get_device_id(ri()),b=i.bootstrap.isIdentifiedID?w:f;this.persistence.set_property(Ee,i.bootstrap.isIdentifiedID?De:Ue),this.register({distinct_id:f,$device_id:b})}}if(_)this.register_once({distinct_id:Oe,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(ri());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(Ee,Ue)}return Xe(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?function(t,e){var i=t.config.segment;if(!i)return e();!function(t,e){var i=t.config.segment;if(!i)return e();var r=i=>{var r=()=>i.anonymousId()||ri();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(Ee,De)),e()},s=i.user();"then"in s&&U(s.then)?s.then(r):r(s)}(t,(()=>{i.register((t=>{Promise&&Promise.resolve||mi.warn("This browser does not have Promise support, and can not use the segment integration");var e=(e,i)=>{if(!i)return e;e.event.userId||e.event.anonymousId===t.get_distinct_id()||(mi.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(mi.info("UserId set, identifying with PostHog"),t.identify(e.event.userId));var r=t.calculateEventProperties(i,e.event.properties);return e.event.properties=Object.assign({},r,e.event.properties),e};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:t=>e(t,t.event.event),page:t=>e(t,Fe),identify:t=>e(t,qe),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.qi())):this.qi(),U(this.config._onCapture)&&this.config._onCapture!==Ts&&(ae.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&ae.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}Ni(t){var e,i,r,s,n,o,a,u=performance.now(),l=p({},Ns.__defaultExtensionClasses,this.config.__extensionClasses),h=[];l.featureFlags&&this.ki.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new l.featureFlags(this)),l.exceptions&&this.ki.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new l.exceptions(this)),l.historyAutocapture&&this.ki.push(this.historyAutocapture=new l.historyAutocapture(this)),l.tracingHeaders&&this.ki.push(this.tracingHeaders=new l.tracingHeaders(this)),l.siteApps&&this.ki.push(this.siteApps=new l.siteApps(this)),l.sessionRecording&&!t&&this.ki.push(this.sessionRecording=new l.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),l.autocapture&&this.ki.push(this.autocapture=new l.autocapture(this)),l.surveys&&this.ki.push(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new l.surveys(this)),l.logs&&this.ki.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new l.logs(this)),l.conversations&&this.ki.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new l.conversations(this)),l.productTours&&this.ki.push(this.productTours=new l.productTours(this)),l.heatmaps&&this.ki.push(this.heatmaps=new l.heatmaps(this)),l.webVitalsAutocapture&&this.ki.push(this.webVitalsAutocapture=new l.webVitalsAutocapture(this)),l.exceptionObserver&&this.ki.push(this.exceptionObserver=new l.exceptionObserver(this)),l.deadClicksAutocapture&&this.ki.push(this.deadClicksAutocapture=new l.deadClicksAutocapture(this,gi)),l.toolbar&&this.ki.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new l.toolbar(this)),l.experiments&&this.ki.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new l.experiments(this)),this.ki.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.Bi){var t=this.Bi;this.Bi=void 0,this.pr(t)}})),this.ji(h,u)}ji(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.ji(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){ae.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Ie]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Me]:r}),this.config.__preview_deferred_init_extensions&&ae.info("PostHog extensions initialized ("+r+"ms)")}pr(t){var e;if(!r||!r.body)return ae.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.pr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Bi=t),this.Hi=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=k(t.supportedCompression,cr.GZipJS)?cr.GZipJS:k(t.supportedCompression,cr.Base64)?cr.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Mi?this.Mi:Ne}),this.ki.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}qi(){try{this.config.loaded(this)}catch(t){ae.critical("`loaded` function failed",t)}if(this.Ui(),this.config.internal_or_test_user_hostname&&null!=s&&s.hostname){var t=s.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.Si())&&this.zi()}),1),this.Vi=new dr(this),this.Vi.load()}Ui(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.Ai)||t.enable())}_dom_loaded(){this.is_capturing()&&Ge(this.__request_queue,(t=>this.$i(t))),this.__request_queue=[],this.Ui()}_handle_unload(){var t,e,i,r;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),this.config.request_batching?(this.Wi()&&this.capture(ze),null==(e=this.logs)||e.flushLogs("sendBeacon"),null==(i=this.Ai)||i.unload(),null==(r=this.Di)||r.unload()):this.Wi()&&this.capture(ze,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?Ms?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)?t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:429})):(t.transport=t.transport||this.config.api_transport,t.headers=p({},this.config.request_headers,t.headers),t.compression="best-available"===t.compression?this.compression:t.compression,(L(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(t=>{var e,i,r,s=p({},t);s.timeout=s.timeout||6e4,s.url=es(s.url,s.compression);var n=null!==(e=s.transport)&&void 0!==e?e:"fetch",o=is.filter((t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport))),a=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(t[i].transport===n)return t[i]}(o))?void 0:r.method)&&void 0!==i?i:o[0].method;if(!a)throw new Error("No available transport method");"sendBeacon"!==n&&s.data&&s.compression===cr.GZipJS&&u&&!Vr?ts(s).then((t=>{a(t)})).catch((e=>{if(x(e))return Vr=!0,void a(p({},s,{compression:void 0,url:es(t.url,void 0)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return x(t)||e===b})(e)&&(Vr=!0),a(s)})):a(s)})(p({},t,{callback:e=>{var i,r;this.rateLimiter.checkForLimiting(e),400>e.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,e),null==t.callback||t.callback(e)}}))):t.fireCallbackOnDrop&&(null==t.callback||t.callback({statusCode:0}))}$i(t){this.Di?this.Di.retriableRequest(t):this._send_request(t)}_execute_array(t){Ss++;try{var e,i=[],r=[],s=[];Ge(t,(t=>{if(t)if(C(e=t[0]))s.push(t);else if(U(t))try{t.call(this)}catch(e){ae.error("Error executing queued PostHog call",t,e)}else C(t)&&"alias"===e?i.push(t):C(t)&&-1!==e.indexOf("capture")&&U(this[e])?s.push(t):r.push(t)}));var n=function(t,e){Ge(t,(function(t){try{if(C(t[0])){var i=e;He(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){ae.error("Error executing queued PostHog call",t,e)}}))};n(i,this),n(r,this),n(s,this)}finally{Ss--}}push(t){if(Ss>0&&C(t)&&B(t[0])){var e=Ns.prototype[t[0]];U(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,e,i){var r,s,n,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ai){if(this.is_capturing())if(!L(t)&&B(t)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var l=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==l||!l.isRateLimited){null!=e&&e.$current_url&&!B(null==e?void 0:e.$current_url)&&(ae.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!=i&&i.Gi||ae.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&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 h=new Date,d=(null==i?void 0:i.timestamp)||h,v=se(null==i?void 0:i.uuid,ri),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Fe&&this.config.__preview_capture_bot_pageviews&&u&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),l&&(c.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var _=null==i?void 0:i.$unset;_&&(c.$unset=_);var f,g,m,w=this.Zi(null==i?void 0:i.$set_once,t!==je,t===qe);if(w&&(c.$set_once=w),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,n=c,o=t=>B(t)?t.slice(0,s):t,a=new Set,c=function t(e,i){return e!==Object(e)?o?o(e):e:a.has(e)?void 0:(a.add(e),C(e)?(r=[],Ge(e,(e=>{r.push(t(e))}))):(r={},He(e,((e,i)=>{a.has(e)||(r[i]=t(e,i))}))),r);var r}(n)),c.timestamp=d,L(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=h),t===ir.DISMISSED||t===ir.SENT){var b=null==e?void 0:e[rr.SURVEY_ID],y=null==e?void 0:e[rr.SURVEY_ITERATION];(t=>{try{var e=(t=>((t,e)=>{var i=""+t+e.id;return e.current_iteration&&e.current_iteration>0&&(i=""+t+e.id+"_"+e.current_iteration),i})("seenSurvey_",t))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){ms.error("Failed to persist survey seen state",t)}})({id:b,current_iteration:y}),c.$set=p({},c.$set,{[(f={id:b,current_iteration:y},g=t===ir.SENT?"responded":"dismissed",m="$survey_"+g+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(m="$survey_"+g+"/"+f.id+"/"+f.current_iteration),m)]:!0})}else t===ir.SHOWN&&(c.$set=p({},c.$set,{[rr.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===or.SHOWN){var x=null==e?void 0:e[ar.TOUR_TYPE];x&&(c.$set=p({},c.$set,{[ar.TOUR_LAST_SEEN_DATE+"/"+x]:(new Date).toISOString()}))}var E=p({},c.properties.$set,c.$set);if(N(E)||this.setPersonPropertiesForFlags(E),!q(this.config.before_send)){var S=this.it(c);if(!S)return;(c=S).uuid=se(c.uuid,ri)}this.Ii.emit("eventCaptured",c);var T={method:"POST",url:null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.$i(T):this.Ai.enqueue(T),c}ae.critical("This capture call is ignored due to client rate limiting.")}}else ae.error("No event name provided to posthog.capture")}else ae.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(e=>t(e.event,e)))}calculateEventProperties(e,i,n,o,a){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return i;var u=a?void 0:this.persistence.remove_event_timer(e),h=p({},i);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Si()&&(h.$cookieless_mode=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=d.distinct_id,(!B(h.distinct_id)&&!j(h.distinct_id)||F(h.distinct_id))&&ae.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var c,_=function(e,i,r,n){var o,a,u,h;if(void 0===n&&(n=!1),!l)return{};var d,c,_,p,f,g,m,w,b,y=e?[...Ii,...i||[]]:[],[x,E]=function(t){for(var e=0;ee.length>e;e++){var[i,r]=ee[e],s=i.exec(t),n=s&&(U(r)?r(s,t):r);if(n)return n}return["",""]}(l),S=null!=(d="undefined"!=typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},T={detectGoogleSearchApp:r},R=We(Ve({$os:x,$os_version:E,$browser:Qt(l,navigator.vendor,S,T),$device:ie(l),$device_type:(_=l,p={userAgentDataPlatform:null==(o=navigator)||null==(o=o.userAgentData)?void 0:o.platform,maxTouchPoints:null==(a=navigator)?void 0:a.maxTouchPoints,screenWidth:null==t||null==(u=t.screen)?void 0:u.width,screenHeight:null==t||null==(h=t.screen)?void 0:h.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio},b=ie(_),b===st||b===rt||"Kobo"===b||"Kindle Fire"===b||b===Ct?it:b===Et||b===St||b===$t||b===It?"Console":b===ot?"Wearable":b?Z:"Android"===(null==p?void 0:p.userAgentDataPlatform)&&(null!==(f=null==p?void 0:p.maxTouchPoints)&&void 0!==f?f:0)>0?600>Math.min(null!==(g=null==p?void 0:p.screenWidth)&&void 0!==g?g:0,null!==(m=null==p?void 0:p.screenHeight)&&void 0!==m?m:0)/(null!==(w=null==p?void 0:p.devicePixelRatio)&&void 0!==w?w:1)?Z:it:"Desktop"),$timezone:qi(),$timezone_offset:ji()}),{$current_url:ki(n?ne(null==s?void 0:s.href):null==s?void 0:s.href,y,Ai),$host:null==s?void 0:s.host,$pathname:null==s?void 0:s.pathname,$raw_user_agent:l.length>1e3?l.substring(0,997)+"...":l,$browser_version:te(l,navigator.vendor,S,T),$browser_language:Ni(),$browser_language_prefix:(c=Ni(),"string"==typeof c?c.split("-")[0]:void 0),$screen_height:null==t?void 0:t.screen.height,$screen_width:null==t?void 0:t.screen.width,$viewport_height:null==t?void 0:t.innerHeight,$viewport_width:null==t?void 0:t.innerWidth,$lib:v.LIB_NAME,$lib_version:v.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return v.SDK_DIST_CHANNEL&&(R.$sdk_dist_channel=v.SDK_DIST_CHANNEL),R}(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{sessionId:f,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(a,n.getTime());h.$session_id=f,h.$window_id=g}this.sessionPropsManager&&We(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&We(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.Di)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===_s&&(h.$lib_custom_api_host=this.config.api_host),c=e!==Fe||a?e!==ze||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,o),h=We(h,c),e===Fe&&r&&(h.title=r.title),!L(u)){var w=n.getTime()-u;h.$duration=parseFloat((w/1e3).toFixed(3))}l&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser"),(h=We({},_,this.persistence.properties(),this.sessionPersistence.properties(),h)).$is_identified=this._isIdentified(),C(this.config.property_denylist)?He(this.config.property_denylist,(function(t){delete h[t]})):ae.error(Os+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(ae.error(ks),h=b(h,e));var y=this.Qi();return h.$process_person_profile=y,y&&!a&&this.Ji("_calculate_event_properties"),h}Zi(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Qi())return t;if(this.Ci&&!i)return t;var s=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=We({},s,n||{},t||{}),a=this.config.sanitize_properties;return a&&(ae.error(ks),o=a(o,"$set_once")),e&&(this.Ci=!0),N(o)?void 0:o}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;null==(e=this.sessionPersistence)||e.register(t)}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t)}Yi(t,e){this.register({[t]:e})}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)}isFeatureEnabled(t,e){var i;return null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(t,e)}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.Ii.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:Ps}),()=>{})}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:Ps})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Ps})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=ws),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:Ps}}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:Ps})}Ki(t){return!t||F(t)?(ae.critical("Unique user id has not been set in posthog.identify"),!1):t===Oe?(ae.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())||(ae.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 ae.uninitializedWarning("posthog.identify");if(j(t)&&(t=t.toString(),ae.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Ki(t)&&this.Ji("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:t}),this.get_property(ve)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),t!==r&&t!==this.get_property(ce)&&(this.unregister(ce),this.register({distinct_id:t}));var s,n=(this.persistence.get_property(Ee)||Ue)===Ue;t!==r&&n?(this.persistence.set_property(Ee,De),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.capture(qe,{distinct_id:t,$anon_distinct_id:r},{$set:e||{},$set_once:i||{}}),this.Pi=cs(t,e,i),null==(s=this.featureFlags)||s.setAnonymousDistinctId(r)):(e||i)&&this.setPersonProperties(e,i),t!==r&&(this.reloadFeatureFlags(),this.unregister(ye))}}setPersonProperties(t,e){if((t||e)&&this.Ji("posthog.setPersonProperties")){var i=cs(this.get_distinct_id(),t,e);this.Pi!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.Pi=i):ae.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(C(t)?t:[t]).filter((t=>B(t)&&t.length>0));0!==i.length&&this.Ji("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Pi=null)}group(t,e,i){if(t&&e){var r=this.getGroups(),s=r[t]!==e;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},r,{[t]:e})}),s||i){var n={$group_type:t,$group_key:e};i&&(n.$group_set=i),this.capture(je,n)}i&&this.setGroupPropertiesForFlags({[t]:i}),s&&!i&&this.reloadFeatureFlags()}else ae.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.Ji("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,i,r,s,n,o,a,u,l;if(ae.info("reset"),!this.__loaded)return ae.uninitializedWarning("posthog.reset");var h,d=this.get_property(ve),v=this.get_property(fe);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(i=this.sessionPersistence)||i.clear(),L(v)||null==(h=this.persistence)||h.register({[fe]:v}),null==(r=this.surveys)||r.reset(),null==(s=this.Vi)||s.stop(),null==(n=this.featureFlags)||n.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(u=this.persistence)||u.set_property(Ee,Ue),null==(l=this.sessionManager)||l.resetSessionId(),this.Pi=null,this.config.cookieless_mode===Ce)this.register_once({distinct_id:Oe,$device_id:null},"");else{var c=this.config.get_device_id(ri());this.register_once({distinct_id:c,$device_id:t?c:d},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,e){var i;this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i.Xi()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.en()}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{sessionId:e,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e);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(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(t,e){return t===this.get_property(de)?(ae.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ji("posthog.alias")?(L(e)&&(e=this.get_distinct_id()),t!==e?(this.Yi(ce,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(ae.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(D(t)){var i,r,s,n,o,a,u,l,h,d,c;We(this.config,Us(t));var _=this.Fi();null==(i=this.persistence)||i.update_config(this.config,e,_),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Yi(p({},this.config,{persistence:"sessionStorage"}),_,!1);var f=this.Ri(this.config.debug);H(f)&&(this.config.debug=f),H(this.config.debug)&&(this.config.debug?(v.DEBUG=!0,li.N()&&li.q("ph_debug",!0),ae.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(v.DEBUG=!1,li.N()&&li.A("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),null==(l=this.exceptionObserver)||l.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(d=this.surveys)||d.loadIfEnabled(),this.tn(),null==(c=this.externalIntegrations)||c.startIfEnabledOrStop()}}_overrideSDKInfo(t,e){v.LIB_NAME=t,v.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){if(this.exceptions){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(p({},r,e))}}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 t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:Ns.rn}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:Is;return e!==Is&&(e=Is+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Ee))===De||(null==(e=this.sessionPersistence)?void 0:e.get_property(Ee))===De}Qi(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===Ne&&!this._isIdentified()&&N(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[ce])&&(null==(e=this.persistence)||null==(e=e.props)||!e[ke]))}Wi(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Qi()||this.Ji("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Ji("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Ji(t){return"never"===this.config.person_profiles?(ae.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Yi(ke,!0),!0)}Fi(){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&&this.config.cookieless_mode!==Ae)}tn(){var t,e,i,r,s=this.Fi();return(null==(t=this.persistence)?void 0:t.Vt)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.Vt)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Ce){if(this.Si()){var i,r,s,n,o;this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new vs(this),this.pageViewManager=new xi(this),this.persistence&&(this.sessionPropsManager=new ls(this,this.sessionManager,this.persistence));var a,u=null!==(s=null==(n=this.config.__extensionClasses)?void 0:n.sessionRecording)&&void 0!==s?s:null==(o=Ns.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.xi(this.sessionRecording,new u(this)),this.Hi&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Hi)))}var l,h;this.consent.optInOut(!0),this.tn(),this.Ui(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ae&&(null==(l=this.surveys)||l.loadIfEnabled()),(L(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(h=null==t?void 0:t.captureEventName)&&void 0!==h?h:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.zi()}else ae.warn(Rs)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==Ce?(this.config.cookieless_mode===Ae&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.tn(),this.config.cookieless_mode===Ae&&(this.register({distinct_id:Oe,$device_id:null}),null==(t=this.sessionRecording)||t.stopRecording(),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.zi(),this.Ui())):ae.warn(Rs)}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.config.cookieless_mode===Ce||(this.config.cookieless_mode===Ae?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.tn()}_is_bot(){return i?function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&P(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some((t=>P(null==t?void 0:t.brand,e))))return!0}catch(t){}return!!t.webdriver}(i,this.config.custom_blocked_useragents):void 0}zi(){r&&("visible"===r.visibilityState?this.Ti||(this.Ti=!0,this.capture(Fe,{title:r.title},{send_instantly:!0}),this.Ei&&(r.removeEventListener(Le,this.Ei),this.Ei=null)):this.Ei||(this.Ei=this.zi.bind(this),Xe(r,Le,this.Ei)))}debug(e){!1===e?(null==t||t.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==t||t.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}))}mr(){var t,e,i,r,s,n,o=this.Oi||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(ae.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):(i="advanced_disable_decide",!1,r=ae,s=(e="advanced_disable_flags")in(t=o)&&!q(t[e]),n=i in t&&!q(t[i]),s?t[e]:!!n&&(r&&r.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i]))}it(t){var e;if(q(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(V),r=C(this.config.before_send)?this.config.before_send:[this.config.before_send],s=t;for(var n of r){if(s=n(s),q(s)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Y(t.event)?ae.warn(o+". This can cause unexpected behavior."):ae.info(o),null}s.properties&&!N(s.properties)||ae.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of i)if(s.properties&&q(s.properties[a]))return ae.warn("Event '"+t.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var t;return null==(t=this.pageViewManager.Ot)?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)})}Ri(t){var e=H(t)&&!t,i=li.N()&&"true"===li.P("ph_debug");return!e&&(!!i||t)}}Ns.__defaultExtensionClasses={},Ns.rn={trace:Es=()=>{},debug:Es,info:Es,warn:Es,error:Es,fatal:Es},function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=Ye(t.prototype[e[i]])}(Ns,["identify"]);var Ls=function(){v.SDK_DIST_CHANNEL="npm";var e=$s[Is]=new Ns;return function(){function e(){e.done||(e.done=!0,Ms=!1,He($s,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():Xe(r,"DOMContentLoaded",e,{capture:!1}):t&&ae.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}();export{cr as Compression,nr as DEFAULT_PRODUCT_TOUR_APPEARANCE,sr as DisplaySurveyType,Ns as PostHog,or as ProductTourEventName,ar as ProductTourEventProperties,ir as SurveyEventName,rr as SurveyEventProperties,Vi as SurveyEventType,Ki as SurveyPosition,tr as SurveyQuestionBranchingType,Zi as SurveyQuestionType,er as SurveySchedule,Xi as SurveyTabPosition,Qi as SurveyType,Ji as SurveyWidgetType,Ls as default,Ls as posthog,vr as severityLevels};
|
|
2
2
|
//# sourceMappingURL=module.slim.js.map
|