@anker-in/headless-ui 1.1.10 → 1.1.11

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 (116) hide show
  1. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +11 -2
  2. package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
  3. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
  4. package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js +1 -1
  5. package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js.map +3 -3
  6. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
  7. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +3 -3
  8. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +1 -1
  9. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +3 -3
  10. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +1 -1
  11. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +2 -2
  12. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +6 -6
  13. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  14. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +2 -1
  15. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
  16. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +3 -3
  17. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  18. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  19. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  20. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
  21. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  22. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
  23. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -2
  24. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +2 -2
  25. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
  26. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
  27. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +1 -1
  28. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +2 -2
  29. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  30. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +3 -3
  31. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +1 -1
  32. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +2 -2
  33. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  34. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  35. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
  36. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +2 -2
  37. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  38. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  39. package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +1 -1
  40. package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +2 -2
  41. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  42. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +2 -2
  43. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
  44. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +3 -3
  45. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.d.ts +2 -0
  46. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.js +2 -0
  47. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.js.map +7 -0
  48. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  49. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +2 -2
  50. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +1 -1
  51. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +3 -3
  52. package/dist/cjs/biz-components/Listing/index.d.ts +0 -3
  53. package/dist/cjs/biz-components/Listing/index.js +1 -1
  54. package/dist/cjs/biz-components/Listing/index.js.map +4 -4
  55. package/dist/cjs/biz-components/index.d.ts +0 -1
  56. package/dist/cjs/biz-components/index.js +1 -1
  57. package/dist/cjs/biz-components/index.js.map +3 -3
  58. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +11 -2
  59. package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
  60. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
  61. package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js +1 -1
  62. package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js.map +3 -3
  63. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
  64. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +3 -3
  65. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +1 -1
  66. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +3 -3
  67. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +1 -1
  68. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +2 -2
  69. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +6 -6
  70. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  71. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +2 -1
  72. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
  73. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +3 -3
  74. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  75. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  76. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  77. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
  78. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  79. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
  80. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +3 -3
  81. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +2 -2
  82. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
  83. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
  84. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +1 -1
  85. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +2 -2
  86. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  87. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +3 -3
  88. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +1 -1
  89. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +2 -2
  90. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  91. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  92. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
  93. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +2 -2
  94. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  95. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  96. package/dist/esm/biz-components/Listing/components/ProductCard/index.js +1 -1
  97. package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +2 -2
  98. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  99. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +2 -2
  100. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
  101. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +3 -3
  102. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.d.ts +2 -0
  103. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.js +2 -0
  104. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.js.map +7 -0
  105. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  106. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +2 -2
  107. package/dist/esm/biz-components/Listing/hooks/useBenefits.js +1 -1
  108. package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +3 -3
  109. package/dist/esm/biz-components/Listing/index.d.ts +0 -3
  110. package/dist/esm/biz-components/Listing/index.js +1 -1
  111. package/dist/esm/biz-components/Listing/index.js.map +3 -3
  112. package/dist/esm/biz-components/index.d.ts +0 -1
  113. package/dist/esm/biz-components/index.js +1 -1
  114. package/dist/esm/biz-components/index.js.map +2 -2
  115. package/package.json +2 -2
  116. package/tailwind.config.js +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";var c=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var w=Object.prototype.hasOwnProperty;var h=(t,e)=>{for(var o in e)c(t,o,{get:e[o],enumerable:!0})},S=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of k(e))!w.call(t,r)&&r!==o&&c(t,r,{get:()=>e[r],enumerable:!(i=N(e,r))||i.enumerable});return t};var P=t=>S(c({},"__esModule",{value:!0}),t);var A={};h(A,{default:()=>T});module.exports=P(A);var a=require("react/jsx-runtime"),l=require("../../../../../components/index.js"),m=require("../../../../AiuiProvider/index.js"),x=require("../../../BizProductProvider.js"),p=require("react"),n=require("../../../utils/index.js"),b=require("../../../utils/textFormat.js");const B=()=>{const{copyWriting:t,locale:e="us"}=(0,m.useAiuiContext)(),{variant:o,finalPrice:i,totalSavings:r,isLogin:d,comparePrice:u,onAddToCart:g,onBuyNow:f,savingDetail:s,addToCartLoading:y,buyNowLoading:C}=(0,x.useBizProductContext)(),v=(0,p.useMemo)(()=>(0,b.replaceTemplate)(t?.totalSavings||"",{amount:(0,n.formatPrice)({amount:r,currencyCode:o.price.currencyCode,locale:e})}),[t?.totalSavings,r,o.price.currencyCode,e]);return(0,a.jsxs)(l.Container,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 desktop:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"desktop:border-none desktop:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[o.availableForSale?(0,a.jsxs)("div",{className:"desktop:items-end flex flex-col justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(l.Text,{className:"tablet:text-2xl desktop:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:(0,n.formatPrice)({amount:Math.floor(i*100)/100,currencyCode:o.price.currencyCode,locale:e})}),(r>0||s?.member>0&&d)&&(0,a.jsx)(l.Text,{className:"tablet:text-2xl desktop:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#999] line-through",html:(0,n.formatPrice)({amount:u,currencyCode:o.price.currencyCode,locale:e})}),s?.member>0&&d&&(0,a.jsx)(l.Text,{className:"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:t?.memberPrice||"Member Price"})]}),(r>0||s?.member>0&&d)&&(0,a.jsx)(l.Text,{className:"text-brand-0 tablet:text-end desktop:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${v}`})]}):(0,a.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:t?.soldOut??"Sold Out"}),(0,a.jsxs)("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:[(0,a.jsx)(l.Button,{variant:"secondary",disabled:!o.availableForSale,size:"lg",className:"tablet:w-auto w-1/2",onClick:()=>g?.(),loading:y,children:t?.addToCart??"Add to Cart"}),(0,a.jsx)(l.Button,{variant:"primary",disabled:!o.availableForSale,size:"lg",loading:C,className:"tablet:w-auto w-1/2",onClick:()=>f?.(),children:t?.buyNow??"Buy Now"})]})]})};var T=B;
1
+ "use strict";var s=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var S=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},P=(t,e,o,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of w(e))!h.call(t,r)&&r!==o&&s(t,r,{get:()=>e[r],enumerable:!(i=N(e,r))||i.enumerable});return t};var B=t=>P(s({},"__esModule",{value:!0}),t);var A={};S(A,{default:()=>k});module.exports=B(A);var a=require("react/jsx-runtime"),l=require("../../../../../components/index.js"),c=require("../../../../AiuiProvider/index.js"),p=require("../../../BizProductProvider.js"),x=require("react"),n=require("../../../utils/index.js"),b=require("../../../utils/textFormat.js");const T=()=>{const{copyWriting:t,locale:e="us"}=(0,c.useAiuiContext)(),{variant:o,finalPrice:i,totalSavings:r,isLogin:d,comparePrice:u,onAddToCart:g,onBuyNow:f,savingDetail:m,addToCartLoading:y,buyNowLoading:C}=(0,p.useBizProductContext)(),v=(0,x.useMemo)(()=>(0,b.replaceTemplate)(t?.totalSavings||"",{amount:(0,n.formatPrice)({amount:r,currencyCode:o.price.currencyCode,locale:e})}),[t?.totalSavings,r,o.price.currencyCode,e]);return(0,a.jsxs)(l.Container,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[o.availableForSale?(0,a.jsxs)("div",{className:"laptop-md:items-end flex flex-col justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(l.Text,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:(0,n.formatPrice)({amount:Math.floor(i*100)/100,currencyCode:o.price.currencyCode,locale:e})}),(r>0||m?.member>0&&d)&&(0,a.jsx)(l.Text,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#999] line-through",html:(0,n.formatPrice)({amount:u,currencyCode:o.price.currencyCode,locale:e})}),m?.member>0&&d&&(0,a.jsx)(l.Text,{className:"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:t?.memberPrice||"Member Price"})]}),(r>0||m?.member>0&&d)&&(0,a.jsx)(l.Text,{className:"text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${v}`})]}):(0,a.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:t?.soldOut??"Sold Out"}),(0,a.jsxs)("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:[(0,a.jsx)(l.Button,{variant:"secondary",disabled:!o.availableForSale,size:"lg",className:"tablet:w-auto w-1/2",onClick:()=>g?.(),loading:y,children:t?.addToCart??"Add to Cart"}),(0,a.jsx)(l.Button,{variant:"primary",disabled:!o.availableForSale,size:"lg",loading:C,className:"tablet:w-auto w-1/2",onClick:()=>f?.(),children:t?.buyNow??"Buy Now"})]})]})};var k=T;
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/ProductActions/index.tsx"],
4
- "sourcesContent": ["import { Text, Button, Container } from '../../../../../components/index.js'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useMemo } from 'react'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\n\nconst ProductActions = () => {\n const { copyWriting, locale = 'us' } = useAiuiContext()\n const {\n variant,\n finalPrice,\n totalSavings,\n isLogin,\n comparePrice,\n onAddToCart,\n onBuyNow,\n savingDetail,\n addToCartLoading,\n buyNowLoading,\n } = useBizProductContext()\n\n const totalSavingsText = useMemo(() => {\n return replaceTemplate(copyWriting?.totalSavings || '', {\n amount: formatPrice({ amount: totalSavings, currencyCode: variant.price.currencyCode, locale }),\n })\n }, [copyWriting?.totalSavings, totalSavings, variant.price.currencyCode, locale])\n\n // const memberPriceSaveText = useMemo(() => {\n // return replaceTemplate(copyWriting?.memberSaving || '', {\n // amount: formatPrice({\n // amount: savingDetail?.member,\n // currencyCode: variant.price.currencyCode,\n // locale,\n // }),\n // })\n // }, [copyWriting?.memberSaving, savingDetail?.member, variant.price.currencyCode, locale])\n\n return (\n <Container\n childClassName=\"tablet:flex tablet:justify-end tablet:gap-8 desktop:px-0 desktop:px-0 tablet:items-center tablet:gap-4\"\n className=\"desktop:border-none desktop:py-0 border-t border-[#E4E5E6] bg-white py-3\"\n >\n {variant.availableForSale ? (\n <div className=\"desktop:items-end flex flex-col justify-between\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"tablet:text-2xl desktop:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]\"\n html={formatPrice({\n amount: Math.floor(finalPrice * 100) / 100,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {(totalSavings > 0 || (savingDetail?.member > 0 && isLogin)) && (\n <Text\n className=\"tablet:text-2xl desktop:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#999] line-through\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n {savingDetail?.member > 0 && isLogin && (\n <Text\n className=\"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white\"\n html={copyWriting?.memberPrice || 'Member Price'}\n />\n )}\n </div>\n {(totalSavings > 0 || (savingDetail?.member > 0 && isLogin)) && (\n <Text\n className=\"text-brand-0 tablet:text-end desktop:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]\"\n html={`${totalSavingsText}`}\n />\n )}\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"tablet:mt-0 mt-2 flex items-center gap-2\">\n <Button\n variant=\"secondary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"tablet:w-auto w-1/2\"\n onClick={() => onAddToCart?.()}\n loading={addToCartLoading}\n >\n {copyWriting?.addToCart ?? 'Add to Cart'}\n </Button>\n <Button\n variant=\"primary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n loading={buyNowLoading}\n className=\"tablet:w-auto w-1/2\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.buyNow ?? 'Buy Now'}\n </Button>\n </div>\n </Container>\n )\n}\n\nexport default ProductActions\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6CU,IAAAI,EAAA,6BA7CVC,EAAwC,8CACxCC,EAA+B,6CAC/BC,EAAqC,0CACrCC,EAAwB,iBACxBC,EAA4B,mCAC5BC,EAAgC,wCAEhC,MAAMC,EAAiB,IAAM,CAC3B,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAS,IAAK,KAAI,kBAAe,EAChD,CACJ,QAAAC,EACA,WAAAC,EACA,aAAAC,EACA,QAAAC,EACA,aAAAC,EACA,YAAAC,EACA,SAAAC,EACA,aAAAC,EACA,iBAAAC,EACA,cAAAC,CACF,KAAI,wBAAqB,EAEnBC,KAAmB,WAAQ,OACxB,mBAAgBZ,GAAa,cAAgB,GAAI,CACtD,UAAQ,eAAY,CAAE,OAAQI,EAAc,aAAcF,EAAQ,MAAM,aAAc,OAAAD,CAAO,CAAC,CAChG,CAAC,EACA,CAACD,GAAa,aAAcI,EAAcF,EAAQ,MAAM,aAAcD,CAAM,CAAC,EAYhF,SACE,QAAC,aACC,eAAe,yGACf,UAAU,2EAET,UAAAC,EAAQ,oBACP,QAAC,OAAI,UAAU,kDACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,QACC,UAAU,uFACV,QAAM,eAAY,CAChB,OAAQ,KAAK,MAAMC,EAAa,GAAG,EAAI,IACvC,aAAcD,EAAQ,MAAM,aAC5B,OAAAD,CACF,CAAC,EACH,GACEG,EAAe,GAAMK,GAAc,OAAS,GAAKJ,OACjD,OAAC,QACC,UAAU,gHACV,QAAM,eAAY,CAChB,OAAQC,EACR,aAAcJ,EAAQ,MAAM,aAC5B,OAAAD,CACF,CAAC,EACH,EAEDQ,GAAc,OAAS,GAAKJ,MAC3B,OAAC,QACC,UAAU,gEACV,KAAML,GAAa,aAAe,eACpC,GAEJ,GACEI,EAAe,GAAMK,GAAc,OAAS,GAAKJ,OACjD,OAAC,QACC,UAAU,0HACV,KAAM,GAAGO,CAAgB,GAC3B,GAEJ,KAEA,OAAC,QAAK,UAAU,uCAAuC,KAAMZ,GAAa,SAAW,WAAY,KAEnG,QAAC,OAAI,UAAU,2CACb,oBAAC,UACC,QAAQ,YACR,SAAU,CAACE,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMK,IAAc,EAC7B,QAASG,EAER,SAAAV,GAAa,WAAa,cAC7B,KACA,OAAC,UACC,QAAQ,UACR,SAAU,CAACE,EAAQ,iBACnB,KAAK,KACL,QAASS,EACT,UAAU,sBACV,QAAS,IAAMH,IAAW,EAEzB,SAAAR,GAAa,QAAU,UAC1B,GACF,GACF,CAEJ,EAEA,IAAOV,EAAQS",
4
+ "sourcesContent": ["import { Text, Button, Container } from '../../../../../components/index.js'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useMemo } from 'react'\nimport { formatPrice } from '../../../utils/index.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\n\nconst ProductActions = () => {\n const { copyWriting, locale = 'us' } = useAiuiContext()\n const {\n variant,\n finalPrice,\n totalSavings,\n isLogin,\n comparePrice,\n onAddToCart,\n onBuyNow,\n savingDetail,\n addToCartLoading,\n buyNowLoading,\n } = useBizProductContext()\n\n const totalSavingsText = useMemo(() => {\n return replaceTemplate(copyWriting?.totalSavings || '', {\n amount: formatPrice({ amount: totalSavings, currencyCode: variant.price.currencyCode, locale }),\n })\n }, [copyWriting?.totalSavings, totalSavings, variant.price.currencyCode, locale])\n\n // const memberPriceSaveText = useMemo(() => {\n // return replaceTemplate(copyWriting?.memberSaving || '', {\n // amount: formatPrice({\n // amount: savingDetail?.member,\n // currencyCode: variant.price.currencyCode,\n // locale,\n // }),\n // })\n // }, [copyWriting?.memberSaving, savingDetail?.member, variant.price.currencyCode, locale])\n\n return (\n <Container\n childClassName=\"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 tablet:items-center tablet:gap-4\"\n className=\"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3\"\n >\n {variant.availableForSale ? (\n <div className=\"laptop-md:items-end flex flex-col justify-between\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]\"\n html={formatPrice({\n amount: Math.floor(finalPrice * 100) / 100,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {(totalSavings > 0 || (savingDetail?.member > 0 && isLogin)) && (\n <Text\n className=\"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#999] line-through\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n {savingDetail?.member > 0 && isLogin && (\n <Text\n className=\"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white\"\n html={copyWriting?.memberPrice || 'Member Price'}\n />\n )}\n </div>\n {(totalSavings > 0 || (savingDetail?.member > 0 && isLogin)) && (\n <Text\n className=\"text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]\"\n html={`${totalSavingsText}`}\n />\n )}\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"tablet:mt-0 mt-2 flex items-center gap-2\">\n <Button\n variant=\"secondary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"tablet:w-auto w-1/2\"\n onClick={() => onAddToCart?.()}\n loading={addToCartLoading}\n >\n {copyWriting?.addToCart ?? 'Add to Cart'}\n </Button>\n <Button\n variant=\"primary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n loading={buyNowLoading}\n className=\"tablet:w-auto w-1/2\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.buyNow ?? 'Buy Now'}\n </Button>\n </div>\n </Container>\n )\n}\n\nexport default ProductActions\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6CU,IAAAI,EAAA,6BA7CVC,EAAwC,8CACxCC,EAA+B,6CAC/BC,EAAqC,0CACrCC,EAAwB,iBACxBC,EAA4B,mCAC5BC,EAAgC,wCAEhC,MAAMC,EAAiB,IAAM,CAC3B,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAS,IAAK,KAAI,kBAAe,EAChD,CACJ,QAAAC,EACA,WAAAC,EACA,aAAAC,EACA,QAAAC,EACA,aAAAC,EACA,YAAAC,EACA,SAAAC,EACA,aAAAC,EACA,iBAAAC,EACA,cAAAC,CACF,KAAI,wBAAqB,EAEnBC,KAAmB,WAAQ,OACxB,mBAAgBZ,GAAa,cAAgB,GAAI,CACtD,UAAQ,eAAY,CAAE,OAAQI,EAAc,aAAcF,EAAQ,MAAM,aAAc,OAAAD,CAAO,CAAC,CAChG,CAAC,EACA,CAACD,GAAa,aAAcI,EAAcF,EAAQ,MAAM,aAAcD,CAAM,CAAC,EAYhF,SACE,QAAC,aACC,eAAe,8FACf,UAAU,+EAET,UAAAC,EAAQ,oBACP,QAAC,OAAI,UAAU,oDACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,QACC,UAAU,yFACV,QAAM,eAAY,CAChB,OAAQ,KAAK,MAAMC,EAAa,GAAG,EAAI,IACvC,aAAcD,EAAQ,MAAM,aAC5B,OAAAD,CACF,CAAC,EACH,GACEG,EAAe,GAAMK,GAAc,OAAS,GAAKJ,OACjD,OAAC,QACC,UAAU,kHACV,QAAM,eAAY,CAChB,OAAQC,EACR,aAAcJ,EAAQ,MAAM,aAC5B,OAAAD,CACF,CAAC,EACH,EAEDQ,GAAc,OAAS,GAAKJ,MAC3B,OAAC,QACC,UAAU,gEACV,KAAML,GAAa,aAAe,eACpC,GAEJ,GACEI,EAAe,GAAMK,GAAc,OAAS,GAAKJ,OACjD,OAAC,QACC,UAAU,4HACV,KAAM,GAAGO,CAAgB,GAC3B,GAEJ,KAEA,OAAC,QAAK,UAAU,uCAAuC,KAAMZ,GAAa,SAAW,WAAY,KAEnG,QAAC,OAAI,UAAU,2CACb,oBAAC,UACC,QAAQ,YACR,SAAU,CAACE,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMK,IAAc,EAC7B,QAASG,EAER,SAAAV,GAAa,WAAa,cAC7B,KACA,OAAC,UACC,QAAQ,UACR,SAAU,CAACE,EAAQ,iBACnB,KAAK,KACL,QAASS,EACT,UAAU,sBACV,QAAS,IAAMH,IAAW,EAEzB,SAAAR,GAAa,QAAU,UAC1B,GACF,GACF,CAEJ,EAEA,IAAOV,EAAQS",
6
6
  "names": ["ProductActions_exports", "__export", "ProductActions_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_AiuiProvider", "import_BizProductProvider", "import_react", "import_utils", "import_textFormat", "ProductActions", "copyWriting", "locale", "variant", "finalPrice", "totalSavings", "isLogin", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "addToCartLoading", "buyNowLoading", "totalSavingsText"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var I=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var B=(e,r)=>{for(var i in r)I(e,i,{get:r[i],enumerable:!0})},M=(e,r,i,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of x(r))!C.call(e,n)&&n!==i&&I(e,n,{get:()=>r[n],enumerable:!(u=N(r,n))||u.enumerable});return e};var k=e=>M(I({},"__esModule",{value:!0}),e);var P={};B(P,{default:()=>L});module.exports=k(P);var S=require("react/jsx-runtime"),A=require("../../../../AiuiProvider/index.js"),w=require("../../../../../helpers/index.js"),o=require("react"),D=require("gsap"),$=require("../../../BizProductProvider.js");const H=(e,r)=>{const[i,u]=(0,o.useState)(null),n=(0,o.useRef)(null),f=(0,o.useRef)(new Map),d=(0,o.useRef)(!1),g=(0,o.useRef)(null);(0,o.useEffect)(()=>{g.current=i},[i]),(0,o.useEffect)(()=>{if(!e||e.length===0)return;n.current&&n.current.disconnect();const p=document.getElementById("purchase-bar"),t=p?p.clientHeight:100;f.current.clear();const c=[];if(e.forEach(l=>{const a=l.id||l.href?.replace("#",""),y=document.getElementById(a);y&&(f.current.set(a,l),c.push(y))}),c.length===0){u(e[0]);return}const m={root:null,rootMargin:`-${t}px 0px -50% 0px`,threshold:[0,.25,.5,.75,1]},h=l=>{if(d.current)return;if((window.scrollY||document.documentElement.scrollTop)<t+50){const s=e[0];s&&g.current?.id!==s.id&&(console.log("\u9875\u9762\u9876\u90E8\uFF0C\u6FC0\u6D3B\u7B2C\u4E00\u4E2A tab:",s.label),u(s),r?.(s));return}const y=l.filter(s=>s.isIntersecting).sort((s,b)=>s.boundingClientRect.top-b.boundingClientRect.top);if(y.length>0){const b=y[0].target.id,v=f.current.get(b);v&&(u(v),r?.(v))}else{const s=[...l].sort((b,v)=>Math.abs(b.boundingClientRect.top)-Math.abs(v.boundingClientRect.top));if(s.length>0){const v=s[0].target.id,R=f.current.get(v);R&&(u(R),r?.(R))}}};n.current=new IntersectionObserver(h,m),c.forEach(l=>{n.current?.observe(l)});const T=()=>{if(d.current)return;if((window.scrollY||document.documentElement.scrollTop)<t+50){const a=e[0];a&&(u(a),r?.(a))}};return window.addEventListener("scroll",T,{passive:!0}),()=>{n.current&&n.current.disconnect(),window.removeEventListener("scroll",T)}},[e]),(0,o.useEffect)(()=>{!i&&e&&e.length>0&&u(e[0])},[e,i]);const E=(0,o.useCallback)(p=>{u(p);const t=p.id||p.href?.replace("#",""),c=document.getElementById(t);if(c){const m=document.getElementById("purchase-bar"),h=m?m.clientHeight:100;d.current=!0;const l=c.getBoundingClientRect().top+window.scrollY-h-10;window.scrollTo({top:l,behavior:"smooth"}),setTimeout(()=>{d.current=!1},1e3)}},[]);return{activeTab:i||e?.[0],setActiveTab:E}},O=({tabs:e,onSpyNavItemClick:r,className:i,renderRating:u})=>{const{activeTab:n,setActiveTab:f}=H(e),d=(0,o.useRef)(null),g=(0,o.useRef)(new Map),E=(0,o.useCallback)(t=>{f(t),r?.(t)},[r,f]);(0,o.useEffect)(()=>{if(!n||!d.current)return;const t=g.current.get(n.id);if(!t)return;const c=d.current,m=t.getBoundingClientRect(),h=c.getBoundingClientRect(),T=m.left+m.width/2-h.left,l=h.width/2,a=T-l;c.scrollTo({left:c.scrollLeft+a,behavior:"smooth"})},[n?.id]);const p=(0,o.useCallback)((t,c)=>{c?g.current.set(t,c):g.current.delete(t)},[]);return(0,S.jsx)("div",{ref:d,style:{scrollbarWidth:"none",msOverflowStyle:"none"},className:(0,w.cn)("overflow-x-auto",i),children:(0,S.jsxs)("div",{className:"tablet:gap-8 flex gap-6",children:[e?.map(t=>(0,S.jsxs)("button",{ref:c=>p(t.id,c),className:(0,w.cn)("desktop:text-[#1d1d1f] relative shrink-0 whitespace-nowrap py-[10px] text-sm font-bold text-[#949494]",{"text-[#1d1d1f]":n?.id===t.id}),onClick:()=>E(t),children:[t.label,(0,S.jsx)("div",{className:(0,w.cn)("desktop:block bg-brand-0 absolute bottom-0 left-0 hidden h-[2px] w-0 transition-all duration-300 ease-in-out",{"w-full":n?.id===t.id})})]},t.id)),u]})})};var L=O;
1
+ "use strict";var v=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var H=(n,o)=>{for(var s in o)v(n,s,{get:o[s],enumerable:!0})},L=(n,o,s,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of k(o))!E.call(n,i)&&i!==s&&v(n,i,{get:()=>o[i],enumerable:!(c=T(o,i))||c.enumerable});return n};var M=n=>L(v({},"__esModule",{value:!0}),n);var I={};H(I,{default:()=>P});module.exports=M(I);var r=require("react/jsx-runtime"),d=require("../../../../../helpers/index.js"),t=require("react"),w=require("./useScrollSpy.js"),g=require("es-toolkit");const z=({tabs:n,onSpyNavItemClick:o,className:s,renderRating:c})=>{const[i,S]=(0,t.useState)(0),p=(0,t.useMemo)(()=>c?[...n,{label:"Reviews",id:"ipc-review",href:""}]:n,[n,c]),y=(0,t.useMemo)(()=>p.map(e=>e.id),[p]),u=(0,g.debounce)(()=>{const e=document.querySelector("#purchase-bar");e&&S(e.getBoundingClientRect().height)},500);(0,t.useEffect)(()=>(u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}),[u]);const a=(0,w.useScrollSpy)(y,i),f=(0,t.useRef)(null),m=(0,t.useRef)(new Map),x=(0,t.useCallback)(e=>{o?.(e)},[o]);(0,t.useEffect)(()=>{if(!a||!f.current)return;const e=m.current.get(a);if(!e)return;const l=f.current,h=e.getBoundingClientRect(),b=l.getBoundingClientRect(),R=h.left+h.width/2-b.left,B=b.width/2,C=R-B;l.scrollTo({left:l.scrollLeft+C,behavior:"smooth"})},[a]);const N=(0,t.useCallback)((e,l)=>{l?m.current.set(e,l):m.current.delete(e)},[]);return(0,r.jsx)("div",{ref:f,style:{scrollbarWidth:"none",msOverflowStyle:"none"},className:(0,d.cn)("overflow-x-auto",s),children:(0,r.jsx)("div",{className:"tablet:gap-8 flex gap-6",children:p?.map(e=>(0,r.jsx)("button",{ref:l=>N(e.id,l),children:e.id==="ipc-review"?(0,r.jsxs)("div",{className:"relative shrink-0 whitespace-nowrap py-[10px]",children:[c,(0,r.jsx)("div",{className:(0,d.cn)("laptop-md:block bg-brand-0 absolute bottom-0 left-0 hidden h-[2px] w-0 transition-all duration-300 ease-in-out",{"w-full":a===e.id})})]}):(0,r.jsxs)("div",{className:(0,d.cn)("laptop-md:text-[#1d1d1f] relative shrink-0 whitespace-nowrap py-[10px] text-sm font-bold text-[#949494]",{"text-[#1d1d1f]":a===e.id}),onClick:()=>x(e),children:[e.label,(0,r.jsx)("div",{className:(0,d.cn)("laptop-md:block bg-brand-0 absolute bottom-0 left-0 hidden h-[2px] w-0 transition-all duration-300 ease-in-out",{"w-full":a===e.id})})]})},e.id))})})};var P=z;
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/ScrollSpyNav/index.tsx"],
4
- "sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { cn } from '../../../../../helpers/index.js'\nimport { useState, useCallback, useRef, useEffect } from 'react'\nimport { gsap } from 'gsap'\nimport type { ScrollSpyNavItem, ScrollSpyNavProps } from './types.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\n\n// \u81EA\u5B9A\u4E49 hook\uFF1A\u76D1\u542C\u9875\u9762\u6EDA\u52A8\uFF0C\u81EA\u52A8\u66F4\u65B0\u5F53\u524D\u6FC0\u6D3B\u7684 tab\nconst useScrollSpy = (tabs: ScrollSpyNavItem[], onActiveChange?: (tab: ScrollSpyNavItem) => void) => {\n const [activeTab, setActiveTab] = useState<ScrollSpyNavItem | null>(null)\n const observerRef = useRef<IntersectionObserver | null>(null)\n const sectionsRef = useRef<Map<string, ScrollSpyNavItem>>(new Map())\n const isManualScrollRef = useRef(false) // \u6807\u8BB0\u662F\u5426\u4E3A\u624B\u52A8\u70B9\u51FB\u89E6\u53D1\u7684\u6EDA\u52A8\n const activeTabRef = useRef<ScrollSpyNavItem | null>(null) // \u7528 ref \u5B58\u50A8\u5F53\u524D\u6FC0\u6D3B\u7684 tab\uFF0C\u907F\u514D\u95ED\u5305\u95EE\u9898\n\n // \u540C\u6B65 activeTab \u5230 ref\n useEffect(() => {\n activeTabRef.current = activeTab\n }, [activeTab])\n\n useEffect(() => {\n if (!tabs || tabs.length === 0) return\n\n // \u6E05\u7406\u4E4B\u524D\u7684 observer\n if (observerRef.current) {\n observerRef.current.disconnect()\n }\n\n // \u83B7\u53D6\u5BFC\u822A\u680F\u9AD8\u5EA6\n const purchaseBar = document.getElementById('purchase-bar')\n const navHeight = purchaseBar ? purchaseBar.clientHeight : 100\n\n // \u521B\u5EFA Map \u5B58\u50A8 section \u4FE1\u606F\n sectionsRef.current.clear()\n const elements: Element[] = []\n\n tabs.forEach(tab => {\n const id = tab.id || tab.href?.replace('#', '')\n const element = document.getElementById(id)\n if (element) {\n sectionsRef.current.set(id, tab)\n elements.push(element)\n }\n })\n\n if (elements.length === 0) {\n // \u5982\u679C\u6CA1\u6709\u627E\u5230\u5143\u7D20\uFF0C\u8BBE\u7F6E\u7B2C\u4E00\u4E2A tab \u4E3A\u6FC0\u6D3B\u72B6\u6001\n setActiveTab(tabs[0])\n return\n }\n\n // \u4F7F\u7528 IntersectionObserver \u76D1\u542C\u5143\u7D20\u8FDB\u5165\u89C6\u53E3\n const observerOptions: IntersectionObserverInit = {\n root: null,\n rootMargin: `-${navHeight}px 0px -50% 0px`, // \u4E0A\u65B9\u504F\u79FB\u5BFC\u822A\u680F\u9AD8\u5EA6\uFF0C\u4E0B\u65B9\u504F\u79FB50%\u89C6\u53E3\u9AD8\u5EA6\n threshold: [0, 0.25, 0.5, 0.75, 1],\n }\n\n const observerCallback: IntersectionObserverCallback = entries => {\n // \u5982\u679C\u662F\u624B\u52A8\u70B9\u51FB\u89E6\u53D1\u7684\u6EDA\u52A8\uFF0C\u4E0D\u8981\u66F4\u65B0\u72B6\u6001\n if (isManualScrollRef.current) {\n return\n }\n\n // \u68C0\u67E5\u662F\u5426\u6EDA\u52A8\u5230\u9875\u9762\u9876\u90E8\uFF08\u7279\u6B8A\u5904\u7406\u7B2C\u4E00\u4E2A\u5143\u7D20\uFF09\n const scrollTop = window.scrollY || document.documentElement.scrollTop\n if (scrollTop < navHeight + 50) {\n // \u5728\u9875\u9762\u9876\u90E8\uFF0C\u6FC0\u6D3B\u7B2C\u4E00\u4E2A tab\n const firstTab = tabs[0]\n if (firstTab && activeTabRef.current?.id !== firstTab.id) {\n console.log('\u9875\u9762\u9876\u90E8\uFF0C\u6FC0\u6D3B\u7B2C\u4E00\u4E2A tab:', firstTab.label)\n setActiveTab(firstTab)\n onActiveChange?.(firstTab)\n }\n return\n }\n\n // \u627E\u51FA\u6240\u6709\u6B63\u5728\u4EA4\u53C9\u7684 entries\n const intersectingEntries = entries\n .filter(entry => entry.isIntersecting)\n .sort((a, b) => {\n // \u6309\u7167\u5143\u7D20\u5728\u9875\u9762\u4E0A\u7684\u4F4D\u7F6E\u6392\u5E8F\uFF08\u4ECE\u4E0A\u5230\u4E0B\uFF09\n return a.boundingClientRect.top - b.boundingClientRect.top\n })\n\n if (intersectingEntries.length > 0) {\n // \u9009\u62E9\u6700\u4E0A\u9762\u7684\u6B63\u5728\u4EA4\u53C9\u7684\u5143\u7D20\n const topEntry = intersectingEntries[0]\n const id = topEntry.target.id\n const tab = sectionsRef.current.get(id)\n\n if (tab) {\n setActiveTab(tab)\n onActiveChange?.(tab)\n }\n } else {\n // \u5982\u679C\u6CA1\u6709\u5143\u7D20\u6B63\u5728\u4EA4\u53C9\uFF0C\u627E\u51FA\u6700\u63A5\u8FD1\u89C6\u53E3\u9876\u90E8\u7684\u5143\u7D20\n const sortedEntries = [...entries].sort((a, b) => {\n return Math.abs(a.boundingClientRect.top) - Math.abs(b.boundingClientRect.top)\n })\n\n if (sortedEntries.length > 0) {\n const closestEntry = sortedEntries[0]\n const id = closestEntry.target.id\n const tab = sectionsRef.current.get(id)\n\n if (tab) {\n setActiveTab(tab)\n onActiveChange?.(tab)\n }\n }\n }\n }\n\n observerRef.current = new IntersectionObserver(observerCallback, observerOptions)\n\n // \u89C2\u5BDF\u6240\u6709 section \u5143\u7D20\n elements.forEach(element => {\n observerRef.current?.observe(element)\n })\n\n // \u6DFB\u52A0\u6EDA\u52A8\u4E8B\u4EF6\u76D1\u542C\uFF0C\u5904\u7406\u9875\u9762\u9876\u90E8\u7684\u60C5\u51B5\n const handleScroll = () => {\n if (isManualScrollRef.current) {\n return\n }\n\n const scrollTop = window.scrollY || document.documentElement.scrollTop\n // \u5982\u679C\u6EDA\u52A8\u5230\u63A5\u8FD1\u9875\u9762\u9876\u90E8\uFF0C\u6FC0\u6D3B\u7B2C\u4E00\u4E2A tab\n if (scrollTop < navHeight + 50) {\n const firstTab = tabs[0]\n if (firstTab) {\n setActiveTab(firstTab)\n onActiveChange?.(firstTab)\n }\n }\n }\n\n window.addEventListener('scroll', handleScroll, { passive: true })\n\n return () => {\n if (observerRef.current) {\n observerRef.current.disconnect()\n }\n window.removeEventListener('scroll', handleScroll)\n }\n }, [tabs])\n\n // \u521D\u59CB\u5316\u65F6\u8BBE\u7F6E\u7B2C\u4E00\u4E2A tab\n useEffect(() => {\n if (!activeTab && tabs && tabs.length > 0) {\n setActiveTab(tabs[0])\n }\n }, [tabs, activeTab])\n\n // \u624B\u52A8\u8BBE\u7F6E\u6FC0\u6D3B tab \u5E76\u6EDA\u52A8\u5230\u5BF9\u5E94\u4F4D\u7F6E\n const handleSetActiveTab = useCallback((tab: ScrollSpyNavItem) => {\n setActiveTab(tab)\n\n // \u6EDA\u52A8\u5230\u5BF9\u5E94\u7684\u951A\u70B9\n const id = tab.id || tab.href?.replace('#', '')\n const element = document.getElementById(id)\n\n if (element) {\n const purchaseBar = document.getElementById('purchase-bar')\n const navHeight = purchaseBar ? purchaseBar.clientHeight : 100\n\n // \u8BBE\u7F6E\u624B\u52A8\u6EDA\u52A8\u6807\u5FD7\n isManualScrollRef.current = true\n\n // \u8BA1\u7B97\u6EDA\u52A8\u4F4D\u7F6E\uFF08\u5143\u7D20\u9876\u90E8 - \u5BFC\u822A\u680F\u9AD8\u5EA6 - \u989D\u5916\u95F4\u8DDD\uFF09\n const elementTop = element.getBoundingClientRect().top + window.scrollY\n const scrollToPosition = elementTop - navHeight - 10\n\n window.scrollTo({\n top: scrollToPosition,\n behavior: 'smooth',\n })\n\n // \u6EDA\u52A8\u7ED3\u675F\u540E\u91CD\u7F6E\u6807\u5FD7\n setTimeout(() => {\n isManualScrollRef.current = false\n }, 1000) // 1\u79D2\u540E\u91CD\u7F6E\uFF0C\u786E\u4FDD\u6EDA\u52A8\u52A8\u753B\u5B8C\u6210\n }\n }, [])\n\n return { activeTab: activeTab || tabs?.[0], setActiveTab: handleSetActiveTab }\n}\n\nconst ScrollSpyNav = ({ tabs, onSpyNavItemClick, className, renderRating }: ScrollSpyNavProps) => {\n // \u4F7F\u7528 useScrollSpy hook \u81EA\u52A8\u76D1\u542C\u6EDA\u52A8\n const { activeTab, setActiveTab } = useScrollSpy(tabs)\n\n // \u79FB\u52A8\u7AEF\uFF1A\u6A2A\u5411\u6EDA\u52A8\u5BB9\u5668\u548C tab \u6309\u94AE\u7684 refs\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const tabRefs = useRef<Map<string, HTMLButtonElement>>(new Map())\n\n const onTabClick = useCallback(\n (tab: ScrollSpyNavItem) => {\n setActiveTab(tab)\n onSpyNavItemClick?.(tab)\n },\n [onSpyNavItemClick, setActiveTab]\n )\n\n // \u79FB\u52A8\u7AEF\uFF1A\u5F53 activeTab \u6539\u53D8\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5230\u4E2D\u5FC3\u4F4D\u7F6E\n useEffect(() => {\n if (!activeTab || !scrollContainerRef.current) return\n\n const activeTabElement = tabRefs.current.get(activeTab.id)\n if (!activeTabElement) return\n\n const container = scrollContainerRef.current\n const tabRect = activeTabElement.getBoundingClientRect()\n const containerRect = container.getBoundingClientRect()\n\n // \u8BA1\u7B97\u9700\u8981\u6EDA\u52A8\u7684\u8DDD\u79BB\uFF0C\u4F7F tab \u4F4D\u4E8E\u5BB9\u5668\u4E2D\u5FC3\n const tabCenter = tabRect.left + tabRect.width / 2 - containerRect.left\n const containerCenter = containerRect.width / 2\n const scrollOffset = tabCenter - containerCenter\n\n container.scrollTo({\n left: container.scrollLeft + scrollOffset,\n behavior: 'smooth',\n })\n }, [activeTab?.id])\n\n // \u8BBE\u7F6E tab ref\n const setTabRef = useCallback((tabId: string, element: HTMLButtonElement | null) => {\n if (element) {\n tabRefs.current.set(tabId, element)\n } else {\n tabRefs.current.delete(tabId)\n }\n }, [])\n\n // \u684C\u9762\u7AEF\u6E32\u67D3\n return (\n <div\n ref={scrollContainerRef}\n style={{ scrollbarWidth: 'none', msOverflowStyle: 'none' }}\n className={cn('overflow-x-auto', className)}\n >\n <div className=\"tablet:gap-8 flex gap-6\">\n {tabs?.map(tab => (\n <button\n ref={el => setTabRef(tab.id, el)}\n className={cn(\n 'desktop:text-[#1d1d1f] relative shrink-0 whitespace-nowrap py-[10px] text-sm font-bold text-[#949494]',\n {\n 'text-[#1d1d1f]': activeTab?.id === tab.id,\n }\n )}\n key={tab.id}\n onClick={() => onTabClick(tab)}\n >\n {tab.label}\n <div\n className={cn(\n 'desktop:block bg-brand-0 absolute bottom-0 left-0 hidden h-[2px] w-0 transition-all duration-300 ease-in-out',\n {\n 'w-full': activeTab?.id === tab.id,\n }\n )}\n />\n </button>\n ))}\n {renderRating}\n </div>\n </div>\n )\n}\n\nexport default ScrollSpyNav\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqPU,IAAAI,EAAA,6BArPVC,EAA+B,6CAC/BC,EAAmB,2CACnBC,EAAyD,iBACzDC,EAAqB,gBAErBC,EAAqC,0CAGrC,MAAMC,EAAe,CAACC,EAA0BC,IAAqD,CACnG,KAAM,CAACC,EAAWC,CAAY,KAAI,YAAkC,IAAI,EAClEC,KAAc,UAAoC,IAAI,EACtDC,KAAc,UAAsC,IAAI,GAAK,EAC7DC,KAAoB,UAAO,EAAK,EAChCC,KAAe,UAAgC,IAAI,KAGzD,aAAU,IAAM,CACdA,EAAa,QAAUL,CACzB,EAAG,CAACA,CAAS,CAAC,KAEd,aAAU,IAAM,CACd,GAAI,CAACF,GAAQA,EAAK,SAAW,EAAG,OAG5BI,EAAY,SACdA,EAAY,QAAQ,WAAW,EAIjC,MAAMI,EAAc,SAAS,eAAe,cAAc,EACpDC,EAAYD,EAAcA,EAAY,aAAe,IAG3DH,EAAY,QAAQ,MAAM,EAC1B,MAAMK,EAAsB,CAAC,EAW7B,GATAV,EAAK,QAAQW,GAAO,CAClB,MAAMC,EAAKD,EAAI,IAAMA,EAAI,MAAM,QAAQ,IAAK,EAAE,EACxCE,EAAU,SAAS,eAAeD,CAAE,EACtCC,IACFR,EAAY,QAAQ,IAAIO,EAAID,CAAG,EAC/BD,EAAS,KAAKG,CAAO,EAEzB,CAAC,EAEGH,EAAS,SAAW,EAAG,CAEzBP,EAAaH,EAAK,CAAC,CAAC,EACpB,MACF,CAGA,MAAMc,EAA4C,CAChD,KAAM,KACN,WAAY,IAAIL,CAAS,kBACzB,UAAW,CAAC,EAAG,IAAM,GAAK,IAAM,CAAC,CACnC,EAEMM,EAAiDC,GAAW,CAEhE,GAAIV,EAAkB,QACpB,OAKF,IADkB,OAAO,SAAW,SAAS,gBAAgB,WAC7CG,EAAY,GAAI,CAE9B,MAAMQ,EAAWjB,EAAK,CAAC,EACnBiB,GAAYV,EAAa,SAAS,KAAOU,EAAS,KACpD,QAAQ,IAAI,oEAAmBA,EAAS,KAAK,EAC7Cd,EAAac,CAAQ,EACrBhB,IAAiBgB,CAAQ,GAE3B,MACF,CAGA,MAAMC,EAAsBF,EACzB,OAAOG,GAASA,EAAM,cAAc,EACpC,KAAK,CAACC,EAAG,IAEDA,EAAE,mBAAmB,IAAM,EAAE,mBAAmB,GACxD,EAEH,GAAIF,EAAoB,OAAS,EAAG,CAGlC,MAAMN,EADWM,EAAoB,CAAC,EAClB,OAAO,GACrBP,EAAMN,EAAY,QAAQ,IAAIO,CAAE,EAElCD,IACFR,EAAaQ,CAAG,EAChBV,IAAiBU,CAAG,EAExB,KAAO,CAEL,MAAMU,EAAgB,CAAC,GAAGL,CAAO,EAAE,KAAK,CAACI,EAAGE,IACnC,KAAK,IAAIF,EAAE,mBAAmB,GAAG,EAAI,KAAK,IAAIE,EAAE,mBAAmB,GAAG,CAC9E,EAED,GAAID,EAAc,OAAS,EAAG,CAE5B,MAAMT,EADeS,EAAc,CAAC,EACZ,OAAO,GACzBV,EAAMN,EAAY,QAAQ,IAAIO,CAAE,EAElCD,IACFR,EAAaQ,CAAG,EAChBV,IAAiBU,CAAG,EAExB,CACF,CACF,EAEAP,EAAY,QAAU,IAAI,qBAAqBW,EAAkBD,CAAe,EAGhFJ,EAAS,QAAQG,GAAW,CAC1BT,EAAY,SAAS,QAAQS,CAAO,CACtC,CAAC,EAGD,MAAMU,EAAe,IAAM,CACzB,GAAIjB,EAAkB,QACpB,OAKF,IAFkB,OAAO,SAAW,SAAS,gBAAgB,WAE7CG,EAAY,GAAI,CAC9B,MAAMQ,EAAWjB,EAAK,CAAC,EACnBiB,IACFd,EAAac,CAAQ,EACrBhB,IAAiBgB,CAAQ,EAE7B,CACF,EAEA,cAAO,iBAAiB,SAAUM,EAAc,CAAE,QAAS,EAAK,CAAC,EAE1D,IAAM,CACPnB,EAAY,SACdA,EAAY,QAAQ,WAAW,EAEjC,OAAO,oBAAoB,SAAUmB,CAAY,CACnD,CACF,EAAG,CAACvB,CAAI,CAAC,KAGT,aAAU,IAAM,CACV,CAACE,GAAaF,GAAQA,EAAK,OAAS,GACtCG,EAAaH,EAAK,CAAC,CAAC,CAExB,EAAG,CAACA,EAAME,CAAS,CAAC,EAGpB,MAAMsB,KAAqB,eAAab,GAA0B,CAChER,EAAaQ,CAAG,EAGhB,MAAMC,EAAKD,EAAI,IAAMA,EAAI,MAAM,QAAQ,IAAK,EAAE,EACxCE,EAAU,SAAS,eAAeD,CAAE,EAE1C,GAAIC,EAAS,CACX,MAAML,EAAc,SAAS,eAAe,cAAc,EACpDC,EAAYD,EAAcA,EAAY,aAAe,IAG3DF,EAAkB,QAAU,GAI5B,MAAMmB,EADaZ,EAAQ,sBAAsB,EAAE,IAAM,OAAO,QAC1BJ,EAAY,GAElD,OAAO,SAAS,CACd,IAAKgB,EACL,SAAU,QACZ,CAAC,EAGD,WAAW,IAAM,CACfnB,EAAkB,QAAU,EAC9B,EAAG,GAAI,CACT,CACF,EAAG,CAAC,CAAC,EAEL,MAAO,CAAE,UAAWJ,GAAaF,IAAO,CAAC,EAAG,aAAcwB,CAAmB,CAC/E,EAEME,EAAe,CAAC,CAAE,KAAA1B,EAAM,kBAAA2B,EAAmB,UAAAC,EAAW,aAAAC,CAAa,IAAyB,CAEhG,KAAM,CAAE,UAAA3B,EAAW,aAAAC,CAAa,EAAIJ,EAAaC,CAAI,EAG/C8B,KAAqB,UAAuB,IAAI,EAChDC,KAAU,UAAuC,IAAI,GAAK,EAE1DC,KAAa,eAChBrB,GAA0B,CACzBR,EAAaQ,CAAG,EAChBgB,IAAoBhB,CAAG,CACzB,EACA,CAACgB,EAAmBxB,CAAY,CAClC,KAGA,aAAU,IAAM,CACd,GAAI,CAACD,GAAa,CAAC4B,EAAmB,QAAS,OAE/C,MAAMG,EAAmBF,EAAQ,QAAQ,IAAI7B,EAAU,EAAE,EACzD,GAAI,CAAC+B,EAAkB,OAEvB,MAAMC,EAAYJ,EAAmB,QAC/BK,EAAUF,EAAiB,sBAAsB,EACjDG,EAAgBF,EAAU,sBAAsB,EAGhDG,EAAYF,EAAQ,KAAOA,EAAQ,MAAQ,EAAIC,EAAc,KAC7DE,EAAkBF,EAAc,MAAQ,EACxCG,EAAeF,EAAYC,EAEjCJ,EAAU,SAAS,CACjB,KAAMA,EAAU,WAAaK,EAC7B,SAAU,QACZ,CAAC,CACH,EAAG,CAACrC,GAAW,EAAE,CAAC,EAGlB,MAAMsC,KAAY,eAAY,CAACC,EAAe5B,IAAsC,CAC9EA,EACFkB,EAAQ,QAAQ,IAAIU,EAAO5B,CAAO,EAElCkB,EAAQ,QAAQ,OAAOU,CAAK,CAEhC,EAAG,CAAC,CAAC,EAGL,SACE,OAAC,OACC,IAAKX,EACL,MAAO,CAAE,eAAgB,OAAQ,gBAAiB,MAAO,EACzD,aAAW,MAAG,kBAAmBF,CAAS,EAE1C,oBAAC,OAAI,UAAU,0BACZ,UAAA5B,GAAM,IAAIW,MACT,QAAC,UACC,IAAK+B,GAAMF,EAAU7B,EAAI,GAAI+B,CAAE,EAC/B,aAAW,MACT,wGACA,CACE,iBAAkBxC,GAAW,KAAOS,EAAI,EAC1C,CACF,EAEA,QAAS,IAAMqB,EAAWrB,CAAG,EAE5B,UAAAA,EAAI,SACL,OAAC,OACC,aAAW,MACT,+GACA,CACE,SAAUT,GAAW,KAAOS,EAAI,EAClC,CACF,EACF,IAXKA,EAAI,EAYX,CACD,EACAkB,GACH,EACF,CAEJ,EAEA,IAAOtC,EAAQmC",
6
- "names": ["ScrollSpyNav_exports", "__export", "ScrollSpyNav_default", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_helpers", "import_react", "import_gsap", "import_BizProductProvider", "useScrollSpy", "tabs", "onActiveChange", "activeTab", "setActiveTab", "observerRef", "sectionsRef", "isManualScrollRef", "activeTabRef", "purchaseBar", "navHeight", "elements", "tab", "id", "element", "observerOptions", "observerCallback", "entries", "firstTab", "intersectingEntries", "entry", "a", "sortedEntries", "b", "handleScroll", "handleSetActiveTab", "scrollToPosition", "ScrollSpyNav", "onSpyNavItemClick", "className", "renderRating", "scrollContainerRef", "tabRefs", "onTabClick", "activeTabElement", "container", "tabRect", "containerRect", "tabCenter", "containerCenter", "scrollOffset", "setTabRef", "tabId", "el"]
4
+ "sourcesContent": ["import { cn } from '../../../../../helpers/index.js'\nimport { useCallback, useRef, useMemo, useEffect, useState } from 'react'\nimport type { ScrollSpyNavItem, ScrollSpyNavProps } from './types.js'\nimport { useScrollSpy } from './useScrollSpy.js'\nimport { debounce } from 'es-toolkit'\n\nconst ScrollSpyNav = ({ tabs, onSpyNavItemClick, className, renderRating }: ScrollSpyNavProps) => {\n // \u4F7F\u7528 useScrollSpy hook \u81EA\u52A8\u76D1\u542C\u6EDA\u52A8\n const [purchaseBarHeight, setPurchaseBarHeight] = useState(0)\n const combinedTabs = useMemo(() => {\n if (renderRating) {\n return [...tabs, { label: 'Reviews', id: 'ipc-review', href: '' }]\n }\n return tabs\n }, [tabs, renderRating])\n\n const sectionIds = useMemo(() => {\n return combinedTabs.map(tab => tab.id)\n }, [combinedTabs])\n\n const debouncedHandleResize = debounce(() => {\n const purchaseBar = document.querySelector('#purchase-bar')\n if (purchaseBar) {\n setPurchaseBarHeight(purchaseBar.getBoundingClientRect().height)\n }\n }, 500)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [debouncedHandleResize])\n\n const activeId = useScrollSpy(sectionIds, purchaseBarHeight)\n\n // \u79FB\u52A8\u7AEF\uFF1A\u6A2A\u5411\u6EDA\u52A8\u5BB9\u5668\u548C tab \u6309\u94AE\u7684 refs\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const tabRefs = useRef<Map<string, HTMLButtonElement>>(new Map())\n\n const onTabClick = useCallback(\n (tab: ScrollSpyNavItem) => {\n onSpyNavItemClick?.(tab)\n },\n [onSpyNavItemClick]\n )\n\n // \u79FB\u52A8\u7AEF\uFF1A\u5F53 activeTab \u6539\u53D8\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5230\u4E2D\u5FC3\u4F4D\u7F6E\n useEffect(() => {\n if (!activeId || !scrollContainerRef.current) return\n\n const activeTabElement = tabRefs.current.get(activeId)\n if (!activeTabElement) return\n\n const container = scrollContainerRef.current\n const tabRect = activeTabElement.getBoundingClientRect()\n const containerRect = container.getBoundingClientRect()\n\n // \u8BA1\u7B97\u9700\u8981\u6EDA\u52A8\u7684\u8DDD\u79BB\uFF0C\u4F7F tab \u4F4D\u4E8E\u5BB9\u5668\u4E2D\u5FC3\n const tabCenter = tabRect.left + tabRect.width / 2 - containerRect.left\n const containerCenter = containerRect.width / 2\n const scrollOffset = tabCenter - containerCenter\n\n container.scrollTo({\n left: container.scrollLeft + scrollOffset,\n behavior: 'smooth',\n })\n }, [activeId])\n\n // \u8BBE\u7F6E tab ref\n const setTabRef = useCallback((tabId: string, element: HTMLButtonElement | null) => {\n if (element) {\n tabRefs.current.set(tabId, element)\n } else {\n tabRefs.current.delete(tabId)\n }\n }, [])\n\n return (\n <div\n ref={scrollContainerRef}\n style={{ scrollbarWidth: 'none', msOverflowStyle: 'none' }}\n className={cn('overflow-x-auto', className)}\n >\n <div className=\"tablet:gap-8 flex gap-6\">\n {combinedTabs?.map(tab => (\n <button key={tab.id} ref={el => setTabRef(tab.id, el)}>\n {tab.id === 'ipc-review' ? (\n <div className=\"relative shrink-0 whitespace-nowrap py-[10px]\">\n {renderRating}\n <div\n className={cn(\n 'laptop-md:block bg-brand-0 absolute bottom-0 left-0 hidden h-[2px] w-0 transition-all duration-300 ease-in-out',\n {\n 'w-full': activeId === tab.id,\n }\n )}\n />\n </div>\n ) : (\n <div\n className={cn(\n 'laptop-md:text-[#1d1d1f] relative shrink-0 whitespace-nowrap py-[10px] text-sm font-bold text-[#949494]',\n {\n 'text-[#1d1d1f]': activeId === tab.id,\n }\n )}\n onClick={() => onTabClick(tab)}\n >\n {tab.label}\n <div\n className={cn(\n 'laptop-md:block bg-brand-0 absolute bottom-0 left-0 hidden h-[2px] w-0 transition-all duration-300 ease-in-out',\n {\n 'w-full': activeId === tab.id,\n }\n )}\n />\n </div>\n )}\n </button>\n ))}\n </div>\n </div>\n )\n}\n\nexport default ScrollSpyNav\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAyFc,IAAAI,EAAA,6BAzFdC,EAAmB,2CACnBC,EAAkE,iBAElEC,EAA6B,6BAC7BC,EAAyB,sBAEzB,MAAMC,EAAe,CAAC,CAAE,KAAAC,EAAM,kBAAAC,EAAmB,UAAAC,EAAW,aAAAC,CAAa,IAAyB,CAEhG,KAAM,CAACC,EAAmBC,CAAoB,KAAI,YAAS,CAAC,EACtDC,KAAe,WAAQ,IACvBH,EACK,CAAC,GAAGH,EAAM,CAAE,MAAO,UAAW,GAAI,aAAc,KAAM,EAAG,CAAC,EAE5DA,EACN,CAACA,EAAMG,CAAY,CAAC,EAEjBI,KAAa,WAAQ,IAClBD,EAAa,IAAIE,GAAOA,EAAI,EAAE,EACpC,CAACF,CAAY,CAAC,EAEXG,KAAwB,YAAS,IAAM,CAC3C,MAAMC,EAAc,SAAS,cAAc,eAAe,EACtDA,GACFL,EAAqBK,EAAY,sBAAsB,EAAE,MAAM,CAEnE,EAAG,GAAG,KAEN,aAAU,KACRD,EAAsB,EACtB,OAAO,iBAAiB,SAAUA,CAAqB,EAChD,IAAM,CACX,OAAO,oBAAoB,SAAUA,CAAqB,CAC5D,GACC,CAACA,CAAqB,CAAC,EAE1B,MAAME,KAAW,gBAAaJ,EAAYH,CAAiB,EAGrDQ,KAAqB,UAAuB,IAAI,EAChDC,KAAU,UAAuC,IAAI,GAAK,EAE1DC,KAAa,eAChBN,GAA0B,CACzBP,IAAoBO,CAAG,CACzB,EACA,CAACP,CAAiB,CACpB,KAGA,aAAU,IAAM,CACd,GAAI,CAACU,GAAY,CAACC,EAAmB,QAAS,OAE9C,MAAMG,EAAmBF,EAAQ,QAAQ,IAAIF,CAAQ,EACrD,GAAI,CAACI,EAAkB,OAEvB,MAAMC,EAAYJ,EAAmB,QAC/BK,EAAUF,EAAiB,sBAAsB,EACjDG,EAAgBF,EAAU,sBAAsB,EAGhDG,EAAYF,EAAQ,KAAOA,EAAQ,MAAQ,EAAIC,EAAc,KAC7DE,EAAkBF,EAAc,MAAQ,EACxCG,EAAeF,EAAYC,EAEjCJ,EAAU,SAAS,CACjB,KAAMA,EAAU,WAAaK,EAC7B,SAAU,QACZ,CAAC,CACH,EAAG,CAACV,CAAQ,CAAC,EAGb,MAAMW,KAAY,eAAY,CAACC,EAAeC,IAAsC,CAC9EA,EACFX,EAAQ,QAAQ,IAAIU,EAAOC,CAAO,EAElCX,EAAQ,QAAQ,OAAOU,CAAK,CAEhC,EAAG,CAAC,CAAC,EAEL,SACE,OAAC,OACC,IAAKX,EACL,MAAO,CAAE,eAAgB,OAAQ,gBAAiB,MAAO,EACzD,aAAW,MAAG,kBAAmBV,CAAS,EAE1C,mBAAC,OAAI,UAAU,0BACZ,SAAAI,GAAc,IAAIE,MACjB,OAAC,UAAoB,IAAKiB,GAAMH,EAAUd,EAAI,GAAIiB,CAAE,EACjD,SAAAjB,EAAI,KAAO,gBACV,QAAC,OAAI,UAAU,gDACZ,UAAAL,KACD,OAAC,OACC,aAAW,MACT,iHACA,CACE,SAAUQ,IAAaH,EAAI,EAC7B,CACF,EACF,GACF,KAEA,QAAC,OACC,aAAW,MACT,0GACA,CACE,iBAAkBG,IAAaH,EAAI,EACrC,CACF,EACA,QAAS,IAAMM,EAAWN,CAAG,EAE5B,UAAAA,EAAI,SACL,OAAC,OACC,aAAW,MACT,iHACA,CACE,SAAUG,IAAaH,EAAI,EAC7B,CACF,EACF,GACF,GAhCSA,EAAI,EAkCjB,CACD,EACH,EACF,CAEJ,EAEA,IAAOhB,EAAQO",
6
+ "names": ["ScrollSpyNav_exports", "__export", "ScrollSpyNav_default", "__toCommonJS", "import_jsx_runtime", "import_helpers", "import_react", "import_useScrollSpy", "import_es_toolkit", "ScrollSpyNav", "tabs", "onSpyNavItemClick", "className", "renderRating", "purchaseBarHeight", "setPurchaseBarHeight", "combinedTabs", "sectionIds", "tab", "debouncedHandleResize", "purchaseBar", "activeId", "scrollContainerRef", "tabRefs", "onTabClick", "activeTabElement", "container", "tabRect", "containerRect", "tabCenter", "containerCenter", "scrollOffset", "setTabRef", "tabId", "element", "el"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ declare const useScrollSpy: (sectionIds: string[], offset?: number) => string;
2
+ export { useScrollSpy };
@@ -0,0 +1,2 @@
1
+ "use strict";var i=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var v=(e,o)=>{for(var n in o)i(e,n,{get:o[n],enumerable:!0})},S=(e,o,n,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of p(o))!g.call(e,t)&&t!==n&&i(e,t,{get:()=>o[t],enumerable:!(l=m(o,t))||l.enumerable});return e};var h=e=>S(i({},"__esModule",{value:!0}),e);var E={};v(E,{useScrollSpy:()=>a});module.exports=h(E);var r=require("react"),u=require("es-toolkit");const a=(e,o=100)=>{const[n,l]=(0,r.useState)("");return(0,r.useEffect)(()=>{const t=()=>{const w=Math.ceil(window.scrollY+o+10);for(let c=e.length-1;c>=0;c--){const d=document.getElementById(e[c]);if(d){const f=Math.ceil(d.getBoundingClientRect().top+window.scrollY);if(console.log(f,"offsetTop"),w>=f){l(e[c]);break}}}};t();const s=(0,u.debounce)(t,50);return window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}},[e,o]),n};
2
+ //# sourceMappingURL=useScrollSpy.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/useScrollSpy.tsx"],
4
+ "sourcesContent": ["import { useState, useEffect } from 'react'\nimport { debounce } from 'es-toolkit'\n\nconst useScrollSpy = (sectionIds: string[], offset = 100) => {\n const [activeId, setActiveId] = useState('')\n\n useEffect(() => {\n const handleScroll = () => {\n const scrollPosition = Math.ceil(window.scrollY + offset + 10)\n\n // \u904D\u5386\u6240\u6709section\uFF0C\u627E\u5230\u5F53\u524D\u53EF\u89C6\u533A\u57DF\u5185\u7684section\n for (let i = sectionIds.length - 1; i >= 0; i--) {\n const section = document.getElementById(sectionIds[i])\n if (section) {\n const offsetTop = Math.ceil(section.getBoundingClientRect().top + window.scrollY)\n console.log(offsetTop, 'offsetTop')\n if (scrollPosition >= offsetTop) {\n setActiveId(sectionIds[i])\n break\n }\n }\n }\n }\n\n // \u521D\u59CB\u5316\u65F6\u6267\u884C\u4E00\u6B21\n handleScroll()\n\n // \u521B\u5EFAdebounce\u51FD\u6570\u5E76\u4FDD\u5B58\u5F15\u7528\uFF0C\u786E\u4FDD\u80FD\u6B63\u786E\u79FB\u9664\u76D1\u542C\u5668\n const debouncedHandleScroll = debounce(handleScroll, 50)\n window.addEventListener('scroll', debouncedHandleScroll)\n\n return () => {\n window.removeEventListener('scroll', debouncedHandleScroll)\n }\n }, [sectionIds, offset])\n\n return activeId\n}\n\nexport { useScrollSpy }\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAoC,iBACpCC,EAAyB,sBAEzB,MAAMH,EAAe,CAACI,EAAsBC,EAAS,MAAQ,CAC3D,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAS,EAAE,EAE3C,sBAAU,IAAM,CACd,MAAMC,EAAe,IAAM,CACzB,MAAMC,EAAiB,KAAK,KAAK,OAAO,QAAUJ,EAAS,EAAE,EAG7D,QAASK,EAAIN,EAAW,OAAS,EAAGM,GAAK,EAAGA,IAAK,CAC/C,MAAMC,EAAU,SAAS,eAAeP,EAAWM,CAAC,CAAC,EACrD,GAAIC,EAAS,CACX,MAAMC,EAAY,KAAK,KAAKD,EAAQ,sBAAsB,EAAE,IAAM,OAAO,OAAO,EAEhF,GADA,QAAQ,IAAIC,EAAW,WAAW,EAC9BH,GAAkBG,EAAW,CAC/BL,EAAYH,EAAWM,CAAC,CAAC,EACzB,KACF,CACF,CACF,CACF,EAGAF,EAAa,EAGb,MAAMK,KAAwB,YAASL,EAAc,EAAE,EACvD,cAAO,iBAAiB,SAAUK,CAAqB,EAEhD,IAAM,CACX,OAAO,oBAAoB,SAAUA,CAAqB,CAC5D,CACF,EAAG,CAACT,EAAYC,CAAM,CAAC,EAEhBC,CACT",
6
+ "names": ["useScrollSpy_exports", "__export", "useScrollSpy", "__toCommonJS", "import_react", "import_es_toolkit", "sectionIds", "offset", "activeId", "setActiveId", "handleScroll", "scrollPosition", "i", "section", "offsetTop", "debouncedHandleScroll"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";var f=Object.create;var p=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var x=(e,t)=>{for(var o in t)p(e,o,{get:t[o],enumerable:!0})},l=(e,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v(t))!k.call(e,r)&&r!==o&&p(e,r,{get:()=>t[r],enumerable:!(s=b(t,r))||s.enumerable});return e};var y=(e,t,o)=>(o=e!=null?f(h(e)):{},l(t||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),w=e=>l(p({},"__esModule",{value:!0}),e);var P={};x(P,{default:()=>g});module.exports=w(P);var a=require("react/jsx-runtime"),n=require("react"),i=require("../../../../components/index.js"),m=require("../index.js"),c=require("../../BizProductProvider.js"),d=y(require("./ScrollSpyNav/index.js")),u=require("../../../../shared/Styles.js");const N=({onSpyNavItemClick:e})=>{const{product:t,renderRating:o}=(0,c.useBizProductContext)(),s=(0,n.useMemo)(()=>t?.payload?.components?.find(r=>r.componentKey==="PurchaseBar")?.data||[],[t?.payload]);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 desktop:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]",children:[(0,a.jsxs)("div",{className:"desktop:pt-6 desktop:pb-0 min-w-0 flex-1 py-3",children:[(0,a.jsx)(i.Heading,{size:2,className:"tablet:max-w-[406px] desktop:max-w-[570px] lg-desktop:max-w-[683px] line-clamp-2",html:t?.title}),(0,a.jsx)("div",{className:"desktop:block mt-3 hidden",children:(0,a.jsx)(d.default,{tabs:s,className:"",renderRating:o,onSpyNavItemClick:e})})]}),(0,a.jsx)("div",{className:"desktop:block hidden shrink-0",children:(0,a.jsx)(m.ProductActions,{})})]})}),(0,a.jsxs)(i.Container,{className:"desktop:hidden relative",children:[(0,a.jsx)("div",{className:"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]"}),(0,a.jsx)(d.default,{tabs:s,renderRating:o,onSpyNavItemClick:e})]})]})};var g=(0,u.withLayout)(N);
1
+ "use strict";var f=Object.create;var l=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var h=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var N=(a,t)=>{for(var o in t)l(a,o,{get:t[o],enumerable:!0})},d=(a,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v(t))!y.call(a,r)&&r!==o&&l(a,r,{get:()=>t[r],enumerable:!(i=b(t,r))||i.enumerable});return a};var g=(a,t,o)=>(o=a!=null?f(h(a)):{},d(t||!a||!a.__esModule?l(o,"default",{value:a,enumerable:!0}):o,a)),P=a=>d(l({},"__esModule",{value:!0}),a);var B={};N(B,{default:()=>x});module.exports=P(B);var e=require("react/jsx-runtime"),m=require("react"),p=require("../../../../components/index.js"),n=require("../index.js"),c=require("../../BizProductProvider.js"),s=g(require("./ScrollSpyNav/index.js")),u=require("../../../../shared/Styles.js");const w=({onSpyNavItemClick:a})=>{const{product:t,renderRating:o}=(0,c.useBizProductContext)(),i=(0,m.useMemo)(()=>t?.payload?.components?.find(r=>r.componentKey==="PurchaseBar")?.data||[],[t?.payload]);return(0,e.jsxs)("div",{id:"purchase-bar",className:"sticky left-0 top-0 z-[45] w-full border-b border-[#E4E5E6] bg-white",children:[(0,e.jsx)(p.Container,{children:(0,e.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,e.jsxs)("div",{className:"laptop-md:pt-6 laptop-md:pb-0 min-w-0 flex-1 py-3",children:[(0,e.jsx)(p.Heading,{size:2,className:"line-clamp-2",html:t?.title}),(0,e.jsx)("div",{className:"laptop-md:block mt-3 hidden",children:(0,e.jsx)(s.default,{tabs:i,className:"",renderRating:o,onSpyNavItemClick:a})})]}),(0,e.jsx)("div",{className:"laptop-md:block hidden shrink-0",children:(0,e.jsx)(n.ProductActions,{})})]})}),(0,e.jsxs)(p.Container,{className:"laptop-md:hidden relative",children:[(0,e.jsx)("div",{className:"absolute left-0 top-0 h-px w-full bg-[#E4E5E6]"}),(0,e.jsx)(s.default,{tabs:i,renderRating:o,onSpyNavItemClick:a})]})]})};var x=(0,u.withLayout)(w);
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 { useMemo } from 'react'\nimport { Text, Heading, Button, Container } from '../../../../components/index.js'\nimport type { PurchaseBarProps } from './types.js'\nimport { ProductActions } from '../index.js'\nimport { useBizProductContext } from '../../BizProductProvider.js'\nimport ScrollSpyNav from './ScrollSpyNav/index.js'\nimport { withLayout } from '../../../../shared/Styles.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick }: PurchaseBarProps) => {\n const { product, renderRating } = useBizProductContext()\n\n const PurchaseBarData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'PurchaseBar')?.data || []\n }, [product?.payload])\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 desktop:gap-16 tablet:gap-0 tablet:w-full flex flex-wrap items-center gap-[10px]\">\n <div className=\"desktop:pt-6 desktop:pb-0 min-w-0 flex-1 py-3\">\n <Heading\n size={2}\n className=\"tablet:max-w-[406px] desktop:max-w-[570px] lg-desktop:max-w-[683px] line-clamp-2\"\n html={product?.title}\n />\n <div className=\"desktop: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=\"desktop:block hidden shrink-0\">\n <ProductActions />\n </div>\n </div>\n </Container>\n <Container className=\"desktop: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,GAmBU,IAAAI,EAAA,6BAnBVC,EAAwB,iBACxBC,EAAiD,2CAEjDC,EAA+B,uBAC/BC,EAAqC,uCACrCC,EAAyB,sCACzBC,EAA2B,wCAE3B,MAAMC,EAAc,CAAC,CAAE,kBAAAC,CAAkB,IAAwB,CAC/D,KAAM,CAAE,QAAAC,EAAS,aAAAC,CAAa,KAAI,wBAAqB,EAEjDC,KAAkB,WAAQ,IACvBF,GAAS,SAAS,YAAY,KAAMG,GAAcA,EAAK,eAAiB,aAAa,GAAG,MAAQ,CAAC,EACvG,CAACH,GAAS,OAAO,CAAC,EAErB,SACE,QAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,oBAAC,aACC,oBAAC,OAAI,UAAU,0GACb,qBAAC,OAAI,UAAU,gDACb,oBAAC,WACC,KAAM,EACN,UAAU,mFACV,KAAMA,GAAS,MACjB,KACA,OAAC,OAAI,UAAU,4BACb,mBAAC,EAAAI,QAAA,CACC,KAAMF,EACN,UAAU,GACV,aAAcD,EACd,kBAAmBF,EACrB,EACF,GACF,KACA,OAAC,OAAI,UAAU,gCACb,mBAAC,mBAAe,EAClB,GACF,EACF,KACA,QAAC,aAAU,UAAU,0BACnB,oBAAC,OAAI,UAAU,iDAAiD,KAChE,OAAC,EAAAK,QAAA,CAAa,KAAMF,EAAiB,aAAcD,EAAc,kBAAmBF,EAAmB,GACzG,GACF,CAEJ,EAEA,IAAOV,KAAQ,cAAWS,CAAW",
4
+ "sourcesContent": ["import { useMemo } from 'react'\nimport { Text, Heading, Button, Container } from '../../../../components/index.js'\nimport type { PurchaseBarProps } from './types.js'\nimport { ProductActions } from '../index.js'\nimport { useBizProductContext } from '../../BizProductProvider.js'\nimport ScrollSpyNav from './ScrollSpyNav/index.js'\nimport { withLayout } from '../../../../shared/Styles.js'\n\nconst PurchaseBar = ({ onSpyNavItemClick }: PurchaseBarProps) => {\n const { product, renderRating } = useBizProductContext()\n\n const PurchaseBarData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'PurchaseBar')?.data || []\n }, [product?.payload])\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\" 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 <ProductActions />\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,GAmBU,IAAAI,EAAA,6BAnBVC,EAAwB,iBACxBC,EAAiD,2CAEjDC,EAA+B,uBAC/BC,EAAqC,uCACrCC,EAAyB,sCACzBC,EAA2B,wCAE3B,MAAMC,EAAc,CAAC,CAAE,kBAAAC,CAAkB,IAAwB,CAC/D,KAAM,CAAE,QAAAC,EAAS,aAAAC,CAAa,KAAI,wBAAqB,EAEjDC,KAAkB,WAAQ,IACvBF,GAAS,SAAS,YAAY,KAAMG,GAAcA,EAAK,eAAiB,aAAa,GAAG,MAAQ,CAAC,EACvG,CAACH,GAAS,OAAO,CAAC,EAErB,SACE,QAAC,OAAI,GAAG,eAAe,UAAU,uEAC/B,oBAAC,aACC,oBAAC,OAAI,UAAU,4GACb,qBAAC,OAAI,UAAU,oDACb,oBAAC,WAAQ,KAAM,EAAG,UAAU,eAAe,KAAMA,GAAS,MAAO,KACjE,OAAC,OAAI,UAAU,8BACb,mBAAC,EAAAI,QAAA,CACC,KAAMF,EACN,UAAU,GACV,aAAcD,EACd,kBAAmBF,EACrB,EACF,GACF,KACA,OAAC,OAAI,UAAU,kCACb,mBAAC,mBAAe,EAClB,GACF,EACF,KACA,QAAC,aAAU,UAAU,4BACnB,oBAAC,OAAI,UAAU,iDAAiD,KAChE,OAAC,EAAAK,QAAA,CAAa,KAAMF,EAAiB,aAAcD,EAAc,kBAAmBF,EAAmB,GACzG,GACF,CAEJ,EAEA,IAAOV,KAAQ,cAAWS,CAAW",
6
6
  "names": ["PurchaseBar_exports", "__export", "PurchaseBar_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import__", "import_BizProductProvider", "import_ScrollSpyNav", "import_Styles", "PurchaseBar", "onSpyNavItemClick", "product", "renderRating", "PurchaseBarData", "item", "ScrollSpyNav"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var P=(e,o)=>{for(var i in o)a(e,i,{get:o[i],enumerable:!0})},R=(e,o,i,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of x(o))!G.call(e,n)&&n!==i&&a(e,n,{get:()=>o[n],enumerable:!(t=I(o,n))||t.enumerable});return e};var S=e=>R(a({},"__esModule",{value:!0}),e);var v={};P(v,{useBenefits:()=>M});module.exports=S(v);var m=require("../BizProductProvider.js"),p=require("../utils/helper.js"),d=require("./useDiscountEnable.js"),g=require("../../AiuiProvider/index.js"),y=require("react");const M=({variant:e})=>{const{coupon:o,product:i,bundle:t,freeGift:n,memberFunctionResult:f,creditsRedemptionAmount:c,profile:b}=(0,m.useBizProductContext)(),{trackingData:l}=(0,g.useAiuiContext)(),B=Math.max(f?.withCouponMemberTotalSave??0,f?.withoutCouponMaxMemberTotalSave??0),r=(0,d.useDiscountEnable)({profile:b,variant:e,memberFunctionResult:f,coupon:o}),h=!!(l?.paidShipping&&e.requiresShipping&&!e?.metafields?.global?.presell&&!e?.metafields?.global?.HideShipping),u=l?.freeGift,C=u?.excludeProducts?.map(s=>typeof s=="object"&&"sku"in s?s.sku:s)??[],D=l?.levelDiscount&&(0,p.checkItemAvailableForProduct)({product:i,variant:e,item:l?.levelDiscount});return{commonCoupon:{enable:r.showCommonCoupon&&!!o,config:o??{}},freeGift:{enable:!!n&&!!n?.giftList?.length,config:n},bundle:{enable:!!t&&!!t?.bundleList?.length&&Math.max(...t?.bundleList?.map(s=>s.savings??0)??[])>0,config:t},memberDiscount:{enable:r.showMemberDiscount,config:{amount:B,description:f?.labels?.[0]}},creditsRedemption:{enable:!!c&&c>0,config:{amount:c,label:l?.creditsRedemptionLabel}},paidShipping:{enable:h,config:{}},fullGift:{enable:!!(u&&!C.includes(e.sku)),config:u??{}},levelDiscount:{enable:!!D,config:l?.levelDiscount??{}}}};
1
+ "use strict";var u=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var P=(e,n)=>{for(var i in n)u(e,i,{get:n[i],enumerable:!0})},S=(e,n,i,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of x(n))!G.call(e,o)&&o!==i&&u(e,o,{get:()=>n[o],enumerable:!(t=R(n,o))||t.enumerable});return e};var v=e=>S(u({},"__esModule",{value:!0}),e);var y={};P(y,{useBenefits:()=>w});module.exports=v(y);var m=require("../BizProductProvider.js"),p=require("../utils/helper.js"),d=require("./useDiscountEnable.js"),g=require("../../AiuiProvider/index.js");const w=({variant:e})=>{const{coupon:n,product:i,bundle:t,freeGift:o,memberFunctionResult:f,creditsRedemption:b,profile:B}=(0,m.useBizProductContext)(),{amount:c}=b??{},{trackingData:l}=(0,g.useAiuiContext)(),h=Math.max(f?.withCouponMemberTotalSave??0,f?.withoutCouponMaxMemberTotalSave??0),r=(0,d.useDiscountEnable)({profile:B,variant:e,memberFunctionResult:f,coupon:n}),C=!!(l?.paidShipping&&e.requiresShipping&&!e?.metafields?.global?.presell&&!e?.metafields?.global?.HideShipping),a=l?.freeGift,D=a?.excludeProducts?.map(s=>typeof s=="object"&&"sku"in s?s.sku:s)??[],I=l?.levelDiscount&&(0,p.checkItemAvailableForProduct)({product:i,variant:e,item:l?.levelDiscount});return{commonCoupon:{enable:r.showCommonCoupon&&!!n,config:n??{}},freeGift:{enable:!!o&&!!o?.giftList?.length,config:o},bundle:{enable:!!t&&!!t?.bundleList?.length&&Math.max(...t?.bundleList?.map(s=>s.savings??0)??[])>0,config:t},memberDiscount:{enable:r.showMemberDiscount,config:{amount:h,description:f?.labels?.[0]}},creditsRedemption:{enable:!!c&&c>0,config:{amount:c,label:l?.creditsRedemptionLabel}},paidShipping:{enable:C,config:{}},fullGift:{enable:!!(a&&!D.includes(e.sku)),config:a??{}},levelDiscount:{enable:!!I,config:l?.levelDiscount??{}}}};
2
2
  //# sourceMappingURL=useBenefits.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/biz-components/Listing/hooks/useBenefits.ts"],
