@redneckz/wildless-cms-uni-blocks 0.14.974 → 0.14.975

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 (169) hide show
  1. package/bundle/bundle.umd.js +15 -133
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
  4. package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
  5. package/bundle/retail/api/createUserTaskDebit.d.ts +0 -1
  6. package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
  7. package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
  8. package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  9. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
  10. package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  11. package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
  12. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
  13. package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  14. package/dist/retail/api/createUserTaskDebit.d.ts +0 -1
  15. package/dist/retail/api/createUserTaskDebit.js.map +1 -1
  16. package/dist/retail/components/Fields/AddressRetailField.js +0 -20
  17. package/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
  18. package/dist/retail/components/Fields/PaymentSystemField.js +2 -14
  19. package/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
  20. package/dist/retail/components/Fields/RegionRetailField.js +7 -20
  21. package/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
  22. package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
  23. package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
  24. package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  25. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
  26. package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  27. package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
  28. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
  29. package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  30. package/lib/retail/api/createUserTaskDebit.d.ts +0 -1
  31. package/lib/retail/api/createUserTaskDebit.js.map +1 -1
  32. package/lib/retail/components/Fields/AddressRetailField.js +0 -20
  33. package/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
  34. package/lib/retail/components/Fields/PaymentSystemField.js +2 -14
  35. package/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
  36. package/lib/retail/components/Fields/RegionRetailField.js +7 -20
  37. package/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
  38. package/mobile/bundle/bundle.umd.js +15 -133
  39. package/mobile/bundle/bundle.umd.min.js +1 -1
  40. package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
  41. package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
  42. package/mobile/bundle/retail/api/createUserTaskDebit.d.ts +0 -1
  43. package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
  44. package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
  45. package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  46. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
  47. package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  48. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
  49. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
  50. package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  51. package/mobile/dist/retail/api/createUserTaskDebit.d.ts +0 -1
  52. package/mobile/dist/retail/api/createUserTaskDebit.js.map +1 -1
  53. package/mobile/dist/retail/components/Fields/AddressRetailField.js +0 -20
  54. package/mobile/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
  55. package/mobile/dist/retail/components/Fields/PaymentSystemField.js +2 -14
  56. package/mobile/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
  57. package/mobile/dist/retail/components/Fields/RegionRetailField.js +7 -20
  58. package/mobile/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
  59. package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
  60. package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
  61. package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
  62. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
  63. package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
  64. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
  65. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
  66. package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
  67. package/mobile/lib/retail/api/createUserTaskDebit.d.ts +0 -1
  68. package/mobile/lib/retail/api/createUserTaskDebit.js.map +1 -1
  69. package/mobile/lib/retail/components/Fields/AddressRetailField.js +0 -20
  70. package/mobile/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
  71. package/mobile/lib/retail/components/Fields/PaymentSystemField.js +2 -14
  72. package/mobile/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
  73. package/mobile/lib/retail/components/Fields/RegionRetailField.js +7 -20
  74. package/mobile/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
  75. package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +5 -14
  76. package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +3 -32
  77. package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +0 -6
  78. package/mobile/src/retail/api/createUserTaskDebit.ts +0 -1
  79. package/mobile/src/retail/components/Fields/AddressRetailField.tsx +0 -26
  80. package/mobile/src/retail/components/Fields/PaymentSystemField.tsx +2 -21
  81. package/mobile/src/retail/components/Fields/RegionRetailField.tsx +7 -22
  82. package/package.json +2 -2
  83. package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +5 -14
  84. package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +3 -32
  85. package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +0 -6
  86. package/src/retail/api/createUserTaskDebit.ts +0 -1
  87. package/src/retail/components/Fields/AddressRetailField.tsx +0 -26
  88. package/src/retail/components/Fields/PaymentSystemField.tsx +2 -21
  89. package/src/retail/components/Fields/RegionRetailField.tsx +7 -22
  90. package/bundle/retail/api/getClaimChannel.d.ts +0 -8
  91. package/bundle/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
  92. package/bundle/retail/utils/filterPaymentSystems.d.ts +0 -4
  93. package/bundle/retail/utils/hasDelivery.d.ts +0 -10
  94. package/bundle/utils/getSlugFromUrl.d.ts +0 -1
  95. package/dist/retail/api/getClaimChannel.d.ts +0 -8
  96. package/dist/retail/api/getClaimChannel.js +0 -9
  97. package/dist/retail/api/getClaimChannel.js.map +0 -1
  98. package/dist/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
  99. package/dist/retail/hooks/useBiblioglobusDefaultRegion.js +0 -34
  100. package/dist/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
  101. package/dist/retail/utils/filterPaymentSystems.d.ts +0 -4
  102. package/dist/retail/utils/filterPaymentSystems.js +0 -13
  103. package/dist/retail/utils/filterPaymentSystems.js.map +0 -1
  104. package/dist/retail/utils/hasDelivery.d.ts +0 -10
  105. package/dist/retail/utils/hasDelivery.js +0 -13
  106. package/dist/retail/utils/hasDelivery.js.map +0 -1
  107. package/dist/utils/getSlugFromUrl.d.ts +0 -1
  108. package/dist/utils/getSlugFromUrl.js +0 -12
  109. package/dist/utils/getSlugFromUrl.js.map +0 -1
  110. package/lib/retail/api/getClaimChannel.d.ts +0 -8
  111. package/lib/retail/api/getClaimChannel.js +0 -6
  112. package/lib/retail/api/getClaimChannel.js.map +0 -1
  113. package/lib/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
  114. package/lib/retail/hooks/useBiblioglobusDefaultRegion.js +0 -31
  115. package/lib/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
  116. package/lib/retail/utils/filterPaymentSystems.d.ts +0 -4
  117. package/lib/retail/utils/filterPaymentSystems.js +0 -10
  118. package/lib/retail/utils/filterPaymentSystems.js.map +0 -1
  119. package/lib/retail/utils/hasDelivery.d.ts +0 -10
  120. package/lib/retail/utils/hasDelivery.js +0 -9
  121. package/lib/retail/utils/hasDelivery.js.map +0 -1
  122. package/lib/utils/getSlugFromUrl.d.ts +0 -1
  123. package/lib/utils/getSlugFromUrl.js +0 -9
  124. package/lib/utils/getSlugFromUrl.js.map +0 -1
  125. package/mobile/bundle/retail/api/getClaimChannel.d.ts +0 -8
  126. package/mobile/bundle/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
  127. package/mobile/bundle/retail/utils/filterPaymentSystems.d.ts +0 -4
  128. package/mobile/bundle/retail/utils/hasDelivery.d.ts +0 -10
  129. package/mobile/bundle/utils/getSlugFromUrl.d.ts +0 -1
  130. package/mobile/dist/retail/api/getClaimChannel.d.ts +0 -8
  131. package/mobile/dist/retail/api/getClaimChannel.js +0 -9
  132. package/mobile/dist/retail/api/getClaimChannel.js.map +0 -1
  133. package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
  134. package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.js +0 -34
  135. package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
  136. package/mobile/dist/retail/utils/filterPaymentSystems.d.ts +0 -4
  137. package/mobile/dist/retail/utils/filterPaymentSystems.js +0 -13
  138. package/mobile/dist/retail/utils/filterPaymentSystems.js.map +0 -1
  139. package/mobile/dist/retail/utils/hasDelivery.d.ts +0 -10
  140. package/mobile/dist/retail/utils/hasDelivery.js +0 -13
  141. package/mobile/dist/retail/utils/hasDelivery.js.map +0 -1
  142. package/mobile/dist/utils/getSlugFromUrl.d.ts +0 -1
  143. package/mobile/dist/utils/getSlugFromUrl.js +0 -12
  144. package/mobile/dist/utils/getSlugFromUrl.js.map +0 -1
  145. package/mobile/lib/retail/api/getClaimChannel.d.ts +0 -8
  146. package/mobile/lib/retail/api/getClaimChannel.js +0 -6
  147. package/mobile/lib/retail/api/getClaimChannel.js.map +0 -1
  148. package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
  149. package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.js +0 -31
  150. package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
  151. package/mobile/lib/retail/utils/filterPaymentSystems.d.ts +0 -4
  152. package/mobile/lib/retail/utils/filterPaymentSystems.js +0 -10
  153. package/mobile/lib/retail/utils/filterPaymentSystems.js.map +0 -1
  154. package/mobile/lib/retail/utils/hasDelivery.d.ts +0 -10
  155. package/mobile/lib/retail/utils/hasDelivery.js +0 -9
  156. package/mobile/lib/retail/utils/hasDelivery.js.map +0 -1
  157. package/mobile/lib/utils/getSlugFromUrl.d.ts +0 -1
  158. package/mobile/lib/utils/getSlugFromUrl.js +0 -9
  159. package/mobile/lib/utils/getSlugFromUrl.js.map +0 -1
  160. package/mobile/src/retail/api/getClaimChannel.ts +0 -18
  161. package/mobile/src/retail/hooks/useBiblioglobusDefaultRegion.ts +0 -56
  162. package/mobile/src/retail/utils/filterPaymentSystems.ts +0 -14
  163. package/mobile/src/retail/utils/hasDelivery.ts +0 -22
  164. package/mobile/src/utils/getSlugFromUrl.ts +0 -10
  165. package/src/retail/api/getClaimChannel.ts +0 -18
  166. package/src/retail/hooks/useBiblioglobusDefaultRegion.ts +0 -56
  167. package/src/retail/utils/filterPaymentSystems.ts +0 -14
  168. package/src/retail/utils/hasDelivery.ts +0 -22
  169. package/src/utils/getSlugFromUrl.ts +0 -10
