@data-c/ui 0.2.93 → 0.2.95
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.d.ts +1 -1
- package/dist/index.js +432 -75
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +486 -129
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -10421,10 +10421,70 @@ function DefaultBanner() {
|
|
|
10421
10421
|
|
|
10422
10422
|
|
|
10423
10423
|
|
|
10424
|
+
// ../../node_modules/jwt-decode/build/esm/index.js
|
|
10425
|
+
var InvalidTokenError = class extends Error {
|
|
10426
|
+
};
|
|
10427
|
+
InvalidTokenError.prototype.name = "InvalidTokenError";
|
|
10428
|
+
function b64DecodeUnicode(str) {
|
|
10429
|
+
return decodeURIComponent(atob(str).replace(/(.)/g, (m, p) => {
|
|
10430
|
+
let code = p.charCodeAt(0).toString(16).toUpperCase();
|
|
10431
|
+
if (code.length < 2) {
|
|
10432
|
+
code = "0" + code;
|
|
10433
|
+
}
|
|
10434
|
+
return "%" + code;
|
|
10435
|
+
}));
|
|
10436
|
+
}
|
|
10437
|
+
function base64UrlDecode(str) {
|
|
10438
|
+
let output = str.replace(/-/g, "+").replace(/_/g, "/");
|
|
10439
|
+
switch (output.length % 4) {
|
|
10440
|
+
case 0:
|
|
10441
|
+
break;
|
|
10442
|
+
case 2:
|
|
10443
|
+
output += "==";
|
|
10444
|
+
break;
|
|
10445
|
+
case 3:
|
|
10446
|
+
output += "=";
|
|
10447
|
+
break;
|
|
10448
|
+
default:
|
|
10449
|
+
throw new Error("base64 string is not of the correct length");
|
|
10450
|
+
}
|
|
10451
|
+
try {
|
|
10452
|
+
return b64DecodeUnicode(output);
|
|
10453
|
+
} catch (err) {
|
|
10454
|
+
return atob(output);
|
|
10455
|
+
}
|
|
10456
|
+
}
|
|
10457
|
+
function jwtDecode(token, options) {
|
|
10458
|
+
if (typeof token !== "string") {
|
|
10459
|
+
throw new InvalidTokenError("Invalid token specified: must be a string");
|
|
10460
|
+
}
|
|
10461
|
+
options || (options = {});
|
|
10462
|
+
const pos = options.header === true ? 0 : 1;
|
|
10463
|
+
const part = token.split(".")[pos];
|
|
10464
|
+
if (typeof part !== "string") {
|
|
10465
|
+
throw new InvalidTokenError(`Invalid token specified: missing part #${pos + 1}`);
|
|
10466
|
+
}
|
|
10467
|
+
let decoded;
|
|
10468
|
+
try {
|
|
10469
|
+
decoded = base64UrlDecode(part);
|
|
10470
|
+
} catch (e) {
|
|
10471
|
+
throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${pos + 1} (${e.message})`);
|
|
10472
|
+
}
|
|
10473
|
+
try {
|
|
10474
|
+
return JSON.parse(decoded);
|
|
10475
|
+
} catch (e) {
|
|
10476
|
+
throw new InvalidTokenError(`Invalid token specified: invalid json for part #${pos + 1} (${e.message})`);
|
|
10477
|
+
}
|
|
10478
|
+
}
|
|
10479
|
+
|
|
10424
10480
|
// src/v2/Auth/context/CredentialsContext.tsx
|
|
10425
10481
|
|
|
10426
10482
|
|
|
10427
10483
|
|
|
10484
|
+
|
|
10485
|
+
|
|
10486
|
+
|
|
10487
|
+
|
|
10428
10488
|
var CredentialsContext = _react.createContext.call(void 0,
|
|
10429
10489
|
void 0
|
|
10430
10490
|
);
|
|
@@ -10432,11 +10492,308 @@ function CredentialsProvider({
|
|
|
10432
10492
|
children,
|
|
10433
10493
|
credentialsConfig
|
|
10434
10494
|
}) {
|
|
10435
|
-
const
|
|
10495
|
+
const TOKEN_KEY = credentialsConfig.tokenKey;
|
|
10496
|
+
const REFRESH_TOKEN_KEY = credentialsConfig.refreshTokenKey;
|
|
10497
|
+
const axios2 = credentialsConfig.axios;
|
|
10498
|
+
const [isSubmitting, setSubmitting] = _react.useState.call(void 0, false);
|
|
10499
|
+
const [token, setTokenState] = _react.useState.call(void 0,
|
|
10500
|
+
() => localStorage.getItem(TOKEN_KEY)
|
|
10501
|
+
);
|
|
10502
|
+
const [refreshToken, setRefreshTokenState] = _react.useState.call(void 0,
|
|
10503
|
+
() => localStorage.getItem(REFRESH_TOKEN_KEY)
|
|
10504
|
+
);
|
|
10505
|
+
const [userLogged, setUserLogged] = _react.useState.call(void 0,
|
|
10506
|
+
() => {
|
|
10507
|
+
const currentToken = localStorage.getItem(TOKEN_KEY);
|
|
10508
|
+
if (!currentToken)
|
|
10509
|
+
return null;
|
|
10510
|
+
try {
|
|
10511
|
+
const { data } = jwtDecode(
|
|
10512
|
+
currentToken
|
|
10513
|
+
);
|
|
10514
|
+
return data;
|
|
10515
|
+
} catch (e4) {
|
|
10516
|
+
return null;
|
|
10517
|
+
}
|
|
10518
|
+
}
|
|
10519
|
+
);
|
|
10520
|
+
const [isAuthenticated, setIsAuthenticated] = _react.useState.call(void 0, () => {
|
|
10521
|
+
const currentToken = localStorage.getItem(TOKEN_KEY);
|
|
10522
|
+
if (!currentToken)
|
|
10523
|
+
return false;
|
|
10524
|
+
try {
|
|
10525
|
+
const { exp } = jwtDecode(currentToken);
|
|
10526
|
+
const expDate = new Date(exp * 1e3).getTime();
|
|
10527
|
+
const nowDate = (/* @__PURE__ */ new Date()).getTime();
|
|
10528
|
+
return nowDate < expDate;
|
|
10529
|
+
} catch (e5) {
|
|
10530
|
+
return false;
|
|
10531
|
+
}
|
|
10532
|
+
});
|
|
10533
|
+
function decodeTokenFromValue(tokenValue) {
|
|
10534
|
+
if (!tokenValue)
|
|
10535
|
+
return null;
|
|
10536
|
+
try {
|
|
10537
|
+
const { data } = jwtDecode(tokenValue);
|
|
10538
|
+
return data;
|
|
10539
|
+
} catch (e6) {
|
|
10540
|
+
return null;
|
|
10541
|
+
}
|
|
10542
|
+
}
|
|
10543
|
+
function isTokenValid(tokenValue) {
|
|
10544
|
+
if (!tokenValue)
|
|
10545
|
+
return false;
|
|
10546
|
+
try {
|
|
10547
|
+
const { exp } = jwtDecode(tokenValue);
|
|
10548
|
+
const expDate = new Date(exp * 1e3).getTime();
|
|
10549
|
+
const nowDate = (/* @__PURE__ */ new Date()).getTime();
|
|
10550
|
+
return nowDate < expDate;
|
|
10551
|
+
} catch (e7) {
|
|
10552
|
+
return false;
|
|
10553
|
+
}
|
|
10554
|
+
}
|
|
10555
|
+
function syncAuthState(nextToken, nextRefreshToken) {
|
|
10556
|
+
setTokenState(nextToken);
|
|
10557
|
+
setRefreshTokenState(nextRefreshToken);
|
|
10558
|
+
setUserLogged(decodeTokenFromValue(nextToken));
|
|
10559
|
+
setIsAuthenticated(isTokenValid(nextToken));
|
|
10560
|
+
}
|
|
10561
|
+
_react.useEffect.call(void 0, () => {
|
|
10562
|
+
const onStorage = (event) => {
|
|
10563
|
+
if (event.key !== TOKEN_KEY && event.key !== REFRESH_TOKEN_KEY) {
|
|
10564
|
+
return;
|
|
10565
|
+
}
|
|
10566
|
+
const nextToken = localStorage.getItem(TOKEN_KEY);
|
|
10567
|
+
const nextRefreshToken = localStorage.getItem(REFRESH_TOKEN_KEY);
|
|
10568
|
+
syncAuthState(nextToken, nextRefreshToken);
|
|
10569
|
+
};
|
|
10570
|
+
window.addEventListener("storage", onStorage);
|
|
10571
|
+
return () => window.removeEventListener("storage", onStorage);
|
|
10572
|
+
}, [TOKEN_KEY, REFRESH_TOKEN_KEY]);
|
|
10573
|
+
function setToken(token2, refreshToken2) {
|
|
10574
|
+
localStorage.setItem(TOKEN_KEY, token2);
|
|
10575
|
+
if (refreshToken2) {
|
|
10576
|
+
localStorage.setItem(REFRESH_TOKEN_KEY, refreshToken2);
|
|
10577
|
+
} else {
|
|
10578
|
+
localStorage.removeItem(REFRESH_TOKEN_KEY);
|
|
10579
|
+
}
|
|
10580
|
+
syncAuthState(token2, refreshToken2 || null);
|
|
10581
|
+
}
|
|
10582
|
+
function logout() {
|
|
10583
|
+
localStorage.removeItem(TOKEN_KEY);
|
|
10584
|
+
localStorage.removeItem(REFRESH_TOKEN_KEY);
|
|
10585
|
+
syncAuthState(null, null);
|
|
10586
|
+
}
|
|
10587
|
+
function getToken() {
|
|
10588
|
+
return token;
|
|
10589
|
+
}
|
|
10590
|
+
function getRefreshToken() {
|
|
10591
|
+
return refreshToken;
|
|
10592
|
+
}
|
|
10593
|
+
function formatAndSetToken(_token, email, senha) {
|
|
10594
|
+
const toReturn = _token;
|
|
10595
|
+
if (toReturn) {
|
|
10596
|
+
const token3 = _token.token;
|
|
10597
|
+
const { data: decodedToken } = jwtDecode(token3);
|
|
10598
|
+
const permissoes = decodedToken.permissoes;
|
|
10599
|
+
const permissao = permissoes[credentialsConfig.applicationsId];
|
|
10600
|
+
const uuid = decodedToken.uuid;
|
|
10601
|
+
const name = decodedToken.name;
|
|
10602
|
+
toReturn.email = email;
|
|
10603
|
+
toReturn.password = senha;
|
|
10604
|
+
toReturn.userId = uuid;
|
|
10605
|
+
toReturn.userName = name;
|
|
10606
|
+
toReturn.empresas = _optionalChain([permissao, 'optionalAccess', _84 => _84.empresas]) || null;
|
|
10607
|
+
}
|
|
10608
|
+
const { token: token2, refreshToken: refreshToken2 } = _token;
|
|
10609
|
+
setToken(token2, refreshToken2);
|
|
10610
|
+
return toReturn;
|
|
10611
|
+
}
|
|
10612
|
+
async function login(email, password) {
|
|
10613
|
+
setSubmitting(true);
|
|
10614
|
+
try {
|
|
10615
|
+
const response = await axios2.post(
|
|
10616
|
+
"sessions",
|
|
10617
|
+
{
|
|
10618
|
+
email,
|
|
10619
|
+
password
|
|
10620
|
+
},
|
|
10621
|
+
{
|
|
10622
|
+
headers: {
|
|
10623
|
+
"DC-SISTEMA": credentialsConfig.applicationsIds
|
|
10624
|
+
}
|
|
10625
|
+
}
|
|
10626
|
+
);
|
|
10627
|
+
return formatAndSetToken(response.data, email, password);
|
|
10628
|
+
} catch (err) {
|
|
10629
|
+
throw err;
|
|
10630
|
+
} finally {
|
|
10631
|
+
setSubmitting(false);
|
|
10632
|
+
}
|
|
10633
|
+
}
|
|
10634
|
+
async function alterarSenha(senhaAtual, senhaNova, email) {
|
|
10635
|
+
const headers = {};
|
|
10636
|
+
const token2 = getToken();
|
|
10637
|
+
if (!email && token2) {
|
|
10638
|
+
headers.Authorization = `Bearer ${token2}`;
|
|
10639
|
+
}
|
|
10640
|
+
setSubmitting(true);
|
|
10641
|
+
try {
|
|
10642
|
+
const response = await axios2.put(
|
|
10643
|
+
"passwords/change",
|
|
10644
|
+
{
|
|
10645
|
+
old: senhaAtual,
|
|
10646
|
+
new: senhaNova,
|
|
10647
|
+
email
|
|
10648
|
+
},
|
|
10649
|
+
{
|
|
10650
|
+
headers
|
|
10651
|
+
}
|
|
10652
|
+
);
|
|
10653
|
+
return _optionalChain([response, 'optionalAccess', _85 => _85.data]);
|
|
10654
|
+
} catch (err) {
|
|
10655
|
+
throw err;
|
|
10656
|
+
} finally {
|
|
10657
|
+
setSubmitting(false);
|
|
10658
|
+
}
|
|
10659
|
+
}
|
|
10660
|
+
async function selecionarLicenca(loginToken, empresaId) {
|
|
10661
|
+
if (!loginToken) {
|
|
10662
|
+
throw new Error("As informa\xE7\xF5es de login foram perdidas");
|
|
10663
|
+
}
|
|
10664
|
+
setSubmitting(true);
|
|
10665
|
+
try {
|
|
10666
|
+
const response = await axios2.post(
|
|
10667
|
+
"selecionar-empresa",
|
|
10668
|
+
{
|
|
10669
|
+
permissao: credentialsConfig.applicationsId,
|
|
10670
|
+
empresaUuid: empresaId
|
|
10671
|
+
},
|
|
10672
|
+
{
|
|
10673
|
+
headers: {
|
|
10674
|
+
Authorization: `Bearer ${loginToken}`
|
|
10675
|
+
}
|
|
10676
|
+
}
|
|
10677
|
+
);
|
|
10678
|
+
if (!response) {
|
|
10679
|
+
throw new Error("Ocorreu um erro ao tentar selecionar a licen\xE7a");
|
|
10680
|
+
}
|
|
10681
|
+
const { token: token2, refreshToken: refreshToken2 } = response.data;
|
|
10682
|
+
setToken(token2, refreshToken2);
|
|
10683
|
+
return response.data;
|
|
10684
|
+
} catch (err) {
|
|
10685
|
+
throw err;
|
|
10686
|
+
} finally {
|
|
10687
|
+
setSubmitting(false);
|
|
10688
|
+
}
|
|
10689
|
+
}
|
|
10690
|
+
async function recuperarSenha(email) {
|
|
10691
|
+
const response = await axios2.put("/passwords/recover", { email });
|
|
10692
|
+
return response;
|
|
10693
|
+
}
|
|
10694
|
+
async function refreshAccessToken() {
|
|
10695
|
+
const token2 = getToken();
|
|
10696
|
+
const refreshToken2 = getRefreshToken();
|
|
10697
|
+
const response = await axios2.post("refresh-token", {
|
|
10698
|
+
token: token2,
|
|
10699
|
+
refreshToken: refreshToken2
|
|
10700
|
+
});
|
|
10701
|
+
setToken(response.data.token, response.data.refreshToken);
|
|
10702
|
+
return response.data.token;
|
|
10703
|
+
}
|
|
10704
|
+
async function obterUsuarioLogado() {
|
|
10705
|
+
const response = await axios2.get("/api/usuario");
|
|
10706
|
+
return response.data;
|
|
10707
|
+
}
|
|
10708
|
+
function base64ToBlob(base64) {
|
|
10709
|
+
const [prefix2, data] = base64.split(",");
|
|
10710
|
+
const mime = _optionalChain([prefix2, 'access', _86 => _86.match, 'call', _87 => _87(/:(.*?);/), 'optionalAccess', _88 => _88[1]]) || "image/jpeg";
|
|
10711
|
+
const binary = atob(data);
|
|
10712
|
+
const array2 = new Uint8Array(binary.length);
|
|
10713
|
+
for (let i = 0; i < binary.length; i++) {
|
|
10714
|
+
array2[i] = binary.charCodeAt(i);
|
|
10715
|
+
}
|
|
10716
|
+
return new Blob([array2], { type: mime });
|
|
10717
|
+
}
|
|
10718
|
+
async function uploadAvatar(base64Image) {
|
|
10719
|
+
try {
|
|
10720
|
+
const blob = base64ToBlob(base64Image);
|
|
10721
|
+
const file = new File([blob], "avatar.jpg", { type: blob.type });
|
|
10722
|
+
const formData = new FormData();
|
|
10723
|
+
formData.append("avatar", file);
|
|
10724
|
+
const response = await axios2.post(
|
|
10725
|
+
"/api/usuario/avatar",
|
|
10726
|
+
formData,
|
|
10727
|
+
{
|
|
10728
|
+
headers: {
|
|
10729
|
+
"Content-Type": "multipart/form-data"
|
|
10730
|
+
}
|
|
10731
|
+
}
|
|
10732
|
+
);
|
|
10733
|
+
return response.data;
|
|
10734
|
+
} catch (error) {
|
|
10735
|
+
throw error;
|
|
10736
|
+
}
|
|
10737
|
+
}
|
|
10738
|
+
async function atualizarUsuario(data) {
|
|
10739
|
+
const response = await axios2.put("/api/usuario", data);
|
|
10740
|
+
return response.data;
|
|
10741
|
+
}
|
|
10742
|
+
async function gerarWhatsappVerificationCode() {
|
|
10743
|
+
const response = await axios2.post(
|
|
10744
|
+
"/api/usuario/gerar-codigo-validacao-whatsapp"
|
|
10745
|
+
);
|
|
10746
|
+
return response.data;
|
|
10747
|
+
}
|
|
10748
|
+
async function gerarOtpVerificationCode(data) {
|
|
10749
|
+
const response = await axios2.post("/otp/generate", data);
|
|
10750
|
+
return response.data;
|
|
10751
|
+
}
|
|
10752
|
+
async function validarOtpVerificationCode(data) {
|
|
10753
|
+
const response = await axios2.post("/otp/verify", data, {
|
|
10754
|
+
headers: {
|
|
10755
|
+
"DC-SISTEMA": credentialsConfig.applicationsIds
|
|
10756
|
+
}
|
|
10757
|
+
});
|
|
10758
|
+
return formatAndSetToken(response.data, data.target);
|
|
10759
|
+
}
|
|
10760
|
+
async function validarCodigoWhatsapp(codigoVerificacao) {
|
|
10761
|
+
const response = await axios2.post(
|
|
10762
|
+
"/api/usuario/validar-codigo-whatsapp",
|
|
10763
|
+
{
|
|
10764
|
+
codigoVerificacao
|
|
10765
|
+
},
|
|
10766
|
+
{
|
|
10767
|
+
headers: {
|
|
10768
|
+
"DC-SISTEMA": credentialsConfig.applicationsIds
|
|
10769
|
+
}
|
|
10770
|
+
}
|
|
10771
|
+
);
|
|
10772
|
+
return response.data;
|
|
10773
|
+
}
|
|
10436
10774
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
10437
10775
|
CredentialsContext.Provider,
|
|
10438
10776
|
{
|
|
10439
|
-
value:
|
|
10777
|
+
value: {
|
|
10778
|
+
login,
|
|
10779
|
+
logout,
|
|
10780
|
+
isSubmitting,
|
|
10781
|
+
token,
|
|
10782
|
+
refreshToken,
|
|
10783
|
+
userLogged,
|
|
10784
|
+
isAuthenticated,
|
|
10785
|
+
selecionarLicenca,
|
|
10786
|
+
alterarSenha,
|
|
10787
|
+
recuperarSenha,
|
|
10788
|
+
refreshAccessToken,
|
|
10789
|
+
obterUsuarioLogado,
|
|
10790
|
+
uploadAvatar,
|
|
10791
|
+
atualizarUsuario,
|
|
10792
|
+
gerarWhatsappVerificationCode,
|
|
10793
|
+
validarCodigoWhatsapp,
|
|
10794
|
+
gerarOtpVerificationCode,
|
|
10795
|
+
validarOtpVerificationCode
|
|
10796
|
+
},
|
|
10440
10797
|
children
|
|
10441
10798
|
}
|
|
10442
10799
|
);
|
|
@@ -10472,7 +10829,7 @@ function EsqueciSenhaForm(props) {
|
|
|
10472
10829
|
await recuperarSenha(email);
|
|
10473
10830
|
setSucessoRecuperarSenha(true);
|
|
10474
10831
|
} catch (error2) {
|
|
10475
|
-
setError(_optionalChain([error2, 'access',
|
|
10832
|
+
setError(_optionalChain([error2, 'access', _89 => _89.response, 'optionalAccess', _90 => _90.data, 'access', _91 => _91.message]));
|
|
10476
10833
|
} finally {
|
|
10477
10834
|
setSubmitting(false);
|
|
10478
10835
|
}
|
|
@@ -10595,14 +10952,14 @@ function LicencaForm(props) {
|
|
|
10595
10952
|
const [empresaId, setEmpresaId] = _react.useState.call(void 0, "");
|
|
10596
10953
|
const { selecionarLicenca, isSubmitting } = useCredentialsContext();
|
|
10597
10954
|
_react.useEffect.call(void 0, () => {
|
|
10598
|
-
if (Array.isArray(_optionalChain([loginData, 'optionalAccess',
|
|
10599
|
-
const empresa = _optionalChain([loginData, 'optionalAccess',
|
|
10600
|
-
setEmpresaId(_optionalChain([empresa, 'optionalAccess',
|
|
10955
|
+
if (Array.isArray(_optionalChain([loginData, 'optionalAccess', _92 => _92.empresas]))) {
|
|
10956
|
+
const empresa = _optionalChain([loginData, 'optionalAccess', _93 => _93.empresas, 'access', _94 => _94[0]]);
|
|
10957
|
+
setEmpresaId(_optionalChain([empresa, 'optionalAccess', _95 => _95.uuid]));
|
|
10601
10958
|
}
|
|
10602
10959
|
}, [loginData]);
|
|
10603
10960
|
async function handleSelecionarLicenca() {
|
|
10604
10961
|
try {
|
|
10605
|
-
const tokens = await selecionarLicenca(_optionalChain([loginData, 'optionalAccess',
|
|
10962
|
+
const tokens = await selecionarLicenca(_optionalChain([loginData, 'optionalAccess', _96 => _96.token]), empresaId);
|
|
10606
10963
|
if (tokens) {
|
|
10607
10964
|
onLoginSuccess(tokens);
|
|
10608
10965
|
} else {
|
|
@@ -10624,7 +10981,7 @@ function LicencaForm(props) {
|
|
|
10624
10981
|
onChange: (e) => {
|
|
10625
10982
|
setEmpresaId(e.target.value);
|
|
10626
10983
|
},
|
|
10627
|
-
children: _optionalChain([loginData, 'optionalAccess',
|
|
10984
|
+
children: _optionalChain([loginData, 'optionalAccess', _97 => _97.empresas, 'optionalAccess', _98 => _98.map, 'call', _99 => _99((empresa) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.MenuItem, { value: empresa.uuid, children: empresa.nome }, empresa.uuid))])
|
|
10628
10985
|
}
|
|
10629
10986
|
),
|
|
10630
10987
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -10760,7 +11117,7 @@ function AlterarSenhaV2(props) {
|
|
|
10760
11117
|
if (onFailed)
|
|
10761
11118
|
onFailed(error2);
|
|
10762
11119
|
if (_axios.isAxiosError.call(void 0, error2)) {
|
|
10763
|
-
setError(_optionalChain([error2, 'access',
|
|
11120
|
+
setError(_optionalChain([error2, 'access', _100 => _100.response, 'optionalAccess', _101 => _101.data, 'access', _102 => _102.message]));
|
|
10764
11121
|
return;
|
|
10765
11122
|
}
|
|
10766
11123
|
setError("Ocorreu um erro ao tentar alterar a senha");
|
|
@@ -10772,40 +11129,40 @@ function AlterarSenhaV2(props) {
|
|
|
10772
11129
|
});
|
|
10773
11130
|
}
|
|
10774
11131
|
function tem8caracteres() {
|
|
10775
|
-
return _optionalChain([data, 'optionalAccess',
|
|
11132
|
+
return _optionalChain([data, 'optionalAccess', _103 => _103.senhaNova, 'access', _104 => _104.length]) >= 8;
|
|
10776
11133
|
}
|
|
10777
11134
|
function temLetraMinuscula() {
|
|
10778
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
10779
|
-
const result = _optionalChain([data, 'optionalAccess',
|
|
11135
|
+
if (_optionalChain([data, 'optionalAccess', _105 => _105.senhaNova])) {
|
|
11136
|
+
const result = _optionalChain([data, 'optionalAccess', _106 => _106.senhaNova, 'access', _107 => _107.match, 'call', _108 => _108(/[a-z]/g)]);
|
|
10780
11137
|
return Array.isArray(result) && result.length > 0;
|
|
10781
11138
|
}
|
|
10782
11139
|
return false;
|
|
10783
11140
|
}
|
|
10784
11141
|
function temLetraMaisucula() {
|
|
10785
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
10786
|
-
const result = _optionalChain([data, 'optionalAccess',
|
|
11142
|
+
if (_optionalChain([data, 'optionalAccess', _109 => _109.senhaNova])) {
|
|
11143
|
+
const result = _optionalChain([data, 'optionalAccess', _110 => _110.senhaNova, 'access', _111 => _111.match, 'call', _112 => _112(/[A-Z]/g)]);
|
|
10787
11144
|
return Array.isArray(result) && result.length > 0;
|
|
10788
11145
|
}
|
|
10789
11146
|
return false;
|
|
10790
11147
|
}
|
|
10791
11148
|
function temNumero() {
|
|
10792
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
10793
|
-
const result = _optionalChain([data, 'optionalAccess',
|
|
11149
|
+
if (_optionalChain([data, 'optionalAccess', _113 => _113.senhaNova])) {
|
|
11150
|
+
const result = _optionalChain([data, 'optionalAccess', _114 => _114.senhaNova, 'access', _115 => _115.match, 'call', _116 => _116(/\d/g)]);
|
|
10794
11151
|
return Array.isArray(result) && result.length > 0;
|
|
10795
11152
|
}
|
|
10796
11153
|
return false;
|
|
10797
11154
|
}
|
|
10798
11155
|
function temCaracterEspecial() {
|
|
10799
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
10800
|
-
const result = _optionalChain([data, 'optionalAccess',
|
|
11156
|
+
if (_optionalChain([data, 'optionalAccess', _117 => _117.senhaNova])) {
|
|
11157
|
+
const result = _optionalChain([data, 'optionalAccess', _118 => _118.senhaNova, 'access', _119 => _119.match, 'call', _120 => _120(/\W/g)]);
|
|
10801
11158
|
return Array.isArray(result) && result.length > 0;
|
|
10802
11159
|
}
|
|
10803
11160
|
return false;
|
|
10804
11161
|
}
|
|
10805
11162
|
function asSenhasSaoIguais() {
|
|
10806
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
11163
|
+
if (_optionalChain([data, 'optionalAccess', _121 => _121.senhaNova]) === "")
|
|
10807
11164
|
return false;
|
|
10808
|
-
return _optionalChain([data, 'optionalAccess',
|
|
11165
|
+
return _optionalChain([data, 'optionalAccess', _122 => _122.senhaNova]) === _optionalChain([data, 'optionalAccess', _123 => _123.senhaNovaConfirmar]);
|
|
10809
11166
|
}
|
|
10810
11167
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Dialog_default.Root, { open: isOpen, onClose: (_) => onClose(), maxWidth: "md", children: [
|
|
10811
11168
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Dialog_default.Header, { children: [
|
|
@@ -10824,7 +11181,7 @@ function AlterarSenhaV2(props) {
|
|
|
10824
11181
|
{
|
|
10825
11182
|
name: "senhaAtual",
|
|
10826
11183
|
label: "Senha Atual",
|
|
10827
|
-
value: _optionalChain([data, 'optionalAccess',
|
|
11184
|
+
value: _optionalChain([data, 'optionalAccess', _124 => _124.senhaAtual]) || "",
|
|
10828
11185
|
onChange: handleChange,
|
|
10829
11186
|
...validationProps("senhaAtual")
|
|
10830
11187
|
}
|
|
@@ -10846,7 +11203,7 @@ function AlterarSenhaV2(props) {
|
|
|
10846
11203
|
{
|
|
10847
11204
|
name: "senhaNova",
|
|
10848
11205
|
label: "Nova Senha",
|
|
10849
|
-
value: _optionalChain([data, 'optionalAccess',
|
|
11206
|
+
value: _optionalChain([data, 'optionalAccess', _125 => _125.senhaNova]) || "",
|
|
10850
11207
|
onChange: handleChange,
|
|
10851
11208
|
...validationProps("senhaNova")
|
|
10852
11209
|
}
|
|
@@ -10857,7 +11214,7 @@ function AlterarSenhaV2(props) {
|
|
|
10857
11214
|
{
|
|
10858
11215
|
name: "senhaNovaConfirmar",
|
|
10859
11216
|
label: "Confirmar Nova Senha",
|
|
10860
|
-
value: _optionalChain([data, 'optionalAccess',
|
|
11217
|
+
value: _optionalChain([data, 'optionalAccess', _126 => _126.senhaNovaConfirmar]) || "",
|
|
10861
11218
|
onChange: handleChange,
|
|
10862
11219
|
...validationProps("senhaNovaConfirmar")
|
|
10863
11220
|
}
|
|
@@ -10963,11 +11320,11 @@ function LoginForm(props) {
|
|
|
10963
11320
|
} catch (err) {
|
|
10964
11321
|
if (_axios.isAxiosError.call(void 0, err)) {
|
|
10965
11322
|
const axiosError = err;
|
|
10966
|
-
if (_optionalChain([axiosError, 'access',
|
|
11323
|
+
if (_optionalChain([axiosError, 'access', _127 => _127.response, 'optionalAccess', _128 => _128.data, 'access', _129 => _129.code]) === "E_FIRST_ACCESS") {
|
|
10967
11324
|
setExibirAlterarSenha(true);
|
|
10968
11325
|
return;
|
|
10969
11326
|
}
|
|
10970
|
-
setError(_optionalChain([err, 'access',
|
|
11327
|
+
setError(_optionalChain([err, 'access', _130 => _130.response, 'optionalAccess', _131 => _131.data, 'access', _132 => _132.message]));
|
|
10971
11328
|
}
|
|
10972
11329
|
onLoginFailed(err);
|
|
10973
11330
|
}
|
|
@@ -11184,12 +11541,12 @@ function VerificationCodeInput({
|
|
|
11184
11541
|
const updatedValue = nextValue.join("");
|
|
11185
11542
|
onChange(updatedValue);
|
|
11186
11543
|
if (cleanDigit && index < length - 1) {
|
|
11187
|
-
_optionalChain([inputsRef, 'access',
|
|
11544
|
+
_optionalChain([inputsRef, 'access', _133 => _133.current, 'access', _134 => _134[index + 1], 'optionalAccess', _135 => _135.focus, 'call', _136 => _136()]);
|
|
11188
11545
|
}
|
|
11189
11546
|
};
|
|
11190
11547
|
const handleKeyDown = (index, event) => {
|
|
11191
11548
|
if (event.key === "Backspace" && !value[index] && index > 0) {
|
|
11192
|
-
_optionalChain([inputsRef, 'access',
|
|
11549
|
+
_optionalChain([inputsRef, 'access', _137 => _137.current, 'access', _138 => _138[index - 1], 'optionalAccess', _139 => _139.focus, 'call', _140 => _140()]);
|
|
11193
11550
|
}
|
|
11194
11551
|
};
|
|
11195
11552
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Box, { display: "flex", gap: 1, children: Array.from({ length }).map((_, i) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -11459,10 +11816,10 @@ function LoginSection(props) {
|
|
|
11459
11816
|
}, [isAuthenticated]);
|
|
11460
11817
|
async function handleLoginSuccess(_loginData) {
|
|
11461
11818
|
try {
|
|
11462
|
-
if (Array.isArray(_optionalChain([_loginData, 'optionalAccess',
|
|
11463
|
-
if (_optionalChain([_loginData, 'optionalAccess',
|
|
11819
|
+
if (Array.isArray(_optionalChain([_loginData, 'optionalAccess', _141 => _141.empresas]))) {
|
|
11820
|
+
if (_optionalChain([_loginData, 'optionalAccess', _142 => _142.empresas, 'access', _143 => _143.length]) === 1) {
|
|
11464
11821
|
const tokens = await selecionarLicenca(
|
|
11465
|
-
_optionalChain([_loginData, 'optionalAccess',
|
|
11822
|
+
_optionalChain([_loginData, 'optionalAccess', _144 => _144.token]),
|
|
11466
11823
|
_loginData.empresas[0].uuid
|
|
11467
11824
|
);
|
|
11468
11825
|
if (tokens) {
|
|
@@ -11715,7 +12072,7 @@ function AlterarSenha(props) {
|
|
|
11715
12072
|
if (onFailed)
|
|
11716
12073
|
onFailed(error2);
|
|
11717
12074
|
if (_axios.isAxiosError.call(void 0, error2)) {
|
|
11718
|
-
setError(_optionalChain([error2, 'access',
|
|
12075
|
+
setError(_optionalChain([error2, 'access', _145 => _145.response, 'optionalAccess', _146 => _146.data, 'access', _147 => _147.message]));
|
|
11719
12076
|
return;
|
|
11720
12077
|
}
|
|
11721
12078
|
setError("Ocorreu um erro ao tentar alterar a senha");
|
|
@@ -11727,40 +12084,40 @@ function AlterarSenha(props) {
|
|
|
11727
12084
|
});
|
|
11728
12085
|
}
|
|
11729
12086
|
function tem8caracteres() {
|
|
11730
|
-
return _optionalChain([data, 'optionalAccess',
|
|
12087
|
+
return _optionalChain([data, 'optionalAccess', _148 => _148.senhaNova, 'access', _149 => _149.length]) >= 8;
|
|
11731
12088
|
}
|
|
11732
12089
|
function temLetraMinuscula() {
|
|
11733
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
11734
|
-
const result = _optionalChain([data, 'optionalAccess',
|
|
12090
|
+
if (_optionalChain([data, 'optionalAccess', _150 => _150.senhaNova])) {
|
|
12091
|
+
const result = _optionalChain([data, 'optionalAccess', _151 => _151.senhaNova, 'access', _152 => _152.match, 'call', _153 => _153(/[a-z]/g)]);
|
|
11735
12092
|
return Array.isArray(result) && result.length > 0;
|
|
11736
12093
|
}
|
|
11737
12094
|
return false;
|
|
11738
12095
|
}
|
|
11739
12096
|
function temLetraMaisucula() {
|
|
11740
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
11741
|
-
const result = _optionalChain([data, 'optionalAccess',
|
|
12097
|
+
if (_optionalChain([data, 'optionalAccess', _154 => _154.senhaNova])) {
|
|
12098
|
+
const result = _optionalChain([data, 'optionalAccess', _155 => _155.senhaNova, 'access', _156 => _156.match, 'call', _157 => _157(/[A-Z]/g)]);
|
|
11742
12099
|
return Array.isArray(result) && result.length > 0;
|
|
11743
12100
|
}
|
|
11744
12101
|
return false;
|
|
11745
12102
|
}
|
|
11746
12103
|
function temNumero() {
|
|
11747
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
11748
|
-
const result = _optionalChain([data, 'optionalAccess',
|
|
12104
|
+
if (_optionalChain([data, 'optionalAccess', _158 => _158.senhaNova])) {
|
|
12105
|
+
const result = _optionalChain([data, 'optionalAccess', _159 => _159.senhaNova, 'access', _160 => _160.match, 'call', _161 => _161(/\d/g)]);
|
|
11749
12106
|
return Array.isArray(result) && result.length > 0;
|
|
11750
12107
|
}
|
|
11751
12108
|
return false;
|
|
11752
12109
|
}
|
|
11753
12110
|
function temCaracterEspecial() {
|
|
11754
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
11755
|
-
const result = _optionalChain([data, 'optionalAccess',
|
|
12111
|
+
if (_optionalChain([data, 'optionalAccess', _162 => _162.senhaNova])) {
|
|
12112
|
+
const result = _optionalChain([data, 'optionalAccess', _163 => _163.senhaNova, 'access', _164 => _164.match, 'call', _165 => _165(/\W/g)]);
|
|
11756
12113
|
return Array.isArray(result) && result.length > 0;
|
|
11757
12114
|
}
|
|
11758
12115
|
return false;
|
|
11759
12116
|
}
|
|
11760
12117
|
function asSenhasSaoIguais() {
|
|
11761
|
-
if (_optionalChain([data, 'optionalAccess',
|
|
12118
|
+
if (_optionalChain([data, 'optionalAccess', _166 => _166.senhaNova]) === "")
|
|
11762
12119
|
return false;
|
|
11763
|
-
return _optionalChain([data, 'optionalAccess',
|
|
12120
|
+
return _optionalChain([data, 'optionalAccess', _167 => _167.senhaNova]) === _optionalChain([data, 'optionalAccess', _168 => _168.senhaNovaConfirmar]);
|
|
11764
12121
|
}
|
|
11765
12122
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Dialog_default.Root, { open: isOpen, onClose: (_) => onClose(), maxWidth: "md", children: [
|
|
11766
12123
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, Dialog_default.Header, { children: [
|
|
@@ -11779,7 +12136,7 @@ function AlterarSenha(props) {
|
|
|
11779
12136
|
{
|
|
11780
12137
|
name: "senhaAtual",
|
|
11781
12138
|
label: "Senha Atual",
|
|
11782
|
-
value: _optionalChain([data, 'optionalAccess',
|
|
12139
|
+
value: _optionalChain([data, 'optionalAccess', _169 => _169.senhaAtual]) || "",
|
|
11783
12140
|
onChange: handleChange,
|
|
11784
12141
|
...validationProps("senhaAtual")
|
|
11785
12142
|
}
|
|
@@ -11801,7 +12158,7 @@ function AlterarSenha(props) {
|
|
|
11801
12158
|
{
|
|
11802
12159
|
name: "senhaNova",
|
|
11803
12160
|
label: "Nova Senha",
|
|
11804
|
-
value: _optionalChain([data, 'optionalAccess',
|
|
12161
|
+
value: _optionalChain([data, 'optionalAccess', _170 => _170.senhaNova]) || "",
|
|
11805
12162
|
onChange: handleChange,
|
|
11806
12163
|
...validationProps("senhaNova")
|
|
11807
12164
|
}
|
|
@@ -11812,7 +12169,7 @@ function AlterarSenha(props) {
|
|
|
11812
12169
|
{
|
|
11813
12170
|
name: "senhaNovaConfirmar",
|
|
11814
12171
|
label: "Confirmar Nova Senha",
|
|
11815
|
-
value: _optionalChain([data, 'optionalAccess',
|
|
12172
|
+
value: _optionalChain([data, 'optionalAccess', _171 => _171.senhaNovaConfirmar]) || "",
|
|
11816
12173
|
onChange: handleChange,
|
|
11817
12174
|
...validationProps("senhaNovaConfirmar")
|
|
11818
12175
|
}
|
|
@@ -11918,11 +12275,11 @@ function LoginForm2(props) {
|
|
|
11918
12275
|
} catch (err) {
|
|
11919
12276
|
if (_axios.isAxiosError.call(void 0, err)) {
|
|
11920
12277
|
const axiosError = err;
|
|
11921
|
-
if (_optionalChain([axiosError, 'access',
|
|
12278
|
+
if (_optionalChain([axiosError, 'access', _172 => _172.response, 'optionalAccess', _173 => _173.data, 'access', _174 => _174.code]) === "E_FIRST_ACCESS") {
|
|
11922
12279
|
setExibirAlterarSenha(true);
|
|
11923
12280
|
return;
|
|
11924
12281
|
}
|
|
11925
|
-
setError(_optionalChain([err, 'access',
|
|
12282
|
+
setError(_optionalChain([err, 'access', _175 => _175.response, 'optionalAccess', _176 => _176.data, 'access', _177 => _177.message]));
|
|
11926
12283
|
}
|
|
11927
12284
|
onLoginFailed(err);
|
|
11928
12285
|
}
|
|
@@ -12082,7 +12439,7 @@ function EsqueciSenhaForm2(props) {
|
|
|
12082
12439
|
await recuperarSenha(email);
|
|
12083
12440
|
setSucessoRecuperarSenha(true);
|
|
12084
12441
|
} catch (error2) {
|
|
12085
|
-
setError(_optionalChain([error2, 'access',
|
|
12442
|
+
setError(_optionalChain([error2, 'access', _178 => _178.response, 'optionalAccess', _179 => _179.data, 'access', _180 => _180.message]));
|
|
12086
12443
|
} finally {
|
|
12087
12444
|
setSubmitting(false);
|
|
12088
12445
|
}
|
|
@@ -12174,14 +12531,14 @@ function LicencaForm2(props) {
|
|
|
12174
12531
|
const [empresaId, setEmpresaId] = _react.useState.call(void 0, "");
|
|
12175
12532
|
const { selecionarLicenca, isSubmitting } = _hooks.useCredentials.call(void 0, credentialsConfig);
|
|
12176
12533
|
_react.useEffect.call(void 0, () => {
|
|
12177
|
-
if (Array.isArray(_optionalChain([loginData, 'optionalAccess',
|
|
12178
|
-
const empresa = _optionalChain([loginData, 'optionalAccess',
|
|
12179
|
-
setEmpresaId(_optionalChain([empresa, 'optionalAccess',
|
|
12534
|
+
if (Array.isArray(_optionalChain([loginData, 'optionalAccess', _181 => _181.empresas]))) {
|
|
12535
|
+
const empresa = _optionalChain([loginData, 'optionalAccess', _182 => _182.empresas, 'access', _183 => _183[0]]);
|
|
12536
|
+
setEmpresaId(_optionalChain([empresa, 'optionalAccess', _184 => _184.uuid]));
|
|
12180
12537
|
}
|
|
12181
12538
|
}, [loginData]);
|
|
12182
12539
|
async function handleSelecionarLicenca() {
|
|
12183
12540
|
try {
|
|
12184
|
-
const tokens = await selecionarLicenca(_optionalChain([loginData, 'optionalAccess',
|
|
12541
|
+
const tokens = await selecionarLicenca(_optionalChain([loginData, 'optionalAccess', _185 => _185.token]), empresaId);
|
|
12185
12542
|
if (tokens) {
|
|
12186
12543
|
onLoginSuccess(tokens);
|
|
12187
12544
|
} else {
|
|
@@ -12203,7 +12560,7 @@ function LicencaForm2(props) {
|
|
|
12203
12560
|
onChange: (e) => {
|
|
12204
12561
|
setEmpresaId(e.target.value);
|
|
12205
12562
|
},
|
|
12206
|
-
children: _optionalChain([loginData, 'optionalAccess',
|
|
12563
|
+
children: _optionalChain([loginData, 'optionalAccess', _186 => _186.empresas, 'optionalAccess', _187 => _187.map, 'call', _188 => _188((empresa) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.MenuItem, { value: empresa.uuid, children: empresa.nome }, empresa.uuid))])
|
|
12207
12564
|
}
|
|
12208
12565
|
),
|
|
12209
12566
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -12490,10 +12847,10 @@ function LoginSection2(props) {
|
|
|
12490
12847
|
}, [isAuthenticated]);
|
|
12491
12848
|
async function handleLoginSuccess(_loginData) {
|
|
12492
12849
|
try {
|
|
12493
|
-
if (Array.isArray(_optionalChain([_loginData, 'optionalAccess',
|
|
12494
|
-
if (_optionalChain([_loginData, 'optionalAccess',
|
|
12850
|
+
if (Array.isArray(_optionalChain([_loginData, 'optionalAccess', _189 => _189.empresas]))) {
|
|
12851
|
+
if (_optionalChain([_loginData, 'optionalAccess', _190 => _190.empresas, 'access', _191 => _191.length]) === 1) {
|
|
12495
12852
|
const tokens = await selecionarLicenca(
|
|
12496
|
-
_optionalChain([_loginData, 'optionalAccess',
|
|
12853
|
+
_optionalChain([_loginData, 'optionalAccess', _192 => _192.token]),
|
|
12497
12854
|
_loginData.empresas[0].uuid
|
|
12498
12855
|
);
|
|
12499
12856
|
if (tokens) {
|
|
@@ -12862,7 +13219,7 @@ function FullMenuItem2(props) {
|
|
|
12862
13219
|
if (!menuItem.visible)
|
|
12863
13220
|
return null;
|
|
12864
13221
|
const isExpandable = Boolean(
|
|
12865
|
-
_optionalChain([menuItem, 'optionalAccess',
|
|
13222
|
+
_optionalChain([menuItem, 'optionalAccess', _193 => _193.items]) && _optionalChain([menuItem, 'optionalAccess', _194 => _194.items, 'access', _195 => _195.length]) > 0
|
|
12866
13223
|
);
|
|
12867
13224
|
function toggleExpand() {
|
|
12868
13225
|
setExpanded(!expanded);
|
|
@@ -12872,7 +13229,7 @@ function FullMenuItem2(props) {
|
|
|
12872
13229
|
MenuItem_default,
|
|
12873
13230
|
{
|
|
12874
13231
|
onClick: () => {
|
|
12875
|
-
if (_optionalChain([menuItem, 'optionalAccess',
|
|
13232
|
+
if (_optionalChain([menuItem, 'optionalAccess', _196 => _196.link])) {
|
|
12876
13233
|
onMenuClick(menuItem.link);
|
|
12877
13234
|
return;
|
|
12878
13235
|
}
|
|
@@ -12887,14 +13244,14 @@ function FullMenuItem2(props) {
|
|
|
12887
13244
|
]
|
|
12888
13245
|
}
|
|
12889
13246
|
),
|
|
12890
|
-
_optionalChain([menuItem, 'optionalAccess',
|
|
13247
|
+
_optionalChain([menuItem, 'optionalAccess', _197 => _197.items]) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Collapse, { in: expanded, timeout: "auto", unmountOnExit: true, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
12891
13248
|
FullMenu,
|
|
12892
13249
|
{
|
|
12893
13250
|
activeMenu,
|
|
12894
13251
|
sx: {
|
|
12895
13252
|
pl: (theme2) => theme2.spacing(1.5)
|
|
12896
13253
|
},
|
|
12897
|
-
menus: _optionalChain([menuItem, 'optionalAccess',
|
|
13254
|
+
menus: _optionalChain([menuItem, 'optionalAccess', _198 => _198.items]) || [],
|
|
12898
13255
|
onMenuClick
|
|
12899
13256
|
}
|
|
12900
13257
|
) })
|
|
@@ -12942,38 +13299,38 @@ function MinMenu(props) {
|
|
|
12942
13299
|
MenuItem_default,
|
|
12943
13300
|
{
|
|
12944
13301
|
onMouseEnter: (e) => {
|
|
12945
|
-
if (!_optionalChain([menuItem, 'optionalAccess',
|
|
13302
|
+
if (!_optionalChain([menuItem, 'optionalAccess', _199 => _199.link])) {
|
|
12946
13303
|
handleOpen(e, menuItem.id, menuItem.items);
|
|
12947
13304
|
}
|
|
12948
13305
|
},
|
|
12949
13306
|
onMouseLeave: () => {
|
|
12950
|
-
if (!_optionalChain([menuItem, 'optionalAccess',
|
|
13307
|
+
if (!_optionalChain([menuItem, 'optionalAccess', _200 => _200.link])) {
|
|
12951
13308
|
handleClose();
|
|
12952
13309
|
}
|
|
12953
13310
|
},
|
|
12954
13311
|
onClick: () => {
|
|
12955
|
-
if (_optionalChain([menuItem, 'optionalAccess',
|
|
13312
|
+
if (_optionalChain([menuItem, 'optionalAccess', _201 => _201.link])) {
|
|
12956
13313
|
onMenuClick(menuItem.link);
|
|
12957
13314
|
}
|
|
12958
13315
|
},
|
|
12959
13316
|
selected: activeMenu === menuItem.link,
|
|
12960
13317
|
children: [
|
|
12961
13318
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.ListItemIcon, { children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Icon, { children: menuItem.icon }) }),
|
|
12962
|
-
_optionalChain([opened, 'optionalAccess',
|
|
13319
|
+
_optionalChain([opened, 'optionalAccess', _202 => _202.id]) === menuItem.id && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
12963
13320
|
_material.Popper,
|
|
12964
13321
|
{
|
|
12965
13322
|
sx: {
|
|
12966
13323
|
zIndex: 999999
|
|
12967
13324
|
},
|
|
12968
|
-
anchorEl: _optionalChain([opened, 'optionalAccess',
|
|
12969
|
-
open: Boolean(_optionalChain([opened, 'optionalAccess',
|
|
13325
|
+
anchorEl: _optionalChain([opened, 'optionalAccess', _203 => _203.element]),
|
|
13326
|
+
open: Boolean(_optionalChain([opened, 'optionalAccess', _204 => _204.element])),
|
|
12970
13327
|
placement: "right-start",
|
|
12971
13328
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
12972
13329
|
FullMenu,
|
|
12973
13330
|
{
|
|
12974
13331
|
activeMenu,
|
|
12975
13332
|
onMenuClick,
|
|
12976
|
-
menus: _optionalChain([menuItem, 'optionalAccess',
|
|
13333
|
+
menus: _optionalChain([menuItem, 'optionalAccess', _205 => _205.items]) || [],
|
|
12977
13334
|
sx: {
|
|
12978
13335
|
minWidth: "240px",
|
|
12979
13336
|
backgroundColor: theme_default.palette.background.paper,
|
|
@@ -13090,7 +13447,7 @@ function Avatar(props) {
|
|
|
13090
13447
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
13091
13448
|
_Avatar2.default,
|
|
13092
13449
|
{
|
|
13093
|
-
src: _optionalChain([user, 'optionalAccess',
|
|
13450
|
+
src: _optionalChain([user, 'optionalAccess', _206 => _206.avatarUrl]),
|
|
13094
13451
|
sx: { width: 64, height: 64, margin: "auto", mb: 2 },
|
|
13095
13452
|
...props
|
|
13096
13453
|
}
|
|
@@ -13201,7 +13558,7 @@ var AvatarUploader = ({ onSave, src }) => {
|
|
|
13201
13558
|
}
|
|
13202
13559
|
};
|
|
13203
13560
|
const handleFileChange = (event) => {
|
|
13204
|
-
const file = _optionalChain([event, 'access',
|
|
13561
|
+
const file = _optionalChain([event, 'access', _207 => _207.target, 'access', _208 => _208.files, 'optionalAccess', _209 => _209[0]]);
|
|
13205
13562
|
if (!file)
|
|
13206
13563
|
return;
|
|
13207
13564
|
const reader = new FileReader();
|
|
@@ -13330,7 +13687,7 @@ function MinhaConta(props) {
|
|
|
13330
13687
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
13331
13688
|
AvatarUploader_default,
|
|
13332
13689
|
{
|
|
13333
|
-
src: _optionalChain([data, 'optionalAccess',
|
|
13690
|
+
src: _optionalChain([data, 'optionalAccess', _210 => _210.avatarUrl]),
|
|
13334
13691
|
onSave: (croppedImage) => {
|
|
13335
13692
|
try {
|
|
13336
13693
|
uploadAvatar(croppedImage);
|
|
@@ -13356,7 +13713,7 @@ function MinhaConta(props) {
|
|
|
13356
13713
|
disabled: true,
|
|
13357
13714
|
fullWidth: true,
|
|
13358
13715
|
label: "E-mail",
|
|
13359
|
-
value: _optionalChain([data, 'optionalAccess',
|
|
13716
|
+
value: _optionalChain([data, 'optionalAccess', _211 => _211.email]) || ""
|
|
13360
13717
|
}
|
|
13361
13718
|
) }),
|
|
13362
13719
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _material.Grid, { size: { xl: 4, lg: 4, md: 4, sm: 12, xs: 12 }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
@@ -13365,7 +13722,7 @@ function MinhaConta(props) {
|
|
|
13365
13722
|
name: "name",
|
|
13366
13723
|
fullWidth: true,
|
|
13367
13724
|
label: "Nome",
|
|
13368
|
-
value: _optionalChain([data, 'optionalAccess',
|
|
13725
|
+
value: _optionalChain([data, 'optionalAccess', _212 => _212.name]) || "",
|
|
13369
13726
|
onChange: handleChange,
|
|
13370
13727
|
...validationErrors("name")
|
|
13371
13728
|
}
|
|
@@ -13376,7 +13733,7 @@ function MinhaConta(props) {
|
|
|
13376
13733
|
name: "surname",
|
|
13377
13734
|
fullWidth: true,
|
|
13378
13735
|
label: "Sobrenome",
|
|
13379
|
-
value: _optionalChain([data, 'optionalAccess',
|
|
13736
|
+
value: _optionalChain([data, 'optionalAccess', _213 => _213.surname]) || "",
|
|
13380
13737
|
onChange: handleChange
|
|
13381
13738
|
}
|
|
13382
13739
|
) })
|
|
@@ -13459,7 +13816,7 @@ function DialogVerificarWhastapp(props) {
|
|
|
13459
13816
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _material.Typography, { variant: "body1", sx: { fontSize: "10pt" }, children: [
|
|
13460
13817
|
"Enviamos um c\xF3digo via WhatsApp para +55",
|
|
13461
13818
|
" ",
|
|
13462
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "b", { children: `(${_optionalChain([payload, 'optionalAccess',
|
|
13819
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "b", { children: `(${_optionalChain([payload, 'optionalAccess', _214 => _214.whatsappNumber, 'optionalAccess', _215 => _215.slice, 'call', _216 => _216(0, 2)])}) ${_optionalChain([payload, 'optionalAccess', _217 => _217.whatsappNumber, 'optionalAccess', _218 => _218.slice, 'call', _219 => _219(2, 7)])}-${_optionalChain([payload, 'optionalAccess', _220 => _220.whatsappNumber, 'optionalAccess', _221 => _221.slice, 'call', _222 => _222(7)])}` }),
|
|
13463
13820
|
". ",
|
|
13464
13821
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "br", {}),
|
|
13465
13822
|
"Digite o c\xF3digo abaixo para confirmar que este n\xFAmero \xE9 seu."
|
|
@@ -13559,7 +13916,7 @@ function LoginSeguranca(props) {
|
|
|
13559
13916
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
13560
13917
|
WhatsAppTextField,
|
|
13561
13918
|
{
|
|
13562
|
-
disabled: Boolean(_optionalChain([data, 'optionalAccess',
|
|
13919
|
+
disabled: Boolean(_optionalChain([data, 'optionalAccess', _223 => _223.whatsappVerifiedAt])),
|
|
13563
13920
|
fullWidth: false,
|
|
13564
13921
|
name: "whatsappNumber",
|
|
13565
13922
|
label: "Whastapp",
|