PageSourceSearch

https://foregon.com/_next/static/chunks/9da6db1e.e79e5d0d39cb0310.js

js foregon.com collected 2026-10-02 10:58:33 UTC 241,545 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8229],{6614:(e,t,i)=>{i.r(t),i.d(t,{Compression:()=>sH,DEFAULT_PRODUCT_TOUR_APPEARANCE:()=>s0,DisplaySurveyType:()=>sZ,PostHog:()=>aT,ProductTourEventName:()=>s1,ProductTourEventProperties:()=>s2,SurveyEventName:()=>sX,SurveyEventProperties:()=>sQ,SurveyEventType:()=>sq,SurveyPosition:()=>sV,SurveyQuestionBranchingType:()=>sY,SurveyQuestionType:()=>sK,SurveySchedule:()=>sJ,SurveyTabPosition:()=>sG,SurveyType:()=>sW,SurveyWidgetType:()=>sz,default:()=>ov,posthog:()=>ov,severityLevels:()=>s8});var r="undefined"!=typeof window?window:void 0,s="undefined"!=typeof globalThis?globalThis:r,n=null==s?void 0:s.navigator,a=null==s?void 0:s.document,o=null==s?void 0:s.location,l=null==s?void 0:s.fetch,u=null!=s&&s.XMLHttpRequest&&"withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:void 0,c=null==s?void 0:s.AbortController,h=null==s?void 0:s.CompressionStream,d=null==n?void 0:n.userAgent;function p(){return!(!r||!1===r.navigator.onLine)}var v="undefined"!=typeof globalThis?globalThis:r;v&&"undefined"==typeof self&&(v.self=v),v&&"undefined"==typeof File&&(v.File=function(){});var g=null!=r?r:{},_={DEBUG:!1,LIB_VERSION:"0.4.0",LIB_NAME:"browser-common"};function f(e,t,i,r,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(r,s)}function m(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function a(e){f(n,r,s,a,o,"next",e)}function o(e){f(n,r,s,a,o,"throw",e)}a(void 0)})}}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(null,arguments)}function b(e,t){if(null==e)return{};var i={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;i[r]=e[r]}return i}var w=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function x(e){return"string"==typeof e||e}function E(e){return"string"==typeof e?e:void 0}var S,k=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],P=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),T=function(e){return e.GZipJS="gzip-js",e.Base64="base64",e}({}),I=["$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"],R=["token"],F="NativeGzipValidationError",$
1=e=>e.length>=2&&31===e[0]&&139===e[1],O=(e,t)=>e===T.GZipJS||t===T.GZipJS||"gzip"===t,C=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),N=e=>{var t=Error("Native gzip produced invalid output: "+e);throw t.name=F,t},M=function(){var e=m(function*(e,t){18>e.size&&N("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));$(i)&&8===i[2]||N("invalid-header");var r=new DataView((yield e.slice(e.size-8).arrayBuffer()));r.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(S)return S;S=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;S[e]=t>>>0}return S})(),i=0xffffffff,r=0;e.length>r;r++)i=t[255&(i^e[r])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&N("invalid-crc");var s=t.length>>>0;r.getUint32(4,!0)!==s&&N("invalid-size")});return function(t,i){return e.apply(this,arguments)}}();function A(){return(A=m(function*(e,t,i){void 0===t&&(t=!0);try{var r,s=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(s).then(()=>a.close()).catch((r=m(function*(e){try{yield a.abort(e)}catch(e){}throw e}),function(e){return r.apply(this,arguments)})),l=new Response(n.readable).blob(),u=(yield Promise.all([l,o]))[0];return yield M(u,s),u}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var L=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],D=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return L.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function U(e,t){return -1!==e.indexOf(t)}var j=function(e){return e.trim()},B=function(e){return e.replace(/^\$/,"")};function H(e){var t,i=[];return null!=(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(t))return"[Circular]";i.push(t)}return t}}))?t:"null"}var q=Object.prototype,z=q.hasOwnProperty,V=q.toString,G=Array.isArray||function(e){return"[object Array]"===V.call(e)},W=e=>"function"==typeof e,K=e=>e===Object(e)&&!G(e),Y=e=>{if(K(e)){for(var t in e)if(z.call(e,t))return!1;return!0}return!1},J=e=>void 0===e,X=e=>"[object String]"==V.call(e),Q=e=>X(e)&&0===e.trim().length,Z=e=>null===e,ee=e=>J(e)||Z(e),et=e=>"[object Number]"==V.call(e)&&e==e,ei=e=>et(e)&&e>0,er=e=>"[object Boolean]"===V.call(e),es=e=>U(I,e),en=e=>U(R,e);function ea(e){return null===e||"object"!=typeof e}function eo(e,t){return({}).toString.call(e)==="[object "+t+"]"}function el(e){return"undefined"!=typeof Event&&eu(e,Event)}function eu(e,t){try{return e instanceof t}catch(e){return!1}}var ec=[!0,"true",1,"1","yes"],eh=e=>U(ec,e),ed=[!1,"false",0,"0","no"];function ep(e,t,i,r,s){return t>i&&(r.warn("min cannot be greater than max."),t=i),et(e)?e>i?(r.warn(" cannot be  greater than max: "+i+". Using max value instead."),i):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+s),ep(s||i,t,i,r))}class ev{constructor(e){this.tt={},this.et=e.et,this.it=ep(e.bucketSize,0,100,e.rt),this.nt=ep(e.refillRate,0,this.it,e.rt),this.st=ep(e.refillInterval,0,864e5,e.rt)}ot(e,t){var i=Math.floor((t-e.lastAccess)/this.st);i>0&&(e.tokens=Math.min(e.tokens+i*this.nt,this.it),e.lastAccess=e.lastAccess+i*this.st)}consumeRateLimit(e){var t,i=Date.now(),r=String(e),s=this.tt[r];return s?this.ot(s,i):this.tt[r]=s={tokens:this.it,lastAccess:i},0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this.et)||t.call(this,e)),0===s.tokens)}stop(){this.tt={}}}var eg="Mobile",e_="Android",ef="Tablet",em=e_+" "+ef,ey="iPad",eb="Apple",ew=eb+" Watch",ex="Safari",eE="BlackBerry",eS="Samsung",ek=eS+"Browser",eP=eS+" Internet",eT="Chrome",eI=eT+" OS",eR=eT+" iOS",eF="Internet Explorer",e$=eF+" "+eg,eO="Opera",eC=eO+" Mini",eN="Edge",eM="Microsoft "+eN,eA="Firefox",eL=eA+" iOS",eD="Nintendo",eU="PlayStation",ej="Xbox",eB=e_+" "+eg,eH=eg+" "+ex,eq="Windows",ez=eq+" Phone",eV="Nokia",eG="Ouya",eW="Generic",eK=eW+" "+eg.toLowerCase(),eY=eW+" "+ef.toLowerCase(),eJ="Konqueror",eX="Oculus Browser",eQ="Vivaldi",eZ="Yandex",e0="Whale",e1="DuckDuckGo",e2="Pale Moon",e3="Waterfox",e5="Brave",e6="Google Search App",e4="(\\d+(\\.\\d+)?)",e8=RegExp("Version/"+e4),e7=RegExp(ej,"i"),e9=RegExp(eU+" \\w+","i"),te=RegExp(eD+" \\w+","i"),tt=RegExp(eE+"|PlayBook|BB10","i"),ti={"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"},tr=function(e,t,i,r){var s;return t=t||"",(null!=i&&i.brave?e5:null)||(null!=r&&r.detectGoogleSearchApp&&U(e,"GSA/")?e6:U(e," OPR/")&&U(e,"Mini")?eC:U(e," OPR/")?eO:tt.test(e)?eE:U(e,"IE"+eg)||U(e,"WPDesktop")?e$:U(e,"OculusBrowser")?eX:U(e,ek)?eP:U(e,eN)||U(e,"Edg/")?eM:U(e,eQ+"/")?eQ:U(e,"YaBrowser/")?eZ:U(e,e0+"/")?e0:U(e,e1+"/")||U(e,"Ddg/")?e1:U(e,"FBIOS")?"Facebook "+eg:U(e,"UCWEB")||U(e,"UCBrowser")?"UC Browser":U(e,"CriOS")?eR:U(e,"CrMo")||U(e,eT)?eT:U(e,e_)&&U(e,ex)?eB:U(e,"FxiOS")?eL:U(e.toLowerCase(),eJ.toLowerCase())?eJ:U(e,e5+"/")?e5:(s=t)&&U(s,eb)||U(e,ex)&&!U(e,eT)&&!U(e,e_)?U(e,eg)?eH:ex:U(e,"PaleMoon/")?e2:U(e,e3+"/")?e3:U(e,eA)?eA:U(e,"MSIE")||U(e,"Trident/")?eF:U(e,"Gecko")?eA:"")},ts={[e$]:[RegExp("rv:"+e4)],[eM]:[RegExp(eN+"?\\/"+e4)],[eT]:[RegExp("("+eT+"|CrMo)\\/"+e4)],[eR]:[RegExp("CriOS\\/"+e4)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+e4)],[ex]:[e8],[eH]:[e8],[eO]:[RegExp("(Opera|OPR)\\/"+e4)],[eA]:[RegExp(eA+"\\/"+e4)],[eL]:[RegExp("FxiOS\\/"+e4)],[eJ]:[RegExp("Konqueror[:/]?"+e4,"i")],[eE]:[RegExp(eE+" "+e4),e8],[eB]:[RegExp("android\\s"+e4,"i")],[eP]:[RegExp(ek+"\\/"+e4)],[eX]:[RegExp("OculusBrowser\\/"+e4)],[eQ]:[RegExp(eQ+"\\/"+e4)],[eZ]:[RegExp("YaBrowser\\/"+e4)],[e0]:[RegExp(e0+"\\/"+e4)],[e5]:[RegExp(e5+"\\/"+e4)],[e1]:[RegExp("(DuckDuckGo|Ddg)\\/"+e4)],[e2]:[RegExp("PaleMoon\\/"+e4)],[e3]:[RegExp(e3+"\\/"+e4)],[e6]:[RegExp("GSA\\/"+e4)],[eF]:[RegExp("(rv:|MSIE )"+e4)],Mozilla:[RegExp("rv:"+e4)]},tn=function(e,t,i,r){var s=ts[tr(e,t,i,r)];if(J(s))return null;for(var n=0;s.length>n;n++){var a=e.match(s[n]);if(a)return parseFloat(a[a.length-2])}return null},ta=[[RegExp(ej+"; "+ej+" (.*?)[);]","i"),e=>[ej,e&&e[1]||""]],[RegExp(eD,"i"),[eD,""]],[RegExp(eU,"i"),[eU,""]],[tt,[eE,""]],[RegExp(eq,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[ez,""];if(new RegExp(eg).test(t)&&!/IEMobile\b/.test(t))return[eq+" "+eg,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=ti[i[1]]||"";return/arm/i.test(t)&&(r="RT"),[eq,r]}return[eq,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=J(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+e_+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+e_+")","i"),e=>e&&e[2]?[e_,[e[2],e[3],e[4]||"0"].join(".")]:[e_,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[eI,""]],[/Linux|debian/i,["Linux",""]]],to=function(e){return te.test(e)?eD:e9.test(e)?eU:e7.test(e)?ej:RegExp(eG,"i").test(e)?eG:RegExp("("+ez+"|WPDesktop)","i").test(e)?ez:/iPad/.test(e)?ey:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ew:tt.test(e)?eE:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eV,"i").test(e)?eV:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(eg).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?e_:em:RegExp("(pda|"+eg+")","i").test(e)?eK:RegExp(ef,"i").test(e)&&!RegExp(ef+" pc","i").test(e)?eY:""},tl=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tu(e,t){return"string"==typeof e&&tl.test(e)?e:t()}function tc(e){return e?e.split("#")[0]:e}function th(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function td(e,t,i){return tp.apply(this,arguments)}function tp(){return(tp=m(function*(e,t,i){var r;try{return yield Promise.race([e,new Promise((e,s)=>{r=th(()=>{try{null==i||i(),e()}catch(e){s(e)}},t)})])}finally{clearTimeout(r)}})).apply(this,arguments)}var tv=e=>e instanceof Error,tg={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}},t_=tg.info;function tf(e){var t=[];for(var i in e){var r=e[i];Z(r)||J(r)||t.push({key:i,value:function e(t){if(er(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(G(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(r)})}return t}function tm(e,t,i){return y({},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":i})}function ty(e,t,i,r){return{resourceLogs:[{resource:{attributes:tf(t)},scopeLogs:[{scope:{name:i,version:r},logRecords:e}]}]}}let tb=class{constructor(e,t,i,r,s,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Ne=t,this.rt=i,this.ut=r,this.ht=s,this.dt=n,this.vt=a,this.ct=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.kt=t.maxBufferSize,this.xt=Math.max(null!=(o=t.maxQueueSize)?o:t.maxBufferSize,t.maxBufferSize),this.St=t.flushIntervalMs,this.Ct=t.maxBatchRecordsPerPost,this.Mt=t.rateCapWindowMs,this.Tt=t.maxLogsPerInterval}reset(){this.Et(),this.ct=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Ne.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.It()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.Pt(e);if(null!==t)if(t.body){if(this.Rt()){var i,r,s,n,a,o,l,u,c={record:(i=this.ut(),s=(r=tg[t.level||"info"]||t_).text,n=r.number,a=String(Date.now())+"000000",o={},i.distinctId&&(o.posthogDistinctId=i.distinctId),i.sessionId&&(o.sessionId=i.sessionId),i.windowId&&(o["window.id"]=i.windowId),ee(i.sessionStartTimestamp)||(o.sessionStartTimestamp=String(i.sessionStartTimestamp)),ee(i.lastActivityTimestamp)||(o.lastActivityTimestamp=String(i.lastActivityTimestamp)),i.currentUrl&&(o["url.full"]=i.currentUrl),i.screenName&&(o["screen.name"]=i.screenName),i.appState&&(o["app.state"]=i.appState),i.activeFeatureFlags&&i.activeFeatureFlags.length>0&&(o.feature_flags=i.activeFeatureFlags),l=y({},o,t.attributes||{}),u={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:n,severityText:s,body:{stringValue:t.body},attributes:tf(l)},t.trace_id&&(u.traceId=t.trace_id),t.span_id&&(u.spanId=t.span_id),J(t.trace_flags)||(u.flags=t.trace_flags),u)};this.ht(()=>this.At(c))}}else this.rt.info("Log was rejected in beforeSend function")}}Pt(e){var t=this.Ne.beforeSend;if(!t)return e;var i=G(t)?t:[t],r=e;for(var s of i)try{var n=s(r);if(!n)return this.rt.info("Log was rejected in beforeSend function"),null;r=n}catch(e){return this.rt.error("Error in beforeSend function for log:",e),null}return r}Rt(){if(void 0===this.Tt)return!0;var e=Date.now(),t=e-this.bt;return this.Mt>t&&t>=0||(this.bt=e,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||(this.rt.warn("captureLog dropping logs: exceeded "+this.Tt+" logs per "+this.Mt+"ms"),this.wt=!0),!1)}flush(){var e=this;return m(function*(){if(!e._instance.isDisabled)return e.ct||(e.ct=e.Ft().finally(()=>{e.ct=null})),e.ct})()}Ft(){var e=this;return m(function*(){e.Et();var t=null!=(s=e._instance.getPersistedProperty(P.LogsQueue))?s:[];if(0!==t.length)for(var i=t.length,r=0;t.length>0&&i>r;){e.ft=0;var s,n,a,o=Math.min(t.length,e.Ct),l=t.slice(0,o),u=ty(l.map(e=>e.record),e.Lt(),null!=(n=e.vt)?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance.Ot(u);
1if("too-large"===c.kind&&l.length>1)e.Ct=Math.max(1,Math.floor(l.length/2)),e.rt.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.Ct);else if("retry-later"===c.kind||("too-large"===c.kind?e.rt.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."):"ok"===c.kind&&e.Ne.maxBatchRecordsPerPost>e.Ct&&(e.Ct=Math.min(e.Ne.maxBatchRecordsPerPost,e.Ct+1)),yield e.Dt(l.length),t=null!=(a=e._instance.getPersistedProperty(P.LogsQueue))?a:[],r+=l.length,"fatal"===c.kind))throw c.error}})()}Dt(e){var t=this;return m(function*(){var i,r=Math.max(0,e-t.ft),s=null!=(i=t._instance.getPersistedProperty(P.LogsQueue))?i:[];t._instance.setPersistedProperty(P.LogsQueue,s.slice(r)),yield t.dt()})()}Lt(){return tm(this.Ne,this._instance.getLibraryId(),this._instance.getLibraryVersion())}At(e){var t;if(!this._instance.optedOut){var i=null!=(t=this._instance.getPersistedProperty(P.LogsQueue))?t:[];this.xt>i.length||(i.shift(),this.ft++,this.rt.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(P.LogsQueue,i),this.kt>i.length?this.$t():this.It()}}$t(e){void 0===e&&(e=this.St),this.Nt||(this.Nt=th(()=>{this.Nt=void 0,this.It()},e))}qt(){var e=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,e)}jt(){var e=this._instance.getPersistedProperty(P.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return m(function*(){t.Et();var i=t.flush().catch(()=>{});void 0!==e?yield td(i,e):yield i})()}flushWithTimeout(e){var t=this;return m(function*(){var i=t.flush();yield td(i,e,()=>{i.catch(()=>{})})})()}It(){this.flush().then(()=>{this.yt=0},e=>{this.yt++,this.rt.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.jt()&&this.$t(this.qt())})}Et(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}};var tw=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function tx(e){return String(e)+"000000"}function tE(e,t,i,r){var s="";return r&&(s=Object.keys(r).sort().map(e=>JSON.stringify(e)+":"+JSON.stringify(r[e])).join(",")),e+"\0"+t+"\0"+(null!=i?i:"")+"\0"+s}let tS=class{constructor(e,t,i){this._instance=e,this.Ne=t,this.rt=i,this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Wt=0}count(e,t,i){void 0===t&&(t=1),this.Vt({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(e,t,i){this.Vt({name:e,type:"gauge",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(e,t,i){this.Vt({name:e,type:"histogram",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var e,t=this,i=this.ct,r=(e=m(function*(){i&&(yield i.catch(()=>{})),yield t.Zt()}),function(){return e.apply(this,arguments)})().finally(()=>{this.ct===r&&(this.ct=null)});return this.ct=r,r}drainWindow(){if(0===this.Bt.size)return null;var e=this.Bt;return this.Bt=new Map,this.Ht=!1,this.Ut=new Map,this.zt=new Set,this.Gt(e)}reset(){this.Wt++,this.Et(),this.Bt=new Map,this.ct=null,this.Ht=!1,this.Ut=new Map,this.zt=new Set}Vt(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.Pt(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this.rt.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{try{i=t.attributes?y({},t.attributes):void 0,r=tE(t.type,t.name,t.unit,i)}catch(e){return void this.rt.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var i,r,s=this.Bt.get(r);if(!s){if(!this.Qt())return;s={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Bt.set(r,s)}var n=this.Ut.get(t.name);void 0===n?this.Ut.set(t.name,t.type):n===t.type||this.zt.has(t.name)||(this.zt.add(t.name),this.rt.warn("Metric name '"+t.name+"' is already used as a "+n+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(s,t.value),this.$t()}else this.rt.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.rt.warn("Dropping metric with empty name")}}Qt(){return this.Ne.maxSeriesPerFlush>this.Bt.size||(this.Ht||(this.Ht=!0,this.rt.warn("Metric series cap reached ("+this.Ne.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(e,t){var i;switch(e.type){case"count":e.total=(null!=(i=e.total)?i:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:Array(tw.length+1).fill(0)});var r=e.hist;r.count+=1,r.sum+=t,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.bucketCounts[function(e,t){for(var i=0;t.length>i;i++)if(t[i]>=e)return i;return t.length}(t,tw)]+=1}}Pt(e){var t=this.Ne.beforeSend;if(!t)return e;var i=G(t)?t:[t],r=e;for(var s of i)try{var n=s(r);if(!n)return this.rt.info("Metric was rejected in beforeSend function"),null;r=n}catch(e){return this.rt.error("Error in beforeSend function for metric:",e),null}return r}$t(){this.Nt||(this.Nt=th(()=>{this.Nt=void 0,this.flush().catch(e=>{this.rt.error("Metrics flush failed:",e)})},this.Ne.flushIntervalMs))}Et(){this.Nt&&(clearTimeout(this.Nt),this.Nt=void 0)}
1Zt(){var e=this;return m(function*(){if(0!==e.Bt.size){var t=e.Bt;e.Bt=new Map,e.Ht=!1,e.Ut=new Map,e.zt=new Set;var i=e.Wt,r=yield e._instance.Kt(e.Gt(t));if(i===e.Wt)switch(r.kind){case"ok":return;case"retry-later":return e.Yt(t),void e.$t();case"too-large":return void e.rt.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.rt.error("Failed to send metrics batch:",r.error)}}})()}Gt(e){var t,i,r,s,n,a,o;return t=this.Xt(e),n=this.Ne,a=this._instance.getLibraryId(),o=this._instance.getLibraryVersion(),i=y({},n.resourceAttributes,{"service.name":n.serviceName||"unknown_service"},n.environment&&{"deployment.environment":n.environment},n.serviceVersion&&{"service.version":n.serviceVersion},{"telemetry.sdk.name":a,"telemetry.sdk.version":o}),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:tf(i)},scopeMetrics:[{scope:{name:r,version:s},metrics:t}]}]}}Xt(e){var t=tx(Date.now()),i=new Map;for(var r of e.values()){var s,n=tE(r.type,r.name,r.unit,void 0),a=i.get(n);a||(a=y({name:r.name},r.unit&&{unit:r.unit}),"count"===r.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===r.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(n,a));var o=tf(null!=(s=r.attributes)?s:{}),l=tx(r.windowStartMs);if("count"===r.type){var u,c={attributes:o,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!=(u=r.total)?u:0};a.sum.dataPoints.push(c)}else if("gauge"===r.type){var h,d={attributes:o,timeUnixNano:t,asDouble:null!=(h=r.last)?h:0};a.gauge.dataPoints.push(d)}else r.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:t,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:tw})}return Array.from(i.values())}Yt(e){var t,i;for(var r of e){var s=r[0],n=r[1],a=this.Bt.get(s);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,n.windowStartMs),a.type){case"count":a.total=(null!=(t=a.total)?t:0)+(null!=(i=n.total)?i: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.Bt.set(s,n)}}};class tk{constructor(e,t,i){void 0===i&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,t,0).apply(e),s=this.buildParsingContext(t),n=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return m(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&G(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,r;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),y({},e,{cause:i,stack:r})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return m(function*(){var i=e;for(var r of t.modifiers)i=yield r(i);return i})()}convertToExceptionList(e,t){var i,r,s,n={type:e.type,value:e.value,mechanism:{type:null!=(i=t.type)?i:"generic",handled:null==(r=t.handled)||r,synthetic:null!=(s=e.synthetic)&&s}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var a=[n];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,y({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return rv&&i.length===rp||(rp=i.length,rv=i.reduce((i,r)=>{rd||(rd={});var s=rd[r];if(s)i[s[0]]=s[1];else for(var n=e(r),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,u=t[r];if(l&&u){i[l]=u,rd[r]=[l,u];break}}return i},{})),rv}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var r=(i,r)=>{if(4>=r){var s=this.buildCoercingContext(e,t,r);return this.applyCoercers(i,s)}};return y({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,i),next:e=>r(e,i+1)})}}function tP(e,t,i,r,s){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return J(r)||(n.lineno=r),J(s)||(n.colno=s),n}var tT=(e,t)=>
1{var i=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return i||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},tI=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tR=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tF=/\((\S*)(?::(\d+))(?::(\d+))\)/,t$=(e,t)=>{var i=tI.exec(e);if(i)return tP(t,i[1],"?",+i[2],+i[3]);var r=tR.exec(e);if(r){if(r[2]&&0===r[2].indexOf("eval")){var s=tF.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var n=tT(r[1]||"?",r[2]);return tP(t,n[1],n[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},tO=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tC=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tN=(e,t)=>{var i=tO.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=tC.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var s=i[3],n=i[1]||"?",a=tT(n,s);return tP(t,s=a[1],n=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tM=/\(error: (.*)\)/;class tA{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=X(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return eo(e,"DOMException")}isDOMError(e){return eo(e,"DOMError")}}class tL{match(e){switch(({}).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return eu(e,Error)}}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){return e.stacktrace||e.stack||void 0}}class tD{constructor(){}match(e){return!!eo(e,"ErrorEvent")&&(null!=e.error||this.fe(e))}coerce(e,t){if(null!=e.error)return t.apply(e.error);var i,r=t.apply(e.message);return y({},r,{stack:null!=(i=this.pe(e))?i:r.stack,synthetic:!0})}fe(e){return X(e.message)&&e.message.length>0}pe(e){if(X(e.filename)&&e.filename.length>0){var t,i,r=null!=(t=e.lineno)?t:0,s=null!=(i=e.colno)?i:0;return"Error\n    at "+e.filename+":"+r+":"+s}}}var tU=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tj{match(e){return"string"==typeof e}coerce(e,t){var i,r=this.getInfos(e),s=r[0],n=r[1];return{type:null!=s?s:"Error",value:null!=n?n:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,r=e.match(tU);return r&&(t=r[1],i=r[2]),[t,i]}}var tB=["fatal","error","warning","log","info","debug"];function tH(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var s=i.slice(0,r).join(", ");if(t>=s.length)return r===i.length?s:s.length>t?s.slice(0,t)+"...":s}return""}class tq{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,r,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:null!=(i=this.getStack(e))?i:null==(r=t.syntheticException)?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return el(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+tH(e)}isSeverityLevel(e){return X(e)&&!Q(e)&&tB.indexOf(e)>=0}getStack(e){try{return X(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:X(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(tv(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tz{match(e){return el(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+tH(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tV{match(e){return ea(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tG{match(e){return eo(e,"PromiseRejectionEvent")||this.isCu
1stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!el(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var i,r=this.getUnhandledRejectionReason(e);return ea(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var tW="$message",tK="$timestamp",tY=new Set([tW,tK]),tJ={enabled:!0,max_bytes:32768};function tX(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tJ.enabled,max_bytes:function(e,t){if(!et(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tJ.max_bytes)}:y({},tJ)}class tQ{constructor(e){this.Je=[],this.Ke=0,this.Ne=tX(e)}setConfig(e){this.Ne=tX(e),this.Xe()}add(e){var t=function(e){var t;try{t=H(e)}catch(e){return}try{var i=JSON.parse(t);if(!K(i))return;var r=i[tW],s=i[tK];if(!X(r)||0===r.trim().length||!X(s)&&!et(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var i=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),i=0,r=0;t.length>r;r++)"%"===t[r]?(i+=1,r+=2):i+=1;return i}(t.json);i>this.Ne.max_bytes||(this.Je.push({step:t.step,bytes:i}),this.Ke+=i,this.Xe())}}getAttachable(){return this.Je.map(e=>e.step)}clear(){this.Je=[],this.Ke=0}size(){return this.Je.length}Xe(){for(;this.Ke>this.Ne.max_bytes&&this.Je.length>0;){var e=this.Je.shift();e&&(this.Ke-=e.bytes)}}}var tZ=function(e,t){var i=(void 0===t?{}:t).debugEnabled,s={k(t){if(r&&(_.DEBUG||r.POSTHOG_DEBUG||i)&&!J(r.console)&&r.console){for(var s=("__rrweb_original__"in r.console[t])?r.console[t].__rrweb_original__:r.console[t],n=arguments.length,a=Array(n>1?n-1:0),o=1;n>o;o++)a[o-1]=arguments[o];s(e,...a)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("error",...t)},critical(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(e){s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>tZ(e+" "+t,i)};return s},t0=tZ("[PostHog.js]"),t1=t0.createLogger,t2=t1("[ExternalScriptsLoader]"),t3=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return t2.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==a?void 0:a.querySelectorAll("script");if(r){for(var s,n=0;r.length>n;n++)if(s=function(){if(r[n].src===t){var e=r[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return s.v}var o=()=>{if(!a)return i("document not found");var r=a.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,i(void 0,e)},r.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)a.head.appendChild(r);else{var s,n=a.querySelectorAll("body > script");n.length>0?null==(s=n[0].parentNode)||s.insertBefore(r,n[0]):a.body.appendChild(r)}};null!=a&&a.body?o():null==a||a.addEventListener("DOMContentLoaded",o)};g.__PosthogExtensions__=g.__PosthogExtensions__||{},g.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var r;if(e.config.strict_script_versioning)r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var s="/static/"+t+".js?v="+e.version;"toolbar"===t&&(s=s+"&t="+3e5*Math.floor(Date.now()/3e5)),r=e.requestRouter.endpointFor("assets",s)}t3(e,r,i)}else{var n=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");t3(e,n,i)}},g.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var r=e.requestRouter.endpointFor("api",t);t3(e,r,i)},_.DEBUG=!1,_.LIB_VERSION="1.413.2",_.LIB_NAME="web";
1var t5="$people_distinct_id",t6="$device_id",t4="$device_model",t8="__alias",t7="__timers",t9="$autocapture_disabled_server_side",ie="$heatmaps_enabled_server_side",it="$exception_capture_enabled_server_side",ii="$error_tracking_suppression_rules",ir="$error_tracking_capture_extension_exceptions",is="$web_vitals_enabled_server_side",ia="$dead_clicks_enabled_server_side",io="$product_tours_enabled_server_side",il="$web_vitals_allowed_metrics",iu="$session_recording_remote_config",ic="$replay_sample_rate",ih="$replay_override_sampling",id="$replay_override_linked_flag",ip="$replay_override_url_trigger",iv="$replay_override_event_trigger",ig="$sesid",i_="$session_is_sampled",im="$enabled_feature_flags",iy="$active_feature_flags",ib="$early_access_features",iw="$feature_flag_details",ix="$feature_flag_payloads",iE="$feature_flag_request_id",iS="$minimal_flag_called_events",ik="$override_feature_flags",iP="$override_feature_flag_payloads",iT="$stored_person_properties",iI="$stored_group_properties",iR="$surveys",iF="$surveys_loaded_at",i$="$surveys_activated",iO="$surveys_activated_session",iC="$surveys_activated_timestamps",iN="ph_product_tours",iM="$flag_call_reported",iA="$flag_call_reported_session_id",iL="$feature_flag_errors",iD="$feature_flag_evaluated_at",iU="$user_state",ij="$client_session_props",iB="$capture_rate_limit",iH="$initial_campaign_params",iq="$initial_referrer_info",iz="$initial_person_info",iV="$epp",iG="$posthog_cookieless",iW="$cookieless_mode",iK="$sdk_debug_extensions_init_method",iY="$sdk_debug_extensions_init_time_ms",iJ="$sdk_debug_recording_script_not_loaded",iX="PostHog loadExternalDependency extension not found.",iQ="on_reject",iZ="always",i0="anonymous",i1="identified",i2="identified_only",i3="visibilitychange",i5="beforeunload",i6="$pageview",i4="$pageleave",i8="$identify",i7="$groupidentify";function i9(e,t){G(e)&&e.forEach(t)}function re(e,t){if(!ee(e))if(G(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)z.call(e,i)&&t(e[i],i)}var rt=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];for(var s of i)for(var n in s)void 0!==s[n]&&(e[n]=s[n]);return e};function ri(e){for(var t=Object.keys(e),i=t.length,r=Array(i);i--;)r[i]=[t[i],e[t[i]]];return r}var rr=function(e){try{return e()}catch(e){return}},rs=function(e){return function(){try{for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,i)}catch(e){t0.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),t0.critical(e)}}},rn=function(e){var t={};return re(e,function(e,i){(X(e)&&e.length>0||et(e))&&(t[i]=e)}),t},ra=["herokuapp.com","vercel.app","netlify.app"];function ro(e,t,i,r){var s=null!=r?r:{},n=s.capture,a=s.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===a||a})}function rl(e){return"ph_toolbar_internal"===e.name}var ru=e=>{if(a){try{for(var t=e+"=",i=a.cookie.split(";").filter(e=>e.length),r=0;i.length>r;r++){for(var s=i[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return et(e)&&isFinite(e)&&Math.floor(e)===e});class rc{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||0>e||0>t||0>i||0>r||e>0xffffffffffff||t>4095||i>0x3fffffff||r>0xffffffff)throw RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/0x10000000000,s[1]=e/0x100000000,s[2]=e/0x1000000,s[3]=e/65536,s[4]=e/256,s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new rc(s)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new rc(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class rh{generate(){var e=this.generateOrAbort();if(!J(e))return e;this.S=0;var t=this.generateOrAbort();if(J(t))throw Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>0x3ffffffffff&&(this.S++,this.C())}return rc.fromFieldsV7(this.S,Math.trunc(this.I/0x40000000),0x3fffffff&this.I,this.A.nextUint32())}C(){this.I=1024*this.A.nextUint32()+(1023&this.A.nextUint32())}constructor(){this.S=0,this.I=0,this.A=new rf}}var rd,rp,rv,rg,r_=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};r&&!J(r.crypto)&&crypto.getRandomValues&&(r_=e=>crypto.getRandomValues(e));class rf{nextUint32(){return this.R.length>this.O||(r_(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var rm=()=>ry().toString(),ry=()=>(rg||(rg=new rh)).generate(),rb="",rw=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,rx={N:()=>!!a,j(e){t0.error("cookieStore error: "+e)},P:ru,H(e){var t;try{t=JSON.parse(rx.P(e))||{}}catch(e){}return t},F(e,t,i,r,s){if(!a)return!1;try{var n="",o="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=a),rb)return rb;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),r=Math.min(i.length,8),s="dmn_chk_"+rm();!rb&&r--;){var n=i.slice(r).join("."),o=s+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(s)&&(t.cookie=o+";max-age=0",rb=n)}return rb}(e);if(!i){var r,s=(r=e.match(rw))?r[0]:"";s!==i&&t0.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(a.location.hostname,r);
1if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),n="; expires="+u.toUTCString()}s&&(o="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&t0.warn("cookieStore warning: large cookie, len="+c.length),a.cookie=c,!0}catch(e){return!1}},q(e,t){if(null!=a&&a.cookie)try{rx.F(e,"",-1,t)}catch(e){return}}},rE=null,rS={N(){if(!Z(rE))return rE;var e=!0;if(J(r))e=!1;else try{var t="__mplssupport__";rS.F(t,"xyz"),'"xyz"'!==rS.P(t)&&(e=!1),rS.q(t)}catch(t){e=!1}return e||t0.error("localStorage unsupported; falling back to cookie store"),rE=e,e},j(e){t0.error("localStorage error: "+e)},P(e){try{return null==r?void 0:r.localStorage.getItem(e)}catch(e){rS.j(e)}return null},H(e){try{return JSON.parse(rS.P(e))||{}}catch(e){}return null},F(e,t){try{return null==r||r.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){rS.j(e)}return!1},q(e){try{null==r||r.localStorage.removeItem(e)}catch(e){rS.j(e)}}},rk=[t6,"distinct_id",ig,i_,iV,iz,iU],rP={},rT={N:()=>!0,j(e){t0.error("memoryStorage error: "+e)},P:e=>rP[e]||null,H:e=>rP[e]||null,F:(e,t)=>(rP[e]=t,!0),q(e){delete rP[e]}},rI=null,rR={N(){if(!Z(rI))return rI;if(rI=!0,J(r))rI=!1;else try{var e="__support__";rR.F(e,"xyz"),'"xyz"'!==rR.P(e)&&(rI=!1),rR.q(e)}catch(e){rI=!1}return rI},j(e){t0.error("sessionStorage error: ",e)},P(e){try{return null==r?void 0:r.sessionStorage.getItem(e)}catch(e){rR.j(e)}return null},H(e){try{return JSON.parse(rR.P(e))||null}catch(e){}return null},F(e,t){try{return null==r||r.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){rR.j(e)}return!1},q(e){try{null==r||r.sessionStorage.removeItem(e)}catch(e){rR.j(e)}}};class rF{constructor(e){this._instance=e}get Ne(){return this._instance.config}get consent(){return this.ti()?0:this.ei}isOptedOut(){return this.Ne.cookieless_mode===iZ||this.isRejected()||-1===this.consent&&this.Ne.cookieless_mode===iQ}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Ne.opt_out_capturing_by_default}optInOut(e){this.ii.F(this.ri,+!!e,this.Ne.cookie_expiration,this.Ne.cross_subdomain_cookie,this.Ne.secure_cookie)}reset(){this.ii.q(this.ri,this.Ne.cross_subdomain_cookie)}get ri(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get ei(){var e=this.ii.P(this.ri);return eh(e)?1:U(ed,e)?0:-1}get ii(){var e=this.Ne.opt_out_capturing_persistence_type,t="localStorage"===e?rS:rx;if(!this.ni||this.ni!==t){this.ni=t;var i="localStorage"===e?rx:rS;i.P(this.ri)&&(this.ni.P(this.ri)||this.optInOut(eh(i.P(this.ri))),i.q(this.ri,this.Ne.cross_subdomain_cookie))}return this.ni}ti(){return!!this.Ne.respect_dnt&&[null==n?void 0:n.doNotTrack,null==n?void 0:n.msDoNotTrack,g.doNotTrack].some(e=>eh(e))}}function r$(e,t){var i,r=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!W(r))return t;try{var s=r(t);return X(s)&&s?s:t}catch(e){return t0.error("Error in get_current_url, falling back to window.location.href",e),t}}var rO="__POSTHOG_TOOLBAR__";function rC(e){return e instanceof Element&&(e.id===rO||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function rN(e){return!!e&&1===e.nodeType}function rM(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function rA(e){return!!e&&3===e.nodeType}function rL(e){return!!e&&11===e.nodeType&&rN(e.host)}function rD(e){return e?j(e).split(/\s+/):[]}function rU(e,t){var i,s,n=J(s=null==r||null==(i=r.location)?void 0:i.href)?void 0:r$(t,s);return!!(n&&e&&e.some(e=>n.match(e)))}function rj(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return rD(t)}function rB(e){return ee(e)?null:j(e).split(/(\s+)/).filter(e=>se(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function rH(e){var t="";return r2(e)&&!r3(e)&&e.childNodes&&e.childNodes.length&&re(e.childNodes,function(e){var i;rA(e)&&e.textContent&&(t+=null!=(i=rB(e.textContent))?i:"")}),j(t)}function rq(e){var t;return J(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var rz=["a","button","form","input","select","textarea","label"];function rV(e,t){if(J(t))return!0;var i,r=function(e){if(t.some(t=>(function(e,t){var i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch(e){return!1}})(e,t)))return{v:!0}};for(var s of e)if(i=r(s))return i.v;return!1}function rG(e){var t=e.parentNode;return!(!t||!rN(t))&&t}var rW=[".ph-no-autocapture","[data-ph-no-autocapture]"],rK=["next","previous","prev",">","<"],rY=[...rK,"+","-","−","–"],rJ=(e,t)=>
1/[a-z0-9]/i.test(t)?e.includes(t):e===t,rX=[".ph-no-rageclick",".ph-no-capture"],rQ=["","text","search","email","password","url","tel","number"];function rZ(e,t){if(!r||r0(e)||(er(t)?(s=!!t&&rX,n=void 0,a=!1):(s=null!=(o=null==t?void 0:t.css_selector_ignorelist)?o:rX,n=null==t?void 0:t.content_ignorelist,a=null!=(l=null==t?void 0:t.ignore_text_selection)&&l),!1===s)||a&&!(!(i=e)||!rN(i))&&(rM(i,"textarea")||(rM(i,"input")?U(rQ,(i.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(i))))return!1;var i,s,n,a,o,l,u=r1(e,!1).targetElementList;return!function(e,t){var i;if(!1===e||J(e))return!1;if(!0===e)i=rK;else{if(!G(e))return!1;if(e.length>10)return t0.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var t=e.safeText,r=e.ariaLabel;return i.some(e=>rJ(t,e)||rJ(r,e))})}(n,u.map(e=>{var t;return{safeText:rH(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!rV(u,s)}var r0=e=>!e||rM(e,"html")||!rN(e),r1=(e,t)=>{if(!r||r0(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],n=e;n.parentNode&&!rM(n,"body");)if(rL(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var a=rG(n);if(!a)break;if(t||rz.indexOf(a.tagName.toLowerCase())>-1)i=!0;else try{var o=r.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(e){}s.push(a),n=a}return{parentIsUsefulElement:i,targetElementList:s}};function r2(e){for(var t=new Set,i=0,r=e;r.parentNode&&!rM(r,"body");r=r.parentNode){if(i++>=1e3||t.has(r))return!1;t.add(r);var s=rj(r);if(U(s,"ph-sensitive")||U(s,"ph-no-capture"))return!1}if(U(rj(e),"ph-include"))return!0;var n=e.type||"";if(X(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var a=e.name||e.id||"";return!X(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 r3(e){return!!(rM(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||rM(e,"select")||rM(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var r5=RegExp("^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$"),r6=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,r4=[16,15,14,13],r8=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),r7=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),r9=/[0-9A-Za-z_]/;function se(e,t){return void 0===t&&(t=!0),!(ee(e)||X(e)&&(e=j(e),(t?r5.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(r6.lastIndex=0;t=r6.exec(e);){var i=t[2];if(i)for(var r=i.replace(/[- ]/g,""),s=0;r.length>s;s++)for(var n of r4){var a=s+n;if(r.length>=a){var o=r.slice(s,a);if(r5.test(o)&&function(e){for(var t=0,i=!1,r=e.length-1;r>=0;r--){var s=e.charCodeAt(r)-48;i&&(s*=2)>9&&(s-=9),t+=s,i=!i}return t%10==0}(o))return!0}}}return!1}(e))||(t?r8.test(e):function(e){var t;for(r7.lastIndex=0;t=r7.exec(e);){var i=t[1],r=t[3];if(!(i&&r&&r9.test(i)&&r9.test(r)))return!0}return!1}(e))))&&!0}function st(e){var t=rH(e);return se(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&re(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var s=rH(t);i=(i+" "+s).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){t0.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function si(e){return e.replace(/"|\\"/g,'\\"')}var sr=t1("[Dead Clicks]"),ss=()=>!0,sn=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(ia)),r=e.instance.config.capture_dead_clicks;return er(r)?r:!!K(r)||i};class sa{get lazyLoadedDeadClicksAutocapture(){return this.si}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[ia]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.ai(()=>{this.oi()}):this.stop()}ai(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?sr.error("failed to load script",t):e()})}oi(){var e;if(a){if(!this.si&&null!=(e=g.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=K(this.instance.config.capture_dead_clicks)?y({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.si=g.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.si.start(a),sr.
1info("starting...")}}else sr.error("`document` not found. Cannot start.")}stop(){this.si&&(this.si.stop(),this.si=void 0,sr.info("stopping..."))}}var so=t1("[SegmentIntegration]"),sl="posthog-js";function su(e,t){var i=void 0===t?{}:t,r=i.organization,s=i.projectId,n=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,u=void 0===l||l;return t=>{if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var i=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=i,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var a,l,c,h,d,p,v=(null==(a=t.exception)?void 0:a.values)||[],g=v.map(e=>y({},e,{stacktrace:e.stacktrace?y({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>y({},e,{platform:"web:javascript"}))}):void 0})),_={$exception_message:(null==(l=v[0])?void 0:l.value)||t.message,$exception_type:null==(c=v[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(h=v[0])?void 0:h.value)||t.message,$sentry_exception_type:null==(d=v[0])?void 0:d.type,$sentry_tags:t.tags};return r&&s&&(_.$sentry_url=(n||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+t.event_id),u&&(null==(p=e.exceptions)||p.sendExceptionEvent(_)),t}}class sc{constructor(e,t,i,r,s,n){this.name=sl,this.setupOnce=function(a){a(su(e,{organization:t,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class sh{constructor(e){this.li=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(t0.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.ui=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.hi()}hi(){var e;this.di=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.li)}destroy(){var e;null==(e=this.di)||e.call(this),this.di=void 0}doPageView(e,t){var i,s=this.vi(e,t);return this.ui={pathname:null!=(i=null==r?void 0:r.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.vi(e,null==(t=this.ui)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ui)?void 0:e.pageViewId}}vi(e,t){var i=this.ui;if(!i)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var n=s.maxScrollHeight,a=s.lastScrollY,o=s.maxScrollY,l=s.maxContentHeight,u=s.lastContentY,c=s.maxContentY;if(!(J(n)||J(a)||J(o)||J(l)||J(u)||J(c))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var h=n>1?ep(a/n,0,1,t0):1,d=n>1?ep(o/n,0,1,t0):1,p=l>1?ep(u/l,0,1,t0):1,v=l>1?ep(c/l,0,1,t0):1;r=rt(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:v})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var sd=["flags","surveys"],sp={[t5]:{exposure:"hidden"},[t8]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[t7]:{exposure:"hidden"},[t9]:{exposure:"event"},[ie]:{exposure:"hidden"},[it]:{exposure:"event"},[ii]:{exposure:"hidden"},[ir]:{exposure:"event"},[is]:{exposure:"event"},[ia]:{exposure:"event"},[io]:{exposure:"hidden"},[il]:{exposure:"event"},[iu]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ig]:{exposure:"hidden"},[i_]:{exposure:"event"},[ic]:{exposure:"event",shouldSkipFromEventProperties:e=>Z(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[im]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!K(e))return{};for(var t={},i=Object.keys(e),r=0;i.length>r;r++)t["$feature/"+i[r]]=e[i[r]];return t}},[iy]:{exposure:"event",storageGroup:"flags"},[ib]:{exposure:"hidden"},[iw]:{exposure:"hidden",storageGroup:"flags"},[ix]:{exposure:"event",storageGroup:"flags"},[iE]:{exposure:"event",storageGroup:"flags",volatile:!0},[iS]:{exposure:"hidden",storageGroup:"flags"},[ik]:{exposure:"event"},[iP]:{exposure:"hidden"},[iT]:{exposure:"hidden"},[iI]:{exposure:"hidden"},[iR]:{exposure:"hidden",storageGroup:"surveys"}
1,[iF]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[i$]:{exposure:"event"},[iO]:{exposure:"hidden"},[iC]:{exposure:"hidden"},[iN]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[iM]:{exposure:"hidden"},[iA]:{exposure:"hidden"},[iL]:{exposure:"hidden"},[iD]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iU]:{exposure:"hidden"},[ij]:{exposure:"hidden"},[iB]:{exposure:"hidden"},[iH]:{exposure:"hidden"},[iq]:{exposure:"hidden"},[iz]:{exposure:"hidden"},[iV]:{exposure:"hidden"},[ih]:{exposure:"event"},[id]:{exposure:"event"},[ip]:{exposure:"event"},[iv]:{exposure:"event"},[iK]:{exposure:"event"},[iY]:{exposure:"event"},[iJ]:{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"}},sv=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],sg=e=>{var t=sp[e];if(t)return t;for(var i of sv){var r=i[1];if(0===e.indexOf(i[0]))return r}},s_=(e,t)=>{try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t)}catch(t){return H(e)}},sf=e=>{var t=null==a?void 0:a.createElement("a");return J(t)?null:(t.href=e,t)},sm=function(e,t){for(var i,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var n=r[s].split("=");if(n[0]===t){i=n;break}}if(!G(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){t0.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},sy=function(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[1],n=(r[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],c=0;l.length>c;c++){var h=l[c].split("=");G(h)&&(t.includes(h[0])?u.push(h[0]+"="+i):u.push(l[c]))}var d=o;return null!=a&&(d+="?"+u.join("&")),null!=s&&(d+="#"+s),d},sb=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},sw=(e,t)=>e>=t&&p(),sx=(e,t,i,r)=>{if(0===e){if(p()){var s=t+1;return s===i&&r(),s}return t}return 0},sE="https?://(.*)",sS=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],sk=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...sS],sP="<masked>",sT=["li_fat_id"];function sI(e,t,i){if(!a)return{};var r,s=t?[...sS,...i||[]]:[],n=sR(sy(a.URL,s,sP),e);return rt((r={},re(sT,function(e){var t=ru(e);r[e]=t||null}),r),n)}function sR(e,t){var i=sk.concat(t||[]),r={};return re(i,function(t){var i=sm(e,t);r[t]=i||null}),r}function sF(e){var t=e?0===e.search(sE+"google.([^/?]*)")?"google":0===e.search(sE+"bing.com")?"bing":0===e.search(sE+"yahoo.com")?"yahoo":0===e.search(sE+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!Z(t)){i.$search_engine=t;var r=a?sm(a.referrer,"yahoo"!=t?"q":"p"):"";r.length&&(i.ph_keyword=r)}return i}function s$(){return navigator.language||navigator.userLanguage}var sO="$direct";function sC(){return(null==a?void 0:a.referrer)||sO}function sN(e,t,i){void 0===i&&(i=!1);var r=e?[...sS,...t||[]]:[],s=i?tc(null==o?void 0:o.href):null==o?void 0:o.href,n=null==s?void 0:s.substring(0,1e3);return{r:sC().substring(0,1e3),u:n?sy(n,r,sP):void 0}}function sM(e,t){void 0===t&&(t=!1);var i,r=e.r,s=e.u,n=t?tc(s):s,a={$referrer:r,$referring_domain:null==r?void 0:r==sO?sO:null==(i=sf(r))?void 0:i.host};
1if(n){a.$current_url=n;var o=sf(n);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname,rt(a,sR(n))}return r&&rt(a,sF(r)),a}function sA(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var sL={flags:iD,surveys:iF},sD=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],sU="main";class sj{constructor(e,t,i){if(void 0===i&&(i=!0),this.ci={},this.fi=!1,this.pi=!1,this.Ne=e,this.gi=i,this.props={},this.mi=void 0,this.yi=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.ii=this.bi(e),this.pi=this.wi(e),this.load(),e.debug&&t0.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save(),r){var s=()=>this.flush();ro(r,"beforeunload",s,{capture:!1}),ro(r,"pagehide",s,{capture:!1})}}ki(){var e,t=null==(e=this.Ne)?void 0:e.persistence_save_debounce_ms;return et(t)&&t>0?t:0}isDisabled(){return!!this.xi}bi(e){-1===sD.indexOf(e.persistence.toLowerCase())&&(t0.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,s,n,a=(t=e.cookie_persisted_properties||[],i=e.__preview_cookie_wins_on_conflict||!1,void 0===t&&(t=[]),void 0===i&&(i=!1),s=[...rk,...t],y({},rS,{H(e){try{var t={};try{t=rx.H(e)||{}}catch(e){}var r,s=JSON.parse(rS.P(e)||"{}");if(i){var n={};for(var a in t){var o=t[a];Z(o)||""===o||(n[a]=o)}r=rt(s,n)}else r=rt(t,s);return rS.F(e,r),r}catch(e){}return null},F(e,t,i,r,n,a){var o=rS.F(e,t,void 0,void 0,a);try{var l={};s.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&rx.F(e,l,i,r,n,a)}catch(e){rS.j(e)}return o},q(e,t){try{null==r||r.localStorage.removeItem(e),rx.q(e,t)}catch(e){rS.j(e)}}})),o=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&rS.N()?(n=rS,o=!0):"localstorage+cookie"===l&&a.N()?(n=a,o=!0):"sessionstorage"===l&&rR.N()?n=rR:"memory"===l?n=rT:"cookie"===l?n=rx:a.N()?(n=a,o=!0):n=rx,this.fi=o,n}Si(e){return this.yi+"__"+e}wi(e){return this.fi&&!!e.split_storage}Ci(e){var t=null!=e?e:this.Ne.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var i=this.props[iD];return!i||"number"!=typeof i||Date.now()-i>t}properties(){var e={};return re(this.props,(t,i)=>{var r=sg(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t,i===im?()=>this.Ci():()=>!1))return;r.transformToEventProperties&&rt(e,r.transformToEventProperties(t))}else if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t,()=>!1))return;e[i]=t}}),e}load(){if(!this.xi){var e=this.ii.H(this.yi);e&&(this.props=rt({},e)),this.pi&&this.Mi()}}Mi(){for(var e of sd){var t=rS.H(this.Si(e));if(t&&!Y(t)){var i=this.Ti(e);i.persisted=!0,this.Ei(e)||(i.fingerprint=this.Ii(t,e)),this.Pi(e,t)||rt(this.props,t)}}}Ei(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=sg(t))?void 0:i.storageGroup)===e})}Pi(e,t){var i=sL[e];if(!i)return!1;var r=t[i],s=this.props[i];return et(r)&&et(s)&&s>r}refreshKey(e){var t;if(!this.xi){var i=this.pi?null==(t=sg(e))?void 0:t.storageGroup:void 0,r=i?rS.H(this.Si(i)):this.ii.H(this.yi);if(r&&e in r)this.Ri(e,r[e]);else{if(i){var s=this.ii.H(this.yi);if(s&&e in s)return void this.Ri(e,s[e])}this.Ai(e)}}}save(){if(!this.xi){var e=this.ki();e>0?J(this.Fi)&&(this.Fi=setTimeout(()=>{this.Fi=void 0,this.Li()},e)):this.Li()}}flush(){J(this.Fi)||(clearTimeout(this.Fi),this.Fi=void 0,this.Li())}Li(){this.xi||(this.pi?this.Oi():this.Di(this.ii,this.yi,this.props,sU))}Oi(){var e=this.$i(),t=e.main,i=e.groups;for(var r of(this.Di(this.ii,this.yi,t,sU),sd)){var s,n=i[r];(!Y(n)||null!=(s=this.ci[r])&&s.persisted)&&this.Di(rS,this.Si(r),n,r)}}$i(){var e={},t={flags:{},surveys:{}};return re(this.props,(i,r)=>{var s,n=null==(s=sg(r))?void 0:s.storageGroup;n?t[n][r]=i:e[r]=i}),{main:e,groups:t}}Ii(e,t){if(t===sU)return JSON.stringify(e)+"|"+this.Ni+"|"+this.qi+"|"+this.ji;var i={};return re(e,(e,t)=>{var r;i[t]=null!=(r=sg(t))&&r.volatile?"__volatile__":e}),JSON.stringify(i)}Di(e,t,i,r){var s,n=this.Ti(r);if(r===sU||n.dirty||J(n.fingerprint)){try{if((s=this.Ii(i,r))===n.fingerprint)return void(n.dirty=!1)}catch(e){s=void 0}e.F(t,i,this.Ni,this.qi,this.ji,this.Ne.debug)?(n.dirty=!1,r!==sU&&(n.persisted=!0),J(s)||(n.fingerprint=s)):this.Ne.debug&&t0.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(J(this.Fi)||(clearTimeout(this.Fi),this.Fi=void 0),this.ii.q(this.yi,!1),this.ii.q(this.yi,!0),!i&&this.gi)for(var r of sd)rS.q(this.Si(r));i?delete this.ci[sU]:this.ci={}}clear(){this.remove(),this.props={}}register_once(e,t,i){if(K(e)){J(t)&&(t="None"),this.Ni=J(i)?this.Bi:i;var r=!1;if(re(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Ri(i,e),r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(K(e)){this.Ni=J(t)?this.Bi:t;var i=!1;if(re(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.Ri(r,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Ai(e),this.save())}update_campaign_params(){var e=null==a?void 0:a.URL;if(e!==this.mi){var t=sI(this.Ne.custom_campaign_params,this.Ne.mask_personal_data_properties,this.Ne.custom_personal_data_properties);Y(rn(t))||this.register(t),this.mi=e}}update_search_keyword(){var e;this.register((e=null==a?void 0:a.referrer)?sF(e):{})}update_referrer_info(){var e;this.register_once({$referrer:sC(),$referring_domain:null!=a&&a.referrer&&(null==(e=sf(a.referrer))?void 0:e.host)||sO},void 0)}set_initial_person_info(){this.props[iH]||this.props[iq]||this.register_once({[iz]:sN(this.Ne.mask_personal_data_properties,this.Ne.custom_personal_data_properties,this.Ne.disable_capture_url_hashes
1)},void 0)}get_initial_props(){var e,t,i,r={};re([iq,iH],e=>{var t=this.props[e];t&&re(t,function(e,t){r["$initial_"+B(t)]=e})});var s=this.props[iz];return s&&rt(r,(void 0===(e=this.Ne.disable_capture_url_hashes)&&(e=!1),t=sM(s,e),i={},re(t,function(e,t){i["$initial_"+B(t)]=e}),i)),r}safe_merge(e){return re(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){this.Bi=this.Ni=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var r=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),r=[...t].sort();return i.every((e,t)=>e===r[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),s=r?this.bi(e):this.ii,n=this.wi(e);if(r||n!==this.pi){var a=this.props;this.clear(),this.ii=s,this.pi=n,this.props=a,this.save()}}set_disabled(e){this.xi=e,this.xi?this.remove():this.save()}set_cross_subdomain(e){e!==this.qi&&(this.qi=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ji&&(this.ji=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[t7]||{};i[e]=t,this.Ri(t7,i),this.save()}remove_event_timer(e){var t=this.props[t7]||{},i=t[e];return J(i)||(delete t[e],this.Ri(t7,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Ri(e,t),this.save()}Ri(e,t){var i;this.props[e]=t,null!=(i=sg(e))&&i.volatile||this.Hi(e)}Ai(e){delete this.props[e],this.Hi(e)}Hi(e){var t,i=null==(t=sg(e))?void 0:t.storageGroup;i&&(this.Ti(i).dirty=!0)}Ti(e){return this.ci[e]||(this.ci[e]={})}}function sB(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&W(i.then)&&i.then(void 0,()=>{})}}}}var sH={GZipJS:"gzip-js",Base64:"base64"},sq={Activation:"events",Cancellation:"cancelEvents"},sz={Button:"button",Tab:"tab",Selector:"selector"},sV={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},sG={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},sW={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},sK={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},sY={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},sJ={Once:"once",Recurring:"recurring",Always:"always"},sX={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},sQ={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},sZ={Popover:"popover",Inline:"inline"},s0={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:0x7ffffffe},s1={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},s2={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},s3=t1("[RateLimiter]");class s5{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;
1if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{s3.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void s3.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,r,s=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,a=(new Date).getTime(),o=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(iB))?t:{tokens:s,last:a};o.tokens+=(a-o.last)/1e3*n,o.last=a,o.tokens>s&&(o.tokens=s);var l=1>o.tokens;if(l||e||(o.tokens=Math.max(0,o.tokens-1)),l&&!e){var u=(et(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.Ui(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(iB,o),{isRateLimited:l,remainingTokens:o.tokens}}zi(e){var t=this.instance.config.property_denylist;return!G(t)||!t.includes(e)}Wi(){var e;if(this.zi("$current_url")&&this.zi("$pathname")&&null!=o&&o.pathname)return""+(null!=(e=o.origin)?e:"")+o.pathname}Ui(e){var t,i,r=this.captureEventsBurstLimit,s=this.captureEventsPerSecond,n=this.Wi(),a=this.zi("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,o=[e+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". Config is set to "+s+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var s6=t1("[RemoteConfig]");class s4{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Vi(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Zi(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return s6.info("Using preloaded remote config",this.remoteConfig),this.Gi(this.remoteConfig),void this.Qi();if(this._instance.Ji())return void s6.warn("Remote config is disabled. Falling back to local config.");this.Vi(e=>{if(!e)return s6.info("No config found after loading remote JS config. Falling back to JSON."),void this.Zi(e=>{this.Gi(e.json,e),this.Qi()});this.Gi(e),this.Qi()})}catch(e){s6.error("Error loading remote config",e),this.Gi()}}stop(){this.Ki&&(clearInterval(this.Ki),this.Ki=void 0)}refresh(){!this._instance.Ji()&&a&&"hidden"!==a.visibilityState&&this._instance.reloadFeatureFlags()}Qi(){var e;if(!this.Ki){var t=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==t&&(this.Ki=setInterval(()=>{this.refresh()},t))}}Gi(e,t){!e&&t&&(0===t.statusCode?t.error||s6.warn("Failed to fetch remote config from PostHog."):s6.error("Failed to fetch remote config from PostHog."));try{this._instance.Gi(e?{ok:!0,config:e}:{ok:!1})}catch(e){s6.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){s6.error("Error loading feature flags",e)}}}var s8=["fatal","error","warning","log","info","debug"],s7=Uint8Array,s9=Uint16Array,ne=Uint32Array,nt=new s7([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]),ni=new s7([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]),nr=new s7([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ns=function(e,t){for(var i=new s9(31),r=0;31>r;++r)i[r]=t+=1<<e[r-1];var s=new ne(i[30]);for(r=1;30>r;++r)for(var n=i[r];i[r+1]>n;++n)s[n]=n-i[r]<<5|r;return[i,s]},nn=ns(nt,2),na=nn[1];nn[0][28]=258,na[258]=28;for(var no=ns(ni,0)[1],nl=new s9(32768),nu=0;32768>nu;++nu){var nc=(43690&nu)>>>1|(21845&nu)<<1;nl[nu]=((65280&(nc=(61680&(nc=(52428&nc)>>>2|(13107&nc)<<2))>>>4|(3855&nc)<<4))>>>8|(255&nc)<<8)>>>1}var nh=function(e,t,i){for(var r=e.length,s=0,n=new s9(t);r>s;++s)++n[e[s]-1];var a,o=new s9(t);for(s=0;t>s;++s)o[s]=o[s-1]+n[s-1]<<1;if(i){a=new s9(1<<t);var l=15-t;for(s=0;r>s;++s)if(e[s])for(var u=s<<4|e[s],c=t-e[s],h=o[e[s]-1]++<<c,d=h|(1<<c)-1;d>=h;++h)a[nl[h]>>>l]=u}else for(a=new s9(r),s=0;r>s;++s)a[s]=nl[o[e[s]-1]++]>>>15-e[s];return a},nd=new s7(288);for(nu=0;144>nu;++nu)nd[nu]=8;for(nu=144;256>nu;++nu)nd[nu]=9;for(nu=256;280>nu;++nu)nd[nu]=7;for(nu=280;288>nu;++nu)nd[nu]=8;var np=new s7(32);for(nu=0;32>nu;
vendor: 4,235 bytes, line 1
1++nu)np[nu]=5;var nv=nh(nd,9,0),ng=nh(np,5,0),n_=function(e){return(e/8|0)+(7&e&&1)},nf=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof s9?s9:e instanceof ne?ne:s7)(i-t);return r.set(e.subarray(t,i)),r},nm=function(e,t,i){var r=t/8|0;e[r]|=i<<=7&t,e[r+1]|=i>>>8},ny=function(e,t,i){var r=t/8|0;e[r]|=i<<=7&t,e[r+1]|=i>>>8,e[r+2]|=i>>>16},nb=function(e,t){for(var i=[],r=0;e.length>r;++r)e[r]&&i.push({s:r,f:e[r]});var s=i.length,n=i.slice();if(!s)return[new s7(0),0];if(1==s){var a=new s7(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,c=1,h=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=s-1;)o=i[i[h].f>i[u].f?u++:h++],l=i[u!=c&&i[h].f>i[u].f?u++:h++],i[c++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(r=1;s>r;++r)n[r].s>d&&(d=n[r].s);var p=new s9(d+1),v=nw(i[c-1],p,0);if(v>t){r=0;var g=0,_=v-t,f=1<<_;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s>r;++r){var m=n[r].s;if(t>=p[m])break;g+=f-(1<<v-p[m]),p[m]=t}for(g>>>=_;g>0;){var y=n[r].s;t>p[y]?g-=1<<t-p[y]++-1:++r}for(;r>=0&&g;--r){var b=n[r].s;p[b]==t&&(--p[b],++g)}v=t}return[new s7(p),v]},nw=function(e,t,i){return -1==e.s?Math.max(nw(e.l,t,i+1),nw(e.r,t,i+1)):t[e.s]=i},nx=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new s9(++t),r=0,s=e[0],n=1,a=function(e){i[r++]=e},o=1;t>=o;++o)if(e[o]==s&&o!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=e[o]}return[i.subarray(0,r),t]},nE=function(e,t){for(var i=0,r=0;t.length>r;++r)i+=e[r]*t[r];return i},nS=function(e,t,i){var r=i.length,s=n_(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var n=0;r>n;++n)e[s+n+4]=i[n];return 8*(s+4+r)},nk=function(e,t,i,r,s,n,a,o,l,u,c){nm(t,c++,i),++s[256];for(var h=nb(s,15),d=h[0],p=h[1],v=nb(n,15),g=v[0],_=v[1],f=nx(d),m=f[0],y=f[1],b=nx(g),w=b[0],x=b[1],E=new s9(19),S=0;m.length>S;++S)E[31&m[S]]++;for(S=0;w.length>S;++S)E[31&w[S]]++;for(var k=nb(E,7),P=k[0],T=k[1],I=19;I>4&&!P[nr[I-1]];--I);var R,F,$,O,C=u+5<<3,N=nE(s,nd)+nE(n,np)+a,M=nE(s,d)+nE(n,g)+a+14+3*I+nE(E,P)+(2*E[16]+3*E[17]+7*E[18]);if(N>=C&&M>=C)return nS(t,c,e.subarray(l,l+u));if(nm(t,c,1+(N>M)),c+=2,N>M){R=nh(d,p,0),F=d,$=nh(g,_,0),O=g;var A=nh(P,T,0);for(nm(t,c,y-257),nm(t,c+5,x-1),nm(t,c+10,I-4),c+=14,S=0;I>S;++S)nm(t,c+3*S,P[nr[S]]);c+=3*I;for(var L=[m,w],D=0;2>D;++D){var U=L[D];for(S=0;U.length>S;++S)nm(t,c,A[j=31&U[S]]),c+=P[j],j>15&&(nm(t,c,U[S]>>>5&127),c+=U[S]>>>12)}}else R=nv,F=nd,$=ng,O=np;for(S=0;o>S;++S)if(r[S]>255){ny(t,c,R[257+(j=r[S]>>>18&31)]),c+=F[j+257],j>7&&(nm(t,c,r[S]>>>23&31),c+=nt[j]);var j,B=31&r[S];ny(t,c,$[B]),c+=O[B],B>3&&(ny(t,c,r[S]>>>5&8191),c+=ni[B])}else ny(t,c,R[r[S]]),c+=F[r[S]];return ny(t,c,R[256]),c+F[256]},nP=new ne([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nT=function(){for(var e=new ne(256),t=0;256>t;++t){for(var i=t,r=9;--r;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),nI=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},nR=!!u||!!l,nF="text/plain",n$=!1,nO=(e,t)=>{var i=e.split("#"),r=i[1],s=i[0].split("?"),n=s[0],a=s[1];if(!a)return e;var o=a.split("&").filter(e=>e.split("=")[0]!==t).join("&");return n+(o?"?"+o:"")+(r?"#"+r:"")},nC=function(e,t,i){void 0===i&&(i=!0);var r,s,n,a,o,l=e.split("?"),u=l[0],c=l[1],h=y({},t),d=null!=(o=null==c?void 0:c.split("&").map(e=>{var t,r=e.split("="),s=r[0],n=i&&null!=(t=h[s])?t:r[1];return delete h[s],s+"="+n}))?o:[],p=(void 0===r&&(r="&"),a=[],re(h,function(e,t){J(e)||J(t)||"undefined"===t||(s=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+s)}),a.join(r));return p&&d.push(p),d.length>0?u+"?"+d.join("&"):u},nN=e=>{if(e.Yi)return e.Yi;var t=e.data,i=e.compression;if(t){if(i===sH.GZipJS){var r=function(e,t){void 0===t&&(t={});var i=(s=0xffffffff,{p(e){for(var t=s,i=0;e.length>i;++i)t=nT[255&t^e[i]]^t>>>8;s=t},d:()=>0xffffffff^s}),r=e.length;i.p(e);var s,n,a,o,l=(o=10+((n=t).filename&&n.filename.length+1||0),function(e,t,i,r,s,n){var a=e.length,o=new s7(r+a+5*(1+Math.floor(a/7e3))+8),l=o.subarray(r,o.length-8),u=0;if(!t||8>a)for(var c=0;a>=c;c+=65535){var h=c+65535;a>
1h?u=nS(l,u,e.subarray(c,h)):(l[c]=!0,u=nS(l,u,e.subarray(c,a)))}else{for(var d=nP[t-1],p=d>>>13,v=8191&d,g=(1<<i)-1,_=new s9(32768),f=new s9(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new ne(25e3),x=new s9(288),E=new s9(32),S=0,k=0,P=(c=0,0),T=0,I=0;a>c;++c){var R=b(c),F=32767&c,$=f[R];if(_[F]=$,f[R]=F,c>=T){var O=a-c;if((S>7e3||P>24576)&&O>423){u=nk(e,l,0,w,x,E,k,P,I,c-I,u),P=S=k=0,I=c;for(var C=0;286>C;++C)x[C]=0;for(C=0;30>C;++C)E[C]=0}var N=2,M=0,A=v,L=F-$&32767;if(O>2&&R==b(c-L))for(var D=Math.min(p,O)-1,U=Math.min(32767,c),j=Math.min(258,O);U>=L&&--A&&F!=$;){if(e[c+N]==e[c+N-L]){for(var B=0;j>B&&e[c+B]==e[c+B-L];++B);if(B>N){if(N=B,M=L,B>D)break;var H=Math.min(L,B-2),q=0;for(C=0;H>C;++C){var z=c-L+C+32768&32767,V=z-_[z]+32768&32767;V>q&&(q=V,$=z)}}}L+=(F=$)-($=_[F])+32768&32767}if(M){w[P++]=0x10000000|na[N]<<18|no[M];var G=31&na[N],W=31&no[M];k+=nt[G]+ni[W],++x[257+G],++E[W],T=c+N,++S}else w[P++]=e[c],++x[e[c]]}}u=nk(e,l,!0,w,x,E,k,P,I,c-I,u)}return nf(o,0,r+n_(u)+s)}(e,null==(a=t).level?6:a.level,null==a.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+a.mem,o,8)),u=l.length;return function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&nI(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;i.length>=r;++r)e[r+10]=i.charCodeAt(r)}}(l,t),nI(l,u-8,i.d()),nI(l,u-4,r),l}(function(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new s7(e.length+(e.length>>>1)),s=0,n=function(e){r[s++]=e},a=0;i>a;++a){if(s+5>r.length){var o=new s7(s+8+(i-a<<1));o.set(r),r=o}var l=e.charCodeAt(a);128>l?n(l):(2048>l?n(192|l>>>6):(l>55295&&57344>l?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return nf(r,0,s)}(s_(t)),{mtime:0});return{contentType:nF,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===sH.Base64){var s=(e=>"data="+encodeURIComponent("string"==typeof e?e:s_(e)))(function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):e}(s_(t)));return{contentType:"application/x-www-form-urlencoded",body:s,estimatedSize:new Blob([s]).size}}var n=s_(t);return{contentType:"application/json",body:n,estimatedSize:new Blob([n]).size}}},nM=e=>{var t,i,r=()=>"sendBeacon"===e.transport?{url:nC(e.url,{compression:sH.Base64}),encodedBody:nN(y({},e,{compression:sH.Base64,Yi:void 0}))}:{url:nO(e.url,"compression"),encodedBody:nN(y({},e,{compression:void 0,Yi:void 0}))};try{t=nN(e)}catch(t){if(O(e.compression,sm(e.url,"compression")))return t0.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return!(t&&O(e.compression,sm(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?$(new Uint8Array(i)):ArrayBuffer.isView(i)&&$(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(n$=!0,r())},nA=e=>{try{return nM(e)}catch(t){return t0.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},nL=function(){var e=m(function*(e){var t=s_(e.data),i=yield function(e,t,i){return A.apply(this,arguments)}(t,_.DEBUG,{rethrow:!0});if(!i)return e;var r=yield i.arrayBuffer();return y({},e,{Yi:{contentType:nF,body:r,estimatedSize:r.byteLength}})});return function(t){return e.apply(this,arguments)}}(),nD=/Failed to fetch|NetworkError|Load failed/i,nU=e=>"TypeError"===(null==e?void 0:e.name)&&nD.test((null==e?void 0:e.message)||""),nj=e=>{var t=nA(e);if(t){var i,r=t.url,s=t.encodedBody,n=null!=s?s:{},a=n.contentType,o=n.body,u=n.estimatedSize,h=new Headers;re(e.headers,function(e,t){h.append(t,e)}),a&&h.append("Content-Type",a);var d=null,p=!1;if(c){var v=new c;d={signal:v.signal,timeout:setTimeout(()=>{var t,i;p=!0,v.abort(((i=Error("PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":""))).name="AbortError",i))},e.timeout)}}var g=t=>{p&&"AbortError"===(null==t?void 0:t.name)||nU(t)?t0.warn(t):t0.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{l(r,y({method:(null==e?void 0:e.method)||"GET",headers:h,keepalive:"POST"===e.method&&!e.Xi&&52428.8>(u||0),body:o,signal:null==(i=d)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var r={statusCode:t.status,text:i};if(200===t.status)try{r.json=JSON.parse(i)}catch(e){t0.error(e)}null==e.callback||e.callback(r)}
1)).catch(g).finally(()=>d?clearTimeout(d.timeout):null)}catch(e){d&&clearTimeout(d.timeout),g(e)}}},nB=e=>{try{var t,i=nM(e),r=i.url,s=i.encodedBody,a=null!=s?s:{},o=a.body,l=a.estimatedSize;if(!o)return;var u=o instanceof Blob?o:new Blob([o],{type:a.contentType});if(n.sendBeacon(r,u))return;var c=G(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(G(c)&&c.length>1&&(null!=l?l:0)>16384){var h=Math.ceil(c.length/2),d=t=>G(e.data)?t:y({},e.data,{batch:t});return nB(y({},e,{data:d(c.slice(0,h))})),void nB(y({},e,{data:d(c.slice(h))}))}t0.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),nj(y({},e,{Xi:!0}))}catch(e){t0.warn("Beacon send failed",e)}},nH=(e,t,i,r)=>{var s="query"===r?"POST"===t?"sent_at":"_":void 0;return nC(i===sH.GZipJS?nO(e,"compression"):e,y({},s?{[s]:Date.now().toString()}:{},i===sH.GZipJS?{}:{compression:i}))},nq=[];l&&nq.push({transport:"fetch",method:nj}),u&&nq.push({transport:"XHR",method(e){var t=nA(e);if(t){var i=new u,r=t.encodedBody;i.open(e.method||"GET",t.url,!0);var s=null!=r?r:{},n=s.contentType,a=s.body;re(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(a)}}}),null!=n&&n.sendBeacon&&nq.push({transport:"sendBeacon",method:nB});class nz{constructor(e,t){this.tr=!0,this.er=[],this.ir=ep((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,t0.createLogger("flush interval"),3e3),this.rr=e}enqueue(e){this.er.push(e),this.nr||this.sr()}unload(){this.ar();var e=Object.values(this.er.length>0?this.lr():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.ur(y({},e,{transport:"sendBeacon"}))})}enable(){this.tr=!1,this.sr()}sr(){var e=this;this.tr||(this.nr=setTimeout(()=>{if(this.ar(),this.er.length>0){var t=this.lr();for(var i in t)!function(){var r=t[i],s=(new Date).getTime();r.data&&G(r.data)&&re(r.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),e.ur(r)}()}},this.ir))}ur(e){try{this.rr(e)}catch(e){t0.error(e)}}ar(){clearTimeout(this.nr),this.nr=void 0}lr(){var e={};return re(this.er,t=>{var i,r=(t?t.batchKey:null)||t.url;J(e[r])&&(e[r]=y({},t,{data:[]})),null==(i=e[r].data)||i.push(t.data)}),this.er=[],e}}var nV=["retriesPerformedSoFar"];class nG{constructor(e){this.hr=!1,this.dr=3e3,this.er=[],this._instance=e,this.er=[],this.vr=!0,!J(r)&&"onLine"in r.navigator&&(this.vr=r.navigator.onLine,this.cr=()=>{this.vr=!0,this.pr()},this.gr=()=>{this.vr=!1},ro(r,"online",this.cr),ro(r,"offline",this.gr))}get length(){return this.er.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=b(e,nV);ei(t)&&(i.url=nC(i.url,{retry_count:t})),this._instance._send_request(y({},i,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.At(y({retriesPerformedSoFar:t},i));0===e.statusCode&&t0.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==i.callback||i.callback(e)}}))}At(e){var t,i,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var s=Math.ceil((i=Math.min(18e5,t=3e3*Math.pow(2,r)))+(Math.random()-.5)*(i-t/2)),n=Date.now()+s;this.er.push({retryAt:n,requestOptions:e});var a="Enqueued failed request for retry in "+s;navigator.onLine||(a+=" (Browser is offline)"),t0.warn(a),this.hr||(this.hr=!0,this.mr())}mr(){if(this.yr&&clearTimeout(this.yr),0===this.er.length)return this.hr=!1,void(this.yr=void 0);this.yr=setTimeout(()=>{this.vr&&this.er.length>0&&this.pr(),this.mr()},this.dr)}pr(){var e=Date.now(),t=[],i=this.er.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.er=t,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.yr&&(clearTimeout(this.yr),this.yr=void 0),this.hr=!1,J(r)||(this.cr&&(r.removeEventListener("online",this.cr),this.cr=void 0),this.gr&&(r.removeEventListener("offline",this.gr),this.gr=void 0)),this.er)){var t=e.requestOptions;try{this._instance._send_request(y({},t,{transport:"sendBeacon"}))}catch(e){t0.error(e)}}this.er=[]}}class nW{constructor(e){this.br=()=>{this._r||(this._r={});var e,t,i,r,s=this.scrollElement(),n=this.scrollY(),a=s?Math.max(0,s.scrollHeight-s.clientHeight):0,o=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this._r.lastScrollY=Math.ceil(n),this._r.maxScrollY=Math.max(n,null!=(e=this._r.maxScrollY)?e:0),this._r.maxScrollHeight=Math.max(a,null!=(t=this._r.maxScrollHeight)?t:0),this._r.last
1ContentY=o,this._r.maxContentY=Math.max(o,null!=(i=this._r.maxContentY)?i:0),this._r.maxContentHeight=Math.max(l,null!=(r=this._r.maxContentHeight)?r:0)},this._instance=e}get wr(){return this._instance.config.scroll_root_selector}getContext(){return this._r}resetContext(){var e=this._r;return setTimeout(this.br,0),e}startMeasuringScrollPosition(){ro(r,"scroll",this.br,{capture:!0}),ro(r,"scrollend",this.br,{capture:!0}),ro(r,"resize",this.br)}scrollElement(){if(!this.wr)return null==r?void 0:r.document.documentElement;for(var e of G(this.wr)?this.wr:[this.wr]){var t=null==r?void 0:r.document.querySelector(e);if(t)return t}}kr(e){if(this.wr){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return r?"y"===e?r.scrollY||r.pageYOffset||r.document.documentElement.scrollTop||0:r.scrollX||r.pageXOffset||r.document.documentElement.scrollLeft||0:0}scrollY(){return this.kr("y")}scrollX(){return this.kr("x")}}var nK=e=>sN(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class nY{constructor(e,t,i,r){this.Sr=e=>{var t=this.Cr();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Mr(this._instance)};this.Tr.register({[ij]:i})}},this._instance=e,this.Er=t,this.Tr=i,this.Mr=r||nK,this.Er.onSessionId(this.Sr)}Cr(){return this.Tr.props[ij]}getSetOnceProps(){var e,t=null==(e=this.Cr())?void 0:e.props;return t?"r"in t?sM(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 re(rn(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+B(i)]=t}),e}}class nJ{on(e,t){return this.Ir[e]||(this.Ir[e]=[]),this.Ir[e].push(t),()=>{this.Ir[e]=this.Ir[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Ir[e]||[])i(t);for(var r of this.Ir["*"]||[])r(e,t)}constructor(){this.Ir={}}}var nX=t1("[SessionId]");class nQ{on(e,t){return this.Pr.on(e,t)}constructor(e,t,i){if(this.Rr=null,this.Ar=[],this.Fr=void 0,this.Lr=!1,this.Pr=new nJ,this.Or=(e,t)=>!(!ei(e)||!ei(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===iZ)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Ne=e.config,this.Tr=e.persistence,this.Dr=void 0,this.$r=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Nr=t||rm,this.qr=i||rm;var r,s=this.Ne.persistence_name||this.Ne.token;if(this._sessionTimeoutMs=1e3*ep(this.Ne.session_idle_timeout_seconds||1800,60,36e3,nX.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.jr(),this.Br="ph_"+s+"_window_id",this.Hr="ph_"+s+"_primary_window_exists",this.Ur()){var n=rR.H(this.Br),a=rR.H(this.Hr);n&&!a?this.Dr=n:rR.q(this.Br),rR.F(this.Hr,!0)}if(null!=(r=this.Ne.bootstrap)&&r.sessionID)try{var o=(e=>{var t=this.Ne.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this.zr(this.Ne.bootstrap.sessionID,(new Date).getTime(),o)}catch(e){nX.error("Invalid sessionID in bootstrap",e)}this.Wr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return J(this.Ar)&&(this.Ar=[]),this.Ar.push(e),this.$r&&e(this.$r,this.Dr),()=>{this.Ar=this.Ar.filter(t=>t!==e)}}Ur(){return"memory"!==this.Ne.persistence&&!this.Tr.xi&&rR.N()}Vr(e){e!==this.Dr&&(this.Dr=e,this.Ur()&&rR.F(this.Br,e))}Zr(){return this.Dr?this.Dr:this.Ur()?rR.H(this.Br):null}Gr(e){var t=this.Rr;return!Z(t)&&!Z(e)&&5e3>Math.abs(e-t)}zr(e,t,i){var r=t!==this._sessionActivityTimestamp,s=e===this.$r&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.$r=e,s&&!r||s&&this.Gr(t)||(this.Rr=t,this.Tr.register({[ig]:[t,e,i]}))}Qr(){var e,t=null==(e=this.Ne)?void 0:e.persistence_save_debounce_ms;return ei(t)&&t>0}Jr(){this.Qr()?this.Tr.refreshKey(ig):(this.Tr.flush(),this.Tr.load())}Kr(){var e;if(!Z(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Rr){this.Jr();var t=this.Yr();t[1]===this.$r&&t[2]===this._sessionStartTimestamp&&(this.Rr=this._sessionActivityTimestamp,this.Tr.register({[ig]:[this._sessionActivityTimestamp,null!=(e=this.$r)?e:null,this._sessionStartTimestamp]}),this.Tr.flush())}}Xr(){var e=this.Yr()[0];return Math.max(ei(e)?e:0,ei(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}
1tn(e){return this.Jr(),this.Or(e,this.Xr())}Yr(){var e=this.Tr.props[ig];return G(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Rr=null,clearTimeout(this.en),this.en=void 0,this.zr(null,null,null)}destroy(){this.Lr=!0,this.Kr(),clearTimeout(this.en),this.en=void 0,this.Fr&&r&&(r.removeEventListener(i5,this.Fr,{capture:!1}),this.Fr=void 0),this.Ar=[]}Wr(){this.Fr=()=>{this.Kr(),this.Ur()&&rR.q(this.Hr)},ro(r,i5,this.Fr,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Ne.cookieless_mode===iZ)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),r=this.Yr(),s=r[1],n=r[2],a=this.Xr(),o=this.Zr(),l=ei(n)&&Math.abs(i-n)>864e5,u=!1,c=!1,h=!s,d=s,p=!h&&!e&&this.Or(i,a);if(p){(p=this.tn(i))||nX.info("cross-tab refresh kept the session alive",{sessionId:s});var v=this.Yr();s=v[1],n=v[2]}h||p||l?(s=this.Nr(),o=this.qr(),nX.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:h,activityTimeout:p,sessionPastMaximumLength:l}}),n=i,u=!0):(o||(o=this.qr(),u=!0),(c=s!==d)&&(nX.info("adopted cross-tab session id",{sessionId:s,windowId:o}),u=!0));var g=ei(a)&&e&&!l?a:i,_=ei(n)?n:(new Date).getTime();this.Vr(o),this.zr(s,g,_),e||this.jr();var f={noSessionId:h,activityTimeout:p,sessionPastMaximumLength:l,crossTabAdoption:c};return u&&this.Ar.forEach(e=>e(s,o,f)),{sessionId:s,windowId:o,sessionStartTimestamp:_,changeReason:u?f:void 0,lastActivityTimestamp:a}}jr(){this.Lr||(clearTimeout(this.en),this.en=setTimeout(()=>{if(!this.Lr)if(this.tn((new Date).getTime())){var e=this.$r;this.resetSessionId(),this.Pr.emit("forcedIdleReset",{idleSessionId:e})}else this.jr()},1.1*this.sessionTimeoutMs))}}var nZ=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&D(i,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>D(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function n0(){return(n0=m(function*(){var e=null==n?void 0:n.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return X(i)&&i.length>0?i:void 0}catch(e){return void t0.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var n1=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function n2(e,t,i){return s_({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var n3={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>n1(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!n1(t,e))),icontains:(e,t)=>t.map(n5).some(t=>e.map(n5).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(n5).every(t=>e.map(n5).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})},n5=e=>e.toLowerCase();function n6(e,t){return!e||Object.entries(e).every(e=>{var i=e[1],r=null==t?void 0:t[e[0]];if(J(r)||Z(r))return!1;var s=[String(r)],n=n3[i.operator];return!!n&&n(i.values,s)})}var n4="custom",n8="i.posthog.com",n7=/^\/static\//;class n9{constructor(e){this.rn={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+n8,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.rn[this.apiHost]||(this.rn[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":n4),this.rn[this.apiHost]}nn(e){if(n7.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var i=this.nn(t);if(i)return""+i+t}if(this.region===n4)return this.apiHost+t;var r=n8+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}function ae(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var at=t1("[Surveys]"),ai="seenSurvey_",ar=e=>{try{var t=(e=>""+ai+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){at.error("Failed to persist survey seen state",e)}},as=[sW.Popover,sW.Widget,sW.API],an={ignoreConditions:!1,ignoreDelay:!1,displayType:sZ.Popover}
1,aa=t1("[PostHog ExternalIntegrations]"),ao={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class al{constructor(e){this._instance=e}ai(e,t){var i;null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return aa.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this;for(var i of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))!function(){var e,r,s,n=i[0],a=i[1];!a||null!=(e=g.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.ai(ao[n],()=>{var e;null==(e=g.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!a&&null!=(r=g.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[n]&&(null==(s=g.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[n])||s.stop())}()}}class au{constructor(e,t){this.rt=e,this.sn=t,this.an=new Map,this.ln=!1}add(e){var t=this;return m(function*(){if(t.ln)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.an.has(e.name))throw Error('Browser extension "'+e.name+'" is already registered');t.an.set(e.name,e);try{var i=e.setup(t.sn);i&&(yield i)}catch(i){var r=t.an.get(e.name)===e;r&&t.an.delete(e.name),t.rt.error('Failed to set up browser extension "'+e.name+'"',i),r&&t.un(e)}})()}dispose(){if(!this.ln){this.ln=!0;var e=Array.from(this.an.values()).reverse();for(var t of(this.an.clear(),e))this.un(t)}}un(e){try{var t=null==e.dispose?void 0:e.dispose();t&&W(t.then)&&t.then(void 0,t=>{this.rt.error('Failed to dispose browser extension "'+e.name+'"',t)})}catch(t){this.rt.error('Failed to dispose browser extension "'+e.name+'"',t)}}}class ac{constructor(e){this._instance=e}get(e){var t;return null==(t=this._instance.persistence)?void 0:t.get_property(e)}set(e,t){var i;null==(i=this._instance.persistence)||i.set_property(e,t)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}}var ah="extensionsRemoteConfig";class ad{constructor(e){this.ln=!1,this.instance=e,this.rt=t0.createLogger("[BrowserExtensions]"),this.hn=e.dn,this.kv=new ac(e),this.onEvent=e=>sB(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.rt.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.ln)return sB(()=>{});var t=t=>{try{e(t)}catch(e){this.rt.error("Browser extension remote config listener failed",e)}},i=this.instance.vn.on(ah,t);return this.hn&&t(this.hn),sB(i)},this.cn=new au(this.rt,this)}get logger(){return this.rt}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!=(e=this.instance.get_property(t6))?e:this.distinctId}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,r,s=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!=(t=null==s?void 0:s.sessionId)?t:"",windowId:null!=(i=null==s?void 0:s.windowId)?i:"",sessionStartTimestamp:null!=(r=null==s?void 0:s.sessionStartTimestamp)?r:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get projectToken(){return this.instance.config.token}add(e){return this.cn.add(e)}capture(e,t,i){var r=this;return m(function*(){i?r.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):r.instance.capture(e,t)})()}registerDynamicEventProperties(e){return sB(this.instance.fn(e))}handleRemoteConfig(e){this.ln||(this.hn=e,this.instance.vn.emit(ah,e))}sendRequest(e,t){var i=this;return m(function*(){void 0===t&&(t={});var r,s=i.instance.requestRouter.endpointFor(null!=(r=t.target)?r:"api",e),n={method:t.method,url:t.query?nC(s,t.query):s,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport};return"sendBeacon"===t.transport?(i.instance._send_request(n),{statusCode:202}):new Promise(e=>{n.callback=e,i.instance._send_request(n)})})()}dispose(){this.ln||(this.ln=!0,this.cn.dispose())}}var ap={},av=0,ag=()=>{},a_='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',af="Surveys module not available",am="sanitize_properties is deprecated. Use before_send instead",ay="Invalid value for property_denylist config: ",ab=["token","distinct_id",iW],aw="posthog",ax=!nR&&-1===(null==d?void 0:d.indexOf("MSIE"))&&-1===(null==d?void 0:d.indexOf("Mozilla")),aE=e=>{var t;return y({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!X(t))return!1;var i=t.split(".").slice(-2).join(".");for(var r of ra)if(i===r)return!1;return!0}(null==a?void 0:a.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:ag,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:o&&X(null==o?void 0:o.search)&&-1!==o.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==r||null==(t=r.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){t0.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:i2,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:ag},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:rY,ignore_text_selection:!0}
1:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e)}))(e))},aS=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],ak=e=>{var t={};for(var i of aS){var r=i[0],s=i[1];J(e[r])||(t[s]=e[r])}var n=rt({},t,e),a=e.__preview_external_dependency_versioned_paths;return J(a)||(J(e.strict_script_versioning)&&(n.strict_script_versioning=!!a),X(a)&&J(e.asset_host)&&(n.asset_host=a)),G(e.property_blacklist)&&(J(e.property_denylist)?n.property_denylist=e.property_blacklist:G(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:t0.error(ay+e.property_denylist)),n};class aP{constructor(){this.__forceAllowLocalhost=!1}get pn(){return this.__forceAllowLocalhost}set pn(e){t0.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class aT{gn(e,t){if(e){var i=this.an.indexOf(e);-1!==i&&this.an.splice(i,1)}return this.an.push(t),null==t.initialize||t.initialize(),t}mn(){return this.config.cookieless_mode===iZ||this.config.cookieless_mode===iQ&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new aP,this.yn=!1,this.version=_.LIB_VERSION,this.vn=new nJ,this.an=[],this.bn=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=aE(),this.SentryIntegration=sc,this.sentryIntegration=e=>(function(e,t){var i=su(e,t);return{name:sl,processEvent:e=>i(e)}})(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._n=!1,this.wn=null,this.kn=null,this.xn=null,this.scrollManager=new nW(this),this.pageViewManager=new sh(this),this.rateLimiter=new s5(this),this.requestRouter=new n9(this),this.consent=new rF(this),this.externalIntegrations=new al(this);var e,t=null!=(e=aT.__defaultExtensionClasses)?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var r=X(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{var r=X(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>t0.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==aw){var r,s=null!=(r=ap[i])?r:new aT;return s._init(e,t,i),ap[i]=s,ap[aw][i]=s,s}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var s,n,a,o=X(e)?e.trim():"";if(!o)return t0.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 o!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+o+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=aE(t.defaults),t.debug=this.Sn(t.debug),this.Cn=t,this.Mn=[],t.person_profiles?this.kn=t.person_profiles:t.process_person&&(this.kn=t.process_person);var l=aE(t.defaults),u=ak(t),c=rt({},l,u,{name:i,token:o});K(l.rageclick)&&K(u.rageclick)&&(c.rageclick=rt({},l.rageclick,u.rageclick)),K(l.session_recording)&&K(u.session_recording)&&(c.session_recording=rt({},l.session_recording,u.session_recording)),this.set_config(c),this.config.on_xhr_error&&t0.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:sH.GZipJS;var h=this.Tn();this.persistence=new sj(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sj(y({},this.config,{persistence:"sessionStorage"}),h,!1);var d=y({},this.persistence.props),p=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.En=new nz(e=>this.In(e),this.config.request_queue_config),this.Pn=new nG(this),this.__request_queue=[];var v=this.mn();if(v||(this.sessionManager=new nQ(this),this.sessionPropsManager=new nY(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(t0.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Rn(v)},0)):(t0.info("Initializing extensions synchronously"),this.Rn(v)),_.DEBUG=_.DEBUG||this.config.debug,_.DEBUG&&t0.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:d,s:p}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=y({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}
1)),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var g=t.bootstrap.distinctID,f=this.get_distinct_id(),m=this.persistence.get_property(iU);if(t.bootstrap.isIdentifiedID&&null!=f&&f!==g&&m===i0)this.identify(g);else if(t.bootstrap.isIdentifiedID&&null!=f&&f!==g&&m===i1)t0.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 b=this.config.get_device_id(rm()),w=t.bootstrap.isIdentifiedID?b:g;this.persistence.set_property(iU,t.bootstrap.isIdentifiedID?i1:i0),this.register({distinct_id:g,$device_id:w})}}if(v)this.register_once({distinct_id:iG,$device_id:null},"");else if(!this.get_distinct_id()){var x=this.config.get_device_id(rm());this.register_once({distinct_id:x,$device_id:x},""),this.persistence.set_property(iU,i0)}return ro(r,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var r=i=>{var r=()=>i.anonymousId()||rm();e.config.get_device_id=r,i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(iU,i1)),t()},s=i.user();"then"in s&&W(s.then)?s.then(r):r(s)}(e,()=>{var r;i.register(("undefined"!=typeof Promise&&Promise.resolve||so.warn("This browser does not have Promise support, and can not use the segment integration"),r=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(so.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(so.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>r(e,e.event.event),page:e=>r(e,i6),identify:e=>r(e,i8),screen:e=>r(e,"$screen")})).then(()=>{t()})})}(this,()=>this.An()):this.An(),W(this.config._onCapture)&&this.config._onCapture!==ag&&(t0.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&t0.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 n0.apply(this,arguments)})().then(e=>{e&&this.register({[t4]:e})}).catch(ag),this}Rn(e){var t,i,r,s,n,a,o,l,u=performance.now(),c=y({},aT.__defaultExtensionClasses,this.config.__extensionClasses),h=[];c.featureFlags&&this.an.push(this.featureFlags=null!=(t=this.featureFlags)?t:new c.featureFlags(this)),c.exceptions&&this.an.push(this.exceptions=null!=(i=this.exceptions)?i:new c.exceptions(this)),c.historyAutocapture&&this.an.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this.an.push(this.tracingHeaders=new c.tracingHeaders(this)),c.siteApps&&this.an.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!e&&this.an.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),c.autocapture&&this.an.push(this.autocapture=new c.autocapture(this)),c.surveys&&this.an.push(this.surveys=null!=(r=this.surveys)?r:new c.surveys(this)),c.logs&&this.an.push(this.logs=null!=(s=this.logs)?s:new c.logs(this)),c.metrics&&this.an.push(this.metrics=null!=(n=this.metrics)?n:new c.metrics(this)),c.conversations&&this.an.push(this.conversations=null!=(a=this.conversations)?a:new c.conversations(this)),c.productTours&&this.an.push(this.productTours=new c.productTours(this)),c.heatmaps&&this.an.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this.an.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this.an.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this.an.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,sn)),c.toolbar&&this.an.push(this.toolbar=null!=(o=this.toolbar)?o:new c.toolbar(this)),c.experiments&&this.an.push(this.experiments=null!=(l=this.experiments)?l:new c.experiments(this)),this.an.forEach(e
1=>{e.initialize&&h.push(()=>{null==e.initialize||e.initialize()})}),h.push(()=>{if(this.Fn){var e=this.Fn;this.Fn=void 0,this.an.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.Ln(h,u)}Ln(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Ln(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){t0.error("Error initializing extension:",e)}}var r=Math.round(performance.now()-t);this.register_for_session({[iK]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[iY]:r}),this.config.__preview_deferred_init_extensions&&t0.info("PostHog extensions initialized ("+r+"ms)")}Gi(e){var t;if(!a||!a.body)return t0.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Gi(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.Fn=e),this.dn=e,this.compression=void 0,e.ok){var i,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=U(r.supportedCompression,sH.GZipJS)?sH.GZipJS:U(r.supportedCompression,sH.Base64)?sH.Base64:void 0),null!=(i=r.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.kn?this.kn:i2}),null==(t=this.On)||t.handleRemoteConfig(e),this.an.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}An(){try{this.config.loaded(this)}catch(e){t0.critical("`loaded` function failed",e)}if(this.Dn(),this.config.internal_or_test_user_hostname&&null!=o&&o.hostname){var e=o.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.mn())&&this.$n()},1),this.Nn=new s4(this),this.Nn.load()}Dn(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.En)||e.enable())}_dom_loaded(){this.is_capturing()&&i9(this.__request_queue,e=>this.In(e)),this.__request_queue=[],this.Dn()}_handle_unload(){var e,t,i,r,s;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.qn()&&this.capture(i4),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.En)||r.unload(),null==(s=this.Pn)||s.unload()):this.qn()&&this.capture(i4,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?ax?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=y({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(J(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,r,s,n,a=y({},e);a.timeout=a.timeout||6e4;var o,l,u,c,d,p=null!=(r=a.transport)?r:"fetch";"sendBeacon"===p&&J(a.compression)&&a.data&&(a.compression=sH.Base64),"POST"===a.method&&a.data&&("capture-body"===a.timestampMode?a.data={api_key:null!=(l=null==(d=(c=G(o=a.data)?o:[o])[0])||null==(u=d.properties)?void 0:u.token)?l:null==d?void 0:d.token,batch:c,sent_at:(new Date).toISOString()}:"body"===a.timestampMode&&(t=a.data,void 0===i&&(i=(new Date).toISOString()),a.data=G(t)?t.map(e=>y({},e,{sent_at:i})):y({},t,{sent_at:i}))),a.url=nH(a.url,a.method,a.compression,a.timestampMode);var v=nq.filter(e=>!a.disableTransport||!e.transport||!a.disableTransport.includes(e.transport)),g=null!=(s=null==(n=function(e,t){for(var i=0;e.length>i;i++)if(e[i].transport===p)return e[i]}(v))?void 0:n.method)?s:v[0].method;if(!g)throw Error("No available transport method");var _=e=>{try{g(e)}catch(e){nU(e)?t0.warn(e):t0.error(e),null==a.callback||a.callback({statusCode:0,error:e})}};"sendBeacon"!==p&&a.data&&a.compression===sH.GZipJS&&h&&"undefined"!=typeof Promise&&!n$?nL(a).then(e=>{_(e)}).catch(t=>{if(C(t))return n$=!0,void _(y({},a,{compression:void 0,url:nH(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return C(e)||t===F})(t)&&(n$=!0),_(a)}):g(a)})(y({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}In(e){this.Pn?this.Pn.retriableRequest(e):this._send_request(e)}_execute_array(e){av++;try{var t,i=[],r=[],s=[];i9(e,e=>
1{if(e)if(G(t=e[0]))s.push(e);else if(W(e))try{e.call(this)}catch(t){t0.error("Error executing queued PostHog call",e,t)}else G(e)&&"alias"===t?i.push(e):G(e)&&-1!==t.indexOf("capture")&&W(this[t])?s.push(e):r.push(e)});var n=function(e,t){i9(e,function(e){try{if(G(e[0])){var i=t;re(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){t0.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(r,this),n(s,this)}finally{av--}}push(e){if(av>0&&G(e)&&X(e[0])){var t=aT.prototype[e[0]];W(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var r,s,n,a,o,l,u;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.En){if(this.is_capturing())if(!J(e)&&X(e)){var c=!this.config.opt_out_useragent_filter&&this._is_bot();if(!c||this.config.__preview_capture_bot_pageviews){var h=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==h||!h.isRateLimited){if(this.bn.length>0){var d={};for(var p of this.bn.slice())try{rt(d,p())}catch(e){t0.error("Failed to produce browser extension event properties",e)}t=y({},d,null!=t?t:{})}null!=(r=t)&&r.$current_url&&!X(null==(s=t)?void 0:s.$current_url)&&(t0.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==(w=t)||delete w.$current_url),"$exception"!==e||null!=i&&i.jn||t0.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 v=new Date,g=(null==i?void 0:i.timestamp)||v,_=tu(null==i?void 0:i.uuid,rm),f={uuid:_,event:e,properties:this.calculateEventProperties(e,t||{},g,_)};e===i6&&this.config.__preview_capture_bot_pageviews&&c&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),h&&(f.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens);var m="$feature_flag_called"===e&&!1===f.properties.$feature_flag_has_experiment&&!0===this.get_property(iS);(null==i?void 0:i.$set)&&!m&&(f.$set=null==i?void 0:i.$set);var b=null==i?void 0:i.$unset;b&&(f.$unset=b);var w,x,E,S,P=m?void 0:this.Bn(null==i?void 0:i.$set_once,e!==i7,e===i8);if(P&&(f.$set_once=P),null!=i&&i._noTruncate||(a=this.config.properties_string_max_length,o=f,l=e=>X(e)?e.slice(0,a):e,u=new Set,f=function e(t,i){if(t!==Object(t))return l?l(t):t;if(!u.has(t)){var r;if(u.add(t),G(t))r=[],i9(t,t=>{r.push(e(t))});else{var s={};re(t,(t,i)=>{u.has(t)||(s[i]=e(t,i))}),r=s}return r}}(o)),f.timestamp=g,J(null==i?void 0:i.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=v),m&&(f.properties=(T=f.properties,void 0===(I=ab)&&(I=[]),R={},F=e=>{void 0!==T[e]&&(R[e]=T[e])},k.forEach(F),I.forEach(F),R)),e===sX.DISMISSED||e===sX.SENT){var T,I,R,F,$,O,C=null==($=t)?void 0:$[sQ.SURVEY_ID],N=null==(O=t)?void 0:O[sQ.SURVEY_ITERATION];ar({id:C,current_iteration:N}),f.$set=y({},f.$set,{[(x={id:C,current_iteration:N},S="$survey_"+(E=e===sX.SENT?"responded":"dismissed")+"/"+x.id,x.current_iteration&&x.current_iteration>0&&(S="$survey_"+E+"/"+x.id+"/"+x.current_iteration),S)]:!0})}else e===sX.SHOWN&&(f.$set=y({},f.$set,{[sQ.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(e===s1.SHOWN){var M,A=null==(M=t)?void 0:M[s2.TOUR_TYPE];A&&(f.$set=y({},f.$set,{[s2.TOUR_LAST_SEEN_DATE+"/"+A]:(new Date).toISOString()}))}var L=y({},f.properties.$set,f.$set);if(Y(L)||this.setPersonPropertiesForFlags(L),!ee(this.config.before_send)){var D=this.Pt(f);if(!D)return;(f=D).uuid=tu(f.uuid,rm)}this.vn.emit("eventCaptured",f);var U=null!=(n=null==i?void 0:i._url)?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),j={method:"POST",url:U,data:f,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(U)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.In(j):this.En.enqueue(j),f}t0.critical("This capture call is ignored due to client rate limiting.")}}else t0.error("No event name provided to posthog.capture")}else t0.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}Hn(){var e;return null!=(e=this.On)?e:this.On=new ad(this)}fn(e){this.bn.push(e);var t=!0;return()=>{if(t){t=!1;var i=this.bn.indexOf(e);-1!==i&&this.bn.splice(i,1)}}}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var l,u=n?void 0:this.persistence.remove_event_timer(e),c=y({},t);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.mn()&&(c[iW]=!0),"$
1snapshot"===e){var h=y({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=h.distinct_id,(!X(c.distinct_id)&&!et(c.distinct_id)||Q(c.distinct_id))&&t0.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var p,v=function(e,t,i,s){if(void 0===s&&(s=!1),!d)return{};var n,a,l,u,c,h=e?[...sS,...t||[]]:[],p=function(e){for(var t=0;ta.length>t;t++){var i=ta[t],r=i[1],s=i[0].exec(e),n=s&&(W(r)?r(s,e):r);if(n)return n}return["",""]}(d),v=p[0],g=p[1],f=null!=(c="undefined"!=typeof navigator?navigator:void 0)&&c.brave?{brave:!0}:{},m={};J(i)||(m.detectGoogleSearchApp=i);var y={},b=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,w=null==(a=navigator)?void 0:a.maxTouchPoints,x=null==r||null==(l=r.screen)?void 0:l.width,E=null==r||null==(u=r.screen)?void 0:u.height,S=null==r?void 0:r.devicePixelRatio;J(b)||(y.userAgentDataPlatform=b),J(w)||(y.maxTouchPoints=w),J(x)||(y.screenWidth=x),J(E)||(y.screenHeight=E),J(S)||(y.devicePixelRatio=S);var k,P,T,I,R,F,$=rt(rn({$os:v,$os_version:g,$browser:tr(d,navigator.vendor,f,m),$device:to(d),$device_type:(F=to(d))===ey||F===em||"Kobo"===F||"Kindle Fire"===F||F===eY?ef:F===eD||F===ej||F===eU||F===eG?"Console":F===ew?"Wearable":F?eg:"Android"===(null==y?void 0:y.userAgentDataPlatform)&&(null!=(P=null==y?void 0:y.maxTouchPoints)?P:0)>0?600>Math.min(null!=(T=null==y?void 0:y.screenWidth)?T:0,null!=(I=null==y?void 0:y.screenHeight)?I:0)/(null!=(R=null==y?void 0:y.devicePixelRatio)?R:1)?eg:ef:"Desktop",$timezone:sA(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:sy(s?tc(null==o?void 0:o.href):null==o?void 0:o.href,h,sP),$host:null==o?void 0:o.host,$pathname:null==o?void 0:o.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+"...":d,$browser_version:tn(d,navigator.vendor,f,m),$browser_language:s$(),$browser_language_prefix:"string"==typeof(k=s$())?k.split("-")[0]:void 0,$screen_height:null==r?void 0:r.screen.height,$screen_width:null==r?void 0:r.screen.width,$viewport_height:null==r?void 0:r.innerHeight,$viewport_width:null==r?void 0:r.innerWidth,$lib:_.LIB_NAME,$lib_version:_.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return _.SDK_DIST_CHANNEL&&($.$sdk_dist_channel=_.SDK_DIST_CHANNEL),$}(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 g=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime()),f=g.windowId;c.$session_id=g.sessionId,c.$window_id=f}this.sessionPropsManager&&rt(c,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&rt(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=null==(l=this.Pn)?void 0:l.length}catch(e){c.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===n4&&(c.$lib_custom_api_host=this.config.api_host),p=e!==i6||n?e!==i4||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),c=rt(c,p),e===i6&&a&&(c.title=a.title),!J(u)){var m=i.getTime()-u;c.$duration=parseFloat((m/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),w=this.sessionPersistence.properties();re(["$referrer","$referring_domain"],e=>{e in b&&delete w[e]}),(c=rt({},v,b,w,c)).$is_identified=this._isIdentified(),G(this.config.property_denylist)?re(this.config.property_denylist,function(e){delete c[e]}):t0.error(ay+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var x=this.config.sanitize_properties;x&&(t0.error(am),c=x(c,e));var E=this.Un();return c.$process_person_profile=E,E&&!n&&this.zn("_calculate_event_properties"),c}Bn(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.Un()||this.yn&&!i)return e;var r,s=rt({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(t0.error(am),s=n(s,"$set_once")),t&&(this.yn=!0),Y(s)?void 0:s}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var r;null==(r=this.persistence)||r.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Wn(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())?e:[]}isFeatureEnabled(e,t){var i,r;return null!=(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t))?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var r;null==(r=this.featureFlags)||r.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var r;return void 0===t&&(t=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.vn.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:af}),()=>{})}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:af})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:af})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=an),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!=(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))?t:{visible:!1,disabledReason:af}}canRenderSurveyAsync(e,t){var i,r;return void 0===t&&(t=!1),null!=(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:af})}Vn(e){return!e||Q(e)?(t0.critical("Unique user id has not been set in posthog.identify"),!1):e===iG?(t0.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())||(t0.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return t0.uninitializedWarning("posthog.identify");if(et(e)&&(e=e.toString(),t0.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Vn(e)&&this.zn("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(t6)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(t8)&&(this.unregister(t8),this.register({distinct_id:e}));var s,n=(this.persistence.get_property(iU)||i0)===i0,a=e!==r,o=!a&&n;if(a&&n)this.persistence.set_property(iU,i1),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.capture(i8,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.xn=n2(e,t,i),null==(s=this.featureFlags)||s.setAnonymousDistinctId(r);else if(o){this.persistence.set_property(iU,i1);var l=t||{},u=i||{};this.setPersonPropertiesForFlags({$set:l,$set_once:u},!1),this.capture("$set",{$set:l,$set_once:u}),this.xn=n2(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);a?(this.reloadFeatureFlags(),this.unregister(iM)):o&&(t||i)&&this.reloadFeatureFlags()}}setPersonProperties(e,t){if((e||t)&&this.zn("posthog.setPersonProperties")){var i=n2(this.get_distinct_id(),e,t);this.xn!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.xn=i):t0.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(G(e)?e:[e]).filter(e=>X(e)&&e.length>0);0!==i.length&&this.zn("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.xn=null)}group(e,t,i){if(e&&t){var r=this.getGroups(),s=r[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},r,{[e]:t})}),s||i){var n={$group_type:e,$group_key:t};i&&(n.$group_set=i),this.capture(i7,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else t0.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this.zn("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){this.Zn(e)}Zn(e,t){if(void 0===t&&(t=!1),t0.info("reset"),!this.__loaded)return t0.uninitializedWarning("posthog.reset");var i,r,s,n,a,o,l,u,c,h,d,p=this.get_property(t6),v=this.get_property(t4),g=this.get_property(iu),_=this.is_capturing();if(this.consent.reset(),t||!_||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after."),null==(i=this.persistence)||i.clear(),null==(r=this.sessionPersistence)||r.clear(),J(g)||null==(d=this.persistence)||d.register({[iu]:g}),null==(s=this.surveys)||s.reset(),null==(n=this.Nn)||n.stop(),null==(a=this.featureFlags)||a.reset(),null==(o=this.conversations)||o.reset(),null==(l=this.logs)||l.reset(),null==(u=this.metrics)||u.reset(),null==(c=this.persistence)||c.set_property(iU,i0),null==(h=this.sessionManager)||h.resetSessionId(),this.xn=null,this.config.cookieless_mode===iZ)this.register_once({distinct_id:iG,$device_id:null},"");else{var f=this.config.get_device_id(rm());this.register_once({distinct_id:f,$device_id:e?f:p},""),e||J(v)||this.register({[t4]:v})}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 m(function*(){var e,i,r,s,n,a,o,l;t.__loaded?(null==(e=t.Nn)||e.stop(),null==(i=t.On)||i.dispose(),null==(r=t.sessionRecording)||r.dispose(),null==(s=t.logs)||s.flushLogs("sendBeacon"),null==(n=t.metrics)||n.flush("sendBeacon"),null==(a=t.En)||a.unload(),null==(o=t.Pn)||o.unload(),null==(l=t.featureFlags)||l.destroy()):t0.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.Gn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.Qn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(null!=e&&e.withTimestamp&&i){var s,n=null!=(s=e.timestampLookBack)?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(e,t){return e===this.get_property(t5)?(t0.critical("Attempting to create alias for existing People user - aborting."),-2):this.zn("posthog.alias")?(J(t)&&(t=this.get_distinct_id()),e!==t?(this.Wn(t8,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(t0.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(K(e)){rt(this.config,ak(e));var i,r,s,n,a,o,l,u,c,h,d,p=this.Tn();null==(i=this.persistence)||i.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sj(y({},this.config,{persistence:"sessionStorage"}),p,!1);var v=this.Sn(this.config.debug);er(v)&&(this.config.debug=v),er(this.config.debug)&&(this.config.debug?(_.DEBUG=!0,rS.N()&&rS.F("ph_debug",!0),t0.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(_.DEBUG=!1,rS.N()&&rS.q("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||
1c.startIfEnabledOrStop(),null==(h=this.surveys)||h.loadIfEnabled(),this.Jn(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){_.LIB_NAME=e,_.LIB_VERSION=t}startSessionRecording(e){var t,i,r,s,n,a=!0===e,o={sampling:a||!(null==e||!e.sampling),linked_flag:a||!(null==e||!e.linked_flag),url_trigger:a||!(null==e||!e.url_trigger),event_trigger:a||!(null==e||!e.event_trigger)};Object.values(o).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),o.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(y({},r,t))}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!=(e=null==(t=this.logs)?void 0:t.logger)?e:aT.Kn}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!=(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&t}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:aw;return t!==aw&&(t=aw+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(iU))===i1||(null==(t=this.sessionPersistence)?void 0:t.get_property(iU))===i1}Un(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===i2&&!this._isIdentified()&&Y(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[t8])&&(null==(t=this.persistence)||null==(t=t.props)||!t[iV]))}qn(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.Un()||this.zn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.zn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}zn(e){return"never"===this.config.person_profiles?(t0.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Wn(iV,!0),!0)}Tn(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==iQ)}Jn(){var e,t,i,r,s=this.Tn();return(null==(e=this.persistence)?void 0:e.xi)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t.xi)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==iZ){if(this.mn()){this.Zn(!0,!0),null==(s=this.sessionManager)||s.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new nQ(this),this.pageViewManager=new sh(this),this.persistence&&(this.sessionPropsManager=new nY(this,this.sessionManager,this.persistence));var i,r,s,n,a,o,l,u,c=null!=(a=null==(o=this.config.__extensionClasses)?void 0:o.sessionRecording)?a:null==(l=aT.__defaultExtensionClasses)?void 0:l.sessionRecording;c&&(this.sessionRecording=this.gn(this.sessionRecording,new c(this)),this.dn&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.dn)))}this.consent.optInOut(!0),this.Jn(),this.Dn(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==iQ&&(null==(i=this.surveys)||i.loadIfEnabled()),(J(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(r=null==e?void 0:e.captureEventName)?r:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.$n()}else t0.warn(a_)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==iZ?(this.config.cookieless_mode===iQ&&this.consent.isOptedIn()&&this.Zn(!0,!0),this.consent.optInOut(!1),this.Jn(),this.config.cookieless_mode===iQ&&(this.register({distinct_id:iG,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(i=this.pageViewM
1anager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.$n(),this.Dn())):t0.warn(a_)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===iZ||(this.config.cookieless_mode===iQ?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Jn()}_is_bot(){return n?nZ(n,this.config.custom_blocked_useragents):void 0}$n(){a&&("visible"===a.visibilityState?this._n||(this._n=!0,this.capture(i6,{title:a.title},{send_instantly:!0}),this.wn&&(a.removeEventListener(i3,this.wn),this.wn=null)):this.wn||(this.wn=this.$n.bind(this),ro(a,i3,this.wn)))}debug(e){!1===e?(null==r||r.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==r||r.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Ji(){var e,t,i,r,s=this.Cn||{};return"advanced_disable_flags"in s?!!s.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(t0.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in s&&!ee(s[e]),r=t in s&&!ee(s[t]),i?s[e]:!!r&&(t0&&t0.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),s[t]))}Pt(e){if(ee(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(en),r=G(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var n of r){if(ee(s=n(s))){var a="Event '"+e.event+"' was rejected in beforeSend function";return es(e.event)?t0.warn(a+". This can cause unexpected behavior."):t0.info(a),null}s.properties&&!Y(s.properties)||t0.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var o of i)if(s.properties&&ee(s.properties[o]))return t0.warn("Event '"+e.event+"' had its '"+o+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var e;return null==(e=this.pageViewManager.ui)?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}Sn(e){var t=er(e)&&!e,i=rS.N()&&"true"===rS.P("ph_debug");return!t&&(!!i||e)}}aT.__defaultExtensionClasses={},aT.Kn=(()=>{var e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=rs(e.prototype[t[i]])}(aT,["identify"]);class aI{constructor(e){this.disabled=!1===e;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,i){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>i-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var aR="$copy_autocapture",aF=t1("[AutoCapture]");function a$(e,t){return t.length>e?t.slice(0,e)+"...":t}var aO=t1("[ExceptionAutocapture]"),aC=()=>{},aN=t1("[TracingHeaders]"),aM=t1("[Web Vitals]"),aA="disabled",aL="lazy_loading",aD="awaiting_config",aU="missing_config";t1("[SessionRecording]"),t1("[SessionRecording]");var aj="[SessionRecording]",aB=t1(aj),aH=t1("[Heatmaps]");function aq(e){return K(e)&&"clientX"in e&&"clientY"in e&&et(e.clientX)&&et(e.clientY)}var az=t1("[Product Tours]"),aV=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(io))},aG=["$set_once","$set"],aW=t1("[SiteApps]"),aK="Error while initializing PostHog app with config id ";function aY(e,t,i){if(ee(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class aJ{constructor(e){this.Yn=new nJ,this.Xn=(e,t)=>this.ts(e,t)&&this.es(e,t)&&this.rs(e,t)&&this.ns(e,t),this.ts=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.ss=new Set,this.os=new Set}init(){var e,t;J(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!J(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
1=>{var t,i;null==(t=this.os)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.ss)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r,s=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(null==e?void 0:e.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(s)}}on(e,t){var i;null!=t&&0!=e.length&&(this.ss.has(e)||this.ss.has(t.event))&&this.os&&(null==(i=this.os)?void 0:i.size)>0&&this.os.forEach(e=>{this.ls(t,e)&&this.Yn.emit("actionCaptured",e.name)})}us(e){this.onAction("actionCaptured",t=>e(t))}ls(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.Xn(e,i))return!0;return!1}onAction(e,t){return this.Yn.on(e,t)}es(e,t){if(null!=t&&t.url){var i,r=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r||!aY(r,t.url,t.url_matching||"contains"))return!1}return!0}rs(e,t){return!!this.hs(e,t)&&!!this.ds(e,t)&&!!this.vs(e,t)}hs(e,t){if(null==t||!t.href)return!0;var i=this.cs(e);if(i.length>0)return i.some(e=>aY(e.href,t.href,t.href_matching||"exact"));var r,s,n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!n&&aY((s=n.match(/(?::|")href="(.*?)"/))?s[1]:"",t.href,t.href_matching||"exact")}ds(e,t){if(null==t||!t.text)return!0;var i=this.cs(e);if(i.length>0)return i.some(e=>aY(e.text,t.text,t.text_matching||"exact")||aY(e.$el_text,t.text,t.text_matching||"exact"));var r,s,n,a,o=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!o&&(s=function(e){for(var t,i=[],r=/(?::|")text="(.*?)"/g;!ee(t=r.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(o),n=t.text,a=t.text_matching||"exact",s.some(e=>aY(e,n,a)))}vs(e,t){if(null==t||!t.selector)return!0;var i,r,s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=s&&s.includes(t.selector))return!0;var n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}cs(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}ns(e,t){return null==t||!t.properties||0===t.properties.length||n6(t.properties.reduce((e,t)=>{var i=G(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class aX{constructor(e){var t;this.fs=[],this._instance=e,this.ps=new Map,this.gs=new Map,this.ys=new Map,null==(t=this._instance)||null==t.onSessionId||t.onSessionId(e=>this.bs(e))}_s(e){return!1}ws(){return null}ks(e){}xs(){}Ss(e,t){return!!e&&n6(e.propertyFilters,null==t?void 0:t.properties)}Cs(e,t){var i=new Map;return e.forEach(e=>{var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(t=>{if(null!=t&&t.name){var r=i.get(t.name)||[];r.push(e.id),i.set(t.name,r)}})}),i}Ms(e,t,i){var r=(i===sq.Activation?this.ps:this.gs).get(e),s=[];return this.Ts(e=>{s=e.filter(e=>null==r?void 0:r.includes(e.id))}),s.filter(r=>{var s,n=null==(s=r.conditions)||null==(s=s[i])||null==(s=s.values)?void 0:s.find(t=>t.name===e);return this.Ss(n,t)})}register(e){var t;J(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Es(e),this.Is(e))}Is(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.Ps&&(this.Ps=new aJ(this._instance),this.Ps.init(),this.Ps.us(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,r,s,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(s=this.Ps)||s.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.ys.get(t.name);i&&i.push(e.id),this.ys.set(t.name,i||[e.id])}}))}))}Es(e){var t,i=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),r=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0});0===i.length&&0===r.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.ps=this.Cs(e,sq.Activation),this.gs=this.Cs(e,sq.Cancellation))}onEvent(e,t){var i,r,s=this.Rs(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(r=t.properties)?void 0:r.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){var a=this.As(e,n);if("consume"===a)return s.info("event consumed activated item, remov
1ing it",{event:e,itemId:n}),void this.Fs([n]);if("persist"===a)return s.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.Ls(n),void this.Os([n])}if(this.gs.has(e)){var o=this.Ms(e,t,sq.Cancellation);o.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.Fs(o.map(e=>e.id)),o.forEach(e=>this.Ds(e.id)))}if(this.ps.has(e)){s.info("event name matched",{event:e,eventPayload:t,items:this.ps.get(e)});var l=this.Ms(e,t,sq.Activation);this.$s(l.map(e=>e.id))}}onAction(e){this.ys.has(e)&&this.$s(this.ys.get(e)||[])}$s(e){var t;if(0!==e.length){var i=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),r=[];for(var s of e)i&&this._s(s)?this.Ls(s)&&this.Ns(s):r.push(s);r.length>0&&(this.fs=[...new Set([...this.fs,...r])]),this.Rs().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Ls(e){this.fs=this.fs.filter(t=>t!==e);var t=this.qs();return!t.includes(e)&&(this.js([...t,e]),this.Bs(),!0)}Fs(e){var t=new Set(e);this.fs=this.fs.filter(e=>!t.has(e));var i=this.Hs(),r=i.filter(e=>!t.has(e));r.length!==i.length&&(this.js(r),0===r.length&&this.Us()),this.Os(e)}zs(){var e,t=this.ws();if(!t)return{};var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}Ns(e){if(this.ws()){var t=this.zs();this.ks(y({},t,{[e]:Date.now()}))}}Os(e){if(this.ws()){var t=this.zs(),i={},r=!1;for(var s of Object.entries(t)){var n=s[0],a=s[1];e.includes(n)?r=!0:i[n]=a}r&&(Y(i)?this.xs():this.ks(i))}}Ws(){this.ws()&&this.xs()}getActivationTimestamp(e){if(this.qs().includes(e)){var t=this.zs()[e];return et(t)?t:void 0}}Hs(){var e,t=this.Vs();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}qs(){var e,t,i=this.Hs();if(0===i.length)return[];var r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Zs()],s=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return s&&r===s?i:[]}Bs(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.Gs(t)}Us(){this.Qs()}bs(e){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Zs()];if(i&&i!==e){var r=this.Hs(),s=this.zs();r.length>0&&(this.js([]),r.filter(e=>et(s[e])).forEach(e=>this.Ds(e))),this.Us(),this.Ws()}}getActivatedIds(){return[...new Set([...this.qs(),...this.fs])].filter(e=>!this.Js(e))}reset(){this.fs=[],this.Hs().length>0&&this.js([]),this.Us(),this.Ws()}getEventToItemsMap(){return this.ps}Ks(){return this.Ps}}class aQ extends aX{constructor(e){super(e)}Vs(){return i$}Zs(){return iO}ws(){return iC}ks(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iC]:e})}xs(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(iC)}_s(e){this.Ts(t=>{i=t.find(t=>t.id===e)});var t,i,r=null==(t=i)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return et(r)&&r>0}Ys(){return sX.SHOWN}Ts(e){var t;null==(t=this._instance)||t.getSurveys(e)}Ds(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Rs(){return at}js(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[i$]:e})}Gs(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iO]:e})}Qs(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(iO)}Js(){return!1}As(e,t){var i,r,s;return this.Ts(e=>{s=e.find(e=>e.id===t)}),!s||ae(i=s)&&!(null==(r=i.conditions)||null==(r=r.events)||!r.repeatedActivation)||"always"===i.schedule?e===sX.SHOWN?"consume":"ignore":e===sX.SHOWN?"persist":e===sX.DISMISSED||e===sX.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var aZ="SDK is not enabled or survey functionality is not yet loaded",a0="Disabled. Not loading surveys.",a1=null!=r&&r.location?sb(r.location.hash,"__posthog")||sb(location.hash,"state"):null,a2="_postHogToolbarParams",a3=t1("[Toolbar]"),a5=t1("[FeatureFlags]"),a6=t1("[FeatureFlags]",{debugEnabled:!0}),a4="\" failed. Feature flags didn't load in time.",a8=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},a7=e=>{var t={};for(var i of ri(e||{})){var r=i[1];r&&(t[i[0]]=r)}return t},a9=t1("[Error tracking]"),oe="Refusing to render web experiment since the viewer is a likely bot",ot={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>n1(t,e),not_regex:(e,t)=>!n1(t,e),exact:(e,t)=>
1t===e,is_not:(e,t)=>t!==e};class oi{get Ne(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{oi.Xs("retrieved web experiments from the server"),t.ta=new Map,e.forEach(e=>{if(e.feature_flag_key){t.ta&&(oi.Xs("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.ta)||i.set(e.feature_flag_key,e));var i,r=t._instance.getFeatureFlag(e.feature_flag_key);X(r)&&e.variants[r]&&t.ea(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var s in e.variants){var n=e.variants[s];oi.ia(n,t._instance)&&t.ea(e.name,s,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())oi.Xs(oe);else if(!this.Ne.disable_web_experiments){if(ee(this.ta))return this.ta=new Map,this.loadIfEnabled(),void this.previewWebExperiment();oi.Xs("applying feature flags",e),e.forEach(e=>{var t;if(this.ta&&null!=(t=this.ta)&&t.has(e)){var i,r=this._instance.getFeatureFlag(e),s=null==(i=this.ta)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&this.ea(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){var e=oi.getWindowLocation();if(null!=e&&e.search){var t=sm(null==e?void 0:e.search,"__experiment_id"),i=sm(null==e?void 0:e.search,"__experiment_variant");t&&i&&(oi.Xs("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.ra(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.Ne.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Ne.disable_web_experiments&&!i)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.Ne.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}ra(e,t,i){var r=i.filter(t=>t.id===e);r&&r.length>0&&(oi.Xs("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.ea(r[0].name,t,r[0].variants[t].transforms))}static ia(e,t){return!ee(e.conditions)&&oi.na(e,t)&&oi.sa(e)}static na(e,t){if(ee(e.conditions)||ee(null==(r=e.conditions)?void 0:r.url))return!0;var i=oi.getWindowLocation();if(i){var r,s,n,a,o=r$(t,i.href);return null==(s=e.conditions)||!s.url||ot[null!=(n=null==(a=e.conditions)?void 0:a.urlMatchType)?n:"icontains"](e.conditions.url,o)}return!1}
1static getWindowLocation(){return null==r?void 0:r.location}static sa(e){if(ee(e.conditions)||ee(null==(i=e.conditions)?void 0:i.utm))return!0;var t=sI();if(t.utm_source){var i,r,s,n,a,o,l,u,c,h=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==t.utm_source,p=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==t.utm_term;return h&&p&&v&&d}return!1}static Xs(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];t0.info("[WebExperiments] "+e,i)}ea(e,t,i){this._is_bot()?oi.Xs(oe):"control"!==t?i.forEach(i=>{if(i.selector){oi.Xs("applying transform of variant "+t+" for experiment "+e+" ",i);var r,s=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==s||s.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):oi.Xs("Control variants leave the page unmodified.")}_is_bot(){return n&&this._instance?nZ(n,this.Ne.custom_blocked_useragents):void 0}}var or=t1("[Conversations]"),os="Conversations not available yet.",on="console",oa="__posthogHandledLogsRequestError",oo=(e,t)=>{var i=e instanceof Error?e:Error(t);return i[oa]=!0,i},ol=e=>!!e&&"object"==typeof e&&!0===e[oa],ou={featureFlags:class{constructor(e){this.aa=!1,this.oa=!1,this.la=!1,this.ua=!1,this.ha=!1,this.da=!1,this.va=!1,this.ca=!1,this.fa=0,this.pa=()=>{var e=this.ga();this.fa=0,e&&this.reloadFeatureFlags()},this._instance=e,this.featureFlagEventHandlers=[],r&&ro(r,"online",this.pa)}destroy(){null==r||r.removeEventListener("online",this.pa)}get Ne(){return this._instance.config}get Tr(){return this._instance.persistence}ma(e){return this._instance.get_property(e)}ya(){var e,t;return null!=(e=null==(t=this.Tr)?void 0:t.Ci(this.Ne.feature_flag_cache_ttl_ms))&&e}ba(){return!!this.ya()&&(this.ca||this.la||(this.ca=!0,a5.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}_a(){var e,t=null!=(e=this.Ne.evaluation_contexts)?e:this.Ne.evaluation_environments;return!this.Ne.evaluation_environments||this.Ne.evaluation_contexts||this.va||(a5.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.va=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||a5.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}wa(){return this._a().length>0}ka(){var e=this.Ne.flag_keys;if(!J(e)){if(G(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||a5.error("Invalid flag key found:",e,"Expected non-empty string"),t});a5.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,i=this._instance.config,r=null!=(e=null==(t=i.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(r).length){var s,n,a=null!=(s=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)?s:{},o=Object.keys(r).filter(e=>!!r[e]).reduce((e,t)=>(e[t]=r[t]||!1,e),{}),l=Object.keys(a).filter(e=>o[e]).reduce((e,t)=>(a[t]&&(e[t]=a[t]),e),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(e,t,i){var r,s,n=null!=i&&i.merge&&null!=(r=this.ma(im))?r:{},a=null!=i&&i.merge&&null!=(s=this.ma(ix))?s:{},o=y({},n,e),l=y({},a,t),u={};for(var c of Object.entries(o)){var h=c[0],d=c[1];u[h]={key:h,enabled:x(d),variant:E(d),reason:void 0,metadata:J(null==l?void 0:l[h])?void 0:{id:0,version:void 0,description:void 0,payload:l[h]}}}this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.oa}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.ma(iw),t=this.ma(ik),i=this.ma(iP);if(!i&&!t)return e||{};var r=rt({},e||{});for(var s of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=r[s],l=null==t?void 0:t[s],u=J(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,c=J(l)?o.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[s],d=y({},o,{enabled:u,variant:u?null!=c?c:null==o?void 0:o.variant:void 0});u!==(null==o?void 0:o.enabled)&&(d.original_enabled=null==o?void 0:o.enabled),c!==(null==o?void 0:o.variant)&&(
1d.original_variant=null==o?void 0:o.variant),h&&(d.metadata=y({},null==o?void 0:o.metadata,{payload:h,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),r[s]=d}return this.aa||(a5.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.aa=!0),r}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var r=e[i];return{key:i,enabled:x(r),variant:E(r),payload:w(t[i])}})}getFlagVariants(){var e=this.ma(im),t=this.ma(ik);if(!t)return e||{};for(var i=rt({},e),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.aa||(a5.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.aa=!0),i}getFlagPayloads(){var e=this.ma(ix),t=this.ma(iP);if(!t)return e||{};for(var i=rt({},e||{}),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.aa||(a5.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.aa=!0),i}reloadFeatureFlags(){this.ua||this.Ne.advanced_disable_feature_flags||this.ga()||this.xa||(this._instance.vn.emit("featureFlagsReloading",!0),this.xa=setTimeout(()=>{this.Sa()},5))}Ca(){clearTimeout(this.xa),this.xa=void 0}ensureFlagsLoaded(){this.oa||this.la||this.xa||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ua=e}Sa(e){var t;if(this.Ca(),!this._instance.Ji()&&!this.ga())if(this.la)this.ha=!0;else{var i=this.Ne.token,r=this.ma(t6),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:y({},(null==(t=this.Tr)?void 0:t.get_initial_props())||{},this.ma(iT)||{},{$lib:_.LIB_NAME,$lib_version:_.LIB_VERSION}),group_properties:this.ma(iI),timezone:sA()};Z(r)||J(r)||(s.$device_id=r),(null!=e&&e.disableFlags||this.Ne.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.wa()&&(s.evaluation_contexts=this._a());var n=this.ka();J(n)||(s.flag_keys=n);var a=!!this.Ne.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Ne.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.la=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this.Ne.disable_compression?void 0:sH.Base64,timestampMode:"body",timeout:this.Ne.feature_flag_request_timeout_ms,callback:e=>{var t,i,r,n=!0;if(this.Ma(e.statusCode),200===e.statusCode&&(this.ha||(this.$anon_distinct_id=void 0),n=!1),this.la=!1,!s.disable_flags||this.ha){this.da=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));(u&&o.push("quota_limited"),null==(r=this.Tr)||r.register({[iL]:o}),u)?a5.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."):(s.disable_flags||this.receivedFeatureFlags(null!=(l=e.json)?l:{},n,{partialResponse:a}),this.ha&&(this.ha=!1,this.Sa()))}}})}}ga(){return sw(this.fa,3)}Ma(e){this.fa=sx(e,this.fa,3,()=>a5.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(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.da)if(this.oa||this.getFlags()&&this.getFlags().length>0){if(!this.ba()){var r=this.getFeatureFlagResult(e,t);return null!=(i=null==r?void 0:r.variant)?i:null==r?void 0:r.enabled}}else a5.warn('getFeatureFlag for key "'+e+a4)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.da)if(this.oa||this.getFlags()&&this.getFlags().length>0){if(!this.ba()){var i=this.getFlagVariants(),r=e in i,s=i[e],n=this.getFlagPayloads()[e],a=String(s),o=this.ma(iE)||void 0,l=this.ma(iD)||void 0,u=this.ma(iM)||{};if(this.Ne.advanced_feature_flags_dedup_per_session){var c,h=this._instance.get_session_id(),d=this.ma(iA);h&&h!==d&&(u={},null==(c=this.Tr)||c.register({[iM]:u,[iA]:h}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(a))){G(u[e])?u[e].push(a):u[e]=[a],null==(_=this.Tr)||_.register({[iM]:u});var p=this.getFeatureFlagDetails(e),v=[...null!=(f=this.ma(iL))?f:[]];J(s)&&v.push("flag_missing");var g={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(m=this.Ne.bootstrap)||null==(m
1=m.featureFlags)?void 0:m[e])||null,$feature_flag_bootstrapped_payload:(null==(y=this.Ne.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])||null,$used_bootstrap_value:!this.da};J(null==p||null==(b=p.metadata)?void 0:b.has_experiment)||(g.$feature_flag_has_experiment=p.metadata.has_experiment),J(null==p||null==(x=p.metadata)?void 0:x.version)||(g.$feature_flag_version=p.metadata.version);var _,f,m,y,b,x,E,S,k,P,T,I,R=null!=(E=null==p||null==(S=p.reason)?void 0:S.description)?E:null==p||null==(k=p.reason)?void 0:k.code;R&&(g.$feature_flag_reason=R),null!=p&&null!=(P=p.metadata)&&P.id&&(g.$feature_flag_id=p.metadata.id),J(null==p?void 0:p.original_variant)&&J(null==p?void 0:p.original_enabled)||(g.$feature_flag_original_response=J(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(T=p.metadata)&&T.original_payload&&(g.$feature_flag_original_payload=null==p||null==(I=p.metadata)?void 0:I.original_payload),v.length&&(g.$feature_flag_error=v.join(",")),this._instance.capture("$feature_flag_called",g)}if(r)return{key:e,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:w(n)}}}else a5.warn('getFeatureFlagResult for key "'+e+a4)}getRemoteConfigPayload(e,t){var i=this.Ne.token,r={distinct_id:this._instance.get_distinct_id(),token:i,person_properties:{$lib:_.LIB_NAME,$lib_version:_.LIB_VERSION}};this.wa()&&(r.evaluation_contexts=this._a());var s=this.ka();J(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Ne.disable_compression?void 0:sH.Base64,timestampMode:"body",timeout:this.Ne.feature_flag_request_timeout_ms,callback(i){var r,s=null==(r=i.json)?void 0:r.featureFlagPayloads;t((null==s?void 0:s[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this.da)return t.defaultValue;if(!(this.oa||this.getFlags()&&this.getFlags().length>0))return a5.warn('isFeatureEnabled for key "'+e+a4),t.defaultValue;var i=this.getFeatureFlag(e,t);return J(i)?t.defaultValue:!!i}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){if(this.Tr){this.oa=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,i,r,s,n){void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s={});var a,o=((a=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(a).map(e=>{var t;return[e,null!=(t=a[e].variant)?t:a[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(a).filter(e=>a[e].enabled).filter(e=>{var t;return null==(t=a[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=a[e].metadata)?void 0:t.payload]}))):e.featureFlags&&a5.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),l=o.flags,u=o.featureFlags,c=o.featureFlagPayloads;if(u){var h=e.requestId,d=e.evaluatedAt;if(G(u)){a5.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(u)for(var v=0;u.length>v;v++)p[u[v]]=!0;t&&t.register({[iy]:u,[im]:p,[iS]:!1})}else{var g=u,_=c,f=l;if(null!=n&&n.partialResponse)g=y({},i,g),_=y({},r,_),f=y({},s,f);else if(e.errorsWhileComputingFlags)if(l){var m=new Set(Object.keys(l).filter(e=>{var t;return!(null!=(t=l[e])&&t.failed)}));g=y({},i,Object.fromEntries(Object.entries(g).filter(e=>m.has(e[0])))),_=y({},r,Object.fromEntries(Object.entries(_||{}).filter(e=>m.has(e[0])))),f=y({},s,Object.fromEntries(Object.entries(f||{}).filter(e=>m.has(e[0]))))}else g=y({},i,g),_=y({},r,_),f=y({},s,f);t&&t.register(y({[iy]:Object.keys(a7(g)),[im]:g||{},[ix]:_||{},[iw]:f||{},[iS]:!0===e.minimalFlagCalledEvents},h?{[iE]:h}:{},d?{[iD]:d}:{}))}}}(e,this.Tr,r,s,n,i),t||(this.ca=!1),this.Ta(t)}}override(e,t){void 0===t&&(t=!1),a5.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.Tr)return a5.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.Tr.unregister(ik),this.Tr.unregister(iP),this.Ta(),a6.info("All overrides cleared");if(G(e)){var t,i=a8(e);return this.Tr.register({[ik]:i}),this.Ta(),a6.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this.aa=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this.Tr.unregister(ik),a6.info("Flag overrides cleared");else if(e.flags){if(G(e.flags)){var r=a8(e.flags);this.Tr.register({[ik]:r})}else this.Tr.register({[ik]:e.flags});a6.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.Tr.unregister(iP),a6.info("Payload overrides cleared")):e.payloads&&(this.Tr.register({[iP]:e.payloads}),a6.info("Payload overrides set",{payloads:e.payloads}))),void this.Ta()}if(e&&"object"==typeof e)return this.Tr.register({[ik]:e}),this.Ta(),a6.info("Flag overrides set",{flags:e});a5.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.oa){var t=this.Ea(),i=t.flags,r=t.flagVariants;try{e(i,r)}catch(e){a5.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,s=(this.ma(ib)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=y({},this.getFlagVariants(),{[e]:t});null==(r=this.Tr)||r.register({[iy]:Object.keys(a7(o)),[im]:o}),this.Ta()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this.ma(ib),s=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Ne.token+s),method:"GET",timestampMode:"query",callback:t=>{var i,r;if(t.json){var s=t.json.earlyAccessFeatures;return null==(i=this.Tr)||i.unregister(ib),null==(r=this.Tr)||r.register({[ib]:s}),e(s)}}})}Ea(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}Ta(e){var t=this.Ea(),i=t.flags,r=t.flagVariants;
1this.featureFlagEventHandlers.forEach(t=>{try{t(i,r,{errorsLoading:e})}catch(e){a5.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.ma(iT)||{},r=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,n={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(n[a]=s[a]));this._instance.register({[iT]:y({},i,n,r)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=y({},this.ma(iT)||{});e.forEach(e=>{delete i[e]}),this._instance.register({[iT]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(iT),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.ma(iI)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=y({},i[t],e[t]),delete e[t]}),this._instance.register({[iI]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.ma(iI)||{};this._instance.register({[iI]:y({},t,{[e]:{}})})}else this._instance.unregister(iI)}reset(){this.oa=!1,this.la=!1,this.ua=!1,this.ha=!1,this.da=!1,this.$anon_distinct_id=void 0,this.Ca(),this.aa=!1,this.fa=0}}},oc=y({productTours:class{get Tr(){return this._instance.persistence}constructor(e){this.zo=null,this.Wo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t,i,r=e.config;if("productTours"in r){if(this.Tr&&this.Tr.register({[io]:!!r.productTours}),!aV(this._instance))return!this.zo&&ee(null==(t=this.Tr)?void 0:t.props[iN])||az.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.zo)||i.stop(),this.zo=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.zo&&aV(this._instance)&&this.ai(()=>this.Vo())}ai(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?az.error("Could not load product tours script",t):e()})}Vo(){var e;!this.zo&&null!=(e=g.__PosthogExtensions__)&&e.generateProductTours&&(this.zo=g.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!G(this.Wo)||t){var i=this.Tr;if(i){var r=i.props[iN];if(G(r)&&!t)return this.Wo=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:t=>{if(aV(this._instance)){var r=t.statusCode;if(200!==r||!t.json){var s="Product Tours API could not be loaded, status: "+r;return 0===r?t.error||az.warn(s):az.error(s),void e([],{isLoaded:!1,error:s})}var n=G(t.json.product_tours)?t.json.product_tours:[];this.Wo=n,i&&i.register({[iN]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Wo,{isLoaded:!0})}getActiveProductTours(e){ee(this.zo)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.zo.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.zo)||t.showTourById(e)}previewTour(e){this.zo?this.zo.previewTour(e):this.ai(()=>{var t;this.Vo(),null==(t=this.zo)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.zo)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.zo)||e.nextStep()}previousStep(){var e;null==(e=this.zo)||e.previousStep()}clearCache(){var e;this.Wo=null,null==(e=this.Tr)||e.unregister(iN)}resetTour(e){var t;null==(t=this.zo)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.zo)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.zo)||t.cancelPendingTour(e)}}},ou),oh=y({surveys:class{get Ne(){return this._instance.config}constructor(e){this.ul=void 0,this._surveyManager=null,this.hl=!1,this.dl=[],this.vl=null,this.cl=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Ne.disable_surveys){if(!e.ok)return at.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(ee(t))return at.warn("Flags not loaded yet. Not loading surveys.");var i=G(t);this.ul=i?t.length>0:t,at.info("flags response received, isSurveysEnabled: "+this.ul),this.loadIfEnabled()}}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],i=0;i<localStorage.length;i++){var r=localStorage.key(i);(null!=r&&r.startsWith(ai)||null!=r&&r.startsWith("inProgressSurvey_"))&&t.push(r)}
1t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.hl)at.info("Already initializing surveys, skipping...");else if(this.Ne.disable_surveys)at.info(a0);else if(this.Ne.cookieless_mode&&this._instance.consent.isOptedOut())at.info("Not loading surveys in cookieless mode without consent.");else{var e=null==g?void 0:g.__PosthogExtensions__;if(e){if(!J(this.ul)||this.Ne.advanced_enable_surveys){var t=this.ul||this.Ne.advanced_enable_surveys;this.hl=!0;try{var i=e.generateSurveys;if(i)return void this.fl(i,t);var r=e.loadExternalDependency;if(!r)return void this.pl(iX);r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.pl("Could not load surveys script",i):this.fl(e.generateSurveys,t)})}catch(e){throw this.pl("Error initializing surveys",e),e}finally{this.hl=!1}}}else at.error("PostHog Extensions not found.")}}fl(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new aQ(this._instance),at.info("Surveys loaded successfully"),this.gl({isLoaded:!0})}pl(e,t){at.error(e,t),this.gl({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.dl.push(e),this._surveyManager&&this.gl({isLoaded:!0}),()=>{this.dl=this.dl.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Ne.disable_surveys)return at.info(a0),e([]);var i,r=this._instance.get_property(iR);if(r&&!t)return e(r,{isLoaded:!0}),void(this.ml()&&this.getSurveys(()=>{},!0));"undefined"!=typeof Promise&&this.vl?this.vl.then(t=>e(t.surveys,t.context)):("undefined"!=typeof Promise&&(this.vl=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Ne.token),method:"GET",timestampMode:"query",timeout:this.Ne.surveys_request_timeout_ms,callback:t=>{this.vl=null;var r=t.statusCode;if(200!==r||!t.json){var s="Surveys API could not be loaded, status: "+r;0!==r?at.error(s):t.error||at.warn(s),this.cl=Date.now();var n={isLoaded:!1,error:s};return e([],n),void(null==i||i({surveys:[],context:n}))}this.cl=null;var a,o,l=t.json.surveys||[],u=l.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(ae(e)||!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length))});u.length>0&&(null==(o=this._surveyEventReceiver)||o.register(u)),null==(a=this._instance.persistence)||a.register({[iR]:l,[iF]:Date.now()});var c={isLoaded:!0};e(l,c),null==i||i({surveys:l,context:c})}}))}ml(){return this.yl()&&!this.vl&&!this.bl()}yl(){var e=this._instance.get_property(iF);return et(e)&&Date.now()-e>3e5}bl(){return et(this.cl)&&3e5>Date.now()-this.cl}markSurveyAsSeen(e,t){var i;ar({id:e,current_iteration:null!=(i=null==t?void 0:t.iteration)?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}gl(e){for(var t of this.dl)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){at.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!ee(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);at.warn("init was not called")}_l(e){var t=null;return this.getSurveys(i=>{var r;t=null!=(r=i.find(t=>t.id===e))?r:null}),t}wl(e){if(ee(this._surveyManager))return{eligible:!1,reason:aZ};var t="string"==typeof e?this._l(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}kl(e){if(ee(this._surveyManager))return{eligible:!1,reason:aZ};var t="string"==typeof e?this._l(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ee(this._surveyManager))return at.warn("init was not called"),{visible:!1,disabledReason:aZ};var t=this.kl(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ee(this._surveyManager)?(at.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:aZ})):new Promise(i=>{this.getSurveys(t=>{var r,s=null!=(r=t.find(t=>t.id===e))?r:null;if(s){var n=this.kl(s);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var r;if(ee(this._surveyManager))at.warn("init was not called");else{var s="string"==typeof e?this._l(e):e;if(null!=s&&s.id)if(as.includes(s.type)){var n=null==a?void 0:a.querySelector(t);if(n)return null!=(r=s.appearance)&&r.surveyPopupDelaySeconds?(at.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;at.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(s,n,i),at.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n,i);at.warn("Survey element not found")}else at.warn("Surveys of type "+s.type+" cannot be rendered in the app");else at.warn("Survey not found")}}displaySurvey(e,t){var i;if(ee(this._surveyManager))at.warn("init was not called");else{var r=this._l(e);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=y({},r,{appearance:y({},r.appearance,{surveyPopupDelaySeconds:0})}
1)),t.displayType!==sZ.Popover&&t.initialResponses&&at.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.wl(r);if(!n.eligible)return void at.warn("Survey is not eligible to be displayed: ",n.reason)}t.displayType!==sZ.Inline?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else at.warn("Survey not found")}}cancelPendingSurvey(e){ee(this._surveyManager)?at.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}},ou),od=y({experiments:oi},ou),op=y({},ou,{sessionRecording:class{get Ne(){return this._instance.config}get Tr(){return this._instance.persistence}get started(){var e;return!(null==(e=this.Ia)||!e.isStarted)}get status(){var e,t;return this.Pa===aD||this.Pa===aU?this.Pa:null!=(e=null==(t=this.Ia)?void 0:t.status)?e:this.Pa}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Pa=aA,this.Ra=void 0,this.Aa=!1,this.Fa=(()=>{if(null==a||!a.visibilityState||"visible"===a.visibilityState)return!0;var e,t=null==r||null==(e=r.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(e=>"visible"===e.name)})(),this.Ie=()=>{var e;"visible"===(null==a?void 0:a.visibilityState)&&(this.Fa=!0,null==(e=this.Ia)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw aB.error("started without valid sessionManager"),Error(aj+" started without valid sessionManager. This is a bug.");if(this.Ne.cookieless_mode===iZ)throw Error(aj+' cannot be used with cookieless_mode="always"');null!=a&&a.addEventListener&&ro(a,"visibilitychange",this.Ie)}initialize(){this.startIfEnabledOrStop()}dispose(){this.Aa=!0,null==a||null==a.removeEventListener||a.removeEventListener("visibilitychange",this.Ie),this.stopRecording()}get La(){var e,t=!(null==(e=this._instance.get_property(iu))||!e.enabled),i=!this.Ne.disable_session_recording,s=this.Ne.disable_session_recording||this._instance.consent.isOptedOut();return r&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!(this.Aa||this.La&&null!=(t=this.Ia)&&t.isStarted)){var i=!J(Object.assign)&&!J(Array.from);this.La&&i?(this.Oa(e),aB.info("starting")):(this.Pa=aA,this.stopRecording())}}Oa(e){var t,i,r;this.La&&(this.Pa!==aD&&this.Pa!==aU&&(this.Pa=aL),null!=g&&null!=(t=g.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=g.__PosthogExtensions__)&&i.initSessionRecording?this.Da(e):null==(r=g.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.$a,t=>{if(t)return aB.error("could not load recorder",t);this.Da(e)}))}stopRecording(){var e,t;null==(e=this.Ra)||e.call(this),this.Ra=void 0,null==(t=this.Ia)||t.stop()}Na(){var e,t;null==(e=this.Ra)||e.call(this),this.Ra=void 0,null==(t=this.Ia)||t.discard()}qa(){var e,t;null==(e=this.Tr)||e.unregister(i_),null==(t=this.Tr)||t.unregister(ic)}ja(e,t){if(ee(e))return null;var i=et(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(aB.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Ba(e){if(this.Tr){var t,i,r=this.Tr,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.ja(null==(t=this.Ne.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.ja(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:n;ee(a)&&this.qa();var o=null==i?void 0:i.minimumDurationMilliseconds;r.register({[iu]:y({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:y({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:J(o)?null:o,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this.Ra)||t.call(this),this.Ra=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.Ba(t),void this.Na()):(this.Ba(t),void this.startIfEnabledOrStop()):(this.Pa===aD&&
1(this.Pa=aU,aB.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.Ia)&&i.log?this.Ia.log(e,t):aB.warn("log called before recorder was ready")}get $a(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(iu);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Ha(){var e,t,i=this._instance.get_property(iu);if(!i)return!1;try{t="object"==typeof i?i:JSON.parse(i)}catch(e){return aB.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}var r=null!=(e=t.cache_timestamp)?e:Date.now();return 36e5>=Date.now()-r}Da(e){var t,i,r,s;if(!this.Aa){if(null==(t=g.__PosthogExtensions__)||!t.initSessionRecording)return aB.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[iJ]:!0});if(this.Ia||(this.Ia=null==(s=g.__PosthogExtensions__)?void 0:s.initSessionRecording(this._instance,this.Fa),this.Ia._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ha()){if(this.Pa===aU||this.Pa===aD)return;return this.Pa=aD,aB.info("persisted remote config is stale, requesting fresh config before starting"),void new s4(this._instance).load()}this.Pa=aL,null==(i=(r=this.Ia).setDocumentWasEverVisible)||i.call(r,this.Fa),this.Ia.start(e)}}onRRwebEmit(e){var t;null==(t=this.Ia)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Ia||null==(t=this.Tr)||t.register({[id]:!0}),null==(e=this.Ia)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Ia||null==(t=this.Tr)||t.register({[ih]:!0}),null==(e=this.Ia)||e.overrideSampling()}overrideTrigger(e){var t,i;this.Ia||null==(i=this.Tr)||i.register({["url"===e?ip:iv]:!0}),null==(t=this.Ia)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Ia)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Ia)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.Ua=!1,this.za=null,this.Wa=!1,this.Va=!1,this.instance=e,this.rageclicks=new aI(e.config.rageclick),this.Za=null}initialize(){this.startIfEnabled()}get Ne(){var e,t,i=K(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}Ga(){if(this.isBrowserSupported()){if(r&&a){var e=e=>{e=e||(null==r?void 0:r.event);try{this.Qa(e)}catch(e){aF.error("Failed to capture event",e)}};if(ro(a,"submit",e,{capture:!0}),ro(a,"change",e,{capture:!0}),ro(a,"click",e,{capture:!0}),this.Ne.capture_copied_text){var t=e=>{e=e||(null==r?void 0:r.event);try{this.Qa(e,aR)}catch(e){aF.error("Failed to capture copy/cut event",e)}};ro(a,"copy",t,{capture:!0}),ro(a,"cut",t,{capture:!0})}}}else aF.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ua&&(this.Ga(),this.Ua=!0)}onRemoteConfig(e){if(this.Wa=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.Va=t.elementsChainAsString);var i=t.autocapture_opt_out;er(i)&&(this.instance.persistence&&this.instance.persistence.register({[t9]:i}),this.za=i),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.Za=e}getElementSelectors(e){var t,i=[];return null==(t=this.Za)||t.forEach(t=>{var r=null==a?void 0:a.querySelectorAll(t);null==r||r.forEach(r=>{e===r&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[t9],r=this.za,s=this.instance.Ji()&&!this.Wa;if(Z(r)&&!er(i)&&!s)return!1;var n=null!=(t=this.za)?t:!!i;return!!this.instance.config.autocapture&&!n}Qa(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,s=rq(e);rA(s)&&(s=s.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&rZ(s,this.instance.config.rageclick)&&this.Qa(e,"$rageclick");var n=t===aR;if(s&&function(e,t,i,s,n,a){if(!r||r0(e)||null!=i&&i.url_allowlist&&!rU(i.url_allowlist,a)||null!=i&&i.url_ignorelist&&rU(i.url_ignorelist,a))return!1;if(null!=i&&i.dom_event_allowlist){var o,l=i.dom_event_allowlist;if(l&&!l.some(e=>t.type===e))return!1}var u=r1(e,s),c=u.parentIsUsefulElement,h=u.targetElementList;if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(J(i))return!0;var r,s=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(r=s(n))return r.v;return!1}(h,i)||!rV(h,null==i?void 0:i.css_selector_allowlist)||rV(h,null!=(o=null==i?void 0:i.css_selector_ignorelist)?o:rW))return!1;try{var d=r.getComputedStyle(e);
1if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return c?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(rz.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.Ne,n,n?["copy","cut"]:void 0,this.instance)){var a=function(e,t){var i,s,n=t.e,a=t.maskAllElementAttributes,o=t.maskAllText,l=t.elementAttributeIgnoreList,u=t.elementsChainAsString,c=t.disableCaptureUrlHashes;if(!rN(e))return{props:{}};for(var h=[e],d=new Set([e]),p=e;p.parentNode&&!rM(p,"body")&&1e3>h.length;)if(rL(p.parentNode)){var v=p.parentNode.host;if(d.has(v))break;d.add(v),h.push(v),p=v}else{if(!rN(p.parentNode)||d.has(p.parentNode))break;d.add(p.parentNode),h.push(p.parentNode),p=p.parentNode}var g,_=[],f={},m=!1,b=!1;if(re(h,e=>{var t=r2(e);if(rM(e,"a")){var i=e.getAttribute("href");m=!!(t&&i&&se(i))&&(c?tc(i):i)}U(rj(e),"ph-no-capture")&&(b=!0),_.push(function(e,t,i,r,s){void 0===s&&(s=!1);var n=e.tagName.toLowerCase(),a={tag_name:n};rz.indexOf(n)>-1&&!i&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?a$(1024,st(e)):a$(1024,rH(e)));var o=rj(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),re(e.attributes,function(i){var n;if((!r3(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!t&&se(i.value)&&(!X(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=rD(o).join(" ")),a["attr__"+i.name]=a$(1024,"href"===i.name&&s?tc(o):o)}});for(var l=1,u=1,c=e;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!rN(t));return t}(c);)l++,c.tagName===e.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(e,a,o,l,c)),rt(f,function(e){if(!r2(e))return{};var t={};return re(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),r=e.value;i&&r&&se(r)&&(t[i]=r)}}),t}(e))}),b)return{props:{},explicitNoCapture:b};if(o||(_[0].$el_text=rM(e,"a")||rM(e,"button")?st(e):rH(e)),m){_[0].attr__href=m;var w,x,E=null==(w=sf(m))?void 0:w.host,S=null==r||null==(x=r.location)?void 0:x.host;E&&S&&E!==S&&(g=m)}return{props:rt({$event_type:n.type,$ce_version:1},u?{}:{$elements:_},{$elements_chain:_.map(e=>{var t,i,r={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:function(e){var t=e.attr__class;if(t)return G(t)?t:rD(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return ri(e).filter(e=>0===e[0].indexOf("attr__")).forEach(e=>r.attributes[e[0]]=e[1]),r}).map(e=>{var t,i,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))r+="."+s.replace(/"/g,"");var n=y({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return ri(n).sort((e,t)=>e[0].localeCompare(t[0])).forEach(e=>{var t=e[1];return a[si(e[0].toString())]=si(t.toString())}),(r+=":")+ri(a).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";")},null!=(i=_[0])&&i.$el_text?{$el_text:null==(s=_[0])?void 0:s.$el_text}:{},g&&"click"===n.type?{$external_click_url:g}:{},f)}}(s,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Ne.element_attribute_ignorelist,elementsChainAsString:this.Va,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=a.props;if(a.explicitNoCapture)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(o.$element_selectors=l),t===aR){var u,c=rB(null==r||null==(u=r.getSelection())?void 0:u.toString()),h=e.type||"clipboard";if(!c)return!1;o.$selected_content=c,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return W(null==a?void 0:a.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ja=(null==r||null==(t=r.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(t0.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ka&&this.Ka(),this.Ka=void 0,t0.info("History API monitoring stopped")}monitorHistoryChanges(){r&&r.history&&(this.Ya("pushState"),this.Ya("replaceState"),this.Xa())}Ya(e){var t;if(r&&(null==(t=r.history[e])||!t.__posthog_wrapped__)){var i=this;!function(e,t,i){try{if(!(t in e))return aC;
1var r={next:e[t]},s=i(function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];return r.next.apply(this,t)});W(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=s,()=>{if(e[t]!==s)for(var i=e[t];W(i)&&i.__posthog_layer__;){var n=i.__posthog_layer__;if(n.next===s)return void(n.next=r.next);i=n.next}else e[t]=r.next}}catch(e){return aC}}(r.history,e,t=>function(r,s,n){t.call(this,r,s,n),i.eo(e)})}}eo(e){try{var t,i=null==r||null==(t=r.location)?void 0:t.pathname;if(!i)return;i!==this.Ja&&this.isEnabled&&this._instance.capture(i6,{navigation_type:e}),this.Ja=i}catch(t){t0.error("Error capturing "+e+" pageview",t)}}Xa(){if(!this.Ka){var e=()=>{this.eo("popstate")};ro(r,"popstate",e),this.Ka=()=>{r&&r.removeEventListener("popstate",e)}}}},heatmaps:class{get Ne(){return this.instance.config}constructor(e){var t;this.io=!1,this.Ua=!1,this.ro=null,this.instance=e,this.io=!(null==(t=this.instance.persistence)||!t.props[ie]),this.rageclicks=new aI(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return K(this.Ne.capture_heatmaps)&&this.Ne.capture_heatmaps.flush_interval_milliseconds&&(e=this.Ne.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ee(this.Ne.capture_heatmaps)?ee(this.Ne.enable_heatmaps)?this.io:this.Ne.enable_heatmaps:!1!==this.Ne.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.Ua||(aH.info("starting..."),this.no(),this.Ie());else{var e;clearInterval(null!=(e=this.ro)?e:void 0),this.so(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ie]:i}),this.io=i,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}ao(e){aq(e.originalEvent)&&this.ke(e.originalEvent,"deadclick")}Ie(){this.ro&&clearInterval(this.ro),this.ro="visible"===(null==a?void 0:a.visibilityState)?setInterval(this.pr.bind(this),this.flushIntervalMilliseconds):null}no(){r&&a&&(this.oo=this.pr.bind(this),ro(r,i5,this.oo),this.lo=e=>this.ke(e||(null==r?void 0:r.event)),ro(a,"click",this.lo,{capture:!0}),this.uo=e=>this.ho(e||(null==r?void 0:r.event)),ro(a,"mousemove",this.uo,{capture:!0}),this.do=new sa(this.instance,ss,this.ao.bind(this)),this.do.startIfEnabledOrStop(),this.vo=this.Ie.bind(this),ro(a,i3,this.vo),this.Ua=!0)}so(){var e;r&&a&&(this.oo&&r.removeEventListener(i5,this.oo),this.lo&&a.removeEventListener("click",this.lo,{capture:!0}),this.uo&&a.removeEventListener("mousemove",this.uo,{capture:!0}),this.vo&&a.removeEventListener(i3,this.vo),clearTimeout(this.co),null==(e=this.do)||e.stop(),this.Ua=!1)}fo(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(e,t,i){for(var s=e;s&&rN(s)&&!rM(s,"body")&&s!==i;){var n,a,o,l=void 0;try{l=null==(n=null!=(a=null==(o=s.ownerDocument)?void 0:o.defaultView)?a:r)?void 0:n.getComputedStyle(s).position}catch(e){break}if(U(t,l))return!0;s=rG(s)}return!1}(rq(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:i),target_fixed:a,type:t}}ke(e,t){var i;if(void 0===t&&(t="click"),!rC(e.target)&&aq(e)){var r=this.fo(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&rZ(rq(e),this.instance.config.rageclick)&&this.Vt(y({},r,{type:"rageclick"})),this.Vt(r)}}ho(e){!rC(e.target)&&aq(e)&&(clearTimeout(this.co),this.co=setTimeout(()=>{this.Vt(this.fo(e,"mousemove"))},500))}Vt(e){if(r){var t=this.Ne.disable_capture_url_hashes?tc(r.location.href):r.location.href,i=this.Ne.custom_personal_data_properties,s=sy(t,this.Ne.mask_personal_data_properties?[...sS,...i||[]]:[],sP);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(e)}}pr(){this.R&&!Y(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:sa,webVitalsAutocapture:class{constructor(e){var t;this.io=!1,this.Ua=!1,this.R={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.po=()=>{clearTimeout(this.mo),this.mo=void 0,0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",y({$current_url:this.R.url},this.R.metrics.reduce((e,t)=>
1y({},e,{["$web_vitals_"+t.name+"_event"]:y({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{}))),this.R={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.yo=e=>{var t;if(this.R=this.R||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},ee(null==e?void 0:e.name)||ee(null==e?void 0:e.value))aM.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,r=this.bo(i);if(!J(r)){var s=et(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+r;if(!this._o||this._o>e.value){this.R.navigationKey!==s&&(this.po(),this.mo=setTimeout(this.po,this.flushToCaptureTimeoutMs)),J(this.R.navigationKey)&&(this.R.navigationKey=s,this.R.url=r),this.R.firstMetricTimestamp=J(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=y({},e,i?{navigationURL:r}:{},{$current_url:r,timestamp:Date.now()});J(n)||(a.$session_id=n.sessionId,a.$window_id=n.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.po()}else aM.error("Ignoring metric with value >= "+this._o,e)}}},this.wo=()=>{if(!this.Ua){var e,t,i,r,s=g.__PosthogExtensions__,n=null==s?void 0:s.postHogWebVitalsCallbacksByFlavor,a=(null==n?void 0:n[this.ko])||("web-vitals"===this.ko&&J(n)?null==s?void 0:s.postHogWebVitalsCallbacks:void 0);if(J(a)||(e=a.onLCP,t=a.onCLS,i=a.onFCP,r=a.onINP),e&&t&&i&&r){var o={reportSoftNavs:this.useSoftNavs};this.allowedMetrics.indexOf("LCP")>-1&&e(this.yo.bind(this),o),this.allowedMetrics.indexOf("CLS")>-1&&t(this.yo.bind(this),o),this.allowedMetrics.indexOf("FCP")>-1&&i(this.yo.bind(this),o),this.allowedMetrics.indexOf("INP")>-1&&r(this.yo.bind(this),o),this.Ua=!0}else aM.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.io=!(null==(t=this._instance.persistence)||!t.props[is]),this.startIfEnabled()}get xo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=K(this.xo)?null==(e=this.xo)?void 0:e.web_vitals_allowed_metrics:void 0;return ee(i)?(null==(t=this._instance.persistence)?void 0:t.props[il])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(K(this.xo)?this.xo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=K(this.xo)?this.xo.web_vitals_attribution:void 0;return null!=e&&e}get useSoftNavs(){var e=K(this.xo)?this.xo.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}get _o(){var e=K(this.xo)&&et(this.xo.__web_vitals_max_value)?this.xo.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==o?void 0:o.protocol;if("http:"!==e&&"https:"!==e)return aM.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=K(this.xo)?this.xo.web_vitals:er(this.xo)?this.xo:void 0;return er(t)?t:this.io}startIfEnabled(){this.isEnabled&&!this.Ua&&(aM.info("enabled, starting..."),this.ai(this.wo))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var i=K(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=K(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[is]:i}),this._instance.persistence.register({[il]:r})),this.io=i,this.startIfEnabled()}}}get ko(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}ai(e){var t=g.__PosthogExtensions__,i=this.ko,r=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=r&&r[i]||"web-vitals"===i&&J(r)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,i,t=>{t?aM.error("failed to load script",t):e()})}bo(e){var t=e||(null==r?void 0:r.location.href);if(t){var i=this._instance.config.disable_capture_url_hashes?tc(t):t,s=this._instance.config.custom_personal_data_properties;return sy(i,this._instance.config.mask_personal_data_properties?[...sS,...s||[]]:[],sP)}aM.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t;this.wo=()=>{var e;if(r&&this.isEnabled&&null!=(e=g.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=g.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=g.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=g.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.So&&this.Ne.capture_unhandled_errors&&(this.So=t(this.captureException.bind(this))),!this.Co&&this.Ne.capture_unhandled_rejections&&(this.Co=i(this.captureException.bind(this))),!this.Mo&&this.Ne.capture_console_errors&&(this.Mo=s(this.captureException.bind(this)))}catch(e){aO.error("failed to start",e),this.To()}}},this._instance=e,this.Eo=!(null==(t=this._instance.persistence)||!t.props[it]),this.Io=new ev(y({},function(e){var t,i,r,s;return void 0===e&&(e={}),{refillRate:null!=(t=null!=(i=e.exceptionRateLimiterRefillRate)?i:e.__exceptionRateLimiterRefillRate)?t:1,bucketSize:null!=(r=null!=(s=e.exceptionRateLimiterBucketSize)?s:e.__exceptionRateLimiterBucketSize)?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,rt:aO})),this.Ne=this.Po(),this.startIfEnabledOrStop()}Po(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return K(e)?t=y({},t,e):(J(e)?this.Eo:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Ne.capture_console_errors||this.Ne.capture_unhandled_errors||this.Ne.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(aO.info("enabled"),this.To(),this.ai(this.wo)):this.To()}ai(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return aO.error("failed to load script",t);e()})}To(){var e,t,i;null==(e=this.So)||e.call(this),this.So=void 0,null==(t=this.Co)||t.call(this),this.Co=void 0,null==(i=this.Mo)||i.call(this),this.Mo=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.Eo=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[it]:this.Eo}),this.Ne=this.Po(),this.startIfEnabledOrStop())}}onConfigChange(){this.Ne=this.Po()}captureException(e){var t,i,r,s=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.Io.consumeRateLimit(s)?aO.info("Skipping exception capture because of client rate limiting.",{exception:s}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,i;this.Ro=[],this.Ao=new tk([new tA,new tG,new tD,new tL,new tz,new tq,new tj,new tV],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var s=[],n=t.split("\n"),a=r;n.length>a;a++){var o=n[a];if(1024>=o.length){var l=tM.test(o)?o.replace(tM,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var c=u(l,e);if(c){s.push(c);break}}if(s.length>=50)break}}}if(!s.length)return[];var h=Array.from(s);return h.reverse(),h.slice(0,50).map(e=>y({},e,{filename:e.filename||(h[h.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",t$,tN)),this._instance=e,this.Ro=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(ii))?t:[],this.Fo=tX(this.Lo()),this.Oo=new tQ(this.Fo)}onConfigChange(){this.Fo=tX(this.Lo()),this.Oo.setConfig(this.Fo)}onRemoteConfig(e){var t,i,r;if(e.ok){var s=e.config;if("errorTracking"in s){var n=null!=(t=null==(i=s.errorTracking)?void 0:i.suppressionRules)?t:[],a=null==(r=s.errorTracking)?void 0:r.captureExtensionExceptions;this.Ro=n,this._instance.persistence&&this._instance.persistence.register({[ii]:this.Ro,[ir]:a})}}}get Do(){var e,t=!!this._instance.get_property(ir),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.Ao.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}
1addExceptionStep(e,t){if(this.Fo.enabled)try{if(!X(e)||0===e.trim().length)return void a9.warn("Ignoring exception step because message must be a non-empty string");var i=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,r)=>(tY.has(r)?t.push(r):i[r]=e[r],i),{}),droppedKeys:t}}(this.$o(t)),r=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&a9.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Oo.add(y({[tW]:e,[tK]:(new Date).toISOString()},r))}catch(e){a9.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){var t;try{var i=e.$exception_list;if(this.No(i)){if(this.qo(i))return this.jo("Exception dropped: matched a suppression rule"),void a9.info("Skipping exception capture because a suppression rule matched");if(!this.Do&&this.Bo(i))return this.jo("Exception dropped: thrown by a browser extension"),void a9.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Ho(i))return this.jo("Exception dropped: thrown by the PostHog SDK"),void a9.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.Fo.enabled&&ee(e.$exception_steps)?this.Uo(e):e,s="string"==typeof(t=globalThis._posthogReleaseId)&&t.length>0?t:void 0;s&&(r.$release_id=s);try{var n=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",jn:!0});return n&&this.Oo.clear(),n}catch(e){return a9.error("Failed to capture exception event. Dropping this exception.",e),void this.Oo.clear()}}catch(e){return void a9.error("Failed to process exception event. Ignoring this exception.",e)}}Uo(e){try{var t=this.Oo.getAttachable();return 0===t.length?e:y({},e,{$exception_steps:t})}catch(t){return a9.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}jo(e){this.Fo.enabled&&this.Oo.add({[tW]:e,[tK]:(new Date).toISOString()})}$o(e){return K(e)?y({},e):{}}Lo(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}qo(e){if(0===e.length)return!1;try{var t=e.reduce((e,t)=>{var i=t.type,r=t.value;return X(i)&&i.length>0&&e.$exception_types.push(i),X(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.Ro.some(e=>{var i=e.values.map(e=>{var i=n3[e.operator],r=t[e.key];if(!i||!r)return!1;var s=G(e.value)?e.value:[e.value];return s.length>0&&i(s,r)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}catch(e){return a9.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}Bo(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}Ho(e){if(e.length>0){var t,i,r,s,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],a=n[n.length-1];return null!=(r=null==a||null==(s=a.filename)?void 0:s.includes("posthog.com/static"))&&r}return!1}No(e){return!ee(e)&&G(e)}}},oc,{siteApps:class{constructor(e){this.Zo=0,this._instance=e,this.Go=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qo(e,t){if(t){var i=this.globalsForEvent(t);this.Go.push(i),this.Go.length>1e3&&(this.Go=this.Go.slice(10))}}get siteAppLoaders(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Qo.bind(this));this.Jo=()=>{e(),this.Go=[],this.Jo=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,r,s,n,a,o,l={},u=this._instance.get_property("$groups")||[];for(var c of Object.entries(this._instance.get_property("$stored_group_properties")||{})){var h=c[0];l[h]={id:u[h],type:h,properties:c[1]}}var d=e.$set_once,p=e.$set;return{event:y({},b(e,aG),{properties:y({},e.properties,p?{$set:y({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:y({},null!=(r=null==(s=e.properties)?void 0:s.$set_once)?r:{},d)}:{}),elements_chain:null!=(n=null==(a=e.properties)?void 0:a.$elements_chain)?n:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}Ko(e){var t,i=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(aW.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(aW.error("prepare_external_dependency_script returned null"),null):e}Yo(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,i,r,s,n,o,l,u=null==a?void 0:a.defaultView,c=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!c)return()=>{};if(this.Zo++,this.Xo)return this.tl();var h=[],d=this,p=new WeakSet,v=(e,t,i)=>{if(null!=e&&e[t]){var r=e[t];e[t]=i(r),h.push(()=>{e[t]=r})}},g=e=>{if(p.has(e))return e;var t=d.Ko(e);return t&&p.add(t),t},_=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!Z(e));return v(c,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),v(c,"insertBefore",e=>function(t,i){var r=g(t);return r?e.call(this,r,i):t}),v(c,"replaceChild",e=>function(t,i){var r=g(t);return r?e.call(this,r,i):i}),[null==(t=u.Element)?void 0:t.prototype,null==(i=u.Document)?void 0:i.prototype,null==(r=u.DocumentFragment)?void 0:r.prototype].forEach(e
vendor: 8,523 bytes, line 1
1=>{v(e,"append",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,_(i))}),v(e,"prepend",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,_(i))})}),[null==(s=u.Element)?void 0:s.prototype,null==(n=u.CharacterData)?void 0:n.prototype,null==(o=u.DocumentType)?void 0:o.prototype].forEach(e=>{v(e,"before",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,_(i))}),v(e,"after",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,_(i))}),v(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];var s=_(i);return i.length&&!s.length?void 0:e.apply(this,s)})}),v(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",e=>function(t,i){var r=g(i);return r?e.call(this,t,r):null}),this.Xo=()=>{h.forEach(e=>e()),this.Xo=void 0},this.tl()}tl(){var e=!1;return()=>{var t;e||(e=!0,this.Zo--,0===this.Zo&&(null==(t=this.Xo)||t.call(this)))}}el(e,t){void 0===t&&(t=!0);var i=this.Yo();try{var r=e(i);return t&&i(),r}catch(e){throw i(),e}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.Go.length&&(aW.info("Processing "+this.Go.length+" events for site app with id "+e.id),this.Go.forEach(e=>this.el(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Jo)||i.call(this))},r=!1,s=s=>{t.errored=!s,t.loaded=!0,aW.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var n=this.el(t=>e.init({posthog:this._instance,callback(e){t(),s(e)}}),!1).processEvent;n&&(t.processEvent=n),r=!0}catch(t){aW.error(aK+e.id,t),s(!1)}if(r&&t.loaded)try{i()}catch(i){aW.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}il(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}rl(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),r=function(r){try{t.el(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(t){aW.error("Error while processing event "+e.event+" for site app "+r.id,t)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(e){var t,i,r,s=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.il(),void this._instance.on("eventCaptured",e=>this.rl(e))):void aW.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Jo)||i.call(this),e.ok){var n=e.config;if(null!=(r=n.siteApps)&&r.length)if(this.isEnabled)for(var a of n.siteApps)!function(){var e,t=a.id,i=a.url;g["__$$ph_site_app_"+t]=s._instance,null==(e=g.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(s._instance,i,e=>{if(e)return aW.error(aK+t,e)})}();else aW.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},oh,{tracingHeaders:class{constructor(e){this.nl=void 0,this.sl=void 0,this.al=void 0,this.wo=()=>{var e,t,i=this.ol();i?(J(this.nl)&&(this.nl=null==(e=g.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),J(this.sl)&&(this.sl=null==(t=g.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.To()},this._instance=e}initialize(){this.startIfEnabledOrStop()}ai(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return aN.error("failed to load script",t);e()})}ll(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}ol(){var e=this.ll();return G(e)?(G(this.al)?this.al.splice(0,this.al.length,...e):this.al=[...e],e.length>0?this.al:void 0):(G(this.al)&&this.al.splice(0),this.al=e||void 0,this.al)}To(){var e,t;null==(e=this.nl)||e.call(this),null==(t=this.sl)||t.call(this),this.nl=void 0,this.sl=void 0}startIfEnabledOrStop(){this.ol()?this.ai(this.wo):this.To()}}},{toolbar:class{constructor(e){this.instance=e}xl(e){g.ph_toolbar_state=e}Sl(){var e;return null!=(e=g.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),rl(this.instance.config)||!r||!a)return!1;e=null!=e?e:r.location,i=null!=i?i:r.history;try{if(!t){try{r.localStorage.setItem("test","test"),r.localStorage.removeItem("test")}catch(e){return!1}t=null==r?void 0:r.localStorage}var s,n=a1||sb(e.hash,"__posthog")||sb(e.hash,"state"),o=n?rr(()=>JSON.parse(atob(decodeURIComponent(n))))||rr(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(a2)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}Cl(e){var t=g.ph_load_toolbar||g.ph_load_editor;!ee(t)&&W(t)?t(e,this.instance):a3.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==a||!a.getElementById(rO));if(!r||i)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(r.localStorage.setItem(a2,JSON.stringify(y({},n,{source:void 0}))),2===this.Sl())?this.Cl(n):0===this.Sl()&&(this.xl(1),null==(t=g.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return a3.error("[Toolbar] Failed to load",e),void this.xl(0);this.xl(2),this.Cl(n)}),ro(r,"turbolinks:load",()=>{this.xl(0),this.loadToolbar(n)})),!0}Ml(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}},od,{conversations:class{constructor(e){this.Tl=void 0,this._conversationsManager=null,this.El=!1,this.Il=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&e.ok){var t=e.config.conversations;ee(t)||(er(t)?this.Tl=t:(this.Tl=t.enabled,this.Il=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Tl=void 0,this.Il=null}loadIfEnabled(){if(!(this._conversationsManager||this.El||this._instance.config.disable_conversations||rl(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==g?void 0:g.__PosthogExtensions__;if(e&&!J(this.Tl)&&this.Tl)if(this.Il&&this.Il.token){this.El=!0;try{var t=e.initConversations;if(t)return this.Pl(t),void(this.El=!1);var i=e.loadExternalDependency;if(!i)return void this.Rl(iX);i(this._instance,"conversations",t=>{t||!e.initConversations?this.Rl("Could not load conversations script",t):this.Pl(e.initConversations),this.El=!1})}catch(e){this.Rl("Error initializing conversations",e),this.El=!1}}else or.error("Conversations enabled but missing token in remote config.")}}Pl(e){if(this.Il)try{this._conversationsManager=e(this.Il,this._instance),or.info("Conversations loaded successfully")}catch(e){this.Rl("Error completing conversations initialization",e)}else or.error("Cannot complete initialization: remote config is null")}Rl(e,t){or.error(e,t),this._conversationsManager=null,this.El=!1}show(){this._conversationsManager?this._conversationsManager.show():or.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Tl&&!Z(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var r=this;return m(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,i):(or.warn(os),null)})()}getMessages(e,t){var i=this;return m(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(or.
1warn(os),null)})()}markAsRead(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(or.warn(os),null)})()}getTickets(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(or.warn(os),null)})()}requestRestoreLink(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(or.warn(os),null)})()}restoreFromToken(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(or.warn(os),null)})()}restoreFromUrlToken(){var e=this;return m(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(or.warn(os),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}Gn(){var e;null==(e=this._conversationsManager)||e.setIdentity()}Qn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t,i=this;this.Al=!1,this.Fl=!1,this.rt=t1("[logs]"),this.Ll=y({},this.rt,{error(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];t.some(ol)||i.rt.error(...t)}}),this.er=[],this.Ol=[],this.fa=0,this.Dl=()=>{var e,t;this.fa=0,null==(e=this.$l)||e.onReconnect(),null==(t=this.Nl)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.Al=!0),r&&ro(r,"online",this.Dl)}ql(e,t,i,r){var s,n,a,o,l,u,c,h,d,p,v,g,_,f,m=(s=null==(f=this._instance)||null==(f=f.config)?void 0:f.logs,d=null!=(n=null==s?void 0:s.flushIntervalMs)?n:3e3,p=null!=(a=null==s?void 0:s.maxBufferSize)?a:100,g=J(v=null!=i&&i.consoleCapture?void 0:null!=(o=null==s?void 0:s.maxLogsPerInterval)?o:1e3)?Math.max(p,2048):Math.max(p,v),{serviceName:null!=(l=null!=(u=null==(_=null==s?void 0:s.resourceAttributes)?void 0:_["service.name"])?u:null==s?void 0:s.serviceName)?l:null==i?void 0:i.serviceNameDefault,serviceVersion:null!=(c=null==_?void 0:_["service.version"])?c:null==s?void 0:s.serviceVersion,environment:null!=(h=null==_?void 0:_["deployment.environment"])?h:null==s?void 0:s.environment,resourceAttributes:_,beforeSend:null==s?void 0:s.beforeSend,flushIntervalMs:d,maxBufferSize:p,maxQueueSize:g,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:v,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0});return[new tb(this.jl(e,t),m,this.Ll,()=>this.Bl(),e=>e(),void 0,r),m]}Hl(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.$l||this.Ul!==t){null==(i=this.$l)||i.reset(),this.Ul=t;var i,r=this.ql(()=>this.er,e=>{this.er=e});this.$l=r[0],this.zl=r[1]}return this.$l}Wl(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.Nl||this.Vl!==t){null==(i=this.Nl)||i.reset(),this.Vl=t;var i,r=this.ql(()=>this.Ol,e=>{this.Ol=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},on);this.Nl=r[0],this.Zl=r[1]}return this.Nl}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t;if(e.ok){var i=null==(t=e.config.logs)?void 0:t.captureConsoleLogs;!ee(i)&&i&&(this.Al=!0,this.loadIfEnabled())}}reset(){var e,t;this.er=[],null==(e=this.$l)||e.reset(),this.Ol=[],null==(t=this.Nl)||t.reset(),this.fa=0}captureLog(e){this.Hl().captureLog(e)}he(e){this.Wl().captureLog(e)}get logger(){return this.Gl||(this.Gl={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Gl}flushLogs(e){e?this.Ql(e):(this.$l&&this.$l.flush().catch(e=>this.Jl(e)),this.Nl&&this.Nl.flush().catch(e=>this.Jl(e)))}Jl(e){ol(e)||this.rt.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(this.Al&&!this.Fl){var e=null==g?void 0:g.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var i;t||null==(i=e.logs)||!i.initializeLogs?this.rt.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.Fl=!0)}):this.rt.error(iX)}else this.rt.error("PostHog Extensions not found.")}}jl(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===P.LogsQueue?e():void 0,setPersistedProperty(e,i){e===P.LogsQueue&&t(null!=i?i:[])},Ot:e=>this.Ot(e),getLibraryId:()=>_.LIB_NAME,getLibraryVersion:()=>_.LIB_VERSION}}Ot(e){return new Promise(t=>{if(sw(this.fa,3))t({kind:"fatal",error:oo(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,r=e=>{i||(i=!0,clearTimeout(s),t(e))},s=setTimeout(()=>{this.rt.warn("Logs request timed out before receiving a response"),r({kind:"retry-later",error:oo(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Kl(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.Yl(i),i>=200&&300>i)?r({kind:"ok"}):413===i?r({kind:"too-large"}):0!==i&&429!==i&&500>i?r({kind:"fatal",error:Error("logs request failed with status "+i)}):0===i?(e.error||this.rt.warn("Logs request failed before receiving an HTTP response"),r({kind:"retry-later",error:oo(e.error,"logs request failed before receiving an HTTP response")})):r({kind:"retry-later",error:null!=(t=e.error)?t:Error("logs request failed with status "+i)})}})}})}
1Yl(e){(0!==e||this._instance.__loaded)&&(this.fa=sx(e,this.fa,3,()=>this.rt.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.")))}Ql(e){this.er.length>0&&this.Xl(e,this.er,this.zl,_.LIB_NAME,e=>{this.er=e}),this.Ol.length>0&&this.Xl(e,this.Ol,this.Zl,on,e=>{this.Ol=e})}Xl(e,t,i,r,s){if(0!==t.length){var n=t.map(e=>e.record);s([]);var a=ty(n,tm(i,_.LIB_NAME,_.LIB_VERSION),r,_.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Kl(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}Kl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Bl(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=i.windowId,s=i.sessionStartTimestamp,n=i.lastActivityTimestamp;t.sessionId=i.sessionId,t.windowId=r,ee(s)||(t.sessionStartTimestamp=s),ee(n)||(t.lastActivityTimestamp=n)}if(null!=g&&null!=(e=g.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tc(g.location.href):g.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(t.activeFeatureFlags=a)}return t}}},{metrics:class{constructor(e){this.rt=t1("[metrics]"),this._instance=e}initialize(){}Hl(){var e,t,i,r,s,n,a,o,l=null==(a=this._instance)||null==(a=a.config)?void 0:a.metrics;return this.$l&&this.Ul===l||(null==(o=this.$l)||o.reset(),this.Ul=l,this.$l=new tS(this.jl(),{serviceName:null!=(e=null==(n=null==l?void 0:l.resourceAttributes)?void 0:n["service.name"])?e:null==l?void 0:l.serviceName,serviceVersion:null!=(t=null==n?void 0:n["service.version"])?t:null==l?void 0:l.serviceVersion,environment:null!=(i=null==n?void 0:n["deployment.environment"])?i:null==l?void 0:l.environment,resourceAttributes:n,beforeSend:null==l?void 0:l.beforeSend,flushIntervalMs:null!=(r=null==l?void 0:l.flushIntervalMs)?r:1e4,maxSeriesPerFlush:null!=(s=null==l?void 0:l.maxSeriesPerFlush)?s:1e3},this.rt)),this.$l}count(e,t,i){void 0===t&&(t=1),this.Hl().count(e,t,i)}gauge(e,t,i){this.Hl().gauge(e,t,i)}histogram(e,t,i){this.Hl().histogram(e,t,i)}flush(e){if(!this.$l)return Promise.resolve();if(e){var t=this.$l.drainWindow();return t&&this.Kt(t,e),Promise.resolve()}return this.$l.flush().catch(e=>this.rt.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.$l)||e.reset()}jl(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Kt:e=>t.Kt(e),getLibraryId:()=>_.LIB_NAME,getLibraryVersion:()=>_.LIB_VERSION}}Kt(e,t){return new Promise(i=>{var r=!1,s=e=>{r||(r=!0,clearTimeout(n),i(e))},n=setTimeout(()=>s({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(y({method:"POST",url:this.tu(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t,i=e.statusCode;i>=200&&300>i?s({kind:"ok"}):413===i?s({kind:"too-large"}):0!==i&&429!==i&&500>i?s({kind:"fatal",error:Error("metrics request failed with status "+i)}):s({kind:"retry-later",error:null!=(t=e.error)?t:Error("metrics request failed with status "+i)})}}))})}tu(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});aT.__defaultExtensionClasses=y({},op);var ov=function(){_.SDK_DIST_CHANNEL="npm";var e=ap[aw]=new aT;return function(){function e(){e.done||(e.done=!0,ax=!1,re(ap,function(e){e._dom_loaded()}))}null!=a&&a.addEventListener?"complete"===a.readyState?e():ro(a,"DOMContentLoaded",e,{capture:!1}):r&&t0.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}()}}]);

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.