@@ -8,7 +8,6 @@ import { createDraftTask } from '../../retail/api/createDraftTask';
8
8
  import { createParticipant } from '../../retail/api/createParticipant';
9
9
  import { createUserProfile } from '../../retail/api/createUserProfile';
10
10
  import { createUserTaskDebit } from '../../retail/api/createUserTaskDebit';
11
- import { getClaimChannel } from '../../retail/api/getClaimChannel';
12
11
  import { getLastTaskStatus } from '../../retail/api/getLastTaskStatus';
13
12
  import { getTaskById } from '../../retail/api/getTaskById';
14
13
  import { saveReferalInfo } from '../../retail/api/saveReferalInfo';
@@ -19,11 +18,9 @@ import { useDraftDialog } from '../../retail/components/DraftDialog/useDraftDial
19
18
  import { VerifyPhoneDialog } from '../../retail/components/VerifyPhoneDialog/VerifyPhoneDialog';
20
19
  import { type FormRetailConsents, type LeadFormState } from '../../retail/model/LeadFormState';
21
20
  import { type ReferalData } from '../../retail/model/ReferalData';
22
- import { BIBLIOGLOBUS_SLUG } from '../../retail/utils/filterPaymentSystems';
23
21
  import { getUpdateUserProfileData } from '../../retail/utils/getUpdateUserProfile';
24
22
  import { useDialog } from '../../ui-kit/DialogManager/useDialog';
25
23
  import { formatPhone } from '../../utils/formatPhone';
26
- import { getCardSlugFromUrl } from '../../utils/getSlugFromUrl';
27
24
  import { type ProductType } from './ApplicationLeadFormContent';
28
25
  import { productTypeToConsentsMap } from './consents';
29
26
  import { getCreditLeadFormTaskData, getDebitLeadFormTaskData } from './getLeadFormTaskData';
