frontend-plus-react 0.4.0 → 0.4.1

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.js CHANGED
@@ -4193,8 +4193,8 @@ var GenericDataGrid = ({
4193
4193
  var GenericDataGrid_default = GenericDataGrid;
4194
4194
 
4195
4195
  // src/App.tsx
4196
- import React27, { useEffect as useEffect15, useMemo as useMemo14 } from "react";
4197
- import { BrowserRouter, Routes, Route, useLocation as useLocation7, Navigate as Navigate3, Outlet as Outlet2 } from "react-router-dom";
4196
+ import React28, { useEffect as useEffect16, useMemo as useMemo14 } from "react";
4197
+ import { BrowserRouter, Routes, Route, useLocation as useLocation7, Navigate as Navigate4, Outlet as Outlet2 } from "react-router-dom";
4198
4198
 
4199
4199
  // src/components/MainLayout.tsx
4200
4200
  import { useEffect as useEffect8 } from "react";
@@ -4326,13 +4326,33 @@ import ExpandMore from "@mui/icons-material/ExpandMore";
4326
4326
  import TableChartIcon from "@mui/icons-material/TableChart";
4327
4327
  import FolderIcon from "@mui/icons-material/Folder";
4328
4328
  import DnsIcon from "@mui/icons-material/Dns";
4329
- import HomeIcon from "@mui/icons-material/Home";
4330
4329
  import WarningAmberIcon3 from "@mui/icons-material/WarningAmber";
4331
4330
  import DesktopWindowsIcon from "@mui/icons-material/DesktopWindows";
4332
4331
  import UnfoldMoreIcon from "@mui/icons-material/UnfoldMore";
4333
4332
  import UnfoldLessIcon from "@mui/icons-material/UnfoldLess";
4334
4333
  import { useNavigate as useNavigate2, useLocation as useLocation2 } from "react-router-dom";
4335
4334
  import { blue, orange, teal, red, grey } from "@mui/material/colors";
4335
+
4336
+ // src/utils/menuInicial.ts
4337
+ function rutaDeItemDeMenu(item) {
4338
+ if (item.menuType === "table") {
4339
+ const consulta = new URLSearchParams();
4340
+ if (item.td) consulta.append("td", JSON.stringify(item.td));
4341
+ if (item.fc) consulta.append("fc", JSON.stringify(item.fc));
4342
+ return `/menu/${item.name}${consulta.size ? `?${consulta.toString()}` : ""}`;
4343
+ }
4344
+ if (item.menuType === "proc") return `/procedures/${item.name}`;
4345
+ if (wScreens[item.menuType] !== void 0) return `/wScreens/${item.menuType}`;
4346
+ console.warn(`Menu type '${item.menuType}' no reconocido o WScreen no mapeada.`);
4347
+ return `/wScreens-fallback/${item.menuType}`;
4348
+ }
4349
+ function itemInicial(menu) {
4350
+ const elegido = menu.find((item) => item.selectedByDefault);
4351
+ if (!elegido) return void 0;
4352
+ return elegido.menuType === "menu" ? itemInicial(elegido.menuContent) : elegido;
4353
+ }
4354
+
4355
+ // src/components/SideMenu.tsx
4336
4356
  import { jsx as jsx20, jsxs as jsxs14 } from "react/jsx-runtime";
4337
4357
  var MenuListItem = ({ item, level, onMenuItemClick }) => {
4338
4358
  const navigate = useNavigate2();
@@ -4343,29 +4363,7 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
4343
4363
  if (item.menuType === "menu") {
4344
4364
  dispatch(toggleSubMenu(item.name));
4345
4365
  } else {
4346
- let path = "";
4347
- const queryParams = new URLSearchParams();
4348
- if (item.menuType === "table") {
4349
- path = `/menu/${item.name}`;
4350
- if (item.td) queryParams.append("td", JSON.stringify(item.td));
4351
- if (item.fc) queryParams.append("fc", JSON.stringify(item.fc));
4352
- if (queryParams.toString()) {
4353
- path = `${path}?${queryParams.toString()}`;
4354
- }
4355
- } else if (item.menuType === "proc") {
4356
- path = `/procedures/${item.name}`;
4357
- } else {
4358
- const WScreenComponent = wScreens[item.menuType];
4359
- if (WScreenComponent !== void 0) {
4360
- path = `/wScreens/${item.menuType}`;
4361
- } else {
4362
- path = `/wScreens-fallback/${item.menuType}`;
4363
- console.warn(`Menu type '${item.menuType}' no reconocido o WScreen no mapeada.`);
4364
- }
4365
- }
4366
- if (path) {
4367
- navigate(path);
4368
- }
4366
+ navigate(rutaDeItemDeMenu(item));
4369
4367
  if (onMenuItemClick) {
4370
4368
  onMenuItemClick();
4371
4369
  }
@@ -4438,19 +4436,12 @@ var SideMenu = ({ onMenuItemClick }) => {
4438
4436
  const allSubMenusKeys = Object.keys(subMenuOpenStates);
4439
4437
  const openSubMenusCount = allSubMenusKeys.filter((key) => subMenuOpenStates[key]).length;
4440
4438
  const isMostlyOpen = allSubMenusKeys.length > 0 && openSubMenusCount / allSubMenusKeys.length > 0.5;
4441
- const handleHomeClick = () => {
4442
- navigate("/home");
4443
- if (onMenuItemClick) {
4444
- onMenuItemClick();
4445
- }
4446
- };
4447
4439
  const handleToggleAllSubMenus = () => {
4448
4440
  dispatch(setAllSubMenusOpen(!isMostlyOpen));
4449
4441
  };
4450
4442
  if (!clientContext || !clientContext.menu) {
4451
4443
  return /* @__PURE__ */ jsx20(Box13, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx20(Typography9, { variant: "body2", color: "text.secondary", children: "Cargando men\xFA..." }) });
4452
4444
  }
4453
- const isHomeSelected = location.pathname === "/home";
4454
4445
  useEffect7(() => {
4455
4446
  if (!clientContext?.menu) return;
4456
4447
  const expandParents = (items, targetPath, parentNames = []) => {
@@ -4486,22 +4477,15 @@ var SideMenu = ({ onMenuItemClick }) => {
4486
4477
  /* @__PURE__ */ jsx20(ListItemText2, { primary: isMostlyOpen ? "colapsar " : "expandir" })
4487
4478
  ] }) }),
4488
4479
  /* @__PURE__ */ jsx20(Divider2, {}),
4489
- /* @__PURE__ */ jsxs14(List2, { children: [
4490
- /* @__PURE__ */ jsx20(ListItem, { disablePadding: true, children: /* @__PURE__ */ jsxs14(ListItemButton2, { onClick: handleHomeClick, selected: isHomeSelected, children: [
4491
- /* @__PURE__ */ jsx20(ListItemIcon2, { sx: { minWidth: "38px" }, children: /* @__PURE__ */ jsx20(HomeIcon, {}) }),
4492
- /* @__PURE__ */ jsx20(ListItemText2, { primary: "Inicio" })
4493
- ] }) }),
4494
- /* @__PURE__ */ jsx20(Divider2, {}),
4495
- clientContext.menu.map((menuItem) => /* @__PURE__ */ jsx20(
4496
- MenuListItem,
4497
- {
4498
- item: menuItem,
4499
- level: 1,
4500
- onMenuItemClick
4501
- },
4502
- menuItem.name
4503
- ))
4504
- ] })
4480
+ /* @__PURE__ */ jsx20(List2, { children: clientContext.menu.map((menuItem) => /* @__PURE__ */ jsx20(
4481
+ MenuListItem,
4482
+ {
4483
+ item: menuItem,
4484
+ level: 1,
4485
+ onMenuItemClick
4486
+ },
4487
+ menuItem.name
4488
+ )) })
4505
4489
  ] });
4506
4490
  };
4507
4491
  var SideMenu_default = SideMenu;
@@ -4560,7 +4544,6 @@ var MainLayout = () => {
4560
4544
  if (!clientContext) {
4561
4545
  return /* @__PURE__ */ jsx21(Box14, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ jsx21(Typography10, { children: "Cargando dise\xF1o de la aplicaci\xF3n..." }) });
4562
4546
  }
