@techstuff-dev/foundation-api-utils 1.49.1 → 1.50.1
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/dist/cjs/chunks/{shared-2Qy1c7Qz.js → shared-xQBEY4BX.js} +2 -2
- package/dist/cjs/chunks/{shared-2Qy1c7Qz.js.map → shared-xQBEY4BX.js.map} +1 -1
- package/dist/cjs/chunks/{slice-DsZzY7T7.js → slice-Cy4kZKn1.js} +266 -49
- package/dist/cjs/chunks/slice-Cy4kZKn1.js.map +1 -0
- package/dist/cjs/index.js +9 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/store/index.native.js +13 -18
- package/dist/cjs/store/index.native.js.map +1 -1
- package/dist/cjs/store/index.web.js +5 -3
- package/dist/cjs/store/index.web.js.map +1 -1
- package/dist/esm/chunks/{shared--CrxBBZ8.js → shared-ykPFVPQ6.js} +2 -2
- package/dist/esm/chunks/{shared--CrxBBZ8.js.map → shared-ykPFVPQ6.js.map} +1 -1
- package/dist/esm/chunks/{slice-3o-PH5Gz.js → slice-qwy3bNV7.js} +259 -50
- package/dist/esm/chunks/slice-qwy3bNV7.js.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/store/index.native.js +13 -18
- package/dist/esm/store/index.native.js.map +1 -1
- package/dist/esm/store/index.web.js +5 -3
- package/dist/esm/store/index.web.js.map +1 -1
- package/dist/types/hooks/index.d.ts +1 -1
- package/dist/types/{index-BDQnFTra.d.ts → index-UQCqBQLx.d.ts} +2 -2
- package/dist/types/index.d.ts +45 -3
- package/dist/types/store/index.d.ts +1 -1
- package/package.json +10 -3
- package/dist/cjs/chunks/index-CfrYa4U_.js +0 -9
- package/dist/cjs/chunks/index-CfrYa4U_.js.map +0 -1
- package/dist/cjs/chunks/slice-DsZzY7T7.js.map +0 -1
- package/dist/esm/chunks/index-KjhWa1AL.js +0 -6
- package/dist/esm/chunks/index-KjhWa1AL.js.map +0 -1
- package/dist/esm/chunks/slice-3o-PH5Gz.js.map +0 -1
|
@@ -4081,8 +4081,8 @@ function useShallowStableValue(value) {
|
|
|
4081
4081
|
var canUseDOM = () => !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined");
|
|
4082
4082
|
var isDOM = /* @__PURE__ */ canUseDOM();
|
|
4083
4083
|
var isRunningInReactNative = () => typeof navigator !== "undefined" && navigator.product === "ReactNative";
|
|
4084
|
-
var isReactNative = /* @__PURE__ */ isRunningInReactNative();
|
|
4085
|
-
var getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? useLayoutEffect : useEffect;
|
|
4084
|
+
var isReactNative$1 = /* @__PURE__ */ isRunningInReactNative();
|
|
4085
|
+
var getUseIsomorphicLayoutEffect = () => isDOM || isReactNative$1 ? useLayoutEffect : useEffect;
|
|
4086
4086
|
var useIsomorphicLayoutEffect = /* @__PURE__ */ getUseIsomorphicLayoutEffect();
|
|
4087
4087
|
var noPendingQueryStateSelector = (selected) => {
|
|
4088
4088
|
if (selected.isUninitialized) {
|
|
@@ -4682,6 +4682,9 @@ Hook ${hookName} was either not provided or not a function.`);
|
|
|
4682
4682
|
// src/query/react/index.ts
|
|
4683
4683
|
var createApi = /* @__PURE__ */ buildCreateApi(coreModule(), reactHooksModule());
|
|
4684
4684
|
|
|
4685
|
+
function onlyUnique(value, index, self) {
|
|
4686
|
+
return self.indexOf(value) === index;
|
|
4687
|
+
}
|
|
4685
4688
|
function applyCoupon(coupon, netTotal) {
|
|
4686
4689
|
const discountedAmount = netTotal * (Number(coupon.discount) / 100);
|
|
4687
4690
|
const discountedTotal = netTotal - discountedAmount;
|
|
@@ -4704,7 +4707,7 @@ function toCamelCaseObject(obj) {
|
|
|
4704
4707
|
};
|
|
4705
4708
|
const camelCaseObject = {};
|
|
4706
4709
|
for (const key in obj) {
|
|
4707
|
-
if (
|
|
4710
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
4708
4711
|
const camelKey = toCamelCase(key);
|
|
4709
4712
|
camelCaseObject[camelKey] = obj[key];
|
|
4710
4713
|
}
|
|
@@ -4969,7 +4972,7 @@ function formatSchedule(data) {
|
|
|
4969
4972
|
return {
|
|
4970
4973
|
end: item?._source?.monday_end?.[index],
|
|
4971
4974
|
start: item?._source?.monday_start?.[index],
|
|
4972
|
-
title
|
|
4975
|
+
title,
|
|
4973
4976
|
video: item?._source?.monday_video?.[index],
|
|
4974
4977
|
live: item?._source?.monday_live?.[index],
|
|
4975
4978
|
};
|
|
@@ -4980,7 +4983,7 @@ function formatSchedule(data) {
|
|
|
4980
4983
|
return {
|
|
4981
4984
|
end: item?._source?.tuesday_end?.[index],
|
|
4982
4985
|
start: item?._source?.tuesday_start?.[index],
|
|
4983
|
-
title
|
|
4986
|
+
title,
|
|
4984
4987
|
video: item?._source?.tuesday_video?.[index],
|
|
4985
4988
|
live: item?._source?.tuesday_live?.[index],
|
|
4986
4989
|
};
|
|
@@ -4991,7 +4994,7 @@ function formatSchedule(data) {
|
|
|
4991
4994
|
return {
|
|
4992
4995
|
end: item?._source?.wednesday_end?.[index],
|
|
4993
4996
|
start: item?._source?.wednesday_start?.[index],
|
|
4994
|
-
title
|
|
4997
|
+
title,
|
|
4995
4998
|
video: item?._source?.wednesday_video?.[index],
|
|
4996
4999
|
live: item?._source?.wednesday_live?.[index],
|
|
4997
5000
|
};
|
|
@@ -5002,7 +5005,7 @@ function formatSchedule(data) {
|
|
|
5002
5005
|
return {
|
|
5003
5006
|
end: item?._source?.thursday_end?.[index],
|
|
5004
5007
|
start: item?._source?.thursday_start?.[index],
|
|
5005
|
-
title
|
|
5008
|
+
title,
|
|
5006
5009
|
video: item?._source?.thursday_video?.[index],
|
|
5007
5010
|
live: item?._source?.thursday_live?.[index],
|
|
5008
5011
|
};
|
|
@@ -5013,7 +5016,7 @@ function formatSchedule(data) {
|
|
|
5013
5016
|
return {
|
|
5014
5017
|
end: item?._source?.friday_end?.[index],
|
|
5015
5018
|
start: item?._source?.friday_start?.[index],
|
|
5016
|
-
title
|
|
5019
|
+
title,
|
|
5017
5020
|
video: item?._source?.friday_video?.[index],
|
|
5018
5021
|
live: item?._source?.friday_live?.[index],
|
|
5019
5022
|
};
|
|
@@ -5024,7 +5027,7 @@ function formatSchedule(data) {
|
|
|
5024
5027
|
return {
|
|
5025
5028
|
end: item?._source?.saturday_end?.[index],
|
|
5026
5029
|
start: item?._source?.saturday_start?.[index],
|
|
5027
|
-
title
|
|
5030
|
+
title,
|
|
5028
5031
|
video: item?._source?.saturday_video?.[index],
|
|
5029
5032
|
live: item?._source?.saturday_live?.[index],
|
|
5030
5033
|
};
|
|
@@ -5035,7 +5038,7 @@ function formatSchedule(data) {
|
|
|
5035
5038
|
return {
|
|
5036
5039
|
end: item?._source?.sunday_end?.[index],
|
|
5037
5040
|
start: item?._source?.sunday_start?.[index],
|
|
5038
|
-
title
|
|
5041
|
+
title,
|
|
5039
5042
|
video: item?._source?.sunday_video?.[index],
|
|
5040
5043
|
live: item?._source?.sunday_live?.[index],
|
|
5041
5044
|
};
|
|
@@ -5315,39 +5318,243 @@ const formatMediaItem = (data) => {
|
|
|
5315
5318
|
});
|
|
5316
5319
|
};
|
|
5317
5320
|
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
process.env?.
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5321
|
+
/**
|
|
5322
|
+
* Platform detection utilities for cross-platform React/React Native applications
|
|
5323
|
+
*/
|
|
5324
|
+
/**
|
|
5325
|
+
* Detects if running in a web environment (Next.js, browser)
|
|
5326
|
+
* Uses multiple checks for robustness
|
|
5327
|
+
*/
|
|
5328
|
+
const isWeb = () => {
|
|
5329
|
+
// Check for explicit web app flag
|
|
5330
|
+
if (typeof process !== 'undefined' && process.env?.NEXT_PUBLIC_WEB_APP) {
|
|
5331
|
+
return true;
|
|
5332
|
+
}
|
|
5333
|
+
// Check for DOM availability (browser environment)
|
|
5334
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
5335
|
+
return true;
|
|
5336
|
+
}
|
|
5337
|
+
// Check for Next.js specific environment variables
|
|
5338
|
+
if (typeof process !== 'undefined' && process.env?.NEXT_RUNTIME) {
|
|
5339
|
+
return true;
|
|
5340
|
+
}
|
|
5341
|
+
return false;
|
|
5342
|
+
};
|
|
5343
|
+
/**
|
|
5344
|
+
* Detects if running in a React Native environment
|
|
5345
|
+
*/
|
|
5346
|
+
const isReactNative = () => {
|
|
5347
|
+
// Check for React Native specific globals
|
|
5348
|
+
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
|
|
5349
|
+
return true;
|
|
5350
|
+
}
|
|
5351
|
+
// Check for React Native Metro bundler
|
|
5352
|
+
if (typeof __DEV__ !== 'undefined') {
|
|
5353
|
+
return true;
|
|
5354
|
+
}
|
|
5355
|
+
// Check for absence of DOM and presence of React Native modules
|
|
5356
|
+
if (typeof window === 'undefined' && typeof require !== 'undefined') {
|
|
5357
|
+
try {
|
|
5358
|
+
require.resolve('react-native');
|
|
5359
|
+
return true;
|
|
5360
|
+
}
|
|
5361
|
+
catch {
|
|
5362
|
+
// react-native not available
|
|
5363
|
+
}
|
|
5364
|
+
}
|
|
5365
|
+
return false;
|
|
5366
|
+
};
|
|
5367
|
+
const getPlatform = () => {
|
|
5368
|
+
if (isReactNative())
|
|
5369
|
+
return 'native';
|
|
5370
|
+
if (isWeb())
|
|
5371
|
+
return 'web';
|
|
5372
|
+
return 'unknown';
|
|
5373
|
+
};
|
|
5374
|
+
/**
|
|
5375
|
+
* Platform-specific execution helper
|
|
5376
|
+
*/
|
|
5377
|
+
const runOnPlatform = (config) => {
|
|
5378
|
+
const platform = getPlatform();
|
|
5379
|
+
if (platform === 'web' && config.web) {
|
|
5380
|
+
return config.web();
|
|
5381
|
+
}
|
|
5382
|
+
if (platform === 'native' && config.native) {
|
|
5383
|
+
return config.native();
|
|
5384
|
+
}
|
|
5385
|
+
if (config.default) {
|
|
5386
|
+
return config.default();
|
|
5387
|
+
}
|
|
5388
|
+
return undefined;
|
|
5389
|
+
};
|
|
5390
|
+
|
|
5391
|
+
/**
|
|
5392
|
+
* Web-specific API configuration for Next.js applications
|
|
5393
|
+
*/
|
|
5394
|
+
// Helper function to get environment variable with fallback
|
|
5395
|
+
const getEnvVar$1 = (key, fallback = '') => {
|
|
5396
|
+
return process.env[key] || fallback;
|
|
5397
|
+
};
|
|
5398
|
+
// Core API endpoints
|
|
5399
|
+
const API_PREFIX$1 = getEnvVar$1('NEXT_PUBLIC_API_PREFIX');
|
|
5400
|
+
const API_AUTH_PREFIX$2 = getEnvVar$1('NEXT_PUBLIC_API_AUTH_PREFIX');
|
|
5401
|
+
const API_PAYMENTS_PREFIX$2 = getEnvVar$1('NEXT_PUBLIC_API_PAYMENTS_PREFIX');
|
|
5402
|
+
const API_ORDERS_PREFIX$2 = getEnvVar$1('NEXT_PUBLIC_API_ORDERS_PREFIX');
|
|
5403
|
+
// Application configuration
|
|
5404
|
+
const APP_BASE_URL$1 = getEnvVar$1('NEXT_PUBLIC_APP_BASE_URL');
|
|
5405
|
+
const APP_ES_INSTANCE$2 = getEnvVar$1('NEXT_PUBLIC_APP_ES_INSTANCE');
|
|
5406
|
+
const APP_ES_AUTH$2 = getEnvVar$1('NEXT_PUBLIC_APP_ES_AUTH');
|
|
5407
|
+
// Elasticsearch indices
|
|
5408
|
+
const APP_ES_PROMO_PANEL_INDEX$1 = getEnvVar$1('NEXT_PUBLIC_APP_ES_PROMO_PANEL_INDEX');
|
|
5409
|
+
const APP_ES_FAQ_INDEX$1 = getEnvVar$1('NEXT_PUBLIC_APP_ES_FAQ_INDEX');
|
|
5410
|
+
const APP_ES_PAGES_INDEX$1 = getEnvVar$1('NEXT_PUBLIC_APP_ES_PAGES_INDEX');
|
|
5411
|
+
const APP_ES_SETTINGS_INDEX$1 = getEnvVar$1('NEXT_PUBLIC_APP_ES_SETTINGS_INDEX');
|
|
5412
|
+
const APP_ES_PRESS_INDEX$1 = getEnvVar$1('NEXT_PUBLIC_APP_ES_PRESS_INDEX');
|
|
5413
|
+
const APP_ES_GUESTS_INDEX$1 = getEnvVar$1('NEXT_PUBLIC_APP_ES_GUESTS_INDEX');
|
|
5414
|
+
const APP_ES_VIDEOS_INDEX$1 = getEnvVar$1('NEXT_PUBLIC_APP_ES_VIDEOS_INDEX');
|
|
5415
|
+
const APP_ES_SECTIONS_INDEX$1 = getEnvVar$1('NEXT_PUBLIC_APP_ES_SECTIONS_INDEX');
|
|
5416
|
+
const APP_ES_WORKOUTS_INDEX$1 = getEnvVar$1('NEXT_PUBLIC_APP_ES_WORKOUTS_INDEX');
|
|
5417
|
+
const APP_ES_SCHEDULE_INDEX$1 = getEnvVar$1('NEXT_PUBLIC_APP_ES_SCHEDULE_INDEX');
|
|
5418
|
+
const APP_ES_CHALLENGES_INDEX$1 = getEnvVar$1('NEXT_PUBLIC_APP_ES_CHALLENGES_INDEX');
|
|
5419
|
+
const APP_ES_CHALLENGE_DAYS_INDEX$1 = getEnvVar$1('NEXT_PUBLIC_APP_ES_CHALLENGE_DAYS_INDEX');
|
|
5420
|
+
// Platform identifier
|
|
5421
|
+
const PLATFORM$1 = 'web';
|
|
5422
|
+
|
|
5423
|
+
var webConfig = /*#__PURE__*/Object.freeze({
|
|
5424
|
+
__proto__: null,
|
|
5425
|
+
API_AUTH_PREFIX: API_AUTH_PREFIX$2,
|
|
5426
|
+
API_ORDERS_PREFIX: API_ORDERS_PREFIX$2,
|
|
5427
|
+
API_PAYMENTS_PREFIX: API_PAYMENTS_PREFIX$2,
|
|
5428
|
+
API_PREFIX: API_PREFIX$1,
|
|
5429
|
+
APP_BASE_URL: APP_BASE_URL$1,
|
|
5430
|
+
APP_ES_AUTH: APP_ES_AUTH$2,
|
|
5431
|
+
APP_ES_CHALLENGES_INDEX: APP_ES_CHALLENGES_INDEX$1,
|
|
5432
|
+
APP_ES_CHALLENGE_DAYS_INDEX: APP_ES_CHALLENGE_DAYS_INDEX$1,
|
|
5433
|
+
APP_ES_FAQ_INDEX: APP_ES_FAQ_INDEX$1,
|
|
5434
|
+
APP_ES_GUESTS_INDEX: APP_ES_GUESTS_INDEX$1,
|
|
5435
|
+
APP_ES_INSTANCE: APP_ES_INSTANCE$2,
|
|
5436
|
+
APP_ES_PAGES_INDEX: APP_ES_PAGES_INDEX$1,
|
|
5437
|
+
APP_ES_PRESS_INDEX: APP_ES_PRESS_INDEX$1,
|
|
5438
|
+
APP_ES_PROMO_PANEL_INDEX: APP_ES_PROMO_PANEL_INDEX$1,
|
|
5439
|
+
APP_ES_SCHEDULE_INDEX: APP_ES_SCHEDULE_INDEX$1,
|
|
5440
|
+
APP_ES_SECTIONS_INDEX: APP_ES_SECTIONS_INDEX$1,
|
|
5441
|
+
APP_ES_SETTINGS_INDEX: APP_ES_SETTINGS_INDEX$1,
|
|
5442
|
+
APP_ES_VIDEOS_INDEX: APP_ES_VIDEOS_INDEX$1,
|
|
5443
|
+
APP_ES_WORKOUTS_INDEX: APP_ES_WORKOUTS_INDEX$1,
|
|
5444
|
+
PLATFORM: PLATFORM$1
|
|
5445
|
+
});
|
|
5446
|
+
|
|
5447
|
+
/**
|
|
5448
|
+
* React Native-specific API configuration
|
|
5449
|
+
*/
|
|
5450
|
+
// Import React Native config synchronously
|
|
5451
|
+
let Config = {};
|
|
5452
|
+
try {
|
|
5453
|
+
// Try to import react-native-config
|
|
5454
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
5455
|
+
Config = require('react-native-config').default || require('react-native-config');
|
|
5456
|
+
}
|
|
5457
|
+
catch {
|
|
5458
|
+
// react-native-config not available, using fallback environment
|
|
5459
|
+
Config = {};
|
|
5460
|
+
}
|
|
5461
|
+
// Helper function to get environment variable with fallback
|
|
5462
|
+
const getEnvVar = (key, fallback = '') => {
|
|
5463
|
+
return Config[key] || process.env[key] || fallback;
|
|
5464
|
+
};
|
|
5465
|
+
// Core API endpoints
|
|
5466
|
+
const API_PREFIX = getEnvVar('API_PREFIX');
|
|
5467
|
+
const API_AUTH_PREFIX$1 = getEnvVar('API_AUTH_PREFIX');
|
|
5468
|
+
const API_PAYMENTS_PREFIX$1 = getEnvVar('API_PAYMENTS_PREFIX');
|
|
5469
|
+
const API_ORDERS_PREFIX$1 = getEnvVar('API_ORDERS_PREFIX');
|
|
5470
|
+
// Application configuration
|
|
5471
|
+
const APP_BASE_URL = getEnvVar('APP_BASE_URL');
|
|
5472
|
+
const APP_ES_INSTANCE$1 = getEnvVar('APP_ES_INSTANCE');
|
|
5473
|
+
const APP_ES_AUTH$1 = getEnvVar('APP_ES_AUTH');
|
|
5474
|
+
// Elasticsearch indices
|
|
5475
|
+
const APP_ES_PROMO_PANEL_INDEX = getEnvVar('APP_ES_PROMO_PANEL_INDEX');
|
|
5476
|
+
const APP_ES_FAQ_INDEX = getEnvVar('APP_ES_FAQ_INDEX');
|
|
5477
|
+
const APP_ES_PAGES_INDEX = getEnvVar('APP_ES_PAGES_INDEX');
|
|
5478
|
+
const APP_ES_SETTINGS_INDEX = getEnvVar('APP_ES_SETTINGS_INDEX');
|
|
5479
|
+
const APP_ES_PRESS_INDEX = getEnvVar('APP_ES_PRESS_INDEX');
|
|
5480
|
+
const APP_ES_GUESTS_INDEX = getEnvVar('APP_ES_GUESTS_INDEX');
|
|
5481
|
+
const APP_ES_VIDEOS_INDEX = getEnvVar('APP_ES_VIDEOS_INDEX');
|
|
5482
|
+
const APP_ES_SECTIONS_INDEX = getEnvVar('APP_ES_SECTIONS_INDEX');
|
|
5483
|
+
const APP_ES_WORKOUTS_INDEX = getEnvVar('APP_ES_WORKOUTS_INDEX');
|
|
5484
|
+
const APP_ES_SCHEDULE_INDEX = getEnvVar('APP_ES_SCHEDULE_INDEX');
|
|
5485
|
+
const APP_ES_CHALLENGES_INDEX = getEnvVar('APP_ES_CHALLENGES_INDEX');
|
|
5486
|
+
const APP_ES_CHALLENGE_DAYS_INDEX = getEnvVar('APP_ES_CHALLENGE_DAYS_INDEX');
|
|
5487
|
+
// Platform identifier
|
|
5488
|
+
const PLATFORM = 'native';
|
|
5489
|
+
|
|
5490
|
+
var nativeConfig = /*#__PURE__*/Object.freeze({
|
|
5491
|
+
__proto__: null,
|
|
5492
|
+
API_AUTH_PREFIX: API_AUTH_PREFIX$1,
|
|
5493
|
+
API_ORDERS_PREFIX: API_ORDERS_PREFIX$1,
|
|
5494
|
+
API_PAYMENTS_PREFIX: API_PAYMENTS_PREFIX$1,
|
|
5495
|
+
API_PREFIX: API_PREFIX,
|
|
5496
|
+
APP_BASE_URL: APP_BASE_URL,
|
|
5497
|
+
APP_ES_AUTH: APP_ES_AUTH$1,
|
|
5498
|
+
APP_ES_CHALLENGES_INDEX: APP_ES_CHALLENGES_INDEX,
|
|
5499
|
+
APP_ES_CHALLENGE_DAYS_INDEX: APP_ES_CHALLENGE_DAYS_INDEX,
|
|
5500
|
+
APP_ES_FAQ_INDEX: APP_ES_FAQ_INDEX,
|
|
5501
|
+
APP_ES_GUESTS_INDEX: APP_ES_GUESTS_INDEX,
|
|
5502
|
+
APP_ES_INSTANCE: APP_ES_INSTANCE$1,
|
|
5503
|
+
APP_ES_PAGES_INDEX: APP_ES_PAGES_INDEX,
|
|
5504
|
+
APP_ES_PRESS_INDEX: APP_ES_PRESS_INDEX,
|
|
5505
|
+
APP_ES_PROMO_PANEL_INDEX: APP_ES_PROMO_PANEL_INDEX,
|
|
5506
|
+
APP_ES_SCHEDULE_INDEX: APP_ES_SCHEDULE_INDEX,
|
|
5507
|
+
APP_ES_SECTIONS_INDEX: APP_ES_SECTIONS_INDEX,
|
|
5508
|
+
APP_ES_SETTINGS_INDEX: APP_ES_SETTINGS_INDEX,
|
|
5509
|
+
APP_ES_VIDEOS_INDEX: APP_ES_VIDEOS_INDEX,
|
|
5510
|
+
APP_ES_WORKOUTS_INDEX: APP_ES_WORKOUTS_INDEX,
|
|
5511
|
+
PLATFORM: PLATFORM
|
|
5512
|
+
});
|
|
5513
|
+
|
|
5514
|
+
/**
|
|
5515
|
+
* Cross-platform API configuration
|
|
5516
|
+
*
|
|
5517
|
+
* This file automatically detects the platform and imports the appropriate
|
|
5518
|
+
* configuration. Build tools should resolve this to platform-specific files.
|
|
5519
|
+
*/
|
|
5520
|
+
// Import platform-specific configurations
|
|
5521
|
+
const getApiConfig = () => {
|
|
5522
|
+
return runOnPlatform({
|
|
5523
|
+
web: () => webConfig,
|
|
5524
|
+
native: () => nativeConfig,
|
|
5525
|
+
default: () => {
|
|
5526
|
+
// eslint-disable-next-line no-console
|
|
5527
|
+
console.warn('Platform detection failed, falling back to web configuration');
|
|
5528
|
+
return webConfig;
|
|
5529
|
+
}
|
|
5530
|
+
});
|
|
5531
|
+
};
|
|
5532
|
+
const apiConfig = getApiConfig();
|
|
5533
|
+
// Re-export all API configuration constants
|
|
5534
|
+
apiConfig.API_PREFIX;
|
|
5535
|
+
const API_AUTH_PREFIX = apiConfig.API_AUTH_PREFIX;
|
|
5536
|
+
const API_PAYMENTS_PREFIX = apiConfig.API_PAYMENTS_PREFIX;
|
|
5537
|
+
const API_ORDERS_PREFIX = apiConfig.API_ORDERS_PREFIX;
|
|
5538
|
+
apiConfig.APP_BASE_URL;
|
|
5539
|
+
const APP_ES_INSTANCE = apiConfig.APP_ES_INSTANCE;
|
|
5540
|
+
const APP_ES_AUTH = apiConfig.APP_ES_AUTH;
|
|
5541
|
+
apiConfig.APP_ES_PROMO_PANEL_INDEX;
|
|
5542
|
+
apiConfig.APP_ES_FAQ_INDEX;
|
|
5543
|
+
apiConfig.APP_ES_PAGES_INDEX;
|
|
5544
|
+
apiConfig.APP_ES_SETTINGS_INDEX;
|
|
5545
|
+
apiConfig.APP_ES_PRESS_INDEX;
|
|
5546
|
+
apiConfig.APP_ES_GUESTS_INDEX;
|
|
5547
|
+
apiConfig.APP_ES_VIDEOS_INDEX;
|
|
5548
|
+
apiConfig.APP_ES_SECTIONS_INDEX;
|
|
5549
|
+
apiConfig.APP_ES_WORKOUTS_INDEX;
|
|
5550
|
+
apiConfig.APP_ES_SCHEDULE_INDEX;
|
|
5551
|
+
apiConfig.APP_ES_CHALLENGES_INDEX;
|
|
5552
|
+
apiConfig.APP_ES_CHALLENGE_DAYS_INDEX;
|
|
5553
|
+
apiConfig.PLATFORM;
|
|
5347
5554
|
|
|
5348
5555
|
const authDataBaseQuery = fetchBaseQuery({
|
|
5349
5556
|
baseUrl: API_AUTH_PREFIX,
|
|
5350
|
-
prepareHeaders: async (headers
|
|
5557
|
+
prepareHeaders: async (headers) => {
|
|
5351
5558
|
headers.set('Content-Type', 'application/json');
|
|
5352
5559
|
try {
|
|
5353
5560
|
// add accessToken to headers from slice using selectAccessToken selector
|
|
@@ -5362,6 +5569,7 @@ const authDataBaseQuery = fetchBaseQuery({
|
|
|
5362
5569
|
return headers;
|
|
5363
5570
|
}
|
|
5364
5571
|
catch (error) {
|
|
5572
|
+
// eslint-disable-next-line no-console
|
|
5365
5573
|
console.error('authDataBaseQuery: ', error);
|
|
5366
5574
|
return headers;
|
|
5367
5575
|
}
|
|
@@ -5444,6 +5652,7 @@ const authApi = createApi({
|
|
|
5444
5652
|
dispatch(resetCreating());
|
|
5445
5653
|
}
|
|
5446
5654
|
catch (err) {
|
|
5655
|
+
// eslint-disable-next-line no-console
|
|
5447
5656
|
console.error('REGISTER: ', err);
|
|
5448
5657
|
}
|
|
5449
5658
|
},
|
|
@@ -5600,7 +5809,7 @@ const paymentApi = createApi({
|
|
|
5600
5809
|
reducerPath: 'paymentApi',
|
|
5601
5810
|
baseQuery: fetchBaseQuery({
|
|
5602
5811
|
baseUrl: API_PAYMENTS_PREFIX,
|
|
5603
|
-
prepareHeaders: async (headers
|
|
5812
|
+
prepareHeaders: async (headers) => {
|
|
5604
5813
|
headers.set('Content-Type', 'application/json');
|
|
5605
5814
|
// add accessToken to headers from slice using selectAccessToken selector
|
|
5606
5815
|
const session = await Auth.currentSession();
|
|
@@ -5658,7 +5867,7 @@ const { useCheckUserSubscriptionQuery, useLazyCheckUserSubscriptionQuery, useGet
|
|
|
5658
5867
|
|
|
5659
5868
|
const dataBaseQuery = fetchBaseQuery({
|
|
5660
5869
|
baseUrl: API_ORDERS_PREFIX,
|
|
5661
|
-
prepareHeaders: async (headers
|
|
5870
|
+
prepareHeaders: async (headers) => {
|
|
5662
5871
|
headers.set('Content-Type', 'application/json');
|
|
5663
5872
|
// add accessToken to headers from slice using selectAccessToken selector
|
|
5664
5873
|
const session = await Auth.currentSession();
|
|
@@ -5761,7 +5970,7 @@ const cartSlice = createSlice({
|
|
|
5761
5970
|
grossTotal,
|
|
5762
5971
|
};
|
|
5763
5972
|
},
|
|
5764
|
-
resetTaxRate: (state,
|
|
5973
|
+
resetTaxRate: (state, _action) => {
|
|
5765
5974
|
return {
|
|
5766
5975
|
...state,
|
|
5767
5976
|
taxRate: {
|
|
@@ -5788,7 +5997,7 @@ const cartSlice = createSlice({
|
|
|
5788
5997
|
grossTotal,
|
|
5789
5998
|
};
|
|
5790
5999
|
},
|
|
5791
|
-
removePromoCode: (state,
|
|
6000
|
+
removePromoCode: (state, _action) => {
|
|
5792
6001
|
const { netTotal, taxRate } = state;
|
|
5793
6002
|
const taxAmount = applyTax(taxRate, netTotal);
|
|
5794
6003
|
const grossTotal = netTotal + taxAmount;
|
|
@@ -5811,9 +6020,9 @@ const cartSlice = createSlice({
|
|
|
5811
6020
|
const addedItems = [...state.addedItems, addItem];
|
|
5812
6021
|
return {
|
|
5813
6022
|
...state,
|
|
5814
|
-
addedItems
|
|
6023
|
+
addedItems,
|
|
5815
6024
|
netTotal: newTotal,
|
|
5816
|
-
grossTotal
|
|
6025
|
+
grossTotal,
|
|
5817
6026
|
};
|
|
5818
6027
|
},
|
|
5819
6028
|
updateCart: (state, action) => {
|
|
@@ -5822,7 +6031,7 @@ const cartSlice = createSlice({
|
|
|
5822
6031
|
...state,
|
|
5823
6032
|
addedItems: state.addedItems.map((item) => item && {
|
|
5824
6033
|
...item,
|
|
5825
|
-
options
|
|
6034
|
+
options,
|
|
5826
6035
|
}),
|
|
5827
6036
|
};
|
|
5828
6037
|
},
|
|
@@ -5835,7 +6044,7 @@ const cartSlice = createSlice({
|
|
|
5835
6044
|
...state,
|
|
5836
6045
|
addedItems: state.addedItems.filter((item) => item && item.uuid !== id),
|
|
5837
6046
|
netTotal: newTotal,
|
|
5838
|
-
grossTotal
|
|
6047
|
+
grossTotal,
|
|
5839
6048
|
};
|
|
5840
6049
|
},
|
|
5841
6050
|
toggleCart: (state, action) => {
|
|
@@ -5874,5 +6083,5 @@ const selectCartItemsIds = createSelector$1([selectMediaInCart], (items) => {
|
|
|
5874
6083
|
});
|
|
5875
6084
|
cartSlice.reducer;
|
|
5876
6085
|
|
|
5877
|
-
export { formatAuthSession as $, emptyCart as A, toggleCart as B, selectMediaInCart as C, selectCartTotal as D, selectCartNetTotal as E, selectCartTaxRate as F, selectCartTaxAmount as G, selectCartCount as H, selectCartStatus as I, selectPromoCode as J, selectCartItems as K, selectCartItemsIds as L, formatUserPayload as M, formatPromos as N, formatWorkout as O, formatShortform as P, formatFaqs as Q, formatPages as R, formatSettings as S, formatPress as T, formatGuests as U, formatVideos as V, formatSections as W, formatSchedule as X, formatChallenges as Y, formatChallengeDays as Z, formatSecondsToISO8601Duration as _, authApi as a, formatFedaratedSession as a0, formatSocialAuthSession as a1, formatConfig as a2, formatSectionPanels as a3, formatSectionItems as a4, formatTaxonomies as a5, formatSeries as a6, formatSeasons as a7, formatLongform as a8, formatMediaItem as a9, useResetPasswordAuthMutation as b, contentApi as c, useRegisterMutation as d, useVerifyUserQuery as e, useLazyVerifyUserQuery as f, useGetUserInfoQuery as g, useLazyGetUserInfoQuery as h, useUpdateUserInfoMutation as i, useForgottenPasswordMutation as j, useVerifyUserAttributesQuery as k, useLazyVerifyUserAttributesQuery as l, useVerifyUserResendQuery as m, useLazyVerifyUserResendQuery as n, ordersApi as o, paymentApi as p, useUpdateUserMutation as q, cartSlice as r, setTaxRate as s, resetTaxRate as t, useResetPasswordMutation as u, setPromoCode as v, removePromoCode as w, addToCart as x, updateCart as y, removeFromCart as z };
|
|
5878
|
-
//# sourceMappingURL=slice-
|
|
6086
|
+
export { formatAuthSession as $, emptyCart as A, toggleCart as B, selectMediaInCart as C, selectCartTotal as D, selectCartNetTotal as E, selectCartTaxRate as F, selectCartTaxAmount as G, selectCartCount as H, selectCartStatus as I, selectPromoCode as J, selectCartItems as K, selectCartItemsIds as L, formatUserPayload as M, formatPromos as N, formatWorkout as O, formatShortform as P, formatFaqs as Q, formatPages as R, formatSettings as S, formatPress as T, formatGuests as U, formatVideos as V, formatSections as W, formatSchedule as X, formatChallenges as Y, formatChallengeDays as Z, formatSecondsToISO8601Duration as _, authApi as a, formatFedaratedSession as a0, formatSocialAuthSession as a1, formatConfig as a2, formatSectionPanels as a3, formatSectionItems as a4, formatTaxonomies as a5, formatSeries as a6, formatSeasons as a7, formatLongform as a8, formatMediaItem as a9, isWeb as aa, isReactNative as ab, getPlatform as ac, runOnPlatform as ad, onlyUnique as ae, applyCoupon as af, applyTax as ag, toCamelCaseObject as ah, useResetPasswordAuthMutation as b, contentApi as c, useRegisterMutation as d, useVerifyUserQuery as e, useLazyVerifyUserQuery as f, useGetUserInfoQuery as g, useLazyGetUserInfoQuery as h, useUpdateUserInfoMutation as i, useForgottenPasswordMutation as j, useVerifyUserAttributesQuery as k, useLazyVerifyUserAttributesQuery as l, useVerifyUserResendQuery as m, useLazyVerifyUserResendQuery as n, ordersApi as o, paymentApi as p, useUpdateUserMutation as q, cartSlice as r, setTaxRate as s, resetTaxRate as t, useResetPasswordMutation as u, setPromoCode as v, removePromoCode as w, addToCart as x, updateCart as y, removeFromCart as z };
|
|
6087
|
+
//# sourceMappingURL=slice-qwy3bNV7.js.map
|