frontend-plus-react 0.3.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
@@ -37,6 +37,7 @@ __export(src_exports, {
37
37
  FrontendPlusProviders: () => FrontendPlusProviders,
38
38
  FrontendPlusReactRoutes: () => FrontendPlusReactRoutes,
39
39
  GenericDataGrid: () => GenericDataGrid_default,
40
+ GrillaBP: () => GrillaBP,
40
41
  MainLayout: () => MainLayout_default,
41
42
  SnackbarProvider: () => SnackbarProvider,
42
43
  cambiarGuionesBajosPorEspacios: () => cambiarGuionesBajosPorEspacios,
@@ -46,6 +47,7 @@ __export(src_exports, {
46
47
  extendResultsOk: () => extendResultsOk,
47
48
  extendWScreens: () => extendWScreens,
48
49
  extractPathsFromRoutes: () => extractPathsFromRoutes,
50
+ habilitarPuenteBP: () => habilitarPuenteBP,
49
51
  resultComponents: () => resultsOk,
50
52
  useApiCall: () => useApiCall,
51
53
  useApiCallWithoutSnackbar: () => useApiCallWithoutSnackbar,
@@ -3451,6 +3453,11 @@ var VerticalEditorPage = ({
3451
3453
  ] });
3452
3454
  };
3453
3455
 
3456
+ // src/rutaBase.ts
3457
+ var import_meta2 = {};
3458
+ var baseDelBundler = import_meta2.env?.BASE_URL ?? "/";
3459
+ var rutaBase = baseDelBundler.replace(/\/+$/, "");
3460
+
3454
3461
  // src/components/grid/GenericDataGrid.tsx
3455
3462
  var import_jsx_runtime18 = require("react/jsx-runtime");
3456
3463
  var SUMMARY_ROW_HEIGHT = 35;
@@ -3840,7 +3847,7 @@ var GenericDataGrid = ({
3840
3847
  const abrirWScreenEnPestana = (0, import_react22.useCallback)((row, detailTable) => {
3841
3848
  const parametros = new URLSearchParams();
3842
3849
  calcularFixedFieldsDetalle(detailTable, row).forEach((ff) => parametros.set(ff.fieldName, String(ff.value)));
3843
- window.open(`${window.location.origin}/wScreens/${detailTable.wScreen}?${parametros}`, "_blank");
3850
+ window.open(`${window.location.origin}${rutaBase}/wScreens/${detailTable.wScreen}?${parametros}`, "_blank");
3844
3851
  }, []);
3845
3852
  const alternarDetalle = (0, import_react22.useCallback)((row, rowId, detailTable, enOtraPestana) => {
3846
3853
  if (enOtraPestana && detailTable.wScreen) {
@@ -4183,8 +4190,8 @@ var GenericDataGrid = ({
4183
4190
  var GenericDataGrid_default = GenericDataGrid;
4184
4191
 
4185
4192
  // src/App.tsx
4186
- var import_react35 = __toESM(require("react"), 1);
4187
- var import_react_router_dom12 = require("react-router-dom");
4193
+ var import_react38 = __toESM(require("react"), 1);
4194
+ var import_react_router_dom15 = require("react-router-dom");
4188
4195
 
4189
4196
  // src/components/MainLayout.tsx
4190
4197
  var import_react26 = require("react");
@@ -4305,13 +4312,33 @@ var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"), 1);
4305
4312
  var import_TableChart = __toESM(require("@mui/icons-material/TableChart"), 1);
4306
4313
  var import_Folder = __toESM(require("@mui/icons-material/Folder"), 1);
4307
4314
  var import_Dns = __toESM(require("@mui/icons-material/Dns"), 1);
4308
- var import_Home = __toESM(require("@mui/icons-material/Home"), 1);
4309
4315
  var import_WarningAmber3 = __toESM(require("@mui/icons-material/WarningAmber"), 1);
4310
4316
  var import_DesktopWindows = __toESM(require("@mui/icons-material/DesktopWindows"), 1);
4311
4317
  var import_UnfoldMore = __toESM(require("@mui/icons-material/UnfoldMore"), 1);
4312
4318
  var import_UnfoldLess = __toESM(require("@mui/icons-material/UnfoldLess"), 1);
4313
4319
  var import_react_router_dom2 = require("react-router-dom");
4314
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
4315
4342
  var import_jsx_runtime20 = require("react/jsx-runtime");
4316
4343
  var MenuListItem = ({ item, level, onMenuItemClick }) => {
4317
4344
  const navigate = (0, import_react_router_dom2.useNavigate)();
@@ -4322,29 +4349,7 @@ var MenuListItem = ({ item, level, onMenuItemClick }) => {
4322
4349
  if (item.menuType === "menu") {
4323
4350
  dispatch(toggleSubMenu(item.name));
4324
4351
  } else {
4325
- let path = "";
4326
- const queryParams = new URLSearchParams();
4327
- if (item.menuType === "table") {
4328
- path = `/menu/${item.name}`;
4329
- if (item.td) queryParams.append("td", JSON.stringify(item.td));
4330
- if (item.fc) queryParams.append("fc", JSON.stringify(item.fc));
4331
- if (queryParams.toString()) {
4332
- path = `${path}?${queryParams.toString()}`;
4333
- }
4334
- } else if (item.menuType === "proc") {
4335
- path = `/procedures/${item.name}`;
4336
- } else {
4337
- const WScreenComponent = wScreens[item.menuType];
4338
- if (WScreenComponent !== void 0) {
4339
- path = `/wScreens/${item.menuType}`;
4340
- } else {
4341
- path = `/wScreens-fallback/${item.menuType}`;
4342
- console.warn(`Menu type '${item.menuType}' no reconocido o WScreen no mapeada.`);
4343
- }
4344
- }
4345
- if (path) {
4346
- navigate(path);
4347
- }
4352
+ navigate(rutaDeItemDeMenu(item));
4348
4353
  if (onMenuItemClick) {
4349
4354
  onMenuItemClick();
4350
4355
  }
@@ -4417,19 +4422,12 @@ var SideMenu = ({ onMenuItemClick }) => {
4417
4422
  const allSubMenusKeys = Object.keys(subMenuOpenStates);
4418
4423
  const openSubMenusCount = allSubMenusKeys.filter((key) => subMenuOpenStates[key]).length;
4419
4424
  const isMostlyOpen = allSubMenusKeys.length > 0 && openSubMenusCount / allSubMenusKeys.length > 0.5;
4420
- const handleHomeClick = () => {
4421
- navigate("/home");
4422
- if (onMenuItemClick) {
4423
- onMenuItemClick();
4424
- }
4425
- };
4426
4425
  const handleToggleAllSubMenus = () => {
4427
4426
  dispatch(setAllSubMenusOpen(!isMostlyOpen));
4428
4427
  };
4429
4428
  if (!clientContext || !clientContext.menu) {
4430
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..." }) });
4431
4430
  }
4432
- const isHomeSelected = location.pathname === "/home";
4433
4431
  (0, import_react24.useEffect)(() => {
4434
4432
  if (!clientContext?.menu) return;
4435
4433
  const expandParents = (items, targetPath, parentNames = []) => {
@@ -4465,22 +4463,15 @@ var SideMenu = ({ onMenuItemClick }) => {
4465
4463
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.ListItemText, { primary: isMostlyOpen ? "colapsar " : "expandir" })
4466
4464
  ] }) }),
4467
4465
  /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.Divider, {}),
4468
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_material16.List, { children: [
4469
- /* @__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: [
4470
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.ListItemIcon, { sx: { minWidth: "38px" }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_Home.default, {}) }),
4471
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.ListItemText, { primary: "Inicio" })
4472
- ] }) }),
4473
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.Divider, {}),
4474
- clientContext.menu.map((menuItem) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
4475
- MenuListItem,
4476
- {
4477
- item: menuItem,
4478
- level: 1,
4479
- onMenuItemClick
4480
- },
4481
- menuItem.name
4482
- ))
4483
- ] })
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
+ )) })
4484
4475
  ] });
4485
4476
  };
4486
4477
  var SideMenu_default = SideMenu;
@@ -4539,7 +4530,6 @@ var MainLayout = () => {
4539
4530
  if (!clientContext) {
4540
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..." }) });
4541
4532
  }
4542
- const appBarOffset = theme.mixins.toolbar;
4543
4533
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_material17.Box, { sx: { display: "flex", height: "100vh" }, children: [
4544
4534
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_material17.CssBaseline, {}),
4545
4535
  /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
@@ -4643,7 +4633,7 @@ var MainLayout = () => {
4643
4633
  ]
4644
4634
  }
4645
4635
  ),
4646
- /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
4636
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
4647
4637
  import_material17.Box,
4648
4638
  {
4649
4639
  component: "main",
@@ -4663,15 +4653,16 @@ var MainLayout = () => {
4663
4653
  },
4664
4654
  minWidth: 0,
4665
4655
  flexShrink: 0,
4666
- // Asegúrate de que el paddingTop sea suficiente para la AppBar
4667
- paddingTop: `${appBarOffset.minHeight}px`,
4668
4656
  height: "100%",
4669
4657
  boxSizing: "border-box",
4670
4658
  display: "flex",
4671
4659
  flexDirection: "column",
4672
4660
  width: isDrawerOpen ? `calc(100% - ${drawerWidth}px)` : "100%"
4673
4661
  },
4674
- 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
+ ]
4675
4666
  }
4676
4667
  )
4677
4668
  ] });
@@ -4729,28 +4720,26 @@ var SessionExpiredMessage = () => {
4729
4720
  };
4730
4721
  var SessionExpiredMessage_default = SessionExpiredMessage;
4731
4722
 
4732
- // src/pages/HomePage.tsx
4733
- var import_material19 = require("@mui/material");
4723
+ // src/pages/PantallaInicial.tsx
4724
+ var import_react_router_dom5 = require("react-router-dom");
4734
4725
  var import_jsx_runtime23 = require("react/jsx-runtime");
4735
- var HomePage = () => {
4726
+ var PantallaInicial = () => {
4736
4727
  const { clientContext } = useApp();
4737
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_material19.Box, { sx: { p: 3 }, children: [
4738
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Typography, { variant: "h4", component: "h1", gutterBottom: true, children: `Bienvenido/a ${clientContext?.username}` }),
4739
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_material19.Typography, { variant: "body1", children: "Usa el men\xFA lateral para navegar por las diferentes secciones." })
4740
- ] });
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;
4741
4730
  };
4742
- var HomePage_default = HomePage;
4731
+ var PantallaInicial_default = PantallaInicial;
4743
4732
 
4744
4733
  // src/pages/LogoutPage.tsx
4745
4734
  var import_react27 = require("react");
4746
- var import_material20 = require("@mui/material");
4735
+ var import_material19 = require("@mui/material");
4747
4736
  var import_jsx_runtime24 = require("react/jsx-runtime");
4748
4737
  var LogoutPage = () => {
4749
4738
  const logout = useLogout_default();
4750
4739
  (0, import_react27.useEffect)(() => {
4751
4740
  logout();
4752
4741
  }, [logout]);
4753
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material20.Box, { sx: {
4742
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material19.Box, { sx: {
4754
4743
  display: "flex",
4755
4744
  flexDirection: "column",
4756
4745
  justifyContent: "center",
@@ -4758,19 +4747,19 @@ var LogoutPage = () => {
4758
4747
  height: "100vh",
4759
4748
  textAlign: "center"
4760
4749
  }, children: [
4761
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material20.CircularProgress, { size: 60 }),
4762
- /* @__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..." })
4763
4752
  ] });
4764
4753
  };
4765
4754
  var LogoutPage_default = LogoutPage;
4766
4755
 
4767
4756
  // src/pages/LoginPage.tsx
4768
4757
  var import_react28 = require("react");
4769
- var import_material21 = require("@mui/material");
4758
+ var import_material20 = require("@mui/material");
4770
4759
  var import_react_hook_form = require("react-hook-form");
4771
4760
  var import_zod = require("@hookform/resolvers/zod");
4772
4761
  var z = __toESM(require("zod"), 1);
4773
- var import_react_router_dom5 = require("react-router-dom");
4762
+ var import_react_router_dom6 = require("react-router-dom");
4774
4763
  var import_react_redux4 = require("react-redux");
4775
4764
  var import_jsx_runtime25 = require("react/jsx-runtime");
4776
4765
  var loginSchema = z.object({
@@ -4780,7 +4769,7 @@ var loginSchema = z.object({
4780
4769
  // Añadir validación básica
4781
4770
  });
4782
4771
  var LoginPage = () => {
4783
- const navigate = (0, import_react_router_dom5.useNavigate)();
4772
+ const navigate = (0, import_react_router_dom6.useNavigate)();
4784
4773
  const [loginError, setLoginError] = (0, import_react28.useState)(null);
4785
4774
  const [isSubmitting, setIsSubmitting] = (0, import_react28.useState)(false);
4786
4775
  const { setIsLoggedIn, checkSession } = useApp();
@@ -4818,7 +4807,7 @@ var LoginPage = () => {
4818
4807
  setIsLoggedIn(true);
4819
4808
  await dispatch(fetchClientContext()).unwrap();
4820
4809
  console.log("Login exitoso y clientContext cargado.");
4821
- navigate("/home");
4810
+ navigate("/");
4822
4811
  reset();
4823
4812
  } catch (error) {
4824
4813
  console.error("Error al iniciar sesi\xF3n:", error);
@@ -4829,7 +4818,7 @@ var LoginPage = () => {
4829
4818
  }
4830
4819
  };
4831
4820
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4832
- import_material21.Box,
4821
+ import_material20.Box,
4833
4822
  {
4834
4823
  display: "flex",
4835
4824
  alignItems: "center",
@@ -4837,7 +4826,7 @@ var LoginPage = () => {
4837
4826
  minHeight: "100vh",
4838
4827
  bgcolor: "#f5f5f5",
4839
4828
  children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
4840
- import_material21.Box,
4829
+ import_material20.Box,
4841
4830
  {
4842
4831
  width: "100%",
4843
4832
  maxWidth: "400px",
@@ -4846,7 +4835,7 @@ var LoginPage = () => {
4846
4835
  borderRadius: 8,
4847
4836
  boxShadow: 3,
4848
4837
  children: [
4849
- /* @__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)(
4850
4839
  "img",
4851
4840
  {
4852
4841
  src: `${envConfig.backendUrl}/img/login-logo-icon.png`,
@@ -4854,17 +4843,17 @@ var LoginPage = () => {
4854
4843
  style: { height: "192px", maxWidth: "100%", objectFit: "contain" }
4855
4844
  }
4856
4845
  ) }),
4857
- /* @__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" }),
4858
4847
  /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("form", { onSubmit: handleSubmit(onSubmit), className: "space-y-4", children: [
4859
4848
  /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
4860
- /* @__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" }) }),
4861
4850
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4862
4851
  import_react_hook_form.Controller,
4863
4852
  {
4864
4853
  name: "username",
4865
4854
  control,
4866
4855
  render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4867
- import_material21.TextField,
4856
+ import_material20.TextField,
4868
4857
  {
4869
4858
  ...field,
4870
4859
  type: "text",
@@ -4880,14 +4869,14 @@ var LoginPage = () => {
4880
4869
  )
4881
4870
  ] }),
4882
4871
  /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { children: [
4883
- /* @__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" }) }),
4884
4873
  /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4885
4874
  import_react_hook_form.Controller,
4886
4875
  {
4887
4876
  name: "password",
4888
4877
  control,
4889
4878
  render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
4890
- import_material21.TextField,
4879
+ import_material20.TextField,
4891
4880
  {
4892
4881
  ...field,
4893
4882
  type: "password",
@@ -4902,14 +4891,14 @@ var LoginPage = () => {
4902
4891
  }
4903
4892
  )
4904
4893
  ] }),
4905
- /* @__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: [
4906
- /* @__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 } }),
4907
4896
  "Iniciando sesi\xF3n..."
4908
4897
  ] }) : "Iniciar Sesi\xF3n" })
4909
4898
  ] }),
4910
- 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: [
4911
4900
  " ",
4912
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material21.AlertTitle, { children: "Error" }),
4901
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_material20.AlertTitle, { children: "Error" }),
4913
4902
  loginError
4914
4903
  ] })
4915
4904
  ]
@@ -4922,18 +4911,18 @@ var LoginPage_default = LoginPage;
4922
4911
 
4923
4912
  // src/components/ProcedureForm.tsx
4924
4913
  var import_react29 = __toESM(require("react"), 1);
4925
- var import_react_router_dom6 = require("react-router-dom");
4926
- var import_material23 = require("@mui/material");
4914
+ var import_react_router_dom7 = require("react-router-dom");
4915
+ var import_material22 = require("@mui/material");
4927
4916
 
4928
4917
  // src/pages/procedure-results/SuccessDisplay.tsx
4929
- var import_material22 = require("@mui/material");
4918
+ var import_material21 = require("@mui/material");
4930
4919
  var import_jsx_runtime26 = require("react/jsx-runtime");
4931
4920
  var SuccessDisplay = ({ data }) => {
4932
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_material22.Paper, { elevation: 2, sx: { p: 2, mt: 2, bgcolor: "success.light", color: "success.contrastText" }, children: [
4933
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material22.Typography, { variant: "h6", sx: { fontSize: "1rem", mb: 1 }, children: "\xA1Operaci\xF3n Exitosa!" }),
4934
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_material22.Typography, { variant: "body2", sx: { fontSize: "0.85rem" }, children: "Detalles del resultado:" }),
4935
- /* @__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) }) }),
4936
- /* @__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." })
4937
4926
  ] });
4938
4927
  };
4939
4928
  var SuccessDisplay_default = SuccessDisplay;
@@ -4949,7 +4938,7 @@ var extendResultsOk = (newComponents) => {
4949
4938
  // src/components/ProcedureForm.tsx
4950
4939
  var import_jsx_runtime27 = require("react/jsx-runtime");
4951
4940
  var ProcedureForm = () => {
4952
- const { procedureName } = (0, import_react_router_dom6.useParams)();
4941
+ const { procedureName } = (0, import_react_router_dom7.useParams)();
4953
4942
  const { clientContext } = useApp();
4954
4943
  const { callApi, loading: apiLoading, error: apiError } = useApiCall();
4955
4944
  const [validationErrors, setValidationErrors] = (0, import_react29.useState)({});
@@ -5162,10 +5151,10 @@ var ProcedureForm = () => {
5162
5151
  sx: { fontSize: "0.8rem" }
5163
5152
  };
5164
5153
  if (param.options && param.options.length > 0) {
5165
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.FormControl, { fullWidth: true, margin: "dense", size: "small", error: hasError, required: commonProps.required, children: [
5166
- /* @__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 }),
5167
5156
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
5168
- import_material23.Select,
5157
+ import_material22.Select,
5169
5158
  {
5170
5159
  labelId: `${param.name}-label`,
5171
5160
  value: formValues[param.name] === void 0 ? "" : formValues[param.name],
@@ -5175,14 +5164,14 @@ var ProcedureForm = () => {
5175
5164
  label: param.label || param.name,
5176
5165
  disabled: apiLoading,
5177
5166
  sx: { fontSize: "0.8rem" },
5178
- 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 }),
5179
5168
  children: [
5180
- (!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..." }) }),
5181
- 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))
5182
5171
  ]
5183
5172
  }
5184
5173
  ),
5185
- (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 })
5186
5175
  ] });
5187
5176
  }
5188
5177
  switch (param.typeName) {
@@ -5191,19 +5180,19 @@ var ProcedureForm = () => {
5191
5180
  case "tsrange":
5192
5181
  case "time_range":
5193
5182
  case "daterange":
5194
- 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 });
5195
5184
  case "decimal":
5196
5185
  case "double":
5197
- 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 });
5198
5187
  case "integer":
5199
5188
  case "bigint":
5200
- 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 });
5201
5190
  case "boolean":
5202
5191
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5203
- import_material23.FormControlLabel,
5192
+ import_material22.FormControlLabel,
5204
5193
  {
5205
5194
  control: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5206
- import_material23.Checkbox,
5195
+ import_material22.Checkbox,
5207
5196
  {
5208
5197
  checked: !!formValues[param.name],
5209
5198
  onChange: handleChange,
@@ -5213,20 +5202,20 @@ var ProcedureForm = () => {
5213
5202
  size: "small"
5214
5203
  }
5215
5204
  ),
5216
- 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 }),
5217
5206
  sx: { mt: 1, mb: 0 }
5218
5207
  }
5219
5208
  );
5220
5209
  case "date":
5221
5210
  case "timestamp":
5222
5211
  case "time":
5223
- 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" } } });
5224
5213
  case "jsonb":
5225
5214
  case "jsona":
5226
- 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" } } });
5227
5216
  case "bytea":
5228
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.FormControl, { fullWidth: true, margin: "dense", error: hasError, required: commonProps.required, children: [
5229
- /* @__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 }),
5230
5219
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5231
5220
  "input",
5232
5221
  {
@@ -5241,10 +5230,10 @@ var ProcedureForm = () => {
5241
5230
  style: { padding: "6px 0", fontSize: "0.8rem" }
5242
5231
  }
5243
5232
  ),
5244
- (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 })
5245
5234
  ] });
5246
5235
  default:
5247
- 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 });
5248
5237
  }
5249
5238
  }, [formValues, handleChange, apiLoading, validationErrors]);
5250
5239
  const ResultDisplayContent = (0, import_react29.useMemo)(() => {
@@ -5253,13 +5242,13 @@ var ProcedureForm = () => {
5253
5242
  if (ComponentToRender) {
5254
5243
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ComponentToRender, { data: procedureResultData });
5255
5244
  } else {
5256
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.Paper, { elevation: 2, sx: { p: 2, mt: 0, bgcolor: "warning.light" }, children: [
5257
- /* @__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: [
5258
5247
  "el componente para resolver el resultOk: '",
5259
5248
  procedure.resultOk,
5260
5249
  "' definido en el procedure no existe o no est\xE1 mapeado."
5261
5250
  ] }),
5262
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Box, { sx: {
5251
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material22.Box, { sx: {
5263
5252
  bgcolor: "warning.dark",
5264
5253
  p: 1,
5265
5254
  borderRadius: 1
@@ -5268,7 +5257,7 @@ var ProcedureForm = () => {
5268
5257
  }
5269
5258
  }, [procedureResultData, procedure]);
5270
5259
  if (!procedure) {
5271
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.Box, { sx: {
5260
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Box, { sx: {
5272
5261
  p: 2,
5273
5262
  width: "100%",
5274
5263
  boxSizing: "border-box",
@@ -5278,13 +5267,13 @@ var ProcedureForm = () => {
5278
5267
  boxShadow: 3,
5279
5268
  textAlign: "center"
5280
5269
  }, children: [
5281
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.CircularProgress, { sx: { mb: 2 } }),
5282
- /* @__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..." })
5283
5272
  ] });
5284
5273
  }
5285
5274
  return (
5286
5275
  // Esta es la Box más externa que ahora controlará el scroll
5287
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.Box, { sx: {
5276
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material22.Box, { sx: {
5288
5277
  p: 2,
5289
5278
  ml: 1,
5290
5279
  mt: 2,
@@ -5301,17 +5290,17 @@ var ProcedureForm = () => {
5301
5290
  overflowX: "hidden"
5302
5291
  // Oculta el scroll horizontal si no es necesario para el contenedor principal
5303
5292
  }, children: [
5304
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Typography, { variant: "h5", component: "h2", gutterBottom: true, align: "left", children: cambiarGuionesBajosPorEspacios(procedure.proceedLabel || procedure.action) }),
5305
- 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: [
5306
5295
  "Por favor, corrige los errores en el formulario antes de enviar.",
5307
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)) })
5308
5297
  ] }),
5309
- !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 }),
5310
- !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 }),
5311
5300
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("form", { onSubmit: handleSubmit, children: [
5312
5301
  procedure.parameters.map((param) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { children: renderInputField(param) }, param.name)),
5313
5302
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5314
- import_material23.Button,
5303
+ import_material22.Button,
5315
5304
  {
5316
5305
  type: "submit",
5317
5306
  variant: "contained",
@@ -5319,20 +5308,20 @@ var ProcedureForm = () => {
5319
5308
  disabled: apiLoading || Object.values(validationErrors).some((err) => err !== null),
5320
5309
  sx: { mt: 2 },
5321
5310
  size: "medium",
5322
- 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,
5323
5312
  children: apiLoading ? "Ejecutando..." : procedure.proceedLabel || "Ejecutar"
5324
5313
  }
5325
5314
  )
5326
5315
  ] }),
5327
- 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: [
5328
5317
  " ",
5329
5318
  ResultDisplayContent
5330
5319
  ] }),
5331
- executionLog.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material23.Box, { sx: { mt: 3 }, children: [
5332
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material23.Divider, { sx: { mb: 2 } }),
5333
- /* @__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" }),
5334
5323
  /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5335
- import_material23.Box,
5324
+ import_material22.Box,
5336
5325
  {
5337
5326
  sx: {
5338
5327
  bgcolor: "grey.100",
@@ -5346,7 +5335,7 @@ var ProcedureForm = () => {
5346
5335
  whiteSpace: "pre-wrap"
5347
5336
  },
5348
5337
  children: executionLog.map((log, index) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
5349
- import_material23.Typography,
5338
+ import_material22.Typography,
5350
5339
  {
5351
5340
  component: "pre",
5352
5341
  sx: {
@@ -5368,14 +5357,14 @@ var ProcedureForm_default = ProcedureForm;
5368
5357
 
5369
5358
  // src/App.tsx
5370
5359
  var import_react_redux5 = require("react-redux");
5371
- var import_react36 = require("redux-persist/integration/react");
5360
+ var import_react39 = require("redux-persist/integration/react");
5372
5361
 
5373
5362
  // src/components/PrivateRoute.tsx
5374
5363
  var import_react30 = require("react");
5375
- var import_react_router_dom7 = require("react-router-dom");
5364
+ var import_react_router_dom8 = require("react-router-dom");
5376
5365
  var import_jsx_runtime28 = require("react/jsx-runtime");
5377
5366
  var PrivateRoute = ({ children }) => {
5378
- const location = (0, import_react_router_dom7.useLocation)();
5367
+ const location = (0, import_react_router_dom8.useLocation)();
5379
5368
  const dispatch = useAppDispatch();
5380
5369
  const clientContextStatus = useClientContextStatus();
5381
5370
  const isAuthenticated = clientContextStatus === "succeeded";
@@ -5384,7 +5373,7 @@ var PrivateRoute = ({ children }) => {
5384
5373
  (0, import_react30.useEffect)(() => {
5385
5374
  console.log(`[PrivateRoute] Effect: Path=${location.pathname}, AuthStatus=${clientContextStatus}, IsAuthenticated=${isAuthenticated}, IsLoadingAuth=${isLoadingAuth}`);
5386
5375
  if (!isAuthenticated && !isLoadingAuth && location.pathname !== "/login") {
5387
- const path = location.pathname + location.search;
5376
+ const path = location.pathname + location.search + location.hash;
5388
5377
  console.log(`[PrivateRoute] ACTION: Dispatching setRedirectPath(${path})`);
5389
5378
  dispatch(setRedirectPath(path));
5390
5379
  } else if (isAuthenticated) {
@@ -5401,7 +5390,7 @@ var PrivateRoute = ({ children }) => {
5401
5390
  }
5402
5391
  if (!isAuthenticated) {
5403
5392
  console.log(`[PrivateRoute] User not authenticated, navigating to /login`);
5404
- 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 });
5405
5394
  }
5406
5395
  console.log(`[PrivateRoute] User authenticated, rendering children.`);
5407
5396
  return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_jsx_runtime28.Fragment, { children });
@@ -5410,10 +5399,10 @@ var PrivateRoute_default = PrivateRoute;
5410
5399
 
5411
5400
  // src/components/InitialRedirectHandler.tsx
5412
5401
  var import_react31 = require("react");
5413
- var import_react_router_dom8 = require("react-router-dom");
5402
+ var import_react_router_dom9 = require("react-router-dom");
5414
5403
  var InitialRedirectHandler = () => {
5415
- const location = (0, import_react_router_dom8.useLocation)();
5416
- 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)();
5417
5406
  const dispatch = useAppDispatch();
5418
5407
  const redirectPath = useRedirectPath();
5419
5408
  const clientContextStatus = useClientContextStatus();
@@ -5431,9 +5420,9 @@ var InitialRedirectHandler = () => {
5431
5420
  navegandoRef.current = true;
5432
5421
  navigate(redirectPath);
5433
5422
  dispatch(setRedirectPath(null));
5434
- } else if (!navegandoRef.current && (location.pathname === "/login" || location.pathname === "/")) {
5435
- console.log("Usuario autenticado, redirigiendo a /home por defecto.");
5436
- navigate("/home");
5423
+ } else if (!navegandoRef.current && location.pathname === "/login") {
5424
+ console.log("Usuario autenticado, redirigiendo a la pantalla de inicio.");
5425
+ navigate("/");
5437
5426
  }
5438
5427
  }
5439
5428
  }, [clientContextStatus, redirectPath, location.pathname, navigate, dispatch]);
@@ -5443,20 +5432,20 @@ var InitialRedirectHandler_default = InitialRedirectHandler;
5443
5432
 
5444
5433
  // src/pages/GenericDataGridPage.tsx
5445
5434
  var import_react32 = __toESM(require("react"), 1);
5446
- var import_react_router_dom9 = require("react-router-dom");
5447
- var import_material24 = require("@mui/material");
5435
+ var import_react_router_dom10 = require("react-router-dom");
5436
+ var import_material23 = require("@mui/material");
5448
5437
  var import_Close2 = __toESM(require("@mui/icons-material/Close"), 1);
5449
5438
  var import_jsx_runtime29 = require("react/jsx-runtime");
5450
5439
  var GenericDataGridPage = ({
5451
5440
  initialTableName,
5452
5441
  initialFixedFields = []
5453
5442
  }) => {
5454
- const { tableName: urlTableName } = (0, import_react_router_dom9.useParams)();
5443
+ const { tableName: urlTableName } = (0, import_react_router_dom10.useParams)();
5455
5444
  const effectiveTableName = initialTableName || urlTableName;
5456
5445
  const [tabs, setTabs] = (0, import_react32.useState)([]);
5457
5446
  const [activeTabIdx, setActiveTabIdx] = (0, import_react32.useState)(0);
5458
5447
  const ffKey = JSON.stringify(initialFixedFields);
5459
- const location = (0, import_react_router_dom9.useLocation)();
5448
+ const location = (0, import_react_router_dom10.useLocation)();
5460
5449
  import_react32.default.useEffect(() => {
5461
5450
  if (effectiveTableName) {
5462
5451
  setTabs([{
@@ -5492,21 +5481,21 @@ var GenericDataGridPage = ({
5492
5481
  else if (activeTabIdx === index) setActiveTabIdx(index - 1);
5493
5482
  };
5494
5483
  if (!effectiveTableName) {
5495
- 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." }) });
5496
5485
  }
5497
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_material24.Box, { sx: { width: "100%", height: "calc(100vh - 64px)", display: "flex", flexDirection: "column" }, children: [
5498
- /* @__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)(
5499
- 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,
5500
5489
  {
5501
- label: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_material24.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
5502
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_material24.Typography, { variant: "caption", sx: { fontWeight: "bold" }, children: tab.label }),
5503
- 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" }) })
5504
5493
  ] })
5505
5494
  },
5506
5495
  tab.id
5507
5496
  )) }) }),
5508
5497
  tabs.map((tab, index) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
5509
- import_material24.Box,
5498
+ import_material23.Box,
5510
5499
  {
5511
5500
  role: "tabpanel",
5512
5501
  hidden: activeTabIdx !== index,
@@ -5529,20 +5518,20 @@ var GenericDataGridPage_default = GenericDataGridPage;
5529
5518
 
5530
5519
  // src/pages/PantallaDeRuta.tsx
5531
5520
  var import_react33 = require("react");
5532
- var import_react_router_dom10 = require("react-router-dom");
5533
- var import_material25 = require("@mui/material");
5521
+ var import_react_router_dom11 = require("react-router-dom");
5522
+ var import_material24 = require("@mui/material");
5534
5523
  var import_jsx_runtime30 = require("react/jsx-runtime");
5535
5524
  var PantallaDeRuta = ({ screenName }) => {
5536
- const [busqueda] = (0, import_react_router_dom10.useSearchParams)();
5525
+ const [busqueda] = (0, import_react_router_dom11.useSearchParams)();
5537
5526
  const params = (0, import_react33.useMemo)(() => Object.fromEntries(busqueda.entries()), [busqueda]);
5538
5527
  const Pantalla = wScreens[screenName];
5539
- 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 }) });
5540
5529
  };
5541
5530
 
5542
5531
  // src/pages/MenuTablePage.tsx
5543
5532
  var import_react34 = require("react");
5544
- var import_react_router_dom11 = require("react-router-dom");
5545
- var import_material26 = require("@mui/material");
5533
+ var import_react_router_dom12 = require("react-router-dom");
5534
+ var import_material25 = require("@mui/material");
5546
5535
  var import_jsx_runtime31 = require("react/jsx-runtime");
5547
5536
  function fixedFieldsDeMenu(ff) {
5548
5537
  if (!ff) return [];
@@ -5552,7 +5541,7 @@ function fixedFieldsDeMenu(ff) {
5552
5541
  return Object.entries(ff).map(([fieldName, value]) => ({ fieldName, value }));
5553
5542
  }
5554
5543
  var MenuTablePage = () => {
5555
- const { menuName } = (0, import_react_router_dom11.useParams)();
5544
+ const { menuName } = (0, import_react_router_dom12.useParams)();
5556
5545
  const { clientContext } = useApp();
5557
5546
  const findMenuItem = (items, nameToFind) => {
5558
5547
  for (const item of items) {
@@ -5584,9 +5573,9 @@ var MenuTablePage = () => {
5584
5573
  };
5585
5574
  }, [menuName, clientContext]);
5586
5575
  if (!currentTableName) {
5587
- 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: [
5588
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Typography, { variant: "h6", children: "Error: No se pudo cargar la informaci\xF3n de la tabla." }),
5589
- /* @__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." })
5590
5579
  ] }) });
5591
5580
  }
5592
5581
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
@@ -5599,62 +5588,424 @@ var MenuTablePage = () => {
5599
5588
  };
5600
5589
  var MenuTablePage_default = MenuTablePage;
5601
5590
 
5602
- // src/App.tsx
5591
+ // src/puente/PantallaBP.tsx
5592
+ var import_react36 = require("react");
5593
+ var import_react_router_dom13 = require("react-router-dom");
5603
5594
  var import_material27 = require("@mui/material");
5604
- var import_type_store6 = __toESM(require("type-store"), 1);
5595
+
5596
+ // src/puente/clienteBP.ts
5597
+ function extraerRecursos(html) {
5598
+ const documento = new DOMParser().parseFromString(html, "text/html");
5599
+ const referencias = (selector, atributo) => Array.from(documento.querySelectorAll(selector)).map((elemento) => elemento.getAttribute(atributo)).filter((ruta) => !!ruta);
5600
+ return {
5601
+ hojasDeEstilo: referencias("link[rel=stylesheet]", "href"),
5602
+ scripts: referencias("script[src]", "src")
5603
+ };
5604
+ }
5605
+ function fijarBase(urlBackend) {
5606
+ const href = new URL(urlBackend.replace(/\/*$/, "/"), window.location.href).href;
5607
+ let base = document.querySelector("base");
5608
+ if (!base) {
5609
+ base = document.createElement("base");
5610
+ document.head.prepend(base);
5611
+ }
5612
+ base.href = href;
5613
+ }
5614
+ function cargarScript(ruta) {
5615
+ return new Promise((resolver, rechazar) => {
5616
+ const script = document.createElement("script");
5617
+ script.async = false;
5618
+ script.src = ruta;
5619
+ script.onload = () => resolver();
5620
+ script.onerror = () => rechazar(new Error(`No se pudo cargar ${ruta}`));
5621
+ document.head.appendChild(script);
5622
+ });
5623
+ }
5624
+ function esperarCargaDeVentana() {
5625
+ if (document.readyState === "complete") return Promise.resolve();
5626
+ return new Promise((resolver) => window.addEventListener("load", () => resolver(), { once: true }));
5627
+ }
5628
+ var carga = null;
5629
+ function cargarClienteBP(urlBackend) {
5630
+ if (!carga) {
5631
+ carga = cargarSinMemoria(urlBackend).catch((error) => {
5632
+ carga = null;
5633
+ throw error;
5634
+ });
5635
+ }
5636
+ return carga;
5637
+ }
5638
+ async function cargarSinMemoria(urlBackend) {
5639
+ const destino = new URL(urlBackend, window.location.href);
5640
+ if (destino.origin !== window.location.origin) {
5641
+ throw new Error(`El cliente de backend-plus solo se puede usar desde el mismo origen que el backend (${destino.origin} no es ${window.location.origin}).`);
5642
+ }
5643
+ fijarBase(urlBackend);
5644
+ const respuesta = await fetch(`${destino.pathname.replace(/\/*$/, "")}/menu`, { credentials: "include" });
5645
+ if (!respuesta.ok || /\/login\/?$/.test(new URL(respuesta.url).pathname)) {
5646
+ throw new Error("No hay una sesi\xF3n iniciada en el backend.");
5647
+ }
5648
+ const recursos = extraerRecursos(await respuesta.text());
5649
+ recursos.hojasDeEstilo.forEach((ruta) => {
5650
+ const enlace = document.createElement("link");
5651
+ enlace.rel = "stylesheet";
5652
+ enlace.href = ruta;
5653
+ document.head.appendChild(enlace);
5654
+ });
5655
+ await esperarCargaDeVentana();
5656
+ for (const ruta of recursos.scripts) {
5657
+ await cargarScript(ruta);
5658
+ }
5659
+ const myOwn = window.myOwn;
5660
+ if (!myOwn) throw new Error("El backend no defini\xF3 myOwn.");
5661
+ window.my = myOwn;
5662
+ await myOwn.autoSetup();
5663
+ return myOwn;
5664
+ }
5665
+
5666
+ // src/puente/ConsolaBP.tsx
5667
+ var import_react35 = require("react");
5668
+ var import_material26 = require("@mui/material");
5605
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
+
5741
+ // src/puente/pantallaDeBP.ts
5742
+ var RUTA_PANTALLA_BP = "/bp/menu";
5743
+ function rutaDePantallaBP(nombre, parametros = "") {
5744
+ const resto = parametros.replace(/^[#?]/, "").replace(/(^|&)w=[^&]*/, "").replace(/^&/, "");
5745
+ return `${RUTA_PANTALLA_BP}#w=${encodeURIComponent(nombre)}${resto ? `&${resto}` : ""}`;
5746
+ }
5747
+ function rutaDeEnlaceBP(href, baseDelDocumento, urlBackend) {
5748
+ const enlace = new URL(href, baseDelDocumento);
5749
+ const base = `${urlBackend.replace(/\/*$/, "/")}`;
5750
+ const pagina = (nombre2) => new URL(`${base}${nombre2}`, baseDelDocumento);
5751
+ if (enlace.origin !== pagina("menu").origin) return null;
5752
+ if (enlace.pathname === pagina("login").pathname) return "/login";
5753
+ if (enlace.pathname === pagina("logout").pathname) return "/logout";
5754
+ if (enlace.pathname !== pagina("menu").pathname) return null;
5755
+ const texto = (enlace.hash || enlace.search).slice(1);
5756
+ const nombre = new URLSearchParams(texto).get("w");
5757
+ return nombre ? rutaDePantallaBP(nombre, texto) : null;
5758
+ }
5759
+ function resolverPantallaBP(myOwn, nombre, contenedor) {
5760
+ const registrada = myOwn.wScreens[nombre];
5761
+ if (!registrada) return null;
5762
+ if (typeof registrada === "function") {
5763
+ return { definicion: { mainFunction: registrada }, ejecutar: registrada };
5764
+ }
5765
+ if (registrada.mainFunction) {
5766
+ return { definicion: registrada, ejecutar: registrada.mainFunction };
5767
+ }
5768
+ const { parameters, mainAction, resultClass, proceedLabel } = registrada;
5769
+ const procAux = myOwn.wScreens.procAux;
5770
+ const mostrarParametros = typeof procAux === "object" ? procAux.showParams : void 0;
5771
+ if (parameters && mostrarParametros) {
5772
+ return {
5773
+ definicion: registrada,
5774
+ ejecutar: (parametros) => mostrarParametros({ parameters, resultClass, proceedLabel }, contenedor, parametros, mainAction)
5775
+ };
5776
+ }
5777
+ return null;
5778
+ }
5779
+
5780
+ // src/puente/capturaDeNavegacion.ts
5781
+ function apiDeNavegacion() {
5782
+ const api = Reflect.get(window, "navigation");
5783
+ return typeof api === "object" && api !== null && "addEventListener" in api && typeof api.addEventListener === "function" ? api : null;
5784
+ }
5785
+ function capturarNavegacionBP(urlBackend, navegar) {
5786
+ const alHacerClick = (evento) => {
5787
+ if (evento.defaultPrevented || evento.button !== 0 || evento.ctrlKey || evento.metaKey || evento.shiftKey) return;
5788
+ const enlace = evento.target instanceof Element ? evento.target.closest("a[href]") : null;
5789
+ if (!enlace || enlace.hasAttribute("download") || (enlace.getAttribute("target") ?? "_self") !== "_self") return;
5790
+ const ruta = rutaDeEnlaceBP(enlace.getAttribute("href") ?? "", document.baseURI, urlBackend);
5791
+ if (ruta) {
5792
+ evento.preventDefault();
5793
+ evento.stopPropagation();
5794
+ navegar(ruta);
5795
+ }
5796
+ };
5797
+ document.addEventListener("click", alHacerClick, true);
5798
+ const navegacion = apiDeNavegacion();
5799
+ const alNavegar = (evento) => {
5800
+ if (!evento.cancelable || evento.destination.sameDocument || evento.downloadRequest !== null) return;
5801
+ const ruta = rutaDeEnlaceBP(evento.destination.url, document.baseURI, urlBackend);
5802
+ if (ruta) {
5803
+ evento.preventDefault();
5804
+ navegar(ruta);
5805
+ }
5806
+ };
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;
5814
+ return () => {
5815
+ if (history.replaceState === reemplazar) history.replaceState = reemplazarOriginal;
5816
+ document.removeEventListener("click", alHacerClick, true);
5817
+ navegacion?.removeEventListener("navigate", alNavegar);
5818
+ };
5819
+ }
5820
+
5821
+ // src/puente/habilitacion.ts
5822
+ var habilitado = false;
5823
+ var habilitarPuenteBP = () => {
5824
+ habilitado = true;
5825
+ };
5826
+ var puenteBPHabilitado = () => habilitado;
5827
+
5828
+ // src/puente/PantallaBP.tsx
5829
+ var import_jsx_runtime33 = require("react/jsx-runtime");
5830
+ function buscarItemDeMenu(items, tipo) {
5831
+ for (const item of items) {
5832
+ if (item.menuType === tipo) return item;
5833
+ if (item.menuType === "menu") {
5834
+ const encontrado = buscarItemDeMenu(item.menuContent, tipo);
5835
+ if (encontrado) return encontrado;
5836
+ }
5837
+ }
5838
+ return void 0;
5839
+ }
5840
+ var PantallaBP = ({ nombre, direccion }) => {
5841
+ const navigate = (0, import_react_router_dom13.useNavigate)();
5842
+ const { clientContext } = useApp();
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);
5847
+ const menu = clientContext.menu;
5848
+ (0, import_react36.useEffect)(() => {
5849
+ const elemento = contenedor.current;
5850
+ if (!elemento) return;
5851
+ let vigente = true;
5852
+ setError(null);
5853
+ setNoExiste(false);
5854
+ setCargando(true);
5855
+ const dejarDeCapturar = capturarNavegacionBP(envConfig.backendUrl, navigate);
5856
+ cargarClienteBP(envConfig.backendUrl).then((myOwn) => {
5857
+ if (!vigente) return;
5858
+ setCargando(false);
5859
+ const pantalla = resolverPantallaBP(myOwn, nombre, elemento);
5860
+ if (!pantalla) {
5861
+ setNoExiste(true);
5862
+ return;
5863
+ }
5864
+ elemento.replaceChildren();
5865
+ const item = menu ? buscarItemDeMenu(menu, nombre) : void 0;
5866
+ const desdeLaDireccion = myOwn.UriSearchToObject?.(direccion) ?? Object.fromEntries(new URLSearchParams(direccion.replace(/^[#?]/, "")).entries());
5867
+ const parametros = { ...item, ...desdeLaDireccion };
5868
+ myOwn.preDisplayPage?.(parametros, pantalla.definicion, nombre);
5869
+ pantalla.ejecutar.call(myOwn, parametros);
5870
+ }).catch((err) => {
5871
+ if (!vigente) return;
5872
+ setCargando(false);
5873
+ setError(mensajeDeError(err));
5874
+ });
5875
+ return () => {
5876
+ vigente = false;
5877
+ dejarDeCapturar();
5878
+ elemento.replaceChildren();
5879
+ };
5880
+ }, [nombre, direccion, menu, navigate]);
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
+ );
5891
+ };
5892
+ var PantallaDeRespaldo = () => {
5893
+ const { screenName = "" } = (0, import_react_router_dom13.useParams)();
5894
+ const { search } = (0, import_react_router_dom13.useLocation)();
5895
+ if (!puenteBPHabilitado()) {
5896
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material27.Box, { sx: { p: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(FallbackWScreen, { screenName }) });
5897
+ }
5898
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_react_router_dom13.Navigate, { to: rutaDePantallaBP(screenName, search), replace: true });
5899
+ };
5900
+ var PaginaBP = () => {
5901
+ const { hash, search } = (0, import_react_router_dom13.useLocation)();
5902
+ const direccion = hash || search;
5903
+ const nombre = new URLSearchParams(direccion.replace(/^[#?]/, "")).get("w");
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: [
5906
+ "Falta la pantalla de backend-plus (",
5907
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("code", { children: "#w=..." }),
5908
+ ")."
5909
+ ] }) });
5910
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PantallaBP, { nombre, direccion }, nombre);
5911
+ };
5912
+
5913
+ // src/puente/GrillaBP.tsx
5914
+ var import_react37 = require("react");
5915
+ var import_react_router_dom14 = require("react-router-dom");
5916
+ var import_material28 = require("@mui/material");
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
+ );
5921
+ var GrillaBP = ({ tabla, fixedFields }) => {
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);
5925
+ const clave = JSON.stringify(fixedFields ?? []);
5926
+ (0, import_react37.useEffect)(() => {
5927
+ const elemento = contenedor.current;
5928
+ if (!elemento) return;
5929
+ let vigente = true;
5930
+ setError(null);
5931
+ setCargando(true);
5932
+ cargarClienteBP(envConfig.backendUrl).then((myOwn) => {
5933
+ if (!vigente) return;
5934
+ setCargando(false);
5935
+ elemento.replaceChildren();
5936
+ myOwn.tableGrid(tabla, elemento, { fixedFields: JSON.parse(clave) });
5937
+ }).catch((err) => {
5938
+ if (!vigente) return;
5939
+ setCargando(false);
5940
+ setError(mensajeDeError(err));
5941
+ });
5942
+ return () => {
5943
+ vigente = false;
5944
+ elemento.replaceChildren();
5945
+ };
5946
+ }, [tabla, clave]);
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, {})
5952
+ ] });
5953
+ };
5954
+ var PaginaGrillaBP = () => {
5955
+ const { tableName = "" } = (0, import_react_router_dom14.useParams)();
5956
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(GrillaBP, { tabla: tableName }, tableName);
5957
+ };
5958
+
5959
+ // src/App.tsx
5960
+ var import_type_store6 = __toESM(require("type-store"), 1);
5961
+ var import_jsx_runtime35 = require("react/jsx-runtime");
5606
5962
  var LocationTracker = () => {
5607
- const location = (0, import_react_router_dom12.useLocation)();
5963
+ const location = (0, import_react_router_dom15.useLocation)();
5608
5964
  const dispatch = useAppDispatch();
5609
- (0, import_react35.useEffect)(() => {
5965
+ (0, import_react38.useEffect)(() => {
5610
5966
  dispatch(setCurrentPath(location.pathname + location.search));
5611
5967
  }, [location, dispatch]);
5612
5968
  return null;
5613
5969
  };
5614
5970
  function FrontendPlusReactRoutes({ myRoutes, myUnloggedRoutes, layout: Layout = MainLayout_default, unloggedLayout: UnloggedLayout }) {
5615
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
5616
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(InitialRedirectHandler_default, {}),
5617
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_router_dom12.Routes, { children: [
5618
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_router_dom12.Route, { element: UnloggedLayout ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(UnloggedLayout, {}) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.Outlet, {}), children: [
5619
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.Route, { path: "/login", element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LoginPage_default, {}) }),
5620
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.Route, { path: "/logout", element: /* @__PURE__ */ (0, import_jsx_runtime32.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, {}) }),
5621
5977
  myUnloggedRoutes
5622
5978
  ] }),
5623
- /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_router_dom12.Route, { element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PrivateRoute_default, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Layout, {}) }), children: [
5624
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.Route, { path: "/", element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(HomePage_default, {}) }),
5625
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.Route, { path: "/home", element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(HomePage_default, {}) }),
5626
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.Route, { path: "/table/:tableName", element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(GenericDataGridPage_default, {}) }),
5627
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.Route, { path: "/menu/:menuName", element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MenuTablePage_default, {}) }),
5628
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.Route, { path: "/procedures/:procedureName", element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ProcedureForm_default, {}) }),
5629
- Object.keys(wScreens).map((screenName) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
5630
- import_react_router_dom12.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,
5631
5986
  {
5632
5987
  path: `/wScreens/${screenName}`,
5633
- element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(PantallaDeRuta, { screenName })
5988
+ element: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PantallaDeRuta, { screenName })
5634
5989
  },