4
- "sourcesContent": ["import { useBizProductContext } from '../BizProductProvider.js'\nimport type { ProductVariant, FreeGift, Bundle } from '../types/product'\nimport { checkItemAvailableForProduct } from '../utils/helper.js'\nimport { useDiscountEnable } from './useDiscountEnable.js'\n\nimport { useAiuiContext } from '../../AiuiProvider/index.js'\nimport { useMemo } from 'react'\n\ninterface BenefitsParams {\n variant: ProductVariant\n}\n\ninterface BenefitItemConfig<T extends Record<string, any> = Record<string, any>> {\n enable: boolean\n config?: T // \u539F\u59CB\u914D\u7F6E\n}\n\ninterface BenefitsResult {\n /**\n * \u901A\u7528\u4F18\u60E0\u5238\n */\n commonCoupon?: BenefitItemConfig\n /**\n * \u4E70\u8D60\n */\n freeGift: BenefitItemConfig<FreeGift>\n /**\n * \u6346\u7ED1\u6298\u6263\n */\n bundle: BenefitItemConfig<Bundle>\n /**\n * \u4F1A\u5458\u4EF7\n */\n memberDiscount: BenefitItemConfig\n /**\n * \u79EF\u5206\u62B5\u73B0\n */\n creditsRedemption: BenefitItemConfig\n /**\n * \u9AD8\u6807\u7269\u6D41\n */\n paidShipping: BenefitItemConfig\n\n /**\n * \u6EE1\u8D60\n */\n fullGift: BenefitItemConfig\n\n /**\n * \u6EE1\u51CF\u6298\u6263\n */\n levelDiscount: BenefitItemConfig\n}\n\n/**\n * \u5546\u54C1\u6743\u76CA\n * \u83B7\u53D6\u5F53\u524Dsku \u6240\u6709\u7684\u6743\u76CA\n * \u5305\u62EC \u901A\u7528\u4F18\u60E0\u5238\uFF0C\u4F1A\u5458\u4EF7\uFF0C\u6EE1\u51CF\uFF0C\u6346\u7ED1\u6298\u6263\uFF0C\u4E70\u8D60 \uFF0C\u6EE1\u8D60 \uFF0C\u79EF\u5206\u62B5\u73B0\n * @returns\n */\nexport const useBenefits = ({ variant }: BenefitsParams): BenefitsResult => {\n const { coupon, product, bundle, freeGift, memberFunctionResult, creditsRedemptionAmount, profile } =\n useBizProductContext()\n\n const { trackingData } = useAiuiContext()\n\n const total = Math.max(\n memberFunctionResult?.withCouponMemberTotalSave ?? 0,\n memberFunctionResult?.withoutCouponMaxMemberTotalSave ?? 0\n )\n\n const discountEnable = useDiscountEnable({ profile, variant, memberFunctionResult, coupon })\n\n // \u9AD8\u6807\u7269\u6D41\n const showPaidShipping = Boolean(\n trackingData?.paidShipping &&\n variant.requiresShipping &&\n !variant?.metafields?.global?.presell &&\n !variant?.metafields?.global?.HideShipping\n )\n\n // \u811A\u672C\u6EE1\u8D60\n const fullGift = trackingData?.freeGift\n const excludeProducts =\n fullGift?.excludeProducts?.map((item: any) => (typeof item === 'object' && 'sku' in item ? item.sku : item)) ?? []\n\n const showLevelDiscount =\n trackingData?.levelDiscount && checkItemAvailableForProduct({ product, variant, item: trackingData?.levelDiscount })\n\n return {\n commonCoupon: {\n enable: discountEnable.showCommonCoupon && Boolean(coupon),\n config: coupon ?? {},\n },\n freeGift: {\n enable: Boolean(freeGift) && !!freeGift?.giftList?.length,\n config: freeGift,\n },\n bundle: {\n enable:\n Boolean(bundle) &&\n !!bundle?.bundleList?.length &&\n Math.max(...(bundle?.bundleList?.map(item => item.savings ?? 0) ?? [])) > 0, // \u6709\u4F18\u60E0\u624D\u5C55\u793A\n config: bundle,\n },\n memberDiscount: {\n enable: discountEnable.showMemberDiscount,\n // enable: total > 0,\n config: {\n amount: total,\n description: memberFunctionResult?.labels?.[0],\n },\n },\n creditsRedemption: {\n enable: Boolean(creditsRedemptionAmount) && creditsRedemptionAmount! > 0,\n config: { amount: creditsRedemptionAmount, label: trackingData?.creditsRedemptionLabel },\n },\n paidShipping: {\n enable: showPaidShipping,\n config: {},\n },\n fullGift: {\n enable: Boolean(fullGift && !excludeProducts.includes(variant.sku)),\n config: fullGift ?? {},\n },\n levelDiscount: {\n enable: Boolean(showLevelDiscount),\n config: trackingData?.levelDiscount ?? {},\n },\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAqC,oCAErCC,EAA6C,8BAC7CC,EAAkC,kCAElCC,EAA+B,uCAC/BC,EAAwB,iBAsDjB,MAAMN,EAAc,CAAC,CAAE,QAAAO,CAAQ,IAAsC,CAC1E,KAAM,CAAE,OAAAC,EAAQ,QAAAC,EAAS,OAAAC,EAAQ,SAAAC,EAAU,qBAAAC,EAAsB,wBAAAC,EAAyB,QAAAC,CAAQ,KAChG,wBAAqB,EAEjB,CAAE,aAAAC,CAAa,KAAI,kBAAe,EAElCC,EAAQ,KAAK,IACjBJ,GAAsB,2BAA6B,EACnDA,GAAsB,iCAAmC,CAC3D,EAEMK,KAAiB,qBAAkB,CAAE,QAAAH,EAAS,QAAAP,EAAS,qBAAAK,EAAsB,OAAAJ,CAAO,CAAC,EAGrFU,EAAmB,GACvBH,GAAc,cACZR,EAAQ,kBACR,CAACA,GAAS,YAAY,QAAQ,SAC9B,CAACA,GAAS,YAAY,QAAQ,cAI5BY,EAAWJ,GAAc,SACzBK,EACJD,GAAU,iBAAiB,IAAKE,GAAe,OAAOA,GAAS,UAAY,QAASA,EAAOA,EAAK,IAAMA,CAAK,GAAK,CAAC,EAE7GC,EACJP,GAAc,kBAAiB,gCAA6B,CAAE,QAAAN,EAAS,QAAAF,EAAS,KAAMQ,GAAc,aAAc,CAAC,EAErH,MAAO,CACL,aAAc,CACZ,OAAQE,EAAe,kBAAoB,EAAQT,EACnD,OAAQA,GAAU,CAAC,CACrB,EACA,SAAU,CACR,OAAQ,EAAQG,GAAa,CAAC,CAACA,GAAU,UAAU,OACnD,OAAQA,CACV,EACA,OAAQ,CACN,OACE,EAAQD,GACR,CAAC,CAACA,GAAQ,YAAY,QACtB,KAAK,IAAI,GAAIA,GAAQ,YAAY,IAAIW,GAAQA,EAAK,SAAW,CAAC,GAAK,CAAC,CAAE,EAAI,EAC5E,OAAQX,CACV,EACA,eAAgB,CACd,OAAQO,EAAe,mBAEvB,OAAQ,CACN,OAAQD,EACR,YAAaJ,GAAsB,SAAS,CAAC,CAC/C,CACF,EACA,kBAAmB,CACjB,OAAQ,EAAQC,GAA4BA,EAA2B,EACvE,OAAQ,CAAE,OAAQA,EAAyB,MAAOE,GAAc,sBAAuB,CACzF,EACA,aAAc,CACZ,OAAQG,EACR,OAAQ,CAAC,CACX,EACA,SAAU,CACR,OAAQ,GAAQC,GAAY,CAACC,EAAgB,SAASb,EAAQ,GAAG,GACjE,OAAQY,GAAY,CAAC,CACvB,EACA,cAAe,CACb,OAAQ,EAAQG,EAChB,OAAQP,GAAc,eAAiB,CAAC,CAC1C,CACF,CACF",
6
- "names": ["useBenefits_exports", "__export", "useBenefits", "__toCommonJS", "import_BizProductProvider", "import_helper", "import_useDiscountEnable", "import_AiuiProvider", "import_react", "variant", "coupon", "product", "bundle", "freeGift", "memberFunctionResult", "creditsRedemptionAmount", "profile", "trackingData", "total", "discountEnable", "showPaidShipping", "fullGift", "excludeProducts", "item", "showLevelDiscount"]
4
+ "sourcesContent": ["import { useBizProductContext } from '../BizProductProvider.js'\nimport type { ProductVariant, FreeGift, Bundle } from '../types/product'\nimport { checkItemAvailableForProduct } from '../utils/helper.js'\nimport { useDiscountEnable } from './useDiscountEnable.js'\n\nimport { useAiuiContext } from '../../AiuiProvider/index.js'\n\ninterface BenefitsParams {\n variant: ProductVariant\n}\n\ninterface BenefitItemConfig<T extends Record<string, any> = Record<string, any>> {\n enable: boolean\n config?: T // \u539F\u59CB\u914D\u7F6E\n}\n\ninterface BenefitsResult {\n /**\n * \u901A\u7528\u4F18\u60E0\u5238\n */\n commonCoupon?: BenefitItemConfig\n /**\n * \u4E70\u8D60\n */\n freeGift: BenefitItemConfig<FreeGift>\n /**\n * \u6346\u7ED1\u6298\u6263\n */\n bundle: BenefitItemConfig<Bundle>\n /**\n * \u4F1A\u5458\u4EF7\n */\n memberDiscount: BenefitItemConfig\n /**\n * \u79EF\u5206\u62B5\u73B0\n */\n creditsRedemption: BenefitItemConfig\n /**\n * \u9AD8\u6807\u7269\u6D41\n */\n paidShipping: BenefitItemConfig\n\n /**\n * \u6EE1\u8D60\n */\n fullGift: BenefitItemConfig\n\n /**\n * \u6EE1\u51CF\u6298\u6263\n */\n levelDiscount: BenefitItemConfig\n}\n\n/**\n * \u5546\u54C1\u6743\u76CA\n * \u83B7\u53D6\u5F53\u524Dsku \u6240\u6709\u7684\u6743\u76CA\n * \u5305\u62EC \u901A\u7528\u4F18\u60E0\u5238\uFF0C\u4F1A\u5458\u4EF7\uFF0C\u6EE1\u51CF\uFF0C\u6346\u7ED1\u6298\u6263\uFF0C\u4E70\u8D60 \uFF0C\u6EE1\u8D60 \uFF0C\u79EF\u5206\u62B5\u73B0\n * @returns\n */\nexport const useBenefits = ({ variant }: BenefitsParams): BenefitsResult => {\n const { coupon, product, bundle, freeGift, memberFunctionResult, creditsRedemption, profile } = useBizProductContext()\n\n const { amount: creditsRedemptionAmount } = creditsRedemption ?? {}\n\n const { trackingData } = useAiuiContext()\n\n const total = Math.max(\n memberFunctionResult?.withCouponMemberTotalSave ?? 0,\n memberFunctionResult?.withoutCouponMaxMemberTotalSave ?? 0\n )\n\n const discountEnable = useDiscountEnable({ profile, variant, memberFunctionResult, coupon })\n\n // \u9AD8\u6807\u7269\u6D41\n const showPaidShipping = Boolean(\n trackingData?.paidShipping &&\n variant.requiresShipping &&\n !variant?.metafields?.global?.presell &&\n !variant?.metafields?.global?.HideShipping\n )\n\n // \u811A\u672C\u6EE1\u8D60\n const fullGift = trackingData?.freeGift\n const excludeProducts =\n fullGift?.excludeProducts?.map((item: any) => (typeof item === 'object' && 'sku' in item ? item.sku : item)) ?? []\n\n const showLevelDiscount =\n trackingData?.levelDiscount && checkItemAvailableForProduct({ product, variant, item: trackingData?.levelDiscount })\n\n return {\n commonCoupon: {\n enable: discountEnable.showCommonCoupon && Boolean(coupon),\n config: coupon ?? {},\n },\n freeGift: {\n enable: Boolean(freeGift) && !!freeGift?.giftList?.length,\n config: freeGift,\n },\n bundle: {\n enable:\n Boolean(bundle) &&\n !!bundle?.bundleList?.length &&\n Math.max(...(bundle?.bundleList?.map(item => item.savings ?? 0) ?? [])) > 0, // \u6709\u4F18\u60E0\u624D\u5C55\u793A\n config: bundle,\n },\n memberDiscount: {\n enable: discountEnable.showMemberDiscount,\n // enable: total > 0,\n config: {\n amount: total,\n description: memberFunctionResult?.labels?.[0],\n },\n },\n creditsRedemption: {\n enable: Boolean(creditsRedemptionAmount) && creditsRedemptionAmount! > 0,\n config: { amount: creditsRedemptionAmount, label: trackingData?.creditsRedemptionLabel },\n },\n paidShipping: {\n enable: showPaidShipping,\n config: {},\n },\n fullGift: {\n enable: Boolean(fullGift && !excludeProducts.includes(variant.sku)),\n config: fullGift ?? {},\n },\n levelDiscount: {\n enable: Boolean(showLevelDiscount),\n config: trackingData?.levelDiscount ?? {},\n },\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,iBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAqC,oCAErCC,EAA6C,8BAC7CC,EAAkC,kCAElCC,EAA+B,uCAsDxB,MAAML,EAAc,CAAC,CAAE,QAAAM,CAAQ,IAAsC,CAC1E,KAAM,CAAE,OAAAC,EAAQ,QAAAC,EAAS,OAAAC,EAAQ,SAAAC,EAAU,qBAAAC,EAAsB,kBAAAC,EAAmB,QAAAC,CAAQ,KAAI,wBAAqB,EAE/G,CAAE,OAAQC,CAAwB,EAAIF,GAAqB,CAAC,EAE5D,CAAE,aAAAG,CAAa,KAAI,kBAAe,EAElCC,EAAQ,KAAK,IACjBL,GAAsB,2BAA6B,EACnDA,GAAsB,iCAAmC,CAC3D,EAEMM,KAAiB,qBAAkB,CAAE,QAAAJ,EAAS,QAAAP,EAAS,qBAAAK,EAAsB,OAAAJ,CAAO,CAAC,EAGrFW,EAAmB,GACvBH,GAAc,cACZT,EAAQ,kBACR,CAACA,GAAS,YAAY,QAAQ,SAC9B,CAACA,GAAS,YAAY,QAAQ,cAI5Ba,EAAWJ,GAAc,SACzBK,EACJD,GAAU,iBAAiB,IAAKE,GAAe,OAAOA,GAAS,UAAY,QAASA,EAAOA,EAAK,IAAMA,CAAK,GAAK,CAAC,EAE7GC,EACJP,GAAc,kBAAiB,gCAA6B,CAAE,QAAAP,EAAS,QAAAF,EAAS,KAAMS,GAAc,aAAc,CAAC,EAErH,MAAO,CACL,aAAc,CACZ,OAAQE,EAAe,kBAAoB,EAAQV,EACnD,OAAQA,GAAU,CAAC,CACrB,EACA,SAAU,CACR,OAAQ,EAAQG,GAAa,CAAC,CAACA,GAAU,UAAU,OACnD,OAAQA,CACV,EACA,OAAQ,CACN,OACE,EAAQD,GACR,CAAC,CAACA,GAAQ,YAAY,QACtB,KAAK,IAAI,GAAIA,GAAQ,YAAY,IAAIY,GAAQA,EAAK,SAAW,CAAC,GAAK,CAAC,CAAE,EAAI,EAC5E,OAAQZ,CACV,EACA,eAAgB,CACd,OAAQQ,EAAe,mBAEvB,OAAQ,CACN,OAAQD,EACR,YAAaL,GAAsB,SAAS,CAAC,CAC/C,CACF,EACA,kBAAmB,CACjB,OAAQ,EAAQG,GAA4BA,EAA2B,EACvE,OAAQ,CAAE,OAAQA,EAAyB,MAAOC,GAAc,sBAAuB,CACzF,EACA,aAAc,CACZ,OAAQG,EACR,OAAQ,CAAC,CACX,EACA,SAAU,CACR,OAAQ,GAAQC,GAAY,CAACC,EAAgB,SAASd,EAAQ,GAAG,GACjE,OAAQa,GAAY,CAAC,CACvB,EACA,cAAe,CACb,OAAQ,EAAQG,EAChB,OAAQP,GAAc,eAAiB,CAAC,CAC1C,CACF,CACF",
6
+ "names": ["useBenefits_exports", "__export", "useBenefits", "__toCommonJS", "import_BizProductProvider", "import_helper", "import_useDiscountEnable", "import_AiuiProvider", "variant", "coupon", "product", "bundle", "freeGift", "memberFunctionResult", "creditsRedemption", "profile", "creditsRedemptionAmount", "trackingData", "total", "discountEnable", "showPaidShipping", "fullGift", "excludeProducts", "item", "showLevelDiscount"]
7
7
  }
@@ -1,3 +0,0 @@
1
- import { type ProductContextType } from './BizProductProvider.js';
2
- declare const Listing: React.FC<Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts'>>;
3
- export default Listing;
@@ -1,2 +1,2 @@
1
- "use strict";var T=Object.create;var c=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var Q=(e,t)=>{for(var o in t)c(e,o,{get:t[o],enumerable:!0})},p=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of j(t))!J.call(e,n)&&n!==o&&c(e,n,{get:()=>t[n],enumerable:!(r=q(t,n))||r.enumerable});return e};var V=(e,t,o)=>(o=e!=null?T(F(e)):{},p(t||!e||!e.__esModule?c(o,"default",{value:e,enumerable:!0}):o,e)),E=e=>p(c({},"__esModule",{value:!0}),e);var K={};Q(K,{default:()=>H});module.exports=E(K);var i=require("react/jsx-runtime"),m=require("../AiuiProvider/index.js"),d=require("./components/index.js"),u=V(require("./BizProductProvider.js")),y=require("./components/index.js"),s=require("react-responsive");const l=({product:e,renderRating:t,variant:o,selectedOptions:r,setSelectedOptions:n,isLogin:U,finalPrice:P,coupon:f,comparePrice:v,totalSavings:C,savingDetail:S,freeGift:g,bundle:h,checkedBundle:k,checkedGift:B,setCheckedBundle:N,setCheckedGift:x,compareData:I,selectedVariants:D,onAddToCart:b,onBuyNow:w,openModal:A,setSavingDetail:M,openSignInPopup:R,openAuthCodePopup:z,renderInstallments:G})=>{const{locale:W}=(0,m.useAiuiContext)(),a=(0,s.useMediaQuery)({query:"(max-width: 768px)"}),L=(0,s.useMediaQuery)({query:"(min-width: 1440px)"});return(0,i.jsx)(u.default,{product:e,isMobile:a,isDesktop:L,freeGift:g,renderRating:t,finalPrice:P,comparePrice:v,totalSavings:C,savingDetail:S,variant:o,selectedOptions:r,setSelectedOptions:n,bundle:h,coupon:f,checkedBundle:k,checkedGift:B,setCheckedBundle:N,setCheckedGift:x,compareData:I,selectedVariants:D,onAddToCart:b,onBuyNow:w,openModal:A,setSavingDetail:M,openSignInPopup:R,openAuthCodePopup:z,renderInstallments:G,children:(0,i.jsxs)("div",{id:"ipc-listing",children:[(0,i.jsx)(d.PurchaseBar,{onSpyNavItemClick:O=>{console.log(O)}}),a&&(0,i.jsx)("div",{className:"fixed bottom-0 left-0 z-[60] w-full",children:(0,i.jsx)(d.ProductActions,{})}),(0,i.jsx)(y.ProductCard,{})]})})};l.displayName="Listing";var H=l;
1
+ "use strict";
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../src/biz-components/Listing/index.tsx"],
4
- "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { PurchaseBar, ProductActions } from './components/index.js'\nimport type { ScrollSpyNavItem } from './components/PurchaseBar/types.js'\nimport BizProductProvider, { type ProductContextType } from './BizProductProvider.js'\nimport { ProductCard } from './components/index.js'\n\nimport { useMediaQuery } from 'react-responsive'\n\nconst Listing: React.FC<Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts'>> = ({\n product,\n renderRating,\n variant,\n selectedOptions,\n setSelectedOptions,\n isLogin,\n finalPrice,\n coupon,\n comparePrice,\n totalSavings,\n savingDetail,\n freeGift,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n openModal,\n setSavingDetail,\n openSignInPopup,\n openAuthCodePopup,\n renderInstallments,\n}) => {\n const { locale } = useAiuiContext()\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isDesktop = useMediaQuery({ query: '(min-width: 1440px)' })\n\n const onSpyNavItemClick = (tab: ScrollSpyNavItem) => {\n console.log(tab)\n }\n\n return (\n <BizProductProvider\n product={product}\n isMobile={isMobile}\n isDesktop={isDesktop}\n freeGift={freeGift}\n renderRating={renderRating}\n finalPrice={finalPrice}\n comparePrice={comparePrice}\n totalSavings={totalSavings}\n savingDetail={savingDetail}\n variant={variant}\n selectedOptions={selectedOptions}\n setSelectedOptions={setSelectedOptions}\n bundle={bundle}\n coupon={coupon}\n checkedBundle={checkedBundle}\n checkedGift={checkedGift}\n setCheckedBundle={setCheckedBundle}\n setCheckedGift={setCheckedGift}\n compareData={compareData}\n selectedVariants={selectedVariants}\n onAddToCart={onAddToCart}\n onBuyNow={onBuyNow}\n openModal={openModal}\n setSavingDetail={setSavingDetail}\n openSignInPopup={openSignInPopup}\n openAuthCodePopup={openAuthCodePopup}\n renderInstallments={renderInstallments}\n >\n <div id=\"ipc-listing\">\n <PurchaseBar onSpyNavItemClick={onSpyNavItemClick} />\n {isMobile && (\n <div className=\"fixed bottom-0 left-0 z-[60] w-full\">\n <ProductActions />\n </div>\n )}\n <ProductCard />\n </div>\n </BizProductProvider>\n )\n}\n\nListing.displayName = 'Listing'\n\nexport default Listing\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2EM,IAAAI,EAAA,6BA3ENC,EAA+B,oCAC/BC,EAA4C,iCAE5CC,EAA4D,sCAC5DD,EAA4B,iCAE5BE,EAA8B,4BAE9B,MAAMC,EAA8G,CAAC,CACnH,QAAAC,EACA,aAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,QAAAC,EACA,WAAAC,EACA,OAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,mBAAAC,CACF,IAAM,CACJ,KAAM,CAAE,OAAAC,CAAO,KAAI,kBAAe,EAE5BC,KAAW,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EACxDC,KAAY,iBAAc,CAAE,MAAO,qBAAsB,CAAC,EAMhE,SACE,OAAC,EAAAC,QAAA,CACC,QAAS7B,EACT,SAAU2B,EACV,UAAWC,EACX,SAAUjB,EACV,aAAcV,EACd,WAAYK,EACZ,aAAcE,EACd,aAAcC,EACd,aAAcC,EACd,QAASR,EACT,gBAAiBC,EACjB,mBAAoBC,EACpB,OAAQQ,EACR,OAAQL,EACR,cAAeM,EACf,YAAaC,EACb,iBAAkBC,EAClB,eAAgBC,EAChB,YAAaC,EACb,iBAAkBC,EAClB,YAAaC,EACb,SAAUC,EACV,UAAWC,EACX,gBAAiBC,EACjB,gBAAiBC,EACjB,kBAAmBC,EACnB,mBAAoBC,EAEpB,oBAAC,OAAI,GAAG,cACN,oBAAC,eAAY,kBAnCQK,GAA0B,CACnD,QAAQ,IAAIA,CAAG,CACjB,EAiCyD,EAClDH,MACC,OAAC,OAAI,UAAU,sCACb,mBAAC,mBAAe,EAClB,KAEF,OAAC,gBAAY,GACf,EACF,CAEJ,EAEA5B,EAAQ,YAAc,UAEtB,IAAOP,EAAQO",
6
- "names": ["Listing_exports", "__export", "Listing_default", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_components", "import_BizProductProvider", "import_react_responsive", "Listing", "product", "renderRating", "variant", "selectedOptions", "setSelectedOptions", "isLogin", "finalPrice", "coupon", "comparePrice", "totalSavings", "savingDetail", "freeGift", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "compareData", "selectedVariants", "onAddToCart", "onBuyNow", "openModal", "setSavingDetail", "openSignInPopup", "openAuthCodePopup", "renderInstallments", "locale", "isMobile", "isDesktop", "BizProductProvider", "tab"]
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
7
  }
