{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/3UxBJlAFsxvp1Qhtwbnd/W3YssxjYWcXC9c3onF31/Checkout.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{useEffect,useState}from\"react\";import{initializeApp,getApps}from\"firebase/app\";import{getFirestore,collection,addDoc,getDoc,doc,serverTimestamp}from\"firebase/firestore\";const firebaseConfig={apiKey:\"AIzaSyBJPcVMy7eXhLG-a_jpqDuoX4BBBU5_-GY\",authDomain:\"forge-du-nord.firebaseapp.com\",projectId:\"forge-du-nord\",storageBucket:\"forge-du-nord.firebasestorage.app\",messagingSenderId:\"123368301614\",appId:\"1:123368301614:web:4beb7e9f777cc796c36bbf\",measurementId:\"G-5QSGNN9X5J\"};if(!getApps().length){initializeApp(firebaseConfig);}export const db=getFirestore();// Learn more: https://www.framer.com/developers/overrides/\n// Charger le panier depuis `localStorage`\nconst initialCart=JSON.parse(localStorage.getItem(getCartStorageKey()))||[];const initialZipcode=localStorage.getItem(\"zipcode\")||\"\";//console.log(\"initialCart = \", initialCart)\nconst useStore=createStore({cart:initialCart,//overlayVisible: false,\nzipcode:initialZipcode});// Fonction pour mettre \u00E0 jour `localStorage` apr\u00E8s chaque modification du panier\nfunction updateLocalStorage(store){localStorage.setItem(getCartStorageKey(),JSON.stringify(store.cart));}function isTestModeEnabledByCookie(){if(typeof document===\"undefined\")return false;return document.cookie.split(\";\").some(c=>c.trim()===\"mode=TEST\");}function getCartStorageKey(){return isTestModeEnabledByCookie()?\"cart-test\":\"cart\";}function isLiveMode(){return!isTestModeEnabledByCookie();}export async function logZipcodeEntry(zipcode){const fsa=zipcode.trim().toUpperCase().slice(0,3);try{await addDoc(collection(db,\"zipcode_entries\"),{fsa,timestamp:serverTimestamp()});console.log(\"\uD83D\uDCEC Code postal enregistr\\xe9 :\",fsa);}catch(error){console.error(\"\u274C Erreur Firestore :\",error);}}export async function getStockBySkuId(skuId){if(!skuId){console.warn(\"SKU ID manquant pour getStockBySkuId\");return null;}try{const ref=doc(db,\"stocks\",skuId);const snap=await getDoc(ref);if(!snap.exists()){console.warn(\"\u26A0\uFE0F Aucun document Firestore pour SKU :\",skuId);return null;}const data=snap.data();console.log(\"\uD83D\uDCE6 Stock Firestore :\",skuId,data);return data;}catch(error){console.error(\"\u274C Erreur Firestore dans getStockBySkuId :\",error);return null;}}//HEADER\nexport function withCartCounter(Component){return props=>{const[store]=useStore();const cartItemCount=store.cart?.reduce((sum,item)=>sum+(item.quantity||0),0);const displayCounter=cartItemCount>0;//console.log(\"cartItemCount = \", cartItemCount)\n//console.log(\"displayCounter = \", displayCounter)\nreturn /*#__PURE__*/_jsx(Component,{...props,displayCounter:displayCounter,count:cartItemCount});};}export function withTestLabel(Component){return props=>{const isLive=isLiveMode();return /*#__PURE__*/_jsx(Component,{...props,isLive:isLive});};}//PDP\nexport function withStockAvailable(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,quantityAvailable:5});};}export function withZipcodeForm(Component){return props=>{const[store,setStore]=useStore();const handleSubmit=async event=>{//event.preventDefault()\nconsole.log(\"withZipcodeForm : \",event);const zipcode=event.toString().trim();if(zipcode){console.log(\"\uD83D\uDCE6 Code postal re\\xe7u :\",zipcode);// 1. Mise \u00E0 jour du localStorage\nlocalStorage.setItem(\"zipcode\",zipcode);// 2. Mise \u00E0 jour du store global\nsetStore({...store,zipcode});// 3. Tentative d'enregistrement Firestore\ntry{await logZipcodeEntry(zipcode);}catch(error){console.error(\"\u274C Erreur lors de l'enregistrement Firestore :\",error);}}};const handleDelete=async event=>{console.log(\"\uD83D\uDDD1\uFE0F Suppression du code postal\");// 1. Suppression du localStorage\nlocalStorage.removeItem(\"zipcode\");// 2. Reset du store\nsetStore({...store,zipcode:\"\"});};return /*#__PURE__*/_jsx(Component,{...props,onSubmit:handleSubmit,onDelete:handleDelete,currentPostalCode:store.zipcode});};}export function withDeliveryPrice(Component){return props=>{const[store]=useStore();const{zipcode}=store;const FREE_SHIPPING_FSAS=[\"H1A\",\"H1B\",\"H1C\",\"H1E\",\"H1G\",\"H1H\",\"H1J\",\"H1K\",\"H1L\",\"H1M\",\"H1N\",\"H1P\",\"H1R\",\"H1S\",\"H1T\",\"H1V\",\"H1W\",\"H1X\",\"H1Y\",\"H1Z\",\"H2A\",\"H2B\",\"H2C\",\"H2E\",\"H2G\",\"H2H\",\"H2J\",\"H2K\",\"H2L\",\"H2M\",\"H2N\",\"H2P\",\"H2R\",\"H2S\",\"H2T\",\"H2V\",\"H2W\",\"H2X\",\"H2Y\",\"H2Z\",\"H3A\",\"H3B\",\"H3C\",\"H3E\",\"H3G\",\"H3H\",\"H3J\",\"H3K\",\"H3L\",\"H3M\",\"H3N\",\"H3R\",\"H3S\",\"H3T\",\"H3V\",\"H3W\",\"H3X\",\"H3Y\",\"H3Z\",\"H4A\",\"H4B\",\"H4C\",\"H4E\",\"H4G\",\"H4H\",\"H4J\",\"H4K\",\"H4L\",\"H4M\",\"H4N\",\"H4R\",\"H4S\",\"H4T\",\"H4V\",\"H7A\",\"H7B\",\"H7C\",\"H7E\",\"H7G\",\"H7H\",\"H7J\",\"H7K\",\"H7L\",\"H7M\",\"H7N\",\"H7P\",\"H7R\",\"H7S\",\"H7T\",\"H7V\",\"J4G\",\"J4H\",\"J4J\",\"J4K\",\"J4L\",\"J4M\",\"J4N\",\"J4P\",\"J4R\",\"J4S\",\"J5K\",\"J5L\",\"J6T\",\"J6X\",\"J7A\",\"J7B\",\"J7C\",\"J7E\",\"J7G\",\"J7H\"];let variant=\"Check\";let postalCodeShort=\"\";if(zipcode){const cleaned=zipcode.trim().toUpperCase();postalCodeShort=cleaned.slice(0,3);if(FREE_SHIPPING_FSAS.includes(postalCodeShort)){variant=\"Free\";}else{variant=\"NotAvailable\";}}return /*#__PURE__*/_jsx(Component,{...props,variant:variant,postalCodeShort:postalCodeShort});};}/*export function withCartDrawer(Component): ComponentType {\n    return (props) => {\n        const [store, setStore] = useStore()\n        const componentRef = useRef(null)\n\n        const handleOnClose = () => {\n            console.log(\"\u274C fermer overlay\")\n            setStore({ overlayVisible: false })\n        }\n\n        // G\u00E9rer la visibilit\u00E9 (via parent DOM wrapper)\n        useEffect(() => {\n            const parent = componentRef.current?.parentNode as HTMLElement\n            if (parent) {\n                parent.style.display = store.overlayVisible ? \"block\" : \"none\"\n                console.log(\"withCartDrawer\")\n            }\n        }, [store.overlayVisible])\n\n        // G\u00E9rer le scroll du body\n        useEffect(() => {\n            if (store.overlayVisible) {\n                document.body.style.overflow = \"hidden\" // \uD83D\uDED1 bloque le scroll\n            } else {\n                document.body.style.overflow = \"\" // \u2705 r\u00E9tablit le scroll\n            }\n        }, [store.overlayVisible])\n\n        return (\n            <Component\n                {...props}\n                ref={componentRef}\n                onClose={handleOnClose}\n                displayDrawer={store.overlayVisible}\n            />\n        )\n    }\n}*/export function withAddToCart(Component){return props=>{const[store,setStore]=useStore();const isLive=isLiveMode();const[variant,setVariant]=useState(\"Init\");// Au montage : log + delay + changement de variant\nuseEffect(()=>{console.log(\"\uD83E\uDDE9 AddToCart \u2013 props on mount:\",props);setVariant(\"Init\");const timer=setTimeout(()=>{setVariant(\"Default\");},1e3);return()=>clearTimeout(timer);},[]);/*useEffect(() => {\n            async function fetchStock() {\n                const stockData = await getStockBySkuId(props.skuId)\n                if (stockData) {\n                    // Par exemple :\n                    const availableQty = stockData.stock?.available ?? 0\n                    console.log(`\u2705 ${props.skuId} \u2192 ${availableQty} en stock`)\n                    setVariant(\"Default\")\n                    // Tu peux aussi setState pour afficher ou d\u00E9sactiver le bouton\n                }\n            }\n\n            if (props.skuId) {\n                fetchStock()\n            }\n        }, [props.skuId])*/const handleClick=async event=>{event.preventDefault();console.log(\"props = \",props);//const isLive = props.isLive !== false\nconst eventName=isLive?\"add_to_cart\":\"add_to_cart_test\";const effectivePriceId=isLive?props.priceId:props.priceIdTest;const effectiveProductId=isLive?props.productId:props.productIdTest;// 1) Tracking e-commerce\nif(props.skuId&&props.productName&&props.price){const ecommerceEvent={event:eventName,ecommerce:{currency:\"CAD\",value:props.price,items:[{item_id:props.skuId,item_name:props.productName,price:\"15.00\",quantity:1}]}};console.log(\"\uD83E\uDDEA Pushing to dataLayer:\",JSON.stringify(ecommerceEvent,null,2));window.dataLayer=window.dataLayer||[];window.dataLayer.push(ecommerceEvent);}else{window.dataLayer=window.dataLayer||[];window.dataLayer.push({event:\"tracking_error\",context:\"add_to_cart\",missing:{skuId:!props.skuId,productName:!props.productName,price:!props.price},timestamp:new Date().toISOString()});console.warn(\"\uD83D\uDEA8 Tracking error in add_to_cart\",{props,context:\"add_to_cart\"});}// 2) Mise \u00E0 jour du panier\nconst itemId=props.skuId||crypto.randomUUID();const rawCart=store.cart;// G\u00E9rer les formats possibles : array direct ou objet avec cl\u00E9 `items`\nconst existingCart=Array.isArray(rawCart)?[...rawCart]:Array.isArray(rawCart?.items)?[...rawCart.items]:[];const idx=existingCart.findIndex(item=>item.sku_id===itemId);const updatedAttributes={product_page_url:props.productPageUrl||\"\",brand_name:props.brandName||\"Marque inconnue\",color:props.color||\"Non sp\\xe9cifi\\xe9\",size:props.size||\"Taille unique\",price:props.price||\"Prix inconnu\",model_id:props.modelId||null,image:props.image||null,image_url:props.image||\"\",seller_name:props.sellerName||\"Vendeur inconnu\"};if(idx!==-1){// Article d\u00E9j\u00E0 pr\u00E9sent \u2192 on met \u00E0 jour toutes les infos et on incr\u00E9mente\nconst existing=existingCart[idx];existingCart[idx]={...existing,quantity:existing.quantity+1,price:props.price||\"Prix inconnu\",price_id:effectivePriceId,size:props.size||\"Taille unique\",name:props.productName||existing.name,additional_attributes:updatedAttributes,productId:effectiveProductId};console.log(\"\u267B\uFE0F Article mis \\xe0 jour :\",existingCart[idx]);console.log(\"Event name :\",eventName);console.log(\" effectiveProductId :\",effectiveProductId);}else{// Nouvel article\nconst newItem={quantity:1,available:true,price:props.price||\"Prix inconnu\",price_id:effectivePriceId,name:props.productName||\"Produit inconnu\",additional_attributes:updatedAttributes,sku_id:itemId,productId:effectiveProductId,addToCartEventSource:\"PRODUCT_PAGE\"};existingCart.push(newItem);console.log(\"\uD83C\uDD95 Ajout d\u2019un nouvel article :\",newItem);console.log(\"Event name :\",eventName);console.log(\" effectiveProductId :\",effectiveProductId);}// 3) Persistance\n//setStore({ cart: existingCart, overlayVisible: true })\nsetStore({cart:existingCart});localStorage.setItem(getCartStorageKey(),JSON.stringify(existingCart));};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,isLive:isLive});};}//CART PAGE\nexport function withQuantitySelector(Component){return props=>{const[store,setStore]=useStore();const[quantity,setQuantity]=useState(0);if(!props.skuId)return /*#__PURE__*/_jsx(\"div\",{children:\"SKU manquant\"});const cartItem=store.cart.find(item=>item.sku_id===props.skuId);useEffect(()=>{if(cartItem)setQuantity(cartItem.quantity);},[cartItem]);if(quantity===null){console.log(\"pas de quanti\\xe9 trouv\\xe9. \\xe9tat du store : \",store);return /*#__PURE__*/_jsx(\"div\",{children:\"Chargement quantit\\xe9...\"})// ou null pour fallback silencieux\n;}const handleAdd=()=>{setStore(prevStore=>{const updatedCart=prevStore.cart.map(item=>{if(item.sku_id===props.skuId){const newQuantity=item.quantity+1;setQuantity(newQuantity);return{...item,quantity:newQuantity};}return item;});updateLocalStorage({cart:updatedCart});return{cart:updatedCart};});};const handleRemove=()=>{setStore(prevStore=>{const updatedCart=prevStore.cart.map(item=>{if(item.sku_id===props.skuId){const newQuantity=Math.max(0,item.quantity-1);setQuantity(newQuantity);return{...item,quantity:newQuantity};}return item;});updateLocalStorage({cart:updatedCart});return{cart:updatedCart};});};const handleDelete=()=>{setStore(prevStore=>{const updatedCart=prevStore.cart.filter(item=>item.sku_id!==props.skuId);setQuantity(null);updateLocalStorage({cart:updatedCart});return{cart:updatedCart};});};const variant=quantity===1?\"OneQuantity\":\"Default\";return /*#__PURE__*/_jsx(Component,{...props,add:handleAdd,remove:handleRemove,deleteItem:handleDelete,quantity:quantity.toString(),variant:variant});};}export function withAddQuantity(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props});};}export function withCloseOverlay(Component){return props=>{const[store,setStore]=useStore();const handleClick=()=>{console.log(\"\u274C fermer overlay\");setStore({overlayVisible:false});};return /*#__PURE__*/_jsx(Component,{...props,onTap:handleClick});};}export function withCartList(Component){return props=>{//console.log(\"props du cart List = \", props)\nreturn /*#__PURE__*/_jsx(Component,{...props});};}export function withCartItem(Component){return props=>{const[store]=useStore();// Cherche l\u2019item dans le panier\nconst cartItem=store.cart.find(item=>item.sku_id===props.skuId);// visible = true si on a trouv\u00E9 l\u2019item\nconst isVisible=Boolean(cartItem);// quantity = quantit\u00E9 du panier, ou 0 si pas pr\u00E9sent\nconst quantity=cartItem?cartItem.quantity:0;return /*#__PURE__*/_jsx(Component,{...props,isVisible:isVisible,quantity:quantity});};}export function withCartTotal(Component){return props=>{const[store]=useStore();// Calcul du total : on s\u2019assure de parser item.price (string ou number)\nconsole.log(\"cart = \",store.cart);console.log(\"props = \",props);const cartTotal=store.cart.reduce((sum,item)=>{const priceNum=parseFloat(item.price??0);return sum+priceNum*item.quantity;},0);console.log(\"total item = \",cartTotal);return /*#__PURE__*/_jsx(Component,{...props,price:cartTotal});};}export function withCartDetail(Component){return props=>{const[store,setStore]=useStore();// Log du panier au chargement\n// V\u00E9rifier si le panier est vide et l'initialiser avec `defaultCart`\nuseEffect(()=>{if(!store.cart||store.cart.length===0){console.log(\"\uD83D\uDED2 Initialisation du panier avec des valeurs mock.\");//setStore({ cart: defaultCart })\n}},[])// Ex\u00E9cute une seule fois \u00E0 l'initialisation\n;return /*#__PURE__*/_jsx(Component,{...props,cart:store.cart});};}/*firstName: props.firstNameValue || \"\",\n    lastName: props.lastNameValue || \"\",\n    address: props.addressValue || \"\",\n    apartment: props.apartmentValue || \"\",\n    city: props.cityValue || \"\",\n    province: props.provinceValue || \"\",\n    postal: props.postalValue || \"\",\n    phone: props.phoneValue || \"\",\n*/export function withAddressComplete(Component){return props=>{const handleOnSelect=async publicId=>{console.log(\"\uD83D\uDCE6 public_id re\\xe7u :\",publicId);try{const response=await fetch(`https://api.woosmap.com/localities/details/?public_id=${encodeURIComponent(publicId)}&key=${props.apiKey}`);const data=await response.json();console.log(\"\uD83E\uDDFE D\\xe9tail complet de l'adresse Woosmap :\",data);}catch(error){console.error(\"\u274C Erreur Woosmap API :\",error);}};return /*#__PURE__*/_jsx(Component,{...props,onSelect:handleOnSelect});};}export function withAddressForm(Component){return props=>{const handleSubmit=async event=>{//event.preventDefault()\nconsole.log(\"withAddressForm : \",event);};const handleCancelled=async event=>{//event.preventDefault()\nconsole.log(\"withAddressForm cancel \");};return /*#__PURE__*/_jsx(Component,{...props,onSubmit:handleSubmit,onCancel:handleCancelled});};}export function withCreateCheckoutOLD(Component){return props=>{const[store,setStore]=useStore();const[loading,setLoading]=useState(false);const handleClick=async event=>{event.preventDefault();setLoading(true);console.log(\"\u23F3 Waiting 1 second before creating Stripe session...\");const existingCart=[...store.cart];if(existingCart.length===0){console.error(\"\u274C ERROR: Cart is empty\");setLoading(false);return;}// \uD83E\uDDFE Push begin_checkout to dataLayer\nconst beginCheckoutPayload={event:\"begin_checkout\",ecommerce:{currency:\"CAD\",value:55,items:existingCart.map(item=>({item_id:item.productId,item_name:item.name,price:15,quantity:item.quantity}))}};console.log(\"\uD83D\uDE80 begin_checkout \u2192 pushed to dataLayer\",beginCheckoutPayload);window.dataLayer=window.dataLayer||[];window.dataLayer.push(beginCheckoutPayload);// Wait before creating Stripe session\nsetTimeout(async()=>{console.log(\"\uD83D\uDCB3 Creating Stripe Checkout session...\");if(!window.Clerk||!window.Clerk.user){console.warn(\"\u26A0\uFE0F No user connected\");alert(\"You must be logged in to complete the purchase.\");setLoading(false);return;}const user=window.Clerk.user;const email=user?.primaryEmailAddress?.emailAddress||\"\";const userId=user?.id||\"\";const testKey=\"sk_test_51QsUvvCouYRjb5lHUCWgrUEs4wwiORHYbTJ0zX1YnWit2F2aE6VpuldpItDNTEyTR29FJKAUGCpLE4djlWuL160200ouqrghyo\";const liveKey=\"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\";const secretKey=props.isLive?liveKey:testKey;const headers={Authorization:`Bearer ${secretKey}`,\"Content-Type\":\"application/x-www-form-urlencoded\"};// 1\uFE0F\u20E3 R\u00E9cup\u00E9ration (ou cr\u00E9ation) du customer\nconst customersRes=await fetch(`https://api.stripe.com/v1/customers?limit=1&email=${encodeURIComponent(email)}`,{method:\"GET\",headers});const customers=await customersRes.json();let customerId;if(customers.data?.length>0){customerId=customers.data[0].id;console.log(\"\u2705 Stripe customer found:\",customerId);}else{const newCustomerRes=await fetch(\"https://api.stripe.com/v1/customers\",{method:\"POST\",headers,body:new URLSearchParams({email,\"metadata[clerk_user_id]\":userId})});const newCustomer=await newCustomerRes.json();customerId=newCustomer.id;console.log(\"\u2795 Stripe customer created:\",customerId);}// 2\uFE0F\u20E3 Mettre \u00E0 jour l'adresse par d\u00E9faut (billing + shipping)\nconst defaultAddress={line1:\"123 Rue Principale\",city:\"Montr\\xe9al\",state:\"QC\",postal_code:\"H2X 1A4\",country:\"CA\"};const shippingName=email;await fetch(`https://api.stripe.com/v1/customers/${customerId}`,{method:\"POST\",headers,body:new URLSearchParams({// billing address\n\"address[line1]\":defaultAddress.line1,\"address[city]\":defaultAddress.city,\"address[state]\":defaultAddress.state,\"address[postal_code]\":defaultAddress.postal_code,\"address[country]\":defaultAddress.country,// shipping info\n\"shipping[name]\":shippingName,\"shipping[address][line1]\":defaultAddress.line1,\"shipping[address][city]\":defaultAddress.city,\"shipping[address][state]\":defaultAddress.state,\"shipping[address][postal_code]\":defaultAddress.postal_code,\"shipping[address][country]\":defaultAddress.country})});try{const response=await fetch(\"https://api.stripe.com/v1/checkout/sessions\",{method:\"POST\",headers:{Authorization:`Bearer ${secretKey}`,\"Content-Type\":\"application/x-www-form-urlencoded\"},body:new URLSearchParams({mode:\"payment\",locale:\"fr\",success_url:window.location.origin+\"/success\",cancel_url:window.location.origin+\"/cart\",//customer_email: email,\nclient_reference_id:userId,customer:customerId,billing_address_collection:\"required\",\"shipping_address_collection[allowed_countries][0]\":\"CA\",// === Livraison gratuite ===\n\"shipping_options[0][shipping_rate_data][type]\":\"fixed_amount\",\"shipping_options[0][shipping_rate_data][fixed_amount][amount]\":\"0\",\"shipping_options[0][shipping_rate_data][fixed_amount][currency]\":\"cad\",\"shipping_options[0][shipping_rate_data][display_name]\":\"Livraison premium (valeur 200\u202F$)\",\"shipping_options[0][shipping_rate_data][delivery_estimate][minimum][unit]\":\"business_day\",\"shipping_options[0][shipping_rate_data][delivery_estimate][minimum][value]\":\"7\",\"shipping_options[0][shipping_rate_data][delivery_estimate][maximum][unit]\":\"business_day\",\"shipping_options[0][shipping_rate_data][delivery_estimate][maximum][value]\":\"14\",...existingCart.map((item,index)=>({[`line_items[${index}][price]`]:item.price_id,[`line_items[${index}][quantity]`]:item.quantity})).reduce((acc,val)=>({...acc,...val}),{})})});const data=await response.json();if(data.url){console.log(\"\u2705 Redirecting to Stripe:\",data.url);window.location.href=data.url;}else{window.dataLayer.push({event:\"tracking_error\",context:\"begin_checkout\",error_type:\"stripe_error\",details:data,timestamp:new Date().toISOString()});console.error(\"\u274C Stripe error:\",data);setLoading(false);}}catch(error){window.dataLayer.push({event:\"tracking_error\",context:\"begin_checkout\",error_type:\"network_error\",details:error?.message||\"unknown\",timestamp:new Date().toISOString()});console.error(\"\u274C Stripe connection error:\",error);}},1e3);};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,variant:loading?\"Loading\":\"Default\"});};}export function withCreateCheckout(Component){return props=>{const[store,setStore]=useStore();const[loading,setLoading]=useState(false);const isLive=isLiveMode();const proceedToCheckout=async()=>{console.log(\"\u23F3 Waiting 1 second before creating Stripe session...\");const existingCart=[...store.cart];if(existingCart.length===0){console.error(\"\u274C ERROR: Cart is empty\");setLoading(false);return;}// \uD83E\uDDFE Push begin_checkout to dataLayer\nconst beginCheckoutPayload={event:\"begin_checkout\",ecommerce:{currency:\"CAD\",value:existingCart.reduce((total,item)=>total+item.price*item.quantity,0),items:existingCart.map(item=>({item_id:item.productId,item_name:item.name,price:item.price,quantity:item.quantity}))}};console.log(\"\uD83D\uDE80 begin_checkout \u2192 pushed to dataLayer\",beginCheckoutPayload);window.dataLayer=window.dataLayer||[];window.dataLayer.push(beginCheckoutPayload);setTimeout(async()=>{const user=window.Clerk.user;const email=user?.primaryEmailAddress?.emailAddress||\"\";const userId=user?.id||\"\";const testKey=\"sk_test_51QsUvvCouYRjb5lHUCWgrUEs4wwiORHYbTJ0zX1YnWit2F2aE6VpuldpItDNTEyTR29FJKAUGCpLE4djlWuL160200ouqrghyo\";const liveKey=\"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\";const secretKey=isLive?liveKey:testKey;const headers={Authorization:`Bearer ${secretKey}`,\"Content-Type\":\"application/x-www-form-urlencoded\"};// 1\uFE0F\u20E3 R\u00E9cup\u00E9ration ou cr\u00E9ation du customer Stripe\nconst customersRes=await fetch(`https://api.stripe.com/v1/customers?limit=1&email=${encodeURIComponent(email)}`,{method:\"GET\",headers});const customers=await customersRes.json();let customerId;if(customers.data?.length>0){customerId=customers.data[0].id;console.log(\"\u2705 Stripe customer found:\",customerId);}else{const newCustomerRes=await fetch(\"https://api.stripe.com/v1/customers\",{method:\"POST\",headers,body:new URLSearchParams({email,\"metadata[clerk_user_id]\":userId})});const newCustomer=await newCustomerRes.json();customerId=newCustomer.id;console.log(\"\u2795 Stripe customer created:\",customerId);}// 2\uFE0F\u20E3 Mise \u00E0 jour adresse par d\u00E9faut\nconst defaultAddress={line1:\"123 Rue Principale\",city:\"Montr\\xe9al\",state:\"QC\",postal_code:\"H2X 1A4\",country:\"CA\"};const shippingName=email;await fetch(`https://api.stripe.com/v1/customers/${customerId}`,{method:\"POST\",headers,body:new URLSearchParams({\"address[line1]\":defaultAddress.line1,\"address[city]\":defaultAddress.city,\"address[state]\":defaultAddress.state,\"address[postal_code]\":defaultAddress.postal_code,\"address[country]\":defaultAddress.country,\"shipping[name]\":shippingName,\"shipping[address][line1]\":defaultAddress.line1,\"shipping[address][city]\":defaultAddress.city,\"shipping[address][state]\":defaultAddress.state,\"shipping[address][postal_code]\":defaultAddress.postal_code,\"shipping[address][country]\":defaultAddress.country})});// 3\uFE0F\u20E3 Cr\u00E9ation session Stripe Checkout\ntry{const response=await fetch(\"https://api.stripe.com/v1/checkout/sessions\",{method:\"POST\",headers,body:new URLSearchParams({mode:\"payment\",locale:\"fr\",success_url:window.location.origin+\"/success\",cancel_url:window.location.origin+\"/cart\",client_reference_id:userId,customer:customerId,billing_address_collection:\"required\",\"shipping_address_collection[allowed_countries][0]\":\"CA\",\"shipping_options[0][shipping_rate_data][type]\":\"fixed_amount\",\"shipping_options[0][shipping_rate_data][fixed_amount][amount]\":\"0\",\"shipping_options[0][shipping_rate_data][fixed_amount][currency]\":\"cad\",\"shipping_options[0][shipping_rate_data][display_name]\":\"Livraison premium (valeur 200\u202F$)\",\"shipping_options[0][shipping_rate_data][delivery_estimate][minimum][unit]\":\"business_day\",\"shipping_options[0][shipping_rate_data][delivery_estimate][minimum][value]\":\"7\",\"shipping_options[0][shipping_rate_data][delivery_estimate][maximum][unit]\":\"business_day\",\"shipping_options[0][shipping_rate_data][delivery_estimate][maximum][value]\":\"14\",...existingCart.map((item,index)=>({[`line_items[${index}][price]`]:item.price_id,[`line_items[${index}][quantity]`]:item.quantity})).reduce((acc,val)=>({...acc,...val}),{})})});const data=await response.json();if(data.url){console.log(\"\u2705 Redirecting to Stripe:\",data.url);window.location.href=data.url;}else{window.dataLayer.push({event:\"tracking_error\",context:\"begin_checkout\",error_type:\"stripe_error\",details:data,timestamp:new Date().toISOString()});console.error(\"\u274C Stripe error:\",data);setLoading(false);}}catch(error){window.dataLayer.push({event:\"tracking_error\",context:\"begin_checkout\",error_type:\"network_error\",details:error?.message||\"unknown\",timestamp:new Date().toISOString()});console.error(\"\u274C Stripe connection error:\",error);setLoading(false);}},1e3);};const handleClick=async event=>{event.preventDefault();setLoading(true);if(!window.Clerk||!window.Clerk.user){window.Clerk.openSignIn({afterSignInUrl:window.location.href,redirectUrl:window.location.href});setLoading(false);return;}proceedToCheckout();};return /*#__PURE__*/_jsx(Component,{...props,onClick:handleClick,isLive:isLive,variant:loading?\"Loading\":\"Default\"});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withAddressForm\":{\"type\":\"reactHoc\",\"name\":\"withAddressForm\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCloseOverlay\":{\"type\":\"reactHoc\",\"name\":\"withCloseOverlay\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCartTotal\":{\"type\":\"reactHoc\",\"name\":\"withCartTotal\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getStockBySkuId\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCreateCheckout\":{\"type\":\"reactHoc\",\"name\":\"withCreateCheckout\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAddQuantity\":{\"type\":\"reactHoc\",\"name\":\"withAddQuantity\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDeliveryPrice\":{\"type\":\"reactHoc\",\"name\":\"withDeliveryPrice\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withStockAvailable\":{\"type\":\"reactHoc\",\"name\":\"withStockAvailable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAddToCart\":{\"type\":\"reactHoc\",\"name\":\"withAddToCart\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"logZipcodeEntry\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCartDetail\":{\"type\":\"reactHoc\",\"name\":\"withCartDetail\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAddressComplete\":{\"type\":\"reactHoc\",\"name\":\"withAddressComplete\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCreateCheckoutOLD\":{\"type\":\"reactHoc\",\"name\":\"withCreateCheckoutOLD\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"db\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCartCounter\":{\"type\":\"reactHoc\",\"name\":\"withCartCounter\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withZipcodeForm\":{\"type\":\"reactHoc\",\"name\":\"withZipcodeForm\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCartItem\":{\"type\":\"reactHoc\",\"name\":\"withCartItem\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTestLabel\":{\"type\":\"reactHoc\",\"name\":\"withTestLabel\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCartList\":{\"type\":\"reactHoc\",\"name\":\"withCartList\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withQuantitySelector\":{\"type\":\"reactHoc\",\"name\":\"withQuantitySelector\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Checkout.map"],
  "mappings": "qNAAgS,IAAMA,EAAe,CAAC,OAAO,0CAA0C,WAAW,gCAAgC,UAAU,gBAAgB,cAAc,oCAAoC,kBAAkB,eAAe,MAAM,4CAA4C,cAAc,cAAc,EAAMC,EAAQ,EAAE,QAAQC,EAAcF,CAAc,EAAU,IAAMG,EAAGC,EAAa,EAE3pBC,EAAY,KAAK,MAAM,aAAa,QAAQC,EAAkB,CAAC,CAAC,GAAG,CAAC,EAAQC,EAAe,aAAa,QAAQ,SAAS,GAAG,GAC5HC,EAASC,EAAY,CAAC,KAAKJ,EACjC,QAAQE,CAAc,CAAC,EACvB,SAASG,EAAmBC,EAAM,CAAC,aAAa,QAAQL,EAAkB,EAAE,KAAK,UAAUK,EAAM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O,MAAM,KAAK,CAACA,EAAO,MAAM,WAAW,CAAC,eAAeA,EAAO,SAAS,KAAK,YAAYA,EAAO,SAAS,IAAI,CAAC,EAAET,EAAW,EAAK,EAAE,MAAO,CAACI,EAAkB,CAAE,EAAmE,OAAOF,EAAO,QAAQH,EAAQ,UAAU,SAAS,CAAC,CAAE,CAAE",
  "names": ["firebaseConfig", "getApps", "initializeApp", "db", "La", "initialCart", "getCartStorageKey", "initialZipcode", "useStore", "createStore", "updateLocalStorage", "store", "isTestModeEnabledByCookie", "c", "isLiveMode", "logZipcodeEntry", "zipcode", "fsa", "pl", "ea", "xl", "error", "withCartCounter", "Component", "props", "store", "useStore", "cartItemCount", "sum", "item", "displayCounter", "p", "withTestLabel", "isLive", "isLiveMode", "withZipcodeForm", "Component", "props", "store", "setStore", "useStore", "p", "event", "zipcode", "logZipcodeEntry", "error", "withAddToCart", "Component", "props", "store", "setStore", "useStore", "isLive", "isLiveMode", "variant", "setVariant", "ye", "ue", "timer", "p", "event", "eventName", "effectivePriceId", "effectiveProductId", "ecommerceEvent", "window", "itemId", "rawCart", "existingCart", "idx", "item", "updatedAttributes", "existing", "newItem", "getCartStorageKey", "withQuantitySelector", "quantity", "setQuantity", "cartItem", "handleAdd", "prevStore", "updatedCart", "newQuantity", "updateLocalStorage", "handleRemove", "handleDelete", "withCartList", "Component", "props", "p", "withCartItem", "store", "useStore", "cartItem", "item", "isVisible", "quantity", "withCartTotal", "cartTotal", "sum", "priceNum", "withCreateCheckout", "Component", "props", "store", "setStore", "useStore", "loading", "setLoading", "ye", "isLive", "isLiveMode", "proceedToCheckout", "existingCart", "beginCheckoutPayload", "total", "item", "window", "user", "email", "userId", "headers", "customers", "customerId", "defaultAddress", "shippingName", "data", "index", "acc", "val", "error", "p", "event"]
}
