@redneckz/wildless-cms-uni-blocks 0.14.1042 → 0.14.1043

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 (53) hide show
  1. package/bundle/bundle.umd.js +22 -6
  2. package/bundle/bundle.umd.min.js +1 -1
  3. package/bundle/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
  4. package/bundle/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
  5. package/bundle/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
  6. package/dist/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
  7. package/dist/retail/components/DraftDialog/DraftDialog.js +3 -8
  8. package/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  9. package/dist/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
  10. package/dist/retail/components/DraftDialog/DraftDialogContent.js +11 -0
  11. package/dist/retail/components/DraftDialog/DraftDialogContent.js.map +1 -0
  12. package/dist/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
  13. package/dist/retail/components/DraftDialog/creditProgramCodes.js +17 -1
  14. package/dist/retail/components/DraftDialog/creditProgramCodes.js.map +1 -1
  15. package/lib/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
  16. package/lib/retail/components/DraftDialog/DraftDialog.js +5 -10
  17. package/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  18. package/lib/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
  19. package/lib/retail/components/DraftDialog/DraftDialogContent.js +9 -0
  20. package/lib/retail/components/DraftDialog/DraftDialogContent.js.map +1 -0
  21. package/lib/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
  22. package/lib/retail/components/DraftDialog/creditProgramCodes.js +15 -0
  23. package/lib/retail/components/DraftDialog/creditProgramCodes.js.map +1 -1
  24. package/mobile/bundle/bundle.umd.js +22 -6
  25. package/mobile/bundle/bundle.umd.min.js +1 -1
  26. package/mobile/bundle/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
  27. package/mobile/bundle/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
  28. package/mobile/bundle/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
  29. package/mobile/dist/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
  30. package/mobile/dist/retail/components/DraftDialog/DraftDialog.js +3 -8
  31. package/mobile/dist/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  32. package/mobile/dist/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
  33. package/mobile/dist/retail/components/DraftDialog/DraftDialogContent.js +11 -0
  34. package/mobile/dist/retail/components/DraftDialog/DraftDialogContent.js.map +1 -0
  35. package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
  36. package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.js +17 -1
  37. package/mobile/dist/retail/components/DraftDialog/creditProgramCodes.js.map +1 -1
  38. package/mobile/lib/retail/components/DraftDialog/DraftDialog.d.ts +1 -1
  39. package/mobile/lib/retail/components/DraftDialog/DraftDialog.js +5 -10
  40. package/mobile/lib/retail/components/DraftDialog/DraftDialog.js.map +1 -1
  41. package/mobile/lib/retail/components/DraftDialog/DraftDialogContent.d.ts +10 -0
  42. package/mobile/lib/retail/components/DraftDialog/DraftDialogContent.js +9 -0
  43. package/mobile/lib/retail/components/DraftDialog/DraftDialogContent.js.map +1 -0
  44. package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.d.ts +2 -0
  45. package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.js +15 -0
  46. package/mobile/lib/retail/components/DraftDialog/creditProgramCodes.js.map +1 -1
  47. package/mobile/src/retail/components/DraftDialog/DraftDialog.tsx +14 -39
  48. package/mobile/src/retail/components/DraftDialog/DraftDialogContent.tsx +49 -0
  49. package/mobile/src/retail/components/DraftDialog/creditProgramCodes.ts +24 -0
  50. package/package.json +1 -1
  51. package/src/retail/components/DraftDialog/DraftDialog.tsx +14 -39
  52. package/src/retail/components/DraftDialog/DraftDialogContent.tsx +49 -0
  53. package/src/retail/components/DraftDialog/creditProgramCodes.ts +24 -0
@@ -1,4 +1,4 @@
1
- import type { OnCloseProps } from '../../../model/OnCloseProps';
1
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
2
2
  import { type Task } from '../../api/draftTasksKZO';
3
3
  import { type DraftTaskType } from '../../model/DraftTaskType';
