@dropins/storefront-pdp 3.0.0-beta1 → 3.0.1-alpha1

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 (52) hide show
  1. package/api.js +2 -2
  2. package/chunks/DownloadableOptions2.js +4 -0
  3. package/chunks/DownloadableOptions2.js.map +1 -0
  4. package/chunks/GiftCardOptions2.js +1 -1
  5. package/chunks/PriceRange.js +1 -1
  6. package/chunks/Swatches.js +1 -1
  7. package/chunks/Zoom.js +1 -1
  8. package/chunks/date.js +1 -1
  9. package/chunks/fetchProductData.js +4 -4
  10. package/chunks/fetchProductData.js.map +1 -1
  11. package/chunks/getFetchedProductData.js +1 -1
  12. package/chunks/getProductConfigurationValues.js +4 -0
  13. package/chunks/getProductConfigurationValues.js.map +1 -0
  14. package/chunks/isProductConfigurationValid.js +2 -2
  15. package/chunks/isProductConfigurationValid.js.map +1 -1
  16. package/chunks/useProductData.js +4 -0
  17. package/chunks/useProductData.js.map +1 -0
  18. package/components/DownloadableOptions/DownloadableOptions.d.ts +29 -0
  19. package/components/DownloadableOptions/index.d.ts +18 -0
  20. package/components/Product/Product.d.ts +1 -0
  21. package/components/index.d.ts +1 -0
  22. package/containers/ProductAttributes.js +2 -2
  23. package/containers/ProductAttributes.js.map +1 -1
  24. package/containers/ProductDescription.js +1 -1
  25. package/containers/ProductDetails.js +2 -2
  26. package/containers/ProductDetails.js.map +1 -1
  27. package/containers/ProductDownloadableOptions/ProductDownloadableOptions.d.ts +9 -0
  28. package/containers/ProductDownloadableOptions/index.d.ts +18 -0
  29. package/containers/ProductDownloadableOptions.d.ts +3 -0
  30. package/containers/ProductDownloadableOptions.js +4 -0
  31. package/containers/ProductDownloadableOptions.js.map +1 -0
  32. package/containers/ProductGallery.js +2 -2
  33. package/containers/ProductGallery.js.map +1 -1
  34. package/containers/ProductGiftCardOptions.js +2 -2
  35. package/containers/ProductGiftCardOptions.js.map +1 -1
  36. package/containers/ProductHeader.js +2 -2
  37. package/containers/ProductHeader.js.map +1 -1
  38. package/containers/ProductOptions.js +2 -2
  39. package/containers/ProductOptions.js.map +1 -1
  40. package/containers/ProductPrice.js +2 -2
  41. package/containers/ProductPrice.js.map +1 -1
  42. package/containers/ProductQuantity.js +2 -2
  43. package/containers/ProductQuantity.js.map +1 -1
  44. package/containers/ProductShortDescription.js +1 -1
  45. package/containers/index.d.ts +1 -0
  46. package/data/models/product-model.d.ts +1 -0
  47. package/fragments.js +1 -1
  48. package/i18n/en_US.json.d.ts +8 -11
  49. package/lib/useProductData.d.ts +31 -0
  50. package/package.json +1 -1
  51. package/render.js +4 -3
  52. package/render.js.map +1 -1
@@ -0,0 +1,29 @@
1
+ import { FunctionComponent } from 'preact';
2
+ import { HTMLAttributes } from 'preact/compat';
3
+
4
+ export type DownloadableLink = {
5
+ uid: string;
6
+ price: number;
7
+ sample_url: string | null;
8
+ label: string;
9
+ number_of_downloads: number;
10
+ };
11
+ export type DownloadableSample = {
12
+ uid: string;
13
+ label: string;
14
+ url: string;
15
+ };
16
+ export type DownloadableValue = {
17
+ links: DownloadableLink[];
18
+ samples: DownloadableSample[];
19
+ purchaseSeparately: boolean;
20
+ };
21
+ export interface DownloadableOptionsProps extends Omit<HTMLAttributes<HTMLDivElement>, 'value'> {
22
+ label: string;
23
+ value: DownloadableValue;
24
+ onLinkChange?: (uid: string, selected: boolean) => void;
25
+ currency?: string;
26
+ locale?: string;
27
+ }
28
+ export declare const DownloadableOptions: FunctionComponent<DownloadableOptionsProps>;
29
+ //# sourceMappingURL=DownloadableOptions.d.ts.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ * Copyright 2023 Adobe
5
+ * All Rights Reserved.
6
+ * __________________
7
+ * NOTICE: All information contained herein is, and remains
8
+ * the property of Adobe and its suppliers, if any. The intellectual
9
+ * and technical concepts contained herein are proprietary to Adobe
10
+ * and its suppliers and are protected by all applicable intellectual
11
+ * property laws, including trade secret and copyright laws.
12
+ * Dissemination of this information or reproduction of this material
13
+ * is strictly forbidden unless prior written permission is obtained
14
+ * from Adobe.
15
+ */
16
+ export * from './DownloadableOptions';
17
+ export { DownloadableOptions as default } from './DownloadableOptions';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -17,6 +17,7 @@ export interface ProductProps extends Omit<HTMLAttributes<HTMLDivElement>, 'titl
17
17
  images: VNode[];
18
18
  options?: VNode;
19
19
  giftCardOptions?: VNode;
20
+ downloadableOptions?: VNode;
20
21
  sku?: VNode;
21
22
  price?: VNode;
22
23
  specialPrice?: VNode;
@@ -24,4 +24,5 @@ export * from './Header';
24
24
  export * from './Price';
25
25
  export * from './PriceTiers';
26
26
  export * from './GiftCardOptions';
