@anker-in/headless-ui 1.1.5 → 1.1.7-alpha.1763622192862

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 (61) hide show
  1. package/dist/cjs/biz-components/Category/SwiperCategory.js +1 -1
  2. package/dist/cjs/biz-components/Category/SwiperCategory.js.map +3 -3
  3. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
  4. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +2 -2
  5. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +1 -1
  6. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +2 -2
  7. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +5 -1
  8. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +2 -2
  9. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  10. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +3 -3
  11. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +1 -1
  12. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +3 -3
  13. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  14. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  15. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  16. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  17. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
  18. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +2 -2
  19. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  20. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +2 -2
  21. package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
  22. package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +3 -3
  23. package/dist/cjs/biz-components/Spacer/index.js +1 -1
  24. package/dist/cjs/biz-components/Spacer/index.js.map +3 -3
  25. package/dist/cjs/biz-components/SwiperBox/index.js +1 -1
  26. package/dist/cjs/biz-components/SwiperBox/index.js.map +3 -3
  27. package/dist/cjs/biz-components/Title/index.js +1 -1
  28. package/dist/cjs/biz-components/Title/index.js.map +2 -2
  29. package/dist/cjs/components/picture.js +1 -1
  30. package/dist/cjs/components/picture.js.map +2 -2
  31. package/dist/esm/biz-components/Category/SwiperCategory.js +1 -1
  32. package/dist/esm/biz-components/Category/SwiperCategory.js.map +3 -3
  33. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
  34. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +2 -2
  35. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +1 -1
  36. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +2 -2
  37. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +5 -1
  38. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +2 -2
  39. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  40. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +3 -3
  41. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +1 -1
  42. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +3 -3
  43. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  44. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  45. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  46. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  47. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
  48. package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +2 -2
  49. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  50. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +2 -2
  51. package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
  52. package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +3 -3
  53. package/dist/esm/biz-components/Spacer/index.js +1 -1
  54. package/dist/esm/biz-components/Spacer/index.js.map +3 -3
  55. package/dist/esm/biz-components/SwiperBox/index.js +1 -1
  56. package/dist/esm/biz-components/SwiperBox/index.js.map +3 -3
  57. package/dist/esm/biz-components/Title/index.js +1 -1
  58. package/dist/esm/biz-components/Title/index.js.map +2 -2
  59. package/dist/esm/components/picture.js +1 -1
  60. package/dist/esm/components/picture.js.map +2 -2
  61. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var w=Object.create;var a=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var P=(e,i)=>{for(var r in i)a(e,r,{get:i[r],enumerable:!0})},d=(e,i,r,l)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of u(i))!g.call(e,o)&&o!==r&&a(e,o,{get:()=>i[o],enumerable:!(l=m(i,o))||l.enumerable});return e};var M=(e,i,r)=>(r=e!=null?w(S(e)):{},d(i||!e||!e.__esModule?a(r,"default",{value:e,enumerable:!0}):r,e)),y=e=>d(a({},"__esModule",{value:!0}),e);var h={};P(h,{default:()=>B});module.exports=y(h);var t=require("react/jsx-runtime"),c=M(require("react")),n=require("swiper/react"),s=require("swiper/modules"),x=require("swiper/css"),k=require("swiper/css/pagination");const f=c.default.forwardRef(({data:e,Slide:i,id:r,pagination:l})=>(0,t.jsx)(n.Swiper,{freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,dynamicBullets:!1},className:"!overflow-visible",modules:[s.FreeMode,s.Mousewheel,s.Pagination],breakpoints:{0:{spaceBetween:16,freeMode:!1,slidesPerView:1,slidesPerGroup:1},376:{spaceBetween:16,freeMode:!1,slidesPerView:1,slidesPerGroup:1},767:{spaceBetween:16,freeMode:!1,slidesPerView:4,slidesPerGroup:4},1441:{spaceBetween:16,freeMode:!1,slidesPerView:Math.min(6,e?.list?.length),slidesPerGroup:Math.min(6,e?.list?.length)}},children:e?.list?.map((o,p)=>(0,t.jsx)(n.SwiperSlide,{className:"!h-[unset]",children:(0,t.jsx)(i,{data:o,configuration:{...e?.configuration,index:p}})},r+"SwiperSlide"+p))}));f.displayName="SwiperBox";var B=f;
1
+ "use strict";"use client";var m=Object.create;var a=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var M=(e,i)=>{for(var r in i)a(e,r,{get:i[r],enumerable:!0})},d=(e,i,r,l)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of S(i))!P.call(e,o)&&o!==r&&a(e,o,{get:()=>i[o],enumerable:!(l=u(i,o))||l.enumerable});return e};var y=(e,i,r)=>(r=e!=null?m(g(e)):{},d(i||!e||!e.__esModule?a(r,"default",{value:e,enumerable:!0}):r,e)),B=e=>d(a({},"__esModule",{value:!0}),e);var b={};M(b,{default:()=>h});module.exports=B(b);var t=require("react/jsx-runtime"),c=y(require("react")),n=require("swiper/react"),s=require("swiper/modules"),k=require("swiper/css"),G=require("swiper/css/pagination");const f=c.default.forwardRef(({data:e,Slide:i,id:r,pagination:l},o)=>(0,t.jsx)(n.Swiper,{freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,dynamicBullets:!1},className:"!overflow-visible",modules:[s.FreeMode,s.Mousewheel,s.Pagination],breakpoints:{0:{spaceBetween:16,freeMode:!1,slidesPerView:1,slidesPerGroup:1},376:{spaceBetween:16,freeMode:!1,slidesPerView:1,slidesPerGroup:1},767:{spaceBetween:16,freeMode:!1,slidesPerView:4,slidesPerGroup:4},1441:{spaceBetween:16,freeMode:!1,slidesPerView:Math.min(6,e?.list?.length),slidesPerGroup:Math.min(6,e?.list?.length)}},children:e?.list?.map((w,p)=>(0,t.jsx)(n.SwiperSlide,{className:"!h-[unset]",children:(0,t.jsx)(i,{data:w,configuration:{...e?.configuration,index:p}})},r+"SwiperSlide"+p))}));f.displayName="SwiperBox";var h=f;
2
2
  //# sourceMappingURL=SwiperCategory.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Category/SwiperCategory.tsx"],
4
- "sourcesContent": ["'use client'\nimport React from 'react'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, FreeMode, Mousewheel } from 'swiper/modules'\nimport 'swiper/css'\nimport 'swiper/css/pagination' // \u5206\u9875\u5668\u6837\u5F0F\n\nexport interface SwiperBoxProps {\n data: {\n list: any[]\n configuration?: any\n }\n pagination?: any\n id: string\n className?: string\n breakpoints?: Record<number, Object>\n Slide: React.ComponentType<{ data: any; configuration?: any }>\n}\n\nconst SwiperBox = React.forwardRef<HTMLDivElement, SwiperBoxProps>(({ data, Slide, id, pagination }) => {\n return (\n <Swiper\n freeMode={true}\n mousewheel={{\n forceToAxis: true,\n }}\n pagination={{\n clickable: true,\n dynamicBullets: false,\n }}\n className=\"!overflow-visible\"\n modules={[FreeMode, Mousewheel, Pagination]}\n breakpoints={{\n 0: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 1,\n slidesPerGroup: 1,\n },\n 376: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 1,\n slidesPerGroup: 1,\n },\n 767: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n slidesPerGroup: 4,\n },\n 1441: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: Math.min(6, data?.list?.length),\n slidesPerGroup: Math.min(6, data?.list?.length),\n },\n }}\n >\n {data?.list?.map((item, jIndex) => (\n <SwiperSlide key={id + 'SwiperSlide' + jIndex} className=\"!h-[unset]\">\n <Slide data={item} configuration={{ ...data?.configuration, index: jIndex }} />\n </SwiperSlide>\n ))}\n </Swiper>\n )\n})\n\nSwiperBox.displayName = 'SwiperBox'\n\nexport default SwiperBox\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6DU,IAAAI,EAAA,6BA5DVC,EAAkB,oBAClBA,EAAoC,wBACpCC,EAAiD,0BACjDC,EAAO,sBACPC,EAAO,iCAcP,MAAMC,EAAY,EAAAC,QAAM,WAA2C,CAAC,CAAE,KAAAC,EAAM,MAAAC,EAAO,GAAAC,EAAI,WAAAC,CAAW,OAE9F,OAAC,UACC,SAAU,GACV,WAAY,CACV,YAAa,EACf,EACA,WAAY,CACV,UAAW,GACX,eAAgB,EAClB,EACA,UAAU,oBACV,QAAS,CAAC,WAAU,aAAY,YAAU,EAC1C,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,EACf,eAAgB,CAClB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,EACf,eAAgB,CAClB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,EACf,eAAgB,CAClB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,KAAK,IAAI,EAAGH,GAAM,MAAM,MAAM,EAC7C,eAAgB,KAAK,IAAI,EAAGA,GAAM,MAAM,MAAM,CAChD,CACF,EAEC,SAAAA,GAAM,MAAM,IAAI,CAACI,EAAMC,OACtB,OAAC,eAA8C,UAAU,aACvD,mBAACJ,EAAA,CAAM,KAAMG,EAAM,cAAe,CAAE,GAAGJ,GAAM,cAAe,MAAOK,CAAO,EAAG,GAD7DH,EAAK,cAAgBG,CAEvC,CACD,EACH,CAEH,EAEDP,EAAU,YAAc,YAExB,IAAOP,EAAQO",
6
- "names": ["SwiperCategory_exports", "__export", "SwiperCategory_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_modules", "import_css", "import_pagination", "SwiperBox", "React", "data", "Slide", "id", "pagination", "item", "jIndex"]
4
+ "sourcesContent": ["'use client'\nimport React from 'react'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Pagination, FreeMode, Mousewheel } from 'swiper/modules'\nimport 'swiper/css'\nimport 'swiper/css/pagination' // \u5206\u9875\u5668\u6837\u5F0F\n\nexport interface SwiperBoxProps {\n data: {\n list: any[]\n configuration?: any\n }\n pagination?: any\n id: string\n className?: string\n breakpoints?: Record<number, Object>\n Slide: React.ComponentType<{ data: any; configuration?: any }>\n}\n\nconst SwiperBox = React.forwardRef<HTMLDivElement, SwiperBoxProps>(({ data, Slide, id, pagination }, ref) => {\n return (\n <Swiper\n freeMode={true}\n mousewheel={{\n forceToAxis: true,\n }}\n pagination={{\n clickable: true,\n dynamicBullets: false,\n }}\n className=\"!overflow-visible\"\n modules={[FreeMode, Mousewheel, Pagination]}\n breakpoints={{\n 0: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 1,\n slidesPerGroup: 1,\n },\n 376: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 1,\n slidesPerGroup: 1,\n },\n 767: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n slidesPerGroup: 4,\n },\n 1441: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: Math.min(6, data?.list?.length),\n slidesPerGroup: Math.min(6, data?.list?.length),\n },\n }}\n >\n {data?.list?.map((item, jIndex) => (\n <SwiperSlide key={id + 'SwiperSlide' + jIndex} className=\"!h-[unset]\">\n <Slide data={item} configuration={{ ...data?.configuration, index: jIndex }} />\n </SwiperSlide>\n ))}\n </Swiper>\n )\n})\n\nSwiperBox.displayName = 'SwiperBox'\n\nexport default SwiperBox\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6DU,IAAAI,EAAA,6BA5DVC,EAAkB,oBAClBA,EAAoC,wBACpCC,EAAiD,0BACjDC,EAAO,sBACPC,EAAO,iCAcP,MAAMC,EAAY,EAAAC,QAAM,WAA2C,CAAC,CAAE,KAAAC,EAAM,MAAAC,EAAO,GAAAC,EAAI,WAAAC,CAAW,EAAGC,OAEjG,OAAC,UACC,SAAU,GACV,WAAY,CACV,YAAa,EACf,EACA,WAAY,CACV,UAAW,GACX,eAAgB,EAClB,EACA,UAAU,oBACV,QAAS,CAAC,WAAU,aAAY,YAAU,EAC1C,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,EACf,eAAgB,CAClB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,EACf,eAAgB,CAClB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,EACf,eAAgB,CAClB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,KAAK,IAAI,EAAGJ,GAAM,MAAM,MAAM,EAC7C,eAAgB,KAAK,IAAI,EAAGA,GAAM,MAAM,MAAM,CAChD,CACF,EAEC,SAAAA,GAAM,MAAM,IAAI,CAACK,EAAMC,OACtB,OAAC,eAA8C,UAAU,aACvD,mBAACL,EAAA,CAAM,KAAMI,EAAM,cAAe,CAAE,GAAGL,GAAM,cAAe,MAAOM,CAAO,EAAG,GAD7DJ,EAAK,cAAgBI,CAEvC,CACD,EACH,CAEH,EAEDR,EAAU,YAAc,YAExB,IAAOP,EAAQO",
6
+ "names": ["SwiperCategory_exports", "__export", "SwiperCategory_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_modules", "import_css", "import_pagination", "SwiperBox", "React", "data", "Slide", "id", "pagination", "ref", "item", "jIndex"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var d=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var a in t)d(e,a,{get:t[a],enumerable:!0})},E=(e,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of y(t))!h.call(e,r)&&r!==a&&d(e,r,{get:()=>t[r],enumerable:!(l=v(t,r))||l.enumerable});return e};var k=e=>E(d({},"__esModule",{value:!0}),e);var D={};N(D,{default:()=>C});module.exports=k(D);var o=require("react/jsx-runtime"),x=require("../../utils/index.js"),s=require("../../../AiuiProvider/index.js"),n=require("../../../../components/index.js"),p=require("../../../../helpers/index.js"),m=require("./type.js");const w=({item:e,index:t,active:a,toggleShipping:l,currencyCode:r,metafields:c,className:b=""})=>{const{trackingData:u,locale:f="us"}=(0,s.useAiuiContext)(),g=u?.common?.copywriting;return(0,o.jsxs)("div",{role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&l(e,t)},className:(0,p.cn)("laptop:rounded-2xl laptop:py-5 relative flex cursor-pointer gap-[16px] overflow-hidden rounded-xl border-2 border-[#E8E8E8] p-4 text-[#1F2021]",{"cursor-not-allowed opacity-60":e.disabled,"border-brand":a},b),onClick:()=>l(e,t),children:[(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(n.Text,{className:(0,p.cn)("laptop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4]",{}),as:"p",html:e.title}),(0,o.jsx)(n.Text,{className:(0,p.cn)("laptop:text-[14px] mt-[8px] text-[12px] font-bold leading-[1.4] text-[#6D6D6F]",{}),as:"p",html:e.subtitle})]}),(0,o.jsx)(n.Text,{className:(0,p.cn)("relative my-auto h-fit text-xl font-bold",{}),as:"p",html:e.price?(0,x.formatPrice)({amount:e.price,currencyCode:r,locale:f,removeTrailingZeros:!0}):g?.free}),e.mode!==m.ShippingMethodMode.FREE&&(0,o.jsx)("div",{className:(0,p.cn)("bg-brand absolute -right-px -top-px rounded-bl-[8px] rounded-tr-[8px] px-[8px] py-[3px] text-[12px] font-bold leading-[1.4] text-white"),children:c?.memberOnly})]})};var C=w;
1
+ "use strict";var i=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var h=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var a in t)i(e,a,{get:t[a],enumerable:!0})},w=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v(t))!h.call(e,r)&&r!==a&&i(e,r,{get:()=>t[r],enumerable:!(n=y(t,r))||n.enumerable});return e};var E=e=>w(i({},"__esModule",{value:!0}),e);var D={};N(D,{default:()=>C});module.exports=E(D);var o=require("react/jsx-runtime"),s=require("../../utils/index.js"),x=require("../../../AiuiProvider/index.js"),l=require("../../../../components/index.js"),p=require("../../../../helpers/index.js"),m=require("./type.js");const k=({item:e,index:t,active:a,toggleShipping:n,currencyCode:r,metafields:c,className:b=""})=>{const{trackingData:u,locale:f="us"}=(0,x.useAiuiContext)(),g=u?.common?.copywriting;return(0,o.jsxs)("div",{role:"button",tabIndex:0,onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&n(e,t)},className:(0,p.cn)("laptop:rounded-2xl laptop:py-5 relative flex cursor-pointer justify-between gap-[16px] overflow-hidden rounded-xl border-2 border-[#E8E8E8] p-4 text-[#1F2021]",{"cursor-not-allowed opacity-60":e.disabled,"border-brand":a},b),onClick:()=>n(e,t),children:[(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(l.Text,{className:(0,p.cn)("laptop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4]",{}),as:"p",html:e.title}),(0,o.jsx)(l.Text,{className:(0,p.cn)("laptop:text-[14px] mt-[8px] text-[12px] font-bold leading-[1.4] text-[#6D6D6F]",{}),as:"p",html:e.subtitle})]}),(0,o.jsx)(l.Text,{className:(0,p.cn)("relative my-auto h-fit text-xl font-bold",{}),as:"p",html:e.price?(0,s.formatPrice)({amount:e.price,currencyCode:r,locale:f,removeTrailingZeros:!0}):g?.free}),e.mode!==m.ShippingMethodMode.FREE&&(0,o.jsx)("div",{className:(0,p.cn)("bg-brand absolute -right-px -top-px rounded-bl-[8px] rounded-tr-[8px] px-[8px] py-[3px] text-[12px] font-bold leading-[1.4] text-white"),children:c?.memberOnly})]})};var C=k;
2
2
  //# sourceMappingURL=ShippingMethod.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/ShippingMethod.tsx"],
