1try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`851dcf77-4794-4ffe-84f0-86c12e69509d`,e._sentryDebugIdIdentifier=`sentry-dbid-851dcf77-4794-4ffe-84f0-86c12e69509d`)}catch{}import{t as e}from"./C1z1S_xi.js";import{t}from"./BrEGcwfa.js";import{n,t as r}from"./BR4KuyMu.js";var i=()=>{let{makeRequest:r}=e();return t({mutationFn:e=>{let t=e.map(e=>({variant_id:e.variantReference,frequency_id:e.frequencyReference,quantity:e.quantity??1}));if(t.length===0)throw Error(`No variants provided for checkout preparation`);return r({path:`/rpc/prepare-generic-checkout`,schema:n,deserializeResponse:!1,options:{method:`POST`,headers:{Accept:`application/json`},body:{items:t}}})}})},a=()=>{let{mutateAsync:e,isSuccess:t,isPending:n,isError:i}=r();return{prepareToCheckout:async t=>{let n=t.split(`-`)[1],r=t.split(`-`)[2]||null;if(!n)throw Error(`No variant found`);let i=await e({variantReference:n,frequencyReference:r});window.location.assign(`/checkout/${i.shop_order_id}`)},isPending:n,isError:i,isSuccess:t}},o=()=>{let{mutateAsync:e,isSuccess:t,isPending:n,isError:r}=i();return{prepareGenericCheckout:async t=>{let n=Array.isArray(t)?t:t.split(`,`),r=new Map;for(let e of n){let t=e.trim().split(`-`),n=t[1],i=t[2]||null;if(!n)throw Error(`Invalid product format: ${e}`);let a=`${n}::${i??`one-off`}`;r.has(a)?r.get(a).quantity+=1:r.set(a,{variantReference:n,frequencyReference:i,quantity:1})}let i=Array.from(r.values()),a=await e(i);window.location.assign(`/checkout/${a.shop_order_id}`)},isPending:n,isError:r,isSuccess:t}};export{a as n,o as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.