1import{j as t,a as M}from"./@themenu-design-system-PPvpWM1I.js";import{a as m}from"./@analytics-DNf5dJTn.js";import{E as b,at as S,b as w,K as D,eT as p,ad as R,eS as G}from"./index-DE1OpxQz.js";import{u as y,d as L}from"./@react-intl-CKI24l5Z.js";import{u as W,A as x}from"./ProductProvider-NkJpu-MM.js";import{a as O}from"./OrderProvider-CsAf8tQk.js";import{e as k}from"./variantUtils-ByJltGTw.js";import{S as z,a as H}from"./ShippingInfo-U4IfUY0y.js";import{u as Q}from"./useElementHeight-trY62YW4.js";import{u as q}from"./useSelectedWallet-DbTf81GP.js";import{W as K}from"./WalletGiftStoreLayout-ZSm2vBbJ.js";import"./@react-aria-stately-4PMgXtPH.js";import"./@libphonenumber-js-CKk4m8Ay.js";import"./@luxon-DfZoh-A_.js";import"./@utils-CrEFOnIh.js";import"./@swiper-DRyvN9l1.js";import"./useProductQuery-D-yywT9I.js";import"./storeGraphql-Ohg8wK-a.js";import"./SetOrderCustomFields-B2Tt4j9n.js";import"./CartItem-BUfXW_sG.js";import"./FormikErrorMessage-othB8Ul0.js";import"./SafeAreaBottomContainer-q4SekFlo.js";import"./useMobileBottomBarMargin-BN50mBiY.js";import"./AutocompleteAddressFieldInput-mlE_NlX1.js";import"./formatPlaceGeocodeToForm-RHWDQ7iM.js";import"./formChecks-DPj_WowZ.js";import"./order-BxhFZRGD.js";import"./WebviewGlobalStyle-UAbJwMWy.js";import"./GiftMobileAppHeader-BJJ958ln.js";import"./queryIds-DQpqvu2M.js";import"./LeftLayout-8UJsuSag.js";import"./wallets-C6pU-a6D.js";import"./SidebarItem-BcUfl4cr.js";try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="1880fbb0-6ab5-43f8-af62-92e9400a9822",e._sentryDebugIdIdentifier="sentry-dbid-1880fbb0-6ab5-43f8-af62-92e9400a9822")}catch{}const v=L({shippingTitle:{id:"gift.no_discount.shipping_selector",defaultMessage:"Where should we send your order?"},confirm:{id:"gift.no_discount.confirm_address_selector",defaultMessage:"Confirm"}}),V=({wallet:e})=>{const{order:s,isLoading:o}=m.useContext(O),i=w(),a=y(),u=D(),n=W(),{shippingAddressCreation:C,shippingAddressEdition:l,getAddress:A,shippingAddresses:I,isLoading:N}=Q(n,s,e.id),{identity:r}=S(),f=b(),d=m.useMemo(()=>s?k(s,e.id):void 0,[s,e.id]),P=h=>{const c={firstName:r==null?void 0:r.firstName,lastName:r==null?void 0:r.lastName,country:G.FRANCE.name};return h===p.SHIPPING&&l?{...c,...A(l)}:h===p.SHIPPING?{...c,phoneNumber:(r==null?void 0:r.phoneNumber)||void 0}:c},j=()=>{i(-1)},_=async()=>{await u.invalidateQueries({queryKey:[x]})},g=()=>{i(d||-1)},E=s&&I.length===0?d:void 0,T=async()=>{await u.invalidateQueries({queryKey:[x]}),g()};return!s||N?null:l||C?t.jsx(z,{presetAddress:P(p.SHIPPING),wallet:e,order:s,channelToken:n,onCancel:f?j:void 0,showSameAsBilling:!1,onSuccess:_,redirectAfterCreation:E}):t.jsxs("div",{className:"relative size-full",children:[o&&t.jsx("div",{className:"-translate-x-2/4 -translate-y-2/4 absolute top-1/2 left-1/2 z-10 flex size-full items-center justify-center overflow-hidden rounded-md bg-interactive-disabled opacity-70 dark:bg-interactive-disabled-dark",children:t.jsx(R,{})}),t.jsx(H,{wallet:e,order:s,orderLines:s.lines,onSuccess:T,onCancel:f?g:void 0,channelToken:n,showBilling:!1,ctaText:a.formatMessage(v.confirm)})]})},B=({wallet:e})=>{const s=y(),o=b(),{isMobileApp:i}=S(),a=m.useMemo(()=>i?24:o?88:0,[o,i]);return t.jsxs(t.Fragment,{children:[t.jsx(M,{variant:o?"body":"h2",weight:"medium",children:s.formatMessage(v.shippingTitle)}),t.jsx("div",{className:"mt-8 flex h-full flex-col md:mt-0",children:t.jsx("div",{className:"flex flex-col p-4",style:{height:`calc(100% - ${a}px)`},children:t.jsx(V,{wallet:e})})})]})},Pe=()=>{const{walletSelected:e}=q();return e?t.jsx(K,{children:t.jsx("div",{className:"max-w-[684px]",children:t.jsx(B,{wallet:e})})}):null};export{Pe as default};
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.