@kiva/kv-shop 2.1.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/_virtual/_commonjs-dynamic-modules.js +6 -0
  2. package/dist/_virtual/_commonjsHelpers.js +8 -0
  3. package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
  4. package/dist/_virtual/dropin.js +11 -0
  5. package/dist/_virtual/dropin2.js +4 -0
  6. package/dist/basket.js +35 -12
  7. package/dist/basketCredits.js +78 -14
  8. package/dist/basketItems.js +27 -8
  9. package/dist/basketTotals.js +38 -10
  10. package/dist/basketVerification.js +6 -6
  11. package/dist/checkoutStatus.js +52 -8
  12. package/dist/components/KvPaymentSelect.css +1 -0
  13. package/dist/components/KvPaymentSelect.js +23 -0
  14. package/dist/components/KvPaymentSelect2.js +110 -0
  15. package/dist/index.d.ts +321 -20
  16. package/dist/index.js +49 -96
  17. package/dist/managedAccount.js +62 -8
  18. package/dist/oneTimeCheckout.js +156 -12
  19. package/dist/receipt.js +143 -12
  20. package/dist/shopError.js +41 -6
  21. package/dist/shopQueries.js +82 -11
  22. package/dist/subscriptionCheckout.js +88 -7
  23. package/dist/useBraintreeDropIn.js +145 -9
  24. package/dist/util/cookie.js +11 -0
  25. package/dist/util/poll.js +17 -0
  26. package/dist/util/redirect.js +8 -0
  27. package/dist/util/visitorId.js +7 -0
  28. package/dist/validatePreCheckout.js +44 -11
  29. package/dist/vendor/braintree-web-drop-in/dist/browser/dropin.js +12223 -0
  30. package/package.json +28 -26
  31. package/dist/basket.cjs +0 -141
  32. package/dist/basket.d.ts +0 -8
  33. package/dist/basketCredits.cjs +0 -250
  34. package/dist/basketCredits.d.ts +0 -32
  35. package/dist/basketItems.cjs +0 -205
  36. package/dist/basketItems.d.ts +0 -26
  37. package/dist/basketTotals.cjs +0 -228
  38. package/dist/basketTotals.d.ts +0 -37
  39. package/dist/basketVerification.cjs +0 -41
  40. package/dist/basketVerification.d.ts +0 -10
  41. package/dist/checkoutStatus.cjs +0 -111
  42. package/dist/checkoutStatus.d.ts +0 -20
  43. package/dist/chunk-4ODZGLWK.js +0 -64
  44. package/dist/chunk-ASZJVUQ7.js +0 -72
  45. package/dist/chunk-FBF4WMN6.js +0 -49
  46. package/dist/chunk-FC4QW6QA.js +0 -106
  47. package/dist/chunk-FCAOCO7O.js +0 -17
  48. package/dist/chunk-GVVI7X2R.js +0 -196
  49. package/dist/chunk-IIN37LC7.js +0 -45
  50. package/dist/chunk-IOZ5ERDX.js +0 -121
  51. package/dist/chunk-KCUOMCSN.js +0 -58
  52. package/dist/chunk-LZ4UMRCV.js +0 -16
  53. package/dist/chunk-RQNRQ2E5.js +0 -155
  54. package/dist/chunk-SRGYGDAX.js +0 -80
  55. package/dist/chunk-TPJPGUO7.js +0 -12
  56. package/dist/chunk-UJXHTR43.js +0 -86
  57. package/dist/chunk-VZ3VDRRP.js +0 -167
  58. package/dist/chunk-Z7JRY3QE.js +0 -34
  59. package/dist/components/KvPaymentSelect.vue +0 -380
  60. package/dist/index.cjs +0 -1227
  61. package/dist/managedAccount.cjs +0 -231
  62. package/dist/managedAccount.d.ts +0 -59
  63. package/dist/oneTimeCheckout.cjs +0 -636
  64. package/dist/oneTimeCheckout.d.ts +0 -21
  65. package/dist/receipt.cjs +0 -191
  66. package/dist/receipt.d.ts +0 -16
  67. package/dist/shopError.cjs +0 -88
  68. package/dist/shopError.d.ts +0 -14
  69. package/dist/shopQueries.cjs +0 -248
  70. package/dist/shopQueries.d.ts +0 -8
  71. package/dist/subscriptionCheckout.cjs +0 -187
  72. package/dist/subscriptionCheckout.d.ts +0 -13
  73. package/dist/useBraintreeDropIn.cjs +0 -258
  74. package/dist/useBraintreeDropIn.d.ts +0 -25
  75. package/dist/validatePreCheckout.cjs +0 -218
  76. package/dist/validatePreCheckout.d.ts +0 -28
