posthog-js 1.391.6 → 1.391.7
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.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/default-extensions.js +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/lazy-recorder.js +1 -1
- package/dist/lazy-recorder.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/dist/posthog-recorder.js.map +1 -1
- package/dist/recorder-v2.js.map +1 -1
- package/dist/recorder.js.map +1 -1
- package/lib/package.json +1 -1
- package/lib/src/extensions/replay/external/config.js +30 -5
- package/lib/src/extensions/replay/external/config.js.map +1 -1
- package/package.json +3 -3
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.391.6",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,U=Array.isArray||function(t){return"[object Array]"===A.call(t)},C=t=>"function"==typeof t,D=t=>t===Object(t)&&!U(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,j=t=>L(t)||z(t),q=t=>"[object Number]"==A.call(t)&&t==t,G=t=>q(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),q(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(),Ut=Mt+" "+it.toLowerCase(),Ct="Konqueror",Dt="Oculus Browser",Nt="Vivaldi",Lt="Yandex",Bt="Whale",Ft="DuckDuckGo",zt="Pale Moon",jt="Waterfox",qt="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?qt: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(),Ct.toLowerCase())?Ct:k(t,qt+"/")?qt:((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,jt+"/")?jt: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)],[Ct]:[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)],[qt]:[new RegExp(qt+"\\/"+Ht)],[Ft]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Ht)],[zt]:[new RegExp("PaleMoon\\/"+Ht)],[jt]:[new RegExp(jt+"\\/"+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)?Ut:""},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}var ne=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)=>ne(e+" "+t,i)};return s},oe=ne("[PostHog.js]"),ae=oe.createLogger,ue=ae("[ExternalScriptsLoader]"),le=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return ue.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)}le(t,r,i)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");le(t,o,i)}},h.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);le(t,r,i)};var he="$people_distinct_id",de="$device_id",ve="__alias",ce="__timers",_e="$dead_clicks_enabled_server_side",pe="$session_recording_remote_config",fe="$sesid",ge="$session_is_sampled",me="$enabled_feature_flags",we="$surveys_loaded_at",be="$flag_call_reported",ye="$feature_flag_evaluated_at",xe="$user_state",Ee="$client_session_props",$e="$capture_rate_limit",Se="$initial_campaign_params",Te="$initial_referrer_info",Re="$initial_person_info",Pe="$epp",ke="$posthog_cookieless",Oe="$sdk_debug_extensions_init_method",Ie="$sdk_debug_extensions_init_time_ms",Me="on_reject",Ae="always",Ue="anonymous",Ce="identified",De="identified_only",Ne="visibilitychange",Le="beforeunload",Be="$pageview",Fe="$pageleave",ze="$identify",je="$groupidentify";function qe(t,e){U(t)&&t.forEach(e)}function Ge(t,e){if(!j(t))if(U(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 He=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},We=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){oe.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),oe.critical(t)}}},Ye=function(t){var e={};return Ge(t,(function(t,i){(B(t)&&t.length>0||q(t))&&(e[i]=t)})),e};var Ve=["herokuapp.com","vercel.app","netlify.app"];function Je(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 Ve)if(i===r)return!1;return!0}function Ke(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 q(t)&&isFinite(t)&&Math.floor(t)===t});class Xe{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 Xe(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 Xe(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 Qe{constructor(){this.S=0,this.C=0,this.I=new ei}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 Xe.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 Ze,ti=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&&(ti=t=>crypto.getRandomValues(t));class ei{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(ti(this.R),this.O=0),this.R[this.O++]}}var ii=()=>ri().toString(),ri=()=>(Ze||(Ze=new Qe)).generate(),si="",ni=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var oi={N:()=>!!r,D(t){oe.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(oi.P(t))||{}}catch(t){}return e},A(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),si)return si;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_"+ii();!si&&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",si=o)}return si}(t);if(!i){var s=(t=>{var e=t.match(ni);return e?e[0]:""})(t);s!==i&&oe.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&&oe.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},q(t,e){if(null!=r&&r.cookie)try{oi.A(t,"",-1,e)}catch(t){return}}},ai=null,ui={N(){if(!z(ai))return ai;var e=!0;if(L(t))e=!1;else try{var i="__mplssupport__";ui.A(i,"xyz"),'"xyz"'!==ui.P(i)&&(e=!1),ui.q(i)}catch(t){e=!1}return e||oe.error("localStorage unsupported; falling back to cookie store"),ai=e,e},D(t){oe.error("localStorage error: "+t)},P(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){ui.D(t)}return null},F(t){try{return JSON.parse(ui.P(t))||{}}catch(t){}return null},A(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){ui.D(t)}return!1},q(e){try{null==t||t.localStorage.removeItem(e)}catch(t){ui.D(t)}}},li=[de,"distinct_id",fe,ge,Pe,Re,xe],hi={},di={N:()=>!0,D(t){oe.error("memoryStorage error: "+t)},P:t=>hi[t]||null,F:t=>hi[t]||null,A:(t,e)=>(hi[t]=e,!0),q(t){delete hi[t]}},vi=null,ci={N(){if(!z(vi))return vi;if(vi=!0,L(t))vi=!1;else try{var e="__support__";ci.A(e,"xyz"),'"xyz"'!==ci.P(e)&&(vi=!1),ci.q(e)}catch(t){vi=!1}return vi},D(t){oe.error("sessionStorage error: ",t)},P(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){ci.D(t)}return null},F(t){try{return JSON.parse(ci.P(t))||null}catch(t){}return null},A(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){ci.D(t)}return!1},q(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){ci.D(t)}}};class _i{constructor(t){this._instance=t}get Dt(){return this._instance.config}get consent(){return this.Lr()?0:this.Ar}isOptedOut(){return this.Dt.cookieless_mode===Ae||this.isRejected()||-1===this.consent&&this.Dt.cookieless_mode===Me}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Dt.opt_out_capturing_by_default}optInOut(t){this.Fr.A(this.Nr,t?1:0,this.Dt.cookie_expiration,this.Dt.cross_subdomain_cookie,this.Dt.secure_cookie)}reset(){this.Fr.q(this.Nr,this.Dt.cross_subdomain_cookie)}get Nr(){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 Ar(){var t=this.Fr.P(this.Nr);return K(t)?1:k(X,t)?0:-1}get Fr(){var t=this.Dt.opt_out_capturing_persistence_type,e="localStorage"===t?ui:oi;if(!this.Dr||this.Dr!==e){this.Dr=e;var i="localStorage"===t?oi:ui;i.P(this.Nr)&&(this.Dr.P(this.Nr)||this.optInOut(K(i.P(this.Nr))),i.q(this.Nr,this.Dt.cross_subdomain_cookie))}return this.Dr}Lr(){return!!this.Dt.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,h.doNotTrack].some((t=>K(t)))}}var pi=["next","previous","prev",">","<","+","-","−","–"];ae("[Dead Clicks]");var fi=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(_e)),r=t.instance.config.capture_dead_clicks;return H(r)?r:!!D(r)||i},gi=ae("[SegmentIntegration]");var mi="posthog-js";function wi(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 bi{constructor(t,e,i,r,s,n){this.name=mi,this.setupOnce=function(o){o(wi(t,{organization:e,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class yi{constructor(t){this.Br=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(oe.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Hr=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Ur()}Ur(){var t;this.zr=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Br)}destroy(){var t;null==(t=this.zr)||t.call(this),this.zr=void 0}doPageView(e,i){var r,s=this.Vr(e,i);return this.Hr={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.Vr(t,null==(e=this.Hr)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Hr)?void 0:t.pageViewId}}Vr(t,e){var i=this.Hr;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,oe):1,v=n>1?Q(a/n,0,1,oe):1,c=u>1?Q(l/u,0,1,oe):1,_=u>1?Q(h/u,0,1,oe):1;r=He(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 xi=["flags","surveys"],Ei={[he]:{exposure:"hidden"},[ve]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[ce]:{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"},[_e]:{exposure:"event"},$product_tours_enabled_server_side:{exposure:"hidden"},$web_vitals_allowed_metrics:{exposure:"event"},[pe]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[fe]:{exposure:"hidden"},[ge]:{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"},[me]:{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"},[we]:{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"},[be]:{exposure:"hidden"},$flag_call_reported_session_id:{exposure:"hidden"},$feature_flag_errors:{exposure:"hidden"},[ye]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[xe]:{exposure:"hidden"},[Ee]:{exposure:"hidden"},[$e]:{exposure:"hidden"},[Se]:{exposure:"hidden"},[Te]:{exposure:"hidden"},[Re]:{exposure:"hidden"},[Pe]:{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"},[Oe]:{exposure:"event"},[Ie]:{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"}},$i=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Si=t=>{var e=Ei[t];if(e)return e;for(var[i,r]of $i)if(0===t.indexOf(i))return r},Ti=t=>{var e=null==r?void 0:r.createElement("a");return L(e)?null:(e.href=t,e)},Ri=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(!U(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){oe.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Pi=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("=");U(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},ki="https?://(.*)",Oi=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ii=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Oi],Mi="<masked>",Ai=["li_fat_id"];function Ui(t,e){var i=Ii.concat(e||[]),r={};return Ge(i,(function(e){var i=Ri(t,e);r[e]=i||null})),r}function Ci(t){var e=function(t){return t?0===t.search(ki+"google.([^/?]*)")?"google":0===t.search(ki+"bing.com")?"bing":0===t.search(ki+"yahoo.com")?"yahoo":0===t.search(ki+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",s={};if(!z(e)){s.$search_engine=e;var n=r?Ri(r.referrer,i):"";n.length&&(s.ph_keyword=n)}return s}function Di(){return navigator.language||navigator.userLanguage}var Ni="$direct";function Li(){return(null==r?void 0:r.referrer)||Ni}function Bi(t,e){var i=t?[...Oi,...e||[]]:[],r=null==s?void 0:s.href.substring(0,1e3);return{r:Li().substring(0,1e3),u:r?Pi(r,i,Mi):void 0}}function Fi(t){var e,{r:i,u:r}=t,s={$referrer:i,$referring_domain:null==i?void 0:i==Ni?Ni:null==(e=Ti(i))?void 0:e.host};if(r){s.$current_url=r;var n=Ti(r);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname;var o=Ui(r);He(s,o)}if(i){var a=Ci(i);He(s,a)}return s}function zi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function ji(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var qi={flags:ye,surveys:we},Gi=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Hi="main";class Wi{constructor(e,i,r){if(void 0===r&&(r=!0),this.Wr={},this.Gr=!1,this.Zr=!1,this.Dt=e,this.Qr=r,this.props={},this.Jr=!1,this.Kr=(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.Fr=this.Yr(e),this.Zr=this.Xr(e),this.load(),e.debug&&oe.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var s=()=>this.flush();Ke(t,"beforeunload",s,{capture:!1}),Ke(t,"pagehide",s,{capture:!1})}}ei(){var t,e=null==(t=this.Dt)?void 0:t.persistence_save_debounce_ms;return q(e)&&e>0?e:0}isDisabled(){return!!this.ti}Yr(e){-1===Gi.indexOf(e.persistence.toLowerCase())&&(oe.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=[...li,...e];return p({},ui,{F(t){try{var e={};try{e=oi.F(t)||{}}catch(t){}var r,s=JSON.parse(ui.P(t)||"{}");if(i){var n={};for(var o in e){var a=e[o];z(a)||""===a||(n[o]=a)}r=He(s,n)}else r=He(e,s);return ui.A(t,r),r}catch(t){}return null},A(t,e,i,s,n,o){var a=ui.A(t,e,void 0,void 0,o);try{var u={};r.forEach((t=>{e[t]&&(u[t]=e[t])})),Object.keys(u).length&&oi.A(t,u,i,s,n,o)}catch(t){ui.D(t)}return a},q(e,i){try{null==t||t.localStorage.removeItem(e),oi.q(e,i)}catch(t){ui.D(t)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,n=e.persistence.toLowerCase();return"localstorage"===n&&ui.N()?(i=ui,s=!0):"localstorage+cookie"===n&&r.N()?(i=r,s=!0):"sessionstorage"===n&&ci.N()?i=ci:"memory"===n?i=di:"cookie"===n?i=oi:r.N()?(i=r,s=!0):i=oi,this.Gr=s,i}ri(t){return this.Kr+"__"+t}Xr(t){return this.Gr&&!!t.split_storage}ii(t){var e=null!=t?t:this.Dt.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var i=this.props[ye];return!i||"number"!=typeof i||Date.now()-i>e}properties(){var t={};return Ge(this.props,((e,i)=>{var r=Si(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,i===me?()=>this.ii():()=>!1))return;r.transformToEventProperties&&He(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.ti){var t=this.Fr.F(this.Kr);t&&(this.props=He({},t)),this.Zr&&this.ni()}}ni(){for(var t of xi){var e=ui.F(this.ri(t));if(e&&!N(e)){var i=this.si(t);i.persisted=!0,this.oi(t)||(i.fingerprint=this.ai(e,t)),this.li(t,e)||He(this.props,e)}}}oi(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Si(e))?void 0:i.storageGroup)===t}))}li(t,e){var i=qi[t];if(!i)return!1;var r=e[i],s=this.props[i];return q(r)&&q(s)&&s>r}refreshKey(t){var e;if(!this.ti){var i=this.Zr?null==(e=Si(t))?void 0:e.storageGroup:void 0,r=i?ui.F(this.ri(i)):this.Fr.F(this.Kr);if(r&&t in r)this.ui(t,r[t]);else{if(i){var s=this.Fr.F(this.Kr);if(s&&t in s)return void this.ui(t,s[t])}this.hi(t)}}}save(){if(!this.ti){var t=this.ei();t>0?L(this.ci)&&(this.ci=setTimeout((()=>{this.ci=void 0,this.di()}),t)):this.di()}}flush(){L(this.ci)||(clearTimeout(this.ci),this.ci=void 0,this.di())}di(){this.ti||(this.Zr?this.vi():this.fi(this.Fr,this.Kr,this.props,Hi))}vi(){var{main:t,groups:e}=this.pi();for(var i of(this.fi(this.Fr,this.Kr,t,Hi),xi)){var r,s=e[i];(!N(s)||null!=(r=this.Wr[i])&&r.persisted)&&this.fi(ui,this.ri(i),s,i)}}pi(){var t={},e={};for(var i of xi)e[i]={};return Ge(this.props,((i,r)=>{var s,n=null==(s=Si(r))?void 0:s.storageGroup;n?e[n][r]=i:t[r]=i})),{main:t,groups:e}}ai(t,e){if(e===Hi)return JSON.stringify(t)+"|"+this.gi+"|"+this.mi+"|"+this.yi;var i={};return Ge(t,((t,e)=>{var r;i[e]=null!=(r=Si(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}fi(t,e,i,r){var s=this.si(r);if(r===Hi||s.dirty||L(s.fingerprint)){var n;try{if((n=this.ai(i,r))===s.fingerprint)return void(s.dirty=!1)}catch(t){n=void 0}t.A(e,i,this.gi,this.mi,this.yi,this.Dt.debug)?(s.dirty=!1,r!==Hi&&(s.persisted=!0),L(n)||(s.fingerprint=n)):this.Dt.debug&&oe.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.ci)||(clearTimeout(this.ci),this.ci=void 0),this.Fr.q(this.Kr,!1),this.Fr.q(this.Kr,!0),!e&&this.Qr)for(var i of xi)ui.q(this.ri(i));e?delete this.Wr[Hi]:this.Wr={}}clear(){this.remove(),this.props={}}register_once(t,e,i){if(D(t)){L(e)&&(e="None"),this.gi=L(i)?this.bi:i;var r=!1;if(Ge(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.ui(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(D(t)){this.gi=L(e)?this.bi:e;var i=!1;if(Ge(t,((e,r)=>{t.hasOwnProperty(r)&&this.props[r]!==e&&(this.ui(r,e),i=!0)})),i)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.hi(t),this.save())}update_campaign_params(){if(!this.Jr){var t=function(t,e,i){if(!r)return{};var s,n=e?[...Oi,...i||[]]:[],o=Ui(Pi(r.URL,n,Mi),t),a=(s={},Ge(Ai,(function(t){var e=oi.P(t);s[t]=e||null})),s);return He(a,o)}(this.Dt.custom_campaign_params,this.Dt.mask_personal_data_properties,this.Dt.custom_personal_data_properties);N(Ye(t))||this.register(t),this.Jr=!0}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Ci(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Li(),$referring_domain:null!=r&&r.referrer&&(null==(t=Ti(r.referrer))?void 0:t.host)||Ni},void 0)}set_initial_person_info(){this.props[Se]||this.props[Te]||this.register_once({[Re]:Bi(this.Dt.mask_personal_data_properties,this.Dt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Ge([Te,Se],(e=>{var i=this.props[e];i&&Ge(i,(function(e,i){t["$initial_"+O(i)]=e}))}));var e,i,r=this.props[Re];if(r){var s=(e=Fi(r),i={},Ge(e,(function(t,e){i["$initial_"+O(e)]=t})),i);He(t,s)}return t}safe_merge(t){return Ge(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){this.bi=this.gi=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.Yr(t):this.Fr,n=this.Xr(t);if(r||n!==this.Zr){var o=this.props;this.clear(),this.Fr=s,this.Zr=n,this.props=o,this.save()}}set_disabled(t){this.ti=t,this.ti?this.remove():this.save()}set_cross_subdomain(t){t!==this.mi&&(this.mi=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.yi&&(this.yi=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[ce]||{};i[t]=e,this.ui(ce,i),this.save()}remove_event_timer(t){var e=this.props[ce]||{},i=e[t];return L(i)||(delete e[t],this.ui(ce,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.ui(t,e),this.save()}ui(t,e){var i;this.props[t]=e,null!=(i=Si(t))&&i.volatile||this.wi(t)}hi(t){delete this.props[t],this.wi(t)}wi(t){var e,i=null==(e=Si(t))?void 0:e.storageGroup;i&&(this.si(i).dirty=!0)}si(t){return this.Wr[t]||(this.Wr[t]={})}}var Yi={Activation:"events",Cancellation:"cancelEvents"},Vi={Button:"button",Tab:"tab",Selector:"selector"},Ji={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"},Ki={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Xi={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Qi={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Zi={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},tr={Once:"once",Recurring:"recurring",Always:"always"},er={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},ir={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"},rr={Popover:"popover",Inline:"inline"},sr={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},nr={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"},or={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"},ar=ae("[RateLimiter]");class ur{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=>{ar.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void ar.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($e))&&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($e,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var lr=ae("[RemoteConfig]");class hr{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}xi(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()}ki(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 lr.info("Using preloaded remote config",this.remoteConfig),this.Si(this.remoteConfig),void this.Ci();if(this._instance.Ii())return void lr.warn("Remote config is disabled. Falling back to local config.");this.xi((t=>{if(!t)return lr.info("No config found after loading remote JS config. Falling back to JSON."),void this.ki((t=>{this.Si(t),this.Ci()}));this.Si(t),this.Ci()}))}catch(t){lr.error("Error loading remote config",t)}}stop(){this.Ti&&(clearInterval(this.Ti),this.Ti=void 0)}refresh(){!this._instance.Ii()&&r&&"hidden"!==r.visibilityState&&this._instance.reloadFeatureFlags()}Ci(){var t;if(!this.Ti){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.Ti=setInterval((()=>{this.refresh()}),e))}}Si(t){var e;t||lr.error("Failed to fetch remote config from PostHog."),this._instance.Si(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 dr=["fatal","error","warning","log","info","debug"],vr={GZipJS:"gzip-js",Base64:"base64"},cr=Uint8Array,_r=Uint16Array,pr=Uint32Array,fr=new cr([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]),gr=new cr([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]),mr=new cr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wr=function(t,e){for(var i=new _r(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var s=new pr(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]},br=wr(fr,2),yr=br[1];br[0][28]=258,yr[258]=28;for(var xr=wr(gr,0)[1],Er=new _r(32768),$r=0;32768>$r;++$r){var Sr=(43690&$r)>>>1|(21845&$r)<<1;Er[$r]=((65280&(Sr=(61680&(Sr=(52428&Sr)>>>2|(13107&Sr)<<2))>>>4|(3855&Sr)<<4))>>>8|(255&Sr)<<8)>>>1}var Tr=function(t,e,i){for(var r=t.length,s=0,n=new _r(e);r>s;++s)++n[t[s]-1];var o,a=new _r(e);for(s=0;e>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new _r(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[Er[d]>>>u]=l}else for(o=new _r(r),s=0;r>s;++s)o[s]=Er[a[t[s]-1]++]>>>15-t[s];return o},Rr=new cr(288);for($r=0;144>$r;++$r)Rr[$r]=8;for($r=144;256>$r;++$r)Rr[$r]=9;for($r=256;280>$r;++$r)Rr[$r]=7;for($r=280;288>$r;++$r)Rr[$r]=8;var Pr=new cr(32);for($r=0;32>$r;++$r)Pr[$r]=5;var kr=Tr(Rr,9,0),Or=Tr(Pr,5,0),Ir=function(t){return(t/8>>0)+(7&t&&1)},Mr=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof _r?_r:t instanceof pr?pr:cr)(i-e);return r.set(t.subarray(e,i)),r},Ar=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},Cr=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 cr(0),0];if(1==s){var o=new cr(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 _r(v+1),_=Dr(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 cr(c),_]},Dr=function(t,e,i){return-1==t.s?Math.max(Dr(t.l,e,i+1),Dr(t.r,e,i+1)):e[t.s]=i},Nr=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new _r(++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]},Lr=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Br=function(t,e,i){var r=i.length,s=Ir(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)},Fr=function(t,e,i,r,s,n,o,a,u,l,h){Ar(e,h++,i),++s[256];for(var d=Cr(s,15),v=d[0],c=d[1],_=Cr(n,15),p=_[0],f=_[1],g=Nr(v),m=g[0],w=g[1],b=Nr(p),y=b[0],x=b[1],E=new _r(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=Cr(E,7),R=T[0],P=T[1],k=19;k>4&&!R[mr[k-1]];--k);var O,I,M,A,U=l+5<<3,C=Lr(s,Rr)+Lr(n,Pr)+o,D=Lr(s,v)+Lr(n,p)+o+14+3*k+Lr(E,R)+(2*E[16]+3*E[17]+7*E[18]);if(C>=U&&D>=U)return Br(e,h,t.subarray(u,u+l));if(Ar(e,h,1+(C>D)),h+=2,C>D){O=Tr(v,c,0),I=v,M=Tr(p,f,0),A=p;var N=Tr(R,P,0);for(Ar(e,h,w-257),Ar(e,h+5,x-1),Ar(e,h+10,k-4),h+=14,S=0;k>S;++S)Ar(e,h+3*S,R[mr[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)Ar(e,h,N[z=31&F[S]]),h+=R[z],z>15&&(Ar(e,h,F[S]>>>5&127),h+=F[S]>>>12)}}else O=kr,I=Rr,M=Or,A=Pr;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&&(Ar(e,h,r[S]>>>23&31),h+=fr[z]);var j=31&r[S];Ur(e,h,M[j]),h+=A[j],j>3&&(Ur(e,h,r[S]>>>5&8191),h+=gr[j])}else Ur(e,h,O[r[S]]),h+=I[r[S]];return Ur(e,h,O[256]),h+I[256]},zr=new pr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),jr=function(){for(var t=new pr(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),qr=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Gr(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 cr(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=Br(u,l,t.subarray(h,d)):(u[h]=!0,l=Br(u,l,t.subarray(h,o)))}else{for(var v=zr[e-1],c=v>>>13,_=8191&v,p=(1<<i)-1,f=new _r(32768),g=new _r(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 pr(25e3),x=new _r(288),E=new _r(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=Fr(t,u,0,y,x,E,T,R,k,h-k,l),R=S=T=0,k=h;for(var U=0;286>U;++U)x[U]=0;for(U=0;30>U;++U)E[U]=0}var C=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+C]==t[h+C-L]){for(var j=0;z>j&&t[h+j]==t[h+j-L];++j);if(j>C){if(C=j,D=L,j>B)break;var q=Math.min(L,j-2),G=0;for(U=0;q>U;++U){var H=h-L+U+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|yr[C]<<18|xr[D];var Y=31&yr[C],V=31&xr[D];T+=fr[Y]+gr[V],++x[257+Y],++E[V],P=h+C,++S}else y[R++]=t[h],++x[t[h]]}}l=Fr(t,u,!0,y,x,E,T,R,k,h-k,l)}return Mr(a,0,r+Ir(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&&qr(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),qr(l,h-8,i.d()),qr(l,h-4,r),l}var Hr=!!o||!!n,Wr="text/plain",Yr=!1,Vr=(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:"")},Jr=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 Ge(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("&")},Kr=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Xr=t=>{if(t.Or)return t.Or;var{data:e,compression:i}=t;if(e){if(i===vr.GZipJS){var r=Gr(function(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new cr(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 cr(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 Mr(r,0,s)}(Kr(e)),{mtime:0});return{contentType:Wr,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===vr.Base64){var s=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Kr(e)),n=(t=>"data="+encodeURIComponent("string"==typeof t?t:Kr(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=Kr(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Qr=t=>{var e,i,r,s=Xr(t);return!s||(i=t.compression,r=Ri(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}:(Yr=!0,{url:Vr(t.url,"compression"),encodedBody:Xr(p({},t,{compression:void 0,Or:void 0}))})},Zr=function(){var t=_((function*(t){var e=Kr(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,{Or:{contentType:Wr,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),ts=(t,e)=>Jr(t,{_:(new Date).getTime().toString(),ver:v.JS_SDK_VERSION,compression:e}),es=[];n&&es.push({transport:"fetch",method(t){var e,{url:i,encodedBody:r}=Qr(t),{contentType:s,body:o,estimatedSize:u}=null!=r?r:{},l=new Headers;Ge(t.headers,(function(t,e){l.append(e,t)})),s&&l.append("Content-Type",s);var h=null;if(a){var d=new a;h={signal:d.signal,timeout:setTimeout((()=>d.abort()),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){oe.error(t)}null==t.callback||t.callback(r)})))).catch((e=>{oe.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>h?clearTimeout(h.timeout):null))}}),o&&es.push({transport:"XHR",method(t){var e=new o,{url:i,encodedBody:r}=Qr(t);e.open(t.method||"GET",i,!0);var{contentType:s,body:n}=null!=r?r:{};Ge(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&&es.push({transport:"sendBeacon",method(t){try{var{url:e,encodedBody:r}=Qr(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 is=3e3;class rs{constructor(t,e){this.Ei=!0,this.Mi=[],this.Ri=Q((null==e?void 0:e.flush_interval_ms)||is,250,5e3,oe.createLogger("flush interval"),is),this.Pi=t}enqueue(t){this.Mi.push(t),this.Oi||this.Li()}unload(){this.Ai();var t=this.Mi.length>0?this.Fi():{},e=Object.values(t);[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))].map((t=>{this.Pi(p({},t,{transport:"sendBeacon"}))}))}enable(){this.Ei=!1,this.Li()}Li(){var t=this;this.Ei||(this.Oi=setTimeout((()=>{if(this.Ai(),this.Mi.length>0){var e=this.Fi(),i=function(){var i=e[r],s=(new Date).getTime();i.data&&U(i.data)&&Ge(i.data,(t=>{t.offset=Math.abs(t.timestamp-s),delete t.timestamp})),t.Pi(i)};for(var r in e)i()}}),this.Ri))}Ai(){clearTimeout(this.Oi),this.Oi=void 0}Fi(){var t={};return Ge(this.Mi,(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.Mi=[],t}}var ss=["retriesPerformedSoFar"];class ns{constructor(e){this.Ni=!1,this.Di=3e3,this.Mi=[],this._instance=e,this.Mi=[],this.$i=!0,!L(t)&&"onLine"in t.navigator&&(this.$i=t.navigator.onLine,this.qi=()=>{this.$i=!0,this.ji()},this.Bi=()=>{this.$i=!1},Ke(t,"online",this.qi),Ke(t,"offline",this.Bi))}get length(){return this.Mi.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,ss);G(e)&&(i.url=Jr(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.br(p({retriesPerformedSoFar:e},i));0===t.statusCode&&oe.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)}}))}br(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.Mi.push({retryAt:r,requestOptions:t});var s="Enqueued failed request for retry in "+i;navigator.onLine||(s+=" (Browser is offline)"),oe.warn(s),this.Ni||(this.Ni=!0,this.Hi())}Hi(){if(this.Ui&&clearTimeout(this.Ui),0===this.Mi.length)return this.Ni=!1,void(this.Ui=void 0);this.Ui=setTimeout((()=>{this.$i&&this.Mi.length>0&&this.ji(),this.Hi()}),this.Di)}ji(){var t=Date.now(),e=[],i=this.Mi.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.Mi=e,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Ui&&(clearTimeout(this.Ui),this.Ui=void 0),this.Ni=!1,L(t)||(this.qi&&(t.removeEventListener("online",this.qi),this.qi=void 0),this.Bi&&(t.removeEventListener("offline",this.Bi),this.Bi=void 0)),this.Mi))try{this._instance._send_request(p({},e,{transport:"sendBeacon"}))}catch(t){oe.error(t)}this.Mi=[]}}class os{constructor(t){this.zi=()=>{var t,e,i,r;this.Vi||(this.Vi={});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.Vi.lastScrollY=Math.ceil(n),this.Vi.maxScrollY=Math.max(n,null!==(t=this.Vi.maxScrollY)&&void 0!==t?t:0),this.Vi.maxScrollHeight=Math.max(o,null!==(e=this.Vi.maxScrollHeight)&&void 0!==e?e:0),this.Vi.lastContentY=a,this.Vi.maxContentY=Math.max(a,null!==(i=this.Vi.maxContentY)&&void 0!==i?i:0),this.Vi.maxContentHeight=Math.max(u,null!==(r=this.Vi.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get Wi(){return this._instance.config.scroll_root_selector}getContext(){return this.Vi}resetContext(){var t=this.Vi;return setTimeout(this.zi,0),t}startMeasuringScrollPosition(){Ke(t,"scroll",this.zi,{capture:!0}),Ke(t,"scrollend",this.zi,{capture:!0}),Ke(t,"resize",this.zi)}scrollElement(){if(!this.Wi)return null==t?void 0:t.document.documentElement;var e=U(this.Wi)?this.Wi:[this.Wi];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}Gi(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.Wi){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.Gi("y")}scrollX(){return this.Gi("x")}}var as=t=>Bi(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class us{constructor(t,e,i,r){this.Zi=t=>{var e=this.Qi();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Ji(this._instance)};this.Ki.register({[Ee]:i})}},this._instance=t,this.Yi=e,this.Ki=i,this.Ji=r||as,this.Yi.onSessionId(this.Zi)}Qi(){return this.Ki.props[Ee]}getSetOnceProps(){var t,e=null==(t=this.Qi())?void 0:t.props;return e?"r"in e?Fi(e):{$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 Ge(Ye(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+O(i)]=e})),t}}class ls{constructor(){this.Xi={}}on(t,e){return this.Xi[t]||(this.Xi[t]=[]),this.Xi[t].push(e),()=>{this.Xi[t]=this.Xi[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Xi[t]||[])i(e);for(var r of this.Xi["*"]||[])r(t,e)}}var hs=ae("[SessionId]");class ds{on(t,e){return this.en.on(t,e)}constructor(t,e,i){var r;if(this.tn=null,this.rn=[],this.nn=void 0,this.sn=!1,this.en=new ls,this.an=(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===Ae)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Dt=t.config,this.Ki=t.persistence,this.ln=void 0,this.un=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.hn=e||ii,this.cn=i||ii;var s=this.Dt.persistence_name||this.Dt.token;if(this._sessionTimeoutMs=1e3*Q(this.Dt.session_idle_timeout_seconds||1800,60,36e3,hs.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.dn(),this.vn="ph_"+s+"_window_id",this.fn="ph_"+s+"_primary_window_exists",this.pn()){var n=ci.F(this.vn),o=ci.F(this.fn);n&&!o?this.ln=n:ci.q(this.vn),ci.A(this.fn,!0)}if(null!=(r=this.Dt.bootstrap)&&r.sessionID)try{var a=(t=>{var e=this.Dt.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.gn(this.Dt.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){hs.error("Invalid sessionID in bootstrap",t)}this.mn()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return L(this.rn)&&(this.rn=[]),this.rn.push(t),this.un&&t(this.un,this.ln),()=>{this.rn=this.rn.filter((e=>e!==t))}}pn(){return"memory"!==this.Dt.persistence&&!this.Ki.ti&&ci.N()}yn(t){t!==this.ln&&(this.ln=t,this.pn()&&ci.A(this.vn,t))}bn(){return this.ln?this.ln:this.pn()?ci.F(this.vn):null}_n(t){var e=this.tn;return!z(e)&&!z(t)&&5e3>Math.abs(t-e)}gn(t,e,i){var r=e!==this._sessionActivityTimestamp,s=!(t!==this.un||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.un=t,s&&!r||s&&this._n(e)||(this.tn=e,this.Ki.register({[fe]:[e,t,i]}))}wn(){var t,e=null==(t=this.Dt)?void 0:t.persistence_save_debounce_ms;return G(e)&&e>0}xn(){this.wn()?this.Ki.refreshKey(fe):(this.Ki.flush(),this.Ki.load())}kn(){var t;if(!z(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.tn){this.xn();var[,e,i]=this.Sn();e===this.un&&i===this._sessionStartTimestamp&&(this.tn=this._sessionActivityTimestamp,this.Ki.register({[fe]:[this._sessionActivityTimestamp,null!==(t=this.un)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Ki.flush())}}Cn(){var[t]=this.Sn(),e=G(t)?t:0,i=G(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}In(t){return this.xn(),this.an(t,this.Cn())}Sn(){var t=this.Ki.props[fe];return U(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.tn=null,clearTimeout(this.Tn),this.Tn=void 0,this.gn(null,null,null)}destroy(){this.sn=!0,this.kn(),clearTimeout(this.Tn),this.Tn=void 0,this.nn&&t&&(t.removeEventListener(Le,this.nn,{capture:!1}),this.nn=void 0),this.rn=[]}mn(){this.nn=()=>{this.kn(),this.pn()&&ci.q(this.fn)},Ke(t,Le,this.nn,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Dt.cookieless_mode===Ae)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=e||(new Date).getTime(),[,r,s]=this.Sn(),n=this.Cn(),o=this.bn(),a=G(s)&&Math.abs(i-s)>864e5,u=!1,l=!1,h=!r,d=r,v=!h&&!t&&this.an(i,n);v&&((v=this.In(i))||hs.info("cross-tab refresh kept the session alive",{sessionId:r}),[,r,s]=this.Sn()),h||v||a?(r=this.hn(),o=this.cn(),hs.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:h,activityTimeout:v,sessionPastMaximumLength:a}}),s=i,u=!0):(o||(o=this.cn(),u=!0),(l=r!==d)&&(hs.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.yn(o),this.gn(r,c,_),t||this.dn();var p={noSessionId:h,activityTimeout:v,sessionPastMaximumLength:a,crossTabAdoption:l};return u&&this.rn.forEach((t=>t(r,o,p))),{sessionId:r,windowId:o,sessionStartTimestamp:_,changeReason:u?p:void 0,lastActivityTimestamp:n}}dn(){this.sn||(clearTimeout(this.Tn),this.Tn=setTimeout((()=>{if(!this.sn)if(this.In((new Date).getTime())){var t=this.un;this.resetSessionId(),this.en.emit("forcedIdleReset",{idleSessionId:t})}else this.dn()}),1.1*this.sessionTimeoutMs))}}function vs(t,e,i){return Kr({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var cs="custom",_s="i.posthog.com",ps=/^\/static\//;class fs{constructor(t){this.En={},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("."+_s,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.En[this.apiHost]||(this.En[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":cs),this.En[this.apiHost]}Mn(t){if(ps.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.Mn(e);if(i)return""+i+e}if(this.region===cs)return this.apiHost+e;var r=_s+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var gs=ae("[Surveys]"),ms={ignoreConditions:!1,ignoreDelay:!1,displayType:rr.Popover},ws=ae("[PostHog ExternalIntegrations]"),bs={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class ys{constructor(t){this._instance=t}qr(t,e){var i;null==(i=h.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return ws.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.qr(bs[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 xs,Es={},$s=0,Ss=()=>{},Ts='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Rs="Surveys module not available",Ps="sanitize_properties is deprecated. Use before_send instead",ks="Invalid value for property_denylist config: ",Os="posthog",Is=!Hr&&-1===(null==l?void 0:l.indexOf("MSIE"))&&-1===(null==l?void 0:l.indexOf("Mozilla")),Ms=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:Je(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ss,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){oe.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:De,before_send:void 0,request_queue_config:{flush_interval_ms:is},error_tracking:{},_onCapture:Ss},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:pi,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-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)}))(e))},As=[["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 As)L(t[i])||(e[r]=t[i]);var s=He({},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)),U(t.property_blacklist)&&(L(t.property_denylist)?s.property_denylist=t.property_blacklist:U(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:oe.error(ks+t.property_denylist)),s};class Cs{constructor(){this.__forceAllowLocalhost=!1}get Rn(){return this.__forceAllowLocalhost}set Rn(t){oe.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Ds{Pn(t,e){if(t){var i=this.On.indexOf(t);-1!==i&&this.On.splice(i,1)}return this.On.push(e),null==e.initialize||e.initialize(),e}Ln(){return this.config.cookieless_mode===Ae||this.config.cookieless_mode===Me&&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 Cs,this.An=!1,this.version=v.LIB_VERSION,this.Fn=new ls,this.On=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Ms(),this.SentryIntegration=bi,this.sentryIntegration=t=>function(t,e){var i=wi(t,e);return{name:mi,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Nn=!1,this.Dn=null,this.$n=null,this.qn=null,this.scrollManager=new os(this),this.pageViewManager=new yi(this),this.rateLimiter=new ur(this),this.requestRouter=new fs(this),this.consent=new _i(this),this.externalIntegrations=new ys(this);var e=null!==(t=Ds.__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=>oe.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==Os){var r,s=null!==(r=Es[i])&&void 0!==r?r:new Ds;return s._init(t,e,i),Es[i]=s,Es[Os][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 oe.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.jn(i.debug),this.Bn=i,this.Hn=[],i.person_profiles?this.$n=i.person_profiles:i.process_person&&(this.$n=i.process_person);var a=Ms(i.defaults),u=Us(i),l=He({},a,u,{name:r,token:o});D(a.rageclick)&&D(u.rageclick)&&(l.rageclick=He({},a.rageclick,u.rageclick)),D(a.session_recording)&&D(u.session_recording)&&(l.session_recording=He({},a.session_recording,u.session_recording)),this.set_config(l),this.config.on_xhr_error&&oe.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:vr.GZipJS;var h=this.Un();this.persistence=new Wi(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Wi(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.zn=new rs((t=>this.Vn(t)),this.config.request_queue_config),this.Wn=new ns(this),this.__request_queue=[];var _=this.Ln();if(_||(this.sessionManager=new ds(this),this.sessionPropsManager=new us(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(oe.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Gn(_)}),0)):(oe.info("Initializing extensions synchronously"),this.Gn(_)),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&oe.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(xe);if(i.bootstrap.isIdentifiedID&&null!=g&&g!==f&&m===Ue)this.identify(f);else if(i.bootstrap.isIdentifiedID&&null!=g&&g!==f&&m===Ce)oe.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(ii()),b=i.bootstrap.isIdentifiedID?w:f;this.persistence.set_property(xe,i.bootstrap.isIdentifiedID?Ce:Ue),this.register({distinct_id:f,$device_id:b})}}if(_)this.register_once({distinct_id:ke,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(ii());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(xe,Ue)}return Ke(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()||ii();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(xe,Ce)),e()},s=i.user();"then"in s&&C(s.then)?s.then(r):r(s)}(t,(()=>{i.register((t=>{Promise&&Promise.resolve||gi.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()||(gi.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(gi.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,Be),identify:t=>e(t,ze),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Zn())):this.Zn(),C(this.config._onCapture)&&this.config._onCapture!==Ss&&(oe.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&oe.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}Gn(t){var e,i,r,s,n,o,a,u=performance.now(),l=p({},Ds.__defaultExtensionClasses,this.config.__extensionClasses),h=[];l.featureFlags&&this.On.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new l.featureFlags(this)),l.exceptions&&this.On.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new l.exceptions(this)),l.historyAutocapture&&this.On.push(this.historyAutocapture=new l.historyAutocapture(this)),l.tracingHeaders&&this.On.push(this.tracingHeaders=new l.tracingHeaders(this)),l.siteApps&&this.On.push(this.siteApps=new l.siteApps(this)),l.sessionRecording&&!t&&this.On.push(this.sessionRecording=new l.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),l.autocapture&&this.On.push(this.autocapture=new l.autocapture(this)),l.surveys&&this.On.push(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new l.surveys(this)),l.logs&&this.On.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new l.logs(this)),l.conversations&&this.On.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new l.conversations(this)),l.productTours&&this.On.push(this.productTours=new l.productTours(this)),l.heatmaps&&this.On.push(this.heatmaps=new l.heatmaps(this)),l.webVitalsAutocapture&&this.On.push(this.webVitalsAutocapture=new l.webVitalsAutocapture(this)),l.exceptionObserver&&this.On.push(this.exceptionObserver=new l.exceptionObserver(this)),l.deadClicksAutocapture&&this.On.push(this.deadClicksAutocapture=new l.deadClicksAutocapture(this,fi)),l.toolbar&&this.On.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new l.toolbar(this)),l.experiments&&this.On.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new l.experiments(this)),this.On.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.Qn){var t=this.Qn;this.Qn=void 0,this.Si(t)}})),this.Jn(h,u)}Jn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Jn(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){oe.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Oe]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Ie]:r}),this.config.__preview_deferred_init_extensions&&oe.info("PostHog extensions initialized ("+r+"ms)")}Si(t){var e;if(!r||!r.body)return oe.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Si(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Qn=t),this.Kn=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=k(t.supportedCompression,vr.GZipJS)?vr.GZipJS:k(t.supportedCompression,vr.Base64)?vr.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.$n?this.$n:De}),this.On.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Zn(){try{this.config.loaded(this)}catch(t){oe.critical("`loaded` function failed",t)}if(this.Yn(),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.Ln())&&this.Xn()}),1),this.es=new hr(this),this.es.load()}Yn(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.zn)||t.enable())}_dom_loaded(){this.is_capturing()&&qe(this.__request_queue,(t=>this.Vn(t))),this.__request_queue=[],this.Yn()}_handle_unload(){var t,e,i,r;null==(t=this.surveys)||t.handlePageUnload(),this.config.request_batching?(this.ts()&&this.capture(Fe),null==(e=this.logs)||e.flushLogs("sendBeacon"),null==(i=this.zn)||i.unload(),null==(r=this.Wn)||r.unload()):this.ts()&&this.capture(Fe,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?Is?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=ts(s.url,s.compression);var n=null!==(e=s.transport)&&void 0!==e?e:"fetch",o=es.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===vr.GZipJS&&u&&!Yr?Zr(s).then((t=>{a(t)})).catch((e=>{if(x(e))return Yr=!0,void a(p({},s,{compression:void 0,url:ts(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)&&(Yr=!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}))}Vn(t){this.Wn?this.Wn.retriableRequest(t):this._send_request(t)}_execute_array(t){$s++;try{var e,i=[],r=[],s=[];qe(t,(t=>{if(t)if(U(e=t[0]))s.push(t);else if(C(t))try{t.call(this)}catch(e){oe.error("Error executing queued PostHog call",t,e)}else U(t)&&"alias"===e?i.push(t):U(t)&&-1!==e.indexOf("capture")&&C(this[e])?s.push(t):r.push(t)}));var n=function(t,e){qe(t,(function(t){try{if(U(t[0])){var i=e;Ge(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){oe.error("Error executing queued PostHog call",t,e)}}))};n(i,this),n(r,this),n(s,this)}finally{$s--}}push(t){if($s>0&&U(t)&&B(t[0])){var e=Ds.prototype[t[0]];C(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.zn){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)&&(oe.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.rs||oe.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,ii),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Be&&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.ns(null==i?void 0:i.$set_once,t!==je,t===ze);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),U(e)?(r=[],qe(e,(e=>{r.push(t(e))}))):(r={},Ge(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===er.DISMISSED||t===er.SENT){var b=null==e?void 0:e[ir.SURVEY_ID],y=null==e?void 0:e[ir.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){gs.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===er.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===er.SHOWN&&(c.$set=p({},c.$set,{[ir.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===nr.SHOWN){var x=null==e?void 0:e[or.TOUR_TYPE];x&&(c.$set=p({},c.$set,{[or.TOUR_LAST_SEEN_DATE+"/"+x]:(new Date).toISOString()}))}var E=p({},c.properties.$set,c.$set);if(N(E)||this.setPersonPropertiesForFlags(E),!j(this.config.before_send)){var S=this.mr(c);if(!S)return;(c=S).uuid=se(c.uuid,ii)}this.Fn.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.Vn(T):this.zn.enqueue(T),c}oe.critical("This capture call is ignored due to client rate limiting.")}}else oe.error("No event name provided to posthog.capture")}else oe.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.Ln()&&(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)&&!q(h.distinct_id)||F(h.distinct_id))&&oe.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var c,_=function(e,i,r){var n,o,a,u;if(!l)return{};var h,d,c,_,p,f,g,m,w,b=e?[...Oi,...i||[]]:[],[y,x]=function(t){for(var e=0;ee.length>e;e++){var[i,r]=ee[e],s=i.exec(t),n=s&&(C(r)?r(s,t):r);if(n)return n}return["",""]}(l),E=null!=(h="undefined"!=typeof navigator?navigator:void 0)&&h.brave?{brave:!0}:{},S={detectGoogleSearchApp:r},T=He(Ye({$os:y,$os_version:x,$browser:Qt(l,navigator.vendor,E,S),$device:ie(l),$device_type:(c=l,_={userAgentDataPlatform:null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,maxTouchPoints:null==(o=navigator)?void 0:o.maxTouchPoints,screenWidth:null==t||null==(a=t.screen)?void 0:a.width,screenHeight:null==t||null==(u=t.screen)?void 0:u.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio},w=ie(c),w===st||w===rt||"Kobo"===w||"Kindle Fire"===w||w===Ut?it:w===Et||w===St||w===$t||w===It?"Console":w===ot?"Wearable":w?Z:"Android"===(null==_?void 0:_.userAgentDataPlatform)&&(null!==(p=null==_?void 0:_.maxTouchPoints)&&void 0!==p?p:0)>0?600>Math.min(null!==(f=null==_?void 0:_.screenWidth)&&void 0!==f?f:0,null!==(g=null==_?void 0:_.screenHeight)&&void 0!==g?g:0)/(null!==(m=null==_?void 0:_.devicePixelRatio)&&void 0!==m?m:1)?Z:it:"Desktop"),$timezone:zi(),$timezone_offset:ji()}),{$current_url:Pi(null==s?void 0:s.href,b,Mi),$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,E,S),$browser_language:Di(),$browser_language_prefix:(d=Di(),"string"==typeof d?d.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&&(T.$sdk_dist_channel=v.SDK_DIST_CHANNEL),T}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app);if(this.sessionManager){var{sessionId:f,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(a,n.getTime());h.$session_id=f,h.$window_id=g}this.sessionPropsManager&&He(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&He(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.Wn)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===cs&&(h.$lib_custom_api_host=this.config.api_host),c=e!==Be||a?e!==Fe||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,o),h=He(h,c),e===Be&&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=He({},_,this.persistence.properties(),this.sessionPersistence.properties(),h)).$is_identified=this._isIdentified(),U(this.config.property_denylist)?Ge(this.config.property_denylist,(function(t){delete h[t]})):oe.error(ks+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(oe.error(Ps),h=b(h,e));var y=this.ss();return h.$process_person_profile=y,y&&!a&&this.os("_calculate_event_properties"),h}ns(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.ss())return t;if(this.An&&!i)return t;var s=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=He({},s,n||{},t||{}),a=this.config.sanitize_properties;return a&&(oe.error(Ps),o=a(o,"$set_once")),e&&(this.An=!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)}ls(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.Fn.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:Rs}),()=>{})}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:Rs})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Rs})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=ms),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:Rs}}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:Rs})}us(t){return!t||F(t)?(oe.critical("Unique user id has not been set in posthog.identify"),!1):t===ke?(oe.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())||(oe.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 oe.uninitializedWarning("posthog.identify");if(q(t)&&(t=t.toString(),oe.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.us(t)&&this.os("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:t}),this.get_property(de)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),t!==r&&t!==this.get_property(ve)&&(this.unregister(ve),this.register({distinct_id:t}));var s,n=(this.persistence.get_property(xe)||Ue)===Ue;t!==r&&n?(this.persistence.set_property(xe,Ce),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.capture(ze,{distinct_id:t,$anon_distinct_id:r},{$set:e||{},$set_once:i||{}}),this.qn=vs(t,e,i),null==(s=this.featureFlags)||s.setAnonymousDistinctId(r)):(e||i)&&this.setPersonProperties(e,i),t!==r&&(this.reloadFeatureFlags(),this.unregister(be))}}setPersonProperties(t,e){if((t||e)&&this.os("posthog.setPersonProperties")){var i=vs(this.get_distinct_id(),t,e);this.qn!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.qn=i):oe.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(U(t)?t:[t]).filter((t=>B(t)&&t.length>0));0!==i.length&&this.os("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.qn=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 oe.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.os("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(oe.info("reset"),!this.__loaded)return oe.uninitializedWarning("posthog.reset");var h,d=this.get_property(de),v=this.get_property(pe);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(i=this.sessionPersistence)||i.clear(),L(v)||null==(h=this.persistence)||h.register({[pe]:v}),null==(r=this.surveys)||r.reset(),null==(s=this.es)||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(xe,Ue),null==(l=this.sessionManager)||l.resetSessionId(),this.qn=null,this.config.cookieless_mode===Ae)this.register_once({distinct_id:ke,$device_id:null},"");else{var c=this.config.get_device_id(ii());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.hs()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.cs()}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(he)?(oe.critical("Attempting to create alias for existing People user - aborting."),-2):this.os("posthog.alias")?(L(e)&&(e=this.get_distinct_id()),t!==e?(this.ls(ve,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(oe.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;He(this.config,Us(t));var _=this.Un();null==(i=this.persistence)||i.update_config(this.config,e,_),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Wi(p({},this.config,{persistence:"sessionStorage"}),_,!1);var f=this.jn(this.config.debug);H(f)&&(this.config.debug=f),H(this.config.debug)&&(this.config.debug?(v.DEBUG=!0,ui.N()&&ui.A("ph_debug",!0),oe.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(v.DEBUG=!1,ui.N()&&ui.q("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.ds(),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:Ds.vs}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:Os;return e!==Os&&(e=Os+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(xe))===Ce||(null==(e=this.sessionPersistence)?void 0:e.get_property(xe))===Ce}ss(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===De&&!this._isIdentified()&&N(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[ve])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Pe]))}ts(){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.ss()||this.os("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.os("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}os(t){return"never"===this.config.person_profiles?(oe.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.ls(Pe,!0),!0)}Un(){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!==Me)}ds(){var t,e,i,r,s=this.Un();return(null==(t=this.persistence)?void 0:t.ti)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.ti)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Ae){if(this.Ln()){var i,r,s,n,o;this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new ds(this),this.pageViewManager=new yi(this),this.persistence&&(this.sessionPropsManager=new us(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=Ds.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.Pn(this.sessionRecording,new u(this)),this.Kn&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Kn)))}var l,h;this.consent.optInOut(!0),this.ds(),this.Yn(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Me&&(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.Xn()}else oe.warn(Ts)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==Ae?(this.config.cookieless_mode===Me&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.ds(),this.config.cookieless_mode===Me&&(this.register({distinct_id:ke,$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.Xn(),this.Yn())):oe.warn(Ts)}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===Ae||(this.config.cookieless_mode===Me?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.ds()}_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}Xn(){r&&("visible"===r.visibilityState?this.Nn||(this.Nn=!0,this.capture(Be,{title:r.title},{send_instantly:!0}),this.Dn&&(r.removeEventListener(Ne,this.Dn),this.Dn=null)):this.Dn||(this.Dn=this.Xn.bind(this),Ke(r,Ne,this.Dn)))}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}))}Ii(){var t,e,i,r,s,n,o=this.Bn||{};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?(oe.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=oe,s=(e="advanced_disable_flags")in(t=o)&&!j(t[e]),n=i in t&&!j(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]))}mr(t){var e;if(j(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(V),r=U(this.config.before_send)?this.config.before_send:[this.config.before_send],s=t;for(var n of r){if(s=n(s),j(s)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Y(t.event)?oe.warn(o+". This can cause unexpected behavior."):oe.info(o),null}s.properties&&!N(s.properties)||oe.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of i)if(s.properties&&j(s.properties[a]))return oe.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.Hr)?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)})}jn(t){var e=H(t)&&!t,i=ui.N()&&"true"===ui.P("ph_debug");return!e&&(!!i||t)}}Ds.__defaultExtensionClasses={},Ds.vs={trace:xs=()=>{},debug:xs,info:xs,warn:xs,error:xs,fatal:xs},function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=We(t.prototype[e[i]])}(Ds,["identify"]);var Ns=function(){v.SDK_DIST_CHANNEL="npm";var e=Es[Os]=new Ds;return function(){function e(){e.done||(e.done=!0,Is=!1,Ge(Es,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():Ke(r,"DOMContentLoaded",e,{capture:!1}):t&&oe.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}();export{vr as Compression,sr as DEFAULT_PRODUCT_TOUR_APPEARANCE,rr as DisplaySurveyType,Ds as PostHog,nr as ProductTourEventName,or as ProductTourEventProperties,er as SurveyEventName,ir as SurveyEventProperties,Yi as SurveyEventType,Ji as SurveyPosition,Zi as SurveyQuestionBranchingType,Qi as SurveyQuestionType,tr as SurveySchedule,Ki as SurveyTabPosition,Xi as SurveyType,Vi as SurveyWidgetType,Ns as default,Ns as posthog,dr 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.391.7",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,U=Array.isArray||function(t){return"[object Array]"===A.call(t)},C=t=>"function"==typeof t,D=t=>t===Object(t)&&!U(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,j=t=>L(t)||z(t),q=t=>"[object Number]"==A.call(t)&&t==t,G=t=>q(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),q(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(),Ut=Mt+" "+it.toLowerCase(),Ct="Konqueror",Dt="Oculus Browser",Nt="Vivaldi",Lt="Yandex",Bt="Whale",Ft="DuckDuckGo",zt="Pale Moon",jt="Waterfox",qt="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?qt: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(),Ct.toLowerCase())?Ct:k(t,qt+"/")?qt:((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,jt+"/")?jt: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)],[Ct]:[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)],[qt]:[new RegExp(qt+"\\/"+Ht)],[Ft]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Ht)],[zt]:[new RegExp("PaleMoon\\/"+Ht)],[jt]:[new RegExp(jt+"\\/"+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)?Ut:""},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}var ne=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)=>ne(e+" "+t,i)};return s},oe=ne("[PostHog.js]"),ae=oe.createLogger,ue=ae("[ExternalScriptsLoader]"),le=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return ue.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)}le(t,r,i)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");le(t,o,i)}},h.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);le(t,r,i)};var he="$people_distinct_id",de="$device_id",ve="__alias",ce="__timers",_e="$dead_clicks_enabled_server_side",pe="$session_recording_remote_config",fe="$sesid",ge="$session_is_sampled",me="$enabled_feature_flags",we="$surveys_loaded_at",be="$flag_call_reported",ye="$feature_flag_evaluated_at",xe="$user_state",Ee="$client_session_props",$e="$capture_rate_limit",Se="$initial_campaign_params",Te="$initial_referrer_info",Re="$initial_person_info",Pe="$epp",ke="$posthog_cookieless",Oe="$sdk_debug_extensions_init_method",Ie="$sdk_debug_extensions_init_time_ms",Me="on_reject",Ae="always",Ue="anonymous",Ce="identified",De="identified_only",Ne="visibilitychange",Le="beforeunload",Be="$pageview",Fe="$pageleave",ze="$identify",je="$groupidentify";function qe(t,e){U(t)&&t.forEach(e)}function Ge(t,e){if(!j(t))if(U(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 He=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},We=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){oe.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),oe.critical(t)}}},Ye=function(t){var e={};return Ge(t,(function(t,i){(B(t)&&t.length>0||q(t))&&(e[i]=t)})),e};var Ve=["herokuapp.com","vercel.app","netlify.app"];function Je(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 Ve)if(i===r)return!1;return!0}function Ke(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 q(t)&&isFinite(t)&&Math.floor(t)===t});class Xe{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 Xe(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 Xe(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 Qe{constructor(){this.S=0,this.C=0,this.I=new ei}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 Xe.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 Ze,ti=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&&(ti=t=>crypto.getRandomValues(t));class ei{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(ti(this.R),this.O=0),this.R[this.O++]}}var ii=()=>ri().toString(),ri=()=>(Ze||(Ze=new Qe)).generate(),si="",ni=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var oi={N:()=>!!r,D(t){oe.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(oi.P(t))||{}}catch(t){}return e},A(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),si)return si;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_"+ii();!si&&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",si=o)}return si}(t);if(!i){var s=(t=>{var e=t.match(ni);return e?e[0]:""})(t);s!==i&&oe.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&&oe.warn("cookieStore warning: large cookie, len="+h.length),r.cookie=h,!0}catch(t){return!1}},q(t,e){if(null!=r&&r.cookie)try{oi.A(t,"",-1,e)}catch(t){return}}},ai=null,ui={N(){if(!z(ai))return ai;var e=!0;if(L(t))e=!1;else try{var i="__mplssupport__";ui.A(i,"xyz"),'"xyz"'!==ui.P(i)&&(e=!1),ui.q(i)}catch(t){e=!1}return e||oe.error("localStorage unsupported; falling back to cookie store"),ai=e,e},D(t){oe.error("localStorage error: "+t)},P(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){ui.D(t)}return null},F(t){try{return JSON.parse(ui.P(t))||{}}catch(t){}return null},A(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){ui.D(t)}return!1},q(e){try{null==t||t.localStorage.removeItem(e)}catch(t){ui.D(t)}}},li=[de,"distinct_id",fe,ge,Pe,Re,xe],hi={},di={N:()=>!0,D(t){oe.error("memoryStorage error: "+t)},P:t=>hi[t]||null,F:t=>hi[t]||null,A:(t,e)=>(hi[t]=e,!0),q(t){delete hi[t]}},vi=null,ci={N(){if(!z(vi))return vi;if(vi=!0,L(t))vi=!1;else try{var e="__support__";ci.A(e,"xyz"),'"xyz"'!==ci.P(e)&&(vi=!1),ci.q(e)}catch(t){vi=!1}return vi},D(t){oe.error("sessionStorage error: ",t)},P(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){ci.D(t)}return null},F(t){try{return JSON.parse(ci.P(t))||null}catch(t){}return null},A(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){ci.D(t)}return!1},q(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){ci.D(t)}}};class _i{constructor(t){this._instance=t}get Dt(){return this._instance.config}get consent(){return this.Lr()?0:this.Ar}isOptedOut(){return this.Dt.cookieless_mode===Ae||this.isRejected()||-1===this.consent&&this.Dt.cookieless_mode===Me}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Dt.opt_out_capturing_by_default}optInOut(t){this.Fr.A(this.Nr,t?1:0,this.Dt.cookie_expiration,this.Dt.cross_subdomain_cookie,this.Dt.secure_cookie)}reset(){this.Fr.q(this.Nr,this.Dt.cross_subdomain_cookie)}get Nr(){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 Ar(){var t=this.Fr.P(this.Nr);return K(t)?1:k(X,t)?0:-1}get Fr(){var t=this.Dt.opt_out_capturing_persistence_type,e="localStorage"===t?ui:oi;if(!this.Dr||this.Dr!==e){this.Dr=e;var i="localStorage"===t?oi:ui;i.P(this.Nr)&&(this.Dr.P(this.Nr)||this.optInOut(K(i.P(this.Nr))),i.q(this.Nr,this.Dt.cross_subdomain_cookie))}return this.Dr}Lr(){return!!this.Dt.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,h.doNotTrack].some((t=>K(t)))}}var pi=["next","previous","prev",">","<","+","-","−","–"];ae("[Dead Clicks]");var fi=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(_e)),r=t.instance.config.capture_dead_clicks;return H(r)?r:!!D(r)||i},gi=ae("[SegmentIntegration]");var mi="posthog-js";function wi(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 bi{constructor(t,e,i,r,s,n){this.name=mi,this.setupOnce=function(o){o(wi(t,{organization:e,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class yi{constructor(t){this.Br=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(oe.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.Hr=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.Ur()}Ur(){var t;this.zr=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.Br)}destroy(){var t;null==(t=this.zr)||t.call(this),this.zr=void 0}doPageView(e,i){var r,s=this.Vr(e,i);return this.Hr={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.Vr(t,null==(e=this.Hr)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.Hr)?void 0:t.pageViewId}}Vr(t,e){var i=this.Hr;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,oe):1,v=n>1?Q(a/n,0,1,oe):1,c=u>1?Q(l/u,0,1,oe):1,_=u>1?Q(h/u,0,1,oe):1;r=He(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 xi=["flags","surveys"],Ei={[he]:{exposure:"hidden"},[ve]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[ce]:{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"},[_e]:{exposure:"event"},$product_tours_enabled_server_side:{exposure:"hidden"},$web_vitals_allowed_metrics:{exposure:"event"},[pe]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[fe]:{exposure:"hidden"},[ge]:{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"},[me]:{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"},[we]:{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"},[be]:{exposure:"hidden"},$flag_call_reported_session_id:{exposure:"hidden"},$feature_flag_errors:{exposure:"hidden"},[ye]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[xe]:{exposure:"hidden"},[Ee]:{exposure:"hidden"},[$e]:{exposure:"hidden"},[Se]:{exposure:"hidden"},[Te]:{exposure:"hidden"},[Re]:{exposure:"hidden"},[Pe]:{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"},[Oe]:{exposure:"event"},[Ie]:{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"}},$i=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Si=t=>{var e=Ei[t];if(e)return e;for(var[i,r]of $i)if(0===t.indexOf(i))return r},Ti=t=>{var e=null==r?void 0:r.createElement("a");return L(e)?null:(e.href=t,e)},Ri=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(!U(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){oe.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},Pi=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("=");U(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},ki="https?://(.*)",Oi=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ii=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Oi],Mi="<masked>",Ai=["li_fat_id"];function Ui(t,e){var i=Ii.concat(e||[]),r={};return Ge(i,(function(e){var i=Ri(t,e);r[e]=i||null})),r}function Ci(t){var e=function(t){return t?0===t.search(ki+"google.([^/?]*)")?"google":0===t.search(ki+"bing.com")?"bing":0===t.search(ki+"yahoo.com")?"yahoo":0===t.search(ki+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",s={};if(!z(e)){s.$search_engine=e;var n=r?Ri(r.referrer,i):"";n.length&&(s.ph_keyword=n)}return s}function Di(){return navigator.language||navigator.userLanguage}var Ni="$direct";function Li(){return(null==r?void 0:r.referrer)||Ni}function Bi(t,e){var i=t?[...Oi,...e||[]]:[],r=null==s?void 0:s.href.substring(0,1e3);return{r:Li().substring(0,1e3),u:r?Pi(r,i,Mi):void 0}}function Fi(t){var e,{r:i,u:r}=t,s={$referrer:i,$referring_domain:null==i?void 0:i==Ni?Ni:null==(e=Ti(i))?void 0:e.host};if(r){s.$current_url=r;var n=Ti(r);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname;var o=Ui(r);He(s,o)}if(i){var a=Ci(i);He(s,a)}return s}function zi(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function ji(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var qi={flags:ye,surveys:we},Gi=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Hi="main";class Wi{constructor(e,i,r){if(void 0===r&&(r=!0),this.Wr={},this.Gr=!1,this.Zr=!1,this.Dt=e,this.Qr=r,this.props={},this.Jr=!1,this.Kr=(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.Fr=this.Yr(e),this.Zr=this.Xr(e),this.load(),e.debug&&oe.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var s=()=>this.flush();Ke(t,"beforeunload",s,{capture:!1}),Ke(t,"pagehide",s,{capture:!1})}}ei(){var t,e=null==(t=this.Dt)?void 0:t.persistence_save_debounce_ms;return q(e)&&e>0?e:0}isDisabled(){return!!this.ti}Yr(e){-1===Gi.indexOf(e.persistence.toLowerCase())&&(oe.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=[...li,...e];return p({},ui,{F(t){try{var e={};try{e=oi.F(t)||{}}catch(t){}var r,s=JSON.parse(ui.P(t)||"{}");if(i){var n={};for(var o in e){var a=e[o];z(a)||""===a||(n[o]=a)}r=He(s,n)}else r=He(e,s);return ui.A(t,r),r}catch(t){}return null},A(t,e,i,s,n,o){var a=ui.A(t,e,void 0,void 0,o);try{var u={};r.forEach((t=>{e[t]&&(u[t]=e[t])})),Object.keys(u).length&&oi.A(t,u,i,s,n,o)}catch(t){ui.D(t)}return a},q(e,i){try{null==t||t.localStorage.removeItem(e),oi.q(e,i)}catch(t){ui.D(t)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,n=e.persistence.toLowerCase();return"localstorage"===n&&ui.N()?(i=ui,s=!0):"localstorage+cookie"===n&&r.N()?(i=r,s=!0):"sessionstorage"===n&&ci.N()?i=ci:"memory"===n?i=di:"cookie"===n?i=oi:r.N()?(i=r,s=!0):i=oi,this.Gr=s,i}ri(t){return this.Kr+"__"+t}Xr(t){return this.Gr&&!!t.split_storage}ii(t){var e=null!=t?t:this.Dt.feature_flag_cache_ttl_ms;if(!e||0>=e)return!1;var i=this.props[ye];return!i||"number"!=typeof i||Date.now()-i>e}properties(){var t={};return Ge(this.props,((e,i)=>{var r=Si(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e,i===me?()=>this.ii():()=>!1))return;r.transformToEventProperties&&He(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.ti){var t=this.Fr.F(this.Kr);t&&(this.props=He({},t)),this.Zr&&this.ni()}}ni(){for(var t of xi){var e=ui.F(this.ri(t));if(e&&!N(e)){var i=this.si(t);i.persisted=!0,this.oi(t)||(i.fingerprint=this.ai(e,t)),this.li(t,e)||He(this.props,e)}}}oi(t){return Object.keys(this.props).some((e=>{var i;return(null==(i=Si(e))?void 0:i.storageGroup)===t}))}li(t,e){var i=qi[t];if(!i)return!1;var r=e[i],s=this.props[i];return q(r)&&q(s)&&s>r}refreshKey(t){var e;if(!this.ti){var i=this.Zr?null==(e=Si(t))?void 0:e.storageGroup:void 0,r=i?ui.F(this.ri(i)):this.Fr.F(this.Kr);if(r&&t in r)this.ui(t,r[t]);else{if(i){var s=this.Fr.F(this.Kr);if(s&&t in s)return void this.ui(t,s[t])}this.hi(t)}}}save(){if(!this.ti){var t=this.ei();t>0?L(this.ci)&&(this.ci=setTimeout((()=>{this.ci=void 0,this.di()}),t)):this.di()}}flush(){L(this.ci)||(clearTimeout(this.ci),this.ci=void 0,this.di())}di(){this.ti||(this.Zr?this.vi():this.fi(this.Fr,this.Kr,this.props,Hi))}vi(){var{main:t,groups:e}=this.pi();for(var i of(this.fi(this.Fr,this.Kr,t,Hi),xi)){var r,s=e[i];(!N(s)||null!=(r=this.Wr[i])&&r.persisted)&&this.fi(ui,this.ri(i),s,i)}}pi(){var t={},e={};for(var i of xi)e[i]={};return Ge(this.props,((i,r)=>{var s,n=null==(s=Si(r))?void 0:s.storageGroup;n?e[n][r]=i:t[r]=i})),{main:t,groups:e}}ai(t,e){if(e===Hi)return JSON.stringify(t)+"|"+this.gi+"|"+this.mi+"|"+this.yi;var i={};return Ge(t,((t,e)=>{var r;i[e]=null!=(r=Si(e))&&r.volatile?"__volatile__":t})),JSON.stringify(i)}fi(t,e,i,r){var s=this.si(r);if(r===Hi||s.dirty||L(s.fingerprint)){var n;try{if((n=this.ai(i,r))===s.fingerprint)return void(s.dirty=!1)}catch(t){n=void 0}t.A(e,i,this.gi,this.mi,this.yi,this.Dt.debug)?(s.dirty=!1,r!==Hi&&(s.persisted=!0),L(n)||(s.fingerprint=n)):this.Dt.debug&&oe.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.ci)||(clearTimeout(this.ci),this.ci=void 0),this.Fr.q(this.Kr,!1),this.Fr.q(this.Kr,!0),!e&&this.Qr)for(var i of xi)ui.q(this.ri(i));e?delete this.Wr[Hi]:this.Wr={}}clear(){this.remove(),this.props={}}register_once(t,e,i){if(D(t)){L(e)&&(e="None"),this.gi=L(i)?this.bi:i;var r=!1;if(Ge(t,((t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.ui(i,t),r=!0)})),r)return this.save(),!0}return!1}register(t,e){if(D(t)){this.gi=L(e)?this.bi:e;var i=!1;if(Ge(t,((e,r)=>{t.hasOwnProperty(r)&&this.props[r]!==e&&(this.ui(r,e),i=!0)})),i)return this.save(),!0}return!1}unregister(t){t in this.props&&(this.hi(t),this.save())}update_campaign_params(){if(!this.Jr){var t=function(t,e,i){if(!r)return{};var s,n=e?[...Oi,...i||[]]:[],o=Ui(Pi(r.URL,n,Mi),t),a=(s={},Ge(Ai,(function(t){var e=oi.P(t);s[t]=e||null})),s);return He(a,o)}(this.Dt.custom_campaign_params,this.Dt.mask_personal_data_properties,this.Dt.custom_personal_data_properties);N(Ye(t))||this.register(t),this.Jr=!0}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?Ci(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Li(),$referring_domain:null!=r&&r.referrer&&(null==(t=Ti(r.referrer))?void 0:t.host)||Ni},void 0)}set_initial_person_info(){this.props[Se]||this.props[Te]||this.register_once({[Re]:Bi(this.Dt.mask_personal_data_properties,this.Dt.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Ge([Te,Se],(e=>{var i=this.props[e];i&&Ge(i,(function(e,i){t["$initial_"+O(i)]=e}))}));var e,i,r=this.props[Re];if(r){var s=(e=Fi(r),i={},Ge(e,(function(t,e){i["$initial_"+O(e)]=t})),i);He(t,s)}return t}safe_merge(t){return Ge(this.props,(function(e,i){i in t||(t[i]=e)})),t}update_config(t,e,i){this.bi=this.gi=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.Yr(t):this.Fr,n=this.Xr(t);if(r||n!==this.Zr){var o=this.props;this.clear(),this.Fr=s,this.Zr=n,this.props=o,this.save()}}set_disabled(t){this.ti=t,this.ti?this.remove():this.save()}set_cross_subdomain(t){t!==this.mi&&(this.mi=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.yi&&(this.yi=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[ce]||{};i[t]=e,this.ui(ce,i),this.save()}remove_event_timer(t){var e=this.props[ce]||{},i=e[t];return L(i)||(delete e[t],this.ui(ce,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.ui(t,e),this.save()}ui(t,e){var i;this.props[t]=e,null!=(i=Si(t))&&i.volatile||this.wi(t)}hi(t){delete this.props[t],this.wi(t)}wi(t){var e,i=null==(e=Si(t))?void 0:e.storageGroup;i&&(this.si(i).dirty=!0)}si(t){return this.Wr[t]||(this.Wr[t]={})}}var Yi={Activation:"events",Cancellation:"cancelEvents"},Vi={Button:"button",Tab:"tab",Selector:"selector"},Ji={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"},Ki={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Xi={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Qi={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Zi={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},tr={Once:"once",Recurring:"recurring",Always:"always"},er={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},ir={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"},rr={Popover:"popover",Inline:"inline"},sr={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},nr={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"},or={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"},ar=ae("[RateLimiter]");class ur{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=>{ar.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4}))}catch(t){return void ar.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($e))&&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($e,a),{isRateLimited:u,remainingTokens:a.tokens}}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var lr=ae("[RemoteConfig]");class hr{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}xi(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()}ki(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 lr.info("Using preloaded remote config",this.remoteConfig),this.Si(this.remoteConfig),void this.Ci();if(this._instance.Ii())return void lr.warn("Remote config is disabled. Falling back to local config.");this.xi((t=>{if(!t)return lr.info("No config found after loading remote JS config. Falling back to JSON."),void this.ki((t=>{this.Si(t),this.Ci()}));this.Si(t),this.Ci()}))}catch(t){lr.error("Error loading remote config",t)}}stop(){this.Ti&&(clearInterval(this.Ti),this.Ti=void 0)}refresh(){!this._instance.Ii()&&r&&"hidden"!==r.visibilityState&&this._instance.reloadFeatureFlags()}Ci(){var t;if(!this.Ti){var e=null!==(t=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==t?t:3e5;0!==e&&(this.Ti=setInterval((()=>{this.refresh()}),e))}}Si(t){var e;t||lr.error("Failed to fetch remote config from PostHog."),this._instance.Si(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 dr=["fatal","error","warning","log","info","debug"],vr={GZipJS:"gzip-js",Base64:"base64"},cr=Uint8Array,_r=Uint16Array,pr=Uint32Array,fr=new cr([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]),gr=new cr([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]),mr=new cr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),wr=function(t,e){for(var i=new _r(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var s=new pr(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]},br=wr(fr,2),yr=br[1];br[0][28]=258,yr[258]=28;for(var xr=wr(gr,0)[1],Er=new _r(32768),$r=0;32768>$r;++$r){var Sr=(43690&$r)>>>1|(21845&$r)<<1;Er[$r]=((65280&(Sr=(61680&(Sr=(52428&Sr)>>>2|(13107&Sr)<<2))>>>4|(3855&Sr)<<4))>>>8|(255&Sr)<<8)>>>1}var Tr=function(t,e,i){for(var r=t.length,s=0,n=new _r(e);r>s;++s)++n[t[s]-1];var o,a=new _r(e);for(s=0;e>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new _r(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[Er[d]>>>u]=l}else for(o=new _r(r),s=0;r>s;++s)o[s]=Er[a[t[s]-1]++]>>>15-t[s];return o},Rr=new cr(288);for($r=0;144>$r;++$r)Rr[$r]=8;for($r=144;256>$r;++$r)Rr[$r]=9;for($r=256;280>$r;++$r)Rr[$r]=7;for($r=280;288>$r;++$r)Rr[$r]=8;var Pr=new cr(32);for($r=0;32>$r;++$r)Pr[$r]=5;var kr=Tr(Rr,9,0),Or=Tr(Pr,5,0),Ir=function(t){return(t/8>>0)+(7&t&&1)},Mr=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof _r?_r:t instanceof pr?pr:cr)(i-e);return r.set(t.subarray(e,i)),r},Ar=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},Cr=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 cr(0),0];if(1==s){var o=new cr(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 _r(v+1),_=Dr(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 cr(c),_]},Dr=function(t,e,i){return-1==t.s?Math.max(Dr(t.l,e,i+1),Dr(t.r,e,i+1)):e[t.s]=i},Nr=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new _r(++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]},Lr=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Br=function(t,e,i){var r=i.length,s=Ir(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)},Fr=function(t,e,i,r,s,n,o,a,u,l,h){Ar(e,h++,i),++s[256];for(var d=Cr(s,15),v=d[0],c=d[1],_=Cr(n,15),p=_[0],f=_[1],g=Nr(v),m=g[0],w=g[1],b=Nr(p),y=b[0],x=b[1],E=new _r(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=Cr(E,7),R=T[0],P=T[1],k=19;k>4&&!R[mr[k-1]];--k);var O,I,M,A,U=l+5<<3,C=Lr(s,Rr)+Lr(n,Pr)+o,D=Lr(s,v)+Lr(n,p)+o+14+3*k+Lr(E,R)+(2*E[16]+3*E[17]+7*E[18]);if(C>=U&&D>=U)return Br(e,h,t.subarray(u,u+l));if(Ar(e,h,1+(C>D)),h+=2,C>D){O=Tr(v,c,0),I=v,M=Tr(p,f,0),A=p;var N=Tr(R,P,0);for(Ar(e,h,w-257),Ar(e,h+5,x-1),Ar(e,h+10,k-4),h+=14,S=0;k>S;++S)Ar(e,h+3*S,R[mr[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)Ar(e,h,N[z=31&F[S]]),h+=R[z],z>15&&(Ar(e,h,F[S]>>>5&127),h+=F[S]>>>12)}}else O=kr,I=Rr,M=Or,A=Pr;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&&(Ar(e,h,r[S]>>>23&31),h+=fr[z]);var j=31&r[S];Ur(e,h,M[j]),h+=A[j],j>3&&(Ur(e,h,r[S]>>>5&8191),h+=gr[j])}else Ur(e,h,O[r[S]]),h+=I[r[S]];return Ur(e,h,O[256]),h+I[256]},zr=new pr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),jr=function(){for(var t=new pr(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),qr=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function Gr(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 cr(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=Br(u,l,t.subarray(h,d)):(u[h]=!0,l=Br(u,l,t.subarray(h,o)))}else{for(var v=zr[e-1],c=v>>>13,_=8191&v,p=(1<<i)-1,f=new _r(32768),g=new _r(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 pr(25e3),x=new _r(288),E=new _r(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=Fr(t,u,0,y,x,E,T,R,k,h-k,l),R=S=T=0,k=h;for(var U=0;286>U;++U)x[U]=0;for(U=0;30>U;++U)E[U]=0}var C=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+C]==t[h+C-L]){for(var j=0;z>j&&t[h+j]==t[h+j-L];++j);if(j>C){if(C=j,D=L,j>B)break;var q=Math.min(L,j-2),G=0;for(U=0;q>U;++U){var H=h-L+U+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|yr[C]<<18|xr[D];var Y=31&yr[C],V=31&xr[D];T+=fr[Y]+gr[V],++x[257+Y],++E[V],P=h+C,++S}else y[R++]=t[h],++x[t[h]]}}l=Fr(t,u,!0,y,x,E,T,R,k,h-k,l)}return Mr(a,0,r+Ir(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&&qr(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),qr(l,h-8,i.d()),qr(l,h-4,r),l}var Hr=!!o||!!n,Wr="text/plain",Yr=!1,Vr=(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:"")},Jr=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 Ge(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("&")},Kr=(t,e)=>JSON.stringify(t,((t,e)=>"bigint"==typeof e?e.toString():e),e),Xr=t=>{if(t.Or)return t.Or;var{data:e,compression:i}=t;if(e){if(i===vr.GZipJS){var r=Gr(function(t,e){var i=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var r=new cr(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 cr(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 Mr(r,0,s)}(Kr(e)),{mtime:0});return{contentType:Wr,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===vr.Base64){var s=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,((t,e)=>String.fromCharCode(parseInt(e,16))))):t}(Kr(e)),n=(t=>"data="+encodeURIComponent("string"==typeof t?t:Kr(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=Kr(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Qr=t=>{var e,i,r,s=Xr(t);return!s||(i=t.compression,r=Ri(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}:(Yr=!0,{url:Vr(t.url,"compression"),encodedBody:Xr(p({},t,{compression:void 0,Or:void 0}))})},Zr=function(){var t=_((function*(t){var e=Kr(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,{Or:{contentType:Wr,body:r,estimatedSize:r.byteLength}})}));return function(e){return t.apply(this,arguments)}}(),ts=(t,e)=>Jr(t,{_:(new Date).getTime().toString(),ver:v.JS_SDK_VERSION,compression:e}),es=[];n&&es.push({transport:"fetch",method(t){var e,{url:i,encodedBody:r}=Qr(t),{contentType:s,body:o,estimatedSize:u}=null!=r?r:{},l=new Headers;Ge(t.headers,(function(t,e){l.append(e,t)})),s&&l.append("Content-Type",s);var h=null;if(a){var d=new a;h={signal:d.signal,timeout:setTimeout((()=>d.abort()),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){oe.error(t)}null==t.callback||t.callback(r)})))).catch((e=>{oe.error(e),null==t.callback||t.callback({statusCode:0,error:e})})).finally((()=>h?clearTimeout(h.timeout):null))}}),o&&es.push({transport:"XHR",method(t){var e=new o,{url:i,encodedBody:r}=Qr(t);e.open(t.method||"GET",i,!0);var{contentType:s,body:n}=null!=r?r:{};Ge(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&&es.push({transport:"sendBeacon",method(t){try{var{url:e,encodedBody:r}=Qr(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 is=3e3;class rs{constructor(t,e){this.Ei=!0,this.Mi=[],this.Ri=Q((null==e?void 0:e.flush_interval_ms)||is,250,5e3,oe.createLogger("flush interval"),is),this.Pi=t}enqueue(t){this.Mi.push(t),this.Oi||this.Li()}unload(){this.Ai();var t=this.Mi.length>0?this.Fi():{},e=Object.values(t);[...e.filter((t=>0===t.url.indexOf("/e"))),...e.filter((t=>0!==t.url.indexOf("/e")))].map((t=>{this.Pi(p({},t,{transport:"sendBeacon"}))}))}enable(){this.Ei=!1,this.Li()}Li(){var t=this;this.Ei||(this.Oi=setTimeout((()=>{if(this.Ai(),this.Mi.length>0){var e=this.Fi(),i=function(){var i=e[r],s=(new Date).getTime();i.data&&U(i.data)&&Ge(i.data,(t=>{t.offset=Math.abs(t.timestamp-s),delete t.timestamp})),t.Pi(i)};for(var r in e)i()}}),this.Ri))}Ai(){clearTimeout(this.Oi),this.Oi=void 0}Fi(){var t={};return Ge(this.Mi,(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.Mi=[],t}}var ss=["retriesPerformedSoFar"];class ns{constructor(e){this.Ni=!1,this.Di=3e3,this.Mi=[],this._instance=e,this.Mi=[],this.$i=!0,!L(t)&&"onLine"in t.navigator&&(this.$i=t.navigator.onLine,this.qi=()=>{this.$i=!0,this.ji()},this.Bi=()=>{this.$i=!1},Ke(t,"online",this.qi),Ke(t,"offline",this.Bi))}get length(){return this.Mi.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,ss);G(e)&&(i.url=Jr(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.br(p({retriesPerformedSoFar:e},i));0===t.statusCode&&oe.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)}}))}br(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.Mi.push({retryAt:r,requestOptions:t});var s="Enqueued failed request for retry in "+i;navigator.onLine||(s+=" (Browser is offline)"),oe.warn(s),this.Ni||(this.Ni=!0,this.Hi())}Hi(){if(this.Ui&&clearTimeout(this.Ui),0===this.Mi.length)return this.Ni=!1,void(this.Ui=void 0);this.Ui=setTimeout((()=>{this.$i&&this.Mi.length>0&&this.ji(),this.Hi()}),this.Di)}ji(){var t=Date.now(),e=[],i=this.Mi.filter((i=>t>i.retryAt||(e.push(i),!1)));if(this.Mi=e,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Ui&&(clearTimeout(this.Ui),this.Ui=void 0),this.Ni=!1,L(t)||(this.qi&&(t.removeEventListener("online",this.qi),this.qi=void 0),this.Bi&&(t.removeEventListener("offline",this.Bi),this.Bi=void 0)),this.Mi))try{this._instance._send_request(p({},e,{transport:"sendBeacon"}))}catch(t){oe.error(t)}this.Mi=[]}}class os{constructor(t){this.zi=()=>{var t,e,i,r;this.Vi||(this.Vi={});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.Vi.lastScrollY=Math.ceil(n),this.Vi.maxScrollY=Math.max(n,null!==(t=this.Vi.maxScrollY)&&void 0!==t?t:0),this.Vi.maxScrollHeight=Math.max(o,null!==(e=this.Vi.maxScrollHeight)&&void 0!==e?e:0),this.Vi.lastContentY=a,this.Vi.maxContentY=Math.max(a,null!==(i=this.Vi.maxContentY)&&void 0!==i?i:0),this.Vi.maxContentHeight=Math.max(u,null!==(r=this.Vi.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get Wi(){return this._instance.config.scroll_root_selector}getContext(){return this.Vi}resetContext(){var t=this.Vi;return setTimeout(this.zi,0),t}startMeasuringScrollPosition(){Ke(t,"scroll",this.zi,{capture:!0}),Ke(t,"scrollend",this.zi,{capture:!0}),Ke(t,"resize",this.zi)}scrollElement(){if(!this.Wi)return null==t?void 0:t.document.documentElement;var e=U(this.Wi)?this.Wi:[this.Wi];for(var i of e){var r=null==t?void 0:t.document.querySelector(i);if(r)return r}}Gi(e){var i="y"===e?"scrollTop":"scrollLeft";if(this.Wi){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.Gi("y")}scrollX(){return this.Gi("x")}}var as=t=>Bi(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties);class us{constructor(t,e,i,r){this.Zi=t=>{var e=this.Qi();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.Ji(this._instance)};this.Ki.register({[Ee]:i})}},this._instance=t,this.Yi=e,this.Ki=i,this.Ji=r||as,this.Yi.onSessionId(this.Zi)}Qi(){return this.Ki.props[Ee]}getSetOnceProps(){var t,e=null==(t=this.Qi())?void 0:t.props;return e?"r"in e?Fi(e):{$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 Ge(Ye(this.getSetOnceProps()),((e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+O(i)]=e})),t}}class ls{constructor(){this.Xi={}}on(t,e){return this.Xi[t]||(this.Xi[t]=[]),this.Xi[t].push(e),()=>{this.Xi[t]=this.Xi[t].filter((t=>t!==e))}}emit(t,e){for(var i of this.Xi[t]||[])i(e);for(var r of this.Xi["*"]||[])r(t,e)}}var hs=ae("[SessionId]");class ds{on(t,e){return this.en.on(t,e)}constructor(t,e,i){var r;if(this.tn=null,this.rn=[],this.nn=void 0,this.sn=!1,this.en=new ls,this.an=(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===Ae)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Dt=t.config,this.Ki=t.persistence,this.ln=void 0,this.un=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.hn=e||ii,this.cn=i||ii;var s=this.Dt.persistence_name||this.Dt.token;if(this._sessionTimeoutMs=1e3*Q(this.Dt.session_idle_timeout_seconds||1800,60,36e3,hs.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.dn(),this.vn="ph_"+s+"_window_id",this.fn="ph_"+s+"_primary_window_exists",this.pn()){var n=ci.F(this.vn),o=ci.F(this.fn);n&&!o?this.ln=n:ci.q(this.vn),ci.A(this.fn,!0)}if(null!=(r=this.Dt.bootstrap)&&r.sessionID)try{var a=(t=>{var e=this.Dt.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.gn(this.Dt.bootstrap.sessionID,(new Date).getTime(),a)}catch(t){hs.error("Invalid sessionID in bootstrap",t)}this.mn()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return L(this.rn)&&(this.rn=[]),this.rn.push(t),this.un&&t(this.un,this.ln),()=>{this.rn=this.rn.filter((e=>e!==t))}}pn(){return"memory"!==this.Dt.persistence&&!this.Ki.ti&&ci.N()}yn(t){t!==this.ln&&(this.ln=t,this.pn()&&ci.A(this.vn,t))}bn(){return this.ln?this.ln:this.pn()?ci.F(this.vn):null}_n(t){var e=this.tn;return!z(e)&&!z(t)&&5e3>Math.abs(t-e)}gn(t,e,i){var r=e!==this._sessionActivityTimestamp,s=!(t!==this.un||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.un=t,s&&!r||s&&this._n(e)||(this.tn=e,this.Ki.register({[fe]:[e,t,i]}))}wn(){var t,e=null==(t=this.Dt)?void 0:t.persistence_save_debounce_ms;return G(e)&&e>0}xn(){this.wn()?this.Ki.refreshKey(fe):(this.Ki.flush(),this.Ki.load())}kn(){var t;if(!z(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.tn){this.xn();var[,e,i]=this.Sn();e===this.un&&i===this._sessionStartTimestamp&&(this.tn=this._sessionActivityTimestamp,this.Ki.register({[fe]:[this._sessionActivityTimestamp,null!==(t=this.un)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Ki.flush())}}Cn(){var[t]=this.Sn(),e=G(t)?t:0,i=G(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}In(t){return this.xn(),this.an(t,this.Cn())}Sn(){var t=this.Ki.props[fe];return U(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.tn=null,clearTimeout(this.Tn),this.Tn=void 0,this.gn(null,null,null)}destroy(){this.sn=!0,this.kn(),clearTimeout(this.Tn),this.Tn=void 0,this.nn&&t&&(t.removeEventListener(Le,this.nn,{capture:!1}),this.nn=void 0),this.rn=[]}mn(){this.nn=()=>{this.kn(),this.pn()&&ci.q(this.fn)},Ke(t,Le,this.nn,{capture:!1})}checkAndGetSessionAndWindowId(t,e){if(void 0===t&&(t=!1),void 0===e&&(e=null),this.Dt.cookieless_mode===Ae)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=e||(new Date).getTime(),[,r,s]=this.Sn(),n=this.Cn(),o=this.bn(),a=G(s)&&Math.abs(i-s)>864e5,u=!1,l=!1,h=!r,d=r,v=!h&&!t&&this.an(i,n);v&&((v=this.In(i))||hs.info("cross-tab refresh kept the session alive",{sessionId:r}),[,r,s]=this.Sn()),h||v||a?(r=this.hn(),o=this.cn(),hs.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:h,activityTimeout:v,sessionPastMaximumLength:a}}),s=i,u=!0):(o||(o=this.cn(),u=!0),(l=r!==d)&&(hs.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.yn(o),this.gn(r,c,_),t||this.dn();var p={noSessionId:h,activityTimeout:v,sessionPastMaximumLength:a,crossTabAdoption:l};return u&&this.rn.forEach((t=>t(r,o,p))),{sessionId:r,windowId:o,sessionStartTimestamp:_,changeReason:u?p:void 0,lastActivityTimestamp:n}}dn(){this.sn||(clearTimeout(this.Tn),this.Tn=setTimeout((()=>{if(!this.sn)if(this.In((new Date).getTime())){var t=this.un;this.resetSessionId(),this.en.emit("forcedIdleReset",{idleSessionId:t})}else this.dn()}),1.1*this.sessionTimeoutMs))}}function vs(t,e,i){return Kr({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var cs="custom",_s="i.posthog.com",ps=/^\/static\//;class fs{constructor(t){this.En={},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("."+_s,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.En[this.apiHost]||(this.En[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":cs),this.En[this.apiHost]}Mn(t){if(ps.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.Mn(e);if(i)return""+i+e}if(this.region===cs)return this.apiHost+e;var r=_s+e;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var gs=ae("[Surveys]"),ms={ignoreConditions:!1,ignoreDelay:!1,displayType:rr.Popover},ws=ae("[PostHog ExternalIntegrations]"),bs={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class ys{constructor(t){this._instance=t}qr(t,e){var i;null==(i=h.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,(t=>{if(t)return ws.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.qr(bs[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 xs,Es={},$s=0,Ss=()=>{},Ts='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Rs="Surveys module not available",Ps="sanitize_properties is deprecated. Use before_send instead",ks="Invalid value for property_denylist config: ",Os="posthog",Is=!Hr&&-1===(null==l?void 0:l.indexOf("MSIE"))&&-1===(null==l?void 0:l.indexOf("Mozilla")),Ms=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:Je(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Ss,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){oe.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:De,before_send:void 0,request_queue_config:{flush_interval_ms:is},error_tracking:{},_onCapture:Ss},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:pi,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-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)}))(e))},As=[["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 As)L(t[i])||(e[r]=t[i]);var s=He({},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)),U(t.property_blacklist)&&(L(t.property_denylist)?s.property_denylist=t.property_blacklist:U(t.property_denylist)?s.property_denylist=[...t.property_blacklist,...t.property_denylist]:oe.error(ks+t.property_denylist)),s};class Cs{constructor(){this.__forceAllowLocalhost=!1}get Rn(){return this.__forceAllowLocalhost}set Rn(t){oe.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Ds{Pn(t,e){if(t){var i=this.On.indexOf(t);-1!==i&&this.On.splice(i,1)}return this.On.push(e),null==e.initialize||e.initialize(),e}Ln(){return this.config.cookieless_mode===Ae||this.config.cookieless_mode===Me&&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 Cs,this.An=!1,this.version=v.LIB_VERSION,this.Fn=new ls,this.On=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Ms(),this.SentryIntegration=bi,this.sentryIntegration=t=>function(t,e){var i=wi(t,e);return{name:mi,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Nn=!1,this.Dn=null,this.$n=null,this.qn=null,this.scrollManager=new os(this),this.pageViewManager=new yi(this),this.rateLimiter=new ur(this),this.requestRouter=new fs(this),this.consent=new _i(this),this.externalIntegrations=new ys(this);var e=null!==(t=Ds.__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=>oe.info('send "'+(null==t?void 0:t.event)+'"',t)))}init(t,e,i){if(i&&i!==Os){var r,s=null!==(r=Es[i])&&void 0!==r?r:new Ds;return s._init(t,e,i),Es[i]=s,Es[Os][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 oe.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.jn(i.debug),this.Bn=i,this.Hn=[],i.person_profiles?this.$n=i.person_profiles:i.process_person&&(this.$n=i.process_person);var a=Ms(i.defaults),u=Us(i),l=He({},a,u,{name:r,token:o});D(a.rageclick)&&D(u.rageclick)&&(l.rageclick=He({},a.rageclick,u.rageclick)),D(a.session_recording)&&D(u.session_recording)&&(l.session_recording=He({},a.session_recording,u.session_recording)),this.set_config(l),this.config.on_xhr_error&&oe.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:vr.GZipJS;var h=this.Un();this.persistence=new Wi(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Wi(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.zn=new rs((t=>this.Vn(t)),this.config.request_queue_config),this.Wn=new ns(this),this.__request_queue=[];var _=this.Ln();if(_||(this.sessionManager=new ds(this),this.sessionPropsManager=new us(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(oe.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Gn(_)}),0)):(oe.info("Initializing extensions synchronously"),this.Gn(_)),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&oe.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(xe);if(i.bootstrap.isIdentifiedID&&null!=g&&g!==f&&m===Ue)this.identify(f);else if(i.bootstrap.isIdentifiedID&&null!=g&&g!==f&&m===Ce)oe.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(ii()),b=i.bootstrap.isIdentifiedID?w:f;this.persistence.set_property(xe,i.bootstrap.isIdentifiedID?Ce:Ue),this.register({distinct_id:f,$device_id:b})}}if(_)this.register_once({distinct_id:ke,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(ii());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(xe,Ue)}return Ke(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()||ii();t.config.get_device_id=r,i.id()&&(t.register({distinct_id:i.id(),$device_id:r()}),t.persistence.set_property(xe,Ce)),e()},s=i.user();"then"in s&&C(s.then)?s.then(r):r(s)}(t,(()=>{i.register((t=>{Promise&&Promise.resolve||gi.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()||(gi.info("No userId set, resetting PostHog"),t.reset()),e.event.userId&&e.event.userId!==t.get_distinct_id()&&(gi.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,Be),identify:t=>e(t,ze),screen:t=>e(t,"$screen")}})(t)).then((()=>{e()}))}))}(this,(()=>this.Zn())):this.Zn(),C(this.config._onCapture)&&this.config._onCapture!==Ss&&(oe.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(t=>this.config._onCapture(t.event,t)))),this.config.ip&&oe.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}Gn(t){var e,i,r,s,n,o,a,u=performance.now(),l=p({},Ds.__defaultExtensionClasses,this.config.__extensionClasses),h=[];l.featureFlags&&this.On.push(this.featureFlags=null!==(e=this.featureFlags)&&void 0!==e?e:new l.featureFlags(this)),l.exceptions&&this.On.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new l.exceptions(this)),l.historyAutocapture&&this.On.push(this.historyAutocapture=new l.historyAutocapture(this)),l.tracingHeaders&&this.On.push(this.tracingHeaders=new l.tracingHeaders(this)),l.siteApps&&this.On.push(this.siteApps=new l.siteApps(this)),l.sessionRecording&&!t&&this.On.push(this.sessionRecording=new l.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),l.autocapture&&this.On.push(this.autocapture=new l.autocapture(this)),l.surveys&&this.On.push(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new l.surveys(this)),l.logs&&this.On.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new l.logs(this)),l.conversations&&this.On.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new l.conversations(this)),l.productTours&&this.On.push(this.productTours=new l.productTours(this)),l.heatmaps&&this.On.push(this.heatmaps=new l.heatmaps(this)),l.webVitalsAutocapture&&this.On.push(this.webVitalsAutocapture=new l.webVitalsAutocapture(this)),l.exceptionObserver&&this.On.push(this.exceptionObserver=new l.exceptionObserver(this)),l.deadClicksAutocapture&&this.On.push(this.deadClicksAutocapture=new l.deadClicksAutocapture(this,fi)),l.toolbar&&this.On.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new l.toolbar(this)),l.experiments&&this.On.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new l.experiments(this)),this.On.forEach((t=>{t.initialize&&h.push((()=>{null==t.initialize||t.initialize()}))})),h.push((()=>{if(this.Qn){var t=this.Qn;this.Qn=void 0,this.Si(t)}})),this.Jn(h,u)}Jn(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout((()=>{this.Jn(t,e)}),0);var i=t.shift();if(i)try{i()}catch(t){oe.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Oe]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Ie]:r}),this.config.__preview_deferred_init_extensions&&oe.info("PostHog extensions initialized ("+r+"ms)")}Si(t){var e;if(!r||!r.body)return oe.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Si(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Qn=t),this.Kn=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=k(t.supportedCompression,vr.GZipJS)?vr.GZipJS:k(t.supportedCompression,vr.Base64)?vr.Base64:void 0),null!=(e=t.analytics)&&e.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.$n?this.$n:De}),this.On.forEach((e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t)))}Zn(){try{this.config.loaded(this)}catch(t){oe.critical("`loaded` function failed",t)}if(this.Yn(),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.Ln())&&this.Xn()}),1),this.es=new hr(this),this.es.load()}Yn(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.zn)||t.enable())}_dom_loaded(){this.is_capturing()&&qe(this.__request_queue,(t=>this.Vn(t))),this.__request_queue=[],this.Yn()}_handle_unload(){var t,e,i,r;null==(t=this.surveys)||t.handlePageUnload(),this.config.request_batching?(this.ts()&&this.capture(Fe),null==(e=this.logs)||e.flushLogs("sendBeacon"),null==(i=this.zn)||i.unload(),null==(r=this.Wn)||r.unload()):this.ts()&&this.capture(Fe,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded?Is?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=ts(s.url,s.compression);var n=null!==(e=s.transport)&&void 0!==e?e:"fetch",o=es.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===vr.GZipJS&&u&&!Yr?Zr(s).then((t=>{a(t)})).catch((e=>{if(x(e))return Yr=!0,void a(p({},s,{compression:void 0,url:ts(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)&&(Yr=!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}))}Vn(t){this.Wn?this.Wn.retriableRequest(t):this._send_request(t)}_execute_array(t){$s++;try{var e,i=[],r=[],s=[];qe(t,(t=>{if(t)if(U(e=t[0]))s.push(t);else if(C(t))try{t.call(this)}catch(e){oe.error("Error executing queued PostHog call",t,e)}else U(t)&&"alias"===e?i.push(t):U(t)&&-1!==e.indexOf("capture")&&C(this[e])?s.push(t):r.push(t)}));var n=function(t,e){qe(t,(function(t){try{if(U(t[0])){var i=e;Ge(t,(function(t){i=i[t[0]].apply(i,t.slice(1))}))}else e[t[0]].apply(e,t.slice(1))}catch(e){oe.error("Error executing queued PostHog call",t,e)}}))};n(i,this),n(r,this),n(s,this)}finally{$s--}}push(t){if($s>0&&U(t)&&B(t[0])){var e=Ds.prototype[t[0]];C(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.zn){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)&&(oe.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.rs||oe.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,ii),c={uuid:v,event:t,properties:this.calculateEventProperties(t,e||{},d,v)};t===Be&&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.ns(null==i?void 0:i.$set_once,t!==je,t===ze);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),U(e)?(r=[],qe(e,(e=>{r.push(t(e))}))):(r={},Ge(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===er.DISMISSED||t===er.SENT){var b=null==e?void 0:e[ir.SURVEY_ID],y=null==e?void 0:e[ir.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){gs.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===er.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===er.SHOWN&&(c.$set=p({},c.$set,{[ir.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===nr.SHOWN){var x=null==e?void 0:e[or.TOUR_TYPE];x&&(c.$set=p({},c.$set,{[or.TOUR_LAST_SEEN_DATE+"/"+x]:(new Date).toISOString()}))}var E=p({},c.properties.$set,c.$set);if(N(E)||this.setPersonPropertiesForFlags(E),!j(this.config.before_send)){var S=this.mr(c);if(!S)return;(c=S).uuid=se(c.uuid,ii)}this.Fn.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.Vn(T):this.zn.enqueue(T),c}oe.critical("This capture call is ignored due to client rate limiting.")}}else oe.error("No event name provided to posthog.capture")}else oe.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.Ln()&&(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)&&!q(h.distinct_id)||F(h.distinct_id))&&oe.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var c,_=function(e,i,r){var n,o,a,u;if(!l)return{};var h,d,c,_,p,f,g,m,w,b=e?[...Oi,...i||[]]:[],[y,x]=function(t){for(var e=0;ee.length>e;e++){var[i,r]=ee[e],s=i.exec(t),n=s&&(C(r)?r(s,t):r);if(n)return n}return["",""]}(l),E=null!=(h="undefined"!=typeof navigator?navigator:void 0)&&h.brave?{brave:!0}:{},S={detectGoogleSearchApp:r},T=He(Ye({$os:y,$os_version:x,$browser:Qt(l,navigator.vendor,E,S),$device:ie(l),$device_type:(c=l,_={userAgentDataPlatform:null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,maxTouchPoints:null==(o=navigator)?void 0:o.maxTouchPoints,screenWidth:null==t||null==(a=t.screen)?void 0:a.width,screenHeight:null==t||null==(u=t.screen)?void 0:u.height,devicePixelRatio:null==t?void 0:t.devicePixelRatio},w=ie(c),w===st||w===rt||"Kobo"===w||"Kindle Fire"===w||w===Ut?it:w===Et||w===St||w===$t||w===It?"Console":w===ot?"Wearable":w?Z:"Android"===(null==_?void 0:_.userAgentDataPlatform)&&(null!==(p=null==_?void 0:_.maxTouchPoints)&&void 0!==p?p:0)>0?600>Math.min(null!==(f=null==_?void 0:_.screenWidth)&&void 0!==f?f:0,null!==(g=null==_?void 0:_.screenHeight)&&void 0!==g?g:0)/(null!==(m=null==_?void 0:_.devicePixelRatio)&&void 0!==m?m:1)?Z:it:"Desktop"),$timezone:zi(),$timezone_offset:ji()}),{$current_url:Pi(null==s?void 0:s.href,b,Mi),$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,E,S),$browser_language:Di(),$browser_language_prefix:(d=Di(),"string"==typeof d?d.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&&(T.$sdk_dist_channel=v.SDK_DIST_CHANNEL),T}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app);if(this.sessionManager){var{sessionId:f,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(a,n.getTime());h.$session_id=f,h.$window_id=g}this.sessionPropsManager&&He(h,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&He(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(m=this.Wn)?void 0:m.length}catch(t){h.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===cs&&(h.$lib_custom_api_host=this.config.api_host),c=e!==Be||a?e!==Fe||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,o),h=He(h,c),e===Be&&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=He({},_,this.persistence.properties(),this.sessionPersistence.properties(),h)).$is_identified=this._isIdentified(),U(this.config.property_denylist)?Ge(this.config.property_denylist,(function(t){delete h[t]})):oe.error(ks+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(oe.error(Ps),h=b(h,e));var y=this.ss();return h.$process_person_profile=y,y&&!a&&this.os("_calculate_event_properties"),h}ns(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.ss())return t;if(this.An&&!i)return t;var s=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=He({},s,n||{},t||{}),a=this.config.sanitize_properties;return a&&(oe.error(Ps),o=a(o,"$set_once")),e&&(this.An=!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)}ls(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.Fn.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:Rs}),()=>{})}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:Rs})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:Rs})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=ms),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:Rs}}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:Rs})}us(t){return!t||F(t)?(oe.critical("Unique user id has not been set in posthog.identify"),!1):t===ke?(oe.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())||(oe.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 oe.uninitializedWarning("posthog.identify");if(q(t)&&(t=t.toString(),oe.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.us(t)&&this.os("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:t}),this.get_property(de)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),t!==r&&t!==this.get_property(ve)&&(this.unregister(ve),this.register({distinct_id:t}));var s,n=(this.persistence.get_property(xe)||Ue)===Ue;t!==r&&n?(this.persistence.set_property(xe,Ce),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.capture(ze,{distinct_id:t,$anon_distinct_id:r},{$set:e||{},$set_once:i||{}}),this.qn=vs(t,e,i),null==(s=this.featureFlags)||s.setAnonymousDistinctId(r)):(e||i)&&this.setPersonProperties(e,i),t!==r&&(this.reloadFeatureFlags(),this.unregister(be))}}setPersonProperties(t,e){if((t||e)&&this.os("posthog.setPersonProperties")){var i=vs(this.get_distinct_id(),t,e);this.qn!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.qn=i):oe.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(U(t)?t:[t]).filter((t=>B(t)&&t.length>0));0!==i.length&&this.os("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.qn=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 oe.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.os("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(oe.info("reset"),!this.__loaded)return oe.uninitializedWarning("posthog.reset");var h,d=this.get_property(de),v=this.get_property(pe);if(this.consent.reset(),null==(e=this.persistence)||e.clear(),null==(i=this.sessionPersistence)||i.clear(),L(v)||null==(h=this.persistence)||h.register({[pe]:v}),null==(r=this.surveys)||r.reset(),null==(s=this.es)||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(xe,Ue),null==(l=this.sessionManager)||l.resetSessionId(),this.qn=null,this.config.cookieless_mode===Ae)this.register_once({distinct_id:ke,$device_id:null},"");else{var c=this.config.get_device_id(ii());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.hs()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(t=this.conversations)||t.cs()}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(he)?(oe.critical("Attempting to create alias for existing People user - aborting."),-2):this.os("posthog.alias")?(L(e)&&(e=this.get_distinct_id()),t!==e?(this.ls(ve,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(oe.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;He(this.config,Us(t));var _=this.Un();null==(i=this.persistence)||i.update_config(this.config,e,_),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Wi(p({},this.config,{persistence:"sessionStorage"}),_,!1);var f=this.jn(this.config.debug);H(f)&&(this.config.debug=f),H(this.config.debug)&&(this.config.debug?(v.DEBUG=!0,ui.N()&&ui.A("ph_debug",!0),oe.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(v.DEBUG=!1,ui.N()&&ui.q("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.ds(),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:Ds.vs}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:Os;return e!==Os&&(e=Os+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(xe))===Ce||(null==(e=this.sessionPersistence)?void 0:e.get_property(xe))===Ce}ss(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===De&&!this._isIdentified()&&N(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[ve])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Pe]))}ts(){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.ss()||this.os("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.os("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}os(t){return"never"===this.config.person_profiles?(oe.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.ls(Pe,!0),!0)}Un(){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!==Me)}ds(){var t,e,i,r,s=this.Un();return(null==(t=this.persistence)?void 0:t.ti)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(e=this.sessionPersistence)?void 0:e.ti)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Ae){if(this.Ln()){var i,r,s,n,o;this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewManager)||r.destroy(),this.sessionManager=new ds(this),this.pageViewManager=new yi(this),this.persistence&&(this.sessionPropsManager=new us(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=Ds.__defaultExtensionClasses)?void 0:o.sessionRecording;u&&(this.sessionRecording=this.Pn(this.sessionRecording,new u(this)),this.Kn&&(null==(a=this.sessionRecording)||null==a.onRemoteConfig||a.onRemoteConfig(this.Kn)))}var l,h;this.consent.optInOut(!0),this.ds(),this.Yn(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Me&&(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.Xn()}else oe.warn(Ts)}opt_out_capturing(){var t,e,i;this.config.cookieless_mode!==Ae?(this.config.cookieless_mode===Me&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.ds(),this.config.cookieless_mode===Me&&(this.register({distinct_id:ke,$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.Xn(),this.Yn())):oe.warn(Ts)}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===Ae||(this.config.cookieless_mode===Me?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.ds()}_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}Xn(){r&&("visible"===r.visibilityState?this.Nn||(this.Nn=!0,this.capture(Be,{title:r.title},{send_instantly:!0}),this.Dn&&(r.removeEventListener(Ne,this.Dn),this.Dn=null)):this.Dn||(this.Dn=this.Xn.bind(this),Ke(r,Ne,this.Dn)))}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}))}Ii(){var t,e,i,r,s,n,o=this.Bn||{};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?(oe.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=oe,s=(e="advanced_disable_flags")in(t=o)&&!j(t[e]),n=i in t&&!j(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]))}mr(t){var e;if(j(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(V),r=U(this.config.before_send)?this.config.before_send:[this.config.before_send],s=t;for(var n of r){if(s=n(s),j(s)){var o="Event '"+t.event+"' was rejected in beforeSend function";return Y(t.event)?oe.warn(o+". This can cause unexpected behavior."):oe.info(o),null}s.properties&&!N(s.properties)||oe.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of i)if(s.properties&&j(s.properties[a]))return oe.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.Hr)?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)})}jn(t){var e=H(t)&&!t,i=ui.N()&&"true"===ui.P("ph_debug");return!e&&(!!i||t)}}Ds.__defaultExtensionClasses={},Ds.vs={trace:xs=()=>{},debug:xs,info:xs,warn:xs,error:xs,fatal:xs},function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=We(t.prototype[e[i]])}(Ds,["identify"]);var Ns=function(){v.SDK_DIST_CHANNEL="npm";var e=Es[Os]=new Ds;return function(){function e(){e.done||(e.done=!0,Is=!1,Ge(Es,(function(t){t._dom_loaded()})))}null!=r&&r.addEventListener?"complete"===r.readyState?e():Ke(r,"DOMContentLoaded",e,{capture:!1}):t&&oe.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}();export{vr as Compression,sr as DEFAULT_PRODUCT_TOUR_APPEARANCE,rr as DisplaySurveyType,Ds as PostHog,nr as ProductTourEventName,or as ProductTourEventProperties,er as SurveyEventName,ir as SurveyEventProperties,Yi as SurveyEventType,Ji as SurveyPosition,Zi as SurveyQuestionBranchingType,Qi as SurveyQuestionType,tr as SurveySchedule,Ki as SurveyTabPosition,Xi as SurveyType,Vi as SurveyWidgetType,Ns as default,Ns as posthog,dr as severityLevels};
|
|
2
2
|
//# sourceMappingURL=module.slim.js.map
|