PageSourceSearch

https://earnedmediavalues.com/assets/root-C2-SzRiy.js

js earnedmediavalues.com collected 2026-10-04 05:37:07 UTC 241,774 bytes, 23 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/VisualEditingComponent2-DvG_WoBD.js","assets/jsx-runtime-CoQTyu9B.js","assets/index-CKPoyeJM.js","assets/preload-helper-D7HrI6pR.js","assets/SiteLayout-UHSjQTG9.js","assets/AuthContext-DZ69f6Ga.js","assets/utils-Bjur4jwN.js","assets/components-g23Xfs-s.js","assets/pricing-data-D0ksSo53.js","assets/gtm.client-D_CnJGNJ.js","assets/index-SP6PeenQ.js","assets/structured-data-CIVsVYkH.js","assets/error-boundary-DR-26qP5.js"])))=>i.map(i=>d[i]);
2import{r as De,j as H}from"./jsx-runtime-CoQTyu9B.js";import{S as Vo,i as gi}from"./SiteLayout-UHSjQTG9.js";import{_ as Zo}from"./preload-helper-D7HrI6pR.js";import{a as Xo}from"./AuthContext-DZ69f6Ga.js";import{P as Qo}from"./index-SP6PeenQ.js";import{S as el}from"./structured-data-CIVsVYkH.js";import{E as tl}from"./error-boundary-DR-26qP5.js";import{p as il,q as rl,_ as sl,u as nl,M as al,c as ol,S as ll}from"./components-g23Xfs-s.js";import{c as Ms,h as ul,O as cl}from"./index-CKPoyeJM.js";/**
3 * @remix-run/react v2.16.5
4 *
5 * Copyright (c) Remix Software Inc.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE.md file in the root directory of this source tree.
9 *
10 * @license MIT
11 */let en="positions";function hl({getKey:i,...e}){let{isSpaMode:t}=il(),r=Ms(),s=ul();rl({getKey:i,storageKey:en});let n=De.useMemo(()=>{if(!i)return null;let o=i(r,s);return o!==r.key?o:null},[]);if(t)return null;let a=((o,l)=>{if(!window.history.state||!window.history.state.key){let u=Math.random().toString(32).slice(2);window.history.replaceState({key:u},"")}try{let c=JSON.parse(sessionStorage.getItem(o)||"{}")[l||window.history.state.key];typeof c=="number"&&window.scrollTo(0,c)}catch(u){console.error(u),sessionStorage.removeItem(o)}}).toString();return De.createElement("script",sl({},e,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${a})(${JSON.stringify(en)}, ${JSON.stringify(n)})`}}))}/**
12 * Copyright (c) Meta Platforms, Inc. and affiliates.
13 *
14 * This source code is licensed under the MIT license found in the
15 * LICENSE file in the root directory of this source tree.
16 *
17 * @lightSyntaxTransform
18 * @noflow
19 * @nolint
20 * @preventMunge
21 * @preserve-invariant-messages
22 */var dl=Object.create,ar=Object.defineProperty,pl=Object.getOwnPropertyDescriptor,vl=Object.getOwnPropertyNames,fl=Object.getPrototypeOf,gl=Object.prototype.hasOwnProperty,_l=(i,e)=>{for(var t in e)ar(i,t,{get:e[t],enumerable:!0})},ha=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of vl(e))!gl.call(i,s)&&s!==t&&ar(i,s,{get:()=>e[s],enumerable:!(r=pl(e,s))||r.enumerable});return i},ml=(i,e,t)=>(t=i!=null?dl(fl(i)):{},ha(!i||!i.__esModule?ar(t,"default",{value:i,enumerable:!0}):t,i)),yl=i=>ha(ar({},"__esModule",{value:!0}),i),da={};_l(da,{$dispatcherGuard:()=>kl,$makeReadOnly:()=>Tl,$reset:()=>Sl,$structuralCheck:()=>Rl,c:()=>El,clearRenderCounterRegistry:()=>Pl,renderCounterRegistry:()=>ni,useRenderCounter:()=>Il});var bl=yl(da),St=ml(De),{useRef:wl,useEffect:xl,isValidElement:pt}=St,tn,Br=(tn=St.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)!=null?tn:St.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Gr=Symbol.for("react.memo_cache_sentinel"),rn,El=typeof((rn=St.__COMPILER_RUNTIME)==null?void 0:rn.c)=="function"?St.__COMPILER_RUNTIME.c:function(e){return St.useMemo(()=>{const t=new Array(e);for(let r=0;r<e;r++)t[r]=Gr;return t[Gr]=!0,t},[])},Ai={};["readContext","useCallback","useContext","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useDebugValue","useDeferredValue","useTransition","useMutableSource","useSyncExternalStore","useId","unstable_isNewReconciler","getCacheSignal","getCacheForType","useCacheRefresh"].forEach(i=>{Ai[i]=()=>{throw new Error(`[React] Unexpected React hook call (${i}) from a React compiled function. Check that all hooks are called directly and named according to convention ('use[A-Z]') `)}});var Xt=null;Ai.useMemoCache=i=>{if(Xt==null)throw new Error("React Compiler internal invariant violation: unexpected null dispatcher");return Xt.useMemoCache(i)};function _i(i){return Br.ReactCurrentDispatcher.current=i,Br.ReactCurrentDispatcher.current}var vt=[];function kl(i){const e=Br.ReactCurrentDispatcher.current;if(i===0){if(vt.push(e),vt.length===1&&(Xt=e),e===Ai)throw new Error("[React] Unexpected call to custom hook or component from a React compiled function. Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') and (2) components are returned as JSX instead of being directly invoked.");_i(Ai)}else if(i===1){const t=vt.pop();if(t==null)throw new Error("React Compiler internal error: unexpected null in guard stack");vt.length===0&&(Xt=null),_i(t)}else if(i===2)vt.push(e),_i(Xt);else if(i===3){const t=vt.pop();if(t==null)throw new Error("React Compiler internal error: unexpected null in guard stack");_i(t)}else throw new Error("React Compiler internal error: unreachable block"+i)}function Sl(i){for(let e=0;e<i.length;e++)i[e]=Gr}function Tl(){throw new Error("TODO: implement $makeReadOnly in react-compiler-runtime")}var ni=new Map;
22function Pl(){for(const i of ni.values())i.forEach(e=>{e.count=0})}function $l(i,e){let t=ni.get(i);t==null&&(t=new Set,ni.set(i,t)),t.add(e)}function Fl(i,e){const t=ni.get(i);t!=null&&t.delete(e)}function Il(i){const e=wl(null);e.current!=null&&(e.current.count+=1),xl(()=>{if(e.current==null){const t={count:0};$l(i,t),e.current=t}return()=>{e.current!==null&&Fl(i,e.current)}})}var sn=new Set;function Rl(i,e,t,r,s,n){function a(u,c,h,d){const v=`${r}:${n} [${s}] ${t}${h} changed from ${u} to ${c} at depth ${d}`;sn.has(v)||(sn.add(v),console.error(v))}const o=2;function l(u,c,h,d){if(!(d>o)){if(u===c)return;if(typeof u!=typeof c)a(`type ${typeof u}`,`type ${typeof c}`,h,d);else if(typeof u=="object"){const v=Array.isArray(u),p=Array.isArray(c);if(u===null&&c!==null)a("null",`type ${typeof c}`,h,d);else if(c===null)a(`type ${typeof u}`,"null",h,d);else if(u instanceof Map)if(!(c instanceof Map))a("Map instance","other value",h,d);else if(u.size!==c.size)a(`Map instance with size ${u.size}`,`Map instance with size ${c.size}`,h,d);else for(const[f,b]of u)c.has(f)?l(b,c.get(f),`${h}.get(${f})`,d+1):a(`Map instance with key ${f}`,`Map instance without key ${f}`,h,d);else if(c instanceof Map)a("other value","Map instance",h,d);else if(u instanceof Set)if(!(c instanceof Set))a("Set instance","other value",h,d);else if(u.size!==c.size)a(`Set instance with size ${u.size}`,`Set instance with size ${c.size}`,h,d);else for(const f of c)u.has(f)||a(`Set instance without element ${f}`,`Set instance with element ${f}`,h,d);else if(c instanceof Set)a("other value","Set instance",h,d);else if(v||p)if(v!==p)a(`type ${v?"array":"object"}`,`type ${p?"array":"object"}`,h,d);else if(u.length!==c.length)a(`array with length ${u.length}`,`array with length ${c.length}`,h,d);else for(let f=0;f<u.length;f++)l(u[f],c[f],`${h}[${f}]`,d+1);else if(pt(u)||pt(c))pt(u)!==pt(c)?a(`type ${pt(u)?"React element":"object"}`,`type ${pt(c)?"React element":"object"}`,h,d):u.type!==c.type?a(`React element of type ${u.type}`,`React element of type ${c.type}`,h,d):l(u.props,c.props,`[props of ${h}]`,d+1);else{for(const f in c)f in u||a(`object without key ${f}`,`object with key ${f}`,h,d);for(const f in u)f in c?l(u[f],c[f],`${h}.${f}`,d+1):a(`object with key ${f}`,`object without key ${f}`,h,d)}}else{if(typeof u=="function")return;isNaN(u)||isNaN(c)?isNaN(u)!==isNaN(c)&&a(`${isNaN(u)?"NaN":"non-NaN value"}`,`${isNaN(c)?"NaN":"non-NaN value"}`,h,d):u!==c&&a(u,c,h,d)}}}l(i,e,"",0)}const Ml=De.lazy(()=>Zo(()=>import("./VisualEditingComponent2-DvG_WoBD.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]))),Cl=()=>()=>{};function Ol(i){const e=bl.c(2);if(!De.useSyncExternalStore(Cl,Ll,Al))return null;let t;return e[0]!==i?(t=H.jsx(De.Suspense,{fallback:null,children:H.jsx(Ml,{...i})}),e[0]=i,e[1]=t):t=e[1],t}function Al(){return!1}function Ll(){return!0}function Dl(){return H.jsx(Ol,{})}const Nl="production",jl=Nl==="qa";var g=typeof window<"u"?window:void 0,de=typeof globalThis<"u"?globalThis:g,fe=de==null?void 0:de.navigator,T=de==null?void 0:de.document,se=de==null?void 0:de.location,Cs=de==null?void 0:de.fetch,Wr=de!=null&&de.XMLHttpRequest&&"withCredentials"in new de.XMLHttpRequest?de.XMLHttpRequest:void 0,nn=de==null?void 0:de.AbortController,Hl=de==null?void 0:de.CompressionStream,ye=fe==null?void 0:fe.userAgent;function pa(){return!(!g||g.navigator.onLine===!1)}var Lt=typeof globalThis<"u"?globalThis:g;Lt&&typeof self>"u"&&(Lt.self=Lt),Lt&&typeof File>"u"&&(Lt.File=function(){});var F=g??{},an="0.2.0",U={DEBUG:!1,LIB_VERSION:an,LIB_NAME:"browser-common",JS_SDK_VERSION:an};function on(i,e,t,r,s,n,a){try{var o=i[n](a),l=o.value}catch(u){return void t(u)}o.done?e(l):Promise.resolve(l).then(r,s)}function re(i){return function(){var e=this,t=arguments;return new Promise(function(r,s){var n=i.apply(e,t);function a(l){on(n,r,s,a,o,"next",l)}function o(l){on(n,r,s,a,o,"throw",l)}a(void 0)})}}function _(){return _=Object.assign?Object.assign.bind():function(i){for(var e=1;arguments.length>e;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(i[r]=t[r])}return i},_.apply(null,arguments)}function va(i,e){if(i==null)return{};var t={};for(var r in i)if({}
22.hasOwnProperty.call(i,r)){if(e.indexOf(r)!==-1)continue;t[r]=i[r]}return t}var ln=i=>{if(typeof i!="string")return i;try{return JSON.parse(i)}catch{return i}};function un(i){return typeof i=="string"||i}function cn(i){return typeof i=="string"?i:void 0}var Dt,ql=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],Ue=function(i){return i.AnonymousId="anonymous_id",i.DistinctId="distinct_id",i.Props="props",i.EnablePersonProcessing="enable_person_processing",i.PersonMode="person_mode",i.FeatureFlagDetails="feature_flag_details",i.FeatureFlags="feature_flags",i.FeatureFlagPayloads="feature_flag_payloads",i.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",i.BootstrapFeatureFlags="bootstrap_feature_flags",i.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",i.OverrideFeatureFlags="override_feature_flags",i.Queue="queue",i.AiQueue="ai_queue",i.LogsQueue="logs_queue",i.OptedOut="opted_out",i.SessionId="session_id",i.SessionStartTimestamp="session_start_timestamp",i.SessionLastTimestamp="session_timestamp",i.PersonProperties="person_properties",i.GroupProperties="group_properties",i.InstalledAppBuild="installed_app_build",i.InstalledAppVersion="installed_app_version",i.SessionReplay="session_replay",i.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",i.SurveyLastSeenDate="survey_last_seen_date",i.SurveysSeen="surveys_seen",i.Surveys="surveys",i.RemoteConfig="remote_config",i.FlagsEndpointWasHit="flags_endpoint_was_hit",i.DeviceId="device_id",i}({}),hn=function(i){return i.GZipJS="gzip-js",i.Base64="base64",i}({}),zl=["$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"],Ul=["token"],fa="NativeGzipValidationError",Kr=i=>i.length>=2&&i[0]===31&&i[1]===139,dn=(i,e)=>i===hn.GZipJS||e===hn.GZipJS||e==="gzip",pn=i=>!(!i||typeof i!="object")&&("name"in i?String(i.name):"")==="NotReadableError",mi=i=>{var e=new Error("Native gzip produced invalid output: "+i);throw e.name=fa,e},Bl=function(){var i=re(function*(e,t){18>e.size&&mi("too-short");var r=new Uint8Array(yield e.slice(0,10).arrayBuffer());Kr(r)&&r[2]===8||mi("invalid-header");var s=new DataView(yield e.slice(e.size-8).arrayBuffer());s.getUint32(0,!0)!==(a=>{for(var o=(()=>{if(Dt)return Dt;Dt=[];for(var c=0;256>c;c++){for(var h=c,d=0;8>d;d++)h=1&h?3988292384^h>>>1:h>>>1;Dt[c]=h>>>0}return Dt})(),l=4294967295,u=0;a.length>u;u++)l=o[255&(l^a[u])]^l>>>8;return(4294967295^l)>>>0})(t)&&mi("invalid-crc");var n=t.length>>>0;s.getUint32(4,!0)!==n&&mi("invalid-size")});return function(e,t){return i.apply(this,arguments)}}();function Jr(){return Jr=re(function*(i,e,t){e===void 0&&(e=!0);try{var r=new TextEncoder().encode(i),s=new globalThis.CompressionStream("gzip"),n=s.writable.getWriter(),a=n.write(r).then(()=>n.close()).catch(function(){var u=re(function*(c){try{yield n.abort(c)}catch{}throw c});return function(c){return u.apply(this,arguments)}}()),o=new Response(s.readable).blob(),l=(yield Promise.all([o,a]))[0];return yield Bl(l,r),l}catch(u){if(t!=null&&t.rethrow)throw u;return e&&console.error("Failed to gzip compress data",u),null}}),Jr.apply(this,arguments)}var Gl=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],vn=function(i,e){if(e===void 0&&(e=[]),!i)return!1;var t=i.toLowerCase();return Gl.concat(e).some(r=>{var s=r.toLowerCase();return t.indexOf(s)!==-1})};function C(i,e){return i.indexOf(e)!==-1}var or=function(i){return i.trim()},Yr=function(i){return i.replace(/^\$/,"")};function ga(i){var e,t=[];return(e=JSON.stringify(i,function(r,s){if(typeof s=="bigint")return s.toString();if(typeof s!="function"&&typeof s!="symbol"){if(s instanceof Error)return{name:s.name,message:s.message,stack:s.stack};if(s&&typeof s=="object"){for(;t.length>0&&t[t.length-1]!==this;)t.pop();if(t.includes(s))return"[Circular]";t.push(s)}return s}}))!==null&&e!==void 0?e:"null"}
22var _a=Object.prototype,ma=_a.hasOwnProperty,lr=_a.toString,L=Array.isArray||function(i){return lr.call(i)==="[object Array]"},Ce=i=>typeof i=="function",Y=i=>i===Object(i)&&!L(i),Ze=i=>{if(Y(i)){for(var e in i)if(ma.call(i,e))return!1;return!0}return!1},w=i=>i===void 0,B=i=>lr.call(i)=="[object String]",Vr=i=>B(i)&&i.trim().length===0,ge=i=>i===null,O=i=>w(i)||ge(i),ce=i=>lr.call(i)=="[object Number]"&&i==i,qe=i=>ce(i)&&i>0,Oe=i=>lr.call(i)==="[object Boolean]",Wl=i=>i instanceof FormData,Kl=i=>C(zl,i),Jl=i=>C(Ul,i);function ya(i){return i===null||typeof i!="object"}function Li(i,e){return{}.toString.call(i)==="[object "+e+"]"}function Os(i){return typeof Event<"u"&&function(e,t){try{return e instanceof t}catch{return!1}}(i,Event)}var Yl=[!0,"true",1,"1","yes"],dr=i=>C(Yl,i),Vl=[!1,"false",0,"0","no"];function Le(i,e,t,r,s){return e>t&&(r.warn("min cannot be greater than max."),e=t),ce(i)?i>t?(r.warn(" cannot be  greater than max: "+t+". Using max value instead."),t):e>i?(r.warn(" cannot be less than min: "+e+". Using min value instead."),e):i:(r.warn(" must be a number. using max or fallback. max: "+t+", fallback: "+s),Le(s||t,e,t,r))}class Zl{constructor(e){this.tt={},this.et=e.et,this.rt=Le(e.bucketSize,0,100,e.it),this.nt=Le(e.refillRate,0,this.rt,e.it),this.st=Le(e.refillInterval,0,864e5,e.it)}ot(e,t){var r=Math.floor((t-e.lastAccess)/this.st);r>0&&(e.tokens=Math.min(e.tokens+r*this.nt,this.rt),e.lastAccess=e.lastAccess+r*this.st)}consumeRateLimit(e){var t,r=Date.now(),s=String(e),n=this.tt[s];return n?this.ot(n,r):this.tt[s]=n={tokens:this.rt,lastAccess:r},n.tokens===0||(n.tokens--,n.tokens===0&&((t=this.et)==null||t.call(this,e)),n.tokens===0)}stop(){this.tt={}}}var ke="Mobile",Di="iOS",Je="Android",$t="Tablet",ba=Je+" "+$t,wa="iPad",xa="Apple",Ea=xa+" Watch",Qt="Safari",Ft="BlackBerry",ka="Samsung",Sa=ka+"Browser",Ta=ka+" Internet",ct="Chrome",Xl=ct+" OS",Pa=ct+" "+Di,As="Internet Explorer",$a=As+" "+ke,Ls="Opera",Ql=Ls+" Mini",Ds="Edge",Fa="Microsoft "+Ds,Tt="Firefox",Ia=Tt+" "+Di,ai="Nintendo",oi="PlayStation",Pt="Xbox",Ra=Je+" "+ke,Ma=ke+" "+Qt,Kt="Windows",Zr=Kt+" Phone",fn="Nokia",Xr="Ouya",Ca="Generic",eu=Ca+" "+ke.toLowerCase(),Oa=Ca+" "+$t.toLowerCase(),Qr="Konqueror",Aa="Oculus Browser",Ni="Vivaldi",La="Yandex",ji="Whale",es="DuckDuckGo",Da="Pale Moon",Hi="Waterfox",ei="Brave",Na="Google Search App",Q="(\\d+(\\.\\d+)?)",pr=new RegExp("Version/"+Q),tu=new RegExp(Pt,"i"),iu=new RegExp(oi+" \\w+","i"),ru=new RegExp(ai+" \\w+","i"),Ns=new RegExp(Ft+"|PlayBook|BB10","i"),su={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},ja=function(i,e,t,r){e=e||"";var s=function(n){return n!=null&&n.brave?ei:null}(t);return s||(r!=null&&r.detectGoogleSearchApp&&C(i,"GSA/")?Na:C(i," OPR/")&&C(i,"Mini")?Ql:C(i," OPR/")?Ls:Ns.test(i)?Ft:C(i,"IE"+ke)||C(i,"WPDesktop")?$a:C(i,"OculusBrowser")?Aa:C(i,Sa)?Ta:C(i,Ds)||C(i,"Edg/")?Fa:C(i,Ni+"/")?Ni:C(i,"YaBrowser/")?La:C(i,ji+"/")?ji:C(i,es+"/")||C(i,"Ddg/")?es:C(i,"FBIOS")?"Facebook "+ke:C(i,"UCWEB")||C(i,"UCBrowser")?"UC Browser":C(i,"CriOS")?Pa:C(i,"CrMo")||C(i,ct)?ct:C(i,Je)&&C(i,Qt)?Ra:C(i,"FxiOS")?Ia:C(i.toLowerCase(),Qr.toLowerCase())?Qr:C(i,ei+"/")?ei:((n,a)=>a&&C(a,xa)||function(o){return C(o,Qt)&&!C(o,ct)&&!C(o,Je)}(n))(i,e)?C(i,ke)?Ma:Qt:C(i,"PaleMoon/")?Da:C(i,Hi+"/")?Hi:C(i,Tt)?Tt:C(i,"MSIE")||C(i,"Trident/")?As:C(i,"Gecko")?Tt:"")},nu={[$a]:[new RegExp("rv:"+Q)],[Fa]:[new RegExp(Ds+"?\\/"+Q)],[ct]:[new RegExp("("+ct+"|CrMo)\\/"+Q)],[Pa]:[new RegExp("CriOS\\/"+Q)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Q)],[Qt]:[pr],[Ma]:[pr],[Ls]:[new RegExp("(Opera|OPR)\\/"+Q)],[Tt]:[new RegExp(Tt+"\\/"+Q)],[Ia]:[new RegExp("FxiOS\\/"+Q)],[Qr]:[new RegExp("Konqueror[:/]?"+Q,"i")],[Ft]:[new RegExp(Ft+" "+Q),pr],[Ra]:[new RegExp("android\\s"+Q,"i")],[Ta]:[new RegExp(Sa+"\\/"+Q)],[Aa]:[new RegExp("OculusBrowser\\/"+Q)],[Ni]:[new RegExp(Ni+"\\/"+Q)],[La]:[new RegExp("YaBrowser\\/"+Q)],[ji]:[new RegExp(ji+"\\/"+Q)],[ei]:[new RegExp(ei+"\\/"+Q)],[es]:[new RegExp("(DuckDuckGo|Ddg)\\/"+Q)],[Da]:[new RegExp("PaleMoon\\/"+Q)],[Hi]:[new RegExp(Hi+"\\/"+Q)],[Na]:[new RegExp("GSA\\/"+Q)],[As]:[new RegExp("(rv:|MSIE )"+Q)],Mozilla:[new RegExp("rv:"+Q)]},au=function(i,e,t,r){var s=ja(i,e,t,r),n=nu[s];if(w(n))return null;for(var a=0;n.length>a;a++){var o=i.match(n[a]);if(o)return parseFloat(o[o.length-2])}return null},gn=[[new RegExp(Pt+"; "+Pt+" (.*?)[);]","i"),i=>[Pt,i&&i[1]||""]],[new RegExp(ai,"i"),[ai,""]],[new RegExp(oi,"i"),[oi,""]],[Ns,[Ft,""]],[new RegExp(Kt,"i"),(i,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Zr,""];if(new RegExp(ke).test(e)&&!/IEMobile\b/.test(e))return[Kt+" "+ke,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var r=su[t[1]]||"";return/arm/i.test(e)&&(r="RT"),[Kt,r]}return[Kt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,i=>i&&i[3]?[Di,[i[3],i[4],i[5]||"0"].join(".")]:[Di,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,i=>{var e="";return i&&i.length>=3&&(e=w(i[2])?i[3]:i[2]),["watchOS",e]}],[new RegExp("("+Je+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Je+")","i"),i=>i&&i[2]?[Je,[i[2],i[3],i[4]||"0"].join(".")]:[Je,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,i=>{var e=["Mac OS X",""];return i&&i[1]&&(e[1]=[i[1],i[2],i[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Xl,""]],[/Linux|debian/i,["Linux",""]]],_n=function(i){return ru.test(i)?ai:iu.test(i)?oi:tu.test(i)?Pt:new RegExp(Xr,"i").test(i)?Xr:new RegExp("("+Zr
22+"|WPDesktop)","i").test(i)?Zr:/iPad/.test(i)?wa:/iPod/.test(i)?"iPod Touch":/iPhone/.test(i)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(i)?Ea:Ns.test(i)?Ft:/(kobo)\s(ereader|touch)/i.test(i)?"Kobo":new RegExp(fn,"i").test(i)?fn:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(i)||/(kf[a-z]+)( bui|\)).+silk\//i.test(i)?"Kindle Fire":/(Android|ZTE)/i.test(i)?new RegExp(ke).test(i)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(i)||/pixel[\daxl ]{1,6}/i.test(i)&&!/pixel c/i.test(i)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(i)||/lmy47v/i.test(i)&&!/QTAQZ3/i.test(i)?Je:ba:new RegExp("(pda|"+ke+")","i").test(i)?eu:new RegExp($t,"i").test(i)&&!new RegExp($t+" pc","i").test(i)?Oa:""},ou=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function mn(i,e){return typeof(t=i)=="string"&&ou.test(t)?i:e();var t}function Xe(i){return i&&i.split("#")[0]}function $i(i,e){var t=setTimeout(i,e);return t!=null&&t.unref&&(t==null||t.unref()),t}var lu=i=>i instanceof Error,Ha={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}},uu=Ha.info;function qa(i){if(Oe(i))return{boolValue:i};if(typeof i=="number")return Number.isFinite(i)?Number.isInteger(i)?{intValue:i}:{doubleValue:i}:{stringValue:String(i)};if(typeof i=="string")return{stringValue:i};if(L(i))return{arrayValue:{values:i.map(e=>qa(e))}};try{return{stringValue:JSON.stringify(i)}}catch{return{stringValue:String(i)}}}function qi(i){var e=[];for(var t in i){var r=i[t];ge(r)||w(r)||e.push({key:t,value:qa(r)})}return e}function cu(i,e){var t=Ha[i.level||"info"]||uu,r=t.text,s=t.number,n=String(Date.now())+"000000",a={};e.distinctId&&(a.posthogDistinctId=e.distinctId),e.sessionId&&(a.sessionId=e.sessionId),e.windowId&&(a["window.id"]=e.windowId),O(e.sessionStartTimestamp)||(a.sessionStartTimestamp=String(e.sessionStartTimestamp)),O(e.lastActivityTimestamp)||(a.lastActivityTimestamp=String(e.lastActivityTimestamp)),e.currentUrl&&(a["url.full"]=e.currentUrl),e.screenName&&(a["screen.name"]=e.screenName),e.appState&&(a["app.state"]=e.appState),e.activeFeatureFlags&&e.activeFeatureFlags.length>0&&(a.feature_flags=e.activeFeatureFlags);var o=_({},a,i.attributes||{}),l={timeUnixNano:n,observedTimeUnixNano:n,severityNumber:s,severityText:r,body:{stringValue:i.body},attributes:qi(o)};return i.trace_id&&(l.traceId=i.trace_id),i.span_id&&(l.spanId=i.span_id),w(i.trace_flags)||(l.flags=i.trace_flags),l}function za(i,e,t){return _({},i.resourceAttributes,{"service.name":i.serviceName||"unknown_service"},i.environment&&{"deployment.environment":i.environment},i.serviceVersion&&{"service.version":i.serviceVersion},{"telemetry.sdk.name":e,"telemetry.sdk.version":t})}function Ua(i,e,t,r){return{resourceLogs:[{resource:{attributes:qi(e)},scopeLogs:[{scope:{name:t,version:r},logRecords:i}]}]}}let hu=class{constructor(i,e,t,r,s,n,a){var o;n===void 0&&(n=()=>Promise.resolve()),this._instance=i,this.Te=e,this.it=t,this.ut=r,this.ht=s,this.dt=n,this.ct=a,this.vt=null,this.ft=0,this.yt=0,this.bt=0,this._t=0,this.wt=!1,this.xt=e.maxBufferSize,this.kt=Math.max((o=e.maxQueueSize)!==null&&o!==void 0?o:e.maxBufferSize,e.maxBufferSize),this.St=e.flushIntervalMs,this.Ct=e.maxBatchRecordsPerPost,this.It=e.rateCapWindowMs,this.Tt=e.maxLogsPerInterval}reset(){this.Mt(),this.vt=null,this.bt=0,this._t=0,this.wt=!1,this.ft=0,this.yt=0,this.Ct=this.Te.maxBatchRecordsPerPost}onReconnect(){this.yt=0,this.Et()}captureLog(i){if(!this._instance.isDisabled&&!this._instance.optedOut&&i!=null&&i.body){var e=this.Rt(i);if(e!==null)if(e.body){if(this.Pt()){var t={record:cu(e,this.ut())};this.ht(()=>this.Ot(t))}}else this.it.info("Log was rejected in beforeSend function")}}Rt(i){var e=this.Te.beforeSend;if(!e)return i;var t=L(e)?e:[e],r=i;for(var s of t)try{var n=s(r);if(!n)return this.it.info("Log was rejected in beforeSend function"),null;r=n}catch(a){return this.it.error("Error in beforeSend function for log:",a),null}return r}Pt(){if(this.Tt===void 0)return!0;var i=Date.now(),e=i-this.bt;return this.It>e&&e>=0||(this.bt=i,this._t=0,this.wt=!1),this.Tt>this._t?(this._t++,!0):(this.wt||(this.it.warn("captureLog dropping logs: exceeded "+this.Tt+" logs per "+this.It+"ms"),this.wt=!0),!1)}flush(){var i=this;return re(function*(){if(!i._instance.isDisabled)return i.vt||(i.vt=i.Ft().finally(()=>{i.vt=null})),i.vt})()}Ft(){var i=this;return re(function*(){var e;i.Mt();var t=(e=i._instance.getPersistedProperty(Ue.LogsQueue))!==null&&e!==void 0?e:[];if(t.length!==0)for(var r=t.length,s=0;t.length>0&&r>s;){var n,a;i.ft=0;var o=Math.min(t.length,i.Ct),l=t.slice(0,o),u=Ua(l.map(h=>h.record),i.Lt(),(n=i.ct)!==null&&n!==void 0?n:i._instance.getLibraryId(),i._instance.getLibraryVersion()),c=yield i._instance.$t(u);
22if(c.kind==="too-large"&&l.length>1)i.Ct=Math.max(1,Math.floor(l.length/2)),i.it.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+i.Ct);else if(c.kind==="retry-later"||(c.kind==="too-large"?i.it.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):c.kind==="ok"&&i.Te.maxBatchRecordsPerPost>i.Ct&&(i.Ct=Math.min(i.Te.maxBatchRecordsPerPost,i.Ct+1)),yield i.At(l.length),t=(a=i._instance.getPersistedProperty(Ue.LogsQueue))!==null&&a!==void 0?a:[],s+=l.length,c.kind==="fatal"))throw c.error}})()}At(i){var e=this;return re(function*(){var t,r=Math.max(0,i-e.ft),s=(t=e._instance.getPersistedProperty(Ue.LogsQueue))!==null&&t!==void 0?t:[];e._instance.setPersistedProperty(Ue.LogsQueue,s.slice(r)),yield e.dt()})()}Lt(){return za(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Ot(i){var e;if(!this._instance.optedOut){var t=(e=this._instance.getPersistedProperty(Ue.LogsQueue))!==null&&e!==void 0?e:[];this.kt>t.length||(t.shift(),this.ft++,this.it.info("Logs queue is full, dropping oldest record.")),t.push(i),this._instance.setPersistedProperty(Ue.LogsQueue,t),this.xt>t.length?this.Nt():this.Et()}}Nt(i){i===void 0&&(i=this.St),this.Dt||(this.Dt=$i(()=>{this.Dt=void 0,this.Et()},i))}qt(){var i=Math.min(Math.max(0,this.yt-1),6);return this.St*Math.pow(2,i)}jt(){var i=this._instance.getPersistedProperty(Ue.LogsQueue);return!!i&&i.length>0}shutdown(i){var e=this;return re(function*(){e.Mt();var t=e.flush().catch(()=>{});i!==void 0?yield Promise.race([t,new Promise(r=>$i(r,i))]):yield t})()}flushWithTimeout(i){var e=this;return re(function*(){var t=!1,r=e.flush(),s=new Promise(n=>$i(()=>{t=!0,n()},i));try{yield Promise.race([r,s])}finally{t&&r.catch(()=>{})}})()}Et(){this.flush().then(()=>{this.yt=0},i=>{this.yt++,this.it.error("PostHog logs flush failed:",i)}).finally(()=>{!this._instance.isDisabled&&this.jt()&&this.Nt(this.qt())})}Mt(){this.Dt&&(clearTimeout(this.Dt),this.Dt=void 0)}};var vr=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function yn(i){return String(i)+"000000"}function bn(i,e,t,r){var s="";return r&&(s=Object.keys(r).sort().map(n=>JSON.stringify(n)+":"+JSON.stringify(r[n])).join(",")),i+"\0"+e+"\0"+(t??"")+"\0"+s}let du=class{constructor(i,e,t){this._instance=i,this.Te=e,this.it=t,this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Vt=0}count(i,e,t){e===void 0&&(e=1),this.Wt({name:i,type:"count",value:e,unit:t==null?void 0:t.unit,attributes:t==null?void 0:t.attributes})}gauge(i,e,t){this.Wt({name:i,type:"gauge",value:e,unit:t==null?void 0:t.unit,attributes:t==null?void 0:t.attributes})}histogram(i,e,t){this.Wt({name:i,type:"histogram",value:e,unit:t==null?void 0:t.unit,attributes:t==null?void 0:t.attributes})}flush(){var i=this,e=this.vt,t=function(){var s=re(function*(){e&&(yield e.catch(()=>{})),yield i.Zt()});return function(){return s.apply(this,arguments)}}(),r=t().finally(()=>{this.vt===r&&(this.vt=null)});return this.vt=r,r}drainWindow(){if(this.Ht.size===0)return null;var i=this.Ht;return this.Ht=new Map,this.Bt=!1,this.Ut=new Map,this.zt=new Set,this.Gt(i)}reset(){this.Vt++,this.Mt(),this.Ht=new Map,this.vt=null,this.Bt=!1,this.Ut=new Map,this.zt=new Set}Wt(i){if(!this._instance.isDisabled&&!this._instance.optedOut){var e=this.Rt(i);if(e!==null)if(e.name&&typeof e.name=="string")if(typeof e.value=="number"&&Number.isFinite(e.value))if(e.type==="count"&&0>e.value)this.it.warn("Dropping count '"+e.name+"': counters are monotonic, value must be >= 0");else{var t,r;try{t=e.attributes?_({},e.attributes):void 0,r=bn(e.type,e.name,e.unit,t)}catch(a){return void this.it.warn("Dropping metric '"+e.name+"': attributes could not be serialized",a)}var s=this.Ht.get(r);if(!s){if(!this.Qt())return;s={name:e.name,type:e.type,unit:e.unit,attributes:t,windowStartMs:Date.now()},this.Ht.set(r,s)}var n=this.Ut.get(e.name);n===void 0?this.Ut.set(e.name,e.type):n===e.type||this.zt.has(e.name)||(this.zt.add(e.name),this.it.warn("Metric name '"+e.name+"' is already used as a "+n+"; recording it as a "+e.type+" too will blend both series in charts. Use a distinct name.")),this.Jt(s,e.value),this.Nt()}else this.it.warn("Dropping metric '"+e.name+"': value must be a finite number");else this.it.warn("Dropping metric with empty name")}}Qt(){return this.Te.maxSeriesPerFlush>this.Ht.size||(this.Bt||(this.Bt=!0,this.it.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Jt(i,e){var t;switch(i.type){case"count":i.total=((t=i.total)!==null&&t!==void 0?t:0)+e;break;case"gauge":i.last=e;break;case"histogram":i.hist||(i.hist={count:0,sum:0,min:e,max:e,bucketCounts:new Array(vr.length+1).fill(0)});var r=i.hist;r.count+=1,r.sum+=e,r.min=Math.min(r.min,e),r.max=Math.max(r.max,e),r.bucketCounts[function(s,n){for(var a=0;n.length>a;a++)if(n[a]>=s)return a;return n.length}(e,vr)]+=1}}Rt(i){var e=this.Te.beforeSend;if(!e)return i;var t=L(e)?e:[e],r=i;for(var s of t)try{var n=s(r);if(!n)return this.it.info("Metric was rejected in beforeSend function"),null;r=n}catch(a){return this.it.error("Error in beforeSend function for metric:",a),null}return r}Nt(){this.Dt||(this.Dt=$i(()=>{this.Dt=void 0,this.flush().catch(i=>{this.it.error("Metrics flush failed:",i)})},this.Te.flushIntervalMs))}
22Mt(){this.Dt&&(clearTimeout(this.Dt),this.Dt=void 0)}Zt(){var i=this;return re(function*(){if(i.Ht.size!==0){var e=i.Ht;i.Ht=new Map,i.Bt=!1,i.Ut=new Map,i.zt=new Set;var t=i.Vt,r=yield i._instance.Kt(i.Gt(e));if(t===i.Vt)switch(r.kind){case"ok":return;case"retry-later":return i.Yt(e),void i.Nt();case"too-large":return void i.it.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void i.it.error("Failed to send metrics batch:",r.error)}}})()}Gt(i){return e=this.Xt(i),t=function(n,a,o){return _({},n.resourceAttributes,{"service.name":n.serviceName||"unknown_service"},n.environment&&{"deployment.environment":n.environment},n.serviceVersion&&{"service.version":n.serviceVersion},{"telemetry.sdk.name":a,"telemetry.sdk.version":o})}(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:qi(t)},scopeMetrics:[{scope:{name:r,version:s},metrics:e}]}]};var e,t,r,s}Xt(i){var e=yn(Date.now()),t=new Map;for(var r of i.values()){var s,n=bn(r.type,r.name,r.unit,void 0),a=t.get(n);a||(a=_({name:r.name},r.unit&&{unit:r.unit}),r.type==="count"?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:r.type==="gauge"?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},t.set(n,a));var o=qi((s=r.attributes)!==null&&s!==void 0?s:{}),l=yn(r.windowStartMs);if(r.type==="count"){var u,c={attributes:o,startTimeUnixNano:l,timeUnixNano:e,asDouble:(u=r.total)!==null&&u!==void 0?u:0};a.sum.dataPoints.push(c)}else if(r.type==="gauge"){var h,d={attributes:o,timeUnixNano:e,asDouble:(h=r.last)!==null&&h!==void 0?h:0};a.gauge.dataPoints.push(d)}else r.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:e,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:vr})}return Array.from(t.values())}Yt(i){var e,t;for(var r of i){var s=r[0],n=r[1],a=this.Ht.get(s);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,n.windowStartMs),a.type){case"count":a.total=((e=a.total)!==null&&e!==void 0?e:0)+((t=n.total)!==null&&t!==void 0?t:0);break;case"gauge":break;case"histogram":if(n.hist)if(a.hist){a.hist.count+=n.hist.count,a.hist.sum+=n.hist.sum,a.hist.min=Math.min(a.hist.min,n.hist.min),a.hist.max=Math.max(a.hist.max,n.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else a.hist=n.hist}else this.Qt()&&this.Ht.set(s,n)}}};var yi,wn,fr;function pu(i){var e=globalThis._posthogChunkIds;if(e){var t=Object.keys(e);return fr&&t.length===wn||(wn=t.length,fr=t.reduce((r,s)=>{yi||(yi={});var n=yi[s];if(n)r[n[0]]=n[1];else for(var a=i(s),o=a.length-1;o>=0;o--){var l=a[o],u=l==null?void 0:l.filename,c=e[s];if(u&&c){r[u]=c,yi[s]=[u,c];break}}return r},{})),fr}}class vu{constructor(e,t,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){t===void 0&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(r,t,0).apply(e),n=this.buildParsingContext(t),a=this.parseStacktrace(s,n);return{$exception_list:this.convertToExceptionList(a,r),$exception_level:"error"}}modifyFrames(e){var t=this;return re(function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&L(r.stacktrace.frames)&&(r.stacktrace.frames=yield t.applyModifiers(r.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:(t=e.syntheticException)==null?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var r,s;return e.cause!=null&&(r=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null&&(s=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),_({},e,{cause:r,stack:s})}applyChunkIds(e,t){return e.map(r=>(r.filename&&t&&(r.chunk_id=t[r.filename]),r))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return re(function*(){var r=e;for(var s of t.modifiers)r=yield s(r);return r})()}convertToExceptionList(e,t){var r,s,n,a={type:e.type,value:e.value,mechanism:{type:(r=t.type)!==null&&r!==void 0?r:"generic",handled:(s=t.handled)===null||s===void 0||s,synthetic:(n=e.synthetic)!==null&&n!==void 0&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,_({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:pu(this.stackParser),skipFirstLines:(t=e.skipFirstLines)!==null&&t!==void 0?t:1}}buildCoercingContext(e,t,r){r===void 0&&(r=0);var s=(n,a)=>
22{if(4>=a){var o=this.buildCoercingContext(e,t,a);return this.applyCoercers(n,o)}};return _({},t,{syntheticException:r==0?t.syntheticException:void 0,mechanism:e,apply:n=>s(n,r),next:n=>s(n,r+1)})}}var It="?";function ts(i,e,t,r,s){var n={platform:i,filename:e,function:t==="<anonymous>"?It:t,in_app:!0};return w(r)||(n.lineno=r),w(s)||(n.colno=s),n}var Ba=(i,e)=>{var t=i.indexOf("safari-extension")!==-1,r=i.indexOf("safari-web-extension")!==-1;return t||r?[i.indexOf("@")!==-1?i.split("@")[0]:It,t?"safari-extension:"+e:"safari-web-extension:"+e]:[i,e]},fu=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,gu=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,_u=/\((\S*)(?::(\d+))(?::(\d+))\)/,mu=(i,e)=>{var t=fu.exec(i);if(t)return ts(e,t[1],It,+t[2],+t[3]);var r=gu.exec(i);if(r){if(r[2]&&r[2].indexOf("eval")===0){var s=_u.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var n=Ba(r[1]||It,r[2]);return ts(e,n[1],n[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},yu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,bu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,wu=(i,e)=>{var t=yu.exec(i);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var r=bu.exec(t[3]);r&&(t[1]=t[1]||"eval",t[3]=r[1],t[4]=r[2],t[5]="")}var s=t[3],n=t[1]||It,a=Ba(n,s);return ts(e,s=a[1],n=a[0],t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},xn=/\(error: (.*)\)/;class xu{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=B(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?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 Li(e,"DOMException")}isDOMError(e){return Li(e,"DOMError")}}class Eu{match(e){return(t=>t instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}}class ku{constructor(){}match(e){return Li(e,"ErrorEvent")&&e.error!=null}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(r=t.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var Su=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Tu{match(e){return typeof e=="string"}coerce(e,t){var r,s=this.getInfos(e),n=s[0],a=s[1];return{type:n??"Error",value:a??e,stack:(r=t.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,s=e.match(Su);return s&&(t=s[1],r=s[2]),[t,r]}}var Pu=["fatal","error","warning","log","info","debug"];function Ga(i,e){e===void 0&&(e=40);var t=Object.keys(i);if(t.sort(),!t.length)return"[object has no keys]";for(var r=t.length;r>0;r--){var s=t.slice(0,r).join(", ");if(e>=s.length)return r===t.length?s:s.length>e?s.slice(0,e)+"...":s}return""}class $u{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var r,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:(r=t.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Os(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var t="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+Ga(e)}isSeverityLevel(e){return B(e)&&!Vr(e)&&Pu.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(lu(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}}class Fu{match(e){return Os(e)}coerce(e,t){var r,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+Ga(e),stack:(r=t.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class Iu{match(e){return ya(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=t.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class Ru{match(e){return Li(e,"PromiseRejectionEvent")||this.isCu
22stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Os(e))return!1;try{var t=e.detail;return t!=null&&typeof t=="object"&&"reason"in t}catch{return!1}}coerce(e,t){var r,s=this.getUnhandledRejectionReason(e);return ya(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:(r=t.syntheticException)==null?void 0:r.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var zi="$message",Ui="$timestamp",Mu=new Set([zi,Ui]),gr={enabled:!0,max_bytes:32768};function Bi(i){var e;return i?{enabled:(e=i.enabled)!==null&&e!==void 0?e:gr.enabled,max_bytes:Ou(i.max_bytes,gr.max_bytes)}:_({},gr)}class Cu{constructor(e){this.$e=[],this.ze=0,this.Te=Bi(e)}setConfig(e){this.Te=Bi(e),this.Ze()}add(e){var t=function(s){var n;try{n=ga(s)}catch{return}try{var a=JSON.parse(n);if(!Y(a))return;var o=a,l=o[zi],u=o[Ui];return!B(l)||l.trim().length===0||!B(u)&&!ce(u)?void 0:{step:o,json:n}}catch{return}}(e);if(t){var r=function(s){if(typeof TextEncoder<"u")return new TextEncoder().encode(s).length;for(var n=encodeURIComponent(s),a=0,o=0;n.length>o;o++)n[o]==="%"?(a+=1,o+=2):a+=1;return a}(t.json);r>this.Te.max_bytes||(this.$e.push({step:t.step,bytes:r}),this.ze+=r,this.Ze())}}getAttachable(){return this.$e.map(e=>e.step)}clear(){this.$e=[],this.ze=0}size(){return this.$e.length}Ze(){for(;this.ze>this.Te.max_bytes&&this.$e.length>0;){var e=this.$e.shift();e&&(this.ze-=e.bytes)}}}function Ou(i,e){if(!ce(i)||i===1/0||i===-1/0)return e;var t=Math.floor(i);return 0>t?e:t}var Wa=function(i,e){var t=(e===void 0?{}:e).debugEnabled,r={k(s){if(g&&(U.DEBUG||g.POSTHOG_DEBUG||t)&&!w(g.console)&&g.console){for(var n=("__rrweb_original__"in g.console[s])?g.console[s].__rrweb_original__:g.console[s],a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];n(i,...o)}},debug(){for(var s=arguments.length,n=new Array(s),a=0;s>a;a++)n[a]=arguments[a];r.k("debug",...n)},info(){for(var s=arguments.length,n=new Array(s),a=0;s>a;a++)n[a]=arguments[a];r.k("log",...n)},warn(){for(var s=arguments.length,n=new Array(s),a=0;s>a;a++)n[a]=arguments[a];r.k("warn",...n)},error(){for(var s=arguments.length,n=new Array(s),a=0;s>a;a++)n[a]=arguments[a];r.k("error",...n)},critical(){for(var s=arguments.length,n=new Array(s),a=0;s>a;a++)n[a]=arguments[a];console.error(i,...n)},uninitializedWarning(s){r.error("You must initialize PostHog before calling "+s)},createLogger:(s,n)=>Wa(i+" "+s,n)};return r},x=Wa("[PostHog.js]"),Z=x.createLogger,Au=Z("[ExternalScriptsLoader]"),_r=(i,e,t)=>{if(i.config.disable_external_dependency_loading)return Au.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var r=T==null?void 0:T.querySelectorAll("script");if(r){for(var s,n=function(){if(r[a].src===e){var l=r[a];return l.__posthog_loading_callback_fired?{v:t()}:(l.addEventListener("load",u=>{l.__posthog_loading_callback_fired=!0,t(void 0,u)}),l.onerror=u=>t(u),{v:void 0})}},a=0;r.length>a;a++)if(s=n())return s.v}var o=()=>{if(!T)return t("document not found");var l=T.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=h=>{l.__posthog_loading_callback_fired=!0,t(void 0,h)},l.onerror=h=>t(h),i.config.prepare_external_dependency_script&&(l=i.config.prepare_external_dependency_script(l)),!l)return t("prepare_external_dependency_script returned null");if(i.config.external_scripts_inject_target==="head")T.head.appendChild(l);else{var u,c=T.querySelectorAll("body > script");c.length>0?(u=c[0].parentNode)==null||u.insertBefore(l,c[0]):T.body.appendChild(l)}};T!=null&&T.body?o():T==null||T.addEventListener("DOMContentLoaded",o)};F.__PosthogExtensions__=F.__PosthogExtensions__||{},F.__PosthogExtensions__.loadExternalDependency=(i,e,t)=>{if(e!=="remote-config"){var r;if(i.config.strict_script_versioning)r=i.requestRouter.endpointFor("assets","/static/"+i.version+"/"+e+".js");else{var s="/static/"+e+".js?v="+i.version;if(e==="toolbar"){var n=3e5;
22s=s+"&t="+Math.floor(Date.now()/n)*n}r=i.requestRouter.endpointFor("assets",s)}_r(i,r,t)}else{var a=i.requestRouter.endpointFor("assets","/array/"+i.config.token+"/config.js");_r(i,a,t)}},F.__PosthogExtensions__.loadSiteApp=(i,e,t)=>{var r=i.requestRouter.endpointFor("api",e);_r(i,r,t)};var En="1.407.2";U.DEBUG=!1,U.LIB_VERSION=En,U.LIB_NAME="web",U.JS_SDK_VERSION=En;var Ka="$people_distinct_id",Gi="$device_id",mr="$device_model",Jt="__alias",Yt="__timers",is="$autocapture_disabled_server_side",rs="$heatmaps_enabled_server_side",ss="$exception_capture_enabled_server_side",ns="$error_tracking_suppression_rules",as="$error_tracking_capture_extension_exceptions",os="$web_vitals_enabled_server_side",js="$dead_clicks_enabled_server_side",Hs="$product_tours_enabled_server_side",ls="$web_vitals_allowed_metrics",ut="$session_recording_remote_config",Ja="$replay_sample_rate",Ya="$replay_override_sampling",Va="$replay_override_linked_flag",Za="$replay_override_url_trigger",Xa="$replay_override_event_trigger",Et="$sesid",qs="$session_is_sampled",lt="$enabled_feature_flags",Fi="$active_feature_flags",Vt="$early_access_features",us="$feature_flag_details",Ii="$feature_flag_payloads",cs="$feature_flag_request_id",Wi="$minimal_flag_called_events",ze="$override_feature_flags",bt="$override_feature_flag_payloads",nt="$stored_person_properties",at="$stored_group_properties",hs="$surveys",Ki="$surveys_loaded_at",ds="$surveys_activated",Ri="$surveys_activated_session",Zt="ph_product_tours",ti="$flag_call_reported",ps="$flag_call_reported_session_id",vs="$feature_flag_errors",li="$feature_flag_evaluated_at",Me="$user_state",fs="$client_session_props",gs="$capture_rate_limit",_s="$initial_campaign_params",ms="$initial_referrer_info",Ji="$initial_person_info",Yi="$epp",bi="$posthog_cookieless",Qa="$cookieless_mode",eo="$sdk_debug_extensions_init_method",to="$sdk_debug_extensions_init_time_ms",io="$sdk_debug_recording_script_not_loaded",zs="PostHog loadExternalDependency extension not found.",ot="on_reject",Ge="always",ft="anonymous",gt="identified",ys="identified_only",Vi="visibilitychange",Zi="beforeunload",wt="$pageview",yr="$pageleave",br="$identify",kn="$groupidentify";function wi(i,e){L(i)&&i.forEach(e)}function G(i,e){if(!O(i))if(L(i))i.forEach(e);else if(Wl(i))i.forEach((r,s)=>e(r,s));else for(var t in i)ma.call(i,t)&&e(i[t],t)}var J=function(i){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;e>r;r++)t[r-1]=arguments[r];for(var s of t)for(var n in s)s[n]!==void 0&&(i[n]=s[n]);return i};function Mi(i){for(var e=Object.keys(i),t=e.length,r=new Array(t);t--;)r[t]=[e[t],i[e[t]]];return r}var Sn=function(i){try{return i()}catch{return}},Lu=function(i){return function(){try{for(var e=arguments.length,t=new Array(e),r=0;e>r;r++)t[r]=arguments[r];return i.apply(this,t)}catch(s){x.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),x.critical(s)}}},Us=function(i){var e={};return G(i,function(t,r){(B(t)&&t.length>0||ce(t))&&(e[r]=t)}),e},Du=["herokuapp.com","vercel.app","netlify.app"];function Nu(i){var e=i==null?void 0:i.hostname;if(!B(e))return!1;var t=e.split(".").slice(-2).join(".");for(var r of Du)if(t===r)return!1;return!0}function ee(i,e,t,r){var s=r??{},n=s.capture,a=s.passive;i==null||i.addEventListener(e,t,{capture:n!==void 0&&n,passive:a===void 0||a})}function ro(i){return i.name==="ph_toolbar_internal"}var so=i=>{if(T){try{for(var e=i+"=",t=T.cookie.split(";").filter(n=>n.length),r=0;t.length>r;r++){for(var s=t[r];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}};Math.trunc||(Math.trunc=function(i){return 0>i?Math.ceil(i):Math.floor(i)}),Number.isInteger||(Number.isInteger=function(i){return ce(i)&&isFinite(i)&&Math.floor(i)===i});class Xi{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,r,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(s)||0>e||0>t||0>r||0>s||e>0xffffffffffff||t>4095||r>1073741823||s>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/256,n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|r>>>24,n[9]=r>>>16,n[10]=r>>>8,n[11]=r,n[12]=s>
22>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new Xi(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Xi(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var r=this.bytes[t]-e.bytes[t];if(r!==0)return Math.sign(r)}return 0}}class ju{generate(){var e=this.generateOrAbort();if(!w(e))return e;this.S=0;var t=this.generateOrAbort();if(w(t))throw new Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return Xi.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.M.nextUint32())}C(){this.I=1024*this.M.nextUint32()+(1023&this.M.nextUint32())}constructor(){this.S=0,this.I=0,this.M=new Hu}}var Tn,no=i=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;i.length>e;e++)i[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return i};g&&!w(g.crypto)&&crypto.getRandomValues&&(no=i=>crypto.getRandomValues(i));class Hu{nextUint32(){return this.R.length>this.O||(no(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var Be=()=>qu().toString(),qu=()=>(Tn||(Tn=new ju)).generate(),Nt="",zu=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,We={N:()=>!!T,D(i){x.error("cookieStore error: "+i)},A:so,F(i){var e;try{e=JSON.parse(We.A(i))||{}}catch{}return e},q(i,e,t,r,s){if(!T)return!1;try{var n="",a="",o=function(c,h){if(h){var d=function(p,f){if(f===void 0&&(f=T),Nt)return Nt;if(!f||["localhost","127.0.0.1"].includes(p))return"";for(var b=p.split("."),m=Math.min(b.length,8),k="dmn_chk_"+Be();!Nt&&m--;){var E=b.slice(m).join("."),S=k+"=1;domain=."+E+";path=/";f.cookie=S+";max-age=3",f.cookie.includes(k)&&(f.cookie=S+";max-age=0",Nt=E)}return Nt}(c);if(!d){var v=(p=>{var f=p.match(zu);return f?f[0]:""})(c);v!==d&&x.info("Warning: cookie subdomain discovery mismatch",v,d),d=v}return d?"; domain=."+d:""}return""}(T.location.hostname,r);if(t){var l=new Date;l.setTime(l.getTime()+864e5*t),n="; expires="+l.toUTCString()}s&&(a="; secure");var u=i+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&x.warn("cookieStore warning: large cookie, len="+u.length),T.cookie=u,!0}catch{return!1}},P(i,e){if(T!=null&&T.cookie)try{We.q(i,"",-1,e)}catch{return}}},wr=null,W={N(){if(!ge(wr))return wr;var i=!0;if(w(g))i=!1;else try{var e="__mplssupport__";W.q(e,"xyz"),W.A(e)!=='"xyz"'&&(i=!1),W.P(e)}catch{i=!1}return i||x.error("localStorage unsupported; falling back to cookie store"),wr=i,i},D(i){x.error("localStorage error: "+i)},A(i){try{return g==null?void 0:g.localStorage.getItem(i)}catch(e){W.D(e)}return null},F(i){try{return JSON.parse(W.A(i))||{}}catch{}return null},q(i,e){try{return g==null||g.localStorage.setItem(i,JSON.stringify(e)),!0}catch(t){W.D(t)}return!1},P(i){try{g==null||g.localStorage.removeItem(i)}catch(e){W.D(e)}}},Uu=[Gi,"distinct_id",Et,qs,Yi,Ji,Me],xi={},Bu={N:()=>!0,D(i){x.error("memoryStorage error: "+i)},A:i=>xi[i]||null,F:i=>xi[i]||null,q:(i,e)=>(xi[i]=e,!0),P(i){delete xi[i]}},et=null,ue={N(){if(!ge(et))return et;if(et=!0,w(g))et=!1;else try{var i="__support__";ue.q(i,"xyz"),ue.A(i)!=='"xyz"'&&(et=!1),ue.P(i)}catch{et=!1}return et},D(i){x.error("sessionStorage error: ",i)},A(i){try{return g==null?void 0:g.sessionStorage.getItem(i)}catch(e){ue.D(e)}return null},F(i){try{return JSON.parse(ue.A(i))||null}catch{}return null},q(i,e){try{return g==null||g.sessionStorage.setItem(i,JSON.stringify(e)),!0}catch(t){ue.D(t)}return!1},P(i){try{g==null||g.sessionStorage.removeItem(i)}catch(e){ue.D(e)}}};class Gu{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Ge()?0:this.Qe}isOptedOut(){return this.Te.cookieless_mode===Ge||this.isRejected()||this.consent===-1&&this.Te.cookieless_mode===ot}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.Te.opt_out_capturing_by_default}optInOut(e){this.Je.q(this.Ke,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Je.P(this.Ke,this.Te.cross_subdomain_cookie)}get Ke(){var e=this._instance.config,t=e.token,r=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(r?r+t:"__ph_opt_in_out_"+t)}get Qe(){var e=this.Je.A(this.Ke);return dr(e)?1:C(Vl,e)?0:-1}get Je(){var e=this.Te.opt_out_capturing_persistence_type,t=e==="localStorage"?W:We;if(!this.Ye||this.Ye!==t){this.Ye=t;var r=e==="localStorage"?We:W;r.A(this.Ke)&&(this.Ye.A(this.Ke)||this.optInOut(dr(r.A(this.Ke))),r.P(this.Ke,this.Te.cross_subdomain_cookie))}return this.Ye}Ge(){return!!this.Te.respect_dnt&&[fe==null?void 0:fe.doNotTrack,fe==null?void 0:fe.msDoNotTrack,F.doNotTrack].some(e=>dr(e))}}function ao(i,e){var t,r=i==null||(t=i.config)==null?void 0:t.get_current_url;if(!Ce(r))return e;try{var s=r(e);return B(s)&&s?s:e}catch(n){return x.error("Error in get_current_url, falling back to window.location.href",n),e}}var oo="__POSTHOG_TOOLBAR__",Wu=1,Ku=3,Ju=11;function Pn(i){return i instanceof Element&&(i.id===oo||!(i.closest==null||!i.closest(".toolbar-global-fade-container")))}function Qe(i){return!!i&&i.nodeType===Wu}function Ee(i,e){return!!i&&!!i.tagName&&i.tagName.toLowerCase()===e.toLowerCase()}function lo(i){return!!i&&i.nodeType===Ku}function uo(i){return!!i&&i.nodeType===Ju&&Qe(i.host)}var co=1e3;function Bs(i){return i?or(i).split(/\s+/):[]}function $n(i,e){var t=function(r){var s,n=g==null||(s=g.location)==null?void 0:s.href;return w(n)?void 0:ao(r,n)}(e);return!!(t&&i&&i.some(r=>t.match(r)))}function Qi(i){var e="";switch(typeof i.className){case"string":e=i.className;break;case"object":e=(i.className&&"baseVal"in i.className?i.className.baseVal:null)||i.getAttribute("class")||"";break;default:e=""}return Bs(e)}function ho(i){return O(i)?null:or(i).split(/(\s+)/).filter(e=>ii(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ui(i){var e="";return ws(i)&&!go(i)&&i.childNodes&&i.childNodes.length&&G(i.childNodes,function(t){var r;lo(t)&&t.textContent&&(e+=(r=ho(t.textContent))!==null&&r!==void 0?r:"")}),or(e)}function xr(i){var e;return w(i.target)?i.srcElement||null:(e=i.target)!=null&&e.shadowRoot?i.composedPath()[0]||null:i.target||null}var Gs=["a","button","form","input","select","textarea","label"];function bs(i,e){if(w(e))return!0;var t,r=function(n){if(e.some(a=>function(o,l){var u=o.matches||o.matchesSelector||o.msMatchesSelector||o.mozMatchesSelector||o.webkitMatchesSelector||o.oMatchesSelector;try{return!!u&&u.call(o,l)}catch{return!1}}(n,a)))return{v:!0}};for(var s of i)if(t=r(s))return t.v;return!1}function po(i){var e=i.parentNode;return!(!e||!Qe(e))&&e}var Yu=[".ph-no-autocapture","[data-ph-no-autocapture]"],vo=["next","previous","prev",">","<"],Vu=[...vo,"+","-","−","–"],Fn=(i,e)=>/[a-z0-9]/i.test(e)?i.includes(e):i===e,In=[".ph-no-rageclick",".ph-no-capture"],Zu=["","text","search","email","password","url","tel","number"];function Rn(i,e){if(!g||Ws(i))return!1;var t,r,s,n,a;
22if(Oe(e)?(t=!!e&&In,r=void 0,s=!1):(t=(n=e==null?void 0:e.css_selector_ignorelist)!==null&&n!==void 0?n:In,r=e==null?void 0:e.content_ignorelist,s=(a=e==null?void 0:e.ignore_text_selection)!==null&&a!==void 0&&a),t===!1||s&&function(l){return!(!l||!Qe(l))&&(!!Ee(l,"textarea")||(Ee(l,"input")?C(Zu,(l.getAttribute("type")||"").toLowerCase()):function(u){if(u.isContentEditable)return!0;var c=u.getAttribute==null?void 0:u.getAttribute("contenteditable");return c==="true"||c===""}(l)))}(i))return!1;var o=fo(i,!1).targetElementList;return!function(l,u){if(l===!1||w(l))return!1;var c;if(l===!0)c=vo;else{if(!L(l))return!1;if(l.length>10)return x.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;c=l.map(h=>h.toLowerCase())}return u.some(h=>{var d=h.safeText,v=h.ariaLabel;return c.some(p=>Fn(d,p)||Fn(v,p))})}(r,o.map(l=>{var u;return{safeText:ui(l).toLowerCase(),ariaLabel:((u=l.getAttribute("aria-label"))==null?void 0:u.toLowerCase().trim())||""}}))&&!bs(o,t)}var Ws=i=>!i||Ee(i,"html")||!Qe(i),fo=(i,e)=>{if(!g||Ws(i))return{parentIsUsefulElement:!1,targetElementList:[]};for(var t=!1,r=[i],s=i;s.parentNode&&!Ee(s,"body");)if(uo(s.parentNode))r.push(s.parentNode.host),s=s.parentNode.host;
22else{var n=po(s);if(!n)break;if(e||Gs.indexOf(n.tagName.toLowerCase())>-1)t=!0;else try{var a=g.getComputedStyle(n);a&&a.getPropertyValue("cursor")==="pointer"&&(t=!0)}catch{}r.push(n),s=n}return{parentIsUsefulElement:t,targetElementList:r}};function ws(i){for(var e=new Set,t=0,r=i;r.parentNode&&!Ee(r,"body");r=r.parentNode){if(t++>=co||e.has(r))return!1;e.add(r);var s=Qi(r);if(C(s,"ph-sensitive")||C(s,"ph-no-capture"))return!1}if(C(Qi(i),"ph-include"))return!0;var n=i.type||"";if(B(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var a=i.name||i.id||"";return!B(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function go(i){return!!(Ee(i,"input")&&!["button","checkbox","submit","reset"].includes(i.type)||Ee(i,"select")||Ee(i,"textarea")||i.getAttribute("contenteditable")==="true")}var _o="(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})",Xu=new RegExp("^(?:"+_o+")$"),Qu=new RegExp(_o),mo="\\d{3}-?\\d{2}-?\\d{4}",ec=new RegExp("^("+mo+")$"),tc=new RegExp("("+mo+")");function ii(i,e){return e===void 0&&(e=!0),!(O(i)||B(i)&&(i=or(i),(e?Xu:Qu).test((i||"").replace(/[- ]/g,""))||(e?ec:tc).test(i)))}function Mn(i){var e=ui(i);return ii(e=(e+" "+yo(i)).trim())?e:""}function yo(i){var e="";return i&&i.childNodes&&i.childNodes.length&&G(i.childNodes,function(t){var r;if(t&&((r=t.tagName)==null?void 0:r.toLowerCase())==="span")try{var s=ui(t);e=(e+" "+s).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+yo(t)).trim())}catch(n){x.error("[AutoCapture]",n)}}),e}function Cn(i){return i.replace(/"|\\"/g,'\\"')}function ic(i){var e=i.attr__class;if(e)return L(e)?e:Bs(e)}var Ei=Z("[Dead Clicks]"),rc=()=>!0,sc=i=>{var e,t=!((e=i.instance.persistence)==null||!e.get_property(js)),r=i.instance.config.capture_dead_clicks;return Oe(r)?r:!!Y(r)||t};class On{get lazyLoadedDeadClicksAutocapture(){return this.Xe}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[js]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.tr(()=>{this.er()}):this.stop()}tr(e){var t,r;(t=F.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture?e():(r=F.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",s=>{s?Ei.error("failed to load script",s):e()})}er(){var e;if(T){if(!this.Xe&&(e=F.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=Y(this.instance.config.capture_dead_clicks)?_({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Xe=F.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Xe.start(T),Ei.info("starting...")}}else Ei.error("`document` not found. Cannot start.")}stop(){this.Xe&&(this.Xe.stop(),this.Xe=void 0,Ei.info("stopping..."))}}var Er=Z("[SegmentIntegration]"),bo="posthog-js";function wo(i,e){var t=e===void 0?{}:e,r=t.organization,s=t.projectId,n=t.prefix,a=t.severityAllowList,o=a===void 0?["error"]:a,l=t.sendExceptionsToPostHog,u=l===void 0||l;return c=>{var h,d,v,p,f;if(o!=="*"&&!o.includes(c.level)||!i.__loaded)return c;c.tags||(c.tags={});var b=i.requestRouter.endpointFor("ui","/project/"+i.config.token+"/person/"+i.get_distinct_id());c.tags["PostHog Person URL"]=b,i.sessionRecordingStarted()&&(c.tags["PostHog Recording URL"]=i.get_session_replay_url({withTimestamp:!0}));var m,k=((h=c.exception)==null?void 0:h.values)||[],E=k.map($=>_({},$,{stacktrace:$.stacktrace?_({},$.stacktrace,{type:"raw",frames:($.stacktrace.frames||[]).map(D=>_({},D,{platform:"web:javascript"}))}):void 0})),S={$exception_message:((d=k[0])==null?void 0:d.value)||c.message,$exception_type:(v=k[0])==null?void 0:v.type,$exception_level:c.level,$exception_list:E,$sentry_event_id:c.event_id,$sentry_exception:c.exception,$sentry_exception_message:((p=k[0])==null?void 0:p.value)||c.message,$sentry_exception_type:(f=k[0])==null?void 0:f.type,$sentry_tags:c.tags};return r&&s&&(S.$sentry_url=(n||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+c.event_id),u&&((m=i.exceptions)==null||m.sendExceptionEvent(S)),c}}class nc{constructor(e,t,r,s,n,a){this.name=bo,this.setupOnce=function(o){o(wo(e,{organization:t,projectId:r,prefix:s,severityAllowList:n,sendExceptionsToPostHog:a==null||a}))}}}class An{constructor(e){this.rr=(t,r,s)=>{s&&(s.noSessionId||s.activityTimeout||s.sessionPastMaximumLength||s.crossTabAdoption)&&(x.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:s}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.nr()}nr(){var e;this.sr=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.rr)}destroy(){var e;(e=this.sr)==null||e.call(this),this.sr=void 0}doPageView(e,t){var r,s=this.ar(e,t);return this.ir={pathname:(r=g==null?void 0:g.location.pathname)!==null&&r!==void 0?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.ar(e,(t=this.ir)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.ir)==null?void 0:e.pageViewId}}ar(e,t){var r=this.ir;if(!r)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:r.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var a=n.maxScrollHeight,o=n.lastScrollY,l=n.maxScrollY,u=n.maxContentHeight,c=n.lastContentY,h=n.maxContentY;if(!(w(a)||w(o)||w(l)||w(u)||w(c)||w(h))){a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),h=Math.ceil(h);var d=a>1?Le(o/a,0,1,x):1,v=a>1?Le(l/a,0,1,x):1,p=u>1?Le(c/u,0,1,x):1,f=u>1?Le(h/u,0,1,x):1;s=J(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:f})}}return r.pathname&&(s.$prev_pageview_pathname=r.pathname),r.timestamp&&(s.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),s}}var kr=["flags","surveys"],ac={[Ka]:{exposure:"hidden"},[Jt]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Yt]:{exposure:"hidden"},[is]:{exposure:"event"},[rs]:{exposure:"hidden"},[ss]:{exposure:"event"},[ns]:{exposure:"hidden"},[as]:{exposure:"event"},[os]:{exposure:"event"},[js]:{exposure:"event"},[Hs]:{exposure:"hidden"}
22,[ls]:{exposure:"event"},[ut]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Et]:{exposure:"hidden"},[qs]:{exposure:"event"},[Ja]:{exposure:"event",shouldSkipFromEventProperties:i=>ge(i)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[lt]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(i,e)=>e(),transformToEventProperties(i){if(!Y(i))return{};for(var e={},t=Object.keys(i),r=0;t.length>r;r++)e["$feature/"+t[r]]=i[t[r]];return e}},[Fi]:{exposure:"event",storageGroup:"flags"},[Vt]:{exposure:"hidden"},[us]:{exposure:"hidden",storageGroup:"flags"},[Ii]:{exposure:"event",storageGroup:"flags"},[cs]:{exposure:"event",storageGroup:"flags",volatile:!0},[Wi]:{exposure:"hidden",storageGroup:"flags"},[ze]:{exposure:"event"},[bt]:{exposure:"hidden"},[nt]:{exposure:"hidden"},[at]:{exposure:"hidden"},[hs]:{exposure:"hidden",storageGroup:"surveys"},[Ki]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ds]:{exposure:"event"},[Ri]:{exposure:"hidden"},[Zt]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ti]:{exposure:"hidden"},[ps]:{exposure:"hidden"},[vs]:{exposure:"hidden"},[li]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[Me]:{exposure:"hidden"},[fs]:{exposure:"hidden"},[gs]:{exposure:"hidden"},[_s]:{exposure:"hidden"},[ms]:{exposure:"hidden"},[Ji]:{exposure:"hidden"},[Yi]:{exposure:"hidden"},[Ya]:{exposure:"event"},[Va]:{exposure:"event"},[Za]:{exposure:"event"},[Xa]:{exposure:"event"},[eo]:{exposure:"event"},[to]:{exposure:"event"},[io]:{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"}},oc=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],tt=i=>{var e=ac[i];if(e)return e;for(var t of oc){var r=t[1];if(i.indexOf(t[0])===0)return r}},kt=(i,e)=>{try{return JSON.stringify(i,(t,r)=>typeof r=="bigint"?r.toString():r,e)}catch{return ga(i)}},ci=i=>{var e=T==null?void 0:T.createElement("a");return w(e)?null:(e.href=i,e)},Rt=function(i,e){for(var t,r=((i.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var n=r[s].split("=");if(n[0]===e){t=n;break}}if(!L(t)||2>t.length)return"";var a=t[1];try{a=decodeURIComponent(a)}catch{x.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},hi=function(i,e,t){if(!i||!e||!e.length)return i;for(var r=i.split("#"),s=r[1],n=(r[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],c=0;l.length>c;c++){var h=l[c].split("=");L(h)&&(e.includes(h[0])?u.push(h[0]+"="+t):u.push(l[c]))}var d=o;return a!=null&&(d+="?"+u.join("&")),s!=null&&(d+="#"+s),d},er=function(i,e){var t=i.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},xo=(i,e)=>i>=e&&pa(),Eo=(i,e,t,r)=>{if(i===0){if(pa()){var s=e+1;return s===t&&r(),s}return e}return 0},ki="https?://(.*)",Mt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],lc=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Mt],di="<masked>",uc=["li_fat_id"];function ko(i,e,t){if(!T)return{};var r,s=e?[...Mt,...t||[]]:[],n=So(hi(T.URL,s,di),i),a=(r={},G(uc,function(o){var l=so(o);r[o]=l||null}),r);return J(a,n)}function So(i,e){var t=lc.concat(e||[]),r={};return G(t,function(s){var n=Rt(i,s);r[s]=n||null}),r}function To(i){var e=function(n){return n?n.search(ki+"google.([^/?]*)")===0?"google":n.search(ki+"bing.com")===0?"bing":n.search(ki+"yahoo.com")===0?"yahoo":n.search(ki+"duckduckgo.com")===0?"duckduckgo":null:null}(i),t=e!="yahoo"?"q":"p",r={};if(!ge(e)){r.$search_engine=e;var s=T?Rt(T.referrer,t):"";s.length&&(r.ph_keyword=s)}return r}function Ln(){return navigator.language||navigator.userLanguage}var tr="$direct";function Po(){return(T==null?void 0:T.referrer)||tr}function $o(i,e,t){t===void 0&&(t=!1);var r=i?[...Mt,...e||[]]:[],s=t?Xe(se==null?void 0:se.href):se==null?void 0:se.href,n=s==null?void 0:s.substring(0,1e3);return{r:Po().substring(0,1e3),u:n?hi(n,r,di):void 0}}function Fo(i,e){var t;e===void 0&&(e=!1);var r=i.r,s=i.u,n=e?Xe(s):s,a={$referrer:r,$referring_domain:r==null?void 0:r==tr?tr:(t=ci(r))==null?void 0:t.host};
22if(n){a.$current_url=n;var o=ci(n);a.$host=o==null?void 0:o.host,a.$pathname=o==null?void 0:o.pathname;var l=So(n);J(a,l)}if(r){var u=To(r);J(a,u)}return a}function Io(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function cc(){try{return new Date().getTimezoneOffset()}catch{return}}var hc={flags:li,surveys:Ki},dc=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],_t="main";class Sr{constructor(e,t,r){if(r===void 0&&(r=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=e,this.dr=r,this.props={},this.cr=!1,this.vr=(n=>{var a="";return n.token&&(a=n.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),n.persistence_name?"ph_"+n.persistence_name:"ph_"+a+"_posthog"})(e),this.Je=this.pr(e),this.hr=this.gr(e),this.load(),e.debug&&x.info("Persistence loaded",e.persistence,_({},this.props)),this.update_config(e,e,t),this.save(),g){var s=()=>this.flush();ee(g,"beforeunload",s,{capture:!1}),ee(g,"pagehide",s,{capture:!1})}}mr(){var e,t=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return ce(t)&&t>0?t:0}isDisabled(){return!!this.yr}pr(e){dc.indexOf(e.persistence.toLowerCase())===-1&&(x.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,r=function(a,o){a===void 0&&(a=[]),o===void 0&&(o=!1);var l=[...Uu,...a];return _({},W,{F(u){try{var c={};try{c=We.F(u)||{}}catch{}var h,d=JSON.parse(W.A(u)||"{}");if(o){var v={};for(var p in c){var f=c[p];ge(f)||f===""||(v[p]=f)}h=J(d,v)}else h=J(c,d);return W.q(u,h),h}catch{}return null},q(u,c,h,d,v,p){var f=W.q(u,c,void 0,void 0,p);try{var b={};l.forEach(m=>{c[m]&&(b[m]=c[m])}),Object.keys(b).length&&We.q(u,b,h,d,v,p)}catch(m){W.D(m)}return f},P(u,c){try{g==null||g.localStorage.removeItem(u),We.P(u,c)}catch(h){W.D(h)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,n=e.persistence.toLowerCase();return n==="localstorage"&&W.N()?(t=W,s=!0):n==="localstorage+cookie"&&r.N()?(t=r,s=!0):n==="sessionstorage"&&ue.N()?t=ue:n==="memory"?t=Bu:n==="cookie"?t=We:r.N()?(t=r,s=!0):t=We,this.ur=s,t}br(e){return this.vr+"__"+e}gr(e){return this.ur&&!!e.split_storage}_r(e){var t=e??this.Te.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[li];return!r||typeof r!="number"||Date.now()-r>t}properties(){var e={};return G(this.props,(t,r)=>{var s=tt(r);if((s==null?void 0:s.exposure)==="derived"){if(s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(t,r===lt?()=>this._r():()=>!1))return;s.transformToEventProperties&&J(e,s.transformToEventProperties(t))}else if(!s||s.exposure==="event"){if(s!=null&&s.shouldSkipFromEventProperties!=null&&s.shouldSkipFromEventProperties(t,()=>!1))return;e[r]=t}}),e}load(){if(!this.yr){var e=this.Je.F(this.vr);e&&(this.props=J({},e)),this.hr&&this.wr()}}wr(){for(var e of kr){var t=W.F(this.br(e));if(t&&!Ze(t)){var r=this.kr(e);r.persisted=!0,this.Sr(e)||(r.fingerprint=this.Cr(t,e)),this.Ir(e,t)||J(this.props,t)}}}Sr(e){return Object.keys(this.props).some(t=>{var r;return((r=tt(t))==null?void 0:r.storageGroup)===e})}Ir(e,t){var r=hc[e];if(!r)return!1;var s=t[r],n=this.props[r];return ce(s)&&ce(n)&&n>s}refreshKey(e){var t;if(!this.yr){var r=this.hr?(t=tt(e))==null?void 0:t.storageGroup:void 0,s=r?W.F(this.br(r)):this.Je.F(this.vr);if(s&&e in s)this.Tr(e,s[e]);else{if(r){var n=this.Je.F(this.vr);if(n&&e in n)return void this.Tr(e,n[e])}this.Mr(e)}}}save(){if(!this.yr){var e=this.mr();e>0?w(this.Er)&&(this.Er=setTimeout(()=>{this.Er=void 0,this.Rr()},e)):this.Rr()}}flush(){w(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Je,this.vr,this.props,_t))}Pr(){var e=this.Fr(),t=e.main,r=e.groups;for(var s of(this.Or(this.Je,this.vr,t,_t),kr)){var n,a=r[s];(!Ze(a)||(n=this.lr[s])!=null&&n.persisted)&&this.Or(W,this.br(s),a,s)}}Fr(){var e={},t={flags:{},surveys:{}};return G(this.props,(r,s)=>{var n,a=(n=tt(s))==null?void 0:n.storageGroup;a?t[a][s]=r:e[s]=r}),{main:e,groups:t}}Cr(e,t){if(t===_t)return JSON.stringify(e)+"|"+this.Lr+"|"+this.$r+"|"+this.Ar;var r={};return G(e,(s,n)=>{var a;r[n]=(a=tt(n))!=null&&a.volatile?"__volatile__":s}),JSON.stringify(r)}Or(e,t,r,s){var n=this.kr(s);if(s===_t||n.dirty||w(n.fingerprint)){var a;try{if((a=this.Cr(r,s))===n.fingerprint)return void(n.dirty=!1)}catch{a=void 0}e.q(t,r,this.Lr,this.$r,this.Ar,this.Te.debug)?(n.dirty=!1,s!==_t&&(n.persisted=!0),w(a)||(n.fingerprint=a)):this.Te.debug&&x.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var t=(e===void 0?{}:e).keepGroupEntries,r=t!==void 0&&t;if(w(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Je.P(this.vr,!1),this.Je.P(this.vr,!0),!r&&this.dr)for(var s of kr)W.P(this.br(s));r?delete this.lr[_t]:this.lr={}}clear(){this.remove(),this.props={}}register_once(e,t,r){if(Y(e)){w(t)&&(t="None"),this.Lr=w(r)?this.Nr:r;var s=!1;if(G(e,(n,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.Tr(a,n),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(Y(e)){this.Lr=w(t)?this.Nr:t;var r=!1;if(G(e,(s,n)=>
22{e.hasOwnProperty(n)&&this.props[n]!==s&&(this.Tr(n,s),r=!0)}),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Mr(e),this.save())}update_campaign_params(){if(!this.cr){var e=ko(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);Ze(Us(e))||this.register(e),this.cr=!0}}update_search_keyword(){var e;this.register((e=T==null?void 0:T.referrer)?To(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Po(),$referring_domain:T!=null&&T.referrer&&((e=ci(T.referrer))==null?void 0:e.host)||tr},void 0)}set_initial_person_info(){this.props[_s]||this.props[ms]||this.register_once({[Ji]:$o(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes)},void 0)}get_initial_props(){var e={};G([ms,_s],s=>{var n=this.props[s];n&&G(n,function(a,o){e["$initial_"+Yr(o)]=a})});var t=this.props[Ji];if(t){var r=function(s,n){n===void 0&&(n=!1);var a=Fo(s,n),o={};return G(a,function(l,u){o["$initial_"+Yr(u)]=l}),o}(t,this.Te.disable_capture_url_hashes);J(e,r)}return e}safe_merge(e){return G(this.props,function(t,r){r in e||(e[r]=t)}),e}
22update_config(e,t,r){this.Nr=this.Lr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==t.persistence||!((l,u)=>{if(l.length!==u.length)return!1;var c=[...l].sort(),h=[...u].sort();return c.every((d,v)=>d===h[v])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),n=s?this.pr(e):this.Je,a=this.gr(e);if(s||a!==this.hr){var o=this.props;this.clear(),this.Je=n,this.hr=a,this.props=o,this.save()}}set_disabled(e){this.yr=e,this.yr?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.Ar&&(this.Ar=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var r=this.props[Yt]||{};r[e]=t,this.Tr(Yt,r),this.save()}remove_event_timer(e){var t=this.props[Yt]||{},r=t[e];return w(r)||(delete t[e],this.Tr(Yt,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this.Tr(e,t),this.save()}Tr(e,t){var r;this.props[e]=t,(r=tt(e))!=null&&r.volatile||this.Dr(e)}Mr(e){delete this.props[e],this.Dr(e)}Dr(e){var t,r=(t=tt(e))==null?void 0:t.storageGroup;r&&(this.kr(r).dirty=!0)}kr(e){return this.lr[e]||(this.lr[e]={})}}var jt={Activation:"events",Cancellation:"cancelEvents"},Tr={Popover:"popover",API:"api",Widget:"widget"},Ke={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Pr={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},xs={Popover:"popover",Inline:"inline"},pc={SHOWN:"product tour shown"},Dn={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},Nn=Z("[RateLimiter]");class vc{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var r=t.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach(s=>{Nn.info((s||"events")+" is quota limited."),this.serverLimits[s]=new Date().getTime()+6e4})}catch(s){return void Nn.warn('could not rate limit - continuing. Error: "'+(s==null?void 0:s.message)+'"',{text:r})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,s;e===void 0&&(e=!1);var n=this.captureEventsBurstLimit,a=this.captureEventsPerSecond,o=new Date().getTime(),l=(t=(r=this.instance.persistence)==null?void 0:r.get_property(gs))!==null&&t!==void 0?t:{tokens:n,last:o};l.tokens+=(o-l.last)/1e3*a,l.last=o,l.tokens>n&&(l.tokens=n);var u=1>l.tokens;return u||e||(l.tokens=Math.max(0,l.tokens-1)),!u||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(s=this.instance.persistence)==null||s.set_property(gs,l),{isRateLimited:u,remainingTokens:l.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var Ht=Z("[RemoteConfig]");class Ro{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=F._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}qr(e){var t,r;(t=F.__PosthogExtensions__)!=null&&t.loadExternalDependency?(r=F.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}jr(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 Ht.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void Ht.warn("Remote config is disabled. Falling back to local config.");this.qr(e=>{if(!e)return Ht.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr(t=>{this.Hr(t),this.Br()});this.Hr(e),this.Br()})}catch(e){Ht.error("Error loading remote config",e)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}refresh(){!this._instance.Ur()&&T&&T.visibilityState!=="hidden"&&this._instance.reloadFeatureFlags()}Br(){var e;if(!this.zr){var t=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;t!==0&&(this.zr=setInterval(()=>{this.refresh()},t))}}Hr(e){var t;e||Ht.error("Failed to fetch remote config from PostHog."),this._instance.Hr(e?{ok:!0,config:e}:{ok:!1}),(e==null?void 0:e.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}}var ve={GZipJS:"gzip-js",Base64:"base64"},Fe=Uint8Array,be=Uint16Array,Ct=Uint32Array,Ks=new Fe([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]),Js=new Fe([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]),jn=new Fe([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Mo=function(i,e){for(var t=new be(31),r=0;31>r;++r)t[r]=e+=1<<i[r-1];var s=new Ct(t[30]);for(r=1;30>r;++r)for(var n=t[r];t[r+1]>n;++n)s[n]=n-t[r]<<5|r;return[t,s]},Co=Mo(Ks,2),Es=Co[1];Co[0][28]=258,Es[258]=28;for(var Hn=Mo(Js,0)[1],Oo=new be(32768),V=0;32768>V;++V){var mt=(43690&V)>>>1|(21845&V)<<1;Oo[V]=((65280&(mt=(61680&(mt=(52428&mt)>>>2|(13107&mt)<<2))>>>4|(3855&mt)<<4))>>>8|(255&mt)<<8)>>>1}var ri=function(i,e,t){for(var r=i.length,s=0,n=new be(e);r>s;++s)++n[i[s]-1];var a,o=new be(e);for(s=0;e>s;++s)o[s]=o[s-1]+n[s-1]<<1;for(a=new be(r),s=0;r>s;++s)a[s]=Oo[o[i[s]-1]++]>>>15-i[s];return a},ht=new Fe(288);for(V=0;144>V;++V)ht[V]=8;for(V=144;256>V;++V)ht[V]=9;for(V=256;280>V;++V)ht[V]=7;for(V=280;288>V;++V)ht[V]=8;var ir=new Fe(32);for(V=0;32>V;++V)ir[V]=5;var fc=ri(ht,9),gc=ri(ir,5),Ao=function(i){return(i/8>>0)+(7&i&&1)},Lo=function(i,e,t){(t==null||t>i.length)&&(t=i.length);var r=new(i instanceof be?be:i instanceof Ct?Ct:Fe)(t-e);return r.set(i.subarray(e,t)),r},Ne=function(i,e,t){var r=e/8>>0;i[r]|=t<<=7&e,i[r+1]|=t>>>8},qt=function(i,e,t){var r=e/8>>0;i[r]|=t<<=7&e,i[r+1]|=t>>>8,i[r+2]|=t>>>16},$r=function(i,e){for(var t=[],r=0;i.length>r;++r)i[r]&&t.push({s:r,f:i[r]});var s=t.length,n=t.slice();if(!s)return[new Fe(0),0];if(s==1){var a=new Fe(t[0].s+1);return a[t[0].s]=1,[a,1]}t.sort(function($,D){return $.f-D.f}),t.push({s:-1,f:25001});var o=t[0],l=t[1],u=0,c=1,h=2;for(t[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=s-1;)o=t[t[h].f>t[u].f?u++:h++],l=t[u!=c&&t[h].f>t[u].f?u++:h++],t[c++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(r=1;s>r;++r)n[r].s>d&&(d=n[r].s);var v=new be(d+1),p=ks(t[c-1],v,0);if(p>e){r=0;var f=0,b=p-e,m=1<<b;for(n.sort(function($,D){return v[D.s]-v[$.s]||$.f-D.f});s>r;++r){var k=n[r].s;if(e>=v[k])break;f+=m-(1<<p-v[k]),v[k]=e}for(f>>>=b;f>0;){var E=n[r].s;e>v[E]?f-=1<<e-v[E]++-1:++r}for(;r>=0&&f;--r){var S=n[r].s;v[S]==e&&(--v[S],++f)}p=e}return[new Fe(v),p]},ks=function(i,e,t){return i.s==-1?Math.max(ks(i.l,e,t+1),ks(i.r,e,t+1)):e[i.s]=t},qn=function(i){for(var e=i.length;e&&!i[--e];);for(var t=new be(++e),r=0,s=i[0],n=1,a=function(l){t[r++]=l},o=1;e>=o;++o)if(i[o]==s&&o!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=i[o]}return[t.subarray(0,r),e]},zt=function(i,e){for(var t=0,r=0;e.length>r;++r)t+=i[r]*e[r];return t},Ss=function(i,e,t){var r=t.length,s=Ao(e+2);i[s]=255&r,i[s+1]=r>>>8,i[s+2]=255^i[s],i[s+3]=255^i[s+1];for(var n=0;r>n;++n)i[s+n+4]=t[n];return 8*(s+4+r)},zn=function(i,e,t,r,s,n,a,o,l,u,c){Ne(e,c++,t),++s[256];for(var h=$r(s,15),d=h[0],v=h[1],p=$r(n,15),f=p[0],b=p[1],m=qn(d),k=m[0],E=m[1],S=qn(f),$=S[0],D=S[1],A=new be(19),y=0;k.length>y;++y)A[31&k[y]]++;for(y=0;$.length>y;++y)A[31&$[y]]++;for(var P=$r(A,7),I=P[0],M=P[1],R=19;R>4&&!I[jn[R-1]];--R);var N,z,K,j,te=u+5<<3,ie=zt(s,ht)+zt(n,ir)+a,we=zt(s,d)+zt(n,f)+a+14+3*R+zt(A,I)+(2*A[16]+3*A[17]+7*A[18]);if(ie>=te&&we>=te)return Ss(e,c,i.subarray(l,l+u));if(Ne(e,c,1+(ie>we)),c+=2,ie>we){N=ri(d,v),z=d,K=ri(f,b),j=f;var Se=ri(I,M);for(Ne(e,c,E-257),Ne(e,c+5,D-1),Ne(e,c+10,R-4),c+=14,y=0;R>y;++y)Ne(e,c+3*y,I[jn[y]]);c+=3*R;for(var _e=[k,$],xe=0;2>xe;++xe){var X=_e[xe];for(y=0;X.length>y;++y)Ne(e,c,Se[ae=31&X[y]]),c+=I[ae],ae>
2215&&(Ne(e,c,X[y]>>>5&127),c+=X[y]>>>12)}}else N=fc,z=ht,K=gc,j=ir;for(y=0;o>y;++y)if(r[y]>255){var ae;qt(e,c,N[257+(ae=r[y]>>>18&31)]),c+=z[ae+257],ae>7&&(Ne(e,c,r[y]>>>23&31),c+=Ks[ae]);var oe=31&r[y];qt(e,c,K[oe]),c+=j[oe],oe>3&&(qt(e,c,r[y]>>>5&8191),c+=Js[oe])}else qt(e,c,N[r[y]]),c+=z[r[y]];return qt(e,c,N[256]),c+z[256]},_c=new Ct([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),mc=function(){for(var i=new Ct(256),e=0;256>e;++e){for(var t=e,r=9;--r;)t=(1&t&&3988292384)^t>>>1;i[e]=t}return i}(),Fr=function(i,e,t){for(;t;++e)i[e]=t,t>>>=8};function yc(i,e){e===void 0&&(e={});var t=function(){var h=4294967295;return{p(d){for(var v=h,p=0;d.length>p;++p)v=mc[255&v^d[p]]^v>>>8;h=v},d(){return 4294967295^h}}}(),r=i.length;t.p(i);var s,n,a,o,l,u=(o=10+((s=e).filename&&s.filename.length+1||0),l=8,function(h,d,v,p,f,b){var m=h.length,k=new Fe(p+m+5*(1+Math.floor(m/7e3))+f),E=k.subarray(p,k.length-f),S=0;if(!d||8>m)for(var $=0;m>=$;$+=65535){var D=$+65535;m>D?S=Ss(E,S,h.subarray($,D)):(E[$]=!0,S=Ss(E,S,h.subarray($,m)))}else{for(var A=_c[d-1],y=A>>>13,P=8191&A,I=(1<<v)-1,M=new be(32768),R=new be(I+1),N=Math.ceil(v/3),z=2*N,K=function(hr){return(h[hr]^h[hr+1]<<N^h[hr+2]<<z)&I},j=new Ct(25e3),te=new be(288),ie=new be(32),we=0,Se=0,_e=($=0,0),xe=0,X=0;m>$;++$){var ae=K($),oe=32767&$,le=R[ae];if(M[oe]=le,R[ae]=oe,$>=xe){var Ye=m-$;if((we>7e3||_e>24576)&&Ye>423){S=zn(h,E,0,j,te,ie,Se,_e,X,$-X,S),_e=we=Se=0,X=$;for(var pe=0;286>pe;++pe)te[pe]=0;for(pe=0;30>pe;++pe)ie[pe]=0}var Ie=2,Ve=0,me=P,Re=oe-le&32767;if(Ye>2&&ae==K($-Re))for(var pi=Math.min(y,Ye)-1,Ot=Math.min(32767,$),vi=Math.min(258,Ye);Ot>=Re&&--me&&oe!=le;){if(h[$+Ie]==h[$+Ie-Re]){for(var Te=0;vi>Te&&h[$+Te]==h[$+Te-Re];++Te);if(Te>Ie){if(Ie=Te,Ve=Re,Te>pi)break;var fi=Math.min(Re,Te-2),At=0;for(pe=0;fi>pe;++pe){var cr=$-Re+pe+32768&32767,Zs=cr-M[cr]+32768&32767;Zs>At&&(At=Zs,le=cr)}}}Re+=(oe=le)-(le=M[oe])+32768&32767}if(Ve){j[_e++]=268435456|Es[Ie]<<18|Hn[Ve];var Xs=31&Es[Ie],Qs=31&Hn[Ve];Se+=Ks[Xs]+Js[Qs],++te[257+Xs],++ie[Qs],xe=$+Ie,++we}else j[_e++]=h[$],++te[h[$]]}}S=zn(h,E,!0,j,te,ie,Se,_e,X,$-X,S)}return Lo(k,0,p+Ao(S)+f)}(n=i,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+a.mem,o,l)),c=u.length;return function(h,d){var v=d.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>d.level?4:d.level==9?2:0,h[9]=3,d.mtime!=0&&Fr(h,4,Math.floor(new Date(d.mtime||Date.now())/1e3)),v){h[3]=8;for(var p=0;v.length>=p;++p)h[p+10]=v.charCodeAt(p)}}(u,e),Fr(u,c-8,t.d()),Fr(u,c-4,r),u}var bc=!!Wr||!!Cs,Do="text/plain",Ci=!1,Ts=(i,e)=>{var t=i.split("#"),r=t[1],s=t[0].split("?"),n=s[0],a=s[1];if(!a)return i;var o=a.split("&").filter(l=>l.split("=")[0]!==e).join("&");return n+(o?"?"+o:"")+(r?"#"+r:"")},Ys=function(i,e,t){var r;t===void 0&&(t=!0);var s=i.split("?"),n=s[0],a=s[1],o=_({},e),l=(r=a==null?void 0:a.split("&").map(c=>{var h,d=c.split("="),v=d[0],p=t&&(h=o[v])!==null&&h!==void 0?h:d[1];return delete o[v],v+"="+p}))!==null&&r!==void 0?r:[],u=function(c,h){var d,v;h===void 0&&(h="&");var p=[];return G(c,function(f,b){w(f)||w(b)||b==="undefined"||(d=encodeURIComponent((m=>m instanceof File)(f)?f.name:f.toString()),v=encodeURIComponent(b),p[p.length]=v+"="+d)}),p.join(h)}(o);return u&&l.push(u),l.length>0?n+"?"+l.join("&"):n},Ir=i=>{if(i.Vr)return i.Vr;var e=i.data,t=i.compression;if(e){if(t===ve.GZipJS){var r=yc(function(o,l){var u=o.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var c=new Fe(o.length+(o.length>>>1)),h=0,d=function(b){c[h++]=b},v=0;u>v;++v){if(h+5>c.length){var p=new Fe(h+8+(u-v<<1));p.set(c),c=p}var f=o.charCodeAt(v);128>f?d(f):2048>f?(d(192|f>>>6),d(128|63&f)):f>55295&&57344>f?(d(240|(f=65536+(1047552&f)|1023&o.charCodeAt(++v))>>>18),d(128|f>>>12&63),d(128|f>>>6&63),d(128|63&f)):(d(224|f>>>12),d(128|f>>>6&63),d(128|63&f))}return Lo(c,0,h)}(kt(e)),{mtime:0});return{contentType:Do,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(t===ve.Base64){var s=function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,(l,u)=>String.fromCharCode(parseInt(u,16))))}(kt(e)),n=(o=>
22"data="+encodeURIComponent(typeof o=="string"?o:kt(o)))(s);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var a=kt(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},No=i=>{var e,t,r=()=>i.transport==="sendBeacon"?{url:Ys(i.url,{compression:ve.Base64}),encodedBody:Ir(_({},i,{compression:ve.Base64,Vr:void 0}))}:{url:Ts(i.url,"compression"),encodedBody:Ir(_({},i,{compression:void 0,Vr:void 0}))};try{e=Ir(i)}catch(s){if(dn(i.compression,Rt(i.url,"compression")))return x.error("Failed to gzip request body, sending uncompressed payload",s),r();throw s}return e&&dn(i.compression,Rt(i.url,"compression"))&&!((t=e.body)instanceof ArrayBuffer?Kr(new Uint8Array(t)):ArrayBuffer.isView(t)&&Kr(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))?(Ci=!0,r()):{url:i.url,encodedBody:e}},jo=i=>{try{return No(i)}catch(e){return x.error(e),void(i.callback==null||i.callback({statusCode:0,error:e}))}},wc=function(){var i=re(function*(e){var t=kt(e.data),r=yield function(n,a,o){return Jr.apply(this,arguments)}(t,U.DEBUG,{rethrow:!0});if(!r)return e;var s=yield r.arrayBuffer();return _({},e,{Vr:{contentType:Do,body:s,estimatedSize:s.byteLength}})});return function(e){return i.apply(this,arguments)}}(),xc=/Failed to fetch|NetworkError|Load failed/i,Ho=i=>{var e=jo(i);if(e){var t=e.url,r=e.encodedBody,s=r??{},n=s.contentType,a=s.body,o=s.estimatedSize,l=new Headers;G(i.headers,function(p,f){l.append(f,p)}),n&&l.append("Content-Type",n);var u=null,c=!1;if(nn){var h=new nn;u={signal:h.signal,timeout:setTimeout(()=>{var p,f;c=!0,h.abort((p=i.timeout,(f=new Error("PostHog request timed out"+(p?" after "+p+"ms":""))).name="AbortError",f))},i.timeout)}}var d=p=>{c&&(p==null?void 0:p.name)==="AbortError"||(f=>(f==null?void 0:f.name)==="TypeError"&&xc.test((f==null?void 0:f.message)||""))(p)?x.warn(p):x.error(p),i.callback==null||i.callback({statusCode:0,error:p})};try{var v;Cs(t,_({method:(i==null?void 0:i.method)||"GET",headers:l,keepalive:i.method==="POST"&&!i.Wr&&52428.8>(o||0),body:a,signal:(v=u)==null?void 0:v.signal},i.fetchOptions)).then(p=>p.text().then(f=>{var b={statusCode:p.status,text:f};if(p.status===200)try{b.json=JSON.parse(f)}catch(m){x.error(m)}i.callback==null||i.callback(b)})).catch(d).finally(()=>u?clearTimeout(u.timeout):null)}catch(p){u&&clearTimeout(u.timeout),d(p)}}},Ps=i=>{try{var e=No(i),t=e.url,r=e.encodedBody,s=r??{},n=s.body,a=s.estimatedSize;if(!n)return;var o=n instanceof Blob?n:new Blob([n],{type:s.contentType});if(fe.sendBeacon(t,o))return;if(L(i.data)&&i.data.length>1&&(a??0)>16384){var l=Math.ceil(i.data.length/2);return Ps(_({},i,{data:i.data.slice(0,l)})),void Ps(_({},i,{data:i.data.slice(l)}))}x.warn("Beacon of ~"+(a??0)+" bytes was rejected by the browser, falling back to fetch"),Ho(_({},i,{Wr:!0}))}catch(u){x.warn("Beacon send failed",u)}},Ec=["/e/","/s/"],Un=(i,e,t,r)=>{var s=(o=>{var l=(u=>{var c=ci(u),h=(c==null?void 0:c.pathname)||u.split(/[?#]/)[0];return h?h[0]==="/"?h:"/"+h:"/"})(o);return Ec.some(u=>((c,h)=>c.slice(c.length-h.length)===h)(l,u))})(i),n=s?Ts(i,"ver"):i,a=r==="query"?e==="POST"?"sent_at":"_":void 0;return Ys(t===ve.GZipJS?Ts(n,"compression"):n,_({},a?{[a]:Date.now().toString()}:{},s?{}:{ver:U.JS_SDK_VERSION},t===ve.GZipJS?{}:{compression:t}))},Oi=[];Cs&&Oi.push({transport:"fetch",method:Ho}),Wr&&Oi.push({transport:"XHR",method(i){var e=jo(i);if(e){var t=new Wr,r=e.encodedBody;t.open(i.method||"GET",e.url,!0);var s=r??{},n=s.contentType,a=s.body;G(i.headers,function(o,l){t.setRequestHeader(l,o)}),n&&t.setRequestHeader("Content-Type",n),i.timeout&&(t.timeout=i.timeout),t.onreadystatechange=()=>{if(t.readyState===4){var o={statusCode:t.status,text:t.responseText};if(t.status===200)try{o.json=JSON.parse(t.responseText)}catch{}i.callback==null||i.callback(o)}},t.send(a)}}}),fe!=null&&fe.sendBeacon&&Oi.push({transport:"sendBeacon",method:Ps});var $s=3e3;class kc{constructor(e,t){this.Zr=!0,this.Gr=[],this.Qr=Le((t==null?void 0:t.flush_interval_ms)||$s,250,5e3,x.createLogger("flush interval"),$s),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}
22unload(){this.Xr();var e=this.Gr.length>0?this.ti():{},t=Object.values(e);[...t.filter(r=>r.url.indexOf("/e")===0),...t.filter(r=>r.url.indexOf("/e")!==0)].map(r=>{this.ei(_({},r,{transport:"sendBeacon"}))})}enable(){this.Zr=!1,this.Yr()}Yr(){var e=this;this.Zr||(this.Kr=setTimeout(()=>{if(this.Xr(),this.Gr.length>0){var t=this.ti(),r=function(){var n=t[s],a=new Date().getTime();n.data&&L(n.data)&&G(n.data,o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp}),e.ei(n)};for(var s in t)r()}},this.Qr))}ei(e){try{this.Jr(e)}catch(t){x.error(t)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ti(){var e={};return G(this.Gr,t=>{var r,s=t,n=(s?s.batchKey:null)||s.url;w(e[n])&&(e[n]=_({},s,{data:[]})),(r=e[n].data)==null||r.push(s.data)}),this.Gr=[],e}}var Sc=["retriesPerformedSoFar"];class Tc{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!w(g)&&"onLine"in g.navigator&&(this.ni=g.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},ee(g,"online",this.si),ee(g,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var t=e.retriesPerformedSoFar,r=va(e,Sc);qe(t)&&(r.url=Ys(r.url,{retry_count:t})),this._instance._send_request(_({},r,{callback:s=>{if(s.statusCode!==200&&(400>s.statusCode||s.statusCode>=500)){if((s.statusCode===0?3:10)>(t??0))return void this.Ot(_({retriesPerformedSoFar:t},r));s.statusCode===0&&x.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(t??0)+" retries.")}r.callback==null||r.callback(s)}}))}Ot(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=function(a){var o=3e3*Math.pow(2,a),l=o/2,u=Math.min(18e5,o),c=Math.random()-.5;return Math.ceil(u+c*(u-l))}(t),s=Date.now()+r;this.Gr.push({retryAt:s,requestOptions:e});var n="Enqueued failed request for retry in "+r;navigator.onLine||(n+=" (Browser is offline)"),x.warn(n),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),this.Gr.length===0)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout(()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()},this.ii)}oi(){var e=Date.now(),t=[],r=this.Gr.filter(n=>e>n.retryAt||(t.push(n),!1));if(this.Gr=t,r.length>0)for(var s of r)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,w(g)||(this.si&&(g.removeEventListener("online",this.si),this.si=void 0),this.ai&&(g.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var t=e.requestOptions;try{this._instance._send_request(_({},t,{transport:"sendBeacon"}))}catch(r){x.error(r)}}this.Gr=[]}}class Pc{constructor(e){this.hi=()=>{var t,r,s,n;this.di||(this.di={});var a=this.scrollElement(),o=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,u=o+((a==null?void 0:a.clientHeight)||0),c=(a==null?void 0:a.scrollHeight)||0;this.di.lastScrollY=Math.ceil(o),this.di.maxScrollY=Math.max(o,(t=this.di.maxScrollY)!==null&&t!==void 0?t:0),this.di.maxScrollHeight=Math.max(l,(r=this.di.maxScrollHeight)!==null&&r!==void 0?r:0),this.di.lastContentY=u,this.di.maxContentY=Math.max(u,(s=this.di.maxContentY)!==null&&s!==void 0?s:0),this.di.maxContentHeight=Math.max(c,(n=this.di.maxContentHeight)!==null&&n!==void 0?n:0)},this._instance=e}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var e=this.di;return setTimeout(this.hi,0),e}startMeasuringScrollPosition(){ee(g,"scroll",this.hi,{capture:!0}),ee(g,"scrollend",this.hi,{capture:!0}),ee(g,"resize",this.hi)}scrollElement(){if(!this.ci)return g==null?void 0:g.document.documentElement;var e=L(this.ci)?this.ci:[this.ci];for(var t of e){var r=g==null?void 0:g.document.querySelector(t);if(r)return r}}vi(e){var t=e==="y"?"scrollTop":"scrollLeft";if(this.ci){var r=this.scrollElement();return r&&r[t]||0}return g?e==="y"?g.scrollY||g.pageYOffset||g.document.documentElement.scrollTop||0:g.scrollX||g.pageXOffset||g.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var $c=i=>$o(i==null?void 0:i.config.mask_personal_data_properties,i==null?void 0:i.config.custom_personal_data_properties,i==null?void 0:i.config.disable_capture_url_hashes
22);class Bn{constructor(e,t,r,s){this.fi=n=>{var a=this.pi();if(!a||a.sessionId!==n){var o={sessionId:n,props:this.gi(this._instance)};this.mi.register({[fs]:o})}},this._instance=e,this.yi=t,this.mi=r,this.gi=s||$c,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[fs]}getSetOnceProps(){var e,t=(e=this.pi())==null?void 0:e.props;return t?"r"in t?Fo(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return G(Us(this.getSetOnceProps()),(t,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Yr(r)]=t}),e}}class Vs{on(e,t){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(t),()=>{this.bi[e]=this.bi[e].filter(r=>r!==t)}}emit(e,t){for(var r of this.bi[e]||[])r(t);for(var s of this.bi["*"]||[])s(e,t)}constructor(){this.bi={}}}var Ut=Z("[SessionId]");class Gn{on(e,t){return this.wi.on(e,t)}constructor(e,t,r){var s;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new Vs,this.Ii=(u,c)=>!(!qe(u)||!qe(c))&&Math.abs(u-c)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===Ge)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ti=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=t||Be,this.Ri=r||Be;var n=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*Le(this.Te.session_idle_timeout_seconds||1800,60,36e3,Ut.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+n+"_window_id",this.Fi="ph_"+n+"_primary_window_exists",this.Li()){var a=ue.F(this.Oi),o=ue.F(this.Fi);a&&!o?this.Ti=a:ue.P(this.Oi),ue.q(this.Fi,!0)}if((s=this.Te.bootstrap)!=null&&s.sessionID)try{var l=(u=>{var c=this.Te.bootstrap.sessionID.replace(/-/g,"");if(c.length!==32)throw new Error("Not a valid UUID");if(c[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(c.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,new Date().getTime(),l)}catch(u){Ut.error("Invalid sessionID in bootstrap",u)}this.Ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return w(this.ki)&&(this.ki=[]),this.ki.push(e),this.Mi&&e(this.Mi,this.Ti),()=>{this.ki=this.ki.filter(t=>t!==e)}}Li(){return this.Te.persistence!=="memory"&&!this.mi.yr&&ue.N()}Ni(e){e!==this.Ti&&(this.Ti=e,this.Li()&&ue.q(this.Oi,e))}Di(){return this.Ti?this.Ti:this.Li()?ue.F(this.Oi):null}qi(e){var t=this.xi;return!ge(t)&&!ge(e)&&5e3>Math.abs(e-t)}$i(e,t,r){var s=t!==this._sessionActivityTimestamp,n=!(e!==this.Mi||r!==this._sessionStartTimestamp);this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.Mi=e,n&&!s||n&&this.qi(t)||(this.xi=t,this.mi.register({[Et]:[t,e,r]}))}ji(){var e,t=(e=this.Te)==null?void 0:e.persistence_save_debounce_ms;return qe(t)&&t>0}Hi(){this.ji()?this.mi.refreshKey(Et):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!ge(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var t=this.Ui();t[1]===this.Mi&&t[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[Et]:[this._sessionActivityTimestamp,(e=this.Mi)!==null&&e!==void 0?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],t=qe(e)?e:0,r=qe(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,r)}Vi(e){return this.Hi(),this.Ii(e,this.zi())}Ui(){var e=this.mi.props[Et];return L(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&g&&(g.removeEventListener(Zi,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Ai(){this.Si=()=>{this.Bi(),this.Li()&&ue.P(this.Fi)},ee(g,Zi,this.Si,{capture:!1})}
22checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.Te.cookieless_mode===Ge)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||new Date().getTime(),s=this.Ui(),n=s[1],a=s[2],o=this.zi(),l=this.Di(),u=qe(a)&&Math.abs(r-a)>864e5,c=!1,h=!1,d=!n,v=n,p=!d&&!e&&this.Ii(r,o);if(p){(p=this.Vi(r))||Ut.info("cross-tab refresh kept the session alive",{sessionId:n});var f=this.Ui();n=f[1],a=f[2]}d||p||u?(n=this.Ei(),l=this.Ri(),Ut.info("new session ID generated",{sessionId:n,windowId:l,changeReason:{noSessionId:d,activityTimeout:p,sessionPastMaximumLength:u}}),a=r,c=!0):(l||(l=this.Ri(),c=!0),(h=n!==v)&&(Ut.info("adopted cross-tab session id",{sessionId:n,windowId:l}),c=!0));var b=qe(o)&&e&&!u?o:r,m=qe(a)?a:new Date().getTime();this.Ni(l),this.$i(n,b,m),e||this.Pi();var k={noSessionId:d,activityTimeout:p,sessionPastMaximumLength:u,crossTabAdoption:h};return c&&this.ki.forEach(E=>E(n,l,k)),{sessionId:n,windowId:l,sessionStartTimestamp:m,changeReason:c?k:void 0,lastActivityTimestamp:o}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout(()=>{if(!this.Ci)if(this.Vi(new Date().getTime())){var e=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()},1.1*this.sessionTimeoutMs))}}var qo=function(i,e){if(!i)return!1;var t=i.userAgent;if(t&&vn(t,e))return!0;try{var r=i==null?void 0:i.userAgentData;if(r!=null&&r.brands&&r.brands.some(s=>vn(s==null?void 0:s.brand,e)))return!0}catch{}return!!i.webdriver};function zo(){return(zo=re(function*(){var i=fe==null?void 0:fe.userAgentData;if(i!=null&&i.getHighEntropyValues)try{var e=yield i.getHighEntropyValues(["model"]),t=e==null?void 0:e.model;return B(t)&&t.length>0?t:void 0}catch(r){return void x.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",r)}})).apply(this,arguments)}var rr=function(i,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(i)}catch{return!1}};function Wn(i,e,t){return kt({distinct_id:i,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var Uo={exact:(i,e)=>e.some(t=>i.some(r=>t===r)),is_not:(i,e)=>e.every(t=>i.every(r=>t!==r)),regex:(i,e)=>e.some(t=>i.some(r=>rr(t,r))),not_regex:(i,e)=>e.every(t=>i.every(r=>!rr(t,r))),icontains:(i,e)=>e.map(Si).some(t=>i.map(Si).some(r=>t.includes(r))),not_icontains:(i,e)=>e.map(Si).every(t=>i.map(Si).every(r=>!t.includes(r))),gt:(i,e)=>e.some(t=>{var r=parseFloat(t);return!isNaN(r)&&i.some(s=>r>parseFloat(s))}),lt:(i,e)=>e.some(t=>{var r=parseFloat(t);return!isNaN(r)&&i.some(s=>r<parseFloat(s))})},Si=i=>i.toLowerCase();function Bo(i,e){return!i||Object.entries(i).every(t=>{var r=t[1],s=e==null?void 0:e[t[0]];if(w(s)||ge(s))return!1;var n=[String(s)],a=Uo[r.operator];return!!a&&a(r.values,n)})}var Fs="custom",Kn="i.posthog.com",Fc=/^\/static\//;class Ic{constructor(e){this.Zi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+Kn,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.Zi[this.apiHost]||(this.Zi[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Fs),this.Zi[this.apiHost]}Gi(e){if(Fc.test(e)){var t=this.instance.config.asset_host;if(typeof t=="string")return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(e==="flags")return this.flagsApiHost+t;if(e==="assets"){var r=this.Gi(t);if(r)return""+r+t}if(this.region===Fs)return this.apiHost+t;var s=Kn+t;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}function Go(i){var e;return!((e=i.conditions)==null||(e=e.events)==null||(e=e.values)==null||!e.length)}var q=Z("[Surveys]"),Wo="seenSurvey_",Ko=i=>{try{var e=(t=>((r,s)=>""+Wo+function(n){return n.current_iteration&&n.current_iteration>0?n.id+"_"+n.current_iteration:n.id}(s))(0,t))(i);if(localStorage.getItem(e))return;localStorage.setItem(e,"true")}catch(t){q.error("Failed to persist survey seen state",t)}},Rc=[Tr.Popover,Tr.Widget,Tr.API],Mc={ignoreConditions:!1,ignoreDelay:!1,displayType:xs.Popover}
22,Cc=Z("[PostHog ExternalIntegrations]"),Oc={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Ac{constructor(e){this._instance=e}tr(e,t){var r;(r=F.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,s=>{if(s)return Cc.error("failed to load script",s);t()})}startIfEnabledOrStop(){var e=this,t=function(){var n,a,o,l=r[0],u=r[1];!u||(n=F.__PosthogExtensions__)!=null&&(n=n.integrations)!=null&&n[l]||e.tr(Oc[l],()=>{var c;(c=F.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[l])==null||c.start(e._instance)}),!u&&(a=F.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[l]&&((o=F.__PosthogExtensions__)==null||(o=o.integrations)==null||(o=o[l])==null||o.stop())};for(var r of Object.entries((s=this._instance.config.integrations)!==null&&s!==void 0?s:{})){var s;t()}}}var si={},Rr=0,sr=()=>{},Jn='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Bt="Surveys module not available",Yn="sanitize_properties is deprecated. Use before_send instead",Jo="Invalid value for property_denylist config: ",Lc=["token","distinct_id",Qa],xt="posthog",Yo=!bc&&(ye==null?void 0:ye.indexOf("MSIE"))===-1&&(ye==null?void 0:ye.indexOf("Mozilla"))===-1,Mr=i=>{var e;return _({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Nu(T==null?void 0:T.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:sr,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:i??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:se&&B(se==null?void 0:se.search)&&se.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:(g==null||(e=g.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(t){x.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:ys,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:$s},error_tracking:{},_onCapture:sr},(t=>({rageclick:t&&t>="2026-05-30"?{content_ignorelist:Vu,ignore_text_selection:!0}
22:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:t&&t>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:t&&t>="2026-05-30"?250:0,split_storage:!(!t||"2026-05-30">t),detect_google_search_app:!(!t||"2026-05-30">t),disable_capture_url_hashes:!(!t||"2026-06-25">t)}))(i))},Dc=[["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"]],Vn=i=>{var e={};for(var t of Dc){var r=t[0],s=t[1];w(i[r])||(e[s]=i[r])}var n=J({},e,i),a=i.__preview_external_dependency_versioned_paths;return w(a)||(w(i.strict_script_versioning)&&(n.strict_script_versioning=!!a),B(a)&&w(i.asset_host)&&(n.asset_host=a)),L(i.property_blacklist)&&(w(i.property_denylist)?n.property_denylist=i.property_blacklist:L(i.property_denylist)?n.property_denylist=[...i.property_blacklist,...i.property_denylist]:x.error(Jo+i.property_denylist)),n};class Nc{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){x.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class $e{Ji(e,t){if(e){var r=this.Ki.indexOf(e);r!==-1&&this.Ki.splice(r,1)}return this.Ki.push(t),t.initialize==null||t.initialize(),t}Yi(){return this.config.cookieless_mode===Ge||this.config.cookieless_mode===ot&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new Nc,this.Xi=!1,this.version=U.LIB_VERSION,this.tn=new Vs,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=Mr(),this.SentryIntegration=nc,this.sentryIntegration=r=>function(s,n){var a=wo(s,n);return{name:bo,processEvent:o=>a(o)}}(this,r),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.en=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new Pc(this),this.pageViewManager=new An(this),this.rateLimiter=new vc(this),this.requestRouter=new Ic(this),this.consent=new Gu(this),this.externalIntegrations=new Ac(this);var t=(e=$e.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(r,s,n)=>{var a=B(r)?{[r]:s}:r;this.setPersonProperties(a),n==null||n({})},set_once:(r,s,n)=>{var a=B(r)?{[r]:s}:r;this.setPersonProperties(void 0,a),n==null||n({})}},this.on("eventCaptured",r=>x.info('send "'+(r==null?void 0:r.event)+'"',r))}init(e,t,r){if(r&&r!==xt){var s,n=(s=si[r])!==null&&s!==void 0?s:new $e;return n._init(e,t,r),si[r]=n,si[xt][r]=n,n}return this._init(e,t,r)}_init(e,t,r){var s,n;t===void 0&&(t={});var a=B(e)?e.trim():"";if(!a)return x.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=Mr(t.defaults),t.debug=this.an(t.debug),this.ln=t,this.un=[],t.person_profiles?this.nn=t.person_profiles:t.process_person&&(this.nn=t.process_person);var o=Mr(t.defaults),l=Vn(t),u=J({},o,l,{name:r,token:a});
22Y(o.rageclick)&&Y(l.rageclick)&&(u.rageclick=J({},o.rageclick,l.rageclick)),Y(o.session_recording)&&Y(l.session_recording)&&(u.session_recording=J({},o.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&x.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:ve.GZipJS;var c=this.hn();this.persistence=new Sr(this.config,c),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Sr(_({},this.config,{persistence:"sessionStorage"}),c,!1);var h=_({},this.persistence.props),d=_({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.dn=new kc(S=>this.cn(S),this.config.request_queue_config),this.vn=new Tc(this),this.__request_queue=[];var v=this.Yi();if(v||(this.sessionManager=new Gn(this),this.sessionPropsManager=new Bn(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(x.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.fn(v)},0)):(x.info("Initializing extensions synchronously"),this.fn(v)),U.DEBUG=U.DEBUG||this.config.debug,U.DEBUG&&x.info("Starting in debug mode",{this:this,config:t,thisC:_({},this.config),p:h,s:d}),!this.config.identity_distinct_id||(s=t.bootstrap)!=null&&s.distinctID||(t.bootstrap=_({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((n=t.bootstrap)==null?void 0:n.distinctID)!==void 0){var p=t.bootstrap.distinctID,f=this.get_distinct_id(),b=this.persistence.get_property(Me);if(t.bootstrap.isIdentifiedID&&f!=null&&f!==p&&b===ft)this.identify(p);else if(t.bootstrap.isIdentifiedID&&f!=null&&f!==p&&b===gt)x.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var m=this.config.get_device_id(Be()),k=t.bootstrap.isIdentifiedID?m:p;this.persistence.set_property(Me,t.bootstrap.isIdentifiedID?gt:ft),this.register({distinct_id:p,$device_id:k})}}if(v)this.register_once({distinct_id:bi,$device_id:null},"");else if(!this.get_distinct_id()){var E=this.config.get_device_id(Be());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(Me,ft)}return ee(g,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(S,$){var D=S.config.segment;if(!D)return $();(function(A,y){var P=A.config.segment;if(!P)return y();var I=R=>{var N=()=>R.anonymousId()||Be();A.config.get_device_id=N,R.id()&&(A.register({distinct_id:R.id(),$device_id:N()}),A.persistence.set_property(Me,gt)),y()},M=P.user();"then"in M&&Ce(M.then)?M.then(I):I(M)})(S,()=>{D.register((A=>{typeof Promise<"u"&&Promise.resolve||Er.warn("This browser does not have Promise support, and can not use the segment integration");var y=(P,I)=>{if(!I)return P;P.event.userId||P.event.anonymousId===A.get_distinct_id()||(Er.info("No userId set, resetting PostHog"),A.reset()),P.event.userId&&P.event.userId!==A.get_distinct_id()&&(Er.info("UserId set, identifying with PostHog"),A.identify(P.event.userId));var M=A.calculateEventProperties(I,P.event.properties);return P.event.properties=Object.assign({},M,P.event.properties),P};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:P=>y(P,P.event.event),page:P=>y(P,wt),identify:P=>y(P,br),screen:P=>y(P,"$screen")}})(S)).then(()=>{$()})})}(this,()=>this.pn()):this.pn(),Ce(this.config._onCapture)&&this.config._onCapture!==sr&&(x.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",S=>this.config._onCapture(S.event,S))),this.config.ip&&x.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 zo.apply(this,arguments)}().then(S=>{S&&this.register({[mr]:S})}).catch(sr),this}fn(e){var t,r,s,n,a,o,l,u,c=performance.now(),h=_({},$e.__defaultExtensionClasses,this.config.__extensionClasses),d=[];h.featureFlags&&this.Ki.push(this.featureFlags=(t=this.featureFlags)!==null&&t!==void 0?t:new h.featureFlags(this)),h.exceptions&&this.Ki.push(this.exceptions=(r=this.exceptions)!==null&&r!==void 0?r:new h.exceptions(this)),h.historyAutocapture&&this.Ki.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Ki.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.Ki.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!e&&this.Ki.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||d.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),h.autocapture&&this.Ki.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.Ki.push(this.surveys=(s=this.surveys)!==null&&s!==void 0?s:new h.surveys(this)),h.logs&&this.Ki.push(this.logs=(n=this.logs)!==null&&n!==void 0?n:new h.logs(this)),h.metrics&&this.Ki.push(this.metrics=(a=this.metrics)!==null&&a!==void 0?a:new h.metrics(this)),h.conversations&&this.Ki.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new h.conversations(this)),h.productTours&&this.Ki.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Ki.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Ki.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Ki.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Ki.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,sc)),h.toolbar&&this.Ki.push(this.toolbar=(l=this.toolbar)!==null&&l!==void 0?l:new h.toolbar(this)),h.experiments&&this.Ki.push(this.experiments=(u=this.experiments)!==null&&u!==void 0?u:new h.experiments(this)),this.Ki.forEach(v=>{v.initialize&&d.push(()=>
22{v.initialize==null||v.initialize()})}),d.push(()=>{if(this.gn){var v=this.gn;this.gn=void 0,this.Hr(v)}}),this.mn(d,c)}mn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.mn(e,t)},0);var r=e.shift();if(r)try{r()}catch(n){x.error("Error initializing extension:",n)}}var s=Math.round(performance.now()-t);this.register_for_session({[eo]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[to]:s}),this.config.__preview_deferred_init_extensions&&x.info("PostHog extensions initialized ("+s+"ms)")}Hr(e){if(!T||!T.body)return x.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Hr(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.gn=e),this.yn=e,this.compression=void 0,e.ok){var t,r=e.config;r.supportedCompression&&!this.config.disable_compression&&(this.compression=C(r.supportedCompression,ve.GZipJS)?ve.GZipJS:C(r.supportedCompression,ve.Base64)?ve.Base64:void 0),(t=r.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=r.analytics.endpoint)}this.set_config({person_profiles:this.nn?this.nn:ys}),this.Ki.forEach(s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(e))}pn(){try{this.config.loaded(this)}catch(r){x.critical("`loaded` function failed",r)}if(this.bn(),this.config.internal_or_test_user_hostname&&se!=null&&se.hostname){var e=se.hostname,t=this.config.internal_or_test_user_hostname;(typeof t=="string"?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Yi())&&this._n()},1),this.wn=new Ro(this),this.wn.load()}bn(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.dn)==null||e.enable())}_dom_loaded(){this.is_capturing()&&wi(this.__request_queue,e=>this.cn(e)),this.__request_queue=[],this.bn()}_handle_unload(){var e,t,r,s,n;(e=this.surveys)==null||e.handlePageUnload==null||e.handlePageUnload(),(t=this.metrics)==null||t.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture(yr),(r=this.logs)==null||r.flushLogs("sendBeacon"),(s=this.dn)==null||s.unload(),(n=this.vn)==null||n.unload()):this.xn()&&this.capture(yr,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?Yo?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=_({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,(w(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var r,s,n,a=_({},t);a.timeout=a.timeout||6e4;var o=(r=a.transport)!==null&&r!==void 0?r:"fetch";o==="sendBeacon"&&w(a.compression)&&a.data&&(a.compression=ve.Base64),a.timestampMode==="body"&&a.method==="POST"&&a.data&&!L(a.data)&&(a.data=_({},a.data,{sent_at:new Date().toISOString()})),a.url=Un(a.url,a.method,a.compression,a.timestampMode);var l=Oi.filter(c=>!a.disableTransport||!c.transport||!a.disableTransport.includes(c.transport)),u=(s=(n=function(c,h){for(var d=0;c.length>d;d++)if(c[d].transport===o)return c[d]}(l))==null?void 0:n.method)!==null&&s!==void 0?s:l[0].method;if(!u)throw new Error("No available transport method");o!=="sendBeacon"&&a.data&&a.compression===ve.GZipJS&&Hl&&typeof Promise<"u"&&!Ci?wc(a).then(c=>{u(c)}).catch(c=>{if(pn(c))return Ci=!0,void u(_({},a,{compression:void 0,url:Un(t.url,t.method,void 0,t.timestampMode)}));(h=>{if(!h||typeof h!="object")return!1;var d="name"in h?String(h.name):"";return pn(h)||d===fa})(c)&&(Ci=!0),u(a)}):u(a)})(_({},e,{callback:t=>{var r,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(r=(s=this.config).on_request_error)==null||r.call(s,t),e.callback==null||e.callback(t)}}))):e.fireCallbackOnDrop&&(e.callback==null||e.callback({statusCode:0}))}
22cn(e){this.vn?this.vn.retriableRequest(e):this._send_request(e)}_execute_array(e){Rr++;try{var t,r=[],s=[],n=[];wi(e,o=>{if(o)if(L(t=o[0]))n.push(o);else if(Ce(o))try{o.call(this)}catch(l){x.error("Error executing queued PostHog call",o,l)}else L(o)&&t==="alias"?r.push(o):L(o)&&t.indexOf("capture")!==-1&&Ce(this[t])?n.push(o):s.push(o)});var a=function(o,l){wi(o,function(u){try{if(L(u[0])){var c=l;G(u,function(h){c=c[h[0]].apply(c,h.slice(1))})}else l[u[0]].apply(l,u.slice(1))}catch(h){x.error("Error executing queued PostHog call",u,h)}})};a(r,this),a(s,this),a(n,this)}finally{Rr--}}push(e){if(Rr>0&&L(e)&&B(e[0])){var t=$e.prototype[e[0]];Ce(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,r){var s,n,a,o,l;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!w(e)&&B(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var c=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(c==null||!c.isRateLimited){t!=null&&t.$current_url&&!B(t==null?void 0:t.$current_url)&&(x.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),e!=="$exception"||r!=null&&r.kn||x.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,d=(r==null?void 0:r.timestamp)||h,v=mn(r==null?void 0:r.uuid,Be),p={uuid:v,event:e,properties:this.calculateEventProperties(e,t||{},d,v)};e===wt&&this.config.__preview_capture_bot_pageviews&&u&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),c&&(p.properties.$lib_rate_limit_remaining_tokens=c.remainingTokens);var f=e==="$feature_flag_called"&&p.properties.$feature_flag_has_experiment===!1&&this.get_property(Wi)===!0;r!=null&&r.$set&&!f&&(p.$set=r==null?void 0:r.$set);var b=r==null?void 0:r.$unset;b&&(p.$unset=b);var m,k,E,S=f?void 0:this.Sn(r==null?void 0:r.$set_once,e!==kn,e===br);if(S&&(p.$set_once=S),r!=null&&r._noTruncate||(n=this.config.properties_string_max_length,a=p,o=M=>B(M)?M.slice(0,n):M,l=new Set,p=function M(R,N){if(R!==Object(R))return o?o(R):R;if(!l.has(R)){var z;if(l.add(R),L(R))z=[],wi(R,j=>{z.push(M(j))});else{var K={};G(R,(j,te)=>{l.has(j)||(K[te]=M(j))}),z=K}return z}}(a)),p.timestamp=d,w(r==null?void 0:r.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=h),f&&(p.properties=function(M,R){R===void 0&&(R=[]);var N={},z=K=>{M[K]!==void 0&&(N[K]=M[K])};return ql.forEach(z),R.forEach(z),N}(p.properties,Lc)),e===Ke.DISMISSED||e===Ke.SENT){var $=t==null?void 0:t[Pr.SURVEY_ID],D=t==null?void 0:t[Pr.SURVEY_ITERATION];Ko({id:$,current_iteration:D}),p.$set=_({},p.$set,{[(m={id:$,current_iteration:D},k=e===Ke.SENT?"responded":"dismissed",E="$survey_"+k+"/"+m.id,m.current_iteration&&m.current_iteration>0&&(E="$survey_"+k+"/"+m.id+"/"+m.current_iteration),E)]:!0})}else e===Ke.SHOWN&&(p.$set=_({},p.$set,{[Pr.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===pc.SHOWN){var A=t==null?void 0:t[Dn.TOUR_TYPE];A&&(p.$set=_({},p.$set,{[Dn.TOUR_LAST_SEEN_DATE+"/"+A]:new Date().toISOString()}))}var y=_({},p.properties.$set,p.$set);if(Ze(y)||this.setPersonPropertiesForFlags(y),!O(this.config.before_send)){var P=this.Rt(p);if(!P)return;(p=P).uuid=mn(p.uuid,Be)}this.tn.emit("eventCaptured",p);var I={method:"POST",url:(s=r==null?void 0:r._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:p,compression:"best-available",timestampMode:"query",batchKey:r==null?void 0:r._batchKey,transport:r==null?void 0:r.transport};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.cn(I):this.dn.enqueue(I),p}x.critical("This capture call is ignored due to client rate limiting.")}}else x.error("No event name provided to posthog.capture")}else x.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,r,s,n){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return t;var a=n?void 0:this.persistence.remove_event_timer(e),o=_({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.Yi()&&(o[Qa]=!0),e==="$snapshot"){var l=_({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!B(o.distinct_id)&&!ce(o.distinct_id)||Vr(o.distinct_id))&&x.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var u,c=function(E,S,$,D){var A,y,P,I;if(D===void 0&&(D=!1),!ye)return{};var M,R=E?[...Mt,...S||[]]:[],N=function(pi){for(var Ot=0;gn.length>Ot;Ot++){var vi=gn[Ot],Te=vi[1],fi=vi[0].exec(pi),At=fi&&(Ce(Te)?Te(fi,pi):Te);if(At)return At}return["",""]}(ye),z=N[0],K=N[1],j=(M=typeof navigator<"u"?navigator:void 0)!=null&&M.brave?{brave:!0}:{},te={};w($)||(te.detectGoogleSearchApp=$);var ie={},we=(A=navigator)==null||(A=A.userAgentData)==null?void 0:A.platform,Se=(y=navigator)==null?void 0:y.maxTouchPoints,_e=g==null||(P=g.screen)==null?void 0:P.width,xe=g==null||(I=g.screen)==null?void 0:I.height,X=g==null?void 0:g.devicePixelRatio;w(we)||(ie.userAgentDataPlatform=we),w(Se)||(ie.maxTouchPoints=Se),w(_e)||(ie.screenWidth=_e),w(xe)||(ie.screenHeight=xe),w(X)||(ie.devicePixelRatio=X);var ae,oe,le,Ye,pe,Ie,Ve,me,Re=J(Us({$os:z,$os_version:K,$browser:ja(ye,navigator.vendor,
22j,te),$device:_n(ye),$device_type:(oe=ye,le=ie,me=_n(oe),me===wa||me===ba||me==="Kobo"||me==="Kindle Fire"||me===Oa?$t:me===ai||me===Pt||me===oi||me===Xr?"Console":me===Ea?"Wearable":me?ke:(le==null?void 0:le.userAgentDataPlatform)==="Android"&&((Ye=le==null?void 0:le.maxTouchPoints)!==null&&Ye!==void 0?Ye:0)>0?600>Math.min((pe=le==null?void 0:le.screenWidth)!==null&&pe!==void 0?pe:0,(Ie=le==null?void 0:le.screenHeight)!==null&&Ie!==void 0?Ie:0)/((Ve=le==null?void 0:le.devicePixelRatio)!==null&&Ve!==void 0?Ve:1)?ke:$t:"Desktop"),$timezone:Io(),$timezone_offset:cc()}),{$current_url:hi(D?Xe(se==null?void 0:se.href):se==null?void 0:se.href,R,di),$host:se==null?void 0:se.host,$pathname:se==null?void 0:se.pathname,$raw_user_agent:ye.length>1e3?ye.substring(0,997)+"...":ye,$browser_version:au(ye,navigator.vendor,j,te),$browser_language:Ln(),$browser_language_prefix:(ae=Ln(),typeof ae=="string"?ae.split("-")[0]:void 0),$screen_height:g==null?void 0:g.screen.height,$screen_width:g==null?void 0:g.screen.width,$viewport_height:g==null?void 0:g.innerHe
22ight,$viewport_width:g==null?void 0:g.innerWidth,$lib:U.LIB_NAME,$lib_version:U.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return U.SDK_DIST_CHANNEL&&(Re.$sdk_dist_channel=U.SDK_DIST_CHANNEL),Re}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var h=this.sessionManager.checkAndGetSessionAndWindowId(n,r.getTime()),d=h.windowId;o.$session_id=h.sessionId,o.$window_id=d}this.sessionPropsManager&&J(o,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&J(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(v=this.vn)==null?void 0:v.length}catch(E){o.$sdk_debug_error_capturing_properties=String(E)}if(this.requestRouter.region===Fs&&(o.$lib_custom_api_host=this.config.api_host),u=e!==wt||n?e!==yr||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,s),o=J(o,u),e===wt&&T&&(o.title=T.title),!w(a)){var p=r.getTime()-a;o.$duration=parseFloat((p/1e3).toFixed(3))}ye&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser");var f=this.persistence.properties(),b=this.sessionPersistence.properties();G(["$referrer","$referring_domain"],E=>{E in f&&delete b[E]}),(o=J({},c,f,b,o)).$is_identified=this._isIdentified(),L(this.config.property_denylist)?G(this.config.property_denylist,function(E){delete o[E]}):x.error(Jo+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var m=this.config.sanitize_properties;m&&(x.error(Yn),o=m(o,e));var k=this.Cn();return o.$process_person_profile=k,k&&!n&&this.In("_calculate_event_properties"),o}Sn(e,t,r){var s;if(t===void 0&&(t=!0),r===void 0&&(r=!1),!this.persistence||!this.Cn()||this.Xi&&!r)return e;var n=this.persistence.get_initial_props(),a=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),o=J({},n,a||{},e||{}),l=this.config.sanitize_properties;return l&&(x.error(Yn),o=l(o,"$set_once")),t&&(this.Xi=!0),Ze(o)?void 0:o}register(e,t){var r;(r=this.persistence)==null||r.register(e,t)}register_once(e,t,r){var s;(s=this.persistence)==null||s.register_once(e,t,r)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}Tn(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return(t=this.featureFlags)==null?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.getAllFeatureFlags())!==null&&e!==void 0?e:[]}isFeatureEnabled(e,t){var r,s;return(r=(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,t))!==null&&r!==void 0?r:t==null?void 0:t.defaultValue}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,t,r){var s;(s=this.featureFlags)==null||s.updateFlags(e,t,r)}updateEarlyAccessFeatureEnrollment(e,t,r){var s;(s=this.featureFlags)==null||s.updateEarlyAccessFeatureEnrollment(e,t,r)}getEarlyAccessFeatures(e,t,r){var s;return t===void 0&&(t=!1),(s=this.featureFlags)==null?void 0:s.getEarlyAccessFeatures(e,t,r)}on(e,t){return this.tn.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:Bt}),()=>{})}onSessionId(e){var t,r;return(t=(r=this.sessionManager)==null?void 0:r.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:Bt})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:Bt})}renderSurvey(e,t){var r;(r=this.surveys)==null||r.renderSurvey(e,t)}displaySurvey(e,t){var r;t===void 0&&(t=Mc),(r=this.surveys)==null||r.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,r;return(t=(r=this.surveys)==null?void 0:r.canRenderSurvey(e))!==null&&t!==void 0?t:{visible:!1,disabledReason:Bt}}canRenderSurveyAsync(e,t){var r,s;return t===void 0&&(t=!1),(r=(s=this.surveys)==null?void 0:s.canRenderSurveyAsync(e,t))!==null&&r!==void 0?r:Promise.resolve({visible:!1,disabledReason:Bt})}Mn(e){return!e||Vr(e)?(x.critical("Unique user id has not been set in posthog.identify"),!1):e===bi?(x.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())||(x.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
22ot a hardcoded string.'),!1)}identify(e,t,r){if(!this.__loaded||!this.persistence)return x.uninitializedWarning("posthog.identify");if(ce(e)&&(e=e.toString(),x.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Mn(e)&&this.In("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(Gi)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(Jt)&&(this.unregister(Jt),this.register({distinct_id:e}));var n,a=(this.persistence.get_property(Me)||ft)===ft;e!==s&&a?(this.persistence.set_property(Me,gt),this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!1),this.capture(br,{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:r||{}}),this.sn=Wn(e,t,r),(n=this.featureFlags)==null||n.setAnonymousDistinctId(s)):(t||r)&&this.setPersonProperties(t,r),e!==s&&(this.reloadFeatureFlags(),this.unregister(ti))}}setPersonProperties(e,t){if((e||t)&&this.In("posthog.setPersonProperties")){var r=Wn(this.get_distinct_id(),e,t);this.sn!==r?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.sn=r):x.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,r=(L(e)?e:[e]).filter(s=>B(s)&&s.length>0);r.length!==0&&this.In("posthog.unsetPersonProperties")&&((t=this.featureFlags)==null||t.unsetPersonPropertiesForFlags(r,!0),this.capture("$set",{$unset:r}),this.sn=null)}group(e,t,r){if(e&&t){var s=this.getGroups(),n=s[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:_({},s,{[e]:t})}),n||r){var a={$group_type:e,$group_key:t};r&&(a.$group_set=r),this.capture(kn,a)}r&&this.setGroupPropertiesForFlags({[e]:r}),n&&!r&&this.reloadFeatureFlags()}else x.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var r;t===void 0&&(t=!0),(r=this.featureFlags)==null||r.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;e===void 0&&(e=!0),(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var r;t===void 0&&(t=!0),this.In("posthog.setGroupPropertiesForFlags")&&((r=this.featureFlags)==null||r.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t,r,s,n,a,o,l,u,c,h;if(x.info("reset"),!this.__loaded)return x.uninitializedWarning("posthog.reset");var d,v=this.get_property(Gi),p=this.get_property(mr),f=this.get_property(ut);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(r=this.sessionPersistence)==null||r.clear(),w(f)||(d=this.persistence)==null||d.register({[ut]:f}),(s=this.surveys)==null||s.reset(),(n=this.wn)==null||n.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.conversations)==null||o.reset(),(l=this.logs)==null||l.reset(),(u=this.metrics)==null||u.reset(),(c=this.persistence)==null||c.set_property(Me,ft),(h=this.sessionManager)==null||h.resetSessionId(),this.sn=null,this.config.cookieless_mode===Ge)this.register_once({distinct_id:bi,$device_id:null},"");else{var b=this.config.get_device_id(Be());this.register_once({distinct_id:b,$device_id:e?b:v},""),e||w(p)||this.register({[mr]: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 re(function*(){var r,s,n,a,o;t.__loaded?((r=t.logs)==null||r.flushLogs("sendBeacon"),(s=t.metrics)==null||s.flush("sendBeacon"),(n=t.dn)==null||n.unload(),(a=t.vn)==null||a.unload(),(o=t.featureFlags)==null||o.destroy()):x.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var r;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),(r=this.conversations)==null||r.En()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,(e=this.conversations)==null||e.Rn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);if(e!=null&&e.withTimestamp&&r){var n,a=(n=e.timestampLookBack)!==null&&n!==void 0?n:10;if(!r)return s;
22s+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-a,0)}return s}alias(e,t){return e===this.get_property(Ka)?(x.critical("Attempting to create alias for existing People user - aborting."),-2):this.In("posthog.alias")?(w(t)&&(t=this.get_distinct_id()),e!==t?(this.Tn(Jt,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(x.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=_({},this.config);if(Y(e)){var r,s,n,a,o,l,u,c,h,d,v;J(this.config,Vn(e));var p=this.hn();(r=this.persistence)==null||r.update_config(this.config,t,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Sr(_({},this.config,{persistence:"sessionStorage"}),p,!1);var f=this.an(this.config.debug);Oe(f)&&(this.config.debug=f),Oe(this.config.debug)&&(this.config.debug?(U.DEBUG=!0,W.N()&&W.q("ph_debug",!0),x.info("set_config",{config:e,oldConfig:t,newConfig:_({},this.config)})):(U.DEBUG=!1,W.N()&&W.P("ph_debug"))),(s=this.exceptionObserver)==null||s.onConfigChange(),(n=this.exceptions)==null||n.onConfigChange(),(a=this.sessionRecording)==null||a.startIfEnabledOrStop(),(o=this.tracingHeaders)==null||o.startIfEnabledOrStop(),(l=this.autocapture)==null||l.startIfEnabled(),(u=this.heatmaps)==null||u.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(h=this.deadClicksAutocapture)==null||h.startIfEnabledOrStop(),(d=this.surveys)==null||d.loadIfEnabled(),this.Pn(),(v=this.externalIntegrations)==null||v.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){U.LIB_NAME=e,U.LIB_VERSION=t}startSessionRecording(e){var t,r,s,n,a,o=e===!0,l={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(l).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),l.sampling&&((r=this.sessionRecording)==null||r.overrideSampling()),l.linked_flag&&((s=this.sessionRecording)==null||s.overrideLinkedFlag()),l.url_trigger&&((n=this.sessionRecording)==null||n.overrideTrigger("url")),l.event_trigger&&((a=this.sessionRecording)==null||a.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){if(this.exceptions){var r=new Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(_({},s,t))}}addExceptionStep(e,t){var r;(r=this.exceptions)==null||r.addExceptionStep(e,t)}captureLog(e){var t;(t=this.logs)==null||t.captureLog(e)}get logger(){var e,t;return(e=(t=this.logs)==null?void 0:t.logger)!==null&&e!==void 0?e:$e.On}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,r;return(t=(r=this.toolbar)==null?void 0:r.loadToolbar(e))!==null&&t!==void 0&&t}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:xt;return t!==xt&&(t=xt+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(Me))===gt||((t=this.sessionPersistence)==null?void 0:t.get_property(Me))===gt}Cn(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles===ys&&!this._isIdentified()&&Ze(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Jt])&&((t=this.persistence)==null||(t=t.props)==null||!t[Yi]))}xn(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.Cn()||this.In("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.In("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}In(e){return this.config.person_profiles==="never"?(x.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Tn(Yi,!0),!0)}hn(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==ot)}Pn(){var e,t,r,s,n=this.hn();return((e=this.persistence)==null?void 0:e.yr)!==n&&((r=this.persistence)==null||r.set_disabled(n)),((t=this.sessionPersistence)==null?void 0:t.yr)!==n&&((s=this.sessionPersistence)==null||s.set_disabled(n)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==Ge){if(this.Yi()){var r,s,n,a,o;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(s=this.pageViewM
22anager)==null||s.destroy(),this.sessionManager=new Gn(this),this.pageViewManager=new An(this),this.persistence&&(this.sessionPropsManager=new Bn(this,this.sessionManager,this.persistence));var l,u=(n=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&n!==void 0?n:(o=$e.__defaultExtensionClasses)==null?void 0:o.sessionRecording;u&&(this.sessionRecording=this.Ji(this.sessionRecording,new u(this)),this.yn&&((l=this.sessionRecording)==null||l.onRemoteConfig==null||l.onRemoteConfig(this.yn)))}var c,h;this.consent.optInOut(!0),this.Pn(),this.bn(),(t=this.sessionRecording)==null||t.startIfEnabledOrStop(),this.config.cookieless_mode==ot&&((c=this.surveys)==null||c.loadIfEnabled()),(w(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((h=e==null?void 0:e.captureEventName)!==null&&h!==void 0?h:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else x.warn(Jn)}opt_out_capturing(){var e,t,r;this.config.cookieless_mode!==Ge?(this.config.cookieless_mode===ot&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===ot&&(this.register({distinct_id:bi,$device_id:null}),(e=this.sessionRecording)==null||e.stopRecording(),this.sessionRecording=void 0,(t=this.sessionManager)==null||t.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this._n(),this.bn())):x.warn(Jn)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===Ge||(this.config.cookieless_mode===ot?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return fe?qo(fe,this.config.custom_blocked_useragents):void 0}_n(){T&&(T.visibilityState==="visible"?this.en||(this.en=!0,this.capture(wt,{title:T.title},{send_instantly:!0}),this.rn&&(T.removeEventListener(Vi,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),ee(T,Vi,this.rn)))}debug(e){e===!1?(g==null||g.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(g==null||g.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Ur(){var e=this.ln||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(x.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):function(t,r,s,n,a){var o=r in t&&!O(t[r]),l=s in t&&!O(t[s]);return o?t[r]:!!l&&(a&&a.warn("Config field '"+s+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),t[s])}(e,"advanced_disable_flags","advanced_disable_decide",0,x)}Rt(e){var t;if(O(this.config.before_send))return e;var r=Object.keys((t=e.properties)!==null&&t!==void 0?t:{}).filter(Jl),s=L(this.config.before_send)?this.config.before_send:[this.config.before_send],n=e;for(var a of s){if(n=a(n),O(n)){var o="Event '"+e.event+"' was rejected in beforeSend function";return Kl(e.event)?x.warn(o+". This can cause unexpected behavior."):x.info(o),null}n.properties&&!Ze(n.properties)||x.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var l of r)if(n.properties&&O(n.properties[l]))return x.warn("Event '"+e.event+"' had its '"+l+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return n}getPageViewId(){var e;return(e=this.pageViewManager.ir)==null?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,r){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(r)})}an(e){var t=Oe(e)&&!e,r=W.N()&&W.A("ph_debug")==="true";return!t&&(!!r||e)}}$e.__defaultExtensionClasses={},$e.On=(()=>{var i=()=>{};return{trace:i,debug:i,info:i,warn:i,error:i,fatal:i}})(),function(i,e){for(var t=0;e.length>t;t++)i.prototype[e[t]]=Lu(i.prototype[e[t]])}($e,["identify"]);class Zn{constructor(e){this.disabled=e===!1;var t=Y(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,r){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>r-s.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}}var Cr="$copy_autocapture",Or=Z("[AutoCapture]");function Ar(i,e){return e.length>i?e.slice(0,i)+"...":e}function jc(i){if(i.previousElementSibling)return i.previousElementSibling;var e=i;do e=e.previousSibling;while(e&&!Qe(e));return e}function Hc(i,e){var t,r,s=e.e,n=e.maskAllElementAttributes,a=e.maskAllText,o=e.elementAttributeIgnoreList,l=e.elementsC
22hainAsString,u=e.disableCaptureUrlHashes;if(!Qe(i))return{props:{}};for(var c=[i],h=new Set([i]),d=i;d.parentNode&&!Ee(d,"body")&&co>c.length;)if(uo(d.parentNode)){var v=d.parentNode.host;if(h.has(v))break;h.add(v),c.push(v),d=v}else{if(!Qe(d.parentNode)||h.has(d.parentNode))break;h.add(d.parentNode),c.push(d.parentNode),d=d.parentNode}var p,f,b=[],m={},k=!1,E=!1;if(G(c,y=>{var P=ws(y);if(Ee(y,"a")){var I=y.getAttribute("href");k=!!(P&&I&&ii(I))&&(u?Xe(I):I)}C(Qi(y),"ph-no-capture")&&(E=!0),b.push(function(R,N,z,K,j){j===void 0&&(j=!1);var te=R.tagName.toLowerCase(),ie={tag_name:te};Gs.indexOf(te)>-1&&!z&&(ie.$el_text=te.toLowerCase()==="a"||te.toLowerCase()==="button"?Ar(1024,Mn(R)):Ar(1024,ui(R)));var we=Qi(R);we.length>0&&(ie.classes=we.filter(function(X){return X!==""})),G(R.attributes,function(X){var ae;if((!go(R)||["name","id","class","aria-label"].indexOf(X.name)!==-1)&&(K==null||!K.includes(X.name))&&!N&&ii(X.value)&&(!B(ae=X.name)||ae.substring(0,10)!=="_ngcontent"&&ae.substring(0,7)!=="_nghost")){var oe=X.value;X.name==="class"&&(oe=Bs(oe).join(" ")),ie["attr__"+X.name]=Ar(1024,X.name==="href"&&j?Xe(oe):oe)}});for(var Se=1,_e=1,xe=R;xe=jc(xe);)Se++,xe.tagName===R.tagName&&_e++;return ie.nth_child=Se,ie.nth_of_type=_e,ie}(y,n,a,o,u));var M=function(R){if(!ws(R))return{};var N={};return G(R.attributes,function(z){if(z.name&&z.name.indexOf("data-ph-capture-attribute")===0){var K=z.name.replace("data-ph-capture-attribute-",""),j=z.value;K&&j&&ii(j)&&(N[K]=j)}}),N}(y);J(m,M)}),E)return{props:{},explicitNoCapture:E};if(a||(b[0].$el_text=Ee(i,"a")||Ee(i,"button")?Mn(i):ui(i)),k){var S,$;b[0].attr__href=k;var D=(S=ci(k))==null?void 0:S.host,A=g==null||($=g.location)==null?void 0:$.host;D&&A&&D!==A&&(p=k)}return{props:J({$event_type:s.type,$ce_version:1},l?{}:{$elements:b},{$elements_chain:(f=b,function(y){return y.map(P=>{var I,M,R="";if(P.tag_name&&(R+=P.tag_name),P.attr_class)for(var N of(P.attr_class.sort(),P.attr_class))R+="."+N.replace(/"/g,"");var z=_({},P.text?{text:P.text}:{},{"nth-child":(I=P.nth_child)!==null&&I!==void 0?I:0,"nth-of-type":(M=P.nth_of_type)!==null&&M!==void 0?M:0},P.href?{href:P.href}:{},P.attr_id?{attr_id:P.attr_id}:{},P.attributes),K={};return Mi(z).sort((j,te)=>j[0].localeCompare(te[0])).forEach(j=>{var te=j[1];return K[Cn(j[0].toString())]=Cn(te.toString())}),(R+=":")+Mi(K).map(j=>j[0]+'="'+j[1]+'"').join("")}).join(";")}(function(y){return y.map(P=>{var I,M,R={text:(I=P.$el_text)==null?void 0:I.slice(0,400),tag_name:P.tag_name,href:(M=P.attr__href)==null?void 0:M.slice(0,2048),attr_class:ic(P),attr_id:P.attr__id,nth_child:P.nth_child,nth_of_type:P.nth_of_type,attributes:{}};return Mi(P).filter(N=>N[0].indexOf("attr__")===0).forEach(N=>R.attributes[N[0]]=N[1]),R})}(f)))},(t=b[0])!=null&&t.$el_text?{$el_text:(r=b[0])==null?void 0:r.$el_text}:{},p&&s.type==="click"?{$external_click_url:p}:{},m)}}var Gt=Z("[ExceptionAutocapture]"),Xn=()=>{},qc=Z("[TracingHeaders]"),it=Z("[Web Vitals]"),Qn=9e5,ea="disabled",ta="lazy_loading",Wt="awaiting_config",Ti="missing_config";Z("[SessionRecording]"),Z("[SessionRecording]");var Is="[SessionRecording]",je=Z(Is),zc=Z("[Heatmaps]");function Lr(i){return Y(i)&&"clientX"in i&&"clientY"in i&&ce(i.clientX)&&ce(i.clientY)}var Dr=Z("[Product Tours]"),Nr=i=>{var e;return!i.config.disable_product_tours&&!((e=i.persistence)==null||!e.get_property(Hs))},Uc=["$set_once","$set"],Ae=Z("[SiteApps]"),ia="Error while initializing PostHog app with config id ";function yt(i,e,t){if(O(i))return!1;switch(t){case"exact":return i===e;case"contains":var r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(i);case"regex":try{return new RegExp(e).test(i)}catch{return!1}default:return!1}}class Bc{constructor(e){this.Fn=new Vs,this.Ln=(t,r)=>this.$n(t,r)&&this.An(t,r)&&this.Nn(t,r)&&this.Dn(t,r),this.$n=(t,r)=>r==null||!r.event||(t==null?void 0:t.event)===(r==null?void 0:r.event),this._instance=e,this.qn=new Set,this.jn=new Set}init(){var e,t;w((e=this._instance)==null?void 0:e._addCaptureHook)||(t=this._instance)==null||t._addCaptureHook((r,s)=>{this.on(r,s)})}register(e){var t,r;if(!w((t=this._instance)==null?void 0:t._addCaptureHook)&&(e.forEach(a=>{var o,l;(o=this.jn)==null||o.add(a),(l=a.steps)==null||l.forEach(u=>{var c;(c=this.qn)==null||c.add((u==null?void 0:u.event)||"")})}),(r=this._instance)!=null&&r.autocapture)){var s,n=new Set;e.forEach(a=>{var o;(o=a.steps)==null||o.forEach(l=>{l!=null&&l.selector&&n.add(l==null?void 0:l.selector)})}),(s=this._instance)==null||s.autocapture.setElementSelectors(n)}}on(e,t){var r;t!=null&&e.length!=0&&(this.qn.has(e)||this.qn.has(t.event))&&this.jn&&((r=this.jn)==null?void 0:r.size)>0&&this.jn.forEach(s=>
22{this.Hn(t,s)&&this.Fn.emit("actionCaptured",s.name)})}Bn(e){this.onAction("actionCaptured",t=>e(t))}Hn(e,t){if((t==null?void 0:t.steps)==null)return!1;for(var r of t.steps)if(this.Ln(e,r))return!0;return!1}onAction(e,t){return this.Fn.on(e,t)}An(e,t){if(t!=null&&t.url){var r,s=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!s||typeof s!="string"||!yt(s,t.url,t.url_matching||"contains"))return!1}return!0}Nn(e,t){return!!this.Un(e,t)&&!!this.zn(e,t)&&!!this.Vn(e,t)}Un(e,t){var r;if(t==null||!t.href)return!0;var s=this.Wn(e);if(s.length>0)return s.some(o=>yt(o.href,t.href,t.href_matching||"exact"));var n,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&yt((n=a.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}zn(e,t){var r;if(t==null||!t.text)return!0;var s=this.Wn(e);if(s.length>0)return s.some(u=>yt(u.text,t.text,t.text_matching||"exact")||yt(u.$el_text,t.text,t.text_matching||"exact"));var n,a,o,l=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!l&&(n=function(u){for(var c,h=[],d=/(?::|")text="(.*?)"/g;!O(c=d.exec(u));)h.includes(c[1])||h.push(c[1]);return h}(l),a=t.text,o=t.text_matching||"exact",n.some(u=>yt(u,a,o)))}Vn(e,t){var r,s;if(t==null||!t.selector)return!0;var n=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(n!=null&&n.includes(t.selector))return!0;var a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}Wn(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e==null?void 0:e.properties.$elements}Dn(e,t){return t==null||!t.properties||t.properties.length===0||Bo(t.properties.reduce((r,s)=>{var n=L(s.value)?s.value.map(String):s.value!=null?[String(s.value)]:[];return r[s.key]={values:n,operator:s.operator||"exact"},r},{}),e==null?void 0:e.properties)}}class Gc{constructor(e){var t;this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map,(t=this._instance)==null||t.onSessionId==null||t.onSessionId(r=>this.Kn(r))}Yn(e,t){return!!e&&Bo(e.propertyFilters,t==null?void 0:t.properties)}Xn(e,t){var r=new Map;return e.forEach(s=>{var n;(n=s.conditions)==null||(n=n[t])==null||(n=n.values)==null||n.forEach(a=>{if(a!=null&&a.name){var o=r.get(a.name)||[];o.push(s.id),r.set(a.name,o)}})}),r}ts(e,t,r){var s=(r===jt.Activation?this.Gn:this.Qn).get(e),n=[];return this.es(a=>{n=a.filter(o=>s==null?void 0:s.includes(o.id))}),n.filter(a=>{var o,l=(o=a.conditions)==null||(o=o[r])==null||(o=o.values)==null?void 0:o.find(u=>u.name===e);return this.Yn(l,t)})}register(e){var t;w((t=this._instance)==null?void 0:t._addCaptureHook)||(this.rs(e),this.ns(e))}ns(e){var t=e.filter(r=>{var s,n;return((s=r.conditions)==null?void 0:s.actions)&&((n=r.conditions)==null||(n=n.actions)==null||(n=n.values)==null?void 0:n.length)>0});t.length!==0&&(this.ss==null&&(this.ss=new Bc(this._instance),this.ss.init(),this.ss.Bn(r=>{this.onAction(r)})),t.forEach(r=>{var s,n,a,o,l;r.conditions&&(s=r.conditions)!=null&&s.actions&&(n=r.conditions)!=null&&(n=n.actions)!=null&&n.values&&((a=r.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((o=this.ss)==null||o.register(r.conditions.actions.values),(l=r.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(u=>{if(u&&u.name){var c=this.Jn.get(u.name);c&&c.push(r.id),this.Jn.set(u.name,c||[r.id])}}))}))}rs(e){var t,r=e.filter(n=>{var a,o;return((a=n.conditions)==null?void 0:a.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0}),s=e.filter(n=>{var a,o;return((a=n.conditions)==null?void 0:a.cancelEvents)&&((o=n.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0});r.length===0&&s.length===0||((t=this._instance)==null||t._addCaptureHook((n,a)=>{this.onEvent(n,a)}),this.Gn=this.Xn(e,jt.Activation),this.Qn=this.Xn(e,jt.Cancellation))}onEvent(e,t){var r,s,n=this.os(),a=(t==null||(r=t.properties)==null?void 0:r.$survey_id)||(t==null||(s=t.properties)==null?void 0:s.$product_tour_id);if(a&&this.getActivatedIds().includes(a)){var o=this.ls(e,a);if(o==="consume")return n.info("event consumed activated item, remov
22ing it",{event:e,itemId:a}),void this.us([a]);if(o==="persist")return n.info("shown item promoted to persisted activation",{event:e,itemId:a}),void this.hs(a)}if(this.Qn.has(e)){var l=this.ts(e,t,jt.Cancellation);l.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:l.map(c=>c.id)}),this.us(l.map(c=>c.id)),l.forEach(c=>this.ds(c.id)))}if(this.Gn.has(e)){n.info("event name matched",{event:e,eventPayload:t,items:this.Gn.get(e)});var u=this.ts(e,t,jt.Activation);this.cs(u.map(c=>c.id))}}onAction(e){this.Jn.has(e)&&this.cs(this.Jn.get(e)||[])}cs(e){e.length!==0&&(this.Zn=[...new Set([...this.Zn,...e])],this.os().info("updating activated items",{activatedItems:this.getActivatedIds()}))}hs(e){this.Zn=this.Zn.filter(r=>r!==e);var t=this.vs();t.includes(e)||(this.fs([...t,e]),this.ps())}us(e){var t=new Set(e);this.Zn=this.Zn.filter(n=>!t.has(n));var r=this.gs(),s=r.filter(n=>!t.has(n));s.length!==r.length&&(this.fs(s),s.length===0&&this.ys())}gs(){var e,t=this.bs();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}vs(){var e,t,r=this.gs();if(r.length===0)return[];var s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[this._s()],n=(t=this._instance)==null||t.get_session_id==null?void 0:t.get_session_id();return n&&s===n?r:[]}ps(){var e,t=(e=this._instance)==null||e.get_session_id==null?void 0:e.get_session_id();t&&this.ws(t)}ys(){this.xs()}Kn(e){var t,r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[this._s()];r&&r!==e&&(this.gs().length>0&&this.fs([]),this.ys())}getActivatedIds(){return[...new Set([...this.vs(),...this.Zn])].filter(e=>!this.ks(e))}reset(){this.Zn=[],this.gs().length>0&&this.fs([]),this.ys()}getEventToItemsMap(){return this.Gn}Ss(){return this.ss}}class Wc extends Gc{constructor(e){super(e)}bs(){return ds}_s(){return Ri}Cs(){return Ke.SHOWN}es(e){var t;(t=this._instance)==null||t.getSurveys(e)}ds(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}os(){return q}fs(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[ds]:e})}ws(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[Ri]:e})}xs(){var e;(e=this._instance)==null||(e=e.persistence)==null||e.unregister(Ri)}ks(){return!1}ls(e,t){var r;this.es(n=>{r=n.find(a=>a.id===t)});var s=!r||function(n){var a;return Go(n)&&!((a=n.conditions)==null||(a=a.events)==null||!a.repeatedActivation)||n.schedule==="always"}(r);return s?e===Ke.SHOWN?"consume":"ignore":e===Ke.SHOWN?"persist":e===Ke.DISMISSED||e===Ke.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var jr="SDK is not enabled or survey functionality is not yet loaded",ra="Disabled. Not loading surveys.",Kc=g!=null&&g.location?er(g.location.hash,"__posthog")||er(location.hash,"state"):null,sa="_postHogToolbarParams",na=Z("[Toolbar]"),ne=Z("[FeatureFlags]"),rt=Z("[FeatureFlags]",{debugEnabled:!0}),Hr=`" failed. Feature flags didn't load in time.`,aa=i=>{for(var e={},t=0;i.length>t;t++)e[i[t]]=!0;return e},oa=i=>{var e={};for(var t of Mi(i||{})){var r=t[1];r&&(e[t[0]]=r)}return e},He=Z("[Error tracking]"),la="Refusing to render web experiment since the viewer is a likely bot",Jc={icontains:(i,e)=>e.toLowerCase().indexOf(i.toLowerCase())>-1,not_icontains:(i,e)=>e.toLowerCase().indexOf(i.toLowerCase())===-1,regex:(i,e)=>rr(e,i),not_regex:(i,e)=>!rr(e,i),exact:(i,e)=>e===i,is_not:(i,e)=>e!==i};class he{get Te(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),t.getWebExperiments(s=>{he.Is("retrieved web experiments from the server"),t.Ts=new Map,s.forEac
22h(n=>{if(n.feature_flag_key){var a;t.Ts&&(he.Is("setting flag key ",n.feature_flag_key," to web experiment ",n),(a=t.Ts)==null||a.set(n.feature_flag_key,n));var o=t._instance.getFeatureFlag(n.feature_flag_key);B(o)&&n.variants[o]&&t.Ms(n.name,o,n.variants[o].transforms)}else if(n.variants)for(var l in n.variants){var u=n.variants[l];he.Es(u,t._instance)&&t.Ms(n.name,l,u.transforms)}})},r)},this._instance=e,this._instance.onFeatureFlags(r=>{this.onFeatureFlags(r)})}initialize(){}onFeatureFlags(e){if(this._is_bot())he.Is(la);else if(!this.Te.disable_web_experiments){if(O(this.Ts))return this.Ts=new Map,this.loadIfEnabled(),void this.previewWebExperiment();he.Is("applying feature flags",e),e.forEach(t=>{var r;if(this.Ts&&(r=this.Ts)!=null&&r.has(t)){var s,n=this._instance.getFeatureFlag(t),a=(s=this.Ts)==null?void 0:s.get(t);n&&a!=null&&a.variants[n]&&this.Ms(a.name,n,a.variants[n].transforms)}})}}previewWebExperiment(){var e=he.getWindowLocation();if(e!=null&&e.search){var t=Rt(e==null?void 0:e.search,"__experiment_id"),r=Rt(e==null?void 0:e.search,"__experiment_variant");t&&r&&(he.Is("previewing web experiments "+t+" && "+r),this.getWebExperiments(s=>{this.Rs(parseInt(t),r,s)},!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,r){if(this.Te.disable_web_experiments&&!r)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.Te.token),method:"GET",timestampMode:"query",callback:n=>e(n.statusCode===200&&n.json&&n.json.experiments||[])})}Rs(e,t,r){var s=r.filter(n=>n.id===e);s&&s.length>0&&(he.Is("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Ms(s[0].name,t,s[0].variants[t].transforms))}static Es(e,t){return!O(e.conditions)&&he.Ps(e,t)&&he.Os(e)}static Ps(e,t){var r;if(O(e.conditions)||O((r=e.conditions)==null?void 0:r.url))return!0;var s=he.getWindowLocation();if(s){var n,a,o,l=ao(t,s.href);return(n=e.conditions)==null||!n.url||Jc[(a=(o=e.conditions)==null?void 0:o.urlMatchType)!==null&&a!==void 0?a:"icontains"](e.conditions.url,l)}return!1}
22static getWindowLocation(){return g==null?void 0:g.location}static Os(e){var t;if(O(e.conditions)||O((t=e.conditions)==null?void 0:t.utm))return!0;var r=ko();if(r.utm_source){var s,n,a,o,l,u,c,h,d=(s=e.conditions)==null||(s=s.utm)==null||!s.utm_campaign||((n=e.conditions)==null||(n=n.utm)==null?void 0:n.utm_campaign)==r.utm_campaign,v=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==r.utm_source,p=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==r.utm_medium,f=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==r.utm_term;return d&&p&&f&&v}return!1}static Is(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;t>s;s++)r[s-1]=arguments[s];x.info("[WebExperiments] "+e,r)}Ms(e,t,r){this._is_bot()?he.Is(la):t!=="control"?r.forEach(s=>{if(s.selector){var n;he.Is("applying transform of variant "+t+" for experiment "+e+" ",s);var a=(n=document)==null?void 0:n.querySelectorAll(s.selector);a==null||a.forEach(o=>{var l=o;s.html&&(l.innerHTML=s.html),s.css&&l.setAttribute("style",s.css)})}}):he.Is("Control variants leave the page unmodified.")}_is_bot(){return fe&&this._instance?qo(fe,this.Te.custom_blocked_useragents):void 0}}var Pe=Z("[Conversations]"),st="Conversations not available yet.",ua="console",ur={featureFlags:class{constructor(i){this.Fs=!1,this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.qs=!1,this.js=!1,this.Hs=0,this.Bs=()=>{var e=this.Us();this.Hs=0,e&&this.reloadFeatureFlags()},this._instance=i,this.featureFlagEventHandlers=[],g&&ee(g,"online",this.Bs)}destroy(){g==null||g.removeEventListener("online",this.Bs)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}zs(i){return this._instance.get_property(i)}Vs(){var i,e;return(i=(e=this.mi)==null?void 0:e._r(this.Te.feature_flag_cache_ttl_ms))!==null&&i!==void 0&&i}Ws(){return!!this.Vs()&&(this.js||this.$s||(this.js=!0,ne.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zs(){var i,e=(i=this.Te.evaluation_contexts)!==null&&i!==void 0?i:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.qs||(ne.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.qs=!0),e!=null&&e.length?e.filter(t=>{var r=t&&typeof t=="string"&&t.trim().length>0;return r||ne.error("Invalid evaluation context found:",t,"Expected non-empty string"),r}):[]}Gs(){return this.Zs().length>0}Qs(){var i=this.Te.flag_keys;if(!w(i)){if(L(i))return i.filter(e=>{var t=e&&typeof e=="string"&&e.trim().length>0;return t||ne.error("Invalid flag key found:",e,"Expected non-empty string"),t});ne.error("Invalid flag_keys found:",i,"Expected array of non-empty strings")}}initialize(){var i,e,t=this._instance.config,r=(i=(e=t.bootstrap)==null?void 0:e.featureFlags)!==null&&i!==void 0?i:{};if(Object.keys(r).length){var s,n,a=(s=(n=t.bootstrap)==null?void 0:n.featureFlagPayloads)!==null&&s!==void 0?s:{},o=Object.keys(r).filter(u=>!!r[u]).reduce((u,c)=>(u[c]=r[c]||!1,u),{}),l=Object.keys(a).filter(u=>o[u]).reduce((u,c)=>(a[c]&&(u[c]=a[c]),u),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(i,e,t){var r,s,n=t!=null&&t.merge&&(r=this.zs(lt))!==null&&r!==void 0?r:{},a=t!=null&&t.merge&&(s=this.zs(Ii))!==null&&s!==void 0?s:{},o=_({},n,i),l=_({},a,e),u={};for(var c of Object.entries(o)){var h=c[0],d=c[1];u[h]={key:h,enabled:un(d),variant:cn(d),reason:void 0,metadata:w(l==null?void 0:l[h])?void 0:{id:0,version:void 0,description:void 0,payload:l[h]}}}this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.Ls}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var i=this.zs(us),e=this.zs(ze),t=this.zs(bt);if(!t&&!e)return i||{};var r=J({},i||{}),s=[...new Set([...Object.keys(t||{}),...Object.keys(e||{})])];for(var n of s){var a,o,l=r[n],u=e==null?void 0:e[n],c=w(u)?(a=l==null?void 0:l.enabled)!==null&&a!==void 0&&a:!!u,h=w(u)?l.variant:typeof u=="string"?u:void 0,d=t==null?void 0:t[n],v=_({},l,{enabled:c,variant:c?h??(l==null?void 0:l.variant):void 0});c!==(l==null?void 0:l.enabled)&&(v.original_enabled=l==null?void 0:l.enabled),h!==(l==null?void 0:l.variant)&&(v.original_variant=l==null?void 0:l.variant),d&&(v.metadata=_({},l==null?void 0:l.metadata,{payload:d,original_payload:l==null||(o=l.metadata)==null?void 0:o.payload})),r[n]=v}
22return this.Fs||(ne.warn(" Overriding feature flag details!",{flagDetails:i,overriddenPayloads:t,finalDetails:r}),this.Fs=!0),r}getAllFeatureFlags(){var i=this.getFlagVariants(),e=this.getFlagPayloads();return Object.keys(i).map(t=>{var r=i[t];return{key:t,enabled:un(r),variant:cn(r),payload:ln(e[t])}})}getFlagVariants(){var i=this.zs(lt),e=this.zs(ze);if(!e)return i||{};for(var t=J({},i),r=Object.keys(e),s=0;r.length>s;s++)t[r[s]]=e[r[s]];return this.Fs||(ne.warn(" Overriding feature flags!",{enabledFlags:i,overriddenFlags:e,finalFlags:t}),this.Fs=!0),t}getFlagPayloads(){var i=this.zs(Ii),e=this.zs(bt);if(!e)return i||{};for(var t=J({},i||{}),r=Object.keys(e),s=0;r.length>s;s++)t[r[s]]=e[r[s]];return this.Fs||(ne.warn(" Overriding feature flag payloads!",{flagPayloads:i,overriddenPayloads:e,finalPayloads:t}),this.Fs=!0),t}reloadFeatureFlags(){this.As||this.Te.advanced_disable_feature_flags||this.Us()||this.Js||(this._instance.tn.emit("featureFlagsReloading",!0),this.Js=setTimeout(()=>{this.Ks()},5))}Ys(){clearTimeout(this.Js),this.Js=void 0}ensureFlagsLoaded(){this.Ls||this.$s||this.Js||this.reloadFeatureFlags()}setAnonymousDistinctId(i){this.$anon_distinct_id=i}setReloadingPaused(i){this.As=i}Ks(i){var e;if(this.Ys(),!this._instance.Ur()&&!this.Us())if(this.$s)this.Ns=!0;else{var t=this.Te.token,r=this.zs(Gi),s={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:_({},((e=this.mi)==null?void 0:e.get_initial_props())||{},this.zs(nt)||{}),group_properties:this.zs(at),timezone:Io()};ge(r)||w(r)||(s.$device_id=r),(i!=null&&i.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Gs()&&(s.evaluation_contexts=this.Zs());var n=this.Qs();w(n)||(s.flag_keys=n);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.$s=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this.Te.disable_compression?void 0:ve.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:l=>{var u,c,h,d=!0;if(this.Xs(l.statusCode),l.statusCode===200&&(this.Ns||(this.$anon_distinct_id=void 0),d=!1),this.$s=!1,!s.disable_flags||this.Ns){this.Ds=!d;var v=[];l.error?l.error instanceof Error?v.push(l.error.name==="AbortError"?"timeout":"connection_error"):v.push("unknown_error"):l.statusCode!==200&&v.push("api_error_"+l.statusCode),(u=l.json)!=null&&u.errorsWhileComputingFlags&&v.push("errors_while_computing_flags");var p,f=!((c=l.json)==null||(c=c.quotaLimited)==null||!c.includes("feature_flags"));f&&v.push("quota_limited"),(h=this.mi)==null||h.register({[vs]:v}),f?ne.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(s.disable_flags||this.receivedFeatureFlags((p=l.json)!==null&&p!==void 0?p:{},d,{partialResponse:a}),this.Ns&&(this.Ns=!1,this.Ks()))}}})}}Us(){return xo(this.Hs,3)}Xs(i){this.Hs=Eo(i,this.Hs,3,()=>ne.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(i,e){var t;if(e===void 0&&(e={}),!e.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var r=this.getFeatureFlagResult(i,e);return(t=r==null?void 0:r.variant)!==null&&t!==void 0?t:r==null?void 0:r.enabled}}else ne.warn('getFeatureFlag for key "'+i+Hr)}getFeatureFlagDetails(i){return this.getFlagsWithDetails()[i]}getFeatureFlagPayload(i){var e=this.getFeatureFlagResult(i,{send_event:!1});return e==null?void 0:e.payload}getFeatureFlagResult(i,e){if(e===void 0&&(e={}),!e.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var t=this.getFlagVariants(),r=i in t,s=t[i],n=this.getFlagPayloads()[i],a=String(s),o=this.zs(cs)||void 0,l=this.zs(li)||void 0,u=this.zs(ti)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var c,h=this._instance.get_session_id(),d=this.zs(ps);h&&h!==d&&(u={},(c=this.mi)==null||c.register({[ti]:u,[ps]:h}))}if((e.send_event||!("send_event"in e))&&(!(i in u)||!u[i].includes(a))){var v,p,f,b,m,k,E,S,$,D,A;L(u[i])?u[i].push(a):u[i]=[a],(v=this.mi)==null||v.register({[ti]:u});var y=this.getFeatureFlagDetails(i),P=[...(p=this.zs(vs))!==null&&p!==void 0?p:[]];w(s)&&P.push("flag_missing");var I={$feature_flag:i,$feature_flag_response:s,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:((f=this.Te.bootstrap)==null||(f=f.featureFlags)==null?void 0:f[i])||null,$feature_flag_bootstrapped_payload:((b=this.Te.bootstrap)==null||(b=b.featureFlagPayloads)==null?void 0:b[i])||null,$used_bootstrap_value:!this.Ds};w(y==null||(m=y.metadata)==null?void 0:m.has_experiment)||(I.$feature_flag_has_experiment=y.metadata.has_experiment),w(y==null||(k=y.metadata)==null?void 0:k.version)||(I.$feature_flag_version=y.metadata.version);var M,R=(E=y==null||(S=y.reason)==null?void 0:S.description)!==null&&E!==void 0?E:y==null||($=y.reason)==null?void 0:$.code;R&&(I.$feature_flag_reason=R),y!=null&&(D=y.metadata)!=null&&D.id&&(I.$feature_flag_id=y.metadata.id),w(y==null?void 0:y.original_variant)&&w(y==null?void 0:y.original_enabled)||(I.$feature_flag_original_response=w(y.original_variant)?y.original_enabled:y.original_variant),y!=null&&(A=y.metadata)!=null&&A.original_payload&&(I.$feature_flag_original_payload=y==null||(M=y.metadata)==null?void 0:M.original_payload),P.length&&(I.$feature_flag_error=P.join(",")),this._instance.capture("$feature_flag_called",I)}if(r)return{key:i,enabled:!!s,variant:typeof s=="string"?s:void 0,payload:ln(n)}}}else ne.warn('getFeatureFlagResult for key "'+i+Hr)}getRemoteConfigPayload(i,e){var t=this.Te.token,r={distinct_id:this._instance.get_distinct_id(),token:t};this.Gs()&&(r.evaluation_contexts=this.Zs());var s=this.Qs();w(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Te.disable_compression?void 0:ve.Base64,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback(n){var a,o=(a=n.json)==null?void 0:a.featureFlagPayloads;e((o==null?void 0:o[i])||void 0)}})}isFeatureEnabled(i,e){if(e===void 0&&(e={}),e.fresh&&!this.Ds)return e.defaultValue;if(!(this.Ls||this.getFlags()&&this.getFlags().length>0))return ne.warn('isFeatureEnabled for key "'+i+Hr),e.defaultValue;var t=this.getFeatureFlag(i,e);return w(t)?e.defaultValue:!!t}addFeatureFlagsHandler(i){this.featureFlagEventHandlers.push(i)}removeFeatureFlagsHandler(i){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(e=>e!==i)}receivedFeatureFlags(i,e,t){if(this.mi){this.Ls=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),n=this.getFlagsWithDetails();(function(a,o,l,u,c,h){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var d=(y=>{var P=y.flags;return P?(y.featureFlags=Object.fromEntries(Object.keys(P).map(I=>{var M;return[I,(M=P[I].variant)!==null&&M!==void 0?M:P[I].enabled]})),y.featureFlagPayloads=Object.fromEntries(Object.keys(P).filter(I=>P[I].enabled).filter(I=>{var M;return(M=P[I].metadata)==null?void 0:M.payload}).map(I=>{var M;return[I,(M=P[I].metadata)==null?void 0:M.payload]}))):y.featureFlags&&ne.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),y})(a),v=d.flags,p=d.featureFlags,f=d.featureFlagPayloads;if(p){var b=a.requestId,m=a.evaluatedAt;if(L(p)){ne.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var k={};if(p)for(var E=0;p.length>E;E++)k[p[E]]=!0;o&&o.register({[Fi]:p,[lt]:k,[Wi]:!1})}else{var S=p,$=f,D=v;if(h!=null&&h.partialResponse)S=_({},l,S),$=_({},u,$),D=_({},c,D);else if(a.errorsWhileComputingFlags)if(v){var A=new Set(Object.keys(v).filter(y=>{var P;return!((P=v[y])!=null&&P.failed)}));S=_({},l,Object.fromEntries(Object.entries(S).filter(y=>A.has(y[0])))),$=_({},u,Object.fromEntries(Object.entries($||{}).filter(y=>A.has(y[0])))),D=_({},c,Object.fromEntries(Object.entries(D||{}).filter(y=>A.has(y[0]))))}else S=_({},l,S),$=_({},u,$),D=_({},c,D);o&&o.register(_({[Fi]:Object.keys(oa(S)),[lt]:S||{},[Ii]:$||{},[us]:D||{},[Wi]:a.minimalFlagCalledEvents===!0},b?{[cs]:b}:{},m?{[li]:m}:{}))}}})(i,this.mi,r,s,n,t),e||(this.js=!1),this.eo(e)}}override(i,e){e===void 0&&(e=!1),ne.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:i,suppressWarning:e})}
22overrideFeatureFlags(i){if(!this._instance.__loaded||!this.mi)return ne.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(i===!1)return this.mi.unregister(ze),this.mi.unregister(bt),this.eo(),rt.info("All overrides cleared");if(L(i)){var e=aa(i);return this.mi.register({[ze]:e}),this.eo(),rt.info("Flag overrides set",{flags:i})}if(i&&typeof i=="object"&&("flags"in i||"payloads"in i)){var t,r=i;if(this.Fs=!!((t=r.suppressWarning)!==null&&t!==void 0&&t),"flags"in r){if(r.flags===!1)this.mi.unregister(ze),rt.info("Flag overrides cleared");else if(r.flags){if(L(r.flags)){var s=aa(r.flags);this.mi.register({[ze]:s})}else this.mi.register({[ze]:r.flags});rt.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this.mi.unregister(bt),rt.info("Payload overrides cleared")):r.payloads&&(this.mi.register({[bt]:r.payloads}),rt.info("Payload overrides set",{payloads:r.payloads}))),void this.eo()}if(i&&typeof i=="object")return this.mi.register({[ze]:i}),this.eo(),rt.info("Flag overrides set",{flags:i});ne.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:i})}
22onFeatureFlags(i){if(this.addFeatureFlagsHandler(i),this.Ls){var e=this.ro(),t=e.flags,r=e.flagVariants;try{i(t,r)}catch(s){ne.error("Error while running feature flags callback",s)}}return()=>this.removeFeatureFlagsHandler(i)}updateEarlyAccessFeatureEnrollment(i,e,t){var r,s=(this.zs(Vt)||[]).find(l=>l.flagKey===i),n={["$feature_enrollment/"+i]:e},a={$feature_flag:i,$feature_enrollment:e,$set:n};s&&(a.$early_access_feature_name=s.name),t&&(a.$feature_enrollment_stage=t),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=_({},this.getFlagVariants(),{[i]:e});(r=this.mi)==null||r.register({[Fi]:Object.keys(oa(o)),[lt]:o}),this.eo()}getEarlyAccessFeatures(i,e,t){e===void 0&&(e=!1);var r=this.zs(Vt),s=t?"&"+t.map(n=>"stage="+n).join("&"):"";if(r&&!e)return i(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Te.token+s),method:"GET",timestampMode:"query",callback:n=>{var a,o;if(n.json){var l=n.json.earlyAccessFeatures;return(a=this.mi)==null||a.unregister(Vt),(o=this.mi)==null||o.register({[Vt]:l}),i(l)}}})}ro(){var i=this.getFlags(),e=this.getFlagVariants();return{flags:i.filter(t=>e[t]),flagVariants:Object.keys(e).filter(t=>e[t]).reduce((t,r)=>(t[r]=e[r],t),{})}}eo(i){var e=this.ro(),t=e.flags,r=e.flagVariants;this.featureFlagEventHandlers.forEach(s=>{try{s(t,r,{errorsLoading:i})}catch(n){ne.error("Error while running feature flags callback",n)}})}setPersonPropertiesForFlags(i,e){e===void 0&&(e=!0);var t=this.zs(nt)||{},r=(i==null?void 0:i.$set)||(i!=null&&i.$set_once?{}:i),s=i==null?void 0:i.$set_once,n={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in t||(n[a]=s[a]));this._instance.register({[nt]:_({},t,n,r)}),e&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(i,e){e===void 0&&(e=!0);var t=_({},this.zs(nt)||{});i.forEach(r=>{delete t[r]}),this._instance.register({[nt]:t}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(i){i===void 0&&(i=!0),this._instance.unregister(nt),i&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(i,e){e===void 0&&(e=!0);var t=this.zs(at)||{};Object.keys(t).length!==0&&Object.keys(t).forEach(r=>{t[r]=_({},t[r],i[r]),delete i[r]}),this._instance.register({[at]:_({},t,i)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(i){if(i){var e=this.zs(at)||{};this._instance.register({[at]:_({},e,{[i]:{}})})}else this._instance.unregister(at)}reset(){this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.$anon_distinct_id=void 0,this.Ys(),this.Fs=!1,this.Hs=0}}},Yc={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var i;return!((i=this.io)==null||!i.isStarted)}get status(){var i,e;return this.no===Wt||this.no===Ti?this.no:(i=(e=this.io)==null?void 0:e.status)!==null&&i!==void 0?i:this.no}constructor(i){if(this._forceAllowLocalhostNetworkCapture=!1,this.no=ea,this.so=void 0,this._instance=i,!this._instance.sessionManager)throw je.error("started without valid sessionManager"),new Error(Is+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===Ge)throw new Error(Is+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get oo(){var i,e=!((i=this._instance.get_property(ut))==null||!i.enabled),t=!this.Te.disable_session_recording,r=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return g&&e&&t&&!r}startIfEnabledOrStop(i){var e;if(!this.oo||(e=this.io)==null||!e.isStarted){var t=!w(Object.assign)&&!w(Array.from);this.oo&&t?(this.ao(i),je.info("starting")):(this.no=ea,this.stopRecording())}}ao(i){var e,t,r;this.oo&&(this.no!==Wt&&this.no!==Ti&&(this.no=ta),F!=null&&(e=F.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(t=F.__PosthogExtensions__)!=null&&t.initSessionRecording?this.lo(i):(r=F.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.uo,s=>
22{if(s)return je.error("could not load recorder",s);this.lo(i)}))}stopRecording(){var i,e;(i=this.so)==null||i.call(this),this.so=void 0,(e=this.io)==null||e.stop()}ho(){var i,e;(i=this.so)==null||i.call(this),this.so=void 0,(e=this.io)==null||e.discard()}do(){var i,e;(i=this.mi)==null||i.unregister(qs),(e=this.mi)==null||e.unregister(Ja)}co(i,e){if(O(i))return null;var t,r=ce(i)?i:parseFloat(i);return typeof(t=r)!="number"||!Number.isFinite(t)||0>t||t>1?(je.warn(e+" must be between 0 and 1. Ignoring invalid value:",i),null):r}vo(i){if(this.mi){var e,t,r=this.mi,s=()=>{var n,a=i.sessionRecording===!1?void 0:i.sessionRecording,o=this.co((n=this.Te.session_recording)==null?void 0:n.sampleRate,"session_recording.sampleRate"),l=this.co(a==null?void 0:a.sampleRate,"remote config sampleRate"),u=o??l;O(u)&&this.do();var c=a==null?void 0:a.minimumDurationMilliseconds;r.register({[ut]:_({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:_({capturePerformance:i.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:u,minimumDurationMilliseconds:w(c)?null:c,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers,version:a==null?void 0:a.version,triggerGroups:a==null?void 0:a.triggerGroups})})};s(),(e=this.so)==null||e.call(this),this.so=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(s)}}onRemoteConfig(i){var e=i.ok?i.config:void 0;return e&&"sessionRecording"in e?e.sessionRecording===!1?(this.vo(e),void this.ho()):(this.vo(e),void this.startIfEnabledOrStop()):(this.no===Wt&&(this.no=Ti,je.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(i,e){var t;e===void 0&&(e="log"),(t=this.io)!=null&&t.log?this.io.log(i,e):je.warn("log called before recorder was ready")}get uo(){var i,e,t=(i=this._instance)==null||(i=i.persistence)==null?void 0:i.get_property(ut);return(t==null||(e=t.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}fo(){var i,e,t=this._instance.get_property(ut);if(!t)return!1;try{e=typeof t=="object"?t:JSON.parse(t)}catch(s){return je.warn("persisted remote config for session recording is invalid and will be ignored",s),!1}var r=(i=e.cache_timestamp)!==null&&i!==void 0?i:Date.now();return 36e5>=Date.now()-r}lo(i){var e,t;if((e=F.__PosthogExtensions__)==null||!e.initSessionRecording)return je.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[io]:!0});if(this.io||(this.io=(t=F.__PosthogExtensions__)==null?void 0:t.initSessionRecording(this._instance),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fo())return this.no===Ti||this.no===Wt?void 0:(this.no=Wt,je.info("persisted remote config is stale, requesting fresh config before starting"),void new Ro(this._instance).load());this.no=ta,this.io.start(i)}onRRwebEmit(i){var e;(e=this.io)==null||e.onRRwebEmit==null||e.onRRwebEmit(i)}overrideLinkedFlag(){var i,e;this.io||(e=this.mi)==null||e.register({[Va]:!0}),(i=this.io)==null||i.overrideLinkedFlag()}overrideSampling(){var i,e;this.io||(e=this.mi)==null||e.register({[Ya]:!0}),(i=this.io)==null||i.overrideSampling()}overrideTrigger(i){var e,t;this.io||(t=this.mi)==null||t.register({[i==="url"?Za:Xa]:!0}),(e=this.io)==null||e.overrideTrigger(i)}get sdkDebugProperties(){var i;return((i=this.io)==null?void 0:i.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(i,e){var t;return!((t=this.io)==null||!t.tryAddCustomEvent(i,e))}}},Vc={autocapture:class{constructor(i){this.po=!1,this.mo=null,this.yo=!1,this.bo=!1,this.instance=i,this.rageclicks=new Zn(i.config.rageclick),this._o=null}initialize(){this.startIfEnabled()}get Te(){var i,e,t=Y(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=(i=t.url_allowlist)==null?void 0:i.map(r=>new RegExp(r)),t.url_ignorelist=(e=t.url_ignorelist)==null?void 0:e.map(r=>new RegExp(r)),t}
22wo(){if(this.isBrowserSupported()){if(g&&T){var i=t=>{t=t||(g==null?void 0:g.event);try{this.xo(t)}catch(r){Or.error("Failed to capture event",r)}};if(ee(T,"submit",i,{capture:!0}),ee(T,"change",i,{capture:!0}),ee(T,"click",i,{capture:!0}),this.Te.capture_copied_text){var e=t=>{t=t||(g==null?void 0:g.event);try{this.xo(t,Cr)}catch(r){Or.error("Failed to capture copy/cut event",r)}};ee(T,"copy",e,{capture:!0}),ee(T,"cut",e,{capture:!0})}}}else Or.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.po&&(this.wo(),this.po=!0)}onRemoteConfig(i){if(this.yo=!0,i.ok){var e=i.config;e.elementsChainAsString&&(this.bo=e.elementsChainAsString);var t=e.autocapture_opt_out;Oe(t)&&(this.instance.persistence&&this.instance.persistence.register({[is]:t}),this.mo=t),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(i){this._o=i}getElementSelectors(i){var e,t=[];return(e=this._o)==null||e.forEach(r=>{var s=T==null?void 0:T.querySelectorAll(r);s==null||s.forEach(n=>{i===n&&t.push(r)})}),t}get isEnabled(){var i,e,t=(i=this.instance.persistence)==null?void 0:i.props[is],r=this.mo,s=this.instance.Ur()&&!this.yo;if(ge(r)&&!Oe(t)&&!s)return!1;var n=(e=this.mo)!==null&&e!==void 0?e:!!t;return!!this.instance.config.autocapture&&!n}xo(i,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var t,r=xr(i);lo(r)&&(r=r.parentNode||null),e==="$autocapture"&&i.type==="click"&&i instanceof MouseEvent&&this.instance.config.rageclick&&(t=this.rageclicks)!=null&&t.isRageClick(i.clientX,i.clientY,i.timeStamp||new Date().getTime())&&Rn(r,this.instance.config.rageclick)&&this.xo(i,"$rageclick");var s=e===Cr;if(r&&function(h,d,v,p,f,b){var m;if(!g||Ws(h)||v!=null&&v.url_allowlist&&!$n(v.url_allowlist,b)||v!=null&&v.url_ignorelist&&$n(v.url_ignorelist,b))return!1;if(v!=null&&v.dom_event_allowlist){var k=v.dom_event_allowlist;if(k&&!k.some(y=>d.type===y))return!1}var E=fo(h,p),S=E.parentIsUsefulElement,$=E.targetElementList;if(!function(y,P){var I=P==null?void 0:P.element_allowlist;if(w(I))return!0;var M,R=function(z){if(I.some(K=>z.tagName.toLowerCase()===K))return{v:!0}};for(var N of y)if(M=R(N))return M.v;return!1}($,v)||!bs($,v==null?void 0:v.css_selector_allowlist)||bs($,(m=v==null?void 0:v.css_selector_ignorelist)!==null&&m!==void 0?m:Yu))return!1;try{var D=g.getComputedStyle(h);if(D&&D.getPropertyValue("cursor")==="pointer"&&d.type==="click")return!0}catch{}var A=h.tagName.toLowerCase();switch(A){case"html":return!1;case"form":return(f||["submit"]).indexOf(d.type)>=0;case"input":case"select":case"textarea":return(f||["change","click"]).indexOf(d.type)>=0;default:return S?(f||["click"]).indexOf(d.type)>=0:(f||["click"]).indexOf(d.type)>=0&&(Gs.indexOf(A)>-1||h.getAttribute("contenteditable")==="true")}}(r,i,this.Te,s,s?["copy","cut"]:void 0,this.instance)){var n=Hc(r,{e:i,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.bo,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),a=n.props;if(n.explicitNoCapture)return!1;var o=this.getElementSelectors(r);if(o&&o.length>0&&(a.$element_selectors=o),e===Cr){var l,u=ho(g==null||(l=g.getSelection())==null?void 0:l.toString()),c=i.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=c}return this.instance.capture(e,a),!0}}}isBrowserSupported(){return Ce(T==null?void 0:T.querySelectorAll)}},historyAutocapture:class{constructor(i){var e;this._instance=i,this.ko=(g==null||(e=g.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(x.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.So&&this.So(),this.So=void 0,x.info("History API monitoring stopped")}monitorHistoryChanges(){g&&g.history&&(this.Co("pushState"),this.Co("replaceState"),this.Io())}Co(i){var e;if(g&&((e=g.history[i])==null||!e.__posthog_wrapped__)){var t=this;(function(r,s,n){try{if(!(s in r))return Xn;var a={next:r[s]},o=n(function(){for(var l=arguments.length,u=new Array(l),c=0;l>c;c++)u[c]=arguments[c];return a.next.apply(this,u)});return Ce(o)&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:a}})),r[s]=o,()=>{if(r[s]!==o)for(var l=r[s];Ce(l)&&l.__posthog_layer__;){var u=l.__posthog_layer__;if(u.next===o)return void(u.next=a.next);l=u.next}else r[s]=a.next}}catch{return Xn}})(g.history,i,r=>function(s,n,a){r.call(this,s,n,a),t.To(i)})}}To(i){try{var e,t=g==null||(e=g.location)==null?void 0:e.pathname;if(!t)return;t!==this.ko&&this.isEnabled&&this._instance.capture(wt,{navigation_type:i}),this.ko=t}catch(r){x.error("Error capturing "+i+" pageview",r)}}Io(){if(!this.So){var i=()=>{this.To("popstate")};ee(g,"popstate",i),this.So=()=>{g&&g.removeEventListener("popstate",i)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(i){var e;this.Mo=!1,this.po=!1,this.Eo=null,this.instance=i,this.Mo=!((e=this.instance.persistence)==null||!e.props[rs]),this.rageclicks=new Zn(i.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var i=5e3;return Y(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(i=this.Te.capture_heatmaps.flush_interval_milliseconds),i}get isEnabled(){return O(this.Te.capture_heatmaps)?O(this.Te.enable_heatmaps)?this.Mo:this.Te.enable_heatmaps:this.Te.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.po)return;zc.info("starting..."),this.Ro(),this.ke()}else{var i;clearInterval((i=this.Eo)!==null&&i!==void 0?i:void 0),this.Po(),this.getAndClearBuffer()}}onRemoteConfig(i){if(i.ok){var e=i.config;if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[rs]:t}),this.Mo=t,this.startIfEnabled()}}}getAndClearBuffer(){var i=this.R;return this.R=void 0,i}Oo(i){Lr(i.originalEvent)&&this.pe(i.originalEvent,"deadclick")}ke(){this.Eo&&clearInterval(this.Eo),this.Eo=(T==null?void 0:T.visibilityState)==="visible"?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}Ro(){g&&T&&(this.Fo=this.oi.bind(this),ee(g,Zi,this.Fo),this.Lo=i=>this.pe(i||(g==null?void 0:g.event)),ee(T,"click",this.Lo,{capture:!0}),this.$o=i=>this.Ao(i||(g==null?void 0:g.event)),ee(T,"mousemove",this.$o,{capture:!0}),this.No=new On(this.instance,rc,this.Oo.bind(this)),this.No.startIfEnabledOrStop(),this.Do=this.ke.bind(this),ee(T,Vi,this.Do),this.po=!0)}Po(){var i;g&&T&&(this.Fo&&g.removeEventListener(Zi,this.Fo),this.Lo&&T.removeEventListener("click",this.Lo,{capture:!0}),this.$o&&T.removeEventListener("mousemove",this.$o,{capture:!0}),this.Do&&T.removeEventListener(Vi,this.Do),clearTimeout(this.qo),(i=this.No)==null||i.stop(),this.po=!1)}jo(i,e){var t=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),s=this.instance.scrollManager.scrollElement(),n=function(a,o,l){for(var u=a;u&&Qe(u)&&!Ee(u,"body");){if(u===l)return!1;var c=void 0;try{var h,d,v;c=(h=(d=(v=u.ownerDocument)==null?void 0:v.defaultView)!==null&&d!==void 0?d:g)==null?void 0:h.getComputedStyle(u).position}catch{return!1}if(C(o,c))return!0;u=po(u)}return!1}(xr(i),["fixed","sticky"],s);return{x:i.clientX+(n?0:r),y:i.clientY+(n?0:t),target_fixed:n,type:e}}pe(i,e){var t;if(e===void 0&&(e="click"),!Pn(i.target)&&Lr(i)){var r=this.jo(i,e);(t=this.rageclicks)!=null&&t.isRageClick(i.clientX,i.clientY,new Date().getTime())&&Rn(xr(i),this.instance.config.rageclick)&&this.Wt(_({},r,{type:"rageclick"})),this.Wt(r)}}Ao(i){!Pn(i.target)&&Lr(i)&&(clearTimeout(this.qo),this.qo=setTimeout(()=>{this.Wt(this.jo(i,"mousemove"))},500))}Wt(i){if(g){var e=this.Te.disable_capture_url_hashes?Xe(g.location.href):g.location.href,t=this.Te.custom_personal_data_properties,r=this.Te.mask_personal_data_properties?[...Mt,...t||[]]:[],s=hi(e,r,di);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(i)}}oi(){this.R&&!Ze(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:On,webVitalsAutocapture:class{constructor(i){var e;this.Mo=!1,this.po=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Ho=()=>{clearTimeout(this.Bo),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((t,r)=>_({},t,{["$web_vitals_"+r.name+"_event"]:_({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Uo=t=>{var r;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.zo();if(!w(s))if(O(t==null?void 0:t.name)||O(t==null?void 0:t.value))it.error("Invalid metric received",t);else if(!this.Vo||this.Vo>t.value){this.R.url!==s&&(this.Ho(),this.Bo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),w(this.R.url)&&(this.R.url=s),this.R.firstMetricTimestamp=w(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0);var n=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0),a=_({},t,{$current_url:s,timestamp:Date.now()});w(n)||(a.$session_id=n.sessionId,a.$window_id=n.windowId),this.R.metrics.push(a),this.R.metrics.length===this.allowedMetrics.length&&this.Ho()}else it.error("Ignoring metric with value >= "+this.Vo,t)},this.Wo=()=>
22{if(!this.po){var t,r,s,n,a=F.__PosthogExtensions__;if(!w(a)&&!w(a.postHogWebVitalsCallbacks)){var o=a.postHogWebVitalsCallbacks;t=o.onLCP,r=o.onCLS,s=o.onFCP,n=o.onINP}t&&r&&s&&n?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.Uo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Uo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&s(this.Uo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&n(this.Uo.bind(this)),this.po=!0):it.error("web vitals callbacks not loaded - not starting")}},this._instance=i,this.Mo=!((e=this._instance.persistence)==null||!e.props[os]),this.startIfEnabled()}get Zo(){return this._instance.config.capture_performance}get allowedMetrics(){var i,e,t=Y(this.Zo)?(i=this.Zo)==null?void 0:i.web_vitals_allowed_metrics:void 0;return O(t)?((e=this._instance.persistence)==null?void 0:e.props[ls])||["CLS","FCP","INP","LCP"]:t}get flushToCaptureTimeoutMs(){return(Y(this.Zo)?this.Zo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var i=Y(this.Zo)?this.Zo.web_vitals_attribution:void 0;return i!=null&&i}get Vo(){var i=Y(this.Zo)&&ce(this.Zo.__web_vitals_max_value)?this.Zo.__web_vitals_max_value:Qn;return i>0&&6e4>=i?Qn:i}get isEnabled(){var i=se==null?void 0:se.protocol;if(i!=="http:"&&i!=="https:")return it.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Y(this.Zo)?this.Zo.web_vitals:Oe(this.Zo)?this.Zo:void 0;return Oe(e)?e:this.Mo}startIfEnabled(){this.isEnabled&&!this.po&&(it.info("enabled, starting..."),this.tr(this.Wo))}onRemoteConfig(i){if(i.ok){var e=i.config;if("capturePerformance"in e){var t=Y(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=Y(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[os]:t}),this._instance.persistence.register({[ls]:r})),this.Mo=t,this.startIfEnabled()}}}tr(i){var e,t;(e=F.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?i():(t=F.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",r=>{r?it.error("failed to load script",r):i()})}zo(){var i=g?this._instance.config.disable_capture_url_hashes?Xe(g.location.href):g.location.href:void 0;if(i){var e=this._instance.config.custom_personal_data_properties,t=this._instance.config.mask_personal_data_properties?[...Mt,...e||[]]:[];return hi(i,t,di)}it.error("Could not determine current URL")}}},Zc={exceptionObserver:class{constructor(i){var e;this.Wo=()=>{var t;if(g&&this.isEnabled&&(t=F.__PosthogExtensions__)!=null&&t.errorWrappingFunctions){var r=F.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=F.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,n=F.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Go&&this.Te.capture_unhandled_errors&&(this.Go=r(this.captureException.bind(this))),!this.Qo&&this.Te.capture_unhandled_rejections&&(this.Qo=s(this.captureException.bind(this))),!this.Jo&&this.Te.capture_console_errors&&(this.Jo=n(this.captureException.bind(this)))}catch(a){Gt.error("failed to start",a),this.Ko()}}},this._instance=i,this.Yo=!((e=this._instance.persistence)==null||!e.props[ss]),this.Xo=new Zl(_({},function(t){var r,s,n,a;return t===void 0&&(t={}),{refillRate:(r=(s=t.exceptionRateLimiterRefillRate)!==null&&s!==void 0?s:t.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(n=(a=t.exceptionRateLimiterBucketSize)!==null&&a!==void 0?a:t.__exceptionRateLimiterBucketSize)!==null&&n!==void 0?n:10}}(this._instance.config.error_tracking),{refillInterval:1e4,it:Gt})),this.Te=this.ta(),this.startIfEnabledOrStop()}ta(){var i=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Y(i)?e=_({},e,i):(w(i)?this.Yo:i)&&(e=_({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Gt.info("enabled"),this.Ko(),this.tr(this.Wo)):this.Ko()}tr(i){var e,t;(e=F.__PosthogExtensions__)!=null&&e.errorWrappingFunctions?i():(t=F.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return Gt.error("failed to load script",r);i()})}Ko(){var i,e,t;(i=this.Go)==null||i.call(this),this.Go=void 0,(e=this.Qo)==null||e.call(this),this.Qo=void 0,(t=this.Jo)==null||t.call(this),this.Jo=void 0}onRemoteConfig(i){if(i.ok){var e=i.config;"autocaptureExceptions"in e&&(this.Yo=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[ss]:this.Yo}),this.Te=this.ta(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ta()}captureException(i){var e,t,r,s=(e=i==null||(t=i.$exception_list)==null||(t=t[0])==null?void 0:t.type)!==null&&e!==void 0?e:"Exception";this.Xo.consumeRateLimit(s)?Gt.info("Skipping exception capture because of client rate limiting.",{exception:s}):(r=this._instance.exceptions)==null||r.sendExceptionEvent(i)}},exceptions:class{constructor(i){var e,t;this.ea=[],this.ra=new vu([new xu,new Ru,new ku,new Eu,new Fu,new $u,new Tu,new Iu],function(r){for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;s>a;a++)n[a-1]=arguments[a];return function(o,l){l===void 0&&(l=0);for(var u=[],c=o.split(`
23`),h=l;c.length>h;h++){var d=c[h];if(1024>=d.length){var v=xn.test(d)?d.replace(xn,"$1"):d;if(!v.match(/\S*Error: /)){for(var p of n){var f=p(v,r);if(f){u.push(f);break}}if(u.length>=50)break}}}return function(b){if(!b.length)return[];var m=Array.from(b);return m.reverse(),m.slice(0,50).map(k=>{return _({},k,{filename:k.filename||(E=m,E[E.length-1]||{}).filename,function:k.function||It});var E})}(u)}}("web:javascript",mu,wu)),this._instance=i,this.ea=(e=(t=this._instance.persistence)==null?void 0:t.get_property(ns))!==null&&e!==void 0?e:[],this.ia=Bi(this.na()),this.sa=new Cu(this.ia)}onConfigChange(){this.ia=Bi(this.na()),this.sa.setConfig(this.ia)}onRemoteConfig(i){var e,t,r;if(i.ok){var s=i.config;if("errorTracking"in s){var n=(e=(t=s.errorTracking)==null?void 0:t.suppressionRules)!==null&&e!==void 0?e:[],a=(r=s.errorTracking)==null?void 0:r.captureExtensionExceptions;this.ea=n,this._instance.persistence&&this._instance.persistence.register({[ns]:this.ea,[as]:a})}}}get oa(){var i,e=!!this._instance.get_property(as),t=this._instance.config.error_tracking.captureExtensionExceptions;return(i=t??e)!==null&&i!==void 0&&i}buildProperties(i,e){return this.ra.buildFromUnknown(i,{syntheticException:e==null?void 0:e.syntheticException,mechanism:{handled:e==null?void 0:e.handled}})}addExceptionStep(i,e){if(this.ia.enabled)try{if(!B(i)||i.trim().length===0)return void He.warn("Ignoring exception step because message must be a non-empty string");var t=function(n){if(!n)return{sanitizedProperties:{},droppedKeys:[]};var a=[];return{sanitizedProperties:Object.keys(n).reduce((o,l)=>Mu.has(l)?(a.push(l),o):(o[l]=n[l],o),{}),droppedKeys:a}}(this.aa(e)),r=t.sanitizedProperties,s=t.droppedKeys;s.length>0&&He.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.sa.add(_({[zi]:i,[Ui]:new Date().toISOString()},r))}catch(n){He.error("Failed to add exception step. Ignoring breadcrumb.",n)}}sendExceptionEvent(i){try{var e=i.$exception_list;
23if(this.la(e)){if(this.ua(e))return this.ha("Exception dropped: matched a suppression rule"),void He.info("Skipping exception capture because a suppression rule matched");if(!this.oa&&this.da(e))return this.ha("Exception dropped: thrown by a browser extension"),void He.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ca(e))return this.ha("Exception dropped: thrown by the PostHog SDK"),void He.info("Skipping exception capture because it was thrown by the PostHog SDK")}var t=this.ia.enabled&&O(i.$exception_steps)?this.va(i):i;try{var r=this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return r&&this.sa.clear(),r}catch(s){return He.error("Failed to capture exception event. Dropping this exception.",s),void this.sa.clear()}}catch(s){return void He.error("Failed to process exception event. Ignoring this exception.",s)}}va(i){try{var e=this.sa.getAttachable();return e.length===0?i:_({},i,{$exception_steps:e})}catch(t){return He.error("Failed to read buffered exception steps. Capturing exception without steps.",t),i}}ha(i){this.ia.enabled&&this.sa.add({[zi]:i,[Ui]:new Date().toISOString()})}aa(i){return Y(i)?_({},i):{}}na(){var i,e;return(i=(e=this._instance.config.error_tracking)==null?void 0:e.exception_steps)!==null&&i!==void 0?i:{}}ua(i){if(i.length===0)return!1;var e=i.reduce((t,r)=>{var s=r.type,n=r.value;return B(s)&&s.length>0&&t.$exception_types.push(s),B(n)&&n.length>0&&t.$exception_values.push(n),t},{$exception_types:[],$exception_values:[]});return this.ea.some(t=>{var r=t.values.map(s=>{var n,a=Uo[s.operator],o=L(s.value)?s.value:[s.value],l=(n=e[s.key])!==null&&n!==void 0?n:[];return o.length>0&&a(o,l)});return t.type==="OR"?r.some(Boolean):r.every(Boolean)})}da(i){return i.flatMap(e=>{var t,r;return(t=(r=e.stacktrace)==null?void 0:r.frames)!==null&&t!==void 0?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}ca(i){if(i.length>0){var e,t,r,s,n=(e=(t=i[0].stacktrace)==null?void 0:t.frames)!==null&&e!==void 0?e:[],a=n[n.length-1];return(r=a==null||(s=a.filename)==null?void 0:s.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}
23la(i){return!O(i)&&L(i)}}},Xc=_({productTours:class{get mi(){return this._instance.persistence}constructor(i){this.fa=null,this.pa=null,this._instance=i}initialize(){this.loadIfEnabled()}onRemoteConfig(i){if(i.ok){var e=i.config;if("productTours"in e){var t,r;if(this.mi&&this.mi.register({[Hs]:!!e.productTours}),!Nr(this._instance))return!this.fa&&O((t=this.mi)==null?void 0:t.props[Zt])||Dr.info("product tours disabled; stopping and clearing cached tours"),(r=this.fa)==null||r.stop(),this.fa=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.fa&&Nr(this._instance)&&this.tr(()=>this.ga())}tr(i){var e,t;(e=F.__PosthogExtensions__)!=null&&e.generateProductTours?i():(t=F.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,"product-tours",r=>{r?Dr.error("Could not load product tours script",r):i()})}ga(){var i;!this.fa&&(i=F.__PosthogExtensions__)!=null&&i.generateProductTours&&(this.fa=F.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(i,e){if(e===void 0&&(e=!1),!L(this.pa)||e){var t=this.mi;if(t){var r=t.props[Zt];if(L(r)&&!e)return this.pa=r,void i(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",timestampMode:"query",callback:s=>{if(Nr(this._instance)){var n=s.statusCode;if(n!==200||!s.json){var a="Product Tours API could not be loaded, status: "+n;return Dr.error(a),void i([],{isLoaded:!1,error:a})}var o=L(s.json.product_tours)?s.json.product_tours:[];this.pa=o,t&&t.register({[Zt]:o}),i(o,{isLoaded:!0})}else i([],{isLoaded:!0})}})}else i(this.pa,{isLoaded:!0})}getActiveProductTours(i){O(this.fa)?i([],{isLoaded:!1,error:"Product tours not loaded"}):this.fa.getActiveProductTours(i)}showProductTour(i){var e;(e=this.fa)==null||e.showTourById(i)}previewTour(i){this.fa?this.fa.previewTour(i):this.tr(()=>{var e;this.ga(),(e=this.fa)==null||e.previewTour(i)})}dismissProductTour(){var i;(i=this.fa)==null||i.dismissTour("user_clicked_skip")}nextStep(){var i;(i=this.fa)==null||i.nextStep()}previousStep(){var i;(i=this.fa)==null||i.previousStep()}clearCache(){var i;this.pa=null,(i=this.mi)==null||i.unregister(Zt)}resetTour(i){var e;(e=this.fa)==null||e.resetTour(i)}resetAllTours(){var i;(i=this.fa)==null||i.resetAllTours()}cancelPendingTour(i){var e;(e=this.fa)==null||e.cancelPendingTour(i)}}},ur),Qc={siteApps:class{constructor(i){this.ma=0,this._instance=i,this.ya=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ba(i,e){if(e){var t=this.globalsForEvent(e);this.ya.push(t),this.ya.length>1e3&&(this.ya=this.ya.slice(10))}}get siteAppLoaders(){var i;return(i=F._POSTHOG_REMOTE_CONFIG)==null||(i=i[this._instance.config.token])==null?void 0:i.siteApps}initialize(){if(this.isEnabled){var i=this._instance._addCaptureHook(this.ba.bind(this));this._a=()=>{i(),this.ya=[],this._a=void 0}}}globalsForEvent(i){var e,t,r,s,n,a,o;if(!i)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],c=this._instance.get_property("$stored_group_properties")||{};for(var h of Object.entries(c)){var d=h[0];l[d]={id:u[d],type:d,properties:h[1]}}var v=i.$set_once,p=i.$set;return{event:_({},va(i,Uc),{properties:_({},i.properties,p?{$set:_({},(e=(t=i.properties)==null?void 0:t.$set)!==null&&e!==void 0?e:{},p)}:{},v?{$set_once:_({},(r=(s=i.properties)==null?void 0:s.$set_once)!==null&&r!==void 0?r:{},v)}:{}),elements_chain:(n=(a=i.properties)==null?void 0:a.$elements_chain)!==null&&n!==void 0?n:"",distinct_id:(o=i.properties)==null?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}wa(i){var e,t=(e=i.tagName)==null?void 0:e.toLowerCase();return t==="style"&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(i)||(Ae.error("prepare_external_dependency_stylesheet returned null"),null):t==="script"&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(i)||(Ae.error("prepare_external_dependency_script returned null"),null):i}xa(){var i,e,t,r,s,n,a,o;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var l=T==null?void 0:T.defaultView,u=l==null||(i=l.Node)==null?void 0:i.prototype;if(!l||!u)return()=>{};if(this.ma++,this.ka)return this.Sa();var c=[],h=this,d=new WeakSet,v=(b,m,k)=>{if(b!=null&&b[m]){var E=b[m];b[m]=k(E),c.push(()=>{b[m]=E})}},p=b=>{if(d.has(b))return b;var m=h.wa(b);return m&&d.add(m),m},f=b=>b.map(m=>typeof m=="string"?m:p(m)).filter(m=>!ge(m));return v(u,"appendChild",b=>function(m){var k=p(m);return k?b.call(this,k):m}),v(u,"insertBefore",b=>function(m,k){var E=p(m);return E?b.call(this,E,k):m}),v(u,"replaceChild",b=>function(m,k){var E=p(m);return E?b.call(this,E,k):k}),[(e=l.Element)==null?void 0:e.prototype,(t=l.Document)==null?void 0:t.prototype,(r=l.DocumentFragment)==null?void 0:r.prototype].forEach(b=>{v(b,"append",m=>function(){for(var k=arguments.length,E=new Array(k),S=0;k>S;S++)E[S]=arguments[S];return m.apply(this,f(E))}
23),v(b,"prepend",m=>function(){for(var k=arguments.length,E=new Array(k),S=0;k>S;S++)E[S]=arguments[S];return m.apply(this,f(E))})}),[(s=l.Element)==null?void 0:s.prototype,(n=l.CharacterData)==null?void 0:n.prototype,(a=l.DocumentType)==null?void 0:a.prototype].forEach(b=>{v(b,"before",m=>function(){for(var k=arguments.length,E=new Array(k),S=0;k>S;S++)E[S]=arguments[S];return m.apply(this,f(E))}),v(b,"after",m=>function(){for(var k=arguments.length,E=new Array(k),S=0;k>S;S++)E[S]=arguments[S];return m.apply(this,f(E))}),v(b,"replaceWith",m=>function(){for(var k=arguments.length,E=new Array(k),S=0;k>S;S++)E[S]=arguments[S];var $=f(E);return E.length&&!$.length?void 0:m.apply(this,$)})}),v((o=l.Element)==null?void 0:o.prototype,"insertAdjacentElement",b=>function(m,k){var E=p(k);return E?b.call(this,m,E):null}),this.ka=()=>{c.forEach(b=>b()),this.ka=void 0},this.Sa()}Sa(){var i=!1;return()=>{var e;i||(i=!0,this.ma--,this.ma===0&&((e=this.ka)==null||e.call(this)))}}Ca(i,e){e===void 0&&(e=!0);var t=this.xa();try{var r=i(t);return e&&t(),r}catch(s){throw t(),s}}setupSiteApp(i){var e=this.apps[i.id],t=()=>{var a;!e.errored&&this.ya.length&&(Ae.info("Processing "+this.ya.length+" events for site app with id "+i.id),this.ya.forEach(o=>this.Ca(()=>e.processEvent==null?void 0:e.processEvent(o))),e.processedBuffer=!0),Object.values(this.apps).every(o=>o.processedBuffer||o.errored)&&((a=this._a)==null||a.call(this))},r=!1,s=a=>{e.errored=!a,e.loaded=!0,Ae.info("Site app with id "+i.id+" "+(a?"loaded":"errored")),r&&t()};try{var n=this.Ca(a=>i.init({posthog:this._instance,callback(o){a(),s(o)}}),!1).processEvent;n&&(e.processEvent=n),r=!0}catch(a){Ae.error(ia+i.id,a),s(!1)}if(r&&e.loaded)try{t()}catch(a){Ae.error("Error while processing buffered events PostHog app with config id "+i.id,a),e.errored=!0}}Ia(){var i=this.siteAppLoaders||[];for(var e of i)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var t of i)this.setupSiteApp(t)}Ta(i){var e=this;if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(i),r=function(n){try{e.Ca(()=>n.processEvent==null?void 0:n.processEvent(t))}catch(a){Ae.error("Error while processing event "+i.event+" for site app "+n.id,a)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(i){var e,t,r,s=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.Ia(),void this._instance.on("eventCaptured",l=>this.Ta(l))):void Ae.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((t=this._a)==null||t.call(this),i.ok){var n=i.config;if((r=n.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(){var l,u=o.id,c=o.url;F["__$$ph_site_app_"+u]=s._instance,(l=F.__PosthogExtensions__)==null||l.loadSiteApp==null||l.loadSiteApp(s._instance,c,h=>{if(h)return Ae.error(ia+u,h)})};for(var o of n.siteApps)a()}else Ae.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},eh={tracingHeaders:class{constructor(i){this.Ma=void 0,this.Ea=void 0,this.Ra=void 0,this.Wo=()=>{var e,t,r=this.Pa();r?(w(this.Ma)&&(this.Ma=(e=F.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null?void 0:e._patchXHR(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),w(this.Ea)&&(this.Ea=(t=F.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null?void 0:t._patchFetch(r,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Ko()},this._instance=i}initialize(){this.startIfEnabledOrStop()}tr(i){var e,t;(e=F.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns?i():(t=F.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return qc.error("failed to load script",r);i()})}Oa(){var i,e;return(i=(e=this._instance.config.tracing_headers)!==null&&e!==void 0?e:this._instance.config.addTracingHeaders)!==null&&i!==void 0?i:this._instance.config.__add_tracing_headers}Pa(){var i=this.Oa();return L(i)?(L(this.Ra)?this.Ra.splice(0,this.Ra.length,...i):this.Ra=[...i],i.length>0?this.Ra:void 0):(L(this.Ra)&&this.Ra.splice(0),this.Ra=i||void 0,this.Ra)}Ko(){var i,e;(i=this.Ma)==null||i.call(this),(e=this.Ea)==null||e.call(this),this.Ma=void 0,this.Ea=void 0}startIfEnabledOrStop(){this.Pa()?this.tr(this.Wo):this.Ko()}}},th=_({surveys:class{get Te(){return this._instance.config}constructor(i){this.Fa=void 0,this._surveyManager=null,this.La=!1,this.$a=[],this.Aa=null,this.Na=null,this._instance=i,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(i){if(!this.Te.disable_surveys){if(!i.ok)return q.warn("Remote config unavailable. Not loading surveys.");var e=i.config.surveys;if(O(e))return q.warn("Flags not loaded yet. Not loading surveys.");var t=L(e);this.Fa=t?e.length>0:e,q.info("flags response received, isSurveysEnabled: "+this.Fa),this.loadIfEnabled()}}reset(){try{var i;(i=this._surveyEventReceiver)==null||i.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);(r!=null&&r.startsWith(Wo)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach(s=>localStorage.removeItem(s))}catch{}}loadIfEnabled(){if(!this._surveyManager)if(this.La)q.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)q.info(ra);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())q.info("Not loading surveys in cookieless mode without consent.");else{var i=F==null?void 0:F.__PosthogExtensions__;if(i){if(!w(this.Fa)||this.Te.advanced_enable_surveys){var e=this.Fa||this.Te.advanced_enable_surveys;this.La=!0;try{var t=i.generateSurveys;if(t)return void this.Da(t,e);var r=i.loadExternalDependency;if(!r)return void this.qa(zs);r(this._instance,"surveys",s=>{s||!i.generateSurveys?this.qa("Could not load surveys script",s):this.Da(i.generateSurveys,e)})}catch(s){throw this.qa("Error initializing surveys",s),s}finally{this.La=!1}}}else q.error("PostHog Extensions not found.")}}Da(i,e){this._surveyManager=i(this._instance,e),this._surveyEventReceiver=new Wc(this._instance),q.info("Surveys loaded successfully"),this.ja({isLoaded:!0})}qa(i,e){q.error(i,e),this.ja({isLoaded:!1,error:i})}onSurveysLoaded(i){return this.$a.push(i),this._surveyManager&&this.ja({isLoaded:!0}),()=>{this.$a=this.$a.filter(e=>e!==i)}}getSurveys(i,e){if(e===void 0&&(e=!1),this.Te.disable_surveys)return q.info(ra),i([]);var t,r=this._instance.get_property(hs);if(r&&!e)return i(r,{isLoaded:!0}
23),void(this.Ha()&&this.getSurveys(()=>{},!0));typeof Promise<"u"&&this.Aa?this.Aa.then(s=>i(s.surveys,s.context)):(typeof Promise<"u"&&(this.Aa=new Promise(s=>{t=s})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:s=>{var n;this.Aa=null;var a=s.statusCode;if(a!==200||!s.json){var o="Surveys API could not be loaded, status: "+a;q.error(o),this.Na=Date.now();var l={isLoaded:!1,error:o};return i([],l),void(t==null||t({surveys:[],context:l}))}this.Na=null;var u,c=s.json.surveys||[],h=c.filter(v=>function(p){return!(!p.start_date||p.end_date)}(v)&&(Go(v)||function(p){var f;return!((f=p.conditions)==null||(f=f.actions)==null||(f=f.values)==null||!f.length)}(v)));h.length>0&&((u=this._surveyEventReceiver)==null||u.register(h)),(n=this._instance.persistence)==null||n.register({[hs]:c,[Ki]:Date.now()});var d={isLoaded:!0};i(c,d),t==null||t({surveys:c,context:d})}}))}Ha(){return this.Ba()&&!this.Aa&&!this.Ua()}Ba(){var i=this._instance.get_property(Ki);return ce(i)&&Date.now()-i>3e5}Ua(){return ce(this.Na)&&3e5>Date.now()-this.Na}markSurveyAsSeen(i,e){var t,r={id:i,current_iteration:(t=e==null?void 0:e.iteration)!==null&&t!==void 0?t:null};Ko(r);try{localStorage.setItem("lastSeenSurveyDate",new Date().toISOString())}catch{}}ja(i){for(var e of this.$a)try{if(!i.isLoaded)return e([],i);this.getSurveys(e)}catch(t){q.error("Error in survey callback",t)}}getActiveMatchingSurveys(i,e){if(e===void 0&&(e=!1),!O(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(i,e);q.warn("init was not called")}za(i){var e=null;return this.getSurveys(t=>{var r;e=(r=t.find(s=>s.id===i))!==null&&r!==void 0?r:null}),e}Va(i){if(O(this._surveyManager))return{eligible:!1,reason:jr};var e=typeof i=="string"?this.za(i):i;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(i){if(O(this._surveyManager))return q.warn("init was not called"),{visible:!1,disabledReason:jr};var e=this.Va(i);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(i,e){return O(this._surveyManager)?(q.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:jr})):new Promise(t=>{this.getSurveys(r=>{var s,n=(s=r.find(o=>o.id===i))!==null&&s!==void 0?s:null;if(n){var a=this.Va(n);t({visible:a.eligible,disabledReason:a.reason})}else t({visible:!1,disabledReason:"Survey not found"})},e)})}renderSurvey(i,e,t){var r;if(O(this._surveyManager))q.warn("init was not called");else{var s=typeof i=="string"?this.za(i):i;if(s!=null&&s.id)if(Rc.includes(s.type)){var n=T==null?void 0:T.querySelector(e);if(n)return(r=s.appearance)!=null&&r.surveyPopupDelaySeconds?(q.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var a,o;q.info("Rendering survey "+s.id+" with delay of "+((a=s.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(s,n,t),q.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n,t);q.warn("Survey element not found")}else q.warn("Surveys of type "+s.type+" cannot be rendered in the app");else q.warn("Survey not found")}}displaySurvey(i,e){var t;if(O(this._surveyManager))q.warn("init was not called");else{var r=this.za(i);if(r){var s=r;if((t=r.appearance)!=null&&t.surveyPopupDelaySeconds&&e.ignoreDelay&&(s=_({},r,{appearance:_({},r.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==xs.Popover&&e.initialResponses&&q.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var n=this.canRenderSurvey(r);if(!n.visible)return void q.warn("Survey is not eligible to be displayed: ",n.disabledReason)}e.displayType!==xs.Inline?this._surveyManager.handlePopoverSurvey(s,e):this.renderSurvey(s,e.selector,e.properties)}else q.warn("Survey not found")}}cancelPendingSurvey(i){O(this._surveyManager)?q.warn("init was not called"):this._surveyManager.cancelSurvey(i)}handlePageUnload(){var i;(i=this._surveyManager)==null||i.handlePageUnload==null||i.handlePageUnload()}}},ur),ih={toolbar:class{constructor(i){this.instance=i}Wa(i){F.ph_toolbar_state=i}Za(){var i;return(i=F.ph_toolbar_state)!==null&&i!==void 0?i:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(i,e,t){if(i===void 0&&(i=void 0),e===void 0&&(e=void 0),t===void 0&&(t=void 0),ro(this.instance.config)||!g||!T)return!1;i=i??g.location,t=t??g.history;try{if(!e){try{g.localStorage.setItem("test","test"),g.localStorage.removeItem("test")}catch{return!1}e=g==null?void 0:g.localStorage}var r,s=Kc||er(i.hash,"__posthog")||er(i.hash,"state"),n=s?Sn(()=>JSON.parse(atob(decodeURIComponent(s))))||Sn(()=>JSON.parse(decodeURIComponent(s))):null;return n&&n.action==="ph_authorize"?((r=n).source="url",r&&Object.keys(r).length>0&&(n.desiredHash?i.hash=n.desiredHash:t?t.replaceState(t.state,"",i.pathname+i.search):i.hash="")):((r=JSON.parse(e.getItem(sa)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch{return!1}}Ga(i){var e=F.ph_load_toolbar||F.ph_load_editor;!O(e)&&Ce(e)?e(i,this.instance):na.warn("No toolbar load function found")}
23loadToolbar(i){var e=!(T==null||!T.getElementById(oo));if(!g||e)return!1;var t=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=_({token:this.instance.config.token},i,{apiURL:this.instance.requestRouter.endpointFor("ui")},t?{instrument:!1}:{});if(g.localStorage.setItem(sa,JSON.stringify(_({},r,{source:void 0}))),this.Za()===2)this.Ga(r);else if(this.Za()===0){var s;this.Wa(1),(s=F.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"toolbar",n=>{if(n)return na.error("[Toolbar] Failed to load",n),void this.Wa(0);this.Wa(2),this.Ga(r)}),ee(g,"turbolinks:load",()=>{this.Wa(0),this.loadToolbar(r)})}return!0}Qa(i){return this.loadToolbar(i)}maybeLoadEditor(i,e,t){return i===void 0&&(i=void 0),e===void 0&&(e=void 0),t===void 0&&(t=void 0),this.maybeLoadToolbar(i,e,t)}}},rh=_({experiments:he},ur),sh={conversations:class{constructor(i){this.Ja=void 0,this._conversationsManager=null,this.Ka=!1,this.Ya=null,this._instance=i}initialize(){this.loadIfEnabled()}onRemoteConfig(i){if(!this._instance.config.disable_conversations&&i.ok){var e=i.config.conversations;O(e)||(Oe(e)?this.Ja=e:(this.Ja=e.enabled,this.Ya=e),this.loadIfEnabled())}}reset(){var i;(i=this._conversationsManager)==null||i.reset(),this._conversationsManager=null,this.Ja=void 0,this.Ya=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ka||this._instance.config.disable_conversations||ro(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var i=F==null?void 0:F.__PosthogExtensions__;if(i&&!w(this.Ja)&&this.Ja)if(this.Ya&&this.Ya.token){this.Ka=!0;try{var e=i.initConversations;if(e)return this.Xa(e),void(this.Ka=!1);var t=i.loadExternalDependency;if(!t)return void this.tl(zs);t(this._instance,"conversations",r=>{r||!i.initConversations?this.tl("Could not load conversations script",r):this.Xa(i.initConversations),this.Ka=!1})}catch(r){this.tl("Error initializing conversations",r),this.Ka=!1}}else Pe.error("Conversations enabled but missing token in remote config.")}}Xa(i){if(this.Ya)try{this._conversationsManager=i(this.Ya,this._instance),Pe.info("Conversations loaded successfully")}catch(e){this.tl("Error completing conversations initialization",e)}else Pe.error("Cannot complete initialization: remote config is null")}tl(i,e){Pe.error(i,e),this._conversationsManager=null,this.Ka=!1}show(){this._conversationsManager?this._conversationsManager.show():Pe.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ja===!0&&!ge(this._conversationsManager)}isVisible(){var i,e;return(i=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&i!==void 0&&i}sendMessage(i,e,t){var r=this;return re(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(i,e,t):(Pe.warn(st),null)})()}getMessages(i,e){var t=this;return re(function*(){return t._conversationsManager?t._conversationsManager.getMessages(i,e):(Pe.warn(st),null)})()}markAsRead(i){var e=this;return re(function*(){return e._conversationsManager?e._conversationsManager.markAsRead(i):(Pe.warn(st),null)})()}getTickets(i){var e=this;return re(function*(){return e._conversationsManager?e._conversationsManager.getTickets(i):(Pe.warn(st),null)})()}requestRestoreLink(i){var e=this;return re(function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(i):(Pe.warn(st),null)})()}restoreFromToken(i){var e=this;return re(function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(i):(Pe.warn(st),null)})()}restoreFromUrlToken(){var i=this;return re(function*(){return i._conversationsManager?i._conversationsManager.restoreFromUrlToken():(Pe.warn(st),null)})()}getCurrentTicketId(){var i,e;return(i=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&i!==void 0?i:null}getWidgetSessionId(){var i,e;return(i=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&i!==void 0?i:null}En(){var i;(i=this._conversationsManager)==null||i.setIdentity()}Rn(){var i;(i=this._conversationsManager)==null||i.clearIdentity()}}},nh={logs:class{constructor(i){var e;this.el=!1,this.rl=!1,this.it=Z("[logs]"),this.Gr=[],this.il=[],this.Hs=0,this.nl=()=>{var t,r;this.Hs=0,(t=this.sl)==null||t.onReconnect(),(r=this.ol)==null||r.onReconnect()},this._instance=i,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.el=!0),g&&ee(g,"online",this.nl)}al(i,e,t,r){var s,n=function(a,o){var l,u,c,h,d,v,p,f=(l=a==null?void 0:a.flushIntervalMs)!==null&&l!==void 0?l:3e3,b=(u=a==null?void 0:a.maxBufferSize)!==null&&u!==void 0?u:100,m=o!=null&&o.consoleCapture?void 0:(c=a==null?void 0:a.maxLogsPerInterval)!==null&&c!==void 0?c:1e3,k=w(m)?Math.max(b,2048):Math.max(b,m),E=a==null?void 0:a.resourceAttributes;return{serviceName:(h=(d=E==null?void 0:E["service.name"])!==null&&d!==void 0?d:a==null?void 0:a.serviceName)!==null&&h!==void 0?h:o==null?void 0:o.serviceNameDefault,serviceVersion:(v=E==null?void 0:E["service.version"])!==null&&v!==void 0?v:a==null?void 0:a.serviceVersion,environment:(p=E==null?void 0:E["deployment.environment"])!==null&&p!==void 0?p:a==null?void 0:a.environment,resourceAttributes:E,beforeSend:a==null?void 0:a.beforeSend,flushIntervalMs:f,maxBufferSize:b,maxQueueSize:k,maxBatchRecordsPerPost:100,rateCapWindowMs:f,maxLogsPerInterval:m,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}((s=this._instance)==null||(s=s.config)==null?void 0:s.logs,t);return[new hu(this.ll(i,e),n,this.it,()=>this.ul(),a=>a(),void 0,r),n]}hl(){var i,e=(i=this._instance)==null||(i=i.config)==null?void 0:i.logs;if(!this.sl||this.dl!==e){var t;(t=this.sl)==null||t.reset(),this.dl=e;var r=this.al(()=>this.Gr,s=>{this.Gr=s});this.sl=r[0],this.cl=r[1]}return this.sl}vl(){var i,e=(i=this._instance)==null||(i=i.config)==null?void 0:i.logs;if(!this.ol||this.fl!==e){var t;(t=this.ol)==null||t.reset(),this.fl=e;var r=this.al(()=>this.il,s=>{this.il=s},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},ua);this.ol=r[0],this.pl=r[1]}return this.ol}initialize(){this.loadIfEnabled()}onRemoteConfig(i){var e;if(i.ok){var t=(e=i.config.logs)==null?void 0:e.captureConsoleLogs;!O(t)&&t&&(this.el=!0,this.loadIfEnabled())}}reset(){var i,e;this.Gr=[],(i=this.sl)==null||i.reset(),this.il=[],(e=this.ol)==null||e.reset(),this.Hs=0}captureLog(i){this.hl().captureLog(i)}le(i){this.vl().captureLog(i)}get logger(){return this.gl||(this.gl={trace:(i,e)=>this.captureLog({body:i,level:"trace",attributes:e}),debug:(i,e)=>this.captureLog({body:i,level:"debug",attributes:e}),info:(i,e)=>this.captureLog({body:i,level:"info",attributes:e}),warn:(i,e)=>this.captureLog({body:i,level:"warn",attributes:e}),error:(i,e)=>this.captureLog({body:i,level:"error",attributes:e}),fatal:(i,e)=>this.captureLog({body:i,level:"fatal",attributes:e})}),this.gl}flushLogs(i){i?this.ml(i):(this.sl&&this.sl.flush().catch(e=>this.it.error("PostHog logs flush failed:",e)),this.ol&&this.ol.flush().catch(e=>this.it.error("PostHog logs flush failed:",e)))}loadIfEnabled(){if(this.el&&!this.rl){var i=F==null?void 0:F.__PosthogExtensions__;if(i){var e=i.loadExternalDependency;e?e(this._instance,"logs",t=>{var r;t||(r=i.logs)==null||!r.initializeLogs?this.it.error("Could not load logs script",t):(i.logs.initializeLogs(this._instance),this.rl=!0)}):this.it.error(zs)}else this.it.error("PostHog Extensions not found.")}}ll(i,e){var t=this._instance;return{get isDisabled(){return!1},get optedOut(){return!t.is_capturing()},getPersistedProperty:r=>r===Ue.LogsQueue?i():void 0,setPersistedProperty(r,s){var n;r===Ue.LogsQueue&&e((n=s)!==null&&n!==void 0?n:[])},$t:r=>this.$t(r),getLibraryId:()=>U.LIB_NAME,getLibraryVersion:()=>U.LIB_VERSION}}$t(i){return new Promise(e=>{if(xo(this.Hs,3))e({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var t=!1,r=n=>{t||(t=!0,clearTimeout(s),e(n))},s=setTimeout(()=>r({kind:"retry-later",error:new Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.yl(),data:i,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:n=>{var a=n.statusCode;if(this.bl(a),a>=200&&300>a)r({kind:"ok"});else if(a===413)r({kind:"too-large"});else if(a!==0&&a!==429&&500>a)r({kind:"fatal",error:new Error("logs request failed with status "+a)});else{var o;r({kind:"retry-later",error:(o=n.error)!==null&&o!==void 0?o:new Error("logs request failed with status "+a)})}}})}})}bl(i){(i!==0||this._instance.__loaded)&&(this.Hs=Eo(i,this.Hs,3,()=>this.it.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}ml(i){this.Gr.length>0&&this._l(i,this.Gr,this.cl,U.LIB_NAME,e=>{this.Gr=e}),this.il.length>0&&this._l(i,this.il,this.pl,ua,e=>{this.il=e})}_l(i,e,t,r,s){if(e.length!==0){var n=e.map(o=>o.record);s([]);var a=Ua(n,za(t,U.LIB_NAME,U.LIB_VERSION),r,U.LIB_VERSION);this._instance._send_request({method:"POST",url:this.yl(),data:a,compression:"best-available",batchKey:"logs",transport:i})}}yl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}ul(){var i,e={};if(e.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var t=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=t.windowId,s=t.sessionStartTimestamp,n=t.lastActivityTimestamp;e.sessionId=t.sessionId,e.windowId=r,O(s)||(e.sessionStartTimestamp=s),O(n)||(e.lastActivityTimestamp=n)}if(F!=null&&(i=F.location)!=null&&i.href&&(e.currentUrl=this._instance.config.disable_capture_url_hashes?Xe(F.location.href):F.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(e.activeFeatureFlags=a)}return e}}},ah={metrics:class{constructor(i){this.it=Z("[metrics]"),this._instance=i}initialize(){}hl(){var i,e,t=(i=this._instance)==null||(i=i.config)==null?void 0:i.metrics;return this.sl&&this.dl===t||((e=this.sl)==null||e.reset(),this.dl=t,this.sl=new du(this.ll(),function(r){var s,n,a,o,l,u=r==null?void 0:r.resourceAttributes;return{serviceName:(s=u==null?void 0:u["service.name"])!==null&&s!==void 0?s:r==null?void 0:r.serviceName,serviceVersion:(n=u==null?void 0:u["service.version"])!==null&&n!==void 0?n:r==null?void 0:r.serviceVersion,environment:(a=u==null?void 0:u["deployment.environment"])!==null&&a!==void 0?a:r==null?void 0:r.environment,resourceAttributes:u,beforeSend:r==null?void 0:r.beforeSend,flushIntervalMs:(o=r==null?void 0:r.flushIntervalMs)!==null&&o!==void 0?o:1e4,maxSeriesPerFlush:(l=r==null?void 0:r.maxSeriesPerFlush)!==null&&l!==void 0?l:1e3}}(t),this.it)),this.sl}count(i,e,t){e===void 0&&(e=1),this.hl().count(i,e,t)}gauge(i,e,t){this.hl().gauge(i,e,t)}histogram(i,e,t){this.hl().histogram(i,e,t)}
23flush(i){if(!this.sl)return Promise.resolve();if(i){var e=this.sl.drainWindow();return e&&this.Kt(e,i),Promise.resolve()}return this.sl.flush().catch(t=>this.it.error("PostHog metrics flush failed:",t))}reset(){var i;(i=this.sl)==null||i.reset()}ll(){var i=this._instance,e=this;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},Kt:t=>e.Kt(t),getLibraryId:()=>U.LIB_NAME,getLibraryVersion:()=>U.LIB_VERSION}}Kt(i,e){return new Promise(t=>{var r=!1,s=a=>{r||(r=!0,clearTimeout(n),t(a))},n=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(_({method:"POST",url:this.wl(),data:i,compression:"best-available",batchKey:"metrics"},e&&{transport:e},{fireCallbackOnDrop:!0,callback(a){var o=a.statusCode;if(o>=200&&300>o)s({kind:"ok"});else if(o===413)s({kind:"too-large"});else if(o!==0&&o!==429&&500>o)s({kind:"fatal",error:new Error("metrics request failed with status "+o)});else{var l;s({kind:"retry-later",error:(l=a.error)!==null&&l!==void 0?l:new Error("metrics request failed with status "+o)})}}}))})}wl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},oh=_({},ur,Yc,Vc,Zc,Xc,Qc,th,eh,ih,rh,sh,nh,ah);$e.__defaultExtensionClasses=_({},oh);var dt=function(){U.SDK_DIST_CHANNEL="npm";var i=si[xt]=new $e;return function(){function e(){e.done||(e.done=!0,Yo=!1,G(si,function(t){t._dom_loaded()}))}T!=null&&T.addEventListener?T.readyState==="complete"?e():ee(T,"DOMContentLoaded",e,{capture:!1}):g&&x.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),i}();let nr=!1,Pi=null;const Rs=i=>{try{const e=new URL(i);return e.origin+e.pathname}catch{return String(i).split(/[?#]/)[0]}};function qr({apiKey:i,apiHost:e,appEnv:t}){nr||!i||(dt.init(i,{api_host:e||"https://us.i.posthog.com",capture_pageview:!1,capture_pageleave:!0,autocapture:!0,persistence:"localStorage+cookie",sanitize_properties:r=>(r.$current_url&&(r.$current_url=Rs(r.$current_url)),r.$referrer&&(r.$referrer=Rs(r.$referrer)),r)}),dt.register({app_env:t}),nr=!0)}let ca=null;function zr(){if(!nr)return;const i=Rs(window.location.href);i!==ca&&(ca=i,dt.capture("$pageview",{$current_url:i}))}function Ur(i,e){if(nr)if(i!=null&&i.member_id){const t=[i.member_id,(e==null?void 0:e.organization_id)??"",(e==null?void 0:e.organization_name)??""].join("|");if(Pi===t)return;Pi=t,dt.identify(i.member_id,{email:i.email_address,name:i.name,organization_id:e==null?void 0:e.organization_id,organization_name:e==null?void 0:e.organization_name})}else(Pi||lh())&&(Pi=null,dt.reset())}function lh(){return typeof dt._isIdentified=="function"&&dt._isIdentified()}Qo.string.isRequired;
23const uh="https://embeds.iubenda.com/widgets/ebfd7eba-2152-4746-a45f-ea5bc3388c18.js",ch="https://cdn.iubenda.com/cons/iubenda_cons.js",hh="7yoImdtW0tPM9BuyZVt6MtuBAvYQPmjN",dh=i=>JSON.stringify(i).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");function ph({gtmId:i}){return De.useEffect(()=>{i&&gi("gtm-init",{target:"head",innerHTML:`(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','${i}');`}),gi("iubenda-embed",{src:uh,async:!0}),gi("iubenda-cons-init",{innerHTML:`var _iub = _iub || {}; _iub.cons_instructions = _iub.cons_instructions || []; _iub.cons_instructions.push(["init", {api_key: "${hh}"}]);`}),gi("iubenda-cons",{src:ch,async:!0})},[i]),null}function vh({ENV:i,member:e,organization:t}){const r=Ms();return De.useEffect(()=>{qr==null||qr({apiKey:i.POSTHOG_API_KEY,apiHost:i.POSTHOG_API_HOST,appEnv:i.APP_ENV})},[i.POSTHOG_API_KEY,i.POSTHOG_API_HOST,i.APP_ENV]),De.useEffect(()=>{Ur==null||Ur(e,t)},[e,t]),De.useEffect(()=>{zr==null||zr()},[r.pathname,r.search]),null}function kh(){return H.jsx(tl,{})}function Sh(){const{auth:i,ENV:e}=nl(),t=Ms(),r=`${el}${t.pathname==="/"?"/":t.pathname.replace(/\/+$/,"")}`;return H.jsxs("html",{lang:"en",className:"h-full",children:[H.jsxs("head",{children:[H.jsx("meta",{charSet:"utf-8"}),H.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),H.jsx("script",{dangerouslySetInnerHTML:{__html:"window.dataLayer = window.dataLayer || [];"}}),e.META_DOMAIN_VERIFICATION&&H.jsx("meta",{name:"facebook-domain-verification",content:e.META_DOMAIN_VERIFICATION}),H.jsx("link",{rel:"canonical",href:r}),H.jsx("link",{rel:"icon",href:"/socialindex-favicon.png",type:"image/png"}),H.jsx("link",{rel:"preconnect",href:"https://embeds.iubenda.com",crossOrigin:""}),H.jsx("link",{rel:"preconnect",href:"https://cdn.iubenda.com",crossOrigin:""}),H.jsx("link",{rel:"preconnect",href:"https://www.googletagmanager.com",crossOrigin:""}),H.jsx(al,{}),H.jsx(ol,{})]}),H.jsxs("body",{className:"min-h-full font-body antialiased",children:[H.jsx(Xo,{initialData:i,children:H.jsx(Vo,{children:H.jsx("main",{className:"",children:H.jsx(cl,{})})})}),H.jsx(hl,{}),H.jsx("script",{dangerouslySetInnerHTML:{__html:`window.ENV = ${dh(e)}`}}),H.jsx(ll,{}),H.jsx(Dl,{}),H.jsx(ph,{gtmId:e.GTM_ID}),e.POSTHOG_API_KEY&&H.jsxs(H.Fragment,{children:[H.jsx(vh,{ENV:e,member:i.member,organization:i.organization}),jl]}),e.GTM_ID&&H.jsx("noscript",{children:H.jsx("iframe",{title:"Google Tag Manager",src:`https://www.googletagmanager.com/ns.html?id=${e.GTM_ID}`,height:"0",width:"0",style:{display:"none",visibility:"hidden"}})})]})]})}export{Sh as A,kh as E,bl as d};

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.