@dropins/storefront-checkout 1.4.0-beta1 → 1.4.0-beta2
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/__generated__/types.d.ts +12644 -0
- package/api/estimateShippingMethods/graphql/index.d.ts +15 -15
- package/api/estimateShippingMethods/index.d.ts +15 -15
- package/api/fetch-graphql/fetch-graphql.d.ts +19 -19
- package/api/fetch-graphql/index.d.ts +15 -15
- package/api/getCart/fixtures.d.ts +2 -2
- package/api/getCart/getCart.d.ts +1 -1
- package/api/getCart/graphql/index.d.ts +15 -15
- package/api/getCart/index.d.ts +15 -15
- package/api/getCheckoutAgreements/graphql/getCheckoutAgreements.graphql.d.ts +1 -1
- package/api/getCustomer/graphql/index.d.ts +15 -15
- package/api/getCustomer/index.d.ts +15 -15
- package/api/getStoreConfig/index.d.ts +15 -15
- package/api/index.d.ts +1 -0
- package/api/initialize/index.d.ts +15 -15
- package/api/initialize/initialize.d.ts +3 -3
- package/api/initializeCheckout/index.d.ts +15 -15
- package/api/initializeCheckout/initializeCheckout.d.ts +1 -1
- package/api/isEmailAvailable/graphql/isEmailAvailable.graphql.d.ts +15 -15
- package/api/isEmailAvailable/index.d.ts +15 -15
- package/api/setBillingAddress/index.d.ts +15 -15
- package/api/setBillingAddress/setBillingAddress.d.ts +1 -1
- package/api/setGuestEmailOnCart/index.d.ts +15 -15
- package/api/setGuestEmailOnCart/setGuestEmailOnCart.d.ts +1 -1
- package/api/setPaymentMethod/index.d.ts +15 -15
- package/api/setPaymentMethod/setPaymentMethod.d.ts +1 -1
- package/api/setShippingAddress/index.d.ts +15 -15
- package/api/setShippingAddress/setShippingAddress.d.ts +1 -1
- package/api/setShippingMethods/index.d.ts +15 -15
- package/api/setShippingMethods/setShippingMethods.d.ts +1 -1
- package/{lib/debounce.d.ts → api/subscribeEmailToNewsletter/graphql/subscribeEmailToNewsletter.graphql.d.ts} +3 -15
- package/{hooks → api/subscribeEmailToNewsletter}/index.d.ts +1 -2
- package/api/subscribeEmailToNewsletter/subscribeEmailToNewsletter.d.ts +4 -0
- package/api/synchronizeCheckout/synchronizeCheckout.d.ts +1 -1
- package/api.js +12 -6
- package/chunks/ConditionalWrapper.js +3 -0
- package/chunks/IsBillToShippingSignal.js +14 -0
- package/chunks/SelectedPaymentMethodSignal.js +3 -0
- package/chunks/SelectedShippingMethodSignal.js +3 -0
- package/chunks/ServerErrorSignal.js +3 -0
- package/chunks/TermsAndConditions.js +2 -2
- package/chunks/setBillingAddress.js +2 -2
- package/chunks/setGuestEmailOnCart.js +6 -6
- package/chunks/setPaymentMethod.js +2 -2
- package/chunks/setShippingMethods.js +3 -3
- package/chunks/subscription-email-statuses.js +3 -0
- package/chunks/synchronizeCheckout.js +5 -5
- package/components/BillToShippingAddress/BillToShippingAddress.d.ts +2 -1
- package/components/BillToShippingAddress/index.d.ts +15 -15
- package/components/ConditionalWrapper/ConditionalWrapper.d.ts +8 -0
- package/{hocs → components/ConditionalWrapper}/index.d.ts +2 -2
- package/components/EstimateShipping/EstimateShipping.d.ts +2 -2
- package/components/EstimateShipping/index.d.ts +15 -15
- package/components/LoginForm/LoginForm.d.ts +2 -2
- package/components/Newsletter/Newsletter.d.ts +2 -1
- package/components/OutOfStock/index.d.ts +15 -15
- package/components/PaymentMethods/PaymentMethods.d.ts +5 -6
- package/components/PlaceOrder/PlaceOrder.d.ts +1 -1
- package/components/PlaceOrder/index.d.ts +15 -15
- package/components/ServerError/index.d.ts +15 -15
- package/components/ShippingMethods/ShippingMethods.d.ts +5 -3
- package/components/TermsAndConditions/TermsAndConditions.d.ts +2 -2
- package/components/index.d.ts +1 -0
- package/containers/BillToShippingAddress/BillToShippingAddress.d.ts +3 -20
- package/containers/BillToShippingAddress.js +1 -1
- package/containers/EstimateShipping/index.d.ts +15 -15
- package/containers/EstimateShipping.js +1 -1
- package/containers/LoginForm/LoginForm.d.ts +2 -5
- package/containers/LoginForm.js +1 -1
- package/containers/MergedCartBanner/MergedCartBanner.d.ts +3 -5
- package/containers/MergedCartBanner.js +1 -1
- package/containers/Newsletter/Newsletter.d.ts +1 -1
- package/containers/Newsletter.js +1 -1
- package/containers/OutOfStock/OutOfStock.d.ts +1 -1
- package/containers/OutOfStock/index.d.ts +15 -15
- package/containers/OutOfStock.js +1 -1
- package/containers/PaymentMethods/PaymentMethods.d.ts +3 -6
- package/containers/PaymentMethods.js +1 -1
- package/containers/PlaceOrder/PlaceOrder.d.ts +4 -6
- package/containers/PlaceOrder/index.d.ts +15 -15
- package/containers/PlaceOrder.js +1 -1
- package/containers/ServerError/ServerError.d.ts +1 -1
- package/containers/ServerError.js +1 -1
- package/containers/ShippingMethods/ShippingMethods.d.ts +4 -6
- package/containers/ShippingMethods/utils/emitShippingEstimateEvent.d.ts +1 -1
- package/containers/ShippingMethods.js +1 -1
- package/containers/TermsAndConditions/TermsAndConditions.d.ts +1 -1
- package/containers/TermsAndConditions.js +1 -1
- package/data/models/country.d.ts +15 -15
- package/data/models/custom-attribute.d.ts +15 -15
- package/data/models/email-availability.d.ts +15 -15
- package/data/models/index.d.ts +1 -0
- package/data/models/payment-method.d.ts +15 -15
- package/data/models/price.d.ts +15 -15
- package/data/models/store-config.d.ts +1 -3
- package/data/models/subscription-email-statuses.d.ts +24 -0
- package/lib/dispatchApiCall.d.ts +6 -22
- package/lib/enqueueRequest.d.ts +11 -24
- package/lib/index.d.ts +0 -2
- package/lib/network-error.d.ts +15 -15
- package/lib/preact.d.ts +1 -1
- package/msw/browser.d.ts +15 -15
- package/msw/fixtures/fragments/cart.d.ts +15 -15
- package/msw/fixtures/index.d.ts +15 -15
- package/msw/fixtures/mutations/index.d.ts +15 -15
- package/msw/fixtures/queries/index.d.ts +15 -15
- package/msw/server.d.ts +15 -15
- package/package.json +1 -1
- package/render/index.d.ts +15 -15
- package/render/render.d.ts +1 -1
- package/render.js +4 -4
- package/signals/ShippingEstimateSignal.d.ts +6 -5
- package/signals/index.d.ts +0 -1
- package/tests/constants.d.ts +15 -15
- package/tests/integration/utils/index.d.ts +15 -15
- package/tests/integration/utils/user-actions.d.ts +15 -15
- package/tests/mocks/svg.d.ts +15 -15
- package/tests/utils/expectError.d.ts +15 -15
- package/tests/utils/index.d.ts +15 -15
- package/tests/utils/mockEvents.d.ts +15 -15
- package/types/TitleProps.d.ts +1 -1
- package/chunks/ShippingEstimateSignal.js +0 -14
- package/chunks/errors.js +0 -3
- package/chunks/store-config.js +0 -3
- package/chunks/withConditionalRendering.js +0 -3
- package/chunks/withSkeleton.js +0 -3
- package/hocs/withConditionalRendering.d.ts +0 -13
- package/hocs/withSkeleton.d.ts +0 -8
- package/hooks/useBreakpoint/index.d.ts +0 -18
- package/hooks/useBreakpoint/useBreakpoint.d.ts +0 -18
- package/hooks/useStableList/index.d.ts +0 -2
- package/hooks/useStableList/useStableList.d.ts +0 -2
- package/lib/fetch-error.d.ts +0 -23
- package/signals/CartSignal.d.ts +0 -7
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
17
|
export * from './setPaymentMethod';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SetPaymentMethodOnCartInput } from '../../__generated__/types';
|
|
2
2
|
|
|
3
|
-
export declare const setPaymentMethod: (paymentMethod: SetPaymentMethodOnCartInput['payment_method']) => Promise<import('../../data/models/cart').Cart |
|
|
3
|
+
export declare const setPaymentMethod: (paymentMethod: SetPaymentMethodOnCartInput['payment_method']) => Promise<import('../../data/models/cart').Cart | undefined>;
|
|
4
4
|
//# sourceMappingURL=setPaymentMethod.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
17
|
export * from './setShippingAddress';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ShippingAddressInput as ShippingAddressInputModel } from '../../data/models';
|
|
2
2
|
|
|
3
|
-
export declare const setShippingAddress: ({ address, customerAddressId, pickupLocationCode, }: ShippingAddressInputModel) => Promise<import('../../data/models').Cart |
|
|
3
|
+
export declare const setShippingAddress: ({ address, customerAddressId, pickupLocationCode, }: ShippingAddressInputModel) => Promise<import('../../data/models').Cart | undefined>;
|
|
4
4
|
//# sourceMappingURL=setShippingAddress.d.ts.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/********************************************************************
|
|
2
|
-
* ADOBE CONFIDENTIAL
|
|
3
|
-
* __________________
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2024 Adobe
|
|
6
|
-
* All Rights Reserved.
|
|
7
|
-
*
|
|
8
|
-
* NOTICE: All information contained herein is, and remains
|
|
9
|
-
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
-
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
-
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
-
* property laws, including trade secret and copyright laws.
|
|
13
|
-
* Dissemination of this information or reproduction of this material
|
|
14
|
-
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
-
* from Adobe.
|
|
16
|
-
*******************************************************************/
|
|
2
|
+
* ADOBE CONFIDENTIAL
|
|
3
|
+
* __________________
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
|
+
* All Rights Reserved.
|
|
7
|
+
*
|
|
8
|
+
* NOTICE: All information contained herein is, and remains
|
|
9
|
+
* the property of Adobe and its suppliers, if any. The intellectual
|
|
10
|
+
* and technical concepts contained herein are proprietary to Adobe
|
|
11
|
+
* and its suppliers and are protected by all applicable intellectual
|
|
12
|
+
* property laws, including trade secret and copyright laws.
|
|
13
|
+
* Dissemination of this information or reproduction of this material
|
|
14
|
+
* is strictly forbidden unless prior written permission is obtained
|
|
15
|
+
* from Adobe.
|
|
16
|
+
*******************************************************************/
|
|
17
17
|
export * from './setShippingMethods';
|
|
18
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
-
export declare const setShippingMethodsOnCart: (shippingMethods: import('../../__generated__/types').InputMaybe<import('../../__generated__/types').ShippingMethodInput>[]) => Promise<import('../../data/models/cart').Cart |
|
|
17
|
+
export declare const setShippingMethodsOnCart: (shippingMethods: import('../../__generated__/types').InputMaybe<import('../../__generated__/types').ShippingMethodInput>[]) => Promise<import('../../data/models/cart').Cart | undefined>;
|
|
18
18
|
//# sourceMappingURL=setShippingMethods.d.ts.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* ADOBE CONFIDENTIAL
|
|
3
3
|
* __________________
|
|
4
4
|
*
|
|
5
|
-
* Copyright
|
|
5
|
+
* Copyright 2024 Adobe
|
|
6
6
|
* All Rights Reserved.
|
|
7
7
|
*
|
|
8
8
|
* NOTICE: All information contained herein is, and remains
|
|
@@ -14,17 +14,5 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* a specified wait time has elapsed since the last time it was invoked.
|
|
20
|
-
*
|
|
21
|
-
* @param fn The function to debounce
|
|
22
|
-
* @param delay The delay in milliseconds
|
|
23
|
-
* @returns A debounced function with cancel and flush methods
|
|
24
|
-
*/
|
|
25
|
-
export declare function debounce<T extends (...args: any[]) => any>(fn: T, delay: number): {
|
|
26
|
-
(...args: Parameters<T>): void;
|
|
27
|
-
cancel: () => void;
|
|
28
|
-
flush: () => void;
|
|
29
|
-
};
|
|
30
|
-
//# sourceMappingURL=debounce.d.ts.map
|
|
17
|
+
export declare const subscribeEmailToNewsletterMutation = "\n mutation subscribeEmailToNewsletter($email: String!) {\n subscribeEmailToNewsletter(email: $email) {\n status\n }\n }\n";
|
|
18
|
+
//# sourceMappingURL=subscribeEmailToNewsletter.graphql.d.ts.map
|
|
@@ -14,6 +14,5 @@
|
|
|
14
14
|
* is strictly forbidden unless prior written permission is obtained
|
|
15
15
|
* from Adobe.
|
|
16
16
|
*******************************************************************/
|
|
17
|
-
export * from './
|
|
18
|
-
export * from './useStableList';
|
|
17
|
+
export * from './subscribeEmailToNewsletter';
|
|
19
18
|
//# sourceMappingURL=index.d.ts.map
|
package/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{
|
|
3
|
+
import{t as E,a as f,b as C}from"./chunks/synchronizeCheckout.js";import{d as X,c as Z,g as tt,i as et,e as st,r as it,s as rt}from"./chunks/synchronizeCheckout.js";import{s as p,S as T}from"./chunks/subscription-email-statuses.js";import{g as nt}from"./chunks/subscription-email-statuses.js";import"@dropins/tools/lib.js";import{a as I}from"./chunks/setShippingMethods.js";import{s as dt}from"./chunks/setShippingMethods.js";import{M as _,b as M,d,Q as A,s as y,i as N,c as b,e as O}from"./chunks/IsBillToShippingSignal.js";import{D as pt,F as gt,I as mt,o as ht,n as ut,S as lt,U as _t,k as At,l as St,m as Et,r as ft,f as Ct,g as Tt,j as It}from"./chunks/IsBillToShippingSignal.js";import"@dropins/tools/event-bus.js";import{A as w}from"./chunks/checkout.js";import{g as yt,i as Nt,s as bt}from"./chunks/setGuestEmailOnCart.js";import{s as wt}from"./chunks/setBillingAddress.js";import{s as Gt}from"./chunks/setPaymentMethod.js";import{CHECKOUT_DATA_FRAGMENT as S}from"./fragments.js";import"@dropins/tools/signals.js";import"@dropins/tools/fetch-graphql.js";const x=`
|
|
4
4
|
mutation estimateShippingMethods(
|
|
5
5
|
$cartId: String!
|
|
6
6
|
$address: EstimateAddressInput!
|
|
@@ -26,19 +26,19 @@ import{d as l,t as I,a as T,b as M}from"./chunks/synchronizeCheckout.js";import{
|
|
|
26
26
|
error_message
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
`,
|
|
29
|
+
`,G=t=>t?t.filter(e=>!!e).map(e=>({id:e.agreement_id,name:e.name,mode:w[e.mode],text:e.checkbox_text,content:{value:e.content,html:e.is_html,height:e.content_height??null}})):[],L=async t=>{var m,h,u,l;const e=p.cartId,r=((m=t==null?void 0:t.criteria)==null?void 0:m.country_code)??((h=p.config)==null?void 0:h.defaultCountry);if(!e)throw new _;if(!r)throw new M;const{region_id:s,region_name:o,zip:a}=(t==null?void 0:t.criteria)??{},i=s||o?{region_id:typeof s=="string"?parseInt(s,10):s,region_code:o}:void 0,n={country_code:r,...a&&{postcode:a},...i&&{region:{...i.region_id&&{region_id:i.region_id},...i.region_code&&{region_code:i.region_code}}}},c={country_id:r,region:(u=n.region)==null?void 0:u.region_code,region_id:(l=n.region)==null?void 0:l.region_id,postcode:a},g=await d({options:{variables:{cartId:e,address:n}},path:"estimateShippingMethods",query:x,queueName:A.ShippingEstimate,transformer:E,type:"mutation"});return y.value={address:I(c),options:g},g},$=`
|
|
30
30
|
query GET_CHECKOUT_AGREEMENTS {
|
|
31
31
|
checkoutAgreements {
|
|
32
32
|
agreement_id
|
|
33
33
|
checkbox_text
|
|
34
34
|
content
|
|
35
35
|
content_height
|
|
36
|
-
is_html
|
|
36
|
+
is_html
|
|
37
37
|
mode
|
|
38
38
|
name
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
`,
|
|
41
|
+
`,V=async()=>await d({defaultValueOnFail:[],options:{method:"GET",cache:"no-cache"},path:"checkoutAgreements",query:$,transformer:G,type:"query"}),U=`
|
|
42
42
|
mutation SET_SHIPPING_ADDRESS_ON_CART_MUTATION(
|
|
43
43
|
$cartId: String!
|
|
44
44
|
$shippingAddressInput: ShippingAddressInput!
|
|
@@ -53,7 +53,7 @@ import{d as l,t as I,a as T,b as M}from"./chunks/synchronizeCheckout.js";import{
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
${S}
|
|
56
|
-
`,
|
|
56
|
+
`,v=`
|
|
57
57
|
mutation SET_SHIPPING_ADDRESS_ON_CART_AND_USE_AS_BILLING_MUTATION(
|
|
58
58
|
$cartId: String!
|
|
59
59
|
$shippingAddressInput: ShippingAddressInput!
|
|
@@ -76,4 +76,10 @@ import{d as l,t as I,a as T,b as M}from"./chunks/synchronizeCheckout.js";import{
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
${S}
|
|
79
|
-
`,
|
|
79
|
+
`,j=async({address:t,customerAddressId:e,pickupLocationCode:r})=>{const s=p.cartId;if(!s)throw new _;const o=()=>{if(e)return{customer_address_id:e};if(r)return{pickup_location_code:r};if(!t)throw new b;return{address:f(t)}},a=N.peek(),i=a?v:U,n=a?"setBillingAddressOnCart.cart":"setShippingAddressesOnCart.cart",c={cartId:s,shippingAddressInput:o()};return await d({type:"mutation",query:i,options:{variables:c},path:n,queueName:A.CartUpdate,transformer:C})},F=`
|
|
80
|
+
mutation subscribeEmailToNewsletter($email: String!) {
|
|
81
|
+
subscribeEmailToNewsletter(email: $email) {
|
|
82
|
+
status
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`,Y=async t=>{if(!t)throw new O;return await d({defaultValueOnFail:T.Error,options:{variables:{email:t}},path:"subscribeEmailToNewsletter.status",query:F,type:"mutation"})};export{pt as DEFAULT_COUNTRY,gt as FetchError,mt as InvalidArgument,ht as MissingBillingAddress,_ as MissingCart,M as MissingCountry,O as MissingEmail,ut as MissingPaymentMethod,b as MissingShippinghAddress,lt as STORE_CONFIG_DEFAULTS,_t as UnexpectedError,X as authenticateCustomer,Z as config,L as estimateShippingMethods,At as fetchGraphQl,tt as getCart,V as getCheckoutAgreements,St as getConfig,yt as getCustomer,Et as getStoreConfig,nt as getStoreConfigCache,et as initialize,st as initializeCheckout,Nt as isEmailAvailable,ft as removeFetchGraphQlHeader,it as resetCheckout,wt as setBillingAddress,Ct as setEndpoint,Tt as setFetchGraphQlHeader,It as setFetchGraphQlHeaders,bt as setGuestEmailOnCart,Gt as setPaymentMethod,j as setShippingAddress,dt as setShippingMethodsOnCart,Y as subscribeEmailToNewsletter,rt as synchronizeCheckout};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{jsxs as a,jsx as o}from"@dropins/tools/preact-jsx-runtime.js";function l(r,t){return function(e){const{isInitialized:i=!0,isVisible:n=!0,...s}=e;return a("div",{className:"conditional-wrapper",children:[n&&!i&&o(t,{}),n&&i&&o(r,{...s})]})}}export{l as W};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
import{T as u}from"./subscription-email-statuses.js";import"@dropins/tools/lib.js";import{events as C}from"@dropins/tools/event-bus.js";import{signal as m,computed as w}from"@dropins/tools/signals.js";import{FetchGraphQL as q}from"@dropins/tools/fetch-graphql.js";var U=(e=>(e.CartUpdate="cartUpdate",e.Default="default",e.ShippingEstimate="shippingEstimate",e))(U||{});const p=new Map,g=new Map,i=m(new Set),y=new Map;y.set("cartUpdate",e=>{C.emit("checkout/updated",e)});async function v(e){g.set(e,!0);const t=p.get(e);let s;for(;t.length>0;){const o=t.shift();try{const a=await o.requestFn();o.resolve(a),s=a}catch(a){o.reject(a)}}g.set(e,!1);const r=new Set(i.value);r.delete(e),i.value=r;const n=y.get(e);n&&s&&n(s)}function A(e,t="default"){p.has(t)||p.set(t,[]);const s=p.get(t),r=new Promise((o,a)=>{s.push({requestFn:e,resolve:o,reject:a})}),n=new Set(i.value);return n.add(t),i.value=n,g.get(t)||v(t),r}const B=w(()=>i.value.has("cartUpdate")),H=w(()=>i.value.has("shippingEstimate")),D=["sender_email","recipient_email"];function T(e){return e.filter(t=>!t.path||!D.some(s=>{var r;return((r=t.path)==null?void 0:r.at(-1))===s}))}const x=e=>{throw e instanceof DOMException&&e.name==="AbortError"||C.emit("error",{source:"checkout",type:"network",error:e}),e};function b(e,t){return t.split(".").reduce((s,r)=>s&&s[r]!==void 0?s[r]:void 0,e)}async function G(e){const{defaultValueOnFail:t,options:s,path:r,query:n,queueName:o,transformer:a,type:d}=e;try{const l=async()=>{const{data:S,errors:E}=await k(n,{method:d==="query"?"GET":"POST",cache:d==="query"?"no-cache":void 0,...s}).catch(x);if(E){const _=T(E);if(_.length>0)throw new L(_)}let h=b(S,r);if(h===void 0)throw new Error(`No data found at path: ${r}`);return a?a(h):h};return d==="mutation"?await A(l,o):await l()}catch(l){if(t!==void 0)return t;throw l}}const F=`
|
|
4
|
+
query getStoreConfig {
|
|
5
|
+
storeConfig {
|
|
6
|
+
default_country
|
|
7
|
+
is_checkout_agreements_enabled
|
|
8
|
+
is_guest_checkout_enabled
|
|
9
|
+
is_one_page_checkout_enabled
|
|
10
|
+
newsletter_enabled
|
|
11
|
+
shopping_cart_display_shipping
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
`,I="US",f={defaultCountry:I,agreementsEnabled:!0,newsletterEnabled:!0,shoppingCartDisplaySetting:{shipping:u.EXCLUDING_TAX}},V=async()=>await G({defaultValueOnFail:f,options:{method:"GET",cache:"no-cache"},path:"storeConfig",query:F,transformer:N,type:"query"});function M(e){switch(e){case 1:return u.EXCLUDING_TAX;case 2:return u.INCLUDING_TAX;case 3:return u.INCLUDING_EXCLUDING_TAX;default:return u.EXCLUDING_TAX}}function N(e){if(!e)return f;const{default_country:t,is_checkout_agreements_enabled:s,newsletter_enabled:r,shopping_cart_display_shipping:n}=e;return{defaultCountry:t||f.defaultCountry,agreementsEnabled:s,newsletterEnabled:r,shoppingCartDisplaySetting:{shipping:M(n)}}}const Y=m(),{setEndpoint:$,setFetchGraphQlHeader:z,removeFetchGraphQlHeader:J,setFetchGraphQlHeaders:K,fetchGraphQl:k,getConfig:W}=new q().getMethods();class L extends Error{constructor(t){super(t.map(s=>s.message).join(" ")),this.name="FetchError"}}class c extends Error{constructor(t){super(t),this.name="InvalidArgument"}}class Z extends Error{constructor(t){super(t),this.name="UnexpectedError"}}class ee extends c{constructor(){super("Cart ID is required")}}class te extends c{constructor(){super("Email is required")}}class se extends c{constructor(){super("Payment method code is required")}}class re extends c{constructor(){super("Shipping address is required")}}class ne extends c{constructor(){super("Billing address is required")}}class ae extends c{constructor(){super("Country Code is required")}}const oe=m(!0);export{I as D,L as F,c as I,ee as M,U as Q,f as S,Z as U,H as a,ae as b,re as c,G as d,te as e,$ as f,z as g,B as h,oe as i,K as j,k,W as l,V as m,se as n,ne as o,J as r,Y as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */const{entries:dt,setPrototypeOf:at,isFrozen:Wt,getPrototypeOf:Bt,getOwnPropertyDescriptor:Yt}=Object;let{freeze:S,seal:O,create:Tt}=Object,{apply:Ce,construct:we}=typeof Reflect<"u"&&Reflect;S||(S=function(o){return o});O||(O=function(o){return o});Ce||(Ce=function(o,l,s){return o.apply(l,s)});we||(we=function(o,l){return new o(...l)});const se=R(Array.prototype.forEach),Xt=R(Array.prototype.lastIndexOf),rt=R(Array.prototype.pop),V=R(Array.prototype.push),jt=R(Array.prototype.splice),ce=R(String.prototype.toLowerCase),Ne=R(String.prototype.toString),st=R(String.prototype.match),$=R(String.prototype.replace),Vt=R(String.prototype.indexOf),$t=R(String.prototype.trim),L=R(Object.prototype.hasOwnProperty),A=R(RegExp.prototype.test),q=qt(TypeError);function R(r){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var l=arguments.length,s=new Array(l>1?l-1:0),T=1;T<l;T++)s[T-1]=arguments[T];return Ce(r,o,s)}}function qt(r){return function(){for(var o=arguments.length,l=new Array(o),s=0;s<o;s++)l[s]=arguments[s];return we(r,l)}}function a(r,o){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ce;at&&at(r,null);let s=o.length;for(;s--;){let T=o[s];if(typeof T=="string"){const b=l(T);b!==T&&(Wt(o)||(o[s]=b),T=b)}r[T]=!0}return r}function Kt(r){for(let o=0;o<r.length;o++)L(r,o)||(r[o]=null);return r}function w(r){const o=Tt(null);for(const[l,s]of dt(r))L(r,l)&&(Array.isArray(s)?o[l]=Kt(s):s&&typeof s=="object"&&s.constructor===Object?o[l]=w(s):o[l]=s);return o}function K(r,o){for(;r!==null;){const s=Yt(r,o);if(s){if(s.get)return R(s.get);if(typeof s.value=="function")return R(s.value)}r=Bt(r)}function l(){return null}return l}const lt=S(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),De=S(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),be=S(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Zt=S(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ie=S(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Jt=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ct=S(["#text"]),ft=S(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Me=S(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ut=S(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),le=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Qt=O(/\{\{[\w\W]*|[\w\W]*\}\}/gm),en=O(/<%[\w\W]*|[\w\W]*%>/gm),tn=O(/\$\{[\w\W]*/gm),nn=O(/^data-[\-\w.\u00B7-\uFFFF]+$/),on=O(/^aria-[\-\w]+$/),_t=O(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),an=O(/^(?:\w+script|data):/i),rn=O(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Et=O(/^html$/i),sn=O(/^[a-z][.\w]*(-[.\w]+)+$/i);var mt=Object.freeze({__proto__:null,ARIA_ATTR:on,ATTR_WHITESPACE:rn,CUSTOM_ELEMENT:sn,DATA_ATTR:nn,DOCTYPE_NAME:Et,ERB_EXPR:en,IS_ALLOWED_URI:_t,IS_SCRIPT_OR_DATA:an,MUSTACHE_EXPR:Qt,TMPLIT_EXPR:tn});const Z={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ln=function(){return typeof window>"u"?null:window},cn=function(o,l){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let s=null;const T="data-tt-policy-suffix";l&&l.hasAttribute(T)&&(s=l.getAttribute(T));const b="dompurify"+(s?"#"+s:"");try{return o.createPolicy(b,{createHTML(x){return x},createScriptURL(x){return x}})}catch{return console.warn("TrustedTypes policy "+b+" could not be created."),null}},pt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function gt(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ln();const o=i=>gt(i);if(o.version="3.2.5",o.removed=[],!r||!r.document||r.document.nodeType!==Z.document||!r.Element)return o.isSupported=!1,o;let{document:l}=r;const s=l,T=s.currentScript,{DocumentFragment:b,HTMLTemplateElement:x,Node:fe,Element:xe,NodeFilter:z,NamedNodeMap:ht=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:At,DOMParser:St,trustedTypes:J}=r,G=xe.prototype,Rt=K(G,"cloneNode"),yt=K(G,"remove"),Ot=K(G,"nextSibling"),Lt=K(G,"childNodes"),Q=K(G,"parentNode");if(typeof x=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let E,W="";const{implementation:ue,createNodeIterator:Nt,createDocumentFragment:Dt,getElementsByTagName:bt}=l,{importNode:It}=s;let g=pt();o.isSupported=typeof dt=="function"&&typeof Q=="function"&&ue&&ue.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:me,ERB_EXPR:pe,TMPLIT_EXPR:de,DATA_ATTR:Mt,ARIA_ATTR:Ct,IS_SCRIPT_OR_DATA:wt,ATTR_WHITESPACE:Pe,CUSTOM_ELEMENT:xt}=mt;let{IS_ALLOWED_URI:ve}=mt,u=null;const ke=a({},[...lt,...De,...be,...Ie,...ct]);let p=null;const Ue=a({},[...ft,...Me,...ut,...le]);let f=Object.seal(Tt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),B=null,Te=null,Fe=!0,_e=!0,He=!1,ze=!0,P=!1,Ee=!0,C=!1,ge=!1,he=!1,v=!1,ee=!1,te=!1,Ge=!0,We=!1;const Pt="user-content-";let Ae=!0,Y=!1,k={},U=null;const Be=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const Xe=a({},["audio","video","img","source","image","track"]);let Se=null;const je=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ne="http://www.w3.org/1998/Math/MathML",oe="http://www.w3.org/2000/svg",I="http://www.w3.org/1999/xhtml";let F=I,Re=!1,ye=null;const vt=a({},[ne,oe,I],Ne);let ie=a({},["mi","mo","mn","ms","mtext"]),ae=a({},["annotation-xml"]);const kt=a({},["title","style","font","a","script"]);let X=null;const Ut=["application/xhtml+xml","text/html"],Ft="text/html";let m=null,H=null;const Ht=l.createElement("form"),Ve=function(e){return e instanceof RegExp||e instanceof Function},Oe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(H&&H===e)){if((!e||typeof e!="object")&&(e={}),e=w(e),X=Ut.indexOf(e.PARSER_MEDIA_TYPE)===-1?Ft:e.PARSER_MEDIA_TYPE,m=X==="application/xhtml+xml"?Ne:ce,u=L(e,"ALLOWED_TAGS")?a({},e.ALLOWED_TAGS,m):ke,p=L(e,"ALLOWED_ATTR")?a({},e.ALLOWED_ATTR,m):Ue,ye=L(e,"ALLOWED_NAMESPACES")?a({},e.ALLOWED_NAMESPACES,Ne):vt,Se=L(e,"ADD_URI_SAFE_ATTR")?a(w(je),e.ADD_URI_SAFE_ATTR,m):je,Ye=L(e,"ADD_DATA_URI_TAGS")?a(w(Xe),e.ADD_DATA_URI_TAGS,m):Xe,U=L(e,"FORBID_CONTENTS")?a({},e.FORBID_CONTENTS,m):Be,B=L(e,"FORBID_TAGS")?a({},e.FORBID_TAGS,m):{},Te=L(e,"FORBID_ATTR")?a({},e.FORBID_ATTR,m):{},k=L(e,"USE_PROFILES")?e.USE_PROFILES:!1,Fe=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,He=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ze=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=e.SAFE_FOR_TEMPLATES||!1,Ee=e.SAFE_FOR_XML!==!1,C=e.WHOLE_DOCUMENT||!1,v=e.RETURN_DOM||!1,ee=e.RETURN_DOM_FRAGMENT||!1,te=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,Ge=e.SANITIZE_DOM!==!1,We=e.SANITIZE_NAMED_PROPS||!1,Ae=e.KEEP_CONTENT!==!1,Y=e.IN_PLACE||!1,ve=e.ALLOWED_URI_REGEXP||_t,F=e.NAMESPACE||I,ie=e.MATHML_TEXT_INTEGRATION_POINTS||ie,ae=e.HTML_INTEGRATION_POINTS||ae,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ve(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ve(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),P&&(_e=!1),ee&&(v=!0),k&&(u=a({},ct),p=[],k.html===!0&&(a(u,lt),a(p,ft)),k.svg===!0&&(a(u,De),a(p,Me),a(p,le)),k.svgFilters===!0&&(a(u,be),a(p,Me),a(p,le)),k.mathMl===!0&&(a(u,Ie),a(p,ut),a(p,le))),e.ADD_TAGS&&(u===ke&&(u=w(u)),a(u,e.ADD_TAGS,m)),e.ADD_ATTR&&(p===Ue&&(p=w(p)),a(p,e.ADD_ATTR,m)),e.ADD_URI_SAFE_ATTR&&a(Se,e.ADD_URI_SAFE_ATTR,m),e.FORBID_CONTENTS&&(U===Be&&(U=w(U)),a(U,e.FORBID_CONTENTS,m)),Ae&&(u["#text"]=!0),C&&a(u,["html","head","body"]),u.table&&(a(u,["tbody"]),delete B.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=e.TRUSTED_TYPES_POLICY,W=E.createHTML("")}else E===void 0&&(E=cn(J,T)),E!==null&&typeof W=="string"&&(W=E.createHTML(""));S&&S(e),H=e}},$e=a({},[...De,...be,...Zt]),qe=a({},[...Ie,...Jt]),zt=function(e){let t=Q(e);(!t||!t.tagName)&&(t={namespaceURI:F,tagName:"template"});const n=ce(e.tagName),c=ce(t.tagName);return ye[e.namespaceURI]?e.namespaceURI===oe?t.namespaceURI===I?n==="svg":t.namespaceURI===ne?n==="svg"&&(c==="annotation-xml"||ie[c]):!!$e[n]:e.namespaceURI===ne?t.namespaceURI===I?n==="math":t.namespaceURI===oe?n==="math"&&ae[c]:!!qe[n]:e.namespaceURI===I?t.namespaceURI===oe&&!ae[c]||t.namespaceURI===ne&&!ie[c]?!1:!qe[n]&&(kt[n]||!$e[n]):!!(X==="application/xhtml+xml"&&ye[e.namespaceURI]):!1},N=function(e){V(o.removed,{element:e});try{Q(e).removeChild(e)}catch{yt(e)}},re=function(e,t){try{V(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch{V(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(v||ee)try{N(t)}catch{}else try{t.setAttribute(e,"")}catch{}},Ke=function(e){let t=null,n=null;if(he)e="<remove></remove>"+e;else{const d=st(e,/^[\r\n\t ]+/);n=d&&d[0]}X==="application/xhtml+xml"&&F===I&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const c=E?E.createHTML(e):e;if(F===I)try{t=new St().parseFromString(c,X)}catch{}if(!t||!t.documentElement){t=ue.createDocument(F,"template",null);try{t.documentElement.innerHTML=Re?W:c}catch{}}const _=t.body||t.documentElement;return e&&n&&_.insertBefore(l.createTextNode(n),_.childNodes[0]||null),F===I?bt.call(t,C?"html":"body")[0]:C?t.documentElement:_},Ze=function(e){return Nt.call(e.ownerDocument||e,e,z.SHOW_ELEMENT|z.SHOW_COMMENT|z.SHOW_TEXT|z.SHOW_PROCESSING_INSTRUCTION|z.SHOW_CDATA_SECTION,null)},Le=function(e){return e instanceof At&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof ht)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Je=function(e){return typeof fe=="function"&&e instanceof fe};function M(i,e,t){se(i,n=>{n.call(o,e,t,H)})}const Qe=function(e){let t=null;if(M(g.beforeSanitizeElements,e,null),Le(e))return N(e),!0;const n=m(e.nodeName);if(M(g.uponSanitizeElement,e,{tagName:n,allowedTags:u}),e.hasChildNodes()&&!Je(e.firstElementChild)&&A(/<[/\w!]/g,e.innerHTML)&&A(/<[/\w!]/g,e.textContent)||e.nodeType===Z.progressingInstruction||Ee&&e.nodeType===Z.comment&&A(/<[/\w]/g,e.data))return N(e),!0;if(!u[n]||B[n]){if(!B[n]&&tt(n)&&(f.tagNameCheck instanceof RegExp&&A(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n)))return!1;if(Ae&&!U[n]){const c=Q(e)||e.parentNode,_=Lt(e)||e.childNodes;if(_&&c){const d=_.length;for(let y=d-1;y>=0;--y){const D=Rt(_[y],!0);D.__removalCount=(e.__removalCount||0)+1,c.insertBefore(D,Ot(e))}}}return N(e),!0}return e instanceof xe&&!zt(e)||(n==="noscript"||n==="noembed"||n==="noframes")&&A(/<\/no(script|embed|frames)/i,e.innerHTML)?(N(e),!0):(P&&e.nodeType===Z.text&&(t=e.textContent,se([me,pe,de],c=>{t=$(t,c," ")}),e.textContent!==t&&(V(o.removed,{element:e.cloneNode()}),e.textContent=t)),M(g.afterSanitizeElements,e,null),!1)},et=function(e,t,n){if(Ge&&(t==="id"||t==="name")&&(n in l||n in Ht))return!1;if(!(_e&&!Te[t]&&A(Mt,t))){if(!(Fe&&A(Ct,t))){if(!p[t]||Te[t]){if(!(tt(e)&&(f.tagNameCheck instanceof RegExp&&A(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&A(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&A(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n))))return!1}else if(!Se[t]){if(!A(ve,$(n,Pe,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Vt(n,"data:")===0&&Ye[e])){if(!(He&&!A(wt,$(n,Pe,"")))){if(n)return!1}}}}}}return!0},tt=function(e){return e!=="annotation-xml"&&st(e,xt)},nt=function(e){M(g.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Le(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:p,forceKeepAttr:void 0};let c=t.length;for(;c--;){const _=t[c],{name:d,namespaceURI:y,value:D}=_,j=m(d);let h=d==="value"?D:$t(D);if(n.attrName=j,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,M(g.uponSanitizeAttribute,e,n),h=n.attrValue,We&&(j==="id"||j==="name")&&(re(d,e),h=Pt+h),Ee&&A(/((--!?|])>)|<\/(style|title)/i,h)){re(d,e);continue}if(n.forceKeepAttr||(re(d,e),!n.keepAttr))continue;if(!ze&&A(/\/>/i,h)){re(d,e);continue}P&&se([me,pe,de],it=>{h=$(h,it," ")});const ot=m(e.nodeName);if(et(ot,j,h)){if(E&&typeof J=="object"&&typeof J.getAttributeType=="function"&&!y)switch(J.getAttributeType(ot,j)){case"TrustedHTML":{h=E.createHTML(h);break}case"TrustedScriptURL":{h=E.createScriptURL(h);break}}try{y?e.setAttributeNS(y,d,h):e.setAttribute(d,h),Le(e)?N(e):rt(o.removed)}catch{}}}M(g.afterSanitizeAttributes,e,null)},Gt=function i(e){let t=null;const n=Ze(e);for(M(g.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)M(g.uponSanitizeShadowNode,t,null),Qe(t),nt(t),t.content instanceof b&&i(t.content);M(g.afterSanitizeShadowDOM,e,null)};return o.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,n=null,c=null,_=null;if(Re=!i,Re&&(i="<!-->"),typeof i!="string"&&!Je(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw q("dirty is not a string, aborting")}else throw q("toString is not a function");if(!o.isSupported)return i;if(ge||Oe(e),o.removed=[],typeof i=="string"&&(Y=!1),Y){if(i.nodeName){const D=m(i.nodeName);if(!u[D]||B[D])throw q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof fe)t=Ke("<!---->"),n=t.ownerDocument.importNode(i,!0),n.nodeType===Z.element&&n.nodeName==="BODY"||n.nodeName==="HTML"?t=n:t.appendChild(n);else{if(!v&&!P&&!C&&i.indexOf("<")===-1)return E&&te?E.createHTML(i):i;if(t=Ke(i),!t)return v?null:te?W:""}t&&he&&N(t.firstChild);const d=Ze(Y?i:t);for(;c=d.nextNode();)Qe(c),nt(c),c.content instanceof b&&Gt(c.content);if(Y)return i;if(v){if(ee)for(_=Dt.call(t.ownerDocument);t.firstChild;)_.appendChild(t.firstChild);else _=t;return(p.shadowroot||p.shadowrootmode)&&(_=It.call(s,_,!0)),_}let y=C?t.outerHTML:t.innerHTML;return C&&u["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&A(Et,t.ownerDocument.doctype.name)&&(y="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
|
|
4
|
-
`+
|
|
3
|
+
/*! @license DOMPurify 3.2.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.5/LICENSE */const{entries:dt,setPrototypeOf:at,isFrozen:Wt,getPrototypeOf:Bt,getOwnPropertyDescriptor:Yt}=Object;let{freeze:S,seal:y,create:Tt}=Object,{apply:Ce,construct:we}=typeof Reflect<"u"&&Reflect;S||(S=function(o){return o});y||(y=function(o){return o});Ce||(Ce=function(o,l,s){return o.apply(l,s)});we||(we=function(o,l){return new o(...l)});const se=R(Array.prototype.forEach),Xt=R(Array.prototype.lastIndexOf),rt=R(Array.prototype.pop),V=R(Array.prototype.push),jt=R(Array.prototype.splice),ce=R(String.prototype.toLowerCase),Ne=R(String.prototype.toString),st=R(String.prototype.match),$=R(String.prototype.replace),Vt=R(String.prototype.indexOf),$t=R(String.prototype.trim),L=R(Object.prototype.hasOwnProperty),A=R(RegExp.prototype.test),q=qt(TypeError);function R(r){return function(o){o instanceof RegExp&&(o.lastIndex=0);for(var l=arguments.length,s=new Array(l>1?l-1:0),T=1;T<l;T++)s[T-1]=arguments[T];return Ce(r,o,s)}}function qt(r){return function(){for(var o=arguments.length,l=new Array(o),s=0;s<o;s++)l[s]=arguments[s];return we(r,l)}}function a(r,o){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ce;at&&at(r,null);let s=o.length;for(;s--;){let T=o[s];if(typeof T=="string"){const b=l(T);b!==T&&(Wt(o)||(o[s]=b),T=b)}r[T]=!0}return r}function Kt(r){for(let o=0;o<r.length;o++)L(r,o)||(r[o]=null);return r}function w(r){const o=Tt(null);for(const[l,s]of dt(r))L(r,l)&&(Array.isArray(s)?o[l]=Kt(s):s&&typeof s=="object"&&s.constructor===Object?o[l]=w(s):o[l]=s);return o}function K(r,o){for(;r!==null;){const s=Yt(r,o);if(s){if(s.get)return R(s.get);if(typeof s.value=="function")return R(s.value)}r=Bt(r)}function l(){return null}return l}const lt=S(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),De=S(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),be=S(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Zt=S(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ie=S(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Jt=S(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ct=S(["#text"]),ft=S(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Me=S(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ut=S(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),le=S(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Qt=y(/\{\{[\w\W]*|[\w\W]*\}\}/gm),en=y(/<%[\w\W]*|[\w\W]*%>/gm),tn=y(/\$\{[\w\W]*/gm),nn=y(/^data-[\-\w.\u00B7-\uFFFF]+$/),on=y(/^aria-[\-\w]+$/),_t=y(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),an=y(/^(?:\w+script|data):/i),rn=y(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Et=y(/^html$/i),sn=y(/^[a-z][.\w]*(-[.\w]+)+$/i);var mt=Object.freeze({__proto__:null,ARIA_ATTR:on,ATTR_WHITESPACE:rn,CUSTOM_ELEMENT:sn,DATA_ATTR:nn,DOCTYPE_NAME:Et,ERB_EXPR:en,IS_ALLOWED_URI:_t,IS_SCRIPT_OR_DATA:an,MUSTACHE_EXPR:Qt,TMPLIT_EXPR:tn});const Z={element:1,text:3,progressingInstruction:7,comment:8,document:9},ln=function(){return typeof window>"u"?null:window},cn=function(o,l){if(typeof o!="object"||typeof o.createPolicy!="function")return null;let s=null;const T="data-tt-policy-suffix";l&&l.hasAttribute(T)&&(s=l.getAttribute(T));const b="dompurify"+(s?"#"+s:"");try{return o.createPolicy(b,{createHTML(x){return x},createScriptURL(x){return x}})}catch{return console.warn("TrustedTypes policy "+b+" could not be created."),null}},pt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function gt(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ln();const o=i=>gt(i);if(o.version="3.2.5",o.removed=[],!r||!r.document||r.document.nodeType!==Z.document||!r.Element)return o.isSupported=!1,o;let{document:l}=r;const s=l,T=s.currentScript,{DocumentFragment:b,HTMLTemplateElement:x,Node:fe,Element:xe,NodeFilter:z,NamedNodeMap:ht=r.NamedNodeMap||r.MozNamedAttrMap,HTMLFormElement:At,DOMParser:St,trustedTypes:J}=r,G=xe.prototype,Rt=K(G,"cloneNode"),Ot=K(G,"remove"),yt=K(G,"nextSibling"),Lt=K(G,"childNodes"),Q=K(G,"parentNode");if(typeof x=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let E,W="";const{implementation:ue,createNodeIterator:Nt,createDocumentFragment:Dt,getElementsByTagName:bt}=l,{importNode:It}=s;let g=pt();o.isSupported=typeof dt=="function"&&typeof Q=="function"&&ue&&ue.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:me,ERB_EXPR:pe,TMPLIT_EXPR:de,DATA_ATTR:Mt,ARIA_ATTR:Ct,IS_SCRIPT_OR_DATA:wt,ATTR_WHITESPACE:Pe,CUSTOM_ELEMENT:xt}=mt;let{IS_ALLOWED_URI:ve}=mt,u=null;const ke=a({},[...lt,...De,...be,...Ie,...ct]);let p=null;const Ue=a({},[...ft,...Me,...ut,...le]);let f=Object.seal(Tt(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),B=null,Te=null,Fe=!0,_e=!0,He=!1,ze=!0,P=!1,Ee=!0,C=!1,ge=!1,he=!1,v=!1,ee=!1,te=!1,Ge=!0,We=!1;const Pt="user-content-";let Ae=!0,Y=!1,k={},U=null;const Be=a({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ye=null;const Xe=a({},["audio","video","img","source","image","track"]);let Se=null;const je=a({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ne="http://www.w3.org/1998/Math/MathML",oe="http://www.w3.org/2000/svg",I="http://www.w3.org/1999/xhtml";let F=I,Re=!1,Oe=null;const vt=a({},[ne,oe,I],Ne);let ie=a({},["mi","mo","mn","ms","mtext"]),ae=a({},["annotation-xml"]);const kt=a({},["title","style","font","a","script"]);let X=null;const Ut=["application/xhtml+xml","text/html"],Ft="text/html";let m=null,H=null;const Ht=l.createElement("form"),Ve=function(e){return e instanceof RegExp||e instanceof Function},ye=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(H&&H===e)){if((!e||typeof e!="object")&&(e={}),e=w(e),X=Ut.indexOf(e.PARSER_MEDIA_TYPE)===-1?Ft:e.PARSER_MEDIA_TYPE,m=X==="application/xhtml+xml"?Ne:ce,u=L(e,"ALLOWED_TAGS")?a({},e.ALLOWED_TAGS,m):ke,p=L(e,"ALLOWED_ATTR")?a({},e.ALLOWED_ATTR,m):Ue,Oe=L(e,"ALLOWED_NAMESPACES")?a({},e.ALLOWED_NAMESPACES,Ne):vt,Se=L(e,"ADD_URI_SAFE_ATTR")?a(w(je),e.ADD_URI_SAFE_ATTR,m):je,Ye=L(e,"ADD_DATA_URI_TAGS")?a(w(Xe),e.ADD_DATA_URI_TAGS,m):Xe,U=L(e,"FORBID_CONTENTS")?a({},e.FORBID_CONTENTS,m):Be,B=L(e,"FORBID_TAGS")?a({},e.FORBID_TAGS,m):{},Te=L(e,"FORBID_ATTR")?a({},e.FORBID_ATTR,m):{},k=L(e,"USE_PROFILES")?e.USE_PROFILES:!1,Fe=e.ALLOW_ARIA_ATTR!==!1,_e=e.ALLOW_DATA_ATTR!==!1,He=e.ALLOW_UNKNOWN_PROTOCOLS||!1,ze=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,P=e.SAFE_FOR_TEMPLATES||!1,Ee=e.SAFE_FOR_XML!==!1,C=e.WHOLE_DOCUMENT||!1,v=e.RETURN_DOM||!1,ee=e.RETURN_DOM_FRAGMENT||!1,te=e.RETURN_TRUSTED_TYPE||!1,he=e.FORCE_BODY||!1,Ge=e.SANITIZE_DOM!==!1,We=e.SANITIZE_NAMED_PROPS||!1,Ae=e.KEEP_CONTENT!==!1,Y=e.IN_PLACE||!1,ve=e.ALLOWED_URI_REGEXP||_t,F=e.NAMESPACE||I,ie=e.MATHML_TEXT_INTEGRATION_POINTS||ie,ae=e.HTML_INTEGRATION_POINTS||ae,f=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ve(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ve(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),P&&(_e=!1),ee&&(v=!0),k&&(u=a({},ct),p=[],k.html===!0&&(a(u,lt),a(p,ft)),k.svg===!0&&(a(u,De),a(p,Me),a(p,le)),k.svgFilters===!0&&(a(u,be),a(p,Me),a(p,le)),k.mathMl===!0&&(a(u,Ie),a(p,ut),a(p,le))),e.ADD_TAGS&&(u===ke&&(u=w(u)),a(u,e.ADD_TAGS,m)),e.ADD_ATTR&&(p===Ue&&(p=w(p)),a(p,e.ADD_ATTR,m)),e.ADD_URI_SAFE_ATTR&&a(Se,e.ADD_URI_SAFE_ATTR,m),e.FORBID_CONTENTS&&(U===Be&&(U=w(U)),a(U,e.FORBID_CONTENTS,m)),Ae&&(u["#text"]=!0),C&&a(u,["html","head","body"]),u.table&&(a(u,["tbody"]),delete B.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw q('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');E=e.TRUSTED_TYPES_POLICY,W=E.createHTML("")}else E===void 0&&(E=cn(J,T)),E!==null&&typeof W=="string"&&(W=E.createHTML(""));S&&S(e),H=e}},$e=a({},[...De,...be,...Zt]),qe=a({},[...Ie,...Jt]),zt=function(e){let t=Q(e);(!t||!t.tagName)&&(t={namespaceURI:F,tagName:"template"});const n=ce(e.tagName),c=ce(t.tagName);return Oe[e.namespaceURI]?e.namespaceURI===oe?t.namespaceURI===I?n==="svg":t.namespaceURI===ne?n==="svg"&&(c==="annotation-xml"||ie[c]):!!$e[n]:e.namespaceURI===ne?t.namespaceURI===I?n==="math":t.namespaceURI===oe?n==="math"&&ae[c]:!!qe[n]:e.namespaceURI===I?t.namespaceURI===oe&&!ae[c]||t.namespaceURI===ne&&!ie[c]?!1:!qe[n]&&(kt[n]||!$e[n]):!!(X==="application/xhtml+xml"&&Oe[e.namespaceURI]):!1},N=function(e){V(o.removed,{element:e});try{Q(e).removeChild(e)}catch{Ot(e)}},re=function(e,t){try{V(o.removed,{attribute:t.getAttributeNode(e),from:t})}catch{V(o.removed,{attribute:null,from:t})}if(t.removeAttribute(e),e==="is")if(v||ee)try{N(t)}catch{}else try{t.setAttribute(e,"")}catch{}},Ke=function(e){let t=null,n=null;if(he)e="<remove></remove>"+e;else{const d=st(e,/^[\r\n\t ]+/);n=d&&d[0]}X==="application/xhtml+xml"&&F===I&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const c=E?E.createHTML(e):e;if(F===I)try{t=new St().parseFromString(c,X)}catch{}if(!t||!t.documentElement){t=ue.createDocument(F,"template",null);try{t.documentElement.innerHTML=Re?W:c}catch{}}const _=t.body||t.documentElement;return e&&n&&_.insertBefore(l.createTextNode(n),_.childNodes[0]||null),F===I?bt.call(t,C?"html":"body")[0]:C?t.documentElement:_},Ze=function(e){return Nt.call(e.ownerDocument||e,e,z.SHOW_ELEMENT|z.SHOW_COMMENT|z.SHOW_TEXT|z.SHOW_PROCESSING_INSTRUCTION|z.SHOW_CDATA_SECTION,null)},Le=function(e){return e instanceof At&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof ht)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},Je=function(e){return typeof fe=="function"&&e instanceof fe};function M(i,e,t){se(i,n=>{n.call(o,e,t,H)})}const Qe=function(e){let t=null;if(M(g.beforeSanitizeElements,e,null),Le(e))return N(e),!0;const n=m(e.nodeName);if(M(g.uponSanitizeElement,e,{tagName:n,allowedTags:u}),e.hasChildNodes()&&!Je(e.firstElementChild)&&A(/<[/\w!]/g,e.innerHTML)&&A(/<[/\w!]/g,e.textContent)||e.nodeType===Z.progressingInstruction||Ee&&e.nodeType===Z.comment&&A(/<[/\w]/g,e.data))return N(e),!0;if(!u[n]||B[n]){if(!B[n]&&tt(n)&&(f.tagNameCheck instanceof RegExp&&A(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n)))return!1;if(Ae&&!U[n]){const c=Q(e)||e.parentNode,_=Lt(e)||e.childNodes;if(_&&c){const d=_.length;for(let O=d-1;O>=0;--O){const D=Rt(_[O],!0);D.__removalCount=(e.__removalCount||0)+1,c.insertBefore(D,yt(e))}}}return N(e),!0}return e instanceof xe&&!zt(e)||(n==="noscript"||n==="noembed"||n==="noframes")&&A(/<\/no(script|embed|frames)/i,e.innerHTML)?(N(e),!0):(P&&e.nodeType===Z.text&&(t=e.textContent,se([me,pe,de],c=>{t=$(t,c," ")}),e.textContent!==t&&(V(o.removed,{element:e.cloneNode()}),e.textContent=t)),M(g.afterSanitizeElements,e,null),!1)},et=function(e,t,n){if(Ge&&(t==="id"||t==="name")&&(n in l||n in Ht))return!1;if(!(_e&&!Te[t]&&A(Mt,t))){if(!(Fe&&A(Ct,t))){if(!p[t]||Te[t]){if(!(tt(e)&&(f.tagNameCheck instanceof RegExp&&A(f.tagNameCheck,e)||f.tagNameCheck instanceof Function&&f.tagNameCheck(e))&&(f.attributeNameCheck instanceof RegExp&&A(f.attributeNameCheck,t)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(t))||t==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&A(f.tagNameCheck,n)||f.tagNameCheck instanceof Function&&f.tagNameCheck(n))))return!1}else if(!Se[t]){if(!A(ve,$(n,Pe,""))){if(!((t==="src"||t==="xlink:href"||t==="href")&&e!=="script"&&Vt(n,"data:")===0&&Ye[e])){if(!(He&&!A(wt,$(n,Pe,"")))){if(n)return!1}}}}}}return!0},tt=function(e){return e!=="annotation-xml"&&st(e,xt)},nt=function(e){M(g.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||Le(e))return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:p,forceKeepAttr:void 0};let c=t.length;for(;c--;){const _=t[c],{name:d,namespaceURI:O,value:D}=_,j=m(d);let h=d==="value"?D:$t(D);if(n.attrName=j,n.attrValue=h,n.keepAttr=!0,n.forceKeepAttr=void 0,M(g.uponSanitizeAttribute,e,n),h=n.attrValue,We&&(j==="id"||j==="name")&&(re(d,e),h=Pt+h),Ee&&A(/((--!?|])>)|<\/(style|title)/i,h)){re(d,e);continue}if(n.forceKeepAttr||(re(d,e),!n.keepAttr))continue;if(!ze&&A(/\/>/i,h)){re(d,e);continue}P&&se([me,pe,de],it=>{h=$(h,it," ")});const ot=m(e.nodeName);if(et(ot,j,h)){if(E&&typeof J=="object"&&typeof J.getAttributeType=="function"&&!O)switch(J.getAttributeType(ot,j)){case"TrustedHTML":{h=E.createHTML(h);break}case"TrustedScriptURL":{h=E.createScriptURL(h);break}}try{O?e.setAttributeNS(O,d,h):e.setAttribute(d,h),Le(e)?N(e):rt(o.removed)}catch{}}}M(g.afterSanitizeAttributes,e,null)},Gt=function i(e){let t=null;const n=Ze(e);for(M(g.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)M(g.uponSanitizeShadowNode,t,null),Qe(t),nt(t),t.content instanceof b&&i(t.content);M(g.afterSanitizeShadowDOM,e,null)};return o.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=null,n=null,c=null,_=null;if(Re=!i,Re&&(i="<!-->"),typeof i!="string"&&!Je(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw q("dirty is not a string, aborting")}else throw q("toString is not a function");if(!o.isSupported)return i;if(ge||ye(e),o.removed=[],typeof i=="string"&&(Y=!1),Y){if(i.nodeName){const D=m(i.nodeName);if(!u[D]||B[D])throw q("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof fe)t=Ke("<!---->"),n=t.ownerDocument.importNode(i,!0),n.nodeType===Z.element&&n.nodeName==="BODY"||n.nodeName==="HTML"?t=n:t.appendChild(n);else{if(!v&&!P&&!C&&i.indexOf("<")===-1)return E&&te?E.createHTML(i):i;if(t=Ke(i),!t)return v?null:te?W:""}t&&he&&N(t.firstChild);const d=Ze(Y?i:t);for(;c=d.nextNode();)Qe(c),nt(c),c.content instanceof b&&Gt(c.content);if(Y)return i;if(v){if(ee)for(_=Dt.call(t.ownerDocument);t.firstChild;)_.appendChild(t.firstChild);else _=t;return(p.shadowroot||p.shadowrootmode)&&(_=It.call(s,_,!0)),_}let O=C?t.outerHTML:t.innerHTML;return C&&u["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&A(Et,t.ownerDocument.doctype.name)&&(O="<!DOCTYPE "+t.ownerDocument.doctype.name+`>
|
|
4
|
+
`+O),P&&se([me,pe,de],D=>{O=$(O,D," ")}),E&&te?E.createHTML(O):O},o.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ye(i),ge=!0},o.clearConfig=function(){H=null,ge=!1},o.isValidAttribute=function(i,e,t){H||ye({});const n=m(i),c=m(e);return et(n,c,t)},o.addHook=function(i,e){typeof e=="function"&&V(g[i],e)},o.removeHook=function(i,e){if(e!==void 0){const t=Xt(g[i],e);return t===-1?void 0:jt(g[i],t,1)[0]}return rt(g[i])},o.removeHooks=function(i){g[i]=[]},o.removeAllHooks=function(){g=pt()},o}var fn=gt();export{fn as p};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{CHECKOUT_DATA_FRAGMENT as e}from"../fragments.js";import{a as o,
|
|
3
|
+
import{CHECKOUT_DATA_FRAGMENT as e}from"../fragments.js";import{a as o,b as d}from"./synchronizeCheckout.js";import{s as l}from"./subscription-email-statuses.js";import{M as p,o as m,d as u,Q as f}from"./IsBillToShippingSignal.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";const _=`
|
|
4
4
|
mutation setBillingAddress($input: SetBillingAddressOnCartInput!) {
|
|
5
5
|
setBillingAddressOnCart(input: $input) {
|
|
6
6
|
cart {
|
|
@@ -10,4 +10,4 @@ import{CHECKOUT_DATA_FRAGMENT as e}from"../fragments.js";import{a as o,d,b as l}
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
${e}
|
|
13
|
-
`,
|
|
13
|
+
`,T=async({address:r,customerAddressId:t,sameAsShipping:s=!1,useForShipping:n=!1})=>{const a=l.cartId;if(!a)throw new p;const i={cart_id:a,billing_address:{same_as_shipping:s,use_for_shipping:n}};if(!s&&t&&(i.billing_address.customer_address_id=t),!s&&!t){if(!r)throw new m;i.billing_address.address=o(r)}return await u({options:{variables:{input:i}},path:"setBillingAddressOnCart.cart",query:_,queueName:f.CartUpdate,transformer:d,type:"mutation"})};export{T as s};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{
|
|
3
|
+
import{CUSTOMER_FRAGMENT as o,CHECKOUT_DATA_FRAGMENT as n}from"../fragments.js";import{s as m}from"./subscription-email-statuses.js";import{d as r,e as l,M as u,Q as c}from"./IsBillToShippingSignal.js";import"@dropins/tools/event-bus.js";import{merge as E}from"@dropins/tools/lib.js";import{c as f,b as p}from"./synchronizeCheckout.js";const C=t=>{var i,a,s;if(!t)return null;const e={firstName:t.firstname||"",lastName:t.lastname||"",email:t.email||""};return E(e,(s=(a=(i=f.getConfig().models)==null?void 0:i.CustomerModel)==null?void 0:a.transformer)==null?void 0:s.call(a,t))},y=t=>!!(t!=null&&t.is_email_available),A=`
|
|
4
4
|
query getCustomer {
|
|
5
5
|
customer {
|
|
6
6
|
...CUSTOMER_FRAGMENT
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
${
|
|
11
|
-
|
|
10
|
+
${o}
|
|
11
|
+
`,q=async()=>m.authenticated?await r({options:{method:"GET",cache:"no-cache"},path:"customer",query:A,transformer:C,type:"query"}):null,g=`
|
|
12
12
|
query isEmailAvailable($email: String!) {
|
|
13
13
|
isEmailAvailable(email: $email) {
|
|
14
14
|
is_email_available
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
`,
|
|
17
|
+
`,N=async t=>{if(!t)throw new l;return await r({options:{method:"GET",cache:"no-cache",variables:{email:t}},path:"isEmailAvailable",query:g,transformer:y,type:"query"})},h=`
|
|
18
18
|
mutation setGuestEmail($cartId: String!, $email: String!) {
|
|
19
19
|
setGuestEmailOnCart(input: { cart_id: $cartId, email: $email }) {
|
|
20
20
|
cart {
|
|
@@ -23,5 +23,5 @@ import{s}from"./store-config.js";import{merge as l}from"@dropins/tools/lib.js";i
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
${
|
|
27
|
-
|
|
26
|
+
${n}
|
|
27
|
+
`,$=async t=>{const e=m.cartId;if(!e)throw new u;return await r({options:{variables:{cartId:e,email:t}},path:"setGuestEmailOnCart.cart",query:h,queueName:c.CartUpdate,transformer:p,type:"mutation"})};export{q as g,N as i,$ as s};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{CHECKOUT_DATA_FRAGMENT as e}from"../fragments.js";import{
|
|
3
|
+
import{CHECKOUT_DATA_FRAGMENT as e}from"../fragments.js";import{b as r}from"./synchronizeCheckout.js";import{s as o}from"./subscription-email-statuses.js";import{M as n,n as s,d as m,Q as i}from"./IsBillToShippingSignal.js";import"@dropins/tools/event-bus.js";import"@dropins/tools/lib.js";const d=`
|
|
4
4
|
mutation setPaymentMethod(
|
|
5
5
|
$cartId: String!
|
|
6
6
|
$paymentMethod: PaymentMethodInput!
|
|
@@ -15,4 +15,4 @@ import{CHECKOUT_DATA_FRAGMENT as e}from"../fragments.js";import{d as r,b as o}fr
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
${e}
|
|
18
|
-
`,
|
|
18
|
+
`,C=async t=>{const a=o.cartId;if(!a)throw new n;if(!t)throw new s;return await m({options:{variables:{cartId:a,paymentMethod:t}},path:"setPaymentMethodOnCart.cart",query:d,queueName:i.CartUpdate,transformer:r,type:"mutation"})};export{C as s};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{s as r}from"./
|
|
3
|
+
import{s as r}from"./subscription-email-statuses.js";import{b as i}from"./synchronizeCheckout.js";import"@dropins/tools/lib.js";import{M as n,d as e,Q as s}from"./IsBillToShippingSignal.js";import"@dropins/tools/event-bus.js";import{CHECKOUT_DATA_FRAGMENT as p}from"../fragments.js";const C=t=>({countryCode:t.country_id,postCode:t.postcode||"",...t.region_id?{regionId:Number(t.region_id)}:{...t.region?{region:t.region}:{}}}),M=t=>({carrierCode:t.carrier.code||"",methodCode:t.code||"",amount:t.amount,amountExclTax:t.amountExclTax,amountInclTax:t.amountInclTax}),a=`
|
|
4
4
|
mutation setShippingMethods(
|
|
5
5
|
$cartId: String!
|
|
6
6
|
$shippingMethods: [ShippingMethodInput]!
|
|
@@ -14,5 +14,5 @@ import{s as r}from"./store-config.js";import{d as i,b as n}from"./synchronizeChe
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
${
|
|
18
|
-
`,S=async t=>{const o=r.cartId;if(!o)throw new
|
|
17
|
+
${p}
|
|
18
|
+
`,S=async t=>{const o=r.cartId;if(!o)throw new n;return await e({type:"mutation",query:a,queueName:s.CartUpdate,options:{variables:{cartId:o,shippingMethods:t}},path:"setShippingMethodsOnCart.cart",transformer:i})};export{C as a,S as s,M as t};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! Copyright 2025 Adobe
|
|
2
|
+
All Rights Reserved. */
|
|
3
|
+
const I={authenticated:!1,cartId:null,initialized:!1,config:null},d=new Proxy(I,{set(e,N,U){return e[N]=U,!0},get(e,N){return e[N]}}),A=()=>d.config;var C=(e=>(e.EXCLUDING_TAX="EXCLUDING_TAX",e.INCLUDING_EXCLUDING_TAX="INCLUDING_AND_EXCLUDING_TAX",e.INCLUDING_TAX="INCLUDING_TAX",e))(C||{}),r=(e=>(e.NotActive="NOT_ACTIVE",e.Subscribed="SUBSCRIBED",e.Unconfirmed="UNCONFIRMED",e.Unsubscribed="UNSUBSCRIBED",e))(r||{}),c=(e=>(e[e.NotActive=r.NotActive]="NotActive",e[e.Subscribed=r.Subscribed]="Subscribed",e[e.Unconfirmed=r.Unconfirmed]="Unconfirmed",e[e.Unsubscribed=r.Unsubscribed]="Unsubscribed",e.Error="ERROR",e))(c||{});export{c as S,C as T,A as g,d as s};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/*! Copyright 2025 Adobe
|
|
2
2
|
All Rights Reserved. */
|
|
3
|
-
import{s as
|
|
3
|
+
import{s as n}from"./subscription-email-statuses.js";import{merge as h,Initializer as g}from"@dropins/tools/lib.js";import{M as y,d as v,m as C}from"./IsBillToShippingSignal.js";import{events as o}from"@dropins/tools/event-bus.js";import{CHECKOUT_DATA_FRAGMENT as c}from"../fragments.js";const A=async(e=!1)=>{n.authenticated=e},x=(e,t)=>e.amount.value-t.amount.value,b=e=>e==null,l=e=>!(!e||!e.method_code||!e.method_title||b(e.amount.value)||!e.amount.currency),u=e=>({amount:{value:e.amount.value,currency:e.amount.currency},title:e.method_title,code:e.method_code,carrier:{code:e.carrier_code,title:e.carrier_title},value:`${e.carrier_code} - ${e.method_code}`,...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}}}),I=e=>{if(l(e))return u(e)},M=e=>{if(e)return e.filter(l).map(t=>u(t)).sort(x)},T=e=>e?!!e.code&&!!e.label:!1,S=e=>{if(!T(e))return;const{code:t,label:i,region_id:r}=e;return r?{code:t,name:i,id:r}:{code:t,name:i}},N=e=>{const{code:t,label:i}=e;return{value:t,label:i}},k=e=>e?"code"in e&&"value"in e:!1,z=e=>e.filter(k).map(t=>{const{code:i,value:r}=t;return{code:i,value:r}}),a=e=>{const t=e.street.filter(Boolean);return{id:(e==null?void 0:e.id)||void 0,city:e.city,company:e.company||void 0,country:N(e.country),customAttributes:z(e.custom_attributes),firstName:e.firstname,lastName:e.lastname,postCode:e.postcode||void 0,region:S(e.region),street:t,telephone:e.telephone||void 0,vatId:e.vat_id||void 0,prefix:e.prefix||void 0,suffix:e.suffix||void 0,middleName:e.middlename||void 0,fax:e.fax||void 0}},E=e=>{if(e)return a(e)},w=e=>e.filter(t=>!!t).map(t=>{const{available_shipping_methods:i,selected_shipping_method:r,same_as_billing:s,..._}=t;return{...a(_),availableShippingMethods:M(i),selectedShippingMethod:I(r),sameAsBilling:s}}),Q=e=>({city:e.city,company:e.company,country_code:e.countryCode,custom_attributes:e.customAttributes.map(t=>({attribute_code:t.code,value:t.value})),firstname:e.firstName,lastname:e.lastName,postcode:e.postcode,region:e.region,region_id:e.regionId,save_in_address_book:e.saveInAddressBook??!0,street:e.street,telephone:e.telephone,vat_id:e.vatId,prefix:e.prefix,suffix:e.suffix,middlename:e.middleName,fax:e.fax}),P=e=>{if(e)return{code:e.code,title:e.title}},$=e=>{if(e)return e.filter(t=>!!t).map(t=>{const{code:i,title:r}=t;return{code:i,title:r}})},q=e=>{var i,r,s;if(!e)return;const t={availablePaymentMethods:$(e.available_payment_methods),billingAddress:E(e.billing_address),email:e.email??void 0,id:e.id,isEmpty:e.total_quantity===0,isVirtual:e.is_virtual,selectedPaymentMethod:P(e.selected_payment_method),shippingAddresses:w(e.shipping_addresses),isGuest:!n.authenticated};return h(t,(s=(r=(i=R.getConfig().models)==null?void 0:i.CartModel)==null?void 0:r.transformer)==null?void 0:s.call(r,e))},B=`
|
|
4
4
|
query getCart($cartId: String!) {
|
|
5
5
|
cart(cart_id: $cartId) {
|
|
6
6
|
...CHECKOUT_DATA_FRAGMENT
|
|
7
7
|
}
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
${
|
|
11
|
-
`,
|
|
10
|
+
${c}
|
|
11
|
+
`,D=`
|
|
12
12
|
query getCustomerCart {
|
|
13
13
|
cart: customerCart {
|
|
14
14
|
...CHECKOUT_DATA_FRAGMENT
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
${
|
|
19
|
-
`,
|
|
18
|
+
${c}
|
|
19
|
+
`,m=async()=>{const e=n.cartId,t=n.authenticated===!1,i=t?B:D,r=t?{cartId:e}:{};if(t&&!e)throw new y;return await v({type:"query",query:i,options:{method:"POST",cache:"no-cache",variables:r},path:"cart",transformer:q})},G=()=>[o.on("authenticated",A,{eager:!0}),o.on("cart/initialized",p,{eager:!0}),o.on("cart/reset",O),o.on("cart/updated",d)],f=new g({init:async e=>{const t=e||{};f.config.setConfig(t)},listeners:G}),R=f.config,p=async e=>{if(n.initialized)return d(e);n.config||(n.config=await C());const t=e?e.id:null;n.cartId=t;const i=t?await m():null;n.initialized=!0,o.emit("checkout/initialized",i||null)},O=()=>{n.cartId=null,o.emit("checkout/updated",null)},d=async e=>{if(!n.initialized)return p(e);const t=e?e.id:null;n.cartId=t;const i=t?await m():null;o.emit("checkout/updated",i||null)};export{Q as a,q as b,R as c,A as d,p as e,m as g,f as i,O as r,d as s,M as t};
|