@anker-in/headless-ui 1.3.9 → 1.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  2. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  3. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  4. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +2 -2
  5. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  6. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
  7. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  8. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
  9. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  10. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +2 -2
  11. package/dist/cjs/biz-components/VideoModal/index.js +1 -1
  12. package/dist/cjs/biz-components/VideoModal/index.js.map +2 -2
  13. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  14. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  15. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  16. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js.map +2 -2
  17. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  18. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
  19. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  20. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
  21. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  22. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +2 -2
  23. package/dist/esm/biz-components/VideoModal/index.js +1 -1
  24. package/dist/esm/biz-components/VideoModal/index.js.map +2 -2
  25. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";var p=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var D=(r,o)=>{for(var c in o)p(r,c,{get:o[c],enumerable:!0})},T=(r,o,c,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of F(o))!z.call(r,a)&&a!==c&&p(r,a,{get:()=>o[a],enumerable:!(s=L(o,a))||s.enumerable});return r};var A=r=>T(p({},"__esModule",{value:!0}),r);var j={};D(j,{default:()=>S});module.exports=A(j);var e=require("react/jsx-runtime"),l=require("../../../../../../components/index.js"),m=require("../../../../../../helpers/index.js"),h=require("../../../../../AiuiProvider/index.js"),k=require("../../../../BizProductProvider.js"),u=require("../../../../utils/index.js"),y=require("../../../../../../shared/Styles.js"),n=require("../../../../hooks/useFollowTooltip.js");const O=()=>{const{locale:r="us"}=(0,h.useAiuiContext)(),{variant:o,bundle:c,checkedBundle:s,setCheckedBundle:a,setCheckedGift:R,savingDetail:G,setSavingDetail:J,setCheckedExchangePurchase:q,setJoinedRecommendBuyProducts:f,joinedRecommendBuyProducts:x,setAddOrder:v}=(0,k.useBizProductContext)(),{title:C,bundleList:N,showAtListing:b}=c||{},g=N?.filter(t=>t.variants.slice(1,t.variants.length).every(d=>d.variant.availableForSale));if(!g?.length&&b)return null;const B=t=>{s?.id===t.id?(a?.(void 0),f?.({...x,bundle:{value:void 0,canOperate:!0}}),v?.(d=>d.filter(i=>i!=="bundle"))):(a?.(t),f?.({...x,bundle:{value:t,canOperate:!1}}),v?.(d=>[...d.filter(w=>w!=="bundle"),"bundle"]))},{tooltip:P,getTooltipProps:E}=(0,n.useFollowTooltip)();return(0,e.jsxs)("div",{className:"ipc-product-detail-bundle",children:[(0,e.jsx)(l.Text,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:C}),(0,e.jsx)("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:g?.map(t=>{const d=t.variants.filter(i=>i.variant.sku!==o.sku);return(0,e.jsx)("div",{children:(0,e.jsxs)("div",{className:(0,m.cn)("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":s?.id===t.id}),children:[(0,e.jsx)(l.Checkbox,{onCheckedChange:()=>B(t),size:"lg",className:(0,m.cn)("rounded-full border-2 border-[#E4E5E6]",{"border-brand":s?.id===t.id}),id:t.id,value:t.id,checked:s?.id===t.id}),(0,e.jsx)("label",{htmlFor:t.id,className:"size-full flex items-center cursor-pointer py-4 lg-desktop:py-6",children:d?.map(i=>(0,e.jsxs)("div",{className:"flex items-center justify-between gap-6 ",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(l.Picture,{source:i?.variant?.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),(0,e.jsx)(l.Text,{...E(i.variant.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:i.variant.product.title}),(0,e.jsx)(n.FollowTooltip,{...P})]}),(0,e.jsxs)("div",{className:"laptop:flex-row flex shrink-0 flex-col items-center justify-end gap-1",children:[(0,e.jsx)(l.Text,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold",html:(0,u.formatPrice)({amount:i.price,locale:r,currencyCode:i.variant.price.currencyCode})}),i.price<i.variant.price.amount&&(0,e.jsx)(l.Text,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through",html:(0,u.formatPrice)({amount:i.variant.price.amount,locale:r,currencyCode:i.variant.price.currencyCode})})]})]},i.variant.id))})]})},t.id)})})]})};var S=(0,y.withLayout)(O);
1
+ "use strict";var p=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var D=(r,o)=>{for(var c in o)p(r,c,{get:o[c],enumerable:!0})},T=(r,o,c,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of F(o))!z.call(r,a)&&a!==c&&p(r,a,{get:()=>o[a],enumerable:!(s=L(o,a))||s.enumerable});return r};var A=r=>T(p({},"__esModule",{value:!0}),r);var j={};D(j,{default:()=>S});module.exports=A(j);var e=require("react/jsx-runtime"),l=require("../../../../../../components/index.js"),m=require("../../../../../../helpers/index.js"),h=require("../../../../../AiuiProvider/index.js"),k=require("../../../../BizProductProvider.js"),u=require("../../../../utils/index.js"),y=require("../../../../../../shared/Styles.js"),n=require("../../../../hooks/useFollowTooltip.js");const O=()=>{const{locale:r="us"}=(0,h.useAiuiContext)(),{variant:o,bundle:c,checkedBundle:s,setCheckedBundle:a,setCheckedGift:R,savingDetail:G,setSavingDetail:J,setCheckedExchangePurchase:q,setJoinedRecommendBuyProducts:f,joinedRecommendBuyProducts:x,setAddOrder:v}=(0,k.useBizProductContext)(),{title:C,bundleList:N,showAtListing:b}=c||{},g=N?.filter(t=>t.variants.slice(1,t.variants.length).every(d=>d.variant.availableForSale));if(!g?.length&&b)return null;const B=t=>{s?.id===t.id?(a?.(void 0),f?.({...x,bundle:{value:void 0,canOperate:!0}}),v?.(d=>d.filter(i=>i!=="bundle"))):(a?.(t),f?.({...x,bundle:{value:t,canOperate:!1}}),v?.(d=>[...d.filter(w=>w!=="bundle"),"bundle"]))},{tooltip:P,getTooltipProps:E}=(0,n.useFollowTooltip)();return(0,e.jsxs)("div",{className:"ipc-product-detail-bundle",children:[(0,e.jsx)(l.Text,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:C}),(0,e.jsx)("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:g?.map(t=>{const d=t.variants.filter(i=>i.variant.sku!==o.sku);return(0,e.jsx)("div",{children:(0,e.jsxs)("div",{className:(0,m.cn)("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":s?.id===t.id}),children:[(0,e.jsx)(l.Checkbox,{onCheckedChange:()=>B(t),size:"lg",className:(0,m.cn)("rounded-full border-2 border-[#E4E5E6]",{"border-brand-0 data-[state=checked]:bg-brand-0":s?.id===t.id}),id:t.id,value:t.id,checked:s?.id===t.id}),(0,e.jsx)("label",{htmlFor:t.id,className:"size-full flex items-center cursor-pointer py-4 lg-desktop:py-6",children:d?.map(i=>(0,e.jsxs)("div",{className:"flex items-center justify-between gap-6 ",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(l.Picture,{source:i?.variant?.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),(0,e.jsx)(l.Text,{...E(i.variant.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:i.variant.product.title}),(0,e.jsx)(n.FollowTooltip,{...P})]}),(0,e.jsxs)("div",{className:"laptop:flex-row flex shrink-0 flex-col items-center justify-end gap-1",children:[(0,e.jsx)(l.Text,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold",html:(0,u.formatPrice)({amount:i.price,locale:r,currencyCode:i.variant.price.currencyCode})}),i.price<i.variant.price.amount&&(0,e.jsx)(l.Text,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through",html:(0,u.formatPrice)({amount:i.variant.price.amount,locale:r,currencyCode:i.variant.price.currencyCode})})]})]},i.variant.id))})]})},t.id)})})]})};var S=(0,y.withLayout)(O);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.tsx"],
4
- "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport type { BundleListItem } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductBundle = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n variant,\n bundle,\n checkedBundle,\n setCheckedBundle,\n setCheckedGift,\n savingDetail,\n setSavingDetail,\n setCheckedExchangePurchase,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n setAddOrder,\n } = useBizProductContext()\n\n const { title, bundleList, showAtListing } = bundle || {}\n\n const availableBundleList = bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n )\n\n if (!availableBundleList?.length && showAtListing) return null\n\n const handleSelectedChange = (bundleItem: BundleListItem) => {\n if (checkedBundle?.id === bundleItem.id) {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'bundle'))\n } else {\n setCheckedBundle?.(bundleItem)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: bundleItem,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'bundle')\n return [...filtered, 'bundle']\n })\n }\n }\n\n const { tooltip, getTooltipProps } = useFollowTooltip()\n\n return (\n <div className=\"ipc-product-detail-bundle\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableBundleList?.map(bundle => {\n const bundleVariants = bundle.variants.filter(v => v.variant.sku !== variant.sku)\n return (\n <div key={bundle.id}>\n <div\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedBundle?.id === bundle.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleSelectedChange(bundle)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand': checkedBundle?.id === bundle.id,\n })}\n id={bundle.id}\n value={bundle.id}\n checked={checkedBundle?.id === bundle.id}\n />\n <label htmlFor={bundle.id} className=\"size-full flex items-center cursor-pointer py-4 lg-desktop:py-6\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center justify-between gap-6 \" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-2\">\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"size-12 shrink-0\"\n imgClassName=\"h-full\"\n />\n <Text\n {...getTooltipProps(bundleVariant.variant.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={bundleVariant.variant.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"laptop:flex-row flex shrink-0 flex-col items-center justify-end gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold\"\n html={formatPrice({\n amount: bundleVariant.price,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n {bundleVariant.price < bundleVariant.variant.price.amount && (\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n )}\n </div>\n </div>\n )\n })}\n </label>\n </div>\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductBundle)\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmEM,IAAAI,EAAA,6BAnENC,EAAwC,iDACxCC,EAAmB,8CACnBC,EAA+B,gDAC/BC,EAAqC,6CACrCC,EAA4B,sCAE5BC,EAA2B,8CAC3BC,EAAgD,iDAEhD,MAAMC,EAAgB,IAAM,CAC1B,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CACJ,QAAAC,EACA,OAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,2BAAAC,EACA,8BAAAC,EACA,2BAAAC,EACA,YAAAC,CACF,KAAI,wBAAqB,EAEnB,CAAE,MAAAC,EAAO,WAAAC,EAAY,cAAAC,CAAc,EAAIZ,GAAU,CAAC,EAElDa,EAAsBF,GAAY,OAAOX,GAC7CA,EAAO,SAAS,MAAM,EAAGA,EAAO,SAAS,MAAM,EAAE,MAAMc,GAAKA,EAAE,QAAQ,gBAAgB,CACxF,EAEA,GAAI,CAACD,GAAqB,QAAUD,EAAe,OAAO,KAE1D,MAAMG,EAAwBC,GAA+B,CACvDf,GAAe,KAAOe,EAAW,IACnCd,IAAmB,MAAS,EAC5BK,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AAGH,EAAS,GAC9B,KACA,QAAC,OAAI,UAAU,wEACb,oBAAC,QACC,UAAU,4EACV,QAAM,eAAY,CAChB,OAAQG,EAAc,MACtB,OAAAxB,EACA,aAAcwB,EAAc,QAAQ,MAAM,YAC5C,CAAC,EACH,EACCA,EAAc,MAAQA,EAAc,QAAQ,MAAM,WACjD,OAAC,QACC,UAAU,wGACV,QAAM,eAAY,CAChB,OAAQA,EAAc,QAAQ,MAAM,OACpC,OAAAxB,EACA,aAAcwB,EAAc,QAAQ,MAAM,YAC5C,CAAC,EACH,GAEJ,IAjC6DA,EAAc,QAAQ,EAkCrF,CAEH,EACH,GACF,GA5DQtB,EAAO,EA6DjB,CAEJ,CAAC,EACH,GACF,CAEJ,EAEA,IAAOb,KAAQ,cAAWU,CAAa",
4
+ "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport type { BundleListItem } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductBundle = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n variant,\n bundle,\n checkedBundle,\n setCheckedBundle,\n setCheckedGift,\n savingDetail,\n setSavingDetail,\n setCheckedExchangePurchase,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n setAddOrder,\n } = useBizProductContext()\n\n const { title, bundleList, showAtListing } = bundle || {}\n\n const availableBundleList = bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n )\n\n if (!availableBundleList?.length && showAtListing) return null\n\n const handleSelectedChange = (bundleItem: BundleListItem) => {\n if (checkedBundle?.id === bundleItem.id) {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'bundle'))\n } else {\n setCheckedBundle?.(bundleItem)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: bundleItem,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'bundle')\n return [...filtered, 'bundle']\n })\n }\n }\n\n const { tooltip, getTooltipProps } = useFollowTooltip()\n\n return (\n <div className=\"ipc-product-detail-bundle\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableBundleList?.map(bundle => {\n const bundleVariants = bundle.variants.filter(v => v.variant.sku !== variant.sku)\n return (\n <div key={bundle.id}>\n <div\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedBundle?.id === bundle.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleSelectedChange(bundle)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand-0 data-[state=checked]:bg-brand-0': checkedBundle?.id === bundle.id,\n })}\n id={bundle.id}\n value={bundle.id}\n checked={checkedBundle?.id === bundle.id}\n />\n <label htmlFor={bundle.id} className=\"size-full flex items-center cursor-pointer py-4 lg-desktop:py-6\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center justify-between gap-6 \" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-2\">\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"size-12 shrink-0\"\n imgClassName=\"h-full\"\n />\n <Text\n {...getTooltipProps(bundleVariant.variant.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={bundleVariant.variant.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"laptop:flex-row flex shrink-0 flex-col items-center justify-end gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold\"\n html={formatPrice({\n amount: bundleVariant.price,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n {bundleVariant.price < bundleVariant.variant.price.amount && (\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n )}\n </div>\n </div>\n )\n })}\n </label>\n </div>\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductBundle)\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmEM,IAAAI,EAAA,6BAnENC,EAAwC,iDACxCC,EAAmB,8CACnBC,EAA+B,gDAC/BC,EAAqC,6CACrCC,EAA4B,sCAE5BC,EAA2B,8CAC3BC,EAAgD,iDAEhD,MAAMC,EAAgB,IAAM,CAC1B,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CACJ,QAAAC,EACA,OAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,2BAAAC,EACA,8BAAAC,EACA,2BAAAC,EACA,YAAAC,CACF,KAAI,wBAAqB,EAEnB,CAAE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A,OAAC,SAAM,QAASA,EAAO,GAAI,UAAU,kEAClC,SAAAqB,GAAgB,IAAIC,MAEjB,QAAC,OAAI,UAAU,2CACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,WACC,OAAQA,GAAe,SAAS,OAAO,IACvC,UAAU,mBACV,aAAa,SACf,KACA,OAAC,QACE,GAAGF,EAAgBE,EAAc,QAAQ,QAAQ,KAAK,EACvD,UAAU,2EACV,KAAMA,EAAc,QAAQ,QAAQ,MACtC,KACA,OAAC,iBAAe,GAAGH,EAAS,GAC9B,KACA,QAAC,OAAI,UAAU,wEACb,oBAAC,QACC,UAAU,4EACV,QAAM,eAAY,CAChB,OAAQG,EAAc,MACtB,OAAAxB,EACA,aAAcwB,EAAc,QAAQ,MAAM,YAC5C,CAAC,EACH,EACCA,EAAc,MAAQA,EAAc,QAAQ,MAAM,WACjD,OAAC,QACC,UAAU,wGACV,QAAM,eAAY,CAChB,OAAQA,EAAc,QAAQ,MAAM,OACpC,OAAAxB,EACA,aAAcwB,EAAc,QAAQ,MAAM,YAC5C,CAAC,EACH,GAEJ,IAjC6DA,EAAc,QAAQ,EAkCrF,CAEH,EACH,GACF,GA5DQtB,EAAO,EA6DjB,CAEJ,CAAC,EACH,GACF,CAEJ,EAEA,IAAOb,KAAQ,cAAWU,CAAa",
6
6
  "names": ["ProductBundle_exports", "__export", "ProductBundle_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_AiuiProvider", "import_BizProductProvider", "import_utils", "import_Styles", "import_useFollowTooltip", "ProductBundle", "locale", "variant", "bundle", "checkedBundle", "setCheckedBundle", "setCheckedGift", "savingDetail", "setSavingDetail", "setCheckedExchangePurchase", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "setAddOrder", "title", "bundleList", "showAtListing", "availableBundleList", "v", "handleSelectedChange", "bundleItem", "prev", "t", "tooltip", "getTooltipProps", "bundleVariants", "bundleVariant"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var $=Object.create;var f=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var A=(o,t)=>{for(var n in t)f(o,n,{get:t[n],enumerable:!0})},h=(o,t,n,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of E(t))!U.call(o,a)&&a!==n&&f(o,a,{get:()=>t[a],enumerable:!(d=z(t,a))||d.enumerable});return o};var T=(o,t,n)=>(n=o!=null?$(H(o)):{},h(t||!o||!o.__esModule?f(n,"default",{value:o,enumerable:!0}):n,o)),q=o=>h(f({},"__esModule",{value:!0}),o);var J={};A(J,{CouponCard:()=>v,MemberDiscountCard:()=>y,default:()=>G});module.exports=q(J);var e=require("react/jsx-runtime"),O=require("react"),s=require("../../../../../../helpers/index.js"),r=require("../../../../../../components/index.js"),P=T(require("../../../../hooks/useCopy.js")),w=require("../../../../hooks/useBenefits.js"),F=require("../../../../BizProductProvider.js"),M=require("../../../../hooks/useComponentData.js"),m=require("../../../../utils/textFormat.js"),I=require("../../../../../AiuiProvider/index.js"),_=T(require("../../../../../../hooks/useCountDown.js"));const v=({checked:o,discountText:t,codeText:n,code:d,countdownText:a,copyText:g,copiedText:b,onClick:l,className:x})=>{const{copied:C,copy:k}=(0,P.default)();return(0,e.jsx)("div",{className:(0,s.cn)("flex flex-col gap-3 rounded-box overflow-hidden",x),role:"button",tabIndex:0,onClick:l,children:(0,e.jsxs)("div",{className:"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(r.Checkbox,{size:"lg",className:"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary",checked:o}),(0,e.jsx)(r.Text,{className:"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]",children:t})]}),(0,e.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,e.jsx)("div",{className:"flex shrink-0 flex-col items-start",children:(0,e.jsx)(r.Text,{className:"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px]",children:n})}),(0,e.jsx)(r.Link,{className:"lg-desktop:text-[16px] text-[14px] font-bold underline",role:"button",tabIndex:0,onClick:i=>{i.preventDefault(),i.stopPropagation(),k(d)},children:C?b:g})]})]}),a&&(0,e.jsx)(r.Text,{className:"text-brand-0 text-sm lg-desktop:text-base font-bold leading-[1.4] tracking-[-0.28px]",children:a})]})})};v.displayName="CouponCard";const y=({checked:o,discountText:t,description:n,onClick:d,className:a})=>(0,e.jsx)("div",{className:(0,s.cn)("flex flex-col gap-3 rounded-box overflow-hidden",a),role:"button",tabIndex:0,onClick:d,children:(0,e.jsx)("div",{className:"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(r.Checkbox,{size:"lg",className:"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary",checked:o}),(0,e.jsx)(r.Text,{className:"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]",children:t})]}),n&&(0,e.jsx)(r.Text,{className:"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px] pl-8",children:n})]})})});y.displayName="MemberDiscountCard";const D=({className:o})=>{const{profile:t,variant:n,onUseCouponChange:d,onUseMemberDiscountChange:a,openSignInPopup:g,discount:b,savingDetail:l}=(0,F.useBizProductContext)(),{locale:x="us",trackingData:C}=(0,I.useAiuiContext)(),k=(0,w.useBenefits)({variant:n}),{commonCoupon:i,memberDiscount:u}=k,{days:S,hours:B,minutes:L,seconds:R}=(0,_.default)({endTime:i?.config?.ends_at}),N=C?.common?.coupon,c=(0,M.useComponentData)("ProductCoupon")??{};return!i?.enable&&!u?.enable||!n?.availableForSale?null:(0,e.jsxs)("div",{className:(0,s.cn)("ipc-product-detail-product-coupon flex flex-col gap-3 lg-desktop:gap-4",o),children:[c?.title&&(0,e.jsx)(r.Text,{className:"text-info-primary text-[14px] lg-desktop:text-[16px] font-bold leading-[1.2] tracking-[-0.56px]",children:c.title}),i?.enable&&(0,e.jsx)(v,{checked:l?.coupon>0,discountText:(0,m.replaceTemplate)(c?.common?.offCoupon,{discount:i?.config?.value_type=="percentage"?Math.abs(Number(i?.config?.value||0))+"%":(0,s.formatPrice)({amount:Math.abs(Number(i?.config?.fixed_value||0)),currencyCode:n.price.currencyCode,locale:x})||""}),codeText:(0,m.replaceTemplate)(c?.common?.withCode,{code:i?.config?.title??""}),code:i?.config?.title??"",countdownText:i?.config?.ends_at?(0,m.replaceTemplate)(c?.common?.endsIn,{countdown:`${S}:${B}:${L}:${R}`}):void 0,copyText:N?.copy||c?.copyCode,copiedText:N?.copied||c?.copied,onClick:()=>{const p=l?.coupon?0:b?.codeSavings??0;d?.(p)}}),u?.enable&&(0,e.jsx)(y,{checked:!!t?.email&&!!l?.member,discountText:(0,m.replaceTemplate)(c?.member?.offMember,{discount:(0,s.formatPrice)({amount:u?.config?.amount??0,currencyCode:n.price.currencyCode,locale:x})||""}),description:t?.email?c?.member?.loginDesc:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"mr-2",dangerouslySetInnerHTML:{__html:c?.member?.unloginDesc}}),(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:p=>{p?.stopPropagation(),g?.()},className:"underline text-nowrap",dangerouslySetInnerHTML:{__html:c?.member?.login}})]}),onClick:()=>{if(t?.email){const p=l?.member?0:u?.config?.amount??0;a?.(p)}}})]})};D.displayName="ProductCoupon";var G=D;
