@dropins/storefront-pdp 0.4.0-beta1 → 0.4.0-beta12

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 (39) hide show
  1. package/__mocks__/product-mocks.d.ts +157 -0
  2. package/api/fetch-graphql/fetch-graphql.d.ts +15 -0
  3. package/api/fetch-graphql/index.d.ts +15 -0
  4. package/api/getProductData/graphql/getProductData.graphql.d.ts +15 -0
  5. package/api/getProductData/index.d.ts +15 -0
  6. package/api/getRefinedProduct/getRefinedProduct.d.ts +1 -1
  7. package/api/getRefinedProduct/graphql/RefineProductQuery.graphql.d.ts +15 -0
  8. package/api/getRefinedProduct/index.d.ts +15 -0
  9. package/api/graphql/ProductFragment.graphql.d.ts +15 -0
  10. package/api/graphql/ProductOptionFragment.graphql.d.ts +15 -0
  11. package/api/index.d.ts +15 -0
  12. package/api/initialize/index.d.ts +15 -0
  13. package/chunks/getRefinedProduct.js +11 -11
  14. package/components/Carousel/index.d.ts +15 -0
  15. package/components/GalleryGrid/index.d.ts +15 -0
  16. package/components/Overlay/index.d.ts +15 -0
  17. package/components/PriceRange/index.d.ts +15 -0
  18. package/components/Product/Product.d.ts +1 -0
  19. package/components/Product/index.d.ts +15 -0
  20. package/components/Swatches/Swatches.d.ts +2 -8
  21. package/components/Swatches/index.d.ts +15 -0
  22. package/components/Zoom/Zoom.d.ts +1 -0
  23. package/components/Zoom/index.d.ts +15 -0
  24. package/components/index.d.ts +15 -0
  25. package/containers/ProductDetails/ProductDetails.d.ts +3 -1
  26. package/containers/ProductDetails/index.d.ts +15 -0
  27. package/containers/ProductDetails.js +1 -1
  28. package/containers/index.d.ts +15 -0
  29. package/data/models/acdl-models.d.ts +15 -0
  30. package/data/models/index.d.ts +15 -0
  31. package/data/models/product-model.d.ts +18 -2
  32. package/data/transforms/index.d.ts +15 -0
  33. package/data/transforms/product-transform.d.ts +1 -1
  34. package/i18n/en_US.json.d.ts +6 -1
  35. package/lib/date.d.ts +15 -0
  36. package/lib/url-params.d.ts +15 -0
  37. package/package.json +1 -1
  38. package/render/index.d.ts +15 -0
  39. package/render.js +2 -2
@@ -0,0 +1,157 @@
1
+ export declare const MOCK_DATA_BUNDLE: {
2
+ __typename: string;
3
+ id: string;
4
+ sku: string;
5
+ name: string;
6
+ shortDescription: string;
7
+ metaDescription: string;
8
+ metaKeyword: string;
9
+ metaTitle: string;
10
+ description: string;
11
+ inStock: boolean;
12
+ addToCartAllowed: boolean;
13
+ url: string;
14
+ urlKey: string;
15
+ externalId: string;
16
+ images: {
17
+ url: string;
18
+ label: string;
19
+ roles: string[];
20
+ }[];
21
+ options: {
22
+ id: string;
23
+ title: string;
24
+ required: boolean;
25
+ multi: null;
26
+ values: {
27
+ id: string;
28
+ title: string;
29
+ inStock: boolean;
30
+ __typename: string;
31
+ quantity: number;
32
+ isDefault: boolean;
33
+ product: {
34
+ sku: string;
35
+ shortDescription: string;
36
+ metaDescription: string;
37
+ metaKeyword: string;
38
+ metaTitle: string;
39
+ name: string;
40
+ price: {
41
+ final: {
42
+ amount: {
43
+ value: number;
44
+ currency: string;
45
+ };
46
+ };
47
+ regular: {
48
+ amount: {
49
+ value: number;
50
+ currency: string;
51
+ };
52
+ };
53
+ roles: string[];
54
+ };
55
+ };
56
+ }[];
57
+ }[];
58
+ priceRange: {
59
+ maximum: {
60
+ final: {
61
+ amount: {
62
+ value: number;
63
+ currency: string;
64
+ };
65
+ };
66
+ regular: {
67
+ amount: {
68
+ value: number;
69
+ currency: string;
70
+ };
71
+ };
72
+ roles: string[];
73
+ };
74
+ minimum: {
75
+ final: {
76
+ amount: {
77
+ value: number;
78
+ currency: string;
79
+ };
80
+ };
81
+ regular: {
82
+ amount: {
83
+ value: number;
84
+ currency: string;
85
+ };
86
+ };
87
+ roles: string[];
88
+ };
89
+ };
90
+ };
91
+ export declare const MOCK_DATA_BUNDLE_TRANSFORMED: {
92
+ name: string;
93
+ sku: string;
94
+ addToCartAllowed: boolean;
95
+ inStock: boolean;
96
+ shortDescription: string;
97
+ metaDescription: string;
98
+ metaKeyword: string;
99
+ metaTitle: string;
100
+ description: string;
101
+ images: {
102
+ url: string;
103
+ label: string;
104
+ width: number;
105
+ height: number;
106
+ }[];
107
+ prices: {
108
+ final: {
109
+ amount: number;
110
+ currency: string;
111
+ };
112
+ regular: {
113
+ amount: number;
114
+ currency: string;
115
+ };
116
+ visible: boolean;
117
+ };
118
+ options: {
119
+ id: string;
120
+ type: "text" | "image" | "color" | "dropdown";
121
+ typename: "ProductViewOptionValueProduct" | "ProductViewOptionValueSwatch" | "ProductViewOptionValueConfiguration";
122
+ label: string;
123
+ required: boolean;
124
+ multiple: boolean;
125
+ items: {
126
+ id: string;
127
+ inStock: boolean;
128
+ label: string;
129
+ selected: boolean;
130
+ value: string;
131
+ product: {
132
+ sku: string;
133
+ shortDescription: string;
134
+ metaDescription: string;
135
+ metaKeyword: string;
136
+ metaTitle: string;
137
+ name: string;
138
+ price: {
139
+ final: {
140
+ amount: {
141
+ value: number;
142
+ currency: string;
143
+ };
144
+ };
145
+ regular: {
146
+ amount: {
147
+ value: number;
148
+ currency: string;
149
+ };
150
+ };
151
+ roles: string[];
152
+ };
153
+ };
154
+ }[];
155
+ }[];
156
+ };
157
+ //# sourceMappingURL=product-mocks.d.ts.map
@@ -1,3 +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
+ */
1
16
  export declare const setEndpoint: (endpoint: string) => void, setFetchGraphQlHeader: (key: string, value: string | null) => void, removeFetchGraphQlHeader: (key: string) => void, setFetchGraphQlHeaders: (header: import('@adobe/fetch-graphql').Header) => void, fetchGraphQl: <T = any>(query: string, options?: import('@adobe/fetch-graphql').FetchOptions | undefined) => Promise<{
2
17
  errors?: import('@adobe/fetch-graphql').FetchQueryError | undefined;
3
18
  data: T;
@@ -1,2 +1,17 @@
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
+ */
1
16
  export * from './fetch-graphql';
2
17
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,17 @@
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
+ */
1
16
  export declare const GET_PRODUCT_DATA: string;
2
17
  //# sourceMappingURL=getProductData.graphql.d.ts.map
@@ -1,2 +1,17 @@
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
+ */
1
16
  export * from './getProductData';
2
17
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import { ProductModel } from '../../data/models';
2
2
 
3
- export declare const getRefinedProduct: (sku: string, optionUIDs: string[], anchorOptions?: string[]) => Promise<ProductModel | null>;
3
+ export declare const getRefinedProduct: (sku: string, optionUIDs: string[], anchorOptions?: string[], isBundle?: boolean) => Promise<ProductModel | null>;
4
4
  //# sourceMappingURL=getRefinedProduct.d.ts.map
@@ -1,2 +1,17 @@
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
+ */
1
16
  export declare const REFINE_PRODUCT_QUERY: string;
2
17
  //# sourceMappingURL=RefineProductQuery.graphql.d.ts.map
@@ -1,2 +1,17 @@
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
+ */
1
16
  export * from './getRefinedProduct';
2
17
  //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1,17 @@
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
+ */
1
16
  export declare const ProductFragment: string;
2
17
  //# sourceMappingURL=ProductFragment.graphql.d.ts.map
@@ -1,2 +1,17 @@
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
+ */
1
16
  export declare const ProductOptionFragment = "\nfragment ProductOptionFragment on ProductViewOption {\n id\n title\n required\n multi\n values {\n id\n title\n inStock\n __typename\n ... on ProductViewOptionValueProduct {\n title\n quantity\n isDefault\n product {\n sku\n shortDescription\n metaDescription\n metaKeyword\n metaTitle\n name\n price {\n final {\n amount {\n value\n currency\n }\n }\n regular {\n amount {\n value\n currency\n }\n }\n roles\n }\n }\n }\n ... on ProductViewOptionValueSwatch {\n id\n title\n type\n value\n inStock\n }\n }\n }\n";
2
17
  //# sourceMappingURL=ProductOptionFragment.graphql.d.ts.map
package/api/index.d.ts CHANGED
@@ -1,3 +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
+ */
1
16
  export * from './initialize';
2
17
  export * from './fetch-graphql';
3
18
  export * from './getProductData';
@@ -1,2 +1,17 @@
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
+ */
1
16
  export * from './initialize';
2
17
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import{c as h}from"./initialize.js";import{FetchGraphQL as Q}from"@dropins/tools/fetch-graphql.js";const{setEndpoint:W,setFetchGraphQlHeader:Z,removeFetchGraphQlHeader:R,setFetchGraphQlHeaders:tt,fetchGraphQl:A,getConfig:et}=new Q().getMethods();function D(e){var o,u,n;const r=e?{name:e.name,sku:e.sku,addToCartAllowed:e.addToCartAllowed,inStock:e.inStock,shortDescription:e.shortDescription,metaDescription:e.metaDescription,metaKeyword:e.metaKeyword,metaTitle:e.metaTitle,description:e.description,images:K(e),prices:j(e),attributes:M(e),options:N(e),optionUIDs:e.optionUIDs,url:e.url,urlKey:e.urlKey,externalId:e.externalId,externalParentId:e.externalParentId,variantSku:e.variantSku}:null,t=(n=(u=(o=h.getConfig())==null?void 0:o.models)==null?void 0:u.ProductDetails)==null?void 0:n.transform;return t&&r?t(r):r}function K(e){var r;return(r=e.images)==null?void 0:r.map(t=>(t.url=t.url.replace(/^https?:/,""),t))}function M(e){var r,t;return(t=(r=e.attributes)==null?void 0:r.filter(({roles:o})=>(o==null?void 0:o.indexOf("visible_in_pdp"))!==-1))==null?void 0:t.map(({label:o,value:u,name:n})=>({id:n,label:o,value:u.toString().split(",").join(", ")}))}function N(e){const{options:r,optionUIDs:t}=e;return r==null?void 0:r.map(({id:o,title:u,required:n,multi:c,values:i})=>{var d,f;const l=(d=i==null?void 0:i[0])==null?void 0:d.__typename;let a=i==null?void 0:i[0].type;return((f=i==null?void 0:i[0])==null?void 0:f.__typename)==="ProductViewOptionValueProduct"?a=void 0:a?a=a.replace("COLOR_HEX","color").replace("TEXT","text").replace("IMAGE","image"):a="dropdown",{id:o,type:a,typename:l,label:u,required:n,multiple:c,items:i==null?void 0:i.map(({id:m,title:g,inStock:p,value:P})=>({id:m,label:g,inStock:p,value:(a==null?void 0:a.toLowerCase())==="dropdown"?m:P==null?void 0:P.replace(/^https?:/,""),selected:(t==null?void 0:t.indexOf(m))>-1}))}})}function j(e){var d,f,m,g,p;const{price:r,priceRange:t,__typename:o}=e;function u(){var k;const P=r.regular.amount.value,y=((k=r.final)==null?void 0:k.amount.value)??r.regular.amount.value,w=r.regular.amount.currency==="NONE"?"USD":r==null?void 0:r.regular.amount.currency;return[P,y,y,w]}function n(){var x,_,b,S,E,T,C,O,v,F,V,$;const P=(x=t==null?void 0:t.minimum)==null?void 0:x.final.amount.value,y=(_=t==null?void 0:t.maximum)==null?void 0:_.final.amount.value;let w;((S=(b=t==null?void 0:t.minimum)==null?void 0:b.regular)==null?void 0:S.amount.value)===((T=(E=t==null?void 0:t.maximum)==null?void 0:E.regular)==null?void 0:T.amount.value)&&(w=(O=(C=t==null?void 0:t.minimum)==null?void 0:C.regular)==null?void 0:O.amount.value);const k=((F=(v=t==null?void 0:t.minimum)==null?void 0:v.final)==null?void 0:F.amount.currency)==="NONE"?"USD":($=(V=t==null?void 0:t.minimum)==null?void 0:V.final)==null?void 0:$.amount.currency;return[w,P,y,k]}const[c,i,l,a]=o==="SimpleProductView"?u():n(),s=o==="SimpleProductView"?(d=r==null?void 0:r.roles)==null?void 0:d.includes("visible"):((m=(f=t==null?void 0:t.maximum)==null?void 0:f.roles)==null?void 0:m.includes("visible"))&&((p=(g=t==null?void 0:t.minimum)==null?void 0:g.roles)==null?void 0:p.includes("visible"));return l&&i===l?{regular:{amount:c,currency:a,variant:c&&i!==c?"strikethrough":"default"},final:{amount:l,currency:a,variant:"default"},visible:s}:{final:{minimumAmount:i,maximumAmount:l,currency:a},visible:s}}const U=`
1
+ import{c as B}from"./initialize.js";import{FetchGraphQL as et}from"@dropins/tools/fetch-graphql.js";const{setEndpoint:gt,setFetchGraphQlHeader:ht,removeFetchGraphQlHeader:wt,setFetchGraphQlHeaders:xt,fetchGraphQl:q,getConfig:bt}=new et().getMethods();function K(e,r){var i,u,o;const n=e?{name:e.name,sku:e.sku,addToCartAllowed:e.addToCartAllowed,inStock:e.inStock,shortDescription:e.shortDescription,metaDescription:e.metaDescription,metaKeyword:e.metaKeyword,metaTitle:e.metaTitle,description:e.description,images:rt(e),prices:mt(e,!!r),attributes:nt(e),options:ut(e),optionUIDs:at(e),url:e.url,urlKey:e.urlKey,externalId:e.externalId,externalParentId:e.externalParentId,variantSku:e.variantSku}:null,t=(o=(u=(i=B.getConfig())==null?void 0:i.models)==null?void 0:u.ProductDetails)==null?void 0:o.transform;return t&&n?t(n):n}function rt(e){var r;return(r=e.images)==null?void 0:r.map(n=>(n.url=n.url.replace(/^https?:/,""),n))}function nt(e){var r,n;return(n=(r=e.attributes)==null?void 0:r.filter(({roles:t})=>(t==null?void 0:t.indexOf("visible_in_pdp"))!==-1))==null?void 0:n.map(({label:t,value:i,name:u})=>({id:u,label:t,value:i.toString().split(",").join(", ")}))}function ut(e){const{options:r,optionUIDs:n}=e;return r==null?void 0:r.map(({id:t,title:i,required:u,multi:o,values:m})=>{var d,s;const a=(d=m==null?void 0:m[0])==null?void 0:d.__typename;let l=m==null?void 0:m[0].type;const c=((s=m==null?void 0:m[0])==null?void 0:s.__typename)==="ProductViewOptionValueProduct";return l?l=l.replace("COLOR_HEX","color").replace("TEXT","text").replace("IMAGE","image"):l="dropdown",{id:t,type:l,typename:a,label:i,required:u,multiple:o,items:c?it(m,n):ot(m,n,l)}})}function it(e,r){return e==null?void 0:e.map(({id:n,title:t,inStock:i,isDefault:u,product:o})=>({id:n,inStock:i,label:t,selected:(r==null?void 0:r.indexOf(n))>-1||u,value:n,product:o}))}function ot(e,r,n){return e==null?void 0:e.map(({id:t,title:i,inStock:u,value:o})=>({id:t,inStock:u,label:i,selected:(r==null?void 0:r.indexOf(t))>-1,value:(n==null?void 0:n.toLowerCase())==="dropdown"?t:o==null?void 0:o.replace(/^https?:/,"")}))}function mt(e,r){var E,x,H,I,L;const{price:n,priceRange:t,options:i,optionUIDs:u}=e;let{__typename:o}=e;function m(){var g;const P=n.regular.amount.value,f=((g=n.final)==null?void 0:g.amount.value)??n.regular.amount.value,y=n.regular.amount.currency==="NONE"?"USD":n==null?void 0:n.regular.amount.currency;return[P,f,f,y]}function a(){var b,_,S,V,T,C,D,A,F,$,G,M;const P=(b=t==null?void 0:t.minimum)==null?void 0:b.final.amount.value,f=(_=t==null?void 0:t.maximum)==null?void 0:_.final.amount.value;let y;((V=(S=t==null?void 0:t.minimum)==null?void 0:S.regular)==null?void 0:V.amount.value)===((C=(T=t==null?void 0:t.maximum)==null?void 0:T.regular)==null?void 0:C.amount.value)&&(y=(A=(D=t==null?void 0:t.minimum)==null?void 0:D.regular)==null?void 0:A.amount.value);const g=(($=(F=t==null?void 0:t.minimum)==null?void 0:F.final)==null?void 0:$.amount.currency)==="NONE"?"USD":(M=(G=t==null?void 0:t.minimum)==null?void 0:G.final)==null?void 0:M.amount.currency;return[y,P,f,g]}function l(){var S,V,T,C,D,A,F,$,G,M,X,Y;let P=0,f=0;i==null||i.forEach(k=>{var z;const j=k==null?void 0:k.values;if(j&&Array.isArray(j)){const h=j.map(p=>{var Q,N,J,W;return(W=(J=(N=(Q=p==null?void 0:p.product)==null?void 0:Q.price)==null?void 0:N.regular)==null?void 0:J.amount)==null?void 0:W.value}).filter(p=>p!==void 0),v=h.length>0?Math.max(...h):0;P+=v}else P+=0;(z=k==null?void 0:k.values)==null||z.forEach(h=>{var v,p,Q,N;u!=null&&u.includes(h.id)&&(f+=(N=(Q=(p=(v=h==null?void 0:h.product)==null?void 0:v.price)==null?void 0:p.final)==null?void 0:Q.amount)==null?void 0:N.value)})});const y=(S=t==null?void 0:t.minimum)==null?void 0:S.final.amount.value,g=(V=t==null?void 0:t.maximum)==null?void 0:V.final.amount.value;let b;((C=(T=t==null?void 0:t.minimum)==null?void 0:T.regular)==null?void 0:C.amount.value)===((A=(D=t==null?void 0:t.maximum)==null?void 0:D.regular)==null?void 0:A.amount.value)&&(b=($=(F=t==null?void 0:t.minimum)==null?void 0:F.regular)==null?void 0:$.amount.value);const _=((M=(G=t==null?void 0:t.minimum)==null?void 0:G.final)==null?void 0:M.amount.currency)==="NONE"?"USD":(Y=(X=t==null?void 0:t.minimum)==null?void 0:X.final)==null?void 0:Y.amount.currency;return r&&!u?[b,y,g,_]:P===(t==null?void 0:t.maximum.regular.amount.value)?[f,f,f,_]:[b,y,g,_]}const[c,d,s,w]=o==="SimpleProductView"?m():r?l():a(),O=o==="SimpleProductView"?(E=n==null?void 0:n.roles)==null?void 0:E.includes("visible"):((H=(x=t==null?void 0:t.maximum)==null?void 0:x.roles)==null?void 0:H.includes("visible"))&&((L=(I=t==null?void 0:t.minimum)==null?void 0:I.roles)==null?void 0:L.includes("visible"));return s&&d===s?{regular:{amount:c,currency:w,variant:c&&d!==c?"strikethrough":"default"},final:{amount:s,currency:w,variant:"default"},visible:O}:{final:{minimumAmount:d,maximumAmount:s,currency:w},visible:O}}function at(e){var n;let{optionUIDs:r}=e;return(n=e==null?void 0:e.options)==null||n.map(({values:t})=>{var u;((u=t==null?void 0:t[0])==null?void 0:u.__typename)==="ProductViewOptionValueProduct"&&!r&&(r=[],t==null||t.map(({id:o,isDefault:m})=>{m&&(r==null?void 0:r.indexOf(o))===-1&&r.push(o)}))}),r}const lt=`
2
2
  fragment ProductOptionFragment on ProductViewOption {
3
3
  id
4
4
  title
@@ -46,7 +46,7 @@ fragment ProductOptionFragment on ProductViewOption {
46
46
  }
47
47
  }
48
48
  }
