1var g=typeof window<"u"?window:void 0,oe=typeof globalThis<"u"?globalThis:g;typeof self>"u"&&(oe.self=oe),typeof File>"u"&&(oe.File=function(){});var pe=oe?.navigator,P=oe?.document,ie=oe?.location,sr=oe?.fetch,ms=oe!=null&&oe.XMLHttpRequest&&"withCredentials"in new oe.XMLHttpRequest?oe.XMLHttpRequest:void 0,Sr=oe?.AbortController,fo=oe?.CompressionStream,me=pe?.userAgent,$=g??{};function $n(){return!(!g||g.navigator.onLine===!1)}var Pr="1.404.1",X={DEBUG:!1,LIB_VERSION:Pr,LIB_NAME:"web",JS_SDK_VERSION:Pr};function Tr(i,e,t,s,r,n,a){try{var o=i[n](a),l=o.value}catch(u){return void t(u)}o.done?e(l):Promise.resolve(l).then(s,r)}function te(i){return function(){var e=this,t=arguments;return new Promise(function(s,r){var n=i.apply(e,t);function a(l){Tr(n,s,r,a,o,"next",l)}function o(l){Tr(n,s,r,a,o,"throw",l)}a(void 0)})}}function _(){return _=Object.assign?Object.assign.bind():function(i){for(var e=1;arguments.length>e;e++){var t=arguments[e];for(var s in t)({}).hasOwnProperty.call(t,s)&&(i[s]=t[s])}return i},_.apply(null,arguments)}function Rn(i,e){if(i==null)return{};var t={};for(var s in i)if({}.hasOwnProperty.call(i,s)){if(e.indexOf(s)!==-1)continue;t[s]=i[s]}return t}var Fr=i=>{if(typeof i!="string")return i;try{return JSON.parse(i)}catch{return i}};function Ir(i){return typeof i=="string"||i}function $r(i){return typeof i=="string"?i:void 0}var Pt,Ne=function(i){return i.AnonymousId="anonymous_id",i.DistinctId="distinct_id",i.Props="props",i.EnablePersonProcessing="enable_person_processing",i.PersonMode="person_mode",i.FeatureFlagDetails="feature_flag_details",i.FeatureFlags="feature_flags",i.FeatureFlagPayloads="feature_flag_payloads",i.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",i.BootstrapFeatureFlags="bootstrap_feature_flags",i.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",i.OverrideFeatureFlags="override_feature_flags",i.Queue="queue",i.AiQueue="ai_queue",i.LogsQueue="logs_queue",i.OptedOut="opted_out",i.SessionId="session_id",i.SessionStartTimestamp="session_start_timestamp",i.SessionLastTimestamp="session_timestamp",i.PersonProperties="person_properties",i.GroupProperties="group_properties",i.InstalledAppBuild="installed_app_build",i.InstalledAppVersion="installed_app_version",i.SessionReplay="session_replay",i.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",i.SurveyLastSeenDate="survey_last_seen_date",i.SurveysSeen="surveys_seen",i.Surveys="surveys",i.RemoteConfig="remote_config",i.FlagsEndpointWasHit="flags_endpoint_was_hit",i.DeviceId="device_id",i}({}),Rr=function(i){return i.GZipJS="gzip-js",i.Base64="base64",i}({}),_o=["$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"],mo=["token"],Cn="NativeGzipValidationError",ys=i=>i.length>=2&&i[0]===31&&i[1]===139,Cr=(i,e)=>i===Rr.GZipJS||e===Rr.GZipJS||e==="gzip",Mr=i=>!(!i||typeof i!="object")&&("name"in i?String(i.name):"")==="NotReadableError",ti=i=>{var e=new Error("Native gzip produced invalid output: "+i);throw e.name=Cn,e},yo=function(){var i=te(function*(e,t){18>e.size&&ti("too-short");var s=new Uint8Array(yield e.slice(0,10).arrayBuffer());ys(s)&&s[2]===8||ti("invalid-header");var r=new DataView(yield e.slice(e.size-8).arrayBuffer());r.getUint32(0,!0)!==(a=>{for(var o=(()=>{if(Pt)return Pt;Pt=[];for(var c=0;256>c;c++){for(var h=c,d=0;8>d;d++)h=1&h?3988292384^h>>>1:h>>>1;Pt[c]=h>>>0}return Pt})(),l=4294967295,u=0;a.length>u;u++)l=o[255&(l^a[u])]^l>>>8;return(4294967295^l)>>>0})(t)&&ti("invalid-crc");var n=t.length>>>0;r.getUint32(4,!0)!==n&&ti("invalid-size")});return function(e,t){return i.apply(this,arguments)}}();function bs(){return bs=te(function*(i,e,t){e===void 0&&(e=!0);try{var s=new TextEncoder().encode(i),r=new globalThis.CompressionStream("gzip"),n=r.writable.getWriter(),a=n.write(s).then(()=>n.close()).catch(function(){var u=te(function*(c){try{yield n.abort(c)}catch{}throw c});return function(c){return u.apply(this,arguments)}}()),o=new Response(r.readable).blob(),l=(yield Promise.all([o,a]))[0];return yield yo(l,s),l}catch(u){if(t!=null&&t.rethrow)throw u;return e&&console.error("Failed to gzip compress data",u),null}}),bs.apply(this,arguments)}var bo=["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","hub
1spot","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"],Or=function(i,e){if(e===void 0&&(e=[]),!i)return!1;var t=i.toLowerCase();return bo.concat(e).some(s=>{var r=s.toLowerCase();return t.indexOf(r)!==-1})};function M(i,e){return i.indexOf(e)!==-1}var Ni=function(i){return i.trim()},ws=function(i){return i.replace(/^\$/,"")};function Mn(i){var e,t=[];return(e=JSON.stringify(i,function(s,r){if(typeof r=="bigint")return r.toString();if(typeof r!="function"&&typeof r!="symbol"){if(r instanceof Error)return{name:r.name,message:r.message,stack:r.stack};if(r&&typeof r=="object"){for(;t.length>0&&t[t.length-1]!==this;)t.pop();if(t.includes(r))return"[Circular]";t.push(r)}return r}}))!==null&&e!==void 0?e:"null"}var On=Object.prototype,An=On.hasOwnProperty,ji=On.toString,A=Array.isArray||function(i){return ji.call(i)==="[object Array]"},Te=i=>typeof i=="function",K=i=>i===Object(i)&&!A(i),Ge=i=>{if(K(i)){for(var e in i)if(An.call(i,e))return!1;return!0}return!1},x=i=>i===void 0,U=i=>ji.call(i)=="[object String]",xs=i=>U(i)&&i.trim().length===0,ve=i=>i===null,O=i=>x(i)||ve(i),ue=i=>ji.call(i)=="[object Number]"&&i==i,Le=i=>ue(i)&&i>0,Ce=i=>ji.call(i)==="[object Boolean]",wo=i=>i instanceof FormData,xo=i=>M(_o,i),Eo=i=>M(mo,i);function Ln(i){return i===null||typeof i!="object"}function fi(i,e){return{}.toString.call(i)==="[object "+e+"]"}function rr(i){return typeof Event<"u"&&function(e,t){try{return e instanceof t}catch{return!1}}(i,Event)}var ko=[!0,"true",1,"1","yes"],Bi=i=>M(ko,i),So=[!1,"false",0,"0","no"];function Re(i,e,t,s,r){return e>t&&(s.warn("min cannot be greater than max."),e=t),ue(i)?i>t?(s.warn(" cannot be greater than max: "+t+". Using max value instead."),t):e>i?(s.warn(" cannot be less than min: "+e+". Using min value instead."),e):i:(s.warn(" must be a number. using max or fallback. max: "+t+", fallback: "+r),Re(r||t,e,t,s))}class Po{constructor(e){this.tt={},this.et=e.et,this.rt=Re(e.bucketSize,0,100,e.it),this.nt=Re(e.refillRate,0,this.rt,e.it),this.st=Re(e.refillInterval,0,864e5,e.it)}ot(e,t){var s=Math.floor((t-e.lastAccess)/this.st);s>0&&(e.tokens=Math.min(e.tokens+s*this.nt,this.rt),e.lastAccess=e.lastAccess+s*this.st)}consumeRateLimit(e){var t,s=Date.now(),r=String(e),n=this.tt[r];return n?this.ot(n,s):this.tt[r]=n={tokens:this.rt,lastAccess:s},n.tokens===0||(n.tokens--,n.tokens===0&&((t=this.et)==null||t.call(this,e)),n.tokens===0)}stop(){this.tt={}}}var xe="Mobile",_i="iOS",Ue="Android",bt="Tablet",Dn=Ue+" "+bt,Nn="iPad",jn="Apple",qn=jn+" Watch",Ht="Safari",wt="BlackBerry",Hn="Samsung",Un=Hn+"Browser",Bn=Hn+" Internet",at="Chrome",To=at+" OS",zn=at+" "+_i,nr="Internet Explorer",Gn=nr+" "+xe,ar="Opera",Fo=ar+" Mini",or="Edge",Vn="Microsoft "+or,mt="Firefox",Wn=mt+" "+_i,Wt="Nintendo",Kt="PlayStation",yt="Xbox",Kn=Ue+" "+xe,Yn=xe+" "+Ht,Lt="Windows",Es=Lt+" Phone",Ar="Nokia",ks="Ouya",Jn="Generic",Io=Jn+" "+xe.toLowerCase(),Qn=Jn+" "+bt.toLowerCase(),Ss="Konqueror",Zn="Oculus Browser",mi="Vivaldi",Xn="Yandex",yi="Whale",Ps="DuckDuckGo",ea="Pale Moon",bi="Waterfox",Ut="Brave",ta="Google Search App",Z="(\\d+(\\.\\d+)?)",zi=new RegExp("Version/"+Z),$o=new RegExp(yt,"i"),Ro=new RegExp(Kt+" \\w+","i"),Co=new RegExp(Wt+" \\w+","i"),lr=new RegExp(wt+"|PlayBook|BB10","i"),Mo={"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"},ia=function(i,e,t,s){e=e||"";var r=function(n){return n!=null&&n.brave?Ut:null}(t);return r||(s!=null&&s.detectGoogleSearchApp&&M(i,"GSA/")?ta:M(i," OPR/")&&M(i,"Mini")?Fo:M(i," OPR/")?ar:lr.test(i)?wt:M(i,"IE"+xe)||M(i,"WPDesktop")?Gn:M(i,"OculusBrowser")?Zn:M(i,Un)?Bn:M(i,or)||M(i,"Edg/")?Vn:M(i,mi+"/")?mi:M(i,"YaBrowser/")?Xn:M(i,yi+"/")?yi:M(i,Ps+"/")||M(i,"Ddg/")?Ps:M(i,"FBIOS")?"Facebook "+xe:M(i,"UCWEB")||M(i,"UCBrowser")?"UC Browser":M(i,"CriOS")?zn:M(i,"CrMo")||M(i,at)?at:M(i,Ue)&&M(i,Ht)?Kn:M(i,"FxiOS")?Wn:M(i.toLowerCase(),Ss.toLowerCase())?Ss:M(i,Ut+"/")?Ut:((n,a)=>a&&M(a,jn)||function(o){return M(o,Ht)&&!M(o,at)&&!M(o,Ue)}(n))(i,e)?M(i,xe)?Yn:Ht:M(i,"PaleMoon/")?ea:M(i,bi+"/")?bi:M(i,mt)?mt:M(i,"MSIE")||M(i,"Trident/")?nr:M(i,"Gecko")?mt:"")},Oo={[Gn]:[new RegExp("rv:"+Z)],[Vn]:[new RegExp(or+"?\\/"+Z)],[at]:[new RegExp("("+at+"|CrMo)\\/"+Z)],[zn]:[new RegExp("CriOS\\/"+Z)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Z)],[Ht]:[zi],[Yn]:[zi],[ar]:[new RegExp("(Opera|OPR)\\/"+Z)],[mt]:[new RegExp(mt+"\\/"+Z)],[Wn]:[new RegExp("FxiOS\\/"+Z)],[Ss]:[new RegExp("Konqueror[:/]?"+Z,"i")],[wt]:[new RegExp(wt+" "+Z),zi],[Kn]:[new RegExp("android\\s"+Z,"i")],[Bn]:[new RegExp(Un+"\\/"+Z)],[Zn]:[new RegExp("OculusBrowser\\/"+Z)],[mi]:[new RegExp(mi+"\\/"+Z)],[Xn]:[new RegExp("YaBrowser\\/"+Z)],[yi]:[new RegExp(yi+"\\/"+Z)],[Ut]:[new RegExp(Ut+"\\/"+Z)],[Ps]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Z)],[ea]:[new RegExp("PaleMoon\\/"+Z)],[bi]:[new RegExp(bi+"\\/"+Z)],[ta]:[new RegExp("GSA\\/"+Z)],[nr]:[new RegExp("(rv:|MSIE )"+Z)],Mozilla:[new RegExp("rv:"+Z)]},Ao=function(i,e,t,s){var r=ia(i,e,t,s),n=Oo[r];if(x(n))return null;for(var a=0;n.length>a;a++){var o=i.match(n[a]);if(o)return parseFloat(o[o.length-2])}return null},Lr=[[new RegExp(yt+"; "+yt+" (.*?)[);]","i"),i=>[yt,i&&i[1]||""]],[new RegExp(Wt,"i"),[Wt,""]],[new RegExp(Kt,"i"),[Kt,""]],[lr,[wt,""]],[new RegExp(Lt,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Es,""];if(new RegExp(xe).test(e)&&!/IEMobile\b/.test(e))return[Lt+" "+xe,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var s=Mo[t[1]]||"";return/arm/i.test(e)&&(s="RT"),[Lt,s]}return[Lt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>i&&i[3]?[_i,[i[3],i[4],i[5]||"0"].join(".")]:[_i,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=x(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+Ue+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ue+")","i"),i=>i&&i[2]?[Ue,[i[2],i[3],i[4]||"0"].join(".")]:[Ue,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];return i&&i[1]&&(e[1]=[i[1],i[2],i[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[To,""]],[/Linux|debian/i,["Linux",""]]],Dr=function(i){return Co.test(i)?Wt:Ro.test(i)?Kt:$o.test(i)?yt:new RegExp(ks,"i").test(i)?ks:new RegExp("("+Es+"|WPDesktop)","i").test(i)?Es:/iPad/.test(i)?Nn:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?qn:lr.test(i)?wt:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(Ar,"i").test(i)?Ar:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?new RegExp(xe).test(i)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)||/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?Ue:Dn:new RegExp("(pda|"+xe+")","i").test(i)?Io:new RegExp(bt,"i").test(i)&&!new RegExp(bt+" pc","i").test(i)?Qn:""},Lo=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Nr(i,e){return typeof(t=i)=="string"&&Lo.test(t)?i:e();var t}function Ve(i){return i&&i.split("#")[0]}function ci(i,e){var t=setTimeout(i,e);return t?.unref&&t?.unref(),t}var Do=i=>i instanceof Error,sa={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},No=sa.info;function ra(i){if(Ce(i))return{boolValue:i};if(typeof i=="number")return Number.isFinite(i)?Number.isInteger(i)?{intValue:i}:{doubleValue:i}:{stringValue:String(i)};if(typeof i=="string")return{stringValue:i};if(A(i))return{arrayValue:{values:i.map(e=>ra(e))}};try{return{stringValue:JSON.stringify(i)}}catch{return{stringValue:String(i)}}}function wi(i){var e=[];
1for(var t in i){var s=i[t];ve(s)||x(s)||e.push({key:t,value:ra(s)})}return e}function jo(i,e){var t=sa[i.level||"info"]||No,s=t.text,r=t.number,n=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),O(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),O(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var o=_({},a,i.attributes||{}),l={timeUnixNano:n,observedTimeUnixNano:n,severityNumber:r,severityText:s,body:{stringValue:i.body},attributes:wi(o)};return i.trace_id&&(l.traceId=i.trace_id),i.span_id&&(l.spanId=i.span_id),x(i.trace_flags)||(l.flags=i.trace_flags),l}function na(i,e,t){return _({},i.resourceAttributes,{"service.name":i.serviceName||"unknown_service"},i.environment&&{"deployment.environment":i.environment},i.serviceVersion&&{"service.version":i.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":t})}function aa(i,e,t,s){return{resourceLogs:[{resource:{attributes:wi(e)},scopeLogs:[{scope:{name:t,version:s},logRecords:i}]}]}}let qo=class{constructor(i,e,t,s,r,n,a){var o;n===void 0&&(n=()=>Promise.resolve()),this._instance=i,this.Te=e,this.it=t,this.ut=s,this.ht=r,this.dt=n,this.ct=a,this.vt=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=e.maxBufferSize,this.kt=Math.max((o=e.maxQueueSize)!==null&&o!==void 0?o:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.maxBatchRecordsPerPost,this.It=e.rateCapWindowMs,this.Tt=e.maxLogsPerInterval}reset(){this.Mt(),this.vt=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Te.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.Et()}captureLog(i){if(!this._instance.isDisabled&&!this._instance.optedOut&&i!=null&&i.body){var e=this.Rt(i);if(e!==null)if(e.body){if(this.Pt()){var t={record:jo(e,this.ut())};this.ht(()=>this.Ot(t))}}else this.it.info("Log was rejected in beforeSend function")}}Rt(i){var e=this.Te.beforeSend;if(!e)return i;var t=A(e)?e:[e],s=i;for(var r of t)try{var n=r(s);if(!n)return this.it.info("Log was rejected in beforeSend function"),null;s=n}catch(a){return this.it.error("Error in beforeSend function for log:",a),null}return s}Pt(){if(this.Tt===void 0)return!0;var i=Date.now(),e=i-this.bt;return this.It>e&&e>=0||(this.bt=i,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||(this.it.warn("captureLog dropping logs: exceeded "+this.Tt+" logs per "+this.It+"ms"),this.wt=!0),!1)}flush(){var i=this;return te(function*(){if(!i._instance.isDisabled)return i.vt||(i.vt=i.Ft().finally(()=>{i.vt=null})),i.vt})()}Ft(){var i=this;return te(function*(){var e;i.Mt();var t=(e=i._instance.getPersistedProperty(Ne.LogsQueue))!==null&&e!==void 0?e:[];if(t.length!==0)for(var s=t.length,r=0;t.length>0&&s>r;){var n,a;i.ft=0;var o=Math.min(t.length,i.Ct),l=t.slice(0,o),u=aa(l.map(h=>h.record),i.Lt(),(n=i.ct)!==null&&n!==void 0?n:i._instance.getLibraryId(),i._instance.getLibraryVersion()),c=yield i._instance.At(u);if(c.kind==="too-large"&&l.length>1)i.Ct=Math.max(1,Math.floor(l.length/2)),i.it.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+i.Ct);else if(c.kind==="retry-later"||(c.kind==="too-large"?i.it.warn("Dropping a single log record after 413 with batch size 1 â the record is larger than the server cap and cannot be split further."):c.kind==="ok"&&i.Te.maxBatchRecordsPerPost>i.Ct&&(i.Ct=Math.min(i.Te.maxBatchRecordsPerPost,i.Ct+1)),yield i.$t(l.length),t=(a=i._instance.getPersistedProperty(Ne.LogsQueue))!==null&&a!==void 0?a:[],r+=l.length,c.kind==="fatal"))throw c.error}})()}$t(i){var e=this;return te(function*(){var t,s=Math.max(0,i-e.ft),r=(t=e._instance.getPersistedProperty(Ne.LogsQueue))!==null&&t!==void 0?t:[];e._instance.setPersistedProperty(Ne.LogsQueue,r.slice(s)),yield e.dt()})()}Lt(){return na(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ot(i){var e;if(!this._instance.optedOut){var t=(e=this._instance.getPersistedProperty(Ne.LogsQueue))!==null&&e!==void 0?e:[];this.kt>t.length||(t.shift(),this.ft++,this.it.info("Logs queue is full, dropping oldest record.")),t.push(i),this._instance.setPersistedProperty(Ne.LogsQueue,t),this.xt>t.length?this.Nt():this.Et()}}Nt(i){i===void 0&&(i=this.St),this.Dt||(this.Dt=ci(()=>{this.Dt=void 0,this.Et()},i))}qt(){var i=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,i)}jt(){var i=this._instance.getPersistedProperty(Ne.LogsQueue);return!!i&&i.length>0}shutdown(i){var e=this;return te(function*(){e.Mt();var t=e.flush().catch(()=>{});i!==void 0?yield Promise.race([t,new Promise(s=>ci(s,i))]):yield t})()}flushWithTimeout(i){var e=this;return te(function*(){var t=!1,s=e.flush(),r=new Promise(n=>ci(()=>{t=!0,n()},i));try{yield Promise.race([s,r])}finally{t&&s.catch(()=>{})}})()}Et(){this.flush().then(()=>{this.yt=0},i=>{this.yt++,this.it.error("PostHog logs flush failed:",i)}).finally(()=>{!this._instance.isDisabled&&this.jt()&&this.Nt(this.qt())})}Mt(){this.Dt&&(clearTimeout(this.Dt),this.Dt=void 0)}};var Gi=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function jr(i){return String(i)+"000000"}function qr(i,e,t,s){var r="";return s&&(r=Object.keys(s).sort().map(n=>JSON.stringify(n)+":"+JSON.stringify(s[n])).join(",")),i+"\0"+e+"\0"+(t??"")+"\0"+r}let Ho=class{constructor(i,e,t){this._instance=i,this.Te=e,this.it=t,this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Vt=0}count(i,e,t){e===void 0&&(e=1),this.Wt({name:i,type:"count",value:e,unit:t?.unit,attributes:t?.attributes})}
1gauge(i,e,t){this.Wt({name:i,type:"gauge",value:e,unit:t?.unit,attributes:t?.attributes})}histogram(i,e,t){this.Wt({name:i,type:"histogram",value:e,unit:t?.unit,attributes:t?.attributes})}flush(){var i=this,e=this.vt,t=function(){var r=te(function*(){e&&(yield e.catch(()=>{})),yield i.Zt()});return function(){return r.apply(this,arguments)}}(),s=t().finally(()=>{this.vt===s&&(this.vt=null)});return this.vt=s,s}drainWindow(){if(this.Ht.size===0)return null;var i=this.Ht;return this.Ht=new Map,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Gt(i)}reset(){this.Vt++,this.Mt(),this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set}Wt(i){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Rt(i);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.it.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var t,s;try{t=e.attributes?_({},e.attributes):void 0,s=qr(e.type,e.name,e.unit,t)}catch(a){return void this.it.warn("Dropping metric '"+e.name+"': attributes could not be serialized",a)}var r=this.Ht.get(s);if(!r){if(!this.Qt())return;r={name:e.name,type:e.type,unit:e.unit,attributes:t,windowStartMs:Date.now()},this.Ht.set(s,r)}var n=this.Ut.get(e.name);n===void 0?this.Ut.set(e.name,e.type):n===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.it.warn("Metric name '"+e.name+"' is already used as a "+n+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(r,e.value),this.Nt()}else this.it.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.it.warn("Dropping metric with empty name")}}Qt(){return this.Te.maxSeriesPerFlush>this.Ht.size||(this.Bt||(this.Bt=!0,this.it.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(i,e){var t;switch(i.type){case"count":i.total=((t=i.total)!==null&&t!==void 0?t:0)+e;break;case"gauge":i.last=e;break;case"histogram":i.hist||(i.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(Gi.length+1).fill(0)});var s=i.hist;s.count+=1,s.sum+=e,s.min=Math.min(s.min,e),s.max=Math.max(s.max,e),s.bucketCounts[function(r,n){for(var a=0;n.length>a;a++)if(n[a]>=r)return a;return n.length}(e,Gi)]+=1}}Rt(i){var e=this.Te.beforeSend;if(!e)return i;var t=A(e)?e:[e],s=i;for(var r of t)try{var n=r(s);if(!n)return this.it.info("Metric was rejected in beforeSend function"),null;s=n}catch(a){return this.it.error("Error in beforeSend function for metric:",a),null}return s}Nt(){this.Dt||(this.Dt=ci(()=>{this.Dt=void 0,this.flush().catch(i=>{this.it.error("Metrics flush failed:",i)})},this.Te.flushIntervalMs))}Mt(){this.Dt&&(clearTimeout(this.Dt),this.Dt=void 0)}Zt(){var i=this;return te(function*(){if(i.Ht.size!==0){var e=i.Ht;i.Ht=new Map,i.Bt=!1,i.Ut=new Map,i.zt=new Set;var t=i.Vt,s=yield i._instance.Kt(i.Gt(e));if(t===i.Vt)switch(s.kind){case"ok":return;case"retry-later":return i.Yt(e),void i.Nt();case"too-large":return void i.it.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void i.it.error("Failed to send metrics batch:",s.error)}}})()}Gt(i){return function(r,n,a,o){return{resourceMetrics:[{resource:{attributes:wi(n)},scopeMetrics:[{scope:{name:a,version:o},metrics:r}]}]}}(this.Xt(i),(e=this.Te,t=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),_({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":s})),this._instance.getLibraryId(),this._instance.getLibraryVersion());var e,t,s}Xt(i){var e=jr(Date.now()),t=new Map;for(var s of i.values()){var r,n=qr(s.type,s.name,s.unit,void 0),a=t.get(n);a||(a=_({name:s.name},s.unit&&{unit:s.unit}),s.type==="count"?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:s.type==="gauge"?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},t.set(n,a));var o=wi((r=s.attributes)!==null&&r!==void 0?r:{}),l=jr(s.windowStartMs);if(s.type==="count"){var u,c={attributes:o,startTimeUnixNano:l,timeUnixNano:e,asDouble:(u=s.total)!==null&&u!==void 0?u:0};a.sum.dataPoints.push(c)}else if(s.type==="gauge"){var h,d={attributes:o,timeUnixNano:e,asDouble:(h=s.last)!==null&&h!==void 0?h:0};a.gauge.dataPoints.push(d)}else s.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:e,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:Gi})}return Array.from(t.values())}Yt(i){var e,t;for(var s of i){var r=s[0],n=s[1],a=this.Ht.get(r);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,n.windowStartMs),a.type){case"count":a.total=((e=a.total)!==null&&e!==void 0?e:0)+((t=n.total)!==null&&t!==void 0?t:0);break;case"gauge":break;case"histogram":if(n.hist)if(a.hist){a.hist.count+=n.hist.count,a.hist.sum+=n.hist.sum,a.hist.min=Math.min(a.hist.min,n.hist.min),a.hist.max=Math.max(a.hist.max,n.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else a.hist=n.hist}else this.Qt()&&this.Ht.set(r,n)}}};var ii,Hr,Vi;function Uo(i){var e=globalThis._posthogChunkIds;if(e){var t=Object.keys(e);return Vi&&t.length===Hr||(Hr=t.length,Vi=t.reduce((s,r)=>{ii||(ii={});var n=ii[r];if(n)s[n[0]]=n[1];else for(var a=i(r),o=a.length-1;o>=0;o--){var l=a[o],u=l?.filename,c=e[r];if(u&&c){s[u]=c,ii[r]=[u,c];break}}return s},{})),Vi}}class Bo{constructor(e,t,s){s===void 0&&(s=[]),this.coercers=e,this.stackParser=t,this.modifiers=s}buildFromUnknown(e,t){t===void 0&&(t={});var s=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(s,t,0).apply(e),n=this.buildParsingContext(t),a=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(a,s),$exception_level:"error"}}modifyFrames(e){var t=this;return te(function*(){for(var s of e)s.stacktrace&&s.stacktrace.frames&&A(s.stacktrace.frames)&&(s.stacktrace.frames=yield t.applyModifiers(s.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 s,r;return e.cause!=null&&(s=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),_({},e,{cause:s,stack:r})}applyChunkIds(e,t){return e.map(s=>(s.filename&&t&&(s.chunk_id=t[s.filename]),s))}applyCoercers(e,t){for(var s of this.coercers)if(s.match(e))return s.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return te(function*(){var s=e;for(var r of t.modifiers)s=yield r(s);return s})()}convertToExceptionList(e,t){var s,r,n,a={type:e.type,value:e.value,mechanism:{type:(s=t.type)!==null&&s!==void 0?s:"generic",handled:(r=t.handled)===null||r===void 0||r,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,_({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:Uo(this.stackParser),skipFirstLines:(t=e.skipFirstLines)!==null&&t!==void 0?t:1}}buildCoercingContext(e,t,s){s===void 0&&(s=0);var r=(n,a)=>{if(4>=a){var o=this.buildCoercingContext(e,t,a);return this.applyCoercers(n,o)}};return _({},t,{syntheticException:s==0?t.syntheticException:void 0,mechanism:e,apply:n=>r(n,s),next:n=>r(n,s+1)})}}var xt="?";function Ts(i,e,t,s,r){var n={platform:i,filename:e,function:t==="<anonymous>"?xt:t,in_app:!0};return x(s)||(n.lineno=s),x(r)||(n.colno=r),n}var oa=(i,e)=>{var t=i.indexOf("safari-extension")!==-1,s=i.indexOf("safari-web-extension")!==-1;return t||s?[i.indexOf("@")!==-1?i.split("@")[0]:xt,t?"safari-extension:"+e:"safari-web-extension:"+e]:[i,e]},zo=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Go=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Vo=/\((\S*)(?::(\d+))(?::(\d+))\)/,Wo=(i,e)=>{var t=zo.exec(i);if(t)return Ts(e,t[1],xt,+t[2],+t[3]);var s=Go.exec(i);if(s){if(s[2]&&s[2].indexOf("eval")===0){var r=Vo.exec(s[2]);r&&(s[2]=r[1],s[3]=r[2],s[4]=r[3])}var n=oa(s[1]||xt,s[2]);return Ts(e,n[1],n[0],s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},Ko=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Yo=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Jo=(i,e)=>{var t=Ko.exec(i);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var s=Yo.exec(t[3]);s&&(t[1]=t[1]||"eval",t[3]=s[1],t[4]=s[2],t[5]="")}var r=t[3],n=t[1]||xt,a=oa(n,r);return Ts(e,r=a[1],n=a[0],t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Ur=/\(error: (.*)\)/;class Qo{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var s=U(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:s?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 fi(e,"DOMException")}isDOMError(e){return fi(e,"DOMError")}}class Zo{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 s=e.message;return String(s.error&&typeof s.error.message=="string"?s.error.message:s)}getStack(e){return e.stacktrace||e.stack||void 0}}class Xo{constructor(){}match(e){return fi(e,"ErrorEvent")&&e.error!=null}coerce(e,t){var s;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(s=t.syntheticException)==null?void 0:s.stack,synthetic:!0}}}var el=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tl{match(e){return typeof e=="string"}coerce(e,t){var s,r=this.getInfos(e),n=r[0],a=r[1];return{type:n??"Error",value:a??e,stack:(s=t.syntheticException)==null?void 0:s.stack,synthetic:!0}}getInfos(e){var t="Error",s=e,r=e.match(el);return r&&(t=r[1],s=r[2]),[t,s]}}var il=["fatal","error","warning","log","info","debug"];function la(i,e){e===void 0&&(e=40);var t=Object.keys(i);if(t.sort(),!t.length)return"[object has no keys]";for(var s=t.length;s>0;s--){var r=t.slice(0,s).join(", ");
1if(e>=r.length)return s===t.length?r:r.length>e?r.slice(0,e)+"...":r}return""}class sl{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var s,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(s=t.syntheticException)==null?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return rr(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 s=this.getObjectClassName(e);return(s&&s!=="Object"?"'"+s+"'":"Object")+" captured as exception with keys: "+la(e)}isSeverityLevel(e){return U(e)&&!xs(e)&&il.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var s=e[t];if(Do(s))return s}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}}class rl{match(e){return rr(e)}coerce(e,t){var s,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+la(e),stack:(s=t.syntheticException)==null?void 0:s.stack,synthetic:!0}}}class nl{match(e){return Ln(e)}coerce(e,t){var s;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(s=t.syntheticException)==null?void 0:s.stack,synthetic:!0}}}class al{match(e){return fi(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!rr(e))return!1;try{var t=e.detail;return t!=null&&typeof t=="object"&&"reason"in t}catch{return!1}}coerce(e,t){var s,r=this.getUnhandledRejectionReason(e);return Ln(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(s=t.syntheticException)==null?void 0:s.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var xi="$message",Ei="$timestamp",ol=new Set([xi,Ei]),Wi={enabled:!0,max_bytes:32768};function ki(i){var e;return i?{enabled:(e=i.enabled)!==null&&e!==void 0?e:Wi.enabled,max_bytes:ul(i.max_bytes,Wi.max_bytes)}:_({},Wi)}class ll{constructor(e){this.$e=[],this.ze=0,this.Te=ki(e)}setConfig(e){this.Te=ki(e),this.Ze()}add(e){var t=function(r){var n;try{n=Mn(r)}catch{return}try{var a=JSON.parse(n);if(!K(a))return;var o=a,l=o[xi],u=o[Ei];return!U(l)||l.trim().length===0||!U(u)&&!ue(u)?void 0:{step:o,json:n}}catch{return}}(e);if(t){var s=function(r){if(typeof TextEncoder<"u")return new TextEncoder().encode(r).length;for(var n=encodeURIComponent(r),a=0,o=0;n.length>o;o++)n[o]==="%"?(a+=1,o+=2):a+=1;return a}(t.json);s>this.Te.max_bytes||(this.$e.push({step:t.step,bytes:s}),this.ze+=s,this.Ze())}}getAttachable(){return this.$e.map(e=>e.step)}clear(){this.$e=[],this.ze=0}size(){return this.$e.length}Ze(){for(;this.ze>this.Te.max_bytes&&this.$e.length>0;){var e=this.$e.shift();e&&(this.ze-=e.bytes)}}}function ul(i,e){if(!ue(i)||i===1/0||i===-1/0)return e;var t=Math.floor(i);return 0>t?e:t}var ua=function(i,e){var t=(e===void 0?{}:e).debugEnabled,s={k(r){if(g&&(X.DEBUG||$.POSTHOG_DEBUG||t)&&!x(g.console)&&g.console){for(var n=("__rrweb_original__"in g.console[r])?g.console[r].__rrweb_original__:g.console[r],a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];n(i,...o)}},debug(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];s.k("debug",...n)},info(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];s.k("log",...n)},warn(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];s.k("warn",...n)},error(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];s.k("error",...n)},critical(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];console.error(i,...n)},uninitializedWarning(r){s.error("You must initialize PostHog before calling "+r)},createLogger:(r,n)=>ua(i+" "+r,n)};return s},w=ua("[PostHog.js]"),J=w.createLogger,cl=J("[ExternalScriptsLoader]"),Ki=(i,e,t)=>{if(i.config.disable_external_dependency_loading)return cl.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var s=P?.querySelectorAll("script");
1if(s){for(var r,n=function(){if(s[a].src===e){var l=s[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;s.length>a;a++)if(r=n())return r.v}var o=()=>{if(!P)return t("document not found");var l=P.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),i.config.prepare_external_dependency_script&&(l=i.config.prepare_external_dependency_script(l)),!l)return t("prepare_external_dependency_script returned null");if(i.config.external_scripts_inject_target==="head")P.head.appendChild(l);else{var u,c=P.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):P.body.appendChild(l)}};P!=null&&P.body?o():P?.addEventListener("DOMContentLoaded",o)};$.__PosthogExtensions__=$.__PosthogExtensions__||{},$.__PosthogExtensions__.loadExternalDependency=(i,e,t)=>{if(e!=="remote-config"){var s;if(i.config.strict_script_versioning)s=i.requestRouter.endpointFor("assets","/static/"+i.version+"/"+e+".js");else{var r="/static/"+e+".js?v="+i.version;if(e==="toolbar"){var n=3e5;r=r+"&t="+Math.floor(Date.now()/n)*n}s=i.requestRouter.endpointFor("assets",r)}Ki(i,s,t)}else{var a=i.requestRouter.endpointFor("assets","/array/"+i.config.token+"/config.js");Ki(i,a,t)}},$.__PosthogExtensions__.loadSiteApp=(i,e,t)=>{var s=i.requestRouter.endpointFor("api",e);Ki(i,s,t)};var ca="$people_distinct_id",Si="$device_id",Yi="$device_model",Dt="__alias",Nt="__timers",Fs="$autocapture_disabled_server_side",Is="$heatmaps_enabled_server_side",$s="$exception_capture_enabled_server_side",Rs="$error_tracking_suppression_rules",Cs="$error_tracking_capture_extension_exceptions",Ms="$web_vitals_enabled_server_side",ur="$dead_clicks_enabled_server_side",cr="$product_tours_enabled_server_side",Os="$web_vitals_allowed_metrics",nt="$session_recording_remote_config",ha="$replay_sample_rate",da="$replay_override_sampling",pa="$replay_override_linked_flag",va="$replay_override_url_trigger",ga="$replay_override_event_trigger",ft="$sesid",hr="$session_is_sampled",rt="$enabled_feature_flags",hi="$active_feature_flags",jt="$early_access_features",As="$feature_flag_details",di="$feature_flag_payloads",Ls="$feature_flag_request_id",De="$override_feature_flags",pt="$override_feature_flag_payloads",tt="$stored_person_properties",it="$stored_group_properties",Ds="$surveys",Pi="$surveys_loaded_at",Ns="$surveys_activated",qt="ph_product_tours",Bt="$flag_call_reported",js="$flag_call_reported_session_id",qs="$feature_flag_errors",Yt="$feature_flag_evaluated_at",Pe="$user_state",Hs="$client_session_props",Us="$capture_rate_limit",Bs="$initial_campaign_params",zs="$initial_referrer_info",Ti="$initial_person_info",Fi="$epp",fa="__POSTHOG_TOOLBAR__",si="$posthog_cookieless",_a="$sdk_debug_extensions_init_method",ma="$sdk_debug_extensions_init_time_ms",ya="$sdk_debug_recording_script_not_loaded",dr="PostHog loadExternalDependency extension not found.",st="on_reject",qe="always",lt="anonymous",ut="identified",Gs="identified_only",Ii="visibilitychange",$i="beforeunload",vt="$pageview",Ji="$pageleave",Qi="$identify",Br="$groupidentify";function ri(i,e){A(i)&&i.forEach(e)}function G(i,e){if(!O(i))if(A(i))i.forEach(e);else if(wo(i))i.forEach((s,r)=>e(s,r));else for(var t in i)An.call(i,t)&&e(i[t],t)}var W=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;e>s;s++)t[s-1]=arguments[s];for(var r of t)for(var n in r)r[n]!==void 0&&(i[n]=r[n]);return i};function pi(i){for(var e=Object.keys(i),t=e.length,s=new Array(t);t--;)s[t]=[e[t],i[e[t]]];return s}var zr=function(i){try{return i()}catch{return}},hl=function(i){return function(){try{for(var e=arguments.length,t=new Array(e),s=0;e>s;s++)t[s]=arguments[s];return i.apply(this,t)}catch(r){w.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),w.critical(r)}}},pr=function(i){var e={};return G(i,function(t,s){(U(t)&&t.length>0||ue(t))&&(e[s]=t)}),e},dl=["herokuapp.com","vercel.app","netlify.app"];function pl(i){var e=i?.hostname;if(!U(e))return!1;var t=e.split(".").slice(-2).join(".");for(var s of dl)if(t===s)return!1;return!0}function ee(i,e,t,s){var r=s??{},n=r.capture,a=r.passive;i?.addEventListener(e,t,{capture:n!==void 0&&n,passive:a===void 0||a})}
1function ba(i){return i.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(i){return 0>i?Math.ceil(i):Math.floor(i)}),Number.isInteger||(Number.isInteger=function(i){return ue(i)&&isFinite(i)&&Math.floor(i)===i});class Ri{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,s,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(s)||!Number.isInteger(r)||0>e||0>t||0>s||0>r||e>0xffffffffffff||t>4095||s>1073741823||r>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|s>>>24,n[9]=s>>>16,n[10]=s>>>8,n[11]=s,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new Ri(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),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 Ri(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var s=this.bytes[t]-e.bytes[t];if(s!==0)return Math.sign(s)}return 0}}class vl{constructor(){this.S=0,this.C=0,this.I=new gl}generate(){var e=this.generateOrAbort();if(x(e)){this.S=0;var t=this.generateOrAbort();if(x(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return Ri.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var Gr,wa=i=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;i.length>e;e++)i[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return i};g&&!x(g.crypto)&&crypto.getRandomValues&&(wa=i=>crypto.getRandomValues(i));class gl{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(wa(this.R),this.O=0),this.R[this.O++]}}var je=()=>fl().toString(),fl=()=>(Gr||(Gr=new vl)).generate(),Tt="",_l=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,$e={N:()=>!!P,D(i){w.error("cookieStore error: "+i)},A(i){if(P){try{for(var e=i+"=",t=P.cookie.split(";").filter(n=>n.length),s=0;t.length>s;s++){for(var r=t[s];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},F(i){var e;try{e=JSON.parse($e.A(i))||{}}catch{}return e},q(i,e,t,s,r){if(!P)return!1;try{var n="",a="",o=function(c,h){if(h){var d=function(p,f){if(f===void 0&&(f=P),Tt)return Tt;if(!f||["localhost","127.0.0.1"].includes(p))return"";for(var y=p.split("."),m=Math.min(y.length,8),S="dmn_chk_"+je();!Tt&&m--;){var k=y.slice(m).join("."),E=S+"=1;domain=."+k+";path=/";f.cookie=E+";max-age=3",f.cookie.includes(S)&&(f.cookie=E+";max-age=0",Tt=k)}return Tt}(c);if(!d){var v=(p=>{var f=p.match(_l);return f?f[0]:""})(c);v!==d&&w.info("Warning: cookie subdomain discovery mismatch",v,d),d=v}return d?"; domain=."+d:""}return""}(P.location.hostname,s);if(t){var l=new Date;l.setTime(l.getTime()+864e5*t),n="; expires="+l.toUTCString()}r&&(a="; secure");var u=i+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&w.warn("cookieStore warning: large cookie, len="+u.length),P.cookie=u,!0}catch{return!1}},P(i,e){if(P!=null&&P.cookie)try{$e.q(i,"",-1,e)}catch{return}}},Zi=null,z={N(){if(!ve(Zi))return Zi;var i=!0;if(x(g))i=!1;else try{var e="__mplssupport__";z.q(e,"xyz"),z.A(e)!=='"xyz"'&&(i=!1),z.P(e)}catch{i=!1}return i||w.error("localStorage unsupported; falling back to cookie store"),Zi=i,i},D(i){w.error("localStorage error: "+i)},A(i){try{return g?.localStorage.getItem(i)}catch(e){z.D(e)}return null},F(i){try{return JSON.parse(z.A(i))||{}}catch{}return null},q(i,e){try{return g?.localStorage.setItem(i,JSON.stringify(e)),!0}catch(t){z.D(t)}return!1},P(i){try{g?.localStorage.removeItem(i)}catch(e){z.D(e)}}},ml=[Si,"distinct_id",ft,hr,Fi,Ti,Pe],ni={},yl={N:()=>!0,D(i){w.error("memoryStorage error: "+i)},A:i=>ni[i]||null,F:i=>ni[i]||null,q:(i,e)=>(ni[i]=e,!0),P(i){delete ni[i]}},Je=null,le={N(){if(!ve(Je))return Je;if(Je=!0,x(g))Je=!1;else try{var i="__support__";le.q(i,"xyz"),le.A(i)!=='"xyz"'&&(Je=!1),le.P(i)}catch{Je=!1}return Je},D(i){w.error("sessionStorage error: ",i)},A(i){try{return g?.sessionStorage.getItem(i)}catch(e){le.D(e)}return null},F(i){try{return JSON.parse(le.A(i))||null}catch{}return null},q(i,e){try{return g?.sessionStorage.setItem(i,JSON.stringify(e)),!0}catch(t){le.D(t)}return!1},P(i){try{g?.sessionStorage.removeItem(i)}catch(e){le.D(e)}}};class bl{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Je()?0:this.Ke}isOptedOut(){return this.Te.cookieless_mode===qe||this.isRejected()||this.consent===-1&&this.Te.cookieless_mode===st}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Te.opt_out_capturing_by_default}optInOut(e){this.Ye.q(this.Xe,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Ye.P(this.Xe,this.Te.cross_subdomain_cookie)}get Xe(){var e=this._instance.config,t=e.token,s=e.opt_out_capturing_cookie_prefix;
1return e.consent_persistence_name||(s?s+t:"__ph_opt_in_out_"+t)}get Ke(){var e=this.Ye.A(this.Xe);return Bi(e)?1:M(So,e)?0:-1}get Ye(){var e=this.Te.opt_out_capturing_persistence_type,t=e==="localStorage"?z:$e;if(!this.tr||this.tr!==t){this.tr=t;var s=e==="localStorage"?$e:z;s.A(this.Xe)&&(this.tr.A(this.Xe)||this.optInOut(Bi(s.A(this.Xe))),s.P(this.Xe,this.Te.cross_subdomain_cookie))}return this.tr}Je(){return!!this.Te.respect_dnt&&[pe?.doNotTrack,pe?.msDoNotTrack,$.doNotTrack].some(e=>Bi(e))}}function xa(i,e){var t,s=i==null||(t=i.config)==null?void 0:t.get_current_url;if(!Te(s))return e;try{var r=s(e);return U(r)&&r?r:e}catch(n){return w.error("Error in get_current_url, falling back to window.location.href",n),e}}var wl=1,xl=3,El=11;function Vr(i){return i instanceof Element&&(i.id===fa||!(i.closest==null||!i.closest(".toolbar-global-fade-container")))}function We(i){return!!i&&i.nodeType===wl}function we(i,e){return!!i&&!!i.tagName&&i.tagName.toLowerCase()===e.toLowerCase()}function Ea(i){return!!i&&i.nodeType===xl}function ka(i){return!!i&&i.nodeType===El&&We(i.host)}var Sa=1e3;function vr(i){return i?Ni(i).split(/\s+/):[]}function Wr(i,e){var t=function(s){var r,n=g==null||(r=g.location)==null?void 0:r.href;return x(n)?void 0:xa(s,n)}(e);return!!(t&&i&&i.some(s=>t.match(s)))}function Ci(i){var e="";switch(typeof i.className){case"string":e=i.className;break;case"object":e=(i.className&&"baseVal"in i.className?i.className.baseVal:null)||i.getAttribute("class")||"";break;default:e=""}return vr(e)}function Pa(i){return O(i)?null:Ni(i).split(/(\s+)/).filter(e=>zt(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Jt(i){var e="";return Ws(i)&&!$a(i)&&i.childNodes&&i.childNodes.length&&G(i.childNodes,function(t){var s;Ea(t)&&t.textContent&&(e+=(s=Pa(t.textContent))!==null&&s!==void 0?s:"")}),Ni(e)}function Xi(i){return x(i.target)?i.srcElement||null:(e=i.target)!=null&&e.shadowRoot?i.composedPath()[0]||null:i.target||null;var e}var gr=["a","button","form","input","select","textarea","label"];function Vs(i,e){if(x(e))return!0;var t,s=function(n){if(e.some(a=>function(o,l){var u=o.matches||o.matchesSelector||o.msMatchesSelector||o.mozMatchesSelector||o.webkitMatchesSelector||o.oMatchesSelector;try{return!!u&&u.call(o,l)}catch{return!1}}(n,a)))return{v:!0}};for(var r of i)if(t=s(r))return t.v;return!1}function Ta(i){var e=i.parentNode;return!(!e||!We(e))&&e}var kl=[".ph-no-autocapture","[data-ph-no-autocapture]"],Fa=["next","previous","prev",">","<"],Sl=[...Fa,"+","-","â","â"],Kr=(i,e)=>/[a-z0-9]/i.test(e)?i.includes(e):i===e,Yr=[".ph-no-rageclick",".ph-no-capture"],Pl=["","text","search","email","password","url","tel","number"];function Jr(i,e){if(!g||fr(i))return!1;var t,s,r,n,a;if(Ce(e)?(t=!!e&&Yr,s=void 0,r=!1):(t=(n=e?.css_selector_ignorelist)!==null&&n!==void 0?n:Yr,s=e?.content_ignorelist,r=(a=e?.ignore_text_selection)!==null&&a!==void 0&&a),t===!1||r&&function(l){return!(!l||!We(l))&&(!!we(l,"textarea")||(we(l,"input")?M(Pl,(l.getAttribute("type")||"").toLowerCase()):function(u){if(u.isContentEditable)return!0;var c=u.getAttribute==null?void 0:u.getAttribute("contenteditable");return c==="true"||c===""}(l)))}(i))return!1;var o=Ia(i,!1).targetElementList;return!function(l,u){if(l===!1||x(l))return!1;var c;if(l===!0)c=Fa;else{if(!A(l))return!1;if(l.length>10)return w.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;c=l.map(h=>h.toLowerCase())}return u.some(h=>{var d=h.safeText,v=h.ariaLabel;return c.some(p=>Kr(d,p)||Kr(v,p))})}(s,o.map(l=>{var u;return{safeText:Jt(l).toLowerCase(),ariaLabel:((u=l.getAttribute("aria-label"))==null?void 0:u.toLowerCase().trim())||""}}))&&!Vs(o,t)}var fr=i=>!i||we(i,"html")||!We(i),Ia=(i,e)=>{if(!g||fr(i))return{parentIsUsefulElement:!1,targetElementList:[]};for(var t=!1,s=[i],r=i;r.parentNode&&!we(r,"body");)if(ka(r.parentNode))s.push(r.parentNode.host),r=r.parentNode.host;else{var n=Ta(r);if(!n)break;if(e||gr.indexOf(n.tagName.toLowerCase())>-1)t=!0;else try{var a=g.getComputedStyle(n);a&&a.getPropertyValue("cursor")==="pointer"&&(t=!0)}catch{}s.push(n),r=n}return{parentIsUsefulElement:t,targetElementList:s}};function Ws(i){for(var e=new Set,t=0,s=i;s.parentNode&&!we(s,"body");s=s.parentNode){if(t++>=Sa||e.has(s))return!1;e.add(s);var r=Ci(s);if(M(r,"ph-sensitive")||M(r,"ph-no-capture"))return!1}if(M(Ci(i),"ph-include"))return!0;var n=i.type||"";if(U(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var a=i.name||i.id||"";return!U(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function $a(i){return!!(we(i,"input")&&!["button","checkbox","submit","reset"].includes(i.type)||we(i,"select")||we(i,"textarea")||i.getAttribute("contenteditable")==="true")}var Ra="(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}
1)|((?:2131|1800|35[0-9]{3})[0-9]{11})",Tl=new RegExp("^(?:"+Ra+")$"),Fl=new RegExp(Ra),Ca="\\d{3}-?\\d{2}-?\\d{4}",Il=new RegExp("^("+Ca+")$"),$l=new RegExp("("+Ca+")");function zt(i,e){return e===void 0&&(e=!0),!(O(i)||U(i)&&(i=Ni(i),(e?Tl:Fl).test((i||"").replace(/[- ]/g,""))||(e?Il:$l).test(i)))}function Qr(i){var e=Jt(i);return zt(e=(e+" "+Ma(i)).trim())?e:""}function Ma(i){var e="";return i&&i.childNodes&&i.childNodes.length&&G(i.childNodes,function(t){var s;if(t&&((s=t.tagName)==null?void 0:s.toLowerCase())==="span")try{var r=Jt(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+Ma(t)).trim())}catch(n){w.error("[AutoCapture]",n)}}),e}function Zr(i){return i.replace(/"|\\"/g,'\\"')}function Rl(i){var e=i.attr__class;return e?A(e)?e:vr(e):void 0}var ai=J("[Dead Clicks]"),Cl=()=>!0,Ml=i=>{var e,t=!((e=i.instance.persistence)==null||!e.get_property(ur)),s=i.instance.config.capture_dead_clicks;return Ce(s)?s:!!K(s)||t};class Xr{get lazyLoadedDeadClicksAutocapture(){return this.er}constructor(e,t,s){this.instance=e,this.isEnabled=t,this.onCapture=s,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[ur]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.rr(()=>{this.ir()}):this.stop()}rr(e){var t,s;(t=$.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture?e():(s=$.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"dead-clicks-autocapture",r=>{r?ai.error("failed to load script",r):e()})}ir(){var e;if(P){if(!this.er&&(e=$.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=K(this.instance.config.capture_dead_clicks)?_({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.er=$.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.er.start(P),ai.info("starting...")}}else ai.error("`document` not found. Cannot start.")}stop(){this.er&&(this.er.stop(),this.er=void 0,ai.info("stopping..."))}}var es=J("[SegmentIntegration]"),Oa="posthog-js";function Aa(i,e){var t=e===void 0?{}:e,s=t.organization,r=t.projectId,n=t.prefix,a=t.severityAllowList,o=a===void 0?["error"]:a,l=t.sendExceptionsToPostHog,u=l===void 0||l;return c=>{var h,d,v,p,f;if(o!=="*"&&!o.includes(c.level)||!i.__loaded)return c;c.tags||(c.tags={});var y=i.requestRouter.endpointFor("ui","/project/"+i.config.token+"/person/"+i.get_distinct_id());c.tags["PostHog Person URL"]=y,i.sessionRecordingStarted()&&(c.tags["PostHog Recording URL"]=i.get_session_replay_url({withTimestamp:!0}));var m,S=((h=c.exception)==null?void 0:h.values)||[],k=S.map(F=>_({},F,{stacktrace:F.stacktrace?_({},F.stacktrace,{type:"raw",frames:(F.stacktrace.frames||[]).map(D=>_({},D,{platform:"web:javascript"}))}):void 0})),E={$exception_message:((d=S[0])==null?void 0:d.value)||c.message,$exception_type:(v=S[0])==null?void 0:v.type,$exception_level:c.level,$exception_list:k,$sentry_event_id:c.event_id,$sentry_exception:c.exception,$sentry_exception_message:((p=S[0])==null?void 0:p.value)||c.message,$sentry_exception_type:(f=S[0])==null?void 0:f.type,$sentry_tags:c.tags};return s&&r&&(E.$sentry_url=(n||"https://sentry.io/organizations/")+s+"/issues/?project="+r+"&query="+c.event_id),u&&((m=i.exceptions)==null||m.sendExceptionEvent(E)),c}}class Ol{constructor(e,t,s,r,n,a){this.name=Oa,this.setupOnce=function(o){o(Aa(e,{organization:t,projectId:s,prefix:r,severityAllowList:n,sendExceptionsToPostHog:a==null||a}))}}}class en{constructor(e){this.nr=(t,s,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength||r.crossTabAdoption)&&(w.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.sr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.ar()}ar(){var e;this.lr=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.nr)}destroy(){var e;(e=this.lr)==null||e.call(this),this.lr=void 0}doPageView(e,t){var s,r=this.ur(e,t);return this.sr={pathname:(s=g?.location.pathname)!==null&&s!==void 0?s:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.ur(e,(t=this.sr)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.sr)==null?void 0:e.pageViewId}}ur(e,t){var s=this.sr;if(!s)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:s.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var a=n.maxScrollHeight,o=n.lastScrollY,l=n.maxScrollY,u=n.maxContentHeight,c=n.lastContentY,h=n.maxContentY;if(!(x(a)||x(o)||x(l)||x(u)||x(c)||x(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 d=a>1?Re(o/a,0,1,w):1,v=a>1?Re(l/a,0,1,w):1,p=u>1?Re(c/u,0,1,w):1,f=u>1?Re(h/u,0,1,w):1;r=W(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return s.pathname&&(r.$prev_pageview_pathname=s.pathname),s.timestamp&&(r.$prev_pageview_duration=(e.getTime()-s.timestamp.getTime())/1e3),r}}var ts=["flags","surveys"],Al={[ca]:{exposure:"hidden"},[Dt]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Nt]:{exposure:"hidden"},[Fs]:{exposure:"event"},[Is]:{exposure:"hidden"},[$s]:{exposure:"event"},[Rs]:{exposure:"hidden"},[Cs]:{exposure:"event"},[Ms]:{exposure:"event"},[ur]:{exposure:"event"},[cr]:{exposure:"hidden"},[Os]:{exposure:"event"},[nt]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ft]:{exposure:"hidden"},[hr]:{exposure:"event"}
1,[ha]:{exposure:"event",shouldSkipFromEventProperties:i=>ve(i)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[rt]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(i,e)=>e(),transformToEventProperties(i){if(!K(i))return{};for(var e={},t=Object.keys(i),s=0;t.length>s;s++)e["$feature/"+t[s]]=i[t[s]];return e}},[hi]:{exposure:"event",storageGroup:"flags"},[jt]:{exposure:"hidden"},[As]:{exposure:"hidden",storageGroup:"flags"},[di]:{exposure:"event",storageGroup:"flags"},[Ls]:{exposure:"event",storageGroup:"flags",volatile:!0},[De]:{exposure:"event"},[pt]:{exposure:"hidden"},[tt]:{exposure:"hidden"},[it]:{exposure:"hidden"},[Ds]:{exposure:"hidden",storageGroup:"surveys"},[Pi]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[Ns]:{exposure:"event"},[qt]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[Bt]:{exposure:"hidden"},[js]:{exposure:"hidden"},[qs]:{exposure:"hidden"},[Yt]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Pe]:{exposure:"hidden"},[Hs]:{exposure:"hidden"},[Us]:{exposure:"hidden"},[Bs]:{exposure:"hidden"},[zs]:{exposure:"hidden"},[Ti]:{exposure:"hidden"},[Fi]:{exposure:"hidden"},[da]:{exposure:"event"},[pa]:{exposure:"event"},[va]:{exposure:"event"},[ga]:{exposure:"event"},[_a]:{exposure:"event"},[ma]:{exposure:"event"},[ya]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},Ll=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Qe=i=>{var e=Al[i];if(e)return e;for(var t of Ll){var s=t[1];if(i.indexOf(t[0])===0)return s}},Qt=i=>{var e=P?.createElement("a");return x(e)?null:(e.href=i,e)},Et=function(i,e){for(var t,s=((i.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;s.length>r;r++){var n=s[r].split("=");if(n[0]===e){t=n;break}}if(!A(t)||2>t.length)return"";var a=t[1];try{a=decodeURIComponent(a)}catch{w.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Zt=function(i,e,t){if(!i||!e||!e.length)return i;for(var s=i.split("#"),r=s[1],n=(s[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],c=0;l.length>c;c++){var h=l[c].split("=");A(h)&&(e.includes(h[0])?u.push(h[0]+"="+t):u.push(l[c]))}var d=o;return a!=null&&(d+="?"+u.join("&")),r!=null&&(d+="#"+r),d},Mi=function(i,e){var t=i.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},La=(i,e)=>i>=e&&$n(),Da=(i,e,t,s)=>{if(i===0){if($n()){var r=e+1;return r===t&&s(),r}return e}return 0},oi="https?://(.*)",kt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Dl=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...kt],Xt="<masked>",Nl=["li_fat_id"];function Na(i,e,t){if(!P)return{};var s,r=e?[...kt,...t||[]]:[],n=ja(Zt(P.URL,r,Xt),i),a=(s={},G(Nl,function(o){var l=$e.A(o);s[o]=l||null}),s);return W(a,n)}function ja(i,e){var t=Dl.concat(e||[]),s={};return G(t,function(r){var n=Et(i,r);s[r]=n||null}),s}function qa(i){var e=function(n){return n?n.search(oi+"google.([^/?]*)")===0?"google":n.search(oi+"bing.com")===0?"bing":n.search(oi+"yahoo.com")===0?"yahoo":n.search(oi+"duckduckgo.com")===0?"duckduckgo":null:null}(i),t=e!="yahoo"?"q":"p",s={};if(!ve(e)){s.$search_engine=e;var r=P?Et(P.referrer,t):"";r.length&&(s.ph_keyword=r)}return s}function tn(){return navigator.language||navigator.userLanguage}var Oi="$direct";function Ha(){return P?.referrer||Oi}function Ua(i,e,t){t===void 0&&(t=!1);var s=i?[...kt,...e||[]]:[],r=t?Ve(ie?.href):ie?.href,n=r?.substring(0,1e3);return{r:Ha().substring(0,1e3),u:n?Zt(n,s,Xt):void 0}}function Ba(i,e){var t;e===void 0&&(e=!1);var s=i.r,r=i.u,n=e?Ve(r):r,a={$referrer:s,$referring_domain:s==null?void 0:s==Oi?Oi:(t=Qt(s))==null?void 0:t.host};
1if(n){a.$current_url=n;var o=Qt(n);a.$host=o?.host,a.$pathname=o?.pathname;var l=ja(n);W(a,l)}if(s){var u=qa(s);W(a,u)}return a}function za(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function jl(){try{return new Date().getTimezoneOffset()}catch{return}}var ql={flags:Yt,surveys:Pi},Hl=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],ct="main";class is{constructor(e,t,s){if(s===void 0&&(s=!0),this.hr={},this.dr=!1,this.cr=!1,this.Te=e,this.vr=s,this.props={},this.pr=!1,this.gr=(n=>{var a="";return n.token&&(a=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+a+"_posthog"})(e),this.Ye=this.mr(e),this.cr=this.yr(e),this.load(),e.debug&&w.info("Persistence loaded",e.persistence,_({},this.props)),this.update_config(e,e,t),this.save(),g){var r=()=>this.flush();ee(g,"beforeunload",r,{capture:!1}),ee(g,"pagehide",r,{capture:!1})}}br(){var e,t=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return ue(t)&&t>0?t:0}isDisabled(){return!!this._r}mr(e){Hl.indexOf(e.persistence.toLowerCase())===-1&&(w.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,s=function(a,o){a===void 0&&(a=[]),o===void 0&&(o=!1);var l=[...ml,...a];return _({},z,{F(u){try{var c={};try{c=$e.F(u)||{}}catch{}var h,d=JSON.parse(z.A(u)||"{}");if(o){var v={};for(var p in c){var f=c[p];ve(f)||f===""||(v[p]=f)}h=W(d,v)}else h=W(c,d);return z.q(u,h),h}catch{}return null},q(u,c,h,d,v,p){var f=z.q(u,c,void 0,void 0,p);try{var y={};l.forEach(m=>{c[m]&&(y[m]=c[m])}),Object.keys(y).length&&$e.q(u,y,h,d,v,p)}catch(m){z.D(m)}return f},P(u,c){try{g?.localStorage.removeItem(u),$e.P(u,c)}catch(h){z.D(h)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),r=!1,n=e.persistence.toLowerCase();return n==="localstorage"&&z.N()?(t=z,r=!0):n==="localstorage+cookie"&&s.N()?(t=s,r=!0):n==="sessionstorage"&&le.N()?t=le:n==="memory"?t=yl:n==="cookie"?t=$e:s.N()?(t=s,r=!0):t=$e,this.dr=r,t}wr(e){return this.gr+"__"+e}yr(e){return this.dr&&!!e.split_storage}kr(e){var t=e??this.Te.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var s=this.props[Yt];return!s||typeof s!="number"||Date.now()-s>t}properties(){var e={};return G(this.props,(t,s)=>{var r=Qe(s);if(r?.exposure==="derived"){if(r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,s===rt?()=>this.kr():()=>!1))return;r.transformToEventProperties&&W(e,r.transformToEventProperties(t))}else if(!r||r.exposure==="event"){if(r!=null&&r.shouldSkipFromEventProperties!=null&&r.shouldSkipFromEventProperties(t,()=>!1))return;e[s]=t}}),e}load(){if(!this._r){var e=this.Ye.F(this.gr);e&&(this.props=W({},e)),this.cr&&this.Sr()}}Sr(){for(var e of ts){var t=z.F(this.wr(e));if(t&&!Ge(t)){var s=this.Cr(e);s.persisted=!0,this.Ir(e)||(s.fingerprint=this.Tr(t,e)),this.Mr(e,t)||W(this.props,t)}}}Ir(e){return Object.keys(this.props).some(t=>{var s;return((s=Qe(t))==null?void 0:s.storageGroup)===e})}Mr(e,t){var s=ql[e];if(!s)return!1;var r=t[s],n=this.props[s];return ue(r)&&ue(n)&&n>r}refreshKey(e){var t;if(!this._r){var s=this.cr?(t=Qe(e))==null?void 0:t.storageGroup:void 0,r=s?z.F(this.wr(s)):this.Ye.F(this.gr);if(r&&e in r)this.Er(e,r[e]);else{if(s){var n=this.Ye.F(this.gr);if(n&&e in n)return void this.Er(e,n[e])}this.Rr(e)}}}save(){if(!this._r){var e=this.br();e>0?x(this.Pr)&&(this.Pr=setTimeout(()=>{this.Pr=void 0,this.Or()},e)):this.Or()}}flush(){x(this.Pr)||(clearTimeout(this.Pr),this.Pr=void 0,this.Or())}Or(){this._r||(this.cr?this.Fr():this.Lr(this.Ye,this.gr,this.props,ct))}Fr(){var e=this.Ar(),t=e.main,s=e.groups;for(var r of(this.Lr(this.Ye,this.gr,t,ct),ts)){var n,a=s[r];(!Ge(a)||(n=this.hr[r])!=null&&n.persisted)&&this.Lr(z,this.wr(r),a,r)}}Ar(){var e={},t={flags:{},surveys:{}};return G(this.props,(s,r)=>{var n,a=(n=Qe(r))==null?void 0:n.storageGroup;a?t[a][r]=s:e[r]=s}),{main:e,groups:t}}Tr(e,t){if(t===ct)return JSON.stringify(e)+"|"+this.$r+"|"+this.Nr+"|"+this.Dr;var s={};return G(e,(r,n)=>{var a;s[n]=(a=Qe(n))!=null&&a.volatile?"__volatile__":r}),JSON.stringify(s)}Lr(e,t,s,r){var n=this.Cr(r);if(r===ct||n.dirty||x(n.fingerprint)){var a;try{if((a=this.Tr(s,r))===n.fingerprint)return void(n.dirty=!1)}catch{a=void 0}e.q(t,s,this.$r,this.Nr,this.Dr,this.Te.debug)?(n.dirty=!1,r!==ct&&(n.persisted=!0),x(a)||
1(n.fingerprint=a)):this.Te.debug&&w.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var t=(e===void 0?{}:e).keepGroupEntries,s=t!==void 0&&t;if(x(this.Pr)||(clearTimeout(this.Pr),this.Pr=void 0),this.Ye.P(this.gr,!1),this.Ye.P(this.gr,!0),!s&&this.vr)for(var r of ts)z.P(this.wr(r));s?delete this.hr[ct]:this.hr={}}clear(){this.remove(),this.props={}}register_once(e,t,s){if(K(e)){x(t)&&(t="None"),this.$r=x(s)?this.qr:s;var r=!1;if(G(e,(n,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.Er(a,n),r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(K(e)){this.$r=x(t)?this.qr:t;var s=!1;if(G(e,(r,n)=>{e.hasOwnProperty(n)&&this.props[n]!==r&&(this.Er(n,r),s=!0)}),s)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Rr(e),this.save())}update_campaign_params(){if(!this.pr){var e=Na(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Ge(pr(e))||this.register(e),this.pr=!0}}update_search_keyword(){var e;this.register((e=P?.referrer)?qa(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Ha(),$referring_domain:P!=null&&P.referrer&&((e=Qt(P.referrer))==null?void 0:e.host)||Oi},void 0)}set_initial_person_info(){this.props[Bs]||this.props[zs]||this.register_once({[Ti]:Ua(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};G([zs,Bs],r=>{var n=this.props[r];n&&G(n,function(a,o){e["$initial_"+ws(o)]=a})});var t=this.props[Ti];if(t){var s=function(r,n){n===void 0&&(n=!1);var a=Ba(r,n),o={};return G(a,function(l,u){o["$initial_"+ws(u)]=l}),o}(t,this.Te.disable_capture_url_hashes);W(e,s)}return e}safe_merge(e){return G(this.props,function(t,s){s in e||(e[s]=t)}),e}update_config(e,t,s){this.qr=this.$r=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!s),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var r=e.persistence!==t.persistence||!((l,u)=>{if(l.length!==u.length)return!1;var c=[...l].sort(),h=[...u].sort();return c.every((d,v)=>d===h[v])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=r?this.mr(e):this.Ye,a=this.yr(e);if(r||a!==this.cr){var o=this.props;this.clear(),this.Ye=n,this.cr=a,this.props=o,this.save()}}set_disabled(e){this._r=e,this._r?this.remove():this.save()}set_cross_subdomain(e){e!==this.Nr&&(this.Nr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Dr&&(this.Dr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var s=this.props[Nt]||{};s[e]=t,this.Er(Nt,s),this.save()}remove_event_timer(e){var t=this.props[Nt]||{},s=t[e];return x(s)||(delete t[e],this.Er(Nt,t),this.save()),s}get_property(e){return this.props[e]}set_property(e,t){this.Er(e,t),this.save()}Er(e,t){var s;this.props[e]=t,(s=Qe(e))!=null&&s.volatile||this.jr(e)}Rr(e){delete this.props[e],this.jr(e)}jr(e){var t,s=(t=Qe(e))==null?void 0:t.storageGroup;s&&(this.Cr(s).dirty=!0)}Cr(e){return this.hr[e]||(this.hr[e]={})}}var Ft={Activation:"events",Cancellation:"cancelEvents"},ss={Popover:"popover",API:"api",Widget:"widget"},He={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},rs={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Ks={Popover:"popover",Inline:"inline"},Ul={SHOWN:"product tour shown"},sn={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},rn=J("[RateLimiter]");class Bl{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var s=t.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(r=>{rn.info((r||"events")+" is quota limited."),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void rn.warn('could not rate limit - continuing. Error: "'+r?.message+'"',{text:s})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,s,r;e===void 0&&(e=!1);var n=this.captureEventsBurstLimit,a=this.captureEventsPerSecond,o=new Date().getTime(),l=(t=(s=this.instance.persistence)==null?void 0:s.get_property(Us))!==null&&t!==void 0?t:{tokens:n,last:o};l.tokens+=(o-l.last)/1e3*a,l.last=o,l.tokens>n&&(l.tokens=n);var u=1>l.tokens;return u||e||(l.tokens=Math.max(0,l.tokens-1)),!u||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(r=this.instance.persistence)==null||r.set_property(Us,l),{isRateLimited:u,remainingTokens:l.tokens}
1}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var It=J("[RemoteConfig]");class Ga{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=$._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Hr(e){var t,s;(t=$.__PosthogExtensions__)!=null&&t.loadExternalDependency?(s=$.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Br(e){this._instance._send_request({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 It.info("Using preloaded remote config",this.remoteConfig),this.Ur(this.remoteConfig),void this.zr();if(this._instance.Vr())return void It.warn("Remote config is disabled. Falling back to local config.");this.Hr(e=>{if(!e)return It.info("No config found after loading remote JS config. Falling back to JSON."),void this.Br(t=>{this.Ur(t),this.zr()});this.Ur(e),this.zr()})}catch(e){It.error("Error loading remote config",e)}}stop(){this.Wr&&(clearInterval(this.Wr),this.Wr=void 0)}refresh(){!this._instance.Vr()&&P&&P.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}zr(){var e;if(!this.Wr){var t=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;t!==0&&(this.Wr=setInterval(()=>{this.refresh()},t))}}Ur(e){var t;e||It.error("Failed to fetch remote config from PostHog."),this._instance.Ur(e?{ok:!0,config:e}:{ok:!1}),e?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}}var de={GZipJS:"gzip-js",Base64:"base64"},Se=Uint8Array,ye=Uint16Array,St=Uint32Array,_r=new Se([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mr=new Se([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),nn=new Se([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Va=function(i,e){for(var t=new ye(31),s=0;31>s;++s)t[s]=e+=1<<i[s-1];var r=new St(t[30]);for(s=1;30>s;++s)for(var n=t[s];t[s+1]>n;++n)r[n]=n-t[s]<<5|s;return[t,r]},Wa=Va(_r,2),Ys=Wa[1];Wa[0][28]=258,Ys[258]=28;for(var an=Va(mr,0)[1],Ka=new ye(32768),Y=0;32768>Y;++Y){var ht=(43690&Y)>>>1|(21845&Y)<<1;Ka[Y]=((65280&(ht=(61680&(ht=(52428&ht)>>>2|(13107&ht)<<2))>>>4|(3855&ht)<<4))>>>8|(255&ht)<<8)>>>1}var Gt=function(i,e,t){for(var s=i.length,r=0,n=new ye(e);s>r;++r)++n[i[r]-1];var a,o=new ye(e);for(r=0;e>r;++r)o[r]=o[r-1]+n[r-1]<<1;for(a=new ye(s),r=0;s>r;++r)a[r]=Ka[o[i[r]-1]++]>>>15-i[r];return a},ot=new Se(288);for(Y=0;144>Y;++Y)ot[Y]=8;for(Y=144;256>Y;++Y)ot[Y]=9;for(Y=256;280>Y;++Y)ot[Y]=7;for(Y=280;288>Y;++Y)ot[Y]=8;var Ai=new Se(32);for(Y=0;32>Y;++Y)Ai[Y]=5;var zl=Gt(ot,9),Gl=Gt(Ai,5),Ya=function(i){return(i/8>>0)+(7&i&&1)},Ja=function(i,e,t){(t==null||t>i.length)&&(t=i.length);var s=new(i instanceof ye?ye:i instanceof St?St:Se)(t-e);return s.set(i.subarray(e,t)),s},Me=function(i,e,t){var s=e/8>>0;i[s]|=t<<=7&e,i[s+1]|=t>>>8}
vendor: 4,290 bytes, line 1
1,$t=function(i,e,t){var s=e/8>>0;i[s]|=t<<=7&e,i[s+1]|=t>>>8,i[s+2]|=t>>>16},ns=function(i,e){for(var t=[],s=0;i.length>s;++s)i[s]&&t.push({s,f:i[s]});var r=t.length,n=t.slice();if(!r)return[new Se(0),0];if(r==1){var a=new Se(t[0].s+1);return a[t[0].s]=1,[a,1]}t.sort(function(F,D){return F.f-D.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!=r-1;)o=t[t[h].f>t[u].f?u++:h++],l=t[u!=c&&t[h].f>t[u].f?u++:h++],t[c++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var v=new ye(d+1),p=Js(t[c-1],v,0);if(p>e){s=0;var f=0,y=p-e,m=1<<y;for(n.sort(function(F,D){return v[D.s]-v[F.s]||F.f-D.f});r>s;++s){var S=n[s].s;if(e>=v[S])break;f+=m-(1<<p-v[S]),v[S]=e}for(f>>>=y;f>0;){var k=n[s].s;e>v[k]?f-=1<<e-v[k]++-1:++s}for(;s>=0&&f;--s){var E=n[s].s;v[E]==e&&(--v[E],++f)}p=e}return[new Se(v),p]},Js=function(i,e,t){return i.s==-1?Math.max(Js(i.l,e,t+1),Js(i.r,e,t+1)):e[i.s]=t},on=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new ye(++e),s=0,r=i[0],n=1,a=function(l){t[s++]=l},o=1;e>=o;++o)if(i[o]==r&&o!=e)++n;else{if(!r&&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(r),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(r);n=1,r=i[o]}return[t.subarray(0,s),e]},Rt=function(i,e){for(var t=0,s=0;e.length>s;++s)t+=i[s]*e[s];return t},Qs=function(i,e,t){var s=t.length,r=Ya(e+2);i[r]=255&s,i[r+1]=s>>>8,i[r+2]=255^i[r],i[r+3]=255^i[r+1];for(var n=0;s>n;++n)i[r+n+4]=t[n];return 8*(r+4+s)},ln=function(i,e,t,s,r,n,a,o,l,u,c){Me(e,c++,t),++r[256];for(var h=ns(r,15),d=h[0],v=h[1],p=ns(n,15),f=p[0],y=p[1],m=on(d),S=m[0],k=m[1],E=on(f),F=E[0],D=E[1],L=new ye(19),b=0;S.length>b;++b)L[31&S[b]]++;for(b=0;F.length>b;++b)L[31&F[b]]++;for(var T=ns(L,7),I=T[0],C=T[1],R=19;R>4&&!I[nn[R-1]];--R);var N,V,B,j,q=u+5<<3,re=Rt(r,ot)+Rt(n,Ai)+a,he=Rt(r,d)+Rt(n,f)+a+14+3*R+Rt(L,I)+(2*L[16]+3*L[17]+7*L[18]);if(re>=q&&he>=q)return Qs(e,c,i.subarray(l,l+u));if(Me(e,c,1+(re>he)),c+=2,re>he){N=Gt(d,v),V=d,B=Gt(f,y),j=f;var ge=Gt(I,C);for(Me(e,c,k-257),Me(e,c+5,D-1),Me(e,c+10,R-4),c+=14,b=0;R>b;++b)Me(e,c+3*b,I[nn[b]]);c+=3*R;for(var fe=[S,F],be=0;2>be;++be){var Q=fe[be];for(b=0;Q.length>b;++b)Me(e,c,ge[ne=31&Q[b]]),c+=I[ne],ne>15&&(Me(e,c,Q[b]>>>5&127),c+=Q[b]>>>12)}}else N=zl,V=ot,B=Gl,j=Ai;for(b=0;o>b;++b)if(s[b]>255){var ne;$t(e,c,N[257+(ne=s[b]>>>18&31)]),c+=V[ne+257],ne>7&&(Me(e,c,s[b]>>>23&31),c+=_r[ne]);var ae=31&s[b];$t(e,c,B[ae]),c+=j[ae],ae>3&&($t(e,c,s[b]>>>5&8191),c+=mr[ae])}else $t(e,c,N[s[b]]),c+=V[s[b]];return $t(e,c,N[256]),c+V[256]},Vl=new St([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Wl=function(){for(var i=new St(256),e=0;256>e;++e){for(var t=e,s=9;--s;)t=(1&t&&3988292384)^t>>>1;i[e]=t}return i}(),as=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8};function Kl(i,e){e===void 0&&(e={});var t=function(){var h=4294967295;return{p(d){for(var v=h,p=0;d.length>p;++p)v=Wl[255&v^d[p]]^v>>>8;h=v},d(){return 4294967295^h}}}(),s=i.length;t.p(i);var r,n,a,o,l,u=(o=10+((r=e).filename&&r.filename.length+1||0),l=8,function(h,d,v,p,f,y){var m=h.length,S=new Se(p+m+5*(1+Math.floor(m/7e3))+f),k=S.subarray(p,S.length-f),E=0;if(!d||8>m)for(var F=0;m>=F;F+=65535){var D=F+65535;m>D?E=Qs(k,E,h.subarray(F,D)):(k[F]=!0,E=Qs(k,E,h.subarray(F,m)))}else{for(var L=Vl[d-1],b=L>>>13,T=8191&L,I=(1<<v)-1,C=new ye(32768),R=new ye(I+1),N=Math.ceil(v/3),V=2*N,B=function(Ui){return(h[Ui]^h[Ui+1]<<N^h[Ui+2]<<V)&I},j=new St(25e3),q=new ye(288),re=new ye(32),he=0,ge=0,fe=(F=0,0),be=0,Q=0;m>F;++F){var ne=B(F),ae=32767&F,Fe=R[ne];if(C[ae]=Fe,R[ne]=ae,F>=be){var Ke=m-F;if((he>7e3||fe>24576)&&Ke>423){E=ln(h,k,0,j,q,re,ge,fe,Q,F-Q,E),fe=he=ge=0,Q=F;for(var _e=0;286>_e;++_e)q[_e]=0;for(_e=0;30>_e;++_e)re[_e]=0}var Ye=2,ei=0,co=T,Be=ae-Fe&32767;if(Ke>2&&ne==B(F-Be))for(var ho=Math.min(b,Ke)-1,po=Math.min(32767,F),vo=Math.min(258,Ke);po>=Be&&--co&&ae!=Fe;){if(h[F+Ye]==h[F+Ye-Be]){for(var ze=0;vo>ze&&h[F+ze]==h[F+ze-Be];++ze);if(ze>Ye){if(Ye=ze,ei=Be,ze>ho)break;var go=Math.min(Be,ze-2),wr=0;for(_e=0;go>_e;++_e){var Hi=F-Be+_e+32768&32767,xr=Hi-C[Hi]+32768&32767;xr>wr&&(wr=xr,Fe=Hi)}}}Be+=(ae=Fe)-(Fe=C[ae])+32768&32767}if(ei){j[fe++]=268435456|Ys[Ye]<<18|an[ei];var Er=31&Ys[Ye],kr=31&an[ei];ge+=_r[Er]+mr[kr],++q[257+Er],++re[kr],be=F+Ye,++he}
1else j[fe++]=h[F],++q[h[F]]}}E=ln(h,k,!0,j,q,re,ge,fe,Q,F-Q,E)}return Ja(S,0,p+Ya(E)+f)}(n=i,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+a.mem,o,l)),c=u.length;return function(h,d){var v=d.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>d.level?4:d.level==9?2:0,h[9]=3,d.mtime!=0&&as(h,4,Math.floor(new Date(d.mtime||Date.now())/1e3)),v){h[3]=8;for(var p=0;v.length>=p;++p)h[p+10]=v.charCodeAt(p)}}(u,e),as(u,c-8,t.d()),as(u,c-4,s),u}var Yl=!!ms||!!sr,Qa="text/plain",vi=!1,Zs=(i,e)=>{var t=i.split("#"),s=t[1],r=t[0].split("?"),n=r[0],a=r[1];if(!a)return i;var o=a.split("&").filter(l=>l.split("=")[0]!==e).join("&");return n+(o?"?"+o:"")+(s?"#"+s:"")},yr=function(i,e,t){var s;t===void 0&&(t=!0);var r=i.split("?"),n=r[0],a=r[1],o=_({},e),l=(s=a?.split("&").map(c=>{var h,d=c.split("="),v=d[0],p=t&&(h=o[v])!==null&&h!==void 0?h:d[1];return delete o[v],v+"="+p}))!==null&&s!==void 0?s:[],u=function(c,h){var d,v;h===void 0&&(h="&");var p=[];return G(c,function(f,y){x(f)||x(y)||y==="undefined"||(d=encodeURIComponent((m=>m instanceof File)(f)?f.name:f.toString()),v=encodeURIComponent(y),p[p.length]=v+"="+d)}),p.join(h)}(o);return u&&l.push(u),n+"?"+l.join("&")},_t=(i,e)=>{try{return JSON.stringify(i,(t,s)=>typeof s=="bigint"?s.toString():s,e)}catch{return Mn(i)}},os=i=>{if(i.Ge)return i.Ge;var e=i.data,t=i.compression;if(e){if(t===de.GZipJS){var s=Kl(function(o,l){var u=o.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var c=new Se(o.length+(o.length>>>1)),h=0,d=function(y){c[h++]=y},v=0;u>v;++v){if(h+5>c.length){var p=new Se(h+8+(u-v<<1));p.set(c),c=p}var f=o.charCodeAt(v);128>f?d(f):2048>f?(d(192|f>>>6),d(128|63&f)):f>55295&&57344>f?(d(240|(f=65536+(1047552&f)|1023&o.charCodeAt(++v))>>>18),d(128|f>>>12&63),d(128|f>>>6&63),d(128|63&f)):(d(224|f>>>12),d(128|f>>>6&63),d(128|63&f))}return Ja(c,0,h)}(_t(e)),{mtime:0});return{contentType:Qa,body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(t===de.Base64){var r=function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))}(_t(e)),n=(o=>"data="+encodeURIComponent(typeof o=="string"?o:_t(o)))(r);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var a=_t(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Za=i=>{var e,t,s=()=>i.transport==="sendBeacon"?{url:yr(i.url,{compression:de.Base64}),encodedBody:os(_({},i,{compression:de.Base64,Ge:void 0}))}:{url:Zs(i.url,"compression"),encodedBody:os(_({},i,{compression:void 0,Ge:void 0}))};try{e=os(i)}catch(r){if(Cr(i.compression,Et(i.url,"compression")))return w.error("Failed to gzip request body, sending uncompressed payload",r),s();throw r}return e&&Cr(i.compression,Et(i.url,"compression"))&&!((t=e.body)instanceof ArrayBuffer?ys(new Uint8Array(t)):ArrayBuffer.isView(t)&&ys(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))?(vi=!0,s()):{url:i.url,encodedBody:e}},Xa=i=>{try{return Za(i)}catch(e){return w.error(e),void(i.callback==null||i.callback({statusCode:0,error:e}))}},Jl=function(){var i=te(function*(e){var t=_t(e.data),s=yield function(n,a,o){return bs.apply(this,arguments)}(t,X.DEBUG,{rethrow:!0});if(!s)return e;var r=yield s.arrayBuffer();return _({},e,{Ge:{contentType:Qa,body:r,estimatedSize:r.byteLength}})});return function(e){return i.apply(this,arguments)}}(),Ql=/Failed to fetch|NetworkError|Load failed/i,eo=i=>{var e=Xa(i);if(e){var t=e.url,s=e.encodedBody,r=s??{},n=r.contentType,a=r.body,o=r.estimatedSize,l=new Headers;G(i.headers,function(p,f){l.append(f,p)}),n&&l.append("Content-Type",n);var u=null,c=!1;if(Sr){var h=new Sr;u={signal:h.signal,timeout:setTimeout(()=>{var p,f;c=!0,h.abort((p=i.timeout,(f=new Error("PostHog request timed out"+(p?" after "+p+"ms":""))).name="AbortError",f))},i.timeout)}}var d=p=>{c&&p?.name==="AbortError"||(f=>f?.name==="TypeError"&&Ql.test(f?.message||""))(p)?w.warn(p):w.error(p),i.callback==null||i.callback({statusCode:0,error:p})};try{var v;sr(t,_({method:i?.method||"GET",headers:l,keepalive:i.method==="POST"&&!i.Qe&&52428.8>(o||0),body:a,signal:(v=u)==null?void 0:v.signal},i.fetchOptions)).then(p=>p.text().then(f=>{var y={statusCode:p.status,text:f};if(p.status===200)try{y.json=JSON.parse(f)}catch(m){w.error(m)}i.callback==null||i.callback(y)})).catch(d).finally(()=>u?clearTimeout(u.timeout):null)}catch(p){u&&clearTimeout(u.timeout),d(p)}}},Xs=i=>{try{var e=Za(i),t=e.url,s=e.encodedBody,r=s??{},n=r.body,a=r.estimatedSize;if(!n)return;var o=n instanceof Blob?n:new Blob([n],{type:r.contentType});if(pe.sendBeacon(t,o))return;if(A(i.data)&&i.data.length>1&&(a??0)>16384){var l=Math.ceil(i.data.length/2);return Xs(_({},i,{data:i.data.slice(0,l)})),void Xs(_({},i,{data:i.data.slice(l)}))}w.warn("Beacon of ~"+(a??0)+" bytes was rejected by the browser, falling back to fetch"),eo(_({},i,{Qe:!0}))}catch(u){w.warn("Beacon send failed",u)}},Zl=["/e/","/s/"],un=(i,e)=>{var t=(r=>{var n=(a=>{var o=Qt(a),l=o?.pathname||a.split(/[?#]/)[0];return l?l[0]==="/"?l:"/"+l:"/"})(r);return Zl.some(a=>((o,l)=>o.slice(o.length-l.length)===l)(n,a))})(i),s=t?Zs(i,"ver"):i;return yr(e===de.GZipJS?Zs(s,"compression"):s,_({_:new Date().getTime().toString()},t?{}:{ver:X.JS_SDK_VERSION},e===de.GZipJS?{}:{compression:e}))},gi=[];sr&&gi.push({transport:"fetch",method:eo}),ms&&gi.push({transport:"XHR",method(i){var e=Xa(i);if(e){var t=new ms,s=e.encodedBody;t.open(i.method||"GET",e.url,!0);var r=s??{},n=r.contentType,a=r.body;G(i.headers,function(o,l){t.setRequestHeader(l,o)}),n&&t.setRequestHeader("Content-Type",n),i.timeout&&(t.timeout=i.timeout),t.onreadystatechange=()=>{if(t.readyState===4){var o={statusCode:t.status,text:t.responseText};if(t.status===200)try{o.json=JSON.parse(t.responseText)}catch{}i.callback==null||i.callback(o)}},t.send(a)}}}),pe!=null&&pe.sendBeacon&&gi.push({transport:"sendBeacon",method:Xs});var er=3e3;class Xl{constructor(e,t){this.Zr=!0,this.Gr=[],this.Qr=Re(t?.flush_interval_ms||er,250,5e3,w.createLogger("flush interval"),er),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}
1unload(){this.Xr();var e=this.Gr.length>0?this.ti():{},t=Object.values(e);[...t.filter(s=>s.url.indexOf("/e")===0),...t.filter(s=>s.url.indexOf("/e")!==0)].map(s=>{this.ei(_({},s,{transport:"sendBeacon"}))})}enable(){this.Zr=!1,this.Yr()}Yr(){var e=this;this.Zr||(this.Kr=setTimeout(()=>{if(this.Xr(),this.Gr.length>0){var t=this.ti(),s=function(){var n=t[r],a=new Date().getTime();n.data&&A(n.data)&&G(n.data,o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp}),e.ei(n)};for(var r in t)s()}},this.Qr))}ei(e){try{this.Jr(e)}catch(t){w.error(t)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ti(){var e={};return G(this.Gr,t=>{var s,r=t,n=(r?r.batchKey:null)||r.url;x(e[n])&&(e[n]=_({},r,{data:[]})),(s=e[n].data)==null||s.push(r.data)}),this.Gr=[],e}}var eu=["retriesPerformedSoFar"];class tu{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!x(g)&&"onLine"in g.navigator&&(this.ni=g.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},ee(g,"online",this.si),ee(g,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var t=e.retriesPerformedSoFar,s=Rn(e,eu);Le(t)&&(s.url=yr(s.url,{retry_count:t})),this._instance._send_request(_({},s,{callback:r=>{if(r.statusCode!==200&&(400>r.statusCode||r.statusCode>=500)){if((r.statusCode===0?3:10)>(t??0))return void this.Ot(_({retriesPerformedSoFar:t},s));r.statusCode===0&&w.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(t??0)+" retries.")}s.callback==null||s.callback(r)}}))}Ot(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var s=function(a){var o=3e3*Math.pow(2,a),l=o/2,u=Math.min(18e5,o),c=Math.random()-.5;return Math.ceil(u+c*(u-l))}(t),r=Date.now()+s;this.Gr.push({retryAt:r,requestOptions:e});var n="Enqueued failed request for retry in "+s;navigator.onLine||(n+=" (Browser is offline)"),w.warn(n),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),this.Gr.length===0)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout(()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()},this.ii)}oi(){var e=Date.now(),t=[],s=this.Gr.filter(n=>e>n.retryAt||(t.push(n),!1));if(this.Gr=t,s.length>0)for(var r of s)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,x(g)||(this.si&&(g.removeEventListener("online",this.si),this.si=void 0),this.ai&&(g.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var t=e.requestOptions;try{this._instance._send_request(_({},t,{transport:"sendBeacon"}))}catch(s){w.error(s)}}this.Gr=[]}}class iu{constructor(e){this.hi=()=>{var t,s,r,n;this.di||(this.di={});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.di.lastScrollY=Math.ceil(o),this.di.maxScrollY=Math.max(o,(t=this.di.maxScrollY)!==null&&t!==void 0?t:0),this.di.maxScrollHeight=Math.max(l,(s=this.di.maxScrollHeight)!==null&&s!==void 0?s:0),this.di.lastContentY=u,this.di.maxContentY=Math.max(u,(r=this.di.maxContentY)!==null&&r!==void 0?r:0),this.di.maxContentHeight=Math.max(c,(n=this.di.maxContentHeight)!==null&&n!==void 0?n:0)},this._instance=e}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var e=this.di;return setTimeout(this.hi,0),e}startMeasuringScrollPosition(){ee(g,"scroll",this.hi,{capture:!0}),ee(g,"scrollend",this.hi,{capture:!0}),ee(g,"resize",this.hi)}scrollElement(){if(!this.ci)return g?.document.documentElement;var e=A(this.ci)?this.ci:[this.ci];for(var t of e){var s=g?.document.querySelector(t);if(s)return s}}vi(e){var t=e==="y"?"scrollTop":"scrollLeft";if(this.ci){var s=this.scrollElement();return s&&s[t]||0}return g?e==="y"?g.scrollY||g.pageYOffset||g.document.documentElement.scrollTop||0:g.scrollX||g.pageXOffset||g.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var su=i=>Ua(i?.config.mask_personal_data_properties,i?.config.custom_personal_data_properties,i?.config.disable_capture_url_hashes
1);class cn{constructor(e,t,s,r){this.fi=n=>{var a=this.pi();if(!a||a.sessionId!==n){var o={sessionId:n,props:this.gi(this._instance)};this.mi.register({[Hs]:o})}},this._instance=e,this.yi=t,this.mi=s,this.gi=r||su,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[Hs]}getSetOnceProps(){var e,t=(e=this.pi())==null?void 0:e.props;return t?"r"in t?Ba(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return G(pr(this.getSetOnceProps()),(t,s)=>{s==="$current_url"&&(s="url"),e["$session_entry_"+ws(s)]=t}),e}}class br{constructor(){this.bi={}}on(e,t){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(t),()=>{this.bi[e]=this.bi[e].filter(s=>s!==t)}}emit(e,t){for(var s of this.bi[e]||[])s(t);for(var r of this.bi["*"]||[])r(e,t)}}var Ct=J("[SessionId]");class hn{on(e,t){return this.wi.on(e,t)}constructor(e,t,s){var r;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new br,this.Ii=(u,c)=>!(!Le(u)||!Le(c))&&Math.abs(u-c)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===qe)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ti=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=t||je,this.Ri=s||je;var n=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*Re(this.Te.session_idle_timeout_seconds||1800,60,36e3,Ct.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+n+"_window_id",this.Fi="ph_"+n+"_primary_window_exists",this.Li()){var a=le.F(this.Oi),o=le.F(this.Fi);a&&!o?this.Ti=a:le.P(this.Oi),le.q(this.Fi,!0)}if((r=this.Te.bootstrap)!=null&&r.sessionID)try{var l=(u=>{var c=this.Te.bootstrap.sessionID.replace(/-/g,"");if(c.length!==32)throw new Error("Not a valid UUID");if(c[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(c.substring(0,12),16)})();this.Ai(this.Te.bootstrap.sessionID,new Date().getTime(),l)}catch(u){Ct.error("Invalid sessionID in bootstrap",u)}this.$i()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return x(this.ki)&&(this.ki=[]),this.ki.push(e),this.Mi&&e(this.Mi,this.Ti),()=>{this.ki=this.ki.filter(t=>t!==e)}}Li(){return this.Te.persistence!=="memory"&&!this.mi._r&&le.N()}Ni(e){e!==this.Ti&&(this.Ti=e,this.Li()&&le.q(this.Oi,e))}Di(){return this.Ti?this.Ti:this.Li()?le.F(this.Oi):null}qi(e){var t=this.xi;return!ve(t)&&!ve(e)&&5e3>Math.abs(e-t)}Ai(e,t,s){var r=t!==this._sessionActivityTimestamp,n=!(e!==this.Mi||s!==this._sessionStartTimestamp);this._sessionStartTimestamp=s,this._sessionActivityTimestamp=t,this.Mi=e,n&&!r||n&&this.qi(t)||(this.xi=t,this.mi.register({[ft]:[t,e,s]}))}ji(){var e,t=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return Le(t)&&t>0}Hi(){this.ji()?this.mi.refreshKey(ft):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!ve(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var t=this.Ui();t[1]===this.Mi&&t[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[ft]:[this._sessionActivityTimestamp,(e=this.Mi)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],t=Le(e)?e:0,s=Le(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,s)}Vi(e){return this.Hi(),this.Ii(e,this.zi())}Ui(){var e=this.mi.props[ft];return A(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.Ai(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&g&&(g.removeEventListener($i,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}$i(){this.Si=()=>{this.Bi(),this.Li()&&le.P(this.Fi)},ee(g,$i,this.Si,{capture:!1})}
1checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.Te.cookieless_mode===qe)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s=t||new Date().getTime(),r=this.Ui(),n=r[1],a=r[2],o=this.zi(),l=this.Di(),u=Le(a)&&Math.abs(s-a)>864e5,c=!1,h=!1,d=!n,v=n,p=!d&&!e&&this.Ii(s,o);if(p){(p=this.Vi(s))||Ct.info("cross-tab refresh kept the session alive",{sessionId:n});var f=this.Ui();n=f[1],a=f[2]}d||p||u?(n=this.Ei(),l=this.Ri(),Ct.info("new session ID generated",{sessionId:n,windowId:l,changeReason:{noSessionId:d,activityTimeout:p,sessionPastMaximumLength:u}}),a=s,c=!0):(l||(l=this.Ri(),c=!0),(h=n!==v)&&(Ct.info("adopted cross-tab session id",{sessionId:n,windowId:l}),c=!0));var y=Le(o)&&e&&!u?o:s,m=Le(a)?a:new Date().getTime();this.Ni(l),this.Ai(n,y,m),e||this.Pi();var S={noSessionId:d,activityTimeout:p,sessionPastMaximumLength:u,crossTabAdoption:h};return c&&this.ki.forEach(k=>k(n,l,S)),{sessionId:n,windowId:l,sessionStartTimestamp:m,changeReason:c?S:void 0,lastActivityTimestamp:o}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout(()=>{if(!this.Ci)if(this.Vi(new Date().getTime())){var e=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()},1.1*this.sessionTimeoutMs))}}var to=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&Or(t,e))return!0;try{var s=i?.userAgentData;if(s!=null&&s.brands&&s.brands.some(r=>Or(r?.brand,e)))return!0}catch{}return!!i.webdriver};function io(){return(io=te(function*(){var i=pe?.userAgentData;if(i!=null&&i.getHighEntropyValues)try{var e=yield i.getHighEntropyValues(["model"]),t=e?.model;return U(t)&&t.length>0?t:void 0}catch(s){return void w.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",s)}})).apply(this,arguments)}var Li=function(i,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(i)}catch{return!1}};function dn(i,e,t){return _t({distinct_id:i,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var so={exact:(i,e)=>e.some(t=>i.some(s=>t===s)),is_not:(i,e)=>e.every(t=>i.every(s=>t!==s)),regex:(i,e)=>e.some(t=>i.some(s=>Li(t,s))),not_regex:(i,e)=>e.every(t=>i.every(s=>!Li(t,s))),icontains:(i,e)=>e.map(li).some(t=>i.map(li).some(s=>t.includes(s))),not_icontains:(i,e)=>e.map(li).every(t=>i.map(li).every(s=>!t.includes(s))),gt:(i,e)=>e.some(t=>{var s=parseFloat(t);return!isNaN(s)&&i.some(r=>s>parseFloat(r))}),lt:(i,e)=>e.some(t=>{var s=parseFloat(t);return!isNaN(s)&&i.some(r=>s<parseFloat(r))})},li=i=>i.toLowerCase();function ro(i,e){return!i||Object.entries(i).every(t=>{var s=t[1],r=e?.[t[0]];if(x(r)||ve(r))return!1;var n=[String(r)],a=so[s.operator];return!!a&&a(s.values,n)})}var tr="custom",pn="i.posthog.com",ru=/^\/static\//;class nu{constructor(e){this.Zi={},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 flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+pn,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.Zi[this.apiHost]||(this.Zi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":tr),this.Zi[this.apiHost]}Gi(e){if(ru.test(e)){var t=this.instance.config.asset_host;if(typeof t=="string")return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(e==="flags")return this.flagsApiHost+t;if(e==="assets"){var s=this.Gi(t);if(s)return""+s+t}if(this.region===tr)return this.apiHost+t;var r=pn+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}function no(i){var e;return!((e=i.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var H=J("[Surveys]"),ao="seenSurvey_",oo=i=>{try{var e=(t=>((s,r)=>""+ao+function(n){return n.current_iteration&&n.current_iteration>0?n.id+"_"+n.current_iteration:n.id}(r))(0,t))(i);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){H.error("Failed to persist survey seen state",t)}},au=[ss.Popover,ss.Widget,ss.API],ou={ignoreConditions:!1,ignoreDelay:!1,displayType:Ks.Popover}
1,lu=J("[PostHog ExternalIntegrations]"),uu={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class cu{constructor(e){this._instance=e}rr(e,t){var s;(s=$.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,e,r=>{if(r)return lu.error("failed to load script",r);t()})}startIfEnabledOrStop(){var e=this,t=function(){var n,a,o,l=s[0],u=s[1];!u||(n=$.__PosthogExtensions__)!=null&&(n=n.integrations)!=null&&n[l]||e.rr(uu[l],()=>{var c;(c=$.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[l])==null||c.start(e._instance)}),!u&&(a=$.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[l]&&((o=$.__PosthogExtensions__)==null||(o=o.integrations)==null||(o=o[l])==null||o.stop())};for(var s of Object.entries((r=this._instance.config.integrations)!==null&&r!==void 0?r:{})){var r;t()}}}var Vt={},ls=0,Di=()=>{},vn='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Mt="Surveys module not available",gn="sanitize_properties is deprecated. Use before_send instead",lo="Invalid value for property_denylist config: ",gt="posthog",uo=!Yl&&me?.indexOf("MSIE")===-1&&me?.indexOf("Mozilla")===-1,us=i=>{var e;return _({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:pl(P?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Di,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:i??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:ie&&U(ie?.search)&&ie.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_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(g==null||(e=g.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,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(t){w.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:Gs,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:er},error_tracking:{},_onCapture:Di},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Sl,ignore_text_selection:!0}
1:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t)}))(i))},hu=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],fn=i=>{var e={};for(var t of hu){var s=t[0],r=t[1];x(i[s])||(e[r]=i[s])}var n=W({},e,i),a=i.__preview_external_dependency_versioned_paths;return x(a)||(x(i.strict_script_versioning)&&(n.strict_script_versioning=!!a),U(a)&&x(i.asset_host)&&(n.asset_host=a)),A(i.property_blacklist)&&(x(i.property_denylist)?n.property_denylist=i.property_blacklist:A(i.property_denylist)?n.property_denylist=[...i.property_blacklist,...i.property_denylist]:w.error(lo+i.property_denylist)),n};class du{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){w.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class ke{Ji(e,t){if(e){var s=this.Ki.indexOf(e);s!==-1&&this.Ki.splice(s,1)}return this.Ki.push(t),t.initialize==null||t.initialize(),t}Yi(){return this.config.cookieless_mode===qe||this.config.cookieless_mode===st&&this.consent.isRejected()}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(){var e;this.webPerformance=new du,this.Xi=!1,this.version=X.LIB_VERSION,this.tn=new br,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=us(),this.SentryIntegration=Ol,this.sentryIntegration=s=>function(r,n){var a=Aa(r,n);return{name:Oa,processEvent:o=>a(o)}}(this,s),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.en=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new iu(this),this.pageViewManager=new en(this),this.rateLimiter=new Bl(this),this.requestRouter=new nu(this),this.consent=new bl(this),this.externalIntegrations=new cu(this);var t=(e=ke.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(s,r,n)=>{var a=U(s)?{[s]:r}:s;this.setPersonProperties(a),n?.({})},set_once:(s,r,n)=>{var a=U(s)?{[s]:r}:s;this.setPersonProperties(void 0,a),n?.({})}},this.on("eventCaptured",s=>w.info('send "'+s?.event+'"',s))}init(e,t,s){if(s&&s!==gt){var r,n=(r=Vt[s])!==null&&r!==void 0?r:new ke;return n._init(e,t,s),Vt[s]=n,Vt[gt][s]=n,n}return this._init(e,t,s)}_init(e,t,s){var r,n;t===void 0&&(t={});var a=U(e)?e.trim():"";if(!a)return w.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=us(t.defaults),t.debug=this.an(t.debug),this.ln=t,this.un=[],t.person_profiles?this.nn=t.person_profiles:t.process_person&&(this.nn=t.process_person);var o=us(t.defaults),l=fn(t),u=W({},o,l,{name:s,token:a});K(o.rageclick)&&K(l.rageclick)&&(u.rageclick=W({},o.rageclick,l.rageclick)),K(o.session_recording)&&K(l.session_recording)&&(u.session_recording=W({},o.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&w.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:de.GZipJS;var c=this.hn();this.persistence=new is(this.config,c),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new is(_({},this.config,{persistence:"sessionStorage"}),c,!1);var h=_({},this.persistence.props),d=_({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.dn=new Xl(E=>this.cn(E),this.config.request_queue_config),this.vn=new tu(this),this.__request_queue=[];var v=this.Yi();if(v||(this.sessionManager=new hn(this),this.sessionPropsManager=new cn(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(w.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.fn(v)},0)):(w.info("Initializing extensions synchronously"),this.fn(v)),X.DEBUG=X.DEBUG||this.config.debug,X.DEBUG&&w.info("Starting in debug mode",{this:this,config:t,thisC:_({},this.config),p:h,s:d}),!this.config.identity_distinct_id||(r=t.bootstrap)!=null&&r.distinctID||(t.bootstrap=_({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((n=t.bootstrap)==null?void 0:n.distinctID)!==void 0){var p=t.bootstrap.distinctID,f=this.get_distinct_id(),y=this.persistence.get_property(Pe);if(t.bootstrap.isIdentifiedID&&f!=null&&f!==p&&y===lt)this.identify(p);else if(t.bootstrap.isIdentifiedID&&f!=null&&f!==p&&y===ut)w.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var m=this.config.get_device_id(je()),S=t.bootstrap.isIdentifiedID?m:p;this.persistence.set_property(Pe,t.bootstrap.isIdentifiedID?ut:lt),this.register({distinct_id:p,$device_id:S})}}if(v)this.register_once({distinct_id:si,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(je());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(Pe,lt)}return ee(g,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(E,F){var D=E.config.segment;if(!D)return F();(function(L,b){var T=L.config.segment;if(!T)return b();var I=R=>{var N=()=>R.anonymousId()||je();L.config.get_device_id=N,R.id()&&(L.register({distinct_id:R.id(),$device_id:N()}),L.persistence.set_property(Pe,ut)),b()},C=T.user();"then"in C&&Te(C.then)?C.then(I):I(C)})(E,()=>{D.register((L=>{typeof Promise<"u"&&Promise.resolve||es.warn("This browser does not have Promise support, and can not use the segment integration");var b=(T,I)=>{if(!I)return T;T.event.userId||T.event.anonymousId===L.get_distinct_id()||(es.info("No userId set, resetting PostHog"),L.reset()),T.event.userId&&T.event.userId!==L.get_distinct_id()&&(es.info("UserId set, identifying with PostHog"),L.identify(T.event.userId)
1);var C=L.calculateEventProperties(I,T.event.properties);return T.event.properties=Object.assign({},C,T.event.properties),T};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:T=>b(T,T.event.event),page:T=>b(T,vt),identify:T=>b(T,Qi),screen:T=>b(T,"$screen")}})(E)).then(()=>{F()})})}(this,()=>this.pn()):this.pn(),Te(this.config._onCapture)&&this.config._onCapture!==Di&&(w.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",E=>this.config._onCapture(E.event,E))),this.config.ip&&w.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return io.apply(this,arguments)}().then(E=>{E&&this.register({[Yi]:E})}).catch(Di),this}fn(e){var t,s,r,n,a,o,l,u,c=performance.now(),h=_({},ke.__defaultExtensionClasses,this.config.__extensionClasses),d=[];h.featureFlags&&this.Ki.push(this.featureFlags=(t=this.featureFlags)!==null&&t!==void 0?t:new h.featureFlags(this)),h.exceptions&&this.Ki.push(this.exceptions=(s=this.exceptions)!==null&&s!==void 0?s:new h.exceptions(this)),h.historyAutocapture&&this.Ki.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Ki.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.Ki.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!e&&this.Ki.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||d.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),h.autocapture&&this.Ki.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.Ki.push(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new h.surveys(this)),h.logs&&this.Ki.push(this.logs=(n=this.logs)!==null&&n!==void 0?n:new h.logs(this)),h.metrics&&this.Ki.push(this.metrics=(a=this.metrics)!==null&&a!==void 0?a:new h.metrics(this)),h.conversations&&this.Ki.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new h.conversations(this)),h.productTours&&this.Ki.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Ki.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Ki.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Ki.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Ki.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,Ml)),h.toolbar&&this.Ki.push(this.toolbar=(l=this.toolbar)!==null&&l!==void 0?l:new h.toolbar(this)),h.experiments&&this.Ki.push(this.experiments=(u=this.experiments)!==null&&u!==void 0?u:new h.experiments(this)),this.Ki.forEach(v=>{v.initialize&&d.push(()=>{v.initialize==null||v.initialize()})}),d.push(()=>{if(this.gn){var v=this.gn;this.gn=void 0,this.Ur(v)}}),this.mn(d,c)}mn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.mn(e,t)},0);var s=e.shift();if(s)try{s()}catch(n){w.error("Error initializing extension:",n)}}var r=Math.round(performance.now()-t);this.register_for_session({[_a]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[ma]:r}),this.config.__preview_deferred_init_extensions&&w.info("PostHog extensions initialized ("+r+"ms)")}Ur(e){var t;if(!P||!P.body)return w.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ur(e)},500);this.config.__preview_deferred_init_extensions&&(this.gn=e);var s=e.ok?e.config:{supportedCompression:[],toolbarParams:{},toolbarVersion:"toolbar",isAuthenticated:!1,siteApps:[]};this.yn=s,this.compression=void 0,s.supportedCompression&&!this.config.disable_compression&&(this.compression=M(s.supportedCompression,de.GZipJS)?de.GZipJS:M(s.supportedCompression,de.Base64)?de.Base64:void 0),(t=s.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint),this.set_config({person_profiles:this.nn?this.nn:Gs}),this.Ki.forEach(r=>{!e.ok&&r.onRemoteConfigFailed?r.onRemoteConfigFailed():r.onRemoteConfig==null||r.onRemoteConfig(s)})}pn(){try{this.config.loaded(this)}catch(s){w.critical("`loaded` function failed",s)}if(this.bn(),this.config.internal_or_test_user_hostname&&ie!=null&&ie.hostname){var e=ie.hostname,t=this.config.internal_or_test_user_hostname;(typeof t=="string"?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()},1),this.wn=new Ga(this),this.wn.load()}bn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.dn)==null||e.enable())}
1_dom_loaded(){this.is_capturing()&&ri(this.__request_queue,e=>this.cn(e)),this.__request_queue=[],this.bn()}_handle_unload(){var e,t,s,r,n;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(t=this.metrics)==null||t.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture(Ji),(s=this.logs)==null||s.flushLogs("sendBeacon"),(r=this.dn)==null||r.unload(),(n=this.vn)==null||n.unload()):this.xn()&&this.capture(Ji,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?uo?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=_({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(x(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var s,r,n,a=_({},t);a.timeout=a.timeout||6e4;var o=(s=a.transport)!==null&&s!==void 0?s:"fetch";o==="sendBeacon"&&x(a.compression)&&a.data&&(a.compression=de.Base64),a.url=un(a.url,a.compression);var l=gi.filter(c=>!a.disableTransport||!c.transport||!a.disableTransport.includes(c.transport)),u=(r=(n=function(c,h){for(var d=0;c.length>d;d++)if(c[d].transport===o)return c[d]}(l))==null?void 0:n.method)!==null&&r!==void 0?r:l[0].method;if(!u)throw new Error("No available transport method");o!=="sendBeacon"&&a.data&&a.compression===de.GZipJS&&fo&&typeof Promise<"u"&&!vi?Jl(a).then(c=>{u(c)}).catch(c=>{if(Mr(c))return vi=!0,void u(_({},a,{compression:void 0,url:un(t.url,void 0)}));(h=>{if(!h||typeof h!="object")return!1;var d="name"in h?String(h.name):"";return Mr(h)||d===Cn})(c)&&(vi=!0),u(a)}):u(a)})(_({},e,{callback:t=>{var s,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(s=(r=this.config).on_request_error)==null||s.call(r,t),e.callback==null||e.callback(t)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}
1cn(e){this.vn?this.vn.retriableRequest(e):this._send_request(e)}_execute_array(e){ls++;try{var t,s=[],r=[],n=[];ri(e,o=>{if(o)if(A(t=o[0]))n.push(o);else if(Te(o))try{o.call(this)}catch(l){w.error("Error executing queued PostHog call",o,l)}else A(o)&&t==="alias"?s.push(o):A(o)&&t.indexOf("capture")!==-1&&Te(this[t])?n.push(o):r.push(o)});var a=function(o,l){ri(o,function(u){try{if(A(u[0])){var c=l;G(u,function(h){c=c[h[0]].apply(c,h.slice(1))})}else l[u[0]].apply(l,u.slice(1))}catch(h){w.error("Error executing queued PostHog call",u,h)}})};a(s,this),a(r,this),a(n,this)}finally{ls--}}push(e){if(ls>0&&A(e)&&U(e[0])){var t=ke.prototype[e[0]];Te(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,s){var r,n,a,o,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!x(e)&&U(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var c=s!=null&&s.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){t!=null&&t.$current_url&&!U(t?.$current_url)&&(w.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),e!=="$exception"||s!=null&&s.kn||w.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,d=s?.timestamp||h,v=Nr(s?.uuid,je),p={uuid:v,event:e,properties:this.calculateEventProperties(e,t||{},d,v)};e===vt&&this.config.__preview_capture_bot_pageviews&&u&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),c&&(p.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens),s?.$set&&(p.$set=s?.$set);var f=s?.$unset;f&&(p.$unset=f);var y,m,S,k=this.Sn(s?.$set_once,e!==Br,e===Qi);if(k&&(p.$set_once=k),s!=null&&s._noTruncate||(n=this.config.properties_string_max_length,a=p,o=I=>U(I)?I.slice(0,n):I,l=new Set,p=function I(C,R){if(C!==Object(C))return o?o(C):C;if(!l.has(C)){var N;if(l.add(C),A(C))N=[],ri(C,B=>{N.push(I(B))});else{var V={};G(C,(B,j)=>{l.has(B)||(V[j]=I(B))}),N=V}return N}}(a)),p.timestamp=d,x(s?.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=h),e===He.DISMISSED||e===He.SENT){var E=t?.[rs.SURVEY_ID],F=t?.[rs.SURVEY_ITERATION];oo({id:E,current_iteration:F}),p.$set=_({},p.$set,{[(y={id:E,current_iteration:F},m=e===He.SENT?"responded":"dismissed",S="$survey_"+m+"/"+y.id,y.current_iteration&&y.current_iteration>0&&(S="$survey_"+m+"/"+y.id+"/"+y.current_iteration),S)]:!0})}else e===He.SHOWN&&(p.$set=_({},p.$set,{[rs.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===Ul.SHOWN){var D=t?.[sn.TOUR_TYPE];D&&(p.$set=_({},p.$set,{[sn.TOUR_LAST_SEEN_DATE+"/"+D]:new Date().toISOString()}))}var L=_({},p.properties.$set,p.$set);if(Ge(L)||this.setPersonPropertiesForFlags(L),!O(this.config.before_send)){var b=this.Rt(p);if(!b)return;(p=b).uuid=Nr(p.uuid,je)}this.tn.emit("eventCaptured",p);var T={method:"POST",url:(r=s?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:p,compression:"best-available",batchKey:s?._batchKey,transport:s?.transport};return!this.config.request_batching||s&&(s==null||!s._batchKey)||s!=null&&s.send_instantly?this.cn(T):this.dn.enqueue(T),p}w.critical("This capture call is ignored due to client rate limiting.")}}else w.error("No event name provided to posthog.capture")}else w.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,s,r,n){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return t;var a=n?void 0:this.persistence.remove_event_timer(e),o=_({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.Yi()&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=_({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!U(o.distinct_id)&&!ue(o.distinct_id)||xs(o.distinct_id))&&w.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var u,c=function(m,S,k,E){var F,D,L,b;if(E===void 0&&(E=!1),!me)return{};var T,I,C,R,N,V,B,j,q,re=m?[...kt,...S||[]]:[],he=function(Q){for(var ne=0;Lr.length>ne;ne++){var ae=Lr[ne],Fe=ae[1],Ke=ae[0].exec(Q),_e=Ke&&(Te(Fe)?Fe(Ke,Q):Fe);
1if(_e)return _e}return["",""]}(me),ge=(T=typeof navigator<"u"?navigator:void 0)!=null&&T.brave?{brave:!0}:{},fe={detectGoogleSearchApp:k},be=W(pr({$os:he[0],$os_version:he[1],$browser:ia(me,navigator.vendor,ge,fe),$device:Dr(me),$device_type:(C=me,R={userAgentDataPlatform:(F=navigator)==null||(F=F.userAgentData)==null?void 0:F.platform,maxTouchPoints:(D=navigator)==null?void 0:D.maxTouchPoints,screenWidth:g==null||(L=g.screen)==null?void 0:L.width,screenHeight:g==null||(b=g.screen)==null?void 0:b.height,devicePixelRatio:g?.devicePixelRatio},q=Dr(C),q===Nn||q===Dn||q==="Kobo"||q==="Kindle Fire"||q===Qn?bt:q===Wt||q===yt||q===Kt||q===ks?"Console":q===qn?"Wearable":q?xe:R?.userAgentDataPlatform==="Android"&&((N=R?.maxTouchPoints)!==null&&N!==void 0?N:0)>0?600>Math.min((V=R?.screenWidth)!==null&&V!==void 0?V:0,(B=R?.screenHeight)!==null&&B!==void 0?B:0)/((j=R?.devicePixelRatio)!==null&&j!==void 0?j:1)?xe:bt:"Desktop"),$timezone:za(),$timezone_offset:jl()}),{$current_url:Zt(E?Ve(ie?.href):ie?.href,re,Xt),$host:ie?.host,$pathname:ie?.pathname,$raw_user_agent:me.length>1e3?me.substring(0,997)+"...":me,$browser_version:Ao(me,navigator.vendor,ge,fe),$browser_language:tn(),$browser_language_prefix:(I=tn(),typeof I=="string"?I.split("-")[0]:void 0),$screen_height:g?.screen.height,$screen_width:g?.screen.width,$viewport_height:g?.innerHe
1ight,$viewport_width:g?.innerWidth,$lib:X.LIB_NAME,$lib_version:X.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return X.SDK_DIST_CHANNEL&&(be.$sdk_dist_channel=X.SDK_DIST_CHANNEL),be}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var h=this.sessionManager.checkAndGetSessionAndWindowId(n,s.getTime()),d=h.windowId;o.$session_id=h.sessionId,o.$window_id=d}this.sessionPropsManager&&W(o,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&W(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(v=this.vn)==null?void 0:v.length}catch(m){o.$sdk_debug_error_capturing_properties=String(m)}if(this.requestRouter.region===tr&&(o.$lib_custom_api_host=this.config.api_host),u=e!==vt||n?e!==Ji||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,r),o=W(o,u),e===vt&&P&&(o.title=P.title),!x(a)){var p=s.getTime()-a;o.$duration=parseFloat((p/1e3).toFixed(3))}me&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=W({},c,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),A(this.config.property_denylist)?G(this.config.property_denylist,function(m){delete o[m]}):w.error(lo+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var f=this.config.sanitize_properties;f&&(w.error(gn),o=f(o,e));var y=this.Cn();return o.$process_person_profile=y,y&&!n&&this.In("_calculate_event_properties"),o}Sn(e,t,s){var r;if(t===void 0&&(t=!0),s===void 0&&(s=!1),!this.persistence||!this.Cn()||this.Xi&&!s)return e;var n=this.persistence.get_initial_props(),a=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),o=W({},n,a||{},e||{}),l=this.config.sanitize_properties;return l&&(w.error(gn),o=l(o,"$set_once")),t&&(this.Xi=!0),Ge(o)?void 0:o}register(e,t){var s;(s=this.persistence)==null||s.register(e,t)}register_once(e,t,s){var r;(r=this.persistence)==null||r.register_once(e,t,s)}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)}Tn(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var s;return(s=this.featureFlags)==null?void 0:s.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return(t=this.featureFlags)==null?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var s;return(s=this.featureFlags)==null?void 0:s.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,t){var s;return(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,t,s){var r;(r=this.featureFlags)==null||r.updateFlags(e,t,s)}updateEarlyAccessFeatureEnrollment(e,t,s){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,t,s)}getEarlyAccessFeatures(e,t,s){var r;return t===void 0&&(t=!1),(r=this.featureFlags)==null?void 0:r.getEarlyAccessFeatures(e,t,s)}on(e,t){return this.tn.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Mt}),()=>{})}onSessionId(e){var t,s;return(t=(s=this.sessionManager)==null?void 0:s.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Mt})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Mt})}renderSurvey(e,t){var s;(s=this.surveys)==null||s.renderSurvey(e,t)}displaySurvey(e,t){var s;
1t===void 0&&(t=ou),(s=this.surveys)==null||s.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,s;return(t=(s=this.surveys)==null?void 0:s.canRenderSurvey(e))!==null&&t!==void 0?t:{visible:!1,disabledReason:Mt}}canRenderSurveyAsync(e,t){var s,r;return t===void 0&&(t=!1),(s=(r=this.surveys)==null?void 0:r.canRenderSurveyAsync(e,t))!==null&&s!==void 0?s:Promise.resolve({visible:!1,disabledReason:Mt})}Mn(e){return!e||xs(e)?(w.critical("Unique user id has not been set in posthog.identify"),!1):e===si?(w.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(w.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.'),!1)}identify(e,t,s){if(!this.__loaded||!this.persistence)return w.uninitializedWarning("posthog.identify");if(ue(e)&&(e=e.toString(),w.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Mn(e)&&this.In("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Si)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(Dt)&&(this.unregister(Dt),this.register({distinct_id:e}));var n,a=(this.persistence.get_property(Pe)||lt)===lt;e!==r&&a?(this.persistence.set_property(Pe,ut),this.setPersonPropertiesForFlags({$set:t||{},$set_once:s||{}},!1),this.capture(Qi,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:s||{}}),this.sn=dn(e,t,s),(n=this.featureFlags)==null||n.setAnonymousDistinctId(r)):(t||s)&&this.setPersonProperties(t,s),e!==r&&(this.reloadFeatureFlags(),this.unregister(Bt))}}setPersonProperties(e,t){if((e||t)&&this.In("posthog.setPersonProperties")){var s=dn(this.get_distinct_id(),e,t);this.sn!==s?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.sn=s):w.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,s=(A(e)?e:[e]).filter(r=>U(r)&&r.length>0);s.length!==0&&this.In("posthog.unsetPersonProperties")&&((t=this.featureFlags)==null||t.unsetPersonPropertiesForFlags(s,!0),this.capture("$set",{$unset:s}),this.sn=null)}group(e,t,s){if(e&&t){var r=this.getGroups(),n=r[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:_({},r,{[e]:t})}),n||s){var a={$group_type:e,$group_key:t};s&&(a.$group_set=s),this.capture(Br,a)}s&&this.setGroupPropertiesForFlags({[e]:s}),n&&!s&&this.reloadFeatureFlags()}else w.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var s;t===void 0&&(t=!0),(s=this.featureFlags)==null||s.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;e===void 0&&(e=!0),(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var s;t===void 0&&(t=!0),this.In("posthog.setGroupPropertiesForFlags")&&((s=this.featureFlags)==null||s.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t,s,r,n,a,o,l,u,c,h;if(w.info("reset"),!this.__loaded)return w.uninitializedWarning("posthog.reset");var d,v=this.get_property(Si),p=this.get_property(Yi),f=this.get_property(nt);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(s=this.sessionPersistence)==null||s.clear(),x(f)||(d=this.persistence)==null||d.register({[nt]:f}),(r=this.surveys)==null||r.reset(),(n=this.wn)==null||n.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.conversations)==null||o.reset(),(l=this.logs)==null||l.reset(),(u=this.metrics)==null||u.reset(),(c=this.persistence)==null||c.set_property(Pe,lt),(h=this.sessionManager)==null||h.resetSessionId(),this.sn=null,this.config.cookieless_mode===qe)this.register_once({distinct_id:si,$device_id:null},"");else{var y=this.config.get_device_id(je());this.register_once({distinct_id:y,$device_id:e?y:v},""),e||x(p)||this.register({[Yi]:p})}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var t=this;return te(function*(){var s,r,n,a,o;t.__loaded?((s=t.logs)==null||s.flushLogs("sendBeacon"),(r=t.metrics)==null||r.flush("sendBeacon"),(n=t.dn)==null||n.unload(),(a=t.vn)==null||a.unload(),(o=t.featureFlags)==null||o.destroy()):w.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var s;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(s=this.conversations)==null||s.En()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.Rn()}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 t=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=t.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(e!=null&&e.withTimestamp&&s){var n,a=(n=e.timestampLookBack)!==null&&n!==void 0?n:10;if(!s)return r;
1r+="?t="+Math.max(Math.floor((new Date().getTime()-s)/1e3)-a,0)}return r}alias(e,t){return e===this.get_property(ca)?(w.critical("Attempting to create alias for existing People user - aborting."),-2):this.In("posthog.alias")?(x(t)&&(t=this.get_distinct_id()),e!==t?(this.Tn(Dt,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(w.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=_({},this.config);if(K(e)){var s,r,n,a,o,l,u,c,h,d,v;W(this.config,fn(e));var p=this.hn();(s=this.persistence)==null||s.update_config(this.config,t,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new is(_({},this.config,{persistence:"sessionStorage"}),p,!1);var f=this.an(this.config.debug);Ce(f)&&(this.config.debug=f),Ce(this.config.debug)&&(this.config.debug?(X.DEBUG=!0,z.N()&&z.q("ph_debug",!0),w.info("set_config",{config:e,oldConfig:t,newConfig:_({},this.config)})):(X.DEBUG=!1,z.N()&&z.P("ph_debug"))),(r=this.exceptionObserver)==null||r.onConfigChange(),(n=this.exceptions)==null||n.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.tracingHeaders)==null||o.startIfEnabledOrStop(),(l=this.autocapture)==null||l.startIfEnabled(),(u=this.heatmaps)==null||u.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(h=this.deadClicksAutocapture)==null||h.startIfEnabledOrStop(),(d=this.surveys)==null||d.loadIfEnabled(),this.Pn(),(v=this.externalIntegrations)==null||v.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){X.LIB_NAME=e,X.LIB_VERSION=t}startSessionRecording(e){var t,s,r,n,a,o=e===!0,l={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(l).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),l.sampling&&((s=this.sessionRecording)==null||s.overrideSampling()),l.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),l.url_trigger&&((n=this.sessionRecording)==null||n.overrideTrigger("url")),l.event_trigger&&((a=this.sessionRecording)==null||a.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){if(this.exceptions){var s=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:s});return this.exceptions.sendExceptionEvent(_({},r,t))}}addExceptionStep(e,t){var s;(s=this.exceptions)==null||s.addExceptionStep(e,t)}captureLog(e){var t;(t=this.logs)==null||t.captureLog(e)}get logger(){var e,t;return(e=(t=this.logs)==null?void 0:t.logger)!==null&&e!==void 0?e:ke.On}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,s;return(t=(s=this.toolbar)==null?void 0:s.loadToolbar(e))!==null&&t!==void 0&&t}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:gt;return t!==gt&&(t=gt+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(Pe))===ut||((t=this.sessionPersistence)==null?void 0:t.get_property(Pe))===ut}Cn(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles===Gs&&!this._isIdentified()&&Ge(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Dt])&&((t=this.persistence)==null||(t=t.props)==null||!t[Fi]))}xn(){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.Cn()||this.In("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.In("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}In(e){return this.config.person_profiles==="never"?(w.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Tn(Fi,!0),!0)}hn(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==st)}Pn(){var e,t,s,r,n=this.hn();return((e=this.persistence)==null?void 0:e._r)!==n&&((s=this.persistence)==null||s.set_disabled(n)),((t=this.sessionPersistence)==null?void 0:t._r)!==n&&((r=this.sessionPersistence)==null||r.set_disabled(n)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==qe){if(this.Yi()){var s,r,n,a,o;this.reset(!0),(s=this.sessionManager)==null||s.destroy(),(r=this.pageViewM
1anager)==null||r.destroy(),this.sessionManager=new hn(this),this.pageViewManager=new en(this),this.persistence&&(this.sessionPropsManager=new cn(this,this.sessionManager,this.persistence));var l,u=(n=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&n!==void 0?n:(o=ke.__defaultExtensionClasses)==null?void 0:o.sessionRecording;u&&(this.sessionRecording=this.Ji(this.sessionRecording,new u(this)),this.yn&&((l=this.sessionRecording)==null||l.onRemoteConfig==null||l.onRemoteConfig(this.yn)))}var c,h;this.consent.optInOut(!0),this.Pn(),this.bn(),(t=this.sessionRecording)==null||t.startIfEnabledOrStop(),this.config.cookieless_mode==st&&((c=this.surveys)==null||c.loadIfEnabled()),(x(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((h=e?.captureEventName)!==null&&h!==void 0?h:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else w.warn(vn)}opt_out_capturing(){var e,t,s;this.config.cookieless_mode!==qe?(this.config.cookieless_mode===st&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===st&&(this.register({distinct_id:si,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(t=this.sessionManager)==null||t.destroy(),(s=this.pageViewManager)==null||s.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._n(),this.bn())):w.warn(vn)}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===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===qe||(this.config.cookieless_mode===st?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return pe?to(pe,this.config.custom_blocked_useragents):void 0}_n(){P&&(P.visibilityState==="visible"?this.en||(this.en=!0,this.capture(vt,{title:P.title},{send_instantly:!0}),this.rn&&(P.removeEventListener(Ii,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),ee(P,Ii,this.rn)))}debug(e){e===!1?(g?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(g?.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}))}Vr(){var e,t,s,r,n,a,o=this.ln||{};return"advanced_disable_flags"in o?!!o.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(w.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):(s="advanced_disable_decide",r=w,n=(t="advanced_disable_flags")in(e=o)&&!O(e[t]),a=s in e&&!O(e[s]),n?e[t]:!!a&&(r&&r.warn("Config field '"+s+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[s]))}Rt(e){var t;if(O(this.config.before_send))return e;var s=Object.keys((t=e.properties)!==null&&t!==void 0?t:{}).filter(Eo),r=A(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var a of r){if(n=a(n),O(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return xo(e.event)?w.warn(o+". This can cause unexpected behavior."):w.info(o),null}n.properties&&!Ge(n.properties)||w.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var l of s)if(n.properties&&O(n.properties[l]))return w.warn("Event '"+e.event+"' had its '"+l+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var e;return(e=this.pageViewManager.sr)==null?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,s){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(s)})}an(e){var t=Ce(e)&&!e,s=z.N()&&z.A("ph_debug")==="true";return!t&&(!!s||e)}}ke.__defaultExtensionClasses={},ke.On=(()=>{var i=()=>{};return{trace:i,debug:i,info:i,warn:i,error:i,fatal:i}})(),function(i,e){for(var t=0;e.length>t;t++)i.prototype[e[t]]=hl(i.prototype[e[t]])}(ke,["identify"]);class _n{constructor(e){this.disabled=e===!1;var t=K(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,s){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>s-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:s}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:s}];return!1}}var cs="$copy_autocapture",hs=J("[AutoCapture]");function ds(i,e){return e.length>i?e.slice(0,i)+"...":e}function pu(i){if(i.previousElementSibling)return i.previousElementSibling;var e=i;do e=e.previousSibling;while(e&&!We(e));return e}function vu(i,e){var t,s,r=e.e,n=e.maskAllElementAttributes,a=e.maskAllText,o=e.elementAttributeIgnoreList,l=e.elementsC
1hainAsString,u=e.disableCaptureUrlHashes;if(!We(i))return{props:{}};for(var c=[i],h=new Set([i]),d=i;d.parentNode&&!we(d,"body")&&Sa>c.length;)if(ka(d.parentNode)){var v=d.parentNode.host;if(h.has(v))break;h.add(v),c.push(v),d=v}else{if(!We(d.parentNode)||h.has(d.parentNode))break;h.add(d.parentNode),c.push(d.parentNode),d=d.parentNode}var p,f,y=[],m={},S=!1,k=!1;if(G(c,b=>{var T=Ws(b);if(we(b,"a")){var I=b.getAttribute("href");S=!!(T&&I&&zt(I))&&(u?Ve(I):I)}M(Ci(b),"ph-no-capture")&&(k=!0),y.push(function(R,N,V,B,j){j===void 0&&(j=!1);var q=R.tagName.toLowerCase(),re={tag_name:q};gr.indexOf(q)>-1&&!V&&(re.$el_text=q.toLowerCase()==="a"||q.toLowerCase()==="button"?ds(1024,Qr(R)):ds(1024,Jt(R)));var he=Ci(R);he.length>0&&(re.classes=he.filter(function(Q){return Q!==""})),G(R.attributes,function(Q){var ne;if((!$a(R)||["name","id","class","aria-label"].indexOf(Q.name)!==-1)&&(B==null||!B.includes(Q.name))&&!N&&zt(Q.value)&&(!U(ne=Q.name)||ne.substring(0,10)!=="_ngcontent"&&ne.substring(0,7)!=="_nghost")){var ae=Q.value;Q.name==="class"&&(ae=vr(ae).join(" ")),re["attr__"+Q.name]=ds(1024,Q.name==="href"&&j?Ve(ae):ae)}});for(var ge=1,fe=1,be=R;be=pu(be);)ge++,be.tagName===R.tagName&&fe++;return re.nth_child=ge,re.nth_of_type=fe,re}(b,n,a,o,u));var C=function(R){if(!Ws(R))return{};var N={};return G(R.attributes,function(V){if(V.name&&V.name.indexOf("data-ph-capture-attribute")===0){var B=V.name.replace("data-ph-capture-attribute-",""),j=V.value;B&&j&&zt(j)&&(N[B]=j)}}),N}(b);W(m,C)}),k)return{props:{},explicitNoCapture:k};if(a||(y[0].$el_text=we(i,"a")||we(i,"button")?Qr(i):Jt(i)),S){var E,F;y[0].attr__href=S;var D=(E=Qt(S))==null?void 0:E.host,L=g==null||(F=g.location)==null?void 0:F.host;D&&L&&D!==L&&(p=S)}return{props:W({$event_type:r.type,$ce_version:1},l?{}:{$elements:y},{$elements_chain:(f=y,function(b){return b.map(T=>{var I,C,R="";if(T.tag_name&&(R+=T.tag_name),T.attr_class)for(var N of(T.attr_class.sort(),T.attr_class))R+="."+N.replace(/"/g,"");var V=_({},T.text?{text:T.text}:{},{"nth-child":(I=T.nth_child)!==null&&I!==void 0?I:0,"nth-of-type":(C=T.nth_of_type)!==null&&C!==void 0?C:0},T.href?{href:T.href}:{},T.attr_id?{attr_id:T.attr_id}:{},T.attributes),B={};return pi(V).sort((j,q)=>j[0].localeCompare(q[0])).forEach(j=>{var q=j[1];return B[Zr(j[0].toString())]=Zr(q.toString())}),(R+=":")+pi(B).map(j=>j[0]+'="'+j[1]+'"').join("")}).join(";")}(function(b){return b.map(T=>{var I,C,R={text:(I=T.$el_text)==null?void 0:I.slice(0,400),tag_name:T.tag_name,href:(C=T.attr__href)==null?void 0:C.slice(0,2048),attr_class:Rl(T),attr_id:T.attr__id,nth_child:T.nth_child,nth_of_type:T.nth_of_type,attributes:{}};return pi(T).filter(N=>N[0].indexOf("attr__")===0).forEach(N=>R.attributes[N[0]]=N[1]),R})}(f)))},(t=y[0])!=null&&t.$el_text?{$el_text:(s=y[0])==null?void 0:s.$el_text}:{},p&&r.type==="click"?{$external_click_url:p}:{},m)}}var Ot=J("[ExceptionAutocapture]"),mn=()=>{},gu=J("[TracingHeaders]"),Ze=J("[Web Vitals]"),yn=9e5,bn="disabled",wn="lazy_loading",At="awaiting_config",ui="missing_config";J("[SessionRecording]"),J("[SessionRecording]");var ir="[SessionRecording]",Oe=J(ir),fu=J("[Heatmaps]");function ps(i){return K(i)&&"clientX"in i&&"clientY"in i&&ue(i.clientX)&&ue(i.clientY)}var vs=J("[Product Tours]"),gs=i=>{var e;return!i.config.disable_product_tours&&!((e=i.persistence)==null||!e.get_property(cr))},_u=["$set_once","$set"],Ie=J("[SiteApps]"),xn="Error while initializing PostHog app with config id ";function dt(i,e,t){if(O(i))return!1;switch(t){case"exact":return i===e;case"contains":var s=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(s,"i").test(i);case"regex":try{return new RegExp(e).test(i)}catch{return!1}default:return!1}}class mu{constructor(e){this.Fn=new br,this.Ln=(t,s)=>this.An(t,s)&&this.$n(t,s)&&this.Nn(t,s)&&this.Dn(t,s),this.An=(t,s)=>s==null||!s.event||t?.event===s?.event,this._instance=e,this.qn=new Set,this.jn=new Set}init(){var e,t;x((e=this._instance)==null?void 0:e._addCaptureHook)||(t=this._instance)==null||t._addCaptureHook((s,r)=>{this.on(s,r)})}register(e){var t,s;if(!x((t=this._instance)==null?void 0:t._addCaptureHook)&&(e.forEach(a=>{var o,l;(o=this.jn)==null||o.add(a),(l=a.steps)==null||l.forEach(u=>{var c;(c=this.qn)==null||c.add(u?.event||"")})}),(s=this._instance)!=null&&s.autocapture)){var r,n=new Set;e.forEach(a=>{var o;(o=a.steps)==null||o.forEach(l=>{l!=null&&l.selector&&n.add(l?.selector)})}),(r=this._instance)==null||r.autocapture.setElementSelectors(n)}}on(e,t){var s;t!=null&&e.length!=0&&(this.qn.has(e)||this.qn.has(t.event))&&this.jn&&((s=this.jn)==null?void 0:s.size)>0&&this.jn.forEach(r=>
1{this.Hn(t,r)&&this.Fn.emit("actionCaptured",r.name)})}Bn(e){this.onAction("actionCaptured",t=>e(t))}Hn(e,t){if(t?.steps==null)return!1;for(var s of t.steps)if(this.Ln(e,s))return!0;return!1}onAction(e,t){return this.Fn.on(e,t)}$n(e,t){if(t!=null&&t.url){var s,r=e==null||(s=e.properties)==null?void 0:s.$current_url;if(!r||typeof r!="string"||!dt(r,t.url,t.url_matching||"contains"))return!1}return!0}Nn(e,t){return!!this.Un(e,t)&&!!this.zn(e,t)&&!!this.Vn(e,t)}Un(e,t){var s;if(t==null||!t.href)return!0;var r=this.Wn(e);if(r.length>0)return r.some(o=>dt(o.href,t.href,t.href_matching||"exact"));var n,a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";return!!a&&dt((n=a.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}zn(e,t){var s;if(t==null||!t.text)return!0;var r=this.Wn(e);if(r.length>0)return r.some(u=>dt(u.text,t.text,t.text_matching||"exact")||dt(u.$el_text,t.text,t.text_matching||"exact"));var n,a,o,l=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";return!!l&&(n=function(u){for(var c,h=[],d=/(?::|")text="(.*?)"/g;!O(c=d.exec(u));)h.includes(c[1])||h.push(c[1]);return h}(l),a=t.text,o=t.text_matching||"exact",n.some(u=>dt(u,a,o)))}Vn(e,t){var s,r;if(t==null||!t.selector)return!0;var n=e==null||(s=e.properties)==null?void 0:s.$element_selectors;if(n!=null&&n.includes(t.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}Wn(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}Dn(e,t){return t==null||!t.properties||t.properties.length===0||ro(t.properties.reduce((s,r)=>{var n=A(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return s[r.key]={values:n,operator:r.operator||"exact"},s},{}),e?.properties)}}class yu{constructor(e){this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map}Kn(e,t){return!!e&&ro(e.propertyFilters,t?.properties)}Yn(e,t){var s=new Map;return e.forEach(r=>{var n;(n=r.conditions)==null||(n=n[t])==null||(n=n.values)==null||n.forEach(a=>{if(a!=null&&a.name){var o=s.get(a.name)||[];o.push(r.id),s.set(a.name,o)}})}),s}Xn(e,t,s){var r=(s===Ft.Activation?this.Gn:this.Qn).get(e),n=[];return this.ts(a=>{n=a.filter(o=>r?.includes(o.id))}),n.filter(a=>{var o,l=(o=a.conditions)==null||(o=o[s])==null||(o=o.values)==null?void 0:o.find(u=>u.name===e);return this.Kn(l,t)})}register(e){var t;x((t=this._instance)==null?void 0:t._addCaptureHook)||(this.es(e),this.rs(e))}rs(e){var t=e.filter(s=>{var r,n;return((r=s.conditions)==null?void 0:r.actions)&&((n=s.conditions)==null||(n=n.actions)==null||(n=n.values)==null?void 0:n.length)>0});t.length!==0&&(this.ns==null&&(this.ns=new mu(this._instance),this.ns.init(),this.ns.Bn(s=>{this.onAction(s)})),t.forEach(s=>{var r,n,a,o,l;s.conditions&&(r=s.conditions)!=null&&r.actions&&(n=s.conditions)!=null&&(n=n.actions)!=null&&n.values&&((a=s.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((o=this.ns)==null||o.register(s.conditions.actions.values),(l=s.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(u=>{if(u&&u.name){var c=this.Jn.get(u.name);c&&c.push(s.id),this.Jn.set(u.name,c||[s.id])}}))}))}es(e){var t,s=e.filter(n=>{var a,o;return((a=n.conditions)==null?void 0:a.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0}),r=e.filter(n=>{var a,o;return((a=n.conditions)==null?void 0:a.cancelEvents)&&((o=n.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0});s.length===0&&r.length===0||((t=this._instance)==null||t._addCaptureHook((n,a)=>{this.onEvent(n,a)}),this.Gn=this.Yn(e,Ft.Activation),this.Qn=this.Yn(e,Ft.Cancellation))}onEvent(e,t){var s,r,n=this.ss(),a=(t==null||(s=t.properties)==null?void 0:s.$survey_id)||(t==null||(r=t.properties)==null?void 0:r.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var o=this.os(e,a);if(o==="consume")return n.info("event consumed activated item, removing it",{event:e,itemId:a}),void this.ls([a]);if(o==="persist")return n.info("shown item promoted to persisted activation",{event:e,itemId:a}),void this.us(a)}if(this.Qn.has(e)){var l=this.Xn(e,t,Ft.Cancellation);l.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:l.map(c=>c.id)}),this.ls(l.map(c=>c.id)),l.forEach(c=>this.hs(c.id)))}if(this.Gn.has(e)){n.info("event name matched",{event:e,eventPayload:t,items:this.Gn.get(e)});var u=this.Xn(e,t,Ft.Activation);this.ds(u.map(c=>c.id))}}onAction(e){this.Jn.has(e)&&this.ds(this.Jn.get(e)||[])}ds(e){e.length!==0&&(this.Zn=[...new Set([...this.Zn,...e])],this.ss().info("updating activated items",{activatedItems:this.getActivatedIds()}))}us(e){this.Zn=this.Zn.filter(s=>s!==e);var t=this.cs();t.includes(e)||this.vs([...t,e])}ls(e){var t=new Set(e);this.Zn=this.Zn.filter(n=>!t.has(n));var s=this.cs(),r=s.filter(n=>!t.has(n));r.length!==s.length&&this.vs(r)}cs(){var e,t=this.fs();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.cs(),...this.Zn])].filter(e=>!this.ps(e))}reset(){this.Zn=[],this.cs().length>0&&this.vs([])}
1getEventToItemsMap(){return this.Gn}gs(){return this.ns}}class bu extends yu{constructor(e){super(e)}fs(){return Ns}ys(){return He.SHOWN}ts(e){var t;(t=this._instance)==null||t.getSurveys(e)}hs(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}ss(){return H}vs(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[Ns]:e})}ps(){return!1}os(e,t){var s;this.ts(n=>{s=n.find(a=>a.id===t)});var r=!s||function(n){var a;return no(n)&&!((a=n.conditions)==null||(a=a.events)==null||!a.repeatedActivation)||n.schedule==="always"}(s);return r?e===He.SHOWN?"consume":"ignore":e===He.SHOWN?"persist":e===He.DISMISSED||e===He.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var fs="SDK is not enabled or survey functionality is not yet loaded",En="Disabled. Not loading surveys.",wu=g!=null&&g.location?Mi(g.location.hash,"__posthog")||Mi(location.hash,"state"):null,kn="_postHogToolbarParams",Sn=J("[Toolbar]"),se=J("[FeatureFlags]"),Xe=J("[FeatureFlags]",{debugEnabled:!0}),_s=`" failed. Feature flags didn't load in time.`,Pn=i=>{for(var e={},t=0;i.length>t;t++)e[i[t]]=!0;return e},Tn=i=>{var e={};for(var t of pi(i||{})){var s=t[1];s&&(e[t[0]]=s)}return e},Ae=J("[Error tracking]"),Fn="Refusing to render web experiment since the viewer is a likely bot",xu={icontains:(i,e)=>e.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>e.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>Li(e,i),not_regex:(i,e)=>!Li(e,i),exact:(i,e)=>e===i,is_not:(i,e)=>e!==i};class ce{get Te(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(s){s===void 0&&(s=!1),t.getWebExperiments(r=>{ce.bs("retrieved web experiments from the server"),t._s=new Map,r.forEach(n=>{if(n.feature_flag_key){var a;t._s&&(ce.bs("setting flag key ",n.feature_flag_key," to web experiment ",n),(a=t._s)==null||a.set(n.feature_flag_key,n));var o=t._instance.getFeatureFlag(n.feature_flag_key);U(o)&&n.variants[o]&&t.ws(n.name,o,n.variants[o].transforms)}else if(n.variants)for(var l in n.variants){var u=n.variants[l];ce.xs(u,t._instance)&&t.ws(n.name,l,u.transforms)}})},s)},this._instance=e,this._instance.onFeatureFlags(s=>{this.onFeatureFlags(s)})}initialize(){}onFeatureFlags(e){if(this._is_bot())ce.bs(Fn);else if(!this.Te.disable_web_experiments){if(O(this._s))return this._s=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ce.bs("applying feature flags",e),e.forEach(t=>{var s;if(this._s&&(s=this._s)!=null&&s.has(t)){var r,n=this._instance.getFeatureFlag(t),a=(r=this._s)==null?void 0:r.get(t);n&&a!=null&&a.variants[n]&&this.ws(a.name,n,a.variants[n].transforms)}})}}previewWebExperiment(){var e=ce.getWindowLocation();if(e!=null&&e.search){var t=Et(e?.search,"__experiment_id"),s=Et(e?.search,"__experiment_variant");t&&s&&(ce.bs("previewing web experiments "+t+" && "+s),this.getWebExperiments(r=>{this.ks(parseInt(t),s,r)},!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,s){if(this.Te.disable_web_experiments&&!s)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Te.token),method:"GET",callback:n=>e(n.statusCode===200&&n.json&&n.json.experiments||[])})}ks(e,t,s){var r=s.filter(n=>n.id===e);r&&r.length>0&&(ce.bs("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.ws(r[0].name,t,r[0].variants[t].transforms))}static xs(e,t){return!O(e.conditions)&&ce.Ss(e,t)&&ce.Cs(e)}static Ss(e,t){var s;if(O(e.conditions)||O((s=e.conditions)==null?void 0:s.url))return!0;var r=ce.getWindowLocation();if(r){var n,a,o,l=xa(t,r.href);return(n=e.conditions)==null||!n.url||xu[(a=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,l)}return!1}
1static getWindowLocation(){return g?.location}static Cs(e){var t;if(O(e.conditions)||O((t=e.conditions)==null?void 0:t.utm))return!0;var s=Na();if(s.utm_source){var r,n,a,o,l,u,c,h,d=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((n=e.conditions)==null||(n=n.utm)==null?void 0:n.utm_campaign)==s.utm_campaign,v=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==s.utm_source,p=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==s.utm_medium,f=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==s.utm_term;return d&&p&&f&&v}return!1}static bs(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;t>r;r++)s[r-1]=arguments[r];w.info("[WebExperiments] "+e,s)}ws(e,t,s){this._is_bot()?ce.bs(Fn):t!=="control"?s.forEach(r=>{if(r.selector){var n;ce.bs("applying transform of variant "+t+" for experiment "+e+" ",r);var a=(n=document)==null?void 0:n.querySelectorAll(r.selector);a?.forEach(o=>{var l=o;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)})}}):ce.bs("Control variants leave the page unmodified.")}_is_bot(){return pe&&this._instance?to(pe,this.Te.custom_blocked_useragents):void 0}}var Ee=J("[Conversations]"),et="Conversations not available yet.",In="console",qi={featureFlags:class{constructor(i){this.Is=!1,this.Ts=!1,this.Ms=!1,this.Es=!1,this.Rs=!1,this.Ps=!1,this.Os=!1,this.Fs=!1,this.Ls=0,this.As=()=>{var e=this.$s();this.Ls=0,e&&this.reloadFeatureFlags()},this._instance=i,this.featureFlagEventHandlers=[],g&&ee(g,"online",this.As)}destroy(){g?.removeEventListener("online",this.As)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}Ns(i){return this._instance.get_property(i)}Ds(){var i,e;return(i=(e=this.mi)==null?void 0:e.kr(this.Te.feature_flag_cache_ttl_ms))!==null&&i!==void 0&&i}qs(){return!!this.Ds()&&(this.Fs||this.Ms||(this.Fs=!0,se.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}js(){var i,e=(i=this.Te.evaluation_contexts)!==null&&i!==void 0?i:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.Os||(se.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Os=!0),e!=null&&e.length?e.filter(t=>{var s=t&&typeof t=="string"&&t.trim().length>0;return s||se.error("Invalid evaluation context found:",t,"Expected non-empty string"),s}):[]}Hs(){return this.js().length>0}Bs(){var i=this.Te.flag_keys;if(!x(i)){if(A(i))return i.filter(e=>{var t=e&&typeof e=="string"&&e.trim().length>0;return t||se.error("Invalid flag key found:",e,"Expected non-empty string"),t});se.error("Invalid flag_keys found:",i,"Expected array of non-empty strings")}}initialize(){var i,e,t=this._instance.config,s=(i=(e=t.bootstrap)==null?void 0:e.featureFlags)!==null&&i!==void 0?i:{};if(Object.keys(s).length){var r,n,a=(r=(n=t.bootstrap)==null?void 0:n.featureFlagPayloads)!==null&&r!==void 0?r:{},o=Object.keys(s).filter(u=>!!s[u]).reduce((u,c)=>(u[c]=s[c]||!1,u),{}),l=Object.keys(a).filter(u=>o[u]).reduce((u,c)=>(a[c]&&(u[c]=a[c]),u),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(i,e,t){var s,r,n=t!=null&&t.merge&&(s=this.Ns(rt))!==null&&s!==void 0?s:{},a=t!=null&&t.merge&&(r=this.Ns(di))!==null&&r!==void 0?r:{},o=_({},n,i),l=_({},a,e),u={};for(var c of Object.entries(o)){var h=c[0],d=c[1];u[h]={key:h,enabled:Ir(d),variant:$r(d),reason:void 0,metadata:x(l?.[h])?void 0:{id:0,version:void 0,description:void 0,payload:l[h]}}}this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.Ts}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var i=this.Ns(As),e=this.Ns(De),t=this.Ns(pt);if(!t&&!e)return i||{};var s=W({},i||{}),r=[...new Set([...Object.keys(t||{}),...Object.keys(e||{})])];for(var n of r){var a,o,l=s[n],u=e?.[n],c=x(u)?(a=l?.enabled)!==null&&a!==void 0&&a:!!u,h=x(u)?l.variant:typeof u=="string"?u:void 0,d=t?.[n],v=_({},l,{enabled:c,variant:c?h??l?.variant:void 0});c!==l?.enabled&&(v.original_enabled=l?.enabled),h!==l?.variant&&(v.original_variant=l?.variant),d&&(v.metadata=_({},l?.metadata,{payload:d,original_payload:l==null||(o=l.metadata)==null?void 0:o.payload})),s[n]=v}
1return this.Is||(se.warn(" Overriding feature flag details!",{flagDetails:i,overriddenPayloads:t,finalDetails:s}),this.Is=!0),s}getAllFeatureFlags(){var i=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(i).map(t=>{var s=i[t];return{key:t,enabled:Ir(s),variant:$r(s),payload:Fr(e[t])}})}getFlagVariants(){var i=this.Ns(rt),e=this.Ns(De);if(!e)return i||{};for(var t=W({},i),s=Object.keys(e),r=0;s.length>r;r++)t[s[r]]=e[s[r]];return this.Is||(se.warn(" Overriding feature flags!",{enabledFlags:i,overriddenFlags:e,finalFlags:t}),this.Is=!0),t}getFlagPayloads(){var i=this.Ns(di),e=this.Ns(pt);if(!e)return i||{};for(var t=W({},i||{}),s=Object.keys(e),r=0;s.length>r;r++)t[s[r]]=e[s[r]];return this.Is||(se.warn(" Overriding feature flag payloads!",{flagPayloads:i,overriddenPayloads:e,finalPayloads:t}),this.Is=!0),t}reloadFeatureFlags(){this.Es||this.Te.advanced_disable_feature_flags||this.$s()||this.Us||(this._instance.tn.emit("featureFlagsReloading",!0),this.Us=setTimeout(()=>{this.zs()},5))}Vs(){clearTimeout(this.Us),this.Us=void 0}ensureFlagsLoaded(){this.Ts||this.Ms||this.Us||this.reloadFeatureFlags()}setAnonymousDistinctId(i){this.$anon_distinct_id=i}setReloadingPaused(i){this.Es=i}zs(i){var e;if(this.Vs(),!this._instance.Vr()&&!this.$s())if(this.Ms)this.Rs=!0;else{var t=this.Te.token,s=this.Ns(Si),r={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:_({},((e=this.mi)==null?void 0:e.get_initial_props())||{},this.Ns(tt)||{}),group_properties:this.Ns(it),timezone:za()};ve(s)||x(s)||(r.$device_id=s),(i!=null&&i.disableFlags||this.Te.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.Hs()&&(r.evaluation_contexts=this.js());var n=this.Bs();x(n)||(r.flag_keys=n);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Ms=!0,this._instance._send_request({method:"POST",url:o,data:r,compression:this.Te.disable_compression?void 0:de.Base64,timeout:this.Te.feature_flag_request_timeout_ms,callback:l=>{var u,c,h,d=!0;if(this.Ws(l.statusCode),l.statusCode===200&&(this.Rs||(this.$anon_distinct_id=void 0),d=!1),this.Ms=!1,!r.disable_flags||this.Rs){this.Ps=!d;var v=[];l.error?l.error instanceof Error?v.push(l.error.name==="AbortError"?"timeout":"connection_error"):v.push("unknown_error"):l.statusCode!==200&&v.push("api_error_"+l.statusCode),(u=l.json)!=null&&u.errorsWhileComputingFlags&&v.push("errors_while_computing_flags");var p,f=!((c=l.json)==null||(c=c.quotaLimited)==null||!c.includes("feature_flags"));f&&v.push("quota_limited"),(h=this.mi)==null||h.register({[qs]:v}),f?se.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."):(r.disable_flags||this.receivedFeatureFlags((p=l.json)!==null&&p!==void 0?p:{},d,{partialResponse:a}),this.Rs&&(this.Rs=!1,this.zs()))}}})}}$s(){return La(this.Ls,3)}Ws(i){this.Ls=Da(i,this.Ls,3,()=>se.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(i,e){var t;if(e===void 0&&(e={}),!e.fresh||this.Ps)if(this.Ts||this.getFlags()&&this.getFlags().length>0){if(!this.qs()){var s=this.getFeatureFlagResult(i,e);return(t=s?.variant)!==null&&t!==void 0?t:s?.enabled}}else se.warn('getFeatureFlag for key "'+i+_s)}getFeatureFlagDetails(i){return this.getFlagsWithDetails()[i]}getFeatureFlagPayload(i){var e=this.getFeatureFlagResult(i,{send_event:!1});return e?.payload}getFeatureFlagResult(i,e){if(e===void 0&&(e={}),!e.fresh||this.Ps)if(this.Ts||this.getFlags()&&this.getFlags().length>0){if(!this.qs()){var t=this.getFlagVariants(),s=i in t,r=t[i],n=this.getFlagPayloads()[i],a=String(r),o=this.Ns(Ls)||void 0,l=this.Ns(Yt)||void 0,u=this.Ns(Bt)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var c,h=this._instance.get_session_id(),d=this.Ns(js);h&&h!==d&&(u={},(c=this.mi)==null||c.register({[Bt]:u,[js]:h}))}if((e.send_event||!("send_event"in e))&&(!(i in u)||!u[i].includes(a))){var v,p,f,y,m,S,k,E,F,D,L;A(u[i])?u[i].push(a):u[i]=[a],(v=this.mi)==null||v.register({[Bt]:u});var b=this.getFeatureFlagDetails(i),T=[...(p=this.Ns(qs))!==null&&p!==void 0?p:[]];x(r)&&T.push("flag_missing");var I={$feature_flag:i,$feature_flag_response:r,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:((f=this.Te.bootstrap)==null||(f=f.featureFlags)==null?void 0:f[i])||null,$feature_flag_bootstrapped_payload:((y=this.Te.bootstrap)==null||(y=y.featureFlagPayloads)==null?void 0:y[i])||null,$used_bootstrap_value:!this.Ps};x(b==null||(m=b.metadata)==null?void 0:m.has_experiment)||(I.$feature_flag_has_experiment=b.metadata.has_experiment),x(b==null||(S=b.metadata)==null?void 0:S.version)||(I.$feature_flag_version=b.metadata.version);var C,R=(k=b==null||(E=b.reason)==null?void 0:E.description)!==null&&k!==void 0?k:b==null||(F=b.reason)==null?void 0:F.code;R&&(I.$feature_flag_reason=R),b!=null&&(D=b.metadata)!=null&&D.id&&(I.$feature_flag_id=b.metadata.id),x(b?.original_variant)&&x(b?.original_enabled)||(I.$feature_flag_original_response=x(b.original_variant)?b.original_enabled:b.original_variant),b!=null&&(L=b.metadata)!=null&&L.original_payload&&(I.$feature_flag_original_payload=b==null||(C=b.metadata)==null?void 0:C.original_payload),T.length&&(I.$feature_flag_error=T.join(",")),this._instance.capture("$feature_flag_called",I)}if(s)return{key:i,enabled:!!r,variant:typeof r=="string"?r:void 0,payload:Fr(n)}}}else se.warn('getFeatureFlagResult for key "'+i+_s)}getRemoteConfigPayload(i,e){var t=this.Te.token,s={distinct_id:this._instance.get_distinct_id(),token:t};this.Hs()&&(s.evaluation_contexts=this.js());var r=this.Bs();x(r)||(s.flag_keys=r),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this.Te.disable_compression?void 0:de.Base64,timeout:this.Te.feature_flag_request_timeout_ms,callback(n){var a,o=(a=n.json)==null?void 0:a.featureFlagPayloads;e(o?.[i]||void 0)}})}isFeatureEnabled(i,e){if(e===void 0&&(e={}),!e.fresh||this.Ps){if(this.Ts||this.getFlags()&&this.getFlags().length>0){var t=this.getFeatureFlag(i,e);return x(t)?void 0:!!t}se.warn('isFeatureEnabled for key "'+i+_s)}}addFeatureFlagsHandler(i){this.featureFlagEventHandlers.push(i)}removeFeatureFlagsHandler(i){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==i)}receivedFeatureFlags(i,e,t){if(this.mi){this.Ts=!0;var s=this.getFlagVariants(),r=this.getFlagPayloads(),n=this.getFlagsWithDetails();(function(a,o,l,u,c,h){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var d=(b=>{var T=b.flags;return T?(b.featureFlags=Object.fromEntries(Object.keys(T).map(I=>{var C;
1return[I,(C=T[I].variant)!==null&&C!==void 0?C:T[I].enabled]})),b.featureFlagPayloads=Object.fromEntries(Object.keys(T).filter(I=>T[I].enabled).filter(I=>{var C;return(C=T[I].metadata)==null?void 0:C.payload}).map(I=>{var C;return[I,(C=T[I].metadata)==null?void 0:C.payload]}))):b.featureFlags&&se.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),b})(a),v=d.flags,p=d.featureFlags,f=d.featureFlagPayloads;if(p){var y=a.requestId,m=a.evaluatedAt;if(A(p)){se.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var S={};if(p)for(var k=0;p.length>k;k++)S[p[k]]=!0;o&&o.register({[hi]:p,[rt]:S})}else{var E=p,F=f,D=v;if(h!=null&&h.partialResponse)E=_({},l,E),F=_({},u,F),D=_({},c,D);else if(a.errorsWhileComputingFlags)if(v){var L=new Set(Object.keys(v).filter(b=>{var T;return!((T=v[b])!=null&&T.failed)}));E=_({},l,Object.fromEntries(Object.entries(E).filter(b=>L.has(b[0])))),F=_({},u,Object.fromEntries(Object.entries(F||{}).filter(b=>L.has(b[0])))),D=_({},c,Object.fromEntries(Object.entries(D||{}).filter(b=>L.has(b[0]))))}else E=_({},l,E),F=_({},u,F),D=_({},c,D);o&&o.register(_({[hi]:Object.keys(Tn(E)),[rt]:E||{},[di]:F||{},[As]:D||{}},y?{[Ls]:y}:{},m?{[Yt]:m}:{}))}}})(i,this.mi,s,r,n,t),e||(this.Fs=!1),this.Zs(e)}}override(i,e){e===void 0&&(e=!1),se.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:i,suppressWarning:e})}
1overrideFeatureFlags(i){if(!this._instance.__loaded||!this.mi)return se.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(i===!1)return this.mi.unregister(De),this.mi.unregister(pt),this.Zs(),Xe.info("All overrides cleared");if(A(i)){var e=Pn(i);return this.mi.register({[De]:e}),this.Zs(),Xe.info("Flag overrides set",{flags:i})}if(i&&typeof i=="object"&&("flags"in i||"payloads"in i)){var t,s=i;if(this.Is=!!((t=s.suppressWarning)!==null&&t!==void 0&&t),"flags"in s){if(s.flags===!1)this.mi.unregister(De),Xe.info("Flag overrides cleared");else if(s.flags){if(A(s.flags)){var r=Pn(s.flags);this.mi.register({[De]:r})}else this.mi.register({[De]:s.flags});Xe.info("Flag overrides set",{flags:s.flags})}}return"payloads"in s&&(s.payloads===!1?(this.mi.unregister(pt),Xe.info("Payload overrides cleared")):s.payloads&&(this.mi.register({[pt]:s.payloads}),Xe.info("Payload overrides set",{payloads:s.payloads}))),void this.Zs()}if(i&&typeof i=="object")return this.mi.register({[De]:i}),this.Zs(),Xe.info("Flag overrides set",{flags:i});se.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:i})}
1onFeatureFlags(i){if(this.addFeatureFlagsHandler(i),this.Ts){var e=this.Gs(),t=e.flags,s=e.flagVariants;try{i(t,s)}catch(r){se.error("Error while running feature flags callback",r)}}return()=>this.removeFeatureFlagsHandler(i)}updateEarlyAccessFeatureEnrollment(i,e,t){var s,r=(this.Ns(jt)||[]).find(l=>l.flagKey===i),n={["$feature_enrollment/"+i]:e},a={$feature_flag:i,$feature_enrollment:e,$set:n};r&&(a.$early_access_feature_name=r.name),t&&(a.$feature_enrollment_stage=t),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=_({},this.getFlagVariants(),{[i]:e});(s=this.mi)==null||s.register({[hi]:Object.keys(Tn(o)),[rt]:o}),this.Zs()}getEarlyAccessFeatures(i,e,t){e===void 0&&(e=!1);var s=this.Ns(jt),r=t?"&"+t.map(n=>"stage="+n).join("&"):"";if(s&&!e)return i(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Te.token+r),method:"GET",callback:n=>{var a,o;if(n.json){var l=n.json.earlyAccessFeatures;return(a=this.mi)==null||a.unregister(jt),(o=this.mi)==null||o.register({[jt]:l}),i(l)}}})}Gs(){var i=this.getFlags(),e=this.getFlagVariants();return{flags:i.filter(t=>e[t]),flagVariants:Object.keys(e).filter(t=>e[t]).reduce((t,s)=>(t[s]=e[s],t),{})}}Zs(i){var e=this.Gs(),t=e.flags,s=e.flagVariants;this.featureFlagEventHandlers.forEach(r=>{try{r(t,s,{errorsLoading:i})}catch(n){se.error("Error while running feature flags callback",n)}})}setPersonPropertiesForFlags(i,e){e===void 0&&(e=!0);var t=this.Ns(tt)||{},s=i?.$set||(i!=null&&i.$set_once?{}:i),r=i?.$set_once,n={};if(r)for(var a in r)({}).hasOwnProperty.call(r,a)&&(a in t||(n[a]=r[a]));this._instance.register({[tt]:_({},t,n,s)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(i,e){e===void 0&&(e=!0);var t=_({},this.Ns(tt)||{});i.forEach(s=>{delete t[s]}),this._instance.register({[tt]:t}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(i){i===void 0&&(i=!0),this._instance.unregister(tt),i&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(i,e){e===void 0&&(e=!0);var t=this.Ns(it)||{};Object.keys(t).length!==0&&Object.keys(t).forEach(s=>{t[s]=_({},t[s],i[s]),delete i[s]}),this._instance.register({[it]:_({},t,i)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(i){if(i){var e=this.Ns(it)||{};this._instance.register({[it]:_({},e,{[i]:{}})})}else this._instance.unregister(it)}reset(){this.Ts=!1,this.Ms=!1,this.Es=!1,this.Rs=!1,this.Ps=!1,this.$anon_distinct_id=void 0,this.Vs(),this.Is=!1,this.Ls=0}}},Eu={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var i;return!((i=this.Qs)==null||!i.isStarted)}get status(){var i,e;return this.Js===At||this.Js===ui?this.Js:(i=(e=this.Qs)==null?void 0:e.status)!==null&&i!==void 0?i:this.Js}constructor(i){if(this._forceAllowLocalhostNetworkCapture=!1,this.Js=bn,this.Ks=void 0,this._instance=i,!this._instance.sessionManager)throw Oe.error("started without valid sessionManager"),new Error(ir+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===qe)throw new Error(ir+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ys(){var i,e=!((i=this._instance.get_property(nt))==null||!i.enabled),t=!this.Te.disable_session_recording,s=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return g&&e&&t&&!s}startIfEnabledOrStop(i){var e;if(!this.Ys||(e=this.Qs)==null||!e.isStarted){var t=!x(Object.assign)&&!x(Array.from);this.Ys&&t?(this.Xs(i),Oe.info("starting")):(this.Js=bn,this.stopRecording())}}Xs(i){var e,t,s;this.Ys&&(this.Js!==At&&this.Js!==ui&&(this.Js=wn),$!=null&&(e=$.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(t=$.__PosthogExtensions__)!=null&&t.initSessionRecording?this.eo(i):(s=$.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,this.ro,r=>{if(r)return Oe.error("could not load recorder",r);this.eo(i)}))}stopRecording(){var i,e;(i=this.Ks)==null||i.call(this),this.Ks=void 0,(e=this.Qs)==null||e.stop()}io(){var i,e;(i=this.Ks)==null||i.call(this),this.Ks=void 0,(e=this.Qs)==null||e.discard()}no(){var i,e;(i=this.mi)==null||i.unregister(hr),(e=this.mi)==null||e.unregister(ha)}so(i,e){if(O(i))return null;var t,s=ue(i)?i:parseFloat(i);return typeof(t=s)!="number"||!Number.isFinite(t)||0>t||t>
11?(Oe.warn(e+" must be between 0 and 1. Ignoring invalid value:",i),null):s}oo(i){if(this.mi){var e,t,s=this.mi,r=()=>{var n,a=i.sessionRecording===!1?void 0:i.sessionRecording,o=this.so((n=this.Te.session_recording)==null?void 0:n.sampleRate,"session_recording.sampleRate"),l=this.so(a?.sampleRate,"remote config sampleRate"),u=o??l;O(u)&&this.no();var c=a?.minimumDurationMilliseconds;s.register({[nt]:_({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:_({capturePerformance:i.capturePerformance},a?.networkPayloadCapture),canvasRecording:{enabled:a?.recordCanvas,fps:a?.canvasFps,quality:a?.canvasQuality},sampleRate:u,minimumDurationMilliseconds:x(c)?null:c,endpoint:a?.endpoint,triggerMatchType:a?.triggerMatchType,masking:a?.masking,urlTriggers:a?.urlTriggers,version:a?.version,triggerGroups:a?.triggerGroups})})};r(),(e=this.Ks)==null||e.call(this),this.Ks=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(r)}}onRemoteConfig(i){return"sessionRecording"in i?i.sessionRecording===!1?(this.oo(i),void this.io()):(this.oo(i),void this.startIfEnabledOrStop()):(this.Js===At&&(this.Js=ui,Oe.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(i,e){var t;e===void 0&&(e="log"),(t=this.Qs)!=null&&t.log?this.Qs.log(i,e):Oe.warn("log called before recorder was ready")}get ro(){var i,e,t=(i=this._instance)==null||(i=i.persistence)==null?void 0:i.get_property(nt);return(t==null||(e=t.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}ao(){var i,e,t=this._instance.get_property(nt);if(!t)return!1;try{e=typeof t=="object"?t:JSON.parse(t)}catch(r){return Oe.warn("persisted remote config for session recording is invalid and will be ignored",r),!1}var s=(i=e.cache_timestamp)!==null&&i!==void 0?i:Date.now();return 36e5>=Date.now()-s}eo(i){var e,t;if((e=$.__PosthogExtensions__)==null||!e.initSessionRecording)return Oe.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[ya]:!0});if(this.Qs||(this.Qs=(t=$.__PosthogExtensions__)==null?void 0:t.initSessionRecording(this._instance),this.Qs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ao())return this.Js===ui||this.Js===At?void 0:(this.Js=At,Oe.info("persisted remote config is stale, requesting fresh config before starting"),void new Ga(this._instance).load());this.Js=wn,this.Qs.start(i)}onRRwebEmit(i){var e;(e=this.Qs)==null||e.onRRwebEmit==null||e.onRRwebEmit(i)}overrideLinkedFlag(){var i,e;this.Qs||(e=this.mi)==null||e.register({[pa]:!0}),(i=this.Qs)==null||i.overrideLinkedFlag()}overrideSampling(){var i,e;this.Qs||(e=this.mi)==null||e.register({[da]:!0}),(i=this.Qs)==null||i.overrideSampling()}overrideTrigger(i){var e,t;this.Qs||(t=this.mi)==null||t.register({[i==="url"?va:ga]:!0}),(e=this.Qs)==null||e.overrideTrigger(i)}get sdkDebugProperties(){var i;return((i=this.Qs)==null?void 0:i.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(i,e){var t;return!((t=this.Qs)==null||!t.tryAddCustomEvent(i,e))}}},ku={autocapture:class{constructor(i){this.lo=!1,this.uo=null,this.ho=!1,this.instance=i,this.rageclicks=new _n(i.config.rageclick),this.do=null}initialize(){this.startIfEnabled()}get Te(){var i,e,t=K(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=(i=t.url_allowlist)==null?void 0:i.map(s=>new RegExp(s)),t.url_ignorelist=(e=t.url_ignorelist)==null?void 0:e.map(s=>new RegExp(s)),t}co(){if(this.isBrowserSupported()){if(g&&P){var i=t=>{t=t||g?.event;try{this.vo(t)}catch(s){hs.error("Failed to capture event",s)}};if(ee(P,"submit",i,{capture:!0}),ee(P,"change",i,{capture:!0}),ee(P,"click",i,{capture:!0}),this.Te.capture_copied_text){var e=t=>{t=t||g?.event;try{this.vo(t,cs)}catch(s){hs.error("Failed to capture copy/cut event",s)}};ee(P,"copy",e,{capture:!0}),ee(P,"cut",e,{capture:!0})}}}else hs.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.lo&&(this.co(),this.lo=!0)}onRemoteConfigFailed(){this.startIfEnabled()}
1onRemoteConfig(i){i.elementsChainAsString&&(this.ho=i.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Fs]:!!i.autocapture_opt_out}),this.uo=!!i.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(i){this.do=i}getElementSelectors(i){var e,t=[];return(e=this.do)==null||e.forEach(s=>{var r=P?.querySelectorAll(s);r?.forEach(n=>{i===n&&t.push(s)})}),t}get isEnabled(){var i,e,t=(i=this.instance.persistence)==null?void 0:i.props[Fs];if(ve(this.uo)&&!Ce(t)&&!this.instance.Vr())return!1;var s=(e=this.uo)!==null&&e!==void 0?e:!!t;return!!this.instance.config.autocapture&&!s}vo(i,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var t,s=Xi(i);Ea(s)&&(s=s.parentNode||null),e==="$autocapture"&&i.type==="click"&&i instanceof MouseEvent&&this.instance.config.rageclick&&(t=this.rageclicks)!=null&&t.isRageClick(i.clientX,i.clientY,i.timeStamp||new Date().getTime())&&Jr(s,this.instance.config.rageclick)&&this.vo(i,"$rageclick");var r=e===cs;if(s&&function(h,d,v,p,f,y){var m,S,k,E,F,D;if(v===void 0&&(v=void 0),!g||fr(h)||(m=v)!=null&&m.url_allowlist&&!Wr(v.url_allowlist,y)||(S=v)!=null&&S.url_ignorelist&&Wr(v.url_ignorelist,y))return!1;if((k=v)!=null&&k.dom_event_allowlist){var L=v.dom_event_allowlist;if(L&&!L.some(N=>d.type===N))return!1}var b=Ia(h,p),T=b.parentIsUsefulElement,I=b.targetElementList;if(!function(N,V){var B=V?.element_allowlist;if(x(B))return!0;var j,q=function(he){if(B.some(ge=>he.tagName.toLowerCase()===ge))return{v:!0}};for(var re of N)if(j=q(re))return j.v;return!1}(I,v)||!Vs(I,(E=v)==null?void 0:E.css_selector_allowlist)||Vs(I,(F=(D=v)==null?void 0:D.css_selector_ignorelist)!==null&&F!==void 0?F:kl))return!1;try{var C=g.getComputedStyle(h);if(C&&C.getPropertyValue("cursor")==="pointer"&&d.type==="click")return!0}catch{}var R=h.tagName.toLowerCase();switch(R){case"html":return!1;case"form":return(f||["submit"]).indexOf(d.type)>=0;case"input":case"select":case"textarea":return(f||["change","click"]).indexOf(d.type)>=0;default:return T?(f||["click"]).indexOf(d.type)>=0:(f||["click"]).indexOf(d.type)>=0&&(gr.indexOf(R)>-1||h.getAttribute("contenteditable")==="true")}}(s,i,this.Te,r,r?["copy","cut"]:void 0,this.instance)){var n=vu(s,{e:i,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.ho,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=n.props;if(n.explicitNoCapture)return!1;var o=this.getElementSelectors(s);if(o&&o.length>0&&(a.$element_selectors=o),e===cs){var l,u=Pa(g==null||(l=g.getSelection())==null?void 0:l.toString()),c=i.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=c}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return Te(P?.querySelectorAll)}},historyAutocapture:class{constructor(i){var e;this._instance=i,this.fo=(g==null||(e=g.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(w.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.po&&this.po(),this.po=void 0,w.info("History API monitoring stopped")}monitorHistoryChanges(){g&&g.history&&(this.mo("pushState"),this.mo("replaceState"),this.yo())}mo(i){var e;if(g&&((e=g.history[i])==null||!e.__posthog_wrapped__)){var t=this;(function(s,r,n){try{if(!(r in s))return mn;var a={next:s[r]},o=n(function(){for(var l=arguments.length,u=new Array(l),c=0;l>c;c++)u[c]=arguments[c];return a.next.apply(this,u)});return Te(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:a}})),s[r]=o,()=>{if(s[r]!==o)for(var l=s[r];Te(l)&&l.__posthog_layer__;){var u=l.__posthog_layer__;if(u.next===o)return void(u.next=a.next);l=u.next}else s[r]=a.next}}catch{return mn}})(g.history,i,s=>function(r,n,a){s.call(this,r,n,a),t.bo(i)})}}bo(i){try{var e,t=g==null||(e=g.location)==null?void 0:e.pathname;if(!t)return;t!==this.fo&&this.isEnabled&&this._instance.capture(vt,{navigation_type:i}),this.fo=t}catch(s){w.error("Error capturing "+i+" pageview",s)}}yo(){if(!this.po){var i=()=>{this.bo("popstate")};ee(g,"popstate",i),this.po=()=>{g&&g.removeEventListener("popstate",i)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(i){var e;this._o=!1,this.lo=!1,this.wo=null,this.instance=i,this._o=!((e=this.instance.persistence)==null||!e.props[Is]),this.rageclicks=new _n(i.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var i=5e3;return K(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(i=this.Te.capture_heatmaps.flush_interval_milliseconds),i}get isEnabled(){return O(this.Te.capture_heatmaps)?O(this.Te.enable_heatmaps)?this._o:this.Te.enable_heatmaps:this.Te.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.lo)return;fu.info("starting..."),this.xo(),this.ke()}else{var i;clearInterval((i=this.wo)!==null&&i!==void 0?i:void 0),this.ko(),this.getAndClearBuffer()}}onRemoteConfig(i){if("heatmaps"in i){var e=!!i.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Is]:e}),this._o=e,this.startIfEnabled()}}getAndClearBuffer(){var i=this.R;return this.R=void 0,i}So(i){ps(i.originalEvent)&&this.pe(i.originalEvent,"deadclick")}ke(){this.wo&&clearInterval(this.wo),this.wo=P?.visibilityState==="visible"?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}xo(){g&&P&&(this.Co=this.oi.bind(this),ee(g,$i,this.Co),this.Io=i=>this.pe(i||g?.event),ee(P,"click",this.Io,{capture:!0}),this.To=i=>this.Mo(i||g?.event),ee(P,"mousemove",this.To,{capture:!0}),this.Eo=new Xr(this.instance,Cl,this.So.bind(this)),this.Eo.startIfEnabledOrStop(),this.Ro=this.ke.bind(this),ee(P,Ii,this.Ro),this.lo=!0)}ko(){var i;g&&P&&(this.Co&&g.removeEventListener($i,this.Co),this.Io&&P.removeEventListener("click",this.Io,{capture:!0}),this.To&&P.removeEventListener("mousemove",this.To,{capture:!0}),this.Ro&&P.removeEventListener(Ii,this.Ro),clearTimeout(this.Po),(i=this.Eo)==null||i.stop(),this.lo=!1)}Oo(i,e){var t=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),n=function(a,o,l){for(var u=a;u&&We(u)&&!we(u,"body");){if(u===l)return!1;var c=void 0;try{var h,d,v;c=(h=(d=(v=u.ownerDocument)==null?void 0:v.defaultView)!==null&&d!==void 0?d:g)==null?void 0:h.getComputedStyle(u).position}catch{return!1}if(M(o,c))return!0;u=Ta(u)}return!1}(Xi(i),["fixed","sticky"],r);return{x:i.clientX+(n?0:s),y:i.clientY+(n?0:t),target_fixed:n,type:e}}pe(i,e){var t;if(e===void 0&&(e="click"),!Vr(i.target)&&ps(i)){var s=this.Oo(i,e);(t=this.rageclicks)!=null&&t.isRageClick(i.clientX,i.clientY,new Date().getTime())&&Jr(Xi(i),this.instance.config.rageclick)&&this.Wt(_({}
1,s,{type:"rageclick"})),this.Wt(s)}}Mo(i){!Vr(i.target)&&ps(i)&&(clearTimeout(this.Po),this.Po=setTimeout(()=>{this.Wt(this.Oo(i,"mousemove"))},500))}Wt(i){if(g){var e=this.Te.disable_capture_url_hashes?Ve(g.location.href):g.location.href,t=this.Te.custom_personal_data_properties,s=this.Te.mask_personal_data_properties?[...kt,...t||[]]:[],r=Zt(e,s,Xt);this.R=this.R||{},this.R[r]||(this.R[r]=[]),this.R[r].push(i)}}oi(){this.R&&!Ge(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Xr,webVitalsAutocapture:class{constructor(i){var e;this._o=!1,this.lo=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Fo=()=>{clearTimeout(this.Lo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((t,s)=>_({},t,{["$web_vitals_"+s.name+"_event"]:_({},s),["$web_vitals_"+s.name+"_value"]:s.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Ao=t=>{var s;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var r=this.$o();if(!x(r))if(O(t?.name)||O(t?.value))Ze.error("Invalid metric received",t);else if(!this.No||this.No>t.value){this.R.url!==r&&(this.Fo(),this.Lo=setTimeout(this.Fo,this.flushToCaptureTimeoutMs)),x(this.R.url)&&(this.R.url=r),this.R.firstMetricTimestamp=x(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var n=(s=this._instance.sessionManager)==null?void 0:s.checkAndGetSessionAndWindowId(!0),a=_({},t,{$current_url:r,timestamp:Date.now()});x(n)||(a.$session_id=n.sessionId,a.$window_id=n.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.Fo()}else Ze.error("Ignoring metric with value >= "+this.No,t)},this.Do=()=>{if(!this.lo){var t,s,r,n,a=$.__PosthogExtensions__;if(!x(a)&&!x(a.postHogWebVitalsCallbacks)){var o=a.postHogWebVitalsCallbacks;t=o.onLCP,s=o.onCLS,r=o.onFCP,n=o.onINP}t&&s&&r&&n?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.Ao.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&s(this.Ao.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.Ao.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&n(this.Ao.bind(this)),this.lo=!0):Ze.error("web vitals callbacks not loaded - not starting")}},this._instance=i,this._o=!((e=this._instance.persistence)==null||!e.props[Ms]),this.startIfEnabled()}get qo(){return this._instance.config.capture_performance}get allowedMetrics(){var i,e,t=K(this.qo)?(i=this.qo)==null?void 0:i.web_vitals_allowed_metrics:void 0;return O(t)?((e=this._instance.persistence)==null?void 0:e.props[Os])||["CLS","FCP","INP","LCP"]:t}get flushToCaptureTimeoutMs(){return(K(this.qo)?this.qo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var i=K(this.qo)?this.qo.web_vitals_attribution:void 0;return i!=null&&i}get No(){var i=K(this.qo)&&ue(this.qo.__web_vitals_max_value)?this.qo.__web_vitals_max_value:yn;return i>0&&6e4>=i?yn:i}get isEnabled(){var i=ie?.protocol;if(i!=="http:"&&i!=="https:")return Ze.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=K(this.qo)?this.qo.web_vitals:Ce(this.qo)?this.qo:void 0;return Ce(e)?e:this._o}startIfEnabled(){this.isEnabled&&!this.lo&&(Ze.info("enabled, starting..."),this.rr(this.Do))}onRemoteConfig(i){if("capturePerformance"in i){var e=K(i.capturePerformance)&&!!i.capturePerformance.web_vitals,t=K(i.capturePerformance)?i.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ms]:e}),this._instance.persistence.register({[Os]:t})),this._o=e,this.startIfEnabled()}}rr(i){var e,t;(e=$.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?i():(t=$.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",s=>{s?Ze.error("failed to load script",s):i()})}$o(){var i=g?this._instance.config.disable_capture_url_hashes?Ve(g.location.href):g.location.href:void 0;if(i){var e=this._instance.config.custom_personal_data_properties,t=this._instance.config.mask_personal_data_properties?[...kt,...e||[]]:[];return Zt(i,t,Xt)}Ze.error("Could not determine current URL")}}},Su={exceptionObserver:class{constructor(i){var e,t,s,r,n,a;this.Do=()=>{var o;if(g&&this.isEnabled&&(o=$.__PosthogExtensions__)!=null&&o.errorWrappingFunctions){var l=$.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,u=$.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,c=$.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.jo&&this.Te.capture_unhandled_errors&&(this.jo=l(this.captureException.bind(this))),!this.Ho&&this.Te.capture_unhandled_rejections&&(this.Ho=u(this.captureException.bind(this))),!this.Bo&&this.Te.capture_console_errors&&(this.Bo=c(this.captureException.bind(this)))}catch(h){Ot.error("failed to start",h),this.Uo()}}},this._instance=i,this.zo=!((e=this._instance.persistence)==null||!e.props[$s]),this.Vo=new Po(_({},((t=this._instance.config.error_tracking)===void 0&&(t={}),{refillRate:(s=(r=t.exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:t.__exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:1,bucketSize:(n=(a=t.exceptionRateLimiterBucketSize)!==null&&a!==void 0?a:t.__exceptionRateLimiterBucketSize)!==null&&n!==void 0?n:10}),{refillInterval:1e4,it:Ot})),this.Te=this.Wo(),this.startIfEnabledOrStop()}Wo(){var i=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return K(i)?e=_({},e,i):(x(i)?this.zo:i)&&(e=_({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Ot.info("enabled"),this.Uo(),this.rr(this.Do)):this.Uo()}rr(i){var e,t;(e=$.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?i():(t=$.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,"exception-autocapture",s=>{if(s)return Ot.error("failed to load script",s);i()})}Uo(){var i,e,t;(i=this.jo)==null||i.call(this),this.jo=void 0,(e=this.Ho)==null||e.call(this),this.Ho=void 0,(t=this.Bo)==null||t.call(this),this.Bo=void 0}onRemoteConfig(i){"autocaptureExceptions"in i&&(this.zo=!!i.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[$s]:this.zo}),this.Te=this.Wo(),this.startIfEnabledOrStop())}onConfigChange(){this.Te=this.Wo()}
1captureException(i){var e,t,s,r=(e=i==null||(t=i.$exception_list)==null||(t=t[0])==null?void 0:t.type)!==null&&e!==void 0?e:"Exception";this.Vo.consumeRateLimit(r)?Ot.info("Skipping exception capture because of client rate limiting.",{exception:r}):(s=this._instance.exceptions)==null||s.sendExceptionEvent(i)}},exceptions:class{constructor(i){var e,t;this.Zo=[],this.Go=new Bo([new Qo,new al,new Xo,new Zo,new rl,new sl,new tl,new nl],function(s){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;r>a;a++)n[a-1]=arguments[a];return function(o,l){l===void 0&&(l=0);for(var u=[],c=o.split(` 2`),h=l;c.length>h;h++){var d=c[h];if(1024>=d.length){var v=Ur.test(d)?d.replace(Ur,"$1"):d;if(!v.match(/\S*Error: /)){for(var p of n){var f=p(v,s);if(f){u.push(f);break}}if(u.length>=50)break}}}return function(y){if(!y.length)return[];var m=Array.from(y);return m.reverse(),m.slice(0,50).map(S=>{return _({},S,{filename:S.filename||(k=m,k[k.length-1]||{}).filename,function:S.function||xt});var k})}(u)}}("web:javascript",Wo,Jo)),this._instance=i,this.Zo=(e=(t=this._instance.persistence)==null?void 0:t.get_property(Rs))!==null&&e!==void 0?e:[],this.Qo=ki(this.Jo()),this.Ko=new ll(this.Qo)}onConfigChange(){this.Qo=ki(this.Jo()),this.Ko.setConfig(this.Qo)}onRemoteConfig(i){var e,t,s;if("errorTracking"in i){var r=(e=(t=i.errorTracking)==null?void 0:t.suppressionRules)!==null&&e!==void 0?e:[],n=(s=i.errorTracking)==null?void 0:s.captureExtensionExceptions;this.Zo=r,this._instance.persistence&&this._instance.persistence.register({[Rs]:this.Zo,[Cs]:n})}}get Yo(){var i,e=!!this._instance.get_property(Cs),t=this._instance.config.error_tracking.captureExtensionExceptions;return(i=t??e)!==null&&i!==void 0&&i}buildProperties(i,e){return this.Go.buildFromUnknown(i,{syntheticException:e?.syntheticException,mechanism:{handled:e?.handled}})}addExceptionStep(i,e){if(this.Qo.enabled)try{if(!U(i)||i.trim().length===0)return void Ae.warn("Ignoring exception step because message must be a non-empty string");var t=function(n){if(!n)return{sanitizedProperties:{},droppedKeys:[]};var a=[];return{sanitizedProperties:Object.keys(n).reduce((o,l)=>ol.has(l)?(a.push(l),o):(o[l]=n[l],o),{}),droppedKeys:a}}(this.Xo(e)),s=t.sanitizedProperties,r=t.droppedKeys;r.length>0&&Ae.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.Ko.add(_({[xi]:i,[Ei]:new Date().toISOString()},s))}catch(n){Ae.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(i){try{var e=i.$exception_list;if(this.ta(e)){if(this.ea(e))return this.ra("Exception dropped: matched a suppression rule"),void Ae.info("Skipping exception capture because a suppression rule matched");if(!this.Yo&&this.ia(e))return this.ra("Exception dropped: thrown by a browser extension"),void Ae.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.na(e))return this.ra("Exception dropped: thrown by the PostHog SDK"),void Ae.info("Skipping exception capture because it was thrown by the PostHog SDK")}var t=this.Qo.enabled&&O(i.$exception_steps)?this.sa(i):i;try{var s=this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return s&&this.Ko.clear(),s}catch(r){return Ae.error("Failed to capture exception event. Dropping this exception.",r),void this.Ko.clear()}}catch(r){return void Ae.error("Failed to process exception event. Ignoring this exception.",r)}}sa(i){try{var e=this.Ko.getAttachable();return e.length===0?i:_({},i,{$exception_steps:e})}catch(t){return Ae.error("Failed to read buffered exception steps. Capturing exception without steps.",t),i}}ra(i){this.Qo.enabled&&this.Ko.add({[xi]:i,[Ei]:new Date().toISOString()})}Xo(i){return K(i)?_({},i):{}}Jo(){var i,e;return(i=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&i!==void 0?i:{}}ea(i){if(i.length===0)return!1;var e=i.reduce((t,s)=>{var r=s.type,n=s.value;return U(r)&&r.length>0&&t.$exception_types.push(r),U(n)&&n.length>0&&t.$exception_values.push(n),t},{$exception_types:[],$exception_values:[]});return this.Zo.some(t=>{var s=t.values.map(r=>{var n,a=so[r.operator],o=A(r.value)?r.value:[r.value],l=(n=e[r.key])!==null&&n!==void 0?n:[];return o.length>0&&a(o,l)});return t.type==="OR"?s.some(Boolean):s.every(Boolean)})}ia(i){return i.flatMap(e=>{var t,s;return(t=(s=e.stacktrace)==null?void 0:s.frames)!==null&&t!==void 0?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}na(i){if(i.length>0){var e,t,s,r,n=(e=(t=i[0].stacktrace)==null?void 0:t.frames)!==null&&e!==void 0?e:[],a=n[n.length-1];return(s=a==null||(r=a.filename)==null?void 0:r.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}
2ta(i){return!O(i)&&A(i)}}},Pu=_({productTours:class{get mi(){return this._instance.persistence}constructor(i){this.oa=null,this.aa=null,this._instance=i}initialize(){this.loadIfEnabled()}onRemoteConfig(i){if("productTours"in i){var e,t;if(this.mi&&this.mi.register({[cr]:!!i.productTours}),!gs(this._instance))return!this.oa&&O((e=this.mi)==null?void 0:e.props[qt])||vs.info("product tours disabled; stopping and clearing cached tours"),(t=this.oa)==null||t.stop(),this.oa=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.oa&&gs(this._instance)&&this.rr(()=>this.la())}rr(i){var e,t;(e=$.__PosthogExtensions__)!=null&&e.generateProductTours?i():(t=$.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,"product-tours",s=>{s?vs.error("Could not load product tours script",s):i()})}la(){var i;!this.oa&&(i=$.__PosthogExtensions__)!=null&&i.generateProductTours&&(this.oa=$.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(i,e){if(e===void 0&&(e=!1),!A(this.aa)||e){var t=this.mi;if(t){var s=t.props[qt];if(A(s)&&!e)return this.aa=s,void i(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:r=>{if(gs(this._instance)){var n=r.statusCode;if(n!==200||!r.json){var a="Product Tours API could not be loaded, status: "+n;return vs.error(a),void i([],{isLoaded:!1,error:a})}var o=A(r.json.product_tours)?r.json.product_tours:[];this.aa=o,t&&t.register({[qt]:o}),i(o,{isLoaded:!0})}else i([],{isLoaded:!0})}})}else i(this.aa,{isLoaded:!0})}getActiveProductTours(i){O(this.oa)?i([],{isLoaded:!1,error:"Product tours not loaded"}):this.oa.getActiveProductTours(i)}showProductTour(i){var e;(e=this.oa)==null||e.showTourById(i)}previewTour(i){this.oa?this.oa.previewTour(i):this.rr(()=>{var e;this.la(),(e=this.oa)==null||e.previewTour(i)})}dismissProductTour(){var i;(i=this.oa)==null||i.dismissTour("user_clicked_skip")}nextStep(){var i;(i=this.oa)==null||i.nextStep()}previousStep(){var i;(i=this.oa)==null||i.previousStep()}clearCache(){var i;this.aa=null,(i=this.mi)==null||i.unregister(qt)}resetTour(i){var e;(e=this.oa)==null||e.resetTour(i)}resetAllTours(){var i;(i=this.oa)==null||i.resetAllTours()}cancelPendingTour(i){var e;(e=this.oa)==null||e.cancelPendingTour(i)}}},qi),Tu={siteApps:class{constructor(i){this.ua=0,this._instance=i,this.ha=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}da(i,e){if(e){var t=this.globalsForEvent(e);this.ha.push(t),this.ha.length>1e3&&(this.ha=this.ha.slice(10))}}get siteAppLoaders(){var i;return(i=$._POSTHOG_REMOTE_CONFIG)==null||(i=i[this._instance.config.token])==null?void 0:i.siteApps}initialize(){if(this.isEnabled){var i=this._instance._addCaptureHook(this.da.bind(this));this.ca=()=>{i(),this.ha=[],this.ca=void 0}}}globalsForEvent(i){var e,t,s,r,n,a,o;if(!i)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var h of Object.entries(c)){var d=h[0];l[d]={id:u[d],type:d,properties:h[1]}}var v=i.$set_once,p=i.$set;return{event:_({},Rn(i,_u),{properties:_({},i.properties,p?{$set:_({},(e=(t=i.properties)==null?void 0:t.$set)!==null&&e!==void 0?e:{},p)}:{},v?{$set_once:_({},(s=(r=i.properties)==null?void 0:r.$set_once)!==null&&s!==void 0?s:{},v)}:{}),elements_chain:(n=(a=i.properties)==null?void 0:a.$elements_chain)!==null&&n!==void 0?n:"",distinct_id:(o=i.properties)==null?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}va(i){var e,t=(e=i.tagName)==null?void 0:e.toLowerCase();return t==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(i)||(Ie.error("prepare_external_dependency_stylesheet returned null"),null):t==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(i)||(Ie.error("prepare_external_dependency_script returned null"),null):i}fa(){var i,e,t,s,r,n,a,o;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=P?.defaultView,u=l==null||(i=l.Node)==null?void 0:i.prototype;if(!l||!u)return()=>{};if(this.ua++,this.pa)return this.ga();var c=[],h=this,d=new WeakSet,v=(y,m,S)=>{if(y!=null&&y[m]){var k=y[m];y[m]=S(k),c.push(()=>{y[m]=k})}},p=y=>{if(d.has(y))return y;var m=h.va(y);return m&&d.add(m),m},f=y=>y.map(m=>typeof m=="string"?m:p(m)).filter(m=>!ve(m));return v(u,"appendChild",y=>function(m){var S=p(m);return S?y.call(this,S):m}),v(u,"insertBefore",y=>function(m,S){var k=p(m);return k?y.call(this,k,S):m}),v(u,"replaceChild",y=>function(m,S){var k=p(m);return k?y.call(this,k,S):S}),[(e=l.Element)==null?void 0:e.prototype,(t=l.Document)==null?void 0:t.prototype,(s=l.DocumentFragment)==null?void 0:s.prototype].forEach(y=>{v(y,"append",m=>function(){for(var S=arguments.length,k=new Array(S),E=0;S>E;E++)k[E]=arguments[E];return m.apply(this,f(k))}),v(y,"prepend",m=>function(){for(var S=arguments.length,k=new Array(S),E=0;S>E;E++)k[E]=arguments[E];return m.apply(this,f(k))})}),[(r=l.Element)==null?void 0:r.prototype,(n=l.CharacterData)==null?void 0:n.prototype,(a=l.DocumentType)==null?void 0:a.prototype].forEach(y=>{v(y,"before",m=>function(){for(var S=arguments.length,k=new Array(S),E=0;S>E;E++)k[E]=arguments[E];return m.apply(this,f(k))}),v(y,"after",m=>function(){for(var S=arguments.length,k=new Array(S),E=0;S>E;E++)k[E]=arguments[E];return m.apply(this,f(k))}),v(y,"replaceWith",m=>function(){for(var S=arguments.length,k=new Array(S),E=0;S>E;E++)k[E]=arguments[E];var F=f(k);return k.length&&!F.length?void 0:m.apply(this,F)})}),v((o=l.Element)==null?void 0:o.prototype,"insertAdjacentElement",y=>function(m,S){var k=p(S);return k?y.call(this,m,k):null}),this.pa=()=>
2{c.forEach(y=>y()),this.pa=void 0},this.ga()}ga(){var i=!1;return()=>{var e;i||(i=!0,this.ua--,this.ua===0&&((e=this.pa)==null||e.call(this)))}}ma(i,e){e===void 0&&(e=!0);var t=this.fa();try{var s=i(t);return e&&t(),s}catch(r){throw t(),r}}setupSiteApp(i){var e=this.apps[i.id],t=()=>{var a;!e.errored&&this.ha.length&&(Ie.info("Processing "+this.ha.length+" events for site app with id "+i.id),this.ha.forEach(o=>this.ma(()=>e.processEvent==null?void 0:e.processEvent(o))),e.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((a=this.ca)==null||a.call(this))},s=!1,r=a=>{e.errored=!a,e.loaded=!0,Ie.info("Site app with id "+i.id+" "+(a?"loaded":"errored")),s&&t()};try{var n=this.ma(a=>i.init({posthog:this._instance,callback(o){a(),r(o)}}),!1).processEvent;n&&(e.processEvent=n),s=!0}catch(a){Ie.error(xn+i.id,a),r(!1)}if(s&&e.loaded)try{t()}catch(a){Ie.error("Error while processing buffered events PostHog app with config id "+i.id,a),e.errored=!0}}ya(){var i=this.siteAppLoaders||[];for(var e of i)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var t of i)this.setupSiteApp(t)}ba(i){var e=this;if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(i),s=function(n){try{e.ma(()=>n.processEvent==null?void 0:n.processEvent(t))}catch(a){Ie.error("Error while processing event "+i.event+" for site app "+n.id,a)}};for(var r of Object.values(this.apps))s(r)}}onRemoteConfig(i){var e,t,s,r=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.ya(),void this._instance.on("eventCaptured",o=>this.ba(o))):void Ie.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((t=this.ca)==null||t.call(this),(s=i.siteApps)!=null&&s.length)if(this.isEnabled){var n=function(){var o,l=a.id,u=a.url;$["__$$ph_site_app_"+l]=r._instance,(o=$.__PosthogExtensions__)==null||o.loadSiteApp==null||o.loadSiteApp(r._instance,u,c=>{if(c)return Ie.error(xn+l,c)})};for(var a of i.siteApps)n()}else Ie.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},Fu={tracingHeaders:class{constructor(i){this._a=void 0,this.wa=void 0,this.xa=void 0,this.Do=()=>{var e,t,s=this.ka();s?(x(this._a)&&(this._a=(e=$.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(s,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),x(this.wa)&&(this.wa=(t=$.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null?void 0:t._patchFetch(s,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Uo()},this._instance=i}initialize(){this.startIfEnabledOrStop()}rr(i){var e,t;(e=$.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?i():(t=$.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,"tracing-headers",s=>{if(s)return gu.error("failed to load script",s);i()})}Sa(){var i,e;return(i=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&i!==void 0?i:this._instance.config.__add_tracing_headers}ka(){var i=this.Sa();return A(i)?(A(this.xa)?this.xa.splice(0,this.xa.length,...i):this.xa=[...i],i.length>0?this.xa:void 0):(A(this.xa)&&this.xa.splice(0),this.xa=i||void 0,this.xa)}Uo(){var i,e;(i=this._a)==null||i.call(this),(e=this.wa)==null||e.call(this),this._a=void 0,this.wa=void 0}startIfEnabledOrStop(){this.ka()?this.rr(this.Do):this.Uo()}}},Iu=_({surveys:class{get Te(){return this._instance.config}constructor(i){this.Ca=void 0,this._surveyManager=null,this.Ia=!1,this.Ta=[],this.Ma=null,this.Ea=null,this._instance=i,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(i){if(!this.Te.disable_surveys){var e=i.surveys;if(O(e))return H.warn("Flags not loaded yet. Not loading surveys.");var t=A(e);this.Ca=t?e.length>0:e,H.info("flags response received, isSurveysEnabled: "+this.Ca),this.loadIfEnabled()}}reset(){try{var i;(i=this._surveyEventReceiver)==null||i.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var s=localStorage.key(t);(s!=null&&s.startsWith(ao)||s!=null&&s.startsWith("inProgressSurvey_"))&&e.push(s)}e.forEach(r=>localStorage.removeItem(r))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.Ia)H.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)H.info(En);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())H.info("Not loading surveys in cookieless mode without consent.");else{var i=$?.__PosthogExtensions__;if(i){if(!x(this.Ca)||this.Te.advanced_enable_surveys){var e=this.Ca||this.Te.advanced_enable_surveys;this.Ia=!0;try{var t=i.generateSurveys;if(t)return void this.Ra(t,e);var s=i.loadExternalDependency;if(!s)return void this.Pa(dr);s(this._instance,"surveys",r=>{r||!i.generateSurveys?this.Pa("Could not load surveys script",r):this.Ra(i.generateSurveys,e)})}catch(r){throw this.Pa("Error initializing surveys",r),r}finally{this.Ia=!1}}}else H.error("PostHog Extensions not found.")}}Ra(i,e){this._surveyManager=i(this._instance,e),this._surveyEventReceiver=new bu(this._instance),H.info("Surveys loaded successfully"),this.Oa({isLoaded:!0})}Pa(i,e){H.error(i,e),this.Oa({isLoaded:!1,error:i})}onSurveysLoaded(i){return this.Ta.push(i),this._surveyManager&&this.Oa({isLoaded:!0}),()=>{this.Ta=this.Ta.filter(e=>e!==i)}}getSurveys(i,e){if(e===void 0&&(e=!1),this.Te.disable_surveys)return H.info(En),i([]);var t,s=this._instance.get_property(Ds);if(s&&!e)return i(s,{isLoaded:!0}
2),void(this.Fa()&&this.getSurveys(()=>{},!0));typeof Promise<"u"&&this.Ma?this.Ma.then(r=>i(r.surveys,r.context)):(typeof Promise<"u"&&(this.Ma=new Promise(r=>{t=r})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timeout:this.Te.surveys_request_timeout_ms,callback:r=>{var n;this.Ma=null;var a=r.statusCode;if(a!==200||!r.json){var o="Surveys API could not be loaded, status: "+a;H.error(o),this.Ea=Date.now();var l={isLoaded:!1,error:o};return i([],l),void(t==null||t({surveys:[],context:l}))}this.Ea=null;var u,c=r.json.surveys||[],h=c.filter(v=>function(p){return!(!p.start_date||p.end_date)}(v)&&(no(v)||function(p){var f;return!((f=p.conditions)==null||(f=f.actions)==null||(f=f.values)==null||!f.length)}(v)));h.length>0&&((u=this._surveyEventReceiver)==null||u.register(h)),(n=this._instance.persistence)==null||n.register({[Ds]:c,[Pi]:Date.now()});var d={isLoaded:!0};i(c,d),t?.({surveys:c,context:d})}}))}Fa(){return this.La()&&!this.Ma&&!this.Aa()}La(){var i=this._instance.get_property(Pi);return ue(i)&&Date.now()-i>3e5}Aa(){return ue(this.Ea)&&3e5>Date.now()-this.Ea}markSurveyAsSeen(i,e){var t,s={id:i,current_iteration:(t=e?.iteration)!==null&&t!==void 0?t:null};oo(s);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}Oa(i){for(var e of this.Ta)try{if(!i.isLoaded)return e([],i);this.getSurveys(e)}catch(t){H.error("Error in survey callback",t)}}getActiveMatchingSurveys(i,e){if(e===void 0&&(e=!1),!O(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(i,e);H.warn("init was not called")}$a(i){var e=null;return this.getSurveys(t=>{var s;e=(s=t.find(r=>r.id===i))!==null&&s!==void 0?s:null}),e}
2Na(i){if(O(this._surveyManager))return{eligible:!1,reason:fs};var e=typeof i=="string"?this.$a(i):i;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(i){if(O(this._surveyManager))return H.warn("init was not called"),{visible:!1,disabledReason:fs};var e=this.Na(i);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(i,e){return O(this._surveyManager)?(H.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:fs})):new Promise(t=>{this.getSurveys(s=>{var r,n=(r=s.find(o=>o.id===i))!==null&&r!==void 0?r:null;if(n){var a=this.Na(n);t({visible:a.eligible,disabledReason:a.reason})}else t({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(i,e,t){var s;if(O(this._surveyManager))H.warn("init was not called");else{var r=typeof i=="string"?this.$a(i):i;if(r!=null&&r.id)if(au.includes(r.type)){var n=P?.querySelector(e);if(n)return(s=r.appearance)!=null&&s.surveyPopupDelaySeconds?(H.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var a,o;H.info("Rendering survey "+r.id+" with delay of "+((a=r.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(r,n,t),H.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n,t);H.warn("Survey element not found")}else H.warn("Surveys of type "+r.type+" cannot be rendered in the app");else H.warn("Survey not found")}}displaySurvey(i,e){var t;if(O(this._surveyManager))H.warn("init was not called");else{var s=this.$a(i);if(s){var r=s;if((t=s.appearance)!=null&&t.surveyPopupDelaySeconds&&e.ignoreDelay&&(r=_({},s,{appearance:_({},s.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Ks.Popover&&e.initialResponses&&H.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var n=this.canRenderSurvey(s);if(!n.visible)return void H.warn("Survey is not eligible to be displayed: ",n.disabledReason)}e.displayType!==Ks.Inline?this._surveyManager.handlePopoverSurvey(r,e):this.renderSurvey(r,e.selector,e.properties)}else H.warn("Survey not found")}}cancelPendingSurvey(i){O(this._surveyManager)?H.warn("init was not called"):this._surveyManager.cancelSurvey(i)}handlePageUnload(){var i;(i=this._surveyManager)==null||i.handlePageUnload==null||i.handlePageUnload()}}},qi),$u={toolbar:class{constructor(i){this.instance=i}Da(i){$.ph_toolbar_state=i}qa(){var i;return(i=$.ph_toolbar_state)!==null&&i!==void 0?i:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(i,e,t){if(i===void 0&&(i=void 0),e===void 0&&(e=void 0),t===void 0&&(t=void 0),ba(this.instance.config)||!g||!P)return!1;i=i??g.location,t=t??g.history;try{if(!e){try{g.localStorage.setItem("test","test"),g.localStorage.removeItem("test")}catch{return!1}e=g?.localStorage}var s,r=wu||Mi(i.hash,"__posthog")||Mi(i.hash,"state"),n=r?zr(()=>JSON.parse(atob(decodeURIComponent(r))))||zr(()=>JSON.parse(decodeURIComponent(r))):null;return n&&n.action==="ph_authorize"?((s=n).source="url",s&&Object.keys(s).length>0&&(n.desiredHash?i.hash=n.desiredHash:t?t.replaceState(t.state,"",i.pathname+i.search):i.hash="")):((s=JSON.parse(e.getItem(kn)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch{return!1}}ja(i){var e=$.ph_load_toolbar||$.ph_load_editor;!O(e)&&Te(e)?e(i,this.instance):Sn.warn("No toolbar load function found")}loadToolbar(i){var e=!(P==null||!P.getElementById(fa));if(!g||e)return!1;var t=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=_({token:this.instance.config.token},i,{apiURL:this.instance.requestRouter.endpointFor("ui")},t?{instrument:!1}:{});if(g.localStorage.setItem(kn,JSON.stringify(_({},s,{source:void 0}))),this.qa()===2)this.ja(s);else if(this.qa()===0){var r;this.Da(1),(r=$.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"toolbar",n=>{if(n)return Sn.error("[Toolbar] Failed to load",n),void this.Da(0);this.Da(2),this.ja(s)}),ee(g,"turbolinks:load",()=>{this.Da(0),this.loadToolbar(s)})}return!0}Ha(i){return this.loadToolbar(i)}maybeLoadEditor(i,e,t){return i===void 0&&(i=void 0),e===void 0&&(e=void 0),t===void 0&&(t=void 0),this.maybeLoadToolbar(i,e,t)}}},Ru=_({experiments:ce},qi),Cu={conversations:class{constructor(i){this.Ba=void 0,this._conversationsManager=null,this.Ua=!1,this.za=null,this._instance=i}initialize(){this.loadIfEnabled()}onRemoteConfig(i){if(!this._instance.config.disable_conversations){var e=i.conversations;O(e)||(Ce(e)?this.Ba=e:(this.Ba=e.enabled,this.za=e),this.loadIfEnabled())}}reset(){var i;(i=this._conversationsManager)==null||i.reset(),this._conversationsManager=null,this.Ba=void 0,this.za=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ua||this._instance.config.disable_conversations||ba(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var i=$?.__PosthogExtensions__;if(i&&!x(this.Ba)&&this.Ba)if(this.za&&this.za.token){this.Ua=!0;try{var e=i.initConversations;if(e)return this.Va(e),void(this.Ua=!1);var t=i.loadExternalDependency;if(!t)return void this.Wa(dr);t(this._instance,"conversations",s=>{s||!i.initConversations?this.Wa("Could not load conversations script",s):this.Va(i.initConversations),this.Ua=!1})}catch(s){this.Wa("Error initializing conversations",s),this.Ua=!1}}else Ee.error("Conversations enabled but missing token in remote config.")}}
2Va(i){if(this.za)try{this._conversationsManager=i(this.za,this._instance),Ee.info("Conversations loaded successfully")}catch(e){this.Wa("Error completing conversations initialization",e)}else Ee.error("Cannot complete initialization: remote config is null")}Wa(i,e){Ee.error(i,e),this._conversationsManager=null,this.Ua=!1}show(){this._conversationsManager?this._conversationsManager.show():Ee.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ba===!0&&!ve(this._conversationsManager)}isVisible(){var i,e;return(i=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&i!==void 0&&i}sendMessage(i,e,t){var s=this;return te(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(i,e,t):(Ee.warn(et),null)})()}getMessages(i,e){var t=this;return te(function*(){return t._conversationsManager?t._conversationsManager.getMessages(i,e):(Ee.warn(et),null)})()}markAsRead(i){var e=this;return te(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(i):(Ee.warn(et),null)})()}getTickets(i){var e=this;return te(function*(){return e._conversationsManager?e._conversationsManager.getTickets(i):(Ee.warn(et),null)})()}requestRestoreLink(i){var e=this;return te(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(i):(Ee.warn(et),null)})()}restoreFromToken(i){var e=this;return te(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(i):(Ee.warn(et),null)})()}restoreFromUrlToken(){var i=this;return te(function*(){return i._conversationsManager?i._conversationsManager.restoreFromUrlToken():(Ee.warn(et),null)})()}getCurrentTicketId(){var i,e;return(i=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&i!==void 0?i:null}getWidgetSessionId(){var i,e;return(i=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&i!==void 0?i:null}En(){var i;(i=this._conversationsManager)==null||i.setIdentity()}Rn(){var i;(i=this._conversationsManager)==null||i.clearIdentity()}}},Mu={logs:class{constructor(i){var e;this.Za=!1,this.Ga=!1,this.it=J("[logs]"),this.Gr=[],this.Qa=[],this.Ls=0,this.Ja=()=>{var t,s;this.Ls=0,(t=this.Ka)==null||t.onReconnect(),(s=this.Ya)==null||s.onReconnect()},this._instance=i,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Za=!0),g&&ee(g,"online",this.Ja)}Xa(i,e,t,s){var r,n=function(a,o){var l,u,c,h,d,v,p,f=(l=a?.flushIntervalMs)!==null&&l!==void 0?l:3e3,y=(u=a?.maxBufferSize)!==null&&u!==void 0?u:100,m=o!=null&&o.consoleCapture?void 0:(c=a?.maxLogsPerInterval)!==null&&c!==void 0?c:1e3,S=x(m)?Math.max(y,2048):Math.max(y,m),k=a?.resourceAttributes;return{serviceName:(h=(d=k?.["service.name"])!==null&&d!==void 0?d:a?.serviceName)!==null&&h!==void 0?h:o?.serviceNameDefault,serviceVersion:(v=k?.["service.version"])!==null&&v!==void 0?v:a?.serviceVersion,environment:(p=k?.["deployment.environment"])!==null&&p!==void 0?p:a?.environment,resourceAttributes:k,beforeSend:a?.beforeSend,flushIntervalMs:f,maxBufferSize:y,maxQueueSize:S,maxBatchRecordsPerPost:100,rateCapWindowMs:f,maxLogsPerInterval:m,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((r=this._instance)==null||(r=r.config)==null?void 0:r.logs,t);return[new qo(this.tl(i,e),n,this.it,()=>this.el(),a=>a(),void 0,s),n]}rl(){var i,e=(i=this._instance)==null||(i=i.config)==null?void 0:i.logs;if(!this.Ka||this.il!==e){var t;(t=this.Ka)==null||t.reset(),this.il=e;var s=this.Xa(()=>this.Gr,r=>{this.Gr=r});this.Ka=s[0],this.nl=s[1]}return this.Ka}sl(){var i,e=(i=this._instance)==null||(i=i.config)==null?void 0:i.logs;if(!this.Ya||this.ol!==e){var t;(t=this.Ya)==null||t.reset(),this.ol=e;var s=this.Xa(()=>this.Qa,r=>{this.Qa=r},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},In);this.Ya=s[0],this.al=s[1]}return this.Ya}initialize(){this.loadIfEnabled()}onRemoteConfig(i){var e,t=(e=i.logs)==null?void 0:e.captureConsoleLogs;!O(t)&&t&&(this.Za=!0,this.loadIfEnabled())}reset(){var i,e;this.Gr=[],(i=this.Ka)==null||i.reset(),this.Qa=[],(e=this.Ya)==null||e.reset(),this.Ls=0}captureLog(i){this.rl().captureLog(i)}le(i){this.sl().captureLog(i)}get logger(){return this.ll||(this.ll={trace:(i,e)=>this.captureLog({body:i,level:"trace",attributes:e}),debug:(i,e)=>this.captureLog({body:i,level:"debug",attributes:e}),info:(i,e)=>this.captureLog({body:i,level:"info",attributes:e}),warn:(i,e)=>this.captureLog({body:i,level:"warn",attributes:e}),error:(i,e)=>this.captureLog({body:i,level:"error",attributes:e}),fatal:(i,e)=>this.captureLog({body:i,level:"fatal",attributes:e})}),this.ll}flushLogs(i){i?this.ul(i):(this.Ka&&this.Ka.flush().catch(e=>this.it.error("PostHog logs flush failed:",e)),this.Ya&&this.Ya.flush().catch(e=>this.it.error("PostHog logs flush failed:",e)))}loadIfEnabled(){if(this.Za&&!this.Ga){var i=$?.__PosthogExtensions__;if(i){var e=i.loadExternalDependency;e?e(this._instance,"logs",t=>{var s;t||(s=i.logs)==null||!s.initializeLogs?this.it.error("Could not load logs script",t):(i.logs.initializeLogs(this._instance),this.Ga=!0)}):this.it.error(dr)}else this.it.error("PostHog Extensions not found.")}}tl(i,e){var t=this._instance;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},getPersistedProperty:s=>s===Ne.LogsQueue?i():void 0,setPersistedProperty(s,r){var n;s===Ne.LogsQueue&&e((n=r)!==null&&n!==void 0?n:[])},At:s=>this.At(s),getLibraryId:()=>X.LIB_NAME,getLibraryVersion:()=>X.LIB_VERSION}}At(i){return new Promise(e=>{if(La(this.Ls,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var t=!1,s=n=>{t||(t=!0,clearTimeout(r),e(n))},r=setTimeout(()=>s({kind:"retry-later",error:new Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.hl(),data:i,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:n=>{var a=n.statusCode;if(this.dl(a),a>=200&&300>a)s({kind:"ok"});else if(a===413)s({kind:"too-large"});else if(a!==0&&a!==429&&500>a)s({kind:"fatal",error:new Error("logs request failed with status "+a)});else{var o;s({kind:"retry-later",error:(o=n.error)!==null&&o!==void 0?o:new Error("logs request failed with status "+a)})}}})}})}dl(i){(i!==0||this._instance.__loaded)&&(this.Ls=Da(i,this.Ls,3,()=>this.it.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}ul(i){this.Gr.length>
20&&this.cl(i,this.Gr,this.nl,X.LIB_NAME,e=>{this.Gr=e}),this.Qa.length>0&&this.cl(i,this.Qa,this.al,In,e=>{this.Qa=e})}cl(i,e,t,s,r){if(e.length!==0){var n=e.map(o=>o.record);r([]);var a=aa(n,na(t,X.LIB_NAME,X.LIB_VERSION),s,X.LIB_VERSION);this._instance._send_request({method:"POST",url:this.hl(),data:a,compression:"best-available",batchKey:"logs",transport:i})}}hl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}el(){var i,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var t=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),s=t.windowId,r=t.sessionStartTimestamp,n=t.lastActivityTimestamp;e.sessionId=t.sessionId,e.windowId=s,O(r)||(e.sessionStartTimestamp=r),O(n)||(e.lastActivityTimestamp=n)}if($!=null&&(i=$.location)!=null&&i.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Ve($.location.href):$.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},Ou={metrics:class{constructor(i){this.it=J("[metrics]"),this._instance=i}initialize(){}rl(){var i,e,t,s,r,n,a,o,l,u=(i=this._instance)==null||(i=i.config)==null?void 0:i.metrics;return this.Ka&&this.il===u||((e=this.Ka)==null||e.reset(),this.il=u,this.Ka=new Ho(this.tl(),{serviceName:(s=(l=(t=u)==null?void 0:t.resourceAttributes)==null?void 0:l["service.name"])!==null&&s!==void 0?s:t?.serviceName,serviceVersion:(r=l?.["service.version"])!==null&&r!==void 0?r:t?.serviceVersion,environment:(n=l?.["deployment.environment"])!==null&&n!==void 0?n:t?.environment,resourceAttributes:l,beforeSend:t?.beforeSend,flushIntervalMs:(a=t?.flushIntervalMs)!==null&&a!==void 0?a:1e4,maxSeriesPerFlush:(o=t?.maxSeriesPerFlush)!==null&&o!==void 0?o:1e3},this.it)),this.Ka}count(i,e,t){e===void 0&&(e=1),this.rl().count(i,e,t)}gauge(i,e,t){this.rl().gauge(i,e,t)}histogram(i,e,t){this.rl().histogram(i,e,t)}flush(i){if(!this.Ka)return Promise.resolve();if(i){var e=this.Ka.drainWindow();return e&&this.Kt(e,i),Promise.resolve()}return this.Ka.flush().catch(t=>this.it.error("PostHog metrics flush failed:",t))}reset(){var i;(i=this.Ka)==null||i.reset()}tl(){var i=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},Kt:t=>e.Kt(t),getLibraryId:()=>X.LIB_NAME,getLibraryVersion:()=>X.LIB_VERSION}}Kt(i,e){return new Promise(t=>{var s=!1,r=a=>{s||(s=!0,clearTimeout(n),t(a))},n=setTimeout(()=>r({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(_({method:"POST",url:this.vl(),data:i,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(a){var o=a.statusCode;if(o>=200&&300>o)r({kind:"ok"});else if(o===413)r({kind:"too-large"});else if(o!==0&&o!==429&&500>o)r({kind:"fatal",error:new Error("metrics request failed with status "+o)});else{var l;r({kind:"retry-later",error:(l=a.error)!==null&&l!==void 0?l:new Error("metrics request failed with status "+o)})}}}))})}vl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},Au=_({},qi,Eu,ku,Su,Pu,Tu,Iu,Fu,$u,Ru,Cu,Mu,Ou);ke.__defaultExtensionClasses=_({},Au);var Lu=function(){X.SDK_DIST_CHANNEL="npm";var i=Vt[gt]=new ke;return function(){function e(){e.done||(e.done=!0,uo=!1,G(Vt,function(t){t._dom_loaded()}))}P!=null&&P.addEventListener?P.readyState==="complete"?e():ee(P,"DOMContentLoaded",e,{capture:!1}):g&&w.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),i}();export{de as Compression,Ks as DisplaySurveyType,ke as PostHog,Ul as ProductTourEventName,sn as ProductTourEventProperties,He as SurveyEventName,rs as SurveyEventProperties,Ft as SurveyEventType,ss as SurveyType,Lu as default,Lu as posthog};
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.