4
- "sourcesContent": ["import { formatPrice } from '../../utils/index.js'\nimport { useAiuiContext } from '../../../AiuiProvider/index.js'\nimport { Text } from '../../../../components/index.js'\nimport { cn } from '../../../../helpers/index.js'\nimport { ShippingMethodMode } from './type.js'\n\nconst ShippingMethod = ({\n item,\n index,\n active,\n toggleShipping,\n currencyCode,\n metafields,\n className = '',\n}: {\n item: any\n index: number\n active: boolean\n toggleShipping: (item: any, index: number) => void\n currencyCode: string\n metafields: any\n className?: string\n}) => {\n const { trackingData, locale = 'us' } = useAiuiContext()\n const shopCommon = trackingData?.common?.copywriting\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n toggleShipping(item, index)\n }\n }}\n className={cn(\n 'laptop:rounded-2xl laptop:py-5 relative flex cursor-pointer gap-[16px] overflow-hidden rounded-xl border-2 border-[#E8E8E8] p-4 text-[#1F2021]',\n {\n 'cursor-not-allowed opacity-60': item.disabled,\n 'border-brand': active,\n },\n className\n )}\n onClick={() => toggleShipping(item, index)}\n >\n <div className=\"relative\">\n <Text\n className={cn('laptop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4]', {})}\n as=\"p\"\n html={item.title}\n />\n <Text\n className={cn('laptop:text-[14px] mt-[8px] text-[12px] font-bold leading-[1.4] text-[#6D6D6F]', {})}\n as=\"p\"\n html={item.subtitle}\n />\n </div>\n\n <Text\n className={cn('relative my-auto h-fit text-xl font-bold', {})}\n as=\"p\"\n html={\n item.price\n ? formatPrice({\n amount: item.price,\n currencyCode,\n locale,\n removeTrailingZeros: true,\n })\n : shopCommon?.free\n }\n />\n {item.mode !== ShippingMethodMode.FREE && (\n <div\n className={cn(\n 'bg-brand absolute -right-px -top-px rounded-bl-[8px] rounded-tr-[8px] px-[8px] py-[3px] text-[12px] font-bold leading-[1.4] text-white'\n )}\n >\n {metafields?.memberOnly}\n </div>\n )}\n </div>\n )\n}\n\nexport default ShippingMethod\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6CM,IAAAI,EAAA,6BA7CNC,EAA4B,gCAC5BC,EAA+B,0CAC/BC,EAAqB,2CACrBC,EAAmB,wCACnBC,EAAmC,qBAEnC,MAAMC,EAAiB,CAAC,CACtB,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,eAAAC,EACA,aAAAC,EACA,WAAAC,EACA,UAAAC,EAAY,EACd,IAQM,CACJ,KAAM,CAAE,aAAAC,EAAc,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACjDC,EAAaF,GAAc,QAAQ,YAEzC,SACE,QAAC,OACC,KAAK,SACL,SAAU,EACV,UAAWG,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCP,EAAeH,EAAMC,CAAK,CAE9B,EACA,aAAW,MACT,iJACA,CACE,gCAAiCD,EAAK,SACtC,eAAgBE,CAClB,EACAI,CACF,EACA,QAAS,IAAMH,EAAeH,EAAMC,CAAK,EAEzC,qBAAC,OAAI,UAAU,WACb,oBAAC,QACC,aAAW,MAAG,gFAAiF,CAAC,CAAC,EACjG,GAAG,IACH,KAAMD,EAAK,MACb,KACA,OAAC,QACC,aAAW,MAAG,iFAAkF,CAAC,CAAC,EAClG,GAAG,IACH,KAAMA,EAAK,SACb,GACF,KAEA,OAAC,QACC,aAAW,MAAG,2CAA4C,CAAC,CAAC,EAC5D,GAAG,IACH,KACEA,EAAK,SACD,eAAY,CACV,OAAQA,EAAK,MACb,aAAAI,EACA,OAAAI,EACA,oBAAqB,EACvB,CAAC,EACDC,GAAY,KAEpB,EACCT,EAAK,OAAS,qBAAmB,SAChC,OAAC,OACC,aAAW,MACT,wIACF,EAEC,SAAAK,GAAY,WACf,GAEJ,CAEJ,EAEA,IAAOd,EAAQQ",
4
+ "sourcesContent": ["import { formatPrice } from '../../utils/index.js'\nimport { useAiuiContext } from '../../../AiuiProvider/index.js'\nimport { Text } from '../../../../components/index.js'\nimport { cn } from '../../../../helpers/index.js'\nimport { ShippingMethodMode } from './type.js'\n\nconst ShippingMethod = ({\n item,\n index,\n active,\n toggleShipping,\n currencyCode,\n metafields,\n className = '',\n}: {\n item: any\n index: number\n active: boolean\n toggleShipping: (item: any, index: number) => void\n currencyCode: string\n metafields: any\n className?: string\n}) => {\n const { trackingData, locale = 'us' } = useAiuiContext()\n const shopCommon = trackingData?.common?.copywriting\n\n return (\n <div\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n toggleShipping(item, index)\n }\n }}\n className={cn(\n 'laptop:rounded-2xl laptop:py-5 relative flex cursor-pointer justify-between gap-[16px] overflow-hidden rounded-xl border-2 border-[#E8E8E8] p-4 text-[#1F2021]',\n {\n 'cursor-not-allowed opacity-60': item.disabled,\n 'border-brand': active,\n },\n className\n )}\n onClick={() => toggleShipping(item, index)}\n >\n <div className=\"relative\">\n <Text\n className={cn('laptop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.4]', {})}\n as=\"p\"\n html={item.title}\n />\n <Text\n className={cn('laptop:text-[14px] mt-[8px] text-[12px] font-bold leading-[1.4] text-[#6D6D6F]', {})}\n as=\"p\"\n html={item.subtitle}\n />\n </div>\n\n <Text\n className={cn('relative my-auto h-fit text-xl font-bold', {})}\n as=\"p\"\n html={\n item.price\n ? formatPrice({\n amount: item.price,\n currencyCode,\n locale,\n removeTrailingZeros: true,\n })\n : shopCommon?.free\n }\n />\n {item.mode !== ShippingMethodMode.FREE && (\n <div\n className={cn(\n 'bg-brand absolute -right-px -top-px rounded-bl-[8px] rounded-tr-[8px] px-[8px] py-[3px] text-[12px] font-bold leading-[1.4] text-white'\n )}\n >\n {metafields?.memberOnly}\n </div>\n )}\n </div>\n )\n}\n\nexport default ShippingMethod\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6CM,IAAAI,EAAA,6BA7CNC,EAA4B,gCAC5BC,EAA+B,0CAC/BC,EAAqB,2CACrBC,EAAmB,wCACnBC,EAAmC,qBAEnC,MAAMC,EAAiB,CAAC,CACtB,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,eAAAC,EACA,aAAAC,EACA,WAAAC,EACA,UAAAC,EAAY,EACd,IAQM,CACJ,KAAM,CAAE,aAAAC,EAAc,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACjDC,EAAaF,GAAc,QAAQ,YAEzC,SACE,QAAC,OACC,KAAK,SACL,SAAU,EACV,UAAWG,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCP,EAAeH,EAAMC,CAAK,CAE9B,EACA,aAAW,MACT,kKACA,CACE,gCAAiCD,EAAK,SACtC,eAAgBE,CAClB,EACAI,CACF,EACA,QAAS,IAAMH,EAAeH,EAAMC,CAAK,EAEzC,qBAAC,OAAI,UAAU,WACb,oBAAC,QACC,aAAW,MAAG,gFAAiF,CAAC,CAAC,EACjG,GAAG,IACH,KAAMD,EAAK,MACb,KACA,OAAC,QACC,aAAW,MAAG,iFAAkF,CAAC,CAAC,EAClG,GAAG,IACH,KAAMA,EAAK,SACb,GACF,KAEA,OAAC,QACC,aAAW,MAAG,2CAA4C,CAAC,CAAC,EAC5D,GAAG,IACH,KACEA,EAAK,SACD,eAAY,CACV,OAAQA,EAAK,MACb,aAAAI,EACA,OAAAI,EACA,oBAAqB,EACvB,CAAC,EACDC,GAAY,KAEpB,EACCT,EAAK,OAAS,qBAAmB,SAChC,OAAC,OACC,aAAW,MACT,wIACF,EAEC,SAAAK,GAAY,WACf,GAEJ,CAEJ,EAEA,IAAOd,EAAQQ",
6
6
  "names": ["ShippingMethod_exports", "__export", "ShippingMethod_default", "__toCommonJS", "import_jsx_runtime", "import_utils", "import_AiuiProvider", "import_components", "import_helpers", "import_type", "ShippingMethod", "item", "index", "active", "toggleShipping", "currencyCode", "metafields", "className", "trackingData", "locale", "shopCommon", "e"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var c=(i,t)=>{for(var o in t)n(i,o,{get:t[o],enumerable:!0})},f=(i,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of x(t))!d.call(i,l)&&l!==o&&n(i,l,{get:()=>t[l],enumerable:!(s=g(t,l))||s.enumerable});return i};var v=i=>f(n({},"__esModule",{value:!0}),i);var N={};c(N,{ShippingPolicyModal:()=>h});module.exports=v(N);var e=require("react/jsx-runtime"),p=require("../../../../components/index.js"),a=require("../../../../components/index.js"),S=require("react");const h=({data:i,onClose:t,open:o})=>(0,e.jsx)(a.Dialog,{open:o,onOpenChange:t,children:(0,e.jsxs)(a.DialogContent,{className:"tablet:max-w-[729px] mx-auto w-full max-w-[326px] overflow-hidden border-none",children:[(0,e.jsx)(p.Text,{className:"text-[32px] font-bold leading-[1.2] md:text-[20px]",html:i?.title}),(0,e.jsxs)("div",{className:"mt-[16px]",children:[(0,e.jsx)(p.Text,{className:"text-[20px] font-bold leading-[1.2] md:text-[16px]",html:i?.shippingCoupon?.title}),(0,e.jsx)("ul",{className:"mt-3 grid grid-flow-row gap-[4px] font-semibold leading-[1.4]",children:i?.shippingCoupon?.list.map((s,l)=>(0,e.jsxs)("li",{className:"text-[16px]",children:[(0,e.jsxs)("span",{children:[l+1,"."]}),(0,e.jsx)("span",{className:"ml-[4px]",children:s})]},l))}),(0,e.jsxs)("div",{className:"mt-[24px] md:mt-[16px]",children:[(0,e.jsx)(p.Text,{className:"text-[20px] font-bold leading-[1.2] md:text-[16px]",html:i?.shippingService?.title}),(0,e.jsx)("div",{className:"mt-[12px] grid w-full grid-cols-2 gap-[12px] md:grid-cols-1",children:i?.shippingService?.list.map((s,l)=>(0,e.jsxs)("div",{className:"rounded-[12px] bg-[#F5F5F7] p-[16px] md:p-[12px]",children:[(0,e.jsx)(p.Text,{as:"p",className:"text-[20px] font-bold leading-[1.2] md:text-[16px]",html:s.title}),(0,e.jsx)("div",{className:"mt-[12px] grid grid-flow-row gap-[4px]",children:s.list.map((m,r)=>(0,e.jsx)(p.Text,{as:"p",className:"text-[16px] font-semibold leading-[1.2]",children:m},r))})]},l))})]}),(0,e.jsx)(p.Link,{className:"mt-[16px] block text-[16px] font-semibold leading-[1.2] underline",href:`${i?.terms?.url}`,children:i?.terms?.text})]})]})});
1
+ "use strict";var n=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var c=(i,t)=>{for(var o in t)n(i,o,{get:t[o],enumerable:!0})},f=(i,t,o,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of d(t))!x.call(i,l)&&l!==o&&n(i,l,{get:()=>t[l],enumerable:!(s=g(t,l))||s.enumerable});return i};var v=i=>f(n({},"__esModule",{value:!0}),i);var N={};c(N,{ShippingPolicyModal:()=>h});module.exports=v(N);var e=require("react/jsx-runtime"),p=require("../../../../components/index.js"),a=require("../../../../components/index.js"),S=require("react");const h=({data:i,onClose:t,open:o})=>(0,e.jsx)(a.Dialog,{open:o,onOpenChange:t,children:(0,e.jsxs)(a.DialogContent,{className:"tablet:max-w-[729px] mx-auto w-full max-w-[326px] overflow-hidden rounded-lg border-none",children:[(0,e.jsx)(p.Text,{className:"text-[32px] font-bold leading-[1.2] md:text-[20px]",html:i?.title}),(0,e.jsxs)("div",{className:"mt-[16px]",children:[(0,e.jsx)(p.Text,{className:"text-[20px] font-bold leading-[1.2] md:text-[16px]",html:i?.shippingCoupon?.title}),(0,e.jsx)("ul",{className:"mt-3 grid grid-flow-row gap-[4px] font-semibold leading-[1.4]",children:i?.shippingCoupon?.list.map((s,l)=>(0,e.jsxs)("li",{className:"text-[16px]",children:[(0,e.jsxs)("span",{children:[l+1,"."]}),(0,e.jsx)("span",{className:"ml-[4px]",children:s})]},l))}),(0,e.jsxs)("div",{className:"mt-[24px] md:mt-[16px]",children:[(0,e.jsx)(p.Text,{className:"text-[20px] font-bold leading-[1.2] md:text-[16px]",html:i?.shippingService?.title}),(0,e.jsx)("div",{className:"mt-[12px] grid w-full grid-cols-2 gap-[12px] md:grid-cols-1",children:i?.shippingService?.list.map((s,l)=>(0,e.jsxs)("div",{className:"rounded-[12px] bg-[#F5F5F7] p-[16px] md:p-[12px]",children:[(0,e.jsx)(p.Text,{as:"p",className:"text-[20px] font-bold leading-[1.2] md:text-[16px]",html:s.title}),(0,e.jsx)("div",{className:"mt-[12px] grid grid-flow-row gap-[4px]",children:s.list.map((m,r)=>(0,e.jsx)(p.Text,{as:"p",className:"text-[16px] font-semibold leading-[1.2]",children:m},r))})]},l))})]}),(0,e.jsx)(p.Link,{className:"mt-[16px] block text-[16px] font-semibold leading-[1.2] underline",href:`${i?.terms?.url}`,children:i?.terms?.text})]})]})});
2
2
  //# sourceMappingURL=ShippingPolicyModal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.tsx"],
4
- "sourcesContent": ["import { Text, Link } from '../../../../components/index.js'\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '../../../../components/index.js'\nimport { useMemo } from 'react'\n\ninterface Terms {\n text: string\n url: string\n}\n\ninterface List {\n title: string\n list: string[]\n}\n\ninterface ShippingService {\n title: string\n list: List[]\n}\n\ninterface Data {\n title: string\n shippingCoupon: List\n shippingService: ShippingService\n terms: Terms\n}\n\ninterface Props {\n data: Data\n onClose: () => void\n open: boolean\n}\n\nexport const ShippingPolicyModal = ({ data, onClose, open }: Props) => {\n return (\n <Dialog open={open} onOpenChange={onClose}>\n <DialogContent className=\"tablet:max-w-[729px] mx-auto w-full max-w-[326px] overflow-hidden border-none\">\n <Text className=\"text-[32px] font-bold leading-[1.2] md:text-[20px]\" html={data?.title} />\n <div className=\"mt-[16px]\">\n <Text className=\"text-[20px] font-bold leading-[1.2] md:text-[16px]\" html={data?.shippingCoupon?.title} />\n <ul className=\"mt-3 grid grid-flow-row gap-[4px] font-semibold leading-[1.4]\">\n {data?.shippingCoupon?.list.map((item, index) => (\n <li className=\"text-[16px]\" key={index}>\n <span>{index + 1}.</span>\n <span className=\"ml-[4px]\">{item}</span>\n </li>\n ))}\n </ul>\n <div className=\"mt-[24px] md:mt-[16px]\">\n <Text className=\"text-[20px] font-bold leading-[1.2] md:text-[16px]\" html={data?.shippingService?.title} />\n <div className=\"mt-[12px] grid w-full grid-cols-2 gap-[12px] md:grid-cols-1\">\n {data?.shippingService?.list.map((item, index) => (\n <div className=\"rounded-[12px] bg-[#F5F5F7] p-[16px] md:p-[12px]\" key={index}>\n <Text as=\"p\" className=\"text-[20px] font-bold leading-[1.2] md:text-[16px]\" html={item.title} />\n <div className=\"mt-[12px] grid grid-flow-row gap-[4px]\">\n {item.list.map((subItem, subIndex) => (\n <Text as=\"p\" className=\"text-[16px] font-semibold leading-[1.2]\" key={subIndex}>\n {subItem}\n </Text>\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n\n <Link\n className=\"mt-[16px] block text-[16px] font-semibold leading-[1.2] underline\"\n href={`${data?.terms?.url}`}\n >\n {data?.terms?.text}\n </Link>\n </div>\n </DialogContent>\n </Dialog>\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,yBAAAE,IAAA,eAAAC,EAAAH,GAoCQ,IAAAI,EAAA,6BApCRC,EAA2B,2CAC3BA,EAAgF,2CAChFC,EAAwB,iBA8BjB,MAAMJ,EAAsB,CAAC,CAAE,KAAAK,EAAM,QAAAC,EAAS,KAAAC,CAAK,OAEtD,OAAC,UAAO,KAAMA,EAAM,aAAcD,EAChC,oBAAC,iBAAc,UAAU,gFACvB,oBAAC,QAAK,UAAU,qDAAqD,KAAMD,GAAM,MAAO,KACxF,QAAC,OAAI,UAAU,YACb,oBAAC,QAAK,UAAU,qDAAqD,KAAMA,GAAM,gBAAgB,MAAO,KACxG,OAAC,MAAG,UAAU,gEACX,SAAAA,GAAM,gBAAgB,KAAK,IAAI,CAACG,EAAMC,OACrC,QAAC,MAAG,UAAU,cACZ,qBAAC,QAAM,UAAAA,EAAQ,EAAE,KAAC,KAClB,OAAC,QAAK,UAAU,WAAY,SAAAD,EAAK,IAFFC,CAGjC,CACD,EACH,KACA,QAAC,OAAI,UAAU,yBACb,oBAAC,QAAK,UAAU,qDAAqD,KAAMJ,GAAM,iBAAiB,MAAO,KACzG,OAAC,OAAI,UAAU,8DACZ,SAAAA,GAAM,iBAAiB,KAAK,IAAI,CAACG,EAAMC,OACtC,QAAC,OAAI,UAAU,mDACb,oBAAC,QAAK,GAAG,IAAI,UAAU,qDAAqD,KAAMD,EAAK,MAAO,KAC9F,OAAC,OAAI,UAAU,yCACZ,SAAAA,EAAK,KAAK,IAAI,CAACE,EAASC,OACvB,OAAC,QAAK,GAAG,IAAI,UAAU,0CACpB,SAAAD,GADmEC,CAEtE,CACD,EACH,IARqEF,CASvE,CACD,EACH,GACF,KAEA,OAAC,QACC,UAAU,oEACV,KAAM,GAAGJ,GAAM,OAAO,GAAG,GAExB,SAAAA,GAAM,OAAO,KAChB,GACF,GACF,EACF",
4
+ "sourcesContent": ["import { Text, Link } from '../../../../components/index.js'\nimport { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '../../../../components/index.js'\nimport { useMemo } from 'react'\n\ninterface Terms {\n text: string\n url: string\n}\n\ninterface List {\n title: string\n list: string[]\n}\n\ninterface ShippingService {\n title: string\n list: List[]\n}\n\ninterface Data {\n title: string\n shippingCoupon: List\n shippingService: ShippingService\n terms: Terms\n}\n\ninterface Props {\n data: Data\n onClose: () => void\n open: boolean\n}\n\nexport const ShippingPolicyModal = ({ data, onClose, open }: Props) => {\n return (\n <Dialog open={open} onOpenChange={onClose}>\n <DialogContent className=\"tablet:max-w-[729px] mx-auto w-full max-w-[326px] overflow-hidden rounded-lg border-none\">\n <Text className=\"text-[32px] font-bold leading-[1.2] md:text-[20px]\" html={data?.title} />\n <div className=\"mt-[16px]\">\n <Text className=\"text-[20px] font-bold leading-[1.2] md:text-[16px]\" html={data?.shippingCoupon?.title} />\n <ul className=\"mt-3 grid grid-flow-row gap-[4px] font-semibold leading-[1.4]\">\n {data?.shippingCoupon?.list.map((item, index) => (\n <li className=\"text-[16px]\" key={index}>\n <span>{index + 1}.</span>\n <span className=\"ml-[4px]\">{item}</span>\n </li>\n ))}\n </ul>\n <div className=\"mt-[24px] md:mt-[16px]\">\n <Text className=\"text-[20px] font-bold leading-[1.2] md:text-[16px]\" html={data?.shippingService?.title} />\n <div className=\"mt-[12px] grid w-full grid-cols-2 gap-[12px] md:grid-cols-1\">\n {data?.shippingService?.list.map((item, index) => (\n <div className=\"rounded-[12px] bg-[#F5F5F7] p-[16px] md:p-[12px]\" key={index}>\n <Text as=\"p\" className=\"text-[20px] font-bold leading-[1.2] md:text-[16px]\" html={item.title} />\n <div className=\"mt-[12px] grid grid-flow-row gap-[4px]\">\n {item.list.map((subItem, subIndex) => (\n <Text as=\"p\" className=\"text-[16px] font-semibold leading-[1.2]\" key={subIndex}>\n {subItem}\n </Text>\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n\n <Link\n className=\"mt-[16px] block text-[16px] font-semibold leading-[1.2] underline\"\n href={`${data?.terms?.url}`}\n >\n {data?.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",
6
6
  "names": ["ShippingPolicyModal_exports", "__export", "ShippingPolicyModal", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react", "data", "onClose", "open", "item", "index", "subItem", "subIndex"]
7
7
  }
@@ -1,2 +1,6 @@
1
- "use strict";var v=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var E=(a,l)=>{for(var r in l)v(a,r,{get:l[r],enumerable:!0})},D=(a,l,r,c)=>{if(l&&typeof l=="object"||typeof l=="function")for(let o of C(l))!T.call(a,o)&&o!==r&&v(a,o,{get:()=>l[o],enumerable:!(c=N(l,o))||c.enumerable});return a};var H=a=>D(v({},"__esModule",{value:!0}),a);var _={};E(_,{default:()=>L});module.exports=H(_);var e=require("react/jsx-runtime"),i=require("../../../../../../components/index.js"),s=require("@radix-ui/react-tabs"),n=require("react"),x=require("../../../../../../helpers/index.js"),b=require("../../../../BizProductProvider.js"),k=require("../../../../../../shared/Styles.js"),w=require("../../../../../../shared/track.js");const P=()=>{const{product:a,variant:l}=(0,b.useBizProductContext)(),[r,c]=(0,n.useState)(!1),o=(0,n.useMemo)(()=>a?.payload?.components?.find(t=>t.componentKey==="ProductHighlight")?.data||{},[a?.payload]),[p,g]=(0,n.useState)(o?.ksp?.[0]),d=(0,n.useCallback)(t=>{(0,w.gaTrack)({event:"ga4Event",event_name:"lp_button",event_parameters:{page_group:`Product Detail Page${l.sku}`,position:o?.title||"",button_name:t||o?.view||""}})},[o?.title,o?.view,l.sku]);return(0,e.jsxs)("div",{className:"ipc-product-detail-highlight",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[o?.title&&(0,e.jsx)(i.Text,{size:3,className:"font-bold leading-[1.2]",html:o?.title}),(0,e.jsxs)(i.Dialog,{open:r,onOpenChange:c,children:[(0,e.jsx)(i.DialogTrigger,{asChild:!0,children:(0,e.jsx)(i.Button,{variant:"link",className:"!p-0 text-base font-bold",onClick:()=>d(),children:o?.view})}),(0,e.jsx)(I,{ksp:o?.ksp||[],clickActiveKspItem:p,gaTrackEvent:d})]})]}),(0,e.jsx)("div",{className:"lg-desktop:mt-4 mt-3 flex flex-wrap gap-4",children:o?.ksp?.map(t=>(0,e.jsx)("div",{className:"product-highlight-item lg-desktop:h-[38px] lg-desktop:leading-[38px] h-[36px] cursor-pointer rounded-full bg-[#F5F5F7] px-4 leading-[36px] hover:bg-[#EAEAEC]",children:(0,e.jsx)(i.Text,{size:3,onClick:()=>{g(t),c(!0),d(t?.title)},className:"lg-desktop:text-[16px] line-clamp-1 overflow-hidden break-all text-[14px] font-bold text-[#1D1D1F]",html:t?.title})},t?.title))})]})},I=({ksp:a,clickActiveKspItem:l,gaTrackEvent:r})=>{const c=(0,n.useRef)([]),o=(0,n.useRef)(null),[p,g]=(0,n.useState)(null),d=(0,n.useCallback)(t=>{const m=a.findIndex(f=>f.title===t?.title),u=c.current[m];if(u&&o.current){const f=o.current,h=u,y=h.offsetLeft-f.offsetWidth/2+h.offsetWidth/2;f.scrollTo({left:y,behavior:"smooth"})}},[l,a]);return(0,n.useEffect)(()=>{l&&(g(l),setTimeout(()=>{d(p)},100))},[l,d]),(0,e.jsx)(i.DialogContent,{className:"tablet:max-w-[896px] tablet:rounded-2xl [&_.dialog-close-icon]:laptop:size-6 mx-auto w-full max-w-[326px] overflow-hidden rounded-xl border-none p-0 [&_.dialog-close-icon]:size-4",children:(0,e.jsxs)(s.Root,{defaultValue:p?.title,className:"w-full overflow-hidden",children:[a?.map(t=>(0,e.jsx)(s.Content,{value:t.title,children:(0,e.jsx)(i.Picture,{source:`${t?.mobileImg}, ${t?.img} 767`,className:"desktop:h-[480px] h-[304px] w-full",alt:t.img.alt,imgClassName:"object-cover h-full"})},t.title)),(0,e.jsxs)("div",{className:"desktop:py-6 w-full overflow-visible py-4",children:[(0,e.jsx)("div",{ref:o,style:{scrollbarWidth:"none",msOverflowStyle:"none"},className:"desktop:px-6 overflow-x-auto px-4",children:(0,e.jsx)("div",{className:"w-fit rounded-full bg-[#EAEAEC]",children:(0,e.jsx)(s.List,{className:"flex w-max p-1",children:a.map((t,m)=>(0,e.jsx)(s.Trigger,{ref:u=>{u&&(c.current[m]=u)},className:(0,x.cn)("lg-desktop:px-7 h-[38px] shrink-0 rounded-full px-5 leading-[38px]",t.title===p?.title&&"bg-white"),onClick:()=>{d(t),g(t),r(t?.title)},value:t.title,children:(0,e.jsx)(i.Text,{html:t.title,className:"text-[14px] font-bold leading-[1.2]"})},m))})})}),(0,e.jsx)("div",{className:"desktop:px-6 mt-4 px-4",children:a.map(t=>(0,e.jsx)(s.Content,{value:t.title,className:"desktop:text-[18px] text-base font-bold",children:t.description}))})]})]})})};var L=(0,k.withLayout)(P);
1
+ "use strict";var v=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var E=(a,l)=>{for(var r in l)v(a,r,{get:l[r],enumerable:!0})},D=(a,l,r,c)=>{if(l&&typeof l=="object"||typeof l=="function")for(let o of C(l))!T.call(a,o)&&o!==r&&v(a,o,{get:()=>l[o],enumerable:!(c=N(l,o))||c.enumerable});return a};var H=a=>D(v({},"__esModule",{value:!0}),a);var _={};E(_,{default:()=>L});module.exports=H(_);var e=require("react/jsx-runtime"),i=require("../../../../../../components/index.js"),s=require("@radix-ui/react-tabs"),n=require("react"),h=require("../../../../../../helpers/index.js"),k=require("../../../../BizProductProvider.js"),b=require("../../../../../../shared/Styles.js"),y=require("../../../../../../shared/track.js");const P=()=>{const{product:a,variant:l}=(0,k.useBizProductContext)(),[r,c]=(0,n.useState)(!1),o=(0,n.useMemo)(()=>a?.payload?.components?.find(t=>t.componentKey==="ProductHighlight")?.data||{},[a?.payload]),[d,f]=(0,n.useState)(o?.ksp?.[0]),p=(0,n.useCallback)(t=>{(0,y.gaTrack)({event:"ga4Event",event_name:"lp_button",event_parameters:{page_group:`Product Detail Page${l.sku}`,position:o?.title||"",button_name:t||o?.view||""}})},[o?.title,o?.view,l.sku]);return(0,e.jsxs)("div",{className:"ipc-product-detail-highlight",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[o?.title&&(0,e.jsx)(i.Text,{size:3,className:"font-bold leading-[1.2]",html:o?.title}),(0,e.jsxs)(i.Dialog,{open:r,onOpenChange:c,children:[(0,e.jsx)(i.DialogTrigger,{asChild:!0,children:(0,e.jsx)(i.Button,{variant:"link",className:"!p-0 text-base font-bold",onClick:()=>p(),children:o?.view})}),(0,e.jsx)(I,{ksp:o?.ksp||[],clickActiveKspItem:d,gaTrackEvent:p})]})]}),(0,e.jsx)("div",{className:"lg-desktop:mt-4 mt-3 flex flex-wrap gap-4",children:o?.ksp?.map(t=>(0,e.jsx)("div",{className:"product-highlight-item lg-desktop:h-[38px] lg-desktop:leading-[38px] h-[36px] cursor-pointer rounded-full bg-[#F5F5F7] px-4 leading-[36px] hover:bg-[#EAEAEC]",children:(0,e.jsx)(i.Text,{size:3,onClick:()=>{f(t),c(!0),p(t?.title)},className:"lg-desktop:text-[16px] line-clamp-1 overflow-hidden break-all text-[14px] font-bold text-[#1D1D1F]",html:t?.title})},t?.title))})]})},I=({ksp:a,clickActiveKspItem:l,gaTrackEvent:r})=>{const c=(0,n.useRef)([]),o=(0,n.useRef)(null),[d,f]=(0,n.useState)(null),p=(0,n.useCallback)(t=>{const g=a.findIndex(m=>m.title===t?.title),u=c.current[g];if(u&&o.current){const m=o.current,x=u,w=x.offsetLeft-m.offsetWidth/2+x.offsetWidth/2;m.scrollTo({left:w,behavior:"smooth"})}},[l,a]);return(0,n.useEffect)(()=>{l&&(f(l),setTimeout(()=>{p(d)},100))},[l,p]),(0,e.jsxs)(i.DialogContent,{className:"tablet:max-w-[896px] tablet:rounded-2xl [&_.dialog-close-icon]:laptop:size-6 mx-auto w-full max-w-[326px] overflow-hidden rounded-xl border-none p-0 [&_.dialog-close-icon]:size-4",children:[(0,e.jsx)("style",{children:`
2
+ .dialog-close-icon {
3
+ color: ${d?.closeColor};
4
+ }
5
+ `}),(0,e.jsxs)(s.Root,{value:d?.title,className:"w-full overflow-hidden",children:[a?.map(t=>(0,e.jsx)(s.Content,{value:t.title,children:(0,e.jsx)(i.Picture,{source:`${t?.img}, ${t?.mobileImg} 767`,className:"desktop:h-[480px] h-[304px] w-full",alt:t.img.alt,imgClassName:"object-cover h-full"})},t.title)),(0,e.jsxs)("div",{className:"desktop:py-6 w-full overflow-visible py-4",children:[(0,e.jsx)("div",{ref:o,style:{scrollbarWidth:"none",msOverflowStyle:"none"},className:"desktop:px-6 overflow-x-auto px-4",children:(0,e.jsx)("div",{className:"w-fit rounded-full bg-[#EAEAEC]",children:(0,e.jsx)(s.List,{className:"flex w-max p-1",children:a?.map((t,g)=>(0,e.jsx)(s.Trigger,{ref:u=>{u&&(c.current[g]=u)},className:(0,h.cn)("lg-desktop:px-7 h-[38px] shrink-0 rounded-full px-5 leading-[38px]",t.title===d?.title&&"bg-white"),onClick:()=>{p(t),f(t),r(t?.title)},value:t.title,children:(0,e.jsx)(i.Text,{html:t.title,className:"text-[14px] font-bold leading-[1.2]"})},g+t.title))})})}),(0,e.jsx)("div",{className:"desktop:px-6 mt-4 px-4",children:a?.map((t,g)=>(0,e.jsx)(s.Content,{value:t.title,className:"desktop:text-[18px] text-[14px] font-bold",children:t.description},g+t.title))})]})]})]})};var L=(0,b.withLayout)(P);
2
6
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.tsx"],
4
- "sourcesContent": ["import type { HighlightProps } from '../types'\nimport {\n Text,\n Picture,\n Button,\n Heading,\n Dialog,\n DialogContent,\n DialogTrigger,\n} from '../../../../../../components/index.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { gaTrack } from '../../../../../../shared/track.js'\n\nconst ProductHighlight = () => {\n const { product, variant } = useBizProductContext()\n const [open, setOpen] = useState(false)\n\n const productHighlightData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductHighlight')?.data || {}\n }, [product?.payload])\n\n const [activeKspItem, setActiveKspItem] = useState(productHighlightData?.ksp?.[0])\n\n const gaTrackEvent = useCallback(\n (buttonName?: string) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: `Product Detail Page${variant.sku}`,\n position: productHighlightData?.title || '',\n button_name: buttonName || productHighlightData?.view || '',\n },\n })\n },\n [productHighlightData?.title, productHighlightData?.view, variant.sku]\n )\n\n return (\n <div className=\"ipc-product-detail-highlight\">\n <div className=\"flex items-center justify-between\">\n {productHighlightData?.title && (\n <Text size={3} className=\"font-bold leading-[1.2]\" html={productHighlightData?.title} />\n )}\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant=\"link\" className=\"!p-0 text-base font-bold\" onClick={() => gaTrackEvent()}>\n {productHighlightData?.view}\n </Button>\n </DialogTrigger>\n <ProductHighlightModal\n ksp={productHighlightData?.ksp || []}\n clickActiveKspItem={activeKspItem}\n gaTrackEvent={gaTrackEvent}\n />\n </Dialog>\n </div>\n <div className=\"lg-desktop:mt-4 mt-3 flex flex-wrap gap-4\">\n {productHighlightData?.ksp?.map((item: any) => (\n <div\n key={item?.title}\n className=\"product-highlight-item lg-desktop:h-[38px] lg-desktop:leading-[38px] h-[36px] cursor-pointer rounded-full bg-[#F5F5F7] px-4 leading-[36px] hover:bg-[#EAEAEC]\"\n >\n <Text\n size={3}\n onClick={() => {\n setActiveKspItem(item)\n setOpen(true)\n gaTrackEvent(item?.title)\n }}\n className=\"lg-desktop:text-[16px] line-clamp-1 overflow-hidden break-all text-[14px] font-bold text-[#1D1D1F]\"\n html={item?.title}\n />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nconst ProductHighlightModal = ({\n ksp,\n clickActiveKspItem,\n gaTrackEvent,\n}: {\n ksp: any[]\n clickActiveKspItem: any\n gaTrackEvent: (buttonName: string) => void\n}) => {\n const highlightRef = useRef<HTMLButtonElement[]>([])\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const [activeKspItem, setActiveKspItem] = useState<any>(null)\n\n const autoScrollToActiveItem = useCallback(\n (activeKspItem: any) => {\n const curIndex = ksp.findIndex(item => item.title === activeKspItem?.title)\n const curRef = highlightRef.current[curIndex]\n\n if (curRef && scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n },\n [clickActiveKspItem, ksp]\n )\n\n useEffect(() => {\n if (!clickActiveKspItem) return\n setActiveKspItem(clickActiveKspItem)\n\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u7B49\u5F85 Dialog \u548C\u5185\u90E8\u5143\u7D20\u5B8C\u5168\u6E32\u67D3\n setTimeout(() => {\n autoScrollToActiveItem(activeKspItem)\n }, 100)\n }, [clickActiveKspItem, autoScrollToActiveItem])\n\n return (\n <DialogContent className=\"tablet:max-w-[896px] tablet:rounded-2xl [&_.dialog-close-icon]:laptop:size-6 mx-auto w-full max-w-[326px] overflow-hidden rounded-xl border-none p-0 [&_.dialog-close-icon]:size-4\">\n <Root defaultValue={activeKspItem?.title} className=\"w-full overflow-hidden\">\n {ksp?.map(item => (\n <Content value={item.title} key={item.title}>\n <Picture\n source={`${item?.mobileImg}, ${item?.img} 767`}\n className=\"desktop:h-[480px] h-[304px] w-full\"\n alt={item.img.alt}\n imgClassName=\"object-cover h-full\"\n />\n </Content>\n ))}\n <div className=\"desktop:py-6 w-full overflow-visible py-4\">\n <div\n ref={scrollContainerRef}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n className=\"desktop:px-6 overflow-x-auto px-4\"\n >\n <div className=\"w-fit rounded-full bg-[#EAEAEC]\">\n <List className=\"flex w-max p-1\">\n {ksp.map((item, index) => (\n <Trigger\n ref={el => {\n if (el) {\n highlightRef.current[index] = el\n }\n }}\n className={cn(\n 'lg-desktop:px-7 h-[38px] shrink-0 rounded-full px-5 leading-[38px]',\n item.title === activeKspItem?.title && 'bg-white'\n )}\n onClick={() => {\n autoScrollToActiveItem(item)\n setActiveKspItem(item)\n gaTrackEvent(item?.title)\n }}\n key={index}\n value={item.title}\n >\n <Text html={item.title} className=\"text-[14px] font-bold leading-[1.2]\" />\n </Trigger>\n ))}\n </List>\n </div>\n </div>\n <div className=\"desktop:px-6 mt-4 px-4\">\n {ksp.map(item => (\n <Content value={item.title} className=\"desktop:text-[18px] text-base font-bold\">\n {item.description}\n </Content>\n ))}\n </div>\n </div>\n </Root>\n </DialogContent>\n )\n}\n\nexport default withLayout(ProductHighlight)\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8CU,IAAAI,EAAA,6BA7CVC,EAQO,iDACPC,EAA6C,gCAC7CC,EAAkE,iBAClEC,EAAmB,8CACnBC,EAAqC,6CACrCC,EAA2B,8CAC3BC,EAAwB,6CAExB,MAAMC,EAAmB,IAAM,CAC7B,KAAM,CAAE,QAAAC,EAAS,QAAAC,CAAQ,KAAI,wBAAqB,EAC5C,CAACC,EAAMC,CAAO,KAAI,YAAS,EAAK,EAEhCC,KAAuB,WAAQ,IAC5BJ,GAAS,SAAS,YAAY,KAAMK,GAAcA,EAAK,eAAiB,kBAAkB,GAAG,MAAQ,CAAC,EAC5G,CAACL,GAAS,OAAO,CAAC,EAEf,CAACM,EAAeC,CAAgB,KAAI,YAASH,GAAsB,MAAM,CAAC,CAAC,EAE3EI,KAAe,eAClBC,GAAwB,IACvB,WAAQ,CACN,MAAO,WACP,WAAY,YACZ,iBAAkB,CACh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,EACH,GACF,GACF,EACF,CAEJ,EAEA,IAAOhB,KAAQ,cAAWU,CAAgB",
4
+ "sourcesContent": ["import type { HighlightProps } from '../types'\nimport {\n Text,\n Picture,\n Button,\n Heading,\n Dialog,\n DialogContent,\n DialogTrigger,\n} from '../../../../../../components/index.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { gaTrack } from '../../../../../../shared/track.js'\n\nconst ProductHighlight = () => {\n const { product, variant } = useBizProductContext()\n const [open, setOpen] = useState(false)\n\n const productHighlightData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductHighlight')?.data || {}\n }, [product?.payload])\n\n const [activeKspItem, setActiveKspItem] = useState(productHighlightData?.ksp?.[0])\n\n const gaTrackEvent = useCallback(\n (buttonName?: string) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: `Product Detail Page${variant.sku}`,\n position: productHighlightData?.title || '',\n button_name: buttonName || productHighlightData?.view || '',\n },\n })\n },\n [productHighlightData?.title, productHighlightData?.view, variant.sku]\n )\n\n return (\n <div className=\"ipc-product-detail-highlight\">\n <div className=\"flex items-center justify-between\">\n {productHighlightData?.title && (\n <Text size={3} className=\"font-bold leading-[1.2]\" html={productHighlightData?.title} />\n )}\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant=\"link\" className=\"!p-0 text-base font-bold\" onClick={() => gaTrackEvent()}>\n {productHighlightData?.view}\n </Button>\n </DialogTrigger>\n <ProductHighlightModal\n ksp={productHighlightData?.ksp || []}\n clickActiveKspItem={activeKspItem}\n gaTrackEvent={gaTrackEvent}\n />\n </Dialog>\n </div>\n <div className=\"lg-desktop:mt-4 mt-3 flex flex-wrap gap-4\">\n {productHighlightData?.ksp?.map((item: any) => (\n <div\n key={item?.title}\n className=\"product-highlight-item lg-desktop:h-[38px] lg-desktop:leading-[38px] h-[36px] cursor-pointer rounded-full bg-[#F5F5F7] px-4 leading-[36px] hover:bg-[#EAEAEC]\"\n >\n <Text\n size={3}\n onClick={() => {\n setActiveKspItem(item)\n setOpen(true)\n gaTrackEvent(item?.title)\n }}\n className=\"lg-desktop:text-[16px] line-clamp-1 overflow-hidden break-all text-[14px] font-bold text-[#1D1D1F]\"\n html={item?.title}\n />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nconst ProductHighlightModal = ({\n ksp,\n clickActiveKspItem,\n gaTrackEvent,\n}: {\n ksp: any[]\n clickActiveKspItem: any\n gaTrackEvent: (buttonName: string) => void\n}) => {\n const highlightRef = useRef<HTMLButtonElement[]>([])\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const [activeKspItem, setActiveKspItem] = useState<any>(null)\n\n const autoScrollToActiveItem = useCallback(\n (activeKspItem: any) => {\n const curIndex = ksp.findIndex(item => item.title === activeKspItem?.title)\n const curRef = highlightRef.current[curIndex]\n\n if (curRef && scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n },\n [clickActiveKspItem, ksp]\n )\n\n useEffect(() => {\n if (!clickActiveKspItem) return\n setActiveKspItem(clickActiveKspItem)\n\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u7B49\u5F85 Dialog \u548C\u5185\u90E8\u5143\u7D20\u5B8C\u5168\u6E32\u67D3\n setTimeout(() => {\n autoScrollToActiveItem(activeKspItem)\n }, 100)\n }, [clickActiveKspItem, autoScrollToActiveItem])\n\n return (\n <DialogContent className=\"tablet:max-w-[896px] tablet:rounded-2xl [&_.dialog-close-icon]:laptop:size-6 mx-auto w-full max-w-[326px] overflow-hidden rounded-xl border-none p-0 [&_.dialog-close-icon]:size-4\">\n <style>{`\n .dialog-close-icon {\n color: ${activeKspItem?.closeColor};\n }\n `}</style>\n <Root value={activeKspItem?.title} className=\"w-full overflow-hidden\">\n {ksp?.map(item => (\n <Content value={item.title} key={item.title}>\n <Picture\n source={`${item?.img}, ${item?.mobileImg} 767`}\n className=\"desktop:h-[480px] h-[304px] w-full\"\n alt={item.img.alt}\n imgClassName=\"object-cover h-full\"\n />\n </Content>\n ))}\n <div className=\"desktop:py-6 w-full overflow-visible py-4\">\n <div\n ref={scrollContainerRef}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n className=\"desktop:px-6 overflow-x-auto px-4\"\n >\n <div className=\"w-fit rounded-full bg-[#EAEAEC]\">\n <List className=\"flex w-max p-1\">\n {ksp?.map((item, index) => (\n <Trigger\n ref={el => {\n if (el) {\n highlightRef.current[index] = el\n }\n }}\n className={cn(\n 'lg-desktop:px-7 h-[38px] shrink-0 rounded-full px-5 leading-[38px]',\n item.title === activeKspItem?.title && 'bg-white'\n )}\n onClick={() => {\n autoScrollToActiveItem(item)\n setActiveKspItem(item)\n gaTrackEvent(item?.title)\n }}\n key={index + item.title}\n value={item.title}\n >\n <Text html={item.title} className=\"text-[14px] font-bold leading-[1.2]\" />\n </Trigger>\n ))}\n </List>\n </div>\n </div>\n <div className=\"desktop:px-6 mt-4 px-4\">\n {ksp?.map((item, index) => (\n <Content\n value={item.title}\n key={index + item.title}\n className=\"desktop:text-[18px] text-[14px] font-bold\"\n >\n {item.description}\n </Content>\n ))}\n </div>\n </div>\n </Root>\n </DialogContent>\n )\n}\n\nexport default withLayout(ProductHighlight)\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8CU,IAAAI,EAAA,6BA7CVC,EAQO,iDACPC,EAA6C,gCAC7CC,EAAkE,iBAClEC,EAAmB,8CACnBC,EAAqC,6CACrCC,EAA2B,8CAC3BC,EAAwB,6CA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,GAAK,IAAI,CAACN,EAAMgB,OACf,OAAC,WACC,IAAKC,GAAM,CACLA,IACFT,EAAa,QAAQQ,CAAK,EAAIC,EAElC,EACA,aAAW,MACT,qEACAjB,EAAK,QAAUC,GAAe,OAAS,UACzC,EACA,QAAS,IAAM,CACbS,EAAuBV,CAAI,EAC3BE,EAAiBF,CAAI,EACrBG,EAAaH,GAAM,KAAK,CAC1B,EAEA,MAAOA,EAAK,MAEZ,mBAAC,QAAK,KAAMA,EAAK,MAAO,UAAU,sCAAsC,GAHnEgB,EAAQhB,EAAK,KAIpB,CACD,EACH,EACF,EACF,KACA,OAAC,OAAI,UAAU,yBACZ,SAAAM,GAAK,IAAI,CAACN,EAAMgB,OACf,OAAC,WACC,MAAOhB,EAAK,MAEZ,UAAU,4CAET,SAAAA,EAAK,aAHDgB,EAAQhB,EAAK,KAIpB,CACD,EACH,GACF,GACF,GACF,CAEJ,EAEA,IAAOhB,KAAQ,cAAWU,CAAgB",
6
6
  "names": ["ProductHighlight_exports", "__export", "ProductHighlight_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react_tabs", "import_react", "import_helpers", "import_BizProductProvider", "import_Styles", "import_track", "ProductHighlight", "product", "variant", "open", "setOpen", "productHighlightData", "item", "activeKspItem", "setActiveKspItem", "gaTrackEvent", "buttonName", "ProductHighlightModal", "ksp", "clickActiveKspItem", "highlightRef", "scrollContainerRef", "autoScrollToActiveItem", "curIndex", "curRef", "container", "button", "scrollLeft", "index", "el"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var E=Object.create;var m=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var w=(o,a)=>{for(var i in a)m(o,i,{get:a[i],enumerable:!0})},g=(o,a,i,p)=>{if(a&&typeof a=="object"||typeof a=="function")for(let l of h(a))!I.call(o,l)&&l!==i&&m(o,l,{get:()=>a[l],enumerable:!(p=D(a,l))||p.enumerable});return o};var k=(o,a,i)=>(i=o!=null?E(G(o)):{},g(a||!o||!o.__esModule?m(i,"default",{value:o,enumerable:!0}):i,o)),P=o=>g(m({},"__esModule",{value:!0}),o);var L={};w(L,{default:()=>T});module.exports=P(L);var e=require("react/jsx-runtime"),n=require("react"),t=require("../../../../../../components/index.js"),b=require("../../../../BizProductProvider.js"),v=k(require("./Select.js")),N=require("../../../../../AiuiProvider/index.js"),C=require("../../../../utils/index.js"),y=require("./ShopifyColorOption.js");const z=()=>{const{locale:o="us"}=(0,N.useAiuiContext)(),{compareData:a,product:i}=(0,b.useBizProductContext)(),[p,l]=(0,n.useState)();(0,n.useEffect)(()=>{l(a?.availableCompareList[0]?.handle)},[a?.availableCompareList]);const x=[a?.currentProductCompareData?.product,a?.availableCompareList.find(r=>r.handle===p)?.product].filter(Boolean);return a?.specificationKeys?(0,e.jsxs)(t.Dialog,{children:[(0,e.jsx)(t.DialogTrigger,{children:(0,e.jsx)("button",{className:"text-base font-bold leading-[1.4]",children:"Compare"})}),(0,e.jsxs)(t.DialogContent,{overlayClassName:"z-[100]",className:"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]",children:[(0,e.jsx)(t.DialogHeader,{className:"laptop:pt-4 laptop:pb-3 border-b border-[#E8E8E8] pb-2 pt-4",children:(0,e.jsx)(t.DialogTitle,{className:"text-sm text-[#6D6D6F]",children:"Compare"})}),(0,e.jsxs)(t.Grid,{className:"laptop:gap-8 laptop:py-8 grid-cols-3 py-6",children:[(0,e.jsx)(t.GridItem,{span:1}),x.map((r,d)=>(0,e.jsx)(t.GridItem,{span:1,className:"flex items-center",children:(0,e.jsx)("img",{src:r.images[0].url,alt:r.title,className:"size-[200px]",role:"presentation"})},d))]}),(0,e.jsxs)(t.Grid,{className:"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[(0,e.jsx)(t.GridItem,{span:1,children:(0,e.jsx)("div",{className:"text-[16px] font-bold text-[#595959]",children:"Product"})}),(0,e.jsx)(t.GridItem,{span:1,children:(0,e.jsx)(t.Text,{as:"div",className:"flex h-[38px] w-full items-center rounded-[2px] border border-[#E8E8E8] px-[12px] text-[16px] font-bold",html:a.currentProductCompareData?.shortName||i.title})}),p&&(0,e.jsx)(t.GridItem,{span:1,children:(0,e.jsx)(v.default,{value:p,onChange:r=>{l(r)},list:a.options})})]}),(0,e.jsxs)(t.Grid,{className:"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[(0,e.jsx)(t.GridItem,{span:1,children:(0,e.jsx)("div",{className:"text-[16px] font-bold text-[#595959]",children:"Basic Information"})}),x.map((r,d)=>{const c=r.variants[0],f=r.options?.find(s=>["color","colour","couleur"].find(u=>s.name.toLowerCase().includes(u)))?.values.map(s=>s.label);return(0,e.jsx)(t.GridItem,{span:1,className:"flex h-full",children:(0,e.jsxs)("div",{className:"flex flex-col gap-[8px]",children:[c.price.amount<9999999&&(0,e.jsxs)("div",{className:"flex items-center gap-[8px]",children:[(0,e.jsx)("div",{className:"text-[16px] font-semibold text-[#595959]",children:"Price:"}),(0,e.jsx)("div",{className:"flex items-center gap-[6px]",children:(0,e.jsx)("span",{className:"text-[16px] font-bold",children:(0,C.formatPrice)({locale:o,amount:c.price.amount,currencyCode:c.price.currencyCode})})})]}),f?.length&&(0,e.jsxs)("div",{className:"flex items-center gap-[8px]",children:[(0,e.jsx)("div",{className:"text-[16px] font-semibold text-[#595959]",children:"Color:"}),(0,e.jsx)("div",{className:"flex items-center gap-[16px]",children:f.map(s=>(0,e.jsx)(y.ShopifyColorOption,{label:s,className:"size-[16px]"},s))})]})]})},d)})]}),(0,e.jsx)(t.Grid,{className:"grid-cols-12 items-center gap-[40px] border-b border-[#E8E8E8]",children:a.specificationKeys?.map(r=>(0,e.jsxs)(t.GridItem,{span:12,className:"grid grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[(0,e.jsx)("div",{className:"text-[16px] font-bold text-[#595959]",children:r}),x.map((d,c)=>{let s=d.metafields?.global?.specifications?.find(u=>u?.key===r)?.value||"";switch(s.trim().toLowerCase()){case"true":s="\u2714\uFE0F";break;case"false":s="\u274C";break;default:break}return(0,e.jsx)("div",{className:"flex items-center",children:(0,e.jsx)("div",{className:"text-[16px] font-semibold text-[#595959]",children:s})},c)})]},r))})]})]}):null};var T=z;
1
+ "use strict";var D=Object.create;var m=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var k=(o,r)=>{for(var a in r)m(o,a,{get:r[a],enumerable:!0})},v=(o,r,a,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of G(r))!w.call(o,l)&&l!==a&&m(o,l,{get:()=>r[l],enumerable:!(d=h(r,l))||d.enumerable});return o};var P=(o,r,a)=>(a=o!=null?D(I(o)):{},v(r||!o||!o.__esModule?m(a,"default",{value:o,enumerable:!0}):a,o)),z=o=>v(m({},"__esModule",{value:!0}),o);var H={};k(H,{default:()=>L});module.exports=z(H);var e=require("react/jsx-runtime"),n=require("react"),t=require("../../../../../../components/index.js"),b=require("../../../../BizProductProvider.js"),N=P(require("./Select.js")),y=require("../../../../../AiuiProvider/index.js"),C=require("../../../../utils/index.js"),E=require("./ShopifyColorOption.js");const T=()=>{const{locale:o="us",copyWriting:r}=(0,y.useAiuiContext)(),{compareData:a,product:d}=(0,b.useBizProductContext)(),[l,g]=(0,n.useState)();(0,n.useEffect)(()=>{g(a?.availableCompareList[0]?.handle)},[a?.availableCompareList]);const x=[a?.currentProductCompareData?.product,a?.availableCompareList.find(i=>i.handle===l)?.product].filter(Boolean);return a?.specificationKeys?(0,e.jsxs)(t.Dialog,{children:[(0,e.jsx)(t.DialogTrigger,{className:"text-base font-bold leading-[1.4]",children:r?.compare}),(0,e.jsxs)(t.DialogContent,{overlayClassName:"z-[100]",className:"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]",children:[(0,e.jsx)(t.DialogHeader,{className:"laptop:pt-4 laptop:pb-3 border-b border-[#E8E8E8] pb-2 pt-4",children:(0,e.jsx)(t.DialogTitle,{className:"text-sm text-[#6D6D6F]",children:r?.compare})}),(0,e.jsxs)(t.Grid,{className:"laptop:gap-8 laptop:py-8 grid-cols-3 py-6",children:[(0,e.jsx)(t.GridItem,{span:1}),x.map((i,p)=>(0,e.jsx)(t.GridItem,{span:1,className:"flex items-center",children:(0,e.jsx)("img",{src:i.images[0].url,alt:i.title,className:"size-[200px]",role:"presentation"})},p))]}),(0,e.jsxs)(t.Grid,{className:"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[(0,e.jsx)(t.GridItem,{span:1,children:(0,e.jsx)("div",{className:"text-[16px] font-bold text-[#595959]",children:"Product"})}),(0,e.jsx)(t.GridItem,{span:1,children:(0,e.jsx)(t.Text,{as:"div",className:"flex h-[38px] w-full items-center rounded-[2px] border border-[#E8E8E8] px-[12px] text-[16px] font-bold",html:a.currentProductCompareData?.shortName||d.title})}),l&&(0,e.jsx)(t.GridItem,{span:1,children:(0,e.jsx)(N.default,{value:l,onChange:i=>{g(i)},list:a.options})})]}),(0,e.jsxs)(t.Grid,{className:"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[(0,e.jsx)(t.GridItem,{span:1,children:(0,e.jsx)("div",{className:"text-[16px] font-bold text-[#595959]",children:"Basic Information"})}),x.map((i,p)=>{const c=i.variants[0],f=i.options?.find(s=>["color","colour","couleur"].find(u=>s.name.toLowerCase().includes(u)))?.values.map(s=>s.label);return(0,e.jsx)(t.GridItem,{span:1,className:"flex h-full",children:(0,e.jsxs)("div",{className:"flex flex-col gap-[8px]",children:[c.price.amount<9999999&&(0,e.jsxs)("div",{className:"flex items-center gap-[8px]",children:[(0,e.jsx)("div",{className:"text-[16px] font-semibold text-[#595959]",children:"Price:"}),(0,e.jsx)("div",{className:"flex items-center gap-[6px]",children:(0,e.jsx)("span",{className:"text-[16px] font-bold",children:(0,C.formatPrice)({locale:o,amount:c.price.amount,currencyCode:c.price.currencyCode})})})]}),f?.length&&(0,e.jsxs)("div",{className:"flex items-center gap-[8px]",children:[(0,e.jsx)("div",{className:"text-[16px] font-semibold text-[#595959]",children:"Color:"}),(0,e.jsx)("div",{className:"flex items-center gap-[16px]",children:f.map(s=>(0,e.jsx)(E.ShopifyColorOption,{label:s,className:"size-[16px]"},s))})]})]})},p)})]}),(0,e.jsx)(t.Grid,{className:"grid-cols-12 items-center gap-[40px] border-b border-[#E8E8E8]",children:a.specificationKeys?.map(i=>(0,e.jsxs)(t.GridItem,{span:12,className:"grid grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]",children:[(0,e.jsx)("div",{className:"text-[16px] font-bold text-[#595959]",children:i}),x.map((p,c)=>{let s=p.metafields?.global?.specifications?.find(u=>u?.key===i)?.value||"";switch(s.trim().toLowerCase()){case"true":s="\u2714\uFE0F";break;case"false":s="\u274C";break;default:break}return(0,e.jsx)("div",{className:"flex items-center",children:(0,e.jsx)("div",{className:"text-[16px] font-semibold text-[#595959]",children:s})},c)})]},i))})]})]}):null};var L=T;
2
2
  //# sourceMappingURL=CompareModal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.tsx"],
4
- "sourcesContent": ["import { useEffect, useState } from 'react'\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Grid,\n GridItem,\n Text,\n} from '../../../../../../components/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport type { CompareItem } from '../../../../types'\nimport Select from './Select.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { ShopifyColorOption } from './ShopifyColorOption.js'\n\nconst CompareModal = () => {\n const { locale = 'us' } = useAiuiContext()\n const { compareData, product } = useBizProductContext()\n const [selectedProductHandle, setSelectedProductHandle] = useState<string>()\n\n useEffect(() => {\n setSelectedProductHandle(compareData?.availableCompareList[0]?.handle)\n }, [compareData?.availableCompareList])\n\n const products = [\n compareData?.currentProductCompareData!?.product,\n compareData?.availableCompareList.find(product => product.handle === selectedProductHandle)?.product,\n ].filter(Boolean) as CompareItem['product'][]\n\n if (!compareData?.specificationKeys) return null\n\n return (\n <Dialog>\n <DialogTrigger>\n <button className=\"text-base font-bold leading-[1.4]\">Compare</button>\n </DialogTrigger>\n <DialogContent\n overlayClassName=\"z-[100]\"\n className=\"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]\"\n >\n <DialogHeader className=\"laptop:pt-4 laptop:pb-3 border-b border-[#E8E8E8] pb-2 pt-4\">\n <DialogTitle className=\"text-sm text-[#6D6D6F]\">Compare</DialogTitle>\n </DialogHeader>\n <Grid className=\"laptop:gap-8 laptop:py-8 grid-cols-3 py-6\">\n <GridItem span={1} />\n {products.map((product, productIndex) => {\n return (\n <GridItem key={productIndex} span={1} className=\"flex items-center\">\n <img src={product.images[0].url} alt={product.title} className=\"size-[200px]\" role=\"presentation\" />\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\">\n <GridItem span={1}>\n <div className=\"text-[16px] font-bold text-[#595959]\">Product</div>\n </GridItem>\n <GridItem span={1}>\n <Text\n as=\"div\"\n className=\"flex h-[38px] w-full items-center rounded-[2px] border border-[#E8E8E8] px-[12px] text-[16px] font-bold\"\n html={compareData.currentProductCompareData?.shortName || product.title}\n ></Text>\n </GridItem>\n {selectedProductHandle && (\n <GridItem span={1}>\n <Select\n value={selectedProductHandle}\n onChange={value => {\n setSelectedProductHandle(value)\n }}\n list={compareData.options!}\n />\n </GridItem>\n )}\n </Grid>\n <Grid className=\"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\">\n <GridItem span={1}>\n <div className=\"text-[16px] font-bold text-[#595959]\">Basic Information</div>\n </GridItem>\n {products.map((product, productIndex) => {\n const variant = product.variants[0]\n const colors = product.options\n ?.find(option =>\n ['color', 'colour', 'couleur'].find(predicate => option.name.toLowerCase().includes(predicate))\n )\n ?.values.map(value => value.label)\n return (\n <GridItem span={1} key={productIndex} className=\"flex h-full\">\n {/* Price with original price */}\n <div className=\"flex flex-col gap-[8px]\">\n {variant.price.amount < 9999999 && (\n <div className=\"flex items-center gap-[8px]\">\n <div className=\"text-[16px] font-semibold text-[#595959]\">Price:</div>\n <div className=\"flex items-center gap-[6px]\">\n <span className=\"text-[16px] font-bold\">\n {formatPrice({\n locale,\n amount: variant.price.amount,\n currencyCode: variant.price.currencyCode,\n })}\n </span>\n\n {/* {Number(coupon?.fixed_value) > 0 && (\n <span className='font-semibold text-[#999999] line-through'>\n {formatPrice({\n locale,\n amount: variant.price.amount,\n currencyCode: variant.price.currencyCode,\n })}\n </span>\n )} */}\n </div>\n </div>\n )}\n {colors?.length && (\n <div className=\"flex items-center gap-[8px]\">\n <div className=\"text-[16px] font-semibold text-[#595959]\">Color:</div>\n <div className=\"flex items-center gap-[16px]\">\n {colors.map(label => (\n <ShopifyColorOption key={label} label={label} className=\"size-[16px]\" />\n ))}\n </div>\n </div>\n )}\n </div>\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"grid-cols-12 items-center gap-[40px] border-b border-[#E8E8E8]\">\n {compareData.specificationKeys?.map((key: string) => {\n return (\n <GridItem\n span={12}\n className=\"grid grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\"\n key={key}\n >\n {/* Detail value */}\n <div className=\"text-[16px] font-bold text-[#595959]\">{key}</div>\n {/* Product Values */}\n {products.map((product, productIndex) => {\n const value =\n product.metafields?.global?.specifications?.find(\n (specification: { key: string }) => specification?.key === key\n )?.value || ''\n let text = value\n switch (text.trim().toLowerCase()) {\n case 'true':\n text = '\u2714\uFE0F'\n break\n case 'false':\n text = '\u274C'\n break\n default:\n break\n }\n return (\n <div key={productIndex} className=\"flex items-center\">\n {/* Other details */}\n <div className=\"text-[16px] font-semibold text-[#595959]\">{text}</div>\n </div>\n )\n })}\n </GridItem>\n )\n })}\n </Grid>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport default CompareModal\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqCQ,IAAAI,EAAA,6BArCRC,EAAoC,iBACpCC,EASO,iDACPC,EAAqC,6CAErCC,EAAmB,0BACnBC,EAA+B,gDAC/BC,EAA4B,sCAC5BC,EAAmC,mCAEnC,MAAMC,EAAe,IAAM,CACzB,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CAAE,YAAAC,EAAa,QAAAC,CAAQ,KAAI,wBAAqB,EAChD,CAACC,EAAuBC,CAAwB,KAAI,YAAiB,KAE3E,aAAU,IAAM,CACdA,EAAyBH,GAAa,qBAAqB,CAAC,GAAG,MAAM,CACvE,EAAG,CAACA,GAAa,oBAAoB,CAAC,EAEtC,MAAMI,EAAW,CACfJ,GAAa,2BAA4B,QACzCA,GAAa,qBAAqB,KAAKC,GAAWA,EAAQ,SAAWC,CAAqB,GAAG,OAC/F,EAAE,OAA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AU,0BACZ,UAAAC,EAAQ,MAAM,OAAS,YACtB,QAAC,OAAI,UAAU,8BACb,oBAAC,OAAI,UAAU,2CAA2C,kBAAM,KAChE,OAAC,OAAI,UAAU,8BACb,mBAAC,QAAK,UAAU,wBACb,2BAAY,CACX,OAAAT,EACA,OAAQS,EAAQ,MAAM,OACtB,aAAcA,EAAQ,MAAM,YAC9B,CAAC,EACH,EAWF,GACF,EAEDC,GAAQ,WACP,QAAC,OAAI,UAAU,8BACb,oBAAC,OAAI,UAAU,2CAA2C,kBAAM,KAChE,OAAC,OAAI,UAAU,+BACZ,SAAAA,EAAO,IAAIG,MACV,OAAC,sBAA+B,MAAOA,EAAO,UAAU,eAA/BA,CAA6C,CACvE,EACH,GACF,GAEJ,GArCsBP,CAsCxB,CAEJ,CAAC,GACH,KACA,OAAC,QAAK,UAAU,iEACb,SAAAL,EAAY,mBAAmB,IAAKa,MAEjC,QAAC,YACC,KAAM,GACN,UAAU,+EAIV,oBAAC,OAAI,UAAU,uCAAwC,SAAAA,EAAI,EAE1DT,EAAS,IAAI,CAACH,EAASI,IAAiB,CAKvC,IAAIS,EAHFb,EAAQ,YAAY,QAAQ,gBAAgB,KACzCc,GAAmCA,GAAe,MAAQF,CAC7D,GAAG,OAAS,GAEd,OAAQC,EAAK,KAAK,EAAE,YAAY,EAAG,CACjC,IAAK,OACHA,EAAO,eACP,MACF,IAAK,QACHA,EAAO,SACP,MACF,QACE,KACJ,CACA,SACE,OAAC,OAAuB,UAAU,oBAEhC,mBAAC,OAAI,UAAU,2CAA4C,SAAAA,EAAK,GAFxDT,CAGV,CAEJ,CAAC,IA3BIQ,CA4BP,CAEH,EACH,GACF,GACF,EA5I0C,IA8I9C,EAEA,IAAOzB,EAAQU",
6
- "names": ["CompareModal_exports", "__export", "CompareModal_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_BizProductProvider", "import_Select", "import_AiuiProvider", "import_utils", "import_ShopifyColorOption", "CompareModal", "locale", "compareData", "product", "selectedProductHandle", "setSelectedProductHandle", "products", "productIndex", "Select", "value", "variant", "colors", "option", "predicate", "label", "key", "text", "specification"]
4
+ "sourcesContent": ["import { useEffect, useState } from 'react'\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Grid,\n GridItem,\n Text,\n} from '../../../../../../components/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport type { CompareItem } from '../../../../types'\nimport Select from './Select.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { ShopifyColorOption } from './ShopifyColorOption.js'\n\nconst CompareModal = () => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { compareData, product } = useBizProductContext()\n const [selectedProductHandle, setSelectedProductHandle] = useState<string>()\n\n useEffect(() => {\n setSelectedProductHandle(compareData?.availableCompareList[0]?.handle)\n }, [compareData?.availableCompareList])\n\n const products = [\n compareData?.currentProductCompareData!?.product,\n compareData?.availableCompareList.find(product => product.handle === selectedProductHandle)?.product,\n ].filter(Boolean) as CompareItem['product'][]\n\n if (!compareData?.specificationKeys) return null\n\n return (\n <Dialog>\n <DialogTrigger className=\"text-base font-bold leading-[1.4]\">{copyWriting?.compare}</DialogTrigger>\n <DialogContent\n overlayClassName=\"z-[100]\"\n className=\"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]\"\n >\n <DialogHeader className=\"laptop:pt-4 laptop:pb-3 border-b border-[#E8E8E8] pb-2 pt-4\">\n <DialogTitle className=\"text-sm text-[#6D6D6F]\">{copyWriting?.compare}</DialogTitle>\n </DialogHeader>\n <Grid className=\"laptop:gap-8 laptop:py-8 grid-cols-3 py-6\">\n <GridItem span={1} />\n {products.map((product, productIndex) => {\n return (\n <GridItem key={productIndex} span={1} className=\"flex items-center\">\n <img src={product.images[0].url} alt={product.title} className=\"size-[200px]\" role=\"presentation\" />\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\">\n <GridItem span={1}>\n <div className=\"text-[16px] font-bold text-[#595959]\">Product</div>\n </GridItem>\n <GridItem span={1}>\n <Text\n as=\"div\"\n className=\"flex h-[38px] w-full items-center rounded-[2px] border border-[#E8E8E8] px-[12px] text-[16px] font-bold\"\n html={compareData.currentProductCompareData?.shortName || product.title}\n ></Text>\n </GridItem>\n {selectedProductHandle && (\n <GridItem span={1}>\n <Select\n value={selectedProductHandle}\n onChange={value => {\n setSelectedProductHandle(value)\n }}\n list={compareData.options!}\n />\n </GridItem>\n )}\n </Grid>\n <Grid className=\"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\">\n <GridItem span={1}>\n <div className=\"text-[16px] font-bold text-[#595959]\">Basic Information</div>\n </GridItem>\n {products.map((product, productIndex) => {\n const variant = product.variants[0]\n const colors = product.options\n ?.find(option =>\n ['color', 'colour', 'couleur'].find(predicate => option.name.toLowerCase().includes(predicate))\n )\n ?.values.map(value => value.label)\n return (\n <GridItem span={1} key={productIndex} className=\"flex h-full\">\n {/* Price with original price */}\n <div className=\"flex flex-col gap-[8px]\">\n {variant.price.amount < 9999999 && (\n <div className=\"flex items-center gap-[8px]\">\n <div className=\"text-[16px] font-semibold text-[#595959]\">Price:</div>\n <div className=\"flex items-center gap-[6px]\">\n <span className=\"text-[16px] font-bold\">\n {formatPrice({\n locale,\n amount: variant.price.amount,\n currencyCode: variant.price.currencyCode,\n })}\n </span>\n\n {/* {Number(coupon?.fixed_value) > 0 && (\n <span className='font-semibold text-[#999999] line-through'>\n {formatPrice({\n locale,\n amount: variant.price.amount,\n currencyCode: variant.price.currencyCode,\n })}\n </span>\n )} */}\n </div>\n </div>\n )}\n {colors?.length && (\n <div className=\"flex items-center gap-[8px]\">\n <div className=\"text-[16px] font-semibold text-[#595959]\">Color:</div>\n <div className=\"flex items-center gap-[16px]\">\n {colors.map(label => (\n <ShopifyColorOption key={label} label={label} className=\"size-[16px]\" />\n ))}\n </div>\n </div>\n )}\n </div>\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"grid-cols-12 items-center gap-[40px] border-b border-[#E8E8E8]\">\n {compareData.specificationKeys?.map((key: string) => {\n return (\n <GridItem\n span={12}\n className=\"grid grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\"\n key={key}\n >\n {/* Detail value */}\n <div className=\"text-[16px] font-bold text-[#595959]\">{key}</div>\n {/* Product Values */}\n {products.map((product, productIndex) => {\n const value =\n product.metafields?.global?.specifications?.find(\n (specification: { key: string }) => specification?.key === key\n )?.value || ''\n let text = value\n switch (text.trim().toLowerCase()) {\n case 'true':\n text = '\u2714\uFE0F'\n break\n case 'false':\n text = '\u274C'\n break\n default:\n break\n }\n return (\n <div key={productIndex} className=\"flex items-center\">\n {/* Other details */}\n <div className=\"text-[16px] font-semibold text-[#595959]\">{text}</div>\n </div>\n )\n })}\n </GridItem>\n )\n })}\n </Grid>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport default CompareModal\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAoCM,IAAAI,EAAA,6BApCNC,EAAoC,iBACpCC,EASO,iDACPC,EAAqC,6CAErCC,EAAmB,0BACnBC,EAA+B,gDAC/BC,EAA4B,sCAC5BC,EAAmC,mCAEnC,MAAMC,EAAe,IAAM,CACzB,KAAM,CAAE,OAAAC,EAAS,KAAM,YAAAC,CAAY,KAAI,kBAAe,EAChD,CAAE,YAAAC,EAAa,QAAAC,CAAQ,KAAI,wBAAqB,EAChD,CAACC,EAAuBC,CAAwB,KAAI,YAAiB,KAE3E,aAAU,IAAM,CACdA,EAAyBH,GAAa,qB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A1I0C,IA4I9C,EAEA,IAAO1B,EAAQU",
6
+ "names": ["CompareModal_exports", "__export", "CompareModal_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_BizProductProvider", "import_Select", "import_AiuiProvider", "import_utils", "import_ShopifyColorOption", "CompareModal", "locale", "copyWriting", "compareData", "product", "selectedProductHandle", "setSelectedProductHandle", "products", "productIndex", "Select", "value", "variant", "colors", "option", "predicate", "label", "key", "text", "specification"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var n=(a,t)=>{for(var l in t)i(a,l,{get:t[l],enumerable:!0})},m=(a,t,l,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of c(t))!d.call(a,s)&&s!==l&&i(a,s,{get:()=>t[s],enumerable:!(p=g(t,s))||p.enumerable});return a};var x=a=>m(i({},"__esModule",{value:!0}),a);var D={};n(D,{SpecsModal:()=>b});module.exports=x(D);var e=require("react/jsx-runtime"),o=require("../../../../../../components/index.js"),r=require("../../../../BizProductProvider.js");const b=()=>{const{product:a}=(0,r.useBizProductContext)();return(0,e.jsxs)(o.Dialog,{children:[(0,e.jsx)(o.DialogTrigger,{children:(0,e.jsx)("button",{className:"text-base font-bold leading-[1.4]",children:"Specs"})}),(0,e.jsxs)(o.DialogContent,{overlayClassName:"z-[100]",className:"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]",children:[(0,e.jsx)(o.DialogHeader,{className:"laptop:pt-4 laptop:pb-3 border-b border-[#E8E8E8] pb-2 pt-4",children:(0,e.jsx)(o.DialogTitle,{className:"text-sm text-[#6D6D6F]",children:"Specs"})}),(0,e.jsx)(o.Grid,{className:"laptop:gap-8 laptop:py-8 py-6",children:a.metafields?.global?.specifications?.map(({key:t,value:l})=>(0,e.jsxs)(o.GridItem,{span:6,className:"flex flex-col gap-1",children:[(0,e.jsx)(o.Text,{className:"text-[16px] font-bold",children:t}),(0,e.jsx)(o.Text,{className:"text-[16px] font-bold text-[#86868C]",html:l?.trim().toLowerCase()==="true"?"\u2714\uFE0F":l?.trim().toLowerCase()==="false"?"\u274C":l})]}))})]})]})};
1
+ "use strict";var p=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var m=(a,e)=>{for(var l in e)p(a,l,{get:e[l],enumerable:!0})},x=(a,e,l,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of n(e))!d.call(a,s)&&s!==l&&p(a,s,{get:()=>e[s],enumerable:!(i=g(e,s))||i.enumerable});return a};var f=a=>x(p({},"__esModule",{value:!0}),a);var b={};m(b,{SpecsModal:()=>D});module.exports=f(b);var t=require("react/jsx-runtime"),r=require("../../../../../AiuiProvider/index.js"),o=require("../../../../../../components/index.js"),c=require("../../../../BizProductProvider.js");const D=()=>{const{product:a}=(0,c.useBizProductContext)(),{copyWriting:e}=(0,r.useAiuiContext)();return(0,t.jsxs)(o.Dialog,{children:[(0,t.jsx)(o.DialogTrigger,{className:"text-base font-bold leading-[1.4]",children:e?.specs}),(0,t.jsxs)(o.DialogContent,{overlayClassName:"z-[100]",className:"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]",children:[(0,t.jsx)(o.DialogHeader,{className:"laptop:pt-4 laptop:pb-3 border-b border-[#E8E8E8] pb-2 pt-4",children:(0,t.jsx)(o.DialogTitle,{className:"text-sm text-[#6D6D6F]",children:e?.specs})}),(0,t.jsx)(o.Grid,{className:"laptop:gap-8 laptop:py-8 py-6",children:a.metafields?.global?.specifications?.map(({key:l,value:i})=>(0,t.jsxs)(o.GridItem,{span:6,className:"flex flex-col gap-1",children:[(0,t.jsx)(o.Text,{className:"text-[16px] font-bold",children:l}),(0,t.jsx)(o.Text,{className:"text-[16px] font-bold text-[#86868C]",html:i?.trim().toLowerCase()==="true"?"\u2714\uFE0F":i?.trim().toLowerCase()==="false"?"\u274C":i})]},l))})]})]})};
2
2
  //# sourceMappingURL=SpecsModal.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.tsx"],
4
- "sourcesContent": ["import {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Grid,\n GridItem,\n Text,\n} from '../../../../../../components/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\n\nexport const SpecsModal = () => {\n const { product } = useBizProductContext()\n\n return (\n <Dialog>\n <DialogTrigger>\n <button className=\"text-base font-bold leading-[1.4]\">Specs</button>\n </DialogTrigger>\n <DialogContent\n overlayClassName=\"z-[100]\"\n className=\"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]\"\n >\n <DialogHeader className=\"laptop:pt-4 laptop:pb-3 border-b border-[#E8E8E8] pb-2 pt-4\">\n <DialogTitle className=\"text-sm text-[#6D6D6F]\">Specs</DialogTitle>\n </DialogHeader>\n <Grid className=\"laptop:gap-8 laptop:py-8 py-6\">\n {product.metafields?.global?.specifications?.map(({ key, value }: { key: string; value: string }) => (\n <GridItem span={6} className=\"flex flex-col gap-1\">\n <Text className=\"text-[16px] font-bold\">{key}</Text>\n <Text\n className=\"text-[16px] font-bold text-[#86868C]\"\n html={\n value?.trim().toLowerCase() === 'true' ? '\u2714\uFE0F' : value?.trim().toLowerCase() === 'false' ? '\u274C' : value\n }\n />\n </GridItem>\n ))}\n </Grid>\n </DialogContent>\n </Dialog>\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAkBQ,IAAAI,EAAA,6BAlBRC,EASO,iDACPC,EAAqC,6CAE9B,MAAMJ,EAAa,IAAM,CAC9B,KAAM,CAAE,QAAAK,CAAQ,KAAI,wBAAqB,EAEzC,SACE,QAAC,UACC,oBAAC,iBACC,mBAAC,UAAO,UAAU,oCAAoC,iBAAK,EAC7D,KACA,QAAC,iBACC,iBAAiB,UACjB,UAAU,8QAEV,oBAAC,gBAAa,UAAU,8DACtB,mBAAC,eAAY,UAAU,yBAAyB,iBAAK,EACvD,KACA,OAAC,QAAK,UAAU,gCACb,SAAAA,EAAQ,YAAY,QAAQ,gBAAgB,IAAI,CAAC,CAAE,IAAAC,EAAK,MAAAC,CAAM,OAC7D,QAAC,YAAS,KAAM,EAAG,UAAU,sBAC3B,oBAAC,QAAK,UAAU,wBAAyB,SAAAD,EAAI,KAC7C,OAAC,QACC,UAAU,uCACV,KACEC,GAAO,KAAK,EAAE,YAAY,IAAM,OAAS,eAAOA,GAAO,KAAK,EAAE,YAAY,IAAM,QAAU,SAAMA,EAEpG,GACF,CACD,EACH,GACF,GACF,CAEJ",
6
- "names": ["SpecsModal_exports", "__export", "SpecsModal", "__toCommonJS", "import_jsx_runtime", "import_components", "import_BizProductProvider", "product", "key", "value"]
4
+ "sourcesContent": ["import { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Grid,\n GridItem,\n Text,\n} from '../../../../../../components/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\n\nexport const SpecsModal = () => {\n const { product } = useBizProductContext()\n const { copyWriting } = useAiuiContext()\n\n return (\n <Dialog>\n <DialogTrigger className=\"text-base font-bold leading-[1.4]\">{copyWriting?.specs}</DialogTrigger>\n <DialogContent\n overlayClassName=\"z-[100]\"\n className=\"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]\"\n >\n <DialogHeader className=\"laptop:pt-4 laptop:pb-3 border-b border-[#E8E8E8] pb-2 pt-4\">\n <DialogTitle className=\"text-sm text-[#6D6D6F]\">{copyWriting?.specs}</DialogTitle>\n </DialogHeader>\n <Grid className=\"laptop:gap-8 laptop:py-8 py-6\">\n {product.metafields?.global?.specifications?.map(({ key, value }: { key: string; value: string }) => (\n <GridItem span={6} key={key} className=\"flex flex-col gap-1\">\n <Text className=\"text-[16px] font-bold\">{key}</Text>\n <Text\n className=\"text-[16px] font-bold text-[#86868C]\"\n html={\n value?.trim().toLowerCase() === 'true' ? '\u2714\uFE0F' : value?.trim().toLowerCase() === 'false' ? '\u274C' : value\n }\n />\n </GridItem>\n ))}\n </Grid>\n </DialogContent>\n </Dialog>\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAmBM,IAAAI,EAAA,6BAnBNC,EAA+B,gDAC/BC,EASO,iDACPC,EAAqC,6CAE9B,MAAML,EAAa,IAAM,CAC9B,KAAM,CAAE,QAAAM,CAAQ,KAAI,wBAAqB,EACnC,CAAE,YAAAC,CAAY,KAAI,kBAAe,EAEvC,SACE,QAAC,UACC,oBAAC,iBAAc,UAAU,oCAAqC,SAAAA,GAAa,MAAM,KACjF,QAAC,iBACC,iBAAiB,UACjB,UAAU,8QAEV,oBAAC,gBAAa,UAAU,8DACtB,mBAAC,eAAY,UAAU,yBAA0B,SAAAA,GAAa,MAAM,EACtE,KACA,OAAC,QAAK,UAAU,gCACb,SAAAD,EAAQ,YAAY,QAAQ,gBAAgB,IAAI,CAAC,CAAE,IAAAE,EAAK,MAAAC,CAAM,OAC7D,QAAC,YAAS,KAAM,EAAa,UAAU,sBACrC,oBAAC,QAAK,UAAU,wBAAyB,SAAAD,EAAI,KAC7C,OAAC,QACC,UAAU,uCACV,KACEC,GAAO,KAAK,EAAE,YAAY,IAAM,OAAS,eAAOA,GAAO,KAAK,EAAE,YAAY,IAAM,QAAU,SAAMA,EAEpG,IAPsBD,CAQxB,CACD,EACH,GACF,GACF,CAEJ",
6
+ "names": ["SpecsModal_exports", "__export", "SpecsModal", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_components", "import_BizProductProvider", "product", "copyWriting", "key", "value"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var ee=Object.create;var V=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var oe=(t,a)=>{for(var s in a)V(t,s,{get:a[s],enumerable:!0})},W=(t,a,s,y)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of le(a))!ie.call(t,n)&&n!==s&&V(t,n,{get:()=>a[n],enumerable:!(y=te(a,n))||y.enumerable});return t};var re=(t,a,s)=>(s=t!=null?ee(ae(t)):{},W(a||!t||!t.__esModule?V(s,"default",{value:t,enumerable:!0}):s,t)),se=t=>W(V({},"__esModule",{value:!0}),t);var pe={};oe(pe,{default:()=>ue});module.exports=se(pe);var e=require("react/jsx-runtime"),$=require("../../../../AiuiProvider/index.js"),N=require("../../../../../components/index.js"),l=require("react"),G=require("swiper/react"),g=require("swiper/modules"),T=require("../../../../../helpers/index.js"),k=require("./types.js"),P=require("@radix-ui/react-tabs"),z=require("../../../BizProductProvider.js"),K=require("../../../hooks/use-variant-media.js"),U=require("./components/SpecsModal.js"),Z=re(require("./components/CompareModal.js")),q=require("../../../utils/index.js"),J=require("../../../../../shared/Styles.js"),Q=require("../../../../../shared/track.js"),X=require("../../../../../components/index.js");const Y=t=>(0,e.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,e.jsx)("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),(0,e.jsx)("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),O=t=>(0,e.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,e.jsx)("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),(0,e.jsx)("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),ne=()=>{const{copyWriting:t}=(0,$.useAiuiContext)(),{product:a,variant:s,selectedOptions:y}=(0,z.useBizProductContext)(),n=(0,K.useVariantMedia)({product:a,variant:s}),[p,x]=(0,l.useState)(null),M=(0,l.useRef)(null),b=s?.metafields?.component?.custom_media_list;let h,w,A,S;b&&b?.available?(h=b?.product||[],w=b?.scenarios||[],A=b?.keyFeatures||[],S=b?.video||[]):(h=n?.productList,w=n?.sceneList,A=n?.keyFeaturesList,S=n?.videoList);const o=(0,l.useMemo)(()=>[...h,...w,...S],[h,w,S]),m={productList:h,sceneList:w,keyFeaturesList:A,videoList:S},i=(0,l.useMemo)(()=>(a?.payload?.components?.find(d=>d.componentKey==="ProductGallery")?.data||[])?.map(d=>{let F=m[d?.galleries]||[];if(d?.images&&Array.isArray(d.images)&&d.images.length>0){const j=d.images.map(u=>{const I=[];if(u.image_1920&&u.image_1920.trim()&&I.push(`${u.image_1920} 1920`),u.image_1440&&u.image_1440.trim()&&I.push(`${u.image_1440} 1440`),u.image_1024&&u.image_1024.trim()&&I.push(`${u.image_1024} 1024`),u.image_768&&u.image_768.trim()&&I.push(`${u.image_768} 767`),u.image_390&&u.image_390.trim()&&I.push(`${u.image_390} 390`),I.length>0){const H=I.join(", ");return{image:{url:H,altText:d.comment?.content||""},_fromImages:!0,_responsiveSource:H}}return null}).filter(u=>u!==null);j.length>0&&(F=j)}return{...d,galleries:F}}).filter(d=>d.galleries.length>0),[a?.payload,m]),[E,L]=(0,l.useState)(i?.[0]),[f,_]=(0,l.useState)(0),[C,r]=(0,l.useState)(null),v=(0,l.useCallback)(()=>{const c=(f+1)%i.length;_(c),L(i[c]),r(0)},[f,i]),R=(0,l.useCallback)(()=>{const c=f===0?i.length-1:f-1;_(c),L(i[c]);const d=i[c]?.galleries||[];r(d.length-1)},[f,i]);(0,l.useEffect)(()=>{f!=null&&requestAnimationFrame(()=>{M.current?.scrollToTab(f)})},[f]),(0,l.useEffect)(()=>{L(i[0]),_(0)},[s?.id]);const D=(c,d)=>{switch(c?.galleryTabType){case k.GalleryTabType.GALLERY_IMAGE_MAIN:return(0,e.jsx)(B,{...c,index:d,onNextTab:v,onPrevTab:R,targetSlideIndex:C,onSlideChange:()=>r(null)});case k.GalleryTabType.GALLERY_IMAGE_FEATURES:return(0,e.jsx)(B,{...c,index:d,onNextTab:v,onPrevTab:R,targetSlideIndex:C,onSlideChange:()=>r(null)});case k.GalleryTabType.GALLERY_IMAGE_SCENE:return(0,e.jsx)(B,{...c,index:d,onNextTab:v,onPrevTab:R,targetSlideIndex:C,onSlideChange:()=>r(null)});case k.GalleryTabType.GALLERY_VIDEO:return(0,e.jsx)(de,{...c,onNextTab:v,onPrevTab:R,targetSlideIndex:C,onSlideChange:()=>r(null)});default:return null}};return(0,e.jsx)("div",{id:"ipc-product-gallery",children:(0,e.jsxs)(P.Root,{className:"relative",value:E?.tabValue,defaultValue:i?.[0]?.tabValue,children:[(0,e.jsx)("div",{className:"tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] desktop:relative h-[420px] overflow-hidden bg-[#EAEAEC] ",children:i.map((c,d)=>(0,e.jsx)(P.Content,{className:"h-full",value:c.tabValue,children:D(c,d)},c.tabValue))}),(0,e.jsx)(ce,{ref:M,galleryTabs:i,activeGalleryTab:E,setActiveGalleryTab:L,setActiveTabIndex:_,setTargetSlideIndex:r})]})})},ce=(0,l.forwardRef)((t,a)=>{const{galleryTabs:s,activeGalleryTab:y,setActiveGalleryTab:n,setActiveTabIndex:p,setTargetSlideIndex:x}=t,{product:M}=(0,z.useBizProductContext)(),b=(0,l.useRef)(null),h=(0,l.useRef)(new Map),w=(0,l.useCallback)((o,m,i)=>{n(m),p(i),x(0),A(o)},[n,p,x]),A=(0,l.useCallback)(o=>{if(b.current){const m=b.current,i=o.currentTarget,E=i.offsetLeft-m.offsetWidth/2+i.offsetWidth/2;m.scrollTo({left:E,behavior:"smooth"})}},[]),S=(0,l.useCallback)(o=>{if(b.current&&s[o]){const m=b.current,i=s[o],E=h.current.get(i.tabValue);if(E){const L=E.offsetLeft-m.offsetWidth/2+E.offsetWidth/2;m.scrollTo({left:L,behavior:"smooth"})}}},[s]);return(0,l.useImperativeHandle)(a,()=>({scrollToTab:S})),(0,e.jsxs)("div",{className:"laptop:inset-x-16 tablet:mt-3 desktop:static absolute inset-x-4 bottom-4 z-[2] flex items-center justify-between",children:[(0,e.jsx)(P.List,{ref:b,className:"laptop:p-0 desktop:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:(0,e.jsx)("div",{className:"whitespace-nowrap",children:s?.map((o,m)=>(0,e.jsx)(P.Trigger,{ref:i=>{i?h.current.set(o.tabValue,i):h.current.delete(o.tabValue)},className:(0,T.cn)("lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] rounded-full px-5 pb-[10px] pt-[11px] text-[14px] font-bold leading-tight",o.tabValue===y?.tabValue&&"bg-white"),onClick:i=>w(i,o,m),value:o.tabValue,children:o.tabLabel},o.tabValue))})}),(0,e.jsx)("div",{className:"laptop:gap-2 laptop:flex hidden",children:M.metafields?.global?.specifications&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(U.SpecsModal,{})," | ",(0,e.jsx)(Z.default,{})]})})]})}),B=(0,l.forwardRef)((t,a)=>{const{locale:s="us",copyWriting:y}=(0,$.useAiuiContext)(),{variant:n,totalSavings:p}=(0,z.useBizProductContext)(),x=(0,l.useRef)(null),[M,b]=(0,l.useState)(null),[h,w]=(0,l.useState)(!0),[A,S]=(0,l.useState)(!1),[o,m]=(0,l.useState)(null),i=(0,l.useRef)(null),[E,L]=(0,l.useState)(!1),f=(0,l.useMemo)(()=>{if(t?.galleryTabType===k.GalleryTabType.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";t?.galleryTabType===k.GalleryTabType.GALLERY_IMAGE_FEATURES||(t?.galleryTabType,k.GalleryTabType.GALLERY_IMAGE_SCENE)},[t?.galleryTabType]),_=(0,l.useCallback)(()=>{o?.isBeginning?t.onPrevTab?.():o?.slidePrev()},[o,t]),C=(0,l.useCallback)(()=>{o?.isEnd?t.onNextTab?.():o?.slideNext()},[o,t]);return(0,l.useEffect)(()=>{o&&t.targetSlideIndex&&(o.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[o,t.targetSlideIndex,t]),(0,e.jsxs)("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[(0,e.jsx)(G.Swiper,{ref:a,className:"h-full",onSwiper:m,onProgress:r=>{w(r.isBeginning),S(r.isEnd)},onTouchEnd:(r,v)=>{r.isBeginning&&r.swipeDirection==="prev"?_():r.isEnd&&r.swipeDirection==="next"&&C()},pagination:{clickable:!0,el:x.current},thumbs:{swiper:M},modules:[g.Mousewheel,g.Thumbs,g.Navigation,g.Pagination],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((r,v)=>{const R=`${t.tabValue}-${v}`,D=()=>{(0,Q.gaTrack)({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${n.sku}`,component_type:"image",component_name:t?.tabLabel||"",position:v+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},c=r?._responsiveSource||r?.image?.url||"";return(0,e.jsx)(G.SwiperSlide,{className:"h-full",children:(0,e.jsx)(X.ExposureDetector,{onExposure:D,exposureKey:R,threshold:.5,duration:2e3,className:"h-full",children:(0,e.jsx)(N.Picture,{source:c,alt:r?.image?.altText,className:(0,T.cn)("h-full",f),imgClassName:"object-cover h-full"})})},t?.id+"SwiperSlideItem"+v)})}),n.availableForSale&&!!p&&!t.index&&(0,e.jsx)(N.Badge,{size:"lg",className:"bg-brand laptop:left-16 laptop:top-5 desktop:left-6 desktop:top-6 absolute left-4 top-3 z-[2] text-white",children:`${(0,q.formatPrice)({amount:p,currencyCode:n?.price?.currencyCode,locale:s})} ${y?.off}`}),(0,e.jsx)("div",{className:(0,T.cn)("tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:_,children:(0,e.jsx)(Y,{className:(0,T.cn)("tablet:size-10 lg-desktop:size-12")})}),(0,e.jsx)("div",{className:(0,T.cn)("tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 desktop:right-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:C,children:(0,e.jsx)(O,{className:(0,T.cn)("tablet:size-10 lg-desktop:size-12")})}),(0,e.jsxs)("div",{className:"tablet:bottom-[70px] tablet:flex laptop:inset-x-16 desktop:bottom-[20px] desktop:inset-x-6 absolute inset-x-4 bottom-[94px] z-10 items-center justify-between",children:[(0,e.jsx)("div",{className:"tablet:block hidden",children:(0,e.jsx)(G.Swiper,{className:"flex items-center justify-between",onSwiper:b,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[g.Navigation,g.Thumbs],children:t?.galleries?.map((r,v)=>(0,e.jsx)(G.SwiperSlide,{className:"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded",children:(0,e.jsx)(N.Picture,{source:r.image?.url,alt:r.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-contain h-full"})},t?.id+"SwiperSlideThumbItem"+v))})}),!t?.index&&(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(N.Picture,{source:t?.comment?.avatar?.url,className:"laptop:size-10 size-8 shrink-0 rounded-full",imgClassName:"object-cover "}),(0,e.jsx)("div",{className:"relative max-w-[528px] overflow-hidden",children:(0,e.jsx)("div",{ref:i,className:(0,T.cn)("line-clamp-2"),style:{},children:(0,e.jsx)(N.Text,{html:t?.comment?.content,className:"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]"})})})]})]}),(0,e.jsx)("div",{ref:x,className:"tablet:hidden absolute inset-x-4 !bottom-[70px] z-10 text-center [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100"})]})}),de=t=>{const[a,s]=(0,l.useState)(null),y=(0,l.useCallback)(()=>{a?.isBeginning?t.onPrevTab?.():a?.slidePrev()},[a,t]),n=(0,l.useCallback)(()=>{a?.isEnd?t.onNextTab?.():a?.slideNext()},[a,t]);return(0,l.useEffect)(()=>{a&&t.targetSlideIndex!==null&&t.targetSlideIndex!==void 0&&(a.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[a,t.targetSlideIndex,t]),(0,e.jsxs)("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[(0,e.jsx)(G.Swiper,{className:"h-full",onSwiper:s,onTouchEnd:(p,x)=>{p.isBeginning&&p.swipeDirection==="prev"?y():p.isEnd&&p.swipeDirection==="next"&&n()},modules:[g.Mousewheel,g.Thumbs,g.Navigation,g.Pagination],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((p,x)=>(0,e.jsx)(G.SwiperSlide,{className:"h-full",children:(0,e.jsxs)("video",{controls:!0,className:"size-full object-cover",children:[(0,e.jsx)("track",{kind:"captions"}),(0,e.jsx)("source",{src:p?.sources?.[0]?.url,type:"video/mp4"}),(0,e.jsx)("source",{src:p?.sources?.[0]?.url,type:"video/webm"}),(0,e.jsx)("source",{src:p?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+x))}),(0,e.jsx)("div",{className:(0,T.cn)("swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:y,children:(0,e.jsx)(Y,{className:"tablet:size-10 lg-desktop:size-12"})}),(0,e.jsx)("div",{className:(0,T.cn)("tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:n,children:(0,e.jsx)(O,{className:"tablet:size-10 lg-desktop:size-12"})})]})},ge=t=>(0,e.jsx)("div",{children:"3D View"});var ue=(0,J.withLayout)(ne);
1
+ "use strict";var ee=Object.create;var V=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var oe=(t,a)=>{for(var s in a)V(t,s,{get:a[s],enumerable:!0})},W=(t,a,s,y)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of le(a))!ie.call(t,n)&&n!==s&&V(t,n,{get:()=>a[n],enumerable:!(y=te(a,n))||y.enumerable});return t};var re=(t,a,s)=>(s=t!=null?ee(ae(t)):{},W(a||!t||!t.__esModule?V(s,"default",{value:t,enumerable:!0}):s,t)),se=t=>W(V({},"__esModule",{value:!0}),t);var pe={};oe(pe,{default:()=>ue});module.exports=se(pe);var e=require("react/jsx-runtime"),$=require("../../../../AiuiProvider/index.js"),N=require("../../../../../components/index.js"),l=require("react"),G=require("swiper/react"),g=require("swiper/modules"),T=require("../../../../../helpers/index.js"),k=require("./types.js"),P=require("@radix-ui/react-tabs"),z=require("../../../BizProductProvider.js"),K=require("../../../hooks/use-variant-media.js"),U=require("./components/SpecsModal.js"),Z=re(require("./components/CompareModal.js")),q=require("../../../utils/index.js"),J=require("../../../../../shared/Styles.js"),Q=require("../../../../../shared/track.js"),X=require("../../../../../components/index.js");const Y=t=>(0,e.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,e.jsx)("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),(0,e.jsx)("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),O=t=>(0,e.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,e.jsx)("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),(0,e.jsx)("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),ne=()=>{const{copyWriting:t}=(0,$.useAiuiContext)(),{product:a,variant:s,selectedOptions:y}=(0,z.useBizProductContext)(),n=(0,K.useVariantMedia)({product:a,variant:s}),[p,x]=(0,l.useState)(null),M=(0,l.useRef)(null),m=s?.metafields?.component?.custom_media_list;let h,w,A,S;m&&m?.available?(h=m?.product||[],w=m?.scenarios||[],A=m?.keyFeatures||[],S=m?.video||[]):(h=n?.productList,w=n?.sceneList,A=n?.keyFeaturesList,S=n?.videoList);const o=(0,l.useMemo)(()=>[...h,...w,...S],[h,w,S]),b={productList:h,sceneList:w,keyFeaturesList:A,videoList:S},i=(0,l.useMemo)(()=>(a?.payload?.components?.find(d=>d.componentKey==="ProductGallery")?.data||[])?.map(d=>{let F=b[d?.galleries]||[];if(d?.images&&Array.isArray(d.images)&&d.images.length>0){const j=d.images.map(u=>{const I=[];if(u.image_1920&&u.image_1920.trim()&&I.push(`${u.image_1920} 1920`),u.image_1440&&u.image_1440.trim()&&I.push(`${u.image_1440} 1440`),u.image_1024&&u.image_1024.trim()&&I.push(`${u.image_1024} 1024`),u.image_768&&u.image_768.trim()&&I.push(`${u.image_768} 767`),u.image_390&&u.image_390.trim()&&I.push(`${u.image_390} 390`),I.length>0){const H=I.join(", ");return{image:{url:H,altText:d.comment?.content||""},_fromImages:!0,_responsiveSource:H}}return null}).filter(u=>u!==null);j.length>0&&(F=j)}return{...d,galleries:F}}).filter(d=>d.galleries.length>0),[a?.payload,b]),[E,L]=(0,l.useState)(i?.[0]),[f,_]=(0,l.useState)(0),[C,r]=(0,l.useState)(null),v=(0,l.useCallback)(()=>{const c=(f+1)%i.length;_(c),L(i[c]),r(0)},[f,i]),R=(0,l.useCallback)(()=>{const c=f===0?i.length-1:f-1;_(c),L(i[c]);const d=i[c]?.galleries||[];r(d.length-1)},[f,i]);(0,l.useEffect)(()=>{f!=null&&requestAnimationFrame(()=>{M.current?.scrollToTab(f)})},[f]),(0,l.useEffect)(()=>{L(i[0]),_(0)},[s?.id]);const D=(c,d)=>{switch(c?.galleryTabType){case k.GalleryTabType.GALLERY_IMAGE_MAIN:return(0,e.jsx)(B,{...c,index:d,onNextTab:v,onPrevTab:R,targetSlideIndex:C,onSlideChange:()=>r(null)});case k.GalleryTabType.GALLERY_IMAGE_FEATURES:return(0,e.jsx)(B,{...c,index:d,onNextTab:v,onPrevTab:R,targetSlideIndex:C,onSlideChange:()=>r(null)});case k.GalleryTabType.GALLERY_IMAGE_SCENE:return(0,e.jsx)(B,{...c,index:d,onNextTab:v,onPrevTab:R,targetSlideIndex:C,onSlideChange:()=>r(null)});case k.GalleryTabType.GALLERY_VIDEO:return(0,e.jsx)(de,{...c,onNextTab:v,onPrevTab:R,targetSlideIndex:C,onSlideChange:()=>r(null)});default:return null}};return(0,e.jsx)("div",{id:"ipc-product-gallery",children:(0,e.jsxs)(P.Root,{className:"relative",value:E?.tabValue,defaultValue:i?.[0]?.tabValue,children:[(0,e.jsx)("div",{className:"tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] desktop:relative h-[420px] overflow-hidden bg-[#EAEAEC] ",children:i.map((c,d)=>(0,e.jsx)(P.Content,{className:"h-full",value:c.tabValue,children:D(c,d)},c.tabValue))}),(0,e.jsx)(ce,{ref:M,galleryTabs:i,activeGalleryTab:E,setActiveGalleryTab:L,setActiveTabIndex:_,setTargetSlideIndex:r})]})})},ce=(0,l.forwardRef)((t,a)=>{const{galleryTabs:s,activeGalleryTab:y,setActiveGalleryTab:n,setActiveTabIndex:p,setTargetSlideIndex:x}=t,{product:M}=(0,z.useBizProductContext)(),m=(0,l.useRef)(null),h=(0,l.useRef)(new Map),w=(0,l.useCallback)((o,b,i)=>{n(b),p(i),x(0),A(o)},[n,p,x]),A=(0,l.useCallback)(o=>{if(m.current){const b=m.current,i=o.currentTarget,E=i.offsetLeft-b.offsetWidth/2+i.offsetWidth/2;b.scrollTo({left:E,behavior:"smooth"})}},[]),S=(0,l.useCallback)(o=>{if(m.current&&s[o]){const b=m.current,i=s[o],E=h.current.get(i.tabValue);if(E){const L=E.offsetLeft-b.offsetWidth/2+E.offsetWidth/2;b.scrollTo({left:L,behavior:"smooth"})}}},[s]);return(0,l.useImperativeHandle)(a,()=>({scrollToTab:S})),(0,e.jsxs)("div",{className:"laptop:inset-x-16 tablet:mt-3 desktop:static absolute inset-x-4 bottom-4 z-[2] flex items-center justify-between",children:[(0,e.jsx)(P.List,{ref:m,className:"laptop:p-0 desktop:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:(0,e.jsx)("div",{className:"whitespace-nowrap",children:s?.map((o,b)=>(0,e.jsx)(P.Trigger,{ref:i=>{i?h.current.set(o.tabValue,i):h.current.delete(o.tabValue)},className:(0,T.cn)("lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] rounded-full px-5 pb-[10px] pt-[11px] text-[14px] font-bold leading-tight",o.tabValue===y?.tabValue&&"bg-white"),onClick:i=>w(i,o,b),value:o.tabValue,children:o.tabLabel},o.tabValue+b))})}),(0,e.jsx)("div",{className:"laptop:gap-2 laptop:flex hidden",children:M.metafields?.global?.specifications&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(U.SpecsModal,{})," | ",(0,e.jsx)(Z.default,{})]})})]})}),B=(0,l.forwardRef)((t,a)=>{const{locale:s="us",copyWriting:y}=(0,$.useAiuiContext)(),{variant:n,totalSavings:p}=(0,z.useBizProductContext)(),x=(0,l.useRef)(null),[M,m]=(0,l.useState)(null),[h,w]=(0,l.useState)(!0),[A,S]=(0,l.useState)(!1),[o,b]=(0,l.useState)(null),i=(0,l.useRef)(null),[E,L]=(0,l.useState)(!1),f=(0,l.useMemo)(()=>{if(t?.galleryTabType===k.GalleryTabType.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";t?.galleryTabType===k.GalleryTabType.GALLERY_IMAGE_FEATURES||(t?.galleryTabType,k.GalleryTabType.GALLERY_IMAGE_SCENE)},[t?.galleryTabType]),_=(0,l.useCallback)(()=>{o?.isBeginning?t.onPrevTab?.():o?.slidePrev()},[o,t]),C=(0,l.useCallback)(()=>{o?.isEnd?t.onNextTab?.():o?.slideNext()},[o,t]);return(0,l.useEffect)(()=>{o&&t.targetSlideIndex&&(o.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[o,t.targetSlideIndex,t]),(0,e.jsxs)("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[(0,e.jsx)(G.Swiper,{ref:a,className:"h-full",onSwiper:b,onProgress:r=>{w(r.isBeginning),S(r.isEnd)},onTouchEnd:(r,v)=>{r.isBeginning&&r.swipeDirection==="prev"?_():r.isEnd&&r.swipeDirection==="next"&&C()},pagination:{clickable:!0,el:x.current},thumbs:{swiper:M},modules:[g.Mousewheel,g.Thumbs,g.Navigation,g.Pagination],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((r,v)=>{const R=`${t.tabValue}-${v}`,D=()=>{(0,Q.gaTrack)({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${n.sku}`,component_type:"image",component_name:t?.tabLabel||"",position:v+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},c=r?._responsiveSource||r?.image?.url||"";return(0,e.jsx)(G.SwiperSlide,{className:"h-full",children:(0,e.jsx)(X.ExposureDetector,{onExposure:D,exposureKey:R,threshold:.5,duration:2e3,className:"h-full",children:(0,e.jsx)(N.Picture,{source:c,alt:r?.image?.altText,className:(0,T.cn)("h-full",f),imgClassName:"object-cover h-full"})})},t?.id+"SwiperSlideItem"+v)})}),n.availableForSale&&!!p&&!t.index&&(0,e.jsx)(N.Badge,{size:"lg",className:"bg-brand laptop:left-16 laptop:top-5 desktop:left-6 desktop:top-6 absolute left-4 top-3 z-[2] text-white",children:`${(0,q.formatPrice)({amount:p,currencyCode:n?.price?.currencyCode,locale:s})} ${y?.off}`}),(0,e.jsx)("div",{className:(0,T.cn)("tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:_,children:(0,e.jsx)(Y,{className:(0,T.cn)("tablet:size-10 lg-desktop:size-12")})}),(0,e.jsx)("div",{className:(0,T.cn)("tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 desktop:right-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:C,children:(0,e.jsx)(O,{className:(0,T.cn)("tablet:size-10 lg-desktop:size-12")})}),(0,e.jsxs)("div",{className:"tablet:bottom-[70px] tablet:flex laptop:inset-x-16 desktop:bottom-[20px] desktop:inset-x-6 absolute inset-x-4 bottom-[94px] z-10 items-center justify-between",children:[(0,e.jsx)("div",{className:"tablet:block hidden",children:(0,e.jsx)(G.Swiper,{className:"flex items-center justify-between",onSwiper:m,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[g.Navigation,g.Thumbs],children:t?.galleries?.map((r,v)=>(0,e.jsx)(G.SwiperSlide,{className:"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded",children:(0,e.jsx)(N.Picture,{source:r.image?.url,alt:r.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-cover h-full"})},t?.id+"SwiperSlideThumbItem"+v))})}),!t?.index&&(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(N.Picture,{source:t?.comment?.avatar?.url,className:"laptop:size-10 size-8 shrink-0 rounded-full",imgClassName:"object-cover "}),(0,e.jsx)("div",{className:"relative max-w-[528px] overflow-hidden",children:(0,e.jsx)("div",{ref:i,className:(0,T.cn)("line-clamp-2"),style:{},children:(0,e.jsx)(N.Text,{html:t?.comment?.content,className:"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]"})})})]})]}),(0,e.jsx)("div",{ref:x,className:"tablet:hidden absolute inset-x-4 !bottom-[70px] z-10 text-center [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100"})]})}),de=t=>{const[a,s]=(0,l.useState)(null),y=(0,l.useCallback)(()=>{a?.isBeginning?t.onPrevTab?.():a?.slidePrev()},[a,t]),n=(0,l.useCallback)(()=>{a?.isEnd?t.onNextTab?.():a?.slideNext()},[a,t]);return(0,l.useEffect)(()=>{a&&t.targetSlideIndex!==null&&t.targetSlideIndex!==void 0&&(a.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[a,t.targetSlideIndex,t]),(0,e.jsxs)("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[(0,e.jsx)(G.Swiper,{className:"h-full",onSwiper:s,onTouchEnd:(p,x)=>{p.isBeginning&&p.swipeDirection==="prev"?y():p.isEnd&&p.swipeDirection==="next"&&n()},modules:[g.Mousewheel,g.Thumbs,g.Navigation,g.Pagination],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((p,x)=>(0,e.jsx)(G.SwiperSlide,{className:"h-full",children:(0,e.jsxs)("video",{controls:!0,className:"size-full object-cover",children:[(0,e.jsx)("track",{kind:"captions"}),(0,e.jsx)("source",{src:p?.sources?.[0]?.url,type:"video/mp4"}),(0,e.jsx)("source",{src:p?.sources?.[0]?.url,type:"video/webm"}),(0,e.jsx)("source",{src:p?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+x))}),(0,e.jsx)("div",{className:(0,T.cn)("swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:y,children:(0,e.jsx)(Y,{className:"tablet:size-10 lg-desktop:size-12"})}),(0,e.jsx)("div",{className:(0,T.cn)("tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:n,children:(0,e.jsx)(O,{className:"tablet:size-10 lg-desktop:size-12"})})]})},ge=t=>(0,e.jsx)("div",{children:"3D View"});var ue=(0,J.withLayout)(ne);
2
2
  //# sourceMappingURL=index.js.map