49
- `,G=`
49
+ `,R=`
50
50
  fragment ProductFragment on ProductView {
51
51
  __typename
52
52
  id
@@ -137,16 +137,16 @@ fragment ProductFragment on ProductView {
137
137
  }
138
138
  }
139
139
 
140
- ${U}
141
- `,q=`
140
+ ${lt}
141
+ `,tt=`
142
142
  query GET_PRODUCT_DATA($skus: [String]) {
143
143
  products(skus: $skus) {
144
144
  ...ProductFragment
145
145
  }
146
146
  }
147
147
 
148
- ${G}
149
- `,rt=async e=>{var u,n,c,i,l;const r=(i=(c=(n=(u=h)==null?void 0:u.getConfig())==null?void 0:n.models)==null?void 0:c.ProductDetails)==null?void 0:i.initialData;if(r)return D(r);const{data:t}=await A(q,{method:"GET",variables:{skus:[e]}}),o=(l=t==null?void 0:t.products)==null?void 0:l[0];return D(o)},H=`
148
+ ${R}
149
+ `;function Z(e){return e.some(r=>(r==null?void 0:r.__typename)==="ProductViewOptionValueProduct")}const _t=async e=>{var u,o,m,a,l,c,d;const r=(a=(m=(o=(u=B)==null?void 0:u.getConfig())==null?void 0:o.models)==null?void 0:m.ProductDetails)==null?void 0:a.initialData;let n=!!((l=r==null?void 0:r.options)!=null&&l.some(s=>Z(s.values)));if(r)return K(r,!!n);const{data:t}=await q(tt,{method:"GET",variables:{skus:[e]}}),i=(c=t==null?void 0:t.products)==null?void 0:c[0];return n=!!((d=i==null?void 0:i.options)!=null&&d.some(s=>Z(s.values))),K(i,!!n)},ct=`
150
150
  query REFINE_PRODUCT_QUERY(
151
151
  $optionIds: [String!]!
152
152
  $sku: String!
@@ -167,11 +167,11 @@ query REFINE_PRODUCT_QUERY(
167
167
  # %extendedPlaceholder%
168
168
  }
169
169
 
170
- ${G}
171
- `;async function I(e,r){const t=L(r),o=B(t,e),u=H.replace("# %extendedPlaceholder%",o),{data:n}=await A(u,{method:"GET",variables:{optionIds:r,sku:e}});return n}const nt=async(e,r,t)=>{var d,f,m,g;const o=await I(e,r);if(!o)return null;let{products:u,refineProduct:n,...c}=o;const i=u==null?void 0:u[0],l=X(Object.values(c),i.options,t);if(t!=null&&t.length&&n===null){r=Y(l,r,t);const p=await I(e,r);n=p==null?void 0:p.refineProduct}const a=D({...n||i,sku:i.sku,name:i.name,externalParentId:i==null?void 0:i.externalId,options:l,optionUIDs:r,variantSku:(n==null?void 0:n.__typename)==="SimpleProductView"?n==null?void 0:n.sku:void 0}),s=(g=(m=(f=(d=h)==null?void 0:d.getConfig())==null?void 0:f.models)==null?void 0:m.ProductDetails)==null?void 0:g.fallbackData;return s?s(i,a):a};function L(e){if(e.length<2)return[e];const r=[];return e.forEach(t=>{const o=[];e.forEach(u=>{t!==u&&o.push(u)}),r.push(o)}),r}function B(e,r){return e.map((t,o)=>`
172
- ProductOption${o}: refineProduct(
170
+ ${R}
171
+ `;async function U(e,r,n){var m;if(n)return{...(m=(await q(tt,{method:"GET",variables:{skus:[e]}})).data)==null?void 0:m.products[0],optionUIDs:r};const t=st(r),i=dt(t,e),u=ct.replace("# %extendedPlaceholder%",i),{data:o}=await q(u,{method:"GET",variables:{optionIds:r,sku:e}});return o}const kt=async(e,r,n,t)=>{var s,w,O,E;let i;if(i=await U(e,r,t),!i)return null;if(t)return K({...i,optionUIDs:r},!0);let{products:u,refineProduct:o,...m}=i;const a=u==null?void 0:u[0],l=ft(Object.values(m),a.options,n);if(n!=null&&n.length&&o===null){r=Pt(l,r,n);const x=await U(e,r);o=x==null?void 0:x.refineProduct}const c=K({...o||a,sku:a.sku,name:a.name,externalParentId:a==null?void 0:a.externalId,options:l,optionUIDs:r,variantSku:(o==null?void 0:o.__typename)==="SimpleProductView"?o==null?void 0:o.sku:void 0}),d=(E=(O=(w=(s=B)==null?void 0:s.getConfig())==null?void 0:w.models)==null?void 0:O.ProductDetails)==null?void 0:E.fallbackData;return d?d(a,c):c};function st(e){if(e.length<2)return[e];const r=[];return e.forEach(n=>{const t=[];e.forEach(i=>{n!==i&&t.push(i)}),r.push(t)}),r}function dt(e,r){return e.map((n,t)=>`
172
+ ProductOption${t}: refineProduct(
173
173
  optionIds: [
174
- ${t.map(u=>`"${u}"`).join(", ")}
174
+ ${n.map(i=>`"${i}"`).join(", ")}
175
175
  ]
176
176
  sku: "${r}"
177
177
  ) {
@@ -181,4 +181,4 @@ ${G}
181
181
  }
182
182
  }
183
183
  }
184
- `).join("")}function X(e,r,t){const o=Object.values(e).filter(n=>!!n).reduce((n,c)=>c.options?[...n,...c.options]:[...n],[]),u=new Map(r.map(n=>[n.id,n]));return o.forEach(n=>{t!=null&&t.includes(n.id)||u.set(n.id,n)}),[...u.values()]}function Y(e,r,t){const o=[];let u;return e.forEach(n=>{var c,i,l,a;t.includes(n.id)?u=((i=(c=n.values)==null?void 0:c.find(s=>r.includes(s==null?void 0:s.id)))==null?void 0:i.id)||((l=n.values[0])==null?void 0:l.id):u=(a=n.values[0])==null?void 0:a.id,o.push(u)}),o}export{Z as a,tt as b,rt as c,nt as d,A as f,et as g,R as r,W as s};
184
+ `).join("")}function ft(e,r,n){const t=Object.values(e).filter(u=>!!u).reduce((u,o)=>o.options?[...u,...o.options]:[...u],[]),i=new Map(r.map(u=>[u.id,u]));return t.forEach(u=>{n!=null&&n.includes(u.id)||i.set(u.id,u)}),[...i.values()]}function Pt(e,r,n){const t=[];let i;return e.forEach(u=>{var o,m,a,l;n.includes(u.id)?i=((m=(o=u.values)==null?void 0:o.find(c=>r.includes(c==null?void 0:c.id)))==null?void 0:m.id)||((a=u.values[0])==null?void 0:a.id):i=(l=u.values[0])==null?void 0:l.id,t.push(i)}),t}export{ht as a,xt as b,_t as c,kt as d,q as f,bt as g,wt as r,gt as s};
@@ -1,3 +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
+ */
1
16
  export * from './Carousel';
2
17
  export { Carousel as default } from './Carousel';
3
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +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
+ */
1
16
  export * from './GalleryGrid';
2
17
  export { GalleryGrid as default } from './GalleryGrid';
3
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +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
+ */
1
16
  export * from './Overlay';
2
17
  export { Overlay as default } from './Overlay';
3
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +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
+ */
1
16
  export * from './PriceRange';
2
17
  export { PriceRange as default } from './PriceRange';
3
18
  //# sourceMappingURL=index.d.ts.map
@@ -24,6 +24,7 @@ export interface ProductProps extends Omit<HTMLAttributes<HTMLDivElement>, 'titl
24
24
  quantity?: VNode;
25
25
  carouselConfig?: ProductCarouselConfig;
26
26
  zoomType?: 'zoom' | 'overlay';
27
+ closeButton?: boolean;
27
28
  }
28
29
  export declare const Product: FunctionComponent<ProductProps>;
29
30
  export {};
@@ -1,3 +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
+ */
1
16
  export * from './Product';
2
17
  export { Product as default } from './Product';
3
18
  //# sourceMappingURL=index.d.ts.map
@@ -24,14 +24,7 @@ type Selection = {
24
24
  };
25
25
  };