@@ -79,7 +76,6 @@ export const useApplicationLeadApi = ({
79
76
 
80
77
  const referalData = leadFormStore.referalData;
81
78
  const marketingInfo = sessionStore.marketingInfo;
82
- const referrerUrl = sessionStore.referrerUrl;
83
79
 
84
80
  if (!profileId) {
85
81
  throw new Error();
@@ -95,7 +91,6 @@ export const useApplicationLeadApi = ({
95
91
  marketingInfo,
96
92
  saveUserData,
97
93
  sendAspects,
98
- referrerUrl,
99
94
  });
100
95
  verifyPhoneDialog.close();
101
96
  if (productType === 'debitCard') {
@@ -219,18 +214,6 @@ const getAcceptedConsents = (formData: LeadFormState, productType: ProductType):
219
214
  .map((_) => consents[_]?.text);
220
215
  };
221
216
 
222
- // Padding line to fix eslint padding-line-between-statements
223
-
224
- const computeClaimChannel = async (slug: string | null): Promise<string | undefined> => {
225
- if (slug !== BIBLIOGLOBUS_SLUG) {
226
- return undefined;
227
- }
228
-
229
- const claimData = await getClaimChannel();
230
-
231
- return claimData.find((item) => item.key === slug)?.code;
232
- };
233
-
234
217
  const updateUserData = async ({
235
218
  programId,
236
219
  profileId,
@@ -240,7 +223,6 @@ const updateUserData = async ({
240
223
  marketingInfo,
241
224
  saveUserData,
242
225
  sendAspects,
243
- referrerUrl,
244
226
  }: {
245
227
  programId: string;
246
228
  profileId: number;
@@ -250,27 +232,17 @@ const updateUserData = async ({
250
232
  marketingInfo: MarketingInfo | null;
251
233
  saveUserData: (userData: UserData) => void;
252
234
  sendAspects: (profileId: number, taskId: number) => void;
253
- referrerUrl: string | null;
254
235
  }) => {
236
+ let taskId: number;
237
+ let participantId: number;
255
238
  const transformedConsents = transformConsentsFields(formData, productType);
256
- const slug = getCardSlugFromUrl(referrerUrl as string);
257
239
 
258
240
  await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
259
241
 
260
242
  try {
261
- let taskId: number;
262
- let participantId: number;
263
-
264
243
  if (productType === 'debitCard') {
265
- const claimChannelCode = await computeClaimChannel(slug);
266
-
267
244
  const debitData = await createUserTaskDebit(
268
- getDebitLeadFormTaskData({
269
- formData,
270
- programId,
271
- marketingInfo,
272
- claimChannelCode,
273
- }),
245
+ getDebitLeadFormTaskData(formData, programId, marketingInfo),
274
246
  );
275
247
 
276
248
  taskId = debitData.taskId;
@@ -293,7 +265,6 @@ const updateUserData = async ({
293
265
  }),
294
266
  );
295
267
  }
296
-
297
268
  if (referalData?.referalCode) {
298
269
  await saveReferalInfo({
299
270
  taskId,
@@ -25,7 +25,6 @@ type InitApplicationLeadProps = {
25
25
  export interface ApplicationLeadStore {
26
26
  marketingInfo: MarketingInfo | null;
27
27
  isNewMicroservice: boolean | null;
28
- referrerUrl: string | null;
29
28
  }
30
29
 
31
30
  export const useInitApplicationLead = ({
@@ -79,11 +78,6 @@ export const useInitApplicationLead = ({
79
78
 
80
79
  sessionStore.marketingInfo = getMarketingInfo(queryFromStorage, sessionStore);
81
80
  sessionStore.isNewMicroservice = isNewMicroservice || null;
82
-
83
- const referrer = globalThis.document.referrer;
84
- if (referrer) {
85
- sessionStore.referrerUrl = referrer as string;
86
- }
87
81
  }, [queryFromStorage]);
88
82
 
89
83
  useEffect(() => {
@@ -11,7 +11,6 @@ export type CreateUserTaskDebitBody = {
11
11
  participants: Participant[];
12
12
  marketingInfo?: Nullable<MarketingInfo>;
13
13
  };
14
- claimChannelCode?: string;
15
14
  };
16
15
 
17
16
  export type CreateUserTaskDebitResponse = {
@@ -1,26 +1,18 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useEffect, useState } from '@redneckz/uni-jsx/lib/hooks';
3
- import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
4
3
  import { getOfficePoint } from '../../../components/OfficesAtmsMap/renderOfficeCard';
5
4
  import { useOfficesAtmsMapData } from '../../../components/OfficesAtmsMap/useOfficesAtmsMapData';
6
5
  import { ClientOnly } from '../../../ui-kit/ClientOnly';
7
6
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
8
7
  import { SelectControl } from '../../../ui-kit/Select/SelectControl';
9
8
  import { YandexMap } from '../../../ui-kit/YandexMap/YandexMap';
10
- import { getCardSlugFromUrl } from '../../../utils/getSlugFromUrl';
11
9
  import { fetchRegionOffices, type OfficeType } from '../../api/regionOffices';
12
10
  import { useLeadFormData } from '../../hooks/useLeadFormData';
13
- import { BIBLIOGLOBUS_SLUG } from '../../utils/filterPaymentSystems';
14
-
15
- const BIBLIOGLOBUS_OFFICE_ID = '714680716';
16
11
 
17
12
  export const AddressRetailField = JSX<CustomFieldProps>(({ field, input }) => {
18
13
  const [offices, setOffices] = useState<OfficeType[]>([]);
19
14
  const { data } = useLeadFormData('REGION_RF');
20
15
 
21
- const sessionStore = useSessionStore<{ referrerUrl?: string }>();
22
- const referrerUrl = sessionStore.referrerUrl;
23
-
24
16
  const regionValue = field('regionRetail')?.value || {};
25
17
  const addressField = field(input?.name ?? '');
26
18
 
@@ -35,24 +27,6 @@ export const AddressRetailField = JSX<CustomFieldProps>(({ field, input }) => {
35
27
  }
36
28
  }, [regionValue.key]);
37
29
 
38
- // Логика для biblioglobus - выбор отделения по умолчанию
39
- useEffect(() => {
40
- if (!referrerUrl || !offices.length) {
41
- return;
42
- }
43
-
44
- const slug = getCardSlugFromUrl(referrerUrl);
45
- if (slug === BIBLIOGLOBUS_SLUG) {
46
- const defaultOffice = offices.find(
47
- (office) => office.id?.toString() === BIBLIOGLOBUS_OFFICE_ID,
48
- );
49
- addressField.onChange?.({
50
- key: defaultOffice?.id?.toString() || '',
51
- text: defaultOffice?.address || '',
52
- });
53
- }
54
- }, [referrerUrl, offices]);
55
-
56
30
  const { points } = useOfficesAtmsMapData({
57
31
  data: offices,
58
32
  filtrationState: {},
@@ -1,14 +1,11 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useMemo, useState } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useLocalStore } from '@redneckz/uni-jsx/lib/Store/useLocalStore';
4
- import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
5
4
  import { useAsyncEffect } from '../../../hooks/useAsyncEffect';
6
5
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
7
6
  import { RadioButtonGroupControl } from '../../../ui-kit/RadioButtonGroup/RadioButtonGroupControl';
8
7
  import { type Option } from '../../../ui-kit/Select/Option';
9
- import { getCardSlugFromUrl } from '../../../utils/getSlugFromUrl';
10
8
  import { getPaymentSystems } from '../../api/getPaymentSystems';
11
- import { filterPaymentSystems } from '../../utils/filterPaymentSystems';
12
9
 
13
10
  const optionKey = (option: { key?: string } | undefined) => option?.key;
14
11
 
@@ -16,28 +13,12 @@ export const PaymentSystemField = JSX<CustomFieldProps>(({ field, input }) => {
16
13
  const [paymentSystemOptions, setPaymentSystemOptions] = useState<Option[]>([]);
17
14
 
18
15
  const localStore = useLocalStore<{ programId: string }>();
19
- const sessionStore = useSessionStore<{ referrerUrl?: string }>();
20
-
21
16
  useAsyncEffect(async () => {
22
17
  const { programId } = localStore;
23
- if (!programId) {
24
- return;
25
- }
26
-
27
- const fetchedPaymentSystems = await getPaymentSystems(programId);
28
-
29
- const referrerUrl = sessionStore.referrerUrl;
30
-
31
- if (!referrerUrl) {
18
+ if (programId) {
19
+ const fetchedPaymentSystems = await getPaymentSystems(programId);
32
20
  setPaymentSystemOptions(fetchedPaymentSystems ?? []);
33
-
34
- return;
35
21
  }
36
-
37
- const slug = getCardSlugFromUrl(referrerUrl);
38
- const filteredSystems = filterPaymentSystems(fetchedPaymentSystems ?? [], slug);
39
-
40
- setPaymentSystemOptions(filteredSystems);
41
22
  }, []);
42
23
 
43
24
  const items = useMemo(
@@ -1,24 +1,19 @@
1
1
  import { JSX } from '@redneckz/uni-jsx';
2
2
  import { useCallback, useEffect } from '@redneckz/uni-jsx/lib/hooks';
3
3
  import { useAsyncData } from '@redneckz/uni-jsx/lib/hooks/useAsyncData';
4
- import { useSessionStore } from '@redneckz/uni-jsx/lib/Store/useSessionStore';
5
4
  import { type ProductType } from '../../../components/ApplicationLeadForm/ApplicationLeadFormContent';
6
5
  import { type CustomFieldProps } from '../../../ui-kit/FormField/CustomFieldProps';
7
6
  import { type Option } from '../../../ui-kit/Select/Option';
8
7
  import { SelectControl } from '../../../ui-kit/Select/SelectControl';
9
8
  import { getRegionsCardDelivery } from '../../api/getRegionsCardDelivery';
10
- import { useBiblioglobusDefaultRegion } from '../../hooks/useBiblioglobusDefaultRegion';
11
9
  import { useLeadFormData } from '../../hooks/useLeadFormData';
12
10
  import { useRetailFormStore } from '../../hooks/useRetailFormStore';
13
- import { calculateRegionHasDelivery, getRegionDeliveryStatus } from '../../utils/hasDelivery';
14
11
 
15
12
  export const RegionRetailField = JSX<CustomFieldProps>(({ field, input }) => {
16
13
  const { programId, productType } = useRetailFormStore();
17
14
  const { data: regions } = useLeadFormData('REGION_RF');
18
15
  const { data: regionsDelivery } = useAsyncData('regionsDelivery', getRegionsCardDelivery);
19
16
  const { data: productSettings } = useLeadFormData(getCurrentProductSettings(productType));
20
- const sessionStore = useSessionStore<{ referrerUrl?: string }>();
21
-
22
17
  const isDebit = productType === 'debitCard';
23
18
  const isSalaryCard = programId === '38';
24
19
  const isEsiaAuth = Boolean(field('esiaAccountTypeCd')?.value?.key);
@@ -29,30 +24,20 @@ export const RegionRetailField = JSX<CustomFieldProps>(({ field, input }) => {
29
24
  const handleChangeRegionHasDelivery = field('regionHasDelivery')?.onChange;
30
25
  const handleChangeMethodObtain = field('methodObtain')?.onChange;
31
26
 
32
- useBiblioglobusDefaultRegion({
33
- referrerUrl: sessionStore.referrerUrl ?? undefined,
34
- regions,
35
- regionsDelivery,
36
- onRegionChange: handleChangeRegion,
37
- onRegionHasDeliveryChange: handleChangeRegionHasDelivery,
38
- onMethodObtainChange: handleChangeMethodObtain,
39
- });
40
-
41
27
  const onChange = useCallback(
42
28
  (value: Option) => {
43
- const regionHasDelivery = calculateRegionHasDelivery({
44
- isDebit,
45
- isEsiaAuth,
46
- isSalaryCard,
47
- isDeliveryActive,
48
- regionDelivery: getRegionDeliveryStatus(regionsDelivery, value),
49
- });
29
+ const regionHasDelivery = isDebit
30
+ ? isEsiaAuth &&
31
+ !isSalaryCard &&
32
+ isDeliveryActive &&
33
+ regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg
34
+ : isDeliveryActive && regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg;
50
35
 
51
36
  handleChangeRegionHasDelivery?.(regionHasDelivery);
52
37
  handleChangeMethodObtain?.(regionHasDelivery ? 'courier' : 'office');
53
38
  handleChangeRegion?.(value);
54
39
  },
55
- [calculateRegionHasDelivery],
40
+ [regionsDelivery, isDeliveryActive, isEsiaAuth],
56
41
  );
57
42
 
58
43
  useEffect(() => {
@@ -1,8 +0,0 @@
1
- export declare type GetClaimChannelResponse = {
2
- code: string;
3
- deliveryEmail: string;
4
- description: string;
5
- id: number;
6
- key: string;
7
- };
8
- export declare const getClaimChannel: () => Promise<GetClaimChannelResponse[]>;
@@ -1,14 +0,0 @@
1
- import { type Option } from '../../ui-kit/Select/Option';
2
- import { type DictionaryItem } from '../model/LeadFormData';
3
- export declare type RegionDelivery = {
4
- regionCode: string;
5
- deliveryFlg: boolean;
6
- };
7
- export declare const useBiblioglobusDefaultRegion: (args: {
8
- referrerUrl?: string | undefined;
9
- regions?: DictionaryItem[] | undefined;
10
- regionsDelivery?: RegionDelivery[] | undefined;
11
- onRegionChange?: ((option: Option) => void) | undefined;
12
- onRegionHasDeliveryChange?: ((value: boolean) => void) | undefined;
13
- onMethodObtainChange?: ((value: string) => void) | undefined;
14
- }) => void;
@@ -1,4 +0,0 @@
1
- import { type Option } from '../../ui-kit/Select/Option';
2
- declare const BIBLIOGLOBUS_SLUG = "biblioglobus";
3
- export declare const filterPaymentSystems: (systems: Option[], slug: string | null) => Option[];
4
- export { BIBLIOGLOBUS_SLUG };
@@ -1,10 +0,0 @@
1
- import { type Option } from '../../ui-kit/Select/Option';
2
- import { type RegionDelivery } from '../hooks/useBiblioglobusDefaultRegion';
3
- export declare const getRegionDeliveryStatus: (regionsDelivery: RegionDelivery[] | undefined, value: Option) => boolean | undefined;
4
- export declare const calculateRegionHasDelivery: (args: {
5
- isDebit: boolean;
6
- isEsiaAuth: boolean;
7
- isSalaryCard: boolean;
8
- isDeliveryActive: boolean;
9
- regionDelivery?: boolean;
10
- }) => boolean | undefined;
@@ -1 +0,0 @@
1
- export declare function getCardSlugFromUrl(url: string): string | null;
@@ -1,8 +0,0 @@
1
- export declare type GetClaimChannelResponse = {
2
- code: string;
3
- deliveryEmail: string;
4
- description: string;
5
- id: number;
6
- key: string;
7
- };
8
- export declare const getClaimChannel: () => Promise<GetClaimChannelResponse[]>;
@@ -1,9 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.getClaimChannel = void 0;
3
- const doRequest_1 = require("./doRequest");
4
- const getClaimChannel = async () => {
5
- const res = await (0, doRequest_1.fetchRetailJSON)('light-api-cash/v1/claimChannel/', 'GET');
6
- return res || [];
7
- };
8
- exports.getClaimChannel = getClaimChannel;
9
- //# sourceMappingURL=getClaimChannel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getClaimChannel.js","sourceRoot":"","sources":["../../../src/retail/api/getClaimChannel.ts"],"names":[],"mappings":";;AAAA,2CAA8C;AAUvC,MAAM,eAAe,GAAG,KAAK,IAAwC,EAAE;IAC5E,MAAM,GAAG,GAAG,MAAM,IAAA,2BAAe,EAC/B,iCAAiC,EACjC,KAAK,CACN,CAAC;IAEF,OAAO,GAAG,IAAK,EAAgC,CAAC;AAClD,CAAC,CAAC;AAPW,QAAA,eAAe,mBAO1B"}
@@ -1,14 +0,0 @@
1
- import { type Option } from '../../ui-kit/Select/Option';
2
- import { type DictionaryItem } from '../model/LeadFormData';
3
- export declare type RegionDelivery = {
4
- regionCode: string;
5
- deliveryFlg: boolean;
6
- };
7
- export declare const useBiblioglobusDefaultRegion: (args: {
8
- referrerUrl?: string | undefined;
9
- regions?: DictionaryItem[] | undefined;
10
- regionsDelivery?: RegionDelivery[] | undefined;
11
- onRegionChange?: ((option: Option) => void) | undefined;
12
- onRegionHasDeliveryChange?: ((value: boolean) => void) | undefined;
13
- onMethodObtainChange?: ((value: string) => void) | undefined;
14
- }) => void;
@@ -1,34 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.useBiblioglobusDefaultRegion = void 0;
3
- const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
4
- const getSlugFromUrl_1 = require("../../utils/getSlugFromUrl");
5
- const filterPaymentSystems_1 = require("../utils/filterPaymentSystems");
6
- const useBiblioglobusDefaultRegion = (args) => {
7
- const { referrerUrl, regions, regionsDelivery, onRegionChange, onRegionHasDeliveryChange, onMethodObtainChange, } = args;
8
- const slug = referrerUrl ? (0, getSlugFromUrl_1.getCardSlugFromUrl)(referrerUrl) : '';
9
- const defaultRegion = regions?.find((region) => region.key === 'REGION_77');
10
- const regionHasDelivery = Boolean(regionsDelivery?.find((rd) => rd.regionCode === 'REGION_77')?.deliveryFlg);
11
- const isReady = Boolean(referrerUrl &&
12
- regions &&
13
- regionsDelivery &&
14
- slug === filterPaymentSystems_1.BIBLIOGLOBUS_SLUG &&
15
- defaultRegion?.key &&
16
- defaultRegion?.value);
17
- (0, hooks_1.useEffect)(() => {
18
- if (!isReady || !defaultRegion || !defaultRegion.key || !defaultRegion.value) {
19
- return;
20
- }
21
- onRegionChange?.({ key: defaultRegion.key, text: defaultRegion.value });
22
- onRegionHasDeliveryChange?.(regionHasDelivery);
23
- onMethodObtainChange?.(regionHasDelivery ? 'courier' : 'office');
24
- }, [
25
- isReady,
26
- defaultRegion,
27
- regionHasDelivery,
28
- onRegionChange,
29
- onRegionHasDeliveryChange,
30
- onMethodObtainChange,
31
- ]);
32
- };
33
- exports.useBiblioglobusDefaultRegion = useBiblioglobusDefaultRegion;
34
- //# sourceMappingURL=useBiblioglobusDefaultRegion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBiblioglobusDefaultRegion.js","sourceRoot":"","sources":["../../../src/retail/hooks/useBiblioglobusDefaultRegion.ts"],"names":[],"mappings":";;AAAA,uDAAwD;AAExD,+DAAgE;AAEhE,wEAAkE;AAI3D,MAAM,4BAA4B,GAAG,CAAC,IAO5C,EAAE,EAAE;IACH,MAAM,EACJ,WAAW,EACX,OAAO,EACP,eAAe,EACf,cAAc,EACd,yBAAyB,EACzB,oBAAoB,GACrB,GAAG,IAAI,CAAC;IAET,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,IAAA,mCAAkB,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,MAAM,aAAa,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,KAAK,WAAW,CAAC,CAAC;IAC5E,MAAM,iBAAiB,GAAG,OAAO,CAC/B,eAAe,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,KAAK,WAAW,CAAC,EAAE,WAAW,CAC1E,CAAC;IACF,MAAM,OAAO,GAAG,OAAO,CACrB,WAAW;QACT,OAAO;QACP,eAAe;QACf,IAAI,KAAK,wCAAiB;QAC1B,aAAa,EAAE,GAAG;QAClB,aAAa,EAAE,KAAK,CACvB,CAAC;IAEF,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;YAC5E,OAAO;SACR;QAED,cAAc,EAAE,CAAC,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC;QACxE,yBAAyB,EAAE,CAAC,iBAAiB,CAAC,CAAC;QAC/C,oBAAoB,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACnE,CAAC,EAAE;QACD,OAAO;QACP,aAAa;QACb,iBAAiB;QACjB,cAAc;QACd,yBAAyB;QACzB,oBAAoB;KACrB,CAAC,CAAC;AACL,CAAC,CAAC;AA/CW,QAAA,4BAA4B,gCA+CvC"}
@@ -1,4 +0,0 @@
1
- import { type Option } from '../../ui-kit/Select/Option';
2
- declare const BIBLIOGLOBUS_SLUG = "biblioglobus";
3
- export declare const filterPaymentSystems: (systems: Option[], slug: string | null) => Option[];
4
- export { BIBLIOGLOBUS_SLUG };
@@ -1,13 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.BIBLIOGLOBUS_SLUG = exports.filterPaymentSystems = void 0;
3
- const BIBLIOGLOBUS_SLUG = 'biblioglobus';
4
- exports.BIBLIOGLOBUS_SLUG = BIBLIOGLOBUS_SLUG;
5
- const UNIONPAY_TEXT = 'UnionPay';
6
- const filterPaymentSystems = (systems, slug) => {
7
- if (slug !== BIBLIOGLOBUS_SLUG) {
8
- return systems;
9
- }
10
- return systems.filter((system) => system.text === UNIONPAY_TEXT);
11
- };
12
- exports.filterPaymentSystems = filterPaymentSystems;
13
- //# sourceMappingURL=filterPaymentSystems.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filterPaymentSystems.js","sourceRoot":"","sources":["../../../src/retail/utils/filterPaymentSystems.ts"],"names":[],"mappings":";;AAEA,MAAM,iBAAiB,GAAG,cAAc,CAAC;AAWhC,8CAAiB;AAV1B,MAAM,aAAa,GAAG,UAAU,CAAC;AAE1B,MAAM,oBAAoB,GAAG,CAAC,OAAiB,EAAE,IAAmB,EAAY,EAAE;IACvF,IAAI,IAAI,KAAK,iBAAiB,EAAE;QAC9B,OAAO,OAAO,CAAC;KAChB;IAED,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;AACnE,CAAC,CAAC;AANW,QAAA,oBAAoB,wBAM/B"}
@@ -1,10 +0,0 @@
1
- import { type Option } from '../../ui-kit/Select/Option';
2
- import { type RegionDelivery } from '../hooks/useBiblioglobusDefaultRegion';
3
- export declare const getRegionDeliveryStatus: (regionsDelivery: RegionDelivery[] | undefined, value: Option) => boolean | undefined;
4
- export declare const calculateRegionHasDelivery: (args: {
5
- isDebit: boolean;
6
- isEsiaAuth: boolean;
7
- isSalaryCard: boolean;
8
- isDeliveryActive: boolean;
9
- regionDelivery?: boolean;
10
- }) => boolean | undefined;
@@ -1,13 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.calculateRegionHasDelivery = exports.getRegionDeliveryStatus = void 0;
3
- const getRegionDeliveryStatus = (regionsDelivery, value) => regionsDelivery?.find((_) => _.regionCode === String(value.key))?.deliveryFlg;
4
- exports.getRegionDeliveryStatus = getRegionDeliveryStatus;
5
- const calculateRegionHasDelivery = (args) => {
6
- const { isDebit, isEsiaAuth, isSalaryCard, isDeliveryActive, regionDelivery } = args;
7
- if (isDebit) {
8
- return isEsiaAuth && !isSalaryCard && isDeliveryActive && regionDelivery;
9
- }
10
- return isDeliveryActive && regionDelivery;
11
- };
12
- exports.calculateRegionHasDelivery = calculateRegionHasDelivery;
13
- //# sourceMappingURL=hasDelivery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasDelivery.js","sourceRoot":"","sources":["../../../src/retail/utils/hasDelivery.ts"],"names":[],"mappings":";;AAGO,MAAM,uBAAuB,GAAG,CACrC,eAA6C,EAC7C,KAAa,EACb,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC;AAHtE,QAAA,uBAAuB,2BAG+C;AAE5E,MAAM,0BAA0B,GAAG,CAAC,IAM1C,EAAE,EAAE;IACH,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACrF,IAAI,OAAO,EAAE;QACX,OAAO,UAAU,IAAI,CAAC,YAAY,IAAI,gBAAgB,IAAI,cAAc,CAAC;KAC1E;IAED,OAAO,gBAAgB,IAAI,cAAc,CAAC;AAC5C,CAAC,CAAC;AAbW,QAAA,0BAA0B,8BAarC"}
@@ -1 +0,0 @@
1
- export declare function getCardSlugFromUrl(url: string): string | null;
@@ -1,12 +0,0 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.getCardSlugFromUrl = void 0;
3
- function getCardSlugFromUrl(url) {
4
- const lastSegment = url.split('/').filter(Boolean).pop();
5
- if (!lastSegment) {
6
- return null;
7
- }
8
- const parts = lastSegment.split('-');
9
- return parts.length > 1 ? parts[parts.length - 1] : null;
10
- }
11
- exports.getCardSlugFromUrl = getCardSlugFromUrl;
12
- //# sourceMappingURL=getSlugFromUrl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getSlugFromUrl.js","sourceRoot":"","sources":["../../src/utils/getSlugFromUrl.ts"],"names":[],"mappings":";;AAAA,SAAgB,kBAAkB,CAAC,GAAW;IAC5C,MAAM,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC;IACzD,IAAI,CAAC,WAAW,EAAE;QAChB,OAAO,IAAI,CAAC;KACb;IAED,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAErC,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC3D,CAAC;AATD,gDASC"}
@@ -1,8 +0,0 @@
1
- export declare type GetClaimChannelResponse = {
2
- code: string;
3
- deliveryEmail: string;
4
- description: string;
5
- id: number;
6
- key: string;
7
- };
8
- export declare const getClaimChannel: () => Promise<GetClaimChannelResponse[]>;
@@ -1,6 +0,0 @@
1
- import { fetchRetailJSON } from './doRequest.js';
2
- export const getClaimChannel = async () => {
3
- const res = await fetchRetailJSON('light-api-cash/v1/claimChannel/', 'GET');
4
- return res || [];
5
- };
6
- //# sourceMappingURL=getClaimChannel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getClaimChannel.js","sourceRoot":"","sources":["../../../src/retail/api/getClaimChannel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAU9C,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,IAAwC,EAAE;IAC5E,MAAM,GAAG,GAAG,MAAM,eAAe,CAC/B,iCAAiC,EACjC,KAAK,CACN,CAAC;IAEF,OAAO,GAAG,IAAK,EAAgC,CAAC;AAClD,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- import { type Option } from '../../ui-kit/Select/Option';
2
- import { type DictionaryItem } from '../model/LeadFormData';
3
- export declare type RegionDelivery = {
4
- regionCode: string;
5
- deliveryFlg: boolean;
6
- };
7
- export declare const useBiblioglobusDefaultRegion: (args: {
8
- referrerUrl?: string | undefined;
9
- regions?: DictionaryItem[] | undefined;
10
- regionsDelivery?: RegionDelivery[] | undefined;
11
- onRegionChange?: ((option: Option) => void) | undefined;
12
- onRegionHasDeliveryChange?: ((value: boolean) => void) | undefined;
13
- onMethodObtainChange?: ((value: string) => void) | undefined;
14
- }) => void;
@@ -1,31 +0,0 @@
1
- import { useEffect } from '@redneckz/uni-jsx/lib/hooks';
2
- import { getCardSlugFromUrl } from '../../utils/getSlugFromUrl.js';
3
- import { BIBLIOGLOBUS_SLUG } from '../utils/filterPaymentSystems.js';
4
- export const useBiblioglobusDefaultRegion = (args) => {
5
- const { referrerUrl, regions, regionsDelivery, onRegionChange, onRegionHasDeliveryChange, onMethodObtainChange, } = args;
6
- const slug = referrerUrl ? getCardSlugFromUrl(referrerUrl) : '';
7
- const defaultRegion = regions?.find((region) => region.key === 'REGION_77');
8
- const regionHasDelivery = Boolean(regionsDelivery?.find((rd) => rd.regionCode === 'REGION_77')?.deliveryFlg);
9
- const isReady = Boolean(referrerUrl &&
10
- regions &&
11
- regionsDelivery &&
12
- slug === BIBLIOGLOBUS_SLUG &&
13
- defaultRegion?.key &&
14
- defaultRegion?.value);
15
- useEffect(() => {
16
- if (!isReady || !defaultRegion || !defaultRegion.key || !defaultRegion.value) {
17
- return;
18
- }
19
- onRegionChange?.({ key: defaultRegion.key, text: defaultRegion.value });
20
- onRegionHasDeliveryChange?.(regionHasDelivery);
21
- onMethodObtainChange?.(regionHasDelivery ? 'courier' : 'office');
22
- }, [
23
- isReady,
24
- defaultRegion,
25
- regionHasDelivery,
26
- onRegionChange,
27
- onRegionHasDeliveryChange,
28
- onMethodObtainChange,
29
- ]);
30
- };
31
- //# sourceMappingURL=useBiblioglobusDefaultRegion.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useBiblioglobusDefaultRegion.js","sourceRoot":"","sources":["../../../src/retail/hooks/useBiblioglobusDefaultRegion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAIlE,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,IAO5C,EAAE,EAAE;IACH,MAAM,EACJ,WAAW,EACX,OAAO,EACP,eAAe,EACf,cAAc,EACd,yBAAyB,EACzB,oBAAoB,GACrB,GAAG,IAAI,CAAC;IAET,MAAM,IAAI,GAAG,WAAW,CAAC,CAAC,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,MAAM,aAAa,GAAG,OAAO,EAAE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,KAAK,WAAW,CAAC,CAAC;IAC5E,MAAM,iBAAiB,GAAG,OAAO,CAC/B,eAAe,EAAE,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,KAAK,WAAW,CAAC,EAAE,WAAW,CAC1E,CAAC;IACF,MAAM,OAAO,GAAG,OAAO,CACrB,WAAW;QACT,OAAO;QACP,eAAe;QACf,IAAI,KAAK,iBAAiB;QAC1B,aAAa,EAAE,GAAG;QAClB,aAAa,EAAE,KAAK,CACvB,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,CAAC,OAAO,IAAI,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;YAC5E,OAAO;SACR;QAED,cAAc,EAAE,CAAC,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,EAAE,IAAI,EAAE,aAAa,CAAC,KAAK,EAAE,CAAC,CAAC;QACxE,yBAAyB,EAAE,CAAC,iBAAiB,CAAC,CAAC;QAC/C,oBAAoB,EAAE,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;IACnE,CAAC,EAAE;QACD,OAAO;QACP,aAAa;QACb,iBAAiB;QACjB,cAAc;QACd,yBAAyB;QACzB,oBAAoB;KACrB,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- import { type Option } from '../../ui-kit/Select/Option';
2
- declare const BIBLIOGLOBUS_SLUG = "biblioglobus";
3
- export declare const filterPaymentSystems: (systems: Option[], slug: string | null) => Option[];
4
- export { BIBLIOGLOBUS_SLUG };
@@ -1,10 +0,0 @@
1
- const BIBLIOGLOBUS_SLUG = 'biblioglobus';
2
- const UNIONPAY_TEXT = 'UnionPay';
3
- export const filterPaymentSystems = (systems, slug) => {
4
- if (slug !== BIBLIOGLOBUS_SLUG) {
5
- return systems;
6
- }
7
- return systems.filter((system) => system.text === UNIONPAY_TEXT);
8
- };
9
- export { BIBLIOGLOBUS_SLUG };
10
- //# sourceMappingURL=filterPaymentSystems.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filterPaymentSystems.js","sourceRoot":"","sources":["../../../src/retail/utils/filterPaymentSystems.ts"],"names":[],"mappings":"AAEA,MAAM,iBAAiB,GAAG,cAAc,CAAC;AACzC,MAAM,aAAa,GAAG,UAAU,CAAC;AAEjC,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,OAAiB,EAAE,IAAmB,EAAY,EAAE;IACvF,IAAI,IAAI,KAAK,iBAAiB,EAAE;QAC9B,OAAO,OAAO,CAAC;KAChB;IAED,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;AACnE,CAAC,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,10 +0,0 @@
1
- import { type Option } from '../../ui-kit/Select/Option';
2
- import { type RegionDelivery } from '../hooks/useBiblioglobusDefaultRegion';
3
- export declare const getRegionDeliveryStatus: (regionsDelivery: RegionDelivery[] | undefined, value: Option) => boolean | undefined;
4
- export declare const calculateRegionHasDelivery: (args: {
5
- isDebit: boolean;
6
- isEsiaAuth: boolean;
7
- isSalaryCard: boolean;
8
- isDeliveryActive: boolean;
9
- regionDelivery?: boolean;
10
- }) => boolean | undefined;
@@ -1,9 +0,0 @@
1
- export const getRegionDeliveryStatus = (regionsDelivery, value) => regionsDelivery?.find((_) => _.regionCode === String(value.key))?.deliveryFlg;
2
- export const calculateRegionHasDelivery = (args) => {
3
- const { isDebit, isEsiaAuth, isSalaryCard, isDeliveryActive, regionDelivery } = args;
4
- if (isDebit) {
5
- return isEsiaAuth && !isSalaryCard && isDeliveryActive && regionDelivery;
6
- }
7
- return isDeliveryActive && regionDelivery;
8
- };
9
- //# sourceMappingURL=hasDelivery.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hasDelivery.js","sourceRoot":"","sources":["../../../src/retail/utils/hasDelivery.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,eAA6C,EAC7C,KAAa,EACb,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC;AAEnF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,IAM1C,EAAE,EAAE;IACH,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACrF,IAAI,OAAO,EAAE;QACX,OAAO,UAAU,IAAI,CAAC,YAAY,IAAI,gBAAgB,IAAI,cAAc,CAAC;KAC1E;IAED,OAAO,gBAAgB,IAAI,cAAc,CAAC;AAC5C,CAAC,CAAC"}
@@ -1 +0,0 @@
1
- export declare function getCardSlugFromUrl(url: string): string | null;
@@ -1,9 +0,0 @@
1
- export function getCardSlugFromUrl(url) {
2
- const lastSegment = url.split('/').filter(Boolean).pop();
3
- if (!lastSegment) {
4
- return null;
5
- }
6
- const parts = lastSegment.split('-');
7
- return parts.length > 1 ? parts[parts.length - 1] : null;
8
- }
9
- //# sourceMappingURL=getSlugFromUrl.js.map