@redneckz/wildless-cms-uni-blocks 0.14.974 → 0.14.976
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/bundle/blocks.schema.json +1 -1
- package/bundle/bundle.umd.js +30 -143
- package/bundle/bundle.umd.min.js +1 -1
- package/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/bundle/components/GalleryLayout/utils.d.ts +1 -1
- package/bundle/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/bundle/model/HeadlineType.d.ts +15 -8
- package/bundle/retail/api/createUserTaskDebit.d.ts +0 -1
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
- package/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
- package/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
- package/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/dist/components/GalleryLayout/utils.d.ts +1 -1
- package/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/dist/components/ProductBlock/ProductBlock.js +15 -10
- package/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/dist/model/HeadlineType.d.ts +15 -8
- package/dist/retail/api/createUserTaskDebit.d.ts +0 -1
- package/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/dist/retail/components/Fields/AddressRetailField.js +0 -20
- package/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/dist/retail/components/Fields/PaymentSystemField.js +2 -14
- package/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/dist/retail/components/Fields/RegionRetailField.js +7 -20
- package/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
- package/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
- package/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
- package/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/lib/components/GalleryLayout/utils.d.ts +1 -1
- package/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/lib/components/ProductBlock/ProductBlock.js +15 -10
- package/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/lib/model/HeadlineType.d.ts +15 -8
- package/lib/retail/api/createUserTaskDebit.d.ts +0 -1
- package/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/lib/retail/components/Fields/AddressRetailField.js +0 -20
- package/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/lib/retail/components/Fields/PaymentSystemField.js +2 -14
- package/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/lib/retail/components/Fields/RegionRetailField.js +7 -20
- package/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/bundle/bundle.umd.js +30 -143
- package/mobile/bundle/bundle.umd.min.js +1 -1
- package/mobile/bundle/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/mobile/bundle/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/mobile/bundle/components/GalleryLayout/utils.d.ts +1 -1
- package/mobile/bundle/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/mobile/bundle/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/bundle/model/HeadlineType.d.ts +15 -8
- package/mobile/bundle/retail/api/createUserTaskDebit.d.ts +0 -1
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
- package/mobile/dist/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
- package/mobile/dist/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
- package/mobile/dist/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/dist/components/GalleryLayout/utils.d.ts +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlock.js +15 -10
- package/mobile/dist/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/dist/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/dist/model/HeadlineType.d.ts +15 -8
- package/mobile/dist/retail/api/createUserTaskDebit.d.ts +0 -1
- package/mobile/dist/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/dist/retail/components/Fields/AddressRetailField.js +0 -20
- package/mobile/dist/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/PaymentSystemField.js +2 -14
- package/mobile/dist/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/dist/retail/components/Fields/RegionRetailField.js +7 -20
- package/mobile/dist/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.d.ts +1 -7
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js +1 -2
- package/mobile/lib/components/ApplicationLeadForm/getLeadFormTaskData.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js +4 -24
- package/mobile/lib/components/ApplicationLeadForm/useApplicationLeadApi.js.map +1 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.d.ts +0 -1
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js +0 -4
- package/mobile/lib/components/ApplicationLeadForm/useInitApplicationLead.js.map +1 -1
- package/mobile/lib/components/GalleryLayout/utils.d.ts +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.d.ts +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlock.js +15 -10
- package/mobile/lib/components/ProductBlock/ProductBlock.js.map +1 -1
- package/mobile/lib/components/ProductBlock/ProductBlockContent.d.ts +2 -2
- package/mobile/lib/model/HeadlineType.d.ts +15 -8
- package/mobile/lib/retail/api/createUserTaskDebit.d.ts +0 -1
- package/mobile/lib/retail/api/createUserTaskDebit.js.map +1 -1
- package/mobile/lib/retail/components/Fields/AddressRetailField.js +0 -20
- package/mobile/lib/retail/components/Fields/AddressRetailField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/PaymentSystemField.js +2 -14
- package/mobile/lib/retail/components/Fields/PaymentSystemField.js.map +1 -1
- package/mobile/lib/retail/components/Fields/RegionRetailField.js +7 -20
- package/mobile/lib/retail/components/Fields/RegionRetailField.js.map +1 -1
- package/mobile/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +5 -14
- package/mobile/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +3 -32
- package/mobile/src/components/ApplicationLeadForm/useInitApplicationLead.ts +0 -6
- package/mobile/src/components/ProductBlock/ProductBlock.tsx +26 -17
- package/mobile/src/components/ProductBlock/ProductBlockContent.ts +2 -5
- package/mobile/src/model/HeadlineType.ts +16 -8
- package/mobile/src/retail/api/createUserTaskDebit.ts +0 -1
- package/mobile/src/retail/components/Fields/AddressRetailField.tsx +0 -26
- package/mobile/src/retail/components/Fields/PaymentSystemField.tsx +2 -21
- package/mobile/src/retail/components/Fields/RegionRetailField.tsx +7 -22
- package/package.json +2 -2
- package/src/components/ApplicationLeadForm/getLeadFormTaskData.ts +5 -14
- package/src/components/ApplicationLeadForm/useApplicationLeadApi.tsx +3 -32
- package/src/components/ApplicationLeadForm/useInitApplicationLead.ts +0 -6
- package/src/components/ProductBlock/ProductBlock.fixture.tsx +16 -7
- package/src/components/ProductBlock/ProductBlock.tsx +26 -17
- package/src/components/ProductBlock/ProductBlockContent.ts +2 -5
- package/src/model/HeadlineType.ts +16 -8
- package/src/retail/api/createUserTaskDebit.ts +0 -1
- package/src/retail/components/Fields/AddressRetailField.tsx +0 -26
- package/src/retail/components/Fields/PaymentSystemField.tsx +2 -21
- package/src/retail/components/Fields/RegionRetailField.tsx +7 -22
- package/bundle/retail/api/getClaimChannel.d.ts +0 -8
- package/bundle/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/bundle/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/bundle/retail/utils/hasDelivery.d.ts +0 -10
- package/bundle/utils/getSlugFromUrl.d.ts +0 -1
- package/dist/retail/api/getClaimChannel.d.ts +0 -8
- package/dist/retail/api/getClaimChannel.js +0 -9
- package/dist/retail/api/getClaimChannel.js.map +0 -1
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.js +0 -34
- package/dist/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
- package/dist/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/dist/retail/utils/filterPaymentSystems.js +0 -13
- package/dist/retail/utils/filterPaymentSystems.js.map +0 -1
- package/dist/retail/utils/hasDelivery.d.ts +0 -10
- package/dist/retail/utils/hasDelivery.js +0 -13
- package/dist/retail/utils/hasDelivery.js.map +0 -1
- package/dist/utils/getSlugFromUrl.d.ts +0 -1
- package/dist/utils/getSlugFromUrl.js +0 -12
- package/dist/utils/getSlugFromUrl.js.map +0 -1
- package/lib/retail/api/getClaimChannel.d.ts +0 -8
- package/lib/retail/api/getClaimChannel.js +0 -6
- package/lib/retail/api/getClaimChannel.js.map +0 -1
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.js +0 -31
- package/lib/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
- package/lib/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/lib/retail/utils/filterPaymentSystems.js +0 -10
- package/lib/retail/utils/filterPaymentSystems.js.map +0 -1
- package/lib/retail/utils/hasDelivery.d.ts +0 -10
- package/lib/retail/utils/hasDelivery.js +0 -9
- package/lib/retail/utils/hasDelivery.js.map +0 -1
- package/lib/utils/getSlugFromUrl.d.ts +0 -1
- package/lib/utils/getSlugFromUrl.js +0 -9
- package/lib/utils/getSlugFromUrl.js.map +0 -1
- package/mobile/bundle/retail/api/getClaimChannel.d.ts +0 -8
- package/mobile/bundle/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/mobile/bundle/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/mobile/bundle/retail/utils/hasDelivery.d.ts +0 -10
- package/mobile/bundle/utils/getSlugFromUrl.d.ts +0 -1
- package/mobile/dist/retail/api/getClaimChannel.d.ts +0 -8
- package/mobile/dist/retail/api/getClaimChannel.js +0 -9
- package/mobile/dist/retail/api/getClaimChannel.js.map +0 -1
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.js +0 -34
- package/mobile/dist/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
- package/mobile/dist/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/mobile/dist/retail/utils/filterPaymentSystems.js +0 -13
- package/mobile/dist/retail/utils/filterPaymentSystems.js.map +0 -1
- package/mobile/dist/retail/utils/hasDelivery.d.ts +0 -10
- package/mobile/dist/retail/utils/hasDelivery.js +0 -13
- package/mobile/dist/retail/utils/hasDelivery.js.map +0 -1
- package/mobile/dist/utils/getSlugFromUrl.d.ts +0 -1
- package/mobile/dist/utils/getSlugFromUrl.js +0 -12
- package/mobile/dist/utils/getSlugFromUrl.js.map +0 -1
- package/mobile/lib/retail/api/getClaimChannel.d.ts +0 -8
- package/mobile/lib/retail/api/getClaimChannel.js +0 -6
- package/mobile/lib/retail/api/getClaimChannel.js.map +0 -1
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.d.ts +0 -14
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.js +0 -31
- package/mobile/lib/retail/hooks/useBiblioglobusDefaultRegion.js.map +0 -1
- package/mobile/lib/retail/utils/filterPaymentSystems.d.ts +0 -4
- package/mobile/lib/retail/utils/filterPaymentSystems.js +0 -10
- package/mobile/lib/retail/utils/filterPaymentSystems.js.map +0 -1
- package/mobile/lib/retail/utils/hasDelivery.d.ts +0 -10
- package/mobile/lib/retail/utils/hasDelivery.js +0 -9
- package/mobile/lib/retail/utils/hasDelivery.js.map +0 -1
- package/mobile/lib/utils/getSlugFromUrl.d.ts +0 -1
- package/mobile/lib/utils/getSlugFromUrl.js +0 -9
- package/mobile/lib/utils/getSlugFromUrl.js.map +0 -1
- package/mobile/src/retail/api/getClaimChannel.ts +0 -18
- package/mobile/src/retail/hooks/useBiblioglobusDefaultRegion.ts +0 -56
- package/mobile/src/retail/utils/filterPaymentSystems.ts +0 -14
- package/mobile/src/retail/utils/hasDelivery.ts +0 -22
- package/mobile/src/utils/getSlugFromUrl.ts +0 -10
- package/src/retail/api/getClaimChannel.ts +0 -18
- package/src/retail/hooks/useBiblioglobusDefaultRegion.ts +0 -56
- package/src/retail/utils/filterPaymentSystems.ts +0 -14
- package/src/retail/utils/hasDelivery.ts +0 -22
- package/src/utils/getSlugFromUrl.ts +0 -10
|
@@ -994,20 +994,25 @@
|
|
|
994
994
|
return result;
|
|
995
995
|
}
|
|
996
996
|
|
|
997
|
-
const ProductBlock = UniBlock(({ className, padding, defaultPadding,
|
|
998
|
-
const
|
|
999
|
-
|
|
997
|
+
const ProductBlock = UniBlock(({ className, padding, defaultPadding, dynamicQueryParamText = {}, dynamicTextSource, description, title, ...rest }) => {
|
|
998
|
+
const { textType } = dynamicQueryParamText;
|
|
999
|
+
const formatText = getFormatDescription(dynamicQueryParamText, dynamicTextSource?.list, textType === 'title' ? title : description);
|
|
1000
|
+
const textProps = {
|
|
1001
|
+
title: textType === 'title' ? formatText : title,
|
|
1002
|
+
description: textType === 'description' ? formatText : description,
|
|
1003
|
+
};
|
|
1004
|
+
return (jsx(BlockWrapper, { className: style('overflow-hidden flex flex-col gap-3xl box-border', className), padding: "p-0", ...rest, children: jsx(BaseProductTile, { defaultPadding: defaultPadding || 'p-6xl', padding: padding, className: "grow h-full", ...textProps, ...rest }) }));
|
|
1000
1005
|
});
|
|
1001
|
-
const getFormatDescription = (
|
|
1002
|
-
const {
|
|
1006
|
+
const getFormatDescription = (dynamicQueryParamText = {}, valuesList = [], text = '') => {
|
|
1007
|
+
const { queryParam, value } = dynamicQueryParamText;
|
|
1003
1008
|
const sessionQuery = saveSessionQuery();
|
|
1004
|
-
const utmValue =
|
|
1005
|
-
const dynamicValue = valuesList.find((item) => item?.id === utmValue)?.value;
|
|
1006
|
-
return dynamicValue ?
|
|
1009
|
+
const utmValue = getQueryParamValue(queryParam ?? 'utm_source', sessionQuery);
|
|
1010
|
+
const dynamicValue = valuesList.find((item) => item?.id?.toLowerCase() === utmValue?.toLowerCase())?.value;
|
|
1011
|
+
return dynamicValue ? text?.replace(String(value), dynamicValue) : text;
|
|
1007
1012
|
};
|
|
1008
|
-
const
|
|
1013
|
+
const getQueryParamValue = (queryParam, queryString) => {
|
|
1009
1014
|
const params = new URLSearchParams(queryString);
|
|
1010
|
-
return params.get(
|
|
1015
|
+
return params.get(queryParam);
|
|
1011
1016
|
};
|
|
1012
1017
|
|
|
1013
1018
|
const AdTile = JSX((props) => {
|
|
@@ -4564,15 +4569,6 @@
|
|
|
4564
4569
|
const mapByIndex = (points, index) => points.map((_) => _.coords?.[index]);
|
|
4565
4570
|
const getArraySumAndAverage = (arr) => arr.length && arr.reduce((a, b) => a + b) / arr.length;
|
|
4566
4571
|
|
|
4567
|
-
function getCardSlugFromUrl(url) {
|
|
4568
|
-
const lastSegment = url.split('/').filter(Boolean).pop();
|
|
4569
|
-
if (!lastSegment) {
|
|
4570
|
-
return null;
|
|
4571
|
-
}
|
|
4572
|
-
const parts = lastSegment.split('-');
|
|
4573
|
-
return parts.length > 1 ? parts[parts.length - 1] : null;
|
|
4574
|
-
}
|
|
4575
|
-
|
|
4576
4572
|
const fetchRegionOffices = async (regionKey) => {
|
|
4577
4573
|
const response = await fetchRetailJSON('/public-data/regionOffices', 'POST', {
|
|
4578
4574
|
regionRfCd: {
|
|
@@ -4601,21 +4597,9 @@
|
|
|
4601
4597
|
return result || [];
|
|
4602
4598
|
};
|
|
4603
4599
|
|
|
4604
|
-
const BIBLIOGLOBUS_SLUG = 'biblioglobus';
|
|
4605
|
-
const UNIONPAY_TEXT = 'UnionPay';
|
|
4606
|
-
const filterPaymentSystems = (systems, slug) => {
|
|
4607
|
-
if (slug !== BIBLIOGLOBUS_SLUG) {
|
|
4608
|
-
return systems;
|
|
4609
|
-
}
|
|
4610
|
-
return systems.filter((system) => system.text === UNIONPAY_TEXT);
|
|
4611
|
-
};
|
|
4612
|
-
|
|
4613
|
-
const BIBLIOGLOBUS_OFFICE_ID = '714680716';
|
|
4614
4600
|
const AddressRetailField = JSX(({ field, input }) => {
|
|
4615
4601
|
const [offices, setOffices] = useState([]);
|
|
4616
4602
|
const { data } = useLeadFormData('REGION_RF');
|
|
4617
|
-
const sessionStore = useSessionStore();
|
|
4618
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
4619
4603
|
const regionValue = field('regionRetail')?.value || {};
|
|
4620
4604
|
const addressField = field(input?.name ?? '');
|
|
4621
4605
|
useEffect(() => {
|
|
@@ -4627,20 +4611,6 @@
|
|
|
4627
4611
|
addressField.onChange?.('');
|
|
4628
4612
|
}
|
|
4629
4613
|
}, [regionValue.key]);
|
|
4630
|
-
// Логика для biblioglobus - выбор отделения по умолчанию
|
|
4631
|
-
useEffect(() => {
|
|
4632
|
-
if (!referrerUrl || !offices.length) {
|
|
4633
|
-
return;
|
|
4634
|
-
}
|
|
4635
|
-
const slug = getCardSlugFromUrl(referrerUrl);
|
|
4636
|
-
if (slug === BIBLIOGLOBUS_SLUG) {
|
|
4637
|
-
const defaultOffice = offices.find((office) => office.id?.toString() === BIBLIOGLOBUS_OFFICE_ID);
|
|
4638
|
-
addressField.onChange?.({
|
|
4639
|
-
key: defaultOffice?.id?.toString() || '',
|
|
4640
|
-
text: defaultOffice?.address || '',
|
|
4641
|
-
});
|
|
4642
|
-
}
|
|
4643
|
-
}, [referrerUrl, offices]);
|
|
4644
4614
|
const { points } = useOfficesAtmsMapData({
|
|
4645
4615
|
data: offices,
|
|
4646
4616
|
filtrationState: {},
|
|
@@ -5749,21 +5719,12 @@
|
|
|
5749
5719
|
const PaymentSystemField = JSX(({ field, input }) => {
|
|
5750
5720
|
const [paymentSystemOptions, setPaymentSystemOptions] = useState([]);
|
|
5751
5721
|
const localStore = useLocalStore();
|
|
5752
|
-
const sessionStore = useSessionStore();
|
|
5753
5722
|
useAsyncEffect(async () => {
|
|
5754
5723
|
const { programId } = localStore;
|
|
5755
|
-
if (
|
|
5756
|
-
|
|
5757
|
-
}
|
|
5758
|
-
const fetchedPaymentSystems = await getPaymentSystems(programId);
|
|
5759
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
5760
|
-
if (!referrerUrl) {
|
|
5724
|
+
if (programId) {
|
|
5725
|
+
const fetchedPaymentSystems = await getPaymentSystems(programId);
|
|
5761
5726
|
setPaymentSystemOptions(fetchedPaymentSystems ?? []);
|
|
5762
|
-
return;
|
|
5763
5727
|
}
|
|
5764
|
-
const slug = getCardSlugFromUrl(referrerUrl);
|
|
5765
|
-
const filteredSystems = filterPaymentSystems(fetchedPaymentSystems ?? [], slug);
|
|
5766
|
-
setPaymentSystemOptions(filteredSystems);
|
|
5767
5728
|
}, []);
|
|
5768
5729
|
const items = useMemo(() => paymentSystemOptions?.map((_) => ({ id: _.key, text: _.text })) ?? [], [paymentSystemOptions]);
|
|
5769
5730
|
return (jsx(RadioButtonGroupControl, { label: "\u041F\u043B\u0430\u0442\u0435\u0436\u043D\u0430\u044F \u0441\u0438\u0441\u0442\u0435\u043C\u0430", orientation: "horizontal", items: items, ...field(input?.name ?? '', {
|
|
@@ -5782,49 +5743,11 @@
|
|
|
5782
5743
|
return res || undefined;
|
|
5783
5744
|
};
|
|
5784
5745
|
|
|
5785
|
-
const useBiblioglobusDefaultRegion = (args) => {
|
|
5786
|
-
const { referrerUrl, regions, regionsDelivery, onRegionChange, onRegionHasDeliveryChange, onMethodObtainChange, } = args;
|
|
5787
|
-
const slug = referrerUrl ? getCardSlugFromUrl(referrerUrl) : '';
|
|
5788
|
-
const defaultRegion = regions?.find((region) => region.key === 'REGION_77');
|
|
5789
|
-
const regionHasDelivery = Boolean(regionsDelivery?.find((rd) => rd.regionCode === 'REGION_77')?.deliveryFlg);
|
|
5790
|
-
const isReady = Boolean(referrerUrl &&
|
|
5791
|
-
regions &&
|
|
5792
|
-
regionsDelivery &&
|
|
5793
|
-
slug === BIBLIOGLOBUS_SLUG &&
|
|
5794
|
-
defaultRegion?.key &&
|
|
5795
|
-
defaultRegion?.value);
|
|
5796
|
-
useEffect(() => {
|
|
5797
|
-
if (!isReady || !defaultRegion || !defaultRegion.key || !defaultRegion.value) {
|
|
5798
|
-
return;
|
|
5799
|
-
}
|
|
5800
|
-
onRegionChange?.({ key: defaultRegion.key, text: defaultRegion.value });
|
|
5801
|
-
onRegionHasDeliveryChange?.(regionHasDelivery);
|
|
5802
|
-
onMethodObtainChange?.(regionHasDelivery ? 'courier' : 'office');
|
|
5803
|
-
}, [
|
|
5804
|
-
isReady,
|
|
5805
|
-
defaultRegion,
|
|
5806
|
-
regionHasDelivery,
|
|
5807
|
-
onRegionChange,
|
|
5808
|
-
onRegionHasDeliveryChange,
|
|
5809
|
-
onMethodObtainChange,
|
|
5810
|
-
]);
|
|
5811
|
-
};
|
|
5812
|
-
|
|
5813
|
-
const getRegionDeliveryStatus = (regionsDelivery, value) => regionsDelivery?.find((_) => _.regionCode === String(value.key))?.deliveryFlg;
|
|
5814
|
-
const calculateRegionHasDelivery = (args) => {
|
|
5815
|
-
const { isDebit, isEsiaAuth, isSalaryCard, isDeliveryActive, regionDelivery } = args;
|
|
5816
|
-
if (isDebit) {
|
|
5817
|
-
return isEsiaAuth && !isSalaryCard && isDeliveryActive && regionDelivery;
|
|
5818
|
-
}
|
|
5819
|
-
return isDeliveryActive && regionDelivery;
|
|
5820
|
-
};
|
|
5821
|
-
|
|
5822
5746
|
const RegionRetailField = JSX(({ field, input }) => {
|
|
5823
5747
|
const { programId, productType } = useRetailFormStore();
|
|
5824
5748
|
const { data: regions } = useLeadFormData('REGION_RF');
|
|
5825
5749
|
const { data: regionsDelivery } = useAsyncData('regionsDelivery', getRegionsCardDelivery);
|
|
5826
5750
|
const { data: productSettings } = useLeadFormData(getCurrentProductSettings(productType));
|
|
5827
|
-
const sessionStore = useSessionStore();
|
|
5828
5751
|
const isDebit = productType === 'debitCard';
|
|
5829
5752
|
const isSalaryCard = programId === '38';
|
|
5830
5753
|
const isEsiaAuth = Boolean(field('esiaAccountTypeCd')?.value?.key);
|
|
@@ -5833,26 +5756,17 @@
|
|
|
5833
5756
|
const handleChangeRegion = field('regionRetail')?.onChange;
|
|
5834
5757
|
const handleChangeRegionHasDelivery = field('regionHasDelivery')?.onChange;
|
|
5835
5758
|
const handleChangeMethodObtain = field('methodObtain')?.onChange;
|
|
5836
|
-
useBiblioglobusDefaultRegion({
|
|
5837
|
-
referrerUrl: sessionStore.referrerUrl ?? undefined,
|
|
5838
|
-
regions,
|
|
5839
|
-
regionsDelivery,
|
|
5840
|
-
onRegionChange: handleChangeRegion,
|
|
5841
|
-
onRegionHasDeliveryChange: handleChangeRegionHasDelivery,
|
|
5842
|
-
onMethodObtainChange: handleChangeMethodObtain,
|
|
5843
|
-
});
|
|
5844
5759
|
const onChange = useCallback((value) => {
|
|
5845
|
-
const regionHasDelivery =
|
|
5846
|
-
|
|
5847
|
-
|
|
5848
|
-
|
|
5849
|
-
|
|
5850
|
-
|
|
5851
|
-
});
|
|
5760
|
+
const regionHasDelivery = isDebit
|
|
5761
|
+
? isEsiaAuth &&
|
|
5762
|
+
!isSalaryCard &&
|
|
5763
|
+
isDeliveryActive &&
|
|
5764
|
+
regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg
|
|
5765
|
+
: isDeliveryActive && regionsDelivery?.find((_) => _.regionCode === value.key)?.deliveryFlg;
|
|
5852
5766
|
handleChangeRegionHasDelivery?.(regionHasDelivery);
|
|
5853
5767
|
handleChangeMethodObtain?.(regionHasDelivery ? 'courier' : 'office');
|
|
5854
5768
|
handleChangeRegion?.(value);
|
|
5855
|
-
}, [
|
|
5769
|
+
}, [regionsDelivery, isDeliveryActive, isEsiaAuth]);
|
|
5856
5770
|
useEffect(() => {
|
|
5857
5771
|
if (!isEsiaAuth && isDebit) {
|
|
5858
5772
|
handleChangeRegionHasDelivery?.(false);
|
|
@@ -6056,11 +5970,6 @@
|
|
|
6056
5970
|
return res || {};
|
|
6057
5971
|
};
|
|
6058
5972
|
|
|
6059
|
-
const getClaimChannel = async () => {
|
|
6060
|
-
const res = await fetchRetailJSON('light-api-cash/v1/claimChannel/', 'GET');
|
|
6061
|
-
return res || [];
|
|
6062
|
-
};
|
|
6063
|
-
|
|
6064
5973
|
const getLastTaskStatus = async (body) => {
|
|
6065
5974
|
const res = await fetchRetailJSON('/user-data/getLastStatus', 'POST', body);
|
|
6066
5975
|
return res?.statusCd === 'DRAFT' ? res?.taskId : null;
|
|
@@ -6748,7 +6657,7 @@
|
|
|
6748
6657
|
...consents,
|
|
6749
6658
|
};
|
|
6750
6659
|
};
|
|
6751
|
-
const getDebitLeadFormTaskData = (
|
|
6660
|
+
const getDebitLeadFormTaskData = (formData, programId, marketingInfo) => {
|
|
6752
6661
|
const { name, surname, middleName, limitedBirthday, phone, email } = formData;
|
|
6753
6662
|
const taskSource = getTaskSource(marketingInfo?.utm_source);
|
|
6754
6663
|
return {
|
|
@@ -6771,7 +6680,6 @@
|
|
|
6771
6680
|
],
|
|
6772
6681
|
marketingInfo,
|
|
6773
6682
|
},
|
|
6774
|
-
...(claimChannelCode ? { claimChannelCode } : {}),
|
|
6775
6683
|
};
|
|
6776
6684
|
};
|
|
6777
6685
|
const getTaskSource = (source) => {
|
|
@@ -6847,7 +6755,6 @@
|
|
|
6847
6755
|
});
|
|
6848
6756
|
const referalData = leadFormStore.referalData;
|
|
6849
6757
|
const marketingInfo = sessionStore.marketingInfo;
|
|
6850
|
-
const referrerUrl = sessionStore.referrerUrl;
|
|
6851
6758
|
if (!profileId) {
|
|
6852
6759
|
throw new Error();
|
|
6853
6760
|
}
|
|
@@ -6861,7 +6768,6 @@
|
|
|
6861
6768
|
marketingInfo,
|
|
6862
6769
|
saveUserData,
|
|
6863
6770
|
sendAspects,
|
|
6864
|
-
referrerUrl,
|
|
6865
6771
|
});
|
|
6866
6772
|
verifyPhoneDialog.close();
|
|
6867
6773
|
if (productType === 'debitCard') {
|
|
@@ -6978,29 +6884,14 @@
|
|
|
6978
6884
|
.filter((_) => formData[_])
|
|
6979
6885
|
.map((_) => consents[_]?.text);
|
|
6980
6886
|
};
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
return undefined;
|
|
6985
|
-
}
|
|
6986
|
-
const claimData = await getClaimChannel();
|
|
6987
|
-
return claimData.find((item) => item.key === slug)?.code;
|
|
6988
|
-
};
|
|
6989
|
-
const updateUserData = async ({ programId, profileId, formData, productType, referalData, marketingInfo, saveUserData, sendAspects, referrerUrl, }) => {
|
|
6887
|
+
const updateUserData = async ({ programId, profileId, formData, productType, referalData, marketingInfo, saveUserData, sendAspects, }) => {
|
|
6888
|
+
let taskId;
|
|
6889
|
+
let participantId;
|
|
6990
6890
|
const transformedConsents = transformConsentsFields(formData, productType);
|
|
6991
|
-
const slug = getCardSlugFromUrl(referrerUrl);
|
|
6992
6891
|
await updateUserProfile(getUpdateUserProfileData(profileId, formData, transformedConsents));
|
|
6993
6892
|
try {
|
|
6994
|
-
let taskId;
|
|
6995
|
-
let participantId;
|
|
6996
6893
|
if (productType === 'debitCard') {
|
|
6997
|
-
const
|
|
6998
|
-
const debitData = await createUserTaskDebit(getDebitLeadFormTaskData({
|
|
6999
|
-
formData,
|
|
7000
|
-
programId,
|
|
7001
|
-
marketingInfo,
|
|
7002
|
-
claimChannelCode,
|
|
7003
|
-
}));
|
|
6894
|
+
const debitData = await createUserTaskDebit(getDebitLeadFormTaskData(formData, programId, marketingInfo));
|
|
7004
6895
|
taskId = debitData.taskId;
|
|
7005
6896
|
participantId = debitData.participantId;
|
|
7006
6897
|
}
|
|
@@ -7430,10 +7321,6 @@
|
|
|
7430
7321
|
leadFormStore.productType = productType;
|
|
7431
7322
|
sessionStore.marketingInfo = getMarketingInfo(queryFromStorage, sessionStore);
|
|
7432
7323
|
sessionStore.isNewMicroservice = isNewMicroservice || null;
|
|
7433
|
-
const referrer = globalThis.document.referrer;
|
|
7434
|
-
if (referrer) {
|
|
7435
|
-
sessionStore.referrerUrl = referrer;
|
|
7436
|
-
}
|
|
7437
7324
|
}, [queryFromStorage]);
|
|
7438
7325
|
useEffect(() => {
|
|
7439
7326
|
const params = new URLSearchParams(decodeURIComponent(globalThis.location?.search));
|
|
@@ -12969,7 +12856,7 @@
|
|
|
12969
12856
|
slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
|
|
12970
12857
|
});
|
|
12971
12858
|
|
|
12972
|
-
const packageVersion = "0.14.
|
|
12859
|
+
const packageVersion = "0.14.975";
|
|
12973
12860
|
|
|
12974
12861
|
exports.Blocks = Blocks;
|
|
12975
12862
|
exports.ContentPage = ContentPage;
|