27
+ export * from './DownloadableOptions';
27
28
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- /*! Copyright 2025 Adobe
1
+ /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{jsxs as m,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{useState as s,useMemo as P,useEffect as A}from"@dropins/tools/preact-compat.js";import{classes as L,Slot as _}from"@dropins/tools/lib.js";import{events as u}from"@dropins/tools/event-bus.js";import{i as j,t as C}from"../chunks/date.js";import{g as I}from"../chunks/getFetchedProductData.js";import{useText as M}from"@dropins/tools/i18n.js";import{c as N}from"../chunks/fetchProductData.js";import"../fragments.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/isProductConfigurationValid.js";const T=({initialData:f=null,scope:i,children:y,slots:e,...c})=>{var l;const p=M("PDP.Product.Details.label").label,{globalLocale:b="en-US"}=N.getConfig(),[d,g]=s(b),[r,D]=s(f),h=P(()=>({data:r}),[r]);return A(()=>{const t=u.on("pdp/data",D,{scope:i}),o=u.on("locale",g);return()=>{t==null||t.off(),o==null||o.off()}},[i]),r?m("div",{...c,className:L(["pdp-attributes",c.className]),children:[p,e!=null&&e.Attributes?n(_,{name:"Attributes",slot:e==null?void 0:e.Attributes,context:{...h}}):n("ul",{children:(l=r==null?void 0:r.attributes)==null?void 0:l.map(({id:t,label:o,value:a},S)=>{if(t!=null&&t.startsWith("ac_")||!a)return null;const x=j(a)?C(a,d):a.toString();return m("li",{children:[o,": ",n("span",{dangerouslySetInnerHTML:{__html:x}})]},`attribute-${S}`)})})]}):null};T.getInitialData=I;export{T as ProductAttributes,T as default};
3
+ import{jsxs as l,jsx as i}from"@dropins/tools/preact-jsx-runtime.js";import{useState as s,useMemo as P,useEffect as A}from"@dropins/tools/preact-compat.js";import{classes as L,Slot as _}from"@dropins/tools/lib.js";import{events as u}from"@dropins/tools/event-bus.js";import{i as j,t as C}from"../chunks/date.js";import{g as I}from"../chunks/getFetchedProductData.js";import{useText as M}from"@dropins/tools/i18n.js";import{c as N}from"../chunks/fetchProductData.js";import"../fragments.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getProductConfigurationValues.js";import"../chunks/isProductConfigurationValid.js";const T=({initialData:f=null,scope:n,children:y,slots:e,...c})=>{var m;const p=M("PDP.Product.Details.label").label,{globalLocale:b="en-US"}=N.getConfig(),[d,g]=s(b),[r,D]=s(f),h=P(()=>({data:r}),[r]);return A(()=>{const t=u.on("pdp/data",D,{scope:n}),o=u.on("locale",g);return()=>{t==null||t.off(),o==null||o.off()}},[n]),r?l("div",{...c,className:L(["pdp-attributes",c.className]),children:[p,e!=null&&e.Attributes?i(_,{name:"Attributes",slot:e==null?void 0:e.Attributes,context:{...h}}):i("ul",{children:(m=r==null?void 0:r.attributes)==null?void 0:m.map(({id:t,label:o,value:a},S)=>{if(t!=null&&t.startsWith("ac_")||!a)return null;const x=j(a)?C(a,d):a.toString();return l("li",{children:[o,": ",i("span",{dangerouslySetInnerHTML:{__html:x}})]},`attribute-${S}`)})})]}):null};T.getInitialData=I;export{T as ProductAttributes,T as default};
4
4
  //# sourceMappingURL=ProductAttributes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductAttributes.js","sources":["/@dropins/storefront-pdp/src/containers/ProductAttributes/ProductAttributes.tsx"],"sourcesContent":["/**\n * ADOBE CONFIDENTIAL\n * __________________\n * Copyright 2024 Adobe\n * All Rights Reserved.\n * __________________\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n */\n\nimport { HTMLAttributes, useEffect, useState, useMemo } from 'preact/compat';\nimport { classes, Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { ProductModel } from '@/pdp/data/models';\nimport { isDateValid, toDateString } from '@/pdp/lib/date';\nimport { config, getFetchedProductData } from '@/pdp/api';\n\ntype DefaultSlotContext = {\n data: ProductModel | null;\n};\n\nexport interface ProductAttributesProps extends HTMLAttributes<HTMLDivElement> {\n scope?: string;\n slots?: {\n Attributes?: SlotProps<DefaultSlotContext>;\n };\n}\n\nexport const ProductAttributes: Container<\n ProductAttributesProps,\n ProductModel | null\n> = ({ initialData = null, scope, children, slots, ...props }) => {\n const DetailsLabel = useText('PDP.Product.Details.label').label;\n const { globalLocale = 'en-US' } = config.getConfig();\n\n const [locale, setLocale] = useState<string>(globalLocale);\n const [data, setData] = useState<ProductModel | null>(initialData);\n\n const defaultSlotContext: DefaultSlotContext = useMemo(\n () => ({ data }),\n [data]\n );\n\n // Listen for events\n useEffect(() => {\n const dataEvent = events.on('pdp/data', setData, { scope });\n const localeEvent = events.on('locale', setLocale);\n\n return () => {\n dataEvent?.off();\n localeEvent?.off();\n };\n }, [scope]);\n\n if (!data) return null;\n\n return (\n <div {...props} className={classes(['pdp-attributes', props.className])}>\n {DetailsLabel}\n {slots?.Attributes ? (\n <Slot\n name=\"Attributes\"\n slot={slots?.Attributes}\n context={{ ...defaultSlotContext }}\n />\n ) : (\n <ul>\n {data?.attributes?.map(\n (\n { id, label, value }: { id: string; label: string; value: any },\n index: number\n ) => {\n if (id?.startsWith('ac_') || !value) {\n return null;\n }\n\n const __html = isDateValid(value)\n ? toDateString(value, locale)\n : value.toString();\n\n return (\n <li key={`attribute-${index}`}>\n {/* eslint-disable-next-line react/no-danger */}\n {label}: <span dangerouslySetInnerHTML={{ __html }} />\n </li>\n );\n }\n )}\n </ul>\n )}\n </div>\n );\n};\n\nProductAttributes.getInitialData = getFetchedProductData;\n"],"names":["ProductAttributes","initialData","scope","children","slots","props","DetailsLabel","useText","globalLocale","config","locale","setLocale","useState","data","setData","defaultSlotContext","useMemo","useEffect","dataEvent","events","localeEvent","jsxs","classes","jsx","Slot","_a","id","label","value","index","__html","isDateValid","toDateString","getFetchedProductData"],"mappings":"mkBAmCa,MAAAA,EAGT,CAAC,CAAE,YAAAC,EAAc,KAAM,MAAAC,EAAO,SAAAC,EAAU,MAAAC,EAAO,GAAGC,KAAY,OAC1D,MAAAC,EAAeC,EAAQ,2BAA2B,EAAE,MACpD,CAAE,aAAAC,EAAe,SAAYC,EAAO,UAAU,EAE9C,CAACC,EAAQC,CAAS,EAAIC,EAAiBJ,CAAY,EACnD,CAACK,EAAMC,CAAO,EAAIF,EAA8BX,CAAW,EAE3Dc,EAAyCC,EAC7C,KAAO,CAAE,KAAAH,CAAK,GACd,CAACA,CAAI,CACP,EAaI,OAVJI,EAAU,IAAM,CACd,MAAMC,EAAYC,EAAO,GAAG,WAAYL,EAAS,CAAE,MAAAZ,EAAO,EACpDkB,EAAcD,EAAO,GAAG,SAAUR,CAAS,EAEjD,MAAO,IAAM,CACXO,GAAA,MAAAA,EAAW,MACXE,GAAA,MAAAA,EAAa,KACf,CAAA,EACC,CAAClB,CAAK,CAAC,EAELW,EAGHQ,EAAC,MAAK,CAAA,GAAGhB,EAAO,UAAWiB,EAAQ,CAAC,iBAAkBjB,EAAM,SAAS,CAAC,EACnE,SAAA,CAAAC,EACAF,GAAA,MAAAA,EAAO,WACNmB,EAACC,EAAA,CACC,KAAK,aACL,KAAMpB,GAAA,YAAAA,EAAO,WACb,QAAS,CAAE,GAAGW,CAAmB,CAAA,CAAA,EAGnCQ,EAAC,KACE,CAAA,UAAAE,EAAAZ,GAAA,YAAAA,EAAM,aAAN,YAAAY,EAAkB,IACjB,CACE,CAAE,GAAAC,EAAI,MAAAC,EAAO,MAAAC,CAAA,EACbC,IACG,CACH,GAAIH,GAAA,MAAAA,EAAI,WAAW,QAAU,CAACE,EACrB,OAAA,KAGH,MAAAE,EAASC,EAAYH,CAAK,EAC5BI,EAAaJ,EAAOlB,CAAM,EAC1BkB,EAAM,SAAS,EAEnB,SACG,KAEE,CAAA,SAAA,CAAAD,EAAM,KAAGJ,EAAA,OAAA,CAAK,wBAAyB,CAAE,OAAAO,EAAU,CAAA,CAF7C,CAAA,EAAA,aAAaD,CAAK,EAG3B,CAAA,EAIR,CAAA,CAAA,EAEJ,EApCgB,IAsCpB,EAEA7B,EAAkB,eAAiBiC"}
1
+ {"version":3,"file":"ProductAttributes.js","sources":["/@dropins/storefront-pdp/src/containers/ProductAttributes/ProductAttributes.tsx"],"sourcesContent":["/**\n * ADOBE CONFIDENTIAL\n * __________________\n * Copyright 2024 Adobe\n * All Rights Reserved.\n * __________________\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n */\n\nimport { HTMLAttributes, useEffect, useState, useMemo } from 'preact/compat';\nimport { classes, Container, Slot, SlotProps } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\nimport { events } from '@adobe-commerce/event-bus';\nimport { ProductModel } from '@/pdp/data/models';\nimport { isDateValid, toDateString } from '@/pdp/lib/date';\nimport { config, getFetchedProductData } from '@/pdp/api';\n\ntype DefaultSlotContext = {\n data: ProductModel | null;\n};\n\nexport interface ProductAttributesProps extends HTMLAttributes<HTMLDivElement> {\n scope?: string;\n slots?: {\n Attributes?: SlotProps<DefaultSlotContext>;\n };\n}\n\nexport const ProductAttributes: Container<\n ProductAttributesProps,\n ProductModel | null\n> = ({ initialData = null, scope, children, slots, ...props }) => {\n const DetailsLabel = useText('PDP.Product.Details.label').label;\n const { globalLocale = 'en-US' } = config.getConfig();\n\n const [locale, setLocale] = useState<string>(globalLocale);\n const [data, setData] = useState<ProductModel | null>(initialData);\n\n const defaultSlotContext: DefaultSlotContext = useMemo(\n () => ({ data }),\n [data]\n );\n\n // Listen for events\n useEffect(() => {\n const dataEvent = events.on('pdp/data', setData, { scope });\n const localeEvent = events.on('locale', setLocale);\n\n return () => {\n dataEvent?.off();\n localeEvent?.off();\n };\n }, [scope]);\n\n if (!data) return null;\n\n return (\n <div {...props} className={classes(['pdp-attributes', props.className])}>\n {DetailsLabel}\n {slots?.Attributes ? (\n <Slot\n name=\"Attributes\"\n slot={slots?.Attributes}\n context={{ ...defaultSlotContext }}\n />\n ) : (\n <ul>\n {data?.attributes?.map(\n (\n { id, label, value }: { id: string; label: string; value: any },\n index: number\n ) => {\n if (id?.startsWith('ac_') || !value) {\n return null;\n }\n\n const __html = isDateValid(value)\n ? toDateString(value, locale)\n : value.toString();\n\n return (\n <li key={`attribute-${index}`}>\n {/* eslint-disable-next-line react/no-danger */}\n {label}: <span dangerouslySetInnerHTML={{ __html }} />\n </li>\n );\n }\n )}\n </ul>\n )}\n </div>\n );\n};\n\nProductAttributes.getInitialData = getFetchedProductData;\n"],"names":["ProductAttributes","initialData","scope","children","slots","props","DetailsLabel","useText","globalLocale","config","locale","setLocale","useState","data","setData","defaultSlotContext","useMemo","useEffect","dataEvent","events","localeEvent","jsxs","classes","jsx","Slot","_a","id","label","value","index","__html","isDateValid","toDateString","getFetchedProductData"],"mappings":"snBAmCa,MAAAA,EAGT,CAAC,CAAE,YAAAC,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AAK,EAG3B,CAAA,EAIR,CAAA,CAAA,EAEJ,EApCgB,IAsCpB,EAEA7B,EAAkB,eAAiBiC"}
@@ -1,4 +1,4 @@
1
- /*! Copyright 2025 Adobe
1
+ /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
3
  import{jsx as i}from"@dropins/tools/preact-jsx-runtime.js";import{useState as a,useEffect as c}from"@dropins/tools/preact-compat.js";import{classes as m}from"@dropins/tools/lib.js";import{events as l}from"@dropins/tools/event-bus.js";import{g as f}from"../chunks/getFetchedProductData.js";const u=({initialData:s=null,scope:r,children:d,...o})=>{const[t,n]=a(s);return c(()=>{const e=l.on("pdp/data",n,{scope:r});return()=>{e==null||e.off()}},[r]),t?i("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.description)??""},...o,className:m(["pdp-description",o.className])}):null};u.getInitialData=f;export{u as ProductDescription,u as default};
4
4
  //# sourceMappingURL=ProductDescription.js.map
@@ -1,4 +1,4 @@
1
- /*! Copyright 2025 Adobe
1
+ /*! Copyright 2026 Adobe
2
2
  All Rights Reserved. */
3
- import{jsx as e,jsxs as k,Fragment as Ft}from"@dropins/tools/preact-jsx-runtime.js";import{useState as J,Children as Lt,useEffect as et,useCallback as nt,useMemo as Jt}from"@dropins/tools/preact-compat.js";import{VComponent as u,classes as v,Slot as A,toLanguageTag as Et}from"@dropins/tools/lib.js";import{Incrementer as Zt,Image as Mt,Button as qt,Icon as st,Breadcrumbs as At}from"@dropins/tools/components.js";/* empty css */import{Z as Kt,C as rt,O as $t}from"../chunks/Zoom.js";import"@dropins/tools/preact-hooks.js";/* empty css */import{useText as L}from"@dropins/tools/i18n.js";import{P as Gt}from"../chunks/PriceRange.js";import{S as Wt}from"../chunks/Swatches.js";import"@dropins/tools/preact.js";import{G as Xt}from"../chunks/GiftCardOptions2.js";import{c as Tt,k as Yt,j as Pt,p as ft,l as Rt,t as gt}from"../chunks/fetchProductData.js";import{events as pt}from"@dropins/tools/event-bus.js";import{i as Ct,t as te}from"../chunks/date.js";import"../fragments.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/isProductConfigurationValid.js";const ee=({title:h,breadcrumbs:N,galleryContent:O,infoContent:I,productContent:D,sku:w,outOfStock:U,shortDescription:E,description:p,attributes:ct,images:c,options:a,giftCardOptions:s,price:f,specialPrice:H,className:dt,children:yt,quantity:M,actions:g,carouselConfig:n,zoomType:lt="overlay",closeButton:it=!0,...at})=>{var Z,G,_,K,R,C,tt,$,T;const x=L("PDP.Product.RegularPrice.label").label,ht=L("PDP.Product.SpecialPrice.label").label,ot=L("PDP.Product.OutOfStock.label").label,B=L("PDP.Product.Image.label").label,[t,q]=J(null),b=c!=null&&c.length?c.map((F,y)=>{var W;const j=((W=h==null?void 0:h.props)==null?void 0:W.children)&&(B==null?void 0:B.replace("{product}",h.props.children.toString()).replace("{key}",String(y+1)).replace("{total}",String(c.length)));return lt==="zoom"?e(Kt,{closeButton:it,children:e(u,{node:F,loading:y===0?"eager":"lazy",alt:j},y)}):e(u,{node:F,loading:y===0?"eager":"lazy",alt:j,onClick:()=>q(y)},y)}):e("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0}),Q=(Z=n==null?void 0:n.thumbnails)!=null&&Z.length?n.thumbnails.map((F,y)=>{var j;return e(u,{node:F,loading:(n==null?void 0:n.thumbnailsLoadingMode)||"lazy",alt:((j=h==null?void 0:h.props)==null?void 0:j.children)&&(B==null?void 0:B.replace("{product}",h.props.children.toString()).replace("{key}",String(y+1)).replace("{total}",String(c.length)))},y)}):e("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0});return k("div",{...at,className:v(["pdp-product",dt]),children:[N&&e(u,{node:N,className:"pdp-product__breadcrumbs"}),k("div",{className:"pdp-product__column-container pdp-product__gallery-column",children:[e("div",{className:"pdp-product__column-body",children:(G=n==null?void 0:n.controls)!=null&&G.desktop?e(rt,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?n.controls.desktop:"dots",arrowsOnMainImage:n==null?void 0:n.arrowsOnMainImage,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,peak:((_=n==null?void 0:n.thumbnails)==null?void 0:_.length)>1&&((K=n==null?void 0:n.peak)==null?void 0:K.desktop)||!1,gap:(n==null?void 0:n.gap)||null,width:"100%",height:"100%",defaultIndex:t||0,thumbnails:Q,children:b}):e(ne,{className:"pdp-product__images",gap:"small",children:b})}),O&&e(u,{node:O,className:"pdp-product__gallery-content"})]}),k("div",{className:"pdp-product__column-container pdp-product__content-column",children:[k("div",{className:"pdp-product__column-body",children:[k("div",{className:"pdp-product__header",children:[h&&e(u,{node:h,className:"pdp-product__title"}),w&&e(u,{node:w,className:"pdp-product__sku"})]}),k("div",{className:"pdp-product__prices",children:[H&&e(u,{node:H,className:v(["pdp-product__price-special","pdp-product__price"]),"aria-label":ht,role:"text"}),f&&e(u,{node:f,className:v(["pdp-product__price-regular","pdp-product__price--grey"]),"aria-label":x,role:"text"})]}),(R=n==null?void 0:n.controls)!=null&&R.mobile&&((C=n==null?void 0:n.controls)==null?void 0:C.mobile)==="thumbnailsRow"?e(rt,{className:"pdp-product__images pdp-product__images--carousel pdp-product__images--carousel--thumbnails",width:"100%",height:"auto",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"thumbnailsRow":null,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,peak:((tt=n==null?void 0:n.thumbnails)==null?void 0:tt.length)>1&&(($=n==null?void 0:n.peak)==null?void 0:$.mobile)||!1,gap:(n==null?void 0:n.gap)||null,thumbnails:Q,children:b}):e(rt,{className:"pdp-product__images pdp-product__images--carousel",peak:((T=n==null?void 0:n.peak)==null?void 0:T.mobile)&&(c==null?void 0:c.length)>1,gap:(n==null?void 0:n.gap)||null,width:"100%",height:"auto",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"dots":null,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,children:b}),k("div",{className:v(["pdp-product__actions",["pdp-product__actions--out-of-stock",U]]),children:[U&&e("div",{className:"pdp-product__out-of-stock__text",children:ot}),a&&e(u,{node:a,className:v(["pdp-product__options"])}),s&&e(u,{node:s,className:v(["pdp-product__gift-card-options"])}),M&&e("div",{className:"pdp-product__quantity",children:e(u,{node:M})}),g&&e(u,{node:g,className:v(["pdp-product__buttons"])})]}),E&&e(u,{node:E,className:v(["pdp-product__short_description"])}),p&&e(u,{node:p,className:v(["pdp-product__description"])}),ct?e("div",{className:"pdp-product__attributes",children:ct}):null]}),I&&e(u,{node:I,className:"pdp-product__info-content"})]}),D&&e(u,{node:D,className:"pdp-product__content"}),t===null?null:e($t,{className:"pdp-product__overlay",onClose:()=>q(null),centered:!0,children:e(rt,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,width:"100%",height:"100%",defaultIndex:t||0,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"dots":null,isZoomed:!0,children:b})})]})},ne=({children:h,gap:N=null,className:O,style:I,...D})=>{const w=Lt.count(h);return e("div",{...D,className:v(["pdp-gallery-grid",O]),style:{"--gap":N?`var(--spacing-${N})`:"0px",...I},children:Lt.map(h,(U,E)=>e("div",{className:"pdp-gallery-grid__item",children:e(u,{node:U,loading:E===0?"eager":"lazy"},U.props.src)},w+E))})},re=({sku:h,hideSku:N,hideQuantity:O,hideShortDescription:I,hideDescription:D,hideAttributes:w,hideURLParams:U,hideSelectedOptionValue:E,slots:p,children:ct,initialData:c,carousel:a,optionsConfig:s,useACDL:f,onAddToCart:H,zoomType:dt,closeButton:yt=!0,disableDropdownPreselection:M,...g})=>{var W,Ot,St,vt,Nt,It,Dt,wt,Vt,kt,Ut;const n=L("PDP.Product.AddToCart.label").label,lt=L("PDP.Product.Incrementer.label").label,it=L("PDP.Product.Details.label").label,at=L("PDP.Swatches.ChooseOption.label").label,[x,ht]=J(Tt.getConfig().defaultLocale||"en-US"),[ot,B]=J(),[t=null,q]=J(c),[b,Q]=J(()=>{const r=Yt(1),d={sku:h,quantity:r};return t!=null&&t.optionUIDs&&(d.optionsUIDs=t.optionUIDs),d}),[Z,G]=J(()=>{var r,d;return!(t!=null&&t.options&&((r=t==null?void 0:t.options)==null?void 0:r.length)>0&&((d=t==null?void 0:t.optionUIDs)==null?void 0:d.length)!==(t==null?void 0:t.options.length))}),_={data:t,values:b,valid:Z};function K(r){return r==null?void 0:r.some(d=>(d==null?void 0:d.typename)==="ProductViewOptionValueProduct")}et(()=>{const r=pt.on("pdp/data",l=>{l&&(q(l),Q(i=>({...i,sku:l.sku,optionsUIDs:l.optionUIDs})))}),d=pt.on("pdp/setValues",l=>{Q(i=>({...i,...l}))});return()=>{d==null||d.off(),r==null||r.off()}},[]),et(()=>{const r=pt.on("locale",d=>{d!==x&&(ht(d),Pt(h,{preselectFirstOption:!M,anchors:s==null?void 0:s.anchorOptions}).then(q))});return()=>{r==null||r.off()}},[M,x,s==null?void 0:s.anchorOptions,h]),et(()=>{f&&c&&Object.keys(c).length>0&&ft(c)},[c]);const R=nt(r=>{Q(d=>({...d,...r}))},[]);et(()=>{pt.emit("pdp/values",b)},[JSON.stringify(b)]);const C=nt(async r=>{var i,o;let d=Object.entries(r).filter(([m,P])=>P.label!==at).map(([m,P])=>r[m].value).filter(m=>m!==void 0);!U&&(t!=null&&t.options)&&!K(t.options)&&Rt({optionsUIDs:d.join(",")}),R({optionsUIDs:d}),G((d==null?void 0:d.length)===((i=t==null?void 0:t.options)==null?void 0:i.length));const l=await Pt(h,{anchors:s==null?void 0:s.anchorOptions,isBundle:t==null?void 0:t.isBundle,optionsUIDs:d,preselectFirstOption:!M});q(l),(o=s==null?void 0:s.anchorOptions)!=null&&o.length&&tt(l,d)},[h]),tt=nt((r,d)=>{var o;const l=(r==null?void 0:r.optionUIDs)??[];d.every(m=>l.includes(m))||(B(r==null?void 0:r.options),R({optionsUIDs:l}),G((l==null?void 0:l.length)===((o=r==null?void 0:r.options)==null?void 0:o.length)))},[h]),$=nt(r=>{Object.keys(r).length!==0&&G(!1)},[]),T=Jt(()=>{var r;return(r=t==null?void 0:t.attributes)==null?void 0:r.map(({label:d,value:l,id:i},o)=>{if(i==="ac_giftcard")return"";const m=Ct(l)?te(l,x):l.toString();return k("li",{children:[d,": ",e("span",{dangerouslySetInnerHTML:{__html:m}})]},o)})},[t==null?void 0:t.attributes,x]),F=!O&&(t!=null&&t.inStock)?e(A,{name:"Quantity",slot:p==null?void 0:p.Quantity,context:{..._},children:e(Zt,{name:"quantity",defaultValue:b.quantity.toString(),value:b.quantity.toString(),min:1,"aria-label":lt,className:"pdp-product__quantity",onValue:r=>{const d=Number(r);R({quantity:d}),!U&&(t!=null&&t.options)&&(K(t.options)||Rt({quantity:d}))}},"quantity")}):void 0,y=()=>{if(t!=null&&t.options)return e(A,{name:"Options",slot:p==null?void 0:p.Options,context:{..._},children:e(Wt,{selectedUIDs:b.optionsUIDs,options:t.options,defaultOptions:b.optionsUIDs,selectionsToUpdate:ot,hideSelectedValue:E,disablePreselections:M,onValues:C,onErrors:$})})},j=()=>{if(t!=null&&t.attributes){const r=t.attributes.filter(d=>d.id==="ac_giftcard");if(r.length>0){const l=r.map((i,o)=>{var m;try{const P=JSON.parse(i.value),mt=b.enteredOptions||[],jt=((m=P.options)==null?void 0:m.map(S=>{const z=mt.find(X=>X.uid===S.uid);return{id:S.uid,value:(z==null?void 0:z.value)||""}}))||[];return e(Xt,{options:P.options||[],optionValues:jt,onOptionChange:(S,z)=>{var xt;const X=b.enteredOptions||[],zt=X.findIndex(V=>V.uid===S);let ut;if(zt!==-1?ut=X.map(V=>V.uid===S?{...V,value:z}:V):ut=[...X,{uid:S,value:z}],R({enteredOptions:ut}),t){const V={...t},Ht=((xt=V.attributes)==null?void 0:xt.map(Y=>{var Bt;if(Y.id==="ac_giftcard")try{const _t=JSON.parse(Y.value),Qt=((Bt=_t.options)==null?void 0:Bt.map(bt=>bt.uid===S?{...bt,value:z}:bt))||[];return{...Y,value:JSON.stringify({..._t,options:Qt})}}catch{return Y}return Y}))||[];V.attributes=Ht,q(V)}},onValidationChange:S=>{S||$({giftCard:"Invalid gift card data"}),G(S)},className:"pdp-product__gift-card-options"},`giftcard-${o}`)}catch(P){return console.warn("Invalid gift card data format:",P),null}}).filter(i=>i!==null);return l.length>0?e("div",{className:"pdp-product__gift-card-options-container",children:l}):void 0}}};return e("div",{...g,children:e(ee,{title:e(A,{name:"Title",slot:p==null?void 0:p.Title,context:{..._},children:t==null?void 0:t.name}),sku:N?void 0:e(A,{name:"SKU",slot:p==null?void 0:p.SKU,context:{..._},children:t==null?void 0:t.sku}),options:y(),giftCardOptions:j(),breadcrumbs:(p==null?void 0:p.Breadcrumbs)&&e(A,{name:"Breadcrumbs",slot:p==null?void 0:p.Breadcrumbs,context:{..._,setSeparator(r){this._registerMethod((...d)=>{const l=r(...d),i=l&&e(st,{source:l});this._setProps(o=>({...o,separator:i,children:[e(At,{separator:i,categories:o.categories})]}))})},appendLink(r){this._registerMethod((...d)=>{const{text:l,...i}=r(...d),o=e("a",{...i,children:l});this._setProps(m=>{const P=[...m.categories||[],o];return{...m,categories:P,children:[e(At,{separator:m.separator,categories:P})]}})})},appendHTMLElement(r){this._registerMethod((...d)=>{const l=r(...d),i=this._htmlElementToVNode(l);this._setProps(o=>{const m=[...o.categories||[],i];return{...o,categories:m,children:[e(At,{separator:o.separator,categories:m})]}})})}}}),quantity:F,actions:e(A,{name:"Actions",slot:p==null?void 0:p.Actions,context:{..._,appendButton(r){this._registerMethod((...d)=>{const l=r(...d);if(!l)return;const{text:i,icon:o,...m}=l,P=e(qt,{type:"button",...m,icon:o&&e(st,{source:o}),children:i});this._setProps(mt=>({children:[...mt.children||[],P]}))})}},children:!(p!=null&&p.Actions)&&e(qt,{size:"medium",type:"submit",icon:e(st,{source:"Cart"}),disabled:!(t!=null&&t.inStock)||!Z,"aria-label":n,onClick:()=>H==null?void 0:H(b),children:n})}),shortDescription:I?void 0:e(A,{name:"ShortDescription",slot:p==null?void 0:p.ShortDescription,context:{..._},children:e("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.shortDescription)??""}})}),description:D?void 0:e(A,{name:"Description",slot:p==null?void 0:p.Description,context:{..._},children:e("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.description)??""}})}),images:((W=t==null?void 0:t.images)==null?void 0:W.map(({label:r,url:d})=>{var l,i;return e(Mt,{title:r,alt:r,src:d,width:((l=a==null?void 0:a.imageParams)==null?void 0:l.width)??960,height:((i=a==null?void 0:a.imageParams)==null?void 0:i.height)??1191,params:(a==null?void 0:a.imageParams)??{width:960}},d)}))??[],specialPrice:(Ot=t==null?void 0:t.prices)!=null&&Ot.visible?e(A,{name:"SpecialPrice",slot:p==null?void 0:p.SpecialPrice,context:{..._},children:e(Gt,{...(St=t.prices)==null?void 0:St.final,locale:Et(x)})}):void 0,price:(vt=t==null?void 0:t.prices)!=null&&vt.visible&&((Nt=t==null?void 0:t.prices)!=null&&Nt.regular)&&((Dt=(It=t==null?void 0:t.prices)==null?void 0:It.final)==null?void 0:Dt.amount)!==((Vt=(wt=t==null?void 0:t.prices)==null?void 0:wt.regular)==null?void 0:Vt.amount)?e(A,{name:"RegularPrice",slot:p==null?void 0:p.RegularPrice,context:{..._},children:e(Gt,{...(kt=t.prices)==null?void 0:kt.regular,locale:Et(x)})}):void 0,zoomType:dt,closeButton:yt,carouselConfig:{...a,thumbnails:a&&Object.keys(a).length?((Ut=t==null?void 0:t.images)==null?void 0:Ut.map(({label:r,url:d})=>{var l,i;return e(Mt,{title:r,alt:r,src:d,width:((l=a==null?void 0:a.thumbnailParams)==null?void 0:l.width)??200,height:((i=a==null?void 0:a.thumbnailParams)==null?void 0:i.height)??248,params:(a==null?void 0:a.thumbnailParams)??{width:200}},d)}))??[]:[]},outOfStock:!(t!=null&&t.inStock),attributes:w?void 0:e(A,{name:"Attributes",slot:p==null?void 0:p.Attributes,context:{..._},children:T!=null&&T.length?k(Ft,{children:[it,e("ul",{children:T})]}):null}),galleryContent:(p==null?void 0:p.GalleryContent)&&e(A,{name:"GalleryContent",slot:p.GalleryContent,context:{..._}}),infoContent:(p==null?void 0:p.InfoContent)&&e(A,{name:"InfoContent",slot:p.InfoContent,context:{..._}}),productContent:(p==null?void 0:p.Content)&&e(A,{name:"Content",slot:p.Content,context:{..._}})})})};re.getInitialData=async function({sku:h,disableDropdownPreselection:N=!1,optionsConfig:O}){var D,w;const I=(w=(D=Tt.getConfig().models)==null?void 0:D.ProductDetails)==null?void 0:w.initialData;return I?gt(I):Pt(h,{preselectFirstOption:!N,anchors:O==null?void 0:O.anchorOptions})};export{re as ProductDetails,re as default};
3
+ import{jsx as e,jsxs as B,Fragment as Jt}from"@dropins/tools/preact-jsx-runtime.js";import{useState as J,Children as qt,useEffect as dt,useCallback as ct,useMemo as Zt}from"@dropins/tools/preact-compat.js";import{VComponent as m,classes as N,Slot as P,toLanguageTag as Gt}from"@dropins/tools/lib.js";import{Incrementer as $t,Image as Rt,Button as Tt,Icon as yt,Breadcrumbs as Ot}from"@dropins/tools/components.js";/* empty css */import{Z as Kt,C as lt,O as Wt}from"../chunks/Zoom.js";import"@dropins/tools/preact-hooks.js";/* empty css *//* empty css */import{useText as G}from"@dropins/tools/i18n.js";import{P as jt}from"../chunks/PriceRange.js";import{S as Xt}from"../chunks/Swatches.js";import"@dropins/tools/preact.js";import{G as Yt}from"../chunks/GiftCardOptions2.js";import{D as ft}from"../chunks/DownloadableOptions2.js";import{c as Ht,k as gt,j as Nt,p as Ct,l as zt,t as te}from"../chunks/fetchProductData.js";import{events as it}from"@dropins/tools/event-bus.js";import{i as ee,t as ne}from"../chunks/date.js";import"../fragments.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getProductConfigurationValues.js";import"../chunks/isProductConfigurationValid.js";const re=({title:u,breadcrumbs:I,galleryContent:S,infoContent:w,productContent:V,sku:U,outOfStock:E,shortDescription:R,description:p,attributes:ot,images:c,options:o,giftCardOptions:s,downloadableOptions:C,price:Q,specialPrice:tt,className:at,children:Z,quantity:et,actions:$,carouselConfig:n,zoomType:ht="overlay",closeButton:ut=!0,...L})=>{var T,_,W,q,nt,rt,X,j,pt;const mt=G("PDP.Product.RegularPrice.label").label,_t=G("PDP.Product.SpecialPrice.label").label,st=G("PDP.Product.OutOfStock.label").label,t=G("PDP.Product.Image.label").label,[M,A]=J(null),k=c!=null&&c.length?c.map((F,O)=>{var Y;const z=((Y=u==null?void 0:u.props)==null?void 0:Y.children)&&(t==null?void 0:t.replace("{product}",u.props.children.toString()).replace("{key}",String(O+1)).replace("{total}",String(c.length)));return ht==="zoom"?e(Kt,{closeButton:ut,children:e(m,{node:F,loading:O===0?"eager":"lazy",alt:z},O)}):e(m,{node:F,loading:O===0?"eager":"lazy",alt:z,onClick:()=>A(O)},O)}):e("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0}),K=(T=n==null?void 0:n.thumbnails)!=null&&T.length?n.thumbnails.map((F,O)=>{var z;return e(m,{node:F,loading:(n==null?void 0:n.thumbnailsLoadingMode)||"lazy",alt:((z=u==null?void 0:u.props)==null?void 0:z.children)&&(t==null?void 0:t.replace("{product}",u.props.children.toString()).replace("{key}",String(O+1)).replace("{total}",String(c.length)))},O)}):e("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0});return B("div",{...L,className:N(["pdp-product",at]),children:[I&&e(m,{node:I,className:"pdp-product__breadcrumbs"}),B("div",{className:"pdp-product__column-container pdp-product__gallery-column",children:[e("div",{className:"pdp-product__column-body",children:(_=n==null?void 0:n.controls)!=null&&_.desktop?e(lt,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?n.controls.desktop:"dots",arrowsOnMainImage:n==null?void 0:n.arrowsOnMainImage,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,peak:((W=n==null?void 0:n.thumbnails)==null?void 0:W.length)>1&&((q=n==null?void 0:n.peak)==null?void 0:q.desktop)||!1,gap:(n==null?void 0:n.gap)||null,width:"100%",height:"100%",defaultIndex:M||0,thumbnails:K,children:k}):e(pe,{className:"pdp-product__images",gap:"small",children:k})}),S&&e(m,{node:S,className:"pdp-product__gallery-content"})]}),B("div",{className:"pdp-product__column-container pdp-product__content-column",children:[B("div",{className:"pdp-product__column-body",children:[B("div",{className:"pdp-product__header",children:[u&&e(m,{node:u,className:"pdp-product__title"}),U&&e(m,{node:U,className:"pdp-product__sku"})]}),B("div",{className:"pdp-product__prices",children:[tt&&e(m,{node:tt,className:N(["pdp-product__price-special","pdp-product__price"]),"aria-label":_t,role:"text"}),Q&&e(m,{node:Q,className:N(["pdp-product__price-regular","pdp-product__price--grey"]),"aria-label":mt,role:"text"})]}),(nt=n==null?void 0:n.controls)!=null&&nt.mobile&&((rt=n==null?void 0:n.controls)==null?void 0:rt.mobile)==="thumbnailsRow"?e(lt,{className:"pdp-product__images pdp-product__images--carousel pdp-product__images--carousel--thumbnails",width:"100%",height:"auto",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"thumbnailsRow":null,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,peak:((X=n==null?void 0:n.thumbnails)==null?void 0:X.length)>1&&((j=n==null?void 0:n.peak)==null?void 0:j.mobile)||!1,gap:(n==null?void 0:n.gap)||null,thumbnails:K,children:k}):e(lt,{className:"pdp-product__images pdp-product__images--carousel",peak:((pt=n==null?void 0:n.peak)==null?void 0:pt.mobile)&&(c==null?void 0:c.length)>1,gap:(n==null?void 0:n.gap)||null,width:"100%",height:"auto",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"dots":null,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,children:k}),B("div",{className:N(["pdp-product__actions",["pdp-product__actions--out-of-stock",E]]),children:[E&&e("div",{className:"pdp-product__out-of-stock__text",children:st}),o&&e(m,{node:o,className:N(["pdp-product__options"])}),s&&e(m,{node:s,className:N(["pdp-product__gift-card-options"])}),C&&e(m,{node:C,className:N(["pdp-product__downloadable-options"])}),et&&e("div",{className:"pdp-product__quantity",children:e(m,{node:et})}),$&&e(m,{node:$,className:N(["pdp-product__buttons"])})]}),R&&e(m,{node:R,className:N(["pdp-product__short_description"])}),p&&e(m,{node:p,className:N(["pdp-product__description"])}),ot?e("div",{className:"pdp-product__attributes",children:ot}):null]}),w&&e(m,{node:w,className:"pdp-product__info-content"})]}),V&&e(m,{node:V,className:"pdp-product__content"}),M===null?null:e(Wt,{className:"pdp-product__overlay",onClose:()=>A(null),centered:!0,children:e(lt,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,width:"100%",height:"100%",defaultIndex:M||0,loop:(n==null?void 0:n.loopable)&&(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"dots":null,isZoomed:!0,children:k})})]})},pe=({children:u,gap:I=null,className:S,style:w,...V})=>{const U=qt.count(u);return e("div",{...V,className:N(["pdp-gallery-grid",S]),style:{"--gap":I?`var(--spacing-${I})`:"0px",...w},children:qt.map(u,(E,R)=>e("div",{className:"pdp-gallery-grid__item",children:e(m,{node:E,loading:R===0?"eager":"lazy"},E.props.src)},U+R))})},de=({sku:u,hideSku:I,hideQuantity:S,hideShortDescription:w,hideDescription:V,hideAttributes:U,hideURLParams:E,hideSelectedOptionValue:R,slots:p,children:ot,initialData:c,carousel:o,optionsConfig:s,useACDL:C,onAddToCart:Q,zoomType:tt,closeButton:at=!0,disableDropdownPreselection:Z,...et})=>{var Y,St,Dt,It,wt,Vt,Ut,kt,xt,Bt,Et;const $=G("PDP.Product.AddToCart.label").label,n=G("PDP.Product.Incrementer.label").label,ht=G("PDP.Product.Details.label").label,ut=G("PDP.Swatches.ChooseOption.label").label,[L,mt]=J(Ht.getConfig().defaultLocale||"en-US"),[_t,st]=J(),[t=null,M]=J(c),[A,k]=J(()=>{const r=gt(1),d={sku:u,quantity:r};return t!=null&&t.optionUIDs&&(d.optionsUIDs=t.optionUIDs),d}),[K,T]=J(()=>{var r,d;return!(t!=null&&t.options&&((r=t==null?void 0:t.options)==null?void 0:r.length)>0&&((d=t==null?void 0:t.optionUIDs)==null?void 0:d.length)!==(t==null?void 0:t.options.length))}),_={data:t,values:A,valid:K};function W(r){return r==null?void 0:r.some(d=>(d==null?void 0:d.typename)==="ProductViewOptionValueProduct")}dt(()=>{const r=it.on("pdp/data",l=>{l&&(M(l),k(i=>({...i,sku:l.sku,optionsUIDs:l.optionUIDs})))}),d=it.on("pdp/setValues",l=>{k(i=>({...i,...l}))});return()=>{d==null||d.off(),r==null||r.off()}},[]),dt(()=>{const r=it.on("locale",d=>{d!==L&&(mt(d),Nt(u,{preselectFirstOption:!Z,anchors:s==null?void 0:s.anchorOptions}).then(M))});return()=>{r==null||r.off()}},[Z,L,s==null?void 0:s.anchorOptions,u]),dt(()=>{C&&c&&Object.keys(c).length>0&&Ct(c)},[c]);const q=ct(r=>{k(d=>({...d,...r}))},[]);dt(()=>{it.emit("pdp/values",A)},[JSON.stringify(A)]);const nt=ct(async r=>{var i,a;let d=Object.entries(r).filter(([h,b])=>b.label!==ut).map(([h,b])=>r[h].value).filter(h=>h!==void 0);!E&&(t!=null&&t.options)&&!W(t.options)&&zt({optionsUIDs:d.join(",")}),q({optionsUIDs:d}),T((d==null?void 0:d.length)===((i=t==null?void 0:t.options)==null?void 0:i.length));const l=await Nt(u,{anchors:s==null?void 0:s.anchorOptions,isBundle:t==null?void 0:t.isBundle,optionsUIDs:d,preselectFirstOption:!Z});M(l),(a=s==null?void 0:s.anchorOptions)!=null&&a.length&&rt(l,d)},[u]),rt=ct((r,d)=>{var a;const l=(r==null?void 0:r.optionUIDs)??[];d.every(h=>l.includes(h))||(st(r==null?void 0:r.options),q({optionsUIDs:l}),T((l==null?void 0:l.length)===((a=r==null?void 0:r.options)==null?void 0:a.length)))},[u]),X=ct(r=>{Object.keys(r).length!==0&&T(!1)},[]),j=Zt(()=>{var r;return(r=t==null?void 0:t.attributes)==null?void 0:r.map(({label:d,value:l,id:i},a)=>{if(i==="ac_giftcard")return"";const h=ee(l)?ne(l,L):l.toString();return B("li",{children:[d,": ",e("span",{dangerouslySetInnerHTML:{__html:h}})]},a)})},[t==null?void 0:t.attributes,L]),pt=!S&&(t!=null&&t.inStock)?e(P,{name:"Quantity",slot:p==null?void 0:p.Quantity,context:{..._},children:e($t,{name:"quantity",defaultValue:A.quantity.toString(),value:A.quantity.toString(),min:1,"aria-label":n,className:"pdp-product__quantity",onValue:r=>{const d=Number(r);q({quantity:d}),!E&&(t!=null&&t.options)&&(W(t.options)||zt({quantity:d}))}},"quantity")}):void 0,F=()=>{if(t!=null&&t.options)return e(P,{name:"Options",slot:p==null?void 0:p.Options,context:{..._},children:e(Xt,{selectedUIDs:A.optionsUIDs,options:t.options,defaultOptions:A.optionsUIDs,selectionsToUpdate:_t,hideSelectedValue:R,disablePreselections:Z,onValues:nt,onErrors:X})})},O=()=>{if(t!=null&&t.attributes){const r=t.attributes.filter(d=>d.id==="ac_giftcard");if(r.length>0){const l=r.map((i,a)=>{var h;try{const b=JSON.parse(i.value),H=A.enteredOptions||[],f=((h=b.options)==null?void 0:h.map(v=>{const y=H.find(D=>D.uid===v.uid);return{id:v.uid,value:(y==null?void 0:y.value)||""}}))||[];return e(Yt,{options:b.options||[],optionValues:f,onOptionChange:(v,y)=>{var Lt;const D=A.enteredOptions||[],bt=D.findIndex(x=>x.uid===v);let At;if(bt!==-1?At=D.map(x=>x.uid===v?{...x,value:y}:x):At=[...D,{uid:v,value:y}],q({enteredOptions:At}),t){const x={...t},Qt=((Lt=x.attributes)==null?void 0:Lt.map(g=>{var Mt;if(g.id==="ac_giftcard")try{const Pt=JSON.parse(g.value),Ft=((Mt=Pt.options)==null?void 0:Mt.map(vt=>vt.uid===v?{...vt,value:y}:vt))||[];return{...g,value:JSON.stringify({...Pt,options:Ft})}}catch{return g}return g}))||[];x.attributes=Qt,M(x)}},onValidationChange:v=>{v||X({giftCard:"Invalid gift card data"}),T(v)},className:"pdp-product__gift-card-options"},`giftcard-${a}`)}catch(b){return console.warn("Invalid gift card data format:",b),null}}).filter(i=>i!==null);return l.length>0?e("div",{className:"pdp-product__gift-card-options-container",children:l}):void 0}}},z=()=>{if(t!=null&&t.attributes){const r=t.attributes.filter(d=>{var l;return d.id==="ac_downloadable"&&((l=d.roles)==null?void 0:l.includes("visible_in_pdp"))});if(r.length>0){const l=r.map((i,a)=>{var h,b;try{const H=typeof i.value=="string"?JSON.parse(i.value):i.value;return e(ft,{label:i.label,value:H,onLinkChange:(f,v)=>{const y=A.optionsUIDs||[];let D;v?y.includes(f)?D=y:D=[...y,f]:D=y.filter(bt=>bt!==f),q({optionsUIDs:D})},currency:(b=(h=t.prices)==null?void 0:h.final)==null?void 0:b.currency,className:"pdp-product__downloadable-options"},`downloadable-${a}`)}catch(H){return console.warn("Invalid downloadable data format:",H),null}}).filter(i=>i!==null);return l.length>0?e("div",{className:"pdp-product__downloadable-options-container",children:l}):void 0}}};return e("div",{...et,children:e(re,{title:e(P,{name:"Title",slot:p==null?void 0:p.Title,context:{..._},children:t==null?void 0:t.name}),sku:I?void 0:e(P,{name:"SKU",slot:p==null?void 0:p.SKU,context:{..._},children:t==null?void 0:t.sku}),options:F(),giftCardOptions:O(),downloadableOptions:z(),breadcrumbs:(p==null?void 0:p.Breadcrumbs)&&e(P,{name:"Breadcrumbs",slot:p==null?void 0:p.Breadcrumbs,context:{..._,setSeparator(r){this._registerMethod((...d)=>{const l=r(...d),i=l&&e(yt,{source:l});this._setProps(a=>({...a,separator:i,children:[e(Ot,{separator:i,categories:a.categories})]}))})},appendLink(r){this._registerMethod((...d)=>{const{text:l,...i}=r(...d),a=e("a",{...i,children:l});this._setProps(h=>{const b=[...h.categories||[],a];return{...h,categories:b,children:[e(Ot,{separator:h.separator,categories:b})]}})})},appendHTMLElement(r){this._registerMethod((...d)=>{const l=r(...d),i=this._htmlElementToVNode(l);this._setProps(a=>{const h=[...a.categories||[],i];return{...a,categories:h,children:[e(Ot,{separator:a.separator,categories:h})]}})})}}}),quantity:pt,actions:e(P,{name:"Actions",slot:p==null?void 0:p.Actions,context:{..._,appendButton(r){this._registerMethod((...d)=>{const l=r(...d);if(!l)return;const{text:i,icon:a,...h}=l,b=e(Tt,{type:"button",...h,icon:a&&e(yt,{source:a}),children:i});this._setProps(H=>({children:[...H.children||[],b]}))})}},children:!(p!=null&&p.Actions)&&e(Tt,{size:"medium",type:"submit",icon:e(yt,{source:"Cart"}),disabled:!(t!=null&&t.inStock)||!K,"aria-label":$,onClick:()=>Q==null?void 0:Q(A),children:$})}),shortDescription:w?void 0:e(P,{name:"ShortDescription",slot:p==null?void 0:p.ShortDescription,context:{..._},children:e("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.shortDescription)??""}})}),description:V?void 0:e(P,{name:"Description",slot:p==null?void 0:p.Description,context:{..._},children:e("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.description)??""}})}),images:((Y=t==null?void 0:t.images)==null?void 0:Y.map(({label:r,url:d})=>{var l,i;return e(Rt,{title:r,alt:r,src:d,width:((l=o==null?void 0:o.imageParams)==null?void 0:l.width)??960,height:((i=o==null?void 0:o.imageParams)==null?void 0:i.height)??1191,params:(o==null?void 0:o.imageParams)??{width:960}},d)}))??[],specialPrice:(St=t==null?void 0:t.prices)!=null&&St.visible?e(P,{name:"SpecialPrice",slot:p==null?void 0:p.SpecialPrice,context:{..._},children:e(jt,{...(Dt=t.prices)==null?void 0:Dt.final,locale:Gt(L)})}):void 0,price:(It=t==null?void 0:t.prices)!=null&&It.visible&&((wt=t==null?void 0:t.prices)!=null&&wt.regular)&&((Ut=(Vt=t==null?void 0:t.prices)==null?void 0:Vt.final)==null?void 0:Ut.amount)!==((xt=(kt=t==null?void 0:t.prices)==null?void 0:kt.regular)==null?void 0:xt.amount)?e(P,{name:"RegularPrice",slot:p==null?void 0:p.RegularPrice,context:{..._},children:e(jt,{...(Bt=t.prices)==null?void 0:Bt.regular,locale:Gt(L)})}):void 0,zoomType:tt,closeButton:at,carouselConfig:{...o,thumbnails:o&&Object.keys(o).length?((Et=t==null?void 0:t.images)==null?void 0:Et.map(({label:r,url:d})=>{var l,i;return e(Rt,{title:r,alt:r,src:d,width:((l=o==null?void 0:o.thumbnailParams)==null?void 0:l.width)??200,height:((i=o==null?void 0:o.thumbnailParams)==null?void 0:i.height)??248,params:(o==null?void 0:o.thumbnailParams)??{width:200}},d)}))??[]:[]},outOfStock:!(t!=null&&t.inStock),attributes:U?void 0:e(P,{name:"Attributes",slot:p==null?void 0:p.Attributes,context:{..._},children:j!=null&&j.length?B(Jt,{children:[ht,e("ul",{children:j})]}):null}),galleryContent:(p==null?void 0:p.GalleryContent)&&e(P,{name:"GalleryContent",slot:p.GalleryContent,context:{..._}}),infoContent:(p==null?void 0:p.InfoContent)&&e(P,{name:"InfoContent",slot:p.InfoContent,context:{..._}}),productContent:(p==null?void 0:p.Content)&&e(P,{name:"Content",slot:p.Content,context:{..._}})})})};de.getInitialData=async function({sku:u,disableDropdownPreselection:I=!1,optionsConfig:S}){var V,U;const w=(U=(V=Ht.getConfig().models)==null?void 0:V.ProductDetails)==null?void 0:U.initialData;return w?te(w):Nt(u,{preselectFirstOption:!I,anchors:S==null?void 0:S.anchorOptions})};export{de as ProductDetails,de as default};
4
4
  //# sourceMappingURL=ProductDetails.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProductDetails.js","sources":["/@dropins/storefront-pdp/src/components/Product/Product.tsx","/@dropins/storefront-pdp/src/components/GalleryGrid/GalleryGrid.tsx","/@dropins/storefront-pdp/src/containers/ProductDetails/ProductDetails.tsx"],"sourcesContent":["/**\n * ADOBE CONFIDENTIAL\n * __________________\n * Copyright 2023 Adobe\n * All Rights Reserved.\n * __________________\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n */\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes, useState } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nimport { Carousel, GalleryGrid, Overlay, Zoom } from '@/pdp/components';\nimport '@/pdp/components/Product/Product.css';\n\nimport { CarouselConfig } from '@/pdp/containers';\n\ninterface ProductCarouselConfig extends CarouselConfig {\n thumbnails: VNode[];\n}\n\nexport interface ProductProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n title?: VNode;\n breadcrumbs?: VNode;\n galleryContent?: VNode;\n infoContent?: VNode;\n productContent?: VNode;\n shortDescription?: VNode;\n description?: VNode;\n attributes?: VNode;\n images: VNode[];\n options?: VNode;\n giftCardOptions?: VNode;\n sku?: VNode;\n price?: VNode;\n specialPrice?: VNode;\n outOfStock: boolean;\n actions?: VNode;\n quantity?: VNode;\n carouselConfig?: ProductCarouselConfig;\n zoomType?: 'zoom' | 'overlay';\n closeButton?: boolean;\n}\n\nexport const Product: FunctionComponent<ProductProps> = ({\n title,\n breadcrumbs,\n galleryContent,\n infoContent,\n productContent,\n sku,\n outOfStock,\n shortDescription,\n description,\n attributes,\n images,\n options,\n giftCardOptions,\n price,\n specialPrice,\n className,\n children,\n quantity,\n actions,\n carouselConfig,\n zoomType = 'overlay',\n closeButton = true,\n ...props\n}) => {\n // i18n\n const RegularPriceLabel = useText('PDP.Product.RegularPrice.label').label;\n const SpecialPriceLabel = useText('PDP.Product.SpecialPrice.label').label;\n const OutOfStockLabel = useText('PDP.Product.OutOfStock.label').label;\n const ImagesLabel = useText('PDP.Product.Image.label').label;\n\n const [zoom, setZoom] = useState<number | null>(null);\n\n const galleryImages = images?.length ? (\n images.map((image, key) => {\n const alt =\n title?.props?.children &&\n ImagesLabel?.replace('{product}', title.props.children.toString())\n .replace('{key}', String(key + 1))\n .replace('{total}', String(images.length));\n return zoomType === 'zoom' ? (\n <Zoom closeButton={closeButton}>\n <VComponent\n key={key}\n node={image}\n loading={key === 0 ? 'eager' : 'lazy'}\n alt={alt}\n />\n </Zoom>\n ) : (\n <VComponent\n key={key}\n node={image}\n loading={key === 0 ? 'eager' : 'lazy'}\n alt={alt}\n onClick={() => setZoom(key)}\n />\n );\n })\n ) : (\n <img\n src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"\n className=\"pdp-product__images__placeholder\"\n aria-hidden\n />\n );\n\n const localThumbnailsImages = carouselConfig?.thumbnails?.length ? (\n carouselConfig.thumbnails.map((image, key) => (\n <VComponent\n key={key}\n node={image}\n loading={carouselConfig?.thumbnailsLoadingMode || 'lazy'}\n alt={\n title?.props?.children &&\n ImagesLabel?.replace('{product}', title.props.children.toString())\n .replace('{key}', String(key + 1))\n .replace('{total}', String(images.length))\n }\n />\n ))\n ) : (\n <img\n src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"\n className=\"pdp-product__images__placeholder\"\n aria-hidden\n />\n );\n\n return (\n <div {...props} className={classes(['pdp-product', className])}>\n {breadcrumbs && (\n <VComponent node={breadcrumbs} className=\"pdp-product__breadcrumbs\" />\n )}\n <div className=\"pdp-product__column-container pdp-product__gallery-column\">\n <div className=\"pdp-product__column-body\">\n {carouselConfig?.controls?.desktop ? (\n <Carousel\n className=\"pdp-product__overlay__carousel\"\n arrows={images?.length > 1}\n controls={\n images?.length > 1 ? carouselConfig.controls.desktop : 'dots'\n }\n arrowsOnMainImage={carouselConfig?.arrowsOnMainImage}\n loop={carouselConfig?.loopable && images?.length > 1}\n peak={\n (carouselConfig?.thumbnails?.length > 1 &&\n carouselConfig?.peak?.desktop) ||\n false\n }\n gap={carouselConfig?.gap || null}\n width=\"100%\"\n height=\"100%\"\n defaultIndex={zoom || 0}\n thumbnails={localThumbnailsImages}\n >\n {galleryImages}\n </Carousel>\n ) : (\n <GalleryGrid className=\"pdp-product__images\" gap=\"small\">\n {galleryImages}\n </GalleryGrid>\n )}\n </div>\n {galleryContent && (\n <VComponent\n node={galleryContent}\n className=\"pdp-product__gallery-content\"\n />\n )}\n </div>\n\n <div className=\"pdp-product__column-container pdp-product__content-column\">\n <div className=\"pdp-product__column-body\">\n <div className=\"pdp-product__header\">\n {title && (\n <VComponent node={title} className=\"pdp-product__title\" />\n )}\n\n {sku && <VComponent node={sku} className=\"pdp-product__sku\" />}\n </div>\n\n <div className=\"pdp-product__prices\">\n {specialPrice && (\n <VComponent\n node={specialPrice}\n className={classes([\n 'pdp-product__price-special',\n 'pdp-product__price',\n ])}\n aria-label={SpecialPriceLabel}\n role=\"text\"\n />\n )}\n {price && (\n <VComponent\n node={price}\n className={classes([\n 'pdp-product__price-regular',\n 'pdp-product__price--grey',\n ])}\n aria-label={RegularPriceLabel}\n role=\"text\"\n />\n )}\n </div>\n\n {/* Small Screen Gallery */}\n {carouselConfig?.controls?.mobile &&\n carouselConfig?.controls?.mobile === 'thumbnailsRow' ? (\n <Carousel\n className=\"pdp-product__images pdp-product__images--carousel pdp-product__images--carousel--thumbnails\"\n width=\"100%\"\n height=\"auto\"\n arrows={images?.length > 1}\n controls={images?.length > 1 ? 'thumbnailsRow' : null}\n loop={carouselConfig?.loopable && images?.length > 1}\n peak={\n (carouselConfig?.thumbnails?.length > 1 &&\n carouselConfig?.peak?.mobile) ||\n false\n }\n gap={carouselConfig?.gap || null}\n thumbnails={localThumbnailsImages}\n >\n {galleryImages}\n </Carousel>\n ) : (\n <Carousel\n className=\"pdp-product__images pdp-product__images--carousel\"\n peak={carouselConfig?.peak?.mobile && images?.length > 1}\n gap={carouselConfig?.gap || null}\n width=\"100%\"\n height=\"auto\"\n arrows={images?.length > 1}\n controls={images?.length > 1 ? 'dots' : null}\n loop={carouselConfig?.loopable && images?.length > 1}\n >\n {galleryImages}\n </Carousel>\n )}\n\n <div\n className={classes([\n 'pdp-product__actions',\n [`pdp-product__actions--out-of-stock`, outOfStock],\n ])}\n >\n {outOfStock && (\n <div className=\"pdp-product__out-of-stock__text\">\n {OutOfStockLabel}\n </div>\n )}\n\n {options && (\n <VComponent\n node={options}\n className={classes(['pdp-product__options'])}\n />\n )}\n\n {giftCardOptions && (\n <VComponent\n node={giftCardOptions}\n className={classes(['pdp-product__gift-card-options'])}\n />\n )}\n\n {quantity && (\n <div className=\"pdp-product__quantity\">\n <VComponent node={quantity} />\n </div>\n )}\n\n {actions && (\n <VComponent\n node={actions}\n className={classes(['pdp-product__buttons'])}\n />\n )}\n </div>\n\n {shortDescription && (\n <VComponent\n node={shortDescription}\n className={classes(['pdp-product__short_description'])}\n />\n )}\n\n {description && (\n <VComponent\n node={description}\n className={classes(['pdp-product__description'])}\n />\n )}\n\n {attributes ? (\n <div className=\"pdp-product__attributes\">{attributes}</div>\n ) : null}\n </div>\n {infoContent && (\n <VComponent\n node={infoContent}\n className=\"pdp-product__info-content\"\n />\n )}\n </div>\n\n {productContent && (\n <VComponent node={productContent} className=\"pdp-product__content\" />\n )}\n\n {/* Zoom Overlay */}\n {zoom === null ? null : (\n <Overlay\n className=\"pdp-product__overlay\"\n onClose={() => setZoom(null)}\n centered\n >\n <Carousel\n className=\"pdp-product__overlay__carousel\"\n arrows={images?.length > 1}\n width=\"100%\"\n height=\"100%\"\n defaultIndex={zoom || 0}\n loop={carouselConfig?.loopable && images?.length > 1}\n controls={images?.length > 1 ? 'dots' : null}\n isZoomed\n >\n {galleryImages}\n </Carousel>\n </Overlay>\n )}\n </div>\n );\n};\n","/**\n * ADOBE CONFIDENTIAL\n * __________________\n * Copyright 2023 Adobe\n * All Rights Reserved.\n * __________________\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n */\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes, Children } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/pdp/components/GalleryGrid/GalleryGrid.css';\n\nexport interface GalleryGridProps extends HTMLAttributes<HTMLDivElement> {\n children: VNode[] | VNode;\n gap?: 'small' | 'medium' | 'large' | null;\n style?: Record<string, string | number>;\n}\n\nexport const GalleryGrid: FunctionComponent<GalleryGridProps> = ({\n children,\n gap = null,\n className,\n style,\n ...props\n}) => {\n const count = Children.count(children);\n\n return (\n <div\n {...props}\n className={classes(['pdp-gallery-grid', className])}\n style={{\n '--gap': gap ? `var(--spacing-${gap})` : '0px',\n ...style,\n }}\n >\n {Children.map(\n children,\n (child: VNode<HTMLAttributes<HTMLElement>>, key) => (\n <div key={count + key} className=\"pdp-gallery-grid__item\">\n <VComponent\n key={child.props.src}\n node={child}\n loading={key === 0 ? 'eager' : 'lazy'}\n />\n </div>\n )\n )}\n </div>\n );\n};\n","/**\n * ADOBE CONFIDENTIAL\n * __________________\n * Copyright 2023 Adobe\n * All Rights Reserved.\n * __________________\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n */\n\nimport {\n HTMLAttributes,\n useEffect,\n useState,\n useCallback,\n useMemo,\n} from 'preact/compat';\n\nimport {\n Container,\n toLanguageTag,\n SlotProps,\n SlotMethod,\n Slot,\n ResolveImageUrlOptions,\n} from '@adobe-commerce/elsie/lib';\n\nimport {\n Button,\n Icon,\n ButtonProps,\n Image,\n Incrementer,\n Breadcrumbs,\n} from '@adobe-commerce/elsie/components';\nimport {\n Product,\n Swatches,\n PriceRange,\n Option,\n GiftCardOptions,\n} from '@/pdp/components';\nimport { config, fetchProductData } from '@/pdp/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { Lang, useText } from '@adobe-commerce/elsie/i18n';\nimport { isDateValid, toDateString } from '@/pdp/lib/date';\nimport {\n setUrlParams,\n getValidatedQuantityFromUrl,\n} from '@/pdp/lib/url-params';\nimport { publishProductPageViewEvent } from '@/pdp/lib/acdl';\nimport { ProductModel, Option as ProductOption } from '@/pdp/data/models';\nimport { transformProductData } from '@/pdp/data/transforms/product-transform';\n\ntype IconType = keyof typeof import('@adobe-commerce/elsie/icons');\n\n/** @deprecated This type is part of the deprecated ProductDetails component. */\nexport type Values = {\n sku: string;\n quantity: number;\n optionsUIDs?: string[];\n enteredOptions?: Array<{ uid: string; value: string }>;\n};\n\n/** @deprecated This type is part of the deprecated ProductDetails component. */\ntype DefaultSlotContext = {\n data: ProductModel | null;\n values: Values;\n valid: boolean;\n};\n\n/** @deprecated This type is part of the deprecated ProductDetails component. */\nexport type CarouselConfig = {\n controls?: {\n desktop?: 'thumbnailsRow' | 'thumbnailsColumn' | 'dots' | null;\n mobile?: 'dots' | 'thumbnailsRow' | null;\n };\n arrowsOnMainImage?: boolean;\n loopable?: boolean;\n peak?: {\n desktop: boolean;\n mobile: boolean;\n };\n gap?: 'small' | 'medium' | 'large' | null;\n thumbnailsLoadingMode?: 'lazy' | 'eager';\n imageParams?: ResolveImageUrlOptions;\n thumbnailParams?: ResolveImageUrlOptions;\n};\n\n/** @deprecated This type is part of the deprecated ProductDetails component. */\nexport type OptionsConfig = {\n anchorOptions?: string[];\n};\n\n/** @deprecated This interface is part of the deprecated ProductDetails component. */\nexport interface ProductDetailsProps extends HTMLAttributes<HTMLDivElement> {\n sku: string;\n productData?: ProductModel;\n hideSku?: boolean;\n hideQuantity?: boolean;\n hideShortDescription?: boolean;\n hideDescription?: boolean;\n hideAttributes?: boolean;\n hideSelectedOptionValue?: boolean;\n hideURLParams?: boolean;\n slots?: {\n Title?: SlotProps<DefaultSlotContext>;\n\n SKU?: SlotProps<DefaultSlotContext>;\n\n RegularPrice?: SlotProps<DefaultSlotContext>;\n\n SpecialPrice?: SlotProps<DefaultSlotContext>;\n\n Options?: SlotProps<DefaultSlotContext>;\n\n Quantity?: SlotProps<DefaultSlotContext>;\n\n Actions?: SlotProps<\n DefaultSlotContext & {\n appendButton: SlotMethod<\n Omit<ButtonProps, 'icon'> & {\n text?: string;\n icon?: IconType;\n }\n >;\n }\n >;\n\n ShortDescription?: SlotProps<DefaultSlotContext>;\n\n Description?: SlotProps<DefaultSlotContext>;\n\n Attributes?: SlotProps<DefaultSlotContext>;\n\n Breadcrumbs?: SlotProps<\n DefaultSlotContext & {\n setSeparator: SlotMethod<IconType>;\n\n appendLink: SlotMethod<\n HTMLAttributes<HTMLAnchorElement> & { text?: string }\n >;\n\n appendHTMLElement: SlotMethod<HTMLElement>;\n }\n >;\n\n GalleryContent?: SlotProps<DefaultSlotContext>;\n\n InfoContent?: SlotProps<DefaultSlotContext>;\n\n Content?: SlotProps<DefaultSlotContext>;\n };\n carousel?: CarouselConfig;\n optionsConfig?: OptionsConfig;\n useACDL?: boolean;\n onAddToCart?: (values: Values) => void;\n zoomType?: 'zoom' | 'overlay';\n closeButton?: boolean;\n disableDropdownPreselection?: boolean;\n}\n\n/**\n * @deprecated This container has been deprecated and will be removed in a future release.\n * Please use the different composable containers to build your product details page.xs\n */\nexport const ProductDetails: Container<\n ProductDetailsProps,\n ProductModel | null\n> = ({\n sku,\n hideSku,\n hideQuantity,\n hideShortDescription,\n hideDescription,\n hideAttributes,\n hideURLParams,\n hideSelectedOptionValue,\n slots,\n children,\n initialData,\n carousel,\n optionsConfig,\n useACDL,\n onAddToCart,\n zoomType,\n closeButton = true,\n disableDropdownPreselection,\n ...props\n}) => {\n // i18n\n const AddToCartLabel = useText('PDP.Product.AddToCart.label').label;\n const IncrementerLabel = useText('PDP.Product.Incrementer.label').label;\n const DetailsLabel = useText('PDP.Product.Details.label').label;\n const ChooseOptionLabel = useText('PDP.Swatches.ChooseOption.label').label;\n\n // TODO: Investigate if the \"|| 'en-US' \" is really necessary\n const [locale, setLocale] = useState<Lang>(\n (config.getConfig().defaultLocale as Lang) || 'en-US'\n );\n\n const [selectionsToUpdate, setSelectionsToUpdate] = useState<Option[]>();\n\n const [data = null, setData] = useState(initialData);\n\n const [values, setValues] = useState<Values>(() => {\n const initialQuantity = getValidatedQuantityFromUrl(1); // Default quantity to 1\n\n const defaultValues: Values = {\n sku,\n quantity: initialQuantity,\n };\n\n if (data?.optionUIDs) {\n defaultValues.optionsUIDs = data.optionUIDs;\n }\n return defaultValues;\n });\n\n // the context is invalid for a configurable product that doesn't have all the options selected\n const [valid, setValid] = useState(() => {\n return !(\n data?.options &&\n data?.options?.length > 0 &&\n data?.optionUIDs?.length !== data?.options.length\n );\n });\n const defaultSlotContext: DefaultSlotContext = { data, values, valid };\n\n function hasProductViewOptionValueProduct(options: ProductOption[]) {\n return options?.some(\n (option) => option?.typename === 'ProductViewOptionValueProduct'\n );\n }\n\n useEffect(() => {\n const dataEvent = events.on('pdp/data', (payload) => {\n if (payload) {\n setData(payload);\n // Preserve the current quantity value when updating from pdp/data event\n setValues((prev: Values) => ({\n ...prev,\n sku: payload.sku,\n optionsUIDs: payload.optionUIDs,\n }));\n }\n });\n\n // @ts-ignore - Type error with event bus events\n const updateDataEvent = events.on(\n 'pdp/setValues',\n (payload: Partial<Values>) => {\n setValues((prev: Values) => ({ ...prev, ...payload }));\n }\n );\n\n return () => {\n updateDataEvent?.off();\n dataEvent?.off();\n };\n }, []);\n\n // Locale\n useEffect(() => {\n const localeEvent = events.on('locale', (payload: string) => {\n if (payload === locale) return;\n\n setLocale(payload as Lang);\n\n fetchProductData(sku, {\n preselectFirstOption: !disableDropdownPreselection,\n anchors: optionsConfig?.anchorOptions,\n }).then(setData);\n });\n return () => {\n localeEvent?.off();\n };\n }, [disableDropdownPreselection, locale, optionsConfig?.anchorOptions, sku]);\n\n useEffect(() => {\n if (useACDL && initialData && Object.keys(initialData).length > 0) {\n publishProductPageViewEvent(initialData);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [initialData]);\n\n // Callbacks\n const handleOnValues = useCallback((newValues: Partial<Values>) => {\n setValues((prev) => ({ ...prev, ...newValues }));\n }, []);\n\n useEffect(() => {\n events.emit('pdp/values', values);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(values)]);\n\n const handleOptionSelected = useCallback(\n async (selections: { [id: string]: { label: string; value: string } }) => {\n // options Selected\n let optionsUIDs = Object.entries(selections)\n .filter(([_, value]) => value.label !== ChooseOptionLabel) // eslint-disable-line no-unused-vars\n .map(([id, _]) => selections[id].value) // eslint-disable-line no-unused-vars\n .filter((element) => element !== undefined);\n\n // set optionUIDs to URL params\n // ?optionsUIDs=1,2,3\n // only set the URL params if the hideURLParams is not set to true and the product is not a bundle type\n if (\n !hideURLParams &&\n data?.options &&\n !hasProductViewOptionValueProduct(data.options)\n ) {\n setUrlParams({ optionsUIDs: optionsUIDs.join(',') });\n }\n\n // update state\n handleOnValues({ optionsUIDs });\n setValid(optionsUIDs?.length === data?.options?.length);\n\n // get refined product data and update state\n const next = await fetchProductData(sku, {\n anchors: optionsConfig?.anchorOptions,\n isBundle: data?.isBundle,\n optionsUIDs,\n preselectFirstOption: !disableDropdownPreselection,\n });\n\n setData(next);\n\n // special processing for anchor options (options that should not be refined when other options are selected)\n if (optionsConfig?.anchorOptions?.length) {\n processUpdates(next, optionsUIDs);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [sku]\n );\n\n const processUpdates = useCallback(\n (next: ProductModel | null, previousOptionsUIDs: string[]) => {\n const updatedOptionsUIDs = next?.optionUIDs ?? [];\n const haveSameValues = previousOptionsUIDs.every((item) =>\n updatedOptionsUIDs.includes(item)\n );\n if (!haveSameValues) {\n setSelectionsToUpdate(next?.options);\n handleOnValues({ optionsUIDs: updatedOptionsUIDs });\n setValid(updatedOptionsUIDs?.length === next?.options?.length);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [sku]\n );\n\n const handleOnErrors = useCallback((_errors: { [id: string]: string }) => {\n if (Object.keys(_errors).length !== 0) setValid(false);\n }, []);\n\n // Product Attributes\n const attributes = useMemo(() => {\n return data?.attributes?.map(({ label, value, id }, key: number) => {\n // Return empty string for gift card attributes\n if (id === 'ac_giftcard') {\n return '';\n }\n\n const __html = isDateValid(value)\n ? toDateString(value, locale)\n : value.toString();\n\n return (\n <li key={key}>\n {/* eslint-disable-next-line react/no-danger */}\n {label}: <span dangerouslySetInnerHTML={{ __html }} />\n </li>\n );\n });\n }, [data?.attributes, locale]);\n\n const quantity =\n !hideQuantity && data?.inStock ? (\n <Slot\n name=\"Quantity\"\n slot={slots?.Quantity}\n context={{ ...defaultSlotContext }}\n >\n <Incrementer\n key=\"quantity\"\n name=\"quantity\"\n defaultValue={values.quantity.toString()}\n value={values.quantity.toString()}\n min={1}\n aria-label={IncrementerLabel}\n className=\"pdp-product__quantity\"\n onValue={(quantity) => {\n const quantityValue = Number(quantity);\n handleOnValues({ quantity: quantityValue });\n\n // Add quantity to URL parameters if not set to hide\n if (!hideURLParams && data?.options) {\n // Only update URL if the product is not a bundle type\n if (!hasProductViewOptionValueProduct(data.options)) {\n setUrlParams({ quantity: quantityValue });\n }\n }\n }}\n />\n </Slot>\n ) : undefined;\n\n const renderOptions = () => {\n if (data?.options) {\n return (\n <Slot\n name=\"Options\"\n slot={slots?.Options}\n context={{ ...defaultSlotContext }}\n >\n <Swatches\n selectedUIDs={values.optionsUIDs}\n options={data.options}\n defaultOptions={values.optionsUIDs}\n selectionsToUpdate={selectionsToUpdate}\n hideSelectedValue={hideSelectedOptionValue}\n disablePreselections={disableDropdownPreselection}\n onValues={handleOptionSelected}\n onErrors={handleOnErrors}\n />\n </Slot>\n );\n }\n };\n\n const renderGiftCardOptions = () => {\n if (data?.attributes) {\n const giftCardAttributes = data.attributes.filter(\n (attr) => attr.id === 'ac_giftcard'\n );\n\n if (giftCardAttributes.length > 0) {\n const giftCardElements = giftCardAttributes.map(\n (giftCardAttr, index) => {\n try {\n const giftCardData = JSON.parse(giftCardAttr.value);\n const prevOptions = values.enteredOptions || [];\n const optionValues =\n giftCardData.options?.map((option: any) => {\n const existingOption = prevOptions.find(\n (opt: { uid: string; value: string }) =>\n opt.uid === option.uid\n );\n return {\n id: option.uid,\n value: existingOption?.value || '',\n };\n }) || [];\n\n return (\n <GiftCardOptions\n key={`giftcard-${index}`}\n options={giftCardData.options || []}\n optionValues={optionValues}\n onOptionChange={(uid: string, value: string) => {\n const prevOptions = values.enteredOptions || [];\n const idx = prevOptions.findIndex(\n (field: { uid: string; value: string }) =>\n field.uid === uid\n );\n let newEnteredOptions;\n if (idx !== -1) {\n newEnteredOptions = prevOptions.map(\n (field: { uid: string; value: string }) =>\n field.uid === uid ? { ...field, value } : field\n );\n } else {\n newEnteredOptions = [...prevOptions, { uid, value }];\n }\n\n handleOnValues({ enteredOptions: newEnteredOptions });\n\n if (data) {\n const updatedData = { ...data };\n const giftCardAttributes =\n updatedData.attributes?.map((attr) => {\n if (attr.id === 'ac_giftcard') {\n try {\n const giftCardData = JSON.parse(attr.value);\n const updatedOptions =\n giftCardData.options?.map((option: any) => {\n if (option.uid === uid) {\n return { ...option, value };\n }\n return option;\n }) || [];\n return {\n ...attr,\n value: JSON.stringify({\n ...giftCardData,\n options: updatedOptions,\n }),\n };\n } catch (error) {\n return attr;\n }\n }\n return attr;\n }) || [];\n updatedData.attributes = giftCardAttributes;\n setData(updatedData);\n }\n }}\n onValidationChange={(valid: boolean) => {\n if (!valid) {\n handleOnErrors({ giftCard: 'Invalid gift card data' });\n }\n\n setValid(valid);\n }}\n className=\"pdp-product__gift-card-options\"\n />\n );\n } catch (error) {\n console.warn('Invalid gift card data format:', error);\n return null;\n }\n }\n );\n\n // Filter out null values and return a single element\n const validElements = giftCardElements.filter(\n (element) => element !== null\n );\n return validElements.length > 0 ? (\n <div className=\"pdp-product__gift-card-options-container\">\n {validElements}\n </div>\n ) : undefined;\n }\n }\n return undefined;\n };\n\n return (\n <div {...props}>\n <Product\n title={\n <Slot\n name=\"Title\"\n slot={slots?.Title}\n context={{ ...defaultSlotContext }}\n >\n {data?.name}\n </Slot>\n }\n sku={\n !hideSku ? (\n <Slot\n name=\"SKU\"\n slot={slots?.SKU}\n context={{ ...defaultSlotContext }}\n >\n {data?.sku}\n </Slot>\n ) : undefined\n }\n options={renderOptions()}\n giftCardOptions={renderGiftCardOptions()}\n breadcrumbs={\n slots?.Breadcrumbs && (\n <Slot\n name=\"Breadcrumbs\"\n slot={slots?.Breadcrumbs}\n context={{\n ...defaultSlotContext,\n\n setSeparator(callback) {\n this._registerMethod((...attrs) => {\n const nextSeparator = callback(...attrs);\n\n const separator = nextSeparator && (\n <Icon source={nextSeparator} />\n );\n\n this._setProps((prev: any) => {\n return {\n ...prev,\n separator,\n children: [\n // eslint-disable-next-line react/jsx-key\n <Breadcrumbs\n separator={separator}\n categories={prev.categories}\n />,\n ],\n };\n });\n });\n },\n\n appendLink(callback) {\n this._registerMethod((...attrs) => {\n const { text, ...p } = callback(...attrs);\n\n const link = <a {...p}>{text}</a>;\n\n this._setProps((prev: any) => {\n const categories = [...(prev.categories || []), link];\n return {\n ...prev,\n categories,\n children: [\n // eslint-disable-next-line react/jsx-key\n <Breadcrumbs\n separator={prev.separator}\n categories={categories}\n />,\n ],\n };\n });\n });\n },\n\n appendHTMLElement(callback) {\n this._registerMethod((...attrs) => {\n const domElement = callback(...attrs);\n\n const vnode = this._htmlElementToVNode(domElement);\n\n this._setProps((prev: any) => {\n const categories = [...(prev.categories || []), vnode];\n\n return {\n ...prev,\n categories,\n children: [\n // eslint-disable-next-line react/jsx-key\n <Breadcrumbs\n separator={prev.separator}\n categories={categories}\n />,\n ],\n };\n });\n });\n },\n }}\n />\n )\n }\n quantity={quantity}\n actions={\n <Slot\n name=\"Actions\"\n slot={slots?.Actions}\n context={{\n ...defaultSlotContext,\n\n appendButton(callback) {\n this._registerMethod((...attrs) => {\n const _button = callback(...attrs);\n\n if (!_button) return;\n\n const { text, icon, ...buttonProps } = _button;\n\n const button = (\n <Button\n type=\"button\"\n {...buttonProps}\n icon={icon && <Icon source={icon} />}\n >\n {text}\n </Button>\n );\n\n this._setProps((prev: any) => ({\n children: [...(prev.children || []), button],\n }));\n });\n },\n }}\n >\n {\n // Default Add to Cart button if no slot is provided\n !slots?.Actions && (\n <Button\n size=\"medium\"\n type=\"submit\"\n icon={<Icon source=\"Cart\" />}\n disabled={!data?.inStock || !valid}\n aria-label={AddToCartLabel}\n onClick={() => {\n return onAddToCart?.(values);\n }}\n >\n {AddToCartLabel}\n </Button>\n )\n }\n </Slot>\n }\n shortDescription={\n !hideShortDescription ? (\n <Slot\n name=\"ShortDescription\"\n slot={slots?.ShortDescription}\n context={{ ...defaultSlotContext }}\n >\n <div\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{\n __html: data?.shortDescription ?? '',\n }}\n />\n </Slot>\n ) : undefined\n }\n description={\n !hideDescription ? (\n <Slot\n name=\"Description\"\n slot={slots?.Description}\n context={{ ...defaultSlotContext }}\n >\n <div\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{ __html: data?.description ?? '' }}\n />\n </Slot>\n ) : undefined\n }\n images={\n data?.images?.map(({ label, url }) => (\n <Image\n key={url}\n title={label}\n alt={label}\n src={url}\n // TODO: change width/height for image aspect ratio\n // pending https://jira.corp.adobe.com/browse/DATA-5122\n width={carousel?.imageParams?.width ?? 960}\n height={carousel?.imageParams?.height ?? 1191}\n params={carousel?.imageParams ?? { width: 960 }}\n />\n )) ?? []\n }\n specialPrice={\n data?.prices?.visible ? (\n <Slot\n name=\"SpecialPrice\"\n slot={slots?.SpecialPrice}\n context={{ ...defaultSlotContext }}\n >\n <PriceRange\n {...data.prices?.final}\n locale={toLanguageTag(locale)}\n />\n </Slot>\n ) : undefined\n }\n price={\n data?.prices?.visible &&\n data?.prices?.regular &&\n data?.prices?.final?.amount !== data?.prices?.regular?.amount ? (\n <Slot\n name=\"RegularPrice\"\n slot={slots?.RegularPrice}\n context={{ ...defaultSlotContext }}\n >\n <PriceRange\n {...data.prices?.regular}\n locale={toLanguageTag(locale)}\n />\n </Slot>\n ) : undefined\n }\n zoomType={zoomType}\n closeButton={closeButton}\n carouselConfig={{\n ...carousel,\n thumbnails:\n carousel && Object.keys(carousel).length\n ? data?.images?.map(({ label, url }) => (\n <Image\n key={url}\n title={label}\n alt={label}\n src={url}\n // TODO: change width/height for image aspect ratio\n // pending https://jira.corp.adobe.com/browse/DATA-5122\n width={carousel?.thumbnailParams?.width ?? 200}\n height={carousel?.thumbnailParams?.height ?? 248}\n params={carousel?.thumbnailParams ?? { width: 200 }}\n />\n )) ?? []\n : [],\n }}\n outOfStock={!data?.inStock}\n attributes={\n !hideAttributes ? (\n <Slot\n name=\"Attributes\"\n slot={slots?.Attributes}\n context={{ ...defaultSlotContext }}\n >\n {attributes?.length ? (\n <>\n {DetailsLabel}\n <ul>{attributes}</ul>\n </>\n ) : null}\n </Slot>\n ) : undefined\n }\n galleryContent={\n slots?.GalleryContent && (\n <Slot\n name=\"GalleryContent\"\n slot={slots.GalleryContent}\n context={{ ...defaultSlotContext }}\n />\n )\n }\n infoContent={\n slots?.InfoContent && (\n <Slot\n name=\"InfoContent\"\n slot={slots.InfoContent}\n context={{ ...defaultSlotContext }}\n />\n )\n }\n productContent={\n slots?.Content && (\n <Slot\n name=\"Content\"\n slot={slots.Content}\n context={{ ...defaultSlotContext }}\n />\n )\n }\n />\n </div>\n );\n};\n\n/** @deprecated This method is part of the deprecated ProductDetails component. */\nProductDetails.getInitialData = async function ({\n sku,\n disableDropdownPreselection = false,\n optionsConfig,\n}) {\n const initialData = config.getConfig().models?.ProductDetails?.initialData;\n\n return initialData\n ? transformProductData(initialData)\n : fetchProductData(sku, {\n preselectFirstOption: !disableDropdownPreselection,\n anchors: optionsConfig?.anchorOptions,\n });\n};\n"],"names":["Product","title","breadcrumbs","galleryContent","infoContent","productContent","sku","outOfStock","shortDescription","description","attributes","images","options","giftCardOptions","price","specialPrice","className","children","quantity","actions","carouselConfig","zoomType","closeButton","props","RegularPriceLabel","useText","SpecialPriceLabel","OutOfStockLabel","ImagesLabel","zoom","setZoom","useState","galleryImages","image","key","alt","_a","jsx","Zoom","VComponent","localThumbnailsImages","jsxs","classes","_b","Carousel","_c","_d","GalleryGrid","_e","_f","_g","_h","_i","Overlay","gap","style","count","Children","child","ProductDetails","hideSku","hideQuantity","hideShortDescription","hideDescription","hideAttributes","hideURLParams","hideSelectedOptionValue","slots","initialData","carousel","optionsConfig","useACDL","onAddToCart","disableDropdownPreselection","AddToCartLabel","IncrementerLabel","DetailsLabel","ChooseOptionLabel","locale","setLocale","config","selectionsToUpdate","setSelectionsToUpdate","data","setData","values","setValues","initialQuantity","getValidatedQuantityFromUrl","defaultValues","valid","setValid","defaultSlotContext","hasProductViewOptionValueProduct","option","useEffect","dataEvent","events","payload","prev","updateDataEvent","localeEvent","fetchProductData","publishProductPageViewEvent","handleOnValues","useCallback","newValues","handleOptionSelected","selections","optionsUIDs","_","value","id","element","setUrlParams","next","processUpdates","previousOptionsUIDs","updatedOptionsUIDs","item","handleOnErrors","_errors","useMemo","label","__html","isDateValid","toDateString","Slot","Incrementer","quantityValue","renderOptions","Swatches","renderGiftCardOptions","giftCardAttributes","attr","validElements","giftCardAttr","index","giftCardData","prevOptions","optionValues","existingOption","opt","GiftCardOptions","uid","idx","field","newEnteredOptions","updatedData","updatedOptions","error","callback","attrs","nextSeparator","separator","Icon","Breadcrumbs","text","p","link","categories","domElement","vnode","_button","icon","buttonProps","button","Button","url","Image","PriceRange","toLanguageTag","_j","_k","Fragment","transformProductData"],"mappings":"+kCAsDO,MAAMA,GAA2C,CAAC,CACvD,MAAAC,EACA,YAAAC,EACA,eAAAC,EACA,YAAAC,EACA,eAAAC,EACA,IAAAC,EACA,WAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,WAAAC,GACA,OAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,MAAAC,EACA,aAAAC,EACA,UAAAC,GACA,SAAAC,GACA,SAAAC,EACA,QAAAC,EACA,eAAAC,EACA,SAAAC,GAAW,UACX,YAAAC,GAAc,GACd,GAAGC,EACL,IAAM,wBAEE,MAAAC,EAAoBC,EAAQ,gCAAgC,EAAE,MAC9DC,GAAoBD,EAAQ,gCAAgC,EAAE,MAC9DE,GAAkBF,EAAQ,8BAA8B,EAAE,MAC1DG,EAAcH,EAAQ,yBAAyB,EAAE,MAEjD,CAACI,EAAMC,CAAO,EAAIC,EAAwB,IAAI,EAE9CC,EAAgBrB,GAAA,MAAAA,EAAQ,OAC5BA,EAAO,IAAI,CAACsB,EAAOC,IAAQ,OACnB,MAAAC,IACJC,EAAAnC,GAAA,YAAAA,EAAO,QAAP,YAAAmC,EAAc,YACdR,GAAA,YAAAA,EAAa,QAAQ,YAAa3B,EAAM,MAAM,SAAS,SAAS,GAC7D,QAAQ,QAAS,OAAOiC,EAAM,CAAC,GAC/B,QAAQ,UAAW,OAAOvB,EAAO,MAAM,IAC5C,OAAOU,KAAa,OACjBgB,EAAAC,GAAA,CAAK,YAAAhB,GACJ,SAAAe,EAACE,EAAA,CAEC,KAAMN,EACN,QAASC,IAAQ,EAAI,QAAU,OAC/B,IAAAC,CAAA,EAHKD,GAKT,EAEAG,EAACE,EAAA,CAEC,KAAMN,EACN,QAASC,IAAQ,EAAI,QAAU,OAC/B,IAAAC,EACA,QAAS,IAAML,EAAQI,CAAG,CAAA,EAJrBA,CAKP,CAEH,CAAA,EAEDG,EAAC,MA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AMF,GAAczB,GAAAP,EAAA4C,GAAO,UAAU,EAAE,SAAnB,YAAA5C,EAA2B,iBAA3B,YAAAO,EAA2C,YAE/D,OAAOyB,EACH2G,GAAqB3G,CAAW,EAChCkC,GAAiBhG,EAAK,CACpB,qBAAsB,CAACmE,EACvB,QAASH,GAAA,YAAAA,EAAe,aAAA,CACzB,CACP"}
