PageSourceSearch

https://next.talentsourcer.ai/assets/root-DxZBze9W.js

js talentsourcer.ai collected 2026-10-05 12:43:31 UTC 260,607 bytes, 113 lines download raw bytes

1import{h as de}from"./chunk-JPUPSTYD-BMV5Lr5Q.js";import{R as te,d as qe,a as Fs,r as S,j as c,C as jn,e as uo,L as Re,c as ho,D as ri,u as po,w as fo,G as go,M as vo,H as _o,S as mo,I as yo,O as si,i as bo}from"./chunk-LFPYN7LY-qhUjRrWc.js";import{C as xo,u as wo,a as ko}from"./useStoreOrganizationEffect-Cf2IJEkg.js";import{u as Eo,c as Ds,O as So}from"./useOrganization-AoCpsmMH.js";import{e as In,a as M,b as tr,c as _e,i as jo}from"./api-CLD_RSuE.js";import{u as Cn,T as Io,a as Co}from"./theme-toggle-BitdaQhz.js";import{S as Nn,c as No}from"./index-DtqZ0xBd.js";import{u as Po,P as To}from"./ProjectDialog-DPB3z1gS.js";import{c as ae}from"./utils-BQHNewu7.js";import{S as Oo,a as $o,b as Ro,c as Mo,d as Ao}from"./sheet-BNoP9-O9.js";import{a as Pn,b as Fo,c as Tn,T as On}from"./tooltip-FImxaVys.js";import{l as lt}from"./tsai_logo-J75Pi5zU.js";import{C as ii,a as ni,b as ai}from"./collapsible-BGDSv2YI.js";import{B as he}from"./button-C_D5ONMG.js";import{C as Do,a as Lo,b as Uo,c as qo,d as Bo,e as oi}from"./command-CGfdvsrL.js";import{P as $n,a as Rn,b as Mn}from"./popover-BCtB7e9M.js";import{c as pe}from"./createLucideIcon-CvQSlB6W.js";import{C as zo}from"./chevrons-up-down-C0uEpO1x.js";import{C as An}from"./check-cbsm8piJ.js";import{S as Fn}from"./square-user-B7HhBYSg.js";import{S as Ho}from"./settings-D3TM-Cb3.js";import{B as Wo,S as Vo}from"./shield-Li-zZ4e9.js";import{S as Dn}from"./shield-check-CsIrpFFm.js";import{C as Go}from"./circle-question-mark-Bh--C4ee.js";import{M as Ln}from"./message-square-CdZSPOWp.js";import{C as li}from"./chevron-down-DccG3_7W.js";import{c as ci,d as Ko,e as Xo,f as Yo,g as Jo}from"./index-C9yFp5tV.js";import{I as Zo}from"./inbox-Dz5V0nn0.js";import{M as Qo}from"./mail-BjiUZP6O.js";import{S as el}from"./search-BLlFQOzt.js";import{W as tl}from"./workflow-DKlIV2tb.js";import{P as rl}from"./progress-tHy268bv.js";import{u as sl,P as il}from"./PrivacyModeContext-CsmS-vox.js";import{B as nl}from"./badge-DOjzbgvD.js";import{D as al,a as ol,b as ll}from"./dropdown-menu-CMAmg8TA.js";import{a as cl,b as ul,d as dl,f as hl,A as Ls}from"./formatDistanceToNow-BRWiIIZu.js";import{M as pl}from"./message-circle-B-BltAl5.js";import{D as fl}from"./download-DXTmuVCp.js";import{S as gl}from"./scroll-area-BBf3jj9b.js";import{I as ui}from"./info-CpqmRjoR.js";import{h as vl,e as Kt,c as di,g as _l,f as ml,k as yl,j as bl,r as xl}from"./compare-Br3z3FUS-Dk7MrLLM.js";import{T as wl}from"./index-BWdw7lx2.js";import{a as kl,c as El}from"./index-0KST_N1X.js";import{u as Un}from"./chunk-3EQWAEPK-Dwc3hNMr.js";import{L as hi}from"./loader-circle-CVlCIGQP.js";import"./dialog-Bl7_VgKs.js";import"./index-BhKvc09d.js";import"./index-CkXDuJs-.js";import"./index-CGrM6t6A.js";import"./index-CZoNgRFX.js";import"./index-CXXVrCEh.js";import"./index-PN7CyXvm.js";import"./index-JlQf2kOu.js";import"./input-DSTl9sgJ.js";import"./textarea-RtukEeJw.js";import"./select-Cgx2hQGY.js";import"./index-CCFLEcMg.js";import"./index-B_x71Ey8.js";import"./chevron-up-CpxD2IYU.js";import"./index-Bw8_Wl4K.js";import"./index-DNtiVxQp.js";import"./index-BFlwwBm8.js";import"./normalizeDates-DV3QDHkL.js";import"./en-US-BLy6J_Ky.js";import"./endOfDay-QVeLo2ki.js";var Be=t=>`🔒 Clerk: ${t.trim()}
2
3For more info, check out the docs: https://clerk.com/docs,
4or come say hi in our discord server: https://clerk.com/discord
5`,qn=`Use 'rootAuthLoader' as your root loader. Then, add <ClerkProvider> to your app.
6Example:
7
8import { rootAuthLoader } from '@clerk/react-router/ssr.server'
9import { ClerkProvider } from '@clerk/react-router'
10
11export async function loader(args: Route.LoaderArgs) {
12  return rootAuthLoader(args)
13}
14
15export default function App({ loaderData }: Route.ComponentProps) {
16  return (
17    <ClerkProvider loaderData={loaderData}>
18      <Outlet />
19    </ClerkProvider>
20  )
21}
22`,Sl=Be(`
23You're trying to pass an invalid object in "<ClerkProvider clerkState={...}>".
24
25${qn}
26`),Bn=Be(`
27Looks like you didn't pass 'clerkState' to "<ClerkProvider clerkState={...}>".
28
29${qn}
30`);Be(`
31You're calling 'getAuth()' from a loader, without providing the loader args object.
32Example:
33
34export async function loader(args: Route.LoaderArgs) {
35  const { userId } = await getAuth(args)
36
37  // Your code here
38}
39`);Be(`
40You're returning an invalid response from the 'rootAuthLoader' inside root.tsx.
41You can only return plain objects, Responses created using the React Router 'data()'helper or
42custom redirect 'Response' instances (status codes in the range of 300 to 400).
43If you want to return a primitive value or an array, you can always wrap the response with an object.
44
45Example:
46
47export async function loader(args: Route.LoaderArgs) {
48  return rootAuthLoader(args, async ({ auth }) => {
49    const { userId } = auth;
50    const posts = await database.getPostsByUserId(userId);
51
52    return { data: posts }
53    // Or
54    return data(posts, {
55      headers: {
56        'Content-Type': 'application/json'
57      }
58    })
59  })
60}
61`);Be(`
62A secretKey must be provided in order to use SSR and the exports from @clerk/react-router/api.');
63If your runtime supports environment variables, you can add a CLERK_SECRET_KEY variable to your config.
64Otherwise, you can pass a secretKey parameter to rootAuthLoader or getAuth.
65`);Be("Missing domain and proxyUrl. A satellite application needs to specify a domain or a proxyUrl");Be(`
66Invalid signInUrl. A satellite application requires a signInUrl for development instances.
67Check if signInUrl is missing from your configuration or if it is not an absolute URL.`);var jl=Be(`
68You're trying to use Clerk in React Router SPA Mode without providing a Publishable Key.
69Please provide the publishableKey prop on the <ClerkProvider> component.
70
71Example:
72
73<ClerkProvider publishableKey={PUBLISHABLE_KEY}>
74`),Il=`To use the new middleware system, you need to:
75
761. Enable the 'v8_middleware' future flag in your config:
77
78// react-router.config.ts
79export default {
80  future: {
81    v8_middleware: true,
82  },
83} satisfies Config;
84
852. Install the clerkMiddleware:
86
87import { clerkMiddleware, rootAuthLoader } from '@clerk/react-router/server'
88import { ClerkProvider } from '@clerk/react-router'
89
90export const middleware: Route.MiddlewareFunction[] = [clerkMiddleware()]
91
92export const loader = (args: Route.LoaderArgs) => rootAuthLoader(args)
93
94export default function App({ loaderData }: Route.ComponentProps) {
95  return (
96    <ClerkProvider loaderData={loaderData}>
97      <Outlet />
98    </ClerkProvider>
99  )
100}
101`;Be(`
102'"clerkMiddleware()" not detected.
103
104${Il}
105`);function Cl(t){(!t||!t.__internal_clerk_state)&&console.warn(Bn)}function Nl(t){if(!t)throw new Error(Bn);if(t&&!t.__internal_clerk_state)throw new Error(Sl)}function Pl(t){if(!t||typeof t!="string")throw new Error(jl)}var zn=()=>{var t;if(typeof window<"u"&&typeof((t=window.__reactRouterContext)==null?void 0:t.isSpaMode)<"u")return window.__reactRouterContext.isSpaMode},Hn=te.createContext(void 0);Hn.displayName="ClerkReactRouterOptionsCtx";var Tl=t=>{const{children:e,options:r}=t;return te.createElement(Hn.Provider,{value:{value:r}},e)},Ol=()=>{const t=qe(),e=Fs(),r=te.useRef([]),s=()=>{r.current.forEach(i=>i()),r.current.splice(0,r.current.length)};return te.useEffect(()=>{s()},[e]),(i,n)=>new Promise(a=>{r.current.push(a),t(i,n)})},$l={name:"@clerk/react-router",version:"2.4.11"},It={current:void 0};function Rl({children:t,...e}){const r=Ol(),s=zn();te.useEffect(()=>{It.current=r},[r]);const{clerkState:i,...n}=e;ci.displayName="ReactClerkProvider",typeof s<"u"&&!s&&Nl(i);const{__clerk_ssr_state:a,__publishableKey:o,__proxyUrl:l,__domain:d,__isSatellite:u,__clerk_debug:h,__signInUrl:f,__signUpUrl:g,__afterSignInUrl:p,__afterSignUpUrl:_,__signInForceRedirectUrl:k,__signUpForceRedirectUrl:m,__signInFallbackRedirectUrl:E,__signUpFallbackRedirectUrl:P,__clerkJSUrl:N,__clerkJSVersion:$,__telemetryDisabled:D,__telemetryDebug:I}=i?.__internal_clerk_state||{};te.useEffect(()=>{typeof s<"u"&&!s&&Cl(i)},[]),te.useEffect(()=>{window.__clerk_debug=h},[]);const T={publishableKey:o,proxyUrl:l,domain:d,isSatellite:u,signInUrl:f,signUpUrl:g,afterSignInUrl:p,afterSignUpUrl:_,signInForceRedirectUrl:k,signUpForceRedirectUrl:m,signInFallbackRedirectUrl:E,signUpFallbackRedirectUrl:P,clerkJSUrl:N,clerkJSVersion:$,telemetry:{disabled:D,debug:I}};return te.createElement(Tl,{options:T},te.createElement(ci,{routerPush:U=>{var W;return(W=It.current)==null?void 0:W.call(It,U)},routerReplace:U=>{var W;return(W=It.current)==null?void 0:W.call(It,U,{replace:!0})},initialState:a,sdkMetadata:$l,...T,...n},t))}var Ml=({children:t,loaderData:e,...r})=>{let s;const i=zn();return!i&&e?.clerkState&&(s=e.clerkState),typeof i<"u"&&i&&Pl(r.publishableKey),te.createElement(Rl,{...r,clerkState:s},t)};function Al({children:t,client:e,useAuth:r}){const s=Fl(r);return te.createElement(xo,{client:e,useAuth:s},t)}function Fl(t){return S.useMemo(()=>function(){const{isLoaded:r,isSignedIn:s,getToken:i,orgId:n,orgRole:a,sessionClaims:o}=t(),l=S.useCallback(async({forceRefreshToken:d})=>{try{return o?.aud==="convex"?await i({skipCache:d}):await i({template:"convex",skipCache:d})}catch{return null}},[n,a]);return S.useMemo(()=>({isLoading:!r,isAuthenticated:s??!1,fetchAccessToken:l}),[r,s,l])},[t])}const Dl=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]],Ll=pe("at-sign",Dl);const Ul=[["path",{d:"M10 10v4",key:"1mb2ec"}],["path",{d:"M14 10v4",key:"1nt88p"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 10v4",key:"1n77qd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]],ql=pe("battery-full",Ul);const Bl=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],Wn=pe("bell",Bl);const zl=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],Hl=pe("building",zl);const Wl=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],Vl=pe("check-check",Wl);
105const Gl=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],mr=pe("clipboard-list",Gl);const Kl=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Xl=pe("folder-open",Kl);const Yl=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],Jl=pe("heart",Yl);const Zl=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],rr=pe("house",Zl);const Ql=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],ec=pe("lock",Ql);const tc=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],rc=pe("log-in",tc);const sc=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]],ic=pe("plug",sc);const nc=[["path",{d:"M6 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-2",key:"4b9dqc"}],["path",{d:"M6 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-2",key:"22nnkd"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"m13 6-4 6h6l-4 6",key:"14hqih"}]],ac=pe("server-crash",nc);const oc=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],lc=pe("shield-alert",oc);const cc=[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]],uc=pe("square-arrow-out-up-right",cc);var dc=(function(){function t(e){this.parent=e}return t.prototype.setMessageText=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["set","message:text",[e]])},t.prototype.send=function(e,r){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","message:send",[e,r]])},t.prototype.sendText=function(e){this.send("text",e)},t.prototype.sendFile=function(e){this.send("file",e)},t.prototype.sendAnimation=function(e){this.send("animation",e)},t.prototype.sendAudio=function(e){this.send("audio",e)},t.prototype.show=function(e,r){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","message:show",[e,r]])},t.prototype.showText=function(e){this.show("text",e)},t.prototype.showFile=function(e){this.show("file",e)},t.prototype.showAnimation=function(e){this.show("animation",e)},t.prototype.showAudio=function(e){this.show("audio",e)},t.prototype.showPicker=function(e){this.show("picker",e)},t.prototype.showField=function(e){this.show("field",e)},t.prototype.showCarousel=function(e){this.show("carousel",e)},t.prototype.markAsRead=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","message:read"])},t.prototype.startThread=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","message:thread:start",[e]])},t.prototype.endThread=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","message:thread:end",[e]])},t.prototype.onMessageSent=function(e){this.parent.createSingletonIfNecessary(),this.offMessageSent(),window.$crisp.push(["on","message:sent",e])},t.prototype.offMessageSent=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","message:sent"])},t.prototype.onMessageReceived=function(e){this.parent.createSingletonIfNecessary(),this.offMessageReceived(),window.$crisp.push(["on","message:received",e])},t.prototype.offMessageReceived=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","message:received"])},t.prototype.onMessageComposeSent=function(e){this.parent.createSingletonIfNecessary(),this.offMessageComposeSent(),window.$crisp.push(["on","message:compose:sent",e])},t.prototype.offMessageComposeSent=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","message:compose:sent"])},t.prototype.onMessageComposeReceived=function(e){this.parent.createSingletonIfNecessary(),this.offMessageComposeReceived(),window.$crisp.push(["on","message:compose:received",e])},t.prototype.offMessageComposeReceived=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","message:compose:received"])},t})(),hc=(function(){function t(e){this.parent=e}return t.prototype.setNickname=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["set","user:nickname",[e]])},t.prototype.setEmail=function(e,r){this.parent.createSingletonIfNecessary(),window.$crisp.push(["set","user:email",[e,r]])},t.prototype.setPhone=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["set","user:phone",[e]])},t.prototype.setAvatar=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["set","user:avatar",[e]])},t.prototype.setCompany=function(e,r){var s={};r&&(r.url&&(s.url=r.url),r.description&&(s.description=r.description),r.employment&&(s.employment=[r.employment.title],r.employment.role&&s.employment.push(r.employment.role))),this.parent.createSingletonIfNecessary(),window.$crisp.push(["set","user:company",[e,s]])},t.prototype.getEmail=function(){return this.parent.isCrispInjected()?window.$crisp.get("user:email"):null},t.prototype.getPhone=function(){return this.parent.isCrispInjected()?window.$crisp.get("user:phone"):null},t.prototype.getNickname=function(){return this.parent.isCrispInjected()?window.$crisp.get("user:nickname"):null},t.prototype.getAvatar=function(){return this.parent.isCrispInjected()?window.$crisp.get("user:avatar"):null},t.prototype.getCompany=function(){return this.parent.isCrispInjected()?window.$crisp.get("user:company"):null},t.prototype.onEmailChanged=function(e){this.parent.isCrispInjected()&&(this.offEmailChanged(),window.$crisp.push(["on","user:email:changed",e]))},t.prototype.offEmailChanged=function(){this.parent.isCrispInjected()&&window.$crisp.push(["off","user:email:changed"])},t.prototype.onPhoneChanged=function(e){this.parent.isCrispInjected()&&(this.offPhoneChanged(),window.$crisp.push(["on","user:phone:changed",e]))},t.prototype.offPhoneChanged=function(){this.parent.isCrispInjected()&&window.$crisp.push(["off","user:phone:changed"])},t.prototype.onNicknameChanged=function(e){this.parent.isCrispInjected()&&(this.offNicknameChanged(),window.$crisp.push(["on","user:nickname:changed",e]))},t.prototype.offNicknameChanged=function(){this.parent.isCrispInjected()&&window.$crisp.push(["off","user:nickname:changed"])},t.prototype.onAvatarChanged=function(e){this.parent.isCrispInjected()&&(this.offAvatarChanged(),window.$crisp.push(["on","user:avatar:changed",e]))},t.prototype.offAvatarChanged=function(){this.parent.isCrispInjected()&&window.$crisp.push(["off","user:avatar:changed"])},t})(),pc=(function(){function t(e){this.parent=e}return t.prototype.run=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","trigger:run",[e]])},t})(),as;(function(t){t.Red="red",t.Orange="orange",t.Yellow="yellow",t.Green="green",t.Blue="blue",t.Purple="purple",t.Pink="pink",t.Brown="brown",t.Grey="grey",t.Black="black"})(as||(as={}));var fc=(function(){function t(e){this.parent=e}return t.prototype.reset=function(e){e===void 0&&(e=!1),this.parent.isCrispInjected()&&window.$crisp.push(["do","session:reset",[e]])},t.prototype.setSegments=function(e,r){this.parent.createSingletonIfNecessary(),$crisp.push(["set","session:segments",[e,r]])},t.prototype.setData=function(e){var r=this,s=[];Object.entries(e).forEach(function(i){r.isValidDataValue(i[1])&&s.push([i[0],i[1]])}),this.parent.createSingletonIfNecessary(),$crisp.push(["set","session:data",[s]])},t.prototype.pushEvent=function(e,r,s){r===void 0&&(r={}),s===void 0&&(s=as.Blue),this.parent.isCrispInjected()&&window.$crisp.push(["set","session:event",[[[e,r,s]]]])},t.prototype.getData=function(e){if(this.parent.isCrispInjected())return window.$crisp.get("session:data",e)},t.prototype.getIdentifier=function(){return this.parent.isCrispInjected()?window.$crisp.get("session:identifier"):null},t.prototype.onLoaded=function(e){this.parent.createSingletonIfNecessary(),this.offLoaded(),window.$crisp.push(["on","session:loaded",e])},t.prototype.offLoaded=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","session:loaded"])},t.prototype.isValidDataValue=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"},t})(),gc=(function(){function t(e){this.parent=e}return t.prototype.show=function(){this.parent.autoInjectIfNecessary(),window.$crisp.push(["do","chat:show"])},t.prototype.hide=function(){this.parent.autoInjectIfNecessary(),window.$crisp.push(["do","chat:hide"])},t.prototype.open=function(){this.parent.autoInjectIfNecessary(),window.$crisp.push(["do","chat:open"])},t.prototype.close=function(){this.parent.isCrispInjected()&&window.$crisp.push(["do","chat:close"])},t.prototype.setHelpdeskView=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","helpdesk:search"])},t.prototype.openHelpdeskArticle=function(e,r,s,i){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","helpdesk:article:open",[e,r,s,i]])},t.prototype.queryHelpdesk=function(e){this.parent.createSingletonIfNecessary(),window.$crisp.push(["do","helpdesk:query",[e]])},t.prototype.unreadCount=function(){return this.parent.isCrispInjected()?window.$crisp.get("chat:unread:count"):0},t.prototype.isChatOpened=function(){return this.parent.isCrispInjected()?window.$crisp.is("chat:opened"):!1},t.prototype.isVisible=function(){return this.parent.isCrispInjected()?window.$crisp.is("chat:visible"):!1},t.prototype.onChatInitiated=function(e){this.parent.createSingletonIfNecessary(),this.offChatInitiated(),window.$crisp.push(["on","chat:initiated",e])},t.prototype.offChatInitiated=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","chat:initiated"])},t.prototype.onChatOpened=function(e){this.parent.createSingletonIfNecessary(),this.offChatOpened(),window.$crisp.push(["on","chat:opened",e])},t.prototype.offChatOpened=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","chat:opened"])},t.prototype.onChatClosed=function(e){this.parent.createSingletonIfNecessary(),this.offChatClosed(),window.$crisp.push(["on","chat:closed",e])},t.prototype.offChatClosed=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","chat:closed"])},t.prototype.onHelpdeskQueried=function(e){this.parent.createSingletonIfNecessary(),this.offHelpdeskQueried(),window.$crisp.push(["on","helpdesk:queried",e])},t.prototype.offHelpdeskQueried=function(){this.parent.createSingletonIfNecessary(),window.$crisp.push(["off","helpdesk:queried"])},t})(),pi;(function(t){t.Default="default",t.Amber="amber",t.Black="black",t.Blue="blue",t.BlueGrey="blue_grey",t.LightBlue="light_blue",t.Brown="brown",t.Cyan="cyan",t.Green="green",t.LightGreen="light_green",t.Grey="grey",t.Indigo="indigo",t.Orange="orange",t.DeepOrange="deep_orange",t.Pink="pink",t.Purple="purple",t.DeepPurple="deep_purple",t.Red="red",t.Teal="teal"})(pi||(pi={}));var os;(function(t){t.Left="left",t.Right="right"})(os||(os={}));var vc=(function(){function t(){this.clientUrl="https://client.crisp.chat/l.js",this.websiteId="",this.autoload=!0,this.injected=!1,this.chat=new gc(this),this.session=new fc(this),this.user=new hc(this),this.message=new dc(this),this.trigger=new pc(this)}return t.prototype.configure=function(e,r){r===void 0&&(r={}),this.websiteId=e,this.tokenId=r.tokenId,this.locale=r.locale,this.sessionMerge=r.sessionMerge,this.cookieDomain=r.cookieDomain,this.cookieExpire=r.cookieExpire,this.lockFullview=r.lockFullview,this.lockMaximized=r.lockMaximized,this.safeMode=r.safeMode,r.clientUrl!==void 0&&(this.clientUrl=r.clientUrl),r.autoload!==void 0&&(this.autoload=r.autoload),this.autoload&&this.load()},t.prototype.load=function(){var e=document.getElementsByTagName("head");if(this.createSingletonIfNecessary(),this.isCrispInjected()!==!0){if(!this.websiteId)throw new Error("websiteId must be set before loading Crisp");if(window.CRISP_WEBSITE_ID=this.websiteId,window.CRISP_RUNTIME_CONFIG={},this.tokenId&&(window.CRISP_TOKEN_ID=this.tokenId),this.sessionMerge&&(window.CRISP_RUNTIME_CONFIG.session_merge=!0),this.locale&&(window.CRISP_RUNTIME_CONFIG.locale=this.locale),this.lockFullview&&(window.CRISP_RUNTIME_CONFIG.lock_full_view=!0),this.lockMaximized&&(window.CRISP_RUNTIME_CONFIG.lock_maximized=!0),this.cookieDomain&&(window.CRISP_COOKIE_DOMAIN=this.cookieDomain),this.cookieExpire&&(window.CRISP_COOKIE_EXPIRE=this.cookieExpire),!e||!e[0])return this.deferredLoading();this.safeMode===!0&&this.setSafeMode(!0);var r=document.createElement("script");r.src=this.clientUrl,r.async=!0,e[0].appendChild(r),this.injected=!0}},t.prototype.setTokenId=function(e){this.tokenId=e,this.isCrispInjected()===!0&&(e?window.CRISP_TOKEN_ID=e:delete window.CRISP_TOKEN_ID)},t.prototype.setZIndex=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","container:index",[e]])},t.prototype.setColorTheme=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","color:theme",[e]])},t.prototype.setHideOnAway=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","hide:on:away",[e]])},t.prototype.setHideOnMobile=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","hide:on:mobile",[e]])},t.prototype.setPosition=function(e){this.createSingletonIfNecessary(),$crisp.push(["config","position:reverse",[e===os.Left]])},t.prototype.setAvailabilityTooltip=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","availability:tooltip",[e]
105])},t.prototype.setVacationMode=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","hide:vacation",[e]])},t.prototype.setSafeMode=function(e){e===void 0&&(e=!0),this.createSingletonIfNecessary(),window.$crisp.push(["safe",e])},t.prototype.muteSound=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","sound:mute",[e]])},t.prototype.toggleOperatorCount=function(e){this.createSingletonIfNecessary(),window.$crisp.push(["config","show:operator:count",[e]])},t.prototype.onWebsiteAvailabilityChanged=function(e){this.createSingletonIfNecessary(),this.offWebsiteAvailabilityChanged(),window.$crisp.push(["on","website:availability:changed",e])},t.prototype.offWebsiteAvailabilityChanged=function(){this.createSingletonIfNecessary(),window.$crisp.push(["off","website:availability:changed"])},t.prototype.createSingletonIfNecessary=function(){window.$crisp===void 0&&(window.$crisp=[])},t.prototype.autoInjectIfNecessary=function(){this.isCrispInjected()||this.load()},t.prototype.isCrispInjected=function(){return!!(this.injected===!0||window.$crisp&&window.$crisp.is)},t.prototype.deferredLoading=function(){var e=this;document.addEventListener("DOMContentLoaded",function(){e.load()})},t})(),ht=new vc;const _c="sidebar_state",mc=3600*24*7,yc="16rem",bc="18rem",xc="3rem",wc="b",Vn=S.createContext(null);function Gn(){const t=S.useContext(Vn);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function kc({defaultOpen:t=!0,open:e,onOpenChange:r,className:s,style:i,children:n,...a}){const o=Po(),[l,d]=S.useState(!1),[u,h]=S.useState(t),f=e??u,g=S.useCallback(m=>{const E=typeof m=="function"?m(f):m;r?r(E):h(E),document.cookie=`${_c}=${E}; path=/; max-age=${mc}`},[r,f]),p=S.useCallback(()=>o?d(m=>!m):g(m=>!m),[o,g,d]);S.useEffect(()=>{const m=E=>{E.key===wc&&(E.metaKey||E.ctrlKey)&&(E.preventDefault(),p())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[p]);const _=f?"expanded":"collapsed",k=S.useMemo(()=>({state:_,open:f,setOpen:g,isMobile:o,openMobile:l,setOpenMobile:d,toggleSidebar:p}),[_,f,g,o,l,d,p]);return c.jsx(Vn.Provider,{value:k,children:c.jsx(On,{delayDuration:0,children:c.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":yc,"--sidebar-width-icon":xc,...i},className:ae("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...a,children:n})})})}function Ec({side:t="left",variant:e="sidebar",collapsible:r="offcanvas",className:s,children:i,...n}){const{isMobile:a,state:o,openMobile:l,setOpenMobile:d}=Gn();return r==="none"?c.jsx("div",{"data-slot":"sidebar",className:ae("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...n,children:i}):a?c.jsx(Oo,{open:l,onOpenChange:d,...n,children:c.jsxs($o,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":bc},side:t,children:[c.jsxs(Ro,{className:"sr-only",children:[c.jsx(Mo,{children:"Sidebar"}),c.jsx(Ao,{children:"Displays the mobile sidebar."})]}),c.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):c.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":o,"data-collapsible":o==="collapsed"?r:"","data-variant":e,"data-side":t,"data-slot":"sidebar",children:[c.jsx("div",{"data-slot":"sidebar-gap",className:ae("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",e==="floating"||e==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),c.jsx("div",{"data-slot":"sidebar-container",className:ae("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",e==="floating"||e==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...n,children:c.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:i})})]})}function Sc({className:t,...e}){return c.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ae("flex flex-col gap-2 p-2",t),...e})}function jc({className:t,...e}){return c.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ae("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...e})}function ir({className:t,...e}){return c.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ae("relative flex w-full min-w-0 flex-col p-2",t),...e})}function nr({className:t,asChild:e=!1,...r}){const s=e?Nn:"div";return c.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:ae("text-sidebar-foreground
105/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...r})}function ar({className:t,...e}){return c.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ae("w-full text-sm",t),...e})}function or({className:t,...e}){return c.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ae("flex w-full min-w-0 flex-col gap-1",t),...e})}function Qe({className:t,...e}){return c.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ae("group/menu-item relative",t),...e})}const Ic=No("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function et({asChild:t=!1,isActive:e=!1,variant:r="default",size:s="default",tooltip:i,className:n,...a}){const o=t?Nn:"button",{isMobile:l,state:d}=Gn(),u=c.jsx(o,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":e,className:ae(Ic({variant:r,size:s}),n),...a});return i?(typeof i=="string"&&(i={children:i}),c.jsxs(Pn,{children:[c.jsx(Fo,{asChild:!0,children:u}),c.jsx(Tn,{side:"right",align:"center",hidden:d!=="collapsed"||l,...i})]})):u}function fi({className:t,...e}){return c.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:ae("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...e})}var Ur={exports:{}};const jt=t=>({...t,__type:"prebuilt_appearance"}),Cc=Object.freeze(Object.defineProperty({__proto__:null,experimental_createTheme:jt},Symbol.toStringTag,{value:"Module"})),Nc=jn(Cc),Kn=jt({name:"dark",variables:{colorBackground:"#212126",colorNeutral:"white",colorPrimary:"#ffffff",colorPrimaryForeground:"black",colorForeground:"white",colorInputForeground:"white",colorInput:"#26262B"},elements:{providerIcon__apple:{filter:"invert(1)"},providerIcon__github:{filter:"invert(1)"},providerIcon__okx_wallet:{filter:"invert(1)"},providerIcon__vercel:{filter:"invert(1)"},activeDeviceIcon:{"--cl-chassis-bottom":"#d2d2d2","--cl-chassis-back":"#e6e6e6","--cl-chassis-screen":"#e6e6e6","--cl-screen":"#111111"}}}),Pc=jt({name:"shadesOfPurple",baseTheme:Kn,variables:{colorBackground:"#3f3c77",colorPrimary:"#f8d80d",colorPrimaryForeground:"#38375f",colorInputForeground:"#a1fdfe",colorShimmer:"rgba(161,253,254,0.36)"}}
105),We={boxShadow:"3px 3px 0px #000",border:"2px solid #000","&:focus":{boxShadow:"4px 4px 0px #000",border:"2px solid #000",transform:"scale(1.01)"},"&:active":{boxShadow:"2px 2px 0px #000",transform:"translate(1px)"}},tt={boxShadow:"3px 3px 0px #000",border:"2px solid #000"},Tc=jt({name:"neobrutalism",simpleStyles:!0,variables:{colorPrimary:"#DF1B1B",colorShimmer:"rgba(255,255,255,0.64)",fontWeight:{normal:500,medium:600,bold:700}},elements:{cardBox:{boxShadow:"7px 7px 0px #000",border:"3px solid #000"},card:{borderRadius:"0"},headerSubtitle:{color:"#212126"},alternativeMethodsBlockButton:We,socialButtonsIconButton:{...We},selectButton:{...We,...tt,transition:"all 0.2s ease-in-out","&:focus":{boxShadow:"4px 4px 0px #000",border:"2px solid #000",transform:"scale(1.01)"}},socialButtonsBlockButton:{...We,color:"#212126"},profileSectionPrimaryButton:We,profileSectionItem:{color:"#212126"},avatarImageActionsUpload:We,menuButton:tt,menuList:tt,formButtonPrimary:We,navbarButton:We,formFieldAction:{fontWeight:"700"},formFieldInput:{...tt,transition:"all 0.2s ease-in-out","&:focus":{boxShadow:"4px 4px 0px #000",border:"2px solid #000",transform:"scale(1.01)"},"&:hover":{...tt,transform:"scale(1.01)"}},table:tt,tableHead:{color:"#212126"},dividerLine:{background:"#000"},dividerText:{fontWeight:"700",color:"#212126"},footer:{background:"#fff","& div":{color:"#212126"}},footerActionText:{color:"#212126"},footerActionLink:{fontWeight:"700",borderBottom:"3px solid","&:focus":{boxShadow:"none"}},actionCard:{...tt},badge:{border:"1px solid #000",background:"#fff",color:"#212126"}}}),Oc=jt({name:"shadcn",cssLayerName:"components",variables:{colorBackground:"var(--card)",colorDanger:"var(--destructive)",colorForeground:"var(--card-foreground)",colorInput:"var(--input)",colorInputForeground:"var(--card-foreground)",colorModalBackdrop:"var(--color-black)",colorMuted:"var(--muted)",colorMutedForeground:"var(--muted-foreground)",colorNeutral:"var(--foreground)",colorPrimary:"var(--primary)",colorPrimaryForeground:"var(--primary-foreground)",colorRing:"var(--ring)",fontWeight:{normal:"var(--font-weight-normal)",medium:"var(--font-weight-medium)",semibold:"var(--font-weight-semibold)",bold:"var(--font-weight-semibold)"}},elements:{input:"bg-transparent dark:bg-input/30",cardBox:"shadow-sm border",popoverBox:"shadow-sm border",button:{'&[data-variant="solid"]::after':{display:"none"}},providerIcon__apple:"dark:invert",providerIcon__github:"dark:invert",providerIcon__okx_wallet:"dark:invert",providerIcon__vercel:"dark:invert"}}),$c=jt({name:"simple",simpleStyles:!0}),Rc=Object.freeze(Object.defineProperty({__proto__:null,dark:Kn,experimental__simple:$c,neobrutalism:Tc,shadcn:Oc,shadesOfPurple:Pc},Symbol.toStringTag,{value:"Module"})),Mc=jn(Rc);var gi;function Ac(){return gi||(gi=1,(function(t){var e=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=Object.getOwnPropertyNames,i=Object.prototype.hasOwnProperty,n=(d,u,h,f)=>{if(u&&typeof u=="object"||typeof u=="function")for(let g of s(u))!i.call(d,g)&&g!==h&&e(d,g,{get:()=>u[g],enumerable:!(f=r(u,g))||f.enumerable});return d},a=(d,u,h)=>(n(d,u,"default"),h&&n(h,u,"default")),o=d=>n(e({},"__esModule",{value:!0}),d),l={};t.exports=o(l),a(l,Nc,t.exports),a(l,Mc,t.exports)})(Ur)),Ur.exports}var vi=Ac();function _i({className:t,projects:e,currentProject:r,compact:s}){const[i,n]=S.useState(!1),[a,o]=S.useState(r?._id||""),l=qe(),d=uo(),u=In(),h=S.useRef(new Set),f=S.useCallback(p=>{if(h.current.has(p))return;h.current.add(p);const _=p;d.load(`/projects/${p}`),Promise.allSettled([u.query(M.projects.getProject,{projectId:_}),u.query(M.candidateChecks.getCandidateCheckCountByProject,{projectId:_}),u.query(M.candidateChecks.getCandidateCheckStatusCounts,{projectId:_}),u.query(M.shortlists.getShortlistCandidateCountsForProject,{projectId:_}),u.query(M.llmUsage.getProjectUsageByAction,{projectId:_})]).then(k=>{k.some(m=>m.status==="rejected")&&h.current.delete(p)})},[u,d]);S.useEffect(()=>{o(r?._id||"")},[r?._id]);const g=e.find(p=>p._id===a);return c.jsx("div",{className:ae(s?"flex h-full w-full items-center justify-center":"w-full h-full",t),children:c.jsxs($n,{open:i,onOpenChange:n,children:[c.jsx(On,{children:c.jsxs(Pn,{children:[c.jsx(Rn,{asChild:!0,children:c.jsx(he,{variant:"outline",role:"combobox","aria-expanded":i,className:ae(s?"h-9 w-9 justify-center p-0":"w-[240px] min-h-[48px] justify-between px-4 py-3"),"aria-label":"Select project",children:s?c.jsx(Xl,{className:"h-4 w-4"}):c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"max-w-[160px] text-left flex flex-col",children:g?c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"truncate",children:g.title}),c.jsx("span",{className:"truncate text-muted-foreground",children:g.company})]}):"Select Project..."}),c.jsx(zo,{className:"opacity-50"})]})})}),g&&c.jsxs(Tn,{side:"right",children:[g.title," ",g.company]})]})}),c.jsx(Mn,{className:"w-[240px] p-0",children:c.jsxs(Do,{children:[c.jsx(Lo,{placeholder:"Search Project...",className:"h-9"}),c.jsxs(Uo,{children:[c.jsx(qo,{children:"No Project found."}),c.jsxs(Bo,{children:[c.jsx(oi,{value:"all",className:"cursor-pointer",onSelect:p=>{o(p===a?"":p),n(!1)},children:c.jsxs(Re,{to:"/",prefetch:"intent",className:"flex items-center gap-2",children:["View All Projects",c.jsx(uc,{className:"w-4 h-4"})]})},"all"),e.map(p=>c.jsxs(oi,{value:`${p.title} ${p.company} ${p._id}`,className:"cursor-pointer",onMouseEnter:()=>f(String(p._id)),onFocus:()=>f(String(p._id)),onSelect:()=>{o(p._id),n(!1),l(`/projects/${p._id}`)},children:[c.jsxs("span",{className:"flex flex-col max-w-[160px]",children:[c.jsx("span",{className:"truncate",children:p.title}),c.jsx("span",{className:"truncate text-muted-foreground",children:p.company})]}),c.jsx(An,{className:ae("ml-auto",a===p._id?"opacity-100":"opacity-0")})]},p._id))]})]})]})})]})})}function Fc(t,e){const r=e?.lastBriefingId?`/projects/${t}/candidate-checks/${e.lastBriefingId}`:`/projects/${t}/candidate-checks`,s={pathname:de("/outreach-tasks"),search:`?${new URLSearchParams({projectId:t}).toString()}`},i={pathname:de("/inbox"),search:`?${new URLSearchParams({projectId:t}).toString()}`};return[{title:"Project Overview",url:`/projects/${t}`,icon:Zo},{title:"Research",url:de("/projects/:projectId/research",{projectId:t}),icon:mr},{title:"Briefings",url:`/projects/${t}/briefings`,icon:Qo},{title:"Searches",url:`/projects/${t}/searches`,icon:el},{title:"Candidate Checks",url:r,icon:An},{title:"Shortlists",url:`/projects/${t}/shortlists`,icon:Fn},{title:"Campaigns",url:`/projects/${t}/campaigns`,icon:tl},{title:"Project Inbox",url:ri(i),to:i,icon:Ln},{title:"Outreach Tasks",url:ri(s),to:s,icon:mr},{title:"Interested",url:`/projects/${t}/interested`,icon:Jl}]}const Dc=[{title:"Setup checklist",url:de("/welcome"),icon:mr},{title:"Manage Personas",url:"/settings/personas",icon:Fn},{title:"Preferences",url:"/settings/preferences",icon:Ho},{title:"AI & Prompts",url:"/settings/ai",icon:Wo},{title:"Outreach Safety",url:"/settings/outreach",icon:Dn},{title:"Integrations",url:"/settings/integrations",icon:ic},{title:"Manage Organization",url:"/organization",icon:Hl},{title:"Support Docs",url:"https://docs.talentsourcer.ai/docs/getting-started",icon:Go,external:!0}
105],Lc=[{title:"Infrastructure Ops",url:"/settings/operations-admin",icon:Dn}],Uc="kn7885yr8q568c6r0bde6yjqpx7kb93c".split(",").map(t=>t.trim()).filter(Boolean),qc=te.memo(function({hide:e}){const r=Fs(),s=r.pathname,i=r.search,n=In(),a=S.useRef(null),o=S.useRef(null),l=S.useRef(new Set),d=S.useRef(new Set),[u,h]=S.useState(()=>Date.now()),{theme:f}=Cn(),{projectId:g}=ho(),p=Eo(),_=tr(M.outreachTasks.prepareLinkedInTasks);S.useEffect(()=>{if(!p)return;const j=String(p);d.current.has(j)||(d.current.add(j),_({organizationId:p,limit:75}).catch(z=>{d.current.delete(j),console.error("Failed to prepare LinkedIn tasks for sidebar",z)}))},[p,_]),S.useEffect(()=>{if(!p)return;h(Date.now());const j=window.setInterval(()=>{h(Date.now())},3e4);return()=>window.clearInterval(j)},[p]);const k=_e(M.projects.getProject,g?{projectId:g}:"skip"),m=_e(M.projects.listActiveProjects,p?{organizationId:p}:"skip"),E=_e(M.inbox.getInboxSidebarCounts,p?{organizationId:p}:"skip"),P=_e(M.outreachTasks.getSidebarCount,p?{organizationId:p,dueBefore:u}:"skip"),N=_e(M.briefings.getLastBriefingWithChecks,p&&g?{organizationId:p,projectId:g}:"skip"),$=_e(M.users.getCurrentUserRole,p?{organizationId:p}:"skip"),D=!!(p&&Uc.includes(String(p))),I=E?.unreadThreads??0,T=E?.needsReplyThreads??0,U=I>0||T>0,W=I>99?"99+":I>0?String(I):"",B=P?.dueCount??0,Q=B>99?"99+":B>0?String(B):"",{sidebarItems:fe,activeItem:re}=S.useMemo(()=>{const j=Fc(String(g??""),{lastBriefingId:N}),z=j.reduce((L,A)=>{if(A.title==="Candidate Checks"){const q=`/projects/${g}/candidate-checks`;if((s===q||s.startsWith(q))&&(!L||A.url.length>L.url.length))return A}else if(A.title==="Project Inbox"){if(s==="/inbox"&&i.includes(`projectId=${g}`)&&(!L||A.url.length>L.url.length))return A}else if(A.title==="Outreach Tasks"){const q=new URLSearchParams(i);if(s==="/outreach-tasks"&&q.get("projectId")===String(g)&&(!L||A.url.length>L.url.length))return A}else if((s===A.url||A.url!=="/projects"&&s.startsWith(A.url))&&(!L||A.url.length>L.url.length))return A;return L},null);return{sidebarItems:j,activeItem:z}},[g,s,i,N]);if(e)return null;const le=()=>{if(!p||!g)return;const j=`${p}:${g}`;if(a.current===j)return;a.current=j;const z=p,L=g;Promise.allSettled([n.query(M.briefings.listBriefings,{organizationId:z,projectId:L}),n.query(M.candidateChecks.getCandidateChecksPageStats,{projectId:L})])},we=j=>{if(!p||!g)return;const z=`${p}:${g}:${j}`;if(l.current.has(z))return;l.current.add(z);const L=p,A=g;if(j==="Candidate Checks"){le();return}const q=j==="Briefings"?n.query(M.briefings.listBriefings,{organizationId:L,projectId:A}):j==="Searches"?n.query(M.searches.listSearches,{organizationId:L,projectId:A}):j==="Shortlists"?n.query(M.shortlists.listShortlists,{organizationId:L,projectId:A}):j==="Campaigns"?n.query(M.campaignExecution.listCampaignDefinitions,{organizationId:L,projectId:A}):null;q&&q.catch(()=>{l.current.delete(z)})},ge=()=>{if(!p)return;const j=String(p);if(o.current===j)return;o.current=j;const z=p;(async()=>{const[L]=await Promise.allSettled([n.query(M.users.getCurrentUserRole,{organizationId:z}),n.query(M.users.current,{}),n.query(M.personalAccessTokens.getMyPersonalAccessToken,{organizationId:z})]),A=L.status==="fulfilled"?L.value?.role:void 0,q=[];(A==="admin"||A==="owner")&&q.push(n.query(M.llmProviders.listProviderConnections,{organizationId:z})),A==="admin"&&q.push(n.query(M.apiKeys.getApiKeys,{organizationId:z})),await Promise.allSettled(q)})().catch(()=>{o.current=null})};return c.jsxs(Ec,{collapsible:"icon",children:[c.jsxs(jc,{children:[c.jsxs(ir,{className:"py-0",children:[c.jsx(nr,{asChild:!0,children:c.jsx("div",{className:"flex flex-col items-start justify-center gap-4 w-full h-[60px] border-b border-gray-200 dark:border-gray-700",children:c.jsxs(Re,{to:"/",prefetch:"intent",className:"mx-auto flex items-center gap-3 flex-nowrap h-full",style:{maxWidth:"100%"},children:[c.jsx("img",{src:lt,alt:"Talent Sourcer AI",className:"h-8 w-auto object-contain"}),c.jsx("span",{className:"text-lg font-mono font-bold text-black whitespace-nowrap dark:text-white",children:"Talent Sourcer AI"})]})})}),c.jsx(ar,{className:"mt-6",children:c.jsxs(or,{children:[c.jsx(Qe,{className:"hidden group-data-[collapsible=icon]:block",children:c.jsx(et,{asChild:!0,children:c.jsxs("a",{href:"/",children:[c.jsx("img",{src:lt,alt:"Talent Sourcer AI",className:"h-5 w-5 object-contain"}),c.jsx("span",{children:"Home"})]})})}),c.jsx(Qe,{children:c.jsx(et,{asChild:!0,isActive:s==="/",tooltip:"Dashboard",children:c.jsxs(Re,{to:"/",prefetch:"intent",children:[c.jsx(rr,{}),c.jsx("span",{children:"Dashboard"})]})})}
105,"Dashboard"),c.jsxs(Qe,{children:[c.jsx(et,{asChild:!0,isActive:s==="/inbox",tooltip:"Inbox",children:c.jsxs(Re,{to:"/inbox",prefetch:"intent","aria-label":U?`Inbox: ${I} unread, ${T} need reply`:"Inbox",children:[c.jsx(Ln,{}),c.jsx("span",{children:"Inbox"})]})}),U?c.jsxs(fi,{children:[W||"•",T>0?c.jsx("span",{"aria-hidden":!0,className:"ml-1 inline-block h-2 w-2 rounded-full bg-amber-500"}):null]}):null]},"Inbox"),c.jsxs(Qe,{children:[c.jsx(et,{asChild:!0,isActive:s==="/outreach-tasks",tooltip:"Outreach Tasks",children:c.jsxs(Re,{to:{pathname:de("/outreach-tasks")},prefetch:"intent","aria-label":B>0?`Outreach Tasks: ${B} of my tasks due`:"Outreach Tasks",children:[c.jsx(mr,{}),c.jsx("span",{children:"Outreach Tasks"})]})}),B>0?c.jsx(fi,{children:Q}):null]},"Outreach Tasks")]})})]}),c.jsxs(ir,{children:[c.jsx(nr,{className:"text-xs text-muted-foreground uppercase tracking-wider font-semibold mb-1 group-data-[collapsible=icon]:hidden",children:"Current Project"}),c.jsx(ar,{className:"flex items-center gap-2 h-12 mb-4 group-data-[collapsible=icon]:hidden",children:c.jsx(_i,{className:"w-full h-full",projects:m||[],currentProject:k})}),c.jsx(ar,{className:"hidden group-data-[collapsible=icon]:flex items-center justify-center mb-4 px-0",children:c.jsx(_i,{compact:!0,className:"h-9 w-9",projects:m||[],currentProject:k})}),c.jsx(ar,{children:c.jsx(or,{children:g&&fe.map(j=>c.jsx(Qe,{children:c.jsx(et,{asChild:!0,isActive:re!==null&&re.url===j.url,tooltip:j.title,children:c.jsxs(Re,{to:j.to??j.url,prefetch:"intent",onMouseEnter:()=>we(j.title),onFocus:()=>we(j.title),children:[c.jsx(j.icon,{}),c.jsx("span",{children:j.title})]})})},j.title))})})]}),c.jsx(ii,{defaultOpen:!0,className:"group/collapsible",children:c.jsxs(ir,{children:[c.jsx(nr,{asChild:!0,children:c.jsxs(ni,{children:["Settings",c.jsx(li,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),c.jsx(ai,{children:c.jsx(or,{children:Dc.filter(j=>!j.adminOnly||$?.isAdmin).map(j=>c.jsx(Qe,{children:c.jsx(et,{asChild:!0,isActive:s===j.url,children:c.jsxs(Re,{to:j.url,prefetch:"intent",target:j.external?"_blank":void 0,onMouseEnter:j.title==="Preferences"?ge:void 0,onFocus:j.title==="Preferences"?ge:void 0,children:[c.jsx(j.icon,{}),c.jsx("span",{children:j.title})]})})},j.title))})})]})}),D?c.jsx(ii,{defaultOpen:!1,className:"group/collapsible",children:c.jsxs(ir,{children:[c.jsx(nr,{asChild:!0,children:c.jsxs(ni,{children:["Operations Admin",c.jsx(li,{className:"ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180"})]})}),c.jsx(ai,{children:c.jsx(or,{children:Lc.map(j=>c.jsx(Qe,{children:c.jsx(et,{asChild:!0,isActive:s===j.url,children:c.jsxs(Re,{to:j.url,prefetch:"intent",children:[c.jsx(j.icon,{}),c.jsx("span",{children:j.title})]})})},j.title))})})]})}):null]}),c.jsxs(Sc,{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center gap-2 group-data-[collapsible=icon]:flex-col group-data-[collapsible=icon]:items-center w-full flex-row justify-between",children:[c.jsx(Io,{}),c.jsxs("div",{className:"flex h-8 w-8 items-center justify-center",children:[c.jsx(Ko,{children:c.jsx("div",{className:"h-8 w-8 rounded-full relative overflow-hidden bg-gradient-to-tr from-muted/50 to-muted before:absolute before:inset-0 before:-translate-x-full before:animate-[shimmer_2s_infinite] before:bg-gradient-to-r before:from-transparent before:via-muted-foreground/10 before:to-transparent"})}),c.jsx(Xo,{children:c.jsx(Yo,{appearance:{baseTheme:f==="dark"?vi.dark:void 0}})})]})]}),c.jsx("div",{className:"border-t border-gray-200 dark:border-gray-700"}),c.jsx("div",{className:"group-data-[collapsible=icon]:hidden",children:c.jsx(Jo,{hidePersonal:!0,afterCreateOrganizationUrl:"/org-setup",afterSelectOrganizationUrl:"/",createOrganizationUrl:"/create-org",organizationProfileUrl:"/organization",organizationProfileMode:"navigation",appearance:{baseTheme:f==="dark"?vi.dark:void 0,elements:{organizationSwitcherDropdown:"z-50"}}})}),c.jsx(Re,{to:"/organization",prefetch:"intent",className:"hidden group-data-[collapsible=icon]:flex h-9 w-9 items-center justify-center rounded-md border border-border/60",children:c.jsx("img",{src:lt,alt:"Talent Sourcer AI",className:"h-5 w-5 object-contain"})})]})]})});function Bc({notification:t,userId:e}){const r=qe(),s=tr(M.notifications.markAsRead),i=async()=>{t.read||await s({notificationId:t._id,userId:e}),r(t.navigationPath)},n=d=>
105d.trim().split(/\s+/).filter(Boolean).map(u=>u[0]).join("").toUpperCase().slice(0,2)||"?",a=()=>t.type==="comment_mention"?"mentioned you":t.type==="candidate_check_run_completed"?"are ready for review":t.type==="linkedin_import_completed"?"import has finished":"replied to your comment",o=()=>{if(t.type!=="candidate_check_run_completed")return t.previewText;const d=t.previewText.match(/(\d+)\s*\/\s*(\d+)/);if(d){const u=d[1],h=d[2];return`Finished: ${u}/${h} checks.`}return t.previewText},l=t.type==="comment_mention"?Ll:t.type==="comment_reply"?pl:t.type==="linkedin_import_completed"?fl:null;return c.jsxs("div",{onClick:i,className:ae("flex gap-3 px-4 py-3 cursor-pointer hover:bg-accent transition-colors border-b last:border-b-0",!t.read&&"bg-blue-50/50 dark:bg-blue-950/20"),children:[c.jsxs(cl,{className:"w-10 h-10 shrink-0",children:[c.jsx(ul,{src:t.actor.profilePictureUrl}),c.jsx(dl,{className:"text-xs",children:n(t.actor.name)})]}),c.jsx("div",{className:"flex-1 min-w-0",children:c.jsxs("div",{className:"flex items-start gap-2 mb-1",children:[l?c.jsx(l,{className:"w-4 h-4 text-muted-foreground shrink-0 mt-0.5"}):null,c.jsxs("div",{className:"flex-1 min-w-0",children:[t.type==="candidate_check_run_completed"?c.jsx("p",{className:"text-sm",children:c.jsxs("span",{className:"font-semibold",children:["Candidate checks ",a()]})}):t.type==="linkedin_import_completed"?c.jsx("p",{className:"text-sm",children:c.jsxs("span",{className:"font-semibold",children:["LinkedIn ",a()]})}):c.jsxs("p",{className:"text-sm",children:[c.jsx("span",{className:"font-semibold",children:t.actor.name})," ",c.jsx("span",{className:"text-muted-foreground",children:a()})]}),c.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:o()}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:hl(t.createdAt,{addSuffix:!0})})]}),!t.read&&c.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full shrink-0 mt-1.5"})]})})]})}function zc({userId:t,organizationId:e}){const r=_e(M.notifications.listNotifications,{userId:t,organizationId:e,unreadOnly:!1}),s=tr(M.notifications.markAllAsRead),i=async()=>{await s({userId:t,organizationId:e})},n=r?.filter(a=>!a.read).length??0;return c.jsxs("div",{className:"flex flex-col",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b",children:[c.jsx("h3",{className:"font-semibold text-sm",children:"Notifications"}),n>0&&c.jsxs(he,{variant:"ghost",size:"sm",onClick:i,className:"h-8 text-xs",children:[c.jsx(Vl,{className:"w-4 h-4 mr-1"}),"Mark all read"]})]}),!r||r.length===0?c.jsxs("div",{className:"flex flex-col items-center justify-center py-12 px-4 text-center",children:[c.jsx(Wn,{className:"w-12 h-12 text-muted-foreground mb-3 opacity-50"}),c.jsx("p",{className:"text-sm font-medium text-muted-foreground",children:"No notifications yet"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"You'll be notified when someone mentions you or replies to your comments"})]}):c.jsx(gl,{className:"h-[500px]",children:c.jsx("div",{className:"flex flex-col",children:r.map(a=>c.jsx(Bc,{notification:a,userId:t},a._id))})})]})}function Hc(){const{organizationId:t}=Ds(),e=_e(M.users.current),r=_e(M.notifications.getUnreadCount,e&&t?{userId:e._id,organizationId:t}:"skip");return c.jsxs(al,{children:[c.jsx(ol,{asChild:!0,children:c.jsxs(he,{variant:"ghost",size:"icon",className:"relative ml-2",children:[c.jsx(Wn,{className:"w-5 h-5"}),r!==void 0&&r>0&&c.jsx(nl,{variant:"destructive",className:"absolute -top-1 -right-1 h-5 min-w-5 px-1 flex items-center justify-center text-[10px] font-semibold rounded-full",children:r>99?"99+":r})]})}),c.jsx(ll,{align:"end",className:"w-[380px] p-0 max-h-[600px] overflow-hidden",children:e&&t?c.jsx(zc,{userId:e._id,organizationId:t}):c.jsx("div",{className:"p-4 text-sm text-muted-foreground text-center",children:"Loading..."})})]})}const mi=S.memo(function(){const{organizationId:e,creditBalance:r}=Ds(),{isPrivacyMode:s}=sl(),i=S.useMemo(()=>{const p=r?.balance??0,_=r?.allocation??0,k=_<=0&&p>0;let m=_>0?p/_:0;isNaN(m)&&(m=0),m=Math.max(0,Math.min(1,m));const E=m>=.75,P=m>=.25&&m<.75;return{percentage:m,isFull:E,isMedium:P,color:k?"text-blue-500":E?"text-green-500":P?"text-yellow-500":"text-red-500"}},[r?.balance,r?.allocation]),{percentage:n,color:a}=i,[o,l]=S.useState(!1),d=tr(M.projects.createProject),u=S.useMemo(()=>({title:"",company:"",description:"",salaryRange:"",location:"",status:"Draft"}),[]),h=_e(M.subscriptions.getCurrentSubscriptionRenewalDateQuery)||void 0;
105function f(p){return p?new Date(p).toLocaleString("en-US",{month:"short",day:"numeric"}):null}const g=f(h);return c.jsxs("nav",{className:"w-full flex items-center justify-end px-6 py-3 border-b bg-background",children:[s&&c.jsxs("div",{className:"flex items-center gap-2 mr-4 px-3 py-1 bg-blue-100 text-blue-800 rounded-full text-sm font-medium border border-blue-200",children:[c.jsx(Vo,{className:"w-4 h-4 text-muted-foreground"}),c.jsx("span",{children:"Privacy Mode"}),c.jsx("div",{className:"w-2 h-2 bg-blue-500 rounded-full animate-pulse"})]}),c.jsxs($n,{children:[c.jsx(Rn,{asChild:!0,children:c.jsxs(he,{variant:"outline",className:"mr-2",children:[c.jsx(ql,{className:`w-4 h-4 ${a}`})," Credits"," ",c.jsx(ui,{className:"w-4 h-4"})]})}),c.jsx(Mn,{className:"min-w-[320px]",children:c.jsxs("div",{className:"flex flex-col gap-1",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsxs("span",{className:`${a} font-semibold`,children:[r?.balance?.toLocaleString()??0," available"]}),c.jsxs("span",{className:"text-muted-foreground",children:["/ ",r?.allocation?.toLocaleString()??0]})]}),c.jsx(rl,{value:i.percentage*100,className:"mb-1"}),g&&c.jsxs("div",{className:"text-xs text-muted-foreground flex items-center gap-1 mt-1",children:[c.jsx(ui,{className:"w-3 h-3"}),"Monthly credits renew on ",g,"."]})]})})]}),c.jsx(To,{open:o,onOpenChange:l,mode:"create",initialValues:u,onSubmit:async p=>{e&&(await d({...p,organizationId:e,status:p.status}),l(!1))}}),c.jsx(Hc,{})]})});function yi(t,e,r){return s=>{if(!(e.length===0||e.some(n=>!vl(s.getAll(n),t.getAll(n)))))return Kt("[nuqs `%s`] no change, returning previous",e.join(","),s),s;const i=ls(t,e,r);return Kt("[nuqs `%s`] subbed search params change\n  from %O\n  to   %O",e.join(","),s,i),i}}function ls(t,e,r){if(e.length===0)return t;const s=r?new URLSearchParams(t):t;for(const i of t.keys())e.includes(i)||s.delete(i);return s}let gr=0;function Wc(t=1){gr=t}function Vc(t=Xn){gr=Math.max(0,gr-1),!(gr>0)&&t()}function Xn(){Kt("[nuqs] Aborting queues"),di.abortAll(),_l.abort().forEach(t=>di.queuedQuerySync.emit(t))}const cs="__nuqs__";function Gc(t){if(t instanceof URL)return t.searchParams;if(t.startsWith("?"))return new URLSearchParams(t);try{return new URL(t,location.origin).searchParams}catch{return new URLSearchParams(t)}}function Kc(t){return typeof history>"u"?!1:history.nuqs?.version&&history.nuqs.version!=="2.8.9"?(console.error(ml(409),history.nuqs.version,"2.8.9",t),
105!1):!history.nuqs?.adapters?.includes(t)}function Xc(t){history.nuqs=history.nuqs??{version:"2.8.9",adapters:[]},history.nuqs.adapters.push(t)}function Yc(t,e){if(!Kc(e))return;let r=typeof location=="object"?location.search:"";t.on("update",a=>{const o=a.toString();r=o.length?"?"+o:""}),window.addEventListener("popstate",()=>{r=location.search,Xn()}),Kt("[nuqs %s] Patching history (%s adapter)","2.8.9",e);function s(a){Vc();try{if(new URL(a,location.origin).search===r)return}catch{}try{t.emit("update",Gc(a))}catch(o){console.error(o)}}const i=history.pushState,n=history.replaceState;history.pushState=function(o,l,d){i.call(history,o,"",d),d&&l!==cs&&s(d)},history.replaceState=function(o,l,d){n.call(history,o,"",d),d&&l!==cs&&s(d)},Xc(e)}function Jc({adapter:t,useNavigate:e,useSearchParams:r}){const s=bl();function i(a){const o=e();return{searchParams:n(a),updateUrl:S.useCallback((l,d)=>{S.startTransition(()=>{s.emit("update",l)});const u=new URL(location.href);u.search=xl(l),Kt(`[nuqs ${t}] Updating url: %s`,u);const h=d.history==="push"?history.pushState:history.replaceState;Wc(d.shallow?1:2),h.call(history,history.state,cs,u),d.shallow===!1&&o({hash:u.hash,search:u.search},{replace:!0,preventScrollReset:!0,state:history.state?.usr}),d.scroll&&window.scrollTo(0,0)},[o]),autoResetQueueOnUpdate:!1}}function n(a=[]){const[o]=r(typeof location>"u"?new URLSearchParams:new URLSearchParams(location.search)),[l,d]=S.useState(()=>typeof location>"u"?ls(o,a,!0):ls(new URLSearchParams(location.search),a,!1));return S.useEffect(()=>{function u(){S.startTransition(()=>{d(yi(new URLSearchParams(location.search),a,!1))})}function h(f){S.startTransition(()=>{d(yi(f,a,!0))})}return s.on("update",h),window.addEventListener("popstate",u),()=>{s.off("update",h),window.removeEventListener("popstate",u)}},[a.join("&")]),l}return Yc(s,t),{NuqsAdapter:yl(i),useOptimisticSearchParams:n}}const Zc=Jc({adapter:"react-router-v7",useNavigate:qe,useSearchParams:po}),Qc=Zc.NuqsAdapter;var v=typeof window<"u"?window:void 0,ne=typeof globalThis<"u"?globalThis:v;typeof self>"u"&&(ne.self=ne),typeof File>"u"&&(ne.File=function(){});var Yn=Array.prototype,bi=Yn.forEach,xi=Yn.indexOf,be=ne?.navigator,b=ne?.document,ie=ne?.location,us=ne?.fetch,ds=ne!=null&&ne.XMLHttpRequest&&"withCredentials"in new ne.XMLHttpRequest?ne.XMLHttpRequest:void 0,wi=ne?.AbortController,ve=be?.userAgent,C=v??{},ki="1.363.1",Se={DEBUG:!1,LIB_VERSION:ki,LIB_NAME:"web",JS_SDK_VERSION:ki};function Ei(t,e,r,s,i,n,a){try{var o=t[n](a),l=o.value}catch(d){return void r(d)}o.done?e(l):Promise.resolve(l).then(s,i)}function Me(t){return function(){var e=this,r=arguments;return new Promise((function(s,i){var n=t.apply(e,r);function a(l){Ei(n,s,i,a,o,"next",l)}function o(l){Ei(n,s,i,a,o,"throw",l)}a(void 0)}))}}function y(){return y=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var s in r)({}
vendor: 4,650 bytes, line 105
105).hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},y.apply(null,arguments)}function Jn(t,e){if(t==null)return{};var r={};for(var s in t)if({}.hasOwnProperty.call(t,s)){if(e.indexOf(s)!==-1)continue;r[s]=t[s]}return r}var eu=["$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"],tu=["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"],Si=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var r=t.toLowerCase();return tu.concat(e).some((s=>{var i=s.toLowerCase();return r.indexOf(i)!==-1}))};function O(t,e){return t.indexOf(e)!==-1}var Rr=function(t){return t.trim()},hs=function(t){return t.replace(/^\$/,"")},ru=Array.isArray,Zn=Object.prototype,Qn=Zn.hasOwnProperty,Mr=Zn.toString,F=ru||function(t){return Mr.call(t)==="[object Array]"},De=t=>typeof t=="function",ee=t=>t===Object(t)&&!F(t),vt=t=>{if(ee(t)){for(var e in t)if(Qn.call(t,e))return!1;return!0}return!1},w=t=>t===void 0,Z=t=>Mr.call(t)=="[object String]",ps=t=>Z(t)&&t.trim().length===0,Ce=t=>t===null,R=t=>w(t)||Ce(t),Oe=t=>Mr.call(t)=="[object Number]"&&t==t,ft=t=>Oe(t)&&t>0,Ue=t=>Mr.call(t)==="[object Boolean]",su=t=>t instanceof FormData,iu=t=>O(eu,t);function ea(t){return t===null||typeof t!="object"}function yr(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function Us(t){return!w(Event)&&(function(e,r){try{return e instanceof r}catch{return!1}})(t,Event)}var nu=[!0,"true",1,"1","yes"],qr=t=>O(nu,t),au=[!1,"false",0,"0","no"];function Te(t,e,r,s,i){return e>r&&(s.warn("min cannot be greater than max."),e=r),Oe(t)?t>r?(s.warn(" cannot be  greater than max: "+r+". Using max value instead."),r):t<e?(s.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(s.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+i),Te(i||r,e,r,s))}class ou{constructor(e){this.t={},this.i=e.i,this.o=Te(e.bucketSize,0,100,e.h),this.m=Te(e.refillRate,0,this.o,e.h),this.S=Te(e.refillInterval,0,864e5,e.h)}$(e,r){var s=r-e.lastAccess,i=Math.floor(s/this.S);if(i>0){var n=i*this.m;e.tokens=Math.min(e.tokens+n,this.o),e.lastAccess=e.lastAccess+i*this.S}}consumeRateLimit(e){var r,s=Date.now(),i=String(e),n=this.t[i];return n?this.$(n,s):(n={tokens:this.o,lastAccess:s},this.t[i]=n),n.tokens===0||(n.tokens--,n.tokens===0&&((r=this.i)==null||r.call(this,e)),n.tokens===0)}stop(){this.t={}}}var xe="Mobile",br="iOS",Le="Android",bt="Tablet",ta=Le+" "+bt,ra="iPad",sa="Apple",ia=sa+" Watch",Xt="Safari",xt="BlackBerry",na="Samsung",aa=na+"Browser",oa=na+" Internet",ct="Chrome",lu=ct+" OS",la=ct+" "+br,qs="Internet Explorer",ca=qs+" "+xe,Bs="Opera",cu=Bs+" Mini",zs="Edge",ua="Microsoft "+zs,mt="Firefox",da=mt+" "+br,Yt="Nintendo",Jt="PlayStation",yt="Xbox",ha=Le+" "+xe,pa=xe+" "+Xt,Ft="Windows",fs=Ft+" Phone",ji="Nokia",gs="Ouya",fa="Generic",uu=fa+" "+xe.toLowerCase(),ga=fa+" "+bt.toLowerCase(),vs="Konqueror",ce="(\\d+(\\.\\d+)?)",Br=new RegExp("Version/"+ce),du=new RegExp(yt,"i"),hu=new RegExp(Jt+" \\w+","i"),pu=new RegExp(Yt+" \\w+","i"),Hs=new RegExp(xt+"|PlayBook|BB10","i"),fu={"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"},lr,Ii,zr,gu=(t,e)=>e&&O(e,sa)||(function(r){return O(r,Xt)&&!O(r,ct)&&!O(r,Le)})(t),va=function(t,e){return e=e||"",O(t," OPR/")&&O(t,"Mini")?cu:O(t," OPR/")?Bs:Hs.test(t)?xt:O(t,"IE"+xe)||O(t,"WPDesktop")?ca:O(t,aa)?oa:O(t,zs)||O(t,"E
105dg/")?ua:O(t,"FBIOS")?"Facebook "+xe:O(t,"UCWEB")||O(t,"UCBrowser")?"UC Browser":O(t,"CriOS")?la:O(t,"CrMo")||O(t,ct)?ct:O(t,Le)&&O(t,Xt)?ha:O(t,"FxiOS")?da:O(t.toLowerCase(),vs.toLowerCase())?vs:gu(t,e)?O(t,xe)?pa:Xt:O(t,mt)?mt:O(t,"MSIE")||O(t,"Trident/")?qs:O(t,"Gecko")?mt:""},vu={[ca]:[new RegExp("rv:"+ce)],[ua]:[new RegExp(zs+"?\\/"+ce)],[ct]:[new RegExp("("+ct+"|CrMo)\\/"+ce)],[la]:[new RegExp("CriOS\\/"+ce)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+ce)],[Xt]:[Br],[pa]:[Br],[Bs]:[new RegExp("(Opera|OPR)\\/"+ce)],[mt]:[new RegExp(mt+"\\/"+ce)],[da]:[new RegExp("FxiOS\\/"+ce)],[vs]:[new RegExp("Konqueror[:/]?"+ce,"i")],[xt]:[new RegExp(xt+" "+ce),Br],[ha]:[new RegExp("android\\s"+ce,"i")],[oa]:[new RegExp(aa+"\\/"+ce)],[qs]:[new RegExp("(rv:|MSIE )"+ce)],Mozilla:[new RegExp("rv:"+ce)]},_u=function(t,e){var r=va(t,e),s=vu[r];if(w(s))return null;for(var i=0;i<s.length;i++){var n=s[i],a=t.match(n);if(a)return parseFloat(a[a.length-2])}return null},Ci=[[new RegExp(yt+"; "+yt+" (.*?)[);]","i"),t=>[yt,t&&t[1]||""]],[new RegExp(Yt,"i"),[Yt,""]],[new RegExp(Jt,"i"),[Jt,""]],[Hs,[xt,""]],[new RegExp(Ft,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[fs,""];if(new RegExp(xe).test(e)&&!/IEMobile\b/.test(e))return[Ft+" "+xe,""];var r=/Windows NT ([0-9.]+)/i.exec(e);if(r&&r[1]){var s=r[1],i=fu[s]||"";return/arm/i.test(e)&&(i="RT"),[Ft,i]}return[Ft,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[br,e.join(".")]}return[br,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=w(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+Le+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Le+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[Le,e.join(".")]}return[Le,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var r=[t[1],t[2],t[3]||"0"];e[1]=r.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[lu,""]],[/Linux|debian/i,["Linux",""]]],Ni=function(t){return pu.test(t)?Yt:hu.test(t)?Jt:du.test(t)?yt:new RegExp(gs,"i").test(t)?gs:new RegExp("("+fs+"|WPDesktop)","i").test(t)?fs:/iPad/.test(t)?ra:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ia:Hs.test(t)?xt:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(ji,"i").test(t)?ji:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(xe).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?Le:ta:new RegExp("(pda|"+xe+")","i").test(t)?uu:new RegExp(bt,"i").test(t)&&!new RegExp(bt+" pc","i").test(t)?ga:""},mu=t=>t instanceof Error;function yu(t){var e=globalThis._posthogChunkIds;if(e){var r=Object.keys(e);return zr&&r.length===Ii||(Ii=r.length,zr=r.reduce(((s,i)=>{lr||(lr={});var n=lr[i];if(n)s[n[0]]=n[1];else for(var a=t(i),o=a.length-1;o>=0;o--){var l=a[o],d=l?.filename,u=e[i];if(d&&u){s[d]=u,lr[i]=[d,u];break}}return s}),{})),zr}}class bu{constructor(e,r,s){s===void 0&&(s=[]),this.coercers=e,this.stackParser=r,this.modifiers=s}buildFromUnknown(e,r){r===void 0&&(r={});var s=r&&r.mechanism||{handled:!0,type:"generic"},i=this.buildCoercingContext(s,r,0).apply(e),n=this.buildParsingContext(r),a=this.parseStacktrace(i,n);return{$exception_list:this.convertToExceptionList(a,s),$exception_level:"error"}}modifyFrames(e){var r=this;return Me((function*(){for(var s of e)s.stacktrace&&s.stacktrace.frames&&F(s.stacktrace.frames)&&(s.stacktrace.frames=yield r.applyModifiers(s.stacktrace.frames));return e}))()}coerceFallback(e){var r;return{type:"Error",value:"Unknown error",stack:(r=e.syntheticException)==null?void 0:r.stack,synthetic:!0}}parseStacktrace(e,r){var s,i;return e.cause!=null&&(s=this.parseStacktrace(e.cause,r)),e.stack!=""&&e.stack!=null&&(i=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?r.skipFirstLines:0),r.chunkIdMap)),y({},e,{cause:s,stack:i})}applyChunkIds(e,r){return e.map((s=>
105(s.filename&&r&&(s.chunk_id=r[s.filename]),s)))}applyCoercers(e,r){for(var s of this.coercers)if(s.match(e))return s.coerce(e,r);return this.coerceFallback(r)}applyModifiers(e){var r=this;return Me((function*(){var s=e;for(var i of r.modifiers)s=yield i(s);return s}))()}convertToExceptionList(e,r){var s,i,n,a={type:e.type,value:e.value,mechanism:{type:(s=r.type)!==null&&s!==void 0?s:"generic",handled:(i=r.handled)===null||i===void 0||i,synthetic:(n=e.synthetic)!==null&&n!==void 0&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,y({},r,{handled:!0}))),o}buildParsingContext(e){var r;return{chunkIdMap:yu(this.stackParser),skipFirstLines:(r=e.skipFirstLines)!==null&&r!==void 0?r:1}}buildCoercingContext(e,r,s){s===void 0&&(s=0);var i=(n,a)=>{if(a<=4){var o=this.buildCoercingContext(e,r,a);return this.applyCoercers(n,o)}};return y({},r,{syntheticException:s==0?r.syntheticException:void 0,mechanism:e,apply:n=>i(n,s),next:n=>i(n,s+1)})}}var wt="?";function _s(t,e,r,s,i){var n={platform:t,filename:e,function:r==="<anonymous>"?wt:r,in_app:!0};return w(s)||(n.lineno=s),w(i)||(n.colno=i),n}var _a=(t,e)=>{var r=t.indexOf("safari-extension")!==-1,s=t.indexOf("safari-web-extension")!==-1;return r||s?[t.indexOf("@")!==-1?t.split("@")[0]:wt,r?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},xu=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,wu=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ku=/\((\S*)(?::(\d+))(?::(\d+))\)/,Eu=(t,e)=>{var r=xu.exec(t);if(r){var[,s,i,n]=r;return _s(e,s,wt,+i,+n)}var a=wu.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var o=ku.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,d]=_a(a[1]||wt,a[2]);return _s(e,d,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},Su=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ju=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Iu=(t,e)=>{var r=Su.exec(t);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var s=ju.exec(r[3]);s&&(r[1]=r[1]||"eval",r[3]=s[1],r[4]=s[2],r[5]="")}var i=r[3],n=r[1]||wt;return[n,i]=_a(n,i),_s(e,i,n,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Pi=/\(error: (.*)\)/,Ti=50;function Cu(){return(function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),s=1;s<e;s++)r[s-1]=arguments[s];return function(i,n){n===void 0&&(n=0);for(var a=[],o=i.split(`
106`),l=n;l<o.length;l++){var d=o[l];if(!(d.length>1024)){var u=Pi.test(d)?d.replace(Pi,"$1"):d;if(!u.match(/\S*Error: /)){for(var h of r){var f=h(u,t);if(f){a.push(f);break}}if(a.length>=Ti)break}}}return(function(g){if(!g.length)return[];var p=Array.from(g);return p.reverse(),p.slice(0,Ti).map((_=>{return y({},_,{filename:_.filename||(k=p,k[k.length-1]||{}).filename,function:_.function||wt});var k}))})(a)}})("web:javascript",Eu,Iu)}class Nu{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,r){var s=Z(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:s?e.stack:void 0,cause:e.cause?r.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var r=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?r+": "+e.message:r}isDOMException(e){return yr(e,"DOMException")}isDOMError(e){return yr(e,"DOMError")}}class Pu{match(e){return(r=>r instanceof Error)(e)}coerce(e,r){return{type:this.getType(e),value:this.getMessage(e,r),stack:this.getStack(e),cause:e.cause?r.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,r){var s=e.message;return s.error&&typeof s.error.message=="string"?String(s.error.message):String(s)}getStack(e){return e.stacktrace||e.stack||void 0}}class Tu{constructor(){}match(e){return yr(e,"ErrorEvent")&&e.error!=null}coerce(e,r){var s,i=r.apply(e.error);return i||{type:"ErrorEvent",value:e.message,stack:(s=r.syntheticException)==null?void 0:s.stack,synthetic:!0}}}var Ou=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class $u{match(e){return typeof e=="string"}coerce(e,r){var s,[i,n]=this.getInfos(e);return{type:i??"Error",value:n??e,stack:(s=r.syntheticException)==null?void 0:s.stack,synthetic:!0}}getInfos(e){var r="Error",s=e,i=e.match(Ou);return i&&(r=i[1],s=i[2]),[r,s]}}var Ru=["fatal","error","warning","log","info","debug"];function ma(t,e){e===void 0&&(e=40);var r=Object.keys(t);if(r.sort(),!r.length)return"[object has no keys]";for(var s=r.length;s>0;s--){var i=r.slice(0,s).join(", ");
106if(!(i.length>e))return s===r.length||i.length<=e?i:i.slice(0,e)+"..."}return""}class Mu{match(e){return typeof e=="object"&&e!==null}coerce(e,r){var s,i=this.getErrorPropertyFromObject(e);return i?r.apply(i):{type:this.getType(e),value:this.getValue(e),stack:(s=r.syntheticException)==null?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Us(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var r="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(r+=" with message: '"+e.message+"'"),r}if("message"in e&&typeof e.message=="string")return e.message;var s=this.getObjectClassName(e);return(s&&s!=="Object"?"'"+s+"'":"Object")+" captured as exception with keys: "+ma(e)}isSeverityLevel(e){return Z(e)&&!ps(e)&&Ru.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var s=e[r];if(mu(s))return s}}getObjectClassName(e){try{var r=Object.getPrototypeOf(e);return r?r.constructor.name:void 0}catch{return}}}class Au{match(e){return Us(e)}coerce(e,r){var s,i=e.constructor.name;return{type:i,value:i+" captured as exception with keys: "+ma(e),stack:(s=r.syntheticException)==null?void 0:s.stack,synthetic:!0}}}class Fu{match(e){return ea(e)}coerce(e,r){var s;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(s=r.syntheticException)==null?void 0:s.stack,synthetic:!0}}}class Du{match(e){return yr(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Us(e))return!1;try{var r=e.detail;return r!=null&&typeof r=="object"&&"reason"in r}catch{return!1}}coerce(e,r){var s,i=this.getUnhandledRejectionReason(e);return ea(i)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(i),stack:(s=r.syntheticException)==null?void 0:s.stack,synthetic:!0}:r.apply(i)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var ya=function(t,e){var{debugEnabled:r}=e===void 0?{}:e,s={k:function(i){if(v&&(Se.DEBUG||C.POSTHOG_DEBUG||r)&&!w(v.console)&&v.console){for(var n=("__rrweb_original__"in v.console[i])?v.console[i].__rrweb_original__:v.console[i],a=arguments.length,o=new Array(a>1?a-1:0),l=1;l<a;l++)o[l-1]=arguments[l];n(t,...o)}},info:function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];s.k("log",...n)},warn:function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];s.k("warn",...n)},error:function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];s.k("error",...n)},critical:function(){for(var i=arguments.length,n=new Array(i),a=0;a<i;a++)n[a]=arguments[a];console.error(t,...n)},uninitializedWarning:i=>{s.error("You must initialize PostHog before calling "+i)},createLogger:(i,n)=>ya(t+" "+i,n)};return s},x=ya("[PostHog.js]"),X=x.createLogger,Lu=X("[ExternalScriptsLoader]"),Oi=(t,e,r)=>{if(t.config.disable_external_dependency_loading)return Lu.warn(e+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var s=b?.querySelectorAll("script");if(s){for(var i,n=function(){if(s[a].src===e){var l=s[a];return l.__posthog_loading_callback_fired?{v:r()}:(l.addEventListener("load",(d=>{l.__posthog_loading_callback_fired=!0,r(void 0,d)})),l.onerror=d=>r(d),{v:void 0})}},a=0;a<s.length;a++)if(i=n())return i.v}var o=()=>{if(!b)return r("document not found");var l=b.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=h=>{l.__posthog_loading_callback_fired=!0,r(void 0,h)},l.onerror=h=>r(h),t.config.prepare_external_dependency_script&&(l=t.config.prepare_external_dependency_script(l)),!l)return r("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")b.head.appendChild(l);else{var d,u=b.querySelectorAll("body > script");u.length>0?(d=u[0].parentNode)==null||d.insertBefore(l,u[0]):b.body.appendChild(l)}};b!=null&&b.body?o():b?.addEventListener("DOMContentLoaded",o)};C.__PosthogExtensions__=C.__PosthogExtensions__||{},C.__PosthogExtensions__.loadExternalDependency=(t,e,r)=>{var s="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(s="/array/"+t.config.token+"/config.js"),e==="toolbar"){var i=3e5;
106s=s+"&t="+Math.floor(Date.now()/i)*i}var n=t.requestRouter.endpointFor("assets",s);Oi(t,n,r)},C.__PosthogExtensions__.loadSiteApp=(t,e,r)=>{var s=t.requestRouter.endpointFor("api",e);Oi(t,s,r)};var xr={};function Je(t,e,r){if(F(t)){if(bi&&t.forEach===bi)t.forEach(e,r);else if("length"in t&&t.length===+t.length){for(var s=0,i=t.length;s<i;s++)if(s in t&&e.call(r,t[s],s)===xr)return}}}function V(t,e,r){if(!R(t)){if(F(t))return Je(t,e,r);if(su(t)){for(var s of t.entries())if(e.call(r,s[1],s[0])===xr)return}else for(var i in t)if(Qn.call(t,i)&&e.call(r,t[i],i)===xr)return}}var Y=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),s=1;s<e;s++)r[s-1]=arguments[s];return Je(r,(function(i){for(var n in i)i[n]!==void 0&&(t[n]=i[n])})),t},kt=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),s=1;s<e;s++)r[s-1]=arguments[s];return Je(r,(function(i){Je(i,(function(n){t.push(n)}))})),t};function vr(t){for(var e=Object.keys(t),r=e.length,s=new Array(r);r--;)s[r]=[e[r],t[e[r]]];return s}var $i=function(t){try{return t()}catch{return}},Uu=function(t){return function(){try{for(var e=arguments.length,r=new Array(e),s=0;s<e;s++)r[s]=arguments[s];return t.apply(this,r)}catch(i){x.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),x.critical(i)}}},Ws=function(t){var e={};return V(t,(function(r,s){(Z(r)&&r.length>0||Oe(r))&&(e[s]=r)})),e};function qu(t,e){return r=t,s=n=>Z(n)&&!Ce(e)?n.slice(0,e):n,i=new Set,(function n(a,o){return a!==Object(a)?s?s(a,o):a:i.has(a)?void 0:(i.add(a),F(a)?(l=[],Je(a,(d=>{l.push(n(d))}))):(l={},V(a,((d,u)=>{i.has(d)||(l[u]=n(d,u))}))),l);var l})(r);var r,s,i}var Bu=["herokuapp.com","vercel.app","netlify.app"];function zu(t){var e=t?.hostname;if(!Z(e))return!1;var r=e.split(".").slice(-2).join(".");for(var s of Bu)if(r===s)return!1;return!0}function ba(t,e){for(var r=0;r<t.length;r++)if(e(t[r]))return t[r]}function J(t,e,r,s){var{capture:i=!1,passive:n=!0}=s??{};t?.addEventListener(e,r,{capture:i,passive:n})}function xa(t){return t.name==="ph_toolbar_internal"}var wa="$people_distinct_id",Dt="__alias",Lt="__timers",Ri="$autocapture_disabled_server_side",ms="$heatmaps_enabled_server_side",Mi="$exception_capture_enabled_server_side",ys="$error_tracking_suppression_rules",Ai="$error_tracking_capture_extension_exceptions",Fi="$web_vitals_enabled_server_side",ka="$dead_clicks_enabled_server_side",Di="$product_tours_enabled_server_side",Li="$web_vitals_allowed_metrics",cr="$session_recording_remote_config",wr="$sesid",Ea="$session_is_sampled",_t="$enabled_feature_flags",Ut="$early_access_features",bs="$feature_flag_details",qt="$stored_person_properties",at="$stored_group_properties",xs="$surveys",Wt="$flag_call_reported",ws="$flag_call_reported_session_id",ks="$feature_flag_errors",kr="$feature_flag_evaluated_at",Ie="$user_state",Es="$client_session_props",Ss="$capture_rate_limit",js="$initial_campaign_params",Is="$initial_referrer_info",Er="$initial_person_info",Sr="$epp",Sa="__POSTHOG_TOOLBAR__",Ct="$posthog_cookieless",Hu=[wa,Dt,"__cmpns",Lt,"$session_recording_enabled_server_side",ms,wr,_t,ys,Ie,Ut,bs,at,qt,xs,Wt,ws,ks,kr,Es,Ss,js,Is,Sr,Er];Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Oe(t)&&isFinite(t)&&Math.floor(t)===t});var Ui="0123456789abcdef";class jr{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,r,s,i){if(!Number.isInteger(e)||!Number.isInteger(r)||!Number.isInteger(s)||!Number.isInteger(i)||e<0||r<0||s<0||i<0||e>0xffffffffffff||r>4095||s>1073741823||i>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|r>>>8,n[7]=r,n[8]=128|s>>>24,n[9]=s>
vendor: 4,116 bytes, line 106
106>>16,n[10]=s>>>8,n[11]=s,n[12]=i>>>24,n[13]=i>>>16,n[14]=i>>>8,n[15]=i,new jr(n)}toString(){for(var e="",r=0;r<this.bytes.length;r++)e=e+Ui.charAt(this.bytes[r]>>>4)+Ui.charAt(15&this.bytes[r]),r!==3&&r!==5&&r!==7&&r!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new jr(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var r=0;r<16;r++){var s=this.bytes[r]-e.bytes[r];if(s!==0)return Math.sign(s)}return 0}}class Wu{constructor(){this.P=0,this.T=0,this.R=new Vu}generate(){var e=this.generateOrAbort();if(w(e)){this.P=0;var r=this.generateOrAbort();if(w(r))throw new Error("Could not generate UUID after timestamp reset");return r}return e}generateOrAbort(){var e=Date.now();if(e>this.P)this.P=e,this.I();else{if(!(e+1e4>this.P))return;this.T++,this.T>4398046511103&&(this.P++,this.I())}return jr.fromFieldsV7(this.P,Math.trunc(this.T/Math.pow(2,30)),this.T&Math.pow(2,30)-1,this.R.nextUint32())}I(){this.T=1024*this.R.nextUint32()+(1023&this.R.nextUint32())}}var qi,ja=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};v&&!w(v.crypto)&&crypto.getRandomValues&&(ja=t=>crypto.getRandomValues(t));class Vu{constructor(){this.C=new Uint32Array(8),this.O=1/0}nextUint32(){return this.O>=this.C.length&&(ja(this.C),this.O=0),this.C[this.O++]}}var Ye=()=>Gu().toString(),Gu=()=>(qi||(qi=new Wu)).generate(),Nt="",Ku=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Xu(t,e){if(e){var r=(function(i,n){if(n===void 0&&(n=b),Nt)return Nt;if(!n||["localhost","127.0.0.1"].includes(i))return"";for(var a=i.split("."),o=Math.min(a.length,8),l="dmn_chk_"+Ye();!Nt&&o--;){var d=a.slice(o).join("."),u=l+"=1;domain=."+d+";path=/";n.cookie=u+";max-age=3",n.cookie.includes(l)&&(n.cookie=u+";max-age=0",Nt=d)}return Nt})(t);if(!r){var s=(i=>{var n=i.match(Ku);return n?n[0]:""})(t);s!==r&&x.info("Warning: cookie subdomain discovery mismatch",s,r),r=s}return r?"; domain=."+r:""}return""}var Ne={F:()=>!!b,M:function(t){x.error("cookieStore error: "+t)},A:function(t){if(b){try{for(var e=t+"=",r=b.cookie.split(";").filter((n=>n.length)),s=0;s<r.length;s++){for(var i=r[s];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return decodeURIComponent(i.substring(e.length,i.length))}}catch{}return null}},D:function(t){var e;try{e=JSON.parse(Ne.A(t))||{}}catch{}return e},j:function(t,e,r,s,i){if(b)try{var n="",a="",o=Xu(b.location.hostname,s);if(r){var l=new Date;l.setTime(l.getTime()+24*r*60*60*1e3),n="; expires="+l.toUTCString()}i&&(a="; secure");var d=t+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+o+a;return d.length>3686.4&&x.warn("cookieStore warning: large cookie, len="+d.length),b.cookie=d,d}catch{return}},L:function(t,e){if(b!=null&&b.cookie)try{Ne.j(t,"",-1,e)}catch{return}}},Hr=null,K={F:function(){if(!Ce(Hr))return Hr;var t=!0;if(w(v))t=!1;else try{var e="__mplssupport__";K.j(e,"xyz"),K.A(e)!=='"xyz"'&&(t=!1),K.L(e)}catch{t=!1}return t||x.error("localStorage unsupported; falling back to cookie store"),Hr=t,t},M:function(t){x.error("localStorage error: "+t)},A:function(t){try{return v?.localStorage.getItem(t)}catch(e){K.M(e)}return null},D:function(t){try{return JSON.parse(K.A(t))||{}}catch{}return null},j:function(t,e){try{v?.localStorage.setItem(t,JSON.stringify(e))}catch(r){K.M(r)}},L:function(t){try{v?.localStorage.removeItem(t)}catch(e){K.M(e)}}},Yu=["$device_id","distinct_id",wr,Ea,Sr,Er,Ie],ur={},Ju={F:function(){return!0},M:function(t){x.error("memoryStorage error: "+t)},A:function(t){return ur[t]||null},D:function(t){return ur[t]||null},j:function(t,e){ur[t]=e},L:function(t){delete ur[t]}},rt=null,se={F:function(){if(!Ce(rt))return rt;if(rt=!0,w(v))rt=!1;else try{var t="__support__";se.j(t,"xyz"),se.A(t)!=='"xyz"'&&(rt=!1),se.L(t)}catch{rt=!1}return rt},M:function(t){x.error("sessionStorage error: ",t)},A:function(t){try{return v?.sessionStorage.getItem(t)}catch(e){se.M(e)}return null}
106,D:function(t){try{return JSON.parse(se.A(t))||null}catch{}return null},j:function(t,e){try{v?.sessionStorage.setItem(t,JSON.stringify(e))}catch(r){se.M(r)}},L:function(t){try{v?.sessionStorage.removeItem(t)}catch(e){se.M(e)}}},Ae=(function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t})({});class Zu{constructor(e){this._instance=e}get N(){return this._instance.config}get consent(){return this.U()?Ae.DENIED:this.H}isOptedOut(){return this.N.cookieless_mode==="always"||this.consent===Ae.DENIED||this.consent===Ae.PENDING&&(this.N.opt_out_capturing_by_default||this.N.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Ae.DENIED}optInOut(e){this.B.j(this.q,e?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.B.L(this.q,this.N.cross_subdomain_cookie)}get q(){var{token:e,opt_out_capturing_cookie_prefix:r,consent_persistence_name:s}=this._instance.config;return s||(r?r+e:"__ph_opt_in_out_"+e)}get H(){var e=this.B.A(this.q);return qr(e)?Ae.GRANTED:O(au,e)?Ae.DENIED:Ae.PENDING}get B(){if(!this.V){var e=this.N.opt_out_capturing_persistence_type;this.V=e==="localStorage"?K:Ne;var r=e==="localStorage"?Ne:K;r.A(this.q)&&(this.V.A(this.q)||this.optInOut(qr(r.A(this.q))),r.L(this.q,this.N.cross_subdomain_cookie))}return this.V}U(){return!!this.N.respect_dnt&&!!ba([be?.doNotTrack,be?.msDoNotTrack,C.doNotTrack],(e=>qr(e)))}}var dr=X("[Dead Clicks]"),Qu=()=>!0,ed=t=>{var e,r=!((e=t.instance.persistence)==null||!e.get_property(ka)),s=t.instance.config.capture_dead_clicks;return Ue(s)?s:!!ee(s)||r};class Bi{get lazyLoadedDeadClicksAutocapture(){return this.W}constructor(e,r,s){this.instance=e,this.isEnabled=r,this.onCapture=s,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[ka]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.G((()=>{this.Y()})):this.stop()}G(e){var r,s;(r=C.__PosthogExtensions__)!=null&&r.initDeadClicksAutocapture&&e(),(s=C.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"dead-clicks-autocapture",(i=>{i?dr.error("failed to load script",i):e()}))}Y(){var e;if(b){if(!this.W&&(e=C.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var r=ee(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};r.__onCapture=this.onCapture,this.W=C.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,r),this.W.start(b),dr.info("starting...")}}else dr.error("`document` not found. Cannot start.")}stop(){this.W&&(this.W.stop(),this.W=void 0,dr.info("stopping..."))}}var Wr=X("[SegmentIntegration]");function td(t,e){var r=t.config.segment;if(!r)return e();(function(s,i){var n=s.config.segment;if(!n)return i();var a=l=>{var d=()=>l.anonymousId()||Ye();s.config.get_device_id=d,l.id()&&(s.register({distinct_id:l.id(),$device_id:d()}),s.persistence.set_property(Ie,"identified")),i()},o=n.user();"then"in o&&De(o.then)?o.then(a):a(o)})(t,(()=>{r.register((s=>{Promise&&Promise.resolve||Wr.warn("This browser does not have Promise support, and can not use the segment integration");var i=(n,a)=>{if(!a)return n;n.event.userId||n.event.anonymousId===s.get_distinct_id()||(Wr.info("No userId set, resetting PostHog"),s.reset()),n.event.userId&&n.event.userId!==s.get_distinct_id()&&(Wr.info("UserId set, identifying with PostHog"),s.identify(n.event.userId));var o=s.calculateEventProperties(a,n.event.properties);return n.event.properties=Object.assign({},o,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:n=>i(n,n.event.event),page:n=>i(n,"$pageview"),identify:n=>i(n,"$identify"),screen:n=>i(n,"$screen")}})(t)).then((()=>{e()}))}))}var Ia="posthog-js";function Ca(t,e){var{organization:r,projectId:s,prefix:i,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return o=>{var l,d,u,h,f;if(!(n==="*"||n.includes(o.level))||!t.__loaded)return o;o.tags||(o.tags={});var g=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/pers
106on/"+t.get_distinct_id());o.tags["PostHog Person URL"]=g,t.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var p,_=((l=o.exception)==null?void 0:l.values)||[],k=_.map((E=>y({},E,{stacktrace:E.stacktrace?y({},E.stacktrace,{type:"raw",frames:(E.stacktrace.frames||[]).map((P=>y({},P,{platform:"web:javascript"})))}):void 0}))),m={$exception_message:((d=_[0])==null?void 0:d.value)||o.message,$exception_type:(u=_[0])==null?void 0:u.type,$exception_level:o.level,$exception_list:k,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((h=_[0])==null?void 0:h.value)||o.message,$sentry_exception_type:(f=_[0])==null?void 0:f.type,$sentry_tags:o.tags};return r&&s&&(m.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+o.event_id),a&&((p=t.exceptions)==null||p.sendExceptionEvent(m)),o}}class rd{constructor(e,r,s,i,n,a){this.name=Ia,this.setupOnce=function(o){o(Ca(e,{organization:r,projectId:s,prefix:i,severityAllowList:n,sendExceptionsToPostHog:a==null||a}))}}}class zi{constructor(e){this.J=(r,s,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(x.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:r,changeReason:i}),this.K=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.X()}X(){var e;this.Z=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.J)}destroy(){var e;(e=this.Z)==null||e.call(this),this.Z=void 0}doPageView(e,r){var s,i=this.tt(e,r);return this.K={pathname:(s=v?.location.pathname)!==null&&s!==void 0?s:"",pageViewId:r,timestamp:e},this._instance.scrollManager.resetContext(),i}doPageLeave(e){var r;return this.tt(e,(r=this.K)==null?void 0:r.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.K)==null?void 0:e.pageViewId}}tt(e,r){var s=this.K;if(!s)return{$pageview_id:r};var i={$pageview_id:r,$prev_pageview_id:s.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:l,maxContentHeight:d,lastContentY:u,maxContentY:h}=n;if(!(w(a)||w(o)||w(l)||w(d)||w(u)||w(h))){a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),d=Math.ceil(d),u=Math.ceil(u),h=Math.ceil(h);var f=a<=1?1:Te(o/a,0,1,x),g=a<=1?1:Te(l/a,0,1,x),p=d<=1?1:Te(u/d,0,1,x),_=d<=1?1:Te(h/d,0,1,x);i=Y(i,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:f,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:_})}}return s.pathname&&(i.$prev_pageview_pathname=s.pathname),s.timestamp&&(i.$prev_pageview_duration=(e.getTime()-s.timestamp.getTime())/1e3),i}}var Ir=t=>{var e=b?.createElement("a");return w(e)?null:(e.href=t,e)},sd=function(t,e){var r,s;e===void 0&&(e="&");var i=[];return V(t,(function(n,a){w(n)||w(a)||a==="undefined"||(r=encodeURIComponent((o=>o instanceof File)(n)?n.name:n.toString()),s=encodeURIComponent(a),i[i.length]=s+"="+r)})),i.join(e)},Cr=function(t,e){for(var r,s=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;i<s.length;i++){var n=s[i].split("=");if(n[0]===e){r=n;break}}if(!F(r)||r.length<2)return"";var a=r[1];try{a=decodeURIComponent(a)}catch{x.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Zt=function(t,e,r){if(!t||!e||!e.length)return t;for(var s=t.split("#"),i=s[0]||"",n=s[1],a=i.split("?"),o=a[1],l=a[0],d=(o||"").split("&"),u=[],h=0;h<d.length;h++){var f=d[h].split("=");F(f)&&(e.includes(f[0])?u.push(f[0]+"="+r):u.push(d[h]))}var g=l;return o!=null&&(g+="?"+u.join("&")),n!=null&&(g+="#"+n),g},Nr=function(t,e){var r=t.match(new RegExp(e+"=([^&]*)"));return r?r[1]:null},hr="https?://(.*)",Et=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],id=kt(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Et),Qt="<masked>",nd=["li_fat_id"];function Na(t,e,r){if(!b)return{};var s,i=e?kt([],Et,r||[]):[],n=Pa(Zt(b.URL,i,Qt),t),a=(s={},V(nd,(function(o){var l=Ne.A(o);s[o]=l||null})),s);return Y(a,n)}function Pa(t,e){var r=id.concat(e||[]),s={};return V(r,(function(i){var n=Cr(t,i);s[i]=n||null})),s}function Ta(t){var e=(function(n){return n?n.search(hr+"google.([^/?]*)")===0?"google":n.search(hr+"bing.com")===0?"bing":n.search(hr+"yaho
106o.com")===0?"yahoo":n.search(hr+"duckduckgo.com")===0?"duckduckgo":null:null})(t),r=e!="yahoo"?"q":"p",s={};if(!Ce(e)){s.$search_engine=e;var i=b?Cr(b.referrer,r):"";i.length&&(s.ph_keyword=i)}return s}function Hi(){return navigator.language||navigator.userLanguage}function Oa(){return b?.referrer||"$direct"}function $a(t,e){var r=t?kt([],Et,e||[]):[],s=ie?.href.substring(0,1e3);return{r:Oa().substring(0,1e3),u:s?Zt(s,r,Qt):void 0}}function Ra(t){var e,{r,u:s}=t,i={$referrer:r,$referring_domain:r==null?void 0:r=="$direct"?"$direct":(e=Ir(r))==null?void 0:e.host};if(s){i.$current_url=s;var n=Ir(s);i.$host=n?.host,i.$pathname=n?.pathname;var a=Pa(s);Y(i,a)}if(r){var o=Ta(r);Y(i,o)}return i}function Ma(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function ad(){try{return new Date().getTimezoneOffset()}catch{return}}function od(t,e){var r,s,i,n;if(!ve)return{};var a,o,l,d,u,h,f,g,p=t?kt([],Et,e||[]):[],[_,k]=(function(m){for(var E=0;E<Ci.length;E++){var[P,N]=Ci[E],$=P.exec(m),D=$&&(De(N)?N($,m):N);if(D)return D}return["",""]})(ve);return Y(Ws({$os:_,$os_version:k,$browser:va(ve,navigator.vendor),$device:Ni(ve),$device_type:(o=ve,l={userAgentDataPlatform:(r=navigator)==null||(r=r.userAgentData)==null?void 0:r.platform,maxTouchPoints:(s=navigator)==null?void 0:s.maxTouchPoints,screenWidth:v==null||(i=v.screen)==null?void 0:i.width,screenHeight:v==null||(n=v.screen)==null?void 0:n.height,devicePixelRatio:v?.devicePixelRatio},g=Ni(o),g===ra||g===ta||g==="Kobo"||g==="Kindle Fire"||g===ga?bt:g===Yt||g===yt||g===Jt||g===gs?"Console":g===ia?"Wearable":g?xe:l?.userAgentDataPlatform==="Android"&&((d=l?.maxTouchPoints)!==null&&d!==void 0?d:0)>
1060?Math.min((u=l?.screenWidth)!==null&&u!==void 0?u:0,(h=l?.screenHeight)!==null&&h!==void 0?h:0)/((f=l?.devicePixelRatio)!==null&&f!==void 0?f:1)>=600?bt:xe:"Desktop"),$timezone:Ma(),$timezone_offset:ad()}),{$current_url:Zt(ie?.href,p,Qt),$host:ie?.host,$pathname:ie?.pathname,$raw_user_agent:ve.length>1e3?ve.substring(0,997)+"...":ve,$browser_version:_u(ve,navigator.vendor),$browser_language:Hi(),$browser_language_prefix:(a=Hi(),typeof a=="string"?a.split("-")[0]:void 0),$screen_height:v?.screen.height,$screen_width:v?.screen.width,$viewport_height:v?.innerHeight,$viewport_width:v?.innerWidth,$lib:Se.LIB_NAME,$lib_version:Se.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var ld=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Vr{constructor(e,r){this.N=e,this.props={},this.it=!1,this.et=(s=>{var i="";return s.token&&(i=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+i+"_posthog"})(e),this.B=this.rt(e),this.load(),e.debug&&x.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,r),this.save()}isDisabled(){return!!this.st}rt(e){ld.indexOf(e.persistence.toLowerCase())===-1&&(x.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var r=(function(i){i===void 0&&(i=[]);var n=[...Yu,...i];return y({},K,{D:function(a){try{var o={};try{o=Ne.D(a)||{}}catch{}var l=Y(o,JSON.parse(K.A(a)||"{}"));return K.j(a,l),l}catch{}return null},j:function(a,o,l,d,u,h){try{K.j(a,o,void 0,void 0,h);var f={};n.forEach((g=>{o[g]&&(f[g]=o[g])})),Object.keys(f).length&&Ne.j(a,f,l,d,u,h)}catch(g){K.M(g)}},L:function(a,o){try{v?.localStorage.removeItem(a),Ne.L(a,o)}catch(l){K.M(l)}}})})(e.cookie_persisted_properties||[]),s=e.persistence.toLowerCase();return s==="localstorage"&&K.F()?K:s==="localstorage+cookie"&&r.F()?r:s==="sessionstorage"&&se.F()?se:s==="memory"?Ju:s==="cookie"?Ne:r.F()?r:Ne}nt(e){var r=e??this.N.feature_flag_cache_ttl_ms;if(!r||r<=0)return!1;var s=this.props[kr];return!s||typeof s!="number"||Date.now()-s>r}properties(){var e={};return V(this.props,((r,s)=>{if(s===_t&&ee(r)){if(!this.nt())for(var i=Object.keys(r),n=0;n<i.length;n++)e["$feature/"+i[n]]=r[i[n]]}else o=s,l=!1,(Ce(a=Hu)?l:xi&&a.indexOf===xi?a.indexOf(o)!=-1:(V(a,(function(d){if(l||(l=d===o))return xr})),l))||(e[s]=r);var a,o,l})),e}load(){if(!this.st){var e=this.B.D(this.et);e&&(this.props=Y({},e))}}save(){this.st||this.B.j(this.et,this.props,this.ot,this.ut,this.ht,this.N.debug)}remove(){this.B.L(this.et,!1),this.B.L(this.et,!0)}clear(){this.remove(),this.props={}}register_once(e,r,s){if(ee(e)){w(r)&&(r="None"),this.ot=w(s)?this.dt:s;var i=!1;if(V(e,((n,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==r||(this.props[a]=n,i=!0)})),i)return this.save(),!0}return!1}register(e,r){if(ee(e)){this.ot=w(r)?this.dt:r;var s=!1;if(V(e,((i,n)=>{e.hasOwnProperty(n)&&this.props[n]!==i&&(this.props[n]=i,s=!0)})),s)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.it){var e=Na(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);vt(Ws(e))||this.register(e),this.it=!0}}update_search_keyword(){var e;this.register((e=b?.referrer)?Ta(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Oa(),$referring_domain:b!=null&&b.referrer&&((e=Ir(b.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[js]||this.props[Is]||this.register_once({[Er]:$a(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};V([Is,js],(a=>{var o=this.props[a];o&&V(o,(function(l,d){e["$initial_"+hs(d)]=l}))}));var r,s,i=this.props[Er];if(i){var n=(r=Ra(i),s={},V(r,(function(a,o){s["$initial_"+hs(o)]=a})),s);Y(e,n)}return e}safe_merge(e){return V(this.props,(function(r,s){s in e||(e[s]=r)})),e}
106update_config(e,r,s){if(this.dt=this.ot=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!s),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==r.persistence||!((a,o)=>{if(a.length!==o.length)return!1;var l=[...a].sort(),d=[...o].sort();return l.every(((u,h)=>u===d[h]))})(e.cookie_persisted_properties||[],r.cookie_persisted_properties||[])){var i=this.rt(e),n=this.props;this.clear(),this.B=i,this.props=n,this.save()}}set_disabled(e){this.st=e,this.st?this.remove():this.save()}set_cross_subdomain(e){e!==this.ut&&(this.ut=e,this.remove(),this.save())}set_secure(e){e!==this.ht&&(this.ht=e,this.remove(),this.save())}set_event_timer(e,r){var s=this.props[Lt]||{};s[e]=r,this.props[Lt]=s,this.save()}remove_event_timer(e){var r=(this.props[Lt]||{})[e];return w(r)||(delete this.props[Lt][e],this.save()),r}get_property(e){return this.props[e]}set_property(e,r){this.props[e]=r,this.save()}}var Pt={Activation:"events",Cancellation:"cancelEvents"},Gr={Popover:"popover",API:"api",Widget:"widget"},Bt={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Kr={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},Cs={Popover:"popover",Inline:"inline"},cd=(function(t){return t.SHOWN="product tour shown",t.DISMISSED="product tour dismissed",t.COMPLETED="product tour completed",t.STEP_SHOWN="product tour step shown",t.STEP_COMPLETED="product tour step completed",t.BUTTON_CLICKED="product tour button clicked",t.STEP_SELECTOR_FAILED="product tour step selector failed",t.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",t.BANNER_ACTION_CLICKED="product tour banner action clicked",t})({}),Wi=(function(t){return t.TOUR_ID="$product_tour_id",t.TOUR_NAME="$product_tour_name",t.TOUR_ITERATION="$product_tour_iteration",t.TOUR_RENDER_REASON="$product_tour_render_reason",t.TOUR_STEP_ID="$product_tour_step_id",t.TOUR_STEP_ORDER="$product_tour_step_order",t.TOUR_STEP_TYPE="$product_tour_step_type",t.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",t.TOUR_BUTTON_TEXT="$product_tour_button_text",t.TOUR_BUTTON_ACTION="$product_tour_button_action",t.TOUR_BUTTON_LINK="$product_tour_button_link",t.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",t.TOUR_STEPS_COUNT="$product_tour_steps_count",t.TOUR_STEP_SELECTOR="$product_tour_step_selector",t.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",t.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",t.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",t.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",t.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",t.TOUR_ERROR="$product_tour_error",t.TOUR_MATCHES_COUNT="$product_tour_matches_count",t.TOUR_FAILURE_PHASE="$product_tour_failure_phase",t.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",t.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",t.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",t.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",t.USE_MANUAL_SELECTOR="$use_manual_selector",t.INFERENCE_DATA_PRESENT="$inference_data_present",t.TOUR_LAST_SEEN_DATE="$product_tour_last_seen_date",t.TOUR_TYPE="$product_tour_type",t})({}),Vi=X("[RateLimiter]");class ud{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var s=r.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach((i=>{Vi.info((i||"events")+" is quota limited."),this.serverLimits[i]=new Date().getTime()+6e4}))}catch(i){return void Vi.warn('could not rate limit - continuing. Error: "'+i?.message+'"',{text:s})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var r,s,i;e===void 0&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:a}=this,o=new Date().getTime(),l=(r=(s=this.instance.persistence)==null?void 0:s.get_property(Ss))!==null&&r!==void 0?r:{tokens:n,last:o};l.tokens+=(o-l.last)/1e3*a,l.last=o,l.tokens>n&&(l.tokens=n);var d=l.tokens<1;return d||e||(l.tokens=Math.max(0,l.tokens-1)),!d||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=d,(i=this.instance.persistence)==null||i.set_property(Ss,l),{isRateLimited:d,remainingTokens:l.tokens}
106}isServerRateLimited(e){var r=this.serverLimits[e||"events"]||!1;return r!==!1&&new Date().getTime()<r}}var Tt=X("[RemoteConfig]");class Aa{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=C._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}vt(e){var r,s;(r=C.__PosthogExtensions__)!=null&&r.loadExternalDependency?(s=C.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}ct(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:r=>{e(r.json)}})}load(){try{if(this.remoteConfig)return Tt.info("Using preloaded remote config",this.remoteConfig),this.ft(this.remoteConfig),void this._t();if(this._instance.bt())return void Tt.warn("Remote config is disabled. Falling back to local config.");this.vt((e=>{if(!e)return Tt.info("No config found after loading remote JS config. Falling back to JSON."),void this.ct((r=>{this.ft(r),this._t()}));this.ft(e),this._t()}))}catch(e){Tt.error("Error loading remote config",e)}}stop(){this.yt&&(clearInterval(this.yt),this.yt=void 0)}refresh(){this._instance.bt()||b?.visibilityState==="hidden"||this._instance.reloadFeatureFlags()}_t(){var e;if(!this.yt){var r=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;r!==0&&(this.yt=setInterval((()=>{this.refresh()}),r))}}ft(e){var r;e||Tt.error("Failed to fetch remote config from PostHog."),this._instance.ft(e??{}),e?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(r=this._instance.featureFlags)==null||r.ensureFlagsLoaded())}}var Fe=(function(t){return t.GZipJS="gzip-js",t.Base64="base64",t})({}),je=Uint8Array,me=Uint16Array,St=Uint32Array,Vs=new je([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]),Gs=new je([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]),Gi=new je([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Fa=function(t,e){for(var r=new me(31),s=0;s<31;++s)r[s]=e+=1<<t[s-1];var i=new St(r[30]);for(s=1;s<30;++s)for(var n=r[s];n<r[s+1];++n)i[n]=n-r[s]<<5|s;return[r,i]},Da=Fa(Vs,2),dd=Da[0],Ns=Da[1];dd[28]=258,Ns[258]=28;for(var Ki=Fa(Gs,0)[1],La=new me(32768),G=0;G<32768;++G){var st=(43690&G)>>>1|(21845&G)<<1;st=(61680&(st=(52428&st)>>>2|(13107&st)<<2))>>>4|(3855&st)<<4,La[G]=((65280&st)>>>8|(255&st)<<8)>>>1}var Vt=function(t,e,r){for(var s=t.length,i=0,n=new me(e);i<s;++i)++n[t[i]-1];var a,o=new me(e);for(i=0;i<e;++i)o[i]=o[i-1]+n[i-1]<<1;for(a=new me(s),i=0;i<s;++i)a[i]=La[o[t[i]-1]++]>>>15-t[i];return a},ut=new je(288);for(G=0;G<144;++G)ut[G]=8;for(G=144;G<256;++G)ut[G]=9;for(G=256;G<280;++G)ut[G]=7;for(G=280;G<288;++G)ut[G]=8;var Pr=new je(32);for(G=0;G<32;++G)Pr[G]=5;var hd=Vt(ut,9),pd=Vt(Pr,5),Ua=function(t){return(t/8>>0)+(7&t&&1)},qa=function(t,e,r){(r==null||r>t.length)&&(r=t.length);var s=new(t instanceof me?me:t instanceof St?St:je)(r-e);return s.set(t.subarray(e,r)),s},$e=function(t,e,r){r<<=7&e;var s=e/8>>0;t[s]|=r,t[s+1]|=r>>>8},Ot=function(t,e,r){r<<=7&e;var s=e/8>>0;t[s]|=r,t[s+1]|=r>>>8,t[s+2]|=r>>>16},Xr=function(t,e){for(var r=[],s=0;s<t.length;++s)t[s]&&r.push({s,f:t[s]});var i=r.length,n=r.slice();if(!i)return[new je(0),0];if(i==1){var a=new je(r[0].s+1);return a[r[0].s]=1,[a,1]}r.sort((function($,D){return $.f-D.f})),r.push({s:-1,f:25001});var o=r[0],l=r[1],d=0,u=1,h=2;for(r[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=i-1;)o=r[r[d].f<r[h].f?d++:h++],l=r[d!=u&&r[d].f<r[h].f?d++:h++],r[u++]={s:-1,f:o.f+l.f,l:o,r:l};var f=n[0].s;for(s=1;s<i;++s)n[s].s>f&&(f=n[s].s);var g=new me(f+1),p=Ps(r[u-1],g,0);if(p>e){s=0;var _=0,k=p-e,m=1<<k;for(n.sort((function($,D){return g[D.s]-g[$.s]||$.f-D.f}));s<i;++s){var E=n[s].s;if(!(g[E]>e))break;_+=m-(1<<p-g[E]),g[E]=e}for(_>>>=k;_>0;){var P=n[s].s;g[P]<e?_-=1<<e-g[P]++-1:++s}for(;s>=0&&_;--s){var N=n[s].s;g[N]==e&&(--g[N],++_)}p=e}return[new je(g),p]},Ps=function(t,e,r){return t.s==-1?Math.max(Ps(t.l,e,r+1),Ps(t.r,e,r+1)):e[t.s]=r},Xi=function(t){for(var e=t.length;e&&!t[--e];);for(var r=new me(++e),s=0,i=t[0],n=1,a=function(l){r[s++]=l},o=1;o<=e;++o)if(t[o]==i&&o!=e)++n;else{if(!i&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(i),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(i);n=1,i=t[o]}return[r.subarray(0,s),e]},$t=function(t,e){for(var r=0,s=0;s<e.length;++s)r+=t[s]*e[s];return r},Ts=function(t,e,r){var s=r.length,i=Ua(e+2);t[i]=255&s,t[i+1]=s>>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var n=0;n<s;++n)t[i+n+4]=r[n];return 8*(i+4+s)},Yi=function(t,e,r,s,i,n,a,o,l,d,u){$e(e,u++,r),++i[256];for(var h=Xr(i,15),f=h[0],g=h[1],p=Xr(n,15),_=p[0],k=p[1],m=Xi(f),E=m[0],P=m[1],N=Xi(_),$=N[0],D=N[1],I=new me(19),T=0;T<E.length;++T)I[31&E[T]]++;for(T=0;T<$.length;++T)I[31&$[T]]++;for(var U=Xr(I,7),W=U[0],B=U[1],Q=19;Q>4&&!W[Gi[Q-1]];--Q);var fe,re,le,we,ge=d+5<<3,j=$t(i,ut)+$t(n,Pr)+a,z=$t(i,f)+$t(n,_)+a+14+3*Q+$t(I,W)+(2*I[16]+3*I[17]+7*I[18]);if(ge<=j&&ge<=z)return Ts(e,u,t.subarray(l,l+d));if($e(e,u,1+(z<j)),u+=2,z<j){fe=Vt(f,g),re=f,le=Vt(_,k),we=_;var L=Vt(W,B);for($e(e,u,P-257),$e(e,u+5,D-1),$e(e,u+10,Q-4),u+=14,T=0;T<Q;++T)$e(e,u+3*T,W[Gi[T]]);u+=3*Q;for(var A=[E,$],q=0;q<2;++q){var ke=A[q];for(T=0;T<ke.length;++T){var ye=31&ke[T];$e(e,u,L[ye]),u+=W[ye],ye>15&&($e(e,u,ke[T]>>>5&127),u+=ke[T]>>>12)}}}else fe=hd,re=ut,le=pd,we=Pr;for(T=0;T<o;++T)if(s[T]>255){ye=s[T]>>>18&31,Ot(e,u,fe[ye+257]),u+=re[ye+257],ye>7&&($e(e,u,s[T]>>>23&31),u+=Vs[ye]);var dt=31&s[T];Ot(e,u,le[dt]),u+=we[dt],dt>3&&(Ot(e,u,s[T]>>>5&8191),u+=Gs[dt])}else Ot(e,u,fe[s[T]]),u+=re[s[T]];return Ot(e,u,fe[256]),u+re[256]},fd=new St([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),gd=(function(){for(var t=new St(256),e=0;e<256;++e){for(var r=e,s=9;--s;)r=(1&r&&3988292384)^r>>>1;t[e]=r}return t})(),vd=function(t,e,r,s,i){return(function(n,a,o,l,d,u){var h=n.length,f=new je(l+h+5*(1+Math.floor(h/7e3))+d),g=f.subarray(l,f.length-d),p=0;if(!a||h<8)for(var _=0;_<=h;_+=65535){var k=_+65535;k<h?p=Ts(g,p,n.subarray(_,k)):(g[_]=u,p=Ts(g,p,n.subarray(_,h)))}else{for(var m=fd[a-1],E=m>>>13,P=8191&m,N=(1<<o)-1,$=new me(32768),D=new me(N+1),I=Math.ceil(o/3),T=2*I,U=function(Lr){return(n[Lr]^n[Lr+1]<<I^n[Lr+2]<<T)&N},W=new St(25e3),B=new me(288),Q=new me(32),fe=0,re=0,le=(_=0,0),we=0,ge=0;_<h;++_){var j=U(_),z=32767&_,L=D[j];if($[z]=L,D[j]=z,we<=_){var A=h-_;if((fe>7e3||le>24576)&&A>423){p=Yi(n,g,0,W,B,Q,re,le,ge,_-ge,p),le=fe=re=0,ge=_;for(var q=0;q<286;++q)B[q]=0;for(q=0;q<30;++q)Q[q]=0}var ke=2,ye=0,dt=P,ze=z-L&32767;if(A>2&&j==U(_-ze))for(var ao=Math.min(E,A)-1,oo=Math.min(32767,_),lo=Math.min(258,A);ze<=oo&&--dt&&z!=L;){if(n[_+ke]==n[_+ke-ze]){for(var He=0;He<lo&&n[_+He]==n[_+He-ze];++He);
106if(He>ke){if(ke=He,ye=ze,He>ao)break;var co=Math.min(ze,He-2),Zs=0;for(q=0;q<co;++q){var Dr=_-ze+q+32768&32767,Qs=Dr-$[Dr]+32768&32767;Qs>Zs&&(Zs=Qs,L=Dr)}}}ze+=(z=L)-(L=$[z])+32768&32767}if(ye){W[le++]=268435456|Ns[ke]<<18|Ki[ye];var ei=31&Ns[ke],ti=31&Ki[ye];re+=Vs[ei]+Gs[ti],++B[257+ei],++Q[ti],we=_+ke,++fe}else W[le++]=n[_],++B[n[_]]}}p=Yi(n,g,u,W,B,Q,re,le,ge,_-ge,p)}return qa(f,0,l+Ua(p)+d)})(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,r,s,!0)},Yr=function(t,e,r){for(;r;++e)t[e]=r,r>>>=8};function _d(t,e){e===void 0&&(e={});var r=(function(){var o=4294967295;return{p:function(l){for(var d=o,u=0;u<l.length;++u)d=gd[255&d^l[u]]^d>>>8;o=d},d:function(){return 4294967295^o}}})(),s=t.length;r.p(t);var i,n=vd(t,e,10+((i=e).filename&&i.filename.length+1||0),8),a=n.length;return(function(o,l){var d=l.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=l.level<2?4:l.level==9?2:0,o[9]=3,l.mtime!=0&&Yr(o,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),d){o[3]=8;for(var u=0;u<=d.length;++u)o[u+10]=d.charCodeAt(u)}})(n,e),Yr(n,a-8,r.d()),Yr(n,a-4,s),n}var md=function(t){var e,r,s,i,n="";for(e=r=0,s=(t=(t+"").replace(/\r\n/g,`
107`).replace(/\r/g,`
108`)).length,i=0;i<s;i++){var a=t.charCodeAt(i),o=null;a<128?r++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),Ce(o)||(r>e&&(n+=t.substring(e,r)),n+=o,e=r=i+1)}return r>e&&(n+=t.substring(e,t.length)),n},yd=!!ds||!!us,Tr=function(t,e,r){var s;r===void 0&&(r=!0);var[i,n]=t.split("?"),a=y({},e),o=(s=n?.split("&").map((d=>{var u,[h,f]=d.split("="),g=r&&(u=a[h])!==null&&u!==void 0?u:f;return delete a[h],h+"="+g})))!==null&&s!==void 0?s:[],l=sd(a);return l&&o.push(l),i+"?"+o.join("&")},zt=(t,e)=>JSON.stringify(t,((r,s)=>typeof s=="bigint"?s.toString():s),e),Jr=t=>{var{data:e,compression:r}=t;if(e){if(r===Fe.GZipJS){var s=_d((function(o,l){var d=o.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var u=new je(o.length+(o.length>>>1)),h=0,f=function(k){u[h++]=k},g=0;g<d;++g){if(h+5>u.length){var p=new je(h+8+(d-g<<1));p.set(u),u=p}var _=o.charCodeAt(g);_<128||l?f(_):_<2048?(f(192|_>>>6),f(128|63&_)):_>55295&&_<57344?(f(240|(_=65536+(1047552&_)|1023&o.charCodeAt(++g))>>>18),f(128|_>>>12&63),f(128|_>>>6&63),f(128|63&_)):(f(224|_>>>12),f(128|_>>>6&63),f(128|63&_))}return qa(u,0,h)})(zt(e)),{mtime:0});return{contentType:"text/plain",body:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),estimatedSize:s.byteLength}}if(r===Fe.Base64){var i=(function(o){var l,d,u,h,f,g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p=0,_=0,k="",m=[];if(!o)return o;o=md(o);do l=(f=o.charCodeAt(p++)<<16|o.charCodeAt(p++)<<8|o.charCodeAt(p++))>>18&63,d=f>>12&63,u=f>>6&63,h=63&f,m[_++]=g.charAt(l)+g.charAt(d)+g.charAt(u)+g.charAt(h);while(p<o.length);switch(k=m.join(""),o.length%3){case 1:k=k.slice(0,-2)+"==";break;case 2:k=k.slice(0,-1)+"="}return k})(zt(e)),n=(o=>"data="+encodeURIComponent(typeof o=="string"?o:zt(o)))(i);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var a=zt(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},_r=[];us&&_r.push({transport:"fetch",method:t=>{var e,r,{contentType:s,body:i,estimatedSize:n}=(e=Jr(t))!==null&&e!==void 0?e:{},a=new Headers;V(t.headers,(function(u,h){a.append(h,u)})),s&&a.append("Content-Type",s);var o=t.url,l=null;if(wi){var d=new wi;l={signal:d.signal,timeout:setTimeout((()=>d.abort()),t.timeout)}}us(o,y({method:t?.method||"GET",headers:a,keepalive:t.method==="POST"&&(n||0)<52428.8,body:i,signal:(r=l)==null?void 0:r.signal},t.fetchOptions)).then((u=>u.text().then((h=>{var f={statusCode:u.status,text:h};if(u.status===200)try{f.json=JSON.parse(h)}catch(g){x.error(g)}t.callback==null||t.callback(f)})))).catch((u=>{x.error(u),t.callback==null||t.callback({statusCode:0,error:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),ds&&_r.push({transport:"XHR",method:t=>{var e,r=new ds;r.open(t.method||"GET",t.url,!0);var{contentType:s,body:i}=(e=Jr(t))!==null&&e!==void 0?e:{};V(t.headers,(function(n,a){r.setRequestHeader(a,n)})),s&&r.setRequestHeader("Content-Type",s),t.timeout&&(r.timeout=t.timeout),t.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(r.readyState===4){var n={statusCode:r.status,text:r.responseText};if(r.status===200)try{n.json=JSON.parse(r.responseText)}catch{}t.callback==null||t.callback(n)}},r.send(i)}}),be!=null&&be.sendBeacon&&_r.push({transport:"sendBeacon",method:t=>{var e=Tr(t.url,{beacon:"1"});try{var r,{contentType:s,body:i}=(r=Jr(t))!==null&&r!==void 0?r:{},n=typeof i=="string"?new Blob([i],{type:s}):i;be.sendBeacon(e,n)}catch{}}});var Os=3e3;class bd{constructor(e,r){this.wt=!0,this.Et=[],this.St=Te(r?.flush_interval_ms||Os,250,5e3,x.createLogger("flush interval"),Os),this.xt=e}enqueue(e){this.Et.push(e),this.$t||this.kt()}unload(){this.Pt();var e=this.Et.length>0?this.Tt():{},r=Object.values(e);[...r.filter((s=>s.url.indexOf("/e")===0)),...r.filter((s=>s.url.indexOf("/e")!==0))].map((s=>{this.xt(y({},s,{transport:"sendBeacon"}))}))}enable(){this.wt=!1,this.kt()}kt(){var e=this;this.wt||(this.$t=setTimeout((()=>
108{if(this.Pt(),this.Et.length>0){var r=this.Tt(),s=function(){var n=r[i],a=new Date().getTime();n.data&&F(n.data)&&V(n.data,(o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp})),e.xt(n)};for(var i in r)s()}}),this.St))}Pt(){clearTimeout(this.$t),this.$t=void 0}Tt(){var e={};return V(this.Et,(r=>{var s,i=r,n=(i?i.batchKey:null)||i.url;w(e[n])&&(e[n]=y({},i,{data:[]})),(s=e[n].data)==null||s.push(i.data)})),this.Et=[],e}}var xd=["retriesPerformedSoFar"];class wd{constructor(e){this.Rt=!1,this.It=3e3,this.Et=[],this._instance=e,this.Et=[],this.Ct=!0,!w(v)&&"onLine"in v.navigator&&(this.Ct=v.navigator.onLine,this.Ot=()=>{this.Ct=!0,this.Ft()},this.Mt=()=>{this.Ct=!1},J(v,"online",this.Ot),J(v,"offline",this.Mt))}get length(){return this.Et.length}retriableRequest(e){var{retriesPerformedSoFar:r}=e,s=Jn(e,xd);ft(r)&&(s.url=Tr(s.url,{retry_count:r})),this._instance._send_request(y({},s,{callback:i=>{i.statusCode!==200&&(i.statusCode<400||i.statusCode>=500)&&(r??0)<10?this.At(y({retriesPerformedSoFar:r},s)):s.callback==null||s.callback(i)}}))}At(e){var r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var s=(function(a){var o=3e3*Math.pow(2,a),l=o/2,d=Math.min(18e5,o),u=(Math.random()-.5)*(d-l);return Math.ceil(d+u)})(r),i=Date.now()+s;this.Et.push({retryAt:i,requestOptions:e});var n="Enqueued failed request for retry in "+s;navigator.onLine||(n+=" (Browser is offline)"),x.warn(n),this.Rt||(this.Rt=!0,this.Dt())}Dt(){if(this.jt&&clearTimeout(this.jt),this.Et.length===0)return this.Rt=!1,void(this.jt=void 0);this.jt=setTimeout((()=>{this.Ct&&this.Et.length>0&&this.Ft(),this.Dt()}),this.It)}Ft(){var e=Date.now(),r=[],s=this.Et.filter((n=>n.retryAt<e||(r.push(n),!1)));if(this.Et=r,s.length>0)for(var{requestOptions:i}of s)this.retriableRequest(i)}unload(){for(var{requestOptions:e}of(this.jt&&(clearTimeout(this.jt),this.jt=void 0),this.Rt=!1,w(v)||(this.Ot&&(v.removeEventListener("online",this.Ot),this.Ot=void 0),this.Mt&&(v.removeEventListener("offline",this.Mt),this.Mt=void 0)),this.Et))try{this._instance._send_request(y({},e,{transport:"sendBeacon"}))}catch(r){x.error(r)}this.Et=[]}}class kd{constructor(e){this.Lt=()=>{var r,s,i,n;this.Nt||(this.Nt={});var a=this.scrollElement(),o=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,d=o+(a?.clientHeight||0),u=a?.scrollHeight||0;this.Nt.lastScrollY=Math.ceil(o),this.Nt.maxScrollY=Math.max(o,(r=this.Nt.maxScrollY)!==null&&r!==void 0?r:0),this.Nt.maxScrollHeight=Math.max(l,(s=this.Nt.maxScrollHeight)!==null&&s!==void 0?s:0),this.Nt.lastContentY=d,this.Nt.maxContentY=Math.max(d,(i=this.Nt.maxContentY)!==null&&i!==void 0?i:0),this.Nt.maxContentHeight=Math.max(u,(n=this.Nt.maxContentHeight)!==null&&n!==void 0?n:0)},this._instance=e}getContext(){return this.Nt}resetContext(){var e=this.Nt;return setTimeout(this.Lt,0),e}startMeasuringScrollPosition(){J(v,"scroll",this.Lt,{capture:!0}),J(v,"scrollend",this.Lt,{capture:!0}),J(v,"resize",this.Lt)}scrollElement(){if(!this._instance.config.scroll_root_selector)return v?.document.documentElement;var e=F(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var r of e){var s=v?.document.querySelector(r);if(s)return s}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return v&&(v.scrollY||v.pageYOffset||v.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return v&&(v.scrollX||v.pageXOffset||v.document.documentElement.scrollLeft)||0}}var Ed=t=>$a(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties);class Ji{constructor(e,r,s,i){this.Ut=n=>{var a=this.zt();if(!a||a.sessionId!==n){var o={sessionId:n,props:this.Ht(this._instance)};this.Bt.register({[Es]:o})}},this._instance=e,this.qt=r,this.Bt=s,this.Ht=i||Ed,this.qt.onSessionId(this.Ut)}zt(){return this.Bt.props[Es]}getSetOnceProps(){var e,r=(e=this.zt())==null?void 0:e.props;return r?"r"in r?Ra(r):{$referring_domain:r.referringDomain,$pathname:r.initialPathName,utm_source:r.utm_source,utm_campaign:r.utm_campaign,utm_medium:r.utm_medium,utm_content:r.utm_content,utm_term:r.utm_term}:{}}getSessionProps(){var e={};return V(Ws(this.getSetOnceProps()),((r,s)=>{s==="$current_url"&&(s="url"),e["$session_entry_"+hs(s)]=r})),e}}class Ks{constructor(){this.Vt={},this.Vt={}}on(e,r){return this.Vt[e]||(this.Vt[e]=[]),this.Vt[e].push(r),()=>{this.Vt[e]=this.Vt[e].filter((s=>s!==r))}}emit(e,r){for(var s of this.Vt[e]||[])s(r);for(var i of this.Vt["*"]||[])i(e,r)}}var Zr=X("[SessionId]");class Zi{on(e,r){return this.Wt.on(e,r)}constructor(e,r,s){var i;if(this.Gt=[],this.Yt=void 0,this.Wt=new Ks,this.Jt=(u,h)=>!(!ft(u)||!ft(h))&&Math.abs(u-h)>
108this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=e.config,this.Bt=e.persistence,this.Kt=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Qt=r||Ye,this.Zt=s||Ye;var n=this.N.persistence_name||this.N.token,a=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Te(a,60,36e3,Zr.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ti(),this.ii="ph_"+n+"_window_id",this.ei="ph_"+n+"_primary_window_exists",this.ri()){var o=se.D(this.ii),l=se.D(this.ei);o&&!l?this.Kt=o:se.L(this.ii),se.j(this.ei,!0)}if((i=this.N.bootstrap)!=null&&i.sessionID)try{var d=(u=>{var h=u.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})(this.N.bootstrap.sessionID);this.si(this.N.bootstrap.sessionID,new Date().getTime(),d)}catch(u){Zr.error("Invalid sessionID in bootstrap",u)}this.ni()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return w(this.Gt)&&(this.Gt=[]),this.Gt.push(e),this.Xt&&e(this.Xt,this.Kt),()=>{this.Gt=this.Gt.filter((r=>r!==e))}}ri(){return this.N.persistence!=="memory"&&!this.Bt.st&&se.F()}oi(e){e!==this.Kt&&(this.Kt=e,this.ri()&&se.j(this.ii,e))}ai(){return this.Kt?this.Kt:this.ri()?se.D(this.ii):null}si(e,r,s){e===this.Xt&&r===this._sessionActivityTimestamp&&s===this._sessionStartTimestamp||(this._sessionStartTimestamp=s,this._sessionActivityTimestamp=r,this.Xt=e,this.Bt.register({[wr]:[r,e,s]}))}li(){var e=this.Bt.props[wr];return F(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.si(null,null,null)}destroy(){clearTimeout(this.ui),this.ui=void 0,this.Yt&&v&&(v.removeEventListener("beforeunload",this.Yt,{capture:!1}),this.Yt=void 0),this.Gt=[]}ni(){this.Yt=()=>{this.ri()&&se.L(this.ei)},J(v,"beforeunload",this.Yt,{capture:!1})}checkAndGetSessionAndWindowId(e,r){if(e===void 0&&(e=!1),r===void 0&&(r=null),this.N.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s=r||new Date().getTime(),[i,n,a]=this.li(),o=this.ai(),l=ft(a)&&Math.abs(s-a)>864e5,d=!1,u=!n,h=!u&&!e&&this.Jt(s,i);u||h||l?(n=this.Qt(),o=this.Zt(),Zr.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}}),a=s,d=!0):o||(o=this.Zt(),d=!0);var f=ft(i)&&e&&!l?i:s,g=ft(a)?a:new Date().getTime();return this.oi(o),this.si(n,f,g),e||this.ti(),d&&this.Gt.forEach((p=>p(n,o,d?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}:void 0))),{sessionId:n,windowId:o,sessionStartTimestamp:g,changeReason:d?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:i}}ti(){clearTimeout(this.ui),this.ui=setTimeout((()=>{var[e]=this.li();if(this.Jt(new Date().getTime(),e)){var r=this.Xt;this.resetSessionId(),this.Wt.emit("forcedIdleReset",{idleSessionId:r})}}),1.1*this.sessionTimeoutMs)}}var Ba=function(t,e){if(!t)return!1;var r=t.userAgent;if(r&&Si(r,e))return!0;try{var s=t?.userAgentData;if(s!=null&&s.brands&&s.brands.some((i=>Si(i?.brand,e))))return!0}catch{}return!!t.webdriver},Or=function(t,e){if(!(function(r){try{new RegExp(r)}catch{return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function Qi(t,e,r){return zt({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:r})}var za={exact:(t,e)=>e.some((r=>t.some((s=>r===s)))),is_not:(t,e)=>e.every((r=>t.every((s=>r!==s)))),regex:(t,e)=>e.some((r=>t.some((s=>Or(r,s))))),not_regex:(t,e)=>e.every((r=>t.every((s=>!Or(r,s))))),icontains:(t,e)=>e.map(pr).some((r=>t.map(pr).some((s=>r.includes(s))))),not_icontains:(t,e)=>e.map(pr).every((r=>t.map(pr).every((s=>!r.includes(s))))),gt:(t,e)=>e.some((r=>{var s=parseFloat(r);return!isNaN(s)&&t.some((i=>s>parseFloat(i)))})),lt:(t,e)=>e.some((r=>{var s=parseFloat(r);return!isNaN(s)&&t.some((i=>s<parseFloat(i)))}))},pr=t=>t.toLowerCase();function Ha(t,e){return!t||Object.entries(t).every((r=>{var[s,i]=r,n=e?.[s];if(w(n)||Ce(n))return!1;var a=[String(n)],o=za[i.operator];return!!o&&o(i.values,a)}))}var Ht=(function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t})({}),en="i.posthog.com";class Sd{constructor(e){this.hi={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,r=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return r||(r=this.apiHost.replace("."+en,".posthog.com")),r==="https://app.posthog.com"?"https://us.posthog.com":r}get region(){return this.hi[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hi[this.apiHost]=Ht.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.hi[this.apiHost]=Ht.EU:this.hi[this.apiHost]=Ht.CUSTOM),this.hi[this.apiHost]}endpointFor(e,r){if(r===void 0&&(r=""),r&&(r=r[0]==="/"?r:"/"+r),e==="ui")return this.uiHost+r;if(e==="flags")return this.flagsApiHost+r;if(this.region===Ht.CUSTOM)return this.apiHost+r;var s=en+r;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}var H=X("[Surveys]"),Wa="seenSurvey_",jd=(t,e)=>{var r="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(r="$survey_"+e+"/"+t.id+"/"+t.current_iteration),r},tn=t=>((e,r)=>{var s=""+e+r.id;return r.current_iteration&&r.current_iteration>0&&(s=""+e+r.id+"_"+r.current_iteration),s})(Wa,t),Id=[Gr.Popover,Gr.Widget,Gr.API],Cd={ignoreConditions:!1,ignoreDelay:!1,displayType:Cs.Popover}
108,Nd=X("[PostHog ExternalIntegrations]"),Pd={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Td{constructor(e){this._instance=e}G(e,r){var s;(s=C.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,e,(i=>{if(i)return Nd.error("failed to load script",i);r()}))}startIfEnabledOrStop(){var e=this,r=function(a){var o,l,d;!i||(o=C.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[a]||e.G(Pd[a],(()=>{var u;(u=C.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)})),!i&&(l=C.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((d=C.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[a])==null||d.stop())};for(var[s,i]of Object.entries((n=this._instance.config.integrations)!==null&&n!==void 0?n:{})){var n;r(s)}}}var Gt={},Qr=0,$s=()=>{},gt="posthog",Va=!yd&&ve?.indexOf("MSIE")===-1&&ve?.indexOf("Mozilla")===-1,rn=t=>{var e;return y({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:zu(b?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:$s,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:ie&&Z(ie?.search)&&ie.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:(v==null||(e=v.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:r=>{var s="Bad HTTP status: "+r.statusCode+" "+r.text;x.error(s)},get_device_id:r=>r,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:Os},error_tracking:{},_onCapture:$s,__preview_eager_load_replay:!1},(r=>({rageclick:!(r&&r>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(r&&r>="2025-05-24")||"history_change",session_recording:r&&r>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:r&&r>="2026-01-30"?"head":"body",internal_or_test_user_hostname:r&&r>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},sn=t=>{var e={};w(t.process_person)||(e.person_profiles=t.process_person),w(t.xhr_headers)||(e.request_headers=t.xhr_headers),w(t.cookie_name)||(e.persistence_name=t.cookie_name),w(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),w(t.store_google)||(e.save_campaign_params=t.store_google),w(t.verbose)||(e.debug=t.verbose);var r=Y({},e,t);return F(t.property_blacklist)&&(w(t.property_denylist)?r.property_denylist=t.property_blacklist:F(t.property_denylist)?r.property_denylist=[...t.property_blacklist,...t.property_denylist]:x.error("Invalid value for property_denylist config: "+t.property_denylist)),r};class Od{constructor(){this.__forceAllowLocalhost=!1}get di(){return this.__forceAllowLocalhost}set di(e){x.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Pe{vi(e,r){if(e){var s=this.ci.indexOf(e);s!==-1&&this.ci.splice(s,1)}return this.ci.push(r),r.initialize==null||r.initialize(),r}get decideEndpointWasHit(){var e,r;return(e=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,r;return(e=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){var e;this.webPerformance=new Od,this.fi=!1,this.version=Se.LIB_VERSION,this.pi=new Ks,this.ci=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=rn(),this.SentryIntegration=rd,this.sentryIntegration=s=>(function(i,n){var a=Ca(i,n);return{name:Ia,processEvent:o=>a(o)}})(this,s),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.gi=!1,this.mi=null,this.bi=null,this.yi=null,this.scrollManager=new kd(this),this.pageViewM
108anager=new zi(this),this.rateLimiter=new ud(this),this.requestRouter=new Sd(this),this.consent=new Zu(this),this.externalIntegrations=new Td(this);var r=(e=Pe.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=r.featureFlags&&new r.featureFlags(this),this.toolbar=r.toolbar&&new r.toolbar(this),this.surveys=r.surveys&&new r.surveys(this),this.conversations=r.conversations&&new r.conversations(this),this.logs=r.logs&&new r.logs(this),this.experiments=r.experiments&&new r.experiments(this),this.exceptions=r.exceptions&&new r.exceptions(this),this.people={set:(s,i,n)=>{var a=Z(s)?{[s]:i}:s;this.setPersonProperties(a),n?.({})},set_once:(s,i,n)=>{var a=Z(s)?{[s]:i}:s;this.setPersonProperties(void 0,a),n?.({})}},this.on("eventCaptured",(s=>x.info('send "'+s?.event+'"',s)))}init(e,r,s){if(s&&s!==gt){var i,n=(i=Gt[s])!==null&&i!==void 0?i:new Pe;return n._init(e,r,s),Gt[s]=n,Gt[gt][s]=n,n}return this._init(e,r,s)}_init(e,r,s){var i;if(r===void 0&&(r={}),w(e)||ps(e))return x.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},r.debug=this.wi(r.debug),this.Ei=r,this.Si=[],r.person_profiles?this.bi=r.person_profiles:r.process_person&&(this.bi=r.process_person),this.set_config(Y({},rn(r.defaults),sn(r),{name:s,token:e})),this.config.on_xhr_error&&x.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=r.disable_compression?void 0:Fe.GZipJS;var n=this.xi();this.persistence=new Vr(this.config,n),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Vr(y({},this.config,{persistence:"sessionStorage"}),n);var a=y({},this.persistence.props),o=y({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.$i=new bd((_=>this.ki(_)),this.config.request_queue_config),this.Pi=new wd(this),this.__request_queue=[];var l=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new Zi(this),this.sessionPropsManager=new Ji(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(x.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Ti(l)}),0)):(x.info("Initializing extensions synchronously"),this.Ti(l)),Se.DEBUG=Se.DEBUG||this.config.debug,Se.DEBUG&&x.info("Starting in debug mode",{this:this,config:r,thisC:y({},this.config),p:a,s:o}),((i=r.bootstrap)==null?void 0:i.distinctID)!==void 0){var d=r.bootstrap.distinctID,u=this.get_distinct_id(),h=this.persistence.get_property(Ie);if(r.bootstrap.isIdentifiedID&&u!=null&&u!==d&&h==="anonymous")this.identify(d);else if(r.bootstrap.isIdentifiedID&&u!=null&&u!==d&&h==="identified")x.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var f=this.config.get_device_id(Ye()),g=r.bootstrap.isIdentifiedID?f:d;this.persistence.set_property(Ie,r.bootstrap.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:d,$device_id:g})}}if(l)this.register_once({distinct_id:Ct,$device_id:null},"");else if(!this.get_distinct_id()){var p=this.config.get_device_id(Ye());this.register_once({distinct_id:p,$device_id:p},""),this.persistence.set_property(Ie,"anonymous")}return J(v,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),r.segment?td(this,(()=>this.Ri())):this.Ri(),De(this.config._onCapture)&&this.config._onCapture!==$s&&(x.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(_=>this.config._onCapture(_.event,_)))),this.config.ip&&x.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Ti(e){var r,s,i,n,a,o,l,d=performance.now(),u=y({},Pe.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.featureFlags&&this.ci.push(this.featureFlags=(r=this.featureFlags)!==null&&r!==void 0?r:new u.featureFlags(this)),u.exceptions&&this.ci.push(this.exceptions=(s=this.exceptions)!==null&&s!==void 0?s:new u.exceptions(this)),u.historyAutocapture&&this.ci.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.ci.push(new u.tracingHeaders(this)),u.siteApps&&this.ci.push(this.siteApps=new u.
108siteApps(this)),u.sessionRecording&&!e&&this.ci.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.ci.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.ci.push(this.surveys=(i=this.surveys)!==null&&i!==void 0?i:new u.surveys(this)),u.logs&&this.ci.push(this.logs=(n=this.logs)!==null&&n!==void 0?n:new u.logs(this)),u.conversations&&this.ci.push(this.conversations=(a=this.conversations)!==null&&a!==void 0?a:new u.conversations(this)),u.productTours&&this.ci.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.ci.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.ci.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.ci.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.ci.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,ed)),u.toolbar&&this.ci.push(this.toolbar=(o=this.toolbar)!==null&&o!==void 0?o:new u.toolbar(this)),u.experiments&&this.ci.push(this.experiments=(l=this.experiments)!==null&&l!==void 0?l:new u.experiments(this)),this.ci.forEach((f=>{f.initialize&&h.push((()=>{f.initialize==null||f.initialize()}))})),h.push((()=>{if(this.Ii){var f=this.Ii;this.Ii=void 0,this.ft(f)}})),this.Ci(h,d)}Ci(e,r){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-r>=30&&e.length>0)return void setTimeout((()=>{this.Ci(e,r)}),0);var s=e.shift();if(s)try{s()}catch(n){x.error("Error initializing extension:",n)}}var i=Math.round(performance.now()-r);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:i}),this.config.__preview_deferred_init_extensions&&x.info("PostHog extensions initialized ("+i+"ms)")}ft(e){var r;if(!b||!b.body)return x.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.ft(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Ii=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=O(e.supportedCompression,Fe.GZipJS)?Fe.GZipJS:O(e.supportedCompression,Fe.Base64)?Fe.Base64:void 0),(r=e.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.bi?this.bi:"identified_only"}),this.ci.forEach((s=>s.onRemoteConfig==null?void 0:s.onRemoteConfig(e)))}Ri(){try{this.config.loaded(this)}catch(s){x.critical("`loaded` function failed",s)}if(this.Oi(),this.config.internal_or_test_user_hostname&&ie!=null&&ie.hostname){var e=ie.hostname,r=this.config.internal_or_test_user_hostname;(typeof r=="string"?e===r:r.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Fi()}),1),this.Mi=new Aa(this),this.Mi.load()}Oi(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.$i)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Je(this.__request_queue,(e=>this.ki(e))),this.__request_queue=[],this.Oi()}_handle_unload(){var e,r,s;(e=this.surveys)==null||e.handlePageUnload(),this.config.request_batching?(this.Ai()&&this.capture("$pageleave"),(r=this.$i)==null||r.unload(),(s=this.Pi)==null||s.unload()):this.Ai()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Va?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Tr(e.url,{ip:this.config.ip?1:0}),e.headers=y({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(r=>{var s,i,n,a=y({},r);a.timeout=a.timeout||6e4,a.url=Tr(a.url,{_:new Date().getTime().toString(),ver:Se.JS_SDK_VERSION,compression:a.compression});var o=(s=a.transport)!==null&&s!==void 0?s:"fetch",l=_r.filter((u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport))),d=(i=(n=ba(l,(u=>
108u.transport===o)))==null?void 0:n.method)!==null&&i!==void 0?i:l[0].method;if(!d)throw new Error("No available transport method");d(a)})(y({},e,{callback:r=>{var s,i;this.rateLimiter.checkForLimiting(r),r.statusCode>=400&&((s=(i=this.config).on_request_error)==null||s.call(i,r)),e.callback==null||e.callback(r)}}))))}ki(e){this.Pi?this.Pi.retriableRequest(e):this._send_request(e)}_execute_array(e){Qr++;try{var r,s=[],i=[],n=[];Je(e,(o=>{o&&(r=o[0],F(r)?n.push(o):De(o)?o.call(this):F(o)&&r==="alias"?s.push(o):F(o)&&r.indexOf("capture")!==-1&&De(this[r])?n.push(o):i.push(o))}));var a=function(o,l){Je(o,(function(d){if(F(d[0])){var u=l;V(d,(function(h){u=u[h[0]].apply(u,h.slice(1))}))}else this[d[0]].apply(this,d.slice(1))}),l)};a(s,this),a(i,this),a(n,this)}finally{Qr--}}push(e){if(Qr>0&&F(e)&&Z(e[0])){var r=Pe.prototype[e[0]];De(r)&&r.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,r,s){var i;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!w(e)&&Z(e)){var n=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(n&&!this.config.__preview_capture_bot_pageviews)){var a=s!=null&&s.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){r!=null&&r.$current_url&&!Z(r?.$current_url)&&(x.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),r==null||delete r.$current_url),e!=="$exception"||s!=null&&s.Di||x.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var o=new Date,l=s?.timestamp||o,d=Ye(),u={uuid:d,event:e,properties:this.calculateEventProperties(e,r||{},l,d)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&n&&(u.event="$bot_pageview",u.properties.$browser_type="bot"),a&&(u.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),s?.$set&&(u.$set=s?.$set);var h,f=e!=="$groupidentify",g=e==="$identify",p=this.ji(s?.$set_once,f,g);if(p&&(u.$set_once=p),(u=qu(u,s!=null&&s._noTruncate?null:this.config.properties_string_max_length)).timestamp=l,w(s?.timestamp)||(u.properties.$event_time_override_provided=!0,u.properties.$event_time_override_system_time=o),e===Bt.DISMISSED||e===Bt.SENT){var _=r?.[Kr.SURVEY_ID],k=r?.[Kr.SURVEY_ITERATION];h={id:_,current_iteration:k},localStorage.getItem(tn(h))||localStorage.setItem(tn(h),"true"),u.$set=y({},u.$set,{[jd({id:_,current_iteration:k},e===Bt.SENT?"responded":"dismissed")]:!0})}else e===Bt.SHOWN&&(u.$set=y({},u.$set,{[Kr.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===cd.SHOWN){var m=r?.[Wi.TOUR_TYPE];m&&(u.$set=y({},u.$set,{[Wi.TOUR_LAST_SEEN_DATE+"/"+m]:new Date().toISOString()}))}var E=y({},u.properties.$set,u.$set);if(vt(E)||this.setPersonPropertiesForFlags(E),!R(this.config.before_send)){var P=this.Li(u);if(!P)return;u=P}
108this.pi.emit("eventCaptured",u);var N={method:"POST",url:(i=s?._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:u,compression:"best-available",batchKey:s?._batchKey};return!this.config.request_batching||s&&(s==null||!s._batchKey)||s!=null&&s.send_instantly?this.ki(N):this.$i.enqueue(N),u}x.critical("This capture call is ignored due to client rate limiting.")}}else x.error("No event name provided to posthog.capture")}else x.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",(r=>e(r.event,r)))}calculateEventProperties(e,r,s,i,n){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return r;var a=n?void 0:this.persistence.remove_event_timer(e),o=y({},r);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=y({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!Z(o.distinct_id)&&!Oe(o.distinct_id)||ps(o.distinct_id))&&x.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var d,u=od(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,s.getTime());o.$session_id=h,o.$window_id=f}this.sessionPropsManager&&Y(o,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&Y(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(g=this.Pi)==null?void 0:g.length}catch(m){o.$sdk_debug_error_capturing_properties=String(m)}if(this.requestRouter.region===Ht.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),d=e!=="$pageview"||n?e!=="$pageleave"||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,i),o=Y(o,d),e==="$pageview"&&b&&(o.title=b.title),!w(a)){var p=s.getTime()-a;o.$duration=parseFloat((p/1e3).toFixed(3))}ve&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=Y({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),F(this.config.property_denylist)?V(this.config.property_denylist,(function(m){delete o[m]})):x.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(x.error("sanitize_properties is deprecated. Use before_send instead"),o=_(o,e));var k=this.Ni();return o.$process_person_profile=k,k&&!n&&this.Ui("_calculate_event_properties"),o}ji(e,r,s){var i;if(r===void 0&&(r=!0),s===void 0&&(s=!1),!this.persistence||!this.Ni()||this.fi&&!s)return e;var n=this.persistence.get_initial_props(),a=(i=this.sessionPropsManager)==null?void 0:i.getSetOnceProps(),o=Y({},n,a||{},e||{}),l=this.config.sanitize_properties;return l&&(x.error("sanitize_properties is deprecated. Use before_send instead"),o=l(o,"$set_once")),r&&(this.fi=!0),vt(o)?void 0:o}register(e,r){var s;(s=this.persistence)==null||s.register(e,r)}register_once(e,r,s){var i;(i=this.persistence)==null||i.register_once(e,r,s)}register_for_session(e){var r;(r=this.sessionPersistence)==null||r.register(e)}unregister(e){var r;(r=this.persistence)==null||r.unregister(e)}unregister_for_session(e){var r;(r=this.sessionPersistence)==null||r.unregister(e)}zi(e,r){this.register({[e]:r})}getFeatureFlag(e,r){var s;return(s=this.featureFlags)==null?void 0:s.getFeatureFlag(e,r)}getFeatureFlagPayload(e){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagPayload(e)}getFeatureFlagResult(e,r){var s;return(s=this.featureFlags)==null?void 0:s.getFeatureFlagResult(e,r)}isFeatureEnabled(e,r){var s;return(s=this.featureFlags)==null?void 0:s.isFeatureEnabled(e,r)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,r,s){var i;(i=this.featureFlags)==null||i.updateFlags(e,r,s)}updateEarlyAccessFeatureEnrollment(e,r,s){var i;(i=this.featureFlags)==null||i.updateEarlyAccessFeatureEnrollment(e,r,s)}getEarlyAccessFeatures(e,r,s){var i;return r===void 0&&(r=!1),(i=this.featureFlags)==null?void 0:i.getEarlyAccessFeatures(e,r,s)}on(e,r){return this.pi.on(e,r)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:"Surveys module not available"}),()=>{})}onSessionId(e){var r,s;return(r=(s=this.sessionManager)==null?void 0:s.onSessionId(e))!==null&&r!==void 0?r:()=>{}}getSurveys(e,r){r===void 0&&(r=!1),this.surveys?this.surveys.getSurveys(e,r):e([],{isLoaded:!1,error:"Surveys module not available"})}getActiveMatchingSurveys(e,r){r===void 0&&(r=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,r):e([],{isLoaded:!1,error:"Surveys module not available"})}renderSurvey(e,r){var s;(s=this.surveys)==null||s.renderSurvey(e,r)}displaySurvey(e,r){var s;r===void 0&&(r=Cd),(s=this.surveys)==null||s.displaySurvey(e,r)}cancelPendingSurvey(e){var r;(r=this.surveys)==null||r.cancelPendingSurvey(e)}canRenderSurvey(e){var r,s;return(r=(s=this.surveys)==null?void 0:s.canRenderSurvey(e))!==null&&r!==void 0?r:{visible:!1,disabledReason:"Surveys module not available"}}canRenderSurveyAsync(e,r){var s,i;return r===void 0&&(r=!1),(s=(i=this.surveys)==null?void 0:i.canRenderSurveyAsync(e,r))!==null&&s!==void 0?s:Promise.resolve({visible:!1,disabledReason:"Surveys module not available"})}identify(e,r,s){if(!this.__loaded||!this.persistence)return x.uninitializedWarning("posthog.identify");if(Oe(e)&&(e=e.toString(),x.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))x.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
108ot a hardcoded string.');else if(e!==Ct){if(this.Ui("posthog.identify")){var i=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var n=i;this.register_once({$had_persisted_distinct_id:!0,$device_id:n},"")}e!==i&&e!==this.get_property(Dt)&&(this.unregister(Dt),this.register({distinct_id:e}));var a,o=(this.persistence.get_property(Ie)||"anonymous")==="anonymous";e!==i&&o?(this.persistence.set_property(Ie,"identified"),this.setPersonPropertiesForFlags(y({},s||{},r||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:i},{$set:r||{},$set_once:s||{}}),this.yi=Qi(e,r,s),(a=this.featureFlags)==null||a.setAnonymousDistinctId(i)):(r||s)&&this.setPersonProperties(r,s),e!==i&&(this.reloadFeatureFlags(),this.unregister(Wt))}}else x.critical('The string "'+Ct+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else x.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,r){if((e||r)&&this.Ui("posthog.setPersonProperties")){var s=Qi(this.get_distinct_id(),e,r);this.yi!==s?(this.setPersonPropertiesForFlags(y({},r||{},e||{})),this.capture("$set",{$set:e||{},$set_once:r||{}}),this.yi=s):x.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,r,s){if(e&&r){var i=this.getGroups();i[e]!==r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},i,{[e]:r})}),s&&(this.capture("$groupidentify",{$group_type:e,$group_key:r,$group_set:s}),this.setGroupPropertiesForFlags({[e]:s})),i[e]===r||s||this.reloadFeatureFlags()}else x.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,r){var s;r===void 0&&(r=!0),(s=this.featureFlags)==null||s.setPersonPropertiesForFlags(e,r)}resetPersonPropertiesForFlags(){var e;(e=this.featureFlags)==null||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,r){var s;r===void 0&&(r=!0),this.Ui("posthog.setGroupPropertiesForFlags")&&((s=this.featureFlags)==null||s.setGroupPropertiesForFlags(e,r))}resetGroupPropertiesForFlags(e){var r;(r=this.featureFlags)==null||r.resetGroupPropertiesForFlags(e)}reset(e){var r,s,i,n,a,o,l;if(x.info("reset"),!this.__loaded)return x.uninitializedWarning("posthog.reset");var d=this.get_property("$device_id");if(this.consent.reset(),(r=this.persistence)==null||r.clear(),(s=this.sessionPersistence)==null||s.clear(),(i=this.surveys)==null||i.reset(),(n=this.Mi)==null||n.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.persistence)==null||o.set_property(Ie,"anonymous"),(l=this.sessionManager)==null||l.resetSessionId(),this.yi=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Ct,$device_id:null},"");else{var u=this.config.get_device_id(Ye());this.register_once({distinct_id:u,$device_id:e?u:d},"")}this.register({$last_posthog_reset:new Date().toISOString()},1),this.reloadFeatureFlags()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,r;return(e=(r=this.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:r,sessionStartTimestamp:s}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+r);if(e!=null&&e.withTimestamp&&s){var n,a=(n=e.timestampLookBack)!==null&&n!==void 0?n:10;if(!s)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-s)/1e3)-a,0)}return i}alias(e,r){return e===this.get_property(wa)?(x.critical("Attempting to create alias for existing People user - aborting."),-2):this.Ui("posthog.alias")?(w(r)&&(r=this.get_distinct_id()),e!==r?(this.zi(Dt,e),this.capture("$create_alias",{alias:e,distinct_id:r})):(x.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var r=y({},this.config);if(ee(e)){var s,i,n,a,o,l,d,u,h;Y(this.config,sn(e));var f=this.xi();(s=this.persistence)==null||s.update_config(this.config,r,f),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Vr(y({},this.config,{persistence:"sessionStorage"}),f);var g=this.wi(this.config.debug);Ue(g)&&(this.config.debug=g),Ue(this.config.debug)&&(this.config.debug?(Se.DEBUG=!0,K.F()&&K.j("p
108h_debug",!0),x.info("set_config",{config:e,oldConfig:r,newConfig:y({},this.config)})):(Se.DEBUG=!1,K.F()&&K.L("ph_debug"))),(i=this.exceptionObserver)==null||i.onConfigChange(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),(a=this.autocapture)==null||a.startIfEnabled(),(o=this.heatmaps)==null||o.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(d=this.deadClicksAutocapture)==null||d.startIfEnabledOrStop(),(u=this.surveys)==null||u.loadIfEnabled(),this.Hi(),(h=this.externalIntegrations)==null||h.startIfEnabledOrStop()}}_overrideSDKInfo(e,r){Se.LIB_NAME=e,Se.LIB_VERSION=r}startSessionRecording(e){var r=e===!0,s={sampling:r||!(e==null||!e.sampling),linked_flag:r||!(e==null||!e.linked_flag),url_trigger:r||!(e==null||!e.url_trigger),event_trigger:r||!(e==null||!e.event_trigger)};if(Object.values(s).some(Boolean)){var i,n,a,o,l;(i=this.sessionManager)==null||i.checkAndGetSessionAndWindowId(),s.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),s.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),s.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("url")),s.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,r){if(this.exceptions){var s=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:s});return this.exceptions.sendExceptionEvent(y({},i,r))}}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var r,s;return(r=(s=this.toolbar)==null?void 0:s.loadToolbar(e))!==null&&r!==void 0&&r}get_property(e){var r;return(r=this.persistence)==null?void 0:r.props[e]}getSessionProperty(e){var r;return(r=this.sessionPersistence)==null?void 0:r.props[e]}toString(){var e,r=(e=this.config.name)!==null&&e!==void 0?e:gt;return r!==gt&&(r=gt+"."+r),r}_isIdentified(){var e,r;return((e=this.persistence)==null?void 0:e.get_property(Ie))==="identified"||((r=this.sessionPersistence)==null?void 0:r.get_property(Ie))==="identified"}Ni(){var e,r;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&vt(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Dt])&&((r=this.persistence)==null||(r=r.props)==null||!r[Sr]))}Ai(){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.Ni()||this.Ui("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Ui("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Ui(e){return this.config.person_profiles==="never"?(x.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.zi(Sr,!0),!0)}xi(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),r=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!r}Hi(){var e,r,s,i,n=this.xi();return((e=this.persistence)==null?void 0:e.st)!==n&&((s=this.persistence)==null||s.set_disabled(n)),((r=this.sessionPersistence)==null?void 0:r.st)!==n&&((i=this.sessionPersistence)==null||i.set_disabled(n)),n}opt_in_capturing(e){var r;if(this.config.cookieless_mode!=="always"){if(this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()){var s,i,n,a,o;this.reset(!0),(s=this.sessionManager)==null||s.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new Zi(this),this.pageViewManager=new zi(this),this.persistence&&(this.sessionPropsManager=new Ji(this,this.sessionManager,this.persistence));var l=(n=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&n!==void 0?n:(o=Pe.__defaultExtensionClasses)==null?void 0:o.sessionRecording;l&&(this.sessionRecording=this.vi(this.sessionRecording,new l(this)))}var d,u;this.consent.optInOut(!0),this.Hi(),this.Oi(),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&((d=this.surveys)==null||d.loadIfEnabled()),(w(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((u=e?.captureEventName)!==null&&u!==void 0?u:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Fi()}
vendor: 7,950 bytes, line 108
108else x.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,r,s;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Hi(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Ct,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(s=this.sessionRecording)==null||s.stopRecording(),this.sessionRecording=void 0,this.Fi())):x.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 e=this.consent.consent;return e===Ae.GRANTED?"granted":e===Ae.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.Hi()}_is_bot(){return be?Ba(be,this.config.custom_blocked_useragents):void 0}Fi(){b&&(b.visibilityState==="visible"?this.gi||(this.gi=!0,this.capture("$pageview",{title:b.title},{send_instantly:!0}),this.mi&&(b.removeEventListener("visibilitychange",this.mi),this.mi=null)):this.mi||(this.mi=this.Fi.bind(this),J(b,"visibilitychange",this.mi)))}debug(e){e===!1?(v?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(v?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}bt(){var e,r,s,i,n,a,o,l=this.Ei||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(x.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(s="advanced_disable_decide",i=!1,n=x,a=(r="advanced_disable_flags")in(e=l)&&!R(e[r]),o=s in e&&!R(e[s]),a?e[r]:o?(n&&n.warn("Config field '"+s+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),e[s]):i)}Li(e){if(R(this.config.before_send))return e;var r=F(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var i of r){if(s=i(s),R(s)){var n="Event '"+e.event+"' was rejected in beforeSend function";return iu(e.event)?x.warn(n+". This can cause unexpected behavior."):x.info(n),null}s.properties&&!vt(s.properties)||x.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return s}getPageViewId(){var e;return(e=this.pageViewManager.K)==null?void 0:e.pageViewId}captureTraceFeedback(e,r){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:r})}captureTraceMetric(e,r,s){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:r,$ai_metric_value:String(s)})}wi(e){var r=Ue(e)&&!e,s=K.F()&&K.A("ph_debug")==="true";return!r&&(!!s||e)}}Pe.__defaultExtensionClasses={},(function(t,e){for(var r=0;r<e.length;r++)t.prototype[e[r]]=Uu(t.prototype[e[r]])})(Pe,["identify"]);function nn(t){return t instanceof Element&&(t.id===Sa||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Ar(t){return!!t&&t.nodeType===1}function Ze(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Ga(t){return!!t&&t.nodeType===3}function Ka(t){return!!t&&t.nodeType===11}function Xs(t){return t?Rr(t).split(/\s+/):[]}function an(t){var e=v?.location.href;return!!(e&&t&&t.some((r=>e.match(r))))}function $r(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return Xs(e)}function Xa(t){return R(t)?null:Rr(t).split(/(\s+)/).filter((e=>er(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function sr(t){var e="";return Rs(t)&&!Qa(t)&&t.childNodes&&t.childNodes.length&&V(t.childNodes,(function(r){var s;Ga(r)&&r.textContent&&(e+=(s=Xa(r.textContent))!==null&&s!==void 0?s:"")})),Rr(e)}function on(t){return w(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Ys=["a","button","form","input","select","textarea","label"];function Ya(t,e){if(w(e))return!0;var r,s=function(n){if(e.some((a=>n.matches(a))))return{v:!0}};for(var i of t)if(r=s(i))return r.v;return!1}function Ja(t){var e=t.parentNode;return!(!e||!Ar(e))&&e}var $d=["next","previous","prev",">","<"],ln=10,cn=[".ph-no-rageclick",".ph-no-capture"];function Rd(t,e){if(!v||Js(t))return!1;var r,s,i;if(Ue(e)?(r=!!e&&cn,s=void 0):(r=(i=e?.css_selector_ignorelist)!==null&&i!==void 0?i:cn,s=e?.content_ignorelist),r===!1)return!1;var{targetElementList:n}=Za(t,!1);return!(function(a,o){if(a===!1||w(a))return!1;var l;if(a===!0)l=$d;else{if(!F(a))return!1;if(a.length>ln)return x.error("[PostHog] content_ignorelist array cannot exceed "+ln+" items. Use css_selector_ignorelist for more complex matching."),!1;l=a.map((d=>d.toLowerCase()))}return o.some((d=>{var{safeText:u,ariaLabel:h}=d;return l.some((f=>u.includes(f)||h.includes(f)))}))})(s,n.map((a=>{var o;return{safeText:sr(a).toLowerCase(),ariaLabel:((o=a.getAttribute("aria-label"))==null?void 0:o.toLowerCase().trim())||""}})))&&!Ya(n,r)}var Js=t=>!t||Ze(t,"html")||!Ar(t),Za=(t,e)=>{if(!v||Js(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,s=[t],i=t;i.parentNode&&!Ze(i,"body");)if(Ka(i.parentNode))s.push(i.parentNode.host),i=i.parentNode.host;else{var n=Ja(i);if(!n)break;if(e||Ys.indexOf(n.tagName.toLowerCase())>-1)r=!0;else{var a=v.getComputedStyle(n);a&&a.getPropertyValue("cursor")==="pointer"&&(r=!0)}s.push(n),i=n}return{parentIsUsefulElement:r,targetElementList:s}};function Md(t,e,r,s,i){var n,a,o,l;if(r===void 0&&(r=void 0),!v||Js(t)||(n=r)!=null&&n.url_allowlist&&!an(r.url_allowlist)||(a=r)!=null&&a.url_ignorelist&&an(r.url_ignorelist))return!1;if((o=r)!=null&&o.dom_event_allowlist){var d=r.dom_event_allowlist;if(d&&!d.some((p=>e.type===p)))return!1}var{parentIsUsefulElement:u,targetElementList:h}=Za(t,s);if(!(function(p,_){var k=_?.element_allowlist;if(w(k))return!0;var m,E=function(N){if(k.some(($=>N.tagName.toLowerCase()===$)))return{v:!0}};for(var P of p)if(m=E(P))return m.v;return!1})(h,r)||!Ya(h,(l=r)==null?void 0:l.css_selector_allowlist))return!1;var f=v.getComputedStyle(t);if(f&&f.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=t.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(i||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(e.type)>=0;default:return u?(i||["click"]).indexOf(e.type)>=0:(i||["click"]).indexOf(e.type)>=0&&(Ys.indexOf(g)>-1||t.getAttribute("contenteditable")==="true")}}function Rs(t){for(var e=t;e.parentNode&&!Ze(e,"body");e=e.parentNode){var r=$r(e);if(O(r,"ph-sensitive")||O(r,"ph-no-capture"))return!1}if(O($r(t),"ph-include"))return!0;var s=t.type||"";if(Z(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var i=t.name||t.id||"";return!(Z(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function Qa(t){return!!(Ze(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Ze(t,"select")||Ze(t,"textarea")||t.getAttribute("contenteditable")==="true")}var eo="(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}
108)|((?:2131|1800|35[0-9]{3})[0-9]{11})",Ad=new RegExp("^(?:"+eo+")$"),Fd=new RegExp(eo),to="\\d{3}-?\\d{2}-?\\d{4}",Dd=new RegExp("^("+to+")$"),Ld=new RegExp("("+to+")");function er(t,e){return e===void 0&&(e=!0),!(R(t)||Z(t)&&(t=Rr(t),(e?Ad:Fd).test((t||"").replace(/[- ]/g,""))||(e?Dd:Ld).test(t)))}function ro(t){var e=sr(t);return er(e=(e+" "+so(t)).trim())?e:""}function so(t){var e="";return t&&t.childNodes&&t.childNodes.length&&V(t.childNodes,(function(r){var s;if(r&&((s=r.tagName)==null?void 0:s.toLowerCase())==="span")try{var i=sr(r);e=(e+" "+i).trim(),r.childNodes&&r.childNodes.length&&(e=(e+" "+so(r)).trim())}catch(n){x.error("[AutoCapture]",n)}})),e}function Ud(t){return(function(e){var r=e.map((s=>{var i,n,a="";if(s.tag_name&&(a+=s.tag_name),s.attr_class)for(var o of(s.attr_class.sort(),s.attr_class))a+="."+o.replace(/"/g,"");var l=y({},s.text?{text:s.text}:{},{"nth-child":(i=s.nth_child)!==null&&i!==void 0?i:0,"nth-of-type":(n=s.nth_of_type)!==null&&n!==void 0?n:0},s.href?{href:s.href}:{},s.attr_id?{attr_id:s.attr_id}:{},s.attributes),d={};return vr(l).sort(((u,h)=>{var[f]=u,[g]=h;return f.localeCompare(g)})).forEach((u=>{var[h,f]=u;return d[un(h.toString())]=un(f.toString())})),a+=":",a+=vr(d).map((u=>{var[h,f]=u;return h+'="'+f+'"'})).join("")}));return r.join(";")})((function(e){return e.map((r=>{var s,i,n={text:(s=r.$el_text)==null?void 0:s.slice(0,400),tag_name:r.tag_name,href:(i=r.attr__href)==null?void 0:i.slice(0,2048),attr_class:qd(r),attr_id:r.attr__id,nth_child:r.nth_child,nth_of_type:r.nth_of_type,attributes:{}};return vr(r).filter((a=>{var[o]=a;return o.indexOf("attr__")===0})).forEach((a=>{var[o,l]=a;return n.attributes[o]=l})),n}))})(t))}function un(t){return t.replace(/"|\\"/g,'\\"')}function qd(t){var e=t.attr__class;return e?F(e)?e:Xs(e):void 0}class dn{constructor(e){this.disabled=e===!1;var r=ee(e)?e:{};this.thresholdPx=r.threshold_px||30,this.timeoutMs=r.timeout_ms||1e3,this.clickCount=r.click_count||3,this.clicks=[]}isRageClick(e,r,s){if(this.disabled)return!1;var i=this.clicks[this.clicks.length-1];if(i&&Math.abs(e-i.x)+Math.abs(r-i.y)<this.thresholdPx&&s-i.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:r,timestamp:s}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:r,timestamp:s}];return!1}}var es="$copy_autocapture",hn=X("[AutoCapture]");function ts(t,e){return e.length>t?e.slice(0,t)+"...":e}function Bd(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Ar(e));return e}function zd(t,e,r,s){var i=t.tagName.toLowerCase(),n={tag_name:i};Ys.indexOf(i)>-1&&!r&&(i.toLowerCase()==="a"||i.toLowerCase()==="button"?n.$el_text=ts(1024,ro(t)):n.$el_text=ts(1024,sr(t)));var a=$r(t);a.length>0&&(n.classes=a.filter((function(u){return u!==""}))),V(t.attributes,(function(u){var h;if((!Qa(t)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(s==null||!s.includes(u.name))&&!e&&er(u.value)&&(h=u.name,!Z(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var f=u.value;u.name==="class"&&(f=Xs(f).join(" ")),n["attr__"+u.name]=ts(1024,f)}}));for(var o=1,l=1,d=t;d=Bd(d);)o++,d.tagName===t.tagName&&l++;return n.nth_child=o,n.nth_of_type=l,n}function Hd(t,e){for(var r,s,{e:i,maskAllElementAttributes:n,maskAllText:a,elementAttributeIgnoreList:o,elementsC
108hainAsString:l}=e,d=[t],u=t;u.parentNode&&!Ze(u,"body");)Ka(u.parentNode)?(d.push(u.parentNode.host),u=u.parentNode.host):(d.push(u.parentNode),u=u.parentNode);var h,f=[],g={},p=!1,_=!1;if(V(d,(N=>{var $=Rs(N);N.tagName.toLowerCase()==="a"&&(p=N.getAttribute("href"),p=$&&p&&er(p)&&p),O($r(N),"ph-no-capture")&&(_=!0),f.push(zd(N,n,a,o));var D=(function(I){if(!Rs(I))return{};var T={};return V(I.attributes,(function(U){if(U.name&&U.name.indexOf("data-ph-capture-attribute")===0){var W=U.name.replace("data-ph-capture-attribute-",""),B=U.value;W&&B&&er(B)&&(T[W]=B)}})),T})(N);Y(g,D)})),_)return{props:{},explicitNoCapture:_};if(a||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?f[0].$el_text=ro(t):f[0].$el_text=sr(t)),p){var k,m;f[0].attr__href=p;var E=(k=Ir(p))==null?void 0:k.host,P=v==null||(m=v.location)==null?void 0:m.host;E&&P&&E!==P&&(h=p)}return{props:Y({$event_type:i.type,$ce_version:1},l?{}:{$elements:f},{$elements_chain:Ud(f)},(r=f[0])!=null&&r.$el_text?{$el_text:(s=f[0])==null?void 0:s.$el_text}:{},h&&i.type==="click"?{$external_click_url:h}:{},g)}}var Rt=X("[ExceptionAutocapture]");function pn(t,e,r){try{if(!(e in t))return()=>{};var s=t[e],i=r(s);return De(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=i,()=>{t[e]=s}}catch{return()=>{}}}var Wd=X("[TracingHeaders]"),Ve=X("[Web Vitals]"),fn=9e5,gn="disabled",vn="lazy_loading",Mt="awaiting_config",fr="missing_config";X("[SessionRecording]");var Ms="[SessionRecording]",it=X(Ms),Vd=X("[Heatmaps]");function _n(t){return ee(t)&&"clientX"in t&&"clientY"in t&&Oe(t.clientX)&&Oe(t.clientY)}var mn=X("[Product Tours]"),rs="ph_product_tours",Gd=["$set_once","$set"],Ge=X("[SiteApps]");function pt(t,e,r){if(R(t))return!1;switch(r){case"exact":return t===e;case"contains":var s=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(s,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class Kd{constructor(e){this.Bi=new Ks,this.qi=(r,s)=>this.Vi(r,s)&&this.Wi(r,s)&&this.Gi(r,s)&&this.Yi(r,s),this.Vi=(r,s)=>s==null||!s.event||r?.event===s?.event,this._instance=e,this.Ji=new Set,this.Ki=new Set}init(){var e;if(!w((e=this._instance)==null?void 0:e._addCaptureHook)){var r;(r=this._instance)==null||r._addCaptureHook(((s,i)=>{this.on(s,i)}))}}register(e){var r,s;if(!w((r=this._instance)==null?void 0:r._addCaptureHook)&&(e.forEach((a=>{var o,l;(o=this.Ki)==null||o.add(a),(l=a.steps)==null||l.forEach((d=>{var u;(u=this.Ji)==null||u.add(d?.event||"")}))})),(s=this._instance)!=null&&s.autocapture)){var i,n=new Set;e.forEach((a=>{var o;(o=a.steps)==null||o.forEach((l=>{l!=null&&l.selector&&n.add(l?.selector)}))})),(i=this._instance)==null||i.autocapture.setElementSelectors(n)}}on(e,r){var s;r!=null&&e.length!=0&&(this.Ji.has(e)||this.Ji.has(r?.event))&&this.Ki&&((s=this.Ki)==null?void 0:s.size)>0&&this.Ki.forEach((i=>{this.Xi(r,i)&&this.Bi.emit("actionCaptured",i.name)}))}Qi(e){this.onAction("actionCaptured",(r=>e(r)))}Xi(e,r){if(r?.steps==null)return!1;for(var s of r.steps)if(this.qi(e,s))return!0;return!1}onAction(e,r){return this.Bi.on(e,r)}Wi(e,r){if(r!=null&&r.url){var s,i=e==null||(s=e.properties)==null?void 0:s.$current_url;if(!i||typeof i!="string"||!pt(i,r.url,r.url_matching||"contains"))return!1}return!0}Gi(e,r){return!!this.Zi(e,r)&&!!this.te(e,r)&&!!this.ie(e,r)}Zi(e,r){var s;if(r==null||!r.href)return!0;var i=this.ee(e);if(i.length>0)return i.some((o=>pt(o.href,r.href,r.href_matching||"exact")));var n,a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";return!!a&&pt((n=a.match(/(?::|")href="(.*?)"/))?n[1]:"",r.href,r.href_matching||"exact")}te(e,r){var s;if(r==null||!r.text)return!0;var i=this.ee(e);if(i.length>0)return i.some((d=>pt(d.text,r.text,r.text_matching||"exact")||pt(d.$el_text,r.text,r.text_matching||"exact")));var n,a,o,l=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";return!!l&&(n=(function(d){for(var u,h=[],f=/(?::|")text="(.*?)"/g;!R(u=f.exec(d));)h.includes(u[1])||h.push(u[1]);return h})(l),a=r.text,o=r.text_matching||"exact",n.some((d=>pt(d,a,o))))}ie(e,r){var s,i;if(r==null||!r.selector)return!0;var n=e==null||(s=e.properties)==null?void 0:s.$element_selectors;if(n!=null&&n.includes(r.selector))return!0;var a=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";if(r.selector_regex&&a)try{return new RegExp(r.selector_regex).test(a)}catch{return!1}return!1}ee(e){var r;return(e==null||(r=e.properties)==null?void 0:r.$elements)==null?[]:e?.properties.$elements}Yi(e,r){return r==null||!r.properties||r.properties.length===0||Ha(r.properties.reduce(((s,i)=>{var n=F(i.value)?i.value.map(String):i.value!=null?[String(i.value)]:[];return s[i.key]={values:n,operator:i.operator||"exact"},s}),{}),e?.properties)}}class Xd{constructor(e){this._instance=e,this.re=new Map,this.se=new Map,this.ne=new Map}oe(e,r){return!!e&&Ha(e.propertyFilters,r?.properties)}ae(e,r){var s=new Map;return e.forEach((i=>{var n;(n=i.conditions)==null||(n=n[r])==null||(n=n.values)==null||n.forEac
108h((a=>{if(a!=null&&a.name){var o=s.get(a.name)||[];o.push(i.id),s.set(a.name,o)}}))})),s}le(e,r,s){var i=(s===Pt.Activation?this.re:this.se).get(e),n=[];return this.ue((a=>{n=a.filter((o=>i?.includes(o.id)))})),n.filter((a=>{var o,l=(o=a.conditions)==null||(o=o[s])==null||(o=o.values)==null?void 0:o.find((d=>d.name===e));return this.oe(l,r)}))}register(e){var r;w((r=this._instance)==null?void 0:r._addCaptureHook)||(this.he(e),this.de(e))}de(e){var r=e.filter((s=>{var i,n;return((i=s.conditions)==null?void 0:i.actions)&&((n=s.conditions)==null||(n=n.actions)==null||(n=n.values)==null?void 0:n.length)>0}));r.length!==0&&(this.ve==null&&(this.ve=new Kd(this._instance),this.ve.init(),this.ve.Qi((s=>{this.onAction(s)}))),r.forEach((s=>{var i,n,a,o,l;s.conditions&&(i=s.conditions)!=null&&i.actions&&(n=s.conditions)!=null&&(n=n.actions)!=null&&n.values&&((a=s.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((o=this.ve)==null||o.register(s.conditions.actions.values),(l=s.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach((d=>{if(d&&d.name){var u=this.ne.get(d.name);u&&u.push(s.id),this.ne.set(d.name,u||[s.id])}})))})))}he(e){var r,s=e.filter((n=>{var a,o;return((a=n.conditions)==null?void 0:a.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0})),i=e.filter((n=>{var a,o;return((a=n.conditions)==null?void 0:a.cancelEvents)&&((o=n.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0}));(s.length!==0||i.length!==0)&&((r=this._instance)==null||r._addCaptureHook(((n,a)=>{this.onEvent(n,a)})),this.re=this.ae(e,Pt.Activation),this.se=this.ae(e,Pt.Cancellation))}onEvent(e,r){var s,i=this.ce(),n=this.fe(),a=this.pe(),o=((s=this._instance)==null||(s=s.persistence)==null?void 0:s.props[n])||[];if(a===e&&r&&o.length>0){var l,d;i.info("event matched, removing item from activated items",{event:e,eventPayload:r,existingActivatedItems:o});var u=(r==null||(l=r.properties)==null?void 0:l.$survey_id)||(r==null||(d=r.properties)==null?void 0:d.$product_tour_id);if(u){var h=o.indexOf(u);h>=0&&(o.splice(h,1),this._e(o))}}else{if(this.se.has(e)){var f=this.le(e,r,Pt.Cancellation);f.length>0&&(i.info("cancel event matched, cancelling items",{event:e,itemsToCancel:f.map((p=>p.id))}),f.forEach((p=>{var _=o.indexOf(p.id);_>=0&&o.splice(_,1),this.ge(p.id)})),this._e(o))}if(this.re.has(e)){i.info("event name matched",{event:e,eventPayload:r,items:this.re.get(e)});var g=this.le(e,r,Pt.Activation);this._e(o.concat(g.map((p=>p.id))||[]))}}}onAction(e){var r,s=this.fe(),i=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[s])||[];this.ne.has(e)&&this._e(i.concat(this.ne.get(e)||[]))}_e(e){var r,s=this.ce(),i=this.fe(),n=[...new Set(e)].filter((a=>!this.me(a)));s.info("updating activated items",{activatedItems:n}),(r=this._instance)==null||(r=r.persistence)==null||r.register({[i]:n})}getActivatedIds(){var e,r=this.fe(),s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[r];return s||[]}getEventToItemsMap(){return this.re}be(){return this.ve}}class Yd extends Xd{constructor(e){super(e)}fe(){return"$surveys_activated"}pe(){return Bt.SHOWN}ue(e){var r;(r=this._instance)==null||r.getSurveys(e)}ge(e){var r;(r=this._instance)==null||r.cancelPendingSurvey(e)}ce(){return H}me(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var Jd=v!=null&&v.location?Nr(v.location.hash,"__posthog")||Nr(location.hash,"state"):null,yn="_postHogToolbarParams",bn=X("[Toolbar]"),Xe=(function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t})(Xe||{}),ue=X("[FeatureFlags]"),nt=X("[FeatureFlags]",{debugEnabled:!0}),Zd="errors_while_computing_flags",Qd="flag_missing",eh="quota_limited",th="timeout",rh="connection_error",sh="unknown_error",ih=t=>"api_error_"+t,ss="$active_feature_flags",Ke="$override_feature_flags",xn="$feature_flag_payloads",At="$override_feature_flag_payloads",wn="$feature_flag_request_id",kn=t=>{for(var e={},r=0;r<t.length;r++)e[t[r]]=!0;return e},En=t=>{var e={};for(var[r,s]of vr(t||{}))s&&(e[r]=s);return e},nh=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map((r=>{var s;return[r,(s=e[r].variant)!==null&&s!==void 0?s:e[r].enabled]}))),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter((r=>e[r].enabled)).filter((r=>{var s;return(s=e[r].metadata)==null?void 0:s.payload})).map((r=>{var s;return[r,(s=e[r].metadata)==null?void 0:s.payload]})))):ue.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},ah=(function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t})({}),is=X("[Error tracking]"),oh={icontains:(t,e)=>!!v&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!v&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!v&&Or(e.href,t),not_regex:(t,e)=>!!v&&!Or(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class oe{constructor(e){var r=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(s){s===void 0&&(s=!1),r.getWebExperiments((i=>{oe.ye("retrieved web experiments from the server"),r.we=new Map,i.forEac
108h((n=>{if(n.feature_flag_key){var a;r.we&&(oe.ye("setting flag key ",n.feature_flag_key," to web experiment ",n),(a=r.we)==null||a.set(n.feature_flag_key,n));var o=r._instance.getFeatureFlag(n.feature_flag_key);Z(o)&&n.variants[o]&&r.Ee(n.name,o,n.variants[o].transforms)}else if(n.variants)for(var l in n.variants){var d=n.variants[l];oe.Se(d)&&r.Ee(n.name,l,d.transforms)}}))}),s)},this._instance=e,this._instance.onFeatureFlags((s=>{this.onFeatureFlags(s)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())oe.ye("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(R(this.we))return this.we=new Map,this.loadIfEnabled(),void this.previewWebExperiment();oe.ye("applying feature flags",e),e.forEach((r=>{var s;if(this.we&&(s=this.we)!=null&&s.has(r)){var i,n=this._instance.getFeatureFlag(r),a=(i=this.we)==null?void 0:i.get(r);n&&a!=null&&a.variants[n]&&this.Ee(a.name,n,a.variants[n].transforms)}}))}}previewWebExperiment(){var e=oe.getWindowLocation();if(e!=null&&e.search){var r=Cr(e?.search,"__experiment_id"),s=Cr(e?.search,"__experiment_variant");r&&s&&(oe.ye("previewing web experiments "+r+" && "+s),this.getWebExperiments((i=>{this.xe(parseInt(r),s,i)}),!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,r,s){if(this._instance.config.disable_web_experiments&&!s)return e([]);var i=this._instance.get_property("$web_experiments");if(i&&!r)return e(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:n=>{if(n.statusCode!==200||!n.json)return e([]);var a=n.json.experiments||[];return e(a)}})}xe(e,r,s){var i=s.filter((n=>n.id===e));i&&i.length>0&&(oe.ye("Previewing web experiment ["+i[0].name+"] with variant ["+r+"]"),this.Ee(i[0].name,r,i[0].variants[r].transforms))}static Se(e){return!R(e.conditions)&&oe.$e(e)&&oe.ke(e)}static $e(e){var r;if(R(e.conditions)||R((r=e.conditions)==null?void 0:r.url))return!0;var s,i,n,a=oe.getWindowLocation();return!!a&&((s=e.conditions)==null||!s.url||oh[(i=(n=e.conditions)==null?void 0:n.urlMatchType)!==null&&i!==void 0?i:"icontains"](e.conditions.url,a))}
108static getWindowLocation(){return v?.location}static ke(e){var r;if(R(e.conditions)||R((r=e.conditions)==null?void 0:r.utm))return!0;var s=Na();if(s.utm_source){var i,n,a,o,l,d,u,h,f=(i=e.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((n=e.conditions)==null||(n=n.utm)==null?void 0:n.utm_campaign)==s.utm_campaign,g=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==s.utm_source,p=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((d=e.conditions)==null||(d=d.utm)==null?void 0:d.utm_medium)==s.utm_medium,_=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==s.utm_term;return f&&p&&_&&g}return!1}static ye(e){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];x.info("[WebExperiments] "+e,s)}Ee(e,r,s){this._is_bot()?oe.ye("Refusing to render web experiment since the viewer is a likely bot"):r!=="control"?s.forEach((i=>{if(i.selector){var n;oe.ye("applying transform of variant "+r+" for experiment "+e+" ",i);var a=(n=document)==null?void 0:n.querySelectorAll(i.selector);a?.forEach((o=>{var l=o;i.html&&(l.innerHTML=i.html),i.css&&l.setAttribute("style",i.css)}))}})):oe.ye("Control variants leave the page unmodified.")}_is_bot(){return be&&this._instance?Ba(be,this._instance.config.custom_blocked_useragents):void 0}}var Ee=X("[Conversations]"),Fr={featureFlags:class{constructor(t){this.Pe=!1,this.Te=!1,this.Re=!1,this.Ie=!1,this.Ce=!1,this.Oe=!1,this.Fe=!1,this.Me=!1,this._instance=t,this.featureFlagEventHandlers=[]}Ae(){var t,e;return(t=(e=this._instance.persistence)==null?void 0:e.nt(this._instance.config.feature_flag_cache_ttl_ms))!==null&&t!==void 0&&t}De(){return!!this.Ae()&&(this.Me||this.Re||(this.Me=!0,ue.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}je(){var t,e=(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.Fe||(ue.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Fe=!0),e!=null&&e.length?e.filter((r=>{var s=r&&typeof r=="string"&&r.trim().length>0;return s||ue.error("Invalid evaluation context found:",r,"Expected non-empty string"),s})):[]}Le(){return this.je().length>0}initialize(){var t,e,{config:r}=this._instance,s=(t=(e=r.bootstrap)==null?void 0:e.featureFlags)!==null&&t!==void 0?t:{};if(Object.keys(s).length){var i,n,a=(i=(n=r.bootstrap)==null?void 0:n.featureFlagPayloads)!==null&&i!==void 0?i:{},o=Object.keys(s).filter((d=>!!s[d])).reduce(((d,u)=>(d[u]=s[u]||!1,d)),{}),l=Object.keys(a).filter((d=>o[d])).reduce(((d,u)=>(a[u]&&(d[u]=a[u]),d)),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(t,e,r){var s=r!=null&&r.merge?this.getFlagVariants():{},i=r!=null&&r.merge?this.getFlagPayloads():{},n=y({},s,t),a=y({},i,e),o={};for(var[l,d]of Object.entries(n)){var u=typeof d=="string";o[l]={key:l,enabled:!!u||!!d,variant:u?d:void 0,reason:void 0,metadata:w(a?.[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.receivedFeatureFlags({flags:o})}get hasLoadedFlags(){return this.Te}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var t=this._instance.get_property(bs),e=this._instance.get_property(Ke),r=this._instance.get_property(At);if(!r&&!e)return t||{};var s=Y({},t||{}),i=[...new Set([...Object.keys(r||{}),...Object.keys(e||{})])];for(var n of i){var a,o,l=s[n],d=e?.[n],u=w(d)?(a=l?.enabled)!==null&&a!==void 0&&a:!!d,h=w(d)?l.variant:typeof d=="string"?d:void 0,f=r?.[n],g=y({},l,{enabled:u,variant:u?h??l?.variant:void 0});u!==l?.enabled&&(g.original_enabled=l?.enabled),h!==l?.variant&&(g.original_variant=l?.variant),f&&(g.metadata=y({},l?.metadata,{payload:f,original_payload:l==null||(o=l.metadata)==null?void 0:o.payload})),s[n]=g}return this.Pe||(ue.warn(" Overriding feature flag details!",{flagDetails:t,overriddenPayloads:r,finalDetails:s}),this.Pe=!0),s}getFlagVariants(){var t=this._instance.get_property(_t),e=this._instance.get_property(Ke);if(!e)return t||{};for(var r=Y({},t),s=Object.keys(e),i=0;i<s.length;i++)r[s[i]]=e[s[i]];return this.Pe||(ue.warn(" Overriding feature flags!",{enabledFlags:t,overriddenFlags:e,finalFlags:r}),this.Pe=!0),r}getFlagPayloads(){var t=this._instance.get_property(xn),e=this._instance.get_property(At);if(!e)return t||{};for(var r=Y({},t||{}),s=Object.keys(e),i=0;i<s.length;i++)r[s[i]]=e[s[i]];return this.Pe||(ue.warn(" Overriding feature flag payloads!",{flagPayloads:t,overriddenPayloads:e,finalPayloads:r}),this.Pe=!0),r}reloadFeatureFlags(){this.Ie||this._instance.config.advanced_disable_feature_flags||this.Ne||(this._instance.pi.emit("featureFlagsReloading",!0),this.Ne=setTimeout((()=>{this.Ue()}),5))}ze(){clearTimeout(this.Ne),this.Ne=void 0}ensureFlagsLoaded(){this.Te||this.Re||this.Ne||this.reloadFeatureFlags()}setAnonymousDistinctId(t){this.$anon_distinct_id=t}setReloadingPaused(t){this.Ie=t}Ue(t){var e;if(this.ze(),!this._instance.bt())if(this.Re)this.Ce=!0;else{var r=this._instance.config.token,s=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:y({},((e=this._instance.persistence)==null?void 0:e.get_initial_props())||{},this._instance.get_property(qt)||{}),group_properties:this._instance.get_property(at),timezone:Ma()};Ce(s)||w(s)||(i.$device_id=s),(t!=null&&t.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.Le()&&(i.evaluation_contexts=this.je());var n=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",a=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+n);this.Re=!0,this._instance._send_request({method:"POST",url:a,data:i,compression:this._instance.config.disable_compression?void 0:Fe.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:o=>{var l,d,u,h=!0;if(o.statusCode===200&&(this.Ce||(this.$anon_distinct_id=void 0),h=!1),this.Re=!1,!i.disable_flags||this.Ce){this.Oe=!h;var f=[];
108o.error?o.error instanceof Error?f.push(o.error.name==="AbortError"?th:rh):f.push(sh):o.statusCode!==200&&f.push(ih(o.statusCode)),(l=o.json)!=null&&l.errorsWhileComputingFlags&&f.push(Zd);var g=!((d=o.json)==null||(d=d.quotaLimited)==null||!d.includes(ah.FeatureFlags));if(g&&f.push(eh),(u=this._instance.persistence)==null||u.register({[ks]:f}),g)ue.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 p;i.disable_flags||this.receivedFeatureFlags((p=o.json)!==null&&p!==void 0?p:{},h),this.Ce&&(this.Ce=!1,this.Ue())}}}})}}getFeatureFlag(t,e){var r;if(e===void 0&&(e={}),!e.fresh||this.Oe)if(this.Te||this.getFlags()&&this.getFlags().length>0){if(!this.De()){var s=this.getFeatureFlagResult(t,e);return(r=s?.variant)!==null&&r!==void 0?r:s?.enabled}}else ue.warn('getFeatureFlag for key "'+t+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(t){return this.getFlagsWithDetails()[t]}getFeatureFlagPayload(t){var e=this.getFeatureFlagResult(t,{send_event:!1});return e?.payload}getFeatureFlagResult(t,e){if(e===void 0&&(e={}),!e.fresh||this.Oe)if(this.Te||this.getFlags()&&this.getFlags().length>0){if(!this.De()){var r=this.getFlagVariants(),s=t in r,i=r[t],n=this.getFlagPayloads()[t],a=String(i),o=this._instance.get_property(wn)||void 0,l=this._instance.get_property(kr)||void 0,d=this._instance.get_property(Wt)||{};if(this._instance.config.advanced_feature_flags_dedup_per_session){var u,h=this._instance.get_session_id(),f=this._instance.get_property(ws);h&&h!==f&&(d={},(u=this._instance.persistence)==null||u.register({[Wt]:d,[ws]:h}))}if((e.send_event||!("send_event"in e))&&(!(t in d)||!d[t].includes(a))){var g,p,_,k,m,E,P,N,$,D;F(d[t])?d[t].push(a):d[t]=[a],(g=this._instance.persistence)==null||g.register({[Wt]:d});var I=this.getFeatureFlagDetails(t),T=[...(p=this._instance.get_property(ks))!==null&&p!==void 0?p:[]];w(i)&&T.push(Qd);var U={$feature_flag:t,$feature_flag_response:i,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:((_=this._instance.config.bootstrap)==null||(_=_.featureFlags)==null?void 0:_[t])||null,$feature_flag_bootstrapped_payload:((k=this._instance.config.bootstrap)==null||(k=k.featureFlagPayloads)==null?void 0:k[t])||null,$used_bootstrap_value:!this.Oe};w(I==null||(m=I.metadata)==null?void 0:m.version)||(U.$feature_flag_version=I.metadata.version);var W,B=(E=I==null||(P=I.reason)==null?void 0:P.description)!==null&&E!==void 0?E:I==null||(N=I.reason)==null?void 0:N.code;B&&(U.$feature_flag_reason=B),I!=null&&($=I.metadata)!=null&&$.id&&(U.$feature_flag_id=I.metadata.id),w(I?.original_variant)&&w(I?.original_enabled)||(U.$feature_flag_original_response=w(I.original_variant)?I.original_enabled:I.original_variant),I!=null&&(D=I.metadata)!=null&&D.original_payload&&(U.$feature_flag_original_payload=I==null||(W=I.metadata)==null?void 0:W.original_payload),T.length&&(U.$feature_flag_error=T.join(",")),this._instance.capture("$feature_flag_called",U)}if(s){var Q=n;if(!w(n))try{Q=JSON.parse(n)}catch{}return{key:t,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:Q}}}}else ue.warn('getFeatureFlagResult for key "'+t+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(t,e){var r=this._instance.config.token,s={distinct_id:this._instance.get_distinct_id(),token:r};this.Le()&&(s.evaluation_contexts=this.je()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this._instance.config.disable_compression?void 0:Fe.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var n,a=(n=i.json)==null?void 0:n.featureFlagPayloads;e(a?.[t]||void 0)}})}isFeatureEnabled(t,e){if(e===void 0&&(e={}),!e.fresh||this.Oe){if(this.Te||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(t,e);return w(r)?void 0:!!r}ue.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((e=>e!==t))}receivedFeatureFlags(t,e){if(this._instance.persistence){this.Te=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(n,a,o,l,d){o===void 0&&(o={}),l===void 0&&(l={}),d===void 0&&(d={});var u=nh(n),h=u.flags,f=u.featureFlags,g=u.featureFlagPayloads;if(f){var p=n.requestId,_=n.evaluatedAt;if(F(f)){ue.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var k={};if(f)for(var m=0;m<f.length;m++)k[f[m]]=!0;a&&a.register({[ss]:f,[_t]:k})}else{var E=f,P=g,N=h;if(n.errorsWhileComputingFlags)if(h){var $=new Set(Object.keys(h).filter((D=>{var I;
108return!((I=h[D])!=null&&I.failed)})));E=y({},o,Object.fromEntries(Object.entries(E).filter((D=>{var[I]=D;return $.has(I)})))),P=y({},l,Object.fromEntries(Object.entries(P||{}).filter((D=>{var[I]=D;return $.has(I)})))),N=y({},d,Object.fromEntries(Object.entries(N||{}).filter((D=>{var[I]=D;return $.has(I)}))))}else E=y({},o,E),P=y({},l,P),N=y({},d,N);a&&a.register(y({[ss]:Object.keys(En(E)),[_t]:E||{},[xn]:P||{},[bs]:N||{}},p?{[wn]:p}:{},_?{[kr]:_}:{}))}}})(t,this._instance.persistence,r,s,i),e||(this.Me=!1),this.He(e)}}override(t,e){e===void 0&&(e=!1),ue.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:t,suppressWarning:e})}overrideFeatureFlags(t){if(!this._instance.__loaded||!this._instance.persistence)return ue.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(t===!1)return this._instance.persistence.unregister(Ke),this._instance.persistence.unregister(At),this.He(),nt.info("All overrides cleared");if(F(t)){var e=kn(t);return this._instance.persistence.register({[Ke]:e}),this.He(),nt.info("Flag overrides set",{flags:t})}if(t&&typeof t=="object"&&("flags"in t||"payloads"in t)){var r,s=t;if(this.Pe=!!((r=s.suppressWarning)!==null&&r!==void 0&&r),"flags"in s){if(s.flags===!1)this._instance.persistence.unregister(Ke),nt.info("Flag overrides cleared");else if(s.flags){if(F(s.flags)){var i=kn(s.flags);this._instance.persistence.register({[Ke]:i})}else this._instance.persistence.register({[Ke]:s.flags});nt.info("Flag overrides set",{flags:s.flags})}}return"payloads"in s&&(s.payloads===!1?(this._instance.persistence.unregister(At),nt.info("Payload overrides cleared")):s.payloads&&(this._instance.persistence.register({[At]:s.payloads}),nt.info("Payload overrides set",{payloads:s.payloads}))),void this.He()}if(t&&typeof t=="object")return this._instance.persistence.register({[Ke]:t}),this.He(),nt.info("Flag overrides set",{flags:t});ue.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:t})}onFeatureFlags(t){if(this.addFeatureFlagsHandler(t),this.Te){var{flags:e,flagVariants:r}=this.Be();t(e,r)}return()=>this.removeFeatureFlagsHandler(t)}updateEarlyAccessFeatureEnrollment(t,e,r){var s,i=(this._instance.get_property(Ut)||[]).find((l=>l.flagKey===t)),n={["$feature_enrollment/"+t]:e},a={$feature_flag:t,$feature_enrollment:e,$set:n};i&&(a.$early_access_feature_name=i.name),r&&(a.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=y({},this.getFlagVariants(),{[t]:e});(s=this._instance.persistence)==null||s.register({[ss]:Object.keys(En(o)),[_t]:o}),this.He()}getEarlyAccessFeatures(t,e,r){e===void 0&&(e=!1);var s=this._instance.get_property(Ut),i=r?"&"+r.map((n=>"stage="+n)).join("&"):"";if(s&&!e)return t(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+i),method:"GET",callback:n=>{var a,o;if(n.json){var l=n.json.earlyAccessFeatures;return(a=this._instance.persistence)==null||a.unregister(Ut),(o=this._instance.persistence)==null||o.register({[Ut]:l}),t(l)}}})}Be(){var t=this.getFlags(),e=this.getFlagVariants();return{flags:t.filter((r=>e[r])),flagVariants:Object.keys(e).filter((r=>e[r])).reduce(((r,s)=>(r[s]=e[s],r)),{})}}He(t){var{flags:e,flagVariants:r}=this.Be();this.featureFlagEventHandlers.forEach((s=>s(e,r,{errorsLoading:t})))}setPersonPropertiesForFlags(t,e){e===void 0&&(e=!0);var r=this._instance.get_property(qt)||{};this._instance.register({[qt]:y({},r,t)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(qt)}setGroupPropertiesForFlags(t,e){e===void 0&&(e=!0);var r=this._instance.get_property(at)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((s=>{r[s]=y({},r[s],t[s]),delete t[s]})),this._instance.register({[at]:y({},r,t)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(t){if(t){var e=this._instance.get_property(at)||{};this._instance.register({[at]:y({},e,{[t]:{}})})}else this._instance.unregister(at)}reset(){this.Te=!1,this.Re=!1,this.Ie=!1,this.Ce=!1,this.Oe=!1,this.$anon_distinct_id=void 0,this.ze(),this.Pe=!1}}},lh={sessionRecording:class{get started(){var t;return!((t=this.qe)==null||!t.isStarted)}get status(){var t,e;return this.Ve===Mt||this.Ve===fr?this.Ve:(t=(e=this.qe)==null?void 0:e.status)!==null&&t!==void 0?t:this.Ve}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.Ve=gn,this.We=void 0,this._instance=t,!this._instance.sessionManager)throw it.error("started without valid sessionManager"),new Error(Ms+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Ms+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ge(){var t,e=!((t=this._instance.get_property(cr))==null||!t.enabled),r=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return v&&e&&r&&!s}startIfEnabledOrStop(t){var e;if(!this.Ge||(e=this.qe)==null||!e.isStarted){var r=!w(Object.assign)&&!w(Array.from);
108this.Ge&&r?(this.Ye(t),it.info("starting")):(this.Ve=gn,this.stopRecording())}}Ye(t){var e,r,s;this.Ge&&(this.Ve!==Mt&&this.Ve!==fr&&(this.Ve=vn),C!=null&&(e=C.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(r=C.__PosthogExtensions__)!=null&&r.initSessionRecording?this.Je(t):(s=C.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,this.Ke,(i=>{if(i)return it.error("could not load recorder",i);this.Je(t)})))}stopRecording(){var t,e;(t=this.We)==null||t.call(this),this.We=void 0,(e=this.qe)==null||e.stop()}Xe(){var t,e;(t=this.We)==null||t.call(this),this.We=void 0,(e=this.qe)==null||e.discard()}Qe(){var t;(t=this._instance.persistence)==null||t.unregister(Ea)}Ze(t,e){if(R(t))return null;var r,s=Oe(t)?t:parseFloat(t);return typeof(r=s)=="number"&&Number.isFinite(r)&&r>=0&&r<=1?s:(it.warn(e+" must be between 0 and 1. Ignoring invalid value:",t),null)}tr(t){if(this._instance.persistence){var e,r,s=this._instance.persistence,i=()=>{var n,a=t.sessionRecording===!1?void 0:t.sessionRecording,o=this.Ze((n=this._instance.config.session_recording)==null?void 0:n.sampleRate,"session_recording.sampleRate"),l=this.Ze(a?.sampleRate,"remote config sampleRate"),d=o??l;R(d)&&this.Qe();var u=a?.minimumDurationMilliseconds;s.register({[cr]:y({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:y({capturePerformance:t.capturePerformance},a?.networkPayloadCapture),canvasRecording:{enabled:a?.recordCanvas,fps:a?.canvasFps,quality:a?.canvasQuality},sampleRate:d,minimumDurationMilliseconds:w(u)?null:u,endpoint:a?.endpoint,triggerMatchType:a?.triggerMatchType,masking:a?.masking,urlTriggers:a?.urlTriggers})})};i(),(e=this.We)==null||e.call(this),this.We=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(i)}}onRemoteConfig(t){return"sessionRecording"in t?t.sessionRecording===!1?(this.tr(t),void this.Xe()):(this.tr(t),void this.startIfEnabledOrStop()):(this.Ve===Mt&&(this.Ve=fr,it.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(t,e){var r;e===void 0&&(e="log"),(r=this.qe)!=null&&r.log?this.qe.log(t,e):it.warn("log called before recorder was ready")}get Ke(){var t,e,r=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(cr);return(r==null||(e=r.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}ir(){var t,e=this._instance.get_property(cr);if(!e)return!1;var r=(t=(typeof e=="object"?e:JSON.parse(e)).cache_timestamp)!==null&&t!==void 0?t:Date.now();return Date.now()-r<=36e5}Je(t){var e,r;if((e=C.__PosthogExtensions__)==null||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");if(this.qe||(this.qe=(r=C.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.qe._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.ir())return this.Ve===fr||this.Ve===Mt?void 0:(this.Ve=Mt,it.info("persisted remote config is stale, requesting fresh config before starting"),void new Aa(this._instance).load());this.Ve=vn,this.qe.start(t)}onRRwebEmit(t){var e;(e=this.qe)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.qe||(e=this._instance.persistence)==null||e.register({$replay_override_linked_flag:!0}),(t=this.qe)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.qe||(e=this._instance.persistence)==null||e.register({$replay_override_sampling:!0}),(t=this.qe)==null||t.overrideSampling()}overrideTrigger(t){var e,r;this.qe||(r=this._instance.persistence)==null||r.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.qe)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.qe)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var r;return!((r=this.qe)==null||!r.tryAddCustomEvent(t,e))}}},ch={autocapture:class{constructor(t){this.er=!1,this.rr=null,this.sr=!1,this.instance=t,this.rageclicks=new dn(t.config.rageclick),this.nr=null}initialize(){this.startIfEnabled()}get N(){var t,e,r=ee(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(t=r.url_allowlist)==null?void 0:t.map((s=>new RegExp(s))),r.url_ignorelist=(e=r.url_ignorelist)==null?void 0:e.map((s=>new RegExp(s))),r}
vendor: 9,942 bytes, line 108
108ar(){if(this.isBrowserSupported()){if(v&&b){var t=r=>{r=r||v?.event;try{this.lr(r)}catch(s){hn.error("Failed to capture event",s)}};if(J(b,"submit",t,{capture:!0}),J(b,"change",t,{capture:!0}),J(b,"click",t,{capture:!0}),this.N.capture_copied_text){var e=r=>{r=r||v?.event,this.lr(r,es)};J(b,"copy",e,{capture:!0}),J(b,"cut",e,{capture:!0})}}}else hn.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.er&&(this.ar(),this.er=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.sr=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Ri]:!!t.autocapture_opt_out}),this.rr=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.nr=t}getElementSelectors(t){var e,r=[];return(e=this.nr)==null||e.forEach((s=>{var i=b?.querySelectorAll(s);i?.forEach((n=>{t===n&&r.push(s)}))})),r}get isEnabled(){var t,e,r=(t=this.instance.persistence)==null?void 0:t.props[Ri],s=this.rr;if(Ce(s)&&!Ue(r)&&!this.instance.bt())return!1;var i=(e=this.rr)!==null&&e!==void 0?e:!!r;return!!this.instance.config.autocapture&&!i}lr(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var r,s=on(t);Ga(s)&&(s=s.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&Rd(s,this.instance.config.rageclick)&&this.lr(t,"$rageclick");var i=e===es;if(s&&Md(s,t,this.N,i,i?["copy","cut"]:void 0)){var{props:n,explicitNoCapture:a}=Hd(s,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.sr});if(a)return!1;var o=this.getElementSelectors(s);if(o&&o.length>0&&(n.$element_selectors=o),e===es){var l,d=Xa(v==null||(l=v.getSelection())==null?void 0:l.toString()),u=t.type||"clipboard";if(!d)return!1;n.$selected_content=d,n.$copy_type=u}return this.instance.capture(e,n),!0}}}isBrowserSupported(){return De(b?.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.ur=(v==null||(e=v.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(x.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.hr&&this.hr(),this.hr=void 0,x.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(v&&v.history){var r=this;(t=v.history.pushState)!=null&&t.__posthog_wrapped__||pn(v.history,"pushState",(s=>function(i,n,a){s.call(this,i,n,a),r.dr("pushState")})),(e=v.history.replaceState)!=null&&e.__posthog_wrapped__||pn(v.history,"replaceState",(s=>function(i,n,a){s.call(this,i,n,a),r.dr("replaceState")})),this.vr()}}dr(t){try{var e,r=v==null||(e=v.location)==null?void 0:e.pathname;if(!r)return;r!==this.ur&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.ur=r}catch(s){x.error("Error capturing "+t+" pageview",s)}}vr(){if(!this.hr){var t=()=>{this.dr("popstate")};J(v,"popstate",t),this.hr=()=>{v&&v.removeEventListener("popstate",t)}}}},heatmaps:class{constructor(t){var e;this.cr=!1,this.er=!1,this.pr=null,this.instance=t,this.cr=!((e=this.instance.persistence)==null||!e.props[ms]),this.rageclicks=new dn(t.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var t=5e3;return ee(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return R(this.instance.config.capture_heatmaps)?R(this.instance.config.enable_heatmaps)?this.cr:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.er)return;Vd.info("starting..."),this._r(),this.gr()}else{var t;clearInterval((t=this.pr)!==null&&t!==void 0?t:void 0),this.mr(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[ms]:e}),this.cr=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.C;return this.C=void 0,t}br(t){this.yr(t.originalEvent,"deadclick")}gr(){this.pr&&clearInterval(this.pr),this.pr=(function(t){return t?.visibilityState==="visible"})(b)?setInterval(this.Ft.bind(this),this.flushIntervalMilliseconds):null}_r(){v&&b&&(this.wr=this.Ft.bind(this),J(v,"beforeunload",this.wr),this.Er=t=>this.yr(t||v?.event),J(b,"click",this.Er,{capture:!0}),this.Sr=t=>this.$r(t||v?.event),J(b,"mousemove",this.Sr,{capture:!0}),this.kr=new Bi(this.instance,Qu,this.br.bind(this)),this.kr.startIfEnabledOrStop(),this.Pr=this.gr.bind(this),J(b,"visibilitychange",this.Pr),this.er=!0)}mr(){var t;v&&b&&(this.wr&&v.removeEventListener("beforeunload",this.wr),this.Er&&b.removeEventListener("click",this.Er,{capture:!0}),this.Sr&&b.removeEventListener("mousemove",this.Sr,{capture:!0}),this.Pr&&b.removeEventListener("visibilitychange",this.Pr),clearTimeout(this.Tr),(t=this.kr)==null||t.stop(),this.er=!1)}Rr(t,e){var r=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),n=(function(a,o,l){for(var d=a;d&&Ar(d)&&!Ze(d,"body");){if(d===l)return!1;if(O(o,v?.getComputedStyle(d).position))return!0;d=Ja(d)}return!1})(on(t),["fixed","sticky"],i);return{x:t.clientX+(n?0:s),y:t.clientY+(n?0:r),target_fixed:n,type:e}}yr(t,e){var r;if(e===void 0&&(e="click"),!nn(t.target)&&_n(t)){var s=this.Rr(t,e);(r=this.rageclicks)!=null&&r.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this.Ir(y({},s,{type:"rageclick"})),this.Ir(s)}}$r(t){!nn(t.target)&&_n(t)&&(clearTimeout(this.Tr),this.Tr=setTimeout((()=>{this.Ir(this.Rr(t,"mousemove"))}),500))}Ir(t){if(v){var e=v.location.href,r=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,i=r?kt([],Et,s||[]):[],n=Zt(e,i,Qt);this.C=this.C||{},this.C[n]||(this.C[n]=[]),this.C[n].push(t)}}Ft(){this.C&&!vt(this.C)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Bi,webVitalsAutocapture:class{constructor(t){var e;this.cr=!1,this.er=!1,this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Cr=()=>{clearTimeout(this.Or),this.C.metrics.length!==0&&(this._instance.capture("$web_vitals",this.C.metrics.reduce(((r,s)=>y({},r,{["$web_vitals_"+s.name+"_event"]:y({},s),["$web_vitals_"+s.name+"_value"]:s.value})),{})),this.C={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Fr=r=>{var s,i=(s=this._instance.sessionManager)==null?void 0:s.checkAndGetSessionAndWindowId(!0);if(w(i))Ve.error("Could not read session ID. Dropping metrics!");else{this.C=this.C||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.Mr();w(n)||(R(r?.name)||R(r?.value)?Ve.error("Invalid metric received",r):this.Ar&&r.value>=this.Ar?Ve.error("Ignoring metric with value >= "+this.Ar,r):(this.C.url!==n&&(this.Cr(),this.Or=setTimeout(this.Cr,this.flushToCaptureTimeoutMs)),w(this.C.url)&&(this.C.url=n),this.C.firstMetricTimestamp=w(this.C.firstMetricTimestamp)?Date.now():this.C.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.C.metrics.push(y({},r,{$current_url:n,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.C.metrics.length===this.allowedMetrics.length&&this.Cr()))}},this.Dr=()=>{if(!this.er){var r,s,i,n,a=C.__PosthogExtensions__;w(a)||w(a.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:s,onFCP:i,onINP:n}=a.postHogWebVitalsCallbacks),r&&s&&i&&n?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.Fr.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&s(this.Fr.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Fr.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&n(this.Fr.bind(this)),this.er=!0):Ve.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.cr=!((e=this._instance.persistence)==null||!e.props[Fi]),this.startIfEnabled()}get allowedMetrics(){var t,e,r=ee(this._instance.config.capture_performance)?(t=this._instance.config.capture_performance)==null?void 0:t.web_vitals_allowed_metrics:void 0;return R(r)?((e=this._instance.persistence)==null?void 0:e.props[Li])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(ee(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=ee(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return t!=null&&t}get Ar(){var t=ee(this._instance.config.capture_performance)&&Oe(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:fn;return 0<t&&t<=6e4?fn:t}get isEnabled(){var t=ie?.protocol;if(t!=="http:"&&t!=="https:")return Ve.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=ee(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:Ue(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return Ue(e)?e:this.cr}startIfEnabled(){this.isEnabled&&!this.er&&(Ve.info("enabled, starting..."),this.G(this.Dr))}onRemoteConfig(t){if("capturePerformance"in t){var e=ee(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=ee(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Fi]:e}),this._instance.persistence.register({[Li]:r})),this.cr=e,this.startIfEnabled()}}G(t){var e,r;if((e=C.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks)t
108();else{var s=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(r=C.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,s,(i=>{i?Ve.error("failed to load script",i):t()}))}}Mr(){var t=v?v.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,r=this._instance.config.custom_personal_data_properties,s=e?kt([],Et,r||[]):[];return Zt(t,s,Qt)}Ve.error("Could not determine current URL")}}},uh={exceptionObserver:class{constructor(t){var e,r,s;this.Dr=()=>{var i;if(v&&this.isEnabled&&(i=C.__PosthogExtensions__)!=null&&i.errorWrappingFunctions){var n=C.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=C.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,o=C.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.jr&&this.N.capture_unhandled_errors&&(this.jr=n(this.captureException.bind(this))),!this.Lr&&this.N.capture_unhandled_rejections&&(this.Lr=a(this.captureException.bind(this))),!this.Nr&&this.N.capture_console_errors&&(this.Nr=o(this.captureException.bind(this)))}catch(l){Rt.error("failed to start",l),this.Ur()}}},this._instance=t,this.zr=!((e=this._instance.persistence)==null||!e.props[Mi]),this.Hr=new ou({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10,refillInterval:1e4,h:Rt}),this.N=this.Br(),this.startIfEnabledOrStop()}Br(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ee(t)?e=y({},e,t):(w(t)?this.zr:t)&&(e=y({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Rt.info("enabled"),this.Ur(),this.G(this.Dr)):this.Ur()}G(t){var e,r;(e=C.__PosthogExtensions__)!=null&&e.errorWrappingFunctions&&t(),(r=C.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(s=>{if(s)return Rt.error("failed to load script",s);t()}))}Ur(){var t,e,r;(t=this.jr)==null||t.call(this),this.jr=void 0,(e=this.Lr)==null||e.call(this),this.Lr=void 0,(r=this.Nr)==null||r.call(this),this.Nr=void 0}onRemoteConfig(t){if("autocaptureExceptions"in t){var e=t.autocaptureExceptions;this.zr=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[Mi]:this.zr}),this.N=this.Br(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this.Br()}captureException(t){var e,r,s,i=(e=t==null||(r=t.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&e!==void 0?e:"Exception";this.Hr.consumeRateLimit(i)?Rt.info("Skipping exception capture because of client rate limiting.",{exception:i}):(s=this._instance.exceptions)==null||s.sendExceptionEvent(t)}},exceptions:class{constructor(t){var e,r;this.qr=[],this.Vr=new bu([new Nu,new Du,new Tu,new Pu,new Au,new Mu,new $u,new Fu],Cu()),this._instance=t,this.qr=(e=(r=this._instance.persistence)==null?void 0:r.get_property(ys))!==null&&e!==void 0?e:[]}onRemoteConfig(t){var e,r,s;if("errorTracking"in t){var i=(e=(r=t.errorTracking)==null?void 0:r.suppressionRules)!==null&&e!==void 0?e:[],n=(s=t.errorTracking)==null?void 0:s.captureExtensionExceptions;this.qr=i,this._instance.persistence&&this._instance.persistence.register({[ys]:this.qr,[Ai]:n})}}get Wr(){var t,e=!!this._instance.get_property(Ai),r=this._instance.config.error_tracking.captureExtensionExceptions;return(t=r??e)!==null&&t!==void 0&&t}buildProperties(t,e){return this.Vr.buildFromUnknown(t,{syntheticException:e?.syntheticException,mechanism:{handled:e?.handled}})}sendExceptionEvent(t){var e=t.$exception_list;if(this.Gr(e)){if(this.Yr(e))return void is.info("Skipping exception capture because a suppression rule matched");if(!this.Wr&&this.Jr(e))return void is.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Kr(e))return void is.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",t,{_noTruncate:!0,_batchKey:"exceptionEvent",Di:!0})}Yr(t){if(t.length===0)return!1;var e=t.reduce(((r,s)=>{var{type:i,value:n}=s;return Z(i)&&i.length>0&&r.$exception_types.push(i),Z(n)&&n.length>0&&r.$exception_values.push(n),r}),{$exception_types:[],$exception_values:[]});return this.qr.some((r=>{var s=r.values.map((i=>{var n,a=za[i.operator],o=F(i.value)?i.value:[i.value],l=(n=e[i.key])!==null&&n!==void 0?n:[];return o.length>0&&a(o,l)}));return r.type==="OR"?s.some(Boolean):s.every(Boolean)}))}Jr(t){return t.flatMap((e=>{var r,s;return(r=(s=e.stacktrace)==null?void 0:s.frames)!==null&&r!==void 0?r:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}Kr(t){if(t.length>0){var e,r,s,i,n=(e=(r=t[0].stacktrace)==null?void 0:r.frames)!==null&&e!==void 0?e:[],a=n[n.length-1];return(s=a==null||(i=a.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&s!==void 0&&s}return!1}Gr(t){return!R(t)&&F(t)}}},dh=y({productTours:class{constructor(t){this.Xr=null,this.Qr=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){"productTours"in t&&(this._instance.persistence&&this._instance.persistence.register({[Di]:!!t.productTours}),this.loadIfEnabled())}loadIfEnabled(){var t,e;this.Xr||(t=this._instance).config.disable_product_tours||(e=t.persistence)==null||!e.get_property(Di)||this.G((()=>this.Zr()))}
vendor: 4,283 bytes, line 108
108G(t){var e,r;(e=C.__PosthogExtensions__)!=null&&e.generateProductTours?t():(r=C.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"product-tours",(s=>{s?mn.error("Could not load product tours script",s):t()}))}Zr(){var t;!this.Xr&&(t=C.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.Xr=C.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!F(this.Qr)||e){var r=this._instance.persistence;if(r){var s=r.props[rs];if(F(s)&&!e)return this.Qr=s,void t(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:i=>{var n=i.statusCode;if(n!==200||!i.json){var a="Product Tours API could not be loaded, status: "+n;return mn.error(a),void t([],{isLoaded:!1,error:a})}var o=F(i.json.product_tours)?i.json.product_tours:[];this.Qr=o,r&&r.register({[rs]:o}),t(o,{isLoaded:!0})}})}else t(this.Qr,{isLoaded:!0})}getActiveProductTours(t){R(this.Xr)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.Xr.getActiveProductTours(t)}showProductTour(t){var e;(e=this.Xr)==null||e.showTourById(t)}previewTour(t){this.Xr?this.Xr.previewTour(t):this.G((()=>{var e;this.Zr(),(e=this.Xr)==null||e.previewTour(t)}))}dismissProductTour(){var t;(t=this.Xr)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.Xr)==null||t.nextStep()}previousStep(){var t;(t=this.Xr)==null||t.previousStep()}clearCache(){var t;this.Qr=null,(t=this._instance.persistence)==null||t.unregister(rs)}resetTour(t){var e;(e=this.Xr)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.Xr)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.Xr)==null||e.cancelPendingTour(t)}}},Fr),hh={siteApps:class{constructor(t){this._instance=t,this.ts=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}es(t,e){if(e){var r=this.globalsForEvent(e);this.ts.push(r),this.ts.length>1e3&&(this.ts=this.ts.slice(10))}}get siteAppLoaders(){var t;return(t=C._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}initialize(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.es.bind(this));this.rs=()=>{t(),this.ts=[],this.rs=void 0}}}globalsForEvent(t){var e,r,s,i,n,a,o;if(!t)throw new Error("Event payload is required");var l={},d=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(var[h,f]of Object.entries(u))l[h]={id:d[h],type:h,properties:f};var{$set_once:g,$set:p}=t;return{event:y({},Jn(t,Gd),{properties:y({},t.properties,p?{$set:y({},(e=(r=t.properties)==null?void 0:r.$set)!==null&&e!==void 0?e:{},p)}:{},g?{$set_once:y({},(s=(i=t.properties)==null?void 0:i.$set_once)!==null&&s!==void 0?s:{},g)}:{}),elements_chain:(n=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&n!==void 0?n:"",distinct_id:(o=t.properties)==null?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(t){var e=this.apps[t.id],r=()=>{var a;!e.errored&&this.ts.length&&(Ge.info("Processing "+this.ts.length+" events for site app with id "+t.id),this.ts.forEach((o=>e.processEvent==null?void 0:e.processEvent(o))),e.processedBuffer=!0),Object.values(this.apps).every((o=>o.processedBuffer||o.errored))&&((a=this.rs)==null||a.call(this))},s=!1,i=a=>{e.errored=!a,e.loaded=!0,Ge.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),s&&r()};try{var{processEvent:n}=t.init({posthog:this._instance,callback:a=>{i(a)}});n&&(e.processEvent=n),s=!0}catch(a){Ge.error("Error while initializing PostHog app with config id "+t.id,a),i(!1)}if(s&&e.loaded)try{r()}catch(a){Ge.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}ss(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of t)this.setupSiteApp(r)}ns(t){if(Object.keys(this.apps).length!==0){var e=this.globalsForEvent(t);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(e)}catch(s){Ge.error("Error while processing event "+t.event+" for site app "+r.id,s)}}}onRemoteConfig(t){var e,r,s,i=this;
108if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.ss(),void this._instance.on("eventCaptured",(l=>this.ns(l)))):void Ge.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.rs)==null||r.call(this),(s=t.siteApps)!=null&&s.length)if(this.isEnabled){var n=function(l){var d;C["__$$ph_site_app_"+l]=i._instance,(d=C.__PosthogExtensions__)==null||d.loadSiteApp==null||d.loadSiteApp(i._instance,o,(u=>{if(u)return Ge.error("Error while initializing PostHog app with config id "+l,u)}))};for(var{id:a,url:o}of t.siteApps)n(a)}else Ge.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},ph={tracingHeaders:class{constructor(t){this.os=void 0,this.ls=void 0,this.Dr=()=>{var e,r;w(this.os)&&((e=C.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),w(this.ls)&&((r=C.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}initialize(){this.startIfEnabledOrStop()}G(t){var e,r;(e=C.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns&&t(),(r=C.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(s=>{if(s)return Wd.error("failed to load script",s);t()}))}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.G(this.Dr):((t=this.os)==null||t.call(this),(e=this.ls)==null||e.call(this),this.os=void 0,this.ls=void 0)}}},fh=y({surveys:class{constructor(t){this.us=void 0,this._surveyManager=null,this.hs=!1,this.ds=[],this.vs=null,this._instance=t,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_surveys){var e=t.surveys;if(R(e))return H.warn("Flags not loaded yet. Not loading surveys.");var r=F(e);this.us=r?e.length>0:e,H.info("flags response received, isSurveysEnabled: "+this.us),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var t=[],e=0;e<localStorage.length;e++){var r=localStorage.key(e);(r!=null&&r.startsWith(Wa)||r!=null&&r.startsWith("inProgressSurvey_"))&&t.push(r)}t.forEach((s=>localStorage.removeItem(s)))}loadIfEnabled(){if(!this._surveyManager)if(this.hs)H.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)H.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())H.info("Not loading surveys in cookieless mode without consent.");else{var t=C?.__PosthogExtensions__;if(t){if(!w(this.us)||this._instance.config.advanced_enable_surveys){var e=this.us||this._instance.config.advanced_enable_surveys;this.hs=!0;try{var r=t.generateSurveys;if(r)return void this.cs(r,e);var s=t.loadExternalDependency;if(!s)return void this.fs("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",(i=>{i||!t.generateSurveys?this.fs("Could not load surveys script",i):this.cs(t.generateSurveys,e)}))}catch(i){throw this.fs("Error initializing surveys",i),i}finally{this.hs=!1}}}else H.error("PostHog Extensions not found.")}}cs(t,e){this._surveyManager=t(this._instance,e),this._surveyEventReceiver=new Yd(this._instance),H.info("Surveys loaded successfully"),this.ps({isLoaded:!0})}fs(t,e){H.error(t,e),this.ps({isLoaded:!1,error:t})}onSurveysLoaded(t){return this.ds.push(t),this._surveyManager&&this.ps({isLoaded:!0}),()=>{this.ds=this.ds.filter((e=>e!==t))}}getSurveys(t,e){if(e===void 0&&(e=!1),this._instance.config.disable_surveys)return H.info("Disabled. Not loading surveys."),t([]);var r,s=this._instance.get_property(xs);if(s&&!e)return t(s,{isLoaded:!0});typeof Promise<"u"&&this.vs?this.vs.then((i=>{var{surveys:n,context:a}=i;return t(n,a)})):(typeof Promise<"u"&&(this.vs=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 n;this.vs=null;var a=i.statusCode;if(a!==200||!i.json){var o="Surveys API could not be loaded, status: "+a;H.error(o);var l={isLoaded:!1,error:o};return t([],l),void(r==null||r({surveys:[],context:l}))}var d,u=i.json.surveys||[],h=u.filter((g=>(function(p){return!(!p.start_date||p.end_date)})(g)&&((function(p){var _;return!((_=p.conditions)==null||(_=_.events)==null||(_=_.values)==null||!_.length)})(g)||(function(p){var _;return!((_=p.conditions)==null||(_=_.actions)==null||(_=_.values)==null||!_.length)})(g))));h.length>0&&((d=this._surveyEventReceiver)==null||d.register(h)),(n=this._instance.persistence)==null||n.register({[xs]:u});var f={isLoaded:!0};t(u,f),r?.({surveys:u,context:f})}}))}ps(t){for(var e of this.ds)try{if(!t.isLoaded)return e([],t);
108this.getSurveys(e)}catch(r){H.error("Error in survey callback",r)}}getActiveMatchingSurveys(t,e){if(e===void 0&&(e=!1),!R(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(t,e);H.warn("init was not called")}_s(t){var e=null;return this.getSurveys((r=>{var s;e=(s=r.find((i=>i.id===t)))!==null&&s!==void 0?s:null})),e}gs(t){if(R(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var e=typeof t=="string"?this._s(t):t;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(t){if(R(this._surveyManager))return H.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var e=this.gs(t);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(t,e){return R(this._surveyManager)?(H.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((s=>{var i,n=(i=s.find((o=>o.id===t)))!==null&&i!==void 0?i:null;if(n){var a=this.gs(n);r({visible:a.eligible,disabledReason:a.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(t,e,r){var s;if(R(this._surveyManager))H.warn("init was not called");else{var i=typeof t=="string"?this._s(t):t;if(i!=null&&i.id)if(Id.includes(i.type)){var n=b?.querySelector(e);if(n)return(s=i.appearance)!=null&&s.surveyPopupDelaySeconds?(H.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,o;H.info("Rendering survey "+i.id+" with delay of "+((a=i.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(i,n,r),H.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,n,r);H.warn("Survey element not found")}else H.warn("Surveys of type "+i.type+" cannot be rendered in the app");else H.warn("Survey not found")}}displaySurvey(t,e){var r;if(R(this._surveyManager))H.warn("init was not called");else{var s=this._s(t);if(s){var i=s;if((r=s.appearance)!=null&&r.surveyPopupDelaySeconds&&e.ignoreDelay&&(i=y({},s,{appearance:y({},s.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==Cs.Popover&&e.initialResponses&&H.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var n=this.canRenderSurvey(s);if(!n.visible)return void H.warn("Survey is not eligible to be displayed: ",n.disabledReason)}e.displayType!==Cs.Inline?this._surveyManager.handlePopoverSurvey(i,e):this.renderSurvey(i,e.selector,e.properties)}else H.warn("Survey not found")}}cancelPendingSurvey(t){R(this._surveyManager)?H.warn("init was not called"):this._surveyManager.cancelSurvey(t)}handlePageUnload(){var t;(t=this._surveyManager)==null||t.handlePageUnload()}}},Fr),gh={toolbar:class{constructor(t){this.instance=t}bs(t){C.ph_toolbar_state=t}ys(){var t;return(t=C.ph_toolbar_state)!==null&&t!==void 0?t:Xe.UNINITIALIZED}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(t,e,r){if(t===void 0&&(t=void 0),e===void 0&&(e=void 0),r===void 0&&(r=void 0),xa(this.instance.config)||!v||!b)return!1;t=t??v.location,r=r??v.history;try{if(!e){try{v.localStorage.setItem("test","test"),v.localStorage.removeItem("test")}catch{return!1}e=v?.localStorage}var s,i=Jd||Nr(t.hash,"__posthog")||Nr(t.hash,"state"),n=i?$i((()=>JSON.parse(atob(decodeURIComponent(i)))))||$i((()=>JSON.parse(decodeURIComponent(i)))):null;return n&&n.action==="ph_authorize"?((s=n).source="url",s&&Object.keys(s).length>0&&(n.desiredHash?t.hash=n.desiredHash:r?r.replaceState(r.state,"",t.pathname+t.search):t.hash="")):((s=JSON.parse(e.getItem(yn)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!0)}catch{return!1}}ws(t){var e=C.ph_load_toolbar||C.ph_load_editor;!R(e)&&De(e)?e(t,this.instance):bn.warn("No toolbar load function found")}loadToolbar(t){var e=!(b==null||!b.getElementById(Sa));if(!v||e)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,s=y({token:this.instance.config.token},t,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(v.localStorage.setItem(yn,JSON.stringify(y({},s,{source:void 0}))),this.ys()===Xe.LOADED)this.ws(s);else if(this.ys()===Xe.UNINITIALIZED){var i;this.bs(Xe.LOADING),(i=C.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",(n=>{if(n)return bn.error("[Toolbar] Failed to load",n),void this.bs(Xe.UNINITIALIZED);this.bs(Xe.LOADED),this.ws(s)})),J(v,"turbolinks:load",(()=>{this.bs(Xe.UNINITIALIZED),this.loadToolbar(s)}))}return!0}Es(t){return this.loadToolbar(t)}maybeLoadEditor(t,e,r){return t===void 0&&(t=void 0),e===void 0&&(e=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(t,e,r)}}},vh=y({experiments:oe},Fr),_h={conversations:class{constructor(t){this.Ss=void 0,this._conversationsManager=null,this.xs=!1,this.$s=null,this._instance=t}initialize(){this.loadIfEnabled()}onRemoteConfig(t){if(!this._instance.config.disable_conversations){var e=t.conversations;R(e)||(Ue(e)?this.Ss=e:(this.Ss=e.enabled,this.$s=e),this.loadIfEnabled())}}reset(){var t;(t=this._conversationsManager)==null||t.reset(),this._conversationsManager=null,this.Ss=void 0,this.$s=null}loadIfEnabled(){if(!(this._conversationsManager||this.xs||this._instance.config.disable_conversations||xa(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var t=C?.__PosthogExtensions__;if(t&&!w(this.Ss)&&this.Ss)if(this.$s&&this.$s.token){this.xs=!0;try{var e=t.initConversations;if(e)return this.ks(e),void(this.xs=!1);var r=t.loadExternalDependency;if(!r)return void this.Ps("PostHog loadExternalDependency extension not found.");r(this._instance,"conversations",(s=>{s||!t.initConversations?this.Ps("Could not load conversations script",s):this.ks(t.initConversations),this.xs=!1}))}catch(s){this.Ps("Error initializing conversations",s),this.xs=!1}}else Ee.error("Conversations enabled but missing token in remote config.")}}ks(t){if(this.$s)try{this._conversationsManager=t(this.$s,this._instance),Ee.info("Conversations loaded successfully")}catch(e){this.Ps("Error completing conversations initialization",e)}else Ee.error("Cannot complete initialization: remote config is null")}Ps(t,e){Ee.error(t,e),this._conversationsManager=null,this.xs=!1}show(){this._conversationsManager?this._conversationsManager.show():Ee.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ss===!0&&!Ce(this._conversationsManager)}isVisible(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&t!==void 0&&t}sendMessage(t,e,r){var s=this;return Me((function*(){return s._conversationsManager?s._conversationsManager.sendMessage(t,e,r):(Ee.warn("Conversations not available yet."),null)}))()}getMessages(t,e){var r=this;return Me((function*(){return r._conversationsManager?r._conversationsManager.getMessages(t,e):(Ee.warn("Conversations not available yet."),null)}))()}markAsRead(t){var e=this;return Me((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(t):(Ee.warn("Conversations not available yet."),null)}))()}getTickets(t){var e=this;return Me((function*(){return e._conversationsManager?e._conversationsManager.getTickets(t):(Ee.warn("Conversations not available yet."),null)}))()}requestRestoreLink(t){var e=this;return Me((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(t):(Ee.warn("Conversations not available yet."),null)}))()}restoreFromToken(t){var e=this;return Me((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(t):(Ee.warn("Conversations not available yet."),null)}))()}restoreFromUrlToken(){var t=this;return Me((function*(){return t._conversationsManager?t._conversationsManager.restoreFromUrlToken():(Ee.warn("Conversations not available yet."),null)}))()}getCurrentTicketId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&t!==void 0?t:null}getWidgetSessionId(){var t,e;return(t=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&t!==void 0?t:null}}},mh={logs:class{constructor(t){var e;this.Ts=!1,this.Rs=!1,this._instance=t,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Ts=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(t){var e,r=(e=t.logs)==null?void 0:e.captureConsoleLogs;!R(r)&&r&&(this.Ts=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ts&&!this.Rs){var t=X("[logs]"),e=C?.__PosthogExtensions__;if(e){var r=e.loadExternalDependency;r?r(this._instance,"logs",(s=>{var i;s||(i=e.logs)==null||!i.initializeLogs?t.error("Could not load logs script",s):(e.logs.initializeLogs(this._instance),this.Rs=!0)})):t.error("PostHog loadExternalDependency extension not found.")}else t.error("PostHog Extensions not found.")}}}},yh=y({},Fr,lh,ch,uh,dh,hh,fh,ph,gh,vh,_h,mh);Pe.__defaultExtensionClasses=y({},yh);var Sn,ot=(Sn=Gt[gt]=new Pe,(function(){function t(){t.done||(t.done=!0,Va=!1,V(Gt,(function(e){e._dom_loaded()})))}b!=null&&b.addEventListener?b.readyState==="complete"?t():J(b,"DOMContentLoaded",t,{capture:!1}):v&&x.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),Sn),io=S.createContext({client:ot,bootstrap:void 0});function no(t,e,r){if(r===void 0&&(r=new WeakMap),t===e)return!0;
108if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;if(r.has(t)&&r.get(t)===e)return!0;r.set(t,e);var s=Object.keys(t),i=Object.keys(e);if(s.length!==i.length)return!1;for(var n=0,a=s;n<a.length;n++){var o=a[n];if(!i.includes(o)||!no(t[o],e[o],r))return!1}return!0}function bh(t){var e,r,s=t.children,i=t.client,n=t.apiKey,a=t.options,o=S.useRef(null),l=S.useMemo(function(){return i?(n&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),i):(n||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),ot)},[i,n,JSON.stringify(a)]);return S.useEffect(function(){if(!i){var d=o.current;d?(n!==d.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),a&&!no(a,d.options)&&ot.set_config(a),o.current={apiKey:n,options:a??{}}):(ot.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),ot.init(n,a),o.current={apiKey:n,options:a??{}})}},[i,n,JSON.stringify(a)]),te.createElement(io.Provider,{value:{client:l,bootstrap:(e=a?.bootstrap)!==null&&e!==void 0?e:(r=i?.config)===null||r===void 0?void 0:r.bootstrap}},s)}var ns=function(t){return typeof t=="function"},As=function(t,e){return As=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])},As(t,e)};function xh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");As(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var wh={componentStack:null,exceptionEvent:null,error:null},kh={INVALID_FALLBACK:"[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."};(function(t){xh(e,t);function e(r){var s=t.call(this,r)||this;return s.state=wh,s}return e.prototype.componentDidCatch=function(r,s){var i=this.props.additionalProperties,n;ns(i)?n=i(r):typeof i=="object"&&(n=i);var a=this.context.client,o=a.captureException(r,n),l=s.componentStack;this.setState({error:r,componentStack:l??null,exceptionEvent:o})},e.prototype.render=function(){var r=this.props,s=r.children,i=r.fallback,n=this.state;if(n.componentStack==null)return ns(s)?s():s;var a=ns(i)?te.createElement(i,{error:n.error,componentStack:n.componentStack,exceptionEvent:n.exceptionEvent}):i;return te.isValidElement(a)?a:(console.warn(kh.INVALID_FALLBACK),te.createElement(te.Fragment,null))},e.contextType=io,e})(te.Component);function Eh({children:t}){const[e,r]=S.useState(!1);return S.useEffect(()=>{r(!0)},[]),e?c.jsx(bh,{client:ot,children:t}):c.jsx(c.Fragment,{children:t})}function Sh(){const t=qe();return c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-8",children:c.jsxs("div",{className:"max-w-md w-full text-center space-y-8",children:[c.jsx("div",{className:"flex justify-center",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("img",{src:lt,alt:"Talent Sourcer AI",className:"h-12 w-auto object-contain"}),c.jsx("span",{className:"text-xl font-mono font-bold text-foreground",children:"Talent Sourcer AI"})]})}),c.jsx("div",{children:c.jsx("h1",{className:"text-9xl font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent",children:"404"})}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Page Not Found"}),c.jsx("p",{className:"text-muted-foreground",children:"The page you're looking for doesn't exist or has been moved."})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[c.jsxs(he,{onClick:()=>t(de("/"),{replace:!0}),size:"lg",className:"min-w-[140px]",children:[c.jsx(rr,{className:"mr-2 h-4 w-4"}),"Go to Dashboard"]}),c.jsxs(he,{onClick:()=>t(-1),variant:"outline",size:"lg",className:"min-w-[140px]",children:[c.jsx(Ls,{className:"mr-2 h-4 w-4"}),"Go Back"]})]}),c.jsxs("div",{className:"pt-8 border-t border-border",children:[c.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Need help? Check out these resources:"}),c.jsxs("div",{className:"flex flex-wrap gap-3 justify-center text-sm",children:[c.jsx("a",{href:"https://docs.talentsourcer.ai/docs/getting-started",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Documentation"}),c.jsx("span",{className:"text-muted-foreground",children:"•"}),c.jsx("button",{onClick:()=>t(de("/"),{replace:!0}),className:"text-primary hover:underline",children:"Dashboard"})]})]})]})})}function jh(){const t=qe();return c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-8",children:c.jsxs("div",{className:"max-w-md w-full text-center space-y-8",children:[c.jsx("div",{className:"flex justify-center",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("img",{src:lt,alt:"Talent Sourcer AI",className:"h-12 w-auto object-contain"}),c.jsx("span",{className:"text-xl font-mono font-bold text-foreground",children:"Talent Sourcer AI"})]})}),c.jsx("div",{className:"flex justify-center",children:c.jsx("div",{className:"rounded-full bg-destructive/10 p-6",children:c.jsx(ac,{className:"h-16 w-16 text-destructive"})})}),c.jsx("div",{children:c.jsx("h1",{className:"text-9xl font-bold bg-gradient-to-r from-destructive to-destructive/60 bg-clip-text text-transparent",children:"500"})}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Server Error"}),c.jsx("p",{className:"text-muted-foreground",children:"Something went wrong on our end. We've been notified and are working to fix it."})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[c.jsxs(he,{onClick:()=>t(de("/"),{replace:!0}),size:"lg",className:"min-w-[140px]",children:[c.jsx(rr,{className:"mr-2 h-4 w-4"}),"Go to Dashboard"]}),c.jsxs(he,{onClick:()=>window.location.reload(),variant:"outline",size:"lg",className:"min-w-[140px]",children:[c.jsx(Ls,{className:"mr-2 h-4 w-4"}),"Try Again"]})]}),c.jsxs("div",{className:"pt-8 border-t border-border",children:[c.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Need immediate help?"}),c.jsxs("div",{className:"flex flex-wrap gap-3 justify-center text-sm",children:[c.jsx("a",{href:"https://docs.talentsourcer.ai/docs/getting-started",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Documentation"}),c.jsx("span",{className:"text-muted-foreground",children:"•"}),c.jsx("button",{onClick:()=>t(de("/"),{replace:!0}),className:"text-primary hover:underline",children:"Dashboard"})]})]})]})})}function Ih(){const t=qe();return c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-8",children:c.jsxs("div",{className:"max-w-md w-full text-center space-y-8",children:[c.jsx("div",{className:"flex justify-center",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("img",{src:lt,alt:"Talent Sourcer AI",className:"h-12 w-auto object-contain"}),c.jsx("span",{className:"text-xl font-mono font-bold text-foreground",children:"Talent Sourcer AI"})]})}),c.jsx("div",{className:"flex justify-center",children:c.jsx("div",{className:"rounded-full bg-orange-500/10 p-6",children:c.jsx(lc,{className:"h-16 w-16 text-orange-500"})})}),c.jsx("div",{children:c.jsx("h1",{className:"text-9xl font-bold bg-gradient-to-r from-orange-500 to-orange-500/60 bg-clip-text text-transparent",children:"403"})}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Access Forbidden"}),c.jsx("p",{className:"text-muted-foreground",children:"You don't have permission to access this resource. Contact your administrator if you believe this is an error."})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[c.jsxs(he,{onClick:()=>t(de("/"),{replace:!0}),size:"lg",className:"min-w-[140px]",children:[c.jsx(rr,{className:"mr-2 h-4 w-4"}),"Go to Dashboard"]}),c.jsxs(he,{onClick:()=>t(-1),variant:"outline",size:"lg",className:"min-w-[140px]",children:[c.jsx(Ls,{className:"mr-2 h-4 w-4"}),"Go Back"]})]}),c.jsxs("div",{className:"pt-8 border-t border-border",children:[c.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Need help? Check out these resources:"}),c.jsxs("div",{className:"flex flex-wrap gap-3 justify-center text-sm",children:[c.jsx("a",{href:"https://docs.talentsourcer.ai/docs/getting-started",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Documentation"}),c.jsx("span",{className:"text-muted-foreground",children:"•"}),c.jsx("button",{onClick:()=>t(de("/"),{replace:!0}),className:"text-primary hover:underline",children:"Dashboard"})]})]})]})})}function Ch(){const t=qe();return c.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background p-8",children:c.jsxs("div",{className:"max-w-md w-full text-center space-y-8",children:[c.jsx("div",{className:"flex justify-center",children:c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("img",{src:lt,alt:"Talent Sourcer AI",className:"h-12 w-auto object-contain"}),c.jsx("span",{className:"text-xl font-mono font-bold text-foreground",children:"Talent Sourcer AI"})]})}),c.jsx("div",{className:"flex justify-center",children:c.jsx("div",{className:"rounded-full bg-yellow-500/10 p-6",children:c.jsx(ec,{className:"h-16 w-16 text-yellow-500"})})}),c.jsx("div",{children:c.jsx("h1",{className:"text-9xl font-bold bg-gradient-to-r from-yellow-500 to-yellow-500/60 bg-clip-text text-transparent",children:"401"})}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("h2",{className:"text-2xl font-semibold text-foreground",children:"Authentication Required"}),c.jsx("p",{className:"text-muted-foreground",children:"You need to be signed in to access this page. Please log in to continue."})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[c.jsxs(he,{onClick:()=>window.location.href="/signin",size:"lg",className:"min-w-[140px]",children:[c.jsx(rc,{className:"mr-2 h-4 w-4"}),"Sign In"]}),c.jsxs(he,{onClick:()=>t(de("/"),{replace:!0}),variant:"outline",size:"lg",className:"min-w-[140px]",children:[c.jsx(rr,{className:"mr-2 h-4 w-4"}),"Go to Home"]})]}),c.jsxs("div",{className:"pt-8 border-t border-border",children:[c.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Need help? Check out these resources:"}),c.jsxs("div",{className:"flex flex-wrap gap-3 justify-center text-sm",children:[c.jsx("a",{href:"https://docs.talentsourcer.ai/docs/getting-started",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Documentation"}),c.jsx("span",{className:"text-muted-foreground",children:"•"}),c.jsx("a",{href:"/signup",className:"text-primary hover:underline",children:"Create Account"})]})]})]})})}const Hp=()=>
108[{rel:"preconnect",href:"https://fonts.googleapis.com"},{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"},{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"}],Nh=new jo("https://proficient-buffalo-564.convex.cloud");function Wp({children:t}){return c.jsxs("html",{lang:"en",children:[c.jsxs("head",{children:[c.jsx("meta",{charSet:"utf-8"}),c.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),c.jsx(vo,{}),c.jsx(_o,{}),c.jsx("script",{dangerouslySetInnerHTML:{__html:`
109              try {
110                let isDark = localStorage.theme === 'dark' || (!localStorage.theme && window.matchMedia('(prefers-color-scheme: dark)').matches);
111                document.documentElement.classList[isDark ? 'add' : 'remove']('dark');
112              } catch (e) {}
113            `}})]}),c.jsx("body",{className:"min-h-screen bg-background",children:c.jsx(Co,{children:c.jsxs(Eh,{children:[t,c.jsx(Ph,{}),c.jsx(mo,{}),c.jsx(yo,{})]})})})]})}function Ph(){const{theme:t}=Cn();return c.jsx(wl,{theme:t,richColors:!0,position:"bottom-right",closeButton:!0,expand:!1,visibleToasts:3,duration:4e3,toastOptions:{className:"font-sans"}})}function Th({isAuthenticated:t,userEmail:e,workspaceName:r,hideChat:s}){const i=S.useRef(!1);return S.useEffect(()=>{if(!t||!e)return;i.current||(ht.configure("58f788d2-e0ab-4746-acff-dc372a1a250d"),ht.load(),i.current=!0),ht.user.setEmail(e),ht.user.setNickname(r||"Unknown Workspace"),s?ht.chat.hide():ht.chat.show()},[t,e,r,s]),null}const Vp=fo(function({loaderData:e}){const r=Fs().pathname,[s,i]=S.useState(!1);return S.useEffect(()=>{i(!0)},[]),c.jsx(Ml,{loaderData:e,signUpFallbackRedirectUrl:"/",signInFallbackRedirectUrl:"/",children:c.jsx(Al,{client:Nh,useAuth:Un,children:c.jsx(So,{children:c.jsx(il,{children:c.jsx(Qc,{children:c.jsx(Oh,{currentPath:r,isHydrated:s})})})})})})});function Oh({currentPath:t,isHydrated:e}){const{isLoading:r,isAuthenticated:s,userId:i}=wo(),n=qe(),{orgId:a}=Un(),{user:o}=kl(),{organization:l}=Ds(),{userMemberships:d,setActive:u,isLoaded:h}=El({userMemberships:!0}),f=S.useMemo(()=>t.startsWith("/create-org"),[t]),g=S.useMemo(()=>t.startsWith("/org-setup"),[t]),p=S.useMemo(()=>t.startsWith("/onboarding"),[t]),_=S.useMemo(()=>t.startsWith("/welcome"),[t]),k=S.useMemo(()=>t.startsWith("/share/"),[t]),m=S.useMemo(()=>t.startsWith("/briefing-call/"),[t]),E=S.useMemo(()=>t.startsWith("/oauth/google/workspace/callback"),[t]),P=S.useMemo(()=>t.startsWith("/oauth/authorize"),[t]),N=S.useMemo(()=>t.startsWith("/device"),[t]),$=S.useMemo(()=>t.startsWith("/inbox"),[t]),[D,I]=S.useState(!$);S.useEffect(()=>{I(!$)},[$]);const T=ko(i),U=_e(M.users.getCurrentUserByClerkId,o?.id?{clerkId:o.id}:"skip"),W=_e(M.subscriptions.getCurrentSubscription),B=_e(M.organizations.getCurrentOrganization,{}),Q=_e(M.projects.getSampleProjectSetup,B?._id?{organizationId:B._id}:"skip"),fe=tr(M.projects.createSampleProjectSetup),[re,le]=S.useState(!1),we=S.useRef(null),ge=S.useRef(!1);if(S.useEffect(()=>{if(!(!s||!h)){if(d.data?.length===0&&!a&&!f&&!g&&!k&&!m&&!E&&!P&&!N&&!ge.current){ge.current=!0,n("/create-org",{replace:!0});return}s&&h&&!a&&!k&&!m&&!E&&!P&&!N&&!f&&!g&&d.data.length>0&&we.current!==d.data[0].organization.id&&(u({organization:d.data[0].organization.id}),we.current=d.data[0].organization.id)}},[s,h,d,f,g,k,m,E,P,N,f,g,n,u,a]),S.useEffect(()=>{!r&&!s&&!t.includes("/signin")&&!t.includes("/signup")&&!k&&!m&&!E&&!P&&!N&&n("/signin",{replace:!0})},[r,s,t,n,k,m,E,P,N]),S.useEffect(()=>{!r&&s&&U&&!U.onboarded&&!p&&!_&&!t.includes("/signin")&&!t.includes("/signup")&&!f&&!g&&!k&&!m&&!E&&!P&&!N&&a&&h&&n(de("/onboarding"),{replace:!0})},[r,s,U,p,_,t,f,g,k,m,E,P,N,a,h,n]),S.useEffect(()=>{g||s&&h&&!a&&!f&&!k&&!m&&!E&&!P&&!N&&n("/create-org",{replace:!0})},[s,h,a,f,g,k,m,E,P,N,n]),f||g||t.includes("/signin")||t.includes("/signup")||k||m||E||P||N)return c.jsx(si,{});if(r||T.isLoading)return c.jsxs("div",{className:"flex flex-col justify-center items-center h-screen",children:[c.jsx(hi,{className:"w-10 h-10 animate-spin mb
113-4"}),c.jsx("p",{children:"Loading..."})]});if(!a&&!f&&!g&&!p&&!k&&!m&&!E&&!P&&!N)return null;if(!T.isAssociated&&!f&&!g&&!p&&!k&&!m&&!E&&!P&&!N)return c.jsxs("div",{className:"flex flex-col justify-center items-center h-screen",children:[c.jsx(hi,{className:"w-10 h-10 animate-spin mb-4"}),c.jsx("p",{children:"Setting up your organization..."})]});const j=async()=>{if(!(re||!B?._id)){le(!0);try{const q=await fe({organizationId:B._id});n(de("/projects/:projectId/briefings",{projectId:String(q.projectId)}))}finally{le(!1)}}},z=!f&&!g&&!p&&!_&&!k&&!m&&!E,L=$,A=$||m||p||_;return c.jsxs(kc,{open:D,onOpenChange:I,children:[c.jsxs("div",{className:"flex min-h-screen w-full",children:[!f&&!g&&!p&&!_&&!k&&!m&&!E&&c.jsx(qc,{}),c.jsxs("div",{className:"flex-1 flex flex-col min-w-0",children:[z?c.jsxs("div",{className:"sticky top-0 z-40 bg-background",children:[L?c.jsx("div",{className:"hidden 2xl:block",children:c.jsx(mi,{})}):c.jsx(mi,{}),W?.isFree&&!t.startsWith("/organization")?B?.byokTrialCreditsGrantedAt?c.jsx("div",{className:"border-b border-blue-300 bg-blue-50 px-4 py-3",children:c.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-3 text-blue-900 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{className:"text-sm",children:[c.jsx("div",{className:"font-bold",children:"Start exploring TalentSourcer AI with a sample project"}),c.jsx("div",{children:"No LinkedIn connection needed. We will create a sample project with guided briefing and search instructions so you can run candidate checks end to end."})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(he,{size:"sm",variant:"outline",asChild:!0,children:c.jsx("a",{href:"/sample-candidates.csv",download:!0,children:"Download sample CSV"})}),c.jsx(he,{size:"sm",onClick:j,disabled:re,children:re?"Creating sample project...":Q?"Open sample project":"Create sample project"})]})]})}):c.jsx("div",{className:"border-b border-blue-300 bg-blue-50 px-4 py-3",children:c.jsxs("div",{className:"mx-auto flex w-full max-w-6xl flex-col gap-3 text-blue-900 md:flex-row md:items-center md:justify-between",children:[c.jsxs("div",{className:"text-sm",children:[c.jsx("div",{className:"font-bold",children:"Build your first shortlist."}),c.jsx("div",{children:"Check candidates against your client's requirements. See what matches, what's missing and what needs a closer look."})]}),c.jsx("div",{className:"flex items-center gap-2",children:c.jsx(he,{size:"sm",onClick:()=>n(de("/welcome")),children:"Set up your first search"})})]})}):null]}):null,c.jsx(si,{})]})]}),e&&c.jsx(Th,{isAuthenticated:s,userEmail:o?.emailAddresses?.[0]?.emailAddress,workspaceName:l?.name,hideChat:A})]})}const Gp=go(function({error:e}){let r="Oops!",s="An unexpected error occurred.",i;if(bo(e))switch(r=e.statusText||"Error",s=e.data?.message||e.statusText||s,e.status){case 401:return c.jsx(Ch,{});case 403:return c.jsx(Ih,{});case 404:return c.jsx(Sh,{});case 500:return c.jsx(jh,{})}return c.jsxs("main",{className:"pt-16 p-4 container mx-auto",children:[c.jsx("h1",{children:r}),c.jsx("p",{children:s}),i]})});export{Gp as ErrorBoundary,Wp as Layout,Vp as default,Hp as links};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.