@cxbox-ui/core 1.37.2-alpha.10 → 1.37.2-alpha.11

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.
@@ -535,6 +535,8 @@ __export(utils_exports, {
535
535
  buildSearchResultTree: function () { return buildSearchResultTree; },
536
536
  buildUrl: function () { return buildUrl; },
537
537
  checkShowCondition: function () { return checkShowCondition; },
538
+ createApiError: function () { return createApiError; },
539
+ createApiErrorObservable: function () { return createApiErrorObservable; },
538
540
  defaultBuildURL: function () { return defaultBuildURL; },
539
541
  defaultParseURL: function () { return defaultParseURL; },
540
542
  deleteUndefinedFromObject: function () { return deleteUndefinedFromObject; },
@@ -582,6 +584,19 @@ function applyRawParams(url, qso) {
582
584
  var result = new URLSearchParams(qso).toString();
583
585
  return "".concat(addTailControlSequences(url)).concat(result && "".concat(result));
584
586
  }
587
+ // src/utils/apiError.ts
588
+ var import_core = require("@cxbox-ui/core");
589
+ var import_rxjs = require("rxjs");
590
+ function createApiError(error, context) {
591
+ if (context === void 0) { context = { widgetName: "unknown" }; }
592
+ if (!error.isAxiosError)
593
+ return void 0;
594
+ return import_core.actions.apiError({ error: error, callContext: context });
595
+ }
596
+ function createApiErrorObservable(error, context) {
597
+ var apiError2 = createApiError(error, context);
598
+ return apiError2 ? (0, import_rxjs.of)(apiError2) : import_rxjs.EMPTY;
599
+ }
585
600
  // src/utils/strings.ts
586
601
  function getTemplate(literals) {
587
602
  var placeholders = [];
@@ -1147,7 +1162,9 @@ var createScreenReducerBuilderManager = function (initialState) { return new Red
1147
1162
  state.bo.bc[action.payload.bcName].page = action.payload.page;
1148
1163
  state.bo.bc[action.payload.bcName].loading = true;
1149
1164
  }).addCase(showViewPopup, function (state, action) {
1150
- state.bo.bc[action.payload.bcName].page = 1;
1165
+ var _a, _b;
1166
+ var currentPage = (_b = (_a = state.bo.bc[action.payload.bcName]) === null || _a === void 0 ? void 0 : _a.page) !== null && _b !== void 0 ? _b : 1;
1167
+ state.bo.bc[action.payload.bcName].page = action.payload.bcName === action.payload.calleeBCName ? currentPage : 1;
1151
1168
  state.bo.bc[action.payload.bcName].loading = action.payload.bcName !== action.payload.calleeBCName;
1152
1169
  }).addCase(sendOperationSuccess, function (state, action) {
1153
1170
  state.bo.bc[action.payload.bcName].loading = false;
@@ -1176,7 +1193,8 @@ var initialSessionState = {
1176
1193
  errorMsg: null,
1177
1194
  screens: [],
1178
1195
  pendingRequests: [],
1179
- notifications: []
1196
+ notifications: [],
1197
+ isMetaRefreshing: false
1180
1198
  };
1181
1199
  var createSessionReducerBuilderManager = function (initialState) { return new ReducerBuilderManager().addCase(login, function (state) {
1182
1200
  state.loginSpin = true;
@@ -1206,6 +1224,12 @@ var createSessionReducerBuilderManager = function (initialState) { return new Re
1206
1224
  }).addCase(removeNotifications, function (state, action) {
1207
1225
  var closingKeys = action.payload;
1208
1226
  state.notifications = state.notifications.filter(function (notification) { return !closingKeys.includes(notification.key); });
1227
+ }).addCase(refreshMeta, function (state) {
1228
+ state.isMetaRefreshing = true;
1229
+ }).addCase(refreshMetaDone, function (state) {
1230
+ state.isMetaRefreshing = false;
1231
+ }).addCase(refreshMetaFail, function (state) {
1232
+ state.isMetaRefreshing = false;
1209
1233
  }); };
1210
1234
  // src/reducers/view.ts
1211
1235
  var import_schema7 = require("@cxbox-ui/schema");
@@ -1254,8 +1278,8 @@ var createViewReducerBuilderManager = function (initialState) { return new Reduc
1254
1278
  }).addCase(bcNewDataSuccess, function (state, action) {
1255
1279
  state.selectedCell = initialViewState.selectedCell;
1256
1280
  }).addCase(forceActiveRmUpdate, function (state, action) {
1257
- var _a, _b, _c, _d;
1258
- var _e = action.payload, bcName = _e.bcName, bcUrl = _e.bcUrl, currentRecordData = _e.currentRecordData, rowMeta = _e.rowMeta, cursor = _e.cursor;
1281
+ var _a, _b, _c, _d, _e;
1282
+ var _f = action.payload, bcName = _f.bcName, bcUrl = _f.bcUrl, currentRecordData = _f.currentRecordData, rowMeta = _f.rowMeta, cursor = _f.cursor;
1259
1283
  var handledForceActive = {};
1260
1284
  var rowMetaForcedValues = {};
1261
1285
  var newPendingChangesDiff = {};
@@ -1266,6 +1290,7 @@ var createViewReducerBuilderManager = function (initialState) { return new Reduc
1266
1290
  forceActiveFieldKeys.push(field.key);
1267
1291
  }
1268
1292
  });
1293
+ state.pendingDataChanges[bcName] = (_a = state.pendingDataChanges[bcName]) !== null && _a !== void 0 ? _a : {};
1269
1294
  var consolidatedFrontData = __assign(__assign({}, currentRecordData), state.pendingDataChanges[bcName][cursor]);
1270
1295
  Object.keys(consolidatedFrontData).forEach(function (key) {
1271
1296
  if (rowMetaForcedValues[key] !== void 0 && consolidatedFrontData[key] !== rowMetaForcedValues[key]) {
@@ -1278,12 +1303,12 @@ var createViewReducerBuilderManager = function (initialState) { return new Reduc
1278
1303
  handledForceActive[key] = newPendingDataChanges[key];
1279
1304
  }
1280
1305
  });
1281
- state.handledForceActive[bcName] = (_a = state.handledForceActive[bcName]) !== null && _a !== void 0 ? _a : {};
1282
- state.handledForceActive[bcName][cursor] = (_b = state.handledForceActive[bcName][cursor]) !== null && _b !== void 0 ? _b : {};
1306
+ state.handledForceActive[bcName] = (_b = state.handledForceActive[bcName]) !== null && _b !== void 0 ? _b : {};
1307
+ state.handledForceActive[bcName][cursor] = (_c = state.handledForceActive[bcName][cursor]) !== null && _c !== void 0 ? _c : {};
1283
1308
  Object.assign(state.handledForceActive[bcName][cursor], handledForceActive);
1284
- state.pendingDataChanges[bcName] = (_c = state.pendingDataChanges[bcName]) !== null && _c !== void 0 ? _c : {};
1309
+ state.pendingDataChanges[bcName] = (_d = state.pendingDataChanges[bcName]) !== null && _d !== void 0 ? _d : {};
1285
1310
  state.pendingDataChanges[bcName][cursor] = newPendingDataChanges;
1286
- state.rowMeta[bcName] = (_d = state.rowMeta[bcName]) !== null && _d !== void 0 ? _d : {};
1311
+ state.rowMeta[bcName] = (_e = state.rowMeta[bcName]) !== null && _e !== void 0 ? _e : {};
1287
1312
  state.rowMeta[bcName][bcUrl] = rowMeta;
1288
1313
  }).addCase(changeDataItem, function (state, action) {
1289
1314
  var _a, _b, _c;
@@ -1549,9 +1574,9 @@ __export(epics_exports, {
1549
1574
  userDrillDownEpic: function () { return userDrillDownEpic; }
1550
1575
  });
1551
1576
  // src/epics/view/sendOperationEpic.ts
1552
- var import_rxjs2 = require("rxjs");
1577
+ var import_rxjs3 = require("rxjs");
1553
1578
  // src/epics/utils/postOperationRoutine.ts
1554
- var import_rxjs = require("rxjs");
1579
+ var import_rxjs2 = require("rxjs");
1555
1580
  function postOperationRoutine(widgetName, postInvoke, preInvoke, operationType, bcName) {
1556
1581
  var postInvokeConfirm = Object.values(OperationPostInvokeConfirmType).includes(postInvoke === null || postInvoke === void 0 ? void 0 : postInvoke.type);
1557
1582
  var result = [];
@@ -1574,12 +1599,12 @@ function postOperationRoutine(widgetName, postInvoke, preInvoke, operationType,
1574
1599
  preInvoke: preInvoke
1575
1600
  }));
1576
1601
  }
1577
- return result.map(function (item) { return (0, import_rxjs.of)(item); });
1602
+ return result.map(function (item) { return (0, import_rxjs2.of)(item); });
1578
1603
  }
1579
1604
  // src/epics/view/sendOperationEpic.ts
1580
1605
  var sendOperationEpic = function (action$, state$, _a) {
1581
1606
  var api = _a.api;
1582
- return action$.pipe((0, import_rxjs2.filter)(sendOperation.match), (0, import_rxjs2.filter)(function (action) { return matchOperationRole("none", action.payload, state$.value); }), (0, import_rxjs2.mergeMap)(function (action) {
1607
+ return action$.pipe((0, import_rxjs3.filter)(sendOperation.match), (0, import_rxjs3.filter)(function (action) { return matchOperationRole("none", action.payload, state$.value); }), (0, import_rxjs3.mergeMap)(function (action) {
1583
1608
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1584
1609
  var state = state$.value;
1585
1610
  var screenName = state.screen.screenName;
@@ -1609,13 +1634,13 @@ var sendOperationEpic = function (action$, state$, _a) {
1609
1634
  params._confirm = confirm;
1610
1635
  }
1611
1636
  var context = { widgetName: action.payload.widgetName };
1612
- return api.customAction(screenName, bcUrl, data, context, params).pipe((0, import_rxjs2.mergeMap)(function (response) {
1637
+ return api.customAction(screenName, bcUrl, data, context, params).pipe((0, import_rxjs3.mergeMap)(function (response) {
1613
1638
  var _a, _b;
1614
1639
  var postInvoke = (_a = response.postActions) === null || _a === void 0 ? void 0 : _a[0];
1615
1640
  var preInvoke = response.preInvoke;
1616
- return defaultSaveOperation ? ((_b = action === null || action === void 0 ? void 0 : action.payload) === null || _b === void 0 ? void 0 : _b.onSuccessAction) ? (0, import_rxjs2.concat)((0, import_rxjs2.of)(bcCancelPendingChanges({ bcNames: [bcName] })), (0, import_rxjs2.of)(action.payload.onSuccessAction)) : import_rxjs2.EMPTY : (0, import_rxjs2.concat).apply(void 0, __spreadArray([(0, import_rxjs2.of)(sendOperationSuccess({ bcName: bcName, cursor: cursor })),
1617
- (0, import_rxjs2.of)(bcForceUpdate({ bcName: bcName }))], postOperationRoutine(widgetName, postInvoke, preInvoke, operationType, bcName), false));
1618
- }), (0, import_rxjs2.catchError)(function (e) {
1641
+ return defaultSaveOperation ? ((_b = action === null || action === void 0 ? void 0 : action.payload) === null || _b === void 0 ? void 0 : _b.onSuccessAction) ? (0, import_rxjs3.concat)((0, import_rxjs3.of)(bcCancelPendingChanges({ bcNames: [bcName] })), (0, import_rxjs3.of)(action.payload.onSuccessAction)) : import_rxjs3.EMPTY : (0, import_rxjs3.concat).apply(void 0, __spreadArray([(0, import_rxjs3.of)(sendOperationSuccess({ bcName: bcName, cursor: cursor })),
1642
+ (0, import_rxjs3.of)(bcForceUpdate({ bcName: bcName }))], postOperationRoutine(widgetName, postInvoke, preInvoke, operationType, bcName), false));
1643
+ }), (0, import_rxjs3.catchError)(function (e) {
1619
1644
  var _a, _b, _c, _d, _e, _f;
1620
1645
  console.error(e);
1621
1646
  var viewError = null;
@@ -1625,14 +1650,14 @@ var sendOperationEpic = function (action$, state$, _a) {
1625
1650
  entityError = (_d = operationError === null || operationError === void 0 ? void 0 : operationError.error) === null || _d === void 0 ? void 0 : _d.entity;
1626
1651
  viewError = (_f = (_e = operationError === null || operationError === void 0 ? void 0 : operationError.error) === null || _e === void 0 ? void 0 : _e.popup) === null || _f === void 0 ? void 0 : _f[0];
1627
1652
  }
1628
- return (0, import_rxjs2.of)(sendOperationFail({ bcName: bcName, bcUrl: bcUrl, viewError: viewError, entityError: entityError }));
1653
+ return (0, import_rxjs3.concat)((0, import_rxjs3.of)(sendOperationFail({ bcName: bcName, bcUrl: bcUrl, viewError: viewError, entityError: entityError })), createApiErrorObservable(e, context));
1629
1654
  }));
1630
1655
  }));
1631
1656
  };
1632
1657
  // src/epics/view/showAssocPopupEpic.ts
1633
- var import_rxjs3 = require("rxjs");
1658
+ var import_rxjs4 = require("rxjs");
1634
1659
  var import_schema8 = require("@cxbox-ui/schema");
1635
- var showAssocPopupEpic = function (action$, state$) { return action$.pipe((0, import_rxjs3.filter)(showViewPopup.match), (0, import_rxjs3.filter)(function (action) { return !!(action.payload.calleeBCName && action.payload.associateFieldKey); }), (0, import_rxjs3.mergeMap)(function (action) {
1660
+ var showAssocPopupEpic = function (action$, state$) { return action$.pipe((0, import_rxjs4.filter)(showViewPopup.match), (0, import_rxjs4.filter)(function (action) { return !!(action.payload.calleeBCName && action.payload.associateFieldKey); }), (0, import_rxjs4.mergeMap)(function (action) {
1636
1661
  var _a, _b, _c, _d;
1637
1662
  var _e = action.payload, bcName = _e.bcName, calleeBCName = _e.calleeBCName;
1638
1663
  var state = state$.value;
@@ -1643,7 +1668,7 @@ var showAssocPopupEpic = function (action$, state$) { return action$.pipe((0, im
1643
1668
  var assocFieldChanges = calleePendingChanges === null || calleePendingChanges === void 0 ? void 0 : calleePendingChanges[assocFieldKey];
1644
1669
  var somethingMissing = !assocWidget || !calleePendingChanges || !assocFieldChanges || !assocFieldChanges;
1645
1670
  if (somethingMissing || assocWidget.options && !assocWidget.options.hierarchyFull) {
1646
- return import_rxjs3.EMPTY;
1671
+ return import_rxjs4.EMPTY;
1647
1672
  }
1648
1673
  var popupInitPendingChanges = {};
1649
1674
  assocFieldChanges.forEach(function (record) {
@@ -1666,18 +1691,18 @@ var showAssocPopupEpic = function (action$, state$) { return action$.pipe((0, im
1666
1691
  }
1667
1692
  });
1668
1693
  }
1669
- return (0, import_rxjs3.of)(changeDataItems({
1694
+ return (0, import_rxjs4.of)(changeDataItems({
1670
1695
  bcName: bcName,
1671
1696
  cursors: Object.keys(popupInitPendingChanges),
1672
1697
  dataItems: Object.values(popupInitPendingChanges)
1673
1698
  }));
1674
1699
  })); };
1675
1700
  // src/epics/view/fileUploadConfirmEpic.ts
1676
- var import_rxjs4 = require("rxjs");
1701
+ var import_rxjs5 = require("rxjs");
1677
1702
  var import_schema9 = require("@cxbox-ui/schema");
1678
1703
  var fileUploadConfirmEpic = function (action$, state$, _a) {
1679
1704
  var api = _a.api;
1680
- return action$.pipe((0, import_rxjs4.filter)(bulkUploadFiles.match), (0, import_rxjs4.mergeMap)(function (action) {
1705
+ return action$.pipe((0, import_rxjs5.filter)(bulkUploadFiles.match), (0, import_rxjs5.mergeMap)(function (action) {
1681
1706
  var _a, _b;
1682
1707
  var state = state$.value;
1683
1708
  var bcName = (_a = state.view.popupData) === null || _a === void 0 ? void 0 : _a.bcName;
@@ -1686,19 +1711,22 @@ var fileUploadConfirmEpic = function (action$, state$, _a) {
1686
1711
  var data = {
1687
1712
  bulkIds: action.payload.fileIds
1688
1713
  };
1689
- return api.customAction(state.screen.screenName, bcUrl, data, null, { _action: "file-upload-save" }).pipe((0, import_rxjs4.mergeMap)(function (response) {
1714
+ return api.customAction(state.screen.screenName, bcUrl, data, null, { _action: "file-upload-save" }).pipe((0, import_rxjs5.mergeMap)(function (response) {
1690
1715
  var _a;
1691
1716
  var postInvoke = (_a = response.postActions) === null || _a === void 0 ? void 0 : _a[0];
1692
1717
  var preInvoke = response.preInvoke;
1693
- return (0, import_rxjs4.concat).apply(void 0, __spreadArray([(0, import_rxjs4.of)(sendOperationSuccess({ bcName: bcName, cursor: null })),
1694
- (0, import_rxjs4.of)(bcForceUpdate({ bcName: bcName })),
1695
- (0, import_rxjs4.of)(closeViewPopup(null))], postOperationRoutine(widgetName, postInvoke, preInvoke, import_schema9.OperationTypeCrud.save, bcName), false));
1718
+ return (0, import_rxjs5.concat).apply(void 0, __spreadArray([(0, import_rxjs5.of)(sendOperationSuccess({ bcName: bcName, cursor: null })),
1719
+ (0, import_rxjs5.of)(bcForceUpdate({ bcName: bcName })),
1720
+ (0, import_rxjs5.of)(closeViewPopup(null))], postOperationRoutine(widgetName, postInvoke, preInvoke, import_schema9.OperationTypeCrud.save, bcName), false));
1721
+ }), (0, import_rxjs5.catchError)(function (error) {
1722
+ console.error(error);
1723
+ return createApiErrorObservable(error);
1696
1724
  }));
1697
1725
  }));
1698
1726
  };
1699
1727
  // src/epics/view/selectTableCellInitEpic.ts
1700
- var import_rxjs5 = require("rxjs");
1701
- var selectTableCellInitEpic = function (action$, state$) { return action$.pipe((0, import_rxjs5.filter)(selectTableCellInit.match), (0, import_rxjs5.mergeMap)(function (action) {
1728
+ var import_rxjs6 = require("rxjs");
1729
+ var selectTableCellInitEpic = function (action$, state$) { return action$.pipe((0, import_rxjs6.filter)(selectTableCellInit.match), (0, import_rxjs6.mergeMap)(function (action) {
1702
1730
  var _a;
1703
1731
  var resultObservables = [];
1704
1732
  var state = state$.value;
@@ -1708,24 +1736,24 @@ var selectTableCellInitEpic = function (action$, state$) { return action$.pipe((
1708
1736
  var nextBcCursor = (_a = state.screen.bo.bc[nextBcName]) === null || _a === void 0 ? void 0 : _a.cursor;
1709
1737
  var selectedCell = state.view.selectedCell;
1710
1738
  if (nextRowId !== nextBcCursor) {
1711
- resultObservables.push((0, import_rxjs5.of)(bcSelectRecord({ bcName: nextBcName, cursor: nextRowId })));
1739
+ resultObservables.push((0, import_rxjs6.of)(bcSelectRecord({ bcName: nextBcName, cursor: nextRowId })));
1712
1740
  }
1713
1741
  if (!selectedCell || fieldKey !== selectedCell.fieldKey || nextRowId !== selectedCell.rowId || (nextWidget === null || nextWidget === void 0 ? void 0 : nextWidget.name) !== selectedCell.widgetName) {
1714
- resultObservables.push((0, import_rxjs5.of)(selectTableCell({ widgetName: nextWidget === null || nextWidget === void 0 ? void 0 : nextWidget.name, rowId: nextRowId, fieldKey: fieldKey })));
1742
+ resultObservables.push((0, import_rxjs6.of)(selectTableCell({ widgetName: nextWidget === null || nextWidget === void 0 ? void 0 : nextWidget.name, rowId: nextRowId, fieldKey: fieldKey })));
1715
1743
  }
1716
- return (0, import_rxjs5.concat).apply(void 0, resultObservables);
1744
+ return (0, import_rxjs6.concat).apply(void 0, resultObservables);
1717
1745
  })); };
1718
1746
  // src/epics/view/showFileUploadPopupEpic.ts
1719
- var import_rxjs6 = require("rxjs");
1747
+ var import_rxjs7 = require("rxjs");
1720
1748
  var import_schema10 = require("@cxbox-ui/schema");
1721
- var showFileUploadPopupEpic = function (action$, state$) { return action$.pipe((0, import_rxjs6.filter)(sendOperation.match), (0, import_rxjs6.filter)(function (action) { return matchOperationRole(import_schema10.OperationTypeCrud.fileUpload, action.payload, state$.value); }), (0, import_rxjs6.mergeMap)(function (action) {
1749
+ var showFileUploadPopupEpic = function (action$, state$) { return action$.pipe((0, import_rxjs7.filter)(sendOperation.match), (0, import_rxjs7.filter)(function (action) { return matchOperationRole(import_schema10.OperationTypeCrud.fileUpload, action.payload, state$.value); }), (0, import_rxjs7.mergeMap)(function (action) {
1722
1750
  var _a;
1723
- return (0, import_rxjs6.concat)((0, import_rxjs6.of)(bcChangeCursors({ cursorsMap: (_a = {}, _a[action.payload.bcName] = null, _a) })), (0, import_rxjs6.of)(showFileUploadPopup({ widgetName: action.payload.widgetName })));
1751
+ return (0, import_rxjs7.concat)((0, import_rxjs7.of)(bcChangeCursors({ cursorsMap: (_a = {}, _a[action.payload.bcName] = null, _a) })), (0, import_rxjs7.of)(showFileUploadPopup({ widgetName: action.payload.widgetName })));
1724
1752
  })); };
1725
1753
  // src/epics/view/sendOperationAssociateEpic.ts
1726
- var import_rxjs7 = require("rxjs");
1754
+ var import_rxjs8 = require("rxjs");
1727
1755
  var import_schema11 = require("@cxbox-ui/schema");
1728
- var sendOperationAssociateEpic = function (action$, state$) { return action$.pipe((0, import_rxjs7.filter)(sendOperation.match), (0, import_rxjs7.filter)(function (action) { return matchOperationRole(import_schema11.OperationTypeCrud.associate, action.payload, state$.value); }), (0, import_rxjs7.map)(function (action) {
1756
+ var sendOperationAssociateEpic = function (action$, state$) { return action$.pipe((0, import_rxjs8.filter)(sendOperation.match), (0, import_rxjs8.filter)(function (action) { return matchOperationRole(import_schema11.OperationTypeCrud.associate, action.payload, state$.value); }), (0, import_rxjs8.map)(function (action) {
1729
1757
  return showViewPopup({
1730
1758
  // TODO: 2.0.0 bcKey and bcName will be removed in favor `widgetName`
1731
1759
  bcName: action.payload.bcKey ? "".concat(action.payload.bcKey) : "".concat(action.payload.bcName, "Assoc"),
@@ -1735,31 +1763,31 @@ var sendOperationAssociateEpic = function (action$, state$) { return action$.pip
1735
1763
  });
1736
1764
  })); };
1737
1765
  // src/epics/view/getRowMetaByForceActiveEpic.ts
1738
- var import_rxjs8 = require("rxjs");
1766
+ var import_rxjs9 = require("rxjs");
1739
1767
  var import_schema12 = require("@cxbox-ui/schema");
1740
1768
  var import_toolkit2 = require("@reduxjs/toolkit");
1741
1769
  var getRowMetaByForceActiveEpic = function (action$, state$, _a) {
1742
1770
  var api = _a.api;
1743
- return action$.pipe((0, import_rxjs8.filter)(changeDataItem.match), (0, import_rxjs8.mergeMap)(function (action) {
1744
- var _a, _b, _c, _d;
1771
+ return action$.pipe((0, import_rxjs9.filter)(changeDataItem.match), (0, import_rxjs9.mergeMap)(function (action) {
1772
+ var _a, _b, _c, _d, _e;
1745
1773
  var state = state$.value;
1746
1774
  var initUrl = state.view.url;
1747
- var _e = action.payload, bcName = _e.bcName, cursor = _e.cursor, disableRetry = _e.disableRetry;
1775
+ var _f = action.payload, bcName = _f.bcName, cursor = _f.cursor, disableRetry = _f.disableRetry;
1748
1776
  var isBcHierarchy = state.view.widgets.some(function (widget) {
1749
1777
  var _a, _b;
1750
1778
  return widget.bcName === bcName && widget.type === import_schema12.WidgetTypes.AssocListPopup && (((_a = widget.options) === null || _a === void 0 ? void 0 : _a.hierarchySameBc) || ((_b = widget.options) === null || _b === void 0 ? void 0 : _b.hierarchyFull));
1751
1779
  });
1752
1780
  if (isBcHierarchy) {
1753
- return import_rxjs8.EMPTY;
1781
+ return import_rxjs9.EMPTY;
1754
1782
  }
1755
1783
  var isPickListPopup = state.view.widgets.find(function (item) { var _a; return item.name === ((_a = state.view.popupData) === null || _a === void 0 ? void 0 : _a.widgetName) && [import_schema12.WidgetTypes.PickListPopup, import_schema12.WidgetTypes.FlatTreePopup].includes(item.type); });
1756
1784
  var bcUrl = buildBcUrl(bcName, true, state);
1757
- var pendingChanges = state.view.pendingDataChanges[bcName][cursor];
1758
- var handledForceActive = ((_a = state.view.handledForceActive[bcName]) === null || _a === void 0 ? void 0 : _a[cursor]) || {};
1759
- var currentRecordData = (_b = state.data[bcName]) === null || _b === void 0 ? void 0 : _b.find(function (record) { return record.id === cursor; });
1760
- var fieldsRowMeta = (_d = (_c = state.view.rowMeta[bcName]) === null || _c === void 0 ? void 0 : _c[bcUrl]) === null || _d === void 0 ? void 0 : _d.fields;
1785
+ var pendingChanges = (_a = state.view.pendingDataChanges[bcName]) === null || _a === void 0 ? void 0 : _a[cursor];
1786
+ var handledForceActive = ((_b = state.view.handledForceActive[bcName]) === null || _b === void 0 ? void 0 : _b[cursor]) || {};
1787
+ var currentRecordData = (_c = state.data[bcName]) === null || _c === void 0 ? void 0 : _c.find(function (record) { return record.id === cursor; });
1788
+ var fieldsRowMeta = (_e = (_d = state.view.rowMeta[bcName]) === null || _d === void 0 ? void 0 : _d[bcUrl]) === null || _e === void 0 ? void 0 : _e.fields;
1761
1789
  var changedFiledKey = null;
1762
- var closePopup = (0, import_rxjs8.concat)((0, import_rxjs8.of)(closeViewPopup(null)), (0, import_rxjs8.of)(viewClearPickMap(null)), (0, import_rxjs8.of)(bcRemoveAllFilters({ bcName: bcName })));
1790
+ var closePopup = (0, import_rxjs9.concat)((0, import_rxjs9.of)(closeViewPopup(null)), (0, import_rxjs9.of)(viewClearPickMap(null)), (0, import_rxjs9.of)(bcRemoveAllFilters({ bcName: bcName })));
1763
1791
  var someForceActiveChanged = fieldsRowMeta === null || fieldsRowMeta === void 0 ? void 0 : fieldsRowMeta.filter(function (field) { return field.forceActive && pendingChanges[field.key] !== void 0; }).some(function (field) {
1764
1792
  var result = pendingChanges[field.key] !== handledForceActive[field.key];
1765
1793
  if (result) {
@@ -1769,10 +1797,10 @@ var getRowMetaByForceActiveEpic = function (action$, state$, _a) {
1769
1797
  });
1770
1798
  var requestId = (0, import_toolkit2.nanoid)();
1771
1799
  if (someForceActiveChanged && !disableRetry) {
1772
- return (0, import_rxjs8.concat)((0, import_rxjs8.of)(addPendingRequest({ request: { requestId: requestId, type: "force-active" } })), api.getRmByForceActive(state.screen.screenName, bcUrl, __assign(__assign({}, pendingChanges), { vstamp: currentRecordData === null || currentRecordData === void 0 ? void 0 : currentRecordData.vstamp })).pipe((0, import_rxjs8.mergeMap)(function (data) {
1773
- var result = [(0, import_rxjs8.of)(removePendingRequest({ requestId: requestId }))];
1800
+ return (0, import_rxjs9.concat)((0, import_rxjs9.of)(addPendingRequest({ request: { requestId: requestId, type: "force-active" } })), api.getRmByForceActive(state.screen.screenName, bcUrl, __assign(__assign({}, pendingChanges), { vstamp: currentRecordData === null || currentRecordData === void 0 ? void 0 : currentRecordData.vstamp })).pipe((0, import_rxjs9.mergeMap)(function (data) {
1801
+ var result = [(0, import_rxjs9.of)(removePendingRequest({ requestId: requestId }))];
1774
1802
  if (state.view.url === initUrl) {
1775
- result.push((0, import_rxjs8.of)(forceActiveRmUpdate({
1803
+ result.push((0, import_rxjs9.of)(forceActiveRmUpdate({
1776
1804
  rowMeta: data,
1777
1805
  currentRecordData: currentRecordData,
1778
1806
  bcName: bcName,
@@ -1783,8 +1811,8 @@ var getRowMetaByForceActiveEpic = function (action$, state$, _a) {
1783
1811
  if (isPickListPopup) {
1784
1812
  result.push(closePopup);
1785
1813
  }
1786
- return (0, import_rxjs8.concat).apply(void 0, result);
1787
- }), (0, import_rxjs8.catchError)(function (e) {
1814
+ return (0, import_rxjs9.concat).apply(void 0, result);
1815
+ }), (0, import_rxjs9.catchError)(function (e) {
1788
1816
  var _a;
1789
1817
  var _b, _c, _d, _e, _f, _g;
1790
1818
  console.error(e);
@@ -1795,36 +1823,36 @@ var getRowMetaByForceActiveEpic = function (action$, state$, _a) {
1795
1823
  entityError = (_e = operationError === null || operationError === void 0 ? void 0 : operationError.error) === null || _e === void 0 ? void 0 : _e.entity;
1796
1824
  viewError = (_g = (_f = operationError === null || operationError === void 0 ? void 0 : operationError.error) === null || _f === void 0 ? void 0 : _f.popup) === null || _g === void 0 ? void 0 : _g[0];
1797
1825
  }
1798
- return (0, import_rxjs8.concat)((0, import_rxjs8.of)(removePendingRequest({ requestId: requestId })), state.view.url === initUrl ? (0, import_rxjs8.concat)((0, import_rxjs8.of)(changeDataItem({
1826
+ return (0, import_rxjs9.concat)((0, import_rxjs9.of)(removePendingRequest({ requestId: requestId })), state.view.url === initUrl ? (0, import_rxjs9.concat)((0, import_rxjs9.of)(changeDataItem({
1799
1827
  bcName: bcName,
1800
1828
  bcUrl: buildBcUrl(bcName, true, state),
1801
1829
  cursor: cursor,
1802
1830
  dataItem: (_a = {}, _a[changedFiledKey] = currentRecordData === null || currentRecordData === void 0 ? void 0 : currentRecordData[changedFiledKey], _a),
1803
1831
  disableRetry: true
1804
- })), (0, import_rxjs8.of)(forceActiveChangeFail({ bcName: bcName, bcUrl: bcUrl, viewError: viewError, entityError: entityError }))) : import_rxjs8.EMPTY);
1832
+ })), (0, import_rxjs9.of)(forceActiveChangeFail({ bcName: bcName, bcUrl: bcUrl, viewError: viewError, entityError: entityError }))) : import_rxjs9.EMPTY, createApiErrorObservable(e));
1805
1833
  })));
1806
1834
  }
1807
- return isPickListPopup ? closePopup : import_rxjs8.EMPTY;
1835
+ return isPickListPopup ? closePopup : import_rxjs9.EMPTY;
1808
1836
  }));
1809
1837
  };
1810
1838
  // src/epics/view/showAllTableRecordsInitEpic.ts
1811
- var import_rxjs9 = require("rxjs");
1812
- var showAllTableRecordsInitEpic = function (action$, state$) { return action$.pipe((0, import_rxjs9.filter)(showAllTableRecordsInit.match), (0, import_rxjs9.mergeMap)(function (action) {
1839
+ var import_rxjs10 = require("rxjs");
1840
+ var showAllTableRecordsInitEpic = function (action$, state$) { return action$.pipe((0, import_rxjs10.filter)(showAllTableRecordsInit.match), (0, import_rxjs10.mergeMap)(function (action) {
1813
1841
  var _a;
1814
1842
  var resultObservables = [];
1815
1843
  var _b = action.payload, bcName = _b.bcName, cursor = _b.cursor;
1816
1844
  var state = state$.value;
1817
1845
  var route = state.router;
1818
- resultObservables.push((0, import_rxjs9.of)(bcChangeCursors({ cursorsMap: (_a = {}, _a[bcName] = null, _a) })));
1846
+ resultObservables.push((0, import_rxjs10.of)(bcChangeCursors({ cursorsMap: (_a = {}, _a[bcName] = null, _a) })));
1819
1847
  var bcPath = route.bcPath.slice(0, route.bcPath.indexOf("".concat(bcName, "/").concat(cursor)));
1820
1848
  var url = defaultBuildURL(__assign(__assign({}, route), { bcPath: bcPath }));
1821
- resultObservables.push((0, import_rxjs9.of)(bcForceUpdate({ bcName: bcName })));
1822
- resultObservables.push((0, import_rxjs9.of)(changeLocation({ location: defaultParseURL(new URL(url, window.location.origin)) })));
1823
- return (0, import_rxjs9.concat).apply(void 0, resultObservables);
1849
+ resultObservables.push((0, import_rxjs10.of)(bcForceUpdate({ bcName: bcName })));
1850
+ resultObservables.push((0, import_rxjs10.of)(changeLocation({ location: defaultParseURL(new URL(url, window.location.origin)) })));
1851
+ return (0, import_rxjs10.concat).apply(void 0, resultObservables);
1824
1852
  })); };
1825
1853
  // src/epics/view/clearPendingDataChangesAfterCursorChangeEpic.ts
1826
- var import_rxjs10 = require("rxjs");
1827
- var clearPendingDataChangesAfterCursorChangeEpic = function (action$, state$) { return action$.pipe((0, import_rxjs10.filter)(bcChangeCursors.match), (0, import_rxjs10.mergeMap)(function (action) {
1854
+ var import_rxjs11 = require("rxjs");
1855
+ var clearPendingDataChangesAfterCursorChangeEpic = function (action$, state$) { return action$.pipe((0, import_rxjs11.filter)(bcChangeCursors.match), (0, import_rxjs11.mergeMap)(function (action) {
1828
1856
  var state = state$.value;
1829
1857
  var nextCursors = parseBcCursors(state.router.bcPath) || {};
1830
1858
  var cursorsDiffMap = {};
@@ -1836,13 +1864,13 @@ var clearPendingDataChangesAfterCursorChangeEpic = function (action$, state$) {
1836
1864
  }
1837
1865
  });
1838
1866
  if (Object.keys(cursorsDiffMap).length) {
1839
- return (0, import_rxjs10.of)(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
1867
+ return (0, import_rxjs11.of)(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
1840
1868
  }
1841
- return import_rxjs10.EMPTY;
1869
+ return import_rxjs11.EMPTY;
1842
1870
  })); };
1843
1871
  // src/epics/router/drilldownEpic.ts
1844
- var import_rxjs11 = require("rxjs");
1845
- var drillDownEpic = function (action$, state$) { return action$.pipe((0, import_rxjs11.filter)(drillDown.match), (0, import_rxjs11.switchMap)(function (action) {
1872
+ var import_rxjs12 = require("rxjs");
1873
+ var drillDownEpic = function (action$, state$) { return action$.pipe((0, import_rxjs12.filter)(drillDown.match), (0, import_rxjs12.switchMap)(function (action) {
1846
1874
  var _a, _b;
1847
1875
  var state = state$.value;
1848
1876
  var url = action.payload.url;
@@ -1918,7 +1946,7 @@ var drillDownEpic = function (action$, state$) { return action$.pipe((0, import_
1918
1946
  result.push(changeLocation({ location: defaultParseURL(new URL(makeRelativeUrl(urlBase), window.location.origin)) }));
1919
1947
  break;
1920
1948
  }
1921
- return result.length ? (0, import_rxjs11.concat)(result) : import_rxjs11.EMPTY;
1949
+ return result.length ? (0, import_rxjs12.concat)(result) : import_rxjs12.EMPTY;
1922
1950
  })); };
1923
1951
  function shallowCompare(prevProps, nextProps, ignore) {
1924
1952
  if (ignore === void 0) { ignore = []; }
@@ -1946,19 +1974,19 @@ function shallowCompare(prevProps, nextProps, ignore) {
1946
1974
  return diffProps;
1947
1975
  }
1948
1976
  // src/epics/router/loginDoneEpic.ts
1949
- var import_rxjs12 = require("rxjs");
1950
- var loginDoneEpic = function (action$, state$) { return action$.pipe((0, import_rxjs12.filter)(loginDone.match), (0, import_rxjs12.switchMap)(function (action) {
1977
+ var import_rxjs13 = require("rxjs");
1978
+ var loginDoneEpic = function (action$, state$) { return action$.pipe((0, import_rxjs13.filter)(loginDone.match), (0, import_rxjs13.switchMap)(function (action) {
1951
1979
  var state = state$.value;
1952
1980
  if (state.router.type === "router" /* router */) {
1953
- return (0, import_rxjs12.of)(handleRouter(state.router));
1981
+ return (0, import_rxjs13.of)(handleRouter(state.router));
1954
1982
  }
1955
1983
  var nextScreenName = state.router.screenName;
1956
1984
  var nextScreen = state.session.screens.find(function (item) { return nextScreenName ? item.name === nextScreenName : item.defaultScreen; }) || state.session.screens[0];
1957
- return nextScreen ? (0, import_rxjs12.of)(selectScreen({ screen: nextScreen })) : (0, import_rxjs12.of)(selectScreenFail({ screenName: nextScreenName }));
1985
+ return nextScreen ? (0, import_rxjs13.of)(selectScreen({ screen: nextScreen })) : (0, import_rxjs13.of)(selectScreenFail({ screenName: nextScreenName }));
1958
1986
  })); };
1959
1987
  // src/epics/router/selectViewEpic.ts
1960
- var import_rxjs13 = require("rxjs");
1961
- var changeViewEpic = function (action$, state$) { return action$.pipe((0, import_rxjs13.filter)(selectView.match), (0, import_rxjs13.switchMap)(function (action) {
1988
+ var import_rxjs14 = require("rxjs");
1989
+ var changeViewEpic = function (action$, state$) { return action$.pipe((0, import_rxjs14.filter)(selectView.match), (0, import_rxjs14.switchMap)(function (action) {
1962
1990
  var state = state$.value;
1963
1991
  var nextCursors = parseBcCursors(state.router.bcPath) || {};
1964
1992
  var cursorsDiffMap = {};
@@ -1970,77 +1998,77 @@ var changeViewEpic = function (action$, state$) { return action$.pipe((0, import
1970
1998
  }
1971
1999
  });
1972
2000
  if (Object.keys(cursorsDiffMap).length) {
1973
- return (0, import_rxjs13.of)(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
2001
+ return (0, import_rxjs14.of)(bcChangeCursors({ cursorsMap: cursorsDiffMap }));
1974
2002
  }
1975
- return import_rxjs13.EMPTY;
2003
+ return import_rxjs14.EMPTY;
1976
2004
  })); };
1977
2005
  // src/epics/router/handleRouterEpic.ts
1978
- var import_rxjs14 = require("rxjs");
2006
+ var import_rxjs15 = require("rxjs");
1979
2007
  var handleRouterEpic = function (action$, state$, _a) {
1980
2008
  var api = _a.api;
1981
- return action$.pipe((0, import_rxjs14.filter)(handleRouter.match), (0, import_rxjs14.switchMap)(function (action) {
2009
+ return action$.pipe((0, import_rxjs15.filter)(handleRouter.match), (0, import_rxjs15.switchMap)(function (action) {
1982
2010
  var path = action.payload.path;
1983
2011
  var params = action.payload.params;
1984
- return api.routerRequest(path, params).pipe((0, import_rxjs14.mergeMap)(function () {
1985
- return import_rxjs14.EMPTY;
1986
- }), (0, import_rxjs14.catchError)(function (error) {
2012
+ return api.routerRequest(path, params).pipe((0, import_rxjs15.mergeMap)(function () {
2013
+ return import_rxjs15.EMPTY;
2014
+ }), (0, import_rxjs15.catchError)(function (error) {
1987
2015
  console.error(error);
1988
- return import_rxjs14.EMPTY;
2016
+ return createApiErrorObservable(error);
1989
2017
  }));
1990
2018
  }));
1991
2019
  };
1992
2020
  // src/epics/router/selectScreenEpic.ts
1993
- var import_rxjs15 = require("rxjs");
1994
- var changeScreen = function (action$, state$) { return action$.pipe((0, import_rxjs15.filter)(selectScreen.match), (0, import_rxjs15.switchMap)(function (action) {
2021
+ var import_rxjs16 = require("rxjs");
2022
+ var changeScreen = function (action$, state$) { return action$.pipe((0, import_rxjs16.filter)(selectScreen.match), (0, import_rxjs16.switchMap)(function (action) {
1995
2023
  var state = state$.value;
1996
2024
  var nextViewName = state.router.viewName;
1997
2025
  var requestedView = state.screen.views.find(function (item) { return item.name === nextViewName; });
1998
2026
  var defaultView = !nextViewName && state.screen.primaryView && state.screen.views.find(function (item) { return item.name === state.screen.primaryView; });
1999
2027
  var nextView = requestedView || defaultView || state.screen.views[0];
2000
- return nextView ? (0, import_rxjs15.of)(selectView(nextView)) : (0, import_rxjs15.of)(selectViewFail({ viewName: nextViewName }));
2028
+ return nextView ? (0, import_rxjs16.of)(selectView(nextView)) : (0, import_rxjs16.of)(selectViewFail({ viewName: nextViewName }));
2001
2029
  })); };
2002
2030
  // src/epics/router/userDrillDownEpic.ts
2003
- var import_rxjs16 = require("rxjs");
2031
+ var import_rxjs17 = require("rxjs");
2004
2032
  var userDrillDownEpic = function (action$, state$, _a) {
2005
2033
  var api = _a.api;
2006
- return action$.pipe((0, import_rxjs16.filter)(userDrillDown.match), (0, import_rxjs16.switchMap)(function (action) {
2034
+ return action$.pipe((0, import_rxjs17.filter)(userDrillDown.match), (0, import_rxjs17.switchMap)(function (action) {
2007
2035
  var state = state$.value;
2008
2036
  var _a = action.payload, bcName = _a.bcName, fieldKey = _a.fieldKey, cursor = _a.cursor;
2009
2037
  var bcUrl = buildBcUrl(bcName, true, state);
2010
- return api.fetchRowMeta(state.screen.screenName, bcUrl).pipe((0, import_rxjs16.mergeMap)(function (rowMeta) {
2038
+ return api.fetchRowMeta(state.screen.screenName, bcUrl).pipe((0, import_rxjs17.mergeMap)(function (rowMeta) {
2011
2039
  var _a, _b, _c, _d;
2012
2040
  var drillDownField = rowMeta.fields.find(function (field) { return field.key === fieldKey; });
2013
2041
  var route = state.router;
2014
2042
  var drillDownKey = (_b = (_a = state.view.widgets.find(function (widget) { return widget.bcName === bcName; })) === null || _a === void 0 ? void 0 : _a.fields.find(function (field) { return field.key === fieldKey; })) === null || _b === void 0 ? void 0 : _b.drillDownKey;
2015
2043
  var customDrillDownUrl = (_d = (_c = state.data[bcName]) === null || _c === void 0 ? void 0 : _c.find(function (record) { return record.id === cursor; })) === null || _d === void 0 ? void 0 : _d[drillDownKey];
2016
- return customDrillDownUrl || (drillDownField === null || drillDownField === void 0 ? void 0 : drillDownField.drillDown) || (drillDownField === null || drillDownField === void 0 ? void 0 : drillDownField.drillDown) !== route.path ? (0, import_rxjs16.concat)((drillDownField === null || drillDownField === void 0 ? void 0 : drillDownField.drillDownType) !== import_schema.DrillDownType.inner ? (0, import_rxjs16.of)(bcFetchRowMetaSuccess({ bcName: bcName, rowMeta: rowMeta, bcUrl: bcUrl, cursor: cursor })) : import_rxjs16.EMPTY, (0, import_rxjs16.of)(userDrillDownSuccess({ bcName: bcName, bcUrl: bcUrl, cursor: cursor })), (0, import_rxjs16.of)(drillDown({
2044
+ return customDrillDownUrl || (drillDownField === null || drillDownField === void 0 ? void 0 : drillDownField.drillDown) || (drillDownField === null || drillDownField === void 0 ? void 0 : drillDownField.drillDown) !== route.path ? (0, import_rxjs17.concat)((drillDownField === null || drillDownField === void 0 ? void 0 : drillDownField.drillDownType) !== import_schema.DrillDownType.inner ? (0, import_rxjs17.of)(bcFetchRowMetaSuccess({ bcName: bcName, rowMeta: rowMeta, bcUrl: bcUrl, cursor: cursor })) : import_rxjs17.EMPTY, (0, import_rxjs17.of)(userDrillDownSuccess({ bcName: bcName, bcUrl: bcUrl, cursor: cursor })), (0, import_rxjs17.of)(drillDown({
2017
2045
  url: customDrillDownUrl || drillDownField.drillDown,
2018
2046
  drillDownType: drillDownField.drillDownType,
2019
2047
  route: route
2020
- }))) : import_rxjs16.EMPTY;
2021
- }), (0, import_rxjs16.catchError)(function (error) {
2048
+ }))) : import_rxjs17.EMPTY;
2049
+ }), (0, import_rxjs17.catchError)(function (error) {
2022
2050
  console.error(error);
2023
- return import_rxjs16.EMPTY;
2051
+ return createApiErrorObservable(error);
2024
2052
  }));
2025
2053
  }));
2026
2054
  };
2027
2055
  // src/epics/router/changeLocationEpic.ts
2028
- var import_rxjs17 = require("rxjs");
2029
- var changeLocationEpic = function (action$, state$) { return action$.pipe((0, import_rxjs17.filter)(changeLocation.match), (0, import_rxjs17.mergeMap)(function (action) {
2056
+ var import_rxjs18 = require("rxjs");
2057
+ var changeLocationEpic = function (action$, state$) { return action$.pipe((0, import_rxjs18.filter)(changeLocation.match), (0, import_rxjs18.mergeMap)(function (action) {
2030
2058
  var _a, _b;
2031
2059
  var state = state$.value;
2032
2060
  if (!state.session.active) {
2033
- return import_rxjs17.EMPTY;
2061
+ return import_rxjs18.EMPTY;
2034
2062
  }
2035
2063
  if (state.router.type === "router" /* router */) {
2036
- return (0, import_rxjs17.of)(handleRouter(state.router));
2064
+ return (0, import_rxjs18.of)(handleRouter(state.router));
2037
2065
  }
2038
2066
  var currentScreenName = state.screen.screenName;
2039
2067
  var defaultScreenName = ((_a = state.session.screens.find(function (screen) { return screen.defaultScreen; })) === null || _a === void 0 ? void 0 : _a.name) || ((_b = state.session.screens[0]) === null || _b === void 0 ? void 0 : _b.name);
2040
2068
  var nextScreenName = state.router.type === "default" /* default */ ? defaultScreenName : state.router.screenName;
2041
2069
  if (nextScreenName !== currentScreenName) {
2042
2070
  var nextScreen = state.session.screens.find(function (item) { return item.name === nextScreenName; });
2043
- return nextScreen ? (0, import_rxjs17.of)(selectScreen({ screen: nextScreen })) : (0, import_rxjs17.of)(selectScreenFail({ screenName: nextScreenName }));
2071
+ return nextScreen ? (0, import_rxjs18.of)(selectScreen({ screen: nextScreen })) : (0, import_rxjs18.of)(selectScreenFail({ screenName: nextScreenName }));
2044
2072
  }
2045
2073
  var currentViewName = state.view.name;
2046
2074
  var nextViewName = state.router.viewName;
@@ -2057,25 +2085,25 @@ var changeLocationEpic = function (action$, state$) { return action$.pipe((0, im
2057
2085
  var needUpdateViews = nextViewName !== currentViewName;
2058
2086
  var resultObservables = [];
2059
2087
  if (needUpdateCursors) {
2060
- resultObservables.push((0, import_rxjs17.of)(bcChangeCursors({ cursorsMap: cursorsDiffMap })));
2088
+ resultObservables.push((0, import_rxjs18.of)(bcChangeCursors({ cursorsMap: cursorsDiffMap })));
2061
2089
  }
2062
2090
  if (needUpdateViews) {
2063
2091
  var nextView = nextViewName ? state.screen.views.find(function (item) { return item.name === nextViewName; }) : state.screen.primaryView ? state.screen.views.find(function (item) { return item.name === state.screen.primaryView; }) : state.screen.views[0];
2064
- resultObservables.push(nextView ? (0, import_rxjs17.of)(selectView(nextView)) : (0, import_rxjs17.of)(selectViewFail({ viewName: nextViewName })));
2092
+ resultObservables.push(nextView ? (0, import_rxjs18.of)(selectView(nextView)) : (0, import_rxjs18.of)(selectViewFail({ viewName: nextViewName })));
2065
2093
  }
2066
2094
  if (needUpdateCursors && !needUpdateViews) {
2067
2095
  Object.entries(nextCursors).forEach(function (entry) {
2068
2096
  var bcName = entry[0], cursor = entry[1];
2069
2097
  if (!state.data[bcName].find(function (item) { return item.id === cursor; })) {
2070
- resultObservables.push((0, import_rxjs17.of)(bcForceUpdate({ bcName: bcName })));
2098
+ resultObservables.push((0, import_rxjs18.of)(bcForceUpdate({ bcName: bcName })));
2071
2099
  }
2072
2100
  });
2073
2101
  }
2074
- return (0, import_rxjs17.concat).apply(void 0, resultObservables);
2102
+ return (0, import_rxjs18.concat).apply(void 0, resultObservables);
2075
2103
  })); };
2076
2104
  // src/epics/router/selectViewFailEpic.ts
2077
- var import_rxjs18 = require("rxjs");
2078
- var selectViewFailEpic = function (action$, state$) { return action$.pipe((0, import_rxjs18.filter)(selectViewFail.match), (0, import_rxjs18.map)(function (action) {
2105
+ var import_rxjs19 = require("rxjs");
2106
+ var selectViewFailEpic = function (action$, state$) { return action$.pipe((0, import_rxjs19.filter)(selectViewFail.match), (0, import_rxjs19.map)(function (action) {
2079
2107
  return addNotification({
2080
2108
  type: "error",
2081
2109
  key: "selectViewFail",
@@ -2084,8 +2112,8 @@ var selectViewFailEpic = function (action$, state$) { return action$.pipe((0, im
2084
2112
  });
2085
2113
  })); };
2086
2114
  // src/epics/router/selectScreenFailEpic.ts
2087
- var import_rxjs19 = require("rxjs");
2088
- var selectScreenFailEpic = function (action$) { return action$.pipe((0, import_rxjs19.filter)(selectScreenFail.match), (0, import_rxjs19.map)(function (action) {
2115
+ var import_rxjs20 = require("rxjs");
2116
+ var selectScreenFailEpic = function (action$) { return action$.pipe((0, import_rxjs20.filter)(selectScreenFail.match), (0, import_rxjs20.map)(function (action) {
2089
2117
  return addNotification({
2090
2118
  type: "error",
2091
2119
  key: "selectScreenFail",
@@ -2094,8 +2122,8 @@ var selectScreenFailEpic = function (action$) { return action$.pipe((0, import_r
2094
2122
  });
2095
2123
  })); };
2096
2124
  // src/epics/router/userDrilldownChangeCursorsEpic.ts
2097
- var import_rxjs20 = require("rxjs");
2098
- var userDrillDownChangeCursorsEpic = function (action$, state$) { return action$.pipe((0, import_rxjs20.filter)(userDrillDown.match), (0, import_rxjs20.map)(function (action) {
2125
+ var import_rxjs21 = require("rxjs");
2126
+ var userDrillDownChangeCursorsEpic = function (action$, state$) { return action$.pipe((0, import_rxjs21.filter)(userDrillDown.match), (0, import_rxjs21.map)(function (action) {
2099
2127
  var _a;
2100
2128
  var _b;
2101
2129
  var state = state$.value;
@@ -2108,30 +2136,30 @@ var userDrillDownChangeCursorsEpic = function (action$, state$) { return action$
2108
2136
  })); };
2109
2137
  // src/epics/screen/apiErrorEpic.ts
2110
2138
  var import_axios = __toESM(require("axios"));
2111
- var import_rxjs21 = require("rxjs");
2112
- var apiErrorEpic = function (action$) { return action$.pipe((0, import_rxjs21.filter)(apiError.match), (0, import_rxjs21.mergeMap)(function (action) {
2139
+ var import_rxjs22 = require("rxjs");
2140
+ var apiErrorEpic = function (action$) { return action$.pipe((0, import_rxjs22.filter)(apiError.match), (0, import_rxjs22.mergeMap)(function (action) {
2113
2141
  var _a = action.payload, error = _a.error, callContext = _a.callContext;
2114
2142
  if (error.response) {
2115
- return (0, import_rxjs21.of)(httpError({
2143
+ return (0, import_rxjs22.of)(httpError({
2116
2144
  statusCode: error.response.status,
2117
2145
  error: error,
2118
2146
  callContext: callContext
2119
2147
  }));
2120
2148
  }
2121
2149
  else if (!import_axios.default.isCancel(error)) {
2122
- return (0, import_rxjs21.of)(showViewError({
2150
+ return (0, import_rxjs22.of)(showViewError({
2123
2151
  error: {
2124
2152
  type: 2 /* NetworkError */
2125
2153
  }
2126
2154
  }));
2127
2155
  }
2128
- return import_rxjs21.EMPTY;
2156
+ return import_rxjs22.EMPTY;
2129
2157
  })); };
2130
2158
  // src/epics/screen/downloadFileEpic.ts
2131
- var import_rxjs22 = require("rxjs");
2159
+ var import_rxjs23 = require("rxjs");
2132
2160
  var downloadFileEpic = function (action$, state$, _a) {
2133
2161
  var api = _a.api;
2134
- return action$.pipe((0, import_rxjs22.filter)(downloadFile.match), (0, import_rxjs22.tap)(function (action) {
2162
+ return action$.pipe((0, import_rxjs23.filter)(downloadFile.match), (0, import_rxjs23.tap)(function (action) {
2135
2163
  var fileId = action.payload.fileId;
2136
2164
  var anchor = document.createElement("a");
2137
2165
  anchor.href = "".concat(api.fileUploadEndpoint, "?id=").concat(encodeURIComponent(fileId));
@@ -2141,16 +2169,16 @@ var downloadFileEpic = function (action$, state$, _a) {
2141
2169
  anchor.click();
2142
2170
  document.body.removeChild(anchor);
2143
2171
  }, 100);
2144
- }), (0, import_rxjs22.mergeMap)(function () { return import_rxjs22.EMPTY; }));
2172
+ }), (0, import_rxjs23.mergeMap)(function () { return import_rxjs23.EMPTY; }));
2145
2173
  };
2146
2174
  // src/epics/screen/httpError401Epic.ts
2147
- var import_rxjs23 = require("rxjs");
2148
- var httpError401Epic = function (action$) { return action$.pipe((0, import_rxjs23.filter)(httpError.match), (0, import_rxjs23.filter)(function (action) { return action.payload.statusCode === 401; }), (0, import_rxjs23.map)(function (action) {
2175
+ var import_rxjs24 = require("rxjs");
2176
+ var httpError401Epic = function (action$) { return action$.pipe((0, import_rxjs24.filter)(httpError.match), (0, import_rxjs24.filter)(function (action) { return action.payload.statusCode === 401; }), (0, import_rxjs24.map)(function (action) {
2149
2177
  return logoutDone(null);
2150
2178
  })); };
2151
2179
  // src/epics/screen/httpError409Epic.ts
2152
- var import_rxjs24 = require("rxjs");
2153
- var httpError409Epic = function (action$, state$) { return action$.pipe((0, import_rxjs24.filter)(httpError.match), (0, import_rxjs24.filter)(function (action) { return action.payload.statusCode === 409; }), (0, import_rxjs24.map)(function (action) {
2180
+ var import_rxjs25 = require("rxjs");
2181
+ var httpError409Epic = function (action$, state$) { return action$.pipe((0, import_rxjs25.filter)(httpError.match), (0, import_rxjs25.filter)(function (action) { return action.payload.statusCode === 409; }), (0, import_rxjs25.map)(function (action) {
2154
2182
  var _a, _b, _c;
2155
2183
  var notificationMessage = ((_c = (_b = ((_a = action.payload.error.response) === null || _a === void 0 ? void 0 : _a.data).error) === null || _b === void 0 ? void 0 : _b.popup) === null || _c === void 0 ? void 0 : _c[0]) || "";
2156
2184
  return addNotification({
@@ -2166,34 +2194,34 @@ var httpError409Epic = function (action$, state$) { return action$.pipe((0, impo
2166
2194
  });
2167
2195
  })); };
2168
2196
  // src/epics/screen/httpError418Epic.ts
2169
- var import_rxjs25 = require("rxjs");
2170
- var httpError418Epic = function (action$, state$) { return action$.pipe((0, import_rxjs25.filter)(httpError.match), (0, import_rxjs25.filter)(function (action) { return action.payload.statusCode === 418; }), (0, import_rxjs25.mergeMap)(function (action) {
2197
+ var import_rxjs26 = require("rxjs");
2198
+ var httpError418Epic = function (action$, state$) { return action$.pipe((0, import_rxjs26.filter)(httpError.match), (0, import_rxjs26.filter)(function (action) { return action.payload.statusCode === 418; }), (0, import_rxjs26.mergeMap)(function (action) {
2171
2199
  var _a, _b;
2172
2200
  var _c = action.payload, error = _c.error, callContext = _c.callContext;
2173
2201
  var result = [];
2174
2202
  var typedError = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data;
2175
2203
  if (!typedError.error.popup) {
2176
- return import_rxjs25.EMPTY;
2204
+ return import_rxjs26.EMPTY;
2177
2205
  }
2178
2206
  var businessError = {
2179
2207
  type: 0 /* BusinessError */,
2180
2208
  message: typedError.error.popup[0]
2181
2209
  };
2182
- result.push((0, import_rxjs25.of)(showViewError({ error: businessError })));
2210
+ result.push((0, import_rxjs26.of)(showViewError({ error: businessError })));
2183
2211
  if ((_b = typedError.error.postActions) === null || _b === void 0 ? void 0 : _b[0]) {
2184
2212
  var widget = state$.value.view.widgets.find(function (item) { return item.name === callContext.widgetName; });
2185
2213
  var bcName = widget === null || widget === void 0 ? void 0 : widget.bcName;
2186
- result.push((0, import_rxjs25.of)(processPostInvoke({
2214
+ result.push((0, import_rxjs26.of)(processPostInvoke({
2187
2215
  bcName: bcName,
2188
2216
  postInvoke: typedError.error.postActions[0],
2189
2217
  widgetName: widget === null || widget === void 0 ? void 0 : widget.name
2190
2218
  })));
2191
2219
  }
2192
- return (0, import_rxjs25.concat).apply(void 0, result);
2220
+ return (0, import_rxjs26.concat).apply(void 0, result);
2193
2221
  })); };
2194
2222
  // src/epics/screen/httpError500Epic.ts
2195
- var import_rxjs26 = require("rxjs");
2196
- var httpError500Epic = function (action$, state$) { return action$.pipe((0, import_rxjs26.filter)(httpError.match), (0, import_rxjs26.filter)(function (action) { return action.payload.statusCode === 500; }), (0, import_rxjs26.map)(function (action) {
2223
+ var import_rxjs27 = require("rxjs");
2224
+ var httpError500Epic = function (action$, state$) { return action$.pipe((0, import_rxjs27.filter)(httpError.match), (0, import_rxjs27.filter)(function (action) { return action.payload.statusCode === 500; }), (0, import_rxjs27.map)(function (action) {
2197
2225
  var _a;
2198
2226
  var systemError = {
2199
2227
  type: 1 /* SystemError */,
@@ -2203,9 +2231,9 @@ var httpError500Epic = function (action$, state$) { return action$.pipe((0, impo
2203
2231
  return showViewError({ error: systemError });
2204
2232
  })); };
2205
2233
  // src/epics/screen/httpErrorDefaultEpic.ts
2206
- var import_rxjs27 = require("rxjs");
2234
+ var import_rxjs28 = require("rxjs");
2207
2235
  var knownHttpErrors = [401, 409, 418, 500];
2208
- var httpErrorDefaultEpic = function (action$, state$) { return action$.pipe((0, import_rxjs27.filter)(httpError.match), (0, import_rxjs27.filter)(function (action) { return !knownHttpErrors.includes(action.payload.statusCode); }), (0, import_rxjs27.map)(function (action) {
2236
+ var httpErrorDefaultEpic = function (action$, state$) { return action$.pipe((0, import_rxjs28.filter)(httpError.match), (0, import_rxjs28.filter)(function (action) { return !knownHttpErrors.includes(action.payload.statusCode); }), (0, import_rxjs28.map)(function (action) {
2209
2237
  var _a, _b;
2210
2238
  var businessError = {
2211
2239
  type: 0 /* BusinessError */,
@@ -2215,8 +2243,8 @@ var httpErrorDefaultEpic = function (action$, state$) { return action$.pipe((0,
2215
2243
  return showViewError({ error: businessError });
2216
2244
  })); };
2217
2245
  // src/epics/screen/downloadFileByUrlEpic.ts
2218
- var import_rxjs28 = require("rxjs");
2219
- var downloadFileByUrlEpic = function (action$, state$) { return action$.pipe((0, import_rxjs28.filter)(downloadFileByUrl.match), (0, import_rxjs28.tap)(function (action) {
2246
+ var import_rxjs29 = require("rxjs");
2247
+ var downloadFileByUrlEpic = function (action$, state$) { return action$.pipe((0, import_rxjs29.filter)(downloadFileByUrl.match), (0, import_rxjs29.tap)(function (action) {
2220
2248
  var url = action.payload.url;
2221
2249
  var anchor = document.createElement("a");
2222
2250
  anchor.href = url;
@@ -2226,16 +2254,16 @@ var downloadFileByUrlEpic = function (action$, state$) { return action$.pipe((0,
2226
2254
  anchor.click();
2227
2255
  document.body.removeChild(anchor);
2228
2256
  }, 100);
2229
- }), (0, import_rxjs28.mergeMap)(function () { return import_rxjs28.EMPTY; })); };
2257
+ }), (0, import_rxjs29.mergeMap)(function () { return import_rxjs29.EMPTY; })); };
2230
2258
  // src/epics/screen/processPostInvokeEpic.ts
2231
- var import_rxjs29 = require("rxjs");
2232
- var processPostInvokeEpic = function (action$, state$) { return action$.pipe((0, import_rxjs29.filter)(processPostInvoke.match), (0, import_rxjs29.mergeMap)(function (action) {
2259
+ var import_rxjs30 = require("rxjs");
2260
+ var processPostInvokeEpic = function (action$, state$) { return action$.pipe((0, import_rxjs30.filter)(processPostInvoke.match), (0, import_rxjs30.mergeMap)(function (action) {
2233
2261
  var _a;
2234
2262
  var _b;
2235
2263
  var state = state$.value;
2236
2264
  switch (action.payload.postInvoke.type) {
2237
2265
  case "drillDown" /* drillDown */:
2238
- return (0, import_rxjs29.of)(drillDown(__assign(__assign({}, action.payload.postInvoke), { route: state.router, widgetName: action.payload.widgetName })));
2266
+ return (0, import_rxjs30.of)(drillDown(__assign(__assign({}, action.payload.postInvoke), { route: state.router, widgetName: action.payload.widgetName })));
2239
2267
  case "postDelete" /* postDelete */: {
2240
2268
  var cursorsMap = (_a = {}, _a[action.payload.bcName] = null, _a);
2241
2269
  var result = [bcChangeCursors({ cursorsMap: cursorsMap })];
@@ -2250,7 +2278,7 @@ var processPostInvokeEpic = function (action$, state$) { return action$.pipe((0,
2250
2278
  widgetName: action.payload.widgetName
2251
2279
  }));
2252
2280
  }
2253
- return (0, import_rxjs29.of).apply(void 0, result);
2281
+ return (0, import_rxjs30.of).apply(void 0, result);
2254
2282
  }
2255
2283
  case "refreshBC" /* refreshBC */: {
2256
2284
  var bo = state.screen.bo;
@@ -2260,36 +2288,36 @@ var processPostInvokeEpic = function (action$, state$) { return action$.pipe((0,
2260
2288
  var widgetName = action.payload.widgetName || "";
2261
2289
  var infiniteWidgets_1 = state.view.infiniteWidgets || [];
2262
2290
  var infinitePagination = state.view.widgets.some(function (item) { return item.bcName === postInvokeBC_1 && infiniteWidgets_1.includes(item.name); });
2263
- return infinitePagination ? (0, import_rxjs29.of)(bcFetchDataPages({
2291
+ return infinitePagination ? (0, import_rxjs30.of)(bcFetchDataPages({
2264
2292
  bcName: postInvokeBCItem.name,
2265
2293
  widgetName: widgetName,
2266
2294
  from: 1,
2267
2295
  to: postInvokeBCItem.page
2268
- })) : (0, import_rxjs29.of)(bcFetchDataRequest({
2296
+ })) : (0, import_rxjs30.of)(bcFetchDataRequest({
2269
2297
  bcName: postInvokeBCItem.name,
2270
2298
  widgetName: widgetName
2271
2299
  }));
2272
2300
  }
2273
2301
  case "showMessage" /* showMessage */: {
2274
2302
  var postInvoke = action.payload.postInvoke;
2275
- return (0, import_rxjs29.of)(showNotification({ type: postInvoke.messageType, message: postInvoke.messageText }));
2303
+ return (0, import_rxjs30.of)(showNotification({ type: postInvoke.messageType, message: postInvoke.messageText }));
2276
2304
  }
2277
2305
  case "downloadFile" /* downloadFile */: {
2278
2306
  var postInvoke = action.payload.postInvoke;
2279
- return (0, import_rxjs29.of)(downloadFile({ fileId: postInvoke.fileId }));
2307
+ return (0, import_rxjs30.of)(downloadFile({ fileId: postInvoke.fileId }));
2280
2308
  }
2281
2309
  case "downloadFileByUrl" /* downloadFileByUrl */: {
2282
2310
  var postInvoke = action.payload.postInvoke;
2283
- return (0, import_rxjs29.of)(downloadFileByUrl({ url: postInvoke.url }));
2311
+ return (0, import_rxjs30.of)(downloadFileByUrl({ url: postInvoke.url }));
2284
2312
  }
2285
2313
  default:
2286
- return import_rxjs29.EMPTY;
2314
+ return import_rxjs30.EMPTY;
2287
2315
  }
2288
2316
  })); };
2289
2317
  // src/epics/screen/processPostInvokeConfirmEpic.ts
2290
- var import_rxjs30 = require("rxjs");
2318
+ var import_rxjs31 = require("rxjs");
2291
2319
  var import_toolkit3 = require("@reduxjs/toolkit");
2292
- var processPostInvokeConfirmEpic = function (action$, state$) { return action$.pipe((0, import_rxjs30.filter)((0, import_toolkit3.isAnyOf)(processPostInvokeConfirm, processPreInvoke)), (0, import_rxjs30.mergeMap)(function (action) {
2320
+ var processPostInvokeConfirmEpic = function (action$, state$) { return action$.pipe((0, import_rxjs31.filter)((0, import_toolkit3.isAnyOf)(processPostInvokeConfirm, processPreInvoke)), (0, import_rxjs31.mergeMap)(function (action) {
2293
2321
  var _a = action.payload, bcName = _a.bcName, operationType = _a.operationType, widgetName = _a.widgetName;
2294
2322
  var confirm = processPostInvokeConfirm.match(action) ? action.payload.postInvokeConfirm : action.payload.preInvoke;
2295
2323
  switch (confirm.type) {
@@ -2297,7 +2325,7 @@ var processPostInvokeConfirmEpic = function (action$, state$) { return action$.p
2297
2325
  case "info" /* info */:
2298
2326
  case "error" /* error */:
2299
2327
  case "confirmText" /* confirmText */: {
2300
- return (0, import_rxjs30.of)(operationConfirmation({
2328
+ return (0, import_rxjs31.of)(operationConfirmation({
2301
2329
  operation: {
2302
2330
  bcName: bcName,
2303
2331
  operationType: operationType,
@@ -2307,48 +2335,48 @@ var processPostInvokeConfirmEpic = function (action$, state$) { return action$.p
2307
2335
  }));
2308
2336
  }
2309
2337
  default:
2310
- return import_rxjs30.EMPTY;
2338
+ return import_rxjs31.EMPTY;
2311
2339
  }
2312
2340
  })); };
2313
2341
  // src/epics/session/switchRoleEpic.ts
2314
- var import_rxjs31 = require("rxjs");
2315
- var switchRoleEpic = function (action$, state$) { return action$.pipe((0, import_rxjs31.filter)(switchRole.match), (0, import_rxjs31.switchMap)(function (action) {
2316
- return (0, import_rxjs31.concat)([logoutDone(null), login({ login: "", password: "", role: action.payload.role })]);
2342
+ var import_rxjs32 = require("rxjs");
2343
+ var switchRoleEpic = function (action$, state$) { return action$.pipe((0, import_rxjs32.filter)(switchRole.match), (0, import_rxjs32.switchMap)(function (action) {
2344
+ return (0, import_rxjs32.concat)([logoutDone(null), login({ login: "", password: "", role: action.payload.role })]);
2317
2345
  })); };
2318
2346
  // src/epics/session/refreshMetaEpic.ts
2319
- var import_rxjs32 = require("rxjs");
2347
+ var import_rxjs33 = require("rxjs");
2320
2348
  var refreshMetaEpic = function (action$, state$, _a) {
2321
2349
  var api = _a.api;
2322
- return action$.pipe((0, import_rxjs32.filter)(refreshMeta.match), (0, import_rxjs32.mergeMap)(function () {
2350
+ return action$.pipe((0, import_rxjs33.filter)(refreshMeta.match), (0, import_rxjs33.mergeMap)(function () {
2323
2351
  var state = state$.value;
2324
2352
  var router = state.router;
2325
2353
  var activeRole = state.session.activeRole;
2326
- return api.refreshMeta().pipe((0, import_rxjs32.switchMap)(function () { return (0, import_rxjs32.concat)([
2354
+ return api.refreshMeta().pipe((0, import_rxjs33.switchMap)(function () { return (0, import_rxjs33.concat)([
2327
2355
  refreshMetaDone(),
2328
2356
  logoutDone(null),
2329
2357
  login({ login: "", password: "", role: activeRole }),
2330
2358
  changeLocation({
2331
2359
  location: router
2332
2360
  })
2333
- ]); }), (0, import_rxjs32.catchError)(function (error) { return (0, import_rxjs32.concat)([loginFail(error), refreshMetaFail()]); }));
2361
+ ]); }), (0, import_rxjs33.catchError)(function (error) { return (0, import_rxjs33.concat)([loginFail(error), refreshMetaFail(), createApiError(error)]); }));
2334
2362
  }));
2335
2363
  };
2336
2364
  // src/epics/session/loginDoneEpic.ts
2337
- var import_rxjs33 = require("rxjs");
2338
- var loginDoneSessionEpic = function (action$, store) { return action$.pipe((0, import_rxjs33.filter)(login.match), (0, import_rxjs33.switchMap)(function (action) { return import_rxjs33.EMPTY; })); };
2339
- // src/epics/session/loginByAnotherRoleEpic.ts
2340
2365
  var import_rxjs34 = require("rxjs");
2366
+ var loginDoneSessionEpic = function (action$, store) { return action$.pipe((0, import_rxjs34.filter)(login.match), (0, import_rxjs34.switchMap)(function (action) { return import_rxjs34.EMPTY; })); };
2367
+ // src/epics/session/loginByAnotherRoleEpic.ts
2368
+ var import_rxjs35 = require("rxjs");
2341
2369
  var responseStatusMessages = {
2342
2370
  401: "Invalid credentials",
2343
2371
  403: "Access denied"
2344
2372
  };
2345
2373
  var loginByAnotherRoleEpic = function (action$, state$, _a) {
2346
2374
  var api = _a.api;
2347
- return action$.pipe((0, import_rxjs34.filter)(login.match), (0, import_rxjs34.filter)(function (action) { var _a; return !!((_a = action.payload) === null || _a === void 0 ? void 0 : _a.role); }), (0, import_rxjs34.switchMap)(function (action) {
2375
+ return action$.pipe((0, import_rxjs35.filter)(login.match), (0, import_rxjs35.filter)(function (action) { var _a; return !!((_a = action.payload) === null || _a === void 0 ? void 0 : _a.role); }), (0, import_rxjs35.switchMap)(function (action) {
2348
2376
  var _a;
2349
2377
  var role = (_a = action.payload.role) !== null && _a !== void 0 ? _a : "";
2350
2378
  var isSwitchRole = role && role !== state$.value.session.activeRole;
2351
- return api.loginByRoleRequest(role).pipe((0, import_rxjs34.mergeMap)(function (data) {
2379
+ return api.loginByRoleRequest(role).pipe((0, import_rxjs35.mergeMap)(function (data) {
2352
2380
  var _a;
2353
2381
  var result = [];
2354
2382
  if (isSwitchRole) {
@@ -2358,7 +2386,7 @@ var loginByAnotherRoleEpic = function (action$, state$, _a) {
2358
2386
  if (defaultView)
2359
2387
  result.push(changeLocation({ location: defaultParseURL(new URL(defaultView.url, window.location.origin)) }));
2360
2388
  }
2361
- return (0, import_rxjs34.concat)(__spreadArray(__spreadArray([], result, true), [
2389
+ return (0, import_rxjs35.concat)(__spreadArray(__spreadArray([], result, true), [
2362
2390
  loginDone({
2363
2391
  devPanelEnabled: data.devPanelEnabled,
2364
2392
  activeRole: data.activeRole,
@@ -2369,29 +2397,29 @@ var loginByAnotherRoleEpic = function (action$, state$, _a) {
2369
2397
  login: data.login
2370
2398
  })
2371
2399
  ], false));
2372
- }), (0, import_rxjs34.catchError)(function (error) {
2400
+ }), (0, import_rxjs35.catchError)(function (error) {
2373
2401
  console.error(error);
2374
2402
  var errorMsg = error.response ? responseStatusMessages[error.response.status] || "Server application unavailable" : "Empty server response";
2375
- return (0, import_rxjs34.of)(loginFail({ errorMsg: errorMsg }));
2403
+ return (0, import_rxjs35.concat)((0, import_rxjs35.of)(loginFail({ errorMsg: errorMsg })), createApiErrorObservable(error));
2376
2404
  }));
2377
2405
  }));
2378
2406
  };
2379
2407
  // src/epics/session/refreshMetaAndReloadPageEpic.ts
2380
- var import_rxjs35 = require("rxjs");
2381
- var refreshMetaAndReloadPageEpic = function (action$, state$) { return action$.pipe((0, import_rxjs35.filter)(refreshMetaAndReloadPage.match), (0, import_rxjs35.switchMap)(function () { return (0, import_rxjs35.concat)((0, import_rxjs35.of)(refreshMeta(null)), action$.pipe((0, import_rxjs35.filter)(loginDone.match), (0, import_rxjs35.take)(1), (0, import_rxjs35.tap)(function () { return location.reload(); }), (0, import_rxjs35.switchMap)(function () { return import_rxjs35.EMPTY; }))); })); };
2382
- // src/epics/data/bcNewDataEpic.ts
2383
2408
  var import_rxjs36 = require("rxjs");
2409
+ var refreshMetaAndReloadPageEpic = function (action$, state$) { return action$.pipe((0, import_rxjs36.filter)(refreshMetaAndReloadPage.match), (0, import_rxjs36.switchMap)(function () { return (0, import_rxjs36.concat)((0, import_rxjs36.of)(refreshMeta()), action$.pipe((0, import_rxjs36.filter)(loginDone.match), (0, import_rxjs36.take)(1), (0, import_rxjs36.tap)(function () { return location.reload(); }), (0, import_rxjs36.switchMap)(function () { return import_rxjs36.EMPTY; }))); })); };
2410
+ // src/epics/data/bcNewDataEpic.ts
2411
+ var import_rxjs37 = require("rxjs");
2384
2412
  var import_schema13 = require("@cxbox-ui/schema");
2385
2413
  var bcNewDataEpic = function (action$, state$, _a) {
2386
2414
  var api = _a.api;
2387
- return action$.pipe((0, import_rxjs36.filter)(sendOperation.match), (0, import_rxjs36.filter)(function (action) { return matchOperationRole(import_schema13.OperationTypeCrud.create, action.payload, state$.value); }), (0, import_rxjs36.mergeMap)(function (action) {
2415
+ return action$.pipe((0, import_rxjs37.filter)(sendOperation.match), (0, import_rxjs37.filter)(function (action) { return matchOperationRole(import_schema13.OperationTypeCrud.create, action.payload, state$.value); }), (0, import_rxjs37.mergeMap)(function (action) {
2388
2416
  var _a;
2389
2417
  var state = state$.value;
2390
2418
  var bcName = action.payload.bcName;
2391
2419
  var bcUrl = (_a = buildBcUrl(bcName, false, state)) !== null && _a !== void 0 ? _a : "";
2392
2420
  var context = { widgetName: action.payload.widgetName };
2393
2421
  var params = { _action: action.payload.operationType };
2394
- return api.newBcData(state.screen.screenName, bcUrl, context, params).pipe((0, import_rxjs36.mergeMap)(function (data) {
2422
+ return api.newBcData(state.screen.screenName, bcUrl, context, params).pipe((0, import_rxjs37.mergeMap)(function (data) {
2395
2423
  var _a, _b;
2396
2424
  var rowMeta = data.row;
2397
2425
  var dataItem = { id: null, vstamp: -1 };
@@ -2400,39 +2428,39 @@ var bcNewDataEpic = function (action$, state$, _a) {
2400
2428
  });
2401
2429
  var postInvoke = (_a = data.postActions) === null || _a === void 0 ? void 0 : _a[0];
2402
2430
  var cursor = dataItem.id;
2403
- return (0, import_rxjs36.concat)((0, import_rxjs36.of)(bcNewDataSuccess({ bcName: bcName, dataItem: dataItem, bcUrl: bcUrl })), (0, import_rxjs36.of)(bcFetchRowMetaSuccess({ bcName: bcName, bcUrl: "".concat(bcUrl, "/").concat(cursor), rowMeta: rowMeta, cursor: cursor })), (0, import_rxjs36.of)(changeDataItem({
2431
+ return (0, import_rxjs37.concat)((0, import_rxjs37.of)(bcNewDataSuccess({ bcName: bcName, dataItem: dataItem, bcUrl: bcUrl })), (0, import_rxjs37.of)(bcFetchRowMetaSuccess({ bcName: bcName, bcUrl: "".concat(bcUrl, "/").concat(cursor), rowMeta: rowMeta, cursor: cursor })), (0, import_rxjs37.of)(changeDataItem({
2404
2432
  bcName: bcName,
2405
2433
  bcUrl: (_b = buildBcUrl(bcName, true, state)) !== null && _b !== void 0 ? _b : "",
2406
2434
  cursor: cursor,
2407
2435
  dataItem: {
2408
2436
  id: cursor
2409
2437
  }
2410
- })), postInvoke ? (0, import_rxjs36.of)(processPostInvoke({ bcName: bcName, postInvoke: postInvoke, cursor: cursor, widgetName: action.payload.widgetName })) : import_rxjs36.EMPTY);
2411
- }), (0, import_rxjs36.catchError)(function (error) {
2438
+ })), postInvoke ? (0, import_rxjs37.of)(processPostInvoke({ bcName: bcName, postInvoke: postInvoke, cursor: cursor, widgetName: action.payload.widgetName })) : import_rxjs37.EMPTY);
2439
+ }), (0, import_rxjs37.catchError)(function (error) {
2412
2440
  console.error(error);
2413
- return (0, import_rxjs36.of)(bcNewDataFail({ bcName: bcName }));
2441
+ return (0, import_rxjs37.concat)((0, import_rxjs37.of)(bcNewDataFail({ bcName: bcName })), createApiErrorObservable(error, context));
2414
2442
  }));
2415
2443
  }));
2416
2444
  };
2417
2445
  // src/epics/data/bcLoadMoreEpic.ts
2418
- var import_rxjs38 = require("rxjs");
2446
+ var import_rxjs39 = require("rxjs");
2419
2447
  // src/utils/cancelRequestEpic.ts
2420
- var import_rxjs37 = require("rxjs");
2448
+ var import_rxjs38 = require("rxjs");
2421
2449
  var import_toolkit4 = require("@reduxjs/toolkit");
2422
2450
  var cancelRequestActionTypes = [selectView, logout];
2423
2451
  function cancelRequestEpic(action$, actionTypes, cancelFn, cancelActionCreator, filterFn) {
2424
2452
  if (filterFn === void 0) { filterFn = function (item) {
2425
2453
  return true;
2426
2454
  }; }
2427
- return action$.pipe((0, import_rxjs37.filter)((0, import_toolkit4.isAnyOf).apply(void 0, actionTypes)), (0, import_rxjs37.filter)(filterFn), (0, import_rxjs37.mergeMap)(function () {
2455
+ return action$.pipe((0, import_rxjs38.filter)((0, import_toolkit4.isAnyOf).apply(void 0, actionTypes)), (0, import_rxjs38.filter)(filterFn), (0, import_rxjs38.mergeMap)(function () {
2428
2456
  cancelFn === null || cancelFn === void 0 ? void 0 : cancelFn();
2429
- return (0, import_rxjs37.of)(cancelActionCreator);
2430
- }), (0, import_rxjs37.take)(1));
2457
+ return (0, import_rxjs38.of)(cancelActionCreator);
2458
+ }), (0, import_rxjs38.take)(1));
2431
2459
  }
2432
2460
  // src/epics/data/bcLoadMoreEpic.ts
2433
2461
  var bcLoadMoreEpic = function (action$, state$, _a) {
2434
2462
  var api = _a.api;
2435
- return action$.pipe((0, import_rxjs38.filter)(bcLoadMore.match), (0, import_rxjs38.mergeMap)(function (action) {
2463
+ return action$.pipe((0, import_rxjs39.filter)(bcLoadMore.match), (0, import_rxjs39.mergeMap)(function (action) {
2436
2464
  var _a, _b;
2437
2465
  var state = state$.value;
2438
2466
  var bcName = action.payload.bcName;
@@ -2446,28 +2474,28 @@ var bcLoadMoreEpic = function (action$, state$, _a) {
2446
2474
  var fetchParams = __assign(__assign({ _page: page, _limit: limit }, getFilters(filters)), getSorters(sorters));
2447
2475
  var canceler = api.createCanceler();
2448
2476
  var cancelFlow = cancelRequestEpic(action$, cancelRequestActionTypes, canceler.cancel, bcFetchDataFail({ bcName: bcName, bcUrl: bcUrl }));
2449
- var normalFlow = api.fetchBcData(state.screen.screenName, bcUrl, fetchParams, canceler.cancelToken).pipe((0, import_rxjs38.mergeMap)(function (data) {
2477
+ var normalFlow = api.fetchBcData(state.screen.screenName, bcUrl, fetchParams, canceler.cancelToken).pipe((0, import_rxjs39.mergeMap)(function (data) {
2450
2478
  var _a;
2451
2479
  var oldBcDataIds = (_a = state.data[bcName]) === null || _a === void 0 ? void 0 : _a.map(function (i) { return i.id; });
2452
2480
  var newData = __spreadArray(__spreadArray([], state.data[bcName], true), data.data.filter(function (i) { return !oldBcDataIds.includes(i.id); }), true);
2453
- return (0, import_rxjs38.of)(bcFetchDataSuccess({
2481
+ return (0, import_rxjs39.of)(bcFetchDataSuccess({
2454
2482
  bcName: bcName,
2455
2483
  data: newData,
2456
2484
  bcUrl: bcUrl,
2457
2485
  hasNext: data.hasNext
2458
2486
  }));
2459
- }), (0, import_rxjs38.catchError)(function (error) {
2487
+ }), (0, import_rxjs39.catchError)(function (error) {
2460
2488
  console.error(error);
2461
- return (0, import_rxjs38.of)(bcFetchDataFail({ bcName: bcName, bcUrl: bcUrl }));
2489
+ return (0, import_rxjs39.concat)((0, import_rxjs39.of)(bcFetchDataFail({ bcName: bcName, bcUrl: bcUrl })), createApiErrorObservable(error));
2462
2490
  }));
2463
- return (0, import_rxjs38.race)(cancelFlow, normalFlow);
2491
+ return (0, import_rxjs39.race)(cancelFlow, normalFlow);
2464
2492
  }));
2465
2493
  };
2466
2494
  // src/epics/data/bcSaveDataEpic.ts
2467
- var import_rxjs39 = require("rxjs");
2495
+ var import_rxjs40 = require("rxjs");
2468
2496
  var bcSaveDataEpic = function (action$, state$, _a) {
2469
2497
  var api = _a.api;
2470
- return action$.pipe((0, import_rxjs39.filter)(sendOperation.match), (0, import_rxjs39.filter)(function (action) { return matchOperationRole(import_schema5.OperationTypeCrud.save, action.payload, state$.value); }), (0, import_rxjs39.mergeMap)(function (action) {
2498
+ return action$.pipe((0, import_rxjs40.filter)(sendOperation.match), (0, import_rxjs40.filter)(function (action) { return matchOperationRole(import_schema5.OperationTypeCrud.save, action.payload, state$.value); }), (0, import_rxjs40.mergeMap)(function (action) {
2471
2499
  var _a, _b, _c, _d;
2472
2500
  var state = state$.value;
2473
2501
  var bcName = action.payload.bcName;
@@ -2494,22 +2522,22 @@ var bcSaveDataEpic = function (action$, state$, _a) {
2494
2522
  return bcFetchDataRequest({ bcName: childBcName, widgetName: widgetNames[0] });
2495
2523
  });
2496
2524
  var context = { widgetName: action.payload.widgetName };
2497
- return api.saveBcData(state.screen.screenName, bcUrl, __assign(__assign({}, pendingChanges), { vstamp: dataItem === null || dataItem === void 0 ? void 0 : dataItem.vstamp }), context).pipe((0, import_rxjs39.mergeMap)(function (data) {
2525
+ return api.saveBcData(state.screen.screenName, bcUrl, __assign(__assign({}, pendingChanges), { vstamp: dataItem === null || dataItem === void 0 ? void 0 : dataItem.vstamp }), context).pipe((0, import_rxjs40.mergeMap)(function (data) {
2498
2526
  var _a;
2499
2527
  var postInvoke = (_a = data.postActions) === null || _a === void 0 ? void 0 : _a[0];
2500
2528
  var responseDataItem = data.record;
2501
- return (0, import_rxjs39.concat)((0, import_rxjs39.of)(bcSaveDataSuccess({ bcName: bcName, cursor: cursor, dataItem: responseDataItem })), (0, import_rxjs39.of)(bcFetchRowMeta({ widgetName: widgetName, bcName: bcName })), (0, import_rxjs39.of).apply(void 0, fetchChildrenBcData), postInvoke ? (0, import_rxjs39.of)(processPostInvoke({
2529
+ return (0, import_rxjs40.concat)((0, import_rxjs40.of)(bcSaveDataSuccess({ bcName: bcName, cursor: cursor, dataItem: responseDataItem })), (0, import_rxjs40.of)(bcFetchRowMeta({ widgetName: widgetName, bcName: bcName })), (0, import_rxjs40.of).apply(void 0, fetchChildrenBcData), postInvoke ? (0, import_rxjs40.of)(processPostInvoke({
2502
2530
  bcName: bcName,
2503
2531
  widgetName: widgetName,
2504
2532
  postInvoke: postInvoke,
2505
2533
  cursor: responseDataItem.id
2506
- })) : import_rxjs39.EMPTY, action.payload.onSuccessAction ? (0, import_rxjs39.of)(action.payload.onSuccessAction) : import_rxjs39.EMPTY);
2507
- }), (0, import_rxjs39.catchError)(function (e) {
2534
+ })) : import_rxjs40.EMPTY, action.payload.onSuccessAction ? (0, import_rxjs40.of)(action.payload.onSuccessAction) : import_rxjs40.EMPTY);
2535
+ }), (0, import_rxjs40.catchError)(function (e) {
2508
2536
  var _a, _b, _c, _d, _e, _f, _g, _h;
2509
2537
  console.error(e);
2510
- var notification$ = import_rxjs39.EMPTY;
2538
+ var notification$ = import_rxjs40.EMPTY;
2511
2539
  if (action.payload.onSuccessAction && !(options === null || options === void 0 ? void 0 : options.disableNotification)) {
2512
- notification$ = (0, import_rxjs39.of)(addNotification({
2540
+ notification$ = (0, import_rxjs40.of)(addNotification({
2513
2541
  key: "data_autosave_undo",
2514
2542
  type: "buttonWarningNotification",
2515
2543
  message: "There are pending changes. Please save them or cancel.",
@@ -2529,13 +2557,13 @@ var bcSaveDataEpic = function (action$, state$, _a) {
2529
2557
  entityError = (_e = (_d = operationError === null || operationError === void 0 ? void 0 : operationError.error) === null || _d === void 0 ? void 0 : _d.entity) !== null && _e !== void 0 ? _e : entityError;
2530
2558
  viewError = (_h = (_g = (_f = operationError === null || operationError === void 0 ? void 0 : operationError.error) === null || _f === void 0 ? void 0 : _f.popup) === null || _g === void 0 ? void 0 : _g[0]) !== null && _h !== void 0 ? _h : viewError;
2531
2559
  }
2532
- return (0, import_rxjs39.concat)((0, import_rxjs39.of)(bcSaveDataFail({ bcName: bcName, bcUrl: bcUrl, viewError: viewError, entityError: entityError })), notification$);
2560
+ return (0, import_rxjs40.concat)((0, import_rxjs40.of)(bcSaveDataFail({ bcName: bcName, bcUrl: bcUrl, viewError: viewError, entityError: entityError })), notification$, createApiErrorObservable(e, context));
2533
2561
  }));
2534
2562
  }));
2535
2563
  };
2536
2564
  // src/epics/data/selectViewEpic.ts
2537
- var import_rxjs40 = require("rxjs");
2538
- var selectViewEpic = function (action$, state$) { return action$.pipe((0, import_rxjs40.filter)(selectView.match), (0, import_rxjs40.mergeMap)(function (action) {
2565
+ var import_rxjs41 = require("rxjs");
2566
+ var selectViewEpic = function (action$, state$) { return action$.pipe((0, import_rxjs41.filter)(selectView.match), (0, import_rxjs41.mergeMap)(function (action) {
2539
2567
  try {
2540
2568
  var state_1 = state$.value;
2541
2569
  var bcToLoad_1 = {};
@@ -2560,23 +2588,23 @@ var selectViewEpic = function (action$, state$) { return action$.pipe((0, import
2560
2588
  }
2561
2589
  catch (e) {
2562
2590
  console.error("selectView Epic:: ".concat(e));
2563
- return import_rxjs40.EMPTY;
2591
+ return import_rxjs41.EMPTY;
2564
2592
  }
2565
2593
  })); };
2566
2594
  // src/epics/data/bcFetchDataEpic.ts
2567
- var import_rxjs41 = require("rxjs");
2595
+ var import_rxjs42 = require("rxjs");
2568
2596
  var import_schema14 = require("@cxbox-ui/schema");
2569
2597
  var import_toolkit5 = require("@reduxjs/toolkit");
2570
2598
  var bcFetchDataEpic = function (action$, state$, _a) {
2571
2599
  var api = _a.api;
2572
- return action$.pipe((0, import_rxjs41.filter)((0, import_toolkit5.isAnyOf)(bcFetchDataRequest, bcFetchDataPages, showViewPopup, bcForceUpdate, bcChangePage)), (0, import_rxjs41.mergeMap)(function (action) {
2600
+ return action$.pipe((0, import_rxjs42.filter)((0, import_toolkit5.isAnyOf)(bcFetchDataRequest, bcFetchDataPages, showViewPopup, bcForceUpdate, bcChangePage)), (0, import_rxjs42.mergeMap)(function (action) {
2573
2601
  var getCursorChange = function (data, prevCursor, isHierarchy) {
2574
2602
  var _a;
2575
2603
  var _b;
2576
2604
  var bcName = action.payload.bcName;
2577
2605
  var keepDelta = bcFetchDataRequest.match(action) ? action.payload.keepDelta : void 0;
2578
2606
  var newCursor = (_b = data[0]) === null || _b === void 0 ? void 0 : _b.id;
2579
- return (0, import_rxjs41.of)(bcChangeCursors({
2607
+ return (0, import_rxjs42.of)(bcChangeCursors({
2580
2608
  cursorsMap: (_a = {},
2581
2609
  _a[bcName] = data.some(function (i) { return i.id === prevCursor; }) ? prevCursor : newCursor,
2582
2610
  _a),
@@ -2586,7 +2614,7 @@ var bcFetchDataEpic = function (action$, state$, _a) {
2586
2614
  var getChildrenData = function (widgets, bcDictionary, isHierarchy, showConditionCheck) {
2587
2615
  var bcName = action.payload.bcName;
2588
2616
  var _a = bcFetchDataRequest.match(action) ? action.payload : { ignorePageLimit: void 0, keepDelta: void 0 }, ignorePageLimit = _a.ignorePageLimit, keepDelta = _a.keepDelta;
2589
- return (0, import_rxjs41.concat).apply(void 0, Object.entries(getBcChildren(bcName, widgets, bcDictionary)).filter(function (_a) {
2617
+ return (0, import_rxjs42.concat).apply(void 0, Object.entries(getBcChildren(bcName, widgets, bcDictionary)).filter(function (_a) {
2590
2618
  var childBcName = _a[0], widgetNames = _a[1];
2591
2619
  var nonLazyWidget = widgets.find(function (item) {
2592
2620
  return widgetNames.includes(item.name) && !PopupWidgetTypes.includes(item.type) && showConditionCheck(item);
@@ -2601,7 +2629,7 @@ var bcFetchDataEpic = function (action$, state$, _a) {
2601
2629
  var nonLazyWidget = widgets.find(function (item) {
2602
2630
  return widgetNames.includes(item.name) && !PopupWidgetTypes.includes(item.type) && showConditionCheck(item);
2603
2631
  });
2604
- return (0, import_rxjs41.of)(bcFetchDataRequest({
2632
+ return (0, import_rxjs42.of)(bcFetchDataRequest({
2605
2633
  bcName: childBcName,
2606
2634
  widgetName: nonLazyWidget === null || nonLazyWidget === void 0 ? void 0 : nonLazyWidget.name,
2607
2635
  ignorePageLimit: ignorePageLimit || showViewPopup.match(action),
@@ -2616,7 +2644,7 @@ var bcFetchDataEpic = function (action$, state$, _a) {
2616
2644
  var _k = state.view, widgets = _k.widgets, infiniteWidgets = _k.infiniteWidgets;
2617
2645
  var widget = (_a = widgets === null || widgets === void 0 ? void 0 : widgets.find(function (item) { return item.name === widgetName; })) !== null && _a !== void 0 ? _a : widgets === null || widgets === void 0 ? void 0 : widgets.find(function (item) { return item.bcName === action.payload.bcName; });
2618
2646
  if (!widget) {
2619
- return [import_rxjs41.EMPTY];
2647
+ return [import_rxjs42.EMPTY];
2620
2648
  }
2621
2649
  var bcName = action.payload.bcName;
2622
2650
  var bc = state.screen.bo.bc[bcName];
@@ -2624,7 +2652,7 @@ var bcFetchDataEpic = function (action$, state$, _a) {
2624
2652
  var limit = (_c = (((_b = widgets === null || widgets === void 0 ? void 0 : widgets.find(function (i) { return i.bcName === bcName; })) === null || _b === void 0 ? void 0 : _b.limit) || bc.limit)) !== null && _c !== void 0 ? _c : 5;
2625
2653
  var sorters = state.screen.sorters[bcName];
2626
2654
  if (showViewPopup.match(action) && bcName === action.payload.calleeBCName) {
2627
- return [import_rxjs41.EMPTY];
2655
+ return [import_rxjs42.EMPTY];
2628
2656
  }
2629
2657
  var anyHierarchyWidget = widgets === null || widgets === void 0 ? void 0 : widgets.find(function (item) {
2630
2658
  return item.bcName === widget.bcName && item.type === import_schema14.WidgetTypes.AssocListPopup && isHierarchyWidget(item);
@@ -2656,7 +2684,7 @@ var bcFetchDataEpic = function (action$, state$, _a) {
2656
2684
  var actionBc = filteredAction.payload.bcName;
2657
2685
  return bc.parentName === actionBc;
2658
2686
  });
2659
- var normalFlow = api.fetchBcData(state.screen.screenName, bcUrl, fetchParams, canceler.cancelToken).pipe((0, import_rxjs41.mergeMap)(function (response) {
2687
+ var normalFlow = api.fetchBcData(state.screen.screenName, bcUrl, fetchParams, canceler.cancelToken).pipe((0, import_rxjs42.mergeMap)(function (response) {
2660
2688
  var _a, _b;
2661
2689
  var cursorChange = getCursorChange(response.data, cursor, !!anyHierarchyWidget);
2662
2690
  var parentOfNotLazyWidget = widgets === null || widgets === void 0 ? void 0 : widgets.some(function (item) {
@@ -2682,23 +2710,23 @@ var bcFetchDataEpic = function (action$, state$, _a) {
2682
2710
  var lazyWidget = (!isWidgetVisible(widget) || PopupWidgetTypes.includes(widget.type)) && !parentOfNotLazyWidget;
2683
2711
  var skipLazy = ((_a = state.view.popupData) === null || _a === void 0 ? void 0 : _a.bcName) !== widget.bcName;
2684
2712
  if (lazyWidget && skipLazy) {
2685
- return import_rxjs41.EMPTY;
2713
+ return import_rxjs42.EMPTY;
2686
2714
  }
2687
- var fetchChildren = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.length) ? getChildrenData(widgets, state.screen.bo.bc, !!anyHierarchyWidget, isWidgetVisible) : import_rxjs41.EMPTY;
2688
- var fetchRowMeta = (0, import_rxjs41.of)(bcFetchRowMeta({ widgetName: widgetName, bcName: bcName }));
2689
- return (0, import_rxjs41.concat)(cursorChange, (0, import_rxjs41.of)(bcFetchDataSuccess({
2715
+ var fetchChildren = ((_b = response.data) === null || _b === void 0 ? void 0 : _b.length) ? getChildrenData(widgets, state.screen.bo.bc, !!anyHierarchyWidget, isWidgetVisible) : import_rxjs42.EMPTY;
2716
+ var fetchRowMeta = (0, import_rxjs42.of)(bcFetchRowMeta({ widgetName: widgetName, bcName: bcName }));
2717
+ return (0, import_rxjs42.concat)(cursorChange, (0, import_rxjs42.of)(bcFetchDataSuccess({
2690
2718
  bcName: bcName,
2691
2719
  data: response.data,
2692
2720
  bcUrl: bcUrl,
2693
2721
  hasNext: response.hasNext
2694
2722
  })), fetchRowMeta, fetchChildren);
2695
- }), (0, import_rxjs41.catchError)(function (error) {
2723
+ }), (0, import_rxjs42.catchError)(function (error) {
2696
2724
  console.error(error);
2697
- return (0, import_rxjs41.of)(bcFetchDataFail({ bcName: action.payload.bcName, bcUrl: bcUrl }));
2725
+ return (0, import_rxjs42.concat)((0, import_rxjs42.of)(bcFetchDataFail({ bcName: action.payload.bcName, bcUrl: bcUrl })), createApiErrorObservable(error));
2698
2726
  }));
2699
2727
  return [cancelFlow, cancelByParentBc, normalFlow];
2700
2728
  };
2701
- return (0, import_rxjs41.race).apply(void 0, bcFetchDataImpl());
2729
+ return (0, import_rxjs42.race).apply(void 0, bcFetchDataImpl());
2702
2730
  }));
2703
2731
  };
2704
2732
  function isHierarchyWidget(widget) {
@@ -2706,11 +2734,11 @@ function isHierarchyWidget(widget) {
2706
2734
  return ((_a = widget.options) === null || _a === void 0 ? void 0 : _a.hierarchy) || ((_b = widget.options) === null || _b === void 0 ? void 0 : _b.hierarchyFull);
2707
2735
  }
2708
2736
  // src/epics/data/bcDeleteDataEpic.ts
2709
- var import_rxjs42 = require("rxjs");
2737
+ var import_rxjs43 = require("rxjs");
2710
2738
  var import_schema15 = require("@cxbox-ui/schema");
2711
2739
  var bcDeleteDataEpic = function (action$, store$, _a) {
2712
2740
  var api = _a.api;
2713
- return action$.pipe((0, import_rxjs42.filter)(sendOperation.match), (0, import_rxjs42.filter)(function (action) { return matchOperationRole(import_schema15.OperationTypeCrud.delete, action.payload, store$.value); }), (0, import_rxjs42.mergeMap)(function (action) {
2741
+ return action$.pipe((0, import_rxjs43.filter)(sendOperation.match), (0, import_rxjs43.filter)(function (action) { return matchOperationRole(import_schema15.OperationTypeCrud.delete, action.payload, store$.value); }), (0, import_rxjs43.mergeMap)(function (action) {
2714
2742
  var widgetName = action.payload.widgetName;
2715
2743
  var state = store$.value;
2716
2744
  var bcName = action.payload.bcName;
@@ -2718,19 +2746,19 @@ var bcDeleteDataEpic = function (action$, store$, _a) {
2718
2746
  var bcUrl = buildBcUrl(bcName, true, state);
2719
2747
  var context = { widgetName: action.payload.widgetName };
2720
2748
  var isTargetFormatPVF = state.view.pendingValidationFailsFormat === "target" /* target */;
2721
- return api.deleteBcData(state.screen.screenName, bcUrl, context).pipe((0, import_rxjs42.mergeMap)(function (data) {
2749
+ return api.deleteBcData(state.screen.screenName, bcUrl, context).pipe((0, import_rxjs43.mergeMap)(function (data) {
2722
2750
  var _a;
2723
2751
  var postInvoke = (_a = data.postActions) === null || _a === void 0 ? void 0 : _a[0];
2724
- return (0, import_rxjs42.concat)(isTargetFormatPVF ? (0, import_rxjs42.of)(bcCancelPendingChanges({ bcNames: [bcName] })) : import_rxjs42.EMPTY, (0, import_rxjs42.of)(bcFetchDataRequest({ bcName: bcName, widgetName: widgetName })), postInvoke ? (0, import_rxjs42.of)(processPostInvoke({ bcName: bcName, postInvoke: postInvoke, cursor: cursor, widgetName: widgetName })) : import_rxjs42.EMPTY);
2725
- }), (0, import_rxjs42.catchError)(function (error) {
2752
+ return (0, import_rxjs43.concat)(isTargetFormatPVF ? (0, import_rxjs43.of)(bcCancelPendingChanges({ bcNames: [bcName] })) : import_rxjs43.EMPTY, (0, import_rxjs43.of)(bcFetchDataRequest({ bcName: bcName, widgetName: widgetName })), postInvoke ? (0, import_rxjs43.of)(processPostInvoke({ bcName: bcName, postInvoke: postInvoke, cursor: cursor, widgetName: widgetName })) : import_rxjs43.EMPTY);
2753
+ }), (0, import_rxjs43.catchError)(function (error) {
2726
2754
  console.error(error);
2727
- return (0, import_rxjs42.of)(bcDeleteDataFail({ bcName: bcName }));
2755
+ return (0, import_rxjs43.concat)((0, import_rxjs43.of)(bcDeleteDataFail({ bcName: bcName })), createApiErrorObservable(error, context));
2728
2756
  }));
2729
2757
  }));
2730
2758
  };
2731
2759
  // src/epics/data/bcSelectRecordEpic.ts
2732
- var import_rxjs43 = require("rxjs");
2733
- var bcSelectRecordEpic = function (action$, store$) { return action$.pipe((0, import_rxjs43.filter)(bcSelectRecord.match), (0, import_rxjs43.mergeMap)(function (action) {
2760
+ var import_rxjs44 = require("rxjs");
2761
+ var bcSelectRecordEpic = function (action$, store$) { return action$.pipe((0, import_rxjs44.filter)(bcSelectRecord.match), (0, import_rxjs44.mergeMap)(function (action) {
2734
2762
  var _a;
2735
2763
  var _b = action.payload, bcName = _b.bcName, cursor = _b.cursor;
2736
2764
  var widgets = store$.value.view.widgets;
@@ -2744,17 +2772,17 @@ var bcSelectRecordEpic = function (action$, store$) { return action$.pipe((0, im
2744
2772
  keepDelta: action.payload.keepDelta
2745
2773
  });
2746
2774
  });
2747
- return (0, import_rxjs43.concat)((0, import_rxjs43.of)(bcChangeCursors({ cursorsMap: (_a = {}, _a[bcName] = cursor, _a), keepDelta: action.payload.keepDelta })), (0, import_rxjs43.of)(bcFetchRowMeta({ widgetName: "", bcName: bcName })), fetchChildrenBcData);
2775
+ return (0, import_rxjs44.concat)((0, import_rxjs44.of)(bcChangeCursors({ cursorsMap: (_a = {}, _a[bcName] = cursor, _a), keepDelta: action.payload.keepDelta })), (0, import_rxjs44.of)(bcFetchRowMeta({ widgetName: "", bcName: bcName })), fetchChildrenBcData);
2748
2776
  })); };
2749
2777
  // src/epics/data/changeAssociationEpic.ts
2750
- var import_rxjs44 = require("rxjs");
2751
- var changeAssociationEpic = function (action$, state$) { return action$.pipe((0, import_rxjs44.filter)(changeAssociation.match), (0, import_rxjs44.mergeMap)(function (action) {
2778
+ var import_rxjs45 = require("rxjs");
2779
+ var changeAssociationEpic = function (action$, state$) { return action$.pipe((0, import_rxjs45.filter)(changeAssociation.match), (0, import_rxjs45.mergeMap)(function (action) {
2752
2780
  var _a, _b, _c, _d, _e;
2753
2781
  var state = state$.value;
2754
2782
  var selected = action.payload.dataItem._associate;
2755
2783
  var bcName = action.payload.bcName;
2756
2784
  var result = [
2757
- (0, import_rxjs44.of)(changeDataItem({
2785
+ (0, import_rxjs45.of)(changeDataItem({
2758
2786
  bcName: bcName,
2759
2787
  bcUrl: buildBcUrl(bcName, true, state),
2760
2788
  cursor: action.payload.dataItem.id,
@@ -2774,7 +2802,7 @@ var changeAssociationEpic = function (action$, state$) { return action$.pipe((0,
2774
2802
  var hierarchyTraverse = (_d = widget.options) === null || _d === void 0 ? void 0 : _d.hierarchyTraverse;
2775
2803
  var childrenBc = hierarchy === null || hierarchy === void 0 ? void 0 : hierarchy.slice(hierarchy.findIndex(function (item) { return item.bcName === action.payload.bcName; }) + 1).map(function (item) { return item.bcName; });
2776
2804
  if (hierarchyGroupSelection && hierarchyDescriptor.radio && !selected) {
2777
- result.push((0, import_rxjs44.of)(dropAllAssociations({
2805
+ result.push((0, import_rxjs45.of)(dropAllAssociations({
2778
2806
  bcNames: childrenBc
2779
2807
  })));
2780
2808
  }
@@ -2785,11 +2813,11 @@ var changeAssociationEpic = function (action$, state$) { return action$.pipe((0,
2785
2813
  var parentItem = (_e = state.data[parent === null || parent === void 0 ? void 0 : parent.bcName]) === null || _e === void 0 ? void 0 : _e.find(function (item) { return item.id === state.screen.bo.bc[parent === null || parent === void 0 ? void 0 : parent.bcName].cursor; });
2786
2814
  if (parent && hierarchyTraverse && selected) {
2787
2815
  if (hierarchyDescriptor.radio) {
2788
- result.push((0, import_rxjs44.of)(dropAllAssociations({
2816
+ result.push((0, import_rxjs45.of)(dropAllAssociations({
2789
2817
  bcNames: [parent.bcName]
2790
2818
  })));
2791
2819
  }
2792
- result.push((0, import_rxjs44.of)(changeAssociation({
2820
+ result.push((0, import_rxjs45.of)(changeAssociation({
2793
2821
  bcName: parent.bcName,
2794
2822
  widgetName: action.payload.widgetName,
2795
2823
  dataItem: __assign(__assign({}, parentItem), { _associate: true, _value: parentItem === null || parentItem === void 0 ? void 0 : parentItem[parent.assocValueKey || action.payload.assocValueKey] }),
@@ -2806,7 +2834,7 @@ var changeAssociationEpic = function (action$, state$) { return action$.pipe((0,
2806
2834
  data_1.find(function (dataValue) { return dataValue.id === deltaValue.id; });
2807
2835
  });
2808
2836
  if (wasLastInData && wasLastInDelta) {
2809
- result.push((0, import_rxjs44.of)(changeAssociation({
2837
+ result.push((0, import_rxjs45.of)(changeAssociation({
2810
2838
  bcName: parent.bcName,
2811
2839
  widgetName: action.payload.widgetName,
2812
2840
  dataItem: __assign(__assign({}, parentItem), { _associate: false }),
@@ -2814,16 +2842,16 @@ var changeAssociationEpic = function (action$, state$) { return action$.pipe((0,
2814
2842
  })));
2815
2843
  }
2816
2844
  }
2817
- return (0, import_rxjs44.concat).apply(void 0, result);
2845
+ return (0, import_rxjs45.concat).apply(void 0, result);
2818
2846
  })); };
2819
2847
  // src/epics/data/bcCancelCreateDataEpic.ts
2820
- var import_rxjs45 = require("rxjs");
2848
+ var import_rxjs46 = require("rxjs");
2821
2849
  var import_schema16 = require("@cxbox-ui/schema");
2822
2850
  var import_toolkit6 = require("@reduxjs/toolkit");
2823
2851
  var actionTypesMatcher = (0, import_toolkit6.isAnyOf)(sendOperation);
2824
2852
  var bcCancelCreateDataEpic = function (action$, state$, _a) {
2825
2853
  var api = _a.api;
2826
- return action$.pipe((0, import_rxjs45.filter)(actionTypesMatcher), (0, import_rxjs45.filter)(function (action) { return matchOperationRole(import_schema16.OperationTypeCrud.cancelCreate, action.payload, state$.value); }), (0, import_rxjs45.mergeMap)(function (action) {
2854
+ return action$.pipe((0, import_rxjs46.filter)(actionTypesMatcher), (0, import_rxjs46.filter)(function (action) { return matchOperationRole(import_schema16.OperationTypeCrud.cancelCreate, action.payload, state$.value); }), (0, import_rxjs46.mergeMap)(function (action) {
2827
2855
  var _a;
2828
2856
  var _b, _c;
2829
2857
  var state = state$.value;
@@ -2838,21 +2866,21 @@ var bcCancelCreateDataEpic = function (action$, state$, _a) {
2838
2866
  var data = record && __assign(__assign({}, pendingRecordChange), { vstamp: record.vstamp });
2839
2867
  var params = { _action: action.payload.operationType };
2840
2868
  var cursorsMap = (_a = {}, _a[action.payload.bcName] = null, _a);
2841
- return api.customAction(screenName, bcUrl, data, context, params).pipe((0, import_rxjs45.mergeMap)(function (response) {
2869
+ return api.customAction(screenName, bcUrl, data, context, params).pipe((0, import_rxjs46.mergeMap)(function (response) {
2842
2870
  var _a;
2843
2871
  var postInvoke = (_a = response.postActions) === null || _a === void 0 ? void 0 : _a[0];
2844
- return (0, import_rxjs45.concat)((0, import_rxjs45.of)(sendOperationSuccess({ bcName: bcName, cursor: cursor })), (0, import_rxjs45.of)(bcChangeCursors({ cursorsMap: cursorsMap })), postInvoke ? (0, import_rxjs45.of)(processPostInvoke({ bcName: bcName, postInvoke: postInvoke, cursor: cursor, widgetName: context.widgetName })) : import_rxjs45.EMPTY);
2845
- }), (0, import_rxjs45.catchError)(function (error) {
2872
+ return (0, import_rxjs46.concat)((0, import_rxjs46.of)(sendOperationSuccess({ bcName: bcName, cursor: cursor })), (0, import_rxjs46.of)(bcChangeCursors({ cursorsMap: cursorsMap })), postInvoke ? (0, import_rxjs46.of)(processPostInvoke({ bcName: bcName, postInvoke: postInvoke, cursor: cursor, widgetName: context.widgetName })) : import_rxjs46.EMPTY);
2873
+ }), (0, import_rxjs46.catchError)(function (error) {
2846
2874
  console.error(error);
2847
- return (0, import_rxjs45.of)(bcDeleteDataFail({ bcName: bcName }));
2875
+ return (0, import_rxjs46.concat)((0, import_rxjs46.of)(bcDeleteDataFail({ bcName: bcName })), createApiErrorObservable(error, context));
2848
2876
  }));
2849
2877
  }));
2850
2878
  };
2851
2879
  // src/epics/data/bcSelectDepthRecordEpic.ts
2852
- var import_rxjs46 = require("rxjs");
2853
- var bcSelectDepthRecordEpic = function (action$) { return action$.pipe((0, import_rxjs46.filter)(bcSelectDepthRecord.match), (0, import_rxjs46.mergeMap)(function (action) {
2880
+ var import_rxjs47 = require("rxjs");
2881
+ var bcSelectDepthRecordEpic = function (action$) { return action$.pipe((0, import_rxjs47.filter)(bcSelectDepthRecord.match), (0, import_rxjs47.mergeMap)(function (action) {
2854
2882
  var _a = action.payload, bcName = _a.bcName, cursor = _a.cursor, depth = _a.depth;
2855
- return (0, import_rxjs46.concat)((0, import_rxjs46.of)(bcChangeDepthCursor({ bcName: bcName, depth: depth, cursor: cursor })), (0, import_rxjs46.of)(bcFetchDataRequest({
2883
+ return (0, import_rxjs47.concat)((0, import_rxjs47.of)(bcChangeDepthCursor({ bcName: bcName, depth: depth, cursor: cursor })), (0, import_rxjs47.of)(bcFetchDataRequest({
2856
2884
  bcName: bcName,
2857
2885
  depth: depth + 1,
2858
2886
  widgetName: "",
@@ -2860,8 +2888,8 @@ var bcSelectDepthRecordEpic = function (action$) { return action$.pipe((0, impor
2860
2888
  })));
2861
2889
  })); };
2862
2890
  // src/epics/data/removeMultivalueTagEpic.ts
2863
- var import_rxjs47 = require("rxjs");
2864
- var removeMultivalueTagEpic = function (action$, state$) { return action$.pipe((0, import_rxjs47.filter)(removeMultivalueTag.match), (0, import_rxjs47.mergeMap)(function (action) {
2891
+ var import_rxjs48 = require("rxjs");
2892
+ var removeMultivalueTagEpic = function (action$, state$) { return action$.pipe((0, import_rxjs48.filter)(removeMultivalueTag.match), (0, import_rxjs48.mergeMap)(function (action) {
2865
2893
  var _a, _b, _c;
2866
2894
  var _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
2867
2895
  var state = state$.value;
@@ -2897,7 +2925,7 @@ var removeMultivalueTagEpic = function (action$, state$) { return action$.pipe((
2897
2925
  return removedNodes.includes(descendant) || !associated.includes(descendant);
2898
2926
  });
2899
2927
  if (parentDeepEmpty) {
2900
- return (0, import_rxjs47.concat)((0, import_rxjs47.of)(removeMultivalueTag(__assign(__assign({}, action.payload), { removedItem: { id: parent_1.id, value: null } }))));
2928
+ return (0, import_rxjs48.concat)((0, import_rxjs48.of)(removeMultivalueTag(__assign(__assign({}, action.payload), { removedItem: { id: parent_1.id, value: null } }))));
2901
2929
  }
2902
2930
  }
2903
2931
  else {
@@ -2906,7 +2934,7 @@ var removeMultivalueTagEpic = function (action$, state$) { return action$.pipe((
2906
2934
  }
2907
2935
  }
2908
2936
  if ((_h = widget === null || widget === void 0 ? void 0 : widget.options) === null || _h === void 0 ? void 0 : _h.hierarchyFull) {
2909
- return (0, import_rxjs47.of)(changeDataItem({
2937
+ return (0, import_rxjs48.of)(changeDataItem({
2910
2938
  bcName: bcName,
2911
2939
  bcUrl: buildBcUrl(bcName, true, state),
2912
2940
  cursor: cursor,
@@ -2918,7 +2946,7 @@ var removeMultivalueTagEpic = function (action$, state$) { return action$.pipe((
2918
2946
  var _a;
2919
2947
  return (_a = state.view.pendingDataChanges[hierarchyData.bcName]) === null || _a === void 0 ? void 0 : _a[action.payload.removedItem.id];
2920
2948
  })) === null || _m === void 0 ? void 0 : _m.bcName) !== null && _o !== void 0 ? _o : bcName;
2921
- return (0, import_rxjs47.concat)((0, import_rxjs47.of)(changeDataItem({
2949
+ return (0, import_rxjs48.concat)((0, import_rxjs48.of)(changeDataItem({
2922
2950
  /**
2923
2951
  * This is incorrect and will break if different BC has records with
2924
2952
  * identical ids.
@@ -2929,19 +2957,19 @@ var removeMultivalueTagEpic = function (action$, state$) { return action$.pipe((
2929
2957
  bcUrl: buildBcUrl(hierarchyBcName, true, state),
2930
2958
  cursor: action.payload.removedItem.id,
2931
2959
  dataItem: __assign(__assign({}, action.payload.removedItem), { _associate: false })
2932
- })), (0, import_rxjs47.of)(changeDataItem({
2960
+ })), (0, import_rxjs48.of)(changeDataItem({
2933
2961
  bcName: bcName,
2934
2962
  bcUrl: buildBcUrl(bcName, true, state),
2935
2963
  cursor: cursor,
2936
2964
  dataItem: (_b = {}, _b[associateFieldKey] = action.payload.dataItem, _b)
2937
2965
  })));
2938
2966
  }
2939
- return (0, import_rxjs47.concat)((0, import_rxjs47.of)(changeDataItem({
2967
+ return (0, import_rxjs48.concat)((0, import_rxjs48.of)(changeDataItem({
2940
2968
  bcName: popupBcName,
2941
2969
  bcUrl: buildBcUrl(popupBcName, true, state),
2942
2970
  cursor: action.payload.removedItem.id,
2943
2971
  dataItem: __assign(__assign({}, action.payload.removedItem), { _associate: false })
2944
- })), (0, import_rxjs47.of)(changeDataItem({
2972
+ })), (0, import_rxjs48.of)(changeDataItem({
2945
2973
  bcName: bcName,
2946
2974
  bcUrl: buildBcUrl(bcName, true, state),
2947
2975
  cursor: cursor,
@@ -2949,10 +2977,10 @@ var removeMultivalueTagEpic = function (action$, state$) { return action$.pipe((
2949
2977
  })));
2950
2978
  })); };
2951
2979
  // src/epics/data/bcFetchRowMetaRequestEpic.ts
2952
- var import_rxjs48 = require("rxjs");
2980
+ var import_rxjs49 = require("rxjs");
2953
2981
  var bcFetchRowMetaRequestEpic = function (action$, state$, _a) {
2954
2982
  var api = _a.api;
2955
- return action$.pipe((0, import_rxjs48.filter)(bcFetchRowMeta.match), (0, import_rxjs48.mergeMap)(function (action) {
2983
+ return action$.pipe((0, import_rxjs49.filter)(bcFetchRowMeta.match), (0, import_rxjs49.mergeMap)(function (action) {
2956
2984
  var _a, _b;
2957
2985
  var state = state$.value;
2958
2986
  var screenName = state.screen.screenName;
@@ -2965,18 +2993,18 @@ var bcFetchRowMetaRequestEpic = function (action$, state$, _a) {
2965
2993
  var actionBc = filteredAction.payload.bcName;
2966
2994
  return state.screen.bo.bc[bcName].parentName === actionBc;
2967
2995
  });
2968
- var normalFlow = api.fetchRowMeta(screenName, bcUrl, void 0, canceler.cancelToken).pipe((0, import_rxjs48.map)(function (rowMeta) {
2996
+ var normalFlow = api.fetchRowMeta(screenName, bcUrl, void 0, canceler.cancelToken).pipe((0, import_rxjs49.map)(function (rowMeta) {
2969
2997
  return bcFetchRowMetaSuccess({ bcName: bcName, rowMeta: rowMeta, bcUrl: bcUrl, cursor: cursor });
2970
- }), (0, import_rxjs48.catchError)(function (error) {
2998
+ }), (0, import_rxjs49.catchError)(function (error) {
2971
2999
  console.error(error);
2972
- return (0, import_rxjs48.of)(bcFetchRowMetaFail({ bcName: bcName }));
3000
+ return (0, import_rxjs49.concat)((0, import_rxjs49.of)(bcFetchRowMetaFail({ bcName: bcName })), createApiErrorObservable(error));
2973
3001
  }));
2974
- return (0, import_rxjs48.race)(cancelFlow, cancelByParentBc, normalFlow);
3002
+ return (0, import_rxjs49.race)(cancelFlow, cancelByParentBc, normalFlow);
2975
3003
  }));
2976
3004
  };
2977
3005
  // src/epics/data/changeAssociationFullEpic.ts
2978
- var import_rxjs49 = require("rxjs");
2979
- var changeAssociationFullEpic = function (action$, state$) { return action$.pipe((0, import_rxjs49.filter)(changeAssociationFull.match), (0, import_rxjs49.mergeMap)(function (action) {
3006
+ var import_rxjs50 = require("rxjs");
3007
+ var changeAssociationFullEpic = function (action$, state$) { return action$.pipe((0, import_rxjs50.filter)(changeAssociationFull.match), (0, import_rxjs50.mergeMap)(function (action) {
2980
3008
  var _a, _b, _c, _d, _e;
2981
3009
  var state = state$.value;
2982
3010
  var result = [];
@@ -3005,7 +3033,7 @@ var changeAssociationFullEpic = function (action$, state$) { return action$.pipe
3005
3033
  return false;
3006
3034
  });
3007
3035
  if (prevSelected) {
3008
- result.push((0, import_rxjs49.of)(changeAssociationFull({
3036
+ result.push((0, import_rxjs50.of)(changeAssociationFull({
3009
3037
  bcName: bcName,
3010
3038
  depth: depth,
3011
3039
  widgetName: action.payload.widgetName,
@@ -3015,7 +3043,7 @@ var changeAssociationFullEpic = function (action$, state$) { return action$.pipe
3015
3043
  }
3016
3044
  }
3017
3045
  else {
3018
- result.push((0, import_rxjs49.of)(changeDescendantsAssociationsFull({
3046
+ result.push((0, import_rxjs50.of)(changeDescendantsAssociationsFull({
3019
3047
  bcName: bcName,
3020
3048
  parentId: action.payload.dataItem.id,
3021
3049
  depth: depth + 1,
@@ -3024,14 +3052,14 @@ var changeAssociationFullEpic = function (action$, state$) { return action$.pipe
3024
3052
  })));
3025
3053
  }
3026
3054
  }
3027
- result.push((0, import_rxjs49.of)(changeDataItem({
3055
+ result.push((0, import_rxjs50.of)(changeDataItem({
3028
3056
  bcName: action.payload.bcName,
3029
3057
  bcUrl: buildBcUrl(action.payload.bcName, true, state),
3030
3058
  cursor: action.payload.dataItem.id,
3031
3059
  dataItem: action.payload.dataItem
3032
3060
  })));
3033
3061
  if (parentDepth && hierarchyTraverse && selected) {
3034
- result.push((0, import_rxjs49.of)(changeAssociationFull({
3062
+ result.push((0, import_rxjs50.of)(changeAssociationFull({
3035
3063
  bcName: bcName,
3036
3064
  depth: parentDepth,
3037
3065
  widgetName: action.payload.widgetName,
@@ -3047,7 +3075,7 @@ var changeAssociationFullEpic = function (action$, state$) { return action$.pipe
3047
3075
  var deltaFalseId_1 = delta && ((_e = Object.values(delta)) === null || _e === void 0 ? void 0 : _e.filter(function (item) { return item._associate === false; }).map(function (item) { return item.id; }));
3048
3076
  var wasLastInData = currentLevelData.filter(function (item) { return item.id !== action.payload.dataItem.id && !(deltaFalseId_1 === null || deltaFalseId_1 === void 0 ? void 0 : deltaFalseId_1.includes(item.id)); }).every(function (item) { return !item._associate; });
3049
3077
  if (wasLastInData && wasLastInDelta) {
3050
- result.push((0, import_rxjs49.of)(changeAssociationFull({
3078
+ result.push((0, import_rxjs50.of)(changeAssociationFull({
3051
3079
  bcName: bcName,
3052
3080
  depth: parentDepth,
3053
3081
  widgetName: action.payload.widgetName,
@@ -3056,16 +3084,16 @@ var changeAssociationFullEpic = function (action$, state$) { return action$.pipe
3056
3084
  })));
3057
3085
  }
3058
3086
  }
3059
- return (0, import_rxjs49.concat).apply(void 0, result);
3087
+ return (0, import_rxjs50.concat).apply(void 0, result);
3060
3088
  })); };
3061
3089
  // src/epics/data/saveAssociationsActiveEpic.ts
3062
- var import_rxjs50 = require("rxjs");
3090
+ var import_rxjs51 = require("rxjs");
3063
3091
  var saveAssociationsActiveEpic = function (action$, state$, _a) {
3064
3092
  var api = _a.api;
3065
- return action$.pipe((0, import_rxjs50.filter)(saveAssociations.match), (0, import_rxjs50.filter)(function (action) {
3093
+ return action$.pipe((0, import_rxjs51.filter)(saveAssociations.match), (0, import_rxjs51.filter)(function (action) {
3066
3094
  var _a;
3067
3095
  return (_a = state$.value.view.popupData) === null || _a === void 0 ? void 0 : _a.active;
3068
- }), (0, import_rxjs50.switchMap)(function (action) {
3096
+ }), (0, import_rxjs51.switchMap)(function (action) {
3069
3097
  var _a, _b;
3070
3098
  var state = state$.value;
3071
3099
  var calleeBCName = (_a = state.view.popupData) === null || _a === void 0 ? void 0 : _a.calleeBCName;
@@ -3074,24 +3102,24 @@ var saveAssociationsActiveEpic = function (action$, state$, _a) {
3074
3102
  var bcUrl = buildBcUrl(calleeBCName, true, state);
3075
3103
  var pendingChanges = state.view.pendingDataChanges[bcNames[0]] || {};
3076
3104
  var params = bcNames.length ? { _bcName: bcNames[bcNames.length - 1] } : {};
3077
- return api.associate(state.screen.screenName, bcUrl, Object.values(pendingChanges).filter(function (i) { return i._associate; }), params).pipe((0, import_rxjs50.mergeMap)(function (response) {
3105
+ return api.associate(state.screen.screenName, bcUrl, Object.values(pendingChanges).filter(function (i) { return i._associate; }), params).pipe((0, import_rxjs51.mergeMap)(function (response) {
3078
3106
  var postInvoke = response.postActions[0];
3079
3107
  var calleeWidget = state.view.widgets.find(function (widgetItem) { return widgetItem.bcName === calleeBCName; });
3080
- return (0, import_rxjs50.concat)(postInvoke ? (0, import_rxjs50.of)(processPostInvoke({ bcName: calleeBCName, postInvoke: postInvoke, widgetName: calleeWidget === null || calleeWidget === void 0 ? void 0 : calleeWidget.name })) : import_rxjs50.EMPTY, (0, import_rxjs50.of)(bcCancelPendingChanges({ bcNames: bcNames })), (0, import_rxjs50.of)(bcForceUpdate({ bcName: calleeBCName, widgetName: calleeWidgetName })));
3081
- }), (0, import_rxjs50.catchError)(function (err) {
3108
+ return (0, import_rxjs51.concat)(postInvoke ? (0, import_rxjs51.of)(processPostInvoke({ bcName: calleeBCName, postInvoke: postInvoke, widgetName: calleeWidget === null || calleeWidget === void 0 ? void 0 : calleeWidget.name })) : import_rxjs51.EMPTY, (0, import_rxjs51.of)(bcCancelPendingChanges({ bcNames: bcNames })), (0, import_rxjs51.of)(bcForceUpdate({ bcName: calleeBCName, widgetName: calleeWidgetName })));
3109
+ }), (0, import_rxjs51.catchError)(function (err) {
3082
3110
  console.error(err);
3083
- return import_rxjs50.EMPTY;
3111
+ return import_rxjs51.EMPTY;
3084
3112
  }));
3085
3113
  }));
3086
3114
  };
3087
3115
  // src/epics/data/changeAssociationSameBcEpic.ts
3088
- var import_rxjs51 = require("rxjs");
3089
- var changeAssociationSameBcEpic = function (action$, state$) { return action$.pipe((0, import_rxjs51.filter)(changeAssociationSameBc.match), (0, import_rxjs51.mergeMap)(function (action) {
3116
+ var import_rxjs52 = require("rxjs");
3117
+ var changeAssociationSameBcEpic = function (action$, state$) { return action$.pipe((0, import_rxjs52.filter)(changeAssociationSameBc.match), (0, import_rxjs52.mergeMap)(function (action) {
3090
3118
  var _a, _b, _c, _d, _e, _f;
3091
3119
  var state = state$.value;
3092
3120
  var bcName = action.payload.bcName;
3093
3121
  var result = [
3094
- (0, import_rxjs51.of)(changeDataItem({
3122
+ (0, import_rxjs52.of)(changeDataItem({
3095
3123
  bcName: bcName,
3096
3124
  bcUrl: buildBcUrl(bcName, true, state),
3097
3125
  cursor: action.payload.dataItem.id,
@@ -3107,7 +3135,7 @@ var changeAssociationSameBcEpic = function (action$, state$) { return action$.pi
3107
3135
  var parentCursor = parentDepth ? parentDepth > 1 ? (_d = (_c = state.screen.bo.bc[bcName].depthBc) === null || _c === void 0 ? void 0 : _c[parentDepth]) === null || _d === void 0 ? void 0 : _d.cursor : state.screen.bo.bc[bcName].cursor : null;
3108
3136
  var parentItem = parentCursor ? parentDepth > 1 ? (_f = (_e = state.depthData[parentDepth]) === null || _e === void 0 ? void 0 : _e[bcName]) === null || _f === void 0 ? void 0 : _f.find(function (item) { return item.id === parentCursor; }) : state.data[bcName].find(function (item) { return item.id === parentCursor; }) : null;
3109
3137
  if (parentDepth && hierarchyTraverse && selected) {
3110
- result.push((0, import_rxjs51.of)(changeAssociationSameBc({
3138
+ result.push((0, import_rxjs52.of)(changeAssociationSameBc({
3111
3139
  bcName: bcName,
3112
3140
  depth: parentDepth,
3113
3141
  widgetName: action.payload.widgetName,
@@ -3118,7 +3146,7 @@ var changeAssociationSameBcEpic = function (action$, state$) { return action$.pi
3118
3146
  if (parentDepth && hierarchyTraverse && !selected) {
3119
3147
  var wasLastInData = currentData.filter(function (item) { return item.id !== action.payload.dataItem.id; }).every(function (item) { return !item._associate; });
3120
3148
  if (wasLastInData) {
3121
- result.push((0, import_rxjs51.of)(changeAssociationSameBc({
3149
+ result.push((0, import_rxjs52.of)(changeAssociationSameBc({
3122
3150
  bcName: bcName,
3123
3151
  depth: parentDepth,
3124
3152
  widgetName: action.payload.widgetName,
@@ -3127,34 +3155,34 @@ var changeAssociationSameBcEpic = function (action$, state$) { return action$.pi
3127
3155
  })));
3128
3156
  }
3129
3157
  }
3130
- return (0, import_rxjs51.concat).apply(void 0, result);
3158
+ return (0, import_rxjs52.concat).apply(void 0, result);
3131
3159
  })); };
3132
3160
  // src/epics/data/inlinePickListFetchDataEpic.ts
3133
- var import_rxjs52 = require("rxjs");
3161
+ var import_rxjs53 = require("rxjs");
3134
3162
  var inlinePickListFetchDataEpic = function (action$, state$, _a) {
3135
3163
  var api = _a.api;
3136
- return action$.pipe((0, import_rxjs52.filter)(inlinePickListFetchDataRequest.match), (0, import_rxjs52.mergeMap)(function (action) {
3164
+ return action$.pipe((0, import_rxjs53.filter)(inlinePickListFetchDataRequest.match), (0, import_rxjs53.mergeMap)(function (action) {
3137
3165
  var _a;
3138
3166
  var _b = action.payload, bcName = _b.bcName, searchSpec = _b.searchSpec, searchString = _b.searchString;
3139
3167
  var state = state$.value;
3140
3168
  var bcUrl = buildBcUrl(bcName, false, state);
3141
3169
  var canceler = api.createCanceler();
3142
3170
  var cancelFlow = cancelRequestEpic(action$, cancelRequestActionTypes, canceler.cancel, bcFetchDataFail({ bcName: bcName, bcUrl: bcUrl }));
3143
- var normalFlow = api.fetchBcData(state$.value.screen.screenName, bcUrl, (_a = {}, _a[searchSpec + ".contains"] = searchString, _a), canceler.cancelToken).pipe((0, import_rxjs52.mergeMap)(function (data) {
3144
- return (0, import_rxjs52.of)(bcFetchDataSuccess({ bcName: bcName, data: data.data, bcUrl: bcUrl }));
3145
- }), (0, import_rxjs52.catchError)(function (error) {
3171
+ var normalFlow = api.fetchBcData(state$.value.screen.screenName, bcUrl, (_a = {}, _a[searchSpec + ".contains"] = searchString, _a), canceler.cancelToken).pipe((0, import_rxjs53.mergeMap)(function (data) {
3172
+ return (0, import_rxjs53.of)(bcFetchDataSuccess({ bcName: bcName, data: data.data, bcUrl: bcUrl }));
3173
+ }), (0, import_rxjs53.catchError)(function (error) {
3146
3174
  console.error(error);
3147
- return (0, import_rxjs52.of)(bcFetchDataFail({ bcName: action.payload.bcName, bcUrl: bcUrl }));
3175
+ return (0, import_rxjs53.of)(bcFetchDataFail({ bcName: action.payload.bcName, bcUrl: bcUrl }));
3148
3176
  }));
3149
- return (0, import_rxjs52.race)(cancelFlow, normalFlow);
3177
+ return (0, import_rxjs53.race)(cancelFlow, normalFlow);
3150
3178
  }));
3151
3179
  };
3152
3180
  // src/epics/data/saveAssociationsPassiveEpic.ts
3153
- var import_rxjs53 = require("rxjs");
3154
- var saveAssociationsPassiveEpic = function (action$, state$) { return action$.pipe((0, import_rxjs53.filter)(saveAssociations.match), (0, import_rxjs53.filter)(function () {
3181
+ var import_rxjs54 = require("rxjs");
3182
+ var saveAssociationsPassiveEpic = function (action$, state$) { return action$.pipe((0, import_rxjs54.filter)(saveAssociations.match), (0, import_rxjs54.filter)(function () {
3155
3183
  var _a;
3156
3184
  return !((_a = state$.value.view.popupData) === null || _a === void 0 ? void 0 : _a.active);
3157
- }), (0, import_rxjs53.switchMap)(function (action) {
3185
+ }), (0, import_rxjs54.switchMap)(function (action) {
3158
3186
  var _a, _b;
3159
3187
  var _c, _d;
3160
3188
  var state = state$.value;
@@ -3184,7 +3212,7 @@ var saveAssociationsPassiveEpic = function (action$, state$) { return action$.pi
3184
3212
  }
3185
3213
  return true;
3186
3214
  })).concat.apply(_a, addedItems);
3187
- return (0, import_rxjs53.of)(changeDataItem({
3215
+ return (0, import_rxjs54.of)(changeDataItem({
3188
3216
  bcName: calleeBCName,
3189
3217
  bcUrl: buildBcUrl(calleeBCName, true, state),
3190
3218
  cursor: cursor,
@@ -3194,13 +3222,13 @@ var saveAssociationsPassiveEpic = function (action$, state$) { return action$.pi
3194
3222
  }));
3195
3223
  })); };
3196
3224
  // src/epics/data/changeChildrenAssociationsEpic.ts
3197
- var import_rxjs54 = require("rxjs");
3225
+ var import_rxjs55 = require("rxjs");
3198
3226
  var changeChildrenAssociationsEpic = function (action$, state$, _a) {
3199
3227
  var api = _a.api;
3200
- return action$.pipe((0, import_rxjs54.filter)(changeChildrenAssociations.match), (0, import_rxjs54.mergeMap)(function (action) {
3228
+ return action$.pipe((0, import_rxjs55.filter)(changeChildrenAssociations.match), (0, import_rxjs55.mergeMap)(function (action) {
3201
3229
  var state = state$.value;
3202
3230
  var data = state.data[action.payload.bcName];
3203
- return (0, import_rxjs54.of)(changeDataItems({
3231
+ return (0, import_rxjs55.of)(changeDataItems({
3204
3232
  bcName: action.payload.bcName,
3205
3233
  cursors: data.map(function (item) { return item.id; }),
3206
3234
  dataItems: data.map(function (item) { return (__assign(__assign({}, item), { _value: item[action.payload.assocValueKey], _associate: action.payload.selected })); })
@@ -3208,26 +3236,26 @@ var changeChildrenAssociationsEpic = function (action$, state$, _a) {
3208
3236
  }));
3209
3237
  };
3210
3238
  // src/epics/data/changeChildrenAssociationsSameBcEpic.ts
3211
- var import_rxjs55 = require("rxjs");
3212
- var changeChildrenAssociationsSameBcEpic = function (action$, state$) { return action$.pipe((0, import_rxjs55.filter)(changeChildrenAssociationsSameBc.match), (0, import_rxjs55.mergeMap)(function (action) {
3239
+ var import_rxjs56 = require("rxjs");
3240
+ var changeChildrenAssociationsSameBcEpic = function (action$, state$) { return action$.pipe((0, import_rxjs56.filter)(changeChildrenAssociationsSameBc.match), (0, import_rxjs56.mergeMap)(function (action) {
3213
3241
  var _a;
3214
3242
  var state = state$.value;
3215
3243
  var data = ((_a = state.depthData[action.payload.depth]) === null || _a === void 0 ? void 0 : _a[action.payload.bcName]) || [];
3216
- return (0, import_rxjs55.of)(changeDataItems({
3244
+ return (0, import_rxjs56.of)(changeDataItems({
3217
3245
  bcName: action.payload.bcName,
3218
3246
  cursors: data.map(function (item) { return item.id; }),
3219
3247
  dataItems: data.map(function (item) { return (__assign(__assign({}, item), { _value: item[action.payload.assocValueKey], _associate: action.payload.selected })); })
3220
3248
  }));
3221
3249
  })); };
3222
3250
  // src/epics/data/changeDescendantsAssociationsFullEpic.ts
3223
- var import_rxjs56 = require("rxjs");
3224
- var changeDescendantsAssociationsFullEpic = function (action$, state$) { return action$.pipe((0, import_rxjs56.filter)(changeDescendantsAssociationsFull.match), (0, import_rxjs56.mergeMap)(function (action) {
3251
+ var import_rxjs57 = require("rxjs");
3252
+ var changeDescendantsAssociationsFullEpic = function (action$, state$) { return action$.pipe((0, import_rxjs57.filter)(changeDescendantsAssociationsFull.match), (0, import_rxjs57.mergeMap)(function (action) {
3225
3253
  var state = state$.value;
3226
3254
  var depth = action.payload.depth;
3227
3255
  var data = state.data[action.payload.bcName];
3228
3256
  var targetData = (data || []).filter(function (item) { return item.level === depth && item.parentId === action.payload.parentId; });
3229
3257
  var result = [
3230
- (0, import_rxjs56.of)(changeDataItems({
3258
+ (0, import_rxjs57.of)(changeDataItems({
3231
3259
  bcName: action.payload.bcName,
3232
3260
  cursors: targetData.map(function (item) { return item.id; }),
3233
3261
  dataItems: targetData.map(function (item) { return (__assign(__assign({}, item), { _value: item[action.payload.assocValueKey], _associate: action.payload.selected })); })
@@ -3235,14 +3263,14 @@ var changeDescendantsAssociationsFullEpic = function (action$, state$) { return
3235
3263
  ];
3236
3264
  targetData.forEach(function (targetDataItem) {
3237
3265
  if (data.find(function (dataItem) { return dataItem.parentId === targetDataItem.id; })) {
3238
- result.push((0, import_rxjs56.of)(changeDescendantsAssociationsFull(__assign(__assign({}, action.payload), { parentId: targetDataItem.id, depth: depth + 1 }))));
3266
+ result.push((0, import_rxjs57.of)(changeDescendantsAssociationsFull(__assign(__assign({}, action.payload), { parentId: targetDataItem.id, depth: depth + 1 }))));
3239
3267
  }
3240
3268
  });
3241
- return (0, import_rxjs56.concat).apply(void 0, result);
3269
+ return (0, import_rxjs57.concat).apply(void 0, result);
3242
3270
  })); };
3243
3271
  // src/api/ObservableApiWrapper.ts
3244
3272
  var import_axios2 = __toESM(require("axios"));
3245
- var import_rxjs57 = require("rxjs");
3273
+ var import_rxjs58 = require("rxjs");
3246
3274
  function redirectOccurred(value) {
3247
3275
  var _a;
3248
3276
  if ((_a = value.data) === null || _a === void 0 ? void 0 : _a.redirectUrl) {
@@ -3267,22 +3295,22 @@ var ObservableApiWrapper = /** @class */ (function () {
3267
3295
  this.instance = instance;
3268
3296
  }
3269
3297
  class_2.prototype.get = function (path, config, callContext) {
3270
- return (0, import_rxjs57.from)(this.instance.get(path, config)).pipe((0, import_rxjs57.takeWhile)(redirectOccurred), (0, import_rxjs57.map)(function (response) { return response.data; }));
3298
+ return (0, import_rxjs58.from)(this.instance.get(path, config)).pipe((0, import_rxjs58.takeWhile)(redirectOccurred), (0, import_rxjs58.map)(function (response) { return response.data; }));
3271
3299
  };
3272
3300
  class_2.prototype.put = function (path, data, callContext) {
3273
- return (0, import_rxjs57.from)(this.instance.put(path, data)).pipe((0, import_rxjs57.takeWhile)(redirectOccurred), (0, import_rxjs57.map)(function (response) { return response.data; }));
3301
+ return (0, import_rxjs58.from)(this.instance.put(path, data)).pipe((0, import_rxjs58.takeWhile)(redirectOccurred), (0, import_rxjs58.map)(function (response) { return response.data; }));
3274
3302
  };
3275
3303
  class_2.prototype.post = function (path, data, config, callContext) {
3276
- return (0, import_rxjs57.from)(this.instance.post(path, data)).pipe((0, import_rxjs57.takeWhile)(redirectOccurred), (0, import_rxjs57.map)(function (response) { return response.data; }));
3304
+ return (0, import_rxjs58.from)(this.instance.post(path, data)).pipe((0, import_rxjs58.takeWhile)(redirectOccurred), (0, import_rxjs58.map)(function (response) { return response.data; }));
3277
3305
  };
3278
3306
  class_2.prototype.delete = function (path, data, config, callContext) {
3279
- return (0, import_rxjs57.from)(this.instance.delete(path, data)).pipe((0, import_rxjs57.takeWhile)(redirectOccurred), (0, import_rxjs57.map)(function (response) { return response.data; }));
3307
+ return (0, import_rxjs58.from)(this.instance.delete(path, data)).pipe((0, import_rxjs58.takeWhile)(redirectOccurred), (0, import_rxjs58.map)(function (response) { return response.data; }));
3280
3308
  };
3281
3309
  return class_2;
3282
3310
  }());
3283
3311
  // src/api/ObservableApi.ts
3284
3312
  var import_axios3 = __toESM(require("axios"));
3285
- var import_rxjs58 = require("rxjs");
3313
+ var import_rxjs59 = require("rxjs");
3286
3314
  var Api = /** @class */ (function () {
3287
3315
  function class_3(instance) {
3288
3316
  this.api$ = new ObservableApiWrapper(instance);
@@ -3301,32 +3329,32 @@ var Api = /** @class */ (function () {
3301
3329
  var _this = this;
3302
3330
  if (params === void 0) { params = {}; }
3303
3331
  var currentPage = 1;
3304
- return this.fetchBcData(screenName, bcUrl, __assign(__assign({}, params), { _page: currentPage })).pipe((0, import_rxjs58.expand)(function (response) {
3305
- return response.hasNext ? _this.fetchBcData(screenName, bcUrl, __assign(__assign({}, params), { _page: ++currentPage })) : import_rxjs58.EMPTY;
3306
- }), (0, import_rxjs58.reduce)(function (items, nextResponse) {
3332
+ return this.fetchBcData(screenName, bcUrl, __assign(__assign({}, params), { _page: currentPage })).pipe((0, import_rxjs59.expand)(function (response) {
3333
+ return response.hasNext ? _this.fetchBcData(screenName, bcUrl, __assign(__assign({}, params), { _page: ++currentPage })) : import_rxjs59.EMPTY;
3334
+ }), (0, import_rxjs59.reduce)(function (items, nextResponse) {
3307
3335
  return __spreadArray(__spreadArray([], items, true), nextResponse.data, true);
3308
3336
  }, []));
3309
3337
  };
3310
3338
  class_3.prototype.fetchRowMeta = function (screenName, bcUrl, params, cancelToken) {
3311
3339
  var url = applyParams(buildUrl(__makeTemplateObject(["row-meta/", "/"], ["row-meta/", "/"]), screenName) + bcUrl, params);
3312
- return this.api$.get(url, { cancelToken: cancelToken }).pipe((0, import_rxjs58.map)(function (response) { var _a; return (_a = response.data) === null || _a === void 0 ? void 0 : _a.row; }));
3340
+ return this.api$.get(url, { cancelToken: cancelToken }).pipe((0, import_rxjs59.map)(function (response) { var _a; return (_a = response.data) === null || _a === void 0 ? void 0 : _a.row; }));
3313
3341
  };
3314
3342
  class_3.prototype.newBcData = function (screenName, bcUrl, context, params) {
3315
3343
  var url = applyParams(buildUrl(__makeTemplateObject(["row-meta-new/", "/"], ["row-meta-new/", "/"]), screenName) + bcUrl, params);
3316
- return this.api$.get(url, void 0, context).pipe((0, import_rxjs58.map)(function (response) { return response.data; }));
3344
+ return this.api$.get(url, void 0, context).pipe((0, import_rxjs59.map)(function (response) { return response.data; }));
3317
3345
  };
3318
3346
  class_3.prototype.saveBcData = function (screenName, bcUrl, data, context, params) {
3319
3347
  var url = applyParams(buildUrl(__makeTemplateObject(["data/", "/"], ["data/", "/"]), screenName) + bcUrl, params);
3320
- return this.api$.put(url, { data: data }, context).pipe((0, import_rxjs58.map)(function (response) { return response.data; }));
3348
+ return this.api$.put(url, { data: data }, context).pipe((0, import_rxjs59.map)(function (response) { return response.data; }));
3321
3349
  };
3322
3350
  class_3.prototype.deleteBcData = function (screenName, bcUrl, context, params) {
3323
3351
  if (bcUrl === void 0) { bcUrl = ""; }
3324
3352
  var url = applyParams(buildUrl(__makeTemplateObject(["data/", "/"], ["data/", "/"]), screenName) + bcUrl, params);
3325
- return this.api$.delete(url, context).pipe((0, import_rxjs58.map)(function (response) { return response.data; }));
3353
+ return this.api$.delete(url, context).pipe((0, import_rxjs59.map)(function (response) { return response.data; }));
3326
3354
  };
3327
3355
  class_3.prototype.customAction = function (screenName, bcUrl, data, context, params) {
3328
3356
  var url = applyParams(buildUrl(__makeTemplateObject(["custom-action/", "/"], ["custom-action/", "/"]), screenName) + bcUrl, params);
3329
- return this.api$.post(url, { data: data || {} }, void 0, context).pipe((0, import_rxjs58.map)(function (response) { return response.data; }));
3357
+ return this.api$.post(url, { data: data || {} }, void 0, context).pipe((0, import_rxjs59.map)(function (response) { return response.data; }));
3330
3358
  };
3331
3359
  class_3.prototype.associate = function (screenName, bcUrl, data, params) {
3332
3360
  var processedData = Array.isArray(data) ? data.map(function (item) { return ({
@@ -3335,11 +3363,11 @@ var Api = /** @class */ (function () {
3335
3363
  associated: item._associate
3336
3364
  }); }) : data;
3337
3365
  var url = applyParams(buildUrl(__makeTemplateObject(["associate/", "/"], ["associate/", "/"]), screenName) + bcUrl, params);
3338
- return this.api$.post(url, processedData).pipe((0, import_rxjs58.map)(function (response) { return response.data; }));
3366
+ return this.api$.post(url, processedData).pipe((0, import_rxjs59.map)(function (response) { return response.data; }));
3339
3367
  };
3340
3368
  class_3.prototype.getRmByForceActive = function (screenName, bcUrl, data, params) {
3341
3369
  var url = applyParams(buildUrl(__makeTemplateObject(["row-meta/", "/"], ["row-meta/", "/"]), screenName) + (bcUrl !== null && bcUrl !== void 0 ? bcUrl : ""), params);
3342
- return this.api$.post(url, { data: data }).pipe((0, import_rxjs58.map)(function (response) { return response.data.row; }));
3370
+ return this.api$.post(url, { data: data }).pipe((0, import_rxjs59.map)(function (response) { return response.data.row; }));
3343
3371
  };
3344
3372
  Object.defineProperty(class_3.prototype, "fileUploadEndpoint", {
3345
3373
  /**
@@ -3518,13 +3546,13 @@ var requiredFields = function (_a) {
3518
3546
  return next(action);
3519
3547
  }; };
3520
3548
  };
3521
- function operationRequiresAutosave(operationType, actions) {
3549
+ function operationRequiresAutosave(operationType, actions2) {
3522
3550
  var result = false;
3523
- if (!actions) {
3551
+ if (!actions2) {
3524
3552
  console.error('rowMeta is missing in the middle of "sendOperation" action');
3525
3553
  return result;
3526
3554
  }
3527
- result = flattenOperations(actions).some(function (action) { return action.type === operationType && action.autoSaveBefore; });
3555
+ result = flattenOperations(actions2).some(function (action) { return action.type === operationType && action.autoSaveBefore; });
3528
3556
  return result;
3529
3557
  }
3530
3558
  function getRequiredFieldsMissing(record, pendingChanges, fieldsMeta) {
@@ -3580,8 +3608,8 @@ var preInvokeAction = function (_a) {
3580
3608
  var bcName = (_a = state.view.widgets.find(function (widgetItem) { return widgetItem.name === widgetName_2; })) === null || _a === void 0 ? void 0 : _a.bcName;
3581
3609
  var bcUrl = buildBcUrl(bcName, true, state);
3582
3610
  var rowMeta = bcUrl && ((_b = state.view.rowMeta[bcName]) === null || _b === void 0 ? void 0 : _b[bcUrl]);
3583
- var actions = rowMeta && flattenOperations(rowMeta.actions);
3584
- var preInvoke = (_c = actions === null || actions === void 0 ? void 0 : actions.find(function (item) { return item.type === operationType_1; })) === null || _c === void 0 ? void 0 : _c.preInvoke;
3611
+ var actions2 = rowMeta && flattenOperations(rowMeta.actions);
3612
+ var preInvoke = (_c = actions2 === null || actions2 === void 0 ? void 0 : actions2.find(function (item) { return item.type === operationType_1; })) === null || _c === void 0 ? void 0 : _c.preInvoke;
3585
3613
  return preInvoke && !confirm ? next(processPreInvoke({
3586
3614
  bcName: bcName,
3587
3615
  operationType: operationType_1,