@bigbinary/neeto-rules-frontend 2.6.1 → 2.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/app/javascript/src/translations/ar.json +2 -1
  2. package/app/javascript/src/translations/bg.json +2 -1
  3. package/app/javascript/src/translations/ca.json +2 -1
  4. package/app/javascript/src/translations/cs.json +2 -1
  5. package/app/javascript/src/translations/da.json +2 -1
  6. package/app/javascript/src/translations/de.json +2 -1
  7. package/app/javascript/src/translations/en.json +2 -1
  8. package/app/javascript/src/translations/es-MX.json +2 -1
  9. package/app/javascript/src/translations/es.json +2 -1
  10. package/app/javascript/src/translations/et.json +2 -1
  11. package/app/javascript/src/translations/fi.json +2 -1
  12. package/app/javascript/src/translations/fil.json +2 -1
  13. package/app/javascript/src/translations/fr.json +2 -1
  14. package/app/javascript/src/translations/he.json +2 -1
  15. package/app/javascript/src/translations/hi.json +2 -1
  16. package/app/javascript/src/translations/hr.json +2 -1
  17. package/app/javascript/src/translations/hu.json +2 -1
  18. package/app/javascript/src/translations/id.json +2 -1
  19. package/app/javascript/src/translations/it.json +2 -1
  20. package/app/javascript/src/translations/ja.json +2 -1
  21. package/app/javascript/src/translations/ko.json +2 -1
  22. package/app/javascript/src/translations/nl.json +2 -1
  23. package/app/javascript/src/translations/pl.json +2 -1
  24. package/app/javascript/src/translations/pt-BR.json +2 -1
  25. package/app/javascript/src/translations/pt.json +2 -1
  26. package/app/javascript/src/translations/ro.json +2 -1
  27. package/app/javascript/src/translations/ru.json +2 -1
  28. package/app/javascript/src/translations/sk.json +2 -1
  29. package/app/javascript/src/translations/sl.json +2 -1
  30. package/app/javascript/src/translations/sv.json +2 -1
  31. package/app/javascript/src/translations/th.json +2 -1
  32. package/app/javascript/src/translations/tr.json +2 -1
  33. package/app/javascript/src/translations/uk.json +2 -1
  34. package/app/javascript/src/translations/vi.json +2 -1
  35. package/app/javascript/src/translations/zh-CN.json +2 -1
  36. package/app/javascript/src/translations/zh-TW.json +2 -1
  37. package/dist/.ready +1 -1
  38. package/dist/NeetoRulesBuilder.js +95 -85
  39. package/dist/NeetoRulesBuilder.js.map +1 -1
  40. package/dist/NeetoRulesForm.js +1 -1
  41. package/dist/cjs/NeetoRulesBuilder.js +95 -85
  42. package/dist/cjs/NeetoRulesBuilder.js.map +1 -1
  43. package/dist/cjs/NeetoRulesForm.js +1 -1
  44. package/dist/cjs/index.js +1 -1
  45. package/dist/{index-CkYo0ca_.js → index-B0FTuUOt.js} +20 -3
  46. package/dist/index-B0FTuUOt.js.map +1 -0
  47. package/dist/{index-3f8Yrbst.js → index-C8o4tdnQ.js} +20 -3
  48. package/dist/index-C8o4tdnQ.js.map +1 -0
  49. package/dist/index.js +1 -1
  50. package/package.json +7 -7
  51. package/dist/index-3f8Yrbst.js.map +0 -1
  52. package/dist/index-CkYo0ca_.js.map +0 -1
@@ -11,7 +11,7 @@ import Header from '@bigbinary/neeto-molecules/Header';
11
11
  import Spinner from '@bigbinary/neetoui/Spinner';
12
12
  import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
13
13
  import { useTranslation } from 'react-i18next';
