PageSourceSearch

https://www.instaworm.com/_next/static/chunks/0gptkc2umsq0a.js?dpl=dpl_Cc27WUVs9Hu8ZTMDwsAdJYwA7PR3

js instaworm.com collected 2026-10-02 01:32:33 UTC 229,720 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,302355,e=>{"use strict";var t=e.i(247167),i=e.i(271645),s=e.i(618566);function r(){return"u">typeof window}function n(){return"production"}function a(){return"development"===((r()?window.vam:n())||"production")}function o(e){return RegExp(`/${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}(?=[/?#]|$)`)}function l(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:`/${e}`}function u(e){return(0,i.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),(0,i.useEffect)(()=>{!function(e={debug:!0},t){var i;if(!r())return;let{beforeSend:s,src:o,dataset:u}=function(e,t){var i,s;let r=e;if(t)try{r={...null==(i=JSON.parse(t))?void 0:i.analytics,...e}}catch{}!function(e="auto"){if("auto"===e){window.vam=n();return}window.vam=e}(r.mode);let o={sdkn:"@vercel/analytics"+(r.framework?`/${r.framework}`:""),sdkv:"2.0.1"};return r.disableAutoTrack&&(o.disableAutoTrack="1"),r.viewEndpoint&&(o.viewEndpoint=l(r.viewEndpoint)),r.eventEndpoint&&(o.eventEndpoint=l(r.eventEndpoint)),r.sessionEndpoint&&(o.sessionEndpoint=l(r.sessionEndpoint)),a()&&!1===r.debug&&(o.debug="false"),r.dsn&&(o.dsn=r.dsn),r.endpoint?o.endpoint=r.endpoint:r.basePath&&(o.endpoint=l(`${r.basePath}/insights`)),{beforeSend:r.beforeSend,src:(s=r).scriptSrc?l(s.scriptSrc):a()?"https://va.vercel-scripts.com/v1/script.debug.js":s.basePath?l(`${s.basePath}/insights/script.js`):"/_vercel/insights/script.js",dataset:o}}(e,t);if(window.va||(window.va=function(...e){window.vaq||(window.vaq=[]),window.vaq.push(e)}),s&&(null==(i=window.va)||i.call(window,"beforeSend",s)),document.head.querySelector(`script[src*="${o}"]`))return;let c=document.createElement("script");for(let[e,t]of(c.src=o,Object.entries(u)))c.dataset[e]=t;c.defer=!0,c.onerror=()=>{let e=a()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${o}. ${e}`)},document.head.appendChild(c)}({framework:e.framework||"react",basePath:e.basePath??function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...void 0!==e.route&&{disableAutoTrack:!0},...e},e.configString??function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.REACT_APP_VERCEL_OBSERVABILITY_CLIENT_CONFIG}())},[]),(0,i.useEffect)(()=>{e.route&&e.path&&function({route:e,path:t}){var i;null==(i=window.va)||i.call(window,"pageview",{route:e,path:t})}({route:e.route,path:e.path})},[e.route,e.path]),null}function c(e){let r,n,a,{route:l,path:c}=(r=(0,s.useParams)(),n=(0,s.useSearchParams)(),a=(0,s.usePathname)(),r?{route:function(e,t){if(!e||!t)return e;let i=e;try{let e=Object.entries(t);for(let[t,s]of e)if(!Array.isArray(s)){let e=o(s);e.test(i)&&(i=i.replace(e,`/[${t}]`))}for(let[t,s]of e)if(Array.isArray(s)){let e=o(s.join("/"));e.test(i)&&(i=i.replace(e,`/[...${t}]`))}return i}catch{return e}}(a,Object.keys(r).length?r:Object.fromEntries(n.entries())),path:a}:{route:null,path:a});return i.default.createElement(u,{path:c,route:l,...e,basePath:function(){if(void 0!==t.default&&void 0!==t.default.env)return t.default.env.NEXT_PUBLIC_VERCEL_OBSERVABILITY_BASEPATH}
1(),configString:function(){if(void 0!==t.default&&void 0!==t.default.env)return'{"analytics":{"scriptSrc":"43020f5acc3e35d6/script.js","viewEndpoint":"43020f5acc3e35d6/view","eventEndpoint":"43020f5acc3e35d6/event","sessionEndpoint":"43020f5acc3e35d6/session"},"speedInsights":{"scriptSrc":"47a1605ac0bb84a3/script.js","endpoint":"47a1605ac0bb84a3/vitals"}}'}(),framework:"next"})}e.s(["Analytics",0,function(e){return i.default.createElement(i.Suspense,{fallback:null},i.default.createElement(c,{...e}))}])},593100,e=>{"use strict";e.i(247167);var t,i,s,r,n=e.i(843476),a=e.i(271645),o=e.i(618566),l="u">typeof window?window:void 0,u="u">typeof globalThis?globalThis:l;"u"<typeof self&&(u.self=u),"u"<typeof File&&(u.File=function(){});var c=null==u?void 0:u.navigator,h=null==u?void 0:u.document,d=null==u?void 0:u.location,p=null==u?void 0:u.fetch,v=null!=u&&u.XMLHttpRequest&&"withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:void 0,g=null==u?void 0:u.AbortController,f=null==u?void 0:u.CompressionStream,_=null==c?void 0:c.userAgent,m=null!=l?l:{};function y(){return!(!l||!1===l.navigator.onLine)}var b="1.399.2",w={DEBUG:!1,LIB_VERSION:b,LIB_NAME:"web",JS_SDK_VERSION:b};function x(e,t,i,s,r,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(s,r)}function S(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function a(e){x(n,s,r,a,o,"next",e)}function o(e){x(n,s,r,a,o,"throw",e)}a(void 0)})}}function E(){return(E=Object.assign.bind()).apply(null,arguments)}function k(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}var P=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function F(e){return"string"==typeof e||e}function A(e){return"string"==typeof e?e:void 0}var I,$,T,R,O=((I={}).AnonymousId="anonymous_id",I.DistinctId="distinct_id",I.Props="props",I.EnablePersonProcessing="enable_person_processing",I.PersonMode="person_mode",I.FeatureFlagDetails="feature_flag_details",I.FeatureFlags="feature_flags",I.FeatureFlagPayloads="feature_flag_payloads",I.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",I.BootstrapFeatureFlags="bootstrap_feature_flags",I.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",I.OverrideFeatureFlags="override_feature_flags",I.Queue="queue",I.LogsQueue="logs_queue",I.OptedOut="opted_out",I.SessionId="session_id",I.SessionStartTimestamp="session_start_timestamp",I.SessionLastTimestamp="session_timestamp",I.PersonProperties="person_properties",I.GroupProperties="group_properties",I.InstalledAppBuild="installed_app_build",I.InstalledAppVersion="installed_app_version",I.SessionReplay="session_replay",I.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",I.SurveyLastSeenDate="survey_last_seen_date",I.SurveysSeen="surveys_seen",I.Surveys="surveys",I.RemoteConfig="remote_config",I.FlagsEndpointWasHit="flags_endpoint_was_hit",I.DeviceId="device_id",I),C=(($={}).GZipJS="gzip-js",$.Base64="base64",$),M=["$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"],L=["token"],D="NativeGzipValidationError",N=e=>e.length>=2&&31===e[0]&&139===e[1],j=(e,t)=>e===C.GZipJS||t===C.GZipJS||"gzip"===t,q=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),B=e=>{var t=Error("Native gzip produced invalid output: "+e);throw t.name=D,t},H=(T=S(function*(e,t){18>e.size&&B("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));N(i)&&8===i[2]||B("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(R)return R;R=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;R[e]=t>>>0}return R})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&B("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&B("invalid-size")}),function(e,t){return T.apply(this,arguments)});function z(){return(z=S(function*(e,t,i){void 0===t&&(t=!0);try{var s,r=(new TextEncoder).encode(e),n=new CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(r).then(()=>a.close()).catch((s=S(function*(e){try{yield a.abort(e)}catch(e){}throw e}),function(e){return s.apply(this,arguments)})),l=new Response(n.readable).blob(),[u]=yield Promise.all([l,o]);return yield H(u,r),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 U=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hub
1spot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],V=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return U.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function G(e,t){return -1!==e.indexOf(t)}var W=function(e){return e.trim()},Y=function(e){return e.replace(/^\$/,"")},K=Object.prototype,J=K.hasOwnProperty,Q=K.toString,Z=Array.isArray||function(e){return"[object Array]"===Q.call(e)},X=e=>"function"==typeof e,ee=e=>e===Object(e)&&!Z(e),et=e=>{if(ee(e)){for(var t in e)if(J.call(e,t))return!1;return!0}return!1},ei=e=>void 0===e,es=e=>"[object String]"==Q.call(e),er=e=>es(e)&&0===e.trim().length,en=e=>null===e,ea=e=>ei(e)||en(e),eo=e=>"[object Number]"==Q.call(e)&&e==e,el=e=>eo(e)&&e>0,eu=e=>"[object Boolean]"===Q.call(e),ec=e=>G(M,e),eh=e=>G(L,e);function ed(e){return null===e||"object"!=typeof e}function ep(e,t){return({}).toString.call(e)==="[object "+t+"]"}function ev(e){return"u">typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var eg=[!0,"true",1,"1","yes"],ef=[!1,"false",0,"0","no"];function e_(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),eo(e)?e>i?(s.warn(" cannot be  greater than max: "+i+". Using max value instead."),i):t>e?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),e_(r||i,t,i,s))}class em{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=e_(e.bucketSize,0,100,e.Ae),this.De=e_(e.refillRate,0,this.Fe,e.Ae),this.$e=e_(e.refillInterval,0,864e5,e.Ae)}Ne(e,t){var i=Math.floor((t-e.lastAccess)/this.$e);i>0&&(e.tokens=Math.min(e.tokens+i*this.De,this.Fe),e.lastAccess=e.lastAccess+i*this.$e)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.Ee[s];return r?this.Ne(r,i):this.Ee[s]=r={tokens:this.Fe,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.Pe)||t.call(this,e)),0===r.tokens)}stop(){this.Ee={}}}var ey="Mobile",eb="Android",ew="Tablet",ex=eb+" "+ew,eS="iPad",eE="Apple",ek=eE+" Watch",eP="Safari",eF="BlackBerry",eA="Samsung",eI=eA+"Browser",e$=eA+" Internet",eT="Chrome",eR=eT+" OS",eO=eT+" iOS",eC="Internet Explorer",eM=eC+" "+ey,eL="Opera",eD=eL+" Mini",eN="Edge",ej="Microsoft "+eN,eq="Firefox",eB=eq+" iOS",eH="Nintendo",ez="PlayStation",eU="Xbox",eV=eb+" "+ey,eG=ey+" "+eP,eW="Windows",eY=eW+" Phone",eK="Nokia",eJ="Ouya",eQ="Generic",eZ=eQ+" "+ey.toLowerCase(),eX=eQ+" "+ew.toLowerCase(),e0="Konqueror",e1="Oculus Browser",e2="Vivaldi",e3="Yandex",e5="Whale",e6="DuckDuckGo",e4="Pale Moon",e8="Waterfox",e7="Brave",e9="Google Search App",te="(\\d+(\\.\\d+)?)",tt=RegExp("Version/"+te),ti=RegExp(eU,"i"),ts=RegExp(ez+" \\w+","i"),tr=RegExp(eH+" \\w+","i"),tn=RegExp(eF+"|PlayBook|BB10","i"),ta={"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"},to=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?e7:null)||(null!=s&&s.detectGoogleSearchApp&&G(e,"GSA/")?e9:G(e," OPR/")&&G(e,"Mini")?eD:G(e," OPR/")?eL:tn.test(e)?eF:G(e,"IE"+ey)||G(e,"WPDesktop")?eM:G(e,"OculusBrowser")?e1:G(e,eI)?e$:G(e,eN)||G(e,"Edg/")?ej:G(e,e2+"/")?e2:G(e,"YaBrowser/")?e3:G(e,e5+"/")?e5:G(e,e6+"/")||G(e,"Ddg/")?e6:G(e,"FBIOS")?"Facebook "+ey:G(e,"UCWEB")||G(e,"UCBrowser")?"UC Browser":G(e,"CriOS")?eO:G(e,"CrMo")||G(e,eT)?eT:G(e,eb)&&G(e,eP)?eV:G(e,"FxiOS")?eB:G(e.toLowerCase(),e0.toLowerCase())?e0:G(e,e7+"/")?e7:(r=t)&&G(r,eE)||G(e,eP)&&!G(e,eT)&&!G(e,eb)?G(e,ey)?eG:eP:G(e,"PaleMoon/")?e4:G(e,e8+"/")?e8:G(e,eq)?eq:G(e,"MSIE")||G(e,"Trident/")?eC:G(e,"Gecko")?eq:"")},tl={[eM]:[RegExp("rv:"+te)],[ej]:[RegExp(eN+"?\\/"+te)],[eT]:[RegExp("("+eT+"|CrMo)\\/"+te)],[eO]:[RegExp("CriOS\\/"+te)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+te)],[eP]:[tt],[eG]:[tt],[eL]:[RegExp("(Opera|OPR)\\/"+te)],[eq]:[RegExp(eq+"\\/"+te)],[eB]:[RegExp("FxiOS\\/"+te)],[e0]:[RegExp("Konqueror[:/]?"+te,"i")],[eF]:[RegExp(eF+" "+te),tt],[eV]:[RegExp("android\\s"+te,"i")],[e$]:[RegExp(eI+"\\/"+te)],[e
11]:[RegExp("OculusBrowser\\/"+te)],[e2]:[RegExp(e2+"\\/"+te)],[e3]:[RegExp("YaBrowser\\/"+te)],[e5]:[RegExp(e5+"\\/"+te)],[e7]:[RegExp(e7+"\\/"+te)],[e6]:[RegExp("(DuckDuckGo|Ddg)\\/"+te)],[e4]:[RegExp("PaleMoon\\/"+te)],[e8]:[RegExp(e8+"\\/"+te)],[e9]:[RegExp("GSA\\/"+te)],[eC]:[RegExp("(rv:|MSIE )"+te)],Mozilla:[RegExp("rv:"+te)]},tu=function(e,t,i,s){var r=tl[to(e,t,i,s)];if(ei(r))return null;for(var n=0;r.length>n;n++){var a=e.match(r[n]);if(a)return parseFloat(a[a.length-2])}return null},tc=[[RegExp(eU+"; "+eU+" (.*?)[);]","i"),e=>[eU,e&&e[1]||""]],[RegExp(eH,"i"),[eH,""]],[RegExp(ez,"i"),[ez,""]],[tn,[eF,""]],[RegExp(eW,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eY,""];if(new RegExp(ey).test(t)&&!/IEMobile\b/.test(t))return[eW+" "+ey,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=ta[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eW,s]}return[eW,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=ei(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+eb+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+eb+")","i"),e=>e&&e[2]?[eb,[e[2],e[3],e[4]||"0"].join(".")]:[eb,""]],[/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/,[eR,""]],[/Linux|debian/i,["Linux",""]]],th=function(e){return tr.test(e)?eH:ts.test(e)?ez:ti.test(e)?eU:RegExp(eJ,"i").test(e)?eJ:RegExp("("+eY+"|WPDesktop)","i").test(e)?eY:/iPad/.test(e)?eS:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ek:tn.test(e)?eF:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eK,"i").test(e)?eK:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(ey).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)?eb:ex:RegExp("(pda|"+ey+")","i").test(e)?eZ:RegExp(ew,"i").test(e)&&!RegExp(ew+" pc","i").test(e)?eX:""},td=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tp(e,t){return"string"==typeof e&&td.test(e)?e:t()}function tv(e){return e?e.split("#")[0]:e}function tg(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}var tf=e=>e instanceof Error,t_={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}},tm=t_.info;function ty(e){var t=[];for(var i in e){var s=e[i];en(s)||ei(s)||t.push({key:i,value:function e(t){if(eu(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(Z(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(s)})}return t}function tb(e,t,i){return E({},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 tw(e,t,i,s){return{resourceLogs:[{resource:{attributes:ty(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}let tx=class{constructor(e,t,i,s,r,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Se=t,this.Ae=i,this.qe=s,this.Be=r,this.je=n,this.He=a,this.Ue=null,this.ze=0,this.Ve=0,this.We=0,this.Ge=0,this.Ze=!1,this.Qe=t.maxBufferSize,this.Je=Math.max(null!=(o=t.maxQueueSize)?o:t.maxBufferSize,t.maxBufferSize),this.Ke=t.flushIntervalMs,this.Ye=t.maxBatchRecordsPerPost,this.Xe=t.rateCapWindowMs,this.et=t.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.We=0,this.Ge=0,this.Ze=!1,this.ze=0,this.Ve=0,this.Ye=this.Se.maxBatchRecordsPerPost}onReconnect(){this.Ve=0,this.rt()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.it(e);
1if(null!==t)if(t.body){if(this.nt()){var i={record:function(e,t){var{text:i,number:s}=t_[e.level||"info"]||tm,r=String(Date.now())+"000000",n={};t.distinctId&&(n.posthogDistinctId=t.distinctId),t.sessionId&&(n.sessionId=t.sessionId),t.windowId&&(n["window.id"]=t.windowId),ea(t.sessionStartTimestamp)||(n.sessionStartTimestamp=String(t.sessionStartTimestamp)),ea(t.lastActivityTimestamp)||(n.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(n["url.full"]=t.currentUrl),t.screenName&&(n["screen.name"]=t.screenName),t.appState&&(n["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(n.feature_flags=t.activeFeatureFlags);var a=E({},n,e.attributes||{}),o={timeUnixNano:r,observedTimeUnixNano:r,severityNumber:s,severityText:i,body:{stringValue:e.body},attributes:ty(a)};return e.trace_id&&(o.traceId=e.trace_id),e.span_id&&(o.spanId=e.span_id),ei(e.trace_flags)||(o.flags=e.trace_flags),o}(t,this.qe())};this.Be(()=>this.st(i))}}else this.Ae.info("Log was rejected in beforeSend function")}}it(e){var t=this.Se.beforeSend;if(!t)return e;var i=Z(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.Ae.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.Ae.error("Error in beforeSend function for log:",e),null}return s}nt(){if(void 0===this.et)return!0;var e=Date.now(),t=e-this.We;return this.Xe>t&&t>=0||(this.We=e,this.Ge=0,this.Ze=!1),this.et>this.Ge?(this.Ge++,!0):(this.Ze||(this.Ae.warn("captureLog dropping logs: exceeded "+this.et+" logs per "+this.Xe+"ms"),this.Ze=!0),!1)}flush(){var e=this;return S(function*(){if(!e._instance.isDisabled)return e.Ue||(e.Ue=e.ot().finally(()=>{e.Ue=null})),e.Ue})()}ot(){var e=this;return S(function*(){e.tt();var t=null!=(r=e._instance.getPersistedProperty(O.LogsQueue))?r:[];if(0!==t.length)for(var i=t.length,s=0;t.length>0&&i>s;){e.ze=0;var r,n,a,o=Math.min(t.length,e.Ye),l=t.slice(0,o),u=tw(l.map(e=>e.record),e.ut(),null!=(n=e.He)?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance.ht(u);if("too-large"===c.kind&&l.length>1)e.Ye=Math.max(1,Math.floor(l.length/2)),e.Ae.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.Ye);else if("retry-later"===c.kind||("too-large"===c.kind?e.Ae.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.Se.maxBatchRecordsPerPost>e.Ye&&(e.Ye=Math.min(e.Se.maxBatchRecordsPerPost,e.Ye+1)),yield e.dt(l.length),t=null!=(a=e._instance.getPersistedProperty(O.LogsQueue))?a:[],s+=l.length,"fatal"===c.kind))throw c.error}})()}dt(e){var t=this;return S(function*(){var i,s=Math.max(0,e-t.ze),r=null!=(i=t._instance.getPersistedProperty(O.LogsQueue))?i:[];t._instance.setPersistedProperty(O.LogsQueue,r.slice(s)),yield t.je()})()}ut(){return tb(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(e){var t;if(!this._instance.optedOut){var i=null!=(t=this._instance.getPersistedProperty(O.LogsQueue))?t:[];this.Je>i.length||(i.shift(),this.ze++,this.Ae.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(O.LogsQueue,i),this.Qe>i.length?this.ct():this.rt()}}ct(e){void 0===e&&(e=this.Ke),this.vt||(this.vt=tg(()=>{this.vt=void 0,this.rt()},e))}ft(){var e=Math.min(Math.max(0,this.Ve-1),6);return this.Ke*Math.pow(2,e)}yt(){var e=this._instance.getPersistedProperty(O.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return S(function*(){t.tt();var i=t.flush().catch(()=>{});void 0!==e?yield Promise.race([i,new Promise(t=>tg(t,e))]):yield i})()}flushWithTimeout(e){var t=this;return S(function*(){var i=!1,s=t.flush(),r=new Promise(t=>tg(()=>{i=!0,t()},e));try{yield Promise.race([s,r])}finally{i&&s.catch(()=>{})}})()}rt(){this.flush().then(()=>{this.Ve=0},e=>{this.Ve++,this.Ae.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())})}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}};var tS=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function tE(e){return String(e)+"000000"}function tk(e,t,i,s){var r="";return s&&(r=Object.keys(s).sort().map(e=>JSON.stringify(e)+":"+JSON.stringify(s[e])).join(",")),e+"\0"+t+"\0"+(null!=i?i:"")+"\0"+r}let tP=class{constructor(e,t,i){this._instance=e,this.Se=t,this.Ae=i,this.bt=new Map,this.Ue=null,this._t=!1,this.wt=new Map,this.xt=new Set}count(e,t,i){void 0===t&&(t=1),this.kt({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}
1gauge(e,t,i){this.kt({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.kt({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.Ue,s=(e=S(function*(){i&&(yield i.catch(()=>{})),yield t.St()}),function(){return e.apply(this,arguments)})().finally(()=>{this.Ue===s&&(this.Ue=null)});return this.Ue=s,s}drainWindow(){if(0===this.bt.size)return null;var e=this.bt;return this.bt=new Map,this._t=!1,this.wt=new Map,this.xt=new Set,this.Ct(e)}reset(){this.tt(),this.bt=new Map,this.Ue=null,this._t=!1,this.wt=new Map,this.xt=new Set}kt(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.it(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.Ae.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var i=this.wt.get(t.name);void 0===i?this.wt.set(t.name,t.type):i===t.type||this.xt.has(t.name)||(this.xt.add(t.name),this.Ae.warn("Metric name '"+t.name+"' is already used as a "+i+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name."));var s=tk(t.type,t.name,t.unit,t.attributes),r=this.bt.get(s);if(!r){if(this.bt.size>=this.Se.maxSeriesPerFlush)return void(this._t||(this._t=!0,this.Ae.warn("Metric series cap reached ("+this.Se.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")));r={name:t.name,type:t.type,unit:t.unit,attributes:t.attributes?E({},t.attributes):void 0,windowStartMs:Date.now()},this.bt.set(s,r)}this.It(r,t.value),this.ct()}else this.Ae.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.Ae.warn("Dropping metric with empty name")}}It(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(tS.length+1).fill(0)});var s=e.hist;s.count+=1,s.sum+=t,s.min=Math.min(s.min,t),s.max=Math.max(s.max,t),s.bucketCounts[function(e,t){for(var i=0;t.length>i;i++)if(t[i]>=e)return i;return t.length}(t,tS)]+=1}}it(e){var t=this.Se.beforeSend;if(!t)return e;var i=Z(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.Ae.info("Metric was rejected in beforeSend function"),null;s=n}catch(e){return this.Ae.error("Error in beforeSend function for metric:",e),null}return s}ct(){this.vt||(this.vt=tg(()=>{this.vt=void 0,this.flush().catch(()=>{})},this.Se.flushIntervalMs))}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}St(){var e=this;return S(function*(){if(0!==e.bt.size){var t=e.bt;e.bt=new Map,e._t=!1,e.wt=new Map,e.xt=new Set;var i=yield e._instance.Tt(e.Ct(t));switch(i.kind){case"ok":return;case"retry-later":return e.Mt(t),void e.ct();case"too-large":return void e.Ae.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.Ae.error("Failed to send metrics batch:",i.error)}}})()}Ct(e){var t,i,s,r,n,a,o;return r=this.Et(e),t=this.Se,i=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),n=E({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":i,"telemetry.sdk.version":s}),a=this._instance.getLibraryId(),o=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:ty(n)},scopeMetrics:[{scope:{name:a,version:o},metrics:r}]}]}}Et(e){var t=tE(Date.now()),i=new Map;for(var s of e.values()){var r,n=tk(s.type,s.name,s.unit,void 0),a=i.get(n);a||(a=E({name:s.name},s.unit&&{unit:s.unit}),"count"===s.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===s.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(n,a));var o=ty(null!=(r=s.attributes)?r:{}),l=tE(s.windowStartMs);if("count"===s.type){var u,c={attributes:o,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!=(u=s.total)?u:0};a.sum.dataPoints.push(c)}else if("gauge"===s.type){var h,d={attributes:o,timeUnixNano:t,asDouble:null!=(h=s.last)?h:0};a.gauge.dataPoints.push(d)}else s.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:t,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:tS})}return Array.from(i.values())}Mt(e){var t,i;for(var[s,r]of e){var n=this.bt.get(s);if(n)switch(n.windowStartMs=Math.min(n.windowStartMs,r.windowStartMs),n.type){case"count":n.total=(null!=(t=n.total)?t:0)+(null!=(i=r.total)?i:0);break;case"gauge":break;case"histogram":if(r.hist)if(n.hist){n.hist.count+=r.hist.count,n.hist.sum+=r.hist.sum,n.hist.min=Math.min(n.hist.min,r.hist.min),n.hist.max=Math.max(n.hist.max,r.hist.max);for(var a=0;n.hist.bucketCounts.length>a;a++)n.hist.bucketCounts[a]+=r.hist.bucketCounts[a]}else n.hist=r.hist}else this.bt.set(s,r)}}};class tF{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"},s=this.buildCoercingContext(i,t,0).apply(e),r=this.buildParsingContext(t),n=this.parseStacktrace(s,r);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return S(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&Z(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,s;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),E({},e,{cause:i,stack:s})}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 S(function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){var i,s,r,n={type:e.type,value:e.value,mechanism:{type:null!=(i=t.type)?i:"generic",handled:null==(s=t.handled)||s,synthetic:null!=(r=e.synthetic)&&r}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var a=[n];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,E({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return sd&&i.length===sh||(sh=i.length,sd=i.reduce((i,s)=>{sc||(sc={});var r=sc[s];if(r)i[r[0]]=r[1];else for(var n=e(s),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,u=t[s];if(l&&u){i[l]=u,sc[s]=[l,u];break}}return i},{})),sd}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var s=(i,s)=>{if(4>=s){var r=this.buildCoercingContext(e,t,s);return this.applyCoercers(i,r)}};return E({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}function tA(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return ei(s)||(n.lineno=s),ei(r)||(n.colno=r),n}var tI=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},t$=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tT=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tR=/\((\S*)(?::(\d+))(?::(\d+))\)/,tO=(e,t)=>{var i=t$.exec(e);if(i){var[,s,r,n]=i;return tA(t,s,"?",+r,+n)}var a=tT.exec(e);if(a){if(a[2]&&0===a[2].indexOf("eval")){var o=tR.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,u]=tI(a[1]||"?",a[2]);return tA(t,u,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},tC=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tM=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tL=(e,t)=>{var i=tC.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=tM.exec(i[3]);s&&(i[1]=i[1]||"eval",i[3]=s[1],i[4]=s[2],i[5]="")}var r=i[3],n=i[1]||"?";return[n,r]=tI(n,r),tA(t,r,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tD=/\(error: (.*)\)/;class tN{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=es(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 ep(e,"DOMException")}isDOMError(e){return ep(e,"DOMError")}}class tj{match(e){return e instanceof 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 tq{match(e){return ep(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var tB=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tH{match(e){return"string"==typeof e}coerce(e,t){var i,[s,r]=this.getInfos(e);return{type:null!=s?s:"Error",value:null!=r?r:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(tB);return s&&(t=s[1],i=s[2]),[t,i]}}var tz=["fatal","error","warning","log","info","debug"];function tU(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var s=i.length;s>0;s--){var r=i.slice(0,s).join(", ");
1if(t>=r.length)return s===i.length?r:r.length>t?r.slice(0,t)+"...":r}return""}class tV{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return ev(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: "+tU(e)}isSeverityLevel(e){return es(e)&&!er(e)&&tz.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(tf(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tG{match(e){return ev(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+tU(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tW{match(e){return ed(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 tY{match(e){return ep(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ev(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,s=this.getUnhandledRejectionReason(e);return ed(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(s)}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 tK="$message",tJ="$timestamp",tQ=new Set([tK,tJ]),tZ={enabled:!0,max_bytes:32768};function tX(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tZ.enabled,max_bytes:function(e,t){if(!eo(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tZ.max_bytes)}:E({},tZ)}class t0{constructor(e){this.Pt=[],this.Rt=0,this.Se=tX(e)}setConfig(e){this.Se=tX(e),this.Ot()}add(e){var t=function(e){var t,i,s;try{s=[],t=null!=(i=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(t))return"[Circular]";s.push(t)}return t}}))?i:"null"}catch(e){return}try{var r=JSON.parse(t);if(!ee(r))return;var n=r[tK],a=r[tJ];if(!es(n)||0===n.trim().length||!es(a)&&!eo(a))return;return{step:r,json:t}}catch(e){return}}(e);if(t){var i=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),i=0,s=0;t.length>s;s++)"%"===t[s]?(i+=1,s+=2):i+=1;return i}(t.json);i>this.Se.max_bytes||(this.Pt.push({step:t.step,bytes:i}),this.Rt+=i,this.Ot())}}getAttachable(){return this.Pt.map(e=>e.step)}clear(){this.Pt=[],this.Rt=0}size(){return this.Pt.length}Ot(){for(;this.Rt>this.Se.max_bytes&&this.Pt.length>0;){var e=this.Pt.shift();e&&(this.Rt-=e.bytes)}}}var t1=function(e,t){var{debugEnabled:i}=void 0===t?{}:t,s={k(t){if(l&&(w.DEBUG||m.POSTHOG_DEBUG||i)&&!ei(l.console)&&l.console){for(var s=("__rrweb_original__"in l.console[t])?l.console[t].__rrweb_original__:l.console[t],r=arguments.length,n=Array(r>1?r-1:0),a=1;r>a;a++)n[a-1]=arguments[a];s(e,...n)}},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),s=0;t>s;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning(e){s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>t1(e+" "+t,i)};return s},t2=t1("[PostHog.js]"),t3=t2.createLogger,t5=t3("[ExternalScriptsLoader]"),t6=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return t5.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==h?void 0:h.querySelectorAll("script");
1if(s){for(var r,n=0;s.length>n;n++)if(r=function(){if(s[n].src===t){var e=s[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 r.v}var a=()=>{if(!h)return i("document not found");var s=h.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)h.head.appendChild(s);else{var r,n=h.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):h.body.appendChild(s)}};null!=h&&h.body?a():null==h||h.addEventListener("DOMContentLoaded",a)};m.__PosthogExtensions__=m.__PosthogExtensions__||{},m.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s;if(e.config.strict_script_versioning)s=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var r="/static/"+t+".js?v="+e.version;"toolbar"===t&&(r=r+"&t="+3e5*Math.floor(Date.now()/3e5)),s=e.requestRouter.endpointFor("assets",r)}t6(e,s,i)}else{var n=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");t6(e,n,i)}},m.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);t6(e,s,i)};var t4="$people_distinct_id",t8="$device_id",t7="$device_model",t9="__alias",ie="__timers",it="$autocapture_disabled_server_side",ii="$heatmaps_enabled_server_side",is="$exception_capture_enabled_server_side",ir="$error_tracking_suppression_rules",ia="$error_tracking_capture_extension_exceptions",io="$web_vitals_enabled_server_side",il="$dead_clicks_enabled_server_side",iu="$product_tours_enabled_server_side",ic="$web_vitals_allowed_metrics",ih="$session_recording_remote_config",id="$replay_sample_rate",ip="$replay_override_sampling",iv="$replay_override_linked_flag",ig="$replay_override_url_trigger",i_="$replay_override_event_trigger",im="$sesid",iy="$session_is_sampled",ib="$enabled_feature_flags",iw="$active_feature_flags",ix="$early_access_features",iS="$feature_flag_details",iE="$feature_flag_payloads",ik="$feature_flag_request_id",iP="$override_feature_flags",iF="$override_feature_flag_payloads",iA="$stored_person_properties",iI="$stored_group_properties",i$="$surveys",iT="$surveys_loaded_at",iR="$surveys_activated",iO="ph_product_tours",iC="$flag_call_reported",iM="$flag_call_reported_session_id",iL="$feature_flag_errors",iD="$feature_flag_evaluated_at",iN="$user_state",ij="$client_session_props",iq="$capture_rate_limit",iB="$initial_campaign_params",iH="$initial_referrer_info",iz="$initial_person_info",iU="$epp",iV="__POSTHOG_TOOLBAR__",iG="$posthog_cookieless",iW="$sdk_debug_extensions_init_method",iY="$sdk_debug_extensions_init_time_ms",iK="$sdk_debug_recording_script_not_loaded",iJ="PostHog loadExternalDependency extension not found.",iQ="on_reject",iZ="always",iX="anonymous",i0="identified",i1="identified_only",i2="visibilitychange",i3="beforeunload",i5="$pageview",i6="$pageleave",i4="$identify",i8="$groupidentify";function i7(e,t){Z(e)&&e.forEach(t)}function i9(e,t){if(!ea(e))if(Z(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)J.call(e,i)&&t(e[i],i)}var se=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];for(var r of i)for(var n in r)void 0!==r[n]&&(e[n]=r[n]);return e};function st(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var si=function(e){try{return e()}catch(e){return}},ss=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){t2.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),t2.critical(e)}}},sr=function(e){var t={};return i9(e,function(e,i){(es(e)&&e.length>0||eo(e))&&(t[i]=e)}),t},sn=["herokuapp.com","vercel.app","netlify.app"];function sa(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}function so(e){return"ph_toolbar_internal"===e.name}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return eo(e)&&isFinite(e)&&Math.floor(e)===e});class sl{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||0>e||0>t||0>i||0>s||e>0xffffffffffff||t>4095||i>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");
1var r=new Uint8Array(16);return r[0]=e/0x10000000000,r[1]=e/0x100000000,r[2]=e/0x1000000,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new sl(r)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new sl(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 su{constructor(){this.S=0,this.C=0,this.I=new sg}generate(){var e=this.generateOrAbort();if(ei(e)){this.S=0;var t=this.generateOrAbort();if(ei(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>0x3ffffffffff&&(this.S++,this.M())}return sl.fromFieldsV7(this.S,Math.trunc(this.C/0x40000000),0x3fffffff&this.C,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var sc,sh,sd,sp,sv=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};l&&!ei(l.crypto)&&crypto.getRandomValues&&(sv=e=>crypto.getRandomValues(e));class sg{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(sv(this.R),this.O=0),this.R[this.O++]}}var sf=()=>s_().toString(),s_=()=>(sp||(sp=new su)).generate(),sm="",sy=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,sb={N:()=>!!h,D(e){t2.error("cookieStore error: "+e)},A(e){if(h){try{for(var t=e+"=",i=h.cookie.split(";").filter(e=>e.length),s=0;i.length>s;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},F(e){var t;try{t=JSON.parse(sb.A(e))||{}}catch(e){}return t},q(e,t,i,s,r){if(!h)return!1;try{var n="",a="",o=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=h),sm)return sm;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+sf();!sm&&s--;){var n=i.slice(s).join("."),a=r+"=1;domain=."+n+";path=/";t.cookie=a+";max-age=3",t.cookie.includes(r)&&(t.cookie=a+";max-age=0",sm=n)}return sm}(e);if(!i){var s,r=(s=e.match(sy))?s[0]:"";r!==i&&t2.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(h.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),n="; expires="+l.toUTCString()}r&&(a="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&t2.warn("cookieStore warning: large cookie, len="+u.length),h.cookie=u,!0}catch(e){return!1}},P(e,t){if(null!=h&&h.cookie)try{sb.q(e,"",-1,t)}catch(e){return}}},sw=null,sx={N(){if(!en(sw))return sw;var e=!0;if(ei(l))e=!1;else try{var t="__mplssupport__";sx.q(t,"xyz"),'"xyz"'!==sx.A(t)&&(e=!1),sx.P(t)}catch(t){e=!1}return e||t2.error("localStorage unsupported; falling back to cookie store"),sw=e,e},D(e){t2.error("localStorage error: "+e)},A(e){try{return null==l?void 0:l.localStorage.getItem(e)}catch(e){sx.D(e)}return null},F(e){try{return JSON.parse(sx.A(e))||{}}catch(e){}return null},q(e,t){try{return null==l||l.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sx.D(e)}return!1},P(e){try{null==l||l.localStorage.removeItem(e)}catch(e){sx.D(e)}}},sS=[t8,"distinct_id",im,iy,iU,iz,iN],sE={},sk={N:()=>!0,D(e){t2.error("memoryStorage error: "+e)},A:e=>sE[e]||null,F:e=>sE[e]||null,q:(e,t)=>(sE[e]=t,!0),P(e){delete sE[e]}},sP=null,sF={N(){if(!en(sP))return sP;if(sP=!0,ei(l))sP=!1;else try{var e="__support__";sF.q(e,"xyz"),'"xyz"'!==sF.A(e)&&(sP=!1),sF.P(e)}catch(e){sP=!1}return sP},D(e){t2.error("sessionStorage error: ",e)},A(e){try{return null==l?void 0:l.sessionStorage.getItem(e)}catch(e){sF.D(e)}return null},F(e){try{return JSON.parse(sF.A(e))||null}catch(e){}return null},q(e,t){try{return null==l||l.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sF.D(e)}return!1},P(e){try{null==l||l.sessionStorage.removeItem(e)}catch(e){sF.D(e)}}};class sA{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.Ft()?0:this.At}
1isOptedOut(){return this.Se.cookieless_mode===iZ||this.isRejected()||-1===this.consent&&this.Se.cookieless_mode===iQ}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Dt.q(this.$t,+!!e,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Dt.P(this.$t,this.Se.cross_subdomain_cookie)}get $t(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get At(){var e=this.Dt.A(this.$t);return G(eg,e)?1:G(ef,e)?0:-1}get Dt(){var e=this.Se.opt_out_capturing_persistence_type,t="localStorage"===e?sx:sb;if(!this.Nt||this.Nt!==t){this.Nt=t;var i="localStorage"===e?sb:sx;i.A(this.$t)&&(this.Nt.A(this.$t)||this.optInOut(G(eg,i.A(this.$t))),i.P(this.$t,this.Se.cross_subdomain_cookie))}return this.Nt}Ft(){return!!this.Se.respect_dnt&&[null==c?void 0:c.doNotTrack,null==c?void 0:c.msDoNotTrack,m.doNotTrack].some(e=>G(eg,e))}}function sI(e,t){var i,s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!X(s))return t;try{var r=s(t);return es(r)&&r?r:t}catch(e){return t2.error("Error in get_current_url, falling back to window.location.href",e),t}}function s$(e){return e instanceof Element&&(e.id===iV||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function sT(e){return!!e&&1===e.nodeType}function sR(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function sO(e){return!!e&&3===e.nodeType}function sC(e){return!!e&&11===e.nodeType&&sT(e.host)}function sM(e){return e?W(e).split(/\s+/):[]}function sL(e,t){var i,s,r=ei(s=null==l||null==(i=l.location)?void 0:i.href)?void 0:sI(t,s);return!!(r&&e&&e.some(e=>r.match(e)))}function sD(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 sM(t)}function sN(e){return ea(e)?null:W(e).split(/(\s+)/).filter(e=>s8(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function sj(e){var t="";return sX(e)&&!s0(e)&&e.childNodes&&e.childNodes.length&&i9(e.childNodes,function(e){var i;sO(e)&&e.textContent&&(t+=null!=(i=sN(e.textContent))?i:"")}),W(t)}function sq(e){var t;return ei(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var sB=["a","button","form","input","select","textarea","label"];function sH(e,t){if(ei(t))return!0;var i,s=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 r of e)if(i=s(r))return i.v;return!1}function sz(e){var t=e.parentNode;return!(!t||!sT(t))&&t}var sU=[".ph-no-autocapture","[data-ph-no-autocapture]"],sV=["next","previous","prev",">","<"],sG=[...sV,"+","-","−","–"],sW=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,sY=[".ph-no-rageclick",".ph-no-capture"],sK=["","text","search","email","password","url","tel","number"];function sJ(e,t){if(!l||sQ(e)||(eu(t)?(s=!!t&&sY,r=void 0,n=!1):(s=null!=(a=null==t?void 0:t.css_selector_ignorelist)?a:sY,r=null==t?void 0:t.content_ignorelist,n=null!=(o=null==t?void 0:t.ignore_text_selection)&&o),!1===s)||n&&!(!(i=e)||!sT(i))&&(sR(i,"textarea")||(sR(i,"input")?G(sK,(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,r,n,a,o,{targetElementList:u}=sZ(e,!1);return!function(e,t){var i;if(!1===e||ei(e))return!1;if(!0===e)i=sV;else{if(!Z(e))return!1;if(e.length>10)return t2.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{safeText:t,ariaLabel:s}=e;return i.some(e=>sW(t,e)||sW(s,e))})}(r,u.map(e=>{var t;return{safeText:sj(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!sH(u,s)}var sQ=e=>!e||sR(e,"html")||!sT(e),sZ=(e,t)=>{if(!l||sQ(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],r=e;r.parentNode&&!sR(r,"body");)if(sC(r.parentNode))s.push(r.parentNode.host),r=r.parentNode.host;else{var n=sz(r);if(!n)break;if(t||sB.indexOf(n.tagName.toLowerCase())>-1)i=!0;else try{var a=l.getComputedStyle(n);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}catch(e){}s.push(n),r=n}return{parentIsUsefulElement:i,targetElementList:s}};function sX(e){for(var t=e;t.parentNode&&!sR(t,"body");t=t.parentNode){var i=sD(t);if(G(i,"ph-sensitive")||G(i,"ph-no-capture"))return!1}if(G(sD(e),"ph-include"))return!0;var s=e.type||"";if(es(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}
1var r=e.name||e.id||"";return!es(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function s0(e){return!!(sR(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||sR(e,"select")||sR(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var s1="(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})",s2=RegExp("^(?:"+s1+")$"),s3=new RegExp(s1),s5="\\d{3}-?\\d{2}-?\\d{4}",s6=RegExp("^("+s5+")$"),s4=RegExp("("+s5+")");function s8(e,t){return void 0===t&&(t=!0),!(ea(e)||es(e)&&(e=W(e),(t?s2:s3).test((e||"").replace(/[- ]/g,""))||(t?s6:s4).test(e)))&&!0}function s7(e){var t=sj(e);return s8(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&i9(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=sj(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){t2.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function s9(e){return e.replace(/"|\\"/g,'\\"')}var re=t3("[Dead Clicks]"),rt=()=>!0,ri=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(il)),s=e.instance.config.capture_dead_clicks;return eu(s)?s:!!ee(s)||i};class rs{get lazyLoadedDeadClicksAutocapture(){return this.qt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[il]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Bt(()=>{this.jt()}):this.stop()}Bt(e){var t,i;null!=(t=m.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=m.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?re.error("failed to load script",t):e()})}jt(){var e;if(h){if(!this.qt&&null!=(e=m.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=ee(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.qt=m.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.qt.start(h),re.info("starting...")}}else re.error("`document` not found. Cannot start.")}stop(){this.qt&&(this.qt.stop(),this.qt=void 0,re.info("stopping..."))}}var rr=t3("[SegmentIntegration]"),rn="posthog-js";function ra(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{if("*"!==n&&!n.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var o=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=o,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var l,u,c,h,d,p,v=(null==(l=t.exception)?void 0:l.values)||[],g=v.map(e=>E({},e,{stacktrace:e.stacktrace?E({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>E({},e,{platform:"web:javascript"}))}):void 0})),f={$exception_message:(null==(u=v[0])?void 0:u.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 i&&s&&(f.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),a&&(null==(p=e.exceptions)||p.sendExceptionEvent(f)),t}}class ro{constructor(e,t,i,s,r,n){this.name=rn,this.setupOnce=function(a){a(ra(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class rl{constructor(e){this.Ht=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(t2.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Ut=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.zt()}zt(){var e;this.Vt=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Ht)}destroy(){var e;null==(e=this.Vt)||e.call(this),this.Vt=void 0}doPageView(e,t){var i,s=this.Wt(e,t);return this.Ut={pathname:null!=(i=null==l?void 0:l.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Wt(e,null==(t=this.Ut)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Ut)?void 0:e.pageViewId}}Wt(e,t){var i=this.Ut;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:a,maxScrollY:o,maxContentHeight:l,lastContentY:u,maxContentY:c}=r;if(!(ei(n)||ei(a)||ei(o)||ei(l)||ei(u)||ei(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?e_(a/n,0,1,t2):1,d=n>1?e_(o/n,0,1,t2):1,p=l>1?e_(u/l,0,1,t2):1,v=l>1?e_(c/l,0,1,t2):1;s=se(s,{$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&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var ru=["flags","surveys"],rc={[t4]:{exposure:"hidden"},[t9]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[ie]:{exposure:"hidden"},[it]:{exposure:"event"},[ii]:{exposure:"hidden"},[is]:{exposure:"event"},[ir]:{exposure:"hidden"},[ia]:{exposure:"event"},[io]:{exposure:"event"},[il]:{exposure:"event"},[iu]:{exposure:"hidden"},[ic]:{exposure:"event"}
1,[ih]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[im]:{exposure:"hidden"},[iy]:{exposure:"event"},[id]:{exposure:"event",shouldSkipFromEventProperties:e=>en(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"},[ib]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!ee(e))return{};for(var t={},i=Object.keys(e),s=0;i.length>s;s++)t["$feature/"+i[s]]=e[i[s]];return t}},[iw]:{exposure:"event",storageGroup:"flags"},[ix]:{exposure:"hidden"},[iS]:{exposure:"hidden",storageGroup:"flags"},[iE]:{exposure:"event",storageGroup:"flags"},[ik]:{exposure:"event",storageGroup:"flags",volatile:!0},[iP]:{exposure:"event"},[iF]:{exposure:"hidden"},[iA]:{exposure:"hidden"},[iI]:{exposure:"hidden"},[i$]:{exposure:"hidden",storageGroup:"surveys"},[iT]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[iR]:{exposure:"event"},[iO]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[iC]:{exposure:"hidden"},[iM]:{exposure:"hidden"},[iL]:{exposure:"hidden"},[iD]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iN]:{exposure:"hidden"},[ij]:{exposure:"hidden"},[iq]:{exposure:"hidden"},[iB]:{exposure:"hidden"},[iH]:{exposure:"hidden"},[iz]:{exposure:"hidden"},[iU]:{exposure:"hidden"},[ip]:{exposure:"event"},[iv]:{exposure:"event"},[ig]:{exposure:"event"},[i_]:{exposure:"event"},[iW]:{exposure:"event"},[iY]:{exposure:"event"},[iK]:{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"}},rh=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rd=e=>{var t=rc[e];if(t)return t;for(var[i,s]of rh)if(0===e.indexOf(i))return s},rp=e=>{var t=null==h?void 0:h.createElement("a");return ei(t)?null:(t.href=e,t)},rv=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;s.length>r;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!Z(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){t2.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},rg=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],c=0;l.length>c;c++){var h=l[c].split("=");Z(h)&&(t.includes(h[0])?u.push(h[0]+"="+i):u.push(l[c]))}var d=o;return null!=a&&(d+="?"+u.join("&")),null!=r&&(d+="#"+r),d},rf=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},r_=(e,t)=>e>=t&&y(),rm=(e,t,i,s)=>{if(0===e){if(y()){var r=t+1;return r===i&&s(),r}return t}return 0},ry="https?://(.*)",rb=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rw=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rb],rx="<masked>",rS=["li_fat_id"];function rE(e,t,i){if(!h)return{};var s,r=t?[...rb,...i||[]]:[],n=rk(rg(h.URL,r,rx),e);return se((s={},i9(rS,function(e){var t=sb.A(e);s[e]=t||null}),s),n)}function rk(e,t){var i=rw.concat(t||[]),s={};return i9(i,function(t){var i=rv(e,t);s[t]=i||null}),s}function rP(e){var t=e?0===e.search(ry+"google.([^/?]*)")?"google":0===e.search(ry+"bing.com")?"bing":0===e.search(ry+"yahoo.com")?"yahoo":0===e.search(ry+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!en(t)){i.$search_engine=t;var s=h?rv(h.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function rF(){return navigator.language||navigator.userLanguage}var rA="$direct";function rI(){return(null==h?void 0:h.referrer)||rA}function r$(e,t,i){void 0===i&&(i=!1);var s=e?[...rb,...t||[]]:[],r=i?tv(null==d?void 0:d.href):null==d?void 0:d.href,n=null==r?void 0:r.substring(0,1e3);return{r:rI().substring(0,1e3),u:n?rg(n,s,rx):void 0}}function rT(e,t){void 0===t&&(t=!1);var i,{r:s,u:r}=e,n=t?tv(r):r,a={$referrer:s,$referring_domain:null==s?void 0:s==rA?rA:null==(i=rp(s))?void 0:i.host};
1if(n){a.$current_url=n;var o=rp(n);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname,se(a,rk(n))}return s&&se(a,rP(s)),a}function rR(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var rO={flags:iD,surveys:iT},rC=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],rM="main";class rL{constructor(e,t,i){if(void 0===i&&(i=!0),this.Gt={},this.Zt=!1,this.Qt=!1,this.Se=e,this.Jt=i,this.props={},this.Kt=!1,this.Yt=(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.Dt=this.Xt(e),this.Qt=this.er(e),this.load(),e.debug&&t2.info("Persistence loaded",e.persistence,E({},this.props)),this.update_config(e,e,t),this.save(),l){var s=()=>this.flush();sa(l,"beforeunload",s,{capture:!1}),sa(l,"pagehide",s,{capture:!1})}}tr(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return eo(t)&&t>0?t:0}isDisabled(){return!!this.rr}Xt(e){-1===rC.indexOf(e.persistence.toLowerCase())&&(t2.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,s,r,n=(t=e.cookie_persisted_properties||[],i=e.__preview_cookie_wins_on_conflict||!1,void 0===t&&(t=[]),void 0===i&&(i=!1),s=[...sS,...t],E({},sx,{F(e){try{var t={};try{t=sb.F(e)||{}}catch(e){}var s,r=JSON.parse(sx.A(e)||"{}");if(i){var n={};for(var a in t){var o=t[a];en(o)||""===o||(n[a]=o)}s=se(r,n)}else s=se(t,r);return sx.q(e,s),s}catch(e){}return null},q(e,t,i,r,n,a){var o=sx.q(e,t,void 0,void 0,a);try{var l={};s.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&sb.q(e,l,i,r,n,a)}catch(e){sx.D(e)}return o},P(e,t){try{null==l||l.localStorage.removeItem(e),sb.P(e,t)}catch(e){sx.D(e)}}})),a=!1,o=e.persistence.toLowerCase();return"localstorage"===o&&sx.N()?(r=sx,a=!0):"localstorage+cookie"===o&&n.N()?(r=n,a=!0):"sessionstorage"===o&&sF.N()?r=sF:"memory"===o?r=sk:"cookie"===o?r=sb:n.N()?(r=n,a=!0):r=sb,this.Zt=a,r}ir(e){return this.Yt+"__"+e}er(e){return this.Zt&&!!e.split_storage}nr(e){var t=null!=e?e:this.Se.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 i9(this.props,(t,i)=>{var s=rd(i);if("derived"===(null==s?void 0:s.exposure)){if(null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t,i===ib?()=>this.nr():()=>!1))return;s.transformToEventProperties&&se(e,s.transformToEventProperties(t))}else if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t,()=>!1))return;e[i]=t}}),e}load(){if(!this.rr){var e=this.Dt.F(this.Yt);e&&(this.props=se({},e)),this.Qt&&this.sr()}}sr(){for(var e of ru){var t=sx.F(this.ir(e));if(t&&!et(t)){var i=this.ar(e);i.persisted=!0,this.lr(e)||(i.fingerprint=this.ur(t,e)),this.hr(e,t)||se(this.props,t)}}}lr(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=rd(t))?void 0:i.storageGroup)===e})}hr(e,t){var i=rO[e];if(!i)return!1;var s=t[i],r=this.props[i];return eo(s)&&eo(r)&&r>s}refreshKey(e){var t;if(!this.rr){var i=this.Qt?null==(t=rd(e))?void 0:t.storageGroup:void 0,s=i?sx.F(this.ir(i)):this.Dt.F(this.Yt);if(s&&e in s)this.dr(e,s[e]);else{if(i){var r=this.Dt.F(this.Yt);if(r&&e in r)return void this.dr(e,r[e])}this.cr(e)}}}save(){if(!this.rr){var e=this.tr();e>0?ei(this.vr)&&(this.vr=setTimeout(()=>{this.vr=void 0,this.pr()},e)):this.pr()}}flush(){ei(this.vr)||(clearTimeout(this.vr),this.vr=void 0,this.pr())}pr(){this.rr||(this.Qt?this.gr():this.mr(this.Dt,this.Yt,this.props,rM))}gr(){var{main:e,groups:t}=this.yr();for(var i of(this.mr(this.Dt,this.Yt,e,rM),ru)){var s,r=t[i];(!et(r)||null!=(s=this.Gt[i])&&s.persisted)&&this.mr(sx,this.ir(i),r,i)}}yr(){var e={},t={};for(var i of ru)t[i]={};return i9(this.props,(i,s)=>{var r,n=null==(r=rd(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}ur(e,t){if(t===rM)return JSON.stringify(e)+"|"+this.br+"|"+this._r+"|"+this.wr;var i={};return i9(e,(e,t)=>{var s;i[t]=null!=(s=rd(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}mr(e,t,i,s){var r,n=this.ar(s);if(s===rM||n.dirty||ei(n.fingerprint)){try{if((r=this.ur(i,s))===n.fingerprint)return void(n.dirty=!1)}catch(e){r=void 0}e.q(t,i,this.br,this._r,this.wr,this.Se.debug)?(n.dirty=!1,s!==rM&&(n.persisted=!0),ei(r)||(n.fingerprint=r)):this.Se.debug&&t2.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var{keepGroupEntries:t=!1}=void 0===e?{}:e;if(ei(this.vr)||(clearTimeout(this.vr),this.vr=void 0),this.Dt.P(this.Yt,!1),this.Dt.P(this.Yt,!0),!t&&this.Jt)for(var i of ru)sx.P(this.ir(i));t?delete this.Gt[rM]:this.Gt={}}clear(){this.remove(),this.props={}}register_once(e,t,i){if(ee(e)){ei(t)&&(t="None"),this.br=ei(i)?this.kr:i;var s=!1;if(i9(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.dr(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(ee(e)){this.br=ei(t)?this.kr:t;var i=!1;if(i9(e,(t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.dr(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.cr(e),this.save())}update_campaign_params(){if(!this.Kt){var e=rE(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);et(sr(e))||this.register(e),this.Kt=!0}}update_search_keyword(){var e;this.register((e=null==h?void 0:h.referrer)?rP(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rI(),$referring_domain:null!=h&&h.referrer&&(null==(e=rp(h.referrer))?void 0:e.host)||rA},void 0)}set_initial_person_info(){this.props[iB]||this.props[iH]||this.register_once({[iz]:r$(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes
1)},void 0)}get_initial_props(){var e,t,i,s={};i9([iH,iB],e=>{var t=this.props[e];t&&i9(t,function(e,t){s["$initial_"+Y(t)]=e})});var r=this.props[iz];return r&&se(s,(void 0===(e=this.Se.disable_capture_url_hashes)&&(e=!1),t=rT(r,e),i={},i9(t,function(e,t){i["$initial_"+Y(t)]=e}),i)),s}safe_merge(e){return i9(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){this.kr=this.br=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 s=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),r=s?this.Xt(e):this.Dt,n=this.er(e);if(s||n!==this.Qt){var a=this.props;this.clear(),this.Dt=r,this.Qt=n,this.props=a,this.save()}}set_disabled(e){this.rr=e,this.rr?this.remove():this.save()}set_cross_subdomain(e){e!==this._r&&(this._r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.wr&&(this.wr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[ie]||{};i[e]=t,this.dr(ie,i),this.save()}remove_event_timer(e){var t=this.props[ie]||{},i=t[e];return ei(i)||(delete t[e],this.dr(ie,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.dr(e,t),this.save()}dr(e,t){var i;this.props[e]=t,null!=(i=rd(e))&&i.volatile||this.Sr(e)}cr(e){delete this.props[e],this.Sr(e)}Sr(e){var t,i=null==(t=rd(e))?void 0:t.storageGroup;i&&(this.ar(i).dirty=!0)}ar(e){return this.Gt[e]||(this.Gt[e]={})}}var rD="events",rN="cancelEvents",rj="survey shown",rq="survey dismissed",rB="survey sent",rH="popover",rz=t3("[RateLimiter]");class rU{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{rz.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void rz.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,s,{captureEventsBurstLimit:r,captureEventsPerSecond:n}=this,a=(new Date).getTime(),o=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(iq))?t:{tokens:r,last:a};o.tokens+=(a-o.last)/1e3*n,o.last=a,o.tokens>r&&(o.tokens=r);var l=1>o.tokens;return l||e||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(iq,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var rV=t3("[RemoteConfig]");class rG{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=m._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Cr(e){var t,i;null!=(t=m.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=m.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Ir(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return rV.info("Using preloaded remote config",this.remoteConfig),this.Tr(this.remoteConfig),void this.Mr();if(this._instance.Er())return void rV.warn("Remote config is disabled. Falling back to local config.");this.Cr(e=>{e?(this.Tr(e),this.Mr()):(rV.info("No config found after loading remote JS config. Falling back to JSON."),this.Ir(e=>{this.Tr(e),this.Mr()}))})}catch(e){rV.error("Error loading remote config",e)}}stop(){this.Pr&&(clearInterval(this.Pr),this.Pr=void 0)}
vendor: 4,280 bytes, line 1
1refresh(){!this._instance.Er()&&h&&"hidden"!==h.visibilityState&&this._instance.reloadFeatureFlags()}Mr(){var e;if(!this.Pr){var t=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==t&&(this.Pr=setInterval(()=>{this.refresh()},t))}}Tr(e){var t;e||rV.error("Failed to fetch remote config from PostHog."),this._instance.Tr(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var rW="gzip-js",rY="base64",rK=Uint8Array,rJ=Uint16Array,rQ=Uint32Array,rZ=new rK([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]),rX=new rK([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]),r0=new rK([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),r1=function(e,t){for(var i=new rJ(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new rQ(i[30]);for(s=1;30>s;++s)for(var n=i[s];i[s+1]>n;++n)r[n]=n-i[s]<<5|s;return[i,r]},r2=r1(rZ,2),r3=r2[1];r2[0][28]=258,r3[258]=28;for(var r5=r1(rX,0)[1],r6=new rJ(32768),r4=0;32768>r4;++r4){var r8=(43690&r4)>>>1|(21845&r4)<<1;r6[r4]=((65280&(r8=(61680&(r8=(52428&r8)>>>2|(13107&r8)<<2))>>>4|(3855&r8)<<4))>>>8|(255&r8)<<8)>>>1}var r7=function(e,t,i){for(var s=e.length,r=0,n=new rJ(t);s>r;++r)++n[e[r]-1];var a,o=new rJ(t);for(r=0;t>r;++r)o[r]=o[r-1]+n[r-1]<<1;if(i){a=new rJ(1<<t);var l=15-t;for(r=0;s>r;++r)if(e[r])for(var u=r<<4|e[r],c=t-e[r],h=o[e[r]-1]++<<c,d=h|(1<<c)-1;d>=h;++h)a[r6[h]>>>l]=u}else for(a=new rJ(s),r=0;s>r;++r)a[r]=r6[o[e[r]-1]++]>>>15-e[r];return a},r9=new rK(288);for(r4=0;144>r4;++r4)r9[r4]=8;for(r4=144;256>r4;++r4)r9[r4]=9;for(r4=256;280>r4;++r4)r9[r4]=7;for(r4=280;288>r4;++r4)r9[r4]=8;var ne=new rK(32);for(r4=0;32>r4;++r4)ne[r4]=5;var nt=r7(r9,9,0),ni=r7(ne,5,0),ns=function(e){return(e/8|0)+(7&e&&1)},nr=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof rJ?rJ:e instanceof rQ?rQ:rK)(i-t);return s.set(e.subarray(t,i)),s},nn=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},na=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},no=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new rK(0),0];if(1==r){var a=new rK(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!=r-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(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var p=new rJ(d+1),v=nl(i[c-1],p,0);if(v>t){s=0;var g=0,f=v-t,_=1<<f;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r>s;++s){var m=n[s].s;if(t>=p[m])break;g+=_-(1<<v-p[m]),p[m]=t}for(g>>>=f;g>0;){var y=n[s].s;t>p[y]?g-=1<<t-p[y]++-1:++s}for(;s>=0&&g;--s){var b=n[s].s;p[b]==t&&(--p[b],++g)}v=t}return[new rK(p),v]},nl=function(e,t,i){return -1==e.s?Math.max(nl(e.l,t,i+1),nl(e.r,t,i+1)):t[e.s]=i},nu=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new rJ(++t),s=0,r=e[0],n=1,a=function(e){i[s++]=e},o=1;t>=o;++o)if(e[o]==r&&o!=t)++n;else{if(!r&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(r),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(r);n=1,r=e[o]}return[i.subarray(0,s),t]},nc=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},nh=function(e,t,i){var s=i.length,r=ns(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;s>n;++n)e[r+n+4]=i[n];return 8*(r+4+s)},nd=function(e,t,i,s,r,n,a,o,l,u,c){nn(t,c++,i),++r[256];for(var h=no(r,15),d=h[0],p=h[1],v=no(n,15),g=v[0],f=v[1],_=nu(d),m=_[0],y=_[1],b=nu(g),w=b[0],x=b[1],S=new rJ(19),E=0;m.length>E;++E)S[31&m[E]]++;for(E=0;w.length>E;++E)S[31&w[E]]++;for(var k=no(S,7),P=k[0],F=k[1],A=19;A>4&&!P[r0[A-1]];--A);var I,$,T,R,O=u+5<<3,C=nc(r,r9)+nc(n,ne)+a,M=nc(r,d)+nc(n,g)+a+14+3*A+nc(S,P)+(2*S[16]+3*S[17]+7*S[18]);if(C>=O&&M>=O)return nh(t,c,e.subarray(l,l+u));if(nn(t,c,1+(C>M)),c+=2,C>M){I=r7(d,p,0),$=d,T=r7(g,f,0),R=g;var L=r7(P,F,0);for(nn(t,c,y-257),nn(t,c+5,x-1),nn(t,c+10,A-4),c+=14,E=0;A>E;++E)nn(t,c+3*E,P[r0[E]]);c+=3*A;for(var D=[m,w],N=0;2>N;++N){var j=D[N];for(E=0;j.length>E;++E)nn(t,c,L[q=31&j[E]]),c+=P[q],q>
115&&(nn(t,c,j[E]>>>5&127),c+=j[E]>>>12)}}else I=nt,$=r9,T=ni,R=ne;for(E=0;o>E;++E)if(s[E]>255){na(t,c,I[257+(q=s[E]>>>18&31)]),c+=$[q+257],q>7&&(nn(t,c,s[E]>>>23&31),c+=rZ[q]);var q,B=31&s[E];na(t,c,T[B]),c+=R[B],B>3&&(na(t,c,s[E]>>>5&8191),c+=rX[B])}else na(t,c,I[s[E]]),c+=$[s[E]];return na(t,c,I[256]),c+$[256]},np=new rQ([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nv=function(){for(var e=new rQ(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),ng=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},nf=!!v||!!p,n_="text/plain",nm=!1,ny=(e,t)=>{var[i,s]=e.split("#"),[r,n]=i.split("?");if(!n)return e;var a=n.split("&").filter(e=>e.split("=")[0]!==t).join("&");return r+(a?"?"+a:"")+(s?"#"+s:"")},nb=function(e,t,i){void 0===i&&(i=!0);var s,r,n,a,o,[l,u]=e.split("?"),c=E({},t),h=null!=(o=null==u?void 0:u.split("&").map(e=>{var t,[s,r]=e.split("="),n=i&&null!=(t=c[s])?t:r;return delete c[s],s+"="+n}))?o:[],d=(void 0===s&&(s="&"),a=[],i9(c,function(e,t){ei(e)||ei(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+r)}),a.join(s));return d&&h.push(d),l+"?"+h.join("&")},nw=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),nx=e=>{if(e.Lt)return e.Lt;var{data:t,compression:i}=e;if(t){if(i===rW){var s,r,n,a,o,l,u,c,h=(s=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new rK(e.length+(e.length>>>1)),s=0,r=function(e){i[s++]=e},n=0;t>n;++n){if(s+5>i.length){var a=new rK(s+8+(t-n<<1));a.set(i),i=a}var o=e.charCodeAt(n);128>o?r(o):(2048>o?r(192|o>>>6):(o>55295&&57344>o?(r(240|(o=65536+(1047552&o)|1023&e.charCodeAt(++n))>>>18),r(128|o>>>12&63)):r(224|o>>>12),r(128|o>>>6&63)),r(128|63&o))}return nr(i,0,s)}(nw(t)),r={mtime:0},n=0xffffffff,a={p(e){for(var t=n,i=0;e.length>i;++i)t=nv[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},o=s.length,a.p(s),c=(l=10+(r.filename&&r.filename.length+1||0),u=function(e,t,i,s){var r=e.length,n=new rK(s+r+5*(1+Math.floor(r/7e3))+8),a=n.subarray(s,n.length-8),o=0;if(!t||8>r)for(var l=0;r>=l;l+=65535){var u=l+65535;r>u?o=nh(a,o,e.subarray(l,u)):(a[l]=!0,o=nh(a,o,e.subarray(l,r)))}else{for(var c=np[t-1],h=c>>>13,d=8191&c,p=(1<<i)-1,v=new rJ(32768),g=new rJ(p+1),f=Math.ceil(i/3),_=2*f,m=function(t){return(e[t]^e[t+1]<<f^e[t+2]<<_)&p},y=new rQ(25e3),b=new rJ(288),w=new rJ(32),x=0,S=0,E=(l=0,0),k=0,P=0;r>l;++l){var F=m(l),A=32767&l,I=g[F];if(v[A]=I,g[F]=A,l>=k){var $=r-l;if((x>7e3||E>24576)&&$>423){o=nd(e,a,0,y,b,w,S,E,P,l-P,o),E=x=S=0,P=l;for(var T=0;286>T;++T)b[T]=0;for(T=0;30>T;++T)w[T]=0}var R=2,O=0,C=d,M=A-I&32767;if($>2&&F==m(l-M))for(var L=Math.min(h,$)-1,D=Math.min(32767,l),N=Math.min(258,$);D>=M&&--C&&A!=I;){if(e[l+R]==e[l+R-M]){for(var j=0;N>j&&e[l+j]==e[l+j-M];++j);if(j>R){if(R=j,O=M,j>L)break;var q=Math.min(M,j-2),B=0;for(T=0;q>T;++T){var H=l-M+T+32768&32767,z=H-v[H]+32768&32767;z>B&&(B=z,I=H)}}}M+=(A=I)-(I=v[A])+32768&32767}if(O){y[E++]=0x10000000|r3[R]<<18|r5[O];var U=31&r3[R],V=31&r5[O];S+=rZ[U]+rX[V],++b[257+U],++w[V],k=l+R,++x}else y[E++]=e[l],++b[e[l]]}}o=nd(e,a,!0,y,b,w,S,E,P,l-P,o)}return nr(n,0,s+ns(o)+8)}(s,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+r.mem,l)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&ng(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;i.length>=s;++s)e[s+10]=i.charCodeAt(s)}}(u,r),ng(u,c-8,a.d()),ng(u,c-4,o),u);return{contentType:n_,body:h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength),estimatedSize:h.byteLength}}if(i===rY){let e;var d,p="data="+encodeURIComponent("string"==typeof(e=(d=nw(t))?btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):d)?e:nw(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var v=nw(t);return{contentType:"application/json",body:v,estimatedSize:new Blob([v]).size}}},nS=e=>{var t,i,s=()=>({url:ny(e.url,"compression"),encodedBody:nx(E({},e,{compression:void 0,Lt:void 0}))});try{t=nx(e)}catch(t){if(j(e.compression,rv(e.url,"compression")))return t2.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&j(e.compression,rv(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?N(new Uint8Array(i)):ArrayBuffer.isView(i)&&N(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(nm=!0,s())},nE=e=>{try{return nS(e)}catch(t){return t2.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},nk=(t=S(function*(e){var t=nw(e.data),i=yield function(e,t,i){return z.apply(this,arguments)}(t,w.DEBUG,{rethrow:!0});if(!i)return e;var s=yield i.arrayBuffer();return E({},e,{Lt:{contentType:n_,body:s,estimatedSize:s.byteLength}})}),function(e){return t.apply(this,arguments)}),nP=["/e/","/s/"],nF=(e,t)=>{var i,s,r,n=(r=(s=(null==(i=rp(e))?void 0:i.pathname)||e.split(/[?#]/)[0])?"/"===s[0]?s:"/"+s:"/",nP.some(e=>r.slice(r.length-e.length)===e)),a=n?ny(e,"ver"):e;return nb(t===rW?ny(a,"compression"):a,E({_:(new Date).getTime().toString()},n?{}:{ver:w.JS_SDK_VERSION},t===rW?{}:{compression:t}))},nA=[];p&&nA.push({transport:"fetch",method(e){var t,i=nE(e);if(i){var{url:s,encodedBody:r}=i,{contentType:n,body:a,estimatedSize:o}=null!=r?r:{},l=new Headers;i9(e.headers,function(e,t){l.append(t,e)}),n&&l.append("Content-Type",n);var u=null,c=!1;if(g){var h=new g;u={signal:h.signal,timeout:setTimeout(()=>{var t,i;c=!0,h.abort(((i=Error("PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":""))).name="AbortError",i))},e.timeout)}}p(s,E({method:(null==e?void 0:e.method)||"GET",headers:l,keepalive:"POST"===e.method&&52428.8>(o||0),body:a,signal:null==(t=u)?void 0:t.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){t2.error(e)}null==e.callback||e.callback(s)})).catch(t=>{c&&"AbortError"===(null==t?void 0:t.name)?t2.warn(t):t2.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>u?clearTimeout(u.timeout):null)}}}),v&&nA.push({transport:"XHR",method(e){var t=nE(e);if(t){var i=new v,{url:s,encodedBody:r}=t;i.open(e.method||"GET",s,!0);var{contentType:n,body:a}=null!=r?r:{};i9(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};
1if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(a)}}}),null!=c&&c.sendBeacon&&nA.push({transport:"sendBeacon",method(e){try{var{url:t,encodedBody:i}=nS(e),{contentType:s,body:r}=null!=i?i:{};if(!r)return;var n=r instanceof Blob?r:new Blob([r],{type:s});c.sendBeacon(t,n)}catch(e){}}});class nI{constructor(e,t){this.Rr=!0,this.Or=[],this.Lr=e_((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,t2.createLogger("flush interval"),3e3),this.Fr=e}enqueue(e){this.Or.push(e),this.Ar||this.Dr()}unload(){this.$r();var e=Object.values(this.Or.length>0?this.Nr():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.qr(E({},e,{transport:"sendBeacon"}))})}enable(){this.Rr=!1,this.Dr()}Dr(){var e=this;this.Rr||(this.Ar=setTimeout(()=>{if(this.$r(),this.Or.length>0){var t=this.Nr();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&Z(s.data)&&i9(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.qr(s)}()}},this.Lr))}qr(e){try{this.Fr(e)}catch(e){t2.error(e)}}$r(){clearTimeout(this.Ar),this.Ar=void 0}Nr(){var e={};return i9(this.Or,t=>{var i,s=(t?t.batchKey:null)||t.url;ei(e[s])&&(e[s]=E({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.Or=[],e}}var n$=["retriesPerformedSoFar"];class nT{constructor(e){this.Br=!1,this.jr=3e3,this.Or=[],this._instance=e,this.Or=[],this.Hr=!0,!ei(l)&&"onLine"in l.navigator&&(this.Hr=l.navigator.onLine,this.Ur=()=>{this.Hr=!0,this.zr()},this.Vr=()=>{this.Hr=!1},sa(l,"online",this.Ur),sa(l,"offline",this.Vr))}get length(){return this.Or.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=k(e,n$);el(t)&&(i.url=nb(i.url,{retry_count:t})),this._instance._send_request(E({},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.st(E({retriesPerformedSoFar:t},i));0===e.statusCode&&t2.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)}}))}st(e){var t,i,s=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=s+1;var r=Math.ceil((i=Math.min(18e5,t=3e3*Math.pow(2,s)))+(Math.random()-.5)*(i-t/2)),n=Date.now()+r;this.Or.push({retryAt:n,requestOptions:e});var a="Enqueued failed request for retry in "+r;navigator.onLine||(a+=" (Browser is offline)"),t2.warn(a),this.Br||(this.Br=!0,this.Wr())}Wr(){(this.Gr&&clearTimeout(this.Gr),0===this.Or.length)?(this.Br=!1,this.Gr=void 0):this.Gr=setTimeout(()=>{this.Hr&&this.Or.length>0&&this.zr(),this.Wr()},this.jr)}zr(){var e=Date.now(),t=[],i=this.Or.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.Or=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Gr&&(clearTimeout(this.Gr),this.Gr=void 0),this.Br=!1,ei(l)||(this.Ur&&(l.removeEventListener("online",this.Ur),this.Ur=void 0),this.Vr&&(l.removeEventListener("offline",this.Vr),this.Vr=void 0)),this.Or))try{this._instance._send_request(E({},e,{transport:"sendBeacon"}))}catch(e){t2.error(e)}this.Or=[]}}class nR{constructor(e){this.Zr=()=>{this.Qr||(this.Qr={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),a=r?Math.max(0,r.scrollHeight-r.clientHeight):0,o=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.Qr.lastScrollY=Math.ceil(n),this.Qr.maxScrollY=Math.max(n,null!=(e=this.Qr.maxScrollY)?e:0),this.Qr.maxScrollHeight=Math.max(a,null!=(t=this.Qr.maxScrollHeight)?t:0),this.Qr.lastContentY=o,this.Qr.maxContentY=Math.max(o,null!=(i=this.Qr.maxContentY)?i:0),this.Qr.maxContentHeight=Math.max(l,null!=(s=this.Qr.maxContentHeight)?s:0)},this._instance=e}get Jr(){return this._instance.config.scroll_root_selector}getContext(){return this.Qr}resetContext(){var e=this.Qr;return setTimeout(this.Zr,0),e}startMeasuringScrollPosition(){sa(l,"scroll",this.Zr,{capture:!0}),sa(l,"scrollend",this.Zr,{capture:!0}),sa(l,"resize",this.Zr)}scrollElement(){if(!this.Jr)return null==l?void 0:l.document.documentElement;for(var e of Z(this.Jr)?this.Jr:[this.Jr]){var t=null==l?void 0:l.document.querySelector(e);
1if(t)return t}}Kr(e){if(this.Jr){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return l?"y"===e?l.scrollY||l.pageYOffset||l.document.documentElement.scrollTop||0:l.scrollX||l.pageXOffset||l.document.documentElement.scrollLeft||0:0}scrollY(){return this.Kr("y")}scrollX(){return this.Kr("x")}}var nO=e=>r$(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 nC{constructor(e,t,i,s){this.Yr=e=>{var t=this.Xr();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.ei(this._instance)};this.ti.register({[ij]:i})}},this._instance=e,this.ri=t,this.ti=i,this.ei=s||nO,this.ri.onSessionId(this.Yr)}Xr(){return this.ti.props[ij]}getSetOnceProps(){var e,t=null==(e=this.Xr())?void 0:e.props;return t?"r"in t?rT(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 i9(sr(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+Y(i)]=t}),e}}class nM{constructor(){this.ii={}}on(e,t){return this.ii[e]||(this.ii[e]=[]),this.ii[e].push(t),()=>{this.ii[e]=this.ii[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.ii[e]||[])i(t);for(var s of this.ii["*"]||[])s(e,t)}}var nL=t3("[SessionId]");class nD{on(e,t){return this.ni.on(e,t)}constructor(e,t,i){if(this.si=null,this.oi=[],this.ai=void 0,this.li=!1,this.ni=new nM,this.ui=(e,t)=>!(!el(e)||!el(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.Se=e.config,this.ti=e.persistence,this.hi=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ci=t||sf,this.vi=i||sf;var s,r=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*e_(this.Se.session_idle_timeout_seconds||1800,60,36e3,nL.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.fi(),this.pi="ph_"+r+"_window_id",this.gi="ph_"+r+"_primary_window_exists",this.mi()){var n=sF.F(this.pi),a=sF.F(this.gi);n&&!a?this.hi=n:sF.P(this.pi),sF.q(this.gi,!0)}if(null!=(s=this.Se.bootstrap)&&s.sessionID)try{var o=(e=>{var t=this.Se.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.yi(this.Se.bootstrap.sessionID,(new Date).getTime(),o)}catch(e){nL.error("Invalid sessionID in bootstrap",e)}this.bi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return ei(this.oi)&&(this.oi=[]),this.oi.push(e),this.di&&e(this.di,this.hi),()=>{this.oi=this.oi.filter(t=>t!==e)}}mi(){return"memory"!==this.Se.persistence&&!this.ti.rr&&sF.N()}wi(e){e!==this.hi&&(this.hi=e,this.mi()&&sF.q(this.pi,e))}xi(){return this.hi?this.hi:this.mi()?sF.F(this.pi):null}ki(e){var t=this.si;return!en(t)&&!en(e)&&5e3>Math.abs(e-t)}yi(e,t,i){var s=t!==this._sessionActivityTimestamp,r=e===this.di&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.di=e,r&&!s||r&&this.ki(t)||(this.si=t,this.ti.register({[im]:[t,e,i]}))}Si(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return el(t)&&t>0}Ci(){this.Si()?this.ti.refreshKey(im):(this.ti.flush(),this.ti.load())}Ii(){var e;if(!en(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.si){this.Ci();var[,t,i]=this.Ti();t===this.di&&i===this._sessionStartTimestamp&&(this.si=this._sessionActivityTimestamp,this.ti.register({[im]:[this._sessionActivityTimestamp,null!=(e=this.di)?e:null,this._sessionStartTimestamp]}),this.ti.flush())}}Mi(){var[e]=this.Ti();return Math.max(el(e)?e:0,el(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}Ei(e){return this.Ci(),this.ui(e,this.Mi())}Ti(){var e=this.ti.props[im];return Z(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.si=null,clearTimeout(this.Pi),this.Pi=void 0,this.yi(null,null,null)}destroy(){this.li=!0,this.Ii(),clearTimeout(this.Pi),this.Pi=void 0,this.ai&&l&&(l.removeEventListener(i3,this.ai,{capture:!1}),this.ai=void 0),this.oi=[]}bi(){this.ai=()=>{this.Ii(),this.mi()&&sF.P(this.gi)},sa(l,i3,this.ai,{capture:!1})}
1checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Se.cookieless_mode===iZ)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[,s,r]=this.Ti(),n=this.Mi(),a=this.xi(),o=el(r)&&Math.abs(i-r)>864e5,l=!1,u=!1,c=!s,h=s,d=!c&&!e&&this.ui(i,n);d&&((d=this.Ei(i))||nL.info("cross-tab refresh kept the session alive",{sessionId:s}),[,s,r]=this.Ti()),c||d||o?(s=this.ci(),a=this.vi(),nL.info("new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:o}}),r=i,l=!0):(a||(a=this.vi(),l=!0),(u=s!==h)&&(nL.info("adopted cross-tab session id",{sessionId:s,windowId:a}),l=!0));var p=el(n)&&e&&!o?n:i,v=el(r)?r:(new Date).getTime();this.wi(a),this.yi(s,p,v),e||this.fi();var g={noSessionId:c,activityTimeout:d,sessionPastMaximumLength:o,crossTabAdoption:u};return l&&this.oi.forEach(e=>e(s,a,g)),{sessionId:s,windowId:a,sessionStartTimestamp:v,changeReason:l?g:void 0,lastActivityTimestamp:n}}fi(){this.li||(clearTimeout(this.Pi),this.Pi=setTimeout(()=>{if(!this.li)if(this.Ei((new Date).getTime())){var e=this.di;this.resetSessionId(),this.ni.emit("forcedIdleReset",{idleSessionId:e})}else this.fi()},1.1*this.sessionTimeoutMs))}}var nN=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&V(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>V(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function nj(){return(nj=S(function*(){var e=null==c?void 0:c.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return es(i)&&i.length>0?i:void 0}catch(e){return void t2.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var nq=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 nB(e,t,i){return nw({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var nH={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=>nq(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!nq(t,e))),icontains:(e,t)=>t.map(nz).some(t=>e.map(nz).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(nz).every(t=>e.map(nz).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))})},nz=e=>e.toLowerCase();function nU(e,t){return!e||Object.entries(e).every(e=>{var[i,s]=e,r=null==t?void 0:t[i];if(ei(r)||en(r))return!1;var n=[String(r)],a=nH[s.operator];return!!a&&a(s.values,n)})}var nV="custom",nG="i.posthog.com",nW=/^\/static\//;class nY{constructor(e){this.Ri={},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("."+nG,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Ri[this.apiHost]||(this.Ri[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":nV),this.Ri[this.apiHost]}Oi(e){if(nW.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.Oi(t);if(i)return""+i+t}if(this.region===nV)return this.apiHost+t;var s=nG+t;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}var nK=t3("[Surveys]"),nJ="seenSurvey_",nQ=e=>{try{var t,i=(t=""+nJ+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+nJ+e.id+"_"+e.current_iteration),t);
1if(localStorage.getItem(i))return;localStorage.setItem(i,"true")}catch(e){nK.error("Failed to persist survey seen state",e)}},nZ=["popover","widget","api"],nX={ignoreConditions:!1,ignoreDelay:!1,displayType:rH},n0=t3("[PostHog ExternalIntegrations]"),n1={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class n2{constructor(e){this._instance=e}Bt(e,t){var i;null==(i=m.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return n0.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,s,n;!r||null!=(i=m.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.Bt(n1[e],()=>{var i;null==(i=m.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!r&&null!=(s=m.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=m.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[s,r]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(s)}}var n3={},n5=0,n6=()=>{},n4='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',n8="Surveys module not available",n7="sanitize_properties is deprecated. Use before_send instead",n9="Invalid value for property_denylist config: ",ae="posthog",at=!nf&&-1===(null==_?void 0:_.indexOf("MSIE"))&&-1===(null==_?void 0:_.indexOf("Mozilla")),ai=e=>{var t;return E({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(!es(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of sn)if(i===s)return!1;return!0}(null==h?void 0:h.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:n6,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:d&&es(null==d?void 0:d.search)&&-1!==d.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==l||null==(t=l.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){t2.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:i1,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:n6},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:sG,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)})},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"]],ar=e=>{var t={};for(var[i,s]of as)ei(e[i])||(t[s]=e[i]);var r=se({},t,e),n=e.__preview_external_dependency_versioned_paths;return ei(n)||(ei(e.strict_script_versioning)&&(r.strict_script_versioning=!!n),es(n)&&ei(e.asset_host)&&(r.asset_host=n)),Z(e.property_blacklist)&&(ei(e.property_denylist)?r.property_denylist=e.property_blacklist:Z(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:t2.error(n9+e.property_denylist)),r};class an{constructor(){this.__forceAllowLocalhost=!1}get Li(){return this.__forceAllowLocalhost}set Li(e){t2.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class aa{Fi(e,t){if(e){var i=this.Ai.indexOf(e);-1!==i&&this.Ai.splice(i,1)}return this.Ai.push(t),null==t.initialize||t.initialize(),t}Di(){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 an,this.$i=!1,this.version=w.LIB_VERSION,this.Ni=new nM,this.Ai=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ai(),this.SentryIntegration=ro,this.sentryIntegration=e=>{var t;return t=ra(this,e),{name:rn,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.qi=!1,this.Bi=null,this.ji=null,this.Hi=null,this.scrollManager=new nR(this),this.pageViewManager=new rl(this),this.rateLimiter=new rU(this),this.requestRouter=new nY(this),this.consent=new sA(this),this.externalIntegrations=new n2(this);var e,t=null!=(e=aa.__defaultExtensionClasses)?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var s=es(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=es(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>t2.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==ae){var s,r=null!=(s=n3[i])?s:new aa;return r._init(e,t,i),n3[i]=r,n3[ae][i]=r,r}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var s,r,n=es(e)?e.trim():"";if(!n)return t2.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Ui(t.debug),this.zi=t,this.Vi=[],t.person_profiles?this.ji=t.person_profiles:t.process_person&&(this.ji=t.process_person);var a=ai(t.defaults),o=ar(t),u=se({},a,o,{name:i,token:n});ee(a.rageclick)&&ee(o.rageclick)&&(u.rageclick=se({},a.rageclick,o.rageclick)),ee(a.session_recording)&&ee(o.session_recording)&&(u.session_recording=se({},a.session_recording,o.session_recording)),this.set_config(u),this.config.on_xhr_error&&t2.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:rW;var c=this.Wi();this.persistence=new rL(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rL(E({},this.config,{persistence:"sessionStorage"}),c,!1);var h=E({},this.persistence.props),d=E({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Gi=new nI(e=>this.Zi(e),this.config.request_queue_config),this.Qi=new nT(this),this.__request_queue=[];var p=this.Di();if(p||(this.sessionManager=new nD(this),this.sessionPropsManager=new nC(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(t2.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Ji(p)},0)):(t2.info("Initializing extensions synchronously"),this.Ji(p)),w.DEBUG=w.DEBUG||this.config.debug,w.DEBUG&&t2.info("Starting in debug mode",{this:this,config:t,thisC:E({},this.config),p:h,s:d}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=E({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}
1)),void 0!==(null==(r=t.bootstrap)?void 0:r.distinctID)){var v=t.bootstrap.distinctID,g=this.get_distinct_id(),f=this.persistence.get_property(iN);if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&f===iX)this.identify(v);else if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&f===i0)t2.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 _=this.config.get_device_id(sf()),m=t.bootstrap.isIdentifiedID?_:v;this.persistence.set_property(iN,t.bootstrap.isIdentifiedID?i0:iX),this.register({distinct_id:v,$device_id:m})}}if(p)this.register_once({distinct_id:iG,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(sf());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(iN,iX)}return sa(l,"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 s=i=>{var s=()=>i.anonymousId()||sf();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(iN,i0)),t()},r=i.user();"then"in r&&X(r.then)?r.then(s):s(r)}(e,()=>{var s;i.register(("u">typeof Promise&&Promise.resolve||rr.warn("This browser does not have Promise support, and can not use the segment integration"),s=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(rr.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(rr.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,i5),identify:e=>s(e,i4),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Ki()):this.Ki(),X(this.config._onCapture)&&this.config._onCapture!==n6&&(t2.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&t2.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 nj.apply(this,arguments)})().then(e=>{e&&this.register({[t7]:e})}).catch(n6),this}Ji(e){var t,i,s,r,n,a,o,l,u=performance.now(),c=E({},aa.__defaultExtensionClasses,this.config.__extensionClasses),h=[];c.featureFlags&&this.Ai.push(this.featureFlags=null!=(t=this.featureFlags)?t:new c.featureFlags(this)),c.exceptions&&this.Ai.push(this.exceptions=null!=(i=this.exceptions)?i:new c.exceptions(this)),c.historyAutocapture&&this.Ai.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this.Ai.push(this.tracingHeaders=new c.tracingHeaders(this)),c.siteApps&&this.Ai.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!e&&this.Ai.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),c.autocapture&&this.Ai.push(this.autocapture=new c.autocapture(this)),c.surveys&&this.Ai.push(this.surveys=null!=(s=this.surveys)?s:new c.surveys(this)),c.logs&&this.Ai.push(this.logs=null!=(r=this.logs)?r:new c.logs(this)),c.metrics&&this.Ai.push(this.metrics=null!=(n=this.metrics)?n:new c.metrics(this)),c.conversations&&this.Ai.push(this.conversations=null!=(a=this.conversations)?a:new c.conversations(this)),c.productTours&&this.Ai.push(this.productTours=new c.productTours(this)),c.heatmaps&&this.Ai.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this.Ai.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this.Ai.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this.Ai.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,ri)),c.toolbar&&this.Ai.push(this.toolbar=null!=(o=this.toolbar)?o:new c.toolbar(this)),c.experiments&&this.Ai.push(this.experiments=null!=(l=this.experiments)?l:new c.experiments(this)),this.Ai.forEac
1h(e=>{e.initialize&&h.push(()=>{null==e.initialize||e.initialize()})}),h.push(()=>{if(this.Yi){var e=this.Yi;this.Yi=void 0,this.Tr(e)}}),this.Xi(h,u)}Xi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Xi(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){t2.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[iW]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[iY]:s}),this.config.__preview_deferred_init_extensions&&t2.info("PostHog extensions initialized ("+s+"ms)")}Tr(e){var t;h&&h.body?(this.config.__preview_deferred_init_extensions&&(this.Yi=e),this.en=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=G(e.supportedCompression,rW)?rW:G(e.supportedCompression,rY)?rY:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.ji?this.ji:i1}),this.Ai.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))):(t2.info("document not ready yet, trying again in 500 milliseconds..."),setTimeout(()=>{this.Tr(e)},500))}Ki(){try{this.config.loaded(this)}catch(e){t2.critical("`loaded` function failed",e)}if(this.tn(),this.config.internal_or_test_user_hostname&&null!=d&&d.hostname){var e=d.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.Di())&&this.rn()},1),this.nn=new rG(this),this.nn.load()}tn(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Gi)||e.enable())}_dom_loaded(){this.is_capturing()&&i7(this.__request_queue,e=>this.Zi(e)),this.__request_queue=[],this.tn()}_handle_unload(){var e,t,i,s,r;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.sn()&&this.capture(i6),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.Gi)||s.unload(),null==(r=this.Qi)||r.unload()):this.sn()&&this.capture(i6,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?at?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=E({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(ei(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,s,r=E({},e);r.timeout=r.timeout||6e4,r.url=nF(r.url,r.compression);var n=null!=(t=r.transport)?t:"fetch",a=nA.filter(e=>!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)),o=null!=(i=null==(s=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===n)return e[t]}(a))?void 0:s.method)?i:a[0].method;if(!o)throw Error("No available transport method");"sendBeacon"!==n&&r.data&&r.compression===rW&&f&&"u">typeof Promise&&!nm?nk(r).then(e=>{o(e)}).catch(t=>{q(t)?(nm=!0,o(E({},r,{compression:void 0,url:nF(e.url,void 0)}))):((e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return q(e)||t===D})(t)&&(nm=!0),o(r))}):o(r)})(E({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(s=this.config).on_request_error)||i.call(s,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}Zi(e){this.Qi?this.Qi.retriableRequest(e):this._send_request(e)}_execute_array(e){n5++;try{var t,i=[],s=[],r=[];i7(e,e=>{if(e)if(Z(t=e[0]))r.push(e);else if(X(e))try{e.call(this)}catch(t){t2.error("Error executing queued PostHog call",e,t)}else Z(e)&&"alias"===t?i.push(e):Z(e)&&-1!==t.indexOf("capture")&&X(this[t])?r.push(e):s.push(e)});var n=function(e,t){i7(e,function(e){try{if(Z(e[0])){var i=t;i9(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){t2.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{n5--}}push(e){if(n5>0&&Z(e)&&es(e[0])){var t=aa.prototype[e[0]];X(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var s,r,n,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Gi){if(this.is_capturing())if(!ei(e)&&es(e)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=t&&t.$current_url&&!es(null==t?void 0:t.$current_url)&&(t2.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.an||t2.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 c=new Date,h=(null==i?void 0:i.timestamp)||c,d=tp(null==i?void 0:i.uuid,sf),p={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},h,d)};e===i5&&this.config.__preview_capture_bot_pageviews&&l&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),u&&(p.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens),(null==i?void 0:i.$set)&&(p.$set=null==i?void 0:i.$set);var v=null==i?void 0:i.$unset;v&&(p.$unset=v);var g,f,_,m=this.ln(null==i?void 0:i.$set_once,e!==i8,e===i4);if(m&&(p.$set_once=m),null!=i&&i._noTruncate||(r=this.config.properties_string_max_length,n=p,a=e=>es(e)?e.slice(0,r):e,o=new Set,p=function e(t,i){var s;return t!==Object(t)?a?a(t):t:o.has(t)?void 0:(o.add(t),Z(t)?(s=[],i7(t,t=>{s.push(e(t))})):(s={},i9(t,(t,i)=>{o.has(t)||(s[i]=e(t,i))}
1)),s)}(n)),p.timestamp=h,ei(null==i?void 0:i.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=c),e===rq||e===rB){var y=null==t?void 0:t.$survey_id,b=null==t?void 0:t.$survey_iteration;nQ({id:y,current_iteration:b}),p.$set=E({},p.$set,{[(g={id:y,current_iteration:b},_="$survey_"+(f=e===rB?"responded":"dismissed")+"/"+g.id,g.current_iteration&&g.current_iteration>0&&(_="$survey_"+f+"/"+g.id+"/"+g.current_iteration),_)]:!0})}else e===rj&&(p.$set=E({},p.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var w=null==t?void 0:t.$product_tour_type;w&&(p.$set=E({},p.$set,{["$product_tour_last_seen_date/"+w]:(new Date).toISOString()}))}var x=E({},p.properties.$set,p.$set);if(et(x)||this.setPersonPropertiesForFlags(x),!ea(this.config.before_send)){var S=this.it(p);if(!S)return;(p=S).uuid=tp(p.uuid,sf)}this.Ni.emit("eventCaptured",p);var k={method:"POST",url:null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:p,compression:"best-available",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.Zi(k):this.Gi.enqueue(k),p}t2.critical("This capture call is ignored due to client rate limiting.")}}else t2.error("No event name provided to posthog.capture")}else t2.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,s,r){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var n,a=r?void 0:this.persistence.remove_event_timer(e),o=E({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.Di()&&(o.$cookieless_mode=!0),"$snapshot"===e){var u=E({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=u.distinct_id,(!es(o.distinct_id)&&!eo(o.distinct_id)||er(o.distinct_id))&&t2.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var c,p=function(e,t,i,s){if(void 0===s&&(s=!1),!_)return{};var r,n,a,o,u,c,h,p,v,g,f,m,y=e?[...rb,...t||[]]:[],[b,x]=function(e){for(var t=0;tc.length>t;t++){var[i,s]=tc[t],r=i.exec(e),n=r&&(X(s)?s(r,e):s);if(n)return n}return["",""]}(_),S=null!=(u="u">typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},E={detectGoogleSearchApp:i},k=se(sr({$os:b,$os_version:x,$browser:to(_,navigator.vendor,S,E),$device:th(_),$device_type:(h={userAgentDataPlatform:null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,maxTouchPoints:null==(n=navigator)?void 0:n.maxTouchPoints,screenWidth:null==l||null==(a=l.screen)?void 0:a.width,screenHeight:null==l||null==(o=l.screen)?void 0:o.height,devicePixelRatio:null==l?void 0:l.devicePixelRatio},(m=th(_))===eS||m===ex||"Kobo"===m||"Kindle Fire"===m||m===eX?ew:m===eH||m===eU||m===ez||m===eJ?"Console":m===ek?"Wearable":m?ey:"Android"===(null==h?void 0:h.userAgentDataPlatform)&&(null!=(p=null==h?void 0:h.maxTouchPoints)?p:0)>0?600>Math.min(null!=(v=null==h?void 0:h.screenWidth)?v:0,null!=(g=null==h?void 0:h.screenHeight)?g:0)/(null!=(f=null==h?void 0:h.devicePixelRatio)?f:1)?ey:ew:"Desktop"),$timezone:rR(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:rg(s?tv(null==d?void 0:d.href):null==d?void 0:d.href,y,rx),$host:null==d?void 0:d.host,$pathname:null==d?void 0:d.pathname,$raw_user_agent:_.length>1e3?_.substring(0,997)+"...":_,$browser_version:tu(_,navigator.vendor,S,E),$browser_language:rF(),$browser_language_prefix:"string"==typeof(c=rF())?c.split("-")[0]:void 0,$screen_height:null==l?void 0:l.screen.height,$screen_width:null==l?void 0:l.screen.width,$viewport_height:null==l?void 0:l.innerHeight,$viewport_width:null==l?void 0:l.innerWidth,$lib:w.LIB_NAME,$lib_version:w.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return w.SDK_DIST_CHANNEL&&(k.$sdk_dist_channel=w.SDK_DIST_CHANNEL),k}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes
1);if(this.sessionManager){var{sessionId:v,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(r,i.getTime());o.$session_id=v,o.$window_id=g}this.sessionPropsManager&&se(o,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&se(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null==(n=this.Qi)?void 0:n.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nV&&(o.$lib_custom_api_host=this.config.api_host),c=e!==i5||r?e!==i6||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),o=se(o,c),e===i5&&h&&(o.title=h.title),!ei(a)){var f=i.getTime()-a;o.$duration=parseFloat((f/1e3).toFixed(3))}_&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=se({},p,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),Z(this.config.property_denylist)?i9(this.config.property_denylist,function(e){delete o[e]}):t2.error(n9+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(t2.error(n7),o=m(o,e));var y=this.un();return o.$process_person_profile=y,y&&!r&&this.hn("_calculate_event_properties"),o}ln(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.un()||this.$i&&!i)return e;var s,r=se({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(t2.error(n7),r=n(r,"$set_once")),t&&(this.$i=!0),et(r)?void 0:r}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t;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)}dn(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;return null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var s;null==(s=this.featureFlags)||s.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var s;return void 0===t&&(t=!1),null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.Ni.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:n8}),()=>{})}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:n8})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:n8})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=nX),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:n8}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!=(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:n8})}cn(e){return!e||er(e)?(t2.critical("Unique user id has not been set in posthog.identify"),!1):e===iG?(t2.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())||(t2.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 t2.uninitializedWarning("posthog.identify");if(eo(e)&&(e=e.toString(),t2.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.cn(e)&&this.hn("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(t8)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(t9)&&(this.unregister(t9),this.register({distinct_id:e}));var r,n=(this.persistence.get_property(iN)||iX)===iX;e!==s&&n?(this.persistence.set_property(iN,i0),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.capture(i4,{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.Hi=nB(e,t,i),null==(r=this.featureFlags)||r.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(iC))}}setPersonProperties(e,t){if((e||t)&&this.hn("posthog.setPersonProperties")){var i=nB(this.get_distinct_id(),e,t);this.Hi!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Hi=i):t2.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(Z(e)?e:[e]).filter(e=>es(e)&&e.length>0);0!==i.length&&this.hn("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Hi=null)}group(e,t,i){if(e&&t){var s=this.getGroups(),r=s[e]!==t;if(r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:E({},s,{[e]:t})}),r||i){var n={$group_type:e,$group_key:t};i&&(n.$group_set=i),this.capture(i8,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),r&&!i&&this.reloadFeatureFlags()}else t2.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.hn("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){if(t2.info("reset"),!this.__loaded)return t2.uninitializedWarning("posthog.reset");var t,i,s,r,n,a,o,l,u,c,h,d=this.get_property(t8),p=this.get_property(t7),v=this.get_property(ih);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),ei(v)||null==(h=this.persistence)||h.register({[ih]:v}),null==(s=this.surveys)||s.reset(),null==(r=this.nn)||r.stop(),null==(n=this.featureFlags)||n.reset(),null==(a=this.conversations)||a.reset(),null==(o=this.logs)||o.reset(),null==(l=this.metrics)||l.reset(),null==(u=this.persistence)||u.set_property(iN,iX),null==(c=this.sessionManager)||c.resetSessionId(),this.Hi=null,this.config.cookieless_mode===iZ)this.register_once({distinct_id:iG,$device_id:null},"");else{var g=this.config.get_device_id(sf());this.register_once({distinct_id:g,$device_id:e?g:d},""),e||ei(p)||this.register({[t7]:p})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var t=this;return S(function*(){var e,i,s,r,n;t.__loaded?(null==(e=t.logs)||e.flushLogs("sendBeacon"),null==(i=t.metrics)||i.flush("sendBeacon"),null==(s=t.Gi)||s.unload(),null==(r=t.Qi)||r.unload(),null==(n=t.featureFlags)||n.destroy()):t2.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.vn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.fn()}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{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var r,n=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(t4)?(t2.critical("Attempting to create alias for existing People user - aborting."),-2):this.hn("posthog.alias")?(ei(t)&&(t=this.get_distinct_id()),e!==t?(this.dn(t9,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(t2.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=E({},this.config);if(ee(e)){se(this.config,ar(e));var i,s,r,n,a,o,l,u,c,h,d,p=this.Wi();null==(i=this.persistence)||i.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rL(E({},this.config,{persistence:"sessionStorage"}),p,!1);var v=this.Ui(this.config.debug);eu(v)&&(this.config.debug=v),eu(this.config.debug)&&(this.config.debug?(w.DEBUG=!0,sx.N()&&sx.q("ph_debug",!0),t2.info("set_config",{config:e,oldConfig:t,newConfig:E({},this.config)})):(w.DEBUG=!1,sx.N()&&sx.P("ph_debug"))),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(r=this.exceptions)||r.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.pn(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){w.LIB_NAME=e,w.LIB_VERSION=t}startSessionRecording(e){var t,i,s,r,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==(s=this.sessionRecording)||s.overrideLinkedFlag()),o.url_trigger&&(null==(r=this.sessionRecording)||r.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"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(E({},s,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:aa.gn}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:ae;return t!==ae&&(t=ae+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(iN))===i0||(null==(t=this.sessionPersistence)?void 0:t.get_property(iN))===i0}un(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===i1&&!this._isIdentified()&&et(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[t9])&&(null==(t=this.persistence)||null==(t=t.props)||!t[iU]))}sn(){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.hn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.hn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}hn(e){return"never"===this.config.person_profiles?(t2.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.dn(iU,!0),!0)}Wi(){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)}pn(){var e,t,i,s,r=this.Wi();return(null==(e=this.persistence)?void 0:e.rr)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.rr)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==iZ){if(this.Di()){this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new nD(this),this.pageViewManager=new rl(this),this.persistence&&(this.sessionPropsManager=new nC(this,this.sessionManager,this.persistence));var i,s,r,n,a,o,l,u,c=null!=(a=null==(o=this.config.__extensionClasses)?void 0:o.sessionRecording)?a:null==(l=aa.__defaultExtensionClasses)?void 0:l.sessionRecording;c&&(this.sessionRecording=this.Fi(this.sessionRecording,new c(this)),this.en&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.en)))}this.consent.optInOut(!0),this.pn(),this.tn(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==iQ&&(null==(i=this.surveys)||i.loadIfEnabled()),(ei(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(s=null==e?void 0:e.captureEventName)?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.rn()}else t2.warn(n4)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==iZ?(this.config.cookieless_mode===iQ&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.pn(),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.rn(),this.tn())):t2.warn(n4)}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.pn()}_is_bot(){return c?nN(c,this.config.custom_blocked_useragents):void 0}rn(){h&&("visible"===h.visibilityState?this.qi||(this.qi=!0,this.capture(i5,{title:h.title},{send_instantly:!0}),this.Bi&&(h.removeEventListener(i2,this.Bi),this.Bi=null)):this.Bi||(this.Bi=this.rn.bind(this),sa(h,i2,this.Bi)))}debug(e){!1===e?(null==l||l.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==l||l.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}))}Er(){var e,t,i,s,r=this.zi||{};return"advanced_disable_flags"in r?!!r.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(t2.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in r&&!ea(r[e]),s=t in r&&!ea(r[t]),i?r[e]:!!s&&(t2&&t2.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}it(e){if(ea(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(eh),s=Z(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s){if(ea(r=n(r))){var a="Event '"+e.event+"' was rejected in beforeSend function";return ec(e.event)?t2.warn(a+". This can cause unexpected behavior."):t2.info(a),null}r.properties&&!et(r.properties)||t2.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var o of i)if(r.properties&&ea(r.properties[o]))return t2.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 r}getPageViewId(){var e;return null==(e=this.pageViewManager.Ut)?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)})}Ui(e){var t=eu(e)&&!e,i=sx.N()&&"true"===sx.A("ph_debug");return!t&&(!!i||e)}}aa.__defaultExtensionClasses={},aa.gn={trace:i=()=>{},debug:i,info:i,warn:i,error:i,fatal:i},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=ss(e.prototype[t[i]])}(aa,["identify"]);class ao{constructor(e){this.disabled=!1===e;var t=ee(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 s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<this.thresholdPx&&this.timeoutMs>i-s.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 al="$copy_autocapture",au=t3("[AutoCapture]");function ac(e,t){return t.length>e?t.slice(0,e)+"...":t}var ah=t3("[ExceptionAutocapture]"),ad=()=>{},ap=t3("[TracingHeaders]"),av=t3("[Web Vitals]"),ag="disabled",af="lazy_loading",a_="awaiting_config",am="missing_config";t3("[SessionRecording]"),t3("[SessionRecording]");var ay="[SessionRecording]",ab=t3(ay),aw=t3("[Heatmaps]");function ax(e){return ee(e)&&"clientX"in e&&"clientY"in e&&eo(e.clientX)&&eo(e.clientY)}var aS=t3("[Product Tours]"),aE=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(iu))},ak=["$set_once","$set"],aP=t3("[SiteApps]"),aF="Error while initializing PostHog app with config id ";function aA(e,t,i){if(ea(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 aI{constructor(e){this.mn=new nM,this.yn=(e,t)=>this.bn(e,t)&&this._n(e,t)&&this.wn(e,t)&&this.xn(e,t),this.bn=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.kn=new Set,this.Sn=new Set}init(){var e,t;ei(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(!ei(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
1=>{var t,i;null==(t=this.Sn)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.kn)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s,r=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&r.add(null==e?void 0:e.selector)})}),null==(s=this._instance)||s.autocapture.setElementSelectors(r)}}on(e,t){var i;null!=t&&0!=e.length&&(this.kn.has(e)||this.kn.has(null==t?void 0:t.event))&&this.Sn&&(null==(i=this.Sn)?void 0:i.size)>0&&this.Sn.forEach(e=>{this.Cn(t,e)&&this.mn.emit("actionCaptured",e.name)})}In(e){this.onAction("actionCaptured",t=>e(t))}Cn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.yn(e,i))return!0;return!1}onAction(e,t){return this.mn.on(e,t)}_n(e,t){if(null!=t&&t.url){var i,s=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!s||"string"!=typeof s||!aA(s,t.url,t.url_matching||"contains"))return!1}return!0}wn(e,t){return!!this.Tn(e,t)&&!!this.Mn(e,t)&&!!this.En(e,t)}Tn(e,t){if(null==t||!t.href)return!0;var i=this.Pn(e);if(i.length>0)return i.some(e=>aA(e.href,t.href,t.href_matching||"exact"));var s,r,n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!n&&aA((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}Mn(e,t){if(null==t||!t.text)return!0;var i=this.Pn(e);if(i.length>0)return i.some(e=>aA(e.text,t.text,t.text_matching||"exact")||aA(e.$el_text,t.text,t.text_matching||"exact"));var s,r,n,a,o=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!o&&(r=function(e){for(var t,i=[],s=/(?::|")text="(.*?)"/g;!ea(t=s.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(o),n=t.text,a=t.text_matching||"exact",r.some(e=>aA(e,n,a)))}En(e,t){if(null==t||!t.selector)return!0;var i,s,r=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=r&&r.includes(t.selector))return!0;var n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}Pn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}xn(e,t){return null==t||!t.properties||0===t.properties.length||nU(t.properties.reduce((e,t)=>{var i=Z(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 a${constructor(e){this.Rn=[],this._instance=e,this.On=new Map,this.Ln=new Map,this.Fn=new Map}An(e,t){return!!e&&nU(e.propertyFilters,null==t?void 0:t.properties)}Dn(e,t){var i=new Map;return e.forEach(e=>{var s;null==(s=e.conditions)||null==(s=s[t])||null==(s=s.values)||s.forEach(t=>{if(null!=t&&t.name){var s=i.get(t.name)||[];s.push(e.id),i.set(t.name,s)}})}),i}$n(e,t,i){var s=(i===rD?this.On:this.Ln).get(e),r=[];return this.Nn(e=>{r=e.filter(e=>null==s?void 0:s.includes(e.id))}),r.filter(s=>{var r,n=null==(r=s.conditions)||null==(r=r[i])||null==(r=r.values)?void 0:r.find(t=>t.name===e);return this.An(n,t)})}register(e){var t;ei(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.qn(e),this.Bn(e))}Bn(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.jn&&(this.jn=new aI(this._instance),this.jn.init(),this.jn.In(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,s,r,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)?void 0:s.length)>0&&(null==(r=this.jn)||r.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.Fn.get(t.name);i&&i.push(e.id),this.Fn.set(t.name,i||[e.id])}}))}))}qn(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}),s=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===s.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.On=this.Dn(e,rD),this.Ln=this.Dn(e,rN))}onEvent(e,t){var i,s,r=this.Hn(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(s=t.properties)?void 0:s.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){var a=this.Un(e,n);if("consume"===a)return r.info("event consumed activated item, remov
1ing it",{event:e,itemId:n}),void this.zn([n]);if("persist"===a)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),void this.Vn(n)}if(this.Ln.has(e)){var o=this.$n(e,t,rN);o.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.zn(o.map(e=>e.id)),o.forEach(e=>this.Wn(e.id)))}if(this.On.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.On.get(e)});var l=this.$n(e,t,rD);this.Gn(l.map(e=>e.id))}}onAction(e){this.Fn.has(e)&&this.Gn(this.Fn.get(e)||[])}Gn(e){0!==e.length&&(this.Rn=[...new Set([...this.Rn,...e])],this.Hn().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Vn(e){this.Rn=this.Rn.filter(t=>t!==e);var t=this.Zn();t.includes(e)||this.Qn([...t,e])}zn(e){var t=new Set(e);this.Rn=this.Rn.filter(e=>!t.has(e));var i=this.Zn(),s=i.filter(e=>!t.has(e));s.length!==i.length&&this.Qn(s)}Zn(){var e,t=this.Jn();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.Zn(),...this.Rn])].filter(e=>!this.Kn(e))}reset(){this.Rn=[],this.Zn().length>0&&this.Qn([])}getEventToItemsMap(){return this.On}Yn(){return this.jn}}class aT extends a${constructor(e){super(e)}Jn(){return iR}Xn(){return rj}Nn(e){var t;null==(t=this._instance)||t.getSurveys(e)}Wn(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Hn(){return nK}Qn(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iR]:e})}Kn(){return!1}Un(e,t){var i,s,r,n,a,o;return this.Nn(e=>{o=e.find(e=>e.id===t)}),!o||(a=(null!=(s=null==(r=(i=o).conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)?s:0)>0,"always"===i.schedule||null!=(n=i.conditions)&&null!=(n=n.events)&&n.repeatedActivation&&a)?e===rj?"consume":"ignore":e===rj?"persist":e===rq||e===rB?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var aR="SDK is not enabled or survey functionality is not yet loaded",aO="Disabled. Not loading surveys.",aC=null!=l&&l.location?rf(l.location.hash,"__posthog")||rf(location.hash,"state"):null,aM="_postHogToolbarParams",aL=t3("[Toolbar]"),aD=t3("[FeatureFlags]"),aN=t3("[FeatureFlags]",{debugEnabled:!0}),aj="\" failed. Feature flags didn't load in time.",aq=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},aB=e=>{var t={};for(var[i,s]of st(e||{}))s&&(t[i]=s);return t},aH=t3("[Error tracking]"),az="Refusing to render web experiment since the viewer is a likely bot",aU={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>nq(t,e),not_regex:(e,t)=>!nq(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class aV{get Se(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{aV.es("retrieved web experiments from the server"),t.ts=new Map,e.forEach(e=>{if(e.feature_flag_key){t.ts&&(aV.es("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.ts)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);es(s)&&e.variants[s]&&t.rs(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];aV.ns(n,t._instance)&&t.rs(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())aV.es(az);else if(!this.Se.disable_web_experiments){if(ea(this.ts))return this.ts=new Map,this.loadIfEnabled(),void this.previewWebExperiment();aV.es("applying feature flags",e),e.forEach(e=>{var t;if(this.ts&&null!=(t=this.ts)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.ts)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.rs(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=aV.getWindowLocation();if(null!=e&&e.search){var t=rv(null==e?void 0:e.search,"__experiment_id"),i=rv(null==e?void 0:e.search,"__experiment_variant");t&&i&&(aV.es("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.ss(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Se.disable_web_experiments&&!i)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Se.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}ss(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(aV.es("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.rs(s[0].name,t,s[0].variants[t].transforms))}static ns(e,t){return!ea(e.conditions)&&aV.os(e,t)&&aV.ls(e)}static os(e,t){if(ea(e.conditions)||ea(null==(s=e.conditions)?void 0:s.url))return!0;var i=aV.getWindowLocation();if(i){var s,r,n,a,o=sI(t,i.href);return null==(r=e.conditions)||!r.url||aU[null!=(n=null==(a=e.conditions)?void 0:a.urlMatchType)?n:"icontains"](e.conditions.url,o)}return!1}
1static getWindowLocation(){return null==l?void 0:l.location}static ls(e){if(ea(e.conditions)||ea(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rE();if(t.utm_source){var i,s,r,n,a,o,l,u,c,h=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.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 es(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];t2.info("[WebExperiments] "+e,i)}rs(e,t,i){this._is_bot()?aV.es(az):"control"!==t?i.forEach(i=>{if(i.selector){aV.es("applying transform of variant "+t+" for experiment "+e+" ",i);var s,r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):aV.es("Control variants leave the page unmodified.")}_is_bot(){return c&&this._instance?nN(c,this.Se.custom_blocked_useragents):void 0}}var aG=t3("[Conversations]"),aW="Conversations not available yet.",aY="console",aK={featureFlags:class{constructor(e){this.us=!1,this.hs=!1,this.ds=!1,this.cs=!1,this.vs=!1,this.fs=!1,this.ps=!1,this.gs=!1,this.ys=0,this.bs=()=>{var e=this._s();this.ys=0,e&&this.reloadFeatureFlags()},this._instance=e,this.featureFlagEventHandlers=[],l&&sa(l,"online",this.bs)}destroy(){null==l||l.removeEventListener("online",this.bs)}get Se(){return this._instance.config}get ti(){return this._instance.persistence}ws(e){return this._instance.get_property(e)}xs(){var e,t;return null!=(e=null==(t=this.ti)?void 0:t.nr(this.Se.feature_flag_cache_ttl_ms))&&e}ks(){return!!this.xs()&&(this.gs||this.ds||(this.gs=!0,aD.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ss(){var e,t=null!=(e=this.Se.evaluation_contexts)?e:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.ps||(aD.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ps=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||aD.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}Cs(){return this.Ss().length>0}Is(){var e=this.Se.flag_keys;if(!ei(e)){if(Z(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||aD.error("Invalid flag key found:",e,"Expected non-empty string"),t});aD.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,{config:i}=this._instance,s=null!=(e=null==(t=i.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(s).length){var r,n,a=null!=(r=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)?r:{},o=Object.keys(s).filter(e=>!!s[e]).reduce((e,t)=>(e[t]=s[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 s,r,n=null!=i&&i.merge&&null!=(s=this.ws(ib))?s:{},a=null!=i&&i.merge&&null!=(r=this.ws(iE))?r:{},o=E({},n,e),l=E({},a,t),u={};for(var[c,h]of Object.entries(o))u[c]={key:c,enabled:F(h),variant:A(h),reason:void 0,metadata:ei(null==l?void 0:l[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}};this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.hs}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.ws(iS),t=this.ws(iP),i=this.ws(iF);if(!i&&!t)return e||{};var s=se({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=s[r],l=null==t?void 0:t[r],u=ei(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,c=ei(l)?o.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[r],d=E({},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=E({},null==o?void 0:o.metadata,{payload:h,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),s[r]=d}return this.us||(aD.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.us=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var s=e[i];return{key:i,enabled:F(s),variant:A(s),payload:P(t[i])}})}getFlagVariants(){var e=this.ws(ib),t=this.ws(iP);if(!t)return e||{};for(var i=se({},e),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.us||(aD.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.us=!0),i}getFlagPayloads(){var e=this.ws(iE),t=this.ws(iF);if(!t)return e||{};for(var i=se({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.us||(aD.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.us=!0),i}reloadFeatureFlags(){this.cs||this.Se.advanced_disable_feature_flags||this._s()||this.Ts||(this._instance.Ni.emit("featureFlagsReloading",!0),this.Ts=setTimeout(()=>{this.Ms()},5))}Es(){clearTimeout(this.Ts),this.Ts=void 0}ensureFlagsLoaded(){this.hs||this.ds||this.Ts||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.cs=e}Ms(e){var t;if(this.Es(),!this._instance.Er()&&!this._s())if(this.ds)this.vs=!0;else{var i=this.Se.token,s=this.ws(t8),r={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:E({},(null==(t=this.ti)?void 0:t.get_initial_props())||{},this.ws(iA)||{}),group_properties:this.ws(iI),timezone:rR()};en(s)||ei(s)||(r.$device_id=s),(null!=e&&e.disableFlags||this.Se.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.Cs()&&(r.evaluation_contexts=this.Ss());var n=this.Is();ei(n)||(r.flag_keys=n);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.ds=!0,this._instance._send_request({method:"POST",url:o,data:r,compression:this.Se.disable_compression?void 0:rY,timeout:this.Se.feature_flag_request_timeout_ms,callback:e=>{var t,i,s,n=!0;if(this.Ps(e.statusCode),200===e.statusCode&&(this.vs||(this.$anon_distinct_id=void 0),n=!1),this.ds=!1,!r.disable_flags||this.vs){this.fs=!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==(s=this.ti)||s.register({[iL]:o}),u)?aD.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(r.disable_flags||this.receivedFeatureFlags(null!=(l=e.json)?l:{},n,{partialResponse:a}),this.vs&&(this.vs=!1,this.Ms()))}}})}}_s(){return r_(this.ys,3)}Ps(e){this.ys=rm(e,this.ys,3,()=>aD.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.fs)if(this.hs||this.getFlags()&&this.getFlags().length>0){if(!this.ks()){var s=this.getFeatureFlagResult(e,t);return null!=(i=null==s?void 0:s.variant)?i:null==s?void 0:s.enabled}}else aD.warn('getFeatureFlag for key "'+e+aj)}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.fs)if(this.hs||this.getFlags()&&this.getFlags().length>0){if(!this.ks()){var i=this.getFlagVariants(),s=e in i,r=i[e],n=this.getFlagPayloads()[e],a=String(r),o=this.ws(ik)||void 0,l=this.ws(iD)||void 0,u=this.ws(iC)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var c,h=this._instance.get_session_id(),d=this.ws(iM);h&&h!==d&&(u={},null==(c=this.ti)||c.register({[iC]:u,[iM]:h}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(a))){Z(u[e])?u[e].push(a):u[e]=[a],null==(f=this.ti)||f.register({[iC]:u});var p=this.getFeatureFlagDetails(e),v=[...null!=(_=this.ws(iL))?_:[]];ei(r)&&v.push("flag_missing");var g={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(m=this.Se.bootstrap)||null==(m
1=m.featureFlags)?void 0:m[e])||null,$feature_flag_bootstrapped_payload:(null==(y=this.Se.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])||null,$used_bootstrap_value:!this.fs};ei(null==p||null==(b=p.metadata)?void 0:b.version)||(g.$feature_flag_version=p.metadata.version);var f,_,m,y,b,w,x,S,E,k,F,A=null!=(w=null==p||null==(x=p.reason)?void 0:x.description)?w:null==p||null==(S=p.reason)?void 0:S.code;A&&(g.$feature_flag_reason=A),null!=p&&null!=(E=p.metadata)&&E.id&&(g.$feature_flag_id=p.metadata.id),ei(null==p?void 0:p.original_variant)&&ei(null==p?void 0:p.original_enabled)||(g.$feature_flag_original_response=ei(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(k=p.metadata)&&k.original_payload&&(g.$feature_flag_original_payload=null==p||null==(F=p.metadata)?void 0:F.original_payload),v.length&&(g.$feature_flag_error=v.join(",")),this._instance.capture("$feature_flag_called",g)}if(s)return{key:e,enabled:!!r,variant:"string"==typeof r?r:void 0,payload:P(n)}}}else aD.warn('getFeatureFlagResult for key "'+e+aj)}getRemoteConfigPayload(e,t){var i=this.Se.token,s={distinct_id:this._instance.get_distinct_id(),token:i};this.Cs()&&(s.evaluation_contexts=this.Ss());var r=this.Is();ei(r)||(s.flag_keys=r),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this.Se.disable_compression?void 0:rY,timeout:this.Se.feature_flag_request_timeout_ms,callback(i){var s,r=null==(s=i.json)?void 0:s.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.fs){if(this.hs||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return ei(i)?void 0:!!i}aD.warn('isFeatureEnabled for key "'+e+aj)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){if(this.ti){this.hs=!0;var s=this.getFlagVariants(),r=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,i,s,r,n){void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r={});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&&aD.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(Z(u)){aD.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({[iw]:u,[ib]:p})}else{var g=u,f=c,_=l;if(null!=n&&n.partialResponse)g=E({},i,g),f=E({},s,f),_=E({},r,_);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=E({},i,Object.fromEntries(Object.entries(g).filter(e=>{var[t]=e;return m.has(t)}))),f=E({},s,Object.fromEntries(Object.entries(f||{}).filter(e=>{var[t]=e;return m.has(t)}))),_=E({},r,Object.fromEntries(Object.entries(_||{}).filter(e=>{var[t]=e;return m.has(t)})))}else g=E({},i,g),f=E({},s,f),_=E({},r,_);t&&t.register(E({[iw]:Object.keys(aB(g)),[ib]:g||{},[iE]:f||{},[iS]:_||{}},h?{[ik]:h}:{},d?{[iD]:d}:{}))}}}(e,this.ti,s,r,n,i),t||(this.gs=!1),this.Rs(t)}}override(e,t){void 0===t&&(t=!1),aD.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ti)return aD.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.ti.unregister(iP),this.ti.unregister(iF),this.Rs(),aN.info("All overrides cleared");if(Z(e)){var t,i=aq(e);return this.ti.register({[iP]:i}),this.Rs(),aN.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this.us=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this.ti.unregister(iP),aN.info("Flag overrides cleared");else if(e.flags){if(Z(e.flags)){var s=aq(e.flags);this.ti.register({[iP]:s})}else this.ti.register({[iP]:e.flags});aN.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.ti.unregister(iF),aN.info("Payload overrides cleared")):e.payloads&&(this.ti.register({[iF]:e.payloads}),aN.info("Payload overrides set",{payloads:e.payloads}))),void this.Rs()}if(e&&"object"==typeof e)return this.ti.register({[iP]:e}),this.Rs(),aN.info("Flag overrides set",{flags:e});aD.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.hs){var{flags:t,flagVariants:i}=this.Os();try{e(t,i)}catch(e){aD.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this.ws(ix)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(a.$early_access_feature_name=r.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=E({},this.getFlagVariants(),{[e]:t});null==(s=this.ti)||s.register({[iw]:Object.keys(aB(o)),[ib]:o}),this.Rs()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.ws(ix),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Se.token+r),method:"GET",callback:t=>{var i,s;if(t.json){var r=t.json.earlyAccessFeatures;return null==(i=this.ti)||i.unregister(ix),null==(s=this.ti)||s.register({[ix]:r}),e(r)}}})}Os(){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),{})}}Rs(e){var{flags:t,flagVariants:i}=this.Os();
1this.featureFlagEventHandlers.forEach(s=>{try{s(t,i,{errorsLoading:e})}catch(e){aD.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.ws(iA)||{},s=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),r=null==e?void 0:e.$set_once,n={};if(r)for(var a in r)({}).hasOwnProperty.call(r,a)&&(a in i||(n[a]=r[a]));this._instance.register({[iA]:E({},i,n,s)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=E({},this.ws(iA)||{});e.forEach(e=>{delete i[e]}),this._instance.register({[iA]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(iA),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.ws(iI)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=E({},i[t],e[t]),delete e[t]}),this._instance.register({[iI]:E({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.ws(iI)||{};this._instance.register({[iI]:E({},t,{[e]:{}})})}else this._instance.unregister(iI)}reset(){this.hs=!1,this.ds=!1,this.cs=!1,this.vs=!1,this.fs=!1,this.$anon_distinct_id=void 0,this.Es(),this.us=!1,this.ys=0}}},aJ=E({productTours:class{get ti(){return this._instance.persistence}constructor(e){this.zo=null,this.Vo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if("productTours"in e){var t,i;if(this.ti&&this.ti.register({[iu]:!!e.productTours}),!aE(this._instance))return!this.zo&&ea(null==(t=this.ti)?void 0:t.props[iO])||aS.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&&aE(this._instance)&&this.Bt(()=>this.Wo())}Bt(e){var t,i;null!=(t=m.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=m.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?aS.error("Could not load product tours script",t):e()})}Wo(){var e;!this.zo&&null!=(e=m.__PosthogExtensions__)&&e.generateProductTours&&(this.zo=m.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!Z(this.Vo)||t){var i=this.ti;if(i){var s=i.props[iO];if(Z(s)&&!t)return this.Vo=s,void e(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{if(aE(this._instance)){var s=t.statusCode;if(200!==s||!t.json){var r="Product Tours API could not be loaded, status: "+s;return aS.error(r),void e([],{isLoaded:!1,error:r})}var n=Z(t.json.product_tours)?t.json.product_tours:[];this.Vo=n,i&&i.register({[iO]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Vo,{isLoaded:!0})}getActiveProductTours(e){ea(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.Bt(()=>{var t;this.Wo(),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.Vo=null,null==(e=this.ti)||e.unregister(iO)}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)}}},aK),aQ=E({surveys:class{get Se(){return this._instance.config}constructor(e){this.ua=void 0,this._surveyManager=null,this.ha=!1,this.da=[],this.ca=null,this.va=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Se.disable_surveys){var t=e.surveys;if(ea(t))return nK.warn("Flags not loaded yet. Not loading surveys.");var i=Z(t);this.ua=i?t.length>0:t,nK.info("flags response received, isSurveysEnabled: "+this.ua),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 s=localStorage.key(i);(null!=s&&s.startsWith(nJ)||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}
1t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.ha)nK.info("Already initializing surveys, skipping...");else if(this.Se.disable_surveys)nK.info(aO);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())nK.info("Not loading surveys in cookieless mode without consent.");else{var e=null==m?void 0:m.__PosthogExtensions__;if(e){if(!ei(this.ua)||this.Se.advanced_enable_surveys){var t=this.ua||this.Se.advanced_enable_surveys;this.ha=!0;try{var i=e.generateSurveys;if(i)return void this.fa(i,t);var s=e.loadExternalDependency;if(!s)return void this.pa(iJ);s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.pa("Could not load surveys script",i):this.fa(e.generateSurveys,t)})}catch(e){throw this.pa("Error initializing surveys",e),e}finally{this.ha=!1}}}else nK.error("PostHog Extensions not found.")}}fa(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new aT(this._instance),nK.info("Surveys loaded successfully"),this.ga({isLoaded:!0})}pa(e,t){nK.error(e,t),this.ga({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.da.push(e),this._surveyManager&&this.ga({isLoaded:!0}),()=>{this.da=this.da.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Se.disable_surveys)return nK.info(aO),e([]);var i,s=this._instance.get_property(i$);s&&!t?(e(s,{isLoaded:!0}),this.ma()&&this.getSurveys(()=>{},!0)):"u">typeof Promise&&this.ca?this.ca.then(t=>{var{surveys:i,context:s}=t;return e(i,s)}):("u">typeof Promise&&(this.ca=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Se.token),method:"GET",timeout:this.Se.surveys_request_timeout_ms,callback:t=>{this.ca=null;var s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;nK.error(r),this.va=Date.now();var n={isLoaded:!1,error:r};return e([],n),void(null==i||i({surveys:[],context:n}))}this.va=null;var a,o,l=t.json.surveys||[],u=l.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});u.length>0&&(null==(o=this._surveyEventReceiver)||o.register(u)),null==(a=this._instance.persistence)||a.register({[i$]:l,[iT]:Date.now()});var c={isLoaded:!0};e(l,c),null==i||i({surveys:l,context:c})}}))}ma(){return this.ya()&&!this.ca&&!this.ba()}ya(){var e=this._instance.get_property(iT);return eo(e)&&Date.now()-e>3e5}ba(){return eo(this.va)&&3e5>Date.now()-this.va}markSurveyAsSeen(e,t){var i;nQ({id:e,current_iteration:null!=(i=null==t?void 0:t.iteration)?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}ga(e){for(var t of this.da)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){nK.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!ea(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);nK.warn("init was not called")}_a(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}wa(e){if(ea(this._surveyManager))return{eligible:!1,reason:aR};var t="string"==typeof e?this._a(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ea(this._surveyManager))return nK.warn("init was not called"),{visible:!1,disabledReason:aR};var t=this.wa(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ea(this._surveyManager)?(nK.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:aR})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this.wa(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(ea(this._surveyManager))nK.warn("init was not called");else{var r="string"==typeof e?this._a(e):e;if(null!=r&&r.id)if(nZ.includes(r.type)){var n=null==h?void 0:h.querySelector(t);if(n)return null!=(s=r.appearance)&&s.surveyPopupDelaySeconds?(nK.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;nK.info("Rendering survey "+r.id+" with delay of "+(null==(e=r.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(r,n,i),nK.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n,i);nK.warn("Survey element not found")}else nK.warn("Surveys of type "+r.type+" cannot be rendered in the app");else nK.warn("Survey not found")}}displaySurvey(e,t){var i;if(ea(this._surveyManager))nK.warn("init was not called");else{var s=this._a(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=E({},s,{appearance:E({},s.appearance,{surveyPopupDelaySeconds:0})}
1)),t.displayType!==rH&&t.initialResponses&&nK.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.canRenderSurvey(s);if(!n.visible)return void nK.warn("Survey is not eligible to be displayed: ",n.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else nK.warn("Survey not found")}}cancelPendingSurvey(e){ea(this._surveyManager)?nK.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}},aK),aZ=E({experiments:aV},aK),aX=E({},aK,{sessionRecording:class{get Se(){return this._instance.config}get ti(){return this._instance.persistence}get started(){var e;return!(null==(e=this.Ls)||!e.isStarted)}get status(){var e,t;return this.Fs===a_||this.Fs===am?this.Fs:null!=(e=null==(t=this.Ls)?void 0:t.status)?e:this.Fs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Fs=ag,this.As=void 0,this._instance=e,!this._instance.sessionManager)throw ab.error("started without valid sessionManager"),Error(ay+" started without valid sessionManager. This is a bug.");if(this.Se.cookieless_mode===iZ)throw Error(ay+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ds(){var e,t=!(null==(e=this._instance.get_property(ih))||!e.enabled),i=!this.Se.disable_session_recording,s=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return l&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!this.Ds||null==(t=this.Ls)||!t.isStarted){var i=!ei(Object.assign)&&!ei(Array.from);this.Ds&&i?(this.$s(e),ab.info("starting")):(this.Fs=ag,this.stopRecording())}}$s(e){var t,i,s;this.Ds&&(this.Fs!==a_&&this.Fs!==am&&(this.Fs=af),null!=m&&null!=(t=m.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=m.__PosthogExtensions__)&&i.initSessionRecording?this.Ns(e):null==(s=m.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.qs,t=>{if(t)return ab.error("could not load recorder",t);this.Ns(e)}))}stopRecording(){var e,t;null==(e=this.As)||e.call(this),this.As=void 0,null==(t=this.Ls)||t.stop()}Bs(){var e,t;null==(e=this.As)||e.call(this),this.As=void 0,null==(t=this.Ls)||t.discard()}js(){var e,t;null==(e=this.ti)||e.unregister(iy),null==(t=this.ti)||t.unregister(id)}Hs(e,t){if(ea(e))return null;var i=eo(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}Us(e){if(this.ti){var t,i,s=this.ti,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Hs(null==(t=this.Se.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.Hs(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=r?r:n;ea(a)&&this.js();var o=null==i?void 0:i.minimumDurationMilliseconds;s.register({[ih]:E({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:E({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:ei(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})})};r(),null==(t=this.As)||t.call(this),this.As=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.Us(e),void this.Bs()):(this.Us(e),void this.startIfEnabledOrStop()):(this.Fs===a_&&(this.Fs=am,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.Ls)&&i.log?this.Ls.log(e,t):ab.warn("log called before recorder was ready")}get qs(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(ih);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}zs(){var e,t,i=this._instance.get_property(ih);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 invali
1d and will be ignored",e),!1}var s=null!=(e=t.cache_timestamp)?e:Date.now();return 36e5>=Date.now()-s}Ns(e){var t,i;if(null==(t=m.__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({[iK]:!0});if(this.Ls||(this.Ls=null==(i=m.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.Ls._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.zs()){if(this.Fs===am||this.Fs===a_)return;return this.Fs=a_,ab.info("persisted remote config is stale, requesting fresh config before starting"),void new rG(this._instance).load()}this.Fs=af,this.Ls.start(e)}onRRwebEmit(e){var t;null==(t=this.Ls)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Ls||null==(t=this.ti)||t.register({[iv]:!0}),null==(e=this.Ls)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Ls||null==(t=this.ti)||t.register({[ip]:!0}),null==(e=this.Ls)||e.overrideSampling()}overrideTrigger(e){var t,i;this.Ls||null==(i=this.ti)||i.register({["url"===e?ig:i_]:!0}),null==(t=this.Ls)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Ls)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Ls)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.Vs=!1,this.Ws=null,this.Gs=!1,this.instance=e,this.rageclicks=new ao(e.config.rageclick),this.Zs=null}initialize(){this.startIfEnabled()}get Se(){var e,t,i=ee(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}Qs(){if(this.isBrowserSupported()){if(l&&h){var e=e=>{e=e||(null==l?void 0:l.event);try{this.Js(e)}catch(e){au.error("Failed to capture event",e)}};if(sa(h,"submit",e,{capture:!0}),sa(h,"change",e,{capture:!0}),sa(h,"click",e,{capture:!0}),this.Se.capture_copied_text){var t=e=>{e=e||(null==l?void 0:l.event);try{this.Js(e,al)}catch(e){au.error("Failed to capture copy/cut event",e)}};sa(h,"copy",t,{capture:!0}),sa(h,"cut",t,{capture:!0})}}}else au.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Vs&&(this.Qs(),this.Vs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Gs=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[it]:!!e.autocapture_opt_out}),this.Ws=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Zs=e}getElementSelectors(e){var t,i=[];return null==(t=this.Zs)||t.forEach(t=>{var s=null==h?void 0:h.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[it];if(en(this.Ws)&&!eu(i)&&!this.instance.Er())return!1;var s=null!=(t=this.Ws)?t:!!i;return!!this.instance.config.autocapture&&!s}Js(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,s=sq(e);sO(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())&&sJ(s,this.instance.config.rageclick)&&this.Js(e,"$rageclick");var r=t===al;if(s&&function(e,t,i,s,r,n){if(void 0===i&&(i=void 0),!l||sQ(e)||null!=(a=i)&&a.url_allowlist&&!sL(i.url_allowlist,n)||null!=(o=i)&&o.url_ignorelist&&sL(i.url_ignorelist,n))return!1;if(null!=(u=i)&&u.dom_event_allowlist){var a,o,u,c,h,d,p=i.dom_event_allowlist;if(p&&!p.some(e=>t.type===e))return!1}var{parentIsUsefulElement:v,targetElementList:g}=sZ(e,s);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(ei(i))return!0;var s,r=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(g,i)||!sH(g,null==(c=i)?void 0:c.css_selector_allowlist)||sH(g,null!=(h=null==(d=i)?void 0:d.css_selector_ignorelist)?h:sU))return!1;try{var f=l.getComputedStyle(e);
1if(f&&"pointer"===f.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var _=e.tagName.toLowerCase();switch(_){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return v?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(sB.indexOf(_)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.Se,r,r?["copy","cut"]:void 0,this.instance)){var{props:n,explicitNoCapture:a}=function(e,t){var i,s,{e:r,maskAllElementAttributes:n,maskAllText:a,elementAttributeIgnoreList:o,elementsChainAsString:u,disableCaptureUrlHashes:c}=t;if(!sT(e))return{props:{}};for(var h=[e],d=e;d.parentNode&&!sR(d,"body");)if(sC(d.parentNode))h.push(d.parentNode.host),d=d.parentNode.host;else{if(!sT(d.parentNode))break;h.push(d.parentNode),d=d.parentNode}var p,v=[],g={},f=!1,_=!1;if(i9(h,e=>{var t=sX(e);if(sR(e,"a")){var i=e.getAttribute("href");f=!!(t&&i&&s8(i))&&(c?tv(i):i)}G(sD(e),"ph-no-capture")&&(_=!0),v.push(function(e,t,i,s,r){void 0===r&&(r=!1);var n=e.tagName.toLowerCase(),a={tag_name:n};sB.indexOf(n)>-1&&!i&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?ac(1024,s7(e)):ac(1024,sj(e)));var o=sD(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),i9(e.attributes,function(i){var n;if((!s0(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&s8(i.value)&&(!es(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=sM(o).join(" ")),a["attr__"+i.name]=ac(1024,"href"===i.name&&r?tv(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&&!sT(t))return t}(c);)l++,c.tagName===e.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(e,n,a,o,c)),se(g,function(e){if(!sX(e))return{};var t={};return i9(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),s=e.value;i&&s&&s8(s)&&(t[i]=s)}}),t}(e))}),_)return{props:{},explicitNoCapture:_};if(a||(v[0].$el_text=sR(e,"a")||sR(e,"button")?s7(e):sj(e)),f){v[0].attr__href=f;var m,y,b=null==(m=rp(f))?void 0:m.host,w=null==l||null==(y=l.location)?void 0:y.host;b&&w&&b!==w&&(p=f)}return{props:se({$event_type:r.type,$ce_version:1},u?{}:{$elements:v},{$elements_chain:v.map(e=>{var t,i,s,r={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(s=e.attr__href)?void 0:s.slice(0,2048),attr_class:(t=e.attr__class)?Z(t)?t:sM(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return st(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return r.attributes[t]=i}),r}).map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=E({},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 st(n).sort((e,t)=>{var[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{var[t,i]=e;return a[s9(t.toString())]=s9(i.toString())}),(s+=":")+st(a).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(i=v[0])&&i.$el_text?{$el_text:null==(s=v[0])?void 0:s.$el_text}:{},p&&"click"===r.type?{$external_click_url:p}:{},g)}}(s,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.Gs,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes});if(a)return!1;var o=this.getElementSelectors(s);if(o&&o.length>0&&(n.$element_selectors=o),t===al){var u,c=sN(null==l||null==(u=l.getSelection())?void 0:u.toString()),h=e.type||"clipboard";if(!c)return!1;n.$selected_content=c,n.$copy_type=h}return this.instance.capture(t,n),!0}}}isBrowserSupported(){return X(null==h?void 0:h.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ks=(null==l||null==(t=l.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(t2.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ys&&this.Ys(),this.Ys=void 0,t2.info("History API monitoring stopped")}monitorHistoryChanges(){l&&l.history&&(this.Xs("pushState"),this.Xs("replaceState"),this.eo())}Xs(e){var t;if(l&&(null==(t=l.history[e])||!t.__posthog_wrapped__)){var i=this;!function(e,t,i){try{if(!(t in e))return ad;var s={next:e[t]},r=i(function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];return s.next.apply(this,t)});X(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),e[t]=r}catch(e){return ad}}(l.history,e,t=>
1function(s,r,n){t.call(this,s,r,n),i.ro(e)})}}ro(e){try{var t,i=null==l||null==(t=l.location)?void 0:t.pathname;if(!i)return;i!==this.Ks&&this.isEnabled&&this._instance.capture(i5,{navigation_type:e}),this.Ks=i}catch(t){t2.error("Error capturing "+e+" pageview",t)}}eo(){if(!this.Ys){var e=()=>{this.ro("popstate")};sa(l,"popstate",e),this.Ys=()=>{l&&l.removeEventListener("popstate",e)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(e){var t;this.io=!1,this.Vs=!1,this.no=null,this.instance=e,this.io=!(null==(t=this.instance.persistence)||!t.props[ii]),this.rageclicks=new ao(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return ee(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(e=this.Se.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ea(this.Se.capture_heatmaps)?ea(this.Se.enable_heatmaps)?this.io:this.Se.enable_heatmaps:!1!==this.Se.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.Vs||(aw.info("starting..."),this.so(),this.ke());else{var e;clearInterval(null!=(e=this.no)?e:void 0),this.oo(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ii]:t}),this.io=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}ao(e){this.fe(e.originalEvent,"deadclick")}ke(){this.no&&clearInterval(this.no),this.no="visible"===(null==h?void 0:h.visibilityState)?setInterval(this.zr.bind(this),this.flushIntervalMilliseconds):null}so(){l&&h&&(this.lo=this.zr.bind(this),sa(l,i3,this.lo),this.uo=e=>this.fe(e||(null==l?void 0:l.event)),sa(h,"click",this.uo,{capture:!0}),this.ho=e=>this.do(e||(null==l?void 0:l.event)),sa(h,"mousemove",this.ho,{capture:!0}),this.co=new rs(this.instance,rt,this.ao.bind(this)),this.co.startIfEnabledOrStop(),this.vo=this.ke.bind(this),sa(h,i2,this.vo),this.Vs=!0)}oo(){var e;l&&h&&(this.lo&&l.removeEventListener(i3,this.lo),this.uo&&h.removeEventListener("click",this.uo,{capture:!0}),this.ho&&h.removeEventListener("mousemove",this.ho,{capture:!0}),this.vo&&h.removeEventListener(i2,this.vo),clearTimeout(this.fo),null==(e=this.co)||e.stop(),this.Vs=!1)}po(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),n=function(e,t,i){for(var s=e;s&&sT(s)&&!sR(s,"body")&&s!==i;){var r,n,a,o=void 0;try{o=null==(r=null!=(n=null==(a=s.ownerDocument)?void 0:a.defaultView)?n:l)?void 0:r.getComputedStyle(s).position}catch(e){break}if(G(t,o))return!0;s=sz(s)}return!1}(sq(e),["fixed","sticky"],r);return{x:e.clientX+(n?0:s),y:e.clientY+(n?0:i),target_fixed:n,type:t}}fe(e,t){var i;if(void 0===t&&(t="click"),!s$(e.target)&&ax(e)){var s=this.po(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&sJ(sq(e),this.instance.config.rageclick)&&this.kt(E({},s,{type:"rageclick"})),this.kt(s)}}do(e){!s$(e.target)&&ax(e)&&(clearTimeout(this.fo),this.fo=setTimeout(()=>{this.kt(this.po(e,"mousemove"))},500))}kt(e){if(l){var t=this.Se.disable_capture_url_hashes?tv(l.location.href):l.location.href,i=this.Se.custom_personal_data_properties,s=rg(t,this.Se.mask_personal_data_properties?[...rb,...i||[]]:[],rx);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(e)}}zr(){this.R&&!et(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:rs,webVitalsAutocapture:class{constructor(e){var t;this.io=!1,this.Vs=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.mo=()=>{clearTimeout(this.yo),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((e,t)=>E({},e,{["$web_vitals_"+t.name+"_event"]:E({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.bo=e=>{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t,i=this._o();if(!ei(i))if(ea(null==e?void 0:e.name)||ea(null==e?void 0:e.value))av.error("Invalid metric received",e);else if(!this.wo||this.wo>e.value){this.R.url!==i&&(this.mo(),this.yo=setTimeout(this.mo,this.flushToCaptureTimeoutMs)),ei(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=ei(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var s=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),r=E({},e,{$current_url:i,timestamp:Date.now()});ei(s)||(r.$session_id=s.sessionId,r.$window_id=s.windowId),this.R.metrics.push(r),this.R.metrics.length===this.allowedMetrics.length&&this.mo()}else av.error("Ignoring metric with value >= "+this.wo,e)},this.xo=()=>
1{if(!this.Vs){var e,t,i,s,r=m.__PosthogExtensions__;ei(r)||ei(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.bo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.bo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.bo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.bo.bind(this)),this.Vs=!0):av.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.io=!(null==(t=this._instance.persistence)||!t.props[io]),this.startIfEnabled()}get ko(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=ee(this.ko)?null==(e=this.ko)?void 0:e.web_vitals_allowed_metrics:void 0;return ea(i)?(null==(t=this._instance.persistence)?void 0:t.props[ic])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(ee(this.ko)?this.ko.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=ee(this.ko)?this.ko.web_vitals_attribution:void 0;return null!=e&&e}get wo(){var e=ee(this.ko)&&eo(this.ko.__web_vitals_max_value)?this.ko.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==d?void 0:d.protocol;if("http:"!==e&&"https:"!==e)return av.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=ee(this.ko)?this.ko.web_vitals:eu(this.ko)?this.ko:void 0;return eu(t)?t:this.io}startIfEnabled(){this.isEnabled&&!this.Vs&&(av.info("enabled, starting..."),this.Bt(this.xo))}onRemoteConfig(e){if("capturePerformance"in e){var t=ee(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=ee(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[io]:t}),this._instance.persistence.register({[ic]:i})),this.io=t,this.startIfEnabled()}}Bt(e){var t,i;null!=(t=m.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(i=m.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?av.error("failed to load script",t):e()})}_o(){var e=l?this._instance.config.disable_capture_url_hashes?tv(l.location.href):l.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return rg(e,this._instance.config.mask_personal_data_properties?[...rb,...t||[]]:[],rx)}av.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t,i,s;this.xo=()=>{var e;if(l&&this.isEnabled&&null!=(e=m.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=m.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=m.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=m.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.So&&this.Se.capture_unhandled_errors&&(this.So=t(this.captureException.bind(this))),!this.Co&&this.Se.capture_unhandled_rejections&&(this.Co=i(this.captureException.bind(this))),!this.Io&&this.Se.capture_console_errors&&(this.Io=s(this.captureException.bind(this)))}catch(e){ah.error("failed to start",e),this.To()}}},this._instance=e,this.Mo=!(null==(t=this._instance.persistence)||!t.props[is]),this.Eo=new em({refillRate:null!=(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?i:1,bucketSize:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?s:10,refillInterval:1e4,Ae:ah}),this.Se=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 ee(e)?t=E({},t,e):(ei(e)?this.Mo:e)&&(t=E({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ah.info("enabled"),this.To(),this.Bt(this.xo)):this.To()}Bt(e){var t,i;null!=(t=m.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=m.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return ah.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.Io)||i.call(this),this.Io=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.Mo=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[is]:this.Mo}),this.Se=this.Po(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this.Po()}captureException(e){var t,i,s,r=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.Eo.consumeRateLimit(r)?ah.info("Skipping exception capture because of client rate limiting.",{exception:r}):null==(s=this._instance.exceptions)||s.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,i;this.Ro=[],this.Oo=new tF([new tN,new tY,new tq,new tj,new tG,new tV,new tH,new tW],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];return function(t,s){void 0===s&&(s=0);for(var r=[],n=t.split("\n"),a=s;n.length>a;a++){var o=n[a];if(1024>=o.length){var l=tD.test(o)?o.replace(tD,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var c=u(l,e);if(c){r.push(c);break}}if(r.length>=50)break}}}if(!r.length)return[];var h=Array.from(r);return h.reverse(),h.slice(0,50).map(e=>E({},e,{filename:e.filename||(h[h.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",tO,tL)),this._instance=e,this.Ro=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(ir))?t:[],this.Lo=tX(this.Fo()),this.Ao=new t0(this.Lo)}onConfigChange(){this.Lo=tX(this.Fo()),this.Ao.setConfig(this.Lo)}onRemoteConfig(e){var t,i,s;if("errorTracking"in e){var r=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(s=e.errorTracking)?void 0:s.captureExtensionExceptions;this.Ro=r,this._instance.persistence&&this._instance.persistence.register({[ir]:this.Ro,[ia]:n}
1)}}get Do(){var e,t=!!this._instance.get_property(ia),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.Oo.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.Lo.enabled)try{if(!es(e)||0===e.trim().length)return void aH.warn("Ignoring exception step because message must be a non-empty string");var i=this.$o(t),{sanitizedProperties:s,droppedKeys:r}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,s)=>(tQ.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(i);r.length>0&&aH.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.Ao.add(E({[tK]:e,[tJ]:(new Date).toISOString()},s))}catch(e){aH.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.No(t)){if(this.qo(t))return this.Bo("Exception dropped: matched a suppression rule"),void aH.info("Skipping exception capture because a suppression rule matched");if(!this.Do&&this.jo(t))return this.Bo("Exception dropped: thrown by a browser extension"),void aH.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Ho(t))return this.Bo("Exception dropped: thrown by the PostHog SDK"),void aH.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.Lo.enabled&&ea(e.$exception_steps)?this.Uo(e):e;try{var s=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",an:!0});return s&&this.Ao.clear(),s}catch(e){return aH.error("Failed to capture exception event. Dropping this exception.",e),void this.Ao.clear()}}catch(e){return void aH.error("Failed to process exception event. Ignoring this exception.",e)}}Uo(e){try{var t=this.Ao.getAttachable();return 0===t.length?e:E({},e,{$exception_steps:t})}catch(t){return aH.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Bo(e){this.Lo.enabled&&this.Ao.add({[tK]:e,[tJ]:(new Date).toISOString()})}$o(e){return ee(e)?E({},e):{}}Fo(){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;var t=e.reduce((e,t)=>{var{type:i,value:s}=t;return es(i)&&i.length>0&&e.$exception_types.push(i),es(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.Ro.some(e=>{var i=e.values.map(e=>{var i,s=nH[e.operator],r=Z(e.value)?e.value:[e.value],n=null!=(i=t[e.key])?i:[];return r.length>0&&s(r,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}jo(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,s,r,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],a=n[n.length-1];return null!=(s=null==a||null==(r=a.filename)?void 0:r.includes("posthog.com/static"))&&s}return!1}No(e){return!ea(e)&&Z(e)}}},aJ,{siteApps:class{constructor(e){this.Go=0,this._instance=e,this.Zo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qo(e,t){if(t){var i=this.globalsForEvent(t);this.Zo.push(i),this.Zo.length>1e3&&(this.Zo=this.Zo.slice(10))}}get siteAppLoaders(){var e;return null==(e=m._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.Zo=[],this.Jo=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,a,o,l={},u=this._instance.get_property("$groups")||[];for(var[c,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[c]={id:u[c],type:c,properties:h};var{$set_once:d,$set:p}=e;return{event:E({},k(e,ak),{properties:E({},e.properties,p?{$set:E({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:E({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},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)||(aP.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)||(aP.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,s,r,n,a,o,l=null==h?void 0:h.defaultView,u=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!u)return()=>{};if(this.Go++,this.Xo)return this.ea();var c=[],d=this,p=new WeakSet,v=(e,t,i)=>{if(null!=e&&e[t]){var s=e[t];e[t]=i(s),c.push(()=>{e[t]=s})}},g=e=>{if(p.has(e))return e;var t=d.Ko(e);return t&&p.add(t),t},f=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!en(e));return v(u,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),v(u,"insertBefore",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):t}),v(u,"replaceChild",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):i}),[null==(t=l.Element)?void 0:t.prototype,null==(i=l.Document)?void 0:i.prototype,null==(s=l.DocumentFragment)?void 0:s.prototype].forEach(e
1=>{v(e,"append",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),v(e,"prepend",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))})}),[null==(r=l.Element)?void 0:r.prototype,null==(n=l.CharacterData)?void 0:n.prototype,null==(a=l.DocumentType)?void 0:a.prototype].forEach(e=>{v(e,"before",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),v(e,"after",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,f(i))}),v(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];var r=f(i);return i.length&&!r.length?void 0:e.apply(this,r)})}),v(null==(o=l.Element)?void 0:o.prototype,"insertAdjacentElement",e=>function(t,i){var s=g(i);return s?e.call(this,t,s):null}),this.Xo=()=>{c.forEach(e=>e()),this.Xo=void 0},this.ea()}ea(){var e=!1;return()=>{var t;e||(e=!0,this.Go--,0===this.Go&&(null==(t=this.Xo)||t.call(this)))}}ta(e,t){void 0===t&&(t=!0);var i=this.Yo();try{var s=e(i);return t&&i(),s}catch(e){throw i(),e}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.Zo.length&&(aP.info("Processing "+this.Zo.length+" events for site app with id "+e.id),this.Zo.forEach(e=>this.ta(()=>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))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,aP.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var{processEvent:n}=this.ta(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1);n&&(t.processEvent=n),s=!0}catch(t){aP.error(aF+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){aP.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}ra(){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)}ia(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.ta(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){aP.error("Error while processing event "+e.event+" for site app "+s.id,t)}};for(var r of Object.values(this.apps))s(r)}}onRemoteConfig(e){var t,i,s,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.ra(),void this._instance.on("eventCaptured",e=>this.ia(e))):void aP.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Jo)||i.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled){var n=function(e){var t;m["__$$ph_site_app_"+e]=r._instance,null==(t=m.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(r._instance,o,t=>{if(t)return aP.error(aF+e,t)})};for(var{id:a,url:o}of e.siteApps)n(a)}else aP.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},aQ,{tracingHeaders:class{constructor(e){this.na=void 0,this.sa=void 0,this.oa=void 0,this.xo=()=>{var e,t,i=this.aa();i?(ei(this.na)&&(this.na=null==(e=m.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),ei(this.sa)&&(this.sa=null==(t=m.__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()}Bt(e){var t,i;null!=(t=m.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=m.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return ap.error("failed to load script",t);e()})}la(){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}aa(){var e=this.la();return Z(e)?(Z(this.oa)?this.oa.splice(0,this.oa.length,...e):this.oa=[...e],e.length>0?this.oa:void 0):(Z(this.oa)&&this.oa.splice(0),this.oa=e||void 0,this.oa)}To(){var e,t;null==(e=this.na)||e.call(this),null==(t=this.sa)||t.call(this),this.na=void 0,this.sa=void 0}startIfEnabledOrStop(){this.aa()?this.Bt(this.xo):this.To()}}},{toolbar:class{constructor(e){this.instance=e}xa(e){m.ph_toolbar_state=e}ka(){var e;return null!=(e=m.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),so(this.instance.config)||!l||!h)return!1;e=null!=e?e:l.location,i=null!=i?i:l.history;try{if(!t){try{l.localStorage.setItem("test","test"),l.localStorage.removeItem("test")}catch(e){return!1}t=null==l?void 0:l.localStorage}var s,r=aC||rf(e.hash,"__posthog")||rf(e.hash,"state"),n=r?si(()=>JSON.parse(atob(decodeURIComponent(r))))||si(()=>JSON.parse(decodeURIComponent(r))):null;return n&&"ph_authorize"===n.action?((s=n).source="url",s&&Object.keys(s).length>0&&(n.desiredHash?e.hash=n.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(aM)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}Sa(e){var t=m.ph_load_toolbar||m.ph_load_editor;!ea(t)&&X(t)?t(e,this.instance):aL.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==h||!h.getElementById(iV));if(!l||i)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=E({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(l.localStorage.setItem(aM,JSON.stringify(E({},r,{source:void 0}))),2===this.ka())?this.Sa(r):0===this.ka()&&(this.xa(1),null==(t=m.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(aL.error("[Toolbar] Failed to load",e),this.xa(0)):(this.xa(2),this.Sa(r))}),sa(l,"turbolinks:load",()=>{this.xa(0),this.loadToolbar(r)})),!0}Ca(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)}}}
1,aZ,{conversations:class{constructor(e){this.Ia=void 0,this._conversationsManager=null,this.Ta=!1,this.Ma=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;ea(t)||(eu(t)?this.Ia=t:(this.Ia=t.enabled,this.Ma=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Ia=void 0,this.Ma=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ta||this._instance.config.disable_conversations||so(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==m?void 0:m.__PosthogExtensions__;if(e&&!ei(this.Ia)&&this.Ia)if(this.Ma&&this.Ma.token){this.Ta=!0;try{var t=e.initConversations;if(t)return this.Ea(t),void(this.Ta=!1);var i=e.loadExternalDependency;if(!i)return void this.Pa(iJ);i(this._instance,"conversations",t=>{t||!e.initConversations?this.Pa("Could not load conversations script",t):this.Ea(e.initConversations),this.Ta=!1})}catch(e){this.Pa("Error initializing conversations",e),this.Ta=!1}}else aG.error("Conversations enabled but missing token in remote config.")}}Ea(e){if(this.Ma)try{this._conversationsManager=e(this.Ma,this._instance),aG.info("Conversations loaded successfully")}catch(e){this.Pa("Error completing conversations initialization",e)}else aG.error("Cannot complete initialization: remote config is null")}Pa(e,t){aG.error(e,t),this._conversationsManager=null,this.Ta=!1}show(){this._conversationsManager?this._conversationsManager.show():aG.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ia&&!en(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var s=this;return S(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(aG.warn(aW),null)})()}getMessages(e,t){var i=this;return S(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(aG.warn(aW),null)})()}markAsRead(e){var t=this;return S(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(aG.warn(aW),null)})()}getTickets(e){var t=this;return S(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(aG.warn(aW),null)})()}requestRestoreLink(e){var t=this;return S(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(aG.warn(aW),null)})()}restoreFromToken(e){var t=this;return S(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(aG.warn(aW),null)})()}restoreFromUrlToken(){var e=this;return S(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(aG.warn(aW),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}vn(){var e;null==(e=this._conversationsManager)||e.setIdentity()}fn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.Ra=!1,this.Oa=!1,this.Ae=t3("[logs]"),this.Or=[],this.La=[],this.ys=0,this.Fa=()=>{var e,t;this.ys=0,null==(e=this.Aa)||e.onReconnect(),null==(t=this.Da)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.Ra=!0),l&&sa(l,"online",this.Fa)}$a(e,t,i,s){var r,n,a,o,l,u,c,h,d,p,v,g,f,_,m=(r=null==(_=this._instance)||null==(_=_.config)?void 0:_.logs,d=null!=(n=null==r?void 0:r.flushIntervalMs)?n:3e3,p=null!=(a=null==r?void 0:r.maxBufferSize)?a:100,g=ei(v=null!=i&&i.consoleCapture?void 0:null!=(o=null==r?void 0:r.maxLogsPerInterval)?o:1e3)?Math.max(p,2048):Math.max(p,v),{serviceName:null!=(l=null!=(u=null==(f=null==r?void 0:r.resourceAttributes)?void 0:f["service.name"])?u:null==r?void 0:r.serviceName)?l:null==i?void 0:i.serviceNameDefault,serviceVersion:null!=(c=null==f?void 0:f["service.version"])?c:null==r?void 0:r.serviceVersion,environment:null!=(h=null==f?void 0:f["deployment.environment"])?h:null==r?void 0:r.environment,resourceAttributes:f,beforeSend:null==r?void 0:r.beforeSend,flushIntervalMs:d,maxBufferSize:p,maxQueueSize:g,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:v,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0});return[new tx(this.Na(e,t),m,this.Ae,()=>this.qa(),e=>e(),void 0,s),m]}Ba(){var e,t,i=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.Aa&&this.ja===i||(null==(t=this.Aa)||t.reset(),this.ja=i,[this.Aa,this.Ha]=this.$a(()=>this.Or,e=>{this.Or=e})),this.Aa}Ua(){var e,t,i=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.Da&&this.za===i||(null==(t=this.Da)||t.reset(),this.za=i,[this.Da,this.Va]=this.$a(()=>this.La,e=>{this.La=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},aY)),this.Da}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!ea(i)&&i&&(this.Ra=!0,this.loadIfEnabled())}reset(){var e,t;this.Or=[],null==(e=this.Aa)||e.reset(),this.La=[],null==(t=this.Da)||t.reset(),this.ys=0}captureLog(e){this.Ba().captureLog(e)}le(e){this.Ua().captureLog(e)}get logger(){return this.Wa||(this.Wa={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)=>
1this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Wa}flushLogs(e){e?this.Ga(e):(this.Aa&&this.Aa.flush().catch(e=>this.Ae.error("PostHog logs flush failed:",e)),this.Da&&this.Da.flush().catch(e=>this.Ae.error("PostHog logs flush failed:",e)))}loadIfEnabled(){if(this.Ra&&!this.Oa){var e=null==m?void 0:m.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var i;t||null==(i=e.logs)||!i.initializeLogs?this.Ae.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.Oa=!0)}):this.Ae.error(iJ)}else this.Ae.error("PostHog Extensions not found.")}}Na(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===O.LogsQueue?e():void 0,setPersistedProperty(e,i){e===O.LogsQueue&&t(null!=i?i:[])},ht:e=>this.ht(e),getLibraryId:()=>w.LIB_NAME,getLibraryVersion:()=>w.LIB_VERSION}}ht(e){return new Promise(t=>{if(r_(this.ys,3))t({kind:"fatal",error:Error("logs endpoint is unreachable, dropping batch")});else{var i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>s({kind:"retry-later",error:Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.Za(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.Qa(i),i>=200&&300>i)?s({kind:"ok"}):413===i?s({kind:"too-large"}):0!==i&&429!==i&&500>i?s({kind:"fatal",error:Error("logs request failed with status "+i)}):s({kind:"retry-later",error:null!=(t=e.error)?t:Error("logs request failed with status "+i)})}})}})}Qa(e){(0!==e||this._instance.__loaded)&&(this.ys=rm(e,this.ys,3,()=>this.Ae.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.")))}Ga(e){this.Or.length>0&&this.Ja(e,this.Or,this.Ha,w.LIB_NAME,e=>{this.Or=e}),this.La.length>0&&this.Ja(e,this.La,this.Va,aY,e=>{this.La=e})}Ja(e,t,i,s,r){if(0!==t.length){var n=t.map(e=>e.record);r([]);
1var a=tw(n,tb(i,w.LIB_NAME,w.LIB_VERSION),s,w.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Za(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}Za(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}qa(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:i,windowId:s,sessionStartTimestamp:r,lastActivityTimestamp:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=i,t.windowId=s,ea(r)||(t.sessionStartTimestamp=r),ea(n)||(t.lastActivityTimestamp=n)}if(null!=m&&null!=(e=m.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tv(m.location.href):m.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.Ae=t3("[metrics]"),this._instance=e}initialize(){}Ba(){var e,t,i,s,r,n,a,o,l=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this.Aa&&this.ja===l||(null==(t=this.Aa)||t.reset(),this.ja=l,this.Aa=new tP(this.Na(),{serviceName:null!=(i=null==(o=null==l?void 0:l.resourceAttributes)?void 0:o["service.name"])?i:null==l?void 0:l.serviceName,serviceVersion:null!=(s=null==o?void 0:o["service.version"])?s:null==l?void 0:l.serviceVersion,environment:null!=(r=null==o?void 0:o["deployment.environment"])?r:null==l?void 0:l.environment,resourceAttributes:o,beforeSend:null==l?void 0:l.beforeSend,flushIntervalMs:null!=(n=null==l?void 0:l.flushIntervalMs)?n:1e4,maxSeriesPerFlush:null!=(a=null==l?void 0:l.maxSeriesPerFlush)?a:1e3},this.Ae)),this.Aa}count(e,t,i){void 0===t&&(t=1),this.Ba().count(e,t,i)}gauge(e,t,i){this.Ba().gauge(e,t,i)}histogram(e,t,i){this.Ba().histogram(e,t,i)}flush(e){if(!this.Aa)return Promise.resolve();if(e){var t=this.Aa.drainWindow();return t&&this.Tt(t,e),Promise.resolve()}return this.Aa.flush().catch(e=>this.Ae.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.Aa)||e.reset()}Na(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Tt:e=>t.Tt(e),getLibraryId:()=>w.LIB_NAME,getLibraryVersion:()=>w.LIB_VERSION}}Tt(e,t){return new Promise(i=>{var s=!1,r=e=>{s||(s=!0,clearTimeout(n),i(e))},n=setTimeout(()=>r({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(E({method:"POST",url:this.Ka(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t,i=e.statusCode;i>=200&&300>i?r({kind:"ok"}):413===i?r({kind:"too-large"}):0!==i&&429!==i&&500>i?r({kind:"fatal",error:Error("metrics request failed with status "+i)}):r({kind:"retry-later",error:null!=(t=e.error)?t:Error("metrics request failed with status "+i)})}}))})}Ka(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});aa.__defaultExtensionClasses=E({},aX);var a0=(w.SDK_DIST_CHANNEL="npm",s=n3[ae]=new aa,function(){function e(){e.done||(e.done=!0,at=!1,i9(n3,function(e){e._dom_loaded()}))}null!=h&&h.addEventListener?"complete"===h.readyState?e():sa(h,"DOMContentLoaded",e,{capture:!1}):l&&t2.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),s),a1=(0,a.createContext)({get client(){return r},bootstrap:void 0});function a2(e){var t,i,s=e.children,n=e.client,o=e.apiKey,l=e.options,u=(0,a.useRef)(null),c=(0,a.useMemo)(function(){if(n)return o&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),l&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),n;var e=r;return o||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),e},[n,o,JSON.stringify(l)]);return(0,a.useEffect)(function(){if(!n&&o){var e=r,t=u.current;t?(o!==t.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),l&&!function e(t,i,s){if(void 0===s&&(s=new WeakMap),t===i)return!0;
1if("object"!=typeof t||null===t||"object"!=typeof i||null===i)return!1;if(s.has(t)&&s.get(t)===i)return!0;s.set(t,i);var r=Object.keys(t),n=Object.keys(i);if(r.length!==n.length)return!1;for(var a=0;a<r.length;a++){var o=r[a];if(!n.includes(o)||!e(t[o],i[o],s))return!1}return!0}(l,t.options)&&e.set_config(l)):(e.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),e.init(o,l)),u.current={apiKey:o,options:null!=l?l:{}}}},[n,o,JSON.stringify(l)]),a.default.createElement(a1.Provider,{value:{client:c,bootstrap:null!=(t=null==l?void 0:l.bootstrap)?t:null==(i=null==n?void 0:n.config)?void 0:i.bootstrap}},s)}var a3=function(e){return"function"==typeof e},a5=function(e,t){return(a5=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};"function"==typeof SuppressedError&&SuppressedError;var a6={componentStack:null,exceptionEvent:null,error:null};!function(e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=i}function i(t){var i=e.call(this,t)||this;return i.state=a6,i}a5(i,e),i.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t),i.prototype.componentDidCatch=function(e,t){var i,s=this.props.additionalProperties;a3(s)?i=s(e):"object"==typeof s&&(i=s);var r=this.context.client.captureException(e,i),n=t.componentStack;this.setState({error:e,componentStack:null!=n?n:null,exceptionEvent:r})},i.prototype.render=function(){var e=this.props,t=e.children,i=e.fallback,s=this.state;if(null==s.componentStack)return a3(t)?t():t;var r=a3(i)?a.default.createElement(i,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):i;return a.default.isValidElement(r)?r:(console.warn("[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."),a.default.createElement(a.default.Fragment,null))},i.contextType=a1}(a.default.Component),r=a0;var a4=e.i(117927),a8=e.i(865012);function a7(){let e=(0,o.useSearchParams)();return(0,a.useEffect)(()=>{if(!e)return;let t=(0,a8.readAttributionFromParams)(new URLSearchParams(e.toString()));if(!t||document.cookie.split("; ").some(e=>e.startsWith(`${a8.ATTRIBUTION_COOKIE}=`)))return;let i=encodeURIComponent((0,a8.serializeAttribution)(t)),s="https:"===window.location.protocol?"; Secure":"";document.cookie=`${a8.ATTRIBUTION_COOKIE}=${i}; Path=/; Max-Age=${a8.ATTRIBUTION_MAX_AGE_SECONDS}; SameSite=Lax${s}`},[e]),null}function a9(){let e=(0,o.usePathname)(),t=(0,o.useSearchParams)(),i=(0,a.useContext)(a1).client;return(0,a.useEffect)(()=>{if(!e||!i)return;let s=window.location.origin+e,r=t?.toString();r&&(s+=`?${r}`),i.capture("$pageview",{$current_url:s})},[e,t,i]),null}e.s(["PostHogProvider",0,function({children:e}){return(0,a.useEffect)(()=>{a0.init("phc_mmQcGywJ6ycyRHxFKnAzejKtocPqTXjNYyNyFdFM4q7g",{api_host:"https://us.i.posthog.com",capture_pageview:!1,capture_pageleave:!0,person_profiles:"identified_only"});let e=(0,a4.createClient)();e.auth.getUser().then(({data:e})=>{e.user&&a0.identify(e.user.id,{email:e.user.email})});let{data:t}=e.auth.onAuthStateChange((e,t)=>{"SIGNED_IN"===e&&t?.user?a0.identify(t.user.id,{email:t.user.email}):"SIGNED_OUT"===e&&a0.reset()});return()=>t.subscription.unsubscribe()},[]),(0,n.jsxs)(a2,{client:a0,children:[(0,n.jsxs)(a.Suspense,{fallback:null,children:[(0,n.jsx)(a9,{}),(0,n.jsx)(a7,{})]}),e]})}],593100)}]);

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.