{"version":3,"file":"Button.BChmCTAP.mjs","names":["__esmMin","init_ssg_sandbox_shims","window","init_jsx_runtime","c","motion","init_framer_motion_DhsWWWsN","addPropertyControls","ControlType","init_framer_D1IzEvwH","init_useQuery","init_useSponsor","useParams","init_useParams","url","sponsorIDParam","sponsorParam","identifierIDParam","sponsorID","sponsorIDFromStorage","identifierIDFromStorage","scrollToID","prospectingUrlQueryParams","resolveLinkUrlParams","init_useLinkResolver","paramStartType","isNewParam","identifierParamStart","sponsorAsSlug","link","Button","props","resolvedLinkUrl","linkurl","scrollToId","isNewQueryParam","resolveButtonGradient","gradient","fill","shouldResolveLink","attachSponsor","openNewTab","style","containerStyle","radius","isOutline","title","init_Button"],"sources":["https:/framerusercontent.com/modules/lhD16y1eZ4KL3NOzpN9a/LmKvV2ZKLHohUm5F5Wwp/useSponsor.js","https:/framerusercontent.com/modules/crGnpPxMXyBxHcaTPaWQ/kJtF50rDzFhOziFzWgtU/useParams.js","https:/framerusercontent.com/modules/K1Hc03QIba0n4dlBmbh7/fy4oXEH5VbqfAYr6znbk/useLinkResolver.js","https:/framerusercontent.com/modules/rzCd5HLos5PTvRHBje0g/AZ0pjVeOApLpme2sOhkn/Button.js"],"sourcesContent":["import{useQuery}from\"https://framerusercontent.com/modules/IK6n26QjV0VFEZK4hmWq/lPalHQ8cXvpBPtYQLR4l/useQuery.js\";import{SOC_API}from\"https://framerusercontent.com/modules/q7LciDNLbH5BIMbdAVU4/trkufmEvdKANwaxi4Ay5/constants.js\";export const useSponsor=slug=>{const sponsorQuery=`\n        query GetUser($slug: String!) {\n            user(storefrontSlug: $slug) {\n                genealogyId\n                firstName\n                lastName\n                username\n                profileImageUrl\n                storefront {\n                    biography\n                    mugshot {\n                        url\n                    }\n                }\n                promptingsCoach {\n                    trainerId\n                    dateTrainingPurchased\n                    dateTrainingCompleted\n                    dateTrainingExpires\n                    dateCoachingPurchased\n                    dateAttendedCertification\n                    isCertified\n                }\n            }\n        }\n    `;return!!slug?useQuery(SOC_API,sponsorQuery,{variables:{slug}}):{data:null,isLoading:false,error:Error(\"No slug provided.\")};};\nexport const __FramerMetadata__ = {\"exports\":{\"PromptingsCoachType\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useSponsor\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./useSponsor.map","import{useSponsor}from\"https://framerusercontent.com/modules/lhD16y1eZ4KL3NOzpN9a/LmKvV2ZKLHohUm5F5Wwp/useSponsor.js\";//import { useLocalStorage } from \"https://framer.com/m/useLocalstorage-K4Wt.js@JbXmKVlAqSoHs4U8NZv9\"\nexport const useParams=()=>{// SSR protection\nif(typeof window===\"undefined\"){return{identifierIDParam:null,sponsorIDParam:null,sponsorID:null,scrollToID:\"\",prospectingUrlQueryParams:\"\",sponsorIDFromStorage:null,identifierIDFromStorage:null};}// Original browser logic\nconst 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=()=>{// SSR protection: no browser APIs on the server.\nconst isBrowser=typeof window!==\"undefined\";const url=isBrowser?new URL(window.location.href):null;const sponsorIDParam=url?.searchParams.get(\"sponsorID\")??null;const sponsorParam=url?.searchParams.get(\"sponsor\")??null;const identifierIDParam=url?.searchParams.get(\"identifierID\")??null;const sponsorID=sponsorIDParam??sponsorParam;const sponsorIDFromStorage=isBrowser?window.localStorage.getItem(\"sponsorID\"):null;const identifierIDFromStorage=isBrowser?window.localStorage.getItem(\"identifierID\"):null;const scrollToID=url?.hash??\"\";// React Hook must run unconditionally.\nconst{error:sponsorError,data:sponsorData}=useSponsor(sponsorID??sponsorIDFromStorage);const sponsor=sponsorData?.user;return{isValidSponsor:!!sponsor,sponsor:sponsor,error:sponsorError};};\nexport const __FramerMetadata__ = {\"exports\":{\"useParams\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useValidSponsor\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{useParams}from\"https://framerusercontent.com/modules/crGnpPxMXyBxHcaTPaWQ/kJtF50rDzFhOziFzWgtU/useParams.js\";export const resolveLinkUrlParams=(link,scrollToID,sponsorAsSlug,isNewParam)=>{// Prevent browser-only code from running during SSR.\nconst{sponsorIDFromStorage,identifierIDFromStorage}=typeof window!==\"undefined\"?useParams():{sponsorIDFromStorage:null,identifierIDFromStorage:null};// Original URL formatting logic preserved.\nconst 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}`:\"\";const resolvedScrollToHash=scrollToID??\"\";return`${link}${resolvedSponsorParam}${resolvedIdentifierParam}${resolvedScrollToHash}`;};\nexport const __FramerMetadata__ = {\"exports\":{\"resolveLinkUrlParams\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType}from\"framer\";import{resolveLinkUrlParams}from\"https://framerusercontent.com/modules/K1Hc03QIba0n4dlBmbh7/fy4oXEH5VbqfAYr6znbk/useLinkResolver.js\";/**\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 */// NOTE: This Is the Correct Button we use EVERYWHERE\nexport default function Button(props){const{title,color,fill,isOutline,gradient,radius,padding,style,fontSize,onClick,linkurl,attachSponsor,sponsorAsSlug,isNewQueryParam,openNewTab,scrollToId}=props;const resolvedLinkUrl=resolveLinkUrlParams(linkurl,scrollToId,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 shouldResolveLink=attachSponsor||scrollToId;const resolveButtonLink=()=>shouldResolveLink?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:\"?\",scrollToId:\"\"}};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:// \"},scrollToId:{type:ControlType.String,defaultValue:\"\",description:\"Will insert scrollTo has to the end of the formated url\"},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}});const containerStyle={display:\"flex\",justifyContent:\"start\",alignItems:\"center\",overflow:\"hidden\"};\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Button\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"A,4VCCa,MAAc,CAC3B,GAAUE,IAAS,OAAa,MAAM,CAAC,kBAAkB,KAAK,eAAe,KAAK,UA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