{"version":3,"file":"Button9x.C77rO2wV.mjs","names":["React.useState"],"sources":["https:/framerusercontent.com/modules/UIUpMuZsp3OfK9XBbgT1/wvmtNraCSS0KyHOmtoCZ/Button9x.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 150\n * @framerIntrinsicHeight 50\n */export default function Button9x(props){const{text,link,newTab,buttonAction,tallyId,tallyWidth,calLink,dataAttributes,variant,trackClick,trackCategory,trackProduct,trackElement,trackAction}=props;// Store the RudderStack Anonymous ID and Session ID in state\nconst[rsAid,setRsAid]=React.useState(\"\");const[rsSid,setRsSid]=React.useState(\"\");const[srcPage,setSrcPage]=React.useState(\"\");// Grab the Anonymous ID & Session ID only when buttonAction === \"tally\"\nReact.useEffect(()=>{// Check if the button action is tally, cal, or if it's link with a Stripe URL\nif(buttonAction===\"tally\"||buttonAction===\"cal\"||buttonAction===\"link\"&&(link.includes(\"buy.stripe.com\")||link.includes(\"form.go9x.com/tutorial-access\"))){const pageURL=encodeURIComponent(window.location.href);if(pageURL)setSrcPage(pageURL);// Ensure RudderStack is available and the methods exist\nif(typeof window!==\"undefined\"&&window.rudderanalytics&&window.rudderanalytics.getAnonymousId&&window.rudderanalytics.getSessionId){console.log(\"button mounted\");rudderanalytics.ready(()=>{const anonId=window.rudderanalytics.getAnonymousId();const sessionId=window.rudderanalytics.getSessionId();if(anonId)setRsAid(anonId);if(sessionId)setRsSid(sessionId);console.log(\"analytics set\");});//\n}}},[buttonAction]);// Animation variants\nconst textVariants={initial:{fontWeight:\"600\"},hover:{fontWeight:\"600\"}};let boxshadow=\"2px 2px 0px 0px #0F1E35\";let hoverBoxshadow=\"6px 6px 0px 0px #0F1E35\";let buttonStyle={display:\"flex\",padding:\"8px 16px\",justifyContent:\"center\",alignItems:\"center\",gap:\"10px\",borderRadius:\"5px\",border:\"2px solid #0F1E35\",cursor:\"pointer\",textDecoration:\"none\"};let textStyle={textAlign:\"center\",fontFamily:\"Inter, sans-serif\",fontSize:\"16px\",lineHeight:\"125%\"};switch(variant){case\"white\":buttonStyle.background=\"#FFF\";textStyle.color=\"#0F1E35\";break;case\"boring-blue\":buttonStyle.background=\"#3f4b5d\";textStyle.color=\"#FFF\";break;case\"flashy-yellow\":buttonStyle.background=\"#FFCA51\";textStyle.color=\"#0F1E35\";break;case\"flashy-orange\":buttonStyle.background=\"#FF6D33\";textStyle.color=\"#FFF\";break;case\"white-boring-blue-shadow\":buttonStyle.background=\"#FFF\";buttonStyle.border=\"2px solid #000\";textStyle.color=\"#0f1e35\";boxshadow=\"2px 2px 0px 0px #000\";hoverBoxshadow=\"6px 6px 0px 0px #000\";break;case\"flashy-yellow-boring-blue-shadow\":buttonStyle.background=\"#FFCA51\";buttonStyle.border=\"2px solid #000\";textStyle.color=\"#0F1E35\";boxshadow=\"2px 2px 0px 0px #000\";hoverBoxshadow=\"6px 6px 0px 0px #000\";break;default:buttonStyle.background=\"#FF6D33\";textStyle.color=\"#FFF\";break;}let buttonVariants={initial:{boxShadow:boxshadow},hover:{boxShadow:hoverBoxshadow}};const getModifiedLink=originalLink=>{if(!originalLink)return\"#\";// Only modify the link if it contains either of the specific URL patterns\nconst isTutorialForm=originalLink.includes(\"form.go9x.com/tutorial-access\");const isStripeForm=originalLink.includes(\"buy.stripe.com\");if(!isTutorialForm&&!isStripeForm){return originalLink;}const params=new URLSearchParams;if(isTutorialForm){if(rsAid)params.append(\"aid\",rsAid);if(rsSid)params.append(\"sid\",rsSid);}else if(isStripeForm){if(rsAid&&rsSid){const stripeClientReferenceId=`${rsAid}_${rsSid}`;params.append(\"client_reference_id\",stripeClientReferenceId);}}const queryString=params.toString();if(!queryString)return originalLink;// Check if the originalLink already has query parameters\nconst separator=originalLink.includes(\"?\")?\"&\":\"?\";return`${originalLink}${separator}${queryString}`;};// Build up data attributes from any array items passed in\nconst dataAttrs={};if(dataAttributes){dataAttributes.forEach(attr=>{if(attr.key&&attr.value){dataAttrs[`data-${attr.key}`]=attr.value;}});}// If the button action is \"tally\", add the required Tally + RudderStack attributes\nif(buttonAction===\"tally\"){dataAttrs[\"data-tally-open\"]=tallyId;dataAttrs[\"data-tally-layout\"]=\"modal\";dataAttrs[\"data-tally-width\"]=tallyWidth;// Add the RudderStack Anonymous ID\nif(rsAid){dataAttrs[\"data-rs_aid\"]=rsAid;}// Add the RudderStack Session ID\nif(rsSid){dataAttrs[\"data-rs_sid\"]=rsSid;}if(srcPage){dataAttrs[\"data-src_page\"]=srcPage;}}// If the button action is \"cal\", add the link attributes\nconst getCalLinkWithParams=baseCalLink=>{const params=new URLSearchParams;if(trackElement)params.append(\"source-element\",trackElement);if(trackCategory)params.append(\"source-category\",trackCategory);if(trackProduct)params.append(\"source-product\",trackProduct);if(rsAid)params.append(\"source-aid\",rsAid);if(rsSid)params.append(\"source-sid\",rsSid);if(srcPage)params.append(\"source-page\",srcPage);const queryString=params.toString();if(!queryString)return baseCalLink;// Check if the baseCalLink already has query parameters\nconst separator=baseCalLink.includes(\"?\")?\"&\":\"?\";return`${baseCalLink}${separator}${queryString}`;};if(buttonAction===\"cal\"){const calLinkWithParams=getCalLinkWithParams(calLink);dataAttrs[\"data-nx-cal-link\"]=calLinkWithParams;dataAttrs[\"data-cal-link\"]=calLinkWithParams;}// Handle click tracking\nconst handleClick=()=>{if(trackClick){const eventProperties={cta_type:trackAction,product_category:trackCategory};if(trackProduct){eventProperties.product_type=trackProduct;}if(trackElement){eventProperties.element=trackElement;}// RudderStack tracking call\nrudderanalytics.track(\"cta_click\",eventProperties);}};return /*#__PURE__*/_jsx(motion.a,{href:buttonAction===\"link\"?getModifiedLink(link):undefined,target:newTab?\"_blank\":\"_self\",style:buttonStyle,variants:buttonVariants,initial:\"initial\",whileHover:\"hover\",onClick:handleClick,...dataAttrs,children:/*#__PURE__*/_jsx(motion.span,{style:textStyle,variants:textVariants,children:text})});}Button9x.defaultProps={text:\"Button\",link:\"#\",dataAttributes:[],variant:\"flashy-orange\",buttonAction:\"link\",tallyId:\"\",tallyWidth:600,calLink:\"team/9x/quick-chat\",newTab:false,trackClick:false,trackCategory:\"learning\",trackProduct:\"\",trackElement:\"\",trackAction:\"book-call\"};addPropertyControls(Button9x,{variant:{type:ControlType.Enum,title:\"Variant\",options:[\"flashy-orange\",\"white\",\"boring-blue\",\"flashy-yellow\",\"white-boring-blue-shadow\",\"flashy-yellow-boring-blue-shadow\"],optionTitles:[\"Flashy Orange\",\"White\",\"Boring Blue\",\"Flashy Yellow\",\"White - Boring Blue Shadow\",\"Flashy Yellow - Boring Blue Shadow\"],defaultValue:\"flashy-yellow\"},text:{type:ControlType.String,title:\"Button Text\",defaultValue:\"Get started\"},buttonAction:{type:ControlType.Enum,title:\"Button Action\",options:[\"link\",\"tally\",\"cal\"],optionTitles:[\"Link\",\"Tally Popup\",\"Cal.com Popup\"],defaultValue:\"link\"},link:{type:ControlType.String,title:\"Link\",defaultValue:\"#\",hidden:props=>props.buttonAction!==\"link\"},newTab:{type:ControlType.Boolean,title:\"New Tab\",defaultValue:false,hidden:props=>props.buttonAction!==\"link\"},tallyId:{type:ControlType.String,title:\"Tally ID\",defaultValue:\"\",hidden:props=>props.buttonAction!==\"tally\"},tallyWidth:{type:ControlType.Number,title:\"Tally Modal Width\",defaultValue:600,min:0,unit:\"px\",hidden:props=>props.buttonAction!==\"tally\"},calLink:{type:ControlType.String,title:\"Cal.com Link\",defaultValue:\"team/9x/quick-chat\",hidden:props=>props.buttonAction!==\"cal\"},trackClick:{type:ControlType.Boolean,title:\"Track Click\",defaultValue:false},trackAction:{type:ControlType.Enum,title:\"Track Action\",options:[\"book-call\",\"enrol-course\",\"purchase-course\",\"join-waitlist\",\"scroll\",\"contact\",\"login\"],optionTitles:[\"Book Call\",\"Enrol Course\",\"Purchase Course\",\"Join Waitlist\",\"Scroll\",\"Contact\",\"Login\"],defaultValue:\"book-call\",hidden:props=>!props.trackClick},trackCategory:{type:ControlType.Enum,title:\"Track Category\",options:[\"learning\",\"advisory\",\"general\"],optionTitles:[\"Learning\",\"Advisory\",\"General\"],defaultValue:\"learning\",hidden:props=>!props.trackClick},trackElement:{type:ControlType.String,title:\"Track Element\",defaultValue:\"\",hidden:props=>!props.trackClick},trackProduct:{type:ControlType.String,title:\"Track Product\",defaultValue:\"\",hidden:props=>!props.trackClick},dataAttributes:{type:ControlType.Array,title:\"Data Attributes\",control:{type:ControlType.Object,controls:{key:{type:ControlType.String,title:\"Key\"},value:{type:ControlType.String,title:\"Value\"}}}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Button9x\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"50\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"* @framerIntrinsicWidth 150\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Button9x.map"],"mappings":"2OAIG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,SAAO,eAAa,UAAQ,aAAW,UAAQ,iBAAe,UAAQ,aAAW,gBAAc,eAAa,eAAa,eAAa,EAC5L,CAAC,EAAM,GAAUA,EAAe,GAAG,CAAM,CAAC,EAAM,GAAUA,EAAe,GAAG,CAAM,CAAC,EAAQ,GAAYA,EAAe,GAAG,CAC9H,MAAoB,CACpB,GAAG,IAAe,SAAS,IAAe,OAAO,IAAe,SAAS,EAAK,SAAS,iBAAiB,EAAE,EAAK,SAAS,gCAAgC,EAAE,CAAC,IAAM,EAAQ,mBAAmB,EAAO,SAAS,KAAK,CAAI,GAAQ,EAAW,EAAQ,CACtO,IAAS,QAAa,EAAO,iBAAiB,EAAO,gBAAgB,gBAAgB,EAAO,gBAAgB,eAAc,QAAQ,IAAI,iBAAiB,CAAC,gBAAgB,UAAU,CAAC,IAAM,EAAO,EAAO,gBAAgB,gBAAgB,CAAO,EAAU,EAAO,gBAAgB,cAAc,CAAI,GAAO,E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