{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/Checkout-eGZ3.js", "ssg:https://framer.com/m/Customer-MZCV.js", "ssg:https://framerusercontent.com/modules/IPnAD3BB0R4U4ixKf5xs/8YV0lqtRVVgITi9FnjSU/pay.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";/**\n * --------------------------------------------------------------------\n * Overrides\n * --------------------------------------------------------------------\n *//**\n * An override to handle checkout confirmation variants & validation.\n */export const Confirmation=Component=>{return props=>{const[sessionInfo,setSessionInfo]=useState({isLoading:true});// State to hold confirmation response\nconst[confirmation,setConfirmation]=useState(null);// Parse the URL and process side effects in useEffect instead of useMemo.\nuseEffect(()=>{if(typeof window!==\"undefined\"){const searchParams=new URLSearchParams(window.location.search);const session_id=searchParams.get(\"session_id\");const endpoint=searchParams.get(\"endpoint\");if(!session_id||!endpoint){// If the params don't exist, redirect to the product page.\nwindow.location.href=props.product;}else{// Remove query parameters from the URL.\n// window.history.replaceState(\n//     null,\n//     \"\",\n//     window.location.pathname + window.location.hash\n// )\n// Update state with the parsed values.\nsetSessionInfo({isLoading:false,session_id,endpoint:atob(endpoint)});}}},[props.product]);// Fetch the session confirmation info.\nuseEffect(()=>{if(!sessionInfo.isLoading&&sessionInfo.session_id&&sessionInfo.endpoint){async function initialize(){try{const res=await fetch(`${sessionInfo.endpoint}?session_id=${sessionInfo.session_id}`);if(!res.ok){setConfirmation(false);return;}setConfirmation(await res.json());}catch(error){setConfirmation(false);}}initialize();}},[sessionInfo]);// If no session_id/endpoint exists after initial load, render nothing.\nif(!sessionInfo.session_id||!sessionInfo.endpoint){return null;}// While waiting for session info, render the \"Pending\" variant.\nif(sessionInfo.isLoading||confirmation===null){return /*#__PURE__*/_jsx(Component,{...props,variant:\"Pending\"});}// If the confirmation request failed, show the \"Error\" variant.\nif(confirmation===false){return /*#__PURE__*/_jsx(Component,{...props,variant:\"Error\"});}// If confirmation indicates a pending/open status, show the \"Failed\" variant.\nif(confirmation&&confirmation.status===\"Open\"){return /*#__PURE__*/_jsx(Component,{...props,variant:\"Failed\"});}// If confirmed, pass the email along to the component.\nif(confirmation&&confirmation.email){return /*#__PURE__*/_jsx(Component,{...props,email:confirmation.email,existing:confirmation.isExisting});}// Return an empty component.\nreturn null;};};/**\n * --------------------------------------------------------------------\n * Root\n * --------------------------------------------------------------------\n */export default function Checkout(Component){return({children,...props})=>{return /*#__PURE__*/_jsx(Component,{...props,children:children});};}\nexport const __FramerMetadata__ = {\"exports\":{\"Confirmation\":{\"type\":\"reactHoc\",\"name\":\"Confirmation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"Checkout\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Checkouts.map", "import{jsx as _jsx}from\"react/jsx-runtime\";import{isFramer}from\"https://framer.com/m/Capsule-oSSG.js\";import{toast}from\"https://framer.com/m/Sonner-2W7J.js\";import{useState}from\"react\";/**\n * --------------------------------------------------------------------\n * Overrides\n * --------------------------------------------------------------------\n *//**\n * An override to create a Stripe portal when the user clicks the button.\n */export const Portal=(Component,config)=>{if(isFramer)return props=>/*#__PURE__*/_jsx(Component,{...props});return({globals,...props})=>{const{credentials:{endpoint}}=config;const{isLoading,user}=globals;const[loading,setLoading]=useState(false);/**\n         * Redirect to customer portal.\n         */const createPortalSession=async e=>{e.preventDefault();try{if(!isLoading&&user){setLoading(true);const email=user?.primaryEmailAddress.emailAddress;if(email){// Start a portal session.\nconst response=await fetch(endpoint,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({user_id:user.id,email,return_url:window.location.href})});const{url,error}=await response.json();if(error){throw new Error(error);}window.location.href=url;}else{throw\"Your email is not set. Please visit your account settings to connect an email address.\";}}else{throw\"You must be logged in to access your customer portal.\";}}catch(error){setLoading(false);toast.error(error.message);}return false;};/**\n         * Render using the loading variant.\n         */if(isLoading||loading){return /*#__PURE__*/_jsx(Component,{...props,variant:\"Loading\"});}/**\n         * Render the component.\n         */return /*#__PURE__*/_jsx(\"span\",{onClick:createPortalSession,children:/*#__PURE__*/_jsx(Component,{...props,variant:loading?\"Loading\":props.variant})});};};/**\n * --------------------------------------------------------------------\n * Root\n * --------------------------------------------------------------------\n */export default function Customer(Component){return({children,...props})=>{return /*#__PURE__*/_jsx(Component,{...props,children:children});};}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Customer\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"Portal\":{\"type\":\"reactHoc\",\"name\":\"Portal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Customer.map", "/**\n * --------------------------------------------------------------------\n * Pay\n * --------------------------------------------------------------------\n */import*as DSPayCheckout from\"https://framer.com/m/Checkout-eGZ3.js\";import*as DSPayCustomer from\"https://framer.com/m/Customer-MZCV.js\";import{config}from\"https://framerusercontent.com/modules/jX5EYy75jVj4TMlbqJdO/ZNyVdLwu4XRXsi3mdylt/_capsule.js\";import{Globals}from\"https://framerusercontent.com/modules/xbyJH4uSP5O2i9iSVF4l/fygiY4oI49kqISnRvGPq/core.js\";/**\n * --------------------------------------------------------------------\n * Pay \u00BB Checkout\n * --------------------------------------------------------------------\n */export const Confirmation=Component=>{return DSPayCheckout.Confirmation(Component);};/**\n * --------------------------------------------------------------------\n * Pay \u00BB Customer\n * --------------------------------------------------------------------\n */export const Portal=Component=>{return Globals(DSPayCustomer.Portal(Component,{credentials:{endpoint:config.pay.portal.endpoint}}));};\nexport const __FramerMetadata__ = {\"exports\":{\"Portal\":{\"type\":\"reactHoc\",\"name\":\"Portal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Confirmation\":{\"type\":\"reactHoc\",\"name\":\"Confirmation\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__F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CD,EAAaC,CAAS,EAIpEC,EAAOD,GAAmBE,EAAsBD,EAAOD,EAAU,CAAC,YAAY,CAAC,SAASG,EAAO,IAAI,OAAO,QAAQ,CAAC,CAAC,CAAC",
  "names": ["Confirmation", "Component", "props", "sessionInfo", "setSessionInfo", "ye", "confirmation", "setConfirmation", "ue", "window", "searchParams", "session_id", "endpoint", "initialize", "res", "p", "Portal", "Component", "config", "isFramer", "props", "p", "globals", "endpoint", "isLoading", "user", "loading", "setLoading", "ye", "createPortalSession", "e", "email", "response", "window", "url", "error", "v", "Confirmation", "Component", "Portal", "Globals", "config"]
}