@@ -32,7 +32,6 @@ export { default as CreativeModule } from './CreativeModule/index.js';
32
32
  export { default as GraphicOverlay } from './GraphicOverlay/index.js';
33
33
  export { default as Specs } from './Specs/index.js';
34
34
  export { default as TabGroup } from './TabsGroup/index.js';
35
- export { default as Listing } from './Listing/index.js';
36
35
  export { default as BizProductProvider } from './Listing/BizProductProvider.js';
37
36
  export { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js';
38
37
  export { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js';
@@ -1,2 +1,2 @@
1
- "use strict";var ce=Object.create;var l=Object.defineProperty;var ue=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var de=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty;var xe=(a,r)=>{for(var t in r)l(a,t,{get:r[t],enumerable:!0})},c=(a,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of se(r))!me.call(a,p)&&p!==t&&l(a,p,{get:()=>r[p],enumerable:!(i=ue(r,p))||i.enumerable});return a};var e=(a,r,t)=>(t=a!=null?ce(de(a)):{},c(r||!a||!a.__esModule?l(t,"default",{value:a,enumerable:!0}):t,a)),ne=a=>c(l({},"__esModule",{value:!0}),a);var ye={};xe(ye,{AccordionCards:()=>g.default,AiuiProvider:()=>D.default,AplusDesc:()=>oe.default,BenefitsTab:()=>ee.default,BizProductProvider:()=>j.default,BrandEquity:()=>u.default,Category:()=>y.default,CreativeModule:()=>O.default,DownLoad:()=>fe.default,Evaluate:()=>h.default,Faq:()=>C.default,Features:()=>te.default,FootCharger:()=>ie.default,FooterNavigation:()=>T.default,GiftBox:()=>pe.default,Graphic:()=>M.default,GraphicAttractionBlock:()=>k.default,GraphicMore:()=>re.default,GraphicOverlay:()=>w.default,HeaderNavigation:()=>A.default,HeroBanner:()=>P.default,IPC_SEARCH_PAGE:()=>f.IPC_SEARCH_PAGE,Listing:()=>_.default,Marquee:()=>b.default,MarqueeImageContent:()=>o.MarqueeImageContent,MarqueeItem:()=>o.MarqueeItem,MarqueeTextContent:()=>o.MarqueeTextContent,MediaPlayerBase:()=>B.default,MediaPlayerMulti:()=>G.default,MediaPlayerSticky:()=>S.default,MemberEquity:()=>s.default,MultiLayoutGraphicBlock:()=>v.default,PAYLOAD_COMPONENT_MAP:()=>he,PaidShipping:()=>ae.default,ProductActions:()=>W.default,ProductBenefitsTabs:()=>R.default,ProductBundle:()=>U.default,ProductCard:()=>z.default,ProductDetail:()=>Z.default,ProductExchangePurchase:()=>K.default,ProductFreeGift:()=>J.default,ProductGallery:()=>X.default,ProductGridBox:()=>V.default,ProductHighlight:()=>Y.default,ProductOptions:()=>Q.default,ProductSummary:()=>$.default,PurchaseBar:()=>I.default,SearchPage:()=>E.default,SearchPageTabType:()=>f.SearchPageTabType,SelectStore:()=>le.default,ShelfDisplay:()=>n.default,Slogan:()=>d.default,Spacer:()=>x.default,Specs:()=>H.default,TabGroup:()=>N.default,Tabs:()=>F.default,Title:()=>m.default,WhyChoose:()=>q.default,withLayout:()=>L.withLayout});module.exports=ne(ye);var u=e(require("./BrandEquity/index.js")),s=e(require("./MemberEquity/index.js")),d=e(require("./Slogan/index.js")),m=e(require("./Title/index.js")),x=e(require("./Spacer/index.js")),n=e(require("./ShelfDisplay/index.js")),h=e(require("./Evaluate/index.js")),y=e(require("./Category/index.js")),P=e(require("./HeroBanner/index.js")),g=e(require("./AccordionCards/index.js")),M=e(require("./Graphic/index.js")),B=e(require("./MediaPlayerBase/index.js")),S=e(require("./MediaPlayerSticky/index.js")),G=e(require("./MediaPlayerMulti/index.js")),b=e(require("./Marquee/index.js")),q=e(require("./WhyChoose/index.js")),C=e(require("./Faq/index.js")),o=require("./Marquee/index.js"),v=e(require("./MultiLayoutGraphicBlock/index.js")),k=e(require("./GraphicAttractionBlock/index.js")),A=e(require("./HeaderNavigation/index.js")),T=e(require("./FooterNavigation/index.js")),E=e(require("./SearchPage/index.js")),f=require("./SearchPage/types.js"),L=require("../shared/Styles.js"),D=e(require("./AiuiProvider/index.js")),F=e(require("./Tabs/index.js")),O=e(require("./CreativeModule/index.js")),w=e(require("./GraphicOverlay/index.js")),H=e(require("./Specs/index.js")),N=e(require("./TabsGroup/index.js")),_=e(require("./Listing/index.js")),j=e(require("./Listing/BizProductProvider.js")),I=e(require("./Listing/components/PurchaseBar/index.js")),W=e(require("./Listing/components/PurchaseBar/ProductActions/index.js")),z=e(require("./Listing/components/ProductCard/index.js")),R=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js")),Y=e(require("./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js")),J=e(require("./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js")),K=e(require("./Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js")),Q=e(require("./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js")),U=e(require("./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js")),V=e(require("./Listing/components/ProductCard/ProductGridBox.js")),X=e(require("./Listing/components/ProductCard/ProductGallery/index.js")),Z=e(require("./Listing/components/ProductCard/ProductDetail/index.js")),$=e(require("./Listing/components/ProductCard/ProductSummary/index.js")),ee=e(require("./Listing/components/ProductCard/ProductDetail/BenefitsTab.js")),ae=e(require("./Listing/components/PaidShipping/index.js")),re=e(require("./GraphicMore/index.js")),te=e(require("./Features/index.js")),oe=e(require("./AplusDesc/index.js")),pe=e(require("./GiftBox/index.js")),le=e(require("./SelectStore/index.js")),fe=e(require("./DownLoad/index.js")),ie=e(require("./FootCharger/index.js"));const he={"ipc-aplusdesc":"AplusDesc","ipc-banner":"Banner","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-collection-banner":"CollectionBanner","ipc-collection-shelves":"CollectionShelves","ipc-creativemodule":"CreativeModule","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-marquee":"Marquee","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-search-page-tabs":"SearchPageBlock","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-text-marquee":"TextMarquee","ipc-title":"Title","ipc-whychoose":"WhyChoose"};
1
+ "use strict";var ie=Object.create;var l=Object.defineProperty;var ce=Object.getOwnPropertyDescriptor;var ue=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,de=Object.prototype.hasOwnProperty;var me=(a,r)=>{for(var t in r)l(a,t,{get:r[t],enumerable:!0})},c=(a,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of ue(r))!de.call(a,p)&&p!==t&&l(a,p,{get:()=>r[p],enumerable:!(i=ce(r,p))||i.enumerable});return a};var e=(a,r,t)=>(t=a!=null?ie(se(a)):{},c(r||!a||!a.__esModule?l(t,"default",{value:a,enumerable:!0}):t,a)),xe=a=>c(l({},"__esModule",{value:!0}),a);var ne={};me(ne,{AccordionCards:()=>g.default,AiuiProvider:()=>F.default,AplusDesc:()=>te.default,BenefitsTab:()=>$.default,BizProductProvider:()=>_.default,BrandEquity:()=>u.default,Category:()=>y.default,CreativeModule:()=>O.default,DownLoad:()=>le.default,Evaluate:()=>n.default,Faq:()=>C.default,Features:()=>re.default,FootCharger:()=>fe.default,FooterNavigation:()=>T.default,GiftBox:()=>oe.default,Graphic:()=>M.default,GraphicAttractionBlock:()=>k.default,GraphicMore:()=>ae.default,GraphicOverlay:()=>w.default,HeaderNavigation:()=>A.default,HeroBanner:()=>P.default,IPC_SEARCH_PAGE:()=>f.IPC_SEARCH_PAGE,Marquee:()=>b.default,MarqueeImageContent:()=>o.MarqueeImageContent,MarqueeItem:()=>o.MarqueeItem,MarqueeTextContent:()=>o.MarqueeTextContent,MediaPlayerBase:()=>B.default,MediaPlayerMulti:()=>G.default,MediaPlayerSticky:()=>S.default,MemberEquity:()=>s.default,MultiLayoutGraphicBlock:()=>v.default,PAYLOAD_COMPONENT_MAP:()=>he,PaidShipping:()=>ee.default,ProductActions:()=>I.default,ProductBenefitsTabs:()=>z.default,ProductBundle:()=>Q.default,ProductCard:()=>W.default,ProductDetail:()=>X.default,ProductExchangePurchase:()=>J.default,ProductFreeGift:()=>Y.default,ProductGallery:()=>V.default,ProductGridBox:()=>U.default,ProductHighlight:()=>R.default,ProductOptions:()=>K.default,ProductSummary:()=>Z.default,PurchaseBar:()=>j.default,SearchPage:()=>E.default,SearchPageTabType:()=>f.SearchPageTabType,SelectStore:()=>pe.default,ShelfDisplay:()=>h.default,Slogan:()=>d.default,Spacer:()=>x.default,Specs:()=>H.default,TabGroup:()=>N.default,Tabs:()=>L.default,Title:()=>m.default,WhyChoose:()=>q.default,withLayout:()=>D.withLayout});module.exports=xe(ne);var u=e(require("./BrandEquity/index.js")),s=e(require("./MemberEquity/index.js")),d=e(require("./Slogan/index.js")),m=e(require("./Title/index.js")),x=e(require("./Spacer/index.js")),h=e(require("./ShelfDisplay/index.js")),n=e(require("./Evaluate/index.js")),y=e(require("./Category/index.js")),P=e(require("./HeroBanner/index.js")),g=e(require("./AccordionCards/index.js")),M=e(require("./Graphic/index.js")),B=e(require("./MediaPlayerBase/index.js")),S=e(require("./MediaPlayerSticky/index.js")),G=e(require("./MediaPlayerMulti/index.js")),b=e(require("./Marquee/index.js")),q=e(require("./WhyChoose/index.js")),C=e(require("./Faq/index.js")),o=require("./Marquee/index.js"),v=e(require("./MultiLayoutGraphicBlock/index.js")),k=e(require("./GraphicAttractionBlock/index.js")),A=e(require("./HeaderNavigation/index.js")),T=e(require("./FooterNavigation/index.js")),E=e(require("./SearchPage/index.js")),f=require("./SearchPage/types.js"),D=require("../shared/Styles.js"),F=e(require("./AiuiProvider/index.js")),L=e(require("./Tabs/index.js")),O=e(require("./CreativeModule/index.js")),w=e(require("./GraphicOverlay/index.js")),H=e(require("./Specs/index.js")),N=e(require("./TabsGroup/index.js")),_=e(require("./Listing/BizProductProvider.js")),j=e(require("./Listing/components/PurchaseBar/index.js")),I=e(require("./Listing/components/PurchaseBar/ProductActions/index.js")),W=e(require("./Listing/components/ProductCard/index.js")),z=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js")),R=e(require("./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js")),Y=e(require("./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js")),J=e(require("./Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js")),K=e(require("./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js")),Q=e(require("./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js")),U=e(require("./Listing/components/ProductCard/ProductGridBox.js")),V=e(require("./Listing/components/ProductCard/ProductGallery/index.js")),X=e(require("./Listing/components/ProductCard/ProductDetail/index.js")),Z=e(require("./Listing/components/ProductCard/ProductSummary/index.js")),$=e(require("./Listing/components/ProductCard/ProductDetail/BenefitsTab.js")),ee=e(require("./Listing/components/PaidShipping/index.js")),ae=e(require("./GraphicMore/index.js")),re=e(require("./Features/index.js")),te=e(require("./AplusDesc/index.js")),oe=e(require("./GiftBox/index.js")),pe=e(require("./SelectStore/index.js")),le=e(require("./DownLoad/index.js")),fe=e(require("./FootCharger/index.js"));const he={"ipc-aplusdesc":"AplusDesc","ipc-banner":"Banner","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-collection-banner":"CollectionBanner","ipc-collection-shelves":"CollectionShelves","ipc-creativemodule":"CreativeModule","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-marquee":"Marquee","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-search-page-tabs":"SearchPageBlock","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-text-marquee":"TextMarquee","ipc-title":"Title","ipc-whychoose":"WhyChoose"};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/biz-components/index.ts"],
4
- "sourcesContent": ["export { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as Title } from './Title/index.js'\nexport { default as Spacer } from './Spacer/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport { default as MediaPlayerBase } from './MediaPlayerBase/index.js'\nexport { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js'\nexport { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js'\nexport { default as Marquee } from './Marquee/index.js'\nexport { default as WhyChoose } from './WhyChoose/index.js'\nexport { default as Faq } from './Faq/index.js'\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js'\nexport { default as MultiLayoutGraphicBlock } from './MultiLayoutGraphicBlock/index.js'\nexport type { MultiLayoutGraphicBlockProps } from './MultiLayoutGraphicBlock/index.js'\nexport { default as GraphicAttractionBlock } from './GraphicAttractionBlock/index.js'\nexport type { GraphicAttractionBlockProps } from './GraphicAttractionBlock/index.js'\nexport { default as HeaderNavigation } from './HeaderNavigation/index.js'\nexport { default as FooterNavigation } from './FooterNavigation/index.js'\nexport { default as SearchPage } from './SearchPage/index.js'\nexport type { SearchPageProps } from './SearchPage/types.js'\nexport { IPC_SEARCH_PAGE, SearchPageTabType } from './SearchPage/types.js'\n\nexport { withLayout } from '../shared/Styles.js'\nexport { default as AiuiProvider } from './AiuiProvider/index.js'\nexport { default as Tabs } from './Tabs/index.js'\nexport { default as CreativeModule } from './CreativeModule/index.js'\nexport { default as GraphicOverlay } from './GraphicOverlay/index.js'\nexport { default as Specs } from './Specs/index.js'\nexport { default as TabGroup } from './TabsGroup/index.js'\n\nexport { default as Listing } from './Listing/index.js'\nexport { default as BizProductProvider } from './Listing/BizProductProvider.js'\nexport { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js'\nexport { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './Listing/components/ProductCard/index.js'\nexport { default as ProductBenefitsTabs } from './Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js'\nexport { default as ProductHighlight } from './Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js'\nexport { default as ProductFreeGift } from './Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js'\nexport { default as ProductExchangePurchase } from './Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js'\nexport { default as ProductOptions } from './Listing/components/ProductCard/ProductDetail/ProductOptions/index.js'\nexport { default as ProductBundle } from './Listing/components/ProductCard/ProductDetail/ProductBundle/index.js'\nexport { default as ProductGridBox } from './Listing/components/ProductCard/ProductGridBox.js'\nexport { default as ProductGallery } from './Listing/components/ProductCard/ProductGallery/index.js'\nexport { default as ProductDetail } from './Listing/components/ProductCard/ProductDetail/index.js'\nexport { default as ProductSummary } from './Listing/components/ProductCard/ProductSummary/index.js'\nexport { default as BenefitsTab } from './Listing/components/ProductCard/ProductDetail/BenefitsTab.js'\nexport { default as PaidShipping } from './Listing/components/PaidShipping/index.js'\n\nexport { default as GraphicMore } from './GraphicMore/index.js'\nexport { default as Features } from './Features/index.js'\nexport { default as AplusDesc } from './AplusDesc/index.js'\nexport { default as GiftBox } from './GiftBox/index.js'\nexport { default as SelectStore } from './SelectStore/index.js'\nexport { default as DownLoad } from './DownLoad/index.js'\nexport { default as FootCharger } from './FootCharger/index.js'\n\nexport const PAYLOAD_COMPONENT_MAP = {\n 'ipc-aplusdesc': 'AplusDesc',\n 'ipc-banner': 'Banner',\n 'ipc-brand-equity': 'BrandEquity',\n 'ipc-category': 'Category',\n 'ipc-collection-banner': 'CollectionBanner',\n 'ipc-collection-shelves': 'CollectionShelves',\n 'ipc-creativemodule': 'CreativeModule',\n 'ipc-download': 'DownLoad',\n 'ipc-evaluate': 'Evaluate',\n 'ipc-faq': 'Faq',\n 'ipc-features': 'Features',\n 'ipc-footcharger': 'FootCharger',\n 'ipc-ga-block': 'GraphicAttractionBlock',\n 'ipc-giftbox': 'GiftBox',\n 'ipc-graphic': 'Graphic',\n 'ipc-graphicmore': 'GraphicMore',\n 'ipc-graphicoverlay': 'GraphicOverlay',\n 'ipc-marquee': 'Marquee',\n 'ipc-mediaplayerbase': 'MediaPlayerBase',\n 'ipc-mediaplayermulti': 'MediaPlayerMulti',\n 'ipc-mediaplayersticky': 'MediaPlayerSticky',\n 'ipc-member-equity': 'MemberEquity',\n 'ipc-mlg-block': 'MultiLayoutGraphicBlock',\n 'ipc-search-page-tabs': 'SearchPageBlock',\n 'ipc-selectstore': 'SelectStore',\n 'ipc-shelfdisplay': 'ShelfDisplay',\n 'ipc-slogan': 'Slogan',\n 'ipc-spacer': 'Spacer',\n 'ipc-specs': 'Specs',\n 'ipc-tabs': 'Tabs',\n 'ipc-text-marquee': 'TextMarquee',\n 'ipc-title': 'Title',\n 'ipc-whychoose': 'WhyChoose',\n}\n"],
5
- "mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,m7BAAAE,GAAA,wtBAAAC,GAAAH,IAAA,IAAAI,EAAuC,qCACvCC,EAAwC,sCACxCC,EAAkC,gCAClCC,EAAiC,+BACjCC,EAAkC,gCAClCC,EAAwC,sCACxCC,EAAoC,kCACpCC,EAAoC,kCACpCC,EAAsC,oCACtCC,EAA0C,wCAC1CC,EAAmC,iCACnCC,EAA2C,yCAC3CC,EAA6C,2CAC7CC,EAA4C,0CAC5CC,EAAmC,iCACnCC,EAAqC,mCACrCC,EAA+B,6BAC/BF,EAAqE,8BACrEG,EAAmD,iDAEnDC,EAAkD,gDAElDC,EAA4C,0CAC5CC,EAA4C,0CAC5CC,EAAsC,oCAEtCC,EAAmD,iCAEnDC,EAA2B,+BAC3BC,EAAwC,sCACxCC,EAAgC,8BAChCC,EAA0C,wCAC1CC,EAA0C,wCAC1CC,EAAiC,+BACjCC,EAAoC,mCAEpCC,EAAmC,iCACnCC,EAA8C,8CAC9CC,EAAuC,wDACvCC,EAA0C,uEAC1CC,EAAuC,wDACvCC,EAA+C,0FAC/CC,EAA4C,uFAC5CC,EAA2C,sFAC3CC,EAAmD,8FACnDC,EAA0C,qFAC1CC,EAAyC,oFACzCC,EAA0C,iEAC1CC,EAA0C,uEAC1CC,EAAyC,sEACzCC,EAA0C,uEAC1CC,GAAuC,4EACvCC,GAAwC,yDAExCC,GAAuC,qCACvCC,GAAoC,kCACpCC,GAAqC,mCACrCC,GAAmC,iCACnCC,GAAuC,qCACvCC,GAAoC,kCACpCC,GAAuC,qCAEhC,MAAMvD,GAAwB,CACnC,gBAAiB,YACjB,aAAc,SACd,mBAAoB,cACpB,eAAgB,WAChB,wBAAyB,mBACzB,yBAA0B,oBAC1B,qBAAsB,iBACtB,eAAgB,WAChB,eAAgB,WAChB,UAAW,MACX,eAAgB,WAChB,kBAAmB,cACnB,eAAgB,yBAChB,cAAe,UACf,cAAe,UACf,kBAAmB,cACnB,qBAAsB,iBACtB,cAAe,UACf,sBAAuB,kBACvB,uBAAwB,mBACxB,wBAAyB,oBACzB,oBAAqB,eACrB,gBAAiB,0BACjB,uBAAwB,kBACxB,kBAAmB,cACnB,mBAAoB,eACpB,aAAc,SACd,aAAc,SACd,YAAa,QACb,WAAY,OACZ,mBAAoB,cACpB,YAAa,QACb,gBAAiB,WACnB",
6
- "names": ["biz_components_exports", "__export", "PAYLOAD_COMPONENT_MAP", "__toCommonJS", "import_BrandEquity", "import_MemberEquity", "import_Slogan", "import_Title", "import_Spacer", "import_ShelfDisplay", "import_Evaluate", "import_Category", "import_HeroBanner", "import_AccordionCards", "import_Graphic", "import_MediaPlayerBase", "import_MediaPlayerSticky", "import_MediaPlayerMulti", "import_Marquee", "import_WhyChoose", "import_Faq", "import_MultiLayoutGraphicBlock", "import_GraphicAttractionBlock", "import_HeaderNavigation", "import_FooterNavigation", "import_SearchPage", "import_types", "import_Styles", "import_AiuiProvider", "import_Tabs", "import_CreativeModule", "import_GraphicOverlay", "import_Specs", "import_TabsGroup", "import_Listing", "import_BizProductProvider", "import_PurchaseBar", "import_ProductActions", "import_ProductCard", "import_ProductBenefitsTabs", "import_ProductHighlight", "import_ProductFreeGift", "import_ProductExchangePurchase", "import_ProductOptions", "import_ProductBundle", "import_ProductGridBox", "import_ProductGallery", "import_ProductDetail", "import_ProductSummary", "import_BenefitsTab", "import_PaidShipping", "import_GraphicMore", "import_Features", "import_AplusDesc", "import_GiftBox", "import_SelectStore", "import_DownLoad", "import_FootCharger"]
4
+ "sourcesContent": ["export { default as BrandEquity } from './BrandEquity/index.js'\nexport { default as MemberEquity } from './MemberEquity/index.js'\nexport { default as Slogan } from './Slogan/index.js'\nexport { default as Title } from './Title/index.js'\nexport { default as Spacer } from './Spacer/index.js'\nexport { default as ShelfDisplay } from './ShelfDisplay/index.js'\nexport { default as Evaluate } from './Evaluate/index.js'\nexport { default as Category } from './Category/index.js'\nexport { default as HeroBanner } from './HeroBanner/index.js'\nexport { default as AccordionCards } from './AccordionCards/index.js'\nexport { default as Graphic } from './Graphic/index.js'\nexport { default as MediaPlayerBase } from './MediaPlayerBase/index.js'\nexport { default as MediaPlayerSticky } from './MediaPlayerSticky/index.js'\nexport { default as MediaPlayerMulti } from './MediaPlayerMulti/index.js'\nexport { default as Marquee } from './Marquee/index.js'\nexport { default as WhyChoose } from './WhyChoose/index.js'\nexport { default as Faq } from './Faq/index.js'\nexport { MarqueeItem, MarqueeImageContent, MarqueeTextContent } from './Marquee/index.js'\nexport { default as MultiLayoutGraphicBlock } from './MultiLayoutGraphicBlock/index.js'\nexport type { MultiLayoutGraphicBlockProps } from './MultiLayoutGraphicBlock/index.js'\nexport { default as GraphicAttractionBlock } from './GraphicAttractionBlock/index.js'\nexport type { GraphicAttractionBlockProps } from './GraphicAttractionBlock/index.js'\nexport { default as HeaderNavigation } from './HeaderNavigation/index.js'\nexport { default as FooterNavigation } from './FooterNavigation/index.js'\nexport { default as SearchPage } from './SearchPage/index.js'\nexport type { SearchPageProps } from './SearchPage/types.js'\nexport { IPC_SEARCH_PAGE, SearchPageTabType } from './SearchPage/types.js'\n\nexport { withLayout } from '../shared/Styles.js'\nexport { default as AiuiProvider } from './AiuiProvider/index.js'\nexport { default as Tabs } from './Tabs/index.js'\nexport { default as CreativeModule } from './CreativeModule/index.js'\nexport { default as GraphicOverlay } from './GraphicOverlay/index.js'\nexport { default as Specs } from './Specs/index.js'\nexport { default as TabGroup } from './TabsGroup/index.js'\n\nexport { default as BizProductProvider } from './Listing/BizProductProvider.js'\nexport { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js'\nexport { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js'\nexport { default as ProductCard } from './Listing/components/ProductCard/index.js'\nexport { default as ProductBenefitsTabs } from './Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js'\nexport { default as ProductHighlight } from './Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js'\nexport { default as ProductFreeGift } from './Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js'\nexport { default as ProductExchangePurchase } from './Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js'\nexport { default as ProductOptions } from './Listing/components/ProductCard/ProductDetail/ProductOptions/index.js'\nexport { default as ProductBundle } from './Listing/components/ProductCard/ProductDetail/ProductBundle/index.js'\nexport { default as ProductGridBox } from './Listing/components/ProductCard/ProductGridBox.js'\nexport { default as ProductGallery } from './Listing/components/ProductCard/ProductGallery/index.js'\nexport { default as ProductDetail } from './Listing/components/ProductCard/ProductDetail/index.js'\nexport { default as ProductSummary } from './Listing/components/ProductCard/ProductSummary/index.js'\nexport { default as BenefitsTab } from './Listing/components/ProductCard/ProductDetail/BenefitsTab.js'\nexport { default as PaidShipping } from './Listing/components/PaidShipping/index.js'\n\nexport { default as GraphicMore } from './GraphicMore/index.js'\nexport { default as Features } from './Features/index.js'\nexport { default as AplusDesc } from './AplusDesc/index.js'\nexport { default as GiftBox } from './GiftBox/index.js'\nexport { default as SelectStore } from './SelectStore/index.js'\nexport { default as DownLoad } from './DownLoad/index.js'\nexport { default as FootCharger } from './FootCharger/index.js'\n\nexport const PAYLOAD_COMPONENT_MAP = {\n 'ipc-aplusdesc': 'AplusDesc',\n 'ipc-banner': 'Banner',\n 'ipc-brand-equity': 'BrandEquity',\n 'ipc-category': 'Category',\n 'ipc-collection-banner': 'CollectionBanner',\n 'ipc-collection-shelves': 'CollectionShelves',\n 'ipc-creativemodule': 'CreativeModule',\n 'ipc-download': 'DownLoad',\n 'ipc-evaluate': 'Evaluate',\n 'ipc-faq': 'Faq',\n 'ipc-features': 'Features',\n 'ipc-footcharger': 'FootCharger',\n 'ipc-ga-block': 'GraphicAttractionBlock',\n 'ipc-giftbox': 'GiftBox',\n 'ipc-graphic': 'Graphic',\n 'ipc-graphicmore': 'GraphicMore',\n 'ipc-graphicoverlay': 'GraphicOverlay',\n 'ipc-marquee': 'Marquee',\n 'ipc-mediaplayerbase': 'MediaPlayerBase',\n 'ipc-mediaplayermulti': 'MediaPlayerMulti',\n 'ipc-mediaplayersticky': 'MediaPlayerSticky',\n 'ipc-member-equity': 'MemberEquity',\n 'ipc-mlg-block': 'MultiLayoutGraphicBlock',\n 'ipc-search-page-tabs': 'SearchPageBlock',\n 'ipc-selectstore': 'SelectStore',\n 'ipc-shelfdisplay': 'ShelfDisplay',\n 'ipc-slogan': 'Slogan',\n 'ipc-spacer': 'Spacer',\n 'ipc-specs': 'Specs',\n 'ipc-tabs': 'Tabs',\n 'ipc-text-marquee': 'TextMarquee',\n 'ipc-title': 'Title',\n 'ipc-whychoose': 'WhyChoose',\n}\n"],
5
+ "mappings": "skBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,45BAAAE,GAAA,wtBAAAC,GAAAH,IAAA,IAAAI,EAAuC,qCACvCC,EAAwC,sCACxCC,EAAkC,gCAClCC,EAAiC,+BACjCC,EAAkC,gCAClCC,EAAwC,sCACxCC,EAAoC,kCACpCC,EAAoC,kCACpCC,EAAsC,oCACtCC,EAA0C,wCAC1CC,EAAmC,iCACnCC,EAA2C,yCAC3CC,EAA6C,2CAC7CC,EAA4C,0CAC5CC,EAAmC,iCACnCC,EAAqC,mCACrCC,EAA+B,6BAC/BF,EAAqE,8BACrEG,EAAmD,iDAEnDC,EAAkD,gDAElDC,EAA4C,0CAC5CC,EAA4C,0CAC5CC,EAAsC,oCAEtCC,EAAmD,iCAEnDC,EAA2B,+BAC3BC,EAAwC,sCACxCC,EAAgC,8BAChCC,EAA0C,wCAC1CC,EAA0C,wCAC1CC,EAAiC,+BACjCC,EAAoC,mCAEpCC,EAA8C,8CAC9CC,EAAuC,wDACvCC,EAA0C,uEAC1CC,EAAuC,wDACvCC,EAA+C,0FAC/CC,EAA4C,uFAC5CC,EAA2C,sFAC3CC,EAAmD,8FACnDC,EAA0C,qFAC1CC,EAAyC,oFACzCC,EAA0C,iEAC1CC,EAA0C,uEAC1CC,EAAyC,sEACzCC,EAA0C,uEAC1CC,EAAuC,4EACvCC,GAAwC,yDAExCC,GAAuC,qCACvCC,GAAoC,kCACpCC,GAAqC,mCACrCC,GAAmC,iCACnCC,GAAuC,qCACvCC,GAAoC,kCACpCC,GAAuC,qCAEhC,MAAMtD,GAAwB,CACnC,gBAAiB,YACjB,aAAc,SACd,mBAAoB,cACpB,eAAgB,WAChB,wBAAyB,mBACzB,yBAA0B,oBAC1B,qBAAsB,iBACtB,eAAgB,WAChB,eAAgB,WAChB,UAAW,MACX,eAAgB,WAChB,kBAAmB,cACnB,eAAgB,yBAChB,cAAe,UACf,cAAe,UACf,kBAAmB,cACnB,qBAAsB,iBACtB,cAAe,UACf,sBAAuB,kBACvB,uBAAwB,mBACxB,wBAAyB,oBACzB,oBAAqB,eACrB,gBAAiB,0BACjB,uBAAwB,kBACxB,kBAAmB,cACnB,mBAAoB,eACpB,aAAc,SACd,aAAc,SACd,YAAa,QACb,WAAY,OACZ,mBAAoB,cACpB,YAAa,QACb,gBAAiB,WACnB",
6
+ "names": ["biz_components_exports", "__export", "PAYLOAD_COMPONENT_MAP", "__toCommonJS", "import_BrandEquity", "import_MemberEquity", "import_Slogan", "import_Title", "import_Spacer", "import_ShelfDisplay", "import_Evaluate", "import_Category", "import_HeroBanner", "import_AccordionCards", "import_Graphic", "import_MediaPlayerBase", "import_MediaPlayerSticky", "import_MediaPlayerMulti", "import_Marquee", "import_WhyChoose", "import_Faq", "import_MultiLayoutGraphicBlock", "import_GraphicAttractionBlock", "import_HeaderNavigation", "import_FooterNavigation", "import_SearchPage", "import_types", "import_Styles", "import_AiuiProvider", "import_Tabs", "import_CreativeModule", "import_GraphicOverlay", "import_Specs", "import_TabsGroup", "import_BizProductProvider", "import_PurchaseBar", "import_ProductActions", "import_ProductCard", "import_ProductBenefitsTabs", "import_ProductHighlight", "import_ProductFreeGift", "import_ProductExchangePurchase", "import_ProductOptions", "import_ProductBundle", "import_ProductGridBox", "import_ProductGallery", "import_ProductDetail", "import_ProductSummary", "import_BenefitsTab", "import_PaidShipping", "import_GraphicMore", "import_Features", "import_AplusDesc", "import_GiftBox", "import_SelectStore", "import_DownLoad", "import_FootCharger"]
7
7
  }
