PageSourceSearch

https://karrotmarket.com/_assets/root-DFjxey2b.js

js karrotmarket.com collected 2026-10-01 10:42:15 UTC 205,307 bytes, 102 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1c123ca6-ee33-5fa5-89e8-5c8a02a44ab6")}catch(e){}}();
3var ps=r=>{throw TypeError(r)};var fs=(r,e,t)=>e.has(r)||ps("Cannot "+t);var C=(r,e,t)=>(fs(r,e,"read from private field"),t?t.call(r):e.get(r)),ce=(r,e,t)=>e.has(r)?ps("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),K=(r,e,t,i)=>(fs(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t);var nr=(r,e,t,i)=>({set _(s){K(r,e,s,t)},get _(){return C(r,e,i)}});import{V as Ho,a as Wi,W as Uo,X as zo,r as A,_ as Wo,Y as Go,j as m,Z as Vo,R as bt,$ as gs,a0 as Yn,g as Ko,h as Yo,b as Qo,a1 as Xo,K as Zt,a2 as Jo,a3 as Zo,a4 as el,a5 as tl,c as ar,a6 as rl,U as Gi,a7 as Qn,a8 as Xn,a9 as Jn,aa as Zn,N as il,u as sl,ab as nl,ac as al,O as vs}from"./constants-psci6gc1.js";import{aR as _s,S as _r,E as ol,aS as ll,aT as ul,aJ as Ve,aU as ea,H as cl,f as dl,aV as hl,aW as zr,C as pl,aX as fl}from"./Header-Ccpd0HQe.js";import{S as ta,o as ra,n as de,q as ms,r as ys,d as Le,v as gl,w as bs,x as ws,y as vl,h as Es,z as Ss,C as _l,B as ml,Q as ia}from"./services-VIymWOJT.js";import{ag as yl,ah as bl,D as wl}from"./useResponsiveClientValue-82rXJak1.js";import{M as El}from"./mutation-Boo0lJuK.js";import{u as Vi,k as sa,l as Pe,V as xs,T as Sl,p as na}from"./Link-BOm1qwNN.js";import{n as xl}from"./noindexMeta-DK5jYImr.js";import{s as kl}from"./safeMeta-D1Yix68w.js";import{h as aa,W as Cl,S as ks,C as Cs}from"./variants-BpGuSOo8.js";import{u as Il}from"./useLocale-BvOEoNgk.js";import{U as Rl}from"./url-pattern-DcJ_9d7r.js";import{R as oa,C as la}from"./ColorModeProvider-bqyhvkan.js";import{F as Pl}from"./Footer-BlGqrGur.js";import{N as Ml}from"./NotFound-CvtskdN9.js";import{S as Fl}from"./ServerError-sKHbvFHm.js";import{u as Is,g as Ol}from"./getUserRole-CnWO5RTV.js";import{g as $l,w as Tl}from"./performance-CzA8Cv-4.js";import{c as Al}from"./exports-Bqt9E6uA.js";import"./IconHeartLine-Bzvg-_bk.js";import"./Loader-B6W929u-.js";import"./IconShoppingbagLine-DnkRyOr3.js";import"./Error.css-B8PNn6L-.js";/**
4 * @remix-run/react v2.15.2
5 *
6 * Copyright (c) Remix Software Inc.
7 *
8 * This source code is licensed under the MIT license found in the
9 * LICENSE.md file in the root directory of this source tree.
10 *
11 * @license MIT
12 */let Rs="positions";function Ll({getKey:r,...e}){let{isSpaMode:t}=Ho(),i=Wi(),s=Uo();zo({getKey:r,storageKey:Rs});let n=A.useMemo(()=>{if(!r)return null;let o=r(i,s);return o!==i.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 A.createElement("script",Wo({},e,{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${a})(${JSON.stringify(Rs)}, ${JSON.stringify(n)})`}}))}function Nl(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.headers=="object"&&typeof r.body<"u"}function Dl(r){if(!(Nl(r)||$l()||!(r instanceof Error)))return Al(r,{mechanism:{type:"instrument",handled:!1,data:{function:"ReactError"}}})}/**
13 * @remix-run/router v1.7.2
14 *
15 * Copyright (c) Remix Software Inc.
16 *
17 * This source code is licensed under the MIT license found in the
18 * LICENSE.md file in the root directory of this source tree.
19 *
20 * @license MIT
21 */var Ps;(function(r){r.Pop="POP",r.Push="PUSH",r.Replace="REPLACE"})(Ps||(Ps={}));var Ms;(function(r){r.data="data",r.deferred="deferred",r.redirect="redirect",r.error="error"})(Ms||(Ms={}));function ua(r){return r!=null&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.internal=="boolean"&&"data"in r}const ca=["post","put","patch","delete"];new Set(ca);const jl=["get",...ca];new Set(jl);const da=Object.freeze(["system","light-only","dark-only"]),ql=da[0];function Bl(r){return da.includes(r)}const ha=({mode:r=ql,fontScaling:e=!1})=>{if(!Bl(r))throw new Error(`Invalid color mode: ${r}`);return`
22    (function(window, document, mode) {
23      try {
24        document.documentElement.dataset.seed = '';
25        document.documentElement.dataset.seedColorMode = mode;
26      } catch (e) {}
27
28      try {
29        var prefersDark = window.matchMedia('(prefers-color-scheme: dark)');
30
31        if ('addEventListener' in prefersDark) {
32          prefersDark.addEventListener('change', apply);
33        } else if ('addListener' in prefersDark) {
34          prefersDark.addListener(apply);
35        }
36
37        if (prefersDark.matches) {
38          document.documentElement.dataset.seedUserColorScheme = 'dark';
39        } else {
40          document.documentElement.dataset.seedUserColorScheme = 'light';
41        }
42
43        function apply() {
44          document.documentElement.dataset.seedUserColorScheme = prefersDark.matches ? 'dark' : 'light';
45        }
46      } catch (e) {}
47
48      try {
49        if (typeof window.AndroidFunction !== 'undefined') {
50          document.documentElement.dataset.seedPlatform = 'android';
51        } else if (typeof window.webkit !== 'undefined' && typeof window.webkit.messageHandlers !== 'undefined') {
52          document.documentElement.dataset.seedPlatform = 'ios';
53        } else {
54          document.documentElement.dataset.seedPlatform = 'ios';
55        }
56      } catch (e) {}
57
58      try {
59        if (${e}) {
60          var platform = document.documentElement.dataset.seedPlatform;
61
62          if (platform === 'ios') {
63            document.documentElement.dataset.seedFontScaling = 'enabled';
64
65            function applyIOSFontScaling() {
66              try {
67                var tempEl = document.createElement('div');
68                tempEl.style.cssText = 'position:absolute;visibility:hidden;font-size:16px;font:-apple-system-body;';
69                document.body.appendChild(tempEl);
70                var size = parseFloat(window.getComputedStyle(tempEl).fontSize);
71                document.body.removeChild(tempEl);
72                var mult = Math.max(0.8, Math.min(1.35, (size / 16) * 0.9412));
73                document.documentElement.dataset.seedFontMultiplier = parseFloat(mult.toFixed(2)).toString();
74              } catch (e) {}
75            }
76
77            if (document.readyState === 'loading') {
78              document.addEventListener('DOMContentLoaded', applyIOSFontScaling);
79            } else {
80              applyIOSFontScaling();
81            }
82          } else if (platform === 'android') {
83            var fontSize = parseFloat(window.getComputedStyle(document.documentElement).fontSize);
84            var scale = Math.max(0.8, Math.min(1.5, fontSize / 16));
85            document.documentElement.dataset.seedFontMultiplier = parseFloat(scale.toFixed(2)).toString();
86            document.documentElement.dataset.seedFontScaling = 'enabled';
87          }
88        }
89      } catch (e) {}
90    })(window, document, '${r}');
91  `};var Re,Gn,Hl=(Gn=class extends ta{constructor(e={}){super();ce(this,Re);this.config=e,K(this,Re,new Map)}build(e,t,i){const s=t.queryKey,n=t.queryHash??ra(s,t);let a=this.get(n);return a||(a=new yl({client:e,queryKey:s,queryHash:n,options:e.defaultQueryOptions(t),state:i,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){C(this,Re).has(e.queryHash)||(C(this,Re).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=C(this,Re).get(e.queryHash);t&&(e.destroy(),t===e&&C(this,Re).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){de.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return C(this,Re).get(e)}getAll(){return[...C(this,Re).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(i=>ms(t,i))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(i=>ms(e,i)):t}notify(e){de.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){de.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){de.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Re=new WeakMap,Gn),qe,Ee,sr,Vn,Ul=(Vn=class extends ta{constructor(e={}){super();ce(this,qe);ce(this,Ee);ce(this,sr);this.config=e,K(this,qe,new Set),K(this,Ee,new Map),K(this,sr,0)}build(e,t,i){const s=new El({mutationCache:this,mutationId:++nr(this,sr)._,options:e.defaultMutationOptions(t),state:i});return this.add(s),s}add(e){C(this,qe).add(e);const t=or(e);if(typeof t=="string"){const i=C(this,Ee).get(t);i?i.push(e):C(this,Ee).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(C(this,qe).delete(e)){const t=or(e);if(typeof t=="string"){const i=C(this,Ee).get(t);if(i)if(i.length>1){const s=i.indexOf(e);s!==-1&&i.splice(s,1)}else i[0]===e&&C(this,Ee).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=or(e);if(typeof t=="string"){const i=C(this,Ee).get(t),s=i==null?void 0:i.find(n=>n.state.status==="pending");return!s||s===e}else return!0}runNext(e){var i;const t=or(e);if(typeof t=="string"){const s=(i=C(this,Ee).get(t))==null?void 0:i.find(n=>
91n!==e&&n.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){de.batch(()=>{C(this,qe).forEach(e=>{this.notify({type:"removed",mutation:e})}),C(this,qe).clear(),C(this,Ee).clear()})}getAll(){return Array.from(C(this,qe))}find(e){const t={exact:!0,...e};return this.getAll().find(i=>ys(t,i))}findAll(e={}){return this.getAll().filter(t=>ys(e,t))}notify(e){de.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return de.batch(()=>Promise.all(e.map(t=>t.continue().catch(Le))))}},qe=new WeakMap,Ee=new WeakMap,sr=new WeakMap,Vn);function or(r){var e;return(e=r.options.scope)==null?void 0:e.id}var q,Xe,Je,Rt,Pt,Ze,Mt,Ft,Kn,pa=(Kn=class{constructor(r={}){ce(this,q);ce(this,Xe);ce(this,Je);ce(this,Rt);ce(this,Pt);ce(this,Ze);ce(this,Mt);ce(this,Ft);K(this,q,r.queryCache||new Hl),K(this,Xe,r.mutationCache||new Ul),K(this,Je,r.defaultOptions||{}),K(this,Rt,new Map),K(this,Pt,new Map),K(this,Ze,0)}mount(){nr(this,Ze)._++,C(this,Ze)===1&&(K(this,Mt,gl.subscribe(async r=>{r&&(await this.resumePausedMutations(),C(this,q).onFocus())})),K(this,Ft,bs.subscribe(async r=>{r&&(await this.resumePausedMutations(),C(this,q).onOnline())})))}unmount(){var r,e;nr(this,Ze)._--,C(this,Ze)===0&&((r=C(this,Mt))==null||r.call(this),K(this,Mt,void 0),(e=C(this,Ft))==null||e.call(this),K(this,Ft,void 0))}isFetching(r){return C(this,q).findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return C(this,Xe).findAll({...r,status:"pending"}).length}getQueryData(r){var t;const e=this.defaultQueryOptions({queryKey:r});return(t=C(this,q).get(e.queryHash))==null?void 0:t.state.data}ensureQueryData(r){const e=this.defaultQueryOptions(r),t=C(this,q).build(this,e),i=t.state.data;return i===void 0?this.fetchQuery(r):(r.revalidateIfStale&&t.isStaleByTime(ws(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(r){return C(this,q).findAll(r).map(({queryKey:e,state:t})=>{const i=t.data;return[e,i]})}setQueryData(r,e,t){const i=this.defaultQueryOptions({queryKey:r}),s=C(this,q).get(i.queryHash),n=s==null?void 0:s.state.data,a=vl(e,n);if(a!==void 0)return C(this,q).build(this,i).setData(a,{...t,manual:!0})}setQueriesData(r,e,t){return de.batch(()=>C(this,q).findAll(r).map(({queryKey:i})=>[i,this.setQueryData(i,e,t)]))}getQueryState(r){var t;const e=this.defaultQueryOptions({queryKey:r});return(t=C(this,q).get(e.queryHash))==null?void 0:t.state}removeQueries(r){const e=C(this,q);de.batch(()=>{e.findAll(r).forEach(t=>{e.remove(t)})})}resetQueries(r,e){const t=C(this,q);return de.batch(()=>(t.findAll(r).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...r},e)))}cancelQueries(r,e={}){const t={revert:!0,...e},i=de.batch(()=>C(this,q).findAll(r).map(s=>s.cancel(t)));return Promise.all(i).then(Le).catch(Le)}invalidateQueries(r,e={}){return de.batch(()=>(C(this,q).findAll(r).forEach(t=>{t.invalidate()}),(r==null?void 0:r.refetchType)==="none"?Promise.resolve():this.refetchQueries({...r,type:(r==null?void 0:r.refetchType)??(r==null?void 0:r.type)??"active"},e)))}refetchQueries(r,e={}){const t={...e,cancelRefetch:e.cancelRefetch??!0},i=de.batch(()=>C(this,q).findAll(r).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let n=s.fetch(void 0,t);return t.throwOnError||(n=n.catch(Le)),s.state.fetchStatus==="paused"?Promise.resolve():n}));return Promise.all(i).then(Le)}fetchQuery(r){const e=this.defaultQueryOptions(r);e.retry===void 0&&(e.retry=!1);const t=C(this,q).build(this,e);return t.isStaleByTime(ws(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(Le).catch(Le)}fetchInfiniteQuery(r){return r.behavior=_s(r.pages),this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(Le).catch(Le)}ensureInfiniteQueryData(r){return r.behavior=_s(r.pages),this.ensureQueryData(r)}resumePausedMutations(){return bs.isOnline()?C(this,Xe).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,q)}getMutationCache(){return C(this,Xe)}getDefaultOptions(){return C(this,Je)}setDefaultOptions(r){K(this,Je,r)}setQueryDefaults(r,e){C(this,Rt).set(Es(r),{queryKey:r,defaultOptions:e})}getQueryDefaults(r){const e=[...C(this,Rt).values()],t={};return e.forEach(i=>
91{Ss(r,i.queryKey)&&Object.assign(t,i.defaultOptions)}),t}setMutationDefaults(r,e){C(this,Pt).set(Es(r),{mutationKey:r,defaultOptions:e})}getMutationDefaults(r){const e=[...C(this,Pt).values()],t={};return e.forEach(i=>{Ss(r,i.mutationKey)&&Object.assign(t,i.defaultOptions)}),t}defaultQueryOptions(r){if(r._defaulted)return r;const e={...C(this,Je).queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};return e.queryHash||(e.queryHash=ra(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===_l&&(e.enabled=!1),e}defaultMutationOptions(r){return r!=null&&r._defaulted?r:{...C(this,Je).mutations,...(r==null?void 0:r.mutationKey)&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){C(this,q).clear(),C(this,Xe).clear()}},q=new WeakMap,Xe=new WeakMap,Je=new WeakMap,Rt=new WeakMap,Pt=new WeakMap,Ze=new WeakMap,Mt=new WeakMap,Ft=new WeakMap,Kn),zl=function(){return null};const Wl="/_assets/favicon-ptbCteuu.png",Gl=()=>typeof window>"u"?!1:_r.getUserCookieConsent()===null?(_r.deleteUserCookieConsent(),!1):!!_r.getUserCookieConsent();function fa(){const[r,e]=A.useState(Gl());return[r,()=>{r||(e(!0),_r.setUserCookieConsent())}]}function Vl({transitionDuration:r=400}){const[e,t]=A.useState("exit-done"),i=A.useCallback(()=>{t(s=>{switch(s){case"enter-active":case"exit-active":return s;case"enter-done":return setTimeout(()=>{t("exit-done")},r),"exit-active";case"exit-done":{setTimeout(()=>{t("enter-active")},32),setTimeout(()=>{t("enter-done")},r);return}}})},[r]);return[e,i]}var Kl=aa({defaultClassName:"_4dr34c0 sprinkles_paddingTop_5_base__1byufe89y sprinkles_paddingTop_8_medium__1byufe8ac sprinkles_paddingBottom_5_base__1byufe8c2 sprinkles_paddingBottom_8_medium__1byufe8cg sprinkles_paddingLeft_4_base__1byufe8g6 sprinkles_paddingLeft_8_medium__1byufe8go sprinkles_paddingRight_4_base__1byufe8e2 sprinkles_paddingRight_8_medium__1byufe8ek sprinkles_display_flex_base__1byufe82i sprinkles_flexDirection_column_base__1byufe8te sprinkles_gap_4_base__1byufe8qq sprinkles_position_fixed_base__1byufe876 sprinkles_bottom_0__1byufe81s sprinkles_left_0__1byufe81t sprinkles_width_full_base__1byufe84q",variantClassNames:{transitionState:{"enter-active":"_4dr34c1","enter-done":"_4dr34c2","exit-active":"_4dr34c3","exit-done":"_4dr34c4"}},defaultVariants:{},compoundVariants:[]}),Yl="_4dr34c5 sprinkles_width_full_base__1byufe84q sprinkles_fontWeight_bold__1byufe81z",Ql="_4dr34c6 sprinkles_color_neutral__1byufe81 sprinkles_fontWeight_regular__1byufe81x sprinkles_flexWrap_wrap_base__1byufe8tm sprinkles_marginBottom_2_base__1byufe8k6",Xl="_4dr34c7",Jl="_4dr34c8";const Zl=r=>{const e=document.createElement("div");return e.setAttribute("id",r),document.body.appendChild(e),e},eu=({children:r,selector:e="portal",blockBodyScroll:t=!0})=>{const i=A.useRef(null),[s,n]=A.useState(null),[,a]=A.useState({});return A.useEffect(()=>a({}),[]),A.useEffect(()=>{if(!s)return;const o=document.body;t&&(o.style.overflow="hidden"),i.current=Zl(e);const l=i.current;return a({}),()=>{o.contains(l)&&(o.removeChild(l),o.style.overflow="")}},[s,e,t]),i.current?Go.createPortal(r,i.current):m.jsx("span",{ref:o=>o&&n(o),style:{display:"none"}})},tu=400;function ru(){const{t:r}=Il(),e=Vi(),[,t]=fa(),[i,s]=Vl({transitionDuration:tu}),n=()=>{s(),t()};return A.useEffect(()=>{s()},[s]),i==="exit-done"?null:m.jsx(eu,{blockBodyScroll:!1,children:m.jsxs("div",{className:Kl({transitionState:i}),onClick:a=>a.stopPropagation(),children:[m.jsx("header",{className:Yl,children:r("CookieModal.title")}),m.jsxs("p",{className:Ql,children:[r("CookieModal.content"),m.jsx(ol,{href:Vo[e.karrotLocalCountryCode],className:Xl,children:r("CookieModal.privacy_policy_button_label")})]}),m.jsx("div",{className:Jl,children:m.jsx("span",{children:m.jsx(ll,{type:"submit",variant:"brand",size:"large",onClick:n,children:r("CookieModal.confirm_button_label")})})})]})})}var v=typeof window<"u"?window:void 0,ae=typeof globalThis<"u"?globalThis:v,ga=Array.prototype,Fs=ga.forEach,Os=ga.indexOf,he=ae==null?void 0:ae.navigator,E=ae==null?void 0:ae.document,ne=ae==null?void 0:ae.location,ci=ae==null?void 0:ae.fetch,di=ae!=null&&ae.XMLHttpRequest&&"withCredentials"in new ae.XMLHttpRequest?ae.XMLHttpRequest:void 0,$s=ae==null?void 0:ae.AbortController,se=he==null?void 0:he.userAgent,P=v??{},je={DEBUG:!1,LIB_VERSION:"1.249.4"},Wr="$copy_autocapture",iu=["$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"],Be=function(r){return r.GZipJS="gzip-js",r.Base64="base64",r}({}),su=["fatal","error","warning","log","info","debug"];function M(r,e){return r.indexOf(e)!==-1}var Ar=function(r){return r.trim()},hi=function(r){return r.replace(/^\$/,"")},nu=Array.isArray,va=Object.prototype,_a=va.hasOwnProperty,Lr=va.toString,D=nu||function(r){return Lr.call(r)==="[object Array]"},_e=r=>typeof r=="function",B=r=>r===Object(r)&&!D(r),Et=r=>{if(B(r)){for(var e in r)if(_a.call(r,e))return!1;return!0}return!1},b=r=>r===void 0,H=r=>Lr.call(r)=="[object String]",pi=r=>H(r)&&r.trim().length===0,st=r=>r===null,O=r=>b(r)||st(r),Z=r=>Lr.call(r)=="[object Number]",Me=r=>Lr.call(r)==="[object Boolean]",au=r=>r instanceof FormData,ou=r=>M(iu,r),ma=r=>{var e={t:function(t){if(v&&(je.DEBUG||P.POSTHOG_DEBUG)&&!b(v.console)&&v.console){for(var i=("__rrweb_original__"in v.console[t])?v.console[t].__rrweb_original__:v.console[t],s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];i(r,...n)}},info:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];e.t("log",...i)},warn:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];e.t("warn",...i)},error:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];e.t("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),s=0;s<t;s++)i[s]=arguments[s];console.error(r,...i)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling "+t)},createLogger:t=>ma(r+" "+t)};return e},S=ma("[PostHog.js]"),Q=S.createLogger,lu=Q("[ExternalScriptsLoader]"),Ts=(r,e,t)=>{if(r.config.disable_external_dependency_loading)return lu.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var i=E==null?void 0:E.querySelectorAll("script");
91if(i){for(var s=0;s<i.length;s++)if(i[s].src===e)return t()}var n=()=>{if(!E)return t("document not found");var a=E.createElement("script");if(a.type="text/javascript",a.crossOrigin="anonymous",a.src=e,a.onload=u=>t(void 0,u),a.onerror=u=>t(u),r.config.prepare_external_dependency_script&&(a=r.config.prepare_external_dependency_script(a)),!a)return t("prepare_external_dependency_script returned null");var o,l=E.querySelectorAll("body > script");l.length>0?(o=l[0].parentNode)==null||o.insertBefore(a,l[0]):E.body.appendChild(a)};E!=null&&E.body?n():E==null||E.addEventListener("DOMContentLoaded",n)};function w(){return w=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r},w.apply(null,arguments)}function ya(r,e){if(r==null)return{};var t={};for(var i in r)if({}.hasOwnProperty.call(r,i)){if(e.indexOf(i)!==-1)continue;t[i]=r[i]}return t}P.__PosthogExtensions__=P.__PosthogExtensions__||{},P.__PosthogExtensions__.loadExternalDependency=(r,e,t)=>{var i="/static/"+e+".js?v="+r.version;if(e==="remote-config"&&(i="/array/"+r.config.token+"/config.js"),e==="toolbar"){var s=3e5;i=i+"&t="+Math.floor(Date.now()/s)*s}var n=r.requestRouter.endpointFor("assets",i);Ts(r,n,t)},P.__PosthogExtensions__.loadSiteApp=(r,e,t)=>{var i=r.requestRouter.endpointFor("api",e);Ts(r,i,t)};var wr={};function tt(r,e,t){if(D(r)){if(Fs&&r.forEach===Fs)r.forEach(e,t);else if("length"in r&&r.length===+r.length){for(var i=0,s=r.length;i<s;i++)if(i in r&&e.call(t,r[i],i)===wr)return}}}function $(r,e,t){if(!O(r)){if(D(r))return tt(r,e,t);if(au(r)){for(var i of r.entries())if(e.call(t,i[1],i[0])===wr)return}else for(var s in r)if(_a.call(r,s)&&e.call(t,r[s],s)===wr)return}}var U=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return tt(t,function(s){for(var n in s)s[n]!==void 0&&(r[n]=s[n])}),r},Nr=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return tt(t,function(s){tt(s,function(n){r.push(n)})}),r};function mr(r){for(var e=Object.keys(r),t=e.length,i=new Array(t);t--;)i[t]=[e[t],r[e[t]]];return i}var As=function(r){try{return r()}catch{return}},uu=function(r){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return r.apply(this,t)}catch(s){S.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),S.critical(s)}}},Ki=function(r){var e={};return $(r,function(t,i){(H(t)&&t.length>0||Z(t))&&(e[i]=t)}),e};function cu(r,e){return t=r,i=n=>H(n)&&!st(e)?n.slice(0,e):n,s=new Set,function n(a,o){return a!==Object(a)?i?i(a,o):a:s.has(a)?void 0:(s.add(a),D(a)?(l=[],tt(a,u=>{l.push(n(u))})):(l={},$(a,(u,c)=>{s.has(u)||(l[c]=n(u,c))})),l);var l}(t);var t,i,s}var du=["herokuapp.com","vercel.app","netlify.app"];function hu(r){var e=r==null?void 0:r.hostname;if(!H(e))return!1;var t=e.split(".").slice(-2).join(".");for(var i of du)if(t===i)return!1;return!0}function ba(r,e){for(var t=0;t<r.length;t++)if(e(r[t]))return r[t]}function j(r,e,t,i){var{capture:s=!1,passive:n=!0}=i??{};r==null||r.addEventListener(e,t,{capture:s,passive:n})}var wa="$people_distinct_id",Bt="__alias",Ht="__timers",Ls="$autocapture_disabled_server_side",fi="$heatmaps_enabled_server_side",Ns="$exception_capture_enabled_server_side",gi="$error_tracking_suppression_rules",Ds="$web_vitals_enabled_server_side",Ea="$dead_clicks_enabled_server_side",js="$web_vitals_allowed_metrics",vi="$session_recording_enabled_server_side",qs="$console_log_recording_enabled_server_side",Bs="$session_recording_network_payload_capture",Hs="$session_recording_masking",Us="$session_recording_canvas_recording",zs="$replay_sample_rate",Ws="$replay_minimum_duration",Gs="$replay_script_config",Er="$sesid",Ut="$session_is_sampled",_i="$session_recording_url_trigger_activated_session",mi="$session_recording_event_trigger_activated_session",St="$enabled_feature_flags",yr="$early_access_features",yi="$feature_flag_details",zt="$stored_person_properties",ct="$stored_group_properties",bi="$surveys",lr="$surveys_activated",Sr="$flag_call_reported",Ne="$user_state",wi="$client_session_props",Ei="$capture_rate_limit",Si="$initial_campaign_params",xi="$initial_referrer_info",xr="$initial_person_info",kr="$epp",Sa="__POSTHOG_TOOLBAR__",Vs="$posthog_cookieless",pu=[wa,Bt,"__cmpns",Ht,vi,fi,Er,St,gi,Ne,yr,yi,ct,zt,bi,Sr,wi,Ei,Si,xi,kr,xr];function Ks(r){return r instanceof Element&&(r.id===Sa||!(r.closest==null||!r.closest(".toolbar-global-fade-container")))}function Dr(r){return!!r&&r.nodeType===1}function rt(r,e){return!!r&&!!r.tagName&&r.tagName.toLowerCase()===e.toLowerCase()}function xa(r){return!!r&&r.nodeType===3}function ka(r){return!!r&&r.nodeType===11}function Yi(r){return r?Ar(r).split(/\s+/):[]}function Ys(r){var e=v==null?void 0:v.location.href;return!!(e&&r&&r.some(t=>e.match(t)))}function Cr(r){var e="";switch(typeof r.className){case"string":e=r.className;break;case"object":e=(r.className&&"baseVal"in r.className?r.className.baseVal:null)||r.getAttribute("class")||"";break;default:e=""}return Yi(e)}function Ca(r){return O(r)?null:Ar(r).split(/(\s+)/).filter(e=>Ot(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function jr(r){var e="";return Ci(r)&&!Pa(r)&&r.childNodes&&r.childNodes.length&&$(r.childNodes,function(t){var i;xa(t)&&t.textContent&&(e+=(i=Ca(t.textContent))!==null&&i!==void 0?i:"")}),Ar(e)}function Ia(r){return b(r.target)?r.srcElement||null:(e=r.target)!=null&&e.shadowRoot?r.composedPath()[0]||null:r.target||null;var e}var ki=["a","button","form","input","select","textarea","label"];function Ra(r){var e=r.parentNode;return!(!e||!Dr(e))&&e}function fu(r,e,t,i,s){var n,a,o;if(t===void 0&&(t=void 0),!v||!r||rt(r,"html")||!Dr(r)||(n=t)!=null&&n.url_allowlist&&!Ys(t.url_allowlist)||(a=t)!=null&&a.url_ignorelist&&Ys(t.url_ignorelist))return!1;if((o=t)!=null&&o.dom_event_allowlist){var l=t.dom_event_allowlist;if(l&&!l.some(_=>e.type===_))return!1}for(var u=!1,c=[r],p=!0,d=r;d.parentNode&&!rt(d,"body");)if(ka(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!(p=Ra(d)))break;if(i||ki.indexOf(p.tagName.toLowerCase())>-1)u=!0;else{var f=v.getComputedStyle(p);f&&f.getPropertyValue("cursor")==="pointer"&&(u=!0)}c.push(p),d=p}if(!function(_,y){var x=y==null?void 0:y.element_allowlist;if(b(x))return!0;var I,k=function(T){if(x.some(N=>T.tagName.toLowerCase()===N))return{v:!0}};for(var F of _)if(I=k(F))return I.v;return!1}(c,t)||!function(_,y){var x=y==null?void 0:y.css_selector_allowlist;if(b(x))return!0;var I,k=function(T){if(x.some(N=>T.matches(N)))return{v:!0}};for(var F of _)if(I=k(F))return I.v;return!1}(c,t))return!1;var h=v.getComputedStyle(r);if(h&&h.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=r.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(s||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(s||["change","click"]).indexOf(e.type)>=0;default:return u?(s||["click"]).indexOf(e.type)>=0:(s||["click"]).indexOf(e.type)>=0&&(ki.indexOf(g)>-1||r.getAttribute("contenteditable")==="true")}}function Ci(r){for(var e=r;e.parentNode&&!rt(e,"body");e=e.parentNode){var t=Cr(e);
vendor: 10,348 bytes, line 91
91if(M(t,"ph-sensitive")||M(t,"ph-no-capture"))return!1}if(M(Cr(r),"ph-include"))return!0;var i=r.type||"";if(H(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var s=r.name||r.id||"";return!(H(s)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,"")))}function Pa(r){return!!(rt(r,"input")&&!["button","checkbox","submit","reset"].includes(r.type)||rt(r,"select")||rt(r,"textarea")||r.getAttribute("contenteditable")==="true")}var Ma="(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})",gu=new RegExp("^(?:"+Ma+")$"),vu=new RegExp(Ma),Fa="\\d{3}-?\\d{2}-?\\d{4}",_u=new RegExp("^("+Fa+")$"),mu=new RegExp("("+Fa+")");function Ot(r,e){return e===void 0&&(e=!0),!(O(r)||H(r)&&(r=Ar(r),(e?gu:vu).test((r||"").replace(/[- ]/g,""))||(e?_u:mu).test(r)))}function Oa(r){var e=jr(r);return Ot(e=(e+" "+$a(r)).trim())?e:""}function $a(r){var e="";return r&&r.childNodes&&r.childNodes.length&&$(r.childNodes,function(t){var i;if(t&&((i=t.tagName)==null?void 0:i.toLowerCase())==="span")try{var s=jr(t);e=(e+" "+s).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+$a(t)).trim())}catch(n){S.error("[AutoCapture]",n)}}),e}function yu(r){return function(e){var t=e.map(i=>{var s,n,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class)for(var o of(i.attr_class.sort(),i.attr_class))a+="."+o.replace(/"/g,"");var l=w({},i.text?{text:i.text}:{},{"nth-child":(s=i.nth_child)!==null&&s!==void 0?s:0,"nth-of-type":(n=i.nth_of_type)!==null&&n!==void 0?n:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),u={};return mr(l).sort((c,p)=>{var[d]=c,[f]=p;return d.localeCompare(f)}).forEach(c=>{var[p,d]=c;return u[Qs(p.toString())]=Qs(d.toString())}),a+=":",a+=mr(u).map(c=>{var[p,d]=c;return p+'="'+d+'"'}).join("")});return t.join(";")}(function(e){return e.map(t=>{var i,s,n={text:(i=t.$el_text)==null?void 0:i.slice(0,400),tag_name:t.tag_name,href:(s=t.attr__href)==null?void 0:s.slice(0,2048),attr_class:bu(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return mr(t).filter(a=>{var[o]=a;return o.indexOf("attr__")===0}).forEach(a=>{var[o,l]=a;return n.attributes[o]=l}),n})}(r))}function Qs(r){return r.replace(/"|\\"/g,'\\"')}function bu(r){var e=r.attr__class;return e?D(e)?e:Yi(e):void 0}class Ta{constructor(){this.clicks=[]}isRageClick(e,t,i){var s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<30&&i-s.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var wu=["localhost","127.0.0.1"],$t=r=>{var e=E==null?void 0:E.createElement("a");return b(e)?null:(e.href=r,e)},Eu=function(r,e){var t,i;e===void 0&&(e="&");var s=[];return $(r,function(n,a){b(n)||b(a)||a==="undefined"||(t=encodeURIComponent((o=>o instanceof File)(n)?n.name:n.toString()),i=encodeURIComponent(a),s[s.length]=i+"="+t)}),s.join(e)},Ir=function(r,e){for(var t,i=((r.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;s<i.length;s++){var n=i[s].split("=");if(n[0]===e){t=n;break}}if(!D(t)||t.length<2)return"";var a=t[1];try{a=decodeURIComponent(a)}catch{S.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Qi=function(r,e,t){if(!r||!e||!e.length)return r;for(var i=r.split("#"),s=i[0]||"",n=i[1],a=s.split("?"),o=a[1],l=a[0],u=(o||"").split("&"),c=[],p=0;p<u.length;p++){var d=u[p].split("=");D(d)&&(e.includes(d[0])?c.push(d[0]+"="+t):c.push(u[p]))}var f=l;return o!=null&&(f+="?"+c.join("&")),n!=null&&(f+="#"+n),f},Rr=function(r,e){var t=r.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Xs=Q("[AutoCapture]");function Gr(r,e){return e.length>r?e.slice(0,r)+"...":e}function Su(r){if(r.previousElementSibling)return r.previousElementSibling;var e=r;do e=e.previousSibling;while(e&&!Dr(e));return e}function xu(r,e,t,i){var s=r.tagName.toLowerCase(),n={tag_name:s};ki.indexOf(s)>-1&&!t&&(s.toLowerCase()==="a"||s.toLowerCase()==="button"?n.$el_text=Gr(1024,Oa(r)):n.$el_text=Gr(1024,jr(r)));var a=Cr(r);a.length>0&&(n.classes=a.filter(function(c){return c!==""})),$(r.attributes,function(c){var p;if((!Pa(r)||["name","id","class","aria-label"].indexOf(c.name)!==-1)&&(i==null||!i.includes(c.name))&&!e&&Ot(c.value)&&(p=c.name,!H(p)||p.substring(0,10)!=="_ngcontent"&&p.substring(0,7)!=="_nghost")){var d=c.value;c.name==="class"&&(d=Yi(d).join(" ")),n["attr__"+c.name]=Gr(1024,d)}});for(var o=1,l=1,u=r;u=Su(u);)o++,u.tagName===r.tagName&&l++;return n.nth_child=o,n.nth_of_type=l,n}function ku(r,e){for(var t,i,{e:s,maskAllElementAttributes:n,maskAllText:a,elementAttributeIgnoreList:o,elementsChainAsString:l}=e,u=[r],c=r;c.parentNode&&!rt(c,"body");)ka(c.parentNode)?(u.push(c.parentNode.host),c=c.parentNode.host):(u.push(c.parentNode),c=c.parentNode);var p,d=[],f={},h=!1,g=!1;if($(u,k=>{var F=Ci(k);k.tagName.toLowerCase()==="a"&&(h=k.getAttribute("href"),h=F&&h&&Ot(h)&&h),M(Cr(k),"ph-no-capture")&&(g=!0),d.push(xu(k,n,a,o));var T=function(N){if(!Ci(N))return{};var R={};return $(N.attributes,function(Se){if(Se.name&&Se.name.indexOf("data-ph-capture-attribute")===0){var le=Se.name.replace("data-ph-capture-attribute-",""),be=Se.value;le&&be&&Ot(be)&&(R[le]=be)}}),R}(k);U(f,T)}),g)return{props:{},explicitNoCapture:g};if(a||(r.tagName.toLowerCase()==="a"||r.tagName.toLowerCase()==="button"?d[0].$el_text=Oa(r):d[0].$el_text=jr(r)),h){var _,y;d[0].attr__href=h;var x=(_=$t(h))==null?void 0:_.host,I=v==null||(y=v.location)==null?void 0:y.host;x&&I&&x!==I&&(p=h)}return{props:U({$event_type:s.type,$ce_version:1},l?{}:{$elements:d},{$elements_chain:yu(d)},(t=d[0])!=null&&t.$el_text?{$el_text:(i=d[0])==null?void 0:i.$el_text}:{},p&&s.type==="click"?{$external_click_url:p}:{},f)}}class Cu{constructor(e){this.i=!1,this.o=null,this.rageclicks=new Ta,this.h=!1,this.instance=e,this.m=null}get S(){var e,t,i=B(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map(s=>new RegExp(s)),i.url_ignorelist=(t=i.url_ignorelist)==null?void 0:t.map(s=>new RegExp(s)),i}$(){if(this.isBrowserSupported()){if(v&&E){var e=i=>{i=i||(v==null?void 0:v.event);try{this.k(i)}catch(s){Xs.error("Failed to capture event",s)}};if(j(E,"submit",e,{capture:!0}),j(E,"change",e,{capture:!0}),j(E,"click",e,{capture:!0}),this.S.capture_copied_text){var t=i=>{i=i||(v==null?void 0:v.event),this.k(i,Wr)};j(E,"copy",t,{capture:!0}),j(E,"cut",t,{capture:!0})}}}else Xs.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.i&&(this.$(),this.i=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.h=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Ls]:!!e.autocapture_opt_out}),this.o=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.m=e}getElementSelectors(e){var t,i=[];return(t=this.m)==null||t.forEach(s=>{var n=E==null?void 0:E.querySelectorAll(s);n==null||n.forEach(a=>{e===a&&i.push(s)})}),i}get isEnabled(){var e,t,i=(e=this.instance.persistence)==null?void 0:e.props[Ls],s=this.o;if(st(s)&&!Me(i)&&!this.instance.config.advanced_disable_decide)return!1;var n=(t=this.o)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!n}k(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var i,s=Ia(e);xa(s)&&(s=s.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.k(e,"$rageclick");var n=t===Wr;if(s&&fu(s,e,this.S,n,n?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=ku(s,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.S.element_attribute_ignorelist,elementsChainAsString:this.h});if(o)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(a.$element_selectors=l),t===Wr){var u,c=Ca(v==null||(u=v.getSelection())==null?void 0:u.toString()),p=e.type||"clipboard";if(!c)return!1;a.$selected_content=c,a.$copy_type=p}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return _e(E==null?void 0:E.querySelectorAll)}}Math.trunc||(Math.trunc=function(r){return r<0?Math.ceil(r):Math.floor(r)}),Number.isInteger||(Number.isInteger=function(r){return Z(r)&&isFinite(r)&&Math.floor(r)===r});var Js="0123456789abcdef";class Pr{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||e<0||t<0||i<0||s<0||e>0xffffffffffff||t>4095||i>1073741823||s>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=s>>>24,n[13]=s>>>16,n[14]=s>>>8,n[15]=s,new Pr(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Js.charAt(this.bytes[t]>>>4)+Js.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new Pr(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}}class Iu{constructor(){this.I=0,this.P=0,this.R=new Ru}generate(){var e=this.generateOrAbort();if(b(e)){this.I=0;var t=this.generateOrAbort();if(b(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.I)this.I=e,this.T();else{if(!(e+1e4>this.I))return;this.P++,this.P>4398046511103&&(this.I++,this.T())}return Pr.fromFieldsV7(this.I,Math.trunc(this.P/Math.pow(2,30)),this.P&Math.pow(2,30)-1,this.R.nextUint32())}T(){this.P=1024*this.R.nextUint32()+(1023&this.R.nextUint32())}}var Zs,Aa=r=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<r.length;
91e++)r[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return r};v&&!b(v.crypto)&&crypto.getRandomValues&&(Aa=r=>crypto.getRandomValues(r));class Ru{constructor(){this.M=new Uint32Array(8),this.C=1/0}nextUint32(){return this.C>=this.M.length&&(Aa(this.M),this.C=0),this.M[this.C++]}}var et=()=>Pu().toString(),Pu=()=>(Zs||(Zs=new Iu)).generate(),Nt="",Mu=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Fu(r,e){if(e){var t=function(s,n){if(n===void 0&&(n=E),Nt)return Nt;if(!n||["localhost","127.0.0.1"].includes(s))return"";for(var a=s.split("."),o=Math.min(a.length,8),l="dmn_chk_"+et();!Nt&&o--;){var u=a.slice(o).join("."),c=l+"=1;domain=."+u+";path=/";n.cookie=c+";max-age=3",n.cookie.includes(l)&&(n.cookie=c+";max-age=0",Nt=u)}return Nt}(r);if(!t){var i=(s=>{var n=s.match(Mu);return n?n[0]:""})(r);i!==t&&S.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var He={O:()=>!!E,F:function(r){S.error("cookieStore error: "+r)},A:function(r){if(E){try{for(var e=r+"=",t=E.cookie.split(";").filter(n=>n.length),i=0;i<t.length;i++){for(var s=t[i];s.charAt(0)==" ";)s=s.substring(1,s.length);if(s.indexOf(e)===0)return decodeURIComponent(s.substring(e.length,s.length))}}catch{}return null}},D:function(r){var e;try{e=JSON.parse(He.A(r))||{}}catch{}return e},L:function(r,e,t,i,s){if(E)try{var n="",a="",o=Fu(E.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),n="; expires="+l.toUTCString()}s&&(a="; secure");var u=r+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&S.warn("cookieStore warning: large cookie, len="+u.length),E.cookie=u,u}catch{return}},N:function(r,e){try{He.L(r,"",-1,e)}catch{return}}},Vr=null,G={O:function(){if(!st(Vr))return Vr;var r=!0;if(b(v))r=!1;else try{var e="__mplssupport__";G.L(e,"xyz"),G.A(e)!=='"xyz"'&&(r=!1),G.N(e)}catch{r=!1}return r||S.error("localStorage unsupported; falling back to cookie store"),Vr=r,r},F:function(r){S.error("localStorage error: "+r)},A:function(r){try{return v==null?void 0:v.localStorage.getItem(r)}catch(e){G.F(e)}return null},D:function(r){try{return JSON.parse(G.A(r))||{}}catch{}return null},L:function(r,e){try{v==null||v.localStorage.setItem(r,JSON.stringify(e))}catch(t){G.F(t)}},N:function(r){try{v==null||v.localStorage.removeItem(r)}catch(e){G.F(e)}}},Ou=["distinct_id",Er,Ut,kr,xr],ur=w({},G,{D:function(r){try{var e={};try{e=He.D(r)||{}}catch{}var t=U(e,JSON.parse(G.A(r)||"{}"));return G.L(r,t),t}catch{}return null},L:function(r,e,t,i,s,n){try{G.L(r,e,void 0,void 0,n);var a={};Ou.forEach(o=>{e[o]&&(a[o]=e[o])}),Object.keys(a).length&&He.L(r,a,t,i,s,n)}catch(o){G.F(o)}},N:function(r,e){try{v==null||v.localStorage.removeItem(r),He.N(r,e)}catch(t){G.F(t)}}}),cr={},$u={O:function(){return!0},F:function(r){S.error("memoryStorage error: "+r)},A:function(r){return cr[r]||null},D:function(r){return cr[r]||null},L:function(r,e){cr[r]=e},N:function(r){delete cr[r]}},at=null,Y={O:function(){if(!st(at))return at;if(at=!0,b(v))at=!1;else try{var r="__support__";Y.L(r,"xyz"),Y.A(r)!=='"xyz"'&&(at=!1),Y.N(r)}catch{at=!1}return at},F:function(r){S.error("sessionStorage error: ",r)},A:function(r){try{return v==null?void 0:v.sessionStorage.getItem(r)}catch(e){Y.F(e)}return null},D:function(r){try{return JSON.parse(Y.A(r))||null}catch{}return null},L:function(r,e){try{v==null||v.sessionStorage.setItem(r,JSON.stringify(e))}catch(t){Y.F(t)}},N:function(r){try{v==null||v.sessionStorage.removeItem(r)}catch(e){Y.F(e)}}},mt=function(r){return r[r.PENDING=-1]="PENDING",r[r.DENIED=0]="DENIED",r[r.GRANTED=1]="GRANTED",r}({});class Tu{constructor(e){this._instance=e}get S(){return this._instance.config}get consent(){return this.j()?mt.DENIED:this.U}isOptedOut(){return this.consent===mt.DENIED||this.consent===mt.PENDING&&this.S.opt_out_capturing_by_default}isOptedIn(){return!this.isOptedOut()}optInOut(e){this.q.L(this.B,e?1:0,this.S.cookie_expiration,this.S.cross_subdomain_cookie,this.S.secure_cookie)}reset(){this.q.N(this.B,this.S.cross_subdomain_cookie)}get B(){var{token:e,opt_out_capturing_cookie_prefix:t}=this._instance.config;return(t||"__ph_opt_in_out_")+e}get U(){var e=this.q.A(this.B);return e==="1"?mt.GRANTED:e==="0"?mt.DENIED:mt.PENDING}get q(){if(!this.H){var e=this.S.opt_out_capturing_persistence_type;this.H=e==="localStorage"?G:He;var t=e==="localStorage"?He:G;t.A(this.B)&&(this.H.A(this.B)||this.optInOut(t.A(this.B)==="1"),t.N(this.B,this.S.cross_subdomain_cookie))}return this.H}j(){return!!this.S.respect_dnt&&!!ba([he==null?void 0:he.doNotTrack,he==null?void 0:he.msDoNotTrack,P.doNotTrack],e=>M([!0,1,"1","yes"],e))}}var dr=Q("[Dead Clicks]"),Au=()=>!0,Lu=r=>{var e,t=!((e=r.instance.persistence)==null||!e.get_property(Ea)),i=r.instance.config.capture_dead_clicks;return Me(i)?i:t};class La{get lazyLoadedDeadClicksAutocapture(){return this.W}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Ea]:e==null?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.G(()=>{this.J()})}G(e){var t,i;(t=P.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(i=P.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",s=>{s?dr.error("failed to load script",s):e()})}J(){var e;if(E){if(!this.W&&(e=P.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=B(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.W=P.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.W.start(E),dr.info("starting...")}}else dr.error("`document` not found. Cannot start.")}stop(){this.W&&(this.W.stop(),this.W=void 0,dr.info("stopping..."))}}var Kr=Q("[ExceptionAutocapture]");class Nu{constructor(e){var t;this.V=()=>{var i;if(v&&this.isEnabled&&(i=P.__PosthogExtensions__)!=null&&i.errorWrappingFunctions){var s=P.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,n=P.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=P.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.K&&this.S.capture_unhandled_errors&&(this.K=s(this.captureException.bind(this))),!this.Y&&this.S.capture_unhandled_rejections&&(this.Y=n(this.captureException.bind(this))),!this.X&&this.S.capture_console_errors&&(this.X=a(this.captureException.bind(this)))}catch(o){Kr.error("failed to start",o),this.Z()}}},this._instance=e,this.tt=!((t=this._instance.persistence)==null||!t.props[Ns]),this.S=this.it(),this.startIfEnabled()}it(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return B(e)?t=w({},t,e):(b(e)?this.tt:e)&&(t=w({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.S.capture_console_errors||this.S.capture_unhandled_errors||this.S.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Kr.info("enabled"),this.G(this.V))}
91G(e){var t,i;(t=P.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(i=P.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",s=>{if(s)return Kr.error("failed to load script",s);e()})}Z(){var e,t,i;(e=this.K)==null||e.call(this),this.K=void 0,(t=this.Y)==null||t.call(this),this.Y=void 0,(i=this.X)==null||i.call(this),this.X=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.tt=!!t||!1,this.S=this.it(),this._instance.persistence&&this._instance.persistence.register({[Ns]:this.tt}),this.startIfEnabled()}captureException(e){var t=this._instance.requestRouter.endpointFor("ui");e.$exception_personURL=t+"/project/"+this._instance.config.token+"/person/"+this._instance.get_distinct_id(),this._instance.exceptions.sendExceptionEvent(e)}}function Na(r){return!b(Event)&&Da(r,Event)}function Da(r,e){try{return r instanceof e}catch{return!1}}function ja(r){switch(Object.prototype.toString.call(r)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":return!0;default:return Da(r,Error)}}function br(r,e){return Object.prototype.toString.call(r)==="[object "+e+"]"}function Yr(r){return br(r,"DOMError")}var en=/\(error: (.*)\)/,tn=50,xt="?";function Qr(r,e,t,i){var s={platform:"web:javascript",filename:r,function:e==="<anonymous>"?xt:e,in_app:!0};return b(t)||(s.lineno=t),b(i)||(s.colno=i),s}var Du=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ju=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,qu=/\((\S*)(?::(\d+))(?::(\d+))\)/,Bu=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Hu=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Uu=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var i=e.sort((s,n)=>s[0]-n[0]).map(s=>s[1]);return function(s,n){n===void 0&&(n=0);for(var a=[],o=s.split(`
92`),l=n;l<o.length;l++){var u=o[l];if(!(u.length>1024)){var c=en.test(u)?u.replace(en,"$1"):u;if(!c.match(/\S*Error: /)){for(var p of i){var d=p(c);if(d){a.push(d);break}}if(a.length>=tn)break}}}return function(f){if(!f.length)return[];var h=Array.from(f);return h.reverse(),h.slice(0,tn).map(g=>w({},g,{filename:g.filename||zu(h).filename,function:g.function||xt}))}(a)}}([30,r=>{var e=Du.exec(r);if(e){var[,t,i,s]=e;return Qr(t,xt,+i,+s)}var n=ju.exec(r);if(n){if(n[2]&&n[2].indexOf("eval")===0){var a=qu.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}var[o,l]=sn(n[1]||xt,n[2]);return Qr(l,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],[50,r=>{var e=Bu.exec(r);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var t=Hu.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}var i=e[3],s=e[1]||xt;return[s,i]=sn(s,i),Qr(i,s,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]);function zu(r){return r[r.length-1]||{}}var hr,rn,Xr,sn=(r,e)=>{var t=r.indexOf("safari-extension")!==-1,i=r.indexOf("safari-web-extension")!==-1;return t||i?[r.indexOf("@")!==-1?r.split("@")[0]:xt,t?"safari-extension:"+e:"safari-web-extension:"+e]:[r,e]},Wu=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;function Xi(r,e){e===void 0&&(e=0);var t=r.stacktrace||r.stack||"",i=function(a){return a&&Gu.test(a.message)?1:0}(r);try{var s=Uu,n=function(a,o){var l=function(u){var c=globalThis._posthogChunkIds;if(!c)return{};var p=Object.keys(c);return Xr&&p.length===rn||(rn=p.length,Xr=p.reduce((d,f)=>{hr||(hr={});var h=hr[f];if(h)d[h[0]]=h[1];else for(var g=u(f),_=g.length-1;_>=0;_--){var y=g[_],x=y==null?void 0:y.filename,I=c[f];if(x&&I){d[x]=I,hr[f]=[x,I];break}}return d},{})),Xr}(o);return a.forEach(u=>{u.filename&&(u.chunk_id=l[u.filename])}),a}(s(t,i),s);return n.slice(0,n.length-e)}catch{}return[]}var Gu=/Minified React error #\d+;/i;function Vu(r,e){var t,i,s=Xi(r),n=(t=e==null?void 0:e.handled)===null||t===void 0||t,a=(i=e==null?void 0:e.synthetic)!==null&&i!==void 0&&i;return{type:e!=null&&e.overrideExceptionType?e.overrideExceptionType:r.name,value:function(o){var l=o.message;return l.error&&typeof l.error.message=="string"?String(l.error.message):String(l)}(r),stacktrace:{frames:s,type:"raw"},mechanism:{handled:n,synthetic:a}}}function qa(r,e){var t=Vu(r,e);return r.cause&&ja(r.cause)&&r.cause!==r?[t,...qa(r.cause,{handled:e==null?void 0:e.handled,synthetic:e==null?void 0:e.synthetic})]:[t]}function Jr(r,e){return{$exception_list:qa(r,e),$exception_level:"error"}}function Zr(r,e){var t,i,s,n=(t=e==null?void 0:e.handled)===null||t===void 0||t,a=(i=e==null?void 0:e.synthetic)===null||i===void 0||i,o={type:e!=null&&e.overrideExceptionType?e.overrideExceptionType:(s=e==null?void 0:e.defaultExceptionType)!==null&&s!==void 0?s:"Error",value:r||(e==null?void 0:e.defaultExceptionMessage),mechanism:{handled:n,synthetic:a}};if(e!=null&&e.syntheticException){var l=Xi(e.syntheticException,1);l.length&&(o.stacktrace={frames:l,type:"raw"})}return{$exception_list:[o],$exception_level:"error"}}function Ku(r){return H(r)&&!pi(r)&&su.indexOf(r)>=0}function Yu(r,e){var t,i,s=(t=e==null?void 0:e.handled)===null||t===void 0||t,n=(i=e==null?void 0:e.synthetic)===null||i===void 0||i,a=e!=null&&e.overrideExceptionType?e.overrideExceptionType:Na(r)?r.constructor.name:"Error",o="Non-Error 'exception' captured with keys: "+function(c,p){p===void 0&&(p=40);var d=Object.keys(c);if(d.sort(),!d.length)return"[object has no keys]";for(var f=d.length;f>0;f--){var h=d.slice(0,f).join(", ");
92if(!(h.length>p))return f===d.length||h.length<=p?h:h.slice(0,p)+"..."}return""}(r),l={type:a,value:o,mechanism:{handled:s,synthetic:n}};if(e!=null&&e.syntheticException){var u=Xi(e==null?void 0:e.syntheticException,1);u.length&&(l.stacktrace={frames:u,type:"raw"})}return{$exception_list:[l],$exception_level:Ku(r.level)?r.level:"error"}}function Qu(r,e){var{error:t,event:i}=r,s={$exception_list:[]},n=t||i;if(Yr(n)||function(d){return br(d,"DOMException")}(n)){var a=n;if(function(d){return"stack"in d}(n))s=Jr(n,e);else{var o=a.name||(Yr(a)?"DOMError":"DOMException"),l=a.message?o+": "+a.message:o;s=Zr(l,w({},e,{overrideExceptionType:Yr(a)?"DOMError":"DOMException",defaultExceptionMessage:l}))}return"code"in a&&(s.$exception_DOMException_code=""+a.code),s}if(function(d){return br(d,"ErrorEvent")}(n)&&n.error)return Jr(n.error,e);if(ja(n))return Jr(n,e);if(function(d){return br(d,"Object")}(n)||Na(n))return Yu(n,e);if(b(t)&&H(i)){var u="Error",c=i,p=i.match(Wu);return p&&(u=p[1],c=p[2]),Zr(c,w({},e,{overrideExceptionType:u,defaultExceptionMessage:c}))}return Zr(n,e)}function nn(r,e,t){try{if(!(e in r))return()=>{};var i=r[e],s=t(i);return _e(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),r[e]=s,()=>{r[e]=i}}catch{return()=>{}}}class Xu{constructor(e){var t;this._instance=e,this.et=(v==null||(t=v.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(S.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.rt&&this.rt(),this.rt=void 0,S.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(v&&v.history){var i=this;(e=v.history.pushState)!=null&&e.__posthog_wrapped__||nn(v.history,"pushState",s=>function(n,a,o){s.call(this,n,a,o),i.st("pushState")}),(t=v.history.replaceState)!=null&&t.__posthog_wrapped__||nn(v.history,"replaceState",s=>function(n,a,o){s.call(this,n,a,o),i.st("replaceState")}),this.nt()}}st(e){try{var t,i=v==null||(t=v.location)==null?void 0:t.pathname;if(!i)return;i!==this.et&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.et=i}catch(s){S.error("Error capturing "+e+" pageview",s)}}nt(){if(!this.rt){var e=()=>{this.st("popstate")};j(v,"popstate",e),this.rt=()=>{v&&v.removeEventListener("popstate",e)}}}}function Mr(r){var e,t;return((e=JSON.stringify(r,(t=[],function(i,s){if(B(s)){for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(s)?"[Circular]":(t.push(s),s)}return s})))==null?void 0:e.length)||0}function Ii(r,e){if(e===void 0&&(e=66060288e-1),r.size>=e&&r.data.length>1){var t=Math.floor(r.data.length/2),i=r.data.slice(0,t),s=r.data.slice(t);return[Ii({size:Mr(i),data:i,sessionId:r.sessionId,windowId:r.windowId}),Ii({size:Mr(s),data:s,sessionId:r.sessionId,windowId:r.windowId})].flatMap(n=>n)}return[r]}var De=(r=>(r[r.DomContentLoaded=0]="DomContentLoaded",r[r.Load=1]="Load",r[r.FullSnapshot=2]="FullSnapshot",r[r.IncrementalSnapshot=3]="IncrementalSnapshot",r[r.Meta=4]="Meta",r[r.Custom=5]="Custom",r[r.Plugin=6]="Plugin",r))(De||{}),we=(r=>(r[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag",r[r.StyleDeclaration=13]="StyleDeclaration",r[r.Selection=14]="Selection",r[r.AdoptedStyleSheet=15]="AdoptedStyleSheet",r[r.CustomElement=16]="CustomElement",r))(we||{}),Ri="[SessionRecording]",Pi="redacted",pr={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:r=>r,recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io",".clarity.ms","analytics.google.com","bam.nr-data.net"]},Ju=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],Zu=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],ec=["/s/","/e/","/i/"];function an(r,e,t,i){if(O(r))return r;var s=(e==null?void 0:e["content-length"])||function(n){return new Blob([n]).size}(r);return H(s)&&(s=parseInt(s)),s>t?Ri+" "+i+" body too large to record ("+s+" bytes)":r}function on(r,e){if(O(r))return r;var t=r;return Ot(t,!1)||(t=Ri+" "+e+" body "+Pi),$(Zu,i=>{var s,n;(s=t)!=null&&s.length&&((n=t)==null?void 0:n.indexOf(i))!==-1&&(t=Ri+" "+e+" body "+Pi+" as might contain: "+i)}),t}var tc=(r,e)=>{var t,i,s,n={payloadSizeLimitBytes:pr.payloadSizeLimitBytes,performanceEntryTypeToObserve:[...pr.performanceEntryTypeToObserve],payloadHostDenyList:[...e.payloadHostDenyList||[],...pr.payloadHostDenyList]},a=r.session_recording.recordHeaders!==!1&&e.recordHeaders,o=r.session_recording.recordBody!==!1&&e.recordBody,l=r.capture_performance!==!1&&e.recordPerformance,u=(t=n,s=Math.min(1e6,(i=t.payloadSizeLimitBytes)!==null&&i!==void 0?i:1e6),d=>(d!=null&&d.requestBody&&(d.requestBody=an(d.requestBody,d.requestHeaders,s,"Request")),d!=null&&d.responseBody&&(d.responseBody=an(d.responseBody,d.responseHeaders,s,"Response")),d)),c=d=>{return u(((g,_)=>{var y,x=$t(g.name),I=_.indexOf("http")===0?(y=$t(_))==null?void 0:y.pathname:_;I==="/"&&(I="");var k=x==null?void 0:x.pathname.replace(I||"","");if(!(x&&k&&ec.some(F=>k.indexOf(F)===0)))return g})((h=(f=d).requestHeaders,O(h)||$(Object.keys(h??{}),g=>{Ju.includes(g.toLowerCase())&&(h[g]=Pi)}),f),r.api_host));var f,h}
92,p=_e(r.session_recording.maskNetworkRequestFn);return p&&_e(r.session_recording.maskCapturedNetworkRequestFn)&&S.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),p&&(r.session_recording.maskCapturedNetworkRequestFn=d=>{var f=r.session_recording.maskNetworkRequestFn({url:d.name});return w({},d,{name:f==null?void 0:f.url})}),n.maskRequestFn=_e(r.session_recording.maskCapturedNetworkRequestFn)?d=>{var f,h=c(d);return h&&(f=r.session_recording.maskCapturedNetworkRequestFn==null?void 0:r.session_recording.maskCapturedNetworkRequestFn(h))!==null&&f!==void 0?f:void 0}:d=>function(f){if(!b(f))return f.requestBody=on(f.requestBody,"Request"),f.responseBody=on(f.responseBody,"Response"),f}(c(d)),w({},pr,n,{recordHeaders:a,recordBody:o,recordPerformance:l,recordInitialRequests:l})};function ve(r,e,t,i,s){return e>t&&(S.warn("min cannot be greater than max."),e=t),Z(r)?r>t?(i&&S.warn(i+" cannot be  greater than max: "+t+". Using max value instead."),t):r<e?(i&&S.warn(i+" cannot be less than min: "+e+". Using min value instead."),e):r:(i&&S.warn(i+" must be a number. using max or fallback. max: "+t+", fallback: "+s),ve(s||t,e,t,i))}class rc{constructor(e,t){var i,s;t===void 0&&(t={}),this.ot=100,this.lt=10,this.ut={},this.ht={},this.dt=()=>{Object.keys(this.ut).forEach(n=>{this.ut[n]=this.ut[n]+this.lt,this.ut[n]>=this.ot&&delete this.ut[n]})},this.vt=n=>{var a=this._rrweb.mirror.getNode(n);if((a==null?void 0:a.nodeName)!=="svg"&&a instanceof Element){var o=a.closest("svg");if(o)return[this._rrweb.mirror.getId(o),o]}return[n,a]},this.ct=n=>{var a,o,l,u,c,p,d,f;return((a=(o=n.removes)==null?void 0:o.length)!==null&&a!==void 0?a:0)+((l=(u=n.attributes)==null?void 0:u.length)!==null&&l!==void 0?l:0)+((c=(p=n.texts)==null?void 0:p.length)!==null&&c!==void 0?c:0)+((d=(f=n.adds)==null?void 0:f.length)!==null&&d!==void 0?d:0)},this.throttleMutations=n=>{if(n.type!==3||n.data.source!==0)return n;var a=n.data,o=this.ct(a);a.attributes&&(a.attributes=a.attributes.filter(u=>{var c,p,d,[f,h]=this.vt(u.id);return this.ut[f]===0?!1:(this.ut[f]=(c=this.ut[f])!==null&&c!==void 0?c:this.ot,this.ut[f]=Math.max(this.ut[f]-1,0),this.ut[f]===0&&(this.ht[f]||(this.ht[f]=!0,(p=(d=this.ft).onBlockedNode)==null||p.call(d,f,h))),u)}));var l=this.ct(a);return l!==0||o===l?n:void 0},this._rrweb=e,this.ft=t,this.lt=ve((i=this.ft.refillRate)!==null&&i!==void 0?i:this.lt,0,100,"mutation throttling refill rate"),this.ot=ve((s=this.ft.bucketSize)!==null&&s!==void 0?s:this.ot,0,100,"mutation throttling bucket size"),setInterval(()=>{this.dt()},1e3)}}var me=Uint8Array,oe=Uint16Array,Tt=Uint32Array,Ji=new me([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]),Zi=new me([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]),ln=new me([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ba=function(r,e){for(var t=new oe(31),i=0;i<31;++i)t[i]=e+=1<<r[i-1];var s=new Tt(t[30]);for(i=1;i<30;++i)for(var n=t[i];n<t[i+1];++n)s[n]=n-t[i]<<5|i;return[t,s]},Ha=Ba(Ji,2),ic=Ha[0],Mi=Ha[1];ic[28]=258,Mi[258]=28;for(var un=Ba(Zi,0)[1],Ua=new oe(32768),L=0;L<32768;++L){var ot=(43690&L)>>>1|(21845&L)<<1;ot=(61680&(ot=(52428&ot)>>>2|(13107&ot)<<2))>>>4|(3855&ot)<<4,Ua[L]=((65280&ot)>>>8|(255&ot)<<8)>>>1}var Qt=function(r,e,t){for(var i=r.length,s=0,n=new oe(e);s<i;++s)++n[r[s]-1];var a,o=new oe(e);for(s=0;s<e;++s)o[s]=o[s-1]+n[s-1]<<1;for(a=new oe(i),s=0;s<i;++s)a[s]=Ua[o[r[s]-1]++]>>>15-r[s];return a},ht=new me(288);for(L=0;L<144;++L)ht[L]=8;for(L=144;L<256;++L)ht[L]=9;for(L=256;L<280;++L)ht[L]=7;for(L=280;L<288;++L)ht[L]=8;var Fr=new me(32);for(L=0;L<32;++L)Fr[L]=5;var sc=Qt(ht,9),nc=Qt(Fr,5),za=function(r){return(r/8>>0)+(7&r&&1)},Wa=function(r,e,t){(t==null||t>r.length)&&(t=r.length);var i=new(r instanceof oe?oe:r instanceof Tt?Tt:me)(t-e);return i.set(r.subarray(e,t)),i},Ae=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8},Dt=function(r,e,t){t<<=7&e;var i=e/8>>0;r[i]|=t,r[i+1]|=t>>>8,r[i+2]|=t>>>16},ei=function(r,e){for(var t=[],i=0;i<r.length;++i)r[i]&&t.push({s:i,f:r[i]});var s=t.length,n=t.slice();if(!s)return[new me(0),0];if(s==1){var a=new me(t[0].s+1);return a[t[0].s]=1,[a,1]}t.sort(function(F,T){return F.f-T.f}),t.push({s:-1,f:25001});var o=t[0],l=t[1],u=0,c=1,p=2;for(t[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=s-1;)o=t[t[u].f<t[p].f?u++:p++],l=t[u!=c&&t[u].f<t[p].f?u++:p++],t[c++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(i=1;i<s;++i)n[i].s>d&&(d=n[i].s);var f=new oe(d+1),h=Fi(t[c-1],f,0);if(h>e){i=0;var g=0,_=h-e,y=1<<_;for(n.sort(function(F,T){return f[T.s]-f[F.s]||F.f-T.f});i<s;++i){var x=n[i].s;if(!(f[x]>e))break;g+=y-(1<<h-f[x]),f[x]=e}for(g>>>=_;g>0;){var I=n[i].s;f[I]<e?g-=1<<e-f[I]++-1:++i}for(;i>=0&&g;--i){var k=n[i].s;f[k]==e&&(--f[k],++g)}h=e}return[new me(f),h]},Fi=function(r,e,t){return r.s==-1?Math.max(Fi(r.l,e,t+1),Fi(r.r,e,t+1)):e[r.s]=t},cn=function(r){for(var e=r.length;e&&!r[--e];);for(var t=new oe(++e),i=0,s=r[0],n=1,a=function(l){t[i++]=l},o=1;o<=e;++o)if(r[o]==s&&o!=e)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=r[o]}return[t.subarray(0,i),e]},jt=function(r,e){for(var t=0,i=0;i<e.length;++i)t+=r[i]*e[i];return t},Oi=function(r,e,t){var i=t.length,s=za(e+2);r[s]=255&i,r[s+1]=i>>>8,r[s+2]=255^r[s],r[s+3]=255^r[s+1];for(var n=0;n<i;++n)r[s+n+4]=t[n];return 8*(s+4+i)},dn=function(r,e,t,i,s,n,a,o,l,u,c){Ae(e,c++,t),++s[256];for(var p=ei(s,15),d=p[0],f=p[1],h=ei(n,15),g=h[0],_=h[1],y=cn(d),x=y[0],I=y[1],k=cn(g),F=k[0],T=k[1],N=new oe(19),R=0;R<x.length;++R)N[31&x[R]]++;for(R=0;R<F.length;++R)N[31&F[R]]++;for(var Se=ei(N,7),le=Se[0],be=Se[1],pe=19;pe>4&&!le[ln[pe-1]];--pe);var Te,xe,ke,gt,Ue=u+5<<3,nt=jt(s,ht)+jt(n,Fr)+a,Ce=jt(s,d)+jt(n,g)+a+14+3*pe+jt(N,le)+(2*N[16]+3*N[17]+7*N[18]);if(Ue<=nt&&Ue<=Ce)return Oi(e,c,r.subarray(l,l+u));if(Ae(e,c,1+(Ce<nt)),c+=2,Ce<nt){Te=Qt(d,f),xe=d,ke=Qt(g,_),gt=g;var ze=Qt(le,be);for(Ae(e,c,I-257),Ae(e,c+5,T-1),Ae(e,c+10,pe-4),c+=14,R=0;R<pe;++R)Ae(e,c+3*R,le[ln[R]]);c+=3*pe;for(var vt=[x,F],te=0;te<2;++te){var fe=vt[te];for(R=0;R<fe.length;++R){var ue=31&fe[R];Ae(e,c,ze[ue]),c+=le[ue],ue>15&&(Ae(e,c,fe[R]>>>5&127),c+=fe[R]>>>12)}}}else Te=sc,xe=ht,ke=nc,gt=Fr;
92for(R=0;R<o;++R)if(i[R]>255){ue=i[R]>>>18&31,Dt(e,c,Te[ue+257]),c+=xe[ue+257],ue>7&&(Ae(e,c,i[R]>>>23&31),c+=Ji[ue]);var _t=31&i[R];Dt(e,c,ke[_t]),c+=gt[_t],_t>3&&(Dt(e,c,i[R]>>>5&8191),c+=Zi[_t])}else Dt(e,c,Te[i[R]]),c+=xe[i[R]];return Dt(e,c,Te[256]),c+xe[256]},ac=new Tt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),oc=function(){for(var r=new Tt(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;r[e]=t}return r}(),lc=function(){var r=4294967295;return{p:function(e){for(var t=r,i=0;i<e.length;++i)t=oc[255&t^e[i]]^t>>>8;r=t},d:function(){return 4294967295^r}}},uc=function(r,e,t,i,s){return function(n,a,o,l,u,c){var p=n.length,d=new me(l+p+5*(1+Math.floor(p/7e3))+u),f=d.subarray(l,d.length-u),h=0;if(!a||p<8)for(var g=0;g<=p;g+=65535){var _=g+65535;_<p?h=Oi(f,h,n.subarray(g,_)):(f[g]=c,h=Oi(f,h,n.subarray(g,p)))}else{for(var y=ac[a-1],x=y>>>13,I=8191&y,k=(1<<o)-1,F=new oe(32768),T=new oe(k+1),N=Math.ceil(o/3),R=2*N,Se=function(Ur){return(n[Ur]^n[Ur+1]<<N^n[Ur+2]<<R)&k},le=new Tt(25e3),be=new oe(288),pe=new oe(32),Te=0,xe=0,ke=(g=0,0),gt=0,Ue=0;g<p;++g){var nt=Se(g),Ce=32767&g,ze=T[nt];if(F[Ce]=ze,T[nt]=Ce,gt<=g){var vt=p-g;if((Te>7e3||ke>24576)&&vt>423){h=dn(n,f,0,le,be,pe,xe,ke,Ue,g-Ue,h),ke=Te=xe=0,Ue=g;for(var te=0;te<286;++te)be[te]=0;for(te=0;te<30;++te)pe[te]=0}var fe=2,ue=0,_t=I,We=Ce-ze&32767;if(vt>2&&nt==Se(g-We))for(var Do=Math.min(x,vt)-1,jo=Math.min(32767,g),qo=Math.min(258,vt);We<=jo&&--_t&&Ce!=ze;){if(n[g+fe]==n[g+fe-We]){for(var Ge=0;Ge<qo&&n[g+Ge]==n[g+Ge-We];++Ge);if(Ge>fe){if(fe=Ge,ue=We,Ge>Do)break;var Bo=Math.min(We,Ge-2),us=0;for(te=0;te<Bo;++te){var Hr=g-We+te+32768&32767,cs=Hr-F[Hr]+32768&32767;cs>us&&(us=cs,ze=Hr)}}}We+=(Ce=ze)-(ze=F[Ce])+32768&32767}if(ue){le[ke++]=268435456|Mi[fe]<<18|un[ue];var ds=31&Mi[fe],hs=31&un[ue];xe+=Ji[ds]+Zi[hs],++be[257+ds],++pe[hs],gt=g+fe,++Te}else le[ke++]=n[g],++be[n[g]]}}h=dn(n,f,c,le,be,pe,xe,ke,Ue,g-Ue,h)}return Wa(d,0,l+za(h)+u)}(r,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+e.mem,t,i,!0)},$i=function(r,e,t){for(;t;++e)r[e]=t,t>>>=8},cc=function(r,e){var t=e.filename;if(r[0]=31,r[1]=139,r[2]=8,r[8]=e.level<2?4:e.level==9?2:0,r[9]=3,e.mtime!=0&&$i(r,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),t){r[3]=8;for(var i=0;i<=t.length;++i)r[i+10]=t.charCodeAt(i)}},dc=function(r){return 10+(r.filename&&r.filename.length+1||0)};function Ga(r,e){e===void 0&&(e={});var t=lc(),i=r.length;t.p(r);var s=uc(r,e,dc(e),8),n=s.length;return cc(s,e),$i(s,n-8,t.d()),$i(s,n-4,i),s}function Va(r,e){var t=r.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(r);for(var i=new me(r.length+(r.length>>>1)),s=0,n=function(u){i[s++]=u},a=0;a<t;++a){if(s+5>i.length){var o=new me(s+8+(t-a<<1));o.set(i),i=o}var l=r.charCodeAt(a);l<128||e?n(l):l<2048?(n(192|l>>>6),n(128|63&l)):l>55295&&l<57344?(n(240|(l=65536+(1047552&l)|1023&r.charCodeAt(++a))>>>18),n(128|l>>>12&63),n(128|l>>>6&63),n(128|63&l)):(n(224|l>>>12),n(128|l>>>6&63),n(128|63&l))}return Wa(i,0,s)}function hc(r,e){return function(t){for(var i=0,s=0;s<t.length;s++)i=(i<<5)-i+t.charCodeAt(s),i|=0;return Math.abs(i)}(r)%100<ve(100*e,0,100)}var it="disabled",es="sampled",Or="active",pt="buffering",ts="paused",rs="trigger",Oe=rs+"_activated",ee=rs+"_pending",$e=rs+"_"+it;function hn(r,e){return e.some(t=>t.matching==="regex"&&new RegExp(t.url).test(r))}class Ka{constructor(e){this._t=e}triggerStatus(e){var t=this._t.map(i=>i.triggerStatus(e));return t.includes(Oe)?Oe:t.includes(ee)?ee:$e}stop(){this._t.forEach(e=>e.stop())}}class Ya{constructor(e){this._t=e}triggerStatus(e){var t=new Set;for(var i of this._t)t.add(i.triggerStatus(e));switch(t.delete($e),t.size){case 0:return $e;case 1:return Array.from(t)[0];default:return ee}}stop(){this._t.forEach(e=>e.stop())}}class pc{triggerStatus(){return ee}stop(){}}class fc{constructor(e){this.gt=[],this.bt=[],this.urlBlocked=!1,this._instance=e}onRemoteConfig(e){var t,i;this.gt=((t=e.sessionRecording)==null?void 0:t.urlTriggers)||[],this.bt=((i=e.sessionRecording)==null?void 0:i.urlBlocklist)||[]}yt(e){var t;return this.gt.length===0?$e:((t=this._instance)==null?void 0:t.get_property(_i))===e?Oe:ee}triggerStatus(e){var t=this.yt(e),i=t===Oe?Oe:t===ee?ee:$e;return this._instance.register_for_session({$sdk_debug_replay_url_trigger_status:i}),i}checkUrlTriggerConditions(e,t,i){if(v!==void 0&&v.location.href){var s=v.location.href,n=this.urlBlocked,a=hn(s,this.bt);n&&a||(a&&!n?e():!a&&n&&t(),hn(s,this.gt)&&i("url"))}}stop(){}}class gc{constructor(e){this.linkedFlag=null,this.linkedFlagSeen=!1,this.wt=()=>{},this._instance=e}triggerStatus(){var e=ee;return O(this.linkedFlag)&&(e=$e),this.linkedFlagSeen&&(e=Oe),this._instance.register_for_session({$sdk_debug_replay_linked_flag_trigger_status:e}),e}onRemoteConfig(e,t){var i;if(this.linkedFlag=((i=e.sessionRecording)==null?void 0:i.linkedFlag)||null,!O(this.linkedFlag)&&!this.linkedFlagSeen){var s=H(this.linkedFlag)?this.linkedFlag:this.linkedFlag.flag,n=H(this.linkedFlag)?null:this.linkedFlag.variant;this.wt=this._instance.onFeatureFlags((a,o)=>{var l=!1;if(B(o)&&s in o){var u=o[s];l=Me(u)?u===!0:n?u===n:!!u}this.linkedFlagSeen=l,l&&t(s,n)})}}stop(){this.wt()}}class vc{constructor(e){this.St=[],this._instance=e}onRemoteConfig(e){var t;this.St=((t=e.sessionRecording)==null?void 0:t.eventTriggers)||[]}$t(e){var t;return this.St.length===0?$e:((t=this._instance)==null?void 0:t.get_property(m
92i))===e?Oe:ee}triggerStatus(e){var t=this.$t(e),i=t===Oe?Oe:t===ee?ee:$e;return this._instance.register_for_session({$sdk_debug_replay_event_trigger_status:i}),i}stop(){}}function _c(r){return r.isRecordingEnabled?pt:it}function mc(r){if(!r.receivedDecide)return pt;if(!r.isRecordingEnabled)return it;if(r.urlTriggerMatching.urlBlocked)return ts;var e=r.isSampled===!0,t=new Ka([r.eventTriggerMatching,r.urlTriggerMatching,r.linkedFlagMatching]).triggerStatus(r.sessionId);return e?es:t===Oe?Or:t===ee?pt:r.isSampled===!1?it:Or}function yc(r){if(!r.receivedDecide)return pt;if(!r.isRecordingEnabled)return it;if(r.urlTriggerMatching.urlBlocked)return ts;var e=new Ya([r.eventTriggerMatching,r.urlTriggerMatching,r.linkedFlagMatching]).triggerStatus(r.sessionId),t=e!==$e,i=Me(r.isSampled);return t&&e===ee?pt:t&&e===$e||i&&!r.isSampled?it:r.isSampled===!0?es:Or}var Wt="[SessionRecording]",X=Q(Wt);function fr(){var r;return P==null||(r=P.__PosthogExtensions__)==null||(r=r.rrweb)==null?void 0:r.record}var bc=3e5,wc=[we.MouseMove,we.MouseInteraction,we.Scroll,we.ViewportResize,we.Input,we.TouchMove,we.MediaInteraction,we.Drag],pn=r=>({rrwebMethod:r,enqueuedAt:Date.now(),attempt:1});function lt(r){return function(e,t){for(var i="",s=0;s<e.length;){var n=e[s++];i+=String.fromCharCode(n)}return i}(Ga(Va(JSON.stringify(r))))}function fn(r){return r.type===De.Custom&&r.data.tag==="sessionIdle"}class Ec{get sessionId(){return this.kt}get xt(){return this._instance.config.session_recording.session_idle_threshold_ms||3e5}get started(){return this.Et}get It(){if(!this._instance.sessionManager)throw new Error(Wt+" must be started with a valid sessionManager.");return this._instance.sessionManager}get Pt(){var e,t;return this.Rt.triggerStatus(this.sessionId)===ee?6e4:(e=(t=this._instance.config.session_recording)==null?void 0:t.full_snapshot_interval_millis)!==null&&e!==void 0?e:bc}get Tt(){var e=this._instance.get_property(Ut);return Me(e)?e:null}get Mt(){var e,t,i=(e=this.M)==null?void 0:e.data[((t=this.M)==null?void 0:t.data.length)-1],{sessionStartTimestamp:s}=this.It.checkAndGetSessionAndWindowId(!0);return i?i.timestamp-s:null}get Ct(){var e=!!this._instance.get_property(vi),t=!this._instance.config.disable_session_recording;return v&&e&&t}get Ot(){var e=!!this._instance.get_property(qs),t=this._instance.config.enable_recording_console_log;return t??e}get Ft(){var e,t,i,s,n,a,o=this._instance.config.session_recording.captureCanvas,l=this._instance.get_property(Us),u=(e=(t=o==null?void 0:o.recordCanvas)!==null&&t!==void 0?t:l==null?void 0:l.enabled)!==null&&e!==void 0&&e,c=(i=(s=o==null?void 0:o.canvasFps)!==null&&s!==void 0?s:l==null?void 0:l.fps)!==null&&i!==void 0?i:4,p=(n=(a=o==null?void 0:o.canvasQuality)!==null&&a!==void 0?a:l==null?void 0:l.quality)!==null&&n!==void 0?n:.4;if(typeof p=="string"){var d=parseFloat(p);p=isNaN(d)?.4:d}return{enabled:u,fps:ve(c,0,12,"canvas recording fps",4),quality:ve(p,0,1,"canvas recording quality",.4)}}get At(){var e,t,i=this._instance.get_property(Bs),s={recordHeaders:(e=this._instance.config.session_recording)==null?void 0:e.recordHeaders,recordBody:(t=this._instance.config.session_recording)==null?void 0:t.recordBody},n=(s==null?void 0:s.recordHeaders)||(i==null?void 0:i.recordHeaders),a=(s==null?void 0:s.recordBody)||(i==null?void 0:i.recordBody),o=B(this._instance.config.capture_performance)?this._instance.config.capture_performance.network_timing:this._instance.config.capture_performance,l=!!(Me(o)?o:i!=null&&i.capturePerformance);return n||a||l?{recordHeaders:n,recordBody:a,recordPerformance:l}:void 0}get Dt(){var e,t,i,s,n,a,o=this._instance.get_property(Hs),l={maskAllInputs:(e=this._instance.config.session_recording)==null?void 0:e.maskAllInputs,maskTextSelector:(t=this._instance.config.session_recording)==null?void 0:t.maskTextSelector,blockSelector:(i=this._instance.config.session_recording)==null?void 0:i.blockSelector},u=(s=l==null?void 0:l.maskAllInputs)!==null&&s!==void 0?s:o==null?void 0:o.maskAllInputs,c=(n=l==null?void 0:l.maskTextSelector)!==null&&n!==void 0?n:o==null?void 0:o.maskTextSelector,p=(a=l==null?void 0:l.blockSelector)!==null&&a!==void 0?a:o==null?void 0:o.blockSelector;return b(u)&&b(c)&&b(p)?void 0:{maskAllInputs:u==null||u,maskTextSelector:c,blockSelector:p}}get Lt(){var e=this._instance.get_property(zs);return Z(e)?e:null}get Nt(){var e=this._instance.get_property(Ws);return Z(e)?e:null}get status(){return this.jt?this.zt({receivedDecide:this.jt,isRecordingEnabled:this.Ct,isSampled:this.Tt,urlTriggerMatching:this.Ut,eventTriggerMatching:this.qt,linkedFlagMatching:this.Bt,sessionId:this.sessionId}):pt}constructor(e){if(this.zt=_c,this.jt=!1,this.Ht=[],this.Wt="unknown",this.Gt
92=Date.now(),this.Rt=new pc,this.Jt=void 0,this.Vt=void 0,this.Kt=void 0,this.Yt=void 0,this.Xt=void 0,this._forceAllowLocalhostNetworkCapture=!1,this.Qt=()=>{this.Zt()},this.ti=()=>{this.ii("browser offline",{})},this.ei=()=>{this.ii("browser online",{})},this.ri=()=>{if(E!=null&&E.visibilityState){var s="window "+E.visibilityState;this.ii(s,{})}},this._instance=e,this.Et=!1,this.si="/s/",this.ni=void 0,this.jt=!1,!this._instance.sessionManager)throw X.error("started without valid sessionManager"),new Error(Wt+" started without valid sessionManager. This is a bug.");if(this._instance.config.__preview_experimental_cookieless_mode)throw new Error(Wt+" cannot be used with __preview_experimental_cookieless_mode.");this.Bt=new gc(this._instance),this.Ut=new fc(this._instance),this.qt=new vc(this._instance);var{sessionId:t,windowId:i}=this.It.checkAndGetSessionAndWindowId();this.kt=t,this.oi=i,this.M=this.ai(),this.xt>=this.It.sessionTimeoutMs&&X.warn("session_idle_threshold_ms ("+this.xt+") is greater than the session timeout ("+this.It.sessionTimeoutMs+"). Session will never be detected as idle")}startIfEnabledOrStop(e){this.Ct?(this.li(e),j(v,"beforeunload",this.Qt),j(v,"offline",this.ti),j(v,"online",this.ei),j(v,"visibilitychange",this.ri),this.ui(),this.hi(),O(this.Jt)&&(this.Jt=this._instance.on("eventCaptured",t=>{try{if(t.event==="$pageview"){var i=t!=null&&t.properties.$current_url?this.di(t==null?void 0:t.properties.$current_url):"";if(!i)return;this.ii("$pageview",{href:i})}}catch(s){X.error("Could not add $pageview to rrweb session",s)}})),this.Vt||(this.Vt=this.It.onSessionId((t,i,s)=>{var n,a;s&&(this.ii("$session_id_change",{sessionId:t,windowId:i,changeReason:s}),(n=this._instance)==null||(n=n.persistence)==null||n.unregister(mi),(a=this._instance)==null||(a=a.persistence)==null||a.unregister(_i))}))):this.stopRecording()}stopRecording(){var e,t,i,s;this.Et&&this.ni&&(this.ni(),this.ni=void 0,this.Et=!1,v==null||v.removeEventListener("beforeunload",this.Qt),v==null||v.removeEventListener("offline",this.ti),v==null||v.removeEventListener("online",this.ei),v==null||v.removeEventListener("visibilitychange",this.ri),this.ai(),clearInterval(this.vi),(e=this.Jt)==null||e.call(this),this.Jt=void 0,(t=this.Xt)==null||t.call(this),this.Xt=void 0,(i=this.Vt)==null||i.call(this),this.Vt=void 0,(s=this.Yt)==null||s.call(this),this.Yt=void 0,this.qt.stop(),this.Ut.stop(),this.Bt.stop(),X.info("stopped"))}ci(){var e;(e=this._instance.persistence)==null||e.unregister(Ut)}fi(e){var t,i=this.kt!==e,s=this.Lt;if(Z(s)){var n=this.Tt,a=i||!Me(n),o=a?hc(e,s):n;a&&(o?this.pi(es):X.warn("Sample rate ("+s+") has determined that this sessionId ("+e+") will not be sent to the server."),this.ii("samplingDecisionMade",{sampleRate:s,isSampled:o})),(t=this._instance.persistence)==null||t.register({[Ut]:o})}else this.ci()}onRemoteConfig(e){var t,i,s,n;this.ii("$remote_config_received",e),this.gi(e),(t=e.sessionRecording)!=null&&t.endpoint&&(this.si=(n=e.sessionRecording)==null?void 0:n.endpoint),this.ui(),((i=e.sessionRecording)==null?void 0:i.triggerMatchType)==="any"?(this.zt=mc,this.Rt=new Ka([this.qt,this.Ut])):(this.zt=yc,this.Rt=new Ya([this.qt,this.Ut])),this._instance.register_for_session({$sdk_debug_replay_remote_trigger_matching_config:(s=e.sessionRecording)==null?void 0:s.triggerMatchType}),this.Ut.onRemoteConfig(e),this.qt.onRemoteConfig(e),this.Bt.onRemoteConfig(e,(a,o)=>{this.pi("linked_flag_matched",{flag:a,variant:o})}),this.jt=!0,this.startIfEnabledOrStop()}ui(){Z(this.Lt)&&O(this.Yt)&&(this.Yt=this.It.onSessionId(e=>{this.fi(e)}))}gi(e){if(this._instance.persistence){var t,i=this._instance.persistence,s=()=>{var n,a,o,l,u,c,p,d,f,h=(n=e.sessionRecording)==null?void 0:n.sampleRate,g=O(h)?null:parseFloat(h);O(g)&&this.ci();var _=(a=e.sessionRecording)==null?void 0:a.minimumDurationMilliseconds;i.register({[vi]:!!e.sessionRecording,[qs]:(o=e.sessionRecording)==null?void 0:o.consoleLogRecordingEnabled,[Bs]:w({capturePerformance:e.capturePerformance},(l=e.sessionRecording)==null?void 0:l.networkPayloadCapture),[Hs]:(u=e.sessionRecording)==null?void 0:u.masking,[Us]:{enabled:(c=e.sessionRecording)==null?void 0:c.recordCanvas,fps:(p=e.sessionRecording)==null?void 0:p.canvasFps,quality:(d=e.sessionRecording)==null?void 0:d.canvasQuality},[zs]:g,[Ws]:b(_)?null:_,[Gs]:(f=e.sessionRecording)==null?void 0:f.scriptConfig})};s(),(t=this.Kt)==null||t.call(this),this.Kt=this.It.onSessionId(s)}}log(e,t){var i;t===void 0&&(t="log"),(i=this._instance.sessionRecording)==null||i.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:t,trace:[],payload:[JSON.stringify(e)]}},timestamp:Date.now()})}li(e){if(!b(Object.assign)&&!b(Array.from)&&!(this.Et||this._instance.config.disable_session_recording||this._instance.consent.isOptedOut())){var t;this.Et=!0,this.It.checkAndGetSessionAndWindowId(),fr()?this.mi():(t=P.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,this.bi,i=>{if(i)return X.error("could not load recorder",i);this.mi()}),X.info("starting"),this.status===Or&&this.pi(e||"recording_initialized")}}get bi(){var e;return((e=this._instance)==null||(e=e.persistence)==null||(e=e.get_property(Gs))==null?void 0:e.script)||"recorder"}yi(e){var t;return e.type===3&&wc.indexOf((t=e.data)==null?void 0:t.source)!==-1}wi(e){var t=this.yi(e);t||this.Wt||e.timestamp-this.Gt>this.xt&&(this.Wt=!0,clearInterval(this.vi),this.ii("sessionIdle",{eventTimestamp:e.timestamp,lastActivityTimestamp:this.Gt,threshold:this.xt,bufferLength:this.M.data.length,bufferSize:this.M.size}),this.Zt());var i=!1;if(t&&(this.Gt=e.timestamp,this.Wt)){var s=this.Wt==="unknown";this.Wt=!1,s||(this.ii("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)}if(!this.Wt){var{windowId:n,sessionId:a}=this.It.checkAndGetSessionAndWindowId(!t,e.timestamp),o=this.kt!==a,l=this.oi!==n;this.oi=n,this.kt=a,o||l?(this.stopRecording(),this.startIfEnabledOrStop("session_id_changed")):i&&this.Si()}}$i(e){try{return e.rrwebMethod(),!0}catch(t){return this.Ht.length<10?this.Ht.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):X.warn("could not emit queued rrweb event.",t,e),!1}}ii(e,t){return this.$i(pn(()=>fr().addCustomEvent(e,t)))}ki(){return this.$i(pn(()=>fr().takeFullSnapshot()))}mi(){var e,t,i,s,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{}
92,collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},a=this._instance.config.session_recording;for(var[o,l]of Object.entries(a||{}))o in n&&(o==="maskInputOptions"?n.maskInputOptions=w({password:!0},l):n[o]=l);this.Ft&&this.Ft.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.Ft.fps},n.dataURLOptions={type:"image/webp",quality:this.Ft.quality}),this.Dt&&(n.maskAllInputs=(t=this.Dt.maskAllInputs)===null||t===void 0||t,n.maskTextSelector=(i=this.Dt.maskTextSelector)!==null&&i!==void 0?i:void 0,n.blockSelector=(s=this.Dt.blockSelector)!==null&&s!==void 0?s:void 0);var u=fr();if(u){this.xi=(e=this.xi)!==null&&e!==void 0?e:new rc(u,{refillRate:this._instance.config.session_recording.__mutationRateLimiterRefillRate,bucketSize:this._instance.config.session_recording.__mutationRateLimiterBucketSize,onBlockedNode:(p,d)=>{var f="Too many mutations on node '"+p+"'. Rate limiting. This could be due to SVG animations or something similar";X.info(f,{node:d}),this.log(Wt+" "+f,"warn")}});var c=this.Ei();this.ni=u(w({emit:p=>{this.onRRwebEmit(p)},plugins:c},n)),this.Gt=Date.now(),this.Wt=Me(this.Wt)?this.Wt:"unknown",this.ii("$session_options",{sessionRecordingOptions:n,activePlugins:c.map(p=>p==null?void 0:p.name)}),this.ii("$posthog_config",{config:this._instance.config})}else X.error("onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}Si(){if(this.vi&&clearInterval(this.vi),this.Wt!==!0){var e=this.Pt;e&&(this.vi=setInterval(()=>{this.ki()},e))}}Ei(){var e,t,i=[],s=(e=P.__PosthogExtensions__)==null||(e=e.rrwebPlugins)==null?void 0:e.getRecordConsolePlugin;s&&this.Ot&&i.push(s());var n=(t=P.__PosthogExtensions__)==null||(t=t.rrwebPlugins)==null?void 0:t.getRecordNetworkPlugin;return this.At&&_e(n)&&(!wu.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?i.push(n(tc(this._instance.config,this.At))):X.info("NetworkCapture not started because we are on localhost.")),i}onRRwebEmit(e){var t;if(this.Ii(),e&&B(e)){if(e.type===De.Meta){var i=this.di(e.data.href);if(this.Pi=i,!i)return;e.data.href=i}else this.Ri();if(this.Ut.checkUrlTriggerConditions(()=>this.Ti(),()=>this.Mi(),d=>this.Ci(d)),!this.Ut.urlBlocked||(s=e).type===De.Custom&&s.data.tag==="recording paused"){var s;e.type===De.FullSnapshot&&this.Si(),e.type===De.FullSnapshot&&this.jt&&this.Rt.triggerStatus(this.sessionId)===ee&&this.ai();var n=this.xi?this.xi.throttleMutations(e):e;if(n){var a=function(d){var f=d;if(f&&B(f)&&f.type===6&&B(f.data)&&f.data.plugin==="rrweb/console@1"){f.data.payload.payload.length>10&&(f.data.payload.payload=f.data.payload.payload.slice(0,10),f.data.payload.payload.push("...[truncated]"));for(var h=[],g=0;g<f.data.payload.payload.length;g++)f.data.payload.payload[g]&&f.data.payload.payload[g].length>2e3?h.push(f.data.payload.payload[g].slice(0,2e3)+"...[truncated]"):h.push(f.data.payload.payload[g]);return f.data.payload.payload=h,d}return d}(n);if(this.wi(a),this.Wt!==!0||fn(a)){if(fn(a)){var o=a.data.payload;if(o){var l=o.lastActivityTimestamp,u=o.threshold;a.timestamp=l+u}}var c=(t=this._instance.config.session_recording.compress_events)===null||t===void 0||t?function(d){if(Mr(d)<1024)return d;try{if(d.type===De.FullSnapshot)return w({},d,{data:lt(d.data),cv:"2024-10"});if(d.type===De.IncrementalSnapshot&&d.data.source===we.Mutation)return w({},d,{cv:"2024-10",data:w({},d.data,{texts:lt(d.data.texts),attributes:lt(d.data.attributes),removes:lt(d.data.removes),adds:lt(d.data.adds)})});if(d.type===De.IncrementalSnapshot&&d.data.source===we.StyleSheetRule)return w({},d,{cv:"2024-10",data:w({},d.data,{adds:d.data.adds?lt(d.data.adds):void 0,removes:d.data.removes?lt(d.data.removes):void 0})})}catch(f){X.error("could not compress event - will use uncompressed event",f)}return d}(a):a,p={$snapshot_bytes:Mr(c),$snapshot_data:c,$session_id:this.kt,$window_id:this.oi};this.status!==it?this.Oi(p):this.ai()}}}}}Ri(){if(!this._instance.config.capture_pageview&&v){var e=this.di(v.location.href);this.Pi!==e&&(this.ii("$url_changed",{href:e}),this.Pi=e)}}Ii(){if(this.Ht.length){var e=[...this.Ht];this.Ht=[],e.forEach(t=>{Date.now()-t.enqueuedAt<=2e3&&this.$i(t)})}}di(e){var t=this._instance.config.session_recording;
92if(t.maskNetworkRequestFn){var i,s={url:e};return(i=s=t.maskNetworkRequestFn(s))==null?void 0:i.url}return e}ai(){return this.M={size:0,data:[],sessionId:this.kt,windowId:this.oi},this.M}Zt(){this.Fi&&(clearTimeout(this.Fi),this.Fi=void 0);var e=this.Nt,t=this.Mt,i=Z(t)&&t>=0,s=Z(e)&&i&&t<e;return this.status===pt||this.status===ts||this.status===it||s?(this.Fi=setTimeout(()=>{this.Zt()},2e3),this.M):(this.M.data.length>0&&Ii(this.M).forEach(n=>{this.Ai({$snapshot_bytes:n.size,$snapshot_data:n.data,$session_id:n.sessionId,$window_id:n.windowId,$lib:"web",$lib_version:je.LIB_VERSION})}),this.ai())}Oi(e){var t,i=2+(((t=this.M)==null?void 0:t.data.length)||0);!this.Wt&&(this.M.size+e.$snapshot_bytes+i>943718.4||this.M.sessionId!==this.kt)&&(this.M=this.Zt()),this.M.size+=e.$snapshot_bytes,this.M.data.push(e.$snapshot_data),this.Fi||this.Wt||(this.Fi=setTimeout(()=>{this.Zt()},2e3))}Ai(e){this._instance.capture("$snapshot",e,{_url:this._instance.requestRouter.endpointFor("api",this.si),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}Ci(e){var t;this.Rt.triggerStatus(this.sessionId)===ee&&((t=this._instance)==null||(t=t.persistence)==null||t.register({[e==="url"?_i:mi]:this.kt}),this.Zt(),this.pi(e+"_trigger_matched"))}Ti(){this.Ut.urlBlocked||(this.Ut.urlBlocked=!0,clearInterval(this.vi),X.info("recording paused due to URL blocker"),this.ii("recording paused",{reason:"url blocker"}))}Mi(){this.Ut.urlBlocked&&(this.Ut.urlBlocked=!1,this.ki(),this.Si(),this.ii("recording resumed",{reason:"left blocked url"}),X.info("recording resumed"))}hi(){this.qt.St.length!==0&&O(this.Xt)&&(this.Xt=this._instance.on("eventCaptured",e=>{try{this.qt.St.includes(e.event)&&this.Ci("event")}catch(t){X.error("Could not activate event trigger",t)}}))}overrideLinkedFlag(){this.Bt.linkedFlagSeen=!0,this.ki(),this.pi("linked_flag_overridden")}overrideSampling(){var e;(e=this._instance.persistence)==null||e.register({[Ut]:!0}),this.ki(),this.pi("sampling_overridden")}overrideTrigger(e){this.Ci(e)}pi(e,t){this._instance.register_for_session({$session_recording_start_reason:e}),X.info(e.replace("_"," "),t),M(["recording_initialized","session_id_changed"],e)||this.ii(e,t)}get sdkDebugProperties(){var{sessionStartTimestamp:e}=this.It.checkAndGetSessionAndWindowId(!0);return{$recording_status:this.status,$sdk_debug_replay_internal_buffer_length:this.M.data.length,$sdk_debug_replay_internal_buffer_size:this.M.size,$sdk_debug_current_session_duration:this.Mt,$sdk_debug_session_start:e}}}var ti=Q("[SegmentIntegration]");function Sc(r,e){var t=r.config.segment;if(!t)return e();(function(i,s){var n=i.config.segment;if(!n)return s();var a=l=>{var u=()=>l.anonymousId()||et();i.config.get_device_id=u,l.id()&&(i.register({distinct_id:l.id(),$device_id:u()}),i.persistence.set_property(Ne,"identified")),s()},o=n.user();"then"in o&&_e(o.then)?o.then(l=>a(l)):a(o)})(r,()=>{t.register((i=>{Promise&&Promise.resolve||ti.warn("This browser does not have Promise support, and can not use the segment integration");var s=(n,a)=>{if(!a)return n;n.event.userId||n.event.anonymousId===i.get_distinct_id()||(ti.info("No userId set, resetting PostHog"),i.reset()),n.event.userId&&n.event.userId!==i.get_distinct_id()&&(ti.info("UserId set, identifying with PostHog"),i.identify(n.event.userId));var o=i.calculateEventProperties(a,n.event.properties);return n.event.properties=Object.assign({},o,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:n=>s(n,n.event.event),page:n=>s(n,"$pageview"),identify:n=>s(n,"$identify"),screen:n=>s(n,"$screen")}})(r)).then(()=>{e()})})}var Qa="posthog-js";function Xa(r,e){var{organization:t,projectId:i,prefix:s,severityAllowList:n=["error"]}=e===void 0?{}:e;return a=>{var o,l,u,c,p;if(!(n==="*"||n.includes(a.level))||!r.__loaded)return a;a.tags||(a.tags={});var d=r.requestRouter.endpointFor("ui","/project/"+r.config.token+"/person/"+r.get_distinct_id());a.tags["PostHog Person URL"]=d,r.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=r.get_session_replay_url({withTimestamp:!0}));var f=((o=a.exception)==null?void 0:o.values)||[],h=f.map(_=>w({},_,{stacktrace:_.stacktrace?w({},_.stacktrace,{type:"raw",frames:(_.stacktrace.frames||[]).map(y=>w({},y,{platform:"web:javascript"}))}):void 0})),g={$exception_message:((l=f[0])==null?void 0:l.value)||a.message,$exception_type:(u=f[0])==null?void 0:u.type,$exception_personURL:d,$exception_level:a.level,$exception_list:h,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((c=f[0])==null?void 0:c.value)||a.message,$sentry_exception_type:(p=f[0])==null?void 0:p.type,$sentry_tags:a.tags};return t&&i&&(g.$sentry_url=(s||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+a.event_id),r.exceptions.sendExceptionEvent(g),a}}class xc{constructor(e,t,i,s,n){this.name=Qa,this.setupOnce=function(a){a(Xa(e,{organization:t,projectId:i,prefix:s,severityAllowList:n}))}}}var kc=v!=null&&v.location?Rr(v.location.hash,"__posthog")||Rr(location.hash,"state"):null,gn="_postHogToolbarParam
92s",vn=Q("[Toolbar]"),Qe=function(r){return r[r.UNINITIALIZED=0]="UNINITIALIZED",r[r.LOADING=1]="LOADING",r[r.LOADED=2]="LOADED",r}(Qe||{});class Cc{constructor(e){this.instance=e}Di(e){P.ph_toolbar_state=e}Li(){var e;return(e=P.ph_toolbar_state)!==null&&e!==void 0?e:Qe.UNINITIALIZED}maybeLoadToolbar(e,t,i){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),i===void 0&&(i=void 0),!v||!E)return!1;e=e??v.location,i=i??v.history;try{if(!t){try{v.localStorage.setItem("test","test"),v.localStorage.removeItem("test")}catch{return!1}t=v==null?void 0:v.localStorage}var s,n=kc||Rr(e.hash,"__posthog")||Rr(e.hash,"state"),a=n?As(()=>JSON.parse(atob(decodeURIComponent(n))))||As(()=>JSON.parse(decodeURIComponent(n))):null;return a&&a.action==="ph_authorize"?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(gn)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}Ni(e){var t=P.ph_load_toolbar||P.ph_load_editor;!O(t)&&_e(t)?t(e,this.instance):vn.warn("No toolbar load function found")}loadToolbar(e){var t=!(E==null||!E.getElementById(Sa));if(!v||t)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=w({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(v.localStorage.setItem(gn,JSON.stringify(w({},s,{source:void 0}))),this.Li()===Qe.LOADED)this.Ni(s);else if(this.Li()===Qe.UNINITIALIZED){var n;this.Di(Qe.LOADING),(n=P.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"toolbar",a=>{if(a)return vn.error("[Toolbar] Failed to load",a),void this.Di(Qe.UNINITIALIZED);this.Di(Qe.LOADED),this.Ni(s)}),j(v,"turbolinks:load",()=>{this.Di(Qe.UNINITIALIZED),this.loadToolbar(s)})}return!0}ji(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var Ic=Q("[TracingHeaders]");class Rc{constructor(e){this.zi=void 0,this.Ui=void 0,this.V=()=>{var t,i;b(this.zi)&&((t=P.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.sessionManager)),b(this.Ui)&&((i=P.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.sessionManager))},this._instance=e}G(e){var t,i;(t=P.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(i=P.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",s=>{if(s)return Ic.error("failed to load script",s);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.G(this.V):((e=this.zi)==null||e.call(this),(t=this.Ui)==null||t.call(this),this.zi=void 0,this.Ui=void 0)}}var Ke=Q("[Web Vitals]"),_n=9e5;class Pc{constructor(e){var t;this.qi=!1,this.i=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Bi=()=>{clearTimeout(this.Hi),this.M.metrics.length!==0&&(this._instance.capture("$web_vitals",this.M.metrics.reduce((i,s)=>w({},i,{["$web_vitals_"+s.name+"_event"]:w({},s),["$web_vitals_"+s.name+"_value"]:s.value}),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Wi=i=>{var s,n=(s=this._instance.sessionManager)==null?void 0:s.checkAndGetSessionAndWindowId(!0);if(b(n))Ke.error("Could not read session ID. Dropping metrics!");else{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Gi();b(a)||(O(i==null?void 0:i.name)||O(i==null?void 0:i.value)?Ke.error("Invalid metric received",i):this.Ji&&i.value>=this.Ji?Ke.error("Ignoring metric with value >= "+this.Ji,i):(this.M.url!==a&&(this.Bi(),this.Hi=setTimeout(this.Bi,this.flushToCaptureTimeoutMs)),b(this.M.url)&&(this.M.url=a),this.M.firstMetricTimestamp=b(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.M.metrics.push(w({},i,{$current_url:a,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),this.M.metrics.length===this.allowedMetrics.length&&this.Bi()))}},this.V=()=>{var i,s,n,a,o=P.__PosthogExtensions__;b(o)||b(o.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:s,onFCP:n,onINP:a}=o.postHogWebVitalsCallbacks),i&&s&&n&&a?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Wi.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&s(this.Wi.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this.Wi.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Wi.bind(this)),this.i=!0):Ke.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.qi=!((t=this._instance.persistence)==null||!t.props[Ds]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=B(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return b(i)?((t=this._instance.persistence)==null?void 0:t.props[js])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(B(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Ji(){var e=B(this._instance.config.capture_performance)&&Z(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:_n;return 0<e&&e<=6e4?_n:e}get isEnabled(){var e=ne==null?void 0:ne.protocol;if(e!=="http:"&&e!=="https:")return Ke.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=B(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Me(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Me(t)?t:this.qi}startIfEnabled(){this.isEnabled&&!this.i&&(Ke.info("enabled, starting..."),this.G(this.V))}onRemoteConfig(e){var t=B(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=B(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ds]:t}),this._instance.persistence.register({[js]:i})),this.qi=t,this.startIfEnabled()}G(e){var t,i;(t=P.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks&&e(),(i=P.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",s=>{s?Ke.error("failed to load script",s):e()})}Gi(){var e=v?v.location.href:void 0;return e||Ke.error("Could not determine current URL"),e}}var Mc=Q("[Heatmaps]");function mn(r){return B(r)&&"clientX"in r&&"clientY"in r&&Z(r.clientX)&&Z(r.clientY)}class Fc{constructor(e){var t;this.rageclicks=new Ta,this.qi=!1,this.i=!1,this.Vi=null,this.instance=e,this.qi=!((t=this.instance.persistence)==null||!t.props[fi])}get flushIntervalMilliseconds(){var e=5e3;return B(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return b(this.instance.config.capture_heatmaps)?b(this.instance.config.enable_heatmaps)?this.qi:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.i)return;Mc.info("starting..."),this.Ki(),this.Vi=setInterval(this.Yi.bind(this),this.flushIntervalMilliseconds)}else{var e,t;
92clearInterval((e=this.Vi)!==null&&e!==void 0?e:void 0),(t=this.Xi)==null||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[fi]:t}),this.qi=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.M;return this.M=void 0,e}Qi(e){this.Zi(e.originalEvent,"deadclick")}Ki(){v&&E&&(j(v,"beforeunload",this.Yi.bind(this)),j(E,"click",e=>this.Zi(e||(v==null?void 0:v.event)),{capture:!0}),j(E,"mousemove",e=>this.te(e||(v==null?void 0:v.event)),{capture:!0}),this.Xi=new La(this.instance,Au,this.Qi.bind(this)),this.Xi.startIfEnabled(),this.i=!0)}ie(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(o,l,u){for(var c=o;c&&Dr(c)&&!rt(c,"body");){if(c===u)return!1;if(M(l,v==null?void 0:v.getComputedStyle(c).position))return!0;c=Ra(c)}return!1}(Ia(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:i),target_fixed:a,type:t}}Zi(e,t){var i;if(t===void 0&&(t="click"),!Ks(e.target)&&mn(e)){var s=this.ie(e,t);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.ee(w({},s,{type:"rageclick"})),this.ee(s)}}te(e){!Ks(e.target)&&mn(e)&&(clearTimeout(this.re),this.re=setTimeout(()=>{this.ee(this.ie(e,"mousemove"))},500))}ee(e){if(v){var t=v.location.href;this.M=this.M||{},this.M[t]||(this.M[t]=[]),this.M[t].push(e)}}Yi(){this.M&&!Et(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class Oc{constructor(e){this._instance=e}doPageView(e,t){var i,s=this.se(e,t);return this.ne={pathname:(i=v==null?void 0:v.location.pathname)!==null&&i!==void 0?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.se(e,(t=this.ne)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.ne)==null?void 0:e.pageViewId}}se(e,t){var i=this.ne;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:l,maxContentHeight:u,lastContentY:c,maxContentY:p}=n;if(!(b(a)||b(o)||b(l)||b(u)||b(c)||b(p))){a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),p=Math.ceil(p);var d=a<=1?1:ve(o/a,0,1),f=a<=1?1:ve(l/a,0,1),h=u<=1?1:ve(c/u,0,1),g=u<=1?1:ve(p/u,0,1);s=U(s,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:f,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:h,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:g})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var $c=function(r){var e,t,i,s,n="";for(e=t=0,i=(r=(r+"").replace(/\r\n/g,`
93`).replace(/\r/g,`
94`)).length,s=0;s<i;s++){var a=r.charCodeAt(s),o=null;a<128?t++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),st(o)||(t>e&&(n+=r.substring(e,t)),n+=o,e=t=s+1)}return t>e&&(n+=r.substring(e,r.length)),n},Tc=!!di||!!ci,yn="text/plain",$r=(r,e)=>{var[t,i]=r.split("?"),s=w({},e);i==null||i.split("&").forEach(a=>{var[o]=a.split("=");delete s[o]});var n=Eu(s);return t+"?"+(n=n?(i?i+"&":"")+n:i)},Gt=(r,e)=>JSON.stringify(r,(t,i)=>typeof i=="bigint"?i.toString():i,e),ri=r=>{var{data:e,compression:t}=r;if(e){if(t===Be.GZipJS){var i=Ga(Va(Gt(e)),{mtime:0}),s=new Blob([i],{type:yn});return{contentType:yn,body:s,estimatedSize:s.size}}if(t===Be.Base64){var n=function(l){var u,c,p,d,f,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",g=0,_=0,y="",x=[];if(!l)return l;l=$c(l);do u=(f=l.charCodeAt(g++)<<16|l.charCodeAt(g++)<<8|l.charCodeAt(g++))>>18&63,c=f>>12&63,p=f>>6&63,d=63&f,x[_++]=h.charAt(u)+h.charAt(c)+h.charAt(p)+h.charAt(d);while(g<l.length);switch(y=x.join(""),l.length%3){case 1:y=y.slice(0,-2)+"==";break;case 2:y=y.slice(0,-1)+"="}return y}(Gt(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Gt(l)))(n);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var o=Gt(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Xt=[];ci&&Xt.push({transport:"fetch",method:r=>{var e,t,{contentType:i,body:s,estimatedSize:n}=(e=ri(r))!==null&&e!==void 0?e:{},a=new Headers;$(r.headers,function(c,p){a.append(p,c)}),i&&a.append("Content-Type",i);var o=r.url,l=null;if($s){var u=new $s;l={signal:u.signal,timeout:setTimeout(()=>u.abort(),r.timeout)}}ci(o,w({method:(r==null?void 0:r.method)||"GET",headers:a,keepalive:r.method==="POST"&&(n||0)<52428.8,body:s,signal:(t=l)==null?void 0:t.signal},r.fetchOptions)).then(c=>c.text().then(p=>{var d={statusCode:c.status,text:p};if(c.status===200)try{d.json=JSON.parse(p)}catch(f){S.error(f)}r.callback==null||r.callback(d)})).catch(c=>{S.error(c),r.callback==null||r.callback({statusCode:0,text:c})}).finally(()=>l?clearTimeout(l.timeout):null)}}
vendor: 4,284 bytes, line 94
94),di&&Xt.push({transport:"XHR",method:r=>{var e,t=new di;t.open(r.method||"GET",r.url,!0);var{contentType:i,body:s}=(e=ri(r))!==null&&e!==void 0?e:{};$(r.headers,function(n,a){t.setRequestHeader(a,n)}),i&&t.setRequestHeader("Content-Type",i),r.timeout&&(t.timeout=r.timeout),t.withCredentials=!0,t.onreadystatechange=()=>{if(t.readyState===4){var n={statusCode:t.status,text:t.responseText};if(t.status===200)try{n.json=JSON.parse(t.responseText)}catch{}r.callback==null||r.callback(n)}},t.send(s)}}),he!=null&&he.sendBeacon&&Xt.push({transport:"sendBeacon",method:r=>{var e=$r(r.url,{beacon:"1"});try{var t,{contentType:i,body:s}=(t=ri(r))!==null&&t!==void 0?t:{},n=typeof s=="string"?new Blob([s],{type:i}):s;he.sendBeacon(e,n)}catch{}}});var At=function(r,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(r)}catch{return!1}};function bn(r,e,t){return Gt({distinct_id:r,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var Ac={exact:(r,e)=>e.some(t=>r.some(i=>t===i)),is_not:(r,e)=>e.every(t=>r.every(i=>t!==i)),regex:(r,e)=>e.some(t=>r.some(i=>At(t,i))),not_regex:(r,e)=>e.every(t=>r.every(i=>!At(t,i))),icontains:(r,e)=>e.map(gr).some(t=>r.map(gr).some(i=>t.includes(i))),not_icontains:(r,e)=>e.map(gr).every(t=>r.map(gr).every(i=>!t.includes(i)))},gr=r=>r.toLowerCase(),Lc=Q("[Error tracking]");class Nc{constructor(e){var t,i;this.oe=[],this._instance=e,this.oe=(t=(i=this._instance.persistence)==null?void 0:i.get_property(gi))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,i,s=(t=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&t!==void 0?t:[];this.oe=s,this._instance.persistence&&this._instance.persistence.register({[gi]:this.oe})}sendExceptionEvent(e){this.ae(e)?Lc.info("Skipping exception capture because a suppression rule matched"):this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}ae(e){var t=e.$exception_list;if(!t||!D(t)||t.length===0)return!1;var i=t.reduce((s,n)=>{var{type:a,value:o}=n;return H(a)&&a.length>0&&s.$exception_types.push(a),H(o)&&o.length>0&&s.$exception_values.push(o),s},{$exception_types:[],$exception_values:[]});return this.oe.some(s=>{var n=s.values.map(a=>{var o,l=Ac[a.operator],u=D(a.value)?a.value:[a.value],c=(o=i[a.key])!==null&&o!==void 0?o:[];return u.length>0&&l(u,c)});return s.type==="OR"?n.some(Boolean):n.every(Boolean)})}}var ye="Mobile",Tr="iOS",Fe="Android",er="Tablet",Ja=Fe+" "+er,Za="iPad",eo="Apple",to=eo+" Watch",tr="Safari",Lt="BlackBerry",ro="Samsung",io=ro+"Browser",so=ro+" Internet",ft="Chrome",Dc=ft+" OS",no=ft+" "+Tr,is="Internet Explorer",ao=is+" "+ye,ss="Opera",jc=ss+" Mini",ns="Edge",oo="Microsoft "+ns,Ct="Firefox",lo=Ct+" "+Tr,rr="Nintendo",ir="PlayStation",It="Xbox",uo=Fe+" "+ye,co=ye+" "+tr,Vt="Windows",Ti=Vt+" Phone",wn="Nokia",Ai="Ouya",ho="Generic",qc=ho+" "+ye.toLowerCase(),po=ho+" "+er.toLowerCase(),Li="Konqueror",re="(\\d+(\\.\\d+)?)",ii=new RegExp("Version/"+re),Bc=new RegExp(It,"i"),Hc=new RegExp(ir+" \\w+","i"),Uc=new RegExp(rr+" \\w+","i"),as=new RegExp(Lt+"|PlayBook|BB10","i"),zc={"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"},Wc=(r,e)=>e&&M(e,eo)||function(t){return M(t,tr)&&!M(t,ft)&&!M(t,Fe)}(r),fo=function(r,e){return e=e||"",M(r," OPR/")&&M(r,"Mini")?jc:M(r," OPR/")?ss:as.test(r)?Lt:M(r,"IE"+ye)||M(r,"WPDesktop")?ao:M(r,io)?so:M(r,ns)||M(r,"Edg/")?oo:M(r,"FBIOS")?"Facebook "+ye:M(r,"UCWEB")||M(r,"UCBrowser")?"UC Browser":M(r,"CriOS")?no:M(r,"CrMo")||M(r,ft)?ft:M(r,Fe)&&M(r,tr)?uo:M(r,"FxiOS")?lo:M(r.toLowerCase(),Li.toLowerCase())?Li:Wc(r,e)?M(r,ye)?co:tr:M(r,Ct)?Ct:M(r,"MSIE")||M(r,"Trident/")?is:M(r,"Gecko")?Ct:""},Gc={[ao]:[new RegExp("rv:"+re)],[oo]:[new RegExp(ns+"?\\/"+re)],[ft]:[new RegExp("("+ft+"|CrMo)\\/"+re)],[no]:[new RegExp("CriOS\\/"+re)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+re)],[tr]:[ii],[co]:[ii],[ss]:[new RegExp("(Opera|OPR)\\/"+re)],[Ct]:[new RegExp(Ct+"\\/"+re)],[lo]:[new RegExp("FxiOS\\/"+re)],[Li]:[new RegExp("Konqueror[:/]?"+re,"i")],[Lt]:[new RegExp(Lt+" "+re),ii],[uo]:[new RegExp("android\\s"+re,"i")],[so]:[new RegExp(io+"\\/"+re)],[is]:[new RegExp("(rv:|MSIE )"+re)],Mozilla:[new RegExp("rv:"+re)]},Vc=function(r,e){var t=fo(r,e),i=Gc[t];
94if(b(i))return null;for(var s=0;s<i.length;s++){var n=i[s],a=r.match(n);if(a)return parseFloat(a[a.length-2])}return null},En=[[new RegExp(It+"; "+It+" (.*?)[);]","i"),r=>[It,r&&r[1]||""]],[new RegExp(rr,"i"),[rr,""]],[new RegExp(ir,"i"),[ir,""]],[as,[Lt,""]],[new RegExp(Vt,"i"),(r,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Ti,""];if(new RegExp(ye).test(e)&&!/IEMobile\b/.test(e))return[Vt+" "+ye,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],s=zc[i]||"";return/arm/i.test(e)&&(s="RT"),[Vt,s]}return[Vt,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,r=>{if(r&&r[3]){var e=[r[3],r[4],r[5]||"0"];return[Tr,e.join(".")]}return[Tr,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,r=>{var e="";return r&&r.length>=3&&(e=b(r[2])?r[3]:r[2]),["watchOS",e]}],[new RegExp("("+Fe+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Fe+")","i"),r=>{if(r&&r[2]){var e=[r[2],r[3],r[4]||"0"];return[Fe,e.join(".")]}return[Fe,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,r=>{var e=["Mac OS X",""];if(r&&r[1]){var t=[r[1],r[2],r[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Dc,""]],[/Linux|debian/i,["Linux",""]]],Sn=function(r){return Uc.test(r)?rr:Hc.test(r)?ir:Bc.test(r)?It:new RegExp(Ai,"i").test(r)?Ai:new RegExp("("+Ti+"|WPDesktop)","i").test(r)?Ti:/iPad/.test(r)?Za:/iPod/.test(r)?"iPod Touch":/iPhone/.test(r)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(r)?to:as.test(r)?Lt:/(kobo)\s(ereader|touch)/i.test(r)?"Kobo":new RegExp(wn,"i").test(r)?wn:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(r)||/(kf[a-z]+)( bui|\)).+silk\//i.test(r)?"Kindle Fire":/(Android|ZTE)/i.test(r)?!new RegExp(ye).test(r)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(r)?/pixel[\daxl ]{1,6}/i.test(r)&&!/pixel c/i.test(r)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(r)||/lmy47v/i.test(r)&&!/QTAQZ3/i.test(r)?Fe:Ja:Fe:new RegExp("(pda|"+ye+")","i").test(r)?qc:new RegExp(er,"i").test(r)&&!new RegExp(er+" pc","i").test(r)?po:""},vr="https?://(.*)",qr=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Kc=Nr(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],qr),os="<masked>";function go(r,e,t){if(!E)return{};var i=e?Nr([],qr,t||[]):[];return vo(Qi(E.URL,i,os),r)}function vo(r,e){var t=Kc.concat(e||[]),i={};return $(t,function(s){var n=Ir(r,s);i[s]=n||null}),i}function _o(r){var e=function(n){return n?n.search(vr+"google.([^/?]*)")===0?"google":n.search(vr+"bing.com")===0?"bing":n.search(vr+"yahoo.com")===0?"yahoo":n.search(vr+"duckduckgo.com")===0?"duckduckgo":null:null}(r),t=e!="yahoo"?"q":"p",i={};if(!st(e)){i.$search_engine=e;var s=E?Ir(E.referrer,t):"";s.length&&(i.ph_keyword=s)}return i}function xn(){return navigator.language||navigator.userLanguage}function mo(){return(E==null?void 0:E.referrer)||"$direct"}function yo(r,e){var t=r?Nr([],qr,e||[]):[],i=ne==null?void 0:ne.href.substring(0,1e3);return{r:mo().substring(0,1e3),u:i?Qi(i,t,os):void 0}}function bo(r){var e,{r:t,u:i}=r,s={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=$t(t))==null?void 0:e.host};if(i){s.$current_url=i;var n=$t(i);s.$host=n==null?void 0:n.host,s.$pathname=n==null?void 0:n.pathname;var a=vo(i);U(s,a)}if(t){var o=_o(t);U(s,o)}return s}function wo(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function Yc(){try{return new Date().getTimezoneOffset()}catch{return}}function Qc(r,e){if(!se)return{};var t,i,s,n=r?Nr([],qr,e||[]):[],[a,o]=function(l){for(var u=0;u<En.length;u++){var[c,p]=En[u],d=c.exec(l),f=d&&(_e(p)?p(d,l):p);if(f)return f}return["",""]}(se);return U(Ki({$os:a,$os_version:o,$browser:fo(se,navigator.vendor),$device:Sn(se),$device_type:(i=se,s=Sn(i),s===Za||s===Ja||s==="Kobo"||s==="Kindle Fire"||s===po?er:s===rr||s===It||s===ir||s===Ai?"Console":s===to?"Wearable":s?ye:"Desktop"),$timezone:wo(),$timezone_offset:Yc()}),{$current_url:Qi(ne==null?void 0:ne.href,n,os),$host:ne==null?void 0:ne.host,$pathname:ne==null?void 0:ne.pathname,$raw_user_agent:se.length>1e3?se.substring(0,997)+"...":se,$browser_version:Vc(se,navigator.vendor),$browser_language:xn(),$browser_language_prefix:(t=xn(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:v==null?void 0:v.screen.height,$screen_width:v==null?void 0:v.screen.width,$viewport_height:v==null?void 0:v.innerHe
94ight,$viewport_width:v==null?void 0:v.innerWidth,$lib:"web",$lib_version:je.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Ie=Q("[FeatureFlags]"),si="$active_feature_flags",yt="$override_feature_flags",kn="$feature_flag_payloads",qt="$override_feature_flag_payloads",Cn="$feature_flag_request_id",In=r=>{var e={};for(var[t,i]of mr(r||{}))i&&(e[t]=i);return e},Xc=r=>{var e=r.flags;return e?(r.featureFlags=Object.fromEntries(Object.keys(e).map(t=>{var i;return[t,(i=e[t].variant)!==null&&i!==void 0?i:e[t].enabled]})),r.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(t=>e[t].enabled).filter(t=>{var i;return(i=e[t].metadata)==null?void 0:i.payload}).map(t=>{var i;return[t,(i=e[t].metadata)==null?void 0:i.payload]}))):Ie.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),r},Jc=function(r){return r.FeatureFlags="feature_flags",r.Recordings="recordings",r}({});class Zc{constructor(e){this.le=!1,this.ue=!1,this.he=!1,this.de=!1,this.ve=!1,this.ce=!1,this.fe=!1,this._instance=e,this.featureFlagEventHandlers=[]}decide(){if(this._instance.config.__preview_remote_config)this.ce=!0;else{var e=!this.pe&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this._e({disableFlags:e})}}get hasLoadedFlags(){return this.ue}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(yi),t=this._instance.get_property(yt),i=this._instance.get_property(qt);if(!i&&!t)return e||{};var s=U({},e||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var a of n){var o,l,u=s[a],c=t==null?void 0:t[a],p=b(c)?(o=u==null?void 0:u.enabled)!==null&&o!==void 0&&o:!!c,d=b(c)?u.variant:typeof c=="string"?c:void 0,f=i==null?void 0:i[a],h=w({},u,{enabled:p,variant:p?d??(u==null?void 0:u.variant):void 0});p!==(u==null?void 0:u.enabled)&&(h.original_enabled=u==null?void 0:u.enabled),d!==(u==null?void 0:u.variant)&&(h.original_variant=u==null?void 0:u.variant),f&&(h.metadata=w({},u==null?void 0:u.metadata,{payload:f,original_payload:u==null||(l=u.metadata)==null?void 0:l.payload})),s[a]=h}return this.le||(Ie.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.le=!0),s}getFlagVariants(){var e=this._instance.get_property(St),t=this._instance.get_property(yt);if(!t)return e||{};for(var i=U({},e),s=Object.keys(t),n=0;n<s.length;n++)i[s[n]]=t[s[n]];return this.le||(Ie.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.le=!0),i}getFlagPayloads(){var e=this._instance.get_property(kn),t=this._instance.get_property(qt);if(!t)return e||{};for(var i=U({},e||{}),s=Object.keys(t),n=0;n<s.length;n++)i[s[n]]=t[s[n]];return this.le||(Ie.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.le=!0),i}reloadFeatureFlags(){this.de||this._instance.config.advanced_disable_feature_flags||this.pe||(this.pe=setTimeout(()=>{this._e()},5))}ge(){clearTimeout(this.pe),this.pe=void 0}ensureFlagsLoaded(){this.ue||this.he||this.pe||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.de=e}_e(e){var t;if(this.ge(),!this._instance.config.advanced_disable_decide)if(this.he)this.ve=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:w({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(zt)||{}),group_properties:this._instance.get_property(ct)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0);var s=this._instance.config.__preview_flags_v2&&this._instance.config.__preview_remote_config,n=s?"/flags/?v=2":"/decide/?v=4",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("api",n+a);s&&(i.timezone=wo()),this.he=!0,this._instance.me({method:"POST",url:o,data:i,compression:this._instance.config.disable_compression?void 0:Be.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var u,c,p=!0;if(l.statusCode===200&&(this.ve||(this.$anon_distinct_id=void 0),p=!1),this.he=!1,this.ce||(this.ce=!0,this._instance.be((c=l.json)!==null&&c!==void 0?c:{})),!i.disable_flags||this.ve)if(this.fe=!p,l.json&&(u=l.json.quotaLimited)!=null&&u.includes(Jc.FeatureFlags))Ie.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var d;
94i.disable_flags||this.receivedFeatureFlags((d=l.json)!==null&&d!==void 0?d:{},p),this.ve&&(this.ve=!1,this._e())}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),this.ue||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],s=""+i,n=this._instance.get_property(Cn)||void 0,a=this._instance.get_property(Sr)||{};if((t.send_event||!("send_event"in t))&&(!(e in a)||!a[e].includes(s))){var o,l,u,c,p,d,f,h,g;D(a[e])?a[e].push(s):a[e]=[s],(o=this._instance.persistence)==null||o.register({[Sr]:a});var _=this.getFeatureFlagDetails(e),y={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:n,$feature_flag_bootstrapped_response:((l=this._instance.config.bootstrap)==null||(l=l.featureFlags)==null?void 0:l[e])||null,$feature_flag_bootstrapped_payload:((u=this._instance.config.bootstrap)==null||(u=u.featureFlagPayloads)==null?void 0:u[e])||null,$used_bootstrap_value:!this.fe};b(_==null||(c=_.metadata)==null?void 0:c.version)||(y.$feature_flag_version=_.metadata.version);var x,I=(p=_==null||(d=_.reason)==null?void 0:d.description)!==null&&p!==void 0?p:_==null||(f=_.reason)==null?void 0:f.code;I&&(y.$feature_flag_reason=I),_!=null&&(h=_.metadata)!=null&&h.id&&(y.$feature_flag_id=_.metadata.id),b(_==null?void 0:_.original_variant)&&b(_==null?void 0:_.original_enabled)||(y.$feature_flag_original_response=b(_.original_variant)?_.original_enabled:_.original_variant),_!=null&&(g=_.metadata)!=null&&g.original_payload&&(y.$feature_flag_original_payload=_==null||(x=_.metadata)==null?void 0:x.original_payload),this._instance.capture("$feature_flag_called",y)}return i}Ie.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var i=this._instance.config.token;this._instance.me({method:"POST",url:this._instance.requestRouter.endpointFor("api","/decide/?v=4"),data:{distinct_id:this._instance.get_distinct_id(),token:i},compression:this._instance.config.disable_compression?void 0:Be.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:s=>{var n,a=(n=s.json)==null?void 0:n.featureFlagPayloads;t((a==null?void 0:a[e])||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this.ue||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);Ie.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.ue=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),n=this.getFlagsWithDetails();(function(a,o,l,u,c){l===void 0&&(l={}),u===void 0&&(u={}),c===void 0&&(c={});var p=Xc(a),d=p.flags,f=p.featureFlags,h=p.featureFlagPayloads;if(f){var g=a.requestId;if(D(f)){Ie.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var _={};if(f)for(var y=0;y<f.length;y++)_[f[y]]=!0;o&&o.register({[si]:f,[St]:_})}else{var x=f,I=h,k=d;a.errorsWhileComputingFlags&&(x=w({},l,x),I=w({},u,I),k=w({},c,k)),o&&o.register(w({[si]:Object.keys(In(x)),[St]:x||{},[kn]:I||{},[yi]:k||{}},g?{[Cn]:g}:{}))}}})(e,this._instance.persistence,i,s,n),this.ye(t)}}override(e,t){t===void 0&&(t=!1),Ie.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Ie.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(yt),this._instance.persistence.unregister(qt),void this.ye();if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,i=e;if(this.le=!!((t=i.suppressWarning)!==null&&t!==void 0&&t),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(yt);else if(i.flags)if(D(i.flags)){for(var s={},n=0;n<i.flags.length;n++)s[i.flags[n]]=!0;this._instance.persistence.register({[yt]:s})}else this._instance.persistence.register({[yt]:i.flags})}return"payloads"in i&&(i.payloads===!1?this._instance.persistence.unregister(qt):i.payloads&&this._instance.persistence.register({[qt]:i.payloads})),void this.ye()}this.ye()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ue){var{flags:t,flagVariants:i}=this.we();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t){var i,s=(this._instance.get_property(yr)||[]).find(l=>l.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(a.$early_access_feature_name=s.name),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=w({},this.getFlagVariants(),{[e]:t});(i=this._instance.persistence)==null||i.register({[si]:Object.keys(In(o)),[St]:o}),this.ye()}getEarlyAccessFeatures(e,t,i){t===void 0&&(t=!1);var s=this._instance.get_property(yr),n=i?"&"+i.map(a=>"stage="+a).join("&"):"";if(s&&!t)return e(s);this._instance.me({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:a=>{var o;if(a.json){var l=a.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.register({[yr]:l}),e(l)}}})}we(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(i=>t[i]),flagVariants:Object.keys(t).filter(i=>t[i]).reduce((i,s)=>(i[s]=t[s],i),{})}}ye(e){var{flags:t,flagVariants:i}=this.we();
vendor: 5,355 bytes, line 94
94this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var i=this._instance.get_property(zt)||{};this._instance.register({[zt]:w({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(zt)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var i=this._instance.get_property(ct)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(s=>{i[s]=w({},i[s],e[s]),delete e[s]}),this._instance.register({[ct]:w({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(ct)||{};this._instance.register({[ct]:w({},t,{[e]:{}})})}else this._instance.unregister(ct)}}var ed=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class ni{constructor(e){this.S=e,this.props={},this.Se=!1,this.$e=(t=>{var i="";return t.token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"})(e),this.q=this.ke(e),this.load(),e.debug&&S.info("Persistence loaded",e.persistence,w({},this.props)),this.update_config(e,e),this.save()}ke(e){ed.indexOf(e.persistence.toLowerCase())===-1&&(S.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&G.O()?G:t==="localstorage+cookie"&&ur.O()?ur:t==="sessionstorage"&&Y.O()?Y:t==="memory"?$u:t==="cookie"?He:ur.O()?ur:He}properties(){var e={};return $(this.props,function(t,i){if(i===St&&B(t))for(var s=Object.keys(t),n=0;n<s.length;n++)e["$feature/"+s[n]]=t[s[n]];else o=i,l=!1,(st(a=pu)?l:Os&&a.indexOf===Os?a.indexOf(o)!=-1:($(a,function(u){if(l||(l=u===o))return wr}),l))||(e[i]=t);var a,o,l}),e}load(){if(!this.xe){var e=this.q.D(this.$e);e&&(this.props=U({},e))}}save(){this.xe||this.q.L(this.$e,this.props,this.Ee,this.Ie,this.Pe,this.S.debug)}remove(){this.q.N(this.$e,!1),this.q.N(this.$e,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(B(e)){b(t)&&(t="None"),this.Ee=b(i)?this.Re:i;var s=!1;if($(e,(n,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.props[a]=n,s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(B(e)){this.Ee=b(t)?this.Re:t;var i=!1;if($(e,(s,n)=>{e.hasOwnProperty(n)&&this.props[n]!==s&&(this.props[n]=s,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Se){var e=go(this.S.custom_campaign_params,this.S.mask_personal_data_properties,this.S.custom_personal_data_properties);Et(Ki(e))||this.register(e),this.Se=!0}}update_search_keyword(){var e;this.register((e=E==null?void 0:E.referrer)?_o(e):{})}update_referrer_info(){var e;this.register_once({$referrer:mo(),$referring_domain:E!=null&&E.referrer&&((e=$t(E.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Si]||this.props[xi]||this.register_once({[xr]:yo(this.S.mask_personal_data_properties,this.S.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};$([xi,Si],a=>{var o=this.props[a];o&&$(o,function(l,u){e["$initial_"+hi(u)]=l})});var t,i,s=this.props[xr];if(s){var n=(t=bo(s),i={},$(t,function(a,o){i["$initial_"+hi(o)]=a}),i);U(e,n)}return e}safe_merge(e){return $(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t){if(this.Re=this.Ee=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var i=this.ke(e),s=this.props;this.clear(),this.q=i,this.props=s,this.save()}}set_disabled(e){this.xe=e,this.xe?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ie&&(this.Ie=e,this.remove(),this.save())}set_secure(e){e!==this.Pe&&(this.Pe=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[Ht]||{};i[e]=t,this.props[Ht]=i,this.save()}remove_event_timer(e){var t=(this.props[Ht]||{})[e];return b(t)||(delete this.props[Ht][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}class Eo{constructor(){this.Te={},this.Te={}}on(e,t){return this.Te[e]||(this.Te[e]=[]),this.Te[e].push(t),()=>{this.Te[e]=this.Te[e].filter(i=>i!==t)}}emit(e,t){for(var i of this.Te[e]||[])i(t);for(var s of this.Te["*"]||[])s(e,t)}}class dt{constructor(e){this.Me=new Eo,this.Ce=(t,i)=>this.Oe(t,i)&&this.Fe(t,i)&&this.Ae(t,i),this.Oe=(t,i)=>i==null||!i.event||(t==null?void 0:t.event)===(i==null?void 0:i.event),this._instance=e,this.De=new Set,this.Le=new Set}init(){var e;if(!b((e=this._instance)==null?void 0:e.Ne)){var t;(t=this._instance)==null||t.Ne((i,s)=>{this.on(i,s)})}}register(e){var t,i;if(!b((t=this._instance)==null?void 0:t.Ne)&&(e.forEach(a=>{var o,l;(o=this.Le)==null||o.add(a),(l=a.steps)==null||l.forEach(u=>{var c;(c=this.De)==null||c.add((u==null?void 0:u.event)||"")})}),(i=this._instance)!=null&&i.autocapture)){var s,n=new Set;e.forEach(a=>{var o;(o=a.steps)==null||o.forEach(l=>{l!=null&&l.selector&&n.add(l==null?void 0:l.selector)})}),(s=this._instance)==null||s.autocapture.setElementSelectors(n)}}on(e,t){var i;t!=null&&e.length!=0&&(this.De.has(e)||this.De.has(t==null?void 0:t.event))&&this.Le&&((i=this.Le)==null?void 0:i.size)>0&&this.Le.forEach(s=>
94{this.je(t,s)&&this.Me.emit("actionCaptured",s.name)})}ze(e){this.onAction("actionCaptured",t=>e(t))}je(e,t){if((t==null?void 0:t.steps)==null)return!1;for(var i of t.steps)if(this.Ce(e,i))return!0;return!1}onAction(e,t){return this.Me.on(e,t)}Fe(e,t){if(t!=null&&t.url){var i,s=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!s||typeof s!="string"||!dt.Ue(s,t==null?void 0:t.url,(t==null?void 0:t.url_matching)||"contains"))return!1}return!0}static Ue(e,t,i){switch(i){case"regex":return!!v&&At(e,t);case"exact":return t===e;case"contains":var s=dt.qe(t).replace(/_/g,".").replace(/%/g,".*");return At(e,s);default:return!1}}static qe(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Ae(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.Be(e).some(n=>!(t!=null&&t.href&&!dt.Ue(n.href||"",t==null?void 0:t.href,(t==null?void 0:t.href_matching)||"exact"))&&(t==null||!t.tag_name||n.tag_name===(t==null?void 0:t.tag_name))&&!(t!=null&&t.text&&!dt.Ue(n.text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact")&&!dt.Ue(n.$el_text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact"))))return!1;if(t!=null&&t.selector){var i,s=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(!s||!s.includes(t==null?void 0:t.selector))return!1}return!0}Be(e){return(e==null?void 0:e.properties.$elements)==null?[]:e==null?void 0:e.properties.$elements}}var W=Q("[Surveys]"),Ni="seenSurvey_",td=(r,e)=>{var t="$survey_"+e+"/"+r.id;return r.current_iteration&&r.current_iteration>0&&(t="$survey_"+e+"/"+r.id+"/"+r.current_iteration),t};class rd{constructor(e){this._instance=e,this.He=new Map,this.We=new Map}register(e){var t;b((t=this._instance)==null?void 0:t.Ne)||(this.Ge(e),this.Je(e))}Je(e){var t=e.filter(i=>{var s,n;return((s=i.conditions)==null?void 0:s.actions)&&((n=i.conditions)==null||(n=n.actions)==null||(n=n.values)==null?void 0:n.length)>0});t.length!==0&&(this.Ve==null&&(this.Ve=new dt(this._instance),this.Ve.init(),this.Ve.ze(i=>{this.onAction(i)})),t.forEach(i=>{var s,n,a,o,l;i.conditions&&(s=i.conditions)!=null&&s.actions&&(n=i.conditions)!=null&&(n=n.actions)!=null&&n.values&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((o=this.Ve)==null||o.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(u=>{if(u&&u.name){var c=this.We.get(u.name);c&&c.push(i.id),this.We.set(u.name,c||[i.id])}}))}))}Ge(e){var t;e.filter(i=>{var s,n;return((s=i.conditions)==null?void 0:s.events)&&((n=i.conditions)==null||(n=n.events)==null||(n=n.values)==null?void 0:n.length)>0}).length!==0&&((t=this._instance)==null||t.Ne((i,s)=>{this.onEvent(i,s)}),e.forEach(i=>{var s;(s=i.conditions)==null||(s=s.events)==null||(s=s.values)==null||s.forEach(n=>{if(n&&n.name){var a=this.He.get(n.name);a&&a.push(i.id),this.He.set(n.name,a||[i.id])}})}))}onEvent(e,t){var i,s=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[lr])||[];if(e==="survey shown"&&t&&s.length>0){var n;W.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:s});var a=t==null||(n=t.properties)==null?void 0:n.$survey_id;if(a){var o=s.indexOf(a);o>=0&&(s.splice(o,1),this.Ke(s))}}else this.He.has(e)&&(W.info("survey event matched, updating activated surveys",{event:e,surveys:this.He.get(e)}),this.Ke(s.concat(this.He.get(e)||[])))}onAction(e){var t,i=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[lr])||[];this.We.has(e)&&this.Ke(i.concat(this.We.get(e)||[]))}Ke(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[lr]:[...new Set(e)]})}getSurveys(){var e,t=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[lr];return t||[]}getEventToSurveys(){return this.He}Ye(){return this.Ve}}class id{constructor(e){this.Xe=null,this.Qe=!1,this.Ze=!1,this.tr=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){var t=e.surveys;if(O(t))return W.warn("Decide not loaded yet. Not loading surveys.");var i=D(t);this.ir=i?t.length>0:t,W.info("decide response received, hasSurveys: "+this.ir),this.ir&&this.loadIfEnabled()}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(i!=null&&i.startsWith(Ni)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(s=>localStorage.removeItem(s))}loadIfEnabled(){if(!this.Xe)if(this.Ze)W.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)W.info("Disabled. Not loading surveys.");else if(this.ir){var e=P==null?void 0:P.__PosthogExtensions__;if(e){this.Ze=!0;try{var t=e.generateSurveys;if(t)return void this.er(t);var i=e.loadExternalDependency;if(!i)return void this.rr("PostHog loadExternalDependency extension not found.");i(this._instance,"surveys",s=>{s||!e.generateSurveys?this.rr("Could not load surveys script",s):this.er(e.generateSurveys)})}catch(s){throw this.rr("Error initializing surveys",s),s}finally{this.Ze=!1}}else W.error("PostHog Extensions not found.")}else W.info("No surveys to load.")}er(e){this.Xe=e(this._instance),this._surveyEventReceiver=new rd(this._instance),W.info("Surveys loaded successfully"),this.sr({isLoaded:!0})}rr(e,t){W.error(e,t),this.sr({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.tr.push(e),this.Xe&&this.sr({isLoaded:!0}),()=>{this.tr=this.tr.filter(t=>t!==e)}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return W.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(bi);if(i&&!t)return e(i,{isLoaded:!0});if(this.Qe)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.Qe=!0,this._instance.me({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:s=>{var n;this.Qe=!1;var a=s.statusCode;if(a!==200||!s.json){var o="Surveys API could not be loaded, status: "+a;return W.error(o),e([],{isLoaded:!1,error:o})}var l,u=s.json.surveys||[],c=u.filter(p=>function(d){return!(!d.start_date||d.end_date)}
94(p)&&(function(d){var f;return!((f=d.conditions)==null||(f=f.events)==null||(f=f.values)==null||!f.length)}(p)||function(d){var f;return!((f=d.conditions)==null||(f=f.actions)==null||(f=f.values)==null||!f.length)}(p)));return c.length>0&&((l=this._surveyEventReceiver)==null||l.register(c)),(n=this._instance.persistence)==null||n.register({[bi]:u}),e(u,{isLoaded:!0})}})}catch(s){throw this.Qe=!1,s}}sr(e){for(var t of this.tr)try{e.isLoaded?this.getSurveys(t):t([],e)}catch(i){W.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!O(this.Xe))return this.Xe.getActiveMatchingSurveys(e,t);W.warn("init was not called")}nr(e){var t=null;return this.getSurveys(i=>{var s;t=(s=i.find(n=>n.id===e))!==null&&s!==void 0?s:null}),t}ar(e){if(O(this.Xe))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this.nr(e):e;return t?this.Xe.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(O(this.Xe))return W.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.ar(e);return{visible:t.eligible,disabledReason:t.reason}}
94canRenderSurveyAsync(e,t){return O(this.Xe)?(W.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(s=>{var n,a=(n=s.find(l=>l.id===e))!==null&&n!==void 0?n:null;if(a){var o=this.ar(a);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){if(O(this.Xe))W.warn("init was not called");else{var i=this.nr(e),s=E==null?void 0:E.querySelector(t);i?s?this.Xe.renderSurvey(i,s):W.warn("Survey element not found"):W.warn("Survey not found")}}}(function(r){return r.Button="button",r.Tab="tab",r.Selector="selector",r})({});(function(r){return r.TopLeft="top_left",r.TopRight="top_right",r.TopCenter="top_center",r.MiddleLeft="middle_left",r.MiddleRight="middle_right",r.MiddleCenter="middle_center",r.Left="left",r.Center="center",r.Right="right",r.NextToTrigger="next_to_trigger",r})({});(function(r){return r.Popover="popover",r.API="api",r.Widget="widget",r})({});(function(r){return r.Open="open",r.MultipleChoice="multiple_choice",r.SingleChoice="single_choice",r.Rating="rating",r.Link="link",r})({});(function(r){return r.NextQuestion="next_question",r.End="end",r.ResponseBased="response_based",r.SpecificQuestion="specific_question",r})({});(function(r){return r.Once="once",r.Recurring="recurring",r.Always="always",r})({});var ai=function(r){return r.SHOWN="survey shown",r.DISMISSED="survey dismissed",r.SENT="survey sent",r}({}),Rn=function(r){return r.SURVEY_ID="$survey_id",r.SURVEY_NAME="$survey_name",r.SURVEY_RESPONSE="$survey_response",r.SURVEY_ITERATION="$survey_iteration",r.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",r.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",r.SURVEY_SUBMISSION_ID="$survey_submission_id",r.SURVEY_QUESTIONS="$survey_questions",r.SURVEY_COMPLETED="$survey_completed",r}({}),Pn=Q("[RateLimiter]");class sd{constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=s=>{var n=s.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(a=>{Pn.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void Pn.warn('could not rate limit - continuing. Error: "'+(a==null?void 0:a.message)+'"',{text:n})}},this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)==null?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,i,s;e===void 0&&(e=!1);var n=new Date().getTime(),a=(t=(i=this.instance.persistence)==null?void 0:i.get_property(Ei))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:n};a.tokens+=(n-a.last)/1e3*this.captureEventsPerSecond,a.last=n,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var o=a.tokens<1;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(s=this.instance.persistence)==null||s.set_property(Ei,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var ut=Q("[RemoteConfig]");class nd{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=P._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}lr(e){var t,i;(t=P.__PosthogExtensions__)!=null&&t.loadExternalDependency?(i=P.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(ut.error("PostHog Extensions not found. Cannot load remote config."),e())}ur(e){this._instance.me({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 ut.info("Using preloaded remote config",this.remoteConfig),void this.be(this.remoteConfig);if(this._instance.config.advanced_disable_decide)return void ut.warn("Remote config is disabled. Falling back to local config.");this.lr(e=>{if(!e)return ut.info("No config found after loading remote JS config. Falling back to JSON."),void this.ur(t=>{this.be(t)});this.be(e)})}catch(e){ut.error("Error loading remote config",e)}}be(e){e?this._instance.config.__preview_remote_config?(this._instance.be(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):ut.info("__preview_remote_config is disabled. Logging config instead",e):ut.error("Failed to fetch remote config from PostHog.")}}var Di=3e3;class ad{constructor(e,t){this.hr=!0,this.dr=[],this.vr=ve((t==null?void 0:t.flush_interval_ms)||Di,250,5e3,"flush interval",Di),this.cr=e}enqueue(e){this.dr.push(e),this.pr||this._r()}unload(){this.gr();var e=this.dr.length>0?this.mr():{},t=Object.values(e);[...t.filter(i=>i.url.indexOf("/e")===0),...t.filter(i=>i.url.indexOf("/e")!==0)].map(i=>{this.cr(w({},i,{transport:"sendBeacon"}))})}enable(){this.hr=!1,this._r()}_r(){var e=this;this.hr||(this.pr=setTimeout(()=>{if(this.gr(),this.dr.length>0){var t=this.mr(),i=function(){var n=t[s],a=new Date().getTime();n.data&&D(n.data)&&$(n.data,o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp}),e.cr(n)};for(var s in t)i()}},this.vr))}gr(){clearTimeout(this.pr),this.pr=void 0}mr(){var e={};return $(this.dr,t=>{var i,s=t,n=(s?s.batchKey:null)||s.url;b(e[n])&&(e[n]=w({},s,{data:[]})),(i=e[n].data)==null||i.push(s.data)}),this.dr=[],e}}var od=["retriesPerformedSoFar"];class ld{constructor(e){this.br=!1,this.yr=3e3,this.dr=[],this._instance=e,this.dr=[],this.wr=!0,!b(v)&&"onLine"in v.navigator&&(this.wr=v.navigator.onLine,j(v,"online",()=>{this.wr=!0,this.Yi()}),j(v,"offline",()=>{this.wr=!1}))}get length(){return this.dr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=ya(e,od);Z(t)&&t>0&&(i.url=$r(i.url,{retry_count:t})),this._instance.me(w({},i,{callback:s=>{s.statusCode!==200&&(s.statusCode<400||s.statusCode>=500)&&(t??0)<10?this.Sr(w({retriesPerformedSoFar:t},i)):i.callback==null||i.callback(s)}}))}Sr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(a){var o=3e3*Math.pow(2,a),l=o/2,u=Math.min(18e5,o),c=(Math.random()-.5)*(u-l);return Math.ceil(u+c)}(t),s=Date.now()+i;this.dr.push({retryAt:s,requestOptions:e});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),S.warn(n),this.br||(this.br=!0,this.$r())}$r(){this.kr&&clearTimeout(this.kr),this.kr=setTimeout(()=>{this.wr&&this.dr.length>0&&this.Yi(),this.$r()},this.yr)}Yi(){var e=Date.now(),t=[],i=this.dr.filter(n=>n.retryAt<e||(t.push(n),!1));if(this.dr=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.kr&&(clearTimeout(this.kr),this.kr=void 0),this.dr))try{this._instance.me(w({},e,{transport:"sendBeacon"}))}catch(t){S.error(t)}this.dr=[]}}class ud{constructor(e){this.Er=()=>{var t,i,s,n;this.Ir||(this.Ir={});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.Ir.lastScrollY=Math.ceil(o),this.Ir.maxScrollY=Math.max(o,(t=this.Ir.maxScrollY)!==null&&t!==void 0?t:0),this.Ir.maxScrollHeight=Math.max(l,(i=this.Ir.maxScrollHeight)!==null&&i!==void 0?i:0),this.Ir.lastContentY=u,this.Ir.maxContentY=Math.max(u,(s=this.Ir.maxContentY)!==null&&s!==void 0?s:0),this.Ir.maxContentHeight=Math.max(c,(n=this.Ir.maxContentHeight)!==null&&n!==void 0?n:0)},this._instance=e}getContext(){return this.Ir}resetContext(){var e=this.Ir;return setTimeout(this.Er,0),e}startMeasuringScrollPosition(){j(v,"scroll",this.Er,{capture:!0}),j(v,"scrollend",this.Er,{capture:!0}),j(v,"resize",this.Er)}scrollElement(){if(!this._instance.config.scroll_root_selector)return v==null?void 0:v.document.documentElement;var e=D(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var i=v==null?void 0:v.document.querySelector(t);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return v&&(v.scrollY||v.pageYOffset||v.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return v&&(v.scrollX||v.pageXOffset||v.document.documentElement.scrollLeft)||0}}var cd=r=>yo(r==null?void 0:r.config.mask_personal_data_properties,r==null?void 0:r.config.custom_personal_data_properties);class dd{constructor(e,t,i,s){this.Pr=n=>{var a=this.Rr();if(!a||a.sessionId!==n){var o={sessionId:n,props:this.Tr(this._instance)};this.Mr.register({[wi]:o})}},this._instance=e,this.Cr=t,this.Mr=i,this.Tr=s||cd,this.Cr.onSessionId(this.Pr)}Rr(){return this.Mr.props[wi]}getSetOnceProps(){var e,t=(e=this.Rr())==null?void 0:e.props;return t?"r"in t?bo(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return $(Ki(this.getSetOnceProps()),(t,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+hi(i)]=t}),e}}var Mn=Q("[SessionId]");class hd{constructor(e,t,i){var s;if(this.Or=[],!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.__preview_experimental_cookieless_mode)throw new Error("SessionIdManager cannot be used with __preview_experimental_cookieless_mode");this.S=e.config,this.Mr=e.persistence,this.oi=void 0,this.kt=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Fr=t||et,this.Ar=i||et;var n=this.S.persistence_name||this.S.token,a=this.S.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*ve(a,60,36e3,"session_idle_timeout_seconds",1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Dr(),this.Lr="ph_"+n+"_window_id",this.Nr="ph_"+n+"_primary_window_exists",this.jr()){var o=Y.D(this.Lr),l=Y.D(this.Nr);o&&!l?this.oi=o:Y.N(this.Lr),Y.L(this.Nr,!0)}if((s=this.S.bootstrap)!=null&&s.sessionID)try{var u=(c=>{var p=c.replace(/-/g,"");if(p.length!==32)throw new Error("Not a valid UUID");if(p[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(p.substring(0,12),16)})(this.S.bootstrap.sessionID);this.zr(this.S.bootstrap.sessionID,new Date().getTime(),u)}catch(c){Mn.error("Invalid sessionID in bootstrap",c)}this.Ur()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return b(this.Or)&&(this.Or=[]),this.Or.push(e),this.kt&&e(this.kt,this.oi),()=>{this.Or=this.Or.filter(t=>t!==e)}}jr(){return this.S.persistence!=="memory"&&!this.Mr.xe&&Y.O()}qr(e){e!==this.oi&&(this.oi=e,this.jr()&&Y.L(this.Lr,e))}Br(){return this.oi?this.oi:this.jr()?Y.D(this.Lr):null}zr(e,t,i){e===this.kt&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.kt=e,this.Mr.register({[Er]:[t,e,i]}))}Hr(){if(this.kt&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.kt,this._sessionStartTimestamp];var e=this.Mr.props[Er];return D(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.zr(null,null,null)}Ur(){j(v,"beforeunload",()=>{this.jr()&&Y.N(this.Nr)},{capture:!1})}
94checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.S.__preview_experimental_cookieless_mode)throw new Error("checkAndGetSessionAndWindowId should not be called in __preview_experimental_cookieless_mode");var i=t||new Date().getTime(),[s,n,a]=this.Hr(),o=this.Br(),l=Z(a)&&a>0&&Math.abs(i-a)>864e5,u=!1,c=!n,p=!e&&Math.abs(i-s)>this.sessionTimeoutMs;c||p||l?(n=this.Fr(),o=this.Ar(),Mn.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:c,activityTimeout:p,sessionPastMaximumLength:l}}),a=i,u=!0):o||(o=this.Ar(),u=!0);var d=s===0||!e||l?i:s,f=a===0?new Date().getTime():a;return this.qr(o),this.zr(n,d,f),e||this.Dr(),u&&this.Or.forEach(h=>h(n,o,u?{noSessionId:c,activityTimeout:p,sessionPastMaximumLength:l}:void 0)),{sessionId:n,windowId:o,sessionStartTimestamp:f,changeReason:u?{noSessionId:c,activityTimeout:p,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:s}}Dr(){clearTimeout(this.Wr),this.Wr=setTimeout(()=>{this.resetSessionId()},1.1*this.sessionTimeoutMs)}}var pd=["$set_once","$set"],Ye=Q("[SiteApps]");class fd{constructor(e){this._instance=e,this.Gr=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Jr(e,t){if(t){var i=this.globalsForEvent(t);this.Gr.push(i),this.Gr.length>1e3&&(this.Gr=this.Gr.slice(10))}}get siteAppLoaders(){var e;return(e=P._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ne(this.Jr.bind(this));this.Vr=()=>{e(),this.Gr=[],this.Vr=void 0}}}globalsForEvent(e){var t,i,s,n,a,o,l;if(!e)throw new Error("Event payload is required");var u={},c=this._instance.get_property("$groups")||[],p=this._instance.get_property("$stored_group_properties")||{};for(var[d,f]of Object.entries(p))u[d]={id:c[d],type:d,properties:f};var{$set_once:h,$set:g}=e;return{event:w({},ya(e,pd),{properties:w({},e.properties,g?{$set:w({},(t=(i=e.properties)==null?void 0:i.$set)!==null&&t!==void 0?t:{},g)}:{},h?{$set_once:w({},(s=(n=e.properties)==null?void 0:n.$set_once)!==null&&s!==void 0?s:{},h)}:{}),elements_chain:(a=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:u}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var o;!t.errored&&this.Gr.length&&(Ye.info("Processing "+this.Gr.length+" events for site app with id "+e.id),this.Gr.forEach(l=>t.processEvent==null?void 0:t.processEvent(l)),t.processedBuffer=!0),Object.values(this.apps).every(l=>l.processedBuffer||l.errored)&&((o=this.Vr)==null||o.call(this))},s=!1,n=o=>{t.errored=!o,t.loaded=!0,Ye.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),s&&i()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:o=>{n(o)}});a&&(t.processEvent=a),s=!0}catch(o){Ye.error("Error while initializing PostHog app with config id "+e.id,o),n(!1)}if(s&&t.loaded)try{i()}catch(o){Ye.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}Kr(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}Yr(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(t)}catch(s){Ye.error("Error while processing event "+e.event+" for site app "+i.id,s)}}}onRemoteConfig(e){var t,i,s,n=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Kr(),void this._instance.on("eventCaptured",u=>this.Yr(u))):void Ye.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.Vr)==null||i.call(this),(s=e.siteApps)!=null&&s.length)if(this.isEnabled){var a=function(u){var c;P["__$$ph_site_app_"+u]=n._instance,(c=P.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(n._instance,l,p=>{if(p)return Ye.error("Error while initializing PostHog app with config id "+u,p)})};for(var{id:o,url:l}of e.siteApps)a(o)}else Ye.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var gd=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hub
94spot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","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"],Fn=function(r,e){if(!r)return!1;var t=r.toLowerCase();return gd.concat(e||[]).some(i=>{var s=i.toLowerCase();return t.indexOf(s)!==-1})},So=function(r,e){if(!r)return!1;var t=r.userAgent;if(t&&Fn(t,e))return!0;try{var i=r==null?void 0:r.userAgentData;if(i!=null&&i.brands&&i.brands.some(s=>Fn(s==null?void 0:s.brand,e)))return!0}catch{}return!!r.webdriver},Kt=function(r){return r.US="us",r.EU="eu",r.CUSTOM="custom",r}({}),On="i.posthog.com";class vd{constructor(e){this.Xr={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+On,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.Xr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Xr[this.apiHost]=Kt.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Xr[this.apiHost]=Kt.EU:this.Xr[this.apiHost]=Kt.CUSTOM),this.Xr[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(this.region===Kt.CUSTOM)return this.apiHost+t;var i=On+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var _d={icontains:(r,e)=>!!v&&e.href.toLowerCase().indexOf(r.toLowerCase())>-1,not_icontains:(r,e)=>!!v&&e.href.toLowerCase().indexOf(r.toLowerCase())===-1,regex:(r,e)=>!!v&&At(e.href,r),not_regex:(r,e)=>!!v&&!At(e.href,r),exact:(r,e)=>e.href===r,is_not:(r,e)=>e.href!==r};class J{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),t.getWebExperiments(s=>{J.Qr("retrieved web experiments from the server"),t.Zr=new Map,s.forEac
vendor: 2,274 bytes, line 94
94h(n=>{if(n.feature_flag_key){var a;t.Zr&&(J.Qr("setting flag key ",n.feature_flag_key," to web experiment ",n),(a=t.Zr)==null||a.set(n.feature_flag_key,n));var o=t._instance.getFeatureFlag(n.feature_flag_key);H(o)&&n.variants[o]&&t.ts(n.name,o,n.variants[o].transforms)}else if(n.variants)for(var l in n.variants){var u=n.variants[l];J.es(u)&&t.ts(n.name,l,u.transforms)}})},i)},this._instance=e,this._instance.onFeatureFlags(i=>{this.onFeatureFlags(i)})}onFeatureFlags(e){if(this._is_bot())J.Qr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(O(this.Zr))return this.Zr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();J.Qr("applying feature flags",e),e.forEach(t=>{var i;if(this.Zr&&(i=this.Zr)!=null&&i.has(t)){var s,n=this._instance.getFeatureFlag(t),a=(s=this.Zr)==null?void 0:s.get(t);n&&a!=null&&a.variants[n]&&this.ts(a.name,n,a.variants[n].transforms)}})}}previewWebExperiment(){var e=J.getWindowLocation();if(e!=null&&e.search){var t=Ir(e==null?void 0:e.search,"__experiment_id"),i=Ir(e==null?void 0:e.search,"__experiment_variant");t&&i&&(J.Qr("previewing web experiments "+t+" && "+i),this.getWebExperiments(s=>{this.rs(parseInt(t),i,s)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance.me({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:n=>{if(n.statusCode!==200||!n.json)return e([]);var a=n.json.experiments||[];return e(a)}})}rs(e,t,i){var s=i.filter(n=>n.id===e);s&&s.length>0&&(J.Qr("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.ts(s[0].name,t,s[0].variants[t].transforms))}static es(e){return!O(e.conditions)&&J.ss(e)&&J.ns(e)}static ss(e){var t;if(O(e.conditions)||O((t=e.conditions)==null?void 0:t.url))return!0;var i,s,n,a=J.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||_d[(s=(n=e.conditions)==null?void 0:n.urlMatchType)!==null&&s!==void 0?s:"icontains"](e.conditions.url,a))}
94static getWindowLocation(){return v==null?void 0:v.location}static ns(e){var t;if(O(e.conditions)||O((t=e.conditions)==null?void 0:t.utm))return!0;var i=go();if(i.utm_source){var s,n,a,o,l,u,c,p,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)==i.utm_campaign,f=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==i.utm_source,h=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==i.utm_medium,g=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_term||((p=e.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==i.utm_term;return d&&h&&g&&f}return!1}static Qr(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];S.info("[WebExperiments] "+e,i)}ts(e,t,i){this._is_bot()?J.Qr("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?i.forEach(s=>{if(s.selector){var n;J.Qr("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)})}}):J.Qr("Control variants leave the page unmodified.")}_is_bot(){return he&&this._instance?So(he,this._instance.config.custom_blocked_useragents):void 0}}var Jt={},ji=()=>{},wt="posthog",xo=!Tc&&(se==null?void 0:se.indexOf("MSIE"))===-1&&(se==null?void 0:se.indexOf("Mozilla"))===-1,$n=r=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:hu(E==null?void 0:E.location),persistence:"localStorage+cookie",persistence_name:"",loaded:ji,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:r!=="2025-05-24"||"history_change",capture_pageleave:"if_capture_pageview",defaults:r??"unset",debug:ne&&H(ne==null?void 0:ne.search)&&ne.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(v==null||(e=v.location)==null?void 0:e.protocol)==="https:",ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var i="Bad HTTP status: "+t.statusCode+" "+t.text;S.error(i)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Di},_onCapture:ji}},Tn=r=>{var e={};b(r.process_person)||(e.person_profiles=r.process_person),b(r.xhr_headers)||(e.request_headers=r.xhr_headers),b(r.cookie_name)||(e.persistence_name=r.cookie_name),b(r.disable_cookie)||(e.disable_persistence=r.disable_cookie),b(r.store_google)||(e.save_campaign_params=r.store_google),b(r.verbose)||(e.debug=r.verbose);var t=U({},e,r);return D(r.property_blacklist)&&(b(r.property_denylist)?t.property_denylist=r.property_blacklist:D(r.property_denylist)?t.property_denylist=[...r.property_blacklist,...r.property_denylist]:S.error("Invalid value for property_denylist config: "+r.property_denylist)),t};class md{constructor(){this.__forceAllowLocalhost=!1}get os(){return this.__forceAllowLocalhost}set os(e){S.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Br{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new md,this.ls=!1,this.version=je.LIB_VERSION,this.us=new Eo,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=$n(),this.SentryIntegration=xc,this.sentryIntegration=e=>function(t,i){var s=Xa(t,i);return{name:Qa,processEvent:n=>s(n)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.hs=!1,this.ds=null,this.vs=null,this.cs=null,this.featureFlags=new Zc(this),this.toolbar=ne
94w Cc(this),this.scrollManager=new ud(this),this.pageViewManager=new Oc(this),this.surveys=new id(this),this.experiments=new J(this),this.exceptions=new Nc(this),this.rateLimiter=new sd(this),this.requestRouter=new vd(this),this.consent=new Tu(this),this.people={set:(e,t,i)=>{var s=H(e)?{[e]:t}:e;this.setPersonProperties(s),i==null||i({})},set_once:(e,t,i)=>{var s=H(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),i==null||i({})}},this.on("eventCaptured",e=>S.info('send "'+(e==null?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==wt){var s,n=(s=Jt[i])!==null&&s!==void 0?s:new Br;return n._init(e,t,i),Jt[i]=n,Jt[wt][i]=n,n}return this._init(e,t,i)}_init(e,t,i){var s,n;if(t===void 0&&(t={}),b(e)||pi(e))return S.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 S.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},this.fs=[],t.person_profiles&&(this.vs=t.person_profiles),this.set_config(U({},$n(t.defaults),Tn(t),{name:i,token:e})),this.config.on_xhr_error&&S.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Be.GZipJS,this.persistence=new ni(this.config),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ni(w({},this.config,{persistence:"sessionStorage"}));var a=w({},this.persistence.props),o=w({},this.sessionPersistence.props);if(this.ps=new ad(y=>this._s(y),this.config.request_queue_config),this.gs=new ld(this),this.__request_queue=[],this.config.__preview_experimental_cookieless_mode||(this.sessionManager=new hd(this),this.sessionPropsManager=new dd(this,this.sessionManager,this.persistence)),new Rc(this).startIfEnabledOrStop(),this.siteApps=new fd(this),(s=this.siteApps)==null||s.init(),this.config.__preview_experimental_cookieless_mode||(this.sessionRecording=new Ec(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Cu(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new Fc(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new Pc(this),this.exceptionObserver=new Nu(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new La(this,Lu),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new Xu(this),this.historyAutocapture.startIfEnabled(),je.DEBUG=je.DEBUG||this.config.debug,je.DEBUG&&S.info("Starting in debug mode",{this:this,config:t,thisC:w({},this.config),p:a,s:o}),this.bs(),((n=t.bootstrap)==null?void 0:n.distinctID)!==void 0){var l,u,c=this.config.get_device_id(et()),p=(l=t.bootstrap)!=null&&l.isIdentifiedID?c:t.bootstrap.distinctID;this.persistence.set_property(Ne,(u=t.bootstrap)!=null&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:p})}if(this.ys()){var d,f,h=Object.keys(((d=t.bootstrap)==null?void 0:d.featureFlags)||{}).filter(y=>{var x;return!((x=t.bootstrap)==null||(x=x.featureFlags)==null||!x[y])}).reduce((y,x)=>{var I;return y[x]=((I=t.bootstrap)==null||(I=I.featureFlags)==null?void 0:I[x])||!1,y},{}),g=Object.keys(((f=t.bootstrap)==null?void 0:f.featureFlagPayloads)||{}).filter(y=>h[y]).reduce((y,x)=>{var I,k;return(I=t.bootstrap)!=null&&(I=I.featureFlagPayloads)!=null&&I[x]&&(y[x]=(k=t.bootstrap)==null||(k=k.featureFlagPayloads)==null?void 0:k[x]),y},{});this.featureFlags.receivedFeatureFlags({featureFlags:h,featureFlagPayloads:g})}if(this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Vs,$device_id:null},"");else if(!this.get_distinct_id()){var _=this.config.get_device_id(et());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(Ne,"anonymous")}return j(v,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Sc(this,()=>this.ws()):this.ws(),_e(this.config._onCapture)&&this.config._onCapture!==ji&&(S.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",y=>this.config._onCapture(y.event,y))),this}be(e){var t,i,s,n,a,o,l,u;if(!E||!E.body)return S.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.be(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=M(e.supportedCompression,Be.GZipJS)?Be.GZipJS:M(e.supportedCompression,Be.Base64)?Be.Base64:void 0),(t=e.anal
94ytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.vs?this.vs:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(s=this.sessionRecording)==null||s.onRemoteConfig(e),(n=this.autocapture)==null||n.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(o=this.webVitalsAutocapture)==null||o.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(u=this.deadClicksAutocapture)==null||u.onRemoteConfig(e)}ws(){try{this.config.loaded(this)}catch(e){S.critical("`loaded` function failed",e)}this.Ss(),this.config.capture_pageview&&setTimeout(()=>{this.consent.isOptedIn()&&this.$s()},1),new nd(this).load(),this.featureFlags.decide()}Ss(){var e;this.has_opted_out_capturing()||this.config.request_batching&&((e=this.ps)==null||e.enable())}_dom_loaded(){this.has_opted_out_capturing()||tt(this.__request_queue,e=>this._s(e)),this.__request_queue=[],this.Ss()}_handle_unload(){var e,t;this.config.request_batching?(this.ks()&&this.capture("$pageleave"),(e=this.ps)==null||e.unload(),(t=this.gs)==null||t.unload()):this.ks()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}me(e){this.__loaded&&(xo?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=$r(e.url,{ip:this.config.ip?1:0}),e.headers=w({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var i,s,n,a=w({},t);a.timeout=a.timeout||6e4,a.url=$r(a.url,{_:new Date().getTime().toString(),ver:je.LIB_VERSION,compression:a.compression});var o=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=(s=(n=ba(Xt,u=>u.transport===o))==null?void 0:n.method)!==null&&s!==void 0?s:Xt[0].method;if(!l)throw new Error("No available transport method");l(a)})(w({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((i=(s=this.config).on_request_error)==null||i.call(s,t)),e.callback==null||e.callback(t)}}))))}_s(e){this.gs?this.gs.retriableRequest(e):this.me(e)}_execute_array(e){var t,i=[],s=[],n=[];tt(e,o=>{o&&(t=o[0],D(t)?n.push(o):_e(o)?o.call(this):D(o)&&t==="alias"?i.push(o):D(o)&&t.indexOf("capture")!==-1&&_e(this[t])?n.push(o):s.push(o))});var a=function(o,l){tt(o,function(u){if(D(u[0])){var c=l;$(u,function(p){c=c[p[0]].apply(c,p.slice(1))})}else this[u[0]].apply(this,u.slice(1))},l)};a(i,this),a(s,this),a(n,this)}ys(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.ps){if(!this.consent.isOptedOut())if(!b(e)&&H(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var n=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(n==null||!n.isRateLimited){t!=null&&t.$current_url&&!H(t==null?void 0:t.$current_url)&&(S.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,o=(i==null?void 0:i.timestamp)||a,l=et(),u={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},o,l)};n&&(u.properties.$lib_rate_limit_remaining_tokens=n.remainingTokens),i!=null&&i.$set&&(u.$set=i==null?void 0:i.$set);var c,p,d=this.xs(i==null?void 0:i.$set_once);if(d&&(u.$set_once=d),(u=cu(u,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=o,b(i==null?void 0:i.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=a),e===ai.DISMISSED||e===ai.SENT){var f=t==null?void 0:t[Rn.SURVEY_ID],h=t==null?void 0:t[Rn.SURVEY_ITERATION];localStorage.setItem((p=""+Ni+(c={id:f,current_iteration:h}).id,c.current_iteration&&c.current_iteration>0&&(p=""+Ni+c.id+"_"+c.current_iteration),p),"true"),u.$set=w({},u.$set,{[td({id:f,current_iteration:h},e===ai.SENT?"responded":"dismissed")]:!0})}var g=w({},u.properties.$set,u.$set);if(Et(g)||this.setPersonPropertiesForFlags(g),!O(this.config.before_send)){var _=this.Es(u);if(!_)return;u=_}this.us.emit("eventCaptured",u);var y={method:"POST",url:(s=i==null?void 0:i._url)!==null&&s!==void 0?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:i==null?void 0:i._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this._s(y):this.ps.enqueue(y),u}S.critical("This capture call is ignored due to client rate limiting.")}}else S.error("No event name provided to posthog.capture")}else S.uninitializedWarning("posthog.capture")}Ne(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var a=n?void 0:this.persistence.remove_event_timer(e),o=w({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.config.__preview_experimental_cookieless_mode&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=w({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!H(o.distinct_id)&&!Z(o.distinct_id)||pi(o.distinct_id))&&S.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var u,c=Qc(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:p,windowId:d}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());o.$session_id=p,o.$window_id=d}this.sessionPropsManager&&U(o,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&U(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(f=this.gs
vendor: 5,078 bytes, line 94
94)==null?void 0:f.length}catch(y){o.$sdk_debug_error_capturing_properties=String(y)}if(this.requestRouter.region===Kt.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||n?e!=="$pageleave"||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),o=U(o,u),e==="$pageview"&&E&&(o.title=E.title),!b(a)){var h=i.getTime()-a;o.$duration=parseFloat((h/1e3).toFixed(3))}se&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=U({},c,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),D(this.config.property_denylist)?$(this.config.property_denylist,function(y){delete o[y]}):S.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(S.error("sanitize_properties is deprecated. Use before_send instead"),o=g(o,e));var _=this.Is();return o.$process_person_profile=_,_&&!n&&this.Ps("_calculate_event_properties"),o}xs(e){var t;if(!this.persistence||!this.Is()||this.ls)return e;var i=this.persistence.get_initial_props(),s=(t=this.sessionPropsManager)==null?void 0:t.getSetOnceProps(),n=U({},i,s||{},e||{}),a=this.config.sanitize_properties;return a&&(S.error("sanitize_properties is deprecated. Use before_send instead"),n=a(n,"$set_once")),this.ls=!0,Et(n)?void 0:n}register(e,t){var i;(i=this.persistence)==null||i.register(e,t)}register_once(e,t,i){var s;(s=this.persistence)==null||s.register_once(e,t,i)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}Rs(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}getEarlyAccessFeatures(e,t,i){return t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.us.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return(t=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return S.uninitializedWarning("posthog.identify");if(Z(e)&&(e=e.toString(),S.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))S.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(this.Ps("posthog.identify")){var s=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var n=s;this.register_once({$had_persisted_distinct_id:!0,$device_id:n},"")}e!==s&&e!==this.get_property(Bt)&&(this.unregister(Bt),this.register({distinct_id:e}));var a=(this.persistence.get_property(Ne)||"anonymous")==="anonymous";e!==s&&a?(this.persistence.set_property(Ne,"identified"),this.setPersonPropertiesForFlags(w({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.cs=bn(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(Sr))}}else S.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Ps("posthog.setPersonProperties")){var i=bn(this.get_distinct_id(),e,t);this.cs!==i?(this.setPersonPropertiesForFlags(w({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.cs=i):S.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.Ps("posthog.group")){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:w({},s,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),s[e]===t||i||this.reloadFeatureFlags()}}else S.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}
94setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.Ps("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,s,n;if(S.info("reset"),!this.__loaded)return S.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),(s=this.persistence)==null||s.set_property(Ne,"anonymous"),(n=this.sessionManager)==null||n.resetSessionId(),this.cs=null,this.config.__preview_experimental_cookieless_mode)this.register_once({distinct_id:Vs,$device_id:null},"");else{var o=this.config.get_device_id(et());this.register_once({distinct_id:o,$device_id:e?o:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&i){var n,a=(n=e.timestampLookBack)!==null&&n!==void 0?n:10;if(!i)return s;s+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-a,0)}return s}alias(e,t){return e===this.get_property(wa)?(S.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ps("posthog.alias")?(b(t)&&(t=this.get_distinct_id()),e!==t?(this.Rs(Bt,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(S.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t,i,s,n,a=w({},this.config);B(e)&&(U(this.config,Tn(e)),(t=this.persistence)==null||t.update_config(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new ni(w({},this.config,{persistence:"sessionStorage"})),G.O()&&G.A("ph_debug")==="true"&&(this.config.debug=!0),this.config.debug&&(je.DEBUG=!0,S.info("set_config",JSON.stringify({config:e,oldConfig:a,newConfig:w({},this.config)},null,2))),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(s=this.autocapture)==null||s.startIfEnabled(),(n=this.heatmaps)==null||n.startIfEnabled(),this.surveys.loadIfEnabled(),this.bs())}startSessionRecording(e){var t=e===!0,i={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var s,n,a,o,l;(s=this.sessionManager)==null||s.checkAndGetSessionAndWindowId(),i.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),i.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),i.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("url")),i.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException");this.exceptions.sendExceptionEvent(w({},Qu((s=>s instanceof Error)(e)?{error:e,event:e.message}:{event:e},{syntheticException:i}),t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:wt;return t!==wt&&(t=wt+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(Ne))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(Ne))==="identified"}Is(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Et(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Bt])&&((t=this.persistence)==null||(t=t.props)==null||!t[kr]))}ks(){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.Is()||this.Ps("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Ps(e){return this.config.person_profiles==="never"?(S.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Rs(kr,!0),!0)}bs(){var e,t,i,s,n=this.consent.isOptedOut(),a=this.config.opt_out_persistence_by_default,o=this.config.disable_persistence||n&&!!a;((e=this.persistence)==null?void 0:e.xe)!==o&&((i=this.persistence)==null||i.set_disabled(o)),((t=this.sessionPersistence)==null?void 0:t.xe)!==o&&((s=this.sessionPersistence)==null||s.set_disabled(o))}opt_in_capturing(e){var t;this.consent.optInOut(!0),this.bs(),(b(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((t=e==null?void 0:e.captureEventName)!==null&&t!==void 0?t:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.$s()}opt_out_capturing(){this.consent.optInOut(!1),this.bs()}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}clear_opt_in_out_capturing(){this.consent.reset(),this.bs()}_is_bot(){return he?So(he,this.config.custom_blocked_useragents):void 0}$s(){E&&(E.visibilityState==="visible"?this.hs||(this.hs=!0,this.capture("$pageview",{title:E.title},{send_instantly:!0}),this.ds&&(E.removeEventListener("visibilitychange",this.ds),this.ds=null)):this.ds||(this.ds=this.$s.bind(this),j(E,"visibilitychange",this.ds)))}debug(e){e===!1?(v==null||v.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(v==null||v.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)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}Es(e){if(O(this.config.before_send))return e;var t=D(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(i=s(i),O(i)){var n="Event '"+e.event+"' was rejected in beforeSend function";return ou(e.event)?S.warn(n+". This can cause unexpected behavior."):S.info(n),null}i.properties&&!Et(i.properties)||S.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;
94return(e=this.pageViewManager.ne)==null?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}}(function(r,e){for(var t=0;t<e.length;t++)r.prototype[e[t]]=uu(r.prototype[e[t]])})(Br,["identify"]);var An,ge=(An=Jt[wt]=new Br,function(){function r(){r.done||(r.done=!0,xo=!1,$(Jt,function(e){e._dom_loaded()}))}E!=null&&E.addEventListener?E.readyState==="complete"?r():j(E,"DOMContentLoaded",r,{capture:!1}):v&&S.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),An),yd=typeof window<"u"?window:void 0,z=typeof globalThis<"u"?globalThis:yd,bd=Array.prototype,Ln=bd.forEach,oi=z==null?void 0:z.navigator;z==null||z.document;z==null||z.location;z==null||z.fetch;z!=null&&z.XMLHttpRequest&&"withCredentials"in new z.XMLHttpRequest&&z.XMLHttpRequest;z==null||z.AbortController;oi==null||oi.userAgent;var Nn;(function(r){r.GZipJS="gzip-js",r.Base64="base64"})(Nn||(Nn={}));var wd=Array.isArray,Ed=Object.prototype,ko=Ed.toString,Co=wd||function(r){return ko.call(r)==="[object Array]"},Sd=function(r){return r===void 0},xd=function(r){return ko.call(r)=="[object Number]"},kd={};function Dn(r,e,t){if(Co(r)){if(Ln&&r.forEach===Ln)r.forEach(e,t);else if("length"in r&&r.length===+r.length){for(var i=0,s=r.length;i<s;i++)if(i in r&&e.call(t,r[i],i)===kd)return}}}var Cd=function(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return Dn(e,function(i){Dn(i,function(s){r.push(s)})}),r},V,ls="Mobile",Io="iOS",Id="Android",Ro="Safari",jn="BlackBerry",Po="Samsung",Rd=Po+"Browser",Pd=Po+" Internet",qi="Chrome",Md=qi+" "+Io,Mo="Internet Explorer",Fd=Mo+" "+ls,qn="Opera",Fo="Edge",Od="Microsoft "+Fo,Bi="Firefox",$d=Bi+" "+Io,Td=Id+" "+ls,Ad=ls+" "+Ro,Ld="Konqueror",ie="(\\d+(\\.\\d+)?)",li=new RegExp("Version/"+ie);V={},V[Fd]=[new RegExp("rv:"+ie)],V[Od]=[new RegExp(Fo+"?\\/"+ie)],V[qi]=[new RegExp("("+qi+"|CrMo)\\/"+ie)],V[Md]=[new RegExp("CriOS\\/"+ie)],V["UC Browser"]=[new RegExp("(UCBrowser|UCWEB)\\/"+ie)],V[Ro]=[li],V[Ad]=[li],V[qn]=[new RegExp("("+qn+"|OPR)\\/"+ie)],V[Bi]=[new RegExp(Bi+"\\/"+ie)],V[$d]=[new RegExp("FxiOS\\/"+ie)],V[Ld]=[new RegExp("Konqueror[:/]?"+ie,"i")],V[jn]=[new RegExp(jn+" "+ie),li],V[Td]=[new RegExp("android\\s"+ie,"i")],V[Pd]=[new RegExp(Rd+"\\/"+ie)],V[Mo]=[new RegExp("(rv:|MSIE )"+ie)],V.Mozilla=[new RegExp("rv:"+ie)];var Nd=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"];Cd(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Nd);function Oo(r,e,t,i,s){return xd(r)?r>t?t:r<e?e:r:Oo(t,e,t)}var Bn=function(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),s,n=[],a;try{for(;(e===void 0||e-- >0)&&!(s=i.next()).done;)n.push(s.value)}catch(o){a={error:o}}finally{try{s&&!s.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return n},Hn=function(r,e,t){if(t||arguments.length===2)for(var i=0,s=e.length,n;i<s;i++)(n||!(i in e))&&(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return r.concat(n||Array.prototype.slice.call(e))};function Dd(r,e){return Hn(Hn([],Bn(r||[]),!1),Bn(Co(e)?e:[e]),!1)}function jd(r,e){return(Sd(r)?1:r)*e}function qd(r){for(var e=0,t=0;t<r.length;t++)e=(e<<5)-e+r.charCodeAt(t),e|=0;return Math.abs(e)}function Bd(r,e){return qd(r)%100<Oo(e*100,0,100)}var kt=function(){return kt=Object.assign||function(r){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}return r},kt.apply(this,arguments)};function Hd(r){return function(e){return e&&Bd(e.properties.$session_id,r)?kt(kt({},e),{properties:kt(kt({},e.properties),{$sample_type:Dd(e.properties.$sample_type,"sampleBySessionId"),$sample_threshold:jd(e.properties.$sample_threshold,r)})}):null}}var $o=A.createContext({client:ge});
94function To(r,e,t){if(t===void 0&&(t=new WeakMap),r===e)return!0;if(typeof r!="object"||r===null||typeof e!="object"||e===null)return!1;if(t.has(r)&&t.get(r)===e)return!0;t.set(r,e);var i=Object.keys(r),s=Object.keys(e);if(i.length!==s.length)return!1;for(var n=0,a=i;n<a.length;n++){var o=a[n];if(!s.includes(o)||!To(r[o],e[o],t))return!1}return!0}function Ud(r){var e=r.children,t=r.client,i=r.apiKey,s=r.options,n=A.useRef(null),a=A.useMemo(function(){return t?(i&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),s&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),t):(i||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),ge)},[t,i,JSON.stringify(s)]);return A.useEffect(function(){if(!t){var o=n.current;o?(i!==o.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),s&&!To(s,o.options)&&ge.set_config(s),n.current={apiKey:i,options:s??{}}):(ge.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),ge.init(i,s),n.current={apiKey:i,options:s??{}})}},[t,i,JSON.stringify(s)]),bt.createElement($o.Provider,{value:{client:a}},e)}var Hi=function(r,e){return Hi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])},Hi(r,e)};function zd(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Hi(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var ui=function(r){return typeof r=="function"},Wd={componentStack:null,error:null},Gd={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(r){zd(e,r);function e(t){var i=r.call(this,t)||this;return i.state=Wd,i}return e.prototype.componentDidCatch=function(t,i){var s=i.componentStack,n=this.props.additionalProperties;this.setState({error:t,componentStack:s});var a;ui(n)?a=n(t):typeof n=="object"&&(a=n);var o=this.context.client;o.captureException(t,a)},e.prototype.render=function(){var t=this.props,i=t.children,s=t.fallback,n=this.state;if(n.componentStack==null)return ui(i)?i():i;var a=ui(s)?bt.createElement(s,{error:n.error,componentStack:n.componentStack}):s;return bt.isValidElement(a)?a:(console.warn(Gd.INVALID_FALLBACK),bt.createElement(bt.Fragment,null))},e.contextType=$o,e})(bt.Component);function Vd(r){return r==="prod"?"phc_sEgdMCo3uzzWk7aD78ggSMJEVn4vQXwA2GiMhsbWAzxF":"phc_zfsxKNKXMxssLp2kXThReZFFRaVNrHGEtPiTeesEQcpw"}function Ao({disabled:r=!1,sampleRate:e=0,children:t}){const i=sa(),s=Cl();return A.useEffect(()=>{if(!(r||e===0)){if(e<0||e>100)throw new Error("PostHog: sampleRate must be between 0 and 100");ge.init(Vd((i==null?void 0:i.stage)??"alpha"),{before_send:[Hd(e/100)],api_host:"https://us.i.posthog.com",person_profiles:"identified_only",loaded:n=>{window.posthog=n},capture_pageview:!1,disable_session_recording:!0})}},[r,e]),A.useEffect(()=>{Pe.isNil(i==null?void 0:i.user)?(ge.reset(),ge.stopSessionRecording()):(ge.identify(i.user.karrotUserId),ge.startSessionRecording())},[i==null?void 0:i.user]),s?m.jsx(Ud,{client:ge,children:t}):m.jsx(m.Fragment,{children:t})}function Kd(){return A.useEffect(()=>{const r=document.createElement("script");r.async=!0,r.src=`https://www.googletagmanager.com/gtag/js?id=${gs}`,document.head.appendChild(r);const e=document.createElement("script");e.textContent=`window.dataLayer=window.dataLayer||[];function gtag(){dataLayer.push(arguments);}gtag('js',new Date());gtag('config','${gs}');`,document.head.appendChild(e)},[]),null}function Yd(){return A.useEffect(()=>{const r=document.createElement("script");r.textContent="window.dataLayer=window.dataLayer||[];window.dataLayer.push({'gtm.start':new Date().getTime(),event:'gtm.js'});",document.head.appendChild(r);const e=document.createElement("script");e.async=!0,e.src=`https://www.googletagmanager.com/gtm.js?id=${Yn}`,document.head.appendChild(e)},[]),null}var Lo={exports:{}};/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
95 * @license MIT */(function(r,e){(function(t,i){r.exports=i()})(Yo,function(){var t={};t.version="0.2.0";var i=t.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};t.configure=function(h){var g,_;for(g in h)_=h[g],_!==void 0&&h.hasOwnProperty(g)&&(i[g]=_);return this},t.status=null,t.set=function(h){var g=t.isStarted();h=s(h,i.minimum,1),t.status=h===1?null:h;var _=t.render(!g),y=_.querySelector(i.barSelector),x=i.speed,I=i.easing;return _.offsetWidth,o(function(k){i.positionUsing===""&&(i.positionUsing=t.getPositioningCSS()),l(y,a(h,x,I)),h===1?(l(_,{transition:"none",opacity:1}),_.offsetWidth,setTimeout(function(){l(_,{transition:"all "+x+"ms linear",opacity:0}
95),setTimeout(function(){t.remove(),k()},x)},x)):setTimeout(k,x)}),this},t.isStarted=function(){return typeof t.status=="number"},t.start=function(){t.status||t.set(0);var h=function(){setTimeout(function(){t.status&&(t.trickle(),h())},i.trickleSpeed)};return i.trickle&&h(),this},t.done=function(h){return!h&&!t.status?this:t.inc(.3+.5*Math.random()).set(1)},t.inc=function(h){var g=t.status;return g?(typeof h!="number"&&(h=(1-g)*s(Math.random()*g,.1,.95)),g=s(g+h,0,.994),t.set(g)):t.start()},t.trickle=function(){return t.inc(Math.random()*i.trickleRate)},function(){var h=0,g=0;t.promise=function(_){return!_||_.state()==="resolved"?this:(g===0&&t.start(),h++,g++,_.always(function(){g--,g===0?(h=0,t.done()):t.set((h-g)/h)}),this)}}(),t.render=function(h){if(t.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var g=document.createElement("div");g.id="nprogress",g.innerHTML=i.template;var _=g.querySelector(i.barSelector),y=h?"-100":n(t.status||0),x=document.querySelector(i.parent),I;return l(_,{transition:"all 0 linear",transform:"translate3d("+y+"%,0,0)"}),i.showSpinner||(I=g.querySelector(i.spinnerSelector),I&&f(I)),x!=document.body&&c(x,"nprogress-custom-parent"),x.appendChild(g),g},t.remove=function(){p(document.documentElement,"nprogress-busy"),p(document.querySelector(i.parent),"nprogress-custom-parent");var h=document.getElementById("nprogress");h&&f(h)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var h=document.body.style,g="WebkitTransform"in h?"Webkit":"MozTransform"in h?"Moz":"msTransform"in h?"ms":"OTransform"in h?"O":"";return g+"Perspective"in h?"translate3d":g+"Transform"in h?"translate":"margin"};function s(h,g,_){return h<g?g:h>_?_:h}function n(h){return(-1+h)*100}function a(h,g,_){var y;return i.positionUsing==="translate3d"?y={transform:"translate3d("+n(h)+"%,0,0)"}:i.positionUsing==="translate"?y={transform:"translate("+n(h)+"%,0)"}:y={"margin-left":n(h)+"%"},y.transition="all "+g+"ms "+_,y}var o=function(){var h=[];function g(){var _=h.shift();_&&_(g)}return function(_){h.push(_),h.length==1&&g()}}(),l=function(){var h=["Webkit","O","Moz","ms"],g={};function _(k){return k.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(F,T){return T.toUpperCase()})}function y(k){var F=document.body.style;if(k in F)return k;for(var T=h.length,N=k.charAt(0).toUpperCase()+k.slice(1),R;T--;)if(R=h[T]+N,R in F)return R;return k}function x(k){return k=_(k),g[k]||(g[k]=y(k))}function I(k,F,T){F=x(F),k.style[F]=T}return function(k,F){var T=arguments,N,R;if(T.length==2)for(N in F)R=F[N],R!==void 0&&F.hasOwnProperty(N)&&I(k,N,R);else I(k,T[1],T[2])}}();function u(h,g){var _=typeof h=="string"?h:d(h);return _.indexOf(" "+g+" ")>=0}function c(h,g){var _=d(h),y=_+g;u(_,g)||(h.className=y.substring(1))}function p(h,g){var _=d(h),y;u(h,g)&&(y=_.replace(" "+g+" "," "),h.className=y.substring(1,y.length-1))}function d(h){return(" "+(h.className||"")+" ").replace(/\s+/gi," ")}function f(h){h&&h.parentNode&&h.parentNode.removeChild(h)}return t})})(Lo);var Qd=Lo.exports;const Yt=Ko(Qd);Yt.configure({showSpinner:!1});const Xd=()=>{const r=Qo(),e=Xo(),t=A.useMemo(()=>r.state!=="idle"?!0:e.some(i=>i.state==="loading"||i.state==="submitting"),[r.state,e]);return A.useEffect(()=>{t?Yt.start():Yt.done()},[t]),A.useEffect(()=>()=>{Yt.done(),Yt.remove()},[]),null},Jd={segmentValueCharset:"a-zA-Z0-9가-힣-_%"},Zd=Pe.cond([[r=>new Rl(`(/:c)/${ks.BUY_SELL}/(:id)(/)`,Jd).match(r)!==null,Pe.constant(ks.BUY_SELL)],[Pe.stubTrue,Pe.constant(null)]]);function Ui(r){return Zd(r)}function eh(){const r=Wi(),e=Vi();return A.useEffect(()=>{bl({$currentUrl:window.location.href,countryCode:e.karrotLocalCountryCode,serviceName:Ui(r.pathname)})},[r]),null}var th="qoqfi20",rh="qoqfi21",ih="qoqfi22",sh="qoqfi23";const nh={ca:"Canada",us:"United States"};function ah(r){const e=Vi(),t=r.initKarrotLocalCountryCode,[i,s]=A.useState(!1);if(t!==Zt.CA&&t!==Zt.US||i)return null;const n=nh[t],a=()=>{s(!0),r.onBannerClose(),window.location.href=ul({stage:e.stage,isLocalhost:e.isLocalhost,countryCode:t})},o=()=>{s(!0),r.onBannerClose()};return m.jsx(xs,{paddingInline:4,paddingBlock:3,className:th,children:m.jsx(wl,{closeAriaLabel:"Close country select banner",onClose:o,children:m.jsxs("div",{className:rh,children:[m.jsx(Sl,{variant:"body-3",className:sh,children:`It looks like you’re visiting from ${n}. Go to the ${n} site for local content?`}),m.jsx(xs,{direction:"row",gap:3,width:"100%",justify:{s:"start",m:"end"},children:m.jsx(ml,{onClick:a,className:ih,children:`Go to ${n}`})})]})})})}var oh=aa({defaultClassName:"q6bl8g0",variantClassNames:{position:{absolute:"q
956bl8g1",fixed:"q6bl8g2"}},defaultVariants:{},compoundVariants:[]}),lh="q6bl8g3";const Un="/_assets/global-nRkuw1Mh.css",zn="/_assets/reshaped-global-BoyXwPjA.css",uh=["나눔","담배","대마초","딜도","맥주","머시론","몰카","바이브레이터","배터리캠","보지","비아그라","사랑 상품권","사랑상품권","서클 렌즈","서클렌즈","섹스","소주","수면제","술","시알리스","신의눈물","아편","엑스터시","엘에스디","오나홀","온누리 상품권","온누리상품권","의료기","의료기기","의약품","인공 눈물","인공눈물","입던","입던속옷","입던팬티","자위","자지","잠지","재난","재난기본소득카드","재난지원금","전자 담배","전자담배","컨택트 렌즈","컨택트렌즈","코카인","콘돔","피임약","필로폰","헤로인","헤시시","헤시시오일","우머나이저","베이프레소","베이포레소","avsee","사쿠라허브"],Wn=[Zt.CA,Zt.US];function ch({countryCodeByIp:r,karrotLocalCountryCode:e,countryConfirmBannerCheck:t,userRole:i=Is.loggedOut}){return!(i!==Is.loggedOut||Pe.isNil(r)||r===e||t||!Wn.includes(r)||!Wn.includes(e))}const dh=r=>{if(!r)return!1;const e=/[\uAC00-\uD7A3\u1100-\u11FF\u3130-\u318F]/,t=/[\u3040-\u309F\u30A0-\u30FF]/,i=n=>/[^\u0000-\u007F]/.test(n)&&!e.test(n)&&!t.test(n);return!!Array.from(r).some(i)},hh=hl.of();function qh({currentUrl:r,nextUrl:e}){const t=new URL(r),i=new URL(e),s=Ui(t.pathname),n=t.searchParams.get(ar.In),a=t.searchParams.get(ar.Search),o=Ui(i.pathname),l=i.searchParams.get(ar.In),u=i.searchParams.get(ar.Search);return s!==o||n!==l||a!==u}const Bh=({data:r})=>r?kl([{property:"og:site_name",content:Zo[r.karrotLocalCountryCode]},{property:"og:locale",content:na(r.karrotLocalCountryCode)},{name:"naver-site-verification",content:el},{property:"fb:app_id",content:tl},{name:"p:domain_verify",content:"e409cc57443686596094495f640bef2a"},...r.__gnb.query?xl({shouldBlock:uh.some(e=>{var t;return(t=r.__gnb.query)==null?void 0:t.toLowerCase().includes(e.toLowerCase())})||dh(r.__gnb.query??"")}):[]]):[],zi=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",ph=()=>{var s;const r=sl(),[e]=fa(),[t]=A.useState(()=>new pa({defaultOptions:{queries:{staleTime:60*1e3}}}));let i=m.jsx(vs,{});return r.user&&(i=m.jsx(Cs,{children:m.jsx(vs,{})})),m.jsxs("html",{lang:r.karrotLang,"data-carotene":"","data-carotene-color-mode":zi(),"data-seed":"","data-seed-color-mode":"system","data-seed-user-color-scheme":zi(),"data-rs-theme":"karrot",children:[m.jsxs("head",{children:[m.jsx("meta",{charSet:"utf-8"}),m.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),m.jsx("meta",{name:"color-scheme",content:"light dark"}),r.stage==="alpha"&&m.jsx("meta",{name:"robots",content:"noindex"}),m.jsx("script",{dangerouslySetInnerHTML:{__html:Xn}}),r.karrotInfraCountryCode===Gi.CA&&m.jsx("script",{dangerouslySetInnerHTML:{__html:Jn}}),m.jsx("script",{dangerouslySetInnerHTML:{__html:ha({mode:"system"})}}),m.jsx("script",{dangerouslySetInnerHTML:{__html:nl`window.sentryEnv = {
96              release: "${r.sentryRelease??"unknown"}",
97              environment: "${r.sentryEnvironment??"unknown"}-${r.karrotInfraCountryCode}"
98            };
99            `}}),m.jsx(al,{}),m.jsx(No,{}),m.jsx(Qn,{})]}),m.jsxs("body",{children:[m.jsx("noscript",{children:m.jsx("iframe",{title:"googletagmanager",src:`https://www.googletagmanager.com/ns.html?id=${Yn}`,height:"0",width:"0",style:{display:"none",visibility:"hidden"}})}),m.jsx(Kd,{}),m.jsx(Yd,{}),m.jsx(Xd,{}),m.jsx(Ao,{sampleRate:r.eventTracker.sampleRate,children:m.jsxs(ia,{client:t,children:[m.jsxs(oa,{defaultColorMode:"light",theme:"karrot",children:[m.jsx(la,{}),!Pe.isNil(r.countryCodeByIp)&&ch({countryCodeByIp:r.countryCodeByIp,karrotLocalCountryCode:r.karrotLocalCountryCode,countryConfirmBannerCheck:r.countryConfirmBannerCheck,userRole:Ol({authorizedUserId:(s=r.user)==null?void 0:s.id})})&&m.jsx(ah,{onBannerClose:()=>{hh.update({disabled:!0})},initKarrotLocalCountryCode:r.countryCodeByIp}),i,r.user&&m.jsx(Cs,{children:m.jsx(zr.Root,{children:m.jsxs(pl.EnabledOnly,{children:[m.jsx(zr.ChannelList,{className:oh({position:r.channelListPosition})}),m.jsx(zr.Channel,{className:lh})]})})}),m.jsx(eh,{}),!e&&Pe.isNil(r.user)&&m.jsx(ru,{}),m.jsx(fl,{})]}),m.jsx(zl,{initialIsOpen:!1,buttonPosition:"bottom-left"})]})}),m.jsx(Ll,{}),m.jsx(Zn,{})]})]})};function Hh(){const r=Jo(),e=Wi();Dl(r);const t=sa(),i=fh({rootData:t,error:r,pathname:e.pathname}),{karrotLang:s,karrotInfraCountryCode:n,karrotLocalCountryCode:a}=i,[o]=A.useState(()=>new pa({defaultOptions:{queries:{staleTime:60*1e3}}})),l=({status:u=Ve.INTERNAL_SERVER_ERROR})=>m.jsxs("html",{lang:s,"data-carotene":"","data-carotene-color-mode":zi(),"data-rs-theme":"karrot",children:[m.jsxs("head",{children:[m.jsx("meta",{charSet:"utf-8"}),m.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),m.jsx(No,{}),m.jsx(Qn,{}),m.jsx("script",{dangerouslySetInnerHTML:{__html:Xn}}),n===Gi.CA&&m.jsx("script",{dangerouslySetInnerHTML:{__html:Jn}}),m.jsx("script",{dangerouslySetInnerHTML:{__html:ha({mode:"system"})}})]}),m.jsxs("body",{style:{background:u===Ve.NOT_FOUND?"linear-gradient(180deg, var(--rs-color-background-primary-faded) 0%, var(--rs-color-background-page) 100%)":"linear-gradient(180deg, var(--rs-color-background-critical-faded) 0%, var(--rs-color-background-page) 100%)"},children:[m.jsx(Ao,{disabled:Pe.isNil(t)}),m.jsx(ia,{client:o,children:m.jsxs(oa,{defaultColorMode:"light",theme:"karrot",children:[m.jsx(la,{}),t?m.jsx(cl,{isAuthenticated:!Pe.isNil(t.user),style:{background:"transparent"},searchBar:{shouldShow:!1},locationSelectMenu:{shouldShow:!1}}):m.jsx(vh,{karrotLocalCountryCode:a}),u===Ve.NOT_FOUND?m.jsx(Ml,{karrotLocalCountryCode:a}):m.jsx(Fl,{karrotLocalCountryCode:a}),t&&m.jsx(Pl,{})]})}),m.jsx(Zn,{})]})]});if(ua(r))switch(r.status){case Ve.NOT_FOUND:return l({status:Ve.NOT_FOUND});default:return l({status:Ve.INTERNAL_SERVER_ERROR})}return r instanceof Error?l({status:Ve.INTERNAL_SERVER_ERROR}):l({status:Ve.INTERNAL_SERVER_ERROR})}const fh=({rootData:r,error:e,pathname:t})=>{const i=ea({run:()=>
99ua(e)&&typeof e.data=="string"?JSON.parse(e.data):null,callback:()=>null}),s=gh(t);return{karrotLang:(r==null?void 0:r.karrotLang)||na(s)||"en-US",karrotLocalCountryCode:(r==null?void 0:r.karrotLocalCountryCode)||s,karrotInfraCountryCode:(r==null?void 0:r.karrotInfraCountryCode)||Gi.CA,stage:(r==null?void 0:r.stage)||rl.Production,__gnb:(r==null?void 0:r.__gnb)||void 0,...i||{}}},Uh=Tl(ph);function gh(r){const e=r.split("/")[1]??"";return ea({run:()=>il(e),callback:()=>Zt.US})}function vh({karrotLocalCountryCode:r}){return m.jsx("header",{style:{display:"flex",alignItems:"center",padding:"12px 16px",background:"transparent"},children:m.jsx("a",{href:`/${r}/`,"aria-label":"Karrot home",children:m.jsx(dl,{})})})}function No(){return m.jsxs(m.Fragment,{children:[m.jsx("link",{rel:"icon",href:Wl,type:"image/png"}),m.jsx("link",{rel:"preconnect",href:"https://warp-static.daangn.com"}),m.jsx("link",{rel:"preload",as:"style",href:Un}),m.jsx("link",{rel:"stylesheet",as:"style",href:Un}),m.jsx("link",{rel:"preload",as:"style",href:zn}),m.jsx("link",{rel:"stylesheet",as:"style",href:zn})]})}export{Hh as ErrorBoundary,Uh as default,Bh as meta,qh as shouldRevalidate};
100//# sourceMappingURL=root-DFjxey2b.js.map
101
102//# debugId=1c123ca6-ee33-5fa5-89e8-5c8a02a44ab6

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.