14
- import { E as EditorAction, n as Panel, q as ErrorCallout, r as SmsFields, s as PhoneNumberField, k as formatData, u as usePollRuleName, T as TouchErrors, m as ScrollToErrorField, o as getValidationSchema, p as DEFAULT_INITIAL_VALUE, l as buildPayload } from './index-CkYo0ca_.js';
14
+ import { E as EditorAction, n as Panel, q as ErrorCallout, r as SmsFields, s as PhoneNumberField, k as formatData, u as usePollRuleName, T as TouchErrors, m as ScrollToErrorField, o as getValidationSchema, p as DEFAULT_INITIAL_VALUE, l as buildPayload } from './index-B0FTuUOt.js';
15
15
  import { u as useCustomDataStore } from './useCustomDataStore-BtKYtLVc.js';
16
16
  import { u as useUtilityStore } from './useUtilityStore-CCUYS1mS.js';
17
17
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
@@ -1808,19 +1808,25 @@ var channelOf = function channelOf(_ref6) {
1808
1808
  action = _ref6.action;
1809
1809
  return (action === null || action === void 0 ? void 0 : action.channel) || ((_schema$actions2 = schema.actions) === null || _schema$actions2 === void 0 || (_schema$actions2$acti = _schema$actions2.actionForName) === null || _schema$actions2$acti === void 0 || (_schema$actions2$acti = _schema$actions2$acti.call(_schema$actions2, action === null || action === void 0 ? void 0 : action.name)) === null || _schema$actions2$acti === void 0 ? void 0 : _schema$actions2$acti.channel);
1810
1810
  };
