@code-insights/cli 3.6.0 → 3.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to `@code-insights/cli` will be documented in this file.
4
4
 
5
+ ## [3.6.1] - 2026-03-04
6
+
7
+ ### Changed
8
+
9
+ - **PostHog custom domain** — Route telemetry events through `code-insights.app` instead of `us.i.posthog.com` to avoid ad-blocker interference. Updated both CLI (posthog-node) and dashboard (posthog-js).
10
+ - **README badges** — Added npm version, monthly downloads, license, Node.js version, and Socket security score badges.
11
+
5
12
  ## [3.6.0] - 2026-03-04
6
13
 
7
14
  ### Added
@@ -61,7 +61,7 @@ Error generating stack: `+b.message+`
61
61
  Please change the parent <Route path="${S}"> to <Route path="${S==="/"?"*":`${S}/*`}">.`)}let f=xi(),p;if(t){let S=typeof t=="string"?Yf(t):t;un(c==="/"||((E=S.pathname)==null?void 0:E.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${S.pathname}" was given in the \`location\` prop.`),p=S}else p=f;let g=p.pathname||"/",v=g;if(c!=="/"){let S=c.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(S.length).join("/")}let x=zq(e,{pathname:v});mi(d||x!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),mi(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=qse(x&&x.map(S=>Object.assign({},S,{params:Object.assign({},o,S.params),pathname:Eo([c,r.encodeLocation?r.encodeLocation(S.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:Eo([c,r.encodeLocation?r.encodeLocation(S.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:S.pathnameBase])})),a,n);return t&&w?y.createElement(Km.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},w):w}function Bse(){let e=Xse(),t=Ase(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:i},"ErrorBoundary")," or"," ",y.createElement("code",{style:i},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:a},n):null,o)}var zse=y.createElement(Bse,null),Jq=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=Mse(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(yi.Provider,{value:this.props.routeContext},y.createElement(FN.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(Gse,{error:e},t):t}};Jq.contextType=Nse;var oS=new WeakMap;function Gse({children:e,error:t}){let{basename:n}=y.useContext(Ga);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Dse(t.digest);if(r){let a=oS.get(t);if(a)throw a;let i=Vq(r.location,n);if(qq&&!oS.get(t))if(i.isExternal||r.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const o=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:r.replace}));throw oS.set(t,o),o}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Hse({routeContext:e,match:t,children:n}){let r=y.useContext(Kf);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(yi.Provider,{value:e},n)}function qse(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,i=r==null?void 0:r.errors;if(i!=null){let f=a.findIndex(p=>p.route.id&&(i==null?void 0:i[p.route.id])!==void 0);un(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let o=!1,l=-1;if(n&&r){o=r.renderFallback;for(let f=0;f<a.length;f++){let p=a[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(l=f),p.route.id){let{loaderData:g,errors:v}=r,x=p.route.loader&&!g.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||x){n.isStatic&&(o=!0),l>=0?a=a.slice(0,l+1):a=[a[0]];break}}}}let c=n==null?void 0:n.onError,d=r&&c?(f,p)=>{var g,v;c(f,{location:r.location,params:((v=(g=r.matches)==null?void 0:g[0])==null?void 0:v.params)??{},unstable_pattern:Tse(r.matches),errorInfo:p})}:void 0;return a.reduceRight((f,p,g)=>{let v,x=!1,w=null,E=null;r&&(v=i&&p.route.id?i[p.route.id]:void 0,w=p.route.errorElement||zse,o&&(l<0&&g===0?(e8("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,E=null):l===g&&(x=!0,E=p.route.hydrateFallbackElement||null)));let S=t.concat(a.slice(0,g+1)),T=()=>{let k;return v?k=w:x?k=E:p.route.Component?k=y.createElement(p.route.Component,null):p.route.element?k=p.route.element:k=f,y.createElement(Hse,{match:p,routeContext:{outlet:f,matches:S,isDataRoute:r!=null},children:k})};return r&&(p.route.ErrorBoundary||p.route.errorElement||g===0)?y.createElement(Jq,{location:r.location,revalidation:r.revalidation,component:w,error:v,children:T(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:d}):T()},null)}function UN(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vse(e){let t=y.useContext(Kf);return un(t,UN(e)),t}function Wse(e){let t=y.useContext(Qx);return un(t,UN(e)),t}function Yse(e){let t=y.useContext(yi);return un(t,UN(e)),t}function BN(e){let t=Yse(e),n=t.matches[t.matches.length-1];return un(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Kse(){return BN("useRouteId")}function Xse(){var r;let e=y.useContext(FN),t=Wse("useRouteError"),n=BN("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Zse(){let{router:e}=Vse("useNavigate"),t=BN("useNavigate"),n=y.useRef(!1);return Zq(()=>{n.current=!0}),y.useCallback(async(a,i={})=>{mi(n.current,Xq),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var VU={};function e8(e,t,n){!t&&!VU[e]&&(VU[e]=!0,mi(!1,n))}y.memo(Qse);function Qse({routes:e,future:t,state:n,isStatic:r,onError:a}){return Qq(e,void 0,{state:n,isStatic:r,onError:a})}function sk({to:e,replace:t,state:n,relative:r}){un(Xf(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=y.useContext(Ga);mi(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:i}=y.useContext(yi),{pathname:o}=xi(),l=$N(),c=Zx(e,jN(i),o,r==="path"),d=JSON.stringify(c);return y.useEffect(()=>{l(JSON.parse(d),{replace:t,state:n,relative:r})},[l,d,r,t,n]),null}function Jse(e){return Fse(e.context)}function ri(e){un(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function ele({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:i=!1,unstable_useTransitions:o}){un(!Xf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),c=y.useMemo(()=>({basename:l,navigator:a,static:i,unstable_useTransitions:o,future:{}}),[l,a,i,o]);typeof n=="string"&&(n=Yf(n));let{pathname:d="/",search:f="",hash:p="",state:g=null,key:v="default",unstable_mask:x}=n,w=y.useMemo(()=>{let E=Ts(d,l);return E==null?null:{location:{pathname:E,search:f,hash:p,state:g,key:v,unstable_mask:x},navigationType:r}},[l,d,f,p,g,v,r,x]);return mi(w!=null,`<Router basename="${l}"> is not able to match the URL "${d}${f}${p}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(Ga.Provider,{value:c},y.createElement(Km.Provider,{children:t,value:w}))}function tle({children:e,location:t}){return Use(lk(e),t)}function lk(e,t=[]){let n=[];return y.Children.forEach(e,(r,a)=>{if(!y.isValidElement(r))return;let i=[...t,a];if(r.type===y.Fragment){n.push.apply(n,lk(r.props.children,i));return}un(r.type===ri,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),un(!r.props.index||!r.props.children,"An index route cannot have child routes.");let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=lk(r.props.children,i)),n.push(o)}),n}var qv="get",Vv="application/x-www-form-urlencoded";function Jx(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function nle(e){return Jx(e)&&e.tagName.toLowerCase()==="button"}function rle(e){return Jx(e)&&e.tagName.toLowerCase()==="form"}function ale(e){return Jx(e)&&e.tagName.toLowerCase()==="input"}function ile(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ole(e,t){return e.button===0&&(!t||t==="_self")&&!ile(e)}function uk(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function sle(e,t){let n=uk(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}var ov=null;function lle(){if(ov===null)try{new FormData(document.createElement("form"),0),ov=!1}catch{ov=!0}return ov}var ule=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function sS(e){return e!=null&&!ule.has(e)?(mi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Vv}"`),null):e}function cle(e,t){let n,r,a,i,o;if(rle(e)){let l=e.getAttribute("action");r=l?Ts(l,t):null,n=e.getAttribute("method")||qv,a=sS(e.getAttribute("enctype"))||Vv,i=new FormData(e)}else if(nle(e)||ale(e)&&(e.type==="submit"||e.type==="image")){let l=e.form;if(l==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=e.getAttribute("formaction")||l.getAttribute("action");if(r=c?Ts(c,t):null,n=e.getAttribute("formmethod")||l.getAttribute("method")||qv,a=sS(e.getAttribute("formenctype"))||sS(l.getAttribute("enctype"))||Vv,i=new FormData(l,e),!lle()){let{name:d,type:f,value:p}=e;if(f==="image"){let g=d?`${d}.`:"";i.append(`${g}x`,"0"),i.append(`${g}y`,"0")}else d&&i.append(d,p)}}else{if(Jx(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=qv,r=null,a=Vv,o=e}return i&&a==="text/plain"&&(o=i,i=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:i,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function zN(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function dle(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&Ts(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function fle(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ple(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function hle(e,t,n){let r=await Promise.all(e.map(async a=>{let i=t.routes[a.route.id];if(i){let o=await fle(i,n);return o.links?o.links():[]}return[]}));return vle(r.flat(1).filter(ple).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function WU(e,t,n,r,a,i){let o=(c,d)=>n[d]?c.route.id!==n[d].route.id:!0,l=(c,d)=>{var f;return n[d].pathname!==c.pathname||((f=n[d].route.path)==null?void 0:f.endsWith("*"))&&n[d].params["*"]!==c.params["*"]};return i==="assets"?t.filter((c,d)=>o(c,d)||l(c,d)):i==="data"?t.filter((c,d)=>{var p;let f=r.routes[c.route.id];if(!f||!f.hasLoader)return!1;if(o(c,d)||l(c,d))return!0;if(c.route.shouldRevalidate){let g=c.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function mle(e,t,{includeHydrateFallback:n}={}){return gle(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let i=[a.module];return a.clientActionModule&&(i=i.concat(a.clientActionModule)),a.clientLoaderModule&&(i=i.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(i=i.concat(a.hydrateFallbackModule)),a.imports&&(i=i.concat(a.imports)),i}).flat(1))}function gle(e){return[...new Set(e)]}function ble(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function vle(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let i=JSON.stringify(ble(a));return n.has(i)||(n.add(i),r.push({key:i,link:a})),r},[])}function t8(){let e=y.useContext(Kf);return zN(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function yle(){let e=y.useContext(Qx);return zN(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var GN=y.createContext(void 0);GN.displayName="FrameworkContext";function n8(){let e=y.useContext(GN);return zN(e,"You must render this element inside a <HydratedRouter> element"),e}function xle(e,t){let n=y.useContext(GN),[r,a]=y.useState(!1),[i,o]=y.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:d,onMouseLeave:f,onTouchStart:p}=t,g=y.useRef(null);y.useEffect(()=>{if(e==="render"&&o(!0),e==="viewport"){let w=S=>{S.forEach(T=>{o(T.isIntersecting)})},E=new IntersectionObserver(w,{threshold:.5});return g.current&&E.observe(g.current),()=>{E.disconnect()}}},[e]),y.useEffect(()=>{if(r){let w=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(w)}}},[r]);let v=()=>{a(!0)},x=()=>{a(!1),o(!1)};return n?e!=="intent"?[i,g,{}]:[i,g,{onFocus:gh(l,v),onBlur:gh(c,x),onMouseEnter:gh(d,v),onMouseLeave:gh(f,x),onTouchStart:gh(p,v)}]:[!1,g,{}]}function gh(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function wle({page:e,...t}){let{router:n}=t8(),r=y.useMemo(()=>zq(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(_le,{page:e,matches:r,...t}):null}function Ele(e){let{manifest:t,routeModules:n}=n8(),[r,a]=y.useState([]);return y.useEffect(()=>{let i=!1;return hle(e,t,n).then(o=>{i||a(o)}),()=>{i=!0}},[e,t,n]),r}function _le({page:e,matches:t,...n}){let r=xi(),{future:a,manifest:i,routeModules:o}=n8(),{basename:l}=t8(),{loaderData:c,matches:d}=yle(),f=y.useMemo(()=>WU(e,t,d,i,r,"data"),[e,t,d,i,r]),p=y.useMemo(()=>WU(e,t,d,i,r,"assets"),[e,t,d,i,r]),g=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,E=!1;if(t.forEach(T=>{var N;let k=i.routes[T.route.id];!k||!k.hasLoader||(!f.some(C=>C.route.id===T.route.id)&&T.route.id in c&&((N=o[T.route.id])!=null&&N.shouldRevalidate)||k.hasClientLoader?E=!0:w.add(T.route.id))}),w.size===0)return[];let S=dle(e,l,a.unstable_trailingSlashAwareDataRequests,"data");return E&&w.size>0&&S.searchParams.set("_routes",t.filter(T=>w.has(T.route.id)).map(T=>T.route.id).join(",")),[S.pathname+S.search]},[l,a.unstable_trailingSlashAwareDataRequests,c,r,i,f,t,e,o]),v=y.useMemo(()=>mle(p,i),[p,i]),x=Ele(p);return y.createElement(y.Fragment,null,g.map(w=>y.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),v.map(w=>y.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),x.map(({key:w,link:E})=>y.createElement("link",{key:w,nonce:n.nonce,...E,crossOrigin:E.crossOrigin??n.crossOrigin})))}function Sle(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Ale=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ale&&(window.__reactRouterVersion="7.13.1")}catch{}function Tle({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=y.useRef();a.current==null&&(a.current=tse({window:r,v5Compat:!0}));let i=a.current,[o,l]=y.useState({action:i.action,location:i.location}),c=y.useCallback(d=>{n===!1?l(d):y.startTransition(()=>l(d))},[n]);return y.useLayoutEffect(()=>i.listen(c),[i,c]),y.createElement(ele,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:i,unstable_useTransitions:n})}var r8=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Fr=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:i,replace:o,unstable_mask:l,state:c,target:d,to:f,preventScrollReset:p,viewTransition:g,unstable_defaultShouldRevalidate:v,...x},w){let{basename:E,navigator:S,unstable_useTransitions:T}=y.useContext(Ga),k=typeof f=="string"&&r8.test(f),N=Vq(f,E);f=N.to;let C=Lse(f,{relative:a}),O=xi(),I=null;if(l){let V=Zx(l,[],O.unstable_mask?O.unstable_mask.pathname:"/",!0);E!=="/"&&(V.pathname=V.pathname==="/"?E:Eo([E,V.pathname])),I=S.createHref(V)}let[D,B,L]=xle(r,x),q=Cle(f,{replace:o,unstable_mask:l,state:c,target:d,preventScrollReset:p,relative:a,viewTransition:g,unstable_defaultShouldRevalidate:v,unstable_useTransitions:T});function U(V){t&&t(V),V.defaultPrevented||q(V)}let X=!(N.isExternal||i),z=y.createElement("a",{...x,...L,href:(X?I:void 0)||N.absoluteURL||C,onClick:X?U:t,ref:Sle(w,B),target:d,"data-discover":!k&&n==="render"?"true":void 0});return D&&!k?y.createElement(y.Fragment,null,z,y.createElement(wle,{page:C})):z});Fr.displayName="Link";var kle=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:i,to:o,viewTransition:l,children:c,...d},f){let p=Xm(o,{relative:d.relative}),g=xi(),v=y.useContext(Qx),{navigator:x,basename:w}=y.useContext(Ga),E=v!=null&&Lle(p)&&l===!0,S=x.encodeLocation?x.encodeLocation(p).pathname:p.pathname,T=g.pathname,k=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(T=T.toLowerCase(),k=k?k.toLowerCase():null,S=S.toLowerCase()),k&&w&&(k=Ts(k,w)||k);const N=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let C=T===S||!a&&T.startsWith(S)&&T.charAt(N)==="/",O=k!=null&&(k===S||!a&&k.startsWith(S)&&k.charAt(S.length)==="/"),I={isActive:C,isPending:O,isTransitioning:E},D=C?t:void 0,B;typeof r=="function"?B=r(I):B=[r,C?"active":null,O?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let L=typeof i=="function"?i(I):i;return y.createElement(Fr,{...d,"aria-current":D,className:B,ref:f,style:L,to:o,viewTransition:l},typeof c=="function"?c(I):c)});kle.displayName="NavLink";var Nle=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:i,method:o=qv,action:l,onSubmit:c,relative:d,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:g,...v},x)=>{let{unstable_useTransitions:w}=y.useContext(Ga),E=Dle(),S=Mle(l,{relative:d}),T=o.toLowerCase()==="get"?"get":"post",k=typeof l=="string"&&r8.test(l),N=C=>{if(c&&c(C),C.defaultPrevented)return;C.preventDefault();let O=C.nativeEvent.submitter,I=(O==null?void 0:O.getAttribute("formmethod"))||o,D=()=>E(O||C.currentTarget,{fetcherKey:t,method:I,navigate:n,replace:a,state:i,relative:d,preventScrollReset:f,viewTransition:p,unstable_defaultShouldRevalidate:g});w&&n!==!1?y.startTransition(()=>D()):D()};return y.createElement("form",{ref:x,method:T,action:S,onSubmit:r?c:N,...v,"data-discover":!k&&e==="render"?"true":void 0})});Nle.displayName="Form";function Ole(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function a8(e){let t=y.useContext(Kf);return un(t,Ole(e)),t}function Cle(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:i,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:d}={}){let f=$N(),p=xi(),g=Xm(e,{relative:o});return y.useCallback(v=>{if(ole(v,t)){v.preventDefault();let x=n!==void 0?n:cm(p)===cm(g),w=()=>f(e,{replace:x,unstable_mask:r,state:a,preventScrollReset:i,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c});d?y.startTransition(()=>w()):w()}},[p,f,g,n,r,a,t,e,i,o,l,c,d])}function HN(e){mi(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(uk(e)),n=y.useRef(!1),r=xi(),a=y.useMemo(()=>sle(r.search,n.current?null:t.current),[r.search]),i=$N(),o=y.useCallback((l,c)=>{const d=uk(typeof l=="function"?l(new URLSearchParams(a)):l);n.current=!0,i("?"+d,c)},[i,a]);return[a,o]}var Rle=0,Ile=()=>`__${String(++Rle)}__`;function Dle(){let{router:e}=a8("useSubmit"),{basename:t}=y.useContext(Ga),n=Kse(),r=e.fetch,a=e.navigate;return y.useCallback(async(i,o={})=>{let{action:l,method:c,encType:d,formData:f,body:p}=cle(i,t);if(o.navigate===!1){let g=o.fetcherKey||Ile();await r(g,n,o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||c,formEncType:o.encType||d,flushSync:o.flushSync})}else await a(o.action||l,{unstable_defaultShouldRevalidate:o.unstable_defaultShouldRevalidate,preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||c,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[r,a,t,n])}function Mle(e,{relative:t}={}){let{basename:n}=y.useContext(Ga),r=y.useContext(yi);un(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),i={...Xm(e||".",{relative:t})},o=xi();if(e==null){i.search=o.search;let l=new URLSearchParams(i.search),c=l.getAll("index");if(c.some(f=>f==="")){l.delete("index"),c.filter(p=>p).forEach(p=>l.append("index",p));let f=l.toString();i.search=f?`?${f}`:""}}return(!e||e===".")&&a.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Eo([n,i.pathname])),cm(i)}function Lle(e,{relative:t}={}){let n=y.useContext(Yq);un(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=a8("useViewTransitionState"),a=Xm(e,{relative:t});if(!n.isTransitioning)return!1;let i=Ts(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ts(n.nextLocation.pathname,r)||n.nextLocation.pathname;return py(a.pathname,o)!=null||py(a.pathname,i)!=null}var ue=typeof window<"u"?window:void 0,Ar=typeof globalThis<"u"?globalThis:ue;typeof self>"u"&&(Ar.self=Ar),typeof File>"u"&&(Ar.File=function(){});var i8=Array.prototype,YU=i8.forEach,KU=i8.indexOf,ja=Ar==null?void 0:Ar.navigator,Se=Ar==null?void 0:Ar.document,Sr=Ar==null?void 0:Ar.location,ck=Ar==null?void 0:Ar.fetch,dk=Ar!=null&&Ar.XMLHttpRequest&&"withCredentials"in new Ar.XMLHttpRequest?Ar.XMLHttpRequest:void 0,XU=Ar==null?void 0:Ar.AbortController,ya=ja==null?void 0:ja.userAgent,ze=ue??{},is={DEBUG:!1,LIB_VERSION:"1.356.2"};function ZU(e,t,n,r,a,i,o){try{var l=e[i](o),c=l.value}catch(d){return void n(d)}l.done?t(c):Promise.resolve(c).then(r,a)}function os(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var i=e.apply(t,n);function o(c){ZU(i,r,a,o,l,"next",c)}function l(c){ZU(i,r,a,o,l,"throw",c)}o(void 0)}))}}function _e(){return _e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_e.apply(null,arguments)}function o8(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var Ple=["$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"],jle=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],QU=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var n=e.toLowerCase();return jle.concat(t).some((r=>{var a=r.toLowerCase();return n.indexOf(a)!==-1}))};function ut(e,t){return e.indexOf(t)!==-1}var e0=function(e){return e.trim()},fk=function(e){return e.replace(/^\$/,"")},Fle=Array.isArray,s8=Object.prototype,l8=s8.hasOwnProperty,t0=s8.toString,Nt=Fle||function(e){return t0.call(e)==="[object Array]"},gs=e=>typeof e=="function",Vn=e=>e===Object(e)&&!Nt(e),Hd=e=>{if(Vn(e)){for(var t in e)if(l8.call(e,t))return!1;return!0}return!1},Ae=e=>e===void 0,$n=e=>t0.call(e)=="[object String]",pk=e=>$n(e)&&e.trim().length===0,Hi=e=>e===null,pt=e=>Ae(e)||Hi(e),ks=e=>t0.call(e)=="[object Number]"&&e==e,Ud=e=>ks(e)&&e>0,Es=e=>t0.call(e)==="[object Boolean]",$le=e=>e instanceof FormData,Ule=e=>ut(Ple,e);function hk(e){return e===null||typeof e!="object"}function hy(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function u8(e){return!Ae(Event)&&(function(t,n){try{return t instanceof n}catch{return!1}})(e,Event)}var Ble=[!0,"true",1,"1","yes"],lS=e=>ut(Ble,e),zle=[!1,"false",0,"0","no"];function vo(e,t,n,r,a){return t>n&&(r.warn("min cannot be greater than max."),t=n),ks(e)?e>n?(r.warn(" cannot be greater than max: "+n+". Using max value instead."),n):e<t?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+a),vo(a||n,t,n,r))}class Gle{constructor(t){this.t={},this.i=t.i,this.o=vo(t.bucketSize,0,100,t.h),this.m=vo(t.refillRate,0,this.o,t.h),this.$=vo(t.refillInterval,0,864e5,t.h)}S(t,n){var r=n-t.lastAccess,a=Math.floor(r/this.$);if(a>0){var i=a*this.m;t.tokens=Math.min(t.tokens+i,this.o),t.lastAccess=t.lastAccess+a*this.$}}consumeRateLimit(t){var n,r=Date.now(),a=String(t),i=this.t[a];return i?this.S(i,r):(i={tokens:this.o,lastAccess:r},this.t[a]=i),i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.i)==null||n.call(this,t)),i.tokens===0)}stop(){this.t={}}}var di="Mobile",my="iOS",bs="Android",dm="Tablet",c8=bs+" "+dm,d8="iPad",f8="Apple",p8=f8+" Watch",fm="Safari",Af="BlackBerry",h8="Samsung",m8=h8+"Browser",g8=h8+" Internet",dc="Chrome",Hle=dc+" OS",b8=dc+" "+my,qN="Internet Explorer",v8=qN+" "+di,VN="Opera",qle=VN+" Mini",WN="Edge",y8="Microsoft "+WN,Xd="Firefox",x8=Xd+" "+my,pm="Nintendo",hm="PlayStation",Zd="Xbox",w8=bs+" "+di,E8=di+" "+fm,Bh="Windows",mk=Bh+" Phone",JU="Nokia",gk="Ouya",_8="Generic",Vle=_8+" "+di.toLowerCase(),S8=_8+" "+dm.toLowerCase(),bk="Konqueror",Yr="(\\d+(\\.\\d+)?)",uS=new RegExp("Version/"+Yr),Wle=new RegExp(Zd,"i"),Yle=new RegExp(hm+" \\w+","i"),Kle=new RegExp(pm+" \\w+","i"),YN=new RegExp(Af+"|PlayBook|BB10","i"),Xle={"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"},sv,eB,cS,Zle=(e,t)=>t&&ut(t,f8)||(function(n){return ut(n,fm)&&!ut(n,dc)&&!ut(n,bs)})(e),A8=function(e,t){return t=t||"",ut(e," OPR/")&&ut(e,"Mini")?qle:ut(e," OPR/")?VN:YN.test(e)?Af:ut(e,"IE"+di)||ut(e,"WPDesktop")?v8:ut(e,m8)?g8:ut(e,WN)||ut(e,"Edg/")?y8:ut(e,"FBIOS")?"Facebook "+di:ut(e,"UCWEB")||ut(e,"UCBrowser")?"UC Browser":ut(e,"CriOS")?b8:ut(e,"CrMo")||ut(e,dc)?dc:ut(e,bs)&&ut(e,fm)?w8:ut(e,"FxiOS")?x8:ut(e.toLowerCase(),bk.toLowerCase())?bk:Zle(e,t)?ut(e,di)?E8:fm:ut(e,Xd)?Xd:ut(e,"MSIE")||ut(e,"Trident/")?qN:ut(e,"Gecko")?Xd:""},Qle={[v8]:[new RegExp("rv:"+Yr)],[y8]:[new RegExp(WN+"?\\/"+Yr)],[dc]:[new RegExp("("+dc+"|CrMo)\\/"+Yr)],[b8]:[new RegExp("CriOS\\/"+Yr)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Yr)],[fm]:[uS],[E8]:[uS],[VN]:[new RegExp("(Opera|OPR)\\/"+Yr)],[Xd]:[new RegExp(Xd+"\\/"+Yr)],[x8]:[new RegExp("FxiOS\\/"+Yr)],[bk]:[new RegExp("Konqueror[:/]?"+Yr,"i")],[Af]:[new RegExp(Af+" "+Yr),uS],[w8]:[new RegExp("android\\s"+Yr,"i")],[g8]:[new RegExp(m8+"\\/"+Yr)],[qN]:[new RegExp("(rv:|MSIE )"+Yr)],Mozilla:[new RegExp("rv:"+Yr)]},Jle=function(e,t){var n=A8(e,t),r=Qle[n];if(Ae(r))return null;for(var a=0;a<r.length;a++){var i=r[a],o=e.match(i);if(o)return parseFloat(o[o.length-2])}return null},tB=[[new RegExp(Zd+"; "+Zd+" (.*?)[);]","i"),e=>[Zd,e&&e[1]||""]],[new RegExp(pm,"i"),[pm,""]],[new RegExp(hm,"i"),[hm,""]],[YN,[Af,""]],[new RegExp(Bh,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[mk,""];if(new RegExp(di).test(t)&&!/IEMobile\b/.test(t))return[Bh+" "+di,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=n[1],a=Xle[r]||"";return/arm/i.test(t)&&(a="RT"),[Bh,a]}return[Bh,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>{if(e&&e[3]){var t=[e[3],e[4],e[5]||"0"];return[my,t.join(".")]}return[my,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Ae(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+bs+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+bs+")","i"),e=>{if(e&&e[2]){var t=[e[2],e[3],e[4]||"0"];return[bs,t.join(".")]}return[bs,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[Hle,""]],[/Linux|debian/i,["Linux",""]]],nB=function(e){return Kle.test(e)?pm:Yle.test(e)?hm:Wle.test(e)?Zd:new RegExp(gk,"i").test(e)?gk:new RegExp("("+mk+"|WPDesktop)","i").test(e)?mk:/iPad/.test(e)?d8:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?p8:YN.test(e)?Af:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(JU,"i").test(e)?JU:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(di).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?bs:c8:new RegExp("(pda|"+di+")","i").test(e)?Vle:new RegExp(dm,"i").test(e)&&!new RegExp(dm+" pc","i").test(e)?S8:""},eue=e=>e instanceof Error;function tue(e){var t=globalThis._posthogChunkIds;if(t){var n=Object.keys(t);return cS&&n.length===eB||(eB=n.length,cS=n.reduce(((r,a)=>{sv||(sv={});var i=sv[a];if(i)r[i[0]]=i[1];else for(var o=e(a),l=o.length-1;l>=0;l--){var c=o[l],d=c==null?void 0:c.filename,f=t[a];if(d&&f){r[d]=f,sv[a]=[d,f];break}}return r}),{})),cS}}class nue{constructor(t,n,r){r===void 0&&(r=[]),this.coercers=t,this.stackParser=n,this.modifiers=r}buildFromUnknown(t,n){n===void 0&&(n={});var r=n&&n.mechanism||{handled:!0,type:"generic"},a=this.buildCoercingContext(r,n,0).apply(t),i=this.buildParsingContext(n),o=this.parseStacktrace(a,i);return{$exception_list:this.convertToExceptionList(o,r),$exception_level:"error"}}modifyFrames(t){var n=this;return os((function*(){for(var r of t)r.stacktrace&&r.stacktrace.frames&&Nt(r.stacktrace.frames)&&(r.stacktrace.frames=yield n.applyModifiers(r.stacktrace.frames));return t}))()}coerceFallback(t){var n;return{type:"Error",value:"Unknown error",stack:(n=t.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(t,n){var r,a;return t.cause!=null&&(r=this.parseStacktrace(t.cause,n)),t.stack!=""&&t.stack!=null&&(a=this.applyChunkIds(this.stackParser(t.stack,t.synthetic?n.skipFirstLines:0),n.chunkIdMap)),_e({},t,{cause:r,stack:a})}applyChunkIds(t,n){return t.map((r=>(r.filename&&n&&(r.chunk_id=n[r.filename]),r)))}applyCoercers(t,n){for(var r of this.coercers)if(r.match(t))return r.coerce(t,n);return this.coerceFallback(n)}applyModifiers(t){var n=this;return os((function*(){var r=t;for(var a of n.modifiers)r=yield a(r);return r}))()}convertToExceptionList(t,n){var r,a,i,o={type:t.type,value:t.value,mechanism:{type:(r=n.type)!==null&&r!==void 0?r:"generic",handled:(a=n.handled)===null||a===void 0||a,synthetic:(i=t.synthetic)!==null&&i!==void 0&&i}};t.stack&&(o.stacktrace={type:"raw",frames:t.stack});var l=[o];return t.cause!=null&&l.push(...this.convertToExceptionList(t.cause,_e({},n,{handled:!0}))),l}buildParsingContext(t){var n;return{chunkIdMap:tue(this.stackParser),skipFirstLines:(n=t.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(t,n,r){r===void 0&&(r=0);var a=(i,o)=>{if(o<=4){var l=this.buildCoercingContext(t,n,o);return this.applyCoercers(i,l)}};return _e({},n,{syntheticException:r==0?n.syntheticException:void 0,mechanism:t,apply:i=>a(i,r),next:i=>a(i,r+1)})}}var Tf="?";function vk(e,t,n,r,a){var i={platform:e,filename:t,function:n==="<anonymous>"?Tf:n,in_app:!0};return Ae(r)||(i.lineno=r),Ae(a)||(i.colno=a),i}var T8=(e,t)=>{var n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Tf,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},rue=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,aue=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,iue=/\((\S*)(?::(\d+))(?::(\d+))\)/,oue=(e,t)=>{var n=rue.exec(e);if(n){var[,r,a,i]=n;return vk(t,r,Tf,+a,+i)}var o=aue.exec(e);if(o){if(o[2]&&o[2].indexOf("eval")===0){var l=iue.exec(o[2]);l&&(o[2]=l[1],o[3]=l[2],o[4]=l[3])}var[c,d]=T8(o[1]||Tf,o[2]);return vk(t,d,c,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},sue=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,lue=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,uue=(e,t)=>{var n=sue.exec(e);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var r=lue.exec(n[3]);r&&(n[1]=n[1]||"eval",n[3]=r[1],n[4]=r[2],n[5]="")}var a=n[3],i=n[1]||Tf;return[i,a]=T8(i,a),vk(t,a,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},rB=/\(error: (.*)\)/,aB=50;function cue(){return(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return function(a,i){i===void 0&&(i=0);for(var o=[],l=a.split(`
62
62
  `),c=i;c<l.length;c++){var d=l[c];if(!(d.length>1024)){var f=rB.test(d)?d.replace(rB,"$1"):d;if(!f.match(/\S*Error: /)){for(var p of n){var g=p(f,e);if(g){o.push(g);break}}if(o.length>=aB)break}}}return(function(v){if(!v.length)return[];var x=Array.from(v);return x.reverse(),x.slice(0,aB).map((w=>{return _e({},w,{filename:w.filename||(E=x,E[E.length-1]||{}).filename,function:w.function||Tf});var E}))})(o)}})("web:javascript",oue,uue)}class due{match(t){return this.isDOMException(t)||this.isDOMError(t)}coerce(t,n){var r=$n(t.stack);return{type:this.getType(t),value:this.getValue(t),stack:r?t.stack:void 0,cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return this.isDOMError(t)?"DOMError":"DOMException"}getValue(t){var n=t.name||(this.isDOMError(t)?"DOMError":"DOMException");return t.message?n+": "+t.message:n}isDOMException(t){return hy(t,"DOMException")}isDOMError(t){return hy(t,"DOMError")}}class fue{match(t){return(n=>n instanceof Error)(t)}coerce(t,n){return{type:this.getType(t),value:this.getMessage(t,n),stack:this.getStack(t),cause:t.cause?n.next(t.cause):void 0,synthetic:!1}}getType(t){return t.name||t.constructor.name}getMessage(t,n){var r=t.message;return r.error&&typeof r.error.message=="string"?String(r.error.message):String(r)}getStack(t){return t.stacktrace||t.stack||void 0}}class pue{constructor(){}match(t){return hy(t,"ErrorEvent")&&t.error!=null}coerce(t,n){var r,a=n.apply(t.error);return a||{type:"ErrorEvent",value:t.message,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}var hue=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class mue{match(t){return typeof t=="string"}coerce(t,n){var r,[a,i]=this.getInfos(t);return{type:a??"Error",value:i??t,stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(t){var n="Error",r=t,a=t.match(hue);return a&&(n=a[1],r=a[2]),[n,r]}}var gue=["fatal","error","warning","log","info","debug"];function k8(e,t){t===void 0&&(t=40);var n=Object.keys(e);if(n.sort(),!n.length)return"[object has no keys]";for(var r=n.length;r>0;r--){var a=n.slice(0,r).join(", ");if(!(a.length>t))return r===n.length||a.length<=t?a:a.slice(0,t)+"..."}return""}class bue{match(t){return typeof t=="object"&&t!==null}coerce(t,n){var r,a=this.getErrorPropertyFromObject(t);return a?n.apply(a):{type:this.getType(t),value:this.getValue(t),stack:(r=n.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(t.level)?t.level:"error",synthetic:!0}}getType(t){return u8(t)?t.constructor.name:"Error"}getValue(t){if("name"in t&&typeof t.name=="string"){var n="'"+t.name+"' captured as exception";return"message"in t&&typeof t.message=="string"&&(n+=" with message: '"+t.message+"'"),n}if("message"in t&&typeof t.message=="string")return t.message;var r=this.getObjectClassName(t);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+k8(t)}isSeverityLevel(t){return $n(t)&&!pk(t)&&gue.indexOf(t)>=0}getErrorPropertyFromObject(t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=t[n];if(eue(r))return r}}getObjectClassName(t){try{var n=Object.getPrototypeOf(t);return n?n.constructor.name:void 0}catch{return}}}class vue{match(t){return u8(t)}coerce(t,n){var r,a=t.constructor.name;return{type:a,value:a+" captured as exception with keys: "+k8(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class yue{match(t){return hk(t)}coerce(t,n){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(t),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}}}class xue{match(t){return hy(t,"PromiseRejectionEvent")}coerce(t,n){var r,a=this.getUnhandledRejectionReason(t);return hk(a)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(a),stack:(r=n.syntheticException)==null?void 0:r.stack,synthetic:!0}:n.apply(a)}getUnhandledRejectionReason(t){if(hk(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}}var N8=function(e,t){var{debugEnabled:n}=t===void 0?{}:t,r={k:function(a){if(ue&&(is.DEBUG||ze.POSTHOG_DEBUG||n)&&!Ae(ue.console)&&ue.console){for(var i=("__rrweb_original__"in ue.console[a])?ue.console[a].__rrweb_original__:ue.console[a],o=arguments.length,l=new Array(o>1?o-1:0),c=1;c<o;c++)l[c-1]=arguments[c];i(e,...l)}},info:function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];r.k("log",...i)},warn:function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];r.k("warn",...i)},error:function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];r.k("error",...i)},critical:function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];console.error(e,...i)},uninitializedWarning:a=>{r.error("You must initialize PostHog before calling "+a)},createLogger:(a,i)=>N8(e+" "+a,i)};return r},ke=N8("[PostHog.js]"),pn=ke.createLogger,wue=pn("[ExternalScriptsLoader]"),iB=(e,t,n)=>{if(e.config.disable_external_dependency_loading)return wue.warn(t+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var r=Se==null?void 0:Se.querySelectorAll("script");if(r){for(var a,i=function(){if(r[o].src===t){var c=r[o];return c.__posthog_loading_callback_fired?{v:n()}:(c.addEventListener("load",(d=>{c.__posthog_loading_callback_fired=!0,n(void 0,d)})),c.onerror=d=>n(d),{v:void 0})}},o=0;o<r.length;o++)if(a=i())return a.v}var l=()=>{if(!Se)return n("document not found");var c=Se.createElement("script");if(c.type="text/javascript",c.crossOrigin="anonymous",c.src=t,c.onload=p=>{c.__posthog_loading_callback_fired=!0,n(void 0,p)},c.onerror=p=>n(p),e.config.prepare_external_dependency_script&&(c=e.config.prepare_external_dependency_script(c)),!c)return n("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")Se.head.appendChild(c);else{var d,f=Se.querySelectorAll("body > script");f.length>0?(d=f[0].parentNode)==null||d.insertBefore(c,f[0]):Se.body.appendChild(c)}};Se!=null&&Se.body?l():Se==null||Se.addEventListener("DOMContentLoaded",l)};ze.__PosthogExtensions__=ze.__PosthogExtensions__||{},ze.__PosthogExtensions__.loadExternalDependency=(e,t,n)=>{var r="/static/"+t+".js?v="+e.version;if(t==="remote-config"&&(r="/array/"+e.config.token+"/config.js"),t==="toolbar"){var a=3e5;r=r+"&t="+Math.floor(Date.now()/a)*a}var i=e.requestRouter.endpointFor("assets",r);iB(e,i,n)},ze.__PosthogExtensions__.loadSiteApp=(e,t,n)=>{var r=e.requestRouter.endpointFor("api",t);iB(e,r,n)};var gy={};function ql(e,t,n){if(Nt(e)){if(YU&&e.forEach===YU)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,a=e.length;r<a;r++)if(r in e&&t.call(n,e[r],r)===gy)return}}}function Kt(e,t,n){if(!pt(e)){if(Nt(e))return ql(e,t,n);if($le(e)){for(var r of e.entries())if(t.call(n,r[1],r[0])===gy)return}else for(var a in e)if(l8.call(e,a)&&t.call(n,e[a],a)===gy)return}}var Nn=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ql(n,(function(a){for(var i in a)a[i]!==void 0&&(e[i]=a[i])})),e},kf=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return ql(n,(function(a){ql(a,(function(i){e.push(i)}))})),e};function Wv(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var oB=function(e){try{return e()}catch{return}},Eue=function(e){return function(){try{for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(a){ke.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),ke.critical(a)}}},KN=function(e){var t={};return Kt(e,(function(n,r){($n(n)&&n.length>0||ks(n))&&(t[r]=n)})),t};function _ue(e,t){return n=e,r=i=>$n(i)&&!Hi(t)?i.slice(0,t):i,a=new Set,(function i(o,l){return o!==Object(o)?r?r(o,l):o:a.has(o)?void 0:(a.add(o),Nt(o)?(c=[],ql(o,(d=>{c.push(i(d))}))):(c={},Kt(o,((d,f)=>{a.has(d)||(c[f]=i(d,f))}))),c);var c})(n);var n,r,a}var Sue=["herokuapp.com","vercel.app","netlify.app"];function Aue(e){var t=e==null?void 0:e.hostname;if(!$n(t))return!1;var n=t.split(".").slice(-2).join(".");for(var r of Sue)if(n===r)return!1;return!0}function O8(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}function jn(e,t,n,r){var{capture:a=!1,passive:i=!0}=r??{};e==null||e.addEventListener(t,n,{capture:a,passive:i})}function C8(e){return e.name==="ph_toolbar_internal"}var R8="$people_distinct_id",zh="__alias",Gh="__timers",sB="$autocapture_disabled_server_side",yk="$heatmaps_enabled_server_side",lB="$exception_capture_enabled_server_side",xk="$error_tracking_suppression_rules",uB="$error_tracking_capture_extension_exceptions",cB="$web_vitals_enabled_server_side",I8="$dead_clicks_enabled_server_side",dB="$product_tours_enabled_server_side",fB="$web_vitals_allowed_metrics",lv="$session_recording_remote_config",by="$sesid",D8="$session_is_sampled",qd="$enabled_feature_flags",Hh="$early_access_features",wk="$feature_flag_details",qh="$stored_person_properties",Bu="$stored_group_properties",Ek="$surveys",vy="$flag_call_reported",_k="$feature_flag_errors",yy="$feature_flag_evaluated_at",lo="$user_state",Sk="$client_session_props",Ak="$capture_rate_limit",Tk="$initial_campaign_params",kk="$initial_referrer_info",xy="$initial_person_info",wy="$epp",M8="__POSTHOG_TOOLBAR__",bh="$posthog_cookieless",Tue=[R8,zh,"__cmpns",Gh,"$session_recording_enabled_server_side",yk,by,qd,xk,lo,Hh,wk,Bu,qh,Ek,vy,_k,yy,Sk,Ak,Tk,kk,wy,xy];Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return ks(e)&&isFinite(e)&&Math.floor(e)===e});var pB="0123456789abcdef";class Ey{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,n,r,a){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(a)||t<0||n<0||r<0||a<0||t>0xffffffffffff||n>4095||r>1073741823||a>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=t/Math.pow(2,40),i[1]=t/Math.pow(2,32),i[2]=t/Math.pow(2,24),i[3]=t/Math.pow(2,16),i[4]=t/Math.pow(2,8),i[5]=t,i[6]=112|n>>>8,i[7]=n,i[8]=128|r>>>24,i[9]=r>>>16,i[10]=r>>>8,i[11]=r,i[12]=a>>>24,i[13]=a>>>16,i[14]=a>>>8,i[15]=a,new Ey(i)}toString(){for(var t="",n=0;n<this.bytes.length;n++)t=t+pB.charAt(this.bytes[n]>>>4)+pB.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Ey(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var n=0;n<16;n++){var r=this.bytes[n]-t.bytes[n];if(r!==0)return Math.sign(r)}return 0}}class kue{constructor(){this.P=0,this.T=0,this.C=new Nue}generate(){var t=this.generateOrAbort();if(Ae(t)){this.P=0;var n=this.generateOrAbort();if(Ae(n))throw new Error("Could not generate UUID after timestamp reset");return n}return t}generateOrAbort(){var t=Date.now();if(t>this.P)this.P=t,this.I();else{if(!(t+1e4>this.P))return;this.T++,this.T>4398046511103&&(this.P++,this.I())}return Ey.fromFieldsV7(this.P,Math.trunc(this.T/Math.pow(2,30)),this.T&Math.pow(2,30)-1,this.C.nextUint32())}I(){this.T=1024*this.C.nextUint32()+(1023&this.C.nextUint32())}}var hB,L8=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};ue&&!Ae(ue.crypto)&&crypto.getRandomValues&&(L8=e=>crypto.getRandomValues(e));class Nue{constructor(){this.R=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.R.length&&(L8(this.R),this.F=0),this.R[this.F++]}}var Bl=()=>Oue().toString(),Oue=()=>(hB||(hB=new kue)).generate(),vh="",Cue=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Rue(e,t){if(t){var n=(function(a,i){if(i===void 0&&(i=Se),vh)return vh;if(!i||["localhost","127.0.0.1"].includes(a))return"";for(var o=a.split("."),l=Math.min(o.length,8),c="dmn_chk_"+Bl();!vh&&l--;){var d=o.slice(l).join("."),f=c+"=1;domain=."+d+";path=/";i.cookie=f+";max-age=3",i.cookie.includes(c)&&(i.cookie=f+";max-age=0",vh=d)}return vh})(e);if(!n){var r=(a=>{var i=a.match(Cue);return i?i[0]:""})(e);r!==n&&ke.info("Warning: cookie subdomain discovery mismatch",r,n),n=r}return n?"; domain=."+n:""}return""}var go={O:()=>!!Se,M:function(e){ke.error("cookieStore error: "+e)},A:function(e){if(Se){try{for(var t=e+"=",n=Se.cookie.split(";").filter((i=>i.length)),r=0;r<n.length;r++){for(var a=n[r];a.charAt(0)==" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return decodeURIComponent(a.substring(t.length,a.length))}}catch{}return null}},D:function(e){var t;try{t=JSON.parse(go.A(e))||{}}catch{}return t},j:function(e,t,n,r,a){if(Se)try{var i="",o="",l=Rue(Se.location.hostname,r);if(n){var c=new Date;c.setTime(c.getTime()+24*n*60*60*1e3),i="; expires="+c.toUTCString()}a&&(o="; secure");var d=e+"="+encodeURIComponent(JSON.stringify(t))+i+"; SameSite=Lax; path=/"+l+o;return d.length>3686.4&&ke.warn("cookieStore warning: large cookie, len="+d.length),Se.cookie=d,d}catch{return}},L:function(e,t){if(Se!=null&&Se.cookie)try{go.j(e,"",-1,t)}catch{return}}},dS=null,dn={O:function(){if(!Hi(dS))return dS;var e=!0;if(Ae(ue))e=!1;else try{var t="__mplssupport__";dn.j(t,"xyz"),dn.A(t)!=='"xyz"'&&(e=!1),dn.L(t)}catch{e=!1}return e||ke.error("localStorage unsupported; falling back to cookie store"),dS=e,e},M:function(e){ke.error("localStorage error: "+e)},A:function(e){try{return ue==null?void 0:ue.localStorage.getItem(e)}catch(t){dn.M(t)}return null},D:function(e){try{return JSON.parse(dn.A(e))||{}}catch{}return null},j:function(e,t){try{ue==null||ue.localStorage.setItem(e,JSON.stringify(t))}catch(n){dn.M(n)}},L:function(e){try{ue==null||ue.localStorage.removeItem(e)}catch(t){dn.M(t)}}},Iue=["$device_id","distinct_id",by,D8,wy,xy,lo],uv={},Due={O:function(){return!0},M:function(e){ke.error("memoryStorage error: "+e)},A:function(e){return uv[e]||null},D:function(e){return uv[e]||null},j:function(e,t){uv[e]=t},L:function(e){delete uv[e]}},Pu=null,_r={O:function(){if(!Hi(Pu))return Pu;if(Pu=!0,Ae(ue))Pu=!1;else try{var e="__support__";_r.j(e,"xyz"),_r.A(e)!=='"xyz"'&&(Pu=!1),_r.L(e)}catch{Pu=!1}return Pu},M:function(e){ke.error("sessionStorage error: ",e)},A:function(e){try{return ue==null?void 0:ue.sessionStorage.getItem(e)}catch(t){_r.M(t)}return null},D:function(e){try{return JSON.parse(_r.A(e))||null}catch{}return null},j:function(e,t){try{ue==null||ue.sessionStorage.setItem(e,JSON.stringify(t))}catch(n){_r.M(n)}},L:function(e){try{ue==null||ue.sessionStorage.removeItem(e)}catch(t){_r.M(t)}}},ss=(function(e){return e[e.PENDING=-1]="PENDING",e[e.DENIED=0]="DENIED",e[e.GRANTED=1]="GRANTED",e})({});class Mue{constructor(t){this._instance=t}get N(){return this._instance.config}get consent(){return this.U()?ss.DENIED:this.H}isOptedOut(){return this.N.cookieless_mode==="always"||this.consent===ss.DENIED||this.consent===ss.PENDING&&(this.N.opt_out_capturing_by_default||this.N.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===ss.DENIED}optInOut(t){this.q.j(this.B,t?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.q.L(this.B,this.N.cross_subdomain_cookie)}get B(){var{token:t,opt_out_capturing_cookie_prefix:n,consent_persistence_name:r}=this._instance.config;return r||(n?n+t:"__ph_opt_in_out_"+t)}get H(){var t=this.q.A(this.B);return lS(t)?ss.GRANTED:ut(zle,t)?ss.DENIED:ss.PENDING}get q(){if(!this.W){var t=this.N.opt_out_capturing_persistence_type;this.W=t==="localStorage"?dn:go;var n=t==="localStorage"?go:dn;n.A(this.B)&&(this.W.A(this.B)||this.optInOut(lS(n.A(this.B))),n.L(this.B,this.N.cross_subdomain_cookie))}return this.W}U(){return!!this.N.respect_dnt&&!!O8([ja==null?void 0:ja.doNotTrack,ja==null?void 0:ja.msDoNotTrack,ze.doNotTrack],(t=>lS(t)))}}var cv=pn("[Dead Clicks]"),Lue=()=>!0,Pue=e=>{var t,n=!((t=e.instance.persistence)==null||!t.get_property(I8)),r=e.instance.config.capture_dead_clicks;return Es(r)?r:!!Vn(r)||n};class mB{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(t,n,r){this.instance=t,this.isEnabled=n,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(t){"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[I8]:t.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.V((()=>{this.J()})):this.stop()}V(t){var n,r;(n=ze.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&t(),(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(a=>{a?cv.error("failed to load script",a):t()}))}J(){var t;if(Se){if(!this.G&&(t=ze.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture){var n=Vn(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.G=ze.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.G.start(Se),cv.info("starting...")}}else cv.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,cv.info("stopping..."))}}var fS=pn("[SegmentIntegration]");function jue(e,t){var n=e.config.segment;if(!n)return t();(function(r,a){var i=r.config.segment;if(!i)return a();var o=c=>{var d=()=>c.anonymousId()||Bl();r.config.get_device_id=d,c.id()&&(r.register({distinct_id:c.id(),$device_id:d()}),r.persistence.set_property(lo,"identified")),a()},l=i.user();"then"in l&&gs(l.then)?l.then(o):o(l)})(e,(()=>{n.register((r=>{Promise&&Promise.resolve||fS.warn("This browser does not have Promise support, and can not use the segment integration");var a=(i,o)=>{if(!o)return i;i.event.userId||i.event.anonymousId===r.get_distinct_id()||(fS.info("No userId set, resetting PostHog"),r.reset()),i.event.userId&&i.event.userId!==r.get_distinct_id()&&(fS.info("UserId set, identifying with PostHog"),r.identify(i.event.userId));var l=r.calculateEventProperties(o,i.event.properties);return i.event.properties=Object.assign({},l,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:i=>a(i,i.event.event),page:i=>a(i,"$pageview"),identify:i=>a(i,"$identify"),screen:i=>a(i,"$screen")}})(e)).then((()=>{t()}))}))}var P8="posthog-js";function j8(e,t){var{organization:n,projectId:r,prefix:a,severityAllowList:i=["error"],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return l=>{var c,d,f,p,g;if(!(i==="*"||i.includes(l.level))||!e.__loaded)return l;l.tags||(l.tags={});var v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());l.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(l.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var x=((c=l.exception)==null?void 0:c.values)||[],w=x.map((S=>_e({},S,{stacktrace:S.stacktrace?_e({},S.stacktrace,{type:"raw",frames:(S.stacktrace.frames||[]).map((T=>_e({},T,{platform:"web:javascript"})))}):void 0}))),E={$exception_message:((d=x[0])==null?void 0:d.value)||l.message,$exception_type:(f=x[0])==null?void 0:f.type,$exception_level:l.level,$exception_list:w,$sentry_event_id:l.event_id,$sentry_exception:l.exception,$sentry_exception_message:((p=x[0])==null?void 0:p.value)||l.message,$sentry_exception_type:(g=x[0])==null?void 0:g.type,$sentry_tags:l.tags};return n&&r&&(E.$sentry_url=(a||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+l.event_id),o&&e.exceptions.sendExceptionEvent(E),l}}class Fue{constructor(t,n,r,a,i,o){this.name=P8,this.setupOnce=function(l){l(j8(t,{organization:n,projectId:r,prefix:a,severityAllowList:i,sendExceptionsToPostHog:o==null||o}))}}}var _y=e=>{var t=Se==null?void 0:Se.createElement("a");return Ae(t)?null:(t.href=e,t)},$ue=function(e,t){var n,r;t===void 0&&(t="&");var a=[];return Kt(e,(function(i,o){Ae(i)||Ae(o)||o==="undefined"||(n=encodeURIComponent((l=>l instanceof File)(i)?i.name:i.toString()),r=encodeURIComponent(o),a[a.length]=r+"="+n)})),a.join(t)},Sy=function(e,t){for(var n,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),a=0;a<r.length;a++){var i=r[a].split("=");if(i[0]===t){n=i;break}}if(!Nt(n)||n.length<2)return"";var o=n[1];try{o=decodeURIComponent(o)}catch{ke.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},mm=function(e,t,n){if(!e||!t||!t.length)return e;for(var r=e.split("#"),a=r[0]||"",i=r[1],o=a.split("?"),l=o[1],c=o[0],d=(l||"").split("&"),f=[],p=0;p<d.length;p++){var g=d[p].split("=");Nt(g)&&(t.includes(g[0])?f.push(g[0]+"="+n):f.push(d[p]))}var v=c;return l!=null&&(v+="?"+f.join("&")),i!=null&&(v+="#"+i),v},Ay=function(e,t){var n=e.match(new RegExp(t+"=([^&]*)"));return n?n[1]:null},Uue=ue!=null&&ue.location?Ay(ue.location.hash,"__posthog")||Ay(location.hash,"state"):null,gB="_postHogToolbarParams",bB=pn("[Toolbar]"),Tl=(function(e){return e[e.UNINITIALIZED=0]="UNINITIALIZED",e[e.LOADING=1]="LOADING",e[e.LOADED=2]="LOADED",e})(Tl||{});class Bue{constructor(t){this.instance=t}K(t){ze.ph_toolbar_state=t}Y(){var t;return(t=ze.ph_toolbar_state)!==null&&t!==void 0?t:Tl.UNINITIALIZED}maybeLoadToolbar(t,n,r){if(t===void 0&&(t=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),C8(this.instance.config)||!ue||!Se)return!1;t=t??ue.location,r=r??ue.history;try{if(!n){try{ue.localStorage.setItem("test","test"),ue.localStorage.removeItem("test")}catch{return!1}n=ue==null?void 0:ue.localStorage}var a,i=Uue||Ay(t.hash,"__posthog")||Ay(t.hash,"state"),o=i?oB((()=>JSON.parse(atob(decodeURIComponent(i)))))||oB((()=>JSON.parse(decodeURIComponent(i)))):null;return o&&o.action==="ph_authorize"?((a=o).source="url",a&&Object.keys(a).length>0&&(o.desiredHash?t.hash=o.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((a=JSON.parse(n.getItem(gB)||"{}")).source="localstorage",delete a.userIntent),!(!a.token||this.instance.config.token!==a.token)&&(this.loadToolbar(a),!0)}catch{return!1}}X(t){var n=ze.ph_load_toolbar||ze.ph_load_editor;!pt(n)&&gs(n)?n(t,this.instance):bB.warn("No toolbar load function found")}loadToolbar(t){var n=!(Se==null||!Se.getElementById(M8));if(!ue||n)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,a=_e({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(ue.localStorage.setItem(gB,JSON.stringify(_e({},a,{source:void 0}))),this.Y()===Tl.LOADED)this.X(a);else if(this.Y()===Tl.UNINITIALIZED){var i;this.K(Tl.LOADING),(i=ze.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",(o=>{if(o)return bB.error("[Toolbar] Failed to load",o),void this.K(Tl.UNINITIALIZED);this.K(Tl.LOADED),this.X(a)})),jn(ue,"turbolinks:load",(()=>{this.K(Tl.UNINITIALIZED),this.loadToolbar(a)}))}return!0}Z(t){return this.loadToolbar(t)}maybeLoadEditor(t,n,r){return t===void 0&&(t=void 0),n===void 0&&(n=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(t,n,r)}}class vB{constructor(t){this.tt=(n,r,a)=>{a&&(a.noSessionId||a.activityTimeout||a.sessionPastMaximumLength)&&(ke.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:a}),this.it=void 0,this._instance.scrollManager.resetContext())},this._instance=t,this.et()}et(){var t;this.rt=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(this.tt)}destroy(){var t;(t=this.rt)==null||t.call(this),this.rt=void 0}doPageView(t,n){var r,a=this.st(t,n);return this.it={pathname:(r=ue==null?void 0:ue.location.pathname)!==null&&r!==void 0?r:"",pageViewId:n,timestamp:t},this._instance.scrollManager.resetContext(),a}doPageLeave(t){var n;return this.st(t,(n=this.it)==null?void 0:n.pageViewId)}doEvent(){var t;return{$pageview_id:(t=this.it)==null?void 0:t.pageViewId}}st(t,n){var r=this.it;if(!r)return{$pageview_id:n};var a={$pageview_id:n,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:o,lastScrollY:l,maxScrollY:c,maxContentHeight:d,lastContentY:f,maxContentY:p}=i;if(!(Ae(o)||Ae(l)||Ae(c)||Ae(d)||Ae(f)||Ae(p))){o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),d=Math.ceil(d),f=Math.ceil(f),p=Math.ceil(p);var g=o<=1?1:vo(l/o,0,1,ke),v=o<=1?1:vo(c/o,0,1,ke),x=d<=1?1:vo(f/d,0,1,ke),w=d<=1?1:vo(p/d,0,1,ke);a=Nn(a,{$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:g,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:v,$prev_pageview_last_content:f,$prev_pageview_last_content_percentage:x,$prev_pageview_max_content:p,$prev_pageview_max_content_percentage:w})}}return r.pathname&&(a.$prev_pageview_pathname=r.pathname),r.timestamp&&(a.$prev_pageview_duration=(t.getTime()-r.timestamp.getTime())/1e3),a}}var hs=(function(e){return e.GZipJS="gzip-js",e.Base64="base64",e})({}),fi=Uint8Array,xa=Uint16Array,Nf=Uint32Array,XN=new fi([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]),ZN=new fi([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]),yB=new fi([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),F8=function(e,t){for(var n=new xa(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var a=new Nf(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)a[i]=i-n[r]<<5|r;return[n,a]},$8=F8(XN,2),zue=$8[0],Nk=$8[1];zue[28]=258,Nk[258]=28;for(var xB=F8(ZN,0)[1],U8=new xa(32768),tn=0;tn<32768;++tn){var ju=(43690&tn)>>>1|(21845&tn)<<1;ju=(61680&(ju=(52428&ju)>>>2|(13107&ju)<<2))>>>4|(3855&ju)<<4,U8[tn]=((65280&ju)>>>8|(255&ju)<<8)>>>1}var em=function(e,t,n){for(var r=e.length,a=0,i=new xa(t);a<r;++a)++i[e[a]-1];var o,l=new xa(t);for(a=0;a<t;++a)l[a]=l[a-1]+i[a-1]<<1;for(o=new xa(r),a=0;a<r;++a)o[a]=U8[l[e[a]-1]++]>>>15-e[a];return o},fc=new fi(288);for(tn=0;tn<144;++tn)fc[tn]=8;for(tn=144;tn<256;++tn)fc[tn]=9;for(tn=256;tn<280;++tn)fc[tn]=7;for(tn=280;tn<288;++tn)fc[tn]=8;var Ty=new fi(32);for(tn=0;tn<32;++tn)Ty[tn]=5;var Gue=em(fc,9),Hue=em(Ty,5),B8=function(e){return(e/8>>0)+(7&e&&1)},z8=function(e,t,n){(n==null||n>e.length)&&(n=e.length);var r=new(e instanceof xa?xa:e instanceof Nf?Nf:fi)(n-t);return r.set(e.subarray(t,n)),r},ns=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},yh=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},pS=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var a=n.length,i=n.slice();if(!a)return[new fi(0),0];if(a==1){var o=new fi(n[0].s+1);return o[n[0].s]=1,[o,1]}n.sort((function(C,O){return C.f-O.f})),n.push({s:-1,f:25001});var l=n[0],c=n[1],d=0,f=1,p=2;for(n[0]={s:-1,f:l.f+c.f,l,r:c};f!=a-1;)l=n[n[d].f<n[p].f?d++:p++],c=n[d!=f&&n[d].f<n[p].f?d++:p++],n[f++]={s:-1,f:l.f+c.f,l,r:c};var g=i[0].s;for(r=1;r<a;++r)i[r].s>g&&(g=i[r].s);var v=new xa(g+1),x=Ok(n[f-1],v,0);if(x>t){r=0;var w=0,E=x-t,S=1<<E;for(i.sort((function(C,O){return v[O.s]-v[C.s]||C.f-O.f}));r<a;++r){var T=i[r].s;if(!(v[T]>t))break;w+=S-(1<<x-v[T]),v[T]=t}for(w>>>=E;w>0;){var k=i[r].s;v[k]<t?w-=1<<t-v[k]++-1:++r}for(;r>=0&&w;--r){var N=i[r].s;v[N]==t&&(--v[N],++w)}x=t}return[new fi(v),x]},Ok=function(e,t,n){return e.s==-1?Math.max(Ok(e.l,t,n+1),Ok(e.r,t,n+1)):t[e.s]=n},wB=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new xa(++t),r=0,a=e[0],i=1,o=function(c){n[r++]=c},l=1;l<=t;++l)if(e[l]==a&&l!=t)++i;else{if(!a&&i>2){for(;i>138;i-=138)o(32754);i>2&&(o(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(o(a),--i;i>6;i-=6)o(8304);i>2&&(o(i-3<<5|8208),i=0)}for(;i--;)o(a);i=1,a=e[l]}return[n.subarray(0,r),t]},xh=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},Ck=function(e,t,n){var r=n.length,a=B8(t+2);e[a]=255&r,e[a+1]=r>>>8,e[a+2]=255^e[a],e[a+3]=255^e[a+1];for(var i=0;i<r;++i)e[a+i+4]=n[i];return 8*(a+4+r)},EB=function(e,t,n,r,a,i,o,l,c,d,f){ns(t,f++,n),++a[256];for(var p=pS(a,15),g=p[0],v=p[1],x=pS(i,15),w=x[0],E=x[1],S=wB(g),T=S[0],k=S[1],N=wB(w),C=N[0],O=N[1],I=new xa(19),D=0;D<T.length;++D)I[31&T[D]]++;for(D=0;D<C.length;++D)I[31&C[D]]++;for(var B=pS(I,7),L=B[0],q=B[1],U=19;U>4&&!L[yB[U-1]];--U);var X,z,V,F,G=d+5<<3,Y=xh(a,fc)+xh(i,Ty)+o,Q=xh(a,g)+xh(i,w)+o+14+3*U+xh(I,L)+(2*I[16]+3*I[17]+7*I[18]);if(G<=Y&&G<=Q)return Ck(t,f,e.subarray(c,c+d));if(ns(t,f,1+(Q<Y)),f+=2,Q<Y){X=em(g,v),z=g,V=em(w,E),F=w;var M=em(L,q);for(ns(t,f,k-257),ns(t,f+5,O-1),ns(t,f+10,U-4),f+=14,D=0;D<U;++D)ns(t,f+3*D,L[yB[D]]);f+=3*U;for(var H=[T,C],J=0;J<2;++J){var P=H[J];for(D=0;D<P.length;++D){var se=31&P[D];ns(t,f,M[se]),f+=L[se],se>15&&(ns(t,f,P[D]>>>5&127),f+=P[D]>>>12)}}}else X=Gue,z=fc,V=Hue,F=Ty;for(D=0;D<l;++D)if(r[D]>255){se=r[D]>>>18&31,yh(t,f,X[se+257]),f+=z[se+257],se>7&&(ns(t,f,r[D]>>>23&31),f+=XN[se]);var pe=31&r[D];yh(t,f,V[pe]),f+=F[pe],pe>3&&(yh(t,f,r[D]>>>5&8191),f+=ZN[pe])}else yh(t,f,X[r[D]]),f+=z[r[D]];return yh(t,f,X[256]),f+z[256]},que=new Nf([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Vue=(function(){for(var e=new Nf(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e})(),Wue=function(e,t,n,r,a){return(function(i,o,l,c,d,f){var p=i.length,g=new fi(c+p+5*(1+Math.floor(p/7e3))+d),v=g.subarray(c,g.length-d),x=0;if(!o||p<8)for(var w=0;w<=p;w+=65535){var E=w+65535;E<p?x=Ck(v,x,i.subarray(w,E)):(v[w]=f,x=Ck(v,x,i.subarray(w,p)))}else{for(var S=que[o-1],T=S>>>13,k=8191&S,N=(1<<l)-1,C=new xa(32768),O=new xa(N+1),I=Math.ceil(l/3),D=2*I,B=function(wt){return(i[wt]^i[wt+1]<<I^i[wt+2]<<D)&N},L=new Nf(25e3),q=new xa(288),U=new xa(32),X=0,z=0,V=(w=0,0),F=0,G=0;w<p;++w){var Y=B(w),Q=32767&w,M=O[Y];if(C[Q]=M,O[Y]=Q,F<=w){var H=p-w;if((X>7e3||V>24576)&&H>423){x=EB(i,v,0,L,q,U,z,V,G,w-G,x),V=X=z=0,G=w;for(var J=0;J<286;++J)q[J]=0;for(J=0;J<30;++J)U[J]=0}var P=2,se=0,pe=k,me=Q-M&32767;if(H>2&&Y==B(w-me))for(var ne=Math.min(T,H)-1,he=Math.min(32767,w),ee=Math.min(258,H);me<=he&&--pe&&Q!=M;){if(i[w+P]==i[w+P-me]){for(var ve=0;ve<ee&&i[w+ve]==i[w+ve-me];++ve);if(ve>P){if(P=ve,se=me,ve>ne)break;var we=Math.min(me,ve-2),le=0;for(J=0;J<we;++J){var Ye=w-me+J+32768&32767,Fe=Ye-C[Ye]+32768&32767;Fe>le&&(le=Fe,M=Ye)}}}me+=(Q=M)-(M=C[Q])+32768&32767}if(se){L[V++]=268435456|Nk[P]<<18|xB[se];var bt=31&Nk[P],at=31&xB[se];z+=XN[bt]+ZN[at],++q[257+bt],++U[at],F=w+P,++X}else L[V++]=i[w],++q[i[w]]}}x=EB(i,v,f,L,q,U,z,V,G,w-G,x)}return z8(g,0,c+B8(x)+d)})(e,t.level==null?6:t.level,t.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):12+t.mem,n,r,!0)},hS=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8};function Yue(e,t){t===void 0&&(t={});var n=(function(){var l=4294967295;return{p:function(c){for(var d=l,f=0;f<c.length;++f)d=Vue[255&d^c[f]]^d>>>8;l=d},d:function(){return 4294967295^l}}})(),r=e.length;n.p(e);var a,i=Wue(e,t,10+((a=t).filename&&a.filename.length+1||0),8),o=i.length;return(function(l,c){var d=c.filename;if(l[0]=31,l[1]=139,l[2]=8,l[8]=c.level<2?4:c.level==9?2:0,l[9]=3,c.mtime!=0&&hS(l,4,Math.floor(new Date(c.mtime||Date.now())/1e3)),d){l[3]=8;for(var f=0;f<=d.length;++f)l[f+10]=d.charCodeAt(f)}})(i,t),hS(i,o-8,n.d()),hS(i,o-4,r),i}var Kue=function(e){var t,n,r,a,i="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,`
63
63
  `).replace(/\r/g,`
64
- `)).length,a=0;a<r;a++){var o=e.charCodeAt(a),l=null;o<128?n++:l=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Hi(l)||(n>t&&(i+=e.substring(t,n)),i+=l,t=n=a+1)}return n>t&&(i+=e.substring(t,e.length)),i},Xue=!!dk||!!ck,ky=function(e,t,n){var r;n===void 0&&(n=!0);var[a,i]=e.split("?"),o=_e({},t),l=(r=i==null?void 0:i.split("&").map((d=>{var f,[p,g]=d.split("="),v=n&&(f=o[p])!==null&&f!==void 0?f:g;return delete o[p],p+"="+v})))!==null&&r!==void 0?r:[],c=$ue(o);return c&&l.push(c),a+"?"+l.join("&")},Vh=(e,t)=>JSON.stringify(e,((n,r)=>typeof r=="bigint"?r.toString():r),t),mS=e=>{var{data:t,compression:n}=e;if(t){if(n===hs.GZipJS){var r=Yue((function(l,c){var d=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var f=new fi(l.length+(l.length>>>1)),p=0,g=function(E){f[p++]=E},v=0;v<d;++v){if(p+5>f.length){var x=new fi(p+8+(d-v<<1));x.set(f),f=x}var w=l.charCodeAt(v);w<128||c?g(w):w<2048?(g(192|w>>>6),g(128|63&w)):w>55295&&w<57344?(g(240|(w=65536+(1047552&w)|1023&l.charCodeAt(++v))>>>18),g(128|w>>>12&63),g(128|w>>>6&63),g(128|63&w)):(g(224|w>>>12),g(128|w>>>6&63),g(128|63&w))}return z8(f,0,p)})(Vh(t)),{mtime:0});return{contentType:"text/plain",body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===hs.Base64){var a=(function(l){var c,d,f,p,g,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",x=0,w=0,E="",S=[];if(!l)return l;l=Kue(l);do c=(g=l.charCodeAt(x++)<<16|l.charCodeAt(x++)<<8|l.charCodeAt(x++))>>18&63,d=g>>12&63,f=g>>6&63,p=63&g,S[w++]=v.charAt(c)+v.charAt(d)+v.charAt(f)+v.charAt(p);while(x<l.length);switch(E=S.join(""),l.length%3){case 1:E=E.slice(0,-2)+"==";break;case 2:E=E.slice(0,-1)+"="}return E})(Vh(t)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Vh(l)))(a);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var o=Vh(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Yv=[];ck&&Yv.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:a,estimatedSize:i}=(t=mS(e))!==null&&t!==void 0?t:{},o=new Headers;Kt(e.headers,(function(f,p){o.append(p,f)})),r&&o.append("Content-Type",r);var l=e.url,c=null;if(XU){var d=new XU;c={signal:d.signal,timeout:setTimeout((()=>d.abort()),e.timeout)}}ck(l,_e({method:(e==null?void 0:e.method)||"GET",headers:o,keepalive:e.method==="POST"&&(i||0)<52428.8,body:a,signal:(n=c)==null?void 0:n.signal},e.fetchOptions)).then((f=>f.text().then((p=>{var g={statusCode:f.status,text:p};if(f.status===200)try{g.json=JSON.parse(p)}catch(v){ke.error(v)}e.callback==null||e.callback(g)})))).catch((f=>{ke.error(f),e.callback==null||e.callback({statusCode:0,error:f})})).finally((()=>c?clearTimeout(c.timeout):null))}}),dk&&Yv.push({transport:"XHR",method:e=>{var t,n=new dk;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:a}=(t=mS(e))!==null&&t!==void 0?t:{};Kt(e.headers,(function(i,o){n.setRequestHeader(o,i)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var i={statusCode:n.status,text:n.responseText};if(n.status===200)try{i.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(i)}},n.send(a)}}),ja!=null&&ja.sendBeacon&&Yv.push({transport:"sendBeacon",method:e=>{var t=ky(e.url,{beacon:"1"});try{var n,{contentType:r,body:a}=(n=mS(e))!==null&&n!==void 0?n:{},i=typeof a=="string"?new Blob([a],{type:r}):a;ja.sendBeacon(t,i)}catch{}}});var Ny=function(e,t){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function _B(e,t,n){return Vh({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var G8={exact:(e,t)=>t.some((n=>e.some((r=>n===r)))),is_not:(e,t)=>t.every((n=>e.every((r=>n!==r)))),regex:(e,t)=>t.some((n=>e.some((r=>Ny(n,r))))),not_regex:(e,t)=>t.every((n=>e.every((r=>!Ny(n,r))))),icontains:(e,t)=>t.map(dv).some((n=>e.map(dv).some((r=>n.includes(r))))),not_icontains:(e,t)=>t.map(dv).every((n=>e.map(dv).every((r=>!n.includes(r))))),gt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((a=>r>parseFloat(a)))})),lt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((a=>r<parseFloat(a)))}))},dv=e=>e.toLowerCase();function H8(e,t){return!e||Object.entries(e).every((n=>{var[r,a]=n,i=t==null?void 0:t[r];if(Ae(i)||Hi(i))return!1;var o=[String(i)],l=G8[a.operator];return!!l&&l(a.values,o)}))}var gS=pn("[Error tracking]");class Zue{constructor(t){var n,r;this.nt=[],this.ot=new nue([new due,new xue,new pue,new fue,new vue,new bue,new mue,new yue],cue()),this._instance=t,this.nt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(xk))!==null&&n!==void 0?n:[]}onRemoteConfig(t){var n,r,a;if("errorTracking"in t){var i=(n=(r=t.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],o=(a=t.errorTracking)==null?void 0:a.captureExtensionExceptions;this.nt=i,this._instance.persistence&&this._instance.persistence.register({[xk]:this.nt,[uB]:o})}}get ut(){var t,n=!!this._instance.get_property(uB),r=this._instance.config.error_tracking.captureExtensionExceptions;return(t=r??n)!==null&&t!==void 0&&t}buildProperties(t,n){return this.ot.buildFromUnknown(t,{syntheticException:n==null?void 0:n.syntheticException,mechanism:{handled:n==null?void 0:n.handled}})}sendExceptionEvent(t){var n=t.$exception_list;if(this.ht(n)){if(this.dt(n))return void gS.info("Skipping exception capture because a suppression rule matched");if(!this.ut&&this.vt(n))return void gS.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ct(n))return void gS.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",ft:!0})}dt(t){if(t.length===0)return!1;var n=t.reduce(((r,a)=>{var{type:i,value:o}=a;return $n(i)&&i.length>0&&r.$exception_types.push(i),$n(o)&&o.length>0&&r.$exception_values.push(o),r}),{$exception_types:[],$exception_values:[]});return this.nt.some((r=>{var a=r.values.map((i=>{var o,l=G8[i.operator],c=Nt(i.value)?i.value:[i.value],d=(o=n[i.key])!==null&&o!==void 0?o:[];return c.length>0&&l(c,d)}));return r.type==="OR"?a.some(Boolean):a.every(Boolean)}))}vt(t){return t.flatMap((n=>{var r,a;return(r=(a=n.stacktrace)==null?void 0:a.frames)!==null&&r!==void 0?r:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ct(t){if(t.length>0){var n,r,a,i,o=(n=(r=t[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],l=o[o.length-1];return(a=l==null||(i=l.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&a!==void 0&&a}return!1}ht(t){return!pt(t)&&Nt(t)}}var fv="https?://(.*)",Of=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Que=kf(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Of),gm="<masked>",Jue=["li_fat_id"];function q8(e,t,n){if(!Se)return{};var r,a=t?kf([],Of,n||[]):[],i=V8(mm(Se.URL,a,gm),e),o=(r={},Kt(Jue,(function(l){var c=go.A(l);r[l]=c||null})),r);return Nn(o,i)}function V8(e,t){var n=Que.concat(t||[]),r={};return Kt(n,(function(a){var i=Sy(e,a);r[a]=i||null})),r}function W8(e){var t=(function(i){return i?i.search(fv+"google.([^/?]*)")===0?"google":i.search(fv+"bing.com")===0?"bing":i.search(fv+"yahoo.com")===0?"yahoo":i.search(fv+"duckduckgo.com")===0?"duckduckgo":null:null})(e),n=t!="yahoo"?"q":"p",r={};if(!Hi(t)){r.$search_engine=t;var a=Se?Sy(Se.referrer,n):"";a.length&&(r.ph_keyword=a)}return r}function SB(){return navigator.language||navigator.userLanguage}function Y8(){return(Se==null?void 0:Se.referrer)||"$direct"}function K8(e,t){var n=e?kf([],Of,t||[]):[],r=Sr==null?void 0:Sr.href.substring(0,1e3);return{r:Y8().substring(0,1e3),u:r?mm(r,n,gm):void 0}}function X8(e){var t,{r:n,u:r}=e,a={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=_y(n))==null?void 0:t.host};if(r){a.$current_url=r;var i=_y(r);a.$host=i==null?void 0:i.host,a.$pathname=i==null?void 0:i.pathname;var o=V8(r);Nn(a,o)}if(n){var l=W8(n);Nn(a,l)}return a}function Z8(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function ece(){try{return new Date().getTimezoneOffset()}catch{return}}function tce(e,t){var n,r;if(!ya)return{};var a,i,o=e?kf([],Of,t||[]):[],[l,c]=(function(S){for(var T=0;T<tB.length;T++){var[k,N]=tB[T],C=k.exec(S),O=C&&(gs(N)?N(C,S):N);if(O)return O}return["",""]})(ya),d=(a=nB(ya))===d8||a===c8||a==="Kobo"||a==="Kindle Fire"||a===S8?dm:a===pm||a===Zd||a===hm||a===gk?"Console":a===p8?"Wearable":a?di:"Desktop";if(d==="Desktop"&&((n=navigator)==null||(n=n.userAgentData)==null?void 0:n.platform)==="Android"&&((r=navigator)==null?void 0:r.maxTouchPoints)>0){var f,p,g,v,x,w=(f=ue==null||(p=ue.screen)==null?void 0:p.width)!==null&&f!==void 0?f:0,E=(g=ue==null||(v=ue.screen)==null?void 0:v.height)!==null&&g!==void 0?g:0;d=Math.min(w,E)/((x=ue==null?void 0:ue.devicePixelRatio)!==null&&x!==void 0?x:1)>=600?"Tablet":"Mobile"}return Nn(KN({$os:l,$os_version:c,$browser:A8(ya,navigator.vendor),$device:nB(ya),$device_type:d,$timezone:Z8(),$timezone_offset:ece()}),{$current_url:mm(Sr==null?void 0:Sr.href,o,gm),$host:Sr==null?void 0:Sr.host,$pathname:Sr==null?void 0:Sr.pathname,$raw_user_agent:ya.length>1e3?ya.substring(0,997)+"...":ya,$browser_version:Jle(ya,navigator.vendor),$browser_language:SB(),$browser_language_prefix:(i=SB(),typeof i=="string"?i.split("-")[0]:void 0),$screen_height:ue==null?void 0:ue.screen.height,$screen_width:ue==null?void 0:ue.screen.width,$viewport_height:ue==null?void 0:ue.innerHeight,$viewport_width:ue==null?void 0:ue.innerWidth,$lib:"web",$lib_version:is.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var ha=pn("[FeatureFlags]"),wh=pn("[FeatureFlags]",{debugEnabled:!0}),nce="errors_while_computing_flags",rce="flag_missing",ace="quota_limited",ice="timeout",oce="connection_error",sce="unknown_error",lce=e=>"api_error_"+e,bS="$active_feature_flags",Nd="$override_feature_flags",AB="$feature_flag_payloads",Eh="$override_feature_flag_payloads",TB="$feature_flag_request_id",kB=e=>{var t={};for(var[n,r]of Wv(e||{}))r&&(t[n]=r);return t},uce=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((n=>{var r;return[n,(r=t[n].variant)!==null&&r!==void 0?r:t[n].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((n=>t[n].enabled)).filter((n=>{var r;return(r=t[n].metadata)==null?void 0:r.payload})).map((n=>{var r;return[n,(r=t[n].metadata)==null?void 0:r.payload]})))):ha.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},cce=(function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e})({});class dce{constructor(t){this._t=!1,this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.Et=!1,this.St=!1,this._instance=t,this.featureFlagEventHandlers=[]}kt(){var t,n;return(t=(n=this._instance.persistence)==null?void 0:n.Pt(this._instance.config.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Tt(){return!!this.kt()&&(this.St||this.yt||(this.St=!0,ha.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ct(){var t,n=(t=this._instance.config.evaluation_contexts)!==null&&t!==void 0?t:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.Et||(ha.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Et=!0),n!=null&&n.length?n.filter((r=>{var a=r&&typeof r=="string"&&r.trim().length>0;return a||ha.error("Invalid evaluation context found:",r,"Expected non-empty string"),a})):[]}It(){return this.Ct().length>0}get hasLoadedFlags(){return this.bt}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(wk),n=this._instance.get_property(Nd),r=this._instance.get_property(Eh);if(!r&&!n)return t||{};var a=Nn({},t||{}),i=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var o of i){var l,c,d=a[o],f=n==null?void 0:n[o],p=Ae(f)?(l=d==null?void 0:d.enabled)!==null&&l!==void 0&&l:!!f,g=Ae(f)?d.variant:typeof f=="string"?f:void 0,v=r==null?void 0:r[o],x=_e({},d,{enabled:p,variant:p?g??(d==null?void 0:d.variant):void 0});p!==(d==null?void 0:d.enabled)&&(x.original_enabled=d==null?void 0:d.enabled),g!==(d==null?void 0:d.variant)&&(x.original_variant=d==null?void 0:d.variant),v&&(x.metadata=_e({},d==null?void 0:d.metadata,{payload:v,original_payload:d==null||(c=d.metadata)==null?void 0:c.payload})),a[o]=x}return this._t||(ha.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:a}),this._t=!0),a}getFlagVariants(){var t=this._instance.get_property(qd),n=this._instance.get_property(Nd);if(!n)return t||{};for(var r=Nn({},t),a=Object.keys(n),i=0;i<a.length;i++)r[a[i]]=n[a[i]];return this._t||(ha.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:n,finalFlags:r}),this._t=!0),r}getFlagPayloads(){var t=this._instance.get_property(AB),n=this._instance.get_property(Eh);if(!n)return t||{};for(var r=Nn({},t||{}),a=Object.keys(n),i=0;i<a.length;i++)r[a[i]]=n[a[i]];return this._t||(ha.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:n,finalPayloads:r}),this._t=!0),r}reloadFeatureFlags(){this.wt||this._instance.config.advanced_disable_feature_flags||this.Rt||(this._instance.Ft.emit("featureFlagsReloading",!0),this.Rt=setTimeout((()=>{this.Ot()}),5))}Mt(){clearTimeout(this.Rt),this.Rt=void 0}ensureFlagsLoaded(){this.bt||this.yt||this.Rt||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.wt=t}Ot(t){var n;if(this.Mt(),!this._instance.At())if(this.yt)this.xt=!0;else{var r=this._instance.config.token,a=this._instance.get_property("$device_id"),i={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:_e({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(qh)||{}),group_properties:this._instance.get_property(Bu),timezone:Z8()};Hi(a)||Ae(a)||(i.$device_id=a),(t!=null&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.It()&&(i.evaluation_contexts=this.Ct());var o=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+o);this.yt=!0,this._instance._send_request({method:"POST",url:l,data:i,compression:this._instance.config.disable_compression?void 0:hs.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:c=>{var d,f,p,g=!0;if(c.statusCode===200&&(this.xt||(this.$anon_distinct_id=void 0),g=!1),this.yt=!1,!i.disable_flags||this.xt){this.$t=!g;var v=[];c.error?c.error instanceof Error?v.push(c.error.name==="AbortError"?ice:oce):v.push(sce):c.statusCode!==200&&v.push(lce(c.statusCode)),(d=c.json)!=null&&d.errorsWhileComputingFlags&&v.push(nce);var x=!((f=c.json)==null||(f=f.quotaLimited)==null||!f.includes(cce.FeatureFlags));if(x&&v.push(ace),(p=this._instance.persistence)==null||p.register({[_k]:v}),x)ha.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 w;i.disable_flags||this.receivedFeatureFlags((w=c.json)!==null&&w!==void 0?w:{},g),this.xt&&(this.xt=!1,this.Ot())}}}})}}getFeatureFlag(t,n){var r;if(n===void 0&&(n={}),!n.fresh||this.$t)if(this.bt||this.getFlags()&&this.getFlags().length>0){if(!this.Tt()){var a=this.getFeatureFlagResult(t,n);return(r=a==null?void 0:a.variant)!==null&&r!==void 0?r:a==null?void 0:a.enabled}}else ha.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var n=this.getFeatureFlagResult(t,{send_event:!1});return n==null?void 0:n.payload}getFeatureFlagResult(t,n){if(n===void 0&&(n={}),!n.fresh||this.$t)if(this.bt||this.getFlags()&&this.getFlags().length>0){if(!this.Tt()){var r=this.getFlagVariants(),a=t in r,i=r[t],o=this.getFlagPayloads()[t],l=String(i),c=this._instance.get_property(TB)||void 0,d=this._instance.get_property(yy)||void 0,f=this._instance.get_property(vy)||{};if((n.send_event||!("send_event"in n))&&(!(t in f)||!f[t].includes(l))){var p,g,v,x,w,E,S,T,k,N;Nt(f[t])?f[t].push(l):f[t]=[l],(p=this._instance.persistence)==null||p.register({[vy]:f});var C=this.getFeatureFlagDetails(t),O=[...(g=this._instance.get_property(_k))!==null&&g!==void 0?g:[]];Ae(i)&&O.push(rce);var I={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:o||null,$feature_flag_request_id:c,$feature_flag_evaluated_at:d,$feature_flag_bootstrapped_response:((v=this._instance.config.bootstrap)==null||(v=v.featureFlags)==null?void 0:v[t])||null,$feature_flag_bootstrapped_payload:((x=this._instance.config.bootstrap)==null||(x=x.featureFlagPayloads)==null?void 0:x[t])||null,$used_bootstrap_value:!this.$t};Ae(C==null||(w=C.metadata)==null?void 0:w.version)||(I.$feature_flag_version=C.metadata.version);var D,B=(E=C==null||(S=C.reason)==null?void 0:S.description)!==null&&E!==void 0?E:C==null||(T=C.reason)==null?void 0:T.code;B&&(I.$feature_flag_reason=B),C!=null&&(k=C.metadata)!=null&&k.id&&(I.$feature_flag_id=C.metadata.id),Ae(C==null?void 0:C.original_variant)&&Ae(C==null?void 0:C.original_enabled)||(I.$feature_flag_original_response=Ae(C.original_variant)?C.original_enabled:C.original_variant),C!=null&&(N=C.metadata)!=null&&N.original_payload&&(I.$feature_flag_original_payload=C==null||(D=C.metadata)==null?void 0:D.original_payload),O.length&&(I.$feature_flag_error=O.join(",")),this._instance.capture("$feature_flag_called",I)}if(a){var L=o;if(!Ae(o))try{L=JSON.parse(o)}catch{}return{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:L}}}}else ha.warn('getFeatureFlagResult for key "'+t+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(t,n){var r=this._instance.config.token,a={distinct_id:this._instance.get_distinct_id(),token:r};this.It()&&(a.evaluation_contexts=this.Ct()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:a,compression:this._instance.config.disable_compression?void 0:hs.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var o,l=(o=i.json)==null?void 0:o.featureFlagPayloads;n((l==null?void 0:l[t])||void 0)}})}isFeatureEnabled(t,n){if(n===void 0&&(n={}),!n.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,n);return Ae(r)?void 0:!!r}ha.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==t))}receivedFeatureFlags(t,n){if(this._instance.persistence){this.bt=!0;var r=this.getFlagVariants(),a=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(o,l,c,d,f){c===void 0&&(c={}),d===void 0&&(d={}),f===void 0&&(f={});var p=uce(o),g=p.flags,v=p.featureFlags,x=p.featureFlagPayloads;if(v){var w=o.requestId,E=o.evaluatedAt;if(Nt(v)){ha.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var S={};if(v)for(var T=0;T<v.length;T++)S[v[T]]=!0;l&&l.register({[bS]:v,[qd]:S})}else{var k=v,N=x,C=g;if(o.errorsWhileComputingFlags)if(g){var O=new Set(Object.keys(g).filter((I=>{var D;return!((D=g[I])!=null&&D.failed)})));k=_e({},c,Object.fromEntries(Object.entries(k).filter((I=>{var[D]=I;return O.has(D)})))),N=_e({},d,Object.fromEntries(Object.entries(N||{}).filter((I=>{var[D]=I;return O.has(D)})))),C=_e({},f,Object.fromEntries(Object.entries(C||{}).filter((I=>{var[D]=I;return O.has(D)}))))}else k=_e({},c,k),N=_e({},d,N),C=_e({},f,C);l&&l.register(_e({[bS]:Object.keys(kB(k)),[qd]:k||{},[AB]:N||{},[wk]:C||{}},w?{[TB]:w}:{},E?{[yy]:E}:{}))}}})(t,this._instance.persistence,r,a,i),n||(this.St=!1),this.Dt(n)}}override(t,n){n===void 0&&(n=!1),ha.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:n})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return ha.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this._instance.persistence.unregister(Nd),this._instance.persistence.unregister(Eh),this.Dt(),wh.info("All overrides cleared");if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this._t=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Nd),wh.info("Flag overrides cleared");else if(r.flags){if(Nt(r.flags)){for(var a={},i=0;i<r.flags.length;i++)a[r.flags[i]]=!0;this._instance.persistence.register({[Nd]:a})}else this._instance.persistence.register({[Nd]:r.flags});wh.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(Eh),wh.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Eh]:r.payloads}),wh.info("Payload overrides set",{payloads:r.payloads}))),void this.Dt()}this.Dt()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.bt){var{flags:n,flagVariants:r}=this.jt();t(n,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,n,r){var a,i=(this._instance.get_property(Hh)||[]).find((d=>d.flagKey===t)),o={["$feature_enrollment/"+t]:n},l={$feature_flag:t,$feature_enrollment:n,$set:o};i&&(l.$early_access_feature_name=i.name),r&&(l.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(o,!1);var c=_e({},this.getFlagVariants(),{[t]:n});(a=this._instance.persistence)==null||a.register({[bS]:Object.keys(kB(c)),[qd]:c}),this.Dt()}getEarlyAccessFeatures(t,n,r){n===void 0&&(n=!1);var a=this._instance.get_property(Hh),i=r?"&"+r.map((o=>"stage="+o)).join("&"):"";if(a&&!n)return t(a);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+i),method:"GET",callback:o=>{var l,c;if(o.json){var d=o.json.earlyAccessFeatures;return(l=this._instance.persistence)==null||l.unregister(Hh),(c=this._instance.persistence)==null||c.register({[Hh]:d}),t(d)}}})}jt(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter((r=>n[r])),flagVariants:Object.keys(n).filter((r=>n[r])).reduce(((r,a)=>(r[a]=n[a],r)),{})}}Dt(t){var{flags:n,flagVariants:r}=this.jt();this.featureFlagEventHandlers.forEach((a=>a(n,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,n){n===void 0&&(n=!0);var r=this._instance.get_property(qh)||{};this._instance.register({[qh]:_e({},r,t)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(qh)}setGroupPropertiesForFlags(t,n){n===void 0&&(n=!0);var r=this._instance.get_property(Bu)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((a=>{r[a]=_e({},r[a],t[a]),delete t[a]})),this._instance.register({[Bu]:_e({},r,t)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var n=this._instance.get_property(Bu)||{};this._instance.register({[Bu]:_e({},n,{[t]:{}})})}else this._instance.unregister(Bu)}reset(){this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.$anon_distinct_id=void 0,this.Mt(),this._t=!1}}var fce=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class vS{constructor(t,n){this.N=t,this.props={},this.Lt=!1,this.Nt=(r=>{var a="";return r.token&&(a=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+a+"_posthog"})(t),this.q=this.Ut(t),this.load(),t.debug&&ke.info("Persistence loaded",t.persistence,_e({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this.zt}Ut(t){fce.indexOf(t.persistence.toLowerCase())===-1&&(ke.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=(function(a){a===void 0&&(a=[]);var i=[...Iue,...a];return _e({},dn,{D:function(o){try{var l={};try{l=go.D(o)||{}}catch{}var c=Nn(l,JSON.parse(dn.A(o)||"{}"));return dn.j(o,c),c}catch{}return null},j:function(o,l,c,d,f,p){try{dn.j(o,l,void 0,void 0,p);var g={};i.forEach((v=>{l[v]&&(g[v]=l[v])})),Object.keys(g).length&&go.j(o,g,c,d,f,p)}catch(v){dn.M(v)}},L:function(o,l){try{ue==null||ue.localStorage.removeItem(o),go.L(o,l)}catch(c){dn.M(c)}}})})(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&dn.O()?dn:r==="localstorage+cookie"&&n.O()?n:r==="sessionstorage"&&_r.O()?_r:r==="memory"?Due:r==="cookie"?go:n.O()?n:go}Pt(t){var n=t??this.N.feature_flag_cache_ttl_ms;if(!n||n<=0)return!1;var r=this.props[yy];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return Kt(this.props,((n,r)=>{if(r===qd&&Vn(n)){if(!this.Pt())for(var a=Object.keys(n),i=0;i<a.length;i++)t["$feature/"+a[i]]=n[a[i]]}else l=r,c=!1,(Hi(o=Tue)?c:KU&&o.indexOf===KU?o.indexOf(l)!=-1:(Kt(o,(function(d){if(c||(c=d===l))return gy})),c))||(t[r]=n);var o,l,c})),t}load(){if(!this.zt){var t=this.q.D(this.Nt);t&&(this.props=Nn({},t))}}save(){this.zt||this.q.j(this.Nt,this.props,this.Ht,this.qt,this.Bt,this.N.debug)}remove(){this.q.L(this.Nt,!1),this.q.L(this.Nt,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Vn(t)){Ae(n)&&(n="None"),this.Ht=Ae(r)?this.Wt:r;var a=!1;if(Kt(t,((i,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=i,a=!0)})),a)return this.save(),!0}return!1}register(t,n){if(Vn(t)){this.Ht=Ae(n)?this.Wt:n;var r=!1;if(Kt(t,((a,i)=>{t.hasOwnProperty(i)&&this.props[i]!==a&&(this.props[i]=a,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.Lt){var t=q8(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);Hd(KN(t))||this.register(t),this.Lt=!0}}update_search_keyword(){var t;this.register((t=Se==null?void 0:Se.referrer)?W8(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Y8(),$referring_domain:Se!=null&&Se.referrer&&((t=_y(Se.referrer))==null?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Tk]||this.props[kk]||this.register_once({[xy]:K8(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Kt([kk,Tk],(o=>{var l=this.props[o];l&&Kt(l,(function(c,d){t["$initial_"+fk(d)]=c}))}));var n,r,a=this.props[xy];if(a){var i=(n=X8(a),r={},Kt(n,(function(o,l){r["$initial_"+fk(l)]=o})),r);Nn(t,i)}return t}safe_merge(t){return Kt(this.props,(function(n,r){r in t||(t[r]=n)})),t}update_config(t,n,r){if(this.Wt=this.Ht=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((o,l)=>{if(o.length!==l.length)return!1;var c=[...o].sort(),d=[...l].sort();return c.every(((f,p)=>f===d[p]))})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var a=this.Ut(t),i=this.props;this.clear(),this.q=a,this.props=i,this.save()}}set_disabled(t){this.zt=t,this.zt?this.remove():this.save()}set_cross_subdomain(t){t!==this.qt&&(this.qt=t,this.remove(),this.save())}set_secure(t){t!==this.Bt&&(this.Bt=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Gh]||{};r[t]=n,this.props[Gh]=r,this.save()}remove_event_timer(t){var n=(this.props[Gh]||{})[t];return Ae(n)||(delete this.props[Gh][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var _h=(function(e){return e.Activation="events",e.Cancellation="cancelEvents",e})({});(function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e})({});(function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e})({});(function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e})({});var yS=(function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e})({});(function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e})({});(function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e})({});(function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e})({});var Wh=(function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e.ABANDONED="survey abandoned",e})({}),xS=(function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e.PRODUCT_TOUR_ID="$product_tour_id",e.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",e})({}),Rk=(function(e){return e.Popover="popover",e.Inline="inline",e})({}),Ht=pn("[Surveys]"),Q8="seenSurvey_",pce=(e,t)=>{var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n},NB=e=>((t,n)=>{var r=""+t+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+t+n.id+"_"+n.current_iteration),r})(Q8,e),hce=[yS.Popover,yS.Widget,yS.API],mce={ignoreConditions:!1,ignoreDelay:!1,displayType:Rk.Popover};class QN{constructor(){this.Gt={},this.Gt={}}on(t,n){return this.Gt[t]||(this.Gt[t]=[]),this.Gt[t].push(n),()=>{this.Gt[t]=this.Gt[t].filter((r=>r!==n))}}emit(t,n){for(var r of this.Gt[t]||[])r(n);for(var a of this.Gt["*"]||[])a(t,n)}}function Od(e,t,n){if(pt(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class gce{constructor(t){this.Vt=new QN,this.Jt=(n,r)=>this.Kt(n,r)&&this.Yt(n,r)&&this.Xt(n,r)&&this.Qt(n,r),this.Kt=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=t,this.Zt=new Set,this.ti=new Set}init(){var t;if(!Ae((t=this._instance)==null?void 0:t._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook(((r,a)=>{this.on(r,a)}))}}register(t){var n,r;if(!Ae((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach((o=>{var l,c;(l=this.ti)==null||l.add(o),(c=o.steps)==null||c.forEach((d=>{var f;(f=this.Zt)==null||f.add((d==null?void 0:d.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var a,i=new Set;t.forEach((o=>{var l;(l=o.steps)==null||l.forEach((c=>{c!=null&&c.selector&&i.add(c==null?void 0:c.selector)}))})),(a=this._instance)==null||a.autocapture.setElementSelectors(i)}}on(t,n){var r;n!=null&&t.length!=0&&(this.Zt.has(t)||this.Zt.has(n==null?void 0:n.event))&&this.ti&&((r=this.ti)==null?void 0:r.size)>0&&this.ti.forEach((a=>{this.ii(n,a)&&this.Vt.emit("actionCaptured",a.name)}))}ei(t){this.onAction("actionCaptured",(n=>t(n)))}ii(t,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Jt(t,r))return!0;return!1}onAction(t,n){return this.Vt.on(t,n)}Yt(t,n){if(n!=null&&n.url){var r,a=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!a||typeof a!="string"||!Od(a,n.url,n.url_matching||"contains"))return!1}return!0}Xt(t,n){return!!this.ri(t,n)&&!!this.si(t,n)&&!!this.ni(t,n)}ri(t,n){var r;if(n==null||!n.href)return!0;var a=this.oi(t);if(a.length>0)return a.some((l=>Od(l.href,n.href,n.href_matching||"exact")));var i,o=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!o&&Od((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}si(t,n){var r;if(n==null||!n.text)return!0;var a=this.oi(t);if(a.length>0)return a.some((d=>Od(d.text,n.text,n.text_matching||"exact")||Od(d.$el_text,n.text,n.text_matching||"exact")));var i,o,l,c=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!c&&(i=(function(d){for(var f,p=[],g=/(?::|")text="(.*?)"/g;!pt(f=g.exec(d));)p.includes(f[1])||p.push(f[1]);return p})(c),o=n.text,l=n.text_matching||"exact",i.some((d=>Od(d,o,l))))}ni(t,n){var r,a;if(n==null||!n.selector)return!0;var i=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var o=(t==null||(a=t.properties)==null?void 0:a.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}oi(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t==null?void 0:t.properties.$elements}Qt(t,n){return n==null||!n.properties||n.properties.length===0||H8(n.properties.reduce(((r,a)=>{var i=Nt(a.value)?a.value.map(String):a.value!=null?[String(a.value)]:[];return r[a.key]={values:i,operator:a.operator||"exact"},r}),{}),t==null?void 0:t.properties)}}class bce{constructor(t){this._instance=t,this.ai=new Map,this.li=new Map,this.ui=new Map}hi(t,n){return!!t&&H8(t.propertyFilters,n==null?void 0:n.properties)}di(t,n){var r=new Map;return t.forEach((a=>{var i;(i=a.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach((o=>{if(o!=null&&o.name){var l=r.get(o.name)||[];l.push(a.id),r.set(o.name,l)}}))})),r}vi(t,n,r){var a=(r===_h.Activation?this.ai:this.li).get(t),i=[];return this.ci((o=>{i=o.filter((l=>a==null?void 0:a.includes(l.id)))})),i.filter((o=>{var l,c=(l=o.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((d=>d.name===t));return this.hi(c,n)}))}register(t){var n;Ae((n=this._instance)==null?void 0:n._addCaptureHook)||(this.fi(t),this.pi(t))}pi(t){var n=t.filter((r=>{var a,i;return((a=r.conditions)==null?void 0:a.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0}));n.length!==0&&(this.gi==null&&(this.gi=new gce(this._instance),this.gi.init(),this.gi.ei((r=>{this.onAction(r)}))),n.forEach((r=>{var a,i,o,l,c;r.conditions&&(a=r.conditions)!=null&&a.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((l=this.gi)==null||l.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((d=>{if(d&&d.name){var f=this.ui.get(d.name);f&&f.push(r.id),this.ui.set(d.name,f||[r.id])}})))})))}fi(t){var n,r=t.filter((i=>{var o,l;return((o=i.conditions)==null?void 0:o.events)&&((l=i.conditions)==null||(l=l.events)==null||(l=l.values)==null?void 0:l.length)>0})),a=t.filter((i=>{var o,l;return((o=i.conditions)==null?void 0:o.cancelEvents)&&((l=i.conditions)==null||(l=l.cancelEvents)==null||(l=l.values)==null?void 0:l.length)>0}));(r.length!==0||a.length!==0)&&((n=this._instance)==null||n._addCaptureHook(((i,o)=>{this.onEvent(i,o)})),this.ai=this.di(t,_h.Activation),this.li=this.di(t,_h.Cancellation))}onEvent(t,n){var r,a=this.mi(),i=this.bi(),o=this.yi(),l=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[i])||[];if(o===t&&n&&l.length>0){var c,d;a.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:l});var f=(n==null||(c=n.properties)==null?void 0:c.$survey_id)||(n==null||(d=n.properties)==null?void 0:d.$product_tour_id);if(f){var p=l.indexOf(f);p>=0&&(l.splice(p,1),this.wi(l))}}else{if(this.li.has(t)){var g=this.vi(t,n,_h.Cancellation);g.length>0&&(a.info("cancel event matched, cancelling items",{event:t,itemsToCancel:g.map((x=>x.id))}),g.forEach((x=>{var w=l.indexOf(x.id);w>=0&&l.splice(w,1),this.xi(x.id)})),this.wi(l))}if(this.ai.has(t)){a.info("event name matched",{event:t,eventPayload:n,items:this.ai.get(t)});var v=this.vi(t,n,_h.Activation);this.wi(l.concat(v.map((x=>x.id))||[]))}}}onAction(t){var n,r=this.bi(),a=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.ui.has(t)&&this.wi(a.concat(this.ui.get(t)||[]))}wi(t){var n,r=this.mi(),a=this.bi(),i=[...new Set(t)].filter((o=>!this.$i(o)));r.info("updating activated items",{activatedItems:i}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[a]:i})}getActivatedIds(){var t,n=this.bi(),r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n];return r||[]}getEventToItemsMap(){return this.ai}Ei(){return this.gi}}let vce=class extends bce{constructor(t){super(t)}bi(){return"$surveys_activated"}yi(){return Wh.SHOWN}ci(t){var n;(n=this._instance)==null||n.getSurveys(t)}xi(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}mi(){return Ht}$i(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}};class yce{constructor(t){this.Si=void 0,this._surveyManager=null,this.ki=!1,this.Pi=[],this.Ti=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var n=t.surveys;if(pt(n))return Ht.warn("Flags not loaded yet. Not loading surveys.");var r=Nt(n);this.Si=r?n.length>0:n,Ht.info("flags response received, isSurveysEnabled: "+this.Si),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(Q8)||r!=null&&r.startsWith("inProgressSurvey_"))&&t.push(r)}t.forEach((a=>localStorage.removeItem(a)))}loadIfEnabled(){if(!this._surveyManager)if(this.ki)Ht.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Ht.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Ht.info("Not loading surveys in cookieless mode without consent.");else{var t=ze==null?void 0:ze.__PosthogExtensions__;if(t){if(!Ae(this.Si)||this._instance.config.advanced_enable_surveys){var n=this.Si||this._instance.config.advanced_enable_surveys;this.ki=!0;try{var r=t.generateSurveys;if(r)return void this.Ci(r,n);var a=t.loadExternalDependency;if(!a)return void this.Ii("PostHog loadExternalDependency extension not found.");a(this._instance,"surveys",(i=>{i||!t.generateSurveys?this.Ii("Could not load surveys script",i):this.Ci(t.generateSurveys,n)}))}catch(i){throw this.Ii("Error initializing surveys",i),i}finally{this.ki=!1}}}else Ht.error("PostHog Extensions not found.")}}Ci(t,n){this._surveyManager=t(this._instance,n),this._surveyEventReceiver=new vce(this._instance),Ht.info("Surveys loaded successfully"),this.Ri({isLoaded:!0})}Ii(t,n){Ht.error(t,n),this.Ri({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Pi.push(t),this._surveyManager&&this.Ri({isLoaded:!0}),()=>{this.Pi=this.Pi.filter((n=>n!==t))}}getSurveys(t,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return Ht.info("Disabled. Not loading surveys."),t([]);var r,a=this._instance.get_property(Ek);if(a&&!n)return t(a,{isLoaded:!0});typeof Promise<"u"&&this.Ti?this.Ti.then((i=>{var{surveys:o,context:l}=i;return t(o,l)})):(typeof Promise<"u"&&(this.Ti=new Promise((i=>{r=i}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:i=>{var o;this.Ti=null;var l=i.statusCode;if(l!==200||!i.json){var c="Surveys API could not be loaded, status: "+l;Ht.error(c);var d={isLoaded:!1,error:c};return t([],d),void(r==null||r({surveys:[],context:d}))}var f,p=i.json.surveys||[],g=p.filter((x=>(function(w){return!(!w.start_date||w.end_date)})(x)&&((function(w){var E;return!((E=w.conditions)==null||(E=E.events)==null||(E=E.values)==null||!E.length)})(x)||(function(w){var E;return!((E=w.conditions)==null||(E=E.actions)==null||(E=E.values)==null||!E.length)})(x))));g.length>0&&((f=this._surveyEventReceiver)==null||f.register(g)),(o=this._instance.persistence)==null||o.register({[Ek]:p});var v={isLoaded:!0};t(p,v),r==null||r({surveys:p,context:v})}}))}Ri(t){for(var n of this.Pi)try{if(!t.isLoaded)return n([],t);this.getSurveys(n)}catch(r){Ht.error("Error in survey callback",r)}}getActiveMatchingSurveys(t,n){if(n===void 0&&(n=!1),!pt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,n);Ht.warn("init was not called")}Fi(t){var n=null;return this.getSurveys((r=>{var a;n=(a=r.find((i=>i.id===t)))!==null&&a!==void 0?a:null})),n}Oi(t){if(pt(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof t=="string"?this.Fi(t):t;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(pt(this._surveyManager))return Ht.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.Oi(t);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(t,n){return pt(this._surveyManager)?(Ht.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((a=>{var i,o=(i=a.find((c=>c.id===t)))!==null&&i!==void 0?i:null;if(o){var l=this.Oi(o);r({visible:l.eligible,disabledReason:l.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(t,n,r){var a;if(pt(this._surveyManager))Ht.warn("init was not called");else{var i=typeof t=="string"?this.Fi(t):t;if(i!=null&&i.id)if(hce.includes(i.type)){var o=Se==null?void 0:Se.querySelector(n);if(o)return(a=i.appearance)!=null&&a.surveyPopupDelaySeconds?(Ht.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var l,c;Ht.info("Rendering survey "+i.id+" with delay of "+((l=i.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(c=this._surveyManager)==null||c.renderSurvey(i,o,r),Ht.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,o,r);Ht.warn("Survey element not found")}else Ht.warn("Surveys of type "+i.type+" cannot be rendered in the app");else Ht.warn("Survey not found")}}displaySurvey(t,n){var r;if(pt(this._surveyManager))Ht.warn("init was not called");else{var a=this.Fi(t);if(a){var i=a;if((r=a.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(i=_e({},a,{appearance:_e({},a.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==Rk.Popover&&n.initialResponses&&Ht.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var o=this.canRenderSurvey(a);if(!o.visible)return void Ht.warn("Survey is not eligible to be displayed: ",o.disabledReason)}n.displayType!==Rk.Inline?this._surveyManager.handlePopoverSurvey(i,n):this.renderSurvey(i,n.selector,n.properties)}else Ht.warn("Survey not found")}}cancelPendingSurvey(t){pt(this._surveyManager)?Ht.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload()}}var ei=pn("[Conversations]");class xce{constructor(t){this.Mi=void 0,this._conversationsManager=null,this.Ai=!1,this.Di=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var n=t.conversations;pt(n)||(Es(n)?this.Mi=n:(this.Mi=n.enabled,this.Di=n),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Mi=void 0,this.Di=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ai||this._instance.config.disable_conversations||C8(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=ze==null?void 0:ze.__PosthogExtensions__;if(t&&!Ae(this.Mi)&&this.Mi)if(this.Di&&this.Di.token){this.Ai=!0;try{var n=t.initConversations;if(n)return this.ji(n),void(this.Ai=!1);var r=t.loadExternalDependency;if(!r)return void this.Li("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(a=>{a||!t.initConversations?this.Li("Could not load conversations script",a):this.ji(t.initConversations),this.Ai=!1}))}catch(a){this.Li("Error initializing conversations",a),this.Ai=!1}}else ei.error("Conversations enabled but missing token in remote config.")}}ji(t){if(this.Di)try{this._conversationsManager=t(this.Di,this._instance),ei.info("Conversations loaded successfully")}catch(n){this.Li("Error completing conversations initialization",n)}else ei.error("Cannot complete initialization: remote config is null")}Li(t,n){ei.error(t,n),this._conversationsManager=null,this.Ai=!1}show(){this._conversationsManager?this._conversationsManager.show():ei.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Mi===!0&&!Hi(this._conversationsManager)}isVisible(){var t,n;return(t=(n=this._conversationsManager)==null?void 0:n.isVisible())!==null&&t!==void 0&&t}sendMessage(t,n,r){var a=this;return os((function*(){return a._conversationsManager?a._conversationsManager.sendMessage(t,n,r):(ei.warn("Conversations not available yet."),null)}))()}getMessages(t,n){var r=this;return os((function*(){return r._conversationsManager?r._conversationsManager.getMessages(t,n):(ei.warn("Conversations not available yet."),null)}))()}markAsRead(t){var n=this;return os((function*(){return n._conversationsManager?n._conversationsManager.markAsRead(t):(ei.warn("Conversations not available yet."),null)}))()}getTickets(t){var n=this;return os((function*(){return n._conversationsManager?n._conversationsManager.getTickets(t):(ei.warn("Conversations not available yet."),null)}))()}requestRestoreLink(t){var n=this;return os((function*(){return n._conversationsManager?n._conversationsManager.requestRestoreLink(t):(ei.warn("Conversations not available yet."),null)}))()}restoreFromToken(t){var n=this;return os((function*(){return n._conversationsManager?n._conversationsManager.restoreFromToken(t):(ei.warn("Conversations not available yet."),null)}))()}restoreFromUrlToken(){var t=this;return os((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(ei.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var t,n;return(t=(n=this._conversationsManager)==null?void 0:n.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,n;return(t=(n=this._conversationsManager)==null?void 0:n.getWidgetSessionId())!==null&&t!==void 0?t:null}}var wce=(function(e){return e.SHOWN="product tour shown",e.DISMISSED="product tour dismissed",e.COMPLETED="product tour completed",e.STEP_SHOWN="product tour step shown",e.STEP_COMPLETED="product tour step completed",e.BUTTON_CLICKED="product tour button clicked",e.STEP_SELECTOR_FAILED="product tour step selector failed",e.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",e.BANNER_ACTION_CLICKED="product tour banner action clicked",e})({}),OB=(function(e){return e.TOUR_ID="$product_tour_id",e.TOUR_NAME="$product_tour_name",e.TOUR_ITERATION="$product_tour_iteration",e.TOUR_RENDER_REASON="$product_tour_render_reason",e.TOUR_STEP_ID="$product_tour_step_id",e.TOUR_STEP_ORDER="$product_tour_step_order",e.TOUR_STEP_TYPE="$product_tour_step_type",e.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",e.TOUR_BUTTON_TEXT="$product_tour_button_text",e.TOUR_BUTTON_ACTION="$product_tour_button_action",e.TOUR_BUTTON_LINK="$product_tour_button_link",e.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",e.TOUR_STEPS_COUNT="$product_tour_steps_count",e.TOUR_STEP_SELECTOR="$product_tour_step_selector",e.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",e.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",e.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",e.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",e.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",e.TOUR_ERROR="$product_tour_error",e.TOUR_MATCHES_COUNT="$product_tour_matches_count",e.TOUR_FAILURE_PHASE="$product_tour_failure_phase",e.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",e.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",e.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",e.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",e.USE_MANUAL_SELECTOR="$use_manual_selector",e.INFERENCE_DATA_PRESENT="$inference_data_present",e.TOUR_LAST_SEEN_DATE="$product_tour_last_seen_date",e.TOUR_TYPE="$product_tour_type",e})({});class Ece{constructor(t){var n;this.Ni=!1,this.Ui=!1,this._instance=t,this._instance&&(n=this._instance.config.logs)!=null&&n.captureConsoleLogs&&(this.Ni=!0)}onRemoteConfig(t){var n,r=(n=t.logs)==null?void 0:n.captureConsoleLogs;!pt(r)&&r&&(this.Ni=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ni&&!this.Ui){var t=pn("[logs]"),n=ze==null?void 0:ze.__PosthogExtensions__;if(n){var r=n.loadExternalDependency;r?r(this._instance,"logs",(a=>{var i;a||(i=n.logs)==null||!i.initializeLogs?t.error("Could not load logs script",a):(n.logs.initializeLogs(this._instance),this.Ui=!0)})):t.error("PostHog loadExternalDependency extension not found.")}else t.error("PostHog Extensions not found.")}}}var CB=pn("[RateLimiter]");let _ce=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((a=>{CB.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void CB.warn('could not rate limit - continuing. Error: "'+(a==null?void 0:a.message)+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,a;t===void 0&&(t=!1);var{captureEventsBurstLimit:i,captureEventsPerSecond:o}=this,l=new Date().getTime(),c=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Ak))!==null&&n!==void 0?n:{tokens:i,last:l};c.tokens+=(l-c.last)/1e3*o,c.last=l,c.tokens>i&&(c.tokens=i);var d=c.tokens<1;return d||t||(c.tokens=Math.max(0,c.tokens-1)),!d||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=d,(a=this.instance.persistence)==null||a.set_property(Ak,c),{isRateLimited:d,remainingTokens:c.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}};var Sh=pn("[RemoteConfig]");class J8{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=ze._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}zi(t){var n,r;(n=ze.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Hi(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return Sh.info("Using preloaded remote config",this.remoteConfig),this.qi(this.remoteConfig),void this.Bi();if(this._instance.At())return void Sh.warn("Remote config is disabled. Falling back to local config.");this.zi((t=>{if(!t)return Sh.info("No config found after loading remote JS config. Falling back to JSON."),void this.Hi((n=>{this.qi(n),this.Bi()}));this.qi(t),this.Bi()}))}catch(t){Sh.error("Error loading remote config",t)}}stop(){this.Wi&&(clearInterval(this.Wi),this.Wi=void 0)}refresh(){this._instance.At()||(Se==null?void 0:Se.visibilityState)==="hidden"||this._instance.featureFlags.reloadFeatureFlags()}Bi(){var t;if(!this.Wi){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.Wi=setInterval((()=>{this.refresh()}),n))}}qi(t){t||Sh.error("Failed to fetch remote config from PostHog."),this._instance.qi(t??{}),(t==null?void 0:t.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||this._instance.featureFlags.ensureFlagsLoaded())}}var Ik=3e3;class Sce{constructor(t,n){this.Gi=!0,this.Vi=[],this.Ji=vo((n==null?void 0:n.flush_interval_ms)||Ik,250,5e3,ke.createLogger("flush interval"),Ik),this.Ki=t}enqueue(t){this.Vi.push(t),this.Yi||this.Xi()}unload(){this.Qi();var t=this.Vi.length>0?this.Zi():{},n=Object.values(t);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Ki(_e({},r,{transport:"sendBeacon"}))}))}enable(){this.Gi=!1,this.Xi()}Xi(){var t=this;this.Gi||(this.Yi=setTimeout((()=>{if(this.Qi(),this.Vi.length>0){var n=this.Zi(),r=function(){var i=n[a],o=new Date().getTime();i.data&&Nt(i.data)&&Kt(i.data,(l=>{l.offset=Math.abs(l.timestamp-o),delete l.timestamp})),t.Ki(i)};for(var a in n)r()}}),this.Ji))}Qi(){clearTimeout(this.Yi),this.Yi=void 0}Zi(){var t={};return Kt(this.Vi,(n=>{var r,a=n,i=(a?a.batchKey:null)||a.url;Ae(t[i])&&(t[i]=_e({},a,{data:[]})),(r=t[i].data)==null||r.push(a.data)})),this.Vi=[],t}}var Ace=["retriesPerformedSoFar"];class Tce{constructor(t){this.te=!1,this.ie=3e3,this.Vi=[],this._instance=t,this.Vi=[],this.ee=!0,!Ae(ue)&&"onLine"in ue.navigator&&(this.ee=ue.navigator.onLine,this.re=()=>{this.ee=!0,this.se()},this.ne=()=>{this.ee=!1},jn(ue,"online",this.re),jn(ue,"offline",this.ne))}get length(){return this.Vi.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=o8(t,Ace);Ud(n)&&(r.url=ky(r.url,{retry_count:n})),this._instance._send_request(_e({},r,{callback:a=>{a.statusCode!==200&&(a.statusCode<400||a.statusCode>=500)&&(n??0)<10?this.oe(_e({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(a)}}))}oe(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=(function(o){var l=3e3*Math.pow(2,o),c=l/2,d=Math.min(18e5,l),f=(Math.random()-.5)*(d-c);return Math.ceil(d+f)})(n),a=Date.now()+r;this.Vi.push({retryAt:a,requestOptions:t});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),ke.warn(i),this.te||(this.te=!0,this.ae())}ae(){if(this.le&&clearTimeout(this.le),this.Vi.length===0)return this.te=!1,void(this.le=void 0);this.le=setTimeout((()=>{this.ee&&this.Vi.length>0&&this.se(),this.ae()}),this.ie)}se(){var t=Date.now(),n=[],r=this.Vi.filter((i=>i.retryAt<t||(n.push(i),!1)));if(this.Vi=n,r.length>0)for(var{requestOptions:a}of r)this.retriableRequest(a)}unload(){for(var{requestOptions:t}of(this.le&&(clearTimeout(this.le),this.le=void 0),this.te=!1,Ae(ue)||(this.re&&(ue.removeEventListener("online",this.re),this.re=void 0),this.ne&&(ue.removeEventListener("offline",this.ne),this.ne=void 0)),this.Vi))try{this._instance._send_request(_e({},t,{transport:"sendBeacon"}))}catch(n){ke.error(n)}this.Vi=[]}}class kce{constructor(t){this.ue=()=>{var n,r,a,i;this.he||(this.he={});var o=this.scrollElement(),l=this.scrollY(),c=o?Math.max(0,o.scrollHeight-o.clientHeight):0,d=l+((o==null?void 0:o.clientHeight)||0),f=(o==null?void 0:o.scrollHeight)||0;this.he.lastScrollY=Math.ceil(l),this.he.maxScrollY=Math.max(l,(n=this.he.maxScrollY)!==null&&n!==void 0?n:0),this.he.maxScrollHeight=Math.max(c,(r=this.he.maxScrollHeight)!==null&&r!==void 0?r:0),this.he.lastContentY=d,this.he.maxContentY=Math.max(d,(a=this.he.maxContentY)!==null&&a!==void 0?a:0),this.he.maxContentHeight=Math.max(f,(i=this.he.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=t}getContext(){return this.he}resetContext(){var t=this.he;return setTimeout(this.ue,0),t}startMeasuringScrollPosition(){jn(ue,"scroll",this.ue,{capture:!0}),jn(ue,"scrollend",this.ue,{capture:!0}),jn(ue,"resize",this.ue)}scrollElement(){if(!this._instance.config.scroll_root_selector)return ue==null?void 0:ue.document.documentElement;var t=Nt(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of t){var r=ue==null?void 0:ue.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return ue&&(ue.scrollY||ue.pageYOffset||ue.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return ue&&(ue.scrollX||ue.pageXOffset||ue.document.documentElement.scrollLeft)||0}}var Nce=e=>K8(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties);class RB{constructor(t,n,r,a){this.de=i=>{var o=this.ve();if(!o||o.sessionId!==i){var l={sessionId:i,props:this.ce(this._instance)};this.fe.register({[Sk]:l})}},this._instance=t,this.pe=n,this.fe=r,this.ce=a||Nce,this.pe.onSessionId(this.de)}ve(){return this.fe.props[Sk]}getSetOnceProps(){var t,n=(t=this.ve())==null?void 0:t.props;return n?"r"in n?X8(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return Kt(KN(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+fk(r)]=n})),t}}var wS=pn("[SessionId]");class IB{on(t,n){return this._e.on(t,n)}constructor(t,n,r){var a;if(this.ge=[],this.me=void 0,this._e=new QN,this.be=(f,p)=>!(!Ud(f)||!Ud(p))&&Math.abs(f-p)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=t.config,this.fe=t.persistence,this.ye=void 0,this.we=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.xe=n||Bl,this.$e=r||Bl;var i=this.N.persistence_name||this.N.token,o=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*vo(o,60,36e3,wS.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ee(),this.Se="ph_"+i+"_window_id",this.ke="ph_"+i+"_primary_window_exists",this.Pe()){var l=_r.D(this.Se),c=_r.D(this.ke);l&&!c?this.ye=l:_r.L(this.Se),_r.j(this.ke,!0)}if((a=this.N.bootstrap)!=null&&a.sessionID)try{var d=(f=>{var p=f.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.N.bootstrap.sessionID);this.Te(this.N.bootstrap.sessionID,new Date().getTime(),d)}catch(f){wS.error("Invalid sessionID in bootstrap",f)}this.Ce()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ae(this.ge)&&(this.ge=[]),this.ge.push(t),this.we&&t(this.we,this.ye),()=>{this.ge=this.ge.filter((n=>n!==t))}}Pe(){return this.N.persistence!=="memory"&&!this.fe.zt&&_r.O()}Ie(t){t!==this.ye&&(this.ye=t,this.Pe()&&_r.j(this.Se,t))}Re(){return this.ye?this.ye:this.Pe()?_r.D(this.Se):null}Te(t,n,r){t===this.we&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.we=t,this.fe.register({[by]:[n,t,r]}))}Fe(){var t=this.fe.props[by];return Nt(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Te(null,null,null)}destroy(){clearTimeout(this.Oe),this.Oe=void 0,this.me&&ue&&(ue.removeEventListener("beforeunload",this.me,{capture:!1}),this.me=void 0),this.ge=[]}Ce(){this.me=()=>{this.Pe()&&_r.L(this.ke)},jn(ue,"beforeunload",this.me,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.N.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[a,i,o]=this.Fe(),l=this.Re(),c=Ud(o)&&Math.abs(r-o)>864e5,d=!1,f=!i,p=!f&&!t&&this.be(r,a);f||p||c?(i=this.xe(),l=this.$e(),wS.info("new session ID generated",{sessionId:i,windowId:l,changeReason:{noSessionId:f,activityTimeout:p,sessionPastMaximumLength:c}}),o=r,d=!0):l||(l=this.$e(),d=!0);var g=Ud(a)&&t&&!c?a:r,v=Ud(o)?o:new Date().getTime();return this.Ie(l),this.Te(i,g,v),t||this.Ee(),d&&this.ge.forEach((x=>x(i,l,d?{noSessionId:f,activityTimeout:p,sessionPastMaximumLength:c}:void 0))),{sessionId:i,windowId:l,sessionStartTimestamp:v,changeReason:d?{noSessionId:f,activityTimeout:p,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:a}}Ee(){clearTimeout(this.Oe),this.Oe=setTimeout((()=>{var[t]=this.Fe();if(this.be(new Date().getTime(),t)){var n=this.we;this.resetSessionId(),this._e.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}}var eV=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&QU(n,t))return!0;try{var r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some((a=>QU(a==null?void 0:a.brand,t))))return!0}catch{}return!!e.webdriver},Yh=(function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e})({}),DB="i.posthog.com";class Oce{constructor(t){this.Me={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+DB,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Me[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Me[this.apiHost]=Yh.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Me[this.apiHost]=Yh.EU:this.Me[this.apiHost]=Yh.CUSTOM),this.Me[this.apiHost]}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(this.region===Yh.CUSTOM)return this.apiHost+n;var r=DB+n;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Cce={icontains:(e,t)=>!!ue&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!ue&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!ue&&Ny(t.href,e),not_regex:(e,t)=>!!ue&&!Ny(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Ir{constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((a=>{Ir.Ae("retrieved web experiments from the server"),n.De=new Map,a.forEach((i=>{if(i.feature_flag_key){var o;n.De&&(Ir.Ae("setting flag key ",i.feature_flag_key," to web experiment ",i),(o=n.De)==null||o.set(i.feature_flag_key,i));var l=n._instance.getFeatureFlag(i.feature_flag_key);$n(l)&&i.variants[l]&&n.je(i.name,l,i.variants[l].transforms)}else if(i.variants)for(var c in i.variants){var d=i.variants[c];Ir.Le(d)&&n.je(i.name,c,d.transforms)}}))}),r)},this._instance=t,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}onFeatureFlags(t){if(this._is_bot())Ir.Ae("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(pt(this.De))return this.De=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Ir.Ae("applying feature flags",t),t.forEach((n=>{var r;if(this.De&&(r=this.De)!=null&&r.has(n)){var a,i=this._instance.getFeatureFlag(n),o=(a=this.De)==null?void 0:a.get(n);i&&o!=null&&o.variants[i]&&this.je(o.name,i,o.variants[i].transforms)}}))}}previewWebExperiment(){var t=Ir.getWindowLocation();if(t!=null&&t.search){var n=Sy(t==null?void 0:t.search,"__experiment_id"),r=Sy(t==null?void 0:t.search,"__experiment_variant");n&&r&&(Ir.Ae("previewing web experiments "+n+" && "+r),this.getWebExperiments((a=>{this.Ne(parseInt(n),r,a)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var a=this._instance.get_property("$web_experiments");if(a&&!n)return t(a);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:i=>{if(i.statusCode!==200||!i.json)return t([]);var o=i.json.experiments||[];return t(o)}})}Ne(t,n,r){var a=r.filter((i=>i.id===t));a&&a.length>0&&(Ir.Ae("Previewing web experiment ["+a[0].name+"] with variant ["+n+"]"),this.je(a[0].name,n,a[0].variants[n].transforms))}static Le(t){return!pt(t.conditions)&&Ir.Ue(t)&&Ir.ze(t)}static Ue(t){var n;if(pt(t.conditions)||pt((n=t.conditions)==null?void 0:n.url))return!0;var r,a,i,o=Ir.getWindowLocation();return!!o&&((r=t.conditions)==null||!r.url||Cce[(a=(i=t.conditions)==null?void 0:i.urlMatchType)!==null&&a!==void 0?a:"icontains"](t.conditions.url,o))}static getWindowLocation(){return ue==null?void 0:ue.location}static ze(t){var n;if(pt(t.conditions)||pt((n=t.conditions)==null?void 0:n.utm))return!0;var r=q8();if(r.utm_source){var a,i,o,l,c,d,f,p,g=(a=t.conditions)==null||(a=a.utm)==null||!a.utm_campaign||((i=t.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,v=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_source||((l=t.conditions)==null||(l=l.utm)==null?void 0:l.utm_source)==r.utm_source,x=(c=t.conditions)==null||(c=c.utm)==null||!c.utm_medium||((d=t.conditions)==null||(d=d.utm)==null?void 0:d.utm_medium)==r.utm_medium,w=(f=t.conditions)==null||(f=f.utm)==null||!f.utm_term||((p=t.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return g&&x&&w&&v}return!1}static Ae(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];ke.info("[WebExperiments] "+t,r)}je(t,n,r){this._is_bot()?Ir.Ae("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach((a=>{if(a.selector){var i;Ir.Ae("applying transform of variant "+n+" for experiment "+t+" ",a);var o=(i=document)==null?void 0:i.querySelectorAll(a.selector);o==null||o.forEach((l=>{var c=l;a.html&&(c.innerHTML=a.html),a.css&&c.setAttribute("style",a.css)}))}})):Ir.Ae("Control variants leave the page unmodified.")}_is_bot(){return ja&&this._instance?eV(ja,this._instance.config.custom_blocked_useragents):void 0}}var Rce=pn("[PostHog ExternalIntegrations]"),Ice={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Dce{constructor(t){this._instance=t}V(t,n){var r;(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,(a=>{if(a)return Rce.error("failed to load script",a);n()}))}startIfEnabledOrStop(){var t=this,n=function(o){var l,c,d;!a||(l=ze.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]||t.V(Ice[o],(()=>{var f;(f=ze.__PosthogExtensions__)==null||(f=f.integrations)==null||(f=f[o])==null||f.start(t._instance)})),!a&&(c=ze.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[o]&&((d=ze.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[o])==null||d.stop())};for(var[r,a]of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;n(r)}}}var tm={},ES=0,Dk=()=>{},Bd="posthog",tV=!Xue&&(ya==null?void 0:ya.indexOf("MSIE"))===-1&&(ya==null?void 0:ya.indexOf("Mozilla"))===-1,MB=e=>{var t;return _e({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Aue(Se==null?void 0:Se.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Dk,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,debug:Sr&&$n(Sr==null?void 0:Sr.search)&&Sr.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(ue==null||(t=ue.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;ke.error(r)},get_device_id:n=>n,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:Ik},error_tracking:{},_onCapture:Dk,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},LB=e=>{var t={};Ae(e.process_person)||(t.person_profiles=e.process_person),Ae(e.xhr_headers)||(t.request_headers=e.xhr_headers),Ae(e.cookie_name)||(t.persistence_name=e.cookie_name),Ae(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),Ae(e.store_google)||(t.save_campaign_params=e.store_google),Ae(e.verbose)||(t.debug=e.verbose);var n=Nn({},t,e);return Nt(e.property_blacklist)&&(Ae(e.property_denylist)?n.property_denylist=e.property_blacklist:Nt(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:ke.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class Mce{constructor(){this.__forceAllowLocalhost=!1}get He(){return this.__forceAllowLocalhost}set He(t){ke.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class vs{get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){this.webPerformance=new Mce,this.qe=!1,this.version=is.LIB_VERSION,this.Ft=new QN,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=MB(),this.SentryIntegration=Fue,this.sentryIntegration=t=>(function(n,r){var a=j8(n,r);return{name:P8,processEvent:i=>a(i)}})(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Be=!1,this.We=null,this.Ge=null,this.Ve=null,this.featureFlags=new dce(this),this.toolbar=new Bue(this),this.scrollManager=new kce(this),this.pageViewManager=new vB(this),this.surveys=new yce(this),this.conversations=new xce(this),this.logs=new Ece(this),this.experiments=new Ir(this),this.exceptions=new Zue(this),this.rateLimiter=new _ce(this),this.requestRouter=new Oce(this),this.consent=new Mue(this),this.externalIntegrations=new Dce(this),this.people={set:(t,n,r)=>{var a=$n(t)?{[t]:n}:t;this.setPersonProperties(a),r==null||r({})},set_once:(t,n,r)=>{var a=$n(t)?{[t]:n}:t;this.setPersonProperties(void 0,a),r==null||r({})}},this.on("eventCaptured",(t=>ke.info('send "'+(t==null?void 0:t.event)+'"',t)))}init(t,n,r){if(r&&r!==Bd){var a,i=(a=tm[r])!==null&&a!==void 0?a:new vs;return i._init(t,n,r),tm[r]=i,tm[Bd][r]=i,i}return this._init(t,n,r)}_init(t,n,r){var a;if(n===void 0&&(n={}),Ae(t)||pk(t))return ke.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Je(n.debug),this.Ke=n,this.Ye=[],n.person_profiles?this.Ge=n.person_profiles:n.process_person&&(this.Ge=n.process_person),this.set_config(Nn({},MB(n.defaults),LB(n),{name:r,token:t})),this.config.on_xhr_error&&ke.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:hs.GZipJS;var i=this.Xe();this.persistence=new vS(this.config,i),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new vS(_e({},this.config,{persistence:"sessionStorage"}),i);var o=_e({},this.persistence.props),l=_e({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Qe=new Sce((T=>this.Ze(T)),this.config.request_queue_config),this.tr=new Tce(this),this.__request_queue=[];var c=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(c||(this.sessionManager=new IB(this),this.sessionPropsManager=new RB(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ke.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.ir(c)}),0)):(ke.info("Initializing extensions synchronously"),this.ir(c)),is.DEBUG=is.DEBUG||this.config.debug,is.DEBUG&&ke.info("Starting in debug mode",{this:this,config:n,thisC:_e({},this.config),p:o,s:l}),((a=n.bootstrap)==null?void 0:a.distinctID)!==void 0){var d,f,p=this.config.get_device_id(Bl()),g=(d=n.bootstrap)!=null&&d.isIdentifiedID?p:n.bootstrap.distinctID;this.persistence.set_property(lo,(f=n.bootstrap)!=null&&f.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:g})}if(this.er()){var v,x,w=Object.keys(((v=n.bootstrap)==null?void 0:v.featureFlags)||{}).filter((T=>{var k;return!((k=n.bootstrap)==null||(k=k.featureFlags)==null||!k[T])})).reduce(((T,k)=>{var N;return T[k]=((N=n.bootstrap)==null||(N=N.featureFlags)==null?void 0:N[k])||!1,T}),{}),E=Object.keys(((x=n.bootstrap)==null?void 0:x.featureFlagPayloads)||{}).filter((T=>w[T])).reduce(((T,k)=>{var N,C;return(N=n.bootstrap)!=null&&(N=N.featureFlagPayloads)!=null&&N[k]&&(T[k]=(C=n.bootstrap)==null||(C=C.featureFlagPayloads)==null?void 0:C[k]),T}),{});this.featureFlags.receivedFeatureFlags({featureFlags:w,featureFlagPayloads:E})}if(c)this.register_once({distinct_id:bh,$device_id:null},"");else if(!this.get_distinct_id()){var S=this.config.get_device_id(Bl());this.register_once({distinct_id:S,$device_id:S},""),this.persistence.set_property(lo,"anonymous")}return jn(ue,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?jue(this,(()=>this.rr())):this.rr(),gs(this.config._onCapture)&&this.config._onCapture!==Dk&&(ke.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(T=>this.config._onCapture(T.event,T)))),this.config.ip&&ke.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}ir(t){var n=performance.now(),r=_e({},vs.__defaultExtensionClasses,this.config.__extensionClasses);r.historyAutocapture&&(this.historyAutocapture=new r.historyAutocapture(this),this.historyAutocapture.startIfEnabled());var a=[];r.tracingHeaders&&a.push((()=>{new r.tracingHeaders(this).startIfEnabledOrStop()})),r.siteApps&&a.push((()=>{var i;this.siteApps=new r.siteApps(this),(i=this.siteApps)==null||i.init()})),!t&&r.sessionRecording&&a.push((()=>{this.sessionRecording=new r.sessionRecording(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||a.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.autocapture&&a.push((()=>{this.autocapture=new r.autocapture(this),this.autocapture.startIfEnabled()})),a.push((()=>{this.surveys.loadIfEnabled()})),a.push((()=>{this.logs.loadIfEnabled()})),a.push((()=>{this.conversations.loadIfEnabled()})),r.productTours&&a.push((()=>{this.productTours=new r.productTours(this),this.productTours.loadIfEnabled()})),r.heatmaps&&a.push((()=>{this.heatmaps=new r.heatmaps(this),this.heatmaps.startIfEnabled()})),r.webVitalsAutocapture&&a.push((()=>{this.webVitalsAutocapture=new r.webVitalsAutocapture(this)})),r.exceptionObserver&&a.push((()=>{this.exceptionObserver=new r.exceptionObserver(this),this.exceptionObserver.startIfEnabledOrStop()})),r.deadClicksAutocapture&&a.push((()=>{this.deadClicksAutocapture=new r.deadClicksAutocapture(this,Pue),this.deadClicksAutocapture.startIfEnabledOrStop()})),a.push((()=>{if(this.sr){var i=this.sr;this.sr=void 0,this.qi(i)}})),this.nr(a,n)}nr(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout((()=>{this.nr(t,n)}),0);var r=t.shift();if(r)try{r()}catch(i){ke.error("Error initializing extension:",i)}}var a=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:a}),this.config.__preview_deferred_init_extensions&&ke.info("PostHog extensions initialized ("+a+"ms)")}qi(t){var n,r,a,i,o,l,c,d,f;if(!Se||!Se.body)return ke.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.qi(t)}),500);this.config.__preview_deferred_init_extensions&&(this.sr=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=ut(t.supportedCompression,hs.GZipJS)?hs.GZipJS:ut(t.supportedCompression,hs.Base64)?hs.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ge?this.Ge:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(t),(a=this.sessionRecording)==null||a.onRemoteConfig(t),(i=this.autocapture)==null||i.onRemoteConfig(t),(o=this.heatmaps)==null||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.logs.onRemoteConfig(t),this.conversations.onRemoteConfig(t),(l=this.productTours)==null||l.onRemoteConfig(t),(c=this.webVitalsAutocapture)==null||c.onRemoteConfig(t),(d=this.exceptionObserver)==null||d.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),(f=this.deadClicksAutocapture)==null||f.onRemoteConfig(t)}rr(){try{this.config.loaded(this)}catch(r){ke.critical("`loaded` function failed",r)}if(this.ar(),this.config.internal_or_test_user_hostname&&Sr!=null&&Sr.hostname){var t=Sr.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.lr()}),1),this.ur=new J8(this),this.ur.load()}ar(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Qe)==null||t.enable())}_dom_loaded(){this.is_capturing()&&ql(this.__request_queue,(t=>this.Ze(t))),this.__request_queue=[],this.ar()}_handle_unload(){var t,n;this.surveys.handlePageUnload(),this.config.request_batching?(this.hr()&&this.capture("$pageleave"),(t=this.Qe)==null||t.unload(),(n=this.tr)==null||n.unload()):this.hr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(tV?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=ky(t.url,{ip:this.config.ip?1:0}),t.headers=_e({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,a,i,o=_e({},n);o.timeout=o.timeout||6e4,o.url=ky(o.url,{_:new Date().getTime().toString(),ver:is.LIB_VERSION,compression:o.compression});var l=(r=o.transport)!==null&&r!==void 0?r:"fetch",c=Yv.filter((f=>!o.disableTransport||!f.transport||!o.disableTransport.includes(f.transport))),d=(a=(i=O8(c,(f=>f.transport===l)))==null?void 0:i.method)!==null&&a!==void 0?a:c[0].method;if(!d)throw new Error("No available transport method");d(o)})(_e({},t,{callback:n=>{var r,a;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(a=this.config).on_request_error)==null||r.call(a,n)),t.callback==null||t.callback(n)}}))))}Ze(t){this.tr?this.tr.retriableRequest(t):this._send_request(t)}_execute_array(t){ES++;try{var n,r=[],a=[],i=[];ql(t,(l=>{l&&(n=l[0],Nt(n)?i.push(l):gs(l)?l.call(this):Nt(l)&&n==="alias"?r.push(l):Nt(l)&&n.indexOf("capture")!==-1&&gs(this[n])?i.push(l):a.push(l))}));var o=function(l,c){ql(l,(function(d){if(Nt(d[0])){var f=c;Kt(d,(function(p){f=f[p[0]].apply(f,p.slice(1))}))}else this[d[0]].apply(this,d.slice(1))}),c)};o(r,this),o(a,this),o(i,this)}finally{ES--}}er(){var t,n;return((t=this.config.bootstrap)==null?void 0:t.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(t){if(ES>0&&Nt(t)&&$n(t[0])){var n=vs.prototype[t[0]];gs(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Qe){if(this.is_capturing())if(!Ae(t)&&$n(t)){var i=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(i&&!this.config.__preview_capture_bot_pageviews)){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){n!=null&&n.$current_url&&!$n(n==null?void 0:n.$current_url)&&(ke.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.ft||ke.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,c=(r==null?void 0:r.timestamp)||l,d=Bl(),f={uuid:d,event:t,properties:this.calculateEventProperties(t,n||{},c,d)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&i&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),o&&(f.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),r!=null&&r.$set&&(f.$set=r==null?void 0:r.$set);var p,g=t!=="$groupidentify",v=this.dr(r==null?void 0:r.$set_once,g);if(v&&(f.$set_once=v),(f=_ue(f,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=c,Ae(r==null?void 0:r.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=l),t===Wh.DISMISSED||t===Wh.SENT){var x=n==null?void 0:n[xS.SURVEY_ID],w=n==null?void 0:n[xS.SURVEY_ITERATION];p={id:x,current_iteration:w},localStorage.getItem(NB(p))||localStorage.setItem(NB(p),"true"),f.$set=_e({},f.$set,{[pce({id:x,current_iteration:w},t===Wh.SENT?"responded":"dismissed")]:!0})}else t===Wh.SHOWN&&(f.$set=_e({},f.$set,{[xS.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===wce.SHOWN){var E=n==null?void 0:n[OB.TOUR_TYPE];E&&(f.$set=_e({},f.$set,{[OB.TOUR_LAST_SEEN_DATE+"/"+E]:new Date().toISOString()}))}var S=_e({},f.properties.$set,f.$set);if(Hd(S)||this.setPersonPropertiesForFlags(S),!pt(this.config.before_send)){var T=this.vr(f);if(!T)return;f=T}this.Ft.emit("eventCaptured",f);var k={method:"POST",url:(a=r==null?void 0:r._url)!==null&&a!==void 0?a:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Ze(k):this.Qe.enqueue(k),f}ke.critical("This capture call is ignored due to client rate limiting.")}}else ke.error("No event name provided to posthog.capture")}else ke.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(n=>t(n.event,n)))}calculateEventProperties(t,n,r,a,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=i?void 0:this.persistence.remove_event_timer(t),l=_e({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(l.$cookieless_mode=!0),t==="$snapshot"){var c=_e({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=c.distinct_id,(!$n(l.distinct_id)&&!ks(l.distinct_id)||pk(l.distinct_id))&&ke.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var d,f=tce(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:p,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime());l.$session_id=p,l.$window_id=g}this.sessionPropsManager&&Nn(l,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&Nn(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=(v=this.tr)==null?void 0:v.length}catch(S){l.$sdk_debug_error_capturing_properties=String(S)}if(this.requestRouter.region===Yh.CUSTOM&&(l.$lib_custom_api_host=this.config.api_host),d=t!=="$pageview"||i?t!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,a),l=Nn(l,d),t==="$pageview"&&Se&&(l.title=Se.title),!Ae(o)){var x=r.getTime()-o;l.$duration=parseFloat((x/1e3).toFixed(3))}ya&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser"),(l=Nn({},f,this.persistence.properties(),this.sessionPersistence.properties(),l)).$is_identified=this._isIdentified(),Nt(this.config.property_denylist)?Kt(this.config.property_denylist,(function(S){delete l[S]})):ke.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var w=this.config.sanitize_properties;w&&(ke.error("sanitize_properties is deprecated. Use before_send instead"),l=w(l,t));var E=this.cr();return l.$process_person_profile=E,E&&!i&&this.pr("_calculate_event_properties"),l}dr(t,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.cr()||this.qe)return t;var a=this.persistence.get_initial_props(),i=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),o=Nn({},a,i||{},t||{}),l=this.config.sanitize_properties;return l&&(ke.error("sanitize_properties is deprecated. Use before_send instead"),o=l(o,"$set_once")),n&&(this.qe=!0),Hd(o)?void 0:o}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var a;(a=this.persistence)==null||a.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}_r(t,n){this.register({[t]:n})}getFeatureFlag(t,n){return this.featureFlags.getFeatureFlag(t,n)}getFeatureFlagPayload(t){return this.featureFlags.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){return this.featureFlags.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){return this.featureFlags.isFeatureEnabled(t,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,n,r){var a=r!=null&&r.merge?this.featureFlags.getFlagVariants():{},i=r!=null&&r.merge?this.featureFlags.getFlagPayloads():{},o=_e({},a,t),l=_e({},i,n),c={};for(var[d,f]of Object.entries(o)){var p=typeof f=="string";c[d]={key:d,enabled:!!p||!!f,variant:p?f:void 0,reason:void 0,metadata:Ae(l==null?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.featureFlags.receivedFeatureFlags({flags:c})}updateEarlyAccessFeatureEnrollment(t,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.Ft.on(t,n)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys.getSurveys(t,n)}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(t,n)}renderSurvey(t,n){this.surveys.renderSurvey(t,n)}displaySurvey(t,n){n===void 0&&(n=mce),this.surveys.displaySurvey(t,n)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(t,n)}identify(t,n,r){if(!this.__loaded||!this.persistence)return ke.uninitializedWarning("posthog.identify");if(ks(t)&&(t=t.toString(),ke.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))ke.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==bh){if(this.pr("posthog.identify")){var a=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var i=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}t!==a&&t!==this.get_property(zh)&&(this.unregister(zh),this.register({distinct_id:t}));var o=(this.persistence.get_property(lo)||"anonymous")==="anonymous";t!==a&&o?(this.persistence.set_property(lo,"identified"),this.setPersonPropertiesForFlags(_e({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:a},{$set:n||{},$set_once:r||{}}),this.Ve=_B(t,n,r),this.featureFlags.setAnonymousDistinctId(a)):(n||r)&&this.setPersonProperties(n,r),t!==a&&(this.reloadFeatureFlags(),this.unregister(vy))}}else ke.critical('The string "'+bh+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else ke.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this.pr("posthog.setPersonProperties")){var r=_B(this.get_distinct_id(),t,n);this.Ve!==r?(this.setPersonPropertiesForFlags(_e({},n||{},t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Ve=r):ke.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var a=this.getGroups();a[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:_e({},a,{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),a[t]===n||r||this.reloadFeatureFlags()}else ke.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){n===void 0&&(n=!0),this.pr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,n)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var n,r,a,i,o;if(ke.info("reset"),!this.__loaded)return ke.uninitializedWarning("posthog.reset");var l=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),(a=this.ur)==null||a.stop(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(lo,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Ve=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:bh,$device_id:null},"");else{var c=this.config.get_device_id(Bl());this.register_once({distinct_id:c,$device_id:t?c:l},"")}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 t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),a=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var i,o=(i=t.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return a;a+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return a}alias(t,n){return t===this.get_property(R8)?(ke.critical("Attempting to create alias for existing People user - aborting."),-2):this.pr("posthog.alias")?(Ae(n)&&(n=this.get_distinct_id()),t!==n?(this._r(zh,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(ke.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=_e({},this.config);if(Vn(t)){var r,a,i,o,l,c,d,f;Nn(this.config,LB(t));var p=this.Xe();(r=this.persistence)==null||r.update_config(this.config,n,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new vS(_e({},this.config,{persistence:"sessionStorage"}),p);var g=this.Je(this.config.debug);Es(g)&&(this.config.debug=g),Es(this.config.debug)&&(this.config.debug?(is.DEBUG=!0,dn.O()&&dn.j("ph_debug","true"),ke.info("set_config",{config:t,oldConfig:n,newConfig:_e({},this.config)})):(is.DEBUG=!1,dn.O()&&dn.L("ph_debug"))),(a=this.exceptionObserver)==null||a.onConfigChange(),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(l=this.heatmaps)==null||l.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(d=this.deadClicksAutocapture)==null||d.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.gr(),(f=this.externalIntegrations)==null||f.startIfEnabledOrStop()}}startSessionRecording(t){var n=t===!0,r={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(r).some(Boolean)){var a,i,o,l,c;(a=this.sessionManager)==null||a.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)==null||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("url")),r.event_trigger&&((c=this.sessionRecording)==null||c.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){var r=new Error("PostHog syntheticException"),a=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(_e({},a,n))}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:Bd;return n!==Bd&&(n=Bd+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(lo))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(lo))==="identified"}cr(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Hd(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[zh])&&((n=this.persistence)==null||(n=n.props)==null||!n[wy]))}hr(){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.cr()||this.pr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.pr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}pr(t){return this.config.person_profiles==="never"?(ke.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._r(wy,!0),!0)}Xe(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||t&&!!n}gr(){var t,n,r,a,i=this.Xe();return((t=this.persistence)==null?void 0:t.zt)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.zt)!==i&&((a=this.sessionPersistence)==null||a.set_disabled(i)),i}opt_in_capturing(t){var n;if(this.config.cookieless_mode!=="always"){if(this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()){var r,a,i,o,l;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(a=this.pageViewManager)==null||a.destroy(),this.sessionManager=new IB(this),this.pageViewManager=new vB(this),this.persistence&&(this.sessionPropsManager=new RB(this,this.sessionManager,this.persistence));var c=(i=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&i!==void 0?i:(l=vs.__defaultExtensionClasses)==null?void 0:l.sessionRecording;c&&(this.sessionRecording=new c(this),this.sessionRecording.startIfEnabledOrStop())}var d;this.consent.optInOut(!0),this.gr(),this.ar(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(Ae(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((d=t==null?void 0:t.captureEventName)!==null&&d!==void 0?d:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.lr()}else ke.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.gr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:bh,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.lr())):ke.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===ss.GRANTED?"granted":t===ss.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.gr()}_is_bot(){return ja?eV(ja,this.config.custom_blocked_useragents):void 0}lr(){Se&&(Se.visibilityState==="visible"?this.Be||(this.Be=!0,this.capture("$pageview",{title:Se.title},{send_instantly:!0}),this.We&&(Se.removeEventListener("visibilitychange",this.We),this.We=null)):this.We||(this.We=this.lr.bind(this),jn(Se,"visibilitychange",this.We)))}debug(t){t===!1?(ue==null||ue.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ue==null||ue.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}At(){var t,n,r,a,i,o,l,c=this.Ke||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(ke.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",a=!1,i=ke,o=(n="advanced_disable_flags")in(t=c)&&!pt(t[n]),l=r in t&&!pt(t[r]),o?t[n]:l?(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]):a)}vr(t){if(pt(this.config.before_send))return t;var n=Nt(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var a of n){if(r=a(r),pt(r)){var i="Event '"+t.event+"' was rejected in beforeSend function";return Ule(t.event)?ke.warn(i+". This can cause unexpected behavior."):ke.info(i),null}r.properties&&!Hd(r.properties)||ke.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.it)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Je(t){var n=Es(t)&&!t,r=dn.O()&&dn.A("ph_debug")==="true";return!n&&(!!r||t)}}vs.__defaultExtensionClasses={},(function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Eue(e.prototype[t[n]])})(vs,["identify"]);function PB(e){return e instanceof Element&&(e.id===M8||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function n0(e){return!!e&&e.nodeType===1}function Vl(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function nV(e){return!!e&&e.nodeType===3}function rV(e){return!!e&&e.nodeType===11}function JN(e){return e?e0(e).split(/\s+/):[]}function jB(e){var t=ue==null?void 0:ue.location.href;return!!(t&&e&&e.some((n=>t.match(n))))}function Oy(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return JN(t)}function aV(e){return pt(e)?null:e0(e).split(/(\s+)/).filter((t=>bm(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Zm(e){var t="";return Mk(e)&&!lV(e)&&e.childNodes&&e.childNodes.length&&Kt(e.childNodes,(function(n){var r;nV(n)&&n.textContent&&(t+=(r=aV(n.textContent))!==null&&r!==void 0?r:"")})),e0(t)}function FB(e){return Ae(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var eO=["a","button","form","input","select","textarea","label"];function iV(e,t){if(Ae(t))return!0;var n,r=function(i){if(t.some((o=>i.matches(o))))return{v:!0}};for(var a of e)if(n=r(a))return n.v;return!1}function oV(e){var t=e.parentNode;return!(!t||!n0(t))&&t}var Lce=["next","previous","prev",">","<"],$B=10,UB=[".ph-no-rageclick",".ph-no-capture"];function Pce(e,t){if(!ue||tO(e))return!1;var n,r,a;if(Es(t)?(n=!!t&&UB,r=void 0):(n=(a=t==null?void 0:t.css_selector_ignorelist)!==null&&a!==void 0?a:UB,r=t==null?void 0:t.content_ignorelist),n===!1)return!1;var{targetElementList:i}=sV(e,!1);return!(function(o,l){if(o===!1||Ae(o))return!1;var c;if(o===!0)c=Lce;else{if(!Nt(o))return!1;if(o.length>$B)return ke.error("[PostHog] content_ignorelist array cannot exceed "+$B+" items. Use css_selector_ignorelist for more complex matching."),!1;c=o.map((d=>d.toLowerCase()))}return l.some((d=>{var{safeText:f,ariaLabel:p}=d;return c.some((g=>f.includes(g)||p.includes(g)))}))})(r,i.map((o=>{var l;return{safeText:Zm(o).toLowerCase(),ariaLabel:((l=o.getAttribute("aria-label"))==null?void 0:l.toLowerCase().trim())||""}})))&&!iV(i,n)}var tO=e=>!e||Vl(e,"html")||!n0(e),sV=(e,t)=>{if(!ue||tO(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],a=e;a.parentNode&&!Vl(a,"body");)if(rV(a.parentNode))r.push(a.parentNode.host),a=a.parentNode.host;else{var i=oV(a);if(!i)break;if(t||eO.indexOf(i.tagName.toLowerCase())>-1)n=!0;else{var o=ue.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(i),a=i}return{parentIsUsefulElement:n,targetElementList:r}};function jce(e,t,n,r,a){var i,o,l,c;if(n===void 0&&(n=void 0),!ue||tO(e)||(i=n)!=null&&i.url_allowlist&&!jB(n.url_allowlist)||(o=n)!=null&&o.url_ignorelist&&jB(n.url_ignorelist))return!1;if((l=n)!=null&&l.dom_event_allowlist){var d=n.dom_event_allowlist;if(d&&!d.some((x=>t.type===x)))return!1}var{parentIsUsefulElement:f,targetElementList:p}=sV(e,r);if(!(function(x,w){var E=w==null?void 0:w.element_allowlist;if(Ae(E))return!0;var S,T=function(N){if(E.some((C=>N.tagName.toLowerCase()===C)))return{v:!0}};for(var k of x)if(S=T(k))return S.v;return!1})(p,n)||!iV(p,(c=n)==null?void 0:c.css_selector_allowlist))return!1;var g=ue.getComputedStyle(e);if(g&&g.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(a||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(a||["change","click"]).indexOf(t.type)>=0;default:return f?(a||["click"]).indexOf(t.type)>=0:(a||["click"]).indexOf(t.type)>=0&&(eO.indexOf(v)>-1||e.getAttribute("contenteditable")==="true")}}function Mk(e){for(var t=e;t.parentNode&&!Vl(t,"body");t=t.parentNode){var n=Oy(t);if(ut(n,"ph-sensitive")||ut(n,"ph-no-capture"))return!1}if(ut(Oy(e),"ph-include"))return!0;var r=e.type||"";if($n(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var a=e.name||e.id||"";return!($n(a)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,"")))}function lV(e){return!!(Vl(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Vl(e,"select")||Vl(e,"textarea")||e.getAttribute("contenteditable")==="true")}var uV="(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})",Fce=new RegExp("^(?:"+uV+")$"),$ce=new RegExp(uV),cV="\\d{3}-?\\d{2}-?\\d{4}",Uce=new RegExp("^("+cV+")$"),Bce=new RegExp("("+cV+")");function bm(e,t){return t===void 0&&(t=!0),!(pt(e)||$n(e)&&(e=e0(e),(t?Fce:$ce).test((e||"").replace(/[- ]/g,""))||(t?Uce:Bce).test(e)))}function dV(e){var t=Zm(e);return bm(t=(t+" "+fV(e)).trim())?t:""}function fV(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Kt(e.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var a=Zm(n);t=(t+" "+a).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+fV(n)).trim())}catch(i){ke.error("[AutoCapture]",i)}})),t}function zce(e){return(function(t){var n=t.map((r=>{var a,i,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var l of(r.attr_class.sort(),r.attr_class))o+="."+l.replace(/"/g,"");var c=_e({},r.text?{text:r.text}:{},{"nth-child":(a=r.nth_child)!==null&&a!==void 0?a:0,"nth-of-type":(i=r.nth_of_type)!==null&&i!==void 0?i:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),d={};return Wv(c).sort(((f,p)=>{var[g]=f,[v]=p;return g.localeCompare(v)})).forEach((f=>{var[p,g]=f;return d[BB(p.toString())]=BB(g.toString())})),o+=":",o+=Wv(d).map((f=>{var[p,g]=f;return p+'="'+g+'"'})).join("")}));return n.join(";")})((function(t){return t.map((n=>{var r,a,i={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(a=n.attr__href)==null?void 0:a.slice(0,2048),attr_class:Gce(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Wv(n).filter((o=>{var[l]=o;return l.indexOf("attr__")===0})).forEach((o=>{var[l,c]=o;return i.attributes[l]=c})),i}))})(e))}function BB(e){return e.replace(/"|\\"/g,'\\"')}function Gce(e){var t=e.attr__class;return t?Nt(t)?t:JN(t):void 0}class zB{constructor(t){this.disabled=t===!1;var n=Vn(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var a=this.clicks[this.clicks.length-1];if(a&&Math.abs(t-a.x)+Math.abs(n-a.y)<this.thresholdPx&&r-a.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var _S="$copy_autocapture",GB=pn("[AutoCapture]");function SS(e,t){return t.length>e?t.slice(0,e)+"...":t}function Hce(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!n0(t));return t}function qce(e,t,n,r){var a=e.tagName.toLowerCase(),i={tag_name:a};eO.indexOf(a)>-1&&!n&&(a.toLowerCase()==="a"||a.toLowerCase()==="button"?i.$el_text=SS(1024,dV(e)):i.$el_text=SS(1024,Zm(e)));var o=Oy(e);o.length>0&&(i.classes=o.filter((function(f){return f!==""}))),Kt(e.attributes,(function(f){var p;if((!lV(e)||["name","id","class","aria-label"].indexOf(f.name)!==-1)&&(r==null||!r.includes(f.name))&&!t&&bm(f.value)&&(p=f.name,!$n(p)||p.substring(0,10)!=="_ngcontent"&&p.substring(0,7)!=="_nghost")){var g=f.value;f.name==="class"&&(g=JN(g).join(" ")),i["attr__"+f.name]=SS(1024,g)}}));for(var l=1,c=1,d=e;d=Hce(d);)l++,d.tagName===e.tagName&&c++;return i.nth_child=l,i.nth_of_type=c,i}function Vce(e,t){for(var n,r,{e:a,maskAllElementAttributes:i,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,d=[e],f=e;f.parentNode&&!Vl(f,"body");)rV(f.parentNode)?(d.push(f.parentNode.host),f=f.parentNode.host):(d.push(f.parentNode),f=f.parentNode);var p,g=[],v={},x=!1,w=!1;if(Kt(d,(N=>{var C=Mk(N);N.tagName.toLowerCase()==="a"&&(x=N.getAttribute("href"),x=C&&x&&bm(x)&&x),ut(Oy(N),"ph-no-capture")&&(w=!0),g.push(qce(N,i,o,l));var O=(function(I){if(!Mk(I))return{};var D={};return Kt(I.attributes,(function(B){if(B.name&&B.name.indexOf("data-ph-capture-attribute")===0){var L=B.name.replace("data-ph-capture-attribute-",""),q=B.value;L&&q&&bm(q)&&(D[L]=q)}})),D})(N);Nn(v,O)})),w)return{props:{},explicitNoCapture:w};if(o||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?g[0].$el_text=dV(e):g[0].$el_text=Zm(e)),x){var E,S;g[0].attr__href=x;var T=(E=_y(x))==null?void 0:E.host,k=ue==null||(S=ue.location)==null?void 0:S.host;T&&k&&T!==k&&(p=x)}return{props:Nn({$event_type:a.type,$ce_version:1},c?{}:{$elements:g},{$elements_chain:zce(g)},(n=g[0])!=null&&n.$el_text?{$el_text:(r=g[0])==null?void 0:r.$el_text}:{},p&&a.type==="click"?{$external_click_url:p}:{},v)}}var Ah=pn("[ExceptionAutocapture]");function HB(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],a=n(r);return gs(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=a,()=>{e[t]=r}}catch{return()=>{}}}var Wce=pn("[TracingHeaders]"),El=pn("[Web Vitals]"),qB=9e5;pn("[SessionRecording]");var Lk="[SessionRecording]",Cd=pn(Lk),Yce=pn("[Heatmaps]");function VB(e){return Vn(e)&&"clientX"in e&&"clientY"in e&&ks(e.clientX)&&ks(e.clientY)}var WB=pn("[Product Tours]"),AS="ph_product_tours",Kce=["$set_once","$set"],_l=pn("[SiteApps]"),Xce={sessionRecording:class{get started(){var e;return!((e=this.mr)==null||!e.isStarted)}get status(){return this.mr?this.mr.status:this.br?this.yr?"lazy_loading":"disabled":"pending_config"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.br=!1,this.wr=!1,this.$r=void 0,this._instance=e,!this._instance.sessionManager)throw Cd.error("started without valid sessionManager"),new Error(Lk+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Lk+' cannot be used with cookieless_mode="always"')}get yr(){var e,t=!((e=this._instance.get_property(lv))==null||!e.enabled),n=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return ue&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(this.br&&(!this.yr||(t=this.mr)==null||!t.isStarted)){var n=!Ae(Object.assign)&&!Ae(Array.from);this.yr&&n?(this.Er(e),Cd.info("starting")):this.stopRecording()}}Er(e){var t,n,r;this.yr&&(ze!=null&&(t=ze.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=ze.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Sr(e):(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.kr,(a=>{if(a)return Cd.error("could not load recorder",a);this.Sr(e)})))}stopRecording(){var e,t;(e=this.$r)==null||e.call(this),this.$r=void 0,(t=this.mr)==null||t.stop()}Pr(){var e;(e=this._instance.persistence)==null||e.unregister(D8)}Tr(e){if(this._instance.persistence){var t,n,r=this._instance.persistence,a=()=>{var i=e.sessionRecording===!1?void 0:e.sessionRecording,o=i==null?void 0:i.sampleRate,l=pt(o)?null:parseFloat(o);pt(l)&&this.Pr();var c=i==null?void 0:i.minimumDurationMilliseconds;r.register({[lv]:_e({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:_e({capturePerformance:e.capturePerformance},i==null?void 0:i.networkPayloadCapture),canvasRecording:{enabled:i==null?void 0:i.recordCanvas,fps:i==null?void 0:i.canvasFps,quality:i==null?void 0:i.canvasQuality},sampleRate:l,minimumDurationMilliseconds:Ae(c)?null:c,endpoint:i==null?void 0:i.endpoint,triggerMatchType:i==null?void 0:i.triggerMatchType,masking:i==null?void 0:i.masking,urlTriggers:i==null?void 0:i.urlTriggers})})};a(),(t=this.$r)==null||t.call(this),this.$r=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(a)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.wr=!1,this.Tr(e),this.br=!0,this.startIfEnabledOrStop()):this.br=!0:Cd.info("skipping remote config with no sessionRecording",e)}log(e,t){var n;t===void 0&&(t="log"),(n=this.mr)!=null&&n.log?this.mr.log(e,t):Cd.warn("log called before recorder was ready")}get kr(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(lv);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Cr(){var e,t=this._instance.get_property(lv);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return Date.now()-n<=3e5}Sr(e){var t,n;if((t=ze.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.mr||(this.mr=(n=ze.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.mr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Cr()?this.mr.start(e):this.wr||(this.wr=!0,Cd.info("persisted remote config is stale, requesting fresh config before starting"),new J8(this._instance).load())}onRRwebEmit(e){var t;(t=this.mr)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.mr||(t=this._instance.persistence)==null||t.register({$replay_override_linked_flag:!0}),(e=this.mr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.mr||(t=this._instance.persistence)==null||t.register({$replay_override_sampling:!0}),(e=this.mr)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.mr||(n=this._instance.persistence)==null||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.mr)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.mr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.mr)==null||!n.tryAddCustomEvent(e,t))}}},Zce={autocapture:class{constructor(e){this.Ir=!1,this.Rr=null,this.Fr=!1,this.instance=e,this.rageclicks=new zB(e.config.rageclick),this.Or=null}get N(){var e,t,n=Vn(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map((r=>new RegExp(r))),n}Mr(){if(this.isBrowserSupported()){if(ue&&Se){var e=n=>{n=n||(ue==null?void 0:ue.event);try{this.Ar(n)}catch(r){GB.error("Failed to capture event",r)}};if(jn(Se,"submit",e,{capture:!0}),jn(Se,"change",e,{capture:!0}),jn(Se,"click",e,{capture:!0}),this.N.capture_copied_text){var t=n=>{n=n||(ue==null?void 0:ue.event),this.Ar(n,_S)};jn(Se,"copy",t,{capture:!0}),jn(Se,"cut",t,{capture:!0})}}}else GB.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ir&&(this.Mr(),this.Ir=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Fr=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[sB]:!!e.autocapture_opt_out}),this.Rr=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Or=e}getElementSelectors(e){var t,n=[];return(t=this.Or)==null||t.forEach((r=>{var a=Se==null?void 0:Se.querySelectorAll(r);a==null||a.forEach((i=>{e===i&&n.push(r)}))})),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[sB],r=this.Rr;if(Hi(r)&&!Es(n)&&!this.instance.At())return!1;var a=(t=this.Rr)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!a}Ar(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=FB(e);nV(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&Pce(r,this.instance.config.rageclick)&&this.Ar(e,"$rageclick");var a=t===_S;if(r&&jce(r,e,this.N,a,a?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:o}=Vce(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.Fr});if(o)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(i.$element_selectors=l),t===_S){var c,d=aV(ue==null||(c=ue.getSelection())==null?void 0:c.toString()),f=e.type||"clipboard";if(!d)return!1;i.$selected_content=d,i.$copy_type=f}return this.instance.capture(t,i),!0}}}isBrowserSupported(){return gs(Se==null?void 0:Se.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Dr=(ue==null||(t=ue.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(ke.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.jr&&this.jr(),this.jr=void 0,ke.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(ue&&ue.history){var n=this;(e=ue.history.pushState)!=null&&e.__posthog_wrapped__||HB(ue.history,"pushState",(r=>function(a,i,o){r.call(this,a,i,o),n.Lr("pushState")})),(t=ue.history.replaceState)!=null&&t.__posthog_wrapped__||HB(ue.history,"replaceState",(r=>function(a,i,o){r.call(this,a,i,o),n.Lr("replaceState")})),this.Nr()}}Lr(e){try{var t,n=ue==null||(t=ue.location)==null?void 0:t.pathname;if(!n)return;n!==this.Dr&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.Dr=n}catch(r){ke.error("Error capturing "+e+" pageview",r)}}Nr(){if(!this.jr){var e=()=>{this.Lr("popstate")};jn(ue,"popstate",e),this.jr=()=>{ue&&ue.removeEventListener("popstate",e)}}}},heatmaps:class{constructor(e){var t;this.Ur=!1,this.Ir=!1,this.zr=null,this.instance=e,this.Ur=!((t=this.instance.persistence)==null||!t.props[yk]),this.rageclicks=new zB(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return Vn(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 pt(this.instance.config.capture_heatmaps)?pt(this.instance.config.enable_heatmaps)?this.Ur:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Ir)return;Yce.info("starting..."),this.Hr(),this.qr()}else{var e;clearInterval((e=this.zr)!==null&&e!==void 0?e:void 0),this.Br(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[yk]:t}),this.Ur=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Wr(e){this.Gr(e.originalEvent,"deadclick")}qr(){this.zr&&clearInterval(this.zr),this.zr=(function(e){return(e==null?void 0:e.visibilityState)==="visible"})(Se)?setInterval(this.se.bind(this),this.flushIntervalMilliseconds):null}Hr(){ue&&Se&&(this.Vr=this.se.bind(this),jn(ue,"beforeunload",this.Vr),this.Jr=e=>this.Gr(e||(ue==null?void 0:ue.event)),jn(Se,"click",this.Jr,{capture:!0}),this.Kr=e=>this.Yr(e||(ue==null?void 0:ue.event)),jn(Se,"mousemove",this.Kr,{capture:!0}),this.Xr=new mB(this.instance,Lue,this.Wr.bind(this)),this.Xr.startIfEnabledOrStop(),this.Qr=this.qr.bind(this),jn(Se,"visibilitychange",this.Qr),this.Ir=!0)}Br(){var e;ue&&Se&&(this.Vr&&ue.removeEventListener("beforeunload",this.Vr),this.Jr&&Se.removeEventListener("click",this.Jr,{capture:!0}),this.Kr&&Se.removeEventListener("mousemove",this.Kr,{capture:!0}),this.Qr&&Se.removeEventListener("visibilitychange",this.Qr),clearTimeout(this.Zr),(e=this.Xr)==null||e.stop(),this.Ir=!1)}ts(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),i=(function(o,l,c){for(var d=o;d&&n0(d)&&!Vl(d,"body");){if(d===c)return!1;if(ut(l,ue==null?void 0:ue.getComputedStyle(d).position))return!0;d=oV(d)}return!1})(FB(e),["fixed","sticky"],a);return{x:e.clientX+(i?0:r),y:e.clientY+(i?0:n),target_fixed:i,type:t}}Gr(e,t){var n;if(t===void 0&&(t="click"),!PB(e.target)&&VB(e)){var r=this.ts(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.es(_e({},r,{type:"rageclick"})),this.es(r)}}Yr(e){!PB(e.target)&&VB(e)&&(clearTimeout(this.Zr),this.Zr=setTimeout((()=>{this.es(this.ts(e,"mousemove"))}),500))}es(e){if(ue){var t=ue.location.href,n=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,a=n?kf([],Of,r||[]):[],i=mm(t,a,gm);this.R=this.R||{},this.R[i]||(this.R[i]=[]),this.R[i].push(e)}}se(){this.R&&!Hd(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:mB,webVitalsAutocapture:class{constructor(e){var t;this.Ur=!1,this.Ir=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.rs=()=>{clearTimeout(this.ss),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,r)=>_e({},n,{["$web_vitals_"+r.name+"_event"]:_e({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ns=n=>{var r,a=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(Ae(a))El.error("Could not read session ID. Dropping metrics!");else{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.os();Ae(i)||(pt(n==null?void 0:n.name)||pt(n==null?void 0:n.value)?El.error("Invalid metric received",n):this.ls&&n.value>=this.ls?El.error("Ignoring metric with value >= "+this.ls,n):(this.R.url!==i&&(this.rs(),this.ss=setTimeout(this.rs,this.flushToCaptureTimeoutMs)),Ae(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Ae(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.R.metrics.push(_e({},n,{$current_url:i,$session_id:a.sessionId,$window_id:a.windowId,timestamp:Date.now()})),this.R.metrics.length===this.allowedMetrics.length&&this.rs()))}},this.us=()=>{if(!this.Ir){var n,r,a,i,o=ze.__PosthogExtensions__;Ae(o)||Ae(o.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:a,onINP:i}=o.postHogWebVitalsCallbacks),n&&r&&a&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.ns.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.ns.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&a(this.ns.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ns.bind(this)),this.Ir=!0):El.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Ur=!((t=this._instance.persistence)==null||!t.props[cB]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=Vn(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return pt(n)?((t=this._instance.persistence)==null?void 0:t.props[fB])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Vn(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Vn(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get ls(){var e=Vn(this._instance.config.capture_performance)&&ks(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:qB;return 0<e&&e<=6e4?qB:e}get isEnabled(){var e=Sr==null?void 0:Sr.protocol;if(e!=="http:"&&e!=="https:")return El.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Vn(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Es(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Es(t)?t:this.Ur}startIfEnabled(){this.isEnabled&&!this.Ir&&(El.info("enabled, starting..."),this.V(this.us))}onRemoteConfig(e){if("capturePerformance"in e){var t=Vn(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Vn(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[cB]:t}),this._instance.persistence.register({[fB]:n})),this.Ur=t,this.startIfEnabled()}}V(e){var t,n;if((t=ze.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks)e();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=ze.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,r,(a=>{a?El.error("failed to load script",a):e()}))}}os(){var e=ue?ue.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,r=t?kf([],Of,n||[]):[];return mm(e,r,gm)}El.error("Could not determine current URL")}}},Qce={exceptionObserver:class{constructor(e){var t,n,r;this.us=()=>{var a;if(ue&&this.isEnabled&&(a=ze.__PosthogExtensions__)!=null&&a.errorWrappingFunctions){var i=ze.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=ze.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=ze.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.hs&&this.N.capture_unhandled_errors&&(this.hs=i(this.captureException.bind(this))),!this.ds&&this.N.capture_unhandled_rejections&&(this.ds=o(this.captureException.bind(this))),!this.vs&&this.N.capture_console_errors&&(this.vs=l(this.captureException.bind(this)))}catch(c){Ah.error("failed to start",c),this.cs()}}},this._instance=e,this.fs=!((t=this._instance.persistence)==null||!t.props[lB]),this.ps=new Gle({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:Ah}),this.N=this._s(),this.startIfEnabledOrStop()}_s(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Vn(e)?t=_e({},t,e):(Ae(e)?this.fs:e)&&(t=_e({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Ah.info("enabled"),this.cs(),this.V(this.us)):this.cs()}V(e){var t,n;(t=ze.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=ze.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return Ah.error("failed to load script",r);e()}))}cs(){var e,t,n;(e=this.hs)==null||e.call(this),this.hs=void 0,(t=this.ds)==null||t.call(this),this.ds=void 0,(n=this.vs)==null||n.call(this),this.vs=void 0}onRemoteConfig(e){if("autocaptureExceptions"in e){var t=e.autocaptureExceptions;this.fs=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[lB]:this.fs}),this.N=this._s(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this._s()}captureException(e){var t,n,r=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.ps.consumeRateLimit(r)?Ah.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}}},Jce={productTours:class{constructor(e){this.gs=null,this.bs=null,this._instance=e}onRemoteConfig(e){"productTours"in e&&(this._instance.persistence&&this._instance.persistence.register({[dB]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.gs||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(dB)||this.V((()=>this.ys()))}V(e){var t,n;(t=ze.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=ze.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?WB.error("Could not load product tours script",r):e()}))}ys(){var e;!this.gs&&(e=ze.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.gs=ze.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Nt(this.bs)||t){var n=this._instance.persistence;if(n){var r=n.props[AS];if(Nt(r)&&!t)return this.bs=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:a=>{var i=a.statusCode;if(i!==200||!a.json){var o="Product Tours API could not be loaded, status: "+i;return WB.error(o),void e([],{isLoaded:!1,error:o})}var l=Nt(a.json.product_tours)?a.json.product_tours:[];this.bs=l,n&&n.register({[AS]:l}),e(l,{isLoaded:!0})}})}else e(this.bs,{isLoaded:!0})}getActiveProductTours(e){pt(this.gs)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.gs.getActiveProductTours(e)}showProductTour(e){var t;(t=this.gs)==null||t.showTourById(e)}previewTour(e){this.gs?this.gs.previewTour(e):this.V((()=>{var t;this.ys(),(t=this.gs)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.gs)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.gs)==null||e.nextStep()}previousStep(){var e;(e=this.gs)==null||e.previousStep()}clearCache(){var e;this.bs=null,(e=this._instance.persistence)==null||e.unregister(AS)}resetTour(e){var t;(t=this.gs)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.gs)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.gs)==null||t.cancelPendingTour(e)}}},ede={siteApps:class{constructor(e){this._instance=e,this.ws=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}xs(e,t){if(t){var n=this.globalsForEvent(t);this.ws.push(n),this.ws.length>1e3&&(this.ws=this.ws.slice(10))}}get siteAppLoaders(){var e;return(e=ze._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.xs.bind(this));this.$s=()=>{e(),this.ws=[],this.$s=void 0}}}globalsForEvent(e){var t,n,r,a,i,o,l;if(!e)throw new Error("Event payload is required");var c={},d=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(var[p,g]of Object.entries(f))c[p]={id:d[p],type:p,properties:g};var{$set_once:v,$set:x}=e;return{event:_e({},o8(e,Kce),{properties:_e({},e.properties,x?{$set:_e({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},x)}:{},v?{$set_once:_e({},(r=(a=e.properties)==null?void 0:a.$set_once)!==null&&r!==void 0?r:{},v)}:{}),elements_chain:(i=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var o;!t.errored&&this.ws.length&&(_l.info("Processing "+this.ws.length+" events for site app with id "+e.id),this.ws.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.$s)==null||o.call(this))},r=!1,a=o=>{t.errored=!o,t.loaded=!0,_l.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&n()};try{var{processEvent:i}=e.init({posthog:this._instance,callback:o=>{a(o)}});i&&(t.processEvent=i),r=!0}catch(o){_l.error("Error while initializing PostHog app with config id "+e.id,o),a(!1)}if(r&&t.loaded)try{n()}catch(o){_l.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}Es(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Ss(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){_l.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,a=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Es(),void this._instance.on("eventCaptured",(c=>this.Ss(c)))):void _l.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.$s)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var i=function(c){var d;ze["__$$ph_site_app_"+c]=a._instance,(d=ze.__PosthogExtensions__)==null||d.loadSiteApp==null||d.loadSiteApp(a._instance,l,(f=>{if(f)return _l.error("Error while initializing PostHog app with config id "+c,f)}))};for(var{id:o,url:l}of e.siteApps)i(o)}else _l.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},tde=_e({},Xce,Zce,Qce,Jce,ede,{tracingHeaders:class{constructor(e){this.ks=void 0,this.Ps=void 0,this.us=()=>{var t,n;Ae(this.ks)&&((t=ze.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),Ae(this.Ps)&&((n=ze.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}V(e){var t,n;(t=ze.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=ze.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return Wce.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.V(this.us):((e=this.ks)==null||e.call(this),(t=this.Ps)==null||t.call(this),this.ks=void 0,this.Ps=void 0)}}});vs.__defaultExtensionClasses=_e({},tde);var YB,Cy=(YB=tm[Bd]=new vs,(function(){function e(){e.done||(e.done=!0,tV=!1,Kt(tm,(function(t){t._dom_loaded()})))}Se!=null&&Se.addEventListener?Se.readyState==="complete"?e():jn(Se,"DOMContentLoaded",e,{capture:!1}):ue&&ke.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),YB);const nde="phc_552ZSApq5xuagswylfdw2vx8nckm31jn6LCpTVyVn8j",rde="https://us.i.posthog.com";let Ry=!1;async function ade(){if(!Ry)try{const e=await fetch("/api/telemetry/identity");if(!e.ok)return;const t=await e.json();if(!t.enabled)return;Cy.init(nde,{api_host:rde,autocapture:!1,capture_pageview:!1,capture_pageleave:!1,persistence:"memory",disable_session_recording:!0,ip:!1}),t.distinct_id&&Cy.identify(t.distinct_id),Ry=!0}catch{}}function ide(e){if(Ry)try{Cy.capture("$pageview",{$current_url:e})}catch{}}function ode(e,t){if(Ry)try{Cy.capture("dashboard_loaded",{page:e,load_time_ms:t})}catch{}}function KB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function r0(...e){return t=>{let n=!1;const r=e.map(a=>{const i=KB(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():KB(e[a],null)}}}}function At(...e){return y.useCallback(r0(...e),e)}function pc(e){const t=sde(e),n=y.forwardRef((r,a)=>{const{children:i,...o}=r,l=y.Children.toArray(i),c=l.find(lde);if(c){const d=c.props.children,f=l.map(p=>p===c?y.Children.count(d)>1?y.Children.only(null):y.isValidElement(d)?d.props.children:null:p);return m.jsx(t,{...o,ref:a,children:y.isValidElement(d)?y.cloneElement(d,void 0,f):null})}return m.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var pV=pc("Slot");function sde(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const o=cde(a),l=ude(i,a.props);return a.type!==y.Fragment&&(l.ref=r?r0(r,o):o),y.cloneElement(a,l)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hV=Symbol("radix.slottable");function mV(e){const t=({children:n})=>m.jsx(m.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=hV,t}function lde(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hV}function ude(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function cde(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dde=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=dde.reduce((e,t)=>{const n=pc(`Primitive.${t}`),r=y.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gV(e,t){e&&su.flushSync(()=>e.dispatchEvent(t))}var bV=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fde="VisuallyHidden",vV=y.forwardRef((e,t)=>m.jsx(Xe.span,{...e,ref:t,style:{...bV,...e.style}}));vV.displayName=fde;var pde=vV;function hde(e,t){const n=y.createContext(t),r=i=>{const{children:o,...l}=i,c=y.useMemo(()=>l,Object.values(l));return m.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function a(i){const o=y.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function qi(e,t=[]){let n=[];function r(i,o){const l=y.createContext(o),c=n.length;n=[...n,o];const d=p=>{var S;const{scope:g,children:v,...x}=p,w=((S=g==null?void 0:g[e])==null?void 0:S[c])||l,E=y.useMemo(()=>x,Object.values(x));return m.jsx(w.Provider,{value:E,children:v})};d.displayName=i+"Provider";function f(p,g){var w;const v=((w=g==null?void 0:g[e])==null?void 0:w[c])||l,x=y.useContext(v);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,f]}const a=()=>{const i=n.map(o=>y.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,mde(a,...t)]}function mde(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function nO(e){const t=e+"CollectionProvider",[n,r]=qi(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:E,children:S}=w,T=ye.useRef(null),k=ye.useRef(new Map).current;return m.jsx(a,{scope:E,itemMap:k,collectionRef:T,children:S})};o.displayName=t;const l=e+"CollectionSlot",c=pc(l),d=ye.forwardRef((w,E)=>{const{scope:S,children:T}=w,k=i(l,S),N=At(E,k.collectionRef);return m.jsx(c,{ref:N,children:T})});d.displayName=l;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=pc(f),v=ye.forwardRef((w,E)=>{const{scope:S,children:T,...k}=w,N=ye.useRef(null),C=At(E,N),O=i(f,S);return ye.useEffect(()=>(O.itemMap.set(N,{ref:N,...k}),()=>void O.itemMap.delete(N))),m.jsx(g,{[p]:"",ref:C,children:T})});v.displayName=f;function x(w){const E=i(e+"CollectionConsumer",w);return ye.useCallback(()=>{const T=E.collectionRef.current;if(!T)return[];const k=Array.from(T.querySelectorAll(`[${p}]`));return Array.from(E.itemMap.values()).sort((O,I)=>k.indexOf(O.ref.current)-k.indexOf(I.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:o,Slot:d,ItemSlot:v},x,r]}function Ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}var Tr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},gde=_N[" useInsertionEffect ".trim().toString()]||Tr;function Kl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=bde({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:a;{const f=y.useRef(e!==void 0);y.useEffect(()=>{const p=f.current;p!==l&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=l},[l,r])}const d=y.useCallback(f=>{var p;if(l){const g=vde(f)?f(e):f;g!==e&&((p=o.current)==null||p.call(o,g))}else i(f)},[l,e,i,o]);return[c,d]}function bde({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),a=y.useRef(n),i=y.useRef(t);return gde(()=>{i.current=t},[t]),y.useEffect(()=>{var o;a.current!==n&&((o=i.current)==null||o.call(i,n),a.current=n)},[n,a]),[n,r,i]}function vde(e){return typeof e=="function"}function yde(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var wi=e=>{const{present:t,children:n}=e,r=xde(t),a=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=At(r.ref,wde(a));return typeof n=="function"||r.isPresent?y.cloneElement(a,{ref:i}):null};wi.displayName="Presence";function xde(e){const[t,n]=y.useState(),r=y.useRef(null),a=y.useRef(e),i=y.useRef("none"),o=e?"mounted":"unmounted",[l,c]=yde(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const d=pv(r.current);i.current=l==="mounted"?d:"none"},[l]),Tr(()=>{const d=r.current,f=a.current;if(f!==e){const g=i.current,v=pv(d);e?c("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(f&&g!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),Tr(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=v=>{const w=pv(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(c("ANIMATION_END"),!a.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},g=v=>{v.target===t&&(i.current=pv(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function pv(e){return(e==null?void 0:e.animationName)||"none"}function wde(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ede=_N[" useId ".trim().toString()]||(()=>{}),_de=0;function pi(e){const[t,n]=y.useState(Ede());return Tr(()=>{n(r=>r??String(_de++))},[e]),e||(t?`radix-${t}`:"")}var a0="Collapsible",[Sde]=qi(a0),[Ade,rO]=Sde(a0),yV=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...l}=e,[c,d]=Kl({prop:r,defaultProp:a??!1,onChange:o,caller:a0});return m.jsx(Ade,{scope:n,disabled:i,contentId:pi(),open:c,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),children:m.jsx(Xe.div,{"data-state":iO(c),"data-disabled":i?"":void 0,...l,ref:t})})});yV.displayName=a0;var xV="CollapsibleTrigger",wV=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=rO(xV,n);return m.jsx(Xe.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":iO(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Ie(e.onClick,a.onOpenToggle)})});wV.displayName=xV;var aO="CollapsibleContent",EV=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=rO(aO,e.__scopeCollapsible);return m.jsx(wi,{present:n||a.open,children:({present:i})=>m.jsx(Tde,{...r,ref:t,present:i})})});EV.displayName=aO;var Tde=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=rO(aO,n),[l,c]=y.useState(r),d=y.useRef(null),f=At(t,d),p=y.useRef(0),g=p.current,v=y.useRef(0),x=v.current,w=o.open||l,E=y.useRef(w),S=y.useRef(void 0);return y.useEffect(()=>{const T=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(T)},[]),Tr(()=>{const T=d.current;if(T){S.current=S.current||{transitionDuration:T.style.transitionDuration,animationName:T.style.animationName},T.style.transitionDuration="0s",T.style.animationName="none";const k=T.getBoundingClientRect();p.current=k.height,v.current=k.width,E.current||(T.style.transitionDuration=S.current.transitionDuration,T.style.animationName=S.current.animationName),c(r)}},[o.open,r]),m.jsx(Xe.div,{"data-state":iO(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!w,...i,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:w&&a})});function iO(e){return e?"open":"closed"}var kde=yV,Nde=y.createContext(void 0);function i0(e){const t=y.useContext(Nde);return e||t||"ltr"}function Ao(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ode(e,t=globalThis==null?void 0:globalThis.document){const n=Ao(e);y.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Cde="DismissableLayer",Pk="dismissableLayer.update",Rde="dismissableLayer.pointerDownOutside",Ide="dismissableLayer.focusOutside",XB,_V=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qm=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,d=y.useContext(_V),[f,p]=y.useState(null),g=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=y.useState({}),x=At(t,I=>p(I)),w=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=w.indexOf(E),T=f?w.indexOf(f):-1,k=d.layersWithOutsidePointerEventsDisabled.size>0,N=T>=S,C=Lde(I=>{const D=I.target,B=[...d.branches].some(L=>L.contains(D));!N||B||(a==null||a(I),o==null||o(I),I.defaultPrevented||l==null||l())},g),O=Pde(I=>{const D=I.target;[...d.branches].some(L=>L.contains(D))||(i==null||i(I),o==null||o(I),I.defaultPrevented||l==null||l())},g);return Ode(I=>{T===d.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&l&&(I.preventDefault(),l()))},g),y.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(XB=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ZB(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=XB)}},[f,g,n,d]),y.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ZB())},[f,d]),y.useEffect(()=>{const I=()=>v({});return document.addEventListener(Pk,I),()=>document.removeEventListener(Pk,I)},[]),m.jsx(Xe.div,{...c,ref:x,style:{pointerEvents:k?N?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,C.onPointerDownCapture)})});Qm.displayName=Cde;var Dde="DismissableLayerBranch",Mde=y.forwardRef((e,t)=>{const n=y.useContext(_V),r=y.useRef(null),a=At(t,r);return y.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),m.jsx(Xe.div,{...e,ref:a})});Mde.displayName=Dde;function Lde(e,t=globalThis==null?void 0:globalThis.document){const n=Ao(e),r=y.useRef(!1),a=y.useRef(()=>{});return y.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){SV(Rde,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Pde(e,t=globalThis==null?void 0:globalThis.document){const n=Ao(e),r=y.useRef(!1);return y.useEffect(()=>{const a=i=>{i.target&&!r.current&&SV(Ide,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ZB(){const e=new CustomEvent(Pk);document.dispatchEvent(e)}function SV(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?gV(a,i):a.dispatchEvent(i)}var TS="focusScope.autoFocusOnMount",kS="focusScope.autoFocusOnUnmount",QB={bubbles:!1,cancelable:!0},jde="FocusScope",o0=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=y.useState(null),d=Ao(a),f=Ao(i),p=y.useRef(null),g=At(t,w=>c(w)),v=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let w=function(k){if(v.paused||!l)return;const N=k.target;l.contains(N)?p.current=N:kl(p.current,{select:!0})},E=function(k){if(v.paused||!l)return;const N=k.relatedTarget;N!==null&&(l.contains(N)||kl(p.current,{select:!0}))},S=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&kl(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",E);const T=new MutationObserver(S);return l&&T.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",E),T.disconnect()}}},[r,l,v.paused]),y.useEffect(()=>{if(l){ez.add(v);const w=document.activeElement;if(!l.contains(w)){const S=new CustomEvent(TS,QB);l.addEventListener(TS,d),l.dispatchEvent(S),S.defaultPrevented||(Fde(Gde(AV(l)),{select:!0}),document.activeElement===w&&kl(l))}return()=>{l.removeEventListener(TS,d),setTimeout(()=>{const S=new CustomEvent(kS,QB);l.addEventListener(kS,f),l.dispatchEvent(S),S.defaultPrevented||kl(w??document.body,{select:!0}),l.removeEventListener(kS,f),ez.remove(v)},0)}}},[l,d,f,v]);const x=y.useCallback(w=>{if(!n&&!r||v.paused)return;const E=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(E&&S){const T=w.currentTarget,[k,N]=$de(T);k&&N?!w.shiftKey&&S===N?(w.preventDefault(),n&&kl(k,{select:!0})):w.shiftKey&&S===k&&(w.preventDefault(),n&&kl(N,{select:!0})):S===T&&w.preventDefault()}},[n,r,v.paused]);return m.jsx(Xe.div,{tabIndex:-1,...o,ref:g,onKeyDown:x})});o0.displayName=jde;function Fde(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(kl(r,{select:t}),document.activeElement!==n)return}function $de(e){const t=AV(e),n=JB(t,e),r=JB(t.reverse(),e);return[n,r]}function AV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function JB(e,t){for(const n of e)if(!Ude(n,{upTo:t}))return n}function Ude(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Bde(e){return e instanceof HTMLInputElement&&"select"in e}function kl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Bde(e)&&t&&e.select()}}var ez=zde();function zde(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=tz(e,t),e.unshift(t)},remove(t){var n;e=tz(e,t),(n=e[0])==null||n.resume()}}}function tz(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Gde(e){return e.filter(t=>t.tagName!=="A")}var Hde="Portal",Jm=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,i]=y.useState(!1);Tr(()=>i(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?$q.createPortal(m.jsx(Xe.div,{...r,ref:t}),o):null});Jm.displayName=Hde;var NS=0;function oO(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??nz()),document.body.insertAdjacentElement("beforeend",e[1]??nz()),NS++,()=>{NS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),NS--}},[])}function nz(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var bo=function(){return bo=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},bo.apply(this,arguments)};function TV(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function qde(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Kv="right-scroll-bar-position",Xv="width-before-scroll-bar",Vde="with-scroll-bars-hidden",Wde="--removed-body-scroll-bar-size";function OS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yde(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var Kde=typeof window<"u"?y.useLayoutEffect:y.useEffect,rz=new WeakMap;function Xde(e,t){var n=Yde(null,function(r){return e.forEach(function(a){return OS(a,r)})});return Kde(function(){var r=rz.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(l){i.has(l)||OS(l,null)}),i.forEach(function(l){a.has(l)||OS(l,o)})}rz.set(n,e)},[e]),n}function Zde(e){return e}function Qde(e,t){t===void 0&&(t=Zde);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return a}function Jde(e){e===void 0&&(e={});var t=Qde(null);return t.options=bo({async:!0,ssr:!1},e),t}var kV=function(e){var t=e.sideCar,n=TV(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,bo({},n))};kV.isSideCarExport=!0;function efe(e,t){return e.useMedium(t),kV}var NV=Jde(),CS=function(){},s0=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:CS,onWheelCapture:CS,onTouchMoveCapture:CS}),a=r[0],i=r[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,p=e.shards,g=e.sideCar,v=e.noRelative,x=e.noIsolation,w=e.inert,E=e.allowPinchZoom,S=e.as,T=S===void 0?"div":S,k=e.gapMode,N=TV(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=g,O=Xde([n,t]),I=bo(bo({},N),a);return y.createElement(y.Fragment,null,f&&y.createElement(C,{sideCar:NV,removeScrollBar:d,shards:p,noRelative:v,noIsolation:x,inert:w,setCallbacks:i,allowPinchZoom:!!E,lockRef:n,gapMode:k}),o?y.cloneElement(y.Children.only(l),bo(bo({},I),{ref:O})):y.createElement(T,bo({},I,{className:c,ref:O}),l))});s0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};s0.classNames={fullWidth:Xv,zeroRight:Kv};var tfe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nfe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tfe();return t&&e.setAttribute("nonce",t),e}function rfe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function afe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ife=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nfe())&&(rfe(t,n),afe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ofe=function(){var e=ife();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},OV=function(){var e=ofe(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},sfe={left:0,top:0,right:0,gap:0},RS=function(e){return parseInt(e||"",10)||0},lfe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[RS(n),RS(r),RS(a)]},ufe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return sfe;var t=lfe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},cfe=OV(),Qd="data-scroll-locked",dfe=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
64
+ `)).length,a=0;a<r;a++){var o=e.charCodeAt(a),l=null;o<128?n++:l=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),Hi(l)||(n>t&&(i+=e.substring(t,n)),i+=l,t=n=a+1)}return n>t&&(i+=e.substring(t,e.length)),i},Xue=!!dk||!!ck,ky=function(e,t,n){var r;n===void 0&&(n=!0);var[a,i]=e.split("?"),o=_e({},t),l=(r=i==null?void 0:i.split("&").map((d=>{var f,[p,g]=d.split("="),v=n&&(f=o[p])!==null&&f!==void 0?f:g;return delete o[p],p+"="+v})))!==null&&r!==void 0?r:[],c=$ue(o);return c&&l.push(c),a+"?"+l.join("&")},Vh=(e,t)=>JSON.stringify(e,((n,r)=>typeof r=="bigint"?r.toString():r),t),mS=e=>{var{data:t,compression:n}=e;if(t){if(n===hs.GZipJS){var r=Yue((function(l,c){var d=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var f=new fi(l.length+(l.length>>>1)),p=0,g=function(E){f[p++]=E},v=0;v<d;++v){if(p+5>f.length){var x=new fi(p+8+(d-v<<1));x.set(f),f=x}var w=l.charCodeAt(v);w<128||c?g(w):w<2048?(g(192|w>>>6),g(128|63&w)):w>55295&&w<57344?(g(240|(w=65536+(1047552&w)|1023&l.charCodeAt(++v))>>>18),g(128|w>>>12&63),g(128|w>>>6&63),g(128|63&w)):(g(224|w>>>12),g(128|w>>>6&63),g(128|63&w))}return z8(f,0,p)})(Vh(t)),{mtime:0});return{contentType:"text/plain",body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(n===hs.Base64){var a=(function(l){var c,d,f,p,g,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",x=0,w=0,E="",S=[];if(!l)return l;l=Kue(l);do c=(g=l.charCodeAt(x++)<<16|l.charCodeAt(x++)<<8|l.charCodeAt(x++))>>18&63,d=g>>12&63,f=g>>6&63,p=63&g,S[w++]=v.charAt(c)+v.charAt(d)+v.charAt(f)+v.charAt(p);while(x<l.length);switch(E=S.join(""),l.length%3){case 1:E=E.slice(0,-2)+"==";break;case 2:E=E.slice(0,-1)+"="}return E})(Vh(t)),i=(l=>"data="+encodeURIComponent(typeof l=="string"?l:Vh(l)))(a);return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var o=Vh(t);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Yv=[];ck&&Yv.push({transport:"fetch",method:e=>{var t,n,{contentType:r,body:a,estimatedSize:i}=(t=mS(e))!==null&&t!==void 0?t:{},o=new Headers;Kt(e.headers,(function(f,p){o.append(p,f)})),r&&o.append("Content-Type",r);var l=e.url,c=null;if(XU){var d=new XU;c={signal:d.signal,timeout:setTimeout((()=>d.abort()),e.timeout)}}ck(l,_e({method:(e==null?void 0:e.method)||"GET",headers:o,keepalive:e.method==="POST"&&(i||0)<52428.8,body:a,signal:(n=c)==null?void 0:n.signal},e.fetchOptions)).then((f=>f.text().then((p=>{var g={statusCode:f.status,text:p};if(f.status===200)try{g.json=JSON.parse(p)}catch(v){ke.error(v)}e.callback==null||e.callback(g)})))).catch((f=>{ke.error(f),e.callback==null||e.callback({statusCode:0,error:f})})).finally((()=>c?clearTimeout(c.timeout):null))}}),dk&&Yv.push({transport:"XHR",method:e=>{var t,n=new dk;n.open(e.method||"GET",e.url,!0);var{contentType:r,body:a}=(t=mS(e))!==null&&t!==void 0?t:{};Kt(e.headers,(function(i,o){n.setRequestHeader(o,i)})),r&&n.setRequestHeader("Content-Type",r),e.timeout&&(n.timeout=e.timeout),e.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var i={statusCode:n.status,text:n.responseText};if(n.status===200)try{i.json=JSON.parse(n.responseText)}catch{}e.callback==null||e.callback(i)}},n.send(a)}}),ja!=null&&ja.sendBeacon&&Yv.push({transport:"sendBeacon",method:e=>{var t=ky(e.url,{beacon:"1"});try{var n,{contentType:r,body:a}=(n=mS(e))!==null&&n!==void 0?n:{},i=typeof a=="string"?new Blob([a],{type:r}):a;ja.sendBeacon(t,i)}catch{}}});var Ny=function(e,t){if(!(function(n){try{new RegExp(n)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function _B(e,t,n){return Vh({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:n})}var G8={exact:(e,t)=>t.some((n=>e.some((r=>n===r)))),is_not:(e,t)=>t.every((n=>e.every((r=>n!==r)))),regex:(e,t)=>t.some((n=>e.some((r=>Ny(n,r))))),not_regex:(e,t)=>t.every((n=>e.every((r=>!Ny(n,r))))),icontains:(e,t)=>t.map(dv).some((n=>e.map(dv).some((r=>n.includes(r))))),not_icontains:(e,t)=>t.map(dv).every((n=>e.map(dv).every((r=>!n.includes(r))))),gt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((a=>r>parseFloat(a)))})),lt:(e,t)=>t.some((n=>{var r=parseFloat(n);return!isNaN(r)&&e.some((a=>r<parseFloat(a)))}))},dv=e=>e.toLowerCase();function H8(e,t){return!e||Object.entries(e).every((n=>{var[r,a]=n,i=t==null?void 0:t[r];if(Ae(i)||Hi(i))return!1;var o=[String(i)],l=G8[a.operator];return!!l&&l(a.values,o)}))}var gS=pn("[Error tracking]");class Zue{constructor(t){var n,r;this.nt=[],this.ot=new nue([new due,new xue,new pue,new fue,new vue,new bue,new mue,new yue],cue()),this._instance=t,this.nt=(n=(r=this._instance.persistence)==null?void 0:r.get_property(xk))!==null&&n!==void 0?n:[]}onRemoteConfig(t){var n,r,a;if("errorTracking"in t){var i=(n=(r=t.errorTracking)==null?void 0:r.suppressionRules)!==null&&n!==void 0?n:[],o=(a=t.errorTracking)==null?void 0:a.captureExtensionExceptions;this.nt=i,this._instance.persistence&&this._instance.persistence.register({[xk]:this.nt,[uB]:o})}}get ut(){var t,n=!!this._instance.get_property(uB),r=this._instance.config.error_tracking.captureExtensionExceptions;return(t=r??n)!==null&&t!==void 0&&t}buildProperties(t,n){return this.ot.buildFromUnknown(t,{syntheticException:n==null?void 0:n.syntheticException,mechanism:{handled:n==null?void 0:n.handled}})}sendExceptionEvent(t){var n=t.$exception_list;if(this.ht(n)){if(this.dt(n))return void gS.info("Skipping exception capture because a suppression rule matched");if(!this.ut&&this.vt(n))return void gS.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ct(n))return void gS.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",ft:!0})}dt(t){if(t.length===0)return!1;var n=t.reduce(((r,a)=>{var{type:i,value:o}=a;return $n(i)&&i.length>0&&r.$exception_types.push(i),$n(o)&&o.length>0&&r.$exception_values.push(o),r}),{$exception_types:[],$exception_values:[]});return this.nt.some((r=>{var a=r.values.map((i=>{var o,l=G8[i.operator],c=Nt(i.value)?i.value:[i.value],d=(o=n[i.key])!==null&&o!==void 0?o:[];return c.length>0&&l(c,d)}));return r.type==="OR"?a.some(Boolean):a.every(Boolean)}))}vt(t){return t.flatMap((n=>{var r,a;return(r=(a=n.stacktrace)==null?void 0:a.frames)!==null&&r!==void 0?r:[]})).some((n=>n.filename&&n.filename.startsWith("chrome-extension://")))}ct(t){if(t.length>0){var n,r,a,i,o=(n=(r=t[0].stacktrace)==null?void 0:r.frames)!==null&&n!==void 0?n:[],l=o[o.length-1];return(a=l==null||(i=l.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&a!==void 0&&a}return!1}ht(t){return!pt(t)&&Nt(t)}}var fv="https?://(.*)",Of=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],Que=kf(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Of),gm="<masked>",Jue=["li_fat_id"];function q8(e,t,n){if(!Se)return{};var r,a=t?kf([],Of,n||[]):[],i=V8(mm(Se.URL,a,gm),e),o=(r={},Kt(Jue,(function(l){var c=go.A(l);r[l]=c||null})),r);return Nn(o,i)}function V8(e,t){var n=Que.concat(t||[]),r={};return Kt(n,(function(a){var i=Sy(e,a);r[a]=i||null})),r}function W8(e){var t=(function(i){return i?i.search(fv+"google.([^/?]*)")===0?"google":i.search(fv+"bing.com")===0?"bing":i.search(fv+"yahoo.com")===0?"yahoo":i.search(fv+"duckduckgo.com")===0?"duckduckgo":null:null})(e),n=t!="yahoo"?"q":"p",r={};if(!Hi(t)){r.$search_engine=t;var a=Se?Sy(Se.referrer,n):"";a.length&&(r.ph_keyword=a)}return r}function SB(){return navigator.language||navigator.userLanguage}function Y8(){return(Se==null?void 0:Se.referrer)||"$direct"}function K8(e,t){var n=e?kf([],Of,t||[]):[],r=Sr==null?void 0:Sr.href.substring(0,1e3);return{r:Y8().substring(0,1e3),u:r?mm(r,n,gm):void 0}}function X8(e){var t,{r:n,u:r}=e,a={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(t=_y(n))==null?void 0:t.host};if(r){a.$current_url=r;var i=_y(r);a.$host=i==null?void 0:i.host,a.$pathname=i==null?void 0:i.pathname;var o=V8(r);Nn(a,o)}if(n){var l=W8(n);Nn(a,l)}return a}function Z8(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function ece(){try{return new Date().getTimezoneOffset()}catch{return}}function tce(e,t){var n,r;if(!ya)return{};var a,i,o=e?kf([],Of,t||[]):[],[l,c]=(function(S){for(var T=0;T<tB.length;T++){var[k,N]=tB[T],C=k.exec(S),O=C&&(gs(N)?N(C,S):N);if(O)return O}return["",""]})(ya),d=(a=nB(ya))===d8||a===c8||a==="Kobo"||a==="Kindle Fire"||a===S8?dm:a===pm||a===Zd||a===hm||a===gk?"Console":a===p8?"Wearable":a?di:"Desktop";if(d==="Desktop"&&((n=navigator)==null||(n=n.userAgentData)==null?void 0:n.platform)==="Android"&&((r=navigator)==null?void 0:r.maxTouchPoints)>0){var f,p,g,v,x,w=(f=ue==null||(p=ue.screen)==null?void 0:p.width)!==null&&f!==void 0?f:0,E=(g=ue==null||(v=ue.screen)==null?void 0:v.height)!==null&&g!==void 0?g:0;d=Math.min(w,E)/((x=ue==null?void 0:ue.devicePixelRatio)!==null&&x!==void 0?x:1)>=600?"Tablet":"Mobile"}return Nn(KN({$os:l,$os_version:c,$browser:A8(ya,navigator.vendor),$device:nB(ya),$device_type:d,$timezone:Z8(),$timezone_offset:ece()}),{$current_url:mm(Sr==null?void 0:Sr.href,o,gm),$host:Sr==null?void 0:Sr.host,$pathname:Sr==null?void 0:Sr.pathname,$raw_user_agent:ya.length>1e3?ya.substring(0,997)+"...":ya,$browser_version:Jle(ya,navigator.vendor),$browser_language:SB(),$browser_language_prefix:(i=SB(),typeof i=="string"?i.split("-")[0]:void 0),$screen_height:ue==null?void 0:ue.screen.height,$screen_width:ue==null?void 0:ue.screen.width,$viewport_height:ue==null?void 0:ue.innerHeight,$viewport_width:ue==null?void 0:ue.innerWidth,$lib:"web",$lib_version:is.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var ha=pn("[FeatureFlags]"),wh=pn("[FeatureFlags]",{debugEnabled:!0}),nce="errors_while_computing_flags",rce="flag_missing",ace="quota_limited",ice="timeout",oce="connection_error",sce="unknown_error",lce=e=>"api_error_"+e,bS="$active_feature_flags",Nd="$override_feature_flags",AB="$feature_flag_payloads",Eh="$override_feature_flag_payloads",TB="$feature_flag_request_id",kB=e=>{var t={};for(var[n,r]of Wv(e||{}))r&&(t[n]=r);return t},uce=e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map((n=>{var r;return[n,(r=t[n].variant)!==null&&r!==void 0?r:t[n].enabled]}))),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter((n=>t[n].enabled)).filter((n=>{var r;return(r=t[n].metadata)==null?void 0:r.payload})).map((n=>{var r;return[n,(r=t[n].metadata)==null?void 0:r.payload]})))):ha.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e},cce=(function(e){return e.FeatureFlags="feature_flags",e.Recordings="recordings",e})({});class dce{constructor(t){this._t=!1,this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.Et=!1,this.St=!1,this._instance=t,this.featureFlagEventHandlers=[]}kt(){var t,n;return(t=(n=this._instance.persistence)==null?void 0:n.Pt(this._instance.config.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}Tt(){return!!this.kt()&&(this.St||this.yt||(this.St=!0,ha.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ct(){var t,n=(t=this._instance.config.evaluation_contexts)!==null&&t!==void 0?t:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.Et||(ha.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Et=!0),n!=null&&n.length?n.filter((r=>{var a=r&&typeof r=="string"&&r.trim().length>0;return a||ha.error("Invalid evaluation context found:",r,"Expected non-empty string"),a})):[]}It(){return this.Ct().length>0}get hasLoadedFlags(){return this.bt}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(wk),n=this._instance.get_property(Nd),r=this._instance.get_property(Eh);if(!r&&!n)return t||{};var a=Nn({},t||{}),i=[...new Set([...Object.keys(r||{}),...Object.keys(n||{})])];for(var o of i){var l,c,d=a[o],f=n==null?void 0:n[o],p=Ae(f)?(l=d==null?void 0:d.enabled)!==null&&l!==void 0&&l:!!f,g=Ae(f)?d.variant:typeof f=="string"?f:void 0,v=r==null?void 0:r[o],x=_e({},d,{enabled:p,variant:p?g??(d==null?void 0:d.variant):void 0});p!==(d==null?void 0:d.enabled)&&(x.original_enabled=d==null?void 0:d.enabled),g!==(d==null?void 0:d.variant)&&(x.original_variant=d==null?void 0:d.variant),v&&(x.metadata=_e({},d==null?void 0:d.metadata,{payload:v,original_payload:d==null||(c=d.metadata)==null?void 0:c.payload})),a[o]=x}return this._t||(ha.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:a}),this._t=!0),a}getFlagVariants(){var t=this._instance.get_property(qd),n=this._instance.get_property(Nd);if(!n)return t||{};for(var r=Nn({},t),a=Object.keys(n),i=0;i<a.length;i++)r[a[i]]=n[a[i]];return this._t||(ha.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:n,finalFlags:r}),this._t=!0),r}getFlagPayloads(){var t=this._instance.get_property(AB),n=this._instance.get_property(Eh);if(!n)return t||{};for(var r=Nn({},t||{}),a=Object.keys(n),i=0;i<a.length;i++)r[a[i]]=n[a[i]];return this._t||(ha.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:n,finalPayloads:r}),this._t=!0),r}reloadFeatureFlags(){this.wt||this._instance.config.advanced_disable_feature_flags||this.Rt||(this._instance.Ft.emit("featureFlagsReloading",!0),this.Rt=setTimeout((()=>{this.Ot()}),5))}Mt(){clearTimeout(this.Rt),this.Rt=void 0}ensureFlagsLoaded(){this.bt||this.yt||this.Rt||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.wt=t}Ot(t){var n;if(this.Mt(),!this._instance.At())if(this.yt)this.xt=!0;else{var r=this._instance.config.token,a=this._instance.get_property("$device_id"),i={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:_e({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(qh)||{}),group_properties:this._instance.get_property(Bu),timezone:Z8()};Hi(a)||Ae(a)||(i.$device_id=a),(t!=null&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.It()&&(i.evaluation_contexts=this.Ct());var o=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+o);this.yt=!0,this._instance._send_request({method:"POST",url:l,data:i,compression:this._instance.config.disable_compression?void 0:hs.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:c=>{var d,f,p,g=!0;if(c.statusCode===200&&(this.xt||(this.$anon_distinct_id=void 0),g=!1),this.yt=!1,!i.disable_flags||this.xt){this.$t=!g;var v=[];c.error?c.error instanceof Error?v.push(c.error.name==="AbortError"?ice:oce):v.push(sce):c.statusCode!==200&&v.push(lce(c.statusCode)),(d=c.json)!=null&&d.errorsWhileComputingFlags&&v.push(nce);var x=!((f=c.json)==null||(f=f.quotaLimited)==null||!f.includes(cce.FeatureFlags));if(x&&v.push(ace),(p=this._instance.persistence)==null||p.register({[_k]:v}),x)ha.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 w;i.disable_flags||this.receivedFeatureFlags((w=c.json)!==null&&w!==void 0?w:{},g),this.xt&&(this.xt=!1,this.Ot())}}}})}}getFeatureFlag(t,n){var r;if(n===void 0&&(n={}),!n.fresh||this.$t)if(this.bt||this.getFlags()&&this.getFlags().length>0){if(!this.Tt()){var a=this.getFeatureFlagResult(t,n);return(r=a==null?void 0:a.variant)!==null&&r!==void 0?r:a==null?void 0:a.enabled}}else ha.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var n=this.getFeatureFlagResult(t,{send_event:!1});return n==null?void 0:n.payload}getFeatureFlagResult(t,n){if(n===void 0&&(n={}),!n.fresh||this.$t)if(this.bt||this.getFlags()&&this.getFlags().length>0){if(!this.Tt()){var r=this.getFlagVariants(),a=t in r,i=r[t],o=this.getFlagPayloads()[t],l=String(i),c=this._instance.get_property(TB)||void 0,d=this._instance.get_property(yy)||void 0,f=this._instance.get_property(vy)||{};if((n.send_event||!("send_event"in n))&&(!(t in f)||!f[t].includes(l))){var p,g,v,x,w,E,S,T,k,N;Nt(f[t])?f[t].push(l):f[t]=[l],(p=this._instance.persistence)==null||p.register({[vy]:f});var C=this.getFeatureFlagDetails(t),O=[...(g=this._instance.get_property(_k))!==null&&g!==void 0?g:[]];Ae(i)&&O.push(rce);var I={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:o||null,$feature_flag_request_id:c,$feature_flag_evaluated_at:d,$feature_flag_bootstrapped_response:((v=this._instance.config.bootstrap)==null||(v=v.featureFlags)==null?void 0:v[t])||null,$feature_flag_bootstrapped_payload:((x=this._instance.config.bootstrap)==null||(x=x.featureFlagPayloads)==null?void 0:x[t])||null,$used_bootstrap_value:!this.$t};Ae(C==null||(w=C.metadata)==null?void 0:w.version)||(I.$feature_flag_version=C.metadata.version);var D,B=(E=C==null||(S=C.reason)==null?void 0:S.description)!==null&&E!==void 0?E:C==null||(T=C.reason)==null?void 0:T.code;B&&(I.$feature_flag_reason=B),C!=null&&(k=C.metadata)!=null&&k.id&&(I.$feature_flag_id=C.metadata.id),Ae(C==null?void 0:C.original_variant)&&Ae(C==null?void 0:C.original_enabled)||(I.$feature_flag_original_response=Ae(C.original_variant)?C.original_enabled:C.original_variant),C!=null&&(N=C.metadata)!=null&&N.original_payload&&(I.$feature_flag_original_payload=C==null||(D=C.metadata)==null?void 0:D.original_payload),O.length&&(I.$feature_flag_error=O.join(",")),this._instance.capture("$feature_flag_called",I)}if(a){var L=o;if(!Ae(o))try{L=JSON.parse(o)}catch{}return{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:L}}}}else ha.warn('getFeatureFlagResult for key "'+t+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(t,n){var r=this._instance.config.token,a={distinct_id:this._instance.get_distinct_id(),token:r};this.It()&&(a.evaluation_contexts=this.Ct()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:a,compression:this._instance.config.disable_compression?void 0:hs.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var o,l=(o=i.json)==null?void 0:o.featureFlagPayloads;n((l==null?void 0:l[t])||void 0)}})}isFeatureEnabled(t,n){if(n===void 0&&(n={}),!n.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,n);return Ae(r)?void 0:!!r}ha.warn('isFeatureEnabled for key "'+t+`" failed. Feature flags didn't load in time.`)}}addFeatureFlagsHandler(t){this.featureFlagEventHandlers.push(t)}removeFeatureFlagsHandler(t){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((n=>n!==t))}receivedFeatureFlags(t,n){if(this._instance.persistence){this.bt=!0;var r=this.getFlagVariants(),a=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(o,l,c,d,f){c===void 0&&(c={}),d===void 0&&(d={}),f===void 0&&(f={});var p=uce(o),g=p.flags,v=p.featureFlags,x=p.featureFlagPayloads;if(v){var w=o.requestId,E=o.evaluatedAt;if(Nt(v)){ha.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var S={};if(v)for(var T=0;T<v.length;T++)S[v[T]]=!0;l&&l.register({[bS]:v,[qd]:S})}else{var k=v,N=x,C=g;if(o.errorsWhileComputingFlags)if(g){var O=new Set(Object.keys(g).filter((I=>{var D;return!((D=g[I])!=null&&D.failed)})));k=_e({},c,Object.fromEntries(Object.entries(k).filter((I=>{var[D]=I;return O.has(D)})))),N=_e({},d,Object.fromEntries(Object.entries(N||{}).filter((I=>{var[D]=I;return O.has(D)})))),C=_e({},f,Object.fromEntries(Object.entries(C||{}).filter((I=>{var[D]=I;return O.has(D)}))))}else k=_e({},c,k),N=_e({},d,N),C=_e({},f,C);l&&l.register(_e({[bS]:Object.keys(kB(k)),[qd]:k||{},[AB]:N||{},[wk]:C||{}},w?{[TB]:w}:{},E?{[yy]:E}:{}))}}})(t,this._instance.persistence,r,a,i),n||(this.St=!1),this.Dt(n)}}override(t,n){n===void 0&&(n=!1),ha.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:n})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return ha.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this._instance.persistence.unregister(Nd),this._instance.persistence.unregister(Eh),this.Dt(),wh.info("All overrides cleared");if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var n,r=t;if(this._t=!!((n=r.suppressWarning)!==null&&n!==void 0&&n),"flags"in r){if(r.flags===!1)this._instance.persistence.unregister(Nd),wh.info("Flag overrides cleared");else if(r.flags){if(Nt(r.flags)){for(var a={},i=0;i<r.flags.length;i++)a[r.flags[i]]=!0;this._instance.persistence.register({[Nd]:a})}else this._instance.persistence.register({[Nd]:r.flags});wh.info("Flag overrides set",{flags:r.flags})}}return"payloads"in r&&(r.payloads===!1?(this._instance.persistence.unregister(Eh),wh.info("Payload overrides cleared")):r.payloads&&(this._instance.persistence.register({[Eh]:r.payloads}),wh.info("Payload overrides set",{payloads:r.payloads}))),void this.Dt()}this.Dt()}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.bt){var{flags:n,flagVariants:r}=this.jt();t(n,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,n,r){var a,i=(this._instance.get_property(Hh)||[]).find((d=>d.flagKey===t)),o={["$feature_enrollment/"+t]:n},l={$feature_flag:t,$feature_enrollment:n,$set:o};i&&(l.$early_access_feature_name=i.name),r&&(l.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(o,!1);var c=_e({},this.getFlagVariants(),{[t]:n});(a=this._instance.persistence)==null||a.register({[bS]:Object.keys(kB(c)),[qd]:c}),this.Dt()}getEarlyAccessFeatures(t,n,r){n===void 0&&(n=!1);var a=this._instance.get_property(Hh),i=r?"&"+r.map((o=>"stage="+o)).join("&"):"";if(a&&!n)return t(a);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+i),method:"GET",callback:o=>{var l,c;if(o.json){var d=o.json.earlyAccessFeatures;return(l=this._instance.persistence)==null||l.unregister(Hh),(c=this._instance.persistence)==null||c.register({[Hh]:d}),t(d)}}})}jt(){var t=this.getFlags(),n=this.getFlagVariants();return{flags:t.filter((r=>n[r])),flagVariants:Object.keys(n).filter((r=>n[r])).reduce(((r,a)=>(r[a]=n[a],r)),{})}}Dt(t){var{flags:n,flagVariants:r}=this.jt();this.featureFlagEventHandlers.forEach((a=>a(n,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,n){n===void 0&&(n=!0);var r=this._instance.get_property(qh)||{};this._instance.register({[qh]:_e({},r,t)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(qh)}setGroupPropertiesForFlags(t,n){n===void 0&&(n=!0);var r=this._instance.get_property(Bu)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((a=>{r[a]=_e({},r[a],t[a]),delete t[a]})),this._instance.register({[Bu]:_e({},r,t)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var n=this._instance.get_property(Bu)||{};this._instance.register({[Bu]:_e({},n,{[t]:{}})})}else this._instance.unregister(Bu)}reset(){this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.$anon_distinct_id=void 0,this.Mt(),this._t=!1}}var fce=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class vS{constructor(t,n){this.N=t,this.props={},this.Lt=!1,this.Nt=(r=>{var a="";return r.token&&(a=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+a+"_posthog"})(t),this.q=this.Ut(t),this.load(),t.debug&&ke.info("Persistence loaded",t.persistence,_e({},this.props)),this.update_config(t,t,n),this.save()}isDisabled(){return!!this.zt}Ut(t){fce.indexOf(t.persistence.toLowerCase())===-1&&(ke.critical("Unknown persistence type "+t.persistence+"; falling back to localStorage+cookie"),t.persistence="localStorage+cookie");var n=(function(a){a===void 0&&(a=[]);var i=[...Iue,...a];return _e({},dn,{D:function(o){try{var l={};try{l=go.D(o)||{}}catch{}var c=Nn(l,JSON.parse(dn.A(o)||"{}"));return dn.j(o,c),c}catch{}return null},j:function(o,l,c,d,f,p){try{dn.j(o,l,void 0,void 0,p);var g={};i.forEach((v=>{l[v]&&(g[v]=l[v])})),Object.keys(g).length&&go.j(o,g,c,d,f,p)}catch(v){dn.M(v)}},L:function(o,l){try{ue==null||ue.localStorage.removeItem(o),go.L(o,l)}catch(c){dn.M(c)}}})})(t.cookie_persisted_properties||[]),r=t.persistence.toLowerCase();return r==="localstorage"&&dn.O()?dn:r==="localstorage+cookie"&&n.O()?n:r==="sessionstorage"&&_r.O()?_r:r==="memory"?Due:r==="cookie"?go:n.O()?n:go}Pt(t){var n=t??this.N.feature_flag_cache_ttl_ms;if(!n||n<=0)return!1;var r=this.props[yy];return!r||typeof r!="number"||Date.now()-r>n}properties(){var t={};return Kt(this.props,((n,r)=>{if(r===qd&&Vn(n)){if(!this.Pt())for(var a=Object.keys(n),i=0;i<a.length;i++)t["$feature/"+a[i]]=n[a[i]]}else l=r,c=!1,(Hi(o=Tue)?c:KU&&o.indexOf===KU?o.indexOf(l)!=-1:(Kt(o,(function(d){if(c||(c=d===l))return gy})),c))||(t[r]=n);var o,l,c})),t}load(){if(!this.zt){var t=this.q.D(this.Nt);t&&(this.props=Nn({},t))}}save(){this.zt||this.q.j(this.Nt,this.props,this.Ht,this.qt,this.Bt,this.N.debug)}remove(){this.q.L(this.Nt,!1),this.q.L(this.Nt,!0)}clear(){this.remove(),this.props={}}register_once(t,n,r){if(Vn(t)){Ae(n)&&(n="None"),this.Ht=Ae(r)?this.Wt:r;var a=!1;if(Kt(t,((i,o)=>{this.props.hasOwnProperty(o)&&this.props[o]!==n||(this.props[o]=i,a=!0)})),a)return this.save(),!0}return!1}register(t,n){if(Vn(t)){this.Ht=Ae(n)?this.Wt:n;var r=!1;if(Kt(t,((a,i)=>{t.hasOwnProperty(i)&&this.props[i]!==a&&(this.props[i]=a,r=!0)})),r)return this.save(),!0}return!1}unregister(t){t in this.props&&(delete this.props[t],this.save())}update_campaign_params(){if(!this.Lt){var t=q8(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);Hd(KN(t))||this.register(t),this.Lt=!0}}update_search_keyword(){var t;this.register((t=Se==null?void 0:Se.referrer)?W8(t):{})}update_referrer_info(){var t;this.register_once({$referrer:Y8(),$referring_domain:Se!=null&&Se.referrer&&((t=_y(Se.referrer))==null?void 0:t.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Tk]||this.props[kk]||this.register_once({[xy]:K8(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var t={};Kt([kk,Tk],(o=>{var l=this.props[o];l&&Kt(l,(function(c,d){t["$initial_"+fk(d)]=c}))}));var n,r,a=this.props[xy];if(a){var i=(n=X8(a),r={},Kt(n,(function(o,l){r["$initial_"+fk(l)]=o})),r);Nn(t,i)}return t}safe_merge(t){return Kt(this.props,(function(n,r){r in t||(t[r]=n)})),t}update_config(t,n,r){if(this.Wt=this.Ht=t.cookie_expiration,this.set_disabled(t.disable_persistence||!!r),this.set_cross_subdomain(t.cross_subdomain_cookie),this.set_secure(t.secure_cookie),t.persistence!==n.persistence||!((o,l)=>{if(o.length!==l.length)return!1;var c=[...o].sort(),d=[...l].sort();return c.every(((f,p)=>f===d[p]))})(t.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var a=this.Ut(t),i=this.props;this.clear(),this.q=a,this.props=i,this.save()}}set_disabled(t){this.zt=t,this.zt?this.remove():this.save()}set_cross_subdomain(t){t!==this.qt&&(this.qt=t,this.remove(),this.save())}set_secure(t){t!==this.Bt&&(this.Bt=t,this.remove(),this.save())}set_event_timer(t,n){var r=this.props[Gh]||{};r[t]=n,this.props[Gh]=r,this.save()}remove_event_timer(t){var n=(this.props[Gh]||{})[t];return Ae(n)||(delete this.props[Gh][t],this.save()),n}get_property(t){return this.props[t]}set_property(t,n){this.props[t]=n,this.save()}}var _h=(function(e){return e.Activation="events",e.Cancellation="cancelEvents",e})({});(function(e){return e.Button="button",e.Tab="tab",e.Selector="selector",e})({});(function(e){return e.TopLeft="top_left",e.TopRight="top_right",e.TopCenter="top_center",e.MiddleLeft="middle_left",e.MiddleRight="middle_right",e.MiddleCenter="middle_center",e.Left="left",e.Center="center",e.Right="right",e.NextToTrigger="next_to_trigger",e})({});(function(e){return e.Top="top",e.Left="left",e.Right="right",e.Bottom="bottom",e})({});var yS=(function(e){return e.Popover="popover",e.API="api",e.Widget="widget",e.ExternalSurvey="external_survey",e})({});(function(e){return e.Open="open",e.MultipleChoice="multiple_choice",e.SingleChoice="single_choice",e.Rating="rating",e.Link="link",e})({});(function(e){return e.NextQuestion="next_question",e.End="end",e.ResponseBased="response_based",e.SpecificQuestion="specific_question",e})({});(function(e){return e.Once="once",e.Recurring="recurring",e.Always="always",e})({});var Wh=(function(e){return e.SHOWN="survey shown",e.DISMISSED="survey dismissed",e.SENT="survey sent",e.ABANDONED="survey abandoned",e})({}),xS=(function(e){return e.SURVEY_ID="$survey_id",e.SURVEY_NAME="$survey_name",e.SURVEY_RESPONSE="$survey_response",e.SURVEY_ITERATION="$survey_iteration",e.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",e.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",e.SURVEY_SUBMISSION_ID="$survey_submission_id",e.SURVEY_QUESTIONS="$survey_questions",e.SURVEY_COMPLETED="$survey_completed",e.PRODUCT_TOUR_ID="$product_tour_id",e.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",e})({}),Rk=(function(e){return e.Popover="popover",e.Inline="inline",e})({}),Ht=pn("[Surveys]"),Q8="seenSurvey_",pce=(e,t)=>{var n="$survey_"+t+"/"+e.id;return e.current_iteration&&e.current_iteration>0&&(n="$survey_"+t+"/"+e.id+"/"+e.current_iteration),n},NB=e=>((t,n)=>{var r=""+t+n.id;return n.current_iteration&&n.current_iteration>0&&(r=""+t+n.id+"_"+n.current_iteration),r})(Q8,e),hce=[yS.Popover,yS.Widget,yS.API],mce={ignoreConditions:!1,ignoreDelay:!1,displayType:Rk.Popover};class QN{constructor(){this.Gt={},this.Gt={}}on(t,n){return this.Gt[t]||(this.Gt[t]=[]),this.Gt[t].push(n),()=>{this.Gt[t]=this.Gt[t].filter((r=>r!==n))}}emit(t,n){for(var r of this.Gt[t]||[])r(n);for(var a of this.Gt["*"]||[])a(t,n)}}function Od(e,t,n){if(pt(e))return!1;switch(n){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}class gce{constructor(t){this.Vt=new QN,this.Jt=(n,r)=>this.Kt(n,r)&&this.Yt(n,r)&&this.Xt(n,r)&&this.Qt(n,r),this.Kt=(n,r)=>r==null||!r.event||(n==null?void 0:n.event)===(r==null?void 0:r.event),this._instance=t,this.Zt=new Set,this.ti=new Set}init(){var t;if(!Ae((t=this._instance)==null?void 0:t._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook(((r,a)=>{this.on(r,a)}))}}register(t){var n,r;if(!Ae((n=this._instance)==null?void 0:n._addCaptureHook)&&(t.forEach((o=>{var l,c;(l=this.ti)==null||l.add(o),(c=o.steps)==null||c.forEach((d=>{var f;(f=this.Zt)==null||f.add((d==null?void 0:d.event)||"")}))})),(r=this._instance)!=null&&r.autocapture)){var a,i=new Set;t.forEach((o=>{var l;(l=o.steps)==null||l.forEach((c=>{c!=null&&c.selector&&i.add(c==null?void 0:c.selector)}))})),(a=this._instance)==null||a.autocapture.setElementSelectors(i)}}on(t,n){var r;n!=null&&t.length!=0&&(this.Zt.has(t)||this.Zt.has(n==null?void 0:n.event))&&this.ti&&((r=this.ti)==null?void 0:r.size)>0&&this.ti.forEach((a=>{this.ii(n,a)&&this.Vt.emit("actionCaptured",a.name)}))}ei(t){this.onAction("actionCaptured",(n=>t(n)))}ii(t,n){if((n==null?void 0:n.steps)==null)return!1;for(var r of n.steps)if(this.Jt(t,r))return!0;return!1}onAction(t,n){return this.Vt.on(t,n)}Yt(t,n){if(n!=null&&n.url){var r,a=t==null||(r=t.properties)==null?void 0:r.$current_url;if(!a||typeof a!="string"||!Od(a,n.url,n.url_matching||"contains"))return!1}return!0}Xt(t,n){return!!this.ri(t,n)&&!!this.si(t,n)&&!!this.ni(t,n)}ri(t,n){var r;if(n==null||!n.href)return!0;var a=this.oi(t);if(a.length>0)return a.some((l=>Od(l.href,n.href,n.href_matching||"exact")));var i,o=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!o&&Od((i=o.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}si(t,n){var r;if(n==null||!n.text)return!0;var a=this.oi(t);if(a.length>0)return a.some((d=>Od(d.text,n.text,n.text_matching||"exact")||Od(d.$el_text,n.text,n.text_matching||"exact")));var i,o,l,c=(t==null||(r=t.properties)==null?void 0:r.$elements_chain)||"";return!!c&&(i=(function(d){for(var f,p=[],g=/(?::|")text="(.*?)"/g;!pt(f=g.exec(d));)p.includes(f[1])||p.push(f[1]);return p})(c),o=n.text,l=n.text_matching||"exact",i.some((d=>Od(d,o,l))))}ni(t,n){var r,a;if(n==null||!n.selector)return!0;var i=t==null||(r=t.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var o=(t==null||(a=t.properties)==null?void 0:a.$elements_chain)||"";if(n.selector_regex&&o)try{return new RegExp(n.selector_regex).test(o)}catch{return!1}return!1}oi(t){var n;return(t==null||(n=t.properties)==null?void 0:n.$elements)==null?[]:t==null?void 0:t.properties.$elements}Qt(t,n){return n==null||!n.properties||n.properties.length===0||H8(n.properties.reduce(((r,a)=>{var i=Nt(a.value)?a.value.map(String):a.value!=null?[String(a.value)]:[];return r[a.key]={values:i,operator:a.operator||"exact"},r}),{}),t==null?void 0:t.properties)}}class bce{constructor(t){this._instance=t,this.ai=new Map,this.li=new Map,this.ui=new Map}hi(t,n){return!!t&&H8(t.propertyFilters,n==null?void 0:n.properties)}di(t,n){var r=new Map;return t.forEach((a=>{var i;(i=a.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach((o=>{if(o!=null&&o.name){var l=r.get(o.name)||[];l.push(a.id),r.set(o.name,l)}}))})),r}vi(t,n,r){var a=(r===_h.Activation?this.ai:this.li).get(t),i=[];return this.ci((o=>{i=o.filter((l=>a==null?void 0:a.includes(l.id)))})),i.filter((o=>{var l,c=(l=o.conditions)==null||(l=l[r])==null||(l=l.values)==null?void 0:l.find((d=>d.name===t));return this.hi(c,n)}))}register(t){var n;Ae((n=this._instance)==null?void 0:n._addCaptureHook)||(this.fi(t),this.pi(t))}pi(t){var n=t.filter((r=>{var a,i;return((a=r.conditions)==null?void 0:a.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0}));n.length!==0&&(this.gi==null&&(this.gi=new gce(this._instance),this.gi.init(),this.gi.ei((r=>{this.onAction(r)}))),n.forEach((r=>{var a,i,o,l,c;r.conditions&&(a=r.conditions)!=null&&a.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((o=r.conditions)==null||(o=o.actions)==null||(o=o.values)==null?void 0:o.length)>0&&((l=this.gi)==null||l.register(r.conditions.actions.values),(c=r.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach((d=>{if(d&&d.name){var f=this.ui.get(d.name);f&&f.push(r.id),this.ui.set(d.name,f||[r.id])}})))})))}fi(t){var n,r=t.filter((i=>{var o,l;return((o=i.conditions)==null?void 0:o.events)&&((l=i.conditions)==null||(l=l.events)==null||(l=l.values)==null?void 0:l.length)>0})),a=t.filter((i=>{var o,l;return((o=i.conditions)==null?void 0:o.cancelEvents)&&((l=i.conditions)==null||(l=l.cancelEvents)==null||(l=l.values)==null?void 0:l.length)>0}));(r.length!==0||a.length!==0)&&((n=this._instance)==null||n._addCaptureHook(((i,o)=>{this.onEvent(i,o)})),this.ai=this.di(t,_h.Activation),this.li=this.di(t,_h.Cancellation))}onEvent(t,n){var r,a=this.mi(),i=this.bi(),o=this.yi(),l=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[i])||[];if(o===t&&n&&l.length>0){var c,d;a.info("event matched, removing item from activated items",{event:t,eventPayload:n,existingActivatedItems:l});var f=(n==null||(c=n.properties)==null?void 0:c.$survey_id)||(n==null||(d=n.properties)==null?void 0:d.$product_tour_id);if(f){var p=l.indexOf(f);p>=0&&(l.splice(p,1),this.wi(l))}}else{if(this.li.has(t)){var g=this.vi(t,n,_h.Cancellation);g.length>0&&(a.info("cancel event matched, cancelling items",{event:t,itemsToCancel:g.map((x=>x.id))}),g.forEach((x=>{var w=l.indexOf(x.id);w>=0&&l.splice(w,1),this.xi(x.id)})),this.wi(l))}if(this.ai.has(t)){a.info("event name matched",{event:t,eventPayload:n,items:this.ai.get(t)});var v=this.vi(t,n,_h.Activation);this.wi(l.concat(v.map((x=>x.id))||[]))}}}onAction(t){var n,r=this.bi(),a=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[r])||[];this.ui.has(t)&&this.wi(a.concat(this.ui.get(t)||[]))}wi(t){var n,r=this.mi(),a=this.bi(),i=[...new Set(t)].filter((o=>!this.$i(o)));r.info("updating activated items",{activatedItems:i}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[a]:i})}getActivatedIds(){var t,n=this.bi(),r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[n];return r||[]}getEventToItemsMap(){return this.ai}Ei(){return this.gi}}let vce=class extends bce{constructor(t){super(t)}bi(){return"$surveys_activated"}yi(){return Wh.SHOWN}ci(t){var n;(n=this._instance)==null||n.getSurveys(t)}xi(t){var n;(n=this._instance)==null||n.cancelPendingSurvey(t)}mi(){return Ht}$i(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}};class yce{constructor(t){this.Si=void 0,this._surveyManager=null,this.ki=!1,this.Pi=[],this.Ti=null,this._instance=t,this._surveyEventReceiver=null}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var n=t.surveys;if(pt(n))return Ht.warn("Flags not loaded yet. Not loading surveys.");var r=Nt(n);this.Si=r?n.length>0:n,Ht.info("flags response received, isSurveysEnabled: "+this.Si),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],n=0;n<localStorage.length;n++){var r=localStorage.key(n);(r!=null&&r.startsWith(Q8)||r!=null&&r.startsWith("inProgressSurvey_"))&&t.push(r)}t.forEach((a=>localStorage.removeItem(a)))}loadIfEnabled(){if(!this._surveyManager)if(this.ki)Ht.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)Ht.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())Ht.info("Not loading surveys in cookieless mode without consent.");else{var t=ze==null?void 0:ze.__PosthogExtensions__;if(t){if(!Ae(this.Si)||this._instance.config.advanced_enable_surveys){var n=this.Si||this._instance.config.advanced_enable_surveys;this.ki=!0;try{var r=t.generateSurveys;if(r)return void this.Ci(r,n);var a=t.loadExternalDependency;if(!a)return void this.Ii("PostHog loadExternalDependency extension not found.");a(this._instance,"surveys",(i=>{i||!t.generateSurveys?this.Ii("Could not load surveys script",i):this.Ci(t.generateSurveys,n)}))}catch(i){throw this.Ii("Error initializing surveys",i),i}finally{this.ki=!1}}}else Ht.error("PostHog Extensions not found.")}}Ci(t,n){this._surveyManager=t(this._instance,n),this._surveyEventReceiver=new vce(this._instance),Ht.info("Surveys loaded successfully"),this.Ri({isLoaded:!0})}Ii(t,n){Ht.error(t,n),this.Ri({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.Pi.push(t),this._surveyManager&&this.Ri({isLoaded:!0}),()=>{this.Pi=this.Pi.filter((n=>n!==t))}}getSurveys(t,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return Ht.info("Disabled. Not loading surveys."),t([]);var r,a=this._instance.get_property(Ek);if(a&&!n)return t(a,{isLoaded:!0});typeof Promise<"u"&&this.Ti?this.Ti.then((i=>{var{surveys:o,context:l}=i;return t(o,l)})):(typeof Promise<"u"&&(this.Ti=new Promise((i=>{r=i}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:i=>{var o;this.Ti=null;var l=i.statusCode;if(l!==200||!i.json){var c="Surveys API could not be loaded, status: "+l;Ht.error(c);var d={isLoaded:!1,error:c};return t([],d),void(r==null||r({surveys:[],context:d}))}var f,p=i.json.surveys||[],g=p.filter((x=>(function(w){return!(!w.start_date||w.end_date)})(x)&&((function(w){var E;return!((E=w.conditions)==null||(E=E.events)==null||(E=E.values)==null||!E.length)})(x)||(function(w){var E;return!((E=w.conditions)==null||(E=E.actions)==null||(E=E.values)==null||!E.length)})(x))));g.length>0&&((f=this._surveyEventReceiver)==null||f.register(g)),(o=this._instance.persistence)==null||o.register({[Ek]:p});var v={isLoaded:!0};t(p,v),r==null||r({surveys:p,context:v})}}))}Ri(t){for(var n of this.Pi)try{if(!t.isLoaded)return n([],t);this.getSurveys(n)}catch(r){Ht.error("Error in survey callback",r)}}getActiveMatchingSurveys(t,n){if(n===void 0&&(n=!1),!pt(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,n);Ht.warn("init was not called")}Fi(t){var n=null;return this.getSurveys((r=>{var a;n=(a=r.find((i=>i.id===t)))!==null&&a!==void 0?a:null})),n}Oi(t){if(pt(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof t=="string"?this.Fi(t):t;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(pt(this._surveyManager))return Ht.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.Oi(t);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(t,n){return pt(this._surveyManager)?(Ht.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise((r=>{this.getSurveys((a=>{var i,o=(i=a.find((c=>c.id===t)))!==null&&i!==void 0?i:null;if(o){var l=this.Oi(o);r({visible:l.eligible,disabledReason:l.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),n)}))}renderSurvey(t,n,r){var a;if(pt(this._surveyManager))Ht.warn("init was not called");else{var i=typeof t=="string"?this.Fi(t):t;if(i!=null&&i.id)if(hce.includes(i.type)){var o=Se==null?void 0:Se.querySelector(n);if(o)return(a=i.appearance)!=null&&a.surveyPopupDelaySeconds?(Ht.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var l,c;Ht.info("Rendering survey "+i.id+" with delay of "+((l=i.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(c=this._surveyManager)==null||c.renderSurvey(i,o,r),Ht.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,o,r);Ht.warn("Survey element not found")}else Ht.warn("Surveys of type "+i.type+" cannot be rendered in the app");else Ht.warn("Survey not found")}}displaySurvey(t,n){var r;if(pt(this._surveyManager))Ht.warn("init was not called");else{var a=this.Fi(t);if(a){var i=a;if((r=a.appearance)!=null&&r.surveyPopupDelaySeconds&&n.ignoreDelay&&(i=_e({},a,{appearance:_e({},a.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==Rk.Popover&&n.initialResponses&&Ht.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var o=this.canRenderSurvey(a);if(!o.visible)return void Ht.warn("Survey is not eligible to be displayed: ",o.disabledReason)}n.displayType!==Rk.Inline?this._surveyManager.handlePopoverSurvey(i,n):this.renderSurvey(i,n.selector,n.properties)}else Ht.warn("Survey not found")}}cancelPendingSurvey(t){pt(this._surveyManager)?Ht.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload()}}var ei=pn("[Conversations]");class xce{constructor(t){this.Mi=void 0,this._conversationsManager=null,this.Ai=!1,this.Di=null,this._instance=t}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var n=t.conversations;pt(n)||(Es(n)?this.Mi=n:(this.Mi=n.enabled,this.Di=n),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Mi=void 0,this.Di=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ai||this._instance.config.disable_conversations||C8(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=ze==null?void 0:ze.__PosthogExtensions__;if(t&&!Ae(this.Mi)&&this.Mi)if(this.Di&&this.Di.token){this.Ai=!0;try{var n=t.initConversations;if(n)return this.ji(n),void(this.Ai=!1);var r=t.loadExternalDependency;if(!r)return void this.Li("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(a=>{a||!t.initConversations?this.Li("Could not load conversations script",a):this.ji(t.initConversations),this.Ai=!1}))}catch(a){this.Li("Error initializing conversations",a),this.Ai=!1}}else ei.error("Conversations enabled but missing token in remote config.")}}ji(t){if(this.Di)try{this._conversationsManager=t(this.Di,this._instance),ei.info("Conversations loaded successfully")}catch(n){this.Li("Error completing conversations initialization",n)}else ei.error("Cannot complete initialization: remote config is null")}Li(t,n){ei.error(t,n),this._conversationsManager=null,this.Ai=!1}show(){this._conversationsManager?this._conversationsManager.show():ei.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Mi===!0&&!Hi(this._conversationsManager)}isVisible(){var t,n;return(t=(n=this._conversationsManager)==null?void 0:n.isVisible())!==null&&t!==void 0&&t}sendMessage(t,n,r){var a=this;return os((function*(){return a._conversationsManager?a._conversationsManager.sendMessage(t,n,r):(ei.warn("Conversations not available yet."),null)}))()}getMessages(t,n){var r=this;return os((function*(){return r._conversationsManager?r._conversationsManager.getMessages(t,n):(ei.warn("Conversations not available yet."),null)}))()}markAsRead(t){var n=this;return os((function*(){return n._conversationsManager?n._conversationsManager.markAsRead(t):(ei.warn("Conversations not available yet."),null)}))()}getTickets(t){var n=this;return os((function*(){return n._conversationsManager?n._conversationsManager.getTickets(t):(ei.warn("Conversations not available yet."),null)}))()}requestRestoreLink(t){var n=this;return os((function*(){return n._conversationsManager?n._conversationsManager.requestRestoreLink(t):(ei.warn("Conversations not available yet."),null)}))()}restoreFromToken(t){var n=this;return os((function*(){return n._conversationsManager?n._conversationsManager.restoreFromToken(t):(ei.warn("Conversations not available yet."),null)}))()}restoreFromUrlToken(){var t=this;return os((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(ei.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var t,n;return(t=(n=this._conversationsManager)==null?void 0:n.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,n;return(t=(n=this._conversationsManager)==null?void 0:n.getWidgetSessionId())!==null&&t!==void 0?t:null}}var wce=(function(e){return e.SHOWN="product tour shown",e.DISMISSED="product tour dismissed",e.COMPLETED="product tour completed",e.STEP_SHOWN="product tour step shown",e.STEP_COMPLETED="product tour step completed",e.BUTTON_CLICKED="product tour button clicked",e.STEP_SELECTOR_FAILED="product tour step selector failed",e.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",e.BANNER_ACTION_CLICKED="product tour banner action clicked",e})({}),OB=(function(e){return e.TOUR_ID="$product_tour_id",e.TOUR_NAME="$product_tour_name",e.TOUR_ITERATION="$product_tour_iteration",e.TOUR_RENDER_REASON="$product_tour_render_reason",e.TOUR_STEP_ID="$product_tour_step_id",e.TOUR_STEP_ORDER="$product_tour_step_order",e.TOUR_STEP_TYPE="$product_tour_step_type",e.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",e.TOUR_BUTTON_TEXT="$product_tour_button_text",e.TOUR_BUTTON_ACTION="$product_tour_button_action",e.TOUR_BUTTON_LINK="$product_tour_button_link",e.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",e.TOUR_STEPS_COUNT="$product_tour_steps_count",e.TOUR_STEP_SELECTOR="$product_tour_step_selector",e.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",e.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",e.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",e.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",e.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",e.TOUR_ERROR="$product_tour_error",e.TOUR_MATCHES_COUNT="$product_tour_matches_count",e.TOUR_FAILURE_PHASE="$product_tour_failure_phase",e.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",e.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",e.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",e.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",e.USE_MANUAL_SELECTOR="$use_manual_selector",e.INFERENCE_DATA_PRESENT="$inference_data_present",e.TOUR_LAST_SEEN_DATE="$product_tour_last_seen_date",e.TOUR_TYPE="$product_tour_type",e})({});class Ece{constructor(t){var n;this.Ni=!1,this.Ui=!1,this._instance=t,this._instance&&(n=this._instance.config.logs)!=null&&n.captureConsoleLogs&&(this.Ni=!0)}onRemoteConfig(t){var n,r=(n=t.logs)==null?void 0:n.captureConsoleLogs;!pt(r)&&r&&(this.Ni=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ni&&!this.Ui){var t=pn("[logs]"),n=ze==null?void 0:ze.__PosthogExtensions__;if(n){var r=n.loadExternalDependency;r?r(this._instance,"logs",(a=>{var i;a||(i=n.logs)==null||!i.initializeLogs?t.error("Could not load logs script",a):(n.logs.initializeLogs(this._instance),this.Ui=!0)})):t.error("PostHog loadExternalDependency extension not found.")}else t.error("PostHog Extensions not found.")}}}var CB=pn("[RateLimiter]");let _ce=class{constructor(t){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var r=n.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((a=>{CB.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4}))}catch(a){return void CB.warn('could not rate limit - continuing. Error: "'+(a==null?void 0:a.message)+'"',{text:r})}},this.instance=t,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var t;return((t=this.instance.config.rate_limiting)==null?void 0:t.events_per_second)||10}get captureEventsBurstLimit(){var t;return Math.max(((t=this.instance.config.rate_limiting)==null?void 0:t.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(t){var n,r,a;t===void 0&&(t=!1);var{captureEventsBurstLimit:i,captureEventsPerSecond:o}=this,l=new Date().getTime(),c=(n=(r=this.instance.persistence)==null?void 0:r.get_property(Ak))!==null&&n!==void 0?n:{tokens:i,last:l};c.tokens+=(l-c.last)/1e3*o,c.last=l,c.tokens>i&&(c.tokens=i);var d=c.tokens<1;return d||t||(c.tokens=Math.max(0,c.tokens-1)),!d||this.lastEventRateLimited||t||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+o+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=d,(a=this.instance.persistence)==null||a.set_property(Ak,c),{isRateLimited:d,remainingTokens:c.tokens}}isServerRateLimited(t){var n=this.serverLimits[t||"events"]||!1;return n!==!1&&new Date().getTime()<n}};var Sh=pn("[RemoteConfig]");class J8{constructor(t){this._instance=t}get remoteConfig(){var t;return(t=ze._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.config}zi(t){var n,r;(n=ze.__PosthogExtensions__)!=null&&n.loadExternalDependency?(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>t(this.remoteConfig))):t()}Hi(t){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{t(n.json)}})}load(){try{if(this.remoteConfig)return Sh.info("Using preloaded remote config",this.remoteConfig),this.qi(this.remoteConfig),void this.Bi();if(this._instance.At())return void Sh.warn("Remote config is disabled. Falling back to local config.");this.zi((t=>{if(!t)return Sh.info("No config found after loading remote JS config. Falling back to JSON."),void this.Hi((n=>{this.qi(n),this.Bi()}));this.qi(t),this.Bi()}))}catch(t){Sh.error("Error loading remote config",t)}}stop(){this.Wi&&(clearInterval(this.Wi),this.Wi=void 0)}refresh(){this._instance.At()||(Se==null?void 0:Se.visibilityState)==="hidden"||this._instance.featureFlags.reloadFeatureFlags()}Bi(){var t;if(!this.Wi){var n=(t=this._instance.config.remote_config_refresh_interval_ms)!==null&&t!==void 0?t:3e5;n!==0&&(this.Wi=setInterval((()=>{this.refresh()}),n))}}qi(t){t||Sh.error("Failed to fetch remote config from PostHog."),this._instance.qi(t??{}),(t==null?void 0:t.hasFeatureFlags)!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||this._instance.featureFlags.ensureFlagsLoaded())}}var Ik=3e3;class Sce{constructor(t,n){this.Gi=!0,this.Vi=[],this.Ji=vo((n==null?void 0:n.flush_interval_ms)||Ik,250,5e3,ke.createLogger("flush interval"),Ik),this.Ki=t}enqueue(t){this.Vi.push(t),this.Yi||this.Xi()}unload(){this.Qi();var t=this.Vi.length>0?this.Zi():{},n=Object.values(t);[...n.filter((r=>r.url.indexOf("/e")===0)),...n.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Ki(_e({},r,{transport:"sendBeacon"}))}))}enable(){this.Gi=!1,this.Xi()}Xi(){var t=this;this.Gi||(this.Yi=setTimeout((()=>{if(this.Qi(),this.Vi.length>0){var n=this.Zi(),r=function(){var i=n[a],o=new Date().getTime();i.data&&Nt(i.data)&&Kt(i.data,(l=>{l.offset=Math.abs(l.timestamp-o),delete l.timestamp})),t.Ki(i)};for(var a in n)r()}}),this.Ji))}Qi(){clearTimeout(this.Yi),this.Yi=void 0}Zi(){var t={};return Kt(this.Vi,(n=>{var r,a=n,i=(a?a.batchKey:null)||a.url;Ae(t[i])&&(t[i]=_e({},a,{data:[]})),(r=t[i].data)==null||r.push(a.data)})),this.Vi=[],t}}var Ace=["retriesPerformedSoFar"];class Tce{constructor(t){this.te=!1,this.ie=3e3,this.Vi=[],this._instance=t,this.Vi=[],this.ee=!0,!Ae(ue)&&"onLine"in ue.navigator&&(this.ee=ue.navigator.onLine,this.re=()=>{this.ee=!0,this.se()},this.ne=()=>{this.ee=!1},jn(ue,"online",this.re),jn(ue,"offline",this.ne))}get length(){return this.Vi.length}retriableRequest(t){var{retriesPerformedSoFar:n}=t,r=o8(t,Ace);Ud(n)&&(r.url=ky(r.url,{retry_count:n})),this._instance._send_request(_e({},r,{callback:a=>{a.statusCode!==200&&(a.statusCode<400||a.statusCode>=500)&&(n??0)<10?this.oe(_e({retriesPerformedSoFar:n},r)):r.callback==null||r.callback(a)}}))}oe(t){var n=t.retriesPerformedSoFar||0;t.retriesPerformedSoFar=n+1;var r=(function(o){var l=3e3*Math.pow(2,o),c=l/2,d=Math.min(18e5,l),f=(Math.random()-.5)*(d-c);return Math.ceil(d+f)})(n),a=Date.now()+r;this.Vi.push({retryAt:a,requestOptions:t});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),ke.warn(i),this.te||(this.te=!0,this.ae())}ae(){if(this.le&&clearTimeout(this.le),this.Vi.length===0)return this.te=!1,void(this.le=void 0);this.le=setTimeout((()=>{this.ee&&this.Vi.length>0&&this.se(),this.ae()}),this.ie)}se(){var t=Date.now(),n=[],r=this.Vi.filter((i=>i.retryAt<t||(n.push(i),!1)));if(this.Vi=n,r.length>0)for(var{requestOptions:a}of r)this.retriableRequest(a)}unload(){for(var{requestOptions:t}of(this.le&&(clearTimeout(this.le),this.le=void 0),this.te=!1,Ae(ue)||(this.re&&(ue.removeEventListener("online",this.re),this.re=void 0),this.ne&&(ue.removeEventListener("offline",this.ne),this.ne=void 0)),this.Vi))try{this._instance._send_request(_e({},t,{transport:"sendBeacon"}))}catch(n){ke.error(n)}this.Vi=[]}}class kce{constructor(t){this.ue=()=>{var n,r,a,i;this.he||(this.he={});var o=this.scrollElement(),l=this.scrollY(),c=o?Math.max(0,o.scrollHeight-o.clientHeight):0,d=l+((o==null?void 0:o.clientHeight)||0),f=(o==null?void 0:o.scrollHeight)||0;this.he.lastScrollY=Math.ceil(l),this.he.maxScrollY=Math.max(l,(n=this.he.maxScrollY)!==null&&n!==void 0?n:0),this.he.maxScrollHeight=Math.max(c,(r=this.he.maxScrollHeight)!==null&&r!==void 0?r:0),this.he.lastContentY=d,this.he.maxContentY=Math.max(d,(a=this.he.maxContentY)!==null&&a!==void 0?a:0),this.he.maxContentHeight=Math.max(f,(i=this.he.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=t}getContext(){return this.he}resetContext(){var t=this.he;return setTimeout(this.ue,0),t}startMeasuringScrollPosition(){jn(ue,"scroll",this.ue,{capture:!0}),jn(ue,"scrollend",this.ue,{capture:!0}),jn(ue,"resize",this.ue)}scrollElement(){if(!this._instance.config.scroll_root_selector)return ue==null?void 0:ue.document.documentElement;var t=Nt(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of t){var r=ue==null?void 0:ue.document.querySelector(n);if(r)return r}}scrollY(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollTop||0}return ue&&(ue.scrollY||ue.pageYOffset||ue.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var t=this.scrollElement();return t&&t.scrollLeft||0}return ue&&(ue.scrollX||ue.pageXOffset||ue.document.documentElement.scrollLeft)||0}}var Nce=e=>K8(e==null?void 0:e.config.mask_personal_data_properties,e==null?void 0:e.config.custom_personal_data_properties);class RB{constructor(t,n,r,a){this.de=i=>{var o=this.ve();if(!o||o.sessionId!==i){var l={sessionId:i,props:this.ce(this._instance)};this.fe.register({[Sk]:l})}},this._instance=t,this.pe=n,this.fe=r,this.ce=a||Nce,this.pe.onSessionId(this.de)}ve(){return this.fe.props[Sk]}getSetOnceProps(){var t,n=(t=this.ve())==null?void 0:t.props;return n?"r"in n?X8(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var t={};return Kt(KN(this.getSetOnceProps()),((n,r)=>{r==="$current_url"&&(r="url"),t["$session_entry_"+fk(r)]=n})),t}}var wS=pn("[SessionId]");class IB{on(t,n){return this._e.on(t,n)}constructor(t,n,r){var a;if(this.ge=[],this.me=void 0,this._e=new QN,this.be=(f,p)=>!(!Ud(f)||!Ud(p))&&Math.abs(f-p)>this.sessionTimeoutMs,!t.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(t.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=t.config,this.fe=t.persistence,this.ye=void 0,this.we=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.xe=n||Bl,this.$e=r||Bl;var i=this.N.persistence_name||this.N.token,o=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*vo(o,60,36e3,wS.createLogger("session_idle_timeout_seconds"),1800),t.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ee(),this.Se="ph_"+i+"_window_id",this.ke="ph_"+i+"_primary_window_exists",this.Pe()){var l=_r.D(this.Se),c=_r.D(this.ke);l&&!c?this.ye=l:_r.L(this.Se),_r.j(this.ke,!0)}if((a=this.N.bootstrap)!=null&&a.sessionID)try{var d=(f=>{var p=f.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.N.bootstrap.sessionID);this.Te(this.N.bootstrap.sessionID,new Date().getTime(),d)}catch(f){wS.error("Invalid sessionID in bootstrap",f)}this.Ce()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(t){return Ae(this.ge)&&(this.ge=[]),this.ge.push(t),this.we&&t(this.we,this.ye),()=>{this.ge=this.ge.filter((n=>n!==t))}}Pe(){return this.N.persistence!=="memory"&&!this.fe.zt&&_r.O()}Ie(t){t!==this.ye&&(this.ye=t,this.Pe()&&_r.j(this.Se,t))}Re(){return this.ye?this.ye:this.Pe()?_r.D(this.Se):null}Te(t,n,r){t===this.we&&n===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=n,this.we=t,this.fe.register({[by]:[n,t,r]}))}Fe(){var t=this.fe.props[by];return Nt(t)&&t.length===2&&t.push(t[0]),t||[0,null,0]}resetSessionId(){this.Te(null,null,null)}destroy(){clearTimeout(this.Oe),this.Oe=void 0,this.me&&ue&&(ue.removeEventListener("beforeunload",this.me,{capture:!1}),this.me=void 0),this.ge=[]}Ce(){this.me=()=>{this.Pe()&&_r.L(this.ke)},jn(ue,"beforeunload",this.me,{capture:!1})}checkAndGetSessionAndWindowId(t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),this.N.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=n||new Date().getTime(),[a,i,o]=this.Fe(),l=this.Re(),c=Ud(o)&&Math.abs(r-o)>864e5,d=!1,f=!i,p=!f&&!t&&this.be(r,a);f||p||c?(i=this.xe(),l=this.$e(),wS.info("new session ID generated",{sessionId:i,windowId:l,changeReason:{noSessionId:f,activityTimeout:p,sessionPastMaximumLength:c}}),o=r,d=!0):l||(l=this.$e(),d=!0);var g=Ud(a)&&t&&!c?a:r,v=Ud(o)?o:new Date().getTime();return this.Ie(l),this.Te(i,g,v),t||this.Ee(),d&&this.ge.forEach((x=>x(i,l,d?{noSessionId:f,activityTimeout:p,sessionPastMaximumLength:c}:void 0))),{sessionId:i,windowId:l,sessionStartTimestamp:v,changeReason:d?{noSessionId:f,activityTimeout:p,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:a}}Ee(){clearTimeout(this.Oe),this.Oe=setTimeout((()=>{var[t]=this.Fe();if(this.be(new Date().getTime(),t)){var n=this.we;this.resetSessionId(),this._e.emit("forcedIdleReset",{idleSessionId:n})}}),1.1*this.sessionTimeoutMs)}}var eV=function(e,t){if(!e)return!1;var n=e.userAgent;if(n&&QU(n,t))return!0;try{var r=e==null?void 0:e.userAgentData;if(r!=null&&r.brands&&r.brands.some((a=>QU(a==null?void 0:a.brand,t))))return!0}catch{}return!!e.webdriver},Yh=(function(e){return e.US="us",e.EU="eu",e.CUSTOM="custom",e})({}),DB="i.posthog.com";class Oce{constructor(t){this.Me={},this.instance=t}get apiHost(){var t=this.instance.config.api_host.trim().replace(/\/$/,"");return t==="https://app.posthog.com"?"https://us.i.posthog.com":t}get flagsApiHost(){var t=this.instance.config.flags_api_host;return t?t.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var t,n=(t=this.instance.config.ui_host)==null?void 0:t.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+DB,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Me[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Me[this.apiHost]=Yh.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Me[this.apiHost]=Yh.EU:this.Me[this.apiHost]=Yh.CUSTOM),this.Me[this.apiHost]}endpointFor(t,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),t==="ui")return this.uiHost+n;if(t==="flags")return this.flagsApiHost+n;if(this.region===Yh.CUSTOM)return this.apiHost+n;var r=DB+n;switch(t){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var Cce={icontains:(e,t)=>!!ue&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!ue&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!ue&&Ny(t.href,e),not_regex:(e,t)=>!!ue&&!Ny(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class Ir{constructor(t){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(r){r===void 0&&(r=!1),n.getWebExperiments((a=>{Ir.Ae("retrieved web experiments from the server"),n.De=new Map,a.forEach((i=>{if(i.feature_flag_key){var o;n.De&&(Ir.Ae("setting flag key ",i.feature_flag_key," to web experiment ",i),(o=n.De)==null||o.set(i.feature_flag_key,i));var l=n._instance.getFeatureFlag(i.feature_flag_key);$n(l)&&i.variants[l]&&n.je(i.name,l,i.variants[l].transforms)}else if(i.variants)for(var c in i.variants){var d=i.variants[c];Ir.Le(d)&&n.je(i.name,c,d.transforms)}}))}),r)},this._instance=t,this._instance.onFeatureFlags((r=>{this.onFeatureFlags(r)}))}onFeatureFlags(t){if(this._is_bot())Ir.Ae("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(pt(this.De))return this.De=new Map,this.loadIfEnabled(),void this.previewWebExperiment();Ir.Ae("applying feature flags",t),t.forEach((n=>{var r;if(this.De&&(r=this.De)!=null&&r.has(n)){var a,i=this._instance.getFeatureFlag(n),o=(a=this.De)==null?void 0:a.get(n);i&&o!=null&&o.variants[i]&&this.je(o.name,i,o.variants[i].transforms)}}))}}previewWebExperiment(){var t=Ir.getWindowLocation();if(t!=null&&t.search){var n=Sy(t==null?void 0:t.search,"__experiment_id"),r=Sy(t==null?void 0:t.search,"__experiment_variant");n&&r&&(Ir.Ae("previewing web experiments "+n+" && "+r),this.getWebExperiments((a=>{this.Ne(parseInt(n),r,a)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,n,r){if(this._instance.config.disable_web_experiments&&!r)return t([]);var a=this._instance.get_property("$web_experiments");if(a&&!n)return t(a);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:i=>{if(i.statusCode!==200||!i.json)return t([]);var o=i.json.experiments||[];return t(o)}})}Ne(t,n,r){var a=r.filter((i=>i.id===t));a&&a.length>0&&(Ir.Ae("Previewing web experiment ["+a[0].name+"] with variant ["+n+"]"),this.je(a[0].name,n,a[0].variants[n].transforms))}static Le(t){return!pt(t.conditions)&&Ir.Ue(t)&&Ir.ze(t)}static Ue(t){var n;if(pt(t.conditions)||pt((n=t.conditions)==null?void 0:n.url))return!0;var r,a,i,o=Ir.getWindowLocation();return!!o&&((r=t.conditions)==null||!r.url||Cce[(a=(i=t.conditions)==null?void 0:i.urlMatchType)!==null&&a!==void 0?a:"icontains"](t.conditions.url,o))}static getWindowLocation(){return ue==null?void 0:ue.location}static ze(t){var n;if(pt(t.conditions)||pt((n=t.conditions)==null?void 0:n.utm))return!0;var r=q8();if(r.utm_source){var a,i,o,l,c,d,f,p,g=(a=t.conditions)==null||(a=a.utm)==null||!a.utm_campaign||((i=t.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==r.utm_campaign,v=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_source||((l=t.conditions)==null||(l=l.utm)==null?void 0:l.utm_source)==r.utm_source,x=(c=t.conditions)==null||(c=c.utm)==null||!c.utm_medium||((d=t.conditions)==null||(d=d.utm)==null?void 0:d.utm_medium)==r.utm_medium,w=(f=t.conditions)==null||(f=f.utm)==null||!f.utm_term||((p=t.conditions)==null||(p=p.utm)==null?void 0:p.utm_term)==r.utm_term;return g&&x&&w&&v}return!1}static Ae(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];ke.info("[WebExperiments] "+t,r)}je(t,n,r){this._is_bot()?Ir.Ae("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?r.forEach((a=>{if(a.selector){var i;Ir.Ae("applying transform of variant "+n+" for experiment "+t+" ",a);var o=(i=document)==null?void 0:i.querySelectorAll(a.selector);o==null||o.forEach((l=>{var c=l;a.html&&(c.innerHTML=a.html),a.css&&c.setAttribute("style",a.css)}))}})):Ir.Ae("Control variants leave the page unmodified.")}_is_bot(){return ja&&this._instance?eV(ja,this._instance.config.custom_blocked_useragents):void 0}}var Rce=pn("[PostHog ExternalIntegrations]"),Ice={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Dce{constructor(t){this._instance=t}V(t,n){var r;(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,t,(a=>{if(a)return Rce.error("failed to load script",a);n()}))}startIfEnabledOrStop(){var t=this,n=function(o){var l,c,d;!a||(l=ze.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[o]||t.V(Ice[o],(()=>{var f;(f=ze.__PosthogExtensions__)==null||(f=f.integrations)==null||(f=f[o])==null||f.start(t._instance)})),!a&&(c=ze.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[o]&&((d=ze.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[o])==null||d.stop())};for(var[r,a]of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;n(r)}}}var tm={},ES=0,Dk=()=>{},Bd="posthog",tV=!Xue&&(ya==null?void 0:ya.indexOf("MSIE"))===-1&&(ya==null?void 0:ya.indexOf("Mozilla"))===-1,MB=e=>{var t;return _e({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Aue(Se==null?void 0:Se.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Dk,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,debug:Sr&&$n(Sr==null?void 0:Sr.search)&&Sr.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(ue==null||(t=ue.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var r="Bad HTTP status: "+n.statusCode+" "+n.text;ke.error(r)},get_device_id:n=>n,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:Ik},error_tracking:{},_onCapture:Dk,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},LB=e=>{var t={};Ae(e.process_person)||(t.person_profiles=e.process_person),Ae(e.xhr_headers)||(t.request_headers=e.xhr_headers),Ae(e.cookie_name)||(t.persistence_name=e.cookie_name),Ae(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),Ae(e.store_google)||(t.save_campaign_params=e.store_google),Ae(e.verbose)||(t.debug=e.verbose);var n=Nn({},t,e);return Nt(e.property_blacklist)&&(Ae(e.property_denylist)?n.property_denylist=e.property_blacklist:Nt(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:ke.error("Invalid value for property_denylist config: "+e.property_denylist)),n};class Mce{constructor(){this.__forceAllowLocalhost=!1}get He(){return this.__forceAllowLocalhost}set He(t){ke.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=t}}class vs{get decideEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,n;return(t=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){this.webPerformance=new Mce,this.qe=!1,this.version=is.LIB_VERSION,this.Ft=new QN,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=MB(),this.SentryIntegration=Fue,this.sentryIntegration=t=>(function(n,r){var a=j8(n,r);return{name:P8,processEvent:i=>a(i)}})(this,t),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Be=!1,this.We=null,this.Ge=null,this.Ve=null,this.featureFlags=new dce(this),this.toolbar=new Bue(this),this.scrollManager=new kce(this),this.pageViewManager=new vB(this),this.surveys=new yce(this),this.conversations=new xce(this),this.logs=new Ece(this),this.experiments=new Ir(this),this.exceptions=new Zue(this),this.rateLimiter=new _ce(this),this.requestRouter=new Oce(this),this.consent=new Mue(this),this.externalIntegrations=new Dce(this),this.people={set:(t,n,r)=>{var a=$n(t)?{[t]:n}:t;this.setPersonProperties(a),r==null||r({})},set_once:(t,n,r)=>{var a=$n(t)?{[t]:n}:t;this.setPersonProperties(void 0,a),r==null||r({})}},this.on("eventCaptured",(t=>ke.info('send "'+(t==null?void 0:t.event)+'"',t)))}init(t,n,r){if(r&&r!==Bd){var a,i=(a=tm[r])!==null&&a!==void 0?a:new vs;return i._init(t,n,r),tm[r]=i,tm[Bd][r]=i,i}return this._init(t,n,r)}_init(t,n,r){var a;if(n===void 0&&(n={}),Ae(t)||pk(t))return ke.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.Je(n.debug),this.Ke=n,this.Ye=[],n.person_profiles?this.Ge=n.person_profiles:n.process_person&&(this.Ge=n.process_person),this.set_config(Nn({},MB(n.defaults),LB(n),{name:r,token:t})),this.config.on_xhr_error&&ke.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:hs.GZipJS;var i=this.Xe();this.persistence=new vS(this.config,i),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new vS(_e({},this.config,{persistence:"sessionStorage"}),i);var o=_e({},this.persistence.props),l=_e({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Qe=new Sce((T=>this.Ze(T)),this.config.request_queue_config),this.tr=new Tce(this),this.__request_queue=[];var c=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(c||(this.sessionManager=new IB(this),this.sessionPropsManager=new RB(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(ke.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.ir(c)}),0)):(ke.info("Initializing extensions synchronously"),this.ir(c)),is.DEBUG=is.DEBUG||this.config.debug,is.DEBUG&&ke.info("Starting in debug mode",{this:this,config:n,thisC:_e({},this.config),p:o,s:l}),((a=n.bootstrap)==null?void 0:a.distinctID)!==void 0){var d,f,p=this.config.get_device_id(Bl()),g=(d=n.bootstrap)!=null&&d.isIdentifiedID?p:n.bootstrap.distinctID;this.persistence.set_property(lo,(f=n.bootstrap)!=null&&f.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:g})}if(this.er()){var v,x,w=Object.keys(((v=n.bootstrap)==null?void 0:v.featureFlags)||{}).filter((T=>{var k;return!((k=n.bootstrap)==null||(k=k.featureFlags)==null||!k[T])})).reduce(((T,k)=>{var N;return T[k]=((N=n.bootstrap)==null||(N=N.featureFlags)==null?void 0:N[k])||!1,T}),{}),E=Object.keys(((x=n.bootstrap)==null?void 0:x.featureFlagPayloads)||{}).filter((T=>w[T])).reduce(((T,k)=>{var N,C;return(N=n.bootstrap)!=null&&(N=N.featureFlagPayloads)!=null&&N[k]&&(T[k]=(C=n.bootstrap)==null||(C=C.featureFlagPayloads)==null?void 0:C[k]),T}),{});this.featureFlags.receivedFeatureFlags({featureFlags:w,featureFlagPayloads:E})}if(c)this.register_once({distinct_id:bh,$device_id:null},"");else if(!this.get_distinct_id()){var S=this.config.get_device_id(Bl());this.register_once({distinct_id:S,$device_id:S},""),this.persistence.set_property(lo,"anonymous")}return jn(ue,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?jue(this,(()=>this.rr())):this.rr(),gs(this.config._onCapture)&&this.config._onCapture!==Dk&&(ke.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(T=>this.config._onCapture(T.event,T)))),this.config.ip&&ke.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}ir(t){var n=performance.now(),r=_e({},vs.__defaultExtensionClasses,this.config.__extensionClasses);r.historyAutocapture&&(this.historyAutocapture=new r.historyAutocapture(this),this.historyAutocapture.startIfEnabled());var a=[];r.tracingHeaders&&a.push((()=>{new r.tracingHeaders(this).startIfEnabledOrStop()})),r.siteApps&&a.push((()=>{var i;this.siteApps=new r.siteApps(this),(i=this.siteApps)==null||i.init()})),!t&&r.sessionRecording&&a.push((()=>{this.sessionRecording=new r.sessionRecording(this),this.sessionRecording.startIfEnabledOrStop()})),this.config.disable_scroll_properties||a.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),r.autocapture&&a.push((()=>{this.autocapture=new r.autocapture(this),this.autocapture.startIfEnabled()})),a.push((()=>{this.surveys.loadIfEnabled()})),a.push((()=>{this.logs.loadIfEnabled()})),a.push((()=>{this.conversations.loadIfEnabled()})),r.productTours&&a.push((()=>{this.productTours=new r.productTours(this),this.productTours.loadIfEnabled()})),r.heatmaps&&a.push((()=>{this.heatmaps=new r.heatmaps(this),this.heatmaps.startIfEnabled()})),r.webVitalsAutocapture&&a.push((()=>{this.webVitalsAutocapture=new r.webVitalsAutocapture(this)})),r.exceptionObserver&&a.push((()=>{this.exceptionObserver=new r.exceptionObserver(this),this.exceptionObserver.startIfEnabledOrStop()})),r.deadClicksAutocapture&&a.push((()=>{this.deadClicksAutocapture=new r.deadClicksAutocapture(this,Pue),this.deadClicksAutocapture.startIfEnabledOrStop()})),a.push((()=>{if(this.sr){var i=this.sr;this.sr=void 0,this.qi(i)}})),this.nr(a,n)}nr(t,n){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&t.length>0)return void setTimeout((()=>{this.nr(t,n)}),0);var r=t.shift();if(r)try{r()}catch(i){ke.error("Error initializing extension:",i)}}var a=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:a}),this.config.__preview_deferred_init_extensions&&ke.info("PostHog extensions initialized ("+a+"ms)")}qi(t){var n,r,a,i,o,l,c,d,f;if(!Se||!Se.body)return ke.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.qi(t)}),500);this.config.__preview_deferred_init_extensions&&(this.sr=t),this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=ut(t.supportedCompression,hs.GZipJS)?hs.GZipJS:ut(t.supportedCompression,hs.Base64)?hs.Base64:void 0),(n=t.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ge?this.Ge:"identified_only"}),(r=this.siteApps)==null||r.onRemoteConfig(t),(a=this.sessionRecording)==null||a.onRemoteConfig(t),(i=this.autocapture)==null||i.onRemoteConfig(t),(o=this.heatmaps)==null||o.onRemoteConfig(t),this.surveys.onRemoteConfig(t),this.logs.onRemoteConfig(t),this.conversations.onRemoteConfig(t),(l=this.productTours)==null||l.onRemoteConfig(t),(c=this.webVitalsAutocapture)==null||c.onRemoteConfig(t),(d=this.exceptionObserver)==null||d.onRemoteConfig(t),this.exceptions.onRemoteConfig(t),(f=this.deadClicksAutocapture)==null||f.onRemoteConfig(t)}rr(){try{this.config.loaded(this)}catch(r){ke.critical("`loaded` function failed",r)}if(this.ar(),this.config.internal_or_test_user_hostname&&Sr!=null&&Sr.hostname){var t=Sr.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?t===n:n.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.lr()}),1),this.ur=new J8(this),this.ur.load()}ar(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Qe)==null||t.enable())}_dom_loaded(){this.is_capturing()&&ql(this.__request_queue,(t=>this.Ze(t))),this.__request_queue=[],this.ar()}_handle_unload(){var t,n;this.surveys.handlePageUnload(),this.config.request_batching?(this.hr()&&this.capture("$pageleave"),(t=this.Qe)==null||t.unload(),(n=this.tr)==null||n.unload()):this.hr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(tV?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=ky(t.url,{ip:this.config.ip?1:0}),t.headers=_e({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(n=>{var r,a,i,o=_e({},n);o.timeout=o.timeout||6e4,o.url=ky(o.url,{_:new Date().getTime().toString(),ver:is.LIB_VERSION,compression:o.compression});var l=(r=o.transport)!==null&&r!==void 0?r:"fetch",c=Yv.filter((f=>!o.disableTransport||!f.transport||!o.disableTransport.includes(f.transport))),d=(a=(i=O8(c,(f=>f.transport===l)))==null?void 0:i.method)!==null&&a!==void 0?a:c[0].method;if(!d)throw new Error("No available transport method");d(o)})(_e({},t,{callback:n=>{var r,a;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((r=(a=this.config).on_request_error)==null||r.call(a,n)),t.callback==null||t.callback(n)}}))))}Ze(t){this.tr?this.tr.retriableRequest(t):this._send_request(t)}_execute_array(t){ES++;try{var n,r=[],a=[],i=[];ql(t,(l=>{l&&(n=l[0],Nt(n)?i.push(l):gs(l)?l.call(this):Nt(l)&&n==="alias"?r.push(l):Nt(l)&&n.indexOf("capture")!==-1&&gs(this[n])?i.push(l):a.push(l))}));var o=function(l,c){ql(l,(function(d){if(Nt(d[0])){var f=c;Kt(d,(function(p){f=f[p[0]].apply(f,p.slice(1))}))}else this[d[0]].apply(this,d.slice(1))}),c)};o(r,this),o(a,this),o(i,this)}finally{ES--}}er(){var t,n;return((t=this.config.bootstrap)==null?void 0:t.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(t){if(ES>0&&Nt(t)&&$n(t[0])){var n=vs.prototype[t[0]];gs(n)&&n.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,n,r){var a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Qe){if(this.is_capturing())if(!Ae(t)&&$n(t)){var i=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(i&&!this.config.__preview_capture_bot_pageviews)){var o=r!=null&&r.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(o==null||!o.isRateLimited){n!=null&&n.$current_url&&!$n(n==null?void 0:n.$current_url)&&(ke.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),t!=="$exception"||r!=null&&r.ft||ke.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,c=(r==null?void 0:r.timestamp)||l,d=Bl(),f={uuid:d,event:t,properties:this.calculateEventProperties(t,n||{},c,d)};t==="$pageview"&&this.config.__preview_capture_bot_pageviews&&i&&(f.event="$bot_pageview",f.properties.$browser_type="bot"),o&&(f.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),r!=null&&r.$set&&(f.$set=r==null?void 0:r.$set);var p,g=t!=="$groupidentify",v=this.dr(r==null?void 0:r.$set_once,g);if(v&&(f.$set_once=v),(f=_ue(f,r!=null&&r._noTruncate?null:this.config.properties_string_max_length)).timestamp=c,Ae(r==null?void 0:r.timestamp)||(f.properties.$event_time_override_provided=!0,f.properties.$event_time_override_system_time=l),t===Wh.DISMISSED||t===Wh.SENT){var x=n==null?void 0:n[xS.SURVEY_ID],w=n==null?void 0:n[xS.SURVEY_ITERATION];p={id:x,current_iteration:w},localStorage.getItem(NB(p))||localStorage.setItem(NB(p),"true"),f.$set=_e({},f.$set,{[pce({id:x,current_iteration:w},t===Wh.SENT?"responded":"dismissed")]:!0})}else t===Wh.SHOWN&&(f.$set=_e({},f.$set,{[xS.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===wce.SHOWN){var E=n==null?void 0:n[OB.TOUR_TYPE];E&&(f.$set=_e({},f.$set,{[OB.TOUR_LAST_SEEN_DATE+"/"+E]:new Date().toISOString()}))}var S=_e({},f.properties.$set,f.$set);if(Hd(S)||this.setPersonPropertiesForFlags(S),!pt(this.config.before_send)){var T=this.vr(f);if(!T)return;f=T}this.Ft.emit("eventCaptured",f);var k={method:"POST",url:(a=r==null?void 0:r._url)!==null&&a!==void 0?a:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:f,compression:"best-available",batchKey:r==null?void 0:r._batchKey};return!this.config.request_batching||r&&(r==null||!r._batchKey)||r!=null&&r.send_instantly?this.Ze(k):this.Qe.enqueue(k),f}ke.critical("This capture call is ignored due to client rate limiting.")}}else ke.error("No event name provided to posthog.capture")}else ke.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(n=>t(n.event,n)))}calculateEventProperties(t,n,r,a,i){if(r=r||new Date,!this.persistence||!this.sessionPersistence)return n;var o=i?void 0:this.persistence.remove_event_timer(t),l=_e({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(l.$cookieless_mode=!0),t==="$snapshot"){var c=_e({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=c.distinct_id,(!$n(l.distinct_id)&&!ks(l.distinct_id)||pk(l.distinct_id))&&ke.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var d,f=tce(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:p,windowId:g}=this.sessionManager.checkAndGetSessionAndWindowId(i,r.getTime());l.$session_id=p,l.$window_id=g}this.sessionPropsManager&&Nn(l,this.sessionPropsManager.getSessionProps());try{var v;this.sessionRecording&&Nn(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=(v=this.tr)==null?void 0:v.length}catch(S){l.$sdk_debug_error_capturing_properties=String(S)}if(this.requestRouter.region===Yh.CUSTOM&&(l.$lib_custom_api_host=this.config.api_host),d=t!=="$pageview"||i?t!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(r):this.pageViewManager.doPageView(r,a),l=Nn(l,d),t==="$pageview"&&Se&&(l.title=Se.title),!Ae(o)){var x=r.getTime()-o;l.$duration=parseFloat((x/1e3).toFixed(3))}ya&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser"),(l=Nn({},f,this.persistence.properties(),this.sessionPersistence.properties(),l)).$is_identified=this._isIdentified(),Nt(this.config.property_denylist)?Kt(this.config.property_denylist,(function(S){delete l[S]})):ke.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var w=this.config.sanitize_properties;w&&(ke.error("sanitize_properties is deprecated. Use before_send instead"),l=w(l,t));var E=this.cr();return l.$process_person_profile=E,E&&!i&&this.pr("_calculate_event_properties"),l}dr(t,n){var r;if(n===void 0&&(n=!0),!this.persistence||!this.cr()||this.qe)return t;var a=this.persistence.get_initial_props(),i=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),o=Nn({},a,i||{},t||{}),l=this.config.sanitize_properties;return l&&(ke.error("sanitize_properties is deprecated. Use before_send instead"),o=l(o,"$set_once")),n&&(this.qe=!0),Hd(o)?void 0:o}register(t,n){var r;(r=this.persistence)==null||r.register(t,n)}register_once(t,n,r){var a;(a=this.persistence)==null||a.register_once(t,n,r)}register_for_session(t){var n;(n=this.sessionPersistence)==null||n.register(t)}unregister(t){var n;(n=this.persistence)==null||n.unregister(t)}unregister_for_session(t){var n;(n=this.sessionPersistence)==null||n.unregister(t)}_r(t,n){this.register({[t]:n})}getFeatureFlag(t,n){return this.featureFlags.getFeatureFlag(t,n)}getFeatureFlagPayload(t){return this.featureFlags.getFeatureFlagPayload(t)}getFeatureFlagResult(t,n){return this.featureFlags.getFeatureFlagResult(t,n)}isFeatureEnabled(t,n){return this.featureFlags.isFeatureEnabled(t,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(t,n,r){var a=r!=null&&r.merge?this.featureFlags.getFlagVariants():{},i=r!=null&&r.merge?this.featureFlags.getFlagPayloads():{},o=_e({},a,t),l=_e({},i,n),c={};for(var[d,f]of Object.entries(o)){var p=typeof f=="string";c[d]={key:d,enabled:!!p||!!f,variant:p?f:void 0,reason:void 0,metadata:Ae(l==null?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.featureFlags.receivedFeatureFlags({flags:c})}updateEarlyAccessFeatureEnrollment(t,n,r){this.featureFlags.updateEarlyAccessFeatureEnrollment(t,n,r)}getEarlyAccessFeatures(t,n,r){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(t,n,r)}on(t,n){return this.Ft.on(t,n)}onFeatureFlags(t){return this.featureFlags.onFeatureFlags(t)}onSurveysLoaded(t){return this.surveys.onSurveysLoaded(t)}onSessionId(t){var n,r;return(n=(r=this.sessionManager)==null?void 0:r.onSessionId(t))!==null&&n!==void 0?n:()=>{}}getSurveys(t,n){n===void 0&&(n=!1),this.surveys.getSurveys(t,n)}getActiveMatchingSurveys(t,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(t,n)}renderSurvey(t,n){this.surveys.renderSurvey(t,n)}displaySurvey(t,n){n===void 0&&(n=mce),this.surveys.displaySurvey(t,n)}cancelPendingSurvey(t){this.surveys.cancelPendingSurvey(t)}canRenderSurvey(t){return this.surveys.canRenderSurvey(t)}canRenderSurveyAsync(t,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(t,n)}identify(t,n,r){if(!this.__loaded||!this.persistence)return ke.uninitializedWarning("posthog.identify");if(ks(t)&&(t=t.toString(),ke.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),t)if(["distinct_id","distinctid"].includes(t.toLowerCase()))ke.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(t!==bh){if(this.pr("posthog.identify")){var a=this.get_distinct_id();if(this.register({$user_id:t}),!this.get_property("$device_id")){var i=a;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}t!==a&&t!==this.get_property(zh)&&(this.unregister(zh),this.register({distinct_id:t}));var o=(this.persistence.get_property(lo)||"anonymous")==="anonymous";t!==a&&o?(this.persistence.set_property(lo,"identified"),this.setPersonPropertiesForFlags(_e({},r||{},n||{}),!1),this.capture("$identify",{distinct_id:t,$anon_distinct_id:a},{$set:n||{},$set_once:r||{}}),this.Ve=_B(t,n,r),this.featureFlags.setAnonymousDistinctId(a)):(n||r)&&this.setPersonProperties(n,r),t!==a&&(this.reloadFeatureFlags(),this.unregister(vy))}}else ke.critical('The string "'+bh+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else ke.error("Unique user id has not been set in posthog.identify")}setPersonProperties(t,n){if((t||n)&&this.pr("posthog.setPersonProperties")){var r=_B(this.get_distinct_id(),t,n);this.Ve!==r?(this.setPersonPropertiesForFlags(_e({},n||{},t||{})),this.capture("$set",{$set:t||{},$set_once:n||{}}),this.Ve=r):ke.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,n,r){if(t&&n){var a=this.getGroups();a[t]!==n&&this.resetGroupPropertiesForFlags(t),this.register({$groups:_e({},a,{[t]:n})}),r&&(this.capture("$groupidentify",{$group_type:t,$group_key:n,$group_set:r}),this.setGroupPropertiesForFlags({[t]:r})),a[t]===n||r||this.reloadFeatureFlags()}else ke.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(t,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,n){n===void 0&&(n=!0),this.pr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(t,n)}resetGroupPropertiesForFlags(t){this.featureFlags.resetGroupPropertiesForFlags(t)}reset(t){var n,r,a,i,o;if(ke.info("reset"),!this.__loaded)return ke.uninitializedWarning("posthog.reset");var l=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(r=this.sessionPersistence)==null||r.clear(),this.surveys.reset(),(a=this.ur)==null||a.stop(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(lo,"anonymous"),(o=this.sessionManager)==null||o.resetSessionId(),this.Ve=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:bh,$device_id:null},"");else{var c=this.config.get_device_id(Bl());this.register_once({distinct_id:c,$device_id:t?c:l},"")}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 t,n;return(t=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:r}=this.sessionManager.checkAndGetSessionAndWindowId(!0),a=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(t!=null&&t.withTimestamp&&r){var i,o=(i=t.timestampLookBack)!==null&&i!==void 0?i:10;if(!r)return a;a+="?t="+Math.max(Math.floor((new Date().getTime()-r)/1e3)-o,0)}return a}alias(t,n){return t===this.get_property(R8)?(ke.critical("Attempting to create alias for existing People user - aborting."),-2):this.pr("posthog.alias")?(Ae(n)&&(n=this.get_distinct_id()),t!==n?(this._r(zh,t),this.capture("$create_alias",{alias:t,distinct_id:n})):(ke.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var n=_e({},this.config);if(Vn(t)){var r,a,i,o,l,c,d,f;Nn(this.config,LB(t));var p=this.Xe();(r=this.persistence)==null||r.update_config(this.config,n,p),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new vS(_e({},this.config,{persistence:"sessionStorage"}),p);var g=this.Je(this.config.debug);Es(g)&&(this.config.debug=g),Es(this.config.debug)&&(this.config.debug?(is.DEBUG=!0,dn.O()&&dn.j("ph_debug","true"),ke.info("set_config",{config:t,oldConfig:n,newConfig:_e({},this.config)})):(is.DEBUG=!1,dn.O()&&dn.L("ph_debug"))),(a=this.exceptionObserver)==null||a.onConfigChange(),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(o=this.autocapture)==null||o.startIfEnabled(),(l=this.heatmaps)==null||l.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(d=this.deadClicksAutocapture)==null||d.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.gr(),(f=this.externalIntegrations)==null||f.startIfEnabledOrStop()}}startSessionRecording(t){var n=t===!0,r={sampling:n||!(t==null||!t.sampling),linked_flag:n||!(t==null||!t.linked_flag),url_trigger:n||!(t==null||!t.url_trigger),event_trigger:n||!(t==null||!t.event_trigger)};if(Object.values(r).some(Boolean)){var a,i,o,l,c;(a=this.sessionManager)==null||a.checkAndGetSessionAndWindowId(),r.sampling&&((i=this.sessionRecording)==null||i.overrideSampling()),r.linked_flag&&((o=this.sessionRecording)==null||o.overrideLinkedFlag()),r.url_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("url")),r.event_trigger&&((c=this.sessionRecording)==null||c.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,n){var r=new Error("PostHog syntheticException"),a=this.exceptions.buildProperties(t,{handled:!0,syntheticException:r});return this.exceptions.sendExceptionEvent(_e({},a,n))}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){return this.toolbar.loadToolbar(t)}get_property(t){var n;return(n=this.persistence)==null?void 0:n.props[t]}getSessionProperty(t){var n;return(n=this.sessionPersistence)==null?void 0:n.props[t]}toString(){var t,n=(t=this.config.name)!==null&&t!==void 0?t:Bd;return n!==Bd&&(n=Bd+"."+n),n}_isIdentified(){var t,n;return((t=this.persistence)==null?void 0:t.get_property(lo))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(lo))==="identified"}cr(){var t,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Hd(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[zh])&&((n=this.persistence)==null||(n=n.props)==null||!n[wy]))}hr(){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.cr()||this.pr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.pr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}pr(t){return this.config.person_profiles==="never"?(ke.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._r(wy,!0),!0)}Xe(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||t&&!!n}gr(){var t,n,r,a,i=this.Xe();return((t=this.persistence)==null?void 0:t.zt)!==i&&((r=this.persistence)==null||r.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.zt)!==i&&((a=this.sessionPersistence)==null||a.set_disabled(i)),i}opt_in_capturing(t){var n;if(this.config.cookieless_mode!=="always"){if(this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()){var r,a,i,o,l;this.reset(!0),(r=this.sessionManager)==null||r.destroy(),(a=this.pageViewManager)==null||a.destroy(),this.sessionManager=new IB(this),this.pageViewManager=new vB(this),this.persistence&&(this.sessionPropsManager=new RB(this,this.sessionManager,this.persistence));var c=(i=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&i!==void 0?i:(l=vs.__defaultExtensionClasses)==null?void 0:l.sessionRecording;c&&(this.sessionRecording=new c(this),this.sessionRecording.startIfEnabledOrStop())}var d;this.consent.optInOut(!0),this.gr(),this.ar(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(Ae(t==null?void 0:t.captureEventName)||t!=null&&t.captureEventName)&&this.capture((d=t==null?void 0:t.captureEventName)!==null&&d!==void 0?d:"$opt_in",t==null?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.lr()}else ke.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var t,n,r;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.gr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:bh,$device_id:null}),(t=this.sessionManager)==null||t.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(r=this.sessionRecording)==null||r.stopRecording(),this.sessionRecording=void 0,this.lr())):ke.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===ss.GRANTED?"granted":t===ss.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.gr()}_is_bot(){return ja?eV(ja,this.config.custom_blocked_useragents):void 0}lr(){Se&&(Se.visibilityState==="visible"?this.Be||(this.Be=!0,this.capture("$pageview",{title:Se.title},{send_instantly:!0}),this.We&&(Se.removeEventListener("visibilitychange",this.We),this.We=null)):this.We||(this.We=this.lr.bind(this),jn(Se,"visibilitychange",this.We)))}debug(t){t===!1?(ue==null||ue.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(ue==null||ue.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}At(){var t,n,r,a,i,o,l,c=this.Ke||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(ke.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(r="advanced_disable_decide",a=!1,i=ke,o=(n="advanced_disable_flags")in(t=c)&&!pt(t[n]),l=r in t&&!pt(t[r]),o?t[n]:l?(i&&i.warn("Config field '"+r+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),t[r]):a)}vr(t){if(pt(this.config.before_send))return t;var n=Nt(this.config.before_send)?this.config.before_send:[this.config.before_send],r=t;for(var a of n){if(r=a(r),pt(r)){var i="Event '"+t.event+"' was rejected in beforeSend function";return Ule(t.event)?ke.warn(i+". This can cause unexpected behavior."):ke.info(i),null}r.properties&&!Hd(r.properties)||ke.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return r}getPageViewId(){var t;return(t=this.pageViewManager.it)==null?void 0:t.pageViewId}captureTraceFeedback(t,n){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:n})}captureTraceMetric(t,n,r){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:n,$ai_metric_value:String(r)})}Je(t){var n=Es(t)&&!t,r=dn.O()&&dn.A("ph_debug")==="true";return!n&&(!!r||t)}}vs.__defaultExtensionClasses={},(function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=Eue(e.prototype[t[n]])})(vs,["identify"]);function PB(e){return e instanceof Element&&(e.id===M8||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function n0(e){return!!e&&e.nodeType===1}function Vl(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function nV(e){return!!e&&e.nodeType===3}function rV(e){return!!e&&e.nodeType===11}function JN(e){return e?e0(e).split(/\s+/):[]}function jB(e){var t=ue==null?void 0:ue.location.href;return!!(t&&e&&e.some((n=>t.match(n))))}function Oy(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return JN(t)}function aV(e){return pt(e)?null:e0(e).split(/(\s+)/).filter((t=>bm(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Zm(e){var t="";return Mk(e)&&!lV(e)&&e.childNodes&&e.childNodes.length&&Kt(e.childNodes,(function(n){var r;nV(n)&&n.textContent&&(t+=(r=aV(n.textContent))!==null&&r!==void 0?r:"")})),e0(t)}function FB(e){return Ae(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var eO=["a","button","form","input","select","textarea","label"];function iV(e,t){if(Ae(t))return!0;var n,r=function(i){if(t.some((o=>i.matches(o))))return{v:!0}};for(var a of e)if(n=r(a))return n.v;return!1}function oV(e){var t=e.parentNode;return!(!t||!n0(t))&&t}var Lce=["next","previous","prev",">","<"],$B=10,UB=[".ph-no-rageclick",".ph-no-capture"];function Pce(e,t){if(!ue||tO(e))return!1;var n,r,a;if(Es(t)?(n=!!t&&UB,r=void 0):(n=(a=t==null?void 0:t.css_selector_ignorelist)!==null&&a!==void 0?a:UB,r=t==null?void 0:t.content_ignorelist),n===!1)return!1;var{targetElementList:i}=sV(e,!1);return!(function(o,l){if(o===!1||Ae(o))return!1;var c;if(o===!0)c=Lce;else{if(!Nt(o))return!1;if(o.length>$B)return ke.error("[PostHog] content_ignorelist array cannot exceed "+$B+" items. Use css_selector_ignorelist for more complex matching."),!1;c=o.map((d=>d.toLowerCase()))}return l.some((d=>{var{safeText:f,ariaLabel:p}=d;return c.some((g=>f.includes(g)||p.includes(g)))}))})(r,i.map((o=>{var l;return{safeText:Zm(o).toLowerCase(),ariaLabel:((l=o.getAttribute("aria-label"))==null?void 0:l.toLowerCase().trim())||""}})))&&!iV(i,n)}var tO=e=>!e||Vl(e,"html")||!n0(e),sV=(e,t)=>{if(!ue||tO(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,r=[e],a=e;a.parentNode&&!Vl(a,"body");)if(rV(a.parentNode))r.push(a.parentNode.host),a=a.parentNode.host;else{var i=oV(a);if(!i)break;if(t||eO.indexOf(i.tagName.toLowerCase())>-1)n=!0;else{var o=ue.getComputedStyle(i);o&&o.getPropertyValue("cursor")==="pointer"&&(n=!0)}r.push(i),a=i}return{parentIsUsefulElement:n,targetElementList:r}};function jce(e,t,n,r,a){var i,o,l,c;if(n===void 0&&(n=void 0),!ue||tO(e)||(i=n)!=null&&i.url_allowlist&&!jB(n.url_allowlist)||(o=n)!=null&&o.url_ignorelist&&jB(n.url_ignorelist))return!1;if((l=n)!=null&&l.dom_event_allowlist){var d=n.dom_event_allowlist;if(d&&!d.some((x=>t.type===x)))return!1}var{parentIsUsefulElement:f,targetElementList:p}=sV(e,r);if(!(function(x,w){var E=w==null?void 0:w.element_allowlist;if(Ae(E))return!0;var S,T=function(N){if(E.some((C=>N.tagName.toLowerCase()===C)))return{v:!0}};for(var k of x)if(S=T(k))return S.v;return!1})(p,n)||!iV(p,(c=n)==null?void 0:c.css_selector_allowlist))return!1;var g=ue.getComputedStyle(e);if(g&&g.getPropertyValue("cursor")==="pointer"&&t.type==="click")return!0;var v=e.tagName.toLowerCase();switch(v){case"html":return!1;case"form":return(a||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(a||["change","click"]).indexOf(t.type)>=0;default:return f?(a||["click"]).indexOf(t.type)>=0:(a||["click"]).indexOf(t.type)>=0&&(eO.indexOf(v)>-1||e.getAttribute("contenteditable")==="true")}}function Mk(e){for(var t=e;t.parentNode&&!Vl(t,"body");t=t.parentNode){var n=Oy(t);if(ut(n,"ph-sensitive")||ut(n,"ph-no-capture"))return!1}if(ut(Oy(e),"ph-include"))return!0;var r=e.type||"";if($n(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var a=e.name||e.id||"";return!($n(a)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,"")))}function lV(e){return!!(Vl(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Vl(e,"select")||Vl(e,"textarea")||e.getAttribute("contenteditable")==="true")}var uV="(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})",Fce=new RegExp("^(?:"+uV+")$"),$ce=new RegExp(uV),cV="\\d{3}-?\\d{2}-?\\d{4}",Uce=new RegExp("^("+cV+")$"),Bce=new RegExp("("+cV+")");function bm(e,t){return t===void 0&&(t=!0),!(pt(e)||$n(e)&&(e=e0(e),(t?Fce:$ce).test((e||"").replace(/[- ]/g,""))||(t?Uce:Bce).test(e)))}function dV(e){var t=Zm(e);return bm(t=(t+" "+fV(e)).trim())?t:""}function fV(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Kt(e.childNodes,(function(n){var r;if(n&&((r=n.tagName)==null?void 0:r.toLowerCase())==="span")try{var a=Zm(n);t=(t+" "+a).trim(),n.childNodes&&n.childNodes.length&&(t=(t+" "+fV(n)).trim())}catch(i){ke.error("[AutoCapture]",i)}})),t}function zce(e){return(function(t){var n=t.map((r=>{var a,i,o="";if(r.tag_name&&(o+=r.tag_name),r.attr_class)for(var l of(r.attr_class.sort(),r.attr_class))o+="."+l.replace(/"/g,"");var c=_e({},r.text?{text:r.text}:{},{"nth-child":(a=r.nth_child)!==null&&a!==void 0?a:0,"nth-of-type":(i=r.nth_of_type)!==null&&i!==void 0?i:0},r.href?{href:r.href}:{},r.attr_id?{attr_id:r.attr_id}:{},r.attributes),d={};return Wv(c).sort(((f,p)=>{var[g]=f,[v]=p;return g.localeCompare(v)})).forEach((f=>{var[p,g]=f;return d[BB(p.toString())]=BB(g.toString())})),o+=":",o+=Wv(d).map((f=>{var[p,g]=f;return p+'="'+g+'"'})).join("")}));return n.join(";")})((function(t){return t.map((n=>{var r,a,i={text:(r=n.$el_text)==null?void 0:r.slice(0,400),tag_name:n.tag_name,href:(a=n.attr__href)==null?void 0:a.slice(0,2048),attr_class:Gce(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Wv(n).filter((o=>{var[l]=o;return l.indexOf("attr__")===0})).forEach((o=>{var[l,c]=o;return i.attributes[l]=c})),i}))})(e))}function BB(e){return e.replace(/"|\\"/g,'\\"')}function Gce(e){var t=e.attr__class;return t?Nt(t)?t:JN(t):void 0}class zB{constructor(t){this.disabled=t===!1;var n=Vn(t)?t:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(t,n,r){if(this.disabled)return!1;var a=this.clicks[this.clicks.length-1];if(a&&Math.abs(t-a.x)+Math.abs(n-a.y)<this.thresholdPx&&r-a.timestamp<this.timeoutMs){if(this.clicks.push({x:t,y:n,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:t,y:n,timestamp:r}];return!1}}var _S="$copy_autocapture",GB=pn("[AutoCapture]");function SS(e,t){return t.length>e?t.slice(0,e)+"...":t}function Hce(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!n0(t));return t}function qce(e,t,n,r){var a=e.tagName.toLowerCase(),i={tag_name:a};eO.indexOf(a)>-1&&!n&&(a.toLowerCase()==="a"||a.toLowerCase()==="button"?i.$el_text=SS(1024,dV(e)):i.$el_text=SS(1024,Zm(e)));var o=Oy(e);o.length>0&&(i.classes=o.filter((function(f){return f!==""}))),Kt(e.attributes,(function(f){var p;if((!lV(e)||["name","id","class","aria-label"].indexOf(f.name)!==-1)&&(r==null||!r.includes(f.name))&&!t&&bm(f.value)&&(p=f.name,!$n(p)||p.substring(0,10)!=="_ngcontent"&&p.substring(0,7)!=="_nghost")){var g=f.value;f.name==="class"&&(g=JN(g).join(" ")),i["attr__"+f.name]=SS(1024,g)}}));for(var l=1,c=1,d=e;d=Hce(d);)l++,d.tagName===e.tagName&&c++;return i.nth_child=l,i.nth_of_type=c,i}function Vce(e,t){for(var n,r,{e:a,maskAllElementAttributes:i,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,d=[e],f=e;f.parentNode&&!Vl(f,"body");)rV(f.parentNode)?(d.push(f.parentNode.host),f=f.parentNode.host):(d.push(f.parentNode),f=f.parentNode);var p,g=[],v={},x=!1,w=!1;if(Kt(d,(N=>{var C=Mk(N);N.tagName.toLowerCase()==="a"&&(x=N.getAttribute("href"),x=C&&x&&bm(x)&&x),ut(Oy(N),"ph-no-capture")&&(w=!0),g.push(qce(N,i,o,l));var O=(function(I){if(!Mk(I))return{};var D={};return Kt(I.attributes,(function(B){if(B.name&&B.name.indexOf("data-ph-capture-attribute")===0){var L=B.name.replace("data-ph-capture-attribute-",""),q=B.value;L&&q&&bm(q)&&(D[L]=q)}})),D})(N);Nn(v,O)})),w)return{props:{},explicitNoCapture:w};if(o||(e.tagName.toLowerCase()==="a"||e.tagName.toLowerCase()==="button"?g[0].$el_text=dV(e):g[0].$el_text=Zm(e)),x){var E,S;g[0].attr__href=x;var T=(E=_y(x))==null?void 0:E.host,k=ue==null||(S=ue.location)==null?void 0:S.host;T&&k&&T!==k&&(p=x)}return{props:Nn({$event_type:a.type,$ce_version:1},c?{}:{$elements:g},{$elements_chain:zce(g)},(n=g[0])!=null&&n.$el_text?{$el_text:(r=g[0])==null?void 0:r.$el_text}:{},p&&a.type==="click"?{$external_click_url:p}:{},v)}}var Ah=pn("[ExceptionAutocapture]");function HB(e,t,n){try{if(!(t in e))return()=>{};var r=e[t],a=n(r);return gs(a)&&(a.prototype=a.prototype||{},Object.defineProperties(a,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=a,()=>{e[t]=r}}catch{return()=>{}}}var Wce=pn("[TracingHeaders]"),El=pn("[Web Vitals]"),qB=9e5;pn("[SessionRecording]");var Lk="[SessionRecording]",Cd=pn(Lk),Yce=pn("[Heatmaps]");function VB(e){return Vn(e)&&"clientX"in e&&"clientY"in e&&ks(e.clientX)&&ks(e.clientY)}var WB=pn("[Product Tours]"),AS="ph_product_tours",Kce=["$set_once","$set"],_l=pn("[SiteApps]"),Xce={sessionRecording:class{get started(){var e;return!((e=this.mr)==null||!e.isStarted)}get status(){return this.mr?this.mr.status:this.br?this.yr?"lazy_loading":"disabled":"pending_config"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.br=!1,this.wr=!1,this.$r=void 0,this._instance=e,!this._instance.sessionManager)throw Cd.error("started without valid sessionManager"),new Error(Lk+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Lk+' cannot be used with cookieless_mode="always"')}get yr(){var e,t=!((e=this._instance.get_property(lv))==null||!e.enabled),n=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return ue&&t&&n&&!r}startIfEnabledOrStop(e){var t;if(this.br&&(!this.yr||(t=this.mr)==null||!t.isStarted)){var n=!Ae(Object.assign)&&!Ae(Array.from);this.yr&&n?(this.Er(e),Cd.info("starting")):this.stopRecording()}}Er(e){var t,n,r;this.yr&&(ze!=null&&(t=ze.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(n=ze.__PosthogExtensions__)!=null&&n.initSessionRecording?this.Sr(e):(r=ze.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.kr,(a=>{if(a)return Cd.error("could not load recorder",a);this.Sr(e)})))}stopRecording(){var e,t;(e=this.$r)==null||e.call(this),this.$r=void 0,(t=this.mr)==null||t.stop()}Pr(){var e;(e=this._instance.persistence)==null||e.unregister(D8)}Tr(e){if(this._instance.persistence){var t,n,r=this._instance.persistence,a=()=>{var i=e.sessionRecording===!1?void 0:e.sessionRecording,o=i==null?void 0:i.sampleRate,l=pt(o)?null:parseFloat(o);pt(l)&&this.Pr();var c=i==null?void 0:i.minimumDurationMilliseconds;r.register({[lv]:_e({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:_e({capturePerformance:e.capturePerformance},i==null?void 0:i.networkPayloadCapture),canvasRecording:{enabled:i==null?void 0:i.recordCanvas,fps:i==null?void 0:i.canvasFps,quality:i==null?void 0:i.canvasQuality},sampleRate:l,minimumDurationMilliseconds:Ae(c)?null:c,endpoint:i==null?void 0:i.endpoint,triggerMatchType:i==null?void 0:i.triggerMatchType,masking:i==null?void 0:i.masking,urlTriggers:i==null?void 0:i.urlTriggers})})};a(),(t=this.$r)==null||t.call(this),this.$r=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(a)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.wr=!1,this.Tr(e),this.br=!0,this.startIfEnabledOrStop()):this.br=!0:Cd.info("skipping remote config with no sessionRecording",e)}log(e,t){var n;t===void 0&&(t="log"),(n=this.mr)!=null&&n.log?this.mr.log(e,t):Cd.warn("log called before recorder was ready")}get kr(){var e,t,n=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(lv);return(n==null||(t=n.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Cr(){var e,t=this._instance.get_property(lv);if(!t)return!1;var n=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return Date.now()-n<=3e5}Sr(e){var t,n;if((t=ze.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.mr||(this.mr=(n=ze.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.mr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Cr()?this.mr.start(e):this.wr||(this.wr=!0,Cd.info("persisted remote config is stale, requesting fresh config before starting"),new J8(this._instance).load())}onRRwebEmit(e){var t;(t=this.mr)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.mr||(t=this._instance.persistence)==null||t.register({$replay_override_linked_flag:!0}),(e=this.mr)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.mr||(t=this._instance.persistence)==null||t.register({$replay_override_sampling:!0}),(e=this.mr)==null||e.overrideSampling()}overrideTrigger(e){var t,n;this.mr||(n=this._instance.persistence)==null||n.register({[e==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(t=this.mr)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.mr)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var n;return!((n=this.mr)==null||!n.tryAddCustomEvent(e,t))}}},Zce={autocapture:class{constructor(e){this.Ir=!1,this.Rr=null,this.Fr=!1,this.instance=e,this.rageclicks=new zB(e.config.rageclick),this.Or=null}get N(){var e,t,n=Vn(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(e=n.url_allowlist)==null?void 0:e.map((r=>new RegExp(r))),n.url_ignorelist=(t=n.url_ignorelist)==null?void 0:t.map((r=>new RegExp(r))),n}Mr(){if(this.isBrowserSupported()){if(ue&&Se){var e=n=>{n=n||(ue==null?void 0:ue.event);try{this.Ar(n)}catch(r){GB.error("Failed to capture event",r)}};if(jn(Se,"submit",e,{capture:!0}),jn(Se,"change",e,{capture:!0}),jn(Se,"click",e,{capture:!0}),this.N.capture_copied_text){var t=n=>{n=n||(ue==null?void 0:ue.event),this.Ar(n,_S)};jn(Se,"copy",t,{capture:!0}),jn(Se,"cut",t,{capture:!0})}}}else GB.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ir&&(this.Mr(),this.Ir=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Fr=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[sB]:!!e.autocapture_opt_out}),this.Rr=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Or=e}getElementSelectors(e){var t,n=[];return(t=this.Or)==null||t.forEach((r=>{var a=Se==null?void 0:Se.querySelectorAll(r);a==null||a.forEach((i=>{e===i&&n.push(r)}))})),n}get isEnabled(){var e,t,n=(e=this.instance.persistence)==null?void 0:e.props[sB],r=this.Rr;if(Hi(r)&&!Es(n)&&!this.instance.At())return!1;var a=(t=this.Rr)!==null&&t!==void 0?t:!!n;return!!this.instance.config.autocapture&&!a}Ar(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var n,r=FB(e);nV(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&Pce(r,this.instance.config.rageclick)&&this.Ar(e,"$rageclick");var a=t===_S;if(r&&jce(r,e,this.N,a,a?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:o}=Vce(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.Fr});if(o)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(i.$element_selectors=l),t===_S){var c,d=aV(ue==null||(c=ue.getSelection())==null?void 0:c.toString()),f=e.type||"clipboard";if(!d)return!1;i.$selected_content=d,i.$copy_type=f}return this.instance.capture(t,i),!0}}}isBrowserSupported(){return gs(Se==null?void 0:Se.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Dr=(ue==null||(t=ue.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(ke.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.jr&&this.jr(),this.jr=void 0,ke.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(ue&&ue.history){var n=this;(e=ue.history.pushState)!=null&&e.__posthog_wrapped__||HB(ue.history,"pushState",(r=>function(a,i,o){r.call(this,a,i,o),n.Lr("pushState")})),(t=ue.history.replaceState)!=null&&t.__posthog_wrapped__||HB(ue.history,"replaceState",(r=>function(a,i,o){r.call(this,a,i,o),n.Lr("replaceState")})),this.Nr()}}Lr(e){try{var t,n=ue==null||(t=ue.location)==null?void 0:t.pathname;if(!n)return;n!==this.Dr&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.Dr=n}catch(r){ke.error("Error capturing "+e+" pageview",r)}}Nr(){if(!this.jr){var e=()=>{this.Lr("popstate")};jn(ue,"popstate",e),this.jr=()=>{ue&&ue.removeEventListener("popstate",e)}}}},heatmaps:class{constructor(e){var t;this.Ur=!1,this.Ir=!1,this.zr=null,this.instance=e,this.Ur=!((t=this.instance.persistence)==null||!t.props[yk]),this.rageclicks=new zB(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return Vn(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 pt(this.instance.config.capture_heatmaps)?pt(this.instance.config.enable_heatmaps)?this.Ur:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Ir)return;Yce.info("starting..."),this.Hr(),this.qr()}else{var e;clearInterval((e=this.zr)!==null&&e!==void 0?e:void 0),this.Br(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[yk]:t}),this.Ur=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Wr(e){this.Gr(e.originalEvent,"deadclick")}qr(){this.zr&&clearInterval(this.zr),this.zr=(function(e){return(e==null?void 0:e.visibilityState)==="visible"})(Se)?setInterval(this.se.bind(this),this.flushIntervalMilliseconds):null}Hr(){ue&&Se&&(this.Vr=this.se.bind(this),jn(ue,"beforeunload",this.Vr),this.Jr=e=>this.Gr(e||(ue==null?void 0:ue.event)),jn(Se,"click",this.Jr,{capture:!0}),this.Kr=e=>this.Yr(e||(ue==null?void 0:ue.event)),jn(Se,"mousemove",this.Kr,{capture:!0}),this.Xr=new mB(this.instance,Lue,this.Wr.bind(this)),this.Xr.startIfEnabledOrStop(),this.Qr=this.qr.bind(this),jn(Se,"visibilitychange",this.Qr),this.Ir=!0)}Br(){var e;ue&&Se&&(this.Vr&&ue.removeEventListener("beforeunload",this.Vr),this.Jr&&Se.removeEventListener("click",this.Jr,{capture:!0}),this.Kr&&Se.removeEventListener("mousemove",this.Kr,{capture:!0}),this.Qr&&Se.removeEventListener("visibilitychange",this.Qr),clearTimeout(this.Zr),(e=this.Xr)==null||e.stop(),this.Ir=!1)}ts(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),a=this.instance.scrollManager.scrollElement(),i=(function(o,l,c){for(var d=o;d&&n0(d)&&!Vl(d,"body");){if(d===c)return!1;if(ut(l,ue==null?void 0:ue.getComputedStyle(d).position))return!0;d=oV(d)}return!1})(FB(e),["fixed","sticky"],a);return{x:e.clientX+(i?0:r),y:e.clientY+(i?0:n),target_fixed:i,type:t}}Gr(e,t){var n;if(t===void 0&&(t="click"),!PB(e.target)&&VB(e)){var r=this.ts(e,t);(n=this.rageclicks)!=null&&n.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.es(_e({},r,{type:"rageclick"})),this.es(r)}}Yr(e){!PB(e.target)&&VB(e)&&(clearTimeout(this.Zr),this.Zr=setTimeout((()=>{this.es(this.ts(e,"mousemove"))}),500))}es(e){if(ue){var t=ue.location.href,n=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,a=n?kf([],Of,r||[]):[],i=mm(t,a,gm);this.R=this.R||{},this.R[i]||(this.R[i]=[]),this.R[i].push(e)}}se(){this.R&&!Hd(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:mB,webVitalsAutocapture:class{constructor(e){var t;this.Ur=!1,this.Ir=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.rs=()=>{clearTimeout(this.ss),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce(((n,r)=>_e({},n,{["$web_vitals_"+r.name+"_event"]:_e({},r),["$web_vitals_"+r.name+"_value"]:r.value})),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ns=n=>{var r,a=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(Ae(a))El.error("Could not read session ID. Dropping metrics!");else{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.os();Ae(i)||(pt(n==null?void 0:n.name)||pt(n==null?void 0:n.value)?El.error("Invalid metric received",n):this.ls&&n.value>=this.ls?El.error("Ignoring metric with value >= "+this.ls,n):(this.R.url!==i&&(this.rs(),this.ss=setTimeout(this.rs,this.flushToCaptureTimeoutMs)),Ae(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Ae(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.R.metrics.push(_e({},n,{$current_url:i,$session_id:a.sessionId,$window_id:a.windowId,timestamp:Date.now()})),this.R.metrics.length===this.allowedMetrics.length&&this.rs()))}},this.us=()=>{if(!this.Ir){var n,r,a,i,o=ze.__PosthogExtensions__;Ae(o)||Ae(o.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:r,onFCP:a,onINP:i}=o.postHogWebVitalsCallbacks),n&&r&&a&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.ns.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.ns.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&a(this.ns.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ns.bind(this)),this.Ir=!0):El.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Ur=!((t=this._instance.persistence)==null||!t.props[cB]),this.startIfEnabled()}get allowedMetrics(){var e,t,n=Vn(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return pt(n)?((t=this._instance.persistence)==null?void 0:t.props[fB])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Vn(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Vn(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return e!=null&&e}get ls(){var e=Vn(this._instance.config.capture_performance)&&ks(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:qB;return 0<e&&e<=6e4?qB:e}get isEnabled(){var e=Sr==null?void 0:Sr.protocol;if(e!=="http:"&&e!=="https:")return El.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Vn(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Es(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Es(t)?t:this.Ur}startIfEnabled(){this.isEnabled&&!this.Ir&&(El.info("enabled, starting..."),this.V(this.us))}onRemoteConfig(e){if("capturePerformance"in e){var t=Vn(e.capturePerformance)&&!!e.capturePerformance.web_vitals,n=Vn(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[cB]:t}),this._instance.persistence.register({[fB]:n})),this.Ur=t,this.startIfEnabled()}}V(e){var t,n;if((t=ze.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks)e();else{var r=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=ze.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,r,(a=>{a?El.error("failed to load script",a):e()}))}}os(){var e=ue?ue.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,r=t?kf([],Of,n||[]):[];return mm(e,r,gm)}El.error("Could not determine current URL")}}},Qce={exceptionObserver:class{constructor(e){var t,n,r;this.us=()=>{var a;if(ue&&this.isEnabled&&(a=ze.__PosthogExtensions__)!=null&&a.errorWrappingFunctions){var i=ze.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=ze.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=ze.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.hs&&this.N.capture_unhandled_errors&&(this.hs=i(this.captureException.bind(this))),!this.ds&&this.N.capture_unhandled_rejections&&(this.ds=o(this.captureException.bind(this))),!this.vs&&this.N.capture_console_errors&&(this.vs=l(this.captureException.bind(this)))}catch(c){Ah.error("failed to start",c),this.cs()}}},this._instance=e,this.fs=!((t=this._instance.persistence)==null||!t.props[lB]),this.ps=new Gle({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,h:Ah}),this.N=this._s(),this.startIfEnabledOrStop()}_s(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Vn(e)?t=_e({},t,e):(Ae(e)?this.fs:e)&&(t=_e({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Ah.info("enabled"),this.cs(),this.V(this.us)):this.cs()}V(e){var t,n;(t=ze.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(n=ze.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",(r=>{if(r)return Ah.error("failed to load script",r);e()}))}cs(){var e,t,n;(e=this.hs)==null||e.call(this),this.hs=void 0,(t=this.ds)==null||t.call(this),this.ds=void 0,(n=this.vs)==null||n.call(this),this.vs=void 0}onRemoteConfig(e){if("autocaptureExceptions"in e){var t=e.autocaptureExceptions;this.fs=!!t||!1,this._instance.persistence&&this._instance.persistence.register({[lB]:this.fs}),this.N=this._s(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this._s()}captureException(e){var t,n,r=(t=e==null||(n=e.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&t!==void 0?t:"Exception";this.ps.consumeRateLimit(r)?Ah.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}}},Jce={productTours:class{constructor(e){this.gs=null,this.bs=null,this._instance=e}onRemoteConfig(e){"productTours"in e&&(this._instance.persistence&&this._instance.persistence.register({[dB]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.gs||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(dB)||this.V((()=>this.ys()))}V(e){var t,n;(t=ze.__PosthogExtensions__)!=null&&t.generateProductTours?e():(n=ze.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",(r=>{r?WB.error("Could not load product tours script",r):e()}))}ys(){var e;!this.gs&&(e=ze.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.gs=ze.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!Nt(this.bs)||t){var n=this._instance.persistence;if(n){var r=n.props[AS];if(Nt(r)&&!t)return this.bs=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:a=>{var i=a.statusCode;if(i!==200||!a.json){var o="Product Tours API could not be loaded, status: "+i;return WB.error(o),void e([],{isLoaded:!1,error:o})}var l=Nt(a.json.product_tours)?a.json.product_tours:[];this.bs=l,n&&n.register({[AS]:l}),e(l,{isLoaded:!0})}})}else e(this.bs,{isLoaded:!0})}getActiveProductTours(e){pt(this.gs)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.gs.getActiveProductTours(e)}showProductTour(e){var t;(t=this.gs)==null||t.showTourById(e)}previewTour(e){this.gs?this.gs.previewTour(e):this.V((()=>{var t;this.ys(),(t=this.gs)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.gs)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.gs)==null||e.nextStep()}previousStep(){var e;(e=this.gs)==null||e.previousStep()}clearCache(){var e;this.bs=null,(e=this._instance.persistence)==null||e.unregister(AS)}resetTour(e){var t;(t=this.gs)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.gs)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.gs)==null||t.cancelPendingTour(e)}}},ede={siteApps:class{constructor(e){this._instance=e,this.ws=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}xs(e,t){if(t){var n=this.globalsForEvent(t);this.ws.push(n),this.ws.length>1e3&&(this.ws=this.ws.slice(10))}}get siteAppLoaders(){var e;return(e=ze._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.xs.bind(this));this.$s=()=>{e(),this.ws=[],this.$s=void 0}}}globalsForEvent(e){var t,n,r,a,i,o,l;if(!e)throw new Error("Event payload is required");var c={},d=this._instance.get_property("$groups")||[],f=this._instance.get_property("$stored_group_properties")||{};for(var[p,g]of Object.entries(f))c[p]={id:d[p],type:p,properties:g};var{$set_once:v,$set:x}=e;return{event:_e({},o8(e,Kce),{properties:_e({},e.properties,x?{$set:_e({},(t=(n=e.properties)==null?void 0:n.$set)!==null&&t!==void 0?t:{},x)}:{},v?{$set_once:_e({},(r=(a=e.properties)==null?void 0:a.$set_once)!==null&&r!==void 0?r:{},v)}:{}),elements_chain:(i=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],n=()=>{var o;!t.errored&&this.ws.length&&(_l.info("Processing "+this.ws.length+" events for site app with id "+e.id),this.ws.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.$s)==null||o.call(this))},r=!1,a=o=>{t.errored=!o,t.loaded=!0,_l.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&n()};try{var{processEvent:i}=e.init({posthog:this._instance,callback:o=>{a(o)}});i&&(t.processEvent=i),r=!0}catch(o){_l.error("Error while initializing PostHog app with config id "+e.id,o),a(!1)}if(r&&t.loaded)try{n()}catch(o){_l.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}Es(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of e)this.setupSiteApp(n)}Ss(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(t)}catch(r){_l.error("Error while processing event "+e.event+" for site app "+n.id,r)}}}onRemoteConfig(e){var t,n,r,a=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Es(),void this._instance.on("eventCaptured",(c=>this.Ss(c)))):void _l.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.$s)==null||n.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var i=function(c){var d;ze["__$$ph_site_app_"+c]=a._instance,(d=ze.__PosthogExtensions__)==null||d.loadSiteApp==null||d.loadSiteApp(a._instance,l,(f=>{if(f)return _l.error("Error while initializing PostHog app with config id "+c,f)}))};for(var{id:o,url:l}of e.siteApps)i(o)}else _l.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},tde=_e({},Xce,Zce,Qce,Jce,ede,{tracingHeaders:class{constructor(e){this.ks=void 0,this.Ps=void 0,this.us=()=>{var t,n;Ae(this.ks)&&((t=ze.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),Ae(this.Ps)&&((n=ze.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}V(e){var t,n;(t=ze.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(n=ze.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",(r=>{if(r)return Wce.error("failed to load script",r);e()}))}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.V(this.us):((e=this.ks)==null||e.call(this),(t=this.Ps)==null||t.call(this),this.ks=void 0,this.Ps=void 0)}}});vs.__defaultExtensionClasses=_e({},tde);var YB,Cy=(YB=tm[Bd]=new vs,(function(){function e(){e.done||(e.done=!0,tV=!1,Kt(tm,(function(t){t._dom_loaded()})))}Se!=null&&Se.addEventListener?Se.readyState==="complete"?e():jn(Se,"DOMContentLoaded",e,{capture:!1}):ue&&ke.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),YB);const nde="phc_552ZSApq5xuagswylfdw2vx8nckm31jn6LCpTVyVn8j",rde="https://code-insights.app";let Ry=!1;async function ade(){if(!Ry)try{const e=await fetch("/api/telemetry/identity");if(!e.ok)return;const t=await e.json();if(!t.enabled)return;Cy.init(nde,{api_host:rde,ui_host:"https://us.i.posthog.com",autocapture:!1,capture_pageview:!1,capture_pageleave:!1,persistence:"memory",disable_session_recording:!0,ip:!1}),t.distinct_id&&Cy.identify(t.distinct_id),Ry=!0}catch{}}function ide(e){if(Ry)try{Cy.capture("$pageview",{$current_url:e})}catch{}}function ode(e,t){if(Ry)try{Cy.capture("dashboard_loaded",{page:e,load_time_ms:t})}catch{}}function KB(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function r0(...e){return t=>{let n=!1;const r=e.map(a=>{const i=KB(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():KB(e[a],null)}}}}function At(...e){return y.useCallback(r0(...e),e)}function pc(e){const t=sde(e),n=y.forwardRef((r,a)=>{const{children:i,...o}=r,l=y.Children.toArray(i),c=l.find(lde);if(c){const d=c.props.children,f=l.map(p=>p===c?y.Children.count(d)>1?y.Children.only(null):y.isValidElement(d)?d.props.children:null:p);return m.jsx(t,{...o,ref:a,children:y.isValidElement(d)?y.cloneElement(d,void 0,f):null})}return m.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var pV=pc("Slot");function sde(e){const t=y.forwardRef((n,r)=>{const{children:a,...i}=n;if(y.isValidElement(a)){const o=cde(a),l=ude(i,a.props);return a.type!==y.Fragment&&(l.ref=r?r0(r,o):o),y.cloneElement(a,l)}return y.Children.count(a)>1?y.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hV=Symbol("radix.slottable");function mV(e){const t=({children:n})=>m.jsx(m.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=hV,t}function lde(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hV}function ude(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function cde(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var dde=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Xe=dde.reduce((e,t)=>{const n=pc(`Primitive.${t}`),r=y.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function gV(e,t){e&&su.flushSync(()=>e.dispatchEvent(t))}var bV=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),fde="VisuallyHidden",vV=y.forwardRef((e,t)=>m.jsx(Xe.span,{...e,ref:t,style:{...bV,...e.style}}));vV.displayName=fde;var pde=vV;function hde(e,t){const n=y.createContext(t),r=i=>{const{children:o,...l}=i,c=y.useMemo(()=>l,Object.values(l));return m.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function a(i){const o=y.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function qi(e,t=[]){let n=[];function r(i,o){const l=y.createContext(o),c=n.length;n=[...n,o];const d=p=>{var S;const{scope:g,children:v,...x}=p,w=((S=g==null?void 0:g[e])==null?void 0:S[c])||l,E=y.useMemo(()=>x,Object.values(x));return m.jsx(w.Provider,{value:E,children:v})};d.displayName=i+"Provider";function f(p,g){var w;const v=((w=g==null?void 0:g[e])==null?void 0:w[c])||l,x=y.useContext(v);if(x)return x;if(o!==void 0)return o;throw new Error(`\`${p}\` must be used within \`${i}\``)}return[d,f]}const a=()=>{const i=n.map(o=>y.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,mde(a,...t)]}function mde(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((l,{useScope:c,scopeName:d})=>{const p=c(i)[`__scope${d}`];return{...l,...p}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function nO(e){const t=e+"CollectionProvider",[n,r]=qi(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=w=>{const{scope:E,children:S}=w,T=ye.useRef(null),k=ye.useRef(new Map).current;return m.jsx(a,{scope:E,itemMap:k,collectionRef:T,children:S})};o.displayName=t;const l=e+"CollectionSlot",c=pc(l),d=ye.forwardRef((w,E)=>{const{scope:S,children:T}=w,k=i(l,S),N=At(E,k.collectionRef);return m.jsx(c,{ref:N,children:T})});d.displayName=l;const f=e+"CollectionItemSlot",p="data-radix-collection-item",g=pc(f),v=ye.forwardRef((w,E)=>{const{scope:S,children:T,...k}=w,N=ye.useRef(null),C=At(E,N),O=i(f,S);return ye.useEffect(()=>(O.itemMap.set(N,{ref:N,...k}),()=>void O.itemMap.delete(N))),m.jsx(g,{[p]:"",ref:C,children:T})});v.displayName=f;function x(w){const E=i(e+"CollectionConsumer",w);return ye.useCallback(()=>{const T=E.collectionRef.current;if(!T)return[];const k=Array.from(T.querySelectorAll(`[${p}]`));return Array.from(E.itemMap.values()).sort((O,I)=>k.indexOf(O.ref.current)-k.indexOf(I.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:o,Slot:d,ItemSlot:v},x,r]}function Ie(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}var Tr=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},gde=_N[" useInsertionEffect ".trim().toString()]||Tr;function Kl({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=bde({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:a;{const f=y.useRef(e!==void 0);y.useEffect(()=>{const p=f.current;p!==l&&console.warn(`${r} is changing from ${p?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=l},[l,r])}const d=y.useCallback(f=>{var p;if(l){const g=vde(f)?f(e):f;g!==e&&((p=o.current)==null||p.call(o,g))}else i(f)},[l,e,i,o]);return[c,d]}function bde({defaultProp:e,onChange:t}){const[n,r]=y.useState(e),a=y.useRef(n),i=y.useRef(t);return gde(()=>{i.current=t},[t]),y.useEffect(()=>{var o;a.current!==n&&((o=i.current)==null||o.call(i,n),a.current=n)},[n,a]),[n,r,i]}function vde(e){return typeof e=="function"}function yde(e,t){return y.useReducer((n,r)=>t[n][r]??n,e)}var wi=e=>{const{present:t,children:n}=e,r=xde(t),a=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=At(r.ref,wde(a));return typeof n=="function"||r.isPresent?y.cloneElement(a,{ref:i}):null};wi.displayName="Presence";function xde(e){const[t,n]=y.useState(),r=y.useRef(null),a=y.useRef(e),i=y.useRef("none"),o=e?"mounted":"unmounted",[l,c]=yde(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const d=pv(r.current);i.current=l==="mounted"?d:"none"},[l]),Tr(()=>{const d=r.current,f=a.current;if(f!==e){const g=i.current,v=pv(d);e?c("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?c("UNMOUNT"):c(f&&g!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),Tr(()=>{if(t){let d;const f=t.ownerDocument.defaultView??window,p=v=>{const w=pv(r.current).includes(CSS.escape(v.animationName));if(v.target===t&&w&&(c("ANIMATION_END"),!a.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",d=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},g=v=>{v.target===t&&(i.current=pv(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{f.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(d=>{r.current=d?getComputedStyle(d):null,n(d)},[])}}function pv(e){return(e==null?void 0:e.animationName)||"none"}function wde(e){var r,a;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ede=_N[" useId ".trim().toString()]||(()=>{}),_de=0;function pi(e){const[t,n]=y.useState(Ede());return Tr(()=>{n(r=>r??String(_de++))},[e]),e||(t?`radix-${t}`:"")}var a0="Collapsible",[Sde]=qi(a0),[Ade,rO]=Sde(a0),yV=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...l}=e,[c,d]=Kl({prop:r,defaultProp:a??!1,onChange:o,caller:a0});return m.jsx(Ade,{scope:n,disabled:i,contentId:pi(),open:c,onOpenToggle:y.useCallback(()=>d(f=>!f),[d]),children:m.jsx(Xe.div,{"data-state":iO(c),"data-disabled":i?"":void 0,...l,ref:t})})});yV.displayName=a0;var xV="CollapsibleTrigger",wV=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=rO(xV,n);return m.jsx(Xe.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":iO(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Ie(e.onClick,a.onOpenToggle)})});wV.displayName=xV;var aO="CollapsibleContent",EV=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=rO(aO,e.__scopeCollapsible);return m.jsx(wi,{present:n||a.open,children:({present:i})=>m.jsx(Tde,{...r,ref:t,present:i})})});EV.displayName=aO;var Tde=y.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=rO(aO,n),[l,c]=y.useState(r),d=y.useRef(null),f=At(t,d),p=y.useRef(0),g=p.current,v=y.useRef(0),x=v.current,w=o.open||l,E=y.useRef(w),S=y.useRef(void 0);return y.useEffect(()=>{const T=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(T)},[]),Tr(()=>{const T=d.current;if(T){S.current=S.current||{transitionDuration:T.style.transitionDuration,animationName:T.style.animationName},T.style.transitionDuration="0s",T.style.animationName="none";const k=T.getBoundingClientRect();p.current=k.height,v.current=k.width,E.current||(T.style.transitionDuration=S.current.transitionDuration,T.style.animationName=S.current.animationName),c(r)}},[o.open,r]),m.jsx(Xe.div,{"data-state":iO(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!w,...i,ref:f,style:{"--radix-collapsible-content-height":g?`${g}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:w&&a})});function iO(e){return e?"open":"closed"}var kde=yV,Nde=y.createContext(void 0);function i0(e){const t=y.useContext(Nde);return e||t||"ltr"}function Ao(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Ode(e,t=globalThis==null?void 0:globalThis.document){const n=Ao(e);y.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Cde="DismissableLayer",Pk="dismissableLayer.update",Rde="dismissableLayer.pointerDownOutside",Ide="dismissableLayer.focusOutside",XB,_V=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Qm=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,d=y.useContext(_V),[f,p]=y.useState(null),g=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=y.useState({}),x=At(t,I=>p(I)),w=Array.from(d.layers),[E]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=w.indexOf(E),T=f?w.indexOf(f):-1,k=d.layersWithOutsidePointerEventsDisabled.size>0,N=T>=S,C=Lde(I=>{const D=I.target,B=[...d.branches].some(L=>L.contains(D));!N||B||(a==null||a(I),o==null||o(I),I.defaultPrevented||l==null||l())},g),O=Pde(I=>{const D=I.target;[...d.branches].some(L=>L.contains(D))||(i==null||i(I),o==null||o(I),I.defaultPrevented||l==null||l())},g);return Ode(I=>{T===d.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&l&&(I.preventDefault(),l()))},g),y.useEffect(()=>{if(f)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(XB=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),ZB(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=XB)}},[f,g,n,d]),y.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),ZB())},[f,d]),y.useEffect(()=>{const I=()=>v({});return document.addEventListener(Pk,I),()=>document.removeEventListener(Pk,I)},[]),m.jsx(Xe.div,{...c,ref:x,style:{pointerEvents:k?N?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,C.onPointerDownCapture)})});Qm.displayName=Cde;var Dde="DismissableLayerBranch",Mde=y.forwardRef((e,t)=>{const n=y.useContext(_V),r=y.useRef(null),a=At(t,r);return y.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),m.jsx(Xe.div,{...e,ref:a})});Mde.displayName=Dde;function Lde(e,t=globalThis==null?void 0:globalThis.document){const n=Ao(e),r=y.useRef(!1),a=y.useRef(()=>{});return y.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){SV(Rde,n,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Pde(e,t=globalThis==null?void 0:globalThis.document){const n=Ao(e),r=y.useRef(!1);return y.useEffect(()=>{const a=i=>{i.target&&!r.current&&SV(Ide,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ZB(){const e=new CustomEvent(Pk);document.dispatchEvent(e)}function SV(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?gV(a,i):a.dispatchEvent(i)}var TS="focusScope.autoFocusOnMount",kS="focusScope.autoFocusOnUnmount",QB={bubbles:!1,cancelable:!0},jde="FocusScope",o0=y.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=y.useState(null),d=Ao(a),f=Ao(i),p=y.useRef(null),g=At(t,w=>c(w)),v=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(r){let w=function(k){if(v.paused||!l)return;const N=k.target;l.contains(N)?p.current=N:kl(p.current,{select:!0})},E=function(k){if(v.paused||!l)return;const N=k.relatedTarget;N!==null&&(l.contains(N)||kl(p.current,{select:!0}))},S=function(k){if(document.activeElement===document.body)for(const C of k)C.removedNodes.length>0&&kl(l)};document.addEventListener("focusin",w),document.addEventListener("focusout",E);const T=new MutationObserver(S);return l&&T.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",E),T.disconnect()}}},[r,l,v.paused]),y.useEffect(()=>{if(l){ez.add(v);const w=document.activeElement;if(!l.contains(w)){const S=new CustomEvent(TS,QB);l.addEventListener(TS,d),l.dispatchEvent(S),S.defaultPrevented||(Fde(Gde(AV(l)),{select:!0}),document.activeElement===w&&kl(l))}return()=>{l.removeEventListener(TS,d),setTimeout(()=>{const S=new CustomEvent(kS,QB);l.addEventListener(kS,f),l.dispatchEvent(S),S.defaultPrevented||kl(w??document.body,{select:!0}),l.removeEventListener(kS,f),ez.remove(v)},0)}}},[l,d,f,v]);const x=y.useCallback(w=>{if(!n&&!r||v.paused)return;const E=w.key==="Tab"&&!w.altKey&&!w.ctrlKey&&!w.metaKey,S=document.activeElement;if(E&&S){const T=w.currentTarget,[k,N]=$de(T);k&&N?!w.shiftKey&&S===N?(w.preventDefault(),n&&kl(k,{select:!0})):w.shiftKey&&S===k&&(w.preventDefault(),n&&kl(N,{select:!0})):S===T&&w.preventDefault()}},[n,r,v.paused]);return m.jsx(Xe.div,{tabIndex:-1,...o,ref:g,onKeyDown:x})});o0.displayName=jde;function Fde(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(kl(r,{select:t}),document.activeElement!==n)return}function $de(e){const t=AV(e),n=JB(t,e),r=JB(t.reverse(),e);return[n,r]}function AV(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function JB(e,t){for(const n of e)if(!Ude(n,{upTo:t}))return n}function Ude(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Bde(e){return e instanceof HTMLInputElement&&"select"in e}function kl(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Bde(e)&&t&&e.select()}}var ez=zde();function zde(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=tz(e,t),e.unshift(t)},remove(t){var n;e=tz(e,t),(n=e[0])==null||n.resume()}}}function tz(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Gde(e){return e.filter(t=>t.tagName!=="A")}var Hde="Portal",Jm=y.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,i]=y.useState(!1);Tr(()=>i(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?$q.createPortal(m.jsx(Xe.div,{...r,ref:t}),o):null});Jm.displayName=Hde;var NS=0;function oO(){y.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??nz()),document.body.insertAdjacentElement("beforeend",e[1]??nz()),NS++,()=>{NS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),NS--}},[])}function nz(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var bo=function(){return bo=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},bo.apply(this,arguments)};function TV(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function qde(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Kv="right-scroll-bar-position",Xv="width-before-scroll-bar",Vde="with-scroll-bars-hidden",Wde="--removed-body-scroll-bar-size";function OS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Yde(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var Kde=typeof window<"u"?y.useLayoutEffect:y.useEffect,rz=new WeakMap;function Xde(e,t){var n=Yde(null,function(r){return e.forEach(function(a){return OS(a,r)})});return Kde(function(){var r=rz.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(l){i.has(l)||OS(l,null)}),i.forEach(function(l){a.has(l)||OS(l,o)})}rz.set(n,e)},[e]),n}function Zde(e){return e}function Qde(e,t){t===void 0&&(t=Zde);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var f=o;o=[],f.forEach(i)},d=function(){return Promise.resolve().then(c)};d(),n={push:function(f){o.push(f),d()},filter:function(f){return o=o.filter(f),n}}}};return a}function Jde(e){e===void 0&&(e={});var t=Qde(null);return t.options=bo({async:!0,ssr:!1},e),t}var kV=function(e){var t=e.sideCar,n=TV(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,bo({},n))};kV.isSideCarExport=!0;function efe(e,t){return e.useMedium(t),kV}var NV=Jde(),CS=function(){},s0=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:CS,onWheelCapture:CS,onTouchMoveCapture:CS}),a=r[0],i=r[1],o=e.forwardProps,l=e.children,c=e.className,d=e.removeScrollBar,f=e.enabled,p=e.shards,g=e.sideCar,v=e.noRelative,x=e.noIsolation,w=e.inert,E=e.allowPinchZoom,S=e.as,T=S===void 0?"div":S,k=e.gapMode,N=TV(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=g,O=Xde([n,t]),I=bo(bo({},N),a);return y.createElement(y.Fragment,null,f&&y.createElement(C,{sideCar:NV,removeScrollBar:d,shards:p,noRelative:v,noIsolation:x,inert:w,setCallbacks:i,allowPinchZoom:!!E,lockRef:n,gapMode:k}),o?y.cloneElement(y.Children.only(l),bo(bo({},I),{ref:O})):y.createElement(T,bo({},I,{className:c,ref:O}),l))});s0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};s0.classNames={fullWidth:Xv,zeroRight:Kv};var tfe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function nfe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=tfe();return t&&e.setAttribute("nonce",t),e}function rfe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function afe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var ife=function(){var e=0,t=null;return{add:function(n){e==0&&(t=nfe())&&(rfe(t,n),afe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},ofe=function(){var e=ife();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},OV=function(){var e=ofe(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},sfe={left:0,top:0,right:0,gap:0},RS=function(e){return parseInt(e||"",10)||0},lfe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[RS(n),RS(r),RS(a)]},ufe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return sfe;var t=lfe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},cfe=OV(),Qd="data-scroll-locked",dfe=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
65
65
  .`.concat(Vde,` {
66
66
  overflow: hidden `).concat(r,`;
67
67
  padding-right: `).concat(l,"px ").concat(r,`;
@@ -24,7 +24,7 @@
24
24
  document.documentElement.classList.add(resolved);
25
25
  })();
26
26
  </script>
27
- <script type="module" crossorigin src="/assets/index-C1mDRV7y.js"></script>
27
+ <script type="module" crossorigin src="/assets/index-BaKju1iW.js"></script>
28
28
  <link rel="stylesheet" crossorigin href="/assets/index-_SWpRg6C.css">
29
29
  </head>
30
30
  <body>
@@ -8,7 +8,7 @@ import { loadConfig, getConfigDir } from './config.js';
8
8
  // PostHog write-only API key (public — this is the standard PostHog pattern;
9
9
  // write-only keys can only ingest events, not read data).
10
10
  const POSTHOG_API_KEY = 'phc_552ZSApq5xuagswylfdw2vx8nckm31jn6LCpTVyVn8j';
11
- const POSTHOG_HOST = 'https://us.i.posthog.com';
11
+ const POSTHOG_HOST = 'https://code-insights.app';
12
12
  // Touch file path that tracks whether the disclosure has been shown.
13
13
  // Content is the CLI version — if version doesn't match current, notice is re-shown.
14
14
  const NOTICE_FILE = path.join(getConfigDir(), '.telemetry-notice-shown');
@@ -1 +1 @@
1
- {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/utils/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEvD,6EAA6E;AAC7E,0DAA0D;AAC1D,MAAM,eAAe,GAAG,iDAAiD,CAAC;AAC1E,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAEhD,qEAAqE;AACrE,qFAAqF;AACrF,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,yBAAyB,CAAC,CAAC;AAoBzE,gEAAgE;AAChE,+DAA+D;AAC/D,IAAI,MAAM,GAAmB,IAAI,CAAC;AAElC;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,OAAO,CAAC,GAAG,CAAC,gCAAgC,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IACvE,IAAI,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IAEnD,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAC7D,OAAO,MAAM,CAAC,SAAS,CAAC;IAC1B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AACH,SAAS,gBAAgB;IACvB,IAAI,CAAC,kBAAkB,EAAE;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,GAAG,IAAI,OAAO,CAAC,eAAe,EAAE;YACpC,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,CAAC;YACV,aAAa,EAAE,CAAC;SACjB,CAAC,CAAC;IACL,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;QACxB,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,2BAA2B;IACzC,IAAI,CAAC,kBAAkB,EAAE;QAAE,OAAO,KAAK,CAAC;IAExC,MAAM,cAAc,GAAG,aAAa,EAAE,CAAC;IACvC,IAAI,YAAY,GAAkB,IAAI,CAAC;IAEvC,IAAI,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QAC/B,IAAI,CAAC;YACH,YAAY,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9D,CAAC;QAAC,MAAM,CAAC;YACP,kCAAkC;QACpC,CAAC;IACH,CAAC;IAED,IAAI,YAAY,KAAK,cAAc;QAAE,OAAO,KAAK,CAAC;IAElD,qCAAqC;IACrC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,iFAAiF,CAAC,CAAC;IAC/F,OAAO,CAAC,GAAG,CAAC,mFAAmF,CAAC,CAAC;IACjG,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,2FAA2F,CAAC,CAAC;IACzG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,4CAA4C,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;IACzD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,gEAAgE;IAChE,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;QACjC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC9B,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5D,CAAC;QACD,EAAE,CAAC,aAAa,CAAC,WAAW,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IACpF,CAAC;IAAC,MAAM,CAAC;QACP,uEAAuE;IACzE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;YAChC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAC/D,CAAC;QACD,8BAA8B;QAC9B,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;YACjC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,aAAa,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAC1E,CAAC;QACD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;IACnE,CAAC;IACD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACjE,CAAC;AAED;;;GAGG;AACH,SAAS,gBAAgB,CAAC,KAAa;IAOrC,MAAM,YAAY,GAAG,2CAA2C,CAAC;IACjE,MAAM,MAAM,GAMP,EAAE,CAAC;IAER,IAAI,KAAK,CAAC;IACV,OAAO,CAAC,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACnD,MAAM,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QACpD,MAAM,CAAC,IAAI,CAAC;YACV,QAAQ;YACR,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YAC9B,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;YAC7B,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,aAAa;YACnC,MAAM,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;SAC5E,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc,EAAE,UAAoC;IAC/E,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE;QAAE,OAAO;IAEhB,IAAI,CAAC;QACH,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;QAC3D,MAAM,aAAa,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC;QACnF,MAAM,KAAK,GAAG,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACvE,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAEpD,EAAE,CAAC,OAAO,CAAC;YACT,UAAU,EAAE,kBAAkB,EAAE;YAChC,KAAK,EAAE,YAAY;YACnB,UAAU,EAAE;gBACV,kBAAkB,EAAE,aAAa;gBACjC,eAAe,EAAE,aAAa;gBAC9B,0BAA0B,EAAE,KAAK;gBACjC,eAAe,EAAE;oBACf;wBACE,IAAI,EAAE,aAAa;wBACnB,KAAK,EAAE,aAAa;wBACpB,SAAS,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE;wBAC7C,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;qBACzD;iBACF;gBACD,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC;aACtB;SACF,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,qDAAqD;IACvD,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAyB,EAAE,UAAoC;IACxF,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE;QAAE,OAAO;IAEhB,IAAI,CAAC;QACH,EAAE,CAAC,OAAO,CAAC;YACT,UAAU,EAAE,kBAAkB,EAAE;YAChC,KAAK;YACL,UAAU,EAAE,UAAU,IAAI,EAAE;SAC7B,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,qDAAqD;IACvD,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC9B,IAAI,CAAC,EAAE;QAAE,OAAO;IAEhB,IAAI,CAAC;QACH,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,MAAM,CAAC,iBAAiB,CAAC,CAAC;QAClD,MAAM,EAAE,GAAG,KAAK,EAAE,CAAC;QACnB,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC,wCAAwC,CAAC,CAAC,GAAG,EAAuB,CAAC;QAE5F,EAAE,CAAC,QAAQ,CAAC;YACV,UAAU,EAAE,kBAAkB,EAAE;YAChC,UAAU,EAAE;gBACV,WAAW,EAAE,aAAa,EAAE;gBAC5B,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;gBAC9C,EAAE,EAAE,OAAO,CAAC,QAAQ;gBACpB,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,mBAAmB,EAAE,eAAe,EAAE;gBACtC,QAAQ,EAAE,UAAU,EAAE;gBACtB,cAAc,EAAE,GAAG,CAAC,KAAK;aAC1B;SACF,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,6DAA6D;IAC/D,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO;QACL,WAAW,EAAE,kBAAkB,EAAE;QACjC,WAAW,EAAE,aAAa,EAAE;QAC5B,YAAY,EAAE,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC;QAC9C,EAAE,EAAE,OAAO,CAAC,QAAQ;QACpB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,mBAAmB,EAAE,eAAe,EAAE;QACtC,QAAQ,EAAE,UAAU,EAAE;QACtB,cAAc,EAAE,uCAAuC;QACvD,YAAY,EAAE;YACZ,KAAK,EAAE,UAAU;YACjB,UAAU,EAAE;gBACV,WAAW,EAAE,IAAI;gBACjB,eAAe,EAAE,CAAC;gBAClB,oBAAoB,EAAE,EAAE,aAAa,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;gBACrD,MAAM,EAAE,CAAC;gBACT,aAAa,EAAE,IAAI;gBACnB,OAAO,EAAE,IAAI;aACd;SACF;KACF,CAAC;AACJ,CAAC;AAED,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,QAAgB,CAAC;IACrB,IAAI,CAAC;QACH,QAAQ,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,sEAAsE;QACtE,QAAQ,GAAG,OAAO,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,SAAS,EAAE,CAAC;IACtD,CAAC;IAED,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACnE,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9E,CAAC;AAED;;GAEG;AACH,SAAS,aAAa;IACpB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,oBAAoB,CAAwB,CAAC;QACjE,OAAO,GAAG,CAAC,OAAO,CAAC;IACrB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,eAAe;IACtB,MAAM,IAAI,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC;IAC1B,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;QAC1D,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;IAED,MAAM,kBAAkB,GAAG;QACzB,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,CAAC;QACvF,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,CAAC;QAChE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,kBAAkB,CAAC;KAC5E,CAAC;IACF,IAAI,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC1B,CAAC;IAED,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC;QACzD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC;QAChE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;GAEG;AACH,SAAS,UAAU;IACjB,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;QACzE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/C,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACvD,OAAO,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/utils/telemetry.ts"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-insights/cli",
3
- "version": "3.6.0",
3
+ "version": "3.6.1",
4
4
  "description": "Turn your AI coding sessions into knowledge",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",