import s from"posthog-js";var p={CTA_INSTALL_CLICK:"cta_install_click",CTA_STUDIO_CLICK:"cta_studio_click",DOCS_QUICKSTART_VIEW:"docs_quickstart_view",COPY_COMMAND_CLICK:"copy_command_click",EXAMPLE_REPO_OPEN:"example_repo_open"},n=process.env.NEXT_PUBLIC_CONTRACTSPEC_POSTHOG_KEY,c=process.env.NEXT_PUBLIC_POSTHOG_HOST||"https://eu.posthog.com",a=()=>{if(typeof window>"u")return!1;let t=window.navigator,o=window,e=t.doNotTrack??t.msDoNotTrack??o.doNotTrack;return e!=="1"&&e!=="yes"};function _(){if(typeof window>"u")return;if(!n){console.warn("[PostHog] NEXT_PUBLIC_CONTRACTSPEC_POSTHOG_KEY is missing");return}if(!a())return;let t=!1;s.init(n,{api_host:c,autocapture:!t,capture_dead_clicks:!t,capture_performance:!t,capture_pageview:!t,capture_heatmaps:!t,capture_exceptions:!t,debug:!1})}function u(t,o){if(!n)return;if(!a())return;try{(globalThis.posthog??s)?.capture?.(t,o)}catch{return}}var l=s;export{n as posthogKey,c as posthogHost,s as posthog,_ as initPosthog,l as default,u as captureAnalyticsEvent,p as analyticsEventNames};
