{"version":3,"file":"DynamicPrice.BviOSVAf.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/bKO2hRSmvXzmWmYQl9Te/T3I74WZ35CnpzfoDQa5d/DynamicPrice.js"],"sourcesContent":["// Get Started: https://www.framer.com/developers\nimport{jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useState}from\"react\";export default function DynamicPrice({basePrice}){const[finalPrice,setFinalPrice]=useState(null);useEffect(()=>{fetch(\"https://api-production.streamlinehq.com/v4/checkouts/power-parity-discount\").then(res=>res.json()).then(data=>{if(data.hasDiscount&&typeof data.discountPercentage===\"number\"){const discount=basePrice*data.discountPercentage/100;setFinalPrice(basePrice-discount);}else{setFinalPrice(basePrice);}}).catch(()=>{setFinalPrice(basePrice);});},[basePrice]);const displayPrice=finalPrice??basePrice;return /*#__PURE__*/_jsxs(\"span\",{style:{fontSize:16,fontWeight:500,color:\"#595959\"},children:[\"from $\",displayPrice.toFixed(0),\"/month\"]});}addPropertyControls(DynamicPrice,{basePrice:{type:ControlType.Number,title:\"Base Price\",defaultValue:29,min:0,step:.01}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DynamicPrice\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./DynamicPrice.map"],"mappings":"iLACuI,SAAwB,EAAa,CAAC,aAAW,CAAC,GAAK,CAAC,EAAW,GAAeA,EAAS,KAAK,CAA+Z,OAA9Z,MAAc,CAAC,MAAM,6EAA6E,CAAC,KAAK,GAAK,EAAI,MAAM,CAAC,CAAC,KAAK,GAAM,CAAI,EAAK,aAAa,OAAO,EAAK,oBAAqB,SAA+D,EAAc,EAApD,EAAU,EAAK,mBAAmB,IAAqC,CAAO,EAAc,EAAU,EAAI,CAAC,UAAU,CAAC,EAAc,EAAU,EAAG,EAAG,CAAC,EAAU,CAAC,CAA8D,EAAM,OAAO,CAAC,MAAM,CAAC,SAAS,GAAG,WAAW,IAAI,MAAM,UAAU,CAAC,SAAS,CAAC,UAArH,GAAY,GAA+H,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,kBAApuB,IAAoD,IAAsC,CAA4oB,EAAoB,EAAa,CAAC,UAAU,CAAC,KAAK,EAAY,OAAO,MAAM,aAAa,aAAa,GAAG,IAAI,EAAE,KAAK,IAAI,CAAC,CAAC"}