{"version":3,"file":"PurchaseButtonFile.Ce1kLSRu.mjs","names":["React.useContext","React.useMemo","React.Fragment","React.useRef","React.useId","RichText","PurchaseButton"],"sources":["https:/framerusercontent.com/modules/rWrOoTzJlRpfmTeVJXVL/B2HK43sgylwN8wqI9P5h/G4GrSP_kp.js","https:/framer.com/m/PurchaseButton-VYcv.js@B2HK43sgylwN8wqI9P5h","https:/framerusercontent.com/modules/3nVLUa4UUZV05HaPAh19/lAPq3CVIdpvSh3BtXVHG/PurchaseButtonFile.js"],"sourcesContent":["// Generated by Framer (9f55354)\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addFonts,cx,RichText,useComponentViewport,useLocaleInfo,useVariantState,withCSS}from\"framer\";import{LayoutGroup,motion,MotionConfigContext}from\"framer-motion\";import*as React from\"react\";const serializationHash=\"framer-HtchF\";const variantClassNames={Jo5Biz3y8:\"framer-v-6s3g51\"};function addPropertyOverrides(overrides,...variants){const nextOverrides={};variants?.forEach(variant=>variant&&Object.assign(nextOverrides,overrides[variant]));return nextOverrides;}const transition1={bounce:.2,delay:0,duration:.4,type:\"spring\"};const transformTemplate1=(_,t)=>`translateY(-50%) ${t}`;const Transition=({value,children})=>{const config=React.useContext(MotionConfigContext);const transition=value??config.transition;const contextValue=React.useMemo(()=>({...config,transition}),[JSON.stringify(transition)]);return /*#__PURE__*/_jsx(MotionConfigContext.Provider,{value:contextValue,children:children});};const Variants=motion.create(React.Fragment);const getProps=({height,id,width,...props})=>{return{...props};};const createLayoutDependency=(props,variants)=>{if(props.layoutDependency)return variants.join(\"-\")+props.layoutDependency;return variants.join(\"-\");};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{activeLocale,setLocale}=useLocaleInfo();const{style,className,layoutId,variant,...restProps}=getProps(props);const{baseVariant,classNames,clearLoadingGesture,gestureHandlers,gestureVariant,isLoading,setGestureState,setVariant,variants}=useVariantState({defaultVariant:\"Jo5Biz3y8\",variant,variantClassNames});const layoutDependency=createLayoutDependency(props,variants);const sharedStyleClassNames=[];const scopingClassNames=cx(serializationHash,...sharedStyleClassNames);const ref1=React.useRef(null);const defaultLayoutId=React.useId();const componentViewport=useComponentViewport();return /*#__PURE__*/_jsx(LayoutGroup,{id:layoutId??defaultLayoutId,children:/*#__PURE__*/_jsx(Variants,{animate:variants,initial:false,children:/*#__PURE__*/_jsx(Transition,{value:transition1,children:/*#__PURE__*/_jsx(motion.div,{...restProps,...gestureHandlers,className:cx(scopingClassNames,\"framer-6s3g51\",className,classNames),\"data-framer-name\":\"Variant 1\",layoutDependency:layoutDependency,layoutId:\"Jo5Biz3y8\",ref:ref??ref1,style:{backgroundColor:\"rgb(36, 108, 193)\",borderBottomLeftRadius:11,borderBottomRightRadius:11,borderTopLeftRadius:11,borderTopRightRadius:11,...style},children:/*#__PURE__*/_jsxs(motion.div,{className:\"framer-zlhytt\",layoutDependency:layoutDependency,layoutId:\"hnMvjfsv8\",children:[/*#__PURE__*/_jsx(RichText,{__fromCanvasComponent:true,children:/*#__PURE__*/_jsx(React.Fragment,{children:/*#__PURE__*/_jsxs(motion.p,{style:{\"--font-selector\":\"R0Y7UHVibGljIFNhbnMtNjAw\",\"--framer-font-family\":'\"Public Sans\", \"Public Sans Placeholder\", sans-serif',\"--framer-font-size\":\"19px\",\"--framer-font-weight\":\"600\",\"--framer-line-height\":\"43.86px\",\"--framer-text-alignment\":\"center\",\"--framer-text-color\":\"var(--extracted-r6o4lv, rgb(255, 255, 255))\"},children:[\"Buy Now for only \",/*#__PURE__*/_jsx(motion.span,{style:{\"--framer-letter-spacing\":\"-0.2px\"},children:\"₹64\"}),\"9 \"]})}),className:\"framer-v6t4ci\",\"data-framer-name\":\"Buy Now\",fonts:[\"GF;Public Sans-600\"],layoutDependency:layoutDependency,layoutId:\"hrdSSETPd\",style:{\"--extracted-r6o4lv\":\"rgb(255, 255, 255)\",\"--framer-paragraph-spacing\":\"0px\"},verticalAlignment:\"center\",withExternalLayout:true}),/*#__PURE__*/_jsxs(motion.div,{className:\"framer-1jc1tyw\",layoutDependency:layoutDependency,layoutId:\"tcMy6zSzE\",children:[/*#__PURE__*/_jsx(motion.div,{className:\"framer-y0h40p\",layoutDependency:layoutDependency,layoutId:\"L4878qjJz\",style:{backgroundColor:\"rgb(255, 255, 255)\",opacity:.5}}),/*#__PURE__*/_jsx(RichText,{__fromCanvasComponent:true,children:/*#__PURE__*/_jsx(React.Fragment,{children:/*#__PURE__*/_jsxs(motion.p,{style:{\"--font-selector\":\"R0Y7UHVibGljIFNhbnMtNjAw\",\"--framer-font-family\":'\"Public Sans\", \"Public Sans Placeholder\", sans-serif',\"--framer-font-size\":\"19px\",\"--framer-font-weight\":\"600\",\"--framer-line-height\":\"43.86px\",\"--framer-text-alignment\":\"center\",\"--framer-text-color\":\"var(--extracted-r6o4lv, rgb(255, 255, 255))\"},children:[\"  \",/*#__PURE__*/_jsx(motion.span,{style:{\"--framer-letter-spacing\":\"-0.2px\"},children:\"₹\"}),\"899\"]})}),className:\"framer-mq4cmj\",\"data-framer-name\":\"Buy Now\",fonts:[\"GF;Public Sans-600\"],layoutDependency:layoutDependency,layoutId:\"ieIT_hcdx\",style:{\"--extracted-r6o4lv\":\"rgb(255, 255, 255)\",\"--framer-paragraph-spacing\":\"0px\",opacity:.5},transformTemplate:transformTemplate1,verticalAlignment:\"center\",withExternalLayout:true})]})]})})})})});});const css=[\"@supports (aspect-ratio: 1) { body { --framer-aspect-ratio-supported: auto; } }\",\".framer-HtchF.framer-1u92gcf, .framer-HtchF .framer-1u92gcf { display: block; }\",\".framer-HtchF.framer-6s3g51 { height: 61px; overflow: hidden; position: relative; width: 563px; will-change: var(--framer-will-change-override, transform); }\",\".framer-HtchF .framer-zlhytt { flex: none; height: 16px; left: calc(50.08880994671405% - 268px / 2); overflow: visible; position: absolute; top: calc(50.81967213114756% - 16px / 2); width: 268px; }\",\".framer-HtchF .framer-v6t4ci { flex: none; height: 15px; left: -5px; position: absolute; top: calc(50.00000000000002% - 15px / 2); white-space: pre-wrap; width: 218px; word-break: break-word; word-wrap: break-word; }\",\".framer-HtchF .framer-1jc1tyw { bottom: 0px; flex: none; overflow: hidden; position: absolute; right: -3px; top: 0px; width: 58px; }\",\".framer-HtchF .framer-y0h40p { flex: none; height: 2px; left: calc(50.00000000000002% - 55px / 2); overflow: hidden; position: absolute; top: calc(50.00000000000002% - 2px / 2); width: 55px; }\",\".framer-HtchF .framer-mq4cmj { flex: none; height: 15px; left: -3px; position: absolute; top: 50%; white-space: pre; width: auto; }\"];/**\n * This is a generated Framer component.\n * @framerIntrinsicHeight 61\n * @framerIntrinsicWidth 563\n * @framerCanvasComponentVariantDetails {\"propertyName\":\"variant\",\"data\":{\"default\":{\"layout\":[\"fixed\",\"fixed\"]}}}\n * @framerImmutableVariables true\n * @framerDisplayContentsDiv false\n * @framerComponentViewportWidth true\n */const FramerG4GrSP_kp=withCSS(Component,css,\"framer-HtchF\");export default FramerG4GrSP_kp;FramerG4GrSP_kp.displayName=\"PurchaseButton\";FramerG4GrSP_kp.defaultProps={height:61,width:563};addFonts(FramerG4GrSP_kp,[{explicitInter:true,fonts:[{family:\"Public Sans\",source:\"google\",style:\"normal\",url:\"https://fonts.gstatic.com/s/publicsans/v18/ijwGs572Xtc6ZYQws9YVwllKVG8qX1oyOymuyJ65xg0pX189fg.woff2\",weight:\"600\"}]}],{supportsExplicitInterCodegen:true});\nexport const __FramerMetadata__ = {\"exports\":{\"Props\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"FramerG4GrSP_kp\",\"slots\":[],\"annotations\":{\"framerComponentViewportWidth\":\"true\",\"framerIntrinsicWidth\":\"563\",\"framerContractVersion\":\"1\",\"framerCanvasComponentVariantDetails\":\"{\\\"propertyName\\\":\\\"variant\\\",\\\"data\\\":{\\\"default\\\":{\\\"layout\\\":[\\\"fixed\\\",\\\"fixed\\\"]}}}\",\"framerIntrinsicHeight\":\"61\",\"framerDisplayContentsDiv\":\"false\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./G4GrSP_kp.map","/*\n * PurchaseButton\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/rWrOoTzJlRpfmTeVJXVL/B2HK43sgylwN8wqI9P5h/G4GrSP_kp.js\"\nexport { default } from \"https://framerusercontent.com/modules/rWrOoTzJlRpfmTeVJXVL/B2HK43sgylwN8wqI9P5h/G4GrSP_kp.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import PurchaseButton from\"https://framer.com/m/PurchaseButton-VYcv.js@B2HK43sgylwN8wqI9P5h\";import{addPropertyControls,ControlType}from\"framer\";export default function PurchaseButtonFile(props){const trackButtonClick=async eventName=>{console.log(props.itemId,eventName);try{await fetch(\"https://asia-south1-pythondjangoserver.cloudfunctions.net/button_click_tracker\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({eventName})}).then(()=>{window.open(`https://nfobooks.checkout.nationalfinanceolympiad.com/CheckoutPage/?item_id=${props.itemId}`,\"_self\");console.log(`https://nfobooks.checkout.nationalfinanceolympiad.com/CheckoutPage/?item_id=${props.itemId}`);});}catch(error){console.error(\"Error tracking button click:\",error);}};return /*#__PURE__*/_jsx(PurchaseButton,{onClick:()=>{trackButtonClick(props.itemId===1?\"personal_finance_handbook_grade_6_8_add_to_cart\":\"personal_finance_handbook_grade_10_12_add_to_cart\");}});}addPropertyControls(PurchaseButtonFile,{itemId:{title:\"Item Id\",type:ControlType.Number,defaultValue:1,max:2,min:1}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PurchaseButtonFile\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./PurchaseButtonFile.map"],"mappings":"uXACyD,IAAoG,IAAkE,IAA4B,CAAM,EAAkB,eAAqB,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