@@ -72,6 +72,15 @@ export type JoinedRecommendBuyProducts = {
72
72
  canOperate?: boolean;
73
73
  };
74
74
  };
75
+ export type CreditsRedemption = {
76
+ amount: number;
77
+ availablePoints: number;
78
+ usedPoints: number;
79
+ skuDetails?: {
80
+ sku: string;
81
+ is_eligible: boolean;
82
+ }[];
83
+ };
75
84
  export interface ProductContextType {
76
85
  isLogin?: boolean;
77
86
  isMobile?: boolean;
@@ -105,7 +114,7 @@ export interface ProductContextType {
105
114
  compareData?: CompareData['data'];
106
115
  onAddToCart?: () => void;
107
116
  onBuyNow?: () => void;
108
- creditsRedemptionAmount?: number;
117
+ creditsRedemption?: CreditsRedemption;
109
118
  memberFunctionResult?: FunctionMemberPriceResult;
110
119
  openModal: ({ title, content, domContent }: ModalData) => void;
111
120
  openSignInPopup?: () => void;
@@ -122,5 +131,5 @@ export interface ProductContextType {
122
131
  }
123
132
  export declare const BizProductContext: React.Context<ProductContextType>;
124
133
  export declare const useBizProductContext: () => ProductContextType;
125
- declare const ProductProvider: ({ product, isLogin, profile, isMobile, isDesktop, children, renderRating, freeGift, exchangePurchase, bundle, checkedBundle, checkedGift, setCheckedBundle, setCheckedGift, checkedExchangePurchase, setCheckedExchangePurchase, variant, selectedOptions, setSelectedOptions, compareData, coupon, finalPrice, comparePrice, totalSavings, savingDetail, setSavingDetail, selectedVariants, onAddToCart, onBuyNow, creditsRedemptionAmount, memberFunctionResult, openModal, openSignInPopup, openAuthCodePopup, openSignUpPopup, renderInstallments, onUseCouponChange, onUseMemberDiscountChange, discount, buyNowLoading, addToCartLoading, }: PropsWithChildren<Omit<ProductContextType, "joinedRecommendBuyProducts" | "setJoinedRecommendBuyProducts" | "addOrder" | "setAddOrder">>) => import("react/jsx-runtime").JSX.Element;
134
+ declare const ProductProvider: ({ product, isLogin, profile, isMobile, isDesktop, children, renderRating, freeGift, exchangePurchase, bundle, checkedBundle, checkedGift, setCheckedBundle, setCheckedGift, checkedExchangePurchase, setCheckedExchangePurchase, variant, selectedOptions, setSelectedOptions, compareData, coupon, finalPrice, comparePrice, totalSavings, savingDetail, setSavingDetail, selectedVariants, onAddToCart, onBuyNow, creditsRedemption, memberFunctionResult, openModal, openSignInPopup, openAuthCodePopup, openSignUpPopup, renderInstallments, onUseCouponChange, onUseMemberDiscountChange, discount, buyNowLoading, addToCartLoading, }: PropsWithChildren<Omit<ProductContextType, "joinedRecommendBuyProducts" | "setJoinedRecommendBuyProducts" | "addOrder" | "setAddOrder">>) => import("react/jsx-runtime").JSX.Element;
126
135
  export default ProductProvider;
@@ -1,2 +1,2 @@
1
- import{jsx as Y}from"react/jsx-runtime";import{createContext as K,useContext as a,useState as i,useEffect as Q}from"react";const t=K({}),te=()=>{if(!a(t))throw new Error("useProductContext must be used in <ProductProvider>");return a(t)},X=({product:n,isLogin:d,profile:c,isMobile:u,isDesktop:s,children:p,renderRating:l,freeGift:m,exchangePurchase:P,bundle:b,checkedBundle:g,checkedGift:h,setCheckedBundle:y,setCheckedGift:f,checkedExchangePurchase:C,setCheckedExchangePurchase:v,variant:e,selectedOptions:S,setSelectedOptions:x,compareData:D,coupon:B,finalPrice:R,comparePrice:A,totalSavings:O,savingDetail:_,setSavingDetail:k,selectedVariants:V,onAddToCart:M,onBuyNow:w,creditsRedemptionAmount:F,memberFunctionResult:T,openModal:G,openSignInPopup:J,openAuthCodePopup:L,openSignUpPopup:I,renderInstallments:N,onUseCouponChange:U,onUseMemberDiscountChange:E,discount:W,buyNowLoading:j,addToCartLoading:z})=>{const[q,o]=i({}),[H,r]=i([]);return Q(()=>{e?.id&&(o({bundle:{value:void 0,canOperate:!0},gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0}}),r([]))},[e?.id]),Y(t.Provider,{value:{product:n,variant:e,isMobile:u,isDesktop:s,isLogin:d,profile:c,coupon:B,renderRating:l,finalPrice:R,comparePrice:A,savingDetail:_,setSavingDetail:k,totalSavings:O,selectedOptions:S,setSelectedOptions:x,freeGift:m,exchangePurchase:P,checkedGift:h,setCheckedGift:f,checkedBundle:g,setCheckedBundle:y,bundle:b,compareData:D,selectedVariants:V,onAddToCart:M,onBuyNow:w,joinedRecommendBuyProducts:q,setJoinedRecommendBuyProducts:o,checkedExchangePurchase:C,setCheckedExchangePurchase:v,creditsRedemptionAmount:F,memberFunctionResult:T,openModal:G,openSignInPopup:J,openAuthCodePopup:L,openSignUpPopup:I,renderInstallments:N,onUseCouponChange:U,onUseMemberDiscountChange:E,discount:W,buyNowLoading:j,addToCartLoading:z,addOrder:H,setAddOrder:r},children:p})};var ne=X;export{t as BizProductContext,ne as default,te as useBizProductContext};
1
+ import{jsx as Y}from"react/jsx-runtime";import{createContext as K,useContext as a,useState as i,useEffect as Q}from"react";const t=K({}),te=()=>{if(!a(t))throw new Error("useProductContext must be used in <ProductProvider>");return a(t)},X=({product:n,isLogin:d,profile:c,isMobile:u,isDesktop:s,children:p,renderRating:l,freeGift:m,exchangePurchase:b,bundle:P,checkedBundle:g,checkedGift:h,setCheckedBundle:y,setCheckedGift:C,checkedExchangePurchase:f,setCheckedExchangePurchase:v,variant:e,selectedOptions:x,setSelectedOptions:S,compareData:D,coupon:B,finalPrice:R,comparePrice:A,totalSavings:O,savingDetail:k,setSavingDetail:_,selectedVariants:V,onAddToCart:M,onBuyNow:w,creditsRedemption:F,memberFunctionResult:T,openModal:G,openSignInPopup:J,openAuthCodePopup:L,openSignUpPopup:I,renderInstallments:N,onUseCouponChange:U,onUseMemberDiscountChange:E,discount:W,buyNowLoading:j,addToCartLoading:z})=>{const[q,o]=i({}),[H,r]=i([]);return Q(()=>{e?.id&&(o({bundle:{value:void 0,canOperate:!0},gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0}}),r([]))},[e?.id]),Y(t.Provider,{value:{product:n,variant:e,isMobile:u,isDesktop:s,isLogin:d,profile:c,coupon:B,renderRating:l,finalPrice:R,comparePrice:A,savingDetail:k,setSavingDetail:_,totalSavings:O,selectedOptions:x,setSelectedOptions:S,freeGift:m,exchangePurchase:b,checkedGift:h,setCheckedGift:C,checkedBundle:g,setCheckedBundle:y,bundle:P,compareData:D,selectedVariants:V,onAddToCart:M,onBuyNow:w,joinedRecommendBuyProducts:q,setJoinedRecommendBuyProducts:o,checkedExchangePurchase:f,setCheckedExchangePurchase:v,creditsRedemption:F,memberFunctionResult:T,openModal:G,openSignInPopup:J,openAuthCodePopup:L,openSignUpPopup:I,renderInstallments:N,onUseCouponChange:U,onUseMemberDiscountChange:E,discount:W,buyNowLoading:j,addToCartLoading:z,addOrder:H,setAddOrder:r},children:p})};var ne=X;export{t as BizProductContext,ne as default,te as useBizProductContext};
2
2
  //# sourceMappingURL=BizProductProvider.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Listing/BizProductProvider.tsx"],
