react-native-purchases 9.1.0 → 9.2.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.
- package/RNPurchases.podspec +1 -1
- package/android/build.gradle +3 -3
- package/android/src/main/java/com/revenuecat/purchases/react/RNPurchasesModule.java +1 -1
- package/dist/{preview → browser}/nativeModule.d.ts +39 -40
- package/dist/{preview → browser}/nativeModule.js +218 -160
- package/dist/browser/typeGuards.d.ts +23 -0
- package/dist/browser/typeGuards.js +61 -0
- package/dist/browser/utils.d.ts +6 -0
- package/dist/browser/utils.js +18 -0
- package/dist/purchases.d.ts +0 -1
- package/dist/purchases.js +5 -78
- package/dist/utils/environment.d.ts +5 -1
- package/dist/utils/environment.js +6 -5
- package/ios/RNPurchases.m +1 -1
- package/package.json +7 -2
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CustomerInfo, MakePurchaseResult, PurchasesOffering, PurchasesOfferings } from '@revenuecat/purchases-typescript-internal';
|
|
2
|
+
/**
|
|
3
|
+
* Type guard function type - returns true if value matches type T
|
|
4
|
+
*/
|
|
5
|
+
type TypeGuard<T> = (value: any) => value is T;
|
|
6
|
+
/**
|
|
7
|
+
* Type-safe transformation function that validates purchases-js output matches expected type
|
|
8
|
+
* @param value - The value from purchases-js
|
|
9
|
+
* @param typeGuard - Runtime type guard function that validates the structure
|
|
10
|
+
* @param typeName - String description of expected type for logging
|
|
11
|
+
* @returns The value cast to expected type T
|
|
12
|
+
* @throws {Error} If type validation fails
|
|
13
|
+
*/
|
|
14
|
+
export declare function validateAndTransform<T>(value: any, typeGuard: TypeGuard<T>, typeName: string): T;
|
|
15
|
+
export declare function isCustomerInfo(value: any): value is CustomerInfo;
|
|
16
|
+
export declare function isPurchasesOfferings(value: any): value is PurchasesOfferings;
|
|
17
|
+
export declare function isPurchasesOffering(value: any): value is PurchasesOffering;
|
|
18
|
+
export declare function isLogInResult(value: any): value is {
|
|
19
|
+
customerInfo: CustomerInfo;
|
|
20
|
+
created: boolean;
|
|
21
|
+
};
|
|
22
|
+
export declare function isMakePurchaseResult(value: any): value is MakePurchaseResult;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isMakePurchaseResult = exports.isLogInResult = exports.isPurchasesOffering = exports.isPurchasesOfferings = exports.isCustomerInfo = exports.validateAndTransform = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Type-safe transformation function that validates purchases-js output matches expected type
|
|
6
|
+
* @param value - The value from purchases-js
|
|
7
|
+
* @param typeGuard - Runtime type guard function that validates the structure
|
|
8
|
+
* @param typeName - String description of expected type for logging
|
|
9
|
+
* @returns The value cast to expected type T
|
|
10
|
+
* @throws {Error} If type validation fails
|
|
11
|
+
*/
|
|
12
|
+
function validateAndTransform(value, typeGuard, typeName) {
|
|
13
|
+
if (value === null || value === undefined) {
|
|
14
|
+
if (typeName.includes('null')) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
console.error("Type validation failed: Expected ".concat(typeName, ", got ").concat(value));
|
|
18
|
+
throw new Error("Type validation failed: Expected ".concat(typeName, ", got ").concat(value));
|
|
19
|
+
}
|
|
20
|
+
if (typeGuard(value)) {
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
console.error("Type validation failed: Expected ".concat(typeName, ", got:"), value);
|
|
24
|
+
throw new Error("Type validation failed: Expected ".concat(typeName, ", received invalid structure"));
|
|
25
|
+
}
|
|
26
|
+
exports.validateAndTransform = validateAndTransform;
|
|
27
|
+
// Type guards for the interfaces we use
|
|
28
|
+
function isCustomerInfo(value) {
|
|
29
|
+
return value && typeof value === 'object' &&
|
|
30
|
+
typeof value.originalAppUserId === 'string' &&
|
|
31
|
+
typeof value.entitlements === 'object';
|
|
32
|
+
}
|
|
33
|
+
exports.isCustomerInfo = isCustomerInfo;
|
|
34
|
+
function isPurchasesOfferings(value) {
|
|
35
|
+
return value && typeof value === 'object' &&
|
|
36
|
+
typeof value.all === 'object' &&
|
|
37
|
+
(value.current === null || typeof value.current === 'object');
|
|
38
|
+
}
|
|
39
|
+
exports.isPurchasesOfferings = isPurchasesOfferings;
|
|
40
|
+
function isPurchasesOffering(value) {
|
|
41
|
+
return value && typeof value === 'object' &&
|
|
42
|
+
typeof value.identifier === 'string' &&
|
|
43
|
+
typeof value.serverDescription === 'string' &&
|
|
44
|
+
Array.isArray(value.availablePackages);
|
|
45
|
+
}
|
|
46
|
+
exports.isPurchasesOffering = isPurchasesOffering;
|
|
47
|
+
function isLogInResult(value) {
|
|
48
|
+
return value && typeof value === 'object' &&
|
|
49
|
+
typeof value.customerInfo === 'object' &&
|
|
50
|
+
typeof value.created === 'boolean' &&
|
|
51
|
+
isCustomerInfo(value.customerInfo);
|
|
52
|
+
}
|
|
53
|
+
exports.isLogInResult = isLogInResult;
|
|
54
|
+
function isMakePurchaseResult(value) {
|
|
55
|
+
return value && typeof value === 'object' &&
|
|
56
|
+
typeof value.productIdentifier === 'string' &&
|
|
57
|
+
typeof value.customerInfo === 'object' &&
|
|
58
|
+
isCustomerInfo(value.customerInfo) &&
|
|
59
|
+
typeof value.transaction === 'object';
|
|
60
|
+
}
|
|
61
|
+
exports.isMakePurchaseResult = isMakePurchaseResult;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper function to ensure PurchasesCommon is configured before making API calls
|
|
3
|
+
* @throws {Error} If PurchasesCommon is not configured
|
|
4
|
+
*/
|
|
5
|
+
export declare function ensurePurchasesConfigured(): void;
|
|
6
|
+
export declare function methodNotSupportedOnWeb(methodName: string): void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.methodNotSupportedOnWeb = exports.ensurePurchasesConfigured = void 0;
|
|
4
|
+
var purchases_js_hybrid_mappings_1 = require("@revenuecat/purchases-js-hybrid-mappings");
|
|
5
|
+
/**
|
|
6
|
+
* Helper function to ensure PurchasesCommon is configured before making API calls
|
|
7
|
+
* @throws {Error} If PurchasesCommon is not configured
|
|
8
|
+
*/
|
|
9
|
+
function ensurePurchasesConfigured() {
|
|
10
|
+
if (!purchases_js_hybrid_mappings_1.PurchasesCommon.isConfigured()) {
|
|
11
|
+
throw new Error('PurchasesCommon is not configured. Call setupPurchases first.');
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.ensurePurchasesConfigured = ensurePurchasesConfigured;
|
|
15
|
+
function methodNotSupportedOnWeb(methodName) {
|
|
16
|
+
throw new Error("".concat(methodName, " is not supported on web platform."));
|
|
17
|
+
}
|
|
18
|
+
exports.methodNotSupportedOnWeb = methodNotSupportedOnWeb;
|
package/dist/purchases.d.ts
CHANGED
|
@@ -814,7 +814,6 @@ export default class Purchases {
|
|
|
814
814
|
*/
|
|
815
815
|
static isConfigured(): Promise<boolean>;
|
|
816
816
|
private static throwIfNotConfigured;
|
|
817
|
-
private static logWarningIfPreviewAPIMode;
|
|
818
817
|
private static throwIfAndroidPlatform;
|
|
819
818
|
private static throwIfIOSPlatform;
|
|
820
819
|
private static isPurchasesAreCompletedByMyApp;
|
package/dist/purchases.js
CHANGED
|
@@ -40,7 +40,7 @@ exports.STOREKIT_VERSION = exports.LOG_LEVEL = exports.REFUND_REQUEST_STATUS = e
|
|
|
40
40
|
var react_native_1 = require("react-native");
|
|
41
41
|
var purchases_typescript_internal_1 = require("@revenuecat/purchases-typescript-internal");
|
|
42
42
|
var environment_1 = require("./utils/environment");
|
|
43
|
-
var nativeModule_1 = require("./
|
|
43
|
+
var nativeModule_1 = require("./browser/nativeModule");
|
|
44
44
|
// This export is kept to keep backwards compatibility to any possible users using this file directly
|
|
45
45
|
var purchases_typescript_internal_2 = require("@revenuecat/purchases-typescript-internal");
|
|
46
46
|
Object.defineProperty(exports, "PURCHASE_TYPE", { enumerable: true, get: function () { return purchases_typescript_internal_2.PURCHASE_TYPE; } });
|
|
@@ -50,10 +50,10 @@ Object.defineProperty(exports, "REFUND_REQUEST_STATUS", { enumerable: true, get:
|
|
|
50
50
|
Object.defineProperty(exports, "LOG_LEVEL", { enumerable: true, get: function () { return purchases_typescript_internal_2.LOG_LEVEL; } });
|
|
51
51
|
Object.defineProperty(exports, "STOREKIT_VERSION", { enumerable: true, get: function () { return purchases_typescript_internal_2.STOREKIT_VERSION; } });
|
|
52
52
|
var react_native_2 = require("react-native");
|
|
53
|
-
// Get the native module or use the
|
|
54
|
-
var
|
|
55
|
-
var RNPurchases =
|
|
56
|
-
var eventEmitter =
|
|
53
|
+
// Get the native module or use the browser implementation
|
|
54
|
+
var usingBrowserMode = (0, environment_1.shouldUseBrowserMode)();
|
|
55
|
+
var RNPurchases = usingBrowserMode ? nativeModule_1.browserNativeModuleRNPurchases : react_native_1.NativeModules.RNPurchases;
|
|
56
|
+
var eventEmitter = usingBrowserMode ? null : new react_native_1.NativeEventEmitter(RNPurchases);
|
|
57
57
|
var customerInfoUpdateListeners = [];
|
|
58
58
|
var shouldPurchasePromoProductListeners = [];
|
|
59
59
|
var customLogHandler;
|
|
@@ -143,10 +143,6 @@ var Purchases = /** @class */ (function () {
|
|
|
143
143
|
console.warn("Warning: You should provide the specific StoreKit version you're using in your implementation when configuring PURCHASES_ARE_COMPLETED_BY_TYPE.MY_APP, and not rely on the DEFAULT.");
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
if (usingPreviewAPIMode) {
|
|
147
|
-
// tslint:disable-next-line:no-console
|
|
148
|
-
console.warn("[RevenueCat] [configure], You successfully installed the RevenueCat SDK. However, it's currently running in Preview API mode because it requires some native modules that are not available in Expo Go. All the APIs are available but have no effect. Please, use a development build to test the real behavior of the RevenueCat SDK.");
|
|
149
|
-
}
|
|
150
146
|
RNPurchases.setupPurchases(apiKey, appUserID, purchasesCompletedByToUse, userDefaultsSuiteName, storeKitVersionToUse, useAmazon, shouldShowInAppMessagesAutomatically, entitlementVerificationMode, pendingTransactionsForPrepaidPlansEnabled, diagnosticsEnabled);
|
|
151
147
|
};
|
|
152
148
|
/**
|
|
@@ -166,7 +162,6 @@ var Purchases = /** @class */ (function () {
|
|
|
166
162
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
167
163
|
case 1:
|
|
168
164
|
_a.sent();
|
|
169
|
-
Purchases.logWarningIfPreviewAPIMode('setAllowSharingStoreAccount');
|
|
170
165
|
RNPurchases.setAllowSharingStoreAccount(allowSharing);
|
|
171
166
|
return [2 /*return*/];
|
|
172
167
|
}
|
|
@@ -252,7 +247,6 @@ var Purchases = /** @class */ (function () {
|
|
|
252
247
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
253
248
|
case 1:
|
|
254
249
|
_a.sent();
|
|
255
|
-
Purchases.logWarningIfPreviewAPIMode('getOfferings');
|
|
256
250
|
return [2 /*return*/, RNPurchases.getOfferings()];
|
|
257
251
|
}
|
|
258
252
|
});
|
|
@@ -272,7 +266,6 @@ var Purchases = /** @class */ (function () {
|
|
|
272
266
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
273
267
|
case 1:
|
|
274
268
|
_a.sent();
|
|
275
|
-
Purchases.logWarningIfPreviewAPIMode('getCurrentOfferingForPlacement');
|
|
276
269
|
return [2 /*return*/, RNPurchases.getCurrentOfferingForPlacement(placementIdentifier)];
|
|
277
270
|
}
|
|
278
271
|
});
|
|
@@ -292,7 +285,6 @@ var Purchases = /** @class */ (function () {
|
|
|
292
285
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
293
286
|
case 1:
|
|
294
287
|
_a.sent();
|
|
295
|
-
Purchases.logWarningIfPreviewAPIMode('syncAttributesAndOfferingsIfNeeded');
|
|
296
288
|
return [2 /*return*/, RNPurchases.syncAttributesAndOfferingsIfNeeded()];
|
|
297
289
|
}
|
|
298
290
|
});
|
|
@@ -315,7 +307,6 @@ var Purchases = /** @class */ (function () {
|
|
|
315
307
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
316
308
|
case 1:
|
|
317
309
|
_a.sent();
|
|
318
|
-
Purchases.logWarningIfPreviewAPIMode('getProducts');
|
|
319
310
|
return [2 /*return*/, RNPurchases.getProductInfo(productIdentifiers, type)];
|
|
320
311
|
}
|
|
321
312
|
});
|
|
@@ -338,7 +329,6 @@ var Purchases = /** @class */ (function () {
|
|
|
338
329
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
339
330
|
case 1:
|
|
340
331
|
_a.sent();
|
|
341
|
-
Purchases.logWarningIfPreviewAPIMode('purchaseProduct');
|
|
342
332
|
return [2 /*return*/, RNPurchases.purchaseProduct(productIdentifier, upgradeInfo, type, null, null, null).catch(function (error) {
|
|
343
333
|
error.userCancelled =
|
|
344
334
|
error.code === purchases_typescript_internal_1.PURCHASES_ERROR_CODE.PURCHASE_CANCELLED_ERROR;
|
|
@@ -369,7 +359,6 @@ var Purchases = /** @class */ (function () {
|
|
|
369
359
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
370
360
|
case 1:
|
|
371
361
|
_a.sent();
|
|
372
|
-
Purchases.logWarningIfPreviewAPIMode('purchaseStoreProduct');
|
|
373
362
|
return [2 /*return*/, RNPurchases.purchaseProduct(product.identifier, googleProductChangeInfo, product.productCategory, null, googleIsPersonalizedPrice == null
|
|
374
363
|
? null
|
|
375
364
|
: { isPersonalizedPrice: googleIsPersonalizedPrice }, product.presentedOfferingContext).catch(function (error) {
|
|
@@ -401,7 +390,6 @@ var Purchases = /** @class */ (function () {
|
|
|
401
390
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
402
391
|
case 1:
|
|
403
392
|
_a.sent();
|
|
404
|
-
Purchases.logWarningIfPreviewAPIMode('purchaseDiscountedProduct');
|
|
405
393
|
if (typeof discount === "undefined" || discount == null) {
|
|
406
394
|
throw new Error("A discount is required");
|
|
407
395
|
}
|
|
@@ -436,7 +424,6 @@ var Purchases = /** @class */ (function () {
|
|
|
436
424
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
437
425
|
case 1:
|
|
438
426
|
_a.sent();
|
|
439
|
-
Purchases.logWarningIfPreviewAPIMode('purchasePackage');
|
|
440
427
|
return [2 /*return*/, RNPurchases.purchasePackage(aPackage.identifier, aPackage.presentedOfferingContext, googleProductChangeInfo || upgradeInfo, null, googleIsPersonalizedPrice == null
|
|
441
428
|
? null
|
|
442
429
|
: { isPersonalizedPrice: googleIsPersonalizedPrice }).catch(function (error) {
|
|
@@ -469,7 +456,6 @@ var Purchases = /** @class */ (function () {
|
|
|
469
456
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
470
457
|
case 1:
|
|
471
458
|
_a.sent();
|
|
472
|
-
Purchases.logWarningIfPreviewAPIMode('purchaseSubscriptionOption');
|
|
473
459
|
return [4 /*yield*/, Purchases.throwIfIOSPlatform()];
|
|
474
460
|
case 2:
|
|
475
461
|
_a.sent();
|
|
@@ -501,7 +487,6 @@ var Purchases = /** @class */ (function () {
|
|
|
501
487
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
502
488
|
case 1:
|
|
503
489
|
_a.sent();
|
|
504
|
-
Purchases.logWarningIfPreviewAPIMode('purchaseDiscountedPackage');
|
|
505
490
|
if (typeof discount === "undefined" || discount == null) {
|
|
506
491
|
throw new Error("A discount is required");
|
|
507
492
|
}
|
|
@@ -526,7 +511,6 @@ var Purchases = /** @class */ (function () {
|
|
|
526
511
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
527
512
|
case 1:
|
|
528
513
|
_a.sent();
|
|
529
|
-
Purchases.logWarningIfPreviewAPIMode('restorePurchases');
|
|
530
514
|
return [2 /*return*/, RNPurchases.restorePurchases()];
|
|
531
515
|
}
|
|
532
516
|
});
|
|
@@ -543,7 +527,6 @@ var Purchases = /** @class */ (function () {
|
|
|
543
527
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
544
528
|
case 1:
|
|
545
529
|
_a.sent();
|
|
546
|
-
Purchases.logWarningIfPreviewAPIMode('getAppUserID');
|
|
547
530
|
return [2 /*return*/, RNPurchases.getAppUserID()];
|
|
548
531
|
}
|
|
549
532
|
});
|
|
@@ -560,7 +543,6 @@ var Purchases = /** @class */ (function () {
|
|
|
560
543
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
561
544
|
case 1:
|
|
562
545
|
_a.sent();
|
|
563
|
-
Purchases.logWarningIfPreviewAPIMode('getStorefront');
|
|
564
546
|
return [2 /*return*/, RNPurchases.getStorefront()];
|
|
565
547
|
}
|
|
566
548
|
});
|
|
@@ -581,7 +563,6 @@ var Purchases = /** @class */ (function () {
|
|
|
581
563
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
582
564
|
case 1:
|
|
583
565
|
_a.sent();
|
|
584
|
-
Purchases.logWarningIfPreviewAPIMode('logIn');
|
|
585
566
|
// noinspection SuspiciousTypeOfGuard
|
|
586
567
|
if (typeof appUserID !== "string") {
|
|
587
568
|
throw new Error("appUserID needs to be a string");
|
|
@@ -604,7 +585,6 @@ var Purchases = /** @class */ (function () {
|
|
|
604
585
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
605
586
|
case 1:
|
|
606
587
|
_a.sent();
|
|
607
|
-
Purchases.logWarningIfPreviewAPIMode('logOut');
|
|
608
588
|
return [2 /*return*/, RNPurchases.logOut()];
|
|
609
589
|
}
|
|
610
590
|
});
|
|
@@ -660,7 +640,6 @@ var Purchases = /** @class */ (function () {
|
|
|
660
640
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
661
641
|
case 1:
|
|
662
642
|
_a.sent();
|
|
663
|
-
Purchases.logWarningIfPreviewAPIMode('getCustomerInfo');
|
|
664
643
|
return [2 /*return*/, RNPurchases.getCustomerInfo()];
|
|
665
644
|
}
|
|
666
645
|
});
|
|
@@ -681,7 +660,6 @@ var Purchases = /** @class */ (function () {
|
|
|
681
660
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
682
661
|
case 1:
|
|
683
662
|
_a.sent();
|
|
684
|
-
Purchases.logWarningIfPreviewAPIMode('syncPurchases');
|
|
685
663
|
RNPurchases.syncPurchases();
|
|
686
664
|
return [2 /*return*/];
|
|
687
665
|
}
|
|
@@ -712,7 +690,6 @@ var Purchases = /** @class */ (function () {
|
|
|
712
690
|
return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
713
691
|
case 2:
|
|
714
692
|
_a.sent();
|
|
715
|
-
Purchases.logWarningIfPreviewAPIMode('syncAmazonPurchase');
|
|
716
693
|
RNPurchases.syncAmazonPurchase(productID, receiptID, amazonUserID, isoCurrencyCode, price);
|
|
717
694
|
return [2 /*return*/];
|
|
718
695
|
}
|
|
@@ -745,7 +722,6 @@ var Purchases = /** @class */ (function () {
|
|
|
745
722
|
return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
746
723
|
case 2:
|
|
747
724
|
_a.sent();
|
|
748
|
-
Purchases.logWarningIfPreviewAPIMode('syncObserverModeAmazonPurchase');
|
|
749
725
|
RNPurchases.syncObserverModeAmazonPurchase(productID, receiptID, amazonUserID, isoCurrencyCode, price);
|
|
750
726
|
return [2 /*return*/];
|
|
751
727
|
}
|
|
@@ -777,7 +753,6 @@ var Purchases = /** @class */ (function () {
|
|
|
777
753
|
return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
778
754
|
case 2:
|
|
779
755
|
_a.sent();
|
|
780
|
-
Purchases.logWarningIfPreviewAPIMode('recordPurchase');
|
|
781
756
|
return [2 /*return*/, RNPurchases.recordPurchaseForProductID(productID)];
|
|
782
757
|
}
|
|
783
758
|
});
|
|
@@ -796,7 +771,6 @@ var Purchases = /** @class */ (function () {
|
|
|
796
771
|
return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
797
772
|
case 1:
|
|
798
773
|
_a.sent();
|
|
799
|
-
Purchases.logWarningIfPreviewAPIMode('enableAdServicesAttributionTokenCollection');
|
|
800
774
|
RNPurchases.enableAdServicesAttributionTokenCollection();
|
|
801
775
|
_a.label = 2;
|
|
802
776
|
case 2: return [2 /*return*/];
|
|
@@ -815,7 +789,6 @@ var Purchases = /** @class */ (function () {
|
|
|
815
789
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
816
790
|
case 1:
|
|
817
791
|
_a.sent();
|
|
818
|
-
Purchases.logWarningIfPreviewAPIMode('isAnonymous');
|
|
819
792
|
return [2 /*return*/, RNPurchases.isAnonymous()];
|
|
820
793
|
}
|
|
821
794
|
});
|
|
@@ -843,7 +816,6 @@ var Purchases = /** @class */ (function () {
|
|
|
843
816
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
844
817
|
case 1:
|
|
845
818
|
_a.sent();
|
|
846
|
-
Purchases.logWarningIfPreviewAPIMode('checkTrialOrIntroductoryPriceEligibility');
|
|
847
819
|
return [2 /*return*/, RNPurchases.checkTrialOrIntroductoryPriceEligibility(productIdentifiers)];
|
|
848
820
|
}
|
|
849
821
|
});
|
|
@@ -865,7 +837,6 @@ var Purchases = /** @class */ (function () {
|
|
|
865
837
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
866
838
|
case 1:
|
|
867
839
|
_a.sent();
|
|
868
|
-
Purchases.logWarningIfPreviewAPIMode('getPromotionalOffer');
|
|
869
840
|
if (react_native_2.Platform.OS === "android") {
|
|
870
841
|
return [2 /*return*/, Promise.resolve(undefined)];
|
|
871
842
|
}
|
|
@@ -893,7 +864,6 @@ var Purchases = /** @class */ (function () {
|
|
|
893
864
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
894
865
|
case 1:
|
|
895
866
|
_a.sent();
|
|
896
|
-
Purchases.logWarningIfPreviewAPIMode('getEligibleWinBackOffersForProduct');
|
|
897
867
|
if (react_native_2.Platform.OS === "android") {
|
|
898
868
|
return [2 /*return*/, Promise.resolve(undefined)];
|
|
899
869
|
}
|
|
@@ -918,7 +888,6 @@ var Purchases = /** @class */ (function () {
|
|
|
918
888
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
919
889
|
case 1:
|
|
920
890
|
_a.sent();
|
|
921
|
-
Purchases.logWarningIfPreviewAPIMode('getEligibleWinBackOffersForPackage');
|
|
922
891
|
if (react_native_2.Platform.OS === "android") {
|
|
923
892
|
return [2 /*return*/, Promise.resolve(undefined)];
|
|
924
893
|
}
|
|
@@ -946,7 +915,6 @@ var Purchases = /** @class */ (function () {
|
|
|
946
915
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
947
916
|
case 1:
|
|
948
917
|
_a.sent();
|
|
949
|
-
Purchases.logWarningIfPreviewAPIMode('purchaseProductWithWinBackOffer');
|
|
950
918
|
if (typeof winBackOffer === "undefined" || winBackOffer == null) {
|
|
951
919
|
throw new Error("A win-back offer is required");
|
|
952
920
|
}
|
|
@@ -981,7 +949,6 @@ var Purchases = /** @class */ (function () {
|
|
|
981
949
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
982
950
|
case 1:
|
|
983
951
|
_a.sent();
|
|
984
|
-
Purchases.logWarningIfPreviewAPIMode('purchasePackageWithWinBackOffer');
|
|
985
952
|
if (typeof winBackOffer === "undefined" || winBackOffer == null) {
|
|
986
953
|
throw new Error("A win-back offer is required");
|
|
987
954
|
}
|
|
@@ -1016,7 +983,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1016
983
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1017
984
|
case 1:
|
|
1018
985
|
_a.sent();
|
|
1019
|
-
Purchases.logWarningIfPreviewAPIMode('invalidateCustomerInfoCache');
|
|
1020
986
|
RNPurchases.invalidateCustomerInfoCache();
|
|
1021
987
|
return [2 /*return*/];
|
|
1022
988
|
}
|
|
@@ -1038,7 +1004,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1038
1004
|
return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1039
1005
|
case 1:
|
|
1040
1006
|
_a.sent();
|
|
1041
|
-
Purchases.logWarningIfPreviewAPIMode('presentCodeRedemptionSheet');
|
|
1042
1007
|
RNPurchases.presentCodeRedemptionSheet();
|
|
1043
1008
|
_a.label = 2;
|
|
1044
1009
|
case 2: return [2 /*return*/];
|
|
@@ -1065,7 +1030,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1065
1030
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1066
1031
|
case 1:
|
|
1067
1032
|
_a.sent();
|
|
1068
|
-
Purchases.logWarningIfPreviewAPIMode('setAttributes');
|
|
1069
1033
|
RNPurchases.setAttributes(attributes);
|
|
1070
1034
|
return [2 /*return*/];
|
|
1071
1035
|
}
|
|
@@ -1086,7 +1050,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1086
1050
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1087
1051
|
case 1:
|
|
1088
1052
|
_a.sent();
|
|
1089
|
-
Purchases.logWarningIfPreviewAPIMode('setEmail');
|
|
1090
1053
|
RNPurchases.setEmail(email);
|
|
1091
1054
|
return [2 /*return*/];
|
|
1092
1055
|
}
|
|
@@ -1107,7 +1070,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1107
1070
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1108
1071
|
case 1:
|
|
1109
1072
|
_a.sent();
|
|
1110
|
-
Purchases.logWarningIfPreviewAPIMode('setPhoneNumber');
|
|
1111
1073
|
RNPurchases.setPhoneNumber(phoneNumber);
|
|
1112
1074
|
return [2 /*return*/];
|
|
1113
1075
|
}
|
|
@@ -1128,7 +1090,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1128
1090
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1129
1091
|
case 1:
|
|
1130
1092
|
_a.sent();
|
|
1131
|
-
Purchases.logWarningIfPreviewAPIMode('setDisplayName');
|
|
1132
1093
|
RNPurchases.setDisplayName(displayName);
|
|
1133
1094
|
return [2 /*return*/];
|
|
1134
1095
|
}
|
|
@@ -1149,7 +1110,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1149
1110
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1150
1111
|
case 1:
|
|
1151
1112
|
_a.sent();
|
|
1152
|
-
Purchases.logWarningIfPreviewAPIMode('setPushToken');
|
|
1153
1113
|
RNPurchases.setPushToken(pushToken);
|
|
1154
1114
|
return [2 /*return*/];
|
|
1155
1115
|
}
|
|
@@ -1182,7 +1142,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1182
1142
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1183
1143
|
case 1:
|
|
1184
1144
|
_a.sent();
|
|
1185
|
-
Purchases.logWarningIfPreviewAPIMode('collectDeviceIdentifiers');
|
|
1186
1145
|
RNPurchases.collectDeviceIdentifiers();
|
|
1187
1146
|
return [2 /*return*/];
|
|
1188
1147
|
}
|
|
@@ -1204,7 +1163,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1204
1163
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1205
1164
|
case 1:
|
|
1206
1165
|
_a.sent();
|
|
1207
|
-
Purchases.logWarningIfPreviewAPIMode('setAdjustID');
|
|
1208
1166
|
RNPurchases.setAdjustID(adjustID);
|
|
1209
1167
|
return [2 /*return*/];
|
|
1210
1168
|
}
|
|
@@ -1225,7 +1183,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1225
1183
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1226
1184
|
case 1:
|
|
1227
1185
|
_a.sent();
|
|
1228
|
-
Purchases.logWarningIfPreviewAPIMode('setAppsflyerID');
|
|
1229
1186
|
RNPurchases.setAppsflyerID(appsflyerID);
|
|
1230
1187
|
return [2 /*return*/];
|
|
1231
1188
|
}
|
|
@@ -1247,7 +1204,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1247
1204
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1248
1205
|
case 1:
|
|
1249
1206
|
_a.sent();
|
|
1250
|
-
Purchases.logWarningIfPreviewAPIMode('setFBAnonymousID');
|
|
1251
1207
|
RNPurchases.setFBAnonymousID(fbAnonymousID);
|
|
1252
1208
|
return [2 /*return*/];
|
|
1253
1209
|
}
|
|
@@ -1269,7 +1225,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1269
1225
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1270
1226
|
case 1:
|
|
1271
1227
|
_a.sent();
|
|
1272
|
-
Purchases.logWarningIfPreviewAPIMode('setMparticleID');
|
|
1273
1228
|
RNPurchases.setMparticleID(mparticleID);
|
|
1274
1229
|
return [2 /*return*/];
|
|
1275
1230
|
}
|
|
@@ -1291,7 +1246,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1291
1246
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1292
1247
|
case 1:
|
|
1293
1248
|
_a.sent();
|
|
1294
|
-
Purchases.logWarningIfPreviewAPIMode('setCleverTapID');
|
|
1295
1249
|
RNPurchases.setCleverTapID(cleverTapID);
|
|
1296
1250
|
return [2 /*return*/];
|
|
1297
1251
|
}
|
|
@@ -1313,7 +1267,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1313
1267
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1314
1268
|
case 1:
|
|
1315
1269
|
_a.sent();
|
|
1316
|
-
Purchases.logWarningIfPreviewAPIMode('setMixpanelDistinctID');
|
|
1317
1270
|
RNPurchases.setMixpanelDistinctID(mixpanelDistinctID);
|
|
1318
1271
|
return [2 /*return*/];
|
|
1319
1272
|
}
|
|
@@ -1335,7 +1288,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1335
1288
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1336
1289
|
case 1:
|
|
1337
1290
|
_a.sent();
|
|
1338
|
-
Purchases.logWarningIfPreviewAPIMode('setFirebaseAppInstanceID');
|
|
1339
1291
|
RNPurchases.setFirebaseAppInstanceID(firebaseAppInstanceID);
|
|
1340
1292
|
return [2 /*return*/];
|
|
1341
1293
|
}
|
|
@@ -1357,7 +1309,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1357
1309
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1358
1310
|
case 1:
|
|
1359
1311
|
_a.sent();
|
|
1360
|
-
Purchases.logWarningIfPreviewAPIMode('setTenjinAnalyticsInstallationID');
|
|
1361
1312
|
RNPurchases.setTenjinAnalyticsInstallationID(tenjinAnalyticsInstallationID);
|
|
1362
1313
|
return [2 /*return*/];
|
|
1363
1314
|
}
|
|
@@ -1379,7 +1330,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1379
1330
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1380
1331
|
case 1:
|
|
1381
1332
|
_a.sent();
|
|
1382
|
-
Purchases.logWarningIfPreviewAPIMode('setKochavaDeviceID');
|
|
1383
1333
|
RNPurchases.setKochavaDeviceID(kochavaDeviceID);
|
|
1384
1334
|
return [2 /*return*/];
|
|
1385
1335
|
}
|
|
@@ -1401,7 +1351,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1401
1351
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1402
1352
|
case 1:
|
|
1403
1353
|
_a.sent();
|
|
1404
|
-
Purchases.logWarningIfPreviewAPIMode('setOnesignalID');
|
|
1405
1354
|
RNPurchases.setOnesignalID(onesignalID);
|
|
1406
1355
|
return [2 /*return*/];
|
|
1407
1356
|
}
|
|
@@ -1423,7 +1372,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1423
1372
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1424
1373
|
case 1:
|
|
1425
1374
|
_a.sent();
|
|
1426
|
-
Purchases.logWarningIfPreviewAPIMode('setAirshipChannelID');
|
|
1427
1375
|
RNPurchases.setAirshipChannelID(airshipChannelID);
|
|
1428
1376
|
return [2 /*return*/];
|
|
1429
1377
|
}
|
|
@@ -1444,7 +1392,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1444
1392
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1445
1393
|
case 1:
|
|
1446
1394
|
_a.sent();
|
|
1447
|
-
Purchases.logWarningIfPreviewAPIMode('setMediaSource');
|
|
1448
1395
|
RNPurchases.setMediaSource(mediaSource);
|
|
1449
1396
|
return [2 /*return*/];
|
|
1450
1397
|
}
|
|
@@ -1465,7 +1412,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1465
1412
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1466
1413
|
case 1:
|
|
1467
1414
|
_a.sent();
|
|
1468
|
-
Purchases.logWarningIfPreviewAPIMode('setCampaign');
|
|
1469
1415
|
RNPurchases.setCampaign(campaign);
|
|
1470
1416
|
return [2 /*return*/];
|
|
1471
1417
|
}
|
|
@@ -1486,7 +1432,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1486
1432
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1487
1433
|
case 1:
|
|
1488
1434
|
_a.sent();
|
|
1489
|
-
Purchases.logWarningIfPreviewAPIMode('setAdGroup');
|
|
1490
1435
|
RNPurchases.setAdGroup(adGroup);
|
|
1491
1436
|
return [2 /*return*/];
|
|
1492
1437
|
}
|
|
@@ -1507,7 +1452,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1507
1452
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1508
1453
|
case 1:
|
|
1509
1454
|
_a.sent();
|
|
1510
|
-
Purchases.logWarningIfPreviewAPIMode('setAd');
|
|
1511
1455
|
RNPurchases.setAd(ad);
|
|
1512
1456
|
return [2 /*return*/];
|
|
1513
1457
|
}
|
|
@@ -1528,7 +1472,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1528
1472
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1529
1473
|
case 1:
|
|
1530
1474
|
_a.sent();
|
|
1531
|
-
Purchases.logWarningIfPreviewAPIMode('setKeyword');
|
|
1532
1475
|
RNPurchases.setKeyword(keyword);
|
|
1533
1476
|
return [2 /*return*/];
|
|
1534
1477
|
}
|
|
@@ -1549,7 +1492,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1549
1492
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1550
1493
|
case 1:
|
|
1551
1494
|
_a.sent();
|
|
1552
|
-
Purchases.logWarningIfPreviewAPIMode('setCreative');
|
|
1553
1495
|
RNPurchases.setCreative(creative);
|
|
1554
1496
|
return [2 /*return*/];
|
|
1555
1497
|
}
|
|
@@ -1594,7 +1536,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1594
1536
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1595
1537
|
case 1:
|
|
1596
1538
|
_a.sent();
|
|
1597
|
-
Purchases.logWarningIfPreviewAPIMode('beginRefundRequestForActiveEntitlement');
|
|
1598
1539
|
return [4 /*yield*/, Purchases.throwIfAndroidPlatform()];
|
|
1599
1540
|
case 2:
|
|
1600
1541
|
_a.sent();
|
|
@@ -1628,7 +1569,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1628
1569
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1629
1570
|
case 1:
|
|
1630
1571
|
_a.sent();
|
|
1631
|
-
Purchases.logWarningIfPreviewAPIMode('beginRefundRequestForEntitlement');
|
|
1632
1572
|
return [4 /*yield*/, Purchases.throwIfAndroidPlatform()];
|
|
1633
1573
|
case 2:
|
|
1634
1574
|
_a.sent();
|
|
@@ -1662,7 +1602,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1662
1602
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1663
1603
|
case 1:
|
|
1664
1604
|
_a.sent();
|
|
1665
|
-
Purchases.logWarningIfPreviewAPIMode('beginRefundRequestForProduct');
|
|
1666
1605
|
return [4 /*yield*/, Purchases.throwIfAndroidPlatform()];
|
|
1667
1606
|
case 2:
|
|
1668
1607
|
_a.sent();
|
|
@@ -1687,7 +1626,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1687
1626
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1688
1627
|
case 1:
|
|
1689
1628
|
_a.sent();
|
|
1690
|
-
Purchases.logWarningIfPreviewAPIMode('showManageSubscriptions');
|
|
1691
1629
|
return [4 /*yield*/, Purchases.throwIfAndroidPlatform()];
|
|
1692
1630
|
case 2:
|
|
1693
1631
|
_a.sent();
|
|
@@ -1714,7 +1652,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1714
1652
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1715
1653
|
case 1:
|
|
1716
1654
|
_a.sent();
|
|
1717
|
-
Purchases.logWarningIfPreviewAPIMode('showInAppMessages');
|
|
1718
1655
|
return [2 /*return*/, RNPurchases.showInAppMessages(messageTypes)];
|
|
1719
1656
|
}
|
|
1720
1657
|
});
|
|
@@ -1748,7 +1685,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1748
1685
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1749
1686
|
case 1:
|
|
1750
1687
|
_a.sent();
|
|
1751
|
-
Purchases.logWarningIfPreviewAPIMode('redeemWebPurchase');
|
|
1752
1688
|
return [2 /*return*/, RNPurchases.redeemWebPurchase(webPurchaseRedemption.redemptionLink)];
|
|
1753
1689
|
}
|
|
1754
1690
|
});
|
|
@@ -1767,7 +1703,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1767
1703
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1768
1704
|
case 1:
|
|
1769
1705
|
_a.sent();
|
|
1770
|
-
Purchases.logWarningIfPreviewAPIMode('getVirtualCurrencies');
|
|
1771
1706
|
return [2 /*return*/, RNPurchases.getVirtualCurrencies()];
|
|
1772
1707
|
}
|
|
1773
1708
|
});
|
|
@@ -1790,7 +1725,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1790
1725
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1791
1726
|
case 1:
|
|
1792
1727
|
_a.sent();
|
|
1793
|
-
Purchases.logWarningIfPreviewAPIMode('invalidateVirtualCurrenciesCache');
|
|
1794
1728
|
RNPurchases.invalidateVirtualCurrenciesCache();
|
|
1795
1729
|
return [2 /*return*/];
|
|
1796
1730
|
}
|
|
@@ -1813,7 +1747,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1813
1747
|
case 0: return [4 /*yield*/, Purchases.throwIfNotConfigured()];
|
|
1814
1748
|
case 1:
|
|
1815
1749
|
_a.sent();
|
|
1816
|
-
Purchases.logWarningIfPreviewAPIMode('getCachedVirtualCurrencies');
|
|
1817
1750
|
return [4 /*yield*/, RNPurchases.getCachedVirtualCurrencies()];
|
|
1818
1751
|
case 2:
|
|
1819
1752
|
result = _a.sent();
|
|
@@ -1846,12 +1779,6 @@ var Purchases = /** @class */ (function () {
|
|
|
1846
1779
|
});
|
|
1847
1780
|
});
|
|
1848
1781
|
};
|
|
1849
|
-
Purchases.logWarningIfPreviewAPIMode = function (methodName) {
|
|
1850
|
-
if (usingPreviewAPIMode) {
|
|
1851
|
-
// tslint:disable-next-line:no-console
|
|
1852
|
-
console.warn("[RevenueCat] [".concat(methodName, "] This method is available but has no effect in Preview API mode."));
|
|
1853
|
-
}
|
|
1854
|
-
};
|
|
1855
1782
|
Purchases.throwIfAndroidPlatform = function () {
|
|
1856
1783
|
return __awaiter(this, void 0, void 0, function () {
|
|
1857
1784
|
return __generator(this, function (_a) {
|