package/dist/index.d.ts CHANGED
@@ -1,20 +1,321 @@
1
- export { createBasket, getBasketID, hasBasketExpired, setBasketID } from './basket.js';
2
- export { ApplyKivaCreditData, ApplyPromoCreditData, RemoveKivaCreditData, RemovePromoCreditData, applyKivaCredit, applyPromoCredit, removeKivaCredit, removePromoCredit } from './basketCredits.js';
3
- export { SetTipDonationData, SetTipDonationOptions, setTipDonation } from './basketItems.js';
4
- export { BasketTotalsData, basketTotalsQuery, watchBasketTotals } from './basketTotals.js';
5
- export { VerificationState, isBasketVerified } from './basketVerification.js';
6
- export { CheckoutStatusQueryResult, GetCheckoutStatusOptions, PollForCheckoutStatusOptions, getCheckoutStatus, pollForFinishedCheckout } from './checkoutStatus.js';
7
- export { ShopPromoCampaignData, ShopPromoCampaignError, getPromoFromBasket } from './managedAccount.js';
8
- export { OneTimeCheckoutOptions, ValetInviter, executeOneTimeCheckout } from './oneTimeCheckout.js';
9
- export { getCheckoutTrackingData, getFTDStatus, getReceiptItems, getReceiptTotals } from './receipt.js';
10
- export { ShopError, ShopErrorOptions, parseShopError } from './shopError.js';
11
- export { callShopMutation, callShopQuery, watchShopQuery } from './shopQueries.js';
12
- export { SubscriptionCheckoutOptions, checkSubscriptionStatus, executeNewSubscriptionCheckout } from './subscriptionCheckout.js';
13
- export { DropInInitOptions, DropInWrapper, PayPalFlowType, PaymentType, defaultPaymentTypes, getClientToken, default as useBraintreeDropIn } from './useBraintreeDropIn.js';
14
- export { ValidatePreCheckoutData, ValidatePreCheckoutOptions, validatePreCheckout, validatePreCheckoutMutation } from './validatePreCheckout.js';
15
- import '@apollo/client/core/core.cjs';
16
- import '@apollo/client/core/ObservableQuery';
17
- import 'graphql/language/ast';
18
- import '@kiva/kv-analytics';
19
- import 'braintree-web-drop-in';
20
- import 'vue-demi';
1
+ import { ApolloClient } from '@apollo/client';
2
+ import { DocumentNode } from '@apollo/client';
3
+ import { Dropin } from 'braintree-web-drop-in';
4
+ import { default as KvPaymentSelect } from './components/KvPaymentSelect.js';
5
+ import { MutationOptions } from '@apollo/client';
6
+ import { ObservableQuery } from '@apollo/client';
7
+ import { PaymentMethodPayload } from 'braintree-web-drop-in';
8
+ import { QueryOptions } from '@apollo/client';
9
+ import { Ref } from 'vue';
10
+ import { TransactionData } from '@kiva/kv-analytics';
11
+ import { WatchQueryOptions } from '@apollo/client';
12
+
13
+ export declare function applyKivaCredit(apollo: ApolloClient<any>): Promise<boolean>;
14
+
15
+ export declare interface ApplyKivaCreditData {
16
+ shop: {
17
+ id: string;
18
+ addCreditByType: boolean;
19
+ } | null;
20
+ }
21
+
22
+ export declare function applyPromoCredit(apollo: ApolloClient<any>, options: MutationOptions<any>): Promise<any>;
23
+
24
+ export declare interface ApplyPromoCreditData {
25
+ shop: {
26
+ id: string;
27
+ addCreditByType: boolean;
28
+ } | null;
29
+ }
30
+
31
+ export declare interface BasketTotalsData {
32
+ shop: {
33
+ id: string;
34
+ basket: {
35
+ id: string;
36
+ totals: {
37
+ bonusAppliedTotal: string;
38
+ bonusAvailableTotal: string;
39
+ creditAmountNeeded: string;
40
+ creditAppliedTotal: string;
41
+ creditAvailableTotal: string;
42
+ donationTotal: string;
43
+ itemTotal: string;
44
+ freeTrialAppliedTotal: string;
45
+ freeTrialAvailableTotal: string;
46
+ loanReservationTotal: string;
47
+ kivaCardTotal: string;
48
+ kivaCreditAppliedTotal: string;
49
+ kivaCreditAvailableTotal: string;
50
+ kivaCreditRemaining: string;
51
+ kivaCreditToReapply: string;
52
+ redemptionCodeAppliedTotal: string;
53
+ redemptionCodeAvailableTotal: string;
54
+ universalCodeAppliedTotal: string;
55
+ universalCodeAvailableTotal: string;
56
+ } | null;
57
+ } | null;
58
+ } | null;
59
+ }
60
+
61
+ export declare const basketTotalsQuery: DocumentNode;
62
+
63
+ export declare function callShopMutation<TData>(apollo: ApolloClient<any>, options: MutationOptions<TData, any>, maxretries?: number): Promise<TData>;
64
+
65
+ export declare function callShopQuery<TData>(apollo: ApolloClient<any>, options: QueryOptions<any, TData>, maxretries?: number): Promise<TData>;
66
+
67
+ export declare interface CheckoutStatusQueryResult {
68
+ data: {
69
+ checkoutStatus: any;
70
+ } | null;
71
+ errors?: any;
72
+ }
73
+
74
+ export declare function checkSubscriptionStatus(apollo: any): Promise<boolean>;
75
+
76
+ export declare function createBasket(apollo: ApolloClient<any>): Promise<any>;
77
+
78
+ export declare const defaultPaymentTypes: readonly ["paypal", "card", "applePay", "googlePay"];
79
+
80
+ export declare interface DropInInitOptions {
81
+ amount: string | number;
82
+ authToken: string;
83
+ container: string | HTMLElement;
84
+ googlePayMerchantId: string;
85
+ paymentTypes?: PaymentType[];
86
+ preselectVaultedPaymentMethod?: boolean;
87
+ paypalFlow?: PayPalFlowType;
88
+ }
89
+
90
+ export declare interface DropInWrapper {
91
+ initDropIn: (options: DropInInitOptions) => Promise<Dropin>;
92
+ paymentMethodRequestable: Ref<boolean>;
93
+ requestPaymentMethod: () => Promise<PaymentMethodPayload | void>;
94
+ updateAmount: (amount: string | number) => void;
95
+ }
96
+
97
+ export declare function executeNewSubscriptionCheckout({ amount, apollo, dayOfMonth, donateAmount, paymentMethod, }: SubscriptionCheckoutOptions): Promise<any>;
98
+
99
+ export declare function executeOneTimeCheckout({ apollo, braintree, emailAddress, emailOptIn, valetInviter, deactivateRedirect, }: OneTimeCheckoutOptions): Promise<CheckoutStatusQueryResult>;
100
+
101
+ export declare function getBasketID(): string;
102
+
103
+ export declare function getCheckoutStatus({ apollo, transactionSagaId }: GetCheckoutStatusOptions): Promise<CheckoutStatusQueryResult>;
104
+
105
+ export declare interface GetCheckoutStatusOptions {
106
+ apollo: ApolloClient<any>;
107
+ transactionSagaId: string;
108
+ }
109
+
110
+ export declare function getCheckoutTrackingData(apollo: ApolloClient<any>, checkoutId: string, paymentType: string): Promise<TransactionData>;
111
+
112
+ export declare function getClientToken(apollo: any): Promise<any>;
113
+
114
+ export declare function getFTDStatus(apollo: ApolloClient<any>): Promise<any>;
115
+
116
+ export declare function getPromoFromBasket(apollo: ApolloClient<any>, options: QueryOptions<any>): Promise<ShopPromoCampaignData | ShopPromoCampaignError | null>;
117
+
118
+ export declare function getReceiptItems(apollo: ApolloClient<any>, checkoutId: number): Promise<ReceiptItem[]>;
119
+
120
+ export declare function getReceiptTotals(apollo: ApolloClient<any>, checkoutId: number): Promise<any>;
121
+
122
+ export declare function hasBasketExpired(error: any): boolean;
123
+
124
+ export declare function isBasketVerified(state: VerificationState): boolean;
125
+
126
+ export { KvPaymentSelect }
127
+
128
+ export declare interface OneTimeCheckoutOptions {
129
+ apollo: ApolloClient<any>;
130
+ braintree?: DropInWrapper;
131
+ emailAddress?: string;
132
+ emailOptIn?: boolean;
133
+ valetInviter?: ValetInviter;
134
+ deactivateRedirect?: boolean;
135
+ }
136
+
137
+ export declare function parseShopError(error: any): ShopError;
138
+
139
+ export declare type PaymentType = 'card' | 'paypal' | 'paypalCredit' | 'venmo' | 'applePay' | 'googlePay';
140
+
141
+ export declare type PayPalFlowType = 'checkout' | 'vault';
142
+
143
+ export declare interface PollForCheckoutStatusOptions extends GetCheckoutStatusOptions {
144
+ interval?: number;
145
+ timeout?: number;
146
+ }
147
+
148
+ export declare function pollForFinishedCheckout({ apollo, transactionSagaId, interval, timeout, }: PollForCheckoutStatusOptions): Promise<CheckoutStatusQueryResult>;
149
+
150
+ declare interface ReceiptItem {
151
+ id: string;
152
+ price: string;
153
+ __typename: string;
154
+ isTip?: boolean;
155
+ isUserEdited?: boolean;
156
+ }
157
+
158
+ export declare function removeKivaCredit(apollo: ApolloClient<any>): Promise<boolean>;
159
+
160
+ export declare interface RemoveKivaCreditData {
161
+ shop: {
162
+ id: string;
163
+ removeCreditByType: boolean;
164
+ } | null;
165
+ }
166
+
167
+ export declare function removePromoCredit(apollo: ApolloClient<any>, options: MutationOptions<any>): Promise<boolean>;
168
+
169
+ export declare interface RemovePromoCreditData {
170
+ shop: {
171
+ id: string;
172
+ removeCreditByType: boolean;
173
+ } | null;
174
+ }
175
+
176
+ export declare function setBasketID(basketId: any): void;
177
+
178
+ export declare function setTipDonation({ amount, apollo, metadata }: SetTipDonationOptions): Promise<{
179
+ id: string;
180
+ price: string;
181
+ isTip: boolean;
182
+ metadata: string | null;
183
+ }>;
184
+
185
+ export declare interface SetTipDonationData {
186
+ shop: {
187
+ id: string;
188
+ updateDonation: {
189
+ id: string;
190
+ price: string;
191
+ isTip: boolean;
192
+ metadata: string | null;
193
+ } | null;
194
+ } | null;
195
+ }
196
+
197
+ export declare interface SetTipDonationOptions {
198
+ amount: string | number;
199
+ metadata?: string | null;
200
+ apollo: ApolloClient<any>;
201
+ }
202
+
203
+ export declare class ShopError extends Error {
204
+ code: string;
205
+ original?: object;
206
+ errors?: Array<ShopError>;
207
+ constructor({ code, original }: ShopErrorOptions, ...params: any[]);
208
+ aggregateErrors(errors: Array<ShopError>): void;
209
+ }
210
+
211
+ export declare interface ShopErrorOptions {
212
+ code: string;
213
+ original?: object;
214
+ }
215
+
216
+ export declare interface ShopPromoCampaignData {
217
+ shop?: {
218
+ id: string;
219
+ promoCampaign?: {
220
+ promoFund?: {
221
+ id: number;
222
+ displayName: string;
223
+ displayDescription: string;
224
+ promoPrice: string;
225
+ };
226
+ promoGroup?: {
227
+ id: number;
228
+ type: string;
229
+ teamId: number;
230
+ };
231
+ managedAccount?: {
232
+ managementType: string;
233
+ audience: string;
234
+ allowDonations: string;
235
+ sendKivaNewsletter: string;
236
+ id: number;
237
+ isEmployee: boolean;
238
+ formId: string;
239
+ pageId: string;
240
+ loanSearchCriteria: {
241
+ filters: {
242
+ cityState: [string];
243
+ country: [string];
244
+ currencyLossPossible: boolean;
245
+ dafEligible: boolean;
246
+ distributionModel: any | string;
247
+ excludeNonRated: boolean;
248
+ expiringSoon: boolean;
249
+ gender: any | string;
250
+ hasResearchScore: boolean;
251
+ isGroup: boolean;
252
+ lenderFavorite: number;
253
+ loanLimit: number;
254
+ loanTags: [number];
255
+ isMatched: boolean;
256
+ sector: [number];
257
+ status: any | string;
258
+ theme: [string];
259
+ };
260
+ sortBy: any | string | null;
261
+ } | any | null;
262
+ } | any | null;
263
+ } | any | null;
264
+ } | null;
265
+ }
266
+
267
+ export declare interface ShopPromoCampaignError {
268
+ shop?: any;
269
+ error?: string | null;
270
+ }
271
+
272
+ export declare interface SubscriptionCheckoutOptions {
273
+ amount: string;
274
+ apollo: any;
275
+ dayOfMonth?: number;
276
+ donateAmount: string;
277
+ paymentMethod: PaymentMethodPayload;
278
+ }
279
+
280
+ export declare function useBraintreeDropIn(key?: string): DropInWrapper;
281
+
282
+ export declare type ValetInviter = {
283
+ inviterId: string;
284
+ invitationUrl: string;
285
+ };
286
+
287
+ export declare function validatePreCheckout({ apollo, emailAddress, emailOptIn, valetInviter, }: ValidatePreCheckoutOptions): Promise<void>;
288
+
289
+ export declare interface ValidatePreCheckoutData {
290
+ shop: {
291
+ id: string;
292
+ validatePreCheckout: Array<{
293
+ error: string;
294
+ success: boolean;
295
+ value: string;
296
+ }>;
297
+ } | null;
298
+ }
299
+
300
+ export declare const validatePreCheckoutMutation: DocumentNode;
301
+
302
+ export declare interface ValidatePreCheckoutOptions {
303
+ apollo: ApolloClient<any>;
304
+ emailAddress?: string;
305
+ emailOptIn?: boolean;
306
+ valetInviter?: ValetInviter;
307
+ }
308
+
309
+ export declare enum VerificationState {
310
+ VERIFIED = "verified",
311
+ PENDING = "pending",
312
+ REQUIRED = "required",
313
+ MAY_BE_NEEDED = "may_be_needed",
314
+ NOT_NEEDED = "not_needed"
315
+ }
316
+
317
+ export declare function watchBasketTotals(apollo: ApolloClient<any>): ObservableQuery<BasketTotalsData, any>;
318
+
319
+ export declare function watchShopQuery<TData>(apollo: ApolloClient<any>, options: WatchQueryOptions<any, TData>, maxretries?: number): ObservableQuery<TData, any>;
320
+
321
+ export { }
package/dist/index.js CHANGED
@@ -1,98 +1,51 @@
1
- import {
2
- executeOneTimeCheckout
3
- } from "./chunk-GVVI7X2R.js";
4
- import {
5
- getCheckoutTrackingData,
6
- getFTDStatus,
7
- getReceiptItems,
8
- getReceiptTotals
9
- } from "./chunk-RQNRQ2E5.js";
10
- import {
11
- checkSubscriptionStatus,
12
- executeNewSubscriptionCheckout
13
- } from "./chunk-FC4QW6QA.js";
14
- import {
15
- defaultPaymentTypes,
16
- getClientToken,
17
- useBraintreeDropIn
18
- } from "./chunk-VZ3VDRRP.js";
19
- import {
20
- validatePreCheckout,
21
- validatePreCheckoutMutation
22
- } from "./chunk-KCUOMCSN.js";
23
- import {
24
- applyKivaCredit,
25
- applyPromoCredit,
26
- removeKivaCredit,
27
- removePromoCredit
28
- } from "./chunk-UJXHTR43.js";
29
- import {
30
- setTipDonation
31
- } from "./chunk-Z7JRY3QE.js";
32
- import {
33
- basketTotalsQuery,
34
- watchBasketTotals
35
- } from "./chunk-IIN37LC7.js";
36
- import {
37
- VerificationState,
38
- isBasketVerified
39
- } from "./chunk-FCAOCO7O.js";
40
- import {
41
- getCheckoutStatus,
42
- pollForFinishedCheckout
43
- } from "./chunk-SRGYGDAX.js";
44
- import "./chunk-TPJPGUO7.js";
45
- import {
46
- getPromoFromBasket
47
- } from "./chunk-ASZJVUQ7.js";
48
- import {
49
- callShopMutation,
50
- callShopQuery,
51
- watchShopQuery
52
- } from "./chunk-IOZ5ERDX.js";
53
- import {
54
- createBasket,
55
- getBasketID,
56
- hasBasketExpired,
57
- setBasketID
58
- } from "./chunk-FBF4WMN6.js";
59
- import {
60
- ShopError,
61
- parseShopError
62
- } from "./chunk-4ODZGLWK.js";
63
- import "./chunk-LZ4UMRCV.js";
1
+ import { createBasket as o, getBasketID as r, hasBasketExpired as a, setBasketID as p } from "./basket.js";
2
+ import { applyKivaCredit as s, applyPromoCredit as m, removeKivaCredit as c, removePromoCredit as u } from "./basketCredits.js";
3
+ import { setTipDonation as k } from "./basketItems.js";
4
+ import { basketTotalsQuery as x, watchBasketTotals as h } from "./basketTotals.js";
5
+ import { VerificationState as d, isBasketVerified as C } from "./basketVerification.js";
6
+ import { getCheckoutStatus as g, pollForFinishedCheckout as T } from "./checkoutStatus.js";
7
+ import { getPromoFromBasket as B } from "./managedAccount.js";
8
+ import { executeOneTimeCheckout as P } from "./oneTimeCheckout.js";
9
+ import { getCheckoutTrackingData as F, getFTDStatus as I, getReceiptItems as b, getReceiptTotals as w } from "./receipt.js";
10
+ import { ShopError as K, parseShopError as Q } from "./shopError.js";
11
+ import { callShopMutation as R, callShopQuery as V, watchShopQuery as N } from "./shopQueries.js";
12
+ import { checkSubscriptionStatus as j, executeNewSubscriptionCheckout as q } from "./subscriptionCheckout.js";
13
+ import { defaultPaymentTypes as A, getClientToken as G, default as H } from "./useBraintreeDropIn.js";
14
+ import { validatePreCheckout as L, validatePreCheckoutMutation as U } from "./validatePreCheckout.js";
15
+ import { default as X } from "./components/KvPaymentSelect.js";
64
16
  export {
65
- ShopError,
66
- VerificationState,
67
- applyKivaCredit,
68
- applyPromoCredit,
69
- basketTotalsQuery,
70
- callShopMutation,
71
- callShopQuery,
72
- checkSubscriptionStatus,
73
- createBasket,
74
- defaultPaymentTypes,
75
- executeNewSubscriptionCheckout,
76
- executeOneTimeCheckout,
77
- getBasketID,
78
- getCheckoutStatus,
79
- getCheckoutTrackingData,
80
- getClientToken,
81
- getFTDStatus,
82
- getPromoFromBasket,
83
- getReceiptItems,
84
- getReceiptTotals,
85
- hasBasketExpired,
86
- isBasketVerified,
87
- parseShopError,
88
- pollForFinishedCheckout,
89
- removeKivaCredit,
90
- removePromoCredit,
91
- setBasketID,
92
- setTipDonation,
93
- useBraintreeDropIn,
94
- validatePreCheckout,
95
- validatePreCheckoutMutation,
96
- watchBasketTotals,
97
- watchShopQuery
17
+ X as KvPaymentSelect,
18
+ K as ShopError,
19
+ d as VerificationState,
20
+ s as applyKivaCredit,
21
+ m as applyPromoCredit,
22
+ x as basketTotalsQuery,
23
+ R as callShopMutation,
24
+ V as callShopQuery,
25
+ j as checkSubscriptionStatus,
26
+ o as createBasket,
27
+ A as defaultPaymentTypes,
28
+ q as executeNewSubscriptionCheckout,
29
+ P as executeOneTimeCheckout,
30
+ r as getBasketID,
31
+ g as getCheckoutStatus,
32
+ F as getCheckoutTrackingData,
33
+ G as getClientToken,
34
+ I as getFTDStatus,
35
+ B as getPromoFromBasket,
36
+ b as getReceiptItems,
37
+ w as getReceiptTotals,
38
+ a as hasBasketExpired,
39
+ C as isBasketVerified,
40
+ Q as parseShopError,
41
+ T as pollForFinishedCheckout,
42
+ c as removeKivaCredit,
43
+ u as removePromoCredit,
44
+ p as setBasketID,
45
+ k as setTipDonation,
46
+ H as useBraintreeDropIn,
47
+ L as validatePreCheckout,
48
+ U as validatePreCheckoutMutation,
49
+ h as watchBasketTotals,
50
+ N as watchShopQuery
98
51
  };