1
+ "use strict";"use client";var $=Object.create;var g=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var A=(o,t)=>{for(var n in t)g(o,n,{get:t[n],enumerable:!0})},h=(o,t,n,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of E(t))!U.call(o,a)&&a!==n&&g(o,a,{get:()=>t[a],enumerable:!(d=z(t,a))||d.enumerable});return o};var T=(o,t,n)=>(n=o!=null?$(H(o)):{},h(t||!o||!o.__esModule?g(n,"default",{value:o,enumerable:!0}):n,o)),q=o=>h(g({},"__esModule",{value:!0}),o);var J={};A(J,{CouponCard:()=>v,MemberDiscountCard:()=>y,default:()=>G});module.exports=q(J);var e=require("react/jsx-runtime"),O=require("react"),s=require("../../../../../../helpers/index.js"),i=require("../../../../../../components/index.js"),P=T(require("../../../../hooks/useCopy.js")),w=require("../../../../hooks/useBenefits.js"),F=require("../../../../BizProductProvider.js"),M=require("../../../../hooks/useComponentData.js"),m=require("../../../../utils/textFormat.js"),I=require("../../../../../AiuiProvider/index.js"),_=T(require("../../../../../../hooks/useCountDown.js"));const v=({checked:o,discountText:t,codeText:n,code:d,countdownText:a,copyText:x,copiedText:b,onClick:l,className:u})=>{const{copied:C,copy:k}=(0,P.default)();return(0,e.jsx)("div",{className:(0,s.cn)("flex flex-col gap-3 rounded-box overflow-hidden",u),role:"button",tabIndex:0,onClick:l,children:(0,e.jsxs)("div",{className:"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(i.Checkbox,{size:"lg",className:"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary",checked:o}),(0,e.jsx)(i.Text,{className:"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]",children:t})]}),(0,e.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,e.jsx)("div",{className:"flex shrink-0 flex-col items-start",children:(0,e.jsx)(i.Text,{className:"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px]",children:n})}),(0,e.jsx)(i.Link,{className:"lg-desktop:text-[16px] text-[14px] font-bold underline",role:"button",tabIndex:0,onClick:r=>{r.preventDefault(),r.stopPropagation(),k(d)},children:C?b:x})]})]}),a&&(0,e.jsx)(i.Text,{className:"text-brand-0 text-sm lg-desktop:text-base font-bold leading-[1.4] tracking-[-0.28px]",children:a})]})})};v.displayName="CouponCard";const y=({checked:o,discountText:t,description:n,onClick:d,className:a})=>(0,e.jsx)("div",{className:(0,s.cn)("flex flex-col gap-3 rounded-box overflow-hidden",a),role:"button",tabIndex:0,onClick:d,children:(0,e.jsx)("div",{className:"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4",children:(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(i.Checkbox,{size:"lg",className:"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary",checked:o}),(0,e.jsx)(i.Text,{className:"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]",children:t})]}),n&&(0,e.jsx)(i.Text,{className:"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px] pl-8",children:n})]})})});y.displayName="MemberDiscountCard";const D=({className:o})=>{const{profile:t,variant:n,onUseCouponChange:d,onUseMemberDiscountChange:a,openSignInPopup:x,discount:b,savingDetail:l}=(0,F.useBizProductContext)(),{locale:u="us",trackingData:C}=(0,I.useAiuiContext)(),k=(0,w.useBenefits)({variant:n}),{commonCoupon:r,memberDiscount:f}=k,{days:S,hours:B,minutes:L,seconds:R}=(0,_.default)({endTime:r?.config?.ends_at}),N=C?.common?.coupon,c=(0,M.useComponentData)("ProductCoupon")??{};return!r?.enable&&!f?.enable||!n?.availableForSale?null:(0,e.jsxs)("div",{className:(0,s.cn)("ipc-product-detail-product-coupon flex flex-col gap-3 lg-desktop:gap-4",o),children:[c?.title&&(0,e.jsx)(i.Text,{className:"text-info-primary text-[14px] lg-desktop:text-[16px] font-bold leading-[1.2] tracking-[-0.56px]",children:c.title}),r?.enable&&(0,e.jsx)(v,{checked:l?.coupon>0,discountText:(0,m.replaceTemplate)(c?.common?.offCoupon,{discount:r?.config?.value_type=="percentage"?Math.abs(Number(r?.config?.value||0))+"%":(0,s.formatPrice)({amount:Math.abs(Number(r?.config?.fixed_value||0)),currencyCode:n.price.currencyCode,locale:u})||""}),codeText:(0,m.replaceTemplate)(c?.common?.withCode,{code:r?.config?.title??""}),code:r?.config?.title??"",countdownText:r?.config?.ends_at?(0,m.replaceTemplate)(c?.common?.endsIn,{countdown:`${S}:${B}:${L}:${R}`}):void 0,copyText:N?.copy||c?.copyCode,copiedText:N?.copied||c?.copied,onClick:()=>{const p=l?.coupon?0:b?.codeSavings??0;d?.(p)}}),f?.enable&&(0,e.jsx)(y,{checked:!!t?.email&&!!l?.member,discountText:(0,m.replaceTemplate)(c?.member?.offMember,{discount:(0,s.formatPrice)({amount:f?.config?.amount??0,currencyCode:n.price.currencyCode,locale:u})||""}),description:t?.email?c?.member?.loginDesc:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"mr-2",dangerouslySetInnerHTML:{__html:c?.member?.unloginDesc}}),(0,e.jsx)("span",{role:"button",tabIndex:0,onClick:p=>{p?.stopPropagation(),x?.()},className:"underline text-nowrap",dangerouslySetInnerHTML:{__html:c?.member?.login}})]}),onClick:()=>{if(!t?.email){x?.();return}const p=l?.member?0:f?.config?.amount??0;a?.(p)}})]})};D.displayName="ProductCoupon";var G=D;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport React from 'react'\nimport { cn, formatPrice } from '../../../../../../helpers/index.js'\nimport { Text, Link, Checkbox } from '../../../../../../components/index.js'\nimport useCopy from '../../../../hooks/useCopy.js'\nimport { useBenefits } from '../../../../hooks/useBenefits.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { useComponentData } from '../../../../hooks/useComponentData.js'\nimport { replaceTemplate } from '../../../../utils/textFormat.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport useCountDown from '../../../../../../hooks/useCountDown.js'\n\nexport interface ProductCouponProps {\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\n// \u4F18\u60E0\u5238\u5361\u7247\u7EC4\u4EF6\nexport interface CouponCardProps {\n /** \u662F\u5426\u9009\u4E2D */\n checked: boolean\n /** \u6298\u6263\u6587\u6848 (\u5982 \"20% OFF\") */\n discountText: string\n /** \u4F18\u60E0\u7801\u6587\u6848 (\u5982 \"With code: ABC123\") */\n codeText: string\n /** \u4F18\u60E0\u7801 */\n code: string\n /** \u5012\u8BA1\u65F6\u6587\u6848 (\u5982 \"Ends in: 1:23:45:00\") */\n countdownText?: string\n /** \u590D\u5236\u6309\u94AE\u6587\u6848 */\n copyText: string\n /** \u5DF2\u590D\u5236\u6587\u6848 */\n copiedText: string\n /** \u70B9\u51FB\u4E8B\u4EF6 */\n onClick?: () => void\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\nexport const CouponCard: React.FC<CouponCardProps> = ({\n checked,\n discountText,\n codeText,\n code,\n countdownText,\n copyText,\n copiedText,\n onClick,\n className,\n}) => {\n const { copied: isCopied, copy: copyToClipboard } = useCopy()\n\n return (\n <div\n className={cn('flex flex-col gap-3 rounded-box overflow-hidden', className)}\n role=\"button\"\n tabIndex={0}\n onClick={onClick}\n >\n <div className=\"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4\">\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-1\">\n <Checkbox\n size=\"lg\"\n className=\"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary\"\n checked={checked}\n />\n <Text className=\"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]\">\n {discountText}\n </Text>\n </div>\n\n <div className=\"flex w-full items-center gap-2\">\n <div className=\"flex shrink-0 flex-col items-start\">\n <Text className=\"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px]\">\n {codeText}\n </Text>\n </div>\n <Link\n className=\"lg-desktop:text-[16px] text-[14px] font-bold underline\"\n role=\"button\"\n tabIndex={0}\n onClick={event => {\n event.preventDefault()\n event.stopPropagation()\n copyToClipboard(code)\n }}\n >\n {isCopied ? copiedText : copyText}\n </Link>\n </div>\n </div>\n\n {countdownText && (\n <Text className=\"text-brand-0 text-sm lg-desktop:text-base font-bold leading-[1.4] tracking-[-0.28px]\">\n {countdownText}\n </Text>\n )}\n </div>\n </div>\n )\n}\n\nCouponCard.displayName = 'CouponCard'\n\n// \u4F1A\u5458\u4EF7\u4F18\u60E0\u5361\u7247\u7EC4\u4EF6\nexport interface MemberDiscountCardProps {\n /** \u662F\u5426\u9009\u4E2D */\n checked: boolean\n /** \u6298\u6263\u6587\u6848 (\u5982 \"$10 OFF Member Price\") */\n discountText: string\n /** \u63CF\u8FF0\u6587\u6848 */\n description?: string\n /** \u70B9\u51FB\u4E8B\u4EF6 */\n onClick?: () => void\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\nexport const MemberDiscountCard: React.FC<MemberDiscountCardProps> = ({\n checked,\n discountText,\n description,\n onClick,\n className,\n}) => {\n return (\n <div\n className={cn('flex flex-col gap-3 rounded-box overflow-hidden', className)}\n role=\"button\"\n tabIndex={0}\n onClick={onClick}\n >\n <div className=\"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4\">\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-1\">\n <Checkbox\n size=\"lg\"\n className=\"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary\"\n checked={checked}\n />\n <Text className=\"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]\">\n {discountText}\n </Text>\n </div>\n\n {description && (\n <Text className=\"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px] pl-8\">\n {description}\n </Text>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nMemberDiscountCard.displayName = 'MemberDiscountCard'\n\nconst ProductCoupon: React.FC<ProductCouponProps> = ({ className }) => {\n const { profile, variant, onUseCouponChange, onUseMemberDiscountChange, openSignInPopup, discount, savingDetail } =\n useBizProductContext()\n const { locale = 'us', trackingData } = useAiuiContext()\n const benefits = useBenefits({ variant })\n const { commonCoupon, memberDiscount } = benefits\n\n const { days, hours, minutes, seconds } = useCountDown({ endTime: commonCoupon?.config?.ends_at })\n\n const couponCopy = trackingData?.common?.coupon\n\n const productCouponData = useComponentData('ProductCoupon') ?? {}\n\n if ((!commonCoupon?.enable && !memberDiscount?.enable) || !variant?.availableForSale) {\n return null\n }\n\n return (\n <div className={cn('ipc-product-detail-product-coupon flex flex-col gap-3 lg-desktop:gap-4', className)}>\n {productCouponData?.title && (\n <Text className=\"text-info-primary text-[14px] lg-desktop:text-[16px] font-bold leading-[1.2] tracking-[-0.56px]\">\n {productCouponData.title}\n </Text>\n )}\n {commonCoupon?.enable && (\n <CouponCard\n checked={savingDetail?.coupon > 0}\n discountText={replaceTemplate(productCouponData?.common?.offCoupon, {\n discount:\n commonCoupon?.config?.value_type == 'percentage'\n ? Math.abs(Number(commonCoupon?.config?.value || 0)) + '%'\n : formatPrice({\n amount: Math.abs(Number(commonCoupon?.config?.fixed_value || 0)),\n currencyCode: variant.price.currencyCode,\n locale,\n }) || '',\n })}\n codeText={replaceTemplate(productCouponData?.common?.withCode, {\n code: commonCoupon?.config?.title ?? '',\n })}\n code={commonCoupon?.config?.title ?? ''}\n countdownText={\n commonCoupon?.config?.ends_at\n ? replaceTemplate(productCouponData?.common?.endsIn, {\n countdown: `${days}:${hours}:${minutes}:${seconds}`,\n })\n : undefined\n }\n copyText={couponCopy?.copy || productCouponData?.copyCode}\n copiedText={couponCopy?.copied || productCouponData?.copied}\n onClick={() => {\n const couponSaving = !savingDetail?.coupon ? (discount?.codeSavings ?? 0) : 0\n onUseCouponChange?.(couponSaving)\n }}\n />\n )}\n\n {memberDiscount?.enable && (\n <MemberDiscountCard\n checked={Boolean(profile?.email) && !!savingDetail?.member}\n discountText={replaceTemplate(productCouponData?.member?.offMember, {\n discount:\n formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }) || '',\n })}\n description={\n Boolean(profile?.email) ? (\n productCouponData?.member?.loginDesc\n ) : (\n <>\n <span className=\"mr-2\" dangerouslySetInnerHTML={{ __html: productCouponData?.member?.unloginDesc }} />\n <span\n role=\"button\"\n tabIndex={0}\n onClick={e => {\n e?.stopPropagation()\n openSignInPopup?.()\n }}\n className=\"underline text-nowrap\"\n dangerouslySetInnerHTML={{ __html: productCouponData?.member?.login }}\n />\n </>\n )\n }\n onClick={() => {\n if (profile?.email) {\n const memberSaving = !savingDetail?.member ? (memberDiscount?.config?.amount ?? 0) : 0\n onUseMemberDiscountChange?.(memberSaving)\n }\n }}\n />\n )}\n </div>\n )\n}\n\nProductCoupon.displayName = 'ProductCoupon'\n\nexport default ProductCoupon\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,EAAA,uBAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAL,GA8DU,IAAAM,EAAA,6BA5DVC,EA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cn, formatPrice } from '../../../../../../helpers/index.js'\nimport { Text, Link, Checkbox } from '../../../../../../components/index.js'\nimport useCopy from '../../../../hooks/useCopy.js'\nimport { useBenefits } from '../../../../hooks/useBenefits.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { useComponentData } from '../../../../hooks/useComponentData.js'\nimport { replaceTemplate } from '../../../../utils/textFormat.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport useCountDown from '../../../../../../hooks/useCountDown.js'\n\nexport interface ProductCouponProps {\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\n// \u4F18\u60E0\u5238\u5361\u7247\u7EC4\u4EF6\nexport interface CouponCardProps {\n /** \u662F\u5426\u9009\u4E2D */\n checked: boolean\n /** \u6298\u6263\u6587\u6848 (\u5982 \"20% OFF\") */\n discountText: string\n /** \u4F18\u60E0\u7801\u6587\u6848 (\u5982 \"With code: ABC123\") */\n codeText: string\n /** \u4F18\u60E0\u7801 */\n code: string\n /** \u5012\u8BA1\u65F6\u6587\u6848 (\u5982 \"Ends in: 1:23:45:00\") */\n countdownText?: string\n /** \u590D\u5236\u6309\u94AE\u6587\u6848 */\n copyText: string\n /** \u5DF2\u590D\u5236\u6587\u6848 */\n copiedText: string\n /** \u70B9\u51FB\u4E8B\u4EF6 */\n onClick?: () => void\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\nexport const CouponCard: React.FC<CouponCardProps> = ({\n checked,\n discountText,\n codeText,\n code,\n countdownText,\n copyText,\n copiedText,\n onClick,\n className,\n}) => {\n const { copied: isCopied, copy: copyToClipboard } = useCopy()\n\n return (\n <div\n className={cn('flex flex-col gap-3 rounded-box overflow-hidden', className)}\n role=\"button\"\n tabIndex={0}\n onClick={onClick}\n >\n <div className=\"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4\">\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-1\">\n <Checkbox\n size=\"lg\"\n className=\"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary\"\n checked={checked}\n />\n <Text className=\"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]\">\n {discountText}\n </Text>\n </div>\n\n <div className=\"flex w-full items-center gap-2\">\n <div className=\"flex shrink-0 flex-col items-start\">\n <Text className=\"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px]\">\n {codeText}\n </Text>\n </div>\n <Link\n className=\"lg-desktop:text-[16px] text-[14px] font-bold underline\"\n role=\"button\"\n tabIndex={0}\n onClick={event => {\n event.preventDefault()\n event.stopPropagation()\n copyToClipboard(code)\n }}\n >\n {isCopied ? copiedText : copyText}\n </Link>\n </div>\n </div>\n\n {countdownText && (\n <Text className=\"text-brand-0 text-sm lg-desktop:text-base font-bold leading-[1.4] tracking-[-0.28px]\">\n {countdownText}\n </Text>\n )}\n </div>\n </div>\n )\n}\n\nCouponCard.displayName = 'CouponCard'\n\n// \u4F1A\u5458\u4EF7\u4F18\u60E0\u5361\u7247\u7EC4\u4EF6\nexport interface MemberDiscountCardProps {\n /** \u662F\u5426\u9009\u4E2D */\n checked: boolean\n /** \u6298\u6263\u6587\u6848 (\u5982 \"$10 OFF Member Price\") */\n discountText: string\n /** \u63CF\u8FF0\u6587\u6848 */\n description?: string\n /** \u70B9\u51FB\u4E8B\u4EF6 */\n onClick?: () => void\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\nexport const MemberDiscountCard: React.FC<MemberDiscountCardProps> = ({\n checked,\n discountText,\n description,\n onClick,\n className,\n}) => {\n return (\n <div\n className={cn('flex flex-col gap-3 rounded-box overflow-hidden', className)}\n role=\"button\"\n tabIndex={0}\n onClick={onClick}\n >\n <div className=\"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4\">\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-1\">\n <Checkbox\n size=\"lg\"\n className=\"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary\"\n checked={checked}\n />\n <Text className=\"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]\">\n {discountText}\n </Text>\n </div>\n\n {description && (\n <Text className=\"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px] pl-8\">\n {description}\n </Text>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nMemberDiscountCard.displayName = 'MemberDiscountCard'\n\nconst ProductCoupon: React.FC<ProductCouponProps> = ({ className }) => {\n const { profile, variant, onUseCouponChange, onUseMemberDiscountChange, openSignInPopup, discount, savingDetail } =\n useBizProductContext()\n const { locale = 'us', trackingData } = useAiuiContext()\n const benefits = useBenefits({ variant })\n const { commonCoupon, memberDiscount } = benefits\n\n const { days, hours, minutes, seconds } = useCountDown({ endTime: commonCoupon?.config?.ends_at })\n\n const couponCopy = trackingData?.common?.coupon\n\n const productCouponData = useComponentData('ProductCoupon') ?? {}\n\n if ((!commonCoupon?.enable && !memberDiscount?.enable) || !variant?.availableForSale) {\n return null\n }\n\n return (\n <div className={cn('ipc-product-detail-product-coupon flex flex-col gap-3 lg-desktop:gap-4', className)}>\n {productCouponData?.title && (\n <Text className=\"text-info-primary text-[14px] lg-desktop:text-[16px] font-bold leading-[1.2] tracking-[-0.56px]\">\n {productCouponData.title}\n </Text>\n )}\n {commonCoupon?.enable && (\n <CouponCard\n checked={savingDetail?.coupon > 0}\n discountText={replaceTemplate(productCouponData?.common?.offCoupon, {\n discount:\n commonCoupon?.config?.value_type == 'percentage'\n ? Math.abs(Number(commonCoupon?.config?.value || 0)) + '%'\n : formatPrice({\n amount: Math.abs(Number(commonCoupon?.config?.fixed_value || 0)),\n currencyCode: variant.price.currencyCode,\n locale,\n }) || '',\n })}\n codeText={replaceTemplate(productCouponData?.common?.withCode, {\n code: commonCoupon?.config?.title ?? '',\n })}\n code={commonCoupon?.config?.title ?? ''}\n countdownText={\n commonCoupon?.config?.ends_at\n ? replaceTemplate(productCouponData?.common?.endsIn, {\n countdown: `${days}:${hours}:${minutes}:${seconds}`,\n })\n : undefined\n }\n copyText={couponCopy?.copy || productCouponData?.copyCode}\n copiedText={couponCopy?.copied || productCouponData?.copied}\n onClick={() => {\n const couponSaving = !savingDetail?.coupon ? (discount?.codeSavings ?? 0) : 0\n onUseCouponChange?.(couponSaving)\n }}\n />\n )}\n\n {memberDiscount?.enable && (\n <MemberDiscountCard\n checked={Boolean(profile?.email) && !!savingDetail?.member}\n discountText={replaceTemplate(productCouponData?.member?.offMember, {\n discount:\n formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }) || '',\n })}\n description={\n Boolean(profile?.email) ? (\n productCouponData?.member?.loginDesc\n ) : (\n <>\n <span className=\"mr-2\" dangerouslySetInnerHTML={{ __html: productCouponData?.member?.unloginDesc }} />\n <span\n role=\"button\"\n tabIndex={0}\n onClick={e => {\n e?.stopPropagation()\n openSignInPopup?.()\n }}\n className=\"underline text-nowrap\"\n dangerouslySetInnerHTML={{ __html: productCouponData?.member?.login }}\n />\n </>\n )\n }\n onClick={() => {\n if (!profile?.email) {\n openSignInPopup?.()\n return\n }\n const memberSaving = !savingDetail?.member ? (memberDiscount?.config?.amount ?? 0) : 0\n onUseMemberDiscountChange?.(memberSaving)\n }}\n />\n )}\n </div>\n )\n}\n\nProductCoupon.displayName = 'ProductCoupon'\n\nexport default ProductCoupon\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,EAAA,uBAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAL,GA8DU,IAAAM,EAAA,6BA5DVC,EAAkB,iBAClBC,EAAgC,8CAChCC,EAAqC,iDACrCC,EAAoB,2CACpBC,EAA4B,4CAC5B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,OAAS,EACvC,CAAC,EACD,KAAMA,GAAc,QAAQ,OAAS,GACrC,cACEA,GAAc,QAAQ,WAClB,mBAAgBQ,GAAmB,QAAQ,OAAQ,CACjD,UAAW,GAAGN,CAAI,IAAIC,CAAK,IAAIC,CAAO,IAAIC,CAAO,EACnD,CAAC,EACD,OAEN,SAAUE,GAAY,MAAQC,GAAmB,SACjD,WAAYD,GAAY,QAAUC,GAAmB,OACrD,QAAS,IAAM,CACb,MAAMC,EAAgBb,GAAc,OAAwC,EAA9BD,GAAU,aAAe,EACvEH,IAAoBiB,CAAY,CAClC,EACF,EAGDR,GAAgB,WACf,OAACxC,EAAA,CACC,QAAS,EAAQ6B,GAAS,OAAU,CAAC,CAACM,GAAc,OACpD,gBAAc,mBAAgBY,GAAmB,QAAQ,UAAW,CAClE,YACE,eAAY,CACV,OAAQP,GAAgB,QAAQ,QAAU,EAC1C,aAAcV,EAAQ,MAAM,aAC5B,OAAAM,CACF,CAAC,GAAK,EACV,CAAC,EACD,YACUP,GAAS,MACfkB,GAAmB,QAAQ,aAE3B,oBACE,oBAAC,QAAK,UAAU,OAAO,wBAAyB,CAAE,OAAQA,GAAmB,QAAQ,WAAY,EAAG,KACpG,OAAC,QACC,KAAK,SACL,SAAU,EACV,QAASE,GAAK,CACZA,GAAG,gBAAgB,EACnBhB,IAAkB,CACpB,EACA,UAAU,wBACV,wBAAyB,CAAE,OAAQc,GAAmB,QAAQ,KAAM,EACtE,GACF,EAGJ,QAAS,IAAM,CACb,GAAI,CAAClB,GAAS,MAAO,CACnBI,IAAkB,EAClB,MACF,CACA,MAAMiB,EAAgBf,GAAc,OAAiD,EAAvCK,GAAgB,QAAQ,QAAU,EAChFR,IAA4BkB,CAAY,CAC1C,EACF,GAEJ,CAEJ,EAEAtB,EAAc,YAAc,gBAE5B,IAAO3B,EAAQ2B",
6
6
  "names": ["ProductCoupon_exports", "__export", "CouponCard", "MemberDiscountCard", "ProductCoupon_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_helpers", "import_components", "import_useCopy", "import_useBenefits", "import_BizProductProvider", "import_useComponentData", "import_textFormat", "import_AiuiProvider", "import_useCountDown", "checked", "discountText", "codeText", "code", "countdownText", "copyText", "copiedText", "onClick", "className", "isCopied", "copyToClipboard", "useCopy", "event", "description", "ProductCoupon", "profile", "variant", "onUseCouponChange", "onUseMemberDiscountChange", "openSignInPopup", "discount", "savingDetail", "locale", "trackingData", "benefits", "commonCoupon", "memberDiscount", "days", "hours", "minutes", "seconds", "useCountDown", "couponCopy", "productCouponData", "couponSaving", "e", "memberSaving"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var L=(r,o)=>{for(var d in o)n(r,d,{get:o[d],enumerable:!0})},O=(r,o,d,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of T(o))!z.call(r,c)&&c!==d&&n(r,c,{get:()=>o[c],enumerable:!(a=B(o,c))||a.enumerable});return r};var S=r=>O(n({},"__esModule",{value:!0}),r);var R={};L(R,{default:()=>A});module.exports=S(R);var t=require("react/jsx-runtime"),l=require("../../../../../../components/index.js"),p=require("../../../../../../helpers/index.js"),k=require("react"),C=require("../../../../BizProductProvider.js"),m=require("../../../../utils/index.js"),v=require("../../../../../AiuiProvider/index.js"),y=require("../../../../../../shared/Styles.js"),i=require("../../../../hooks/useFollowTooltip.js");const V=()=>{const{locale:r="us"}=(0,v.useAiuiContext)(),{tooltip:o,getTooltipProps:d}=(0,i.useFollowTooltip)(),{checkedExchangePurchase:a,exchangePurchase:c,setCheckedBundle:j,setJoinedRecommendBuyProducts:u,setSavingDetail:N,setCheckedExchangePurchase:x,joinedRecommendBuyProducts:h,savingDetail:E,setAddOrder:f}=(0,C.useBizProductContext)(),{title:w,giftList:b=[],freeLabel:G}=c||{},g=(0,k.useMemo)(()=>b?.filter(e=>e.availableForSale),[b]),D=e=>{a?.id===e.id?(x?.(void 0),u?.({...h,exchange:{value:void 0,canOperate:!0}}),N?.({...E,exchangePurchase:0}),f?.(s=>s.filter(P=>P!=="exchange"))):(x?.(e),u?.({...h,exchange:{value:e,canOperate:!1}}),f?.(s=>[...s.filter(F=>F!=="exchange"),"exchange"]))};return g?.length?(0,t.jsxs)("div",{className:"ipc-product-detail-exchange-purchase",children:[(0,t.jsx)(l.Text,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:w}),(0,t.jsx)("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:g.map(e=>(0,t.jsxs)("div",{className:(0,p.cn)("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":a?.id===e.id}),children:[(0,t.jsx)(l.Checkbox,{onCheckedChange:()=>D(e),size:"lg",className:(0,p.cn)("rounded-full border-2 border-[#E4E5E6]",{"border-brand":a?.id===e.id}),id:e.id,checked:a?.id===e.id,value:e.id}),(0,t.jsxs)("label",{htmlFor:e.id,className:"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(l.Picture,{source:e.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),(0,t.jsx)(l.Text,{...d(e.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:e.product.title}),(0,t.jsx)(i.FollowTooltip,{...o})]}),(0,t.jsxs)("div",{className:"tablet:flex-row flex shrink-0 flex-col items-center gap-1",children:[(0,t.jsx)(l.Text,{className:"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold",html:(0,m.formatPrice)({amount:e?.finalPrice?.amount||0,locale:r,currencyCode:e?.finalPrice?.currencyCode||"USD"})}),(0,t.jsx)(l.Text,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through",html:(0,m.formatPrice)({amount:e.price.amount,locale:r,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var A=(0,y.withLayout)(V);
1
+ "use strict";var n=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var L=(r,o)=>{for(var d in o)n(r,d,{get:o[d],enumerable:!0})},O=(r,o,d,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of T(o))!z.call(r,c)&&c!==d&&n(r,c,{get:()=>o[c],enumerable:!(l=B(o,c))||l.enumerable});return r};var S=r=>O(n({},"__esModule",{value:!0}),r);var R={};L(R,{default:()=>A});module.exports=S(R);var t=require("react/jsx-runtime"),a=require("../../../../../../components/index.js"),p=require("../../../../../../helpers/index.js"),k=require("react"),C=require("../../../../BizProductProvider.js"),m=require("../../../../utils/index.js"),v=require("../../../../../AiuiProvider/index.js"),y=require("../../../../../../shared/Styles.js"),i=require("../../../../hooks/useFollowTooltip.js");const V=()=>{const{locale:r="us"}=(0,v.useAiuiContext)(),{tooltip:o,getTooltipProps:d}=(0,i.useFollowTooltip)(),{checkedExchangePurchase:l,exchangePurchase:c,setCheckedBundle:j,setJoinedRecommendBuyProducts:u,setSavingDetail:N,setCheckedExchangePurchase:x,joinedRecommendBuyProducts:h,savingDetail:E,setAddOrder:f}=(0,C.useBizProductContext)(),{title:w,giftList:b=[],freeLabel:G}=c||{},g=(0,k.useMemo)(()=>b?.filter(e=>e.availableForSale),[b]),D=e=>{l?.id===e.id?(x?.(void 0),u?.({...h,exchange:{value:void 0,canOperate:!0}}),N?.({...E,exchangePurchase:0}),f?.(s=>s.filter(P=>P!=="exchange"))):(x?.(e),u?.({...h,exchange:{value:e,canOperate:!1}}),f?.(s=>[...s.filter(F=>F!=="exchange"),"exchange"]))};return g?.length?(0,t.jsxs)("div",{className:"ipc-product-detail-exchange-purchase",children:[(0,t.jsx)(a.Text,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:w}),(0,t.jsx)("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:g.map(e=>(0,t.jsxs)("div",{className:(0,p.cn)("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":l?.id===e.id}),children:[(0,t.jsx)(a.Checkbox,{onCheckedChange:()=>D(e),size:"lg",className:(0,p.cn)("rounded-full border-2 border-[#E4E5E6]",{"border-brand-0 data-[state=checked]:bg-brand-0":l?.id===e.id}),id:e.id,checked:l?.id===e.id,value:e.id}),(0,t.jsxs)("label",{htmlFor:e.id,className:"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.Picture,{source:e.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),(0,t.jsx)(a.Text,{...d(e.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:e.product.title}),(0,t.jsx)(i.FollowTooltip,{...o})]}),(0,t.jsxs)("div",{className:"tablet:flex-row flex shrink-0 flex-col items-center gap-1",children:[(0,t.jsx)(a.Text,{className:"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold",html:(0,m.formatPrice)({amount:e?.finalPrice?.amount||0,locale:r,currencyCode:e?.finalPrice?.currencyCode||"USD"})}),(0,t.jsx)(a.Text,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through",html:(0,m.formatPrice)({amount:e.price.amount,locale:r,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var A=(0,y.withLayout)(V);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.tsx"],
4
- "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant, ProductPrice } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductExchangePurchase = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n checkedExchangePurchase,\n exchangePurchase,\n setCheckedBundle,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n setCheckedExchangePurchase,\n joinedRecommendBuyProducts,\n savingDetail,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = exchangePurchase || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedExchangePurchase?.id === value.id) {\n setCheckedExchangePurchase?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n } else {\n setCheckedExchangePurchase?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'exchange')\n return [...filtered, 'exchange']\n })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-exchange-purchase\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map((gift: ProductVariant & { finalPrice?: ProductPrice }) => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedExchangePurchase?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand': checkedExchangePurchase?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedExchangePurchase?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold\"\n html={formatPrice({\n amount: gift?.finalPrice?.amount || 0,\n locale,\n currencyCode: gift?.finalPrice?.currencyCode || 'USD',\n })}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductExchangePurchase)\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8DM,IAAAI,EAAA,6BA9DNC,EAAwC,iDACxCC,EAAmB,8CACnBC,EAAwB,iBACxBC,EAAqC,6CACrCC,EAA4B,sCAC5BC,EAA+B,gDAE/BC,EAA2B,8CAC3BC,EAAgD,iDAEhD,MAAMC,EAA0B,IAAM,CACpC,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CAAE,QAAAC,EAAS,gBAAAC,CAAgB,KAAI,oBAAiB,EAChD,CACJ,wBAAAC,EACA,iBAAAC,EACA,iBAAAC,EACA,8BAAAC,EACA,gBAAAC,EACA,2BAAAC,EACA,2BAAAC,EACA,aAAAC,EACA,YAAAC,CACF,KAAI,wBAAqB,EACnB,CAAE,MAAAC,EAAO,SAAAC,EAAW,CAAC,EAAG,UAAAC,CAAU,EAAIV,GAAoB,CAAC,EAC3DW,KAAiB,WAAQ,IAAMF,GAAU,OAAOG,GAAQA,EAAK,gBAAgB,EAAG,CAACH,CAAQ,CAAC,EAE1FI,EAAuBC,GAA0B,CACjDf,GAAyB,KAAOe,EAAM,IACxCV,IAA6B,MAAS,EACtCF,IAAgC,CAC9B,GAAGG,EACH,SAAU,CACR,MAAO,OACP,WAAY,EACd,CACF,CAAC,EACDF,IAAkB,CAAE,GAAGG,EAAc,iBAAkB,CAAE,CAAC,EAE1DC,IAAcQ,GAAQA,EAAK,OAAOC,GAAKA,IAAM,UAAU,CAAC,IAExDZ,IAA6BU,CAAK,EAClCZ,IAAgC,CAC9B,GAAGG,EACH,SAAU,CACR,MAAAS,EACA,WAAY,EACd,CACF,CAAC,EAEDP,IAAcQ,GAGL,CAAC,GADSA,EAAK,OAAOC,GAAKA,IAAM,UAAU,EAC7B,UAAU,CAChC,EAEL,EAEA,OAAKL,GAAgB,UAGnB,QAAC,OAAI,UAAU,uCACb,oBAAC,QAAK,UAAU,6DAA6D,KAAMH,EAAO,KAC1F,OAAC,OAAI,UAAU,uFACZ,SAAAG,EAAe,IAAKM,MACnB,QAAC,OAEC,aAAW,MACT,mHACA,CACG,eAAiBlB,GAAyB,KAAOkB,EAAK,EACzD,CACF,EAEA,oBAAC,YACC,gBAAiB,IAAMJ,EAAoBI,CAAI,EAC/C,KAAK,KACL,aAAW,MAAG,yCAA0C,CACtD,eAAgBlB,GAAyB,KAAOkB,EAAK,EACvD,CAAC,EACD,GAAIA,EAAK,GACT,QAASlB,GAAyB,KAAOkB,EAAK,GAC9C,MAAOA,EAAK,GACb,KACD,QAAC,SACC,QAASA,EAAK,GACd,UAAU,qFAEV,qBAAC,OAAI,UAAU,0BACb,oBAAC,WAAQ,OAAQA,EAAK,OAAO,IAAK,UAAU,mBAAmB,aAAa,SAAS,KACrF,OAAC,QACE,GAAGnB,EAAgBmB,EAAK,QAAQ,KAAK,EACtC,UAAU,2EACV,KAAMA,EAAK,QAAQ,MACrB,KACA,OAAC,iBAAe,GAAGpB,EAAS,GAC9B,KACA,QAAC,OAAI,UAAU,4DACb,oBAAC,QACC,UAAU,4EACV,QAAM,eAAY,CAChB,OAAQoB,GAAM,YAAY,QAAU,EACpC,OAAArB,EACA,aAAcqB,GAAM,YAAY,cAAgB,KAClD,CAAC,EACH,KACA,OAAC,QACC,UAAU,yGACV,QAAM,eAAY,CAChB,OAAQA,EAAK,MAAM,OACnB,OAAArB,EACA,aAAcqB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IAjDKA,EAAK,EAkDZ,CACD,EACH,GACF,EA7DkC,IA+DtC,EAEA,IAAOjC,KAAQ,cAAWW,CAAuB",
4
+ "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant, ProductPrice } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductExchangePurchase = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n checkedExchangePurchase,\n exchangePurchase,\n setCheckedBundle,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n setCheckedExchangePurchase,\n joinedRecommendBuyProducts,\n savingDetail,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = exchangePurchase || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedExchangePurchase?.id === value.id) {\n setCheckedExchangePurchase?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n } else {\n setCheckedExchangePurchase?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'exchange')\n return [...filtered, 'exchange']\n })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-exchange-purchase\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map((gift: ProductVariant & { finalPrice?: ProductPrice }) => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedExchangePurchase?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand-0 data-[state=checked]:bg-brand-0': checkedExchangePurchase?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedExchangePurchase?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold\"\n html={formatPrice({\n amount: gift?.finalPrice?.amount || 0,\n locale,\n currencyCode: gift?.finalPrice?.currencyCode || 'USD',\n })}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(Product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A6D,KAAMH,EAAO,KAC1F,OAAC,OAAI,UAAU,uFACZ,SAAAG,EAAe,IAAKM,MACnB,QAAC,OAEC,aAAW,MACT,mHACA,CACG,eAAiBlB,GAAyB,KAAOkB,EAAK,EACzD,CACF,EAEA,oBAAC,YACC,gBAAiB,IAAMJ,EAAoBI,CAAI,EAC/C,KAAK,KACL,aAAW,MAAG,yCAA0C,CACtD,iDAAkDlB,GAAyB,KAAOkB,EAAK,EACzF,CAAC,EACD,GAAIA,EAAK,GACT,QAASlB,GAAyB,KAAOkB,EAAK,GAC9C,MAAOA,EAAK,GACb,KACD,QAAC,SACC,QAASA,EAAK,GACd,UAAU,qFAEV,qBAAC,OAAI,UAAU,0BACb,oBAAC,WAAQ,OAAQA,EAAK,OAAO,IAAK,UAAU,mBAAmB,aAAa,SAAS,KACrF,OAAC,QACE,GAAGnB,EAAgBmB,EAAK,QAAQ,KAAK,EACtC,UAAU,2EACV,KAAMA,EAAK,QAAQ,MACrB,KACA,OAAC,iBAAe,GAAGpB,EAAS,GAC9B,KACA,QAAC,OAAI,UAAU,4DACb,oBAAC,QACC,UAAU,4EACV,QAAM,eAAY,CAChB,OAAQoB,GAAM,YAAY,QAAU,EACpC,OAAArB,EACA,aAAcqB,GAAM,YAAY,cAAgB,KAClD,CAAC,EACH,KACA,OAAC,QACC,UAAU,yGACV,QAAM,eAAY,CAChB,OAAQA,EAAK,MAAM,OACnB,OAAArB,EACA,aAAcqB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IAjDKA,EAAK,EAkDZ,CACD,EACH,GACF,EA7DkC,IA+DtC,EAEA,IAAOjC,KAAQ,cAAWW,CAAuB",
6
6
  "names": ["ProductExchangePurchase_exports", "__export", "ProductExchangePurchase_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_react", "import_BizProductProvider", "import_utils", "import_AiuiProvider", "import_Styles", "import_useFollowTooltip", "ProductExchangePurchase", "locale", "tooltip", "getTooltipProps", "checkedExchangePurchase", "exchangePurchase", "setCheckedBundle", "setJoinedRecommendBuyProducts", "setSavingDetail", "setCheckedExchangePurchase", "joinedRecommendBuyProducts", "savingDetail", "setAddOrder", "title", "giftList", "freeLabel", "availableGifts", "item", "handleCheckboxClick", "value", "prev", "t", "gift"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var p=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var L=(r,o)=>{for(var d in o)p(r,d,{get:o[d],enumerable:!0})},O=(r,o,d,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of T(o))!z.call(r,l)&&l!==d&&p(r,l,{get:()=>o[l],enumerable:!(a=D(o,l))||a.enumerable});return r};var A=r=>O(p({},"__esModule",{value:!0}),r);var V={};L(V,{default:()=>S});module.exports=A(V);var t=require("react/jsx-runtime"),i=require("../../../../../../components/index.js"),n=require("../../../../../../helpers/index.js"),k=require("react"),v=require("../../../../BizProductProvider.js"),C=require("../../../../utils/index.js"),N=require("../../../../../AiuiProvider/index.js"),y=require("../../../../../../shared/Styles.js"),s=require("../../../../hooks/useFollowTooltip.js");const R=()=>{const{locale:r="us"}=(0,N.useAiuiContext)(),{tooltip:o,getTooltipProps:d}=(0,s.useFollowTooltip)(),{freeGift:a,checkedGift:l,setCheckedGift:m,setCheckedBundle:j,setSavingDetail:P,savingDetail:E,setJoinedRecommendBuyProducts:f,joinedRecommendBuyProducts:u,setAddOrder:x}=(0,v.useBizProductContext)(),{title:w,giftList:b=[],freeLabel:F}=a||{},h=(0,k.useMemo)(()=>b?.filter(e=>e.availableForSale),[b]),G=e=>{l?.id===e.id?(m?.(void 0),P?.({...E,freeGift:0}),f?.({...u,gift:{value:void 0,canOperate:!0}}),x?.(c=>c.filter(g=>g!=="gift"))):(m?.(e),f?.({...u,gift:{value:e,canOperate:!1}}),x?.(c=>[...c.filter(B=>B!=="gift"),"gift"]))};return h?.length?(0,t.jsxs)("div",{className:"ipc-product-detail-free-gift",children:[(0,t.jsx)(i.Text,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:w}),(0,t.jsx)("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:h.map(e=>(0,t.jsxs)("div",{className:(0,n.cn)("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":l?.id===e.id}),children:[(0,t.jsx)(i.Checkbox,{onCheckedChange:()=>G(e),size:"lg",className:(0,n.cn)("rounded-full border-2 border-[#E4E5E6]",{"border-brand":l?.id===e.id}),id:e.id,checked:l?.id===e.id,value:e.id}),(0,t.jsxs)("label",{htmlFor:e.id,className:"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.Picture,{source:e.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),(0,t.jsx)(i.Text,{...d(e.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:e.product.title}),(0,t.jsx)(s.FollowTooltip,{...o})]}),(0,t.jsxs)("div",{className:"tablet:flex-row flex shrink-0 flex-col items-center gap-1",children:[(0,t.jsx)(i.Text,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]",html:F}),(0,t.jsx)(i.Text,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]",html:(0,C.formatPrice)({amount:e.price.amount,locale:r,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var S=(0,y.withLayout)(R);
1
+ "use strict";var p=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var L=(r,o)=>{for(var i in o)p(r,i,{get:o[i],enumerable:!0})},O=(r,o,i,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of T(o))!z.call(r,l)&&l!==i&&p(r,l,{get:()=>o[l],enumerable:!(a=D(o,l))||a.enumerable});return r};var A=r=>O(p({},"__esModule",{value:!0}),r);var V={};L(V,{default:()=>S});module.exports=A(V);var t=require("react/jsx-runtime"),d=require("../../../../../../components/index.js"),n=require("../../../../../../helpers/index.js"),k=require("react"),v=require("../../../../BizProductProvider.js"),C=require("../../../../utils/index.js"),N=require("../../../../../AiuiProvider/index.js"),y=require("../../../../../../shared/Styles.js"),s=require("../../../../hooks/useFollowTooltip.js");const R=()=>{const{locale:r="us"}=(0,N.useAiuiContext)(),{tooltip:o,getTooltipProps:i}=(0,s.useFollowTooltip)(),{freeGift:a,checkedGift:l,setCheckedGift:m,setCheckedBundle:j,setSavingDetail:P,savingDetail:E,setJoinedRecommendBuyProducts:f,joinedRecommendBuyProducts:u,setAddOrder:x}=(0,v.useBizProductContext)(),{title:w,giftList:b=[],freeLabel:F}=a||{},h=(0,k.useMemo)(()=>b?.filter(e=>e.availableForSale),[b]),G=e=>{l?.id===e.id?(m?.(void 0),P?.({...E,freeGift:0}),f?.({...u,gift:{value:void 0,canOperate:!0}}),x?.(c=>c.filter(g=>g!=="gift"))):(m?.(e),f?.({...u,gift:{value:e,canOperate:!1}}),x?.(c=>[...c.filter(B=>B!=="gift"),"gift"]))};return h?.length?(0,t.jsxs)("div",{className:"ipc-product-detail-free-gift",children:[(0,t.jsx)(d.Text,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:w}),(0,t.jsx)("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:h.map(e=>(0,t.jsxs)("div",{className:(0,n.cn)("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":l?.id===e.id}),children:[(0,t.jsx)(d.Checkbox,{onCheckedChange:()=>G(e),size:"lg",className:(0,n.cn)("rounded-full border-2 border-[#E4E5E6]",{"border-brand-0 data-[state=checked]:bg-brand-0":l?.id===e.id}),id:e.id,checked:l?.id===e.id,value:e.id}),(0,t.jsxs)("label",{htmlFor:e.id,className:"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(d.Picture,{source:e.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),(0,t.jsx)(d.Text,{...i(e.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:e.product.title}),(0,t.jsx)(s.FollowTooltip,{...o})]}),(0,t.jsxs)("div",{className:"tablet:flex-row flex shrink-0 flex-col items-center gap-1",children:[(0,t.jsx)(d.Text,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]",html:F}),(0,t.jsx)(d.Text,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]",html:(0,C.formatPrice)({amount:e.price.amount,locale:r,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var S=(0,y.withLayout)(R);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.tsx"],
4
- "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useEffect, useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductFreeGift = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n freeGift,\n checkedGift,\n setCheckedGift,\n setCheckedBundle,\n setSavingDetail,\n savingDetail,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = freeGift || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedGift?.id === value.id) {\n setCheckedGift?.(undefined)\n setSavingDetail?.({ ...savingDetail, freeGift: 0 })\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'gift'))\n } else {\n setCheckedGift?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'gift')\n return [...filtered, 'gift']\n })\n }\n }\n\n // useEffect(() => {\n // // \u5982\u679C\u7B2C\u4E00\u4E2A\u793C\u7269\u53EF\u7528\uFF0C\u5219\u9009\u4E2D\u5B83\n // availableGifts?.[0] && handleCheckboxClick(availableGifts?.[0])\n // }, [availableGifts])\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-free-gift\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map(gift => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedGift?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand': checkedGift?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedGift?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]\"\n html={freeLabel}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductFreeGift)\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmEM,IAAAI,EAAA,6BAnENC,EAAwC,iDACxCC,EAAmB,8CACnBC,EAAmC,iBACnCC,EAAqC,6CACrCC,EAA4B,sCAC5BC,EAA+B,gDAE/BC,EAA2B,8CAC3BC,EAAgD,iDAEhD,MAAMC,EAAkB,IAAM,CAC5B,KAAM,CAAE,OAAAC,EAAS,IAAK,KAA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GAAa,KAAOiB,EAAK,GAClC,MAAOA,EAAK,GACb,KACD,QAAC,SACC,QAASA,EAAK,GACd,UAAU,qFAEV,qBAAC,OAAI,UAAU,0BACb,oBAAC,WAAQ,OAAQA,EAAK,OAAO,IAAK,UAAU,mBAAmB,aAAa,SAAS,KACrF,OAAC,QACE,GAAGnB,EAAgBmB,EAAK,QAAQ,KAAK,EACtC,UAAU,2EACV,KAAMA,EAAK,QAAQ,MACrB,KACA,OAAC,iBAAe,GAAGpB,EAAS,GAC9B,KACA,QAAC,OAAI,UAAU,4DACb,oBAAC,QACC,UAAU,4EACV,KAAMa,EACR,KACA,OAAC,QACC,UAAU,wGACV,QAAM,eAAY,CAChB,OAAQO,EAAK,MAAM,OACnB,OAAArB,EACA,aAAcqB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IA7CKA,EAAK,EA8CZ,CACD,EACH,GACF,EAzDkC,IA2DtC,EAEA,IAAOjC,KAAQ,cAAWW,CAAe",
4
+ "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useEffect, useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductFreeGift = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n freeGift,\n checkedGift,\n setCheckedGift,\n setCheckedBundle,\n setSavingDetail,\n savingDetail,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = freeGift || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedGift?.id === value.id) {\n setCheckedGift?.(undefined)\n setSavingDetail?.({ ...savingDetail, freeGift: 0 })\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'gift'))\n } else {\n setCheckedGift?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'gift')\n return [...filtered, 'gift']\n })\n }\n }\n\n // useEffect(() => {\n // // \u5982\u679C\u7B2C\u4E00\u4E2A\u793C\u7269\u53EF\u7528\uFF0C\u5219\u9009\u4E2D\u5B83\n // availableGifts?.[0] && handleCheckboxClick(availableGifts?.[0])\n // }, [availableGifts])\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-free-gift\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map(gift => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedGift?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand-0 data-[state=checked]:bg-brand-0': checkedGift?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedGift?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]\"\n html={freeLabel}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductFreeGift)\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmEM,IAAAI,EAAA,6BAnENC,EAAwC,iDACxCC,EAAmB,8CACnBC,EAAmC,iBACnCC,EAAqC,6CACrCC,EAA4B,sCAC5BC,EAA+B,gDAE/BC,EAA2B,8CAC3BC,EAAgD,iDAEhD,MAAMC,EAAkB,IAAM,CAC5B,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CAAE,QAAAC,EAAS,gBAAAC,CAAgB,KAAI,oBAAiB,EAChD,CACJ,SAAAC,EACA,YAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,aAAAC,EACA,8BAAAC,EACA,2BAAAC,EACA,YAAAC,CACF,KAAI,wBAAqB,EACnB,CAAE,MAAAC,EA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AQ,KAAK,EACtC,UAAU,2EACV,KAAMA,EAAK,QAAQ,MACrB,KACA,OAAC,iBAAe,GAAGpB,EAAS,GAC9B,KACA,QAAC,OAAI,UAAU,4DACb,oBAAC,QACC,UAAU,4EACV,KAAMa,EACR,KACA,OAAC,QACC,UAAU,wGACV,QAAM,eAAY,CAChB,OAAQO,EAAK,MAAM,OACnB,OAAArB,EACA,aAAcqB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IA7CKA,EAAK,EA8CZ,CACD,EACH,GACF,EAzDkC,IA2DtC,EAEA,IAAOjC,KAAQ,cAAWW,CAAe",
6
6
  "names": ["ProductFreeGift_exports", "__export", "ProductFreeGift_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_react", "import_BizProductProvider", "import_utils", "import_AiuiProvider", "import_Styles", "import_useFollowTooltip", "ProductFreeGift", "locale", "tooltip", "getTooltipProps", "freeGift", "checkedGift", "setCheckedGift", "setCheckedBundle", "setSavingDetail", "savingDetail", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "setAddOrder", "title", "giftList", "freeLabel", "availableGifts", "item", "handleCheckboxClick", "value", "prev", "t", "gift"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var b=Object.create;var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var r in e)p(t,r,{get:e[r],enumerable:!0})},m=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of h(e))!g.call(t,o)&&o!==r&&p(t,o,{get:()=>e[o],enumerable:!(l=v(e,o))||l.enumerable});return t};var P=(t,e,r)=>(r=t!=null?b(N(t)):{},m(e||!t||!t.__esModule?p(r,"default",{value:t,enumerable:!0}):r,t)),y=t=>m(p({},"__esModule",{value:!0}),t);var C={};w(C,{default:()=>B});module.exports=y(C);var a=require("react/jsx-runtime"),i=require("../../../../components/index.js"),n=require("../index.js"),c=require("../../BizProductProvider.js"),u=require("../../hooks/useComponentData.js"),s=P(require("./ScrollSpyNav/index.js")),f=require("../../../../shared/Styles.js");const x=({onSpyNavItemClick:t,totalSavingsSlot:e,actionsSlot:r})=>{const{product:l,renderRating:o}=(0,c.useBizProductContext)(),d=(0,u.useComponentData)("PurchaseBar")??[];return(0,a.jsxs)("div",{id:"purchase-bar",className:"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white",children:[(0,a.jsx)(i.Container,{children:(0,a.jsxs)("div",{className:"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]",children:[(0,a.jsxs)("div",{className:"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3",children:[(0,a.jsx)(i.Heading,{size:2,className:"line-clamp-2 text-wrap",html:l?.title}),(0,a.jsx)("div",{className:"laptop-md:block mt-3 hidden",children:(0,a.jsx)(s.default,{tabs:d,className:"",renderRating:o,onSpyNavItemClick:t})})]}),(0,a.jsx)("div",{className:"laptop-md:block hidden shrink-0",children:r??(0,a.jsx)(n.ProductActions,{totalSavingsSlot:e})})]})}),(0,a.jsxs)(i.Container,{className:"laptop-md:hidden relative",children:[(0,a.jsx)("div",{className:"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]"}),(0,a.jsx)(s.default,{tabs:d,renderRating:o,onSpyNavItemClick:t})]})]})};var B=(0,f.withLayout)(x);
1
+ "use strict";var b=Object.create;var s=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},m=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of h(e))!g.call(t,o)&&o!==r&&s(t,o,{get:()=>e[o],enumerable:!(l=v(e,o))||l.enumerable});return t};var P=(t,e,r)=>(r=t!=null?b(N(t)):{},m(e||!t||!t.__esModule?s(r,"default",{value:t,enumerable:!0}):r,t)),y=t=>m(s({},"__esModule",{value:!0}),t);var C={};w(C,{default:()=>B});module.exports=y(C);var a=require("react/jsx-runtime"),i=require("../../../../components/index.js"),n=require("../index.js"),c=require("../../BizProductProvider.js"),u=require("../../hooks/useComponentData.js"),p=P(require("./ScrollSpyNav/index.js")),f=require("../../../../shared/Styles.js");const x=({onSpyNavItemClick:t,totalSavingsSlot:e,actionsSlot:r})=>{const{product:l,renderRating:o}=(0,c.useBizProductContext)(),d=(0,u.useComponentData)("PurchaseBar")??[];return(0,a.jsxs)("div",{id:"purchase-bar",className:"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white",children:[(0,a.jsx)(i.Container,{children:(0,a.jsxs)("div",{className:"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]",children:[(0,a.jsxs)("div",{className:"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3",children:[(0,a.jsx)(i.Heading,{as:"h1",size:2,className:"line-clamp-2 text-wrap",html:l?.title}),(0,a.jsx)("div",{className:"laptop-md:block mt-3 hidden",children:(0,a.jsx)(p.default,{tabs:d,className:"",renderRating:o,onSpyNavItemClick:t})})]}),(0,a.jsx)("div",{className:"laptop-md:block hidden shrink-0",children:r??(0,a.jsx)(n.ProductActions,{totalSavingsSlot:e})})]})}),(0,a.jsxs)(i.Container,{className:"laptop-md:hidden relative",children:[(0,a.jsx)("div",{className:"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]"}),(0,a.jsx)(p.default,{tabs:d,renderRating:o,onSpyNavItemClick:t})]})]})};var B=(0,f.withLayout)(x);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/biz-components/Listing/components/PurchaseBar/index.tsx"],
4
- "sourcesContent": ["import { Heading, Container } from '../../../../components/index.js'\nimport type { PurchaseBarProps } from './types.js'\nimport { ProductActions } from '../index.js'\nimport { useBizProductContext } from '../../BizProductProvider.js'\nimport { useComponentData } from '../../hooks/useComponentData.js'\nimport ScrollSpyNav from './ScrollSpyNav/index.js'\nimport { withLayout } from '../../../../shared/Styles.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick, totalSavingsSlot, actionsSlot }: PurchaseBarProps) => {\n const { product, renderRating } = useBizProductContext()\n\n const PurchaseBarData = useComponentData('PurchaseBar') ?? []\n\n return (\n <div id=\"purchase-bar\" className=\"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white\">\n <Container>\n <div className=\"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]\">\n <div className=\"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3\">\n <Heading size={2} className=\"line-clamp-2 text-wrap\" html={product?.title} />\n <div className=\"laptop-md:block mt-3 hidden\">\n <ScrollSpyNav\n tabs={PurchaseBarData}\n className=\"\"\n renderRating={renderRating}\n onSpyNavItemClick={onSpyNavItemClick}\n />\n </div>\n </div>\n <div className=\"laptop-md:block hidden shrink-0\">\n {actionsSlot ?? <ProductActions totalSavingsSlot={totalSavingsSlot} />}\n </div>\n </div>\n </Container>\n <Container className=\"laptop-md:hidden relative\">\n <div className=\"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]\"></div>\n <ScrollSpyNav tabs={PurchaseBarData} renderRating={renderRating} onSpyNavItemClick={onSpyNavItemClick} />\n </Container>\n </div>\n )\n}\n\nexport default withLayout(PurchaseBar)\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAiBU,IAAAI,EAAA,6BAjBVC,EAAmC,2CAEnCC,EAA+B,uBAC/BC,EAAqC,uCACrCC,EAAiC,2CACjCC,EAAyB,sCACzBC,EAA2B,wCAE3B,MAAMC,EAAc,CAAC,CAAE,kBAAAC,EAAmB,iBAAAC,EAAkB,YAAAC,CAAY,IAAwB,CAC9F,KAAM,CAAE,QAAAC,EAAS,aAAAC,CAAa,KAAI,wBAAqB,EAEjDC,KAAkB,oBAAiB,aAAa,GAAK,CAAC,EAE5D,SACE,QAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,oBAAC,aACC,oBAAC,OAAI,UAAU,4GACb,qBAAC,OAAI,UAAU,oDACb,oBAAC,WAAQ,KAAM,EAAG,UAAU,yBAAyB,KAAMF,GAAS,MAAO,KAC3E,OAAC,OAAI,UAAU,8BACb,mBAAC,EAAAG,QAAA,CACC,KAAMD,EACN,UAAU,GACV,aAAcD,EACd,kBAAmBJ,EACrB,EACF,GACF,KACA,OAAC,OAAI,UAAU,kCACZ,SAAAE,MAAe,OAAC,kBAAe,iBAAkBD,EAAkB,EACtE,GACF,EACF,KACA,QAAC,aAAU,UAAU,4BACnB,oBAAC,OAAI,UAAU,iDAAiD,KAChE,OAAC,EAAAK,QAAA,CAAa,KAAMD,EAAiB,aAAcD,EAAc,kBAAmBJ,EAAmB,GACzG,GACF,CAEJ,EAEA,IAAOV,KAAQ,cAAWS,CAAW",
4
+ "sourcesContent": ["import { Heading, Container } from '../../../../components/index.js'\nimport type { PurchaseBarProps } from './types.js'\nimport { ProductActions } from '../index.js'\nimport { useBizProductContext } from '../../BizProductProvider.js'\nimport { useComponentData } from '../../hooks/useComponentData.js'\nimport ScrollSpyNav from './ScrollSpyNav/index.js'\nimport { withLayout } from '../../../../shared/Styles.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick, totalSavingsSlot, actionsSlot }: PurchaseBarProps) => {\n const { product, renderRating } = useBizProductContext()\n\n const PurchaseBarData = useComponentData('PurchaseBar') ?? []\n\n return (\n <div id=\"purchase-bar\" className=\"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white\">\n <Container>\n <div className=\"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]\">\n <div className=\"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3\">\n <Heading as=\"h1\" size={2} className=\"line-clamp-2 text-wrap\" html={product?.title} />\n <div className=\"laptop-md:block mt-3 hidden\">\n <ScrollSpyNav\n tabs={PurchaseBarData}\n className=\"\"\n renderRating={renderRating}\n onSpyNavItemClick={onSpyNavItemClick}\n />\n </div>\n </div>\n <div className=\"laptop-md:block hidden shrink-0\">\n {actionsSlot ?? <ProductActions totalSavingsSlot={totalSavingsSlot} />}\n </div>\n </div>\n </Container>\n <Container className=\"laptop-md:hidden relative\">\n <div className=\"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]\"></div>\n <ScrollSpyNav tabs={PurchaseBarData} renderRating={renderRating} onSpyNavItemClick={onSpyNavItemClick} />\n </Container>\n </div>\n )\n}\n\nexport default withLayout(PurchaseBar)\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAiBU,IAAAI,EAAA,6BAjBVC,EAAmC,2CAEnCC,EAA+B,uBAC/BC,EAAqC,uCACrCC,EAAiC,2CACjCC,EAAyB,sCACzBC,EAA2B,wCAE3B,MAAMC,EAAc,CAAC,CAAE,kBAAAC,EAAmB,iBAAAC,EAAkB,YAAAC,CAAY,IAAwB,CAC9F,KAAM,CAAE,QAAAC,EAAS,aAAAC,CAAa,KAAI,wBAAqB,EAEjDC,KAAkB,oBAAiB,aAAa,GAAK,CAAC,EAE5D,SACE,QAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,oBAAC,aACC,oBAAC,OAAI,UAAU,4GACb,qBAAC,OAAI,UAAU,oDACb,oBAAC,WAAQ,GAAG,KAAK,KAAM,EAAG,UAAU,yBAAyB,KAAMF,GAAS,MAAO,KACnF,OAAC,OAAI,UAAU,8BACb,mBAAC,EAAAG,QAAA,CACC,KAAMD,EACN,UAAU,GACV,aAAcD,EACd,kBAAmBJ,EACrB,EACF,GACF,KACA,OAAC,OAAI,UAAU,kCACZ,SAAAE,MAAe,OAAC,kBAAe,iBAAkBD,EAAkB,EACtE,GACF,EACF,KACA,QAAC,aAAU,UAAU,4BACnB,oBAAC,OAAI,UAAU,iDAAiD,KAChE,OAAC,EAAAK,QAAA,CAAa,KAAMD,EAAiB,aAAcD,EAAc,kBAAmBJ,EAAmB,GACzG,GACF,CAEJ,EAEA,IAAOV,KAAQ,cAAWS,CAAW",
6
6
  "names": ["PurchaseBar_exports", "__export", "PurchaseBar_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import__", "import_BizProductProvider", "import_useComponentData", "import_ScrollSpyNav", "import_Styles", "PurchaseBar", "onSpyNavItemClick", "totalSavingsSlot", "actionsSlot", "product", "renderRating", "PurchaseBarData", "ScrollSpyNav"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var b=(e,o)=>{for(var i in o)n(e,i,{get:o[i],enumerable:!0})},h=(e,o,i,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of p(o))!c.call(e,l)&&l!==i&&n(e,l,{get:()=>o[l],enumerable:!(r=u(o,l))||r.enumerable});return e};var v=e=>h(n({},"__esModule",{value:!0}),e);var g={};b(g,{VideoModal:()=>d});module.exports=v(g);var t=require("react/jsx-runtime"),a=require("../../components/dialog.js"),s=require("../VideoModal/YouTubePlayer.js");const d=e=>{const{visible:o,youTubeId:i,videoUrl:r,onCloseModal:l,className:m,...w}=e;return(0,t.jsx)(a.Dialog,{open:o,onOpenChange:()=>l(),children:(0,t.jsxs)(a.DialogContent,{className:"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden",children:[i?(0,t.jsx)(s.YouTubePlayer,{youTubeId:i}):r?(0,t.jsx)("video",{className:"size-full overflow-hidden rounded-2xl object-cover",src:r,muted:!0,loop:!0,autoPlay:!0,controls:!0}):null,(0,t.jsx)("div",{onClick:()=>l(),className:"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",className:"HomeCharger_closeWrap__Z7aBo",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]})})};
1
+ "use strict";var r=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var b=(e,o)=>{for(var l in o)r(e,l,{get:o[l],enumerable:!0})},h=(e,o,l,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of p(o))!c.call(e,i)&&i!==l&&r(e,i,{get:()=>o[i],enumerable:!(n=u(o,i))||n.enumerable});return e};var g=e=>h(r({},"__esModule",{value:!0}),e);var m={};b(m,{VideoModal:()=>d});module.exports=g(m);var t=require("react/jsx-runtime"),a=require("../../components/dialog.js"),s=require("../VideoModal/YouTubePlayer.js");const d=e=>{const{visible:o,youTubeId:l,videoUrl:n,onCloseModal:i,className:v,...w}=e;return(0,t.jsx)(a.Dialog,{open:o,onOpenChange:()=>i(),children:(0,t.jsxs)(a.DialogContent,{className:"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden",children:[l?(0,t.jsx)(s.YouTubePlayer,{youTubeId:l}):n?(0,t.jsx)("video",{className:"size-full overflow-hidden rounded-2xl object-contain",src:n,muted:!0,loop:!0,autoPlay:!0,controls:!0}):null,(0,t.jsx)("div",{onClick:()=>i(),className:"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white",children:(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",className:"HomeCharger_closeWrap__Z7aBo",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]})})};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/VideoModal/index.tsx"],
4
- "sourcesContent": ["import { Dialog, DialogContent } from '../../components/dialog.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\n\nexport interface VideoModalType extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n visible: boolean\n youTubeId?: string\n videoUrl?: string\n onCloseModal: () => void\n}\n\nconst VideoModal = (props: VideoModalType) => {\n const { visible, youTubeId, videoUrl, onCloseModal, className, ...rest } = props\n\n return (\n <Dialog open={visible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden\">\n {youTubeId ? (\n <YouTubePlayer youTubeId={youTubeId} />\n ) : videoUrl ? (\n <video\n className=\"size-full overflow-hidden rounded-2xl object-cover\"\n src={videoUrl}\n muted\n loop\n autoPlay\n controls\n />\n ) : null}\n <div\n onClick={() => onCloseModal()}\n className=\"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n className=\"HomeCharger_closeWrap__Z7aBo\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\"></path>\n </svg>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { VideoModal }\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAeM,IAAAI,EAAA,6BAfNC,EAAsC,sCACtCC,EAA8B,0CAS9B,MAAMJ,EAAcK,GAA0B,CAC5C,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,SAAAC,EAAU,aAAAC,EAAc,UAAAC,EAAW,GAAGC,CAAK,EAAIN,EAE3E,SACE,OAAC,UAAO,KAAMC,EAAS,aAAc,IAAMG,EAAa,EACtD,oBAAC,iBAAc,UAAU,wFACtB,UAAAF,KACC,OAAC,iBAAc,UAAWA,EAAW,EACnCC,KACF,OAAC,SACC,UAAU,qDACV,IAAKA,EACL,MAAK,GACL,KAAI,GACJ,SAAQ,GACR,SAAQ,GACV,EACE,QACJ,OAAC,OACC,QAAS,IAAMC,EAAa,EAC5B,UAAU,wHAEV,mBAAC,OACC,MAAM,6BACN,KAAK,OACL,QAAQ,YACR,YAAY,MACZ,OAAO,eACP,cAAY,OACZ,YAAU,OACV,UAAU,+BAEV,mBAAC,QAAK,cAAc,QAAQ,eAAe,QAAQ,EAAE,uBAAuB,EAC9E,EACF,GACF,EACF,CAEJ",
4
+ "sourcesContent": ["import { Dialog, DialogContent } from '../../components/dialog.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\n\nexport interface VideoModalType extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n visible: boolean\n youTubeId?: string\n videoUrl?: string\n onCloseModal: () => void\n}\n\nconst VideoModal = (props: VideoModalType) => {\n const { visible, youTubeId, videoUrl, onCloseModal, className, ...rest } = props\n\n return (\n <Dialog open={visible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden\">\n {youTubeId ? (\n <YouTubePlayer youTubeId={youTubeId} />\n ) : videoUrl ? (\n <video\n className=\"size-full overflow-hidden rounded-2xl object-contain\"\n src={videoUrl}\n muted\n loop\n autoPlay\n controls\n />\n ) : null}\n <div\n onClick={() => onCloseModal()}\n className=\"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n className=\"HomeCharger_closeWrap__Z7aBo\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\"></path>\n </svg>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { VideoModal }\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAeM,IAAAI,EAAA,6BAfNC,EAAsC,sCACtCC,EAA8B,0CAS9B,MAAMJ,EAAcK,GAA0B,CAC5C,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,SAAAC,EAAU,aAAAC,EAAc,UAAAC,EAAW,GAAGC,CAAK,EAAIN,EAE3E,SACE,OAAC,UAAO,KAAMC,EAAS,aAAc,IAAMG,EAAa,EACtD,oBAAC,iBAAc,UAAU,wFACtB,UAAAF,KACC,OAAC,iBAAc,UAAWA,EAAW,EACnCC,KACF,OAAC,SACC,UAAU,uDACV,IAAKA,EACL,MAAK,GACL,KAAI,GACJ,SAAQ,GACR,SAAQ,GACV,EACE,QACJ,OAAC,OACC,QAAS,IAAMC,EAAa,EAC5B,UAAU,wHAEV,mBAAC,OACC,MAAM,6BACN,KAAK,OACL,QAAQ,YACR,YAAY,MACZ,OAAO,eACP,cAAY,OACZ,YAAU,OACV,UAAU,+BAEV,mBAAC,QAAK,cAAc,QAAQ,eAAe,QAAQ,EAAE,uBAAuB,EAC9E,EACF,GACF,EACF,CAEJ",
6
6
  "names": ["VideoModal_exports", "__export", "VideoModal", "__toCommonJS", "import_jsx_runtime", "import_dialog", "import_YouTubePlayer", "props", "visible", "youTubeId", "videoUrl", "onCloseModal", "className", "rest"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as i,jsxs as r}from"react/jsx-runtime";import{Text as a,Picture as B,Checkbox as P}from"../../../../../../components/index.js";import{cn as u}from"../../../../../../helpers/index.js";import{useAiuiContext as E}from"../../../../../AiuiProvider/index.js";import{useBizProductContext as w}from"../../../../BizProductProvider.js";import{formatPrice as f}from"../../../../utils/index.js";import{withLayout as L}from"../../../../../../shared/Styles.js";import{useFollowTooltip as F,FollowTooltip as z}from"../../../../hooks/useFollowTooltip.js";const D=()=>{const{locale:s="us"}=E(),{variant:x,bundle:v,checkedBundle:l,setCheckedBundle:d,setCheckedGift:T,savingDetail:A,setSavingDetail:O,setCheckedExchangePurchase:S,setJoinedRecommendBuyProducts:c,joinedRecommendBuyProducts:n,setAddOrder:p}=w(),{title:g,bundleList:h,showAtListing:k}=v||{},m=h?.filter(e=>e.variants.slice(1,e.variants.length).every(o=>o.variant.availableForSale));if(!m?.length&&k)return null;const y=e=>{l?.id===e.id?(d?.(void 0),c?.({...n,bundle:{value:void 0,canOperate:!0}}),p?.(o=>o.filter(t=>t!=="bundle"))):(d?.(e),c?.({...n,bundle:{value:e,canOperate:!1}}),p?.(o=>[...o.filter(b=>b!=="bundle"),"bundle"]))},{tooltip:C,getTooltipProps:N}=F();return r("div",{className:"ipc-product-detail-bundle",children:[i(a,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:g}),i("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:m?.map(e=>{const o=e.variants.filter(t=>t.variant.sku!==x.sku);return i("div",{children:r("div",{className:u("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":l?.id===e.id}),children:[i(P,{onCheckedChange:()=>y(e),size:"lg",className:u("rounded-full border-2 border-[#E4E5E6]",{"border-brand":l?.id===e.id}),id:e.id,value:e.id,checked:l?.id===e.id}),i("label",{htmlFor:e.id,className:"size-full flex items-center cursor-pointer py-4 lg-desktop:py-6",children:o?.map(t=>r("div",{className:"flex items-center justify-between gap-6 ",children:[r("div",{className:"flex items-center gap-2",children:[i(B,{source:t?.variant?.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),i(a,{...N(t.variant.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:t.variant.product.title}),i(z,{...C})]}),r("div",{className:"laptop:flex-row flex shrink-0 flex-col items-center justify-end gap-1",children:[i(a,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold",html:f({amount:t.price,locale:s,currencyCode:t.variant.price.currencyCode})}),t.price<t.variant.price.amount&&i(a,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through",html:f({amount:t.variant.price.amount,locale:s,currencyCode:t.variant.price.currencyCode})})]})]},t.variant.id))})]})},e.id)})})]})};var K=L(D);export{K as default};
1
+ import{jsx as i,jsxs as r}from"react/jsx-runtime";import{Text as a,Picture as B,Checkbox as P}from"../../../../../../components/index.js";import{cn as u}from"../../../../../../helpers/index.js";import{useAiuiContext as E}from"../../../../../AiuiProvider/index.js";import{useBizProductContext as w}from"../../../../BizProductProvider.js";import{formatPrice as f}from"../../../../utils/index.js";import{withLayout as L}from"../../../../../../shared/Styles.js";import{useFollowTooltip as F,FollowTooltip as z}from"../../../../hooks/useFollowTooltip.js";const D=()=>{const{locale:s="us"}=E(),{variant:x,bundle:v,checkedBundle:l,setCheckedBundle:d,setCheckedGift:T,savingDetail:A,setSavingDetail:O,setCheckedExchangePurchase:S,setJoinedRecommendBuyProducts:c,joinedRecommendBuyProducts:n,setAddOrder:p}=w(),{title:g,bundleList:h,showAtListing:k}=v||{},m=h?.filter(e=>e.variants.slice(1,e.variants.length).every(o=>o.variant.availableForSale));if(!m?.length&&k)return null;const y=e=>{l?.id===e.id?(d?.(void 0),c?.({...n,bundle:{value:void 0,canOperate:!0}}),p?.(o=>o.filter(t=>t!=="bundle"))):(d?.(e),c?.({...n,bundle:{value:e,canOperate:!1}}),p?.(o=>[...o.filter(b=>b!=="bundle"),"bundle"]))},{tooltip:C,getTooltipProps:N}=F();return r("div",{className:"ipc-product-detail-bundle",children:[i(a,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:g}),i("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:m?.map(e=>{const o=e.variants.filter(t=>t.variant.sku!==x.sku);return i("div",{children:r("div",{className:u("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":l?.id===e.id}),children:[i(P,{onCheckedChange:()=>y(e),size:"lg",className:u("rounded-full border-2 border-[#E4E5E6]",{"border-brand-0 data-[state=checked]:bg-brand-0":l?.id===e.id}),id:e.id,value:e.id,checked:l?.id===e.id}),i("label",{htmlFor:e.id,className:"size-full flex items-center cursor-pointer py-4 lg-desktop:py-6",children:o?.map(t=>r("div",{className:"flex items-center justify-between gap-6 ",children:[r("div",{className:"flex items-center gap-2",children:[i(B,{source:t?.variant?.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),i(a,{...N(t.variant.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:t.variant.product.title}),i(z,{...C})]}),r("div",{className:"laptop:flex-row flex shrink-0 flex-col items-center justify-end gap-1",children:[i(a,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold",html:f({amount:t.price,locale:s,currencyCode:t.variant.price.currencyCode})}),t.price<t.variant.price.amount&&i(a,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through",html:f({amount:t.variant.price.amount,locale:s,currencyCode:t.variant.price.currencyCode})})]})]},t.variant.id))})]})},e.id)})})]})};var K=L(D);export{K as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.tsx"],
4
- "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport type { BundleListItem } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductBundle = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n variant,\n bundle,\n checkedBundle,\n setCheckedBundle,\n setCheckedGift,\n savingDetail,\n setSavingDetail,\n setCheckedExchangePurchase,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n setAddOrder,\n } = useBizProductContext()\n\n const { title, bundleList, showAtListing } = bundle || {}\n\n const availableBundleList = bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n )\n\n if (!availableBundleList?.length && showAtListing) return null\n\n const handleSelectedChange = (bundleItem: BundleListItem) => {\n if (checkedBundle?.id === bundleItem.id) {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'bundle'))\n } else {\n setCheckedBundle?.(bundleItem)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: bundleItem,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'bundle')\n return [...filtered, 'bundle']\n })\n }\n }\n\n const { tooltip, getTooltipProps } = useFollowTooltip()\n\n return (\n <div className=\"ipc-product-detail-bundle\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableBundleList?.map(bundle => {\n const bundleVariants = bundle.variants.filter(v => v.variant.sku !== variant.sku)\n return (\n <div key={bundle.id}>\n <div\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedBundle?.id === bundle.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleSelectedChange(bundle)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand': checkedBundle?.id === bundle.id,\n })}\n id={bundle.id}\n value={bundle.id}\n checked={checkedBundle?.id === bundle.id}\n />\n <label htmlFor={bundle.id} className=\"size-full flex items-center cursor-pointer py-4 lg-desktop:py-6\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center justify-between gap-6 \" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-2\">\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"size-12 shrink-0\"\n imgClassName=\"h-full\"\n />\n <Text\n {...getTooltipProps(bundleVariant.variant.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={bundleVariant.variant.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"laptop:flex-row flex shrink-0 flex-col items-center justify-end gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold\"\n html={formatPrice({\n amount: bundleVariant.price,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n {bundleVariant.price < bundleVariant.variant.price.amount && (\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n )}\n </div>\n </div>\n )\n })}\n </label>\n </div>\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductBundle)\n"],
5
- "mappings": "AAmEM,cAAAA,EA4BkB,QAAAC,MA5BlB,oBAnEN,OAAS,QAAAC,EAAM,WAAAC,EAAS,YAAAC,MAAgB,wCACxC,OAAS,MAAAC,MAAU,qCACnB,OAAS,kBAAAC,MAAsB,uCAC/B,OAAS,wBAAAC,MAA4B,oCACrC,OAAS,eAAAC,MAAmB,6BAE5B,OAAS,cAAAC,MAAkB,qCAC3B,OAAS,oBAAAC,EAAkB,iBAAAC,MAAqB,wCAEhD,MAAMC,EAAgB,IAAM,CAC1B,KAAM,CAAE,OAAAC,EAAS,IAAK,EAAIP,EAAe,EACnC,CACJ,QAAAQ,EACA,OAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,2BAAAC,EACA,8BAAAC,EACA,2BAAAC,EACA,YAAAC,CACF,EAAIjB,EAAqB,EAEnB,CAAE,MAAAkB,EAAO,WAAAC,EAAY,cAAAC,CAAc,EAAIZ,GAAU,CAAC,EAElDa,EAAsBF,GAAY,OAAOX,GAC7CA,EAAO,SAAS,MAAM,EAAGA,EAAO,SAAS,MAAM,EAAE,MAAMc,GAAKA,EAAE,QAAQ,gBAAgB,CACxF,EAEA,GAAI,CAACD,GAAqB,QAAUD,EAAe,OAAO,KAE1D,MAAM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SACf,EACArC,EAACE,EAAA,CACE,GAAGiC,EAAgBE,EAAc,QAAQ,QAAQ,KAAK,EACvD,UAAU,2EACV,KAAMA,EAAc,QAAQ,QAAQ,MACtC,EACArC,EAACW,EAAA,CAAe,GAAGuB,EAAS,GAC9B,EACAjC,EAAC,OAAI,UAAU,wEACb,UAAAD,EAACE,EAAA,CACC,UAAU,4EACV,KAAMM,EAAY,CAChB,OAAQ6B,EAAc,MACtB,OAAAxB,EACA,aAAcwB,EAAc,QAAQ,MAAM,YAC5C,CAAC,EACH,EACCA,EAAc,MAAQA,EAAc,QAAQ,MAAM,QACjDrC,EAACE,EAAA,CACC,UAAU,wGACV,KAAMM,EAAY,CAChB,OAAQ6B,EAAc,QAAQ,MAAM,OACpC,OAAAxB,EACA,aAAcwB,EAAc,QAAQ,MAAM,YAC5C,CAAC,EACH,GAEJ,IAjC6DA,EAAc,QAAQ,EAkCrF,CAEH,EACH,GACF,GA5DQtB,EAAO,EA6DjB,CAEJ,CAAC,EACH,GACF,CAEJ,EAEA,IAAOuB,EAAQ7B,EAAWG,CAAa",
4
+ "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport type { BundleListItem } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductBundle = () => {\n const { locale = 'us' } = useAiuiContext()\n const {\n variant,\n bundle,\n checkedBundle,\n setCheckedBundle,\n setCheckedGift,\n savingDetail,\n setSavingDetail,\n setCheckedExchangePurchase,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n setAddOrder,\n } = useBizProductContext()\n\n const { title, bundleList, showAtListing } = bundle || {}\n\n const availableBundleList = bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n )\n\n if (!availableBundleList?.length && showAtListing) return null\n\n const handleSelectedChange = (bundleItem: BundleListItem) => {\n if (checkedBundle?.id === bundleItem.id) {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'bundle'))\n } else {\n setCheckedBundle?.(bundleItem)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: bundleItem,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'bundle')\n return [...filtered, 'bundle']\n })\n }\n }\n\n const { tooltip, getTooltipProps } = useFollowTooltip()\n\n return (\n <div className=\"ipc-product-detail-bundle\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableBundleList?.map(bundle => {\n const bundleVariants = bundle.variants.filter(v => v.variant.sku !== variant.sku)\n return (\n <div key={bundle.id}>\n <div\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedBundle?.id === bundle.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleSelectedChange(bundle)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand-0 data-[state=checked]:bg-brand-0': checkedBundle?.id === bundle.id,\n })}\n id={bundle.id}\n value={bundle.id}\n checked={checkedBundle?.id === bundle.id}\n />\n <label htmlFor={bundle.id} className=\"size-full flex items-center cursor-pointer py-4 lg-desktop:py-6\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center justify-between gap-6 \" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-2\">\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"size-12 shrink-0\"\n imgClassName=\"h-full\"\n />\n <Text\n {...getTooltipProps(bundleVariant.variant.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={bundleVariant.variant.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"laptop:flex-row flex shrink-0 flex-col items-center justify-end gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold\"\n html={formatPrice({\n amount: bundleVariant.price,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n {bundleVariant.price < bundleVariant.variant.price.amount && (\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount,\n locale,\n currencyCode: bundleVariant.variant.price.currencyCode,\n })}\n />\n )}\n </div>\n </div>\n )\n })}\n </label>\n </div>\n </div>\n )\n })}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductBundle)\n"],
5
+ "mappings": "AAmEM,cAAAA,EA4BkB,QAAAC,MA5BlB,oBAnEN,OAAS,QAAAC,EAAM,WAAAC,EAAS,YAAAC,MAAgB,wCACxC,OAAS,MAAAC,MAAU,qCACnB,OAAS,kBAAAC,MAAsB,uCAC/B,OAAS,wBAAAC,MAA4B,oCACrC,OAAS,eAAAC,MAAmB,6BAE5B,OAAS,cAAAC,MAAkB,qCAC3B,OAAS,oBAAAC,EAAkB,iBAAAC,MA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"useAiuiContext", "useBizProductContext", "formatPrice", "withLayout", "useFollowTooltip", "FollowTooltip", "ProductBundle", "locale", "variant", "bundle", "checkedBundle", "setCheckedBundle", "setCheckedGift", "savingDetail", "setSavingDetail", "setCheckedExchangePurchase", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "setAddOrder", "title", "bundleList", "showAtListing", "availableBundleList", "v", "handleSelectedChange", "bundleItem", "prev", "t", "tooltip", "getTooltipProps", "bundleVariants", "bundleVariant", "ProductBundle_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as z,jsx as e,jsxs as a}from"react/jsx-runtime";import"react";import{cn as k,formatPrice as y}from"../../../../../../helpers/index.js";import{Text as d,Link as I,Checkbox as N}from"../../../../../../components/index.js";import _ from"../../../../hooks/useCopy.js";import{useBenefits as S}from"../../../../hooks/useBenefits.js";import{useBizProductContext as B}from"../../../../BizProductProvider.js";import{useComponentData as L}from"../../../../hooks/useComponentData.js";import{replaceTemplate as u}from"../../../../utils/textFormat.js";import{useAiuiContext as R}from"../../../../../AiuiProvider/index.js";import $ from"../../../../../../hooks/useCountDown.js";const h=({checked:s,discountText:i,codeText:n,code:l,countdownText:r,copyText:f,copiedText:g,onClick:c,className:m})=>{const{copied:b,copy:C}=_();return e("div",{className:k("flex flex-col gap-3 rounded-box overflow-hidden",m),role:"button",tabIndex:0,onClick:c,children:a("div",{className:"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4",children:[a("div",{className:"flex flex-col gap-1",children:[a("div",{className:"flex items-center gap-1",children:[e(N,{size:"lg",className:"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary",checked:s}),e(d,{className:"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]",children:i})]}),a("div",{className:"flex w-full items-center gap-2",children:[e("div",{className:"flex shrink-0 flex-col items-start",children:e(d,{className:"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px]",children:n})}),e(I,{className:"lg-desktop:text-[16px] text-[14px] font-bold underline",role:"button",tabIndex:0,onClick:o=>{o.preventDefault(),o.stopPropagation(),C(l)},children:b?g:f})]})]}),r&&e(d,{className:"text-brand-0 text-sm lg-desktop:text-base font-bold leading-[1.4] tracking-[-0.28px]",children:r})]})})};h.displayName="CouponCard";const T=({checked:s,discountText:i,description:n,onClick:l,className:r})=>e("div",{className:k("flex flex-col gap-3 rounded-box overflow-hidden",r),role:"button",tabIndex:0,onClick:l,children:e("div",{className:"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4",children:a("div",{className:"flex flex-col gap-1",children:[a("div",{className:"flex items-center gap-1",children:[e(N,{size:"lg",className:"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary",checked:s}),e(d,{className:"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]",children:i})]}),n&&e(d,{className:"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px] pl-8",children:n})]})})});T.displayName="MemberDiscountCard";const D=({className:s})=>{const{profile:i,variant:n,onUseCouponChange:l,onUseMemberDiscountChange:r,openSignInPopup:f,discount:g,savingDetail:c}=B(),{locale:m="us",trackingData:b}=R(),C=S({variant:n}),{commonCoupon:o,memberDiscount:x}=C,{days:P,hours:w,minutes:F,seconds:M}=$({endTime:o?.config?.ends_at}),v=b?.common?.coupon,t=L("ProductCoupon")??{};return!o?.enable&&!x?.enable||!n?.availableForSale?null:a("div",{className:k("ipc-product-detail-product-coupon flex flex-col gap-3 lg-desktop:gap-4",s),children:[t?.title&&e(d,{className:"text-info-primary text-[14px] lg-desktop:text-[16px] font-bold leading-[1.2] tracking-[-0.56px]",children:t.title}),o?.enable&&e(h,{checked:c?.coupon>0,discountText:u(t?.common?.offCoupon,{discount:o?.config?.value_type=="percentage"?Math.abs(Number(o?.config?.value||0))+"%":y({amount:Math.abs(Number(o?.config?.fixed_value||0)),currencyCode:n.price.currencyCode,locale:m})||""}),codeText:u(t?.common?.withCode,{code:o?.config?.title??""}),code:o?.config?.title??"",countdownText:o?.config?.ends_at?u(t?.common?.endsIn,{countdown:`${P}:${w}:${F}:${M}`}):void 0,copyText:v?.copy||t?.copyCode,copiedText:v?.copied||t?.copied,onClick:()=>{const p=c?.coupon?0:g?.codeSavings??0;l?.(p)}}),x?.enable&&e(T,{checked:!!i?.email&&!!c?.member,discountText:u(t?.member?.offMember,{discount:y({amount:x?.config?.amount??0,currencyCode:n.price.currencyCode,locale:m})||""}),description:i?.email?t?.member?.loginDesc:a(z,{children:[e("span",{className:"mr-2",dangerouslySetInnerHTML:{__html:t?.member?.unloginDesc}}),e("span",{role:"button",tabIndex:0,onClick:p=>{p?.stopPropagation(),f?.()},className:"underline text-nowrap",dangerouslySetInnerHTML:{__html:t?.member?.login}})]}),onClick:()=>{if(i?.email){const p=c?.member?0:x?.config?.amount??0;r?.(p)}}})]})};D.displayName="ProductCoupon";var W=D;export{h as CouponCard,T as MemberDiscountCard,W as default};
1
+ "use client";import{Fragment as z,jsx as e,jsxs as a}from"react/jsx-runtime";import"react";import{cn as k,formatPrice as y}from"../../../../../../helpers/index.js";import{Text as d,Link as I,Checkbox as N}from"../../../../../../components/index.js";import _ from"../../../../hooks/useCopy.js";import{useBenefits as S}from"../../../../hooks/useBenefits.js";import{useBizProductContext as B}from"../../../../BizProductProvider.js";import{useComponentData as L}from"../../../../hooks/useComponentData.js";import{replaceTemplate as f}from"../../../../utils/textFormat.js";import{useAiuiContext as R}from"../../../../../AiuiProvider/index.js";import $ from"../../../../../../hooks/useCountDown.js";const h=({checked:s,discountText:r,codeText:n,code:l,countdownText:i,copyText:m,copiedText:g,onClick:c,className:x})=>{const{copied:b,copy:C}=_();return e("div",{className:k("flex flex-col gap-3 rounded-box overflow-hidden",x),role:"button",tabIndex:0,onClick:c,children:a("div",{className:"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4",children:[a("div",{className:"flex flex-col gap-1",children:[a("div",{className:"flex items-center gap-1",children:[e(N,{size:"lg",className:"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary",checked:s}),e(d,{className:"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]",children:r})]}),a("div",{className:"flex w-full items-center gap-2",children:[e("div",{className:"flex shrink-0 flex-col items-start",children:e(d,{className:"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px]",children:n})}),e(I,{className:"lg-desktop:text-[16px] text-[14px] font-bold underline",role:"button",tabIndex:0,onClick:o=>{o.preventDefault(),o.stopPropagation(),C(l)},children:b?g:m})]})]}),i&&e(d,{className:"text-brand-0 text-sm lg-desktop:text-base font-bold leading-[1.4] tracking-[-0.28px]",children:i})]})})};h.displayName="CouponCard";const T=({checked:s,discountText:r,description:n,onClick:l,className:i})=>e("div",{className:k("flex flex-col gap-3 rounded-box overflow-hidden",i),role:"button",tabIndex:0,onClick:l,children:e("div",{className:"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4",children:a("div",{className:"flex flex-col gap-1",children:[a("div",{className:"flex items-center gap-1",children:[e(N,{size:"lg",className:"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary",checked:s}),e(d,{className:"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]",children:r})]}),n&&e(d,{className:"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px] pl-8",children:n})]})})});T.displayName="MemberDiscountCard";const D=({className:s})=>{const{profile:r,variant:n,onUseCouponChange:l,onUseMemberDiscountChange:i,openSignInPopup:m,discount:g,savingDetail:c}=B(),{locale:x="us",trackingData:b}=R(),C=S({variant:n}),{commonCoupon:o,memberDiscount:u}=C,{days:P,hours:w,minutes:F,seconds:M}=$({endTime:o?.config?.ends_at}),v=b?.common?.coupon,t=L("ProductCoupon")??{};return!o?.enable&&!u?.enable||!n?.availableForSale?null:a("div",{className:k("ipc-product-detail-product-coupon flex flex-col gap-3 lg-desktop:gap-4",s),children:[t?.title&&e(d,{className:"text-info-primary text-[14px] lg-desktop:text-[16px] font-bold leading-[1.2] tracking-[-0.56px]",children:t.title}),o?.enable&&e(h,{checked:c?.coupon>0,discountText:f(t?.common?.offCoupon,{discount:o?.config?.value_type=="percentage"?Math.abs(Number(o?.config?.value||0))+"%":y({amount:Math.abs(Number(o?.config?.fixed_value||0)),currencyCode:n.price.currencyCode,locale:x})||""}),codeText:f(t?.common?.withCode,{code:o?.config?.title??""}),code:o?.config?.title??"",countdownText:o?.config?.ends_at?f(t?.common?.endsIn,{countdown:`${P}:${w}:${F}:${M}`}):void 0,copyText:v?.copy||t?.copyCode,copiedText:v?.copied||t?.copied,onClick:()=>{const p=c?.coupon?0:g?.codeSavings??0;l?.(p)}}),u?.enable&&e(T,{checked:!!r?.email&&!!c?.member,discountText:f(t?.member?.offMember,{discount:y({amount:u?.config?.amount??0,currencyCode:n.price.currencyCode,locale:x})||""}),description:r?.email?t?.member?.loginDesc:a(z,{children:[e("span",{className:"mr-2",dangerouslySetInnerHTML:{__html:t?.member?.unloginDesc}}),e("span",{role:"button",tabIndex:0,onClick:p=>{p?.stopPropagation(),m?.()},className:"underline text-nowrap",dangerouslySetInnerHTML:{__html:t?.member?.login}})]}),onClick:()=>{if(!r?.email){m?.();return}const p=c?.member?0:u?.config?.amount??0;i?.(p)}})]})};D.displayName="ProductCoupon";var W=D;export{h as CouponCard,T as MemberDiscountCard,W as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport React from 'react'\nimport { cn, formatPrice } from '../../../../../../helpers/index.js'\nimport { Text, Link, Checkbox } from '../../../../../../components/index.js'\nimport useCopy from '../../../../hooks/useCopy.js'\nimport { useBenefits } from '../../../../hooks/useBenefits.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { useComponentData } from '../../../../hooks/useComponentData.js'\nimport { replaceTemplate } from '../../../../utils/textFormat.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport useCountDown from '../../../../../../hooks/useCountDown.js'\n\nexport interface ProductCouponProps {\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\n// \u4F18\u60E0\u5238\u5361\u7247\u7EC4\u4EF6\nexport interface CouponCardProps {\n /** \u662F\u5426\u9009\u4E2D */\n checked: boolean\n /** \u6298\u6263\u6587\u6848 (\u5982 \"20% OFF\") */\n discountText: string\n /** \u4F18\u60E0\u7801\u6587\u6848 (\u5982 \"With code: ABC123\") */\n codeText: string\n /** \u4F18\u60E0\u7801 */\n code: string\n /** \u5012\u8BA1\u65F6\u6587\u6848 (\u5982 \"Ends in: 1:23:45:00\") */\n countdownText?: string\n /** \u590D\u5236\u6309\u94AE\u6587\u6848 */\n copyText: string\n /** \u5DF2\u590D\u5236\u6587\u6848 */\n copiedText: string\n /** \u70B9\u51FB\u4E8B\u4EF6 */\n onClick?: () => void\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\nexport const CouponCard: React.FC<CouponCardProps> = ({\n checked,\n discountText,\n codeText,\n code,\n countdownText,\n copyText,\n copiedText,\n onClick,\n className,\n}) => {\n const { copied: isCopied, copy: copyToClipboard } = useCopy()\n\n return (\n <div\n className={cn('flex flex-col gap-3 rounded-box overflow-hidden', className)}\n role=\"button\"\n tabIndex={0}\n onClick={onClick}\n >\n <div className=\"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4\">\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-1\">\n <Checkbox\n size=\"lg\"\n className=\"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary\"\n checked={checked}\n />\n <Text className=\"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]\">\n {discountText}\n </Text>\n </div>\n\n <div className=\"flex w-full items-center gap-2\">\n <div className=\"flex shrink-0 flex-col items-start\">\n <Text className=\"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px]\">\n {codeText}\n </Text>\n </div>\n <Link\n className=\"lg-desktop:text-[16px] text-[14px] font-bold underline\"\n role=\"button\"\n tabIndex={0}\n onClick={event => {\n event.preventDefault()\n event.stopPropagation()\n copyToClipboard(code)\n }}\n >\n {isCopied ? copiedText : copyText}\n </Link>\n </div>\n </div>\n\n {countdownText && (\n <Text className=\"text-brand-0 text-sm lg-desktop:text-base font-bold leading-[1.4] tracking-[-0.28px]\">\n {countdownText}\n </Text>\n )}\n </div>\n </div>\n )\n}\n\nCouponCard.displayName = 'CouponCard'\n\n// \u4F1A\u5458\u4EF7\u4F18\u60E0\u5361\u7247\u7EC4\u4EF6\nexport interface MemberDiscountCardProps {\n /** \u662F\u5426\u9009\u4E2D */\n checked: boolean\n /** \u6298\u6263\u6587\u6848 (\u5982 \"$10 OFF Member Price\") */\n discountText: string\n /** \u63CF\u8FF0\u6587\u6848 */\n description?: string\n /** \u70B9\u51FB\u4E8B\u4EF6 */\n onClick?: () => void\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\nexport const MemberDiscountCard: React.FC<MemberDiscountCardProps> = ({\n checked,\n discountText,\n description,\n onClick,\n className,\n}) => {\n return (\n <div\n className={cn('flex flex-col gap-3 rounded-box overflow-hidden', className)}\n role=\"button\"\n tabIndex={0}\n onClick={onClick}\n >\n <div className=\"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4\">\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-1\">\n <Checkbox\n size=\"lg\"\n className=\"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary\"\n checked={checked}\n />\n <Text className=\"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]\">\n {discountText}\n </Text>\n </div>\n\n {description && (\n <Text className=\"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px] pl-8\">\n {description}\n </Text>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nMemberDiscountCard.displayName = 'MemberDiscountCard'\n\nconst ProductCoupon: React.FC<ProductCouponProps> = ({ className }) => {\n const { profile, variant, onUseCouponChange, onUseMemberDiscountChange, openSignInPopup, discount, savingDetail } =\n useBizProductContext()\n const { locale = 'us', trackingData } = useAiuiContext()\n const benefits = useBenefits({ variant })\n const { commonCoupon, memberDiscount } = benefits\n\n const { days, hours, minutes, seconds } = useCountDown({ endTime: commonCoupon?.config?.ends_at })\n\n const couponCopy = trackingData?.common?.coupon\n\n const productCouponData = useComponentData('ProductCoupon') ?? {}\n\n if ((!commonCoupon?.enable && !memberDiscount?.enable) || !variant?.availableForSale) {\n return null\n }\n\n return (\n <div className={cn('ipc-product-detail-product-coupon flex flex-col gap-3 lg-desktop:gap-4', className)}>\n {productCouponData?.title && (\n <Text className=\"text-info-primary text-[14px] lg-desktop:text-[16px] font-bold leading-[1.2] tracking-[-0.56px]\">\n {productCouponData.title}\n </Text>\n )}\n {commonCoupon?.enable && (\n <CouponCard\n checked={savingDetail?.coupon > 0}\n discountText={replaceTemplate(productCouponData?.common?.offCoupon, {\n discount:\n commonCoupon?.config?.value_type == 'percentage'\n ? Math.abs(Number(commonCoupon?.config?.value || 0)) + '%'\n : formatPrice({\n amount: Math.abs(Number(commonCoupon?.config?.fixed_value || 0)),\n currencyCode: variant.price.currencyCode,\n locale,\n }) || '',\n })}\n codeText={replaceTemplate(productCouponData?.common?.withCode, {\n code: commonCoupon?.config?.title ?? '',\n })}\n code={commonCoupon?.config?.title ?? ''}\n countdownText={\n commonCoupon?.config?.ends_at\n ? replaceTemplate(productCouponData?.common?.endsIn, {\n countdown: `${days}:${hours}:${minutes}:${seconds}`,\n })\n : undefined\n }\n copyText={couponCopy?.copy || productCouponData?.copyCode}\n copiedText={couponCopy?.copied || productCouponData?.copied}\n onClick={() => {\n const couponSaving = !savingDetail?.coupon ? (discount?.codeSavings ?? 0) : 0\n onUseCouponChange?.(couponSaving)\n }}\n />\n )}\n\n {memberDiscount?.enable && (\n <MemberDiscountCard\n checked={Boolean(profile?.email) && !!savingDetail?.member}\n discountText={replaceTemplate(productCouponData?.member?.offMember, {\n discount:\n formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }) || '',\n })}\n description={\n Boolean(profile?.email) ? (\n productCouponData?.member?.loginDesc\n ) : (\n <>\n <span className=\"mr-2\" dangerouslySetInnerHTML={{ __html: productCouponData?.member?.unloginDesc }} />\n <span\n role=\"button\"\n tabIndex={0}\n onClick={e => {\n e?.stopPropagation()\n openSignInPopup?.()\n }}\n className=\"underline text-nowrap\"\n dangerouslySetInnerHTML={{ __html: productCouponData?.member?.login }}\n />\n </>\n )\n }\n onClick={() => {\n if (profile?.email) {\n const memberSaving = !savingDetail?.member ? (memberDiscount?.config?.amount ?? 0) : 0\n onUseMemberDiscountChange?.(memberSaving)\n }\n }}\n />\n )}\n </div>\n )\n}\n\nProductCoupon.displayName = 'ProductCoupon'\n\nexport default ProductCoupon\n"],
5
- "mappings": "aA8DU,OA0KI,YAAAA,EAzKF,OAAAC,EADF,QAAAC,MAAA,oBA5DV,MAAkB,QAClB,OAAS,MAAAC,EAAI,eAAAC,MAAmB,qCAChC,OAAS,QAAAC,EAAM,QAAAC,EAAM,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IAAM,CACb,GAAIjB,GAAS,MAAO,CAClB,MAAMoB,EAAgBd,GAAc,OAAiD,EAAvCK,GAAgB,QAAQ,QAAU,EAChFR,IAA4BiB,CAAY,CAC1C,CACF,EACF,GAEJ,CAEJ,EAEArB,EAAc,YAAc,gBAE5B,IAAOsB,EAAQtB",
4
+ "sourcesContent": ["'use client'\n\nimport React from 'react'\nimport { cn, formatPrice } from '../../../../../../helpers/index.js'\nimport { Text, Link, Checkbox } from '../../../../../../components/index.js'\nimport useCopy from '../../../../hooks/useCopy.js'\nimport { useBenefits } from '../../../../hooks/useBenefits.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { useComponentData } from '../../../../hooks/useComponentData.js'\nimport { replaceTemplate } from '../../../../utils/textFormat.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport useCountDown from '../../../../../../hooks/useCountDown.js'\n\nexport interface ProductCouponProps {\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\n// \u4F18\u60E0\u5238\u5361\u7247\u7EC4\u4EF6\nexport interface CouponCardProps {\n /** \u662F\u5426\u9009\u4E2D */\n checked: boolean\n /** \u6298\u6263\u6587\u6848 (\u5982 \"20% OFF\") */\n discountText: string\n /** \u4F18\u60E0\u7801\u6587\u6848 (\u5982 \"With code: ABC123\") */\n codeText: string\n /** \u4F18\u60E0\u7801 */\n code: string\n /** \u5012\u8BA1\u65F6\u6587\u6848 (\u5982 \"Ends in: 1:23:45:00\") */\n countdownText?: string\n /** \u590D\u5236\u6309\u94AE\u6587\u6848 */\n copyText: string\n /** \u5DF2\u590D\u5236\u6587\u6848 */\n copiedText: string\n /** \u70B9\u51FB\u4E8B\u4EF6 */\n onClick?: () => void\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\nexport const CouponCard: React.FC<CouponCardProps> = ({\n checked,\n discountText,\n codeText,\n code,\n countdownText,\n copyText,\n copiedText,\n onClick,\n className,\n}) => {\n const { copied: isCopied, copy: copyToClipboard } = useCopy()\n\n return (\n <div\n className={cn('flex flex-col gap-3 rounded-box overflow-hidden', className)}\n role=\"button\"\n tabIndex={0}\n onClick={onClick}\n >\n <div className=\"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4\">\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-1\">\n <Checkbox\n size=\"lg\"\n className=\"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary\"\n checked={checked}\n />\n <Text className=\"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]\">\n {discountText}\n </Text>\n </div>\n\n <div className=\"flex w-full items-center gap-2\">\n <div className=\"flex shrink-0 flex-col items-start\">\n <Text className=\"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px]\">\n {codeText}\n </Text>\n </div>\n <Link\n className=\"lg-desktop:text-[16px] text-[14px] font-bold underline\"\n role=\"button\"\n tabIndex={0}\n onClick={event => {\n event.preventDefault()\n event.stopPropagation()\n copyToClipboard(code)\n }}\n >\n {isCopied ? copiedText : copyText}\n </Link>\n </div>\n </div>\n\n {countdownText && (\n <Text className=\"text-brand-0 text-sm lg-desktop:text-base font-bold leading-[1.4] tracking-[-0.28px]\">\n {countdownText}\n </Text>\n )}\n </div>\n </div>\n )\n}\n\nCouponCard.displayName = 'CouponCard'\n\n// \u4F1A\u5458\u4EF7\u4F18\u60E0\u5361\u7247\u7EC4\u4EF6\nexport interface MemberDiscountCardProps {\n /** \u662F\u5426\u9009\u4E2D */\n checked: boolean\n /** \u6298\u6263\u6587\u6848 (\u5982 \"$10 OFF Member Price\") */\n discountText: string\n /** \u63CF\u8FF0\u6587\u6848 */\n description?: string\n /** \u70B9\u51FB\u4E8B\u4EF6 */\n onClick?: () => void\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\nexport const MemberDiscountCard: React.FC<MemberDiscountCardProps> = ({\n checked,\n discountText,\n description,\n onClick,\n className,\n}) => {\n return (\n <div\n className={cn('flex flex-col gap-3 rounded-box overflow-hidden', className)}\n role=\"button\"\n tabIndex={0}\n onClick={onClick}\n >\n <div className=\"flex flex-col gap-3 overflow-hidden rounded-box bg-[#EDFBFF] p-3 laptop:p-4\">\n <div className=\"flex flex-col gap-1\">\n <div className=\"flex items-center gap-1\">\n <Checkbox\n size=\"lg\"\n className=\"data-[state=checked]:border-info-primary data-[state=checked]:bg-info-primary mr-2 rounded-full border-[1.6px] border-info-primary\"\n checked={checked}\n />\n <Text className=\"text-info-primary text-base laptop:text-xl lg-desktop:text-2xl font-bold leading-[1.2] tracking-[-0.8px]\">\n {discountText}\n </Text>\n </div>\n\n {description && (\n <Text className=\"text-info-primary lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4] tracking-[-0.28px] pl-8\">\n {description}\n </Text>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nMemberDiscountCard.displayName = 'MemberDiscountCard'\n\nconst ProductCoupon: React.FC<ProductCouponProps> = ({ className }) => {\n const { profile, variant, onUseCouponChange, onUseMemberDiscountChange, openSignInPopup, discount, savingDetail } =\n useBizProductContext()\n const { locale = 'us', trackingData } = useAiuiContext()\n const benefits = useBenefits({ variant })\n const { commonCoupon, memberDiscount } = benefits\n\n const { days, hours, minutes, seconds } = useCountDown({ endTime: commonCoupon?.config?.ends_at })\n\n const couponCopy = trackingData?.common?.coupon\n\n const productCouponData = useComponentData('ProductCoupon') ?? {}\n\n if ((!commonCoupon?.enable && !memberDiscount?.enable) || !variant?.availableForSale) {\n return null\n }\n\n return (\n <div className={cn('ipc-product-detail-product-coupon flex flex-col gap-3 lg-desktop:gap-4', className)}>\n {productCouponData?.title && (\n <Text className=\"text-info-primary text-[14px] lg-desktop:text-[16px] font-bold leading-[1.2] tracking-[-0.56px]\">\n {productCouponData.title}\n </Text>\n )}\n {commonCoupon?.enable && (\n <CouponCard\n checked={savingDetail?.coupon > 0}\n discountText={replaceTemplate(productCouponData?.common?.offCoupon, {\n discount:\n commonCoupon?.config?.value_type == 'percentage'\n ? Math.abs(Number(commonCoupon?.config?.value || 0)) + '%'\n : formatPrice({\n amount: Math.abs(Number(commonCoupon?.config?.fixed_value || 0)),\n currencyCode: variant.price.currencyCode,\n locale,\n }) || '',\n })}\n codeText={replaceTemplate(productCouponData?.common?.withCode, {\n code: commonCoupon?.config?.title ?? '',\n })}\n code={commonCoupon?.config?.title ?? ''}\n countdownText={\n commonCoupon?.config?.ends_at\n ? replaceTemplate(productCouponData?.common?.endsIn, {\n countdown: `${days}:${hours}:${minutes}:${seconds}`,\n })\n : undefined\n }\n copyText={couponCopy?.copy || productCouponData?.copyCode}\n copiedText={couponCopy?.copied || productCouponData?.copied}\n onClick={() => {\n const couponSaving = !savingDetail?.coupon ? (discount?.codeSavings ?? 0) : 0\n onUseCouponChange?.(couponSaving)\n }}\n />\n )}\n\n {memberDiscount?.enable && (\n <MemberDiscountCard\n checked={Boolean(profile?.email) && !!savingDetail?.member}\n discountText={replaceTemplate(productCouponData?.member?.offMember, {\n discount:\n formatPrice({\n amount: memberDiscount?.config?.amount ?? 0,\n currencyCode: variant.price.currencyCode,\n locale,\n }) || '',\n })}\n description={\n Boolean(profile?.email) ? (\n productCouponData?.member?.loginDesc\n ) : (\n <>\n <span className=\"mr-2\" dangerouslySetInnerHTML={{ __html: productCouponData?.member?.unloginDesc }} />\n <span\n role=\"button\"\n tabIndex={0}\n onClick={e => {\n e?.stopPropagation()\n openSignInPopup?.()\n }}\n className=\"underline text-nowrap\"\n dangerouslySetInnerHTML={{ __html: productCouponData?.member?.login }}\n />\n </>\n )\n }\n onClick={() => {\n if (!profile?.email) {\n openSignInPopup?.()\n return\n }\n const memberSaving = !savingDetail?.member ? (memberDiscount?.config?.amount ?? 0) : 0\n onUseMemberDiscountChange?.(memberSaving)\n }}\n />\n )}\n </div>\n )\n}\n\nProductCoupon.displayName = 'ProductCoupon'\n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AG,EACpG/C,EAAC,QACC,KAAK,SACL,SAAU,EACV,QAASiD,GAAK,CACZA,GAAG,gBAAgB,EACnBf,IAAkB,CACpB,EACA,UAAU,wBACV,wBAAyB,CAAE,OAAQa,GAAmB,QAAQ,KAAM,EACtE,GACF,EAGJ,QAAS,IAAM,CACb,GAAI,CAACjB,GAAS,MAAO,CACnBI,IAAkB,EAClB,MACF,CACA,MAAMgB,EAAgBd,GAAc,OAAiD,EAAvCK,GAAgB,QAAQ,QAAU,EAChFR,IAA4BiB,CAAY,CAC1C,EACF,GAEJ,CAEJ,EAEArB,EAAc,YAAc,gBAE5B,IAAOsB,EAAQtB",
6
6
  "names": ["Fragment", "jsx", "jsxs", "cn", "formatPrice", "Text", "Link", "Checkbox", "useCopy", "useBenefits", "useBizProductContext", "useComponentData", "replaceTemplate", "useAiuiContext", "useCountDown", "CouponCard", "checked", "discountText", "codeText", "code", "countdownText", "copyText", "copiedText", "onClick", "className", "isCopied", "copyToClipboard", "event", "MemberDiscountCard", "description", "ProductCoupon", "profile", "variant", "onUseCouponChange", "onUseMemberDiscountChange", "openSignInPopup", "discount", "savingDetail", "locale", "trackingData", "benefits", "commonCoupon", "memberDiscount", "days", "hours", "minutes", "seconds", "couponCopy", "productCouponData", "couponSaving", "e", "memberSaving", "ProductCoupon_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Text as l,Picture as N,Checkbox as E}from"../../../../../../components/index.js";import{cn as x}from"../../../../../../helpers/index.js";import{useMemo as w}from"react";import{useBizProductContext as D}from"../../../../BizProductProvider.js";import{formatPrice as h}from"../../../../utils/index.js";import{useAiuiContext as F}from"../../../../../AiuiProvider/index.js";import{withLayout as B}from"../../../../../../shared/Styles.js";import{useFollowTooltip as T,FollowTooltip as z}from"../../../../hooks/useFollowTooltip.js";const L=()=>{const{locale:c="us"}=F(),{tooltip:f,getTooltipProps:b}=T(),{checkedExchangePurchase:r,exchangePurchase:g,setCheckedBundle:O,setJoinedRecommendBuyProducts:d,setSavingDetail:P,setCheckedExchangePurchase:i,joinedRecommendBuyProducts:s,savingDetail:k,setAddOrder:n}=D(),{title:C,giftList:p=[],freeLabel:S}=g||{},m=w(()=>p?.filter(e=>e.availableForSale),[p]),v=e=>{r?.id===e.id?(i?.(void 0),d?.({...s,exchange:{value:void 0,canOperate:!0}}),P?.({...k,exchangePurchase:0}),n?.(a=>a.filter(u=>u!=="exchange"))):(i?.(e),d?.({...s,exchange:{value:e,canOperate:!1}}),n?.(a=>[...a.filter(y=>y!=="exchange"),"exchange"]))};return m?.length?o("div",{className:"ipc-product-detail-exchange-purchase",children:[t(l,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:C}),t("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:m.map(e=>o("div",{className:x("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":r?.id===e.id}),children:[t(E,{onCheckedChange:()=>v(e),size:"lg",className:x("rounded-full border-2 border-[#E4E5E6]",{"border-brand":r?.id===e.id}),id:e.id,checked:r?.id===e.id,value:e.id}),o("label",{htmlFor:e.id,className:"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6",children:[o("div",{className:"flex items-center gap-2",children:[t(N,{source:e.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),t(l,{...b(e.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:e.product.title}),t(z,{...f})]}),o("div",{className:"tablet:flex-row flex shrink-0 flex-col items-center gap-1",children:[t(l,{className:"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold",html:h({amount:e?.finalPrice?.amount||0,locale:c,currencyCode:e?.finalPrice?.currencyCode||"USD"})}),t(l,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through",html:h({amount:e.price.amount,locale:c,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var q=B(L);export{q as default};
1
+ import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Text as a,Picture as N,Checkbox as E}from"../../../../../../components/index.js";import{cn as x}from"../../../../../../helpers/index.js";import{useMemo as w}from"react";import{useBizProductContext as D}from"../../../../BizProductProvider.js";import{formatPrice as h}from"../../../../utils/index.js";import{useAiuiContext as F}from"../../../../../AiuiProvider/index.js";import{withLayout as B}from"../../../../../../shared/Styles.js";import{useFollowTooltip as T,FollowTooltip as z}from"../../../../hooks/useFollowTooltip.js";const L=()=>{const{locale:c="us"}=F(),{tooltip:f,getTooltipProps:b}=T(),{checkedExchangePurchase:r,exchangePurchase:g,setCheckedBundle:O,setJoinedRecommendBuyProducts:d,setSavingDetail:P,setCheckedExchangePurchase:i,joinedRecommendBuyProducts:s,savingDetail:k,setAddOrder:n}=D(),{title:C,giftList:p=[],freeLabel:S}=g||{},m=w(()=>p?.filter(e=>e.availableForSale),[p]),v=e=>{r?.id===e.id?(i?.(void 0),d?.({...s,exchange:{value:void 0,canOperate:!0}}),P?.({...k,exchangePurchase:0}),n?.(l=>l.filter(u=>u!=="exchange"))):(i?.(e),d?.({...s,exchange:{value:e,canOperate:!1}}),n?.(l=>[...l.filter(y=>y!=="exchange"),"exchange"]))};return m?.length?o("div",{className:"ipc-product-detail-exchange-purchase",children:[t(a,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:C}),t("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:m.map(e=>o("div",{className:x("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":r?.id===e.id}),children:[t(E,{onCheckedChange:()=>v(e),size:"lg",className:x("rounded-full border-2 border-[#E4E5E6]",{"border-brand-0 data-[state=checked]:bg-brand-0":r?.id===e.id}),id:e.id,checked:r?.id===e.id,value:e.id}),o("label",{htmlFor:e.id,className:"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6",children:[o("div",{className:"flex items-center gap-2",children:[t(N,{source:e.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),t(a,{...b(e.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:e.product.title}),t(z,{...f})]}),o("div",{className:"tablet:flex-row flex shrink-0 flex-col items-center gap-1",children:[t(a,{className:"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold",html:h({amount:e?.finalPrice?.amount||0,locale:c,currencyCode:e?.finalPrice?.currencyCode||"USD"})}),t(a,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through",html:h({amount:e.price.amount,locale:c,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var q=B(L);export{q as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.tsx"],
4
- "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant, ProductPrice } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductExchangePurchase = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n checkedExchangePurchase,\n exchangePurchase,\n setCheckedBundle,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n setCheckedExchangePurchase,\n joinedRecommendBuyProducts,\n savingDetail,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = exchangePurchase || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedExchangePurchase?.id === value.id) {\n setCheckedExchangePurchase?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n } else {\n setCheckedExchangePurchase?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'exchange')\n return [...filtered, 'exchange']\n })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-exchange-purchase\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map((gift: ProductVariant & { finalPrice?: ProductPrice }) => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedExchangePurchase?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand': checkedExchangePurchase?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedExchangePurchase?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold\"\n html={formatPrice({\n amount: gift?.finalPrice?.amount || 0,\n locale,\n currencyCode: gift?.finalPrice?.currencyCode || 'USD',\n })}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductExchangePurchase)\n"],
5
- "mappings": "AA8DM,cAAAA,EA0BQ,QAAAC,MA1BR,oBA9DN,OAAS,QAAAC,EAAM,WAAAC,EAAS,YAAAC,MAAgB,wCACxC,OAAS,MAAAC,MAAU,qCACnB,OAAS,WAAAC,MAAe,QACxB,OAAS,wBAAAC,MAA4B,oCACrC,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,kBAAAC,MAAsB,uCAE/B,OAAS,cAAAC,MAAkB,qCAC3B,OAAS,oBAAAC,EAAkB,iBAAAC,MAAqB,wCAEhD,MAAMC,EAA0B,IAAM,CACpC,KAAM,CAAE,OAAAC,EAAS,IAAK,EAAI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K,EACvD,CAAC,EACD,GAAIA,EAAK,GACT,QAASlB,GAAyB,KAAOkB,EAAK,GAC9C,MAAOA,EAAK,GACb,EACDlC,EAAC,SACC,QAASkC,EAAK,GACd,UAAU,qFAEV,UAAAlC,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACG,EAAA,CAAQ,OAAQgC,EAAK,OAAO,IAAK,UAAU,mBAAmB,aAAa,SAAS,EACrFnC,EAACE,EAAA,CACE,GAAGc,EAAgBmB,EAAK,QAAQ,KAAK,EACtC,UAAU,2EACV,KAAMA,EAAK,QAAQ,MACrB,EACAnC,EAACY,EAAA,CAAe,GAAGG,EAAS,GAC9B,EACAd,EAAC,OAAI,UAAU,4DACb,UAAAD,EAACE,EAAA,CACC,UAAU,4EACV,KAAMM,EAAY,CAChB,OAAQ2B,GAAM,YAAY,QAAU,EACpC,OAAArB,EACA,aAAcqB,GAAM,YAAY,cAAgB,KAClD,CAAC,EACH,EACAnC,EAACE,EAAA,CACC,UAAU,yGACV,KAAMM,EAAY,CAChB,OAAQ2B,EAAK,MAAM,OACnB,OAAArB,EACA,aAAcqB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IAjDKA,EAAK,EAkDZ,CACD,EACH,GACF,EA7DkC,IA+DtC,EAEA,IAAOC,EAAQ1B,EAAWG,CAAuB",
4
+ "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant, ProductPrice } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductExchangePurchase = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n checkedExchangePurchase,\n exchangePurchase,\n setCheckedBundle,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n setCheckedExchangePurchase,\n joinedRecommendBuyProducts,\n savingDetail,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = exchangePurchase || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedExchangePurchase?.id === value.id) {\n setCheckedExchangePurchase?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n } else {\n setCheckedExchangePurchase?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'exchange')\n return [...filtered, 'exchange']\n })\n }\n }\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-exchange-purchase\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map((gift: ProductVariant & { finalPrice?: ProductPrice }) => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedExchangePurchase?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand-0 data-[state=checked]:bg-brand-0': checkedExchangePurchase?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedExchangePurchase?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl !leading-[1.2] text-base font-bold\"\n html={formatPrice({\n amount: gift?.finalPrice?.amount || 0,\n locale,\n currencyCode: gift?.finalPrice?.currencyCode || 'USD',\n })}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base !leading-[1.2] font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductExchangePurchase)\n"],
5
+ "mappings": "AA8DM,cAAAA,EA0BQ,QAAAC,MA1BR,oBA9DN,OAAS,QAAAC,EAAM,WAAAC,EAAS,YAAAC,MAAgB,wCACxC,OAAS,MAAAC,MAAU,qCACnB,OAAS,WAAAC,MAAe,QACxB,OAAS,wBAAAC,MAA4B,oCACrC,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,kBAAAC,MAAsB,uCAE/B,OAAS,cAAAC,MAAkB,qCAC3B,OAAS,oBAAAC,E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2B,EAAoBI,CAAI,EAC/C,KAAK,KACL,UAAW9B,EAAG,yCAA0C,CACtD,iDAAkDY,GAAyB,KAAOkB,EAAK,EACzF,CAAC,EACD,GAAIA,EAAK,GACT,QAASlB,GAAyB,KAAOkB,EAAK,GAC9C,MAAOA,EAAK,GACb,EACDlC,EAAC,SACC,QAASkC,EAAK,GACd,UAAU,qFAEV,UAAAlC,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACG,EAAA,CAAQ,OAAQgC,EAAK,OAAO,IAAK,UAAU,mBAAmB,aAAa,SAAS,EACrFnC,EAACE,EAAA,CACE,GAAGc,EAAgBmB,EAAK,QAAQ,KAAK,EACtC,UAAU,2EACV,KAAMA,EAAK,QAAQ,MACrB,EACAnC,EAACY,EAAA,CAAe,GAAGG,EAAS,GAC9B,EACAd,EAAC,OAAI,UAAU,4DACb,UAAAD,EAACE,EAAA,CACC,UAAU,4EACV,KAAMM,EAAY,CAChB,OAAQ2B,GAAM,YAAY,QAAU,EACpC,OAAArB,EACA,aAAcqB,GAAM,YAAY,cAAgB,KAClD,CAAC,EACH,EACAnC,EAACE,EAAA,CACC,UAAU,yGACV,KAAMM,EAAY,CAChB,OAAQ2B,EAAK,MAAM,OACnB,OAAArB,EACA,aAAcqB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IAjDKA,EAAK,EAkDZ,CACD,EACH,GACF,EA7DkC,IA+DtC,EAEA,IAAOC,EAAQ1B,EAAWG,CAAuB",
6
6
  "names": ["jsx", "jsxs", "Text", "Picture", "Checkbox", "cn", "useMemo", "useBizProductContext", "formatPrice", "useAiuiContext", "withLayout", "useFollowTooltip", "FollowTooltip", "ProductExchangePurchase", "locale", "tooltip", "getTooltipProps", "checkedExchangePurchase", "exchangePurchase", "setCheckedBundle", "setJoinedRecommendBuyProducts", "setSavingDetail", "setCheckedExchangePurchase", "joinedRecommendBuyProducts", "savingDetail", "setAddOrder", "title", "giftList", "freeLabel", "availableGifts", "item", "handleCheckboxClick", "value", "prev", "t", "gift", "ProductExchangePurchase_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Text as r,Picture as P,Checkbox as E}from"../../../../../../components/index.js";import{cn as f}from"../../../../../../helpers/index.js";import{useMemo as w}from"react";import{useBizProductContext as F}from"../../../../BizProductProvider.js";import{formatPrice as G}from"../../../../utils/index.js";import{useAiuiContext as B}from"../../../../../AiuiProvider/index.js";import{withLayout as D}from"../../../../../../shared/Styles.js";import{useFollowTooltip as T,FollowTooltip as z}from"../../../../hooks/useFollowTooltip.js";const L=()=>{const{locale:u="us"}=B(),{tooltip:x,getTooltipProps:b}=T(),{freeGift:h,checkedGift:l,setCheckedGift:d,setCheckedBundle:O,setSavingDetail:g,savingDetail:k,setJoinedRecommendBuyProducts:a,joinedRecommendBuyProducts:s,setAddOrder:c}=F(),{title:v,giftList:p=[],freeLabel:C}=h||{},n=w(()=>p?.filter(e=>e.availableForSale),[p]),N=e=>{l?.id===e.id?(d?.(void 0),g?.({...k,freeGift:0}),a?.({...s,gift:{value:void 0,canOperate:!0}}),c?.(i=>i.filter(m=>m!=="gift"))):(d?.(e),a?.({...s,gift:{value:e,canOperate:!1}}),c?.(i=>[...i.filter(y=>y!=="gift"),"gift"]))};return n?.length?o("div",{className:"ipc-product-detail-free-gift",children:[t(r,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:v}),t("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:n.map(e=>o("div",{className:f("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":l?.id===e.id}),children:[t(E,{onCheckedChange:()=>N(e),size:"lg",className:f("rounded-full border-2 border-[#E4E5E6]",{"border-brand":l?.id===e.id}),id:e.id,checked:l?.id===e.id,value:e.id}),o("label",{htmlFor:e.id,className:"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6",children:[o("div",{className:"flex items-center gap-2",children:[t(P,{source:e.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),t(r,{...b(e.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:e.product.title}),t(z,{...x})]}),o("div",{className:"tablet:flex-row flex shrink-0 flex-col items-center gap-1",children:[t(r,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]",html:C}),t(r,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]",html:G({amount:e.price.amount,locale:u,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var I=D(L);export{I as default};
1
+ import{jsx as t,jsxs as o}from"react/jsx-runtime";import{Text as r,Picture as P,Checkbox as E}from"../../../../../../components/index.js";import{cn as f}from"../../../../../../helpers/index.js";import{useMemo as w}from"react";import{useBizProductContext as F}from"../../../../BizProductProvider.js";import{formatPrice as G}from"../../../../utils/index.js";import{useAiuiContext as B}from"../../../../../AiuiProvider/index.js";import{withLayout as D}from"../../../../../../shared/Styles.js";import{useFollowTooltip as T,FollowTooltip as z}from"../../../../hooks/useFollowTooltip.js";const L=()=>{const{locale:u="us"}=B(),{tooltip:x,getTooltipProps:b}=T(),{freeGift:h,checkedGift:l,setCheckedGift:i,setCheckedBundle:O,setSavingDetail:g,savingDetail:k,setJoinedRecommendBuyProducts:a,joinedRecommendBuyProducts:s,setAddOrder:c}=F(),{title:v,giftList:p=[],freeLabel:C}=h||{},n=w(()=>p?.filter(e=>e.availableForSale),[p]),N=e=>{l?.id===e.id?(i?.(void 0),g?.({...k,freeGift:0}),a?.({...s,gift:{value:void 0,canOperate:!0}}),c?.(d=>d.filter(m=>m!=="gift"))):(i?.(e),a?.({...s,gift:{value:e,canOperate:!1}}),c?.(d=>[...d.filter(y=>y!=="gift"),"gift"]))};return n?.length?o("div",{className:"ipc-product-detail-free-gift",children:[t(r,{className:"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]",html:v}),t("div",{className:"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3",children:n.map(e=>o("div",{className:f("rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold",{"border-brand":l?.id===e.id}),children:[t(E,{onCheckedChange:()=>N(e),size:"lg",className:f("rounded-full border-2 border-[#E4E5E6]",{"border-brand-0 data-[state=checked]:bg-brand-0":l?.id===e.id}),id:e.id,checked:l?.id===e.id,value:e.id}),o("label",{htmlFor:e.id,className:"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6",children:[o("div",{className:"flex items-center gap-2",children:[t(P,{source:e.image?.url,className:"size-12 shrink-0",imgClassName:"h-full"}),t(r,{...b(e.product.title),className:"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold",html:e.product.title}),t(z,{...x})]}),o("div",{className:"tablet:flex-row flex shrink-0 flex-col items-center gap-1",children:[t(r,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]",html:C}),t(r,{className:"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]",html:G({amount:e.price.amount,locale:u,currencyCode:e.price.currencyCode})})]})]})]},e.id))})]}):null};var I=D(L);export{I as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.tsx"],
4
- "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useEffect, useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductFreeGift = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n freeGift,\n checkedGift,\n setCheckedGift,\n setCheckedBundle,\n setSavingDetail,\n savingDetail,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = freeGift || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedGift?.id === value.id) {\n setCheckedGift?.(undefined)\n setSavingDetail?.({ ...savingDetail, freeGift: 0 })\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'gift'))\n } else {\n setCheckedGift?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'gift')\n return [...filtered, 'gift']\n })\n }\n }\n\n // useEffect(() => {\n // // \u5982\u679C\u7B2C\u4E00\u4E2A\u793C\u7269\u53EF\u7528\uFF0C\u5219\u9009\u4E2D\u5B83\n // availableGifts?.[0] && handleCheckboxClick(availableGifts?.[0])\n // }, [availableGifts])\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-free-gift\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map(gift => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedGift?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand': checkedGift?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedGift?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]\"\n html={freeLabel}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductFreeGift)\n"],
5
- "mappings": "AAmEM,cAAAA,EA0BQ,QAAAC,MA1BR,oBAnEN,OAAS,QAAAC,EAAM,WAAAC,EAAS,YAAAC,MAAgB,wCACxC,OAAS,MAAAC,MAAU,qCACnB,OA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Z,SAAA6B,EAAe,IAAIM,GAClBlC,EAAC,OAEC,UAAWI,EACT,mHACA,CACG,eAAiBa,GAAa,KAAOiB,EAAK,EAC7C,CACF,EAEA,UAAAnC,EAACI,EAAA,CACC,gBAAiB,IAAM2B,EAAoBI,CAAI,EAC/C,KAAK,KACL,UAAW9B,EAAG,yCAA0C,CACtD,eAAgBa,GAAa,KAAOiB,EAAK,EAC3C,CAAC,EACD,GAAIA,EAAK,GACT,QAASjB,GAAa,KAAOiB,EAAK,GAClC,MAAOA,EAAK,GACb,EACDlC,EAAC,SACC,QAASkC,EAAK,GACd,UAAU,qFAEV,UAAAlC,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACG,EAAA,CAAQ,OAAQgC,EAAK,OAAO,IAAK,UAAU,mBAAmB,aAAa,SAAS,EACrFnC,EAACE,EAAA,CACE,GAAGc,EAAgBmB,EAAK,QAAQ,KAAK,EACtC,UAAU,2EACV,KAAMA,EAAK,QAAQ,MACrB,EACAnC,EAACY,EAAA,CAAe,GAAGG,EAAS,GAC9B,EACAd,EAAC,OAAI,UAAU,4DACb,UAAAD,EAACE,EAAA,CACC,UAAU,4EACV,KAAM0B,EACR,EACA5B,EAACE,EAAA,CACC,UAAU,wGACV,KAAMM,EAAY,CAChB,OAAQ2B,EAAK,MAAM,OACnB,OAAArB,EACA,aAAcqB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IA7CKA,EAAK,EA8CZ,CACD,EACH,GACF,EAzDkC,IA2DtC,EAEA,IAAOC,EAAQ1B,EAAWG,CAAe",
4
+ "sourcesContent": ["import { Text, Picture, Checkbox } from '../../../../../../components/index.js'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useEffect, useMemo } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport type { ProductVariant } from '../../../../types/product'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { useFollowTooltip, FollowTooltip } from '../../../../hooks/useFollowTooltip.js'\n\nconst ProductFreeGift = () => {\n const { locale = 'us' } = useAiuiContext()\n const { tooltip, getTooltipProps } = useFollowTooltip()\n const {\n freeGift,\n checkedGift,\n setCheckedGift,\n setCheckedBundle,\n setSavingDetail,\n savingDetail,\n setJoinedRecommendBuyProducts,\n joinedRecommendBuyProducts,\n setAddOrder,\n } = useBizProductContext()\n const { title, giftList = [], freeLabel } = freeGift || {}\n const availableGifts = useMemo(() => giftList?.filter(item => item.availableForSale), [giftList])\n\n const handleCheckboxClick = (value: ProductVariant) => {\n if (checkedGift?.id === value.id) {\n setCheckedGift?.(undefined)\n setSavingDetail?.({ ...savingDetail, freeGift: 0 })\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'gift'))\n } else {\n setCheckedGift?.(value)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value,\n canOperate: false,\n },\n })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => {\n // \u5982\u679C\u5DF2\u7ECF\u5B58\u5728\uFF0C\u5148\u79FB\u9664\u518D\u6DFB\u52A0\u5230\u672B\u5C3E\n const filtered = prev.filter(t => t !== 'gift')\n return [...filtered, 'gift']\n })\n }\n }\n\n // useEffect(() => {\n // // \u5982\u679C\u7B2C\u4E00\u4E2A\u793C\u7269\u53EF\u7528\uFF0C\u5219\u9009\u4E2D\u5B83\n // availableGifts?.[0] && handleCheckboxClick(availableGifts?.[0])\n // }, [availableGifts])\n\n if (!availableGifts?.length) return null\n\n return (\n <div className=\"ipc-product-detail-free-gift\">\n <Text className=\"font-bold leading-[1.2] text-[14px] lg-desktop:text-[16px]\" html={title} />\n <div className=\"laptop:grid-cols-2 laptop-md:grid-cols-1 lg-desktop:mt-4 mt-3 grid grid-cols-1 gap-3\">\n {availableGifts.map(gift => (\n <div\n key={gift.id}\n className={cn(\n 'rounded-box h-[80px] laptop:h-[100px] flex items-center gap-2 border-2 border-[#E4E5E6] px-4 text-left font-bold',\n {\n ['border-brand']: checkedGift?.id === gift.id,\n }\n )}\n >\n <Checkbox\n onCheckedChange={() => handleCheckboxClick(gift)}\n size=\"lg\"\n className={cn('rounded-full border-2 border-[#E4E5E6]', {\n 'border-brand-0 data-[state=checked]:bg-brand-0': checkedGift?.id === gift.id,\n })}\n id={gift.id}\n checked={checkedGift?.id === gift.id}\n value={gift.id}\n ></Checkbox>\n <label\n htmlFor={gift.id}\n className=\"flex w-full cursor-pointer items-center justify-between gap-4 py-4 lg-desktop:py-6\"\n >\n <div className=\"flex items-center gap-2\">\n <Picture source={gift.image?.url} className=\"size-12 shrink-0\" imgClassName=\"h-full\" />\n <Text\n {...getTooltipProps(gift.product.title)}\n className=\"laptop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-sm font-bold\"\n html={gift.product.title}\n />\n <FollowTooltip {...tooltip} />\n </div>\n <div className=\"tablet:flex-row flex shrink-0 flex-col items-center gap-1\">\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold !leading-[1.2]\"\n html={freeLabel}\n />\n <Text\n className=\"laptop:text-[20px] lg-desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through !leading-[1.2]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n </label>\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductFreeGift)\n"],
5
+ "mappings": "AAmEM,cAAAA,EA0BQ,QAAAC,MA1BR,oBAnEN,OAAS,QAAAC,EAAM,WAAAC,EAAS,YAAAC,MAAgB,wCACxC,OAAS,MAAAC,MAAU,qCACnB,OAAoB,WAAAC,MAAe,QACnC,OAAS,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lC,EAAC,OAEC,UAAWI,EACT,mHACA,CACG,eAAiBa,GAAa,KAAOiB,EAAK,EAC7C,CACF,EAEA,UAAAnC,EAACI,EAAA,CACC,gBAAiB,IAAM2B,EAAoBI,CAAI,EAC/C,KAAK,KACL,UAAW9B,EAAG,yCAA0C,CACtD,iDAAkDa,GAAa,KAAOiB,EAAK,EAC7E,CAAC,EACD,GAAIA,EAAK,GACT,QAASjB,GAAa,KAAOiB,EAAK,GAClC,MAAOA,EAAK,GACb,EACDlC,EAAC,SACC,QAASkC,EAAK,GACd,UAAU,qFAEV,UAAAlC,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACG,EAAA,CAAQ,OAAQgC,EAAK,OAAO,IAAK,UAAU,mBAAmB,aAAa,SAAS,EACrFnC,EAACE,EAAA,CACE,GAAGc,EAAgBmB,EAAK,QAAQ,KAAK,EACtC,UAAU,2EACV,KAAMA,EAAK,QAAQ,MACrB,EACAnC,EAACY,EAAA,CAAe,GAAGG,EAAS,GAC9B,EACAd,EAAC,OAAI,UAAU,4DACb,UAAAD,EAACE,EAAA,CACC,UAAU,4EACV,KAAM0B,EACR,EACA5B,EAACE,EAAA,CACC,UAAU,wGACV,KAAMM,EAAY,CAChB,OAAQ2B,EAAK,MAAM,OACnB,OAAArB,EACA,aAAcqB,EAAK,MAAM,YAC3B,CAAC,EACH,GACF,GACF,IA7CKA,EAAK,EA8CZ,CACD,EACH,GACF,EAzDkC,IA2DtC,EAEA,IAAOC,EAAQ1B,EAAWG,CAAe",
6
6
  "names": ["jsx", "jsxs", "Text", "Picture", "Checkbox", "cn", "useMemo", "useBizProductContext", "formatPrice", "useAiuiContext", "withLayout", "useFollowTooltip", "FollowTooltip", "ProductFreeGift", "locale", "tooltip", "getTooltipProps", "freeGift", "checkedGift", "setCheckedGift", "setCheckedBundle", "setSavingDetail", "savingDetail", "setJoinedRecommendBuyProducts", "joinedRecommendBuyProducts", "setAddOrder", "title", "giftList", "freeLabel", "availableGifts", "item", "handleCheckboxClick", "value", "prev", "t", "gift", "ProductFreeGift_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Heading as m,Container as i}from"../../../../components/index.js";import{ProductActions as n}from"../index.js";import{useBizProductContext as c}from"../../BizProductProvider.js";import{useComponentData as u}from"../../hooks/useComponentData.js";import l from"./ScrollSpyNav/index.js";import{withLayout as f}from"../../../../shared/Styles.js";const b=({onSpyNavItemClick:e,totalSavingsSlot:p,actionsSlot:s})=>{const{product:d,renderRating:r}=c(),o=u("PurchaseBar")??[];return a("div",{id:"purchase-bar",className:"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white",children:[t(i,{children:a("div",{className:"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]",children:[a("div",{className:"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3",children:[t(m,{size:2,className:"line-clamp-2 text-wrap",html:d?.title}),t("div",{className:"laptop-md:block mt-3 hidden",children:t(l,{tabs:o,className:"",renderRating:r,onSpyNavItemClick:e})})]}),t("div",{className:"laptop-md:block hidden shrink-0",children:s??t(n,{totalSavingsSlot:p})})]})}),a(i,{className:"laptop-md:hidden relative",children:[t("div",{className:"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]"}),t(l,{tabs:o,renderRating:r,onSpyNavItemClick:e})]})]})};var y=f(b);export{y as default};
1
+ import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Heading as m,Container as i}from"../../../../components/index.js";import{ProductActions as n}from"../index.js";import{useBizProductContext as c}from"../../BizProductProvider.js";import{useComponentData as u}from"../../hooks/useComponentData.js";import l from"./ScrollSpyNav/index.js";import{withLayout as f}from"../../../../shared/Styles.js";const b=({onSpyNavItemClick:e,totalSavingsSlot:s,actionsSlot:p})=>{const{product:d,renderRating:r}=c(),o=u("PurchaseBar")??[];return a("div",{id:"purchase-bar",className:"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white",children:[t(i,{children:a("div",{className:"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]",children:[a("div",{className:"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3",children:[t(m,{as:"h1",size:2,className:"line-clamp-2 text-wrap",html:d?.title}),t("div",{className:"laptop-md:block mt-3 hidden",children:t(l,{tabs:o,className:"",renderRating:r,onSpyNavItemClick:e})})]}),t("div",{className:"laptop-md:block hidden shrink-0",children:p??t(n,{totalSavingsSlot:s})})]})}),a(i,{className:"laptop-md:hidden relative",children:[t("div",{className:"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]"}),t(l,{tabs:o,renderRating:r,onSpyNavItemClick:e})]})]})};var y=f(b);export{y as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/biz-components/Listing/components/PurchaseBar/index.tsx"],
4
- "sourcesContent": ["import { Heading, Container } from '../../../../components/index.js'\nimport type { PurchaseBarProps } from './types.js'\nimport { ProductActions } from '../index.js'\nimport { useBizProductContext } from '../../BizProductProvider.js'\nimport { useComponentData } from '../../hooks/useComponentData.js'\nimport ScrollSpyNav from './ScrollSpyNav/index.js'\nimport { withLayout } from '../../../../shared/Styles.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick, totalSavingsSlot, actionsSlot }: PurchaseBarProps) => {\n const { product, renderRating } = useBizProductContext()\n\n const PurchaseBarData = useComponentData('PurchaseBar') ?? []\n\n return (\n <div id=\"purchase-bar\" className=\"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white\">\n <Container>\n <div className=\"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]\">\n <div className=\"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3\">\n <Heading size={2} className=\"line-clamp-2 text-wrap\" html={product?.title} />\n <div className=\"laptop-md:block mt-3 hidden\">\n <ScrollSpyNav\n tabs={PurchaseBarData}\n className=\"\"\n renderRating={renderRating}\n onSpyNavItemClick={onSpyNavItemClick}\n />\n </div>\n </div>\n <div className=\"laptop-md:block hidden shrink-0\">\n {actionsSlot ?? <ProductActions totalSavingsSlot={totalSavingsSlot} />}\n </div>\n </div>\n </Container>\n <Container className=\"laptop-md:hidden relative\">\n <div className=\"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]\"></div>\n <ScrollSpyNav tabs={PurchaseBarData} renderRating={renderRating} onSpyNavItemClick={onSpyNavItemClick} />\n </Container>\n </div>\n )\n}\n\nexport default withLayout(PurchaseBar)\n"],
5
- "mappings": "AAiBU,OACE,OAAAA,EADF,QAAAC,MAAA,oBAjBV,OAAS,WAAAC,EAAS,aAAAC,MAAiB,kCAEnC,OAAS,kBAAAC,MAAsB,cAC/B,OAAS,wBAAAC,MAA4B,8BACrC,OAAS,oBAAAC,MAAwB,kCACjC,OAAOC,MAAkB,0BACzB,OAAS,cAAAC,MAAkB,+BAE3B,MAAMC,EAAc,CAAC,CAAE,kBAAAC,EAAmB,iBAAAC,EAAkB,YAAAC,CAAY,IAAwB,CAC9F,KAAM,CAAE,QAAAC,EAAS,aAAAC,CAAa,EAAIT,EAAqB,EAEjDU,EAAkBT,EAAiB,aAAa,GAAK,CAAC,EAE5D,OACEL,EAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,UAAAD,EAACG,EAAA,CACC,SAAAF,EAAC,OAAI,UAAU,4GACb,UAAAA,EAAC,OAAI,UAAU,oDACb,UAAAD,EAACE,EAAA,CAAQ,KAAM,EAAG,UAAU,yBAAyB,KAAMW,GAAS,MAAO,EAC3Eb,EAAC,OAAI,UAAU,8BACb,SAAAA,EAACO,EAAA,CACC,KAAMQ,EACN,UAAU,GACV,aAAcD,EACd,kBAAmBJ,EACrB,EACF,GACF,EACAV,EAAC,OAAI,UAAU,kCACZ,SAAAY,GAAeZ,EAACI,EAAA,CAAe,iBAAkBO,EAAkB,EACtE,GACF,EACF,EACAV,EAACE,EAAA,CAAU,UAAU,4BACnB,UAAAH,EAAC,OAAI,UAAU,iDAAiD,EAChEA,EAACO,EAAA,CAAa,KAAMQ,EAAiB,aAAcD,EAAc,kBAAmBJ,EAAmB,GACzG,GACF,CAEJ,EAEA,IAAOM,EAAQR,EAAWC,CAAW",
4
+ "sourcesContent": ["import { Heading, Container } from '../../../../components/index.js'\nimport type { PurchaseBarProps } from './types.js'\nimport { ProductActions } from '../index.js'\nimport { useBizProductContext } from '../../BizProductProvider.js'\nimport { useComponentData } from '../../hooks/useComponentData.js'\nimport ScrollSpyNav from './ScrollSpyNav/index.js'\nimport { withLayout } from '../../../../shared/Styles.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick, totalSavingsSlot, actionsSlot }: PurchaseBarProps) => {\n const { product, renderRating } = useBizProductContext()\n\n const PurchaseBarData = useComponentData('PurchaseBar') ?? []\n\n return (\n <div id=\"purchase-bar\" className=\"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white\">\n <Container>\n <div className=\"tablet:justify-between laptop-md:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]\">\n <div className=\"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3\">\n <Heading as=\"h1\" size={2} className=\"line-clamp-2 text-wrap\" html={product?.title} />\n <div className=\"laptop-md:block mt-3 hidden\">\n <ScrollSpyNav\n tabs={PurchaseBarData}\n className=\"\"\n renderRating={renderRating}\n onSpyNavItemClick={onSpyNavItemClick}\n />\n </div>\n </div>\n <div className=\"laptop-md:block hidden shrink-0\">\n {actionsSlot ?? <ProductActions totalSavingsSlot={totalSavingsSlot} />}\n </div>\n </div>\n </Container>\n <Container className=\"laptop-md:hidden relative\">\n <div className=\"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]\"></div>\n <ScrollSpyNav tabs={PurchaseBarData} renderRating={renderRating} onSpyNavItemClick={onSpyNavItemClick} />\n </Container>\n </div>\n )\n}\n\nexport default withLayout(PurchaseBar)\n"],
5
+ "mappings": "AAiBU,OACE,OAAAA,EADF,QAAAC,MAAA,oBAjBV,OAAS,WAAAC,EAAS,aAAAC,MAAiB,kCAEnC,OAAS,kBAAAC,MAAsB,cAC/B,OAAS,wBAAAC,MAA4B,8BACrC,OAAS,oBAAAC,MAAwB,kCACjC,OAAOC,MAAkB,0BACzB,OAAS,cAAAC,MAAkB,+BAE3B,MAAMC,EAAc,CAAC,CAAE,kBAAAC,EAAmB,iBAAAC,EAAkB,YAAAC,CAAY,IAAwB,CAC9F,KAAM,CAAE,QAAAC,EAAS,aAAAC,CAAa,EAAIT,EAAqB,EAEjDU,EAAkBT,EAAiB,aAAa,GAAK,CAAC,EAE5D,OACEL,EAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,UAAAD,EAACG,EAAA,CACC,SAAAF,EAAC,OAAI,UAAU,4GACb,UAAAA,EAAC,OAAI,UAAU,oDACb,UAAAD,EAACE,EAAA,CAAQ,GAAG,KAAK,KAAM,EAAG,UAAU,yBAAyB,KAAMW,GAAS,MAAO,EACnFb,EAAC,OAAI,UAAU,8BACb,SAAAA,EAACO,EAAA,CACC,KAAMQ,EACN,UAAU,GACV,aAAcD,EACd,kBAAmBJ,EACrB,EACF,GACF,EACAV,EAAC,OAAI,UAAU,kCACZ,SAAAY,GAAeZ,EAACI,EAAA,CAAe,iBAAkBO,EAAkB,EACtE,GACF,EACF,EACAV,EAACE,EAAA,CAAU,UAAU,4BACnB,UAAAH,EAAC,OAAI,UAAU,iDAAiD,EAChEA,EAACO,EAAA,CAAa,KAAMQ,EAAiB,aAAcD,EAAc,kBAAmBJ,EAAmB,GACzG,GACF,CAEJ,EAEA,IAAOM,EAAQR,EAAWC,CAAW",
6
6
  "names": ["jsx", "jsxs", "Heading", "Container", "ProductActions", "useBizProductContext", "useComponentData", "ScrollSpyNav", "withLayout", "PurchaseBar", "onSpyNavItemClick", "totalSavingsSlot", "actionsSlot", "product", "renderRating", "PurchaseBarData", "PurchaseBar_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as o,jsxs as u}from"react/jsx-runtime";import{Dialog as a,DialogContent as n}from"../../components/dialog.js";import{YouTubePlayer as s}from"../VideoModal/YouTubePlayer.js";const d=i=>{const{visible:r,youTubeId:e,videoUrl:t,onCloseModal:l,className:p,...c}=i;return o(a,{open:r,onOpenChange:()=>l(),children:u(n,{className:"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden",children:[e?o(s,{youTubeId:e}):t?o("video",{className:"size-full overflow-hidden rounded-2xl object-cover",src:t,muted:!0,loop:!0,autoPlay:!0,controls:!0}):null,o("div",{onClick:()=>l(),className:"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white",children:o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",className:"HomeCharger_closeWrap__Z7aBo",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]})})};export{d as VideoModal};
1
+ import{jsx as o,jsxs as u}from"react/jsx-runtime";import{Dialog as a,DialogContent as r}from"../../components/dialog.js";import{YouTubePlayer as s}from"../VideoModal/YouTubePlayer.js";const d=l=>{const{visible:n,youTubeId:e,videoUrl:t,onCloseModal:i,className:p,...c}=l;return o(a,{open:n,onOpenChange:()=>i(),children:u(r,{className:"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden",children:[e?o(s,{youTubeId:e}):t?o("video",{className:"size-full overflow-hidden rounded-2xl object-contain",src:t,muted:!0,loop:!0,autoPlay:!0,controls:!0}):null,o("div",{onClick:()=>i(),className:"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white",children:o("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon",className:"HomeCharger_closeWrap__Z7aBo",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]})})};export{d as VideoModal};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/VideoModal/index.tsx"],
4
- "sourcesContent": ["import { Dialog, DialogContent } from '../../components/dialog.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\n\nexport interface VideoModalType extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n visible: boolean\n youTubeId?: string\n videoUrl?: string\n onCloseModal: () => void\n}\n\nconst VideoModal = (props: VideoModalType) => {\n const { visible, youTubeId, videoUrl, onCloseModal, className, ...rest } = props\n\n return (\n <Dialog open={visible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden\">\n {youTubeId ? (\n <YouTubePlayer youTubeId={youTubeId} />\n ) : videoUrl ? (\n <video\n className=\"size-full overflow-hidden rounded-2xl object-cover\"\n src={videoUrl}\n muted\n loop\n autoPlay\n controls\n />\n ) : null}\n <div\n onClick={() => onCloseModal()}\n className=\"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n className=\"HomeCharger_closeWrap__Z7aBo\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\"></path>\n </svg>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { VideoModal }\n"],
5
- "mappings": "AAeM,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAfN,OAAS,UAAAC,EAAQ,iBAAAC,MAAqB,6BACtC,OAAS,iBAAAC,MAAqB,iCAS9B,MAAMC,EAAcC,GAA0B,CAC5C,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,SAAAC,EAAU,aAAAC,EAAc,UAAAC,EAAW,GAAGC,CAAK,EAAIN,EAE3E,OACEN,EAACE,EAAA,CAAO,KAAMK,EAAS,aAAc,IAAMG,EAAa,EACtD,SAAAT,EAACE,EAAA,CAAc,UAAU,wFACtB,UAAAK,EACCR,EAACI,EAAA,CAAc,UAAWI,EAAW,EACnCC,EACFT,EAAC,SACC,UAAU,qDACV,IAAKS,EACL,MAAK,GACL,KAAI,GACJ,SAAQ,GACR,SAAQ,GACV,EACE,KACJT,EAAC,OACC,QAAS,IAAMU,EAAa,EAC5B,UAAU,wHAEV,SAAAV,EAAC,OACC,MAAM,6BACN,KAAK,OACL,QAAQ,YACR,YAAY,MACZ,OAAO,eACP,cAAY,OACZ,YAAU,OACV,UAAU,+BAEV,SAAAA,EAAC,QAAK,cAAc,QAAQ,eAAe,QAAQ,EAAE,uBAAuB,EAC9E,EACF,GACF,EACF,CAEJ",
4
+ "sourcesContent": ["import { Dialog, DialogContent } from '../../components/dialog.js'\nimport { YouTubePlayer } from '../VideoModal/YouTubePlayer.js'\n\nexport interface VideoModalType extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n visible: boolean\n youTubeId?: string\n videoUrl?: string\n onCloseModal: () => void\n}\n\nconst VideoModal = (props: VideoModalType) => {\n const { visible, youTubeId, videoUrl, onCloseModal, className, ...rest } = props\n\n return (\n <Dialog open={visible} onOpenChange={() => onCloseModal()}>\n <DialogContent className=\"max-h-3/4 h-3/4 w-4/5 max-w-[1200px] border-none bg-transparent p-0 [&_button]:hidden\">\n {youTubeId ? (\n <YouTubePlayer youTubeId={youTubeId} />\n ) : videoUrl ? (\n <video\n className=\"size-full overflow-hidden rounded-2xl object-contain\"\n src={videoUrl}\n muted\n loop\n autoPlay\n controls\n />\n ) : null}\n <div\n onClick={() => onCloseModal()}\n className=\"tablet:size-8 tablet:-right-8 tablet:-top-8 absolute -right-6 -top-6 size-6 cursor-pointer overflow-hidden text-white\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth=\"1.5\"\n stroke=\"currentColor\"\n aria-hidden=\"true\"\n data-slot=\"icon\"\n className=\"HomeCharger_closeWrap__Z7aBo\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\"></path>\n </svg>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport { VideoModal }\n"],
5
+ "mappings": "AAeM,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAfN,OAAS,UAAAC,EAAQ,iBAAAC,MAAqB,6BACtC,OAAS,iBAAAC,MAAqB,iCAS9B,MAAMC,EAAcC,GAA0B,CAC5C,KAAM,CAAE,QAAAC,EAAS,UAAAC,EAAW,SAAAC,EAAU,aAAAC,EAAc,UAAAC,EAAW,GAAGC,CAAK,EAAIN,EAE3E,OACEN,EAACE,EAAA,CAAO,KAAMK,EAAS,aAAc,IAAMG,EAAa,EACtD,SAAAT,EAACE,EAAA,CAAc,UAAU,wFACtB,UAAAK,EACCR,EAACI,EAAA,CAAc,UAAWI,EAAW,EACnCC,EACFT,EAAC,SACC,UAAU,uDACV,IAAKS,EACL,MAAK,GACL,KAAI,GACJ,SAAQ,GACR,SAAQ,GACV,EACE,KACJT,EAAC,OACC,QAAS,IAAMU,EAAa,EAC5B,UAAU,wHAEV,SAAAV,EAAC,OACC,MAAM,6BACN,KAAK,OACL,QAAQ,YACR,YAAY,MACZ,OAAO,eACP,cAAY,OACZ,YAAU,OACV,UAAU,+BAEV,SAAAA,EAAC,QAAK,cAAc,QAAQ,eAAe,QAAQ,EAAE,uBAAuB,EAC9E,EACF,GACF,EACF,CAEJ",
6
6
  "names": ["jsx", "jsxs", "Dialog", "DialogContent", "YouTubePlayer", "VideoModal", "props", "visible", "youTubeId", "videoUrl", "onCloseModal", "className", "rest"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "1.3.9",
3
+ "version": "1.3.10",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",