thecore-auth 0.0.89 → 0.0.92
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/thecore-auth.cjs.js +18 -17
- package/dist/thecore-auth.css +1 -1
- package/dist/thecore-auth.esm.js +132 -131
- package/package.json +1 -1
package/dist/thecore-auth.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as t from "react";
|
|
2
|
-
import H, { createContext as ie, useState as
|
|
2
|
+
import H, { createContext as ie, useState as w, useContext as se, useEffect as A } from "react";
|
|
3
3
|
import at from "jwt-decode";
|
|
4
4
|
import { useNavigate as ke, useLocation as Le, matchPath as $e, Outlet as je, Navigate as Je, Routes as lt, Route as Q, useMatch as ct } from "react-router-dom";
|
|
5
5
|
import { BrowserRouter as i0, Link as s0, NavLink as a0, Outlet as l0, Route as c0, Routes as f0, useLocation as u0, useMatch as d0, useNavigate as m0 } from "react-router-dom";
|
|
@@ -64,7 +64,7 @@ function dt() {
|
|
|
64
64
|
return "Profiler";
|
|
65
65
|
case te:
|
|
66
66
|
return "StrictMode";
|
|
67
|
-
case
|
|
67
|
+
case M:
|
|
68
68
|
return "Suspense";
|
|
69
69
|
case F:
|
|
70
70
|
return "SuspenseList";
|
|
@@ -115,7 +115,7 @@ function dt() {
|
|
|
115
115
|
}
|
|
116
116
|
function a() {
|
|
117
117
|
if (Y === 0) {
|
|
118
|
-
Pe = console.log, Re = console.info, Ne = console.warn, Ge = console.error, Te = console.group, _e = console.groupCollapsed,
|
|
118
|
+
Pe = console.log, Re = console.info, Ne = console.warn, Ge = console.error, Te = console.group, _e = console.groupCollapsed, ze = console.groupEnd;
|
|
119
119
|
var e = {
|
|
120
120
|
configurable: !0,
|
|
121
121
|
enumerable: !0,
|
|
@@ -138,13 +138,13 @@ function dt() {
|
|
|
138
138
|
if (Y--, Y === 0) {
|
|
139
139
|
var e = { configurable: !0, enumerable: !0, writable: !0 };
|
|
140
140
|
Object.defineProperties(console, {
|
|
141
|
-
log:
|
|
142
|
-
info:
|
|
143
|
-
warn:
|
|
144
|
-
error:
|
|
145
|
-
group:
|
|
146
|
-
groupCollapsed:
|
|
147
|
-
groupEnd:
|
|
141
|
+
log: I({}, e, { value: Pe }),
|
|
142
|
+
info: I({}, e, { value: Re }),
|
|
143
|
+
warn: I({}, e, { value: Ne }),
|
|
144
|
+
error: I({}, e, { value: Ge }),
|
|
145
|
+
group: I({}, e, { value: Te }),
|
|
146
|
+
groupCollapsed: I({}, e, { value: _e }),
|
|
147
|
+
groupEnd: I({}, e, { value: ze })
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
0 > Y && console.error(
|
|
@@ -157,11 +157,11 @@ function dt() {
|
|
|
157
157
|
throw Error();
|
|
158
158
|
} catch (f) {
|
|
159
159
|
var c = f.stack.trim().match(/\n( *(at )?)/);
|
|
160
|
-
Ee = c && c[1] || "",
|
|
160
|
+
Ee = c && c[1] || "", Ie = -1 < f.stack.indexOf(`
|
|
161
161
|
at`) ? " (<anonymous>)" : -1 < f.stack.indexOf("@") ? "@unknown:0:0" : "";
|
|
162
162
|
}
|
|
163
163
|
return `
|
|
164
|
-
` + Ee + e +
|
|
164
|
+
` + Ee + e + Ie;
|
|
165
165
|
}
|
|
166
166
|
function m(e, c) {
|
|
167
167
|
if (!e || Ce) return "";
|
|
@@ -214,11 +214,11 @@ function dt() {
|
|
|
214
214
|
}
|
|
215
215
|
};
|
|
216
216
|
G.DetermineComponentFrameRoot.displayName = "DetermineComponentFrameRoot";
|
|
217
|
-
var
|
|
217
|
+
var P = Object.getOwnPropertyDescriptor(
|
|
218
218
|
G.DetermineComponentFrameRoot,
|
|
219
219
|
"name"
|
|
220
220
|
);
|
|
221
|
-
|
|
221
|
+
P && P.configurable && Object.defineProperty(
|
|
222
222
|
G.DetermineComponentFrameRoot,
|
|
223
223
|
"name",
|
|
224
224
|
{ value: "DetermineComponentFrameRoot" }
|
|
@@ -228,30 +228,30 @@ function dt() {
|
|
|
228
228
|
var _ = D.split(`
|
|
229
229
|
`), K = oe.split(`
|
|
230
230
|
`);
|
|
231
|
-
for (h =
|
|
231
|
+
for (h = P = 0; P < _.length && !_[P].includes(
|
|
232
232
|
"DetermineComponentFrameRoot"
|
|
233
233
|
); )
|
|
234
|
-
|
|
234
|
+
P++;
|
|
235
235
|
for (; h < K.length && !K[h].includes(
|
|
236
236
|
"DetermineComponentFrameRoot"
|
|
237
237
|
); )
|
|
238
238
|
h++;
|
|
239
|
-
if (
|
|
240
|
-
for (
|
|
239
|
+
if (P === _.length || h === K.length)
|
|
240
|
+
for (P = _.length - 1, h = K.length - 1; 1 <= P && 0 <= h && _[P] !== K[h]; )
|
|
241
241
|
h--;
|
|
242
|
-
for (; 1 <=
|
|
243
|
-
if (_[
|
|
244
|
-
if (
|
|
242
|
+
for (; 1 <= P && 0 <= h; P--, h--)
|
|
243
|
+
if (_[P] !== K[h]) {
|
|
244
|
+
if (P !== 1 || h !== 1)
|
|
245
245
|
do
|
|
246
|
-
if (
|
|
246
|
+
if (P--, h--, 0 > h || _[P] !== K[h]) {
|
|
247
247
|
var fe = `
|
|
248
|
-
` + _[
|
|
248
|
+
` + _[P].replace(
|
|
249
249
|
" at new ",
|
|
250
250
|
" at "
|
|
251
251
|
);
|
|
252
252
|
return e.displayName && fe.includes("<anonymous>") && (fe = fe.replace("<anonymous>", e.displayName)), typeof e == "function" && we.set(e, fe), fe;
|
|
253
253
|
}
|
|
254
|
-
while (1 <=
|
|
254
|
+
while (1 <= P && 0 <= h);
|
|
255
255
|
break;
|
|
256
256
|
}
|
|
257
257
|
}
|
|
@@ -271,7 +271,7 @@ function dt() {
|
|
|
271
271
|
}
|
|
272
272
|
if (typeof e == "string") return u(e);
|
|
273
273
|
switch (e) {
|
|
274
|
-
case
|
|
274
|
+
case M:
|
|
275
275
|
return u("Suspense");
|
|
276
276
|
case F:
|
|
277
277
|
return u("SuspenseList");
|
|
@@ -296,15 +296,15 @@ function dt() {
|
|
|
296
296
|
return e === null ? null : e.getOwner();
|
|
297
297
|
}
|
|
298
298
|
function v(e) {
|
|
299
|
-
if (
|
|
299
|
+
if (z.call(e, "key")) {
|
|
300
300
|
var c = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
301
301
|
if (c && c.isReactWarning) return !1;
|
|
302
302
|
}
|
|
303
303
|
return e.key !== void 0;
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function L(e, c) {
|
|
306
306
|
function f() {
|
|
307
|
-
|
|
307
|
+
Ae || (Ae = !0, console.error(
|
|
308
308
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
309
309
|
c
|
|
310
310
|
));
|
|
@@ -314,22 +314,22 @@ function dt() {
|
|
|
314
314
|
configurable: !0
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function C() {
|
|
318
318
|
var e = r(this.type);
|
|
319
|
-
return
|
|
319
|
+
return Me[e] || (Me[e] = !0, console.error(
|
|
320
320
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
321
321
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
322
322
|
}
|
|
323
|
-
function d(e, c, f, b, G,
|
|
324
|
-
return f =
|
|
323
|
+
function d(e, c, f, b, G, P) {
|
|
324
|
+
return f = P.ref, e = {
|
|
325
325
|
$$typeof: E,
|
|
326
326
|
type: e,
|
|
327
327
|
key: c,
|
|
328
|
-
props:
|
|
328
|
+
props: P,
|
|
329
329
|
_owner: G
|
|
330
330
|
}, (f !== void 0 ? f : null) !== null ? Object.defineProperty(e, "ref", {
|
|
331
331
|
enumerable: !1,
|
|
332
|
-
get:
|
|
332
|
+
get: C
|
|
333
333
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
334
334
|
configurable: !1,
|
|
335
335
|
enumerable: !1,
|
|
@@ -342,8 +342,8 @@ function dt() {
|
|
|
342
342
|
value: null
|
|
343
343
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
344
344
|
}
|
|
345
|
-
function x(e, c, f, b, G,
|
|
346
|
-
if (typeof e == "string" || typeof e == "function" || e === B || e === q || e === te || e ===
|
|
345
|
+
function x(e, c, f, b, G, P) {
|
|
346
|
+
if (typeof e == "string" || typeof e == "function" || e === B || e === q || e === te || e === M || e === F || e === be || typeof e == "object" && e !== null && (e.$$typeof === V || e.$$typeof === $ || e.$$typeof === le || e.$$typeof === re || e.$$typeof === J || e.$$typeof === T || e.getModuleId !== void 0)) {
|
|
347
347
|
var h = c.children;
|
|
348
348
|
if (h !== void 0)
|
|
349
349
|
if (b)
|
|
@@ -362,7 +362,7 @@ function dt() {
|
|
|
362
362
|
b,
|
|
363
363
|
h
|
|
364
364
|
);
|
|
365
|
-
if (
|
|
365
|
+
if (z.call(c, "key")) {
|
|
366
366
|
h = r(e);
|
|
367
367
|
var D = Object.keys(c).filter(function(_) {
|
|
368
368
|
return _ !== "key";
|
|
@@ -385,10 +385,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
385
385
|
for (var oe in c)
|
|
386
386
|
oe !== "key" && (f[oe] = c[oe]);
|
|
387
387
|
} else f = c;
|
|
388
|
-
return h &&
|
|
388
|
+
return h && L(
|
|
389
389
|
f,
|
|
390
390
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
391
|
-
), d(e, h,
|
|
391
|
+
), d(e, h, P, G, y(), f);
|
|
392
392
|
}
|
|
393
393
|
function g(e, c) {
|
|
394
394
|
if (typeof e == "object" && e && e.$$typeof !== st) {
|
|
@@ -431,9 +431,9 @@ Check the render method of \`` + f + "`."), c || (e = r(e)) && (c = `
|
|
|
431
431
|
|
|
432
432
|
Check the top-level render call using <` + e + ">."), c;
|
|
433
433
|
}
|
|
434
|
-
var R = H, E = Symbol.for("react.transitional.element"), N = Symbol.for("react.portal"), B = Symbol.for("react.fragment"), te = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), re = Symbol.for("react.consumer"), le = Symbol.for("react.context"), J = Symbol.for("react.forward_ref"),
|
|
434
|
+
var R = H, E = Symbol.for("react.transitional.element"), N = Symbol.for("react.portal"), B = Symbol.for("react.fragment"), te = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), re = Symbol.for("react.consumer"), le = Symbol.for("react.context"), J = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), F = Symbol.for("react.suspense_list"), $ = Symbol.for("react.memo"), V = Symbol.for("react.lazy"), be = Symbol.for("react.offscreen"), ce = Symbol.iterator, ye = Symbol.for("react.client.reference"), k = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, I = Object.assign, T = Symbol.for("react.client.reference"), X = Array.isArray, Y = 0, Pe, Re, Ne, Ge, Te, _e, ze;
|
|
435
435
|
s.__reactDisabledLog = !0;
|
|
436
|
-
var Ee,
|
|
436
|
+
var Ee, Ie, Ce = !1, we = new (typeof WeakMap == "function" ? WeakMap : Map)(), st = Symbol.for("react.client.reference"), Ae, Me = {}, Be = {}, Fe = {};
|
|
437
437
|
de.Fragment = B, de.jsx = function(e, c, f, b, G) {
|
|
438
438
|
return x(e, c, f, !1, b, G);
|
|
439
439
|
}, de.jsxs = function(e, c, f, b, G) {
|
|
@@ -447,7 +447,7 @@ function mt() {
|
|
|
447
447
|
}
|
|
448
448
|
var o = mt();
|
|
449
449
|
const Ve = ie(), Ht = ({ children: r }) => {
|
|
450
|
-
const [i, n] =
|
|
450
|
+
const [i, n] = w(!1), [s, a] = w(!1), [l, u] = w({});
|
|
451
451
|
return /* @__PURE__ */ o.jsx(Ve.Provider, { value: { isLoading: i, setIsLoading: n, isLoadingComponent: s, setIsLoadingComponent: a, loadingProps: l, setLoadingProps: u }, children: r });
|
|
452
452
|
}, me = () => {
|
|
453
453
|
const r = se(Ve);
|
|
@@ -457,7 +457,7 @@ const Ve = ie(), Ht = ({ children: r }) => {
|
|
|
457
457
|
/* @__PURE__ */ o.jsx("h1", { className: "text-center text-8xl my-12", children: "Errore" }),
|
|
458
458
|
/* @__PURE__ */ o.jsx("pre", { className: "text-xl", children: r })
|
|
459
459
|
] }) }), Xe = ie(), Yt = ({ children: r }) => {
|
|
460
|
-
const [i, n] =
|
|
460
|
+
const [i, n] = w({}), [s, a] = w(!1), l = `Creare un file config.json in public per il corretto funzionamento
|
|
461
461
|
Esempio di config.json:
|
|
462
462
|
|
|
463
463
|
{
|
|
@@ -470,19 +470,20 @@ Esempio di config.json:
|
|
|
470
470
|
"configRoutes": [
|
|
471
471
|
{"path": "", "title": "", "element": ""}
|
|
472
472
|
],
|
|
473
|
-
"infiniteSession": " ,
|
|
474
|
-
"timeDeducted": " ,
|
|
475
|
-
"alertTimeout": "
|
|
476
|
-
"axiosTimeout": " ,
|
|
473
|
+
"infiniteSession": "" ,
|
|
474
|
+
"timeDeducted": "" ,
|
|
475
|
+
"alertTimeout": "",
|
|
476
|
+
"axiosTimeout": "" ,
|
|
477
477
|
"axiosErrors": {
|
|
478
478
|
"unauthorized":"",
|
|
479
479
|
"notFound": "",
|
|
480
480
|
"defaultMessage": ""
|
|
481
481
|
},
|
|
482
|
-
"clearLoginFormOnError": " ,
|
|
483
|
-
"autoLogin": " ,
|
|
482
|
+
"clearLoginFormOnError": "" ,
|
|
483
|
+
"autoLogin": "" ,
|
|
484
484
|
"backendToken": "",
|
|
485
|
-
"isDebug": ""
|
|
485
|
+
"isDebug": "",
|
|
486
|
+
"showHeaderButton": ""
|
|
486
487
|
}`, u = () => {
|
|
487
488
|
const d = /* @__PURE__ */ new Date(), x = String(d.getDate()).padStart(2, "0"), g = String(d.getMonth() + 1).padStart(2, "0"), O = d.getFullYear(), j = String(d.getHours()).padStart(2, "0"), S = String(d.getMinutes()).padStart(2, "0"), R = String(d.getSeconds()).padStart(2, "0");
|
|
488
489
|
return `${x}/${g}/${O} ${j}:${S}:${R}`;
|
|
@@ -518,9 +519,9 @@ Esempio di config.json:
|
|
|
518
519
|
g = await p(d, x), g && x++;
|
|
519
520
|
while (g);
|
|
520
521
|
return x;
|
|
521
|
-
},
|
|
522
|
+
}, L = async (d, x) => {
|
|
522
523
|
x.id || (x.id = await v(d)), await y(d, x);
|
|
523
|
-
},
|
|
524
|
+
}, C = async () => {
|
|
524
525
|
try {
|
|
525
526
|
const g = {
|
|
526
527
|
...await (await fetch("/config.json")).json(),
|
|
@@ -528,7 +529,7 @@ Esempio di config.json:
|
|
|
528
529
|
getDataIndexedDB: p,
|
|
529
530
|
setDataIndexedDB: y,
|
|
530
531
|
generateUniqueId: v,
|
|
531
|
-
setDataWithAutoId:
|
|
532
|
+
setDataWithAutoId: L,
|
|
532
533
|
setCurrentDate: u
|
|
533
534
|
};
|
|
534
535
|
n(g);
|
|
@@ -536,8 +537,8 @@ Esempio di config.json:
|
|
|
536
537
|
console.error(d), a(!0);
|
|
537
538
|
}
|
|
538
539
|
};
|
|
539
|
-
return
|
|
540
|
-
|
|
540
|
+
return A(() => {
|
|
541
|
+
C();
|
|
541
542
|
}, []), Object.keys(i).length === 0 ? /* @__PURE__ */ o.jsx(pt, { errorShow: s, errorMessage: l }) : /* @__PURE__ */ o.jsx(Xe.Provider, { value: i, children: r });
|
|
542
543
|
}, U = () => {
|
|
543
544
|
const r = se(Xe);
|
|
@@ -656,7 +657,7 @@ function St(r) {
|
|
|
656
657
|
return ae({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M17.47 250.9C88.82 328.1 158 397.6 224.5 485.5c72.3-143.8 146.3-288.1 268.4-444.37L460 26.06C356.9 135.4 276.8 238.9 207.2 361.9c-48.4-43.6-126.62-105.3-174.38-137z" }, child: [] }] })(r);
|
|
657
658
|
}
|
|
658
659
|
const et = ie(), Zt = ({ children: r }) => {
|
|
659
|
-
const [i, n] =
|
|
660
|
+
const [i, n] = w(!1), [s, a] = w(), [l, u] = w(), L = {
|
|
660
661
|
showAlert: i,
|
|
661
662
|
setShowAlert: n,
|
|
662
663
|
typeAlert: s,
|
|
@@ -697,8 +698,8 @@ const et = ie(), Zt = ({ children: r }) => {
|
|
|
697
698
|
progressColor: "bg-warning-progress"
|
|
698
699
|
}
|
|
699
700
|
},
|
|
700
|
-
getIcon: (
|
|
701
|
-
switch (
|
|
701
|
+
getIcon: (C) => {
|
|
702
|
+
switch (C) {
|
|
702
703
|
case "danger":
|
|
703
704
|
return /* @__PURE__ */ o.jsx(ht, { className: "w-[20px] h-[20px]" });
|
|
704
705
|
case "info":
|
|
@@ -712,13 +713,13 @@ const et = ie(), Zt = ({ children: r }) => {
|
|
|
712
713
|
closeAlert: () => {
|
|
713
714
|
n(!i);
|
|
714
715
|
},
|
|
715
|
-
activeAlert: (
|
|
716
|
+
activeAlert: (C, d) => {
|
|
716
717
|
n(!1), setTimeout(() => {
|
|
717
|
-
a(
|
|
718
|
+
a(C), u(d), n(!0);
|
|
718
719
|
}, 50);
|
|
719
720
|
}
|
|
720
721
|
};
|
|
721
|
-
return /* @__PURE__ */ o.jsx(et.Provider, { value:
|
|
722
|
+
return /* @__PURE__ */ o.jsx(et.Provider, { value: L, children: r });
|
|
722
723
|
}, ee = () => {
|
|
723
724
|
const r = se(et);
|
|
724
725
|
if (r === void 0) throw new Error("Non puoi modificare l'alert");
|
|
@@ -755,24 +756,24 @@ const Ot = async (r, i, n) => {
|
|
|
755
756
|
console.error(s);
|
|
756
757
|
}
|
|
757
758
|
}, tt = ie(), Ut = ({ children: r }) => {
|
|
758
|
-
const { heartbeatEndpoint: i, firstPrivatePath: n, infiniteSession: s, timeDeducted: a, authenticatedEndpoint: l, autoLogin: u, autoLoginEmail: m, autoLoginPassword: p, setCurrentDate: y, isDebug: v, backendToken:
|
|
759
|
+
const { heartbeatEndpoint: i, firstPrivatePath: n, infiniteSession: s, timeDeducted: a, authenticatedEndpoint: l, autoLogin: u, autoLoginEmail: m, autoLoginPassword: p, setCurrentDate: y, isDebug: v, backendToken: L } = U(), { setIsLoading: C } = me(), { setShowAlert: d, setMessageAlert: x, setTypeAlert: g, activeAlert: O } = ee(), j = ke(), [S, R] = w(null), [E, N] = w(), [B, te] = w(), [q, re] = w(), [le, J] = w(!1), M = async () => await Ot(d, g, x), F = async (k = null, z) => {
|
|
759
760
|
k && k.preventDefault(), J(!0);
|
|
760
761
|
try {
|
|
761
|
-
|
|
762
|
-
const T = await (await
|
|
763
|
-
auth:
|
|
762
|
+
C(!0), d(!1);
|
|
763
|
+
const T = await (await M()).post(l, {
|
|
764
|
+
auth: z
|
|
764
765
|
}), X = T.headers.token, Y = T.data;
|
|
765
766
|
X && (localStorage.setItem("accessToken", X), localStorage.setItem("user", JSON.stringify(Y)), R(!0), N(X), j(`${n}${Y.id}`));
|
|
766
|
-
} catch (
|
|
767
|
-
console.error(
|
|
767
|
+
} catch (I) {
|
|
768
|
+
console.error(I);
|
|
768
769
|
} finally {
|
|
769
|
-
J(!1),
|
|
770
|
+
J(!1), C(!1);
|
|
770
771
|
}
|
|
771
772
|
}, $ = () => {
|
|
772
773
|
localStorage.removeItem("accessToken"), localStorage.removeItem("id"), localStorage.removeItem("user"), R(!1), N(null);
|
|
773
774
|
}, V = async () => {
|
|
774
775
|
try {
|
|
775
|
-
const k = localStorage.getItem("accessToken"), T = (await (await
|
|
776
|
+
const k = localStorage.getItem("accessToken"), T = (await (await M()).get(
|
|
776
777
|
`${i}`,
|
|
777
778
|
{
|
|
778
779
|
headers: {
|
|
@@ -787,11 +788,11 @@ const Ot = async (r, i, n) => {
|
|
|
787
788
|
}, be = () => {
|
|
788
789
|
if (!E)
|
|
789
790
|
return;
|
|
790
|
-
const
|
|
791
|
+
const z = at(E).exp, I = Math.floor(Date.now() / 1e3), T = (z - I) * 1e3;
|
|
791
792
|
re(T), te(T - a);
|
|
792
793
|
}, ce = async (k) => {
|
|
793
794
|
try {
|
|
794
|
-
const T = (await (await
|
|
795
|
+
const T = (await (await M()).get(
|
|
795
796
|
i,
|
|
796
797
|
{
|
|
797
798
|
headers: {
|
|
@@ -800,33 +801,33 @@ const Ot = async (r, i, n) => {
|
|
|
800
801
|
}
|
|
801
802
|
)).data;
|
|
802
803
|
T && (localStorage.setItem("user", JSON.stringify(T)), localStorage.setItem("accessToken", k), R(!0), j(`${n}${T.id}`));
|
|
803
|
-
} catch (
|
|
804
|
-
console.error(
|
|
804
|
+
} catch (z) {
|
|
805
|
+
console.error(z);
|
|
805
806
|
}
|
|
806
807
|
};
|
|
807
|
-
|
|
808
|
+
A(() => {
|
|
808
809
|
if (localStorage.getItem("accessToken"))
|
|
809
810
|
R(!0);
|
|
810
811
|
else {
|
|
811
812
|
R(!1);
|
|
812
813
|
return;
|
|
813
814
|
}
|
|
814
|
-
}, []),
|
|
815
|
-
u && ce(
|
|
816
|
-
}, [u]),
|
|
817
|
-
S || u && !le && ce(
|
|
818
|
-
}, [S]),
|
|
815
|
+
}, []), A(() => {
|
|
816
|
+
u && ce(L);
|
|
817
|
+
}, [u]), A(() => {
|
|
818
|
+
S || u && !le && ce(L);
|
|
819
|
+
}, [S]), A(() => {
|
|
819
820
|
if (u) return;
|
|
820
821
|
be();
|
|
821
822
|
let k;
|
|
822
823
|
s && E && B && (k = setInterval(() => {
|
|
823
824
|
V();
|
|
824
825
|
}, B));
|
|
825
|
-
let
|
|
826
|
-
return !s && E && q && (
|
|
826
|
+
let z;
|
|
827
|
+
return !s && E && q && (z = setTimeout(() => {
|
|
827
828
|
$(), O("danger", "Sessione scaduta");
|
|
828
829
|
}, q)), () => {
|
|
829
|
-
k && clearInterval(k),
|
|
830
|
+
k && clearInterval(k), z && clearTimeout(z);
|
|
830
831
|
};
|
|
831
832
|
}, [E, B]);
|
|
832
833
|
const ye = {
|
|
@@ -835,7 +836,7 @@ const Ot = async (r, i, n) => {
|
|
|
835
836
|
login: F,
|
|
836
837
|
logout: $,
|
|
837
838
|
setCurrentToken: N,
|
|
838
|
-
createAxiosInstances:
|
|
839
|
+
createAxiosInstances: M
|
|
839
840
|
};
|
|
840
841
|
return /* @__PURE__ */ o.jsx(tt.Provider, { value: ye, children: r });
|
|
841
842
|
}, ve = () => {
|
|
@@ -861,7 +862,7 @@ Esempio:
|
|
|
861
862
|
const { login: i } = ve(), { clearLoginFormOnError: n } = U(), s = {
|
|
862
863
|
email: "",
|
|
863
864
|
password: ""
|
|
864
|
-
}, [a, l] =
|
|
865
|
+
}, [a, l] = w("Accedi"), [u, m] = w("Email"), [p, y] = w("email"), [v, L] = w("example@example.it"), [C, d] = w("Accedi"), [x, g] = w(s), [O, j] = w(), [S, R] = w(), [E, N] = w(), [B, te] = w(), [q, re] = w({}), M = {
|
|
865
866
|
overrideStyle: q,
|
|
866
867
|
setOverrideStyle: re,
|
|
867
868
|
title: a,
|
|
@@ -871,8 +872,8 @@ Esempio:
|
|
|
871
872
|
type: p,
|
|
872
873
|
setType: y,
|
|
873
874
|
placeholder: v,
|
|
874
|
-
setPlaceholder:
|
|
875
|
-
buttonText:
|
|
875
|
+
setPlaceholder: L,
|
|
876
|
+
buttonText: C,
|
|
876
877
|
setButtonText: d,
|
|
877
878
|
formData: x,
|
|
878
879
|
setFormData: g,
|
|
@@ -891,7 +892,7 @@ Esempio:
|
|
|
891
892
|
i(F, x), n && g(s);
|
|
892
893
|
}
|
|
893
894
|
};
|
|
894
|
-
return /* @__PURE__ */ o.jsx(ot.Provider, { value:
|
|
895
|
+
return /* @__PURE__ */ o.jsx(ot.Provider, { value: M, children: r });
|
|
895
896
|
}, nt = () => {
|
|
896
897
|
const r = se(ot);
|
|
897
898
|
if (r === void 0) throw new Error("Non puoi modificare La login");
|
|
@@ -911,8 +912,8 @@ function Pt(r) {
|
|
|
911
912
|
return ae({ tag: "svg", attr: { viewBox: "0 0 15 15", fill: "none" }, child: [{ tag: "path", attr: { fillRule: "evenodd", clipRule: "evenodd", d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z", fill: "currentColor" }, child: [] }] })(r);
|
|
912
913
|
}
|
|
913
914
|
const Ue = () => {
|
|
914
|
-
const { messageAlert: r, typeAlert: i, alertConfig: n, getIcon: s, closeAlert: a } = ee(), { alertTimeout: l } = U(), [u, m] =
|
|
915
|
-
return
|
|
915
|
+
const { messageAlert: r, typeAlert: i, alertConfig: n, getIcon: s, closeAlert: a } = ee(), { alertTimeout: l } = U(), [u, m] = w(0), { bgColor: p, textColor: y, buttonBg: v, hoverBg: L, focusRing: C, progressColor: d } = n[i];
|
|
916
|
+
return A(() => {
|
|
916
917
|
let x;
|
|
917
918
|
const O = 100 / (l / 100);
|
|
918
919
|
x = setInterval(() => {
|
|
@@ -932,7 +933,7 @@ const Ue = () => {
|
|
|
932
933
|
"button",
|
|
933
934
|
{
|
|
934
935
|
type: "button",
|
|
935
|
-
className: `ms-auto ${v} rounded-lg focus:ring-2 ${
|
|
936
|
+
className: `ms-auto ${v} rounded-lg focus:ring-2 ${C} p-1.5 ${L} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,
|
|
936
937
|
title: "Close",
|
|
937
938
|
onClick: a,
|
|
938
939
|
children: /* @__PURE__ */ o.jsx(Pt, { className: "text-xl" })
|
|
@@ -948,15 +949,15 @@ const Ue = () => {
|
|
|
948
949
|
footerComponent: p = null,
|
|
949
950
|
showFooterOnLogin: y = !1,
|
|
950
951
|
footerExcludedRoutes: v = []
|
|
951
|
-
} = r,
|
|
952
|
-
let
|
|
953
|
-
s.pathname === "/" ?
|
|
952
|
+
} = r, L = m.some((g) => $e(g, s.pathname));
|
|
953
|
+
let C;
|
|
954
|
+
s.pathname === "/" ? C = l && u : C = l && !L;
|
|
954
955
|
const d = v.some((g) => $e(g, s.pathname));
|
|
955
956
|
let x;
|
|
956
957
|
return s.pathname === "/" ? x = p && y : x = p && !d, /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
957
958
|
i && /* @__PURE__ */ o.jsx(Lt, {}),
|
|
958
959
|
n && /* @__PURE__ */ o.jsx(Ue, {}),
|
|
959
|
-
|
|
960
|
+
C && l,
|
|
960
961
|
a ? /* @__PURE__ */ o.jsxs("main", { className: i ? "hidden" : "", children: [
|
|
961
962
|
n && /* @__PURE__ */ o.jsx(Ue, {}),
|
|
962
963
|
/* @__PURE__ */ o.jsx(je, {})
|
|
@@ -975,11 +976,11 @@ const Ue = () => {
|
|
|
975
976
|
inputStyle: p,
|
|
976
977
|
overrideStyle: y,
|
|
977
978
|
disabled: v
|
|
978
|
-
} = r,
|
|
979
|
+
} = r, C = ["text", "email", "password", "search", "tel", "url"].includes(i) ? i : "text";
|
|
979
980
|
return /* @__PURE__ */ o.jsx(
|
|
980
981
|
"input",
|
|
981
982
|
{
|
|
982
|
-
type:
|
|
983
|
+
type: C,
|
|
983
984
|
autoFocus: m,
|
|
984
985
|
id: n,
|
|
985
986
|
className: y || `bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-primary focus:border-primary focus:outline-none focus:shadow-(--shadow-primary-input) block w-full p-input ${p}`,
|
|
@@ -1029,7 +1030,7 @@ const Ue = () => {
|
|
|
1029
1030
|
] });
|
|
1030
1031
|
}, Gt = ({ Logo: r }) => {
|
|
1031
1032
|
const { styleCardForm: i, styleContainerLogo: n, styleLogo: s, overrideStyle: a } = nt(), { firstPrivatePath: l } = U(), u = ke();
|
|
1032
|
-
return
|
|
1033
|
+
return A(() => {
|
|
1033
1034
|
const m = JSON.parse(localStorage.getItem("user"));
|
|
1034
1035
|
localStorage.getItem("accessToken") && m.id && u(`${l}${m.id}`);
|
|
1035
1036
|
}, []), /* @__PURE__ */ o.jsx("section", { id: "login-page", children: /* @__PURE__ */ o.jsx("div", { className: a.container || "container mx-auto flex items-center justify-center h-screen", children: /* @__PURE__ */ o.jsxs("div", { className: a.cardForm || `bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${i}`, children: [
|
|
@@ -1038,12 +1039,12 @@ const Ue = () => {
|
|
|
1038
1039
|
] }) }) });
|
|
1039
1040
|
}, Tt = () => {
|
|
1040
1041
|
const { isAuthenticated: r } = ve(), { activeAlert: i } = ee(), { autoLogin: n } = U();
|
|
1041
|
-
return
|
|
1042
|
+
return A(() => {
|
|
1042
1043
|
const s = localStorage.getItem("accessToken");
|
|
1043
1044
|
!r && !s && !n && i("danger", "Non sei autorizzato");
|
|
1044
1045
|
}, []), r === null ? null : r ? /* @__PURE__ */ o.jsx(je, {}) : /* @__PURE__ */ o.jsx(Je, { to: "/", replace: !0 });
|
|
1045
1046
|
}, _t = () => {
|
|
1046
|
-
const { logout: r, setCurrentToken: i, createAxiosInstances: n } = ve(), { usersEndpoint: s } = U(), { setIsLoading: a } = me(), { activeAlert: l } = ee(), [u, m] =
|
|
1047
|
+
const { logout: r, setCurrentToken: i, createAxiosInstances: n } = ve(), { usersEndpoint: s } = U(), { setIsLoading: a } = me(), { activeAlert: l } = ee(), [u, m] = w(null), [p, y] = w(!1), v = JSON.parse(localStorage.getItem("user")), L = async () => {
|
|
1047
1048
|
try {
|
|
1048
1049
|
y(!0);
|
|
1049
1050
|
const d = localStorage.getItem("accessToken");
|
|
@@ -1065,10 +1066,10 @@ const Ue = () => {
|
|
|
1065
1066
|
} finally {
|
|
1066
1067
|
y(!1);
|
|
1067
1068
|
}
|
|
1068
|
-
},
|
|
1069
|
+
}, C = () => {
|
|
1069
1070
|
r(), l("info", "Hai effettuato il logout");
|
|
1070
1071
|
};
|
|
1071
|
-
return
|
|
1072
|
+
return A(() => {
|
|
1072
1073
|
const d = localStorage.getItem("accessToken");
|
|
1073
1074
|
d && i(d);
|
|
1074
1075
|
}, []), /* @__PURE__ */ o.jsx("section", { children: /* @__PURE__ */ o.jsxs("div", { className: "container mx-auto py-8", children: [
|
|
@@ -1080,7 +1081,7 @@ const Ue = () => {
|
|
|
1080
1081
|
/* @__PURE__ */ o.jsx(
|
|
1081
1082
|
"button",
|
|
1082
1083
|
{
|
|
1083
|
-
onClick:
|
|
1084
|
+
onClick: C,
|
|
1084
1085
|
className: "bg-red-500 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-full cursor-pointer shadow-[0_4px_10px_rgba(239,68,68,0.3),0_2px_4px_rgba(239,68,68,0.2)] hover:shadow-[0_6px_14px_rgba(185,28,28,0.4),0_3px_6px_rgba(185,28,28,0.3)] active:shadow-[0_2px_5px_rgba(239,68,68,0.3)] transition-all duration-200 active:translate-y-[2px]",
|
|
1085
1086
|
children: "Logout"
|
|
1086
1087
|
}
|
|
@@ -1089,7 +1090,7 @@ const Ue = () => {
|
|
|
1089
1090
|
/* @__PURE__ */ o.jsx("div", { className: "flex justify-center items-center my-12 gap-8", children: /* @__PURE__ */ o.jsx(
|
|
1090
1091
|
"button",
|
|
1091
1092
|
{
|
|
1092
|
-
onClick:
|
|
1093
|
+
onClick: L,
|
|
1093
1094
|
className: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-full disabled:bg-blue-300 disabled:text-gray-500 disabled:cursor-not-allowed cursor-pointer transition-all duration-200 active:translate-y-[2px] shadow-[0_4px_10px_rgba(59,130,246,0.3),0_2px_4px_rgba(59,130,246,0.2)] hover:shadow-[0_6px_14px_rgba(29,78,216,0.4),0_3px_6px_rgba(29,78,216,0.3)] active:shadow-[0_2px_5px_rgba(59,130,246,0.3)]",
|
|
1094
1095
|
disabled: p,
|
|
1095
1096
|
children: "Lista degli utenti"
|
|
@@ -1101,7 +1102,7 @@ const Ue = () => {
|
|
|
1101
1102
|
d.email
|
|
1102
1103
|
] }, `user-${d.id}`)) }) })
|
|
1103
1104
|
] }) });
|
|
1104
|
-
},
|
|
1105
|
+
}, zt = (r) => /* @__PURE__ */ t.createElement("svg", { width: "108.41262mm", height: "108.41262mm", viewBox: "0 0 108.41262 108.41262", id: "svg1", xmlSpace: "preserve", xmlnsXlink: "http://www.w3.org/1999/xlink", xmlns: "http://www.w3.org/2000/svg", "xmlns:svg": "http://www.w3.org/2000/svg", ...r }, /* @__PURE__ */ t.createElement("defs", { id: "defs1" }, /* @__PURE__ */ t.createElement("linearGradient", { id: "linearGradient27" }, /* @__PURE__ */ t.createElement("stop", { style: {
|
|
1105
1106
|
stopColor: "#ff0000",
|
|
1106
1107
|
stopOpacity: 1
|
|
1107
1108
|
}, offset: 0, id: "stop27" }), /* @__PURE__ */ t.createElement("stop", { style: {
|
|
@@ -1149,15 +1150,15 @@ const Ue = () => {
|
|
|
1149
1150
|
paintOrder: "stroke markers fill"
|
|
1150
1151
|
}, d: "", id: "path40", transform: "scale(0.26458333)" }))), Vt = (r) => {
|
|
1151
1152
|
const { publicRoutes: i, privateRoutes: n } = kt(), { firstPrivatePath: s } = U(), {
|
|
1152
|
-
logoImg: a =
|
|
1153
|
+
logoImg: a = zt,
|
|
1153
1154
|
pathImg: l = "./src/assets/MyWarehouse.svg",
|
|
1154
1155
|
firstPrivateElement: u = /* @__PURE__ */ o.jsx(_t, {}),
|
|
1155
1156
|
globalLayout: m,
|
|
1156
1157
|
isMain: p,
|
|
1157
1158
|
headerComponent: y,
|
|
1158
1159
|
showHeaderOnLogin: v,
|
|
1159
|
-
headerExcludedRoutes:
|
|
1160
|
-
footerComponent:
|
|
1160
|
+
headerExcludedRoutes: L,
|
|
1161
|
+
footerComponent: C,
|
|
1161
1162
|
showFooterOnLogin: d,
|
|
1162
1163
|
footerExcludedRoutes: x,
|
|
1163
1164
|
privateProvider: g,
|
|
@@ -1168,8 +1169,8 @@ const Ue = () => {
|
|
|
1168
1169
|
isMain: p,
|
|
1169
1170
|
headerComponent: y,
|
|
1170
1171
|
showHeaderOnLogin: v,
|
|
1171
|
-
headerExcludedRoutes:
|
|
1172
|
-
footerComponent:
|
|
1172
|
+
headerExcludedRoutes: L,
|
|
1173
|
+
footerComponent: C,
|
|
1173
1174
|
showFooterOnLogin: d,
|
|
1174
1175
|
footerExcludedRoutes: x
|
|
1175
1176
|
}
|
|
@@ -1177,7 +1178,7 @@ const Ue = () => {
|
|
|
1177
1178
|
const E = document.querySelector("link[rel='icon']");
|
|
1178
1179
|
l && (E.href = l);
|
|
1179
1180
|
};
|
|
1180
|
-
return
|
|
1181
|
+
return A(() => {
|
|
1181
1182
|
R();
|
|
1182
1183
|
}, []), /* @__PURE__ */ o.jsx(lt, { children: /* @__PURE__ */ o.jsxs(Q, { element: m === "none" ? null : j, children: [
|
|
1183
1184
|
/* @__PURE__ */ o.jsxs(Q, { path: "/", children: [
|
|
@@ -1192,7 +1193,7 @@ const Ue = () => {
|
|
|
1192
1193
|
}, Xt = ({ children: r }) => {
|
|
1193
1194
|
var a;
|
|
1194
1195
|
const i = Le(), { activeAlert: n } = ee(), s = JSON.parse(localStorage.getItem("user"));
|
|
1195
|
-
return
|
|
1196
|
+
return A(() => {
|
|
1196
1197
|
(!s || !s.admin) && n("warning", "Non puoi accedere a questa pagina");
|
|
1197
1198
|
}, [s]), !s || !s.admin ? /* @__PURE__ */ o.jsx(Je, { to: ((a = i.state) == null ? void 0 : a.from) || "/", replace: !0 }) : r;
|
|
1198
1199
|
}, Kt = ({ spinner: r = !0, spinnerStyle: i, text: n, textStyle: s, children: a, containerStyle: l, overrideStyle: u = {} }) => /* @__PURE__ */ o.jsxs("div", { className: u.container || `w-full h-full relative flex items-center justify-center ${l}`, children: [
|
|
@@ -1240,12 +1241,12 @@ const Ue = () => {
|
|
|
1240
1241
|
{
|
|
1241
1242
|
onClick: l,
|
|
1242
1243
|
disabled: !(n != null && n.valueTID) && !(n != null && n.valueEPC),
|
|
1243
|
-
className: "my-1 bg-
|
|
1244
|
+
className: "my-1 bg-write-button disabled:bg-write-button/40 text-white px-4 py-2 rounded-lg shadow-md disabled:transition-none disabled:active:translate-y-0 transition-all duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer uppercase",
|
|
1244
1245
|
children: "Scrivi tag"
|
|
1245
1246
|
}
|
|
1246
1247
|
) })
|
|
1247
1248
|
] });
|
|
1248
|
-
function
|
|
1249
|
+
function It(r) {
|
|
1249
1250
|
return ae({ tag: "svg", attr: { viewBox: "0 0 16 16", fill: "currentColor" }, child: [{ tag: "path", attr: { fillRule: "evenodd", clipRule: "evenodd", d: "M11.04 1.33L12.71 3l.29.71v.33h-.5l-.5.5v-.83l-1.67-1.67H10v4H4v-4H2v10h3l-.5 1H2l-1-1v-10l1-1h8.33l.71.29zM7 5h2V2H7v3zm6.5 0L15 6.5l-.02.69-5.5 5.5-.13.12-.37.37-.1.09-3 1.5-.67-.67 1.5-3 .09-.1.37-.37.12-.13 5.5-5.5h.71zm-6.22 7.24l-.52 1 1.04-.48-.52-.52zm.69-1.03l.79.79 5.15-5.15-.79-.79-5.15 5.15z" }, child: [] }] })(r);
|
|
1250
1251
|
}
|
|
1251
1252
|
const e0 = ({ minReadingPower: r, maxReadingPower: i, stepRangePower: n, rangeValue: s, setRangeValue: a, show: l, handleClick: u }) => {
|
|
@@ -1263,7 +1264,7 @@ const e0 = ({ minReadingPower: r, maxReadingPower: i, stepRangePower: n, rangeVa
|
|
|
1263
1264
|
step: n,
|
|
1264
1265
|
value: s,
|
|
1265
1266
|
onChange: (p) => a(Number(p.target.value)),
|
|
1266
|
-
className: "w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-
|
|
1267
|
+
className: "w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-primary-accent"
|
|
1267
1268
|
}
|
|
1268
1269
|
),
|
|
1269
1270
|
/* @__PURE__ */ o.jsx(
|
|
@@ -1279,10 +1280,10 @@ const e0 = ({ minReadingPower: r, maxReadingPower: i, stepRangePower: n, rangeVa
|
|
|
1279
1280
|
"button",
|
|
1280
1281
|
{
|
|
1281
1282
|
onClick: () => u(s),
|
|
1282
|
-
className: "py-2 px-4 flex items-center justify-center gap-1 bg-
|
|
1283
|
+
className: "py-2 px-4 flex items-center justify-center gap-1 bg-save-button text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",
|
|
1283
1284
|
children: [
|
|
1284
1285
|
"Salva",
|
|
1285
|
-
/* @__PURE__ */ o.jsx(
|
|
1286
|
+
/* @__PURE__ */ o.jsx(It, {})
|
|
1286
1287
|
]
|
|
1287
1288
|
}
|
|
1288
1289
|
) })
|
|
@@ -1295,10 +1296,10 @@ const e0 = ({ minReadingPower: r, maxReadingPower: i, stepRangePower: n, rangeVa
|
|
|
1295
1296
|
] }),
|
|
1296
1297
|
/* @__PURE__ */ o.jsx("button", { onClick: n, className: "my-4 bg-blue-500 text-white px-4 py-2 rounded-lg", children: "Seleziona file" })
|
|
1297
1298
|
] });
|
|
1298
|
-
function
|
|
1299
|
+
function At(r) {
|
|
1299
1300
|
return ae({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M312 372c-7.7 0-14 6.3-14 14 0 9.9-8.1 18-18 18H94c-9.9 0-18-8.1-18-18V126c0-9.9 8.1-18 18-18h186c9.9 0 18 8.1 18 18 0 7.7 6.3 14 14 14s14-6.3 14-14c0-25.4-20.6-46-46-46H94c-25.4 0-46 20.6-46 46v260c0 25.4 20.6 46 46 46h186c25.4 0 46-20.6 46-46 0-7.7-6.3-14-14-14z" }, child: [] }, { tag: "path", attr: { d: "M372.9 158.1c-2.6-2.6-6.1-4.1-9.9-4.1-3.7 0-7.3 1.4-9.9 4.1-5.5 5.5-5.5 14.3 0 19.8l65.2 64.2H162c-7.7 0-14 6.3-14 14s6.3 14 14 14h256.6L355 334.2c-5.4 5.4-5.4 14.3 0 19.8l.1.1c2.7 2.5 6.2 3.9 9.8 3.9 3.8 0 7.3-1.4 9.9-4.1l82.6-82.4c4.3-4.3 6.5-9.3 6.5-14.7 0-5.3-2.3-10.3-6.5-14.5l-84.5-84.2z" }, child: [] }] })(r);
|
|
1300
1301
|
}
|
|
1301
|
-
function
|
|
1302
|
+
function Mt(r) {
|
|
1302
1303
|
return ae({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 9.059v-2.559c0-.256-.098-.512-.293-.708-.195-.195-.451-.292-.707-.292s-.512.097-.707.292l-6.293 6.208 6.293 6.207c.195.195.451.293.707.293s.512-.098.707-.293.293-.452.293-.707v-2.489c2.75.068 5.755.566 8 3.989v-1c0-4.633-3.5-8.443-8-8.941z" }, child: [] }] })(r);
|
|
1303
1304
|
}
|
|
1304
1305
|
const Bt = (r) => /* @__PURE__ */ t.createElement("svg", { width: "108.41262mm", height: "108.41262mm", viewBox: "0 0 108.41262 108.41262", id: "svg1", xmlSpace: "preserve", xmlnsXlink: "http://www.w3.org/1999/xlink", xmlns: "http://www.w3.org/2000/svg", "xmlns:svg": "http://www.w3.org/2000/svg", ...r }, /* @__PURE__ */ t.createElement("defs", { id: "defs1" }, /* @__PURE__ */ t.createElement("linearGradient", { id: "linearGradient27" }, /* @__PURE__ */ t.createElement("stop", { style: {
|
|
@@ -1367,29 +1368,29 @@ const Bt = (r) => /* @__PURE__ */ t.createElement("svg", { width: "108.41262mm",
|
|
|
1367
1368
|
strokeOpacity: 1,
|
|
1368
1369
|
paintOrder: "stroke markers fill"
|
|
1369
1370
|
}, d: "", id: "path40", transform: "scale(0.26458333)" }))), r0 = ({ Logo: r }) => {
|
|
1370
|
-
const { logout: i } = ve(), { activeAlert: n } = ee(), { autoLogin: s, configRoutes: a, firstPrivateTitle: l } = U(), { isLoading:
|
|
1371
|
+
const { logout: i } = ve(), { activeAlert: n } = ee(), { autoLogin: s, configRoutes: a, firstPrivateTitle: l, showHeaderButton: u } = U(), { isLoading: m } = me(), p = Le(), y = ke(), v = () => {
|
|
1371
1372
|
i(), n("info", "Hai effettuato il logout");
|
|
1372
|
-
},
|
|
1373
|
-
return /* @__PURE__ */ o.jsx("header", { className:
|
|
1374
|
-
/* @__PURE__ */ o.jsx("figure", { children: r ? /* @__PURE__ */ o.jsx(r, { className: "
|
|
1375
|
-
/* @__PURE__ */ o.jsx("div", { children: /* @__PURE__ */ o.jsx("p", { children: (
|
|
1373
|
+
}, L = a.find((d) => d.path === p.pathname), C = ct("home/:id");
|
|
1374
|
+
return /* @__PURE__ */ o.jsx("header", { className: m ? "hidden" : "", children: /* @__PURE__ */ o.jsxs("nav", { className: "header-size flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300", children: [
|
|
1375
|
+
/* @__PURE__ */ o.jsx("figure", { children: r ? /* @__PURE__ */ o.jsx(r, { className: "header-logo-size" }) : /* @__PURE__ */ o.jsx(Bt, { className: "header-logo-size" }) }),
|
|
1376
|
+
/* @__PURE__ */ o.jsx("div", { children: /* @__PURE__ */ o.jsx("p", { children: (L == null ? void 0 : L.title) || l }) }),
|
|
1376
1377
|
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
1377
|
-
!s &&
|
|
1378
|
+
!s && C && /* @__PURE__ */ o.jsx(
|
|
1378
1379
|
"button",
|
|
1379
1380
|
{
|
|
1380
|
-
className: "h-[
|
|
1381
|
+
className: "h-[var(--header-logo-size)] w-[var(--header-logo-size)] flex items-center justify-center bg-red-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",
|
|
1381
1382
|
type: "button",
|
|
1382
|
-
onClick:
|
|
1383
|
-
children: /* @__PURE__ */ o.jsx(
|
|
1383
|
+
onClick: v,
|
|
1384
|
+
children: /* @__PURE__ */ o.jsx(At, { className: "text-4xl w-full" })
|
|
1384
1385
|
}
|
|
1385
1386
|
),
|
|
1386
|
-
!
|
|
1387
|
+
!C && u && /* @__PURE__ */ o.jsx(
|
|
1387
1388
|
"button",
|
|
1388
1389
|
{
|
|
1389
|
-
className: "h-[
|
|
1390
|
+
className: "h-[var(--header-logo-size)] w-[var(--header-logo-size)] flex items-center justify-center bg-sky-600 text-white rounded-lg shadow-md transition duration-200 ease-in-out transform active:translate-y-[2px] cursor-pointer",
|
|
1390
1391
|
type: "button",
|
|
1391
|
-
onClick: () =>
|
|
1392
|
-
children: /* @__PURE__ */ o.jsx(
|
|
1392
|
+
onClick: () => y(-1),
|
|
1393
|
+
children: /* @__PURE__ */ o.jsx(Mt, { className: "text-4xl w-full" })
|
|
1393
1394
|
}
|
|
1394
1395
|
)
|
|
1395
1396
|
] })
|