1811
- var channelMetaOf = function channelMetaOf(_ref7) {
1812
- var _schema$actions3;
1811
+ var recipientOf = function recipientOf(_ref7) {
1812
+ var _action$recipient, _schema$actions3, _schema$actions3$acti;
1813
1813
  var schema = _ref7.schema,
1814
1814
  action = _ref7.action;
1815
- return ((_schema$actions3 = schema.actions) === null || _schema$actions3 === void 0 || (_schema$actions3 = _schema$actions3.channelMeta) === null || _schema$actions3 === void 0 ? void 0 : _schema$actions3[channelOf({
1815
+ return (_action$recipient = action === null || action === void 0 ? void 0 : action.recipient) !== null && _action$recipient !== void 0 ? _action$recipient : (_schema$actions3 = schema.actions) === null || _schema$actions3 === void 0 || (_schema$actions3$acti = _schema$actions3.actionForName) === null || _schema$actions3$acti === void 0 || (_schema$actions3$acti = _schema$actions3$acti.call(_schema$actions3, action === null || action === void 0 ? void 0 : action.name)) === null || _schema$actions3$acti === void 0 ? void 0 : _schema$actions3$acti.recipient;
1816
+ };
1817
+ var channelMetaOf = function channelMetaOf(_ref8) {
1818
+ var _schema$actions4;
1819
+ var schema = _ref8.schema,
1820
+ action = _ref8.action;
1821
+ return ((_schema$actions4 = schema.actions) === null || _schema$actions4 === void 0 || (_schema$actions4 = _schema$actions4.channelMeta) === null || _schema$actions4 === void 0 ? void 0 : _schema$actions4[channelOf({
1816
1822
  schema: schema,
1817
1823
  action: action
1818
1824
  })]) || {};
1819
1825
  };
1820
- var actionHasConfig = function actionHasConfig(_ref8) {
1821
- var _schema$actions4, _schema$actions5;
1822
- var schema = _ref8.schema,
1823
- action = _ref8.action;
1826
+ var actionHasConfig = function actionHasConfig(_ref9) {
1827
+ var _schema$actions5, _schema$actions6;
1828
+ var schema = _ref9.schema,
1829
+ action = _ref9.action;
1824
1830
  var meta = channelMetaOf({
1825
1831
  schema: schema,
1826
1832
  action: action
@@ -1831,18 +1837,18 @@ var actionHasConfig = function actionHasConfig(_ref8) {
1831
1837
  name: action === null || action === void 0 ? void 0 : action.name
1832
1838
  });
1833
1839
  if (option !== null && option !== void 0 && option.component || option !== null && option !== void 0 && option.renderConfig) return true;
1834
- if ((_schema$actions4 = schema.actions) !== null && _schema$actions4 !== void 0 && _schema$actions4.hasConfig) return schema.actions.hasConfig(action);
1835
- return !!((_schema$actions5 = schema.actions) !== null && _schema$actions5 !== void 0 && _schema$actions5.renderConfig);
1840
+ if ((_schema$actions5 = schema.actions) !== null && _schema$actions5 !== void 0 && _schema$actions5.hasConfig) return schema.actions.hasConfig(action);
1841
+ return !!((_schema$actions6 = schema.actions) !== null && _schema$actions6 !== void 0 && _schema$actions6.renderConfig);
1836
1842
  };
1837
- var recipientsFor = function recipientsFor(_ref9) {
1838
- var _schema$actions6, _schema$actions7;
1839
- var schema = _ref9.schema,
1840
- action = _ref9.action;
1843
+ var recipientsFor = function recipientsFor(_ref0) {
1844
+ var _schema$actions7, _schema$actions8;
1845
+ var schema = _ref0.schema,
1846
+ action = _ref0.action;
1841
1847
  var channel = channelOf({
1842
1848
  schema: schema,
1843
1849
  action: action
1844
1850
  });
1845
- if (channel && (_schema$actions6 = schema.actions) !== null && _schema$actions6 !== void 0 && _schema$actions6.recipientsFor) {
1851
+ if (channel && (_schema$actions7 = schema.actions) !== null && _schema$actions7 !== void 0 && _schema$actions7.recipientsFor) {
1846
1852
  return schema.actions.recipientsFor(channel);
1847
1853
  }
1848
1854
  var option = findActionOption({
@@ -1850,13 +1856,13 @@ var recipientsFor = function recipientsFor(_ref9) {
1850
1856
  name: channel
1851
1857
  });
1852
1858
  if (option !== null && option !== void 0 && option.recipients) return option.recipients;
1853
- return ((_schema$actions7 = schema.actions) === null || _schema$actions7 === void 0 ? void 0 : _schema$actions7.recipients) || [];
1859
+ return ((_schema$actions8 = schema.actions) === null || _schema$actions8 === void 0 ? void 0 : _schema$actions8.recipients) || [];
1854
1860
  };
1855
- var nextTriggers = function nextTriggers(_ref0) {
1861
+ var nextTriggers = function nextTriggers(_ref1) {
1856
1862
  var _schema$triggers;
1857
- var schema = _ref0.schema,
1858
- rule = _ref0.rule,
1859
- value = _ref0.value;
1863
+ var schema = _ref1.schema,
1864
+ rule = _ref1.rule,
1865
+ value = _ref1.value;
1860
1866
  if ((_schema$triggers = schema.triggers) !== null && _schema$triggers !== void 0 && _schema$triggers.multi) {
1861
1867
  var names = pluck("name", rule.triggers);
1862
1868
  return names.includes(value) ? removeBy({
@@ -1869,12 +1875,12 @@ var nextTriggers = function nextTriggers(_ref0) {
1869
1875
  name: value
1870
1876
  }];
1871
1877
  };
1872
- var nextConditionAt = function nextConditionAt(_ref1) {
1878
+ var nextConditionAt = function nextConditionAt(_ref10) {
1873
1879
  var _field$allowMatching;
1874
- var schema = _ref1.schema,
1875
- rule = _ref1.rule,
1876
- index = _ref1.index,
1877
- value = _ref1.value;
1880
+ var schema = _ref10.schema,
1881
+ rule = _ref10.rule,
1882
+ index = _ref10.index,
1883
+ value = _ref10.value;
1878
1884
  var field = findField({
1879
1885
  schema: schema,
1880
1886
  value: value
@@ -1893,13 +1899,13 @@ var nextConditionAt = function nextConditionAt(_ref1) {
1893
1899
  metadata: {}
1894
1900
  });
1895
1901
  };
1896
- var nextActionAt = function nextActionAt(_ref10) {
1897
- var _schema$actions8;
1898
- var schema = _ref10.schema,
1899
- rule = _ref10.rule,
1900
- index = _ref10.index,
1901
- value = _ref10.value;
1902
- if (!((_schema$actions8 = schema.actions) !== null && _schema$actions8 !== void 0 && _schema$actions8.resolveName)) {
1902
+ var nextActionAt = function nextActionAt(_ref11) {
1903
+ var _schema$actions9;
1904
+ var schema = _ref11.schema,
1905
+ rule = _ref11.rule,
1906
+ index = _ref11.index,
1907
+ value = _ref11.value;
1908
+ if (!((_schema$actions9 = schema.actions) !== null && _schema$actions9 !== void 0 && _schema$actions9.resolveName)) {
1903
1909
  var option = findActionOption({
1904
1910
  schema: schema,
1905
1911
  name: value
@@ -1937,10 +1943,10 @@ var nextActionAt = function nextActionAt(_ref10) {
1937
1943
  var channelChanged = prevChannel !== value;
1938
1944
  var recipient = channelChanged ? undefined : prev.recipient;
1939
1945
  if (channelChanged) {
1940
- var _schema$actions9;
1946
+ var _schema$actions0;
1941
1947
  var channelRecipients =
1942
1948
  // eslint-disable-next-line security/detect-object-injection
1943
- ((_schema$actions9 = schema.actions) === null || _schema$actions9 === void 0 || (_schema$actions9 = _schema$actions9.recipientsByChannel) === null || _schema$actions9 === void 0 ? void 0 : _schema$actions9[value]) || [];
1949
+ ((_schema$actions0 = schema.actions) === null || _schema$actions0 === void 0 || (_schema$actions0 = _schema$actions0.recipientsByChannel) === null || _schema$actions0 === void 0 ? void 0 : _schema$actions0[value]) || [];
1944
1950
  if (channelRecipients.length === 1) {
1945
1951
  var _channelRecipients = _slicedToArray(channelRecipients, 1);
1946
1952
  recipient = _channelRecipients[0];
@@ -1956,12 +1962,12 @@ var nextActionAt = function nextActionAt(_ref10) {
1956
1962
  metadata: channelChanged ? {} : prev.metadata
1957
1963
  });
1958
1964
  };
1959
- var nextActionRecipientAt = function nextActionRecipientAt(_ref11) {
1960
- var _schema$actions0;
1961
- var schema = _ref11.schema,
1962
- rule = _ref11.rule,
1963
- index = _ref11.index,
1964
- value = _ref11.value;
1965
+ var nextActionRecipientAt = function nextActionRecipientAt(_ref12) {
1966
+ var _schema$actions1;
1967
+ var schema = _ref12.schema,
1968
+ rule = _ref12.rule,
1969
+ index = _ref12.index,
1970
+ value = _ref12.value;
1965
1971
  var prev = actionAt({
1966
1972
  rule: rule,
1967
1973
  index: index
@@ -1972,18 +1978,18 @@ var nextActionRecipientAt = function nextActionRecipientAt(_ref11) {
1972
1978
  });
1973
1979
  return _objectSpread$4(_objectSpread$4({}, prev), {}, {
1974
1980
  recipient: value,
1975
- name: (_schema$actions0 = schema.actions) !== null && _schema$actions0 !== void 0 && _schema$actions0.resolveName ? schema.actions.resolveName({
1981
+ name: (_schema$actions1 = schema.actions) !== null && _schema$actions1 !== void 0 && _schema$actions1.resolveName ? schema.actions.resolveName({
1976
1982
  channel: channel,
1977
1983
  recipient: value
1978
1984
  }) : value
1979
1985
  });
1980
1986
  };
1981
- var descriptorFor = function descriptorFor(_ref12) {
1987
+ var descriptorFor = function descriptorFor(_ref13) {
1982
1988
  var _schema$actor2, _schema$conditions2;
1983
- var anchor = _ref12.anchor,
1984
- schema = _ref12.schema,
1985
- rule = _ref12.rule,
1986
- index = _ref12.index;
1989
+ var anchor = _ref13.anchor,
1990
+ schema = _ref13.schema,
1991
+ rule = _ref13.rule,
1992
+ index = _ref13.index;
1987
1993
  switch (anchor) {
1988
1994
  case BUILDER_ANCHORS.TRIGGER_ADD:
1989
1995
  case BUILDER_ANCHORS.TRIGGER_REPLACE:
@@ -2093,22 +2099,22 @@ var descriptorFor = function descriptorFor(_ref12) {
2093
2099
  case BUILDER_ANCHORS.ACTION_ADD:
2094
2100
  case BUILDER_ANCHORS.ACTION_CHANNEL:
2095
2101
  {
2096
- var _schema$actions10, _schema$actions11, _channelOf;
2102
+ var _schema$actions11, _schema$actions12, _channelOf;
2097
2103
  var isSwap = anchor === BUILDER_ANCHORS.ACTION_CHANNEL;
2098
2104
  var channelMetaFor = function channelMetaFor(value) {
2099
- var _schema$actions1;
2105
+ var _schema$actions10;
2100
2106
  return (
2101
2107
  // eslint-disable-next-line security/detect-object-injection
2102
- ((_schema$actions1 = schema.actions) === null || _schema$actions1 === void 0 || (_schema$actions1 = _schema$actions1.channelMeta) === null || _schema$actions1 === void 0 ? void 0 : _schema$actions1[value]) || {}
2108
+ ((_schema$actions10 = schema.actions) === null || _schema$actions10 === void 0 || (_schema$actions10 = _schema$actions10.channelMeta) === null || _schema$actions10 === void 0 ? void 0 : _schema$actions10[value]) || {}
2103
2109
  );
2104
2110
  };
2105
2111
  var rank = function rank(value) {
2106
2112
  var idx = SWAP_CHANNEL_ORDER.indexOf(value);
2107
2113
  return idx === -1 ? SWAP_CHANNEL_ORDER.length : idx;
2108
2114
  };
2109
- var sourceOptions = isSwap ? _toConsumableArray(((_schema$actions10 = schema.actions) === null || _schema$actions10 === void 0 ? void 0 : _schema$actions10.options) || []).sort(function (optionA, optionB) {
2115
+ var sourceOptions = isSwap ? _toConsumableArray(((_schema$actions11 = schema.actions) === null || _schema$actions11 === void 0 ? void 0 : _schema$actions11.options) || []).sort(function (optionA, optionB) {
2110
2116
  return rank(optionValue(optionA)) - rank(optionValue(optionB));
2111
- }) : ((_schema$actions11 = schema.actions) === null || _schema$actions11 === void 0 ? void 0 : _schema$actions11.options) || [];
2117
+ }) : ((_schema$actions12 = schema.actions) === null || _schema$actions12 === void 0 ? void 0 : _schema$actions12.options) || [];
2112
2118
  return {
2113
2119
  title: isSwap ? t("neetoRules.builder.panes.actionSwapTitle") : t("neetoRules.builder.panes.actionAddTitle"),
2114
2120
  subtitle: isSwap ? t("neetoRules.builder.panes.actionSwapSubtitle") : t("neetoRules.builder.panes.actionAddSubtitle"),
@@ -2138,7 +2144,7 @@ var descriptorFor = function descriptorFor(_ref12) {
2138
2144
  }
2139
2145
  case BUILDER_ANCHORS.ACTION_RECIPIENT:
2140
2146
  {
2141
- var _schema$actions12;
2147
+ var _schema$actions13;
2142
2148
  var action = actionAt({
2143
2149
  rule: rule,
2144
2150
  index: index
@@ -2148,7 +2154,7 @@ var descriptorFor = function descriptorFor(_ref12) {
2148
2154
  action: action
2149
2155
  });
2150
2156
  // eslint-disable-next-line security/detect-object-injection
2151
- var meta = ((_schema$actions12 = schema.actions) === null || _schema$actions12 === void 0 || (_schema$actions12 = _schema$actions12.channelMeta) === null || _schema$actions12 === void 0 ? void 0 : _schema$actions12[channel]) || {};
2157
+ var meta = ((_schema$actions13 = schema.actions) === null || _schema$actions13 === void 0 || (_schema$actions13 = _schema$actions13.channelMeta) === null || _schema$actions13 === void 0 ? void 0 : _schema$actions13[channel]) || {};
2152
2158
  var option = findActionOption({
2153
2159
  schema: schema,
2154
2160
  name: channel
@@ -2165,7 +2171,10 @@ var descriptorFor = function descriptorFor(_ref12) {
2165
2171
  value: optionValue(recipient)
2166
2172
  };
2167
2173
  }),
2168
- selectedValues: [action.recipient]
2174
+ selectedValues: [recipientOf({
2175
+ schema: schema,
2176
+ action: action
2177
+ })]
2169
2178
  };
2170
2179
  }
2171
2180
  case BUILDER_ANCHORS.SCOPE:
@@ -2205,13 +2214,13 @@ var descriptorFor = function descriptorFor(_ref12) {
2205
2214
  };
2206
2215
  }
2207
2216
  };
2208
- var commitFor = function commitFor(_ref13) {
2209
- var anchor = _ref13.anchor,
2210
- schema = _ref13.schema,
2211
- rule = _ref13.rule,
2212
- index = _ref13.index,
2213
- value = _ref13.value,
2214
- helpers = _ref13.helpers;
2217
+ var commitFor = function commitFor(_ref14) {
2218
+ var anchor = _ref14.anchor,
2219
+ schema = _ref14.schema,
2220
+ rule = _ref14.rule,
2221
+ index = _ref14.index,
2222
+ value = _ref14.value,
2223
+ helpers = _ref14.helpers;
2215
2224
  var setTriggers = helpers.setTriggers,
2216
2225
  setPerformer = helpers.setPerformer,
2217
2226
  setConditionMode = helpers.setConditionMode,
@@ -2306,12 +2315,12 @@ var commitFor = function commitFor(_ref13) {
2306
2315
  return "close";
2307
2316
  }
2308
2317
  };
2309
- var continueTargetFor = function continueTargetFor(_ref14) {
2318
+ var continueTargetFor = function continueTargetFor(_ref15) {
2310
2319
  var _schema$actor3;
2311
- var anchor = _ref14.anchor,
2312
- schema = _ref14.schema,
2313
- rule = _ref14.rule,
2314
- index = _ref14.index;
2320
+ var anchor = _ref15.anchor,
2321
+ schema = _ref15.schema,
2322
+ rule = _ref15.rule,
2323
+ index = _ref15.index;
2315
2324
  switch (anchor) {
2316
2325
  case BUILDER_ANCHORS.TRIGGER_ADD:
2317
2326
  case BUILDER_ANCHORS.TRIGGER_REPLACE:
@@ -2384,21 +2393,21 @@ var continueTargetFor = function continueTargetFor(_ref14) {
2384
2393
  return null;
2385
2394
  }
2386
2395
  };
2387
- var replaceAt = function replaceAt(_ref15) {
2388
- var list = _ref15.list,
2389
- index = _ref15.index,
2390
- item = _ref15.item;
2396
+ var replaceAt = function replaceAt(_ref16) {
2397
+ var list = _ref16.list,
2398
+ index = _ref16.index,
2399
+ item = _ref16.item;
2391
2400
  var next = _toConsumableArray(list);
2392
2401
  // eslint-disable-next-line security/detect-object-injection
2393
2402
  next[index] = item;
2394
2403
  return next;
2395
2404
  };
2396
- var applyPreview = function applyPreview(_ref16) {
2397
- var rule = _ref16.rule,
2398
- schema = _ref16.schema,
2399
- anchor = _ref16.anchor,
2400
- index = _ref16.index,
2401
- value = _ref16.value;
2405
+ var applyPreview = function applyPreview(_ref17) {
2406
+ var rule = _ref17.rule,
2407
+ schema = _ref17.schema,
2408
+ anchor = _ref17.anchor,
2409
+ index = _ref17.index,
2410
+ value = _ref17.value;
2402
2411
  switch (anchor) {
2403
2412
  case BUILDER_ANCHORS.TRIGGER_ADD:
2404
2413
  case BUILDER_ANCHORS.TRIGGER_REPLACE:
@@ -3846,7 +3855,7 @@ var RecipientField = function RecipientField(_ref) {
3846
3855
  };
3847
3856
 
3848
3857
  var RecipientPane = function RecipientPane(_ref) {
3849
- var _schema$actions, _schema$actions$actio, _schema$actions2, _schema$actions2$rend, _schema$actions3, _schema$actions3$opti, _schema$actions4, _schema$actions4$opti, _schema$actions5, _schema$actions6, _schema$actions$rende, _schema$actions7, _schema$actions7$rend, _action$metadata, _schema$actions8;
3858
+ var _schema$actions, _schema$actions$actio, _action$recipient, _schema$actions2, _schema$actions2$acti, _schema$actions3, _schema$actions3$rend, _schema$actions4, _schema$actions4$opti, _schema$actions5, _schema$actions5$opti, _schema$actions6, _schema$actions7, _schema$actions$rende, _schema$actions8, _schema$actions8$rend, _action$metadata, _schema$actions9;
3850
3859
  var schema = _ref.schema,
3851
3860
  index = _ref.index;
3852
3861
  var _useTranslation = useTranslation(),
@@ -3860,13 +3869,14 @@ var RecipientPane = function RecipientPane(_ref) {
3860
3869
  // eslint-disable-next-line security/detect-object-injection
3861
3870
  var action = rule.actions[index] || {};
3862
3871
  var channel = action.channel || ((_schema$actions = schema.actions) === null || _schema$actions === void 0 || (_schema$actions$actio = _schema$actions.actionForName) === null || _schema$actions$actio === void 0 || (_schema$actions$actio = _schema$actions$actio.call(_schema$actions, action.name)) === null || _schema$actions$actio === void 0 ? void 0 : _schema$actions$actio.channel);
3872
+ var recipient = (_action$recipient = action.recipient) !== null && _action$recipient !== void 0 ? _action$recipient : (_schema$actions2 = schema.actions) === null || _schema$actions2 === void 0 || (_schema$actions2$acti = _schema$actions2.actionForName) === null || _schema$actions2$acti === void 0 || (_schema$actions2$acti = _schema$actions2$acti.call(_schema$actions2, action.name)) === null || _schema$actions2$acti === void 0 ? void 0 : _schema$actions2$acti.recipient;
3863
3873
  var name = "".concat(fieldKeys.actions, ".value.").concat(index, ".metadata");
3864
- var editor = (_schema$actions2 = schema.actions) === null || _schema$actions2 === void 0 || (_schema$actions2$rend = _schema$actions2.renderRecipientEditor) === null || _schema$actions2$rend === void 0 ? void 0 : _schema$actions2$rend.call(_schema$actions2, {
3874
+ var editor = (_schema$actions3 = schema.actions) === null || _schema$actions3 === void 0 || (_schema$actions3$rend = _schema$actions3.renderRecipientEditor) === null || _schema$actions3$rend === void 0 ? void 0 : _schema$actions3$rend.call(_schema$actions3, {
3865
3875
  channel: channel,
3866
3876
  name: name,
3867
3877
  action: action
3868
3878
  });
3869
- var flatOption = ((_schema$actions3 = schema.actions) === null || _schema$actions3 === void 0 || (_schema$actions3$opti = _schema$actions3.optionForName) === null || _schema$actions3$opti === void 0 ? void 0 : _schema$actions3$opti.call(_schema$actions3, action.name)) || ((_schema$actions4 = schema.actions) === null || _schema$actions4 === void 0 || (_schema$actions4$opti = _schema$actions4.optionForChannel) === null || _schema$actions4$opti === void 0 ? void 0 : _schema$actions4$opti.call(_schema$actions4, channel));
3879
+ var flatOption = ((_schema$actions4 = schema.actions) === null || _schema$actions4 === void 0 || (_schema$actions4$opti = _schema$actions4.optionForName) === null || _schema$actions4$opti === void 0 ? void 0 : _schema$actions4$opti.call(_schema$actions4, action.name)) || ((_schema$actions5 = schema.actions) === null || _schema$actions5 === void 0 || (_schema$actions5$opti = _schema$actions5.optionForChannel) === null || _schema$actions5$opti === void 0 ? void 0 : _schema$actions5$opti.call(_schema$actions5, channel));
3870
3880
  var isSmsToNumbers = (flatOption === null || flatOption === void 0 ? void 0 : flatOption.type) === SMS_TO_NUMBERS;
3871
3881
  var recipientFieldPath = isSmsToNumbers ? "".concat(name, ".phoneNumbers") : "".concat(name, ".emails");
3872
3882
  usePaneValidation(recipientFieldPath);
@@ -3880,11 +3890,11 @@ var RecipientPane = function RecipientPane(_ref) {
3880
3890
  }, 0);
3881
3891
  // eslint-disable-next-line react-hooks/exhaustive-deps
3882
3892
  }, [!editor]);
3883
- var recipientConfig = (((_schema$actions5 = schema.actions) === null || _schema$actions5 === void 0 ? void 0 : _schema$actions5.options) || []).flatMap(function (option) {
3893
+ var recipientConfig = (((_schema$actions6 = schema.actions) === null || _schema$actions6 === void 0 ? void 0 : _schema$actions6.options) || []).flatMap(function (option) {
3884
3894
  return option.recipients || [];
3885
- }).concat(((_schema$actions6 = schema.actions) === null || _schema$actions6 === void 0 ? void 0 : _schema$actions6.recipients) || []).find(function (item) {
3895
+ }).concat(((_schema$actions7 = schema.actions) === null || _schema$actions7 === void 0 ? void 0 : _schema$actions7.recipients) || []).find(function (item) {
3886
3896
  var _item$value;
3887
- return ((_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : item.id) === action.recipient;
3897
+ return ((_item$value = item.value) !== null && _item$value !== void 0 ? _item$value : item.id) === recipient;
3888
3898
  });
3889
3899
  var builtInRecipientField = recipientConfig !== null && recipientConfig !== void 0 && recipientConfig.field ? /*#__PURE__*/jsx(RecipientField, {
3890
3900
  name: name,
@@ -3892,9 +3902,9 @@ var RecipientPane = function RecipientPane(_ref) {
3892
3902
  field: recipientConfig.field,
3893
3903
  placeholder: recipientConfig.placeholder
3894
3904
  }) : null;
3895
- var recipientField = (_schema$actions$rende = (_schema$actions7 = schema.actions) === null || _schema$actions7 === void 0 || (_schema$actions7$rend = _schema$actions7.renderRecipientField) === null || _schema$actions7$rend === void 0 ? void 0 : _schema$actions7$rend.call(_schema$actions7, {
3905
+ var recipientField = (_schema$actions$rende = (_schema$actions8 = schema.actions) === null || _schema$actions8 === void 0 || (_schema$actions8$rend = _schema$actions8.renderRecipientField) === null || _schema$actions8$rend === void 0 ? void 0 : _schema$actions8$rend.call(_schema$actions8, {
3896
3906
  channel: channel,
3897
- recipient: action.recipient,
3907
+ recipient: recipient,
3898
3908
  name: name,
3899
3909
  action: action
3900
3910
  })) !== null && _schema$actions$rende !== void 0 ? _schema$actions$rende : builtInRecipientField;
@@ -3929,7 +3939,7 @@ var RecipientPane = function RecipientPane(_ref) {
3929
3939
  }
3930
3940
 
3931
3941
  // eslint-disable-next-line security/detect-object-injection
3932
- var meta = ((_schema$actions8 = schema.actions) === null || _schema$actions8 === void 0 || (_schema$actions8 = _schema$actions8.channelMeta) === null || _schema$actions8 === void 0 ? void 0 : _schema$actions8[channel]) || {};
3942
+ var meta = ((_schema$actions9 = schema.actions) === null || _schema$actions9 === void 0 || (_schema$actions9 = _schema$actions9.channelMeta) === null || _schema$actions9 === void 0 ? void 0 : _schema$actions9[channel]) || {};
3933
3943
  return /*#__PURE__*/jsxs(Fragment, {
3934
3944
  children: [/*#__PURE__*/jsx(Panel.Header, {
3935
3945
  children: /*#__PURE__*/jsxs("div", {