26
26
  export interface SwatchesProps extends HTMLAttributes<HTMLDivElement> {
27
- options: Array<{
28
- id: string;
29
- type: (typeof supportedTypes)[number];
30
- label: string;
31
- required?: boolean;
32
- multiple?: boolean;
33
- items: OptionValue[];
34
- }>;
27
+ options: Array<Option>;
35
28
  hideSelectedValue?: boolean;
36
29
  defaultOptions?: string[];
37
30
  selectionsToUpdate?: Option[];
@@ -39,6 +32,7 @@ export interface SwatchesProps extends HTMLAttributes<HTMLDivElement> {
39
32
  onErrors?: (errors: {
40
33
  [id: string]: string;
41
34
  }) => void;
35
+ selectedUIDs?: string[];
42
36
  }
43
37
  export declare const Swatches: FunctionComponent<SwatchesProps>;
44
38
  export {};
@@ -1,3 +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
+ */
1
16
  export * from './Swatches';
2
17
  export { Swatches as default } from './Swatches';
3
18
  //# sourceMappingURL=index.d.ts.map
@@ -3,6 +3,7 @@ import { FunctionComponent, VNode } from 'preact';
3
3
  export interface ZoomProps {
4
4
  children: VNode[] | VNode;
5
5
  scale?: number;
6
+ closeButton?: boolean;
6
7
  }
7
8
  export declare const Zoom: FunctionComponent<ZoomProps>;
8
9
  //# sourceMappingURL=Zoom.d.ts.map
@@ -1,3 +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
+ */
1
16
  export * from './Zoom';
2
17
  export { Zoom as default } from './Zoom';
3
18
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +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
+ */
1
16
  export * from './Carousel';
2
17
  export * from './Product';
3
18
  export * from './GalleryGrid';
@@ -4,7 +4,7 @@ import { ButtonProps } from '@dropins/tools/types/elsie/src/components';
4
4
  import { ProductModel } from '../../data/models';
5
5
 
6
6
  type IconType = keyof typeof import('@dropins/tools/types/elsie/src/icons');
7
- type Values = {
7
+ export type Values = {
8
8
  sku: string;
9
9
  quantity: number;
10
10
  optionsUIDs?: string[];
@@ -74,6 +74,8 @@ export interface ProductDetailsProps extends HTMLAttributes<HTMLDivElement> {
74
74
  optionsConfig?: OptionsConfig;
75
75
  useACDL?: boolean;
76
76
  onAddToCart?: (values: Values) => void;
77
+ zoomType?: 'zoom' | 'overlay';
78
+ closeButton?: boolean;
77
79
  }
78
80
  export declare const ProductDetails: Container<ProductDetailsProps, ProductModel | null>;
79
81
  export {};
@@ -1,3 +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
+ */
1
16
  export * from './ProductDetails';
2
17
  export { ProductDetails as default } from './ProductDetails';
3
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- import*as pe from"@dropins/tools/preact-compat.js";import{useState as Z,Children as ce,useRef as Ae,useMemo as we,useEffect as re,useCallback as C}from"@dropins/tools/preact-compat.js";import{debounce as Le,classes as x,VComponent as U,toLanguageTag as Ne,Slot as G}from"@dropins/tools/lib.js";import{Button as Pe,Icon as ve,Price as Se,Picker as Ue,ColorSwatch as He,ImageSwatch as Ve,TextSwatch as ze,Incrementer as qe,Breadcrumbs as je,Image as De}from"@dropins/tools/components.js";import{jsxs as H,jsx as t,Fragment as fe}from"@dropins/tools/preact-jsx-runtime.js";import{useText as z}from"@dropins/tools/i18n.js";import{cloneElement as Ge}from"@dropins/tools/preact.js";import{c as Ie,d as $e}from"../chunks/getRefinedProduct.js";import{events as Fe}from"@dropins/tools/event-bus.js";import{c as Me}from"../chunks/initialize.js";import"@dropins/tools/fetch-graphql.js";const Ke=e=>pe.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},pe.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),Qe=e=>pe.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},pe.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 5.64001L5.62988 18.37",stroke:"currentColor"}),pe.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 18.37L5.62988 5.64001",stroke:"currentColor"})),Xe=24,ge=16,_e=2,Ze="32";var Oe=(e=>(e[e.small=16]="small",e[e.medium=24]="medium",e[e.large=64]="large",e))(Oe||{});const be=({show:e=1,scrollbar:d=!1,peak:h=!1,arrows:_=!1,controls:p="dots",arrowsOnMainImage:A=!1,loop:u=!1,gap:w=null,direction:l="horizontal",width:q="100%",height:c="100%",defaultIndex:m=0,className:E,children:I,thumbnails:F=null,isZoomed:S,...P})=>{const b=z("PDP.Carousel.label").label,r=z("PDP.Carousel.Slide.label").label,D=z("PDP.Carousel.Previous.label").label,B=z("PDP.Carousel.Next.label").label,N=z("PDP.Carousel.Controls.label").label,ee=z("PDP.Carousel.Controls.Button.label").label,[n,J]=Z(()=>ke(e)),$=Math.ceil(ce.count(I)/n),T=h?Xe:0,K=w?Oe[w]:0,Y=ce.count(I)%n,[v,ie]=Z(u?m+1:m),le=Ae([]),[ae,se]=Z(0),[te,he]=Z(0),oe=we(()=>ce.toArray(F),[F]),M=we(()=>{const a=ce.toArray(I).reduce((i,L,g)=>g%n===0?[...i,[L]]:[...i.slice(0,-1),[...i[i.length-1],L]],[]);return!u||a.length===1?a:u&&ce.count(I)%n===0?[a[$-1]].concat(a).concat([a[0],a[1]]):[ce.toArray(I).slice(-n)].concat(a).concat([a[0],a[1]])},[I,n,$,u]),j=Ae(null),V=Ae(null),k=p==="thumbnailsRow"||p==="thumbnailsColumn";re(()=>{const a=document.body,i=Le(()=>{var R,ne;se(((R=j.current)==null?void 0:R.offsetWidth)??0),he(((ne=j.current)==null?void 0:ne.offsetHeight)??0);const g=window.innerWidth,W=ke(e,g);W!==n&&J(W)},50),L=new ResizeObserver(i);return L.observe(a),()=>{L.unobserve(a)}},[n,e]);const o=C(a=>{const i=u?a-1:a,L=le==null?void 0:le.current[0],g=(L==null?void 0:L.offsetWidth)+ge,W=(L==null?void 0:L.offsetHeight)+ge,R=V.current,ne=p==="thumbnailsRow",ye=p==="thumbnailsColumn",de=ne?R==null?void 0:R.offsetWidth:R==null?void 0:R.offsetHeight,X=ne?g:W;(ne||ye)&&de&&(X*(i+1)>de&&(R.style.scrollBehavior="smooth",ne?R.scrollLeft=(i+_e)*X:R.scrollTop=(i+_e)*X),(ne?R.scrollLeft:R.scrollTop)>X*i&&(R.style.scrollBehavior="smooth",ne?R.scrollLeft=(i-_e)*X:R.scrollTop=(i-_e)*X))},[p,u]);re(()=>{o(v)},[v,o]);const s=C((a,i,L)=>{k&&o(a);const g=j.current,W=T?g.offsetWidth-T:g.offsetWidth-T+K;if(!Array.from(g.querySelectorAll("[data-index]")).filter(de=>{const X=Number(de.getAttribute("data-index"));return!isNaN(X)&&X>-1})[a])return;if(L){const de=a===0?$:0,X=W*($+(Y||n)/n);if(g.scrollLeft>=0&&g.scrollLeft<W-5){s(1,!0);return}if(g.scrollLeft>X-W&&g.scrollLeft<=X){s($,!0);return}g.style.scrollBehavior="auto",g.scrollLeft=de===0?0:X,s(de===0?1:$,!0);return}const ye=(g.offsetWidth-K)/n*M[a].length-T;g.style.scrollBehavior=i?"smooth":"auto",g.scrollLeft=M[a].length===n?W*a:W*(a-1)+ye},[K,$,T,n,Y,M,o,p]),y=C(()=>{if(u){const i=v-1;s(i,!0,v===1);return}const a=v<=0?0:v-1;s(a,!0)},[v,s,u]),f=C(()=>{const a=M.length-1;if(u){const L=v+1;s(L,!0,v===$);return}const i=v>=a?a:v+1;s(i,!0)},[M.length,u,v,s,$]);re(()=>{const a=i=>{i.key==="ArrowLeft"&&(i.preventDefault(),y()),i.key==="ArrowRight"&&(i.preventDefault(),f())};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[f,y]),re(()=>{s(u?m+1:m,!1)},[m,s,u]);const O=Le(()=>{const a=j.current,i=T?a.offsetWidth-T:a.offsetWidth-T+K,L=a.scrollLeft/i,g=Math.round(L)-L<1?Math.round(L):Math.ceil(L);if(k&&o(g),u){const W=i*($+(Y||n)/n);if(Math.ceil(a.scrollLeft)>=Math.ceil(W)-5){a.style.scrollBehavior="auto",a.scrollLeft=a.offsetWidth*1+(Math.ceil(a.scrollLeft)-Math.ceil(W)-T);return}if(a.scrollLeft===0){a.style.scrollBehavior="auto",a.scrollLeft=W-a.offsetWidth+T;return}}v!==g&&ie(g)},100);re(()=>{const a=j.current;return a==null||a.addEventListener("scroll",O),()=>{a==null||a.removeEventListener("scroll",O)}},[O]);const Q=(a,i,L)=>t(Pe,{className:x([["pdp-carousel__button",!a],[`pdp-carousel__button--${i}`,!a],[`pdp-carousel__button--${p}`,a]]),style:{"--height":`${te}px`},variant:"tertiary","aria-label":i==="next"?B:D,onClick:L,disabled:u?!1:i==="next"?v>=M.length-1:v<1,children:t(ve,{className:x([["pdp-carousel__button__icon",!a],[`pdp-carousel__button__icon--${i}`,!a],[`pdp-carousel__button__icon--${p}--${i}`,a]]),size:Ze,source:Ke})}),ue=_&&M.length!=1&&Q(k,"prev",y),me=_&&M.length!=1&&Q(k,"next",f),Te=_&&M.length!=1&&Q(!1,"prev",y),We=_&&M.length!=1&&Q(!1,"next",f);return H("div",{role:"region","aria-roledescription":b,className:x(["pdp-carousel",["pdp-carousel--main-image-controls",A],["pdp-carousel--arrows",_&&!k],[`pdp-carousel--${p}`,k],E]),style:{"--flex-carousel":p==="thumbnailsColumn"?"row-reverse":"column","--gap":k?"0":"var(--spacing-small)","--width":q},...P,children:[t("div",{ref:j,className:x(["pdp-carousel__wrapper",`pdp-carousel__wrapper--${l}`,["pdp-carousel__wrapper--scrollbar",d],["pdp-carousel__wrapper--peak",h]]),style:{"--total-width":p==="thumbnailsColumn"?"81.6%":"100%","--height":p==="thumbnailsColumn"?"auto":c,"--gap":w?`var(--spacing-${w})`:"0px","--per-page":n},tabIndex:0,children:M.map((a,i)=>{const L=a.length<n;return t("div",{role:"group","aria-roledescription":r,"data-index":i,className:x(["pdp-carousel__slide",`pdp-carousel__slide--${l}`,["pdp-carousel__slide--active",v===i],["pdp-carousel__slide--orphan",L]]),style:{"--length":a.length},children:a},i)})}),!k&&H(fe,{children:[ue,me]}),k&&A&&H(fe,{children:[Te,We]}),p&&M.length!=1&&H("div",{className:x([[`pdp-carousel__controls__container--${p}`,k],["pdp-carousel__controls__container--no-arrows",!_||A]]),style:{"--width":p==="thumbnailsRow"?`${ae}px`:q,"--height":`${te}px`,"--nr-thumbnails":oe.length},children:[(k||S)&&!A&&ue,t("div",{ref:V,className:x([[`pdp-carousel__controls__wrapper--${p}`,k],["pdp-carousel__controls__wrapper",k]]),children:t("div",{role:"group","aria-label":N,className:x(["pdp-carousel__controls",[`pdp-carousel__controls--${p}`,k]]),children:(u?M.slice(0,$):M).map((a,i)=>{const L=u?$:M.length,g=u?v-1===i:v===i;return k?H("label",{className:x(["pdp-carousel__thumbnail__container"]),ref:W=>{W&&(le.current[i]=W)},children:[t("input",{type:"radio",name:"carousel-thumbnails","aria-label":ee.replace("{key}",String(i+1)).replace("{total}",String(L)),checked:g&&ae!==0,onChange:()=>{s(u?i+1:i,!0)},...P,className:x(["pdp-carousel__thumbnail",["pdp-carousel__thumbnail--selected",g&&ae!==0]])}),t("span",{className:x(["pdp-carousel__thumbnail__span"]),children:oe[i]})]},i):t("button",{"aria-label":ee.replace("{key}",String(i+1)).replace("{total}",String(L)),onClick:()=>{s(u?i+1:i,!0)},className:x(["pdp-carousel__controls__button",["pdp-carousel__controls__button--active",g]])},i)})})}),(k||S)&&!A&&me]})]})};function ke(e,d=0){if(typeof e=="number")return e;const{small:h,medium:_,large:p}=e,u=[{breakpoint:1024,value:p},{breakpoint:786,value:_},{breakpoint:0,value:h}].find(({breakpoint:w})=>d>w);return u?u.value:h}const Ye=({title:e,breadcrumbs:d,galleryContent:h,infoContent:_,productContent:p,sku:A,outOfStock:u,shortDescription:w,description:l,attributes:q,images:c,options:m,price:E,specialPrice:I,className:F,children:S,quantity:P,actions:b,carouselConfig:r,zoomType:D="zoom",...B})=>{var v,ie,le,ae,se,te,he,oe,M;const N=z("PDP.Product.RegularPrice.label").label,ee=z("PDP.Product.SpecialPrice.label").label,n=z("PDP.Product.OutOfStock.label").label,J=z("PDP.Product.Image.label").label,[$,T]=Z(null),K=c!=null&&c.length?c.map((j,V)=>{var o;const k=(o=e==null?void 0:e.props)!=null&&o.children?J==null?void 0:J.replace("{product}",e.props.children.toString()).replace("{key}",String(V+1)).replace("{total}",String(c.length)):void 0;return D==="zoom"?t(rt,{children:t(U,{node:j,loading:V===0?"eager":"lazy",alt:k},V)}):t(U,{node:j,loading:V===0?"eager":"lazy",alt:k,onClick:()=>T(V)},V)}):t("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0}),Y=(v=r==null?void 0:r.thumbnails)!=null&&v.length?r.thumbnails.map((j,V)=>{var k;return t(U,{node:j,loading:(r==null?void 0:r.thumbnailsLoadingMode)||"lazy",alt:((k=e==null?void 0:e.props)==null?void 0:k.children)&&(J==null?void 0:J.replace("{product}",e.props.children.toString()).replace("{key}",String(V+1)).replace("{total}",String(c.length)))},V)}):t("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0});return H("div",{...B,className:x(["pdp-product",F]),children:[d&&t(U,{node:d,className:"pdp-product__breadcrumbs"}),H("div",{className:"pdp-product__column-container pdp-product__gallery-column",children:[t("div",{className:"pdp-product__column-body",children:(ie=r==null?void 0:r.controls)!=null&&ie.desktop?t(be,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?r.controls.desktop:"dots",arrowsOnMainImage:r==null?void 0:r.arrowsOnMainImage,loop:(r==null?void 0:r.loopable)&&(c==null?void 0:c.length)>1,peak:((le=r==null?void 0:r.thumbnails)==null?void 0:le.length)>1&&((ae=r==null?void 0:r.peak)==null?void 0:ae.desktop)||!1,gap:(r==null?void 0:r.gap)||null,width:"100%",height:"100%",defaultIndex:$||0,thumbnails:Y,children:K}):t(Je,{className:"pdp-product__images",gap:"small",children:K})}),h&&t(U,{node:h,className:"pdp-product__gallery-content"})]}),H("div",{className:"pdp-product__column-container pdp-product__content-column",children:[H("div",{className:"pdp-product__column-body",children:[H("div",{className:"pdp-product__header",children:[e&&t(U,{node:e,className:"pdp-product__title"}),A&&t(U,{node:A,className:"pdp-product__sku"})]}),H("div",{className:"pdp-product__prices",children:[I&&t(U,{node:I,className:x(["pdp-product__price-special","pdp-product__price"]),"aria-label":ee,role:"text"}),E&&t(U,{node:E,className:x(["pdp-product__price-regular","pdp-product__price--grey"]),"aria-label":N,role:"text"})]}),(se=r==null?void 0:r.controls)!=null&&se.mobile&&((te=r==null?void 0:r.controls)==null?void 0:te.mobile)==="thumbnailsRow"?t(be,{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:(r==null?void 0:r.loopable)&&(c==null?void 0:c.length)>1,peak:((he=r==null?void 0:r.thumbnails)==null?void 0:he.length)>1&&((oe=r==null?void 0:r.peak)==null?void 0:oe.mobile)||!1,gap:(r==null?void 0:r.gap)||null,thumbnails:Y,children:K}):t(be,{className:"pdp-product__images pdp-product__images--carousel",peak:((M=r==null?void 0:r.peak)==null?void 0:M.mobile)&&(c==null?void 0:c.length)>1,gap:(r==null?void 0:r.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:(r==null?void 0:r.loopable)&&(c==null?void 0:c.length)>1,children:K}),H("div",{className:x(["pdp-product__actions",["pdp-product__actions--out-of-stock",u]]),children:[u&&t("div",{className:"pdp-product__out-of-stock__text",children:n}),m&&t(U,{node:m,className:x(["pdp-product__options"])}),P&&t("div",{className:"pdp-product__quantity",children:t(U,{node:P})}),b&&t(U,{node:b,className:x(["pdp-product__buttons"])})]}),w&&t(U,{node:w,className:x(["pdp-product__short_description"])}),l&&t(U,{node:l,className:x(["pdp-product__description"])}),q?t("div",{className:"pdp-product__attributes",children:q}):null]}),_&&t(U,{node:_,className:"pdp-product__info-content"})]}),p&&t(U,{node:p,className:"pdp-product__content"}),$===null?null:t(Ce,{className:"pdp-product__overlay",onClose:()=>T(null),centered:!0,children:t(be,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,width:"100%",height:"100%",defaultIndex:$||0,loop:(r==null?void 0:r.loopable)&&(c==null?void 0:c.length)>1,controls:(c==null?void 0:c.length)>1?"dots":null,isZoomed:!0,children:K})})]})},Je=({children:e,gap:d=null,className:h,style:_,...p})=>{const A=ce.count(e);return t("div",{...p,className:x(["pdp-gallery-grid",h]),style:{"--gap":d?`var(--spacing-${d})`:"0px",..._},children:ce.map(e,(u,w)=>t("div",{className:"pdp-gallery-grid__item",children:t(U,{node:u,loading:w===0?"eager":"lazy"},u.props.src)},A+w))})},xe=({amount:e,currency:d,locale:h,variant:_,sale:p,minimumAmount:A,maximumAmount:u,className:w,...l})=>t(fe,{children:e||A===u?t("div",{className:"pdp-price-range",...l,children:t(Se,{amount:e||A,currency:d,locale:h,variant:_,sale:p,className:w})}):H("div",{className:"pdp-price-range",...l,children:[t(Se,{amount:A,currency:d,locale:h,className:w}),t("span",{className:"pdp-price-range__label",children:"-"}),t(Se,{amount:u,currency:d,locale:h,className:w})]})}),Ce=({centered:e,onClose:d,className:h,children:_,...p})=>{const A=z("PDP.Overlay.Close.label").label,u=C(()=>{d==null||d()},[d]);return re(()=>{const w=l=>{l.key==="Escape"&&u()};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[u]),re(()=>{const w=document.scrollingElement,l=w.style.overflow;return w.style.overflow="hidden",()=>{w.style.overflow=l}},[]),H("div",{...p,className:x(["pdp-overlay",["pdp-overlay--centered",e],h]),children:[t("div",{className:"pdp-overlay__content",children:_}),t(Pe,{"aria-label":A,variant:"tertiary",className:"pdp-overlay__close-button",onClick:u,icon:t(Qe,{})})]})},et=["text","image","color","dropdown"],tt=e=>e.map(d=>({...d,text:d.label,disabled:!d.inStock})),nt=({options:e,hideSelectedValue:d,onValues:h,onErrors:_,defaultOptions:p,selectionsToUpdate:A,className:u,children:w,...l})=>{const q=z("PDP.Swatches.Required.label").label,[c,m]=Z(()=>e==null?void 0:e.reduce((P,b)=>{const{items:r}=b,D=r==null?void 0:r.find(N=>p==null?void 0:p.includes(N.id)),B=r==null?void 0:r.find(N=>N.selected);return D?{...P,[b.id]:{label:D.label,value:D.id}}:B?{...P,[b.id]:{label:B.label,value:B.id}}:P},{}));re(()=>{A==null||A.forEach(S=>{m(P=>{var D;const b=(D=S==null?void 0:S.items)==null?void 0:D.find(B=>B.selected);return b?{...P,[S.id]:{label:b==null?void 0:b.label,value:b==null?void 0:b.id}}:P})})},[A,m]),we(()=>{const S=e==null?void 0:e.reduce((P,b)=>{var r;return(r=b==null?void 0:b.items)==null||r.forEach(D=>{var N;const B=((N=c[b.id])==null?void 0:N.value)===D.id;b.required&&!B&&(P[b.id]=q)}),P},{});return _==null||_(S),S},[c]);const E=C((S,P,b)=>{m(r=>{const D={...r,[S]:{label:P,value:b}};return h==null||h(D,b),D})},[h]),I=(S,P)=>{var r;const b=((r=P.selectedOptions[0])==null?void 0:r.label)??"";E(S,b,P.value)},F=C(({items:S,id:P,required:b,type:r,selected:D,label:B})=>t("div",{className:x(["pdp-swatches__options"]),children:(r==null?void 0:r.toLowerCase())==="dropdown"?t(Ue,{"aria-label":B,handleSelect:N=>I(P,N.target),options:tt(S),value:D}):S==null?void 0:S.map(N=>{const ee={key:N.id,id:N.id,name:P,value:N.value,label:N.label,groupAriaLabel:B,selected:D===N.id,outOfStock:!N.inStock,required:b===null?!0:b,onValue:()=>{E(P,N.label,N.id)}};switch(r){case"text":return t(ze,{...ee,label:N.label});case"image":return t(Ve,{...ee,src:N.value,alt:N.label});case"color":return t(He,{...ee,size:"large",color:N.value});default:return console.warn(`Invalid swatch type ${r}`),null}})}),[E]);return t("div",{...l,className:x(["pdp-swatches",u]),children:e==null?void 0:e.map(({type:S,label:P,id:b,multiple:r,required:D,items:B})=>{var N;if(!S){console.warn("Bundle product not supported on UI.");return}return et.includes(S)||console.warn(`Invalid swatch type ${S}`),r&&console.warn("Multiple selection swatches are not currently supported."),H("div",{id:`swatch-item-${b}`,"data-slot-key":`product-swatch--${b}`,className:"pdp-swatches__field",children:[t("div",{className:"pdp-swatches__field__label",children:c[b]?d?`${P}`:`${P}: ${c[b].label}`:P}),t(F,{id:b,type:S,required:D,items:B,label:P,selected:(N=c[b])==null?void 0:N.value})]},`swatch-item-${b}`)})})},rt=({children:e,scale:d=2})=>{const[h,_]=Z(!1),[p,A]=Z({x:"0%",y:"0%"}),u=m=>{var b;const E=(b=m.currentTarget)==null?void 0:b.getBoundingClientRect(),I=(100-100/d)/2,F=m.type==="touchmove"?m.touches[0]:m,S=I-(F.clientX-E.x)/E.width*100,P=I-(F.clientY-E.y)/E.height*100;A({x:`${Math.max(-I,Math.min(S,I))||0}%`,y:`${Math.max(-I,Math.min(P,I))||0}%`})},w=m=>{h?_(!1):(_(!0),u(m))},l=m=>{h&&u(m)},q=()=>{_(!1)},c=h?`scale(${d}) translateX(${p.x}) translateY(${p.y})`:"none";return t("figure",{className:"pdp-zoom",onClick:w,onMouseMove:l,onMouseLeave:q,onTouchStart:w,onTouchMove:l,onTouchEnd:q,children:Ge(ce.only(e),{style:{"-webkit-transform":c,"-moz-transform":c,"-ms-transform":c,"-o-transform":c,transform:c}})})};function lt(e,d="en_US"){if(!Be(e))throw Error("Invalid date string");return e.split(" ")[1]||(e=`${e} 00:00:00`),new Date(e).toLocaleDateString(Ne(d)).toString()}function Be(e){if(![/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{2}\/\d{2}\/\d{4}$/,/^\d{4}\/\d{2}\/\d{2}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/,/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/].some(_=>_.test(e)))return!1;const h=new Date(e);return!isNaN(h.getTime())}function ct(e){const d=new URLSearchParams(window.location.search);Object.entries(e).forEach(([_,p])=>{p===null?d.delete(_):d.set(_,String(p))});let h=window.location.pathname;h+=`?${d.toString()}`,h+=window.location.hash,window.history.replaceState({},"",h)}function at(){const e=new URLSearchParams(window.location.search),d={};return e.forEach((h,_)=>{d[_]=h}),d}function ot(e){var d,h,_,p,A,u,w,l,q,c,m,E;return{productId:Number(e==null?void 0:e.externalId),name:e==null?void 0:e.name,sku:e==null?void 0:e.sku,topLevelSku:e==null?void 0:e.externalParentId,specialToDate:void 0,specialFromDate:void 0,newToDate:void 0,newFromDate:void 0,createdAt:void 0,updatedAt:void 0,manufacturer:void 0,countryOfManufacture:void 0,categories:void 0,productType:void 0,pricing:{regularPrice:((h=(d=e==null?void 0:e.prices)==null?void 0:d.regular)==null?void 0:h.amount)||0,minimalPrice:(p=(_=e==null?void 0:e.prices)==null?void 0:_.final)==null?void 0:p.minimumAmount,maximalPrice:(u=(A=e==null?void 0:e.prices)==null?void 0:A.final)==null?void 0:u.maximumAmount,specialPrice:(l=(w=e==null?void 0:e.prices)==null?void 0:w.final)==null?void 0:l.amount,tierPricing:void 0,currencyCode:((c=(q=e==null?void 0:e.prices)==null?void 0:q.final)==null?void 0:c.currency)||"USD"},canonicalUrl:e==null?void 0:e.url,mainImageUrl:(E=(m=e==null?void 0:e.images)==null?void 0:m[0])==null?void 0:E.url}}const dt={PRODUCT_CONTEXT:"productContext"},it={PRODUCT_PAGE_VIEW:"product-page-view"};function Re(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function st(e,d){const h=Re();h.push({[e]:null}),h.push({[e]:d})}function ht(e,d){Re().push(_=>{const p=_.getState?_.getState():{};_.push({event:e,eventInfo:{...p,...d}})})}function Ee(e){const d=ot(e);st(dt.PRODUCT_CONTEXT,d),ht(it.PRODUCT_PAGE_VIEW)}const pt=({sku:e,hideSku:d,hideQuantity:h,hideShortDescription:_,hideDescription:p,hideAttributes:A,hideURLParams:u,hideSelectedOptionValue:w,slots:l,children:q,initialData:c,carousel:m,optionsConfig:E,useACDL:I,onAddToCart:F,...S})=>{var M,j,V,k;const P=z("PDP.Product.AddToCart.label").label,b=z("PDP.Product.Incrementer.label").label,r=z("PDP.Product.Details.label").label,[D,B]=Z(Me.getConfig().defaultLocale||"en-US"),[N,ee]=Z(),[n=null,J]=Z(c),[$,T]=Z(()=>{const o={sku:e,quantity:1};return n!=null&&n.optionUIDs&&(o.optionsUIDs=n.optionUIDs),o}),[K,Y]=Z(()=>{var o,s;return!(n!=null&&n.options&&((o=n==null?void 0:n.options)==null?void 0:o.length)>0&&((s=n==null?void 0:n.optionUIDs)==null?void 0:s.length)!==(n==null?void 0:n.options.length))}),v={data:n,values:$,valid:K};re(()=>{const o=Fe.on("locale",s=>{s!==D&&(B(s),Ie(e).then(J))});return()=>{o==null||o.off()}},[D,e]),re(()=>{I&&c&&Object.keys(c).length>0&&Ee(c)},[c]);const ie=C(o=>{T(s=>({...s,...o}))},[]),le=C(o=>{var y;let s=Object.keys(o).map(f=>o[f].value).filter(f=>f!==void 0);u||ct({optionsUIDs:s.join(",")}),T(f=>({...f,optionsUIDs:s})),Y((s==null?void 0:s.length)===((y=n==null?void 0:n.options)==null?void 0:y.length)),$e(e,s,E==null?void 0:E.anchorOptions).then(f=>{var O;J(f),(O=E==null?void 0:E.anchorOptions)!=null&&O.length&&ae(f,s),I&&(f==null?void 0:f.sku)!==e&&Ee(f)})},[e]),ae=C((o,s)=>{var O;const y=(o==null?void 0:o.optionUIDs)??[];s.every(Q=>y.includes(Q))||(ee(o==null?void 0:o.options),T(Q=>({...Q,optionsUIDs:y})),Y((y==null?void 0:y.length)===((O=o==null?void 0:o.options)==null?void 0:O.length)))},[e]),se=C(o=>{Object.keys(o).length!==0&&Y(!1)},[]),te=we(()=>{var o;return(o=n==null?void 0:n.attributes)==null?void 0:o.map(({label:s,value:y},f)=>{const O=Be(y)?lt(y,D):y.toString();return H("li",{children:[s,": ",t("span",{dangerouslySetInnerHTML:{__html:O}})]},f)})},[n==null?void 0:n.attributes,D]),he=!h&&(n!=null&&n.inStock)?t(G,{name:"Quantity",slot:l==null?void 0:l.Quantity,context:{...v},children:t(qe,{name:"quantity",defaultValue:$.quantity.toString(),min:1,"aria-label":b,className:"pdp-product__quantity",onValue:o=>{ie({quantity:Number(o)})}},"quantity")}):void 0,oe=()=>{if(n!=null&&n.options)return t(G,{name:"Options",slot:l==null?void 0:l.Options,context:{...v},children:t(nt,{options:n.options,defaultOptions:$.optionsUIDs,selectionsToUpdate:N,hideSelectedValue:w,onValues:le,onErrors:se})})};return t("div",{...S,children:t(Ye,{title:t(G,{name:"Title",slot:l==null?void 0:l.Title,context:{...v},children:n==null?void 0:n.name}),sku:d?void 0:t(G,{name:"SKU",slot:l==null?void 0:l.SKU,context:{...v},children:n==null?void 0:n.sku}),options:oe(),breadcrumbs:(l==null?void 0:l.Breadcrumbs)&&t(G,{name:"Breadcrumbs",slot:l==null?void 0:l.Breadcrumbs,context:{...v,setSeparator(o){this._registerMethod((...s)=>{const y=o(...s),f=y&&t(ve,{source:y});this._setProps(O=>({...O,separator:f}))})},appendLink(o){this._registerMethod((...s)=>{const{text:y,...f}=o(...s),O=t("a",{...f,children:y});this._setProps(Q=>({...Q,categories:[...Q.categories||[],O]}))})},appendHTMLElement(o){this._registerMethod((...s)=>{const y=o(...s),f=this._htmlElementToVNode(y);this._setProps(O=>({...O,categories:[...O.categories||[],f]}))})}},render:({separator:o,categories:s})=>t(je,{separator:o,categories:s})}),quantity:he,actions:t(G,{name:"Actions",slot:l==null?void 0:l.Actions,context:{...v,appendButton(o){this._registerMethod((...s)=>{const y=o(...s);if(!y)return;const{text:f,icon:O,...Q}=y,ue=t(Pe,{type:"button",...Q,icon:O&&t(ve,{source:O}),children:f});this._setProps(me=>({children:[...me.children||[],ue]}))})}},children:!(l!=null&&l.Actions)&&t(Pe,{size:"medium",type:"submit",icon:t(ve,{source:"Cart"}),disabled:!(n!=null&&n.inStock)||!K,"aria-label":P,onClick:()=>F==null?void 0:F($),children:P})}),shortDescription:_?void 0:t(G,{name:"ShortDescription",slot:l==null?void 0:l.ShortDescription,context:{...v},children:t("div",{dangerouslySetInnerHTML:{__html:(n==null?void 0:n.shortDescription)??""}})}),description:p?void 0:t(G,{name:"Description",slot:l==null?void 0:l.Description,context:{...v},children:t("div",{dangerouslySetInnerHTML:{__html:(n==null?void 0:n.description)??""}})}),images:((M=n==null?void 0:n.images)==null?void 0:M.map(({label:o,url:s})=>{var y,f;return t(De,{title:o,alt:o,src:s,width:((y=m==null?void 0:m.imageParams)==null?void 0:y.width)??960,height:((f=m==null?void 0:m.imageParams)==null?void 0:f.height)??1191,params:(m==null?void 0:m.imageParams)??{width:960}},s)}))??[],specialPrice:(j=n==null?void 0:n.prices)!=null&&j.visible?t(G,{name:"SpecialPrice",slot:l==null?void 0:l.SpecialPrice,context:{...v},children:t(xe,{...n.prices.final,locale:Ne(D)})}):void 0,price:(V=n==null?void 0:n.prices)!=null&&V.visible&&n.prices.regular&&n.prices.final.amount!==(n==null?void 0:n.prices.regular.amount)?t(G,{name:"RegularPrice",slot:l==null?void 0:l.RegularPrice,context:{...v},children:t(xe,{...n.prices.regular,locale:Ne(D)})}):void 0,carouselConfig:{...m,thumbnails:m&&Object.keys(m).length?((k=n==null?void 0:n.images)==null?void 0:k.map(({label:o,url:s})=>{var y,f;return t(De,{title:o,alt:o,src:s,width:((y=m==null?void 0:m.thumbnailParams)==null?void 0:y.width)??200,height:((f=m==null?void 0:m.thumbnailParams)==null?void 0:f.height)??248,params:(m==null?void 0:m.thumbnailParams)??{width:200}},s)}))??[]:[]},outOfStock:!(n!=null&&n.inStock),attributes:A?void 0:t(G,{name:"Attributes",slot:l==null?void 0:l.Attributes,context:{...v},children:te!=null&&te.length?H(fe,{children:[r,t("ul",{children:te})]}):null}),galleryContent:(l==null?void 0:l.GalleryContent)&&t(G,{name:"GalleryContent",slot:l.GalleryContent,context:{...v}}),infoContent:(l==null?void 0:l.InfoContent)&&t(G,{name:"InfoContent",slot:l.InfoContent,context:{...v}}),productContent:(l==null?void 0:l.Content)&&t(G,{name:"Content",slot:l.Content,context:{...v}})})})};pt.getInitialData=async function({sku:e,optionsConfig:d}){var _,p,A,u,w,l;const h=((_=at().optionsUIDs)==null?void 0:_.split(","))||((l=(w=(u=(A=(p=Me)==null?void 0:p.getConfig())==null?void 0:A.models)==null?void 0:u.ProductDetails)==null?void 0:w.initialData)==null?void 0:l.optionsUIDs);return h!=null&&h.length?await $e(e,h,d==null?void 0:d.anchorOptions):await Ie(e)};export{pt as ProductDetails,pt as default};
1
+ import*as be from"@dropins/tools/preact-compat.js";import{useState as F,Children as de,useRef as Ne,useMemo as ye,useEffect as Q,useCallback as re}from"@dropins/tools/preact-compat.js";import{debounce as xe,classes as O,VComponent as X,toLanguageTag as De,Slot as Z}from"@dropins/tools/lib.js";import{Button as ve,Icon as Pe,Price as ge,Picker as Ue,ColorSwatch as He,ImageSwatch as qe,TextSwatch as je,Incrementer as Xe,Breadcrumbs as Fe,Image as ke}from"@dropins/tools/components.js";import{jsxs as q,jsx as r,Fragment as Se}from"@dropins/tools/preact-jsx-runtime.js";import{useText as G}from"@dropins/tools/i18n.js";import{cloneElement as Ge}from"@dropins/tools/preact.js";import{c as $e,d as Re}from"../chunks/getRefinedProduct.js";import{events as Le}from"@dropins/tools/event-bus.js";import{c as Te}from"../chunks/initialize.js";import"@dropins/tools/fetch-graphql.js";const Ye=t=>be.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},be.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),Be=t=>be.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},be.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 5.64001L5.62988 18.37",stroke:"currentColor"}),be.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 18.37L5.62988 5.64001",stroke:"currentColor"})),Ke=24,Me=16,fe=2,Ze="32";var We=(t=>(t[t.small=16]="small",t[t.medium=24]="medium",t[t.large=64]="large",t))(We||{});const we=({show:t=1,scrollbar:i=!1,peak:d=!1,arrows:p=!1,controls:s="dots",arrowsOnMainImage:f=!1,loop:h=!1,gap:v=null,direction:l="horizontal",width:Y="100%",height:c="100%",defaultIndex:_=0,className:V,children:R,thumbnails:J=null,isZoomed:oe,...b})=>{const P=G("PDP.Carousel.label").label,n=G("PDP.Carousel.Slide.label").label,y=G("PDP.Carousel.Previous.label").label,k=G("PDP.Carousel.Next.label").label,E=G("PDP.Carousel.Controls.label").label,S=G("PDP.Carousel.Controls.Button.label").label,[A,se]=F(()=>Ee(t)),e=Math.ceil(de.count(R)/A),I=d?Ke:0,g=v?We[v]:0,B=de.count(R)%A,[L,ee]=F(h?_+1:_),x=Ne([]),[te,le]=F(0),[ae,me]=F(0),he=ye(()=>de.toArray(J),[J]),$=ye(()=>{const a=de.toArray(R).reduce((u,D,M)=>M%A===0?[...u,[D]]:[...u.slice(0,-1),[...u[u.length-1],D]],[]);return!h||a.length===1?a:h&&de.count(R)%A===0?[a[e-1]].concat(a).concat([a[0],a[1]]):[de.toArray(R).slice(-A)].concat(a).concat([a[0],a[1]])},[R,A,e,h]),ne=Ne(null),ie=Ne(null),N=s==="thumbnailsRow"||s==="thumbnailsColumn";Q(()=>{const a=document.body,u=xe(()=>{var H,ce;le(((H=ne.current)==null?void 0:H.offsetWidth)??0),me(((ce=ne.current)==null?void 0:ce.offsetHeight)??0);const M=window.innerWidth,j=Ee(t,M);j!==A&&se(j)},50),D=new ResizeObserver(u);return D.observe(a),()=>{D.unobserve(a)}},[A,t]);const K=re(a=>{const u=h?a-1:a,D=x==null?void 0:x.current[0],M=(D==null?void 0:D.offsetWidth)+Me,j=(D==null?void 0:D.offsetHeight)+Me,H=ie.current,ce=s==="thumbnailsRow",Ae=s==="thumbnailsColumn",ue=ce?H==null?void 0:H.offsetWidth:H==null?void 0:H.offsetHeight,C=ce?M:j;(ce||Ae)&&ue&&(C*(u+1)>ue&&(H.style.scrollBehavior="smooth",ce?H.scrollLeft=(u+fe)*C:H.scrollTop=(u+fe)*C),(ce?H.scrollLeft:H.scrollTop)>C*u&&(H.style.scrollBehavior="smooth",ce?H.scrollLeft=(u-fe)*C:H.scrollTop=(u-fe)*C))},[s,h]);Q(()=>{K(L)},[L,K]);const U=re((a,u,D)=>{N&&K(a);const M=ne.current,j=I?M.offsetWidth-I:M.offsetWidth-I+g;if(!Array.from(M.querySelectorAll("[data-index]")).filter(ue=>{const C=Number(ue.getAttribute("data-index"));return!isNaN(C)&&C>-1})[a])return;if(D){const ue=a===0?e:0,C=j*(e+(B||A)/A);if(M.scrollLeft>=0&&M.scrollLeft<j-5){U(1,!0);return}if(M.scrollLeft>C-j&&M.scrollLeft<=C){U(e,!0);return}M.style.scrollBehavior="auto",M.scrollLeft=ue===0?0:C,U(ue===0?1:e,!0);return}const Ae=(M.offsetWidth-g)/A*$[a].length-I;M.style.scrollBehavior=u?"smooth":"auto",M.scrollLeft=$[a].length===A?j*a:j*(a-1)+Ae},[g,e,I,A,B,$,K,s]),pe=re(()=>{if(h){const u=L-1;U(u,!0,L===1);return}const a=L<=0?0:L-1;U(a,!0)},[L,U,h]),o=re(()=>{const a=$.length-1;if(h){const D=L+1;U(D,!0,L===e);return}const u=L>=a?a:L+1;U(u,!0)},[$.length,h,L,U,e]);Q(()=>{const a=u=>{u.key==="ArrowLeft"&&(u.preventDefault(),pe()),u.key==="ArrowRight"&&(u.preventDefault(),o())};return window.addEventListener("keydown",a),()=>{window.removeEventListener("keydown",a)}},[o,pe]),Q(()=>{U(h?_+1:_,!1)},[_,U,h]);const m=xe(()=>{const a=ne.current,u=I?a.offsetWidth-I:a.offsetWidth-I+g,D=a.scrollLeft/u,M=Math.round(D)-D<1?Math.round(D):Math.ceil(D);if(N&&K(M),h){const j=u*(e+(B||A)/A);if(Math.ceil(a.scrollLeft)>=Math.ceil(j)-5){a.style.scrollBehavior="auto",a.scrollLeft=a.offsetWidth*1+(Math.ceil(a.scrollLeft)-Math.ceil(j)-I);return}if(a.scrollLeft===0){a.style.scrollBehavior="auto",a.scrollLeft=j-a.offsetWidth+I;return}}L!==M&&ee(M)},100);Q(()=>{const a=ne.current;return a==null||a.addEventListener("scroll",m),()=>{a==null||a.removeEventListener("scroll",m)}},[m]);const w=(a,u,D)=>r(ve,{className:O([["pdp-carousel__button",!a],[`pdp-carousel__button--${u}`,!a],[`pdp-carousel__button--${s}`,a]]),style:{"--height":`${ae}px`},variant:"tertiary","aria-label":u==="next"?k:y,onClick:D,disabled:h?!1:u==="next"?L>=$.length-1:L<1,children:r(Pe,{className:O([["pdp-carousel__button__icon",!a],[`pdp-carousel__button__icon--${u}`,!a],[`pdp-carousel__button__icon--${s}--${u}`,a]]),size:Ze,source:Ye})}),T=p&&$.length!=1&&w(N,"prev",pe),z=p&&$.length!=1&&w(N,"next",o),W=p&&$.length!=1&&w(!1,"prev",pe),_e=p&&$.length!=1&&w(!1,"next",o);return q("div",{role:"region","aria-roledescription":P,className:O(["pdp-carousel",["pdp-carousel--main-image-controls",f],["pdp-carousel--arrows",p&&!N],[`pdp-carousel--${s}`,N],V]),style:{"--flex-carousel":s==="thumbnailsColumn"?"row-reverse":"column","--gap":N?"0":"var(--spacing-small)","--width":Y},...b,children:[r("div",{ref:ne,className:O(["pdp-carousel__wrapper",`pdp-carousel__wrapper--${l}`,["pdp-carousel__wrapper--scrollbar",i],["pdp-carousel__wrapper--peak",d]]),style:{"--total-width":s==="thumbnailsColumn"?"81.6%":"100%","--height":s==="thumbnailsColumn"?"auto":c,"--gap":v?`var(--spacing-${v})`:"0px","--per-page":A},tabIndex:0,children:$.map((a,u)=>{const D=a.length<A;return r("div",{role:"group","aria-roledescription":n,"data-index":u,className:O(["pdp-carousel__slide",`pdp-carousel__slide--${l}`,["pdp-carousel__slide--active",L===u],["pdp-carousel__slide--orphan",D]]),style:{"--length":a.length},children:a},u)})}),!N&&q(Se,{children:[T,z]}),N&&f&&q(Se,{children:[W,_e]}),s&&$.length!=1&&q("div",{className:O([[`pdp-carousel__controls__container--${s}`,N],["pdp-carousel__controls__container--no-arrows",!p||f]]),style:{"--width":s==="thumbnailsRow"?`${te}px`:Y,"--height":`${ae}px`,"--nr-thumbnails":he.length},children:[(N||oe)&&!f&&T,r("div",{ref:ie,className:O([[`pdp-carousel__controls__wrapper--${s}`,N],["pdp-carousel__controls__wrapper",N]]),children:r("div",{role:"group","aria-label":E,className:O(["pdp-carousel__controls",[`pdp-carousel__controls--${s}`,N]]),children:(h?$.slice(0,e):$).map((a,u)=>{const D=h?e:$.length,M=h?L-1===u:L===u;return N?q("label",{className:O(["pdp-carousel__thumbnail__container"]),ref:j=>{j&&(x.current[u]=j)},children:[r("input",{type:"radio",name:"carousel-thumbnails","aria-label":S.replace("{key}",String(u+1)).replace("{total}",String(D)),checked:M&&te!==0,onChange:()=>{U(h?u+1:u,!0)},...b,className:O(["pdp-carousel__thumbnail",["pdp-carousel__thumbnail--selected",M&&te!==0]])}),r("span",{className:O(["pdp-carousel__thumbnail__span"]),children:he[u]})]},u):r("button",{"aria-label":S.replace("{key}",String(u+1)).replace("{total}",String(D)),onClick:()=>{U(h?u+1:u,!0)},className:O(["pdp-carousel__controls__button",["pdp-carousel__controls__button--active",M]])},u)})})}),(N||oe)&&!f&&z]})]})};function Ee(t,i=0){if(typeof t=="number")return t;const{small:d,medium:p,large:s}=t,h=[{breakpoint:1024,value:s},{breakpoint:786,value:p},{breakpoint:0,value:d}].find(({breakpoint:v})=>i>v);return h?h.value:d}const Qe=({title:t,breadcrumbs:i,galleryContent:d,infoContent:p,productContent:s,sku:f,outOfStock:h,shortDescription:v,description:l,attributes:Y,images:c,options:_,price:V,specialPrice:R,className:J,children:oe,quantity:b,actions:P,carouselConfig:n,zoomType:y="overlay",closeButton:k=!0,...E})=>{var ee,x,te,le,ae,me,he,$,ne;const S=G("PDP.Product.RegularPrice.label").label,A=G("PDP.Product.SpecialPrice.label").label,se=G("PDP.Product.OutOfStock.label").label,e=G("PDP.Product.Image.label").label,[I,g]=F(null),B=c!=null&&c.length?c.map((ie,N)=>{var U;const K=((U=t==null?void 0:t.props)==null?void 0:U.children)&&(e==null?void 0:e.replace("{product}",t.props.children.toString()).replace("{key}",String(N+1)).replace("{total}",String(c.length)));return y==="zoom"?r(lt,{closeButton:k,children:r(X,{node:ie,loading:N===0?"eager":"lazy",alt:K},N)}):r(X,{node:ie,loading:N===0?"eager":"lazy",alt:K,onClick:()=>g(N)},N)}):r("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0}),L=(ee=n==null?void 0:n.thumbnails)!=null&&ee.length?n.thumbnails.map((ie,N)=>{var K;return r(X,{node:ie,loading:(n==null?void 0:n.thumbnailsLoadingMode)||"lazy",alt:((K=t==null?void 0:t.props)==null?void 0:K.children)&&(e==null?void 0:e.replace("{product}",t.props.children.toString()).replace("{key}",String(N+1)).replace("{total}",String(c.length)))},N)}):r("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0});return q("div",{...E,className:O(["pdp-product",J]),children:[i&&r(X,{node:i,className:"pdp-product__breadcrumbs"}),q("div",{className:"pdp-product__column-container pdp-product__gallery-column",children:[r("div",{className:"pdp-product__column-body",children:(x=n==null?void 0:n.controls)!=null&&x.desktop?r(we,{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:((te=n==null?void 0:n.thumbnails)==null?void 0:te.length)>1&&((le=n==null?void 0:n.peak)==null?void 0:le.desktop)||!1,gap:(n==null?void 0:n.gap)||null,width:"100%",height:"100%",defaultIndex:I||0,thumbnails:L,children:B}):r(Je,{className:"pdp-product__images",gap:"small",children:B})}),d&&r(X,{node:d,className:"pdp-product__gallery-content"})]}),q("div",{className:"pdp-product__column-container pdp-product__content-column",children:[q("div",{className:"pdp-product__column-body",children:[q("div",{className:"pdp-product__header",children:[t&&r(X,{node:t,className:"pdp-product__title"}),f&&r(X,{node:f,className:"pdp-product__sku"})]}),q("div",{className:"pdp-product__prices",children:[R&&r(X,{node:R,className:O(["pdp-product__price-special","pdp-product__price"]),"aria-label":A,role:"text"}),V&&r(X,{node:V,className:O(["pdp-product__price-regular","pdp-product__price--grey"]),"aria-label":S,role:"text"})]}),(ae=n==null?void 0:n.controls)!=null&&ae.mobile&&((me=n==null?void 0:n.controls)==null?void 0:me.mobile)==="thumbnailsRow"?r(we,{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:((he=n==null?void 0:n.thumbnails)==null?void 0:he.length)>1&&(($=n==null?void 0:n.peak)==null?void 0:$.mobile)||!1,gap:(n==null?void 0:n.gap)||null,thumbnails:L,children:B}):r(we,{className:"pdp-product__images pdp-product__images--carousel",peak:((ne=n==null?void 0:n.peak)==null?void 0:ne.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}),q("div",{className:O(["pdp-product__actions",["pdp-product__actions--out-of-stock",h]]),children:[h&&r("div",{className:"pdp-product__out-of-stock__text",children:se}),_&&r(X,{node:_,className:O(["pdp-product__options"])}),b&&r("div",{className:"pdp-product__quantity",children:r(X,{node:b})}),P&&r(X,{node:P,className:O(["pdp-product__buttons"])})]}),v&&r(X,{node:v,className:O(["pdp-product__short_description"])}),l&&r(X,{node:l,className:O(["pdp-product__description"])}),Y?r("div",{className:"pdp-product__attributes",children:Y}):null]}),p&&r(X,{node:p,className:"pdp-product__info-content"})]}),s&&r(X,{node:s,className:"pdp-product__content"}),I===null?null:r(Ce,{className:"pdp-product__overlay",onClose:()=>g(null),centered:!0,children:r(we,{className:"pdp-product__overlay__carousel",arrows:(c==null?void 0:c.length)>1,width:"100%",height:"100%",defaultIndex:I||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})})]})},Je=({children:t,gap:i=null,className:d,style:p,...s})=>{const f=de.count(t);return r("div",{...s,className:O(["pdp-gallery-grid",d]),style:{"--gap":i?`var(--spacing-${i})`:"0px",...p},children:de.map(t,(h,v)=>r("div",{className:"pdp-gallery-grid__item",children:r(X,{node:h,loading:v===0?"eager":"lazy"},h.props.src)},f+v))})},Ie=({amount:t,currency:i,locale:d,variant:p,sale:s,minimumAmount:f,maximumAmount:h,className:v,...l})=>r(Se,{children:t||f===h?r("div",{className:"pdp-price-range",...l,children:r(ge,{amount:t||f,currency:i,locale:d,variant:p,sale:s,className:v})}):q("div",{className:"pdp-price-range",...l,children:[r(ge,{amount:f,currency:i,locale:d,className:v}),r("span",{className:"pdp-price-range__label",children:"-"}),r(ge,{amount:h,currency:i,locale:d,className:v})]})}),Ce=({centered:t,onClose:i,className:d,children:p,...s})=>{const f=G("PDP.Overlay.Close.label").label,h=re(()=>{i==null||i()},[i]);return Q(()=>{const v=l=>{l.key==="Escape"&&h()};return document.addEventListener("keydown",v),()=>{document.removeEventListener("keydown",v)}},[h]),Q(()=>{const v=document.scrollingElement,l=v.style.overflow;return v.style.overflow="hidden",()=>{v.style.overflow=l}},[]),q("div",{...s,className:O(["pdp-overlay",["pdp-overlay--centered",t],d]),children:[r("div",{className:"pdp-overlay__content",children:p}),r(ve,{"aria-label":f,variant:"tertiary",className:"pdp-overlay__close-button",onClick:h,icon:r(Be,{})})]})},et=["text","image","color","dropdown"],tt=t=>t.map(i=>({...i,text:i.label,disabled:!i.inStock}));function nt(t,i){return t.reduce((d,p)=>{const s=i==null?void 0:i.find(h=>h.items.find(v=>v.id===p));if(!s)return d;const f=s.items.find(h=>h.id===p);return{...d,[s.id]:{label:f.label,value:f.id}}},{})}const rt=({options:t,hideSelectedValue:i,selectedUIDs:d,onValues:p,onErrors:s,defaultOptions:f,selectionsToUpdate:h,className:v,children:l,...Y})=>{const c=G("PDP.Swatches.Required.label").label,[_,V]=F(()=>t==null?void 0:t.reduce((P,n)=>{const{items:y}=n,k=y==null?void 0:y.find(S=>f==null?void 0:f.includes(S.id)),E=y==null?void 0:y.find(S=>S.selected);return k?{...P,[n.id]:{label:k.label,value:k.id}}:E?{...P,[n.id]:{label:E.label,value:E.id}}:P},{}));Q(()=>{if(d){const b=nt(d,t);if(JSON.stringify(b)===JSON.stringify(_))return;R(Object.keys(b)[0],b[Object.keys(b)[0]].label,d[0])}},[d]),Q(()=>{h==null||h.forEach(b=>{V(P=>{var k;const n=(k=b==null?void 0:b.items)==null?void 0:k.find(E=>E.selected);return n?{...P,[b.id]:{label:n==null?void 0:n.label,value:n==null?void 0:n.id}}:P})})},[h,V]),ye(()=>{const b=t==null?void 0:t.reduce((P,n)=>{var k;let y=!1;return(k=n==null?void 0:n.items)==null||k.forEach(E=>{var A;((A=_[n.id])==null?void 0:A.value)===E.id&&(y=!0)}),n.required&&!y&&(P[n.id]=c),P},{});return s==null||s(b),b},[_]);const R=re((b,P,n)=>{V(y=>{const k={...y,[b]:{label:P,value:n}};return p==null||p(k,n),k})},[p]),J=(b,P)=>{var y;const n=((y=P.selectedOptions[0])==null?void 0:y.label)??"";R(b,n,P.value)},oe=re(({items:b,id:P,required:n,type:y,selected:k,label:E})=>(b==null?void 0:b.length)>0&&r("div",{className:O(["pdp-swatches__options"]),children:(y==null?void 0:y.toLowerCase())==="dropdown"?r(Ue,{"aria-label":E,handleSelect:S=>J(P,S.target),options:tt(b),value:k}):b==null?void 0:b.map(S=>{const A={key:S.id,id:S.id,name:P,value:S.value,label:S.label,groupAriaLabel:E,selected:k===S.id,outOfStock:!S.inStock,required:n===null?!0:n,onValue:()=>{R(P,S.label,S.id)}};switch(y){case"text":return r(je,{...A,label:S.label});case"image":return r(qe,{...A,src:S.value,alt:S.label});case"color":return r(He,{...A,size:"large",color:S.value});default:return console.warn(`Invalid swatch type ${y}`),null}})}),[R]);return r("div",{...Y,className:O(["pdp-swatches",v]),children:t==null?void 0:t.map(({type:b,label:P,id:n,multiple:y,required:k,items:E})=>{var S;return et.includes(b)||console.warn(`Invalid swatch type ${b}`),y&&console.warn("Multiple selection swatches are not currently supported."),q("div",{id:`swatch-item-${n}`,"data-slot-key":`product-swatch--${n}`,className:"pdp-swatches__field",children:[r("div",{className:"pdp-swatches__field__label",children:_[n]?i?`${P}`:`${P}: ${_[n].label}`:P}),r(oe,{id:n,type:b,required:k,items:E,label:P,selected:(S=_[n])==null?void 0:S.value})]},`swatch-item-${n}`)})})},lt=({children:t,scale:i=2,closeButton:d=!0})=>{const[p,s]=F(!1),[f,h]=F("pdp-zoom"),[v,l]=F(!1),[Y,c]=F({x:0,y:0}),[_,V]=F({x:0,y:0}),[R,J]=F({x:0,y:0}),oe=e=>{!p||e.type!=="touchstart"||(c({x:e.touches[0].clientX,y:e.touches[0].clientY}),V({x:R.x,y:R.y}),l(!0))},b=e=>{var ae;if(!v||e.type!=="touchmove")return;const I=(ae=e.currentTarget)==null?void 0:ae.getBoundingClientRect(),g=(100-100/i)/2,B=e.touches[0].clientX-Y.x,L=e.touches[0].clientY-Y.y,ee=B*100/(I.width*i),x=L*100/(I.height*i),te=_.x+ee,le=_.y+x;J({x:Math.max(-g,Math.min(te,g))||0,y:Math.max(-g,Math.min(le,g))||0}),e.preventDefault()},P=e=>{var x;const I=(x=e.currentTarget)==null?void 0:x.getBoundingClientRect(),g=(100-100/i)/2;let B;if("touches"in e)B=e.touches[0];else if(e instanceof MouseEvent)B=e;else return;const L=g-(B.clientX-I.left)/I.width*100,ee=g-(B.clientY-I.top)/I.height*100;J({x:Math.max(-g,Math.min(L,g))||0,y:Math.max(-g,Math.min(ee,g))||0})},n=e=>{if(!v){if(p){if(d&&"touches"in e){oe(e);return}d||s(!1)}else s(!0),P(e);e.preventDefault()}},y=e=>{if(d&&"touches"in e){b(e);return}p&&P(e)},k=()=>{if(d){l(!1);return}s(!1)},E=e=>{s(!1),e.stopPropagation()},S=p?`scale(${i}) translateX(${R.x}%) translateY(${R.y}%)`:"none",A=G("PDP.Zoom.Close.label").label,se=Ge(de.only(t),{draggable:!1,style:{"--transform":S}});return Q(()=>{h(p?`pdp-zoom ${d?"pdp-zoom--no-effects":"pdp-zoom--zoomed"}`:"pdp-zoom")},[p,d]),q("figure",{className:f,onClick:n,onMouseMove:y,onMouseLeave:k,onTouchStart:n,onTouchMove:y,onTouchEnd:k,children:[se,d&&p&&r(ve,{"aria-label":A,variant:"tertiary",className:"pdp-zoom__close-button",icon:r(Be,{}),onClick:E})]})};function at(t,i="en_US"){if(!Ve(t))throw Error("Invalid date string");return t.split(" ")[1]||(t=`${t} 00:00:00`),new Date(t).toLocaleDateString(De(i)).toString()}function Ve(t){if(![/^\d{4}-\d{2}-\d{2}$/,/^\d{1,2}\/\d{1,2}\/\d{4}$/,/^\d{2}\/\d{2}\/\d{4}$/,/^\d{4}\/\d{2}\/\d{2}$/,/^\d{1,2}\.\d{1,2}\.\d{4}$/,/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/].some(p=>p.test(t)))return!1;const d=new Date(t);return!isNaN(d.getTime())}function ct(t){const i=new URLSearchParams(window.location.search);Object.entries(t).forEach(([p,s])=>{s===null?i.delete(p):i.set(p,String(s))});let d=window.location.pathname;d+=`?${i.toString()}`,d+=window.location.hash,window.history.replaceState({},"",d)}function ot(){const t=new URLSearchParams(window.location.search),i={};return t.forEach((d,p)=>{i[p]=d}),i}function it(t){var i,d,p,s,f,h,v,l,Y,c,_,V;return{productId:Number(t==null?void 0:t.externalId),name:t==null?void 0:t.name,sku:t==null?void 0:t.sku,topLevelSku:t==null?void 0:t.externalParentId,specialToDate:void 0,specialFromDate:void 0,newToDate:void 0,newFromDate:void 0,createdAt:void 0,updatedAt:void 0,manufacturer:void 0,countryOfManufacture:void 0,categories:void 0,productType:void 0,pricing:{regularPrice:((d=(i=t==null?void 0:t.prices)==null?void 0:i.regular)==null?void 0:d.amount)||0,minimalPrice:(s=(p=t==null?void 0:t.prices)==null?void 0:p.final)==null?void 0:s.minimumAmount,maximalPrice:(h=(f=t==null?void 0:t.prices)==null?void 0:f.final)==null?void 0:h.maximumAmount,specialPrice:(l=(v=t==null?void 0:t.prices)==null?void 0:v.final)==null?void 0:l.amount,tierPricing:void 0,currencyCode:((c=(Y=t==null?void 0:t.prices)==null?void 0:Y.final)==null?void 0:c.currency)||"USD"},canonicalUrl:t==null?void 0:t.url,mainImageUrl:(V=(_=t==null?void 0:t.images)==null?void 0:_[0])==null?void 0:V.url}}const dt={PRODUCT_CONTEXT:"productContext"},st={PRODUCT_PAGE_VIEW:"product-page-view"};function ze(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function ht(t,i){const d=ze();d.push({[t]:null}),d.push({[t]:i})}function pt(t,i){ze().push(p=>{const s=p.getState?p.getState():{};p.push({event:t,eventInfo:{...s,...i}})})}function Oe(t){const i=it(t);ht(dt.PRODUCT_CONTEXT,i),pt(st.PRODUCT_PAGE_VIEW)}const ut=({sku:t,hideSku:i,hideQuantity:d,hideShortDescription:p,hideDescription:s,hideAttributes:f,hideURLParams:h,hideSelectedOptionValue:v,slots:l,children:Y,initialData:c,carousel:_,optionsConfig:V,useACDL:R,onAddToCart:J,zoomType:oe,closeButton:b=!0,...P})=>{var N,K,U,pe;const n=G("PDP.Product.AddToCart.label").label,y=G("PDP.Product.Incrementer.label").label,k=G("PDP.Product.Details.label").label,[E,S]=F(Te.getConfig().defaultLocale||"en-US"),[A,se]=F(),[e=null,I]=F(c),[g,B]=F(()=>{const o={sku:t,quantity:1};return e!=null&&e.optionUIDs&&(o.optionsUIDs=e.optionUIDs),o}),[L,ee]=F(()=>{var o,m;return!(e!=null&&e.options&&((o=e==null?void 0:e.options)==null?void 0:o.length)>0&&((m=e==null?void 0:e.optionUIDs)==null?void 0:m.length)!==(e==null?void 0:e.options.length))}),x={data:e,values:g,valid:L};function te(o){return o==null?void 0:o.some(m=>(m==null?void 0:m.typename)==="ProductViewOptionValueProduct")}Q(()=>{const o=Le.on("pdp/setValues",m=>{B(w=>({...w,...m}))});return()=>{o==null||o.off()}},[]),Q(()=>{const o=Le.on("locale",m=>{m!==E&&(S(m),$e(t).then(I))});return()=>{o==null||o.off()}},[E,t]),Q(()=>{R&&c&&Object.keys(c).length>0&&Oe(c)},[c]);const le=re(o=>{B(m=>({...m,...o}))},[]);Q(()=>{Le.emit("pdp/values",g)},[JSON.stringify(g)]);const ae=re(o=>{var T,z;let m=Object.keys(o).map(W=>o[W].value).filter(W=>W!==void 0);!h&&(e!=null&&e.options)&&!te(e.options)&&ct({optionsUIDs:m.join(",")}),le({optionsUIDs:m}),ee((m==null?void 0:m.length)===((T=e==null?void 0:e.options)==null?void 0:T.length));const w=(z=e==null?void 0:e.options)==null?void 0:z.some(W=>te([W]));Re(t,m,V==null?void 0:V.anchorOptions,w).then(W=>{var _e;I(W),(_e=V==null?void 0:V.anchorOptions)!=null&&_e.length&&me(W,m),R&&(W==null?void 0:W.variantSku)!==t&&Oe(W)})},[t]),me=re((o,m)=>{var z;const w=(o==null?void 0:o.optionUIDs)??[];m.every(W=>w.includes(W))||(se(o==null?void 0:o.options),le({optionsUIDs:w}),ee((w==null?void 0:w.length)===((z=o==null?void 0:o.options)==null?void 0:z.length)))},[t]),he=re(o=>{Object.keys(o).length!==0&&ee(!1)},[]),$=ye(()=>{var o;return(o=e==null?void 0:e.attributes)==null?void 0:o.map(({label:m,value:w},T)=>{const z=Ve(w)?at(w,E):w.toString();return q("li",{children:[m,": ",r("span",{dangerouslySetInnerHTML:{__html:z}})]},T)})},[e==null?void 0:e.attributes,E]),ne=!d&&(e!=null&&e.inStock)?r(Z,{name:"Quantity",slot:l==null?void 0:l.Quantity,context:{...x},children:r(Xe,{name:"quantity",defaultValue:g.quantity.toString(),value:g.quantity.toString(),min:1,"aria-label":y,className:"pdp-product__quantity",onValue:o=>{le({quantity:Number(o)})}},"quantity")}):void 0,ie=()=>{if(e!=null&&e.options)return r(Z,{name:"Options",slot:l==null?void 0:l.Options,context:{...x},children:r(rt,{selectedUIDs:g.optionsUIDs,options:e.options,defaultOptions:g.optionsUIDs,selectionsToUpdate:A,hideSelectedValue:v,onValues:ae,onErrors:he})})};return r("div",{...P,children:r(Qe,{title:r(Z,{name:"Title",slot:l==null?void 0:l.Title,context:{...x},children:e==null?void 0:e.name}),sku:i?void 0:r(Z,{name:"SKU",slot:l==null?void 0:l.SKU,context:{...x},children:e==null?void 0:e.sku}),options:ie(),breadcrumbs:(l==null?void 0:l.Breadcrumbs)&&r(Z,{name:"Breadcrumbs",slot:l==null?void 0:l.Breadcrumbs,context:{...x,setSeparator(o){this._registerMethod((...m)=>{const w=o(...m),T=w&&r(Pe,{source:w});this._setProps(z=>({...z,separator:T}))})},appendLink(o){this._registerMethod((...m)=>{const{text:w,...T}=o(...m),z=r("a",{...T,children:w});this._setProps(W=>({...W,categories:[...W.categories||[],z]}))})},appendHTMLElement(o){this._registerMethod((...m)=>{const w=o(...m),T=this._htmlElementToVNode(w);this._setProps(z=>({...z,categories:[...z.categories||[],T]}))})}},render:({separator:o,categories:m})=>r(Fe,{separator:o,categories:m})}),quantity:ne,actions:r(Z,{name:"Actions",slot:l==null?void 0:l.Actions,context:{...x,appendButton(o){this._registerMethod((...m)=>{const w=o(...m);if(!w)return;const{text:T,icon:z,...W}=w,_e=r(ve,{type:"button",...W,icon:z&&r(Pe,{source:z}),children:T});this._setProps(a=>({children:[...a.children||[],_e]}))})}},children:!(l!=null&&l.Actions)&&r(ve,{size:"medium",type:"submit",icon:r(Pe,{source:"Cart"}),disabled:!(e!=null&&e.inStock)||!L,"aria-label":n,onClick:()=>J==null?void 0:J(g),children:n})}),shortDescription:p?void 0:r(Z,{name:"ShortDescription",slot:l==null?void 0:l.ShortDescription,context:{...x},children:r("div",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.shortDescription)??""}})}),description:s?void 0:r(Z,{name:"Description",slot:l==null?void 0:l.Description,context:{...x},children:r("div",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.description)??""}})}),images:((N=e==null?void 0:e.images)==null?void 0:N.map(({label:o,url:m})=>{var w,T;return r(ke,{title:o,alt:o,src:m,width:((w=_==null?void 0:_.imageParams)==null?void 0:w.width)??960,height:((T=_==null?void 0:_.imageParams)==null?void 0:T.height)??1191,params:(_==null?void 0:_.imageParams)??{width:960}},m)}))??[],specialPrice:(K=e==null?void 0:e.prices)!=null&&K.visible?r(Z,{name:"SpecialPrice",slot:l==null?void 0:l.SpecialPrice,context:{...x},children:r(Ie,{...e.prices.final,locale:De(E)})}):void 0,price:(U=e==null?void 0:e.prices)!=null&&U.visible&&e.prices.regular&&e.prices.final.amount!==(e==null?void 0:e.prices.regular.amount)?r(Z,{name:"RegularPrice",slot:l==null?void 0:l.RegularPrice,context:{...x},children:r(Ie,{...e.prices.regular,locale:De(E)})}):void 0,zoomType:oe,closeButton:b,carouselConfig:{..._,thumbnails:_&&Object.keys(_).length?((pe=e==null?void 0:e.images)==null?void 0:pe.map(({label:o,url:m})=>{var w,T;return r(ke,{title:o,alt:o,src:m,width:((w=_==null?void 0:_.thumbnailParams)==null?void 0:w.width)??200,height:((T=_==null?void 0:_.thumbnailParams)==null?void 0:T.height)??248,params:(_==null?void 0:_.thumbnailParams)??{width:200}},m)}))??[]:[]},outOfStock:!(e!=null&&e.inStock),attributes:f?void 0:r(Z,{name:"Attributes",slot:l==null?void 0:l.Attributes,context:{...x},children:$!=null&&$.length?q(Se,{children:[k,r("ul",{children:$})]}):null}),galleryContent:(l==null?void 0:l.GalleryContent)&&r(Z,{name:"GalleryContent",slot:l.GalleryContent,context:{...x}}),infoContent:(l==null?void 0:l.InfoContent)&&r(Z,{name:"InfoContent",slot:l.InfoContent,context:{...x}}),productContent:(l==null?void 0:l.Content)&&r(Z,{name:"Content",slot:l.Content,context:{...x}})})})};ut.getInitialData=async function({sku:t,optionsConfig:i}){var p,s,f,h,v,l;const d=((p=ot().optionsUIDs)==null?void 0:p.split(","))||((l=(v=(h=(f=(s=Te)==null?void 0:s.getConfig())==null?void 0:f.models)==null?void 0:h.ProductDetails)==null?void 0:v.initialData)==null?void 0:l.optionsUIDs);return d!=null&&d.length?await Re(t,d,i==null?void 0:i.anchorOptions):await $e(t)};export{ut as ProductDetails,ut as default};
@@ -1,2 +1,17 @@
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
+ */
1
16
  export * from './ProductDetails';
