vendor: 43,364 bytes, lines 1-2
1import{b as mt,a as We}from"./vendor-react-kWzqx5_g.js";var d=typeof window<"u"?window:void 0,Y=typeof globalThis<"u"?globalThis:d,os=Array.prototype,ur=os.forEach,hr=os.indexOf,Q=Y?.navigator,m=Y?.document,z=Y?.location,Ei=Y?.fetch,xi=Y!=null&&Y.XMLHttpRequest&&"withCredentials"in new Y.XMLHttpRequest?Y.XMLHttpRequest:void 0,dr=Y?.AbortController,G=Q?.userAgent,x=d??{},ve={DEBUG:!1,LIB_VERSION:"1.285.1"};function pr(r,e,t,i,s,n,a){try{var o=r[n](a),l=o.value}catch(u){return void t(u)}o.done?e(l):Promise.resolve(l).then(i,s)}function fr(r){return function(){var e=this,t=arguments;return new Promise(function(i,s){var n=r.apply(e,t);function a(l){pr(n,i,s,a,o,"next",l)}function o(l){pr(n,i,s,a,o,"throw",l)}a(void 0)})}}function w(){return w=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},w.apply(null,arguments)}function ls(r,e){if(r==null)return{};var t={};for(var i in r)if({}.hasOwnProperty.call(r,i)){if(e.indexOf(i)!==-1)continue;t[i]=r[i]}return t}var wn=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],gr=function(r,e){if(e===void 0&&(e=[]),!r)return!1;var t=r.toLowerCase();return wn.concat(e).some(i=>{var s=i.toLowerCase();return t.indexOf(s)!==-1})},En=["$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"];function k(r,e){return r.indexOf(e)!==-1}var Zt=function(r){return r.trim()},ki=function(r){return r.replace(/^\$/,"")},xn=Array.isArray,cs=Object.prototype,us=cs.hasOwnProperty,Qt=cs.toString,R=xn||function(r){return Qt.call(r)==="[object Array]"},Ce=r=>typeof r=="function",B=r=>r===Object(r)&&!R(r),Ye=r=>{if(B(r)){for(var e in r)if(us.call(r,e))return!1;return!0}return!1},_=r=>r===void 0,M=r=>Qt.call(r)=="[object String]",Si=r=>M(r)&&r.trim().length===0,be=r=>r===null,T=r=>_(r)||be(r),pe=r=>Qt.call(r)=="[object Number]",Fe=r=>Qt.call(r)==="[object Boolean]",kn=r=>r instanceof FormData,Sn=r=>k(En,r);function Pi(r){return r===null||typeof r!="object"}function Mt(r,e){return Object.prototype.toString.call(r)==="[object "+e+"]"}function hs(r){return!_(Event)&&function(e,t){try{return e instanceof t}catch{return!1}}(r,Event)}var Pn=[!0,"true",1,"1","yes"],ni=r=>k(Pn,r),$n=[!1,"false",0,"0","no"];function ue(r,e,t,i,s){return e>t&&(i.warn("min cannot be greater than max."),e=t),pe(r)?r>t?(i.warn(" cannot be greater than max: "+t+". Using max value instead."),t):r<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):r:(i.warn(" must be a number. using max or fallback. max: "+t+", fallback: "+s),ue(s||t,e,t,i))}class In{constructor(e){this.t={},this.i=e.i,this.o=ue(e.bucketSize,0,100,e.h),this.m=ue(e.refillRate,0,this.o,e.h),this.S=ue(e.refillInterval,0,864e5,e.h)}$(e,t){var i=t-e.lastAccess,s=Math.floor(i/this.S);if(s>0){var n=s*this.m;e.tokens=Math.min(e.tokens+n,this.o),e.lastAccess=e.lastAccess+s*this.S}}consumeRateLimit(e){var t,i=Date.now(),s=String(e),n=this.t[s];return n?this.$(n,i):(n={tokens:this.o,lastAccess:i},this.t[s]=n),n.tokens===0||(n.tokens--,n.tokens===0&&((t=this.i)==null||t.call(this,e)),n.tokens===0)}stop(){this.t={}}}var It,vr,ai,Cn=r=>r instanceof Error;function Fn(r){var e=globalThis._posthogChunkIds;if(e){var t=Object.keys(e);return ai&&t.length===vr||(vr=t.length,ai=t.reduce((i,s)=>{It||(It={});var n=It[s];if(n)i[n[0]]=n[1];else for(var a=r(s),o=a.length-1;o>=0;o--){var l=a[o],u=l?.filename,c=e[s];if(u&&c){i[u]=c,It[s]=[u,c];break}}return i},{})),ai}}var Ze="?";function $i(r,e,t,i){var s={platform:"web:javascript",filename:r,function:e==="<anonymous>"?Ze:e,in_app:!0};return _(t)||(s.lineno=t),_(i)||(s.colno=i),s}var ds=(r,e)=>{var t=r.indexOf("safari-extension")!==-1,i=r.indexOf("safari-web-extension")!==-1;return t||i?[r.indexOf("@")!==-1?r.split("@")[0]:Ze,t?"safari-extension:"+e:"safari-web-extension:"+e]:[r,e]},On=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Tn=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Rn=/\((\S*)(?::(\d+))(?::(\d+))\)/,An=r=>{var e=On.exec(r);if(e){var[,t,i,s]=e;return $i(t,Ze,+i,+s)}var n=Tn.exec(r);if(n){if(n[2]&&n[2].indexOf("eval")===0){var a=Rn.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}var[o,l]=ds(n[1]||Ze,n[2]);return $i(l,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},Dn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ln=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Nn=r=>{var e=Dn.exec(r);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var t=Ln.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}var i=e[3],s=e[1]||Ze;return[s,i]=ds(s,i),$i(i,s,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},_r=/\(error: (.*)\)/,mr=50;function Mn(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return function(i,s){s===void 0&&(s=0);for(var n=[],a=i.split(` 2`),o=s;o<a.length;o++){var l=a[o];if(!(l.length>1024)){var u=_r.test(l)?l.replace(_r,"$1"):l;if(!u.match(/\S*Error: /)){for(var c of e){var h=c(u);if(h){n.push(h);break}}if(n.length>=mr)break}}}return function(f){if(!f.length)return[];var p=Array.from(f);return p.reverse(),p.slice(0,mr).map(v=>{return w({},v,{filename:v.filename||(g=p,g[g.length-1]||{}).filename,function:v.function||Ze});var g})}(n)}}class jn{constructor(e,t,i){e===void 0&&(e=[]),t===void 0&&(t=[]),i===void 0&&(i=[]),this.coercers=e,this.modifiers=i,this.stackParser=Mn(...t)}buildFromUnknown(e,t){t===void 0&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),n=this.buildParsingContext(),a=this.parseStacktrace(s,n);return{$exception_list:this.convertToExceptionList(a,i),$exception_level:"error"}}modifyFrames(e){var t=this;return fr(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&R(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:(t=e.syntheticException)==null?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,s;return e.cause!=null&&(i=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),t.chunkIdMap)),w({},e,{cause:i,stack:s})}applyChunkIds(e,t){return e.map(i=>(i.filename&&t&&(i.chunk_id=t[i.filename]),i))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return fr(function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){var i,s,n,a={type:e.type,value:e.value,mechanism:{type:(i=t.type)!==null&&i!==void 0?i:"generic",handled:(s=t.handled)===null||s===void 0||s,synthetic:(n=e.synthetic)!==null&&n!==void 0&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,w({},t,{handled:!0}))),o}buildParsingContext(){return{chunkIdMap:Fn(this.stackParser)}}buildCoercingContext(e,t,i){i===void 0&&(i=0);var s=(n,a)=>{if(a<=4){var o=this.buildCoercingContext(e,t,a);return this.applyCoercers(n,o)}};return w({},t,{syntheticException:i==0?t.syntheticException:void 0,mechanism:e,apply:n=>s(n,i),next:n=>s(n,i+1)})}}class Hn{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=M(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return Mt(e,"DOMException")}isDOMError(e){return Mt(e,"DOMError")}}class qn{match(e){return(t=>t instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return i.error&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class Un{constructor(){}match(e){return Mt(e,"ErrorEvent")&&e.error!=null}coerce(e,t){var i,s=t.apply(e.error);return s||{type:"ErrorEvent",value:e.message,stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}var Bn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Vn{match(e){return typeof e=="string"}coerce(e,t){var i,[s,n]=this.getInfos(e);return{type:s??"Error",value:n??e,stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(Bn);return s&&(t=s[1],i=s[2]),[t,i]}}var Wn=["fatal","error","warning","log","info","debug"];function ps(r,e){e===void 0&&(e=40);var t=Object.keys(r);if(t.sort(),!t.length)return"[object has no keys]";for(var i=t.length;i>0;i--){var s=t.slice(0,i).join(", ");if(!(s.length>e))return i===t.length||s.length<=e?s:s.slice(0,e)+"..."}return""}class Gn{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var i,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(i=t.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return hs(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var t="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&typeof e.message=="string")return e.message;var i=this.getObjectClassName(e);return(i&&i!=="Object"?"'"+i+"'":"Object")+" captured as exception with keys: "+ps(e)}isSeverityLevel(e){return M(e)&&!Si(e)&&Wn.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if(Cn(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}}class zn{match(e){return hs(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+ps(e),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}class Yn{match(e){return Pi(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}class Xn{match(e){return Mt(e,"PromiseRejectionEvent")}coerce(e,t){var i,s=this.getUnhandledRejectionReason(e);return Pi(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){if(Pi(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var fs=r=>{var e={k:function(t){if(d&&(ve.DEBUG||x.POSTHOG_DEBUG)&&!_(d.console)&&d.console){for(var i=("__rrweb_original__"in d.console[t])?d.console[t].__rrweb_original__:d.console[t],s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];i(r,...n)}},info:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];e.k("log",...i)},warn:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];e.k("warn",...i)},error:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];e.k("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];console.error(r,...i)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling "+t)},createLogger:t=>fs(r+" "+t)};return e},b=fs("[PostHog.js]"),j=b.createLogger,Kn=j("[ExternalScriptsLoader]"),yr=(r,e,t)=>{if(r.config.disable_external_dependency_loading)return Kn.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var i=m?.querySelectorAll("script");if(i){for(var s,n=function(){if(i[a].src===e){var l=i[a];return l.__posthog_loading_callback_fired?{v:t()}:(l.addEventListener("load",u=>{l.__posthog_loading_callback_fired=!0,t(void 0,u)}),l.onerror=u=>t(u),{v:void 0})}},a=0;a<i.length;a++)if(s=n())return s.v}var o=()=>{if(!m)return t("document not found");var l=m.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=h=>{l.__posthog_loading_callback_fired=!0,t(void 0,h)},l.onerror=h=>t(h),r.config.prepare_external_dependency_script&&(l=r.config.prepare_external_dependency_script(l)),!l)return t("prepare_external_dependency_script returned null");var u,c=m.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):m.body.appendChild(l)};m!=null&&m.body?o():m?.addEventListener("DOMContentLoaded",o)};x.__PosthogExtensions__=x.__PosthogExtensions__||{},x.__PosthogExtensions__.loadExternalDependency=(r,e,t)=>{var i="/static/"+e+".js?v="+r.version;if(e==="remote-config"&&(i="/array/"+r.config.token+"/config.js"),e==="toolbar"){var s=3e5;i=i+"&t="+Math.floor(Date.now()/s)*s}var n=r.requestRouter.endpointFor("assets",i);yr(r,n,t)},x.__PosthogExtensions__.loadSiteApp=(r,e,t)=>{var i=r.requestRouter.endpointFor("api",e);yr(r,i,t)};var jt={};function Oe(r,e,t){if(R(r)){if(ur&&r.forEach===ur)r.forEach(e,t);else if("length"in r&&r.length===+r.length){for(var i=0,s=r.length;i<s;i++)if(i in r&&e.call(t,r[i],i)===jt)return}}}function O(r,e,t){if(!T(r)){if(R(r))return Oe(r,e,t);if(kn(r)){for(var i of r.entries())if(e.call(t,i[1],i[0])===jt)return}else for(var s in r)if(us.call(r,s)&&e.call(t,r[s],s)===jt)return}}var L=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Oe(t,function(s){for(var n in s)s[n]!==void 0&&(r[n]=s[n])}),r},it=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return Oe(t,function(s){Oe(s,function(n){r.push(n)})}),r};function Dt(r){for(var e=Object.keys(r),t=e.length,i=new Array(t);t--;)i[t]=[e[t],r[e[t]]];return i}var br=function(r){try{return r()}catch{return}},Jn=function(r){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.apply(this,t)}catch(s){b.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),b.critical(s)}}},Yi=function(r){var e={};return O(r,function(t,i){(M(t)&&t.length>0||pe(t))&&(e[i]=t)}),e};function Zn(r,e){return t=r,i=n=>M(n)&&!be(e)?n.slice(0,e):n,s=new Set,function n(a,o){return a!==Object(a)?i?i(a,o):a:s.has(a)?void 0:(s.add(a),R(a)?(l=[],Oe(a,u=>{l.push(n(u))})):(l={},O(a,(u,c)=>{s.has(u)||(l[c]=n(u,c))})),l);var l}(t);var t,i,s}var Qn=["herokuapp.com","vercel.app","netlify.app"];function ea(r){var e=r?.hostname;if(!M(e))return!1;var t=e.split(".").slice(-2).join(".");for(var i of Qn)if(t===i)return!1;return!0}function gs(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return r[t]}function N(r,e,t,i){var{capture:s=!1,passive:n=!0}=i??{};r?.addEventListener(e,t,{capture:s,passive:n})}var vs="$people_distinct_id",ht="__alias",dt="__timers",wr="$autocapture_disabled_server_side",Ii="$heatmaps_enabled_server_side",Er="$exception_capture_enabled_server_side",Ci="$error_tracking_suppression_rules",xr="$error_tracking_capture_extension_exceptions",kr="$web_vitals_enabled_server_side",_s="$dead_clicks_enabled_server_side",Sr="$web_vitals_allowed_metrics",oi="$session_recording_remote_config",Ht="$sesid",ms="$session_is_sampled",Xe="$enabled_feature_flags",pt="$early_access_features",Fi="$feature_flag_details",ft="$stored_person_properties",Ne="$stored_group_properties",Oi="$surveys",Ct="$surveys_activated",qt="$flag_call_reported",_e="$user_state",Ti="$client_session_props",Ri="$capture_rate_limit",Ai="$initial_campaign_params",Di="$initial_referrer_info",Ut="$initial_person_info",Bt="$epp",ys="__POSTHOG_TOOLBAR__",st="$posthog_cookieless",ta=[vs,ht,"__cmpns",dt,"$session_recording_enabled_server_side",Ii,Ht,Xe,Ci,_e,pt,Fi,Ne,ft,Oi,qt,Ti,Ri,Ai,Di,Bt,Ut];function Pr(r){return r instanceof Element&&(r.id===ys||!(r.closest==null||!r.closest(".toolbar-global-fade-container")))}function ei(r){return!!r&&r.nodeType===1}function Te(r,e){return!!r&&!!r.tagName&&r.tagName.toLowerCase()===e.toLowerCase()}function bs(r){return!!r&&r.nodeType===3}function ws(r){return!!r&&r.nodeType===11}function Xi(r){return r?Zt(r).split(/\s+/):[]}function $r(r){var e=d?.location.href;return!!(e&&r&&r.some(t=>e.match(t)))}function Vt(r){var e="";switch(typeof r.className){case"string":e=r.className;break;case"object":e=(r.className&&"baseVal"in r.className?r.className.baseVal:null)||r.getAttribute("class")||"";break;default:e=""}return Xi(e)}function Es(r){return T(r)?null:Zt(r).split(/(\s+)/).filter(e=>wt(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ti(r){var e="";return Li(r)&&!$s(r)&&r.childNodes&&r.childNodes.length&&O(r.childNodes,function(t){var i;bs(t)&&t.textContent&&(e+=(i=Es(t.textContent))!==null&&i!==void 0?i:"")}),Zt(e)}function xs(r){return _(r.target)?r.srcElement||null:(e=r.target)!=null&&e.shadowRoot?r.composedPath()[0]||null:r.target||null;var e}var Ki=["a","button","form","input","select","textarea","label"];function ks(r,e){if(_(e))return!0;var t,i=function(n){if(e.some(a=>n.matches(a)))return{v:!0}};for(var s of r)if(t=i(s))return t.v;return!1}function Ss(r){var e=r.parentNode;return!(!e||!ei(e))&&e}var Ir=[".ph-no-rageclick",".ph-no-capture"],Ji=r=>!r||Te(r,"html")||!ei(r),Ps=(r,e)=>{if(!d||Ji(r))return{parentIsUsefulElement:!1,targetElementList:[]};for(var t=!1,i=[r],s=r;s.parentNode&&!Te(s,"body");)if(ws(s.parentNode))i.push(s.parentNode.host),s=s.parentNode.host;else{var n=Ss(s);if(!n)break;if(e||Ki.indexOf(n.tagName.toLowerCase())>-1)t=!0;else{var a=d.getComputedStyle(n);a&&a.getPropertyValue("cursor")==="pointer"&&(t=!0)}i.push(n),s=n}return{parentIsUsefulElement:t,targetElementList:i}};function ia(r,e,t,i,s){var n,a,o,l;if(t===void 0&&(t=void 0),!d||Ji(r)||(n=t)!=null&&n.url_allowlist&&!$r(t.url_allowlist)||(a=t)!=null&&a.url_ignorelist&&$r(t.url_ignorelist))return!1;if((o=t)!=null&&o.dom_event_allowlist){var u=t.dom_event_allowlist;if(u&&!u.some(v=>e.type===v))return!1}var{parentIsUsefulElement:c,targetElementList:h}=Ps(r,i);if(!function(v,g){var y=g?.element_allowlist;if(_(y))return!0;var E,$=function(S){if(y.some(F=>S.tagName.toLowerCase()===F))return{v:!0}};for(var P of v)if(E=$(P))return E.v;return!1}(h,t)||!ks(h,(l=t)==null?void 0:l.css_selector_allowlist))return!1;var f=d.getComputedStyle(r);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var p=r.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(s||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(e.type)>=0;default:return c?(s||["click"]).indexOf(e.type)>=0:(s||["click"]).indexOf(e.type)>=0&&(Ki.indexOf(p)>-1||r.getAttribute("contenteditable")==="true")}}function Li(r){for(var e=r;e.parentNode&&!Te(e,"body");e=e.parentNode){var t=Vt(e);if(k(t,"ph-sensitive")||k(t,"ph-no-capture"))return!1}if(k(Vt(r),"ph-include"))return!0;var i=r.type||"";if(M(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var s=r.name||r.id||"";return!(M(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function $s(r){return!!(Te(r,"input")&&!["button","checkbox","submit","reset"].includes(r.type)||Te(r,"select")||Te(r,"textarea")||r.getAttribute("contenteditable")==="true")}var Is="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",ra=new RegExp("^(?:"+Is+")$"),sa=new RegExp(Is),Cs="\\d{3}-?\\d{2}-?\\d{4}",na=new RegExp("^("+Cs+")$"),aa=new RegExp("("+Cs+")");function wt(r,e){return e===void 0&&(e=!0),!(T(r)||M(r)&&(r=Zt(r),(e?ra:sa).test((r||"").replace(/[- ]/g,""))||(e?na:aa).test(r)))}function Fs(r){var e=ti(r);return wt(e=(e+" "+Os(r)).trim())?e:""}function Os(r){var e="";return r&&r.childNodes&&r.childNodes.length&&O(r.childNodes,function(t){var i;if(t&&((i=t.tagName)==null?void 0:i.toLowerCase())==="span")try{var s=ti(t);e=(e+" "+s).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Os(t)).trim())}catch(n){b.error("[AutoCapture]",n)}}),e}function oa(r){return function(e){var t=e.map(i=>{var s,n,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class)for(var o of(i.attr_class.sort(),i.attr_class))a+="."+o.replace(/"/g,"");var l=w({},i.text?{text:i.text}:{},{"nth-child":(s=i.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(n=i.nth_of_type)!==null&&n!==void 0?n:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),u={};return Dt(l).sort((c,h)=>{var[f]=c,[p]=h;return f.localeCompare(p)}).forEach(c=>{var[h,f]=c;return u[Cr(h.toString())]=Cr(f.toString())}),a+=":",a+=Dt(u).map(c=>{var[h,f]=c;return h+'="'+f+'"'}).join("")});return t.join(";")}(function(e){return e.map(t=>{var i,s,n={text:(i=t.$el_text)==null?void 0:i.slice(0,400),tag_name:t.tag_name,href:(s=t.attr__href)==null?void 0:s.slice(0,2048),attr_class:la(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Dt(t).filter(a=>{var[o]=a;return o.indexOf("attr__")===0}).forEach(a=>{var[o,l]=a;return n.attributes[o]=l}),n})}(r))}function Cr(r){return r.replace(/"|\\"/g,'\\"')}function la(r){var e=r.attr__class;return e?R(e)?e:Xi(e):void 0}class Ts{constructor(){this.clicks=[]}isRageClick(e,t,i){var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<30&&i-s.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var li="$copy_autocapture",ye=function(r){return r.GZipJS="gzip-js",r.Base64="base64",r}({}),Wt=r=>{var e=m?.createElement("a");return _(e)?null:(e.href=r,e)},ca=function(r,e){var t,i;e===void 0&&(e="&");var s=[];return O(r,function(n,a){_(n)||_(a)||a==="undefined"||(t=encodeURIComponent((o=>o instanceof File)(n)?n.name:n.toString()),i=encodeURIComponent(a),s[s.length]=i+"="+t)}),s.join(e)},Gt=function(r,e){for(var t,i=((r.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<i.length;s++){var n=i[s].split("=");if(n[0]===e){t=n;break}}if(!R(t)||t.length<2)return"";var a=t[1];try{a=decodeURIComponent(a)}catch{b.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Pt=function(r,e,t){if(!r||!e||!e.length)return r;for(var i=r.split("#"),s=i[0]||"",n=i[1],a=s.split("?"),o=a[1],l=a[0],u=(o||"").split("&"),c=[],h=0;h<u.length;h++){var f=u[h].split("=");R(f)&&(e.includes(f[0])?c.push(f[0]+"="+t):c.push(u[h]))}var p=l;return o!=null&&(p+="?"+c.join("&")),n!=null&&(p+="#"+n),p},zt=function(r,e){var t=r.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Fr=j("[AutoCapture]");function ci(r,e){return e.length>r?e.slice(0,r)+"...":e}function ua(r){if(r.previousElementSibling)return r.previousElementSibling;var e=r;do e=e.previousSibling;while(e&&!ei(e));return e}function ha(r,e,t,i){var s=r.tagName.toLowerCase(),n={tag_name:s};Ki.indexOf(s)>-1&&!t&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?n.$el_text=ci(1024,Fs(r)):n.$el_text=ci(1024,ti(r)));var a=Vt(r);a.length>0&&(n.classes=a.filter(function(c){return c!==""})),O(r.attributes,function(c){var h;if((!$s(r)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(i==null||!i.includes(c.name))&&!e&&wt(c.value)&&(h=c.name,!M(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var f=c.value;c.name==="class"&&(f=Xi(f).join(" ")),n["attr__"+c.name]=ci(1024,f)}});for(var o=1,l=1,u=r;u=ua(u);)o++,u.tagName===r.tagName&&l++;return n.nth_child=o,n.nth_of_type=l,n}function da(r,e){for(var t,i,{e:s,maskAllElementAttributes:n,maskAllText:a,elementAttributeIgnoreList:o,elementsChainAsString:l}=e,u=[r],c=r;c.parentNode&&!Te(c,"body");)ws(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var h,f=[],p={},v=!1,g=!1;if(O(u,S=>{var F=Li(S);S.tagName.toLowerCase()==="a"&&(v=S.getAttribute("href"),v=F&&v&&wt(v)&&v),k(Vt(S),"ph-no-capture")&&(g=!0),f.push(ha(S,n,a,o));var q=function(K){if(!Li(K))return{};var I={};return O(K.attributes,function(ae){if(ae.name&&ae.name.indexOf("data-ph-capture-attribute")===0){var J=ae.name.replace("data-ph-capture-attribute-",""),se=ae.value;J&&se&&wt(se)&&(I[J]=se)}}),I}(S);L(p,q)}),g)return{props:{},explicitNoCapture:g};if(a||(r.tagName.toLowerCase()==="a"||r.tagName.toLowerCase()==="button"?f[0].$el_text=Fs(r):f[0].$el_text=ti(r)),v){var y,E;f[0].attr__href=v;var $=(y=Wt(v))==null?void 0:y.host,P=d==null||(E=d.location)==null?void 0:E.host;$&&P&&$!==P&&(h=v)}return{props:L({$event_type:s.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:oa(f)},(t=f[0])!=null&&t.$el_text?{$el_text:(i=f[0])==null?void 0:i.$el_text}:{},h&&s.type==="click"?{$external_click_url:h}:{},p)}}class pa{constructor(e){this.P=!1,this.T=null,this.rageclicks=new Ts,this.R=!1,this.instance=e,this.I=null}get C(){var e,t,i=B(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map(s=>new RegExp(s)),i.url_ignorelist=(t=i.url_ignorelist)==null?void 0:t.map(s=>new RegExp(s)),i}O(){if(this.isBrowserSupported()){if(d&&m){var e=i=>{i=i||d?.event;try{this.F(i)}catch(s){Fr.error("Failed to capture event",s)}};if(N(m,"submit",e,{capture:!0}),N(m,"change",e,{capture:!0}),N(m,"click",e,{capture:!0}),this.C.capture_copied_text){var t=i=>{i=i||d?.event,this.F(i,li)};N(m,"copy",t,{capture:!0}),N(m,"cut",t,{capture:!0})}}}else Fr.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.O(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.R=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[wr]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.I=e}getElementSelectors(e){var t,i=[];return(t=this.I)==null||t.forEach(s=>{var n=m?.querySelectorAll(s);n?.forEach(a=>{e===a&&i.push(s)})}),i}get isEnabled(){var e,t,i=(e=this.instance.persistence)==null?void 0:e.props[wr],s=this.T;if(be(s)&&!Fe(i)&&!this.instance.M())return!1;var n=(t=this.T)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!n}F(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var i,s=xs(e);bs(s)&&(s=s.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&function(f,p){if(!d||Ji(f))return!1;var v,g;if((v=Fe(p)?!!p&&Ir:(g=p?.css_selector_ignorelist)!==null&&g!==void 0?g:Ir)===!1)return!1;var{targetElementList:y}=Ps(f,!1);return!ks(y,v)}(s,this.instance.config.rageclick)&&this.F(e,"$rageclick");var n=t===li;if(s&&ia(s,e,this.C,n,n?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=da(s,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.C.element_attribute_ignorelist,elementsChainAsString:this.R});if(o)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(a.$element_selectors=l),t===li){var u,c=Es(d==null||(u=d.getSelection())==null?void 0:u.toString()),h=e.type||"clipboard";if(!c)return!1;a.$selected_content=c,a.$copy_type=h}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return Ce(m?.querySelectorAll)}}Math.trunc||(Math.trunc=function(r){return r<0?Math.ceil(r):Math.floor(r)}),Number.isInteger||(Number.isInteger=function(r){return pe(r)&&isFinite(r)&&Math.floor(r)===r});var Or="0123456789abcdef";class Yt{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||e<0||t<0||i<0||s<0||e>0xffffffffffff||t>4095||i>1073741823||s>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new Yt(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Or.charAt(this.bytes[t]>>>4)+Or.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Yt(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}}class fa{constructor(){this.A=0,this.D=0,this.j=new ga}generate(){var e=this.generateOrAbort();if(_(e)){this.A=0;var t=this.generateOrAbort();if(_(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.D++,this.D>4398046511103&&(this.A++,this.L())}return Yt.fromFieldsV7(this.A,Math.trunc(this.D/Math.pow(2,30)),this.D&Math.pow(2,30)-1,this.j.nextUint32())}L(){this.D=1024*this.j.nextUint32()+(1023&this.j.nextUint32())}}var Tr,Rs=r=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<r.length;e++)r[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return r};d&&!_(d.crypto)&&crypto.getRandomValues&&(Rs=r=>crypto.getRandomValues(r));class ga{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(Rs(this.N),this.U=0),this.N[this.U++]}}var Ie=()=>va().toString(),va=()=>(Tr||(Tr=new fa)).generate(),nt="",_a=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function ma(r,e){if(e){var t=function(s,n){if(n===void 0&&(n=m),nt)return nt;if(!n||["localhost","127.0.0.1"].includes(s))return"";for(var a=s.split("."),o=Math.min(a.length,8),l="dmn_chk_"+Ie();!nt&&o--;){var u=a.slice(o).join("."),c=l+"=1;domain=."+u+";path=/";n.cookie=c+";max-age=3",n.cookie.includes(l)&&(n.cookie=c+";max-age=0",nt=u)}return nt}(r);if(!t){var i=(s=>{var n=s.match(_a);return n?n[0]:""})(r);i!==t&&b.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var de={H:()=>!!m,B:function(r){b.error("cookieStore error: "+r)},q:function(r){if(m){try{for(var e=r+"=",t=m.cookie.split(";").filter(n=>n.length),i=0;i<t.length;i++){for(var s=t[i];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}},W:function(r){var e;try{e=JSON.parse(de.q(r))||{}}catch{}return e},G:function(r,e,t,i,s){if(m)try{var n="",a="",o=ma(m.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),n="; expires="+l.toUTCString()}s&&(a="; secure");var u=r+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&b.warn("cookieStore warning: large cookie, len="+u.length),m.cookie=u,u}catch{return}},V:function(r,e){if(m!=null&&m.cookie)try{de.G(r,"",-1,e)}catch{return}}},ui=null,D={H:function(){if(!be(ui))return ui;var r=!0;if(_(d))r=!1;else try{var e="__mplssupport__";D.G(e,"xyz"),D.q(e)!=='"xyz"'&&(r=!1),D.V(e)}catch{r=!1}return r||b.error("localStorage unsupported; falling back to cookie store"),ui=r,r},B:function(r){b.error("localStorage error: "+r)},q:function(r){try{return d?.localStorage.getItem(r)}catch(e){D.B(e)}return null},W:function(r){try{return JSON.parse(D.q(r))||{}}catch{}return null},G:function(r,e){try{d?.localStorage.setItem(r,JSON.stringify(e))}catch(t){D.B(t)}},V:function(r){try{d?.localStorage.removeItem(r)}catch(e){D.B(e)}}},ya=["distinct_id",Ht,ms,Bt,Ut],Ft=w({},D,{W:function(r){try{var e={};try{e=de.W(r)||{}}catch{}var t=L(e,JSON.parse(D.q(r)||"{}"));return D.G(r,t),t}catch{}return null},G:function(r,e,t,i,s,n){try{D.G(r,e,void 0,void 0,n);var a={};ya.forEach(o=>{e[o]&&(a[o]=e[o])}),Object.keys(a).length&&de.G(r,a,t,i,s,n)}catch(o){D.B(o)}},V:function(r,e){try{d?.localStorage.removeItem(r),de.V(r,e)}catch(t){D.B(t)}}}),Ot={},ba={H:function(){return!0},B:function(r){b.error("memoryStorage error: "+r)},q:function(r){return Ot[r]||null},W:function(r){return Ot[r]||null},G:function(r,e){Ot[r]=e},V:function(r){delete Ot[r]}},Ae=null,H={H:function(){if(!be(Ae))return Ae;if(Ae=!0,_(d))Ae=!1;else try{var r="__support__";H.G(r,"xyz"),H.q(r)!=='"xyz"'&&(Ae=!1),H.V(r)}catch{Ae=!1}return Ae},B:function(r){b.error("sessionStorage error: ",r)},q:function(r){try{return d?.sessionStorage.getItem(r)}catch(e){H.B(e)}return null},W:function(r){try{return JSON.parse(H.q(r))||null}catch{}return null},G:function(r,e){try{d?.sessionStorage.setItem(r,JSON.stringify(e))}catch(t){H.B(t)}},V:function(r){try{d?.sessionStorage.removeItem(r)}catch(e){H.B(e)}}},me=function(r){return r[r.PENDING=-1]="PENDING",r[r.DENIED=0]="DENIED",r[r.GRANTED=1]="GRANTED",r}({});class wa{constructor(e){this._instance=e}get C(){return this._instance.config}get consent(){return this.J()?me.DENIED:this.K}isOptedOut(){return this.C.cookieless_mode==="always"||this.consent===me.DENIED||this.consent===me.PENDING&&(this.C.opt_out_capturing_by_default||this.C.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===me.DENIED}optInOut(e){this.Y.G(this.X,e?1:0,this.C.cookie_expiration,this.C.cross_subdomain_cookie,this.C.secure_cookie)}reset(){this.Y.V(this.X,this.C.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return ni(e)?me.GRANTED:k($n,e)?me.DENIED:me.PENDING}get Y(){if(!this.Z){var e=this.C.opt_out_capturing_persistence_type;this.Z=e==="localStorage"?D:de;var t=e==="localStorage"?de:D;t.q(this.X)&&(this.Z.q(this.X)||this.optInOut(ni(t.q(this.X))),t.V(this.X,this.C.cross_subdomain_cookie))}return this.Z}J(){return!!this.C.respect_dnt&&!!gs([Q?.doNotTrack,Q?.msDoNotTrack,x.doNotTrack],e=>ni(e))}}var Tt=j("[Dead Clicks]"),Ea=()=>!0,xa=r=>{var e,t=!((e=r.instance.persistence)==null||!e.get_property(_s)),i=r.instance.config.capture_dead_clicks;return Fe(i)?i:t};class As{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[_s]:e?.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it(()=>{this.et()})}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",s=>{s?Tt.error("failed to load script",s):e()})}et(){var e;if(m){if(!this.tt&&(e=x.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=B(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.tt=x.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.tt.start(m),Tt.info("starting...")}}else Tt.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,Tt.info("stopping..."))}}var at=j("[ExceptionAutocapture]");class ka{constructor(e){var t,i,s;this.rt=()=>{var n;if(d&&this.isEnabled&&(n=x.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var a=x.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=x.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=x.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.C.capture_unhandled_errors&&(this.st=a(this.captureException.bind(this))),!this.nt&&this.C.capture_unhandled_rejections&&(this.nt=o(this.captureException.bind(this))),!this.ot&&this.C.capture_console_errors&&(this.ot=l(this.captureException.bind(this)))}catch(u){at.error("failed to start",u),this.lt()}}},this._instance=e,this.ut=!((t=this._instance.persistence)==null||!t.props[Er]),this.C=this.ht(),this.dt=new In({refillRate:(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10,refillInterval:1e4,h:at}),this.startIfEnabled()}ht(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return B(e)?t=w({},t,e):(_(e)?this.ut:e)&&(t=w({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.C.capture_console_errors||this.C.capture_unhandled_errors||this.C.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(at.info("enabled"),this.it(this.rt))}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",s=>{if(s)return at.error("failed to load script",s);e()})}lt(){var e,t,i;(e=this.st)==null||e.call(this),this.st=void 0,(t=this.nt)==null||t.call(this),this.nt=void 0,(i=this.ot)==null||i.call(this),this.ot=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.ut=!!t||!1,this.C=this.ht(),this._instance.persistence&&this._instance.persistence.register({[Er]:this.ut}),this.startIfEnabled()}captureException(e){var t,i,s=(t=e==null||(i=e.$exception_list)==null||(i=i[0])==null?void 0:i.type)!==null&&t!==void 0?t:"Exception";this.dt.consumeRateLimit(s)?at.info("Skipping exception capture because of client rate limiting.",{exception:s}):this._instance.exceptions.sendExceptionEvent(e)}}function Rr(r,e,t){try{if(!(e in r))return()=>{};var i=r[e],s=t(i);return Ce(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),r[e]=s,()=>{r[e]=i}}catch{return()=>{}}}class Sa{constructor(e){var t;this._instance=e,this.vt=(d==null||(t=d.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(b.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ct&&this.ct(),this.ct=void 0,b.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(d&&d.history){var i=this;(e=d.history.pushState)!=null&&e.__posthog_wrapped__||Rr(d.history,"pushState",s=>function(n,a,o){s.call(this,n,a,o),i.ft("pushState")}),(t=d.history.replaceState)!=null&&t.__posthog_wrapped__||Rr(d.history,"replaceState",s=>function(n,a,o){s.call(this,n,a,o),i.ft("replaceState")}),this.gt()}}ft(e){try{var t,i=d==null||(t=d.location)==null?void 0:t.pathname;if(!i)return;i!==this.vt&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.vt=i}catch(s){b.error("Error capturing "+e+" pageview",s)}}gt(){if(!this.ct){var e=()=>{this.ft("popstate")};N(d,"popstate",e),this.ct=()=>{d&&d.removeEventListener("popstate",e)}}}}var hi=j("[SegmentIntegration]");function Pa(r,e){var t=r.config.segment;if(!t)return e();(function(i,s){var n=i.config.segment;if(!n)return s();var a=l=>{var u=()=>l.anonymousId()||Ie();i.config.get_device_id=u,l.id()&&(i.register({distinct_id:l.id(),$device_id:u()}),i.persistence.set_property(_e,"identified")),s()},o=n.user();"then"in o&&Ce(o.then)?o.then(l=>a(l)):a(o)})(r,()=>{t.register((i=>{Promise&&Promise.resolve||hi.warn("This browser does not have Promise support, and can not use the segment integration");var s=(n,a)=>{if(!a)return n;n.event.userId||n.event.anonymousId===i.get_distinct_id()||(hi.info("No userId set, resetting PostHog"),i.reset()),n.event.userId&&n.event.userId!==i.get_distinct_id()&&(hi.info("UserId set, identifying with PostHog"),i.identify(n.event.userId));var o=i.calculateEventProperties(a,n.event.properties);return n.event.properties=Object.assign({},o,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:n=>s(n,n.event.event),page:n=>s(n,"$pageview"),identify:n=>s(n,"$identify"),screen:n=>s(n,"$screen")}})(r)).then(()=>{e()})})}var Ds="posthog-js";function Ls(r,e){var{organization:t,projectId:i,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return o=>{var l,u,c,h,f;if(!(n==="*"||n.includes(o.level))||!r.__loaded)return o;o.tags||(o.tags={});var p=r.requestRouter.endpointFor("ui","/project/"+r.config.token+"/person/"+r.get_distinct_id());o.tags["PostHog Person URL"]=p,r.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=r.get_session_replay_url({withTimestamp:!0}));var v=((l=o.exception)==null?void 0:l.values)||[],g=v.map(E=>w({},E,{stacktrace:E.stacktrace?w({},E.stacktrace,{type:"raw",frames:(E.stacktrace.frames||[]).map($=>w({},$,{platform:"web:javascript"}))}):void 0})),y={$exception_message:((u=v[0])==null?void 0:u.value)||o.message,$exception_type:(c=v[0])==null?void 0:c.type,$exception_level:o.level,$exception_list:g,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((h=v[0])==null?void 0:h.value)||o.message,$sentry_exception_type:(f=v[0])==null?void 0:f.type,$sentry_tags:o.tags};return t&&i&&(y.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+o.event_id),a&&r.exceptions.sendExceptionEvent(y),o}}class $a{constructor(e,t,i,s,n,a){this.name=Ds,this.setupOnce=function(o){o(Ls(e,{organization:t,projectId:i,prefix:s,severityAllowList:n,sendExceptionsToPostHog:a==null||a}))}}}var Ia=d!=null&&d.location?zt(d.location.hash,"__posthog")||zt(location.hash,"state"):null,Ar="_postHogToolbarParam
2s",Dr=j("[Toolbar]"),$e=function(r){return r[r.UNINITIALIZED=0]="UNINITIALIZED",r[r.LOADING=1]="LOADING",r[r.LOADED=2]="LOADED",r}($e||{});class Ca{constructor(e){this.instance=e}_t(e){x.ph_toolbar_state=e}yt(){var e;return(e=x.ph_toolbar_state)!==null&&e!==void 0?e:$e.UNINITIALIZED}maybeLoadToolbar(e,t,i){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),i===void 0&&(i=void 0),!d||!m)return!1;e=e??d.location,i=i??d.history;try{if(!t){try{d.localStorage.setItem("test","test"),d.localStorage.removeItem("test")}catch{return!1}t=d?.localStorage}var s,n=Ia||zt(e.hash,"__posthog")||zt(e.hash,"state"),a=n?br(()=>JSON.parse(atob(decodeURIComponent(n))))||br(()=>JSON.parse(decodeURIComponent(n))):null;return a&&a.action==="ph_authorize"?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(Ar)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}bt(e){var t=x.ph_load_toolbar||x.ph_load_editor;!T(t)&&Ce(t)?t(e,this.instance):Dr.warn("No toolbar load function found")}loadToolbar(e){var t=!(m==null||!m.getElementById(ys));if(!d||t)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=w({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(d.localStorage.setItem(Ar,JSON.stringify(w({},s,{source:void 0}))),this.yt()===$e.LOADED)this.bt(s);else if(this.yt()===$e.UNINITIALIZED){var n;this._t($e.LOADING),(n=x.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"toolbar",a=>{if(a)return Dr.error("[Toolbar] Failed to load",a),void this._t($e.UNINITIALIZED);this._t($e.LOADED),this.bt(s)}),N(d,"turbolinks:load",()=>{this._t($e.UNINITIALIZED),this.loadToolbar(s)})}return!0}wt(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var Fa=j("[TracingHeaders]");class Oa{constructor(e){this.xt=void 0,this.St=void 0,this.rt=()=>{var t,i;_(this.xt)&&((t=x.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),_(this.St)&&((i=x.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",s=>{if(s)return Fa.error("failed to load script",s);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.it(this.rt):((e=this.xt)==null||e.call(this),(t=this.St)==null||t.call(this),this.xt=void 0,this.St=void 0)}}var ie="Mobile",Xt="iOS",he="Android",Et="Tablet",Ns=he+" "+Et,Ms="iPad",js="Apple",Hs=js+" Watch",xt="Safari",Qe="BlackBerry",qs="Samsung",Us=qs+"Browser",Bs=qs+" Internet",je="Chrome",Ta=je+" OS",Vs=je+" "+Xt,Zi="Internet Explorer",Ws=Zi+" "+ie,Qi="Opera",Ra=Qi+" Mini",er="Edge",Gs="Microsoft "+er,Ke="Firefox",zs=Ke+" "+Xt,kt="Nintendo",St="PlayStation",Je="Xbox",Ys=he+" "+ie,Xs=ie+" "+xt,gt="Windows",Ni=gt+" Phone",Lr="Nokia",Mi="Ouya",Ks="Generic",Aa=Ks+" "+ie.toLowerCase(),Js=Ks+" "+Et.toLowerCase(),ji="Konqueror",W="(\\d+(\\.\\d+)?)",di=new RegExp("Version/"+W),Da=new RegExp(Je,"i"),La=new RegExp(St+" \\w+","i"),Na=new RegExp(kt+" \\w+","i"),tr=new RegExp(Qe+"|PlayBook|BB10","i"),Ma={"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"},ja=(r,e)=>e&&k(e,js)||function(t){return k(t,xt)&&!k(t,je)&&!k(t,he)}(r),Zs=function(r,e){return e=e||"",k(r," OPR/")&&k(r,"Mini")?Ra:k(r," OPR/")?Qi:tr.test(r)?Qe:k(r,"IE"+ie)||k(r,"WPDesktop")?Ws:k(r,Us)?Bs:k(r,er)||k(r,"Edg/")?Gs:k(r,"FBIOS")?"Facebook "+ie:k(r,"UCWEB")||k(r,"UCBrowser")?"UC Browser":k(r,"CriOS")?Vs:k(r,"CrMo")||k(r,je)?je:k(r,he)&&k(r,xt)?Ys:k(r,"FxiOS")?zs:k(r.toLowerCase(),ji.toLowerCase())?ji:ja(r,e)?k(r,ie)?Xs:xt:k(r,Ke)?Ke:k(r,"MSIE")||k(r,"Trident/")?Zi:k(r,"Gecko")?Ke:""},Ha={[Ws]:[new RegExp("rv:"+W)],[Gs]:[new RegExp(er+"?\\/"+W)],[je]:[new RegExp("("+je+"|CrMo)\\/"+W)],[Vs]:[new RegExp("CriOS\\/"+W)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+W)],[xt]:[di],[Xs]:[di],[Qi]:[new RegExp("(Opera|OPR)\\/"+W)],[Ke]:[new RegExp(Ke+"\\/"+W)],[zs]:[new RegExp("FxiOS\\/"+W)],[ji]:[new RegExp("Konqueror[:/]?"+W,"i")],[Qe]:[new RegExp(Qe+" "+W),di],[Ys]:[new RegExp("android\\s"+W,"i")],[Bs]:[new RegExp(Us+"\\/"+W)],[Zi]:[new RegExp("(rv:|MSIE )"+W)],Mozilla:[new RegExp("rv:"+W)]},qa=function(r,e){var t=Zs(r,e),i=Ha[t];if(_(i))return null;for(var s=0;s<i.length;s++){var n=i[s],a=r.match(n);if(a)return parseFloat(a[a.length-2])}return null},Nr=[[new RegExp(Je+"; "+Je+" (.*?)[);]","i"),r=>[Je,r&&r[1]||""]],[new RegExp(kt,"i"),[kt,""]],[new RegExp(St,"i"),[St,""]],[tr,[Qe,""]],[new RegExp(gt,"i"),(r,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Ni,""];if(new RegExp(ie).test(e)&&!/IEMobile\b/.test(e))return[gt+" "+ie,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],s=Ma[i]||"";return/arm/i.test(e)&&(s="RT"),[gt,s]}return[gt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,r=>{if(r&&r[3]){var e=[r[3],r[4],r[5]||"0"];
vendor: 11,438 bytes, line 2
2return[Xt,e.join(".")]}return[Xt,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,r=>{var e="";return r&&r.length>=3&&(e=_(r[2])?r[3]:r[2]),["watchOS",e]}],[new RegExp("("+he+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+he+")","i"),r=>{if(r&&r[2]){var e=[r[2],r[3],r[4]||"0"];return[he,e.join(".")]}return[he,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,r=>{var e=["Mac OS X",""];if(r&&r[1]){var t=[r[1],r[2],r[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Ta,""]],[/Linux|debian/i,["Linux",""]]],Mr=function(r){return Na.test(r)?kt:La.test(r)?St:Da.test(r)?Je:new RegExp(Mi,"i").test(r)?Mi:new RegExp("("+Ni+"|WPDesktop)","i").test(r)?Ni:/iPad/.test(r)?Ms:/iPod/.test(r)?"iPod Touch":/iPhone/.test(r)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(r)?Hs:tr.test(r)?Qe:/(kobo)\s(ereader|touch)/i.test(r)?"Kobo":new RegExp(Lr,"i").test(r)?Lr:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(r)||/(kf[a-z]+)( bui|\)).+silk\//i.test(r)?"Kindle Fire":/(Android|ZTE)/i.test(r)?!new RegExp(ie).test(r)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(r)?/pixel[\daxl ]{1,6}/i.test(r)&&!/pixel c/i.test(r)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(r)||/lmy47v/i.test(r)&&!/QTAQZ3/i.test(r)?he:Ns:he:new RegExp("(pda|"+ie+")","i").test(r)?Aa:new RegExp(Et,"i").test(r)&&!new RegExp(Et+" pc","i").test(r)?Js:""},Rt="https?://(.*)",rt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Ua=it(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],rt),$t="<masked>",Ba=["li_fat_id"];function Qs(r,e,t){if(!m)return{};var i,s=e?it([],rt,t||[]):[],n=en(Pt(m.URL,s,$t),r),a=(i={},O(Ba,function(o){var l=de.q(o);i[o]=l||null}),i);return L(a,n)}function en(r,e){var t=Ua.concat(e||[]),i={};return O(t,function(s){var n=Gt(r,s);i[s]=n||null}),i}function tn(r){var e=function(n){return n?n.search(Rt+"google.([^/?]*)")===0?"google":n.search(Rt+"bing.com")===0?"bing":n.search(Rt+"yahoo.com")===0?"yahoo":n.search(Rt+"duckduckgo.com")===0?"duckduckgo":null:null}(r),t=e!="yahoo"?"q":"p",i={};if(!be(e)){i.$search_engine=e;var s=m?Gt(m.referrer,t):"";s.length&&(i.ph_keyword=s)}return i}function jr(){return navigator.language||navigator.userLanguage}function rn(){return m?.referrer||"$direct"}function sn(r,e){var t=r?it([],rt,e||[]):[],i=z?.href.substring(0,1e3);return{r:rn().substring(0,1e3),u:i?Pt(i,t,$t):void 0}}function nn(r){var e,{r:t,u:i}=r,s={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Wt(t))==null?void 0:e.host};if(i){s.$current_url=i;var n=Wt(i);s.$host=n?.host,s.$pathname=n?.pathname;var a=en(i);L(s,a)}if(t){var o=tn(t);L(s,o)}return s}function an(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Va(){try{return new Date().getTimezoneOffset()}catch{return}}function Wa(r,e){if(!G)return{};var t,i,s,n=r?it([],rt,e||[]):[],[a,o]=function(l){for(var u=0;u<Nr.length;u++){var[c,h]=Nr[u],f=c.exec(l),p=f&&(Ce(h)?h(f,l):h);if(p)return p}return["",""]}(G);return L(Yi({$os:a,$os_version:o,$browser:Zs(G,navigator.vendor),$device:Mr(G),$device_type:(i=G,s=Mr(i),s===Ms||s===Ns||s==="Kobo"||s==="Kindle Fire"||s===Js?Et:s===kt||s===Je||s===St||s===Mi?"Console":s===Hs?"Wearable":s?ie:"Desktop"),$timezone:an(),$timezone_offset:Va()}),{$current_url:Pt(z?.href,n,$t),$host:z?.host,$pathname:z?.pathname,$raw_user_agent:G.length>1e3?G.substring(0,997)+"...":G,$browser_version:qa(G,navigator.vendor),$browser_language:jr(),$browser_language_prefix:(t=jr(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:d?.screen.height,$screen_width:d?.screen.width,$viewport_height:d?.innerHeight,$viewport_width:d?.innerWidth,$lib:"web",$lib_version:ve.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Se=j("[Web Vitals]"),Hr=9e5;class Ga{constructor(e){var t;this.Et=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.$t=()=>{clearTimeout(this.kt),this.N.metrics.length!==0&&(this._instance.capture("$web_vitals",this.N.metrics.reduce((i,s)=>w({},i,{["$web_vitals_"+s.name+"_event"]:w({},s),["$web_vitals_"+s.name+"_value"]:s.value}),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Pt=i=>{var s,n=(s=this._instance.sessionManager)==null?void 0:s.checkAndGetSessionAndWindowId(!0);if(_(n))Se.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Tt();_(a)||(T(i?.name)||T(i?.value)?Se.error("Invalid metric received",i):this.Rt&&i.value>=this.Rt?Se.error("Ignoring metric with value >= "+this.Rt,i):(this.N.url!==a&&(this.$t(),this.kt=setTimeout(this.$t,this.flushToCaptureTimeoutMs)),_(this.N.url)&&(this.N.url=a),this.N.firstMetricTimestamp=_(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.N.metrics.push(w({},i,{$current_url:a,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.$t()))}},this.rt=()=>{var i,s,n,a,o=x.__PosthogExtensions__;_(o)||_(o.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:s,onFCP:n,onINP:a}=o.postHogWebVitalsCallbacks),i&&s&&n&&a?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Pt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&s(this.Pt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this.Pt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Pt.bind(this)),this.P=!0):Se.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Et=!((t=this._instance.persistence)==null||!t.props[kr]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=B(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return _(i)?((t=this._instance.persistence)==null?void 0:t.props[Sr])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(B(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Rt(){var e=B(this._instance.config.capture_performance)&&pe(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Hr;return 0<e&&e<=6e4?Hr:e}get isEnabled(){var e=z?.protocol;if(e!=="http:"&&e!=="https:")return Se.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=B(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Fe(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Fe(t)?t:this.Et}startIfEnabled(){this.isEnabled&&!this.P&&(Se.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var t=B(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=B(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[kr]:t}),this._instance.persistence.register({[Sr]:i})),this.Et=t,this.startIfEnabled()}it(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks&&e(),(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",s=>{s?Se.error("failed to load script",s):e()})}Tt(){var e=d?d.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,s=t?it([],rt,i||[]):[];return Pt(e,s,$t)}Se.error("Could not determine current URL")}}var za=j("[Heatmaps]");function qr(r){return B(r)&&"clientX"in r&&"clientY"in r&&pe(r.clientX)&&pe(r.clientY)}class Ya{constructor(e){var t;this.rageclicks=new Ts,this.Et=!1,this.P=!1,this.It=null,this.instance=e,this.Et=!((t=this.instance.persistence)==null||!t.props[Ii])}get flushIntervalMilliseconds(){var e=5e3;return B(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return _(this.instance.config.capture_heatmaps)?_(this.instance.config.enable_heatmaps)?this.Et:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.P)return;za.info("starting..."),this.Ct(),this.Ot()}else{var e;clearInterval((e=this.It)!==null&&e!==void 0?e:void 0),this.Ft(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Ii]:t}),this.Et=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}Mt(e){this.At(e.originalEvent,"deadclick")}Ot(){this.It&&clearInterval(this.It),this.It=function(e){return e?.visibilityState==="visible"}(m)?setInterval(this.Dt.bind(this),this.flushIntervalMilliseconds):null}Ct(){d&&m&&(this.jt=this.Dt.bind(this),N(d,"beforeunload",this.jt),this.Lt=e=>this.At(e||d?.event),N(m,"click",this.Lt,{capture:!0}),this.Nt=e=>this.Ut(e||d?.event),N(m,"mousemove",this.Nt,{capture:!0}),this.zt=new As(this.instance,Ea,this.Mt.bind(this)),this.zt.startIfEnabled(),this.Ht=this.Ot.bind(this),N(m,"visibilitychange",this.Ht),this.P=!0)}Ft(){var e;d&&m&&(this.jt&&d.removeEventListener("beforeunload",this.jt),this.Lt&&m.removeEventListener("click",this.Lt,{capture:!0}),this.Nt&&m.removeEventListener("mousemove",this.Nt,{capture:!0}),this.Ht&&m.removeEventListener("visibilitychange",this.Ht),clearTimeout(this.Bt),(e=this.zt)==null||e.stop(),this.P=!1)}qt(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(o,l,u){for(var c=o;c&&ei(c)&&!Te(c,"body");){if(c===u)return!1;if(k(l,d?.getComputedStyle(c).position))return!0;c=Ss(c)}return!1}(xs(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:i),target_fixed:a,type:t}}At(e,t){var i;if(t===void 0&&(t="click"),!Pr(e.target)&&qr(e)){var s=this.qt(e,t);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Wt(w({},s,{type:"rageclick"})),this.Wt(s)}}Ut(e){!Pr(e.target)&&qr(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout(()=>{this.Wt(this.qt(e,"mousemove"))},500))}Wt(e){if(d){var t=d.location.href,i=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,n=i?it([],rt,s||[]):[],a=Pt(t,n,$t);this.N=this.N||{},this.N[a]||(this.N[a]=[]),this.N[a].push(e)}}Dt(){this.N&&!Ye(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Xa{constructor(e){this._instance=e}doPageView(e,t){var i,s=this.Gt(e,t);return this.Vt={pathname:(i=d?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Gt(e,(t=this.Vt)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Vt)==null?void 0:e.pageViewId}}Gt(e,t){var i=this.Vt;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:l,maxContentHeight:u,last
vendor: 4,137 bytes, line 2
2ContentY:c,maxContentY:h}=n;if(!(_(a)||_(o)||_(l)||_(u)||_(c)||_(h))){a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),h=Math.ceil(h);var f=a<=1?1:ue(o/a,0,1,b),p=a<=1?1:ue(l/a,0,1,b),v=u<=1?1:ue(c/u,0,1,b),g=u<=1?1:ue(h/u,0,1,b);s=L(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:v,$prev_pageview_max_content:h,$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 re=Uint8Array,X=Uint16Array,et=Uint32Array,ir=new re([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]),rr=new re([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]),Ur=new re([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),on=function(r,e){for(var t=new X(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];var s=new et(t[30]);for(i=1;i<30;++i)for(var n=t[i];n<t[i+1];++n)s[n]=n-t[i]<<5|i;return[t,s]},ln=on(ir,2),Ka=ln[0],Hi=ln[1];Ka[28]=258,Hi[258]=28;for(var Br=on(rr,0)[1],cn=new X(32768),A=0;A<32768;++A){var De=(43690&A)>>>1|(21845&A)<<1;De=(61680&(De=(52428&De)>>>2|(13107&De)<<2))>>>4|(3855&De)<<4,cn[A]=((65280&De)>>>8|(255&De)<<8)>>>1}var yt=function(r,e,t){for(var i=r.length,s=0,n=new X(e);s<i;++s)++n[r[s]-1];var a,o=new X(e);for(s=0;s<e;++s)o[s]=o[s-1]+n[s-1]<<1;for(a=new X(i),s=0;s<i;++s)a[s]=cn[o[r[s]-1]++]>>>15-r[s];return a},He=new re(288);for(A=0;A<144;++A)He[A]=8;for(A=144;A<256;++A)He[A]=9;for(A=256;A<280;++A)He[A]=7;for(A=280;A<288;++A)He[A]=8;var Kt=new re(32);for(A=0;A<32;++A)Kt[A]=5;var Ja=yt(He,9),Za=yt(Kt,5),un=function(r){return(r/8>>0)+(7&r&&1)},hn=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof X?X:r instanceof et?et:re)(t-e);return i.set(r.subarray(e,t)),i},ge=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8},ot=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8,r[i+2]|=t>>>16},pi=function(r,e){for(var t=[],i=0;i<r.length;++i)r[i]&&t.push({s:i,f:r[i]});var s=t.length,n=t.slice();if(!s)return[new re(0),0];if(s==1){var a=new re(t[0].s+1);return a[t[0].s]=1,[a,1]}t.sort(function(F,q){return F.f-q.f}),t.push({s:-1,f:25001});var o=t[0],l=t[1],u=0,c=1,h=2;for(t[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=s-1;)o=t[t[u].f<t[h].f?u++:h++],l=t[u!=c&&t[u].f<t[h].f?u++:h++],t[c++]={s:-1,f:o.f+l.f,l:o,r:l};var f=n[0].s;for(i=1;i<s;++i)n[i].s>f&&(f=n[i].s);var p=new X(f+1),v=qi(t[c-1],p,0);if(v>e){i=0;var g=0,y=v-e,E=1<<y;for(n.sort(function(F,q){return p[q.s]-p[F.s]||F.f-q.f});i<s;++i){var $=n[i].s;if(!(p[$]>e))break;g+=E-(1<<v-p[$]),p[$]=e}for(g>>>=y;g>0;){var P=n[i].s;p[P]<e?g-=1<<e-p[P]++-1:++i}for(;i>=0&&g;--i){var S=n[i].s;p[S]==e&&(--p[S],++g)}v=e}return[new re(p),v]},qi=function(r,e,t){return r.s==-1?Math.max(qi(r.l,e,t+1),qi(r.r,e,t+1)):e[r.s]=t},Vr=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new X(++e),i=0,s=r[0],n=1,a=function(l){t[i++]=l},o=1;o<=e;++o)if(r[o]==s&&o!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=r[o]}return[t.subarray(0,i),e]},lt=function(r,e){for(var t=0,i=0;i<e.length;++i)t+=r[i]*e[i];return t},Ui=function(r,e,t){var i=t.length,s=un(e+2);r[s]=255&i,r[s+1]=i>>>8,r[s+2]=255^r[s],r[s+3]=255^r[s+1];for(var n=0;n<i;++n)r[s+n+4]=t[n];return 8*(s+4+i)},Wr=function(r,e,t,i,s,n,a,o,l,u,c){ge(e,c++,t),++s[256];for(var h=pi(s,15),f=h[0],p=h[1],v=pi(n,15),g=v[0],y=v[1],E=Vr(f),$=E[0],P=E[1],S=Vr(g),F=S[0],q=S[1],K=new X(19),I=0;I<$.length;++I)K[31&$[I]]++;for(I=0;I<F.length;++I)K[31&F[I]]++;for(var ae=pi(K,7),J=ae[0],se=ae[1],ee=19;ee>4&&!J[Ur[ee-1]];--ee);var fe,oe,le,qe,we=u+5<<3,Re=lt(s,He)+lt(n,Kt)+a,ce=lt(s,f)+lt(n,g)+a+14+3*ee+lt(K,J)+(2*K[16]+3*K[17]+7*K[18]);if(we<=Re&&we<=ce)return Ui(e,c,r.subarray(l,l+u));if(ge(e,c,1+(ce<Re)),c+=2,ce<Re){fe=yt(f,p),oe=f,le=yt(g,y),qe=g;var Ee=yt(J,se);for(ge(e,c,P-257),ge(e,c+5,q-1),ge(e,c+10,ee-4),c+=14,I=0;I<ee;
vendor: 4,192 bytes, lines 2-4
2++I)ge(e,c+3*I,J[Ur[I]]);c+=3*ee;for(var Ue=[$,F],V=0;V<2;++V){var te=Ue[V];for(I=0;I<te.length;++I){var Z=31&te[I];ge(e,c,Ee[Z]),c+=J[Z],Z>15&&(ge(e,c,te[I]>>>5&127),c+=te[I]>>>12)}}}else fe=Ja,oe=He,le=Za,qe=Kt;for(I=0;I<o;++I)if(i[I]>255){Z=i[I]>>>18&31,ot(e,c,fe[Z+257]),c+=oe[Z+257],Z>7&&(ge(e,c,i[I]>>>23&31),c+=ir[Z]);var Be=31&i[I];ot(e,c,le[Be]),c+=qe[Be],Be>3&&(ot(e,c,i[I]>>>5&8191),c+=rr[Be])}else ot(e,c,fe[i[I]]),c+=oe[i[I]];return ot(e,c,fe[256]),c+oe[256]},Qa=new et([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),eo=function(){for(var r=new et(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;r[e]=t}return r}(),to=function(r,e,t,i,s){return function(n,a,o,l,u,c){var h=n.length,f=new re(l+h+5*(1+Math.floor(h/7e3))+u),p=f.subarray(l,f.length-u),v=0;if(!a||h<8)for(var g=0;g<=h;g+=65535){var y=g+65535;y<h?v=Ui(p,v,n.subarray(g,y)):(p[g]=c,v=Ui(p,v,n.subarray(g,h)))}else{for(var E=Qa[a-1],$=E>>>13,P=8191&E,S=(1<<o)-1,F=new X(32768),q=new X(S+1),K=Math.ceil(o/3),I=2*K,ae=function(si){return(n[si]^n[si+1]<<K^n[si+2]<<I)&S},J=new et(25e3),se=new X(288),ee=new X(32),fe=0,oe=0,le=(g=0,0),qe=0,we=0;g<h;++g){var Re=ae(g),ce=32767&g,Ee=q[Re];if(F[ce]=Ee,q[Re]=ce,qe<=g){var Ue=h-g;if((fe>7e3||le>24576)&&Ue>423){v=Wr(n,p,0,J,se,ee,oe,le,we,g-we,v),le=fe=oe=0,we=g;for(var V=0;V<286;++V)se[V]=0;for(V=0;V<30;++V)ee[V]=0}var te=2,Z=0,Be=P,xe=ce-Ee&32767;if(Ue>2&&Re==ae(g-xe))for(var _n=Math.min($,Ue)-1,mn=Math.min(32767,g),yn=Math.min(258,Ue);xe<=mn&&--Be&&ce!=Ee;){if(n[g+te]==n[g+te-xe]){for(var ke=0;ke<yn&&n[g+ke]==n[g+ke-xe];++ke);if(ke>te){if(te=ke,Z=xe,ke>_n)break;var bn=Math.min(xe,ke-2),ar=0;for(V=0;V<bn;++V){var ri=g-xe+V+32768&32767,or=ri-F[ri]+32768&32767;or>ar&&(ar=or,Ee=ri)}}}xe+=(ce=Ee)-(Ee=F[ce])+32768&32767}if(Z){J[le++]=268435456|Hi[te]<<18|Br[Z];var lr=31&Hi[te],cr=31&Br[Z];oe+=ir[lr]+rr[cr],++se[257+lr],++ee[cr],qe=g+te,++fe}else J[le++]=n[g],++se[n[g]]}}v=Wr(n,p,c,J,se,ee,oe,le,we,g-we,v)}return hn(f,0,l+un(v)+u)}(r,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+e.mem,t,i,!0)},fi=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8};function io(r,e){e===void 0&&(e={});var t=function(){var o=4294967295;return{p:function(l){for(var u=o,c=0;c<l.length;++c)u=eo[255&u^l[c]]^u>>>8;o=u},d:function(){return 4294967295^o}}}(),i=r.length;t.p(r);var s,n=to(r,e,10+((s=e).filename&&s.filename.length+1||0),8),a=n.length;return function(o,l){var u=l.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=l.level<2?4:l.level==9?2:0,o[9]=3,l.mtime!=0&&fi(o,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),u){o[3]=8;for(var c=0;c<=u.length;++c)o[c+10]=u.charCodeAt(c)}}(n,e),fi(n,a-8,t.d()),fi(n,a-4,i),n}var ro=function(r){var e,t,i,s,n="";for(e=t=0,i=(r=(r+"").replace(/\r\n/g,` 3`).replace(/\r/g,` 4`)).length,s=0;s<i;s++){var a=r.charCodeAt(s),o=null;a<128?t++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),be(o)||(t>e&&(n+=r.substring(e,t)),n+=o,e=t=s+1)}return t>e&&(n+=r.substring(e,r.length)),n},so=!!xi||!!Ei,Gr="text/plain",Jt=function(r,e,t){var i;t===void 0&&(t=!0);var[s,n]=r.split("?"),a=w({},e),o=(i=n?.split("&").map(u=>{var c,[h,f]=u.split("="),p=t&&(c=a[h])!==null&&c!==void 0?c:f;return delete a[h],h+"="+p}))!==null&&i!==void 0?i:[],l=ca(a);return l&&o.push(l),s+"?"+o.join("&")},vt=(r,e)=>JSON.stringify(r,(t,i)=>typeof i=="bigint"?i.toString():i,e),gi=r=>{var{data:e,compression:t}=r;if(e){if(t===ye.GZipJS){var i=io(function(l,u){var c=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var h=new re(l.length+(l.length>>>1)),f=0,p=function(E){h[f++]=E},v=0;v<c;++v){if(f+5>h.length){var g=new re(f+8+(c-v<<1));g.set(h),h=g}var y=l.charCodeAt(v);y<128||u?p(y):y<2048?(p(192|y>>>6),p(128|63&y)):y>55295&&y<57344?(p(240|(y=65536+(1047552&y)|1023&l.charCodeAt(++v))>>>18),p(128|y>>>12&63),p(128|y>>>6&63),p(128|63&y)):(p(224|y>>>12),p(128|y>>>6&63),p(128|63&y))}return hn(h,0,f)}(vt(e)),{mtime:0}),s=new Blob([i],{type:Gr});return{contentType:Gr,body:s,estimatedSize:s.size}}if(t===ye.Base64){var n=function(l){var u,c,h,f,p,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
4+/=",g=0,y=0,E="",$=[];if(!l)return l;l=ro(l);do u=(p=l.charCodeAt(g++)<<16|l.charCodeAt(g++)<<8|l.charCodeAt(g++))>>18&63,c=p>>12&63,h=p>>6&63,f=63&p,$[y++]=v.charAt(u)+v.charAt(c)+v.charAt(h)+v.charAt(f);while(g<l.length);switch(E=$.join(""),l.length%3){case 1:E=E.slice(0,-2)+"==";break;case 2:E=E.slice(0,-1)+"="}return E}(vt(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:vt(l)))(n);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var o=vt(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Lt=[];Ei&&Lt.push({transport:"fetch",method:r=>{var e,t,{contentType:i,body:s,estimatedSize:n}=(e=gi(r))!==null&&e!==void 0?e:{},a=new Headers;O(r.headers,function(c,h){a.append(h,c)}),i&&a.append("Content-Type",i);var o=r.url,l=null;if(dr){var u=new dr;l={signal:u.signal,timeout:setTimeout(()=>u.abort(),r.timeout)}}Ei(o,w({method:r?.method||"GET",headers:a,keepalive:r.method==="POST"&&(n||0)<52428.8,body:s,signal:(t=l)==null?void 0:t.signal},r.fetchOptions)).then(c=>c.text().then(h=>{var f={statusCode:c.status,text:h};if(c.status===200)try{f.json=JSON.parse(h)}catch(p){b.error(p)}r.callback==null||r.callback(f)})).catch(c=>{b.error(c),r.callback==null||r.callback({statusCode:0,text:c})}).finally(()=>l?clearTimeout(l.timeout):null)}}),xi&&Lt.push({transport:"XHR",method:r=>{var e,t=new xi;t.open(r.method||"GET",r.url,!0);var{contentType:i,body:s}=(e=gi(r))!==null&&e!==void 0?e:{};O(r.headers,function(n,a){t.setRequestHeader(a,n)}),i&&t.setRequestHeader("Content-Type",i),r.timeout&&(t.timeout=r.timeout),r.disableXHRCredentials||(t.withCredentials=!0),t.onreadystatechange=()=>{if(t.readyState===4){var n={statusCode:t.status,text:t.responseText};if(t.status===200)try{n.json=JSON.parse(t.responseText)}catch{}r.callback==null||r.callback(n)}},t.send(s)}}),Q!=null&&Q.sendBeacon&&Lt.push({transport:"sendBeacon",method:r=>{var e=Jt(r.url,{beacon:"1"});try{var t,{contentType:i,body:s}=(t=gi(r))!==null&&t!==void 0?t:{},n=typeof s=="string"?new Blob([s],{type:i}):s;Q.sendBeacon(e,n)}catch{}}});var tt=function(r,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(r)}catch{return!1}};function zr(r,e,t){return vt({distinct_id:r,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var dn={exact:(r,e)=>e.some(t=>r.some(i=>t===i)),is_not:(r,e)=>e.every(t=>r.every(i=>t!==i)),regex:(r,e)=>e.some(t=>r.some(i=>tt(t,i))),not_regex:(r,e)=>e.every(t=>r.every(i=>!tt(t,i))),icontains:(r,e)=>e.map(At).some(t=>r.map(At).some(i=>t.includes(i))),not_icontains:(r,e)=>e.map(At).every(t=>r.map(At).every(i=>!t.includes(i)))},At=r=>r.toLowerCase(),vi=j("[Error tracking]");class no{constructor(e){var t,i;this.Jt=[],this.Kt=new jn([new Hn,new Xn,new Un,new qn,new zn,new Gn,new Vn,new Yn],[An,Nn]),this._instance=e,this.Jt=(t=(i=this._instance.persistence)==null?void 0:i.get_property(Ci))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,i,s,n=(t=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&t!==void 0?t:[],a=(s=e.errorTracking)==null?void 0:s.captureExtensionExceptions;this.Jt=n,this._instance.persistence&&this._instance.persistence.register({[Ci]:this.Jt,[xr]:a})}get Yt(){var e,t=!!this._instance.get_property(xr),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.Kt.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.Xt(t)){if(this.Qt(t))return void vi.info("Skipping exception capture because a suppression rule matched");if(!this.Yt&&this.Zt(t))return void vi.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ti(t))return void vi.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}Qt(e){if(e.length===0)return!1;var t=e.reduce((i,s)=>{var{type:n,value:a}=s;return M(n)&&n.length>0&&i.$exception_types.push(n),M(a)&&a.length>0&&i.$exception_values.push(a),i},{$exception_types:[],$exception_values:[]});return this.Jt.some(i=>{var s=i.values.map(n=>{var a,o=dn[n.operator],l=R(n.value)?n.value:[n.value],u=(a=t[n.key])!==null&&a!==void 0?a:[];return l.length>0&&o(l,u)});return i.type==="OR"?s.some(Boolean):s.every(Boolean)})}Zt(e){return e.flatMap(t=>{var i,s;return(i=(s=t.stacktrace)==null?void 0:s.frames)!==null&&i!==void 0?i:[]}).some(t=>t.filename&&t.filename.startsWith("chrome-extension://"))}ti(e){if(e.length>0){var t,i,s,n,a=(t=(i=e[0].stacktrace)==null?void 0:i.frames)!==null&&t!==void 0?t:[],o=a[a.length-1];return(s=o==null||(n=o.filename)==null?void 0:n.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}Xt(e){return!T(e)&&R(e)}}var ne=j("[FeatureFlags]"),_i="$active_feature_flags",Ve="$override_feature_flags",Yr="$feature_flag_payloads",ct="$override_feature_flag_payloads",Xr="$feature_flag_request_id",Kr=r=>{var e={};for(var[t,i]of Dt(r||{}))i&&(e[t]=i);return e},ao=r=>{var e=r.flags;return e?(r.featureFlags=Object.fromEntries(Object.keys(e).map(t=>{var i;return[t,(i=e[t].variant)!==null&&i!==void 0?i:e[t].enabled]})),r.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(t=>e[t].enabled).filter(t=>{var i;return(i=e[t].metadata)==null?void 0:i.payload}).map(t=>{var i;return[t,(i=e[t].metadata)==null?void 0:i.payload]}))):ne.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),r},oo=function(r){return r.FeatureFlags="feature_flags",r.Recordings="recordings",r}({});class lo{constructor(e){this.ii=!1,this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this._instance=e,this.featureFlagEventHandlers=[]}li(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter(t=>{var i=t&&typeof t=="string"&&t.trim().length>0;return i||ne.error("Invalid evaluation environment found:",t,"Expected non-empty string"),i}):[]}ui(){return this.li().length>0}flags(){if(this._instance.config.__preview_remote_config)this.oi=!0;else{var e=!this.hi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.di({disableFlags:e})}}get hasLoadedFlags(){return this.ei}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Fi),t=this._instance.get_property(Ve),i=this._instance.get_property(ct);if(!i&&!t)return e||{};var s=L({},e||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var a of n){var o,l,u=s[a],c=t?.[a],h=_(c)?(o=u?.enabled)!==null&&o!==void 0&&o:!!c,f=_(c)?u.variant:typeof c=="string"?c:void 0,p=i?.[a],v=w({},u,{enabled:h,variant:h?f??u?.variant:void 0});h!==u?.enabled&&(v.original_enabled=u?.enabled),f!==u?.variant&&(v.original_variant=u?.variant),p&&(v.metadata=w({},u?.metadata,{payload:p,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),s[a]=v}
vendor: 13,362 bytes, line 4
4return this.ii||(ne.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.ii=!0),s}getFlagVariants(){var e=this._instance.get_property(Xe),t=this._instance.get_property(Ve);if(!t)return e||{};for(var i=L({},e),s=Object.keys(t),n=0;n<s.length;n++)i[s[n]]=t[s[n]];return this.ii||(ne.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ii=!0),i}getFlagPayloads(){var e=this._instance.get_property(Yr),t=this._instance.get_property(ct);if(!t)return e||{};for(var i=L({},e||{}),s=Object.keys(t),n=0;n<s.length;n++)i[s[n]]=t[s[n]];return this.ii||(ne.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ii=!0),i}reloadFeatureFlags(){this.si||this._instance.config.advanced_disable_feature_flags||this.hi||(this.hi=setTimeout(()=>{this.di()},5))}vi(){clearTimeout(this.hi),this.hi=void 0}ensureFlagsLoaded(){this.ei||this.ri||this.hi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.si=e}di(e){var t;if(this.vi(),!this._instance.M())if(this.ri)this.ni=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:w({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(ft)||{}),group_properties:this._instance.get_property(Ne)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ui()&&(i.evaluation_environments=this.li());var s=this._instance.config.__preview_remote_config,n=s?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("api",n+a);s&&(i.timezone=an()),this.ri=!0,this._instance.ci({method:"POST",url:o,data:i,compression:this._instance.config.disable_compression?void 0:ye.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,c,h=!0;if(l.statusCode===200&&(this.ni||(this.$anon_distinct_id=void 0),h=!1),this.ri=!1,this.oi||(this.oi=!0,this._instance.fi((c=l.json)!==null&&c!==void 0?c:{})),!i.disable_flags||this.ni)if(this.ai=!h,l.json&&(u=l.json.quotaLimited)!=null&&u.includes(oo.FeatureFlags))ne.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var f;i.disable_flags||this.receivedFeatureFlags((f=l.json)!==null&&f!==void 0?f:{},h),this.ni&&(this.ni=!1,this.di())}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],s=""+i,n=this._instance.get_property(Xr)||void 0,a=this._instance.get_property(qt)||{};if((t.send_event||!("send_event"in t))&&(!(e in a)||!a[e].includes(s))){var o,l,u,c,h,f,p,v,g;R(a[e])?a[e].push(s):a[e]=[s],(o=this._instance.persistence)==null||o.register({[qt]:a});var y=this.getFeatureFlagDetails(e),E={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:n,$feature_flag_bootstrapped_response:((l=this._instance.config.bootstrap)==null||(l=l.featureFlags)==null?void 0:l[e])||null,$feature_flag_bootstrapped_payload:((u=this._instance.config.bootstrap)==null||(u=u.featureFlagPayloads)==null?void 0:u[e])||null,$used_bootstrap_value:!this.ai};_(y==null||(c=y.metadata)==null?void 0:c.version)||(E.$feature_flag_version=y.metadata.version);var $,P=(h=y==null||(f=y.reason)==null?void 0:f.description)!==null&&h!==void 0?h:y==null||(p=y.reason)==null?void 0:p.code;P&&(E.$feature_flag_reason=P),y!=null&&(v=y.metadata)!=null&&v.id&&(E.$feature_flag_id=y.metadata.id),_(y?.original_variant)&&_(y?.original_enabled)||(E.$feature_flag_original_response=_(y.original_variant)?y.original_enabled:y.original_variant),y!=null&&(g=y.metadata)!=null&&g.original_payload&&(E.$feature_flag_original_payload=y==null||($=y.metadata)==null?void 0:$.original_payload),this._instance.capture("$feature_flag_called",E)}return i}ne.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var i=this._instance.config.token,s={distinct_id:this._instance.get_distinct_id(),token:i};this.ui()&&(s.evaluation_environments=this.li()),this._instance.ci({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:s,compression:this._instance.config.disable_compression?void 0:ye.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:n=>{var a,o=(a=n.json)==null?void 0:a.featureFlagPayloads;t(o?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this.ei||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return _(i)?void 0:!!i}ne.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.ei=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),n=this.getFlagsWithDetails();(function(a,o,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var h=ao(a),f=h.flags,p=h.featureFlags,v=h.featureFlagPayloads;if(p){var g=a.requestId;if(R(p)){ne.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var y={};if(p)for(var E=0;E<p.length;E++)y[p[E]]=!0;o&&o.register({[_i]:p,[Xe]:y})}else{var $=p,P=v,S=f;a.errorsWhileComputingFlags&&($=w({},l,$),P=w({},u,P),S=w({},c,S)),o&&o.register(w({[_i]:Object.keys(Kr($)),[Xe]:$||{},[Yr]:P||{},[Fi]:S||{}},g?{[Xr]:g}:{}))}}})(e,this._instance.persistence,i,s,n),this.pi(t)}}override(e,t){t===void 0&&(t=!1),ne.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return ne.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(Ve),this._instance.persistence.unregister(ct),void this.pi();if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,i=e;if(this.ii=!!((t=i.suppressWarning)!==null&&t!==void 0&&t),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(Ve);else if(i.flags)if(R(i.flags)){for(var s={},n=0;n<i.flags.length;n++)s[i.flags[n]]=!0;this._instance.persistence.register({[Ve]:s})}else this._instance.persistence.register({[Ve]:i.flags})}return"payloads"in i&&(i.payloads===!1?this._instance.persistence.unregister(ct):i.payloads&&this._instance.persistence.register({[ct]:i.payloads})),void this.pi()}this.pi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ei){var{flags:t,flagVariants:i}=this.gi();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,n=(this._instance.get_property(pt)||[]).find(u=>u.flagKey===e),a={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};n&&(o.$early_access_feature_name=n.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(a,!1);var l=w({},this.getFlagVariants(),{[e]:t});(s=this._instance.persistence)==null||s.register({[_i]:Object.keys(Kr(l)),[Xe]:l}),this.pi()}getEarlyAccessFeatures(e,t,i){t===void 0&&(t=!1);var s=this._instance.get_property(pt),n=i?"&"+i.map(a=>"stage="+a).join("&"):"";if(s&&!t)return e(s);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:a=>{var o,l;if(a.json){var u=a.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.unregister(pt),(l=this._instance.persistence)==null||l.register({[pt]:u}),e(u)}}})}gi(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(i=>t[i]),flagVariants:Object.keys(t).filter(i=>t[i]).reduce((i,s)=>(i[s]=t[s],i),{})}}pi(e){var{flags:t,flagVariants:i}=this.gi();this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var i=this._instance.get_property(ft)||{};this._instance.register({[ft]:w({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(ft)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var i=this._instance.get_property(Ne)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(s=>{i[s]=w({},i[s],e[s]),delete e[s]}),this._instance.register({[Ne]:w({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(Ne)||{};this._instance.register({[Ne]:w({},t,{[e]:{}})})}else this._instance.unregister(Ne)}reset(){this.ei=!1,this.ri=!1,this.si=!1,this.ni=!1,this.oi=!1,this.ai=!1,this.$anon_distinct_id=void 0,this.vi(),this.ii=!1}}var co=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class mi{constructor(e,t){this.C=e,this.props={},this.mi=!1,this.yi=(i=>{var s="";return i.token&&(s=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+s+"_posthog"})(e),this.Y=this.bi(e),this.load(),e.debug&&b.info("Persistence loaded",e.persistence,w({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.wi}bi(e){co.indexOf(e.persistence.toLowerCase())===-1&&(b.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&D.H()?D:t==="localstorage+cookie"&&Ft.H()?Ft:t==="sessionstorage"&&H.H()?H:t==="memory"?ba:t==="cookie"?de:Ft.H()?Ft:de}properties(){var e={};return O(this.props,function(t,i){if(i===Xe&&B(t))for(var s=Object.keys(t),n=0;n<s.length;n++)e["$feature/"+s[n]]=t[s[n]];else o=i,l=!1,(be(a=ta)?l:hr&&a.indexOf===hr?a.indexOf(o)!=-1:(O(a,function(u){if(l||(l=u===o))return jt}),l))||(e[i]=t);var a,o,l}),e}load(){if(!this.wi){var e=this.Y.W(this.yi);e&&(this.props=L({},e))}}save(){this.wi||this.Y.G(this.yi,this.props,this.xi,this.Si,this.Ei,this.C.debug)}remove(){this.Y.V(this.yi,!1),this.Y.V(this.yi,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(B(e)){_(t)&&(t="None"),this.xi=_(i)?this.$i:i;var s=!1;if(O(e,(n,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.props[a]=n,s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(B(e)){this.xi=_(t)?this.$i:t;var i=!1;if(O(e,(s,n)=>{e.hasOwnProperty(n)&&this.props[n]!==s&&(this.props[n]=s,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.mi){var e=Qs(this.C.custom_campaign_params,this.C.mask_personal_data_properties,this.C.custom_personal_data_properties);Ye(Yi(e))||this.register(e),this.mi=!0}}update_search_keyword(){var e;this.register((e=m?.referrer)?tn(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rn(),$referring_domain:m!=null&&m.referrer&&((e=Wt(m.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Ai]||this.props[Di]||this.register_once({[Ut]:sn(this.C.mask_personal_data_properties,this.C.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};O([Di,Ai],a=>{var o=this.props[a];o&&O(o,function(l,u){e["$initial_"+ki(u)]=l})});var t,i,s=this.props[Ut];if(s){var n=(t=nn(s),i={},O(t,function(a,o){i["$initial_"+ki(o)]=a}),i);L(e,n)}return e}safe_merge(e){return O(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.$i=this.xi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var s=this.bi(e),n=this.props;this.clear(),this.Y=s,this.props=n,this.save()}}set_disabled(e){this.wi=e,this.wi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Si&&(this.Si=e,this.remove(),this.save())}set_secure(e){e!==this.Ei&&(this.Ei=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[dt]||{};i[e]=t,this.props[dt]=i,this.save()}remove_event_timer(e){var t=(this.props[dt]||{})[e];return _(t)||(delete this.props[dt][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}(function(r){return r.Button="button",r.Tab="tab",r.Selector="selector",r})({});(function(r){return r.TopLeft="top_left",r.TopRight="top_right",r.TopCenter="top_center",r.MiddleLeft="middle_left",r.MiddleRight="middle_right",r.MiddleCenter="middle_center",r.Left="left",r.Center="center",r.Right="right",r.NextToTrigger="next_to_trigger",r})({});var yi=function(r){return r.Popover="popover",r.API="api",r.Widget="widget",r.ExternalSurvey="external_survey",r}({});(function(r){return r.Open="open",r.MultipleChoice="multiple_choice",r.SingleChoice="single_choice",r.Rating="rating",r.Link="link",r})({});
4(function(r){return r.NextQuestion="next_question",r.End="end",r.ResponseBased="response_based",r.SpecificQuestion="specific_question",r})({});(function(r){return r.Once="once",r.Recurring="recurring",r.Always="always",r})({});var Nt=function(r){return r.SHOWN="survey shown",r.DISMISSED="survey dismissed",r.SENT="survey sent",r}({}),Jr=function(r){return r.SURVEY_ID="$survey_id",r.SURVEY_NAME="$survey_name",r.SURVEY_RESPONSE="$survey_response",r.SURVEY_ITERATION="$survey_iteration",r.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",r.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",r.SURVEY_SUBMISSION_ID="$survey_submission_id",r.SURVEY_QUESTIONS="$survey_questions",r.SURVEY_COMPLETED="$survey_completed",r}({}),pn=function(r){return r.Popover="popover",r.Inline="inline",r}({});class sr{constructor(){this.ki={},this.ki={}}on(e,t){return this.ki[e]||(this.ki[e]=[]),this.ki[e].push(t),()=>{this.ki[e]=this.ki[e].filter(i=>i!==t)}}emit(e,t){for(var i of this.ki[e]||[])i(t);for(var s of this.ki["*"]||[])s(e,t)}}class Me{constructor(e){this.Pi=new sr,this.Ti=(t,i)=>this.Ri(t,i)&&this.Ii(t,i)&&this.Ci(t,i),this.Ri=(t,i)=>i==null||!i.event||t?.event===i?.event,this._instance=e,this.Oi=new Set,this.Fi=new Set}init(){var e;if(!_((e=this._instance)==null?void 0:e.Mi)){var t;(t=this._instance)==null||t.Mi((i,s)=>{this.on(i,s)})}}register(e){var t,i;if(!_((t=this._instance)==null?void 0:t.Mi)&&(e.forEach(a=>{var o,l;(o=this.Fi)==null||o.add(a),(l=a.steps)==null||l.forEach(u=>{var c;(c=this.Oi)==null||c.add(u?.event||"")})}),(i=this._instance)!=null&&i.autocapture)){var s,n=new Set;e.forEach(a=>{var o;(o=a.steps)==null||o.forEach(l=>{l!=null&&l.selector&&n.add(l?.selector)})}),(s=this._instance)==null||s.autocapture.setElementSelectors(n)}}on(e,t){var i;t!=null&&e.length!=0&&(this.Oi.has(e)||this.Oi.has(t?.event))&&this.Fi&&((i=this.Fi)==null?void 0:i.size)>0&&this.Fi.forEach(s=>{this.Ai(t,s)&&this.Pi.emit("actionCaptured",s.name)})}Di(e){this.onAction("actionCaptured",t=>e(t))}Ai(e,t){if(t?.steps==null)return!1;for(var i of t.steps)if(this.Ti(e,i))return!0;return!1}onAction(e,t){return this.Pi.on(e,t)}Ii(e,t){if(t!=null&&t.url){var i,s=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!s||typeof s!="string"||!Me.ji(s,t?.url,t?.url_matching||"contains"))return!1}return!0}static ji(e,t,i){switch(i){case"regex":return!!d&&tt(e,t);case"exact":return t===e;case"contains":var s=Me.Li(t).replace(/_/g,".").replace(/%/g,".*");return tt(e,s);default:return!1}}static Li(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Ci(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.Ni(e).some(n=>!(t!=null&&t.href&&!Me.ji(n.href||"",t?.href,t?.href_matching||"exact"))&&(t==null||!t.tag_name||n.tag_name===t?.tag_name)&&!(t!=null&&t.text&&!Me.ji(n.text||"",t?.text,t?.text_matching||"exact")&&!Me.ji(n.$el_text||"",t?.text,t?.text_matching||"exact"))))return!1;if(t!=null&&t.selector){var i,s=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(!s||!s.includes(t?.selector))return!1}return!0}Ni(e){return e?.properties.$elements==null?[]:e?.properties.$elements}}var C=j("[Surveys]"),Bi="seenSurvey_",uo=(r,e)=>{var t="$survey_"+e+"/"+r.id;return r.current_iteration&&r.current_iteration>0&&(t="$survey_"+e+"/"+r.id+"/"+r.current_iteration),t},Zr=r=>{var e=""+Bi+r.id;return r.current_iteration&&r.current_iteration>0&&(e=""+Bi+r.id+"_"+r.current_iteration),e},ho=[yi.Popover,yi.Widget,yi.API],po={ignoreConditions:!1,ignoreDelay:!1,displayType:pn.Popover};class fo{constructor(e){this._instance=e,this.Ui=new Map,this.zi=new Map}register(e){var t;_((t=this._instance)==null?void 0:t.Mi)||(this.Hi(e),this.Bi(e))}Bi(e){var t=e.filter(i=>{var s,n;return((s=i.conditions)==null?void 0:s.actions)&&((n=i.conditions)==null||(n=n.actions)==null||(n=n.values)==null?void 0:n.length)>0});t.length!==0&&(this.qi==null&&(this.qi=new Me(this._instance),this.qi.init(),this.qi.Di(i=>{this.onAction(i)})),t.forEach(i=>{var s,n,a,o,l;i.conditions&&(s=i.conditions)!=null&&s.actions&&(n=i.conditions)!=null&&(n=n.actions)!=null&&n.values&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((o=this.qi)==null||o.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(u=>{if(u&&u.name){var c=this.zi.get(u.name);c&&c.push(i.id),this.zi.set(u.name,c||[i.id])}}))}))}Hi(e){var t;e.filter(i=>{var s,n;return((s=i.conditions)==null?void 0:s.events)&&((n=i.conditions)==null||(n=n.events)==null||(n=n.values)==null?void 0:n.length)>0}).length!==0&&((t=this._instance)==null||t.Mi((i,s)=>{this.onEvent(i,s)}),e.forEach(i=>
4{var s;(s=i.conditions)==null||(s=s.events)==null||(s=s.values)==null||s.forEach(n=>{if(n&&n.name){var a=this.Ui.get(n.name);a&&a.push(i.id),this.Ui.set(n.name,a||[i.id])}})}))}onEvent(e,t){var i,s,n=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[Ct])||[];if(Nt.SHOWN===e&&t&&n.length>0){var a;C.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:n});var o=t==null||(a=t.properties)==null?void 0:a.$survey_id;if(o){var l=n.indexOf(o);l>=0&&(n.splice(l,1),this.Wi(n))}}else if(this.Ui.has(e)){C.info("survey event name matched",{event:e,eventPayload:t,surveys:this.Ui.get(e)});var u=[];(s=this._instance)==null||s.getSurveys(h=>{u=h.filter(f=>{var p;return(p=this.Ui.get(e))==null?void 0:p.includes(f.id)})});var c=u.filter(h=>{var f,p=(f=h.conditions)==null||(f=f.events)==null||(f=f.values)==null?void 0:f.find(v=>v.name===e);return!!p&&(!p.propertyFilters||Object.entries(p.propertyFilters).every(v=>{var g,[y,E]=v,$=t==null||(g=t.properties)==null?void 0:g[y];if(_($)||be($))return!1;var P=[String($)],S=dn[E.operator];return S?S(E.values,P):(C.warn("Unknown property comparison operator: "+E.operator),!1)}))});this.Wi(n.concat(c.map(h=>h.id)||[]))}}onAction(e){var t,i=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[Ct])||[];this.zi.has(e)&&this.Wi(i.concat(this.zi.get(e)||[]))}Wi(e){var t;C.info("updating activated surveys",{activatedSurveys:e}),(t=this._instance)==null||(t=t.persistence)==null||t.register({[Ct]:[...new Set(e)]})}getSurveys(){var e,t=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[Ct];return t||[]}getEventToSurveys(){return this.Ui}Gi(){return this.qi}}class go{constructor(e){this.Vi=void 0,this._surveyManager=null,this.Ji=!1,this.Ki=!1,this.Yi=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(T(t))return C.warn("Flags not loaded yet. Not loading surveys.");var i=R(t);this.Vi=i?t.length>0:t,C.info("flags response received, isSurveysEnabled: "+this.Vi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(i!=null&&i.startsWith(Bi)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(s=>localStorage.removeItem(s))}loadIfEnabled(){if(!this._surveyManager)if(this.Ki)C.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)C.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())C.info("Not loading surveys in cookieless mode without consent.");else{var e=x?.__PosthogExtensions__;if(e){if(!_(this.Vi)||this._instance.config.advanced_enable_surveys){var t=this.Vi||this._instance.config.advanced_enable_surveys;this.Ki=!0;try{var i=e.generateSurveys;if(i)return void this.Xi(i,t);var s=e.loadExternalDependency;if(!s)return void this.Qi("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",n=>{n||!e.generateSurveys?this.Qi("Could not load surveys script",n):this.Xi(e.generateSurveys,t)})}catch(n){throw this.Qi("Error initializing surveys",n),n}finally{this.Ki=!1}}}else C.error("PostHog Extensions not found.")}}Xi(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new fo(this._instance),C.info("Surveys loaded successfully"),this.Zi({isLoaded:!0})}Qi(e,t){C.error(e,t),this.Zi({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Yi.push(e),this._surveyManager&&this.Zi({isLoaded:!0}),()=>{this.Yi=this.Yi.filter(t=>t!==e)}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return C.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(Oi);if(i&&!t)return e(i,{isLoaded:!0});if(this.Ji)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.Ji=!0,this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:s=>{var n;this.Ji=!1;var a=s.statusCode;if(a!==200||!s.json){var o="Surveys API could not be loaded, status: "+a;return C.error(o),e([],{isLoaded:!1,error:o})}var l,u=s.json.surveys||[],c=u.filter(h=>function(f){return!(!f.start_date||f.end_date)}
vendor: 58,249 bytes, line 4
4(h)&&(function(f){var p;return!((p=f.conditions)==null||(p=p.events)==null||(p=p.values)==null||!p.length)}(h)||function(f){var p;return!((p=f.conditions)==null||(p=p.actions)==null||(p=p.values)==null||!p.length)}(h)));return c.length>0&&((l=this._surveyEventReceiver)==null||l.register(c)),(n=this._instance.persistence)==null||n.register({[Oi]:u}),e(u,{isLoaded:!0})}})}catch(s){throw this.Ji=!1,s}}Zi(e){for(var t of this.Yi)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(i){C.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!T(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);C.warn("init was not called")}te(e){var t=null;return this.getSurveys(i=>{var s;t=(s=i.find(n=>n.id===e))!==null&&s!==void 0?s:null}),t}ie(e){if(T(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this.te(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(T(this._surveyManager))return C.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.ie(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return T(this._surveyManager)?(C.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(s=>{var n,a=(n=s.find(l=>l.id===e))!==null&&n!==void 0?n:null;if(a){var o=this.ie(a);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){var i;if(T(this._surveyManager))C.warn("init was not called");else{var s=typeof e=="string"?this.te(e):e;if(s!=null&&s.id)if(ho.includes(s.type)){var n=m?.querySelector(t);if(n)return(i=s.appearance)!=null&&i.surveyPopupDelaySeconds?(C.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var a,o;C.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(s,n),C.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n);C.warn("Survey element not found")}else C.warn("Surveys of type "+s.type+" cannot be rendered in the app");else C.warn("Survey not found")}}displaySurvey(e,t){var i;if(T(this._surveyManager))C.warn("init was not called");else{var s=this.te(e);if(s){var n=s;if((i=s.appearance)!=null&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(n=w({},s,{appearance:w({},s.appearance,{surveyPopupDelaySeconds:0})})),t.ignoreConditions===!1){var a=this.canRenderSurvey(s);if(!a.visible)return void C.warn("Survey is not eligible to be displayed: ",a.disabledReason)}t.displayType!==pn.Inline?this._surveyManager.handlePopoverSurvey(n):this.renderSurvey(n,t.selector)}else C.warn("Survey not found")}}}var Qr=j("[RateLimiter]");class vo{constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=s=>{var n=s.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(a=>{Qr.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void Qr.warn('could not rate limit - continuing. Error: "'+a?.message+'"',{text:n})}},this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)==null?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,i,s;e===void 0&&(e=!1);var n=new Date().getTime(),a=(t=(i=this.instance.persistence)==null?void 0:i.get_property(Ri))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:n};a.tokens+=(n-a.last)/1e3*this.captureEventsPerSecond,a.last=n,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var o=a.tokens<1;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(s=this.instance.persistence)==null||s.set_property(Ri,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var Le=j("[RemoteConfig]");class _o{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=x._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}ee(e){var t,i;(t=x.__PosthogExtensions__)!=null&&t.loadExternalDependency?(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(Le.error("PostHog Extensions not found. Cannot load remote config."),e())}re(e){this._instance.ci({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:t=>{e(t.json)}})}load(){try{if(this.remoteConfig)return Le.info("Using preloaded remote config",this.remoteConfig),void this.fi(this.remoteConfig);if(this._instance.M())return void Le.warn("Remote config is disabled. Falling back to local config.");this.ee(e=>{if(!e)return Le.info("No config found after loading remote JS config. Falling back to JSON."),void this.re(t=>{this.fi(t)});this.fi(e)})}catch(e){Le.error("Error loading remote config",e)}}fi(e){e?this._instance.config.__preview_remote_config?(this._instance.fi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):Le.info("__preview_remote_config is disabled. Logging config instead",e):Le.error("Failed to fetch remote config from PostHog.")}}var Vi=3e3;class mo{constructor(e,t){this.se=!0,this.ne=[],this.oe=ue(t?.flush_interval_ms||Vi,250,5e3,b.createLogger("flush interval"),Vi),this.ae=e}enqueue(e){this.ne.push(e),this.le||this.ue()}unload(){this.he();var e=this.ne.length>0?this.de():{},t=Object.values(e);[...t.filter(i=>i.url.indexOf("/e")===0),...t.filter(i=>i.url.indexOf("/e")!==0)].map(i=>{this.ae(w({},i,{transport:"sendBeacon"}))})}enable(){this.se=!1,this.ue()}ue(){var e=this;this.se||(this.le=setTimeout(()=>{if(this.he(),this.ne.length>0){var t=this.de(),i=function(){var n=t[s],a=new Date().getTime();n.data&&R(n.data)&&O(n.data,o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp}),e.ae(n)};for(var s in t)i()}},this.oe))}he(){clearTimeout(this.le),this.le=void 0}de(){var e={};return O(this.ne,t=>{var i,s=t,n=(s?s.batchKey:null)||s.url;_(e[n])&&(e[n]=w({},s,{data:[]})),(i=e[n].data)==null||i.push(s.data)}),this.ne=[],e}}var yo=["retriesPerformedSoFar"];class bo{constructor(e){this.ve=!1,this.ce=3e3,this.ne=[],this._instance=e,this.ne=[],this.fe=!0,!_(d)&&"onLine"in d.navigator&&(this.fe=d.navigator.onLine,this.pe=()=>{this.fe=!0,this.Dt()},this.ge=()=>{this.fe=!1},N(d,"online",this.pe),N(d,"offline",this.ge))}get length(){return this.ne.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=ls(e,yo);pe(t)&&t>0&&(i.url=Jt(i.url,{retry_count:t})),this._instance.ci(w({},i,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(t??0)<10?this._e(w({retriesPerformedSoFar:t},i)):i.callback==null||i.callback(s)}}))}_e(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(a){var o=3e3*Math.pow(2,a),l=o/2,u=Math.min(18e5,o),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)}(t),s=Date.now()+i;this.ne.push({retryAt:s,requestOptions:e});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),b.warn(n),this.ve||(this.ve=!0,this.me())}me(){if(this.ye&&clearTimeout(this.ye),this.ne.length===0)return this.ve=!1,void(this.ye=void 0);this.ye=setTimeout(()=>{this.fe&&this.ne.length>0&&this.Dt(),this.me()},this.ce)}Dt(){var e=Date.now(),t=[],i=this.ne.filter(n=>n.retryAt<e||(t.push(n),!1));if(this.ne=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.ye&&(clearTimeout(this.ye),this.ye=void 0),this.ve=!1,_(d)||(this.pe&&(d.removeEventListener("online",this.pe),this.pe=void 0),this.ge&&(d.removeEventListener("offline",this.ge),this.ge=void 0)),this.ne))try{this._instance.ci(w({},e,{transport:"sendBeacon"}))}catch(t){b.error(t)}this.ne=[]}}class wo{constructor(e){this.be=()=>{var t,i,s,n;this.we||(this.we={});var a=this.scrollElement(),o=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,u=o+(a?.clientHeight||0),c=a?.scrollHeight||0;this.we.lastScrollY=Math.ceil(o),this.we.maxScrollY=Math.max(o,(t=this.we.maxScrollY)!==null&&t!==void 0?t:0),this.we.maxScrollHeight=Math.max(l,(i=this.we.maxScrollHeight)!==null&&i!==void 0?i:0),this.we.lastContentY=u,this.we.maxContentY=Math.max(u,(s=this.we.maxContentY)!==null&&s!==void 0?s:0),this.we.maxContentHeight=Math.max(c,(n=this.we.maxContentHeight)!==null&&n!==void 0?n:0)},this._instance=e}getContext(){return this.we}resetContext(){var e=this.we;return setTimeout(this.be,0),e}startMeasuringScrollPosition(){N(d,"scroll",this.be,{capture:!0}),N(d,"scrollend",this.be,{capture:!0}),N(d,"resize",this.be)}scrollElement(){if(!this._instance.config.scroll_root_selector)return d?.document.documentElement;var e=R(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var i=d?.document.querySelector(t);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return d&&(d.scrollY||d.pageYOffset||d.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return d&&(d.scrollX||d.pageXOffset||d.document.documentElement.scrollLeft)||0}}var Eo=r=>sn(r?.config.mask_personal_data_properties,r?.config.custom_personal_data_properties);class es{constructor(e,t,i,s){this.xe=n=>{var a=this.Se();if(!a||a.sessionId!==n){var o={sessionId:n,props:this.Ee(this._instance)};this.$e.register({[Ti]:o})}},this._instance=e,this.ke=t,this.$e=i,this.Ee=s||Eo,this.ke.onSessionId(this.xe)}Se(){return this.$e.props[Ti]}getSetOnceProps(){var e,t=(e=this.Se())==null?void 0:e.props;return t?"r"in t?nn(t):{$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 O(Yi(this.getSetOnceProps()),(t,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+ki(i)]=t}),e}}var bi=j("[SessionId]");class ts{on(e,t){return this.Pe.on(e,t)}constructor(e,t,i){var s;if(this.Te=[],this.Re=void 0,this.Pe=new sr,this.Ie=(c,h)=>Math.abs(c-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.C=e.config,this.$e=e.persistence,this.Ce=void 0,this.Oe=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Fe=t||Ie,this.Me=i||Ie;var n=this.C.persistence_name||this.C.token,a=this.C.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*ue(a,60,36e3,bi.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ae(),this.De="ph_"+n+"_window_id",this.je="ph_"+n+"_primary_window_exists",this.Le()){var o=H.W(this.De),l=H.W(this.je);o&&!l?this.Ce=o:H.V(this.De),H.G(this.je,!0)}if((s=this.C.bootstrap)!=null&&s.sessionID)try{var u=(c=>{var h=c.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})(this.C.bootstrap.sessionID);this.Ne(this.C.bootstrap.sessionID,new Date().getTime(),u)}catch(c){bi.error("Invalid sessionID in bootstrap",c)}this.Ue()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return _(this.Te)&&(this.Te=[]),this.Te.push(e),this.Oe&&e(this.Oe,this.Ce),()=>{this.Te=this.Te.filter(t=>t!==e)}}Le(){return this.C.persistence!=="memory"&&!this.$e.wi&&H.H()}ze(e){e!==this.Ce&&(this.Ce=e,this.Le()&&H.G(this.De,e))}He(){return this.Ce?this.Ce:this.Le()?H.W(this.De):null}Ne(e,t,i){e===this.Oe&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Oe=e,this.$e.register({[Ht]:[t,e,i]}))}Be(){if(this.Oe&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.Oe,this._sessionStartTimestamp];var e=this.$e.props[Ht];return R(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ne(null,null,null)}destroy(){clearTimeout(this.qe),this.qe=void 0,this.Re&&d&&(d.removeEventListener("beforeunload",this.Re,{capture:!1}),this.Re=void 0),this.Te=[]}Ue(){this.Re=()=>{this.Le()&&H.V(this.je)},N(d,"beforeunload",this.Re,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.C.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||new Date().getTime(),[s,n,a]=this.Be(),o=this.He(),l=pe(a)&&a>0&&Math.abs(i-a)>864e5,u=!1,c=!n,h=!c&&!e&&this.Ie(i,s);c||h||l?(n=this.Fe(),o=this.Me(),bi.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:c,activityTimeout:h,sessionPastMaximumLength:l}}),a=i,u=!0):o||(o=this.Me(),u=!0);var f=s===0||!e||l?i:s,p=a===0?new Date().getTime():a;return this.ze(o),this.Ne(n,f,p),e||this.Ae(),u&&this.Te.forEach(v=>v(n,o,u?{noSessionId:c,activityTimeout:h,sessionPastMaximumLength:l}:void 0)),{sessionId:n,windowId:o,sessionStartTimestamp:p,changeReason:u?{noSessionId:c,activityTimeout:h,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:s}}Ae(){clearTimeout(this.qe),this.qe=setTimeout(()=>{var[e]=this.Be();if(this.Ie(new Date().getTime(),e)){var t=this.Oe;this.resetSessionId(),this.Pe.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var xo=["$set_once","$set"],Pe=j("[SiteApps]");class ko{constructor(e){this._instance=e,this.We=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ge(e,t){if(t){var i=this.globalsForEvent(t);this.We.push(i),this.We.length>1e3&&(this.We=this.We.slice(10))}}get siteAppLoaders(){var e;return(e=x._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Mi(this.Ge.bind(this));this.Ve=()=>{e(),this.We=[],this.Ve=void 0}}}globalsForEvent(e){var t,i,s,n,a,o,l;if(!e)throw new Error("Event payload is required");var u={},c=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var[f,p]of Object.entries(h))u[f]={id:c[f],type:f,properties:p};var{$set_once:v,$set:g}=e;return{event:w({},ls(e,xo),{properties:w({},e.properties,g?{$set:w({},(t=(i=e.properties)==null?void 0:i.$set)!==null&&t!==void 0?t:{},g)}:{},v?{$set_once:w({},(s=(n=e.properties)==null?void 0:n.$set_once)!==null&&s!==void 0?s:{},v)}:{}),elements_chain:(a=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var o;!t.errored&&this.We.length&&(Pe.info("Processing "+this.We.length+" events for site app with id "+e.id),this.We.forEach(l=>t.processEvent==null?void 0:t.processEvent(l)),t.processedBuffer=!0),Object.values(this.apps).every(l=>l.processedBuffer||l.errored)&&((o=this.Ve)==null||o.call(this))},s=!1,n=o=>{t.errored=!o,t.loaded=!0,Pe.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),s&&i()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:o=>{n(o)}});a&&(t.processEvent=a),s=!0}catch(o){Pe.error("Error while initializing PostHog app with config id "+e.id,o),n(!1)}if(s&&t.loaded)try{i()}catch(o){Pe.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}Je(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}Ke(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(t)}catch(s){Pe.error("Error while processing event "+e.event+" for site app "+i.id,s)}}}onRemoteConfig(e){var t,i,s,n=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Je(),void this._instance.on("eventCaptured",u=>this.Ke(u))):void Pe.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.Ve)==null||i.call(this),(s=e.siteApps)!=null&&s.length)if(this.isEnabled){var a=function(u){var c;x["__$$ph_site_app_"+u]=n._instance,(c=x.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(n._instance,l,h=>{if(h)return Pe.error("Error while initializing PostHog app with config id "+u,h)})};for(var{id:o,url:l}of e.siteApps)a(o)}else Pe.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var fn=function(r,e){if(!r)return!1;var t=r.userAgent;if(t&&gr(t,e))return!0;try{var i=r?.userAgentData;if(i!=null&&i.brands&&i.brands.some(s=>gr(s?.brand,e)))return!0}catch{}return!!r.webdriver},_t=function(r){return r.US="us",r.EU="eu",r.CUSTOM="custom",r}({}),is="i.posthog.com";class So{constructor(e){this.Ye={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+is,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.Ye[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ye[this.apiHost]=_t.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ye[this.apiHost]=_t.EU:this.Ye[this.apiHost]=_t.CUSTOM),this.Ye[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(this.region===_t.CUSTOM)return this.apiHost+t;var i=is+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Po={icontains:(r,e)=>!!d&&e.href.toLowerCase().indexOf(r.toLowerCase())>-1,not_icontains:(r,e)=>!!d&&e.href.toLowerCase().indexOf(r.toLowerCase())===-1,regex:(r,e)=>!!d&&tt(e.href,r),not_regex:(r,e)=>!!d&&!tt(e.href,r),exact:(r,e)=>e.href===r,is_not:(r,e)=>e.href!==r};class U{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),t.getWebExperiments(s=>{U.Xe("retrieved web experiments from the server"),t.Qe=new Map,s.forEach(n=>{if(n.feature_flag_key){var a;t.Qe&&(U.Xe("setting flag key ",n.feature_flag_key," to web experiment ",n),(a=t.Qe)==null||a.set(n.feature_flag_key,n));var o=t._instance.getFeatureFlag(n.feature_flag_key);M(o)&&n.variants[o]&&t.Ze(n.name,o,n.variants[o].transforms)}else if(n.variants)for(var l in n.variants){var u=n.variants[l];U.tr(u)&&t.Ze(n.name,l,u.transforms)}})},i)},this._instance=e,this._instance.onFeatureFlags(i=>{this.onFeatureFlags(i)})}onFeatureFlags(e){if(this._is_bot())U.Xe("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(T(this.Qe))return this.Qe=new Map,this.loadIfEnabled(),void this.previewWebExperiment();U.Xe("applying feature flags",e),e.forEach(t=>{var i;if(this.Qe&&(i=this.Qe)!=null&&i.has(t)){var s,n=this._instance.getFeatureFlag(t),a=(s=this.Qe)==null?void 0:s.get(t);n&&a!=null&&a.variants[n]&&this.Ze(a.name,n,a.variants[n].transforms)}})}}previewWebExperiment(){var e=U.getWindowLocation();if(e!=null&&e.search){var t=Gt(e?.search,"__experiment_id"),i=Gt(e?.search,"__experiment_variant");t&&i&&(U.Xe("previewing web experiments "+t+" && "+i),this.getWebExperiments(s=>{this.ir(parseInt(t),i,s)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance.ci({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:n=>{if(n.statusCode!==200||!n.json)return e([]);var a=n.json.experiments||[];return e(a)}})}ir(e,t,i){var s=i.filter(n=>n.id===e);s&&s.length>0&&(U.Xe("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Ze(s[0].name,t,s[0].variants[t].transforms))}static tr(e){return!T(e.conditions)&&U.er(e)&&U.rr(e)}static er(e){var t;if(T(e.conditions)||T((t=e.conditions)==null?void 0:t.url))return!0;var i,s,n,a=U.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||Po[(s=(n=e.conditions)==null?void 0:n.urlMatchType)!==null&&s!==void 0?s:"icontains"](e.conditions.url,a))}static getWindowLocation(){return d?.location}static rr(e){var t;if(T(e.conditions)||T((t=e.conditions)==null?void 0:t.utm))return!0;var i=Qs();if(i.utm_source){var s,n,a,o,l,u,c,h,f=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((n=e.conditions)==null||(n=n.utm)==null?void 0:n.utm_campaign)==i.utm_campaign,p=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==i.utm_source,v=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==i.utm_medium,g=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==i.utm_term;return f&&v&&g&&p}return!1}static Xe(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];b.info("[WebExperiments] "+e,i)}Ze(e,t,i){this._is_bot()?U.Xe("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?i.forEach(s=>{if(s.selector){var n;U.Xe("applying transform of variant "+t+" for experiment "+e+" ",s);var a=(n=document)==null?void 0:n.querySelectorAll(s.selector);a?.forEach(o=>{var l=o;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)})}}):U.Xe("Control variants leave the page unmodified.")}_is_bot(){return Q&&this._instance?fn(Q,this._instance.config.custom_blocked_useragents):void 0}}var $o=j("[PostHog ExternalIntegrations]"),Io={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Co{constructor(e){this._instance=e}it(e,t){var i;(i=x.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,s=>{if(s)return $o.error("failed to load script",s);t()})}startIfEnabledOrStop(){var e=this,t=function(a){var o,l,u;!s||(o=x.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[a]||e.it(Io[a],()=>{var c;(c=x.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.start(e._instance)}),!s&&(l=x.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((u=x.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.stop())};for(var[i,s]of Object.entries((n=this._instance.config.integrations)!==null&&n!==void 0?n:{})){var n;t(i)}}}var Wi="[SessionRecording]",ut=j(Wi);class rs{get started(){var e;return!((e=this.sr)==null||!e.isStarted)}get status(){return this.sr?this.sr.status:this.nr&&!this.ar?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.nr=!1,this.lr=void 0,this._instance=e,!this._instance.sessionManager)throw ut.error("started without valid sessionManager"),new Error(Wi+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Wi+' cannot be used with cookieless_mode="always"')}get ar(){var e,t=!((e=this._instance.get_property(oi))==null||!e.enabled),i=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return d&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!this.ar||(t=this.sr)==null||!t.isStarted){var i=!_(Object.assign)&&!_(Array.from);this.ar&&i?(this.ur(e),ut.info("starting")):this.stopRecording()}}ur(e){var t,i,s;this.ar&&(x!=null&&(t=x.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(i=x.__PosthogExtensions__)!=null&&i.initSessionRecording?this.hr(e):(s=x.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,this.dr,n=>{if(n)return ut.error("could not load recorder",n);this.hr(e)}))}stopRecording(){var e,t;(e=this.lr)==null||e.call(this),this.lr=void 0,(t=this.sr)==null||t.stop()}vr(){var e;(e=this._instance.persistence)==null||e.unregister(ms)}cr(e){if(this._instance.persistence){var t,i,s=this._instance.persistence,n=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,o=a?.sampleRate,l=T(o)?null:parseFloat(o);T(l)&&this.vr();var u=a?.minimumDurationMilliseconds;s.register({[oi]:w({enabled:!!a},a,{networkPayloadCapture:w({capturePerformance:e.capturePerformance},a?.networkPayloadCapture),canvasRecording:{enabled:a?.recordCanvas,fps:a?.canvasFps,quality:a?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:_(u)?null:u,endpoint:a?.endpoint,triggerMatchType:a?.triggerMatchType,masking:a?.masking,urlTriggers:a?.urlTriggers})})};n(),(t=this.lr)==null||t.call(this),this.lr=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(n)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.cr(e),this.nr=!0,this.startIfEnabledOrStop()):this.nr=!0:ut.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;t===void 0&&(t="log"),(i=this.sr)!=null&&i.log?this.sr.log(e,t):ut.warn("log called before recorder was ready")}get dr(){var e,t,i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(oi);return(i==null||(t=i.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}hr(e){var t,i;if((t=x.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.sr||(this.sr=(i=x.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance),this.sr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.sr.start(e)}onRRwebEmit(e){var t;(t=this.sr)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e;(e=this.sr)==null||e.overrideLinkedFlag()}overrideSampling(){var e;(e=this.sr)==null||e.overrideSampling()}overrideTrigger(e){var t;(t=this.sr)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.sr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!((i=this.sr)==null||!i.tryAddCustomEvent(e,t))}}var bt={},Gi=()=>{},Ge="posthog",gn=!so&&G?.indexOf("MSIE")===-1&&G?.indexOf("Mozilla")===-1,ss=r=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:ea(m?.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Gi,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:r!=="2025-05-24"||"history_change",capture_pageleave:"if_capture_pageview",defaults:r??"unset",debug:z&&M(z?.search)&&z.search.indexOf("__posthog_debug=true")!==-1||!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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(d==null||(e=d.location)==null?void 0:e.protocol)==="https:",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,session_recording:{},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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var i="Bad HTTP status: "+t.statusCode+" "+t.text;b.error(i)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Vi},error_tracking:{},_onCapture:Gi,__preview_eager_load_replay:!1}},ns=r=>{var e={};_(r.process_person)||(e.person_profiles=r.process_person),_(r.xhr_headers)||(e.request_headers=r.xhr_headers),_(r.cookie_name)||(e.persistence_name=r.cookie_name),_(r.disable_cookie)||(e.disable_persistence=r.disable_cookie),_(r.store_google)||(e.save_campaign_params=r.store_google),_(r.verbose)||(e.debug=r.verbose);var t=L({},e,r);return R(r.property_blacklist)&&(_(r.property_denylist)?t.property_denylist=r.property_blacklist:R(r.property_denylist)?t.property_denylist=[...r.property_blacklist,...r.property_denylist]:b.error("Invalid value for property_denylist config: "+r.property_denylist)),t};class Fo{constructor(){this.__forceAllowLocalhost=!1}get pr(){return this.__forceAllowLocalhost}set pr(e){b.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class ii{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new Fo,this.gr=!1,this.version=ve.LIB_VERSION,this._r=new sr,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ss(),this.SentryIntegration=$a,this.sentryIntegration=e=>function(t,i){var s=Ls(t,i);return{name:Ds,processEvent:n=>s(n)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.mr=!1,this.yr=null,this.br=null,this.wr=null,this.featureFlags=new lo(this),this.toolbar=new Ca(this),this.scrollManager=new wo(this),this.pageViewManager=new Xa(this),this.surveys=new go(this),this.experiments=new U(this),this.exceptions=new no(this),this.rateLimiter=new vo(this),this.requestRouter=new So(this),this.consent=new wa(this),this.externalIntegrations=new Co(this),this.people={set:(e,t,i)=>{var s=M(e)?{[e]:t}:e;this.setPersonProperties(s),i?.({})},set_once:(e,t,i)=>{var s=M(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),i?.({})}},this.on("eventCaptured",e=>b.info('send "'+e?.event+'"',e))}init(e,t,i){if(i&&i!==Ge){var s,n=(s=bt[i])!==null&&s!==void 0?s:new ii;return n._init(e,t,i),bt[i]=n,bt[Ge][i]=n,n}return this._init(e,t,i)}_init(e,t,i){var s,n;if(t===void 0&&(t={}),_(e)||Si(e))return b.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Sr(t.debug),this.Er=t,this.$r=[],t.person_profiles&&(this.br=t.person_profiles),this.set_config(L({},ss(t.defaults),ns(t),{name:i,token:e})),this.config.on_xhr_error&&b.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:ye.GZipJS;var a=this.kr();this.persistence=new mi(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new mi(w({},this.config,{persistence:"sessionStorage"}),a);var o=w({},this.persistence.props),l=w({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Pr=new mo(P=>this.Tr(P),this.config.request_queue_config),this.Rr=new bo(this),this.__request_queue=[];var u=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(u||(this.sessionManager=new ts(this),this.sessionPropsManager=new es(this,this.sessionManager,this.persistence)),new Oa(this).startIfEnabledOrStop(),this.siteApps=new ko(this),(s=this.siteApps)==null||s.init(),u||(this.sessionRecording=new rs(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new pa(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Ya(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Ga(this),this.exceptionObserver=new ka(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new As(this,xa),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new Sa(this),this.historyAutocapture.startIfEnabled(),ve.DEBUG=ve.DEBUG||this.config.debug,ve.DEBUG&&b.info("Starting in debug mode",{this:this,config:t,thisC:w({},this.config),p:o,s:l}),((n=t.bootstrap)==null?void 0:n.distinctID)!==void 0){var c,h,f=this.config.get_device_id(Ie()),p=(c=t.bootstrap)!=null&&c.isIdentifiedID?f:t.bootstrap.distinctID;this.persistence.set_property(_e,(h=t.bootstrap)!=null&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:p})}if(this.Ir()){var v,g,y=Object.keys(((v=t.bootstrap)==null?void 0:v.featureFlags)||{}).filter(P=>{var S;return!((S=t.bootstrap)==null||(S=S.featureFlags)==null||!S[P])}).reduce((P,S)=>{var F;return P[S]=((F=t.bootstrap)==null||(F=F.featureFlags)==null?void 0:F[S])||!1,P},{}),E=Object.keys(((g=t.bootstrap)==null?void 0:g.featureFlagPayloads)||{}).filter(P=>y[P]).reduce((P,S)=>{var F,q;return(F=t.bootstrap)!=null&&(F=F.featureFlagPayloads)!=null&&F[S]&&(P[S]=(q=t.bootstrap)==null||(q=q.featureFlagPayloads)==null?void 0:q[S]),P},{});this.featureFlags.receivedFeatureFlags({featureFlags:y,featureFlagPayloads:E})}if(u)this.register_once({distinct_id:st,$device_id:null},"");else if(!this.get_distinct_id()){var $=this.config.get_device_id(Ie());this.register_once({distinct_id:$,$device_id:$},""),this.persistence.set_property(_e,"anonymous")}return N(d,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Pa(this,()=>this.Cr()):this.Cr(),Ce(this.config._onCapture)&&this.config._onCapture!==Gi&&(b.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",P=>this.config._onCapture(P.event,P))),this.config.ip&&b.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}fi(e){var t,i,s,n,a,o,l,u;if(!m||!m.body)return b.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.fi(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=k(e.supportedCompression,ye.GZipJS)?ye.GZipJS:k(e.supportedCompression,ye.Base64)?ye.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.br?this.br:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(s=this.sessionRecording)==null||s.onRemoteConfig(e),(n=this.autocapture)==null||n.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(o=this.webVitalsAutocapture)==null||o.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(u=this.deadClicksAutocapture)==null||u.onRemoteConfig(e)}Cr(){try{this.config.loaded(this)}catch(e){b.critical("`loaded` function failed",e)}this.Or(),this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Fr()},1),new _o(this).load(),this.featureFlags.flags()}Or(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Pr)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Oe(this.__request_queue,e=>this.Tr(e)),this.__request_queue=[],this.Or()}_handle_unload(){var e,t;this.config.request_batching?(this.Mr()&&this.capture("$pageleave"),(e=this.Pr)==null||e.unload(),(t=this.Rr)==null||t.unload()):this.Mr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ci(e){this.__loaded&&(gn?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Jt(e.url,{ip:this.config.ip?1:0}),e.headers=w({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var i,s,n,a=w({},t);a.timeout=a.timeout||6e4,a.url=Jt(a.url,{_:new Date().getTime().toString(),ver:ve.LIB_VERSION,compression:a.compression});var o=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=Lt.filter(c=>!a.disableTransport||!c.transport||!a.disableTransport.includes(c.transport)),u=(s=(n=gs(l,c=>c.transport===o))==null?void 0:n.method)!==null&&s!==void 0?s:l[0].method;if(!u)throw new Error("No available transport method");u(a)})(w({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((i=(s=this.config).on_request_error)==null||i.call(s,t)),e.callback==null||e.callback(t)}}))))}Tr(e){this.Rr?this.Rr.retriableRequest(e):this.ci(e)}_execute_array(e){var t,i=[],s=[],n=[];Oe(e,o=>{o&&(t=o[0],R(t)?n.push(o):Ce(o)?o.call(this):R(o)&&t==="alias"?i.push(o):R(o)&&t.indexOf("capture")!==-1&&Ce(this[t])?n.push(o):s.push(o))});var a=function(o,l){Oe(o,function(u){if(R(u[0])){var c=l;O(u,function(h){c=c[h[0]].apply(c,h.slice(1))})}else this[u[0]].apply(this,u.slice(1))},l)};a(i,this),a(s,this),a(n,this)}Ir(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Pr){if(this.is_capturing())if(!_(e)&&M(e)){var n=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(n&&!this.config.__preview_capture_bot_pageviews)){var a=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){t!=null&&t.$current_url&&!M(t?.$current_url)&&(b.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,l=i?.timestamp||o,u=Ie(),c={uuid:u,event:e,properties:this.calculateEventProperties(e,t||{},l,u)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&n&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),a&&(c.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),i?.$set&&(c.$set=i?.$set);var h,f=this.Ar(i?.$set_once);if(f&&(c.$set_once=f),(c=Zn(c,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,_(i?.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=o),e===Nt.DISMISSED||e===Nt.SENT){var p=t?.[Jr.SURVEY_ID],v=t?.[Jr.SURVEY_ITERATION];h={id:p,current_iteration:v},localStorage.getItem(Zr(h))||localStorage.setItem(Zr(h),"true"),c.$set=w({},c.$set,{[uo({id:p,current_iteration:v},e===Nt.SENT?"responded":"dismissed")]:!0})}var g=w({},c.properties.$set,c.$set);if(Ye(g)||this.setPersonPropertiesForFlags(g),!T(this.config.before_send)){var y=this.Dr(c);if(!y)return;c=y}this._r.emit("eventCaptured",c);var E={method:"POST",url:(s=i?._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.Tr(E):this.Pr.enqueue(E),c}b.critical("This capture call is ignored due to client rate limiting.")}}else b.error("No event name provided to posthog.capture")}else b.uninitializedWarning("posthog.capture")}Mi(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var a=n?void 0:this.persistence.remove_event_timer(e),o=w({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=w({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!M(o.distinct_id)&&!pe(o.distinct_id)||Si(o.distinct_id))&&b.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var u,c=Wa(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());o.$session_id=h,o.$window_id=f}this.sessionPropsManager&&L(o,this.sessionPropsManager.getSessionProps());try{var p;this.sessionRecording&&L(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(p=this.Rr)==null?void 0:p.length}catch(E){o.$sdk_debug_error_capturing_properties=String(E)}if(this.requestRouter.region===_t.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||n?e!=="$pageleave"||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),o=L(o,u),e==="$pageview"&&m&&(o.title=m.title),!_(a)){var v=i.getTime()-a;o.$duration=parseFloat((v/1e3).toFixed(3))}G&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=L({},c,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),R(this.config.property_denylist)?O(this.config.property_denylist,function(E){delete o[E]}):b.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(b.error("sanitize_properties is deprecated. Use before_send instead"),o=g(o,e));var y=this.jr();return o.$process_person_profile=y,y&&!n&&this.Lr("_calculate_event_properties"),o}Ar(e){var t;if(!this.persistence||!this.jr()||this.gr)return e;var i=this.persistence.get_initial_props(),s=(t=this.sessionPropsManager)==null?void 0:t.getSetOnceProps(),n=L({},i,s||{},e||{}),a=this.config.sanitize_properties;return a&&(b.error("sanitize_properties is deprecated. Use before_send instead"),n=a(n,"$set_once")),this.gr=!0,Ye(n)?void 0:n}register(e,t){var i;(i=this.persistence)==null||i.register(e,t)}register_once(e,t,i){var s;(s=this.persistence)==null||s.register_once(e,t,i)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}Nr(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this._r.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return(t=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){t===void 0&&(t=po),this.surveys.displaySurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return b.uninitializedWarning("posthog.identify");if(pe(e)&&(e=e.toString(),b.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))b.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==st){if(this.Lr("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var n=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:n},"")}e!==s&&e!==this.get_property(ht)&&(this.unregister(ht),this.register({distinct_id:e}));var a=(this.persistence.get_property(_e)||"anonymous")==="anonymous";e!==s&&a?(this.persistence.set_property(_e,"identified"),this.setPersonPropertiesForFlags(w({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.wr=zr(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(qt))}}else b.critical('The string "'+st+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else b.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Lr("posthog.setPersonProperties")){var i=zr(this.get_distinct_id(),e,t);this.wr!==i?(this.setPersonPropertiesForFlags(w({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.wr=i):b.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.Lr("posthog.group")){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:w({},s,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),s[e]===t||i||this.reloadFeatureFlags()}}else b.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.Lr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,s,n;if(b.info("reset"),!this.__loaded)return b.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),this.featureFlags.reset(),(s=this.persistence)==null||s.set_property(_e,"anonymous"),(n=this.sessionManager)==null||n.resetSessionId(),this.wr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:st,$device_id:null},"");else{var o=this.config.get_device_id(Ie());this.register_once({distinct_id:o,$device_id:e?o:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&i){var n,a=(n=e.timestampLookBack)!==null&&n!==void 0?n:10;if(!i)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-a,0)}return s}alias(e,t){return e===this.get_property(vs)?(b.critical("Attempting to create alias for existing People user - aborting."),-2):this.Lr("posthog.alias")?(_(t)&&(t=this.get_distinct_id()),e!==t?(this.Nr(ht,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(b.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=w({},this.config);if(B(e)){var i,s,n,a,o;L(this.config,ns(e));var l=this.kr();(i=this.persistence)==null||i.update_config(this.config,t,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new mi(w({},this.config,{persistence:"sessionStorage"}),l);var u=this.Sr(this.config.debug);Fe(u)&&(this.config.debug=u),Fe(this.config.debug)&&(this.config.debug?(ve.DEBUG=!0,D.H()&&D.G("ph_debug","true"),b.info("set_config",{config:e,oldConfig:t,newConfig:w({},this.config)})):(ve.DEBUG=!1,D.H()&&D.V("ph_debug"))),(s=this.sessionRecording)==null||s.startIfEnabledOrStop(),(n=this.autocapture)==null||n.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Ur(),(o=this.externalIntegrations)==null||o.startIfEnabledOrStop()}}startSessionRecording(e){var t=e===!0,i={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var s,n,a,o,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),i.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),i.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),i.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("url")),i.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(w({},s,t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:Ge;return t!==Ge&&(t=Ge+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(_e))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(_e))==="identified"}jr(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ye(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[ht])&&((t=this.persistence)==null||(t=t.props)==null||!t[Bt]))}Mr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.jr()||this.Lr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Lr(e){return this.config.person_profiles==="never"?(b.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Nr(Bt,!0),!0)}kr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!t}Ur(){var e,t,i,s,n=this.kr();return((e=this.persistence)==null?void 0:e.wi)!==n&&((i=this.persistence)==null||i.set_disabled(n)),((t=this.sessionPersistence)==null?void 0:t.wi)!==n&&((s=this.sessionPersistence)==null||s.set_disabled(n)),n}opt_in_capturing(e){if(this.config.cookieless_mode!=="always"){var t,i;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(t=this.sessionManager)==null||t.destroy(),this.sessionManager=new ts(this),this.persistence&&(this.sessionPropsManager=new es(this,this.sessionManager,this.persistence)),this.sessionRecording=new rs(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Ur(),this.Or(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(_(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((i=e?.captureEventName)!==null&&i!==void 0?i:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Fr()}else b.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Ur(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:st,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(t=this.sessionRecording)==null||t.stopRecording(),this.sessionRecording=void 0,this.Fr())):b.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}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 e===me.GRANTED?"granted":e===me.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Ur()}_is_bot(){return Q?fn(Q,this.config.custom_blocked_useragents):void 0}Fr(){m&&(m.visibilityState==="visible"?this.mr||(this.mr=!0,this.capture("$pageview",{title:m.title},{send_instantly:!0}),this.yr&&(m.removeEventListener("visibilitychange",this.yr),this.yr=null)):this.yr||(this.yr=this.Fr.bind(this),N(m,"visibilitychange",this.yr)))}debug(e){e===!1?(d?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(d?.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}))}M(){var e,t,i,s,n,a,o,l=this.Er||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(b.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(i="advanced_disable_decide",s=!1,n=b,a=(t="advanced_disable_flags")in(e=l)&&!_(e[t]),o=i in e&&!_(e[i]),a?e[t]:o?(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i]):s)}Dr(e){if(T(this.config.before_send))return e;var t=R(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(i=s(i),T(i)){var n="Event '"+e.event+"' was rejected in beforeSend function";return Sn(e.event)?b.warn(n+". This can cause unexpected behavior."):b.info(n),null}i.properties&&!Ye(i.properties)||b.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return(e=this.pageViewManager.Vt)==null?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)})}Sr(e){var t=Fe(e)&&!e,i=D.H()&&D.q("ph_debug")==="true";return!t&&(!!i||e)}}(function(r,e){for(var t=0;t<e.length;t++)r.prototype[e[t]]=Jn(r.prototype[e[t]])})(ii,["identify"]);var as,ze=(as=bt[Ge]=new ii,function(){function r(){r.done||(r.done=!0,gn=!1,O(bt,function(e){e._dom_loaded()}))}m!=null&&m.addEventListener?m.readyState==="complete"?r():N(m,"DOMContentLoaded",r,{capture:!1}):d&&b.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),as),nr=mt.createContext({client:ze});
4function vn(r,e,t){if(t===void 0&&(t=new WeakMap),r===e)return!0;if(typeof r!="object"||r===null||typeof e!="object"||e===null)return!1;if(t.has(r)&&t.get(r)===e)return!0;t.set(r,e);var i=Object.keys(r),s=Object.keys(e);if(i.length!==s.length)return!1;for(var n=0,a=i;n<a.length;n++){var o=a[n];if(!s.includes(o)||!vn(r[o],e[o],t))return!1}return!0}function Do(r){var e=r.children,t=r.client,i=r.apiKey,s=r.options,n=mt.useRef(null),a=mt.useMemo(function(){return t?(i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),s&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),t):(i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),ze)},[t,i,JSON.stringify(s)]);return mt.useEffect(function(){if(!t){var o=n.current;o?(i!==o.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),s&&!vn(s,o.options)&&ze.set_config(s),n.current={apiKey:i,options:s??{}}):(ze.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),ze.init(i,s),n.current={apiKey:i,options:s??{}})}},[t,i,JSON.stringify(s)]),We.createElement(nr.Provider,{value:{client:a}},e)}var Lo=function(){var r=mt.useContext(nr).client;return r},zi=function(r,e){return zi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},zi(r,e)};function Oo(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");zi(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var wi=function(r){return typeof r=="function"},To={componentStack:null,exceptionEvent:null,error:null},Ro={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(r){Oo(e,r);function e(t){var i=r.call(this,t)||this;return i.state=To,i}return e.prototype.componentDidCatch=function(t,i){var s=this.props.additionalProperties,n;wi(s)?n=s(t):typeof s=="object"&&(n=s);var a=this.context.client,o=a.captureException(t,n),l=i.componentStack;this.setState({error:t,componentStack:l,exceptionEvent:o})},e.prototype.render=function(){var t=this.props,i=t.children,s=t.fallback,n=this.state;if(n.componentStack==null)return wi(i)?i():i;var a=wi(s)?We.createElement(s,{error:n.error,componentStack:n.componentStack,exceptionEvent:n.exceptionEvent}):s;return We.isValidElement(a)?a:(console.warn(Ro.INVALID_FALLBACK),We.createElement(We.Fragment,null))},e.contextType=nr,e})(We.Component);export{ze as C,Do as P,Lo as u};
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.