try{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]=`7435b918-e3f6-4411-8ad8-9366637bdad0`,e._sentryDebugIdIdentifier=`sentry-dbid-7435b918-e3f6-4411-8ad8-9366637bdad0`)}catch{}import{o as e}from"./rolldown-runtime-eb2nym32.js";import{Ag as t,Fg as n,Ig as r,dn as i,ep as a,mh as o,sh as s,th as c,wg as l}from"./entry.client-dr7r6s9a.js";import{t as u}from"./useFlowId-n9vqrww9.js";import{t as d}from"./GiftingHost-hgnt8esd.js";import{n as f}from"./DialogShell-k2jpaw9r.js";var p=n(),m=e(r(),1),h=t(),g=i(e=>{let t=(0,p.c)(3),n=d.useComponent(),r;return t[0]!==n||t[1]!==e?(r=(0,h.jsx)(n,{...e}),t[0]=n,t[1]=e,t[2]=r):r=t[2],r},e=>{let{queryClient:t,systems:{dialog:n}}=c(),r=u(),{authentication:{queries:{xToken:i}}}=s(),{mutate:o}=l(n.mutations.goBack.getOptions()),d=(0,m.useCallback)(async e=>(await t.fetchQuery(i.getActiveUserQuery().getOptions({relyingParty:a.MDollar,uri:e}))).toAuthenticationHeader(),[t,i]),f=(0,m.useCallback)(e=>{o()},[o]);return{...e,getAuthToken:d,onExit:f,flowId:r}}),_=e=>{let t=(0,p.c)(15),n=f.useComponent(),r=g.useComponent(),i=e.giftingFlowConfiguration;if(!i){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e={type:`PromptForDeliveryMethod`},t[0]=e):e=t[0],i=e}let a=e.productId,s=e.skuId,c=e.availabilityId,l=e.campaignId,u=e.optionalCampaignId,d=i,m=e.catalogId,_;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(_=performance.now(),t[1]=_):_=t[1];let v=e.sourceClientName??o.BaysidePurchase,y;t[2]!==r||t[3]!==e.productId||t[4]!==e.skuId||t[5]!==e.availabilityId||t[6]!==e.campaignId||t[7]!==e.optionalCampaignId||t[8]!==e.catalogId||t[9]!==i||t[10]!==v?(y=(0,h.jsx)(r,{productId:a,skuId:s,availabilityId:c,campaignId:l,optionalCampaignId:u,giftingFlowConfiguration:d,allowAsyncPurchase:!0,catalogId:m,giftingLaunchStartTime:_,sourceClientName:v}),t[2]=r,t[3]=e.productId,t[4]=e.skuId,t[5]=e.availabilityId,t[6]=e.campaignId,t[7]=e.optionalCampaignId,t[8]=e.catalogId,t[9]=i,t[10]=v,t[11]=y):y=t[11];let b;return t[12]!==n||t[13]!==y?(b=(0,h.jsx)(n,{className:`h-full w-full overflow-visible`,children:y}),t[12]=n,t[13]=y,t[14]=b):b=t[14],b};export{_ as GiftingDialog,_ as default};