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.cjs CHANGED
@@ -4190,8 +4190,8 @@ var GenericDataGrid = ({
4190
4190
  var GenericDataGrid_default = GenericDataGrid;
4191
4191
 
4192
4192
  // src/App.tsx
4193
- var import_react37 = __toESM(require("react"), 1);
4194
- var import_react_router_dom14 = require("react-router-dom");
4193
+ var import_react38 = __toESM(require("react"), 1);
4194
+ var import_react_router_dom15 = require("react-router-dom");
4195
4195
 
4196
4196
  // src/components/MainLayout.tsx
4197
4197
  var import_react26 = require("react");
@@ -4312,13 +4312,33 @@ var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"), 1);
4312
4312
  var import_TableChart = __toESM(require("@mui/icons-material/TableChart"), 1);
4313
4313
  var import_Folder = __toESM(require("@mui/icons-material/Folder"), 1);
4314
4314
  var import_Dns = __toESM(require("@mui/icons-material/Dns"), 1);
4315
- var import_Home = __toESM(require("@mui/icons-material/Home"), 1);
4316
4315
  var import_WarningAmber3 = __toESM(require("@mui/icons-material/WarningAmber"), 1);
4317
4316
  var import_DesktopWindows = __toESM(require("@mui/icons-material/DesktopWindows"), 1);
4318
4317
  var import_UnfoldMore = __toESM(require("@mui/icons-material/UnfoldMore"), 1);
4319
4318
  var import_UnfoldLess = __toESM(require("@mui/icons-material/UnfoldLess"), 1);
4320
4319
  var import_react_router_dom2 = require("react-router-dom");
4321
4320
  var import_colors = require("@mui/material/colors");
4321
+
4322
+ // src/utils/menuInicial.ts
4323
+ function rutaDeItemDeMenu(item) {
4324
+ if (item.menuType === "table") {
4325
+ const consulta = new URLSearchParams();
4326
+ if (item.td) consulta.append("td", JSON.stringify(item.td));
4327
+ if (item.fc) consulta.append("fc", JSON.stringify(item.fc));
4328
+ return `/menu/${item.name}${consulta.size ? `?${consulta.toString()}` : ""}`;
4329
+ }
4330
+ if (item.menuType === "proc") return `/procedures/${item.name}`;
4331
+ if (wScreens[item.menuType] !== void 0) return `/wScreens/${item.menuType}`;
4332
+ console.warn(`Menu type '${item.menuType}' no reconocido o WScreen no mapeada.`);
4333
+ return `/wScreens-fallback/${item.menuType}`;
4334
+ }
4335
+ function itemInicial(menu) {
4336
+ const elegido = menu.find((item) => item.selectedByDefault);
4337
+ if (!elegido) return void 0;
4338
+ return elegido.menuType === "menu" ? itemInicial(elegido.menuContent) : elegido;
4339
+ }
4340
+
4341
+ // src/components/SideMenu.tsx
4322
4342
  var import_jsx_runtime20 = require("react/jsx-runtime");
4323
4343
  var MenuListItem = ({ item, level, onMenuItemClick }) => {
4324
4344
  const navigate = (0, import_react_router_dom2.useNavigate)();
@@ -4329,29 +4349,7 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
4329
4349
  if (item.menuType === "menu") {
4330
4350
  dispatch(toggleSubMenu(item.name));
4331
4351
  } else {
4332
- let path = "";
4333
- const queryParams = new URLSearchParams();
4334
- if (item.menuType === "table") {
4335
- path = `/menu/${item.name}`;
4336
- if (item.td) queryParams.append("td", JSON.stringify(item.td));
4337
- if (item.fc) queryParams.append("fc", JSON.stringify(item.fc));
4338
- if (queryParams.toString()) {
4339
- path = `${path}?${queryParams.toString()}`;
4340
- }
4341
- } else if (item.menuType === "proc") {
4342
- path = `/procedures/${item.name}`;
4343
- } else {
4344
- const WScreenComponent = wScreens[item.menuType];
4345
- if (WScreenComponent !== void 0) {
4346
- path = `/wScreens/${item.menuType}`;
4347
- } else {
4348
- path = `/wScreens-fallback/${item.menuType}`;
4349
- console.warn(`Menu type '${item.menuType}' no reconocido o WScreen no mapeada.`);
4350
- }
4351
- }
4352
- if (path) {
4353
- navigate(path);
4354
- }
4352
+ navigate(rutaDeItemDeMenu(item));
4355
4353
  if (onMenuItemClick) {
4356
4354
  onMenuItemClick();
4357
4355
  }
@@ -4424,19 +4422,12 @@ var SideMenu = ({ onMenuItemClick }) => {
4424
4422
  const allSubMenusKeys = Object.keys(subMenuOpenStates);
4425
4423
  const openSubMenusCount = allSubMenusKeys.filter((key) => subMenuOpenStates[key]).length;
4426
4424
  const isMostlyOpen = allSubMenusKeys.length > 0 && openSubMenusCount / allSubMenusKeys.length > 0.5;
4427
- const handleHomeClick = () => {
4428
- navigate("/home");
4429
- if (onMenuItemClick) {
4430
- onMenuItemClick();
4431
- }
4432
- };
4433
4425
  const handleToggleAllSubMenus = () => {
4434
4426
  dispatch(setAllSubMenusOpen(!isMostlyOpen));
4435
4427
  };
4436
4428
  if (!clientContext || !clientContext.menu) {
4437
4429
  return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.Box, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.Typography, { variant: "body2", color: "text.secondary", children: "Cargando men\xFA..." }) });
4438
4430
  }
4439
- const isHomeSelected = location.pathname === "/home";
4440
4431
  (0, import_react24.useEffect)(() => {
4441
4432
  if (!clientContext?.menu) return;
4442
4433
  const expandParents = (items, targetPath, parentNames = []) => {
@@ -4472,22 +4463,15 @@ var SideMenu = ({ onMenuItemClick }) => {
4472
4463
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.ListItemText, { primary: isMostlyOpen ? "colapsar " : "expandir" })
4473
4464
  ] }) }),
4474
4465
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.Divider, {}),
4475
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material16.List, { children: [
4476
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.ListItem, { disablePadding: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material16.ListItemButton, { onClick: handleHomeClick, selected: isHomeSelected, children: [
4477
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.ListItemIcon, { sx: { minWidth: "38px" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_Home.default, {}) }),
4478
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.ListItemText, { primary: "Inicio" })
4479
- ] }) }),
4480
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.Divider, {}),
4481
- clientContext.menu.map((menuItem) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4482
- MenuListItem,
4483
- {
4484
- item: menuItem,
4485
- level: 1,
4486
- onMenuItemClick
4487
- },
4488
- menuItem.name
4489
- ))
4490
- ] })
4466
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.List, { children: clientContext.menu.map((menuItem) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4467
+ MenuListItem,
4468
+ {
4469
+ item: menuItem,
4470
+ level: 1,
4471
+ onMenuItemClick
4472
+ },
4473
+ menuItem.name
4474
+ )) })
4491
4475
  ] });
4492
4476
  };
4493
4477
  var SideMenu_default = SideMenu;
@@ -4546,7 +4530,6 @@ var MainLayout = () => {
4546
4530
  if (!clientContext) {
4547
4531
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Box, { sx: { display: "flex", justifyContent: "center", alignItems: "center", height: "100vh" }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Typography, { children: "Cargando dise\xF1o de la aplicaci\xF3n..." }) });
4548
4532
  }
4549
- const appBarOffset = theme.mixins.toolbar;
4550
4533
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material17.Box, { sx: { display: "flex", height: "100vh" }, children: [
4551
4534
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.CssBaseline, {}),
4552
4535
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
@@ -4650,7 +4633,7 @@ var MainLayout = () => {
4650
4633
  ]
4651
4634
  }
4652
4635
  ),
4653
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4636
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
4654
4637
  import_material17.Box,