4
- "sourcesContent": ["import React, {\n createContext,\n useCallback,\n useContext,\n type Dispatch,\n type SetStateAction,\n type PropsWithChildren,\n useState,\n useEffect,\n} from 'react'\nimport type {\n Product,\n ProductPrice,\n ProductVariant,\n VariantCoupon,\n Options,\n FreeGift,\n BundleListItem,\n Bundle,\n} from './types/product'\nimport type { CompareData, DiscountData } from './types.js'\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n\nexport type SavingDetail = {\n coupon: number\n bundle: number\n member: number\n freeGift: number\n compare: number\n exchangePurchase: number\n}\n\ntype variantWithFinalPrice = ProductVariant & { finalPrice?: ProductPrice }\n\nexport type FunctionMemberPriceResult = {\n hasMemberPrice: boolean\n originalPrice: number\n withCouponMemberTotalSave: number\n withoutCouponMaxMemberTotalSave?: number\n labels: {\n key: string\n value: string\n desc: string\n }[]\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\n\nexport type JoinedRecommendBuyProducts = {\n bundle?: {\n value?: BundleListItem\n canOperate?: boolean\n }\n gift?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n exchange?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n}\nexport interface ProductContextType {\n isLogin?: boolean\n isMobile?: boolean\n isDesktop?: boolean\n product: Product\n profile?: UserProfile\n variant: ProductVariant\n selectedVariants: Array<variantWithFinalPrice>\n renderRating?: React.ReactNode\n coupon?: VariantCoupon\n savingDetail: SavingDetail\n setSavingDetail: Dispatch<SetStateAction<SavingDetail>>\n finalPrice: number\n comparePrice: number\n totalSavings: number\n selectedOptions: Options\n setSelectedOptions: Dispatch<SetStateAction<Options>>\n freeGift?: FreeGift\n checkedGift?: ProductVariant\n setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>\n exchangePurchase?: FreeGift\n checkedExchangePurchase?: ProductVariant\n setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>\n checkedBundle?: BundleListItem\n setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>\n joinedRecommendBuyProducts: JoinedRecommendBuyProducts\n setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<JoinedRecommendBuyProducts>>\n checkedCareBundle?: ProductVariant\n setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>\n bundle?: Bundle\n compareData?: CompareData['data']\n onAddToCart?: () => void\n onBuyNow?: () => void\n creditsRedemptionAmount?: number\n memberFunctionResult?: FunctionMemberPriceResult\n openModal: ({ title, content, domContent }: ModalData) => void\n openSignInPopup?: () => void\n openAuthCodePopup?: () => void\n openSignUpPopup?: () => void\n renderInstallments?: React.ReactNode\n onUseCouponChange?: (couponSaving: number) => void\n onUseMemberDiscountChange?: (memberSaving: number) => void\n discount?: DiscountData\n buyNowLoading?: boolean\n addToCartLoading?: boolean\n addOrder?: Array<'bundle' | 'gift' | 'exchange'>\n setAddOrder?: Dispatch<SetStateAction<Array<'bundle' | 'gift' | 'exchange'>>>\n}\n\n// const initialState: ProductContextType = {\n// isLogin: false,\n// isMobile: false,\n// product: {} as Product,\n// variant: {} as ProductVariant,\n// savingDetail: { coupon: 0, bundle: 0, member: 0, freeGift: 0, compare: 0 },\n// finalPrice: 0,\n// comparePrice: 0,\n// totalSavings: 0,\n// renderRating: null,\n// selectedOptions: {} as Options,\n// setSelectedOptions: () => {},\n// checkedBundle: undefined,\n// checkedGift: undefined,\n// setCheckedBundle: () => {},\n// setCheckedGift: () => {},\n// checkedCareBundle: undefined,\n// setCheckedCareBundle: () => {},\n// }\n\nexport const BizProductContext = createContext<ProductContextType>({} as ProductContextType)\n\nexport const useBizProductContext = () => {\n const context = useContext(BizProductContext)\n if (!context) {\n throw new Error('useProductContext must be used in <ProductProvider>')\n }\n return useContext(BizProductContext)\n}\n\nconst ProductProvider = ({\n product,\n isLogin,\n profile,\n isMobile,\n isDesktop,\n children,\n renderRating,\n freeGift,\n exchangePurchase,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n variant,\n selectedOptions,\n setSelectedOptions,\n compareData,\n coupon,\n finalPrice,\n comparePrice,\n totalSavings,\n savingDetail,\n setSavingDetail,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n creditsRedemptionAmount,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n buyNowLoading,\n addToCartLoading,\n}: PropsWithChildren<\n Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts' | 'addOrder' | 'setAddOrder'>\n>) => {\n const [joinedRecommendBuyProducts, setJoinedRecommendBuyProducts] = useState<JoinedRecommendBuyProducts>({})\n const [addOrder, setAddOrder] = useState<Array<'bundle' | 'gift' | 'exchange'>>([])\n\n useEffect(() => {\n if (variant?.id) {\n setJoinedRecommendBuyProducts({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setAddOrder([])\n }\n }, [variant?.id])\n\n return (\n <BizProductContext.Provider\n value={{\n product,\n variant,\n isMobile,\n isDesktop,\n isLogin,\n profile,\n coupon,\n renderRating,\n finalPrice,\n comparePrice,\n savingDetail,\n setSavingDetail,\n totalSavings,\n selectedOptions,\n setSelectedOptions,\n freeGift,\n exchangePurchase,\n checkedGift,\n setCheckedGift,\n checkedBundle,\n setCheckedBundle,\n bundle,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n creditsRedemptionAmount,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n buyNowLoading,\n addToCartLoading,\n addOrder,\n setAddOrder,\n }}\n >\n {children}\n </BizProductContext.Provider>\n )\n}\n\nexport default ProductProvider\n"],
5
- "mappings": "AAqPI,cAAAA,MAAA,oBArPJ,OACE,iBAAAC,EAEA,cAAAC,EAIA,YAAAC,EACA,aAAAC,MACK,QA6JA,MAAMC,EAAoBJ,EAAkC,CAAC,CAAuB,EAE9EK,GAAuB,IAAM,CAExC,GAAI,CADYJ,EAAWG,CAAiB,EAE1C,MAAM,IAAI,MAAM,qDAAqD,EAEvE,OAAOH,EAAWG,CAAiB,CACrC,EAEME,EAAkB,CAAC,CACvB,QAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,aAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,wBAAAC,EACA,2BAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,YAAAC,EACA,OAAAC,EACA,WAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,wBAAAC,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,EACA,cAAAC,EACA,iBAAAC,CACF,IAEM,CACJ,KAAM,CAACC,EAA4BC,CAA6B,EAAI/C,EAAqC,CAAC,CAAC,EACrG,CAACgD,EAAUC,CAAW,EAAIjD,EAAgD,CAAC,CAAC,EAElF,OAAAC,EAAU,IAAM,CACVoB,GAAS,KACX0B,EAA8B,CAC5B,OAAQ,CACN,MAAO,OACP,WAAY,EACd,EACA,KAAM,CACJ,MAAO,OACP,WAAY,EACd,EACA,SAAU,CACR,MAAO,OACP,WAAY,EACd,CACF,CAAC,EACDE,EAAY,CAAC,CAAC,EAElB,EAAG,CAAC5B,GAAS,EAAE,CAAC,EAGdxB,EAACK,EAAkB,SAAlB,CACC,MAAO,CACL,QAAAG,EACA,QAAAgB,EACA,SAAAb,EACA,UAAAC,EACA,QAAAH,EACA,QAAAC,EACA,OAAAkB,EACA,aAAAd,EACA,WAAAe,EACA,aAAAC,EACA,aAAAE,EACA,gBAAAC,EACA,aAAAF,EACA,gBAAAN,EACA,mBAAAC,EACA,SAAAX,EACA,iBAAAC,EACA,YAAAG,EACA,eAAAE,EACA,cAAAH,EACA,iBAAAE,EACA,OAAAH,EACA,YAAAU,EACA,iBAAAO,EACA,YAAAC,EACA,SAAAC,EACA,2BAAAa,EACA,8BAAAC,EACA,wBAAA5B,EACA,2BAAAC,EACA,wBAAAc,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,SAAAG,EACA,YAAAC,CACF,EAEC,SAAAvC,EACH,CAEJ,EAEA,IAAOwC,GAAQ9C",
6
- "names": ["jsx", "createContext", "useContext", "useState", "useEffect", "BizProductContext", "useBizProductContext", "ProductProvider", "product", "isLogin", "profile", "isMobile", "isDesktop", "children", "renderRating", "freeGift", "exchangePurchase", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "checkedExchangePurchase", "setCheckedExchangePurchase", "variant", "selectedOptions", "setSelectedOptions", "compareData", "coupon", "finalPrice", "comparePrice", "totalSavings", "savingDetail", "setSavingDetail", "selectedVariants", "onAddToCart", "onBuyNow", "creditsRedemptionAmount", "memberFunctionResult", "openModal", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "renderInstallments", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "buyNowLoading", "addToCartLoading", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "addOrder", "setAddOrder", "BizProductProvider_default"]
4
+ "sourcesContent": ["import React, {\n createContext,\n useCallback,\n useContext,\n type Dispatch,\n type SetStateAction,\n type PropsWithChildren,\n useState,\n useEffect,\n} from 'react'\nimport type {\n Product,\n ProductPrice,\n ProductVariant,\n VariantCoupon,\n Options,\n FreeGift,\n BundleListItem,\n Bundle,\n} from './types/product'\nimport type { CompareData, DiscountData } from './types.js'\n\ntype Country = {\n id?: number\n name?: string\n code?: string\n}\n\nexport type UserProfile = {\n user_id: string\n email: string\n nick_name?: string\n full_name?: string\n first_name?: string\n last_name?: string\n dob?: string\n gender?: string\n phone_number?: string\n phone_account?: string\n country?: Country\n is_subscribe?: boolean\n avatar?: string\n can_change_password?: boolean\n invitation_code?: string\n phone_carrier?: string\n dob_programmed?: boolean\n activated?: boolean\n registed_at?: number\n activated_at?: number\n token?: string\n}\n\nexport type SavingDetail = {\n coupon: number\n bundle: number\n member: number\n freeGift: number\n compare: number\n exchangePurchase: number\n}\n\ntype variantWithFinalPrice = ProductVariant & { finalPrice?: ProductPrice }\n\nexport type FunctionMemberPriceResult = {\n hasMemberPrice: boolean\n originalPrice: number\n withCouponMemberTotalSave: number\n withoutCouponMaxMemberTotalSave?: number\n labels: {\n key: string\n value: string\n desc: string\n }[]\n}\n\nexport type ModalData = {\n needClickAway?: boolean\n className?: string\n title?: string\n content?: string\n domContent?: React.ReactNode\n}\n\nexport type JoinedRecommendBuyProducts = {\n bundle?: {\n value?: BundleListItem\n canOperate?: boolean\n }\n gift?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n exchange?: {\n value?: ProductVariant\n canOperate?: boolean\n }\n}\n\nexport type CreditsRedemption = {\n amount: number\n availablePoints: number\n usedPoints: number\n skuDetails?: {\n sku: string\n is_eligible: boolean\n }[]\n}\n\nexport interface ProductContextType {\n isLogin?: boolean\n isMobile?: boolean\n isDesktop?: boolean\n product: Product\n profile?: UserProfile\n variant: ProductVariant\n selectedVariants: Array<variantWithFinalPrice>\n renderRating?: React.ReactNode\n coupon?: VariantCoupon\n savingDetail: SavingDetail\n setSavingDetail: Dispatch<SetStateAction<SavingDetail>>\n finalPrice: number\n comparePrice: number\n totalSavings: number\n selectedOptions: Options\n setSelectedOptions: Dispatch<SetStateAction<Options>>\n freeGift?: FreeGift\n checkedGift?: ProductVariant\n setCheckedGift?: Dispatch<SetStateAction<ProductVariant | undefined>>\n exchangePurchase?: FreeGift\n checkedExchangePurchase?: ProductVariant\n setCheckedExchangePurchase?: Dispatch<SetStateAction<ProductVariant | undefined>>\n checkedBundle?: BundleListItem\n setCheckedBundle: Dispatch<SetStateAction<BundleListItem | undefined>>\n joinedRecommendBuyProducts: JoinedRecommendBuyProducts\n setJoinedRecommendBuyProducts?: Dispatch<SetStateAction<JoinedRecommendBuyProducts>>\n checkedCareBundle?: ProductVariant\n setCheckedCareBundle?: Dispatch<SetStateAction<ProductVariant | undefined>>\n bundle?: Bundle\n compareData?: CompareData['data']\n onAddToCart?: () => void\n onBuyNow?: () => void\n creditsRedemption?: CreditsRedemption\n memberFunctionResult?: FunctionMemberPriceResult\n openModal: ({ title, content, domContent }: ModalData) => void\n openSignInPopup?: () => void\n openAuthCodePopup?: () => void\n openSignUpPopup?: () => void\n renderInstallments?: React.ReactNode\n onUseCouponChange?: (couponSaving: number) => void\n onUseMemberDiscountChange?: (memberSaving: number) => void\n discount?: DiscountData\n buyNowLoading?: boolean\n addToCartLoading?: boolean\n addOrder?: Array<'bundle' | 'gift' | 'exchange'>\n setAddOrder?: Dispatch<SetStateAction<Array<'bundle' | 'gift' | 'exchange'>>>\n}\n\n// const initialState: ProductContextType = {\n// isLogin: false,\n// isMobile: false,\n// product: {} as Product,\n// variant: {} as ProductVariant,\n// savingDetail: { coupon: 0, bundle: 0, member: 0, freeGift: 0, compare: 0 },\n// finalPrice: 0,\n// comparePrice: 0,\n// totalSavings: 0,\n// renderRating: null,\n// selectedOptions: {} as Options,\n// setSelectedOptions: () => {},\n// checkedBundle: undefined,\n// checkedGift: undefined,\n// setCheckedBundle: () => {},\n// setCheckedGift: () => {},\n// checkedCareBundle: undefined,\n// setCheckedCareBundle: () => {},\n// }\n\nexport const BizProductContext = createContext<ProductContextType>({} as ProductContextType)\n\nexport const useBizProductContext = () => {\n const context = useContext(BizProductContext)\n if (!context) {\n throw new Error('useProductContext must be used in <ProductProvider>')\n }\n return useContext(BizProductContext)\n}\n\nconst ProductProvider = ({\n product,\n isLogin,\n profile,\n isMobile,\n isDesktop,\n children,\n renderRating,\n freeGift,\n exchangePurchase,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n variant,\n selectedOptions,\n setSelectedOptions,\n compareData,\n coupon,\n finalPrice,\n comparePrice,\n totalSavings,\n savingDetail,\n setSavingDetail,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n creditsRedemption,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n buyNowLoading,\n addToCartLoading,\n}: PropsWithChildren<\n Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts' | 'addOrder' | 'setAddOrder'>\n>) => {\n const [joinedRecommendBuyProducts, setJoinedRecommendBuyProducts] = useState<JoinedRecommendBuyProducts>({})\n const [addOrder, setAddOrder] = useState<Array<'bundle' | 'gift' | 'exchange'>>([])\n\n useEffect(() => {\n if (variant?.id) {\n setJoinedRecommendBuyProducts({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setAddOrder([])\n }\n }, [variant?.id])\n\n return (\n <BizProductContext.Provider\n value={{\n product,\n variant,\n isMobile,\n isDesktop,\n isLogin,\n profile,\n coupon,\n renderRating,\n finalPrice,\n comparePrice,\n savingDetail,\n setSavingDetail,\n totalSavings,\n selectedOptions,\n setSelectedOptions,\n freeGift,\n exchangePurchase,\n checkedGift,\n setCheckedGift,\n checkedBundle,\n setCheckedBundle,\n bundle,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n checkedExchangePurchase,\n setCheckedExchangePurchase,\n creditsRedemption,\n memberFunctionResult,\n openModal,\n openSignInPopup,\n openAuthCodePopup,\n openSignUpPopup,\n renderInstallments,\n onUseCouponChange,\n onUseMemberDiscountChange,\n discount,\n buyNowLoading,\n addToCartLoading,\n addOrder,\n setAddOrder,\n }}\n >\n {children}\n </BizProductContext.Provider>\n )\n}\n\nexport default ProductProvider\n"],
5
+ "mappings": "AAgQI,cAAAA,MAAA,oBAhQJ,OACE,iBAAAC,EAEA,cAAAC,EAIA,YAAAC,EACA,aAAAC,MACK,QAwKA,MAAMC,EAAoBJ,EAAkC,CAAC,CAAuB,EAE9EK,GAAuB,IAAM,CAExC,GAAI,CADYJ,EAAWG,CAAiB,EAE1C,MAAM,IAAI,MAAM,qDAAqD,EAEvE,OAAOH,EAAWG,CAAiB,CACrC,EAEME,EAAkB,CAAC,CACvB,QAAAC,EACA,QAAAC,EACA,QAAAC,EACA,SAAAC,EACA,UAAAC,EACA,SAAAC,EACA,aAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,wBAAAC,EACA,2BAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,YAAAC,EACA,OAAAC,EACA,WAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,kBAAAC,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,EACA,cAAAC,EACA,iBAAAC,CACF,IAEM,CACJ,KAAM,CAACC,EAA4BC,CAA6B,EAAI/C,EAAqC,CAAC,CAAC,EACrG,CAACgD,EAAUC,CAAW,EAAIjD,EAAgD,CAAC,CAAC,EAElF,OAAAC,EAAU,IAAM,CACVoB,GAAS,KACX0B,EAA8B,CAC5B,OAAQ,CACN,MAAO,OACP,WAAY,EACd,EACA,KAAM,CACJ,MAAO,OACP,WAAY,EACd,EACA,SAAU,CACR,MAAO,OACP,WAAY,EACd,CACF,CAAC,EACDE,EAAY,CAAC,CAAC,EAElB,EAAG,CAAC5B,GAAS,EAAE,CAAC,EAGdxB,EAACK,EAAkB,SAAlB,CACC,MAAO,CACL,QAAAG,EACA,QAAAgB,EACA,SAAAb,EACA,UAAAC,EACA,QAAAH,EACA,QAAAC,EACA,OAAAkB,EACA,aAAAd,EACA,WAAAe,EACA,aAAAC,EACA,aAAAE,EACA,gBAAAC,EACA,aAAAF,EACA,gBAAAN,EACA,mBAAAC,EACA,SAAAX,EACA,iBAAAC,EACA,YAAAG,EACA,eAAAE,EACA,cAAAH,EACA,iBAAAE,EACA,OAAAH,EACA,YAAAU,EACA,iBAAAO,EACA,YAAAC,EACA,SAAAC,EACA,2BAAAa,EACA,8BAAAC,EACA,wBAAA5B,EACA,2BAAAC,EACA,kBAAAc,EACA,qBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,kBAAAC,EACA,0BAAAC,EACA,SAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,SAAAG,EACA,YAAAC,CACF,EAEC,SAAAvC,EACH,CAEJ,EAEA,IAAOwC,GAAQ9C",
6
+ "names": ["jsx", "createContext", "useContext", "useState", "useEffect", "BizProductContext", "useBizProductContext", "ProductProvider", "product", "isLogin", "profile", "isMobile", "isDesktop", "children", "renderRating", "freeGift", "exchangePurchase", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "checkedExchangePurchase", "setCheckedExchangePurchase", "variant", "selectedOptions", "setSelectedOptions", "compareData", "coupon", "finalPrice", "comparePrice", "totalSavings", "savingDetail", "setSavingDetail", "selectedVariants", "onAddToCart", "onBuyNow", "creditsRedemption", "memberFunctionResult", "openModal", "openSignInPopup", "openAuthCodePopup", "openSignUpPopup", "renderInstallments", "onUseCouponChange", "onUseMemberDiscountChange", "discount", "buyNowLoading", "addToCartLoading", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "addOrder", "setAddOrder", "BizProductProvider_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Button as i,Picture as x,Text as p}from"../../../../components/index.js";import{useAiuiContext as c}from"../../../AiuiProvider/index.js";import{cn as m}from"../../../../helpers/index.js";const d=n=>{const{className:s,setOpenShippingPolicyModal:a,metafields:t}=n,{trackingData:r}=c(),l=r?.common?.copywriting;return o("div",{tabIndex:-1,className:m("from-4.29% to-101.05% laptop:rounded-2xl laptop:py-5 relative items-start gap-[16px] overflow-hidden rounded-xl bg-gradient-to-r from-[rgba(215,245,254,0.24)] to-[rgba(215,245,254,0.80)] p-4 text-[#1F2021] md:py-[16px]","flex flex-col",s),children:[e(x,{source:t?.shippingPolicyIcon,className:"absolute -bottom-10 -right-10 z-[1] size-[150px]"}),o("div",{className:"relative z-10 flex w-full items-start justify-between",children:[o("div",{className:"laptop:gap-2 lg-desktop:gap-4 flex flex-col gap-3",children:[e(p,{size:2,className:"laptop:text-[16px] lg-desktop:text-[18px] text-[14px]",children:t?.shippingPolicyTitle}),e(p,{size:1,as:"p",className:"laptop:text-[14px] text-[12px] text-[#6D6D6F]",children:t?.loginBeforeCheckoutNote})]}),e(i,{variant:"link",className:"laptop:inline-flex hidden whitespace-nowrap !p-0",onClick:()=>{a(!0)},children:l?.learnMore})]}),e(i,{variant:"link",className:"laptop:hidden inline-flex p-0",onClick:()=>{a(!0)},children:l?.learnMore})]})};var v=d;export{v as default};
1
+ import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Button as i,Picture as r,Text as p}from"../../../../components/index.js";import{useAiuiContext as x}from"../../../AiuiProvider/index.js";import{cn as c}from"../../../../helpers/index.js";const d=s=>{const{className:n,setOpenShippingPolicyModal:a,metafields:t}=s,{copyWriting:l}=x();return o("div",{tabIndex:-1,className:c("from-4.29% to-101.05% laptop:rounded-2xl laptop:py-5 relative items-start gap-[16px] overflow-hidden rounded-xl bg-gradient-to-r from-[rgba(215,245,254,0.24)] to-[rgba(215,245,254,0.80)] p-4 text-[#1F2021] md:py-[16px]","flex flex-col",n),children:[e(r,{source:t?.shippingPolicyIcon,className:"absolute -bottom-10 -right-10 z-[1] size-[150px]"}),o("div",{className:"relative z-10 flex w-full items-start justify-between",children:[o("div",{className:"laptop:gap-2 lg-desktop:gap-4 flex flex-col gap-3",children:[e(p,{size:2,className:"laptop:text-[16px] lg-desktop:text-[18px] text-[14px]",children:t?.shippingPolicyTitle}),e(p,{size:1,as:"p",className:"laptop:text-[14px] text-[12px] text-[#6D6D6F]",children:t?.loginBeforeCheckoutNote})]}),e(i,{variant:"link",className:"laptop:inline-flex hidden whitespace-nowrap !p-0",onClick:()=>{a(!0)},children:l?.learnMore})]}),e(i,{variant:"link",className:"laptop:hidden inline-flex p-0",onClick:()=>{a(!0)},children:l?.learnMore})]})};var u=d;export{u as default};
2
2
  //# sourceMappingURL=LearnMore.js.map