@dropins/storefront-pdp 0.2.3-beta9 → 0.4.0-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api/fetch-graphql/fetch-graphql.d.ts +15 -0
- package/api/fetch-graphql/index.d.ts +15 -0
- package/api/getProductData/graphql/getProductData.graphql.d.ts +15 -0
- package/api/getProductData/index.d.ts +15 -0
- package/api/getRefinedProduct/graphql/RefineProductQuery.graphql.d.ts +15 -0
- package/api/getRefinedProduct/index.d.ts +15 -0
- package/api/graphql/ProductFragment.graphql.d.ts +15 -0
- package/api/graphql/ProductOptionFragment.graphql.d.ts +15 -0
- package/api/index.d.ts +15 -0
- package/api/initialize/index.d.ts +15 -0
- package/chunks/getRefinedProduct.js +6 -6
- package/components/Carousel/index.d.ts +15 -0
- package/components/GalleryGrid/index.d.ts +15 -0
- package/components/Overlay/index.d.ts +15 -0
- package/components/PriceRange/index.d.ts +15 -0
- package/components/Product/index.d.ts +15 -0
- package/components/Swatches/Swatches.d.ts +2 -8
- package/components/Swatches/index.d.ts +15 -0
- package/components/index.d.ts +15 -0
- package/containers/ProductDetails/ProductDetails.d.ts +1 -1
- package/containers/ProductDetails/index.d.ts +15 -0
- package/containers/ProductDetails.js +1 -1
- package/containers/index.d.ts +15 -0
- package/data/models/acdl-models.d.ts +15 -0
- package/data/models/index.d.ts +15 -0
- package/data/models/product-model.d.ts +15 -0
- package/data/transforms/index.d.ts +15 -0
- package/lib/date.d.ts +15 -0
- package/lib/url-params.d.ts +15 -0
- package/package.json +1 -1
- package/render/index.d.ts +15 -0
|
@@ -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,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:
|
|
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=`
|
|
2
2
|
fragment ProductOptionFragment on ProductViewOption {
|
|
3
3
|
id
|
|
4
4
|
title
|
|
@@ -137,8 +137,8 @@ fragment ProductFragment on ProductView {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
${
|
|
141
|
-
`,
|
|
140
|
+
${U}
|
|
141
|
+
`,q=`
|
|
142
142
|
query GET_PRODUCT_DATA($skus: [String]) {
|
|
143
143
|
products(skus: $skus) {
|
|
144
144
|
...ProductFragment
|
|
@@ -146,7 +146,7 @@ query GET_PRODUCT_DATA($skus: [String]) {
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
${G}
|
|
149
|
-
`,rt=async e=>{var u,n,
|
|
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=`
|
|
150
150
|
query REFINE_PRODUCT_QUERY(
|
|
151
151
|
$optionIds: [String!]!
|
|
152
152
|
$sku: String!
|
|
@@ -168,7 +168,7 @@ query REFINE_PRODUCT_QUERY(
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
${G}
|
|
171
|
-
`;async function
|
|
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
172
|
ProductOption${o}: refineProduct(
|
|
173
173
|
optionIds: [
|
|
174
174
|
${t.map(u=>`"${u}"`).join(", ")}
|
|
@@ -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,
|
|
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};
|
|
@@ -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
|
|
@@ -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
|
package/components/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 './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[];
|
|
@@ -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 X,Children as ae,useRef as ye,useMemo as we,useEffect as ne,useCallback as Z}from"@dropins/tools/preact-compat.js";import{debounce as Le,classes as g,VComponent as H,toLanguageTag as Ne,Slot as j}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 qe,Incrementer as je,Breadcrumbs as Ge,Image as De}from"@dropins/tools/components.js";import{jsxs as U,jsx as n,Fragment as fe}from"@dropins/tools/preact-jsx-runtime.js";import{useText as V}from"@dropins/tools/i18n.js";import{c as xe,d as $e}from"../chunks/getRefinedProduct.js";import{events as ze}from"@dropins/tools/event-bus.js";import{c as Oe}from"../chunks/initialize.js";import"@dropins/tools/fetch-graphql.js";const Fe=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"})),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",{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"})),Qe=24,ke=16,me=2,Xe="32";var Be=(e=>(e[e.small=16]="small",e[e.medium=24]="medium",e[e.large=64]="large",e))(Be||{});const be=({show:e=1,scrollbar:o=!1,peak:u=!1,arrows:m=!1,controls:h="dots",arrowsOnMainImage:y=!1,loop:p=!1,gap:f=null,direction:l="horizontal",width:K="100%",height:a="100%",defaultIndex:b=0,className:B,children:q,thumbnails:J=null,isZoomed:N,...A})=>{const _=V("PDP.Carousel.label").label,r=V("PDP.Carousel.Slide.label").label,D=V("PDP.Carousel.Previous.label").label,M=V("PDP.Carousel.Next.label").label,S=V("PDP.Carousel.Controls.label").label,Y=V("PDP.Carousel.Controls.Button.label").label,[t,le]=X(()=>ge(e)),x=Math.ceil(ae.count(q)/t),$=u?Qe:0,C=f?Be[f]:0,F=ae.count(q)%t,[v,oe]=X(p?b+1:b),re=ye([]),[ce,se]=X(0),[ee,he]=X(0),de=we(()=>ae.toArray(J),[J]),I=we(()=>{const c=ae.toArray(q).reduce((i,L,k)=>k%t===0?[...i,[L]]:[...i.slice(0,-1),[...i[i.length-1],L]],[]);return!p||c.length===1?c:p&&ae.count(q)%t===0?[c[x-1]].concat(c).concat([c[0],c[1]]):[ae.toArray(q).slice(-t)].concat(c).concat([c[0],c[1]])},[q,t,x,p]),T=ye(null),Q=ye(null),O=h==="thumbnailsRow"||h==="thumbnailsColumn";ne(()=>{const c=document.body,i=Le(()=>{var R,te;se(((R=T.current)==null?void 0:R.offsetWidth)??0),he(((te=T.current)==null?void 0:te.offsetHeight)??0);const k=window.innerWidth,W=ge(e,k);W!==t&&le(W)},50),L=new ResizeObserver(i);return L.observe(c),()=>{L.unobserve(c)}},[t,e]);const d=Z(c=>{const i=p?c-1:c,L=re==null?void 0:re.current[0],k=(L==null?void 0:L.offsetWidth)+ke,W=(L==null?void 0:L.offsetHeight)+ke,R=Q.current,te=h==="thumbnailsRow",Ae=h==="thumbnailsColumn",ie=te?R==null?void 0:R.offsetWidth:R==null?void 0:R.offsetHeight,z=te?k:W;(te||Ae)&&ie&&(z*(i+1)>ie&&(R.style.scrollBehavior="smooth",te?R.scrollLeft=(i+me)*z:R.scrollTop=(i+me)*z),(te?R.scrollLeft:R.scrollTop)>z*i&&(R.style.scrollBehavior="smooth",te?R.scrollLeft=(i-me)*z:R.scrollTop=(i-me)*z))},[h,p]);ne(()=>{d(v)},[v,d]);const s=Z((c,i,L)=>{O&&d(c);const k=T.current,W=$?k.offsetWidth-$:k.offsetWidth-$+C;if(!Array.from(k.querySelectorAll("[data-index]")).filter(ie=>{const z=Number(ie.getAttribute("data-index"));return!isNaN(z)&&z>-1})[c])return;if(L){const ie=c===0?x:0,z=W*(x+(F||t)/t);if(k.scrollLeft>=0&&k.scrollLeft<W-5){s(1,!0);return}if(k.scrollLeft>z-W&&k.scrollLeft<=z){s(x,!0);return}k.style.scrollBehavior="auto",k.scrollLeft=ie===0?0:z,s(ie===0?1:x,!0);return}const Ae=(k.offsetWidth-C)/t*I[c].length-$;k.style.scrollBehavior=i?"smooth":"auto",k.scrollLeft=I[c].length===t?W*c:W*(c-1)+Ae},[C,x,$,t,F,I,d,h]),P=Z(()=>{if(p){const i=v-1;s(i,!0,v===1);return}const c=v<=0?0:v-1;s(c,!0)},[v,s,p]),w=Z(()=>{const c=I.length-1;if(p){const L=v+1;s(L,!0,v===x);return}const i=v>=c?c:v+1;s(i,!0)},[I.length,p,v,s,x]);ne(()=>{const c=i=>{i.key==="ArrowLeft"&&(i.preventDefault(),P()),i.key==="ArrowRight"&&(i.preventDefault(),w())};return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c)}},[w,P]),ne(()=>{s(p?b+1:b,!1)},[b,s,p]);const E=Le(()=>{const c=T.current,i=$?c.offsetWidth-$:c.offsetWidth-$+C,L=c.scrollLeft/i,k=Math.round(L)-L<1?Math.round(L):Math.ceil(L);if(O&&d(k),p){const W=i*(x+(F||t)/t);if(Math.ceil(c.scrollLeft)>=Math.ceil(W)-5){c.style.scrollBehavior="auto",c.scrollLeft=c.offsetWidth*1+(Math.ceil(c.scrollLeft)-Math.ceil(W)-$);return}if(c.scrollLeft===0){c.style.scrollBehavior="auto",c.scrollLeft=W-c.offsetWidth+$;return}}v!==k&&oe(k)},100);ne(()=>{const c=T.current;return c==null||c.addEventListener("scroll",E),()=>{c==null||c.removeEventListener("scroll",E)}},[E]);const G=(c,i,L)=>n(Pe,{className:g([["pdp-carousel__button",!c],[`pdp-carousel__button--${i}`,!c],[`pdp-carousel__button--${h}`,c]]),style:{"--height":`${ee}px`},variant:"tertiary","aria-label":i==="next"?M:D,onClick:L,disabled:p?!1:i==="next"?v>=I.length-1:v<1,children:n(ve,{className:g([["pdp-carousel__button__icon",!c],[`pdp-carousel__button__icon--${i}`,!c],[`pdp-carousel__button__icon--${h}--${i}`,c]]),size:Xe,source:Fe})}),ue=m&&I.length!=1&&G(O,"prev",P),_e=m&&I.length!=1&&G(O,"next",w),Te=m&&I.length!=1&&G(!1,"prev",P),We=m&&I.length!=1&&G(!1,"next",w);return U("div",{role:"region","aria-roledescription":_,className:g(["pdp-carousel",["pdp-carousel--main-image-controls",y],["pdp-carousel--arrows",m&&!O],[`pdp-carousel--${h}`,O],B]),style:{"--flex-carousel":h==="thumbnailsColumn"?"row-reverse":"column","--gap":O?"0":"var(--spacing-small)","--width":K},...A,children:[n("div",{ref:T,className:g(["pdp-carousel__wrapper",`pdp-carousel__wrapper--${l}`,["pdp-carousel__wrapper--scrollbar",o],["pdp-carousel__wrapper--peak",u]]),style:{"--total-width":h==="thumbnailsColumn"?"81.6%":"100%","--height":h==="thumbnailsColumn"?"auto":a,"--gap":f?`var(--spacing-${f})`:"0px","--per-page":t},tabIndex:0,children:I.map((c,i)=>{const L=c.length<t;return n("div",{role:"group","aria-roledescription":r,"data-index":i,className:g(["pdp-carousel__slide",`pdp-carousel__slide--${l}`,["pdp-carousel__slide--active",v===i],["pdp-carousel__slide--orphan",L]]),style:{"--length":c.length},children:c},i)})}),!O&&U(fe,{children:[ue,_e]}),O&&y&&U(fe,{children:[Te,We]}),h&&I.length!=1&&U("div",{className:g([[`pdp-carousel__controls__container--${h}`,O],["pdp-carousel__controls__container--no-arrows",!m||y]]),style:{"--width":h==="thumbnailsRow"?`${ce}px`:K,"--height":`${ee}px`,"--nr-thumbnails":de.length},children:[(O||N)&&!y&&ue,n("div",{ref:Q,className:g([[`pdp-carousel__controls__wrapper--${h}`,O],["pdp-carousel__controls__wrapper",O]]),children:n("div",{role:"group","aria-label":S,className:g(["pdp-carousel__controls",[`pdp-carousel__controls--${h}`,O]]),children:(p?I.slice(0,x):I).map((c,i)=>{const L=p?x:I.length,k=p?v-1===i:v===i;return O?U("label",{className:g(["pdp-carousel__thumbnail__container"]),ref:W=>{W&&(re.current[i]=W)},children:[n("input",{type:"radio",name:"carousel-thumbnails","aria-label":Y.replace("{key}",String(i+1)).replace("{total}",String(L)),checked:k&&ce!==0,onChange:()=>{s(p?i+1:i,!0)},...A,className:g(["pdp-carousel__thumbnail",["pdp-carousel__thumbnail--selected",k&&ce!==0]])}),n("span",{className:g(["pdp-carousel__thumbnail__span"]),children:de[i]})]},i):n("button",{"aria-label":Y.replace("{key}",String(i+1)).replace("{total}",String(L)),onClick:()=>{s(p?i+1:i,!0)},className:g(["pdp-carousel__controls__button",["pdp-carousel__controls__button--active",k]])},i)})})}),(O||N)&&!y&&_e]})]})};function ge(e,o=0){if(typeof e=="number")return e;const{small:u,medium:m,large:h}=e,p=[{breakpoint:1024,value:h},{breakpoint:786,value:m},{breakpoint:0,value:u}].find(({breakpoint:f})=>o>f);return p?p.value:u}const Ze=({title:e,breadcrumbs:o,galleryContent:u,infoContent:m,productContent:h,sku:y,outOfStock:p,shortDescription:f,description:l,attributes:K,images:a,options:b,price:B,specialPrice:q,className:J,children:N,quantity:A,actions:_,carouselConfig:r,...D})=>{var F,v,oe,re,ce,se,ee,he,de;const M=V("PDP.Product.RegularPrice.label").label,S=V("PDP.Product.SpecialPrice.label").label,Y=V("PDP.Product.OutOfStock.label").label,t=V("PDP.Product.Image.label").label,[le,x]=X(null),$=a!=null&&a.length?a.map((I,T)=>{var Q;return n(H,{node:I,loading:T===0?"eager":"lazy",alt:((Q=e==null?void 0:e.props)==null?void 0:Q.children)&&(t==null?void 0:t.replace("{product}",e.props.children.toString()).replace("{key}",String(T+1)).replace("{total}",String(a.length))),onClick:()=>x(T)},T)}):n("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0}),C=(F=r==null?void 0:r.thumbnails)!=null&&F.length?r.thumbnails.map((I,T)=>{var Q;return n(H,{node:I,loading:(r==null?void 0:r.thumbnailsLoadingMode)||"lazy",alt:((Q=e==null?void 0:e.props)==null?void 0:Q.children)&&(t==null?void 0:t.replace("{product}",e.props.children.toString()).replace("{key}",String(T+1)).replace("{total}",String(a.length)))},T)}):n("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0});return U("div",{...D,className:g(["pdp-product",J]),children:[o&&n(H,{node:o,className:"pdp-product__breadcrumbs"}),U("div",{className:"pdp-product__column-container pdp-product__gallery-column",children:[n("div",{className:"pdp-product__column-body",children:(v=r==null?void 0:r.controls)!=null&&v.desktop?n(be,{className:"pdp-product__overlay__carousel",arrows:(a==null?void 0:a.length)>1,controls:(a==null?void 0:a.length)>1?r.controls.desktop:"dots",arrowsOnMainImage:r==null?void 0:r.arrowsOnMainImage,loop:(r==null?void 0:r.loopable)&&(a==null?void 0:a.length)>1,peak:((oe=r==null?void 0:r.thumbnails)==null?void 0:oe.length)>1&&((re=r==null?void 0:r.peak)==null?void 0:re.desktop)||!1,gap:(r==null?void 0:r.gap)||null,width:"100%",height:"100%",defaultIndex:le||0,thumbnails:C,children:$}):n(Je,{className:"pdp-product__images",gap:"small",children:$})}),u&&n(H,{node:u,className:"pdp-product__gallery-content"})]}),U("div",{className:"pdp-product__column-container pdp-product__content-column",children:[U("div",{className:"pdp-product__column-body",children:[U("div",{className:"pdp-product__header",children:[e&&n(H,{node:e,className:"pdp-product__title"}),y&&n(H,{node:y,className:"pdp-product__sku"})]}),U("div",{className:"pdp-product__prices",children:[q&&n(H,{node:q,className:g(["pdp-product__price-special","pdp-product__price"]),"aria-label":S,role:"text"}),B&&n(H,{node:B,className:g(["pdp-product__price-regular","pdp-product__price--grey"]),"aria-label":M,role:"text"})]}),(ce=r==null?void 0:r.controls)!=null&&ce.mobile&&((se=r==null?void 0:r.controls)==null?void 0:se.mobile)==="thumbnailsRow"?n(be,{className:"pdp-product__images pdp-product__images--carousel pdp-product__images--carousel--thumbnails",width:"100%",height:"auto",arrows:(a==null?void 0:a.length)>1,controls:(a==null?void 0:a.length)>1?"thumbnailsRow":null,loop:(r==null?void 0:r.loopable)&&(a==null?void 0:a.length)>1,peak:((ee=r==null?void 0:r.thumbnails)==null?void 0:ee.length)>1&&((he=r==null?void 0:r.peak)==null?void 0:he.mobile)||!1,gap:(r==null?void 0:r.gap)||null,thumbnails:C,children:$}):n(be,{className:"pdp-product__images pdp-product__images--carousel",peak:((de=r==null?void 0:r.peak)==null?void 0:de.mobile)&&(a==null?void 0:a.length)>1,gap:(r==null?void 0:r.gap)||null,width:"100%",height:"auto",arrows:(a==null?void 0:a.length)>1,controls:(a==null?void 0:a.length)>1?"dots":null,loop:(r==null?void 0:r.loopable)&&(a==null?void 0:a.length)>1,children:$}),U("div",{className:g(["pdp-product__actions",["pdp-product__actions--out-of-stock",p]]),children:[p&&n("div",{className:"pdp-product__out-of-stock__text",children:Y}),b&&n(H,{node:b,className:g(["pdp-product__options"])}),A&&n("div",{className:"pdp-product__quantity",children:n(H,{node:A})}),_&&n(H,{node:_,className:g(["pdp-product__buttons"])})]}),f&&n(H,{node:f,className:g(["pdp-product__short_description"])}),l&&n(H,{node:l,className:g(["pdp-product__description"])}),K?n("div",{className:"pdp-product__attributes",children:K}):null]}),m&&n(H,{node:m,className:"pdp-product__info-content"})]}),h&&n(H,{node:h,className:"pdp-product__content"}),le===null?null:n(Ye,{className:"pdp-product__overlay",onClose:()=>x(null),centered:!0,children:n(be,{className:"pdp-product__overlay__carousel",arrows:(a==null?void 0:a.length)>1,width:"100%",height:"100%",defaultIndex:le||0,loop:(r==null?void 0:r.loopable)&&(a==null?void 0:a.length)>1,controls:(a==null?void 0:a.length)>1?"dots":null,isZoomed:!0,children:$})})]})},Je=({children:e,gap:o=null,className:u,style:m,...h})=>{const y=ae.count(e);return n("div",{...h,className:g(["pdp-gallery-grid",u]),style:{"--gap":o?`var(--spacing-${o})`:"0px",...m},children:ae.map(e,(p,f)=>n("div",{className:"pdp-gallery-grid__item",children:n(H,{node:p,loading:f===0?"eager":"lazy"},p.props.src)},y+f))})},Ie=({amount:e,currency:o,locale:u,variant:m,sale:h,minimumAmount:y,maximumAmount:p,className:f,...l})=>n(fe,{children:e||y===p?n("div",{className:"pdp-price-range",...l,children:n(Se,{amount:e||y,currency:o,locale:u,variant:m,sale:h,className:f})}):U("div",{className:"pdp-price-range",...l,children:[n(Se,{amount:y,currency:o,locale:u,className:f}),n("span",{className:"pdp-price-range__label",children:"-"}),n(Se,{amount:p,currency:o,locale:u,className:f})]})}),Ye=({centered:e,onClose:o,className:u,children:m,...h})=>{const y=V("PDP.Overlay.Close.label").label,p=Z(()=>{o==null||o()},[o]);return ne(()=>{const f=l=>{l.key==="Escape"&&p()};return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f)}},[p]),ne(()=>{const f=document.scrollingElement,l=f.style.overflow;return f.style.overflow="hidden",()=>{f.style.overflow=l}},[]),U("div",{...h,className:g(["pdp-overlay",["pdp-overlay--centered",e],u]),children:[n("div",{className:"pdp-overlay__content",children:m}),n(Pe,{"aria-label":y,variant:"tertiary",className:"pdp-overlay__close-button",onClick:p,icon:n(Ke,{})})]})},Ce=["text","image","color","dropdown"],et=e=>e.map(o=>({...o,text:o.label,disabled:!o.inStock})),tt=({options:e,hideSelectedValue:o,onValues:u,onErrors:m,defaultOptions:h,selectionsToUpdate:y,className:p,children:f,...l})=>{const K=V("PDP.Swatches.Required.label").label,[a,b]=X(()=>e==null?void 0:e.reduce((A,_)=>{const{items:r}=_,D=r==null?void 0:r.find(S=>h==null?void 0:h.includes(S.id)),M=r==null?void 0:r.find(S=>S.selected);return D?{...A,[_.id]:{label:D.label,value:D.id}}:M?{...A,[_.id]:{label:M.label,value:M.id}}:A},{}));ne(()=>{y==null||y.forEach(N=>{b(A=>{var D;const _=(D=N==null?void 0:N.items)==null?void 0:D.find(M=>M.selected);return _?{...A,[N.id]:{label:_==null?void 0:_.label,value:_==null?void 0:_.id}}:A})})},[y,b]),we(()=>{const N=e==null?void 0:e.reduce((A,_)=>{var r;return(r=_==null?void 0:_.items)==null||r.forEach(D=>{var S;const M=((S=a[_.id])==null?void 0:S.value)===D.id;_.required&&!M&&(A[_.id]=K)}),A},{});return m==null||m(N),N},[a]);const B=Z((N,A,_)=>{b(r=>{const D={...r,[N]:{label:A,value:_}};return u==null||u(D,_),D})},[u]),q=(N,A)=>{var r;const _=((r=A.selectedOptions[0])==null?void 0:r.label)??"";B(N,_,A.value)},J=Z(({items:N,id:A,required:_,type:r,selected:D,label:M})=>n("div",{className:g(["pdp-swatches__options"]),children:(r==null?void 0:r.toLowerCase())==="dropdown"?n(Ue,{"aria-label":M,handleSelect:S=>q(A,S.target),options:et(N),value:D}):N==null?void 0:N.map(S=>{const Y={key:S.id,id:S.id,name:A,value:S.value,label:S.label,groupAriaLabel:M,selected:D===S.id,outOfStock:!S.inStock,required:_===null?!0:_,onValue:()=>{B(A,S.label,S.id)}};switch(r){case"text":return n(qe,{...Y,label:S.label});case"image":return n(Ve,{...Y,src:S.value,alt:S.label});case"color":return n(He,{...Y,size:"large",color:S.value});default:return console.warn(`Invalid swatch type ${r}`),null}})}),[B]);return n("div",{...l,className:g(["pdp-swatches",p]),children:e==null?void 0:e.map(({type:N,label:A,id:_,multiple:r,required:D,items:M})=>{var S;if(!N){console.warn("Bundle product not supported on UI.");return}return Ce.includes(N)||console.warn(`Invalid swatch type ${N}`),r&&console.warn("Multiple selection swatches are not currently supported."),U("div",{id:`swatch-item-${_}`,"data-slot-key":`product-swatch--${_}`,className:"pdp-swatches__field",children:[n("div",{className:"pdp-swatches__field__label",children:a[_]?o?`${A}`:`${A}: ${a[_].label}`:A}),n(J,{id:_,type:N,required:D,items:M,label:A,selected:(S=a[_])==null?void 0:S.value})]},`swatch-item-${_}`)})})};function nt(e,o="en_US"){if(!Me(e))throw Error("Invalid date string");return e.split(" ")[1]||(e=`${e} 00:00:00`),new Date(e).toLocaleDateString(Ne(o)).toString()}function Me(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(m=>m.test(e)))return!1;const u=new Date(e);return!isNaN(u.getTime())}function rt(e){const o=new URLSearchParams(window.location.search);Object.entries(e).forEach(([m,h])=>{h===null?o.delete(m):o.set(m,String(h))});let u=window.location.pathname;u+=`?${o.toString()}`,u+=window.location.hash,window.history.replaceState({},"",u)}function lt(){const e=new URLSearchParams(window.location.search),o={};return e.forEach((u,m)=>{o[m]=u}),o}function ct(e){var o,u,m,h,y,p,f,l,K,a,b,B;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:((u=(o=e==null?void 0:e.prices)==null?void 0:o.regular)==null?void 0:u.amount)||0,minimalPrice:(h=(m=e==null?void 0:e.prices)==null?void 0:m.final)==null?void 0:h.minimumAmount,maximalPrice:(p=(y=e==null?void 0:e.prices)==null?void 0:y.final)==null?void 0:p.maximumAmount,specialPrice:(l=(f=e==null?void 0:e.prices)==null?void 0:f.final)==null?void 0:l.amount,tierPricing:void 0,currencyCode:((a=(K=e==null?void 0:e.prices)==null?void 0:K.final)==null?void 0:a.currency)||"USD"},canonicalUrl:e==null?void 0:e.url,mainImageUrl:(B=(b=e==null?void 0:e.images)==null?void 0:b[0])==null?void 0:B.url}}const at={PRODUCT_CONTEXT:"productContext"},dt={PRODUCT_PAGE_VIEW:"product-page-view"};function Re(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function it(e,o){const u=Re();u.push({[e]:null}),u.push({[e]:o})}function ot(e,o){Re().push(m=>{const h=m.getState?m.getState():{};m.push({event:e,eventInfo:{...h,...o}})})}function Ee(e){const o=ct(e);it(at.PRODUCT_CONTEXT,o),ot(dt.PRODUCT_PAGE_VIEW)}const st=({sku:e,hideSku:o,hideQuantity:u,hideShortDescription:m,hideDescription:h,hideAttributes:y,hideURLParams:p,hideSelectedOptionValue:f,slots:l,children:K,initialData:a,carousel:b,optionsConfig:B,useACDL:q,onAddToCart:J,...N})=>{var I,T,Q,O;const A=V("PDP.Product.AddToCart.label").label,_=V("PDP.Product.Incrementer.label").label,r=V("PDP.Product.Details.label").label,[D,M]=X(Oe.getConfig().defaultLocale||"en-US"),[S,Y]=X(),[t=null,le]=X(a),[x,$]=X(()=>{const d={sku:e,quantity:1};return t!=null&&t.optionUIDs&&(d.optionsUIDs=t.optionUIDs),d}),[C,F]=X(()=>{var d,s;return!(t!=null&&t.options&&((d=t==null?void 0:t.options)==null?void 0:d.length)>0&&((s=t==null?void 0:t.optionUIDs)==null?void 0:s.length)!==(t==null?void 0:t.options.length))}),v={data:t,values:x,valid:C};ne(()=>{const d=ze.on("locale",s=>{s!==D&&(M(s),xe(e).then(le))});return()=>{d==null||d.off()}},[D,e]),ne(()=>{q&&a&&Object.keys(a).length>0&&Ee(a)},[a]);const oe=Z(d=>{$(s=>({...s,...d}))},[]),re=Z(d=>{var P;let s=Object.keys(d).map(w=>d[w].value).filter(w=>w!==void 0);p||rt({optionsUIDs:s.join(",")}),$(w=>({...w,optionsUIDs:s})),F((s==null?void 0:s.length)===((P=t==null?void 0:t.options)==null?void 0:P.length)),$e(e,s,B==null?void 0:B.anchorOptions).then(w=>{var E;le(w),(E=B==null?void 0:B.anchorOptions)!=null&&E.length&&ce(w,s),q&&(w==null?void 0:w.sku)!==e&&Ee(w)})},[e]),ce=Z((d,s)=>{var E;const P=(d==null?void 0:d.optionUIDs)??[];s.every(G=>P.includes(G))||(Y(d==null?void 0:d.options),$(G=>({...G,optionsUIDs:P})),F((P==null?void 0:P.length)===((E=d==null?void 0:d.options)==null?void 0:E.length)))},[e]),se=Z(d=>{Object.keys(d).length!==0&&F(!1)},[]),ee=we(()=>{var d;return(d=t==null?void 0:t.attributes)==null?void 0:d.map(({label:s,value:P},w)=>{const E=Me(P)?nt(P,D):P.toString();return U("li",{children:[s,": ",n("span",{dangerouslySetInnerHTML:{__html:E}})]},w)})},[t==null?void 0:t.attributes,D]),he=!u&&(t!=null&&t.inStock)?n(j,{name:"Quantity",slot:l==null?void 0:l.Quantity,context:{...v},children:n(je,{name:"quantity",defaultValue:x.quantity.toString(),min:1,"aria-label":_,className:"pdp-product__quantity",onValue:d=>{oe({quantity:Number(d)})}},"quantity")}):void 0,de=()=>{if(t!=null&&t.options)return n(j,{name:"Options",slot:l==null?void 0:l.Options,context:{...v},children:n(tt,{options:t.options,defaultOptions:x.optionsUIDs,selectionsToUpdate:S,hideSelectedValue:f,onValues:re,onErrors:se})})};return n("div",{...N,children:n(Ze,{title:n(j,{name:"Title",slot:l==null?void 0:l.Title,context:{...v},children:t==null?void 0:t.name}),sku:o?void 0:n(j,{name:"SKU",slot:l==null?void 0:l.SKU,context:{...v},children:t==null?void 0:t.sku}),options:de(),breadcrumbs:(l==null?void 0:l.Breadcrumbs)&&n(j,{name:"Breadcrumbs",slot:l==null?void 0:l.Breadcrumbs,context:{...v,setSeparator(d){this._registerMethod((...s)=>{const P=d(...s),w=P&&n(ve,{source:P});this._setProps(E=>({...E,separator:w}))})},appendLink(d){this._registerMethod((...s)=>{const{text:P,...w}=d(...s),E=n("a",{...w,children:P});this._setProps(G=>({...G,categories:[...G.categories||[],E]}))})},appendHTMLElement(d){this._registerMethod((...s)=>{const P=d(...s),w=this._htmlElementToVNode(P);this._setProps(E=>({...E,categories:[...E.categories||[],w]}))})}},render:({separator:d,categories:s})=>n(Ge,{separator:d,categories:s})}),quantity:he,actions:n(j,{name:"Actions",slot:l==null?void 0:l.Actions,context:{...v,appendButton(d){this._registerMethod((...s)=>{const P=d(...s);if(!P)return;const{text:w,icon:E,...G}=P,ue=n(Pe,{type:"button",...G,icon:E&&n(ve,{source:E}),children:w});this._setProps(_e=>({children:[..._e.children||[],ue]}))})}},children:!(l!=null&&l.Actions)&&n(Pe,{size:"medium",type:"submit",icon:n(ve,{source:"Cart"}),disabled:!(t!=null&&t.inStock)||!C,"aria-label":A,onClick:()=>J==null?void 0:J(x),children:A})}),shortDescription:m?void 0:n(j,{name:"ShortDescription",slot:l==null?void 0:l.ShortDescription,context:{...v},children:n("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.shortDescription)??""}})}),description:h?void 0:n(j,{name:"Description",slot:l==null?void 0:l.Description,context:{...v},children:n("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.description)??""}})}),images:((I=t==null?void 0:t.images)==null?void 0:I.map(({label:d,url:s})=>{var P,w;return n(De,{title:d,alt:d,src:s,width:((P=b==null?void 0:b.imageParams)==null?void 0:P.width)??960,height:((w=b==null?void 0:b.imageParams)==null?void 0:w.height)??1191,params:(b==null?void 0:b.imageParams)??{width:960}},s)}))??[],specialPrice:(T=t==null?void 0:t.prices)!=null&&T.visible?n(j,{name:"SpecialPrice",slot:l==null?void 0:l.SpecialPrice,context:{...v},children:n(Ie,{...t.prices.final,locale:Ne(D)})}):void 0,price:(Q=t==null?void 0:t.prices)!=null&&Q.visible&&t.prices.regular&&t.prices.final.amount!==(t==null?void 0:t.prices.regular.amount)?n(j,{name:"RegularPrice",slot:l==null?void 0:l.RegularPrice,context:{...v},children:n(Ie,{...t.prices.regular,locale:Ne(D)})}):void 0,carouselConfig:{...b,thumbnails:b&&Object.keys(b).length?((O=t==null?void 0:t.images)==null?void 0:O.map(({label:d,url:s})=>{var P,w;return n(De,{title:d,alt:d,src:s,width:((P=b==null?void 0:b.thumbnailParams)==null?void 0:P.width)??200,height:((w=b==null?void 0:b.thumbnailParams)==null?void 0:w.height)??248,params:(b==null?void 0:b.thumbnailParams)??{width:200}},s)}))??[]:[]},outOfStock:!(t!=null&&t.inStock),attributes:y?void 0:n(j,{name:"Attributes",slot:l==null?void 0:l.Attributes,context:{...v},children:ee!=null&&ee.length?U(fe,{children:[r,n("ul",{children:ee})]}):null}),galleryContent:(l==null?void 0:l.GalleryContent)&&n(j,{name:"GalleryContent",slot:l.GalleryContent,context:{...v}}),infoContent:(l==null?void 0:l.InfoContent)&&n(j,{name:"InfoContent",slot:l.InfoContent,context:{...v}}),productContent:(l==null?void 0:l.Content)&&n(j,{name:"Content",slot:l.Content,context:{...v}})})})};st.getInitialData=async function({sku:e,optionsConfig:o}){var m,h,y,p,f,l;const u=((m=lt().optionsUIDs)==null?void 0:m.split(","))||((l=(f=(p=(y=(h=Oe)==null?void 0:h.getConfig())==null?void 0:y.models)==null?void 0:p.ProductDetails)==null?void 0:f.initialData)==null?void 0:l.optionsUIDs);return u!=null&&u.length?await $e(e,u,o==null?void 0:o.anchorOptions):await xe(e)};export{st as ProductDetails,st as default};
|
|
1
|
+
import*as pe from"@dropins/tools/preact-compat.js";import{useState as X,Children as ae,useRef as ye,useMemo as we,useEffect as z,useCallback as Z}from"@dropins/tools/preact-compat.js";import{debounce as De,classes as g,VComponent as V,toLanguageTag as Le,Slot as j}from"@dropins/tools/lib.js";import{Button as Pe,Icon as ve,Price as Se,Picker as He,ColorSwatch as Ve,ImageSwatch as qe,TextSwatch as je,Incrementer as Ge,Breadcrumbs as ze,Image as ke}from"@dropins/tools/components.js";import{jsxs as H,jsx as r,Fragment as fe}from"@dropins/tools/preact-jsx-runtime.js";import{useText as q}from"@dropins/tools/i18n.js";import{c as xe,d as $e}from"../chunks/getRefinedProduct.js";import{events as Ne}from"@dropins/tools/event-bus.js";import{c as Be}from"../chunks/initialize.js";import"@dropins/tools/fetch-graphql.js";const Fe=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"})),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",{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"})),Qe=24,ge=16,me=2,Je="32";var Me=(e=>(e[e.small=16]="small",e[e.medium=24]="medium",e[e.large=64]="large",e))(Me||{});const be=({show:e=1,scrollbar:d=!1,peak:u=!1,arrows:_=!1,controls:p="dots",arrowsOnMainImage:A=!1,loop:o=!1,gap:w=null,direction:l="horizontal",width:K="100%",height:a="100%",defaultIndex:m=0,className:B,children:T,thumbnails:Y=null,isZoomed:ie,...b})=>{const N=q("PDP.Carousel.label").label,n=q("PDP.Carousel.Slide.label").label,f=q("PDP.Carousel.Previous.label").label,I=q("PDP.Carousel.Next.label").label,M=q("PDP.Carousel.Controls.label").label,S=q("PDP.Carousel.Controls.Button.label").label,[t,re]=X(()=>Ie(e)),k=Math.ceil(ae.count(T)/t),x=u?Qe:0,C=w?Me[w]:0,F=ae.count(T)%t,[v,le]=X(o?m+1:m),ne=ye([]),[ce,se]=X(0),[ee,he]=X(0),de=we(()=>ae.toArray(Y),[Y]),E=we(()=>{const c=ae.toArray(T).reduce((h,L,D)=>D%t===0?[...h,[L]]:[...h.slice(0,-1),[...h[h.length-1],L]],[]);return!o||c.length===1?c:o&&ae.count(T)%t===0?[c[k-1]].concat(c).concat([c[0],c[1]]):[ae.toArray(T).slice(-t)].concat(c).concat([c[0],c[1]])},[T,t,k,o]),W=ye(null),Q=ye(null),$=p==="thumbnailsRow"||p==="thumbnailsColumn";z(()=>{const c=document.body,h=De(()=>{var R,te;se(((R=W.current)==null?void 0:R.offsetWidth)??0),he(((te=W.current)==null?void 0:te.offsetHeight)??0);const D=window.innerWidth,U=Ie(e,D);U!==t&&re(U)},50),L=new ResizeObserver(h);return L.observe(c),()=>{L.unobserve(c)}},[t,e]);const i=Z(c=>{const h=o?c-1:c,L=ne==null?void 0:ne.current[0],D=(L==null?void 0:L.offsetWidth)+ge,U=(L==null?void 0:L.offsetHeight)+ge,R=Q.current,te=p==="thumbnailsRow",Ae=p==="thumbnailsColumn",oe=te?R==null?void 0:R.offsetWidth:R==null?void 0:R.offsetHeight,G=te?D:U;(te||Ae)&&oe&&(G*(h+1)>oe&&(R.style.scrollBehavior="smooth",te?R.scrollLeft=(h+me)*G:R.scrollTop=(h+me)*G),(te?R.scrollLeft:R.scrollTop)>G*h&&(R.style.scrollBehavior="smooth",te?R.scrollLeft=(h-me)*G:R.scrollTop=(h-me)*G))},[p,o]);z(()=>{i(v)},[v,i]);const s=Z((c,h,L)=>{$&&i(c);const D=W.current,U=x?D.offsetWidth-x:D.offsetWidth-x+C;if(!Array.from(D.querySelectorAll("[data-index]")).filter(oe=>{const G=Number(oe.getAttribute("data-index"));return!isNaN(G)&&G>-1})[c])return;if(L){const oe=c===0?k:0,G=U*(k+(F||t)/t);if(D.scrollLeft>=0&&D.scrollLeft<U-5){s(1,!0);return}if(D.scrollLeft>G-U&&D.scrollLeft<=G){s(k,!0);return}D.style.scrollBehavior="auto",D.scrollLeft=oe===0?0:G,s(oe===0?1:k,!0);return}const Ae=(D.offsetWidth-C)/t*E[c].length-x;D.style.scrollBehavior=h?"smooth":"auto",D.scrollLeft=E[c].length===t?U*c:U*(c-1)+Ae},[C,k,x,t,F,E,i,p]),P=Z(()=>{if(o){const h=v-1;s(h,!0,v===1);return}const c=v<=0?0:v-1;s(c,!0)},[v,s,o]),y=Z(()=>{const c=E.length-1;if(o){const L=v+1;s(L,!0,v===k);return}const h=v>=c?c:v+1;s(h,!0)},[E.length,o,v,s,k]);z(()=>{const c=h=>{h.key==="ArrowLeft"&&(h.preventDefault(),P()),h.key==="ArrowRight"&&(h.preventDefault(),y())};return window.addEventListener("keydown",c),()=>{window.removeEventListener("keydown",c)}},[y,P]),z(()=>{s(o?m+1:m,!1)},[m,s,o]);const O=De(()=>{const c=W.current,h=x?c.offsetWidth-x:c.offsetWidth-x+C,L=c.scrollLeft/h,D=Math.round(L)-L<1?Math.round(L):Math.ceil(L);if($&&i(D),o){const U=h*(k+(F||t)/t);if(Math.ceil(c.scrollLeft)>=Math.ceil(U)-5){c.style.scrollBehavior="auto",c.scrollLeft=c.offsetWidth*1+(Math.ceil(c.scrollLeft)-Math.ceil(U)-x);return}if(c.scrollLeft===0){c.style.scrollBehavior="auto",c.scrollLeft=U-c.offsetWidth+x;return}}v!==D&&le(D)},100);z(()=>{const c=W.current;return c==null||c.addEventListener("scroll",O),()=>{c==null||c.removeEventListener("scroll",O)}},[O]);const J=(c,h,L)=>r(Pe,{className:g([["pdp-carousel__button",!c],[`pdp-carousel__button--${h}`,!c],[`pdp-carousel__button--${p}`,c]]),style:{"--height":`${ee}px`},variant:"tertiary","aria-label":h==="next"?I:f,onClick:L,disabled:o?!1:h==="next"?v>=E.length-1:v<1,children:r(ve,{className:g([["pdp-carousel__button__icon",!c],[`pdp-carousel__button__icon--${h}`,!c],[`pdp-carousel__button__icon--${p}--${h}`,c]]),size:Je,source:Fe})}),ue=_&&E.length!=1&&J($,"prev",P),_e=_&&E.length!=1&&J($,"next",y),We=_&&E.length!=1&&J(!1,"prev",P),Ue=_&&E.length!=1&&J(!1,"next",y);return H("div",{role:"region","aria-roledescription":N,className:g(["pdp-carousel",["pdp-carousel--main-image-controls",A],["pdp-carousel--arrows",_&&!$],[`pdp-carousel--${p}`,$],B]),style:{"--flex-carousel":p==="thumbnailsColumn"?"row-reverse":"column","--gap":$?"0":"var(--spacing-small)","--width":K},...b,children:[r("div",{ref:W,className:g(["pdp-carousel__wrapper",`pdp-carousel__wrapper--${l}`,["pdp-carousel__wrapper--scrollbar",d],["pdp-carousel__wrapper--peak",u]]),style:{"--total-width":p==="thumbnailsColumn"?"81.6%":"100%","--height":p==="thumbnailsColumn"?"auto":a,"--gap":w?`var(--spacing-${w})`:"0px","--per-page":t},tabIndex:0,children:E.map((c,h)=>{const L=c.length<t;return r("div",{role:"group","aria-roledescription":n,"data-index":h,className:g(["pdp-carousel__slide",`pdp-carousel__slide--${l}`,["pdp-carousel__slide--active",v===h],["pdp-carousel__slide--orphan",L]]),style:{"--length":c.length},children:c},h)})}),!$&&H(fe,{children:[ue,_e]}),$&&A&&H(fe,{children:[We,Ue]}),p&&E.length!=1&&H("div",{className:g([[`pdp-carousel__controls__container--${p}`,$],["pdp-carousel__controls__container--no-arrows",!_||A]]),style:{"--width":p==="thumbnailsRow"?`${ce}px`:K,"--height":`${ee}px`,"--nr-thumbnails":de.length},children:[($||ie)&&!A&&ue,r("div",{ref:Q,className:g([[`pdp-carousel__controls__wrapper--${p}`,$],["pdp-carousel__controls__wrapper",$]]),children:r("div",{role:"group","aria-label":M,className:g(["pdp-carousel__controls",[`pdp-carousel__controls--${p}`,$]]),children:(o?E.slice(0,k):E).map((c,h)=>{const L=o?k:E.length,D=o?v-1===h:v===h;return $?H("label",{className:g(["pdp-carousel__thumbnail__container"]),ref:U=>{U&&(ne.current[h]=U)},children:[r("input",{type:"radio",name:"carousel-thumbnails","aria-label":S.replace("{key}",String(h+1)).replace("{total}",String(L)),checked:D&&ce!==0,onChange:()=>{s(o?h+1:h,!0)},...b,className:g(["pdp-carousel__thumbnail",["pdp-carousel__thumbnail--selected",D&&ce!==0]])}),r("span",{className:g(["pdp-carousel__thumbnail__span"]),children:de[h]})]},h):r("button",{"aria-label":S.replace("{key}",String(h+1)).replace("{total}",String(L)),onClick:()=>{s(o?h+1:h,!0)},className:g(["pdp-carousel__controls__button",["pdp-carousel__controls__button--active",D]])},h)})})}),($||ie)&&!A&&_e]})]})};function Ie(e,d=0){if(typeof e=="number")return e;const{small:u,medium:_,large:p}=e,o=[{breakpoint:1024,value:p},{breakpoint:786,value:_},{breakpoint:0,value:u}].find(({breakpoint:w})=>d>w);return o?o.value:u}const Xe=({title:e,breadcrumbs:d,galleryContent:u,infoContent:_,productContent:p,sku:A,outOfStock:o,shortDescription:w,description:l,attributes:K,images:a,options:m,price:B,specialPrice:T,className:Y,children:ie,quantity:b,actions:N,carouselConfig:n,...f})=>{var F,v,le,ne,ce,se,ee,he,de;const I=q("PDP.Product.RegularPrice.label").label,M=q("PDP.Product.SpecialPrice.label").label,S=q("PDP.Product.OutOfStock.label").label,t=q("PDP.Product.Image.label").label,[re,k]=X(null),x=a!=null&&a.length?a.map((E,W)=>{var Q;return r(V,{node:E,loading:W===0?"eager":"lazy",alt:((Q=e==null?void 0:e.props)==null?void 0:Q.children)&&(t==null?void 0:t.replace("{product}",e.props.children.toString()).replace("{key}",String(W+1)).replace("{total}",String(a.length))),onClick:()=>k(W)},W)}):r("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0}),C=(F=n==null?void 0:n.thumbnails)!=null&&F.length?n.thumbnails.map((E,W)=>{var Q;return r(V,{node:E,loading:(n==null?void 0:n.thumbnailsLoadingMode)||"lazy",alt:((Q=e==null?void 0:e.props)==null?void 0:Q.children)&&(t==null?void 0:t.replace("{product}",e.props.children.toString()).replace("{key}",String(W+1)).replace("{total}",String(a.length)))},W)}):r("img",{src:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",className:"pdp-product__images__placeholder","aria-hidden":!0});return H("div",{...f,className:g(["pdp-product",Y]),children:[d&&r(V,{node:d,className:"pdp-product__breadcrumbs"}),H("div",{className:"pdp-product__column-container pdp-product__gallery-column",children:[r("div",{className:"pdp-product__column-body",children:(v=n==null?void 0:n.controls)!=null&&v.desktop?r(be,{className:"pdp-product__overlay__carousel",arrows:(a==null?void 0:a.length)>1,controls:(a==null?void 0:a.length)>1?n.controls.desktop:"dots",arrowsOnMainImage:n==null?void 0:n.arrowsOnMainImage,loop:(n==null?void 0:n.loopable)&&(a==null?void 0:a.length)>1,peak:((le=n==null?void 0:n.thumbnails)==null?void 0:le.length)>1&&((ne=n==null?void 0:n.peak)==null?void 0:ne.desktop)||!1,gap:(n==null?void 0:n.gap)||null,width:"100%",height:"100%",defaultIndex:re||0,thumbnails:C,children:x}):r(Ze,{className:"pdp-product__images",gap:"small",children:x})}),u&&r(V,{node:u,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&&r(V,{node:e,className:"pdp-product__title"}),A&&r(V,{node:A,className:"pdp-product__sku"})]}),H("div",{className:"pdp-product__prices",children:[T&&r(V,{node:T,className:g(["pdp-product__price-special","pdp-product__price"]),"aria-label":M,role:"text"}),B&&r(V,{node:B,className:g(["pdp-product__price-regular","pdp-product__price--grey"]),"aria-label":I,role:"text"})]}),(ce=n==null?void 0:n.controls)!=null&&ce.mobile&&((se=n==null?void 0:n.controls)==null?void 0:se.mobile)==="thumbnailsRow"?r(be,{className:"pdp-product__images pdp-product__images--carousel pdp-product__images--carousel--thumbnails",width:"100%",height:"auto",arrows:(a==null?void 0:a.length)>1,controls:(a==null?void 0:a.length)>1?"thumbnailsRow":null,loop:(n==null?void 0:n.loopable)&&(a==null?void 0:a.length)>1,peak:((ee=n==null?void 0:n.thumbnails)==null?void 0:ee.length)>1&&((he=n==null?void 0:n.peak)==null?void 0:he.mobile)||!1,gap:(n==null?void 0:n.gap)||null,thumbnails:C,children:x}):r(be,{className:"pdp-product__images pdp-product__images--carousel",peak:((de=n==null?void 0:n.peak)==null?void 0:de.mobile)&&(a==null?void 0:a.length)>1,gap:(n==null?void 0:n.gap)||null,width:"100%",height:"auto",arrows:(a==null?void 0:a.length)>1,controls:(a==null?void 0:a.length)>1?"dots":null,loop:(n==null?void 0:n.loopable)&&(a==null?void 0:a.length)>1,children:x}),H("div",{className:g(["pdp-product__actions",["pdp-product__actions--out-of-stock",o]]),children:[o&&r("div",{className:"pdp-product__out-of-stock__text",children:S}),m&&r(V,{node:m,className:g(["pdp-product__options"])}),b&&r("div",{className:"pdp-product__quantity",children:r(V,{node:b})}),N&&r(V,{node:N,className:g(["pdp-product__buttons"])})]}),w&&r(V,{node:w,className:g(["pdp-product__short_description"])}),l&&r(V,{node:l,className:g(["pdp-product__description"])}),K?r("div",{className:"pdp-product__attributes",children:K}):null]}),_&&r(V,{node:_,className:"pdp-product__info-content"})]}),p&&r(V,{node:p,className:"pdp-product__content"}),re===null?null:r(Ye,{className:"pdp-product__overlay",onClose:()=>k(null),centered:!0,children:r(be,{className:"pdp-product__overlay__carousel",arrows:(a==null?void 0:a.length)>1,width:"100%",height:"100%",defaultIndex:re||0,loop:(n==null?void 0:n.loopable)&&(a==null?void 0:a.length)>1,controls:(a==null?void 0:a.length)>1?"dots":null,isZoomed:!0,children:x})})]})},Ze=({children:e,gap:d=null,className:u,style:_,...p})=>{const A=ae.count(e);return r("div",{...p,className:g(["pdp-gallery-grid",u]),style:{"--gap":d?`var(--spacing-${d})`:"0px",..._},children:ae.map(e,(o,w)=>r("div",{className:"pdp-gallery-grid__item",children:r(V,{node:o,loading:w===0?"eager":"lazy"},o.props.src)},A+w))})},Ee=({amount:e,currency:d,locale:u,variant:_,sale:p,minimumAmount:A,maximumAmount:o,className:w,...l})=>r(fe,{children:e||A===o?r("div",{className:"pdp-price-range",...l,children:r(Se,{amount:e||A,currency:d,locale:u,variant:_,sale:p,className:w})}):H("div",{className:"pdp-price-range",...l,children:[r(Se,{amount:A,currency:d,locale:u,className:w}),r("span",{className:"pdp-price-range__label",children:"-"}),r(Se,{amount:o,currency:d,locale:u,className:w})]})}),Ye=({centered:e,onClose:d,className:u,children:_,...p})=>{const A=q("PDP.Overlay.Close.label").label,o=Z(()=>{d==null||d()},[d]);return z(()=>{const w=l=>{l.key==="Escape"&&o()};return document.addEventListener("keydown",w),()=>{document.removeEventListener("keydown",w)}},[o]),z(()=>{const w=document.scrollingElement,l=w.style.overflow;return w.style.overflow="hidden",()=>{w.style.overflow=l}},[]),H("div",{...p,className:g(["pdp-overlay",["pdp-overlay--centered",e],u]),children:[r("div",{className:"pdp-overlay__content",children:_}),r(Pe,{"aria-label":A,variant:"tertiary",className:"pdp-overlay__close-button",onClick:o,icon:r(Ke,{})})]})},Ce=["text","image","color","dropdown"],et=e=>e.map(d=>({...d,text:d.label,disabled:!d.inStock}));function tt(e,d){return e.reduce((u,_)=>{const p=d==null?void 0:d.find(o=>o.items.find(w=>w.id===_));if(!p)return u;const A=p.items.find(o=>o.id===_);return{...u,[p.id]:{label:A.label,value:A.id}}},{})}const nt=({options:e,hideSelectedValue:d,selectedUIDs:u,onValues:_,onErrors:p,defaultOptions:A,selectionsToUpdate:o,className:w,children:l,...K})=>{const a=q("PDP.Swatches.Required.label").label,[m,B]=X(()=>e==null?void 0:e.reduce((N,n)=>{const{items:f}=n,I=f==null?void 0:f.find(S=>A==null?void 0:A.includes(S.id)),M=f==null?void 0:f.find(S=>S.selected);return I?{...N,[n.id]:{label:I.label,value:I.id}}:M?{...N,[n.id]:{label:M.label,value:M.id}}:N},{}));z(()=>{if(u){const b=tt(u,e);if(JSON.stringify(b)===JSON.stringify(m))return;T(Object.keys(b)[0],b[Object.keys(b)[0]].label,u[0])}},[u]),z(()=>{o==null||o.forEach(b=>{B(N=>{var I;const n=(I=b==null?void 0:b.items)==null?void 0:I.find(M=>M.selected);return n?{...N,[b.id]:{label:n==null?void 0:n.label,value:n==null?void 0:n.id}}:N})})},[o,B]),we(()=>{const b=e==null?void 0:e.reduce((N,n)=>{var f;return(f=n==null?void 0:n.items)==null||f.forEach(I=>{var S;const M=((S=m[n.id])==null?void 0:S.value)===I.id;n.required&&!M&&(N[n.id]=a)}),N},{});return p==null||p(b),b},[m]);const T=Z((b,N,n)=>{B(f=>{const I={...f,[b]:{label:N,value:n}};return _==null||_(I,n),I})},[_]),Y=(b,N)=>{var f;const n=((f=N.selectedOptions[0])==null?void 0:f.label)??"";T(b,n,N.value)},ie=Z(({items:b,id:N,required:n,type:f,selected:I,label:M})=>r("div",{className:g(["pdp-swatches__options"]),children:(f==null?void 0:f.toLowerCase())==="dropdown"?r(He,{"aria-label":M,handleSelect:S=>Y(N,S.target),options:et(b),value:I}):b==null?void 0:b.map(S=>{const t={key:S.id,id:S.id,name:N,value:S.value,label:S.label,groupAriaLabel:M,selected:I===S.id,outOfStock:!S.inStock,required:n===null?!0:n,onValue:()=>{T(N,S.label,S.id)}};switch(f){case"text":return r(je,{...t,label:S.label});case"image":return r(qe,{...t,src:S.value,alt:S.label});case"color":return r(Ve,{...t,size:"large",color:S.value});default:return console.warn(`Invalid swatch type ${f}`),null}})}),[T]);return r("div",{...K,className:g(["pdp-swatches",w]),children:e==null?void 0:e.map(({type:b,label:N,id:n,multiple:f,required:I,items:M})=>{var S;if(!b){console.warn("Bundle product not supported on UI.");return}return Ce.includes(b)||console.warn(`Invalid swatch type ${b}`),f&&console.warn("Multiple selection swatches are not currently supported."),H("div",{id:`swatch-item-${n}`,"data-slot-key":`product-swatch--${n}`,className:"pdp-swatches__field",children:[r("div",{className:"pdp-swatches__field__label",children:m[n]?d?`${N}`:`${N}: ${m[n].label}`:N}),r(ie,{id:n,type:b,required:I,items:M,label:N,selected:(S=m[n])==null?void 0:S.value})]},`swatch-item-${n}`)})})};function rt(e,d="en_US"){if(!Re(e))throw Error("Invalid date string");return e.split(" ")[1]||(e=`${e} 00:00:00`),new Date(e).toLocaleDateString(Le(d)).toString()}function Re(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 u=new Date(e);return!isNaN(u.getTime())}function lt(e){const d=new URLSearchParams(window.location.search);Object.entries(e).forEach(([_,p])=>{p===null?d.delete(_):d.set(_,String(p))});let u=window.location.pathname;u+=`?${d.toString()}`,u+=window.location.hash,window.history.replaceState({},"",u)}function ct(){const e=new URLSearchParams(window.location.search),d={};return e.forEach((u,_)=>{d[_]=u}),d}function at(e){var d,u,_,p,A,o,w,l,K,a,m,B;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:((u=(d=e==null?void 0:e.prices)==null?void 0:d.regular)==null?void 0:u.amount)||0,minimalPrice:(p=(_=e==null?void 0:e.prices)==null?void 0:_.final)==null?void 0:p.minimumAmount,maximalPrice:(o=(A=e==null?void 0:e.prices)==null?void 0:A.final)==null?void 0:o.maximumAmount,specialPrice:(l=(w=e==null?void 0:e.prices)==null?void 0:w.final)==null?void 0:l.amount,tierPricing:void 0,currencyCode:((a=(K=e==null?void 0:e.prices)==null?void 0:K.final)==null?void 0:a.currency)||"USD"},canonicalUrl:e==null?void 0:e.url,mainImageUrl:(B=(m=e==null?void 0:e.images)==null?void 0:m[0])==null?void 0:B.url}}const it={PRODUCT_CONTEXT:"productContext"},dt={PRODUCT_PAGE_VIEW:"product-page-view"};function Te(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function ot(e,d){const u=Te();u.push({[e]:null}),u.push({[e]:d})}function st(e,d){Te().push(_=>{const p=_.getState?_.getState():{};_.push({event:e,eventInfo:{...p,...d}})})}function Oe(e){const d=at(e);ot(it.PRODUCT_CONTEXT,d),st(dt.PRODUCT_PAGE_VIEW)}const ht=({sku:e,hideSku:d,hideQuantity:u,hideShortDescription:_,hideDescription:p,hideAttributes:A,hideURLParams:o,hideSelectedOptionValue:w,slots:l,children:K,initialData:a,carousel:m,optionsConfig:B,useACDL:T,onAddToCart:Y,...ie})=>{var E,W,Q,$;const b=q("PDP.Product.AddToCart.label").label,N=q("PDP.Product.Incrementer.label").label,n=q("PDP.Product.Details.label").label,[f,I]=X(Be.getConfig().defaultLocale||"en-US"),[M,S]=X(),[t=null,re]=X(a),[k,x]=X(()=>{const i={sku:e,quantity:1};return t!=null&&t.optionUIDs&&(i.optionsUIDs=t.optionUIDs),i}),[C,F]=X(()=>{var i,s;return!(t!=null&&t.options&&((i=t==null?void 0:t.options)==null?void 0:i.length)>0&&((s=t==null?void 0:t.optionUIDs)==null?void 0:s.length)!==(t==null?void 0:t.options.length))}),v={data:t,values:k,valid:C};z(()=>{const i=Ne.on("pdp/setValues",s=>{x(P=>({...P,...s}))});return()=>{i==null||i.off()}},[]),z(()=>{const i=Ne.on("locale",s=>{s!==f&&(I(s),xe(e).then(re))});return()=>{i==null||i.off()}},[f,e]),z(()=>{T&&a&&Object.keys(a).length>0&&Oe(a)},[a]);const le=Z(i=>{x(s=>({...s,...i}))},[]);z(()=>{Ne.emit("pdp/values",k)},[JSON.stringify(k)]);const ne=Z(i=>{var P;let s=Object.keys(i).map(y=>i[y].value).filter(y=>y!==void 0);o||lt({optionsUIDs:s.join(",")}),le({optionsUIDs:s}),F((s==null?void 0:s.length)===((P=t==null?void 0:t.options)==null?void 0:P.length)),$e(e,s,B==null?void 0:B.anchorOptions).then(y=>{var O;re(y),(O=B==null?void 0:B.anchorOptions)!=null&&O.length&&ce(y,s),T&&(y==null?void 0:y.sku)!==e&&Oe(y)})},[e]),ce=Z((i,s)=>{var O;const P=(i==null?void 0:i.optionUIDs)??[];s.every(J=>P.includes(J))||(S(i==null?void 0:i.options),le({optionsUIDs:P}),F((P==null?void 0:P.length)===((O=i==null?void 0:i.options)==null?void 0:O.length)))},[e]),se=Z(i=>{Object.keys(i).length!==0&&F(!1)},[]),ee=we(()=>{var i;return(i=t==null?void 0:t.attributes)==null?void 0:i.map(({label:s,value:P},y)=>{const O=Re(P)?rt(P,f):P.toString();return H("li",{children:[s,": ",r("span",{dangerouslySetInnerHTML:{__html:O}})]},y)})},[t==null?void 0:t.attributes,f]),he=!u&&(t!=null&&t.inStock)?r(j,{name:"Quantity",slot:l==null?void 0:l.Quantity,context:{...v},children:r(Ge,{name:"quantity",defaultValue:k.quantity.toString(),value:k.quantity.toString(),min:1,"aria-label":N,className:"pdp-product__quantity",onValue:i=>{le({quantity:Number(i)})}},"quantity")}):void 0,de=()=>{if(t!=null&&t.options)return r(j,{name:"Options",slot:l==null?void 0:l.Options,context:{...v},children:r(nt,{selectedUIDs:k.optionsUIDs,options:t.options,defaultOptions:k.optionsUIDs,selectionsToUpdate:M,hideSelectedValue:w,onValues:ne,onErrors:se})})};return r("div",{...ie,children:r(Xe,{title:r(j,{name:"Title",slot:l==null?void 0:l.Title,context:{...v},children:t==null?void 0:t.name}),sku:d?void 0:r(j,{name:"SKU",slot:l==null?void 0:l.SKU,context:{...v},children:t==null?void 0:t.sku}),options:de(),breadcrumbs:(l==null?void 0:l.Breadcrumbs)&&r(j,{name:"Breadcrumbs",slot:l==null?void 0:l.Breadcrumbs,context:{...v,setSeparator(i){this._registerMethod((...s)=>{const P=i(...s),y=P&&r(ve,{source:P});this._setProps(O=>({...O,separator:y}))})},appendLink(i){this._registerMethod((...s)=>{const{text:P,...y}=i(...s),O=r("a",{...y,children:P});this._setProps(J=>({...J,categories:[...J.categories||[],O]}))})},appendHTMLElement(i){this._registerMethod((...s)=>{const P=i(...s),y=this._htmlElementToVNode(P);this._setProps(O=>({...O,categories:[...O.categories||[],y]}))})}},render:({separator:i,categories:s})=>r(ze,{separator:i,categories:s})}),quantity:he,actions:r(j,{name:"Actions",slot:l==null?void 0:l.Actions,context:{...v,appendButton(i){this._registerMethod((...s)=>{const P=i(...s);if(!P)return;const{text:y,icon:O,...J}=P,ue=r(Pe,{type:"button",...J,icon:O&&r(ve,{source:O}),children:y});this._setProps(_e=>({children:[..._e.children||[],ue]}))})}},children:!(l!=null&&l.Actions)&&r(Pe,{size:"medium",type:"submit",icon:r(ve,{source:"Cart"}),disabled:!(t!=null&&t.inStock)||!C,"aria-label":b,onClick:()=>Y==null?void 0:Y(k),children:b})}),shortDescription:_?void 0:r(j,{name:"ShortDescription",slot:l==null?void 0:l.ShortDescription,context:{...v},children:r("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.shortDescription)??""}})}),description:p?void 0:r(j,{name:"Description",slot:l==null?void 0:l.Description,context:{...v},children:r("div",{dangerouslySetInnerHTML:{__html:(t==null?void 0:t.description)??""}})}),images:((E=t==null?void 0:t.images)==null?void 0:E.map(({label:i,url:s})=>{var P,y;return r(ke,{title:i,alt:i,src:s,width:((P=m==null?void 0:m.imageParams)==null?void 0:P.width)??960,height:((y=m==null?void 0:m.imageParams)==null?void 0:y.height)??1191,params:(m==null?void 0:m.imageParams)??{width:960}},s)}))??[],specialPrice:(W=t==null?void 0:t.prices)!=null&&W.visible?r(j,{name:"SpecialPrice",slot:l==null?void 0:l.SpecialPrice,context:{...v},children:r(Ee,{...t.prices.final,locale:Le(f)})}):void 0,price:(Q=t==null?void 0:t.prices)!=null&&Q.visible&&t.prices.regular&&t.prices.final.amount!==(t==null?void 0:t.prices.regular.amount)?r(j,{name:"RegularPrice",slot:l==null?void 0:l.RegularPrice,context:{...v},children:r(Ee,{...t.prices.regular,locale:Le(f)})}):void 0,carouselConfig:{...m,thumbnails:m&&Object.keys(m).length?(($=t==null?void 0:t.images)==null?void 0:$.map(({label:i,url:s})=>{var P,y;return r(ke,{title:i,alt:i,src:s,width:((P=m==null?void 0:m.thumbnailParams)==null?void 0:P.width)??200,height:((y=m==null?void 0:m.thumbnailParams)==null?void 0:y.height)??248,params:(m==null?void 0:m.thumbnailParams)??{width:200}},s)}))??[]:[]},outOfStock:!(t!=null&&t.inStock),attributes:A?void 0:r(j,{name:"Attributes",slot:l==null?void 0:l.Attributes,context:{...v},children:ee!=null&&ee.length?H(fe,{children:[n,r("ul",{children:ee})]}):null}),galleryContent:(l==null?void 0:l.GalleryContent)&&r(j,{name:"GalleryContent",slot:l.GalleryContent,context:{...v}}),infoContent:(l==null?void 0:l.InfoContent)&&r(j,{name:"InfoContent",slot:l.InfoContent,context:{...v}}),productContent:(l==null?void 0:l.Content)&&r(j,{name:"Content",slot:l.Content,context:{...v}})})})};ht.getInitialData=async function({sku:e,optionsConfig:d}){var _,p,A,o,w,l;const u=((_=ct().optionsUIDs)==null?void 0:_.split(","))||((l=(w=(o=(A=(p=Be)==null?void 0:p.getConfig())==null?void 0:A.models)==null?void 0:o.ProductDetails)==null?void 0:w.initialData)==null?void 0:l.optionsUIDs);return u!=null&&u.length?await $e(e,u,d==null?void 0:d.anchorOptions):await xe(e)};export{ht as ProductDetails,ht as default};
|
package/containers/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 './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
|
package/data/models/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 './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;
|
|
@@ -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
|
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
|
package/lib/url-params.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 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.
|
|
1
|
+
{"name": "@dropins/storefront-pdp", "version": "0.4.0-alpha1", "@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
|