4655
4638
  {
4656
4639
  component: "main",
@@ -4670,15 +4653,16 @@ var MainLayout = () => {
4670
4653
  },
4671
4654
  minWidth: 0,
4672
4655
  flexShrink: 0,
4673
- // Asegúrate de que el paddingTop sea suficiente para la AppBar
4674
- paddingTop: `${appBarOffset.minHeight}px`,
4675
4656
  height: "100%",
4676
4657
  boxSizing: "border-box",
4677
4658
  display: "flex",
4678
4659
  flexDirection: "column",
4679
4660
  width: isDrawerOpen ? `calc(100% - ${drawerWidth}px)` : "100%"
4680
4661
  },
4681
- children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_router_dom4.Outlet, {})
4662
+ children: [
4663
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Toolbar, {}),
4664
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.Box, { sx: { flex: 1, minHeight: 0, overflowY: "auto", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react_router_dom4.Outlet, {}) })
4665
+ ]
4682
4666
  }
4683
4667
  )
4684
4668
  ] });
@@ -4736,28 +4720,26 @@ var SessionExpiredMessage = () => {
4736
4720
  };
4737
4721
  var SessionExpiredMessage_default = SessionExpiredMessage;
4738
4722
 
4739
- // src/pages/HomePage.tsx
4740
- var import_material19 = require("@mui/material");
4723
+ // src/pages/PantallaInicial.tsx
4724
+ var import_react_router_dom5 = require("react-router-dom");
4741
4725
  var import_jsx_runtime23 = require("react/jsx-runtime");