4
4
  export interface DraftDialogProps extends OnCloseProps {
@@ -0,0 +1,10 @@
1
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
2
+ import { type getProductData } from './utils';
3
+ export interface DraftDialogContentProps extends OnCloseProps {
4
+ createdDate: string;
5
+ productData: ReturnType<typeof getProductData>;
6
+ isFromLead: boolean;
7
+ handleGoToDraft: () => void;
8
+ handleGoToNewTask: () => void;
9
+ }
10
+ export declare const DraftDialogContent: import("@redneckz/uni-jsx").UNIComponent<DraftDialogContentProps, any, any>;
@@ -1,3 +1,4 @@
1
+ import { type DraftTaskType } from '../../model/DraftTaskType';
1
2
  export declare const creditCodesToProgrammIdMap: {
2
3
  credit_cash: string;
3
4
  credit_cash_single_doc: string;
@@ -37,3 +38,4 @@ export declare const creditProgramCodeToProductIdMap: {
37
38
  summer_cash: string;
38
39
  summer_cash_pens: string;
39
40
  };
41
+ export declare const getCreditProgramTaskType: (creditProgramCode?: string, isDebit?: boolean) => DraftTaskType | undefined;
@@ -1,4 +1,4 @@
1
- import type { OnCloseProps } from '../../../model/OnCloseProps';
1
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
2
2
  import { type Task } from '../../api/draftTasksKZO';
3
3
  import { type DraftTaskType } from '../../model/DraftTaskType';
4
4
  export interface DraftDialogProps extends OnCloseProps {
@@ -5,26 +5,21 @@ const uni_jsx_1 = require("@redneckz/uni-jsx");
5
5
  const hooks_1 = require("@redneckz/uni-jsx/lib/hooks");
6
6
  const locationNavigator_1 = require("../../../external/locationNavigator");
7
7
  const Dialog_1 = require("../../../ui-kit/DialogManager/Dialog");
8
- const Heading_1 = require("../../../ui-kit/Heading/Heading");
9
- const formatDate_1 = require("../../../utils/formatDate");
10
8
  const noop_1 = require("../../../utils/noop");
11
9
  const sendMessage_1 = require("../../api/sendMessage");
12
10
  const useRetailFormStore_1 = require("../../hooks/useRetailFormStore");
13
11
  const checkNewMicroservice_1 = require("../../utils/checkNewMicroservice");
14
12
  const creditProgramCodes_1 = require("./creditProgramCodes");
15
- const DraftActionButton_1 = require("./DraftActionButton");
13
+ const DraftDialogContent_1 = require("./DraftDialogContent");
16
14
  const parseDraftTask_1 = require("./parseDraftTask");
17
15
  const utils_1 = require("./utils");
18
- const getTaskTypeOrDebit = (taskType, isDebit) => {
19
- return taskType || (isDebit ? 'debit' : undefined);
20
- };
21
16
  exports.DraftDialog = (0, uni_jsx_1.JSX)(function ({ task, taskType, isDebit, isFromLead = false, sendAspects = noop_1.noop, onClose = noop_1.noop, }) {
22
17
  const retailFormStore = (0, useRetailFormStore_1.useRetailFormStore)();
23
18
  const navigator = (0, locationNavigator_1.locationNavigator)();
24
19
  const isNewMicroservice = (0, checkNewMicroservice_1.checkNewMicroservice)();
25
20
  const { participants, participant, creditProgram, createdDate = '', id: taskId } = task;
26
21
  const programmId = creditProgramCodes_1.creditProgramCodeToProductIdMap[creditProgram.code];
27
- const productData = (0, utils_1.getProductData)(getTaskTypeOrDebit(taskType, isDebit));
22
+ const productData = (0, utils_1.getProductData)(taskType ?? (0, creditProgramCodes_1.getCreditProgramTaskType)(task.creditProgram.code, isDebit));
28
23
  const currentParticipant = participant || participants?.[0];
29
24
  const { id: participantId, profile } = currentParticipant || {};
30
25
  const handleGoToDraft = (0, hooks_1.useCallback)(() => {
@@ -54,6 +49,6 @@ exports.DraftDialog = (0, uni_jsx_1.JSX)(function ({ task, taskType, isDebit, is
54
49
  }
55
50
  navigator.assign(productData.newTaskLink);
56
51
  }, [task.id, productData.newTaskLink, isNewMicroservice]);
57
- return ((0, jsx_runtime_1.jsx)(Dialog_1.Dialog, { onClose: onClose, children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [(0, jsx_runtime_1.jsx)(Heading_1.Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-m max-w-lg", children: [(0, jsx_runtime_1.jsx)(DraftActionButton_1.DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${(0, formatDate_1.formatDate)(new Date(createdDate))}` : '', onClick: handleGoToDraft, name: "go-to-draft-button" }), (0, jsx_runtime_1.jsx)(DraftActionButton_1.DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask, name: "go-to-current-task-button" })] })] }) }));
52
+ return ((0, jsx_runtime_1.jsx)(Dialog_1.Dialog, { onClose: onClose, children: (0, jsx_runtime_1.jsx)(DraftDialogContent_1.DraftDialogContent, { createdDate: createdDate, productData: productData, isFromLead: isFromLead, handleGoToDraft: handleGoToDraft, handleGoToNewTask: handleGoToNewTask, onClose: onClose }) }));
58
53
  });
59
54
  //# sourceMappingURL=DraftDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DraftDialog.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialog.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAA0D;AAC1D,2EAAwE;AAExE,iEAA8D;AAC9D,6DAA0D;AAC1D,0DAAuD;AACvD,8CAA2C;AAE3C,uDAAo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C,CAAC,CAAC,eAAe,IAAA,uBAAU,EAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAClF,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,oBAAoB,GACzB,EACF,uBAAC,qCAAiB,IAChB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,sBAAsB,EACnF,IAAI,EAAC,aAAa,EAClB,WAAW,EAAE,WAAW,CAAC,WAAW,EACpC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,EACjD,IAAI,EAAC,2BAA2B,GAChC,IACE,IACF,GACC,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"DraftDialog.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialog.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAA0D;AAC1D,2EAAwE;AAExE,iEAA8D;AAC9D,8CAA2C;AAE3C,uDAAoD;AACpD,uEAAoE;AAEpE,2EAAwE;AACxE,6DAAiG;AACjG,6DAA0D;AAC1D,qDAAkD;AAClD,mCAAyC;AAU5B,QAAA,WAAW,GAAG,IAAA,aAAG,EAAmB,UAAU,EACzD,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,UAAU,GAAG,KAAK,EAClB,WAAW,GAAG,WAAI,EAClB,OAAO,GAAG,WAAI,GACf;IACC,MAAM,eAAe,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAC7C,MAAM,SAAS,GAAG,IAAA,qCAAiB,GAAE,CAAC;IACtC,MAAM,iBAAiB,GAAG,IAAA,2CAAoB,GAAE,CAAC;IACjD,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,GAAG,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxF,MAAM,UAAU,GAAW,oDAA+B,CAAC,aAA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C,EAAE,CAAC,CAAC;aACnB;SACF;QACD,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE1D,OAAO,CACL,uBAAC,eAAM,IAAC,OAAO,EAAE,OAAO,YACtB,uBAAC,uCAAkB,IACjB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,OAAO,GAChB,GACK,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
2
+ import { type getProductData } from './utils';
3
+ export interface DraftDialogContentProps extends OnCloseProps {
4
+ createdDate: string;
5
+ productData: ReturnType<typeof getProductData>;
6
+ isFromLead: boolean;
7
+ handleGoToDraft: () => void;
8
+ handleGoToNewTask: () => void;
9
+ }
10
+ export declare const DraftDialogContent: import("@redneckz/uni-jsx").UNIComponent<DraftDialogContentProps, any, any>;
@@ -0,0 +1,11 @@
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ exports.DraftDialogContent = void 0;
3
+ const jsx_runtime_1 = require("@redneckz/uni-jsx/jsx-runtime");
4
+ const uni_jsx_1 = require("@redneckz/uni-jsx");
5
+ const Heading_1 = require("../../../ui-kit/Heading/Heading");
6
+ const formatDate_1 = require("../../../utils/formatDate");
7
+ const DraftActionButton_1 = require("./DraftActionButton");
8
+ exports.DraftDialogContent = (0, uni_jsx_1.JSX)(function ({ createdDate, productData, isFromLead, handleGoToDraft, handleGoToNewTask, onClose, }) {
9
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [(0, jsx_runtime_1.jsx)(Heading_1.Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col gap-m max-w-lg", children: [(0, jsx_runtime_1.jsx)(DraftActionButton_1.DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${(0, formatDate_1.formatDate)(new Date(createdDate))}` : '', onClick: handleGoToDraft, name: "go-to-draft-button" }), (0, jsx_runtime_1.jsx)(DraftActionButton_1.DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask, name: "go-to-current-task-button" })] })] }));
10
+ });
11
+ //# sourceMappingURL=DraftDialogContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DraftDialogContent.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialogContent.tsx"],"names":[],"mappings":";;;AAAA,+CAAwC;AAExC,6DAA0D;AAC1D,0DAAuD;AACvD,2DAAwD;AAW3C,QAAA,kBAAkB,GAAG,IAAA,aAAG,EAA0B,UAAU,EACvE,WAAW,EACX,WAAW,EACX,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,OAAO,GACR;IACC,OAAO,CACL,iCAAK,SAAS,EAAC,gDAAgD,aAC7D,uBAAC,iBAAO,IACN,SAAS,EAAC,iCAAiC,EAC3C,KAAK,EAAC,qJAA6B,EACnC,WAAW,EAAC,IAAI,GAChB,EACF,iCAAK,SAAS,EAAC,8BAA8B,aAC3C,uBAAC,qCAAiB,IAChB,KAAK,EAAC,kLAAiC,EACvC,IAAI,EAAC,eAAe,EACpB,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,eAAe,IAAA,uBAAU,EAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAClF,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,oBAAoB,GACzB,EACF,uBAAC,qCAAiB,IAChB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,sBAAsB,EACnF,IAAI,EAAC,aAAa,EAClB,WAAW,EAAE,WAAW,CAAC,WAAW,EACpC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,EACjD,IAAI,EAAC,2BAA2B,GAChC,IACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { type DraftTaskType } from '../../model/DraftTaskType';
1
2
  export declare const creditCodesToProgrammIdMap: {
2
3
  credit_cash: string;
3
4
  credit_cash_single_doc: string;
@@ -37,3 +38,4 @@ export declare const creditProgramCodeToProductIdMap: {
37
38
  summer_cash: string;
38
39
  summer_cash_pens: string;
39
40
  };
41
+ export declare const getCreditProgramTaskType: (creditProgramCode?: string, isDebit?: boolean) => DraftTaskType | undefined;
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable camelcase */
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.creditProgramCodeToProductIdMap = exports.creditCodesToProgrammIdMap = void 0;
3
+ exports.getCreditProgramTaskType = exports.creditProgramCodeToProductIdMap = exports.creditCodesToProgrammIdMap = void 0;
4
4
  exports.creditCodesToProgrammIdMap = {
5
5
  credit_cash: '10',
6
6
  credit_cash_single_doc: '28',
@@ -36,4 +36,20 @@ exports.creditProgramCodeToProductIdMap = {
36
36
  ...cardCodesToProgrammIdMap,
37
37
  ...debitCardCodesToProgrammIdMap,
38
38
  };
39
+ const getCreditProgramTaskType = (creditProgramCode, isDebit) => {
40
+ if (isDebit || (creditProgramCode && creditProgramCode in debitCardCodesToProgrammIdMap)) {
41
+ return 'debit';
42
+ }
43
+ if (!creditProgramCode) {
44
+ return undefined;
45
+ }
46
+ if (creditProgramCode in exports.creditCodesToProgrammIdMap) {
47
+ return 'credit';
48
+ }
49
+ if (creditProgramCode in cardCodesToProgrammIdMap) {
50
+ return 'card';
51
+ }
52
+ return undefined;
53
+ };
54
+ exports.getCreditProgramTaskType = getCreditProgramTaskType;
39
55
  //# sourceMappingURL=creditProgramCodes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"creditProgramCodes.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/creditProgramCodes.ts"],"names":[],"mappings":"AAAA,8BAA8B;;;AAEjB,QAAA,0BAA0B,GAAG;IACxC,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,IAAI;IACzB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,IAAI;IAChB,qBAAqB,EAAE,IAAI;IAC3B,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,6BAA6B,GAAG;IACpC,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,0BAA0B,EAAE,IAAI;CACjC,CAAC;AAEF,MAAM,wBAAwB,GAAG;IAC/B,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;CAClB,CAAC;AAEW,QAAA,+BAA+B,GAAG;IAC7C,GAAG,kCAA0B;IAC7B,GAAG,wBAAwB;IAC3B,GAAG,6BAA6B;CACjC,CAAC"}
1
+ {"version":3,"file":"creditProgramCodes.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/creditProgramCodes.ts"],"names":[],"mappings":"AAAA,8BAA8B;;;AAIjB,QAAA,0BAA0B,GAAG;IACxC,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,IAAI;IACzB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,IAAI;IAChB,qBAAqB,EAAE,IAAI;IAC3B,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,6BAA6B,GAAG;IACpC,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,0BAA0B,EAAE,IAAI;CACjC,CAAC;AAEF,MAAM,wBAAwB,GAAG;IAC/B,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;CAClB,CAAC;AAEW,QAAA,+BAA+B,GAAG;IAC7C,GAAG,kCAA0B;IAC7B,GAAG,wBAAwB;IAC3B,GAAG,6BAA6B;CACjC,CAAC;AAEK,MAAM,wBAAwB,GAAG,CACtC,iBAA0B,EAC1B,OAAiB,EACU,EAAE;IAC7B,IAAI,OAAO,IAAI,CAAC,iBAAiB,IAAI,iBAAiB,IAAI,6BAA6B,CAAC,EAAE;QACxF,OAAO,OAAO,CAAC;KAChB;IAED,IAAI,CAAC,iBAAiB,EAAE;QACtB,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,iBAAiB,IAAI,kCAA0B,EAAE;QACnD,OAAO,QAAQ,CAAC;KACjB;IACD,IAAI,iBAAiB,IAAI,wBAAwB,EAAE;QACjD,OAAO,MAAM,CAAC;KACf;IAED,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AApBW,QAAA,wBAAwB,4BAoBnC"}
@@ -1,4 +1,4 @@
1
- import type { OnCloseProps } from '../../../model/OnCloseProps';
1
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
2
2
  import { type Task } from '../../api/draftTasksKZO';
3
3
  import { type DraftTaskType } from '../../model/DraftTaskType';
4
4
  export interface DraftDialogProps extends OnCloseProps {
@@ -1,28 +1,23 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
1
+ import { jsx as _jsx } from "@redneckz/uni-jsx/jsx-runtime";
2
2
  import { JSX } from '@redneckz/uni-jsx';
3
3
  import { useCallback } from '@redneckz/uni-jsx/lib/hooks';
4
4
  import { locationNavigator } from '../../../external/locationNavigator.js';
5
5
  import { Dialog } from '../../../ui-kit/DialogManager/Dialog.js';
6
- import { Heading } from '../../../ui-kit/Heading/Heading.js';
7
- import { formatDate } from '../../../utils/formatDate.js';
8
6
  import { noop } from '../../../utils/noop.js';
9
7
  import { sendMessage } from '../../api/sendMessage.js';
10
8
  import { useRetailFormStore } from '../../hooks/useRetailFormStore.js';
11
9
  import { checkNewMicroservice } from '../../utils/checkNewMicroservice.js';
12
- import { creditProgramCodeToProductIdMap } from './creditProgramCodes.js';
13
- import { DraftActionButton } from './DraftActionButton.js';
10
+ import { creditProgramCodeToProductIdMap, getCreditProgramTaskType } from './creditProgramCodes.js';
11
+ import { DraftDialogContent } from './DraftDialogContent.js';
14
12
  import { parseDraftTask } from './parseDraftTask.js';
15
13
  import { getProductData } from './utils.js';
16
- const getTaskTypeOrDebit = (taskType, isDebit) => {
17
- return taskType || (isDebit ? 'debit' : undefined);
18
- };
19
14
  export const DraftDialog = JSX(function ({ task, taskType, isDebit, isFromLead = false, sendAspects = noop, onClose = noop, }) {
20
15
  const retailFormStore = useRetailFormStore();
21
16
  const navigator = locationNavigator();
22
17
  const isNewMicroservice = checkNewMicroservice();
23
18
  const { participants, participant, creditProgram, createdDate = '', id: taskId } = task;
24
19
  const programmId = creditProgramCodeToProductIdMap[creditProgram.code];
25
- const productData = getProductData(getTaskTypeOrDebit(taskType, isDebit));
20
+ const productData = getProductData(taskType ?? getCreditProgramTaskType(task.creditProgram.code, isDebit));
26
21
  const currentParticipant = participant || participants?.[0];
27
22
  const { id: participantId, profile } = currentParticipant || {};
28
23
  const handleGoToDraft = useCallback(() => {
@@ -52,6 +47,6 @@ export const DraftDialog = JSX(function ({ task, taskType, isDebit, isFromLead =
52
47
  }
53
48
  navigator.assign(productData.newTaskLink);
54
49
  }, [task.id, productData.newTaskLink, isNewMicroservice]);
55
- return (_jsx(Dialog, { onClose: onClose, children: _jsxs("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [_jsx(Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), _jsxs("div", { className: "flex flex-col gap-m max-w-lg", children: [_jsx(DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : '', onClick: handleGoToDraft, name: "go-to-draft-button" }), _jsx(DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask, name: "go-to-current-task-button" })] })] }) }));
50
+ return (_jsx(Dialog, { onClose: onClose, children: _jsx(DraftDialogContent, { createdDate: createdDate, productData: productData, isFromLead: isFromLead, handleGoToDraft: handleGoToDraft, handleGoToNewTask: handleGoToNewTask, onClose: onClose }) }));
56
51
  });
57
52
  //# sourceMappingURL=DraftDialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DraftDialog.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,+BAA+B,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAUzC,MAAM,kBAAkB,GAAG,CAAC,QAAwB,EAAE,OAAiB,EAAE,EAAE;IACzE,OAAO,QAAQ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACrD,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WA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AAE,EAAE;gBACX,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;QACD,SAAS,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAC5C,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,WAAW,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAE1D,OAAO,CACL,KAAC,MAAM,IAAC,OAAO,EAAE,OAAO,YACtB,KAAC,kBAAkB,IACjB,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,eAAe,EAAE,eAAe,EAChC,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,OAAO,GAChB,GACK,CACV,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { type OnCloseProps } from '../../../model/OnCloseProps';
2
+ import { type getProductData } from './utils';
3
+ export interface DraftDialogContentProps extends OnCloseProps {
4
+ createdDate: string;
5
+ productData: ReturnType<typeof getProductData>;
6
+ isFromLead: boolean;
7
+ handleGoToDraft: () => void;
8
+ handleGoToNewTask: () => void;
9
+ }
10
+ export declare const DraftDialogContent: import("@redneckz/uni-jsx").UNIComponent<DraftDialogContentProps, any, any>;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@redneckz/uni-jsx/jsx-runtime";
2
+ import { JSX } from '@redneckz/uni-jsx';
3
+ import { Heading } from '../../../ui-kit/Heading/Heading.js';
4
+ import { formatDate } from '../../../utils/formatDate.js';
5
+ import { DraftActionButton } from './DraftActionButton.js';
6
+ export const DraftDialogContent = JSX(function ({ createdDate, productData, isFromLead, handleGoToDraft, handleGoToNewTask, onClose, }) {
7
+ return (_jsxs("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [_jsx(Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), _jsxs("div", { className: "flex flex-col gap-m max-w-lg", children: [_jsx(DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : '', onClick: handleGoToDraft, name: "go-to-draft-button" }), _jsx(DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask, name: "go-to-current-task-button" })] })] }));
8
+ });
9
+ //# sourceMappingURL=DraftDialogContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DraftDialogContent.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/DraftDialogContent.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAWxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAA0B,UAAU,EACvE,WAAW,EACX,WAAW,EACX,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,OAAO,GACR;IACC,OAAO,CACL,eAAK,SAAS,EAAC,gDAAgD,aAC7D,KAAC,OAAO,IACN,SAAS,EAAC,iCAAiC,EAC3C,KAAK,EAAC,qJAA6B,EACnC,WAAW,EAAC,IAAI,GAChB,EACF,eAAK,SAAS,EAAC,8BAA8B,aAC3C,KAAC,iBAAiB,IAChB,KAAK,EAAC,kLAAiC,EACvC,IAAI,EAAC,eAAe,EACpB,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,eAAe,UAAU,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,EAClF,OAAO,EAAE,eAAe,EACxB,IAAI,EAAC,oBAAoB,GACzB,EACF,KAAC,iBAAiB,IAChB,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,sCAAsC,CAAC,CAAC,CAAC,sBAAsB,EACnF,IAAI,EAAC,aAAa,EAClB,WAAW,EAAE,WAAW,CAAC,WAAW,EACpC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,EACjD,IAAI,EAAC,2BAA2B,GAChC,IACE,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { type DraftTaskType } from '../../model/DraftTaskType';
1
2
  export declare const creditCodesToProgrammIdMap: {
2
3
  credit_cash: string;
3
4
  credit_cash_single_doc: string;
@@ -37,3 +38,4 @@ export declare const creditProgramCodeToProductIdMap: {
37
38
  summer_cash: string;
38
39
  summer_cash_pens: string;
39
40
  };
41
+ export declare const getCreditProgramTaskType: (creditProgramCode?: string, isDebit?: boolean) => DraftTaskType | undefined;
@@ -34,4 +34,19 @@ export const creditProgramCodeToProductIdMap = {
34
34
  ...cardCodesToProgrammIdMap,
35
35
  ...debitCardCodesToProgrammIdMap,
36
36
  };
37
+ export const getCreditProgramTaskType = (creditProgramCode, isDebit) => {
38
+ if (isDebit || (creditProgramCode && creditProgramCode in debitCardCodesToProgrammIdMap)) {
39
+ return 'debit';
40
+ }
41
+ if (!creditProgramCode) {
42
+ return undefined;
43
+ }
44
+ if (creditProgramCode in creditCodesToProgrammIdMap) {
45
+ return 'credit';
46
+ }
47
+ if (creditProgramCode in cardCodesToProgrammIdMap) {
48
+ return 'card';
49
+ }
50
+ return undefined;
51
+ };
37
52
  //# sourceMappingURL=creditProgramCodes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"creditProgramCodes.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/creditProgramCodes.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAE9B,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,IAAI;IACzB,eAAe,EAAE,IAAI;IACrB,cAAc,EAAE,IAAI;IACpB,UAAU,EAAE,IAAI;IAChB,qBAAqB,EAAE,IAAI;IAC3B,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,IAAI;IACjB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF,MAAM,6BAA6B,GAAG;IACpC,eAAe,EAAE,IAAI;IACrB,gBAAgB,EAAE,IAAI;IACtB,kBAAkB,EAAE,IAAI;IACxB,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI;IACpB,iBAAiB,EAAE,IAAI;IACvB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,0BAA0B,EAAE,IAAI;CACjC,CAAC;AAEF,MAAM,wBAAwB,GAAG;IAC/B,SAAS,EAAE,IAAI;IACf,UAAU,EAAE,IAAI;IAChB,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG;IAC7C,GAAG,0BAA0B;IAC7B,GAAG,wBAAwB;IAC3B,GAAG,6BAA6B;CACjC,CAAC"}
1
+ {"version":3,"file":"creditProgramCodes.js","sourceRoot":"","sources":["../../../../src/retail/components/DraftDialog/creditProgramCodes.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAI9B,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,WAAW,EAAE,IAAI;IACjB,sBAAsB,EAAE,IAAI;IAC5B,UAAU,EAAE,IAAI;IAChB,mBAAmB,EAAE,IA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
7241
7241
  };
7242
+ const getCreditProgramTaskType = (creditProgramCode, isDebit) => {
7243
+ if (isDebit || (creditProgramCode && creditProgramCode in debitCardCodesToProgrammIdMap)) {
7244
+ return 'debit';
7245
+ }
7246
+ if (!creditProgramCode) {
7247
+ return undefined;
7248
+ }
7249
+ if (creditProgramCode in creditCodesToProgrammIdMap) {
7250
+ return 'credit';
7251
+ }
7252
+ if (creditProgramCode in cardCodesToProgrammIdMap) {
7253
+ return 'card';
7254
+ }
7255
+ return undefined;
7256
+ };
7242
7257
 
7243
7258
  const DraftActionButton = JSX(({ title, icon, description, name, onClick = noop }) => (jsxs("button", { className: "flex gap-lg items-center border border-gray/30 rounded-xl cursor-pointer p-4 hover:border-green", type: "button", onClick: onClick, "data-test-id": name, children: [jsx(Img, { image: { icon, iconVersion: 'normal' }, width: "78", height: "78" }), jsxs("div", { className: "flex flex-col items-start gap-xs md:w-72 md:mr-lg", children: [title ? (jsx(Text, { font: "font-medium", size: "text-s", children: title })) : null, description ? (jsx(Text, { color: "text-secondary-text", size: "text-xs", children: description })) : null] })] })));
7244
7259
 
7260
+ const DraftDialogContent = JSX(function ({ createdDate, productData, isFromLead, handleGoToDraft, handleGoToNewTask, onClose, }) {
7261
+ return (jsxs("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [jsx(Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), jsxs("div", { className: "flex flex-col gap-m max-w-lg", children: [jsx(DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : '', onClick: handleGoToDraft, name: "go-to-draft-button" }), jsx(DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask, name: "go-to-current-task-button" })] })] }));
7262
+ });
7263
+
7245
7264
  const fieldsNamesToContactKeysMap = {
7246
7265
  email: 'EMAIL',
7247
7266
  phone: 'MAIN_PHONE',
@@ -7484,16 +7503,13 @@
7484
7503
  };
7485
7504
  };
7486
7505
 
7487
- const getTaskTypeOrDebit = (taskType, isDebit) => {
7488
- return taskType || (isDebit ? 'debit' : undefined);
7489
- };
7490
7506
  const DraftDialog = JSX(function ({ task, taskType, isDebit, isFromLead = false, sendAspects = noop, onClose = noop, }) {
7491
7507
  const retailFormStore = useRetailFormStore();
7492
7508
  const navigator = locationNavigator();
7493
7509
  const isNewMicroservice = checkNewMicroservice();
7494
7510
  const { participants, participant, creditProgram, createdDate = '', id: taskId } = task;
7495
7511
  const programmId = creditProgramCodeToProductIdMap[creditProgram.code];
7496
- const productData = getProductData(getTaskTypeOrDebit(taskType, isDebit));
7512
+ const productData = getProductData(taskType ?? getCreditProgramTaskType(task.creditProgram.code, isDebit));
7497
7513
  const currentParticipant = participant || participants?.[0];
7498
7514
  const { id: participantId, profile } = currentParticipant || {};
7499
7515
  const handleGoToDraft = useCallback(() => {
@@ -7523,7 +7539,7 @@
7523
7539
  }
7524
7540
  navigator.assign(productData.newTaskLink);
7525
7541
  }, [task.id, productData.newTaskLink, isNewMicroservice]);
7526
- return (jsx(Dialog, { onClose: onClose, children: jsxs("div", { className: "flex flex-col gap-lg items-center mt-xs mx-6xl", children: [jsx(Heading, { className: "whitespace-pre-wrap text-center", title: "\u041D\u0430\u0448\u043B\u0438 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A \u0432\u0430\u0448\u0435\u0439 \u0437\u0430\u044F\u0432\u043A\u0438", headingType: "h5" }), jsxs("div", { className: "flex flex-col gap-m max-w-lg", children: [jsx(DraftActionButton, { title: "\u041F\u0440\u043E\u0434\u043E\u043B\u0436\u0438\u0442\u044C \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u0438\u0435 \u0447\u0435\u0440\u043D\u043E\u0432\u0438\u043A\u0430", icon: "BankColorIcon", description: createdDate ? `Черновик от ${formatDate(new Date(createdDate))}` : '', onClick: handleGoToDraft, name: "go-to-draft-button" }), jsx(DraftActionButton, { title: isFromLead ? 'Продолжить заполнение текущей заявки' : 'Создать новую заявку', icon: "NewLoanIcon", description: productData.description, onClick: isFromLead ? onClose : handleGoToNewTask, name: "go-to-current-task-button" })] })] }) }));
7542
+ return (jsx(Dialog, { onClose: onClose, children: jsx(DraftDialogContent, { createdDate: createdDate, productData: productData, isFromLead: isFromLead, handleGoToDraft: handleGoToDraft, handleGoToNewTask: handleGoToNewTask, onClose: onClose }) }));
7527
7543
  });
7528
7544
 
7529
7545
  const EmptyDraftDialog = JSX(function ({ taskType, isDebit, onClose = noop, }) {
@@ -14504,7 +14520,7 @@
14504
14520
  slots: () => [HEADER_SLOT, FOOTER_SLOT, STICKY_FOOTER_SLOT],
14505
14521
  });
14506
14522
 
14507
- const packageVersion = "0.14.1041";
14523
+ const packageVersion = "0.14.1042";
14508
14524
 
14509
14525
  exports.Blocks = Blocks;
14510
14526
  exports.ContentPage = ContentPage;