@credithub/harlan-components 1.82.3 → 1.82.4

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.
@@ -84,26 +84,25 @@ var businessTypes = [
84
84
  'cooperativa'
85
85
  ];
86
86
  var Liminar = function (_a) {
87
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
88
- var _p = _a.isFinancial, isFinancial = _p === void 0 ? true : _p, hasCredits = _a.hasCredits, _q = _a.tags, tags = _q === void 0 ? [] : _q;
87
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
88
+ var _o = _a.isFinancial, isFinancial = _o === void 0 ? false : _o, hasCredits = _a.hasCredits, _p = _a.tags, tags = _p === void 0 ? [] : _p;
89
89
  var ctx = useContext(Queries.LiminarCenprot);
90
- var _r = useGlobalData(), globalData = _r.data, setData = _r.setData;
90
+ var _q = useGlobalData(), globalData = _q.data, setData = _q.setData;
91
91
  var fetchLiminarProtestosDoPassado = useLiminarProtestosDoPassado({
92
92
  documento: ((_c = (_b = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _b === void 0 ? void 0 : _b.carousel) === null || _c === void 0 ? void 0 : _c.document) || ''
93
93
  }).fetchLiminarProtestosDoPassado;
94
- console.log((_d = globalData === null || globalData === void 0 ? void 0 : globalData.documentHistory) === null || _d === void 0 ? void 0 : _d.protestoLiminar);
95
- var _s = useState(false), isLoadingLiminarProtestosDoPassado = _s[0], setIsLoadingLiminarProtestosDoPassado = _s[1];
94
+ var _r = useState(false), isLoadingLiminarProtestosDoPassado = _r[0], setIsLoadingLiminarProtestosDoPassado = _r[1];
96
95
  var processedRef = useRef(false);
97
96
  var dataHashRef = useRef('');
98
97
  var invertedIdsRef = useRef([]);
99
- var _t = useState(false), isTooltipVisible = _t[0], setTooltipVisible = _t[1];
100
- var _u = useState(false), isEmailModalOpen = _u[0], setIsEmailModalOpen = _u[1];
101
- var _v = useState(''), emailModalMessage = _v[0], setEmailModalMessage = _v[1];
98
+ var _s = useState(false), isTooltipVisible = _s[0], setTooltipVisible = _s[1];
99
+ var _t = useState(false), isEmailModalOpen = _t[0], setIsEmailModalOpen = _t[1];
100
+ var _u = useState(''), emailModalMessage = _u[0], setEmailModalMessage = _u[1];
102
101
  var liminarMailPrice = useMemo(function () {
103
102
  var isDiamanteNew = hasOneOfTags(tags, ['diamante-new']);
104
103
  return isDiamanteNew ? 0 : 50000;
105
104
  }, [tags]);
106
- var _w = useFetch("SELECT FROM 'LIMINAR'.'SENDMAIL'"), sendIndiciosEmail = _w.fetch, isEmailSending = _w.isLoading, emailError = _w.error;
105
+ var _v = useFetch("SELECT FROM 'LIMINAR'.'SENDMAIL'"), sendIndiciosEmail = _v.fetch, isEmailSending = _v.isLoading, emailError = _v.error;
107
106
  var hideTt = useRef();
108
107
  /*
109
108
  * Extrai e normaliza os tipos de documento presentes em ctx.document, retornando sempre um array de strings em minúsculo.
@@ -141,13 +140,13 @@ var Liminar = function (_a) {
141
140
  });
142
141
  });
143
142
  }, [
144
- (_e = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _e === void 0 ? void 0 : _e.carousel,
145
- (_f = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _f === void 0 ? void 0 : _f.empresa
143
+ (_d = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _d === void 0 ? void 0 : _d.carousel,
144
+ (_e = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _e === void 0 ? void 0 : _e.empresa
146
145
  ]);
147
146
  /*
148
147
  * Identifica as origens de liminares detectadas e verifica se existe liminar de protesto invertida
149
148
  */
150
- var _x = useMemo(function () {
149
+ var _w = useMemo(function () {
151
150
  var _a, _b;
152
151
  var labels = new Set();
153
152
  var indiciosApi = ((_a = ctx.document) === null || _a === void 0 ? void 0 : _a.indiciosDeLiminar) === true;
@@ -182,17 +181,17 @@ var Liminar = function (_a) {
182
181
  ctx.document,
183
182
  tiposDocumento,
184
183
  processosComAssuntoValido,
185
- (_g = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _g === void 0 ? void 0 : _g.indiciosDeLiminarProtestosDoPassado
186
- ]), origensDetectadas = _x.origensDetectadas, foundBusinessEntity = _x.foundBusinessEntity;
184
+ (_f = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _f === void 0 ? void 0 : _f.indiciosDeLiminarProtestosDoPassado
185
+ ]), origensDetectadas = _w.origensDetectadas, foundBusinessEntity = _w.foundBusinessEntity;
187
186
  var documentHistoryReady = useMemo(function () { return isDocumentHistoryReady(globalData); }, [globalData]);
188
187
  useEffect(function () {
189
188
  if (!documentHistoryReady)
190
189
  return;
191
190
  var fetch = function () { return __awaiter(void 0, void 0, void 0, function () {
192
191
  var dossie, processosJuridicos, depsLoaded, newIds, hash, indiciosApi, indiciosDeLiminarProtestosDoPassado, protestosDoPassadoIds, _a, possuiIndiciosDeLiminarProtestosDoPassado, protestosIds, finalStatus, descricaoLiminar;
193
- var _b, _c, _d, _e;
194
- return __generator(this, function (_f) {
195
- switch (_f.label) {
192
+ var _b, _c, _d;
193
+ return __generator(this, function (_e) {
194
+ switch (_e.label) {
196
195
  case 0:
197
196
  dossie = globalData === null || globalData === void 0 ? void 0 : globalData.dossie;
198
197
  processosJuridicos = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData;
@@ -214,13 +213,11 @@ var Liminar = function (_a) {
214
213
  indiciosApi = ((_c = ctx.document) === null || _c === void 0 ? void 0 : _c.indiciosDeLiminar) === true;
215
214
  indiciosDeLiminarProtestosDoPassado = false;
216
215
  protestosDoPassadoIds = '';
217
- console.log('status Protesto Liminar', (_d = globalData === null || globalData === void 0 ? void 0 : globalData.documentHistory) === null || _d === void 0 ? void 0 : _d.protestoLiminar);
218
- if (!((_e = globalData === null || globalData === void 0 ? void 0 : globalData.documentHistory) === null || _e === void 0 ? void 0 : _e.protestoLiminar)) return [3 /*break*/, 2];
219
- console.log('entrou');
216
+ if (!((_d = globalData === null || globalData === void 0 ? void 0 : globalData.documentHistory) === null || _d === void 0 ? void 0 : _d.protestoLiminar)) return [3 /*break*/, 2];
220
217
  setIsLoadingLiminarProtestosDoPassado(true);
221
218
  return [4 /*yield*/, fetchLiminarProtestosDoPassado()];
222
219
  case 1:
223
- _a = _f.sent(), possuiIndiciosDeLiminarProtestosDoPassado = _a.possuiIndiciosDeLiminarProtestosDoPassado, protestosIds = _a.protestosDoPassadoIds;
220
+ _a = _e.sent(), possuiIndiciosDeLiminarProtestosDoPassado = _a.possuiIndiciosDeLiminarProtestosDoPassado, protestosIds = _a.protestosDoPassadoIds;
224
221
  if (possuiIndiciosDeLiminarProtestosDoPassado) {
225
222
  origensDetectadas.push('Liminar no Cenprot');
226
223
  indiciosDeLiminarProtestosDoPassado =
@@ -228,7 +225,7 @@ var Liminar = function (_a) {
228
225
  protestosDoPassadoIds = protestosIds.join(',');
229
226
  }
230
227
  setIsLoadingLiminarProtestosDoPassado(false);
231
- _f.label = 2;
228
+ _e.label = 2;
232
229
  case 2:
233
230
  finalStatus = indiciosApi ||
234
231
  processosComAssuntoValido.length ||
@@ -271,8 +268,8 @@ var Liminar = function (_a) {
271
268
  foundBusinessEntity
272
269
  ]);
273
270
  var ready = processedRef.current &&
274
- !!((_h = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _h === void 0 ? void 0 : _h.isLoaded) &&
275
- !!((_j = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _j === void 0 ? void 0 : _j.carousel) &&
271
+ !!((_g = globalData === null || globalData === void 0 ? void 0 : globalData.processosJuridicosData) === null || _g === void 0 ? void 0 : _g.isLoaded) &&
272
+ !!((_h = globalData === null || globalData === void 0 ? void 0 : globalData.dossie) === null || _h === void 0 ? void 0 : _h.carousel) &&
276
273
  !isLoadingLiminarProtestosDoPassado &&
277
274
  ctx.type !== RequestStatus.Loading;
278
275
  var ctxLoading = useMemo(function () { return (__assign(__assign({}, ctx), { type: RequestStatus.Loading })); }, [ctx]);
@@ -292,8 +289,8 @@ var Liminar = function (_a) {
292
289
  : 'Processos com indícios encontrados:';
293
290
  var shouldRender = isLoadingLiminarProtestosDoPassado ||
294
291
  (ready &&
295
- (((_k = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _k === void 0 ? void 0 : _k.indiciosDeLiminar) ||
296
- ((_o = (_m = (_l = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _l === void 0 ? void 0 : _l.processosComLiminarIds) === null || _m === void 0 ? void 0 : _m.length) !== null && _o !== void 0 ? _o : 0) > 0));
292
+ (((_j = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _j === void 0 ? void 0 : _j.indiciosDeLiminar) ||
293
+ ((_m = (_l = (_k = globalData === null || globalData === void 0 ? void 0 : globalData.liminar) === null || _k === void 0 ? void 0 : _k.processosComLiminarIds) === null || _l === void 0 ? void 0 : _l.length) !== null && _m !== void 0 ? _m : 0) > 0));
297
294
  // Função para disparar o envio do e-mail e configurar a mensagem do modal
298
295
  var handleSendEmailIndicios = function (e) { return __awaiter(void 0, void 0, void 0, function () {
299
296
  var callback;
@@ -93,7 +93,6 @@ var useLiminarProtestosDoPassado = function (_a) {
93
93
  })];
94
94
  case 1:
95
95
  data = _a.sent();
96
- console.log('data', data);
97
96
  return [4 /*yield*/, Client.WebService.parse(data)];
98
97
  case 2:
99
98
  parsed = (_a.sent());
@@ -107,7 +106,7 @@ var useLiminarProtestosDoPassado = function (_a) {
107
106
  switch (_a.label) {
108
107
  case 0: return [4 /*yield*/, possuiPdf(chave)];
109
108
  case 1:
110
- if (!(_a.sent()))
109
+ if (_a.sent())
111
110
  ocultos.push(chave);
112
111
  return [2 /*return*/];
113
112
  }