4563
- const appBarOffset = theme.mixins.toolbar;
4564
4547
  return /* @__PURE__ */ jsxs15(Box14, { sx: { display: "flex", height: "100vh" }, children: [
4565
4548
  /* @__PURE__ */ jsx21(CssBaseline, {}),
4566
4549
  /* @__PURE__ */ jsx21(
@@ -4664,7 +4647,7 @@ var MainLayout = () => {
4664
4647
  ]
4665
4648
  }
4666
4649
  ),
4667
- /* @__PURE__ */ jsx21(
4650
+ /* @__PURE__ */ jsxs15(
4668
4651
  Box14,
4669
4652
  {
4670
4653
  component: "main",
@@ -4684,15 +4667,16 @@ var MainLayout = () => {
4684
4667
  },
4685
4668
  minWidth: 0,
4686
4669
  flexShrink: 0,
4687
- // Asegúrate de que el paddingTop sea suficiente para la AppBar
4688
- paddingTop: `${appBarOffset.minHeight}px`,
4689
4670
  height: "100%",
4690
4671
  boxSizing: "border-box",
4691
4672
  display: "flex",
4692
4673
  flexDirection: "column",
4693
4674
  width: isDrawerOpen ? `calc(100% - ${drawerWidth}px)` : "100%"
4694
4675
  },
4695
- children: /* @__PURE__ */ jsx21(Outlet, {})
4676
+ children: [
4677
+ /* @__PURE__ */ jsx21(Toolbar, {}),
4678
+ /* @__PURE__ */ jsx21(Box14, { sx: { flex: 1, minHeight: 0, overflowY: "auto", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsx21(Outlet, {}) })
4679
+ ]
4696
4680
  }
4697
4681
  )
4698
4682
  ] });
@@ -4750,28 +4734,26 @@ var SessionExpiredMessage = () => {
4750
4734
  };
4751
4735
  var SessionExpiredMessage_default = SessionExpiredMessage;
4752
4736
 