5635
5990
  screenName
5636
5991
  )),
5637
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
5638
- import_react_router_dom12.Route,
5639
- {
5640
- path: "/wScreens-fallback/:screenName",
5641
- element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material27.Box, { sx: { p: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(FallbackWScreen, { screenName: ":screenName" }) })
5642
- }
5643
- ),
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, {}) }),
5644
5995
  myRoutes,
5645
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.Route, { path: "*", element: /* @__PURE__ */ (0, import_jsx_runtime32.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" }) })
5646
5997
  ] }),
5647
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.Route, { path: "*", element: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_router_dom12.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 }) })
5648
5999
  ] })
5649
6000
  ] });
5650
6001
  }
5651
6002
  var FrontendPlusProviders = ({ children, publicPaths }) => {
5652
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react_redux5.Provider, { store, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react36.PersistGate, { loading: null, persistor, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_react_router_dom12.BrowserRouter, { children: [
5653
- /* @__PURE__ */ (0, import_jsx_runtime32.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, {}),
5654
6005
  " ",
5655
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AppProvider, { publicPaths, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(SnackbarProvider, { children: [
6006
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(AppProvider, { publicPaths, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(SnackbarProvider, { children: [
5656
6007
  children,
5657
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(SessionExpiredMessage_default, {})
6008
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(SessionExpiredMessage_default, {})
5658
6009
  ] }) })
5659
6010
  ] }) }) });
5660
6011
  };
@@ -5665,9 +6016,10 @@ var App = ({
5665
6016
  myWScreens,
5666
6017
  myClientSides,
5667
6018
  myResultsOk,
5668
- myConditions
6019
+ myConditions,
6020
+ puenteBP
5669
6021
  }) => {
5670
- (0, import_react35.useMemo)(() => {
6022
+ (0, import_react38.useMemo)(() => {
5671
6023
  if (myClientSides) {
5672
6024
  extendClientSides(myClientSides);
5673
6025
  }
@@ -5680,8 +6032,11 @@ var App = ({
5680
6032
  if (myConditions) {
5681
6033
  extendConditions(myConditions);
5682
6034
  }
5683
- }, [myClientSides, myResultsOk, myWScreens, myConditions]);
5684
- (0, import_react35.useEffect)(() => {
6035
+ if (puenteBP) {
6036
+ habilitarPuenteBP();
6037
+ }
6038
+ }, [myClientSides, myResultsOk, myWScreens, myConditions, puenteBP]);
6039
+ (0, import_react38.useEffect)(() => {
5685
6040
  import_type_store6.default.messages = import_type_store6.default.i18n.messages.es;
5686
6041
  import_type_store6.default.locale = import_type_store6.default.i18n.locale.es;
5687
6042
  const link = document.querySelector("link[rel*='icon']") || document.createElement("link");
@@ -5690,11 +6045,11 @@ var App = ({
5690
6045
  link.href = `${envConfig.backendUrl}/img/logo-128.png`;
5691
6046
  document.getElementsByTagName("head")[0].appendChild(link);
5692
6047
  }, []);
5693
- const safePaths = import_react35.default.useMemo(() => {
6048
+ const safePaths = import_react38.default.useMemo(() => {
5694
6049
  const extracted = extractPathsFromRoutes(myUnloggedRoutes);
5695
6050
  return ["/login", "/logout", ...extracted];
5696
6051
  }, [myUnloggedRoutes]);
5697
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(FrontendPlusProviders, { publicPaths: safePaths, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
6052
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FrontendPlusProviders, { publicPaths: safePaths, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5698
6053
  FrontendPlusReactRoutes,
5699
6054
  {
5700
6055
  myRoutes,
@@ -5713,6 +6068,7 @@ var App_default = App;
5713
6068
  FrontendPlusProviders,
5714
6069
  FrontendPlusReactRoutes,
5715
6070
  GenericDataGrid,
6071
+ GrillaBP,
5716
6072
  MainLayout,
5717
6073
  SnackbarProvider,
5718
6074
  cambiarGuionesBajosPorEspacios,
@@ -5722,6 +6078,7 @@ var App_default = App;
5722
6078
  extendResultsOk,
5723
6079
  extendWScreens,
5724
6080
  extractPathsFromRoutes,
6081
+ habilitarPuenteBP,
5725
6082
  resultComponents,
5726
6083
  useApiCall,
5727
6084
  useApiCallWithoutSnackbar,