{"version":3,"file":"S_Lite_Logic.CzO2CP1D.mjs","names":[],"sources":["https:/framerusercontent.com/modules/sxqusxdvv3Tm4GW9iOtM/qGT1Zd0YizrLfbV5PWFt/S_Lite_Logic.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{Data}from\"framer\";// 1. O teu armazém original + 1 linha para o controle visual\nconst store=Data({usuario:\"\",senha:\"\",carregando:false,statusVisual:\"default\"});// 2. Input de Usuário (Versão Teste Seguro)\nexport function withUsuario_Teste(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,// INJEÇÃO VISUAL (Mude \"Erro\" e \"Verificando\" para o nome exato das tuas variantes)\nvariant:store.statusVisual===\"verificando\"?\"Verificando\":store.statusVisual===\"erro\"?\"Erro\":\"Default\",value:store.usuario,onChange:e=>{store.usuario=e.target.value;}});};}// 3. Input de Senha (Versão Teste Seguro)\nexport function withSenha_Teste(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,// INJEÇÃO VISUAL\nvariant:store.statusVisual===\"verificando\"?\"Verificando\":store.statusVisual===\"erro\"?\"Erro\":\"Default\",value:store.senha,onChange:e=>{store.senha=e.target.value;}});};}// EXTRA: Bolinha de Status (Versão Teste Seguro)\nexport function withBolinha_Teste(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,variant:store.statusVisual===\"verificando\"?\"Verificando\":store.statusVisual===\"erro\"?\"Erro\":\"Online\"});};}// 4. Botão de Login (Versão Teste Seguro - Tua lógica intocável)\nexport function withBotaoLogin_Teste(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,onTap:async()=>{if(store.carregando)return;if(!store.usuario||!store.senha){alert(\"Por favor, preencha o usu\\xe1rio e a senha.\");store.statusVisual=\"erro\"// Dispara borda vermelha se tiver vazio\n;return;}store.carregando=true;store.statusVisual=\"verificando\"// Dispara visual de carregamento\n;try{const resposta=await fetch(\"https://aged-shadow-47b1.mauro20101214.workers.dev\",{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({usuario:store.usuario,senha:store.senha})});const dados=await resposta.json();if(dados.login===\"ok\"){localStorage.setItem(\"crm_token\",dados.token);localStorage.setItem(\"crm_gestor\",dados.gestor);store.statusVisual=\"default\";window.location.href=\"/dashboard_home\";}else{store.statusVisual=\"erro\"// Dispara borda vermelha se API negar\n;alert(\"Acesso negado: \"+(dados.erro||\"Credenciais inv\\xe1lidas\"));}}catch(erro){store.statusVisual=\"erro\"// Dispara borda vermelha se API cair\n;alert(\"Erro de conex\\xe3o com o servidor. Tente novamente.\");}finally{store.carregando=false;}}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withSenha_Teste\":{\"type\":\"reactHoc\",\"name\":\"withSenha_Teste\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBotaoLogin_Teste\":{\"type\":\"reactHoc\",\"name\":\"withBotaoLogin_Teste\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBolinha_Teste\":{\"type\":\"reactHoc\",\"name\":\"withBolinha_Teste\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withUsuario_Teste\":{\"type\":\"reactHoc\",\"name\":\"withUsuario_Teste\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./S_Lite_Logic.map"],"mappings":"mKAEA,SAAgB,EAAkB,EAAU,CAAC,MAAO,IAA4B,EAAK,EAAU,CAAC,GAAG,EACnG,QAAQ,EAAM,eAAe,cAAc,cAAc,EAAM,eAAe,OAAO,OAAO,UAAU,MAAM,EAAM,QAAQ,SAAS,GAAG,CAAC,EAAM,QAAQ,EAAE,OAAO,OAAQ,CAAC,CACvK,SAAgB,EAAgB,EAAU,CAAC,MAAO,IAA4B,EAAK,EAAU,CAAC,GAAG,EACjG,QAAQ,EAAM,eAAe,cAAc,cAAc,EAAM,eAAe,OAAO,OAAO,UAAU,MAAM,EAAM,MAAM,SAAS,GAAG,CAAC,EAAM,MAAM,EAAE,OAAO,OAAQ,CAA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