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]=`1daa7a45-a720-4d75-89b4-61b75b02fa1e`,e._sentryDebugIdIdentifier=`sentry-dbid-1daa7a45-a720-4d75-89b4-61b75b02fa1e`)}catch{}import{o as e}from"./rolldown-runtime-nx40z1zs.js";import{Ag as t,Zh as n,Zm as r,_r as i,ai as a,jg as o,ng as s,pi as c,xi as l,yt as u}from"./entry.client-mpghtlrl.js";import{o as d,r as f}from"./priceHelpers-fqbpta9z.js";var p=t(),m=e(c(),1),h=e(o(),1),g=s(),_={priceBaseContainer:`price-base-container`,originalPrice:`original-price`,originalPriceText:`original-price-text`,currentPrice:`current-price`,currentPriceText:`current-price-text`,afterPriceText:`after-price-text`,afterPriceTextContainer:`after-price-text-container`};function v(e){let t=(0,p.c)(5),{className:n,children:r}=e,i;t[0]===n?i=t[1]:(i=u(`flex flex-wrap items-baseline gap-x-1`,n),t[0]=n,t[1]=i);let a;return t[2]!==i||t[3]!==r?(a=(0,g.jsx)(`div`,{"data-testid":_.priceBaseContainer,className:i,children:r}),t[2]=i,t[3]=r,t[4]=a):a=t[4],a}function y(e){let t=(0,p.c)(8),{originalPrice:n,hasBrandStyling:r,className:i}=e;if(!n)return null;let a=r?`font-light`:`text-gray-400`,o;t[0]!==a||t[1]!==i?(o=u(`margin-inline-end-4 line-through`,a,i),t[0]=a,t[1]=i,t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,g.jsx)(`span`,{"data-testid":_.originalPriceText,children:n}),t[3]=n,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,g.jsx)(`span`,{"data-testid":_.originalPrice,"aria-hidden":`true`,className:o,children:s}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function b(e){let t=(0,p.c)(7),{currentPrice:n,hasAddOns:r,className:i}=e,a;t[0]===i?a=t[1]:(a=u(`text-bold`,i),t[0]=i,t[1]=a);let o=`${n}${r?`+`:``}`,s;t[2]===o?s=t[3]:(s=(0,g.jsx)(`span`,{"data-testid":_.currentPriceText,children:o}),t[2]=o,t[3]=s);let c;return t[4]!==a||t[5]!==s?(c=(0,g.jsx)(`span`,{"data-testid":_.currentPrice,className:a,children:s}),t[4]=a,t[5]=s,t[6]=c):c=t[6],c}function x(e){let t=(0,p.c)(3),{text:n}=e;if(!n||n.length===0)return null;let r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,m.default)(`inline-flex items-baseline gap-2`),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,g.jsx)(`span`,{"data-testid":_.afterPriceTextContainer,className:r,children:(0,g.jsx)(`span`,{"data-testid":_.afterPriceText,children:n})}),t[1]=n,t[2]=i),i}var S={productPrice:`product-price`,loadingShimmer:`product-price-loading-shimmer`},C=i(({marketInfo:e,product:t,sku:n,availability:r,className:i,listedPriceClassName:o,hasBrandStyling:s=!1})=>{if(!t||!n||!r)return null;let c=f({product:t,sku:n,availability:r},e);if(!c)return null;let{originalPrice:u,lowestPrice:d,afterText:p}=c;return(0,g.jsx)(h.Suspense,{fallback:(0,g.jsx)(a,{children:(0,g.jsx)(l,{className:i,"data-testid":S.loadingShimmer})}),children:(0,g.jsx)(`div`,{"data-testid":S.productPrice,children:(0,g.jsxs)(v,{className:i,children:[(0,g.jsx)(b,{className:o,hasAddOns:!!t.hasAddOns,currentPrice:d,standalone:!u,hasBrandStyling:s}),(0,g.jsx)(y,{originalPrice:u,hasBrandStyling:s}),(0,g.jsx)(x,{text:p})]})})})},({productId:e,skuId:t,availabilityId:i,className:a,listedPriceClassName:o,hasBrandStyling:s})=>{let{authentication:c,internationalization:l,xboxcomFD:u}=r(),{data:f}=n(c.queries.isFullySignedIn.getOptions()),{data:p}=n(f?u.queries.product.getActiveUserQuery().getOptions({productId:e}):u.queries.product.getAnonymousQuery().getOptions({productId:e})),m=p.productSummaries.find(t=>t.productId===e),h;m&&(h=d({product:m,skuSummaries:p.skuSummaries,availabilitySummaries:p.availabilitySummaries,skuId:t,availabilityId:i}));let{data:g}=n(l.queries.territory.getOptions()),{data:_}=n(l.queries.locale.getOptions()),v={market:g,language:_.split(`-`)[0],locale:_,localeWithScript:_};return{...h,marketInfo:v,product:m,className:a,listedPriceClassName:o,hasBrandStyling:s}});export{v as a,y as i,x as n,b as r,C as t};