2
17
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +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
+ */
1
16
  /**
2
17
  * ACDL Product Types from:
3
18
  * https://github.com/adobe/commerce-events/blob/main/packages/storefront-events-sdk/src/types/schemas/product.ts
@@ -1,2 +1,17 @@
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
+ */
1
16
  export * from './product-model';
2
17
  //# sourceMappingURL=index.d.ts.map
@@ -1,3 +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
+ */
1
16
  export interface ProductModel {
2
17
  name: string;
3
18
  sku: string;
@@ -37,9 +52,9 @@ interface Prices {
37
52
  final: Price;
38
53
  visible: boolean;
39
54
  }
40
- interface Option {
55
+ export interface Option {
41
56
  id: string;
42
- type: 'text' | 'image' | 'color';
57
+ type: 'text' | 'image' | 'color' | 'dropdown';
43
58
  typename: 'ProductViewOptionValueProduct' | 'ProductViewOptionValueSwatch' | 'ProductViewOptionValueConfiguration';
44
59
  label: string;
45
60
  required: boolean;
@@ -52,6 +67,7 @@ interface OptionValue {
52
67
  inStock: boolean;
53
68
  value: string;
54
69
  selected: boolean;
70
+ product?: any;
55
71
  }
56
72
  interface Attribute {
57
73
  label: string;
@@ -1,2 +1,17 @@
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
+ */
1
16
  export * from './product-transform';
2
17
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
1
  import { ProductModel } from '../models';
2
2
 
3
- export declare function transformProductData(data: any): ProductModel | null;
3
+ export declare function transformProductData(data: any, isBundle?: boolean): ProductModel | null;
4
4
  //# sourceMappingURL=product-transform.d.ts.map
@@ -58,10 +58,15 @@ declare const _default: {
58
58
  "Close": {
59
59
  "label": "Close"
60
60
  }
61
+ },
62
+ "Zoom": {
63
+ "Close": {
64
+ "label": "Close"
65
+ }
61
66
  }
62
67
  },
63
68
  "Custom": {
64
- "quantityLabel": "Passengers"
69
+ "quantityLabel": "Quantity"
65
70
  }
66
71
  }
67
72
  ;
package/lib/date.d.ts CHANGED
@@ -1,3 +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
+ */
1
16
  export declare function toDateString(value: string, locale?: string): string;
2
17
  export declare function isDateValid(dateString: string): boolean;
3
18
  //# sourceMappingURL=date.d.ts.map
@@ -1,3 +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
+ */
1
16
  export declare function setUrlParams(params: Record<string, string | number | null>): void;
2
17
  export declare function getUrlParams(): Record<string, string>;
3
18
  //# sourceMappingURL=url-params.d.ts.map
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name": "@dropins/storefront-pdp", "version": "0.4.0-beta1", "@dropins/tools": "0.25.0"}
1
+ {"name": "@dropins/storefront-pdp", "version": "0.4.0-beta12", "@dropins/tools": "~0.26.0"}
package/render/index.d.ts CHANGED
@@ -1,2 +1,17 @@
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
+ */
1
16
  export * from './render';
2
17
  //# sourceMappingURL=index.d.ts.map
package/render.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(p,t){try{if(typeof document<"u"){const r=document.createElement("style"),e=t.styleId;for(const a in t.attributes)r.setAttribute(a,t.attributes[a]);r.setAttribute("data-dropin",e),r.appendChild(document.createTextNode(p));const o=document.querySelector('style[data-dropin="sdk"]');if(o)o.after(r);else{const a=document.querySelector('link[rel="stylesheet"], style');a?a.before(r):document.head.append(r)}}}catch(r){console.error("dropin-styles (injectCodeFunction)",r)}})(".pdp-carousel{--icon-size: 32px;--icon-extra-padding: 8px;--thumb-peak: 32px;--thumbnails-col-width: 18.6%;position:relative;display:flex;flex-direction:var(--flex-carousel);align-items:center;gap:var(--gap);width:var(--width)}.pdp-carousel--thumbnailsColumn{justify-content:flex-end;align-items:start}.pdp-carousel--thumbnailsRow{align-items:center}.pdp-carousel--arrows{padding-left:calc(var(--icon-size) + var(--icon-extra-padding));padding-right:calc(var(--icon-size) + var(--icon-extra-padding));width:calc(var(--width) - 2 * var(--icon-size) - 2 * var(--icon-extra-padding))}.pdp-carousel__button{position:absolute;top:50%;transform:translateY(-50%);padding:0}.pdp-carousel__button--prev{left:0}.pdp-carousel__button--next{right:0}.pdp-carousel__button__icon--prev{transform:rotate(90deg)}.pdp-carousel__button__icon--next{right:0;transform:rotate(-90deg)}.pdp-carousel--main-image-controls.pdp-carousel--thumbnailsColumn .pdp-carousel__button--prev{left:var(--thumbnails-col-width)}.pdp-carousel--main-image-controls.pdp-carousel--thumbnailsRow .pdp-carousel__button--prev,.pdp-carousel--main-image-controls.pdp-carousel--thumbnailsRow .pdp-carousel__button--next{top:calc(var(--height) / 2)}.pdp-carousel__button--thumbnailsColumn{margin:auto;padding:0}.pdp-carousel__button--thumbnailsRow{padding:0}.pdp-carousel__button__icon--thumbnailsColumn--prev{transform:rotate(180deg)}.pdp-carousel__button__icon--thumbnailsRow--prev{transform:rotate(90deg)}.pdp-carousel__button__icon--thumbnailsRow--next{transform:rotate(-90deg)}.pdp-carousel__wrapper{--peak: 0px;scroll-padding:var(--peak);width:var(--total-width);height:var(--height);display:flex;flex-wrap:nowrap;gap:var(--gap);-webkit-overflow-scrolling:touch}.pdp-carousel__wrapper--horizontal{overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory}.pdp-carousel__slide{display:grid;grid-gap:var(--gap);grid-auto-columns:1fr;grid-auto-rows:100%;scroll-snap-align:end;scroll-snap-stop:always;flex-shrink:0}.pdp-carousel__slide--horizontal{grid-auto-flow:column;width:calc(100% - var(--peak))}.pdp-carousel__slide--horizontal.pdp-carousel__slide--orphan{width:calc((100% / var(--per-page) * var(--length)) - var(--peak) / var(--per-page) * var(--length) - var(--gap) / var(--per-page) * (var(--per-page) - var(--length)))}.pdp-carousel__slide>*{vertical-align:middle;max-width:100%;max-height:100%}.pdp-carousel__slide>img{object-fit:contain;width:100%;height:100%}.pdp-carousel__wrapper--peak{--peak: calc(var(--spacing-medium) + var(--gap))}.pdp-carousel__wrapper--scrollbar{--scroll-foreground: var(--color-neutral-600);--scroll-background: var(--color-neutral-400);scrollbar-color:var(--scroll-foreground) var(--scroll-background);scrollbar-width:thin}.pdp-carousel__wrapper:not(.pdp-carousel__wrapper--scrollbar){scrollbar-width:none}.pdp-carousel__wrapper:not(.pdp-carousel__wrapper--scrollbar)::-webkit-scrollbar{display:none}.pdp-carousel__wrapper--scrollbar::-webkit-scrollbar{width:4px;height:4px}.pdp-carousel__wrapper--scrollbar::-webkit-scrollbar-thumb{background:var(--scroll-foreground)}.pdp-carousel__wrapper--scrollbar::-webkit-scrollbar-track{background:var(--scroll-background)}.pdp-carousel__controls__container--thumbnailsRow{--thumbnails-spacing: var(--spacing-small);--thumbnails-box-width: var(--spacing-xxsmall);--thumbnails-rest: calc(var(--thumbnails-spacing) - var(--thumbnails-box-width));--thumbnails-width: calc((var(--width) - 2 * var(--icon-size) - 4 * var(--thumbnails-spacing) - var(--thumb-peak) - 2 * var(--thumbnails-box-width)) / 4);margin-top:var(--thumbnails-rest);width:var(--width);display:flex}.pdp-carousel__controls__container--thumbnailsColumn{--thumbnails-spacing: var(--spacing-small);--thumbnails-box-width: var(--spacing-xxsmall);--thumbnails-rest: calc(var(--thumbnails-spacing) - var(--thumbnails-box-width));--thumbnails-width: 100%;width:calc(var(--thumbnails-col-width) - var(--thumbnails-rest));margin-right:var(--thumbnails-rest)}.pdp-carousel__controls__container--thumbnailsColumn:not(.pdp-carousel__controls__container--no-arrows){height:calc(max(var(--height),4 * var(--thumbnails-spacing)) - 4 * var(--thumbnails-spacing))}.pdp-carousel__controls__container--thumbnailsColumn.pdp-carousel__controls__container--no-arrows{height:var(--height)}.pdp-carousel__controls__wrapper--thumbnailsColumn{max-height:100%;overflow-y:scroll}.pdp-carousel__controls__wrapper--thumbnailsRow{max-width:100%;overflow-x:scroll}.pdp-carousel__controls--thumbnailsRow>label>span:nth-last-child(1){margin-right:var(--thumbnails-box-width)}.pdp-carousel__controls__wrapper::-webkit-scrollbar{display:none}.pdp-carousel__controls__wrapper{-ms-overflow-style:none;scrollbar-width:none}.pdp-carousel__controls{display:flex;flex-direction:row;gap:var(--spacing-xsmall)}.pdp-carousel__controls--thumbnailsColumn{display:grid;grid-template-columns:repeat(1,1fr);grid-auto-rows:1fr;grid-row-gap:var(--thumbnails-spacing);padding:var(--thumbnails-box-width)}.pdp-carousel__controls--thumbnailsRow{grid-column-gap:var(--thumbnails-spacing);padding:var(--thumbnails-box-width)}.pdp-carousel__controls__button{border-radius:50%;width:10px;height:10px;padding:0;border:none;background:var(--color-neutral-400);cursor:pointer}.pdp-carousel__controls__button:hover{background:var(--color-neutral-500)}.pdp-carousel__controls__button:active,.pdp-carousel__controls__button--active{background:var(--color-neutral-600)}.pdp-carousel__slide--last{width:100%}.pdp-carousel__thumbnail__container input[type=radio]{opacity:0;position:absolute;width:0;height:0}.pdp-carousel__thumbnail__container .pdp-carousel__thumbnail__span{display:inline-block;--bg-color: var(--color-neutral-300);box-shadow:0 0 0 var(--shape-border-width-1) var(--color-neutral-400);position:relative;cursor:pointer;background-color:var(--bg-color);background-image:var(--background-image);background-repeat:no-repeat;background-size:cover;height:100%;width:100%;overflow:hidden}.pdp-carousel__thumbnail__content{width:inherit;position:absolute;top:-9999px;bottom:-9999px;left:-9999px;right:-9999px;margin:auto;overflow:hidden}.pdp-carousel__thumbnail__span:hover{box-shadow:0 0 0 var(--shape-border-width-3) var(--color-neutral-50),0 0 0 var(--shape-border-width-4) var(--color-neutral-500);outline:none}.pdp-carousel__controls__wrapper--thumbnailsRow .pdp-carousel__thumbnail__container{min-width:100px}.pdp-carousel__thumbnail__container input[type=radio]:not(:checked):active~.pdp-carousel-thumbnail__span{box-shadow:0 0 0 var(--shape-border-width-1) var(--color-neutral-500);outline:none}.pdp-carousel__thumbnail__container input[type=radio]:checked~.pdp-carousel__thumbnail__span,.pdp-carousel__thumbnail--selected{box-shadow:0 0 0 var(--shape-border-width-3) var(--color-neutral-50),0 0 0 var(--shape-border-width-4) var(--color-neutral-800)}.pdp-carousel__thumbnail__container input[type=radio]:checked:active~.pdp-carousel__thumbnail__span{box-shadow:0 0 0 var(--shape-border-width-3) var(--color-neutral-50),0 0 0 var(--shape-border-width-4) var(--color-neutral-600)}.pdp-carousel__thumbnail__container input[type=radio]:focus-visible+.pdp-carousel__thumbnail__span{box-shadow:0 0 0 var(--shape-border-width-3) var(--color-neutral-900),0 0 0 6px var(--color-neutral-400)}.pdp-carousel__thumbnail__span>img{object-fit:cover;width:100%;height:100%}.pdp-product{display:grid;grid-template-columns:repeat(var(--grid-1-columns),1fr);grid-column-gap:var(--grid-1-gutters);margin:0 var(--grid-1-margins)}.pdp-product__gallery-column{display:none}.pdp-product__content-column{grid-column:1 / span 4;color:var(--color-neutral-800)}.pdp-product__header{display:grid;grid-auto-rows:max-content;margin-bottom:var(--spacing-medium)}.pdp-product__breadcrumbs{grid-column:1 / -1;padding:var(--spacing-medium) 0 var(--spacing-xxbig)}.pdp-product__title{font:var(--type-display-3-font);letter-spacing:var(--type-display-3-letter-spacing);margin:0}.pdp-product__sku{font:var(--type-body-1-default-font);max-width:600px}.pdp-product__prices{display:flex;gap:var(--spacing-xsmall);margin-top:var(--spacing-medium)}.pdp-product__out-of-stock__text{font:var(--type-headline-2-strong-font)}.pdp-product__options{grid-column:1 / span 4}.pdp-product__price,.pdp-product__price-special{font:var(--type-headline-2-strong-font)}.pdp-product__price,.pdp-product__sku,.pdp-product__price-special,.pdp-product__out-of-stock__text{letter-spacing:var(--type-headline-2-strong-letter-spacing)}.pdp-product__price--grey{color:var(--color-neutral-500)}.pdp-product__actions,.pdp-product__actions--out-of-stock{display:grid;grid-auto-flow:row;gap:var(--grid-1-gutters);grid-auto-rows:max-content;margin-bottom:var(--spacing-xxbig);margin-top:var(--spacing-big)}.pdp-product__short_description,.pdp-product__attributes{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin-bottom:var(--spacing-small)}.pdp-product__description,.pdp-product__attributes li{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.pdp-product__attributes{margin-top:var(--spacing-xsmall)}.pdp-product__short_description p,.pdp-product__description p,.pdp-product__attributes li p{margin:0}.pdp-product__short_description figure,.pdp-product__description figure{margin:0}.pdp-product__short_description img,.pdp-product__description img{max-width:100%}.pdp-product__images--carousel{max-height:60vh}.pdp-product__images--carousel--thumbnails{max-height:90vh}.pdp-product__images__placeholder{background-color:var(--color-neutral-200)}.pdp-product__buttons{display:grid;grid-auto-rows:max-content;grid-gap:var(--grid-1-gutters)}.pdp-product__buttons a{text-align:center}.pdp-product__buttons a:hover{text-decoration:none}.pdp-product__overlay .pdp-overlay__content{width:100%;height:100%}.pdp-product__overlay__carousel{width:100%;height:100%;box-sizing:border-box}.pdp-product__overlay__carousel img{width:100%;height:100%;object-fit:contain}.pdp-carousel__controls__container--thumbnailsRow img,.pdp-carousel__controls__container--thumbnailsColumn img{object-fit:cover}.pdp-product__quantity,.pdp-product__buttons{grid-column:1 / span 4}@media only screen and (min-width: 1024px){.pdp-product__breadcrumbs{grid-column:2 / -2}.pdp-product{grid-template-columns:repeat(var(--grid-3-columns),1fr);grid-column-gap:var(--grid-3-gutters);margin:0 var(--grid-3-margins);position:relative}.pdp-product__column-container{position:relative;display:flex;flex-direction:column}.pdp-product__column-body{position:sticky;bottom:30%;align-self:flex-end}.pdp-product__gallery-column{display:block;grid-column:2 / span 6}.pdp-product__content-column{grid-column:8 / span 4;padding-top:var(--spacing-medium)}.pdp-product__images--carousel{display:none}.pdp-product__header{margin-bottom:var(--spacing-small)}.pdp-product__actions{grid-template-columns:repeat(var(--grid-1-columns),1fr);grid-column-gap:var(--grid-1-gutters);grid-row-gap:var(--spacing-xxbig);margin-top:var(--spacing-xxbig)}.pdp-product__quantity{grid-column:1 / span 2}.pdp-product__actions--out-of-stock{grid-template-columns:repeat(var(--grid-1-columns),1fr);grid-column-gap:var(--grid-1-gutters);grid-row-gap:var(--spacing-xxbig);margin-top:var(--spacing-small)}.pdp-product__buttons{grid-column:1 / span 4}.pdp-product__out-of-stock__text{grid-column:1 / span 2}.pdp-product__gallery-content,.pdp-product__content{grid-column:2 / span 6}}.pdp-gallery-grid{display:grid;grid-gap:var(--gap);grid-template-columns:repeat(1,1fr);grid-auto-rows:max-content}.pdp-gallery-grid__item>*{height:100%;max-width:100%;min-width:100%;vertical-align:middle;width:100%;object-fit:contain}.pdp-gallery-grid__item:only-child{grid-column:1 / span 2}.pdp-gallery-grid__item:first-child:nth-last-child(2){grid-column:1 / span 2;grid-row:1}.pdp-gallery-grid__item:nth-child(2):last-child{grid-column:1 / 3;grid-row:2}@media only screen and (min-width: 1024px){.pdp-gallery-grid{grid-template-columns:repeat(2,1fr)}}.pdp-price-range .dropin-price{letter-spacing:var(--type-headline-2-strong-letter-spacing);font:var(--type-headline-2-strong-font)}.pdp-price-range__label{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin-left:5px;margin-right:5px}.pdp-overlay{position:fixed;top:0;left:0;z-index:1000;right:0;bottom:0;background-color:var(--color-neutral-50);display:flex;padding:var(--spacing-medium)}.pdp-overlay--centered{align-items:center;justify-content:center}.pdp-overlay__close-button{position:absolute;top:var(--spacing-medium);right:var(--spacing-medium);z-index:1001}.pdp-swatches{display:grid;grid-auto-flow:row;grid-gap:var(--grid-1-gutters);grid-auto-rows:max-content}.pdp-swatches__field{display:grid;font:var(--type-body-2-strong-font);grid-auto-rows:max-content;gap:var(--spacing-xsmall)}.pdp-swatches__field__label{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-neutral-800)}.pdp-swatches__options{display:flex;flex-wrap:wrap;gap:var(--spacing-xsmall)}.pdp-zoom{cursor:zoom-in}.pdp-zoom img{transition:transform .2s}",{styleId:"PDP"});
2
- import{deepmerge as c,Render as u}from"@dropins/tools/lib.js";import{useState as f,useEffect as m}from"@dropins/tools/preact-hooks.js";import{UIProvider as b}from"@dropins/tools/components.js";import{events as d}from"@dropins/tools/event-bus.js";import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{c as g}from"./chunks/initialize.js";const P={Product:{Incrementer:{label:"Item Quantity"},OutOfStock:{label:"Out of Stock"},AddToCart:{label:"Add to Cart"},Details:{label:"Details"},RegularPrice:{label:"Regular Price"},SpecialPrice:{label:"Special Price"},PriceRange:{From:{label:"From"},To:{label:"to"}},Image:{label:"{product} Image {key} of {total}"}},Swatches:{Required:{label:"Required"}},Carousel:{label:"Carousel",Next:{label:"Next"},Previous:{label:"Previous"},Slide:{label:"Slide"},Controls:{label:"Carousel Controls",Button:{label:"Show slide {key} of {total}"}}},Overlay:{Close:{label:"Close"}}},C={quantityLabel:"Passengers"},p={PDP:P,Custom:C},S={default:p},D=({children:a})=>{var t;const[e,i]=f(),n=(t=g.getConfig())==null?void 0:t.langDefinitions;m(()=>{const o=d.on("locale",l=>{l!==e&&i(l)},{eager:!0});return()=>{o==null||o.off()}},[e]);const s=c(S,n??{});return r(b,{lang:e,langDefinitions:s,children:a})},O=new u(r(D,{}));export{O as render};
1
+ (function(p,o){try{if(typeof document<"u"){const r=document.createElement("style"),e=o.styleId;for(const a in o.attributes)r.setAttribute(a,o.attributes[a]);r.setAttribute("data-dropin",e),r.appendChild(document.createTextNode(p));const t=document.querySelector('style[data-dropin="sdk"]');if(t)t.after(r);else{const a=document.querySelector('link[rel="stylesheet"], style');a?a.before(r):document.head.append(r)}}}catch(r){console.error("dropin-styles (injectCodeFunction)",r)}})(".pdp-carousel{--icon-size: 32px;--icon-extra-padding: 8px;--thumb-peak: 32px;--thumbnails-col-width: 18.6%;position:relative;display:flex;flex-direction:var(--flex-carousel);align-items:center;gap:var(--gap);width:var(--width)}.pdp-carousel--thumbnailsColumn{justify-content:flex-end;align-items:start}.pdp-carousel--thumbnailsRow{align-items:center}.pdp-carousel--arrows{padding-left:calc(var(--icon-size) + var(--icon-extra-padding));padding-right:calc(var(--icon-size) + var(--icon-extra-padding));width:calc(var(--width) - 2 * var(--icon-size) - 2 * var(--icon-extra-padding))}.pdp-carousel__button{position:absolute;top:50%;transform:translateY(-50%);padding:0}.pdp-carousel__button--prev{left:0}.pdp-carousel__button--next{right:0}.pdp-carousel__button__icon--prev{transform:rotate(90deg)}.pdp-carousel__button__icon--next{right:0;transform:rotate(-90deg)}.pdp-carousel--main-image-controls.pdp-carousel--thumbnailsColumn .pdp-carousel__button--prev{left:var(--thumbnails-col-width)}.pdp-carousel--main-image-controls.pdp-carousel--thumbnailsRow .pdp-carousel__button--prev,.pdp-carousel--main-image-controls.pdp-carousel--thumbnailsRow .pdp-carousel__button--next{top:calc(var(--height) / 2)}.pdp-carousel__button--thumbnailsColumn{margin:auto;padding:0}.pdp-carousel__button--thumbnailsRow{padding:0}.pdp-carousel__button__icon--thumbnailsColumn--prev{transform:rotate(180deg)}.pdp-carousel__button__icon--thumbnailsRow--prev{transform:rotate(90deg)}.pdp-carousel__button__icon--thumbnailsRow--next{transform:rotate(-90deg)}.pdp-carousel__wrapper{--peak: 0px;scroll-padding:var(--peak);width:var(--total-width);height:var(--height);display:flex;flex-wrap:nowrap;gap:var(--gap);-webkit-overflow-scrolling:touch}.pdp-carousel__wrapper--horizontal{overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory}.pdp-carousel__slide{display:grid;grid-gap:var(--gap);grid-auto-columns:1fr;grid-auto-rows:100%;scroll-snap-align:end;scroll-snap-stop:always;flex-shrink:0}.pdp-carousel__slide--horizontal{grid-auto-flow:column;width:calc(100% - var(--peak))}.pdp-carousel__slide--horizontal.pdp-carousel__slide--orphan{width:calc((100% / var(--per-page) * var(--length)) - var(--peak) / var(--per-page) * var(--length) - var(--gap) / var(--per-page) * (var(--per-page) - var(--length)))}.pdp-carousel__slide>*{vertical-align:middle;max-width:100%;max-height:100%}.pdp-carousel__slide>img{object-fit:contain;width:100%;height:100%}.pdp-carousel__wrapper--peak{--peak: calc(var(--spacing-medium) + var(--gap))}.pdp-carousel__wrapper--scrollbar{--scroll-foreground: var(--color-neutral-600);--scroll-background: var(--color-neutral-400);scrollbar-color:var(--scroll-foreground) var(--scroll-background);scrollbar-width:thin}.pdp-carousel__wrapper:not(.pdp-carousel__wrapper--scrollbar){scrollbar-width:none}.pdp-carousel__wrapper:not(.pdp-carousel__wrapper--scrollbar)::-webkit-scrollbar{display:none}.pdp-carousel__wrapper--scrollbar::-webkit-scrollbar{width:4px;height:4px}.pdp-carousel__wrapper--scrollbar::-webkit-scrollbar-thumb{background:var(--scroll-foreground)}.pdp-carousel__wrapper--scrollbar::-webkit-scrollbar-track{background:var(--scroll-background)}.pdp-carousel__controls__container--thumbnailsRow{--thumbnails-spacing: var(--spacing-small);--thumbnails-box-width: var(--spacing-xxsmall);--thumbnails-rest: calc(var(--thumbnails-spacing) - var(--thumbnails-box-width));--thumbnails-width: calc((var(--width) - 2 * var(--icon-size) - 4 * var(--thumbnails-spacing) - var(--thumb-peak) - 2 * var(--thumbnails-box-width)) / 4);margin-top:var(--thumbnails-rest);width:var(--width);display:flex}.pdp-carousel__controls__container--thumbnailsColumn{--thumbnails-spacing: var(--spacing-small);--thumbnails-box-width: var(--spacing-xxsmall);--thumbnails-rest: calc(var(--thumbnails-spacing) - var(--thumbnails-box-width));--thumbnails-width: 100%;width:calc(var(--thumbnails-col-width) - var(--thumbnails-rest));margin-right:var(--thumbnails-rest)}.pdp-carousel__controls__container--thumbnailsColumn:not(.pdp-carousel__controls__container--no-arrows){height:calc(max(var(--height),4 * var(--thumbnails-spacing)) - 4 * var(--thumbnails-spacing))}.pdp-carousel__controls__container--thumbnailsColumn.pdp-carousel__controls__container--no-arrows{height:var(--height)}.pdp-carousel__controls__wrapper--thumbnailsColumn{max-height:100%;overflow-y:scroll}.pdp-carousel__controls__wrapper--thumbnailsRow{max-width:100%;overflow-x:scroll}.pdp-carousel__controls--thumbnailsRow>label>span:nth-last-child(1){margin-right:var(--thumbnails-box-width)}.pdp-carousel__controls__wrapper::-webkit-scrollbar{display:none}.pdp-carousel__controls__wrapper{-ms-overflow-style:none;scrollbar-width:none}.pdp-carousel__controls{display:flex;flex-direction:row;gap:var(--spacing-xsmall)}.pdp-carousel__controls--thumbnailsColumn{display:grid;grid-template-columns:repeat(1,1fr);grid-auto-rows:1fr;grid-row-gap:var(--thumbnails-spacing);padding:var(--thumbnails-box-width)}.pdp-carousel__controls--thumbnailsRow{grid-column-gap:var(--thumbnails-spacing);padding:var(--thumbnails-box-width)}.pdp-carousel__controls__button{border-radius:50%;width:10px;height:10px;padding:0;border:none;background:var(--color-neutral-400);cursor:pointer}.pdp-carousel__controls__button:hover{background:var(--color-neutral-500)}.pdp-carousel__controls__button:active,.pdp-carousel__controls__button--active{background:var(--color-neutral-600)}.pdp-carousel__slide--last{width:100%}.pdp-carousel__thumbnail__container input[type=radio]{opacity:0;position:absolute;width:0;height:0}.pdp-carousel__thumbnail__container .pdp-carousel__thumbnail__span{display:inline-block;--bg-color: var(--color-neutral-300);box-shadow:0 0 0 var(--shape-border-width-1) var(--color-neutral-400);position:relative;cursor:pointer;background-color:var(--bg-color);background-image:var(--background-image);background-repeat:no-repeat;background-size:cover;height:100%;width:100%;overflow:hidden}.pdp-carousel__thumbnail__content{width:inherit;position:absolute;top:-9999px;bottom:-9999px;left:-9999px;right:-9999px;margin:auto;overflow:hidden}.pdp-carousel__thumbnail__span:hover{box-shadow:0 0 0 var(--shape-border-width-3) var(--color-neutral-50),0 0 0 var(--shape-border-width-4) var(--color-neutral-500);outline:none}.pdp-carousel__controls__wrapper--thumbnailsRow .pdp-carousel__thumbnail__container{min-width:100px}.pdp-carousel__thumbnail__container input[type=radio]:not(:checked):active~.pdp-carousel-thumbnail__span{box-shadow:0 0 0 var(--shape-border-width-1) var(--color-neutral-500);outline:none}.pdp-carousel__thumbnail__container input[type=radio]:checked~.pdp-carousel__thumbnail__span,.pdp-carousel__thumbnail--selected{box-shadow:0 0 0 var(--shape-border-width-3) var(--color-neutral-50),0 0 0 var(--shape-border-width-4) var(--color-neutral-800)}.pdp-carousel__thumbnail__container input[type=radio]:checked:active~.pdp-carousel__thumbnail__span{box-shadow:0 0 0 var(--shape-border-width-3) var(--color-neutral-50),0 0 0 var(--shape-border-width-4) var(--color-neutral-600)}.pdp-carousel__thumbnail__container input[type=radio]:focus-visible+.pdp-carousel__thumbnail__span{box-shadow:0 0 0 var(--shape-border-width-3) var(--color-neutral-900),0 0 0 6px var(--color-neutral-400)}.pdp-carousel__thumbnail__span>img{object-fit:cover;width:100%;height:100%}.pdp-product{display:grid;grid-template-columns:repeat(var(--grid-1-columns),1fr);grid-column-gap:var(--grid-1-gutters);margin:0 var(--grid-1-margins)}.pdp-product__gallery-column{display:none}.pdp-product__content-column{grid-column:1 / span 4;color:var(--color-neutral-800)}.pdp-product__header{display:grid;grid-auto-rows:max-content;margin-bottom:var(--spacing-medium)}.pdp-product__breadcrumbs{grid-column:1 / -1;padding:var(--spacing-medium) 0 var(--spacing-xxbig)}.pdp-product__title{font:var(--type-display-3-font);letter-spacing:var(--type-display-3-letter-spacing);margin:0}.pdp-product__sku{font:var(--type-body-1-default-font);max-width:600px}.pdp-product__prices{display:flex;gap:var(--spacing-xsmall);margin-top:var(--spacing-medium)}.pdp-product__out-of-stock__text{font:var(--type-headline-2-strong-font)}.pdp-product__options{grid-column:1 / span 4}.pdp-product__price,.pdp-product__price-special{font:var(--type-headline-2-strong-font)}.pdp-product__price,.pdp-product__sku,.pdp-product__price-special,.pdp-product__out-of-stock__text{letter-spacing:var(--type-headline-2-strong-letter-spacing)}.pdp-product__price--grey{color:var(--color-neutral-500)}.pdp-product__actions,.pdp-product__actions--out-of-stock{display:grid;grid-auto-flow:row;gap:var(--grid-1-gutters);grid-auto-rows:max-content;margin-bottom:var(--spacing-xxbig);margin-top:var(--spacing-big)}.pdp-product__short_description,.pdp-product__attributes{font:var(--type-body-1-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin-bottom:var(--spacing-small)}.pdp-product__description,.pdp-product__attributes li{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.pdp-product__attributes{margin-top:var(--spacing-xsmall)}.pdp-product__short_description p,.pdp-product__description p,.pdp-product__attributes li p{margin:0}.pdp-product__short_description figure,.pdp-product__description figure{margin:0}.pdp-product__short_description img,.pdp-product__description img{max-width:100%}.pdp-product__images--carousel{max-height:60vh}.pdp-product__images--carousel--thumbnails{max-height:90vh}.pdp-product__images__placeholder{background-color:var(--color-neutral-200)}.pdp-product__buttons{display:grid;grid-auto-rows:max-content;grid-gap:var(--grid-1-gutters)}.pdp-product__buttons a{text-align:center}.pdp-product__buttons a:hover{text-decoration:none}.pdp-product__overlay .pdp-overlay__content{width:100%;height:100%}.pdp-product__overlay__carousel{width:100%;height:100%;box-sizing:border-box}.pdp-product__overlay__carousel img{width:100%;height:100%;object-fit:contain}.pdp-carousel__controls__container--thumbnailsRow img,.pdp-carousel__controls__container--thumbnailsColumn img{object-fit:cover}.pdp-product__quantity,.pdp-product__buttons{grid-column:1 / span 4}@media only screen and (min-width: 1024px){.pdp-product__breadcrumbs{grid-column:2 / -2}.pdp-product{grid-template-columns:repeat(var(--grid-3-columns),1fr);grid-column-gap:var(--grid-3-gutters);margin:0 var(--grid-3-margins);position:relative}.pdp-product__column-container{position:relative;display:flex;flex-direction:column}.pdp-product__column-body{position:sticky;bottom:30%;align-self:flex-end}.pdp-product__gallery-column{display:block;grid-column:2 / span 6}.pdp-product__content-column{grid-column:8 / span 4;padding-top:var(--spacing-medium)}.pdp-product__images--carousel{display:none}.pdp-product__header{margin-bottom:var(--spacing-small)}.pdp-product__actions{grid-template-columns:repeat(var(--grid-1-columns),1fr);grid-column-gap:var(--grid-1-gutters);grid-row-gap:var(--spacing-xxbig);margin-top:var(--spacing-xxbig)}.pdp-product__quantity{grid-column:1 / span 2}.pdp-product__actions--out-of-stock{grid-template-columns:repeat(var(--grid-1-columns),1fr);grid-column-gap:var(--grid-1-gutters);grid-row-gap:var(--spacing-xxbig);margin-top:var(--spacing-small)}.pdp-product__buttons{grid-column:1 / span 4}.pdp-product__out-of-stock__text{grid-column:1 / span 2}.pdp-product__gallery-content,.pdp-product__content{grid-column:2 / span 6}}.pdp-gallery-grid{display:grid;grid-gap:var(--gap);grid-template-columns:repeat(1,1fr);grid-auto-rows:max-content}.pdp-gallery-grid__item>*{height:100%;max-width:100%;min-width:100%;vertical-align:middle;width:100%;object-fit:contain}.pdp-gallery-grid__item:only-child{grid-column:1 / span 2}.pdp-gallery-grid__item:first-child:nth-last-child(2){grid-column:1 / span 2;grid-row:1}.pdp-gallery-grid__item:nth-child(2):last-child{grid-column:1 / 3;grid-row:2}@media only screen and (min-width: 1024px){.pdp-gallery-grid{grid-template-columns:repeat(2,1fr)}}.pdp-price-range .dropin-price{letter-spacing:var(--type-headline-2-strong-letter-spacing);font:var(--type-headline-2-strong-font)}.pdp-price-range__label{font:var(--type-headline-2-strong-font);letter-spacing:var(--type-body-1-strong-letter-spacing);margin-left:5px;margin-right:5px}.pdp-overlay{position:fixed;top:0;left:0;z-index:1000;right:0;bottom:0;background-color:var(--color-neutral-50);display:flex;padding:var(--spacing-medium)}.pdp-overlay--centered{align-items:center;justify-content:center}.pdp-overlay__close-button{position:absolute;top:var(--spacing-medium);right:var(--spacing-medium);z-index:1001}.pdp-swatches{display:grid;grid-auto-flow:row;grid-gap:var(--grid-1-gutters);grid-auto-rows:max-content}.pdp-swatches__field{display:grid;font:var(--type-body-2-strong-font);grid-auto-rows:max-content;gap:var(--spacing-xsmall)}.pdp-swatches__field__label{font:var(--type-details-caption-1-font);letter-spacing:var(--type-details-caption-1-letter-spacing);color:var(--color-neutral-800)}.pdp-swatches__options{display:flex;flex-wrap:wrap;gap:var(--spacing-xsmall)}.pdp-zoom{cursor:zoom-in;overflow:hidden;margin:0;position:relative}.pdp-zoom img{height:100%;max-width:100%;min-width:100%;object-fit:contain;position:relative;transition:transform .2s;transform:var(--transform);vertical-align:middle;width:100%}.pdp-zoom .pdp-zoom__close-button{background-color:var(--color-neutral-50);border-radius:50%;position:absolute;right:var(--spacing-small);top:var(--spacing-small)}.pdp-zoom.pdp-zoom--zoomed{cursor:zoom-out}.pdp-zoom.pdp-zoom--no-effects{cursor:default}@media only screen and (max-width: 768px){.pdp-zoom img{display:block;width:100%;height:100%;transition:transform .2s;transform:var(--transform)}}",{styleId:"PDP"});
2
+ import{deepmerge as c,Render as u}from"@dropins/tools/lib.js";import{useState as f,useEffect as m}from"@dropins/tools/preact-hooks.js";import{UIProvider as b}from"@dropins/tools/components.js";import{events as d}from"@dropins/tools/event-bus.js";import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{c as g}from"./chunks/initialize.js";const C={Product:{Incrementer:{label:"Item Quantity"},OutOfStock:{label:"Out of Stock"},AddToCart:{label:"Add to Cart"},Details:{label:"Details"},RegularPrice:{label:"Regular Price"},SpecialPrice:{label:"Special Price"},PriceRange:{From:{label:"From"},To:{label:"to"}},Image:{label:"{product} Image {key} of {total}"}},Swatches:{Required:{label:"Required"}},Carousel:{label:"Carousel",Next:{label:"Next"},Previous:{label:"Previous"},Slide:{label:"Slide"},Controls:{label:"Carousel Controls",Button:{label:"Show slide {key} of {total}"}}},Overlay:{Close:{label:"Close"}},Zoom:{Close:{label:"Close"}}},P={quantityLabel:"Quantity"},p={PDP:C,Custom:P},S={default:p},D=({children:a})=>{var l;const[e,i]=f(),n=(l=g.getConfig())==null?void 0:l.langDefinitions;m(()=>{const o=d.on("locale",t=>{t!==e&&i(t)},{eager:!0});return()=>{o==null||o.off()}},[e]);const s=c(S,n??{});return r(b,{lang:e,langDefinitions:s,children:a})},O=new u(r(D,{}));export{O as render};