4753
- // src/pages/HomePage.tsx
4754
- import { Box as Box16, Typography as Typography12 } from "@mui/material";
4755
- import { jsx as jsx23, jsxs as jsxs17 } from "react/jsx-runtime";
4756
- var HomePage = () => {
4737
+ // src/pages/PantallaInicial.tsx
4738
+ import { Navigate } from "react-router-dom";
4739
+ import { jsx as jsx23 } from "react/jsx-runtime";
4740
+ var PantallaInicial = () => {
4757
4741
  const { clientContext } = useApp();
4758
- return /* @__PURE__ */ jsxs17(Box16, { sx: { p: 3 }, children: [
4759
- /* @__PURE__ */ jsx23(Typography12, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${clientContext?.username}` }),
4760
- /* @__PURE__ */ jsx23(Typography12, { variant: "body1", children: "Usa el men\xFA lateral para navegar por las diferentes secciones." })
4761
- ] });
4742
+ const item = clientContext.menu ? itemInicial(clientContext.menu) : void 0;
4743
+ return item ? /* @__PURE__ */ jsx23(Navigate, { to: rutaDeItemDeMenu(item), replace: true }) : null;
4762
4744
  };
4763
- var HomePage_default = HomePage;
4745
+ var PantallaInicial_default = PantallaInicial;
4764
4746
 
4765
4747
  // src/pages/LogoutPage.tsx
4766
4748
  import { useEffect as useEffect9 } from "react";
4767
- import { Box as Box17, Typography as Typography13, CircularProgress as CircularProgress5 } from "@mui/material";
4768
- import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
4749
+ import { Box as Box16, Typography as Typography12, CircularProgress as CircularProgress5 } from "@mui/material";
4750
+ import { jsx as jsx24, jsxs as jsxs17 } from "react/jsx-runtime";
4769
4751
  var LogoutPage = () => {
4770
4752
  const logout = useLogout_default();
4771
4753
  useEffect9(() => {
4772
4754
  logout();
4773
4755
  }, [logout]);
4774
- return /* @__PURE__ */ jsxs18(Box17, { sx: {
4756
+ return /* @__PURE__ */ jsxs17(Box16, { sx: {
4775
4757
  display: "flex",
4776
4758
  flexDirection: "column",
4777
4759
  justifyContent: "center",
@@ -4780,20 +4762,20 @@ var LogoutPage = () => {
4780
4762
  textAlign: "center"
4781
4763
  }, children: [
4782
4764
  /* @__PURE__ */ jsx24(CircularProgress5, { size: 60 }),
4783
- /* @__PURE__ */ jsx24(Typography13, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
4765
+ /* @__PURE__ */ jsx24(Typography12, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
4784
4766
  ] });
4785
4767
  };
4786
4768
  var LogoutPage_default = LogoutPage;
4787
4769
 
4788
4770
  // src/pages/LoginPage.tsx
4789
4771
  import { useState as useState14 } from "react";
4790
- import { Button as Button8, TextField as TextField2, Typography as Typography14, Alert as Alert3, AlertTitle, Box as Box18, CircularProgress as CircularProgress6 } from "@mui/material";
4772
+ import { Button as Button8, TextField as TextField2, Typography as Typography13, Alert as Alert3, AlertTitle, Box as Box17, CircularProgress as CircularProgress6 } from "@mui/material";
4791
4773
  import { useForm, Controller } from "react-hook-form";
4792
4774
  import { zodResolver } from "@hookform/resolvers/zod";
4793
4775
  import * as z from "zod";
4794
4776
  import { useNavigate as useNavigate4 } from "react-router-dom";
4795
4777
  import { useDispatch as useDispatch4 } from "react-redux";
4796
- import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
4778
+ import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
4797
4779
  var loginSchema = z.object({
4798
4780
  username: z.string().min(1, "El usuario es requerido"),
4799
4781
  // Añadir validación básica
@@ -4839,7 +4821,7 @@ var LoginPage = () => {
4839
4821
  setIsLoggedIn(true);
4840
4822
  await dispatch(fetchClientContext()).unwrap();
4841
4823
  console.log("Login exitoso y clientContext cargado.");
4842
- navigate("/home");
4824
+ navigate("/");
4843
4825
  reset();
4844
4826
  } catch (error) {
4845
4827
  console.error("Error al iniciar sesi\xF3n:", error);
@@ -4850,15 +4832,15 @@ var LoginPage = () => {
4850
4832
  }
4851
4833
  };
4852
4834
  return /* @__PURE__ */ jsx25(
4853
- Box18,
4835
+ Box17,
4854
4836
  {
4855
4837
  display: "flex",
4856
4838
  alignItems: "center",
4857
4839
  justifyContent: "center",
4858
4840
  minHeight: "100vh",
4859
4841
  bgcolor: "#f5f5f5",
4860
- children: /* @__PURE__ */ jsxs19(
4861
- Box18,
4842
+ children: /* @__PURE__ */ jsxs18(
4843
+ Box17,
4862
4844
  {
4863
4845
  width: "100%",
4864
4846
  maxWidth: "400px",
@@ -4867,7 +4849,7 @@ var LoginPage = () => {
4867
4849
  borderRadius: 8,
4868
4850
  boxShadow: 3,
4869
4851
  children: [
4870
- /* @__PURE__ */ jsx25(Box18, { sx: { display: "flex", justifyContent: "center", mb: 3 }, children: /* @__PURE__ */ jsx25(
4852
+ /* @__PURE__ */ jsx25(Box17, { sx: { display: "flex", justifyContent: "center", mb: 3 }, children: /* @__PURE__ */ jsx25(
4871
4853
  "img",
4872
4854
  {
4873
4855
  src: `${envConfig.backendUrl}/img/login-logo-icon.png`,
@@ -4875,10 +4857,10 @@ var LoginPage = () => {
4875
4857
  style: { height: "192px", maxWidth: "100%", objectFit: "contain" }
4876
4858
  }
4877
4859
  ) }),
4878
- /* @__PURE__ */ jsx25(Typography14, { variant: "h5", align: "center", gutterBottom: true, sx: { fontWeight: "bold", color: "primary.main" }, children: "Iniciar Sesi\xF3n" }),
4879
- /* @__PURE__ */ jsxs19("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
4880
- /* @__PURE__ */ jsxs19("div", { children: [
4881
- /* @__PURE__ */ jsx25("label", { htmlFor: "username", children: /* @__PURE__ */ jsx25(Typography14, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
4860
+ /* @__PURE__ */ jsx25(Typography13, { variant: "h5", align: "center", gutterBottom: true, sx: { fontWeight: "bold", color: "primary.main" }, children: "Iniciar Sesi\xF3n" }),
4861
+ /* @__PURE__ */ jsxs18("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
4862
+ /* @__PURE__ */ jsxs18("div", { children: [
4863
+ /* @__PURE__ */ jsx25("label", { htmlFor: "username", children: /* @__PURE__ */ jsx25(Typography13, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
4882
4864
  /* @__PURE__ */ jsx25(
4883
4865
  Controller,
4884
4866
  {
@@ -4900,8 +4882,8 @@ var LoginPage = () => {
4900
4882
  }
4901
4883
  )
4902
4884
  ] }),
4903
- /* @__PURE__ */ jsxs19("div", { children: [
4904
- /* @__PURE__ */ jsx25("label", { htmlFor: "password", children: /* @__PURE__ */ jsx25(Typography14, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
4885
+ /* @__PURE__ */ jsxs18("div", { children: [
4886
+ /* @__PURE__ */ jsx25("label", { htmlFor: "password", children: /* @__PURE__ */ jsx25(Typography13, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
4905
4887
  /* @__PURE__ */ jsx25(
4906
4888
  Controller,
4907
4889
  {
@@ -4923,12 +4905,12 @@ var LoginPage = () => {
4923
4905
  }
4924
4906
  )
4925
4907
  ] }),
4926
- /* @__PURE__ */ jsx25(Button8, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ jsxs19(Fragment3, { children: [
4908
+ /* @__PURE__ */ jsx25(Button8, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ jsxs18(Fragment3, { children: [
4927
4909
  /* @__PURE__ */ jsx25(CircularProgress6, { size: 20, sx: { mr: 1 } }),
4928
4910
  "Iniciando sesi\xF3n..."
4929
4911
  ] }) : "Iniciar Sesi\xF3n" })
4930
4912
  ] }),
4931
- loginError && /* @__PURE__ */ jsxs19(Alert3, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
4913
+ loginError && /* @__PURE__ */ jsxs18(Alert3, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
4932
4914
  " ",
4933
4915
  /* @__PURE__ */ jsx25(AlertTitle, { children: "Error" }),
4934
4916
  loginError
@@ -4954,8 +4936,8 @@ import {
4954
4936
  Checkbox as Checkbox3,
4955
4937
  FormControlLabel as FormControlLabel3,
4956
4938
  FormHelperText as FormHelperText2,
4957
- Typography as Typography16,
4958
- Box as Box20,
4939
+ Typography as Typography15,
4940
+ Box as Box19,
4959
4941
  CircularProgress as CircularProgress7,
4960
4942
  Alert as Alert4,
4961
4943
  Divider as Divider3,
@@ -4963,14 +4945,14 @@ import {
4963
4945
  } from "@mui/material";
4964
4946
 
4965
4947
  // src/pages/procedure-results/SuccessDisplay.tsx
4966
- import { Box as Box19, Typography as Typography15, Paper as Paper3 } from "@mui/material";
4967
- import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
4948
+ import { Box as Box18, Typography as Typography14, Paper as Paper3 } from "@mui/material";
4949
+ import { jsx as jsx26, jsxs as jsxs19 } from "react/jsx-runtime";
4968
4950
  var SuccessDisplay = ({ data }) => {
4969
- return /* @__PURE__ */ jsxs20(Paper3, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
4970
- /* @__PURE__ */ jsx26(Typography15, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
4971
- /* @__PURE__ */ jsx26(Typography15, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
4972
- /* @__PURE__ */ jsx26(Box19, { sx: { bgcolor: "success.dark", p: 1, borderRadius: 1, mt: 1, overflowX: "auto" }, children: /* @__PURE__ */ jsx26("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(data, null, 2) }) }),
4973
- /* @__PURE__ */ jsx26(Typography15, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
4951
+ return /* @__PURE__ */ jsxs19(Paper3, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
4952
+ /* @__PURE__ */ jsx26(Typography14, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
4953
+ /* @__PURE__ */ jsx26(Typography14, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
4954
+ /* @__PURE__ */ jsx26(Box18, { sx: { bgcolor: "success.dark", p: 1, borderRadius: 1, mt: 1, overflowX: "auto" }, children: /* @__PURE__ */ jsx26("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(data, null, 2) }) }),
4955
+ /* @__PURE__ */ jsx26(Typography14, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
4974
4956
  ] });
4975
4957
  };
4976
4958
  var SuccessDisplay_default = SuccessDisplay;
@@ -4984,7 +4966,7 @@ var extendResultsOk = (newComponents) => {
4984
4966
  };
4985
4967
 
4986
4968
  // src/components/ProcedureForm.tsx
4987
- import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
4969
+ import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
4988
4970
  var ProcedureForm = () => {
4989
4971
  const { procedureName } = useParams();
4990
4972
  const { clientContext } = useApp();
@@ -5199,9 +5181,9 @@ var ProcedureForm = () => {
5199
5181
  sx: { fontSize: "0.8rem" }
5200
5182
  };
5201
5183
  if (param.options && param.options.length > 0) {
5202
- return /* @__PURE__ */ jsxs21(FormControl3, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
5184
+ return /* @__PURE__ */ jsxs20(FormControl3, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
5203
5185
  /* @__PURE__ */ jsx27(InputLabel2, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
5204
- /* @__PURE__ */ jsxs21(
5186
+ /* @__PURE__ */ jsxs20(
5205
5187
  Select2,
5206
5188
  {
5207
5189
  labelId: `${param.name}-label`,
@@ -5212,7 +5194,7 @@ var ProcedureForm = () => {
5212
5194
  label: param.label || param.name,
5213
5195
  disabled: apiLoading,
5214
5196
  sx: { fontSize: "0.8rem" },
5215
- renderValue: (selected) => /* @__PURE__ */ jsx27(Typography16, { sx: { fontSize: "0.8rem" }, children: selected }),
5197
+ renderValue: (selected) => /* @__PURE__ */ jsx27(Typography15, { sx: { fontSize: "0.8rem" }, children: selected }),
5216
5198
  children: [
5217
5199
  (!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */ jsx27(MenuItem2, { value: "", sx: { fontSize: "0.8rem" }, children: /* @__PURE__ */ jsx27("em", { children: "Seleccione..." }) }),
5218
5200
  param.options.map((option) => /* @__PURE__ */ jsx27(MenuItem2, { value: option, sx: { fontSize: "0.8rem" }, children: option }, option))
@@ -5250,7 +5232,7 @@ var ProcedureForm = () => {
5250
5232
  size: "small"
5251
5233
  }
5252
5234
  ),
5253
- label: /* @__PURE__ */ jsx27(Typography16, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
5235
+ label: /* @__PURE__ */ jsx27(Typography15, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
5254
5236
  sx: { mt: 1, mb: 0 }
5255
5237
  }
5256
5238
  );
@@ -5262,8 +5244,8 @@ var ProcedureForm = () => {
5262
5244
  case "jsona":
5263
5245
  return /* @__PURE__ */ jsx27(TextField3, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
5264
5246
  case "bytea":
5265
- return /* @__PURE__ */ jsxs21(FormControl3, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
5266
- /* @__PURE__ */ jsx27(Typography16, { variant: "body2", color: "textSecondary", component: "label", htmlFor: param.name, sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "text.secondary" }, children: param.label || param.name }),
5247
+ return /* @__PURE__ */ jsxs20(FormControl3, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
5248
+ /* @__PURE__ */ jsx27(Typography15, { variant: "body2", color: "textSecondary", component: "label", htmlFor: param.name, sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "text.secondary" }, children: param.label || param.name }),
5267
5249
  /* @__PURE__ */ jsx27(
5268
5250
  "input",
5269
5251
  {
@@ -5290,13 +5272,13 @@ var ProcedureForm = () => {
5290
5272
  if (ComponentToRender) {
5291
5273
  return /* @__PURE__ */ jsx27(ComponentToRender, { data: procedureResultData });
5292
5274
  } else {
5293
- return /* @__PURE__ */ jsxs21(Paper4, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
5294
- /* @__PURE__ */ jsxs21(Typography16, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
5275
+ return /* @__PURE__ */ jsxs20(Paper4, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
5276
+ /* @__PURE__ */ jsxs20(Typography15, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
5295
5277
  "el componente para resolver el resultOk: '",
5296
5278
  procedure.resultOk,
5297
5279
  "' definido en el procedure no existe o no est\xE1 mapeado."
5298
5280
  ] }),
5299
- /* @__PURE__ */ jsx27(Box20, { sx: {
5281
+ /* @__PURE__ */ jsx27(Box19, { sx: {
5300
5282
  bgcolor: "warning.dark",
5301
5283
  p: 1,
5302
5284
  borderRadius: 1
@@ -5305,7 +5287,7 @@ var ProcedureForm = () => {
5305
5287
  }
5306
5288
  }, [procedureResultData, procedure]);
5307
5289
  if (!procedure) {
5308
- return /* @__PURE__ */ jsxs21(Box20, { sx: {
5290
+ return /* @__PURE__ */ jsxs20(Box19, { sx: {
5309
5291
  p: 2,
5310
5292
  width: "100%",
5311
5293
  boxSizing: "border-box",
@@ -5316,12 +5298,12 @@ var ProcedureForm = () => {
5316
5298
  textAlign: "center"
5317
5299
  }, children: [
5318
5300
  /* @__PURE__ */ jsx27(CircularProgress7, { sx: { mb: 2 } }),
5319
- /* @__PURE__ */ jsx27(Typography16, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
5301
+ /* @__PURE__ */ jsx27(Typography15, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
5320
5302
  ] });
5321
5303
  }
5322
5304
  return (
5323
5305
  // Esta es la Box más externa que ahora controlará el scroll
5324
- /* @__PURE__ */ jsxs21(Box20, { sx: {
5306
+ /* @__PURE__ */ jsxs20(Box19, { sx: {
5325
5307
  p: 2,
5326
5308
  ml: 1,
5327
5309
  mt: 2,
@@ -5338,14 +5320,14 @@ var ProcedureForm = () => {
5338
5320
  overflowX: "hidden"
5339
5321
  // Oculta el scroll horizontal si no es necesario para el contenedor principal
5340
5322
  }, children: [
5341
- /* @__PURE__ */ jsx27(Typography16, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
5342
- Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ jsxs21(Alert4, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
5323
+ /* @__PURE__ */ jsx27(Typography15, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
5324
+ Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ jsxs20(Alert4, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
5343
5325
  "Por favor, corrige los errores en el formulario antes de enviar.",
5344
5326
  /* @__PURE__ */ jsx27("ul", { children: Object.values(validationErrors).map((err, idx) => err && /* @__PURE__ */ jsx27("li", { children: err }, idx)) })
5345
5327
  ] }),
5346
5328
  !Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */ jsx27(Alert4, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: apiError.message }),
5347
5329
  !Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */ jsx27(Alert4, { severity: "success", sx: { mb: 2, fontSize: "0.8rem" }, children: successMessage }),
5348
- /* @__PURE__ */ jsxs21("form", { onSubmit: handleSubmit, children: [
5330
+ /* @__PURE__ */ jsxs20("form", { onSubmit: handleSubmit, children: [
5349
5331
  procedure.parameters.map((param) => /* @__PURE__ */ jsx27("div", { children: renderInputField(param) }, param.name)),
5350
5332
  /* @__PURE__ */ jsx27(
5351
5333
  Button9,
@@ -5361,15 +5343,15 @@ var ProcedureForm = () => {
5361
5343
  }
5362
5344
  )
5363
5345
  ] }),
5364
- ResultDisplayContent && /* @__PURE__ */ jsxs21(Box20, { sx: { mt: 2 }, children: [
5346
+ ResultDisplayContent && /* @__PURE__ */ jsxs20(Box19, { sx: { mt: 2 }, children: [
5365
5347
  " ",
5366
5348
  ResultDisplayContent
5367
5349
  ] }),
5368
- executionLog.length > 0 && /* @__PURE__ */ jsxs21(Box20, { sx: { mt: 3 }, children: [
5350
+ executionLog.length > 0 && /* @__PURE__ */ jsxs20(Box19, { sx: { mt: 3 }, children: [
5369
5351
  /* @__PURE__ */ jsx27(Divider3, { sx: { mb: 2 } }),
5370
- /* @__PURE__ */ jsx27(Typography16, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
5352
+ /* @__PURE__ */ jsx27(Typography15, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
5371
5353
  /* @__PURE__ */ jsx27(
5372
- Box20,
5354
+ Box19,
5373
5355
  {
5374
5356
  sx: {
5375
5357
  bgcolor: "grey.100",
@@ -5383,7 +5365,7 @@ var ProcedureForm = () => {
5383
5365
  whiteSpace: "pre-wrap"
5384
5366
  },
5385
5367
  children: executionLog.map((log, index) => /* @__PURE__ */ jsx27(
5386
- Typography16,
5368
+ Typography15,
5387
5369
  {
5388
5370
  component: "pre",
5389
5371
  sx: {
@@ -5409,7 +5391,7 @@ import { PersistGate } from "redux-persist/integration/react";
5409
5391
 
5410
5392
  // src/components/PrivateRoute.tsx
5411
5393
  import { useEffect as useEffect10 } from "react";
5412
- import { Navigate, useLocation as useLocation3 } from "react-router-dom";
5394
+ import { Navigate as Navigate2, useLocation as useLocation3 } from "react-router-dom";
5413
5395
  import { Fragment as Fragment4, jsx as jsx28 } from "react/jsx-runtime";
5414
5396
  var PrivateRoute = ({ children }) => {
5415
5397
  const location = useLocation3();
@@ -5421,7 +5403,7 @@ var PrivateRoute = ({ children }) => {
5421
5403
  useEffect10(() => {
5422
5404
  console.log(`[PrivateRoute] Effect: Path=${location.pathname}, AuthStatus=${clientContextStatus}, IsAuthenticated=${isAuthenticated}, IsLoadingAuth=${isLoadingAuth}`);
5423
5405
  if (!isAuthenticated && !isLoadingAuth && location.pathname !== "/login") {
5424
- const path = location.pathname + location.search;
5406
+ const path = location.pathname + location.search + location.hash;
5425
5407
  console.log(`[PrivateRoute] ACTION: Dispatching setRedirectPath(${path})`);
5426
5408
  dispatch(setRedirectPath(path));
5427
5409
  } else if (isAuthenticated) {
@@ -5438,7 +5420,7 @@ var PrivateRoute = ({ children }) => {
5438
5420
  }
5439
5421
  if (!isAuthenticated) {
5440
5422
  console.log(`[PrivateRoute] User not authenticated, navigating to /login`);
5441
- return /* @__PURE__ */ jsx28(Navigate, { to: "/login", replace: true });
5423
+ return /* @__PURE__ */ jsx28(Navigate2, { to: "/login", replace: true });
5442
5424
  }
5443
5425
  console.log(`[PrivateRoute] User authenticated, rendering children.`);
5444
5426
  return /* @__PURE__ */ jsx28(Fragment4, { children });
@@ -5468,9 +5450,9 @@ var InitialRedirectHandler = () => {
5468
5450
  navegandoRef.current = true;
5469
5451
  navigate(redirectPath);
5470
5452
  dispatch(setRedirectPath(null));
5471
- } else if (!navegandoRef.current && (location.pathname === "/login" || location.pathname === "/")) {
5472
- console.log("Usuario autenticado, redirigiendo a /home por defecto.");
5473
- navigate("/home");
5453
+ } else if (!navegandoRef.current && location.pathname === "/login") {
5454
+ console.log("Usuario autenticado, redirigiendo a la pantalla de inicio.");
5455
+ navigate("/");
5474
5456
  }
5475
5457
  }
5476
5458
  }, [clientContextStatus, redirectPath, location.pathname, navigate, dispatch]);
@@ -5481,9 +5463,9 @@ var InitialRedirectHandler_default = InitialRedirectHandler;
5481
5463
  // src/pages/GenericDataGridPage.tsx
5482
5464
  import React22, { useState as useState16, useCallback as useCallback15 } from "react";
5483
5465
  import { useParams as useParams2, useLocation as useLocation5 } from "react-router-dom";
5484
- import { Box as Box21, Alert as Alert5, Typography as Typography17, Tabs, Tab, IconButton as IconButton5 } from "@mui/material";
5466
+ import { Box as Box20, Alert as Alert5, Typography as Typography16, Tabs, Tab, IconButton as IconButton5 } from "@mui/material";
5485
5467
  import CloseIcon2 from "@mui/icons-material/Close";
5486
- import { jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
5468
+ import { jsx as jsx29, jsxs as jsxs21 } from "react/jsx-runtime";
5487
5469
  var GenericDataGridPage = ({
5488
5470
  initialTableName,
5489
5471
  initialFixedFields = []
@@ -5529,21 +5511,21 @@ var GenericDataGridPage = ({
5529
5511
  else if (activeTabIdx === index) setActiveTabIdx(index - 1);
5530
5512
  };
5531
5513
  if (!effectiveTableName) {
5532
- return /* @__PURE__ */ jsx29(Box21, { p: 3, children: /* @__PURE__ */ jsx29(Alert5, { severity: "error", children: "No se especific\xF3 una tabla." }) });
5514
+ return /* @__PURE__ */ jsx29(Box20, { p: 3, children: /* @__PURE__ */ jsx29(Alert5, { severity: "error", children: "No se especific\xF3 una tabla." }) });
5533
5515
  }
5534
- return /* @__PURE__ */ jsxs22(Box21, { sx: { width: "100%", height: "calc(100vh - 64px)", display: "flex", flexDirection: "column" }, children: [
5535
- /* @__PURE__ */ jsx29(Box21, { sx: { borderBottom: 1, borderColor: "divider", bgcolor: "background.paper" }, children: /* @__PURE__ */ jsx29(Tabs, { value: activeTabIdx, onChange: (_, v) => setActiveTabIdx(v), variant: "scrollable", children: tabs.map((tab, index) => /* @__PURE__ */ jsx29(
5516
+ return /* @__PURE__ */ jsxs21(Box20, { sx: { width: "100%", height: "calc(100vh - 64px)", display: "flex", flexDirection: "column" }, children: [
5517
+ /* @__PURE__ */ jsx29(Box20, { sx: { borderBottom: 1, borderColor: "divider", bgcolor: "background.paper" }, children: /* @__PURE__ */ jsx29(Tabs, { value: activeTabIdx, onChange: (_, v) => setActiveTabIdx(v), variant: "scrollable", children: tabs.map((tab, index) => /* @__PURE__ */ jsx29(
5536
5518
  Tab,
5537
5519
  {
5538
- label: /* @__PURE__ */ jsxs22(Box21, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
5539
- /* @__PURE__ */ jsx29(Typography17, { variant: "caption", sx: { fontWeight: "bold" }, children: tab.label }),
5520
+ label: /* @__PURE__ */ jsxs21(Box20, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
5521
+ /* @__PURE__ */ jsx29(Typography16, { variant: "caption", sx: { fontWeight: "bold" }, children: tab.label }),
5540
5522
  index !== 0 && /* @__PURE__ */ jsx29(IconButton5, { size: "small", onClick: (e) => handleCloseTab(index, e), children: /* @__PURE__ */ jsx29(CloseIcon2, { fontSize: "inherit" }) })
5541
5523
  ] })
5542
5524
  },
5543
5525
  tab.id
5544
5526
  )) }) }),
5545
5527
  tabs.map((tab, index) => /* @__PURE__ */ jsx29(
5546
- Box21,
5528
+ Box20,
5547
5529
  {
5548
5530
  role: "tabpanel",
5549
5531
  hidden: activeTabIdx !== index,
@@ -5567,20 +5549,20 @@ var GenericDataGridPage_default = GenericDataGridPage;
5567
5549
  // src/pages/PantallaDeRuta.tsx
5568
5550
  import { useMemo as useMemo12 } from "react";
5569
5551
  import { useSearchParams } from "react-router-dom";
5570
- import { Box as Box22 } from "@mui/material";
5552
+ import { Box as Box21 } from "@mui/material";
5571
5553
  import { jsx as jsx30 } from "react/jsx-runtime";
5572
5554
  var PantallaDeRuta = ({ screenName }) => {
5573
5555
  const [busqueda] = useSearchParams();
5574
5556
  const params = useMemo12(() => Object.fromEntries(busqueda.entries()), [busqueda]);
5575
5557
  const Pantalla = wScreens[screenName];
5576
- return /* @__PURE__ */ jsx30(Box22, { sx: { pt: 3, pl: 4 }, children: Pantalla ? /* @__PURE__ */ jsx30(Pantalla, { screenName, params }) : /* @__PURE__ */ jsx30(FallbackWScreen, { screenName }) });
5558
+ return /* @__PURE__ */ jsx30(Box21, { sx: { pt: 3, pl: 4 }, children: Pantalla ? /* @__PURE__ */ jsx30(Pantalla, { screenName, params }) : /* @__PURE__ */ jsx30(FallbackWScreen, { screenName }) });
5577
5559
  };
5578
5560
 
5579
5561
  // src/pages/MenuTablePage.tsx
5580
5562
  import { useMemo as useMemo13 } from "react";
5581
5563
  import { useParams as useParams3 } from "react-router-dom";
5582
- import { Box as Box23, Alert as Alert6, Typography as Typography18 } from "@mui/material";
5583
- import { jsx as jsx31, jsxs as jsxs23 } from "react/jsx-runtime";
5564
+ import { Box as Box22, Alert as Alert6, Typography as Typography17 } from "@mui/material";
5565
+ import { jsx as jsx31, jsxs as jsxs22 } from "react/jsx-runtime";
5584
5566
  function fixedFieldsDeMenu(ff) {
5585
5567
  if (!ff) return [];
5586
5568
  if (Array.isArray(ff)) {
@@ -5621,9 +5603,9 @@ var MenuTablePage = () => {
5621
5603
  };
5622
5604
  }, [menuName, clientContext]);
5623
5605
  if (!currentTableName) {
5624
- return /* @__PURE__ */ jsx31(Box23, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs23(Alert6, { severity: "error", children: [
5625
- /* @__PURE__ */ jsx31(Typography18, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
5626
- /* @__PURE__ */ jsx31(Typography18, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
5606
+ return /* @__PURE__ */ jsx31(Box22, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ jsxs22(Alert6, { severity: "error", children: [
5607
+ /* @__PURE__ */ jsx31(Typography17, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
5608
+ /* @__PURE__ */ jsx31(Typography17, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
5627
5609
  ] }) });
5628
5610
  }
5629
5611
  return /* @__PURE__ */ jsx31(
@@ -5637,8 +5619,8 @@ var MenuTablePage = () => {
5637
5619
  var MenuTablePage_default = MenuTablePage;
5638
5620
 
5639
5621
  // src/puente/PantallaBP.tsx
5640
- import { useEffect as useEffect13, useRef as useRef9, useState as useState17 } from "react";
5641
- import { Navigate as Navigate2, useLocation as useLocation6, useNavigate as useNavigate6, useParams as useParams4 } from "react-router-dom";
5622
+ import { useEffect as useEffect14, useRef as useRef9, useState as useState17 } from "react";
5623
+ import { Navigate as Navigate3, useLocation as useLocation6, useNavigate as useNavigate6, useParams as useParams4 } from "react-router-dom";
5642
5624
  import { Alert as Alert7, Box as Box24, CircularProgress as CircularProgress8 } from "@mui/material";
5643
5625
 
5644
5626
  // src/puente/clienteBP.ts
@@ -5669,6 +5651,10 @@ function cargarScript(ruta) {
5669
5651
  document.head.appendChild(script);
5670
5652
  });
5671
5653
  }
5654
+ function esperarCargaDeVentana() {
5655
+ if (document.readyState === "complete") return Promise.resolve();
5656
+ return new Promise((resolver) => window.addEventListener("load", () => resolver(), { once: true }));
5657
+ }
5672
5658
  var carga = null;
5673
5659
  function cargarClienteBP(urlBackend) {
5674
5660
  if (!carga) {
@@ -5696,6 +5682,7 @@ async function cargarSinMemoria(urlBackend) {
5696
5682
  enlace.href = ruta;
5697
5683
  document.head.appendChild(enlace);
5698
5684
  });
5685
+ await esperarCargaDeVentana();
5699
5686
  for (const ruta of recursos.scripts) {
5700
5687
  await cargarScript(ruta);
5701
5688
  }
@@ -5706,6 +5693,81 @@ async function cargarSinMemoria(urlBackend) {
5706
5693
  return myOwn;
5707
5694
  }
5708
5695
 
5696
+ // src/puente/ConsolaBP.tsx
5697
+ import { useEffect as useEffect13 } from "react";
5698
+ import { Box as Box23 } from "@mui/material";
5699
+ import { jsx as jsx32 } from "react/jsx-runtime";
5700
+ var MARGEN_DE_REPETIDO_MS = 1e3;
5701
+ function descartarRepetidos(consola, agregados, ahora) {
5702
+ for (const nodo of agregados) {
5703
+ if (!(nodo instanceof HTMLElement)) continue;
5704
+ const repetido = Array.from(consola.children).find(
5705
+ (otro) => otro instanceof HTMLElement && otro !== nodo && otro.className === nodo.className && otro.textContent === nodo.textContent && ahora - Number(otro.dataset.instante) < MARGEN_DE_REPETIDO_MS
5706
+ );
5707
+ if (repetido) nodo.remove();
5708
+ else nodo.dataset.instante = String(ahora);
5709
+ }
5710
+ }
5711
+ var ConsolaBP = () => {
5712
+ useEffect13(() => {
5713
+ const consola = document.getElementById("mini-console");
5714
+ if (!consola) return;
5715
+ const observador = new MutationObserver(
5716
+ (registros) => descartarRepetidos(consola, registros.flatMap((registro) => Array.from(registro.addedNodes)), Date.now())
5717
+ );
5718
+ observador.observe(consola, { childList: true });
5719
+ return () => observador.disconnect();
5720
+ }, []);
5721
+ return /* @__PURE__ */ jsx32(
5722
+ Box23,
5723
+ {
5724
+ id: "mini-console",
5725
+ sx: (tema) => ({
5726
+ "&#mini-console": {
5727
+ position: "fixed",
5728
+ top: { xs: 64, sm: 72 },
5729
+ left: "auto",
5730
+ right: 16,
5731
+ bottom: "auto",
5732
+ float: "none",
5733
+ zIndex: tema.zIndex.snackbar,
5734
+ width: "auto",
5735
+ minWidth: 0,
5736
+ maxWidth: "min(480px, calc(100vw - 32px))",
5737
+ minHeight: 0,
5738
+ maxHeight: "none",
5739
+ overflow: "visible",
5740
+ padding: 0,
5741
+ border: "none",
5742
+ borderRadius: 0,
5743
+ boxShadow: "none",
5744
+ backgroundColor: "transparent",
5745
+ fontSize: "inherit",
5746
+ display: "flex",
5747
+ flexDirection: "column",
5748
+ gap: 1
5749
+ },
5750
+ "&#mini-console:not(:empty)": { display: "flex" },
5751
+ "&#mini-console:empty": { display: "none" },
5752
+ "& > div": {
5753
+ p: "6px 12px",
5754
+ borderRadius: 1,
5755
+ boxShadow: tema.shadows[3],
5756
+ fontSize: "0.875rem",
5757
+ whiteSpace: "pre-wrap",
5758
+ overflowWrap: "anywhere",
5759
+ backgroundColor: tema.palette.grey[800],
5760
+ color: tema.palette.common.white
5761
+ },
5762
+ "& > .status-error": {
5763
+ backgroundColor: tema.palette.error.main,
5764
+ color: tema.palette.error.contrastText
5765
+ }
5766
+ })
5767
+ }
5768
+ );
5769
+ };
5770
+
5709
5771
  // src/puente/pantallaDeBP.ts
5710
5772
  var RUTA_PANTALLA_BP = "/bp/menu";
5711
5773
  function rutaDePantallaBP(nombre, parametros = "") {
@@ -5773,7 +5835,14 @@ function capturarNavegacionBP(urlBackend, navegar) {
5773
5835
  }
5774
5836
  };
5775
5837
  navegacion?.addEventListener("navigate", alNavegar);
5838
+ const reemplazarOriginal = history.replaceState;
5839
+ const reemplazar = (estado, titulo, url) => {
5840
+ const ruta = url === void 0 || url === null ? null : rutaDeEnlaceBP(String(url), document.baseURI, urlBackend);
5841
+ reemplazarOriginal.call(history, estado, titulo, ruta === null ? url : rutaBase + ruta);
5842
+ };
5843
+ history.replaceState = reemplazar;
5776
5844
  return () => {
5845
+ if (history.replaceState === reemplazar) history.replaceState = reemplazarOriginal;
5777
5846
  document.removeEventListener("click", alHacerClick, true);
5778
5847
  navegacion?.removeEventListener("navigate", alNavegar);
5779
5848
  };
@@ -5787,7 +5856,7 @@ var habilitarPuenteBP = () => {
5787
5856
  var puenteBPHabilitado = () => habilitado;
5788
5857
 
5789
5858
  // src/puente/PantallaBP.tsx
5790
- import { jsx as jsx32, jsxs as jsxs24 } from "react/jsx-runtime";
5859
+ import { jsx as jsx33, jsxs as jsxs23 } from "react/jsx-runtime";
5791
5860
  function buscarItemDeMenu(items, tipo) {
5792
5861
  for (const item of items) {
5793
5862
  if (item.menuType === tipo) return item;
@@ -5806,7 +5875,7 @@ var PantallaBP = ({ nombre, direccion }) => {
5806
5875
  const [noExiste, setNoExiste] = useState17(false);
5807
5876
  const contenedor = useRef9(null);
5808
5877
  const menu = clientContext.menu;
5809
- useEffect13(() => {
5878
+ useEffect14(() => {
5810
5879
  const elemento = contenedor.current;
5811
5880
  if (!elemento) return;
5812
5881
  let vigente = true;
@@ -5839,45 +5908,49 @@ var PantallaBP = ({ nombre, direccion }) => {
5839
5908
  elemento.replaceChildren();
5840
5909
  };
5841
5910
  }, [nombre, direccion, menu, navigate]);
5842
- if (noExiste) return /* @__PURE__ */ jsx32(FallbackWScreen, { screenName: nombre });
5843
- return /* @__PURE__ */ jsxs24(Box24, { children: [
5844
- cargando && /* @__PURE__ */ jsx32(CircularProgress8, { size: 24, sx: { m: 2 } }),
5845
- error && /* @__PURE__ */ jsx32(Alert7, { severity: "error", sx: { m: 2 }, children: error }),
5846
- /* @__PURE__ */ jsx32("div", { id: "main_layout", ref: contenedor })
5847
- ] });
5911
+ if (noExiste) return /* @__PURE__ */ jsx33(FallbackWScreen, { screenName: nombre });
5912
+ return (
5913
+ // el indicador de carga flota: si ocupara lugar, el contenido de backend-plus empezaría más abajo mientras carga y subiría al terminar
5914
+ /* @__PURE__ */ jsxs23(Box24, { sx: { position: "relative" }, children: [
5915
+ cargando && /* @__PURE__ */ jsx33(CircularProgress8, { size: 24, sx: { position: "absolute", top: 16, left: 16 } }),
5916
+ error && /* @__PURE__ */ jsx33(Alert7, { severity: "error", sx: { m: 2 }, children: error }),
5917
+ /* @__PURE__ */ jsx33("div", { id: "main_layout", ref: contenedor }),
5918
+ /* @__PURE__ */ jsx33(ConsolaBP, {})
5919
+ ] })
5920
+ );
5848
5921
  };
5849
5922
  var PantallaDeRespaldo = () => {
5850
5923
  const { screenName = "" } = useParams4();
5851
5924
  const { search } = useLocation6();
5852
5925
  if (!puenteBPHabilitado()) {
5853
- return /* @__PURE__ */ jsx32(Box24, { sx: { p: 3 }, children: /* @__PURE__ */ jsx32(FallbackWScreen, { screenName }) });
5926
+ return /* @__PURE__ */ jsx33(Box24, { sx: { p: 3 }, children: /* @__PURE__ */ jsx33(FallbackWScreen, { screenName }) });
5854
5927
  }
5855
- return /* @__PURE__ */ jsx32(Navigate2, { to: rutaDePantallaBP(screenName, search), replace: true });
5928
+ return /* @__PURE__ */ jsx33(Navigate3, { to: rutaDePantallaBP(screenName, search), replace: true });
5856
5929
  };
5857
5930
  var PaginaBP = () => {
5858
5931
  const { hash, search } = useLocation6();
5859
5932
  const direccion = hash || search;
5860
5933
  const nombre = new URLSearchParams(direccion.replace(/^[#?]/, "")).get("w");
5861
- if (!puenteBPHabilitado()) return /* @__PURE__ */ jsx32(Navigate2, { to: "/", replace: true });
5862
- if (!nombre) return /* @__PURE__ */ jsx32(Box24, { sx: { p: 3 }, children: /* @__PURE__ */ jsxs24(Alert7, { severity: "warning", children: [
5934
+ if (!puenteBPHabilitado()) return /* @__PURE__ */ jsx33(Navigate3, { to: "/", replace: true });
5935
+ if (!nombre) return /* @__PURE__ */ jsx33(Box24, { sx: { p: 3 }, children: /* @__PURE__ */ jsxs23(Alert7, { severity: "warning", children: [
5863
5936
  "Falta la pantalla de backend-plus (",
5864
- /* @__PURE__ */ jsx32("code", { children: "#w=..." }),
5937
+ /* @__PURE__ */ jsx33("code", { children: "#w=..." }),
5865
5938
  ")."
5866
5939
  ] }) });
5867
- return /* @__PURE__ */ jsx32(PantallaBP, { nombre, direccion }, nombre);
5940
+ return /* @__PURE__ */ jsx33(PantallaBP, { nombre, direccion }, nombre);
5868
5941
  };
5869
5942
 
5870
5943
  // src/puente/GrillaBP.tsx
5871
- import { useEffect as useEffect14, useRef as useRef10, useState as useState18 } from "react";
5944
+ import { useEffect as useEffect15, useRef as useRef10, useState as useState18 } from "react";
5872
5945
  import { useParams as useParams5 } from "react-router-dom";
5873
5946
  import { Alert as Alert8, Box as Box25, CircularProgress as CircularProgress9 } from "@mui/material";
5874
- import { jsx as jsx33, jsxs as jsxs25 } from "react/jsx-runtime";
5947
+ import { jsx as jsx34, jsxs as jsxs24 } from "react/jsx-runtime";
5875
5948
  var GrillaBP = ({ tabla, fixedFields }) => {
5876
5949
  const contenedor = useRef10(null);
5877
5950
  const [cargando, setCargando] = useState18(true);
5878
5951
  const [error, setError] = useState18(null);
5879
5952
  const clave = JSON.stringify(fixedFields ?? []);
5880
- useEffect14(() => {
5953
+ useEffect15(() => {
5881
5954
  const elemento = contenedor.current;
5882
5955
  if (!elemento) return;
5883
5956
  let vigente = true;
@@ -5898,68 +5971,71 @@ var GrillaBP = ({ tabla, fixedFields }) => {
5898
5971
  elemento.replaceChildren();
5899
5972
  };
5900
5973
  }, [tabla, clave]);
5901
- return /* @__PURE__ */ jsxs25(Box25, { children: [
5902
- cargando && /* @__PURE__ */ jsx33(CircularProgress9, { size: 24, sx: { m: 2 } }),
5903
- error && /* @__PURE__ */ jsx33(Alert8, { severity: "error", sx: { m: 2 }, children: error }),
5904
- /* @__PURE__ */ jsx33("div", { ref: contenedor })
5905
- ] });
5974
+ return (
5975
+ // el indicador de carga flota: si ocupara lugar, el contenido de backend-plus empezaría más abajo mientras carga y subiría al terminar
5976
+ /* @__PURE__ */ jsxs24(Box25, { sx: { position: "relative" }, children: [
5977
+ cargando && /* @__PURE__ */ jsx34(CircularProgress9, { size: 24, sx: { position: "absolute", top: 16, left: 16 } }),
5978
+ error && /* @__PURE__ */ jsx34(Alert8, { severity: "error", sx: { m: 2 }, children: error }),
5979
+ /* @__PURE__ */ jsx34("div", { ref: contenedor }),
5980
+ /* @__PURE__ */ jsx34(ConsolaBP, {})
5981
+ ] })
5982
+ );
5906
5983
  };
5907
5984
  var PaginaGrillaBP = () => {
5908
5985
  const { tableName = "" } = useParams5();
5909
- return /* @__PURE__ */ jsx33(GrillaBP, { tabla: tableName }, tableName);
5986
+ return /* @__PURE__ */ jsx34(GrillaBP, { tabla: tableName }, tableName);
5910
5987
  };
5911
5988
 
5912
5989
  // src/App.tsx
5913
5990
  import typeStore6 from "type-store";
5914
- import { Fragment as Fragment5, jsx as jsx34, jsxs as jsxs26 } from "react/jsx-runtime";
5991
+ import { Fragment as Fragment5, jsx as jsx35, jsxs as jsxs25 } from "react/jsx-runtime";
5915
5992
  var LocationTracker = () => {
5916
5993
  const location = useLocation7();
5917
5994
  const dispatch = useAppDispatch();
5918
- useEffect15(() => {
5995
+ useEffect16(() => {
5919
5996
  dispatch(setCurrentPath(location.pathname + location.search));
5920
5997
  }, [location, dispatch]);
5921
5998
  return null;
5922
5999
  };
5923
6000
  function FrontendPlusReactRoutes({ myRoutes, myUnloggedRoutes, layout: Layout = MainLayout_default, unloggedLayout: UnloggedLayout }) {
5924
- return /* @__PURE__ */ jsxs26(Fragment5, { children: [
5925
- /* @__PURE__ */ jsx34(InitialRedirectHandler_default, {}),
5926
- /* @__PURE__ */ jsxs26(Routes, { children: [
5927
- /* @__PURE__ */ jsxs26(Route, { element: UnloggedLayout ? /* @__PURE__ */ jsx34(UnloggedLayout, {}) : /* @__PURE__ */ jsx34(Outlet2, {}), children: [
5928
- /* @__PURE__ */ jsx34(Route, { path: "/login", element: /* @__PURE__ */ jsx34(LoginPage_default, {}) }),
5929
- /* @__PURE__ */ jsx34(Route, { path: "/logout", element: /* @__PURE__ */ jsx34(LogoutPage_default, {}) }),
6001
+ return /* @__PURE__ */ jsxs25(Fragment5, { children: [
6002
+ /* @__PURE__ */ jsx35(InitialRedirectHandler_default, {}),
6003
+ /* @__PURE__ */ jsxs25(Routes, { children: [
6004
+ /* @__PURE__ */ jsxs25(Route, { element: UnloggedLayout ? /* @__PURE__ */ jsx35(UnloggedLayout, {}) : /* @__PURE__ */ jsx35(Outlet2, {}), children: [
6005
+ /* @__PURE__ */ jsx35(Route, { path: "/login", element: /* @__PURE__ */ jsx35(LoginPage_default, {}) }),
6006
+ /* @__PURE__ */ jsx35(Route, { path: "/logout", element: /* @__PURE__ */ jsx35(LogoutPage_default, {}) }),
5930
6007
  myUnloggedRoutes
5931
6008
  ] }),
5932
- /* @__PURE__ */ jsxs26(Route, { element: /* @__PURE__ */ jsx34(PrivateRoute_default, { children: /* @__PURE__ */ jsx34(Layout, {}) }), children: [
5933
- /* @__PURE__ */ jsx34(Route, { path: "/", element: /* @__PURE__ */ jsx34(HomePage_default, {}) }),
5934
- /* @__PURE__ */ jsx34(Route, { path: "/home", element: /* @__PURE__ */ jsx34(HomePage_default, {}) }),
5935
- /* @__PURE__ */ jsx34(Route, { path: "/table/:tableName", element: /* @__PURE__ */ jsx34(GenericDataGridPage_default, {}) }),
5936
- /* @__PURE__ */ jsx34(Route, { path: "/menu/:menuName", element: /* @__PURE__ */ jsx34(MenuTablePage_default, {}) }),
5937
- /* @__PURE__ */ jsx34(Route, { path: "/procedures/:procedureName", element: /* @__PURE__ */ jsx34(ProcedureForm_default, {}) }),
5938
- Object.keys(wScreens).map((screenName) => /* @__PURE__ */ jsx34(
6009
+ /* @__PURE__ */ jsxs25(Route, { element: /* @__PURE__ */ jsx35(PrivateRoute_default, { children: /* @__PURE__ */ jsx35(Layout, {}) }), children: [
6010
+ /* @__PURE__ */ jsx35(Route, { path: "/", element: /* @__PURE__ */ jsx35(PantallaInicial_default, {}) }),
6011
+ /* @__PURE__ */ jsx35(Route, { path: "/table/:tableName", element: /* @__PURE__ */ jsx35(GenericDataGridPage_default, {}) }),
6012
+ /* @__PURE__ */ jsx35(Route, { path: "/menu/:menuName", element: /* @__PURE__ */ jsx35(MenuTablePage_default, {}) }),
6013
+ /* @__PURE__ */ jsx35(Route, { path: "/procedures/:procedureName", element: /* @__PURE__ */ jsx35(ProcedureForm_default, {}) }),
6014
+ Object.keys(wScreens).map((screenName) => /* @__PURE__ */ jsx35(
5939
6015
  Route,
5940
6016
  {
5941
6017
  path: `/wScreens/${screenName}`,
5942
- element: /* @__PURE__ */ jsx34(PantallaDeRuta, { screenName })
6018
+ element: /* @__PURE__ */ jsx35(PantallaDeRuta, { screenName })
5943
6019
  },
5944
6020
  screenName
5945
6021
  )),
5946
- /* @__PURE__ */ jsx34(Route, { path: "/wScreens-fallback/:screenName", element: /* @__PURE__ */ jsx34(PantallaDeRespaldo, {}) }),
5947
- puenteBPHabilitado() && /* @__PURE__ */ jsx34(Route, { path: "/bp/menu", element: /* @__PURE__ */ jsx34(PaginaBP, {}) }),
5948
- puenteBPHabilitado() && /* @__PURE__ */ jsx34(Route, { path: "/bp/table/:tableName", element: /* @__PURE__ */ jsx34(PaginaGrillaBP, {}) }),
6022
+ /* @__PURE__ */ jsx35(Route, { path: "/wScreens-fallback/:screenName", element: /* @__PURE__ */ jsx35(PantallaDeRespaldo, {}) }),
6023
+ puenteBPHabilitado() && /* @__PURE__ */ jsx35(Route, { path: "/bp/menu", element: /* @__PURE__ */ jsx35(PaginaBP, {}) }),
6024
+ puenteBPHabilitado() && /* @__PURE__ */ jsx35(Route, { path: "/bp/table/:tableName", element: /* @__PURE__ */ jsx35(PaginaGrillaBP, {}) }),
5949
6025
  myRoutes,
5950
- /* @__PURE__ */ jsx34(Route, { path: "*", element: /* @__PURE__ */ jsx34("div", { style: { marginTop: "20px", marginLeft: "10px" }, children: "404 - Recurso No Encontrado" }) })
6026
+ /* @__PURE__ */ jsx35(Route, { path: "*", element: /* @__PURE__ */ jsx35("div", { style: { marginTop: "20px", marginLeft: "10px" }, children: "404 - Recurso No Encontrado" }) })
5951
6027
  ] }),
5952
- /* @__PURE__ */ jsx34(Route, { path: "*", element: /* @__PURE__ */ jsx34(Navigate3, { to: "/", replace: true }) })
6028
+ /* @__PURE__ */ jsx35(Route, { path: "*", element: /* @__PURE__ */ jsx35(Navigate4, { to: "/", replace: true }) })
5953
6029
  ] })
5954
6030
  ] });
5955
6031
  }
5956
6032
  var FrontendPlusProviders = ({ children, publicPaths }) => {
5957
- return /* @__PURE__ */ jsx34(Provider, { store, children: /* @__PURE__ */ jsx34(PersistGate, { loading: null, persistor, children: /* @__PURE__ */ jsxs26(BrowserRouter, { basename: rutaBase, children: [
5958
- /* @__PURE__ */ jsx34(LocationTracker, {}),
6033
+ return /* @__PURE__ */ jsx35(Provider, { store, children: /* @__PURE__ */ jsx35(PersistGate, { loading: null, persistor, children: /* @__PURE__ */ jsxs25(BrowserRouter, { basename: rutaBase, children: [
6034
+ /* @__PURE__ */ jsx35(LocationTracker, {}),
5959
6035
  " ",
5960
- /* @__PURE__ */ jsx34(AppProvider, { publicPaths, children: /* @__PURE__ */ jsxs26(SnackbarProvider, { children: [
6036
+ /* @__PURE__ */ jsx35(AppProvider, { publicPaths, children: /* @__PURE__ */ jsxs25(SnackbarProvider, { children: [
5961
6037
  children,
5962
- /* @__PURE__ */ jsx34(SessionExpiredMessage_default, {})
6038
+ /* @__PURE__ */ jsx35(SessionExpiredMessage_default, {})
5963
6039
  ] }) })
5964
6040
  ] }) }) });
5965
6041
  };
@@ -5990,7 +6066,7 @@ var App = ({
5990
6066
  habilitarPuenteBP();
5991
6067
  }
5992
6068
  }, [myClientSides, myResultsOk, myWScreens, myConditions, puenteBP]);
5993
- useEffect15(() => {
6069
+ useEffect16(() => {
5994
6070
  typeStore6.messages = typeStore6.i18n.messages.es;
5995
6071
  typeStore6.locale = typeStore6.i18n.locale.es;
5996
6072
  const link = document.querySelector("link[rel*='icon']") || document.createElement("link");
@@ -5999,11 +6075,11 @@ var App = ({
5999
6075
  link.href = `${envConfig.backendUrl}/img/logo-128.png`;
6000
6076
  document.getElementsByTagName("head")[0].appendChild(link);
6001
6077
  }, []);
6002
- const safePaths = React27.useMemo(() => {
6078
+ const safePaths = React28.useMemo(() => {
6003
6079
  const extracted = extractPathsFromRoutes(myUnloggedRoutes);
6004
6080
  return ["/login", "/logout", ...extracted];
6005
6081
  }, [myUnloggedRoutes]);
6006
- return /* @__PURE__ */ jsx34(FrontendPlusProviders, { publicPaths: safePaths, children: /* @__PURE__ */ jsx34(
6082
+ return /* @__PURE__ */ jsx35(FrontendPlusProviders, { publicPaths: safePaths, children: /* @__PURE__ */ jsx35(
6007
6083
  FrontendPlusReactRoutes,
6008
6084
  {
6009
6085
  myRoutes,