posthog-js 1.428.2 → 1.428.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all-external-dependencies.js +1 -1
- package/dist/all-external-dependencies.js.map +1 -1
- package/dist/array.full.es5.js +1 -1
- package/dist/array.full.es5.js.map +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.js.map +1 -1
- package/dist/array.no-external.js +1 -1
- package/dist/array.no-external.js.map +1 -1
- package/dist/customizations.full.js +1 -1
- package/dist/customizations.js +1 -1
- package/dist/default-extensions.js +1 -1
- package/dist/default-extensions.js.map +1 -1
- package/dist/extension-bundles.js +1 -1
- package/dist/extension-bundles.js.map +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/main.js.map +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.js.map +1 -1
- package/dist/module.mjs +1 -1
- package/dist/module.mjs.map +1 -1
- package/dist/module.no-external.js +1 -1
- package/dist/module.no-external.js.map +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/src/extensions/replay/external/lazy-loaded-session-recorder.d.ts +1 -0
- package/lib/package.json +1 -1
- package/lib/src/autocapture.js +6 -1
- package/lib/src/autocapture.js.map +1 -1
- package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.d.ts +1 -0
- package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js +12 -15
- package/lib/src/extensions/replay/external/lazy-loaded-session-recorder.js.map +1 -1
- package/package.json +4 -4
package/dist/module.slim.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var t="u">typeof window?window:void 0,e="u">typeof globalThis?globalThis:t,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,h=null==e?void 0:e.CompressionStream,l=null==i?void 0:i.userAgent,u="undefined"!=typeof globalThis?globalThis:t;u&&"undefined"==typeof self&&(u.self=u),u&&"undefined"==typeof File&&(u.File=function(){});var d=null!=t?t:{},v={DEBUG:!1,LIB_VERSION:"0.8.2",LIB_NAME:"browser-common"};function c(t,e,i,r,s,n,o){try{var a=t[n](o),h=a.value}catch(t){return void i(t)}a.done?e(h):Promise.resolve(h).then(r,s)}function _(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=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],g=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return f.concat(e).some(t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)})};function m(t,e){return-1!==t.indexOf(e)}var b=function(t){return t.replace(/^\$/,"")},w=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),y=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],x=["token"],E=Object.prototype,S=E.hasOwnProperty,T=E.toString,k=Array.isArray||function(t){return"[object Array]"===T.call(t)},R=t=>"function"==typeof t,P=t=>t===Object(t)&&!k(t),I=t=>{if(P(t)){for(var e in t)if(S.call(t,e))return!1;return!0}return!1},O=t=>void 0===t,C=t=>"[object String]"==T.call(t),A=t=>C(t)&&0===t.trim().length,M=t=>null===t,D=t=>O(t)||M(t),N=t=>"[object Number]"==T.call(t)&&t==t,F=t=>N(t)&&t>0,U=t=>"[object Boolean]"===T.call(t),B=t=>m(y,t),L=t=>m(x,t);function j(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Error)}}var z=[!0,"true",1,"1","yes"],q=t=>m(z,t),H=[!1,"false",0,"0","no"];function G(t,e,i,r,s){return e>i&&(r.warn("min cannot be greater than max."),e=i),N(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),G(null!=s?s:i,e,i,r))}var W="Mobile",V="iOS",J="Android",Y="Tablet",K=J+" "+Y,X="iPad",Q="Apple",Z=Q+" Watch",tt="Safari",et="BlackBerry",it="Samsung",rt=it+"Browser",st=it+" Internet",nt="Chrome",ot=nt+" OS",at=nt+" "+V,ht="Internet Explorer",lt=ht+" "+W,ut="Opera",dt=ut+" Mini",vt="Edge",ct="Microsoft "+vt,_t="Firefox",pt=_t+" "+V,ft="Nintendo",gt="PlayStation",mt="Xbox",bt=J+" "+W,wt=W+" "+tt,yt="Windows",$t=yt+" Phone",xt="Nokia",Et="Ouya",St="Generic",Tt=St+" "+W.toLowerCase(),kt=St+" "+Y.toLowerCase(),Rt="Konqueror",Pt="Oculus Browser",It="Vivaldi",Ot="Yandex",Ct="Whale",At="DuckDuckGo",Mt="Pale Moon",Dt="Waterfox",Nt="Brave",Ft="Claude",Ut="Codex",Bt="ChatGPT",Lt="Google Search App",jt="(\\d+(\\.\\d+)?)",zt=new RegExp("Version/"+jt),qt=new RegExp("("+Ft+"|"+Ut+"|"+Bt+")\\/"+jt),Ht=new RegExp(mt,"i"),Gt=new RegExp(gt+" \\w+","i"),Wt=new RegExp(ft+" \\w+","i"),Vt=new RegExp(et+"|PlayBook|BB10","i"),Jt={"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"},Yt=function(t,e,i,r){e=e||"";var s=function(t){return null!=t&&t.brave?Nt:null}(i);return s||(null!=r&&r.detectGoogleSearchApp&&m(t,"GSA/")?Lt:m(t," OPR/")&&m(t,"Mini")?dt:m(t," OPR/")?ut:Vt.test(t)?et:m(t,"IE"+W)||m(t,"WPDesktop")?lt:m(t,"OculusBrowser")?Pt:m(t,rt)?st:m(t,vt)||m(t,"Edg/")?ct:m(t,It+"/")?It:m(t,"YaBrowser/")?Ot:m(t,Ct+"/")?Ct:m(t,At+"/")||m(t,"Ddg/")?At:m(t,Ft+"/")?Ft:m(t,Ut+"/")?Ut:m(t,Bt+"/")?Bt:m(t,"FBIOS")?"Facebook "+W:m(t,"UCWEB")||m(t,"UCBrowser")?"UC Browser":m(t,"CriOS")?at:m(t,"CrMo")||m(t,nt)?nt:m(t,J)&&m(t,tt)?bt:m(t,"FxiOS")?pt:m(t.toLowerCase(),Rt.toLowerCase())?Rt:m(t,Nt+"/")?Nt:((t,e)=>e&&m(e,Q)||function(t){return m(t,tt)&&!m(t,nt)&&!m(t,J)}(t))(t,e)?m(t,W)?wt:tt:m(t,"PaleMoon/")?Mt:m(t,Dt+"/")?Dt:m(t,_t)?_t:m(t,"MSIE")||m(t,"Trident/")?ht:m(t,"Gecko")?_t:"")},Kt={[lt]:[new RegExp("rv:"+jt)],[ct]:[new RegExp(vt+"?\\/"+jt)],[nt]:[new RegExp("("+nt+"|CrMo)\\/"+jt)],[at]:[new RegExp("CriOS\\/"+jt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+jt)],[tt]:[zt],[wt]:[zt],[ut]:[new RegExp("(Opera|OPR)\\/"+jt)],[_t]:[new RegExp(_t+"\\/"+jt)],[pt]:[new RegExp("FxiOS\\/"+jt)],[Rt]:[new RegExp("Konqueror[:/]?"+jt,"i")],[et]:[new RegExp(et+" "+jt),zt],[bt]:[new RegExp("android\\s"+jt,"i")],[st]:[new RegExp(rt+"\\/"+jt)],[Pt]:[new RegExp("OculusBrowser\\/"+jt)],[It]:[new RegExp(It+"\\/"+jt)],[Ot]:[new RegExp("YaBrowser\\/"+jt)],[Ct]:[new RegExp(Ct+"\\/"+jt)],[Nt]:[new RegExp(Nt+"\\/"+jt)],[Ft]:[qt],[Ut]:[qt],[Bt]:[qt],[At]:[new RegExp("(DuckDuckGo|Ddg)\\/"+jt)],[Mt]:[new RegExp("PaleMoon\\/"+jt)],[Dt]:[new RegExp(Dt+"\\/"+jt)],[Lt]:[new RegExp("GSA\\/"+jt)],[ht]:[new RegExp("(rv:|MSIE )"+jt)],Mozilla:[new RegExp("rv:"+jt)]},Xt=function(t,e,i,r){var s=Yt(t,e,i,r),n=Kt[s];if(O(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},Qt=[[new RegExp(mt+"; "+mt+" (.*?)[);]","i"),t=>[mt,t&&t[1]||""]],[new RegExp(ft,"i"),[ft,""]],[new RegExp(gt,"i"),[gt,""]],[Vt,[et,""]],[new RegExp(yt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[$t,""];if(new RegExp(W).test(e)&&!/IEMobile\b/.test(e))return[yt+" "+W,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Jt[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[yt,r]}return[yt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[V,[t[3],t[4],t[5]||"0"].join(".")]:[V,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=O(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+J+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+J+")","i"),t=>t&&t[2]?[J,[t[2],t[3],t[4]||"0"].join(".")]:[J,""]],[/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/,[ot,""]],[/Linux|debian/i,["Linux",""]]],Zt=function(t){return Wt.test(t)?ft:Gt.test(t)?gt:Ht.test(t)?mt:new RegExp(Et,"i").test(t)?Et:new RegExp("("+$t+"|WPDesktop)","i").test(t)?$t:/iPad/.test(t)?X:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Z:Vt.test(t)?et:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(xt,"i").test(t)?xt:/(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(W).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)?J:K:new RegExp("(pda|"+W+")","i").test(t)?Tt:new RegExp(Y,"i").test(t)&&!new RegExp(Y+" pc","i").test(t)?kt:""},te=/\bFBAV\/(\d+(?:\.\d+)*)/i,ee=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",te],[/\bFBAN\/EMA\b/i,"Facebook Lite",te],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",te],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],ie=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function re(t,e){return"string"==typeof(i=t)&&ie.test(i)?t:e();var i}function se(t,e){var i=new Error(e);try{Object.defineProperty(i,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return i}function ne(t){return t?t.split("#")[0]:t}var oe,ae=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],he="NativeGzipValidationError",le=t=>t.length>=2&&31===t[0]&&139===t[1],ue=(t,e)=>t===w.GZipJS||e===w.GZipJS||"gzip"===e,de=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),ve=t=>{throw se(he,"Native gzip produced invalid output: "+t)},ce=function(){var t=_(function*(t,e){18>t.size&&ve("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());le(i)&&8===i[2]||ve("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(oe)return oe;oe=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;oe[t]=e>>>0}return oe})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&ve("invalid-crc");var s=e.length>>>0;r.getUint32(4,!0)!==s&&ve("invalid-size")});return function(e,i){return t.apply(this,arguments)}}();function _e(){return _e=_(function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),s=new globalThis.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(),h=(yield Promise.all([a,o]))[0];return yield ce(h,r),h}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),_e.apply(this,arguments)}var pe=function(e,i){var r=(void 0===i?{}:i).debugEnabled,s={Et(i){if(t&&(v.DEBUG||t.POSTHOG_DEBUG||r)&&!O(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.Et("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.Et("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.Et("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.Et("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)=>pe(e+" "+t,i)};return s},fe=pe("[PostHog.js]"),ge=fe.createLogger,me=ge("[ExternalScriptsLoader]"),be=t=>{var e=null==r?void 0:r.querySelectorAll("script");if(e)for(var i=0;e.length>i;i++)if(e[i].src===t||e[i].getAttribute("src")===t)return e[i]},we=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return me.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=be(e);if(s){if(s.__posthog_loading_callback_fired)return i();var n=s.__posthog_loading_error;return n?i(n):(s.addEventListener("load",t=>{s.__posthog_loading_callback_fired=!0,i(void 0,t)}),void s.addEventListener("error",t=>{s.__posthog_loading_error=t,i(t)}))}var o=()=>{if(!r)return i("document not found");if(be(e))return we(t,e,i);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=>{s.__posthog_loading_error=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?o():null==r||r.addEventListener("DOMContentLoaded",o)},ye={},$e=(t,e)=>{var i="/static/"+e+".js?v="+t.version;if("toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",i)};d.__PosthogExtensions__=d.__PosthogExtensions__||{},d.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r=t.config.strict_script_versioning;if(r){var s=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),n=ye[s];if("fallback"===r&&n){if(be(n))return void we(t,n,i);delete ye[s]}we(t,s,"fallback"===r?(r,n)=>{if(r)if("string"==typeof r)i(r);else{var o,a=$e(t,e);ye[s]=a;var h=be(s);null==h||null==(o=h.parentNode)||o.removeChild(h),we(t,a,i)}else i(void 0,n)}:i)}else we(t,$e(t,e),i)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");we(t,o,i)}},d.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);we(t,r,i)};v.DEBUG=!1,v.LIB_VERSION="1.428.2",v.LIB_NAME="web";var xe="$people_distinct_id",Ee="distinct_id",Se="$device_id",Te="$device_model",ke="__alias",Re="__cmpns",Pe="$fbc",Ie="$fbc_persistence",Oe="__timers",Ce="$autocapture_disabled_server_side",Ae="$heatmaps_enabled_server_side",Me="$exception_capture_enabled_server_side",De="$error_tracking_suppression_rules",Ne="$error_tracking_capture_extension_exceptions",Fe="$web_vitals_enabled_server_side",Ue="$dead_clicks_enabled_server_side",Be="$product_tours_enabled_server_side",Le="$logs_capture_enabled_server_side",je="$web_vitals_allowed_metrics",ze="$session_recording_remote_config",qe="$session_recording_enabled_server_side",He="$replay_sample_rate",Ge="$replay_override_sampling",We="$replay_override_linked_flag",Ve="$replay_override_url_trigger",Je="$replay_override_event_trigger",Ye="$sesid",Ke="$session_is_sampled",Xe="$session_past_minimum_duration",Qe="$session_recording_url_trigger_activated_session",Ze="$session_recording_event_trigger_activated_session",ti="$debug_first_full_snapshot_timestamp",ei="$sess_rec_flush_size",ii="$enabled_feature_flags",ri="$active_feature_flags",si="$early_access_features",ni="$feature_flag_details",oi="$feature_flag_payloads",ai="$feature_flag_request_id",hi="$minimal_flag_called_events",li="$override_feature_flags",ui="$override_feature_flag_payloads",di="$stored_person_properties",vi="$stored_group_properties",ci="$groups",_i="$surveys",pi="$surveys_loaded_at",fi="$surveys_activated",gi="$surveys_activated_session",mi="$surveys_activated_timestamps",bi="ph_product_tours",wi="$product_tours_activated",yi="$product_tours_activated_session",$i="$conversations_widget_session_id",xi="$conversations_ticket_id",Ei="$conversations_widget_state",Si="$conversations_user_traits",Ti="$flag_call_reported",ki="$flag_call_reported_session_id",Ri="$feature_flag_errors",Pi="$feature_flag_evaluated_at",Ii="$user_state",Oi="$client_session_props",Ci="$capture_rate_limit",Ai="$initial_campaign_params",Mi="$initial_referrer_info",Di="$initial_person_info",Ni="$epp",Fi="$posthog_cookieless",Ui="$cookieless_mode",Bi="$sdk_debug_extensions_init_method",Li="$sdk_debug_extensions_init_time_ms",ji="$sdk_debug_recording_script_not_loaded",zi="$sdk_debug_replay_event_trigger_status",qi="$sdk_debug_replay_linked_flag_trigger_status",Hi="$sdk_debug_replay_matched_recording_trigger_groups",Gi="$sdk_debug_replay_pending_trigger_conditions",Wi="$sdk_debug_replay_remote_trigger_matching_config",Vi="$sdk_debug_replay_trigger_groups_count",Ji="$sdk_debug_replay_url_trigger_status",Yi="$session_recording_start_reason",Ki="on_reject",Xi="always",Qi="anonymous",Zi="identified",tr="identified_only",er="visibilitychange",ir="beforeunload",rr="$pageview",sr="$pageleave",nr="$identify",or="$groupidentify";function ar(t,e){k(t)&&t.forEach(e)}function hr(t,e){if(!D(t))if(k(t))t.forEach(e);else if((t=>t instanceof FormData)(t))t.forEach((t,i)=>e(t,i));else for(var i in t)S.call(t,i)&&e(t[i],i)}var lr=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},ur=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){fe.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),fe.critical(t)}}},dr=function(t){var e={};return hr(t,function(t,i){(C(t)&&t.length>0||N(t))&&(e[i]=t)}),e};function vr(t){var e=p({},t);for(var i of["name","message","stack","cause","errors"])try{i in t&&(e[i]=t[i])}catch(t){}return e}var cr=["herokuapp.com","vercel.app","netlify.app"];function _r(t){var e=null==t?void 0:t.hostname;if(!C(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of cr)if(i===r)return!1;return!0}function pr(t,e,i,r){var s=null!=r?r:{},n=s.capture,o=s.passive;null==t||t.addEventListener(e,i,{capture:void 0!==n&&n,passive:void 0===o||o})}var fr=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}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return N(t)&&isFinite(t)&&Math.floor(t)===t});class gr{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/256,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 gr(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 gr(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 mr{generate(){var t=this.generateOrAbort();if(!O(t))return t;this.v=0;var e=this.generateOrAbort();if(O(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t,e=(t=Date.now(),N(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0);if(e>this.v)this.v=e,this.lt();else{if(this.v>=e+1e4)return;this.gt++,this.gt>4398046511103&&(this.v++,this.lt())}return gr.fromFieldsV7(this.v,Math.trunc(this.gt/Math.pow(2,30)),this.gt&Math.pow(2,30)-1,this.eo.nextUint32())}lt(){this.gt=1024*this.eo.nextUint32()+(1023&this.eo.nextUint32())}constructor(){this.v=0,this.gt=0,this.eo=new yr}}var br,wr=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!O(t.crypto)&&crypto.getRandomValues&&(wr=t=>crypto.getRandomValues(t));class yr{nextUint32(){return this.cs.length>this.io||(wr(this.cs),this.io=0),this.cs[this.io++]}constructor(){this.cs=new Uint32Array(8),this.io=1/0}}var $r=()=>xr().toString(),xr=()=>(br||(br=new mr)).generate(),Er="",Sr=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Tr=null,kr={ro(){if(!M(Tr))return Tr;if(Tr=!1,r)try{var t="__ph_cookie_support_"+$r();kr.gr(t,"xyz"),Tr='"xyz"'===fr(t),kr.mr(t)}catch(t){Tr=!1}return Tr},so(t){fe.error("cookieStore error: "+t)},no:fr,oo(t){var e;try{e=JSON.parse(kr.no(t))||{}}catch(t){}return e},gr(t,e,i,s,n){if(!r)return!1;try{var o="",a="",h=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),Er)return Er;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_"+$r();!Er&&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",Er=o)}return Er}(t);if(!i){var s=(t=>{var e=t.match(Sr);return e?e[0]:""})(t);s!==i&&fe.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 u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+h+a;return u.length>3686.4&&fe.warn("cookieStore warning: large cookie, len="+u.length),r.cookie=u,!0}catch(t){return!1}},mr(t,e){if(null!=r&&r.cookie)try{kr.gr(t,"",-1,e)}catch(t){return}}},Rr=null,Pr={ro(){if(!M(Rr))return Rr;var e=!0;if(O(t))e=!1;else try{var i="__mplssupport__";Pr.gr(i,"xyz"),'"xyz"'!==Pr.no(i)&&(e=!1),Pr.mr(i)}catch(t){e=!1}return e||fe.error("localStorage unsupported; falling back to cookie store"),Rr=e,e},so(t){fe.error("localStorage error: "+t)},no(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){Pr.so(t)}return null},oo(t){try{return JSON.parse(Pr.no(t))||{}}catch(t){}return null},gr(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){Pr.so(t)}return!1},mr(e){try{null==t||t.localStorage.removeItem(e)}catch(t){Pr.so(t)}}},Ir=[di,ri,ii,ni,oi,ai,Pi,Ri,Ti],Or=[Se,Ee,Ye,Ke,Ni,Di,Ie,Ii],Cr=t=>t+"_cpm",Ar=["__proto__","constructor","prototype"],Mr=t=>{if(!P(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===Ar.indexOf(i)&&(e[i]=t[i])}),e},Dr=function(t,e){void 0===e&&(e=[]);var i={};return[...Or,...e].forEach(e=>{var r=t[e];O(r)||M(r)||""===r||(i[e]=r)}),i},Nr=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var s=t.charCodeAt(r);e=33*e^s,i=Math.imul(i^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},Fr=(t,e)=>({p:e,f:Nr(JSON.stringify(t))}),Ur=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=kr.oo(Cr(t)),r=(null==i?void 0:i.f)===Nr(e)&&k(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Br=(t,e)=>e+"|"+(kr.no(Cr(t))||""),Lr={},jr={ro:()=>!0,so(t){fe.error("memoryStorage error: "+t)},no:t=>t in Lr?Lr[t]:null,oo:t=>t in Lr?Lr[t]:null,gr:(t,e)=>(Lr[t]=e,!0),mr(t){delete Lr[t]}},zr=null,qr={ro(){if(!M(zr))return zr;if(zr=!0,O(t))zr=!1;else try{var e="__support__";qr.gr(e,"xyz"),'"xyz"'!==qr.no(e)&&(zr=!1),qr.mr(e)}catch(t){zr=!1}return zr},so(t){fe.error("sessionStorage error: ",t)},no(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){qr.so(t)}return null},oo(t){try{return JSON.parse(qr.no(t))||null}catch(t){}return null},gr(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){qr.so(t)}return!1},mr(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){qr.so(t)}}};class Hr{constructor(t){this._instance=t}get P(){return this._instance.config}get consent(){return this.ao()?0:this.ho}isOptedOut(){return this.P.cookieless_mode===Xi||this.isRejected()||-1===this.consent&&this.P.cookieless_mode===Ki}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.P.opt_out_capturing_by_default}optInOut(t){this.lo.gr(this.uo,t?1:0,this.P.cookie_expiration,this.P.cross_subdomain_cookie,this.P.secure_cookie)}reset(){this.lo.mr(this.uo,this.P.cross_subdomain_cookie)}get uo(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get ho(){var t=this.lo.no(this.uo);return q(t)?1:m(H,t)?0:-1}get lo(){var t=this.P.opt_out_capturing_persistence_type,e="localStorage"===t?Pr:kr,i=e.ro()?e:jr;if(!this.do||this.do!==i){this.do=i;var r="localStorage"===t?kr:Pr;r.no(this.uo)&&(this.do.no(this.uo)||this.optInOut(q(r.no(this.uo))),r.mr(this.uo,this.P.cross_subdomain_cookie))}return this.do}ao(){return!!this.P.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,d.doNotTrack,null==i?void 0:i.globalPrivacyControl].some(t=>q(t))}}var Gr=["next","previous","prev",">","<","+","-","−","–"];ge("[Dead Clicks]");var Wr=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Ue)),r=t.instance.config.capture_dead_clicks;return U(r)?r:!!P(r)||i},Vr=ge("[SegmentIntegration]");function Jr(t,e,i){void 0===i&&(i=!0);var r=t.config.segment;if(!r)return e();!function(t,e,i){var r=t.config.segment;if(!r)return e();var s=r=>{var s=()=>r.anonymousId()||$r();t.config.get_device_id=s,i&&r.id()&&(t.register({distinct_id:r.id(),$device_id:s()}),t.persistence.set_property(Ii,Zi)),e(i?void 0:r.anonymousId()||void 0)},n=r.user();"then"in n&&R(n.then)?n.then(s):s(n)}(t,i=>{r.register(((t,e)=>{"undefined"!=typeof Promise&&Promise.resolve||Vr.warn("This browser does not have Promise support, and can not use the segment integration");var i=(i,r)=>{if(!r)return i;var s=!!e&&i.event.anonymousId===e&&!i.event.userId;s||i.event.userId||i.event.anonymousId===t.get_distinct_id()||(Vr.info("No userId set, resetting PostHog"),t.reset()),s||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(Vr.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var n=t.calculateEventProperties(r,i.event.properties);return i.event.properties=Object.assign({},n,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return i(t,t.event.event)},page(t){return i(t,rr)},identify(t){return i(t,nr)},screen(t){return i(t,"$screen")}}})(t,i)).then(()=>{e()},t=>{Vr.error("Failed to register the Segment integration",t),e()})},i)}var Yr="posthog-js";function Kr(t,e){var i=void 0===e?{}:e,r=i.organization,s=i.projectId,n=i.prefix,o=i.severityAllowList,a=void 0===o?["error"]:o,h=i.sendExceptionsToPostHog,l=void 0===h||h;return e=>{var i,o,h,u,d;if("*"!==a&&!a.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==(i=e.exception)?void 0:i.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==(o=_[0])?void 0:o.value)||e.message,$exception_type:null==(h=_[0])?void 0:h.type,$exception_level:e.level,$exception_list:f,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(u=_[0])?void 0:u.value)||e.message,$sentry_exception_type:null==(d=_[0])?void 0:d.type,$sentry_tags:e.tags};return r&&s&&(g.$sentry_url=(n||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+e.event_id),l&&(null==(c=t.exceptions)||c.sendExceptionEvent(g)),e}}class Xr{constructor(t,e,i,r,s,n){this.name=Yr,this.setupOnce=function(o){o(Kr(t,{organization:e,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class Qr{constructor(t){this.vo=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(fe.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.co=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this._o()}_o(){var t;this.po=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.vo)}destroy(){var t;null==(t=this.po)||t.call(this),this.po=void 0}doPageView(e,i){var r,s=this.fo(e,i);return this.co={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.fo(t,null==(e=this.co)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.co)?void 0:t.pageViewId}}fo(t,e){var i=this.co;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var n=s.maxScrollHeight,o=s.lastScrollY,a=s.maxScrollY,h=s.maxContentHeight,l=s.lastContentY,u=s.maxContentY;if(!(O(n)||O(o)||O(a)||O(h)||O(l)||O(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),h=Math.ceil(h),l=Math.ceil(l),u=Math.ceil(u);var d=n>1?G(o/n,0,1,fe):1,v=n>1?G(a/n,0,1,fe):1,c=h>1?G(l/h,0,1,fe):1,_=h>1?G(u/h,0,1,fe):1;r=lr(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var Zr=["flags","surveys"],ts={[xe]:{exposure:"hidden"},[ke]:{exposure:"hidden"},[Re]:{exposure:"hidden"},[Oe]:{exposure:"hidden"},[Ie]:{exposure:"hidden"},[Ce]:{exposure:"event"},[Ae]:{exposure:"hidden"},[Le]:{exposure:"hidden"},[Me]:{exposure:"event"},[De]:{exposure:"hidden"},[Ne]:{exposure:"event"},[Fe]:{exposure:"event"},[Ue]:{exposure:"event"},[Be]:{exposure:"hidden"},[je]:{exposure:"event"},[ze]:{exposure:"hidden"},[qe]:{exposure:"hidden"},[Ye]:{exposure:"hidden"},[Ke]:{exposure:"event"},[He]:{exposure:"event",shouldSkipFromEventProperties:t=>M(t)},[Xe]:{exposure:"event"},[Qe]:{exposure:"event"},[Ze]:{exposure:"event"},[ti]:{exposure:"event"},[ei]:{exposure:"hidden"},[ii]:{exposure:"hidden",storageGroup:"flags"},[ri]:{exposure:"hidden",storageGroup:"flags"},[si]:{exposure:"hidden"},[ni]:{exposure:"hidden",storageGroup:"flags"},[oi]:{exposure:"hidden",storageGroup:"flags"},[ai]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[hi]:{exposure:"hidden",storageGroup:"flags"},[li]:{exposure:"hidden"},[ui]:{exposure:"hidden"},[di]:{exposure:"hidden"},[vi]:{exposure:"hidden"},[_i]:{exposure:"hidden",storageGroup:"surveys"},[pi]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[fi]:{exposure:"event"},[gi]:{exposure:"hidden"},[mi]:{exposure:"hidden"},[bi]:{exposure:"hidden"},[wi]:{exposure:"hidden"},[yi]:{exposure:"hidden"},[$i]:{exposure:"event"},[xi]:{exposure:"event"},[Ei]:{exposure:"event"},[Si]:{exposure:"event"},[Ti]:{exposure:"hidden"},[ki]:{exposure:"hidden"},[ci]:{exposure:"event"},[Ri]:{exposure:"hidden"},[Pi]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ii]:{exposure:"hidden"},[Oi]:{exposure:"hidden"},[Ci]:{exposure:"hidden"},[Ai]:{exposure:"hidden"},[Mi]:{exposure:"hidden"},[Di]:{exposure:"hidden"},[Ni]:{exposure:"hidden"},[Ge]:{exposure:"event"},[We]:{exposure:"event"},[Ve]:{exposure:"event"},[Je]:{exposure:"event"},[Bi]:{exposure:"event"},[Li]:{exposure:"event"},[ji]:{exposure:"event"},[zi]:{exposure:"event"},[qi]:{exposure:"event"},[Hi]:{exposure:"event"},[Gi]:{exposure:"event"},[Wi]:{exposure:"event"},[Vi]:{exposure:"event"},[Ji]:{exposure:"event"},[Yi]:{exposure:"event"}},es=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],is=t=>{var e=ts[t];if(e)return e;for(var i of es){var r=i[1];if(0===t.indexOf(i[0]))return r}},rs=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>j(e)?(null!=i||(i=new WeakMap),i.has(e)||i.set(e,vr(e)),i.get(e)):"bigint"==typeof e?e.toString():e,e)}catch(e){return s=[],null!==(r=JSON.stringify(t,function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(e))return"[Circular]";s.push(e)}return e}}))&&void 0!==r?r:"null"}var r,s},ss=t=>{var e=null==r?void 0:r.createElement("a");return O(e)?null:(e.href=t,e)},ns=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(!k(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){fe.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},os=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],n=(r[0]||"").split("?"),o=n[1],a=n[0],h=(o||"").split("&"),l=[],u=0;h.length>u;u++){var d=h[u].split("=");k(d)&&(e.includes(d[0])?l.push(d[0]+"="+i):l.push(h[u]))}var v=a;return null!=o&&(v+="?"+l.join("&")),null!=s&&(v+="#"+s),v},as="https?://(.*)",hs=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ls=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...hs],us="<masked>",ds=["li_fat_id"];function vs(t,e){var i=ls.concat(e||[]),r={};return hr(i,function(e){var i=ns(t,e);r[e]=i||null}),r}function cs(t){var e=function(t){return t?0===t.search(as+"google.([^/?]*)")?"google":0===t.search(as+"bing.com")?"bing":0===t.search(as+"yahoo.com")?"yahoo":0===t.search(as+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",s={};if(!M(e)){s.$search_engine=e;var n=r?ns(r.referrer,i):"";n.length&&(s.ph_keyword=n)}return s}function _s(){return navigator.language||navigator.userLanguage}var ps="$direct";function fs(){return(null==r?void 0:r.referrer)||ps}function gs(t,e,i){void 0===i&&(i=!1);var r=t?[...hs,...e||[]]:[],n=i?ne(null==s?void 0:s.href):null==s?void 0:s.href,o=null==n?void 0:n.substring(0,1e3);return{r:fs().substring(0,1e3),u:o?os(o,r,us):void 0}}function ms(t,e){var i;void 0===e&&(e=!1);var r=t.r,s=t.u,n=e?ne(s):s,o={$referrer:r,$referring_domain:null==r?void 0:r==ps?ps:null==(i=ss(r))?void 0:i.host};if(n){o.$current_url=n;var a=ss(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var h=vs(n);lr(o,h)}if(r){var l=cs(r);lr(o,l)}return o}function bs(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function ws(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var ys={flags:Pi,surveys:pi},$s=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],xs=t=>t+"_cookie_identity_change_pending",Es=t=>{var e="",i=0;for(var r of t){var s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+s>1e3)break;e+=r,i+=s}return e},Ss="main",Ts=[ii,ri,ni,oi,ai,Pi,hi,di],ks=t=>-1!==Ts.indexOf(t),Rs=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},Ps=t=>{if(!t)return{};var e=JSON.parse(t);return P(e)?e:{}},Is=(t,e)=>{hr(t,(i,r)=>{var s=is(r);s&&"event"!==s.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})};class Os{constructor(e,i,r){if(void 0===r&&(r=!0),this.mo={},this.bo=!1,this.wo=!1,this.yo=!1,this.$o=!1,this.xo=!1,this.Eo=new Map,this.So=!1,this.To=!1,this.ko=!1,this.Ro=!1,this.Po=new Set,this.P=e,this.Io=r,this.props={},this.Oo=void 0,this.Co=(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.lo=this.Ao(e),this.yo=this.Mo(e),this.load(),this.Do(),e.debug&&fe.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var s=()=>this.flush();pr(t,"beforeunload",s,{capture:!1}),pr(t,"pagehide",s,{capture:!1}),this.No=e=>{if(this.bo&&(!e.storageArea||e.storageArea===(null==t?void 0:t.localStorage))&&e.key)if(e.key!==this.Co){if(this.yo){var i=Zr.find(t=>e.key===this.Fo(t));i&&this.Uo(e.key,i)}}else this.Uo(e.key,Ss)},pr(t,"storage",this.No)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.Eo.get(e);if(ks(e)&&!0!==r)if(!0!==i){var s=new Set(r||[]);i.forEach(t=>s.add(t)),s.size&&this.Bo(e,s)}else this.Bo(e,!0)})}onCrossTabFeatureFlagChange(t){return this.Po.add(t),()=>this.Po.delete(t)}destroy(){this.No&&t&&(t.removeEventListener("storage",this.No),this.No=void 0),this.Po.clear()}Uo(t,e,i){if(void 0===i&&(i=!0),this.Lo)return!1;var r,s;try{if(s=Pr.no(t),M(s)){var n=this.jo(e);return n.storageValue=null,e!==Ss&&(n.persisted=!1),!1}r=Ps(s)}catch(t){return!1}var o=e===Ss?r:Pr.oo(this.Co);if(o&&this.zo(o))return!1;var a=this.qo(r,e,i);return e===Ss&&this.yo&&!Rs(this.Ho().main,r)||this.Go(r,e,!0,s),a}zo(t){var e=this.props[Ee],i=t[Ee];return!O(e)&&!O(i)&&e!==i}Go(t,e,i,r){var s=this.jo(e);s.storageValue=r,e!==Ss&&(s.persisted=i);try{s.fingerprint=this.Wo(t,e)}catch(t){s.fingerprint=void 0}}qo(t,e,i){var r=!1;return Ts.forEach(i=>{var s,n=null==(s=is(i))?void 0:s.storageGroup;if(!(e===Ss&&this.yo&&n||e!==Ss&&n!==e)){var o=i in t,a=this.Vo(i,o?t[i]:void 0),h=this.Eo.has(i)?i in this.props:o;h===i in this.props&&Rs(a,this.props[i])||(h?this.Jo(i,a,!1):this.Yo(i,!1),r=!0)}}),r&&i&&this.Po.forEach(t=>t()),r}Ko(){if(!this.bo)return!1;try{this.ko=!1;var t,e=Pr.no(this.Co),i=this.jo(Ss),r=!1,s=!1;if(e!==i.storageValue)if(M(e))i.storageValue=null;else{if(t=Ps(e),this.ko=!this.To&&this.zo(t),this.ko)return!1;s=this.qo(t,Ss,!1),!this.yo||Rs(this.Ho().main,t)?this.Go(t,Ss,!0,e):i.storageValue=e,r=!0}return this.yo&&Zr.forEach(e=>{var i=Pr.no(this.Fo(e)),n=this.jo(e),o=t||{},a=r&&Ts.some(t=>{var i;return(null==(i=is(t))?void 0:i.storageGroup)===e&&t in o});if(i!==n.storageValue||a){if(M(i))return n.storageValue=null,n.persisted=!1,void(a&&(s=this.qo(o,e,!1)||s));var h=Ps(i);s=this.qo(h,e,!1)||s,this.Go(h,e,!0,i)}}),s}catch(t){return!1}}Bo(t,e){this.Eo.set(t,e);var i=is(t);null!=i&&i.volatile||(this.jo((this.yo?null==i?void 0:i.storageGroup:void 0)||Ss).fingerprint=void 0,this.Xo(t))}Qo(){Ts.forEach(t=>this.Eo.set(t,!0))}Do(){if(this.bo)try{var t=Pr.no(this.Co),e=Ps(t);this.jo(Ss).storageValue=t,Ts.forEach(t=>{var i,r=this.yo?null==(i=is(t))?void 0:i.storageGroup:void 0,s=r?Pr.no(this.Fo(r)):null;if(r){var n=this.jo(r);n.storageValue=s,n.persisted=!M(s)}var o=r&&!M(s)?Ps(s):e;t in this.props?this.Zo(t,o[t],this.props[t]):t in o&&this.Bo(t,!0)})}catch(t){}}Vo(t,e){var i=this.Eo.get(t);if(!i)return e;if(!0===i)return this.props[t];if(t===ri){var r=new Set(k(e)?e:[]),s=new Set(k(this.props[t])?this.props[t]:[]);return i.forEach(t=>s.has(t)?r.add(t):r.delete(t)),Array.from(r)}var n=P(e)?p({},e):{},o=P(this.props[t])?this.props[t]:{};return i.forEach(t=>{t in o?n[t]=o[t]:delete n[t]}),n}Zo(t,e,i){if(ks(t)){var r=this.Eo.get(t);if(!0!==r){var s=e;if(this.bo)try{var n,o=this.yo?null==(n=is(t))?void 0:n.storageGroup:void 0,a=o?this.Fo(o):this.Co;s=Ps(Pr.no(a))[t]}catch(t){}var h=new Set(r||[]);if(t===ri){if(!O(e)&&!k(e)||!O(s)&&!k(s)||!k(i))return void this.Bo(t,!0);var l=new Set(e||[]),u=new Set(s||[]),d=new Set(i);new Set([...l,...d]).forEach(t=>{l.has(t)!==d.has(t)&&h.add(t)}),h.forEach(t=>{u.has(t)===d.has(t)&&h.delete(t)})}else{if(!P(i))return void(Rs(s,i)?this.Eo.delete(t):this.Bo(t,!0));if(!O(e)&&!P(e)||O(e)&&I(i)&&O(s))return void this.Bo(t,!0);var v=P(e)?e:{},c=P(s)?s:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&Rs(v[t],i[t])||h.add(t)}),h.forEach(t=>{t in c==t in i&&Rs(c[t],i[t])&&h.delete(t)})}h.size?this.Bo(t,h):this.Eo.delete(t)}}}_a(){var t,e=null==(t=this.P)?void 0:t.persistence_save_debounce_ms;return N(e)&&e>0?e:0}ma(t){if(this.P.cookieWinsOnConflict&&"localstorage+cookie"===this.P.persistence.toLowerCase())if(t)try{var e=Dr(t,this.P.cookie_persisted_properties||[]),i=Fr(e,this.P.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),s=kr.no(this.Co)||void 0;s&&Br(this.Co,s)===r&&(this.ba=r,this.wa=s)}catch(t){}else try{var n=kr.no(this.Co)||void 0;this.ba=n?Br(this.Co,n):void 0,this.wa=n}catch(t){}}syncCookieProperties(){return this.ya(this.P)}ya(t,e){if(void 0===e&&(e=!1),this.Lo&&!e||this.xo||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=kr.no(this.Co)||void 0}catch(t){}if(!i||i===this.wa)return!1;var r,s=Br(this.Co,i);try{r=Mr(JSON.parse(i))}catch(t){return!1}if((kr.no(this.Co)||void 0)!==i)return!1;this.ba=s,this.wa=i;var n=Ur(this.Co,i),o=[...Or,...n.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(O(e)||M(e)||""===e||t===Ii&&e!==Qi&&e!==Zi)&&(a[t]=!0,delete r[t])}),I(r))return!1;var h=Ee in r||r[Ii]===Qi||r[Ii]===Zi,l=this.props,u=l[Ee],d=l[Ii],v=lr({},l);[...Or,...t.cookie_persisted_properties||[]].forEach(t=>{if(-1!==o.indexOf(t)&&!(t in r)&&!a[t]&&(h||t!==Ee&&t!==Ii)){var e=v[t];!n.isValid&&-1!==Or.indexOf(t)&&(!1===e||0===e)||delete v[t]}}),this.props=lr(v,r),Ts.forEach(t=>{var e=t in this.props;t in l===e&&Rs(l[t],this.props[t])||(e?this.Zo(t,l[t],this.props[t]):this.Bo(t,!0))}),!h||Ii in r||Ii in this.props||this.Jo(Ii,Qi);var c=this.props[Ee],_=this.props[Ii];return!h||c===u&&_===d||(this.To=!0,this.$o=!0,qr.gr(xs(this.Co),!0),this.Yo(di),this.Yo(ri),this.Yo(ii),this.Yo(ni),this.Yo(oi),this.Yo(ai),this.Yo(Pi),this.Yo(Ri),this.Yo(Ti),_===Qi&&(d===Zi||r[Ii]===Qi||!O(u)&&c!==u)&&(Is(this.props,r),this.Yo(vi)),_===Zi?this.props.$user_id=c:delete this.props.$user_id,this.Yo(ke)),!0}consumeCookieIdentityChange(){var t=xs(this.Co),e=this.$o||!!qr.no(t);return this.$o=!1,e&&qr.mr(t),e}$a(t){return void 0===t&&(t=!1),!(this.xo||this.Lo&&!t||!this.P.cookieWinsOnConflict||"localstorage+cookie"!==this.P.persistence.toLowerCase()||(this.xo=!0,0))}xa(){this.xo&&(O(this.Ea)||(clearTimeout(this.Ea),this.Ea=void 0),delete this.mo[Ss],this.Sa(!0))}Ta(t){if(void 0===t&&(t=!0),this.xo)try{t?this.xa():O(this.Ea)||(clearTimeout(this.Ea),this.Ea=void 0)}finally{this.xo=!1}}isDisabled(){return!!this.Lo}Ao(e){-1===$s.indexOf(e.persistence.toLowerCase())&&(fe.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=[...Or,...e];return p({},Pr,{oo(t){try{var e,s={};try{e=kr.no(t)||void 0,s=e?Mr(JSON.parse(e)):{}}catch(t){}var n,o=JSON.parse(Pr.no(t)||"{}");if(i){var a=Ur(t,e),h=[...Or,...a.properties],l={};Object.keys(s).forEach(t=>{var e=s[t];M(e)||""===e||t===Ii&&e!==Qi&&e!==Zi||(l[t]=e)});var u=Ee in l||l[Ii]===Qi||l[Ii]===Zi;if(Object.keys(l).length>0){var d,v=o[Ee],c=null!==(d=o[Ii])&&void 0!==d?d:Qi;r.forEach(t=>{if(-1!==h.indexOf(t)&&!(t in s)&&(u||t!==Ee&&t!==Ii)){var e=o[t];!a.isValid&&-1!==Or.indexOf(t)&&(!1===e||0===e)||delete o[t]}}),!u||Ii in s||Ii in o||(o[Ii]=Qi),!u||(Ee in l?l[Ee]:o[Ee])===v&&(Ii in l?l[Ii]:o[Ii])===c||(Ir.forEach(t=>delete o[t]),l[Ii]===Zi&&Ee in l?o.$user_id=l[Ee]:delete o.$user_id,l[Ii]!==Zi&&(delete o[ci],delete o[vi]),delete o.__alias)}n=lr(o,l)}else n=lr(s,o);return Pr.gr(t,n),n}catch(t){}return null},gr(t,r,s,n,o,a){var h=Pr.gr(t,r,void 0,void 0,a);try{var l=Dr(r,e);if(Object.keys(l).length){if(i){var u=Cr(t),d=Fr(l,e);if(kr.gr(u,d,s,n,o,a),kr.no(u)!==JSON.stringify(d)){kr.mr(u,n);var v=Dr(r);return kr.gr(t,v,s,n,o,a),h}}kr.gr(t,l,s,n,o,a)}}catch(t){Pr.so(t)}return h},mr(e,i){try{null==t||t.localStorage.removeItem(e),kr.mr(e,i),kr.mr(Cr(e),i)}catch(t){Pr.so(t)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),s=!1,n=!1,o=e.persistence.toLowerCase();return"localstorage"===o&&Pr.ro()?(i=Pr,n=!0):"localstorage+cookie"===o&&r.ro()?(i=r,n=!0,s=!0):"sessionstorage"===o&&qr.ro()?i=qr:"memory"===o?i=jr:"cookie"===o&&kr.ro()?(i=kr,s=!0):r.ro()?(i=r,n=!0,s=!0):kr.ro()?(i=kr,s=!0):i=jr,this.bo=n,this.wo=s,i}Fo(t){return this.Co+"__"+t}Mo(t){return this.bo&&!!t.split_storage}properties(){var t={};return hr(this.props,(e,i)=>{var r=is(i);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e))return;t[i]=e}}),t}load(t){if(void 0===t&&(t=!1),!this.Lo||t){var e=this.P.cookieWinsOnConflict&&"localstorage+cookie"===this.P.persistence.toLowerCase(),i=e?Pr.oo(this.Co):null,r={};if(e)try{hr(r=Mr(kr.oo(this.Co)),(t,e)=>{(O(t)||M(t)||""===t)&&delete r[e]})}catch(t){}var s=this.lo.oo(this.Co);if(s&&(this.props=lr({},s)),this.yo&&this.ka(),e&&s){var n,o,a=null==i?void 0:i[Ee],h=null!==(n=null==i?void 0:i[Ii])&&void 0!==n?n:Qi,l=s[Ee],u=null!==(o=s[Ii])&&void 0!==o?o:Qi;if(l!==a||u!==h){this.$o=!0,qr.gr(xs(this.Co),!0);var d=lr({},this.props);Ir.forEach(t=>delete d[t]),u===Qi&&(h===Zi||r[Ii]===Qi||!O(a)&&l!==a)&&(Is(d,r),delete d[vi]),this.props=d;var v=new Set;Ir.forEach(t=>{var e,i=null==(e=is(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{var e={};hr(this.props,(i,r)=>{var s;(null==(s=is(r))?void 0:s.storageGroup)===t&&(e[r]=i)}),I(e)?(Pr.mr(this.Fo(t)),this.mo[t]={}):Pr.gr(this.Fo(t),e)&&(this.mo[t]={persisted:!0,fingerprint:this.Wo(e,t)})})}}qr.no(xs(this.Co))&&(this.$o=!0)}}ka(){for(var t of Zr){var e=Pr.oo(this.Fo(t));if(e&&!I(e)){var i=this.jo(t);i.persisted=!0,this.Ra(t)||(i.fingerprint=this.Wo(e,t)),this.Pa(t,e)||lr(this.props,e)}}}Ra(t){return Object.keys(this.props).some(e=>{var i;return(null==(i=is(e))?void 0:i.storageGroup)===t})}Pa(t,e){var i=ys[t];if(!i)return!1;var r=e[i],s=this.props[i];return N(r)&&N(s)&&s>r}refreshKey(t){var e;if(!(this.Lo||t===Ie&&this.Ro)){var i=this.yo?null==(e=is(t))?void 0:e.storageGroup:void 0,r=i?Pr.oo(this.Fo(i)):this.lo.oo(this.Co);if(r&&t in r)this.Jo(t,r[t],!1);else{if(i){var s=this.lo.oo(this.Co);if(s&&t in s)return void this.Jo(t,s[t],!1)}this.Yo(t,!1)}}}save(){if(!this.Lo){var t=this._a();t>0?O(this.Ea)&&(this.Ea=setTimeout(()=>{this.Ea=void 0,this.Sa()},t)):this.Sa()}}flush(){O(this.Ea)||(clearTimeout(this.Ea),this.Ea=void 0,this.Sa())}Sa(t){if(void 0===t&&(t=!1),!(this.Lo||this.xo&&!t)){t||(this.syncCookieProperties(),this.Ro||this.P.cookieWinsOnConflict&&"localstorage+cookie"===this.P.persistence.toLowerCase()||this.refreshKey(Ie));var e=!t&&!this.So;e||(this.ko=!1);var i=!!e&&this.Ko();if(this.ko)this.P.debug&&fe.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.yo)return this.Ia(),void(i&&this.Po.forEach(t=>t()));var r=this.Oa(this.lo,this.Co,this.props,Ss);"written"===r&&this.ma(this.props),"failed"!==r&&(this.Eo.clear(),this.To=!1,this.Ro=!1),i&&this.Po.forEach(t=>t())}}}Ia(){var t=this,e=this.Ho(),i=e.main,r=e.groups,s=this.Oa(this.lo,this.Co,i,Ss);"written"===s&&this.ma(i),"failed"!==s&&(this.To=!1,this.Ro=!1,Ts.forEach(t=>{var e;null!=(e=is(t))&&e.storageGroup||this.Eo.delete(t)}));var n=function(e){var i,s=r[e];if(I(s)&&(null==(i=t.mo[e])||!i.persisted))return Ts.forEach(i=>{var r;(null==(r=is(i))?void 0:r.storageGroup)===e&&t.Eo.delete(i)}),1;var n=t.Oa(Pr,t.Fo(e),s,e);"failed"!==n&&Ts.forEach(i=>{var r=is(i);(null==r?void 0:r.storageGroup)!==e||"written"!==n&&r.volatile||t.Eo.delete(i)})};for(var o of Zr)n(o)}Ho(){var t={},e={flags:{},surveys:{}};return hr(this.props,(i,r)=>{var s,n=null==(s=is(r))?void 0:s.storageGroup;n?e[n][r]=i:t[r]=i}),{main:t,groups:e}}Wo(t,e){if(e===Ss)return JSON.stringify(t)+"|"+this.Ca+"|"+this.Aa+"|"+this.Ma;var i={};return hr(t,(t,e)=>{var r;i[e]=null!=(r=is(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}Oa(t,e,i,r){var s,n=this.jo(r);if(r!==Ss&&!n.dirty&&!O(n.fingerprint))return"skipped";try{if((s=this.Wo(i,r))===n.fingerprint)return n.dirty=!1,"skipped"}catch(t){s=void 0}return t.gr(e,i,this.Ca,this.Aa,this.Ma,this.P.debug)?(n.dirty=!1,r!==Ss&&(n.persisted=!0),O(s)||(n.fingerprint=s),this.bo&&(n.storageValue=Pr.no(e)),"written"):(this.P.debug&&fe.warn('failed to persist storage entry "'+e+'"; will retry on next save'),"failed")}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(this.Qo(),O(this.Ea)||(clearTimeout(this.Ea),this.Ea=void 0),this.lo.mr(this.Co,!1),this.lo.mr(this.Co,!0),!i&&this.Io)for(var r of Zr)Pr.mr(this.Fo(r));i?delete this.mo[Ss]:this.mo={},this.ba=void 0,this.wa=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(P(t)){this.syncCookieProperties(),O(e)&&(e="None"),this.Ca=O(i)?this.Da:i;var r=!1;if(hr(t,(t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Jo(i,t),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(P(t)){this.syncCookieProperties(),this.Ca=O(e)?this.Da:e;var i=!1;if(hr(t,(e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||P(e)||k(e))&&(this.Jo(r,e),i=!0)}),i)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();var e="string"==typeof t?[t]:t,i=!1;for(var r of e)r in this.props&&(this.Yo(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==r?void 0:r.URL;if(t!==this.Oo){var e=function(t,e,i){if(!r)return{};var s,n=e?[...hs,...i||[]]:[],o=vs(os(r.URL,n,us),t),a=(s={},hr(ds,function(t){var e=fr(t);s[t]=e||null}),s);return lr(a,o)}(this.P.custom_campaign_params,this.P.mask_personal_data_properties,this.P.custom_personal_data_properties),i=!I(dr(e));return i&&this.register(e),this.Oo=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?cs(t):{})}update_referrer_info(){var t;this.register_once({$referrer:fs(),$referring_domain:null!=r&&r.referrer&&(null==(t=ss(r.referrer))?void 0:t.host)||ps},void 0)}set_initial_person_info(){if(!this.props[Ai]&&!this.props[Mi]){var t=gs(this.P.mask_personal_data_properties,this.P.custom_personal_data_properties,this.P.disable_capture_url_hashes);this.register_once({[Di]:this.wo?{r:Es(t.r),u:t.u?Es(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};hr([Mi,Ai],e=>{var i=this.props[e];i&&hr(i,function(e,i){t["$initial_"+b(i)]=e})});var e=this.props[Di];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=ms(t,e),r={};return hr(i,function(t,e){r["$initial_"+b(e)]=t}),r}(e,this.P.disable_capture_url_hashes);lr(t,i)}return t}safe_merge(t){return hr(this.props,function(e,i){i in t||(t[i]=e)}),t}update_config(t,e,i){var r=t.persistence!==e.persistence,s=!((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||[]),n=r||s,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,a=t.disable_persistence||!!i,h=!!this.Lo&&!a;a||this.ya(e,h),this.P=t,!a&&(r||s||o)&&(this.ba=void 0,this.wa=void 0,this.ya(p({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),h));var l=n||o?this.Ao(t):this.lo;this.Na();var u=this.Mo(t),d=n||u!==this.yo,v=!a&&(d||t.cross_subdomain_cookie!==this.Aa||t.secure_cookie!==this.Ma)&&this.$a(h);this.So=d;try{if(this.Da=this.Ca=t.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),d){var c=this.props;this.clear(),this.lo=l,this.yo=u,this.props=c,this.save()}else o&&(this.lo=l,a||(delete this.mo[Ss],this.Sa()))}finally{this.So=!1,v&&this.Ta()}}Na(){var t=this.props[Di];if(this.wo&&P(t)&&"string"==typeof t.r){var e=Es(t.r),i="string"==typeof t.u?Es(t.u):t.u;e===t.r&&i===t.u||this.Jo(Di,p({},t,{r:e,u:i}))}}set_disabled(t){this.Lo=t,this.Lo?this.remove():this.save()}set_cross_subdomain(t){t!==this.Aa&&(this.Aa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Ma&&(this.Ma=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[Oe]||{};i[t]=e,this.Jo(Oe,i),this.save()}remove_event_timer(t){var e=this.props[Oe]||{},i=e[t];return O(i)||(delete e[t],this.Jo(Oe,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Jo(t,e),this.save()}Jo(t,e,i){var r;void 0===i&&(i=!0);var s=this.props[t];this.props[t]=e,i&&(t!==Ee&&t!==Ii||s===e||(this.To=!0),t!==Ie||Rs(s,e)||(this.Ro=!0),this.Zo(t,s,e),null!=(r=is(t))&&r.volatile||this.Xo(t))}Yo(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(ks(t)&&this.Bo(t,!0),t===Ie&&(this.Ro=!0),this.Xo(t))}Xo(t){var e,i=null==(e=is(t))?void 0:e.storageGroup;i&&(this.jo(i).dirty=!0)}jo(t){return this.mo[t]||(this.mo[t]={})}}var Cs={GZipJS:"gzip-js",Base64:"base64"},As={Activation:"events",Cancellation:"cancelEvents"},Ms={Button:"button",Tab:"tab",Selector:"selector"},Ds={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"},Ns={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Fs={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Us={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Bs={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Ls={Once:"once",Recurring:"recurring",Always:"always"},js={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},zs={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},qs={Popover:"popover",Inline:"inline"};function Hs(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&R(i.then)&&i.then(void 0,()=>{})}}}}var Gs={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},Ws={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"},Vs={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"},Js=ge("[RateLimiter]");class Ys{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=>{Js.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4})}catch(t){return void Js.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 s=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(Ci))&&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 h=1>a.tokens;if(h||t||(a.tokens=Math.max(0,a.tokens-1)),h&&!t){var l=(N(a.dropped)?a.dropped:0)+1;a.dropped=l,!this.lastEventRateLimited&&this.Fa(l)&&(a.dropped=0)}return this.lastEventRateLimited=h,null==(r=this.instance.persistence)||r.set_property(Ci,a),{isRateLimited:h,remainingTokens:a.tokens}}Ua(t){var e=this.instance.config.property_denylist;return!k(e)||!e.includes(t)}Ba(){var t;if(this.Ua("$current_url")&&this.Ua("$pathname")&&null!=s&&s.pathname)return""+(null!==(t=s.origin)&&void 0!==t?t:"")+s.pathname}Fa(t){var e,i,r=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,n=this.Ba(),o=this.Ua("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,a=[t+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+s+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Ks=ge("[RemoteConfig]");class Xs{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=d._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Zt(t){var e,i;null!=(e=d.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Qt(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return Ks.info("Using preloaded remote config",this.remoteConfig),void this.Yt(this.remoteConfig);if(this._instance._shouldDisableFlags())return void Ks.warn("Remote config is disabled. Falling back to local config.");this.Zt(t=>{if(!t)return Ks.info("No config found after loading remote JS config. Falling back to JSON."),void this.Qt(t=>{this.Yt(t.json,t)});this.Yt(t)})}catch(t){Ks.error("Error loading remote config",t),this.Yt()}}Yt(t,e){!t&&e&&(0===e.statusCode?e.error||Ks.warn("Failed to fetch remote config from PostHog."):Ks.error("Failed to fetch remote config from PostHog."));try{this._instance.Yt(t?{ok:!0,config:t}:{ok:!1})}catch(t){Ks.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(t){Ks.error("Error loading feature flags",t)}}}var Qs=["fatal","error","warning","log","info","debug"],Zs=Uint8Array,tn=Uint16Array,en=Uint32Array,rn=new Zs([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]),sn=new Zs([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]),nn=new Zs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),on=function(t,e){for(var i=new tn(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var s=new en(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]},an=on(rn,2),hn=an[1];an[0][28]=258,hn[258]=28;for(var ln=on(sn,0)[1],un=new tn(32768),dn=0;32768>dn;++dn){var vn=(43690&dn)>>>1|(21845&dn)<<1;un[dn]=((65280&(vn=(61680&(vn=(52428&vn)>>>2|(13107&vn)<<2))>>>4|(3855&vn)<<4))>>>8|(255&vn)<<8)>>>1}var cn=function(t,e,i){for(var r=t.length,s=0,n=new tn(e);r>s;++s)++n[t[s]-1];var o,a=new tn(e);for(s=0;e>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new tn(1<<e);var h=15-e;for(s=0;r>s;++s)if(t[s])for(var l=s<<4|t[s],u=e-t[s],d=a[t[s]-1]++<<u,v=d|(1<<u)-1;v>=d;++d)o[un[d]>>>h]=l}else for(o=new tn(r),s=0;r>s;++s)o[s]=un[a[t[s]-1]++]>>>15-t[s];return o},_n=new Zs(288);for(dn=0;144>dn;++dn)_n[dn]=8;for(dn=144;256>dn;++dn)_n[dn]=9;for(dn=256;280>dn;++dn)_n[dn]=7;for(dn=280;288>dn;++dn)_n[dn]=8;var pn=new Zs(32);for(dn=0;32>dn;++dn)pn[dn]=5;var fn=cn(_n,9,0),gn=cn(pn,5,0),mn=function(t){return(t/8|0)+(7&t&&1)},bn=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof tn?tn:t instanceof en?en:Zs)(i-e);return r.set(t.subarray(e,i)),r},wn=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},yn=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},$n=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 Zs(0),0];if(1==s){var o=new Zs(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(t,e){return t.f-e.f}),i.push({s:-1,f:25001});var a=i[0],h=i[1],l=0,u=1,d=2;for(i[0]={s:-1,f:a.f+h.f,l:a,r:h};u!=s-1;)a=i[i[d].f>i[l].f?l++:d++],h=i[l!=u&&i[d].f>i[l].f?l++:d++],i[u++]={s:-1,f:a.f+h.f,l:a,r:h};var v=n[0].s;for(r=1;s>r;++r)n[r].s>v&&(v=n[r].s);var c=new tn(v+1),_=xn(i[u-1],c,0);if(_>e){r=0;var p=0,f=_-e,g=1<<f;for(n.sort(function(t,e){return c[e.s]-c[t.s]||t.f-e.f});s>r;++r){var m=n[r].s;if(e>=c[m])break;p+=g-(1<<_-c[m]),c[m]=e}for(p>>>=f;p>0;){var b=n[r].s;e>c[b]?p-=1<<e-c[b]++-1:++r}for(;r>=0&&p;--r){var w=n[r].s;c[w]==e&&(--c[w],++p)}_=e}return[new Zs(c),_]},xn=function(t,e,i){return-1==t.s?Math.max(xn(t.l,e,i+1),xn(t.r,e,i+1)):e[t.s]=i},En=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new tn(++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]},Sn=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Tn=function(t,e,i){var r=i.length,s=mn(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)},kn=function(t,e,i,r,s,n,o,a,h,l,u){wn(e,u++,i),++s[256];for(var d=$n(s,15),v=d[0],c=d[1],_=$n(n,15),p=_[0],f=_[1],g=En(v),m=g[0],b=g[1],w=En(p),y=w[0],x=w[1],E=new tn(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=$n(E,7),k=T[0],R=T[1],P=19;P>4&&!k[nn[P-1]];--P);var I,O,C,A,M=l+5<<3,D=Sn(s,_n)+Sn(n,pn)+o,N=Sn(s,v)+Sn(n,p)+o+14+3*P+Sn(E,k)+(2*E[16]+3*E[17]+7*E[18]);if(D>=M&&N>=M)return Tn(e,u,t.subarray(h,h+l));if(wn(e,u,1+(D>N)),u+=2,D>N){I=cn(v,c,0),O=v,C=cn(p,f,0),A=p;var F=cn(k,R,0);for(wn(e,u,b-257),wn(e,u+5,x-1),wn(e,u+10,P-4),u+=14,S=0;P>S;++S)wn(e,u+3*S,k[nn[S]]);u+=3*P;for(var U=[m,y],B=0;2>B;++B){var L=U[B];for(S=0;L.length>S;++S)wn(e,u,F[j=31&L[S]]),u+=k[j],j>15&&(wn(e,u,L[S]>>>5&127),u+=L[S]>>>12)}}else I=fn,O=_n,C=gn,A=pn;for(S=0;a>S;++S)if(r[S]>255){var j;yn(e,u,I[257+(j=r[S]>>>18&31)]),u+=O[j+257],j>7&&(wn(e,u,r[S]>>>23&31),u+=rn[j]);var z=31&r[S];yn(e,u,C[z]),u+=A[z],z>3&&(yn(e,u,r[S]>>>5&8191),u+=sn[z])}else yn(e,u,I[r[S]]),u+=O[r[S]];return yn(e,u,I[256]),u+O[256]},Rn=new en([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pn=function(){for(var t=new en(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),In=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function On(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=Pn[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var s,n,o,a,h,l=(a=10+((s=e).filename&&s.filename.length+1||0),h=8,function(t,e,i,r,s,n){var o=t.length,a=new Zs(r+o+5*(1+Math.floor(o/7e3))+s),h=a.subarray(r,a.length-s),l=0;if(!e||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=Tn(h,l,t.subarray(u,d)):(h[u]=n,l=Tn(h,l,t.subarray(u,o)))}else{for(var v=Rn[e-1],c=v>>>13,_=8191&v,p=(1<<i)-1,f=new tn(32768),g=new tn(p+1),m=Math.ceil(i/3),b=2*m,w=function(e){return(t[e]^t[e+1]<<m^t[e+2]<<b)&p},y=new en(25e3),x=new tn(288),E=new tn(32),S=0,T=0,k=(u=0,0),R=0,P=0;o>u;++u){var I=w(u),O=32767&u,C=g[I];if(f[O]=C,g[I]=O,u>=R){var A=o-u;if((S>7e3||k>24576)&&A>423){l=kn(t,h,0,y,x,E,T,k,P,u-P,l),k=S=T=0,P=u;for(var M=0;286>M;++M)x[M]=0;for(M=0;30>M;++M)E[M]=0}var D=2,N=0,F=_,U=O-C&32767;if(A>2&&I==w(u-U))for(var B=Math.min(c,A)-1,L=Math.min(32767,u),j=Math.min(258,A);L>=U&&--F&&O!=C;){if(t[u+D]==t[u+D-U]){for(var z=0;j>z&&t[u+z]==t[u+z-U];++z);if(z>D){if(D=z,N=U,z>B)break;var q=Math.min(U,z-2),H=0;for(M=0;q>M;++M){var G=u-U+M+32768&32767,W=G-f[G]+32768&32767;W>H&&(H=W,C=G)}}}U+=(O=C)-(C=f[O])+32768&32767}if(N){y[k++]=268435456|hn[D]<<18|ln[N];var V=31&hn[D],J=31&ln[N];T+=rn[V]+sn[J],++x[257+V],++E[J],R=u+D,++S}else y[k++]=t[u],++x[t[u]]}}l=kn(t,h,n,y,x,E,T,k,P,u-P,l)}return bn(a,0,r+mn(l)+s)}(n=t,null==(o=e).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+o.mem,a,h,!0)),u=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&&In(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),In(l,u-8,i.d()),In(l,u-4,r),l}var Cn=!!o||!!n,An="text/plain",Mn=!1,Dn=(t,e)=>{var i=t.split("#"),r=i[1],s=i[0].split("?"),n=s[0],o=s[1];if(!o)return t;var a=o.split("&").filter(t=>t.split("=")[0]!==e).join("&");return n+(a?"?"+a:"")+(r?"#"+r:"")},Nn=function(t,e,i){var r;void 0===i&&(i=!0);var s=t.split("?"),n=s[0],o=s[1],a=p({},e),h=null!==(r=null==o?void 0:o.split("&").map(t=>{var e,r=t.split("="),s=r[0],n=i&&null!==(e=a[s])&&void 0!==e?e:r[1];return delete a[s],s+"="+n}))&&void 0!==r?r:[],l=function(t,e){var i,r;void 0===e&&(e="&");var s=[];return hr(t,function(t,e){O(t)||O(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)}(a);return l&&h.push(l),h.length>0?n+"?"+h.join("&"):n},Fn=t=>{if(t.La)return t.La;var e=t.data,i=t.compression;if(e){if(i===Cs.GZipJS){var r=On(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new Zs(t.length+(t.length>>>1)),r=0,s=function(t){i[r++]=t},n=0;e>n;++n){if(r+5>i.length){var o=new Zs(r+8+(e-n<<1));o.set(i),i=o}var a=t.charCodeAt(n);128>a?s(a):2048>a?(s(192|a>>>6),s(128|63&a)):a>55295&&57344>a?(s(240|(a=65536+(1047552&a)|1023&t.charCodeAt(++n))>>>18),s(128|a>>>12&63),s(128|a>>>6&63),s(128|63&a)):(s(224|a>>>12),s(128|a>>>6&63),s(128|63&a))}return bn(i,0,r)}(rs(e)),{mtime:0});return{contentType:An,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Cs.Base64){var s=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(rs(e)),n=(t=>"data="+encodeURIComponent("string"==typeof t?t:rs(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=rs(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Un=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:Nn(t.url,{compression:Cs.Base64}),encodedBody:Fn(p({},t,{compression:Cs.Base64,La:void 0}))}:{url:Dn(t.url,"compression"),encodedBody:Fn(p({},t,{compression:void 0,La:void 0}))};try{e=Fn(t)}catch(e){if(ue(t.compression,ns(t.url,"compression")))return fe.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&ue(t.compression,ns(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?le(new Uint8Array(i)):ArrayBuffer.isView(i)&&le(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Mn=!0,r()):{url:t.url,encodedBody:e}},Bn=t=>{try{return Un(t)}catch(e){return fe.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Ln=function(){var t=_(function*(t){var e=rs(t.data),i=yield function(t,e,i){return _e.apply(this,arguments)}(e,v.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{La:{contentType:An,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}}(),jn=/Failed to fetch|NetworkError|Load failed/i,zn=t=>"TypeError"===(null==t?void 0:t.name)&&jn.test((null==t?void 0:t.message)||""),qn=t=>{var e=Bn(t);if(e){var i=e.url,r=e.encodedBody,s=null!=r?r:{},o=s.contentType,h=s.body,l=s.estimatedSize,u=new Headers;hr(t.headers,function(t,e){u.append(e,t)}),o&&u.append("Content-Type",o);var d=null,v=!1;if(a){var c=new a;d={signal:c.signal,timeout:setTimeout(()=>{var e;v=!0,c.abort(se("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))},t.timeout)}}var _=e=>{v&&"AbortError"===(null==e?void 0:e.name)||zn(e)?fe.warn(e):fe.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var f;n(i,p({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.ja&&52428.8>(l||0),body:h,signal:null==(f=d)?void 0:f.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){fe.error(t)}null==t.callback||t.callback(r)})).catch(_).finally(()=>d?clearTimeout(d.timeout):null)}catch(t){d&&clearTimeout(d.timeout),_(t)}}},Hn=t=>{try{var e,r=Un(t),s=r.url,n=r.encodedBody,o=null!=n?n:{},a=o.body,h=o.estimatedSize;if(!a)return;var l=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(i.sendBeacon(s,l))return;var u=k(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(k(u)&&u.length>1&&(null!=h?h:0)>16384){var d=Math.ceil(u.length/2),v=e=>k(t.data)?e:p({},t.data,{batch:e});return Hn(p({},t,{data:v(u.slice(0,d))})),void Hn(p({},t,{data:v(u.slice(d))}))}fe.warn("Beacon of ~"+(null!=h?h:0)+" bytes was rejected by the browser, falling back to fetch"),qn(p({},t,{ja:!0}))}catch(t){fe.warn("Beacon send failed",t)}},Gn=(t,e,i,r)=>{var s="query"===r?"POST"===e?"sent_at":"_":void 0;return Nn(i===Cs.GZipJS?Dn(t,"compression"):t,p({},s?{[s]:Date.now().toString()}:{},i===Cs.GZipJS?{}:{compression:i}))},Wn=[];n&&Wn.push({transport:"fetch",method:qn}),o&&Wn.push({transport:"XHR",method(t){var e=Bn(t);if(e){var i=new o,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var s=null!=r?r:{},n=s.contentType,a=s.body;hr(t.headers,function(t,e){i.setRequestHeader(e,t)}),n&&i.setRequestHeader("Content-Type",n),t.timeout&&(i.timeout=t.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(a)}}}),null!=i&&i.sendBeacon&&Wn.push({transport:"sendBeacon",method:Hn});var Vn=3e3;class Jn{constructor(t,e){this.za=!0,this.Ln=[],this.qa=G((null==e?void 0:e.flush_interval_ms)||Vn,250,5e3,fe.createLogger("flush interval"),Vn),this.Ha=t}enqueue(t){this.Ln.push(t),this.Ga||this.Wa()}unload(){this.Va();var t=this.Ln.length>0?this.Ja():{},e=Object.values(t);[...e.filter(t=>0===t.url.indexOf("/e")),...e.filter(t=>0!==t.url.indexOf("/e"))].map(t=>{this.Ya(p({},t,{transport:"sendBeacon"}))})}enable(){this.za=!1,this.Wa()}Wa(){var t=this;this.za||(this.Ga=setTimeout(()=>{if(this.Va(),this.Ln.length>0){var e=this.Ja(),i=function(){var i=e[r],s=(new Date).getTime();i.data&&k(i.data)&&hr(i.data,t=>{t.offset=Math.abs(t.timestamp-s),delete t.timestamp}),t.Ya(i)};for(var r in e)i()}},this.qa))}Ya(t){try{this.Ha(t)}catch(t){fe.error(t)}}Va(){clearTimeout(this.Ga),this.Ga=void 0}Ja(){var t={};return hr(this.Ln,e=>{var i,r=e,s=(r?r.batchKey:null)||r.url;O(t[s])&&(t[s]=p({},r,{data:[]})),null==(i=t[s].data)||i.push(r.data)}),this.Ln=[],t}}var Yn=["retriesPerformedSoFar"];class Kn{constructor(e){this.Ka=!1,this.Xa=3e3,this.Ln=[],this._instance=e,this.Ln=[],this.Qa=!0,!O(t)&&"onLine"in t.navigator&&(this.Qa=t.navigator.onLine,this.Za=()=>{this.Qa=!0,this.gs()},this.th=()=>{this.Qa=!1},pr(t,"online",this.Za),pr(t,"offline",this.th))}get length(){return this.Ln.length}retriableRequest(t){var e=t.retriesPerformedSoFar,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,Yn);F(e)&&(i.url=Nn(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.Z(p({retriesPerformedSoFar:e},i));0===t.statusCode&&fe.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)}}))}Z(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.Ln.push({retryAt:r,requestOptions:t});var s="Enqueued failed request for retry in "+i;navigator.onLine||(s+=" (Browser is offline)"),fe.warn(s),this.Ka||(this.Ka=!0,this.eh())}eh(){if(this.ih&&clearTimeout(this.ih),0===this.Ln.length)return this.Ka=!1,void(this.ih=void 0);this.ih=setTimeout(()=>{this.Qa&&this.Ln.length>0&&this.gs(),this.eh()},this.Xa)}gs(){var t=Date.now(),e=[],i=this.Ln.filter(i=>t>i.retryAt||(e.push(i),!1));if(this.Ln=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.ih&&(clearTimeout(this.ih),this.ih=void 0),this.Ka=!1,O(t)||(this.Za&&(t.removeEventListener("online",this.Za),this.Za=void 0),this.th&&(t.removeEventListener("offline",this.th),this.th=void 0)),this.Ln)){var i=e.requestOptions;try{this._instance._send_request(p({},i,{transport:"sendBeacon"}))}catch(t){fe.error(t)}}this.Ln=[]}}class Xn{constructor(t){this.rh=()=>{var t,e,i,r;this.sh||(this.sh={});var s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),h=(null==s?void 0:s.scrollHeight)||0;this.sh.lastScrollY=Math.ceil(n),this.sh.maxScrollY=Math.max(n,null!==(t=this.sh.maxScrollY)&&void 0!==t?t:0),this.sh.maxScrollHeight=Math.max(o,null!==(e=this.sh.maxScrollHeight)&&void 0!==e?e:0),this.sh.lastContentY=a,this.sh.maxContentY=Math.max(a,null!==(i=this.sh.maxContentY)&&void 0!==i?i:0),this.sh.maxContentHeight=Math.max(h,null!==(r=this.sh.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get nh(){return this._instance.config.scroll_root_selector}getContext(){return this.sh}resetContext(){var t=this.sh;return setTimeout(this.rh,0),t}startMeasuringScrollPosition(){pr(t,"scroll",this.rh,{capture:!0}),pr(t,"scrollend",this.rh,{capture:!0}),pr(t,"resize",this.rh)}scrollElement(){var e;if(!this.nh)return null==t||null==(e=t.document)?void 0:e.documentElement;var i=k(this.nh)?this.nh:[this.nh];for(var r of i){var s,n=null==t||null==(s=t.document)?void 0:s.querySelector(r);if(n)return n}}oh(e){var i,r,s="y"===e?"scrollTop":"scrollLeft";if(this.nh){var n=this.scrollElement();return n&&n[s]||0}return t?"y"===e?t.scrollY||t.pageYOffset||(null==(i=t.document)||null==(i=i.documentElement)?void 0:i.scrollTop)||0:t.scrollX||t.pageXOffset||(null==(r=t.document)||null==(r=r.documentElement)?void 0:r.scrollLeft)||0:0}scrollY(){return this.oh("y")}scrollX(){return this.oh("x")}}var Qn=t=>gs(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class Zn{constructor(t,e,i,r){this.ah=t=>{var e=this.hh();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.uh(this._instance)};this.Ir.register({[Oi]:i})}},this._instance=t,this.dh=e,this.Ir=i,this.uh=r||Qn,this.dh.onSessionId(this.ah)}hh(){return this.Ir.props[Oi]}getSetOnceProps(){var t,e=null==(t=this.hh())?void 0:t.props;return e?"r"in e?ms(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return hr(dr(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+b(i)]=e}),t}}class to{on(t,e){return this.wi[t]||(this.wi[t]=[]),this.wi[t].push(e),()=>{this.wi[t]=this.wi[t].filter(t=>t!==e)}}emit(t,e){for(var i of this.wi[t]||[])i(e);for(var r of this.wi["*"]||[])r(t,e)}constructor(){this.wi={}}}var eo=ge("[SessionId]"),io=864e5;class ro{on(t,e){return this._h.on(t,e)}constructor(t,e,i){var r;if(this.ph=null,this.fh=null,this.gh=[],this.mh=void 0,this.bh=!1,this._h=new to,this.wh=(t,e)=>!(!F(t)||!F(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Xi)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.P=t.config,this.Ir=t.persistence,this.yh=void 0,this.$h=void 0,this._sessionStartTimestamp=null,this.xh=void 0,this._sessionActivityTimestamp=null,this.Eh=e||$r,this.Sh=i||$r;var s=this.P.persistence_name||this.P.token;if(this._sessionTimeoutMs=1e3*G(this.P.session_idle_timeout_seconds||1800,60,36e3,eo.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Th(),this.kh="ph_"+s+"_window_id",this.Rh="ph_"+s+"_primary_window_exists",this.Ph()){var n=qr.oo(this.kh),o=qr.oo(this.Rh);n&&!o?this.yh=n:qr.mr(this.kh),qr.gr(this.Rh,!0)}null!=(r=this.P.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.P.bootstrap.sessionID),this.Ih()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return O(this.gh)&&(this.gh=[]),this.gh.push(t),this.$h&&t(this.$h,this.yh),()=>{this.gh=this.gh.filter(e=>e!==t)}}Ph(){return"memory"!==this.P.persistence&&!this.Ir.Lo&&qr.ro()}Oh(t){t!==this.yh&&(this.yh=t,this.Ph()&&qr.gr(this.kh,t))}Ch(){return this.yh?this.yh:this.Ph()?qr.oo(this.kh):null}Ah(t){var e=this.ph;return!M(e)&&!M(t)&&5e3>Math.abs(t-e)}Mh(t,e,i){var r=e!==this._sessionActivityTimestamp,s=!(t!==this.$h||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.$h=t,s&&!r||s&&this.Ah(e)||(this.ph=e,this.Ir.register({[Ye]:[e,t,i]}))}Dh(){var t,e=null==(t=this.P)?void 0:t.persistence_save_debounce_ms;return F(e)&&e>0}Nh(){this.Dh()?this.Ir.refreshKey(Ye):(this.Ir.flush(),this.Ir.load())}Fh(){var t;if(!M(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.ph){this.Nh();var e=this.Uh();e[1]===this.$h&&e[2]===this._sessionStartTimestamp&&(this.ph=this._sessionActivityTimestamp,this.Ir.register({[Ye]:[this._sessionActivityTimestamp,null!==(t=this.$h)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Ir.flush())}}Bh(){var t=this.Uh()[0],e=F(t)?t:0,i=F(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}Lh(t){return this.Nh(),this.wh(t,this.Bh())}Uh(){var t=this.Ir.props[Ye];return k(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.ph=null,this.xh=void 0,clearTimeout(this.jh),this.jh=void 0,this.Mh(null,null,null)}setBootstrapSessionId(t,e){void 0===e&&(e=!1);var i=function(t,e){void 0===e&&(e=(new Date).getTime());try{var i=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(t);return i>e+6e4?void eo.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void eo.error("Invalid sessionID in bootstrap",t)}}(t);return!O(i)&&(e?this.xh={sessionId:t,sessionStartTimestamp:i}:this.Mh(t,(new Date).getTime(),i),!0)}destroy(){this.bh=!0,this.Fh(),clearTimeout(this.jh),this.jh=void 0,this.mh&&t&&(t.removeEventListener(ir,this.mh,{capture:!1}),this.mh=void 0),this.gh=[]}Ih(){this.mh=()=>{this.Fh(),this.Ph()&&qr.mr(this.Rh)},pr(t,ir,this.mh,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),this.P.cookieless_mode===Xi)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),s=this.$h;if(i)this.fh=r;else if(M(this.fh)||this.fh>r||r-this.fh>=1e3){var n,o;null==(n=(o=this.Ir).syncCookieProperties)||n.call(o),this.fh=r}var a=this.Uh(),h=a[1],l=a[2],u=!O(s)&&h!==s,d=this.Bh(),v=this.Ch(),c=this.xh,_=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>io),p=c?_:F(l)&&Math.abs(r-l)>io,f=!1,g=u,m=!h||!!c,b=h,w=!m&&!t&&this.wh(r,d);if(w){(w=this.Lh(r))||eo.info("cross-tab refresh kept the session alive",{sessionId:h});var y=this.Uh();h=y[1],l=y[2]}if(m||w||p){g=!1;var x=c&&!_;h=x?c.sessionId:this.Eh(),v=this.Sh(),eo.info("new session ID assigned",{sessionId:h,windowId:v,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:w,sessionPastMaximumLength:p}}),l=x?c.sessionStartTimestamp:r,this.xh=void 0,f=!0}else v||(v=this.Sh(),f=!0),(g=g||h!==b)&&(eo.info("adopted cross-tab session id",{sessionId:h,windowId:v}),f=!0);var E=F(d)&&t&&!p?d:r,S=F(l)?l:(new Date).getTime();this.Oh(v),this.Mh(h,E,S),t||this.Th();var T={noSessionId:m,activityTimeout:w,sessionPastMaximumLength:p,crossTabAdoption:g};return f&&this.gh.forEach(t=>t(h,v,T)),{sessionId:h,windowId:v,sessionStartTimestamp:S,changeReason:f?T:void 0,lastActivityTimestamp:d}}Th(){this.bh||(clearTimeout(this.jh),this.jh=setTimeout(()=>{if(!this.bh)if(this.Lh((new Date).getTime())){var t=this.$h;this.resetSessionId(),this._h.emit("forcedIdleReset",{idleSessionId:t})}else this.Th()},1.1*this.sessionTimeoutMs))}}function so(){return(so=_(function*(){var t=null==i?void 0:i.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return C(r)&&r.length>0?r:void 0}catch(t){return void fe.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})).apply(this,arguments)}function no(t,e){var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i}function oo(t,e,i){return rs({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var ao="custom",ho="i.posthog.com",lo=/^\/static\//,uo=["/s/","/e/","/i/"];class vo{constructor(t){this.zh={},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("."+ho,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.zh[this.apiHost]||(this.zh[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":ao),this.zh[this.apiHost]}qh(t){if(lo.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Hh(t){var e=ss(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Gh(t,e,i){if("ui"===t)return i;var r=i,s=this.instance.config.rewriteRequestPath;if(s){var n,o=(null==(n=ss(i))?void 0:n.href)||i;r=s(new URL(o)).toString()}if(s&&"api"===t&&uo.some(t=>0===e.indexOf(t))){var a=this.Hh(r);if(a){var h,l=this.apiHost,u=this.Wh;(null==(h=u)?void 0:h.apiHost)===l&&u.rewriteRequestPath===s||(u={apiHost:l,rewriteRequestPath:s,urls:new Set},this.Wh=u),u.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Wh,i=this.Hh(t);return(null==e?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&e.urls.has(i)}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.Gh(t,e,this.uiHost+e);if("flags"===t)return this.Gh(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.qh(e);if(i)return this.Gh(t,e,""+i+e)}if(this.region===ao)return this.Gh(t,e,this.apiHost+e);var r=ho+e;switch(t){case"assets":return this.Gh(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Gh(t,e,"https://"+this.region+"."+r)}}}var co=ge("[Surveys]"),_o={ignoreConditions:!1,ignoreDelay:!1,displayType:qs.Popover},po=ge("[PostHog ExternalIntegrations]"),fo={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class go{constructor(t){this._instance=t}Gt(t,e){var i;null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,t=>{if(t)return po.error("failed to load script",t);e()})}startIfEnabledOrStop(){var t=this,e=function(){var e,r,s,n=i[0],o=i[1];!o||null!=(e=d.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.Gt(fo[n],()=>{var e;null==(e=d.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!o&&null!=(r=d.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[n]&&(null==(s=d.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[n])||s.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;e()}}}class mo{constructor(t,e){this.l=t,this.Ot=e,this.Vh=new Map,this.Dt=!1}add(t){var e=this;return _(function*(){if(e.Dt)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.Vh.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.Vh.set(t.name,t);try{var i=t.setup(e.Ot);i&&(yield i)}catch(i){var r=e.Vh.get(t.name)===t;r&&e.Vh.delete(t.name),e.l.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.Jh(t)}})()}getExtension(t){return this.Vh.get(t)}dispose(){if(!this.Dt){this.Dt=!0;var t=Array.from(this.Vh.values()).reverse();for(var e of(this.Vh.clear(),t))this.Jh(e)}}Jh(t){try{var e=null==t.dispose?void 0:t.dispose();e&&R(e.then)&&e.then(void 0,e=>{this.l.error('Failed to dispose browser extension "'+t.name+'"',e)})}catch(e){this.l.error('Failed to dispose browser extension "'+t.name+'"',e)}}}class bo{constructor(t){this._instance=t}initialize(){}get(t){var e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);var i={};for(var r of t){var s=null==e?void 0:e.get_property(r);O(s)||(i[r]=s)}return i}set(t,e){var i;null==(i=this._instance.persistence)||i.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}}var wo="extensionsRemoteConfig";class yo{constructor(t){this.Dt=!1,this.instance=t,this.l=fe,this.Yh=t.Kh,this.kv=new bo(t),this.onEvent=t=>Hs(this.instance.on("eventCaptured",e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.l.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{if(this.Dt)return Hs(()=>{});var e=e=>{try{t(e)}catch(t){this.l.error("Browser extension remote config listener failed",t)}},i=this.instance.Xh.on(wo,e);return this.Yh&&e(this.Yh),Hs(i)},this.Qh=new mo(fe.createLogger("[BrowserExtensions]"),this)}get logger(){return this.l}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property(Se))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(Se);return"string"==typeof t?t:void 0}get library(){return{name:v.LIB_NAME,version:v.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null==(e=this.instance.persistence)?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,i,r,s=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==s?void 0:s.sessionId)&&void 0!==e?e:"",windowId:null!==(i=null==s?void 0:s.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(r=null==s?void 0:s.sessionStartTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(t){return this.Qh.add(t)}getExtension(t){return this.Qh.getExtension(t)}capture(t,e,i){var r=this;return _(function*(){i?r.instance.capture(t,e,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):r.instance.capture(t,e)})()}registerDynamicEventProperties(t){return Hs(this.instance.Zh(t))}handleRemoteConfig(t){this.Dt||(this.Yh=t,this.instance.Xh.emit(wo,t))}sendRequest(t,e){var i=this;return _(function*(){var r;void 0===e&&(e={});var s=i.instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",t),n={method:e.method,url:e.query?Nn(s,e.query):s,data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,compressionFallback:"flags"===e.target&&"best-available"===e.compression?w.Base64:void 0,timestampMode:e.sentAt};return"sendBeacon"===e.transport?(i.instance._send_request(n),{statusCode:202}):new Promise(t=>{n.callback=t,i.instance._send_request(n)})})()}dispose(){this.Dt||(this.Dt=!0,this.Qh.dispose())}}var $o,xo={},Eo=0,So=()=>{},To='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ko="Surveys module not available",Ro="sanitize_properties is deprecated. Use before_send instead",Po="Invalid value for property_denylist config: ",Io=/^[A-Za-z0-9_-]{1,400}$/,Oo=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Co=["token","distinct_id",Ui],Ao="posthog",Mo=!Cn&&-1===(null==l?void 0:l.indexOf("MSIE"))&&-1===(null==l?void 0:l.indexOf("Mozilla")),Do=t=>{var e={};return t&&"unset"!==t?("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0),e):e},No=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:_r(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:So,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&&C(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,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",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){fe.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:tr,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Vn},error_tracking:{},_onCapture:So},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Gr,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:Do(t),external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t),cookieWinsOnConflict:!(!t||"unset"===t||"2026-08-29">t)}))(e))},Fo=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],Uo=t=>{var e={};for(var i of Fo){var r=i[0],s=i[1];O(t[r])||(e[s]=t[r])}var n=lr({},e,t),o=t.__preview_external_dependency_versioned_paths;return O(o)||(O(t.strict_script_versioning)&&(n.strict_script_versioning=!!o),C(o)&&O(t.asset_host)&&(n.asset_host=o)),k(t.property_blacklist)&&(O(t.property_denylist)?n.property_denylist=t.property_blacklist:k(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:fe.error(Po+t.property_denylist)),n};class Bo{constructor(){this.__forceAllowLocalhost=!1}get tl(){return this.__forceAllowLocalhost}set tl(t){fe.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Lo{el(t){if(t){var e=this.Vh.indexOf(t);-1!==e&&this.Vh.splice(e,1)}}il(t,e){return this.el(t),this.Vh.push(e),null==e.initialize||e.initialize(),e}rl(){return this.config.cookieless_mode===Xi||this.config.cookieless_mode===Ki&&this.consent.isRejected()}sl(){if(!(this.nl||this.config.reuseAnonymousId||this.config.segment||this.rl())){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.ol||(r?(t="persistence is set to '"+this.config.persistence+"'",e="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(t="persistence is disabled (disable_persistence is true)",e="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.nl=!0,console.warn("[PostHog.js]",t+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+e+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+i)))}}al(){if(!this.rl()&&this.get_distinct_id()===Fi){var t=this.persistence;if(t){this.hl()||t.load(!0);var e=this.get_distinct_id();if(!e||e===Fi){var i=this.config.get_device_id($r());this.register({distinct_id:i,$device_id:i}),t.set_property(Ii,Qi)}this.ll()}}}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 Bo,this.ul=!1,this.version=v.LIB_VERSION,this.dl=new Set,this.vl="",this.Xh=new to,this.Vh=[],this.cl=[],this.ol=!1,this.nl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=No(),this.SentryIntegration=Xr,this.sentryIntegration=t=>function(t,e){var i=Kr(t,e);return{name:Yr,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._l=!1,this.pl=null,this.fl=null,this.gl=null,this.scrollManager=new Xn(this),this.pageViewManager=new Qr(this),this.rateLimiter=new Ys(this),this.requestRouter=new vo(this),this.consent=new Hr(this),this.externalIntegrations=new go(this);var e=null!==(t=Lo.__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.metrics=e.metrics&&new e.metrics(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=C(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=C(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>fe.info('send "'+(null==t?void 0:t.event)+'"',t))}init(t,e,i){if(i&&i!==Ao){var r,s=null!==(r=xo[i])&&void 0!==r?r:new Lo;return s._init(t,e,i),xo[i]=s,xo[Ao][i]=s,s}return this._init(t,e,i)}_init(e,i,r){var s,n,o;void 0===i&&(i={});var a,h=C(e)?e.trim():"";if(!h)return fe.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 h!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+h+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=No(i.defaults),i.debug=this.ml(i.debug),this.bl=i,this.wl=[],i.person_profiles?this.fl=i.person_profiles:i.process_person&&(this.fl=i.process_person);var l=No(i.defaults),u=Uo(i),d=lr({},l,u,{name:r,token:h});P(l.rageclick)&&P(u.rageclick)&&(d.rageclick=lr({},l.rageclick,u.rageclick)),P(l.session_recording)&&P(u.session_recording)&&(d.session_recording=lr({},l.session_recording,u.session_recording)),this.set_config(d),this.config.on_xhr_error&&fe.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:Cs.GZipJS;var c=this.hl();if(this.persistence=new Os(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Os(p({},this.config,{persistence:"sessionStorage"}),c,!1),this.vl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&qr.ro()){var _=qr.oo(this.vl);k(_)&&_.forEach(t=>{C(t)&&this.dl.add(t)})}else qr.mr(this.vl);var f=p({},this.persistence.props),g=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.yl=new Jn(t=>this.$l(t),this.config.request_queue_config),this.xl=new Kn(this),this.__request_queue=[];var m=this.rl();m||(this.sessionManager=new ro(this),this.sessionPropsManager=new Zn(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.El()})),this.Sl(),this.config.__preview_deferred_init_extensions?(fe.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Tl(m)},0)):(fe.info("Initializing extensions synchronously"),this.Tl(m)),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&fe.info("Starting in debug mode",{this:this,config:i,thisC:p({},this.config),p:f,s:g}),!this.config.identity_distinct_id||null!=(s=i.bootstrap)&&s.distinctID||(i.bootstrap=p({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var b=null==(n=i.bootstrap)?void 0:n.distinctID;if(this.ol=!!b&&!A(b),void 0!==(null==(o=i.bootstrap)?void 0:o.distinctID)){var w=i.bootstrap.distinctID,y=this.get_distinct_id(),x=this.persistence.get_property(Ii);if(i.bootstrap.isIdentifiedID&&null!=y&&y!==w&&x===Qi)this.identify(w);else if(i.bootstrap.isIdentifiedID&&null!=y&&y!==w&&x===Zi)fe.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 E=this.config.get_device_id($r()),S=i.bootstrap.isIdentifiedID?E:w;this.persistence.set_property(Ii,i.bootstrap.isIdentifiedID?Zi:Qi),this.register({distinct_id:w,$device_id:S})}}if(m)this.register_once({distinct_id:Fi,$device_id:null},"");else if(!this.get_distinct_id()){var T=this.config.get_device_id($r());this.register_once({distinct_id:T,$device_id:T},""),this.persistence.set_property(Ii,Qi)}return pr(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?Jr(this,()=>this.kl()):this.kl(),R(this.config._onCapture)&&this.config._onCapture!==So&&(fe.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&fe.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return so.apply(this,arguments)}().then(t=>{t&&this.register({[Te]:t})}).catch(So),this}Rl(t){var e=t;return C(e.name)&&R(e.setup)}Pl(t,e){this.Rl(t)?e.push(()=>{this.Il().add(t).catch(()=>null==t.dispose?void 0:t.dispose()).catch(e=>{fe.error('Failed to dispose browser extension "'+t.name+'"',e)})}):this.Vh.push(t)}Sl(){var t,e,i,r,s,n,o=null!==(t=null==(e=this.config.__extensionClasses)?void 0:e.featureFlags)&&void 0!==t?t:null==(i=Lo.__defaultExtensionClasses)?void 0:i.featureFlags;o&&(this.featureFlags&&this.featureFlags instanceof o||(null==(r=this.Ol)||r.call(this),this.Ol=void 0,this.featureFlags=new o(this)),R(this.featureFlags.onReloading)&&R(this.featureFlags.setup)?this.Ol||(this.Ol=this.featureFlags.onReloading(()=>{this.Xh.emit("featureFlagsReloading",!0)}),this.Il().add(this.featureFlags)):null==(s=(n=this.featureFlags).initialize)||s.call(n))}Tl(t){var e,i,r,s,n,o,a,h=performance.now(),l=p({},Lo.__defaultExtensionClasses,this.config.__extensionClasses),u=[];l.exceptions&&this.Vh.push(this.exceptions=null!==(e=this.exceptions)&&void 0!==e?e:new l.exceptions(this)),l.historyAutocapture&&this.Vh.push(this.historyAutocapture=new l.historyAutocapture(this)),l.tracingHeaders&&this.Vh.push(this.tracingHeaders=new l.tracingHeaders(this)),l.siteApps&&this.Vh.push(this.siteApps=new l.siteApps(this)),l.sessionRecording&&!t&&this.Vh.push(this.sessionRecording=new l.sessionRecording(this)),this.config.disable_scroll_properties||u.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),l.autocapture&&this.Pl(this.autocapture=new l.autocapture(this),u),l.surveys&&this.Pl(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new l.surveys(this),u),l.logs&&this.Pl(this.logs=null!==(r=this.logs)&&void 0!==r?r:new l.logs(this),u),l.metrics&&this.Vh.push(this.metrics=null!==(s=this.metrics)&&void 0!==s?s:new l.metrics(this)),l.conversations&&this.Vh.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new l.conversations(this)),l.productTours&&this.Vh.push(this.productTours=new l.productTours(this)),l.heatmaps&&this.Vh.push(this.heatmaps=new l.heatmaps(this)),l.webVitalsAutocapture&&this.Vh.push(this.webVitalsAutocapture=new l.webVitalsAutocapture(this)),l.exceptionObserver&&this.Vh.push(this.exceptionObserver=new l.exceptionObserver(this)),l.deadClicksAutocapture&&this.Vh.push(this.deadClicksAutocapture=new l.deadClicksAutocapture(this,Wr)),l.toolbar&&this.Vh.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new l.toolbar(this)),l.experiments&&this.Vh.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new l.experiments(this)),this.Vh.forEach(t=>{t.initialize&&u.push(()=>{null==t.initialize||t.initialize()})}),u.push(()=>{if(this.Cl){var t=this.Cl;this.Cl=void 0,this.Vh.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}}),this.Al(u,h)}Al(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout(()=>{this.Al(t,e)},0);var i=t.shift();if(i)try{i()}catch(t){fe.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Bi]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Li]:r}),this.config.__preview_deferred_init_extensions&&fe.info("PostHog extensions initialized ("+r+"ms)")}Yt(t){var e;if(!r||!r.body)return fe.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Yt(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Cl=t),this.Kh=t,this.compression=void 0,t.ok){var i,s=t.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=m(s.supportedCompression,Cs.GZipJS)?Cs.GZipJS:m(s.supportedCompression,Cs.Base64)?Cs.Base64:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.fl?this.fl:tr}),null==(e=this.Ml)||e.handleRemoteConfig(t),this.Vh.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}kl(){try{this.config.loaded(this)}catch(t){fe.critical("`loaded` function failed",t)}if(this.Dl(),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.rl())&&this.Nl()},1),this.Fl=new Xs(this),this.Fl.load()}Dl(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.yl)||t.enable())}_dom_loaded(){this.is_capturing()&&ar(this.__request_queue,t=>this.$l(t)),this.__request_queue=[],this.Dl()}_handle_unload(){var t,e,i,r,s;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.Ul()&&this.capture(sr),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.yl)||r.unload(),null==(s=this.xl)||s.unload()):this.Ul()&&this.capture(sr,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?Mo?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?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(O(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;var n,o,a,l,u,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&O(s.compression)&&s.data&&(s.compression=Cs.Base64),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(o=null==(u=(l=(k(n=s.data)?n:[n]).map(t=>p({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{})))[0])||null==(a=u.properties)?void 0:a.token)&&void 0!==o?o:null==u?void 0:u.token,batch:l,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),k(t)?t.map(t=>p({},t,{sent_at:e})):p({},t,{sent_at:e})}(s.data))),s.url=Gn(s.url,s.method,s.compression,s.timestampMode);var v=Wn.filter(t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport)),c=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(v,t=>t.transport===d))?void 0:r.method)&&void 0!==i?i:v[0].method;if(!c)throw new Error("No available transport method");var _=t=>{try{c(t)}catch(t){zn(t)?fe.warn(t):fe.error(t),null==s.callback||s.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&s.data&&s.compression===Cs.GZipJS&&h&&"undefined"!=typeof Promise&&!Mn?Ln(s).then(t=>{_(t)}).catch(e=>{if(de(e))return Mn=!0,void _(p({},s,{compression:void 0,url:Gn(t.url,t.method,void 0,t.timestampMode)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return de(t)||e===he})(e)&&(Mn=!0),_(s)}):c(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}))}$l(t){this.xl?this.xl.retriableRequest(t):this._send_request(t)}_execute_array(t){Eo++;try{var e,i=[],r=[],s=[];ar(t,t=>{if(t)if(k(e=t[0]))s.push(t);else if(R(t))try{t.call(this)}catch(e){fe.error("Error executing queued PostHog call",t,e)}else k(t)&&"alias"===e?i.push(t):k(t)&&-1!==e.indexOf("capture")&&R(this[e])?s.push(t):r.push(t)});var n=function(t,e){ar(t,function(t){try{if(k(t[0])){var i=e;hr(t,function(t){i=i[t[0]].apply(i,t.slice(1))})}else e[t[0]].apply(e,t.slice(1))}catch(e){fe.error("Error executing queued PostHog call",t,e)}})};n(i,this),n(r,this),n(s,this)}finally{Eo--}}push(t){if(Eo>0&&k(t)&&C(t[0])){var e=Lo.prototype[t[0]];R(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}Bl(){var t,e=null==(t=this.persistence)?void 0:t.get_property(Ie);return C(e)&&Oo.test(e)?{value:e,delivered:!1}:P(e)&&C(e.value)&&Oo.test(e.value)?{value:e.value,delivered:!0===e.delivered}:void 0}Ll(t,e,i,r){if(this.persistence){this.persistence.refreshKey(Ie);var s=this.Bl();if(!r){if(i)return C(e)&&Oo.test(e)?(e!==(null==s?void 0:s.value)&&this.persistence.register({[Ie]:{value:e,delivered:!1}}),{value:e,pending:e!==(null==s?void 0:s.value)||!s.delivered}):void this.persistence.unregister(Ie);if(C(t)&&Io.test(t)){if((null==s?void 0:s.value.split(".")[3])===t)return{value:s.value,pending:!s.delivered};var n="fb.1."+Date.now()+"."+t;return this.persistence.register({[Ie]:{value:n,delivered:!1}}),{value:n,pending:!0}}return s?{value:s.value,pending:!s.delivered}:void 0}this.persistence.unregister(Ie)}}jl(t){if(this.persistence){this.persistence.refreshKey(Ie);var e=this.Bl();(null==e?void 0:e.value)!==t||e.delivered||this.persistence.register({[Ie]:{value:t,delivered:!0}})}}capture(t,e,i){var r,s,n,o,a,h,l,u,d,v;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.yl){if(this.is_capturing())if(!O(t)&&C(t)){this.al();var c=!this.config.opt_out_useragent_filter&&this._is_bot();if(!c||this.config.__preview_capture_bot_pageviews){var _=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==_||!_.isRateLimited){var f;null!=e&&e.$current_url&&!C(null==e?void 0:e.$current_url)&&(fe.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._originatedFromCaptureException||fe.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&&(f=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 g=new Date,m=(null==i?void 0:i.timestamp)||g,b=re(null==i?void 0:i.uuid,$r),w={uuid:b,event:t,properties:this.calculateEventProperties(t,e||{},m,b)};t===rr&&this.config.__preview_capture_bot_pageviews&&c&&(w.event="$bot_pageview",w.properties.$browser_type="bot"),_&&(w.properties.$lib_rate_limit_remaining_tokens=_.remainingTokens);var y="$feature_flag_called"===t&&!1===w.properties.$feature_flag_has_experiment&&!0===this.get_property(hi);(null==i?void 0:i.$set)&&!y&&(w.$set=null==i?void 0:i.$set);var x=P(null==e?void 0:e.$set)?e.$set:void 0,E=!(null==i||!i.$set)&&Pe in i.$set,S=E||!!x&&Pe in x,T=E?null==i||null==(r=i.$set)?void 0:r[Pe]:null==x?void 0:x[Pe],R=k(null==e?void 0:e.$unset)?e.$unset:[],A=(null==i?void 0:i.$unset)||[],M=-1!==R.indexOf(Pe)||-1!==A.indexOf(Pe),N=this.Ll(null==(s=f)?void 0:s.fbclid,T,S,M);N&&!0===w.properties.$process_person_profile&&N.pending&&!S&&!y&&(w.$set=p({[Pe]:N.value},w.$set));var F=null==i?void 0:i.$unset;F&&(w.$unset=F);var U=y?void 0:this.zl(null==i?void 0:i.$set_once,t!==or,t===nr);if(U&&(w.$set_once=U),null!=i&&i._noTruncate||(l=this.config.properties_string_max_length,u=w,d=t=>C(t)?t.slice(0,l):t,v=new Set,w=function t(e,i){if(e!==Object(e))return d?d(e):e;if(!v.has(e)){var r;if(v.add(e),k(e))r=[],ar(e,e=>{r.push(t(e))});else{var s={};hr(j(e)?vr(e):e,(e,i)=>{v.has(e)||(s[i]=t(e,i))}),r=s}return r}}(u)),w.timestamp=m,O(null==i?void 0:i.timestamp)||(w.properties.$event_time_override_provided=!0,w.properties.$event_time_override_system_time=g),y&&(w.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return ae.forEach(r),e.forEach(r),i}(w.properties,Co)),t===js.DISMISSED||t===js.SENT){var B=null==e?void 0:e[zs.SURVEY_ID],L=null==e?void 0:e[zs.SURVEY_ITERATION];(t=>{try{var e=(t=>((t,e)=>"seenSurvey_"+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e))(0,t))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){co.error("Failed to persist survey seen state",t)}})({id:B,current_iteration:L}),w.$set=p({},w.$set,{[no({id:B,current_iteration:L},t===js.SENT?"responded":"dismissed")]:!0})}else t===js.SHOWN&&(w.$set=p({},w.$set,{[zs.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===Ws.SHOWN){var z=null==e?void 0:e[Vs.TOUR_TYPE];z&&(w.$set=p({},w.$set,{[Vs.TOUR_LAST_SEEN_DATE+"/"+z]:(new Date).toISOString()}))}var q=p({},w.properties.$set,w.$set);if(I(q)||this.setPersonPropertiesForFlags(q),!D(this.config.before_send)){var H=this.G(w);if(!H)return;(w=H).uuid=re(w.uuid,$r)}var G=null!==(n=null==(o=w.$set)?void 0:o[Pe])&&void 0!==n?n:P(null==(a=w.properties)?void 0:a.$set)?w.properties.$set[Pe]:void 0,W=null!=N&&N.pending&&G===N.value?N.value:void 0;this.Xh.emit("eventCaptured",w);var V=null!==(h=null==i?void 0:i._url)&&void 0!==h?h:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),J=p({method:"POST",url:V,data:w,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(V)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},W?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.jl(W)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||W?this.$l(J):this.yl.enqueue(J),w}fe.critical("This capture call is ignored due to client rate limiting.")}}else fe.error("No event name provided to posthog.capture")}else fe.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",e=>t(e.event,e))}getExtension(t){var e;return null==(e=this.Ml)?void 0:e.getExtension(t)}Il(){var t;return null!==(t=this.Ml)&&void 0!==t?t:this.Ml=new yo(this)}Zh(t){this.cl.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.cl.indexOf(t);-1!==i&&this.cl.splice(i,1)}}}ql(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.gl=null,this.persistence.get_property(Ii)===Qi&&(null==(r=this.sessionPersistence)||r.clear(),this.dl.clear(),this.Hl()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,i,n,o,a){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return i;this.persistence.syncCookieProperties(),this.ql();var h=a?void 0:this.persistence.remove_event_timer(e),u=p({},i);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.rl()&&(u[Ui]=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=d.distinct_id,(!C(u.distinct_id)&&!N(u.distinct_id)||A(u.distinct_id))&&fe.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var c,_=function(e,i,r,n){var o,a,h,u;if(void 0===n&&(n=!1),!l)return{};var d,c=e?[...hs,...i||[]]:[],_=function(t){for(var e=0;Qt.length>e;e++){var i=Qt[e],r=i[1],s=i[0].exec(t),n=s&&(R(r)?r(s,t):r);if(n)return n}return["",""]}(l),p=_[0],f=_[1],g=function(t){for(var e=0;ee.length>e;e++){var i=ee[e],r=i[1],s=i[2],n=t.match(i[0]);if(n){var o=s&&t.match(s)||n;return[r,(null==o?void 0:o[1])||""]}}return["",""]}(l),m=g[0],b=g[1],w=null!=(d="u">typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},y={};O(r)||(y.detectGoogleSearchApp=r);var x={},E=null==(o=navigator)||null==(o=o.userAgentData)?void 0:o.platform,S=null==(a=navigator)?void 0:a.maxTouchPoints,T=null==t||null==(h=t.screen)?void 0:h.width,k=null==t||null==(u=t.screen)?void 0:u.height,P=null==t?void 0:t.devicePixelRatio;O(E)||(x.userAgentDataPlatform=E),O(S)||(x.maxTouchPoints=S),O(T)||(x.screenWidth=T),O(k)||(x.screenHeight=k),O(P)||(x.devicePixelRatio=P);var I,C,A,M,D,N,F,U,B=lr(dr({$os:p,$os_version:f,$browser:Yt(l,navigator.vendor,w,y),$webview_app:m,$webview_app_version:b,$device:Zt(l),$device_type:(C=l,A=x,U=Zt(C),U===X||U===K||"Kobo"===U||"Kindle Fire"===U||U===kt?Y:U===ft||U===mt||U===gt||U===Et?"Console":U===Z?"Wearable":U?W:"Android"===(null==A?void 0:A.userAgentDataPlatform)&&(null!==(M=null==A?void 0:A.maxTouchPoints)&&void 0!==M?M:0)>0?600>Math.min(null!==(D=null==A?void 0:A.screenWidth)&&void 0!==D?D:0,null!==(N=null==A?void 0:A.screenHeight)&&void 0!==N?N:0)/(null!==(F=null==A?void 0:A.devicePixelRatio)&&void 0!==F?F:1)?W:Y:"Desktop"),$timezone:bs(),$timezone_offset:ws()}),{$current_url:os(n?ne(null==s?void 0:s.href):null==s?void 0:s.href,c,us),$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:Xt(l,navigator.vendor,w,y),$browser_language:_s(),$browser_language_prefix:(I=_s(),"string"==typeof I?I.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&&(B.$sdk_dist_channel=v.SDK_DIST_CHANNEL),B}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var f=this.sessionManager.checkAndGetSessionAndWindowId(a,n.getTime(),!0),g=f.windowId;u.$session_id=f.sessionId,u.$window_id=g}this.sessionPropsManager&&lr(u,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&lr(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=null==(m=this.xl)?void 0:m.length}catch(t){u.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===ao&&(u.$lib_custom_api_host=this.config.api_host),c=e!==rr||a?e!==sr||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,o),u=lr(u,c),e===rr&&r&&(u.title=r.title),!O(h)){var b=n.getTime()-h;u.$duration=parseFloat((b/1e3).toFixed(3))}l&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var w=this.persistence.properties(),y=this.sessionPersistence.properties(),x=u.$groups,E=w.$groups;P(x)&&!I(x)&&(u.$groups=p({},P(E)?E:{},x)),hr(["$referrer","$referring_domain"],t=>{t in w&&delete y[t]});var S={};if(this.cl.length>0)for(var T of this.cl.slice())try{lr(S,T())}catch(t){fe.error("Failed to produce browser extension event properties",t)}(u=lr({},_,w,y,p({},S,u))).$is_identified=this._isIdentified(),k(this.config.property_denylist)?hr(this.config.property_denylist,function(t){delete u[t]}):fe.error(Po+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var M=this.config.sanitize_properties;M&&(fe.error(Ro),u=M(u,e));var D=this.Gl();return u.$process_person_profile=D,D&&!a&&this.Wl("_calculate_event_properties"),u}zl(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Gl())return t;if(this.ul&&!i)return t;var s=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=lr({},s,n||{},t||{}),a=this.config.sanitize_properties;return a&&(fe.error(Ro),o=a(o,"$set_once")),e&&(this.ul=!0),I(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,i;null==(e=this.persistence)||e.syncCookieProperties(),this.ql(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach(t=>this.dl.add(t)),this.Hl()}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t),this.dl.delete(t),this.Hl()}Vl(t,e){this.register({[t]:e})}El(){this.dl.forEach(t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)}),this.dl.clear(),this.Hl()}Hl(){var t;if(this.vl)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.Lo||!qr.ro())qr.mr(this.vl);else{var e=[];this.dl.forEach(t=>e.push(t)),e.length>0?qr.gr(this.vl,e):qr.mr(this.vl)}}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e))&&void 0!==i?i:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.Xh.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:ko}),()=>{})}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:ko})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:ko})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=_o),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:ko}}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:ko})}Jl(t){return!t||A(t)?(fe.critical("Unique user id has not been set in posthog.identify"),!1):t===Fi?(fe.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())||(fe.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 fe.uninitializedWarning("posthog.identify");if(N(t)&&(t=t.toString(),fe.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Jl(t)&&this.Wl("posthog.identify")){this.al();var r=this.get_distinct_id(),s=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,n=this.ql(!1),o=this.persistence.$a(),a=!1;try{var h=this.get_distinct_id();this.register({$user_id:t}),this.get_property(Se)||this.register_once({$had_persisted_distinct_id:!0,$device_id:h},""),t!==h&&t!==this.get_property(ke)&&(this.unregister(ke),this.register({distinct_id:t}));var l=(this.persistence.get_property(Ii)||Qi)===Qi,u=t!==h,d=!u&&l;if(u&&l){var v,c=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:h};this.persistence.set_property(Ii,Zi),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.xa(),this.capture(nr,c,{$set:e||{},$set_once:i||{}}),this.gl=oo(t,e,i),null==(v=this.featureFlags)||v.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:h)}else if(d){this.persistence.set_property(Ii,Zi);var _=e||{},p=i||{};this.setPersonPropertiesForFlags({$set:_,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.xa(),this.capture("$set",{$set:_,$set_once:p}),this.gl=oo(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);u||s||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Ti)):d&&(e||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.Ta(a)}}}setPersonProperties(t,e){if((t||e)&&this.Wl("posthog.setPersonProperties")){var i=oo(this.get_distinct_id(),t,e);this.gl!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.gl=i):fe.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(k(t)?t:[t]).filter(t=>C(t)&&t.length>0);0!==i.length&&this.Wl("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.gl=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.ql();var s=this.getGroups(),n=s[t]!==e;if(n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},s,{[t]:e})}),(n||i)&&this.Gl()){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(or,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),n&&!i&&this.reloadFeatureFlags()}else fe.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.Wl("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e=U(t)?t:null==t?void 0:t.resetDeviceID,i=U(t)||null==t?void 0:t.bootstrap;this.Yl(e,!1,i)}Yl(t,e,i){var r,s,n,o;if(void 0===e&&(e=!1),fe.info("reset"),!this.__loaded)return fe.uninitializedWarning("posthog.reset");var a=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.bl)?void 0:r.bootstrap)||{},null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this._shouldDisableFlags());var h=this.get_property(Se),l=this.get_property(Te),u=this.get_property(ze);null==(n=this.sessionRecording)||n.flushBeforeIdentityReset();var d=this.is_capturing();this.consent.reset(),e||!d||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var v=null==(o=this.persistence)||null==o.$a?void 0:o.$a(),c=!1;try{var _,f,g,m,b,w,y,x,E,S,T,k,R;if(null==(_=this.persistence)||_.clear(),null==(f=this.sessionPersistence)||f.clear(),this.dl.clear(),this.Hl(),O(u)||null==(S=this.persistence)||S.register({[ze]:u}),null==(g=this.surveys)||g.reset(),null==(m=this.featureFlags)||m.reset(),null==(b=this.conversations)||b.reset(),null==(w=this.logs)||w.reset(),null==(y=this.metrics)||y.reset(),null==(x=this.persistence)||x.set_property(Ii,Qi),null==(E=this.sessionManager)||E.resetSessionId(),this.gl=null,this.config.cookieless_mode===Xi)this.register_once({distinct_id:Fi,$device_id:null},"");else{var P=this.config.get_device_id($r());this.register_once({distinct_id:P,$device_id:t?P:h},""),t||O(l)||this.register({[Te]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.rl()||(null==(R=this.persistence)||R.set_property(Ii,i.isIdentifiedID?Zi:Qi),this.register({distinct_id:i.distinctID})),null==(T=this.featureFlags)||T.initialize(),!(O(a)||null!=(k=this.sessionManager)&&k.setBootstrapSessionId(a,!0))){var I=p({},i);delete I.sessionID,this.config.bootstrap=I}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,c=!0}finally{var C;v&&(null==(C=this.persistence)||null==C.Ta||C.Ta(c))}this.reloadFeatureFlags()}shutdown(t){var e=this;return _(function*(){var t,i,r,s,n,o,a;if(e.__loaded){e.Il().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(s=e.yl)||s.unload(),null==(n=e.xl)||n.unload();try{var h;null==(h=e.featureFlags)||h.destroy()}catch(t){fe.error("Error while destroying feature flags",t)}null==(o=e.persistence)||o.destroy(),null==(a=e.sessionPersistence)||a.destroy()}else fe.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,e){var i;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i._onIdentityChanged()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t._onIdentityCleared()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=e.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&i){var s,n=null!==(s=t.timestampLookBack)&&void 0!==s?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(t,e){return t===this.get_property(xe)?(fe.critical("Attempting to create alias for existing People user - aborting."),-2):this.Wl("posthog.alias")?(O(e)&&(e=this.get_distinct_id()),t!==e?(this.Vl(ke,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(fe.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(P(t)){var i,r,s,n,o,a,h,l,u,d,c,_;lr(this.config,Uo(t));var f=this.hl();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Os(p({},this.config,{persistence:"sessionStorage"}),f,!1);var g,m=this.ml(this.config.debug);U(m)&&(this.config.debug=m),U(this.config.debug)&&(this.config.debug?(v.DEBUG=!0,Pr.ro()&&Pr.gr("ph_debug",!0),fe.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(v.DEBUG=!1,Pr.ro()&&Pr.mr("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this._shouldDisableFlags()),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(n=this.exceptions)||n.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(h=this.autocapture)||h.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(g=this.historyAutocapture)||g.startIfEnabledOrStop()),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.ll(),null==(_=this.externalIntegrations)||_.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&Jr(this,So,!1)}}_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){try{if(!this.exceptions)return;var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(p({},r,e))}catch(t){return}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:Lo.Kl}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:Ao;return e!==Ao&&(e=Ao+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Ii))===Zi||(null==(e=this.sessionPersistence)?void 0:e.get_property(Ii))===Zi}Gl(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===tr&&!this._isIdentified()&&I(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[ke])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ni]))}Ul(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Gl()||this.Wl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Wl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Wl(t){return"never"===this.config.person_profiles?(fe.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.sl(),this.Vl(Ni,!0),!0)}hl(){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!==Ki)}ll(){var t,e,i,r,s,n=this.hl();return this.is_capturing()||null==(i=this.logs)||i._onOptOut(),(null==(t=this.persistence)?void 0:t.Lo)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.Lo)!==n&&(null==(s=this.sessionPersistence)||s.set_disabled(n)),n&&(this.dl.clear(),this.Hl()),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Xi){if(this.rl()){var i,r,s,n,o,a;null==(i=this.sessionRecording)||i.dispose({discardBufferedEvents:!0}),this.Yl(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(s=this.pageViewManager)||s.destroy(),this.sessionManager=new ro(this),this.pageViewManager=new Qr(this),this.persistence&&(this.sessionPropsManager=new Zn(this,this.sessionManager,this.persistence));var h,l=null!==(n=null==(o=this.config.__extensionClasses)?void 0:o.sessionRecording)&&void 0!==n?n:null==(a=Lo.__defaultExtensionClasses)?void 0:a.sessionRecording;l&&(this.sessionRecording=this.il(this.sessionRecording,new l(this)),this.Kh&&(null==(h=this.sessionRecording)||null==h.onRemoteConfig||h.onRemoteConfig(this.Kh)))}var u,d;this.consent.optInOut(!0),this.ll(),this.Dl(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ki&&(null==(u=this.surveys)||u.loadIfEnabled()),(O(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(d=null==t?void 0:t.captureEventName)&&void 0!==d?d:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Nl()}else fe.warn(To)}opt_out_capturing(){if(this.config.cookieless_mode!==Xi){var t,e,i=this.config.cookieless_mode===Ki?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode===Ki&&this.consent.isOptedIn()&&this.Yl(!0,!0),this.consent.optInOut(!1),this.ll(),this.config.cookieless_mode===Ki&&(this.register({distinct_id:Fi,$device_id:null}),this.el(i),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Nl(),this.Dl())}else fe.warn(To)}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===Xi||(this.config.cookieless_mode===Ki?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.ll()}_is_bot(){return i?function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&g(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>g(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver}(i,this.config.custom_blocked_useragents):void 0}Nl(){r&&("visible"===r.visibilityState?this._l||(this._l=!0,this.capture(rr,{title:r.title},{send_instantly:!0}),this.pl&&(r.removeEventListener(er,this.pl),this.pl=null)):this.pl||(this.pl=this.Nl.bind(this),pr(r,er,this.pl)))}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}))}_shouldDisableFlags(){var t=this.bl||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(fe.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(t,e,i,r,s){var n=e in t&&!D(t[e]),o=i in t&&!D(t[i]);return n?t[e]:!!o&&(s&&s.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,fe)}G(t){var e;if(D(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(L),r=k(this.config.before_send)?this.config.before_send:[this.config.before_send],s=t;for(var n of r)try{if(s=n(s),D(s)){var o="Event '"+t.event+"' was rejected in beforeSend function";return B(t.event)?fe.warn(o+". This can cause unexpected behavior."):fe.info(o),null}s.properties&&!I(s.properties)||fe.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return fe.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(s.properties&&D(s.properties[a]))return fe.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.co)?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)})}ml(t){var e=U(t)&&!t,i=Pr.ro()&&"true"===Pr.no("ph_debug");return!e&&(!!i||t)}}Lo.__defaultExtensionClasses={},Lo.Kl={trace:$o=()=>{},debug:$o,info:$o,warn:$o,error:$o,fatal:$o},function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=ur(t.prototype[e[i]])}(Lo,["identify"]);var jo=function(){v.SDK_DIST_CHANNEL="npm";var e=xo[Ao]=new Lo;return function(){function e(){e.done||(e.done=!0,Mo=!1,hr(xo,function(t){t._dom_loaded()}))}null!=r&&r.addEventListener?"complete"===r.readyState?e():pr(r,"DOMContentLoaded",e,{capture:!1}):t&&fe.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}();export{Cs as Compression,Gs as DEFAULT_PRODUCT_TOUR_APPEARANCE,qs as DisplaySurveyType,Lo as PostHog,Ws as ProductTourEventName,Vs as ProductTourEventProperties,js as SurveyEventName,zs as SurveyEventProperties,As as SurveyEventType,Ds as SurveyPosition,Bs as SurveyQuestionBranchingType,Us as SurveyQuestionType,Ls as SurveySchedule,Ns as SurveyTabPosition,Fs as SurveyType,Ms as SurveyWidgetType,jo as default,jo as posthog,Qs as severityLevels};
|
|
1
|
+
var t="u">typeof window?window:void 0,e="u">typeof globalThis?globalThis:t,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,h=null==e?void 0:e.CompressionStream,l=null==i?void 0:i.userAgent,u="undefined"!=typeof globalThis?globalThis:t;u&&"undefined"==typeof self&&(u.self=u),u&&"undefined"==typeof File&&(u.File=function(){});var d=null!=t?t:{},v={DEBUG:!1,LIB_VERSION:"0.8.2",LIB_NAME:"browser-common"};function c(t,e,i,r,s,n,o){try{var a=t[n](o),h=a.value}catch(t){return void i(t)}a.done?e(h):Promise.resolve(h).then(r,s)}function _(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=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterestbot","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],g=function(t,e){if(void 0===e&&(e=[]),!t)return!1;var i=t.toLowerCase();return f.concat(e).some(t=>{var e=t.toLowerCase();return-1!==i.indexOf(e)})};function m(t,e){return-1!==t.indexOf(e)}var b=function(t){return t.replace(/^\$/,"")},w=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),y=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],x=["token"],E=Object.prototype,S=E.hasOwnProperty,T=E.toString,k=Array.isArray||function(t){return"[object Array]"===T.call(t)},R=t=>"function"==typeof t,P=t=>t===Object(t)&&!k(t),I=t=>{if(P(t)){for(var e in t)if(S.call(t,e))return!1;return!0}return!1},O=t=>void 0===t,C=t=>"[object String]"==T.call(t),A=t=>C(t)&&0===t.trim().length,M=t=>null===t,D=t=>O(t)||M(t),N=t=>"[object Number]"==T.call(t)&&t==t,F=t=>N(t)&&t>0,U=t=>"[object Boolean]"===T.call(t),B=t=>m(y,t),L=t=>m(x,t);function j(t){switch({}.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return function(t,e){try{return t instanceof e}catch(t){return!1}}(t,Error)}}var z=[!0,"true",1,"1","yes"],q=t=>m(z,t),H=[!1,"false",0,"0","no"];function G(t,e,i,r,s){return e>i&&(r.warn("min cannot be greater than max."),e=i),N(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),G(null!=s?s:i,e,i,r))}var W="Mobile",V="iOS",J="Android",Y="Tablet",K=J+" "+Y,X="iPad",Q="Apple",Z=Q+" Watch",tt="Safari",et="BlackBerry",it="Samsung",rt=it+"Browser",st=it+" Internet",nt="Chrome",ot=nt+" OS",at=nt+" "+V,ht="Internet Explorer",lt=ht+" "+W,ut="Opera",dt=ut+" Mini",vt="Edge",ct="Microsoft "+vt,_t="Firefox",pt=_t+" "+V,ft="Nintendo",gt="PlayStation",mt="Xbox",bt=J+" "+W,wt=W+" "+tt,yt="Windows",$t=yt+" Phone",xt="Nokia",Et="Ouya",St="Generic",Tt=St+" "+W.toLowerCase(),kt=St+" "+Y.toLowerCase(),Rt="Konqueror",Pt="Oculus Browser",It="Vivaldi",Ot="Yandex",Ct="Whale",At="DuckDuckGo",Mt="Pale Moon",Dt="Waterfox",Nt="Brave",Ft="Claude",Ut="Codex",Bt="ChatGPT",Lt="Google Search App",jt="(\\d+(\\.\\d+)?)",zt=new RegExp("Version/"+jt),qt=new RegExp("("+Ft+"|"+Ut+"|"+Bt+")\\/"+jt),Ht=new RegExp(mt,"i"),Gt=new RegExp(gt+" \\w+","i"),Wt=new RegExp(ft+" \\w+","i"),Vt=new RegExp(et+"|PlayBook|BB10","i"),Jt={"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"},Yt=function(t,e,i,r){e=e||"";var s=function(t){return null!=t&&t.brave?Nt:null}(i);return s||(null!=r&&r.detectGoogleSearchApp&&m(t,"GSA/")?Lt:m(t," OPR/")&&m(t,"Mini")?dt:m(t," OPR/")?ut:Vt.test(t)?et:m(t,"IE"+W)||m(t,"WPDesktop")?lt:m(t,"OculusBrowser")?Pt:m(t,rt)?st:m(t,vt)||m(t,"Edg/")?ct:m(t,It+"/")?It:m(t,"YaBrowser/")?Ot:m(t,Ct+"/")?Ct:m(t,At+"/")||m(t,"Ddg/")?At:m(t,Ft+"/")?Ft:m(t,Ut+"/")?Ut:m(t,Bt+"/")?Bt:m(t,"FBIOS")?"Facebook "+W:m(t,"UCWEB")||m(t,"UCBrowser")?"UC Browser":m(t,"CriOS")?at:m(t,"CrMo")||m(t,nt)?nt:m(t,J)&&m(t,tt)?bt:m(t,"FxiOS")?pt:m(t.toLowerCase(),Rt.toLowerCase())?Rt:m(t,Nt+"/")?Nt:((t,e)=>e&&m(e,Q)||function(t){return m(t,tt)&&!m(t,nt)&&!m(t,J)}(t))(t,e)?m(t,W)?wt:tt:m(t,"PaleMoon/")?Mt:m(t,Dt+"/")?Dt:m(t,_t)?_t:m(t,"MSIE")||m(t,"Trident/")?ht:m(t,"Gecko")?_t:"")},Kt={[lt]:[new RegExp("rv:"+jt)],[ct]:[new RegExp(vt+"?\\/"+jt)],[nt]:[new RegExp("("+nt+"|CrMo)\\/"+jt)],[at]:[new RegExp("CriOS\\/"+jt)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+jt)],[tt]:[zt],[wt]:[zt],[ut]:[new RegExp("(Opera|OPR)\\/"+jt)],[_t]:[new RegExp(_t+"\\/"+jt)],[pt]:[new RegExp("FxiOS\\/"+jt)],[Rt]:[new RegExp("Konqueror[:/]?"+jt,"i")],[et]:[new RegExp(et+" "+jt),zt],[bt]:[new RegExp("android\\s"+jt,"i")],[st]:[new RegExp(rt+"\\/"+jt)],[Pt]:[new RegExp("OculusBrowser\\/"+jt)],[It]:[new RegExp(It+"\\/"+jt)],[Ot]:[new RegExp("YaBrowser\\/"+jt)],[Ct]:[new RegExp(Ct+"\\/"+jt)],[Nt]:[new RegExp(Nt+"\\/"+jt)],[Ft]:[qt],[Ut]:[qt],[Bt]:[qt],[At]:[new RegExp("(DuckDuckGo|Ddg)\\/"+jt)],[Mt]:[new RegExp("PaleMoon\\/"+jt)],[Dt]:[new RegExp(Dt+"\\/"+jt)],[Lt]:[new RegExp("GSA\\/"+jt)],[ht]:[new RegExp("(rv:|MSIE )"+jt)],Mozilla:[new RegExp("rv:"+jt)]},Xt=function(t,e,i,r){var s=Yt(t,e,i,r),n=Kt[s];if(O(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},Qt=[[new RegExp(mt+"; "+mt+" (.*?)[);]","i"),t=>[mt,t&&t[1]||""]],[new RegExp(ft,"i"),[ft,""]],[new RegExp(gt,"i"),[gt,""]],[Vt,[et,""]],[new RegExp(yt,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[$t,""];if(new RegExp(W).test(e)&&!/IEMobile\b/.test(e))return[yt+" "+W,""];var i=/Windows NT ([0-9.]+)/i.exec(e);if(i&&i[1]){var r=Jt[i[1]]||"";return/arm/i.test(e)&&(r="RT"),[yt,r]}return[yt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>t&&t[3]?[V,[t[3],t[4],t[5]||"0"].join(".")]:[V,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=O(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+J+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+J+")","i"),t=>t&&t[2]?[J,[t[2],t[3],t[4]||"0"].join(".")]:[J,""]],[/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/,[ot,""]],[/Linux|debian/i,["Linux",""]]],Zt=function(t){return Wt.test(t)?ft:Gt.test(t)?gt:Ht.test(t)?mt:new RegExp(Et,"i").test(t)?Et:new RegExp("("+$t+"|WPDesktop)","i").test(t)?$t:/iPad/.test(t)?X:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Z:Vt.test(t)?et:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(xt,"i").test(t)?xt:/(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(W).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)?J:K:new RegExp("(pda|"+W+")","i").test(t)?Tt:new RegExp(Y,"i").test(t)&&!new RegExp(Y+" pc","i").test(t)?kt:""},te=/\bFBAV\/(\d+(?:\.\d+)*)/i,ee=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",te],[/\bFBAN\/EMA\b/i,"Facebook Lite",te],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",te],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],ie=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function re(t,e){return"string"==typeof(i=t)&&ie.test(i)?t:e();var i}function se(t,e){var i=new Error(e);try{Object.defineProperty(i,"name",{value:t,writable:!0,enumerable:!0,configurable:!0})}catch(t){}return i}function ne(t){return t?t.split("#")[0]:t}var oe,ae=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],he="NativeGzipValidationError",le=t=>t.length>=2&&31===t[0]&&139===t[1],ue=(t,e)=>t===w.GZipJS||e===w.GZipJS||"gzip"===e,de=t=>!(!t||"object"!=typeof t)&&"NotReadableError"===("name"in t?String(t.name):""),ve=t=>{throw se(he,"Native gzip produced invalid output: "+t)},ce=function(){var t=_(function*(t,e){18>t.size&&ve("too-short");var i=new Uint8Array(yield t.slice(0,10).arrayBuffer());le(i)&&8===i[2]||ve("invalid-header");var r=new DataView(yield t.slice(t.size-8).arrayBuffer());r.getUint32(0,!0)!==(t=>{for(var e=(()=>{if(oe)return oe;oe=[];for(var t=0;256>t;t++){for(var e=t,i=0;8>i;i++)e=1&e?3988292384^e>>>1:e>>>1;oe[t]=e>>>0}return oe})(),i=4294967295,r=0;t.length>r;r++)i=e[255&(i^t[r])]^i>>>8;return(4294967295^i)>>>0})(e)&&ve("invalid-crc");var s=e.length>>>0;r.getUint32(4,!0)!==s&&ve("invalid-size")});return function(e,i){return t.apply(this,arguments)}}();function _e(){return _e=_(function*(t,e,i){void 0===e&&(e=!0);try{var r=(new TextEncoder).encode(t),s=new globalThis.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(),h=(yield Promise.all([a,o]))[0];return yield ce(h,r),h}catch(t){if(null!=i&&i.rethrow)throw t;return e&&console.error("Failed to gzip compress data",t),null}}),_e.apply(this,arguments)}var pe=function(e,i){var r=(void 0===i?{}:i).debugEnabled,s={Et(i){if(t&&(v.DEBUG||t.POSTHOG_DEBUG||r)&&!O(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.Et("debug",...e)},info(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.Et("log",...e)},warn(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.Et("warn",...e)},error(){for(var t=arguments.length,e=new Array(t),i=0;t>i;i++)e[i]=arguments[i];s.Et("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)=>pe(e+" "+t,i)};return s},fe=pe("[PostHog.js]"),ge=fe.createLogger,me=ge("[ExternalScriptsLoader]"),be=t=>{var e=null==r?void 0:r.querySelectorAll("script");if(e)for(var i=0;e.length>i;i++)if(e[i].src===t||e[i].getAttribute("src")===t)return e[i]},we=(t,e,i)=>{if(t.config.disable_external_dependency_loading)return me.warn(e+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=be(e);if(s){if(s.__posthog_loading_callback_fired)return i();var n=s.__posthog_loading_error;return n?i(n):(s.addEventListener("load",t=>{s.__posthog_loading_callback_fired=!0,i(void 0,t)}),void s.addEventListener("error",t=>{s.__posthog_loading_error=t,i(t)}))}var o=()=>{if(!r)return i("document not found");if(be(e))return we(t,e,i);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=>{s.__posthog_loading_error=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?o():null==r||r.addEventListener("DOMContentLoaded",o)},ye={},$e=(t,e)=>{var i="/static/"+e+".js?v="+t.version;if("toolbar"===e){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}return t.requestRouter.endpointFor("assets",i)};d.__PosthogExtensions__=d.__PosthogExtensions__||{},d.__PosthogExtensions__.loadExternalDependency=(t,e,i)=>{if("remote-config"!==e){var r=t.config.strict_script_versioning;if(r){var s=t.requestRouter.endpointFor("assets","/static/"+t.version+"/"+e+".js"),n=ye[s];if("fallback"===r&&n){if(be(n))return void we(t,n,i);delete ye[s]}we(t,s,"fallback"===r?(r,n)=>{if(r)if("string"==typeof r)i(r);else{var o,a=$e(t,e);ye[s]=a;var h=be(s);null==h||null==(o=h.parentNode)||o.removeChild(h),we(t,a,i)}else i(void 0,n)}:i)}else we(t,$e(t,e),i)}else{var o=t.requestRouter.endpointFor("assets","/array/"+t.config.token+"/config.js");we(t,o,i)}},d.__PosthogExtensions__.loadSiteApp=(t,e,i)=>{var r=t.requestRouter.endpointFor("api",e);we(t,r,i)};v.DEBUG=!1,v.LIB_VERSION="1.428.4",v.LIB_NAME="web";var xe="$people_distinct_id",Ee="distinct_id",Se="$device_id",Te="$device_model",ke="__alias",Re="__cmpns",Pe="$fbc",Ie="$fbc_persistence",Oe="__timers",Ce="$autocapture_disabled_server_side",Ae="$heatmaps_enabled_server_side",Me="$exception_capture_enabled_server_side",De="$error_tracking_suppression_rules",Ne="$error_tracking_capture_extension_exceptions",Fe="$web_vitals_enabled_server_side",Ue="$dead_clicks_enabled_server_side",Be="$product_tours_enabled_server_side",Le="$logs_capture_enabled_server_side",je="$web_vitals_allowed_metrics",ze="$session_recording_remote_config",qe="$session_recording_enabled_server_side",He="$replay_sample_rate",Ge="$replay_override_sampling",We="$replay_override_linked_flag",Ve="$replay_override_url_trigger",Je="$replay_override_event_trigger",Ye="$sesid",Ke="$session_is_sampled",Xe="$session_past_minimum_duration",Qe="$session_recording_url_trigger_activated_session",Ze="$session_recording_event_trigger_activated_session",ti="$debug_first_full_snapshot_timestamp",ei="$sess_rec_flush_size",ii="$enabled_feature_flags",ri="$active_feature_flags",si="$early_access_features",ni="$feature_flag_details",oi="$feature_flag_payloads",ai="$feature_flag_request_id",hi="$minimal_flag_called_events",li="$override_feature_flags",ui="$override_feature_flag_payloads",di="$stored_person_properties",vi="$stored_group_properties",ci="$groups",_i="$surveys",pi="$surveys_loaded_at",fi="$surveys_activated",gi="$surveys_activated_session",mi="$surveys_activated_timestamps",bi="ph_product_tours",wi="$product_tours_activated",yi="$product_tours_activated_session",$i="$conversations_widget_session_id",xi="$conversations_ticket_id",Ei="$conversations_widget_state",Si="$conversations_user_traits",Ti="$flag_call_reported",ki="$flag_call_reported_session_id",Ri="$feature_flag_errors",Pi="$feature_flag_evaluated_at",Ii="$user_state",Oi="$client_session_props",Ci="$capture_rate_limit",Ai="$initial_campaign_params",Mi="$initial_referrer_info",Di="$initial_person_info",Ni="$epp",Fi="$posthog_cookieless",Ui="$cookieless_mode",Bi="$sdk_debug_extensions_init_method",Li="$sdk_debug_extensions_init_time_ms",ji="$sdk_debug_recording_script_not_loaded",zi="$sdk_debug_replay_event_trigger_status",qi="$sdk_debug_replay_linked_flag_trigger_status",Hi="$sdk_debug_replay_matched_recording_trigger_groups",Gi="$sdk_debug_replay_pending_trigger_conditions",Wi="$sdk_debug_replay_remote_trigger_matching_config",Vi="$sdk_debug_replay_trigger_groups_count",Ji="$sdk_debug_replay_url_trigger_status",Yi="$session_recording_start_reason",Ki="on_reject",Xi="always",Qi="anonymous",Zi="identified",tr="identified_only",er="visibilitychange",ir="beforeunload",rr="$pageview",sr="$pageleave",nr="$identify",or="$groupidentify";function ar(t,e){k(t)&&t.forEach(e)}function hr(t,e){if(!D(t))if(k(t))t.forEach(e);else if((t=>t instanceof FormData)(t))t.forEach((t,i)=>e(t,i));else for(var i in t)S.call(t,i)&&e(t[i],i)}var lr=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},ur=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){fe.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),fe.critical(t)}}},dr=function(t){var e={};return hr(t,function(t,i){(C(t)&&t.length>0||N(t))&&(e[i]=t)}),e};function vr(t){var e=p({},t);for(var i of["name","message","stack","cause","errors"])try{i in t&&(e[i]=t[i])}catch(t){}return e}var cr=["herokuapp.com","vercel.app","netlify.app"];function _r(t){var e=null==t?void 0:t.hostname;if(!C(e))return!1;var i=e.split(".").slice(-2).join(".");for(var r of cr)if(i===r)return!1;return!0}function pr(t,e,i,r){var s=null!=r?r:{},n=s.capture,o=s.passive;null==t||t.addEventListener(e,i,{capture:void 0!==n&&n,passive:void 0===o||o})}var fr=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}};Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return N(t)&&isFinite(t)&&Math.floor(t)===t});class gr{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/256,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 gr(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 gr(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 mr{generate(){var t=this.generateOrAbort();if(!O(t))return t;this.v=0;var e=this.generateOrAbort();if(O(e))throw new Error("Could not generate UUID after timestamp reset");return e}generateOrAbort(){var t,e=(t=Date.now(),N(t)&&isFinite(t)?Math.min(Math.max(Math.floor(t),0),0xffffffffffff):0);if(e>this.v)this.v=e,this.lt();else{if(this.v>=e+1e4)return;this.gt++,this.gt>4398046511103&&(this.v++,this.lt())}return gr.fromFieldsV7(this.v,Math.trunc(this.gt/Math.pow(2,30)),this.gt&Math.pow(2,30)-1,this.eo.nextUint32())}lt(){this.gt=1024*this.eo.nextUint32()+(1023&this.eo.nextUint32())}constructor(){this.v=0,this.gt=0,this.eo=new yr}}var br,wr=t=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;t.length>e;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};t&&!O(t.crypto)&&crypto.getRandomValues&&(wr=t=>crypto.getRandomValues(t));class yr{nextUint32(){return this.cs.length>this.io||(wr(this.cs),this.io=0),this.cs[this.io++]}constructor(){this.cs=new Uint32Array(8),this.io=1/0}}var $r=()=>xr().toString(),xr=()=>(br||(br=new mr)).generate(),Er="",Sr=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;var Tr=null,kr={ro(){if(!M(Tr))return Tr;if(Tr=!1,r)try{var t="__ph_cookie_support_"+$r();kr.gr(t,"xyz"),Tr='"xyz"'===fr(t),kr.mr(t)}catch(t){Tr=!1}return Tr},so(t){fe.error("cookieStore error: "+t)},no:fr,oo(t){var e;try{e=JSON.parse(kr.no(t))||{}}catch(t){}return e},gr(t,e,i,s,n){if(!r)return!1;try{var o="",a="",h=function(t,e){if(e){var i=function(t,e){if(void 0===e&&(e=r),Er)return Er;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_"+$r();!Er&&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",Er=o)}return Er}(t);if(!i){var s=(t=>{var e=t.match(Sr);return e?e[0]:""})(t);s!==i&&fe.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 u=t+"="+encodeURIComponent(JSON.stringify(e))+o+"; SameSite=Lax; path=/"+h+a;return u.length>3686.4&&fe.warn("cookieStore warning: large cookie, len="+u.length),r.cookie=u,!0}catch(t){return!1}},mr(t,e){if(null!=r&&r.cookie)try{kr.gr(t,"",-1,e)}catch(t){return}}},Rr=null,Pr={ro(){if(!M(Rr))return Rr;var e=!0;if(O(t))e=!1;else try{var i="__mplssupport__";Pr.gr(i,"xyz"),'"xyz"'!==Pr.no(i)&&(e=!1),Pr.mr(i)}catch(t){e=!1}return e||fe.error("localStorage unsupported; falling back to cookie store"),Rr=e,e},so(t){fe.error("localStorage error: "+t)},no(e){try{return null==t?void 0:t.localStorage.getItem(e)}catch(t){Pr.so(t)}return null},oo(t){try{return JSON.parse(Pr.no(t))||{}}catch(t){}return null},gr(e,i){try{return null==t||t.localStorage.setItem(e,JSON.stringify(i)),!0}catch(t){Pr.so(t)}return!1},mr(e){try{null==t||t.localStorage.removeItem(e)}catch(t){Pr.so(t)}}},Ir=[di,ri,ii,ni,oi,ai,Pi,Ri,Ti],Or=[Se,Ee,Ye,Ke,Ni,Di,Ie,Ii],Cr=t=>t+"_cpm",Ar=["__proto__","constructor","prototype"],Mr=t=>{if(!P(t))return{};var e={};return Object.keys(t).forEach(i=>{-1===Ar.indexOf(i)&&(e[i]=t[i])}),e},Dr=function(t,e){void 0===e&&(e=[]);var i={};return[...Or,...e].forEach(e=>{var r=t[e];O(r)||M(r)||""===r||(i[e]=r)}),i},Nr=t=>{for(var e=5381,i=2166136261,r=0;t.length>r;r++){var s=t.charCodeAt(r);e=33*e^s,i=Math.imul(i^s,16777619)}return t.length.toString(36)+"."+(e>>>0).toString(36)+"."+(i>>>0).toString(36)},Fr=(t,e)=>({p:e,f:Nr(JSON.stringify(t))}),Ur=(t,e)=>{if(!e)return{properties:[],isValid:!1};try{var i=kr.oo(Cr(t)),r=(null==i?void 0:i.f)===Nr(e)&&k(i.p);return{properties:r?i.p:[],isValid:r}}catch(t){return{properties:[],isValid:!1}}},Br=(t,e)=>e+"|"+(kr.no(Cr(t))||""),Lr={},jr={ro:()=>!0,so(t){fe.error("memoryStorage error: "+t)},no:t=>t in Lr?Lr[t]:null,oo:t=>t in Lr?Lr[t]:null,gr:(t,e)=>(Lr[t]=e,!0),mr(t){delete Lr[t]}},zr=null,qr={ro(){if(!M(zr))return zr;if(zr=!0,O(t))zr=!1;else try{var e="__support__";qr.gr(e,"xyz"),'"xyz"'!==qr.no(e)&&(zr=!1),qr.mr(e)}catch(t){zr=!1}return zr},so(t){fe.error("sessionStorage error: ",t)},no(e){try{return null==t?void 0:t.sessionStorage.getItem(e)}catch(t){qr.so(t)}return null},oo(t){try{return JSON.parse(qr.no(t))||null}catch(t){}return null},gr(e,i){try{return null==t||t.sessionStorage.setItem(e,JSON.stringify(i)),!0}catch(t){qr.so(t)}return!1},mr(e){try{null==t||t.sessionStorage.removeItem(e)}catch(t){qr.so(t)}}};class Hr{constructor(t){this._instance=t}get P(){return this._instance.config}get consent(){return this.ao()?0:this.ho}isOptedOut(){return this.P.cookieless_mode===Xi||this.isRejected()||-1===this.consent&&this.P.cookieless_mode===Ki}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.P.opt_out_capturing_by_default}optInOut(t){this.lo.gr(this.uo,t?1:0,this.P.cookie_expiration,this.P.cross_subdomain_cookie,this.P.secure_cookie)}reset(){this.lo.mr(this.uo,this.P.cross_subdomain_cookie)}get uo(){var t=this._instance.config,e=t.token,i=t.opt_out_capturing_cookie_prefix;return t.consent_persistence_name||(i?i+e:"__ph_opt_in_out_"+e)}get ho(){var t=this.lo.no(this.uo);return q(t)?1:m(H,t)?0:-1}get lo(){var t=this.P.opt_out_capturing_persistence_type,e="localStorage"===t?Pr:kr,i=e.ro()?e:jr;if(!this.do||this.do!==i){this.do=i;var r="localStorage"===t?kr:Pr;r.no(this.uo)&&(this.do.no(this.uo)||this.optInOut(q(r.no(this.uo))),r.mr(this.uo,this.P.cross_subdomain_cookie))}return this.do}ao(){return!!this.P.respect_dnt&&[null==i?void 0:i.doNotTrack,null==i?void 0:i.msDoNotTrack,d.doNotTrack,null==i?void 0:i.globalPrivacyControl].some(t=>q(t))}}var Gr=["next","previous","prev",">","<","+","-","−","–"];ge("[Dead Clicks]");var Wr=t=>{var e,i=!(null==(e=t.instance.persistence)||!e.get_property(Ue)),r=t.instance.config.capture_dead_clicks;return U(r)?r:!!P(r)||i},Vr=ge("[SegmentIntegration]");function Jr(t,e,i){void 0===i&&(i=!0);var r=t.config.segment;if(!r)return e();!function(t,e,i){var r=t.config.segment;if(!r)return e();var s=r=>{var s=()=>r.anonymousId()||$r();t.config.get_device_id=s,i&&r.id()&&(t.register({distinct_id:r.id(),$device_id:s()}),t.persistence.set_property(Ii,Zi)),e(i?void 0:r.anonymousId()||void 0)},n=r.user();"then"in n&&R(n.then)?n.then(s):s(n)}(t,i=>{r.register(((t,e)=>{"undefined"!=typeof Promise&&Promise.resolve||Vr.warn("This browser does not have Promise support, and can not use the segment integration");var i=(i,r)=>{if(!r)return i;var s=!!e&&i.event.anonymousId===e&&!i.event.userId;s||i.event.userId||i.event.anonymousId===t.get_distinct_id()||(Vr.info("No userId set, resetting PostHog"),t.reset()),s||(e=void 0),i.event.userId&&i.event.userId!==t.get_distinct_id()&&(Vr.info("UserId set, identifying with PostHog"),t.identify(i.event.userId));var n=t.calculateEventProperties(r,i.event.properties);return i.event.properties=Object.assign({},n,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded(){return!0},load(){return Promise.resolve()},track(t){return i(t,t.event.event)},page(t){return i(t,rr)},identify(t){return i(t,nr)},screen(t){return i(t,"$screen")}}})(t,i)).then(()=>{e()},t=>{Vr.error("Failed to register the Segment integration",t),e()})},i)}var Yr="posthog-js";function Kr(t,e){var i=void 0===e?{}:e,r=i.organization,s=i.projectId,n=i.prefix,o=i.severityAllowList,a=void 0===o?["error"]:o,h=i.sendExceptionsToPostHog,l=void 0===h||h;return e=>{var i,o,h,u,d;if("*"!==a&&!a.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==(i=e.exception)?void 0:i.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==(o=_[0])?void 0:o.value)||e.message,$exception_type:null==(h=_[0])?void 0:h.type,$exception_level:e.level,$exception_list:f,$sentry_event_id:e.event_id,$sentry_exception:e.exception,$sentry_exception_message:(null==(u=_[0])?void 0:u.value)||e.message,$sentry_exception_type:null==(d=_[0])?void 0:d.type,$sentry_tags:e.tags};return r&&s&&(g.$sentry_url=(n||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+e.event_id),l&&(null==(c=t.exceptions)||c.sendExceptionEvent(g)),e}}class Xr{constructor(t,e,i,r,s,n){this.name=Yr,this.setupOnce=function(o){o(Kr(t,{organization:e,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class Qr{constructor(t){this.vo=(t,e,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(fe.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:i}),this.co=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this._o()}_o(){var t;this.po=null==(t=this._instance.sessionManager)?void 0:t.onSessionId(this.vo)}destroy(){var t;null==(t=this.po)||t.call(this),this.po=void 0}doPageView(e,i){var r,s=this.fo(e,i);return this.co={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.fo(t,null==(e=this.co)?void 0:e.pageViewId)}doEvent(){var t;return{$pageview_id:null==(t=this.co)?void 0:t.pageViewId}}fo(t,e){var i=this.co;if(!i)return{$pageview_id:e};var r={$pageview_id:e,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var n=s.maxScrollHeight,o=s.lastScrollY,a=s.maxScrollY,h=s.maxContentHeight,l=s.lastContentY,u=s.maxContentY;if(!(O(n)||O(o)||O(a)||O(h)||O(l)||O(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),h=Math.ceil(h),l=Math.ceil(l),u=Math.ceil(u);var d=n>1?G(o/n,0,1,fe):1,v=n>1?G(a/n,0,1,fe):1,c=h>1?G(l/h,0,1,fe):1,_=h>1?G(u/h,0,1,fe):1;r=lr(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:l,$prev_pageview_last_content_percentage:c,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(t.getTime()-i.timestamp.getTime())/1e3),r}}var Zr=["flags","surveys"],ts={[xe]:{exposure:"hidden"},[ke]:{exposure:"hidden"},[Re]:{exposure:"hidden"},[Oe]:{exposure:"hidden"},[Ie]:{exposure:"hidden"},[Ce]:{exposure:"event"},[Ae]:{exposure:"hidden"},[Le]:{exposure:"hidden"},[Me]:{exposure:"event"},[De]:{exposure:"hidden"},[Ne]:{exposure:"event"},[Fe]:{exposure:"event"},[Ue]:{exposure:"event"},[Be]:{exposure:"hidden"},[je]:{exposure:"event"},[ze]:{exposure:"hidden"},[qe]:{exposure:"hidden"},[Ye]:{exposure:"hidden"},[Ke]:{exposure:"event"},[He]:{exposure:"event",shouldSkipFromEventProperties:t=>M(t)},[Xe]:{exposure:"event"},[Qe]:{exposure:"event"},[Ze]:{exposure:"event"},[ti]:{exposure:"event"},[ei]:{exposure:"hidden"},[ii]:{exposure:"hidden",storageGroup:"flags"},[ri]:{exposure:"hidden",storageGroup:"flags"},[si]:{exposure:"hidden"},[ni]:{exposure:"hidden",storageGroup:"flags"},[oi]:{exposure:"hidden",storageGroup:"flags"},[ai]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[hi]:{exposure:"hidden",storageGroup:"flags"},[li]:{exposure:"hidden"},[ui]:{exposure:"hidden"},[di]:{exposure:"hidden"},[vi]:{exposure:"hidden"},[_i]:{exposure:"hidden",storageGroup:"surveys"},[pi]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[fi]:{exposure:"event"},[gi]:{exposure:"hidden"},[mi]:{exposure:"hidden"},[bi]:{exposure:"hidden"},[wi]:{exposure:"hidden"},[yi]:{exposure:"hidden"},[$i]:{exposure:"event"},[xi]:{exposure:"event"},[Ei]:{exposure:"event"},[Si]:{exposure:"event"},[Ti]:{exposure:"hidden"},[ki]:{exposure:"hidden"},[ci]:{exposure:"event"},[Ri]:{exposure:"hidden"},[Pi]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Ii]:{exposure:"hidden"},[Oi]:{exposure:"hidden"},[Ci]:{exposure:"hidden"},[Ai]:{exposure:"hidden"},[Mi]:{exposure:"hidden"},[Di]:{exposure:"hidden"},[Ni]:{exposure:"hidden"},[Ge]:{exposure:"event"},[We]:{exposure:"event"},[Ve]:{exposure:"event"},[Je]:{exposure:"event"},[Bi]:{exposure:"event"},[Li]:{exposure:"event"},[ji]:{exposure:"event"},[zi]:{exposure:"event"},[qi]:{exposure:"event"},[Hi]:{exposure:"event"},[Gi]:{exposure:"event"},[Wi]:{exposure:"event"},[Vi]:{exposure:"event"},[Ji]:{exposure:"event"},[Yi]:{exposure:"event"}},es=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],is=t=>{var e=ts[t];if(e)return e;for(var i of es){var r=i[1];if(0===t.indexOf(i[0]))return r}},rs=(t,e)=>{try{var i;return JSON.stringify(t,(t,e)=>j(e)?(null!=i||(i=new WeakMap),i.has(e)||i.set(e,vr(e)),i.get(e)):"bigint"==typeof e?e.toString():e,e)}catch(e){return s=[],null!==(r=JSON.stringify(t,function(t,e){if("bigint"==typeof e)return e.toString();if("function"!=typeof e&&"symbol"!=typeof e){if(e instanceof Error)return{name:e.name,message:e.message,stack:e.stack};if(e&&"object"==typeof e){for(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(e))return"[Circular]";s.push(e)}return e}}))&&void 0!==r?r:"null"}var r,s},ss=t=>{var e=null==r?void 0:r.createElement("a");return O(e)?null:(e.href=t,e)},ns=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(!k(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(t){fe.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},os=function(t,e,i){if(!t||!e||!e.length)return t;for(var r=t.split("#"),s=r[1],n=(r[0]||"").split("?"),o=n[1],a=n[0],h=(o||"").split("&"),l=[],u=0;h.length>u;u++){var d=h[u].split("=");k(d)&&(e.includes(d[0])?l.push(d[0]+"="+i):l.push(h[u]))}var v=a;return null!=o&&(v+="?"+l.join("&")),null!=s&&(v+="#"+s),v},as="https?://(.*)",hs=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],ls=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...hs],us="<masked>",ds=["li_fat_id"];function vs(t,e){var i=ls.concat(e||[]),r={};return hr(i,function(e){var i=ns(t,e);r[e]=i||null}),r}function cs(t){var e=function(t){return t?0===t.search(as+"google.([^/?]*)")?"google":0===t.search(as+"bing.com")?"bing":0===t.search(as+"yahoo.com")?"yahoo":0===t.search(as+"duckduckgo.com")?"duckduckgo":null:null}(t),i="yahoo"!=e?"q":"p",s={};if(!M(e)){s.$search_engine=e;var n=r?ns(r.referrer,i):"";n.length&&(s.ph_keyword=n)}return s}function _s(){return navigator.language||navigator.userLanguage}var ps="$direct";function fs(){return(null==r?void 0:r.referrer)||ps}function gs(t,e,i){void 0===i&&(i=!1);var r=t?[...hs,...e||[]]:[],n=i?ne(null==s?void 0:s.href):null==s?void 0:s.href,o=null==n?void 0:n.substring(0,1e3);return{r:fs().substring(0,1e3),u:o?os(o,r,us):void 0}}function ms(t,e){var i;void 0===e&&(e=!1);var r=t.r,s=t.u,n=e?ne(s):s,o={$referrer:r,$referring_domain:null==r?void 0:r==ps?ps:null==(i=ss(r))?void 0:i.host};if(n){o.$current_url=n;var a=ss(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname;var h=vs(n);lr(o,h)}if(r){var l=cs(r);lr(o,l)}return o}function bs(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return}}function ws(){try{return(new Date).getTimezoneOffset()}catch(t){return}}var ys={flags:Pi,surveys:pi},$s=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],xs=t=>t+"_cookie_identity_change_pending",Es=t=>{var e="",i=0;for(var r of t){var s=encodeURIComponent(JSON.stringify(r).slice(1,-1)).length;if(i+s>1e3)break;e+=r,i+=s}return e},Ss="main",Ts=[ii,ri,ni,oi,ai,Pi,hi,di],ks=t=>-1!==Ts.indexOf(t),Rs=(t,e)=>{try{return JSON.stringify(t)===JSON.stringify(e)}catch(i){return t===e}},Ps=t=>{if(!t)return{};var e=JSON.parse(t);return P(e)?e:{}},Is=(t,e)=>{hr(t,(i,r)=>{var s=is(r);s&&"event"!==s.exposure||{}.hasOwnProperty.call(e,r)||delete t[r]})};class Os{constructor(e,i,r){if(void 0===r&&(r=!0),this.mo={},this.bo=!1,this.wo=!1,this.yo=!1,this.$o=!1,this.xo=!1,this.Eo=new Map,this.So=!1,this.To=!1,this.ko=!1,this.Ro=!1,this.Po=new Set,this.P=e,this.Io=r,this.props={},this.Oo=void 0,this.Co=(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.lo=this.Ao(e),this.yo=this.Mo(e),this.load(),this.Do(),e.debug&&fe.info("Persistence loaded",e.persistence,p({},this.props)),this.update_config(e,e,i),this.save(),t){var s=()=>this.flush();pr(t,"beforeunload",s,{capture:!1}),pr(t,"pagehide",s,{capture:!1}),this.No=e=>{if(this.bo&&(!e.storageArea||e.storageArea===(null==t?void 0:t.localStorage))&&e.key)if(e.key!==this.Co){if(this.yo){var i=Zr.find(t=>e.key===this.Fo(t));i&&this.Uo(e.key,i)}}else this.Uo(e.key,Ss)},pr(t,"storage",this.No)}}markCrossTabFeatureFlagChanges(t){Object.entries(t).forEach(t=>{var e=t[0],i=t[1],r=this.Eo.get(e);if(ks(e)&&!0!==r)if(!0!==i){var s=new Set(r||[]);i.forEach(t=>s.add(t)),s.size&&this.Bo(e,s)}else this.Bo(e,!0)})}onCrossTabFeatureFlagChange(t){return this.Po.add(t),()=>this.Po.delete(t)}destroy(){this.No&&t&&(t.removeEventListener("storage",this.No),this.No=void 0),this.Po.clear()}Uo(t,e,i){if(void 0===i&&(i=!0),this.Lo)return!1;var r,s;try{if(s=Pr.no(t),M(s)){var n=this.jo(e);return n.storageValue=null,e!==Ss&&(n.persisted=!1),!1}r=Ps(s)}catch(t){return!1}var o=e===Ss?r:Pr.oo(this.Co);if(o&&this.zo(o))return!1;var a=this.qo(r,e,i);return e===Ss&&this.yo&&!Rs(this.Ho().main,r)||this.Go(r,e,!0,s),a}zo(t){var e=this.props[Ee],i=t[Ee];return!O(e)&&!O(i)&&e!==i}Go(t,e,i,r){var s=this.jo(e);s.storageValue=r,e!==Ss&&(s.persisted=i);try{s.fingerprint=this.Wo(t,e)}catch(t){s.fingerprint=void 0}}qo(t,e,i){var r=!1;return Ts.forEach(i=>{var s,n=null==(s=is(i))?void 0:s.storageGroup;if(!(e===Ss&&this.yo&&n||e!==Ss&&n!==e)){var o=i in t,a=this.Vo(i,o?t[i]:void 0),h=this.Eo.has(i)?i in this.props:o;h===i in this.props&&Rs(a,this.props[i])||(h?this.Jo(i,a,!1):this.Yo(i,!1),r=!0)}}),r&&i&&this.Po.forEach(t=>t()),r}Ko(){if(!this.bo)return!1;try{this.ko=!1;var t,e=Pr.no(this.Co),i=this.jo(Ss),r=!1,s=!1;if(e!==i.storageValue)if(M(e))i.storageValue=null;else{if(t=Ps(e),this.ko=!this.To&&this.zo(t),this.ko)return!1;s=this.qo(t,Ss,!1),!this.yo||Rs(this.Ho().main,t)?this.Go(t,Ss,!0,e):i.storageValue=e,r=!0}return this.yo&&Zr.forEach(e=>{var i=Pr.no(this.Fo(e)),n=this.jo(e),o=t||{},a=r&&Ts.some(t=>{var i;return(null==(i=is(t))?void 0:i.storageGroup)===e&&t in o});if(i!==n.storageValue||a){if(M(i))return n.storageValue=null,n.persisted=!1,void(a&&(s=this.qo(o,e,!1)||s));var h=Ps(i);s=this.qo(h,e,!1)||s,this.Go(h,e,!0,i)}}),s}catch(t){return!1}}Bo(t,e){this.Eo.set(t,e);var i=is(t);null!=i&&i.volatile||(this.jo((this.yo?null==i?void 0:i.storageGroup:void 0)||Ss).fingerprint=void 0,this.Xo(t))}Qo(){Ts.forEach(t=>this.Eo.set(t,!0))}Do(){if(this.bo)try{var t=Pr.no(this.Co),e=Ps(t);this.jo(Ss).storageValue=t,Ts.forEach(t=>{var i,r=this.yo?null==(i=is(t))?void 0:i.storageGroup:void 0,s=r?Pr.no(this.Fo(r)):null;if(r){var n=this.jo(r);n.storageValue=s,n.persisted=!M(s)}var o=r&&!M(s)?Ps(s):e;t in this.props?this.Zo(t,o[t],this.props[t]):t in o&&this.Bo(t,!0)})}catch(t){}}Vo(t,e){var i=this.Eo.get(t);if(!i)return e;if(!0===i)return this.props[t];if(t===ri){var r=new Set(k(e)?e:[]),s=new Set(k(this.props[t])?this.props[t]:[]);return i.forEach(t=>s.has(t)?r.add(t):r.delete(t)),Array.from(r)}var n=P(e)?p({},e):{},o=P(this.props[t])?this.props[t]:{};return i.forEach(t=>{t in o?n[t]=o[t]:delete n[t]}),n}Zo(t,e,i){if(ks(t)){var r=this.Eo.get(t);if(!0!==r){var s=e;if(this.bo)try{var n,o=this.yo?null==(n=is(t))?void 0:n.storageGroup:void 0,a=o?this.Fo(o):this.Co;s=Ps(Pr.no(a))[t]}catch(t){}var h=new Set(r||[]);if(t===ri){if(!O(e)&&!k(e)||!O(s)&&!k(s)||!k(i))return void this.Bo(t,!0);var l=new Set(e||[]),u=new Set(s||[]),d=new Set(i);new Set([...l,...d]).forEach(t=>{l.has(t)!==d.has(t)&&h.add(t)}),h.forEach(t=>{u.has(t)===d.has(t)&&h.delete(t)})}else{if(!P(i))return void(Rs(s,i)?this.Eo.delete(t):this.Bo(t,!0));if(!O(e)&&!P(e)||O(e)&&I(i)&&O(s))return void this.Bo(t,!0);var v=P(e)?e:{},c=P(s)?s:{};new Set([...Object.keys(v),...Object.keys(i)]).forEach(t=>{t in v==t in i&&Rs(v[t],i[t])||h.add(t)}),h.forEach(t=>{t in c==t in i&&Rs(c[t],i[t])&&h.delete(t)})}h.size?this.Bo(t,h):this.Eo.delete(t)}}}_a(){var t,e=null==(t=this.P)?void 0:t.persistence_save_debounce_ms;return N(e)&&e>0?e:0}ma(t){if(this.P.cookieWinsOnConflict&&"localstorage+cookie"===this.P.persistence.toLowerCase())if(t)try{var e=Dr(t,this.P.cookie_persisted_properties||[]),i=Fr(e,this.P.cookie_persisted_properties||[]),r=JSON.stringify(e)+"|"+JSON.stringify(i),s=kr.no(this.Co)||void 0;s&&Br(this.Co,s)===r&&(this.ba=r,this.wa=s)}catch(t){}else try{var n=kr.no(this.Co)||void 0;this.ba=n?Br(this.Co,n):void 0,this.wa=n}catch(t){}}syncCookieProperties(){return this.ya(this.P)}ya(t,e){if(void 0===e&&(e=!1),this.Lo&&!e||this.xo||!t.cookieWinsOnConflict||"localstorage+cookie"!==t.persistence.toLowerCase())return!1;var i;try{i=kr.no(this.Co)||void 0}catch(t){}if(!i||i===this.wa)return!1;var r,s=Br(this.Co,i);try{r=Mr(JSON.parse(i))}catch(t){return!1}if((kr.no(this.Co)||void 0)!==i)return!1;this.ba=s,this.wa=i;var n=Ur(this.Co,i),o=[...Or,...n.properties],a={};if(Object.keys(r).forEach(t=>{var e=r[t];(O(e)||M(e)||""===e||t===Ii&&e!==Qi&&e!==Zi)&&(a[t]=!0,delete r[t])}),I(r))return!1;var h=Ee in r||r[Ii]===Qi||r[Ii]===Zi,l=this.props,u=l[Ee],d=l[Ii],v=lr({},l);[...Or,...t.cookie_persisted_properties||[]].forEach(t=>{if(-1!==o.indexOf(t)&&!(t in r)&&!a[t]&&(h||t!==Ee&&t!==Ii)){var e=v[t];!n.isValid&&-1!==Or.indexOf(t)&&(!1===e||0===e)||delete v[t]}}),this.props=lr(v,r),Ts.forEach(t=>{var e=t in this.props;t in l===e&&Rs(l[t],this.props[t])||(e?this.Zo(t,l[t],this.props[t]):this.Bo(t,!0))}),!h||Ii in r||Ii in this.props||this.Jo(Ii,Qi);var c=this.props[Ee],_=this.props[Ii];return!h||c===u&&_===d||(this.To=!0,this.$o=!0,qr.gr(xs(this.Co),!0),this.Yo(di),this.Yo(ri),this.Yo(ii),this.Yo(ni),this.Yo(oi),this.Yo(ai),this.Yo(Pi),this.Yo(Ri),this.Yo(Ti),_===Qi&&(d===Zi||r[Ii]===Qi||!O(u)&&c!==u)&&(Is(this.props,r),this.Yo(vi)),_===Zi?this.props.$user_id=c:delete this.props.$user_id,this.Yo(ke)),!0}consumeCookieIdentityChange(){var t=xs(this.Co),e=this.$o||!!qr.no(t);return this.$o=!1,e&&qr.mr(t),e}$a(t){return void 0===t&&(t=!1),!(this.xo||this.Lo&&!t||!this.P.cookieWinsOnConflict||"localstorage+cookie"!==this.P.persistence.toLowerCase()||(this.xo=!0,0))}xa(){this.xo&&(O(this.Ea)||(clearTimeout(this.Ea),this.Ea=void 0),delete this.mo[Ss],this.Sa(!0))}Ta(t){if(void 0===t&&(t=!0),this.xo)try{t?this.xa():O(this.Ea)||(clearTimeout(this.Ea),this.Ea=void 0)}finally{this.xo=!1}}isDisabled(){return!!this.Lo}Ao(e){-1===$s.indexOf(e.persistence.toLowerCase())&&(fe.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=[...Or,...e];return p({},Pr,{oo(t){try{var e,s={};try{e=kr.no(t)||void 0,s=e?Mr(JSON.parse(e)):{}}catch(t){}var n,o=JSON.parse(Pr.no(t)||"{}");if(i){var a=Ur(t,e),h=[...Or,...a.properties],l={};Object.keys(s).forEach(t=>{var e=s[t];M(e)||""===e||t===Ii&&e!==Qi&&e!==Zi||(l[t]=e)});var u=Ee in l||l[Ii]===Qi||l[Ii]===Zi;if(Object.keys(l).length>0){var d,v=o[Ee],c=null!==(d=o[Ii])&&void 0!==d?d:Qi;r.forEach(t=>{if(-1!==h.indexOf(t)&&!(t in s)&&(u||t!==Ee&&t!==Ii)){var e=o[t];!a.isValid&&-1!==Or.indexOf(t)&&(!1===e||0===e)||delete o[t]}}),!u||Ii in s||Ii in o||(o[Ii]=Qi),!u||(Ee in l?l[Ee]:o[Ee])===v&&(Ii in l?l[Ii]:o[Ii])===c||(Ir.forEach(t=>delete o[t]),l[Ii]===Zi&&Ee in l?o.$user_id=l[Ee]:delete o.$user_id,l[Ii]!==Zi&&(delete o[ci],delete o[vi]),delete o.__alias)}n=lr(o,l)}else n=lr(s,o);return Pr.gr(t,n),n}catch(t){}return null},gr(t,r,s,n,o,a){var h=Pr.gr(t,r,void 0,void 0,a);try{var l=Dr(r,e);if(Object.keys(l).length){if(i){var u=Cr(t),d=Fr(l,e);if(kr.gr(u,d,s,n,o,a),kr.no(u)!==JSON.stringify(d)){kr.mr(u,n);var v=Dr(r);return kr.gr(t,v,s,n,o,a),h}}kr.gr(t,l,s,n,o,a)}}catch(t){Pr.so(t)}return h},mr(e,i){try{null==t||t.localStorage.removeItem(e),kr.mr(e,i),kr.mr(Cr(e),i)}catch(t){Pr.so(t)}}})}(e.cookie_persisted_properties||[],e.cookieWinsOnConflict),s=!1,n=!1,o=e.persistence.toLowerCase();return"localstorage"===o&&Pr.ro()?(i=Pr,n=!0):"localstorage+cookie"===o&&r.ro()?(i=r,n=!0,s=!0):"sessionstorage"===o&&qr.ro()?i=qr:"memory"===o?i=jr:"cookie"===o&&kr.ro()?(i=kr,s=!0):r.ro()?(i=r,n=!0,s=!0):kr.ro()?(i=kr,s=!0):i=jr,this.bo=n,this.wo=s,i}Fo(t){return this.Co+"__"+t}Mo(t){return this.bo&&!!t.split_storage}properties(){var t={};return hr(this.props,(e,i)=>{var r=is(i);if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(e))return;t[i]=e}}),t}load(t){if(void 0===t&&(t=!1),!this.Lo||t){var e=this.P.cookieWinsOnConflict&&"localstorage+cookie"===this.P.persistence.toLowerCase(),i=e?Pr.oo(this.Co):null,r={};if(e)try{hr(r=Mr(kr.oo(this.Co)),(t,e)=>{(O(t)||M(t)||""===t)&&delete r[e]})}catch(t){}var s=this.lo.oo(this.Co);if(s&&(this.props=lr({},s)),this.yo&&this.ka(),e&&s){var n,o,a=null==i?void 0:i[Ee],h=null!==(n=null==i?void 0:i[Ii])&&void 0!==n?n:Qi,l=s[Ee],u=null!==(o=s[Ii])&&void 0!==o?o:Qi;if(l!==a||u!==h){this.$o=!0,qr.gr(xs(this.Co),!0);var d=lr({},this.props);Ir.forEach(t=>delete d[t]),u===Qi&&(h===Zi||r[Ii]===Qi||!O(a)&&l!==a)&&(Is(d,r),delete d[vi]),this.props=d;var v=new Set;Ir.forEach(t=>{var e,i=null==(e=is(t))?void 0:e.storageGroup;i&&v.add(i)}),v.forEach(t=>{var e={};hr(this.props,(i,r)=>{var s;(null==(s=is(r))?void 0:s.storageGroup)===t&&(e[r]=i)}),I(e)?(Pr.mr(this.Fo(t)),this.mo[t]={}):Pr.gr(this.Fo(t),e)&&(this.mo[t]={persisted:!0,fingerprint:this.Wo(e,t)})})}}qr.no(xs(this.Co))&&(this.$o=!0)}}ka(){for(var t of Zr){var e=Pr.oo(this.Fo(t));if(e&&!I(e)){var i=this.jo(t);i.persisted=!0,this.Ra(t)||(i.fingerprint=this.Wo(e,t)),this.Pa(t,e)||lr(this.props,e)}}}Ra(t){return Object.keys(this.props).some(e=>{var i;return(null==(i=is(e))?void 0:i.storageGroup)===t})}Pa(t,e){var i=ys[t];if(!i)return!1;var r=e[i],s=this.props[i];return N(r)&&N(s)&&s>r}refreshKey(t){var e;if(!(this.Lo||t===Ie&&this.Ro)){var i=this.yo?null==(e=is(t))?void 0:e.storageGroup:void 0,r=i?Pr.oo(this.Fo(i)):this.lo.oo(this.Co);if(r&&t in r)this.Jo(t,r[t],!1);else{if(i){var s=this.lo.oo(this.Co);if(s&&t in s)return void this.Jo(t,s[t],!1)}this.Yo(t,!1)}}}save(){if(!this.Lo){var t=this._a();t>0?O(this.Ea)&&(this.Ea=setTimeout(()=>{this.Ea=void 0,this.Sa()},t)):this.Sa()}}flush(){O(this.Ea)||(clearTimeout(this.Ea),this.Ea=void 0,this.Sa())}Sa(t){if(void 0===t&&(t=!1),!(this.Lo||this.xo&&!t)){t||(this.syncCookieProperties(),this.Ro||this.P.cookieWinsOnConflict&&"localstorage+cookie"===this.P.persistence.toLowerCase()||this.refreshKey(Ie));var e=!t&&!this.So;e||(this.ko=!1);var i=!!e&&this.Ko();if(this.ko)this.P.debug&&fe.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.yo)return this.Ia(),void(i&&this.Po.forEach(t=>t()));var r=this.Oa(this.lo,this.Co,this.props,Ss);"written"===r&&this.ma(this.props),"failed"!==r&&(this.Eo.clear(),this.To=!1,this.Ro=!1),i&&this.Po.forEach(t=>t())}}}Ia(){var t=this,e=this.Ho(),i=e.main,r=e.groups,s=this.Oa(this.lo,this.Co,i,Ss);"written"===s&&this.ma(i),"failed"!==s&&(this.To=!1,this.Ro=!1,Ts.forEach(t=>{var e;null!=(e=is(t))&&e.storageGroup||this.Eo.delete(t)}));var n=function(e){var i,s=r[e];if(I(s)&&(null==(i=t.mo[e])||!i.persisted))return Ts.forEach(i=>{var r;(null==(r=is(i))?void 0:r.storageGroup)===e&&t.Eo.delete(i)}),1;var n=t.Oa(Pr,t.Fo(e),s,e);"failed"!==n&&Ts.forEach(i=>{var r=is(i);(null==r?void 0:r.storageGroup)!==e||"written"!==n&&r.volatile||t.Eo.delete(i)})};for(var o of Zr)n(o)}Ho(){var t={},e={flags:{},surveys:{}};return hr(this.props,(i,r)=>{var s,n=null==(s=is(r))?void 0:s.storageGroup;n?e[n][r]=i:t[r]=i}),{main:t,groups:e}}Wo(t,e){if(e===Ss)return JSON.stringify(t)+"|"+this.Ca+"|"+this.Aa+"|"+this.Ma;var i={};return hr(t,(t,e)=>{var r;i[e]=null!=(r=is(e))&&r.volatile?"__volatile__":t}),JSON.stringify(i)}Oa(t,e,i,r){var s,n=this.jo(r);if(r!==Ss&&!n.dirty&&!O(n.fingerprint))return"skipped";try{if((s=this.Wo(i,r))===n.fingerprint)return n.dirty=!1,"skipped"}catch(t){s=void 0}return t.gr(e,i,this.Ca,this.Aa,this.Ma,this.P.debug)?(n.dirty=!1,r!==Ss&&(n.persisted=!0),O(s)||(n.fingerprint=s),this.bo&&(n.storageValue=Pr.no(e)),"written"):(this.P.debug&&fe.warn('failed to persist storage entry "'+e+'"; will retry on next save'),"failed")}remove(t){var e=(void 0===t?{}:t).keepGroupEntries,i=void 0!==e&&e;if(this.Qo(),O(this.Ea)||(clearTimeout(this.Ea),this.Ea=void 0),this.lo.mr(this.Co,!1),this.lo.mr(this.Co,!0),!i&&this.Io)for(var r of Zr)Pr.mr(this.Fo(r));i?delete this.mo[Ss]:this.mo={},this.ba=void 0,this.wa=void 0}clear(){this.remove(),this.props={}}register_once(t,e,i){if(P(t)){this.syncCookieProperties(),O(e)&&(e="None"),this.Ca=O(i)?this.Da:i;var r=!1;if(hr(t,(t,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==e||(this.Jo(i,t),r=!0)}),r)return this.save(),!0}return!1}register(t,e){if(P(t)){this.syncCookieProperties(),this.Ca=O(e)?this.Da:e;var i=!1;if(hr(t,(e,r)=>{t.hasOwnProperty(r)&&(this.props[r]!==e||P(e)||k(e))&&(this.Jo(r,e),i=!0)}),i)return this.save(),!0}return!1}unregister(t){this.syncCookieProperties();var e="string"==typeof t?[t]:t,i=!1;for(var r of e)r in this.props&&(this.Yo(r),i=!0);i&&this.save()}update_campaign_params(){var t=null==r?void 0:r.URL;if(t!==this.Oo){var e=function(t,e,i){if(!r)return{};var s,n=e?[...hs,...i||[]]:[],o=vs(os(r.URL,n,us),t),a=(s={},hr(ds,function(t){var e=fr(t);s[t]=e||null}),s);return lr(a,o)}(this.P.custom_campaign_params,this.P.mask_personal_data_properties,this.P.custom_personal_data_properties),i=!I(dr(e));return i&&this.register(e),this.Oo=t,i?e:void 0}}update_search_keyword(){var t;this.register((t=null==r?void 0:r.referrer)?cs(t):{})}update_referrer_info(){var t;this.register_once({$referrer:fs(),$referring_domain:null!=r&&r.referrer&&(null==(t=ss(r.referrer))?void 0:t.host)||ps},void 0)}set_initial_person_info(){if(!this.props[Ai]&&!this.props[Mi]){var t=gs(this.P.mask_personal_data_properties,this.P.custom_personal_data_properties,this.P.disable_capture_url_hashes);this.register_once({[Di]:this.wo?{r:Es(t.r),u:t.u?Es(t.u):void 0}:t},void 0)}}get_initial_props(){var t={};hr([Mi,Ai],e=>{var i=this.props[e];i&&hr(i,function(e,i){t["$initial_"+b(i)]=e})});var e=this.props[Di];if(e){var i=function(t,e){void 0===e&&(e=!1);var i=ms(t,e),r={};return hr(i,function(t,e){r["$initial_"+b(e)]=t}),r}(e,this.P.disable_capture_url_hashes);lr(t,i)}return t}safe_merge(t){return hr(this.props,function(e,i){i in t||(t[i]=e)}),t}update_config(t,e,i){var r=t.persistence!==e.persistence,s=!((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||[]),n=r||s,o=t.cookieWinsOnConflict!==e.cookieWinsOnConflict,a=t.disable_persistence||!!i,h=!!this.Lo&&!a;a||this.ya(e,h),this.P=t,!a&&(r||s||o)&&(this.ba=void 0,this.wa=void 0,this.ya(p({},t,{cookie_persisted_properties:e.cookie_persisted_properties}),h));var l=n||o?this.Ao(t):this.lo;this.Na();var u=this.Mo(t),d=n||u!==this.yo,v=!a&&(d||t.cross_subdomain_cookie!==this.Aa||t.secure_cookie!==this.Ma)&&this.$a(h);this.So=d;try{if(this.Da=this.Ca=t.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),d){var c=this.props;this.clear(),this.lo=l,this.yo=u,this.props=c,this.save()}else o&&(this.lo=l,a||(delete this.mo[Ss],this.Sa()))}finally{this.So=!1,v&&this.Ta()}}Na(){var t=this.props[Di];if(this.wo&&P(t)&&"string"==typeof t.r){var e=Es(t.r),i="string"==typeof t.u?Es(t.u):t.u;e===t.r&&i===t.u||this.Jo(Di,p({},t,{r:e,u:i}))}}set_disabled(t){this.Lo=t,this.Lo?this.remove():this.save()}set_cross_subdomain(t){t!==this.Aa&&(this.Aa=t,this.remove({keepGroupEntries:!0}),this.save())}set_secure(t){t!==this.Ma&&(this.Ma=t,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(t,e){var i=this.props[Oe]||{};i[t]=e,this.Jo(Oe,i),this.save()}remove_event_timer(t){var e=this.props[Oe]||{},i=e[t];return O(i)||(delete e[t],this.Jo(Oe,e),this.save()),i}get_property(t){return this.props[t]}set_property(t,e){this.Jo(t,e),this.save()}Jo(t,e,i){var r;void 0===i&&(i=!0);var s=this.props[t];this.props[t]=e,i&&(t!==Ee&&t!==Ii||s===e||(this.To=!0),t!==Ie||Rs(s,e)||(this.Ro=!0),this.Zo(t,s,e),null!=(r=is(t))&&r.volatile||this.Xo(t))}Yo(t,e){void 0===e&&(e=!0),delete this.props[t],e&&(ks(t)&&this.Bo(t,!0),t===Ie&&(this.Ro=!0),this.Xo(t))}Xo(t){var e,i=null==(e=is(t))?void 0:e.storageGroup;i&&(this.jo(i).dirty=!0)}jo(t){return this.mo[t]||(this.mo[t]={})}}var Cs={GZipJS:"gzip-js",Base64:"base64"},As={Activation:"events",Cancellation:"cancelEvents"},Ms={Button:"button",Tab:"tab",Selector:"selector"},Ds={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"},Ns={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},Fs={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},Us={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},Bs={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},Ls={Once:"once",Recurring:"recurring",Always:"always"},js={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},zs={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},qs={Popover:"popover",Inline:"inline"};function Hs(t){var e=!0;return{dispose(){if(e){e=!1;var i=t();i&&R(i.then)&&i.then(void 0,()=>{})}}}}var Gs={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},Ws={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"},Vs={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"},Js=ge("[RateLimiter]");class Ys{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=>{Js.info((t||"events")+" is quota limited."),this.serverLimits[t]=(new Date).getTime()+6e4})}catch(t){return void Js.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 s=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!==(e=null==(i=this.instance.persistence)?void 0:i.get_property(Ci))&&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 h=1>a.tokens;if(h||t||(a.tokens=Math.max(0,a.tokens-1)),h&&!t){var l=(N(a.dropped)?a.dropped:0)+1;a.dropped=l,!this.lastEventRateLimited&&this.Fa(l)&&(a.dropped=0)}return this.lastEventRateLimited=h,null==(r=this.instance.persistence)||r.set_property(Ci,a),{isRateLimited:h,remainingTokens:a.tokens}}Ua(t){var e=this.instance.config.property_denylist;return!k(e)||!e.includes(t)}Ba(){var t;if(this.Ua("$current_url")&&this.Ua("$pathname")&&null!=s&&s.pathname)return""+(null!==(t=s.origin)&&void 0!==t?t:"")+s.pathname}Fa(t){var e,i,r=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,n=this.Ba(),o=this.Ua("$session_id")?null==(e=(i=this.instance).get_session_id)?void 0:e.call(i):void 0,a=[t+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,o?"session "+o:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+s+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(t){var e=this.serverLimits[t||"events"]||!1;return!1!==e&&(new Date).getTime()<e}}var Ks=ge("[RemoteConfig]");class Xs{constructor(t){this._instance=t}get remoteConfig(){var t;return null==(t=d._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])?void 0:t.config}Zt(t){var e,i;null!=(e=d.__PosthogExtensions__)&&e.loadExternalDependency?null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>t(this.remoteConfig)):t()}Qt(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t})}load(){try{if(this.remoteConfig)return Ks.info("Using preloaded remote config",this.remoteConfig),void this.Yt(this.remoteConfig);if(this._instance._shouldDisableFlags())return void Ks.warn("Remote config is disabled. Falling back to local config.");this.Zt(t=>{if(!t)return Ks.info("No config found after loading remote JS config. Falling back to JSON."),void this.Qt(t=>{this.Yt(t.json,t)});this.Yt(t)})}catch(t){Ks.error("Error loading remote config",t),this.Yt()}}Yt(t,e){!t&&e&&(0===e.statusCode?e.error||Ks.warn("Failed to fetch remote config from PostHog."):Ks.error("Failed to fetch remote config from PostHog."));try{this._instance.Yt(t?{ok:!0,config:t}:{ok:!1})}catch(t){Ks.error("Error applying remote config",t)}if(!1!==(null==t?void 0:t.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(t){Ks.error("Error loading feature flags",t)}}}var Qs=["fatal","error","warning","log","info","debug"],Zs=Uint8Array,tn=Uint16Array,en=Uint32Array,rn=new Zs([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]),sn=new Zs([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]),nn=new Zs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),on=function(t,e){for(var i=new tn(31),r=0;31>r;++r)i[r]=e+=1<<t[r-1];var s=new en(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]},an=on(rn,2),hn=an[1];an[0][28]=258,hn[258]=28;for(var ln=on(sn,0)[1],un=new tn(32768),dn=0;32768>dn;++dn){var vn=(43690&dn)>>>1|(21845&dn)<<1;un[dn]=((65280&(vn=(61680&(vn=(52428&vn)>>>2|(13107&vn)<<2))>>>4|(3855&vn)<<4))>>>8|(255&vn)<<8)>>>1}var cn=function(t,e,i){for(var r=t.length,s=0,n=new tn(e);r>s;++s)++n[t[s]-1];var o,a=new tn(e);for(s=0;e>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new tn(1<<e);var h=15-e;for(s=0;r>s;++s)if(t[s])for(var l=s<<4|t[s],u=e-t[s],d=a[t[s]-1]++<<u,v=d|(1<<u)-1;v>=d;++d)o[un[d]>>>h]=l}else for(o=new tn(r),s=0;r>s;++s)o[s]=un[a[t[s]-1]++]>>>15-t[s];return o},_n=new Zs(288);for(dn=0;144>dn;++dn)_n[dn]=8;for(dn=144;256>dn;++dn)_n[dn]=9;for(dn=256;280>dn;++dn)_n[dn]=7;for(dn=280;288>dn;++dn)_n[dn]=8;var pn=new Zs(32);for(dn=0;32>dn;++dn)pn[dn]=5;var fn=cn(_n,9,0),gn=cn(pn,5,0),mn=function(t){return(t/8|0)+(7&t&&1)},bn=function(t,e,i){(null==i||i>t.length)&&(i=t.length);var r=new(t instanceof tn?tn:t instanceof en?en:Zs)(i-e);return r.set(t.subarray(e,i)),r},wn=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8},yn=function(t,e,i){var r=e/8|0;t[r]|=i<<=7&e,t[r+1]|=i>>>8,t[r+2]|=i>>>16},$n=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 Zs(0),0];if(1==s){var o=new Zs(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(t,e){return t.f-e.f}),i.push({s:-1,f:25001});var a=i[0],h=i[1],l=0,u=1,d=2;for(i[0]={s:-1,f:a.f+h.f,l:a,r:h};u!=s-1;)a=i[i[d].f>i[l].f?l++:d++],h=i[l!=u&&i[d].f>i[l].f?l++:d++],i[u++]={s:-1,f:a.f+h.f,l:a,r:h};var v=n[0].s;for(r=1;s>r;++r)n[r].s>v&&(v=n[r].s);var c=new tn(v+1),_=xn(i[u-1],c,0);if(_>e){r=0;var p=0,f=_-e,g=1<<f;for(n.sort(function(t,e){return c[e.s]-c[t.s]||t.f-e.f});s>r;++r){var m=n[r].s;if(e>=c[m])break;p+=g-(1<<_-c[m]),c[m]=e}for(p>>>=f;p>0;){var b=n[r].s;e>c[b]?p-=1<<e-c[b]++-1:++r}for(;r>=0&&p;--r){var w=n[r].s;c[w]==e&&(--c[w],++p)}_=e}return[new Zs(c),_]},xn=function(t,e,i){return-1==t.s?Math.max(xn(t.l,e,i+1),xn(t.r,e,i+1)):e[t.s]=i},En=function(t){for(var e=t.length;e&&!t[--e];);for(var i=new tn(++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]},Sn=function(t,e){for(var i=0,r=0;e.length>r;++r)i+=t[r]*e[r];return i},Tn=function(t,e,i){var r=i.length,s=mn(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)},kn=function(t,e,i,r,s,n,o,a,h,l,u){wn(e,u++,i),++s[256];for(var d=$n(s,15),v=d[0],c=d[1],_=$n(n,15),p=_[0],f=_[1],g=En(v),m=g[0],b=g[1],w=En(p),y=w[0],x=w[1],E=new tn(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=$n(E,7),k=T[0],R=T[1],P=19;P>4&&!k[nn[P-1]];--P);var I,O,C,A,M=l+5<<3,D=Sn(s,_n)+Sn(n,pn)+o,N=Sn(s,v)+Sn(n,p)+o+14+3*P+Sn(E,k)+(2*E[16]+3*E[17]+7*E[18]);if(D>=M&&N>=M)return Tn(e,u,t.subarray(h,h+l));if(wn(e,u,1+(D>N)),u+=2,D>N){I=cn(v,c,0),O=v,C=cn(p,f,0),A=p;var F=cn(k,R,0);for(wn(e,u,b-257),wn(e,u+5,x-1),wn(e,u+10,P-4),u+=14,S=0;P>S;++S)wn(e,u+3*S,k[nn[S]]);u+=3*P;for(var U=[m,y],B=0;2>B;++B){var L=U[B];for(S=0;L.length>S;++S)wn(e,u,F[j=31&L[S]]),u+=k[j],j>15&&(wn(e,u,L[S]>>>5&127),u+=L[S]>>>12)}}else I=fn,O=_n,C=gn,A=pn;for(S=0;a>S;++S)if(r[S]>255){var j;yn(e,u,I[257+(j=r[S]>>>18&31)]),u+=O[j+257],j>7&&(wn(e,u,r[S]>>>23&31),u+=rn[j]);var z=31&r[S];yn(e,u,C[z]),u+=A[z],z>3&&(yn(e,u,r[S]>>>5&8191),u+=sn[z])}else yn(e,u,I[r[S]]),u+=O[r[S]];return yn(e,u,I[256]),u+O[256]},Rn=new en([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Pn=function(){for(var t=new en(256),e=0;256>e;++e){for(var i=e,r=9;--r;)i=(1&i&&3988292384)^i>>>1;t[e]=i}return t}(),In=function(t,e,i){for(;i;++e)t[e]=i,i>>>=8};function On(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=Pn[255&i^e[r]]^i>>>8;t=i},d(){return 4294967295^t}}}(),r=t.length;i.p(t);var s,n,o,a,h,l=(a=10+((s=e).filename&&s.filename.length+1||0),h=8,function(t,e,i,r,s,n){var o=t.length,a=new Zs(r+o+5*(1+Math.floor(o/7e3))+s),h=a.subarray(r,a.length-s),l=0;if(!e||8>o)for(var u=0;o>=u;u+=65535){var d=u+65535;o>d?l=Tn(h,l,t.subarray(u,d)):(h[u]=n,l=Tn(h,l,t.subarray(u,o)))}else{for(var v=Rn[e-1],c=v>>>13,_=8191&v,p=(1<<i)-1,f=new tn(32768),g=new tn(p+1),m=Math.ceil(i/3),b=2*m,w=function(e){return(t[e]^t[e+1]<<m^t[e+2]<<b)&p},y=new en(25e3),x=new tn(288),E=new tn(32),S=0,T=0,k=(u=0,0),R=0,P=0;o>u;++u){var I=w(u),O=32767&u,C=g[I];if(f[O]=C,g[I]=O,u>=R){var A=o-u;if((S>7e3||k>24576)&&A>423){l=kn(t,h,0,y,x,E,T,k,P,u-P,l),k=S=T=0,P=u;for(var M=0;286>M;++M)x[M]=0;for(M=0;30>M;++M)E[M]=0}var D=2,N=0,F=_,U=O-C&32767;if(A>2&&I==w(u-U))for(var B=Math.min(c,A)-1,L=Math.min(32767,u),j=Math.min(258,A);L>=U&&--F&&O!=C;){if(t[u+D]==t[u+D-U]){for(var z=0;j>z&&t[u+z]==t[u+z-U];++z);if(z>D){if(D=z,N=U,z>B)break;var q=Math.min(U,z-2),H=0;for(M=0;q>M;++M){var G=u-U+M+32768&32767,W=G-f[G]+32768&32767;W>H&&(H=W,C=G)}}}U+=(O=C)-(C=f[O])+32768&32767}if(N){y[k++]=268435456|hn[D]<<18|ln[N];var V=31&hn[D],J=31&ln[N];T+=rn[V]+sn[J],++x[257+V],++E[J],R=u+D,++S}else y[k++]=t[u],++x[t[u]]}}l=kn(t,h,n,y,x,E,T,k,P,u-P,l)}return bn(a,0,r+mn(l)+s)}(n=t,null==(o=e).level?6:o.level,null==o.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+o.mem,a,h,!0)),u=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&&In(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),In(l,u-8,i.d()),In(l,u-4,r),l}var Cn=!!o||!!n,An="text/plain",Mn=!1,Dn=(t,e)=>{var i=t.split("#"),r=i[1],s=i[0].split("?"),n=s[0],o=s[1];if(!o)return t;var a=o.split("&").filter(t=>t.split("=")[0]!==e).join("&");return n+(a?"?"+a:"")+(r?"#"+r:"")},Nn=function(t,e,i){var r;void 0===i&&(i=!0);var s=t.split("?"),n=s[0],o=s[1],a=p({},e),h=null!==(r=null==o?void 0:o.split("&").map(t=>{var e,r=t.split("="),s=r[0],n=i&&null!==(e=a[s])&&void 0!==e?e:r[1];return delete a[s],s+"="+n}))&&void 0!==r?r:[],l=function(t,e){var i,r;void 0===e&&(e="&");var s=[];return hr(t,function(t,e){O(t)||O(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)}(a);return l&&h.push(l),h.length>0?n+"?"+h.join("&"):n},Fn=t=>{if(t.La)return t.La;var e=t.data,i=t.compression;if(e){if(i===Cs.GZipJS){var r=On(function(t){var e=t.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(t);for(var i=new Zs(t.length+(t.length>>>1)),r=0,s=function(t){i[r++]=t},n=0;e>n;++n){if(r+5>i.length){var o=new Zs(r+8+(e-n<<1));o.set(i),i=o}var a=t.charCodeAt(n);128>a?s(a):2048>a?(s(192|a>>>6),s(128|63&a)):a>55295&&57344>a?(s(240|(a=65536+(1047552&a)|1023&t.charCodeAt(++n))>>>18),s(128|a>>>12&63),s(128|a>>>6&63),s(128|63&a)):(s(224|a>>>12),s(128|a>>>6&63),s(128|63&a))}return bn(i,0,r)}(rs(e)),{mtime:0});return{contentType:An,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Cs.Base64){var s=function(t){return t?btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(t,e)=>String.fromCharCode(parseInt(e,16)))):t}(rs(e)),n=(t=>"data="+encodeURIComponent("string"==typeof t?t:rs(t)))(s);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var o=rs(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Un=t=>{var e,i,r=()=>"sendBeacon"===t.transport?{url:Nn(t.url,{compression:Cs.Base64}),encodedBody:Fn(p({},t,{compression:Cs.Base64,La:void 0}))}:{url:Dn(t.url,"compression"),encodedBody:Fn(p({},t,{compression:void 0,La:void 0}))};try{e=Fn(t)}catch(e){if(ue(t.compression,ns(t.url,"compression")))return fe.error("Failed to gzip request body, sending uncompressed payload",e),r();throw e}return e&&ue(t.compression,ns(t.url,"compression"))&&!((i=e.body)instanceof ArrayBuffer?le(new Uint8Array(i)):ArrayBuffer.isView(i)&&le(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Mn=!0,r()):{url:t.url,encodedBody:e}},Bn=t=>{try{return Un(t)}catch(e){return fe.error(e),void(null==t.callback||t.callback({statusCode:0,error:e}))}},Ln=function(){var t=_(function*(t){var e=rs(t.data),i=yield function(t,e,i){return _e.apply(this,arguments)}(e,v.DEBUG,{rethrow:!0});if(!i)return t;var r=yield i.arrayBuffer();return p({},t,{La:{contentType:An,body:r,estimatedSize:r.byteLength}})});return function(e){return t.apply(this,arguments)}}(),jn=/Failed to fetch|NetworkError|Load failed/i,zn=t=>"TypeError"===(null==t?void 0:t.name)&&jn.test((null==t?void 0:t.message)||""),qn=t=>{var e=Bn(t);if(e){var i=e.url,r=e.encodedBody,s=null!=r?r:{},o=s.contentType,h=s.body,l=s.estimatedSize,u=new Headers;hr(t.headers,function(t,e){u.append(e,t)}),o&&u.append("Content-Type",o);var d=null,v=!1;if(a){var c=new a;d={signal:c.signal,timeout:setTimeout(()=>{var e;v=!0,c.abort(se("AbortError","PostHog request timed out"+((e=t.timeout)?" after "+e+"ms":"")))},t.timeout)}}var _=e=>{v&&"AbortError"===(null==e?void 0:e.name)||zn(e)?fe.warn(e):fe.error(e),null==t.callback||t.callback({statusCode:0,error:e})};try{var f;n(i,p({method:(null==t?void 0:t.method)||"GET",headers:u,keepalive:"POST"===t.method&&!t.ja&&52428.8>(l||0),body:h,signal:null==(f=d)?void 0:f.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){fe.error(t)}null==t.callback||t.callback(r)})).catch(_).finally(()=>d?clearTimeout(d.timeout):null)}catch(t){d&&clearTimeout(d.timeout),_(t)}}},Hn=t=>{try{var e,r=Un(t),s=r.url,n=r.encodedBody,o=null!=n?n:{},a=o.body,h=o.estimatedSize;if(!a)return;var l=a instanceof Blob?a:new Blob([a],{type:o.contentType});if(i.sendBeacon(s,l))return;var u=k(t.data)?t.data:null==(e=t.data)?void 0:e.batch;if(k(u)&&u.length>1&&(null!=h?h:0)>16384){var d=Math.ceil(u.length/2),v=e=>k(t.data)?e:p({},t.data,{batch:e});return Hn(p({},t,{data:v(u.slice(0,d))})),void Hn(p({},t,{data:v(u.slice(d))}))}fe.warn("Beacon of ~"+(null!=h?h:0)+" bytes was rejected by the browser, falling back to fetch"),qn(p({},t,{ja:!0}))}catch(t){fe.warn("Beacon send failed",t)}},Gn=(t,e,i,r)=>{var s="query"===r?"POST"===e?"sent_at":"_":void 0;return Nn(i===Cs.GZipJS?Dn(t,"compression"):t,p({},s?{[s]:Date.now().toString()}:{},i===Cs.GZipJS?{}:{compression:i}))},Wn=[];n&&Wn.push({transport:"fetch",method:qn}),o&&Wn.push({transport:"XHR",method(t){var e=Bn(t);if(e){var i=new o,r=e.encodedBody;i.open(t.method||"GET",e.url,!0);var s=null!=r?r:{},n=s.contentType,a=s.body;hr(t.headers,function(t,e){i.setRequestHeader(e,t)}),n&&i.setRequestHeader("Content-Type",n),t.timeout&&(i.timeout=t.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var e={statusCode:i.status,text:i.responseText};if(200===i.status)try{e.json=JSON.parse(i.responseText)}catch(t){}null==t.callback||t.callback(e)}},i.send(a)}}}),null!=i&&i.sendBeacon&&Wn.push({transport:"sendBeacon",method:Hn});var Vn=3e3;class Jn{constructor(t,e){this.za=!0,this.Ln=[],this.qa=G((null==e?void 0:e.flush_interval_ms)||Vn,250,5e3,fe.createLogger("flush interval"),Vn),this.Ha=t}enqueue(t){this.Ln.push(t),this.Ga||this.Wa()}unload(){this.Va();var t=this.Ln.length>0?this.Ja():{},e=Object.values(t);[...e.filter(t=>0===t.url.indexOf("/e")),...e.filter(t=>0!==t.url.indexOf("/e"))].map(t=>{this.Ya(p({},t,{transport:"sendBeacon"}))})}enable(){this.za=!1,this.Wa()}Wa(){var t=this;this.za||(this.Ga=setTimeout(()=>{if(this.Va(),this.Ln.length>0){var e=this.Ja(),i=function(){var i=e[r],s=(new Date).getTime();i.data&&k(i.data)&&hr(i.data,t=>{t.offset=Math.abs(t.timestamp-s),delete t.timestamp}),t.Ya(i)};for(var r in e)i()}},this.qa))}Ya(t){try{this.Ha(t)}catch(t){fe.error(t)}}Va(){clearTimeout(this.Ga),this.Ga=void 0}Ja(){var t={};return hr(this.Ln,e=>{var i,r=e,s=(r?r.batchKey:null)||r.url;O(t[s])&&(t[s]=p({},r,{data:[]})),null==(i=t[s].data)||i.push(r.data)}),this.Ln=[],t}}var Yn=["retriesPerformedSoFar"];class Kn{constructor(e){this.Ka=!1,this.Xa=3e3,this.Ln=[],this._instance=e,this.Ln=[],this.Qa=!0,!O(t)&&"onLine"in t.navigator&&(this.Qa=t.navigator.onLine,this.Za=()=>{this.Qa=!0,this.gs()},this.th=()=>{this.Qa=!1},pr(t,"online",this.Za),pr(t,"offline",this.th))}get length(){return this.Ln.length}retriableRequest(t){var e=t.retriesPerformedSoFar,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,Yn);F(e)&&(i.url=Nn(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.Z(p({retriesPerformedSoFar:e},i));0===t.statusCode&&fe.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)}}))}Z(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.Ln.push({retryAt:r,requestOptions:t});var s="Enqueued failed request for retry in "+i;navigator.onLine||(s+=" (Browser is offline)"),fe.warn(s),this.Ka||(this.Ka=!0,this.eh())}eh(){if(this.ih&&clearTimeout(this.ih),0===this.Ln.length)return this.Ka=!1,void(this.ih=void 0);this.ih=setTimeout(()=>{this.Qa&&this.Ln.length>0&&this.gs(),this.eh()},this.Xa)}gs(){var t=Date.now(),e=[],i=this.Ln.filter(i=>t>i.retryAt||(e.push(i),!1));if(this.Ln=e,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.ih&&(clearTimeout(this.ih),this.ih=void 0),this.Ka=!1,O(t)||(this.Za&&(t.removeEventListener("online",this.Za),this.Za=void 0),this.th&&(t.removeEventListener("offline",this.th),this.th=void 0)),this.Ln)){var i=e.requestOptions;try{this._instance._send_request(p({},i,{transport:"sendBeacon"}))}catch(t){fe.error(t)}}this.Ln=[]}}class Xn{constructor(t){this.rh=()=>{var t,e,i,r;this.sh||(this.sh={});var s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),h=(null==s?void 0:s.scrollHeight)||0;this.sh.lastScrollY=Math.ceil(n),this.sh.maxScrollY=Math.max(n,null!==(t=this.sh.maxScrollY)&&void 0!==t?t:0),this.sh.maxScrollHeight=Math.max(o,null!==(e=this.sh.maxScrollHeight)&&void 0!==e?e:0),this.sh.lastContentY=a,this.sh.maxContentY=Math.max(a,null!==(i=this.sh.maxContentY)&&void 0!==i?i:0),this.sh.maxContentHeight=Math.max(h,null!==(r=this.sh.maxContentHeight)&&void 0!==r?r:0)},this._instance=t}get nh(){return this._instance.config.scroll_root_selector}getContext(){return this.sh}resetContext(){var t=this.sh;return setTimeout(this.rh,0),t}startMeasuringScrollPosition(){pr(t,"scroll",this.rh,{capture:!0}),pr(t,"scrollend",this.rh,{capture:!0}),pr(t,"resize",this.rh)}scrollElement(){var e;if(!this.nh)return null==t||null==(e=t.document)?void 0:e.documentElement;var i=k(this.nh)?this.nh:[this.nh];for(var r of i){var s,n=null==t||null==(s=t.document)?void 0:s.querySelector(r);if(n)return n}}oh(e){var i,r,s="y"===e?"scrollTop":"scrollLeft";if(this.nh){var n=this.scrollElement();return n&&n[s]||0}return t?"y"===e?t.scrollY||t.pageYOffset||(null==(i=t.document)||null==(i=i.documentElement)?void 0:i.scrollTop)||0:t.scrollX||t.pageXOffset||(null==(r=t.document)||null==(r=r.documentElement)?void 0:r.scrollLeft)||0:0}scrollY(){return this.oh("y")}scrollX(){return this.oh("x")}}var Qn=t=>gs(null==t?void 0:t.config.mask_personal_data_properties,null==t?void 0:t.config.custom_personal_data_properties,null==t?void 0:t.config.disable_capture_url_hashes);class Zn{constructor(t,e,i,r){this.ah=t=>{var e=this.hh();if(!e||e.sessionId!==t){var i={sessionId:t,props:this.uh(this._instance)};this.Ir.register({[Oi]:i})}},this._instance=t,this.dh=e,this.Ir=i,this.uh=r||Qn,this.dh.onSessionId(this.ah)}hh(){return this.Ir.props[Oi]}getSetOnceProps(){var t,e=null==(t=this.hh())?void 0:t.props;return e?"r"in e?ms(e,this._instance.config.disable_capture_url_hashes):{$referring_domain:e.referringDomain,$pathname:e.initialPathName,utm_source:e.utm_source,utm_campaign:e.utm_campaign,utm_medium:e.utm_medium,utm_content:e.utm_content,utm_term:e.utm_term}:{}}getSessionProps(){var t={};return hr(dr(this.getSetOnceProps()),(e,i)=>{"$current_url"===i&&(i="url"),t["$session_entry_"+b(i)]=e}),t}}class to{on(t,e){return this.wi[t]||(this.wi[t]=[]),this.wi[t].push(e),()=>{this.wi[t]=this.wi[t].filter(t=>t!==e)}}emit(t,e){for(var i of this.wi[t]||[])i(e);for(var r of this.wi["*"]||[])r(t,e)}constructor(){this.wi={}}}var eo=ge("[SessionId]"),io=864e5;class ro{on(t,e){return this._h.on(t,e)}constructor(t,e,i){var r;if(this.ph=null,this.fh=null,this.gh=[],this.mh=void 0,this.bh=!1,this._h=new to,this.wh=(t,e)=>!(!F(t)||!F(e))&&Math.abs(t-e)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode===Xi)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.P=t.config,this.Ir=t.persistence,this.yh=void 0,this.$h=void 0,this._sessionStartTimestamp=null,this.xh=void 0,this._sessionActivityTimestamp=null,this.Eh=e||$r,this.Sh=i||$r;var s=this.P.persistence_name||this.P.token;if(this._sessionTimeoutMs=1e3*G(this.P.session_idle_timeout_seconds||1800,60,36e3,eo.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Th(),this.kh="ph_"+s+"_window_id",this.Rh="ph_"+s+"_primary_window_exists",this.Ph()){var n=qr.oo(this.kh),o=qr.oo(this.Rh);n&&!o?this.yh=n:qr.mr(this.kh),qr.gr(this.Rh,!0)}null!=(r=this.P.bootstrap)&&r.sessionID&&this.setBootstrapSessionId(this.P.bootstrap.sessionID),this.Ih()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return O(this.gh)&&(this.gh=[]),this.gh.push(t),this.$h&&t(this.$h,this.yh),()=>{this.gh=this.gh.filter(e=>e!==t)}}Ph(){return"memory"!==this.P.persistence&&!this.Ir.Lo&&qr.ro()}Oh(t){t!==this.yh&&(this.yh=t,this.Ph()&&qr.gr(this.kh,t))}Ch(){return this.yh?this.yh:this.Ph()?qr.oo(this.kh):null}Ah(t){var e=this.ph;return!M(e)&&!M(t)&&5e3>Math.abs(t-e)}Mh(t,e,i){var r=e!==this._sessionActivityTimestamp,s=!(t!==this.$h||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=e,this.$h=t,s&&!r||s&&this.Ah(e)||(this.ph=e,this.Ir.register({[Ye]:[e,t,i]}))}Dh(){var t,e=null==(t=this.P)?void 0:t.persistence_save_debounce_ms;return F(e)&&e>0}Nh(){this.Dh()?this.Ir.refreshKey(Ye):(this.Ir.flush(),this.Ir.load())}Fh(){var t;if(!M(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.ph){this.Nh();var e=this.Uh();e[1]===this.$h&&e[2]===this._sessionStartTimestamp&&(this.ph=this._sessionActivityTimestamp,this.Ir.register({[Ye]:[this._sessionActivityTimestamp,null!==(t=this.$h)&&void 0!==t?t:null,this._sessionStartTimestamp]}),this.Ir.flush())}}Bh(){var t=this.Uh()[0],e=F(t)?t:0,i=F(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(e,i)}Lh(t){return this.Nh(),this.wh(t,this.Bh())}Uh(){var t=this.Ir.props[Ye];return k(t)&&2===t.length&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.ph=null,this.xh=void 0,clearTimeout(this.jh),this.jh=void 0,this.Mh(null,null,null)}setBootstrapSessionId(t,e){void 0===e&&(e=!1);var i=function(t,e){void 0===e&&(e=(new Date).getTime());try{var i=(t=>{var e=t.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})(t);return i>e+6e4?void eo.error("Bootstrap sessionID cannot be in the future"):i}catch(t){return void eo.error("Invalid sessionID in bootstrap",t)}}(t);return!O(i)&&(e?this.xh={sessionId:t,sessionStartTimestamp:i}:this.Mh(t,(new Date).getTime(),i),!0)}destroy(){this.bh=!0,this.Fh(),clearTimeout(this.jh),this.jh=void 0,this.mh&&t&&(t.removeEventListener(ir,this.mh,{capture:!1}),this.mh=void 0),this.gh=[]}Ih(){this.mh=()=>{this.Fh(),this.Ph()&&qr.mr(this.Rh)},pr(t,ir,this.mh,{capture:!1})}checkAndGetSessionAndWindowId(t,e,i){if(void 0===t&&(t=!1),void 0===e&&(e=null),void 0===i&&(i=!1),this.P.cookieless_mode===Xi)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=e||(new Date).getTime(),s=this.$h;if(i)this.fh=r;else if(M(this.fh)||this.fh>r||r-this.fh>=1e3){var n,o;null==(n=(o=this.Ir).syncCookieProperties)||n.call(o),this.fh=r}var a=this.Uh(),h=a[1],l=a[2],u=!O(s)&&h!==s,d=this.Bh(),v=this.Ch(),c=this.xh,_=!!c&&(c.sessionStartTimestamp>r+6e4||r-c.sessionStartTimestamp>io),p=c?_:F(l)&&Math.abs(r-l)>io,f=!1,g=u,m=!h||!!c,b=h,w=!m&&!t&&this.wh(r,d);if(w){(w=this.Lh(r))||eo.info("cross-tab refresh kept the session alive",{sessionId:h});var y=this.Uh();h=y[1],l=y[2]}if(m||w||p){g=!1;var x=c&&!_;h=x?c.sessionId:this.Eh(),v=this.Sh(),eo.info("new session ID assigned",{sessionId:h,windowId:v,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:w,sessionPastMaximumLength:p}}),l=x?c.sessionStartTimestamp:r,this.xh=void 0,f=!0}else v||(v=this.Sh(),f=!0),(g=g||h!==b)&&(eo.info("adopted cross-tab session id",{sessionId:h,windowId:v}),f=!0);var E=F(d)&&t&&!p?d:r,S=F(l)?l:(new Date).getTime();this.Oh(v),this.Mh(h,E,S),t||this.Th();var T={noSessionId:m,activityTimeout:w,sessionPastMaximumLength:p,crossTabAdoption:g};return f&&this.gh.forEach(t=>t(h,v,T)),{sessionId:h,windowId:v,sessionStartTimestamp:S,changeReason:f?T:void 0,lastActivityTimestamp:d}}Th(){this.bh||(clearTimeout(this.jh),this.jh=setTimeout(()=>{if(!this.bh)if(this.Lh((new Date).getTime())){var t=this.$h;this.resetSessionId(),this._h.emit("forcedIdleReset",{idleSessionId:t})}else this.Th()},1.1*this.sessionTimeoutMs))}}function so(){return(so=_(function*(){var t=null==i?void 0:i.userAgentData;if(null!=t&&t.getHighEntropyValues)try{var e=yield t.getHighEntropyValues(["model"]),r=null==e?void 0:e.model;return C(r)&&r.length>0?r:void 0}catch(t){return void fe.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",t)}})).apply(this,arguments)}function no(t,e){var i="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(i="$survey_"+e+"/"+t.id+"/"+t.current_iteration),i}function oo(t,e,i){return rs({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:i})}var ao="custom",ho="i.posthog.com",lo=/^\/static\//,uo=["/s/","/e/","/i/"];class vo{constructor(t){this.zh={},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("."+ho,".posthog.com")),"https://app.posthog.com"===e?"https://us.posthog.com":e}get region(){return this.zh[this.apiHost]||(this.zh[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":ao),this.zh[this.apiHost]}qh(t){if(lo.test(t)){var e=this.instance.config.asset_host;if("string"==typeof e)return e.trim().replace(/\/$/,"")||void 0}}Hh(t){var e=ss(t);return e?e.protocol+"//"+e.host+e.pathname:void 0}Gh(t,e,i){if("ui"===t)return i;var r=i,s=this.instance.config.rewriteRequestPath;if(s){var n,o=(null==(n=ss(i))?void 0:n.href)||i;r=s(new URL(o)).toString()}if(s&&"api"===t&&uo.some(t=>0===e.indexOf(t))){var a=this.Hh(r);if(a){var h,l=this.apiHost,u=this.Wh;(null==(h=u)?void 0:h.apiHost)===l&&u.rewriteRequestPath===s||(u={apiHost:l,rewriteRequestPath:s,urls:new Set},this.Wh=u),u.urls.add(a)}}return r}isIngestionEndpoint(t){var e=this.Wh,i=this.Hh(t);return(null==e?void 0:e.apiHost)===this.apiHost&&e.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&e.urls.has(i)}endpointFor(t,e){if(void 0===e&&(e=""),e&&(e="/"===e[0]?e:"/"+e),"ui"===t)return this.Gh(t,e,this.uiHost+e);if("flags"===t)return this.Gh(t,e,this.flagsApiHost+e);if("assets"===t){var i=this.qh(e);if(i)return this.Gh(t,e,""+i+e)}if(this.region===ao)return this.Gh(t,e,this.apiHost+e);var r=ho+e;switch(t){case"assets":return this.Gh(t,e,"https://"+this.region+"-assets."+r);case"api":return this.Gh(t,e,"https://"+this.region+"."+r)}}}var co=ge("[Surveys]"),_o={ignoreConditions:!1,ignoreDelay:!1,displayType:qs.Popover},po=ge("[PostHog ExternalIntegrations]"),fo={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class go{constructor(t){this._instance=t}Gt(t,e){var i;null==(i=d.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,t,t=>{if(t)return po.error("failed to load script",t);e()})}startIfEnabledOrStop(){var t=this,e=function(){var e,r,s,n=i[0],o=i[1];!o||null!=(e=d.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.Gt(fo[n],()=>{var e;null==(e=d.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!o&&null!=(r=d.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[n]&&(null==(s=d.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[n])||s.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;e()}}}class mo{constructor(t,e){this.l=t,this.Ot=e,this.Vh=new Map,this.Dt=!1}add(t){var e=this;return _(function*(){if(e.Dt)throw new Error("Cannot add an extension to a disposed ExtensionRuntime");if(e.Vh.has(t.name))throw new Error('Browser extension "'+t.name+'" is already registered');e.Vh.set(t.name,t);try{var i=t.setup(e.Ot);i&&(yield i)}catch(i){var r=e.Vh.get(t.name)===t;r&&e.Vh.delete(t.name),e.l.error('Failed to set up browser extension "'+t.name+'"',i),r&&e.Jh(t)}})()}getExtension(t){return this.Vh.get(t)}dispose(){if(!this.Dt){this.Dt=!0;var t=Array.from(this.Vh.values()).reverse();for(var e of(this.Vh.clear(),t))this.Jh(e)}}Jh(t){try{var e=null==t.dispose?void 0:t.dispose();e&&R(e.then)&&e.then(void 0,e=>{this.l.error('Failed to dispose browser extension "'+t.name+'"',e)})}catch(e){this.l.error('Failed to dispose browser extension "'+t.name+'"',e)}}}class bo{constructor(t){this._instance=t}initialize(){}get(t){var e=this._instance.persistence;if("string"==typeof t)return null==e?void 0:e.get_property(t);var i={};for(var r of t){var s=null==e?void 0:e.get_property(r);O(s)||(i[r]=s)}return i}set(t,e){var i;null==(i=this._instance.persistence)||i.register("string"==typeof t?{[t]:e}:t)}remove(t){var e;null==(e=this._instance.persistence)||e.unregister(t)}}var wo="extensionsRemoteConfig";class yo{constructor(t){this.Dt=!1,this.instance=t,this.l=fe,this.Yh=t.Kh,this.kv=new bo(t),this.onEvent=t=>Hs(this.instance.on("eventCaptured",e=>{try{t({event:e.event,properties:e.properties})}catch(t){this.l.error("Browser extension event listener failed",t)}})),this.onRemoteConfig=t=>{if(this.Dt)return Hs(()=>{});var e=e=>{try{t(e)}catch(t){this.l.error("Browser extension remote config listener failed",t)}},i=this.instance.Xh.on(wo,e);return this.Yh&&e(this.Yh),Hs(i)},this.Qh=new mo(fe.createLogger("[BrowserExtensions]"),this)}get logger(){return this.l}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var t;return null!==(t=this.instance.get_property(Se))&&void 0!==t?t:this.distinctId}get deviceId(){var t=this.instance.get_property(Se);return"string"==typeof t?t:void 0}get library(){return{name:v.LIB_NAME,version:v.LIB_VERSION}}get initialPersonProperties(){var t,e;return null!==(t=null==(e=this.instance.persistence)?void 0:e.get_initial_props())&&void 0!==t?t:{}}get groups(){return this.instance.getGroups()}get session(){try{var t,e,i,r,s=null==(t=this.instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);return{sessionId:null!==(e=null==s?void 0:s.sessionId)&&void 0!==e?e:"",windowId:null!==(i=null==s?void 0:s.windowId)&&void 0!==i?i:"",sessionStartTimestamp:null!==(r=null==s?void 0:s.sessionStartTimestamp)&&void 0!==r?r:0}}catch(t){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(t){return this.Qh.add(t)}getExtension(t){return this.Qh.getExtension(t)}capture(t,e,i){var r=this;return _(function*(){i?r.instance.capture(t,e,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):r.instance.capture(t,e)})()}registerDynamicEventProperties(t){return Hs(this.instance.Zh(t))}handleRemoteConfig(t){this.Dt||(this.Yh=t,this.instance.Xh.emit(wo,t))}sendRequest(t,e){var i=this;return _(function*(){var r;void 0===e&&(e={});var s=i.instance.requestRouter.endpointFor(null!==(r=e.target)&&void 0!==r?r:"api",t),n={method:e.method,url:e.query?Nn(s,e.query):s,data:e.body,headers:e.headers,timeout:e.timeoutMs,fireCallbackOnDrop:!0,transport:e.transport,compression:e.compression,compressionFallback:"flags"===e.target&&"best-available"===e.compression?w.Base64:void 0,timestampMode:e.sentAt};return"sendBeacon"===e.transport?(i.instance._send_request(n),{statusCode:202}):new Promise(t=>{n.callback=t,i.instance._send_request(n)})})()}dispose(){this.Dt||(this.Dt=!0,this.Qh.dispose())}}var $o,xo={},Eo=0,So=()=>{},To='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',ko="Surveys module not available",Ro="sanitize_properties is deprecated. Use before_send instead",Po="Invalid value for property_denylist config: ",Io=/^[A-Za-z0-9_-]{1,400}$/,Oo=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,Co=["token","distinct_id",Ui],Ao="posthog",Mo=!Cn&&-1===(null==l?void 0:l.indexOf("MSIE"))&&-1===(null==l?void 0:l.indexOf("Mozilla")),Do=t=>{var e={};return t&&"unset"!==t?("2025-11-30">t||(e.strictMinimumDuration=!0),"2026-05-30">t||(e.canvasCapture={resolutionScale:.6}),"2026-06-25">t||(e.streamNetworkBody=!0),"2026-08-30">t||(e.captureJsonLd=!0),e):e},No=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:_r(null==r?void 0:r.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:So,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&&C(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,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",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){fe.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:tr,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:Vn},error_tracking:{},_onCapture:So},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Gr,ignore_text_selection:!0}:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:Do(t),external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t),cookieWinsOnConflict:!(!t||"unset"===t||"2026-08-29">t)}))(e))},Fo=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],Uo=t=>{var e={};for(var i of Fo){var r=i[0],s=i[1];O(t[r])||(e[s]=t[r])}var n=lr({},e,t),o=t.__preview_external_dependency_versioned_paths;return O(o)||(O(t.strict_script_versioning)&&(n.strict_script_versioning=!!o),C(o)&&O(t.asset_host)&&(n.asset_host=o)),k(t.property_blacklist)&&(O(t.property_denylist)?n.property_denylist=t.property_blacklist:k(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:fe.error(Po+t.property_denylist)),n};class Bo{constructor(){this.__forceAllowLocalhost=!1}get tl(){return this.__forceAllowLocalhost}set tl(t){fe.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class Lo{el(t){if(t){var e=this.Vh.indexOf(t);-1!==e&&this.Vh.splice(e,1)}}il(t,e){return this.el(t),this.Vh.push(e),null==e.initialize||e.initialize(),e}rl(){return this.config.cookieless_mode===Xi||this.config.cookieless_mode===Ki&&this.consent.isRejected()}sl(){if(!(this.nl||this.config.reuseAnonymousId||this.config.segment||this.rl())){var t,e,i,r="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(r||this.config.disable_persistence)&&(this.ol||(r?(t="persistence is set to '"+this.config.persistence+"'",e="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(t="persistence is disabled (disable_persistence is true)",e="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.nl=!0,console.warn("[PostHog.js]",t+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+e+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+i)))}}al(){if(!this.rl()&&this.get_distinct_id()===Fi){var t=this.persistence;if(t){this.hl()||t.load(!0);var e=this.get_distinct_id();if(!e||e===Fi){var i=this.config.get_device_id($r());this.register({distinct_id:i,$device_id:i}),t.set_property(Ii,Qi)}this.ll()}}}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 Bo,this.ul=!1,this.version=v.LIB_VERSION,this.dl=new Set,this.vl="",this.Xh=new to,this.Vh=[],this.cl=[],this.ol=!1,this.nl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=No(),this.SentryIntegration=Xr,this.sentryIntegration=t=>function(t,e){var i=Kr(t,e);return{name:Yr,processEvent:t=>i(t)}}(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._l=!1,this.pl=null,this.fl=null,this.gl=null,this.scrollManager=new Xn(this),this.pageViewManager=new Qr(this),this.rateLimiter=new Ys(this),this.requestRouter=new vo(this),this.consent=new Hr(this),this.externalIntegrations=new go(this);var e=null!==(t=Lo.__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.metrics=e.metrics&&new e.metrics(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=C(t)?{[t]:e}:t;this.setPersonProperties(r),null==i||i({})},set_once:(t,e,i)=>{var r=C(t)?{[t]:e}:t;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",t=>fe.info('send "'+(null==t?void 0:t.event)+'"',t))}init(t,e,i){if(i&&i!==Ao){var r,s=null!==(r=xo[i])&&void 0!==r?r:new Lo;return s._init(t,e,i),xo[i]=s,xo[Ao][i]=s,s}return this._init(t,e,i)}_init(e,i,r){var s,n,o;void 0===i&&(i={});var a,h=C(e)?e.trim():"";if(!h)return fe.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 h!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+h+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=No(i.defaults),i.debug=this.ml(i.debug),this.bl=i,this.wl=[],i.person_profiles?this.fl=i.person_profiles:i.process_person&&(this.fl=i.process_person);var l=No(i.defaults),u=Uo(i),d=lr({},l,u,{name:r,token:h});P(l.rageclick)&&P(u.rageclick)&&(d.rageclick=lr({},l.rageclick,u.rageclick)),P(l.session_recording)&&P(u.session_recording)&&(d.session_recording=lr({},l.session_recording,u.session_recording)),this.set_config(d),this.config.on_xhr_error&&fe.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=i.disable_compression?void 0:Cs.GZipJS;var c=this.hl();if(this.persistence=new Os(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Os(p({},this.config,{persistence:"sessionStorage"}),c,!1),this.vl="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&qr.ro()){var _=qr.oo(this.vl);k(_)&&_.forEach(t=>{C(t)&&this.dl.add(t)})}else qr.mr(this.vl);var f=p({},this.persistence.props),g=p({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.yl=new Jn(t=>this.$l(t),this.config.request_queue_config),this.xl=new Kn(this),this.__request_queue=[];var m=this.rl();m||(this.sessionManager=new ro(this),this.sessionPropsManager=new Zn(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((t,e,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.El()})),this.Sl(),this.config.__preview_deferred_init_extensions?(fe.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Tl(m)},0)):(fe.info("Initializing extensions synchronously"),this.Tl(m)),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&fe.info("Starting in debug mode",{this:this,config:i,thisC:p({},this.config),p:f,s:g}),!this.config.identity_distinct_id||null!=(s=i.bootstrap)&&s.distinctID||(i.bootstrap=p({},i.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var b=null==(n=i.bootstrap)?void 0:n.distinctID;if(this.ol=!!b&&!A(b),void 0!==(null==(o=i.bootstrap)?void 0:o.distinctID)){var w=i.bootstrap.distinctID,y=this.get_distinct_id(),x=this.persistence.get_property(Ii);if(i.bootstrap.isIdentifiedID&&null!=y&&y!==w&&x===Qi)this.identify(w);else if(i.bootstrap.isIdentifiedID&&null!=y&&y!==w&&x===Zi)fe.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 E=this.config.get_device_id($r()),S=i.bootstrap.isIdentifiedID?E:w;this.persistence.set_property(Ii,i.bootstrap.isIdentifiedID?Zi:Qi),this.register({distinct_id:w,$device_id:S})}}if(m)this.register_once({distinct_id:Fi,$device_id:null},"");else if(!this.get_distinct_id()){var T=this.config.get_device_id($r());this.register_once({distinct_id:T,$device_id:T},""),this.persistence.set_property(Ii,Qi)}return pr(t,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),i.segment?Jr(this,()=>this.kl()):this.kl(),R(this.config._onCapture)&&this.config._onCapture!==So&&(fe.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",t=>this.config._onCapture(t.event,t))),this.config.ip&&fe.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return so.apply(this,arguments)}().then(t=>{t&&this.register({[Te]:t})}).catch(So),this}Rl(t){var e=t;return C(e.name)&&R(e.setup)}Pl(t,e){this.Rl(t)?e.push(()=>{this.Il().add(t).catch(()=>null==t.dispose?void 0:t.dispose()).catch(e=>{fe.error('Failed to dispose browser extension "'+t.name+'"',e)})}):this.Vh.push(t)}Sl(){var t,e,i,r,s,n,o=null!==(t=null==(e=this.config.__extensionClasses)?void 0:e.featureFlags)&&void 0!==t?t:null==(i=Lo.__defaultExtensionClasses)?void 0:i.featureFlags;o&&(this.featureFlags&&this.featureFlags instanceof o||(null==(r=this.Ol)||r.call(this),this.Ol=void 0,this.featureFlags=new o(this)),R(this.featureFlags.onReloading)&&R(this.featureFlags.setup)?this.Ol||(this.Ol=this.featureFlags.onReloading(()=>{this.Xh.emit("featureFlagsReloading",!0)}),this.Il().add(this.featureFlags)):null==(s=(n=this.featureFlags).initialize)||s.call(n))}Tl(t){var e,i,r,s,n,o,a,h=performance.now(),l=p({},Lo.__defaultExtensionClasses,this.config.__extensionClasses),u=[];l.exceptions&&this.Vh.push(this.exceptions=null!==(e=this.exceptions)&&void 0!==e?e:new l.exceptions(this)),l.historyAutocapture&&this.Vh.push(this.historyAutocapture=new l.historyAutocapture(this)),l.tracingHeaders&&this.Vh.push(this.tracingHeaders=new l.tracingHeaders(this)),l.siteApps&&this.Vh.push(this.siteApps=new l.siteApps(this)),l.sessionRecording&&!t&&this.Vh.push(this.sessionRecording=new l.sessionRecording(this)),this.config.disable_scroll_properties||u.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),l.autocapture&&this.Pl(this.autocapture=new l.autocapture(this),u),l.surveys&&this.Pl(this.surveys=null!==(i=this.surveys)&&void 0!==i?i:new l.surveys(this),u),l.logs&&this.Pl(this.logs=null!==(r=this.logs)&&void 0!==r?r:new l.logs(this),u),l.metrics&&this.Vh.push(this.metrics=null!==(s=this.metrics)&&void 0!==s?s:new l.metrics(this)),l.conversations&&this.Vh.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new l.conversations(this)),l.productTours&&this.Vh.push(this.productTours=new l.productTours(this)),l.heatmaps&&this.Vh.push(this.heatmaps=new l.heatmaps(this)),l.webVitalsAutocapture&&this.Vh.push(this.webVitalsAutocapture=new l.webVitalsAutocapture(this)),l.exceptionObserver&&this.Vh.push(this.exceptionObserver=new l.exceptionObserver(this)),l.deadClicksAutocapture&&this.Vh.push(this.deadClicksAutocapture=new l.deadClicksAutocapture(this,Wr)),l.toolbar&&this.Vh.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new l.toolbar(this)),l.experiments&&this.Vh.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new l.experiments(this)),this.Vh.forEach(t=>{t.initialize&&u.push(()=>{null==t.initialize||t.initialize()})}),u.push(()=>{if(this.Cl){var t=this.Cl;this.Cl=void 0,this.Vh.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}}),this.Al(u,h)}Al(t,e){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-e>=30&&t.length>0)return void setTimeout(()=>{this.Al(t,e)},0);var i=t.shift();if(i)try{i()}catch(t){fe.error("Error initializing extension:",t)}}var r=Math.round(performance.now()-e);this.register_for_session({[Bi]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[Li]:r}),this.config.__preview_deferred_init_extensions&&fe.info("PostHog extensions initialized ("+r+"ms)")}Yt(t){var e;if(!r||!r.body)return fe.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Yt(t)},500);if(this.config.__preview_deferred_init_extensions&&(this.Cl=t),this.Kh=t,this.compression=void 0,t.ok){var i,s=t.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=m(s.supportedCompression,Cs.GZipJS)?Cs.GZipJS:m(s.supportedCompression,Cs.Base64)?Cs.Base64:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.fl?this.fl:tr}),null==(e=this.Ml)||e.handleRemoteConfig(t),this.Vh.forEach(e=>null==e.onRemoteConfig?void 0:e.onRemoteConfig(t))}kl(){try{this.config.loaded(this)}catch(t){fe.critical("`loaded` function failed",t)}if(this.Dl(),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.rl())&&this.Nl()},1),this.Fl=new Xs(this),this.Fl.load()}Dl(){var t;this.is_capturing()&&this.config.request_batching&&(null==(t=this.yl)||t.enable())}_dom_loaded(){this.is_capturing()&&ar(this.__request_queue,t=>this.$l(t)),this.__request_queue=[],this.Dl()}_handle_unload(){var t,e,i,r,s;null==(t=this.surveys)||null==t.handlePageUnload||t.handlePageUnload(),null==(e=this.metrics)||e.flush("sendBeacon"),this.config.request_batching?(this.Ul()&&this.capture(sr),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.yl)||r.unload(),null==(s=this.xl)||s.unload()):this.Ul()&&this.capture(sr,null,{transport:"sendBeacon"})}_send_request(t){var e;this.__loaded?Mo?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?null!==(e=this.compression)&&void 0!==e?e:t.compressionFallback:t.compression,(O(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;var n,o,a,l,u,d=null!==(e=s.transport)&&void 0!==e?e:"fetch";"sendBeacon"===d&&O(s.compression)&&s.data&&(s.compression=Cs.Base64),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(o=null==(u=(l=(k(n=s.data)?n:[n]).map(t=>p({},t,t.timestamp instanceof Date&&!isNaN(t.timestamp.getTime())?{timestamp:t.timestamp.toISOString()}:{})))[0])||null==(a=u.properties)?void 0:a.token)&&void 0!==o?o:null==u?void 0:u.token,batch:l,sent_at:(new Date).toISOString()}:"body"===s.timestampMode&&(s.data=function(t,e){return void 0===e&&(e=(new Date).toISOString()),k(t)?t.map(t=>p({},t,{sent_at:e})):p({},t,{sent_at:e})}(s.data))),s.url=Gn(s.url,s.method,s.compression,s.timestampMode);var v=Wn.filter(t=>!s.disableTransport||!t.transport||!s.disableTransport.includes(t.transport)),c=null!==(i=null==(r=function(t,e){for(var i=0;t.length>i;i++)if(e(t[i]))return t[i]}(v,t=>t.transport===d))?void 0:r.method)&&void 0!==i?i:v[0].method;if(!c)throw new Error("No available transport method");var _=t=>{try{c(t)}catch(t){zn(t)?fe.warn(t):fe.error(t),null==s.callback||s.callback({statusCode:0,error:t})}};"sendBeacon"!==d&&s.data&&s.compression===Cs.GZipJS&&h&&"undefined"!=typeof Promise&&!Mn?Ln(s).then(t=>{_(t)}).catch(e=>{if(de(e))return Mn=!0,void _(p({},s,{compression:void 0,url:Gn(t.url,t.method,void 0,t.timestampMode)}));(t=>{if(!t||"object"!=typeof t)return!1;var e="name"in t?String(t.name):"";return de(t)||e===he})(e)&&(Mn=!0),_(s)}):c(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}))}$l(t){this.xl?this.xl.retriableRequest(t):this._send_request(t)}_execute_array(t){Eo++;try{var e,i=[],r=[],s=[];ar(t,t=>{if(t)if(k(e=t[0]))s.push(t);else if(R(t))try{t.call(this)}catch(e){fe.error("Error executing queued PostHog call",t,e)}else k(t)&&"alias"===e?i.push(t):k(t)&&-1!==e.indexOf("capture")&&R(this[e])?s.push(t):r.push(t)});var n=function(t,e){ar(t,function(t){try{if(k(t[0])){var i=e;hr(t,function(t){i=i[t[0]].apply(i,t.slice(1))})}else e[t[0]].apply(e,t.slice(1))}catch(e){fe.error("Error executing queued PostHog call",t,e)}})};n(i,this),n(r,this),n(s,this)}finally{Eo--}}push(t){if(Eo>0&&k(t)&&C(t[0])){var e=Lo.prototype[t[0]];R(e)&&e.apply(this,t.slice(1))}else this._execute_array([t])}Bl(){var t,e=null==(t=this.persistence)?void 0:t.get_property(Ie);return C(e)&&Oo.test(e)?{value:e,delivered:!1}:P(e)&&C(e.value)&&Oo.test(e.value)?{value:e.value,delivered:!0===e.delivered}:void 0}Ll(t,e,i,r){if(this.persistence){this.persistence.refreshKey(Ie);var s=this.Bl();if(!r){if(i)return C(e)&&Oo.test(e)?(e!==(null==s?void 0:s.value)&&this.persistence.register({[Ie]:{value:e,delivered:!1}}),{value:e,pending:e!==(null==s?void 0:s.value)||!s.delivered}):void this.persistence.unregister(Ie);if(C(t)&&Io.test(t)){if((null==s?void 0:s.value.split(".")[3])===t)return{value:s.value,pending:!s.delivered};var n="fb.1."+Date.now()+"."+t;return this.persistence.register({[Ie]:{value:n,delivered:!1}}),{value:n,pending:!0}}return s?{value:s.value,pending:!s.delivered}:void 0}this.persistence.unregister(Ie)}}jl(t){if(this.persistence){this.persistence.refreshKey(Ie);var e=this.Bl();(null==e?void 0:e.value)!==t||e.delivered||this.persistence.register({[Ie]:{value:t,delivered:!0}})}}capture(t,e,i){var r,s,n,o,a,h,l,u,d,v;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.yl){if(this.is_capturing())if(!O(t)&&C(t)){this.al();var c=!this.config.opt_out_useragent_filter&&this._is_bot();if(!c||this.config.__preview_capture_bot_pageviews){var _=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==_||!_.isRateLimited){var f;null!=e&&e.$current_url&&!C(null==e?void 0:e.$current_url)&&(fe.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._originatedFromCaptureException||fe.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&&(f=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 g=new Date,m=(null==i?void 0:i.timestamp)||g,b=re(null==i?void 0:i.uuid,$r),w={uuid:b,event:t,properties:this.calculateEventProperties(t,e||{},m,b)};t===rr&&this.config.__preview_capture_bot_pageviews&&c&&(w.event="$bot_pageview",w.properties.$browser_type="bot"),_&&(w.properties.$lib_rate_limit_remaining_tokens=_.remainingTokens);var y="$feature_flag_called"===t&&!1===w.properties.$feature_flag_has_experiment&&!0===this.get_property(hi);(null==i?void 0:i.$set)&&!y&&(w.$set=null==i?void 0:i.$set);var x=P(null==e?void 0:e.$set)?e.$set:void 0,E=!(null==i||!i.$set)&&Pe in i.$set,S=E||!!x&&Pe in x,T=E?null==i||null==(r=i.$set)?void 0:r[Pe]:null==x?void 0:x[Pe],R=k(null==e?void 0:e.$unset)?e.$unset:[],A=(null==i?void 0:i.$unset)||[],M=-1!==R.indexOf(Pe)||-1!==A.indexOf(Pe),N=this.Ll(null==(s=f)?void 0:s.fbclid,T,S,M);N&&!0===w.properties.$process_person_profile&&N.pending&&!S&&!y&&(w.$set=p({[Pe]:N.value},w.$set));var F=null==i?void 0:i.$unset;F&&(w.$unset=F);var U=y?void 0:this.zl(null==i?void 0:i.$set_once,t!==or,t===nr);if(U&&(w.$set_once=U),null!=i&&i._noTruncate||(l=this.config.properties_string_max_length,u=w,d=t=>C(t)?t.slice(0,l):t,v=new Set,w=function t(e,i){if(e!==Object(e))return d?d(e):e;if(!v.has(e)){var r;if(v.add(e),k(e))r=[],ar(e,e=>{r.push(t(e))});else{var s={};hr(j(e)?vr(e):e,(e,i)=>{v.has(e)||(s[i]=t(e,i))}),r=s}return r}}(u)),w.timestamp=m,O(null==i?void 0:i.timestamp)||(w.properties.$event_time_override_provided=!0,w.properties.$event_time_override_system_time=g),y&&(w.properties=function(t,e){void 0===e&&(e=[]);var i={},r=e=>{void 0!==t[e]&&(i[e]=t[e])};return ae.forEach(r),e.forEach(r),i}(w.properties,Co)),t===js.DISMISSED||t===js.SENT){var B=null==e?void 0:e[zs.SURVEY_ID],L=null==e?void 0:e[zs.SURVEY_ITERATION];(t=>{try{var e=(t=>((t,e)=>"seenSurvey_"+function(t){return t.current_iteration&&t.current_iteration>0?t.id+"_"+t.current_iteration:t.id}(e))(0,t))(t);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){co.error("Failed to persist survey seen state",t)}})({id:B,current_iteration:L}),w.$set=p({},w.$set,{[no({id:B,current_iteration:L},t===js.SENT?"responded":"dismissed")]:!0})}else t===js.SHOWN&&(w.$set=p({},w.$set,{[zs.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(t===Ws.SHOWN){var z=null==e?void 0:e[Vs.TOUR_TYPE];z&&(w.$set=p({},w.$set,{[Vs.TOUR_LAST_SEEN_DATE+"/"+z]:(new Date).toISOString()}))}var q=p({},w.properties.$set,w.$set);if(I(q)||this.setPersonPropertiesForFlags(q),!D(this.config.before_send)){var H=this.G(w);if(!H)return;(w=H).uuid=re(w.uuid,$r)}var G=null!==(n=null==(o=w.$set)?void 0:o[Pe])&&void 0!==n?n:P(null==(a=w.properties)?void 0:a.$set)?w.properties.$set[Pe]:void 0,W=null!=N&&N.pending&&G===N.value?N.value:void 0;this.Xh.emit("eventCaptured",w);var V=null!==(h=null==i?void 0:i._url)&&void 0!==h?h:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),J=p({method:"POST",url:V,data:w,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(V)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},W?{fireCallbackOnDrop:!0,callback:t=>{t.statusCode>=200&&300>t.statusCode&&this.jl(W)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||W?this.$l(J):this.yl.enqueue(J),w}fe.critical("This capture call is ignored due to client rate limiting.")}}else fe.error("No event name provided to posthog.capture")}else fe.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",e=>t(e.event,e))}getExtension(t){var e;return null==(e=this.Ml)?void 0:e.getExtension(t)}Il(){var t;return null!==(t=this.Ml)&&void 0!==t?t:this.Ml=new yo(this)}Zh(t){this.cl.push(t);var e=!0;return()=>{if(e){e=!1;var i=this.cl.indexOf(t);-1!==i&&this.cl.splice(i,1)}}}ql(t){var e,i,r;return void 0===t&&(t=!0),!(null==(e=this.persistence)||!e.consumeCookieIdentityChange())&&(this.gl=null,this.persistence.get_property(Ii)===Qi&&(null==(r=this.sessionPersistence)||r.clear(),this.dl.clear(),this.Hl()),null==(i=this.featureFlags)||i.reset(),t&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,i,n,o,a){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return i;this.persistence.syncCookieProperties(),this.ql();var h=a?void 0:this.persistence.remove_event_timer(e),u=p({},i);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.rl()&&(u[Ui]=!0),"$snapshot"===e){var d=p({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=d.distinct_id,(!C(u.distinct_id)&&!N(u.distinct_id)||A(u.distinct_id))&&fe.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var c,_=function(e,i,r,n){var o,a,h,u;if(void 0===n&&(n=!1),!l)return{};var d,c=e?[...hs,...i||[]]:[],_=function(t){for(var e=0;Qt.length>e;e++){var i=Qt[e],r=i[1],s=i[0].exec(t),n=s&&(R(r)?r(s,t):r);if(n)return n}return["",""]}(l),p=_[0],f=_[1],g=function(t){for(var e=0;ee.length>e;e++){var i=ee[e],r=i[1],s=i[2],n=t.match(i[0]);if(n){var o=s&&t.match(s)||n;return[r,(null==o?void 0:o[1])||""]}}return["",""]}(l),m=g[0],b=g[1],w=null!=(d="u">typeof navigator?navigator:void 0)&&d.brave?{brave:!0}:{},y={};O(r)||(y.detectGoogleSearchApp=r);var x={},E=null==(o=navigator)||null==(o=o.userAgentData)?void 0:o.platform,S=null==(a=navigator)?void 0:a.maxTouchPoints,T=null==t||null==(h=t.screen)?void 0:h.width,k=null==t||null==(u=t.screen)?void 0:u.height,P=null==t?void 0:t.devicePixelRatio;O(E)||(x.userAgentDataPlatform=E),O(S)||(x.maxTouchPoints=S),O(T)||(x.screenWidth=T),O(k)||(x.screenHeight=k),O(P)||(x.devicePixelRatio=P);var I,C,A,M,D,N,F,U,B=lr(dr({$os:p,$os_version:f,$browser:Yt(l,navigator.vendor,w,y),$webview_app:m,$webview_app_version:b,$device:Zt(l),$device_type:(C=l,A=x,U=Zt(C),U===X||U===K||"Kobo"===U||"Kindle Fire"===U||U===kt?Y:U===ft||U===mt||U===gt||U===Et?"Console":U===Z?"Wearable":U?W:"Android"===(null==A?void 0:A.userAgentDataPlatform)&&(null!==(M=null==A?void 0:A.maxTouchPoints)&&void 0!==M?M:0)>0?600>Math.min(null!==(D=null==A?void 0:A.screenWidth)&&void 0!==D?D:0,null!==(N=null==A?void 0:A.screenHeight)&&void 0!==N?N:0)/(null!==(F=null==A?void 0:A.devicePixelRatio)&&void 0!==F?F:1)?W:Y:"Desktop"),$timezone:bs(),$timezone_offset:ws()}),{$current_url:os(n?ne(null==s?void 0:s.href):null==s?void 0:s.href,c,us),$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:Xt(l,navigator.vendor,w,y),$browser_language:_s(),$browser_language_prefix:(I=_s(),"string"==typeof I?I.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&&(B.$sdk_dist_channel=v.SDK_DIST_CHANNEL),B}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var f=this.sessionManager.checkAndGetSessionAndWindowId(a,n.getTime(),!0),g=f.windowId;u.$session_id=f.sessionId,u.$window_id=g}this.sessionPropsManager&&lr(u,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&lr(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=null==(m=this.xl)?void 0:m.length}catch(t){u.$sdk_debug_error_capturing_properties=String(t)}if(this.requestRouter.region===ao&&(u.$lib_custom_api_host=this.config.api_host),c=e!==rr||a?e!==sr||a?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,o),u=lr(u,c),e===rr&&r&&(u.title=r.title),!O(h)){var b=n.getTime()-h;u.$duration=parseFloat((b/1e3).toFixed(3))}l&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var w=this.persistence.properties(),y=this.sessionPersistence.properties(),x=u.$groups,E=w.$groups;P(x)&&!I(x)&&(u.$groups=p({},P(E)?E:{},x)),hr(["$referrer","$referring_domain"],t=>{t in w&&delete y[t]});var S={};if(this.cl.length>0)for(var T of this.cl.slice())try{lr(S,T())}catch(t){fe.error("Failed to produce browser extension event properties",t)}(u=lr({},_,w,y,p({},S,u))).$is_identified=this._isIdentified(),k(this.config.property_denylist)?hr(this.config.property_denylist,function(t){delete u[t]}):fe.error(Po+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var M=this.config.sanitize_properties;M&&(fe.error(Ro),u=M(u,e));var D=this.Gl();return u.$process_person_profile=D,D&&!a&&this.Wl("_calculate_event_properties"),u}zl(t,e,i){var r;if(void 0===e&&(e=!0),void 0===i&&(i=!1),!this.persistence||!this.Gl())return t;if(this.ul&&!i)return t;var s=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),o=lr({},s,n||{},t||{}),a=this.config.sanitize_properties;return a&&(fe.error(Ro),o=a(o,"$set_once")),e&&(this.ul=!0),I(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,i;null==(e=this.persistence)||e.syncCookieProperties(),this.ql(),null==(i=this.sessionPersistence)||i.register(t),Object.keys(t).forEach(t=>this.dl.add(t)),this.Hl()}unregister(t){var e;null==(e=this.persistence)||e.unregister(t)}unregister_for_session(t){var e;null==(e=this.sessionPersistence)||e.unregister(t),this.dl.delete(t),this.Hl()}Vl(t,e){this.register({[t]:e})}El(){this.dl.forEach(t=>{var e;null==(e=this.sessionPersistence)||e.unregister(t)}),this.dl.clear(),this.Hl()}Hl(){var t;if(this.vl)if("memory"===this.config.persistence||null!=(t=this.sessionPersistence)&&t.Lo||!qr.ro())qr.mr(this.vl);else{var e=[];this.dl.forEach(t=>e.push(t)),e.length>0?qr.gr(this.vl,e):qr.mr(this.vl)}}getFeatureFlag(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(t,e)}getFeatureFlagPayload(t){var e;return null==(e=this.featureFlags)?void 0:e.getFeatureFlagPayload(t)}getFeatureFlagResult(t,e){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(t,e)}getAllFeatureFlags(){var t,e;return null!==(t=null==(e=this.featureFlags)?void 0:e.getAllFeatureFlags())&&void 0!==t?t:[]}isFeatureEnabled(t,e){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(t,e))&&void 0!==i?i:null==e?void 0:e.defaultValue}reloadFeatureFlags(){var t;null==(t=this.featureFlags)||t.reloadFeatureFlags()}updateFlags(t,e,i){var r;null==(r=this.featureFlags)||r.updateFlags(t,e,i)}updateEarlyAccessFeatureEnrollment(t,e,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(t,e,i)}getEarlyAccessFeatures(t,e,i){var r;return void 0===e&&(e=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(t,e,i)}on(t,e){return this.Xh.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:ko}),()=>{})}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:ko})}getActiveMatchingSurveys(t,e){void 0===e&&(e=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,e):t([],{isLoaded:!1,error:ko})}renderSurvey(t,e){var i;null==(i=this.surveys)||i.renderSurvey(t,e)}displaySurvey(t,e){var i;void 0===e&&(e=_o),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:ko}}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:ko})}Jl(t){return!t||A(t)?(fe.critical("Unique user id has not been set in posthog.identify"),!1):t===Fi?(fe.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())||(fe.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 fe.uninitializedWarning("posthog.identify");if(N(t)&&(t=t.toString(),fe.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Jl(t)&&this.Wl("posthog.identify")){this.al();var r=this.get_distinct_id(),s=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==r,n=this.ql(!1),o=this.persistence.$a(),a=!1;try{var h=this.get_distinct_id();this.register({$user_id:t}),this.get_property(Se)||this.register_once({$had_persisted_distinct_id:!0,$device_id:h},""),t!==h&&t!==this.get_property(ke)&&(this.unregister(ke),this.register({distinct_id:t}));var l=(this.persistence.get_property(Ii)||Qi)===Qi,u=t!==h,d=!u&&l;if(u&&l){var v,c=this.config.reuseAnonymousId?{distinct_id:t}:{distinct_id:t,$anon_distinct_id:h};this.persistence.set_property(Ii,Zi),this.setPersonPropertiesForFlags({$set:e||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.xa(),this.capture(nr,c,{$set:e||{},$set_once:i||{}}),this.gl=oo(t,e,i),null==(v=this.featureFlags)||v.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:h)}else if(d){this.persistence.set_property(Ii,Zi);var _=e||{},p=i||{};this.setPersonPropertiesForFlags({$set:_,$set_once:p},!1),this.config.cookieWinsOnConflict&&this.persistence.xa(),this.capture("$set",{$set:_,$set_once:p}),this.gl=oo(t,e,i)}else(e||i)&&this.setPersonProperties(e,i);u||s||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(Ti)):d&&(e||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.Ta(a)}}}setPersonProperties(t,e){if((t||e)&&this.Wl("posthog.setPersonProperties")){var i=oo(this.get_distinct_id(),t,e);this.gl!==i?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:e||{}},!0),this.capture("$set",{$set:t||{},$set_once:e||{}}),this.gl=i):fe.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(t){var e,i=(k(t)?t:[t]).filter(t=>C(t)&&t.length>0);0!==i.length&&this.Wl("posthog.unsetPersonProperties")&&(null==(e=this.featureFlags)||e.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.gl=null)}group(t,e,i){var r;if(t&&e){null==(r=this.persistence)||r.syncCookieProperties(),this.ql();var s=this.getGroups(),n=s[t]!==e;if(n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:p({},s,{[t]:e})}),(n||i)&&this.Gl()){var o={$group_type:t,$group_key:e};i&&(o.$group_set=i),this.capture(or,o)}i&&this.setGroupPropertiesForFlags({[t]:i}),n&&!i&&this.reloadFeatureFlags()}else fe.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.Wl("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(t,e))}resetGroupPropertiesForFlags(t){var e;null==(e=this.featureFlags)||e.resetGroupPropertiesForFlags(t)}reset(t){var e=U(t)?t:null==t?void 0:t.resetDeviceID,i=U(t)||null==t?void 0:t.bootstrap;this.Yl(e,!1,i)}Yl(t,e,i){var r,s,n,o;if(void 0===e&&(e=!1),fe.info("reset"),!this.__loaded)return fe.uninitializedWarning("posthog.reset");var a=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(r=this.bl)?void 0:r.bootstrap)||{},null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this._shouldDisableFlags());var h=this.get_property(Se),l=this.get_property(Te),u=this.get_property(ze);null==(n=this.sessionRecording)||n.flushBeforeIdentityReset();var d=this.is_capturing();this.consent.reset(),e||!d||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var v=null==(o=this.persistence)||null==o.$a?void 0:o.$a(),c=!1;try{var _,f,g,m,b,w,y,x,E,S,T,k,R;if(null==(_=this.persistence)||_.clear(),null==(f=this.sessionPersistence)||f.clear(),this.dl.clear(),this.Hl(),O(u)||null==(S=this.persistence)||S.register({[ze]:u}),null==(g=this.surveys)||g.reset(),null==(m=this.featureFlags)||m.reset(),null==(b=this.conversations)||b.reset(),null==(w=this.logs)||w.reset(),null==(y=this.metrics)||y.reset(),null==(x=this.persistence)||x.set_property(Ii,Qi),null==(E=this.sessionManager)||E.resetSessionId(),this.gl=null,this.config.cookieless_mode===Xi)this.register_once({distinct_id:Fi,$device_id:null},"");else{var P=this.config.get_device_id($r());this.register_once({distinct_id:P,$device_id:t?P:h},""),t||O(l)||this.register({[Te]:l})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i)if(void 0===i.distinctID||this.rl()||(null==(R=this.persistence)||R.set_property(Ii,i.isIdentifiedID?Zi:Qi),this.register({distinct_id:i.distinctID})),null==(T=this.featureFlags)||T.initialize(),!(O(a)||null!=(k=this.sessionManager)&&k.setBootstrapSessionId(a,!0))){var I=p({},i);delete I.sessionID,this.config.bootstrap=I}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,c=!0}finally{var C;v&&(null==(C=this.persistence)||null==C.Ta||C.Ta(c))}this.reloadFeatureFlags()}shutdown(t){var e=this;return _(function*(){var t,i,r,s,n,o,a;if(e.__loaded){e.Il().dispose(),null==(t=e.sessionRecording)||t.dispose(),null==(i=e.logs)||i.flushLogs("sendBeacon"),null==(r=e.metrics)||r.flush("sendBeacon"),null==(s=e.yl)||s.unload(),null==(n=e.xl)||n.unload();try{var h;null==(h=e.featureFlags)||h.destroy()}catch(t){fe.error("Error while destroying feature flags",t)}null==(o=e.persistence)||o.destroy(),null==(a=e.sessionPersistence)||a.destroy()}else fe.uninitializedWarning("posthog.shutdown")})()}setIdentity(t,e){var i;delete this.config.identity_claims,this.config.identity_distinct_id=t,this.config.identity_hash=e,this.alias(t),null==(i=this.conversations)||i._onIdentityChanged()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(t=this.conversations)||t._onIdentityCleared()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,e;return null!==(t=null==(e=this.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==t?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var e=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=e.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+e.sessionId);if(null!=t&&t.withTimestamp&&i){var s,n=null!==(s=t.timestampLookBack)&&void 0!==s?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(t,e){return t===this.get_property(xe)?(fe.critical("Attempting to create alias for existing People user - aborting."),-2):this.Wl("posthog.alias")?(O(e)&&(e=this.get_distinct_id()),t!==e?(this.Vl(ke,t),this.capture("$create_alias",{alias:t,distinct_id:e})):(fe.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var e=p({},this.config);if(P(t)){var i,r,s,n,o,a,h,l,u,d,c,_;lr(this.config,Uo(t));var f=this.hl();null==(i=this.persistence)||i.update_config(this.config,e,f),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Os(p({},this.config,{persistence:"sessionStorage"}),f,!1);var g,m=this.ml(this.config.debug);U(m)&&(this.config.debug=m),U(this.config.debug)&&(this.config.debug?(v.DEBUG=!0,Pr.ro()&&Pr.gr("ph_debug",!0),fe.info("set_config",{config:t,oldConfig:e,newConfig:p({},this.config)})):(v.DEBUG=!1,Pr.ro()&&Pr.mr("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this._shouldDisableFlags()),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(n=this.exceptions)||n.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(h=this.autocapture)||h.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),("capture_pageview"in t||"disable_capture_url_hashes"in t)&&(null==(g=this.historyAutocapture)||g.startIfEnabledOrStop()),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.ll(),null==(_=this.externalIntegrations)||_.startIfEnabledOrStop(),!e.segment&&this.config.segment&&this.persistence&&Jr(this,So,!1)}}_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){try{if(!this.exceptions)return;var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(t,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(p({},r,e))}catch(t){return}}addExceptionStep(t,e){var i;null==(i=this.exceptions)||i.addExceptionStep(t,e)}captureLog(t){var e;null==(e=this.logs)||e.captureLog(t)}get logger(){var t,e;return null!==(t=null==(e=this.logs)?void 0:e.logger)&&void 0!==t?t:Lo.Kl}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:Ao;return e!==Ao&&(e=Ao+"."+e),e}_isIdentified(){var t,e;return(null==(t=this.persistence)?void 0:t.get_property(Ii))===Zi||(null==(e=this.sessionPersistence)?void 0:e.get_property(Ii))===Zi}Gl(){var t,e;return!("never"===this.config.person_profiles||this.config.person_profiles===tr&&!this._isIdentified()&&I(this.getGroups())&&(null==(t=this.persistence)||null==(t=t.props)||!t[ke])&&(null==(e=this.persistence)||null==(e=e.props)||!e[Ni]))}Ul(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Gl()||this.Wl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Wl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Wl(t){return"never"===this.config.person_profiles?(fe.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.sl(),this.Vl(Ni,!0),!0)}hl(){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!==Ki)}ll(){var t,e,i,r,s,n=this.hl();return this.is_capturing()||null==(i=this.logs)||i._onOptOut(),(null==(t=this.persistence)?void 0:t.Lo)!==n&&(null==(r=this.persistence)||r.set_disabled(n)),(null==(e=this.sessionPersistence)?void 0:e.Lo)!==n&&(null==(s=this.sessionPersistence)||s.set_disabled(n)),n&&(this.dl.clear(),this.Hl()),n}opt_in_capturing(t){var e;if(this.config.cookieless_mode!==Xi){if(this.rl()){var i,r,s,n,o,a;null==(i=this.sessionRecording)||i.dispose({discardBufferedEvents:!0}),this.Yl(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(s=this.pageViewManager)||s.destroy(),this.sessionManager=new ro(this),this.pageViewManager=new Qr(this),this.persistence&&(this.sessionPropsManager=new Zn(this,this.sessionManager,this.persistence));var h,l=null!==(n=null==(o=this.config.__extensionClasses)?void 0:o.sessionRecording)&&void 0!==n?n:null==(a=Lo.__defaultExtensionClasses)?void 0:a.sessionRecording;l&&(this.sessionRecording=this.il(this.sessionRecording,new l(this)),this.Kh&&(null==(h=this.sessionRecording)||null==h.onRemoteConfig||h.onRemoteConfig(this.Kh)))}var u,d;this.consent.optInOut(!0),this.ll(),this.Dl(),null==(e=this.sessionRecording)||e.startIfEnabledOrStop(),this.config.cookieless_mode==Ki&&(null==(u=this.surveys)||u.loadIfEnabled()),(O(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!==(d=null==t?void 0:t.captureEventName)&&void 0!==d?d:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Nl()}else fe.warn(To)}opt_out_capturing(){if(this.config.cookieless_mode!==Xi){var t,e,i=this.config.cookieless_mode===Ki?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode===Ki&&this.consent.isOptedIn()&&this.Yl(!0,!0),this.consent.optInOut(!1),this.ll(),this.config.cookieless_mode===Ki&&(this.register({distinct_id:Fi,$device_id:null}),this.el(i),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(e=this.pageViewManager)||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Nl(),this.Dl())}else fe.warn(To)}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===Xi||(this.config.cookieless_mode===Ki?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.ll()}_is_bot(){return i?function(t,e){if(!t)return!1;var i=t.userAgent;if(i&&g(i,e))return!0;try{var r=null==t?void 0:t.userAgentData;if(null!=r&&r.brands&&r.brands.some(t=>g(null==t?void 0:t.brand,e)))return!0}catch(t){}return!!t.webdriver}(i,this.config.custom_blocked_useragents):void 0}Nl(){r&&("visible"===r.visibilityState?this._l||(this._l=!0,this.capture(rr,{title:r.title},{send_instantly:!0}),this.pl&&(r.removeEventListener(er,this.pl),this.pl=null)):this.pl||(this.pl=this.Nl.bind(this),pr(r,er,this.pl)))}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}))}_shouldDisableFlags(){var t=this.bl||{};return"advanced_disable_flags"in t?!!t.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(fe.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):function(t,e,i,r,s){var n=e in t&&!D(t[e]),o=i in t&&!D(t[i]);return n?t[e]:!!o&&(s&&s.warn("Config field '"+i+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),t[i])}(t,"advanced_disable_flags","advanced_disable_decide",0,fe)}G(t){var e;if(D(this.config.before_send))return t;var i=Object.keys(null!==(e=t.properties)&&void 0!==e?e:{}).filter(L),r=k(this.config.before_send)?this.config.before_send:[this.config.before_send],s=t;for(var n of r)try{if(s=n(s),D(s)){var o="Event '"+t.event+"' was rejected in beforeSend function";return B(t.event)?fe.warn(o+". This can cause unexpected behavior."):fe.info(o),null}s.properties&&!I(s.properties)||fe.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}catch(e){return fe.error("Error in beforeSend function for event '"+t.event+"':",e),null}for(var a of i)if(s.properties&&D(s.properties[a]))return fe.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.co)?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)})}ml(t){var e=U(t)&&!t,i=Pr.ro()&&"true"===Pr.no("ph_debug");return!e&&(!!i||t)}}Lo.__defaultExtensionClasses={},Lo.Kl={trace:$o=()=>{},debug:$o,info:$o,warn:$o,error:$o,fatal:$o},function(t,e){for(var i=0;e.length>i;i++)t.prototype[e[i]]=ur(t.prototype[e[i]])}(Lo,["identify"]);var jo=function(){v.SDK_DIST_CHANNEL="npm";var e=xo[Ao]=new Lo;return function(){function e(){e.done||(e.done=!0,Mo=!1,hr(xo,function(t){t._dom_loaded()}))}null!=r&&r.addEventListener?"complete"===r.readyState?e():pr(r,"DOMContentLoaded",e,{capture:!1}):t&&fe.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}();export{Cs as Compression,Gs as DEFAULT_PRODUCT_TOUR_APPEARANCE,qs as DisplaySurveyType,Lo as PostHog,Ws as ProductTourEventName,Vs as ProductTourEventProperties,js as SurveyEventName,zs as SurveyEventProperties,As as SurveyEventType,Ds as SurveyPosition,Bs as SurveyQuestionBranchingType,Us as SurveyQuestionType,Ls as SurveySchedule,Ns as SurveyTabPosition,Fs as SurveyType,Ms as SurveyWidgetType,jo as default,jo as posthog,Qs as severityLevels};
|
|
2
2
|
//# sourceMappingURL=module.slim.js.map
|