mitre-form-component 2.2.3 → 2.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1818,12 +1818,26 @@ var MitreFormComponent = import_react8.default.forwardRef(({
1818
1818
  }, REDIRECT_DELAY_MS);
1819
1819
  }
1820
1820
  } else if (channel === "chat") {
1821
+ const { channel: _channelInBody, name: _nameInBody, phone: _phoneInBody, ...requestBodyMinimal } = requestBody;
1822
+ const dialCode = phone.dialCode;
1823
+ const nationalDigits = dialCode && phoneDigitsOnly.startsWith(dialCode) ? phoneDigitsOnly.slice(dialCode.length) : phoneDigitsOnly;
1824
+ const foneDdd = nationalDigits.slice(0, 2);
1825
+ const foneNumber = nationalDigits.slice(2);
1826
+ const effectiveIdEmpreendimento = idEmpreendimento ?? selectedProduct.id.toString();
1827
+ const effectiveIdProdutoTerceiro = idProdutoTerceiro ?? "0";
1821
1828
  const virtualObj = {
1822
- ...requestBody,
1829
+ ...requestBodyMinimal,
1830
+ canal: channel,
1831
+ nome: name,
1832
+ ddi: dialCode,
1833
+ ddd: foneDdd,
1834
+ fone: foneNumber,
1823
1835
  externalOriginId: leadId,
1836
+ idEmpreendimento: effectiveIdEmpreendimento,
1837
+ id_produto: effectiveIdEmpreendimento,
1838
+ idProdutoTerceiro: effectiveIdProdutoTerceiro,
1839
+ id_produto_terceiro: effectiveIdProdutoTerceiro,
1824
1840
  ...paginaAtual ? { pagina: paginaAtual } : {},
1825
- ...idProdutoTerceiro !== void 0 ? { idProdutoTerceiro } : {},
1826
- ...idEmpreendimento !== void 0 ? { idEmpreendimento } : {},
1827
1841
  ...naoCriarEventoEfetivo ? { naoCriarEvento: true } : {}
1828
1842
  };
1829
1843
  setActionModal({