4742
- var HomePage = () => {
4726
+ var PantallaInicial = () => {
4743
4727
  const { clientContext } = useApp();
4744
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_material19.Box, { sx: { p: 3 }, children: [
4745
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Typography, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${clientContext?.username}` }),
4746
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Typography, { variant: "body1", children: "Usa el men\xFA lateral para navegar por las diferentes secciones." })
4747
- ] });
4728
+ const item = clientContext.menu ? itemInicial(clientContext.menu) : void 0;
4729
+ return item ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_router_dom5.Navigate, { to: rutaDeItemDeMenu(item), replace: true }) : null;
4748
4730
  };
4749
- var HomePage_default = HomePage;
4731
+ var PantallaInicial_default = PantallaInicial;
4750
4732
 
4751
4733
  // src/pages/LogoutPage.tsx
4752
4734
  var import_react27 = require("react");
4753
- var import_material20 = require("@mui/material");
4735
+ var import_material19 = require("@mui/material");
4754
4736
  var import_jsx_runtime24 = require("react/jsx-runtime");
4755
4737
  var LogoutPage = () => {
4756
4738
  const logout = useLogout_default();
4757
4739
  (0, import_react27.useEffect)(() => {
4758
4740
  logout();
4759
4741
  }, [logout]);
4760
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material20.Box, { sx: {
4742
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material19.Box, { sx: {
4761
4743
  display: "flex",
4762
4744
  flexDirection: "column",
4763
4745
  justifyContent: "center",
@@ -4765,19 +4747,19 @@ var LogoutPage = () => {
4765
4747
  height: "100vh",
4766
4748
  textAlign: "center"
4767
4749
  }, children: [
4768
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material20.CircularProgress, { size: 60 }),
4769
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material20.Typography, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
4750
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.CircularProgress, { size: 60 }),
4751
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material19.Typography, { variant: "h6", sx: { mt: 2 }, children: "Cerrando sesi\xF3n..." })
4770
4752
  ] });
4771
4753
  };
4772
4754
  var LogoutPage_default = LogoutPage;
4773
4755
 
4774
4756
  // src/pages/LoginPage.tsx
4775
4757
  var import_react28 = require("react");
4776
- var import_material21 = require("@mui/material");
4758
+ var import_material20 = require("@mui/material");
4777
4759
  var import_react_hook_form = require("react-hook-form");
4778
4760
  var import_zod = require("@hookform/resolvers/zod");
4779
4761
  var z = __toESM(require("zod"), 1);
4780
- var import_react_router_dom5 = require("react-router-dom");
4762
+ var import_react_router_dom6 = require("react-router-dom");
4781
4763
  var import_react_redux4 = require("react-redux");
4782
4764
  var import_jsx_runtime25 = require("react/jsx-runtime");
4783
4765
  var loginSchema = z.object({
@@ -4787,7 +4769,7 @@ var loginSchema = z.object({
4787
4769
  // Añadir validación básica
4788
4770
  });
4789
4771
  var LoginPage = () => {
4790
- const navigate = (0, import_react_router_dom5.useNavigate)();
4772
+ const navigate = (0, import_react_router_dom6.useNavigate)();
4791
4773
  const [loginError, setLoginError] = (0, import_react28.useState)(null);
4792
4774
  const [isSubmitting, setIsSubmitting] = (0, import_react28.useState)(false);
4793
4775
  const { setIsLoggedIn, checkSession } = useApp();
@@ -4825,7 +4807,7 @@ var LoginPage = () => {
4825
4807
  setIsLoggedIn(true);
4826
4808
  await dispatch(fetchClientContext()).unwrap();
4827
4809
  console.log("Login exitoso y clientContext cargado.");
4828
- navigate("/home");
4810
+ navigate("/");
4829
4811
  reset();
4830
4812
  } catch (error) {
4831
4813
  console.error("Error al iniciar sesi\xF3n:", error);
@@ -4836,7 +4818,7 @@ var LoginPage = () => {
4836
4818
  }
4837
4819
  };
4838
4820
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4839
- import_material21.Box,
4821
+ import_material20.Box,
4840
4822
  {
4841
4823
  display: "flex",
4842
4824
  alignItems: "center",
@@ -4844,7 +4826,7 @@ var LoginPage = () => {
4844
4826
  minHeight: "100vh",
4845
4827
  bgcolor: "#f5f5f5",
4846
4828
  children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
4847
- import_material21.Box,
4829
+ import_material20.Box,
4848
4830
  {
4849
4831
  width: "100%",
4850
4832
  maxWidth: "400px",
@@ -4853,7 +4835,7 @@ var LoginPage = () => {
4853
4835
  borderRadius: 8,
4854
4836
  boxShadow: 3,
4855
4837
  children: [
4856
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material21.Box, { sx: { display: "flex", justifyContent: "center", mb: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4838
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Box, { sx: { display: "flex", justifyContent: "center", mb: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4857
4839
  "img",
4858
4840
  {
4859
4841
  src: `${envConfig.backendUrl}/img/login-logo-icon.png`,
@@ -4861,17 +4843,17 @@ var LoginPage = () => {
4861
4843
  style: { height: "192px", maxWidth: "100%", objectFit: "contain" }
4862
4844
  }
4863
4845
  ) }),
4864
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material21.Typography, { variant: "h5", align: "center", gutterBottom: true, sx: { fontWeight: "bold", color: "primary.main" }, children: "Iniciar Sesi\xF3n" }),
4846
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Typography, { variant: "h5", align: "center", gutterBottom: true, sx: { fontWeight: "bold", color: "primary.main" }, children: "Iniciar Sesi\xF3n" }),
4865
4847
  /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
4866
4848
  /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
4867
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { htmlFor: "username", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material21.Typography, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
4849
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { htmlFor: "username", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Typography, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Usuario" }) }),
4868
4850
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4869
4851
  import_react_hook_form.Controller,
4870
4852
  {
4871
4853
  name: "username",
4872
4854
  control,
4873
4855
  render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4874
- import_material21.TextField,
4856
+ import_material20.TextField,
4875
4857
  {
4876
4858
  ...field,
4877
4859
  type: "text",
@@ -4887,14 +4869,14 @@ var LoginPage = () => {
4887
4869
  )
4888
4870
  ] }),
4889
4871
  /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
4890
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { htmlFor: "password", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material21.Typography, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
4872
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("label", { htmlFor: "password", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Typography, { variant: "subtitle1", component: "div", sx: { fontWeight: "medium" }, children: "Contrase\xF1a" }) }),
4891
4873
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4892
4874
  import_react_hook_form.Controller,
4893
4875
  {
4894
4876
  name: "password",
4895
4877
  control,
4896
4878
  render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4897
- import_material21.TextField,
4879
+ import_material20.TextField,
4898
4880
  {
4899
4881
  ...field,
4900
4882
  type: "password",
@@ -4909,14 +4891,14 @@ var LoginPage = () => {
4909
4891
  }
4910
4892
  )
4911
4893
  ] }),
4912
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material21.Button, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
4913
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material21.CircularProgress, { size: 20, sx: { mr: 1 } }),
4894
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.Button, { type: "submit", fullWidth: true, variant: "contained", color: "primary", disabled: isSubmitting, sx: { mt: 2 }, children: isSubmitting ? /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
4895
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.CircularProgress, { size: 20, sx: { mr: 1 } }),
4914
4896
  "Iniciando sesi\xF3n..."
4915
4897
  ] }) : "Iniciar Sesi\xF3n" })
4916
4898
  ] }),
4917
- loginError && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material21.Alert, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
4899
+ loginError && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_material20.Alert, { severity: "error", sx: { mt: 2, maxHeight: "200px" }, children: [
4918
4900
  " ",
4919
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material21.AlertTitle, { children: "Error" }),
4901
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.AlertTitle, { children: "Error" }),
4920
4902
  loginError
4921
4903
  ] })
4922
4904
  ]
@@ -4929,18 +4911,18 @@ var LoginPage_default = LoginPage;
4929
4911
 
4930
4912
  // src/components/ProcedureForm.tsx
4931
4913
  var import_react29 = __toESM(require("react"), 1);
4932
- var import_react_router_dom6 = require("react-router-dom");
4933
- var import_material23 = require("@mui/material");
4914
+ var import_react_router_dom7 = require("react-router-dom");
4915
+ var import_material22 = require("@mui/material");
4934
4916
 
4935
4917
  // src/pages/procedure-results/SuccessDisplay.tsx
4936
- var import_material22 = require("@mui/material");
4918
+ var import_material21 = require("@mui/material");
4937
4919
  var import_jsx_runtime26 = require("react/jsx-runtime");
4938
4920
  var SuccessDisplay = ({ data }) => {
4939
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material22.Paper, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
4940
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material22.Typography, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
4941
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material22.Typography, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
4942
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material22.Box, { sx: { bgcolor: "success.dark", p: 1, borderRadius: 1, mt: 1, overflowX: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(data, null, 2) }) }),
4943
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material22.Typography, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
4921
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material21.Paper, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
4922
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Typography, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
4923
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Typography, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
4924
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Box, { sx: { bgcolor: "success.dark", p: 1, borderRadius: 1, mt: 1, overflowX: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("pre", { style: { margin: 0, fontSize: "0.75rem", color: "white" }, children: JSON.stringify(data, null, 2) }) }),
4925
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material21.Typography, { variant: "body2", sx: { fontSize: "0.8rem", mt: 1 }, children: "Puedes revisar los detalles anteriores o cerrar este mensaje." })
4944
4926
  ] });
4945
4927
  };
4946
4928
  var SuccessDisplay_default = SuccessDisplay;
@@ -4956,7 +4938,7 @@ var extendResultsOk = (newComponents) => {
4956
4938
  // src/components/ProcedureForm.tsx
4957
4939
  var import_jsx_runtime27 = require("react/jsx-runtime");
4958
4940
  var ProcedureForm = () => {
4959
- const { procedureName } = (0, import_react_router_dom6.useParams)();
4941
+ const { procedureName } = (0, import_react_router_dom7.useParams)();
4960
4942
  const { clientContext } = useApp();
4961
4943
  const { callApi, loading: apiLoading, error: apiError } = useApiCall();
4962
4944
  const [validationErrors, setValidationErrors] = (0, import_react29.useState)({});
@@ -5169,10 +5151,10 @@ var ProcedureForm = () => {
5169
5151
  sx: { fontSize: "0.8rem" }
5170
5152
  };
5171
5153
  if (param.options && param.options.length > 0) {
5172
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.FormControl, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
5173
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.InputLabel, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
5154
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.FormControl, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
5155
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.InputLabel, { id: `${param.name}-label`, sx: { fontSize: "0.8rem" }, children: param.label || param.name }),
5174
5156
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5175
- import_material23.Select,
5157
+ import_material22.Select,
5176
5158
  {
5177
5159
  labelId: `${param.name}-label`,
5178
5160
  value: formValues[param.name] === void 0 ? "" : formValues[param.name],
@@ -5182,14 +5164,14 @@ var ProcedureForm = () => {
5182
5164
  label: param.label || param.name,
5183
5165
  disabled: apiLoading,
5184
5166
  sx: { fontSize: "0.8rem" },
5185
- renderValue: (selected) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Typography, { sx: { fontSize: "0.8rem" }, children: selected }),
5167
+ renderValue: (selected) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Typography, { sx: { fontSize: "0.8rem" }, children: selected }),
5186
5168
  children: [
5187
- (!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.MenuItem, { value: "", sx: { fontSize: "0.8rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("em", { children: "Seleccione..." }) }),
5188
- param.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.MenuItem, { value: option, sx: { fontSize: "0.8rem" }, children: option }, option))
5169
+ (!commonProps.required || formValues[param.name] === "") && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.MenuItem, { value: "", sx: { fontSize: "0.8rem" }, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("em", { children: "Seleccione..." }) }),
5170
+ param.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.MenuItem, { value: option, sx: { fontSize: "0.8rem" }, children: option }, option))
5189
5171
  ]
5190
5172
  }
5191
5173
  ),
5192
- (param.description || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
5174
+ (param.description || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
5193
5175
  ] });
5194
5176
  }
5195
5177
  switch (param.typeName) {
@@ -5198,19 +5180,19 @@ var ProcedureForm = () => {
5198
5180
  case "tsrange":
5199
5181
  case "time_range":
5200
5182
  case "daterange":
5201
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.TextField, { type: "text", value: formValues[param.name] || "", ...commonProps });
5183
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.TextField, { type: "text", value: formValues[param.name] || "", ...commonProps });
5202
5184
  case "decimal":
5203
5185
  case "double":
5204
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.TextField, { type: "number", inputProps: { step: "any", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
5186
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.TextField, { type: "number", inputProps: { step: "any", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
5205
5187
  case "integer":
5206
5188
  case "bigint":
5207
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.TextField, { type: "number", inputProps: { step: "1", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
5189
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.TextField, { type: "number", inputProps: { step: "1", style: { fontSize: "0.8rem" } }, value: formValues[param.name] || "", ...commonProps });
5208
5190
  case "boolean":
5209
5191
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5210
- import_material23.FormControlLabel,
5192
+ import_material22.FormControlLabel,
5211
5193
  {
5212
5194
  control: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5213
- import_material23.Checkbox,
5195
+ import_material22.Checkbox,
5214
5196
  {
5215
5197
  checked: !!formValues[param.name],
5216
5198
  onChange: handleChange,
@@ -5220,20 +5202,20 @@ var ProcedureForm = () => {
5220
5202
  size: "small"
5221
5203
  }
5222
5204
  ),
5223
- label: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Typography, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
5205
+ label: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Typography, { sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "inherit" }, children: param.label || param.name }),
5224
5206
  sx: { mt: 1, mb: 0 }
5225
5207
  }
5226
5208
  );
5227
5209
  case "date":
5228
5210
  case "timestamp":
5229
5211
  case "time":
5230
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.TextField, { type: param.typeName === "date" ? "date" : param.typeName === "timestamp" ? "datetime-local" : "time", value: formValues[param.name] || "", ...commonProps, InputLabelProps: { shrink: true, sx: { fontSize: "0.8rem" } } });
5212
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.TextField, { type: param.typeName === "date" ? "date" : param.typeName === "timestamp" ? "datetime-local" : "time", value: formValues[param.name] || "", ...commonProps, InputLabelProps: { shrink: true, sx: { fontSize: "0.8rem" } } });
5231
5213
  case "jsonb":
5232
5214
  case "jsona":
5233
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.TextField, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
5215
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.TextField, { multiline: true, rows: 5, value: formValues[param.name] || "", ...commonProps, InputProps: { sx: { fontSize: "0.8rem" } } });
5234
5216
  case "bytea":
5235
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.FormControl, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
5236
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Typography, { variant: "body2", color: "textSecondary", component: "label", htmlFor: param.name, sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "text.secondary" }, children: param.label || param.name }),
5217
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.FormControl, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
5218
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Typography, { variant: "body2", color: "textSecondary", component: "label", htmlFor: param.name, sx: { fontSize: "0.8rem", color: hasError ? "error.main" : "text.secondary" }, children: param.label || param.name }),
5237
5219
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5238
5220
  "input",
5239
5221
  {
@@ -5248,10 +5230,10 @@ var ProcedureForm = () => {
5248
5230
  style: { padding: "6px 0", fontSize: "0.8rem" }
5249
5231
  }
5250
5232
  ),
5251
- (param.description || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
5233
+ (param.description || errorMessage) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.FormHelperText, { sx: { fontSize: "0.7rem" }, children: errorMessage || param.description })
5252
5234
  ] });
5253
5235
  default:
5254
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.TextField, { type: "text", value: formValues[param.name] || "", ...commonProps });
5236
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.TextField, { type: "text", value: formValues[param.name] || "", ...commonProps });
5255
5237
  }
5256
5238
  }, [formValues, handleChange, apiLoading, validationErrors]);
5257
5239
  const ResultDisplayContent = (0, import_react29.useMemo)(() => {
@@ -5260,13 +5242,13 @@ var ProcedureForm = () => {
5260
5242
  if (ComponentToRender) {
5261
5243
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ComponentToRender, { data: procedureResultData });
5262
5244
  } else {
5263
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.Paper, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
5264
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.Typography, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
5245
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Paper, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
5246
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Typography, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: [
5265
5247
  "el componente para resolver el resultOk: '",
5266
5248
  procedure.resultOk,
5267
5249
  "' definido en el procedure no existe o no est\xE1 mapeado."
5268
5250
  ] }),
5269
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Box, { sx: {
5251
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Box, { sx: {
5270
5252
  bgcolor: "warning.dark",
5271
5253
  p: 1,
5272
5254
  borderRadius: 1
@@ -5275,7 +5257,7 @@ var ProcedureForm = () => {
5275
5257
  }
5276
5258
  }, [procedureResultData, procedure]);
5277
5259
  if (!procedure) {
5278
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.Box, { sx: {
5260
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Box, { sx: {
5279
5261
  p: 2,
5280
5262
  width: "100%",
5281
5263
  boxSizing: "border-box",
@@ -5285,13 +5267,13 @@ var ProcedureForm = () => {
5285
5267
  boxShadow: 3,
5286
5268
  textAlign: "center"
5287
5269
  }, children: [
5288
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.CircularProgress, { sx: { mb: 2 } }),
5289
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Typography, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
5270
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.CircularProgress, { sx: { mb: 2 } }),
5271
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Typography, { variant: "h6", color: "text.secondary", children: "Cargando procedimiento o no encontrado..." })
5290
5272
  ] });
5291
5273
  }
5292
5274
  return (
5293
5275
  // Esta es la Box más externa que ahora controlará el scroll
5294
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.Box, { sx: {
5276
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Box, { sx: {
5295
5277
  p: 2,
5296
5278
  ml: 1,
5297
5279
  mt: 2,
@@ -5308,17 +5290,17 @@ var ProcedureForm = () => {
5308
5290
  overflowX: "hidden"
5309
5291
  // Oculta el scroll horizontal si no es necesario para el contenedor principal
5310
5292
  }, children: [
5311
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Typography, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
5312
- Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.Alert, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
5293
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Typography, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
5294
+ Object.values(validationErrors).some((err) => err !== null) && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Alert, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: [
5313
5295
  "Por favor, corrige los errores en el formulario antes de enviar.",
5314
5296
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("ul", { children: Object.values(validationErrors).map((err, idx) => err && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("li", { children: err }, idx)) })
5315
5297
  ] }),
5316
- !Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Alert, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: apiError.message }),
5317
- !Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Alert, { severity: "success", sx: { mb: 2, fontSize: "0.8rem" }, children: successMessage }),
5298
+ !Object.values(validationErrors).some((err) => err !== null) && apiError && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Alert, { severity: "error", sx: { mb: 2, fontSize: "0.8rem" }, children: apiError.message }),
5299
+ !Object.values(validationErrors).some((err) => err !== null) && !apiError && successMessage && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Alert, { severity: "success", sx: { mb: 2, fontSize: "0.8rem" }, children: successMessage }),
5318
5300
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("form", { onSubmit: handleSubmit, children: [
5319
5301
  procedure.parameters.map((param) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: renderInputField(param) }, param.name)),
5320
5302
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5321
- import_material23.Button,
5303
+ import_material22.Button,
5322
5304
  {
5323
5305
  type: "submit",
5324
5306
  variant: "contained",
@@ -5326,20 +5308,20 @@ var ProcedureForm = () => {
5326
5308
  disabled: apiLoading || Object.values(validationErrors).some((err) => err !== null),
5327
5309
  sx: { mt: 2 },
5328
5310
  size: "medium",
5329
- startIcon: apiLoading ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.CircularProgress, { size: 20, color: "inherit" }) : null,
5311
+ startIcon: apiLoading ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.CircularProgress, { size: 20, color: "inherit" }) : null,
5330
5312
  children: apiLoading ? "Ejecutando..." : procedure.proceedLabel || "Ejecutar"
5331
5313
  }
5332
5314
  )
5333
5315
  ] }),
5334
- ResultDisplayContent && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.Box, { sx: { mt: 2 }, children: [
5316
+ ResultDisplayContent && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Box, { sx: { mt: 2 }, children: [
5335
5317
  " ",
5336
5318
  ResultDisplayContent
5337
5319
  ] }),
5338
- executionLog.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.Box, { sx: { mt: 3 }, children: [
5339
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Divider, { sx: { mb: 2 } }),
5340
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Typography, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
5320
+ executionLog.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Box, { sx: { mt: 3 }, children: [
5321
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Divider, { sx: { mb: 2 } }),
5322
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Typography, { variant: "h6", gutterBottom: true, sx: { fontSize: "0.9rem" }, children: "Registro de Ejecuci\xF3n" }),
5341
5323
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5342
- import_material23.Box,
5324
+ import_material22.Box,
5343
5325
  {
5344
5326
  sx: {
5345
5327
  bgcolor: "grey.100",
@@ -5353,7 +5335,7 @@ var ProcedureForm = () => {
5353
5335
  whiteSpace: "pre-wrap"
5354
5336
  },
5355
5337
  children: executionLog.map((log, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5356
- import_material23.Typography,
5338
+ import_material22.Typography,
5357
5339
  {
5358
5340
  component: "pre",
5359
5341
  sx: {
@@ -5375,14 +5357,14 @@ var ProcedureForm_default = ProcedureForm;
5375
5357
 
5376
5358
  // src/App.tsx
5377
5359
  var import_react_redux5 = require("react-redux");
5378
- var import_react38 = require("redux-persist/integration/react");
5360
+ var import_react39 = require("redux-persist/integration/react");
5379
5361
 
5380
5362
  // src/components/PrivateRoute.tsx
5381
5363
  var import_react30 = require("react");
5382
- var import_react_router_dom7 = require("react-router-dom");
5364
+ var import_react_router_dom8 = require("react-router-dom");
5383
5365
  var import_jsx_runtime28 = require("react/jsx-runtime");
5384
5366
  var PrivateRoute = ({ children }) => {
5385
- const location = (0, import_react_router_dom7.useLocation)();
5367
+ const location = (0, import_react_router_dom8.useLocation)();
5386
5368
  const dispatch = useAppDispatch();
5387
5369
  const clientContextStatus = useClientContextStatus();
5388
5370
  const isAuthenticated = clientContextStatus === "succeeded";
@@ -5391,7 +5373,7 @@ var PrivateRoute = ({ children }) => {
5391
5373
  (0, import_react30.useEffect)(() => {
5392
5374
  console.log(`[PrivateRoute] Effect: Path=${location.pathname}, AuthStatus=${clientContextStatus}, IsAuthenticated=${isAuthenticated}, IsLoadingAuth=${isLoadingAuth}`);
5393
5375
  if (!isAuthenticated && !isLoadingAuth && location.pathname !== "/login") {
5394
- const path = location.pathname + location.search;
5376
+ const path = location.pathname + location.search + location.hash;
5395
5377
  console.log(`[PrivateRoute] ACTION: Dispatching setRedirectPath(${path})`);
5396
5378
  dispatch(setRedirectPath(path));
5397
5379
  } else if (isAuthenticated) {
@@ -5408,7 +5390,7 @@ var PrivateRoute = ({ children }) => {
5408
5390
  }
5409
5391
  if (!isAuthenticated) {
5410
5392
  console.log(`[PrivateRoute] User not authenticated, navigating to /login`);
5411
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_router_dom7.Navigate, { to: "/login", replace: true });
5393
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_react_router_dom8.Navigate, { to: "/login", replace: true });
5412
5394
  }
5413
5395
  console.log(`[PrivateRoute] User authenticated, rendering children.`);
5414
5396
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children });
@@ -5417,10 +5399,10 @@ var PrivateRoute_default = PrivateRoute;
5417
5399
 
5418
5400
  // src/components/InitialRedirectHandler.tsx
5419
5401
  var import_react31 = require("react");
5420
- var import_react_router_dom8 = require("react-router-dom");
5402
+ var import_react_router_dom9 = require("react-router-dom");
5421
5403
  var InitialRedirectHandler = () => {
5422
- const location = (0, import_react_router_dom8.useLocation)();
5423
- const navigate = (0, import_react_router_dom8.useNavigate)();
5404
+ const location = (0, import_react_router_dom9.useLocation)();
5405
+ const navigate = (0, import_react_router_dom9.useNavigate)();
5424
5406
  const dispatch = useAppDispatch();
5425
5407
  const redirectPath = useRedirectPath();
5426
5408
  const clientContextStatus = useClientContextStatus();
@@ -5438,9 +5420,9 @@ var InitialRedirectHandler = () => {
5438
5420
  navegandoRef.current = true;
5439
5421
  navigate(redirectPath);
5440
5422
  dispatch(setRedirectPath(null));
5441
- } else if (!navegandoRef.current && (location.pathname === "/login" || location.pathname === "/")) {
5442
- console.log("Usuario autenticado, redirigiendo a /home por defecto.");
5443
- navigate("/home");
5423
+ } else if (!navegandoRef.current && location.pathname === "/login") {
5424
+ console.log("Usuario autenticado, redirigiendo a la pantalla de inicio.");
5425
+ navigate("/");
5444
5426
  }
5445
5427
  }
5446
5428
  }, [clientContextStatus, redirectPath, location.pathname, navigate, dispatch]);
@@ -5450,20 +5432,20 @@ var InitialRedirectHandler_default = InitialRedirectHandler;
5450
5432
 
5451
5433
  // src/pages/GenericDataGridPage.tsx
5452
5434
  var import_react32 = __toESM(require("react"), 1);
5453
- var import_react_router_dom9 = require("react-router-dom");
5454
- var import_material24 = require("@mui/material");
5435
+ var import_react_router_dom10 = require("react-router-dom");
5436
+ var import_material23 = require("@mui/material");
5455
5437
  var import_Close2 = __toESM(require("@mui/icons-material/Close"), 1);
5456
5438
  var import_jsx_runtime29 = require("react/jsx-runtime");
5457
5439
  var GenericDataGridPage = ({
5458
5440
  initialTableName,
5459
5441
  initialFixedFields = []
5460
5442
  }) => {
5461
- const { tableName: urlTableName } = (0, import_react_router_dom9.useParams)();
5443
+ const { tableName: urlTableName } = (0, import_react_router_dom10.useParams)();
5462
5444
  const effectiveTableName = initialTableName || urlTableName;
5463
5445
  const [tabs, setTabs] = (0, import_react32.useState)([]);
5464
5446
  const [activeTabIdx, setActiveTabIdx] = (0, import_react32.useState)(0);
5465
5447
  const ffKey = JSON.stringify(initialFixedFields);
5466
- const location = (0, import_react_router_dom9.useLocation)();
5448
+ const location = (0, import_react_router_dom10.useLocation)();
5467
5449
  import_react32.default.useEffect(() => {
5468
5450
  if (effectiveTableName) {
5469
5451
  setTabs([{
@@ -5499,21 +5481,21 @@ var GenericDataGridPage = ({
5499
5481
  else if (activeTabIdx === index) setActiveTabIdx(index - 1);
5500
5482
  };
5501
5483
  if (!effectiveTableName) {
5502
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material24.Box, { p: 3, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material24.Alert, { severity: "error", children: "No se especific\xF3 una tabla." }) });
5484
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.Box, { p: 3, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.Alert, { severity: "error", children: "No se especific\xF3 una tabla." }) });
5503
5485
  }
5504
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_material24.Box, { sx: { width: "100%", height: "calc(100vh - 64px)", display: "flex", flexDirection: "column" }, children: [
5505
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material24.Box, { sx: { borderBottom: 1, borderColor: "divider", bgcolor: "background.paper" }, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material24.Tabs, { value: activeTabIdx, onChange: (_, v) => setActiveTabIdx(v), variant: "scrollable", children: tabs.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5506
- import_material24.Tab,
5486
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_material23.Box, { sx: { width: "100%", height: "calc(100vh - 64px)", display: "flex", flexDirection: "column" }, children: [
5487
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.Box, { sx: { borderBottom: 1, borderColor: "divider", bgcolor: "background.paper" }, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.Tabs, { value: activeTabIdx, onChange: (_, v) => setActiveTabIdx(v), variant: "scrollable", children: tabs.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5488
+ import_material23.Tab,
5507
5489
  {
5508
- label: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_material24.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
5509
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material24.Typography, { variant: "caption", sx: { fontWeight: "bold" }, children: tab.label }),
5510
- index !== 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material24.IconButton, { size: "small", onClick: (e) => handleCloseTab(index, e), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_Close2.default, { fontSize: "inherit" }) })
5490
+ label: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_material23.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
5491
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.Typography, { variant: "caption", sx: { fontWeight: "bold" }, children: tab.label }),
5492
+ index !== 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material23.IconButton, { size: "small", onClick: (e) => handleCloseTab(index, e), children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_Close2.default, { fontSize: "inherit" }) })
5511
5493
  ] })
5512
5494
  },
5513
5495
  tab.id
5514
5496
  )) }) }),
5515
5497
  tabs.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5516
- import_material24.Box,
5498
+ import_material23.Box,
5517
5499
  {
5518
5500
  role: "tabpanel",
5519
5501
  hidden: activeTabIdx !== index,
@@ -5536,20 +5518,20 @@ var GenericDataGridPage_default = GenericDataGridPage;
5536
5518
 
5537
5519
  // src/pages/PantallaDeRuta.tsx
5538
5520
  var import_react33 = require("react");
5539
- var import_react_router_dom10 = require("react-router-dom");
5540
- var import_material25 = require("@mui/material");
5521
+ var import_react_router_dom11 = require("react-router-dom");
5522
+ var import_material24 = require("@mui/material");
5541
5523
  var import_jsx_runtime30 = require("react/jsx-runtime");
5542
5524
  var PantallaDeRuta = ({ screenName }) => {
5543
- const [busqueda] = (0, import_react_router_dom10.useSearchParams)();
5525
+ const [busqueda] = (0, import_react_router_dom11.useSearchParams)();
5544
5526
  const params = (0, import_react33.useMemo)(() => Object.fromEntries(busqueda.entries()), [busqueda]);
5545
5527
  const Pantalla = wScreens[screenName];
5546
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material25.Box, { sx: { pt: 3, pl: 4 }, children: Pantalla ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Pantalla, { screenName, params }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FallbackWScreen, { screenName }) });
5528
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_material24.Box, { sx: { pt: 3, pl: 4 }, children: Pantalla ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Pantalla, { screenName, params }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(FallbackWScreen, { screenName }) });
5547
5529
  };
5548
5530
 
5549
5531
  // src/pages/MenuTablePage.tsx
5550
5532
  var import_react34 = require("react");
5551
- var import_react_router_dom11 = require("react-router-dom");
5552
- var import_material26 = require("@mui/material");
5533
+ var import_react_router_dom12 = require("react-router-dom");
5534
+ var import_material25 = require("@mui/material");
5553
5535
  var import_jsx_runtime31 = require("react/jsx-runtime");
5554
5536
  function fixedFieldsDeMenu(ff) {
5555
5537
  if (!ff) return [];
@@ -5559,7 +5541,7 @@ function fixedFieldsDeMenu(ff) {
5559
5541
  return Object.entries(ff).map(([fieldName, value]) => ({ fieldName, value }));
5560
5542
  }
5561
5543
  var MenuTablePage = () => {
5562
- const { menuName } = (0, import_react_router_dom11.useParams)();
5544
+ const { menuName } = (0, import_react_router_dom12.useParams)();
5563
5545
  const { clientContext } = useApp();
5564
5546
  const findMenuItem = (items, nameToFind) => {
5565
5547
  for (const item of items) {
@@ -5591,9 +5573,9 @@ var MenuTablePage = () => {
5591
5573
  };
5592
5574
  }, [menuName, clientContext]);
5593
5575
  if (!currentTableName) {
5594
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Box, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material26.Alert, { severity: "error", children: [
5595
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Typography, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
5596
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Typography, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
5576
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Box, { display: "flex", justifyContent: "center", alignItems: "center", minHeight: "200px", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material25.Alert, { severity: "error", children: [
5577
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Typography, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
5578
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material25.Typography, { variant: "body1", children: "Verifique la configuraci\xF3n del men\xFA o el nombre de la tabla en la URL." })
5597
5579
  ] }) });
5598
5580
  }
5599
5581
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
@@ -5607,8 +5589,8 @@ var MenuTablePage = () => {
5607
5589
  var MenuTablePage_default = MenuTablePage;
5608
5590
 
5609
5591
  // src/puente/PantallaBP.tsx
5610
- var import_react35 = require("react");
5611
- var import_react_router_dom12 = require("react-router-dom");
5592
+ var import_react36 = require("react");
5593
+ var import_react_router_dom13 = require("react-router-dom");
5612
5594
  var import_material27 = require("@mui/material");
5613
5595
 
5614
5596
  // src/puente/clienteBP.ts
@@ -5639,6 +5621,10 @@ function cargarScript(ruta) {
5639
5621
  document.head.appendChild(script);
5640
5622
  });
5641
5623
  }
5624
+ function esperarCargaDeVentana() {
5625
+ if (document.readyState === "complete") return Promise.resolve();
5626
+ return new Promise((resolver) => window.addEventListener("load", () => resolver(), { once: true }));
5627
+ }
5642
5628
  var carga = null;
5643
5629
  function cargarClienteBP(urlBackend) {
5644
5630
  if (!carga) {
@@ -5666,6 +5652,7 @@ async function cargarSinMemoria(urlBackend) {
5666
5652
  enlace.href = ruta;
5667
5653
  document.head.appendChild(enlace);
5668
5654
  });
5655
+ await esperarCargaDeVentana();
5669
5656
  for (const ruta of recursos.scripts) {
5670
5657
  await cargarScript(ruta);
5671
5658
  }
@@ -5676,6 +5663,81 @@ async function cargarSinMemoria(urlBackend) {
5676
5663
  return myOwn;
5677
5664
  }
5678
5665
 
5666
+ // src/puente/ConsolaBP.tsx
5667
+ var import_react35 = require("react");
5668
+ var import_material26 = require("@mui/material");
5669
+ var import_jsx_runtime32 = require("react/jsx-runtime");
5670
+ var MARGEN_DE_REPETIDO_MS = 1e3;
5671
+ function descartarRepetidos(consola, agregados, ahora) {
5672
+ for (const nodo of agregados) {
5673
+ if (!(nodo instanceof HTMLElement)) continue;
5674
+ const repetido = Array.from(consola.children).find(
5675
+ (otro) => otro instanceof HTMLElement && otro !== nodo && otro.className === nodo.className && otro.textContent === nodo.textContent && ahora - Number(otro.dataset.instante) < MARGEN_DE_REPETIDO_MS
5676
+ );
5677
+ if (repetido) nodo.remove();
5678
+ else nodo.dataset.instante = String(ahora);
5679
+ }
5680
+ }
5681
+ var ConsolaBP = () => {
5682
+ (0, import_react35.useEffect)(() => {
5683
+ const consola = document.getElementById("mini-console");
5684
+ if (!consola) return;
5685
+ const observador = new MutationObserver(
5686
+ (registros) => descartarRepetidos(consola, registros.flatMap((registro) => Array.from(registro.addedNodes)), Date.now())
5687
+ );
5688
+ observador.observe(consola, { childList: true });
5689
+ return () => observador.disconnect();
5690
+ }, []);
5691
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
5692
+ import_material26.Box,
5693
+ {
5694
+ id: "mini-console",
5695
+ sx: (tema) => ({
5696
+ "&#mini-console": {
5697
+ position: "fixed",
5698
+ top: { xs: 64, sm: 72 },
5699
+ left: "auto",
5700
+ right: 16,
5701
+ bottom: "auto",
5702
+ float: "none",
5703
+ zIndex: tema.zIndex.snackbar,
5704
+ width: "auto",
5705
+ minWidth: 0,
5706
+ maxWidth: "min(480px, calc(100vw - 32px))",
5707
+ minHeight: 0,
5708
+ maxHeight: "none",
5709
+ overflow: "visible",
5710
+ padding: 0,
5711
+ border: "none",
5712
+ borderRadius: 0,
5713
+ boxShadow: "none",
5714
+ backgroundColor: "transparent",
5715
+ fontSize: "inherit",
5716
+ display: "flex",
5717
+ flexDirection: "column",
5718
+ gap: 1
5719
+ },
5720
+ "&#mini-console:not(:empty)": { display: "flex" },
5721
+ "&#mini-console:empty": { display: "none" },
5722
+ "& > div": {
5723
+ p: "6px 12px",
5724
+ borderRadius: 1,
5725
+ boxShadow: tema.shadows[3],
5726
+ fontSize: "0.875rem",
5727
+ whiteSpace: "pre-wrap",
5728
+ overflowWrap: "anywhere",
5729
+ backgroundColor: tema.palette.grey[800],
5730
+ color: tema.palette.common.white
5731
+ },
5732
+ "& > .status-error": {
5733
+ backgroundColor: tema.palette.error.main,
5734
+ color: tema.palette.error.contrastText
5735
+ }
5736
+ })
5737
+ }
5738
+ );
5739
+ };
5740
+
5679
5741
  // src/puente/pantallaDeBP.ts
5680
5742
  var RUTA_PANTALLA_BP = "/bp/menu";
5681
5743
  function rutaDePantallaBP(nombre, parametros = "") {
@@ -5743,7 +5805,14 @@ function capturarNavegacionBP(urlBackend, navegar) {
5743
5805
  }
5744
5806
  };
5745
5807
  navegacion?.addEventListener("navigate", alNavegar);
5808
+ const reemplazarOriginal = history.replaceState;
5809
+ const reemplazar = (estado, titulo, url) => {
5810
+ const ruta = url === void 0 || url === null ? null : rutaDeEnlaceBP(String(url), document.baseURI, urlBackend);
5811
+ reemplazarOriginal.call(history, estado, titulo, ruta === null ? url : rutaBase + ruta);
5812
+ };
5813
+ history.replaceState = reemplazar;
5746
5814
  return () => {
5815
+ if (history.replaceState === reemplazar) history.replaceState = reemplazarOriginal;
5747
5816
  document.removeEventListener("click", alHacerClick, true);
5748
5817
  navegacion?.removeEventListener("navigate", alNavegar);
5749
5818
  };
@@ -5757,7 +5826,7 @@ var habilitarPuenteBP = () => {
5757
5826
  var puenteBPHabilitado = () => habilitado;
5758
5827
 
5759
5828
  // src/puente/PantallaBP.tsx
5760
- var import_jsx_runtime32 = require("react/jsx-runtime");
5829
+ var import_jsx_runtime33 = require("react/jsx-runtime");
5761
5830
  function buscarItemDeMenu(items, tipo) {
5762
5831
  for (const item of items) {
5763
5832
  if (item.menuType === tipo) return item;
@@ -5769,14 +5838,14 @@ function buscarItemDeMenu(items, tipo) {
5769
5838
  return void 0;
5770
5839
  }
5771
5840
  var PantallaBP = ({ nombre, direccion }) => {
5772
- const navigate = (0, import_react_router_dom12.useNavigate)();
5841
+ const navigate = (0, import_react_router_dom13.useNavigate)();
5773
5842
  const { clientContext } = useApp();
5774
- const [cargando, setCargando] = (0, import_react35.useState)(true);
5775
- const [error, setError] = (0, import_react35.useState)(null);
5776
- const [noExiste, setNoExiste] = (0, import_react35.useState)(false);
5777
- const contenedor = (0, import_react35.useRef)(null);
5843
+ const [cargando, setCargando] = (0, import_react36.useState)(true);
5844
+ const [error, setError] = (0, import_react36.useState)(null);
5845
+ const [noExiste, setNoExiste] = (0, import_react36.useState)(false);
5846
+ const contenedor = (0, import_react36.useRef)(null);
5778
5847
  const menu = clientContext.menu;
5779
- (0, import_react35.useEffect)(() => {
5848
+ (0, import_react36.useEffect)(() => {
5780
5849
  const elemento = contenedor.current;
5781
5850
  if (!elemento) return;
5782
5851
  let vigente = true;
@@ -5809,45 +5878,52 @@ var PantallaBP = ({ nombre, direccion }) => {
5809
5878
  elemento.replaceChildren();
5810
5879
  };
5811
5880
  }, [nombre, direccion, menu, navigate]);
5812
- if (noExiste) return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(FallbackWScreen, { screenName: nombre });
5813
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material27.Box, { children: [
5814
- cargando && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material27.CircularProgress, { size: 24, sx: { m: 2 } }),
5815
- error && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material27.Alert, { severity: "error", sx: { m: 2 }, children: error }),
5816
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { id: "main_layout", ref: contenedor })
5817
- ] });
5881
+ if (noExiste) return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FallbackWScreen, { screenName: nombre });
5882
+ return (
5883
+ // 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
5884
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_material27.Box, { sx: { position: "relative" }, children: [
5885
+ cargando && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material27.CircularProgress, { size: 24, sx: { position: "absolute", top: 16, left: 16 } }),
5886
+ error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material27.Alert, { severity: "error", sx: { m: 2 }, children: error }),
5887
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { id: "main_layout", ref: contenedor }),
5888
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ConsolaBP, {})
5889
+ ] })
5890
+ );
5818
5891
  };
5819
5892
  var PantallaDeRespaldo = () => {
5820
- const { screenName = "" } = (0, import_react_router_dom12.useParams)();
5821
- const { search } = (0, import_react_router_dom12.useLocation)();
5893
+ const { screenName = "" } = (0, import_react_router_dom13.useParams)();
5894
+ const { search } = (0, import_react_router_dom13.useLocation)();
5822
5895
  if (!puenteBPHabilitado()) {
5823
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material27.Box, { sx: { p: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(FallbackWScreen, { screenName }) });
5896
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material27.Box, { sx: { p: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FallbackWScreen, { screenName }) });
5824
5897
  }
5825
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.Navigate, { to: rutaDePantallaBP(screenName, search), replace: true });
5898
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_router_dom13.Navigate, { to: rutaDePantallaBP(screenName, search), replace: true });
5826
5899
  };
5827
5900
  var PaginaBP = () => {
5828
- const { hash, search } = (0, import_react_router_dom12.useLocation)();
5901
+ const { hash, search } = (0, import_react_router_dom13.useLocation)();
5829
5902
  const direccion = hash || search;
5830
5903
  const nombre = new URLSearchParams(direccion.replace(/^[#?]/, "")).get("w");
5831
- if (!puenteBPHabilitado()) return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.Navigate, { to: "/", replace: true });
5832
- if (!nombre) return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material27.Box, { sx: { p: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material27.Alert, { severity: "warning", children: [
5904
+ if (!puenteBPHabilitado()) return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_router_dom13.Navigate, { to: "/", replace: true });
5905
+ if (!nombre) return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material27.Box, { sx: { p: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_material27.Alert, { severity: "warning", children: [
5833
5906
  "Falta la pantalla de backend-plus (",
5834
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { children: "#w=..." }),
5907
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("code", { children: "#w=..." }),
5835
5908
  ")."
5836
5909
  ] }) });
5837
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PantallaBP, { nombre, direccion }, nombre);
5910
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PantallaBP, { nombre, direccion }, nombre);
5838
5911
  };
5839
5912
 
5840
5913
  // src/puente/GrillaBP.tsx
5841
- var import_react36 = require("react");
5842
- var import_react_router_dom13 = require("react-router-dom");
5914
+ var import_react37 = require("react");
5915
+ var import_react_router_dom14 = require("react-router-dom");
5843
5916
  var import_material28 = require("@mui/material");
5844
- var import_jsx_runtime33 = require("react/jsx-runtime");
5917
+ var import_jsx_runtime34 = (
5918
+ // 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
5919
+ require("react/jsx-runtime")
5920
+ );
5845
5921
  var GrillaBP = ({ tabla, fixedFields }) => {
5846
- const contenedor = (0, import_react36.useRef)(null);
5847
- const [cargando, setCargando] = (0, import_react36.useState)(true);
5848
- const [error, setError] = (0, import_react36.useState)(null);
5922
+ const contenedor = (0, import_react37.useRef)(null);
5923
+ const [cargando, setCargando] = (0, import_react37.useState)(true);
5924
+ const [error, setError] = (0, import_react37.useState)(null);
5849
5925
  const clave = JSON.stringify(fixedFields ?? []);
5850
- (0, import_react36.useEffect)(() => {
5926
+ (0, import_react37.useEffect)(() => {
5851
5927
  const elemento = contenedor.current;
5852
5928
  if (!elemento) return;
5853
5929
  let vigente = true;
@@ -5868,68 +5944,68 @@ var GrillaBP = ({ tabla, fixedFields }) => {
5868
5944
  elemento.replaceChildren();
5869
5945
  };
5870
5946
  }, [tabla, clave]);
5871
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_material28.Box, { children: [
5872
- cargando && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material28.CircularProgress, { size: 24, sx: { m: 2 } }),
5873
- error && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material28.Alert, { severity: "error", sx: { m: 2 }, children: error }),
5874
- /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { ref: contenedor })
5947
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_material28.Box, { sx: { position: "relative" }, children: [
5948
+ cargando && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_material28.CircularProgress, { size: 24, sx: { position: "absolute", top: 16, left: 16 } }),
5949
+ error && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_material28.Alert, { severity: "error", sx: { m: 2 }, children: error }),
5950
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { ref: contenedor }),
5951
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ConsolaBP, {})
5875
5952
  ] });
5876
5953
  };
5877
5954
  var PaginaGrillaBP = () => {
5878
- const { tableName = "" } = (0, import_react_router_dom13.useParams)();
5879
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GrillaBP, { tabla: tableName }, tableName);
5955
+ const { tableName = "" } = (0, import_react_router_dom14.useParams)();
5956
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GrillaBP, { tabla: tableName }, tableName);
5880
5957
  };
5881
5958
 
5882
5959
  // src/App.tsx
5883
5960
  var import_type_store6 = __toESM(require("type-store"), 1);
5884
- var import_jsx_runtime34 = require("react/jsx-runtime");
5961
+ var import_jsx_runtime35 = require("react/jsx-runtime");
5885
5962
  var LocationTracker = () => {
5886
- const location = (0, import_react_router_dom14.useLocation)();
5963
+ const location = (0, import_react_router_dom15.useLocation)();
5887
5964
  const dispatch = useAppDispatch();
5888
- (0, import_react37.useEffect)(() => {
5965
+ (0, import_react38.useEffect)(() => {
5889
5966
  dispatch(setCurrentPath(location.pathname + location.search));
5890
5967
  }, [location, dispatch]);
5891
5968
  return null;
5892
5969
  };
5893
5970
  function FrontendPlusReactRoutes({ myRoutes, myUnloggedRoutes, layout: Layout = MainLayout_default, unloggedLayout: UnloggedLayout }) {
5894
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
5895
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(InitialRedirectHandler_default, {}),
5896
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react_router_dom14.Routes, { children: [
5897
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react_router_dom14.Route, { element: UnloggedLayout ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(UnloggedLayout, {}) : /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Outlet, {}), children: [
5898
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Route, { path: "/login", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LoginPage_default, {}) }),
5899
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Route, { path: "/logout", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LogoutPage_default, {}) }),
5971
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
5972
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(InitialRedirectHandler_default, {}),
5973
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react_router_dom15.Routes, { children: [
5974
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react_router_dom15.Route, { element: UnloggedLayout ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(UnloggedLayout, {}) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Outlet, {}), children: [
5975
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Route, { path: "/login", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(LoginPage_default, {}) }),
5976
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Route, { path: "/logout", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(LogoutPage_default, {}) }),
5900
5977
  myUnloggedRoutes
5901
5978
  ] }),
5902
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react_router_dom14.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PrivateRoute_default, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Layout, {}) }), children: [
5903
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Route, { path: "/", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(HomePage_default, {}) }),
5904
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Route, { path: "/home", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(HomePage_default, {}) }),
5905
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Route, { path: "/table/:tableName", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GenericDataGridPage_default, {}) }),
5906
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Route, { path: "/menu/:menuName", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(MenuTablePage_default, {}) }),
5907
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Route, { path: "/procedures/:procedureName", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ProcedureForm_default, {}) }),
5908
- Object.keys(wScreens).map((screenName) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5909
- import_react_router_dom14.Route,
5979
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react_router_dom15.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PrivateRoute_default, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Layout, {}) }), children: [
5980
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Route, { path: "/", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PantallaInicial_default, {}) }),
5981
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Route, { path: "/table/:tableName", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(GenericDataGridPage_default, {}) }),
5982
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Route, { path: "/menu/:menuName", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(MenuTablePage_default, {}) }),
5983
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Route, { path: "/procedures/:procedureName", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ProcedureForm_default, {}) }),
5984
+ Object.keys(wScreens).map((screenName) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5985
+ import_react_router_dom15.Route,
5910
5986
  {
5911
5987
  path: `/wScreens/${screenName}`,
5912
- element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PantallaDeRuta, { screenName })
5988
+ element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PantallaDeRuta, { screenName })
5913
5989
  },
5914
5990
  screenName
5915
5991
  )),
5916
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Route, { path: "/wScreens-fallback/:screenName", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PantallaDeRespaldo, {}) }),
5917
- puenteBPHabilitado() && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Route, { path: "/bp/menu", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PaginaBP, {}) }),
5918
- puenteBPHabilitado() && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Route, { path: "/bp/table/:tableName", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PaginaGrillaBP, {}) }),
5992
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Route, { path: "/wScreens-fallback/:screenName", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PantallaDeRespaldo, {}) }),
5993
+ puenteBPHabilitado() && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Route, { path: "/bp/menu", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PaginaBP, {}) }),
5994
+ puenteBPHabilitado() && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Route, { path: "/bp/table/:tableName", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PaginaGrillaBP, {}) }),
5919
5995
  myRoutes,
5920
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Route, { path: "*", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { style: { marginTop: "20px", marginLeft: "10px" }, children: "404 - Recurso No Encontrado" }) })
5996
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Route, { path: "*", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { style: { marginTop: "20px", marginLeft: "10px" }, children: "404 - Recurso No Encontrado" }) })
5921
5997
  ] }),
5922
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Route, { path: "*", element: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_router_dom14.Navigate, { to: "/", replace: true }) })
5998
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Route, { path: "*", element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_router_dom15.Navigate, { to: "/", replace: true }) })
5923
5999
  ] })
5924
6000
  ] });
5925
6001
  }
5926
6002
  var FrontendPlusProviders = ({ children, publicPaths }) => {
5927
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react_redux5.Provider, { store, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react38.PersistGate, { loading: null, persistor, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react_router_dom14.BrowserRouter, { basename: rutaBase, children: [
5928
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LocationTracker, {}),
6003
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react_redux5.Provider, { store, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react39.PersistGate, { loading: null, persistor, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react_router_dom15.BrowserRouter, { basename: rutaBase, children: [
6004
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(LocationTracker, {}),
5929
6005
  " ",
5930
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(AppProvider, { publicPaths, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(SnackbarProvider, { children: [
6006
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AppProvider, { publicPaths, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(SnackbarProvider, { children: [
5931
6007
  children,
5932
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SessionExpiredMessage_default, {})
6008
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SessionExpiredMessage_default, {})
5933
6009
  ] }) })
5934
6010
  ] }) }) });
5935
6011
  };
@@ -5943,7 +6019,7 @@ var App = ({
5943
6019
  myConditions,
5944
6020
  puenteBP
5945
6021
  }) => {
5946
- (0, import_react37.useMemo)(() => {
6022
+ (0, import_react38.useMemo)(() => {
5947
6023
  if (myClientSides) {
5948
6024
  extendClientSides(myClientSides);
5949
6025
  }
@@ -5960,7 +6036,7 @@ var App = ({
5960
6036
  habilitarPuenteBP();
5961
6037
  }
5962
6038
  }, [myClientSides, myResultsOk, myWScreens, myConditions, puenteBP]);
5963
- (0, import_react37.useEffect)(() => {
6039
+ (0, import_react38.useEffect)(() => {
5964
6040
  import_type_store6.default.messages = import_type_store6.default.i18n.messages.es;
5965
6041
  import_type_store6.default.locale = import_type_store6.default.i18n.locale.es;
5966
6042
  const link = document.querySelector("link[rel*='icon']") || document.createElement("link");
@@ -5969,11 +6045,11 @@ var App = ({
5969
6045
  link.href = `${envConfig.backendUrl}/img/logo-128.png`;
5970
6046
  document.getElementsByTagName("head")[0].appendChild(link);
5971
6047
  }, []);
5972
- const safePaths = import_react37.default.useMemo(() => {
6048
+ const safePaths = import_react38.default.useMemo(() => {
5973
6049
  const extracted = extractPathsFromRoutes(myUnloggedRoutes);
5974
6050
  return ["/login", "/logout", ...extracted];
5975
6051
  }, [myUnloggedRoutes]);
5976
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(FrontendPlusProviders, { publicPaths: safePaths, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
6052
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FrontendPlusProviders, { publicPaths: safePaths, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5977
6053
  FrontendPlusReactRoutes,
5978
6054
  {
5979
6055
  myRoutes,