@@ -1,10 +1,64 @@
1
- import {
2
- getPromoFromBasket
3
- } from "./chunk-ASZJVUQ7.js";
4
- import "./chunk-IOZ5ERDX.js";
5
- import "./chunk-FBF4WMN6.js";
6
- import "./chunk-4ODZGLWK.js";
7
- import "./chunk-LZ4UMRCV.js";
1
+ import { gql as i } from "@apollo/client";
2
+ import { callShopQuery as l } from "./shopQueries.js";
3
+ async function c(d, e) {
4
+ var r, a;
5
+ return !((r = e == null ? void 0 : e.variables) != null && r.promoFundId) && !((a = e == null ? void 0 : e.variables) != null && a.basketId) ? Promise.resolve({ error: "promoFundId or basketId variable required" }) : await l(d, {
6
+ variables: { ...e == null ? void 0 : e.variables },
7
+ query: i`
8
+ query promoCampaign($basketId: String, $promoFundId: String) {
9
+ shop (basketId: $basketId) {
10
+ id
11
+ promoCampaign (promoFundId: $promoFundId) {
12
+ promoFund {
13
+ id
14
+ displayName
15
+ displayDescription
16
+ promoPrice
17
+ }
18
+ promoGroup {
19
+ id
20
+ type
21
+ teamId
22
+ }
23
+ managedAccount {
24
+ managementType
25
+ audience
26
+ allowDonations
27
+ sendKivaNewsletter
28
+ id
29
+ isEmployee
30
+ formId
31
+ pageId
32
+ loanSearchCriteria {
33
+ filters {
34
+ cityState
35
+ country
36
+ currencyLossPossible
37
+ dafEligible
38
+ distributionModel
39
+ status
40
+ excludeNonRated
41
+ expiringSoon
42
+ gender
43
+ hasResearchScore
44
+ isGroup
45
+ lenderFavorite
46
+ loanLimit
47
+ isMatched
48
+ sector
49
+ loanTags
50
+ theme
51
+ }
52
+ sortBy
53
+ }
54
+ }
55
+ }
56
+ }
57
+ }
58
+ `,
59
+ fetchPolicy: (e == null ? void 0 : e.fetchPolicy) ?? "network-only"
60
+ }, 0);
61
+ }
8
62
  export {
9
- getPromoFromBasket
63
+ c as getPromoFromBasket
10
64
  };