{"version":3,"file":"Button_2.BAv5mPRf.mjs","names":["identifierIDParam","sponsorID","sponsorID","sponsorIDFromStorage"],"sources":["https:/framerusercontent.com/modules/crGnpPxMXyBxHcaTPaWQ/mZxkgxO1PqUPqNMZP56L/useParams.js","https:/framer.com/m/useParams-SU7t.js@mZxkgxO1PqUPqNMZP56L","https:/framerusercontent.com/modules/K1Hc03QIba0n4dlBmbh7/dN37o9yna2WGvGZKy2Xu/useLinkResolver.js","https:/framer.com/m/useLinkResolver-n9qB.js@dN37o9yna2WGvGZKy2Xu","https:/framerusercontent.com/modules/crGnpPxMXyBxHcaTPaWQ/j8IzQTMtoR30C3OwDv7U/useParams.js","https:/framer.com/m/useParams-SU7t.js@j8IzQTMtoR30C3OwDv7U","https:/framerusercontent.com/modules/rFdOUwl3DTESJXU1yAPF/72pdi7LI9UdsX34z66yU/bydesignHelpers.js","https:/framer.com/m/bydesignHelpers-gZnn.js@72pdi7LI9UdsX34z66yU","https:/framerusercontent.com/modules/VLi3PwmZgOEnehY7CK25/FYLf7QEv82ZAvgBc11rF/Button_2.js"],"sourcesContent":["export const useParams=()=>{const url=new URL(window.location.href);const sponsorIDParam=url.searchParams.get(\"sponsorID\");const sponsorParam=url.searchParams.get(\"sponsor\");const identifierIDParam=url.searchParams.get(\"identifierID\");const sponsorID=sponsorIDParam!==null&&sponsorIDParam!==void 0?sponsorIDParam:sponsorParam;const prospectingUrlQueryParams=`${sponsorID&&`?sponsorID=${sponsorID}`}\n    ${identifierIDParam&&sponsorID?`&identifierID=${identifierIDParam}`:identifierIDParam&&!sponsorID?`?identifierID=${identifierIDParam}`:\"\"}`;if(identifierIDParam){window.localStorage.setItem(\"identifierID\",identifierIDParam);}if(sponsorID){window.localStorage.setItem(\"sponsorID\",sponsorID);}const sponsorIDFromStorage=window.localStorage.getItem(\"sponsorID\");const identifierIDFromStorage=window.localStorage.getItem(\"identifierID\");return{identifierIDParam,sponsorIDParam,sponsorID,prospectingUrlQueryParams,sponsorIDFromStorage,identifierIDFromStorage};};\nexport const __FramerMetadata__ = {\"exports\":{\"useParams\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./useParams.map","/*\n * useParams\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/crGnpPxMXyBxHcaTPaWQ/mZxkgxO1PqUPqNMZP56L/useParams.js\"\n","import{useParams}from\"https://framer.com/m/useParams-SU7t.js@mZxkgxO1PqUPqNMZP56L\";const{sponsorID,identifierIDParam,sponsorIDFromStorage,identifierIDFromStorage}=useParams();export const resolveLinkUrlParams=(link,sponsorAsSlug,isNewParam)=>{const paramStartType=isNewParam?\"?\":\"&\";const identifierParamStart=!sponsorIDFromStorage?paramStartType:sponsorIDFromStorage&&sponsorAsSlug?paramStartType:\"&\";const resolvedSponsorParam=sponsorIDFromStorage&&sponsorAsSlug?`/${sponsorIDFromStorage}`:sponsorIDFromStorage&&!sponsorAsSlug?`${paramStartType}sponsor=${sponsorIDFromStorage}`:\"\";const resolvedIdentifierParam=identifierIDFromStorage?`${identifierParamStart}identifierID=${identifierIDFromStorage}`:\"\";return`${link}${resolvedSponsorParam}${resolvedIdentifierParam}`;};\nexport const __FramerMetadata__ = {\"exports\":{\"resolveLinkUrlParams\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./useLinkResolver.map","/*\n * useLinkResolver\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/K1Hc03QIba0n4dlBmbh7/dN37o9yna2WGvGZKy2Xu/useLinkResolver.js\"\n","import{useSponsor}from\"https://framer.com/m/useSponsor-VJAz.js@3moiMSmzD9j4Sz8NSHF6\";export const useParams=()=>{const url=new URL(window.location.href);const sponsorIDParam=url.searchParams.get(\"sponsorID\");const sponsorParam=url.searchParams.get(\"sponsor\");const identifierIDParam=url.searchParams.get(\"identifierID\");const sponsorID=sponsorIDParam??sponsorParam;const sponsorIDFromStorage=window.localStorage.getItem(\"sponsorID\");const identifierIDFromStorage=window.localStorage.getItem(\"identifierID\");const scrollToID=url.hash;console.table({sponsorIDParam,sponsorParam,identifierIDParam,sponsorID,sponsorIDFromStorage,identifierIDFromStorage,scrollToID});const prospectingUrlQueryParams=`${sponsorID&&`?sponsorID=${sponsorID}`}\n\n    ${identifierIDParam&&sponsorID?`&identifierID=${identifierIDParam}`:identifierIDParam&&!sponsorID?`?identifierID=${identifierIDParam}`:\"\"}`;if(identifierIDParam){window.localStorage.setItem(\"identifierID\",identifierIDParam);}if(sponsorID){window.localStorage.setItem(\"sponsorID\",sponsorID);}return{identifierIDParam,sponsorIDParam,sponsorID,scrollToID,prospectingUrlQueryParams,sponsorIDFromStorage,identifierIDFromStorage};};export const useValidSponsor=()=>{const url=new URL(window.location.href);const sponsorIDParam=url.searchParams.get(\"sponsorID\");const sponsorParam=url.searchParams.get(\"sponsor\");const identifierIDParam=url.searchParams.get(\"identifierID\");const sponsorID=sponsorIDParam??sponsorParam;const sponsorIDFromStorage=window.localStorage.getItem(\"sponsorID\");const identifierIDFromStorage=window.localStorage.getItem(\"identifierID\");const scrollToID=url.hash;const{error:sponsorError,data:sponsorData}=useSponsor(sponsorID??sponsorIDFromStorage);const sponsor=sponsorData?.user;return{isValidSponsor:!!sponsor,sponsor:sponsor,error:sponsorError};};\nexport const __FramerMetadata__ = {\"exports\":{\"useValidSponsor\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useParams\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./useParams.map","/*\n * useParams\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/crGnpPxMXyBxHcaTPaWQ/j8IzQTMtoR30C3OwDv7U/useParams.js\"\n","import{useValidSponsor}from\"https://framer.com/m/useParams-SU7t.js@j8IzQTMtoR30C3OwDv7U\";export const getCorrectShoppingCartLinkUrl=(categoryID,productID)=>{const{sponsor}=useValidSponsor();const genealogyId=sponsor?.genealogyId??\"9070\";return!!categoryID?shopCategoryUrl(categoryID):!!productID?viewProductDetailsUrl(productID):\"\";};export const resolveBydesignImage=imageUrl=>imageUrl?`https://extranet.securefreedom.com/SendOutCards/Shopping/Images/${imageUrl}`:\"\";export const formatPrice=price=>{const formatter=new Intl.NumberFormat(\"en-US\",{style:\"currency\",currency:\"USD\",minimumFractionDigits:2});if(price){return formatter.format(parseInt(price)).replace(/\\$/g,\"\");}return undefined;};export const viewProductDetailsUrl=productID=>{const{sponsor}=useValidSponsor();const genealogyId=sponsor?.genealogyId??\"9070\";return`https://shop.bydesign.com/SendOutCards/#/shop/detail/${productID}/from/${genealogyId}`;};export const shopCategoryUrl=categoryID=>{const{sponsor}=useValidSponsor();const genealogyId=sponsor?.genealogyId??\"9070\";return`https://shop.bydesign.com/SendOutCards/#/shop/from/${genealogyId}?categoryID=${categoryID}`;};\nexport const __FramerMetadata__ = {\"exports\":{\"getCorrectShoppingCartLinkUrl\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"viewProductDetailsUrl\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"shopCategoryUrl\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"formatPrice\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"resolveBydesignImage\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./bydesignHelpers.map","/*\n * bydesignHelpers\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/rFdOUwl3DTESJXU1yAPF/72pdi7LI9UdsX34z66yU/bydesignHelpers.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{resolveLinkUrlParams}from\"https://framer.com/m/useLinkResolver-n9qB.js@dN37o9yna2WGvGZKy2Xu\";import{getCorrectShoppingCartLinkUrl}from\"https://framer.com/m/bydesignHelpers-gZnn.js@72pdi7LI9UdsX34z66yU\";/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/docs/guides/auto-sizing\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function Button(props){const{title,color,fill,isOutline,gradient,radius,padding,style,fontSize,onClick,linkurl,attachSponsor,sponsorAsSlug,isNewQueryParam,openNewTab,generateShopLink,shopCategoryID,shopProductID}=props;const resolvedLinkUrl=resolveLinkUrlParams(linkurl,sponsorAsSlug,isNewQueryParam);const resolveButtonGradient=()=>{switch(gradient){case\"promptings\":return\"linear-gradient(281deg, #00e0e0 0%, rgb(5, 197, 235) 100%)\";case\"portal\":return\"linear-gradient()\";default:return fill;}};const isShopLink=generateShopLink;const resolveButtonLink=()=>isShopLink?getCorrectShoppingCartLinkUrl(shopCategoryID??\"\",shopProductID??\"\"):!isShopLink&&linkurl&&attachSponsor?resolvedLinkUrl:linkurl;return /*#__PURE__*/_jsx(motion.a,{style:{cursor:\"pointer\",textDecoration:\"none\",display:\"block\"},href:resolveButtonLink(),target:openNewTab?\"_blank\":\"initial\",children:/*#__PURE__*/_jsx(motion.div,{style:{...style,...containerStyle},children:/*#__PURE__*/_jsx(motion.div,{style:{padding:padding,borderRadius:radius,background:gradient!==\"none\"?resolveButtonGradient():isOutline?\"transparent\":fill,color:color,border:isOutline?`2px solid ${fill}`:\"none\",fontSize:fontSize,fontWeight:\"bold\",cursor:\"pointer\"},whileHover:{scale:1.01},children:title})})});}Button.defaultProps={background:{solid:\"#09F\",gradient:\"promptings\"},title:\"New Button\",link:{url:\"/opportunity\",shouldOpenNewTab:false,isSponsorQueryParam:false,isLinkDynamic:true,sponsorIDType:\"param\",paramStartType:\"?\"}};addPropertyControls(Button,{title:{title:\"Title\",type:ControlType.String},padding:{title:\"Padding\",defaultValue:\"15px 30px\",type:ControlType.String},fontSize:{title:\"Font Size Override\",defaultValue:\"18px\",type:ControlType.String},radius:{title:\"Radius\",defaultValue:13,type:ControlType.Number},color:{title:\"Text Color\",type:ControlType.Color,defaultValue:\"#FFF\"},fill:{title:\"Fill\",type:ControlType.Color},isOutline:{title:\"Outline Button\",type:ControlType.Boolean,defaultValue:false},gradient:{title:\"Gradient Background\",type:ControlType.Enum,defaultValue:\"none\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\",options:[\"none\",\"promptings\"],optionTitles:[\"No Gradient\",\"Promptings Gradient\"]},linkurl:{type:ControlType.String,defaultValue:\"https://app.sendoutcards.com/?client=promptings&affiliatejoin\",description:\"Supports both full url and /pagename slugs, to use a full url the value of this field must start with http or https:// \"},attachSponsor:{type:ControlType.Boolean,defaultValue:true},sponsorAsSlug:{type:ControlType.Boolean,defaultValue:false,description:\"If true the sponsor will be placed at the end of the url with a /122485\"},isNewQueryParam:{type:ControlType.Boolean,defaultValue:false},openNewTab:{type:ControlType.Boolean,defaultValue:true},generateShopLink:{type:ControlType.Boolean,defaultValue:false,description:\"Selecting true will ignore any value placed inside of 'Link url' and instead generate a shoppingcart link based on the values in 'shopCategoryID' and 'shopProductID'\"},shopCategoryID:{type:ControlType.String,defaultValue:\"12323\",title:\"Link to Category\",description:\"To link to a specific category in the shopping cart please provide the CategoryID, (note): Link to Product must be blank\"},shopProductID:{type:ControlType.String,defaultValue:\"\",title:\"Link to Product\",description:\"Generates a link to a specific products details by using the bydesign products;productID, (note):  Link to Category must be blank\"}});const containerStyle={display:\"flex\",justifyContent:\"start\",alignItems:\"center\",overflow:\"hidden\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Button\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":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