PageSourceSearch

https://getmotivated.ai/_next/static/chunks/281.d8d53538d664a356.js

js getmotivated.ai collected 2026-10-05 12:05:45 UTC 139,725 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="24fcc719-0d75-40b4-98fe-b28a68c7810c",e._sentryDebugIdIdentifier="sentry-dbid-24fcc719-0d75-40b4-98fe-b28a68c7810c")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[281],{281:(e,t,i)=>{i.d(t,{default:()=>rz});var s,r="u">typeof window?window:void 0,n="u">typeof globalThis?globalThis:r,o=null==n?void 0:n.navigator,a=null==n?void 0:n.document,l=null==n?void 0:n.location,h=null==n?void 0:n.fetch,u=null!=n&&n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest?n.XMLHttpRequest:void 0,c=null==n?void 0:n.AbortController,d=null==n?void 0:n.CompressionStream,p=null==o?void 0:o.userAgent,g="u">typeof globalThis?globalThis:r;g&&"u"<typeof self&&(g.self=g),g&&"u"<typeof File&&(g.File=function(){});var _=null!=r?r:{},v={DEBUG:!1,LIB_VERSION:"0.8.2",LIB_NAME:"browser-common"};function f(e,t,i,s,r,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(s,r)}function m(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function o(e){f(n,s,r,o,a,"next",e)}function a(e){f(n,s,r,o,a,"throw",e)}o(void 0)})}}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var i=arguments[t];for(var s in i)({}).hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e}).apply(null,arguments)}var b=["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"],w=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return b.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function x(e,t){return -1!==e.indexOf(t)}var k=function(e){return e.replace(/^\$/,"")},E=((e6={}).GZipJS="gzip-js",e6.Base64="base64",e6),$=["$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"],S=["token"],P=Object.prototype,I=P.hasOwnProperty,C=P.toString,F=Array.isArray||function(e){return"[object Array]"===C.call(e)},O=e=>"function"==typeof e,T=e=>e===Object(e)&&!F(e),R=e=>{if(T(e)){for(var t in e)if(I.call(e,t))return!1;return!0}return!1},A=e=>void 0===e,M=e=>"[object String]"==C.call(e),L=e=>M(e)&&0===e.trim().length,D=e=>A(e)||null===e,B=e=>"[object Number]"==C.call(e)&&e==e,N=e=>B(e)&&e>0,q=e=>"[object Boolean]"===C.call(e),j=e=>x($,e),G=e=>x(S,e);function V(e){switch(({}).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:var t=Error;try{return e instanceof t}catch(e){return!1}}}var H=[!0,"true",1,"1","yes"],z=[!1,"false",0,"0","no"];function U(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),B(e)?e>i?(s.warn(" cannot be  greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),U(null!=r?r:i,t,i,s))}var W="Mobile",Y="Android",J="Tablet",K=Y+" "+J,X="iPad",Z="Apple",Q=Z+" Watch",ee="Safari",et="BlackBerry",ei="Samsung",es=ei+"Browser",er=ei+" Internet",en="Chrome",eo=en+" OS",ea=en+" iOS",el="Internet Explorer",eh=el+" "+W,eu="Opera",ec=eu+" Mini",ed="Edge",ep="Microsoft "+ed,eg="Firefox",e_=eg+" iOS",ev="Nintendo",ef="PlayStation",em="Xbox",ey=Y+" "+W,eb=W+" "+ee,ew="Windows",ex=ew+" Phone",ek="Nokia",eE="Ouya",e$="Generic",eS=e$+" "+W.toLowerCase(),eP=e$+" "+J.toLowerCase(),eI="Konqueror",eC="Oculus Browser",eF="Vivaldi",eO="Yandex",eT="Whale",eR="DuckDuckGo",eA="Pale Moon",eM="Waterfox",eL="Brave",eD="Claude",eB="Codex",eN="ChatGPT",eq="Google Search App",ej="(\\d+(\\.\\d+)?)",eG=RegExp("Version/"+ej),eV=RegExp("("+eD+"|"+eB+"|"+eN+")\\/"+ej),eH=RegExp(em,"i"),ez=RegExp(ef+" \\w+","i"),eU=RegExp(ev+" \\w+","i"),eW=RegExp(et+"|PlayBook|BB10","i"),eY={"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"},eJ=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?eL:null)||(null!=s&&s.detectGoogleSearchApp&&x(e,"GSA/")?eq:x(e," OPR/")&&x(e,"Mini")?ec:x(e," OPR/")?eu:eW.test(e)?et:x(e,"IE"+W)||x(e,"WPDesktop")?eh:x(e,"OculusBrowser")?eC:x(e,es)?er:x(e,ed)||x(e,"Edg/")?ep:x(e,eF+"/")?eF:x(e,"YaBrowser/")?eO:x(e,eT+"/")?eT:x(e,eR+"/")||x(e,"Ddg/")?eR:x(e,eD+"/")?eD:x(e,eB+"/")?eB:x(e,eN+"/")?eN:x(e,"FBIOS")?"Facebook "+W:x(e,"UCWEB")||x(e,"UCBrowser")?"UC Browser":x(e,"CriOS")?ea:x(e,"CrMo")||x(e,en)?en:x(e,Y)&&x(e,ee)?ey:x(e,"FxiOS")?e_:x(e.toLowerCase(),eI.toLowerCase())?eI:x(e,eL+"/")?eL:(r=t)&&x(r,Z)||x(e,ee)&&!x(e,en)&&!x(e,Y)?x(e,W)?eb:ee:x(e,"PaleMoon/")?eA:x(e,eM+"/")?eM:x(e,eg)?eg:x(e,"MSIE")||x(e,"Trident/")?el:x(e,"Gecko")?eg:"")},eK={[eh]:[RegExp("rv:"+ej)],[ep]:[RegExp(ed+"?\\/"+ej)],[en]:[RegExp("("+en+"|CrMo)\\/"+ej)],[ea]:[RegExp("CriOS\\/"+ej)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+ej)],[ee]:[eG],[eb]:[eG],[eu]:[RegExp("(Opera|OPR)\\/"+ej)],[eg]:[RegExp(eg+"\\/"+ej)],[e_]:[RegExp("FxiOS\\/"+ej)],[eI]:[RegExp("Konqueror[:/]?"+ej,"i")],[et]:[RegExp(et+" "+ej),eG],[ey]:[RegExp("android\\s"+ej,"i")],[er]:[RegExp(es+"\\/"+ej)],[eC]:[RegExp("OculusBrowser\\/"+ej)],[eF]:[RegExp(eF+"\\/"+ej)],[eO]:[RegExp("YaBrowser\\/"+ej)],[eT]:[RegExp(eT+"\\/"+ej)],[eL]:[RegExp(eL+"\\/"+ej)],[eD]:[eV],[eB]:[eV],[eN]:[eV],[eR]:[RegExp("(DuckDuckGo|Ddg)\\/"+ej)],[eA]:[RegExp("PaleMoon\\/"+ej)],[eM]:[RegExp(eM+"\\/"+ej)],[eq]:[RegExp("GSA\\/"+ej)],[el]:[RegExp("(rv:|MSIE )"+ej)],Mozilla:[RegExp("rv:"+ej)]},eX=function(e,t,i,s){var r=eK[eJ(e,t,i,s)];if(A(r))return null;for(var n=0;r.length>n;n++){var o=e.match(r[n]);if(o)return parseFloat(o[o.length-2])}return null},eZ=[[RegExp(em+"; "+em+" (.*?)[);]","i"),e=>[em,e&&e[1]||""]],[RegExp(ev,"i"),[ev,""]],[RegExp(ef,"i"),[ef,""]],[eW,[et,""]],[RegExp(ew,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[ex,""];if(new RegExp(W).test(t)&&!/IEMobile\b/.test(t))return[ew+" "+W,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=eY[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[ew,s]}return[ew,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=A(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+Y+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Y+")","i"),e=>e&&e[2]?[Y,[e[2],e[3],e[4]||"0"].join(".")]:[Y,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[eo,""]],[/Linux|debian/i,["Linux",""]]],eQ=function(e){return eU.test(e)?ev:ez.test(e)?ef:eH.test(e)?em:RegExp(eE,"i").test(e)?eE:RegExp("("+ex+"|WPDesktop)","i").test(e)?ex:/iPad/.test(e)?X:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?Q:eW.test(e)?et:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(ek,"i").test(e)?ek:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(W).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?Y:K:RegExp("(pda|"+W+")","i").test(e)?eS:RegExp(J,"i").test(e)&&!RegExp(J+" pc","i").test(e)?eP:""},e0=/\bFBAV\/(\d+(?:\.\d+)*)/i,e1=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",e0],[/\bFBAN\/EMA\b/i,"Facebook Lite",e0],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",e0],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?
1:\/(\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"]],e2=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function e3(e,t){return"string"==typeof e&&e2.test(e)?e:t()}function e5(e,t){var i=Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function e8(e){return e?e.split("#")[0]:e}var e6,e4,e7,e9=["$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"],te="NativeGzipValidationError",tt=e=>e.length>=2&&31===e[0]&&139===e[1],ti=(e,t)=>e===E.GZipJS||t===E.GZipJS||"gzip"===t,ts=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),tr=e=>{throw e5(te,"Native gzip produced invalid output: "+e)},tn=(e4=m(function*(e,t){18>e.size&&tr("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));tt(i)&&8===i[2]||tr("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(e7)return e7;e7=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;e7[e]=t>>>0}return e7})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&tr("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&tr("invalid-size")}),function(e,t){return e4.apply(this,arguments)});function to(){return(to=m(function*(e,t,i){void 0===t&&(t=!0);try{var s,r=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(r).then(()=>o.close()).catch((s=m(function*(e){try{yield o.abort(e)}catch(e){}throw e}),function(e){return s.apply(this,arguments)})),l=new Response(n.readable).blob(),h=(yield Promise.all([l,a]))[0];return yield tn(h,r),h}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var ta=function(e,t){var i=(void 0===t?{}:t).debugEnabled,s={Et(t){if(r&&(v.DEBUG||r.POSTHOG_DEBUG||i)&&!A(r.console)&&r.console){for(var s=("__rrweb_original__"in r.console[t])?r.console[t].__rrweb_original__:r.console[t],n=arguments.length,o=Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];s(e,...o)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.Et("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.Et("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.Et("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.Et("error",...t)},critical(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning(e){s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>ta(e+" "+t,i)};return s},tl=ta("[PostHog.js]"),th=tl.createLogger,tu=th("[ExternalScriptsLoader]"),tc=e=>{var t=null==a?void 0:a.querySelectorAll("script");
1if(t){for(var i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]}},td=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return tu.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=tc(t);if(s){if(s.__posthog_loading_callback_fired)return i();var r=s.__posthog_loading_error;return r?i(r):(s.addEventListener("load",e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)}),void s.addEventListener("error",e=>{s.__posthog_loading_error=e,i(e)}))}var n=()=>{if(!a)return i("document not found");if(tc(t))return td(e,t,i);var s=a.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>{s.__posthog_loading_error=e,i(e)},e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)a.head.appendChild(s);else{var r,n=a.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):a.body.appendChild(s)}};null!=a&&a.body?n():null==a||a.addEventListener("DOMContentLoaded",n)},tp={},tg=(e,t)=>{var i="/static/"+t+".js?v="+e.version;return"toolbar"===t&&(i=i+"&t="+3e5*Math.floor(Date.now()/3e5)),e.requestRouter.endpointFor("assets",i)};_.__PosthogExtensions__=_.__PosthogExtensions__||{},_.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s=e.config.strict_script_versioning;if(s){var r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js"),n=tp[r];if("fallback"===s&&n){if(tc(n))return void td(e,n,i);delete tp[r]}td(e,r,"fallback"===s?(s,n)=>{if(s)if("string"==typeof s)i(s);else{var o,a=tg(e,t);tp[r]=a;var l=tc(r);null==l||null==(o=l.parentNode)||o.removeChild(l),td(e,a,i)}else i(void 0,n)}:i)}else td(e,tg(e,t),i)}else{var o=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");td(e,o,i)}},_.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);td(e,s,i)},v.DEBUG=!1,v.LIB_VERSION="1.428.7",v.LIB_NAME="web";var t_="$people_distinct_id",tv="distinct_id",tf="$device_id",tm="$device_model",ty="__alias",tb="$fbc",tw="$fbc_persistence",tx="__timers",tk="$dead_clicks_enabled_server_side",tE="$session_recording_remote_config",t$="$sesid",tS="$session_is_sampled",tP="$enabled_feature_flags",tI="$active_feature_flags",tC="$feature_flag_details",tF="$feature_flag_payloads",tO="$feature_flag_request_id",tT="$minimal_flag_called_events",tR="$stored_person_properties",tA="$stored_group_properties",tM="$groups",tL="$surveys_loaded_at",tD="$flag_call_reported",tB="$feature_flag_errors",tN="$feature_flag_evaluated_at",tq="$user_state",tj="$client_session_props",tG="$capture_rate_limit",tV="$initial_campaign_params",tH="$initial_referrer_info",tz="$initial_person_info",tU="$epp",tW="$posthog_cookieless",tY="$cookieless_mode",tJ="$sdk_debug_extensions_init_method",tK="$sdk_debug_extensions_init_time_ms",tX="on_reject",tZ="always",tQ="anonymous",t0="identified",t1="identified_only",t2="visibilitychange",t3="beforeunload",t5="$pageview",t8="$pageleave",t6="$identify",t4="$groupidentify";function t7(e,t){F(e)&&e.forEach(t)}function t9(e,t){if(!D(e))if(F(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)I.call(e,i)&&t(e[i],i)}var ie=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];for(var r of i)for(var n in r)void 0!==r[n]&&(e[n]=r[n]);return e},it=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){tl.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),tl.critical(e)}}},ii=function(e){var t={};return t9(e,function(e,i){(M(e)&&e.length>0||B(e))&&(t[i]=e)}),t};function is(e){var t=y({},e);for(var i of["name","message","stack","cause","errors"])try{i in e&&(t[i]=e[i])}catch(e){}return t}var ir=["herokuapp.com","vercel.app","netlify.app"];function io(e,t,i,s){var r=null!=s?s:{},n=r.capture,o=r.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===o||o})}var ia=e=>{if(a){try{for(var t=e+"=",i=a.cookie.split(";").filter(e=>e.length),s=0;i.length>s;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return B(e)&&isFinite(e)&&Math.floor(e)===e});class il{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||0>e||0>t||0>i||0>s||e>0xffffffffffff||t>4095||i>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");
1var r=new Uint8Array(16);return r[0]=e/0x10000000000,r[1]=e/0x100000000,r[2]=e/0x1000000,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new il(r)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new il(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class ih{generate(){var e=this.generateOrAbort();if(!A(e))return e;this.v=0;var t=this.generateOrAbort();if(A(t))throw Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e,t=B(e=Date.now())&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0;if(t>this.v)this.v=t,this.lt();else{if(this.v>=t+1e4)return;this.gt++,this.gt>0x3ffffffffff&&(this.v++,this.lt())}return il.fromFieldsV7(this.v,Math.trunc(this.gt/0x40000000),0x3fffffff&this.gt,this.eo.nextUint32())}lt(){this.gt=1024*this.eo.nextUint32()+(1023&this.eo.nextUint32())}constructor(){this.v=0,this.gt=0,this.eo=new id}}var iu,ic=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};r&&!A(r.crypto)&&crypto.getRandomValues&&(ic=e=>crypto.getRandomValues(e));class id{nextUint32(){return this.cs.length>this.io||(ic(this.cs),this.io=0),this.cs[this.io++]}constructor(){this.cs=new Uint32Array(8),this.io=1/0}}var ip=()=>ig().toString(),ig=()=>(iu||(iu=new ih)).generate(),i_="",iv=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,im=null,iy={ro(){if(null!==im)return im;if(im=!1,a)try{var e="__ph_cookie_support_"+ip();iy.gr(e,"xyz"),im='"xyz"'===ia(e),iy.mr(e)}catch(e){im=!1}return im},so(e){tl.error("cookieStore error: "+e)},no:ia,oo(e){var t;try{t=JSON.parse(iy.no(e))||{}}catch(e){}return t},gr(e,t,i,s,r){if(!a)return!1;try{var n="",o="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=a),i_)return i_;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+ip();!i_&&s--;){var n=i.slice(s).join("."),o=r+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(r)&&(t.cookie=o+";max-age=0",i_=n)}return i_}(e);if(!i){var s,r=(s=e.match(iv))?s[0]:"";r!==i&&tl.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(a.location.hostname,s);if(i){var h=new Date;h.setTime(h.getTime()+864e5*i),n="; expires="+h.toUTCString()}r&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+o;return u.length>3686.4&&tl.warn("cookieStore warning: large cookie, len="+u.length),a.cookie=u,!0}catch(e){return!1}},mr(e,t){if(null!=a&&a.cookie)try{iy.gr(e,"",-1,t)}catch(e){return}}},ib=null,iw={ro(){if(null!==ib)return ib;var e=!0;if(A(r))e=!1;else try{var t="__mplssupport__";iw.gr(t,"xyz"),'"xyz"'!==iw.no(t)&&(e=!1),iw.mr(t)}catch(t){e=!1}return e||tl.error("localStorage unsupported; falling back to cookie store"),ib=e,e},so(e){tl.error("localStorage error: "+e)},no(e){try{return null==r?void 0:r.localStorage.getItem(e)}catch(e){iw.so(e)}return null},oo(e){try{return JSON.parse(iw.no(e))||{}}catch(e){}return null},gr(e,t){try{return null==r||r.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){iw.so(e)}return!1},mr(e){try{null==r||r.localStorage.removeItem(e)}catch(e){iw.so(e)}}},ix=[tR,tI,tP,tC,tF,tO,tN,tB,tD],ik=[tf,tv,t$,tS,tU,tz,tw,tq],iE=["__proto__","constructor","prototype"],i$=e=>{if(!T(e))return{};var t={};return Object.keys(e).forEach(i=>{-1===iE.indexOf(i)&&(t[i]=e[i])}),t},iS=function(e,t){void 0===t&&(t=[]);var i={};return[...ik,...t].forEach(t=>{var s=e[t];A(s)||null===s||""===s||(i[t]=s)}),i},iP=e=>{for(var t=5381,i=0x811c9dc5,s=0;e.length>s;s++){var r=e.charCodeAt(s);t=33*t^r,i=Math.imul(i^r,0x1000193)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},iI=(e,t)=>({p:t,f:iP(JSON.stringify(e))}),iC=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var i=iy.oo(e+"_cpm"),s=(null==i?void 0:i.f)===iP(t)&&F(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},iF=(e,t)=>t+"|"+(iy.no(e+"_cpm")||""),iO={},iT={ro:()=>!0,so(e){tl.error("memoryStorage error: "+e)},no:e=>e in iO?iO[e]:null,oo:e=>e in iO?iO[e]:null,gr:(e,t)=>(iO[e]=t,!0),mr(e){delete iO[e]}},iR=null,iA={ro(){if(null!==iR)return iR;if(iR=!0,A(r))iR=!1;else try{var e="__support__";iA.gr(e,"xyz"),'"xyz"'!==iA.no(e)&&(iR=!1),iA.mr(e)}catch(e){iR=!1}return iR},so(e){tl.error("sessionStorage error: ",e)},no(e){try{return null==r?void 0:r.sessionStorage.getItem(e)}catch(e){iA.so(e)}return null},oo(e){try{return JSON.parse(iA.no(e))||null}catch(e){}return null},gr(e,t){try{return null==r||r.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){iA.so(e)}return!1},mr(e){try{null==r||r.sessionStorage.removeItem(e)}catch(e){iA.so(e)}}};class iM{constructor(e){this._instance=e}get P(){return this._instance.config}get consent(){return this.ao()?0:this.ho}isOptedOut(){return this.P.cookieless_mode===tZ||this.isRejected()||-1===this.consent&&this.P.cookieless_mode===tX}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(e){this.lo.gr(this.uo,+!!e,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 e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;
1return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get ho(){var e=this.lo.no(this.uo);return x(H,e)?1:x(z,e)?0:-1}get lo(){var e=this.P.opt_out_capturing_persistence_type,t="localStorage"===e?iw:iy,i=t.ro()?t:iT;if(!this.do||this.do!==i){this.do=i;var s="localStorage"===e?iy:iw;s.no(this.uo)&&(this.do.no(this.uo)||this.optInOut(x(H,s.no(this.uo))),s.mr(this.uo,this.P.cross_subdomain_cookie))}return this.do}ao(){return!!this.P.respect_dnt&&[null==o?void 0:o.doNotTrack,null==o?void 0:o.msDoNotTrack,_.doNotTrack,null==o?void 0:o.globalPrivacyControl].some(e=>x(H,e))}}var iL=["next","previous","prev",">","<","+","-","−","–"];th("[Dead Clicks]");var iD=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(tk)),s=e.instance.config.capture_dead_clicks;return q(s)?s:!!T(s)||i},iB=th("[SegmentIntegration]");function iN(e,t,i){void 0===i&&(i=!0);var s=e.config.segment;if(!s)return t();!function(e,t,i){var s=e.config.segment;if(!s)return t();var r=s=>{var r=()=>s.anonymousId()||ip();e.config.get_device_id=r,i&&s.id()&&(e.register({distinct_id:s.id(),$device_id:r()}),e.persistence.set_property(tq,t0)),t(i?void 0:s.anonymousId()||void 0)},n=s.user();"then"in n&&O(n.then)?n.then(r):r(n)}(e,i=>{var r,n;s.register((r=i,"u">typeof Promise&&Promise.resolve||iB.warn("This browser does not have Promise support, and can not use the segment integration"),n=(t,i)=>{if(!i)return t;var s=!!r&&t.event.anonymousId===r&&!t.event.userId;s||t.event.userId||t.event.anonymousId===e.get_distinct_id()||(iB.info("No userId set, resetting PostHog"),e.reset()),s||(r=void 0),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(iB.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var n=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},n,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>n(e,e.event.event),page:e=>n(e,t5),identify:e=>n(e,t6),screen:e=>n(e,"$screen")})).then(()=>{t()},e=>{iB.error("Failed to register the Segment integration",e),t()})},i)}var iq="posthog-js";function ij(e,t){var i=void 0===t?{}:t,s=i.organization,r=i.projectId,n=i.prefix,o=i.severityAllowList,a=void 0===o?["error"]:o,l=i.sendExceptionsToPostHog,h=void 0===l||l;return t=>{if("*"!==a&&!a.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var i=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=i,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var o,l,u,c,d,p,g=(null==(o=t.exception)?void 0:o.values)||[],_=g.map(e=>y({},e,{stacktrace:e.stacktrace?y({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>y({},e,{platform:"web:javascript"}))}):void 0})),v={$exception_message:(null==(l=g[0])?void 0:l.value)||t.message,$exception_type:null==(u=g[0])?void 0:u.type,$exception_level:t.level,$exception_list:_,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=g[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=g[0])?void 0:d.type,$sentry_tags:t.tags};return s&&r&&(v.$sentry_url=(n||"https://sentry.io/organizations/")+s+"/issues/?project="+r+"&query="+t.event_id),h&&(null==(p=e.exceptions)||p.sendExceptionEvent(v)),t}}class iG{constructor(e,t,i,s,r,n){this.name=iq,this.setupOnce=function(o){o(ij(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class iV{constructor(e){this.vo=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(tl.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.co=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this._o()}_o(){var e;this.po=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.vo)}destroy(){var e;null==(e=this.po)||e.call(this),this.po=void 0}doPageView(e,t){var i,s=this.fo(e,t);return this.co={pathname:null!=(i=null==r?void 0:r.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.fo(e,null==(t=this.co)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.co)?void 0:e.pageViewId}}fo(e,t){var i=this.co;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var n=r.maxScrollHeight,o=r.lastScrollY,a=r.maxScrollY,l=r.maxContentHeight,h=r.lastContentY,u=r.maxContentY;if(!(A(n)||A(o)||A(a)||A(l)||A(h)||A(u))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),h=Math.ceil(h),u=Math.ceil(u);var c=n>1?U(o/n,0,1,tl):1,d=n>1?U(a/n,0,1,tl):1,p=l>1?U(h/l,0,1,tl):1,g=l>1?U(u/l,0,1,tl):1;s=ie(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:h,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:g})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var iH=["flags","surveys"],iz={[t_]:{exposure:"hidden"},[ty]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[tx]:{exposure:"hidden"},[tw]:{exposure:"hidden"},$autocapture_disabled_server_side:{exposure:"event"},$heatmaps_enabled_server_side:{exposure:"hidden"},$logs_capture_enabled_server_side:{exposure:"hidden"},$exception_capture_enabled_server_side:{exposure:"event"}
1,$error_tracking_suppression_rules:{exposure:"hidden"},$error_tracking_capture_extension_exceptions:{exposure:"event"},$web_vitals_enabled_server_side:{exposure:"event"},[tk]:{exposure:"event"},$product_tours_enabled_server_side:{exposure:"hidden"},$web_vitals_allowed_metrics:{exposure:"event"},[tE]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[t$]:{exposure:"hidden"},[tS]:{exposure:"event"},$replay_sample_rate:{exposure:"event",shouldSkipFromEventProperties:e=>null===e},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[tP]:{exposure:"hidden",storageGroup:"flags"},[tI]:{exposure:"hidden",storageGroup:"flags"},$early_access_features:{exposure:"hidden"},[tC]:{exposure:"hidden",storageGroup:"flags"},[tF]:{exposure:"hidden",storageGroup:"flags"},[tO]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[tT]:{exposure:"hidden",storageGroup:"flags"},$override_feature_flags:{exposure:"hidden"},$override_feature_flag_payloads:{exposure:"hidden"},[tR]:{exposure:"hidden"},[tA]:{exposure:"hidden"},$surveys:{exposure:"hidden",storageGroup:"surveys"},[tL]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},$surveys_activated:{exposure:"event"},$surveys_activated_session:{exposure:"hidden"},$surveys_activated_timestamps:{exposure:"hidden"},ph_product_tours:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[tD]:{exposure:"hidden"},$flag_call_reported_session_id:{exposure:"hidden"},[tM]:{exposure:"event"},[tB]:{exposure:"hidden"},[tN]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[tq]:{exposure:"hidden"},[tj]:{exposure:"hidden"},[tG]:{exposure:"hidden"},[tV]:{exposure:"hidden"},[tH]:{exposure:"hidden"},[tz]:{exposure:"hidden"},[tU]:{exposure:"hidden"},$replay_override_sampling:{exposure:"event"},$replay_override_linked_flag:{exposure:"event"},$replay_override_url_trigger:{exposure:"event"},$replay_override_event_trigger:{exposure:"event"},[tJ]:{exposure:"event"},[tK]:{exposure:"event"},$sdk_debug_recording_script_not_loaded:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"}
1,$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},iU=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],iW=e=>{var t=iz[e];if(t)return t;for(var i of iU){var s=i[1];if(0===e.indexOf(i[0]))return s}},iY=(e,t)=>{var i,s,r;try{return JSON.stringify(e,(e,t)=>V(t)?(null!=r||(r=new WeakMap),r.has(t)||r.set(t,is(t)),r.get(t)):"bigint"==typeof t?t.toString():t,t)}catch(t){return s=[],null!=(i=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(t))return"[Circular]";s.push(t)}return t}}))?i:"null"}},iJ=e=>{var t=null==a?void 0:a.createElement("a");return A(t)?null:(t.href=e,t)},iK=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;s.length>r;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!F(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){tl.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},iX=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),o=n[1],a=n[0],l=(o||"").split("&"),h=[],u=0;l.length>u;u++){var c=l[u].split("=");F(c)&&(t.includes(c[0])?h.push(c[0]+"="+i):h.push(l[u]))}var d=a;return null!=o&&(d+="?"+h.join("&")),null!=r&&(d+="#"+r),d},iZ="https?://(.*)",iQ=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],i0=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...iQ],i1="<masked>",i2=["li_fat_id"];function i3(e,t){var i=i0.concat(t||[]),s={};return t9(i,function(t){var i=iK(e,t);s[t]=i||null}),s}function i5(e){var t=e?0===e.search(iZ+"google.([^/?]*)")?"google":0===e.search(iZ+"bing.com")?"bing":0===e.search(iZ+"yahoo.com")?"yahoo":0===e.search(iZ+"duckduckgo.com")?"duckduckgo":null:null,i={};if(null!==t){i.$search_engine=t;var s=a?iK(a.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function i8(){return navigator.language||navigator.userLanguage}var i6="$direct";function i4(){return(null==a?void 0:a.referrer)||i6}function i7(e,t,i){void 0===i&&(i=!1);var s=e?[...iQ,...t||[]]:[],r=i?e8(null==l?void 0:l.href):null==l?void 0:l.href,n=null==r?void 0:r.substring(0,1e3);return{r:i4().substring(0,1e3),u:n?iX(n,s,i1):void 0}}function i9(e,t){void 0===t&&(t=!1);var i,s=e.r,r=e.u,n=t?e8(r):r,o={$referrer:s,$referring_domain:null==s?void 0:s==i6?i6:null==(i=iJ(s))?void 0:i.host};
vendor: 3,133 bytes, line 1
1if(n){o.$current_url=n;var a=iJ(n);o.$host=null==a?void 0:a.host,o.$pathname=null==a?void 0:a.pathname,ie(o,i3(n))}return s&&ie(o,i5(s)),o}var se={flags:tN,surveys:tL},st=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],si=e=>{var t="",i=0;for(var s of e){var r=encodeURIComponent(JSON.stringify(s).slice(1,-1)).length;if(i+r>1e3)break;t+=s,i+=r}return t},ss="main",sr=[tP,tI,tC,tF,tO,tN,tT,tR],sn=e=>-1!==sr.indexOf(e),so=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch(i){return e===t}},sa=e=>{if(!e)return{};var t=JSON.parse(e);return T(t)?t:{}},sl=(e,t)=>{t9(e,(i,s)=>{var r=iW(s);r&&"event"!==r.exposure||({}).hasOwnProperty.call(t,s)||delete e[s]})};class sh{constructor(e,t,i){if(void 0===i&&(i=!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=i,this.props={},this.Oo=void 0,this.Co=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.lo=this.Ao(e),this.yo=this.Mo(e),this.load(),this.Do(),e.debug&&tl.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save(),r){var s=()=>this.flush();io(r,"beforeunload",s,{capture:!1}),io(r,"pagehide",s,{capture:!1}),this.No=e=>{if(this.bo&&(!e.storageArea||e.storageArea===(null==r?void 0:r.localStorage))&&e.key)if(e.key!==this.Co){if(this.yo){var t=iH.find(t=>e.key===this.Fo(t));t&&this.Uo(e.key,t)}}else this.Uo(e.key,ss)},io(r,"storage",this.No)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(e=>{var t=e[0],i=e[1],s=this.Eo.get(t);if(sn(t)&&!0!==s)if(!0!==i){var r=new Set(s||[]);i.forEach(e=>r.add(e)),r.size&&this.Bo(t,r)}else this.Bo(t,!0)})}onCrossTabFeatureFlagChange(e){return this.Po.add(e),()=>this.Po.delete(e)}destroy(){this.No&&r&&(r.removeEventListener("storage",this.No),this.No=void 0),this.Po.clear()}Uo(e,t,i){if(void 0===i&&(i=!0),this.Lo)return!1;try{let i;if(i=r=iw.no(e),null===i){var s,r,n=this.jo(t);return n.storageValue=null,t!==ss&&(n.persisted=!1),!1}s=sa(r)}catch(e){return!1}var o=t===ss?s:iw.oo(this.Co);if(o&&this.zo(o))return!1;var a=this.qo(s,t,i);return t===ss&&this.yo&&!so(this.Ho().main,s)||this.Go(s,t,!0,r),a}zo(e){var t=this.props[tv],i=e[tv];return!A(t)&&!A(i)&&t!==i}Go(e,t,i,s){var r=this.jo(t);r.storageValue=s,t!==ss&&(r.persisted=i);try{r.fingerprint=this.Wo(e,t)}catch(e){r.fingerprint=void 0}}qo(e,t,i){var s=!1;return sr.forEach(i=>{var r,n=null==(r=iW(i))?void 0:r.storageGroup;if(!(t===ss&&this.yo&&n||t!==ss&&n!==t)){var o=i in e,a=this.Vo(i,o?e[i]:void 0),l=this.Eo.has(i)?i in this.props:o;l===i in this.props&&so(a,this.props[i])||(l?this.Jo(i,a,!1):this.Yo(i,!1),s=!0)}}),s&&i&&this.Po.forEach(e=>e()),s}Ko(){if(!this.bo)return!1;try{this.ko=!1;var e,t=iw.no(this.Co),i=this.jo(ss),s=!1,r=!1;if(t!==i.storageValue)if(null===t)i.storageValue=null;else{if(e=sa(t),this.ko=!this.To&&this.zo(e),this.ko)return!1;r=this.qo(e,ss,!1),!this.yo||so(this.Ho().main,e)?this.Go(e,ss,!0,t):i.storageValue=t,s=!0}
1return this.yo&&iH.forEach(t=>{var i=iw.no(this.Fo(t)),n=this.jo(t),o=e||{},a=s&&sr.some(e=>{var i;return(null==(i=iW(e))?void 0:i.storageGroup)===t&&e in o});if(i!==n.storageValue||a){if(null===i)return n.storageValue=null,n.persisted=!1,void(a&&(r=this.qo(o,t,!1)||r));var l=sa(i);r=this.qo(l,t,!1)||r,this.Go(l,t,!0,i)}}),r}catch(e){return!1}}Bo(e,t){this.Eo.set(e,t);var i=iW(e);null!=i&&i.volatile||(this.jo((this.yo?null==i?void 0:i.storageGroup:void 0)||ss).fingerprint=void 0,this.Xo(e))}Qo(){sr.forEach(e=>this.Eo.set(e,!0))}Do(){if(this.bo)try{var e=iw.no(this.Co),t=sa(e);this.jo(ss).storageValue=e,sr.forEach(e=>{var i,s=this.yo?null==(i=iW(e))?void 0:i.storageGroup:void 0,r=s?iw.no(this.Fo(s)):null;if(s){var n=this.jo(s);n.storageValue=r,n.persisted=null!==r}var o=s&&null!==r?sa(r):t;e in this.props?this.Zo(e,o[e],this.props[e]):e in o&&this.Bo(e,!0)})}catch(e){}}Vo(e,t){var i=this.Eo.get(e);if(!i)return t;if(!0===i)return this.props[e];if(e===tI){var s=new Set(F(t)?t:[]),r=new Set(F(this.props[e])?this.props[e]:[]);return i.forEach(e=>r.has(e)?s.add(e):s.delete(e)),Array.from(s)}var n=T(t)?y({},t):{},o=T(this.props[e])?this.props[e]:{};return i.forEach(e=>{e in o?n[e]=o[e]:delete n[e]}),n}Zo(e,t,i){if(sn(e)){var s=this.Eo.get(e);if(!0!==s){var r=t;if(this.bo)try{var n,o=this.yo?null==(n=iW(e))?void 0:n.storageGroup:void 0,a=o?this.Fo(o):this.Co;r=sa(iw.no(a))[e]}catch(e){}var l=new Set(s||[]);if(e===tI){if(!A(t)&&!F(t)||!A(r)&&!F(r)||!F(i))return void this.Bo(e,!0);var h=new Set(t||[]),u=new Set(r||[]),c=new Set(i);new Set([...h,...c]).forEach(e=>{h.has(e)!==c.has(e)&&l.add(e)}),l.forEach(e=>{u.has(e)===c.has(e)&&l.delete(e)})}else{if(!T(i))return void(so(r,i)?this.Eo.delete(e):this.Bo(e,!0));if(!A(t)&&!T(t)||A(t)&&R(i)&&A(r))return void this.Bo(e,!0);var d=T(t)?t:{},p=T(r)?r:{};new Set([...Object.keys(d),...Object.keys(i)]).forEach(e=>{e in d==e in i&&so(d[e],i[e])||l.add(e)}),l.forEach(e=>{e in p==e in i&&so(p[e],i[e])&&l.delete(e)})}l.size?this.Bo(e,l):this.Eo.delete(e)}}}_a(){var e,t=null==(e=this.P)?void 0:e.persistence_save_debounce_ms;return B(t)&&t>0?t:0}ma(e){if(this.P.cookieWinsOnConflict&&"localstorage+cookie"===this.P.persistence.toLowerCase())if(e)try{var t=iS(e,this.P.cookie_persisted_properties||[]),i=iI(t,this.P.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=iy.no(this.Co)||void 0;r&&iF(this.Co,r)===s&&(this.ba=s,this.wa=r)}catch(e){}else try{var n=iy.no(this.Co)||void 0;this.ba=n?iF(this.Co,n):void 0,this.wa=n}catch(e){}}syncCookieProperties(){return this.ya(this.P)}ya(e,t){if(void 0===t&&(t=!1),this.Lo&&!t||this.xo||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{i=iy.no(this.Co)||void 0}catch(e){}if(!i||i===this.wa)return!1;var i,s,r=iF(this.Co,i);try{s=i$(JSON.parse(i))}catch(e){return!1}if((iy.no(this.Co)||void 0)!==i)return!1;this.ba=r,this.wa=i;var n=iC(this.Co,i),o=[...ik,...n.properties],a={};if(Object.keys(s).forEach(e=>{var t=s[e];(A(t)||null===t||""===t||e===tq&&t!==tQ&&t!==t0)&&(a[e]=!0,delete s[e])}),R(s))return!1;var l=tv in s||s[tq]===tQ||s[tq]===t0,h=this.props,u=h[tv],c=h[tq],d=ie({},h);[...ik,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==o.indexOf(e)&&!(e in s)&&!a[e]&&(l||e!==tv&&e!==tq)){var t=d[e];(n.isValid||-1===ik.indexOf(e)||!1!==t&&0!==t)&&delete d[e]}}),this.props=ie(d,s),sr.forEach(e=>{var t=e in this.props;e in h===t&&so(h[e],this.props[e])||(t?this.Zo(e,h[e],this.props[e]):this.Bo(e,!0))}),!l||tq in s||tq in this.props||this.Jo(tq,tQ);var p=this.props[tv],g=this.props[tq];return l&&(p!==u||g!==c)&&(this.To=!0,this.$o=!0,iA.gr(this.Co+"_cookie_identity_change_pending",!0),this.Yo(tR),this.Yo(tI),this.Yo(tP),this.Yo(tC),this.Yo(tF),this.Yo(tO),this.Yo(tN),this.Yo(tB),this.Yo(tD),g!==tQ||c!==t0&&s[tq]!==tQ&&(A(u)||p===u)||(sl(this.props,s),this.Yo(tA)),g===t0?this.props.$user_id=p:delete this.props.$user_id,this.Yo(ty)),!0}
1consumeCookieIdentityChange(){var e=this.Co+"_cookie_identity_change_pending",t=this.$o||!!iA.no(e);return this.$o=!1,t&&iA.mr(e),t}$a(e){return void 0===e&&(e=!1),!(this.xo||this.Lo&&!e||!this.P.cookieWinsOnConflict||"localstorage+cookie"!==this.P.persistence.toLowerCase()||(this.xo=!0,0))}xa(){this.xo&&(A(this.Ea)||(clearTimeout(this.Ea),this.Ea=void 0),delete this.mo[ss],this.Sa(!0))}Ta(e){if(void 0===e&&(e=!0),this.xo)try{e?this.xa():A(this.Ea)||(clearTimeout(this.Ea),this.Ea=void 0)}finally{this.xo=!1}}isDisabled(){return!!this.Lo}Ao(e){-1===st.indexOf(e.persistence.toLowerCase())&&(tl.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,s,n,o=(t=e.cookie_persisted_properties||[],i=e.cookieWinsOnConflict,void 0===t&&(t=[]),void 0===i&&(i=!1),s=[...ik,...t],y({},iw,{oo(e){try{var t,r={};try{r=(t=iy.no(e)||void 0)?i$(JSON.parse(t)):{}}catch(e){}var n,o=JSON.parse(iw.no(e)||"{}");if(i){var a=iC(e,t),l=[...ik,...a.properties],h={};Object.keys(r).forEach(e=>{var t=r[e];null===t||""===t||e===tq&&t!==tQ&&t!==t0||(h[e]=t)});var u=tv in h||h[tq]===tQ||h[tq]===t0;if(Object.keys(h).length>0){var c,d=o[tv],p=null!=(c=o[tq])?c:tQ;s.forEach(e=>{if(-1!==l.indexOf(e)&&!(e in r)&&(u||e!==tv&&e!==tq)){var t=o[e];(a.isValid||-1===ik.indexOf(e)||!1!==t&&0!==t)&&delete o[e]}}),!u||tq in r||tq in o||(o[tq]=tQ),u&&((tv in h?h[tv]:o[tv])!==d||(tq in h?h[tq]:o[tq])!==p)&&
vendor: 6,624 bytes, line 1
1(ix.forEach(e=>delete o[e]),h[tq]===t0&&tv in h?o.$user_id=h[tv]:delete o.$user_id,h[tq]!==t0&&(delete o[tM],delete o[tA]),delete o.__alias)}n=ie(o,h)}else n=ie(r,o);return iw.gr(e,n),n}catch(e){}return null},gr(e,s,r,n,o,a){var l=iw.gr(e,s,void 0,void 0,a);try{var h=iS(s,t);if(Object.keys(h).length){if(i){var u=e+"_cpm",c=iI(h,t);if(iy.gr(u,c,r,n,o,a),iy.no(u)!==JSON.stringify(c)){iy.mr(u,n);var d=iS(s);return iy.gr(e,d,r,n,o,a),l}}iy.gr(e,h,r,n,o,a)}}catch(e){iw.so(e)}return l},mr(e,t){try{null==r||r.localStorage.removeItem(e),iy.mr(e,t),iy.mr(e+"_cpm",t)}catch(e){iw.so(e)}}})),a=!1,l=!1,h=e.persistence.toLowerCase();return"localstorage"===h&&iw.ro()?(n=iw,l=!0):"localstorage+cookie"===h&&o.ro()?(n=o,l=!0,a=!0):"sessionstorage"===h&&iA.ro()?n=iA:"memory"===h?n=iT:"cookie"===h&&iy.ro()?(n=iy,a=!0):o.ro()?(n=o,l=!0,a=!0):iy.ro()?(n=iy,a=!0):n=iT,this.bo=l,this.wo=a,n}Fo(e){return this.Co+"__"+e}Mo(e){return this.bo&&!!e.split_storage}properties(){var e={};return t9(this.props,(t,i)=>{var s=iW(i);if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t))return;e[i]=t}}),e}load(e){if(void 0===e&&(e=!1),!this.Lo||e){var t=this.P.cookieWinsOnConflict&&"localstorage+cookie"===this.P.persistence.toLowerCase(),i=t?iw.oo(this.Co):null,s={};if(t)try{t9(s=i$(iy.oo(this.Co)),(e,t)=>{(A(e)||null===e||""===e)&&delete s[t]})}catch(e){}var r=this.lo.oo(this.Co);if(r&&(this.props=ie({},r)),this.yo&&this.ka(),t&&r){var n,o,a=null==i?void 0:i[tv],l=null!=(n=null==i?void 0:i[tq])?n:tQ,h=r[tv],u=null!=(o=r[tq])?o:tQ;if(h!==a||u!==l){this.$o=!0,iA.gr(this.Co+"_cookie_identity_change_pending",!0);var c=ie({},this.props);ix.forEach(e=>delete c[e]),u!==tQ||l!==t0&&s[tq]!==tQ&&(A(a)||h===a)||(sl(c,s),delete c[tA]),this.props=c;var d=new Set;ix.forEach(e=>{var t,i=null==(t=iW(e))?void 0:t.storageGroup;i&&d.add(i)}),d.forEach(e=>{var t={};t9(this.props,(i,s)=>{var r;(null==(r=iW(s))?void 0:r.storageGroup)===e&&(t[s]=i)}),R(t)?(iw.mr(this.Fo(e)),this.mo[e]={}):iw.gr(this.Fo(e),t)&&(this.mo[e]={persisted:!0,fingerprint:this.Wo(t,e)})})}}iA.no(this.Co+"_cookie_identity_change_pending")&&(this.$o=!0)}}ka(){for(var e of iH){var t=iw.oo(this.Fo(e));if(t&&!R(t)){var i=this.jo(e);i.persisted=!0,this.Ra(e)||(i.fingerprint=this.Wo(t,e)),this.Pa(e,t)||ie(this.props,t)}}}Ra(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=iW(t))?void 0:i.storageGroup)===e})}Pa(e,t){var i=se[e];if(!i)return!1;var s=t[i],r=this.props[i];return B(s)&&B(r)&&r>s}refreshKey(e){var t;if(!(this.Lo||e===tw&&this.Ro)){var i=this.yo?null==(t=iW(e))?void 0:t.storageGroup:void 0,s=i?iw.oo(this.Fo(i)):this.lo.oo(this.Co);if(s&&e in s)this.Jo(e,s[e],!1);else{if(i){var r=this.lo.oo(this.Co);if(r&&e in r)return void this.Jo(e,r[e],!1)}this.Yo(e,!1)}}}save(){if(!this.Lo){var e=this._a();e>0?A(this.Ea)&&(this.Ea=setTimeout(()=>{this.Ea=void 0,this.Sa()},e)):this.Sa()}}flush(){A(this.Ea)||(clearTimeout(this.Ea),this.Ea=void 0,this.Sa())}Sa(e){if(void 0===e&&(e=!1),!(this.Lo||this.xo&&!e)){e||(this.syncCookieProperties(),this.Ro||this.P.cookieWinsOnConflict&&"localstorage+cookie"===this.P.persistence.toLowerCase()||this.refreshKey(tw));var t=!e&&!this.So;t||(this.ko=!1);var i=!!t&&this.Ko();if(this.ko)this.P.debug&&tl.warn("skipping persistence write because storage belongs to a different distinct ID");else{if(this.yo)return this.Ia(),void(i&&this.Po.forEach(e=>e()));var s=this.Oa(this.lo,this.Co,this.props,ss);"written"===s&&this.ma(this.props),"failed"!==s&&(this.Eo.clear(),this.To=!1,this.Ro=!1),i&&this.Po.forEach(e=>e())}}}Ia(){var e=this,t=this.Ho(),i=t.main,s=t.groups,r=this.Oa(this.lo,this.Co,i,ss);"written"===r&&this.ma(i),"failed"!==r&&(this.To=!1,this.Ro=!1,sr.forEach(e=>{var t;null!=(t=iW(e))&&t.storageGroup||this.Eo.delete(e)}));var n=function(t){var i,r=s[t];if(R(r)&&(null==(i=e.mo[t])||!i.persisted))return sr.forEach(i=>{var s;(null==(s=iW(i))?void 0:s.storageGroup)===t&&e.Eo.delete(i)}),1;var n=e.Oa(iw,e.Fo(t),r,t);"failed"!==n&&sr.forEach(i=>{var s=iW(i);(null==s?void 0:s.storageGroup)!==t||"written"!==n&&s.volatile||e.Eo.delete(i)})};for(var o of iH)n(o)}Ho(){var e={},t={flags:{},surveys:{}};return t9(this.props,(i,s)=>{var r,n=null==(r=iW(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}Wo(e,t){if(t===ss)return JSON.stringify(e)+"|"+this.Ca+"|"+this.Aa+"|"+this.Ma;var i={};return t9(e,(e,t)=>{var s;i[t]=null!=(s=iW(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}Oa(e,t,i,s){var r,n=this.jo(s);if(s!==ss&&!n.dirty&&!A(n.fingerprint))return"skipped";try{if((r=this.Wo(i,s))===n.fingerprint)return n.dirty=!1,"skipped"}catch(e){r=void 0}return e.gr(t,i,this.Ca,this.Aa,this.Ma,this.P.debug)?(n.dirty=!1,s!==ss&&(n.persisted=!0),A(r)||(n.fingerprint=r),this.bo&&(n.storageValue=iw.no(t)),"written"):(this.P.debug&&tl.warn('failed to persist storage entry "'+t+'"; will retry on next save'),"failed")}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(this.Qo(),A(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 s of iH)iw.mr(this.Fo(s));i?delete this.mo[ss]:this.mo={},this.ba=void 0,this.wa=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(T(e)){this.syncCookieProperties(),A(t)&&(t="None"),this.Ca=A(i)?this.Da:i;var s=!1;if(t9(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Jo(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(T(e)){this.syncCookieProperties(),this.Ca=A(t)?this.Da:t;var i=!1;if(t9(e,(t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||T(t)||F(t))&&(this.Jo(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var t=!1;for(var i of"string"==typeof e?[e]:e)i in this.props&&(this.Yo(i),t=!0);t&&this.save()}update_campaign_params(){var e=null==a?void 0:a.URL;if(e!==this.Oo){var t=function(e,t,i){if(!a)return{};var s,r=t?[...iQ,...i||[]]:[],n=i3(iX(a.URL,r,i1),e);return ie((s={},t9(i2,function(e){var t=ia(e);s[e]=t||null}),s),n)}(this.P.custom_campaign_params,this.P.mask_personal_data_properties,this.P.custom_personal_data_properties),i=!R(ii(t));return i&&this.register(t),this.Oo=e,i?t:void 0}}update_search_keyword(){var e;this.register((e=null==a?void 0:a.referrer)?i5(e):{})}update_referrer_info(){var e;this.register_once({$referrer:i4(),$referring_domain:null!=a&&a.referrer&&(null==(e=iJ(a.referrer))?void 0:e.host)||i6},void 0)}set_initial_person_info(){if(!this.props[tV]&&!this.props[tH]){var e=i7(this.P.mask_personal_data_properties,this.P.custom_personal_data_properties,this.P.disable_capture_url_hashes
1);this.register_once({[tz]:this.wo?{r:si(e.r),u:e.u?si(e.u):void 0}:e},void 0)}}get_initial_props(){var e,t,i,s={};t9([tH,tV],e=>{var t=this.props[e];t&&t9(t,function(e,t){s["$initial_"+k(t)]=e})});var r=this.props[tz];return r&&ie(s,(void 0===(e=this.P.disable_capture_url_hashes)&&(e=!1),t=i9(r,e),i={},t9(t,function(e,t){i["$initial_"+k(t)]=e}),i)),s}safe_merge(e){return t9(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){var s=e.persistence!==t.persistence,r=!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=s||r,o=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,a=e.disable_persistence||!!i,l=!!this.Lo&&!a;a||this.ya(t,l),this.P=e,!a&&(s||r||o)&&(this.ba=void 0,this.wa=void 0,this.ya(y({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),l));var h=n||o?this.Ao(e):this.lo;this.Na();var u=this.Mo(e),c=n||u!==this.yo,d=!a&&(c||e.cross_subdomain_cookie!==this.Aa||e.secure_cookie!==this.Ma)&&this.$a(l);this.So=c;try{if(this.Da=this.Ca=e.cookie_expiration,this.set_disabled(a),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),c){var p=this.props;this.clear(),this.lo=h,this.yo=u,this.props=p,this.save()}else o&&(this.lo=h,a||(delete this.mo[ss],this.Sa()))}finally{this.So=!1,d&&this.Ta()}}Na(){var e=this.props[tz];if(this.wo&&T(e)&&"string"==typeof e.r){var t=si(e.r),i="string"==typeof e.u?si(e.u):e.u;t===e.r&&i===e.u||this.Jo(tz,y({},e,{r:t,u:i}))}}set_disabled(e){this.Lo=e,this.Lo?this.remove():this.save()}set_cross_subdomain(e){e!==this.Aa&&(this.Aa=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ma&&(this.Ma=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[tx]||{};i[e]=t,this.Jo(tx,i),this.save()}remove_event_timer(e){var t=this.props[tx]||{},i=t[e];return A(i)||(delete t[e],this.Jo(tx,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Jo(e,t),this.save()}Jo(e,t,i){void 0===i&&(i=!0);var s,r=this.props[e];this.props[e]=t,i&&(e!==tv&&e!==tq||r===t||(this.To=!0),e!==tw||so(r,t)||(this.Ro=!0),this.Zo(e,r,t),null!=(s=iW(e))&&s.volatile||this.Xo(e))}Yo(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(sn(e)&&this.Bo(e,!0),e===tw&&(this.Ro=!0),this.Xo(e))}Xo(e){var t,i=null==(t=iW(e))?void 0:t.storageGroup;i&&(this.jo(i).dirty=!0)}jo(e){return this.mo[e]||(this.mo[e]={})}}var su="gzip-js",sc="base64",sd="survey sent";function sp(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&O(i.then)&&i.then(void 0,()=>{})}}}}var sg=th("[RateLimiter]");class s_{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{sg.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void sg.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,s,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,o=(new Date).getTime(),a=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(tG))?t:{tokens:r,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>r&&(a.tokens=r);var l=1>a.tokens;if(l||e||(a.tokens=Math.max(0,a.tokens-1)),l&&!e){var h=(B(a.dropped)?a.dropped:0)+1;a.dropped=h,!this.lastEventRateLimited&&this.Fa(h)&&(a.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(tG,a),{isRateLimited:l,remainingTokens:a.tokens}}Ua(e){var t=this.instance.config.property_denylist;return!F(t)||!t.includes(e)}Ba(){var e;if(this.Ua("$current_url")&&this.Ua("$pathname")&&null!=l&&l.pathname)return""+(null!=(e=l.origin)?e:"")+l.pathname}Fa(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this.Ba(),o=this.Ua("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,a=[e+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,o?"session "+o:void 0].filter(
vendor: 8,082 bytes, line 1
1Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+a+". Config is set to "+r+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var sv=th("[RemoteConfig]");class sf{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Zt(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Qt(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return sv.info("Using preloaded remote config",this.remoteConfig),void this.Yt(this.remoteConfig);if(this._instance._shouldDisableFlags())return void sv.warn("Remote config is disabled. Falling back to local config.");this.Zt(e=>{e?this.Yt(e):(sv.info("No config found after loading remote JS config. Falling back to JSON."),this.Qt(e=>{this.Yt(e.json,e)}))})}catch(e){sv.error("Error loading remote config",e),this.Yt()}}Yt(e,t){!e&&t&&(0===t.statusCode?t.error||sv.warn("Failed to fetch remote config from PostHog."):sv.error("Failed to fetch remote config from PostHog."));try{this._instance.Yt(e?{ok:!0,config:e}:{ok:!1})}catch(e){sv.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){sv.error("Error loading feature flags",e)}}}var sm=Uint8Array,sy=Uint16Array,sb=Uint32Array,sw=new sm([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]),sx=new sm([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]),sk=new sm([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sE=function(e,t){for(var i=new sy(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new sb(i[30]);for(s=1;30>s;++s)for(var n=i[s];i[s+1]>n;++n)r[n]=n-i[s]<<5|s;return[i,r]},s$=sE(sw,2),sS=s$[1];s$[0][28]=258,sS[258]=28;for(var sP=sE(sx,0)[1],sI=new sy(32768),sC=0;32768>sC;++sC){var sF=(43690&sC)>>>1|(21845&sC)<<1;sI[sC]=((65280&(sF=(61680&(sF=(52428&sF)>>>2|(13107&sF)<<2))>>>4|(3855&sF)<<4))>>>8|(255&sF)<<8)>>>1}var sO=function(e,t,i){for(var s=e.length,r=0,n=new sy(t);s>r;++r)++n[e[r]-1];var o,a=new sy(t);for(r=0;t>r;++r)a[r]=a[r-1]+n[r-1]<<1;if(i){o=new sy(1<<t);var l=15-t;for(r=0;s>r;++r)if(e[r])for(var h=r<<4|e[r],u=t-e[r],c=a[e[r]-1]++<<u,d=c|(1<<u)-1;d>=c;++c)o[sI[c]>>>l]=h}else for(o=new sy(s),r=0;s>r;++r)o[r]=sI[a[e[r]-1]++]>>>15-e[r];return o},sT=new sm(288);for(sC=0;144>sC;++sC)sT[sC]=8;for(sC=144;256>sC;++sC)sT[sC]=9;for(sC=256;280>sC;++sC)sT[sC]=7;for(sC=280;288>sC;++sC)sT[sC]=8;var sR=new sm(32);for(sC=0;32>sC;++sC)sR[sC]=5;var sA=sO(sT,9,0),sM=sO(sR,5,0),sL=function(e){return(e/8|0)+(7&e&&1)},sD=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof sy?sy:e instanceof sb?sb:sm)(i-t);return s.set(e.subarray(t,i)),s},sB=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},sN=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},sq=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new sm(0),0];if(1==r){var o=new sm(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],h=0,u=1,c=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};u!=r-1;)a=i[i[c].f>i[h].f?h++:c++],l=i[h!=u&&i[c].f>i[h].f?h++:c++],i[u++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var p=new sy(d+1),g=sj(i[u-1],p,0);if(g>t){s=0;var _=0,v=g-t,f=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r>s;++s){var m=n[s].s;if(t>=p[m])break;_+=f-(1<<g-p[m]),p[m]=t}for(_>>>=v;_>0;){var y=n[s].s;t>p[y]?_-=1<<t-p[y]++-1:++s}for(;s>=0&&_;--s){var b=n[s].s;p[b]==t&&(--p[b],++_)}g=t}return[new sm(p),g]},sj=function(e,t,i){return -1==e.s?Math.max(sj(e.l,t,i+1),sj(e.r,t,i+1)):t[e.s]=i},sG=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new sy(++t),s=0,r=e[0],n=1,o=function(e){i[s++]=e},a=1;t>=a;++a)if(e[a]==r&&a!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(r),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(r);n=1,r=e[a]}return[i.subarray(0,s),t]},sV=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},sH=function(e,t,i){var s=i.length,r=sL(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;s>n;++n)e[r+n+4]=i[n];return 8*(r+4+s)},sz=function(e,t,i,s,r,n,o,a,l,h,u){sB(t,u++,i),++r[256];for(var c=sq(r,15),d=c[0],p=c[1],g=sq(n,15),_=g[0],v=g[1],f=sG(d),m=f[0],y=f[1],b=sG(_),w=b[0],x=b[1],k=new sy(19),E=0;m.length>E;++E)k[31&m[E]]++;for(E=0;w.length>E;++E)k[31&w[E]]++;for(var $=sq(k,7),S=$[0],P=$[1],I=19;I>4&&!S[sk[I-1]];--I);var C,F,O,T,R=h+5<<3,A=sV(r,sT)+sV(n,sR)+o,M=sV(r,d)+sV(n,_)+o+14+3*I+sV(k,S)+(2*k[16]+3*k[17]+7*k[18]);if(A>=R&&M>=R)return sH(t,u,e.subarray(l,l+h));if(sB(t,u,1+(A>M)),u+=2,A>M){C=sO(d,p,0),F=d,O=sO(_,v,0),T=_;var L=sO(S,P,0);for(sB(t,u,y-257),sB(t,u+5,x-1),sB(t,u+10,I-4),u+=14,E=0;I>E;++E)sB(t,u+3*E,S[sk[E]]);u+=3*I;for(var D=[m,w],B=0;2>B;++B){var N=D[B];for(E=0;N.length>E;++E)sB(t,u,L[q=31&N[E]]),u+=S[q],q>15&&(sB(t,u,N[E]>>>5&127),u+=N[E]>>>12)}}else C=sA,F=sT,O=sM,T=sR;for(E=0;a>E;++E)if(s[E]>255){sN(t,u,C[257+(q=s[E]>>>18&31)]),u+=F[q+257],q>7&&(sB(t,u,s[E]>>>23&31),u+=sw[q]);var q,j=31&s[E];sN(t,u,O[j]),u+=T[j],j>3&&(sN(t,u,s[E]>>>5&8191),u+=sx[j])}else sN(t,u,C[s[E]]),u+=F[s[E]];return sN(t,u,C[256]),u+F[256]},sU=new sb([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),sW=function(){for(var e=new sb(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),sY=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},sJ=!!u||!!h,sK="text/plain",sX=!1,sZ=(e,t)=>{var i=e.split("#"),s=i[1],r=i[0].split("?"),n=r[0],o=r[1];if(!o)return e;var a=o.split("&").filter(e=>e.split("=")[0]!==t).join("&");return n+(a?"?"+a:"")+(s?"#"+s:"")},sQ=function(e,t,i){void 0===i&&(i=!0);var s,r,n,o,a,l=e.split("?"),h=l[0],u=l[1],c=y({},t),d=null!=(a=null==u?void 0:u.split("&").map(e=>{var t,s=e.split("="),r=s[0],n=i&&null!=(t=c[r])?t:s[1];return delete c[r],r+"="+n}))?a:[],p=(void 0===s&&(s="&"),o=[],t9(c,function(e,t){A(e)||A(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),o[o.length]=n+"="+r)}),o.join(s));return p&&d.push(p),d.length>0?h+"?"+d.join("&"):h},s0=e=>{if(e.La)return e.La;var t=e.data,i=e.compression;if(t){if(i===su){var s,r,n,o,a,l,h,u,c=(s=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new sm(e.length+(e.length>>>1)),s=0,r=function(e){i[s++]=e},n=0;t>n;++n){if(s+5>i.length){var o=new sm(s+8+(t-n<<1));o.set(i),i=o}var a=e.charCodeAt(n);128>a?r(a):(2048>a?r(192|a>>>6):(a>55295&&57344>a?(r(240|(a=65536+(1047552&a)|1023&e.charCodeAt(++n))>>>18),r(128|a>>>12&63)):r(224|a>>>12),r(128|a>>>6&63)),r(128|63&a))}return sD(i,0,s)}(iY(t)),r={mtime:0},n=0xffffffff,o={p(e){for(var t=n,i=0;e.length>i;++i)t=sW[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},a=s.length,o.p(s),u=(l=10+(r.filename&&r.filename.length+1||0),h=function(e,t,i,s,r){var n=e.length,o=new sm(s+n+5*(1+Math.floor(n/7e3))+8),a=o.subarray(s,o.length-8),l=0;if(!t||8>n)for(var h=0;n>=h;h+=65535){var u=h+65535;n>u?l=sH(a,l,e.subarray(h,u)):(a[h]=r,l=sH(a,l,e.subarray(h,n)))}else{for(var c=sU[t-1],d=c>>>13,p=8191&c,g=(1<<i)-1,_=new sy(32768),v=new sy(g+1),f=Math.ceil(i/3),m=2*f,y=function(t){return(e[t]^e[t+1]<<f^e[t+2]<<m)&g},b=new sb(25e3),w=new sy(288),x=new sy(32),k=0,E=0,$=(h=0,0),S=0,P=0;n>h;++h){var I=y(h),C=32767&h,F=v[I];if(_[C]=F,v[I]=C,h>
1=S){var O=n-h;if((k>7e3||$>24576)&&O>423){l=sz(e,a,0,b,w,x,E,$,P,h-P,l),$=k=E=0,P=h;for(var T=0;286>T;++T)w[T]=0;for(T=0;30>T;++T)x[T]=0}var R=2,A=0,M=p,L=C-F&32767;if(O>2&&I==y(h-L))for(var D=Math.min(d,O)-1,B=Math.min(32767,h),N=Math.min(258,O);B>=L&&--M&&C!=F;){if(e[h+R]==e[h+R-L]){for(var q=0;N>q&&e[h+q]==e[h+q-L];++q);if(q>R){if(R=q,A=L,q>D)break;var j=Math.min(L,q-2),G=0;for(T=0;j>T;++T){var V=h-L+T+32768&32767,H=V-_[V]+32768&32767;H>G&&(G=H,F=V)}}}L+=(C=F)-(F=_[C])+32768&32767}if(A){b[$++]=0x10000000|sS[R]<<18|sP[A];var z=31&sS[R],U=31&sP[A];E+=sw[z]+sx[U],++w[257+z],++x[U],S=h+R,++k}else b[$++]=e[h],++w[e[h]]}}l=sz(e,a,r,b,w,x,E,$,P,h-P,l)}return sD(o,0,s+sL(l)+8)}(s,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+r.mem,l,!0)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&sY(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;i.length>=s;++s)e[s+10]=i.charCodeAt(s)}}(h,r),sY(h,u-8,o.d()),sY(h,u-4,a),h);return{contentType:sK,body:c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength),estimatedSize:c.byteLength}}if(i===sc){let e;var d,p="data="+encodeURIComponent("string"==typeof(e=(d=iY(t))?btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):d)?e:iY(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var g=iY(t);return{contentType:"application/json",body:g,estimatedSize:new Blob([g]).size}}},s1=e=>{var t,i,s=()=>"sendBeacon"===e.transport?{url:sQ(e.url,{compression:sc}),encodedBody:s0(y({},e,{compression:sc,La:void 0}))}:{url:sZ(e.url,"compression"),encodedBody:s0(y({},e,{compression:void 0,La:void 0}))};try{t=s0(e)}catch(t){if(ti(e.compression,iK(e.url,"compression")))return tl.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&ti(e.compression,iK(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?tt(new Uint8Array(i)):ArrayBuffer.isView(i)&&tt(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(sX=!0,s())},s2=e=>{try{return s1(e)}catch(t){return tl.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},s3=(rS=m(function*(e){var t=iY(e.data),i=yield function(e,t,i){return to.apply(this,arguments)}(t,v.DEBUG,{rethrow:!0});if(!i)return e;var s=yield i.arrayBuffer();return y({},e,{La:{contentType:sK,body:s,estimatedSize:s.byteLength}})}),function(e){return rS.apply(this,arguments)}),s5=/Failed to fetch|NetworkError|Load failed/i,s8=e=>"TypeError"===(null==e?void 0:e.name)&&s5.test((null==e?void 0:e.message)||""),s6=e=>{var t=s2(e);if(t){var i=new u,s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,o=r.body;t9(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(o)}},s4=e=>{var t=s2(e);if(t){var i,s=t.url,r=t.encodedBody,n=null!=r?r:{},o=n.contentType,a=n.body,l=n.estimatedSize,u=new Headers;t9(e.headers,function(e,t){u.append(t,e)}),o&&u.append("Content-Type",o);var d=null,p=!1;if(c){var g=new c;d={signal:g.signal,timeout:setTimeout(()=>{var t;p=!0,g.abort(e5("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))},e.timeout)}}var _=t=>{p&&"AbortError"===(null==t?void 0:t.name)||s8(t)?tl.warn(t):tl.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{h(s,y({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&!e.ja&&52428.8>(l||0),body:a,signal:null==(i=d)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){tl.error(e)}null==e.callback||e.callback(s)})).catch(_).finally(()=>d?clearTimeout(d.timeout):null)}catch(e){d&&clearTimeout(d.timeout),_(e)}}},s7=e=>{try{var t,i=s1(e),s=i.url,r=i.encodedBody,n=null!=r?r:{},a=n.body,l=n.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:n.contentType});if(o.sendBeacon(s,u))return;var c=F(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(F(c)&&c.length>1&&(null!=l?l:0)>16384){var d=Math.ceil(c.length/2),p=t=>F(e.data)?t:y({},e.data,{batch:t});return s7(y({},e,{data:p(c.slice(0,d))})),void s7(y({},e,{data:p(c.slice(d))}))}tl.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to "+(h?"fetch":"XHR")),h?s4(y({},e,{ja:!0})):s6(e)}catch(e){tl.warn("Beacon send failed",e)}}
1,s9=(e,t,i,s)=>{var r="query"===s?"POST"===t?"sent_at":"_":void 0;return sQ(i===su?sZ(e,"compression"):e,y({},r?{[r]:Date.now().toString()}:{},i===su?{}:{compression:i}))},re=[];h&&re.push({transport:"fetch",method:s4}),u&&re.push({transport:"XHR",method:s6}),null!=o&&o.sendBeacon&&re.push({transport:"sendBeacon",method:s7});class rt{constructor(e,t){this.za=!0,this.Ln=[],this.qa=U((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,tl.createLogger("flush interval"),3e3),this.Ha=e}enqueue(e){this.Ln.push(e),this.Ga||this.Wa()}unload(){this.Va();var e=Object.values(this.Ln.length>0?this.Ja():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Ya(y({},e,{transport:"sendBeacon"}))})}enable(){this.za=!1,this.Wa()}Wa(){var e=this;this.za||(this.Ga=setTimeout(()=>{if(this.Va(),this.Ln.length>0){var t=this.Ja();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&F(s.data)&&t9(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Ya(s)}()}},this.qa))}Ya(e){try{this.Ha(e)}catch(e){tl.error(e)}}Va(){clearTimeout(this.Ga),this.Ga=void 0}Ja(){var e={};return t9(this.Ln,t=>{var i,s=(t?t.batchKey:null)||t.url;A(e[s])&&(e[s]=y({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.Ln=[],e}}var ri=["retriesPerformedSoFar"];class rs{constructor(e){this.Ka=!1,this.Xa=3e3,this.Ln=[],this._instance=e,this.Ln=[],this.Qa=!0,this.resume()}resume(){!A(r)&&"onLine"in r.navigator&&(this.Qa=r.navigator.onLine,this.Za||(this.Za=()=>{this.Qa=!0,this.gs()},this.th=()=>{this.Qa=!1},io(r,"online",this.Za),io(r,"offline",this.th)))}get length(){return this.Ln.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=function(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}(e,ri);N(t)&&(i.url=sQ(i.url,{retry_count:t})),this._instance._send_request(y({},i,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.Z(y({retriesPerformedSoFar:t},i));0===e.statusCode&&tl.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!=t?t:0)+" retries.")}null==i.callback||i.callback(e)}}))}Z(e){var t,i,s=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=s+1;var r=Math.ceil((i=Math.min(18e5,t=3e3*Math.pow(2,s)))+(Math.random()-.5)*(i-t/2)),n=Date.now()+r;this.Ln.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+r;navigator.onLine||(o+=" (Browser is offline)"),tl.warn(o),this.Ka||(this.Ka=!0,this.eh())}eh(){(this.ih&&clearTimeout(this.ih),0===this.Ln.length)?(this.Ka=!1,this.ih=void 0):this.ih=setTimeout(()=>{this.Qa&&this.Ln.length>0&&this.gs(),this.eh()},this.Xa)}gs(){var e=Date.now(),t=[],i=this.Ln.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.Ln=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.ih&&(clearTimeout(this.ih),this.ih=void 0),this.Ka=!1,A(r)||(this.Za&&(r.removeEventListener("online",this.Za),this.Za=void 0),this.th&&(r.removeEventListener("offline",this.th),this.th=void 0)),this.Ln)){var t=e.requestOptions;try{this._instance._send_request(y({},t,{transport:"sendBeacon"}))}catch(e){tl.error(e)}}this.Ln=[]}}class rr{constructor(e){this.rh=()=>{this.sh||(this.sh={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),o=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.sh.lastScrollY=Math.ceil(n),this.sh.maxScrollY=Math.max(n,null!=(e=this.sh.maxScrollY)?e:0),this.sh.maxScrollHeight=Math.max(o,null!=(t=this.sh.maxScrollHeight)?t:0),this.sh.lastContentY=a,this.sh.maxContentY=Math.max(a,null!=(i=this.sh.maxContentY)?i:0),this.sh.maxContentHeight=Math.max(l,null!=(s=this.sh.maxContentHeight)?s:0)},this._instance=e}get nh(){return this._instance.config.scroll_root_selector}getContext(){return this.sh}resetContext(){var e=this.sh;return setTimeout(this.rh,0),e}startMeasuringScrollPosition(){io(r,"scroll",this.rh,{capture:!0}),io(r,"scrollend",this.rh,{capture:!0}),io(r,"resize",this.rh)}scrollElement(){if(!this.nh)return null==r||null==(t=r.document)?void 0:t.documentElement;for(var e of F(this.nh)?this.nh:[this.nh]){var t,i,s=null==r||null==(i=r.document)?void 0:i.querySelector(e);
1if(s)return s}}oh(e){var t,i;if(this.nh){var s=this.scrollElement();return s&&s["y"===e?"scrollTop":"scrollLeft"]||0}return r?"y"===e?r.scrollY||r.pageYOffset||(null==(t=r.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:r.scrollX||r.pageXOffset||(null==(i=r.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.oh("y")}scrollX(){return this.oh("x")}}var rn=e=>i7(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class ro{constructor(e,t,i,s){this.ah=e=>{var t=this.hh();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.uh(this._instance)};this.Ir.register({[tj]:i})}},this._instance=e,this.dh=t,this.Ir=i,this.uh=s||rn,this.dh.onSessionId(this.ah)}hh(){return this.Ir.props[tj]}getSetOnceProps(){var e,t=null==(e=this.hh())?void 0:e.props;return t?"r"in t?i9(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return t9(ii(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+k(i)]=t}),e}}class ra{on(e,t){return this.wi[e]||(this.wi[e]=[]),this.wi[e].push(t),()=>{this.wi[e]=this.wi[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.wi[e]||[])i(t);for(var s of this.wi["*"]||[])s(e,t)}constructor(){this.wi={}}}var rl=th("[SessionId]");class rh{on(e,t){return this._h.on(e,t)}constructor(e,t,i){if(this.ph=null,this.fh=null,this.gh=[],this.mh=void 0,this.bh=!1,this._h=new ra,this.wh=(e,t)=>!(!N(e)||!N(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===tZ)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.P=e.config,this.Ir=e.persistence,this.yh=void 0,this.$h=void 0,this._sessionStartTimestamp=null,this.xh=void 0,this._sessionActivityTimestamp=null,this.Eh=t||ip,this.Sh=i||ip;var s,r=this.P.persistence_name||this.P.token;if(this._sessionTimeoutMs=1e3*U(this.P.session_idle_timeout_seconds||1800,60,36e3,rl.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Th(),this.kh="ph_"+r+"_window_id",this.Rh="ph_"+r+"_primary_window_exists",this.Ph()){var n=iA.oo(this.kh),o=iA.oo(this.Rh);n&&!o?this.yh=n:iA.mr(this.kh),iA.gr(this.Rh,!0)}null!=(s=this.P.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this.P.bootstrap.sessionID),this.Ih()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return A(this.gh)&&(this.gh=[]),this.gh.push(e),this.$h&&e(this.$h,this.yh),()=>{this.gh=this.gh.filter(t=>t!==e)}}Ph(){return"memory"!==this.P.persistence&&!this.Ir.Lo&&iA.ro()}Oh(e){e!==this.yh&&(this.yh=e,this.Ph()&&iA.gr(this.kh,e))}Ch(){return this.yh?this.yh:this.Ph()?iA.oo(this.kh):null}Ah(e){var t=this.ph;return null!==t&&null!==e&&5e3>Math.abs(e-t)}Mh(e,t,i){var s=t!==this._sessionActivityTimestamp,r=e===this.$h&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.$h=e,r&&!s||r&&this.Ah(t)||(this.ph=t,this.Ir.register({[t$]:[t,e,i]}))}Dh(){var e,t=null==(e=this.P)?void 0:e.persistence_save_debounce_ms;return N(t)&&t>0}Nh(){this.Dh()?this.Ir.refreshKey(t$):(this.Ir.flush(),this.Ir.load())}Fh(){var e;if(null!==this._sessionActivityTimestamp&&this._sessionActivityTimestamp!==this.ph){this.Nh();var t=this.Uh();t[1]===this.$h&&t[2]===this._sessionStartTimestamp&&(this.ph=this._sessionActivityTimestamp,this.Ir.register({[t$]:[this._sessionActivityTimestamp,null!=(e=this.$h)?e:null,this._sessionStartTimestamp]}),this.Ir.flush())}}Bh(){var e=this.Uh()[0];return Math.max(N(e)?e:0,N(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}Lh(e){return this.Nh(),this.wh(e,this.Bh())}Uh(){var e=this.Ir.props[t$];return F(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.ph=null,this.xh=void 0,clearTimeout(this.jh),this.jh=void 0,this.Mh(null,null,null)}setBootstrapSessionId(e,t){void 0===t&&(t=!1);var i=function(e,t){void 0===t&&(t=(new Date).getTime());try{var i=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(e);return i>t+6e4?void rl.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void rl.error("Invalid sessionID in bootstrap",e)}}(e);return!A(i)&&(t?this.xh={sessionId:e,sessionStartTimestamp:i}
1:this.Mh(e,(new Date).getTime(),i),!0)}destroy(){this.bh=!0,this.Fh(),clearTimeout(this.jh),this.jh=void 0,this.mh&&r&&(r.removeEventListener(t3,this.mh,{capture:!1}),this.mh=void 0),this.gh=[]}Ih(){this.mh=()=>{this.Fh(),this.Ph()&&iA.mr(this.Rh)},io(r,t3,this.mh,{capture:!1})}checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),this.P.cookieless_mode===tZ)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s,r,n=t||(new Date).getTime(),o=this.$h;i?this.fh=n:(null===this.fh||this.fh>n||n-this.fh>=1e3)&&(null==(s=(r=this.Ir).syncCookieProperties)||s.call(r),this.fh=n);var a=this.Uh(),l=a[1],h=a[2],u=!A(o)&&l!==o,c=this.Bh(),d=this.Ch(),p=this.xh,g=!!p&&(p.sessionStartTimestamp>n+6e4||n-p.sessionStartTimestamp>864e5),_=p?g:N(h)&&Math.abs(n-h)>864e5,v=!1,f=u,m=!l||!!p,y=l,b=!m&&!e&&this.wh(n,c);if(b){(b=this.Lh(n))||rl.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.Uh();l=w[1],h=w[2]}if(m||b||_){f=!1;var x=p&&!g;l=x?p.sessionId:this.Eh(),d=this.Sh(),rl.info("new session ID assigned",{sessionId:l,windowId:d,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_}}),h=x?p.sessionStartTimestamp:n,this.xh=void 0,v=!0}else d||(d=this.Sh(),v=!0),(f=f||l!==y)&&(rl.info("adopted cross-tab session id",{sessionId:l,windowId:d}),v=!0);var k=N(c)&&e&&!_?c:n,E=N(h)?h:(new Date).getTime();this.Oh(d),this.Mh(l,k,E),e||this.Th();var $={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:_,crossTabAdoption:f};return v&&this.gh.forEach(e=>e(l,d,$)),{sessionId:l,windowId:d,sessionStartTimestamp:E,changeReason:v?$:void 0,lastActivityTimestamp:c}}Th(){this.bh||(clearTimeout(this.jh),this.jh=setTimeout(()=>{if(!this.bh)if(this.Lh((new Date).getTime())){var e=this.$h;this.resetSessionId(),this._h.emit("forcedIdleReset",{idleSessionId:e})}else this.Th()},1.1*this.sessionTimeoutMs))}}function ru(){return(ru=m(function*(){var e=null==o?void 0:o.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return M(i)&&i.length>0?i:void 0}catch(e){return void tl.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function rc(e,t,i){return iY({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var rd="custom",rp="i.posthog.com",rg=/^\/static\//,r_=["/s/","/e/","/i/"];class rv{constructor(e){this.zh={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+rp,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}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":rd),this.zh[this.apiHost]}qh(e){if(rg.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}Hh(e){var t=iJ(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}Gh(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;if(r&&(s=r(new URL((null==(o=iJ(i))?void 0:o.href)||i)).toString()),r&&"api"===e&&r_.some(e=>0===t.indexOf(e))){var n=this.Hh(s);if(n){var o,a,l=this.apiHost,h=this.Wh;(null==(a=h)?void 0:a.apiHost)===l&&h.rewriteRequestPath===r||(h={apiHost:l,rewriteRequestPath:r,urls:new Set},this.Wh=h),h.urls.add(n)}}return s}isIngestionEndpoint(e){var t=this.Wh,i=this.Hh(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.Gh(e,t,this.uiHost+t);if("flags"===e)return this.Gh(e,t,this.flagsApiHost+t);if("assets"===e){var i=this.qh(t);if(i)return this.Gh(e,t,""+i+t)}if(this.region===rd)return this.Gh(e,t,this.apiHost+t);var s=rp+t;switch(e){case"assets":return this.Gh(e,t,"https://"+this.region+"-assets."+s);case"api":return this.Gh(e,t,"https://"+this.region+"."+s)}}}var rf=th("[Surveys]"),rm={ignoreConditions:!1,ignoreDelay:!1,displayType:"popover"}
1,ry=th("[PostHog ExternalIntegrations]"),rb={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class rw{constructor(e){this._instance=e}Gt(e,t){var i;null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return ry.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this;for(var i of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))!function(){var e,s,r,n=i[0],o=i[1];!o||null!=(e=_.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.Gt(rb[n],()=>{var e;null==(e=_.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!o&&null!=(s=_.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=_.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())}()}}class rx{constructor(e,t){this.l=e,this.Ot=t,this.Vh=new Map,this.Dt=!1}add(e){var t=this;return m(function*(){if(t.Dt)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.Vh.has(e.name))throw Error('Browser extension "'+e.name+'" is already registered');t.Vh.set(e.name,e);try{var i=e.setup(t.Ot);i&&(yield i)}catch(i){var s=t.Vh.get(e.name)===e;s&&t.Vh.delete(e.name),t.l.error('Failed to set up browser extension "'+e.name+'"',i),s&&t.Jh(e)}})()}getExtension(e){return this.Vh.get(e)}dispose(){if(!this.Dt){this.Dt=!0;var e=Array.from(this.Vh.values()).reverse();for(var t of(this.Vh.clear(),e))this.Jh(t)}}Jh(e){try{var t=null==e.dispose?void 0:e.dispose();t&&O(t.then)&&t.then(void 0,t=>{this.l.error('Failed to dispose browser extension "'+e.name+'"',t)})}catch(t){this.l.error('Failed to dispose browser extension "'+e.name+'"',t)}}}class rk{constructor(e){this._instance=e}initialize(){}get(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);var i={};for(var s of e){var r=null==t?void 0:t.get_property(s);A(r)||(i[s]=r)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}}var rE="extensionsRemoteConfig";class r${constructor(e){this.Dt=!1,this.instance=e,this.l=tl,this.Yh=e.Kh,this.kv=new rk(e),this.onEvent=e=>sp(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.l.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.Dt)return sp(()=>{});var t=t=>{try{e(t)}catch(e){this.l.error("Browser extension remote config listener failed",e)}},i=this.instance.Xh.on(rE,t);return this.Yh&&t(this.Yh),sp(i)},this.Qh=new rx(tl.createLogger("[BrowserExtensions]"),this)}get logger(){return this.l}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!=(e=this.instance.get_property(tf))?e:this.distinctId}get deviceId(){var e=this.instance.get_property(tf);return"string"==typeof e?e:void 0}get library(){return{name:v.LIB_NAME,version:v.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!=(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s,r=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!=(t=null==r?void 0:r.sessionId)?t:"",windowId:null!=(i=null==r?void 0:r.windowId)?i:"",sessionStartTimestamp:null!=(s=null==r?void 0:r.sessionStartTimestamp)?s:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.Qh.add(e)}getExtension(e){return this.Qh.getExtension(e)}capture(e,t,i){var s=this;return m(function*(){i?s.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):s.instance.capture(e,t)})()}registerDynamicEventProperties(e){return sp(this.instance.Zh(e))}handleRemoteConfig(e){this.Dt||(this.Yh=e,this.instance.Xh.emit(rE,e))}sendRequest(e,t){var i=this;return m(function*(){void 0===t&&(t={});var s,r=i.instance.requestRouter.endpointFor(null!=(s=t.target)?s:"api",e),n={method:t.method,url:t.query?sQ(r,t.query):r,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,compressionFallback:"flags"===t.target&&"best-available"===t.compression?E.Base64:void 0,timestampMode:t.sentAt};return"sendBeacon"===t.transport?(i.instance._send_request(n),{statusCode:202}):new Promise(e=>{n.callback=e,i.instance._send_request(n)})})()}dispose(){this.Dt||(this.Dt=!0,this.Qh.dispose())}}var rS,rP,rI={},rC=0,rF=()=>{}
1,rO='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',rT="Surveys module not available",rR="sanitize_properties is deprecated. Use before_send instead",rA="Invalid value for property_denylist config: ",rM=/^[A-Za-z0-9_-]{1,400}$/,rL=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,rD=["token","distinct_id",tY],rB="posthog",rN=!sJ&&-1===(null==p?void 0:p.indexOf("MSIE"))&&-1===(null==p?void 0:p.indexOf("Mozilla")),rq=e=>{var t,i;return y({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!M(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of ir)if(i===s)return!1;return!0}(null==a?void 0:a.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:rF,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:l&&M(null==l?void 0:l.search)&&-1!==l.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==r||null==(t=r.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){tl.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:t1,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:rF},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:iL,ignore_text_selection:!0}
1:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:(i={},e&&"unset"!==e&&("2025-11-30">e||(i.strictMinimumDuration=!0),"2026-05-30">e||(i.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(i.streamNetworkBody=!0),"2026-08-30">e||(i.captureJsonLd=!0)),i),external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)})},rj=[["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"]],rG=e=>{var t={};for(var i of rj){var s=i[0],r=i[1];A(e[s])||(t[r]=e[s])}var n=ie({},t,e),o=e.__preview_external_dependency_versioned_paths;return A(o)||(A(e.strict_script_versioning)&&(n.strict_script_versioning=!!o),M(o)&&A(e.asset_host)&&(n.asset_host=o)),F(e.property_blacklist)&&(A(e.property_denylist)?n.property_denylist=e.property_blacklist:F(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:tl.error(rA+e.property_denylist)),n};class rV{constructor(){this.__forceAllowLocalhost=!1}get tl(){return this.__forceAllowLocalhost}set tl(e){tl.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class rH{el(e){if(e){var t=this.Vh.indexOf(e);-1!==t&&this.Vh.splice(t,1)}}il(e,t){return this.el(e),this.Vh.push(t),null==t.initialize||t.initialize(),t}rl(){return this.config.cookieless_mode===tZ||this.config.cookieless_mode===tX&&this.consent.isRejected()}sl(){if(!(this.nl||this.config.reuseAnonymousId||this.config.segment||this.rl())){var e,t,i,s="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(s||this.config.disable_persistence)&&(this.ol||(s?(e="persistence is set to '"+this.config.persistence+"'",t="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.nl=!0,console.warn("[PostHog.js]",e+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+t+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+i)))}}al(){if(!this.rl()&&this.get_distinct_id()===tW){var e=this.persistence;if(e){this.hl()||e.load(!0);var t=this.get_distinct_id();if(!t||t===tW){var i=this.config.get_device_id(ip());this.register({distinct_id:i,$device_id:i}),e.set_property(tq,tQ)}this.ll()}}}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.ul=!1,this.dl=!1,this.webPerformance=new rV,this.vl=!1,this.version=v.LIB_VERSION,this.cl=new Set,this._l="",this.Xh=new ra,this.Vh=[],this.pl=[],this.ol=!1,this.nl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rq(),this.SentryIntegration=iG,this.sentryIntegration=e=>{var t;return t=ij(this,e),{name:iq,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.fl=!1,this.gl=null,this.ml=null,this.bl=null,this.scrollManager=new rr(this),this.pageViewM
vendor: 8,033 bytes, line 1
1anager=new iV(this),this.rateLimiter=new s_(this),this.requestRouter=new rv(this),this.consent=new iM(this),this.externalIntegrations=new rw(this);var e,t=null!=(e=rH.__defaultExtensionClasses)?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var s=M(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=M(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>tl.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==rB){var s,r=null!=(s=rI[i])?s:new rH;return r._init(e,t,i),rI[i]=r,rI[rB][i]=r,r}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var s,n,o,a,l=M(e)?e.trim():"";if(!l)return tl.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return l!==(null==(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('"+l+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=rq(t.defaults),t.debug=this.wl(t.debug),this.yl=t,this.$l=[],t.person_profiles?this.ml=t.person_profiles:t.process_person&&(this.ml=t.process_person);var h=rq(t.defaults),u=rG(t),c=ie({},h,u,{name:i,token:l});T(h.rageclick)&&T(u.rageclick)&&(c.rageclick=ie({},h.rageclick,u.rageclick)),T(h.session_recording)&&T(u.session_recording)&&(c.session_recording=ie({},h.session_recording,u.session_recording)),this.set_config(c),this.config.on_xhr_error&&tl.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:su;var d=this.hl();if(this.persistence=new sh(this.config,d),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sh(y({},this.config,{persistence:"sessionStorage"}),d,!1),this._l="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!d&&iA.ro()){var p=iA.oo(this._l);F(p)&&p.forEach(e=>{M(e)&&this.cl.add(e)})}else iA.mr(this._l);var g=y({},this.persistence.props),_=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.xl=new rt(e=>this.El(e),this.config.request_queue_config),this.Sl=new rs(this),this.__request_queue=[];var f=this.rl();f||(this.sessionManager=new rh(this),this.sessionPropsManager=new ro(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.Tl()})),this.kl(),this.config.__preview_deferred_init_extensions?(tl.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Rl(f)},0)):(tl.info("Initializing extensions synchronously"),this.Rl(f)),v.DEBUG=v.DEBUG||this.config.debug,v.DEBUG&&tl.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:g,s:_}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=y({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var m=null==(n=t.bootstrap)?void 0:n.distinctID;if(this.ol=!!m&&!L(m),void 0!==(null==(o=t.bootstrap)?void 0:o.distinctID)){var b=t.bootstrap.distinctID,w=this.get_distinct_id(),x=this.persistence.get_property(tq);if(t.bootstrap.isIdentifiedID&&null!=w&&w!==b&&x===tQ)this.identify(b);else if(t.bootstrap.isIdentifiedID&&null!=w&&w!==b&&x===t0)tl.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 k=this.config.get_device_id(ip()),E=t.bootstrap.isIdentifiedID?k:b;this.persistence.set_property(tq,t.bootstrap.isIdentifiedID?t0:tQ),this.register({distinct_id:b,$device_id:E})}}if(f)this.register_once({distinct_id:tW,$device_id:null},"");else if(!this.get_distinct_id()){var $=this.config.get_device_id(ip());this.register_once({distinct_id:$,$device_id:$},""),this.persistence.set_property(tq,tQ)}return io(r,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),io(r,"pageshow",()=>{var e;this.ul=!1,this.dl||null==(e=this.Sl)||e.resume()}),t.segment?iN(this,()=>this.Pl()):this.Pl(),O(this.config._onCapture)&&this.config._onCapture!==rF&&(tl.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&tl.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 ru.apply(this,arguments)})().then(e=>{e&&this.register({[tm]:e})}).catch(rF),this}Il(e){return M(e.name)&&O(e.setup)}Ol(e,t){this.Il(e)?t.push(()=>{this.Cl().add(e).catch(()=>null==e.dispose?void 0:e.dispose()).catch(t=>{tl.error('Failed to dispose browser extension "'+e.name+'"',t)})}):this.Vh.push(e)}kl(){var e,t,i,s,r,n,o=null!=(e=null==(t=this.config.__extensionClasses)?void 0:t.featureFlags)?e:null==(i=rH.__defaultExtensionClasses)?void 0:i.featureFlags;o&&(this.featureFlags&&this.featureFlags instanceof o||(null==(s=this.Al)||s.call(this),this.Al=void 0,this.featureFlags=new o(this)),O(this.featureFlags.onReloading)&&O(this.featureFlags.setup)?this.Al||(this.Al=this.featureFlags.onReloading(()=>{this.Xh.emit("featureFlagsReloading",!0)}),this.Cl().add(this.featureFlags)):null==(r=(n=this.featureFlags).initialize)||r.call(n))}Rl(e){var t,i,s,r,n,o,a,l=performance.now(),h=y({},rH.__defaultExtensionClasses,this.config.__extensionClasses),u=[];h.exceptions&&this.Vh.push(this.exceptions=null!=(t=this.exceptions)?t:new h.exceptions(this)),h.historyAutocapture&&this.Vh.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Vh.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.Vh.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!e&&this.Vh.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||u.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),h.autocapture&&this.Ol(this.autocapture=new h.autocapture(this),u),h.surveys&&this.Ol(this.surveys=null!=(i=this.surveys)?i:new h.surveys(this),u),h.logs&&this.Ol(this.logs=null!=(s=this.logs)?s:new h.logs(this),u),h.metrics&&this.Vh.push(this.metrics=null!=(r=this.metrics)?r:new h.metrics(this)),h.conversations&&this.Vh.push(this.conversations=null!=(n=this.conversations)?n:new h.conversations(this)),h.productTours&&this.Vh.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Vh.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Vh.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Vh.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Vh.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,iD)),h.toolbar&&this.Vh.push(this.toolbar=null!=(o=this.toolbar)?o:new h.toolbar(this)),h.experiments&&this.Vh.push(this.experiments=null!=(a=this.experiments)?a:new h.experiments(this)),this.Vh.forEac
1h(e=>{e.initialize&&u.push(()=>{null==e.initialize||e.initialize()})}),u.push(()=>{if(this.Ml){var e=this.Ml;this.Ml=void 0,this.Vh.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.Dl(u,l)}Dl(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Dl(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){tl.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[tJ]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[tK]:s}),this.config.__preview_deferred_init_extensions&&tl.info("PostHog extensions initialized ("+s+"ms)")}Yt(e){var t;if(!a||!a.body)return tl.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Yt(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Ml=e),this.Kh=e,this.compression=void 0,e.ok){var i,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=x(s.supportedCompression,su)?su:x(s.supportedCompression,sc)?sc:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.ml?this.ml:t1}),null==(t=this.Nl)||t.handleRemoteConfig(e),this.Vh.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}Pl(){try{this.config.loaded(this)}catch(e){tl.critical("`loaded` function failed",e)}if(this.Fl(),this.config.internal_or_test_user_hostname&&null!=l&&l.hostname){var e=l.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.rl())&&this.Ul()},1),this.Bl=new sf(this),this.Bl.load()}Fl(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.xl)||e.enable())}_dom_loaded(){this.is_capturing()&&t7(this.__request_queue,e=>this.El(e)),this.__request_queue=[],this.Fl()}_handle_unload(){var e,t,i,s,r;this.ul=!0,null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.Ll()&&this.capture(t8),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.xl)||s.unload(),null==(r=this.Sl)||r.unload()):this.Ll()&&this.capture(t8,null,{transport:"sendBeacon"})}_send_request(e){var t;this.__loaded?rN?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=y({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!=(t=this.compression)?t:e.compressionFallback:e.compression,(A(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,s,r,n,o=y({},e);o.timeout=o.timeout||6e4;var a,l,h,u,c,p=null!=(s=o.transport)?s:"fetch";"sendBeacon"===p&&A(o.compression)&&o.data&&(o.compression=sc),"POST"===o.method&&o.data&&("capture-body"===o.timestampMode?o.data={api_key:null!=(l=null==(c=(u=(F(a=o.data)?a:[a]).map(e=>y({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0])||null==(h=c.properties)?void 0:h.token)?l:null==c?void 0:c.token,batch:u,sent_at:(new Date).toISOString()}:"body"===o.timestampMode&&(t=o.data,void 0===i&&(i=(new Date).toISOString()),o.data=F(t)?t.map(e=>y({},e,{sent_at:i})):y({},t,{sent_at:i}))),o.url=s9(o.url,o.method,o.compression,o.timestampMode);var g=re.filter(e=>!o.disableTransport||!e.transport||!o.disableTransport.includes(e.transport)),_=null!=(r=null==(n=function(e,t){for(var i=0;e.length>i;i++)if(t(e[i]))return e[i]}(g,e=>e.transport===p))?void 0:n.method)?r:g[0].method;if(!_)throw Error("No available transport method");var v=e=>{try{_(e)}catch(e){s8(e)?tl.warn(e):tl.error(e),null==o.callback||o.callback({statusCode:0,error:e})}};"sendBeacon"!==p&&o.data&&o.compression===su&&d&&"u">typeof Promise&&!sX?s3(o).then(e=>{v(e)}).catch(t=>{ts(t)?(sX=!0,v(y({},o,{compression:void 0,url:s9(e.url,e.method,void 0,e.timestampMode)}))):((e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return ts(e)||t===te})(t)&&(sX=!0),v(o))}):_(o)})(y({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(s=this.config).on_request_error)||i.call(s,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}El(e){this.Sl?this.Sl.retriableRequest(e):this._send_request(e)}_execute_array(e){rC++;try{var t,i=[],s=[],r=[];t7(e,e=>{if(e)if(F(t=e[0]))r.push(e);else if(O(e))try{e.call(this)}catch(t){tl.error("Error executing queued PostHog call",e,t)}else F(e)&&"alias"===t?i.push(e):F(e)&&-1!==t.indexOf("capture")&&O(this[t])?r.pu
1sh(e):s.push(e)});var n=function(e,t){t7(e,function(e){try{if(F(e[0])){var i=t;t9(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){tl.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{rC--}}push(e){if(rC>0&&F(e)&&M(e[0])){var t=rH.prototype[e[0]];O(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}jl(){var e,t=null==(e=this.persistence)?void 0:e.get_property(tw);return M(t)&&rL.test(t)?{value:t,delivered:!1}:T(t)&&M(t.value)&&rL.test(t.value)?{value:t.value,delivered:!0===t.delivered}:void 0}zl(e,t,i,s){if(this.persistence){this.persistence.refreshKey(tw);var r=this.jl();if(!s){if(i)return M(t)&&rL.test(t)?(t!==(null==r?void 0:r.value)&&this.persistence.register({[tw]:{value:t,delivered:!1}}),{value:t,pending:t!==(null==r?void 0:r.value)||!r.delivered}):void this.persistence.unregister(tw);if(M(e)&&rM.test(e)){if((null==r?void 0:r.value.split(".")[3])===e)return{value:r.value,pending:!r.delivered};var n="fb.1."+Date.now()+"."+e;return this.persistence.register({[tw]:{value:n,delivered:!1}}),{value:n,pending:!0}}return r?{value:r.value,pending:!r.delivered}:void 0}this.persistence.unregister(tw)}}ql(e){if(this.persistence){this.persistence.refreshKey(tw);var t=this.jl();(null==t?void 0:t.value)!==e||t.delivered||this.persistence.register({[tw]:{value:e,delivered:!0}})}}capture(e,t,i){var s,r,n,o,a,l,h,u,c,d;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.xl){if(this.is_capturing())if(!A(e)&&M(e)){this.al();var p=!this.config.opt_out_useragent_filter&&this._is_bot();if(!p||this.config.__preview_capture_bot_pageviews){var g=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==g||!g.isRateLimited){null!=t&&t.$current_url&&!M(null==t?void 0:t.$current_url)&&(tl.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i._originatedFromCaptureException||tl.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&&(Z=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 _=new Date,v=(null==i?void 0:i.timestamp)||_,f=e3(null==i?void 0:i.uuid,ip),m={uuid:f,event:e,properties:this.calculateEventProperties(e,t||{},v,f)};e===t5&&this.config.__preview_capture_bot_pageviews&&p&&(m.event="$bot_pageview",m.properties.$browser_type="bot"),g&&(m.properties.$lib_rate_limit_remaining_tokens=g.remainingTokens);var b="$feature_flag_called"===e&&!1===m.properties.$feature_flag_has_experiment&&!0===this.get_property(tT);(null==i?void 0:i.$set)&&!b&&(m.$set=null==i?void 0:i.$set);var w=T(null==t?void 0:t.$set)?t.$set:void 0,x=!(null==i||!i.$set)&&tb in i.$set,k=x||!!w&&tb in w,E=x?null==i||null==(s=i.$set)?void 0:s[tb]:null==w?void 0:w[tb],$=F(null==t?void 0:t.$unset)?t.$unset:[],S=(null==i?void 0:i.$unset)||[],P=-1!==$.indexOf(tb)||-1!==S.indexOf(tb),I=this.zl(null==(r=Z)?void 0:r.fbclid,E,k,P);I&&!0===m.properties.$process_person_profile&&I.pending&&!k&&!b&&(m.$set=y({[tb]:I.value},m.$set));var C=null==i?void 0:i.$unset;C&&(m.$unset=C);var O=b?void 0:this.Hl(null==i?void 0:i.$set_once,e!==t4,e===t6);if(O&&(m.$set_once=O),null!=i&&i._noTruncate||(h=this.config.properties_string_max_length,u=m,c=e=>M(e)?e.slice(0,h):e,d=new Set,m=function e(t,i){if(t!==Object(t))return c?c(t):t;if(!d.has(t)){var s;if(d.add(t),F(t))s=[],t7(t,t=>{s.push(e(t))});else{var r={};t9(V(t)?is(t):t,(t,i)=>{d.has(t)||(r[i]=e(t,i))}),s=r}return s}}(u)),m.timestamp=v,A(null==i?void 0:i.timestamp)||(m.properties.$event_time_override_provided=!0,m.properties.$event_time_override_system_time=_),b&&(m.properties=(L=m.properties,void 0===(B=rD)&&(B=[]),N={},q=e=>{void 0!==L[e]&&(N[e]=L[e])},e9.forEach(q),B.forEach(q),N)),"survey dismissed"===e||e===sd){var L,B,N,q,j,G,H,z=null==t?void 0:t.$survey_id,U=null==t?void 0:t.$survey_iteration;(e=>{try{var t="seenSurvey_"+(e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){rf.error("Failed to persist survey seen state",e)}})({id:z,current_iteration:U}),m.$set=y({},m.$set,{[(j={id:z,current_iteration:U},H="$survey_"+(G=e===sd?"responded":"dismissed")+"/"+j.id,j.current_iteration&&j.current_iteration>0&&(H="$survey_"+G+"/"+j.id+"/"+j.current_iteration),H)]:!0})}else"survey shown"===e&&(m.$set=y({},m.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var W=null==t?void 0:t.$product_tour_type;W&&(m.$set=y({},m.$set,{["$product_tour_last_seen_date/"+W]:(new Date).toISOString()}))}var Y=y({},m.properties.$set,m.$set);if(R(Y)||this.setPersonPropertiesForFlags(Y),!D(this.config.before_send)){var J=this.G(m);
1if(!J)return;(m=J).uuid=e3(m.uuid,ip)}var K=null!=(n=null==(o=m.$set)?void 0:o[tb])?n:T(null==(a=m.properties)?void 0:a.$set)?m.properties.$set[tb]:void 0,X=null!=I&&I.pending&&K===I.value?I.value:void 0;this.Xh.emit("eventCaptured",m);var Z,Q,ee=null!=(l=null==i?void 0:i._url)?l:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),et=y({method:"POST",url:ee,data:m,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(ee)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},X?{fireCallbackOnDrop:!0,callback:e=>{e.statusCode>=200&&300>e.statusCode&&this.ql(X)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||X?(!et.transport&&!et.callback&&R(null!=(Q=this.config.request_headers)?Q:{})&&this.ul&&(et.transport="sendBeacon"),this.El(et)):this.xl.enqueue(et),m}tl.critical("This capture call is ignored due to client rate limiting.")}}else tl.error("No event name provided to posthog.capture")}else tl.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}getExtension(e){var t;return null==(t=this.Nl)?void 0:t.getExtension(e)}Cl(){var e;return null!=(e=this.Nl)?e:this.Nl=new r$(this)}Zh(e){this.pl.push(e);var t=!0;return()=>{if(t){t=!1;var i=this.pl.indexOf(e);-1!==i&&this.pl.splice(i,1)}}}Gl(e){var t,i,s;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this.bl=null,this.persistence.get_property(tq)===tQ&&(null==(s=this.sessionPersistence)||s.clear(),this.cl.clear(),this.Wl()),null==(i=this.featureFlags)||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this.Gl();var o,h=n?void 0:this.persistence.remove_event_timer(e),u=y({},t);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.rl()&&(u[tY]=!0),"$snapshot"===e){var c=y({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=c.distinct_id,(!M(u.distinct_id)&&!B(u.distinct_id)||L(u.distinct_id))&&tl.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var d,g=function(e,t,i,s){if(void 0===s&&(s=!1),!p)return{};var n,o,a,h,u,c=e?[...iQ,...t||[]]:[],d=function(e){for(var t=0;eZ.length>t;t++){var i=eZ[t],s=i[1],r=i[0].exec(e),n=r&&(O(s)?s(r,e):s);if(n)return n}return["",""]}(p),g=d[0],_=d[1],f=function(e){for(var t=0;e1.length>t;t++){var i=e1[t],s=i[1],r=i[2],n=e.match(i[0]);if(n){var o=r&&e.match(r)||n;return[s,(null==o?void 0:o[1])||""]}}return["",""]}(p),m=f[0],y=f[1],b=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},w={};A(i)||(w.detectGoogleSearchApp=i);var x={},k=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,E=null==(o=navigator)?void 0:o.maxTouchPoints,$=null==r||null==(a=r.screen)?void 0:a.width,S=null==r||null==(h=r.screen)?void 0:h.height,P=null==r?void 0:r.devicePixelRatio;A(k)||(x.userAgentDataPlatform=k),A(E)||(x.maxTouchPoints=E),A($)||(x.screenWidth=$),A(S)||(x.screenHeight=S),A(P)||(x.devicePixelRatio=P);var I,C,F,T,R,M,L=ie(ii({$os:g,$os_version:_,$browser:eJ(p,navigator.vendor,b,w),$webview_app:m,$webview_app_version:y,$device:eQ(p),$device_type:(M=eQ(p))===X||M===K||"Kobo"===M||"Kindle Fire"===M||M===eP?J:M===ev||M===em||M===ef||M===eE?"Console":M===Q?"Wearable":M?W:"Android"===(null==x?void 0:x.userAgentDataPlatform)&&(null!=(C=null==x?void 0:x.maxTouchPoints)?C:0)>0?600>Math.min(null!=(F=null==x?void 0:x.screenWidth)?F:0,null!=(T=null==x?void 0:x.screenHeight)?T:0)/(null!=(R=null==x?void 0:x.devicePixelRatio)?R:1)?W:J:"Desktop",$timezone:function(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:iX(s?e8(null==l?void 0:l.href):null==l?void 0:l.href,c,i1),$host:null==l?void 0:l.host,$pathname:null==l?void 0:l.pathname,$raw_user_agent:p.length>1e3?p.substring(0,997)+"...":p,$browser_version:eX(p,navigator.vendor,b,w),$browser_language:i8(),$browser_language_prefix:"string"==typeof(I=i8())?I.split("-")[0]:void 0,$screen_height:null==r?void 0:r.screen.height,$screen_width:null==r?void 0:r.screen.width,$viewport_height:null==r?void 0:r.innerHe
1ight,$viewport_width:null==r?void 0:r.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&&(L.$sdk_dist_channel=v.SDK_DIST_CHANNEL),L}(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 _=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime(),!0),f=_.windowId;u.$session_id=_.sessionId,u.$window_id=f}this.sessionPropsManager&&ie(u,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&ie(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=null==(o=this.Sl)?void 0:o.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===rd&&(u.$lib_custom_api_host=this.config.api_host),d=e!==t5||n?e!==t8||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),u=ie(u,d),e===t5&&a&&(u.title=a.title),!A(h)){var m=i.getTime()-h;u.$duration=parseFloat((m/1e3).toFixed(3))}p&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),w=this.sessionPersistence.properties(),x=u.$groups,k=b.$groups;T(x)&&!R(x)&&(u.$groups=y({},T(k)?k:{},x)),t9(["$referrer","$referring_domain"],e=>{e in b&&delete w[e]});var E={};if(this.pl.length>0)for(var $ of this.pl.slice())try{ie(E,$())}catch(e){tl.error("Failed to produce browser extension event properties",e)}(u=ie({},g,b,w,y({},E,u))).$is_identified=this._isIdentified(),F(this.config.property_denylist)?t9(this.config.property_denylist,function(e){delete u[e]}):tl.error(rA+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(tl.error(rR),u=S(u,e));var P=this.Vl();return u.$process_person_profile=P,P&&!n&&this.Jl("_calculate_event_properties"),u}Hl(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.Vl()||this.vl&&!i)return e;var s,r=ie({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(tl.error(rR),r=n(r,"$set_once")),t&&(this.vl=!0),R(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t,i;null==(t=this.persistence)||t.syncCookieProperties(),this.Gl(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e=>this.cl.add(e)),this.Wl()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this.cl.delete(e),this.Wl()}Yl(e,t){this.register({[e]:t})}Tl(){this.cl.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.cl.clear(),this.Wl()}Wl(){var e;if(this._l)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e.Lo||!iA.ro())iA.mr(this._l);else{var t=[];this.cl.forEach(e=>t.push(e)),t.length>0?iA.gr(this._l,t):iA.mr(this._l)}}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())?e:[]}isFeatureEnabled(e,t){var i,s;return null!=(i=null==(s=this.featureFlags)?void 0:s.isFeatureEnabled(e,t))?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var s;null==(s=this.featureFlags)||s.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var s;return void 0===t&&(t=!1),null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.Xh.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:rT}),()=>{})}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:rT})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:rT})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=rm),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!=(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))?t:{visible:!1,disabledReason:rT}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!=(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:rT})}Kl(e){return!e||L(e)?(tl.critical("Unique user id has not been set in posthog.identify"),!1):e===tW?(tl.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(tl.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return tl.uninitializedWarning("posthog.identify");if(B(e)&&(e=e.toString(),tl.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Kl(e)&&this.Jl("posthog.identify")){this.al();var s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this.Gl(!1),o=this.persistence.$a(),a=!1;try{var l=this.get_distinct_id();this.register({$user_id:e}),this.get_property(tf)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),e!==l&&e!==this.get_property(ty)&&(this.unregister(ty),this.register({distinct_id:e}));var h=(this.persistence.get_property(tq)||tQ)===tQ,u=e!==l,c=!u&&h;if(u&&h){var d,p=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:l};this.persistence.set_property(tq,t0),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.xa(),this.capture(t6,p,{$set:t||{},$set_once:i||{}}),this.bl=rc(e,t,i),null==(d=this.featureFlags)||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(c){this.persistence.set_property(tq,t0);var g=t||{},_=i||{};this.setPersonPropertiesForFlags({$set:g,$set_once:_},!1),this.config.cookieWinsOnConflict&&this.persistence.xa(),this.capture("$set",{$set:g,$set_once:_}),this.bl=rc(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);u||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(tD)):c&&(t||i)&&this.reloadFeatureFlags(),a=!0}finally{o&&this.persistence.Ta(a)}}}setPersonProperties(e,t){if((e||t)&&this.Jl("posthog.setPersonProperties")){var i=rc(this.get_distinct_id(),e,t);this.bl!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.bl=i):tl.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(F(e)?e:[e]).filter(e=>M(e)&&e.length>0);0!==i.length&&this.Jl("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.bl=null)}group(e,t,i){var s;if(e&&t){null==(s=this.persistence)||s.syncCookieProperties(),this.Gl();var r=this.getGroups(),n=r[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},r,{[e]:t})}),(n||i)&&this.Vl()){var o={$group_type:e,$group_key:t};i&&(o.$group_set=i),this.capture(t4,o)}i&&this.setGroupPropertiesForFlags({[e]:i}),n&&!i&&this.reloadFeatureFlags()}else tl.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this.Jl("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t=q(e)?e:null==e?void 0:e.resetDeviceID,i=q(e)||null==e?void 0:e.bootstrap;this.Xl(t,!1,i)}Xl(e,t,i){if(void 0===t&&(t=!1),tl.info("reset"),!this.__loaded)return tl.uninitializedWarning("posthog.reset");var s,r,n,o,a,l,h,u,c,d,p,g,_,v,f,m,b,w,x=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(s=this.yl)?void 0:s.bootstrap)||{},null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this._shouldDisableFlags());var k=this.get_property(tf),E=this.get_property(tm),$=this.get_property(tE);null==(n=this.sessionRecording)||n.flushBeforeIdentityReset();var S=this.is_capturing();this.consent.reset(),t||!S||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 P=null==(o=this.persistence)||null==o.$a?void 0:o.$a(),I=!1;try{if(null==(a=this.persistence)||a.clear(),null==(l=this.sessionPersistence)||l.clear(),this.cl.clear(),this.Wl(),A($)||null==(v=this.persistence)||v.register({[tE]:$}),null==(h=this.surveys)||h.reset(),null==(u=this.featureFlags)||u.reset(),null==(c=this.conversations)||c.reset(),null==(d=this.logs)||d.reset(),null==(p=this.metrics)||p.reset(),null==(g=this.persistence)||g.set_property(tq,tQ),null==(_=this.sessionManager)||_.resetSessionId(),this.bl=null,this.config.cookieless_mode===tZ)this.register_once({distinct_id:tW,$device_id:null},"");else{var C=this.config.get_device_id(ip());this.register_once({distinct_id:C,$device_id:e?C:k},""),e||A(E)||this.register({[tm]:E})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(void 0===i.distinctID||this.rl()||(null==(b=this.persistence)||b.set_property(tq,i.isIdentifiedID?t0:tQ),this.register({distinct_id:i.distinctID})),null==(f=this.featureFlags)||f.initialize(),!(A(x)||null!=(m=this.sessionManager)&&m.setBootstrapSessionId(x,!0)))){var F=y({},i);delete F.sessionID,this.config.bootstrap=F}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,I=!0}finally{P&&(null==(w=this.persistence)||null==w.Ta||w.Ta(I))}this.reloadFeatureFlags()}shutdown(e){var t=this;return m(function*(){var e,i,s,r,n,o,a,l;if(t.__loaded){t.dl=!0,t.Cl().dispose(),null==(e=t.sessionRecording)||e.dispose(),null==(i=t.logs)||i.flushLogs("sendBeacon"),null==(s=t.metrics)||s.flush("sendBeacon"),null==(r=t.xl)||r.unload(),null==(n=t.Sl)||n.unload();try{null==(l=t.featureFlags)||l.destroy()}catch(e){tl.error("Error while destroying feature flags",e)}null==(o=t.persistence)||o.destroy(),null==(a=t.sessionPersistence)||a.destroy()}else tl.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i._onIdentityChanged()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(e=this.conversations)||e._onIdentityCleared()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&i){var r,n=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(t_)?(tl.critical("Attempting to create alias for existing People user - aborting."),-2):this.Jl("posthog.alias")?(A(t)&&(t=this.get_distinct_id()),e!==t?(this.Yl(ty,e),this.capture("$create_alias",{alias:e,distinct_id:t}
1)):(tl.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(T(e)){ie(this.config,rG(e));var i=this.hl();null==(s=this.persistence)||s.update_config(this.config,t,i),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sh(y({},this.config,{persistence:"sessionStorage"}),i,!1);var s,r,n,o,a,l,h,u,c,d,p,g,_,f=this.wl(this.config.debug);q(f)&&(this.config.debug=f),q(this.config.debug)&&(this.config.debug?(v.DEBUG=!0,iw.ro()&&iw.gr("ph_debug",!0),tl.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(v.DEBUG=!1,iw.ro()&&iw.mr("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this._shouldDisableFlags()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(o=this.exceptions)||o.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(h=this.autocapture)||h.startIfEnabled(),null==(u=this.heatmaps)||u.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(_=this.historyAutocapture)||_.startIfEnabledOrStop()),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(p=this.surveys)||p.loadIfEnabled(),this.ll(),null==(g=this.externalIntegrations)||g.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&iN(this,rF,!1)}}_overrideSDKInfo(e,t){v.LIB_NAME=e,v.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),a.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),a.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){try{if(!this.exceptions)return;var i=Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(y({},s,t))}catch(e){return}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!=(e=null==(t=this.logs)?void 0:t.logger)?e:rH.Ql}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!=(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:rB;return t!==rB&&(t=rB+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(tq))===t0||(null==(t=this.sessionPersistence)?void 0:t.get_property(tq))===t0}Vl(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===t1&&!this._isIdentified()&&R(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[ty])&&(null==(t=this.persistence)||null==(t=t.props)||!t[tU]))}Ll(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Vl()||this.Jl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Jl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Jl(e){return"never"===this.config.person_profiles?(tl.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.sl(),this.Yl(tU,!0),!0)}
1hl(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==tX)}ll(){var e,t,i,s,r,n=this.hl();return this.is_capturing()||null==(i=this.logs)||i._onOptOut(),(null==(e=this.persistence)?void 0:e.Lo)!==n&&(null==(s=this.persistence)||s.set_disabled(n)),(null==(t=this.sessionPersistence)?void 0:t.Lo)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n&&(this.cl.clear(),this.Wl()),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==tZ){if(this.rl()){null==(r=this.sessionRecording)||r.dispose({discardBufferedEvents:!0}),this.Xl(!0,!0),null==(n=this.sessionManager)||n.destroy(),null==(o=this.pageViewManager)||o.destroy(),this.sessionManager=new rh(this),this.pageViewManager=new iV(this),this.persistence&&(this.sessionPropsManager=new ro(this,this.sessionManager,this.persistence));var i,s,r,n,o,a,l,h,u,c=null!=(a=null==(l=this.config.__extensionClasses)?void 0:l.sessionRecording)?a:null==(h=rH.__defaultExtensionClasses)?void 0:h.sessionRecording;c&&(this.sessionRecording=this.il(this.sessionRecording,new c(this)),this.Kh&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.Kh)
1))}this.consent.optInOut(!0),this.ll(),this.Fl(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==tX&&(null==(i=this.surveys)||i.loadIfEnabled()),(A(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(s=null==e?void 0:e.captureEventName)?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ul()}else tl.warn(rO)}opt_out_capturing(){if(this.config.cookieless_mode!==tZ){var e,t,i=this.config.cookieless_mode===tX?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),this.config.cookieless_mode===tX&&this.consent.isOptedIn()&&this.Xl(!0,!0),this.consent.optInOut(!1),this.ll(),this.config.cookieless_mode===tX&&(this.register({distinct_id:tW,$device_id:null}),this.el(i),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Ul(),this.Fl())}else tl.warn(rO)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===tZ||(this.config.cookieless_mode===tX?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.ll()}_is_bot(){return o?function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&w(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>w(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver}(o,this.config.custom_blocked_useragents):void 0}Ul(){a&&("visible"===a.visibilityState?this.fl||(this.fl=!0,this.capture(t5,{title:a.title},{send_instantly:!0}),this.gl&&(a.removeEventListener(t2,this.gl),this.gl=null)):this.gl||(this.gl=this.Ul.bind(this),io(a,t2,this.gl)))}debug(e){!1===e?(null==r||r.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==r||r.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 e,t,i,s,r=this.yl||{};return"advanced_disable_flags"in r?!!r.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(tl.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):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in r&&!D(r[e]),s=t in r&&!D(r[t]),i?r[e]:!!s&&(tl&&tl.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}G(e){if(D(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(G),s=F(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s)try{if(r=n(r),D(r)){var o="Event '"+e.event+"' was rejected in beforeSend function";return j(e.event)?tl.warn(o+". This can cause unexpected behavior."):tl.info(o),null}r.properties&&!R(r.properties)||tl.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return tl.error("Error in beforeSend function for event '"+e.event+"':",t),null}for(var a of i)if(r.properties&&D(r.properties[a]))return tl.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return r}getPageViewId(){var e;return null==(e=this.pageViewManager.co)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}wl(e){var t=q(e)&&!e,i=iw.ro()&&"true"===iw.no("ph_debug");return!t&&(!!i||e)}}rH.__defaultExtensionClasses={},rH.Ql={trace:rP=()=>{}
1,debug:rP,info:rP,warn:rP,error:rP,fatal:rP},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=it(e.prototype[t[i]])}(rH,["identify"]);var rz=(v.SDK_DIST_CHANNEL="npm",s=rI[rB]=new rH,function(){function e(){e.done||(e.done=!0,rN=!1,t9(rI,function(e){e._dom_loaded()}))}null!=a&&a.addEventListener?"complete"===a.readyState?e():io(a,"DOMContentLoaded",e,{capture:!1}):r&&tl.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),s)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.