thecore-auth 0.0.164 → 0.0.166

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.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),Fe=require("jwt-decode"),P=require("react-router-dom"),Ze=require("axios"),Ve=require("react-dom");function gt(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(o,s,a.get?a:{enumerable:!0,get:()=>e[s]})}}return o.default=e,Object.freeze(o)}const r=gt(l);var ke={exports:{}},ye={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),qe=require("jwt-decode"),O=require("react-router-dom"),Ge=require("axios"),Ze=require("react-dom");function pt(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const u=pt(a);var Pe={exports:{}},ye={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var We;function xt(){if(We)return ye;We=1;var e=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function s(a,i,u){var c=null;if(u!==void 0&&(c=""+u),i.key!==void 0&&(c=""+i.key),"key"in i){u={};for(var h in i)h!=="key"&&(u[h]=i[h])}else u=i;return i=u.ref,{$$typeof:e,type:a,key:c,ref:i!==void 0?i:null,props:u}}return ye.Fragment=o,ye.jsx=s,ye.jsxs=s,ye}var Ee={};/**
9
+ */var We;function xt(){if(We)return ye;We=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function n(s,l,c){var i=null;if(c!==void 0&&(i=""+c),l.key!==void 0&&(i=""+l.key),"key"in l){c={};for(var h in l)h!=="key"&&(c[h]=l[h])}else c=l;return l=c.ref,{$$typeof:e,type:s,key:i,ref:l!==void 0?l:null,props:c}}return ye.Fragment=r,ye.jsx=n,ye.jsxs=n,ye}var we={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,21 +14,21 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var qe;function bt(){return qe||(qe=1,process.env.NODE_ENV!=="production"&&function(){function e(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===re?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case N:return"Fragment";case k:return"Portal";case z:return"Profiler";case T:return"StrictMode";case ie:return"Suspense";case te:return"SuspenseList"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case $:return(t.displayName||"Context")+".Provider";case Z:return(t._context.displayName||"Context")+".Consumer";case _:var x=t.render;return t=t.displayName,t||(t=x.displayName||x.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case q:return x=t.displayName||null,x!==null?x:e(t.type)||"Memo";case H:x=t._payload,t=t._init;try{return e(t(x))}catch{}}return null}function o(t){return""+t}function s(t){try{o(t);var x=!1}catch{x=!0}if(x){x=console;var b=x.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return b.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),o(t)}}function a(){}function i(){if(oe===0){ce=console.log,je=console.info,G=console.warn,M=console.error,B=console.group,I=console.groupCollapsed,ue=console.groupEnd;var t={configurable:!0,enumerable:!0,value:a,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}oe++}function u(){if(oe--,oe===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:U({},t,{value:ce}),info:U({},t,{value:je}),warn:U({},t,{value:G}),error:U({},t,{value:M}),group:U({},t,{value:B}),groupCollapsed:U({},t,{value:I}),groupEnd:U({},t,{value:ue})})}0>oe&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function c(t){if(Y===void 0)try{throw Error()}catch(b){var x=b.stack.trim().match(/\n( *(at )?)/);Y=x&&x[1]||"",Se=-1<b.stack.indexOf(`
18
- at`)?" (<anonymous>)":-1<b.stack.indexOf("@")?"@unknown:0:0":""}return`
19
- `+Y+t+Se}function h(t,x){if(!t||fe)return"";var b=be.get(t);if(b!==void 0)return b;fe=!0,b=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var R=null;R=J.H,J.H=null,i();try{var D={DetermineComponentFrameRoot:function(){try{if(x){var ne=function(){throw Error()};if(Object.defineProperty(ne.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ne,[])}catch(Q){var Oe=Q}Reflect.construct(t,[],ne)}else{try{ne.call()}catch(Q){Oe=Q}t.call(ne.prototype)}}else{try{throw Error()}catch(Q){Oe=Q}(ne=t())&&typeof ne.catch=="function"&&ne.catch(function(){})}}catch(Q){if(Q&&Oe&&typeof Q.stack=="string")return[Q.stack,Oe.stack]}return[null,null]}};D.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var A=Object.getOwnPropertyDescriptor(D.DetermineComponentFrameRoot,"name");A&&A.configurable&&Object.defineProperty(D.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=D.DetermineComponentFrameRoot(),K=O[0],me=O[1];if(K&&me){var F=K.split(`
17
+ */var Fe;function vt(){return Fe||(Fe=1,process.env.NODE_ENV!=="production"&&function(){function e(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===re?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case L:return"Fragment";case P:return"Portal";case z:return"Profiler";case A:return"StrictMode";case le:return"Suspense";case te:return"SuspenseList"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case H:return(t.displayName||"Context")+".Provider";case G:return(t._context.displayName||"Context")+".Consumer";case D:var x=t.render;return t=t.displayName,t||(t=x.displayName||x.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case F:return x=t.displayName||null,x!==null?x:e(t.type)||"Memo";case U:x=t._payload,t=t._init;try{return e(t(x))}catch{}}return null}function r(t){return""+t}function n(t){try{r(t);var x=!1}catch{x=!0}if(x){x=console;var v=x.error,T=typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object";return v.call(x,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",T),r(t)}}function s(){}function l(){if(ne===0){ce=console.log,Se=console.info,M=console.warn,_=console.error,I=console.group,$=console.groupCollapsed,ue=console.groupEnd;var t={configurable:!0,enumerable:!0,value:s,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}ne++}function c(){if(ne--,ne===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:V({},t,{value:ce}),info:V({},t,{value:Se}),warn:V({},t,{value:M}),error:V({},t,{value:_}),group:V({},t,{value:I}),groupCollapsed:V({},t,{value:$}),groupEnd:V({},t,{value:ue})})}0>ne&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function i(t){if(Y===void 0)try{throw Error()}catch(v){var x=v.stack.trim().match(/\n( *(at )?)/);Y=x&&x[1]||"",Ce=-1<v.stack.indexOf(`
18
+ at`)?" (<anonymous>)":-1<v.stack.indexOf("@")?"@unknown:0:0":""}return`
19
+ `+Y+t+Ce}function h(t,x){if(!t||fe)return"";var v=ve.get(t);if(v!==void 0)return v;fe=!0,v=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var T=null;T=J.H,J.H=null,l();try{var B={DetermineComponentFrameRoot:function(){try{if(x){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(Q){var ke=Q}Reflect.construct(t,[],oe)}else{try{oe.call()}catch(Q){ke=Q}t.call(oe.prototype)}}else{try{throw Error()}catch(Q){ke=Q}(oe=t())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(Q){if(Q&&ke&&typeof Q.stack=="string")return[Q.stack,ke.stack]}return[null,null]}};B.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var R=Object.getOwnPropertyDescriptor(B.DetermineComponentFrameRoot,"name");R&&R.configurable&&Object.defineProperty(B.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=B.DetermineComponentFrameRoot(),K=k[0],me=k[1];if(K&&me){var q=K.split(`
20
20
  `),de=me.split(`
21
- `);for(O=A=0;A<F.length&&!F[A].includes("DetermineComponentFrameRoot");)A++;for(;O<de.length&&!de[O].includes("DetermineComponentFrameRoot");)O++;if(A===F.length||O===de.length)for(A=F.length-1,O=de.length-1;1<=A&&0<=O&&F[A]!==de[O];)O--;for(;1<=A&&0<=O;A--,O--)if(F[A]!==de[O]){if(A!==1||O!==1)do if(A--,O--,0>O||F[A]!==de[O]){var ve=`
22
- `+F[A].replace(" at new "," at ");return t.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",t.displayName)),typeof t=="function"&&be.set(t,ve),ve}while(1<=A&&0<=O);break}}}finally{fe=!1,J.H=R,u(),Error.prepareStackTrace=b}return F=(F=t?t.displayName||t.name:"")?c(F):"",typeof t=="function"&&be.set(t,F),F}function d(t){if(t==null)return"";if(typeof t=="function"){var x=t.prototype;return h(t,!(!x||!x.isReactComponent))}if(typeof t=="string")return c(t);switch(t){case ie:return c("Suspense");case te:return c("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case _:return t=h(t.render,!1),t;case q:return d(t.type);case H:x=t._payload,t=t._init;try{return d(t(x))}catch{}}return""}function g(){var t=J.A;return t===null?null:t.getOwner()}function j(t){if(W.call(t,"key")){var x=Object.getOwnPropertyDescriptor(t,"key").get;if(x&&x.isReactWarning)return!1}return t.key!==void 0}function S(t,x){function b(){ze||(ze=!0,console.error("%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)",x))}b.isReactWarning=!0,Object.defineProperty(t,"key",{get:b,configurable:!0})}function m(){var t=e(this.type);return _e[t]||(_e[t]=!0,console.error("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.")),t=this.props.ref,t!==void 0?t:null}function f(t,x,b,R,D,A){return b=A.ref,t={$$typeof:C,type:t,key:x,props:A,_owner:D},(b!==void 0?b:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:m}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function E(t,x,b,R,D,A){if(typeof t=="string"||typeof t=="function"||t===N||t===z||t===T||t===ie||t===te||t===X||typeof t=="object"&&t!==null&&(t.$$typeof===H||t.$$typeof===q||t.$$typeof===$||t.$$typeof===Z||t.$$typeof===_||t.$$typeof===xe||t.getModuleId!==void 0)){var O=x.children;if(O!==void 0)if(R)if(le(O)){for(R=0;R<O.length;R++)p(O[R],t);Object.freeze&&Object.freeze(O)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else p(O,t)}else O="",(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(O+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),t===null?R="null":le(t)?R="array":t!==void 0&&t.$$typeof===C?(R="<"+(e(t.type)||"Unknown")+" />",O=" Did you accidentally export a JSX literal instead of a component?"):R=typeof t,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,O);if(W.call(x,"key")){O=e(t);var K=Object.keys(x).filter(function(F){return F!=="key"});R=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",De[O+R]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
21
+ `);for(k=R=0;R<q.length&&!q[R].includes("DetermineComponentFrameRoot");)R++;for(;k<de.length&&!de[k].includes("DetermineComponentFrameRoot");)k++;if(R===q.length||k===de.length)for(R=q.length-1,k=de.length-1;1<=R&&0<=k&&q[R]!==de[k];)k--;for(;1<=R&&0<=k;R--,k--)if(q[R]!==de[k]){if(R!==1||k!==1)do if(R--,k--,0>k||q[R]!==de[k]){var be=`
22
+ `+q[R].replace(" at new "," at ");return t.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",t.displayName)),typeof t=="function"&&ve.set(t,be),be}while(1<=R&&0<=k);break}}}finally{fe=!1,J.H=T,c(),Error.prepareStackTrace=v}return q=(q=t?t.displayName||t.name:"")?i(q):"",typeof t=="function"&&ve.set(t,q),q}function d(t){if(t==null)return"";if(typeof t=="function"){var x=t.prototype;return h(t,!(!x||!x.isReactComponent))}if(typeof t=="string")return i(t);switch(t){case le:return i("Suspense");case te:return i("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case D:return t=h(t.render,!1),t;case F:return d(t.type);case U:x=t._payload,t=t._init;try{return d(t(x))}catch{}}return""}function p(){var t=J.A;return t===null?null:t.getOwner()}function S(t){if(W.call(t,"key")){var x=Object.getOwnPropertyDescriptor(t,"key").get;if(x&&x.isReactWarning)return!1}return t.key!==void 0}function C(t,x){function v(){ze||(ze=!0,console.error("%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)",x))}v.isReactWarning=!0,Object.defineProperty(t,"key",{get:v,configurable:!0})}function m(){var t=e(this.type);return De[t]||(De[t]=!0,console.error("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.")),t=this.props.ref,t!==void 0?t:null}function f(t,x,v,T,B,R){return v=R.ref,t={$$typeof:E,type:t,key:x,props:R,_owner:B},(v!==void 0?v:null)!==null?Object.defineProperty(t,"ref",{enumerable:!1,get:m}):Object.defineProperty(t,"ref",{enumerable:!1,value:null}),t._store={},Object.defineProperty(t._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(t,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze(t.props),Object.freeze(t)),t}function w(t,x,v,T,B,R){if(typeof t=="string"||typeof t=="function"||t===L||t===z||t===A||t===le||t===te||t===X||typeof t=="object"&&t!==null&&(t.$$typeof===U||t.$$typeof===F||t.$$typeof===H||t.$$typeof===G||t.$$typeof===D||t.$$typeof===xe||t.getModuleId!==void 0)){var k=x.children;if(k!==void 0)if(T)if(ie(k)){for(T=0;T<k.length;T++)g(k[T],t);Object.freeze&&Object.freeze(k)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(k,t)}else k="",(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(k+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),t===null?T="null":ie(t)?T="array":t!==void 0&&t.$$typeof===E?(T="<"+(e(t.type)||"Unknown")+" />",k=" Did you accidentally export a JSX literal instead of a component?"):T=typeof t,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",T,k);if(W.call(x,"key")){k=e(t);var K=Object.keys(x).filter(function(q){return q!=="key"});T=0<K.length?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}",Be[k+T]||(K=0<K.length?"{"+K.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
23
23
  let props = %s;
24
24
  <%s {...props} />
25
25
  React keys must be passed directly to JSX without using spread:
26
26
  let props = %s;
27
- <%s key={someKey} {...props} />`,R,O,K,O),De[O+R]=!0)}if(O=null,b!==void 0&&(s(b),O=""+b),j(x)&&(s(x.key),O=""+x.key),"key"in x){b={};for(var me in x)me!=="key"&&(b[me]=x[me])}else b=x;return O&&S(b,typeof t=="function"?t.displayName||t.name||"Unknown":t),f(t,O,A,D,g(),b)}function p(t,x){if(typeof t=="object"&&t&&t.$$typeof!==Te){if(le(t))for(var b=0;b<t.length;b++){var R=t[b];w(R)&&v(R,x)}else if(w(t))t._store&&(t._store.validated=1);else if(t===null||typeof t!="object"?b=null:(b=V&&t[V]||t["@@iterator"],b=typeof b=="function"?b:null),typeof b=="function"&&b!==t.entries&&(b=b.call(t),b!==t))for(;!(t=b.next()).done;)w(t.value)&&v(t.value,x)}}function w(t){return typeof t=="object"&&t!==null&&t.$$typeof===C}function v(t,x){if(t._store&&!t._store.validated&&t.key==null&&(t._store.validated=1,x=y(x),!$e[x])){$e[x]=!0;var b="";t&&t._owner!=null&&t._owner!==g()&&(b=null,typeof t._owner.tag=="number"?b=e(t._owner.type):typeof t._owner.name=="string"&&(b=t._owner.name),b=" It was passed a child from "+b+".");var R=J.getCurrentStack;J.getCurrentStack=function(){var D=d(t.type);return R&&(D+=R()||""),D},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',x,b),J.getCurrentStack=R}}function y(t){var x="",b=g();return b&&(b=e(b.type))&&(x=`
27
+ <%s key={someKey} {...props} />`,T,k,K,k),Be[k+T]=!0)}if(k=null,v!==void 0&&(n(v),k=""+v),S(x)&&(n(x.key),k=""+x.key),"key"in x){v={};for(var me in x)me!=="key"&&(v[me]=x[me])}else v=x;return k&&C(v,typeof t=="function"?t.displayName||t.name||"Unknown":t),f(t,k,R,B,p(),v)}function g(t,x){if(typeof t=="object"&&t&&t.$$typeof!==Ae){if(ie(t))for(var v=0;v<t.length;v++){var T=t[v];j(T)&&b(T,x)}else if(j(t))t._store&&(t._store.validated=1);else if(t===null||typeof t!="object"?v=null:(v=Z&&t[Z]||t["@@iterator"],v=typeof v=="function"?v:null),typeof v=="function"&&v!==t.entries&&(v=v.call(t),v!==t))for(;!(t=v.next()).done;)j(t.value)&&b(t.value,x)}}function j(t){return typeof t=="object"&&t!==null&&t.$$typeof===E}function b(t,x){if(t._store&&!t._store.validated&&t.key==null&&(t._store.validated=1,x=y(x),!He[x])){He[x]=!0;var v="";t&&t._owner!=null&&t._owner!==p()&&(v=null,typeof t._owner.tag=="number"?v=e(t._owner.type):typeof t._owner.name=="string"&&(v=t._owner.name),v=" It was passed a child from "+v+".");var T=J.getCurrentStack;J.getCurrentStack=function(){var B=d(t.type);return T&&(B+=T()||""),B},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',x,v),J.getCurrentStack=T}}function y(t){var x="",v=p();return v&&(v=e(v.type))&&(x=`
28
28
 
29
- Check the render method of \``+b+"`."),x||(t=e(t))&&(x=`
29
+ Check the render method of \``+v+"`."),x||(t=e(t))&&(x=`
30
30
 
31
- Check the top-level render call using <`+t+">."),x}var L=l,C=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),$=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),ie=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),V=Symbol.iterator,re=Symbol.for("react.client.reference"),J=L.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,U=Object.assign,xe=Symbol.for("react.client.reference"),le=Array.isArray,oe=0,ce,je,G,M,B,I,ue;a.__reactDisabledLog=!0;var Y,Se,fe=!1,be=new(typeof WeakMap=="function"?WeakMap:Map),Te=Symbol.for("react.client.reference"),ze,_e={},De={},$e={};Ee.Fragment=N,Ee.jsx=function(t,x,b,R,D){return E(t,x,b,!1,R,D)},Ee.jsxs=function(t,x,b,R,D){return E(t,x,b,!0,R,D)}}()),Ee}var He;function vt(){return He||(He=1,process.env.NODE_ENV==="production"?ke.exports=xt():ke.exports=bt()),ke.exports}var n=vt();const Je=l.createContext(),yt=({children:e,defaultComponent:o})=>{const[s,a]=l.useState(!1),[i,u]=l.useState({}),[c,h]=l.useState(o),g={isLoading:s,setIsLoading:a,loadingProps:i,setLoadingProps:u,loadingComponent:c,setLoadingComponent:h,showLoadingFor:(j=2e3,S={})=>{u(S),a(!0),setTimeout(()=>{a(!1)},j)}};return n.jsx(Je.Provider,{value:g,children:e})},he=()=>{const e=l.useContext(Je);if(e===void 0)throw new Error("Non puoi settare il loading");return e},Et="0.0.164",Xe=({errorMessage:e,errorShow:o})=>n.jsx("section",{className:o?"":"hidden",children:n.jsxs("div",{className:"container mx-auto",children:[n.jsx("h1",{className:"text-center text-8xl my-12",children:"Errore"}),n.jsx("pre",{className:"text-xl",children:e})]})}),Ke=l.createContext(),wt=({children:e})=>{const[o,s]=l.useState({}),[a,i]=l.useState(!1),u=l.useRef(!1),c=`Creare un file config.json in public per il corretto funzionamento
31
+ Check the top-level render call using <`+t+">."),x}var N=a,E=Symbol.for("react.transitional.element"),P=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),G=Symbol.for("react.consumer"),H=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),X=Symbol.for("react.offscreen"),Z=Symbol.iterator,re=Symbol.for("react.client.reference"),J=N.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,V=Object.assign,xe=Symbol.for("react.client.reference"),ie=Array.isArray,ne=0,ce,Se,M,_,I,$,ue;s.__reactDisabledLog=!0;var Y,Ce,fe=!1,ve=new(typeof WeakMap=="function"?WeakMap:Map),Ae=Symbol.for("react.client.reference"),ze,De={},Be={},He={};we.Fragment=L,we.jsx=function(t,x,v,T,B){return w(t,x,v,!1,T,B)},we.jsxs=function(t,x,v,T,B){return w(t,x,v,!0,T,B)}}()),we}var Ue;function bt(){return Ue||(Ue=1,process.env.NODE_ENV==="production"?Pe.exports=xt():Pe.exports=vt()),Pe.exports}var o=bt();const Je=a.createContext(),yt=({children:e,defaultComponent:r})=>{const[n,s]=a.useState(!1),[l,c]=a.useState({}),[i,h]=a.useState(r),p={isLoading:n,setIsLoading:s,loadingProps:l,setLoadingProps:c,loadingComponent:i,setLoadingComponent:h,showLoadingFor:(S=2e3,C={})=>{c(C),s(!0),setTimeout(()=>{s(!1)},S)}};return o.jsx(Je.Provider,{value:p,children:e})},he=()=>{const e=a.useContext(Je);if(e===void 0)throw new Error("Non puoi settare il loading");return e},wt="0.0.166",Xe=({errorMessage:e,errorShow:r})=>o.jsx("section",{className:r?"":"hidden",children:o.jsxs("div",{className:"container mx-auto",children:[o.jsx("h1",{className:"text-center text-8xl my-12",children:"Errore"}),o.jsx("pre",{className:"text-xl",children:e})]})}),Ke=a.createContext(),jt=({children:e})=>{const[r,n]=a.useState({}),[s,l]=a.useState(!1),c=a.useRef(!1),i=`Creare un file config.json in public per il corretto funzionamento
32
32
  Esempio di config.json:
33
33
 
34
34
  {
@@ -55,7 +55,7 @@ Esempio di config.json:
55
55
  "backendToken": "",
56
56
  "isDebug": "",
57
57
  "showHeaderButton": ""
58
- }`,h=(p,w)=>{if(!p)return null;let v=sessionStorage.getItem("sessionKey");return v||(v=`${w?w+"-":""}${crypto.randomUUID()}`,sessionStorage.setItem("sessionKey",v)),v},d=()=>{const p=new Date,w=String(p.getDate()).padStart(2,"0"),v=String(p.getMonth()+1).padStart(2,"0"),y=p.getFullYear(),L=String(p.getHours()).padStart(2,"0"),C=String(p.getMinutes()).padStart(2,"0"),k=String(p.getSeconds()).padStart(2,"0");return`${w}/${v}/${y} ${L}:${C}:${k}`},g=(p,w)=>new Promise((v,y)=>{const L=indexedDB.open(p,1);L.onupgradeneeded=C=>{const k=C.target.result;k.objectStoreNames.contains(w)||k.createObjectStore(w,{keyPath:"id"})},L.onsuccess=C=>v(C.target.result),L.onerror=C=>y(C.target.error)}),j=async(p,w,v)=>{const y=await g(p,w);return new Promise((L,C)=>{if(!y){C("Errore: DB non disponibile");return}const k=y==null?void 0:y.transaction(w,"readonly"),N=k==null?void 0:k.objectStore(w),T=N==null?void 0:N.get(v);T.onsuccess=()=>L(T.result),T.onerror=z=>C(z.target.error)})},S=async(p,w,v)=>{const y=await g(p,w);return new Promise((L,C)=>{if(!y){C("Errore: DB non disponibile");return}const k=y==null?void 0:y.transaction(w,"readwrite"),N=k==null?void 0:k.objectStore(w),T=N==null?void 0:N.put(v);T.onsuccess=()=>L(T.result),T.onerror=z=>C(z.target.error)})},m=async(p,w)=>{let v=Date.now(),y;do y=await j(p,w,v),y&&v++;while(y);return v},f=async(p,w,v)=>{v.id||(v.id=await m(p,w)),await S(p,w,v)},E=async()=>{try{const w=await(await fetch("/config.json")).json();let v;w.isDevelopment?v=Et:v=(await(await fetch("/package.json")).json()).version;const y=h(w.hasSessionKey,w.appKey),L={...w,version:v,openIndexedDB:g,getDataIndexedDB:j,setDataIndexedDB:S,generateUniqueId:m,setDataWithAutoId:f,setCurrentDate:d};w.hasSessionKey&&(L.sessionKey=y),s(L)}catch(p){console.error(p),i(!0)}};return l.useEffect(()=>{u.current||(u.current=!0,E())},[]),Object.keys(o).length===0?n.jsx(Xe,{errorShow:a,errorMessage:c}):n.jsx(Ke.Provider,{value:o,children:e})},ee=()=>{const e=l.useContext(Ke);if(e===void 0)throw new Error("Non puoi leggere i config");return e},Ct=e=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...e},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"6ca7e2bf04"},r.createElement("path",{d:"M 265.136719 0 L 375 109.863281 L 375 265.136719 L 265.136719 375 L 109.863281 375 L 0 265.136719 L 0 109.863281 L 109.863281 0 Z M 265.136719 0 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"2c77c820c6"},r.createElement("path",{d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"3d94df7d66"},r.createElement("path",{d:"M 259.804688 12.878906 L 362.121094 115.195312 L 362.121094 259.804688 L 259.804688 362.121094 L 115.195312 362.121094 L 12.878906 259.804688 L 12.878906 115.195312 L 115.195312 12.878906 Z M 259.804688 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"8793709a64"},r.createElement("path",{d:"M 12.878906 12.878906 L 362.109375 12.878906 L 362.109375 362.109375 L 12.878906 362.109375 Z M 12.878906 12.878906 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"fdb3fe29d8"},r.createElement("path",{d:"M 259.796875 12.878906 L 362.109375 115.191406 L 362.109375 259.796875 L 259.796875 362.109375 L 115.191406 362.109375 L 12.878906 259.796875 L 12.878906 115.191406 L 115.191406 12.878906 Z M 259.796875 12.878906 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#6ca7e2bf04)"},r.createElement("rect",{x:-37.5,width:450,fill:"#b91c1c",y:-37.499999,height:449.999989,fillOpacity:1})),r.createElement("g",{clipPath:"url(#2c77c820c6)"},r.createElement("g",{clipPath:"url(#3d94df7d66)"},r.createElement("path",{fill:"#b91c1c",d:"M 12.878906 12.878906 L 362.121094 12.878906 L 362.121094 362.121094 L 12.878906 362.121094 Z M 12.878906 12.878906 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#8793709a64)"},r.createElement("g",{clipPath:"url(#fdb3fe29d8)"},r.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 12.879396, 12.879392)",fill:"none",strokeLinejoin:"miter",d:"M 329.223327 -0.000647072 L 465.640003 136.416029 L 465.640003 329.223333 L 329.223327 465.640009 L 136.416023 465.640009 L -0.000653072 329.223333 L -0.000653072 136.416029 L 136.416023 -0.000647072 Z M 329.223327 -0.000647072 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(111.648432, 267.442446)"},r.createElement("g",null,r.createElement("path",{d:"M 2.828125 0 L 56.25 -79.859375 L 3.046875 -159.609375 L 37.28125 -159.609375 L 75.90625 -98.046875 L 114.53125 -159.609375 L 148.765625 -159.609375 L 95.5625 -79.859375 L 148.984375 0 L 114.765625 0 L 75.671875 -60.65625 L 37.046875 0 Z M 2.828125 0 "}))))),jt=e=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...e},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"30562604dd"},r.createElement("path",{d:"M 187.5 0 C 83.945312 0 0 83.945312 0 187.5 C 0 291.054688 83.945312 375 187.5 375 C 291.054688 375 375 291.054688 375 187.5 C 375 83.945312 291.054688 0 187.5 0 Z M 187.5 0 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"971fcd5f72"},r.createElement("path",{d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"e891a7f57e"},r.createElement("path",{d:"M 187.5 18.570312 C 94.203125 18.570312 18.570312 94.203125 18.570312 187.5 C 18.570312 280.796875 94.203125 356.429688 187.5 356.429688 C 280.796875 356.429688 356.429688 280.796875 356.429688 187.5 C 356.429688 94.203125 280.796875 18.570312 187.5 18.570312 Z M 187.5 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"19a9ddc130"},r.createElement("path",{d:"M 18.570312 18.570312 L 356.070312 18.570312 L 356.070312 356.070312 L 18.570312 356.070312 Z M 18.570312 18.570312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"5e650d5bd0"},r.createElement("path",{d:"M 187.496094 18.570312 C 94.199219 18.570312 18.570312 94.199219 18.570312 187.496094 C 18.570312 280.792969 94.199219 356.421875 187.496094 356.421875 C 280.792969 356.421875 356.421875 280.792969 356.421875 187.496094 C 356.421875 94.199219 280.792969 18.570312 187.496094 18.570312 Z M 187.496094 18.570312 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#30562604dd)"},r.createElement("rect",{x:-37.5,width:450,fill:"#1d4ed8",y:-37.499999,height:449.999989,fillOpacity:1})),r.createElement("g",{clipPath:"url(#971fcd5f72)"},r.createElement("g",{clipPath:"url(#e891a7f57e)"},r.createElement("path",{fill:"#1d4ed8",d:"M 18.570312 18.570312 L 356.429688 18.570312 L 356.429688 356.429688 L 18.570312 356.429688 Z M 18.570312 18.570312 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#19a9ddc130)"},r.createElement("g",{clipPath:"url(#5e650d5bd0)"},r.createElement("path",{strokeLinecap:"butt",transform:"matrix(0.75, 0, 0, 0.75, 18.570291, 18.570286)",fill:"none",strokeLinejoin:"miter",d:"M 225.234419 0.0000349326 C 100.838577 0.0000349326 0.0000289326 100.838583 0.0000289326 225.234425 C 0.0000289326 349.630266 100.838577 450.468815 225.234419 450.468815 C 349.63026 450.468815 450.468809 349.630266 450.468809 225.234425 C 450.468809 100.838583 349.63026 0.0000349326 225.234419 0.0000349326 Z M 225.234419 0.0000349326 ",stroke:"#ffffff",strokeWidth:34,strokeOpacity:1,strokeMiterlimit:4}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(136.121787, 300.837436)"},r.createElement("g",null,r.createElement("path",{d:"M 60 -193.78125 C 54.707031 -193.78125 50.109375 -195.734375 46.203125 -199.640625 C 42.296875 -203.554688 40.34375 -208.15625 40.34375 -213.4375 C 40.34375 -218.726562 42.296875 -223.328125 46.203125 -227.234375 C 50.109375 -231.140625 54.707031 -233.09375 60 -233.09375 C 65.28125 -233.09375 69.875 -231.140625 73.78125 -227.234375 C 77.695312 -223.328125 79.65625 -218.726562 79.65625 -213.4375 C 79.65625 -208.15625 77.695312 -203.554688 73.78125 -199.640625 C 69.875 -195.734375 65.28125 -193.78125 60 -193.78125 Z M 45.171875 4.828125 C 39.191406 4.828125 35.28125 2.414062 33.4375 -2.40625 C 31.601562 -7.238281 30.6875 -13.675781 30.6875 -21.71875 C 30.6875 -34.59375 31.773438 -47.234375 33.953125 -59.640625 C 36.140625 -72.054688 38.328125 -83.894531 40.515625 -95.15625 C 42.703125 -106.425781 43.796875 -116.890625 43.796875 -126.546875 C 43.796875 -129.078125 43.675781 -131.832031 43.4375 -134.8125 C 43.207031 -137.800781 42.632812 -140.101562 41.71875 -141.71875 C 38.039062 -139.414062 33.269531 -135.617188 27.40625 -130.328125 C 21.550781 -125.046875 16.898438 -119.1875 13.453125 -112.75 C 11.835938 -114.363281 11.03125 -116.550781 11.03125 -119.3125 C 11.03125 -123.21875 12.582031 -127.46875 15.6875 -132.0625 C 18.789062 -136.65625 22.925781 -141.078125 28.09375 -145.328125 C 33.269531 -149.585938 38.847656 -153.097656 44.828125 -155.859375 C 50.804688 -158.617188 56.664062 -160 62.40625 -160 C 67.695312 -160 71.085938 -158.734375 72.578125 -156.203125 C 74.078125 -153.671875 74.828125 -150.453125 74.828125 -146.546875 C 74.828125 -140.796875 74.078125 -133.378906 72.578125 -124.296875 C 71.085938 -115.222656 69.363281 -105.515625 67.40625 -95.171875 C 65.457031 -84.828125 63.734375 -74.484375 62.234375 -64.140625 C 60.742188 -53.796875 60 -44.367188 60 -35.859375 C 60 -31.492188 60.226562 -27.414062 60.6875 -23.625 C 61.144531 -19.832031 61.71875 -16.671875 62.40625 -14.140625 C 68.15625 -16.671875 73.613281 -20.40625 78.78125 -25.34375 C 83.957031 -30.28125 87.8125 -34.9375 90.34375 -39.3125 C 91.71875 -37.238281 92.40625 -35.050781 92.40625 -32.75 C 92.40625 -29.070312 90.796875 -25.050781 87.578125 -20.6875 C 84.359375 -16.320312 80.332031 -12.179688 75.5 -8.265625 C 70.675781 -4.359375 65.5625 -1.203125 60.15625 1.203125 C 54.757812 3.617188 49.765625 4.828125 45.171875 4.828125 Z M 45.171875 4.828125 "}))))),St=e=>r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:500,zoomAndPan:"magnify",viewBox:"0 0 375 374.999991",height:500,preserveAspectRatio:"xMidYMid meet",...e},r.createElement("defs",null,r.createElement("g",null),r.createElement("clipPath",{id:"59a10ac27a"},r.createElement("path",{d:"M 17.179688 32.695312 L 360 32.695312 L 360 337.5 L 17.179688 337.5 Z M 17.179688 32.695312 ",clipRule:"nonzero"})),r.createElement("clipPath",{id:"664b27481e"},r.createElement("path",{d:"M 207.042969 43.574219 L 356.394531 304.941406 C 360.242188 311.675781 360.214844 319.953125 356.324219 326.660156 C 352.429688 333.371094 345.257812 337.5 337.5 337.5 L 39.375 337.5 C 31.617188 337.5 24.445312 333.371094 20.554688 326.660156 C 16.660156 319.953125 16.632812 311.675781 20.480469 304.941406 L 169.832031 43.574219 C 173.648438 36.898438 180.746094 32.777344 188.4375 32.777344 C 196.128906 32.777344 203.226562 36.898438 207.042969 43.574219 Z M 207.042969 43.574219 ",clipRule:"nonzero"}))),r.createElement("g",{clipPath:"url(#59a10ac27a)"},r.createElement("g",{clipPath:"url(#664b27481e)"},r.createElement("path",{fill:"#d97706",d:"M 1.875 11.015625 L 375.546875 11.015625 L 375.546875 337.5 L 1.875 337.5 Z M 1.875 11.015625 ",fillOpacity:1,fillRule:"nonzero"}))),r.createElement("g",{fill:"#ffffff",fillOpacity:1},r.createElement("g",{transform:"translate(158.410439, 295.655517)"},r.createElement("g",null,r.createElement("path",{d:"M 46.890625 -63.21875 C 46.890625 -63.21875 46.890625 -64.445312 46.890625 -66.90625 L 46.890625 -176.46875 C 46.890625 -178.925781 46.1875 -180.859375 44.78125 -182.265625 C 43.375 -183.671875 41.441406 -184.375 38.984375 -184.375 L 21.078125 -184.375 C 18.617188 -184.375 16.6875 -183.671875 15.28125 -182.265625 C 13.875 -180.859375 13.171875 -178.925781 13.171875 -176.46875 L 13.171875 -66.90625 C 13.171875 -64.445312 13.875 -62.515625 15.28125 -61.109375 C 16.6875 -59.703125 18.617188 -59 21.078125 -59 L 38.984375 -59 C 41.441406 -59 43.375 -59.703125 44.78125 -61.109375 C 46.1875 -62.515625 46.890625 -63.21875 46.890625 -63.21875 Z M 46.890625 -4.21875 C 46.890625 -4.21875 46.890625 -5.445312 46.890625 -7.90625 L 46.890625 -25.546875 C 46.890625 -28.003906 46.1875 -29.9375 44.78125 -31.34375 C 43.375 -32.75 41.441406 -33.453125 38.984375 -33.453125 L 21.078125 -33.453125 C 18.617188 -33.453125 16.6875 -32.75 15.28125 -31.34375 C 13.875 -29.9375 13.171875 -28.003906 13.171875 -25.546875 L 13.171875 -7.90625 C 13.171875 -5.445312 13.875 -3.515625 15.28125 -2.109375 C 16.6875 -0.703125 18.617188 0 21.078125 0 L 38.984375 0 C 41.441406 0 43.375 -0.703125 44.78125 -2.109375 C 46.1875 -3.515625 46.890625 -4.21875 46.890625 -4.21875 Z M 46.890625 -4.21875 "})))));var Qe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ue=l.createContext&&l.createContext(Qe),Ot=["attr","size","title"];function kt(e,o){if(e==null)return{};var s=Lt(e,o),a,i;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(i=0;i<u.length;i++)a=u[i],!(o.indexOf(a)>=0)&&Object.prototype.propertyIsEnumerable.call(e,a)&&(s[a]=e[a])}return s}function Lt(e,o){if(e==null)return{};var s={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(o.indexOf(a)>=0)continue;s[a]=e[a]}return s}function Le(){return Le=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a])}return e},Le.apply(this,arguments)}function Ye(e,o){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);o&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),s.push.apply(s,a)}return s}function Pe(e){for(var o=1;o<arguments.length;o++){var s=arguments[o]!=null?arguments[o]:{};o%2?Ye(Object(s),!0).forEach(function(a){Pt(e,a,s[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ye(Object(s)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(s,a))})}return e}function Pt(e,o,s){return o=Rt(o),o in e?Object.defineProperty(e,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[o]=s,e}function Rt(e){var o=Nt(e,"string");return typeof o=="symbol"?o:o+""}function Nt(e,o){if(typeof e!="object"||!e)return e;var s=e[Symbol.toPrimitive];if(s!==void 0){var a=s.call(e,o||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(e)}function et(e){return e&&e.map((o,s)=>l.createElement(o.tag,Pe({key:s},o.attr),et(o.child)))}function se(e){return o=>l.createElement(Tt,Le({attr:Pe({},e.attr)},o),et(e.child))}function Tt(e){var o=s=>{var{attr:a,size:i,title:u}=e,c=kt(e,Ot),h=i||s.size||"1em",d;return s.className&&(d=s.className),e.className&&(d=(d?d+" ":"")+e.className),l.createElement("svg",Le({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},s.attr,a,c,{className:d,style:Pe(Pe({color:e.color||s.color},s.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),u&&l.createElement("title",null,u),e.children)};return Ue!==void 0?l.createElement(Ue.Consumer,null,s=>o(s)):o(Qe)}function At(e){return se({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:[]}]})(e)}const tt=l.createContext(),Mt=({children:e})=>{const[o,s]=l.useState(!1),[a,i]=l.useState(),[u,c]=l.useState(),S={showAlert:o,setShowAlert:s,typeAlert:a,setTypeAlert:i,messageAlert:u,setMessageAlert:c,alertConfig:{danger:{bgColor:"bg-danger",textColor:"text-danger-text",buttonBg:"bg-danger",hoverBg:"hover:bg-danger-hover",focusRing:"focus:ring-danger-progress",progressColor:"bg-danger-progress"},info:{bgColor:"bg-info",textColor:"text-info-text",buttonBg:"bg-info",hoverBg:"hover:bg-info-hover",focusRing:"focus:ring-info-progress",progressColor:"bg-info-progress"},success:{bgColor:"bg-success",textColor:"text-success-text",buttonBg:"bg-success",hoverBg:"hover:bg-success-hover",focusRing:"focus:ring-success-progress",progressColor:"bg-success-progress"},warning:{bgColor:"bg-warning",textColor:"text-warning-text",buttonBg:"bg-warning",hoverBg:"hover:bg-warning-hover",focusRing:"focus:ring-warning-progress",progressColor:"bg-warning-progress"}},getIcon:m=>{switch(m){case"danger":return n.jsx(Ct,{className:"w-[20px] h-[20px]"});case"info":return n.jsx(jt,{className:"w-[20px] h-[20px]"});case"success":return n.jsx(At,{className:"text-xl"});case"warning":return n.jsx(St,{className:"w-[20px] h-[20px]"})}},closeAlert:()=>{s(!o)},activeAlert:(m,f)=>{s(!1),setTimeout(()=>{i(m),c(f),s(!0)},50)}};return n.jsx(tt.Provider,{value:S,children:e})},ae=()=>{const e=l.useContext(tt);if(e===void 0)throw new Error("Non puoi modificare l'alert");return e};let pe;const rt=async(e,o,s,a,i,u)=>{if(pe)return pe;try{const h=await(await fetch("/config.json")).json(),d=h.baseUri,{unauthorized:g,notFound:j,defaultMessage:S}=h.axiosErrors;return pe=Ze.create({baseURL:d}),pe.interceptors.request.use(m=>{const f=JSON.parse(localStorage.getItem("accessToken"));return f?m.headers.Authorization=`Bearer ${f}`:delete m.headers.Authorization,m}),pe.interceptors.response.use(m=>m,m=>{if(m.response)switch(e==null||e(!0),o==null||o("danger"),m.response.status){case 401:localStorage.removeItem("accessToken"),s==null||s(g),a==null||a();break;case 404:s==null||s(j),i==null||i(m);break;default:s==null||s(`${S} ${m.response.status||""} ${m.response.data.error||""}`),u==null||u(m)}return Promise.reject(m)}),pe}catch(c){console.error(c)}},Ae=(e,o)=>{const[s,a]=l.useState(()=>{try{const c=localStorage.getItem(o);return c===null?(localStorage.setItem(o,JSON.stringify(e)),e):JSON.parse(c)}catch(c){return console.error("Errore nel recupero dal localStorage:",c),e}});return[s,c=>{a(h=>{const d=typeof c=="function"?c(h):c;return localStorage.setItem(o,JSON.stringify(d)),d})},(c=!1)=>{c?localStorage.clear():localStorage.removeItem(o),a(e)}]},ge=()=>{const[e,o,s]=Ae(null,"accessToken"),[a,i,u]=Ae(null,"user");return{token:e,user:a,setToken:o,setUser:i,storageLogout:()=>{s(),u()}}},ot=l.createContext(),Bt=({children:e})=>{const{heartbeatEndpoint:o,firstPrivatePath:s,infiniteSession:a,timeDeducted:i,authenticatedEndpoint:u,autoLogin:c,setCurrentDate:h,isDebug:d,backendToken:g,useCustomLoginTimeout:j,stopLoaderOnFinish:S,customLoginTimeout:m,tokenLog:f,timerInfiniteSession:E}=ee(),{setIsLoading:p,showLoadingFor:w}=he(),{setShowAlert:v,setMessageAlert:y,setTypeAlert:L,activeAlert:C}=ae(),{token:k,setToken:N,setUser:T,storageLogout:z}=ge(),Z=P.useNavigate(),[$,_]=l.useState(null),[ie,te]=l.useState(),[q,H]=l.useState(),[X,V]=l.useState(!1),re=async(G=W,M,B)=>await rt(v,L,y,G,M,B),J=async(G=null,M)=>{G&&G.preventDefault(),V(!0);try{j?w(m):p(!0),v(!1);const I=await(await re()).post(u,{auth:M}),ue=I.headers.token,Y=I.data;ue&&(T(Y),N(ue),_(!0),Z(`${s}${Y.id}`))}catch(B){console.error(B),p(!1)}finally{V(!1),!j&&S&&p(!1)}},W=()=>{z(),_(!1)},U=async()=>{try{const B=(await(await re()).get(`${o}`)).headers.token;N(B),d&&console.log("[Auth]: Nuovo token: ",B,"Data:",h())}catch(G){console.error(G),W()}},xe=G=>{const M=G||k;if(!M)return;const B="Token non valido";try{const I=Fe(M);if(!I.exp){f&&console.warn("[Auth]: Token senza data di scadenza, eseguo logout."),W(),C("danger",B);return}const ue=Math.floor(Date.now()/1e3),Y=(I.exp-ue)*1e3;if(Y<=0){f&&console.warn("[Auth]: Token scaduto, eseguo logout."),W(),C("danger",B);return}H(Y),te(Y-i);const Se=Y-i;if(f){const fe=Math.floor(Y/1e3),be=Math.floor(fe/60),Te=fe%60;console.log(`[Auth]: Token valido per ancora: ${be} minuti e ${Te} secondi`),console.log("[Auth]: Token:",k)}return Se}catch(I){f&&console.error("[Auth]: Errore nella decodifica del token:",I),W(),C("danger",B)}},le=G=>{if(!G)return!1;try{const M=Fe(G),B=Math.floor(Date.now()/1e3);return!M.exp||M.exp<B?(console.warn("[Auth]: Token scaduto o non valido"),!1):!0}catch(M){return console.error("[Auth]: Token non valido o corrotto",M),!1}},oe=async G=>{try{const I=(await(await re()).get(o)).data;I&&(T(I),N(G),_(!0),Z(`${s}${I.id}`))}catch(M){console.error(M)}},ce=()=>{le(k)?(f&&console.log("[Auth]: Ricarico pagina → controllo scadenza token"),xe(k)):(f&&console.warn("[Auth]: Token non valido al reload, eseguo logout"),W())};l.useEffect(()=>{if(!le(k)){W();return}_(!0)},[]),l.useEffect(()=>{c&&!$&&!X&&(f&&console.log("[Auth]: Tentativo di autologin con backendToken"),oe(g))},[c,$,X]),l.useEffect(()=>{if(document.readyState==="complete")ce();else return window.addEventListener("load",ce),()=>window.removeEventListener("load",ce)},[]),l.useEffect(()=>{if(c)return;const G=xe(k),M=E||G;f&&console.log("[Auth]: intervallo per il prossimo token:",M);let B;a&&k&&G&&(f&&console.log("[Auth]: Entrato dentro il timer della sessione infinita"),B=setInterval(()=>{U()},M));let I;return!a&&k&&(f&&console.log("[Auth]: Entrato dentro il timer della sessione con scadenza del token"),I=setTimeout(()=>{W(),C("danger","Sessione scaduta")},q)),()=>{B&&clearInterval(B),I&&clearTimeout(I)}},[k,ie]);const je={isAuthenticated:$,setIsAuthenticated:_,login:J,logout:W,createAxiosInstances:re,fetchHeartbeat:U,getTokenExpiry:xe,checkTokenValidity:le,fetchUser:oe,handleLoad:ce};return n.jsx(ot.Provider,{value:je,children:e})},Ce=()=>{const e=l.useContext(ot);if(e===void 0)throw new Error("Non sei dentro al Auth Provider");return e},nt=l.createContext(),Gt=({children:e,publicRoutes:o=[],privateRoutes:s=[]})=>n.jsx(nt.Provider,{value:{publicRoutes:o,privateRoutes:s},children:e}),st=()=>{const e=l.useContext(nt);if(e===void 0)throw new Error(`Errore: Le rotte non sono state inizializzate correttamente.
58
+ }`,h=(g,j)=>{if(!g)return null;let b=sessionStorage.getItem("sessionKey");return b||(b=`${j?j+"-":""}${crypto.randomUUID()}`,sessionStorage.setItem("sessionKey",b)),b},d=()=>{const g=new Date,j=String(g.getDate()).padStart(2,"0"),b=String(g.getMonth()+1).padStart(2,"0"),y=g.getFullYear(),N=String(g.getHours()).padStart(2,"0"),E=String(g.getMinutes()).padStart(2,"0"),P=String(g.getSeconds()).padStart(2,"0");return`${j}/${b}/${y} ${N}:${E}:${P}`},p=(g,j)=>new Promise((b,y)=>{const N=indexedDB.open(g,1);N.onupgradeneeded=E=>{const P=E.target.result;P.objectStoreNames.contains(j)||P.createObjectStore(j,{keyPath:"id"})},N.onsuccess=E=>b(E.target.result),N.onerror=E=>y(E.target.error)}),S=async(g,j,b)=>{const y=await p(g,j);return new Promise((N,E)=>{if(!y){E("Errore: DB non disponibile");return}const P=y==null?void 0:y.transaction(j,"readonly"),L=P==null?void 0:P.objectStore(j),A=L==null?void 0:L.get(b);A.onsuccess=()=>N(A.result),A.onerror=z=>E(z.target.error)})},C=async(g,j,b)=>{const y=await p(g,j);return new Promise((N,E)=>{if(!y){E("Errore: DB non disponibile");return}const P=y==null?void 0:y.transaction(j,"readwrite"),L=P==null?void 0:P.objectStore(j),A=L==null?void 0:L.put(b);A.onsuccess=()=>N(A.result),A.onerror=z=>E(z.target.error)})},m=async(g,j)=>{let b=Date.now(),y;do y=await S(g,j,b),y&&b++;while(y);return b},f=async(g,j,b)=>{b.id||(b.id=await m(g,j)),await C(g,j,b)},w=async()=>{try{const j=await(await fetch("/config.json")).json();let b;j.isDevelopment?b=wt:b=(await(await fetch("/package.json")).json()).version;const y=h(j.hasSessionKey,j.appKey),N={...j,version:b,openIndexedDB:p,getDataIndexedDB:S,setDataIndexedDB:C,generateUniqueId:m,setDataWithAutoId:f,setCurrentDate:d};j.hasSessionKey&&(N.sessionKey=y),n(N)}catch(g){console.error(g),l(!0)}};return a.useEffect(()=>{c.current||(c.current=!0,w())},[]),Object.keys(r).length===0?o.jsx(Xe,{errorShow:s,errorMessage:i}):o.jsx(Ke.Provider,{value:r,children:e})},ee=()=>{const e=a.useContext(Ke);if(e===void 0)throw new Error("Non puoi leggere i config");return e},Et=e=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:500,height:500,viewBox:"0 0 375 375",...e},u.createElement("defs",null,u.createElement("clipPath",{id:"6ca7e2bf04"},u.createElement("path",{d:"M265.137 0 375 109.863v155.274L265.137 375H109.863L0 265.137V109.863L109.863 0Zm0 0"})),u.createElement("clipPath",{id:"2c77c820c6"},u.createElement("path",{d:"M12.879 12.879H362.12V362.12H12.88Zm0 0"})),u.createElement("clipPath",{id:"3d94df7d66"},u.createElement("path",{d:"M259.805 12.879 362.12 115.195v144.61L259.805 362.12h-144.61L12.88 259.805v-144.61L115.195 12.88Zm0 0"})),u.createElement("clipPath",{id:"8793709a64"},u.createElement("path",{d:"M12.879 12.879h349.23v349.23H12.88Zm0 0"})),u.createElement("clipPath",{id:"fdb3fe29d8"},u.createElement("path",{d:"M259.797 12.879 362.109 115.19v144.606L259.797 362.109H115.19L12.88 259.797V115.19L115.19 12.88Zm0 0"}))),u.createElement("g",{clipPath:"url(#6ca7e2bf04)"},u.createElement("path",{fill:"#b91c1c",d:"M-37.5-37.5h450v450h-450z"})),u.createElement("g",{clipPath:"url(#2c77c820c6)"},u.createElement("g",{clipPath:"url(#3d94df7d66)"},u.createElement("path",{fill:"#b91c1c",d:"M12.879 12.879H362.12V362.12H12.88Zm0 0"}))),u.createElement("g",{clipPath:"url(#8793709a64)"},u.createElement("g",{clipPath:"url(#fdb3fe29d8)"},u.createElement("path",{fill:"none",stroke:"#fff",strokeWidth:25.5,d:"M259.797 12.879 362.109 115.19v144.606L259.797 362.109H115.19L12.88 259.797V115.19L115.19 12.88Zm0 0"}))),u.createElement("path",{fill:"#fff",d:"m114.477 267.442 53.421-79.859-53.203-79.75h34.235l38.625 61.563 38.625-61.563h34.234l-53.203 79.75 53.422 79.86h-34.219l-39.094-60.657-38.625 60.656Zm0 0"})),St=e=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:500,height:500,viewBox:"0 0 375 375",...e},u.createElement("defs",null,u.createElement("clipPath",{id:"30562604dd"},u.createElement("path",{d:"M187.5 0C83.945 0 0 83.945 0 187.5S83.945 375 187.5 375 375 291.055 375 187.5 291.055 0 187.5 0m0 0"})),u.createElement("clipPath",{id:"971fcd5f72"},u.createElement("path",{d:"M18.57 18.57h337.86v337.86H18.57Zm0 0"})),u.createElement("clipPath",{id:"e891a7f57e"},u.createElement("path",{d:"M187.5 18.57c-93.297 0-168.93 75.633-168.93 168.93S94.203 356.43 187.5 356.43s168.93-75.633 168.93-168.93S280.797 18.57 187.5 18.57m0 0"})),u.createElement("clipPath",{id:"19a9ddc130"},u.createElement("path",{d:"M18.57 18.57h337.5v337.5H18.57Zm0 0"})),u.createElement("clipPath",{id:"5e650d5bd0"},u.createElement("path",{d:"M187.496 18.57C94.2 18.57 18.57 94.2 18.57 187.496c0 93.297 75.63 168.926 168.926 168.926 93.297 0 168.926-75.629 168.926-168.926S280.793 18.57 187.496 18.57m0 0"}))),u.createElement("g",{clipPath:"url(#30562604dd)"},u.createElement("path",{fill:"#1d4ed8",d:"M-37.5-37.5h450v450h-450z"})),u.createElement("g",{clipPath:"url(#971fcd5f72)"},u.createElement("g",{clipPath:"url(#e891a7f57e)"},u.createElement("path",{fill:"#1d4ed8",d:"M18.57 18.57h337.86v337.86H18.57Zm0 0"}))),u.createElement("g",{clipPath:"url(#19a9ddc130)"},u.createElement("g",{clipPath:"url(#5e650d5bd0)"},u.createElement("path",{fill:"none",stroke:"#fff",strokeWidth:25.5,d:"M187.496 18.57C94.2 18.57 18.57 94.2 18.57 187.496c0 93.297 75.63 168.926 168.926 168.926 93.297 0 168.926-75.629 168.926-168.926S280.793 18.57 187.496 18.57Zm0 0"}))),u.createElement("path",{fill:"#fff",d:"M196.122 107.056q-7.938 0-13.797-5.86c-3.906-3.913-5.86-8.515-5.86-13.796q0-7.936 5.86-13.797 5.858-5.86 13.797-5.86 7.922 0 13.781 5.86c3.914 3.906 5.875 8.508 5.875 13.797 0 5.281-1.96 9.883-5.875 13.797q-5.86 5.86-13.781 5.86m-14.828 198.61c-5.98 0-9.891-2.415-11.735-7.235-1.836-4.832-2.75-11.27-2.75-19.312q-.002-19.313 3.266-37.922a2076 2076 0 0 1 6.562-35.516q3.282-16.906 3.282-31.39 0-3.797-.36-8.266-.346-4.482-1.718-6.906-5.52 3.456-14.313 11.39-8.784 7.922-13.953 17.578-2.424-2.42-2.422-6.562-.001-5.859 4.656-12.75 4.654-6.891 12.407-13.266 7.763-6.389 16.734-10.53 8.964-4.14 17.578-4.142 7.934 0 10.172 3.797 2.25 3.797 2.25 9.657 0 8.626-2.25 22.25a1236 1236 0 0 1-5.172 29.125 745 745 0 0 0-5.172 31.03q-2.236 15.519-2.234 28.282c0 4.367.226 8.445.687 12.234q.687 5.689 1.719 9.485 8.624-3.797 16.375-11.203 7.764-7.406 11.563-13.97 2.062 3.113 2.062 6.563 0 5.52-4.828 12.063-4.83 6.55-12.078 12.422-7.236 5.859-15.344 9.469c-5.398 2.414-10.39 3.625-14.984 3.625m0 0"})),Ct=e=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:500,height:500,viewBox:"0 0 375 375",...e},u.createElement("defs",null,u.createElement("clipPath",{id:"59a10ac27a"},u.createElement("path",{d:"M17.18 32.695H360V337.5H17.18Zm0 0"})),u.createElement("clipPath",{id:"664b27481e"},u.createElement("path",{d:"m207.043 43.574 149.352 261.367a21.77 21.77 0 0 1-.07 21.72A21.76 21.76 0 0 1 337.5 337.5H39.375a21.75 21.75 0 0 1-18.82-10.84 21.76 21.76 0 0 1-.075-21.719L169.832 43.574a21.43 21.43 0 0 1 37.211 0m0 0"}))),u.createElement("g",{clipPath:"url(#59a10ac27a)"},u.createElement("g",{clipPath:"url(#664b27481e)"},u.createElement("path",{fill:"#d97706",d:"M1.875 11.016h373.672V337.5H1.875Zm0 0"}))),u.createElement("path",{fill:"#fff",d:"M205.301 232.437v-113.25q0-3.686-2.11-5.797t-5.796-2.11h-17.906q-3.69 0-5.797 2.11-2.11 2.11-2.11 5.797v109.562c0 2.461.703 4.39 2.11 5.797q2.107 2.11 5.797 2.11h17.906q3.686 0 5.797-2.11zm0 59v-21.328q0-3.687-2.11-5.797t-5.796-2.11h-17.906q-3.69 0-5.797 2.11-2.11 2.11-2.11 5.797v17.64c0 2.461.703 4.39 2.11 5.797q2.107 2.11 5.797 2.11h17.906q3.686 0 5.797-2.11zm0 0"}));var Qe={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ve=a.createContext&&a.createContext(Qe),kt=["attr","size","title"];function Pt(e,r){if(e==null)return{};var n=Nt(e,r),s,l;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(l=0;l<c.length;l++)s=c[l],!(r.indexOf(s)>=0)&&Object.prototype.propertyIsEnumerable.call(e,s)&&(n[s]=e[s])}return n}function Nt(e,r){if(e==null)return{};var n={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if(r.indexOf(s)>=0)continue;n[s]=e[s]}return n}function Ne(){return Ne=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ne.apply(this,arguments)}function Ye(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);r&&(s=s.filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable})),n.push.apply(n,s)}return n}function Oe(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Ye(Object(n),!0).forEach(function(s){Ot(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ye(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Ot(e,r,n){return r=Tt(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Tt(e){var r=Lt(e,"string");return typeof r=="symbol"?r:r+""}function Lt(e,r){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,r||"default");if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function et(e){return e&&e.map((r,n)=>a.createElement(r.tag,Oe({key:n},r.attr),et(r.child)))}function se(e){return r=>a.createElement(At,Ne({attr:Oe({},e.attr)},r),et(e.child))}function At(e){var r=n=>{var{attr:s,size:l,title:c}=e,i=Pt(e,kt),h=l||n.size||"1em",d;return n.className&&(d=n.className),e.className&&(d=(d?d+" ":"")+e.className),a.createElement("svg",Ne({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,s,i,{className:d,style:Oe(Oe({color:e.color||n.color},n.style),e.style),height:h,width:h,xmlns:"http://www.w3.org/2000/svg"}),c&&a.createElement("title",null,c),e.children)};return Ve!==void 0?a.createElement(Ve.Consumer,null,n=>r(n)):r(Qe)}function Rt(e){return se({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:[]}]})(e)}const tt=a.createContext(),_t=({children:e})=>{const[r,n]=a.useState(!1),[s,l]=a.useState(),[c,i]=a.useState(),C={showAlert:r,setShowAlert:n,typeAlert:s,setTypeAlert:l,messageAlert:c,setMessageAlert:i,alertConfig:{danger:{bgColor:"bg-danger",textColor:"text-danger-text",buttonBg:"bg-danger",hoverBg:"hover:bg-danger-hover",focusRing:"focus:ring-danger-progress",progressColor:"bg-danger-progress"},info:{bgColor:"bg-info",textColor:"text-info-text",buttonBg:"bg-info",hoverBg:"hover:bg-info-hover",focusRing:"focus:ring-info-progress",progressColor:"bg-info-progress"},success:{bgColor:"bg-success",textColor:"text-success-text",buttonBg:"bg-success",hoverBg:"hover:bg-success-hover",focusRing:"focus:ring-success-progress",progressColor:"bg-success-progress"},warning:{bgColor:"bg-warning",textColor:"text-warning-text",buttonBg:"bg-warning",hoverBg:"hover:bg-warning-hover",focusRing:"focus:ring-warning-progress",progressColor:"bg-warning-progress"}},getIcon:m=>{switch(m){case"danger":return o.jsx(Et,{className:"w-[20px] h-[20px]"});case"info":return o.jsx(St,{className:"w-[20px] h-[20px]"});case"success":return o.jsx(Rt,{className:"text-xl"});case"warning":return o.jsx(Ct,{className:"w-[20px] h-[20px]"})}},closeAlert:()=>{n(!r)},activeAlert:(m,f)=>{n(!1),setTimeout(()=>{l(m),i(f),n(!0)},50)}};return o.jsx(tt.Provider,{value:C,children:e})},ae=()=>{const e=a.useContext(tt);if(e===void 0)throw new Error("Non puoi modificare l'alert");return e};let ge;const rt=async(e,r,n,s,l,c)=>{if(ge)return ge;try{const h=await(await fetch("/config.json")).json(),d=h.baseUri,{unauthorized:p,notFound:S,defaultMessage:C}=h.axiosErrors;return ge=Ge.create({baseURL:d}),ge.interceptors.request.use(m=>{const f=JSON.parse(localStorage.getItem("accessToken"));return f?m.headers.Authorization=`Bearer ${f}`:delete m.headers.Authorization,m}),ge.interceptors.response.use(m=>m,m=>{if(m.response)switch(e==null||e(!0),r==null||r("danger"),m.response.status){case 401:localStorage.removeItem("accessToken"),n==null||n(p),s==null||s();break;case 404:n==null||n(S),l==null||l(m);break;default:n==null||n(`${C} ${m.response.status||""} ${m.response.data.error||""}`),c==null||c(m)}return Promise.reject(m)}),ge}catch(i){console.error(i)}},Re=(e,r)=>{const[n,s]=a.useState(()=>{try{const i=localStorage.getItem(r);return i===null?(localStorage.setItem(r,JSON.stringify(e)),e):JSON.parse(i)}catch(i){return console.error("Errore nel recupero dal localStorage:",i),e}});return[n,i=>{s(h=>{const d=typeof i=="function"?i(h):i;return localStorage.setItem(r,JSON.stringify(d)),d})},(i=!1)=>{i?localStorage.clear():localStorage.removeItem(r),s(e)}]},pe=()=>{const[e,r,n]=Re(null,"accessToken"),[s,l,c]=Re(null,"user");return{token:e,user:s,setToken:r,setUser:l,storageLogout:()=>{n(),c()}}},nt=a.createContext(),It=({children:e})=>{const{heartbeatEndpoint:r,firstPrivatePath:n,infiniteSession:s,timeDeducted:l,authenticatedEndpoint:c,autoLogin:i,setCurrentDate:h,isDebug:d,backendToken:p,useCustomLoginTimeout:S,stopLoaderOnFinish:C,customLoginTimeout:m,tokenLog:f,timerInfiniteSession:w}=ee(),{setIsLoading:g,showLoadingFor:j}=he(),{setShowAlert:b,setMessageAlert:y,setTypeAlert:N,activeAlert:E}=ae(),{token:P,setToken:L,setUser:A,storageLogout:z}=pe(),G=O.useNavigate(),[H,D]=a.useState(null),[le,te]=a.useState(),[F,U]=a.useState(),[X,Z]=a.useState(!1),re=async(M=W,_,I)=>await rt(b,N,y,M,_,I),J=async(M=null,_)=>{M&&M.preventDefault(),Z(!0);try{S?j(m):g(!0),b(!1);const $=await(await re()).post(c,{auth:_}),ue=$.headers.token,Y=$.data;ue&&(A(Y),L(ue),D(!0),G(`${n}${Y.id}`))}catch(I){console.error(I),g(!1)}finally{Z(!1),!S&&C&&g(!1)}},W=()=>{z(),D(!1)},V=async()=>{try{const I=(await(await re()).get(`${r}`)).headers.token;L(I),d&&console.log("[Auth]: Nuovo token: ",I,"Data:",h())}catch(M){console.error(M),W()}},xe=M=>{const _=M||P;if(!_)return;const I="Token non valido";try{const $=qe(_);if(!$.exp){f&&console.warn("[Auth]: Token senza data di scadenza, eseguo logout."),W(),E("danger",I);return}const ue=Math.floor(Date.now()/1e3),Y=($.exp-ue)*1e3;if(Y<=0){f&&console.warn("[Auth]: Token scaduto, eseguo logout."),W(),E("danger",I);return}U(Y),te(Y-l);const Ce=Y-l;if(f){const fe=Math.floor(Y/1e3),ve=Math.floor(fe/60),Ae=fe%60;console.log(`[Auth]: Token valido per ancora: ${ve} minuti e ${Ae} secondi`),console.log("[Auth]: Token:",P)}return Ce}catch($){f&&console.error("[Auth]: Errore nella decodifica del token:",$),W(),E("danger",I)}},ie=M=>{if(!M)return!1;try{const _=qe(M),I=Math.floor(Date.now()/1e3);return!_.exp||_.exp<I?(console.warn("[Auth]: Token scaduto o non valido"),!1):!0}catch(_){return console.error("[Auth]: Token non valido o corrotto",_),!1}},ne=async M=>{try{const $=(await(await re()).get(r)).data;$&&(A($),L(M),D(!0),G(`${n}${$.id}`))}catch(_){console.error(_)}},ce=()=>{ie(P)?(f&&console.log("[Auth]: Ricarico pagina → controllo scadenza token"),xe(P)):(f&&console.warn("[Auth]: Token non valido al reload, eseguo logout"),W())};a.useEffect(()=>{if(!ie(P)){W();return}D(!0)},[]),a.useEffect(()=>{i&&!H&&!X&&(f&&console.log("[Auth]: Tentativo di autologin con backendToken"),ne(p))},[i,H,X]),a.useEffect(()=>{if(document.readyState==="complete")ce();else return window.addEventListener("load",ce),()=>window.removeEventListener("load",ce)},[]),a.useEffect(()=>{if(i)return;const M=xe(P),_=w||M;f&&console.log("[Auth]: intervallo per il prossimo token:",_);let I;s&&P&&M&&(f&&console.log("[Auth]: Entrato dentro il timer della sessione infinita"),I=setInterval(()=>{V()},_));let $;return!s&&P&&(f&&console.log("[Auth]: Entrato dentro il timer della sessione con scadenza del token"),$=setTimeout(()=>{W(),E("danger","Sessione scaduta")},F)),()=>{I&&clearInterval(I),$&&clearTimeout($)}},[P,le]);const Se={isAuthenticated:H,setIsAuthenticated:D,login:J,logout:W,createAxiosInstances:re,fetchHeartbeat:V,getTokenExpiry:xe,checkTokenValidity:ie,fetchUser:ne,handleLoad:ce};return o.jsx(nt.Provider,{value:Se,children:e})},Ee=()=>{const e=a.useContext(nt);if(e===void 0)throw new Error("Non sei dentro al Auth Provider");return e},ot=a.createContext(),Mt=({children:e,publicRoutes:r=[],privateRoutes:n=[]})=>o.jsx(ot.Provider,{value:{publicRoutes:r,privateRoutes:n},children:e}),st=()=>{const e=a.useContext(ot);if(e===void 0)throw new Error(`Errore: Le rotte non sono state inizializzate correttamente.
59
59
 
60
60
  Soluzione: Assicurati di avvolgere il tuo componente con <RouteProvider>.
61
61
 
@@ -63,4 +63,4 @@ Esempio:
63
63
 
64
64
  <RouteProvider publicRoutes={[]} privateRoutes={[]}>
65
65
  <MyPackageRoutes />
66
- </RouteProvider>`);return e},at=l.createContext(),It=({children:e})=>{const{login:o}=Ce(),{clearLoginFormOnError:s}=ee(),a={email:"",password:""},[i,u]=l.useState("Accedi"),[c,h]=l.useState("Email"),[d,g]=l.useState("email"),[j,S]=l.useState("example@example.it"),[m,f]=l.useState("Accedi"),[E,p]=l.useState(a),[w,v]=l.useState(),[y,L]=l.useState(),[C,k]=l.useState(),[N,T]=l.useState(),[z,Z]=l.useState({}),[$,_]=l.useState(null),q={overrideStyle:z,setOverrideStyle:Z,title:i,setTitle:u,label:c,setLabel:h,type:d,setType:g,placeholder:j,setPlaceholder:S,buttonText:m,setButtonText:f,formData:E,setFormData:p,LogoImg:w,setLogoImg:v,styleCardForm:y,setStyleCardForm:L,styleContainerLogo:C,setStyleContainerLogo:k,styleLogo:N,setStyleLogo:T,changeData:(H,X)=>{p(V=>({...V,[H]:X}))},handleLogin:H=>{o(H,E),s&&p(a)},customVersion:$,setCustomVersion:_};return n.jsx(at.Provider,{value:q,children:e})},Ie=()=>{const e=l.useContext(at);if(e===void 0)throw new Error("Non puoi modificare La login");return e},it=l.createContext(),zt=({children:e})=>{const[o,s]=l.useState(!1),[a,i]=l.useState(null),[u,c]=l.useState(""),[h,d]=l.useState(null),[g,j]=l.useState(null),[S,m]=l.useState(null),[f,E]=l.useState("modal-form"),[p,w]=l.useState("submit"),[v,y]=l.useState({}),[L,C]=l.useState(null),[k,N]=l.useState(null),[T,z]=l.useState(null),Z=({modalData:q,component:H,title:X="",onConfirm:V=null,type:re="submit",formId:J="modal-form",item:W=null,style:U})=>{C(q),i(()=>H),c(X),d(()=>V),w(re),E(J),m(W),y(U),s(!0)},$=()=>{i(null),c(""),d(null),w("submit"),E("modal-form"),m(null),y({}),s(!1),C(null)},te={isOpen:o,openModal:Z,closeModal:$,content:a,title:u,onConfirm:h,type:p,item:S,formId:f,style:v,modalData:L,setModalData:C,handleChange:q=>{const{name:H,value:X}=q.target;C(V=>({...V,[H]:X}))},handleSubmit:q=>{q.preventDefault(),h&&(h(L),$())},headerContent:k,setHeaderContent:N,footerContent:T,setFooterContent:z,onCancel:g,setOnCancel:j};return n.jsx(it.Provider,{value:te,children:e})},lt=()=>{const e=l.useContext(it);if(e===void 0)throw new Error("Non sei all'interno del ModalProvider");return e},ct=(e=[],o="SPOT")=>{const s=P.useLocation();l.useLayoutEffect(()=>{let a=o;for(const i of e)if(P.matchPath({path:i.path,end:!0},s.pathname)){a=i.title;break}document.title=a},[s,e,o])},_t=(e,o,s=1)=>{const a=l.useRef(null),[i,u]=l.useState(!1),c=l.useCallback(f=>new Promise((E,p)=>{if(!a.current){p("DB non pronto");return}const y=a.current.transaction(o,"readonly").objectStore(o).get(f);y.onsuccess=()=>E(y.result),y.onerror=L=>p(L.target.error)}),[o]),h=l.useCallback(()=>new Promise((f,E)=>{if(!a.current)return E("DB non pronto");const v=a.current.transaction(o,"readonly").objectStore(o).getAll();v.onsuccess=()=>f(v.result),v.onerror=y=>E(y.target.error)}),[o]),d=l.useCallback(f=>new Promise((E,p)=>{if(!a.current){p("DB non pronto");return}const y=a.current.transaction(o,"readwrite").objectStore(o).put(f);y.onsuccess=()=>E(y.result),y.onerror=L=>p(L.target.error)}),[o]),g=l.useCallback(async()=>{let f=Date.now();for(;await c(f);)f++;return f},[c]),j=l.useCallback(async f=>(f.id||(f.id=await g()),d(f)),[g,d]),S=l.useCallback(f=>new Promise((E,p)=>{if(!a.current){p("DB non pronto");return}const y=a.current.transaction(o,"readwrite").objectStore(o).delete(f);y.onsuccess=()=>E(!0),y.onerror=L=>p(L.target.error)}),[o]),m=l.useCallback(()=>new Promise((f,E)=>{if(!a.current){E("DB non pronto");return}const v=a.current.transaction(o,"readwrite").objectStore(o).clear();v.onsuccess=()=>f(!0),v.onerror=y=>E(y.target.error)}),[o]);return l.useEffect(()=>{const f=indexedDB.open(e,s);return f.onupgradeneeded=E=>{const p=E.target.result;p.objectStoreNames.contains(o)||p.createObjectStore(o,{keyPath:"id"})},f.onsuccess=E=>{a.current=E.target.result,u(!0)},f.onerror=E=>{console.error("IndexedDB error",E.target.error)},()=>{var E;(E=a.current)==null||E.close()}},[e,o,s]),{get:c,getAll:h,set:d,setWithAutoId:j,remove:S,clear:m,isReady:i}};function ut(e){return se({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.355 0-7.898 3.481-7.998 7.812 0.092-3.779 2.966-6.812 6.498-6.812 3.59 0 6.5 3.134 6.5 7 0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-4.418-3.582-8-8-8zM8 16c4.355 0 7.898-3.481 7.998-7.812-0.092 3.779-2.966 6.812-6.498 6.812-3.59 0-6.5-3.134-6.5-7 0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5c0 4.418 3.582 8 8 8z"},child:[]}]})(e)}const dt=()=>{const{loadingProps:e,loadingComponent:o}=he(),{spinner:s=!0,spinnerStyle:a,text:i,textStyle:u,children:c,containerStyle:h,overrideStyle:d={}}=e;return o||n.jsxs("div",{className:d.container||`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-loading-bg z-[999] ${h}`,children:[s&&n.jsx(ut,{className:d.spinner||`text-[20rem] relative animate-spin text-spinner ${a}`}),c||n.jsx("p",{className:d.text||`text-white text-2xl select-none absolute ${u}`,children:i||"Loading..."})]})};function Dt(e){return se({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:[]}]})(e)}const Me=()=>{const{messageAlert:e,typeAlert:o,alertConfig:s,getIcon:a,closeAlert:i}=ae(),{alertTimeout:u}=ee(),[c,h]=l.useState(0),{bgColor:d,textColor:g,buttonBg:j,hoverBg:S,focusRing:m,progressColor:f}=s[o];return l.useEffect(()=>{let E;const w=100/(u/100);E=setInterval(()=>{h(y=>y>=100?(clearInterval(E),100):y+w)},100);const v=setTimeout(()=>{i()},u);return()=>{clearTimeout(v),clearInterval(E)}},[]),n.jsxs("div",{className:`flex items-center p-4 pt-6 ${g} rounded-lg ${d} mx-auto max-sm:min-w-[280px] sm:max-w-1/3 fixed top-[calc(100vh-100px)] sm:right-10 right-1/2 translate-x-1/2 sm:translate-0 z-100`,role:"alert",children:[n.jsx("div",{className:"w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0",children:n.jsx("div",{className:`${f} h-2.5 rounded-t-lg`,style:{width:`${c}%`}})}),a(o),n.jsx("div",{className:"px-4 text-sm font-medium",children:e}),n.jsx("button",{type:"button",className:`ms-auto ${j} rounded-lg focus:ring-2 ${m} p-1.5 ${S} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,title:"Close",onClick:i,children:n.jsx(Dt,{className:"text-xl"})})]})},$t=({onClose:e,onConfirm:o,onCancel:s,type:a,formId:i,style:u})=>{const c=u.resetButton??!0,h=u.confirmButtonText??(a==="delete"?"Elimina":"Salva"),d=u.cancelButtonText??"Annulla",g=u.bgSaveButton??"bg-indigo-600 rounded-lg shadow-md hover:bg-indigo-700 hover:shadow-lg active:bg-indigo-800 text-white",j=u.bgDeleteButton??"bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 text-white",S=u.bgResetButton??"bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 text-white",m=u.bgCancelButton??"text-gray-800 bg-gray-300 rounded-lg shadow-md hover:bg-gray-400 hover:shadow-lg active:bg-gray-500",f=a==="custom"?u.customButtonStyle:null,E={delete:()=>{o==null||o(),e==null||e()},custom:()=>{o==null||o()}};return n.jsxs("footer",{className:"flex items-center justify-between mt-4",children:[n.jsx("button",{onClick:s||e,className:`${m} px-4 py-2 cursor-pointer text-sm font-medium active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:d}),n.jsxs("div",{className:"flex items-center gap-4",children:[a!=="delete"&&c&&n.jsx("button",{type:"reset",form:i,className:`px-4 py-2 cursor-pointer text-sm font-medium ${S} active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:"Reset"}),n.jsx("button",{type:a==="submit"?"submit":"button",form:a==="submit"?i:void 0,onClick:()=>{var p;return(p=E[a])==null?void 0:p.call(E)},className:f||`${a==="delete"?j:g} px-4 py-2 cursor-pointer text-sm font-medium active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:h})]})]})};function Ft(e){return se({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const Wt=({onClose:e,type:o,title:s,name:a,onCancel:i})=>n.jsxs("header",{className:`flex items-center justify-between mb-4 ${o==="delete"?"gap-8":""}`,children:[o==="delete"&&a?n.jsxs("h2",{className:"text-2xl",children:["Sei sicuro di volere eliminare: ",n.jsx("strong",{children:a}),"?"]}):n.jsx("h2",{className:"text-2xl",children:s||"Conferma operazione"}),n.jsx("button",{onClick:i||e,className:"text-gray-500 hover:text-gray-700 cursor-pointer transition-transform duration-150 ease-in-out hover:scale-110 hover:opacity-80 active:scale-95 active:opacity-60","aria-label":"Chiudi modale",children:n.jsx(Ft,{className:"text-2xl"})})]}),qt=({type:e,children:o,item:s,overrideStyle:a})=>n.jsx(n.Fragment,{children:e!=="delete"&&n.jsx("main",{className:a||"my-8 max-h-[600px] overflow-y-auto overflow-x-hidden",children:e==="delete"&&!s?n.jsx("div",{className:"text-red-600 font-semibold",children:"Errore: nessun item selezionato per l'operazione."}):o})}),Ht=({isOpen:e,onClose:o,onCancel:s,title:a,formId:i,children:u,item:c,onConfirm:h,type:d="submit",style:g={},headerContent:j,footerContent:S})=>{const m=l.useRef(null),[f,E]=l.useState(e),p=()=>{e||E(!1)},w=g.width??(d==="delete"?"max-w-md w-auto":"w-full max-w-4xl"),v=g.bgModal??"bg-white",y=g.bgOverlay??"bg-black/50",L=g.zIndex??"z-50";return l.useEffect(()=>{e&&E(!0)},[e]),l.useEffect(()=>{const C=k=>{k.key==="Escape"&&(s?s():o())};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[o,s]),l.useEffect(()=>{var C;if(e){const k=document.activeElement;return(C=m.current)==null||C.focus(),()=>k==null?void 0:k.focus()}},[e]),f?Ve.createPortal(n.jsx("div",{className:`fixed inset-0 ${L} flex items-center justify-center transition-opacity duration-200 ${e?`${y} opacity-100`:"opacity-0"}`,onClick:s||o,onTransitionEnd:p,children:n.jsxs("div",{ref:m,className:`relative ${v} rounded-lg p-6 shadow-xl ${w} transform transition-transform duration-200 ${e?"scale-100 opacity-100":"scale-95 opacity-0"}`,onClick:C=>C.stopPropagation(),role:"dialog","aria-modal":"true",tabIndex:-1,children:[j||n.jsx(Wt,{onClose:o,onCancel:s,type:d,title:a,name:c==null?void 0:c.name}),n.jsx(qt,{type:d,item:c,overrideStyle:g.overrideStyle,children:u}),S||n.jsx($t,{onClose:o,onCancel:s,onConfirm:h,type:d,formId:i,style:g})]})}),document.body):null},ft=e=>{const{isLoading:o}=he(),{showAlert:s}=ae(),{isOpen:a,closeModal:i,onCancel:u,content:c,title:h,onConfirm:d,item:g,type:j,formId:S,style:m,headerContent:f,footerContent:E}=lt(),p=P.useLocation(),{isMain:w=!0,headerComponent:v=null,showHeaderOnLogin:y=!1,headerExcludedRoutes:L=[],footerComponent:C=null,showFooterOnLogin:k=!1,footerExcludedRoutes:N=[]}=e,T=L.some(_=>P.matchPath(_,p.pathname));let z;p.pathname==="/"?z=v&&y:z=v&&!T;const Z=N.some(_=>P.matchPath(_,p.pathname));let $;return p.pathname==="/"?$=C&&k:$=C&&!Z,n.jsxs(n.Fragment,{children:[o&&n.jsx(dt,{}),s&&n.jsx(Me,{}),n.jsx(Ht,{isOpen:a,onClose:i,onCancel:u,title:h,formId:S,onConfirm:d,type:j,item:g,style:m,headerContent:f,footerContent:E,children:c}),z&&v,w?n.jsxs("main",{className:o?"hidden":"",children:[s&&n.jsx(Me,{}),n.jsx(P.Outlet,{})]}):n.jsx(P.Outlet,{}),$&&C]})},Re=e=>{const{inputType:o,inputId:s,inputPlaceholder:a,inputRequired:i,inputValue:u,inputChange:c,inputName:h,autoFocus:d,inputStyle:g,overrideStyle:j,disabled:S}=e,f=["text","email","password","search","tel","url"].includes(o)?o:"text";return n.jsx("input",{type:f,autoFocus:d,id:s,className:j||`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 ${g}`,placeholder:a,required:i??!0,value:u,onChange:c,disabled:S,name:h})},Ne=({label:e,labelId:o,labelStyle:s,overrideStyle:a})=>n.jsx("label",{htmlFor:o,className:a||`show-label mb-1 sm:mb-2 text-input-label font-medium text-color-label ${s}`,children:e}),mt=()=>{const{title:e,label:o,type:s,placeholder:a,buttonText:i,formData:u,changeData:c,handleLogin:h,overrideStyle:d}=Ie();return n.jsxs("form",{onSubmit:h,className:d.form||"form-size",children:[n.jsx("h1",{className:d.title||"text-form-title-size show-title title-position m-form-title",children:e}),n.jsxs("div",{className:d.containerEmail||"flex justify-center flex-col gap-1 m-input-form input-size mx-auto",children:[n.jsx(Ne,{labelId:"user-email",label:o}),n.jsx(Re,{inputType:s,inputId:"user-email",inputPlaceholder:a,inputValue:u.email,inputChange:g=>{c("email",g.target.value)},autoFocus:!0})]}),n.jsxs("div",{className:d.containerPassword||"flex justify-center flex-col gap-1 my-4 input-size mx-auto",children:[n.jsx(Ne,{labelId:"password",label:"Password"}),n.jsx(Re,{inputType:"password",inputId:"password",inputPlaceholder:"Password",inputValue:u.password,inputChange:g=>{c("password",g.target.value)}})]}),n.jsx("div",{className:d.containerButton||"flex button-position items-center m-primary-button",children:n.jsx("button",{className:d.button||"font-bold cursor-pointer shadow-(--shadow-primary) transition-all duration-200 hover:shadow-(--shadow-primary-hover) active:shadow-(--shadow-primary-active) active:translate-y-[2px] p-primary-button rounded-primary-button bg-primary hover:bg-primary-hover text-primary-text",children:i})})]})},pt=({Logo:e})=>{const{styleCardForm:o,styleContainerLogo:s,styleLogo:a,overrideStyle:i,customVersion:u}=Ie(),{firstPrivatePath:c,version:h}=ee(),{token:d,user:g}=ge(),j=P.useNavigate();return l.useEffect(()=>{d&&(g!=null&&g.id)&&j(`${c}${g.id}`)},[]),n.jsxs("section",{id:"login-page",children:[(h||u)&&n.jsx("div",{className:"text-md text-primary absolute top-4 left-4",children:u||h}),n.jsx("div",{className:i.container||"container mx-auto flex items-center justify-center h-screen",children:n.jsxs("div",{className:i.cardForm||`bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${o}`,children:[n.jsx("div",{className:i.containerLogo||`basis-1/2 flex items-center justify-center ${s}`,children:e&&n.jsx(e,{className:i.logo||`login-logo h-full sm:h-auto ${a}`})}),n.jsx(mt,{})]})})]})},we=()=>{const{isAuthenticated:e}=Ce(),{activeAlert:o}=ae(),{autoLogin:s}=ee(),{token:a}=ge();return l.useEffect(()=>{!e&&!a&&!s&&o("danger","Non sei autorizzato")},[]),e===null?null:e?n.jsx(P.Outlet,{}):n.jsx(P.Navigate,{to:"/",replace:!0})},ht=()=>{const{logout:e,createAxiosInstances:o}=Ce(),{usersEndpoint:s}=ee(),{setIsLoading:a}=he(),{activeAlert:i}=ae(),{token:u,user:c}=ge(),[h,d]=l.useState(null),[g,j]=l.useState(!1),S=async()=>{try{if(j(!0),!u){e(),i("danger","Sessione Scaduta");return}const p=(await(await o()).get(`${s}`)).data;d(p)}catch(f){console.error(f),a(!1)}finally{j(!1)}},m=()=>{e(),i("info","Hai effettuato il logout")};return n.jsx("section",{children:n.jsxs("div",{className:"container mx-auto py-8",children:[n.jsxs("div",{className:"flex items-center justify-center gap-8 h-20",children:[n.jsxs("h1",{className:"text-4xl text-center text-slate-800",children:["Email: ",c.email]}),n.jsx("button",{onClick:m,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]",children:"Logout"})]}),n.jsx("div",{className:"flex justify-center items-center my-12 gap-8",children:n.jsx("button",{onClick:S,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)]",disabled:g,children:"Lista degli utenti"})}),n.jsx("div",{className:"flex justify-center items-center",children:h&&n.jsx("ul",{children:h.map(f=>n.jsxs("li",{className:"text-xl my-4",children:[f.id," - ",f.email]},`user-${f.id}`))})})]})})},Ut=e=>r.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",...e},r.createElement("defs",{id:"defs1"},r.createElement("linearGradient",{id:"linearGradient27"},r.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),r.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),r.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),r.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},r.createElement("rect",{style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},id:"rect26",width:108.41262,height:108.41262,x:35.001785,y:83.942337,rx:30,ry:30}),r.createElement("g",{id:"g1",transform:"matrix(0.90701349,0,0,0.90701349,9.3696997,14.003172)",style:{strokeWidth:1.10252}},r.createElement("path",{id:"path272",style:{fill:"#000000",strokeWidth:1.10252},d:"m 103.62373,105.0137 c -0.2695,0.002 -0.78905,0.20889 -1.00345,0.40037 -0.0723,0.0646 -0.21317,0.24236 -0.313,0.39478 l -0.18141,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52343 -1.523699 l -2.7e-4,-9.75061 c -5.1e-4,-10.41143 -0.004,-10.51883 -0.34443,-11.94691 -1.39786,-5.8616 -6.2432,-10.12876 -12.21276,-10.75566 -1.515814,-0.1589 -19.83671,-0.16023 -20.462316,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.360304,1.98933 v 6.52314 l -17.360304,3.10307 14.274817,1.63584 -0.01572,4.90514 -0.01864,5.72665 -0.63026,0.1252 c -1.586894,0.3153 -3.197032,1.06826 -4.528475,2.1172 -2.205268,1.73733 -3.741586,4.44584 -4.052716,7.1446 -0.370335,3.21237 0.552005,6.19841 2.657413,8.60144 1.687848,1.92642 4.173186,3.25989 6.695215,3.59241 v -5.2e-4 c 0.823968,0.10864 2.933749,0.0318 3.671522,-0.13399 0.932239,-0.20951 1.790163,-0.51486 2.636639,-0.93819 2.065707,-1.03314 3.823794,-2.77572 4.827084,-4.78447 0.504382,-1.00984 0.910162,-2.2066 1.026636,-3.02875 l 0.04632,-0.32925 h 9.414169 9.413628 v 0.21364 c 0,0.11749 0.0641,0.46829 0.14251,0.77944 0.90405,3.58952 3.50881,6.4605 6.974649,7.68694 1.34306,0.47527 1.94661,0.56832 3.65554,0.56367 1.31935,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36735,-0.785 6.02631,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.8921 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49462,-0.14278 0.6474,-0.29351 0.90064,-0.70316 0.90064,-1.45738 0,-0.56862 -0.16856,-0.94445 -0.54982,-1.22508 -0.50606,-0.37245 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11582 l -0.11721,-0.59669 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68167,-3.95762 -0.57002,-0.85316 -2.01938,-2.29531 -2.86466,-2.85108 -1.21392,-0.79816 -2.80463,-1.46394 -3.99997,-1.6734 l -0.5016,-0.0876 -0.0181,-21.17061 -0.0178,-21.17036 -0.15424,-0.31167 c -0.25804,-0.52106 -0.8796,-0.9025 -1.46482,-0.8993 z m 9.34091,0.76079 c -1.96193,0 -3.68713,1.06774 -4.53247,2.80552 -0.53635,1.10262 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55566 c 0.62086,1.83041 2.22554,3.17608 4.08307,3.42406 0.24153,0.0323 2.71506,0.0532 5.4965,0.0458 5.70515,-0.0145 5.3423,0.0172 6.54658,-0.57378 0.54778,-0.26881 0.75708,-0.42234 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70949 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26129 0,-4.84593 -0.0122,-5.0614 -0.32764,-5.86224 -0.76424,-1.94014 -2.6134,-3.18671 -4.72693,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87799,1.48961 c -1.03267,0.8192 -1.9166,1.51251 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94697,-1.55885 v -4.12119 -4.12117 z m 2.28928,0.5522 v 3.46322 3.46375 l 1.08417,0.86973 c 0.59637,0.47836 1.10581,0.86085 1.13185,0.85003 0.0261,-0.0108 0.53535,-0.40918 1.13212,-0.88546 l 1.08497,-0.866 -0.0171,-3.42912 -0.0168,-3.42939 -2.19977,-0.0184 z m -47.246903,6.50849 9.196533,0.0248 c 9.138394,0.0246 9.200727,0.0256 9.88912,0.17528 2.276157,0.49507 4.008841,1.42496 5.576421,2.99252 1.56294,1.56292 2.49402,3.26009 3.00157,5.47254 0.15094,0.65777 0.15069,0.6637 0.16943,10.68613 l 0.0189,10.02763 -1.19632,-2.6e-4 -1.19658,-2.6e-4 -2.909674,-2.90889 c -2.148162,-2.14765 -2.999001,-2.95439 -3.251981,-3.08256 l -0.342815,-0.17367 h -9.477299 -9.477299 v -11.60676 z m 44.869453,16.35471 c -0.8458,0 -1.3552,0.0997 -1.97601,0.38599 -1.35181,0.62342 -2.29671,1.66611 -2.77169,3.05885 l -0.18354,0.53889 -0.0203,4.74531 c -0.0228,5.40031 -0.0234,5.39175 0.50346,6.47758 0.5061,1.04314 1.24312,1.77945 2.29621,2.29407 0.34744,0.1698 0.83013,0.35177 1.07325,0.40464 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.004 5.68307,0.0148 6.74876,-0.50692 1.37728,-0.67421 2.29905,-1.80091 2.67474,-3.26982 0.12915,-0.50539 0.13665,-0.78389 0.13665,-5.22267 0,-4.44771 -0.007,-4.7167 -0.13746,-5.23651 -0.23263,-0.92645 -0.63571,-1.63668 -1.31912,-2.32417 -0.51589,-0.519 -0.69084,-0.64491 -1.31831,-0.94858 -0.81757,-0.39568 -1.26328,-0.49681 -2.19099,-0.49681 h -0.64544 v 4.11159 4.11159 l -1.90888,1.51757 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.7e-4,-4.10467 -5.1e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44644 0.004,3.4467 1.05221,0.84416 h 5.1e-4 c 0.57884,0.46404 1.07893,0.84576 1.1116,0.84843 0.0327,0.003 0.55455,-0.39065 1.1601,-0.87373 l 1.10122,-0.87826 v -3.41687 -3.41687 h -2.21709 z m -50.294829,9.49115 h 10.511122 10.511121 l 3.015165,3.00185 c 2.567942,2.55652 3.057622,3.01393 3.300462,3.08282 0.2049,0.0582 1.62307,0.0807 5.03966,0.0807 h 4.754629 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12048,0.19566 -2.647899,0.80928 -3.728799,1.49786 -1.68955,1.07633 -3.11899,2.69978 -3.99411,4.53647 -0.44366,0.93112 -0.88466,2.34132 -0.88466,2.82896 v 0.21524 H 83.533023 74.11886 l -0.04632,-0.32925 c -0.173141,-1.22207 -0.843416,-2.86149 -1.706703,-4.17392 -0.532033,-0.80881 -1.995609,-2.29178 -2.799129,-2.83643 -1.322594,-0.89646 -2.959014,-1.5737 -4.282866,-1.77223 l -0.324987,-0.0488 v -4.66833 z"}),r.createElement("path",{id:"path268",style:{fill:"#ffffff",strokeWidth:1.10252},d:"m 103.6238,103.56164 c -0.26951,0.002 -0.78905,0.20888 -1.00346,0.40036 -0.0723,0.0646 -0.21316,0.24236 -0.313,0.39478 l -0.1814,0.27703 -0.0181,18.06409 -0.0178,18.06382 h -1.52344 -1.523699 l -2.6e-4,-9.7506 c -5.1e-4,-10.41144 -0.004,-10.51884 -0.34443,-11.94692 -1.39786,-5.86159 -6.2432,-10.12876 -12.212765,-10.75566 -1.515813,-0.1589 -19.836715,-0.16022 -20.46231,-0.003 l -0.0017,-0.004 -19.984159,3.5751 18.852043,2.16035 v 6.07801 l -17.36031,3.10307 17.36031,1.98934 v 6.52313 l -17.36031,3.10307 14.274823,1.63584 -0.01572,4.90514 -0.01864,5.72666 -0.630261,0.12519 c -1.586888,0.3153 -3.19702,1.06826 -4.528463,2.1172 -2.205268,1.73733 -3.741592,4.44584 -4.052721,7.1446 -0.370335,3.21237 0.55201,6.19842 2.657412,8.60144 1.687849,1.92642 4.173187,3.25989 6.695216,3.59241 v -5.2e-4 c 0.823962,0.10864 2.933749,0.0318 3.671527,-0.13398 0.932233,-0.20952 1.790157,-0.51486 2.636639,-0.9382 2.065707,-1.03313 3.823794,-2.77572 4.82709,-4.78447 0.504371,-1.00983 0.910151,-2.2066 1.026624,-3.02874 l 0.04632,-0.32925 h 9.414164 9.413621 v 0.21363 c 0,0.11749 0.0641,0.46829 0.14252,0.77944 0.90405,3.58952 3.50882,6.4605 6.974649,7.68695 1.34307,0.47527 1.94662,0.56831 3.65555,0.56366 1.31934,-0.003 1.6122,-0.0248 2.18192,-0.1577 3.36734,-0.785 6.0263,-2.86016 7.51461,-5.86464 0.44078,-0.88981 0.88236,-2.20383 0.97202,-2.89209 l 0.0429,-0.32925 7.18349,-0.002 c 7.08058,-0.002 7.18734,-0.003 7.49463,-0.14278 0.6474,-0.29351 0.90063,-0.70316 0.90063,-1.45737 0,-0.56863 -0.16856,-0.94446 -0.54981,-1.22508 -0.50607,-0.37246 -0.22593,-0.35988 -7.89979,-0.35988 h -7.11583 l -0.11721,-0.5967 c -0.2611,-1.32878 -0.84786,-2.70966 -1.68166,-3.95762 -0.57003,-0.85315 -2.01939,-2.29531 -2.86466,-2.85107 -1.21393,-0.79817 -2.80464,-1.46395 -3.99997,-1.6734 l -0.50159,-0.0876 -0.0181,-21.17061 -0.0179,-21.17036 -0.15424,-0.31166 c -0.25804,-0.52107 -0.8796,-0.90251 -1.46482,-0.8993 z m 9.34091,0.76078 c -1.96194,0 -3.68714,1.06774 -4.53248,2.80552 -0.53635,1.10263 -0.53017,1.02648 -0.50719,6.44296 l 0.0203,4.7802 0.18834,0.55567 c 0.62086,1.8304 2.22555,3.17607 4.08308,3.42406 0.24152,0.0323 2.71505,0.0532 5.4965,0.0458 5.70514,-0.0145 5.34229,0.0172 6.54658,-0.57378 0.54778,-0.2688 0.75707,-0.42233 1.25039,-0.91741 0.48917,-0.4909 0.64889,-0.70948 0.91635,-1.25279 0.53896,-1.09564 0.53516,-1.04438 0.53516,-6.26128 0,-4.84594 -0.0122,-5.06141 -0.32765,-5.86225 -0.76423,-1.94014 -2.6134,-3.18671 -4.72692,-3.18671 h -0.55701 l -0.003,4.13929 -0.003,4.13902 -1.87798,1.48961 c -1.03268,0.8192 -1.9166,1.51252 -1.96429,1.54074 -0.0554,0.0327 -0.79171,-0.51293 -2.03382,-1.50745 l -1.94698,-1.55886 v -4.12117 -4.12118 z m 2.28927,0.55221 v 3.46321 3.46375 l 1.08417,0.86974 c 0.59637,0.47835 1.10582,0.86085 1.13185,0.85002 0.0261,-0.0108 0.53535,-0.40918 1.13213,-0.88545 l 1.08496,-0.86601 -0.0171,-3.42912 -0.0168,-3.42939 -2.19978,-0.0184 z m -47.246901,6.50848 9.196533,0.0248 c 9.138394,0.0247 9.200727,0.0256 9.889125,0.17528 2.276152,0.49507 4.008834,1.42496 5.576414,2.99253 1.56294,1.56292 2.49402,3.26009 3.00158,5.47253 0.15094,0.65777 0.15069,0.6637 0.16942,10.68613 l 0.0189,10.02764 -1.19632,-2.7e-4 -1.19658,-2.6e-4 -2.909672,-2.90888 c -2.148163,-2.14765 -2.999001,-2.9544 -3.251981,-3.08256 l -0.342835,-0.17368 H 77.484375 68.00707 v -11.60675 z m 44.869461,16.35472 c -0.84581,0 -1.35521,0.0997 -1.97602,0.38599 -1.35181,0.62342 -2.29671,1.6661 -2.77169,3.05885 l -0.18354,0.53888 -0.0203,4.74531 c -0.0229,5.40032 -0.0234,5.39175 0.50346,6.47758 0.50611,1.04314 1.24312,1.77945 2.29621,2.29408 0.34744,0.1698 0.83013,0.35177 1.07325,0.40463 h 5.1e-4 c 0.35322,0.0766 1.47942,0.0968 5.60252,0.10015 5.81748,0.005 5.68308,0.0148 6.74876,-0.50692 1.37729,-0.67421 2.29905,-1.8009 2.67474,-3.26982 0.12916,-0.50539 0.13665,-0.78389 0.13665,-5.22266 0,-4.44771 -0.007,-4.7167 -0.13745,-5.23652 -0.23264,-0.92645 -0.63572,-1.63668 -1.31912,-2.32417 -0.5159,-0.519 -0.69084,-0.64491 -1.31832,-0.94858 -0.81757,-0.39568 -1.26328,-0.4968 -2.19098,-0.4968 h -0.64545 v 4.11159 4.11159 l -1.90888,1.51756 c -1.04987,0.83448 -1.93862,1.52747 -1.97495,1.54022 -0.0363,0.0129 -0.93815,-0.6732 -2.00425,-1.52423 l -1.93845,-1.54714 -2.6e-4,-4.10466 -5.2e-4,-4.10493 z m 2.37718,0.55434 0.004,3.44643 0.004,3.4467 1.0522,0.84416 h 5.2e-4 c 0.57883,0.46405 1.07893,0.84577 1.1116,0.84843 0.0327,0.003 0.55454,-0.39065 1.16009,-0.87374 l 1.10122,-0.87825 v -3.41686 -3.41687 h -2.21709 z m -50.294837,9.49114 H 75.47001 85.981126 l 3.015165,3.00185 c 2.56794,2.55652 3.05762,3.01393 3.30046,3.08283 0.20491,0.0582 1.62308,0.0807 5.03966,0.0807 h 4.754639 v 1.5799 1.57938 l -0.53676,0.0938 c -1.12049,0.19566 -2.647909,0.80928 -3.728809,1.49786 -1.68955,1.07634 -3.11898,2.69979 -3.99411,4.53647 -0.44366,0.93112 -0.88465,2.34132 -0.88465,2.82897 v 0.21523 h -9.413636 -9.414164 l -0.04632,-0.32925 c -0.173136,-1.22207 -0.843417,-2.86149 -1.706697,-4.17392 -0.53204,-0.80881 -1.995616,-2.29178 -2.799129,-2.83642 -1.322601,-0.89647 -2.959015,-1.57371 -4.282873,-1.77224 l -0.324986,-0.0487 v -4.66833 z"})),r.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},d:"",id:"path40",transform:"scale(0.26458333)"}))),Yt=e=>{const{publicRoutes:o,privateRoutes:s}=st(),{firstPrivatePath:a,routes:i,defaultTitle:u}=ee();ct(i,u);const{logoImg:c=Ut,pathImg:h="./src/assets/MyWarehouse.svg",firstPrivateElement:d=n.jsx(ht,{}),globalLayout:g,isMain:j,headerComponent:S,showHeaderOnLogin:m,headerExcludedRoutes:f,footerComponent:E,showFooterOnLogin:p,footerExcludedRoutes:w,privateProvider:v,customProvider:y}=e;let L;g==="none"?L=null:l.isValidElement(g)?L=g:L=n.jsx(ft,{isMain:j,headerComponent:S,showHeaderOnLogin:m,headerExcludedRoutes:f,footerComponent:E,showFooterOnLogin:p,footerExcludedRoutes:w});const C=l.useMemo(()=>v?l.cloneElement(v,{},y?l.cloneElement(y,{},n.jsx(we,{children:n.jsx(P.Outlet,{})})):n.jsx(we,{children:n.jsx(P.Outlet,{})})):y?l.cloneElement(y,{},n.jsx(we,{children:n.jsx(P.Outlet,{})})):n.jsx(we,{children:n.jsx(P.Outlet,{})}),[v,y]),k=()=>{const N=document.querySelector("link[rel='icon']");h&&(N.href=h)};return l.useEffect(()=>{k()},[]),n.jsx(P.Routes,{children:n.jsxs(P.Route,{element:L,children:[n.jsxs(P.Route,{path:"/",children:[n.jsx(P.Route,{index:!0,element:n.jsx(pt,{Logo:c})}),o.map((N,T)=>n.jsx(P.Route,{path:N.path,element:N.element},`public-${T}`))]}),n.jsxs(P.Route,{element:C,children:[n.jsx(P.Route,{path:`${a??"/dashboard/"}:id`,element:d}),s.map((N,T)=>n.jsx(P.Route,{path:N.path,element:N.element},`private-${T}`))]})]})})},Zt=({children:e})=>{var i;const{user:o}=ge(),s=P.useLocation(),{activeAlert:a}=ae();return l.useEffect(()=>{(!o||!o.admin)&&a("warning","Non puoi accedere a questa pagina")},[o]),!o||!o.admin?n.jsx(P.Navigate,{to:((i=s.state)==null?void 0:i.from)||"/",replace:!0}):e},Vt=({spinner:e=!0,spinnerStyle:o,text:s,textStyle:a,children:i,containerStyle:u,overrideStyle:c={}})=>n.jsxs("div",{className:c.container||`w-full h-full relative flex items-center justify-center ${u}`,children:[e&&n.jsx(ut,{className:c.spinner||`text-[20rem] animate-spin text-black ${o}`}),i||n.jsx("p",{className:c.text||`text-black text-2xl select-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ${a}`,children:s||"Loading..."})]}),Be=({isTag:e=!1,value:o,label:s,placeholder:a,id:i,onChange:u,error:c=null})=>n.jsxs("div",{className:`flex items-center justify-center relative ${e?"gap-4 mb-2":"gap-1 m-4"}`,children:[n.jsx(Ne,{labelId:i,label:s,overrideStyle:`text-xl font-bold text-color-label ${e?"":"basis-1/3"}`}),n.jsx(Re,{type:"text",inputId:i,inputPlaceholder:a,inputValue:o||"",disabled:e,inputChange:u,overrideStyle:`${e?"w-full":"basis-2/3"} ${c?"border-red-600 focus:ring focus:ring-red-600 focus:border-red-600 focus:shadow-[0_0_0_4px_rgba(255,0,0,0.5)]":""} bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-focus-ring focus:border-spot-rfid-input-border focus:outline-none focus:shadow-spot-rfid-input block w-full p-input`}),c&&n.jsx("p",{className:"text-red-600 text-[13px] absolute bottom-0 left-26 translate-y-[20px]",children:c})]}),Jt=({title:e,showTag:o,value:s,tag:a,showButton:i,handleClick:u})=>n.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${e==="TAG B"?"delay-200":"mb-4"} ${o?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[n.jsx("h2",{className:"text-center mb-2 text-2xl",children:e}),n.jsx(Be,{label:"TID",placeholder:`Leggi ${e}`,id:a?`tid-${a}`:"tid",isTag:!0,value:(s==null?void 0:s.valueTID)||""}),n.jsx(Be,{label:"EPC",placeholder:`Leggi ${e}`,id:a?`epc-${a}`:"epc",isTag:!0,value:(s==null?void 0:s.valueEPC)||""}),!i&&n.jsx("div",{className:"flex items-center justify-center",children:n.jsx("button",{onClick:u,disabled:!(s!=null&&s.valueTID)&&!(s!=null&&s.valueEPC),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",children:"Scrivi tag"})})]});function Xt(e){return se({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:[]}]})(e)}const Kt=({minReadingPower:e,maxReadingPower:o,stepRangePower:s,rangeValue:a,setRangeValue:i,show:u,handleClick:c})=>{const h=(a-e)/(o-e)*100;return n.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${u?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[n.jsx("h2",{className:"text-center my-4 text-2xl",children:"Configurazione Potenza"}),n.jsxs("div",{className:"relative my-12 w-[90%] mx-auto",children:[n.jsx("input",{id:"power",type:"range",min:e,max:o,step:s,value:a,onChange:d=>i(Number(d.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-primary-accent"}),n.jsx("div",{className:"absolute bottom-8 transform -translate-x-1/2 bg-white border border-gray-200 text-sm text-gray-800 py-1 px-2 rounded-lg shadow-md transition-opacity",style:{left:`${h}%`},children:a})]}),n.jsx("div",{className:"flex items-center justify-center my-4",children:n.jsxs("button",{onClick:()=>c(a),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",children:["Salva",n.jsx(Xt,{})]})})]})},Qt=({show:e,isConfigPage:o,handleSelectFile:s})=>n.jsxs("div",{className:`${o?`${e?"opacity-100 translate-y-0 delay-200":"opacity-0 translate-y-10"}`:""} p-4 text-center transition-all duration-700 transform`,children:[n.jsxs("h2",{className:"text-xl my-4",children:["Seleziona il file ",n.jsx("strong",{children:"config.json"})," per recuperare le chiavi univoche del dispositivo"]}),n.jsx("button",{onClick:s,className:"my-4 bg-blue-500 text-white px-4 py-2 rounded-lg",children:"Seleziona file"})]});function er(e){return se({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:[]}]})(e)}function tr(e){return se({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:[]}]})(e)}const rr=e=>r.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",...e},r.createElement("defs",{id:"defs1"},r.createElement("linearGradient",{id:"linearGradient27"},r.createElement("stop",{style:{stopColor:"#ff0000",stopOpacity:1},offset:0,id:"stop27"}),r.createElement("stop",{style:{stopColor:"#ffca00",stopOpacity:.96862745},offset:1,id:"stop28"})),r.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.001785,y1:192.35495,x2:143.4144,y2:83.942337,gradientUnits:"userSpaceOnUse"}),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter90",x:-.059506074,y:-.12477839,width:1.1465613,height:1.3073246},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:1,floodColor:"rgb(0,0,0)",id:"feFlood89"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:.9,id:"feGaussianBlur89"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset89"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite89"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite90"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter147",x:-.31473854,y:-.27257434,width:1.6432813,height:1.5822092},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(255,255,255)",id:"feFlood146"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:9.5,id:"feGaussianBlur146"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:3.1,id:"feOffset146"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite146"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite147"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter385",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood384"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur384"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset384"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite384"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite385"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter387",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood385"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur385"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset385"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite386"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite387"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter389",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood387"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur387"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset387"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite388"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite389"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter391",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood389"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur389"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset389"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite390"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite391"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter393",x:0,y:0,width:1.0518825,height:1.0518825},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood391"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur391"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset391"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite392"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite393"})),r.createElement("filter",{style:{colorInterpolationFilters:"sRGB"},id:"filter395",x:0,y:0,width:1.0112203,height:1.010137},r.createElement("feFlood",{result:"flood",in:"SourceGraphic",floodOpacity:.815686,floodColor:"rgb(105,0,0)",id:"feFlood393"}),r.createElement("feGaussianBlur",{result:"blur",in:"SourceGraphic",stdDeviation:0,id:"feGaussianBlur393"}),r.createElement("feOffset",{result:"offset",in:"blur",dx:1,dy:1,id:"feOffset393"}),r.createElement("feComposite",{result:"comp1",operator:"in",in:"flood",in2:"offset",id:"feComposite394"}),r.createElement("feComposite",{result:"comp2",operator:"over",in:"SourceGraphic",in2:"comp1",id:"feComposite395"}))),r.createElement("g",{id:"layer1",transform:"translate(-35.001785,-83.942337)"},r.createElement("rect",{style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},id:"rect26",width:108.41262,height:108.41262,x:35.001785,y:83.942337,rx:30,ry:30}),r.createElement("g",{id:"g1",transform:"matrix(1.0833532,0,0,1.1590115,-13.020803,-26.50933)",style:{strokeWidth:.892424}},r.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,strokeWidth:0,strokeDasharray:"none"},d:"m 93.82567,176.60265 c -0.16819,-0.0337 -1.83675,-0.44258 -3.70792,-0.90862 -1.87115,-0.46603 -6.89404,-1.70738 -11.16196,-2.75855 -4.26793,-1.05118 -7.88422,-1.94532 -8.03621,-1.98697 -0.38441,-0.10533 -0.67366,-0.35309 -0.84014,-0.71961 -0.13464,-0.29646 -0.14169,-0.67022 -0.14329,-7.58613 l -0.002,-7.27432 -1.58638,-0.3886 c -0.8725,-0.21372 -2.73139,-0.66288 -4.13086,-0.99814 -1.66387,-0.39859 -2.62074,-0.66385 -2.76482,-0.76643 -0.45114,-0.32125 -0.67287,-1.17785 -0.44025,-1.70084 0.0507,-0.11391 1.34784,-1.54136 2.88261,-3.17212 1.53477,-1.63075 3.54737,-3.76898 4.47243,-4.75162 0.92507,-0.98264 1.68195,-1.81314 1.68195,-1.84557 0,-0.0324 -2.0126,-2.19745 -4.47244,-4.81117 -2.45984,-2.61372 -4.51389,-4.8454 -4.56455,-4.95928 -0.12411,-0.27898 -0.12207,-0.80663 0.005,-1.10902 0.1372,-0.32836 0.59041,-0.71699 0.94692,-0.81198 0.15823,-0.0422 1.52621,-0.37262 3.03996,-0.73436 4.23151,-1.01121 12.80468,-3.07938 16.20779,-3.90995 3.11435,-0.76008 3.63105,-0.84103 4.02851,-0.63116 0.11325,0.0598 1.10839,1.07202 2.21144,2.24939 1.10304,1.17736 3.10699,3.30654 4.45322,4.73153 l 2.44769,2.59088 0.578,-0.60313 c 0.73001,-0.76177 7.41013,-7.89063 7.89815,-8.42872 0.53305,-0.58777 1.16446,-0.82568 1.67671,-0.6318 0.0974,0.0368 1.94877,0.48807 4.11427,1.00273 2.1655,0.51466 5.55423,1.32534 7.53051,1.80149 1.97627,0.47615 5.17578,1.24703 7.11002,1.71306 1.93424,0.46603 3.61155,0.88516 3.72738,0.93144 0.43966,0.17561 0.81987,0.81095 0.82108,1.37204 2.3e-4,0.10902 -0.077,0.33848 -0.17159,0.50991 -0.14542,0.26349 -2.63982,2.95379 -7.91983,8.54181 -0.59557,0.63032 -1.07365,1.1737 -1.06238,1.20751 0.0113,0.0338 2.01538,2.1792 4.45357,4.76756 2.43818,2.58836 4.49238,4.83165 4.56486,4.9851 0.23209,0.49134 0.12362,1.1068 -0.26923,1.52754 -0.24489,0.26229 -0.46525,0.35629 -1.27692,0.54472 -0.39945,0.0927 -2.13682,0.50971 -3.86082,0.92658 -1.72399,0.41689 -3.21193,0.77599 -3.30654,0.79802 l -0.17202,0.0401 v 7.21184 c 0,5.18025 -0.0245,7.28504 -0.0869,7.4717 -0.0478,0.14293 -0.17678,0.35764 -0.2867,0.47713 -0.21143,0.22984 -0.69257,0.50905 -0.87722,0.50905 -0.0605,0 -4.19891,1.01172 -9.19638,2.24827 -12.94173,3.20224 -13.80448,3.41153 -14.01743,3.4002 -0.10512,-0.005 -0.32874,-0.0378 -0.49695,-0.0714 z m -0.11468,-14.06316 c 0,-6.93801 -0.0266,-12.61456 -0.059,-12.61456 -0.0324,0 -1.13014,1.1439 -2.43938,2.54202 -5.28868,5.6477 -5.75841,6.13463 -6.04581,6.26705 -0.47758,0.22003 0.50027,0.42347 -8.92509,-1.85672 -2.27062,-0.5493 -4.32623,-1.04513 -4.568,-1.10183 l -0.43961,-0.10308 v 6.97711 6.97712 l 0.97477,0.24011 c 6.05221,1.49085 19.20592,4.74159 20.12595,4.97382 0.65175,0.16452 1.22801,0.30235 1.28057,0.30631 0.0761,0.005 0.0956,-2.56285 0.0956,-12.60735 z m 12.57633,9.85252 c 5.92884,-1.46667 10.85676,-2.68431 10.95094,-2.70586 l 0.17122,-0.0392 0.02,-6.99318 c 0.0176,-6.18688 0.006,-6.98914 -0.0948,-6.95814 -0.0631,0.0192 -1.69723,0.41672 -3.63146,0.88324 -1.93423,0.46652 -4.7209,1.1404 -6.1926,1.49752 -3.65266,0.88632 -3.40635,0.8392 -3.78841,0.72474 -0.18605,-0.0557 -0.46352,-0.23294 -0.65085,-0.41565 -0.17959,-0.17516 -2.03807,-2.14184 -4.12994,-4.37042 -2.09186,-2.22857 -3.83203,-4.06342 -3.86703,-4.07743 -0.035,-0.014 -0.0637,5.65667 -0.0637,12.60152 v 12.627 l 0.24846,-0.0537 c 0.13666,-0.0296 5.09935,-1.25375 11.02819,-2.72042 z M 85.323,156.74825 c 0.88524,-0.91925 7.62622,-8.10235 8.03426,-8.56119 0.16287,-0.18314 0.28328,-0.34442 0.26759,-0.35841 -0.03,-0.0267 -1.29081,-0.3341 -7.0621,-1.72171 -1.93424,-0.46507 -6.15811,-1.48175 -9.38639,-2.25933 l -5.8696,-1.41376 -0.51316,0.55367 c -0.28223,0.30453 -0.80894,0.86331 -1.17046,1.24174 -0.52801,0.55274 -4.33277,4.60748 -6.87086,7.32232 -0.2664,0.28496 -0.46871,0.53377 -0.44956,0.55291 0.0191,0.0191 1.89033,0.48037 4.15819,1.02495 9.93967,2.38676 16.93345,4.07196 17.46425,4.20814 0.31536,0.0809 0.59738,0.14912 0.62671,0.15159 0.0293,0.003 0.37634,-0.33095 0.77113,-0.74092 z m 20.23487,0.40117 c 0.77963,-0.18934 3.86015,-0.93125 6.8456,-1.6487 12.24203,-2.94198 13.98307,-3.36382 14.01498,-3.39573 0.0184,-0.0184 -0.23762,-0.32105 -0.56885,-0.67267 -0.33122,-0.35161 -2.18125,-2.32256 -4.11118,-4.37989 -1.92994,-2.05733 -3.69458,-3.93741 -3.92146,-4.17796 l -0.41248,-0.43738 -6.82004,1.63769 c -3.75102,0.90074 -8.29937,1.99733 -10.10746,2.43686 -1.80808,0.43955 -3.76047,0.911 -4.33864,1.04768 -0.57817,0.13668 -1.05122,0.27733 -1.05122,0.31258 0,0.0599 1.97276,2.17716 6.91891,7.42581 1.1353,1.20474 2.07997,2.19169 2.09925,2.1932 0.0193,0.002 0.67295,-0.15217 1.45259,-0.34149 z m -9.33771,-11.00163 c 0.95365,-0.22729 3.67769,-0.88483 6.05344,-1.46119 4.87911,-1.18367 10.14405,-2.45535 11.25754,-2.7191 0.40997,-0.0971 0.7454,-0.19673 0.7454,-0.22138 0,-0.0412 -2.28027,-0.59973 -11.88826,-2.91197 -1.93424,-0.46549 -4.51448,-1.08925 -5.73389,-1.38617 -1.21941,-0.29689 -2.26871,-0.53817 -2.33178,-0.53618 -0.0631,0.002 -1.3876,0.31307 -2.9434,0.69126 -1.55579,0.37819 -4.05004,0.98158 -5.54275,1.34086 -1.49273,0.35928 -4.43422,1.06949 -6.53664,1.57826 -2.10243,0.50877 -4.07201,0.98326 -4.37687,1.05442 -0.30485,0.0712 -0.55427,0.14798 -0.55427,0.17071 0,0.0227 0.61066,0.18561 1.35702,0.36195 0.74636,0.17635 4.83175,1.16061 9.07865,2.18726 4.2469,1.02663 8.08287,1.95378 8.52439,2.06033 0.4415,0.10653 0.88256,0.19606 0.98013,0.19894 0.0976,0.003 0.95764,-0.18071 1.91129,-0.408 z m -23.17527,-5.5068 c 1.61572,-0.38489 15.1372,-3.64431 18.92683,-4.56241 0.91455,-0.22156 1.66283,-0.42236 1.66283,-0.44621 0,-0.0436 -2.17511,-2.37359 -6.49352,-6.95578 -1.28517,-1.36367 -2.37292,-2.52792 -2.41721,-2.58723 -0.0681,-0.0912 -0.25681,-0.0653 -1.22322,0.16776 -2.15241,0.51909 -10.69795,2.57488 -15.92927,3.83208 -2.87653,0.69131 -5.24697,1.27382 -5.26762,1.29447 -0.0458,0.0458 -0.20983,-0.13182 4.76121,5.15371 2.23,2.37108 4.08206,4.35788 4.11569,4.4151 0.0336,0.0572 0.0744,0.10403 0.0906,0.10403 0.0161,0 0.81435,-0.18698 1.7737,-0.41552 z m 44.72625,0.0168 c 0.66764,-0.72696 2.63332,-2.82289 4.6092,-4.91467 3.5914,-3.80204 4.07433,-4.32272 4.04059,-4.35646 -0.0185,-0.0184 -0.89212,-0.23938 -1.94146,-0.49094 -4.03823,-0.96807 -15.40558,-3.70468 -17.84516,-4.29611 l -2.55819,-0.62019 -0.2247,0.25651 c -0.12359,0.14108 -0.76319,0.82417 -1.42134,1.51797 -0.65816,0.6938 -2.25926,2.39677 -3.55803,3.78436 -1.29877,1.38761 -2.68169,2.85649 -3.07316,3.26419 -0.39148,0.40769 -0.71177,0.77302 -0.71177,0.81184 0,0.081 1.22124,0.38162 13.25883,3.26372 4.83252,1.15702 8.80323,2.1205 8.82382,2.14109 0.10179,0.1018 0.26744,0.003 0.60137,-0.36131 z",id:"path1"}),r.createElement("path",{style:{fill:"#d30000",fillOpacity:1,strokeWidth:.892424},d:"m 94.23704,147.39738 c -0.18923,-0.0768 -0.53591,-0.44038 -0.83007,-0.87064 -0.13792,-0.20172 -0.97955,-1.55209 -1.87028,-3.00083 -6.42775,-10.45449 -9.51471,-15.54702 -9.94927,-16.41318 -0.45927,-0.91546 -0.98193,-2.46434 -1.17845,-3.49236 -0.47774,-2.49897 -0.33475,-4.87936 0.43464,-7.23535 1.18651,-3.63329 3.71304,-6.57746 7.14475,-8.32579 1.32203,-0.67352 2.76073,-1.13624 4.31579,-1.38807 1.01828,-0.16489 3.18289,-0.16489 4.20118,0 2.16477,0.35056 4.09681,1.1098 5.90163,2.31918 3.0314,2.03129 5.22702,5.32107 5.95891,8.92844 0.6233,3.07215 0.29346,6.03826 -0.98629,8.86914 -0.35811,0.79216 -3.66707,6.34467 -7.57053,12.70353 -1.14824,1.87052 -2.60138,4.23855 -3.2292,5.2623 -0.78819,1.28523 -1.26572,1.99215 -1.54284,2.28396 -0.39825,0.41935 -0.51902,0.47365 -0.79997,0.35967 z m 1.26593,-20.98125 c 2.28056,-0.3989 4.20147,-2.0406 4.94879,-4.22949 0.29427,-0.86192 0.38048,-1.47914 0.33067,-2.36733 -0.0986,-1.75805 -0.74937,-3.16136 -2.02879,-4.37485 -1.21602,-1.15336 -2.65543,-1.72396 -4.3489,-1.72396 -1.69143,0 -3.13312,0.57083 -4.34528,1.72052 -0.96303,0.91339 -1.53452,1.85482 -1.86842,3.07793 -0.13092,0.47957 -0.1542,0.7208 -0.15122,1.5671 0.003,0.87328 0.0263,1.08366 0.18354,1.65699 0.55902,2.03928 1.99215,3.61954 3.96302,4.36987 1.03786,0.39512 2.18932,0.5004 3.31659,0.30322 z",id:"path2"}),r.createElement("rect",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeDasharray:"none",paintOrder:"stroke markers fill"},id:"rect2",width:3.538805,height:1.3867109,x:158.63237,y:137.74451,transform:"matrix(0.98806246,0.1540538,-0.46962192,0.88286763,0,0)"}),r.createElement("rect",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeDasharray:"none",paintOrder:"stroke markers fill"},id:"rect3",width:3.1665602,height:1.2219434,x:120.62843,y:170.94601,transform:"matrix(0.98237657,-0.18691248,-0.14496758,0.98943641,0,0)"})),r.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"},d:"",id:"path40",transform:"scale(0.26458333)"}))),or=({Logo:e,logo:o})=>{const{logout:s}=Ce(),{activeAlert:a}=ae(),{autoLogin:i,configRoutes:u,firstPrivateTitle:c,showHeaderButton:h}=ee(),{isLoading:d}=he(),g=P.useLocation(),j=P.useNavigate(),S=()=>{s(),a("info","Hai effettuato il logout")},m=u.find(E=>E.path===g.pathname),f=P.useMatch("home/:id");return n.jsx("header",{className:d?"hidden":"",children:n.jsxs("nav",{className:"header-size flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300",children:[n.jsx("figure",{children:e&&typeof e=="function"?n.jsx(e,{className:"header-logo-size"}):o?n.jsx("img",{src:o,alt:"Logo",className:"header-logo-size"}):n.jsx(rr,{className:"header-logo-size"})}),n.jsx("div",{children:n.jsx("p",{children:(m==null?void 0:m.title)||c})}),n.jsxs("div",{children:[!i&&f&&n.jsx("button",{className:"h-[48px] w-[48px] 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",type:"button",onClick:S,children:n.jsx(er,{className:"text-4xl w-full"})}),!f&&h&&n.jsx("button",{className:"h-[48px] w-[48px] 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",type:"button",onClick:()=>j(-1),children:n.jsx(tr,{className:"text-4xl w-full"})})]})]})})};function nr(e){return se({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M763.024 259.968C718.4 141.536 622.465 66.527 477.553 66.527c-184.384 0-313.392 136.912-324.479 315.536C64.177 410.495.002 501.183.002 603.903c0 125.744 98.848 231.968 215.823 231.968h92.448c17.664 0 32-14.336 32-32 0-17.68-14.336-32-32-32h-92.448c-82.304 0-152.832-76.912-152.832-167.968 0-80.464 56.416-153.056 127.184-165.216l29.04-5.008-2.576-29.328-.24-.368c0-155.872 102.576-273.44 261.152-273.44 127.104 0 198.513 62.624 231.537 169.44l6.847 22.032 23.056.496c118.88 2.496 223.104 98.945 223.104 218.77 0 109.055-72.273 230.591-181.696 230.591h-73.12c-17.664 0-32 14.336-32 32 0 17.68 14.336 32 32 32l72.88-.095c160-4.224 243.344-157.071 243.344-294.495 0-147.712-115.76-265.744-260.48-281.312zM535.985 514.941c-.176-.192-.241-.352-.354-.512l-8.095-8.464c-4.432-4.688-10.336-7.008-16.24-6.976-5.905-.048-11.777 2.288-16.289 6.975l-8.095 8.464c-.16.16-.193.353-.336.513L371.072 642.685c-8.944 9.344-8.944 24.464 0 33.84l8.064 5.471c8.945 9.344 23.44 6.32 32.368-3.024l68.113-75.935v322.432c0 17.664 14.336 32 32 32s32-14.336 32-32V603.34l70.368 77.631c8.944 9.344 23.408 12.369 32.336 3.025l8.064-5.472c8.945-9.376 8.945-24.496 0-33.84z"},child:[]}]})(e)}const sr=e=>{const[o,s]=l.useState(!1),{onFilesSelect:a,id:i="dropzone-file",containerStyle:u="flex items-center justify-center w-full relative h-full",dropzoneStyle:c="flex flex-col items-center justify-center text-body px-6 text-center pt-5 pb-6 pointer-events-none",labelStyle:h=`flex flex-col items-center justify-center w-full h-full rounded-2xl transition-all duration-300 bg-slate-100/80 shadow-lg border border-slate-300 rounded-base cursor-pointer hover:bg-slate-200/80 hover:border-slate-500 hover:shadow-xl ${o?"bg-slate-200/80 border-slate-600 shadow-xl shadow-primary-strong":"border-default-strong"}`,dragActiveStyle:d="absolute w-full h-full top-0 left-0 rounded-2xl border-2 border-primary-strong/70 animate-pulse"}=e,g=l.useCallback(m=>{m.preventDefault(),m.stopPropagation(),console.log("entrato qui"),m.type==="dragenter"||m.type==="dragover"?s(!0):m.type==="dragleave"&&s(!1)},[]),j=l.useCallback(m=>{m.preventDefault(),m.stopPropagation(),s(!1),m.dataTransfer.files&&m.dataTransfer.files.length>0&&(a==null||a(Array.from(m.dataTransfer.files)))},[a]),S=m=>{m.target.files&&m.target.files.length>0&&(a==null||a(Array.from(m.target.files)))};return n.jsxs("div",{className:u,onDragEnter:g,children:[n.jsxs("label",{htmlFor:i,className:h,children:[n.jsxs("div",{className:c,children:[n.jsx(nr,{className:"text-8xl"}),n.jsxs("p",{className:"mb-2",children:[n.jsx("span",{className:"font-semibold",children:"Clicca per caricare"})," o trascina qui i file"]}),n.jsx("p",{className:"text-sm opacity-70",children:"Puoi selezionare più file"})]}),n.jsx("input",{id:i,type:"file",multiple:!0,className:"hidden",onChange:S})]}),o&&n.jsx("div",{className:d,onDragEnter:g,onDragLeave:g,onDragOver:g,onDrop:j})]})},ar=({initial:e=!1,onChange:o})=>{const[s,a]=l.useState(e),i=()=>{a(!s),o&&o(!s)};return n.jsx("button",{onClick:i,className:`w-14 h-6 flex items-center rounded-full p-1 transition-colors cursor-pointer ${s?"bg-blue-500":"bg-gray-300"}`,children:n.jsx("div",{className:`bg-white w-4 h-4 rounded-full shadow-md transform transition-transform ${s?"translate-x-8":"translate-x-0"}`})})},Ge=e=>{const{id:o,name:s,value:a,onChange:i,disabled:u,required:c,labelStyle:h,containerStyle:d,inputStyle:g,title:j,children:S}=e;return n.jsxs("div",{className:d||"flex flex-col gap-1 mx-auto w-full",children:[n.jsx("label",{htmlFor:o,className:h||"mb-1 text-input-label font-medium text-color-label",children:j}),n.jsx("input",{type:"date",id:o,name:s,value:a||"",onChange:i,disabled:u,required:c,className:g||"bg-input-bg border border-input-border rounded-lg text-input-text placeholder:text-input-placeholder rounded-input focus:ring focus:ring-primary focus:border-primary focus:outline-none focus:shadow-[var(--shadow-primary-input)] block w-full h-[43px] p-input disabled:bg-gray-100 disabled:text-gray-400 disabled:cursor-not-allowed disabled:opacity-60"}),S]})},ir=e=>{const{startId:o,endId:s,startName:a,endName:i,startValue:u,endValue:c,onChange:h,disabled:d,required:g,dateError:j,startTitle:S,endTitle:m,startStyle:f,endStyle:E,labelStyle:p,containerStyle:w,startContainerStyle:v,endContainerStyle:y,endDateShow:L=!0,children:C}=e;return n.jsxs("div",{className:w||"flex gap-4 mx-auto w-full mb-4",children:[n.jsx(Ge,{id:o,name:a,value:u,onChange:h,disabled:d,required:g,title:S,labelStyle:p,containerStyle:v,inputStyle:f}),L&&n.jsx(Ge,{id:s,name:i,value:c,onChange:h,disabled:d,required:g,title:m,labelStyle:p,containerStyle:y,inputStyle:E,children:j&&n.jsx("p",{className:"text-red-500 text-[13px] mt-1",children:j})}),C]})};Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>P.BrowserRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>P.Link});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>P.NavLink});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>P.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>P.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>P.Routes});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>P.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>P.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>P.useNavigate});Object.defineProperty(exports,"useParams",{enumerable:!0,get:()=>P.useParams});exports.axios=Ze;exports.ReactDOM=Ve;exports.Alert=Me;exports.AlertProvider=Mt;exports.AuthAdmin=Zt;exports.AuthPage=we;exports.AuthProvider=Bt;exports.CardInputRange=Kt;exports.CardInputTag=Jt;exports.ConfigFileReader=Qt;exports.ConfigProvider=wt;exports.Dashboard=ht;exports.DefaultLayout=ft;exports.ErrorPage=Xe;exports.FileDropzone=sr;exports.Header=or;exports.Input=Re;exports.InputDate=Ge;exports.InputGroup=Be;exports.InputLabel=Ne;exports.InputStartEndDate=ir;exports.Loading=dt;exports.LoadingComponent=Vt;exports.LoadingProvider=yt;exports.Login=pt;exports.LoginForm=mt;exports.LoginFormProvider=It;exports.ModalProvider=zt;exports.PackageRoutes=Yt;exports.RouteProvider=Gt;exports.SwitchRadio=ar;exports.UsePageTitle=ct;exports.fetchAxiosConfig=rt;exports.useAlert=ae;exports.useAuth=Ce;exports.useAuthStorage=ge;exports.useConfig=ee;exports.useIndexedDB=_t;exports.useLoading=he;exports.useLoginForm=Ie;exports.useModal=lt;exports.useRoutesInjection=st;exports.useStorage=Ae;
66
+ </RouteProvider>`);return e},at=a.createContext(),$t=({children:e})=>{const{login:r}=Ee(),{clearLoginFormOnError:n}=ee(),s={email:"",password:""},[l,c]=a.useState("Accedi"),[i,h]=a.useState("Email"),[d,p]=a.useState("email"),[S,C]=a.useState("example@example.it"),[m,f]=a.useState("Accedi"),[w,g]=a.useState(s),[j,b]=a.useState(),[y,N]=a.useState(),[E,P]=a.useState(),[L,A]=a.useState(),[z,G]=a.useState({}),[H,D]=a.useState(null),F={overrideStyle:z,setOverrideStyle:G,title:l,setTitle:c,label:i,setLabel:h,type:d,setType:p,placeholder:S,setPlaceholder:C,buttonText:m,setButtonText:f,formData:w,setFormData:g,LogoImg:j,setLogoImg:b,styleCardForm:y,setStyleCardForm:N,styleContainerLogo:E,setStyleContainerLogo:P,styleLogo:L,setStyleLogo:A,changeData:(U,X)=>{g(Z=>({...Z,[U]:X}))},handleLogin:U=>{r(U,w),n&&g(s)},customVersion:H,setCustomVersion:D};return o.jsx(at.Provider,{value:F,children:e})},$e=()=>{const e=a.useContext(at);if(e===void 0)throw new Error("Non puoi modificare La login");return e},lt=a.createContext(),zt=({children:e})=>{const[r,n]=a.useState(!1),[s,l]=a.useState(null),[c,i]=a.useState(""),[h,d]=a.useState(null),[p,S]=a.useState(null),[C,m]=a.useState(null),[f,w]=a.useState("modal-form"),[g,j]=a.useState("submit"),[b,y]=a.useState({}),[N,E]=a.useState(null),[P,L]=a.useState(null),[A,z]=a.useState(null),G=({modalData:F,component:U,title:X="",onConfirm:Z=null,type:re="submit",formId:J="modal-form",item:W=null,style:V})=>{E(F),l(()=>U),i(X),d(()=>Z),j(re),w(J),m(W),y(V),n(!0)},H=()=>{l(null),i(""),d(null),j("submit"),w("modal-form"),m(null),y({}),n(!1),E(null)},te={isOpen:r,openModal:G,closeModal:H,content:s,title:c,onConfirm:h,type:g,item:C,formId:f,style:b,modalData:N,setModalData:E,handleChange:F=>{const{name:U,value:X}=F.target;E(Z=>({...Z,[U]:X}))},handleSubmit:F=>{F.preventDefault(),h&&(h(N),H())},headerContent:P,setHeaderContent:L,footerContent:A,setFooterContent:z,onCancel:p,setOnCancel:S};return o.jsx(lt.Provider,{value:te,children:e})},it=()=>{const e=a.useContext(lt);if(e===void 0)throw new Error("Non sei all'interno del ModalProvider");return e},ct=(e=[],r="SPOT")=>{const n=O.useLocation();a.useLayoutEffect(()=>{let s=r;for(const l of e)if(O.matchPath({path:l.path,end:!0},n.pathname)){s=l.title;break}document.title=s},[n,e,r])},Dt=(e,r,n=1)=>{const s=a.useRef(null),[l,c]=a.useState(!1),i=a.useCallback(f=>new Promise((w,g)=>{if(!s.current){g("DB non pronto");return}const y=s.current.transaction(r,"readonly").objectStore(r).get(f);y.onsuccess=()=>w(y.result),y.onerror=N=>g(N.target.error)}),[r]),h=a.useCallback(()=>new Promise((f,w)=>{if(!s.current)return w("DB non pronto");const b=s.current.transaction(r,"readonly").objectStore(r).getAll();b.onsuccess=()=>f(b.result),b.onerror=y=>w(y.target.error)}),[r]),d=a.useCallback(f=>new Promise((w,g)=>{if(!s.current){g("DB non pronto");return}const y=s.current.transaction(r,"readwrite").objectStore(r).put(f);y.onsuccess=()=>w(y.result),y.onerror=N=>g(N.target.error)}),[r]),p=a.useCallback(async()=>{let f=Date.now();for(;await i(f);)f++;return f},[i]),S=a.useCallback(async f=>(f.id||(f.id=await p()),d(f)),[p,d]),C=a.useCallback(f=>new Promise((w,g)=>{if(!s.current){g("DB non pronto");return}const y=s.current.transaction(r,"readwrite").objectStore(r).delete(f);y.onsuccess=()=>w(!0),y.onerror=N=>g(N.target.error)}),[r]),m=a.useCallback(()=>new Promise((f,w)=>{if(!s.current){w("DB non pronto");return}const b=s.current.transaction(r,"readwrite").objectStore(r).clear();b.onsuccess=()=>f(!0),b.onerror=y=>w(y.target.error)}),[r]);return a.useEffect(()=>{const f=indexedDB.open(e,n);return f.onupgradeneeded=w=>{const g=w.target.result;g.objectStoreNames.contains(r)||g.createObjectStore(r,{keyPath:"id"})},f.onsuccess=w=>{s.current=w.target.result,c(!0)},f.onerror=w=>{console.error("IndexedDB error",w.target.error)},()=>{var w;(w=s.current)==null||w.close()}},[e,r,n]),{get:i,getAll:h,set:d,setWithAutoId:S,remove:C,clear:m,isReady:l}},Bt=()=>{const[e,r]=a.useState(window.innerWidth>window.innerHeight?"landscape":"portrait");return a.useEffect(()=>{const n=()=>{r(window.innerWidth>window.innerHeight?"landscape":"portrait")};return window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),e};function ut(e){return se({tag:"svg",attr:{version:"1.1",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M8 0c-4.355 0-7.898 3.481-7.998 7.812 0.092-3.779 2.966-6.812 6.498-6.812 3.59 0 6.5 3.134 6.5 7 0 0.828 0.672 1.5 1.5 1.5s1.5-0.672 1.5-1.5c0-4.418-3.582-8-8-8zM8 16c4.355 0 7.898-3.481 7.998-7.812-0.092 3.779-2.966 6.812-6.498 6.812-3.59 0-6.5-3.134-6.5-7 0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5c0 4.418 3.582 8 8 8z"},child:[]}]})(e)}const dt=()=>{const{loadingProps:e,loadingComponent:r}=he(),{spinner:n=!0,spinnerStyle:s,text:l,textStyle:c,children:i,containerStyle:h,overrideStyle:d={}}=e;return r||o.jsxs("div",{className:d.container||`fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-loading-bg z-[999] ${h}`,children:[n&&o.jsx(ut,{className:d.spinner||`text-[20rem] relative animate-spin text-spinner ${s}`}),i||o.jsx("p",{className:d.text||`text-white text-2xl select-none absolute ${c}`,children:l||"Loading..."})]})};function Ht(e){return se({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:[]}]})(e)}const _e=()=>{const{messageAlert:e,typeAlert:r,alertConfig:n,getIcon:s,closeAlert:l}=ae(),{alertTimeout:c}=ee(),[i,h]=a.useState(0),{bgColor:d,textColor:p,buttonBg:S,hoverBg:C,focusRing:m,progressColor:f}=n[r];return a.useEffect(()=>{let w;const j=100/(c/100);w=setInterval(()=>{h(y=>y>=100?(clearInterval(w),100):y+j)},100);const b=setTimeout(()=>{l()},c);return()=>{clearTimeout(b),clearInterval(w)}},[]),o.jsxs("div",{className:` ${d} ${p} flex items-center min-h-[65px] max-h-[100px] p-4 pt-6 rounded-lg mx-auto max-sm:min-w-[240px] sm:max-w-1/3 fixed sm:top-[calc(100vh-100px)] top-[calc(100vh-115px)] sm:right-10 right-1/2 translate-x-1/2 sm:translate-0 z-100`,role:"alert",children:[o.jsx("div",{className:"w-full bg-gray-200 rounded-t-lg overflow-hidden h-2.5 absolute top-0 left-0 right-0",children:o.jsx("div",{className:`${f} h-2.5 rounded-t-lg`,style:{width:`${i}%`}})}),s(r),o.jsx("div",{className:"px-4 text-sm font-medium",children:e}),o.jsx("button",{type:"button",className:`ms-auto ${S} rounded-lg focus:ring-2 ${m} p-1.5 ${C} inline-flex items-center justify-center h-8 w-8 cursor-pointer`,title:"Close",onClick:l,children:o.jsx(Ht,{className:"text-xl"})})]})},qt=({onClose:e,onConfirm:r,onCancel:n,type:s,formId:l,style:c})=>{const i=c.resetButton??!0,h=c.confirmButtonText??(s==="delete"?"Elimina":"Salva"),d=c.cancelButtonText??"Annulla",p=c.bgSaveButton??"bg-indigo-600 rounded-lg shadow-md hover:bg-indigo-700 hover:shadow-lg active:bg-indigo-800 text-white",S=c.bgDeleteButton??"bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 text-white",C=c.bgResetButton??"bg-rose-500 rounded-lg shadow-md hover:bg-rose-600 hover:shadow-lg active:bg-rose-700 text-white",m=c.bgCancelButton??"text-gray-800 bg-gray-300 rounded-lg shadow-md hover:bg-gray-400 hover:shadow-lg active:bg-gray-500",f=s==="custom"?c.customButtonStyle:null,w={delete:()=>{r==null||r(),e==null||e()},custom:()=>{r==null||r()}};return o.jsxs("footer",{className:"flex items-center justify-between mt-4",children:[o.jsx("button",{onClick:n||e,className:`${m} px-4 py-2 cursor-pointer text-sm font-medium active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:d}),o.jsxs("div",{className:"flex items-center gap-4",children:[s!=="delete"&&i&&o.jsx("button",{type:"reset",form:l,className:`px-4 py-2 cursor-pointer text-sm font-medium ${C} active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:"Reset"}),o.jsx("button",{type:s==="submit"?"submit":"button",form:s==="submit"?l:void 0,onClick:()=>{var g;return(g=w[s])==null?void 0:g.call(w)},className:f||`${s==="delete"?S:p} px-4 py-2 cursor-pointer text-sm font-medium active:shadow-sm transition-all duration-150 ease-in-out hover:opacity-90 active:scale-95 active:opacity-70`,children:h})]})]})};function Wt(e){return se({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(e)}const Ft=({onClose:e,type:r,title:n,name:s,onCancel:l})=>o.jsxs("header",{className:`flex items-center justify-between mb-4 ${r==="delete"?"gap-8":""}`,children:[r==="delete"&&s?o.jsxs("h2",{className:"text-2xl",children:["Sei sicuro di volere eliminare: ",o.jsx("strong",{children:s}),"?"]}):o.jsx("h2",{className:"text-2xl",children:n||"Conferma operazione"}),o.jsx("button",{onClick:l||e,className:"text-gray-500 hover:text-gray-700 cursor-pointer transition-transform duration-150 ease-in-out hover:scale-110 hover:opacity-80 active:scale-95 active:opacity-60","aria-label":"Chiudi modale",children:o.jsx(Wt,{className:"text-2xl"})})]}),Ut=({type:e,children:r,item:n,overrideStyle:s})=>o.jsx(o.Fragment,{children:e!=="delete"&&o.jsx("main",{className:s||"my-8 max-h-[600px] overflow-y-auto overflow-x-hidden",children:e==="delete"&&!n?o.jsx("div",{className:"text-red-600 font-semibold",children:"Errore: nessun item selezionato per l'operazione."}):r})}),Vt=({isOpen:e,onClose:r,onCancel:n,title:s,formId:l,children:c,item:i,onConfirm:h,type:d="submit",style:p={},headerContent:S,footerContent:C})=>{const m=a.useRef(null),[f,w]=a.useState(e),g=()=>{e||w(!1)},j=p.width??(d==="delete"?"max-w-md w-auto":"w-full max-w-4xl"),b=p.bgModal??"bg-white",y=p.bgOverlay??"bg-black/50",N=p.zIndex??"z-50";return a.useEffect(()=>{e&&w(!0)},[e]),a.useEffect(()=>{const E=P=>{P.key==="Escape"&&(n?n():r())};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[r,n]),a.useEffect(()=>{var E;if(e){const P=document.activeElement;return(E=m.current)==null||E.focus(),()=>P==null?void 0:P.focus()}},[e]),f?Ze.createPortal(o.jsx("div",{className:`fixed inset-0 ${N} flex items-center justify-center transition-opacity duration-200 ${e?`${y} opacity-100`:"opacity-0"}`,onClick:n||r,onTransitionEnd:g,children:o.jsxs("div",{ref:m,className:`relative ${b} rounded-lg p-6 shadow-xl ${j} transform transition-transform duration-200 ${e?"scale-100 opacity-100":"scale-95 opacity-0"}`,onClick:E=>E.stopPropagation(),role:"dialog","aria-modal":"true",tabIndex:-1,children:[S||o.jsx(Ft,{onClose:r,onCancel:n,type:d,title:s,name:i==null?void 0:i.name}),o.jsx(Ut,{type:d,item:i,overrideStyle:p.overrideStyle,children:c}),C||o.jsx(qt,{onClose:r,onCancel:n,onConfirm:h,type:d,formId:l,style:p})]})}),document.body):null},ft=e=>{const{isLoading:r}=he(),{showAlert:n}=ae(),{isOpen:s,closeModal:l,onCancel:c,content:i,title:h,onConfirm:d,item:p,type:S,formId:C,style:m,headerContent:f,footerContent:w}=it(),g=O.useLocation(),{isMain:j=!0,headerComponent:b=null,showHeaderOnLogin:y=!1,headerExcludedRoutes:N=[],footerComponent:E=null,showFooterOnLogin:P=!1,footerExcludedRoutes:L=[]}=e,A=N.some(D=>O.matchPath(D,g.pathname));let z;g.pathname==="/"?z=b&&y:z=b&&!A;const G=L.some(D=>O.matchPath(D,g.pathname));let H;return g.pathname==="/"?H=E&&P:H=E&&!G,o.jsxs(o.Fragment,{children:[r&&o.jsx(dt,{}),n&&o.jsx(_e,{}),o.jsx(Vt,{isOpen:s,onClose:l,onCancel:c,title:h,formId:C,onConfirm:d,type:S,item:p,style:m,headerContent:f,footerContent:w,children:i}),z&&b,j?o.jsxs("main",{className:r?"hidden":"",children:[n&&o.jsx(_e,{}),o.jsx(O.Outlet,{})]}):o.jsx(O.Outlet,{}),H&&E]})},Te=e=>{const{inputType:r,inputId:n,inputPlaceholder:s,inputRequired:l,inputValue:c,inputChange:i,inputName:h,autoFocus:d,inputStyle:p,overrideStyle:S,disabled:C}=e,f=["text","email","password","search","tel","url"].includes(r)?r:"text";return o.jsx("input",{type:f,autoFocus:d,id:n,className:S||`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}`,placeholder:s,required:l??!0,value:c,onChange:i,disabled:C,name:h})},Le=({label:e,labelId:r,labelStyle:n,overrideStyle:s})=>o.jsx("label",{htmlFor:r,className:s||`show-label mb-1 sm:mb-2 text-input-label font-medium text-color-label ${n}`,children:e}),mt=()=>{const{title:e,label:r,type:n,placeholder:s,buttonText:l,formData:c,changeData:i,handleLogin:h,overrideStyle:d}=$e();return o.jsxs("form",{onSubmit:h,className:d.form||"form-size",children:[o.jsx("h1",{className:d.title||"text-form-title-size show-title title-position m-form-title",children:e}),o.jsxs("div",{className:d.containerEmail||"flex justify-center flex-col gap-1 m-input-form input-size mx-auto",children:[o.jsx(Le,{labelId:"user-email",label:r}),o.jsx(Te,{inputType:n,inputId:"user-email",inputPlaceholder:s,inputValue:c.email,inputChange:p=>{i("email",p.target.value)},autoFocus:!0})]}),o.jsxs("div",{className:d.containerPassword||"flex justify-center flex-col gap-1 my-4 input-size mx-auto",children:[o.jsx(Le,{labelId:"password",label:"Password"}),o.jsx(Te,{inputType:"password",inputId:"password",inputPlaceholder:"Password",inputValue:c.password,inputChange:p=>{i("password",p.target.value)}})]}),o.jsx("div",{className:d.containerButton||"flex button-position items-center m-primary-button",children:o.jsx("button",{className:d.button||"font-bold cursor-pointer shadow-(--shadow-primary) transition-all duration-200 hover:shadow-(--shadow-primary-hover) active:shadow-(--shadow-primary-active) active:translate-y-[2px] p-primary-button rounded-primary-button bg-primary hover:bg-primary-hover text-primary-text",children:l})})]})},gt=({Logo:e})=>{const{styleCardForm:r,styleContainerLogo:n,styleLogo:s,overrideStyle:l,customVersion:c}=$e(),{firstPrivatePath:i,version:h}=ee(),{token:d,user:p}=pe(),S=O.useNavigate();return a.useEffect(()=>{d&&(p!=null&&p.id)&&S(`${i}${p.id}`)},[]),o.jsxs("section",{id:"login-page",children:[(h||c)&&o.jsx("div",{className:"text-md text-primary absolute top-4 left-4",children:c||h}),o.jsx("div",{className:l.container||"container mx-auto flex items-center justify-center h-screen",children:o.jsxs("div",{className:l.cardForm||`bg-form card-style card-size flex flex-col sm:flex-row sm:items-center justify-center ${r}`,children:[o.jsx("div",{className:l.containerLogo||`basis-1/2 flex items-center justify-center ${n}`,children:e&&o.jsx(e,{className:l.logo||`login-logo h-full sm:h-auto ${s}`})}),o.jsx(mt,{})]})})]})},je=()=>{const{isAuthenticated:e}=Ee(),{activeAlert:r}=ae(),{autoLogin:n}=ee(),{token:s}=pe();return a.useEffect(()=>{!e&&!s&&!n&&r("danger","Non sei autorizzato")},[]),e===null?null:e?o.jsx(O.Outlet,{}):o.jsx(O.Navigate,{to:"/",replace:!0})},ht=()=>{const{logout:e,createAxiosInstances:r}=Ee(),{usersEndpoint:n}=ee(),{setIsLoading:s}=he(),{activeAlert:l}=ae(),{token:c,user:i}=pe(),[h,d]=a.useState(null),[p,S]=a.useState(!1),C=async()=>{try{if(S(!0),!c){e(),l("danger","Sessione Scaduta");return}const g=(await(await r()).get(`${n}`)).data;d(g)}catch(f){console.error(f),s(!1)}finally{S(!1)}},m=()=>{e(),l("info","Hai effettuato il logout")};return o.jsx("section",{children:o.jsxs("div",{className:"container mx-auto py-8",children:[o.jsxs("div",{className:"flex items-center justify-center gap-8 h-20",children:[o.jsxs("h1",{className:"text-4xl text-center text-slate-800",children:["Email: ",i.email]}),o.jsx("button",{onClick:m,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]",children:"Logout"})]}),o.jsx("div",{className:"flex justify-center items-center my-12 gap-8",children:o.jsx("button",{onClick:C,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)]",disabled:p,children:"Lista degli utenti"})}),o.jsx("div",{className:"flex justify-center items-center",children:h&&o.jsx("ul",{children:h.map(f=>o.jsxs("li",{className:"text-xl my-4",children:[f.id," - ",f.email]},`user-${f.id}`))})})]})})},Yt=e=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlSpace:"preserve",id:"svg1",width:409.748,height:409.748,viewBox:"0 0 108.413 108.413",...e},u.createElement("defs",{id:"defs1"},u.createElement("linearGradient",{id:"linearGradient27"},u.createElement("stop",{id:"stop27",offset:0,style:{stopColor:"red",stopOpacity:1}}),u.createElement("stop",{id:"stop28",offset:1,style:{stopColor:"#ffca00",stopOpacity:.96862745}})),u.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.002,x2:143.414,y1:192.355,y2:83.942,gradientUnits:"userSpaceOnUse"})),u.createElement("g",{id:"layer1",transform:"translate(-35.002 -83.942)"},u.createElement("rect",{id:"rect26",width:108.413,height:108.413,x:35.002,y:83.942,rx:30,ry:30,style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"}}),u.createElement("g",{id:"g1",style:{strokeWidth:1.10252},transform:"translate(9.37 14.003)scale(.90701)"},u.createElement("path",{id:"path272",d:"M103.624 105.014c-.27.002-.79.209-1.004.4a2.5 2.5 0 0 0-.313.395l-.181.277-.018 18.064-.018 18.064h-3.047v-9.75c0-10.412-.004-10.52-.345-11.948-1.398-5.861-6.243-10.128-12.213-10.755-1.515-.16-19.836-.16-20.462-.003l-.002-.004-19.984 3.575 18.852 2.16v6.078l-17.36 3.103 17.36 1.99v6.523l-17.36 3.103 14.275 1.636-.016 4.905-.019 5.726-.63.126c-1.587.315-3.197 1.068-4.528 2.117-2.206 1.737-3.742 4.446-4.053 7.144-.37 3.213.552 6.199 2.657 8.602 1.688 1.926 4.174 3.26 6.696 3.592.824.108 2.933.031 3.671-.134.932-.21 1.79-.515 2.637-.939 2.065-1.033 3.824-2.775 4.827-4.784.504-1.01.91-2.207 1.026-3.029l.047-.329h18.828v.214c0 .117.064.468.142.78.904 3.589 3.509 6.46 6.975 7.686 1.343.475 1.946.568 3.655.564 1.32-.003 1.612-.025 2.182-.158 3.368-.785 6.026-2.86 7.515-5.865.44-.89.882-2.203.972-2.892l.043-.329 7.183-.002c7.08-.002 7.188-.003 7.495-.143.647-.293.9-.703.9-1.457 0-.569-.168-.945-.55-1.225-.505-.373-.225-.36-7.9-.36h-7.115l-.117-.597c-.261-1.329-.848-2.71-1.682-3.957-.57-.854-2.02-2.296-2.864-2.852-1.214-.798-2.805-1.463-4-1.673l-.502-.088-.018-21.17-.018-21.17-.154-.312c-.258-.521-.88-.903-1.465-.9zm9.34.76c-1.961 0-3.686 1.068-4.532 2.806-.536 1.103-.53 1.026-.507 6.443l.02 4.78.189.556c.62 1.83 2.225 3.176 4.083 3.424.241.032 2.715.053 5.496.046 5.705-.015 5.342.017 6.547-.574.548-.269.757-.422 1.25-.918.49-.49.649-.709.917-1.252.538-1.096.535-1.045.535-6.262 0-4.846-.013-5.061-.328-5.862-.764-1.94-2.613-3.187-4.727-3.187h-.557l-.003 4.14-.003 4.139-1.878 1.49a123 123 0 0 1-1.964 1.54c-.056.033-.792-.513-2.034-1.507l-1.947-1.56v-8.242zm2.29.553v6.927l1.084.87c.596.478 1.106.86 1.132.85s.535-.41 1.132-.886l1.085-.866-.017-3.43-.017-3.429-2.2-.018zm-47.247 6.508 9.197.025c9.138.025 9.2.026 9.889.175 2.276.495 4.009 1.425 5.576 2.993 1.563 1.563 2.494 3.26 3.002 5.472.15.658.15.664.17 10.686l.018 10.028h-2.393l-2.91-2.91c-2.148-2.147-2.999-2.954-3.252-3.082l-.342-.174H68.007v-11.606zm44.87 16.355c-.846 0-1.356.1-1.977.386-1.351.623-2.296 1.666-2.771 3.059l-.184.539-.02 4.745c-.023 5.4-.023 5.392.503 6.478.506 1.043 1.244 1.779 2.297 2.294.347.17.83.351 1.073.404.354.077 1.48.097 5.603.1 5.817.004 5.683.015 6.749-.507 1.377-.674 2.299-1.8 2.674-3.27.13-.505.137-.783.137-5.222 0-4.448-.007-4.717-.137-5.237-.233-.926-.636-1.636-1.32-2.324-.515-.519-.69-.645-1.318-.948-.817-.396-1.263-.497-2.19-.497h-.646v8.223l-1.91 1.518c-1.049.834-1.938 1.527-1.974 1.54s-.938-.673-2.004-1.524l-1.939-1.548v-8.209zm2.377.554.004 3.447.004 3.446 1.052.845c.58.464 1.08.845 1.112.848s.555-.39 1.16-.874l1.101-.878v-6.834h-2.217zm-50.295 9.491H85.98l3.015 3.002c2.568 2.557 3.058 3.014 3.3 3.083.206.058 1.624.08 5.04.08h4.755v3.16l-.537.094c-1.12.195-2.648.81-3.729 1.498-1.69 1.076-3.119 2.7-3.994 4.536-.443.931-.884 2.341-.884 2.83v.214H74.119l-.046-.329c-.174-1.222-.844-2.861-1.707-4.174-.532-.809-1.996-2.292-2.8-2.836-1.322-.897-2.958-1.574-4.282-1.772l-.325-.05v-4.668z",style:{fill:"#000",strokeWidth:1.10252}}),u.createElement("path",{id:"path268",d:"M103.624 103.562c-.27.002-.79.209-1.004.4a2.5 2.5 0 0 0-.313.395l-.181.277-.018 18.064-.018 18.064h-3.047v-9.75c0-10.412-.004-10.52-.345-11.948-1.398-5.861-6.243-10.129-12.213-10.755-1.515-.16-19.836-.16-20.462-.003l-.002-.004-19.984 3.575 18.852 2.16v6.078l-17.36 3.103 17.36 1.99v6.523l-17.36 3.103 14.275 1.635-.016 4.906-.019 5.726-.63.125c-1.587.316-3.197 1.069-4.528 2.118-2.206 1.737-3.742 4.445-4.053 7.144-.37 3.213.552 6.199 2.657 8.602 1.688 1.926 4.174 3.26 6.696 3.592.824.108 2.933.031 3.671-.134.932-.21 1.79-.515 2.637-.939 2.066-1.033 3.824-2.775 4.827-4.784.504-1.01.91-2.207 1.027-3.029l.046-.33h18.828v.215c0 .117.064.468.142.779a10.96 10.96 0 0 0 6.975 7.687c1.343.475 1.946.568 3.655.564 1.32-.003 1.613-.025 2.182-.158 3.368-.785 6.027-2.86 7.515-5.865.44-.89.882-2.204.972-2.892l.043-.33 7.183-.001c7.08-.002 7.188-.003 7.495-.143.647-.293.9-.703.9-1.457 0-.569-.168-.945-.55-1.225-.505-.373-.225-.36-7.899-.36h-7.116l-.117-.597c-.261-1.329-.848-2.71-1.682-3.958-.57-.853-2.02-2.295-2.864-2.85-1.214-.799-2.805-1.465-4-1.674l-.502-.088-.018-21.17-.018-21.17-.154-.312c-.258-.521-.88-.903-1.465-.9zm9.34.76c-1.961 0-3.686 1.068-4.532 2.806-.536 1.103-.53 1.026-.507 6.443l.02 4.78.189.556c.62 1.83 2.225 3.176 4.083 3.424.241.032 2.715.053 5.496.046 5.705-.015 5.343.017 6.547-.574.548-.269.757-.422 1.25-.918.49-.49.65-.709.917-1.252.539-1.096.535-1.045.535-6.262 0-4.846-.012-5.061-.328-5.862-.764-1.94-2.613-3.187-4.727-3.187h-.557l-.003 4.14-.003 4.139-1.878 1.49a116 116 0 0 1-1.964 1.54c-.056.033-.792-.513-2.034-1.507l-1.947-1.56v-8.242zm2.29.553v6.927l1.084.87c.597.478 1.106.86 1.132.85s.535-.41 1.132-.886l1.085-.866-.017-3.43-.017-3.429-2.2-.018zm-47.247 6.508 9.197.025c9.138.025 9.2.026 9.889.175 2.276.495 4.009 1.425 5.576 2.993 1.563 1.563 2.494 3.26 3.002 5.472.15.658.15.664.17 10.686l.018 10.028h-2.393l-2.91-2.91c-2.148-2.147-2.999-2.954-3.252-3.082l-.342-.174H68.007V122.99zm44.87 16.355c-.846 0-1.356.1-1.976.386-1.352.623-2.297 1.666-2.772 3.059l-.184.539-.02 4.745c-.023 5.4-.023 5.392.503 6.477.507 1.044 1.244 1.78 2.297 2.295.347.17.83.351 1.073.404.354.077 1.48.097 5.603.1 5.817.005 5.683.015 6.749-.507 1.377-.674 2.299-1.8 2.674-3.27.13-.505.137-.783.137-5.222 0-4.448-.007-4.717-.137-5.237-.233-.926-.636-1.636-1.32-2.324-.515-.519-.69-.645-1.318-.948-.817-.396-1.263-.497-2.19-.497h-.646v8.223l-1.91 1.518c-1.049.834-1.938 1.527-1.974 1.54s-.938-.673-2.004-1.524l-1.939-1.548v-8.209zm2.377.554.004 3.447.004 3.446 1.052.844c.58.465 1.08.846 1.112.849s.555-.39 1.16-.874l1.101-.878v-6.834h-2.217zm-50.295 9.491H85.98l3.015 3.002c2.568 2.557 3.058 3.014 3.3 3.083.206.058 1.624.08 5.04.08h4.755v3.16l-.537.094c-1.12.195-2.648.809-3.729 1.498-1.69 1.076-3.118 2.7-3.994 4.536-.443.931-.884 2.341-.884 2.83v.214H74.119l-.046-.329c-.174-1.222-.844-2.861-1.707-4.174-.532-.809-1.996-2.292-2.8-2.836-1.322-.897-2.958-1.574-4.282-1.773l-.325-.048v-4.669z",style:{fill:"#fff",strokeWidth:1.10252}})))),Gt=e=>{const{publicRoutes:r,privateRoutes:n}=st(),{firstPrivatePath:s,routes:l,defaultTitle:c}=ee();ct(l,c);const{logoImg:i=Yt,pathImg:h="./src/assets/MyWarehouse.svg",firstPrivateElement:d=o.jsx(ht,{}),globalLayout:p,isMain:S,headerComponent:C,showHeaderOnLogin:m,headerExcludedRoutes:f,footerComponent:w,showFooterOnLogin:g,footerExcludedRoutes:j,privateProvider:b,customProvider:y}=e;let N;p==="none"?N=null:a.isValidElement(p)?N=p:N=o.jsx(ft,{isMain:S,headerComponent:C,showHeaderOnLogin:m,headerExcludedRoutes:f,footerComponent:w,showFooterOnLogin:g,footerExcludedRoutes:j});const E=a.useMemo(()=>b?a.cloneElement(b,{},y?a.cloneElement(y,{},o.jsx(je,{children:o.jsx(O.Outlet,{})})):o.jsx(je,{children:o.jsx(O.Outlet,{})})):y?a.cloneElement(y,{},o.jsx(je,{children:o.jsx(O.Outlet,{})})):o.jsx(je,{children:o.jsx(O.Outlet,{})}),[b,y]),P=()=>{const L=document.querySelector("link[rel='icon']");h&&(L.href=h)};return a.useEffect(()=>{P()},[]),o.jsx(O.Routes,{children:o.jsxs(O.Route,{element:N,children:[o.jsxs(O.Route,{path:"/",children:[o.jsx(O.Route,{index:!0,element:o.jsx(gt,{Logo:i})}),r.map((L,A)=>o.jsx(O.Route,{path:L.path,element:L.element},`public-${A}`))]}),o.jsxs(O.Route,{element:E,children:[o.jsx(O.Route,{path:`${s??"/dashboard/"}:id`,element:d}),n.map((L,A)=>o.jsx(O.Route,{path:L.path,element:L.element},`private-${A}`))]})]})})},Zt=({children:e})=>{var l;const{user:r}=pe(),n=O.useLocation(),{activeAlert:s}=ae();return a.useEffect(()=>{(!r||!r.admin)&&s("warning","Non puoi accedere a questa pagina")},[r]),!r||!r.admin?o.jsx(O.Navigate,{to:((l=n.state)==null?void 0:l.from)||"/",replace:!0}):e},Jt=({spinner:e=!0,spinnerStyle:r,text:n,textStyle:s,children:l,containerStyle:c,overrideStyle:i={}})=>o.jsxs("div",{className:i.container||`w-full h-full relative flex items-center justify-center ${c}`,children:[e&&o.jsx(ut,{className:i.spinner||`text-[20rem] animate-spin text-black ${r}`}),l||o.jsx("p",{className:i.text||`text-black text-2xl select-none absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 ${s}`,children:n||"Loading..."})]}),Ie=({isTag:e=!1,value:r,label:n,placeholder:s,id:l,onChange:c,error:i=null})=>o.jsxs("div",{className:`flex items-center justify-center relative ${e?"gap-4 mb-2":"gap-1 m-4"}`,children:[o.jsx(Le,{labelId:l,label:n,overrideStyle:`text-xl font-bold text-color-label ${e?"":"basis-1/3"}`}),o.jsx(Te,{type:"text",inputId:l,inputPlaceholder:s,inputValue:r||"",disabled:e,inputChange:c,overrideStyle:`${e?"w-full":"basis-2/3"} ${i?"border-red-600 focus:ring focus:ring-red-600 focus:border-red-600 focus:shadow-[0_0_0_4px_rgba(255,0,0,0.5)]":""} bg-input-bg border border-input-border text-input-text text-input-placeholder input-rounded focus:ring focus:ring-focus-ring focus:border-spot-rfid-input-border focus:outline-none focus:shadow-spot-rfid-input block w-full p-input`}),i&&o.jsx("p",{className:"text-red-600 text-[13px] absolute bottom-0 left-26 translate-y-[20px]",children:i})]}),Xt=({title:e,showTag:r,value:n,tag:s,showButton:l,handleClick:c})=>o.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${e==="TAG B"?"delay-200":"mb-4"} ${r?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[o.jsx("h2",{className:"text-center mb-2 text-2xl",children:e}),o.jsx(Ie,{label:"TID",placeholder:`Leggi ${e}`,id:s?`tid-${s}`:"tid",isTag:!0,value:(n==null?void 0:n.valueTID)||""}),o.jsx(Ie,{label:"EPC",placeholder:`Leggi ${e}`,id:s?`epc-${s}`:"epc",isTag:!0,value:(n==null?void 0:n.valueEPC)||""}),!l&&o.jsx("div",{className:"flex items-center justify-center",children:o.jsx("button",{onClick:c,disabled:!(n!=null&&n.valueTID)&&!(n!=null&&n.valueEPC),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",children:"Scrivi tag"})})]});function Kt(e){return se({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:[]}]})(e)}const Qt=({minReadingPower:e,maxReadingPower:r,stepRangePower:n,rangeValue:s,setRangeValue:l,show:c,handleClick:i})=>{const h=(s-e)/(r-e)*100;return o.jsxs("div",{className:`border border-slate-300 rounded-xl p-2 m-2 shadow-xl transition-all duration-700 transform ${c?"opacity-100 translate-y-0":"opacity-0 translate-y-10"}`,children:[o.jsx("h2",{className:"text-center my-4 text-2xl",children:"Configurazione Potenza"}),o.jsxs("div",{className:"relative my-12 w-[90%] mx-auto",children:[o.jsx("input",{id:"power",type:"range",min:e,max:r,step:n,value:s,onChange:d=>l(Number(d.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer accent-primary-accent"}),o.jsx("div",{className:"absolute bottom-8 transform -translate-x-1/2 bg-white border border-gray-200 text-sm text-gray-800 py-1 px-2 rounded-lg shadow-md transition-opacity",style:{left:`${h}%`},children:s})]}),o.jsx("div",{className:"flex items-center justify-center my-4",children:o.jsxs("button",{onClick:()=>i(s),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",children:["Salva",o.jsx(Kt,{})]})})]})},er=({show:e,isConfigPage:r,handleSelectFile:n})=>o.jsxs("div",{className:`${r?`${e?"opacity-100 translate-y-0 delay-200":"opacity-0 translate-y-10"}`:""} p-4 text-center transition-all duration-700 transform`,children:[o.jsxs("h2",{className:"text-xl my-4",children:["Seleziona il file ",o.jsx("strong",{children:"config.json"})," per recuperare le chiavi univoche del dispositivo"]}),o.jsx("button",{onClick:n,className:"my-4 bg-blue-500 text-white px-4 py-2 rounded-lg",children:"Seleziona file"})]});function tr(e){return se({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:[]}]})(e)}function rr(e){return se({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:[]}]})(e)}const nr=e=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",xmlSpace:"preserve",id:"svg1",width:409.748,height:409.748,viewBox:"0 0 108.413 108.413",...e},u.createElement("defs",{id:"defs1"},u.createElement("linearGradient",{id:"linearGradient27"},u.createElement("stop",{id:"stop27",offset:0,style:{stopColor:"red",stopOpacity:1}}),u.createElement("stop",{id:"stop28",offset:1,style:{stopColor:"#ffca00",stopOpacity:.96862745}})),u.createElement("linearGradient",{xlinkHref:"#linearGradient27",id:"linearGradient28",x1:35.002,x2:143.414,y1:192.355,y2:83.942,gradientUnits:"userSpaceOnUse"})),u.createElement("g",{id:"layer1",transform:"translate(-35.002 -83.942)"},u.createElement("rect",{id:"rect26",width:108.413,height:108.413,x:35.002,y:83.942,rx:30,ry:30,style:{fill:"url(#linearGradient28)",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeOpacity:1,paintOrder:"stroke markers fill"}}),u.createElement("g",{id:"g1",style:{strokeWidth:.892424},transform:"matrix(1.08335 0 0 1.15901 -13.02 -26.51)"},u.createElement("path",{id:"path1",d:"M93.826 176.603c-.169-.034-1.837-.443-3.708-.909s-6.894-1.707-11.162-2.759a2463 2463 0 0 1-8.036-1.986 1.26 1.26 0 0 1-.84-.72c-.135-.297-.142-.67-.144-7.586l-.002-7.275-1.586-.388c-.873-.214-2.732-.663-4.131-.998-1.664-.399-2.62-.664-2.765-.767-.451-.321-.673-1.178-.44-1.7.05-.114 1.348-1.542 2.882-3.173l4.473-4.751c.925-.983 1.682-1.813 1.682-1.846 0-.032-2.013-2.197-4.473-4.811s-4.513-4.845-4.564-4.96c-.124-.278-.122-.806.005-1.108.137-.329.59-.717.947-.812a377 377 0 0 1 3.04-.735 4957 4957 0 0 0 16.208-3.91c3.114-.76 3.63-.84 4.028-.63.113.059 1.108 1.071 2.211 2.249a1906 1906 0 0 0 4.454 4.731l2.447 2.591.578-.603c.73-.762 7.41-7.89 7.899-8.429.533-.588 1.164-.826 1.676-.632.098.037 1.949.488 4.115 1.003 2.165.515 5.554 1.325 7.53 1.802l7.11 1.713c1.934.466 3.612.885 3.727.931.44.176.82.811.821 1.372 0 .11-.077.339-.171.51-.146.264-2.64 2.954-7.92 8.542-.595.63-1.074 1.174-1.062 1.207.011.034 2.015 2.18 4.453 4.768s4.493 4.832 4.565 4.985c.232.491.124 1.107-.27 1.528-.244.262-.464.356-1.276.544-.4.093-2.137.51-3.86.927l-3.307.798-.172.04v7.212c0 5.18-.025 7.285-.087 7.472a1.6 1.6 0 0 1-.287.477c-.211.23-.693.509-.877.509-.06 0-4.2 1.011-9.197 2.248-12.941 3.202-13.804 3.411-14.017 3.4a4 4 0 0 1-.497-.071m-.115-14.064c0-6.938-.027-12.614-.059-12.614s-1.13 1.144-2.44 2.542c-5.288 5.648-5.758 6.135-6.045 6.267-.478.22.5.423-8.925-1.857-2.27-.549-4.327-1.045-4.568-1.102l-.44-.103v13.955l.975.24c6.052 1.49 19.206 4.741 20.126 4.974a30 30 0 0 0 1.28.306c.076.005.096-2.563.096-12.608m12.576 9.853c5.93-1.467 10.857-2.684 10.951-2.706l.171-.04.02-6.992c.018-6.187.006-6.99-.094-6.958-.063.019-1.698.416-3.632.883-1.934.466-4.72 1.14-6.192 1.497-3.653.887-3.407.84-3.789.725-.186-.056-.463-.233-.65-.416-.18-.175-2.039-2.141-4.13-4.37-2.092-2.229-3.833-4.063-3.868-4.077s-.063 5.656-.063 12.601v12.627l.248-.054c.137-.03 5.1-1.253 11.028-2.72m-20.964-15.644c.885-.919 7.626-8.102 8.034-8.56.163-.184.284-.345.268-.36-.03-.026-1.291-.333-7.062-1.721l-9.387-2.26-5.87-1.413-.512.554a2343 2343 0 0 0-8.041 8.564c-.267.285-.47.533-.45.552s1.89.48 4.158 1.025c9.94 2.387 16.933 4.072 17.464 4.209.316.08.598.149.627.151s.376-.33.771-.74m20.235.401c.78-.189 3.86-.93 6.845-1.648 12.242-2.942 13.984-3.364 14.015-3.396.019-.018-.237-.321-.568-.673l-4.112-4.38-3.921-4.178-.413-.437-6.82 1.638c-3.75.9-8.299 1.997-10.107 2.437s-3.76.91-4.339 1.047c-.578.137-1.05.278-1.05.313 0 .06 1.972 2.177 6.918 7.426 1.135 1.204 2.08 2.191 2.1 2.193.019.002.672-.152 1.452-.342m-9.338-11.001c.954-.227 3.678-.885 6.054-1.461a4296 4296 0 0 1 11.257-2.72c.41-.097.746-.196.746-.22 0-.042-2.28-.6-11.889-2.913a3300 3300 0 0 1-5.734-1.386c-1.219-.297-2.268-.538-2.331-.536s-1.388.313-2.944.691-4.05.982-5.543 1.34c-1.492.36-4.434 1.07-6.536 1.58-2.103.508-4.072.982-4.377 1.054-.305.07-.554.148-.554.17s.61.186 1.357.362c.746.177 4.831 1.16 9.078 2.188l8.525 2.06c.441.106.882.196.98.199s.958-.18 1.911-.408m-23.175-5.507c1.616-.385 15.137-3.644 18.927-4.562.914-.222 1.663-.423 1.663-.447 0-.043-2.176-2.373-6.494-6.955a220 220 0 0 1-2.417-2.588c-.068-.09-.257-.065-1.223.168-2.153.52-10.698 2.575-15.93 3.832-2.876.692-5.247 1.274-5.267 1.295-.046.045-.21-.132 4.76 5.153 2.23 2.371 4.083 4.358 4.117 4.415s.074.105.09.105.815-.187 1.774-.416m44.726.017c.668-.727 2.633-2.823 4.61-4.915 3.59-3.802 4.074-4.323 4.04-4.356-.019-.019-.892-.24-1.942-.491a14930 14930 0 0 1-17.845-4.296l-2.558-.62-.225.256c-.123.141-.763.824-1.42 1.518-.66.694-2.26 2.397-3.559 3.784a573 573 0 0 1-3.073 3.264c-.392.408-.712.773-.712.812 0 .081 1.221.382 13.259 3.264 4.832 1.157 8.803 2.12 8.824 2.141.102.102.267.003.601-.361",style:{fill:"#fff",fillOpacity:1,strokeWidth:0,strokeDasharray:"none"}}),u.createElement("path",{id:"path2",d:"M94.237 147.397c-.19-.076-.536-.44-.83-.87-.138-.202-.98-1.552-1.87-3.001-6.428-10.455-9.515-15.547-9.95-16.413-.459-.916-.982-2.465-1.178-3.493-.478-2.499-.335-4.879.435-7.235 1.186-3.633 3.713-6.577 7.144-8.326a14.6 14.6 0 0 1 4.316-1.388c1.018-.165 3.183-.165 4.201 0a14.6 14.6 0 0 1 5.902 2.32c3.031 2.03 5.227 5.32 5.959 8.928.623 3.072.293 6.038-.986 8.869-.359.792-3.667 6.345-7.571 12.703l-3.23 5.263c-.787 1.285-1.265 1.992-1.542 2.284-.398.42-.519.473-.8.36m1.266-20.98a6.44 6.44 0 0 0 4.949-4.23c.294-.862.38-1.48.33-2.368-.098-1.758-.749-3.161-2.028-4.375-1.216-1.153-2.656-1.723-4.35-1.723-1.69 0-3.132.57-4.345 1.72-.963.913-1.534 1.855-1.868 3.078-.13.48-.154.72-.151 1.567.003.873.026 1.084.183 1.657a6.43 6.43 0 0 0 3.963 4.37 6.3 6.3 0 0 0 3.317.303",style:{fill:"#d30000",fillOpacity:1,strokeWidth:.892424}}),u.createElement("path",{id:"rect2",d:"M158.632 137.745h3.539v1.387h-3.539z",style:{fill:"#fff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeDasharray:"none",paintOrder:"stroke markers fill"},transform:"matrix(.98806 .15405 -.46962 .88287 0 0)"}),u.createElement("path",{id:"rect3",d:"M120.628 170.946h3.167v1.222h-3.167z",style:{fill:"#fff",fillOpacity:1,fillRule:"evenodd",stroke:"#ff9b01",strokeWidth:0,strokeDasharray:"none",paintOrder:"stroke markers fill"},transform:"rotate(8.335)scale(.9449 1)skewY(-18.126)"})))),or=({Logo:e,logo:r})=>{const{logout:n}=Ee(),{activeAlert:s}=ae(),{autoLogin:l,configRoutes:c,firstPrivateTitle:i,showHeaderButton:h}=ee(),{isLoading:d}=he(),p=O.useLocation(),S=O.useNavigate(),C=()=>{n(),s("info","Hai effettuato il logout")},m=c.find(w=>w.path===p.pathname),f=O.useMatch("home/:id");return o.jsx("header",{className:d?"hidden":"",children:o.jsxs("nav",{className:"header-size flex items-center justify-between px-2 shadow-lg border-b gap-2 border-b-gray-300",children:[o.jsx("figure",{children:e&&typeof e=="function"?o.jsx(e,{className:"header-logo-size"}):r?o.jsx("img",{src:r,alt:"Logo",className:"header-logo-size"}):o.jsx(nr,{className:"header-logo-size"})}),o.jsx("div",{children:o.jsx("p",{children:(m==null?void 0:m.title)||i})}),o.jsxs("div",{children:[!l&&f&&o.jsx("button",{className:"h-[48px] w-[48px] 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",type:"button",onClick:C,children:o.jsx(tr,{className:"text-4xl w-full"})}),!f&&h&&o.jsx("button",{className:"h-[48px] w-[48px] 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",type:"button",onClick:()=>S(-1),children:o.jsx(rr,{className:"text-4xl w-full"})})]})]})})};function sr(e){return se({tag:"svg",attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M763.024 259.968C718.4 141.536 622.465 66.527 477.553 66.527c-184.384 0-313.392 136.912-324.479 315.536C64.177 410.495.002 501.183.002 603.903c0 125.744 98.848 231.968 215.823 231.968h92.448c17.664 0 32-14.336 32-32 0-17.68-14.336-32-32-32h-92.448c-82.304 0-152.832-76.912-152.832-167.968 0-80.464 56.416-153.056 127.184-165.216l29.04-5.008-2.576-29.328-.24-.368c0-155.872 102.576-273.44 261.152-273.44 127.104 0 198.513 62.624 231.537 169.44l6.847 22.032 23.056.496c118.88 2.496 223.104 98.945 223.104 218.77 0 109.055-72.273 230.591-181.696 230.591h-73.12c-17.664 0-32 14.336-32 32 0 17.68 14.336 32 32 32l72.88-.095c160-4.224 243.344-157.071 243.344-294.495 0-147.712-115.76-265.744-260.48-281.312zM535.985 514.941c-.176-.192-.241-.352-.354-.512l-8.095-8.464c-4.432-4.688-10.336-7.008-16.24-6.976-5.905-.048-11.777 2.288-16.289 6.975l-8.095 8.464c-.16.16-.193.353-.336.513L371.072 642.685c-8.944 9.344-8.944 24.464 0 33.84l8.064 5.471c8.945 9.344 23.44 6.32 32.368-3.024l68.113-75.935v322.432c0 17.664 14.336 32 32 32s32-14.336 32-32V603.34l70.368 77.631c8.944 9.344 23.408 12.369 32.336 3.025l8.064-5.472c8.945-9.376 8.945-24.496 0-33.84z"},child:[]}]})(e)}const ar=e=>{const[r,n]=a.useState(!1),{onFilesSelect:s,id:l="dropzone-file",containerStyle:c="flex items-center justify-center w-full relative h-full",dropzoneStyle:i="flex flex-col items-center justify-center text-body px-6 text-center pt-5 pb-6 pointer-events-none",labelStyle:h=`flex flex-col items-center justify-center w-full h-full rounded-2xl transition-all duration-300 bg-slate-100/80 shadow-lg border border-slate-300 rounded-base cursor-pointer hover:bg-slate-200/80 hover:border-slate-500 hover:shadow-xl ${r?"bg-slate-200/80 border-slate-600 shadow-xl shadow-primary-strong":"border-default-strong"}`,dragActiveStyle:d="absolute w-full h-full top-0 left-0 rounded-2xl border-2 border-primary-strong/70 animate-pulse"}=e,p=a.useCallback(m=>{m.preventDefault(),m.stopPropagation(),console.log("entrato qui"),m.type==="dragenter"||m.type==="dragover"?n(!0):m.type==="dragleave"&&n(!1)},[]),S=a.useCallback(m=>{m.preventDefault(),m.stopPropagation(),n(!1),m.dataTransfer.files&&m.dataTransfer.files.length>0&&(s==null||s(Array.from(m.dataTransfer.files)))},[s]),C=m=>{m.target.files&&m.target.files.length>0&&(s==null||s(Array.from(m.target.files)))};return o.jsxs("div",{className:c,onDragEnter:p,children:[o.jsxs("label",{htmlFor:l,className:h,children:[o.jsxs("div",{className:i,children:[o.jsx(sr,{className:"text-8xl"}),o.jsxs("p",{className:"mb-2",children:[o.jsx("span",{className:"font-semibold",children:"Clicca per caricare"})," o trascina qui i file"]}),o.jsx("p",{className:"text-sm opacity-70",children:"Puoi selezionare più file"})]}),o.jsx("input",{id:l,type:"file",multiple:!0,className:"hidden",onChange:C})]}),r&&o.jsx("div",{className:d,onDragEnter:p,onDragLeave:p,onDragOver:p,onDrop:S})]})},lr=({initial:e=!1,onChange:r})=>{const[n,s]=a.useState(e),l=()=>{s(!n),r&&r(!n)};return o.jsx("button",{onClick:l,className:`w-14 h-6 flex items-center rounded-full p-1 transition-colors cursor-pointer ${n?"bg-blue-500":"bg-gray-300"}`,children:o.jsx("div",{className:`bg-white w-4 h-4 rounded-full shadow-md transform transition-transform ${n?"translate-x-8":"translate-x-0"}`})})},Me=e=>{const{id:r,name:n,value:s,onChange:l,disabled:c,required:i,labelStyle:h,containerStyle:d,inputStyle:p,title:S,children:C}=e;return o.jsxs("div",{className:d||"flex flex-col gap-1 mx-auto w-full",children:[o.jsx("label",{htmlFor:r,className:h||"mb-1 text-input-label font-medium text-color-label",children:S}),o.jsx("input",{type:"date",id:r,name:n,value:s||"",onChange:l,disabled:c,required:i,className:p||"bg-input-bg border border-input-border rounded-lg text-input-text placeholder:text-input-placeholder rounded-input focus:ring focus:ring-primary focus:border-primary focus:outline-none focus:shadow-[var(--shadow-primary-input)] block w-full h-[43px] p-input disabled:bg-gray-100 disabled:text-gray-400 disabled:cursor-not-allowed disabled:opacity-60"}),C]})},ir=e=>{const{startId:r,endId:n,startName:s,endName:l,startValue:c,endValue:i,onChange:h,disabled:d,required:p,dateError:S,startTitle:C,endTitle:m,startStyle:f,endStyle:w,labelStyle:g,containerStyle:j,startContainerStyle:b,endContainerStyle:y,endDateShow:N=!0,children:E}=e;return o.jsxs("div",{className:j||"flex gap-4 mx-auto w-full mb-4",children:[o.jsx(Me,{id:r,name:s,value:c,onChange:h,disabled:d,required:p,title:C,labelStyle:g,containerStyle:b,inputStyle:f}),N&&o.jsx(Me,{id:n,name:l,value:i,onChange:h,disabled:d,required:p,title:m,labelStyle:g,containerStyle:y,inputStyle:w,children:S&&o.jsx("p",{className:"text-red-500 text-[13px] mt-1",children:S})}),E]})};Object.defineProperty(exports,"BrowserRouter",{enumerable:!0,get:()=>O.BrowserRouter});Object.defineProperty(exports,"Link",{enumerable:!0,get:()=>O.Link});Object.defineProperty(exports,"NavLink",{enumerable:!0,get:()=>O.NavLink});Object.defineProperty(exports,"Outlet",{enumerable:!0,get:()=>O.Outlet});Object.defineProperty(exports,"Route",{enumerable:!0,get:()=>O.Route});Object.defineProperty(exports,"Routes",{enumerable:!0,get:()=>O.Routes});Object.defineProperty(exports,"useLocation",{enumerable:!0,get:()=>O.useLocation});Object.defineProperty(exports,"useMatch",{enumerable:!0,get:()=>O.useMatch});Object.defineProperty(exports,"useNavigate",{enumerable:!0,get:()=>O.useNavigate});Object.defineProperty(exports,"useParams",{enumerable:!0,get:()=>O.useParams});exports.axios=Ge;exports.ReactDOM=Ze;exports.Alert=_e;exports.AlertProvider=_t;exports.AuthAdmin=Zt;exports.AuthPage=je;exports.AuthProvider=It;exports.CardInputRange=Qt;exports.CardInputTag=Xt;exports.ConfigFileReader=er;exports.ConfigProvider=jt;exports.Dashboard=ht;exports.DefaultLayout=ft;exports.ErrorPage=Xe;exports.FileDropzone=ar;exports.Header=or;exports.Input=Te;exports.InputDate=Me;exports.InputGroup=Ie;exports.InputLabel=Le;exports.InputStartEndDate=ir;exports.Loading=dt;exports.LoadingComponent=Jt;exports.LoadingProvider=yt;exports.Login=gt;exports.LoginForm=mt;exports.LoginFormProvider=$t;exports.ModalProvider=zt;exports.PackageRoutes=Gt;exports.RouteProvider=Mt;exports.SwitchRadio=lr;exports.UsePageTitle=ct;exports.fetchAxiosConfig=rt;exports.useAlert=ae;exports.useAuth=Ee;exports.useAuthStorage=pe;exports.useConfig=ee;exports.useIndexedDB=Dt;exports.useLoading=he;exports.useLoginForm=$e;exports.useModal=it;exports.useOrientation=Bt;exports.useRoutesInjection=st;exports.useStorage=Re;