1
+ {"version":3,"file":"ProductDetails.js","sources":["/@dropins/storefront-pdp/src/components/Product/Product.tsx","/@dropins/storefront-pdp/src/components/GalleryGrid/GalleryGrid.tsx","/@dropins/storefront-pdp/src/containers/ProductDetails/ProductDetails.tsx"],"sourcesContent":["/**\n * ADOBE CONFIDENTIAL\n * __________________\n * Copyright 2023 Adobe\n * All Rights Reserved.\n * __________________\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n */\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes, useState } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport { useText } from '@adobe-commerce/elsie/i18n';\n\nimport { Carousel, GalleryGrid, Overlay, Zoom } from '@/pdp/components';\nimport '@/pdp/components/Product/Product.css';\n\nimport { CarouselConfig } from '@/pdp/containers';\n\ninterface ProductCarouselConfig extends CarouselConfig {\n thumbnails: VNode[];\n}\n\nexport interface ProductProps\n extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {\n title?: VNode;\n breadcrumbs?: VNode;\n galleryContent?: VNode;\n infoContent?: VNode;\n productContent?: VNode;\n shortDescription?: VNode;\n description?: VNode;\n attributes?: VNode;\n images: VNode[];\n options?: VNode;\n giftCardOptions?: VNode;\n downloadableOptions?: VNode;\n sku?: VNode;\n price?: VNode;\n specialPrice?: VNode;\n outOfStock: boolean;\n actions?: VNode;\n quantity?: VNode;\n carouselConfig?: ProductCarouselConfig;\n zoomType?: 'zoom' | 'overlay';\n closeButton?: boolean;\n}\n\nexport const Product: FunctionComponent<ProductProps> = ({\n title,\n breadcrumbs,\n galleryContent,\n infoContent,\n productContent,\n sku,\n outOfStock,\n shortDescription,\n description,\n attributes,\n images,\n options,\n giftCardOptions,\n downloadableOptions,\n price,\n specialPrice,\n className,\n children,\n quantity,\n actions,\n carouselConfig,\n zoomType = 'overlay',\n closeButton = true,\n ...props\n}) => {\n // i18n\n const RegularPriceLabel = useText('PDP.Product.RegularPrice.label').label;\n const SpecialPriceLabel = useText('PDP.Product.SpecialPrice.label').label;\n const OutOfStockLabel = useText('PDP.Product.OutOfStock.label').label;\n const ImagesLabel = useText('PDP.Product.Image.label').label;\n\n const [zoom, setZoom] = useState<number | null>(null);\n\n const galleryImages = images?.length ? (\n images.map((image, key) => {\n const alt =\n title?.props?.children &&\n ImagesLabel?.replace('{product}', title.props.children.toString())\n .replace('{key}', String(key + 1))\n .replace('{total}', String(images.length));\n return zoomType === 'zoom' ? (\n <Zoom closeButton={closeButton}>\n <VComponent\n key={key}\n node={image}\n loading={key === 0 ? 'eager' : 'lazy'}\n alt={alt}\n />\n </Zoom>\n ) : (\n <VComponent\n key={key}\n node={image}\n loading={key === 0 ? 'eager' : 'lazy'}\n alt={alt}\n onClick={() => setZoom(key)}\n />\n );\n })\n ) : (\n <img\n src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"\n className=\"pdp-product__images__placeholder\"\n aria-hidden\n />\n );\n\n const localThumbnailsImages = carouselConfig?.thumbnails?.length ? (\n carouselConfig.thumbnails.map((image, key) => (\n <VComponent\n key={key}\n node={image}\n loading={carouselConfig?.thumbnailsLoadingMode || 'lazy'}\n alt={\n title?.props?.children &&\n ImagesLabel?.replace('{product}', title.props.children.toString())\n .replace('{key}', String(key + 1))\n .replace('{total}', String(images.length))\n }\n />\n ))\n ) : (\n <img\n src=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"\n className=\"pdp-product__images__placeholder\"\n aria-hidden\n />\n );\n\n return (\n <div {...props} className={classes(['pdp-product', className])}>\n {breadcrumbs && (\n <VComponent node={breadcrumbs} className=\"pdp-product__breadcrumbs\" />\n )}\n <div className=\"pdp-product__column-container pdp-product__gallery-column\">\n <div className=\"pdp-product__column-body\">\n {carouselConfig?.controls?.desktop ? (\n <Carousel\n className=\"pdp-product__overlay__carousel\"\n arrows={images?.length > 1}\n controls={\n images?.length > 1 ? carouselConfig.controls.desktop : 'dots'\n }\n arrowsOnMainImage={carouselConfig?.arrowsOnMainImage}\n loop={carouselConfig?.loopable && images?.length > 1}\n peak={\n (carouselConfig?.thumbnails?.length > 1 &&\n carouselConfig?.peak?.desktop) ||\n false\n }\n gap={carouselConfig?.gap || null}\n width=\"100%\"\n height=\"100%\"\n defaultIndex={zoom || 0}\n thumbnails={localThumbnailsImages}\n >\n {galleryImages}\n </Carousel>\n ) : (\n <GalleryGrid className=\"pdp-product__images\" gap=\"small\">\n {galleryImages}\n </GalleryGrid>\n )}\n </div>\n {galleryContent && (\n <VComponent\n node={galleryContent}\n className=\"pdp-product__gallery-content\"\n />\n )}\n </div>\n\n <div className=\"pdp-product__column-container pdp-product__content-column\">\n <div className=\"pdp-product__column-body\">\n <div className=\"pdp-product__header\">\n {title && (\n <VComponent node={title} className=\"pdp-product__title\" />\n )}\n\n {sku && <VComponent node={sku} className=\"pdp-product__sku\" />}\n </div>\n\n <div className=\"pdp-product__prices\">\n {specialPrice && (\n <VComponent\n node={specialPrice}\n className={classes([\n 'pdp-product__price-special',\n 'pdp-product__price',\n ])}\n aria-label={SpecialPriceLabel}\n role=\"text\"\n />\n )}\n {price && (\n <VComponent\n node={price}\n className={classes([\n 'pdp-product__price-regular',\n 'pdp-product__price--grey',\n ])}\n aria-label={RegularPriceLabel}\n role=\"text\"\n />\n )}\n </div>\n\n {/* Small Screen Gallery */}\n {carouselConfig?.controls?.mobile &&\n carouselConfig?.controls?.mobile === 'thumbnailsRow' ? (\n <Carousel\n className=\"pdp-product__images pdp-product__images--carousel pdp-product__images--carousel--thumbnails\"\n width=\"100%\"\n height=\"auto\"\n arrows={images?.length > 1}\n controls={images?.length > 1 ? 'thumbnailsRow' : null}\n loop={carouselConfig?.loopable && images?.length > 1}\n peak={\n (carouselConfig?.thumbnails?.length > 1 &&\n carouselConfig?.peak?.mobile) ||\n false\n }\n gap={carouselConfig?.gap || null}\n thumbnails={localThumbnailsImages}\n >\n {galleryImages}\n </Carousel>\n ) : (\n <Carousel\n className=\"pdp-product__images pdp-product__images--carousel\"\n peak={carouselConfig?.peak?.mobile && images?.length > 1}\n gap={carouselConfig?.gap || null}\n width=\"100%\"\n height=\"auto\"\n arrows={images?.length > 1}\n controls={images?.length > 1 ? 'dots' : null}\n loop={carouselConfig?.loopable && images?.length > 1}\n >\n {galleryImages}\n </Carousel>\n )}\n\n <div\n className={classes([\n 'pdp-product__actions',\n [`pdp-product__actions--out-of-stock`, outOfStock],\n ])}\n >\n {outOfStock && (\n <div className=\"pdp-product__out-of-stock__text\">\n {OutOfStockLabel}\n </div>\n )}\n\n {options && (\n <VComponent\n node={options}\n className={classes(['pdp-product__options'])}\n />\n )}\n\n {giftCardOptions && (\n <VComponent\n node={giftCardOptions}\n className={classes(['pdp-product__gift-card-options'])}\n />\n )}\n\n {downloadableOptions && (\n <VComponent\n node={downloadableOptions}\n className={classes(['pdp-product__downloadable-options'])}\n />\n )}\n\n {quantity && (\n <div className=\"pdp-product__quantity\">\n <VComponent node={quantity} />\n </div>\n )}\n\n {actions && (\n <VComponent\n node={actions}\n className={classes(['pdp-product__buttons'])}\n />\n )}\n </div>\n\n {shortDescription && (\n <VComponent\n node={shortDescription}\n className={classes(['pdp-product__short_description'])}\n />\n )}\n\n {description && (\n <VComponent\n node={description}\n className={classes(['pdp-product__description'])}\n />\n )}\n\n {attributes ? (\n <div className=\"pdp-product__attributes\">{attributes}</div>\n ) : null}\n </div>\n {infoContent && (\n <VComponent\n node={infoContent}\n className=\"pdp-product__info-content\"\n />\n )}\n </div>\n\n {productContent && (\n <VComponent node={productContent} className=\"pdp-product__content\" />\n )}\n\n {/* Zoom Overlay */}\n {zoom === null ? null : (\n <Overlay\n className=\"pdp-product__overlay\"\n onClose={() => setZoom(null)}\n centered\n >\n <Carousel\n className=\"pdp-product__overlay__carousel\"\n arrows={images?.length > 1}\n width=\"100%\"\n height=\"100%\"\n defaultIndex={zoom || 0}\n loop={carouselConfig?.loopable && images?.length > 1}\n controls={images?.length > 1 ? 'dots' : null}\n isZoomed\n >\n {galleryImages}\n </Carousel>\n </Overlay>\n )}\n </div>\n );\n};\n","/**\n * ADOBE CONFIDENTIAL\n * __________________\n * Copyright 2023 Adobe\n * All Rights Reserved.\n * __________________\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n */\n\nimport { FunctionComponent, VNode } from 'preact';\nimport { HTMLAttributes, Children } from 'preact/compat';\nimport { classes, VComponent } from '@adobe-commerce/elsie/lib';\nimport '@/pdp/components/GalleryGrid/GalleryGrid.css';\n\nexport interface GalleryGridProps extends HTMLAttributes<HTMLDivElement> {\n children: VNode[] | VNode;\n gap?: 'small' | 'medium' | 'large' | null;\n style?: Record<string, string | number>;\n}\n\nexport const GalleryGrid: FunctionComponent<GalleryGridProps> = ({\n children,\n gap = null,\n className,\n style,\n ...props\n}) => {\n const count = Children.count(children);\n\n return (\n <div\n {...props}\n className={classes(['pdp-gallery-grid', className])}\n style={{\n '--gap': gap ? `var(--spacing-${gap})` : '0px',\n ...style,\n }}\n >\n {Children.map(\n children,\n (child: VNode<HTMLAttributes<HTMLElement>>, key) => (\n <div key={count + key} className=\"pdp-gallery-grid__item\">\n <VComponent\n key={child.props.src}\n node={child}\n loading={key === 0 ? 'eager' : 'lazy'}\n />\n </div>\n )\n )}\n </div>\n );\n};\n","/**\n * ADOBE CONFIDENTIAL\n * __________________\n * Copyright 2023 Adobe\n * All Rights Reserved.\n * __________________\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n */\n\nimport {\n HTMLAttributes,\n useEffect,\n useState,\n useCallback,\n useMemo,\n} from 'preact/compat';\n\nimport {\n Container,\n toLanguageTag,\n SlotProps,\n SlotMethod,\n Slot,\n ResolveImageUrlOptions,\n} from '@adobe-commerce/elsie/lib';\n\nimport {\n Button,\n Icon,\n ButtonProps,\n Image,\n Incrementer,\n Breadcrumbs,\n} from '@adobe-commerce/elsie/components';\nimport {\n Product,\n Swatches,\n PriceRange,\n Option,\n GiftCardOptions,\n DownloadableOptions,\n} from '@/pdp/components';\nimport { config, fetchProductData } from '@/pdp/api';\nimport { events } from '@adobe-commerce/event-bus';\nimport { Lang, useText } from '@adobe-commerce/elsie/i18n';\nimport { isDateValid, toDateString } from '@/pdp/lib/date';\nimport {\n setUrlParams,\n getValidatedQuantityFromUrl,\n} from '@/pdp/lib/url-params';\nimport { publishProductPageViewEvent } from '@/pdp/lib/acdl';\nimport { ProductModel, Option as ProductOption } from '@/pdp/data/models';\nimport { transformProductData } from '@/pdp/data/transforms/product-transform';\n\ntype IconType = keyof typeof import('@adobe-commerce/elsie/icons');\n\n/** @deprecated This type is part of the deprecated ProductDetails component. */\nexport type Values = {\n sku: string;\n quantity: number;\n optionsUIDs?: string[];\n enteredOptions?: Array<{ uid: string; value: string }>;\n};\n\n/** @deprecated This type is part of the deprecated ProductDetails component. */\ntype DefaultSlotContext = {\n data: ProductModel | null;\n values: Values;\n valid: boolean;\n};\n\n/** @deprecated This type is part of the deprecated ProductDetails component. */\nexport type CarouselConfig = {\n controls?: {\n desktop?: 'thumbnailsRow' | 'thumbnailsColumn' | 'dots' | null;\n mobile?: 'dots' | 'thumbnailsRow' | null;\n };\n arrowsOnMainImage?: boolean;\n loopable?: boolean;\n peak?: {\n desktop: boolean;\n mobile: boolean;\n };\n gap?: 'small' | 'medium' | 'large' | null;\n thumbnailsLoadingMode?: 'lazy' | 'eager';\n imageParams?: ResolveImageUrlOptions;\n thumbnailParams?: ResolveImageUrlOptions;\n};\n\n/** @deprecated This type is part of the deprecated ProductDetails component. */\nexport type OptionsConfig = {\n anchorOptions?: string[];\n};\n\n/** @deprecated This interface is part of the deprecated ProductDetails component. */\nexport interface ProductDetailsProps extends HTMLAttributes<HTMLDivElement> {\n sku: string;\n productData?: ProductModel;\n hideSku?: boolean;\n hideQuantity?: boolean;\n hideShortDescription?: boolean;\n hideDescription?: boolean;\n hideAttributes?: boolean;\n hideSelectedOptionValue?: boolean;\n hideURLParams?: boolean;\n slots?: {\n Title?: SlotProps<DefaultSlotContext>;\n\n SKU?: SlotProps<DefaultSlotContext>;\n\n RegularPrice?: SlotProps<DefaultSlotContext>;\n\n SpecialPrice?: SlotProps<DefaultSlotContext>;\n\n Options?: SlotProps<DefaultSlotContext>;\n\n Quantity?: SlotProps<DefaultSlotContext>;\n\n Actions?: SlotProps<\n DefaultSlotContext & {\n appendButton: SlotMethod<\n Omit<ButtonProps, 'icon'> & {\n text?: string;\n icon?: IconType;\n }\n >;\n }\n >;\n\n ShortDescription?: SlotProps<DefaultSlotContext>;\n\n Description?: SlotProps<DefaultSlotContext>;\n\n Attributes?: SlotProps<DefaultSlotContext>;\n\n Breadcrumbs?: SlotProps<\n DefaultSlotContext & {\n setSeparator: SlotMethod<IconType>;\n\n appendLink: SlotMethod<\n HTMLAttributes<HTMLAnchorElement> & { text?: string }\n >;\n\n appendHTMLElement: SlotMethod<HTMLElement>;\n }\n >;\n\n GalleryContent?: SlotProps<DefaultSlotContext>;\n\n InfoContent?: SlotProps<DefaultSlotContext>;\n\n Content?: SlotProps<DefaultSlotContext>;\n };\n carousel?: CarouselConfig;\n optionsConfig?: OptionsConfig;\n useACDL?: boolean;\n onAddToCart?: (values: Values) => void;\n zoomType?: 'zoom' | 'overlay';\n closeButton?: boolean;\n disableDropdownPreselection?: boolean;\n}\n\n/**\n * @deprecated This container has been deprecated and will be removed in a future release.\n * Please use the different composable containers to build your product details page.xs\n */\nexport const ProductDetails: Container<\n ProductDetailsProps,\n ProductModel | null\n> = ({\n sku,\n hideSku,\n hideQuantity,\n hideShortDescription,\n hideDescription,\n hideAttributes,\n hideURLParams,\n hideSelectedOptionValue,\n slots,\n children,\n initialData,\n carousel,\n optionsConfig,\n useACDL,\n onAddToCart,\n zoomType,\n closeButton = true,\n disableDropdownPreselection,\n ...props\n}) => {\n // i18n\n const AddToCartLabel = useText('PDP.Product.AddToCart.label').label;\n const IncrementerLabel = useText('PDP.Product.Incrementer.label').label;\n const DetailsLabel = useText('PDP.Product.Details.label').label;\n const ChooseOptionLabel = useText('PDP.Swatches.ChooseOption.label').label;\n\n // TODO: Investigate if the \"|| 'en-US' \" is really necessary\n const [locale, setLocale] = useState<Lang>(\n (config.getConfig().defaultLocale as Lang) || 'en-US'\n );\n\n const [selectionsToUpdate, setSelectionsToUpdate] = useState<Option[]>();\n\n const [data = null, setData] = useState(initialData);\n\n const [values, setValues] = useState<Values>(() => {\n const initialQuantity = getValidatedQuantityFromUrl(1); // Default quantity to 1\n\n const defaultValues: Values = {\n sku,\n quantity: initialQuantity,\n };\n\n if (data?.optionUIDs) {\n defaultValues.optionsUIDs = data.optionUIDs;\n }\n return defaultValues;\n });\n\n // the context is invalid for a configurable product that doesn't have all the options selected\n const [valid, setValid] = useState(() => {\n return !(\n data?.options &&\n data?.options?.length > 0 &&\n data?.optionUIDs?.length !== data?.options.length\n );\n });\n const defaultSlotContext: DefaultSlotContext = { data, values, valid };\n\n function hasProductViewOptionValueProduct(options: ProductOption[]) {\n return options?.some(\n (option) => option?.typename === 'ProductViewOptionValueProduct'\n );\n }\n\n useEffect(() => {\n const dataEvent = events.on('pdp/data', (payload) => {\n if (payload) {\n setData(payload);\n // Preserve the current quantity value when updating from pdp/data event\n setValues((prev: Values) => ({\n ...prev,\n sku: payload.sku,\n optionsUIDs: payload.optionUIDs,\n }));\n }\n });\n\n // @ts-ignore - Type error with event bus events\n const updateDataEvent = events.on(\n 'pdp/setValues',\n (payload: Partial<Values>) => {\n setValues((prev: Values) => ({ ...prev, ...payload }));\n }\n );\n\n return () => {\n updateDataEvent?.off();\n dataEvent?.off();\n };\n }, []);\n\n // Locale\n useEffect(() => {\n const localeEvent = events.on('locale', (payload: string) => {\n if (payload === locale) return;\n\n setLocale(payload as Lang);\n\n fetchProductData(sku, {\n preselectFirstOption: !disableDropdownPreselection,\n anchors: optionsConfig?.anchorOptions,\n }).then(setData);\n });\n return () => {\n localeEvent?.off();\n };\n }, [disableDropdownPreselection, locale, optionsConfig?.anchorOptions, sku]);\n\n useEffect(() => {\n if (useACDL && initialData && Object.keys(initialData).length > 0) {\n publishProductPageViewEvent(initialData);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [initialData]);\n\n // Callbacks\n const handleOnValues = useCallback((newValues: Partial<Values>) => {\n setValues((prev) => ({ ...prev, ...newValues }));\n }, []);\n\n useEffect(() => {\n events.emit('pdp/values', values);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(values)]);\n\n const handleOptionSelected = useCallback(\n async (selections: { [id: string]: { label: string; value: string } }) => {\n // options Selected\n let optionsUIDs = Object.entries(selections)\n .filter(([_, value]) => value.label !== ChooseOptionLabel) // eslint-disable-line no-unused-vars\n .map(([id, _]) => selections[id].value) // eslint-disable-line no-unused-vars\n .filter((element) => element !== undefined);\n\n // set optionUIDs to URL params\n // ?optionsUIDs=1,2,3\n // only set the URL params if the hideURLParams is not set to true and the product is not a bundle type\n if (\n !hideURLParams &&\n data?.options &&\n !hasProductViewOptionValueProduct(data.options)\n ) {\n setUrlParams({ optionsUIDs: optionsUIDs.join(',') });\n }\n\n // update state\n handleOnValues({ optionsUIDs });\n setValid(optionsUIDs?.length === data?.options?.length);\n\n // get refined product data and update state\n const next = await fetchProductData(sku, {\n anchors: optionsConfig?.anchorOptions,\n isBundle: data?.isBundle,\n optionsUIDs,\n preselectFirstOption: !disableDropdownPreselection,\n });\n\n setData(next);\n\n // special processing for anchor options (options that should not be refined when other options are selected)\n if (optionsConfig?.anchorOptions?.length) {\n processUpdates(next, optionsUIDs);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [sku]\n );\n\n const processUpdates = useCallback(\n (next: ProductModel | null, previousOptionsUIDs: string[]) => {\n const updatedOptionsUIDs = next?.optionUIDs ?? [];\n const haveSameValues = previousOptionsUIDs.every((item) =>\n updatedOptionsUIDs.includes(item)\n );\n if (!haveSameValues) {\n setSelectionsToUpdate(next?.options);\n handleOnValues({ optionsUIDs: updatedOptionsUIDs });\n setValid(updatedOptionsUIDs?.length === next?.options?.length);\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [sku]\n );\n\n const handleOnErrors = useCallback((_errors: { [id: string]: string }) => {\n if (Object.keys(_errors).length !== 0) setValid(false);\n }, []);\n\n // Product Attributes\n const attributes = useMemo(() => {\n return data?.attributes?.map(({ label, value, id }, key: number) => {\n // Return empty string for gift card attributes\n if (id === 'ac_giftcard') {\n return '';\n }\n\n const __html = isDateValid(value)\n ? toDateString(value, locale)\n : value.toString();\n\n return (\n <li key={key}>\n {/* eslint-disable-next-line react/no-danger */}\n {label}: <span dangerouslySetInnerHTML={{ __html }} />\n </li>\n );\n });\n }, [data?.attributes, locale]);\n\n const quantity =\n !hideQuantity && data?.inStock ? (\n <Slot\n name=\"Quantity\"\n slot={slots?.Quantity}\n context={{ ...defaultSlotContext }}\n >\n <Incrementer\n key=\"quantity\"\n name=\"quantity\"\n defaultValue={values.quantity.toString()}\n value={values.quantity.toString()}\n min={1}\n aria-label={IncrementerLabel}\n className=\"pdp-product__quantity\"\n onValue={(quantity) => {\n const quantityValue = Number(quantity);\n handleOnValues({ quantity: quantityValue });\n\n // Add quantity to URL parameters if not set to hide\n if (!hideURLParams && data?.options) {\n // Only update URL if the product is not a bundle type\n if (!hasProductViewOptionValueProduct(data.options)) {\n setUrlParams({ quantity: quantityValue });\n }\n }\n }}\n />\n </Slot>\n ) : undefined;\n\n const renderOptions = () => {\n if (data?.options) {\n return (\n <Slot\n name=\"Options\"\n slot={slots?.Options}\n context={{ ...defaultSlotContext }}\n >\n <Swatches\n selectedUIDs={values.optionsUIDs}\n options={data.options}\n defaultOptions={values.optionsUIDs}\n selectionsToUpdate={selectionsToUpdate}\n hideSelectedValue={hideSelectedOptionValue}\n disablePreselections={disableDropdownPreselection}\n onValues={handleOptionSelected}\n onErrors={handleOnErrors}\n />\n </Slot>\n );\n }\n };\n\n const renderGiftCardOptions = () => {\n if (data?.attributes) {\n const giftCardAttributes = data.attributes.filter(\n (attr) => attr.id === 'ac_giftcard'\n );\n\n if (giftCardAttributes.length > 0) {\n const giftCardElements = giftCardAttributes.map(\n (giftCardAttr, index) => {\n try {\n const giftCardData = JSON.parse(giftCardAttr.value);\n const prevOptions = values.enteredOptions || [];\n const optionValues =\n giftCardData.options?.map((option: any) => {\n const existingOption = prevOptions.find(\n (opt: { uid: string; value: string }) =>\n opt.uid === option.uid\n );\n return {\n id: option.uid,\n value: existingOption?.value || '',\n };\n }) || [];\n\n return (\n <GiftCardOptions\n key={`giftcard-${index}`}\n options={giftCardData.options || []}\n optionValues={optionValues}\n onOptionChange={(uid: string, value: string) => {\n const prevOptions = values.enteredOptions || [];\n const idx = prevOptions.findIndex(\n (field: { uid: string; value: string }) =>\n field.uid === uid\n );\n let newEnteredOptions;\n if (idx !== -1) {\n newEnteredOptions = prevOptions.map(\n (field: { uid: string; value: string }) =>\n field.uid === uid ? { ...field, value } : field\n );\n } else {\n newEnteredOptions = [...prevOptions, { uid, value }];\n }\n\n handleOnValues({ enteredOptions: newEnteredOptions });\n\n if (data) {\n const updatedData = { ...data };\n const giftCardAttributes =\n updatedData.attributes?.map((attr) => {\n if (attr.id === 'ac_giftcard') {\n try {\n const giftCardData = JSON.parse(attr.value);\n const updatedOptions =\n giftCardData.options?.map((option: any) => {\n if (option.uid === uid) {\n return { ...option, value };\n }\n return option;\n }) || [];\n return {\n ...attr,\n value: JSON.stringify({\n ...giftCardData,\n options: updatedOptions,\n }),\n };\n } catch (error) {\n return attr;\n }\n }\n return attr;\n }) || [];\n updatedData.attributes = giftCardAttributes;\n setData(updatedData);\n }\n }}\n onValidationChange={(valid: boolean) => {\n if (!valid) {\n handleOnErrors({ giftCard: 'Invalid gift card data' });\n }\n\n setValid(valid);\n }}\n className=\"pdp-product__gift-card-options\"\n />\n );\n } catch (error) {\n console.warn('Invalid gift card data format:', error);\n return null;\n }\n }\n );\n\n // Filter out null values and return a single element\n const validElements = giftCardElements.filter(\n (element) => element !== null\n );\n return validElements.length > 0 ? (\n <div className=\"pdp-product__gift-card-options-container\">\n {validElements}\n </div>\n ) : undefined;\n }\n }\n return undefined;\n };\n\n const renderDownloadableOptions = () => {\n if (data?.attributes) {\n const downloadableAttributes = data.attributes.filter(\n (attr) =>\n attr.id === 'ac_downloadable' &&\n attr.roles?.includes('visible_in_pdp')\n );\n\n if (downloadableAttributes.length > 0) {\n const downloadableElements = downloadableAttributes.map(\n (downloadableAttr, index) => {\n try {\n const downloadableValue =\n typeof downloadableAttr.value === 'string'\n ? JSON.parse(downloadableAttr.value)\n : downloadableAttr.value;\n\n return (\n <DownloadableOptions\n key={`downloadable-${index}`}\n label={downloadableAttr.label}\n value={downloadableValue}\n onLinkChange={(uid: string, selected: boolean) => {\n const prevUIDs = values.optionsUIDs || [];\n let newOptionsUIDs;\n\n if (selected) {\n if (!prevUIDs.includes(uid)) {\n newOptionsUIDs = [...prevUIDs, uid];\n } else {\n newOptionsUIDs = prevUIDs;\n }\n } else {\n newOptionsUIDs = prevUIDs.filter(\n (id: string) => id !== uid\n );\n }\n\n handleOnValues({ optionsUIDs: newOptionsUIDs });\n }}\n currency={data.prices?.final?.currency}\n className=\"pdp-product__downloadable-options\"\n />\n );\n } catch (error) {\n console.warn('Invalid downloadable data format:', error);\n return null;\n }\n }\n );\n\n // Filter out null values and return a wrapper div\n const validElements = downloadableElements.filter(\n (element) => element !== null\n );\n return validElements.length > 0 ? (\n <div className=\"pdp-product__downloadable-options-container\">\n {validElements}\n </div>\n ) : undefined;\n }\n }\n return undefined;\n };\n\n return (\n <div {...props}>\n <Product\n title={\n <Slot\n name=\"Title\"\n slot={slots?.Title}\n context={{ ...defaultSlotContext }}\n >\n {data?.name}\n </Slot>\n }\n sku={\n !hideSku ? (\n <Slot\n name=\"SKU\"\n slot={slots?.SKU}\n context={{ ...defaultSlotContext }}\n >\n {data?.sku}\n </Slot>\n ) : undefined\n }\n options={renderOptions()}\n giftCardOptions={renderGiftCardOptions()}\n downloadableOptions={renderDownloadableOptions()}\n breadcrumbs={\n slots?.Breadcrumbs && (\n <Slot\n name=\"Breadcrumbs\"\n slot={slots?.Breadcrumbs}\n context={{\n ...defaultSlotContext,\n\n setSeparator(callback) {\n this._registerMethod((...attrs) => {\n const nextSeparator = callback(...attrs);\n\n const separator = nextSeparator && (\n <Icon source={nextSeparator} />\n );\n\n this._setProps((prev: any) => {\n return {\n ...prev,\n separator,\n children: [\n // eslint-disable-next-line react/jsx-key\n <Breadcrumbs\n separator={separator}\n categories={prev.categories}\n />,\n ],\n };\n });\n });\n },\n\n appendLink(callback) {\n this._registerMethod((...attrs) => {\n const { text, ...p } = callback(...attrs);\n\n const link = <a {...p}>{text}</a>;\n\n this._setProps((prev: any) => {\n const categories = [...(prev.categories || []), link];\n return {\n ...prev,\n categories,\n children: [\n // eslint-disable-next-line react/jsx-key\n <Breadcrumbs\n separator={prev.separator}\n categories={categories}\n />,\n ],\n };\n });\n });\n },\n\n appendHTMLElement(callback) {\n this._registerMethod((...attrs) => {\n const domElement = callback(...attrs);\n\n const vnode = this._htmlElementToVNode(domElement);\n\n this._setProps((prev: any) => {\n const categories = [...(prev.categories || []), vnode];\n\n return {\n ...prev,\n categories,\n children: [\n // eslint-disable-next-line react/jsx-key\n <Breadcrumbs\n separator={prev.separator}\n categories={categories}\n />,\n ],\n };\n });\n });\n },\n }}\n />\n )\n }\n quantity={quantity}\n actions={\n <Slot\n name=\"Actions\"\n slot={slots?.Actions}\n context={{\n ...defaultSlotContext,\n\n appendButton(callback) {\n this._registerMethod((...attrs) => {\n const _button = callback(...attrs);\n\n if (!_button) return;\n\n const { text, icon, ...buttonProps } = _button;\n\n const button = (\n <Button\n type=\"button\"\n {...buttonProps}\n icon={icon && <Icon source={icon} />}\n >\n {text}\n </Button>\n );\n\n this._setProps((prev: any) => ({\n children: [...(prev.children || []), button],\n }));\n });\n },\n }}\n >\n {\n // Default Add to Cart button if no slot is provided\n !slots?.Actions && (\n <Button\n size=\"medium\"\n type=\"submit\"\n icon={<Icon source=\"Cart\" />}\n disabled={!data?.inStock || !valid}\n aria-label={AddToCartLabel}\n onClick={() => {\n return onAddToCart?.(values);\n }}\n >\n {AddToCartLabel}\n </Button>\n )\n }\n </Slot>\n }\n shortDescription={\n !hideShortDescription ? (\n <Slot\n name=\"ShortDescription\"\n slot={slots?.ShortDescription}\n context={{ ...defaultSlotContext }}\n >\n <div\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{\n __html: data?.shortDescription ?? '',\n }}\n />\n </Slot>\n ) : undefined\n }\n description={\n !hideDescription ? (\n <Slot\n name=\"Description\"\n slot={slots?.Description}\n context={{ ...defaultSlotContext }}\n >\n <div\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{ __html: data?.description ?? '' }}\n />\n </Slot>\n ) : undefined\n }\n images={\n data?.images?.map(({ label, url }) => (\n <Image\n key={url}\n title={label}\n alt={label}\n src={url}\n // TODO: change width/height for image aspect ratio\n // pending https://jira.corp.adobe.com/browse/DATA-5122\n width={carousel?.imageParams?.width ?? 960}\n height={carousel?.imageParams?.height ?? 1191}\n params={carousel?.imageParams ?? { width: 960 }}\n />\n )) ?? []\n }\n specialPrice={\n data?.prices?.visible ? (\n <Slot\n name=\"SpecialPrice\"\n slot={slots?.SpecialPrice}\n context={{ ...defaultSlotContext }}\n >\n <PriceRange\n {...data.prices?.final}\n locale={toLanguageTag(locale)}\n />\n </Slot>\n ) : undefined\n }\n price={\n data?.prices?.visible &&\n data?.prices?.regular &&\n data?.prices?.final?.amount !== data?.prices?.regular?.amount ? (\n <Slot\n name=\"RegularPrice\"\n slot={slots?.RegularPrice}\n context={{ ...defaultSlotContext }}\n >\n <PriceRange\n {...data.prices?.regular}\n locale={toLanguageTag(locale)}\n />\n </Slot>\n ) : undefined\n }\n zoomType={zoomType}\n closeButton={closeButton}\n carouselConfig={{\n ...carousel,\n thumbnails:\n carousel && Object.keys(carousel).length\n ? data?.images?.map(({ label, url }) => (\n <Image\n key={url}\n title={label}\n alt={label}\n src={url}\n // TODO: change width/height for image aspect ratio\n // pending https://jira.corp.adobe.com/browse/DATA-5122\n width={carousel?.thumbnailParams?.width ?? 200}\n height={carousel?.thumbnailParams?.height ?? 248}\n params={carousel?.thumbnailParams ?? { width: 200 }}\n />\n )) ?? []\n : [],\n }}\n outOfStock={!data?.inStock}\n attributes={\n !hideAttributes ? (\n <Slot\n name=\"Attributes\"\n slot={slots?.Attributes}\n context={{ ...defaultSlotContext }}\n >\n {attributes?.length ? (\n <>\n {DetailsLabel}\n <ul>{attributes}</ul>\n </>\n ) : null}\n </Slot>\n ) : undefined\n }\n galleryContent={\n slots?.GalleryContent && (\n <Slot\n name=\"GalleryContent\"\n slot={slots.GalleryContent}\n context={{ ...defaultSlotContext }}\n />\n )\n }\n infoContent={\n slots?.InfoContent && (\n <Slot\n name=\"InfoContent\"\n slot={slots.InfoContent}\n context={{ ...defaultSlotContext }}\n />\n )\n }\n productContent={\n slots?.Content && (\n <Slot\n name=\"Content\"\n slot={slots.Content}\n context={{ ...defaultSlotContext }}\n />\n )\n }\n />\n </div>\n );\n};\n\n/** @deprecated This method is part of the deprecated ProductDetails component. */\nProductDetails.getInitialData = async function ({\n sku,\n disableDropdownPreselection = false,\n optionsConfig,\n}) {\n const initialData = config.getConfig().models?.ProductDetails?.initialData;\n\n return initialData\n ? transformProductData(initialData)\n : fetchProductData(sku, {\n preselectFirstOption: !disableDropdownPreselection,\n anchors: optionsConfig?.anchorOptions,\n });\n};\n"],"names":["Product","title","breadcrumbs","galleryContent","infoContent","productContent","sku","outOfStock","shortDescription","description","attributes","images","options","giftCardOptions","downloadableOptions","price","specialPrice","className","children","quantity","actions","carouselConfig","zoomType","closeButton","props","RegularPriceLabel","useText","SpecialPriceLabel","OutOfStockLabel","ImagesLabel","zoom","setZoom","useState","galleryImages","image","key","alt","_a","jsx","Zoom","VComponent","localThumbnailsImages","jsxs","classes","_b","Carousel","_c","_d","GalleryGrid","_e","_f","_g","_h","_i","Overlay","gap","style","count","Children","child","ProductDetails","hideSku","hideQuantity","hideShortDescription","hideDescription","hideAttributes","hideURLParams","hideSelectedOptionValue","slots","initialData","carousel","optionsConfig","useACDL","onAddToCart","disableDropdownPreselection","AddToCartLabel","IncrementerLabel","DetailsLabel","ChooseOptionLabel","locale","setLocale","config","selectionsToUpdate","setSelectionsToUpdate","data","setData","values","setValues","initialQuantity","getValidatedQuantityFromUrl","defaultValues","valid","setValid","defaultSlotContext","hasProductViewOptionValueProduct","option","useEffect","dataEvent","events","payload","prev","updateDataEvent","localeEvent","fetchProductData","publishProductPageViewEvent","handleOnValues","useCallback","newValues","handleOptionSelected","selections","optionsUIDs","_","value","id","element","setUrlParams","next","processUpdates","previousOptionsUIDs","updatedOptionsUIDs","item","handleOnErrors","_errors","useMemo","label","__html","isDateValid","toDateString","Slot","Incrementer","quantityValue","renderOptions","Swatches","renderGiftCardOptions","giftCardAttributes","attr","validElements","giftCardAttr","index","giftCardData","prevOptions","optionValues","existingOption","opt","GiftCardOptions","uid","idx","field","newEnteredOptions","updatedData","updatedOptions","error","renderDownloadableOptions","downloadableAttributes","downloadableAttr","downloadableValue","DownloadableOptions","selected","prevUIDs","newOptionsUIDs","callback","attrs","nextSeparator","separator","Icon","Breadcrumbs","text","p","link","categories","domElement","vnode","_button","icon","buttonProps","button","Button","url","Image","PriceRange","toLanguageTag","_j","_k","Fragment","transformProductData"],"mappings":"kuCAuDO,MAAMA,GAA2C,CAAC,CACvD,MAAAC,EACA,YAAAC,EACA,eAAAC,EACA,YAAAC,EACA,eAAAC,EACA,IAAAC,EACA,WAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,WAAAC,GACA,OAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,oBAAAC,EACA,MAAAC,EACA,aAAAC,GACA,UAAAC,GACA,SAAAC,EACA,SAAAC,GACA,QAAAC,EACA,eAAAC,EACA,SAAAC,GAAW,UACX,YAAAC,GAAc,GACd,GAAGC,CACL,IAAM,0BAEE,MAAAC,GAAoBC,EAAQ,gCAAgC,EAAE,MAC9DC,GAAoBD,EAAQ,gCAAgC,EAAE,MAC9DE,GAAkBF,EAAQ,8BAA8B,EAAE,MAC1DG,EAAcH,EAAQ,yBAAyB,EAAE,MAEjD,CAACI,EAAMC,CAAO,EAAIC,EAAwB,IAAI,EAE9CC,EAAgBtB,GAAA,MAAAA,EAAQ,OAC5BA,EAAO,IAAI,CAACuB,EAAOC,IAAQ,OACnB,MAAAC,IACJC,EAAApC,GAAA,YAAAA,EAAO,QAAP,YAAAoC,EAAc,YACdR,GAAA,YAAAA,EAAa,QAAQ,YAAa5B,EAAM,MAAM,SAAS,SAAS,GAC7D,QAAQ,QAAS,OAAOkC,EAAM,CAAC,GAC/B,QAAQ,UAAW,OAAOxB,EAAO,MAAM,IAC5C,OAAOW,KAAa,OACjBgB,EAAAC,GAAA,CAAK,YAAAhB,GACJ,SAAAe,EAACE,EAAA,CAEC,KAAMN,EACN,QAAS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GyB,CAAmB,CAAA,CAAA,CACnC,CAAA,EAIR,CAEJ,EAGAjC,GAAe,eAAiB,eAAgB,CAC9C,IAAAtD,EACA,4BAAAoE,EAA8B,GAC9B,cAAAH,CACF,EAAG,SACD,MAAMF,GAAczB,GAAAP,EAAA4C,GAAO,UAAU,EAAE,SAAnB,YAAA5C,EAA2B,iBAA3B,YAAAO,EAA2C,YAE/D,OAAOyB,EACHmH,GAAqBnH,CAAW,EAChCkC,GAAiBjG,EAAK,CACpB,qBAAsB,CAACoE,EACvB,QAASH,GAAA,YAAAA,EAAe,aAAA,CACzB,CACP"}
@@ -0,0 +1,9 @@
1
+ import { HTMLAttributes } from 'preact/compat';
2
+ import { Container } from '@dropins/tools/types/elsie/src/lib';
3
+ import { ProductModel } from '../../data/models';
4
+
5
+ export interface ProductDownloadableOptionsProps extends HTMLAttributes<HTMLDivElement> {
6
+ scope?: string;
7
+ }
8
+ export declare const ProductDownloadableOptions: Container<ProductDownloadableOptionsProps, ProductModel | null>;
9
+ //# sourceMappingURL=ProductDownloadableOptions.d.ts.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * ADOBE CONFIDENTIAL
3
+ * __________________
4
+ * Copyright 2024 Adobe
5
+ * All Rights Reserved.
6
+ * __________________
7
+ * NOTICE: All information contained herein is, and remains
8
+ * the property of Adobe and its suppliers, if any. The intellectual
9
+ * and technical concepts contained herein are proprietary to Adobe
10
+ * and its suppliers and are protected by all applicable intellectual
11
+ * property laws, including trade secret and copyright laws.
12
+ * Dissemination of this information or reproduction of this material
13
+ * is strictly forbidden unless prior written permission is obtained
14
+ * from Adobe.
15
+ */
16
+ export * from './ProductDownloadableOptions';
17
+ export { ProductDownloadableOptions as default } from './ProductDownloadableOptions';
18
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,3 @@
1
+ export * from './ProductDownloadableOptions/index'
2
+ import _default from './ProductDownloadableOptions/index'
3
+ export default _default
@@ -0,0 +1,4 @@
1
+ /*! Copyright 2026 Adobe
2
+ All Rights Reserved. */
3
+ import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{classes as p}from"@dropins/tools/lib.js";import{s as f}from"../chunks/getProductConfigurationValues.js";import"@dropins/tools/event-bus.js";import{g as D}from"../chunks/getFetchedProductData.js";import{D as b}from"../chunks/DownloadableOptions2.js";import{u as g,g as h}from"../chunks/useProductData.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/i18n.js";const I=({initialData:c=null,scope:m,children:w,...o})=>{const{data:s,values:u}=g({scope:m,initialData:c,initialValues:{optionsUIDs:[]}}),d=(e,l)=>{const t=u.optionsUIDs||[];let a;l?t.includes(e)?a=t:a=[...t,e]:a=t.filter(n=>n!==e),f(n=>({...n,optionsUIDs:a}))},i=h(s,"ac_downloadable");return!s||i.length===0?null:r("div",{...o,className:p(["pdp-downloadable-options",o.className]),children:i.map((e,l)=>{var t,a;return r(b,{label:e.label,value:e.value,onLinkChange:d,currency:(a=(t=s.prices)==null?void 0:t.final)==null?void 0:a.currency,className:o.className},`downloadable-${l}`)})})};I.getInitialData=D;export{I as ProductDownloadableOptions,I as default};
4
+ //# sourceMappingURL=ProductDownloadableOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ProductDownloadableOptions.js","sources":["/@dropins/storefront-pdp/src/containers/ProductDownloadableOptions/ProductDownloadableOptions.tsx"],"sourcesContent":["/**\n * ADOBE CONFIDENTIAL\n * __________________\n * Copyright 2024 Adobe\n * All Rights Reserved.\n * __________________\n * NOTICE: All information contained herein is, and remains\n * the property of Adobe and its suppliers, if any. The intellectual\n * and technical concepts contained herein are proprietary to Adobe\n * and its suppliers and are protected by all applicable intellectual\n * property laws, including trade secret and copyright laws.\n * Dissemination of this information or reproduction of this material\n * is strictly forbidden unless prior written permission is obtained\n * from Adobe.\n */\n\nimport { HTMLAttributes } from 'preact/compat';\nimport { Container, classes } from '@adobe-commerce/elsie/lib';\nimport { ProductModel } from '@/pdp/data/models';\nimport {\n getFetchedProductData,\n setProductConfigurationValues,\n} from '@/pdp/api';\nimport { DownloadableOptions } from '@/pdp/components/DownloadableOptions';\nimport { useProductData, getAttributesById } from '@/pdp/lib/useProductData';\n\nexport interface ProductDownloadableOptionsProps\n extends HTMLAttributes<HTMLDivElement> {\n scope?: string;\n}\n\nexport const ProductDownloadableOptions: Container<\n ProductDownloadableOptionsProps,\n ProductModel | null\n> = ({ initialData = null, scope, children, ...props }) => {\n const { data, values } = useProductData({\n scope,\n initialData,\n initialValues: { optionsUIDs: [] },\n });\n\n const handleLinkChange = (uid: string, selected: boolean) => {\n const prevUIDs = values.optionsUIDs || [];\n let newOptionsUIDs;\n\n if (!selected) {\n newOptionsUIDs = prevUIDs.filter((id) => id !== uid);\n } else if (prevUIDs.includes(uid)) {\n newOptionsUIDs = prevUIDs;\n } else {\n newOptionsUIDs = [...prevUIDs, uid];\n }\n\n setProductConfigurationValues((prev) => ({\n ...prev,\n optionsUIDs: newOptionsUIDs,\n }));\n };\n\n const downloadableAttributes = getAttributesById(data, 'ac_downloadable');\n\n if (!data) return null;\n\n if (downloadableAttributes.length === 0) return null;\n\n return (\n <div\n {...props}\n className={classes(['pdp-downloadable-options', props.className])}\n >\n {downloadableAttributes.map((downloadable, index) => (\n <DownloadableOptions\n key={`downloadable-${index}`}\n label={downloadable.label}\n value={downloadable.value}\n onLinkChange={handleLinkChange}\n currency={data.prices?.final?.currency}\n className={props.className}\n />\n ))}\n </div>\n );\n};\n\nProductDownloadableOptions.getInitialData = getFetchedProductData;\n"],"names":["ProductDownloadableOptions","initialData","scope","children","props","data","values","useProductData","handleLinkChange","uid","selected","prevUIDs","newOptionsUIDs","id","setProductConfigurationValues","prev","downloadableAttributes","getAttributesById","jsx","classes","downloadable","index","DownloadableOptions","_b","_a","getFetchedProductData"],"mappings":"ugBA+Ba,MAAAA,EAGT,CAAC,CAAE,YAAAC,EAAc,KAAM,MAAAC,EAAO,SAAAC,EAAU,GAAGC,KAAY,CACzD,KAAM,CAAE,KAAAC,EAAM,OAAAC,CAAO,EAAIC,EAAe,CACtC,MAAAL,EACA,YAAAD,EACA,cAAe,CAAE,YAAa,CAAG,CAAA,CAAA,CAClC,EAEKO,EAAmB,CAACC,EAAaC,IAAsB,CACrD,MAAAC,EAAWL,EAAO,aAAe,CAAC,EACpC,IAAAM,EAECF,EAEMC,EAAS,SAASF,CAAG,EACbG,EAAAD,EAEAC,EAAA,CAAC,GAAGD,EAAUF,CAAG,EAJlCG,EAAiBD,EAAS,OAAQE,GAAOA,IAAOJ,CAAG,EAOrDK,EAA+BC,IAAU,CACvC,GAAGA,EACH,YAAaH,CAAA,EACb,CACJ,EAEMI,EAAyBC,EAAkBZ,EAAM,iBAAiB,EAIpE,MAFA,CAACA,GAEDW,EAAuB,SAAW,EAAU,KAG9CE,EAAC,MAAA,CACE,GAAGd,EACJ,UAAWe,EAAQ,CAAC,2BAA4Bf,EAAM,SAAS,CAAC,EAE/D,SAAuBY,EAAA,IAAI,CAACI,EAAcC,IACzC,SAAA,OAAAH,EAACI,EAAA,CAEC,MAAOF,EAAa,MACpB,MAAOA,EAAa,MACpB,aAAcZ,EACd,UAAUe,GAAAC,EAAAnB,EAAK,SAAL,YAAAmB,EAAa,QAAb,YAAAD,EAAoB,SAC9B,UAAWnB,EAAM,SAAA,EALZ,gBAAgBiB,CAAK,EAO7B,EAAA,CAAA,CACH,CAEJ,EAEArB,EAA2B,eAAiByB"}