const e=new Map,i=(i,n)=>{"undefined"!=typeof window&&window.plausible&&((i,n)=>{const o=`${i}_${JSON.stringify(n)}`,s=Date.now();return s-(e.get(o)||0)>=1e3&&(e.set(o,s),!0)})(i,n)&&window.plausible(i,{props:n})},n=e=>{"undefined"!=typeof window&&window.plausible&&window.plausible("Questionnaire Start",{props:{source:e||"direct"}})},o=e=>{"undefined"!=typeof window&&window.plausible&&window.plausible("Questionnaire Complete",{props:{business_type:e}})},s=(e="email",i=!1)=>{"undefined"!=typeof window&&window.plausible&&window.plausible("Sign Up",{props:{method:e,from_questionnaire:i}})},t=(e="email",i=!1)=>{"undefined"!=typeof window&&window.plausible&&window.plausible("Login",{props:{method:e,from_questionnaire:i}})},d=(e,i,n="v1")=>{if("undefined"!=typeof window&&window.plausible){const o=`${"v1"===n?"1":"2"}.${e}`;window.plausible("Question Answered",{props:{question_number:o,question_id:i,questionnaire_version:n}})}},w=(e,i="USD",n,o)=>{"undefined"!=typeof window&&window.plausible&&window.plausible("Begin Checkout",{revenue:{currency:i,amount:e},props:{product_id:n,product_name:a(n),category:"Digital Service",coupon_code:"none"}})},a=e=>({complete_guide:"Complete Marketing Guide",agency_pack:"Agency Pack (10 Credits)",entrepreneur_pack:"Entrepreneur Pack (3 Credits)"}[e]||"MarketingGuide AI Service"),r=()=>{if("undefined"!=typeof window){const e=new URLSearchParams(window.location.search),n=e.get("success"),o=e.get("session_id");if("true"===n&&o){i("Purchase Success",{session_id:o});const e=window.location.origin+window.location.pathname;return window.history.replaceState({},document.title,e),!0}}return!1};export{s as a,n as b,r as c,d,o as e,w as f,t};