master-page-vue 1.0.1 → 1.0.2
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/master-page-vue.mjs +238 -180
- package/dist/master-page-vue.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/master-page-vue.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ref as A, readonly as I, defineComponent as
|
|
1
|
+
import { ref as A, readonly as I, defineComponent as L, openBlock as r, createElementBlock as i, createElementVNode as o, unref as p, createCommentVNode as j, toDisplayString as C, normalizeClass as S, createTextVNode as z, createStaticVNode as W, Fragment as O, renderList as R, onUnmounted as q, createVNode as F, renderSlot as J } from "vue";
|
|
2
2
|
import { UserManager as Q } from "oidc-client-ts";
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
function
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
const
|
|
3
|
+
const x = A(!1), T = A(null), H = A([]), E = A(!0);
|
|
4
|
+
let w, m, y = null;
|
|
5
|
+
function P() {
|
|
6
|
+
function h(e) {
|
|
7
|
+
w = e;
|
|
8
|
+
const t = {
|
|
9
9
|
authority: e.oidc.authority,
|
|
10
10
|
client_id: e.oidc.clientId,
|
|
11
11
|
client_secret: e.oidc.clientSecret,
|
|
@@ -14,160 +14,163 @@ function R() {
|
|
|
14
14
|
scope: e.oidc.scope ?? "openid profile email roles offline_access",
|
|
15
15
|
post_logout_redirect_uri: e.oidc.postLogoutRedirectUri ?? `${window.location.origin}?op=1`
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
m = new Q(t), l(), $();
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return
|
|
19
|
+
function d() {
|
|
20
|
+
return w;
|
|
21
21
|
}
|
|
22
22
|
function n() {
|
|
23
|
-
|
|
23
|
+
m.signinRedirect({ prompt: "login" });
|
|
24
24
|
}
|
|
25
25
|
function f() {
|
|
26
|
-
const e = localStorage.getItem("access_token") ?? "",
|
|
27
|
-
|
|
26
|
+
const e = localStorage.getItem("access_token") ?? "", t = encodeURIComponent(
|
|
27
|
+
w.oidc.postLogoutRedirectUri ?? `${window.location.origin}?op=1`
|
|
28
28
|
);
|
|
29
|
-
window.location.href = `${
|
|
29
|
+
window.location.href = `${w.oidc.authority}/connect/logout?id_token_hint=${e}&post_logout_redirect_uri=${t}`;
|
|
30
30
|
}
|
|
31
31
|
function u() {
|
|
32
|
-
window.location.href = `${
|
|
32
|
+
window.location.href = `${w.oidc.authority}/Identity/Account/Manage?salir=1`;
|
|
33
33
|
}
|
|
34
|
-
async function
|
|
35
|
-
const e = await
|
|
34
|
+
async function g() {
|
|
35
|
+
const e = await m.getUser();
|
|
36
36
|
return (e == null ? void 0 : e.access_token) ?? null;
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function l() {
|
|
39
39
|
const e = new URLSearchParams(window.location.search).get("op");
|
|
40
|
-
e === "2" &&
|
|
40
|
+
e === "2" && m.signinRedirectCallback().then(() => {
|
|
41
41
|
window.location.href = "/";
|
|
42
|
-
}).catch((
|
|
43
|
-
|
|
44
|
-
}).catch((
|
|
42
|
+
}).catch((t) => console.error("[MasterPage] signin callback error:", t)), e === "1" && m.signoutRedirectCallback().then(() => {
|
|
43
|
+
m.removeUser(), window.location.href = "/";
|
|
44
|
+
}).catch((t) => console.error("[MasterPage] signout callback error:", t));
|
|
45
45
|
}
|
|
46
|
-
async function
|
|
46
|
+
async function $() {
|
|
47
47
|
try {
|
|
48
|
-
const e = await
|
|
49
|
-
e && !e.expired ? (
|
|
48
|
+
const e = await m.getUser();
|
|
49
|
+
e && !e.expired ? (b(e), w.enableFetchInterceptor !== !1 && a(), await _(e)) : (x.value = !1, T.value = null);
|
|
50
50
|
} catch (e) {
|
|
51
|
-
console.error("[MasterPage] session check error:", e),
|
|
51
|
+
console.error("[MasterPage] session check error:", e), x.value = !1;
|
|
52
52
|
} finally {
|
|
53
|
-
|
|
53
|
+
E.value = !1;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const
|
|
56
|
+
function b(e) {
|
|
57
|
+
const t = e.profile;
|
|
58
58
|
T.value = {
|
|
59
|
-
firstName:
|
|
60
|
-
middleName:
|
|
61
|
-
lastName:
|
|
62
|
-
secondLastName:
|
|
63
|
-
enterpriseName:
|
|
64
|
-
displayName: [
|
|
65
|
-
email:
|
|
59
|
+
firstName: t.UserFirstName ?? "",
|
|
60
|
+
middleName: t.UserMiddleName ?? "",
|
|
61
|
+
lastName: t.UserLastName ?? "",
|
|
62
|
+
secondLastName: t.UserSecondLastName ?? "",
|
|
63
|
+
enterpriseName: t.EnterpriseName ?? "",
|
|
64
|
+
displayName: [t.UserFirstName, t.UserMiddleName, t.UserLastName, t.UserSecondLastName].filter(Boolean).join(" ").trim(),
|
|
65
|
+
email: t.email ?? "",
|
|
66
66
|
accessToken: e.access_token,
|
|
67
|
-
rawClaims:
|
|
68
|
-
}, localStorage.setItem("access_token", e.access_token),
|
|
67
|
+
rawClaims: t
|
|
68
|
+
}, localStorage.setItem("access_token", e.access_token), x.value = !0;
|
|
69
69
|
}
|
|
70
|
-
async function
|
|
71
|
-
var
|
|
70
|
+
async function _(e) {
|
|
71
|
+
var t;
|
|
72
72
|
try {
|
|
73
|
-
const c = await fetch(`${
|
|
73
|
+
const c = await fetch(`${w.oidc.authority}/connect/userinfo`, {
|
|
74
74
|
headers: { Authorization: `Bearer ${e.access_token}` }
|
|
75
75
|
});
|
|
76
76
|
if (!c.ok) return;
|
|
77
|
-
const
|
|
78
|
-
(
|
|
77
|
+
const k = await c.json();
|
|
78
|
+
(t = k == null ? void 0 : k.usrAuthorizations) != null && t.aplicaciones && (H.value = k.usrAuthorizations.aplicaciones);
|
|
79
79
|
} catch (c) {
|
|
80
80
|
console.error("[MasterPage] Failed to fetch authorizations:", c);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
|
-
function
|
|
83
|
+
function a() {
|
|
84
84
|
if (y) return;
|
|
85
85
|
y = window.fetch.bind(window);
|
|
86
|
-
const e =
|
|
87
|
-
window.fetch = async (
|
|
88
|
-
if ((typeof
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
let
|
|
92
|
-
if (
|
|
86
|
+
const e = w.oidc.authority;
|
|
87
|
+
window.fetch = async (t, c = {}) => {
|
|
88
|
+
if ((typeof t == "string" ? t : t.url).startsWith(e)) return y(t, c);
|
|
89
|
+
let v = await m.getUser();
|
|
90
|
+
v && !v.expired && (c.headers = { ...c.headers, Authorization: `Bearer ${v.access_token}` });
|
|
91
|
+
let s = await y(t, c);
|
|
92
|
+
if (s.status === 401 && v)
|
|
93
93
|
try {
|
|
94
|
-
const N = await
|
|
95
|
-
N && (
|
|
94
|
+
const N = await m.signinSilent();
|
|
95
|
+
N && (b(N), c.headers = { ...c.headers, Authorization: `Bearer ${N.access_token}` }, s = await y(t, c));
|
|
96
96
|
} catch {
|
|
97
|
-
await
|
|
97
|
+
await m.signoutRedirect();
|
|
98
98
|
}
|
|
99
|
-
return
|
|
99
|
+
return s;
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
102
|
function U() {
|
|
103
103
|
y && (window.fetch = y, y = null);
|
|
104
104
|
}
|
|
105
105
|
return {
|
|
106
|
-
isAuthenticated: I(
|
|
106
|
+
isAuthenticated: I(x),
|
|
107
107
|
userProfile: I(T),
|
|
108
|
-
menuItems: I(
|
|
109
|
-
isLoading: I(
|
|
110
|
-
configure:
|
|
111
|
-
getConfig:
|
|
108
|
+
menuItems: I(H),
|
|
109
|
+
isLoading: I(E),
|
|
110
|
+
configure: h,
|
|
111
|
+
getConfig: d,
|
|
112
112
|
login: n,
|
|
113
113
|
logout: f,
|
|
114
114
|
openAccountSettings: u,
|
|
115
|
-
getAccessToken:
|
|
115
|
+
getAccessToken: g,
|
|
116
116
|
destroyFetchInterceptor: U
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
const X = { class: "navbar-custom" }, Y = { class: "container-fluid" }, Z = {
|
|
120
120
|
class: "navbar-brand",
|
|
121
121
|
href: "#"
|
|
122
|
-
}, ee = ["src"], oe = { class: "brand-text" }, te = { class: "navbar-right" },
|
|
122
|
+
}, ee = ["src"], oe = { class: "brand-text" }, te = { class: "navbar-right" }, se = {
|
|
123
123
|
key: 0,
|
|
124
124
|
class: "nav-item"
|
|
125
|
-
},
|
|
125
|
+
}, ne = { class: "user-label" }, ae = { class: "user-name" }, re = { class: "user-enterprise" }, ie = {
|
|
126
|
+
key: 1,
|
|
127
|
+
class: "auth-buttons"
|
|
128
|
+
}, le = /* @__PURE__ */ L({
|
|
126
129
|
__name: "AppHeader",
|
|
127
130
|
emits: ["menu-toggle"],
|
|
128
|
-
setup(
|
|
129
|
-
var
|
|
130
|
-
const n =
|
|
131
|
-
function
|
|
132
|
-
|
|
131
|
+
setup(h, { emit: d }) {
|
|
132
|
+
var k;
|
|
133
|
+
const n = d, { isAuthenticated: f, userProfile: u, login: g, logout: l, openAccountSettings: $, getConfig: b } = P(), _ = A(!1), a = b(), U = (a == null ? void 0 : a.appTitle) ?? "SISPRO - Aplicativos Misionales", e = ((k = a == null ? void 0 : a.oidc) == null ? void 0 : k.authority) ?? "";
|
|
134
|
+
function t(v) {
|
|
135
|
+
v.stopPropagation(), _.value = !_.value;
|
|
133
136
|
}
|
|
134
137
|
function c() {
|
|
135
|
-
var
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
+
var s;
|
|
139
|
+
const v = (s = b()) == null ? void 0 : s.registerUrl;
|
|
140
|
+
v && (window.location.href = v);
|
|
138
141
|
}
|
|
139
|
-
return (
|
|
140
|
-
var N,
|
|
142
|
+
return (v, s) => {
|
|
143
|
+
var N, V;
|
|
141
144
|
return r(), i("nav", X, [
|
|
142
|
-
|
|
145
|
+
o("div", Y, [
|
|
143
146
|
p(f) ? (r(), i("button", {
|
|
144
147
|
key: 0,
|
|
145
148
|
class: "menu-toggle",
|
|
146
|
-
onClick:
|
|
149
|
+
onClick: s[0] || (s[0] = (M) => n("menu-toggle")),
|
|
147
150
|
"aria-label": "Toggle menu"
|
|
148
151
|
}, " ☰ ")) : j("", !0),
|
|
149
|
-
|
|
150
|
-
|
|
152
|
+
o("a", Z, [
|
|
153
|
+
o("img", {
|
|
151
154
|
src: `${p(e)}/img/logo.svg`,
|
|
152
155
|
alt: "Logo gov.co"
|
|
153
156
|
}, null, 8, ee),
|
|
154
|
-
|
|
157
|
+
o("span", oe, C(p(U)), 1)
|
|
155
158
|
]),
|
|
156
|
-
|
|
157
|
-
p(f) ? (r(), i("div",
|
|
158
|
-
|
|
159
|
-
class: "dropdown-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
o("div", te, [
|
|
160
|
+
p(f) ? (r(), i("div", se, [
|
|
161
|
+
o("button", {
|
|
162
|
+
class: "user-dropdown-btn",
|
|
163
|
+
onClick: t,
|
|
164
|
+
"aria-label": "Opciones de usuario"
|
|
162
165
|
}, [
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
+
o("div", ne, [
|
|
167
|
+
o("span", ae, C((N = p(u)) == null ? void 0 : N.displayName), 1),
|
|
168
|
+
o("span", re, C((V = p(u)) == null ? void 0 : V.enterpriseName), 1)
|
|
166
169
|
]),
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
width: "
|
|
170
|
-
height: "
|
|
170
|
+
s[5] || (s[5] = o("div", { class: "user-avatar" }, [
|
|
171
|
+
o("svg", {
|
|
172
|
+
width: "20",
|
|
173
|
+
height: "20",
|
|
171
174
|
viewBox: "0 0 24 24",
|
|
172
175
|
fill: "none",
|
|
173
176
|
stroke: "currentColor",
|
|
@@ -175,133 +178,188 @@ const X = { class: "navbar-custom" }, Y = { class: "container-fluid" }, Z = {
|
|
|
175
178
|
"stroke-linecap": "round",
|
|
176
179
|
"stroke-linejoin": "round"
|
|
177
180
|
}, [
|
|
178
|
-
|
|
179
|
-
|
|
181
|
+
o("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }),
|
|
182
|
+
o("circle", {
|
|
180
183
|
cx: "12",
|
|
181
184
|
cy: "7",
|
|
182
185
|
r: "4"
|
|
183
186
|
})
|
|
184
187
|
])
|
|
185
|
-
], -1))
|
|
188
|
+
], -1)),
|
|
189
|
+
(r(), i("svg", {
|
|
190
|
+
class: S(["chevron", { rotated: _.value }]),
|
|
191
|
+
width: "14",
|
|
192
|
+
height: "14",
|
|
193
|
+
viewBox: "0 0 24 24",
|
|
194
|
+
fill: "none",
|
|
195
|
+
stroke: "currentColor",
|
|
196
|
+
"stroke-width": "2.5",
|
|
197
|
+
"stroke-linecap": "round",
|
|
198
|
+
"stroke-linejoin": "round"
|
|
199
|
+
}, [...s[4] || (s[4] = [
|
|
200
|
+
o("polyline", { points: "6 9 12 15 18 9" }, null, -1)
|
|
201
|
+
])], 2))
|
|
186
202
|
]),
|
|
187
|
-
|
|
188
|
-
class:
|
|
203
|
+
o("ul", {
|
|
204
|
+
class: S(["dropdown-menu", { open: _.value }])
|
|
189
205
|
}, [
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
onClick:
|
|
193
|
-
(...
|
|
194
|
-
},
|
|
206
|
+
o("li", null, [
|
|
207
|
+
o("a", {
|
|
208
|
+
onClick: s[1] || (s[1] = //@ts-ignore
|
|
209
|
+
(...M) => p($) && p($)(...M))
|
|
210
|
+
}, [...s[6] || (s[6] = [
|
|
211
|
+
o("svg", {
|
|
212
|
+
width: "16",
|
|
213
|
+
height: "16",
|
|
214
|
+
viewBox: "0 0 24 24",
|
|
215
|
+
fill: "none",
|
|
216
|
+
stroke: "currentColor",
|
|
217
|
+
"stroke-width": "2",
|
|
218
|
+
"stroke-linecap": "round",
|
|
219
|
+
"stroke-linejoin": "round"
|
|
220
|
+
}, [
|
|
221
|
+
o("circle", {
|
|
222
|
+
cx: "12",
|
|
223
|
+
cy: "12",
|
|
224
|
+
r: "3"
|
|
225
|
+
}),
|
|
226
|
+
o("path", { d: "M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z" })
|
|
227
|
+
], -1),
|
|
228
|
+
z(" Configuración ", -1)
|
|
229
|
+
])])
|
|
195
230
|
]),
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
231
|
+
s[8] || (s[8] = o("li", { class: "divider" }, null, -1)),
|
|
232
|
+
o("li", null, [
|
|
233
|
+
o("a", {
|
|
234
|
+
class: "logout-item",
|
|
235
|
+
onClick: s[2] || (s[2] = //@ts-ignore
|
|
236
|
+
(...M) => p(l) && p(l)(...M))
|
|
237
|
+
}, [...s[7] || (s[7] = [
|
|
238
|
+
o("svg", {
|
|
239
|
+
width: "16",
|
|
240
|
+
height: "16",
|
|
241
|
+
viewBox: "0 0 24 24",
|
|
242
|
+
fill: "none",
|
|
243
|
+
stroke: "currentColor",
|
|
244
|
+
"stroke-width": "2",
|
|
245
|
+
"stroke-linecap": "round",
|
|
246
|
+
"stroke-linejoin": "round"
|
|
247
|
+
}, [
|
|
248
|
+
o("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }),
|
|
249
|
+
o("polyline", { points: "16 17 21 12 16 7" }),
|
|
250
|
+
o("line", {
|
|
251
|
+
x1: "21",
|
|
252
|
+
y1: "12",
|
|
253
|
+
x2: "9",
|
|
254
|
+
y2: "12"
|
|
255
|
+
})
|
|
256
|
+
], -1),
|
|
257
|
+
z(" Cerrar sesión ", -1)
|
|
258
|
+
])])
|
|
201
259
|
])
|
|
202
260
|
], 2)
|
|
203
|
-
])) : (r(), i(
|
|
204
|
-
|
|
261
|
+
])) : (r(), i("div", ie, [
|
|
262
|
+
o("button", {
|
|
205
263
|
class: "btn-login",
|
|
206
|
-
onClick:
|
|
207
|
-
(...
|
|
264
|
+
onClick: s[3] || (s[3] = //@ts-ignore
|
|
265
|
+
(...M) => p(g) && p(g)(...M))
|
|
208
266
|
}, "Ingresar"),
|
|
209
|
-
|
|
267
|
+
o("button", {
|
|
210
268
|
class: "btn-register",
|
|
211
269
|
onClick: c
|
|
212
270
|
}, "Registrarse")
|
|
213
|
-
]
|
|
271
|
+
]))
|
|
214
272
|
])
|
|
215
273
|
])
|
|
216
274
|
]);
|
|
217
275
|
};
|
|
218
276
|
}
|
|
219
|
-
}), B = (
|
|
220
|
-
const n =
|
|
221
|
-
for (const [f, u] of
|
|
277
|
+
}), B = (h, d) => {
|
|
278
|
+
const n = h.__vccOpts || h;
|
|
279
|
+
for (const [f, u] of d)
|
|
222
280
|
n[f] = u;
|
|
223
281
|
return n;
|
|
224
|
-
}, D = /* @__PURE__ */ B(
|
|
282
|
+
}, D = /* @__PURE__ */ B(le, [["__scopeId", "data-v-99bde91d"]]), ce = { class: "shell-footer" }, de = { class: "container" }, ue = { class: "row" }, fe = { class: "col logos-col" }, pe = ["src"], he = ["src"], ge = /* @__PURE__ */ L({
|
|
225
283
|
__name: "AppFooter",
|
|
226
|
-
setup(
|
|
284
|
+
setup(h) {
|
|
227
285
|
var f, u;
|
|
228
|
-
const { getConfig:
|
|
229
|
-
return (
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
286
|
+
const { getConfig: d } = P(), n = ((u = (f = d()) == null ? void 0 : f.oidc) == null ? void 0 : u.authority) ?? "";
|
|
287
|
+
return (g, l) => (r(), i("footer", ce, [
|
|
288
|
+
o("div", de, [
|
|
289
|
+
o("div", ue, [
|
|
290
|
+
o("div", fe, [
|
|
291
|
+
o("img", {
|
|
234
292
|
src: `${p(n)}/img/logo.svg`,
|
|
235
293
|
alt: "GOV.CO",
|
|
236
294
|
class: "footer-logo"
|
|
237
|
-
}, null, 8,
|
|
238
|
-
|
|
295
|
+
}, null, 8, pe),
|
|
296
|
+
o("img", {
|
|
239
297
|
src: `${p(n)}/img/colombia.png`,
|
|
240
298
|
alt: "Colombia Potencia de la Vida",
|
|
241
299
|
class: "footer-logo"
|
|
242
|
-
}, null, 8,
|
|
300
|
+
}, null, 8, he)
|
|
243
301
|
]),
|
|
244
|
-
|
|
302
|
+
l[0] || (l[0] = W('<div class="col border-start" data-v-93fe5bbf><strong data-v-93fe5bbf>SISPRO</strong><p data-v-93fe5bbf> Dirección:<br data-v-93fe5bbf> Carrera 13 # 32–76 (piso 1)<br data-v-93fe5bbf> Cundinamarca, Bogotá D.C.<br data-v-93fe5bbf> Código Postal: 110311 </p><p data-v-93fe5bbf><a href="#" class="footer-link" data-v-93fe5bbf>Horario de atención:</a><br data-v-93fe5bbf> Lunes a viernes 8:00 a.m. a 4:00 p.m. </p></div><div class="col border-start" data-v-93fe5bbf><strong data-v-93fe5bbf>Contacto</strong><p data-v-93fe5bbf> Teléfono conmutador:<br data-v-93fe5bbf> En Bogotá: 601 330 5043 Opción 2<br data-v-93fe5bbf> Resto del país: 018000960020 Opción 2 </p><p data-v-93fe5bbf> Correo de notificaciones judiciales:<br data-v-93fe5bbf><a href="mailto:notificacionesjudiciales@minsalud.gov.co" class="footer-link" data-v-93fe5bbf> notificacionesjudiciales@minsalud.gov.co </a></p><p data-v-93fe5bbf><a href="https://www.minsalud.gov.co/Documents/Ministerio/Terminos%20y%20Condiciones%20de%20uso%20del%20portal%20web_Octubre%202012x.pdf" target="_blank" class="footer-link" data-v-93fe5bbf> Términos y condiciones </a></p></div>', 2))
|
|
245
303
|
])
|
|
246
304
|
])
|
|
247
305
|
]));
|
|
248
306
|
}
|
|
249
|
-
}),
|
|
307
|
+
}), G = /* @__PURE__ */ B(ge, [["__scopeId", "data-v-93fe5bbf"]]), ve = { class: "menu-list" }, me = ["onClick"], _e = ["href"], be = {
|
|
250
308
|
key: 2,
|
|
251
309
|
class: "submenu"
|
|
252
|
-
},
|
|
310
|
+
}, ke = ["onClick"], we = ["href"], ye = {
|
|
253
311
|
key: 2,
|
|
254
312
|
class: "submenu"
|
|
255
|
-
},
|
|
313
|
+
}, Ce = ["href"], $e = /* @__PURE__ */ L({
|
|
256
314
|
__name: "AppMenu",
|
|
257
315
|
props: {
|
|
258
316
|
isOpen: { type: Boolean }
|
|
259
317
|
},
|
|
260
|
-
setup(
|
|
261
|
-
const { menuItems:
|
|
318
|
+
setup(h) {
|
|
319
|
+
const { menuItems: d } = P(), n = A(/* @__PURE__ */ new Set());
|
|
262
320
|
function f(u) {
|
|
263
321
|
n.value.has(u) ? n.value.delete(u) : n.value.add(u), n.value = new Set(n.value);
|
|
264
322
|
}
|
|
265
|
-
return (u,
|
|
266
|
-
class:
|
|
323
|
+
return (u, g) => (r(), i("aside", {
|
|
324
|
+
class: S(["sidebar-menu", { show: h.isOpen }])
|
|
267
325
|
}, [
|
|
268
|
-
|
|
269
|
-
(r(!0), i(
|
|
270
|
-
var
|
|
326
|
+
o("ul", ve, [
|
|
327
|
+
(r(!0), i(O, null, R(p(d), (l) => {
|
|
328
|
+
var $, b, _;
|
|
271
329
|
return r(), i("li", {
|
|
272
|
-
key:
|
|
273
|
-
class:
|
|
330
|
+
key: l.nombre,
|
|
331
|
+
class: S({ "has-submenu": ($ = l.hijos) == null ? void 0 : $.length, open: n.value.has(l) })
|
|
274
332
|
}, [
|
|
275
|
-
(
|
|
333
|
+
(b = l.hijos) != null && b.length ? (r(), i("span", {
|
|
276
334
|
key: 0,
|
|
277
335
|
class: "has-children",
|
|
278
|
-
onClick: (
|
|
279
|
-
},
|
|
336
|
+
onClick: (a) => f(l)
|
|
337
|
+
}, C(l.nombre), 9, me)) : (r(), i("a", {
|
|
280
338
|
key: 1,
|
|
281
|
-
href:
|
|
282
|
-
},
|
|
283
|
-
(
|
|
284
|
-
(r(!0), i(
|
|
285
|
-
var U, e,
|
|
339
|
+
href: l.url || "#"
|
|
340
|
+
}, C(l.nombre), 9, _e)),
|
|
341
|
+
(_ = l.hijos) != null && _.length && n.value.has(l) ? (r(), i("ul", be, [
|
|
342
|
+
(r(!0), i(O, null, R(l.hijos, (a) => {
|
|
343
|
+
var U, e, t;
|
|
286
344
|
return r(), i("li", {
|
|
287
|
-
key:
|
|
288
|
-
class:
|
|
345
|
+
key: a.nombre,
|
|
346
|
+
class: S({ "has-submenu": (U = a.hijos) == null ? void 0 : U.length, open: n.value.has(a) })
|
|
289
347
|
}, [
|
|
290
|
-
(e =
|
|
348
|
+
(e = a.hijos) != null && e.length ? (r(), i("span", {
|
|
291
349
|
key: 0,
|
|
292
350
|
class: "has-children",
|
|
293
|
-
onClick: (c) => f(
|
|
294
|
-
},
|
|
351
|
+
onClick: (c) => f(a)
|
|
352
|
+
}, C(a.nombre), 9, ke)) : (r(), i("a", {
|
|
295
353
|
key: 1,
|
|
296
|
-
href:
|
|
297
|
-
},
|
|
298
|
-
(
|
|
299
|
-
(r(!0), i(
|
|
354
|
+
href: a.url || "#"
|
|
355
|
+
}, C(a.nombre), 9, we)),
|
|
356
|
+
(t = a.hijos) != null && t.length && n.value.has(a) ? (r(), i("ul", ye, [
|
|
357
|
+
(r(!0), i(O, null, R(a.hijos, (c) => (r(), i("li", {
|
|
300
358
|
key: c.nombre
|
|
301
359
|
}, [
|
|
302
|
-
|
|
360
|
+
o("a", {
|
|
303
361
|
href: c.url || "#"
|
|
304
|
-
},
|
|
362
|
+
}, C(c.nombre), 9, Ce)
|
|
305
363
|
]))), 128))
|
|
306
364
|
])) : j("", !0)
|
|
307
365
|
], 2);
|
|
@@ -312,44 +370,44 @@ const X = { class: "navbar-custom" }, Y = { class: "container-fluid" }, Z = {
|
|
|
312
370
|
])
|
|
313
371
|
], 2));
|
|
314
372
|
}
|
|
315
|
-
}),
|
|
373
|
+
}), K = /* @__PURE__ */ B($e, [["__scopeId", "data-v-1619503d"]]), Ae = { class: "master-page-layout" }, Ue = { class: "shell-main" }, Ne = /* @__PURE__ */ L({
|
|
316
374
|
__name: "MasterPage",
|
|
317
|
-
setup(
|
|
318
|
-
const
|
|
375
|
+
setup(h) {
|
|
376
|
+
const d = A(!1);
|
|
319
377
|
function n() {
|
|
320
|
-
|
|
378
|
+
d.value = !d.value;
|
|
321
379
|
}
|
|
322
380
|
function f() {
|
|
323
|
-
|
|
381
|
+
d.value = !1;
|
|
324
382
|
}
|
|
325
|
-
function u(
|
|
326
|
-
|
|
383
|
+
function u(g) {
|
|
384
|
+
g.key === "Escape" && f();
|
|
327
385
|
}
|
|
328
|
-
return window.addEventListener("keydown", u), q(() => window.removeEventListener("keydown", u)), (
|
|
386
|
+
return window.addEventListener("keydown", u), q(() => window.removeEventListener("keydown", u)), (g, l) => (r(), i("div", Ae, [
|
|
329
387
|
F(D, { onMenuToggle: n }),
|
|
330
|
-
F(
|
|
331
|
-
|
|
388
|
+
F(K, { "is-open": d.value }, null, 8, ["is-open"]),
|
|
389
|
+
d.value ? (r(), i("div", {
|
|
332
390
|
key: 0,
|
|
333
391
|
class: "sidebar-backdrop",
|
|
334
392
|
onClick: f
|
|
335
393
|
})) : j("", !0),
|
|
336
|
-
|
|
337
|
-
J(
|
|
394
|
+
o("main", Ue, [
|
|
395
|
+
J(g.$slots, "default", {}, void 0, !0)
|
|
338
396
|
]),
|
|
339
|
-
F(
|
|
397
|
+
F(G)
|
|
340
398
|
]));
|
|
341
399
|
}
|
|
342
|
-
}),
|
|
343
|
-
install(
|
|
344
|
-
const { configure: n } =
|
|
345
|
-
n(
|
|
400
|
+
}), Me = /* @__PURE__ */ B(Ne, [["__scopeId", "data-v-ad151b79"]]), xe = {
|
|
401
|
+
install(h, d) {
|
|
402
|
+
const { configure: n } = P();
|
|
403
|
+
n(d), h.component("MasterPage", Me), h.component("AppHeader", D), h.component("AppFooter", G), h.component("AppMenu", K);
|
|
346
404
|
}
|
|
347
405
|
};
|
|
348
406
|
export {
|
|
349
|
-
|
|
407
|
+
G as AppFooter,
|
|
350
408
|
D as AppHeader,
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
409
|
+
K as AppMenu,
|
|
410
|
+
Me as MasterPage,
|
|
411
|
+
xe as default,
|
|
412
|
+
P as useAuth
|
|
355
413
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(m,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("oidc-client-ts")):typeof define=="function"&&define.amd?define(["exports","vue","oidc-client-ts"],e):(m=typeof globalThis<"u"?globalThis:m||self,e(m.MasterPageVue={},m.Vue,m.OidcClientTs))})(this,function(m,e,F){"use strict";const V=e.ref(!1),S=e.ref(null),I=e.ref([]),P=e.ref(!0);let _,p,u=null;function C(){function f(o){_=o;const t={authority:o.oidc.authority,client_id:o.oidc.clientId,client_secret:o.oidc.clientSecret,redirect_uri:o.oidc.redirectUri??`${window.location.origin}?op=2`,response_type:o.oidc.responseType??"code",scope:o.oidc.scope??"openid profile email roles offline_access",post_logout_redirect_uri:o.oidc.postLogoutRedirectUri??`${window.location.origin}?op=1`};p=new F.UserManager(t),s(),y()}function c(){return _}function n(){p.signinRedirect({prompt:"login"})}function d(){const o=localStorage.getItem("access_token")??"",t=encodeURIComponent(_.oidc.postLogoutRedirectUri??`${window.location.origin}?op=1`);window.location.href=`${_.oidc.authority}/connect/logout?id_token_hint=${o}&post_logout_redirect_uri=${t}`}function i(){window.location.href=`${_.oidc.authority}/Identity/Account/Manage?salir=1`}async function g(){const o=await p.getUser();return(o==null?void 0:o.access_token)??null}function s(){const o=new URLSearchParams(window.location.search).get("op");o==="2"&&p.signinRedirectCallback().then(()=>{window.location.href="/"}).catch(t=>console.error("[MasterPage] signin callback error:",t)),o==="1"&&p.signoutRedirectCallback().then(()=>{p.removeUser(),window.location.href="/"}).catch(t=>console.error("[MasterPage] signout callback error:",t))}async function y(){try{const o=await p.getUser();o&&!o.expired?(b(o),_.enableFetchInterceptor!==!1&&a(),await k(o)):(V.value=!1,S.value=null)}catch(o){console.error("[MasterPage] session check error:",o),V.value=!1}finally{P.value=!1}}function b(o){const t=o.profile;S.value={firstName:t.UserFirstName??"",middleName:t.UserMiddleName??"",lastName:t.UserLastName??"",secondLastName:t.UserSecondLastName??"",enterpriseName:t.EnterpriseName??"",displayName:[t.UserFirstName,t.UserMiddleName,t.UserLastName,t.UserSecondLastName].filter(Boolean).join(" ").trim(),email:t.email??"",accessToken:o.access_token,rawClaims:t},localStorage.setItem("access_token",o.access_token),V.value=!0}async function k(o){var t;try{const r=await fetch(`${_.oidc.authority}/connect/userinfo`,{headers:{Authorization:`Bearer ${o.access_token}`}});if(!r.ok)return;const w=await r.json();(t=w==null?void 0:w.usrAuthorizations)!=null&&t.aplicaciones&&(I.value=w.usrAuthorizations.aplicaciones)}catch(r){console.error("[MasterPage] Failed to fetch authorizations:",r)}}function a(){if(u)return;u=window.fetch.bind(window);const o=_.oidc.authority;window.fetch=async(t,r={})=>{if((typeof t=="string"?t:t.url).startsWith(o))return u(t,r);let h=await p.getUser();h&&!h.expired&&(r.headers={...r.headers,Authorization:`Bearer ${h.access_token}`});let l=await u(t,r);if(l.status===401&&h)try{const E=await p.signinSilent();E&&(b(E),r.headers={...r.headers,Authorization:`Bearer ${E.access_token}`},l=await u(t,r))}catch{await p.signoutRedirect()}return l}}function N(){u&&(window.fetch=u,u=null)}return{isAuthenticated:e.readonly(V),userProfile:e.readonly(S),menuItems:e.readonly(I),isLoading:e.readonly(P),configure:f,getConfig:c,login:n,logout:d,openAccountSettings:i,getAccessToken:g,destroyFetchInterceptor:N}}const T={class:"navbar-custom"},O={class:"container-fluid"},R={class:"navbar-brand",href:"#"},D=["src"],z={class:"brand-text"},x={class:"navbar-right"},H={key:0,class:"nav-item"},q={class:"user-label"},G=e.defineComponent({__name:"AppHeader",emits:["menu-toggle"],setup(f,{emit:c}){var w;const n=c,{isAuthenticated:d,userProfile:i,login:g,logout:s,openAccountSettings:y,getConfig:b}=C(),k=e.ref(!1),a=b(),N=(a==null?void 0:a.appTitle)??"SISPRO - Aplicativos Misionales",o=((w=a==null?void 0:a.oidc)==null?void 0:w.authority)??"";function t(h){h.stopPropagation(),k.value=!k.value}function r(){var l;const h=(l=b())==null?void 0:l.registerUrl;h&&(window.location.href=h)}return(h,l)=>{var E,j;return e.openBlock(),e.createElementBlock("nav",T,[e.createElementVNode("div",O,[e.unref(d)?(e.openBlock(),e.createElementBlock("button",{key:0,class:"menu-toggle",onClick:l[0]||(l[0]=B=>n("menu-toggle")),"aria-label":"Toggle menu"}," ☰ ")):e.createCommentVNode("",!0),e.createElementVNode("a",R,[e.createElementVNode("img",{src:`${e.unref(o)}/img/logo.svg`,alt:"Logo gov.co"},null,8,D),e.createElementVNode("span",z,e.toDisplayString(e.unref(N)),1)]),e.createElementVNode("div",x,[e.unref(d)?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("a",{class:"dropdown-user",role:"button",onClick:t},[e.createElementVNode("div",q,[e.createTextVNode(e.toDisplayString((E=e.unref(i))==null?void 0:E.displayName)+" ",1),e.createElementVNode("span",null,e.toDisplayString((j=e.unref(i))==null?void 0:j.enterpriseName),1)]),l[4]||(l[4]=e.createElementVNode("button",{class:"user-icon-btn"},[e.createElementVNode("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.createElementVNode("circle",{cx:"12",cy:"7",r:"4"})])],-1))]),e.createElementVNode("ul",{class:e.normalizeClass(["dropdown-menu",{open:k.value}])},[e.createElementVNode("li",null,[e.createElementVNode("a",{onClick:l[1]||(l[1]=(...B)=>e.unref(y)&&e.unref(y)(...B))},"Configuración")]),e.createElementVNode("li",null,[e.createElementVNode("a",{onClick:l[2]||(l[2]=(...B)=>e.unref(s)&&e.unref(s)(...B))},"Cerrar sesión")])],2)])):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("button",{class:"btn-login",onClick:l[3]||(l[3]=(...B)=>e.unref(g)&&e.unref(g)(...B))},"Ingresar"),e.createElementVNode("button",{class:"btn-register",onClick:r},"Registrarse")],64))])])])}}}),$=(f,c)=>{const n=f.__vccOpts||f;for(const[d,i]of c)n[d]=i;return n},A=$(G,[["__scopeId","data-v-69067b97"]]),K={class:"shell-footer"},W={class:"container"},J={class:"row"},Q={class:"col logos-col"},X=["src"],Y=["src"],M=$(e.defineComponent({__name:"AppFooter",setup(f){var d,i;const{getConfig:c}=C(),n=((i=(d=c())==null?void 0:d.oidc)==null?void 0:i.authority)??"";return(g,s)=>(e.openBlock(),e.createElementBlock("footer",K,[e.createElementVNode("div",W,[e.createElementVNode("div",J,[e.createElementVNode("div",Q,[e.createElementVNode("img",{src:`${e.unref(n)}/img/logo.svg`,alt:"GOV.CO",class:"footer-logo"},null,8,X),e.createElementVNode("img",{src:`${e.unref(n)}/img/colombia.png`,alt:"Colombia Potencia de la Vida",class:"footer-logo"},null,8,Y)]),s[0]||(s[0]=e.createStaticVNode('<div class="col border-start" data-v-93fe5bbf><strong data-v-93fe5bbf>SISPRO</strong><p data-v-93fe5bbf> Dirección:<br data-v-93fe5bbf> Carrera 13 # 32–76 (piso 1)<br data-v-93fe5bbf> Cundinamarca, Bogotá D.C.<br data-v-93fe5bbf> Código Postal: 110311 </p><p data-v-93fe5bbf><a href="#" class="footer-link" data-v-93fe5bbf>Horario de atención:</a><br data-v-93fe5bbf> Lunes a viernes 8:00 a.m. a 4:00 p.m. </p></div><div class="col border-start" data-v-93fe5bbf><strong data-v-93fe5bbf>Contacto</strong><p data-v-93fe5bbf> Teléfono conmutador:<br data-v-93fe5bbf> En Bogotá: 601 330 5043 Opción 2<br data-v-93fe5bbf> Resto del país: 018000960020 Opción 2 </p><p data-v-93fe5bbf> Correo de notificaciones judiciales:<br data-v-93fe5bbf><a href="mailto:notificacionesjudiciales@minsalud.gov.co" class="footer-link" data-v-93fe5bbf> notificacionesjudiciales@minsalud.gov.co </a></p><p data-v-93fe5bbf><a href="https://www.minsalud.gov.co/Documents/Ministerio/Terminos%20y%20Condiciones%20de%20uso%20del%20portal%20web_Octubre%202012x.pdf" target="_blank" class="footer-link" data-v-93fe5bbf> Términos y condiciones </a></p></div>',2))])])]))}}),[["__scopeId","data-v-93fe5bbf"]]),Z={class:"menu-list"},v=["onClick"],ee=["href"],oe={key:2,class:"submenu"},te=["onClick"],ne=["href"],ae={key:2,class:"submenu"},se=["href"],U=$(e.defineComponent({__name:"AppMenu",props:{isOpen:{type:Boolean}},setup(f){const{menuItems:c}=C(),n=e.ref(new Set);function d(i){n.value.has(i)?n.value.delete(i):n.value.add(i),n.value=new Set(n.value)}return(i,g)=>(e.openBlock(),e.createElementBlock("aside",{class:e.normalizeClass(["sidebar-menu",{show:f.isOpen}])},[e.createElementVNode("ul",Z,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(c),s=>{var y,b,k;return e.openBlock(),e.createElementBlock("li",{key:s.nombre,class:e.normalizeClass({"has-submenu":(y=s.hijos)==null?void 0:y.length,open:n.value.has(s)})},[(b=s.hijos)!=null&&b.length?(e.openBlock(),e.createElementBlock("span",{key:0,class:"has-children",onClick:a=>d(s)},e.toDisplayString(s.nombre),9,v)):(e.openBlock(),e.createElementBlock("a",{key:1,href:s.url||"#"},e.toDisplayString(s.nombre),9,ee)),(k=s.hijos)!=null&&k.length&&n.value.has(s)?(e.openBlock(),e.createElementBlock("ul",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.hijos,a=>{var N,o,t;return e.openBlock(),e.createElementBlock("li",{key:a.nombre,class:e.normalizeClass({"has-submenu":(N=a.hijos)==null?void 0:N.length,open:n.value.has(a)})},[(o=a.hijos)!=null&&o.length?(e.openBlock(),e.createElementBlock("span",{key:0,class:"has-children",onClick:r=>d(a)},e.toDisplayString(a.nombre),9,te)):(e.openBlock(),e.createElementBlock("a",{key:1,href:a.url||"#"},e.toDisplayString(a.nombre),9,ne)),(t=a.hijos)!=null&&t.length&&n.value.has(a)?(e.openBlock(),e.createElementBlock("ul",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.hijos,r=>(e.openBlock(),e.createElementBlock("li",{key:r.nombre},[e.createElementVNode("a",{href:r.url||"#"},e.toDisplayString(r.nombre),9,se)]))),128))])):e.createCommentVNode("",!0)],2)}),128))])):e.createCommentVNode("",!0)],2)}),128))])],2))}}),[["__scopeId","data-v-1619503d"]]),re={class:"master-page-layout"},ce={class:"shell-main"},L=$(e.defineComponent({__name:"MasterPage",setup(f){const c=e.ref(!1);function n(){c.value=!c.value}function d(){c.value=!1}function i(g){g.key==="Escape"&&d()}return window.addEventListener("keydown",i),e.onUnmounted(()=>window.removeEventListener("keydown",i)),(g,s)=>(e.openBlock(),e.createElementBlock("div",re,[e.createVNode(A,{onMenuToggle:n}),e.createVNode(U,{"is-open":c.value},null,8,["is-open"]),c.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sidebar-backdrop",onClick:d})):e.createCommentVNode("",!0),e.createElementVNode("main",ce,[e.renderSlot(g.$slots,"default",{},void 0,!0)]),e.createVNode(M)]))}}),[["__scopeId","data-v-ad151b79"]]),ie={install(f,c){const{configure:n}=C();n(c),f.component("MasterPage",L),f.component("AppHeader",A),f.component("AppFooter",M),f.component("AppMenu",U)}};m.AppFooter=M,m.AppHeader=A,m.AppMenu=U,m.MasterPage=L,m.default=ie,m.useAuth=C,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(m,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("oidc-client-ts")):typeof define=="function"&&define.amd?define(["exports","vue","oidc-client-ts"],e):(m=typeof globalThis<"u"?globalThis:m||self,e(m.MasterPageVue={},m.Vue,m.OidcClientTs))})(this,function(m,e,x){"use strict";const C=e.ref(!1),A=e.ref(null),I=e.ref([]),j=e.ref(!0);let u,p,_=null;function V(){function f(o){u=o;const t={authority:o.oidc.authority,client_id:o.oidc.clientId,client_secret:o.oidc.clientSecret,redirect_uri:o.oidc.redirectUri??`${window.location.origin}?op=2`,response_type:o.oidc.responseType??"code",scope:o.oidc.scope??"openid profile email roles offline_access",post_logout_redirect_uri:o.oidc.postLogoutRedirectUri??`${window.location.origin}?op=1`};p=new x.UserManager(t),r(),y()}function i(){return u}function a(){p.signinRedirect({prompt:"login"})}function d(){const o=localStorage.getItem("access_token")??"",t=encodeURIComponent(u.oidc.postLogoutRedirectUri??`${window.location.origin}?op=1`);window.location.href=`${u.oidc.authority}/connect/logout?id_token_hint=${o}&post_logout_redirect_uri=${t}`}function c(){window.location.href=`${u.oidc.authority}/Identity/Account/Manage?salir=1`}async function g(){const o=await p.getUser();return(o==null?void 0:o.access_token)??null}function r(){const o=new URLSearchParams(window.location.search).get("op");o==="2"&&p.signinRedirectCallback().then(()=>{window.location.href="/"}).catch(t=>console.error("[MasterPage] signin callback error:",t)),o==="1"&&p.signoutRedirectCallback().then(()=>{p.removeUser(),window.location.href="/"}).catch(t=>console.error("[MasterPage] signout callback error:",t))}async function y(){try{const o=await p.getUser();o&&!o.expired?(b(o),u.enableFetchInterceptor!==!1&&s(),await k(o)):(C.value=!1,A.value=null)}catch(o){console.error("[MasterPage] session check error:",o),C.value=!1}finally{j.value=!1}}function b(o){const t=o.profile;A.value={firstName:t.UserFirstName??"",middleName:t.UserMiddleName??"",lastName:t.UserLastName??"",secondLastName:t.UserSecondLastName??"",enterpriseName:t.EnterpriseName??"",displayName:[t.UserFirstName,t.UserMiddleName,t.UserLastName,t.UserSecondLastName].filter(Boolean).join(" ").trim(),email:t.email??"",accessToken:o.access_token,rawClaims:t},localStorage.setItem("access_token",o.access_token),C.value=!0}async function k(o){var t;try{const l=await fetch(`${u.oidc.authority}/connect/userinfo`,{headers:{Authorization:`Bearer ${o.access_token}`}});if(!l.ok)return;const w=await l.json();(t=w==null?void 0:w.usrAuthorizations)!=null&&t.aplicaciones&&(I.value=w.usrAuthorizations.aplicaciones)}catch(l){console.error("[MasterPage] Failed to fetch authorizations:",l)}}function s(){if(_)return;_=window.fetch.bind(window);const o=u.oidc.authority;window.fetch=async(t,l={})=>{if((typeof t=="string"?t:t.url).startsWith(o))return _(t,l);let h=await p.getUser();h&&!h.expired&&(l.headers={...l.headers,Authorization:`Bearer ${h.access_token}`});let n=await _(t,l);if(n.status===401&&h)try{const E=await p.signinSilent();E&&(b(E),l.headers={...l.headers,Authorization:`Bearer ${E.access_token}`},n=await _(t,l))}catch{await p.signoutRedirect()}return n}}function N(){_&&(window.fetch=_,_=null)}return{isAuthenticated:e.readonly(C),userProfile:e.readonly(A),menuItems:e.readonly(I),isLoading:e.readonly(j),configure:f,getConfig:i,login:a,logout:d,openAccountSettings:c,getAccessToken:g,destroyFetchInterceptor:N}}const T={class:"navbar-custom"},O={class:"container-fluid"},F={class:"navbar-brand",href:"#"},z=["src"],R={class:"brand-text"},D={class:"navbar-right"},H={key:0,class:"nav-item"},q={class:"user-label"},G={class:"user-name"},K={class:"user-enterprise"},W={key:1,class:"auth-buttons"},J=e.defineComponent({__name:"AppHeader",emits:["menu-toggle"],setup(f,{emit:i}){var w;const a=i,{isAuthenticated:d,userProfile:c,login:g,logout:r,openAccountSettings:y,getConfig:b}=V(),k=e.ref(!1),s=b(),N=(s==null?void 0:s.appTitle)??"SISPRO - Aplicativos Misionales",o=((w=s==null?void 0:s.oidc)==null?void 0:w.authority)??"";function t(h){h.stopPropagation(),k.value=!k.value}function l(){var n;const h=(n=b())==null?void 0:n.registerUrl;h&&(window.location.href=h)}return(h,n)=>{var E,L;return e.openBlock(),e.createElementBlock("nav",T,[e.createElementVNode("div",O,[e.unref(d)?(e.openBlock(),e.createElementBlock("button",{key:0,class:"menu-toggle",onClick:n[0]||(n[0]=B=>a("menu-toggle")),"aria-label":"Toggle menu"}," ☰ ")):e.createCommentVNode("",!0),e.createElementVNode("a",F,[e.createElementVNode("img",{src:`${e.unref(o)}/img/logo.svg`,alt:"Logo gov.co"},null,8,z),e.createElementVNode("span",R,e.toDisplayString(e.unref(N)),1)]),e.createElementVNode("div",D,[e.unref(d)?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("button",{class:"user-dropdown-btn",onClick:t,"aria-label":"Opciones de usuario"},[e.createElementVNode("div",q,[e.createElementVNode("span",G,e.toDisplayString((E=e.unref(c))==null?void 0:E.displayName),1),e.createElementVNode("span",K,e.toDisplayString((L=e.unref(c))==null?void 0:L.enterpriseName),1)]),n[5]||(n[5]=e.createElementVNode("div",{class:"user-avatar"},[e.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"}),e.createElementVNode("circle",{cx:"12",cy:"7",r:"4"})])],-1)),(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["chevron",{rotated:k.value}]),width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[...n[4]||(n[4]=[e.createElementVNode("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2))]),e.createElementVNode("ul",{class:e.normalizeClass(["dropdown-menu",{open:k.value}])},[e.createElementVNode("li",null,[e.createElementVNode("a",{onClick:n[1]||(n[1]=(...B)=>e.unref(y)&&e.unref(y)(...B))},[...n[6]||(n[6]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("circle",{cx:"12",cy:"12",r:"3"}),e.createElementVNode("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})],-1),e.createTextVNode(" Configuración ",-1)])])]),n[8]||(n[8]=e.createElementVNode("li",{class:"divider"},null,-1)),e.createElementVNode("li",null,[e.createElementVNode("a",{class:"logout-item",onClick:n[2]||(n[2]=(...B)=>e.unref(r)&&e.unref(r)(...B))},[...n[7]||(n[7]=[e.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e.createElementVNode("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),e.createElementVNode("polyline",{points:"16 17 21 12 16 7"}),e.createElementVNode("line",{x1:"21",y1:"12",x2:"9",y2:"12"})],-1),e.createTextVNode(" Cerrar sesión ",-1)])])])],2)])):(e.openBlock(),e.createElementBlock("div",W,[e.createElementVNode("button",{class:"btn-login",onClick:n[3]||(n[3]=(...B)=>e.unref(g)&&e.unref(g)(...B))},"Ingresar"),e.createElementVNode("button",{class:"btn-register",onClick:l},"Registrarse")]))])])])}}}),$=(f,i)=>{const a=f.__vccOpts||f;for(const[d,c]of i)a[d]=c;return a},S=$(J,[["__scopeId","data-v-99bde91d"]]),Q={class:"shell-footer"},X={class:"container"},Y={class:"row"},Z={class:"col logos-col"},v=["src"],ee=["src"],M=$(e.defineComponent({__name:"AppFooter",setup(f){var d,c;const{getConfig:i}=V(),a=((c=(d=i())==null?void 0:d.oidc)==null?void 0:c.authority)??"";return(g,r)=>(e.openBlock(),e.createElementBlock("footer",Q,[e.createElementVNode("div",X,[e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createElementVNode("img",{src:`${e.unref(a)}/img/logo.svg`,alt:"GOV.CO",class:"footer-logo"},null,8,v),e.createElementVNode("img",{src:`${e.unref(a)}/img/colombia.png`,alt:"Colombia Potencia de la Vida",class:"footer-logo"},null,8,ee)]),r[0]||(r[0]=e.createStaticVNode('<div class="col border-start" data-v-93fe5bbf><strong data-v-93fe5bbf>SISPRO</strong><p data-v-93fe5bbf> Dirección:<br data-v-93fe5bbf> Carrera 13 # 32–76 (piso 1)<br data-v-93fe5bbf> Cundinamarca, Bogotá D.C.<br data-v-93fe5bbf> Código Postal: 110311 </p><p data-v-93fe5bbf><a href="#" class="footer-link" data-v-93fe5bbf>Horario de atención:</a><br data-v-93fe5bbf> Lunes a viernes 8:00 a.m. a 4:00 p.m. </p></div><div class="col border-start" data-v-93fe5bbf><strong data-v-93fe5bbf>Contacto</strong><p data-v-93fe5bbf> Teléfono conmutador:<br data-v-93fe5bbf> En Bogotá: 601 330 5043 Opción 2<br data-v-93fe5bbf> Resto del país: 018000960020 Opción 2 </p><p data-v-93fe5bbf> Correo de notificaciones judiciales:<br data-v-93fe5bbf><a href="mailto:notificacionesjudiciales@minsalud.gov.co" class="footer-link" data-v-93fe5bbf> notificacionesjudiciales@minsalud.gov.co </a></p><p data-v-93fe5bbf><a href="https://www.minsalud.gov.co/Documents/Ministerio/Terminos%20y%20Condiciones%20de%20uso%20del%20portal%20web_Octubre%202012x.pdf" target="_blank" class="footer-link" data-v-93fe5bbf> Términos y condiciones </a></p></div>',2))])])]))}}),[["__scopeId","data-v-93fe5bbf"]]),oe={class:"menu-list"},te=["onClick"],ne=["href"],ae={key:2,class:"submenu"},se=["onClick"],re=["href"],le={key:2,class:"submenu"},ie=["href"],U=$(e.defineComponent({__name:"AppMenu",props:{isOpen:{type:Boolean}},setup(f){const{menuItems:i}=V(),a=e.ref(new Set);function d(c){a.value.has(c)?a.value.delete(c):a.value.add(c),a.value=new Set(a.value)}return(c,g)=>(e.openBlock(),e.createElementBlock("aside",{class:e.normalizeClass(["sidebar-menu",{show:f.isOpen}])},[e.createElementVNode("ul",oe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(i),r=>{var y,b,k;return e.openBlock(),e.createElementBlock("li",{key:r.nombre,class:e.normalizeClass({"has-submenu":(y=r.hijos)==null?void 0:y.length,open:a.value.has(r)})},[(b=r.hijos)!=null&&b.length?(e.openBlock(),e.createElementBlock("span",{key:0,class:"has-children",onClick:s=>d(r)},e.toDisplayString(r.nombre),9,te)):(e.openBlock(),e.createElementBlock("a",{key:1,href:r.url||"#"},e.toDisplayString(r.nombre),9,ne)),(k=r.hijos)!=null&&k.length&&a.value.has(r)?(e.openBlock(),e.createElementBlock("ul",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.hijos,s=>{var N,o,t;return e.openBlock(),e.createElementBlock("li",{key:s.nombre,class:e.normalizeClass({"has-submenu":(N=s.hijos)==null?void 0:N.length,open:a.value.has(s)})},[(o=s.hijos)!=null&&o.length?(e.openBlock(),e.createElementBlock("span",{key:0,class:"has-children",onClick:l=>d(s)},e.toDisplayString(s.nombre),9,se)):(e.openBlock(),e.createElementBlock("a",{key:1,href:s.url||"#"},e.toDisplayString(s.nombre),9,re)),(t=s.hijos)!=null&&t.length&&a.value.has(s)?(e.openBlock(),e.createElementBlock("ul",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.hijos,l=>(e.openBlock(),e.createElementBlock("li",{key:l.nombre},[e.createElementVNode("a",{href:l.url||"#"},e.toDisplayString(l.nombre),9,ie)]))),128))])):e.createCommentVNode("",!0)],2)}),128))])):e.createCommentVNode("",!0)],2)}),128))])],2))}}),[["__scopeId","data-v-1619503d"]]),ce={class:"master-page-layout"},de={class:"shell-main"},P=$(e.defineComponent({__name:"MasterPage",setup(f){const i=e.ref(!1);function a(){i.value=!i.value}function d(){i.value=!1}function c(g){g.key==="Escape"&&d()}return window.addEventListener("keydown",c),e.onUnmounted(()=>window.removeEventListener("keydown",c)),(g,r)=>(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(S,{onMenuToggle:a}),e.createVNode(U,{"is-open":i.value},null,8,["is-open"]),i.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"sidebar-backdrop",onClick:d})):e.createCommentVNode("",!0),e.createElementVNode("main",de,[e.renderSlot(g.$slots,"default",{},void 0,!0)]),e.createVNode(M)]))}}),[["__scopeId","data-v-ad151b79"]]),fe={install(f,i){const{configure:a}=V();a(i),f.component("MasterPage",P),f.component("AppHeader",S),f.component("AppFooter",M),f.component("AppMenu",U)}};m.AppFooter=M,m.AppHeader=S,m.AppMenu=U,m.MasterPage=P,m.default=fe,m.useAuth=V,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.navbar-custom[data-v-
|
|
1
|
+
.navbar-custom[data-v-99bde91d]{background-color:#36c;box-shadow:0 4px 10px #0003;position:fixed;width:100%;z-index:1001;height:60px}.container-fluid[data-v-99bde91d]{display:flex;align-items:center;width:100%;padding:0 15px}.navbar-brand[data-v-99bde91d]{color:#fff;display:flex;align-items:center;gap:10px;text-decoration:none}.navbar-brand img[data-v-99bde91d]{height:36px;margin-top:1px}.brand-text[data-v-99bde91d]{padding-top:5px}.navbar-right[data-v-99bde91d]{display:flex;align-items:center;margin-left:auto;flex-shrink:0}.nav-item[data-v-99bde91d]{position:relative}.user-dropdown-btn[data-v-99bde91d]{display:flex;align-items:center;gap:8px;background:#ffffff1f;border:1px solid rgba(255,255,255,.3);color:#fff;cursor:pointer;padding:6px 12px;border-radius:8px;transition:background .2s;max-width:260px;overflow:hidden}.user-dropdown-btn[data-v-99bde91d]:hover{background:#fff3}.user-label[data-v-99bde91d]{text-align:left;line-height:1.2;overflow:hidden}.user-name[data-v-99bde91d]{display:block;font-weight:600;font-size:.875rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-enterprise[data-v-99bde91d]{display:block;font-size:.75rem;color:#c8d8f8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.user-avatar[data-v-99bde91d]{display:flex;align-items:center;justify-content:center;width:32px;height:32px;border-radius:50%;background:#ffffff40;flex-shrink:0}.chevron[data-v-99bde91d]{flex-shrink:0;transition:transform .2s}.chevron.rotated[data-v-99bde91d]{transform:rotate(180deg)}.dropdown-menu[data-v-99bde91d]{display:none;position:absolute;right:0;top:calc(100% + 8px);min-width:210px;background:#fff;border:1px solid #e0e0e0;box-shadow:0 4px 16px #0000001f;border-radius:10px;list-style:none;margin:0;padding:6px 0;z-index:1002}.dropdown-menu.open[data-v-99bde91d]{display:block}.dropdown-menu li a[data-v-99bde91d]{display:flex;align-items:center;gap:10px;padding:10px 16px;color:#333;cursor:pointer;text-decoration:none;font-size:.9rem;transition:background .15s}.dropdown-menu li a[data-v-99bde91d]:hover{background:#f0f4ff}.dropdown-menu .divider[data-v-99bde91d]{height:1px;background:#eee;margin:4px 0}.dropdown-menu .logout-item[data-v-99bde91d]{color:#c0392b}.dropdown-menu .logout-item[data-v-99bde91d]:hover{background:#fff5f5}.auth-buttons[data-v-99bde91d]{display:flex;align-items:center;gap:8px;flex-shrink:0}.btn-login[data-v-99bde91d],.btn-register[data-v-99bde91d]{border-radius:20px;font-weight:500;border:1px solid white;padding:6px 16px;cursor:pointer;white-space:nowrap;font-size:.875rem}.btn-login[data-v-99bde91d]{color:#fff;background:transparent}.btn-login[data-v-99bde91d]:hover{background:#ffffff26}.btn-register[data-v-99bde91d]{color:#36c;background:#fff}.btn-register[data-v-99bde91d]:hover{background:#e8eeff}.menu-toggle[data-v-99bde91d]{font-size:30px;border:none;background:transparent;color:#fff;cursor:pointer;margin-right:15px;padding:0;line-height:1;flex-shrink:0}@media (max-width: 860px){.navbar-brand[data-v-99bde91d]{display:none}}@media (max-width: 520px){.user-label[data-v-99bde91d],.chevron[data-v-99bde91d]{display:none}.user-dropdown-btn[data-v-99bde91d]{padding:6px;border-radius:50%}.btn-login[data-v-99bde91d],.btn-register[data-v-99bde91d]{padding:6px 10px;font-size:.8rem}}.shell-footer[data-v-93fe5bbf]{background-color:#36c;color:#fff;padding:1.5rem 0;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;font-size:1em;width:100%}.container[data-v-93fe5bbf]{max-width:1200px;margin:0 auto;padding:0 15px}.row[data-v-93fe5bbf]{display:flex;flex-wrap:wrap;align-items:flex-start}.col[data-v-93fe5bbf]{flex:1;padding:0 15px}.logos-col[data-v-93fe5bbf]{display:flex;align-items:center;justify-content:center;gap:16px}.footer-logo[data-v-93fe5bbf]{max-height:50px}.border-start[data-v-93fe5bbf]{border-left:1px solid rgba(255,255,255,.3)}.footer-link[data-v-93fe5bbf]{color:#fff;text-decoration:underline}strong[data-v-93fe5bbf]{display:block;margin-bottom:.5rem}p[data-v-93fe5bbf]{margin:.25rem 0;line-height:1.5}@media (max-width: 768px){.col[data-v-93fe5bbf]{flex:0 0 100%;margin-bottom:1rem}.border-start[data-v-93fe5bbf]{border-left:none}}.sidebar-menu[data-v-1619503d]{position:fixed;top:0;left:0;height:100vh;width:300px;background-color:#36c;padding-top:60px;transform:translate(-100%);transition:transform .3s ease;z-index:1000;overflow-y:auto}.sidebar-menu.show[data-v-1619503d]{transform:translate(0)}.menu-list[data-v-1619503d],.submenu[data-v-1619503d]{list-style:none;padding:0;margin:0}.submenu[data-v-1619503d]{padding-left:10px}li a[data-v-1619503d],li span[data-v-1619503d]{display:block;padding:10px;color:#fff;text-decoration:none;font-weight:500;cursor:pointer}li a[data-v-1619503d]:hover,li span[data-v-1619503d]:hover{background-color:#2952a3}.has-submenu>span.has-children[data-v-1619503d]:after{content:" ▼";font-size:.8em;float:right}.has-submenu.open>span.has-children[data-v-1619503d]:after{content:" ▲"}.master-page-layout[data-v-ad151b79]{display:flex;flex-direction:column;min-height:100vh;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}.shell-main[data-v-ad151b79]{flex:1;padding-top:65px;min-height:calc(100vh - 260px)}.sidebar-backdrop[data-v-ad151b79]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000059;z-index:999;cursor:pointer;transition:opacity .3s ease}
|