@dropins/storefront-cart 1.0.0 → 1.0.2-beta1
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/LICENSE.md +127 -0
- package/api.js +1 -1
- package/chunks/CartSummaryGrid.js +1 -1
- package/chunks/CartSummaryList.js +1 -1
- package/chunks/ChevronDown.js +1 -1
- package/chunks/Coupon.js +1 -1
- package/chunks/EmptyCart.js +1 -1
- package/chunks/OrderSummary.js +1 -1
- package/chunks/OrderSummaryLine.js +1 -1
- package/chunks/acdl.js +1 -1
- package/chunks/applyCouponsToCart.js +1 -1
- package/chunks/getEstimateShipping.js +4 -4
- package/chunks/getEstimatedTotals.js +1 -1
- package/chunks/persisted-data.js +1 -1
- package/chunks/refreshCart.js +1 -1
- package/chunks/resetCart.js +1 -1
- package/chunks/updateProductsFromCart.js +1 -1
- package/containers/CartSummaryGrid.js +1 -1
- package/containers/CartSummaryList.js +1 -1
- package/containers/Coupons.js +1 -1
- package/containers/EmptyCart.js +1 -1
- package/containers/EstimateShipping.js +2 -2
- package/containers/MiniCart.js +1 -1
- package/containers/OrderSummary.js +1 -1
- package/containers/OrderSummaryLine.js +1 -1
- package/data/transforms/__fixtures__/productTypesData.d.ts +0 -15
- package/fragments.js +2 -5
- package/i18n/en_US.json.d.ts +2 -2
- package/package.json +1 -1
- package/render.js +2 -2
package/LICENSE.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
Last Updated: 28 October 2024
|
|
2
|
+
|
|
3
|
+
ADOBE COMMERCE DROP-IN LICENSE AGREEMENT
|
|
4
|
+
|
|
5
|
+
applicable to Adobe Commerce Customers
|
|
6
|
+
|
|
7
|
+
**Effective Date:** first date you download or use the Drop-in
|
|
8
|
+
|
|
9
|
+
NOTICE TO USER: The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the terms and conditions below which form a binding agreement between you and Adobe. **By downloading, installing, or making use of any portion of the Drop-in, you are agreeing to the following terms and conditions. If you do not agree to the terms and conditions below, do not use the Drop-in**. If you agree to be bound by this agreement on behalf of your employer or other entity, you must have the legal authority to do so. If you are not authorized to so bind your employer or such entity, do not download and do not use the Drop-in.
|
|
10
|
+
|
|
11
|
+
Your access to and use of the Drop-in is governed by the Adobe Enterprise Licensing Terms previously agreed to by you and Adobe or an authorized Adobe Reseller in a separate agreement. If you have not previously agreed to licensing terms then your installation and use of the Drop-in is subject to the current applicable Adobe Enterprise Licensing Terms available at <http://www.adobe.com/legal/terms/enterprise-licensing.html>. You agree that this agreement will have the same effect as any written negotiated agreement signed by you.
|
|
12
|
+
|
|
13
|
+
By downloading, installing or making use of any portion of the Drop-in, you accept and agree to be bound by all the terms and conditions of this agreement including all terms incorporated herein by reference.
|
|
14
|
+
|
|
15
|
+
This agreement is enforceable against any person or entity that installs and uses the Drop-in and any person or entity (e.g., system integrator, consultant or contractor) that installs or uses the drop-in on another person's or entity's behalf (e.g., Adobe Customer).
|
|
16
|
+
|
|
17
|
+
Notice to U.S. Government End Users: Products and services are “Commercial Product(s),” and “Commercial Service(s)” as those terms are defined at 48 C.F.R. section 2.101, consisting of “Commercial Computer Software” and “Commercial Computer Software Documentation,” as the terms are used in 48 C.F.R. section 12.212 or 48 C.F.R. section 227.7202, as applicable. Customer agrees, consistent with 48 C.F.R. section 12.212 or 48 C.F.R. sections 227.7202-1 through 227.72024, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (A) only as Commercial Products and Services; and (B) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished rights are reserved under the copyright laws of the United States.
|
|
18
|
+
|
|
19
|
+
**ADOBE COMMERCE DROP-IN LICENSE AGREEMENT**
|
|
20
|
+
|
|
21
|
+
applicable to Developers
|
|
22
|
+
|
|
23
|
+
**Effective Date:** first date you download or use the Drop-in
|
|
24
|
+
|
|
25
|
+
The Adobe Commerce Drop-in (“Drop-in”) is licensed to you subject to the terms and conditions below which form a binding agreement between you and Adobe. **By downloading, installing, or making use of any portion of the Drop-in, you are agreeing to the following terms and conditions. If you do not agree to the terms and conditions below, do not use the Drop-in**. If you agree to be bound by this agreement on behalf of your employer or other entity, you must have the legal authority to do so. If you are not authorized to so bind your employer or such entity, do not download and do not use the Drop-in.
|
|
26
|
+
|
|
27
|
+
**AGREED TERMS AND CONDITIONS**
|
|
28
|
+
|
|
29
|
+
1. **DEFINITIONS**.
|
|
30
|
+
|
|
31
|
+
1.1 “**Adobe**” means collectively, Adobe Inc., a company incorporated in Delaware, U.S.A., having a place of business at 345 Park Avenue, San Jose, California USA 95110-2704, U.S.A. (“**Adobe US**”) and Adobe Systems Software Ireland, company incorporated in Ireland, having a place of business 4-6 Riverwalk, City West Business Campus, Saggart, Dublin 24, Ireland (“**Adobe Ireland**”).__
|
|
32
|
+
|
|
33
|
+
1.2 “**Adobe Product(s)**” means software applications, programs and other technologies not included in or with the Drop-in which are or may be made available by Adobe for licensing to the general public. This agreement does not govern use of Adobe Products. See the end user license agreement accompanying an Adobe Product for terms governing its use.
|
|
34
|
+
|
|
35
|
+
1.3 “**Developer Product(s)**” means any software application(s), program(s) and other teconolog(y/ies) you develop with use of the Drop-in to function or interoperate with Adobe Products.
|
|
36
|
+
|
|
37
|
+
1.4 “**Intellectual Property Rights**” means copyright, moral rights, trademark, trade dress, patent, trade secret, unfair competition, and any other intellectual and proprietary rights.
|
|
38
|
+
|
|
39
|
+
1.5 “**Adobe Commerce Drop-in**” or “Drop-in” means all items comprising the application and all associated materials licensed to you by Adobe as part of the Drop-in, including all Drop-in system files, tools, programs and utilities, as well as any plug-ins or other application programming interfaces, header or JAR files (“**API**”), sample images, sounds, or similar assets (“**Content** **Files**”), software code samples, runtimes and libraries, including any portion(s) that is modified by you, or merged or incorporated with your Developer Products (“**Sample Code**”), and any related documentation, technical specifications, notes and explanatory materials, as well any modifications, updates, upgrades, or copies of, any of the foregoing items, that may be made available by Adobe, whether online or recorded on media, or manually downloaded by you.
|
|
40
|
+
|
|
41
|
+
2. **LICENSES GRANTED TO YOU**.
|
|
42
|
+
|
|
43
|
+
2.1 **Drop-in**. Subject to your compliance with terms of this agreement, Adobe grants to you a non-exclusive, non-sublicensable, non-transferable license to install and use the Drop-in solely for your internal design, development and testing of your Developer Products, subject further to the requirements and limitations below.
|
|
44
|
+
|
|
45
|
+
2.2 **API.** Subject to your compliance with terms of this agreement, Adobe grants to you a non-exclusive, non-sublicensable, non-transferable license to use the API only as provided in or by the applicable specification and to distribute the API solely in, with, and on the same media as, your Developer Products. For clarification, you may not modify the API.
|
|
46
|
+
|
|
47
|
+
2.3 **Content Files**. You may not use, modify, reproduce or distribute any of the Content Files. For the avoidance of doubt, the Content Files are included as examples only. You acquire no rights to the Content Files.
|
|
48
|
+
|
|
49
|
+
2.4 **Sample Code.** Subject to your compliance with terms of this agreement, Adobe grants to you a non-exclusive, non-sublicensable, non-transferable license to use, modify, merge, and redistribute (in object code form only) all or any portions of the Sample Code solely as part of, and as necessary to properly implement, the Drop-in in your Developer Products. All and any portion of the Sample Code that is modified or merged by you in your Developer Products is subject to the terms of this agreement.
|
|
50
|
+
|
|
51
|
+
3. **SCOPE OF LICENSE; LIMITATIONS AND RESTRICTIONS**
|
|
52
|
+
|
|
53
|
+
3.1 You may not distribute the Drop-ins or any of its component parts to interoperate with or to run on a platform other than the Adobe-approved platform.
|
|
54
|
+
|
|
55
|
+
3.2 Third-Party Software. The Drop-ins may contain third-party software, subject to additional terms and conditions, available at <http://www.adobe.com/go/thirdparty>; and
|
|
56
|
+
|
|
57
|
+
3.3 You may not modify, port, adapt, creative derivate works, redistribute, or translate any portion of this Drop-in; or add or delete any Drop-in program files that would in any way result in modifying the functionality or appearance of any element of the Adobe Products.
|
|
58
|
+
|
|
59
|
+
3.4 You may not reverse engineer, decompile, disassemble, or otherwise attempt to discover the source code of, any portion of the Drop-in, except and only to the extent that applicable laws of the jurisdiction where you are located grant you the right to decompile the Drop-in in order to obtain information necessary to render the Drop-in interoperable with other software; in which case you must first request the information from Adobe in writing and Adobe may, in its discretion, either provide such information to you or impose reasonable conditions, including reasonable fees, on your use of the Drop-in to ensure that Adobe’s and its licensors’ Intellectual Proprietary Rights in the Drop-in are protected.
|
|
60
|
+
|
|
61
|
+
3.5 You may not unbundle, repackage, distribute, rent, lease, offer, sell, resale, sublicense, assign or transfer all, or any component parts of the Drop-in, or any of your rights in the Drop-in, nor authorize any portion of the Drop-in to be copied onto another’s device, computer or platform, including on a service bureau basis to other providers (i.e., volume printing, banking, payroll service providers, etc) who provide you free or fee-based business services.
|
|
62
|
+
|
|
63
|
+
4. **VIRAL OPEN SOURCE SOFTWARE AND SERVICES**
|
|
64
|
+
|
|
65
|
+
You are not license to (and you agree that you will not) merge, integrate or use the Drop-in with any Viral Open Source Software or Viral Service, or otherwise take any action that could require disclosure, distribution, or licensing of all or any part of the Drop-in in source code form for any purpose whatsoever. For purposes of this Section, “**Viral Open Source Software**” means software licensed under the GNU General Public License, the GNU Affero General Public License (AGPL), the GNU Lesser General Public License (LGPL), or any other license terms that would require, or condition your use, modification, or distribution of such licensed software on the disclosure, distribution, or licensing of any other software in source code form, for the purpose of making derivative works, or at no charge, and “**Viral Service**” means any service that contains any viruses, Trojan horses, worms, time bombs, cancelbots or other computer programming routines that are intended to damage, detrimentally interfere with, surreptitiously intercept, expropriate or deprive owners’ possession of any system, data or personal information, or that in any way violates any law, statute, ordinance, regulation or rights (including any law, regulations or rights respecting intellectual property, computer spyware, privacy, export control, unfair competition, antidiscrimination or false advertising), or otherwise interferes with the operability of Adobe Products or third-party programs or software.
|
|
66
|
+
|
|
67
|
+
5. **NON-BLOCKING OF ADOBE DEVELOPMENT**
|
|
68
|
+
|
|
69
|
+
You acknowledge that Adobe is currently developing or may develop technologies and Adobe Products in the future that have, or may have, design or functionality similar to Developer Products that you may develop based on the license granted to you in this agreement. Nothing in this agreement will impair, limit or curtail Adobe’s right to continue with its development, maintenance or distribution of Adobe Products. You agree that you will not assert in any way any patent owned by you arising out of or in connection with your use of the Drop-in, or any Drop-in modifications made by you, against Adobe, its customers, subsidiaries or affiliates, or any of their customers, direct or indirect, agents and contractors for the manufacture, use, import, license, offer for sale, or sale of any Adobe Products.
|
|
70
|
+
|
|
71
|
+
6. **OWNERSHIP; INTELLECTUAL PROPERTY RIGHTS**
|
|
72
|
+
|
|
73
|
+
6.1 The items contained in the Drop-in are the Intellectual Property of Adobe and its licensors and are protected by United States copyright and patent law, international treaty provisions and applicable laws of the country in which it is being used. Adobe and its licensors reserve all rights not expressly granted to you under this agreement, and retain all right, title, and interest in the Drop-in, including all Intellectual Property Rights.
|
|
74
|
+
|
|
75
|
+
6.2 The Drop-in, or any of its component parts, may be supplied to you with certain accompanying proprietary notices, including patent, copyright and trademark notices. You agree to protect all copyright and other ownership interests of Adobe and its licensors in the Drop-in supplied to you under this agreement; to preserve exactly (and not remove or alter) all proprietary notices displayed in or on the Drop-in; to reproduce the same proprietary notices in all copies you make of any portion of the Drop-in.
|
|
76
|
+
|
|
77
|
+
6.3 You agree to include in your Developer Products Adobe’s copyright notices, wherever such notices are customarily posted, in substantially the following form: _Portions of software used to develop this product copyrighted by Adobe and its licensors. All Rights Reserved_.
|
|
78
|
+
|
|
79
|
+
6.4 Nothing in this agreement gives you a right to use the name, logo or trademarks of Adobe or its licensors to market your Developer Products.
|
|
80
|
+
|
|
81
|
+
7. **CONFIDENTIAL INFORMATION**
|
|
82
|
+
|
|
83
|
+
With respect to the API, and any portion, included in the Drop-in (for purposes of this Section, “**Adobe Confidential Information**”), you will treat the Adobe Confidential Information, and exercise the same degree of care to protect it, as you afford to your own confidential information. Your obligations under this Section will terminate when you can document that (a) the Adobe Confidential Information was in the public domain at or subsequent to the time Adobe communicated or provided it to you with no fault of your own; (b) your employees or agents developed independently without reference to any Adobe Confidential Information Adobe communicated or provided to you; or (c) your communication of Adobe Confidential Information was in response to a valid order by a court or other governmental body, was otherwise required by law, or was necessary to establish the rights of a party under this agreement.
|
|
84
|
+
|
|
85
|
+
8. **TERM; TERMINATION**
|
|
86
|
+
|
|
87
|
+
This agreement will commence on the Effective Date and will continue unless terminated. Adobe may terminate this agreement immediately upon notice to you, and without judicial intervention, if you fail to comply with any term of its terms. You may terminate this agreement at any time by discontinuing all your use(s) of the Drop-in and you agree to destroying or removing all full and partial copies of the Drop-in from your computer. If requested by Adobe, you must demonstrate proof of your compliance with the terms of this Section. In the event of termination, the terms of this agreement that, by their nature, are meant to survive termination, including all terms relating to viral open source software and services, ownership, confidential information, indemnity obligations and procedures, disclaimers of warranty, limitations on and exclusions of remedies and damages, dispute resolution, and waiver, will survive termination of this agreement.
|
|
88
|
+
|
|
89
|
+
9. **DISCLAIMER OF WARRANTY; LIMITATION OF LIABILITY**
|
|
90
|
+
|
|
91
|
+
You expressly understand and agree that, to the maximum extent permitted by applicable law:
|
|
92
|
+
|
|
93
|
+
9.1 **Use OF THE DROP-IN is entirely at your own risk. The Drop-in is provided by Adobe “AS-IS” and with all faults. Adobe and its licensors are not liable to you or anyone else for any special, incidental, indirect, consequential, or punitive damages whatsoever (even if Adobe has been advised of the possibility of such damages), including (a) damages resulting from loss of use, data, or profits, whether or not foreseeable, (b) damages based on any theory of liability, including breach of contract or warranty, negligence or other tortious action, or (c) damages arising from any other claim arising out of or in connection with your use of the Drop-in.**
|
|
94
|
+
|
|
95
|
+
9.2 **Adobe’s total liability in any matter arising out of or related to these terms is limited to US $100. This limitation will apply even if Adobe has been advised of the possibility of such damages and regardless of any failure of the essential purpose of any limited remedy.**
|
|
96
|
+
|
|
97
|
+
10. **INDEMNIFICATION**
|
|
98
|
+
|
|
99
|
+
To the maximum extent permitted by law, you agree to indemnify Adobe, its subsidiaries, affiliates, officers, agents, employees, partners, licensors, or suppliers from any claim or demand, including reasonable attorneys’ fees, that arise from the use and distribution of your Developer Products that contain or are based upon any portion of the Drop-in, or from your violation of the terms of this agreement.
|
|
100
|
+
|
|
101
|
+
11. **DISPUTE RESOLUTION**
|
|
102
|
+
|
|
103
|
+
11.1 **Choice of Law.** If you are a resident of North America (or if your organization is headquartered in North America), your relationship is with Adobe Systems Incorporated, a United States company, and the Drop-in is governed by the law of California, U.S.A. If you reside outside of North America, your relationship is with Adobe Systems Software Ireland Limited, and the Drop-in is governed by the law of Ireland.
|
|
104
|
+
|
|
105
|
+
11.2 **Venue.** You agree that any claim or dispute you may have against Adobe must be resolved by a court located in Santa Clara County, California, United States of America. You agree to submit to the personal jurisdiction of the courts located in Santa Clara County, California, United States of America when the laws of California apply, and the courts of Dublin, Ireland, when the laws of Ireland applies, for the purpose of litigating such claims or disputes. The parties specifically disclaim the U.N. Convention on Contracts for the International Sale of Goods.
|
|
106
|
+
|
|
107
|
+
11.3 **Injunctive Relief.** Notwithstanding the foregoing, in the event of your or others’ unauthorized access to or use of the Drop-in in violation of this Agreement, you agree that Adobe is entitled to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
|
|
108
|
+
|
|
109
|
+
12. **EXPORT RULES**
|
|
110
|
+
|
|
111
|
+
The Drop-in and your use of the Drop-in are subject to U.S. and international laws, restrictions, and regulations that may govern the import, export, and use of the Drop-in. You agree to comply with all such laws, restrictions, and regulations.
|
|
112
|
+
|
|
113
|
+
13. **NOTICE TO U.S. GOVERNMENT END USERS**
|
|
114
|
+
|
|
115
|
+
Products and services are “Commercial Product(s),” and “Commercial Service(s)” as those terms are defined at 48 C.F.R. section 2.101, consisting of “Commercial Computer Software” and “Commercial Computer Software Documentation,” as the terms are used in 48 C.F.R. section 12.212 or 48 C.F.R. section 227.7202, as applicable. Customer agrees, consistent with 48 C.F.R. section 12.212 or 48 C.F.R. sections 227.7202-1 through 227.72024, as applicable, the Commercial Computer Software and Commercial Computer Software Documentation are being licensed to U.S. Government end users (A) only as Commercial Products and Services; and (B) with only those rights as are granted to all other end users pursuant to the terms and conditions herein. Unpublished rights are reserved under the copyright laws of the United States.
|
|
116
|
+
|
|
117
|
+
14. **GENERAL PROVISIONS**
|
|
118
|
+
|
|
119
|
+
14.1 **Severability.** If it turns out that a particular term is not enforceable, the unenforceability of that term will not affect any other terms.
|
|
120
|
+
|
|
121
|
+
14.2 **Modification; Waiver.** No provision of this agreement will be deemed to have been modified or waived by any act or acquiescence on the part of Adobe, its agents, or employees, but only by any instrument in writing, signed by an authorized officer of Adobe.
|
|
122
|
+
|
|
123
|
+
14.3 **English Version.** The English language version of this agreement will be the version used when interpreting or construing its terms.
|
|
124
|
+
|
|
125
|
+
14.4 **Entire Agreement.** This Agreement is the entire agreement, superseding any prior written or oral agreements, between you and Adobe relating to the Drop-in.
|
|
126
|
+
|
|
127
|
+
Adobe Commerce Drop-in License Agreement_en_US-20241028_v1
|
package/api.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{s as o,f as d,h as l}from"./chunks/resetCart.js";import{g as $,r as Q,d as H,a as k,b as z,c as V}from"./chunks/resetCart.js";import{C as T,t as g,c as f}from"./chunks/refreshCart.js";import{g as j,b as q,d as B,e as J,i as K,a as W,r as X}from"./chunks/refreshCart.js";import{events as C}from"@dropins/tools/event-bus.js";import{CART_FRAGMENT as h}from"./fragments.js";import{b as A,a as I,c as _}from"./chunks/acdl.js";import{u as Z}from"./chunks/updateProductsFromCart.js";import{g as rt,b as at,a as et}from"./chunks/getEstimateShipping.js";import{g as ot}from"./chunks/getEstimatedTotals.js";import{g as E}from"./chunks/persisted-data.js";import{A as it,a as ct}from"./chunks/applyCouponsToCart.js";import"@dropins/tools/fetch-graphql.js";import"@dropins/tools/lib.js";const S=`
|
|
4
4
|
mutation ADD_PRODUCTS_TO_CART_MUTATION(
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsx as a,Fragment as l}from"@dropins/tools/preact-jsx-runtime.js";import{useState as y,useEffect as h}from"@dropins/tools/preact-compat.js";import{E as _}from"./EmptyCart.js";import{classes as d,VComponent as C}from"@dropins/tools/lib.js";/* empty css */import{Image as v}from"@dropins/tools/components.js";import{events as N}from"@dropins/tools/event-bus.js";import{g as b}from"./persisted-data.js";const j=({className:m,children:i,emptyCart:n,products:e,...c})=>a("div",{...c,className:d(["cart-cart-summary-grid",m]),children:a(l,{children:a("div",{className:d(["cart-cart-summary-grid__content",["cart-cart-summary-grid__content--empty",!e]]),children:e||a(C,{node:n,className:"cart-cart-summary-grid__empty-cart"})})})}),D=({children:m,initialData:i=null,routeProduct:n,routeEmptyCartCTA:e,...c})=>{const[s,g]=y(i);h(()=>{const r=N.on("cart/data",t=>{g(t)},{eager:!0});return()=>{r==null||r.off()}},[]);const p=(r,t)=>{const f=r.selectedOptions?`${r.name}: ${Object.entries(r.selectedOptions).join("; ")}`:r.name,o=a(v,{"data-testid":"cart-grid-item-image",loading:t<4?"eager":"lazy",src:r.image.src,alt:r.image.alt,"aria-label":f,width:"100%"});return n?a("div",{className:"cart-cart-summary-grid__item-container",children:a("a",{href:n(r),children:o})},t):o},u=s&&a(l,{children:s.items.map((r,t)=>p(r,t))});return a(j,{...c,emptyCart:a(_,{ctaLinkURL:e?e():void 0}),products:u})};D.getInitialData=async function(){return b()};export{D as C};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsx as n,jsxs as h,Fragment as X}from"@dropins/tools/preact-jsx-runtime.js";import*as o from"@dropins/tools/preact-compat.js";import{useState as N,useCallback as Ft,useEffect as ot}from"@dropins/tools/preact-compat.js";import{classes as L,VComponent as b,Slot as w}from"@dropins/tools/lib.js";import{E as Mt}from"./EmptyCart.js";/* empty css */import{Divider as st,Skeleton as zt,SkeletonRow as Ut,InLineAlert as qt,Icon as z,CartList as lt,Button as U,Accordion as Tt,AccordionSection as Wt,CartItem as Jt,Price as O,Image as Kt}from"@dropins/tools/components.js";import{g as Rt}from"./persisted-data.js";import{events as Yt}from"@dropins/tools/event-bus.js";import{s as Ht}from"./resetCart.js";import{u as ut}from"./updateProductsFromCart.js";import{S as Dt}from"./ChevronDown.js";import{useText as te}from"@dropins/tools/i18n.js";const ee=d=>o.createElement("svg",{id:"Icon_Chevron_right_Base","data-name":"Icon \\u2013 Chevron right \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...d},o.createElement("g",{id:"Large"},o.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),o.createElement("g",{id:"Chevron_right_icon","data-name":"Chevron right icon"},o.createElement("path",{vectorEffect:"non-scaling-stroke",id:"chevron",d:"M199.75,367.5l4.255,-4.255-4.255,-4.255",transform:"translate(-189.25 -351.0)",fill:"none",stroke:"currentColor"})))),dt=d=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d},o.createElement("g",{clipPath:"url(#clip0_4797_15331)"},o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M10.25 20.91L1.5 17.55V6.51996L10.25 9.92996V20.91Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M6.24023 4.64001L14.9902 8.06001V11.42",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{className:"error-icon",vectorEffect:"non-scaling-stroke",d:"M19 13.31L15.5 19.37H22.5L19 13.31Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{className:"error-icon",vectorEffect:"non-scaling-stroke",d:"M19.0202 17.11H18.9802L18.9502 15.56H19.0502L19.0202 17.11ZM18.9602 18.29V18.06H19.0502V18.29H18.9602Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M19 12.16V6.51996L10.25 9.92996V20.91L14.27 19.37L14.4 19.32",stroke:"currentColor",strokeLinejoin:"round"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M1.5 6.51999L10.25 3.04999L19 6.51999L10.25 9.92999L1.5 6.51999Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),o.createElement("defs",null,o.createElement("clipPath",{id:"clip0_4797_15331"},o.createElement("rect",{width:22,height:18.86,fill:"white",transform:"translate(1 2.54999)"})))),ne=d=>o.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d},o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M0.75 12C0.75 5.78421 5.78421 0.75 12 0.75C18.2158 0.75 23.25 5.78421 23.25 12C23.25 18.2158 18.2158 23.25 12 23.25C5.78421 23.25 0.75 18.2158 0.75 12Z",stroke:"currentColor"}),o.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M11.75 5.88423V4.75H12.25V5.88423L12.0485 13.0713H11.9515L11.75 5.88423ZM11.7994 18.25V16.9868H12.2253V18.25H11.7994Z",stroke:"currentColor"})),gt=({className:d,children:q,heading:k,footer:y,emptyCart:_,products:u,outOfStockMessage:v,variant:S="primary",loading:m=!0,...c})=>n("div",{...c,className:L(["cart-cart-summary-list",d,`cart-cart-summary-list__background--${S}`]),children:m?n(re,{}):h(X,{children:[(k||v)&&h("div",{"data-testid":"cart-summary-list-heading-wrapper",className:L(["cart-cart-summary-list__heading",["cart-cart-summary-list__heading--full-width",!u]]),children:[k&&h(X,{children:[n(b,{node:k,className:"cart-cart-summary-list__heading-text"}),n(st,{variant:"primary",className:L(["cart-cart-summary-list__heading-divider"])})]}),v&&n(b,{node:v,className:"cart-cart-summary-list__out-of-stock-message"})]}),n("div",{className:L(["cart-cart-summary-list__content",["cart-cart-summary-list__content--empty",!u]]),children:u||n(b,{node:_,className:"cart-cart-summary-list__empty-cart"})}),y&&h(X,{children:[n(st,{variant:"primary",className:L(["cart-cart-summary-list__footer-divider"])}),n(b,{node:y,className:"cart-cart-summary-list__footer-text"})]})]})}),re=()=>n(zt,{"data-testid":"cart-summary-list-skeleton",className:"cart-cart-summary-list__skeleton",rowGap:"medium",children:n(Ut,{variant:"row",size:"xlarge",fullWidth:!0,lines:3,multilineGap:"small"})}),ae=({initialData:d=null,hideHeading:q,hideFooter:k,routeProduct:y,routeEmptyCartCTA:_,routeCart:u,onItemUpdate:v,onItemRemove:S,maxItems:m,slots:c,attributesToHide:l=[],enableRemoveItem:j,enableUpdateItemQuantity:T,onItemsErrorsChange:$,accordion:ft=!1,variant:Z="primary",isLoading:mt,showMaxItems:W,showDiscount:ht,showSavings:yt,quantityType:vt,dropdownOptions:pt,...J})=>{var rt;const[B,kt]=N(!d),[a,Ct]=N(d),[E,wt]=N(new Set),[A,Lt]=N(new Map),s=(rt=Ht.config)==null?void 0:rt.shoppingCartDisplaySetting,[Q,_t]=N(W?!0:!m&&!W),i=te({file:"Cart.CartItem.file",files:"Cart.CartItem.files",heading:"Cart.Cart.heading",message:"Cart.CartItem.message",recipient:"Cart.CartItem.recipient",regularPrice:"Cart.CartItem.regularPrice",discountedPrice:"Cart.CartItem.discountedPrice",sender:"Cart.CartItem.sender",lowInventory:"Cart.CartItem.lowInventory",insufficientQuantity:"Cart.CartItem.insufficientQuantity",insufficientQuantityGeneral:"Cart.CartItem.insufficientQuantityGeneral",outOfStockHeading:"Cart.OutOfStockMessage.heading",outOfStockDescription:"Cart.OutOfStockMessage.message",outOfStockAlert:"Cart.OutOfStockMessage.alert",removeAction:"Cart.OutOfStockMessage.action",notAvailableMessage:"Cart.CartItem.notAvailableMessage",viewMore:"Cart.Cart.viewMore",viewAll:"Cart.Cart.viewAll",discountPercent:"Cart.CartItem.discountPercentage",savingsAmount:"Cart.CartItem.savingsAmount"}),F=(t,e)=>{wt(r=>(e?r.add(t):r.delete(t),new Set(r)))},K=(t,e)=>{Lt(r=>(e?r.set(t,e):r.delete(t),new Map(r)))},M=(t,e)=>{F(t.uid,!0),K(t.uid),j&&e===0?ut([{uid:t.uid,quantity:e}]).then(()=>{S==null||S({item:t})}).finally(()=>{F(t.uid,!1)}).catch(r=>{console.warn(r)}):T&&ut([{uid:t.uid,quantity:e}]).then(()=>{v==null||v({item:t})}).finally(()=>{F(t.uid,!1)}).catch(r=>{console.warn(r),K(t.uid,r.message)})},St=Ft(()=>{_t(t=>!t)},[]);ot(()=>{const t=Yt.on("cart/data",e=>{Ct(e),kt(!!mt)},{eager:!0});return()=>{t==null||t.off()}},[]),ot(()=>{$&&$(A)},[A,$]);const Et=(t,e)=>{if(l.includes("image"))return;const r=n(Kt,{"data-testid":"cart-list-item-image",loading:e<4?"eager":"lazy",src:t.image.src,alt:t.image.alt,width:"300",height:"300",params:{width:300}});return n(w,{name:"Thumbnail",slot:c==null?void 0:c.Thumbnail,context:{item:t},children:y?n("a",{href:y(t),children:r}):r})},It=t=>{if(!l.includes("name"))return n("span",{"data-testid":"cart-list-item-title",children:y?n("a",{href:y(t),children:t.name}):t.name})},xt=t=>{if(l.includes("configurations"))return;const e={...t.bundleOptions,...t.selectedOptions,...t.customizableOptions,...t.recipient?{[i.recipient]:t.recipient}:null,...t.recipientEmail&&t.recipient?{[i.recipient]:`${t.recipient} (${t.recipientEmail})`}:null,...t.sender?{[i.sender]:t.sender}:null,...t.senderEmail&&t.sender?{[i.sender]:`${t.sender} (${t.senderEmail})`}:{},...t.message?{[i.message]:t.message}:null,...t.links&&t.links.count?t.links.count>1?{[i.files.replace("{count}",t.links.count.toString())]:t.links.result}:{[i.file.replace("{count}",t.links.count.toString())]:t.links.result}:null};if(Object.keys(e).length!==0)return e},Pt=t=>{var e,r,f,g;return(s==null?void 0:s.price)==="INCLUDING_TAX"?t.discounted?{amount:t.regularPrice.value,currency:t.regularPrice.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:(e=t.taxedPrice)==null?void 0:e.value,currency:(r=t.taxedPrice)==null?void 0:r.currency,style:{font:"inherit"},"data-testid":"including-tax-item-price"}:{amount:(f=t.regularPrice)==null?void 0:f.value,currency:(g=t.regularPrice)==null?void 0:g.currency,style:{font:"inherit"},"data-testid":"regular-item-price"}},Nt=t=>{var e,r;return{amount:(e=t.savingsAmount)==null?void 0:e.value,currency:(r=t.savingsAmount)==null?void 0:r.currency,style:{font:"inherit"},"data-testid":"item-savings-amount"}},Ot=t=>(s==null?void 0:s.price)==="INCLUDING_EXCLUDING_TAX"?n(O,{amount:t.rowTotal.value,currency:t.rowTotal.currency,"data-testid":"excluding-tax-total","aria-label":i.regularPrice}):void 0,At=t=>{var f,g,p,C,I,x,P,at,it,ct;const e={"aria-label":i.regularPrice},r=t.discounted?{}:null;return["INCLUDING_TAX","INCLUDING_EXCLUDING_TAX"].includes(s==null?void 0:s.price)?(e.amount=(f=t.rowTotalIncludingTax)==null?void 0:f.value,e.currency=(g=t.rowTotalIncludingTax)==null?void 0:g.currency,e.variant=t.discounted?"strikethrough":"default",e["data-testid"]="including-tax-item-total",r&&(e.amount=(p=t.total)==null?void 0:p.value,e.currency=(C=t.total)==null?void 0:C.currency,r.amount=(I=t.rowTotalIncludingTax)==null?void 0:I.value,r.currency=(x=t.rowTotalIncludingTax)==null?void 0:x.currency,r.sale=!0,r["aria-label"]=i.discountedPrice,r["data-testid"]="discount-total")):(e.amount=(P=t.total)==null?void 0:P.value,e.currency=(at=t.total)==null?void 0:at.currency,e.variant=t.discounted?"strikethrough":"default",e["data-testid"]="regular-item-total",r&&(r.amount=(it=t.discountedTotal)==null?void 0:it.value,r.currency=(ct=t.discountedTotal)==null?void 0:ct.currency,r.sale=!0,r["aria-label"]=i.regularPrice,r["data-testid"]="discount-total")),{totalProps:e,discountProps:r}},Qt=t=>{var I,x,P;if(l.includes("warning"))return;const e=A.get(t.uid),r=(I=A.get(t.uid))==null?void 0:I.includes("The requested qty is not available"),f=E.has(t.uid),g=t.insufficientQuantity&&t.stockLevel?t.stockLevel==="noNumber"?i.insufficientQuantityGeneral:i.insufficientQuantity.replace("{inventory}",(x=t.stockLevel)==null?void 0:x.toString()).replace("{count}",t.quantity.toString()):"",p=t.lowInventory&&t.onlyXLeftInStock&&i.lowInventory.replace("{count}",(P=t.onlyXLeftInStock)==null?void 0:P.toString()),C=!t.outOfStock&&e&&r?i.notAvailableMessage:e;return!f&&(e||t.insufficientQuantity||t.lowInventory)?h("span",{"data-testid":"item-warning",children:[n(z,{source:ne,size:"16"}),C||g||p]}):void 0},Gt=t=>l!=null&&l.includes("alert")?void 0:!E.has(t.uid)&&t.outOfStock?h("span",{"data-testid":"item-alert",children:[n(z,{source:dt,size:"16"}),i.outOfStockAlert]}):void 0,Vt=t=>n(w,{name:"ProductAttributes",slot:c==null?void 0:c.ProductAttributes,context:{item:t}}),bt=t=>{if(!l.includes("sku"))return n("span",{"data-testid":"cart-list-item-sku",children:t.sku})},Xt=t=>n(w,{name:"Footer",slot:c==null?void 0:c.Footer,context:{item:t}}),R=t=>a!=null&&a.totalQuantity?a.items.filter(t).map((e,r)=>{var p;const{totalProps:f,discountProps:g}=At(e);return n(Jt,{updating:E==null?void 0:E.has(e.uid),loading:B,"data-testid":`cart-list-item-entry-${e.uid}`,image:Et(e,r),title:It(e),sku:bt(e),price:l.includes("price")?void 0:n(O,{...Pt(e)}),quantity:l.includes("quantity")?void 0:e.quantity,total:h(X,{children:[l.includes("total")?void 0:n(O,{...f}),l.includes("totalDiscount")?void 0:g&&n(O,{...g})]}),attributes:Vt(e),configurations:xt(e),totalExcludingTax:l.includes("totalExcludingTax")?void 0:Ot(e),taxIncluded:(s==null?void 0:s.price)==="INCLUDING_TAX",taxExcluded:!l.includes("totalExcludingTax")&&(s==null?void 0:s.price)==="INCLUDING_EXCLUDING_TAX",warning:Qt(e),alert:Gt(e),quantityType:vt,dropdownOptions:pt,onQuantity:T?C=>{M(e,C)}:void 0,onRemove:j?()=>M(e,0):void 0,discount:ht&&e.discounted&&e.discountPercentage?n("div",{"data-testid":"item-discount-percent",children:i.discountPercent.replace("{discount}",((p=e.discountPercentage)==null?void 0:p.toString())??"")}):void 0,savings:yt&&e.discounted&&e.savingsAmount?h("div",{children:[n("span",{children:n(O,{...Nt(e)})})," ",i.savingsAmount]}):void 0,footer:Xt(e)},e.uid)}):null,Y=n(w,{name:"EmptyCart",slot:c==null?void 0:c.EmptyCart,context:{},children:n(Mt,{"data-testid":"empty-cart",ctaLinkURL:_==null?void 0:_()})}),H=n(w,{name:"Heading",slot:c==null?void 0:c.Heading,context:{count:a==null?void 0:a.totalQuantity},children:n("div",{"data-testid":"default-cart-heading",children:i.heading.replace("({count})",a!=null&&a.totalQuantity?`(${a==null?void 0:a.totalQuantity.toString()})`:"")})}),jt=H.props.children.props.children,$t=()=>{const t=a==null?void 0:a.items.filter(e=>e.outOfStock);t==null||t.forEach(e=>{M(e,0)})},Zt=R(t=>t.outOfStock||t.insufficientQuantity||!1),D=a!=null&&a.hasOutOfStockItems?n(qt,{"data-testid":"cart-out-of-stock-message",icon:n(z,{source:dt,size:"16"}),itemList:n(lt,{"data-testid":"out-of-stock-cart-items",children:Zt}),type:"warning",heading:i.outOfStockHeading,description:i.outOfStockDescription,variant:"primary",actionButtonPosition:"bottom",additionalActions:a!=null&&a.hasFullyOutOfStockItems&&j?[{label:i.removeAction,onClick:$t}]:void 0}):void 0,G=R(t=>!t.outOfStock&&!t.insufficientQuantity),tt=Q?Math.max(m||5,5):Math.min((a==null?void 0:a.totalQuantity)||5,5),et=(a==null?void 0:a.totalQuantity)>tt,Bt=et&&!Q&&tt!=m,V=a!=null&&a.totalQuantity&&G?n(w,{name:"Footer",slot:c==null?void 0:c.CartSummaryFooter,context:{displayMaxItems:Q,routeCart:u},"data-testid":"cart-cart-summary-footer-slot",children:n("div",{"data-testid":"cart-cart-summary-footer",children:et?Bt?n(U,{className:"cart-cart-summary-list-footer__action",onClick:St,"data-testid":"view-more-items-button",variant:"tertiary",children:i.viewMore}):u&&n(U,{className:"cart-cart-summary-list-footer__action",href:u(),variant:"tertiary","data-testid":"view-cart-or-less-items-button",children:i.viewAll}):u&&n(U,{className:"cart-cart-summary-list-footer__action",href:u(),variant:"tertiary","data-testid":"view-cart-button",children:i.viewAll})})}):null,nt=a!=null&&a.totalQuantity?n(lt,{"data-testid":"cart-list",children:G==null?void 0:G.slice(0,Q?Math.max(m||(a==null?void 0:a.totalQuantity),5):Math.min(m??5,5))}):null;return ft?n(Tt,{"data-testid":"cart-summary-list-accordion",className:L(["cart-cart-summary-list-accordion",`cart-cart-summary-list__background--${Z}`]),iconOpen:ee,iconClose:Dt,children:n(Wt,{title:jt,"data-testid":"cart-summary-list-accordion__section",open:!0,renderContentWhenClosed:!0,children:n(gt,{...J,"aria-expanded":!0,"aria-label":"TEST",className:"cart-cart-summary-list-accordion__list",loading:B,footer:k?void 0:V||(u?V:void 0),emptyCart:Y,products:nt,outOfStockMessage:D,variant:Z})})}):n(gt,{...J,heading:q?void 0:H,footer:k?void 0:V||(u?V:void 0),loading:B,emptyCart:Y,products:nt,outOfStockMessage:D,variant:Z})};ae.getInitialData=async function(){return Rt()};export{ae as C};
|
package/chunks/ChevronDown.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import*as e from"@dropins/tools/preact-compat.js";const o=t=>e.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},e.createElement("path",{d:"M7.74512 9.87701L12.0001 14.132L16.2551 9.87701",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"}));export{o as S};
|
package/chunks/Coupon.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import*as C from"@dropins/tools/preact-compat.js";const M=H=>C.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...H},C.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M22 6.25H22.75C22.75 5.83579 22.4142 5.5 22 5.5V6.25ZM22 9.27L22.2514 9.97663C22.5503 9.87029 22.75 9.58731 22.75 9.27H22ZM20.26 12.92L19.5534 13.1714L19.5539 13.1728L20.26 12.92ZM22 14.66H22.75C22.75 14.3433 22.551 14.0607 22.2528 13.9539L22 14.66ZM22 17.68V18.43C22.4142 18.43 22.75 18.0942 22.75 17.68H22ZM2 17.68H1.25C1.25 18.0942 1.58579 18.43 2 18.43V17.68ZM2 14.66L1.74865 13.9534C1.44969 14.0597 1.25 14.3427 1.25 14.66H2ZM3.74 11.01L4.44663 10.7586L4.44611 10.7572L3.74 11.01ZM2 9.27H1.25C1.25 9.58675 1.44899 9.86934 1.7472 9.97611L2 9.27ZM2 6.25V5.5C1.58579 5.5 1.25 5.83579 1.25 6.25H2ZM21.25 6.25V9.27H22.75V6.25H21.25ZM21.7486 8.56337C19.8706 9.23141 18.8838 11.2889 19.5534 13.1714L20.9666 12.6686C20.5762 11.5711 21.1494 10.3686 22.2514 9.97663L21.7486 8.56337ZM19.5539 13.1728C19.9195 14.1941 20.7259 15.0005 21.7472 15.3661L22.2528 13.9539C21.6541 13.7395 21.1805 13.2659 20.9661 12.6672L19.5539 13.1728ZM21.25 14.66V17.68H22.75V14.66H21.25ZM22 16.93H2V18.43H22V16.93ZM2.75 17.68V14.66H1.25V17.68H2.75ZM2.25135 15.3666C4.12941 14.6986 5.11623 12.6411 4.44663 10.7586L3.03337 11.2614C3.42377 12.3589 2.85059 13.5614 1.74865 13.9534L2.25135 15.3666ZM4.44611 10.7572C4.08045 9.73588 3.27412 8.92955 2.2528 8.56389L1.7472 9.97611C2.34588 10.1905 2.81955 10.6641 3.03389 11.2628L4.44611 10.7572ZM2.75 9.27V6.25H1.25V9.27H2.75ZM2 7H22V5.5H2V7ZM7.31 6.74V18.17H8.81V6.74H7.31ZM17.0997 8.39967L11.0397 14.4597L12.1003 15.5203L18.1603 9.46033L17.0997 8.39967ZM12.57 9.67C12.57 9.87231 12.4159 10 12.27 10V11.5C13.2839 11.5 14.07 10.6606 14.07 9.67H12.57ZM12.27 10C12.1241 10 11.97 9.87231 11.97 9.67H10.47C10.47 10.6606 11.2561 11.5 12.27 11.5V10ZM11.97 9.67C11.97 9.46769 12.1241 9.34 12.27 9.34V7.84C11.2561 7.84 10.47 8.67938 10.47 9.67H11.97ZM12.27 9.34C12.4159 9.34 12.57 9.46769 12.57 9.67H14.07C14.07 8.67938 13.2839 7.84 12.27 7.84V9.34ZM17.22 14.32C17.22 14.5223 17.0659 14.65 16.92 14.65V16.15C17.9339 16.15 18.72 15.3106 18.72 14.32H17.22ZM16.92 14.65C16.7741 14.65 16.62 14.5223 16.62 14.32H15.12C15.12 15.3106 15.9061 16.15 16.92 16.15V14.65ZM16.62 14.32C16.62 14.1177 16.7741 13.99 16.92 13.99V12.49C15.9061 12.49 15.12 13.3294 15.12 14.32H16.62ZM16.92 13.99C17.0659 13.99 17.22 14.1177 17.22 14.32H18.72C18.72 13.3294 17.9339 12.49 16.92 12.49V13.99Z",fill:"#3D3D3D"}));export{M as S};
|
package/chunks/EmptyCart.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsx as r}from"@dropins/tools/preact-jsx-runtime.js";import{classes as o}from"@dropins/tools/lib.js";import{IllustratedMessage as i,Icon as s,Button as m}from"@dropins/tools/components.js";/* empty css */import*as t from"@dropins/tools/preact-compat.js";import{useText as l}from"@dropins/tools/i18n.js";const p=e=>t.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},t.createElement("g",{clipPath:"url(#clip0_102_196)"},t.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3601 18.16H6.5601L4.8801 3H2.3501M19.6701 19.59C19.6701 20.3687 19.0388 21 18.2601 21C17.4814 21 16.8501 20.3687 16.8501 19.59C16.8501 18.8113 17.4814 18.18 18.2601 18.18C19.0388 18.18 19.6701 18.8113 19.6701 19.59ZM7.42986 19.59C7.42986 20.3687 6.79858 21 6.01986 21C5.24114 21 4.60986 20.3687 4.60986 19.59C4.60986 18.8113 5.24114 18.18 6.01986 18.18C6.79858 18.18 7.42986 18.8113 7.42986 19.59Z",stroke:"currentColor",strokeLinejoin:"round"}),t.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M5.25 6.37L20.89 8.06L20.14 14.8H6.19",stroke:"currentColor",strokeLinejoin:"round"})),t.createElement("defs",null,t.createElement("clipPath",{id:"clip0_102_196"},t.createElement("rect",{vectorEffect:"non-scaling-stroke",width:19.29,height:19.5,fill:"white",transform:"translate(2.3501 2.25)"})))),g=({className:e,children:d,ctaLinkURL:a,...n})=>{const c=l({emptyCart:"Cart.EmptyCart.heading",cta:"Cart.EmptyCart.cta"});return r("div",{...n,className:o(["cart-empty-cart",e]),children:r(i,{className:o(["cart-empty-cart__wrapper",e]),"data-testid":"cart-empty-cart",heading:c.emptyCart,icon:r(s,{className:"cart-empty-cart__icon",source:p}),action:a?r(m,{"data-testid":"cart-empty-cart-button",size:"medium",variant:"primary",type:"submit",href:a,children:c.cta},"routeHome"):void 0})})};export{g as E};
|
package/chunks/OrderSummary.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsxs as E,jsx as r,Fragment as We}from"@dropins/tools/preact-jsx-runtime.js";import*as Ie from"@dropins/tools/preact-compat.js";import{useState as M,useEffect as ae,useCallback as Fe}from"@dropins/tools/preact-compat.js";import{VComponent as D,classes as ke,Slot as we}from"@dropins/tools/lib.js";import{events as Ee}from"@dropins/tools/event-bus.js";import{g as Ge}from"./persisted-data.js";import{s as Oe}from"./resetCart.js";import{g as ze}from"./getEstimatedTotals.js";import{p as Ve}from"./acdl.js";import{Accordion as Ne,AccordionSection as Be,ProgressSpinner as Ze,Divider as je,Price as l,Icon as Ue,Button as Qe}from"@dropins/tools/components.js";/* empty css */import{O as v}from"./OrderSummaryLine.js";import{S as Le}from"./ChevronDown.js";import{useText as Ae}from"@dropins/tools/i18n.js";import{S as Xe}from"./Coupon.js";const De=O=>Ie.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...O},Ie.createElement("path",{d:"M7.74512 14.132L12.0001 9.87701L16.2551 14.132",stroke:"#2B2B2B",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round"})),$e=({className:O,children:A,variant:P="primary",heading:s,loading:N=!0,subTotal:g,shipping:m,discounts:_,taxTotal:x,taxesApplied:e,total:p,primaryAction:B,coupons:o,totalSaved:y,updateLineItems:I=T=>T,...t})=>{const[T,L]=M(!1),i=Ae({checkout:"Cart.PriceSummary.checkout",discountedPrice:"Cart.CartItem.discountedPrice",download:"Cart.CartItem.download",heading:"Cart.Cart.heading",message:"Cart.CartItem.message",regularPrice:"Cart.CartItem.regularPrice",recipient:"Cart.CartItem.recipient",sender:"Cart.CartItem.sender",file:"Cart.CartItem.file",files:"Cart.CartItem.files",orderSummary:"Cart.PriceSummary.orderSummary",taxesBreakdownTitle:"Cart.PriceSummary.taxes.breakdown",taxTotal:"Cart.PriceSummary.taxes.total",taxEstimated:"Cart.PriceSummary.taxes.estimated",taxTotalOnly:"Cart.PriceSummary.taxes.totalOnly",showTaxBreakdown:"Cart.PriceSummary.taxes.showBreakdown",hideTaxBreakdown:"Cart.PriceSummary.taxes.hideBreakdown",taxToBeDetermined:"Cart.PriceSummary.taxToBeDetermined",subtotalLabel:"Cart.PriceSummary.subTotal.label",subtotalWithTaxes:"Cart.PriceSummary.subTotal.withTaxes",subtotalWithoutTaxes:"Cart.PriceSummary.subTotal.withoutTaxes",totalEstimated:"Cart.PriceSummary.total.estimated",totalLabel:"Cart.PriceSummary.total.label",totalWithoutTax:"Cart.PriceSummary.total.withoutTax",totalSaved:"Cart.PriceSummary.total.saved",shippingLabel:"Cart.PriceSummary.shipping.label",zipPlaceholder:"Cart.PriceSummary.shipping.zipPlaceholder",editZipAction:"Cart.PriceSummary.shipping.editZipAction",shippingWithTaxes:"Cart.PriceSummary.shipping.withTaxes",shippingWithoutTaxes:"Cart.PriceSummary.shipping.withoutTaxes",shippingEstimated:"Cart.PriceSummary.shipping.estimated",shippingEstimatedByState:"Cart.PriceSummary.shipping.alternateField.state",shippingEstimatedByZip:"Cart.PriceSummary.shipping.alternateField.zip",destinationLinkAriaLabel:"Cart.PriceSummary.shipping.destinationLinkAriaLabel",applyButton:"Cart.PriceSummary.estimatedShippingForm.apply.label",countryField:"Cart.PriceSummary.estimatedShippingForm.country.placeholder",freeShipping:"Cart.PriceSummary.freeShipping",stateField:"Cart.PriceSummary.estimatedShippingForm.state.placeholder",zipField:"Cart.PriceSummary.estimatedShippingForm.zip.placeholder"}),k=g&&E(v,{label:i.subtotalLabel,price:g.price,classSuffixes:["subTotal"],children:[g.taxIncluded&&r("div",{"data-testid":"sub-total-tax-caption",className:"cart-order-summary__caption",children:r("span",{children:i.subtotalWithTaxes})}),g.taxExcluded?r("div",{"data-testid":"sub-total-tax-caption-excluded",className:"cart-order-summary__caption",children:E("span",{children:[g.priceExcludingTax," ",i.subtotalWithoutTaxes]})}):void 0]}),w=_&&_.length>0&&r(We,{children:_.map(n=>E(v,{label:n.label,price:n.price,classSuffixes:["discount"],children:[n.coupon&&r(D,{node:n.coupon,className:"cart-order-summary__coupon__code"}),n.caption&&r(D,{node:n.caption,className:"cart-order-summary__caption"})]}))}),S=e&&e.length>0?r(Ne,{"data-testid":"tax-breakdown",className:"cart-order-summary__taxes",iconOpen:Le,iconClose:De,children:E(Be,{title:i.taxesBreakdownTitle,secondaryText:!T&&x?r(D,{node:x.price,className:"cart-order-summary__price"}):void 0,renderContentWhenClosed:!1,onStateChange:L,children:[r("div",{className:"cart-order-summary__appliedTaxes",children:e.map(n=>r(v,{label:n.label,price:n.price,classSuffixes:["taxEntry"],labelClassSuffix:"muted"}))}),x&&r(v,{label:i.taxTotal,price:x.price,classSuffixes:["taxTotal"],labelClassSuffix:"muted"})]})}):x&&r(v,{label:x.estimated?i.taxEstimated:i.taxTotalOnly,price:x.price,classSuffixes:["taxTotal"],testId:"tax-total-only"}),d=[{key:"subTotalContent",sortOrder:100,content:k},...m?[{key:"shippingContent",sortOrder:200,content:r(D,{node:m,className:"cart-order-summary__shipping"})}]:[],{key:"discountsContent",sortOrder:300,content:w},{key:"taxContent",sortOrder:400,content:S},...p?[{key:"taxContent",sortOrder:500,content:r(v,{label:p.estimated?i.totalEstimated:i.totalLabel,price:p.price,classSuffixes:["total","total--padded"],testId:"total-content",labelClassSuffix:"bold"})}]:[],...p&&p.priceWithoutTax?[{key:"totalWithoutTaxContent",sortOrder:600,content:r(v,{label:i.totalWithoutTax,price:p.priceWithoutTax,classSuffixes:["totalWithoutTax"],testId:"total-without-tax",labelClassSuffix:"muted"})}]:[],...y?[{key:"totalSavedContent",sortOrder:700,content:r(v,{label:i.totalSaved,price:y,classSuffixes:["saved"],testId:"total-saved",labelClassSuffix:"muted"})}]:[],...B?[{key:"primaryActionContent",sortOrder:800,content:r("div",{className:ke(["cart-order-summary__entry","cart-order-summary__primaryAction"]),children:B})}]:[],...o?[{key:"couponsContent",sortOrder:900,content:r(D,{node:o,className:"cart-order-summary__coupons"})}]:[]],h=I(d).sort((n,C)=>n.sortOrder-C.sortOrder);return E("div",{...t,className:ke(["cart-order-summary",["cart-order-summary--loading",N],[`cart-order-summary__${P}`,P],O]),children:[N&&r(Ze,{className:"cart-order-summary__spinner"}),E("div",{className:"cart-order-summary__heading",children:[s&&r(D,{node:s,className:"cart-order-summary__heading-text"}),r(je,{variant:"primary",className:"cart-order-summary__divider-primary"})]}),r("div",{className:"cart-order-summary__content",children:h.map(n=>Array.isArray(n.content)?r(Ne,{className:n.className,actionIconPosition:"right",iconOpen:Le,iconClose:De,children:r(Be,{defaultOpen:!1,title:n.title,renderContentWhenClosed:!1,children:n.content.map(C=>C.content)})}):n.content)})]})},qe=()=>{const[O,A]=M(!1),[P,s]=M();return{handleEstimateTotals:(g,m)=>{A(!0);const{shippingCountry:_,shippingState:x="",shippingStateId:e,shippingZip:p=""}=g,B={countryCode:_,postcode:p,region:{region:x,id:e},shipping_method:{carrier_code:(m==null?void 0:m.carrier_code)||"",method_code:(m==null?void 0:m.method_code)||""}};ze(B).then(o=>{var y,I,t,T,L,i,k,w,S,d,h,n,C,ee,W,F,G,z,V,Z;o&&s({estimatedTaxTotal:{amount:(y=o.totalTax)==null?void 0:y.value,currency:(I=o.totalTax)==null?void 0:I.currency},estimatedSubTotal:{excludingTax:{amount:(T=(t=o.subtotal)==null?void 0:t.excludingTax)==null?void 0:T.value,currency:(i=(L=o.subtotal)==null?void 0:L.excludingTax)==null?void 0:i.currency},includingTax:{amount:(w=(k=o.subtotal)==null?void 0:k.includingTax)==null?void 0:w.value,currency:(d=(S=o.subtotal)==null?void 0:S.includingTax)==null?void 0:d.currency},includingDiscountOnly:{amount:(n=(h=o.subtotal)==null?void 0:h.includingDiscountOnly)==null?void 0:n.value,currency:(ee=(C=o.subtotal)==null?void 0:C.includingDiscountOnly)==null?void 0:ee.currency}},estimatedGrandTotalPrice:{includingTax:{amount:(W=o.total)==null?void 0:W.includingTax.value,currency:(F=o.total)==null?void 0:F.includingTax.currency},excludingTax:{amount:(G=o.total)==null?void 0:G.excludingTax.value,currency:(z=o.total)==null?void 0:z.excludingTax.currency}},estimatedAppliedTaxes:{taxes:(V=o.appliedTaxes)==null?void 0:V.map(u=>{var b,f;return{label:u.label,amount:{value:(b=u.amount)==null?void 0:b.value,currency:(f=u.amount)==null?void 0:f.currency}}})},estimatedItems:{items:(Z=o.items)==null?void 0:Z.map(u=>{var b,f,j,U,Q,X,$,q,H,R;return{uid:u.uid,price:{amount:(b=u.price)==null?void 0:b.value,currency:(f=u.price)==null?void 0:f.currency},taxedPrice:{amount:(j=u.taxedPrice)==null?void 0:j.value,currency:(U=u.taxedPrice)==null?void 0:U.currency},rowTotal:{amount:(Q=u.rowTotal)==null?void 0:Q.value,currency:(X=u.rowTotal)==null?void 0:X.currency},rowTotalIncludingTax:{amount:($=u.rowTotalIncludingTax)==null?void 0:$.value,currency:(q=u.rowTotalIncludingTax)==null?void 0:q.currency},regularPrice:{amount:(H=u.regularPrice)==null?void 0:H.value,currency:(R=u.regularPrice)==null?void 0:R.currency}}})}})}).finally(()=>{A(!1)})},estimatedTotals:P,setEstimatedTotals:s,loading:O}},He=({children:O,initialData:A=null,routeCheckout:P,slots:s,errors:N,showTotalSaved:g,enableCoupons:m,updateLineItems:_=e=>e,...x})=>{var W,F,G,z,V,Z,u,b,f,j,U,Q,X,$,q,H,R,ie,ne,ce,oe,ue,se,le,me,de,xe,pe,he,ge,ye,Te,Se,Ce,be,fe;const[e,p]=M(A),[B,o]=M(!1),y=e==null?void 0:e.isVirtual;m=m??!0;const{handleEstimateTotals:I,estimatedTotals:t,setEstimatedTotals:T,loading:L}=qe(),i=(W=Oe.config)==null?void 0:W.shoppingCartDisplaySetting,k=(i==null?void 0:i.subtotal)==="INCLUDING_TAX",w=(i==null?void 0:i.subtotal)==="INCLUDING_EXCLUDING_TAX",S=i==null?void 0:i.zeroTax;ae(()=>{const c=Ee.on("cart/data",a=>{var J,K,Y;p(a);const te=(J=a==null?void 0:a.addresses)==null?void 0:J.shipping,re=a==null?void 0:a.isVirtual;(te||re)&&T(null),t==null&&T({estimatedTaxTotal:{amount:(K=a==null?void 0:a.totalTax)==null?void 0:K.value,currency:(Y=a==null?void 0:a.totalTax)==null?void 0:Y.currency}})},{eager:!0});return()=>{c==null||c.off()}},[]),ae(()=>{o(N)},[N]),ae(()=>{const c=Ee.on("shipping/estimate",a=>{var J,K,Y,ve,Pe,_e;const te={shippingCountry:(J=a==null?void 0:a.address)==null?void 0:J.countryCode,shippingState:(K=a==null?void 0:a.address)==null?void 0:K.region,shippingStateId:(Y=a==null?void 0:a.address)==null?void 0:Y.regionId,shippingZip:(ve=a==null?void 0:a.address)==null?void 0:ve.postCode},re={carrier_code:((Pe=a==null?void 0:a.shippingMethod)==null?void 0:Pe.carrierCode)||"",method_code:((_e=a==null?void 0:a.shippingMethod)==null?void 0:_e.methodCode)||""};I(te,re)});return()=>{c==null||c.off()}},[I]);const d=Ae({checkout:"Cart.PriceSummary.checkout",free:"Cart.PriceSummary.total.free",orderSummary:"Cart.PriceSummary.orderSummary",taxToBeDetermined:"Cart.PriceSummary.taxToBeDetermined"}),h=(e==null?void 0:e.hasOutOfStockItems)||B,n=Fe(()=>{!h&&e&&Ve(e,Oe.locale)},[h,e]),C=!y&&(s!=null&&s.EstimateShipping)?r(we,{name:"EstimateShipping",slot:s.EstimateShipping},"estimateShippingId"):void 0;if(!Object.keys(e??{}).length||(e==null?void 0:e.totalQuantity)===0)return null;const ee=m&&(s!=null&&s.Coupons)?r(we,{name:"Coupons",slot:s.Coupons},"couponsId"):void 0;return r($e,{...x,"data-testid":"cart-order-summary",heading:r("div",{children:d.orderSummary}),shipping:C,coupons:ee,loading:L,updateLineItems:_,subTotal:{taxIncluded:k&&!S,taxExcluded:w,zeroTaxSubtotal:S,priceExcludingTax:(F=t==null?void 0:t.estimatedSubTotal)!=null&&F.excludingTax?r(l,{"data-testid":"subtotal",...(G=t==null?void 0:t.estimatedSubTotal)==null?void 0:G.excludingTax}):r(l,{"data-testid":"subtotal",amount:(V=(z=e==null?void 0:e.subtotal)==null?void 0:z.excludingTax)==null?void 0:V.value,currency:(u=(Z=e==null?void 0:e.subtotal)==null?void 0:Z.excludingTax)==null?void 0:u.currency}),price:!S&&k||!S&&w?(b=t==null?void 0:t.estimatedSubTotal)!=null&&b.includingTax?r(l,{"data-testid":"subtotal",...(f=t==null?void 0:t.estimatedSubTotal)==null?void 0:f.includingTax}):r(l,{"data-testid":"subtotal",amount:(j=e==null?void 0:e.subtotal.includingTax)==null?void 0:j.value,currency:(U=e==null?void 0:e.subtotal.includingTax)==null?void 0:U.currency}):r(l,{"data-testid":"subtotal",amount:(X=(Q=e==null?void 0:e.subtotal)==null?void 0:Q.excludingTax)==null?void 0:X.value,currency:(q=($=e==null?void 0:e.subtotal)==null?void 0:$.excludingTax)==null?void 0:q.currency})},discounts:(H=e==null?void 0:e.appliedDiscounts)==null?void 0:H.map(c=>{var a;return{label:c.label,price:r(l,{"data-testid":"summary-discount-total",amount:-c.amount.value,currency:c.amount.currency,sale:!0}),coupon:c!=null&&c.coupon?E("span",{children:[r(Ue,{source:Xe,size:"16"}),(a=c==null?void 0:c.coupon)==null?void 0:a.code]}):void 0}}),taxTotal:y||t&&t.estimatedTaxTotal==null?{price:r("span",{"data-testid":"tax-total-tbd",children:d.taxToBeDetermined})}:{price:t!=null&&t.estimatedTaxTotal?r(l,{"data-testid":"tax-total-estimated",...t==null?void 0:t.estimatedTaxTotal}):r(l,{"data-testid":"tax-total-actual",amount:(R=e==null?void 0:e.totalTax)==null?void 0:R.value,currency:(ie=e==null?void 0:e.totalTax)==null?void 0:ie.currency}),estimated:(!t||!t.estimatedTaxTotal)&&!((ne=e==null?void 0:e.addresses)!=null&&ne.shipping)},taxesApplied:y?void 0:i!=null&&i.fullSummary?(oe=((ce=t==null?void 0:t.estimatedAppliedTaxes)==null?void 0:ce.taxes)||(e==null?void 0:e.appliedTaxes))==null?void 0:oe.map(c=>({label:c.label,price:r(l,{"data-testid":"applied-taxes",amount:c.amount.value,currency:c.amount.currency})})):void 0,total:{price:t!=null&&t.estimatedGrandTotalPrice?((se=(ue=t==null?void 0:t.estimatedGrandTotalPrice)==null?void 0:ue.includingTax)==null?void 0:se.amount)===0?r("span",{"data-testid":"total-including-tax",children:d.free}):r(l,{"data-testid":"total-including-tax-estimated",...(le=t==null?void 0:t.estimatedGrandTotalPrice)==null?void 0:le.includingTax}):((me=e==null?void 0:e.total)==null?void 0:me.includingTax.value)===0?r("span",{"data-testid":"total-including-tax",children:d.free}):r(l,{"data-testid":"total-including-tax-actual",amount:(de=e==null?void 0:e.total)==null?void 0:de.includingTax.value,currency:(xe=e==null?void 0:e.total)==null?void 0:xe.includingTax.currency}),estimated:(!t||!!(t!=null&&t.estimatedTaxTotal))&&!((pe=e==null?void 0:e.addresses)!=null&&pe.shipping),priceWithoutTax:i!=null&&i.grandTotal?t!=null&&t.estimatedAppliedTaxes?((ge=(he=t==null?void 0:t.estimatedGrandTotalPrice)==null?void 0:he.excludingTax)==null?void 0:ge.amount)===0?r("span",{"data-testid":"total-excluding-tax",children:d.free}):r(l,{"data-testid":"total-excluding-tax",...(ye=t==null?void 0:t.estimatedGrandTotalPrice)==null?void 0:ye.excludingTax}):((Te=e==null?void 0:e.total)==null?void 0:Te.excludingTax.value)===0?r("span",{"data-testid":"total-excluding-tax",children:d.free}):r(l,{"data-testid":"total-excluding-tax",amount:(Se=e==null?void 0:e.total)==null?void 0:Se.excludingTax.value,currency:(Ce=e==null?void 0:e.total)==null?void 0:Ce.excludingTax.currency}):void 0},primaryAction:P&&r(Qe,{"data-testid":"checkout-button",variant:"primary",disabled:h,"aria-disabled":h,href:h?void 0:P({cartId:e.id}),onClick:n,children:d.checkout}),totalSaved:g?r(l,{amount:(be=e==null?void 0:e.discount)==null?void 0:be.value,currency:(fe=e==null?void 0:e.total)==null?void 0:fe.includingTax.currency}):void 0})};He.getInitialData=async function(){return Ge()};export{He as O};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsxs as _,jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{classes as c,VComponent as y}from"@dropins/tools/lib.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/preact-compat.js";const u=({label:e,price:a,classSuffixes:s=[],labelClassSuffix:r,testId:m,children:o,...t})=>{const d="cart-order-summary__label",p="cart-order-summary__price";return _("div",{...t,...m?{"data-testid":m}:{},className:c(["cart-order-summary__entry",...s.map(i=>"cart-order-summary__"+i)]),children:[n("span",{className:c([d,...r?[d+"--"+r]:[]]),children:e}),n(y,{node:a,className:c([p,...r?[p+"--"+r]:[]])}),o]})},L=({label:e,price:a,classSuffixes:s=[],labelClassSuffix:r,testId:m,children:o,...t})=>n(u,{...t,label:e,price:a,classSuffixes:s,labelClassSuffix:r,testId:m,children:o});export{L as O};
|
package/chunks/acdl.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
function d(n){const{cart:e,locale:t="en-US"}=n;return{id:e.id,items:g(e.items,t),prices:{subtotalExcludingTax:e.subtotal.excludingTax,subtotalIncludingTax:e.subtotal.includingTax},totalQuantity:e.totalUniqueItems,possibleOnepageCheckout:void 0,giftMessageSelected:void 0,giftWrappingSelected:void 0,source:void 0}}function g(n,e){return n.map(t=>({canApplyMsrp:!1,formattedPrice:P(e,t.price.currency,t.price.value),id:t.uid,prices:{price:t.price},product:{productId:t.uid,name:t.name,sku:t.sku,topLevelSku:t.topLevelSku,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:t.categories,productType:t.itemType,pricing:{regularPrice:t.regularPrice.value,minimalPrice:void 0,maximalPrice:void 0,specialPrice:v(t),tierPricing:void 0,currencyCode:t.regularPrice.currency},canonicalUrl:t.canonicalUrl,mainImageUrl:t.image.src,image:{src:t.image.src,alt:t.image.alt}},configurableOptions:void 0,quantity:t.quantity}))}function P(n,e,t){const o=n.replace("_","-");return new Intl.NumberFormat(o,{style:"currency",currency:e}).format(t)}function v(n){var e;if(n.discounted)return(e=n.price)==null?void 0:e.value}const r={SHOPPING_CART_CONTEXT:"shoppingCartContext",PRODUCT_CONTEXT:"productContext",CHANGED_PRODUCTS_CONTEXT:"changedProductsContext"},c={OPEN_CART:"open-cart",ADD_TO_CART:"add-to-cart",REMOVE_FROM_CART:"remove-from-cart",SHOPPING_CART_VIEW:"shopping-cart-view",INITIATE_CHECKOUT:"initiate-checkout"};function O(){return window.adobeDataLayer=window.adobeDataLayer||[],window.adobeDataLayer}function i(n,e){const t=O();t.push({[n]:null}),t.push({[n]:e})}function T(n,e){O().push(o=>{const C=o.getState?o.getState():{};o.push({event:n,eventInfo:{...C,...e}})})}function D(n,e,t){const o=d({cart:n,locale:t});i(r.SHOPPING_CART_CONTEXT,{...o}),T(c.OPEN_CART),g(e,t).forEach(u=>{i(r.PRODUCT_CONTEXT,u.product),p(o,[u],c.ADD_TO_CART)})}function R(n,e){const t=d({cart:n,locale:e});i(r.SHOPPING_CART_CONTEXT,{...t}),T(c.SHOPPING_CART_VIEW)}function p(n,e,t){const o={items:e};i(r.SHOPPING_CART_CONTEXT,{...n}),i(r.CHANGED_PRODUCTS_CONTEXT,{...o}),T(t)}function I(n,e,t){const o=d({cart:n,locale:t}),C=o.items,u=O(),E=u.getState?u.getState():{},{shoppingCartContext:{items:f=[]}={}}=E;e.forEach(_=>{const s=f.find(l=>l.id===_.uid),a=C.find(l=>l.id===_.uid);!a&&!s||(!s&&a?(i(r.PRODUCT_CONTEXT,a.product),p(o,[a],c.ADD_TO_CART)):s&&!a?(i(r.PRODUCT_CONTEXT,s.product),p(o,[s],c.REMOVE_FROM_CART)):a.quantity>s.quantity?(i(r.PRODUCT_CONTEXT,a.product),p(o,[a],c.ADD_TO_CART)):(i(r.PRODUCT_CONTEXT,a.product),p(o,[a],c.REMOVE_FROM_CART)))})}function h(n,e){const t=d({cart:n,locale:e});i(r.SHOPPING_CART_CONTEXT,{...t}),T(c.INITIATE_CHECKOUT)}export{I as a,D as b,R as c,h as p};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{s as c,f as T,h as A}from"./resetCart.js";import{C as _,t as i}from"./refreshCart.js";import{events as n}from"@dropins/tools/event-bus.js";import{CART_FRAGMENT as u}from"../fragments.js";const P=`
|
|
4
4
|
mutation APPLY_COUPONS_TO_CART_MUTATION(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{s as a,f as u,h as l}from"./resetCart.js";import{events as p}from"@dropins/tools/event-bus.js";const h=e=>{var r,
|
|
3
|
+
import{s as a,f as u,h as l}from"./resetCart.js";import{events as p}from"@dropins/tools/event-bus.js";const h=e=>{var r,t;return{countryCode:e.country_code||"US",postCode:e.postcode||"",region:((r=e.region)==null?void 0:r.region)||"",regionId:(t=e.region)==null?void 0:t.id}},m=e=>e?{carrierCode:e.carrier_code||"",methodCode:e.method_code||"",amount:e.amount,...e.price_excl_tax&&{amountExclTax:{value:e.price_excl_tax.value,currency:e.price_excl_tax.currency}},...e.price_incl_tax&&{amountInclTax:{value:e.price_incl_tax.value,currency:e.price_incl_tax.currency}}}:null,g=`
|
|
4
4
|
query COUNTRIES_QUERY {
|
|
5
5
|
countries {
|
|
6
6
|
label: full_name_locale
|
|
@@ -19,7 +19,7 @@ query REGIONS_QUERY($id: String) {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
`,
|
|
22
|
+
`,E=`
|
|
23
23
|
mutation ESTIMATE_SHIPPING_METHODS_MUTATION(
|
|
24
24
|
$cartId: String!
|
|
25
25
|
$address: EstimateAddressInput!
|
|
@@ -47,4 +47,4 @@ query REGIONS_QUERY($id: String) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
`,x=async e=>{const r=a.cartId;if(!r)throw new Error("No cart ID found");if(!e)throw new Error("No address parameter found");const{countryCode:
|
|
50
|
+
`,x=async e=>{const r=a.cartId;if(!r)throw new Error("No cart ID found");if(!e)throw new Error("No address parameter found");const{countryCode:t,postcode:c,region:n}=e,i={country_code:t||"US",postcode:c||"",region:{region:(n==null?void 0:n.region)||"",region_id:n==null?void 0:n.id}};return u(E,{variables:{cartId:r,address:i}}).then(({errors:o,data:s})=>{if(o)return l(o);const d=s.estimateShippingMethods.find(_=>!_.error_message)||null;return p.emit("shipping/estimate",{address:h(i),shippingMethod:m(d)}),d})},C=async()=>u(g,{method:"GET"}).then(({errors:e,data:r})=>{var n,i;if(e)return l(e);const t=((n=r==null?void 0:r.countries)==null?void 0:n.sort((o,s)=>o.label.localeCompare(s.label)))||[],c=((i=r==null?void 0:r.storeConfig)==null?void 0:i.defaultCountry)||"US";return t.forEach(o=>{o.isDefaultCountry=o.id===c}),t}),T=async e=>u(f,{method:"GET",variables:{id:e}}).then(({errors:r,data:t})=>{var c;return r?l(r):((c=t==null?void 0:t.country)==null?void 0:c.available_regions)||[]});export{T as a,x as b,C as g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{s as h,f as T,h as m}from"./resetCart.js";import{C as A,t as E}from"./refreshCart.js";import"@dropins/tools/event-bus.js";import{CART_FRAGMENT as I}from"../fragments.js";const u=`
|
|
4
4
|
mutation GET_ESTIMATED_TOTALS_MUTATION(
|
package/chunks/persisted-data.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
function s(e){e?sessionStorage.setItem("DROPIN__CART__CART__DATA",JSON.stringify(e)):sessionStorage.removeItem("DROPIN__CART__CART__DATA")}function t(){const e=sessionStorage.getItem("DROPIN__CART__CART__DATA");return e?JSON.parse(e):null}function _(e){e?sessionStorage.setItem("DROPIN__CART__SHIPPING__DATA",JSON.stringify(e)):sessionStorage.removeItem("DROPIN__CART__SHIPPING__DATA")}export{s as a,t as g,_ as s};
|
package/chunks/refreshCart.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{s as i,d as A,f as g,h as y}from"./resetCart.js";import{events as l}from"@dropins/tools/event-bus.js";import{Initializer as R,merge as w}from"@dropins/tools/lib.js";import{a as G}from"./persisted-data.js";import{CART_FRAGMENT as d}from"../fragments.js";const I=new R({init:async r=>{const t={disableGuestCart:!1,...r};I.config.setConfig(t),f().catch(console.error)},listeners:()=>[l.on("authenticated",r=>{i.authenticated&&!r?l.emit("cart/reset",void 0):r&&!i.authenticated&&(i.authenticated=r,f().catch(console.error))},{eager:!0}),l.on("locale",async r=>{r!==i.locale&&(i.locale=r,f().catch(console.error))}),l.on("cart/reset",()=>{A().catch(console.error),l.emit("cart/data",null)}),l.on("cart/data",r=>{G(r)}),l.on("checkout/updated",r=>{r&&tr().catch(console.error)})]}),S=I.config;function b(r){var n,e,c,u,s,a,o,_,p,h;if(!r)return null;const t={id:r.id,totalQuantity:z(r),totalUniqueItems:r.itemsV2.items.length,errors:D(r==null?void 0:r.itemsV2),items:v(r==null?void 0:r.itemsV2),miniCartMaxItems:v(r==null?void 0:r.itemsV2).slice(0,((n=i.config)==null?void 0:n.miniCartMaxItemsDisplay)??10),total:{includingTax:{value:r.prices.grand_total.value,currency:r.prices.grand_total.currency},excludingTax:{value:r.prices.grand_total_excluding_tax.value,currency:r.prices.grand_total_excluding_tax.currency}},discount:x(r.prices.discounts,r.prices.grand_total.currency),subtotal:{excludingTax:{value:(e=r.prices.subtotal_excluding_tax)==null?void 0:e.value,currency:(c=r.prices.subtotal_excluding_tax)==null?void 0:c.currency},includingTax:{value:(u=r.prices.subtotal_including_tax)==null?void 0:u.value,currency:(s=r.prices.subtotal_including_tax)==null?void 0:s.currency},includingDiscountOnly:{value:(a=r.prices.subtotal_with_discount_excluding_tax)==null?void 0:a.value,currency:(o=r.prices.subtotal_with_discount_excluding_tax)==null?void 0:o.currency}},appliedTaxes:T(r.prices.applied_taxes),totalTax:x(r.prices.applied_taxes,r.prices.grand_total.currency),appliedDiscounts:T(r.prices.discounts),isVirtual:r.is_virtual,addresses:{shipping:r.shipping_addresses&&Q(r)},isGuestCart:!i.authenticated,hasOutOfStockItems:q(r),hasFullyOutOfStockItems:V(r),appliedCoupons:r.applied_coupons};return w(t,(h=(p=(_=S.getConfig().models)==null?void 0:_.CartModel)==null?void 0:p.transformer)==null?void 0:h.call(p,r))}function x(r,t){return r!=null&&r.length?r.reduce((n,e)=>({value:n.value+e.amount.value,currency:e.amount.currency}),{value:0,currency:t}):{value:0,currency:t}}function k(r,t){var n,e,c,u;return{src:r!=null&&r.useConfigurableParentThumbnail?t.product.thumbnail.url:((e=(n=t.configured_variant)==null?void 0:n.thumbnail)==null?void 0:e.url)||t.product.thumbnail.url,alt:r!=null&&r.useConfigurableParentThumbnail?t.product.thumbnail.label:((u=(c=t.configured_variant)==null?void 0:c.thumbnail)==null?void 0:u.label)||t.product.thumbnail.label}}function U(r){var t,n,e,c;return r.__typename==="ConfigurableCartItem"?{value:(n=(t=r.configured_variant)==null?void 0:t.price_range)==null?void 0:n.maximum_price.regular_price.value,currency:(c=(e=r.configured_variant)==null?void 0:e.price_range)==null?void 0:c.maximum_price.regular_price.currency}:r.__typename==="GiftCardCartItem"?{value:r.prices.price.value,currency:r.prices.price.currency}:{value:r.prices.original_item_price.value,currency:r.prices.original_item_price.currency}}function M(r){var t,n,e;return r.__typename==="ConfigurableCartItem"?((n=(t=r.configured_variant)==null?void 0:t.price_range)==null?void 0:n.maximum_price.discount.amount_off)>0:((e=r.product.price_range)==null?void 0:e.maximum_price.discount.amount_off)>0}function v(r){var n;if(!((n=r==null?void 0:r.items)!=null&&n.length))return[];const t=i.config;return r.items.map(e=>{var c,u,s,a;return{itemType:e.__typename,uid:e.uid,url:{urlKey:e.product.url_key,categories:e.product.categories.map(o=>o.url_key)},canonicalUrl:e.product.canonical_url,categories:e.product.categories.map(o=>o.name),quantity:e.quantity,sku:K(e),topLevelSku:e.product.sku,name:e.product.name,image:k(t,e),price:{value:e.prices.price.value,currency:e.prices.price.currency},taxedPrice:{value:e.prices.price_including_tax.value,currency:e.prices.price_including_tax.currency},fixedProductTaxes:e.prices.fixed_product_taxes,rowTotal:{value:e.prices.row_total.value,currency:e.prices.row_total.currency},rowTotalIncludingTax:{value:e.prices.row_total_including_tax.value,currency:e.prices.row_total_including_tax.currency},links:$(e.links),total:{value:(c=e.prices.original_row_total)==null?void 0:c.value,currency:(u=e.prices.original_row_total)==null?void 0:u.currency},discount:{value:e.prices.total_item_discount.value,currency:e.prices.total_item_discount.currency,label:(s=e.prices.discounts)==null?void 0:s.map(o=>o.label)},regularPrice:U(e),discounted:M(e),bundleOptions:e.__typename==="BundleCartItem"?N(e.bundle_options):null,selectedOptions:P(e.configurable_options),customizableOptions:F(e.customizable_options),sender:e.__typename==="GiftCardCartItem"?e.sender_name:null,senderEmail:e.__typename==="GiftCardCartItem"?e.sender_email:null,recipient:e.__typename==="GiftCardCartItem"?e.recipient_name:null,recipientEmail:e.__typename==="GiftCardCartItem"?e.recipient_email:null,message:e.__typename==="GiftCardCartItem"?e.message:null,discountedTotal:{value:e.prices.row_total.value,currency:e.prices.row_total.currency},onlyXLeftInStock:e.__typename==="ConfigurableCartItem"?(a=e.configured_variant)==null?void 0:a.only_x_left_in_stock:e.product.only_x_left_in_stock,lowInventory:e.is_available&&e.product.only_x_left_in_stock!==null,insufficientQuantity:(e.__typename==="ConfigurableCartItem"?e.configured_variant:e.product).stock_status==="IN_STOCK"&&!e.is_available,outOfStock:e.product.stock_status==="OUT_OF_STOCK",stockLevel:L(e),discountPercentage:X(e),savingsAmount:Y(e),productAttributes:j(e)}})}function D(r){var n;const t=(n=r==null?void 0:r.items)==null?void 0:n.reduce((e,c)=>{var u;return(u=c.errors)==null||u.forEach(s=>{e.push({uid:c.uid,text:s.message})}),e},[]);return t!=null&&t.length?t:null}function T(r){return r!=null&&r.length?r.map(t=>({amount:{value:t.amount.value,currency:t.amount.currency},label:t.label,coupon:t.coupon})):[]}function N(r){const t=r==null?void 0:r.map(e=>({uid:e.uid,label:e.label,value:e.values.map(c=>c.label).join(", ")})),n={};return t==null||t.forEach(e=>{n[e.label]=e.value}),Object.keys(n).length>0?n:null}function P(r){const t=r==null?void 0:r.map(e=>({uid:e.configurable_product_option_uid,label:e.option_label,value:e.value_label})),n={};return t==null||t.forEach(e=>{n[e.label]=e.value}),Object.keys(n).length>0?n:null}function F(r){const t=r==null?void 0:r.map(e=>({uid:e.customizable_option_uid,label:e.label,type:e.type,values:e.values.map(c=>({uid:c.customizable_option_value_uid,label:c.label,value:c.value}))})),n={};return t==null||t.forEach(e=>{var c;switch(e.type){case"field":case"area":case"date_time":n[e.label]=e.values[0].value;break;case"radio":case"drop_down":n[e.label]=e.values[0].label;break;case"multiple":case"checkbox":n[e.label]=e.values.reduce((_,p)=>_?`${_}, ${p.label}`:p.label,"");break;case"file":const u=new DOMParser,s=e.values[0].value,o=((c=u.parseFromString(s,"text/html").querySelector("a"))==null?void 0:c.textContent)||"";n[e.label]=o;break}}),n}function z(r){var t,n;return((t=i.config)==null?void 0:t.cartSummaryDisplayTotal)===0?r.itemsV2.items.length:((n=i.config)==null?void 0:n.cartSummaryDisplayTotal)===1?r.total_quantity:r.itemsV2.items.length}function $(r){return(r==null?void 0:r.length)>0?{count:r.length,result:r.map(t=>t.title).join(", ")}:null}function Q(r){var t,n,e,c;return(t=r.shipping_addresses)!=null&&t.length?(n=r.shipping_addresses)==null?void 0:n.map(u=>({countryCode:u.country.code,zipCode:u.postcode,regionCode:u.region.code})):(e=r.addresses)!=null&&e.length?(c=r.addresses)==null?void 0:c.filter(u=>u.default_shipping).map(u=>{var s;return u.default_shipping&&{countryCode:u.country_code,zipCode:u.postcode,regionCode:(s=u.region)==null?void 0:s.region_code}}):null}function q(r){var t,n;return(n=(t=r==null?void 0:r.itemsV2)==null?void 0:t.items)==null?void 0:n.some(e=>{var c;return((c=e==null?void 0:e.product)==null?void 0:c.stock_status)==="OUT_OF_STOCK"||e.product.stock_status==="IN_STOCK"&&!e.is_available})}function L(r){if(!r.not_available_message)return null;const t=r.not_available_message.match(/-?\d+/);return t?parseInt(t[0]):"noNumber"}function V(r){var t,n;return(n=(t=r==null?void 0:r.itemsV2)==null?void 0:t.items)==null?void 0:n.some(e=>{var c;return((c=e==null?void 0:e.product)==null?void 0:c.stock_status)==="OUT_OF_STOCK"})}function X(r){var n,e,c,u,s,a,o,_;let t;if(r.__typename==="ConfigurableCartItem")t=(u=(c=(e=(n=r==null?void 0:r.configured_variant)==null?void 0:n.price_range)==null?void 0:e.maximum_price)==null?void 0:c.discount)==null?void 0:u.percent_off;else{if(r.__typename==="BundleCartItem")return;t=(_=(o=(a=(s=r==null?void 0:r.product)==null?void 0:s.price_range)==null?void 0:a.maximum_price)==null?void 0:o.discount)==null?void 0:_.percent_off}if(t!==0)return Math.round(t)}function K(r){var t;return r.__typename==="ConfigurableCartItem"?r.configured_variant.sku:((t=r.product)==null?void 0:t.variantSku)||r.product.sku}function Y(r){var e,c,u,s,a,o;let t,n;if(t=((c=(e=r==null?void 0:r.prices)==null?void 0:e.original_row_total)==null?void 0:c.value)-((s=(u=r==null?void 0:r.prices)==null?void 0:u.row_total)==null?void 0:s.value),n=(o=(a=r==null?void 0:r.prices)==null?void 0:a.row_total)==null?void 0:o.currency,t!==0)return{value:t,currency:n}}function j(r){var t,n,e;return(e=(n=(t=r==null?void 0:r.product)==null?void 0:t.custom_attributesV2)==null?void 0:n.items)==null?void 0:e.map(c=>{const u=c.code.split("_").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ");return{...c,code:u}})}function B(r){if(!r)return null;const t=n=>{switch(n){case 1:return"EXCLUDING_TAX";case 2:return"INCLUDING_TAX";case 3:return"INCLUDING_EXCLUDING_TAX";default:return"EXCLUDING_TAX"}};return{displayMiniCart:r.minicart_display,miniCartMaxItemsDisplay:r.minicart_max_items,cartExpiresInDays:r.cart_expires_in_days,cartSummaryDisplayTotal:r.cart_summary_display_quantity,cartSummaryMaxItems:r.max_items_in_order_summary,defaultCountry:r.default_country,categoryFixedProductTaxDisplaySetting:r.category_fixed_product_tax_display_setting,productFixedProductTaxDisplaySetting:r.product_fixed_product_tax_display_setting,salesFixedProductTaxDisplaySetting:r.sales_fixed_product_tax_display_setting,shoppingCartDisplaySetting:{zeroTax:r.shopping_cart_display_zero_tax,subtotal:t(r.shopping_cart_display_subtotal),price:t(r.shopping_cart_display_price),shipping:t(r.shopping_cart_display_shipping),fullSummary:r.shopping_cart_display_full_summary,grandTotal:r.shopping_cart_display_grand_total,taxGiftWrapping:r.shopping_cart_display_tax_gift_wrapping},useConfigurableParentThumbnail:r.configurable_thumbnail_source==="parent"}}const C=`
|
|
4
4
|
$pageSize: Int! = 100,
|
package/chunks/resetCart.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{FetchGraphQL as i}from"@dropins/tools/fetch-graphql.js";import"@dropins/tools/event-bus.js";import{g as c}from"./persisted-data.js";function u(t){const r=document.cookie.split(";");for(let a=0;a<r.length;a++){const n=r[a].trim();if(n.indexOf(`${t}=`)===0)return n.substring(t.length+1)}return null}const d=(()=>{const t=c();return{cartId:null,authenticated:t?!t.isGuestCart:!1}})(),s=new Proxy(d,{set(t,r,a){var n;if(t[r]=a,r==="cartId"){if(a===s.cartId)return!0;if(a===null)return document.cookie="DROPIN__CART__CART-ID=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/",!0;const e=(n=s.config)==null?void 0:n.cartExpiresInDays;e||console.warn('Missing "expiresInDays" config. Cookie expiration will default to 30 days.');const o=new Date;o.setDate(o.getDate()+(e??30)),document.cookie=`DROPIN__CART__CART-ID=${a}; expires=${o.toUTCString()}; path=/`}return!0},get(t,r){return r==="cartId"?u("DROPIN__CART__CART-ID"):t[r]}}),{setEndpoint:f,setFetchGraphQlHeader:C,removeFetchGraphQlHeader:I,setFetchGraphQlHeaders:D,fetchGraphQl:m,getConfig:_}=new i().getMethods(),T=t=>{const r=t.findIndex(({extensions:e})=>(e==null?void 0:e.category)==="graphql-authorization")>-1,a=t.findIndex(({path:e,extensions:o})=>(o==null?void 0:o.category)==="graphql-no-such-entity"&&!(e!=null&&e.includes("applyCouponsToCart")))>-1,n=t.map(e=>e.message).join(" ");if(r||a)return l(),console.error(n),null;throw Error(n)},l=()=>(s.cartId=null,s.authenticated=!1,Promise.resolve(null));export{f as a,C as b,D as c,l as d,m as f,_ as g,T as h,I as r,s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{s as m,f as i,h as T}from"./resetCart.js";import{C as _,t as p}from"./refreshCart.js";import{events as n}from"@dropins/tools/event-bus.js";import{a as I}from"./acdl.js";import{CART_FRAGMENT as u}from"../fragments.js";const C=`
|
|
4
4
|
mutation UPDATE_PRODUCTS_FROM_CART_MUTATION(
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{C as s,C as u}from"../chunks/CartSummaryGrid.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"../chunks/EmptyCart.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/i18n.js";import"@dropins/tools/event-bus.js";import"../chunks/persisted-data.js";export{s as CartSummaryGrid,u as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{C as b,C as c}from"../chunks/CartSummaryList.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"../chunks/EmptyCart.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/i18n.js";import"../chunks/persisted-data.js";import"@dropins/tools/event-bus.js";import"../chunks/resetCart.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/updateProductsFromCart.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/acdl.js";import"../chunks/ChevronDown.js";export{b as CartSummaryList,c as default};
|
package/containers/Coupons.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsx as o,jsxs as A}from"@dropins/tools/preact-jsx-runtime.js";import*as n from"@dropins/tools/preact-compat.js";import{useRef as P,useState as E,useEffect as y}from"@dropins/tools/preact-compat.js";import{classes as a,VComponent as w,getFormValues as I}from"@dropins/tools/lib.js";import{Accordion as M,AccordionSection as b,Button as k,Icon as R,Input as T}from"@dropins/tools/components.js";/* empty css */import{S as j}from"../chunks/Coupon.js";import{useText as B}from"@dropins/tools/i18n.js";import"../chunks/resetCart.js";import{events as L}from"@dropins/tools/event-bus.js";import{a as x,A as N}from"../chunks/applyCouponsToCart.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/persisted-data.js";import"../chunks/refreshCart.js";import"../fragments.js";const z=s=>n.createElement("svg",{id:"Icon_Add_Base","data-name":"Icon \\u2013 Add \\u2013 Base",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",...s},n.createElement("g",{id:"Large"},n.createElement("rect",{id:"Placement_area","data-name":"Placement area",width:24,height:24,fill:"#fff",opacity:0}),n.createElement("g",{id:"Add_icon","data-name":"Add icon",transform:"translate(9.734 9.737)"},n.createElement("line",{vectorEffect:"non-scaling-stroke",id:"Line_579","data-name":"Line 579",y2:12.7,transform:"translate(2.216 -4.087)",fill:"none",stroke:"currentColor"}),n.createElement("line",{vectorEffect:"non-scaling-stroke",id:"Line_580","data-name":"Line 580",x2:12.7,transform:"translate(-4.079 2.263)",fill:"none",stroke:"currentColor"})))),q=s=>n.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},n.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 5.64001L5.62988 18.37",stroke:"currentColor"}),n.createElement("path",{vectorEffect:"non-scaling-stroke",d:"M18.3599 18.37L5.62988 5.64001",stroke:"currentColor"})),D=s=>n.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...s},n.createElement("path",{d:"M17.3332 11.75H6.6665",strokeWidth:1.5,strokeLinecap:"square",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke",fill:"none",stroke:"currentColor"})),V=({className:s,children:_,couponCodeField:f,applyCouponsButton:p,appliedCoupons:u,error:h,onApplyCoupon:d,...r})=>{const c=P(null),g=B({couponTitle:"Cart.PriceSummary.coupon.title"}),C=v=>{var t;v.preventDefault();const S=I(c.current);d==null||d(S);const e=(t=c==null?void 0:c.current)==null?void 0:t.querySelector("input");e&&(e.value="")};return o("div",{...r,"data-testid":"cart-coupons",className:a(["cart-coupons",s]),children:o(M,{"data-testid":"coupon-code",className:a(["cart-coupons__accordion"]),actionIconPosition:"right",iconOpen:z,iconClose:D,children:A(b,{title:g.couponTitle,iconLeft:j,showIconLeft:!0,renderContentWhenClosed:!1,"data-testid":"coupon-code-accordion-section",className:a(["cart-coupons__accordion-section"]),children:[o("form",{"data-testid":"coupon-code-form",className:a(["coupon-code-form--edit"]),ref:c,children:A("div",{className:a(["coupon-code-form__action"]),children:[f&&o(w,{node:f,className:a(["coupon-code-form__codes"])}),p&&o(w,{node:p,className:a(["coupon-code-form--button"]),onClick:C,type:"submit"})]})}),h&&o(w,{node:h,className:a(["coupon-code-form__error"])}),u&&o(w,{node:u,className:a(["coupon-code-form__applied"])})]})})})},oe=({children:s,..._})=>{const[f,p]=E(new Set),[u,h]=E([]),[d,r]=E(new Set),c=B({applyButton:"Cart.PriceSummary.coupon.applyAction",placeholder:"Cart.PriceSummary.coupon.placeholder"}),g=async e=>{const t=e.coupon,i=new Set(f);i.add(t),r(new Set);const l=Array.from(i);x(l,N.REPLACE).then(m=>{if(m===null)throw new Error("Error adding coupon code");p(i)}).catch(m=>{console.warn(m),r(new Set([m.message]))})},C=e=>{const t=new Set(f);t.delete(e),r(new Set);const i=Array.from(t);x(i,N.REPLACE).then(l=>{if(l===null)throw new Error("Error removing coupon code");p(t)}).catch(l=>{console.warn(l),r(new Set([l.message]))})};y(()=>{const e=L.on("cart/data",t=>{const i=t==null?void 0:t.appliedCoupons;if(!i){h([]),r(new Set);return}const l=i.map(m=>m.code);h(l),r(new Set)},{eager:!0});return()=>{e==null||e.off()}},[]),y(()=>{p(new Set(u))},[u]),y(()=>{const e=L.on("shipping/estimate",()=>{r(new Set)},{eager:!0});return()=>{e==null||e.off()}},[]);const v=u.map(e=>o(k,{variant:"tertiary",icon:o(R,{source:q,size:"24"}),onClick:()=>C(e),children:e},e)),S=d.size>0?o("div",{"data-testid":"coupon-code-error",children:Array.from(d)[0]}):void 0;return o(V,{..._,couponCodeField:o(T,{"aria-label":c.placeholder,type:"text",placeholder:c.placeholder,name:"coupon",variant:"primary",value:"","data-testid":"coupon-code-input",maxLength:50,error:d.size>0}),applyCouponsButton:o(k,{variant:"secondary",children:c.applyButton}),error:S,appliedCoupons:o("div",{children:v}),onApplyCoupon:g})};export{oe as Coupons,oe as default};
|
package/containers/EmptyCart.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsx as m}from"@dropins/tools/preact-jsx-runtime.js";import{E as p}from"../chunks/EmptyCart.js";import"@dropins/tools/lib.js";import"@dropins/tools/preact-compat.js";/* empty css */import"@dropins/tools/components.js";import"@dropins/tools/i18n.js";const E=({routeCTA:t})=>m(p,{ctaLinkURL:t==null?void 0:t()});export{E as EmptyCart,E as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{jsxs as A,jsx as e,Fragment as V}from"@dropins/tools/preact-jsx-runtime.js";import{classes as _,VComponent as Z,getFormValues as $}from"@dropins/tools/lib.js";import{Price as U,Picker as w,Input as G,Button as q}from"@dropins/tools/components.js";/* empty css */import{useRef as H,useState as r,useEffect as P,useCallback as J}from"@dropins/tools/preact-compat.js";import{useText as M,Text as v}from"@dropins/tools/i18n.js";import{s as X}from"../chunks/resetCart.js";import{events as B}from"@dropins/tools/event-bus.js";import{s as j}from"../chunks/persisted-data.js";import{g as O,a as Q,b as W}from"../chunks/getEstimateShipping.js";import"@dropins/tools/fetch-graphql.js";const Y=({countryField:k,destinationText:D,estimateButton:z,estimated:I,loading:N,onEstimate:l,price:f,priceExcludingTax:F,priceIncludingTax:n,stateField:S,taxExcluded:b,taxIncluded:T,zipField:m})=>{const d=H(null),[L,C]=r(!0),[y,i]=r("zip"),p=M({editZipAction:"Cart.EstimateShipping.editZipAction",destinationLinkAriaLabel:"Cart.EstimateShipping.destinationLinkAriaLabel",shippingLabel:"Cart.EstimateShipping.label",zipPlaceholder:"Cart.EstimateShipping.zipPlaceholder"}),x=a=>{a.preventDefault(),C(E=>!E)},t=a=>{a.preventDefault(),C(!0),i(E=>E==="zip"?"state":"zip")},h=a=>{a.preventDefault(),C(!1);const E=$(d.current);l==null||l(E)};return A("div",{"data-testid":"estimate-shipping",className:_(["cart-estimate-shipping",["cart-estimate-shipping--loading",N]]),children:[e("span",{className:"cart-estimate-shipping__label",children:I?D?A(V,{children:[e(v,{id:"Cart.EstimateShipping.estimatedDestination"}),e("a",{className:"cart-estimate-shippingLink",role:"button",href:"",onClick:x,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&x(a)},tabIndex:0,"aria-label":p.destinationLinkAriaLabel,"data-testid":"shipping-destination-link",children:D})]}):e(v,{id:"Cart.EstimateShipping.estimated"}):e(v,{id:"Cart.EstimateShipping.label"})}),e(Z,{node:f,className:"cart-estimate-shipping__price"}),I&&A(V,{children:[e("div",{className:_(["cart-estimate-shipping__caption"]),children:e("a",{href:"#",className:"cart-estimate-shipping__link",onClick:t,"data-testid":"shipping-alternate-field-link",children:y==="zip"?e(v,{id:"Cart.EstimateShipping.alternateField.state"}):e(v,{id:"Cart.EstimateShipping.alternateField.zip"})})}),A("form",{className:_(["cart-estimate-shipping--edit",["cart-estimate-shipping--hide",!L]]),ref:d,"data-testid":"shipping-estimate-form",children:[k&&e(Z,{node:k,className:_(["cart-estimate-shipping--country"])}),y==="state"?S&&e(Z,{node:S,className:_(["cart-estimate-shipping--state"])}):m&&e(Z,{node:m,className:_(["cart-estimate-shipping--zip"])}),z&&e(Z,{node:z,className:_(["cart-estimate-shipping--action"]),onClick:h,type:"submit"})]})]}),T&&e("div",{"data-testid":"shipping-tax-included",className:_(["cart-estimate-shipping__caption"]),children:A("span",{children:[n," ",e(v,{id:"Cart.EstimateShipping.withTaxes"})]})}),b?e("div",{"data-testid":"shipping-tax-included-excluded",className:_(["cart-estimate-shipping__caption"]),children:A("span",{children:[F," ",e(v,{id:"Cart.EstimateShipping.withoutTaxes"})]})}):void 0]})},ee=()=>{const[k,D]=r(!1),[z,I]=r([]),[N,l]=r("US"),[f,F]=r(""),[n,S]=r(""),[b,T]=r([]),[m,d]=r(!1),[L,C]=r(),[y,i]=r(),[p,x]=r(""),[t,h]=r(!1),a=()=>{l("US"),F(""),S(""),C(null),i(null),x(""),h(!1)},E=async u=>{const{shippingCountry:s,shippingState:o="",shippingZip:c=""}=u,K={countryCode:s,postcode:c,region:{region:o}};return D(!0),W(K).then(g=>(g&&(C({amount:g.amount.value,currency:g.amount.currency,priceIncludingtax:{amount:g.price_incl_tax.value,currency:g.price_incl_tax.currency},priceExcludingtax:{amount:g.price_excl_tax.value,currency:g.price_excl_tax.currency}}),i({carrier_code:g.carrier_code,method_code:g.method_code}),l(s),F(o),S(c),x(o||c||s),h(!0)),l(s),F(o),S(c),x(o||c||s),g)).finally(()=>{D(!1)})},R=u=>{u.preventDefault(),F(""),S("");const s=u.target.value;l(s)};return P(()=>{O().then(u=>{let s="US";const o=u.map(c=>(c.isDefaultCountry&&(s=c.id),{text:c.label,value:c.id}));I(o),l(s)})},[]),P(()=>{d(!0),Q(N).then(u=>{const s=u.map(o=>({text:o.name,value:o.code}));T(s)}).finally(()=>{d(!1)})},[N,d]),{loading:k,regionsLoading:m,estimatedDestinationText:p,countries:z,selectedCountry:N,selectedRegion:f,selectedZip:n,regions:b,estimatedShippingPrice:L,estimatedShippingMethod:y,shippingEstimated:t,handleEstimateShipping:E,handleCountrySelected:R,resetValues:a,setPriceSummaryLoading:D}},me=({showDefaultEstimatedShippingCost:k})=>{var x;const[D,z]=r(!1),{loading:I,countries:N,regions:l,selectedCountry:f,estimatedDestinationText:F,estimatedShippingPrice:n,handleCountrySelected:S,handleEstimateShipping:b,regionsLoading:T,selectedRegion:m,selectedZip:d,shippingEstimated:L,resetValues:C}=ee(),y=J(t=>{b(t).then(()=>{j(t)})},[b]);P(()=>{const t=B.on("cart/data",h=>{var s,o,c;z((h==null?void 0:h.isVirtual)||!1);const a=(o=(s=h==null?void 0:h.addresses)==null?void 0:s.shipping)==null?void 0:o[0];if(k&&!a&&b({shippingCountry:((c=X.config)==null?void 0:c.defaultCountry)??""}),!a)return;const{countryCode:E,regionCode:R,zipCode:u}=a;y({shippingCountry:E,shippingState:R,shippingZip:u})},{eager:!0});return()=>{t==null||t.off()}},[]),P(()=>{const t=B.on("cart/updated",()=>{L&&b({shippingCountry:f,shippingState:m,shippingZip:d})});return()=>{t==null||t.off()}},[L,f,m,d]),P(()=>{const t=B.on("cart/reset",()=>{C(),j(null)});return()=>{t==null||t.off()}},[C]),P(()=>{const t=B.on("cart/merged",()=>{L&&y({shippingCountry:f,shippingState:m,shippingZip:d})});return()=>{t==null||t.off()}},[L,f,m,d,y]);const i=M({applyButton:"Cart.PriceSummary.estimatedShippingForm.apply.label",countryField:"Cart.PriceSummary.estimatedShippingForm.country.placeholder",freeShipping:"Cart.PriceSummary.freeShipping",stateField:"Cart.PriceSummary.estimatedShippingForm.state.placeholder",taxToBeDetermined:"Cart.PriceSummary.taxToBeDetermined",zipField:"Cart.PriceSummary.estimatedShippingForm.zip.placeholder"});if(D)return null;const p=(x=X.config)==null?void 0:x.shoppingCartDisplaySetting;return e(Y,{loading:I,taxIncluded:(p==null?void 0:p.shipping)==="INCLUDING_TAX",taxExcluded:(p==null?void 0:p.shipping)==="INCLUDING_EXCLUDING_TAX",price:(n==null?void 0:n.amount)==0?e("span",{"data-testId":"free-shipping",children:i.freeShipping}):(p==null?void 0:p.shipping)==="INCLUDING_TAX"&&n?e(U,{"data-testid":"shipping",...n.priceIncludingtax}):n?e(U,{...n}):e("span",{children:i.taxToBeDetermined}),estimated:!0,priceExcludingTax:n!=null&&n.priceExcludingtax?e(U,{"data-testid":"shipping-excluding-tax",...n.priceExcludingtax}):e("span",{children:i.taxToBeDetermined}),countryField:e(w,{name:"shippingCountry",placeholder:i.countryField,value:f,variant:"primary",options:N,handleSelect:S,"data-testid":"estimate-shipping-country-selector"}),stateField:l.length>0?e(w,{name:"shippingState",placeholder:i.stateField,variant:"primary",options:l,value:m,"data-testid":"estimate-shipping-state-selector",disabled:T}):e(G,{"aria-label":i.stateField,name:"shippingState",placeholder:i.stateField,variant:"primary",value:m,disabled:T,"data-testid":"estimate-shipping-state-input",maxLength:50}),zipField:e(G,{"aria-label":i.zipField,name:"shippingZip",placeholder:i.zipField,variant:"primary","data-testid":"estimate-shipping-zip-input",value:d,maxLength:12}),estimateButton:e(q,{variant:"secondary","data-testid":"estimate-shipping-apply-button","aria-label":i.applyButton,children:i.applyButton}),destinationText:F||i.taxToBeDetermined,onEstimate:y})};export{me as EstimateShipping,me as default};
|
|
3
|
+
import{jsxs as A,jsx as e,Fragment as V}from"@dropins/tools/preact-jsx-runtime.js";import{classes as _,VComponent as Z,getFormValues as $}from"@dropins/tools/lib.js";import{Price as U,Picker as w,Input as G,Button as q}from"@dropins/tools/components.js";/* empty css */import{useRef as H,useState as r,useEffect as P,useCallback as J}from"@dropins/tools/preact-compat.js";import{useText as M,Text as v}from"@dropins/tools/i18n.js";import{s as X}from"../chunks/resetCart.js";import{events as B}from"@dropins/tools/event-bus.js";import{s as j}from"../chunks/persisted-data.js";import{g as O,a as Q,b as W}from"../chunks/getEstimateShipping.js";import"@dropins/tools/fetch-graphql.js";const Y=({countryField:k,destinationText:D,estimateButton:z,estimated:I,loading:N,onEstimate:l,price:f,priceExcludingTax:F,priceIncludingTax:n,stateField:S,taxExcluded:b,taxIncluded:T,zipField:m})=>{const d=H(null),[L,C]=r(!0),[y,i]=r("zip"),p=M({editZipAction:"Cart.EstimateShipping.editZipAction",destinationLinkAriaLabel:"Cart.EstimateShipping.destinationLinkAriaLabel",shippingLabel:"Cart.EstimateShipping.label",zipPlaceholder:"Cart.EstimateShipping.zipPlaceholder"}),x=a=>{a.preventDefault(),C(E=>!E)},t=a=>{a.preventDefault(),C(!0),i(E=>E==="zip"?"state":"zip")},h=a=>{a.preventDefault(),C(!1);const E=$(d.current);l==null||l(E)};return A("div",{"data-testid":"estimate-shipping",className:_(["cart-estimate-shipping",["cart-estimate-shipping--loading",N]]),children:[e("span",{className:"cart-estimate-shipping__label",children:I?D?A(V,{children:[e(v,{id:"Cart.EstimateShipping.estimatedDestination"})," ",e("a",{className:"cart-estimate-shippingLink",role:"button",href:"",onClick:x,onKeyDown:a=>{(a.key==="Enter"||a.key===" ")&&x(a)},tabIndex:0,"aria-label":p.destinationLinkAriaLabel,"data-testid":"shipping-destination-link",children:D})]}):e(v,{id:"Cart.EstimateShipping.estimated"}):e(v,{id:"Cart.EstimateShipping.label"})}),e(Z,{node:f,className:"cart-estimate-shipping__price"}),I&&A(V,{children:[e("div",{className:_(["cart-estimate-shipping__caption"]),children:e("a",{href:"#",className:"cart-estimate-shipping__link",onClick:t,"data-testid":"shipping-alternate-field-link",children:y==="zip"?e(v,{id:"Cart.EstimateShipping.alternateField.state"}):e(v,{id:"Cart.EstimateShipping.alternateField.zip"})})}),A("form",{className:_(["cart-estimate-shipping--edit",["cart-estimate-shipping--hide",!L]]),ref:d,"data-testid":"shipping-estimate-form",children:[k&&e(Z,{node:k,className:_(["cart-estimate-shipping--country"])}),y==="state"?S&&e(Z,{node:S,className:_(["cart-estimate-shipping--state"])}):m&&e(Z,{node:m,className:_(["cart-estimate-shipping--zip"])}),z&&e(Z,{node:z,className:_(["cart-estimate-shipping--action"]),onClick:h,type:"submit"})]})]}),T&&e("div",{"data-testid":"shipping-tax-included",className:_(["cart-estimate-shipping__caption"]),children:A("span",{children:[n," ",e(v,{id:"Cart.EstimateShipping.withTaxes"})]})}),b?e("div",{"data-testid":"shipping-tax-included-excluded",className:_(["cart-estimate-shipping__caption"]),children:A("span",{children:[F," ",e(v,{id:"Cart.EstimateShipping.withoutTaxes"})]})}):void 0]})},ee=()=>{const[k,D]=r(!1),[z,I]=r([]),[N,l]=r("US"),[f,F]=r(""),[n,S]=r(""),[b,T]=r([]),[m,d]=r(!1),[L,C]=r(),[y,i]=r(),[p,x]=r(""),[t,h]=r(!1),a=()=>{l("US"),F(""),S(""),C(null),i(null),x(""),h(!1)},E=async u=>{const{shippingCountry:s,shippingState:o="",shippingZip:c=""}=u,K={countryCode:s,postcode:c,region:{region:o}};return D(!0),W(K).then(g=>(g&&(C({amount:g.amount.value,currency:g.amount.currency,priceIncludingtax:{amount:g.price_incl_tax.value,currency:g.price_incl_tax.currency},priceExcludingtax:{amount:g.price_excl_tax.value,currency:g.price_excl_tax.currency}}),i({carrier_code:g.carrier_code,method_code:g.method_code}),l(s),F(o),S(c),x(o||c||s),h(!0)),l(s),F(o),S(c),x(o||c||s),g)).finally(()=>{D(!1)})},R=u=>{u.preventDefault(),F(""),S("");const s=u.target.value;l(s)};return P(()=>{O().then(u=>{let s="US";const o=u.map(c=>(c.isDefaultCountry&&(s=c.id),{text:c.label,value:c.id}));I(o),l(s)})},[]),P(()=>{d(!0),Q(N).then(u=>{const s=u.map(o=>({text:o.name,value:o.code}));T(s)}).finally(()=>{d(!1)})},[N,d]),{loading:k,regionsLoading:m,estimatedDestinationText:p,countries:z,selectedCountry:N,selectedRegion:f,selectedZip:n,regions:b,estimatedShippingPrice:L,estimatedShippingMethod:y,shippingEstimated:t,handleEstimateShipping:E,handleCountrySelected:R,resetValues:a,setPriceSummaryLoading:D}},me=({showDefaultEstimatedShippingCost:k})=>{var x;const[D,z]=r(!1),{loading:I,countries:N,regions:l,selectedCountry:f,estimatedDestinationText:F,estimatedShippingPrice:n,handleCountrySelected:S,handleEstimateShipping:b,regionsLoading:T,selectedRegion:m,selectedZip:d,shippingEstimated:L,resetValues:C}=ee(),y=J(t=>{b(t).then(()=>{j(t)})},[b]);P(()=>{const t=B.on("cart/data",h=>{var s,o,c;z((h==null?void 0:h.isVirtual)||!1);const a=(o=(s=h==null?void 0:h.addresses)==null?void 0:s.shipping)==null?void 0:o[0];if(k&&!a&&b({shippingCountry:((c=X.config)==null?void 0:c.defaultCountry)??""}),!a)return;const{countryCode:E,regionCode:R,zipCode:u}=a;y({shippingCountry:E,shippingState:R,shippingZip:u})},{eager:!0});return()=>{t==null||t.off()}},[]),P(()=>{const t=B.on("cart/updated",()=>{L&&b({shippingCountry:f,shippingState:m,shippingZip:d})});return()=>{t==null||t.off()}},[L,f,m,d]),P(()=>{const t=B.on("cart/reset",()=>{C(),j(null)});return()=>{t==null||t.off()}},[C]),P(()=>{const t=B.on("cart/merged",()=>{L&&y({shippingCountry:f,shippingState:m,shippingZip:d})});return()=>{t==null||t.off()}},[L,f,m,d,y]);const i=M({applyButton:"Cart.PriceSummary.estimatedShippingForm.apply.label",countryField:"Cart.PriceSummary.estimatedShippingForm.country.placeholder",freeShipping:"Cart.PriceSummary.freeShipping",stateField:"Cart.PriceSummary.estimatedShippingForm.state.placeholder",taxToBeDetermined:"Cart.PriceSummary.taxToBeDetermined",zipField:"Cart.PriceSummary.estimatedShippingForm.zip.placeholder"});if(D)return null;const p=(x=X.config)==null?void 0:x.shoppingCartDisplaySetting;return e(Y,{loading:I,taxIncluded:(p==null?void 0:p.shipping)==="INCLUDING_TAX",taxExcluded:(p==null?void 0:p.shipping)==="INCLUDING_EXCLUDING_TAX",price:(n==null?void 0:n.amount)==0?e("span",{"data-testId":"free-shipping",children:i.freeShipping}):(p==null?void 0:p.shipping)==="INCLUDING_TAX"&&n?e(U,{"data-testid":"shipping",...n.priceIncludingtax}):n?e(U,{...n}):e("span",{children:i.taxToBeDetermined}),estimated:!0,priceExcludingTax:n!=null&&n.priceExcludingtax?e(U,{"data-testid":"shipping-excluding-tax",...n.priceExcludingtax}):e("span",{children:i.taxToBeDetermined}),countryField:e(w,{name:"shippingCountry",placeholder:i.countryField,value:f,variant:"primary",options:N,handleSelect:S,"data-testid":"estimate-shipping-country-selector"}),stateField:l.length>0?e(w,{name:"shippingState",placeholder:i.stateField,variant:"primary",options:l,value:m,"data-testid":"estimate-shipping-state-selector",disabled:T}):e(G,{"aria-label":i.stateField,name:"shippingState",placeholder:i.stateField,variant:"primary",value:m,disabled:T,"data-testid":"estimate-shipping-state-input",maxLength:50}),zipField:e(G,{"aria-label":i.zipField,name:"shippingZip",placeholder:i.zipField,variant:"primary","data-testid":"estimate-shipping-zip-input",value:d,maxLength:12}),estimateButton:e(q,{variant:"secondary","data-testid":"estimate-shipping-apply-button","aria-label":i.applyButton,children:i.applyButton}),destinationText:F||i.taxToBeDetermined,onEstimate:y})};export{me as EstimateShipping,me as default};
|
package/containers/MiniCart.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{jsx as i,jsxs as c,Fragment as S}from"@dropins/tools/preact-jsx-runtime.js";import{useState as G,useEffect as X,useCallback as A}from"@dropins/tools/preact-compat.js";import{classes as v,VComponent as b,Slot as H}from"@dropins/tools/lib.js";import{g as R}from"../chunks/persisted-data.js";import{events as j}from"@dropins/tools/event-bus.js";import{Price as C,Button as I}from"@dropins/tools/components.js";/* empty css */import{useText as k}from"@dropins/tools/i18n.js";import{s as d}from"../chunks/resetCart.js";import{p as w}from"../chunks/acdl.js";import{u as F}from"../chunks/updateProductsFromCart.js";import"../chunks/CartSummaryGrid.js";import{C as O}from"../chunks/CartSummaryList.js";import"../chunks/OrderSummary.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/EmptyCart.js";import"../chunks/ChevronDown.js";import"../chunks/getEstimatedTotals.js";import"../chunks/OrderSummaryLine.js";import"../chunks/Coupon.js";const B=({className:h,products:s,subtotal:u,subtotalExcludingTaxes:a,ctas:l,...m})=>{const o=k({subtotal:"Cart.MiniCart.subtotal",subtotalExcludingTaxes:"Cart.MiniCart.subtotalExcludingTaxes"});return i("div",{...m,className:v(["cart-mini-cart",h]),children:s&&c(S,{children:[i("div",{className:"cart-mini-cart__products","data-testid":"mini-cart-products-wrapper",children:s}),c("div",{className:"cart-mini-cart__footer","data-testid":"mini-cart-subtotals",children:[u&&c("div",{className:"cart-mini-cart__footer__estimated-total","data-testid":"mini-cart-subtotal",children:[o.subtotal,i(b,{node:u})]}),a&&c("div",{className:"cart-mini-cart__footer__estimated-total-excluding-taxes","data-testid":"mini-cart-subtotal-excluding-taxes",children:[o.subtotalExcludingTaxes,i(b,{node:a,className:v(["dropin-price-summary__price","dropin-price-summary__price--muted"])})]}),l&&i(b,{node:l,className:"cart-mini-cart__footer__ctas"})]})]})})},V=({children:h,initialData:s=null,hideFooter:u=!0,slots:a,routeProduct:l,routeCart:m,routeCheckout:o,routeEmptyCartCTA:L,showDiscount:N,showSavings:D,...M})=>{var f,_,g;const[t,Q]=G(s),e=(f=d.config)==null?void 0:f.shoppingCartDisplaySetting;X(()=>{const r=j.on("cart/data",p=>{Q(p)},{eager:!0});return()=>{r==null||r.off()}},[]);const x=k({cartLink:"Cart.MiniCart.cartLink",checkoutLink:"Cart.MiniCart.checkoutLink"}),y=(r,p)=>F([{uid:r,quantity:p}]),T=r=>y(r,0),n=t==null?void 0:t.hasOutOfStockItems,E=A(()=>{t&&!n&&w(t,d.locale)},[t,n]),P=i(H,{name:"ProductList",slot:a==null?void 0:a.ProductList,context:{itemQuantityUpdateHandler:y,itemRemoveHandler:T,totalQuantity:t==null?void 0:t.totalQuantity},children:i(O,{"data-testid":"default-cart-summary-list",routeProduct:l,routeEmptyCartCTA:L,initialData:t,maxItems:(_=d.config)==null?void 0:_.miniCartMaxItemsDisplay,showMaxItems:!!((g=d.config)!=null&&g.miniCartMaxItemsDisplay),hideHeading:!(t!=null&&t.totalQuantity),hideFooter:u,enableRemoveItem:!0,showDiscount:N,showSavings:D})}),U=()=>(e==null?void 0:e.subtotal)==="INCLUDING_TAX"||(e==null?void 0:e.subtotal)==="INCLUDING_EXCLUDING_TAX"?{amount:t==null?void 0:t.subtotal.includingTax.value,currency:t==null?void 0:t.subtotal.includingTax.currency,"data-testid":"subtotal-including-tax",style:{font:"inherit"}}:{amount:t==null?void 0:t.subtotal.excludingTax.value,currency:t==null?void 0:t.subtotal.excludingTax.currency,"data-testid":"subtotal-excluding-tax",style:{font:"inherit"}};return i(B,{...M,subtotal:t!=null&&t.totalQuantity?(t==null?void 0:t.subtotal)&&i(C,{...U()}):void 0,subtotalExcludingTaxes:t!=null&&t.totalQuantity?(t==null?void 0:t.subtotal)&&((e==null?void 0:e.subtotal)==="INCLUDING_EXCLUDING_TAX"?i(C,{amount:t==null?void 0:t.subtotal.excludingTax.value,currency:t==null?void 0:t.subtotal.excludingTax.currency,"data-testid":"subtotal-including-excluding-tax",style:{font:"inherit"}}):void 0):void 0,ctas:t!=null&&t.totalQuantity?c("div",{children:[o&&i(I,{"data-testid":"route-checkout-button",variant:"primary",href:n?void 0:o(),disabled:n,"aria-disabled":n,onClick:E,children:x.checkoutLink}),m&&i(I,{"data-testid":"route-cart-button",variant:"tertiary",href:m(),children:x.cartLink})]}):void 0,products:P})};V.getInitialData=async function(){return R()};export{V as MiniCart,V as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{O as g,O as h}from"../chunks/OrderSummary.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/preact-compat.js";import"@dropins/tools/lib.js";import"@dropins/tools/event-bus.js";import"../chunks/persisted-data.js";import"../chunks/resetCart.js";import"@dropins/tools/fetch-graphql.js";import"../chunks/getEstimatedTotals.js";import"../chunks/refreshCart.js";import"../fragments.js";import"../chunks/acdl.js";import"@dropins/tools/components.js";/* empty css */import"../chunks/OrderSummaryLine.js";import"../chunks/ChevronDown.js";import"@dropins/tools/i18n.js";import"../chunks/Coupon.js";export{g as OrderSummary,h as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
import{O as e,O}from"../chunks/OrderSummaryLine.js";import"@dropins/tools/preact-jsx-runtime.js";import"@dropins/tools/lib.js";import"@dropins/tools/components.js";/* empty css */import"@dropins/tools/preact-compat.js";export{e as OrderSummaryLine,O as default};
|
|
@@ -66,7 +66,6 @@ declare const bundleOptions: {
|
|
|
66
66
|
label: string;
|
|
67
67
|
};
|
|
68
68
|
url_key: string;
|
|
69
|
-
url_suffix: string;
|
|
70
69
|
categories: {
|
|
71
70
|
url_path: string;
|
|
72
71
|
url_key: string;
|
|
@@ -132,7 +131,6 @@ declare const bundleOptionsEmpty: {
|
|
|
132
131
|
label: string;
|
|
133
132
|
};
|
|
134
133
|
url_key: string;
|
|
135
|
-
url_suffix: string;
|
|
136
134
|
categories: {
|
|
137
135
|
url_path: string;
|
|
138
136
|
url_key: string;
|
|
@@ -200,7 +198,6 @@ declare const giftCardPhysical: {
|
|
|
200
198
|
label: string;
|
|
201
199
|
};
|
|
202
200
|
url_key: string;
|
|
203
|
-
url_suffix: string;
|
|
204
201
|
categories: {
|
|
205
202
|
url_path: string;
|
|
206
203
|
url_key: string;
|
|
@@ -270,7 +267,6 @@ declare const giftCardVirtual: {
|
|
|
270
267
|
label: string;
|
|
271
268
|
};
|
|
272
269
|
url_key: string;
|
|
273
|
-
url_suffix: string;
|
|
274
270
|
categories: {
|
|
275
271
|
url_path: string;
|
|
276
272
|
url_key: string;
|
|
@@ -334,7 +330,6 @@ declare const simple: {
|
|
|
334
330
|
label: string;
|
|
335
331
|
};
|
|
336
332
|
url_key: string;
|
|
337
|
-
url_suffix: string;
|
|
338
333
|
categories: {
|
|
339
334
|
url_path: string;
|
|
340
335
|
url_key: string;
|
|
@@ -417,7 +412,6 @@ declare const simpleCustomizable: {
|
|
|
417
412
|
label: string;
|
|
418
413
|
};
|
|
419
414
|
url_key: string;
|
|
420
|
-
url_suffix: string;
|
|
421
415
|
categories: {
|
|
422
416
|
url_path: string;
|
|
423
417
|
url_key: string;
|
|
@@ -510,7 +504,6 @@ declare const configurable: {
|
|
|
510
504
|
label: string;
|
|
511
505
|
};
|
|
512
506
|
url_key: string;
|
|
513
|
-
url_suffix: string;
|
|
514
507
|
categories: {
|
|
515
508
|
url_path: string;
|
|
516
509
|
url_key: string;
|
|
@@ -621,7 +614,6 @@ declare const configurableCustomizable: {
|
|
|
621
614
|
label: string;
|
|
622
615
|
};
|
|
623
616
|
url_key: string;
|
|
624
|
-
url_suffix: string;
|
|
625
617
|
categories: {
|
|
626
618
|
url_path: string;
|
|
627
619
|
url_key: string;
|
|
@@ -686,7 +678,6 @@ declare const giftCard: {
|
|
|
686
678
|
label: string;
|
|
687
679
|
};
|
|
688
680
|
url_key: string;
|
|
689
|
-
url_suffix: string;
|
|
690
681
|
categories: {
|
|
691
682
|
url_path: string;
|
|
692
683
|
url_key: string;
|
|
@@ -755,7 +746,6 @@ declare const downloadbleWithMultipleLinks: {
|
|
|
755
746
|
label: string;
|
|
756
747
|
};
|
|
757
748
|
url_key: string;
|
|
758
|
-
url_suffix: string;
|
|
759
749
|
categories: {
|
|
760
750
|
url_path: string;
|
|
761
751
|
url_key: string;
|
|
@@ -791,7 +781,6 @@ declare const simpleLowInventory: {
|
|
|
791
781
|
label: string;
|
|
792
782
|
};
|
|
793
783
|
url_key: string;
|
|
794
|
-
url_suffix: string;
|
|
795
784
|
categories: {
|
|
796
785
|
url_path: string;
|
|
797
786
|
url_key: string;
|
|
@@ -859,7 +848,6 @@ declare const complexInsufficientQuantity: {
|
|
|
859
848
|
label: string;
|
|
860
849
|
};
|
|
861
850
|
url_key: string;
|
|
862
|
-
url_suffix: string;
|
|
863
851
|
categories: {
|
|
864
852
|
url_path: string;
|
|
865
853
|
url_key: string;
|
|
@@ -932,7 +920,6 @@ declare const complexInsufficientQuantityGeneralMessage: {
|
|
|
932
920
|
label: string;
|
|
933
921
|
};
|
|
934
922
|
url_key: string;
|
|
935
|
-
url_suffix: string;
|
|
936
923
|
categories: {
|
|
937
924
|
url_path: string;
|
|
938
925
|
url_key: string;
|
|
@@ -1015,7 +1002,6 @@ declare const complexWithProductAttributes: {
|
|
|
1015
1002
|
label: string;
|
|
1016
1003
|
};
|
|
1017
1004
|
url_key: string;
|
|
1018
|
-
url_suffix: string;
|
|
1019
1005
|
categories: {
|
|
1020
1006
|
url_path: string;
|
|
1021
1007
|
url_key: string;
|
|
@@ -1129,7 +1115,6 @@ declare const simpleWithNoDiscount: {
|
|
|
1129
1115
|
label: string;
|
|
1130
1116
|
};
|
|
1131
1117
|
url_key: string;
|
|
1132
|
-
url_suffix: string;
|
|
1133
1118
|
categories: {
|
|
1134
1119
|
url_path: string;
|
|
1135
1120
|
url_key: string;
|
package/fragments.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
const e=`
|
|
4
4
|
fragment PRICE_RANGE_FRAGMENT on PriceRange {
|
|
@@ -112,7 +112,6 @@ fragment CART_ITEM_FRAGMENT on CartItemInterface {
|
|
|
112
112
|
label
|
|
113
113
|
}
|
|
114
114
|
url_key
|
|
115
|
-
url_suffix
|
|
116
115
|
canonical_url
|
|
117
116
|
categories {
|
|
118
117
|
url_path
|
|
@@ -130,13 +129,11 @@ fragment CART_ITEM_FRAGMENT on CartItemInterface {
|
|
|
130
129
|
value
|
|
131
130
|
label
|
|
132
131
|
}
|
|
133
|
-
|
|
134
132
|
}
|
|
135
133
|
}
|
|
136
134
|
}
|
|
137
135
|
only_x_left_in_stock
|
|
138
|
-
stock_status
|
|
139
|
-
|
|
136
|
+
stock_status
|
|
140
137
|
price_range {
|
|
141
138
|
...PRICE_RANGE_FRAGMENT
|
|
142
139
|
}
|
package/i18n/en_US.json.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ declare const _default: {
|
|
|
30
30
|
"label": "Shipping",
|
|
31
31
|
"editZipAction": "Apply",
|
|
32
32
|
"estimated": "Estimated Shipping",
|
|
33
|
-
"estimatedDestination": "Estimated Shipping to
|
|
33
|
+
"estimatedDestination": "Estimated Shipping to",
|
|
34
34
|
"destinationLinkAriaLabel": "Change destination",
|
|
35
35
|
"zipPlaceholder": "Zip Code",
|
|
36
36
|
"withTaxes": "Including taxes",
|
|
@@ -96,7 +96,7 @@ declare const _default: {
|
|
|
96
96
|
"label": "Shipping",
|
|
97
97
|
"editZipAction": "Apply",
|
|
98
98
|
"estimated": "Estimated Shipping",
|
|
99
|
-
"estimatedDestination": "Estimated Shipping to
|
|
99
|
+
"estimatedDestination": "Estimated Shipping to",
|
|
100
100
|
"destinationLinkAriaLabel": "Change destination",
|
|
101
101
|
"zipPlaceholder": "Zip Code",
|
|
102
102
|
"withTaxes": "Including taxes",
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name": "@dropins/storefront-cart", "version": "1.0.
|
|
1
|
+
{"name": "@dropins/storefront-cart", "version": "1.0.2-beta1", "@dropins/tools": "~0.38.0", "license": "SEE LICENSE IN LICENSE.md"}
|
package/render.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! Copyright
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
3
|
(function(i,t){try{if(typeof document<"u"){const a=document.createElement("style"),n=t.styleId;for(const r in t.attributes)a.setAttribute(r,t.attributes[r]);a.setAttribute("data-dropin",n),a.appendChild(document.createTextNode(i));const e=document.querySelector('style[data-dropin="sdk"]');if(e)e.after(a);else{const r=document.querySelector('link[rel="stylesheet"], style');r?r.before(a):document.head.append(a)}}}catch(a){console.error("dropin-styles (injectCodeFunction)",a)}})(".cart-empty-cart{container-type:inline-size;container-name:cart}.cart-empty-cart__wrapper .dropin-card--secondary{display:grid;grid-auto-rows:min-content;justify-content:center;text-align:center}@container cart (width < 737px){.cart-empty-cart__wrapper .dropin-card{border:unset;border-style:hidden}}.cart-estimate-shipping{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xsmall);align-items:flex-end;color:var(--color-neutral-800)}.cart-estimate-shipping__label,.cart-estimate-shipping__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.cart-estimate-shipping__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.cart-estimate-shipping__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.cart-estimate-shipping__price{text-align:right}a.cart-estimate-shippingLink{text-decoration:underline}.cart-estimate-shipping__label--bold,.cart-estimate-shipping__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}.cart-estimate-shipping__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);grid-column:span 2;color:var(--color-neutral-700)}.cart-estimate-shipping--zip,.cart-estimate-shipping--state{background-color:var(--color-neutral-50)}.cart-estimate-shipping--edit{display:grid;grid-column:1 / span 2;gap:var(--spacing-small);padding-top:var(--spacing-small)}a.cart-estimate-shipping__link{text-decoration:underline}.cart-estimate-shipping--hide{display:none!important}.cart-estimate-shipping--edit button{width:var(--spacing-huge);justify-self:end}.cart-estimate-shipping--loading{opacity:.4;pointer-events:none}.cart-mini-cart{display:flex;flex-direction:column;height:100%;padding:var(--spacing-small) var(--spacing-small) var(--spacing-medium);box-sizing:border-box}.cart-mini-cart__empty-cart{width:100%;max-width:800px;height:100%;display:flex;flex-direction:column;justify-content:center;align-self:center}.cart-mini-cart__heading{display:grid;row-gap:var(--spacing-xsmall);font:var(--type-headline-2-default-font);letter-spacing:var(--type-headline-2-default-letter-spacing)}.cart-mini-cart__heading-divider{width:100%;margin:var(--spacing-xxsmall) 0 0 0}.cart-mini-cart__products{flex:1;overflow-y:auto;max-height:100%;padding-bottom:var(--spacing-medium)}.cart-mini-cart__products .cart-cart-summary-list__heading{padding:0}.cart-mini-cart__products .dropin-cart-item__configurations li{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.cart-mini-cart__footer{display:grid;grid-auto-flow:row;gap:var(--spacing-small);padding-top:var(--spacing-small);row-gap:var(--spacing-xsmall)}.cart-mini-cart__footer__estimated-total{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing);display:grid;grid-template:max-content / 1fr auto;gap:var(--spacing-xsmall)}.cart-mini-cart__footer__estimated-total-excluding-taxes{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);display:grid;grid-template:max-content / 1fr auto;gap:var(--spacing-xsmall);color:var(--color-neutral-700)}.cart-mini-cart__footer__ctas{display:grid;grid-auto-flow:row;gap:var(--spacing-xsmall);padding-top:var(--spacing-small)}.cart-cart-summary-grid{container-type:inline-size;container-name:cart-summary-grid;max-width:inherit}.cart-cart-summary-grid__content{display:grid;flex-wrap:wrap;gap:var(--spacing-small);grid-template-columns:repeat(6,1fr);margin:auto}.cart-cart-summary-grid__item-container{aspect-ratio:auto 3/4;display:inline-block}.cart-cart-summary-grid__item-container img{height:auto;max-width:100%}.cart-cart-summary-grid__item-container a:focus{display:block}.cart-cart-summary-grid__content--empty{grid-template-columns:repeat(1,1fr)}.cart-cart-summary-grid__empty-cart{align-self:center;justify-self:center;max-width:800px;width:100%}@container cart-summary-grid (width < 360px){.cart-cart-summary-grid__content{grid-template-columns:repeat(4,1fr);gap:var(--spacing-xsmall)}.cart-cart-summary-grid__content--empty{grid-template-columns:repeat(1,1fr)}}.cart-cart-summary-list{container-type:inline-size;container-name:cart-summary-list}.cart-cart-summary-list__background--secondary{background-color:var(--color-neutral-200)}.cart-cart-summary-list__heading{display:grid;row-gap:var(--spacing-xsmall);padding:var(--spacing-medium) 0 0 0;font:var(--type-headline-1-font);letter-spacing:var(--type-headline-1-letter-spacing);color:var(--color-neutral-800)}.cart-cart-summary-list__heading--full-width{width:100%}.cart-cart-summary-list__heading-divider{width:100%;margin:var(--spacing-xxsmall) 0 var(--spacing-medium) 0}.cart-cart-summary-list__content{display:grid;grid-template-columns:1fr;padding:0}.cart-cart-summary-list__out-of-stock-message{margin:calc(-1 * var(--spacing-xsmall)) 0 var(--spacing-medium) 0}.cart-cart-summary-list__empty-cart{justify-self:center;align-self:center;width:100%;max-width:800px}.cart-cart-summary-list-footer__action,.cart-cart-summary-list-footer__action:focus .cart-cart-summary-list-footer__action:active,.cart-cart-summary-list-footer__action:link{font:var(--type-body-2-strong-font);margin:0 auto;width:auto;margin-top:var(--spacing-medium);margin-bottom:var(--spacing-medium)}.cart-cart-summary-list-footer__action:hover{text-decoration:underline;text-underline-offset:var(--spacing-xxsmall);background:transparent;color:var(--color-brand-700)}.cart-cart-summary-list-footer__action:visited{background-color:none}.cart-cart-summary-list-accordion{border-left:var(--shape-border-width-2) solid var(--color-neutral-400);border-right:var(--shape-border-width-2) solid var(--color-neutral-400)}.cart-cart-summary-list-accordion__section{margin:var(--spacing-medium)}@container cart-summary-list (width >= 768px){.cart-cart-summary-list__out-of-stock-message{margin:calc(-1 * var(--spacing-small)) 0 var(--spacing-xxbig) 0}}@container cart-summary-list (width >= 1024px){.cart-cart-summary-list__content,.cart-cart-summary-list__heading{grid-column:1 / span 8}.cart-cart-summary-list__heading--full-width,.cart-cart-summary-list__content--empty{grid-column:1 / span 12}.cart-cart-summary-list__content{padding:0}}.cart-order-summary{display:grid;position:relative;grid-auto-flow:row;padding:var(--spacing-medium)}.cart-order-summary__primary{background-color:var(--color-neutral-200)}.cart-order-summary__secondary{background-color:var(--color-neutral-50)}.cart-order-summary__content{display:grid;gap:var(--spacing-xsmall);margin-top:var(--spacing-small)}.cart-order-summary__heading{display:grid;font:var(--type-headline-2-strong-font);letter-spacing:var(--type-headline-2-strong-letter-spacing);color:var(--color-neutral-800);gap:var(--spacing-small)}.cart-order-summary__discount .cart-order-summary__label,.cart-order-summary__discount .cart-order-summary__price{color:var(--color-warning-800)}.cart-order-summary__coupon__code{display:flex;align-items:center;font:var(--type-details-overline-font);letter-spacing:var(--type-details-overline-letter-spacing);color:var(--color-neutral-700);gap:var(--spacing-xsmall);grid-column:span 2}.cart-order-summary__taxes .dropin-divider:last-child{margin-bottom:0}.cart-order-summary__total{margin-top:var(--spacing-medium)}.cart-order-summary__divider-primary,.cart-order-summary__divider-secondary{width:100%;margin:0}.cart-order-summary__divider-secondary{margin:0}.cart-order-summary__taxEntry.cart-order-summary__entry{margin-top:0}.cart-order-summary__entry,.cart-order-summary__taxEntry{display:grid;grid-template-columns:1fr 1fr;gap:var(--spacing-xxsmall);align-items:center;color:var(--color-neutral-800)}.cart-order-summary__caption{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);grid-column:span 2;color:var(--color-neutral-700)}.cart-order-summary__primaryAction{margin-top:var(--spacing-small);grid-template-columns:1fr}.cart-order-summary__shipping--edit{display:grid;grid-column:1 / span 2;gap:var(--spacing-small);padding-top:var(--spacing-small);padding-left:var(--spacing-small)}a.cart-order-summary__shippingLink{text-decoration:underline}.cart-order-summary__shipping--hide{display:none!important}.cart-order-summary__shipping--edit button{width:var(--spacing-huge);justify-self:end}.cart-order-summary__shipping--zip,.cart-order-summary__shipping--state{background-color:var(--color-neutral-50)}.cart-order-summary__taxes .dropin-accordion-section__content-container{gap:var(--spacing-small);margin:var(--spacing-small) 0}.cart-order-summary--loading{opacity:.4;pointer-events:none}.cart-order-summary__spinner{margin:0 auto;position:absolute;z-index:999;left:0;right:0;top:calc(50% - (var(--size) / 2));bottom:0}.coupon-code-form__action{display:flex}.coupon-code-form__action .dropin-input-container{flex-grow:1;margin-right:var(--spacing-small)}.cart-coupons__accordion-section .dropin-accordion-section__content-container{gap:var(--spacing-small)}.coupon-code-form__codes{background-color:var(--color-neutral-50)}.coupon-code-form__error{font:var(--type-details-caption-2-font);letter-spacing:var(--type-details-caption-2-letter-spacing);color:var(--color-alert-500);margin-top:calc(var(--spacing-xsmall) * -1)}.coupon-code-form__applied{display:flex;flex-wrap:wrap;gap:var(--spacing-small)}div.coupon-code-form__applied button{background:var(--color-neutral-400);color:var(--color-neutral-800);display:flex;flex-direction:row-reverse}.cart-order-summary__label,.cart-order-summary__price{font:var(--type-body-1-default-font);letter-spacing:var(--type-body-1-default-letter-spacing)}.cart-order-summary__price{text-align:right;text-transform:uppercase}.cart-order-summary__label--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing);color:var(--color-neutral-700)}.cart-order-summary__price--muted{font:var(--type-body-2-default-font);letter-spacing:var(--type-body-2-default-letter-spacing)}.cart-order-summary__label--bold,.cart-order-summary__price--bold{font:var(--type-body-1-emphasized-font);letter-spacing:var(--type-body-1-emphasized-letter-spacing)}",{styleId:"Cart"});
|
|
4
|
-
import{jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{deepmerge as c,Render as d}from"@dropins/tools/lib.js";import{useState as u,useEffect as p}from"@dropins/tools/preact-hooks.js";import{UIProvider as m}from"@dropins/tools/components.js";import{events as g}from"@dropins/tools/event-bus.js";import"./chunks/resetCart.js";import{c as h}from"./chunks/refreshCart.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/persisted-data.js";import"./fragments.js";const f={Cart:{heading:"Shopping Cart ({count})",editCart:"Edit",viewAll:"View all in cart",viewMore:"View more"},MiniCart:{heading:"Shopping Cart ({count})",subtotal:"Subtotal",subtotalExcludingTaxes:"Subtotal excluding taxes",cartLink:"View Cart",checkoutLink:"Checkout"},EmptyCart:{heading:"Your cart is empty",cta:"Start shopping"},PriceSummary:{taxToBeDetermined:"TBD",checkout:"Checkout",orderSummary:"Order Summary",subTotal:{label:"Subtotal",withTaxes:"Including taxes",withoutTaxes:"excluding taxes"},shipping:{label:"Shipping",editZipAction:"Apply",estimated:"Estimated Shipping",estimatedDestination:"Estimated Shipping to
|
|
4
|
+
import{jsx as n}from"@dropins/tools/preact-jsx-runtime.js";import{deepmerge as c,Render as d}from"@dropins/tools/lib.js";import{useState as u,useEffect as p}from"@dropins/tools/preact-hooks.js";import{UIProvider as m}from"@dropins/tools/components.js";import{events as g}from"@dropins/tools/event-bus.js";import"./chunks/resetCart.js";import{c as h}from"./chunks/refreshCart.js";import"@dropins/tools/fetch-graphql.js";import"./chunks/persisted-data.js";import"./fragments.js";const f={Cart:{heading:"Shopping Cart ({count})",editCart:"Edit",viewAll:"View all in cart",viewMore:"View more"},MiniCart:{heading:"Shopping Cart ({count})",subtotal:"Subtotal",subtotalExcludingTaxes:"Subtotal excluding taxes",cartLink:"View Cart",checkoutLink:"Checkout"},EmptyCart:{heading:"Your cart is empty",cta:"Start shopping"},PriceSummary:{taxToBeDetermined:"TBD",checkout:"Checkout",orderSummary:"Order Summary",subTotal:{label:"Subtotal",withTaxes:"Including taxes",withoutTaxes:"excluding taxes"},shipping:{label:"Shipping",editZipAction:"Apply",estimated:"Estimated Shipping",estimatedDestination:"Estimated Shipping to",destinationLinkAriaLabel:"Change destination",zipPlaceholder:"Zip Code",withTaxes:"Including taxes",withoutTaxes:"excluding taxes",alternateField:{zip:"Estimate using country/zip",state:"Estimate using country/state"}},taxes:{total:"Tax Total",totalOnly:"Tax",breakdown:"Taxes",showBreakdown:"Show Tax Breakdown",hideBreakdown:"Hide Tax Breakdown",estimated:"Estimated Tax"},total:{estimated:"Estimated Total",free:"Free",label:"Total",withoutTax:"Total excluding taxes",saved:"Total saved"},estimatedShippingForm:{country:{placeholder:"Country"},state:{placeholder:"State"},zip:{placeholder:"Zip Code"},apply:{label:"Apply"}},freeShipping:"Free",coupon:{applyAction:"Apply",placeholder:"Enter code",title:"Discount code"}},CartItem:{discountedPrice:"Discounted Price",download:"file",message:"Note",recipient:"To",regularPrice:"Regular Price",sender:"From",file:"{count} file",files:"{count} files",lowInventory:"Only {count} left!",insufficientQuantity:"Only {inventory} of {count} in stock",insufficientQuantityGeneral:"Not enough items for sale",notAvailableMessage:"Requested qty. not available",discountPercentage:"{discount}% off",savingsAmount:"Savings"},EstimateShipping:{label:"Shipping",editZipAction:"Apply",estimated:"Estimated Shipping",estimatedDestination:"Estimated Shipping to",destinationLinkAriaLabel:"Change destination",zipPlaceholder:"Zip Code",withTaxes:"Including taxes",withoutTaxes:"excluding taxes",alternateField:{zip:"Estimate using country/zip",state:"Estimate using country/state"}},OutOfStockMessage:{heading:"Your cart contains items with limited stock",message:"Please adjust quantities to continue",alert:"Out of stock",action:"Remove all out of stock items from cart"}},x={Cart:f},y={default:x},S=({children:o})=>{var i;const[t,s]=u(),r=(i=h.getConfig())==null?void 0:i.langDefinitions;p(()=>{const e=g.on("locale",a=>{a!==t&&s(a)},{eager:!0});return()=>{e==null||e.off()}},[t]);const l=c(y,r??{});return n(m,{lang:t,langDefinitions:l,children:o})},L=new d(n(S,{}));export{L as render};
|