@tracktor/shared-module 2.6.3 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(p,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],g):(p=typeof globalThis<"u"?globalThis:p||self,g(p["@tracktor/shared-module"]={},p.React))})(this,function(p,g){"use strict";var te={exports:{}},B={};/**
1
+ (function(p,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(p=typeof globalThis<"u"?globalThis:p||self,h(p["@tracktor/shared-module"]={},p.React))})(this,function(p,h){"use strict";var re={exports:{}},G={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.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 le;function We(){if(le)return B;le=1;var t=g,n=Symbol.for("react.element"),o=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function l(d,c,y){var E,_={},C=null,u=null;y!==void 0&&(C=""+y),c.key!==void 0&&(C=""+c.key),c.ref!==void 0&&(u=c.ref);for(E in c)s.call(c,E)&&!f.hasOwnProperty(E)&&(_[E]=c[E]);if(d&&d.defaultProps)for(E in c=d.defaultProps,c)_[E]===void 0&&(_[E]=c[E]);return{$$typeof:n,type:d,key:C,ref:u,props:_,_owner:i.current}}return B.Fragment=o,B.jsx=l,B.jsxs=l,B}var G={};/**
9
+ */var fe;function ze(){if(fe)return G;fe=1;var t=h,n=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,c=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function l(d,s,E){var g,P={},b=null,u=null;E!==void 0&&(b=""+E),s.key!==void 0&&(b=""+s.key),s.ref!==void 0&&(u=s.ref);for(g in s)a.call(s,g)&&!f.hasOwnProperty(g)&&(P[g]=s[g]);if(d&&d.defaultProps)for(g in s=d.defaultProps,s)P[g]===void 0&&(P[g]=s[g]);return{$$typeof:n,type:d,key:b,ref:u,props:P,_owner:c.current}}return G.Fragment=o,G.jsx=l,G.jsxs=l,G}var J={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,12 +14,12 @@
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 fe;function ze(){return fe||(fe=1,process.env.NODE_ENV!=="production"&&function(){var t=g,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),u=Symbol.for("react.offscreen"),T=Symbol.iterator,k="@@iterator";function x(e){if(e===null||typeof e!="object")return null;var r=T&&e[T]||e[k];return typeof r=="function"?r:null}var I=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var r=arguments.length,a=new Array(r>1?r-1:0),v=1;v<r;v++)a[v-1]=arguments[v];N("error",e,a)}}function N(e,r,a){{var v=I.ReactDebugCurrentFrame,w=v.getStackAddendum();w!==""&&(r+="%s",a=a.concat([w]));var R=a.map(function(m){return String(m)});R.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,R)}}var W=!1,z=!1,j=!1,ge=!1,he=!1,Q;Q=Symbol.for("react.module.reference");function vt(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===f||he||e===i||e===y||e===E||ge||e===u||W||z||j||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===_||e.$$typeof===l||e.$$typeof===d||e.$$typeof===c||e.$$typeof===Q||e.getModuleId!==void 0))}function gt(e,r,a){var v=e.displayName;if(v)return v;var w=r.displayName||r.name||"";return w!==""?a+"("+w+")":a}function ye(e){return e.displayName||"Context"}function L(e){if(e==null)return null;if(typeof e.tag=="number"&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case s:return"Fragment";case o:return"Portal";case f:return"Profiler";case i:return"StrictMode";case y:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return ye(r)+".Consumer";case l:var a=e;return ye(a._context)+".Provider";case c:return gt(e,e.render,"ForwardRef");case _:var v=e.displayName||null;return v!==null?v:L(e.type)||"Memo";case C:{var w=e,R=w._payload,m=w._init;try{return L(m(R))}catch{return null}}}return null}var M=Object.assign,J=0,me,Ee,we,Re,pe,Ce,_e;function be(){}be.__reactDisabledLog=!0;function ht(){{if(J===0){me=console.log,Ee=console.info,we=console.warn,Re=console.error,pe=console.group,Ce=console.groupCollapsed,_e=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}J++}}function yt(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:me}),info:M({},e,{value:Ee}),warn:M({},e,{value:we}),error:M({},e,{value:Re}),group:M({},e,{value:pe}),groupCollapsed:M({},e,{value:Ce}),groupEnd:M({},e,{value:_e})})}J<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=I.ReactCurrentDispatcher,ne;function X(e,r,a){{if(ne===void 0)try{throw Error()}catch(w){var v=w.stack.trim().match(/\n( *(at )?)/);ne=v&&v[1]||""}return`
18
- `+ne+e}}var oe=!1,Z;{var mt=typeof WeakMap=="function"?WeakMap:Map;Z=new mt}function Pe(e,r){if(!e||oe)return"";{var a=Z.get(e);if(a!==void 0)return a}var v;oe=!0;var w=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var R;R=re.current,re.current=null,ht();try{if(r){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(Y){v=Y}Reflect.construct(e,[],m)}else{try{m.call()}catch(Y){v=Y}e.call(m.prototype)}}else{try{throw Error()}catch(Y){v=Y}e()}}catch(Y){if(Y&&v&&typeof Y.stack=="string"){for(var h=Y.stack.split(`
19
- `),O=v.stack.split(`
20
- `),P=h.length-1,S=O.length-1;P>=1&&S>=0&&h[P]!==O[S];)S--;for(;P>=1&&S>=0;P--,S--)if(h[P]!==O[S]){if(P!==1||S!==1)do if(P--,S--,S<0||h[P]!==O[S]){var D=`
21
- `+h[P].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),typeof e=="function"&&Z.set(e,D),D}while(P>=1&&S>=0);break}}}finally{oe=!1,re.current=R,yt(),Error.prepareStackTrace=w}var U=e?e.displayName||e.name:"",Ne=U?X(U):"";return typeof e=="function"&&Z.set(e,Ne),Ne}function Et(e,r,a){return Pe(e,!1)}function wt(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function $(e,r,a){if(e==null)return"";if(typeof e=="function")return Pe(e,wt(e));if(typeof e=="string")return X(e);switch(e){case y:return X("Suspense");case E:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return Et(e.render);case _:return $(e.type,r,a);case C:{var v=e,w=v._payload,R=v._init;try{return $(R(w),r,a)}catch{}}}return""}var q=Object.prototype.hasOwnProperty,je={},Se=I.ReactDebugCurrentFrame;function ee(e){if(e){var r=e._owner,a=$(e.type,e._source,r?r.type:null);Se.setExtraStackFrame(a)}else Se.setExtraStackFrame(null)}function Rt(e,r,a,v,w){{var R=Function.call.bind(q);for(var m in e)if(R(e,m)){var h=void 0;try{if(typeof e[m]!="function"){var O=Error((v||"React class")+": "+a+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw O.name="Invariant Violation",O}h=e[m](r,m,v,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){h=P}h&&!(h instanceof Error)&&(ee(w),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",v||"React class",a,m,typeof h),ee(null)),h instanceof Error&&!(h.message in je)&&(je[h.message]=!0,ee(w),b("Failed %s type: %s",a,h.message),ee(null))}}}var pt=Array.isArray;function ae(e){return pt(e)}function Ct(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,a=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function _t(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function xe(e){if(_t(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ct(e)),Te(e)}var H=I.ReactCurrentOwner,bt={key:!0,ref:!0,__self:!0,__source:!0},Oe,Ae,ie;ie={};function Pt(e){if(q.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function jt(e){if(q.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function St(e,r){if(typeof e.ref=="string"&&H.current&&r&&H.current.stateNode!==r){var a=L(H.current.type);ie[a]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',L(H.current.type),e.ref),ie[a]=!0)}}function Tt(e,r){{var a=function(){Oe||(Oe=!0,b("%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://reactjs.org/link/special-props)",r))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function xt(e,r){{var a=function(){Ae||(Ae=!0,b("%s: `ref` 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://reactjs.org/link/special-props)",r))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var Ot=function(e,r,a,v,w,R,m){var h={$$typeof:n,type:e,key:r,ref:a,props:m,_owner:R};return h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(h,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(h,"_source",{configurable:!1,enumerable:!1,writable:!1,value:w}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h};function At(e,r,a,v,w){{var R,m={},h=null,O=null;a!==void 0&&(xe(a),h=""+a),jt(r)&&(xe(r.key),h=""+r.key),Pt(r)&&(O=r.ref,St(r,w));for(R in r)q.call(r,R)&&!bt.hasOwnProperty(R)&&(m[R]=r[R]);if(e&&e.defaultProps){var P=e.defaultProps;for(R in P)m[R]===void 0&&(m[R]=P[R])}if(h||O){var S=typeof e=="function"?e.displayName||e.name||"Unknown":e;h&&Tt(m,S),O&&xt(m,S)}return Ot(e,h,O,w,v,H.current,m)}}var se=I.ReactCurrentOwner,Ie=I.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,a=$(e.type,e._source,r?r.type:null);Ie.setExtraStackFrame(a)}else Ie.setExtraStackFrame(null)}var ue;ue=!1;function ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function ke(){{if(se.current){var e=L(se.current.type);if(e)return`
17
+ */var de;function Me(){return de||(de=1,process.env.NODE_ENV!=="production"&&function(){var t=h,n=Symbol.for("react.element"),o=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),u=Symbol.for("react.offscreen"),R=Symbol.iterator,j="@@iterator";function T(e){if(e===null||typeof e!="object")return null;var r=R&&e[R]||e[j];return typeof r=="function"?r:null}var w=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){{for(var r=arguments.length,i=new Array(r>1?r-1:0),v=1;v<r;v++)i[v-1]=arguments[v];D("error",e,i)}}function D(e,r,i){{var v=w.ReactDebugCurrentFrame,C=v.getStackAddendum();C!==""&&(r+="%s",i=i.concat([C]));var S=i.map(function(m){return String(m)});S.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,S)}}var L=!1,N=!1,O=!1,X=!1,ye=!1,B;B=Symbol.for("react.module.reference");function mt(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===f||ye||e===c||e===E||e===g||X||e===u||L||N||O||typeof e=="object"&&e!==null&&(e.$$typeof===b||e.$$typeof===P||e.$$typeof===l||e.$$typeof===d||e.$$typeof===s||e.$$typeof===B||e.getModuleId!==void 0))}function Et(e,r,i){var v=e.displayName;if(v)return v;var C=r.displayName||r.name||"";return C!==""?i+"("+C+")":i}function me(e){return e.displayName||"Context"}function W(e){if(e==null)return null;if(typeof e.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case a:return"Fragment";case o:return"Portal";case f:return"Profiler";case c:return"StrictMode";case E:return"Suspense";case g:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return me(r)+".Consumer";case l:var i=e;return me(i._context)+".Provider";case s:return Et(e,e.render,"ForwardRef");case P:var v=e.displayName||null;return v!==null?v:W(e.type)||"Memo";case b:{var C=e,S=C._payload,m=C._init;try{return W(m(S))}catch{return null}}}return null}var M=Object.assign,Q=0,Ee,we,Re,Ce,_e,pe,Se;function be(){}be.__reactDisabledLog=!0;function wt(){{if(Q===0){Ee=console.log,we=console.info,Re=console.warn,Ce=console.error,_e=console.group,pe=console.groupCollapsed,Se=console.groupEnd;var e={configurable:!0,enumerable:!0,value:be,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}Q++}}function Rt(){{if(Q--,Q===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:M({},e,{value:Ee}),info:M({},e,{value:we}),warn:M({},e,{value:Re}),error:M({},e,{value:Ce}),group:M({},e,{value:_e}),groupCollapsed:M({},e,{value:pe}),groupEnd:M({},e,{value:Se})})}Q<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=w.ReactCurrentDispatcher,oe;function Z(e,r,i){{if(oe===void 0)try{throw Error()}catch(C){var v=C.stack.trim().match(/\n( *(at )?)/);oe=v&&v[1]||""}return`
18
+ `+oe+e}}var ae=!1,$;{var Ct=typeof WeakMap=="function"?WeakMap:Map;$=new Ct}function Pe(e,r){if(!e||ae)return"";{var i=$.get(e);if(i!==void 0)return i}var v;ae=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var S;S=ne.current,ne.current=null,wt();try{if(r){var m=function(){throw Error()};if(Object.defineProperty(m.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(m,[])}catch(z){v=z}Reflect.construct(e,[],m)}else{try{m.call()}catch(z){v=z}e.call(m.prototype)}}else{try{throw Error()}catch(z){v=z}e()}}catch(z){if(z&&v&&typeof z.stack=="string"){for(var y=z.stack.split(`
19
+ `),I=v.stack.split(`
20
+ `),A=y.length-1,x=I.length-1;A>=1&&x>=0&&y[A]!==I[x];)x--;for(;A>=1&&x>=0;A--,x--)if(y[A]!==I[x]){if(A!==1||x!==1)do if(A--,x--,x<0||y[A]!==I[x]){var F=`
21
+ `+y[A].replace(" at new "," at ");return e.displayName&&F.includes("<anonymous>")&&(F=F.replace("<anonymous>",e.displayName)),typeof e=="function"&&$.set(e,F),F}while(A>=1&&x>=0);break}}}finally{ae=!1,ne.current=S,Rt(),Error.prepareStackTrace=C}var U=e?e.displayName||e.name:"",We=U?Z(U):"";return typeof e=="function"&&$.set(e,We),We}function _t(e,r,i){return Pe(e,!1)}function pt(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function q(e,r,i){if(e==null)return"";if(typeof e=="function")return Pe(e,pt(e));if(typeof e=="string")return Z(e);switch(e){case E:return Z("Suspense");case g:return Z("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case s:return _t(e.render);case P:return q(e.type,r,i);case b:{var v=e,C=v._payload,S=v._init;try{return q(S(C),r,i)}catch{}}}return""}var ee=Object.prototype.hasOwnProperty,je={},Te=w.ReactDebugCurrentFrame;function te(e){if(e){var r=e._owner,i=q(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(i)}else Te.setExtraStackFrame(null)}function St(e,r,i,v,C){{var S=Function.call.bind(ee);for(var m in e)if(S(e,m)){var y=void 0;try{if(typeof e[m]!="function"){var I=Error((v||"React class")+": "+i+" type `"+m+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[m]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw I.name="Invariant Violation",I}y=e[m](r,m,v,i,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(A){y=A}y&&!(y instanceof Error)&&(te(C),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",v||"React class",i,m,typeof y),te(null)),y instanceof Error&&!(y.message in je)&&(je[y.message]=!0,te(C),_("Failed %s type: %s",i,y.message),te(null))}}}var bt=Array.isArray;function ie(e){return bt(e)}function Pt(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,i=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return i}}function jt(e){try{return Oe(e),!1}catch{return!0}}function Oe(e){return""+e}function Ae(e){if(jt(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Pt(e)),Oe(e)}var K=w.ReactCurrentOwner,Tt={key:!0,ref:!0,__self:!0,__source:!0},xe,Ie,ce;ce={};function Ot(e){if(ee.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function At(e){if(ee.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function xt(e,r){if(typeof e.ref=="string"&&K.current&&r&&K.current.stateNode!==r){var i=W(K.current.type);ce[i]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(K.current.type),e.ref),ce[i]=!0)}}function It(e,r){{var i=function(){xe||(xe=!0,_("%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://reactjs.org/link/special-props)",r))};i.isReactWarning=!0,Object.defineProperty(e,"key",{get:i,configurable:!0})}}function kt(e,r){{var i=function(){Ie||(Ie=!0,_("%s: `ref` 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://reactjs.org/link/special-props)",r))};i.isReactWarning=!0,Object.defineProperty(e,"ref",{get:i,configurable:!0})}}var Dt=function(e,r,i,v,C,S,m){var y={$$typeof:n,type:e,key:r,ref:i,props:m,_owner:S};return y._store={},Object.defineProperty(y._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(y,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(y,"_source",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y};function Ft(e,r,i,v,C){{var S,m={},y=null,I=null;i!==void 0&&(Ae(i),y=""+i),At(r)&&(Ae(r.key),y=""+r.key),Ot(r)&&(I=r.ref,xt(r,C));for(S in r)ee.call(r,S)&&!Tt.hasOwnProperty(S)&&(m[S]=r[S]);if(e&&e.defaultProps){var A=e.defaultProps;for(S in A)m[S]===void 0&&(m[S]=A[S])}if(y||I){var x=typeof e=="function"?e.displayName||e.name||"Unknown":e;y&&It(m,x),I&&kt(m,x)}return Dt(e,y,I,C,v,K.current,m)}}var se=w.ReactCurrentOwner,ke=w.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,i=q(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(i)}else ke.setExtraStackFrame(null)}var ue;ue=!1;function le(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function De(){{if(se.current){var e=W(se.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function It(e){return""}var De={};function kt(e){{var r=ke();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(r=`
23
+ Check the render method of \``+e+"`."}return""}}function Lt(e){return""}var Fe={};function Nt(e){{var r=De();if(!r){var i=typeof e=="string"?e:e.displayName||e.name;i&&(r=`
24
24
 
25
- Check the top-level render call using <`+a+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=kt(r);if(De[a])return;De[a]=!0;var v="";e&&e._owner&&e._owner!==se.current&&(v=" It was passed a child from "+L(e._owner.type)+"."),V(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,v),V(null)}}function Le(e,r){{if(typeof e!="object")return;if(ae(e))for(var a=0;a<e.length;a++){var v=e[a];ce(v)&&Fe(v,r)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var w=x(e);if(typeof w=="function"&&w!==e.entries)for(var R=w.call(e),m;!(m=R.next()).done;)ce(m.value)&&Fe(m.value,r)}}}function Dt(e){{var r=e.type;if(r==null||typeof r=="string")return;var a;if(typeof r=="function")a=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===_))a=r.propTypes;else return;if(a){var v=L(r);Rt(a,e.props,"prop",v,e)}else if(r.PropTypes!==void 0&&!ue){ue=!0;var w=L(r);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",w||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ft(e){{for(var r=Object.keys(e.props),a=0;a<r.length;a++){var v=r[a];if(v!=="children"&&v!=="key"){V(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),V(null);break}}e.ref!==null&&(V(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Ye(e,r,a,v,w,R){{var m=vt(e);if(!m){var h="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(h+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var O=It();O?h+=O:h+=ke();var P;e===null?P="null":ae(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(L(e.type)||"Unknown")+" />",h=" Did you accidentally export a JSX literal instead of a component?"):P=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",P,h)}var S=At(e,r,a,w,R);if(S==null)return S;if(m){var D=r.children;if(D!==void 0)if(v)if(ae(D)){for(var U=0;U<D.length;U++)Le(D[U],e);Object.freeze&&Object.freeze(D)}else b("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 Le(D,e)}return e===s?Ft(S):Dt(S),S}}function Lt(e,r,a){return Ye(e,r,a,!0)}function Yt(e,r,a){return Ye(e,r,a,!1)}var Nt=Yt,Wt=Lt;G.Fragment=s,G.jsx=Nt,G.jsxs=Wt}()),G}process.env.NODE_ENV==="production"?te.exports=We():te.exports=ze();var F=te.exports;const A=g.createContext({}),Me=({children:t,apiURL:n,libraries:o})=>{const s=g.useMemo(()=>({apiURL:n,libraries:o}),[n,o]);return F.jsx(A.Provider,{value:s,children:t})},Ve=({Fallback:t,isLogged:n,loginPath:o="/login",localStorageKey:s="user",redirect401Path:i="/login",...f})=>{var b,N,W,z;const{libraries:l}=g.useContext(A),d=(f==null?void 0:f.reactRouter)||(l==null?void 0:l.reactRouter),c=(f==null?void 0:f.axios)||(l==null?void 0:l.axios);if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[y,E]=g.useState(null),{useLocation:_,Navigate:C,Outlet:u}=d,T=_(),k=g.useRef(!1),x=typeof n=="function"?n():!!n,I=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return g.useEffect(()=>{k.current||(k.current=!0,c.interceptors.response.use(j=>j,async j=>{var Q;return typeof j=="object"&&j&&"response"in j&&j.response&&typeof j.response=="object"&&"status"in j.response&&j.response&&typeof j.response=="object"&&"status"in j.response&&((Q=j==null?void 0:j.response)==null?void 0:Q.status)===401&&(c.defaults.headers.common.Authorization=null,typeof window<"u"&&window.localStorage&&localStorage.removeItem(s),E(i)),Promise.reject(j)}))},[c.defaults.headers.common,c.interceptors.response,s,i]),I&&!y?F.jsx(g.Suspense,{fallback:t,children:(N=(b=T.state)==null?void 0:b.from)!=null&&N.state&&((z=(W=T.state)==null?void 0:W.from)==null?void 0:z.pathname)===o?F.jsx(C,{to:T.state.from.state.from.pathname+T.state.from.state.from.search,replace:!0}):F.jsx(u,{})}):F.jsx(C,{to:o+T.search,state:{from:T},replace:!0})},Ue=({data:t,...n})=>{const{libraries:o}=g.useContext(A),s=(n==null?void 0:n.reactRouter)||(o==null?void 0:o.reactRouter),i=(n==null?void 0:n.gtm)||(o==null?void 0:o.gtm);if(!s)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!i)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:f}=i,{useLocation:l,Outlet:d}=s,{pathname:c}=l(),{sendEvent:y}=f();return g.useEffect(()=>{y({event:"pageView",pathname:c,...t})},[t,c,y]),F.jsx(d,{})},Be=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:o="accessToken",postContentType:s="application/json",...i})=>{const{apiURL:f=i.apiURL,libraries:l}=g.useContext(A),d=(i==null?void 0:i.axios)||(l==null?void 0:l.axios);if(!d)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(d!=null&&d.defaults))return null;if(typeof window<"u"&&window.localStorage){const c=localStorage.getItem(n),y=c?JSON.parse(c):null,E=y!=null&&y[t]?y[t]:null,_=y!=null&&y[o]?y[o]:null,C=c?`${E} ${_}`:null;C&&(d.defaults.headers.common.Authorization=C)}return d.defaults.baseURL=f,d.defaults.headers.post["Content-Type"]=s,null},Ge=({debug:t,resources:n,...o})=>{const{libraries:s}=g.useContext(A),i=(o==null?void 0:o.i18)||(s==null?void 0:s.i18),{i18next:f,initReactI18next:l,languageDetector:d}=i||{};if(!i)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return f!=null&&f.isInitialized||(f.use(d).use(l).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==f.resolvedLanguage&&f.resolvedLanguage&&document.documentElement.setAttribute("lang",f.resolvedLanguage)}),f.on("languageChanged",c=>{document.documentElement.setAttribute("lang",c)})),null},Qe=({dsn:t,integrations:n,tracesSampleRate:o,replaysSessionSampleRate:s,replaysOnErrorSampleRate:i,tracePropagationTargets:f,ignoreErrors:l,debug:d,environment:c,release:y,...E})=>{const{libraries:_}=g.useContext(A),C=(E==null?void 0:E.sentry)||(_==null?void 0:_.sentry),u=(E==null?void 0:E.reactRouter)||(_==null?void 0:_.reactRouter);if(!C)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!u)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(C.isInitialized())return null;const{createRoutesFromChildren:T,matchRoutes:k,useLocation:x,useNavigationType:I}=u;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&C.init({debug:d,dsn:t,environment:c||"production",ignoreErrors:[...l||[],/dynamically imported module/,/Cannot read properties of undefined \(reading 'default'\)/,/Loading chunk \d+ failed/,/ChunkLoadError/,/Failed to fetch dynamically imported module/,/vite:preloadError/],integrations:[C.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:T,matchRoutes:k,useEffect:g.useEffect,useLocation:x,useNavigationType:I}),...n||[]],release:y,replaysOnErrorSampleRate:i||1,replaysSessionSampleRate:s||.1,tracePropagationTargets:f,tracesSampleRate:o||1}),null},Je=({IMaskMixin:t,...n})=>{const o=g.useMemo(()=>t(({TextField:s,...i})=>F.jsx(s,{...i})),[t]);return F.jsx(o,{...n})},He=({accessToken:t,...n})=>{const{libraries:o}=g.useContext(A),s=(n==null?void 0:n.mapbox)||(o==null?void 0:o.mapbox);if(!s)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return t&&(s.accessToken=t),null},Ke=({language:t,...n})=>{const{libraries:o}=g.useContext(A),s=(n==null?void 0:n.dayjs)||(o==null?void 0:o.dayjs),i=(n==null?void 0:n.plugin)||(o==null?void 0:o.dayjsPlugin);if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return g.useEffect(()=>{(async()=>{var d;const l=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";i&&i.forEach(c=>{c&&s.extend(c)}),await import("dayjs/locale/en"),await import("dayjs/locale/fr"),s.locale(l)})().then()},[s,i,t]),null},Xe=()=>(g.useEffect(()=>{const t=n=>{try{n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),window.location.reload()}catch{}};return window.addEventListener("vite:preloadError",t),()=>{window.removeEventListener("vite:preloadError",t)}},[]),null),Ze=t=>t&&typeof t=="function",$e=t=>t&&typeof t=="function",qe=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:o,...s})=>{var c,y;const{libraries:i}=g.useContext(A),f=(s==null?void 0:s.QueryClient)||((c=i==null?void 0:i.reactQuery)==null?void 0:c.QueryClient),l=(s==null?void 0:s.QueryClientProvider)||((y=i==null?void 0:i.reactQuery)==null?void 0:y.QueryClientProvider);if(!f)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!l)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!Ze(l))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!$e(f))throw new Error("Provided QueryClient dependencies are not valid.");const d=new f({defaultOptions:{mutations:{...o},queries:{getNextPageParam:(E,_,C)=>E.length+(C||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(l,{client:d,children:t})},et=t=>{var y,E,_;const{libraries:n}=g.useContext(A),o=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),s=((y=t==null?void 0:t.i18)==null?void 0:y.translateFunction)||((E=n==null?void 0:n.i18)==null?void 0:E.translateFunction),i=((_=o==null?void 0:o.i18next)==null?void 0:_.t)||s||(C=>C),{unknownErrorTranslationKey:f="error.unknownError"}=t||{},l=i(f),d=g.useCallback(C=>{var T,k,x,I,b,N,W,z,j;const{response:u}=C||{};return u!=null&&u.reason?String(u.reason):(T=u==null?void 0:u.data)!=null&&T.reason?String(u.data.reason):(k=u==null?void 0:u.data)!=null&&k.message?String(u.data.message):(I=(x=u==null?void 0:u.data)==null?void 0:x.detail)!=null&&I.length&&Array.isArray((b=u==null?void 0:u.data)==null?void 0:b.detail)&&((W=(N=u==null?void 0:u.data)==null?void 0:N.detail[0])!=null&&W.msg)&&typeof((j=(z=u==null?void 0:u.data)==null?void 0:z.detail[0])==null?void 0:j.msg)=="string"?String(u.data.detail[0].msg):l},[l]);return{getErrorCode:g.useCallback(C=>{var T,k,x;const{response:u}=C||{};return u!=null&&u.error_code?String(u==null?void 0:u.error_code):(T=u==null?void 0:u.data)!=null&&T.error_code?String((k=u==null?void 0:u.data)==null?void 0:k.error_code):u!=null&&u.error_code?String(u==null?void 0:u.error_code):(x=u==null?void 0:u.data)!=null&&x.error_code?String(u.data.error_code):"unknown_error_code"},[]),printError:d}},tt=({data:t,fetchNextPage:n,isFetchingNextPage:o,isInitialLoading:s,isLoading:i,enabled:f=!0})=>{const l=g.useCallback(async c=>{o||!f||await n({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[f,n,o]),d=g.useMemo(()=>{if(t)return t.pages.reduce((c,y)=>[...c,...y],[])},[t]);return{fetchNextPageOnRowsScrollEnd:l,isLoading:o||i,loadingVariant:s?"skeleton":"linear",rows:d}},rt=t=>{const{libraries:n}=g.useContext(A),o=(t==null?void 0:t.axios)||(n==null?void 0:n.axios),s=(t==null?void 0:t.localStorageKey)||"user";if(!o)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");const i=g.useCallback(({tokenType:l,accessToken:d})=>{o.defaults.headers.common.Authorization=`${l} ${d}`},[o.defaults.headers.common]),f=()=>{o.defaults.headers.common.Authorization=null};return g.useEffect(()=>{const l=({newValue:d,key:c})=>{if(c===s&&d)try{const{accessToken:y,tokenType:E}=JSON.parse(d);i({accessToken:y,tokenType:E})}catch(y){console.error("Failed to parse newValue from localStorage:",y)}};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}},[s,i]),{clearAuthenticationToken:f,setAuthenticationToken:i}},de=({library:t,date:n,format:o="ll"})=>t(n).format(o),ve=(t,n="km")=>{const o=Number(t);return Number.isNaN(o)?`0 ${n}`:`${o.toFixed(2)} ${n}`},nt=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,ot=({path:t,size:n,apiURL:o})=>{if(!t)return"";const s=nt(t),i=`${o}${s}`,f=i.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&f?`${i.replace("/files",`/thumbs/${n}`)}`:i},at=t=>{const{apiURL:n,libraries:o}=g.useContext(A),s=(t==null?void 0:t.dayjs)||(o==null?void 0:o.dayjs);return{dateAdapter:(l,d)=>{if(!s)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return de({date:l,format:d,library:s})},distanceAdapter:ve,filePathAdapter:(l,d)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return ot({apiURL:n,path:l,size:d})}}},K=(t,n)=>n==="short"?t.split("-")[0]:t,it=(t,n="full")=>{const[o,s]=g.useState(()=>{const i=(t==null?void 0:t.language)||navigator.language;return t&&"isInitialized"in t&&t.isInitialized,K(i,n)});return g.useEffect(()=>{var f;t&&"isInitialized"in t&&t.isInitialized&&t.language&&s(K(t.language,n));const i=l=>{s(K(l,n))};return(f=t==null?void 0:t.on)==null||f.call(t,"languageChanged",i),()=>{var l;(l=t==null?void 0:t.off)==null||l.call(t,"languageChanged",i)}},[t,n]),o},st=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),ut=t=>{const s=t.split("/").filter(i=>i.length>0).map(i=>i.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return s.charAt(0).toLowerCase()+s.slice(1)},ct=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),lt=(t,n,o)=>{const s=ut(n),i=st(o);return`${s}${i}`},ft=t=>{if(t)return(t==null?void 0:t.reduce((n,o)=>(n[o]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},dt=t=>(Array.isArray(t)?t:[t]).reduce((o,s)=>{const{output:i,operationsToGenerateInfiniteQueryHook:f,input:l="./openapi.json"}=s||{},d=ct(l);return{...o,[d]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:l,output:{baseUrl:i==null?void 0:i.baseUrl,client:"react-query",mode:"tags-split",override:{...(f==null?void 0:f.length)&&{operations:ft(f)},header:c=>["Generated by orval 🍺",...c.title?[c.title]:[],...c.description?[c.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:lt,query:{useQuery:!0}},schemas:(i==null?void 0:i.schemas)||`src/api/${d}/model`,target:(i==null?void 0:i.target)||`src/api/${d}/services/api.ts`,...i}}}},{});p.GTMSendPageView=Ue,p.InitializeAxiosConfig=Be,p.InitializeDaysJSConfig=Ke,p.InitializeI18nConfig=Ge,p.InitializeMapBoxConfig=He,p.InitializeSentryConfig=Qe,p.InjectDependenciesContext=A,p.InjectDependenciesProvider=Me,p.MaskTextField=Je,p.PreloadErrorHandler=Xe,p.QueryClientProviderWithConfig=qe,p.RequireAuth=Ve,p.dateAdapter=de,p.distanceAdapter=ve,p.getOrvalConfig=dt,p.useAdapter=at,p.useAuth=rt,p.useCurrentLanguage=it,p.useInfiniteDataGrid=tt,p.useResponseError=et,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
25
+ Check the top-level render call using <`+i+">.")}return r}}function Le(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var i=Nt(r);if(Fe[i])return;Fe[i]=!0;var v="";e&&e._owner&&e._owner!==se.current&&(v=" It was passed a child from "+W(e._owner.type)+"."),V(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',i,v),V(null)}}function Ne(e,r){{if(typeof e!="object")return;if(ie(e))for(var i=0;i<e.length;i++){var v=e[i];le(v)&&Le(v,r)}else if(le(e))e._store&&(e._store.validated=!0);else if(e){var C=T(e);if(typeof C=="function"&&C!==e.entries)for(var S=C.call(e),m;!(m=S.next()).done;)le(m.value)&&Le(m.value,r)}}}function Yt(e){{var r=e.type;if(r==null||typeof r=="string")return;var i;if(typeof r=="function")i=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===s||r.$$typeof===P))i=r.propTypes;else return;if(i){var v=W(r);St(i,e.props,"prop",v,e)}else if(r.PropTypes!==void 0&&!ue){ue=!0;var C=W(r);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",C||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Wt(e){{for(var r=Object.keys(e.props),i=0;i<r.length;i++){var v=r[i];if(v!=="children"&&v!=="key"){V(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),V(null);break}}e.ref!==null&&(V(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Ye(e,r,i,v,C,S){{var m=mt(e);if(!m){var y="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(y+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var I=Lt();I?y+=I:y+=De();var A;e===null?A="null":ie(e)?A="array":e!==void 0&&e.$$typeof===n?(A="<"+(W(e.type)||"Unknown")+" />",y=" Did you accidentally export a JSX literal instead of a component?"):A=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,y)}var x=Ft(e,r,i,C,S);if(x==null)return x;if(m){var F=r.children;if(F!==void 0)if(v)if(ie(F)){for(var U=0;U<F.length;U++)Ne(F[U],e);Object.freeze&&Object.freeze(F)}else _("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 Ne(F,e)}return e===a?Wt(x):Yt(x),x}}function zt(e,r,i){return Ye(e,r,i,!0)}function Mt(e,r,i){return Ye(e,r,i,!1)}var Vt=Mt,Ut=zt;J.Fragment=a,J.jsx=Vt,J.jsxs=Ut}()),J}process.env.NODE_ENV==="production"?re.exports=ze():re.exports=Me();var Y=re.exports;const k=h.createContext({}),Ve=({children:t,apiURL:n,libraries:o,localStorageKeys:a})=>{const c=h.useMemo(()=>({apiURL:n,libraries:o,localStorageKeys:a}),[n,o,a]);return Y.jsx(k.Provider,{value:c,children:t})},Ue=({Fallback:t,isLogged:n,loginPath:o="/login",localStorageKey:a="user",redirect401Path:c="/login",...f})=>{var _,D,L,N;const{libraries:l}=h.useContext(k),d=(f==null?void 0:f.reactRouter)||(l==null?void 0:l.reactRouter),s=(f==null?void 0:f.axios)||(l==null?void 0:l.axios);if(!d)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[E,g]=h.useState(null),{useLocation:P,Navigate:b,Outlet:u}=d,R=P(),j=h.useRef(!1),T=typeof n=="function"?n():!!n,w=typeof T=="boolean"?T:T==null?void 0:T.isLogged;return h.useEffect(()=>{j.current||(j.current=!0,s.interceptors.response.use(O=>O,async O=>{var B;return typeof O=="object"&&O&&"response"in O&&O.response&&typeof O.response=="object"&&"status"in O.response&&O.response&&typeof O.response=="object"&&"status"in O.response&&((B=O==null?void 0:O.response)==null?void 0:B.status)===401&&(s.defaults.headers.common.Authorization=null,typeof window<"u"&&window.localStorage&&localStorage.removeItem(a),g(c)),Promise.reject(O)}))},[s.defaults.headers.common,s.interceptors.response,a,c]),w&&!E?Y.jsx(h.Suspense,{fallback:t,children:(D=(_=R.state)==null?void 0:_.from)!=null&&D.state&&((N=(L=R.state)==null?void 0:L.from)==null?void 0:N.pathname)===o?Y.jsx(b,{to:R.state.from.state.from.pathname+R.state.from.state.from.search,replace:!0}):Y.jsx(u,{})}):Y.jsx(b,{to:o+R.search,state:{from:R},replace:!0})},Ge=({data:t,...n})=>{const{libraries:o}=h.useContext(k),a=(n==null?void 0:n.reactRouter)||(o==null?void 0:o.reactRouter),c=(n==null?void 0:n.gtm)||(o==null?void 0:o.gtm);if(!a)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!c)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:f}=c,{useLocation:l,Outlet:d}=a,{pathname:s}=l(),{sendEvent:E}=f();return h.useEffect(()=>{E({event:"pageView",pathname:s,...t})},[t,s,E]),Y.jsx(d,{})},Je="user",Be=({tokenTypeKey:t="tokenType",tokenKey:n="accessToken",postContentType:o="application/json",...a})=>{const{apiURL:c=a.apiURL,libraries:f,localStorageKeys:l}=h.useContext(k),d=(a==null?void 0:a.userLocalStorageKey)||(l==null?void 0:l.user)||Je,s=(a==null?void 0:a.axios)||(f==null?void 0:f.axios);if(!s)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(s!=null&&s.defaults))return null;if(typeof window<"u"&&window.localStorage){const E=localStorage.getItem(d),g=E?JSON.parse(E):null,P=g!=null&&g[t]?g[t]:null,b=g!=null&&g[n]?g[n]:null,u=E?`${P} ${b}`:null;u&&(s.defaults.headers.common.Authorization=u)}return s.defaults.baseURL=c,s.defaults.headers.post["Content-Type"]=o,null},Qe=({debug:t,resources:n,...o})=>{const{libraries:a}=h.useContext(k),c=(o==null?void 0:o.i18)||(a==null?void 0:a.i18),{i18next:f,initReactI18next:l,languageDetector:d}=c||{};if(!c)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return f!=null&&f.isInitialized||(f.use(d).use(l).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==f.resolvedLanguage&&f.resolvedLanguage&&document.documentElement.setAttribute("lang",f.resolvedLanguage)}),f.on("languageChanged",s=>{document.documentElement.setAttribute("lang",s)})),null},Ke=({dsn:t,integrations:n,tracesSampleRate:o,replaysSessionSampleRate:a,replaysOnErrorSampleRate:c,tracePropagationTargets:f,ignoreErrors:l,debug:d,environment:s,release:E,...g})=>{const{libraries:P}=h.useContext(k),b=(g==null?void 0:g.sentry)||(P==null?void 0:P.sentry),u=(g==null?void 0:g.reactRouter)||(P==null?void 0:P.reactRouter);if(!b)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!u)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(b.isInitialized())return null;const{createRoutesFromChildren:R,matchRoutes:j,useLocation:T,useNavigationType:w}=u;return(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&b.init({debug:d,dsn:t,environment:s||"production",ignoreErrors:[...l||[],/dynamically imported module/,/Cannot read properties of undefined \(reading 'default'\)/,/Loading chunk \d+ failed/,/ChunkLoadError/,/Failed to fetch dynamically imported module/,/vite:preloadError/],integrations:[b.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:R,matchRoutes:j,useEffect:h.useEffect,useLocation:T,useNavigationType:w}),...n||[]],release:E,replaysOnErrorSampleRate:c||1,replaysSessionSampleRate:a||.1,tracePropagationTargets:f,tracesSampleRate:o||1}),null},He=({IMaskMixin:t,...n})=>{const o=h.useMemo(()=>t(({TextField:a,...c})=>Y.jsx(a,{...c})),[t]);return Y.jsx(o,{...n})},Xe=({accessToken:t,...n})=>{const{libraries:o}=h.useContext(k),a=(n==null?void 0:n.mapbox)||(o==null?void 0:o.mapbox);if(!a)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return t&&(a.accessToken=t),null},Ze=({language:t,...n})=>{const{libraries:o}=h.useContext(k),a=(n==null?void 0:n.dayjs)||(o==null?void 0:o.dayjs),c=(n==null?void 0:n.plugin)||(o==null?void 0:o.dayjsPlugin);if(!a)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return h.useEffect(()=>{(async()=>{var d;const l=t||((d=navigator.language)==null?void 0:d.slice(0,2))||"en";c&&c.forEach(s=>{s&&a.extend(s)}),await import("dayjs/locale/en"),await import("dayjs/locale/fr"),a.locale(l)})().then()},[a,c,t]),null},$e=()=>(h.useEffect(()=>{const t=n=>{try{n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation(),window.location.reload()}catch{}};return window.addEventListener("vite:preloadError",t),()=>{window.removeEventListener("vite:preloadError",t)}},[]),null),qe=t=>t&&typeof t=="function",et=t=>t&&typeof t=="function",tt=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:o,...a})=>{var s,E;const{libraries:c}=h.useContext(k),f=(a==null?void 0:a.QueryClient)||((s=c==null?void 0:c.reactQuery)==null?void 0:s.QueryClient),l=(a==null?void 0:a.QueryClientProvider)||((E=c==null?void 0:c.reactQuery)==null?void 0:E.QueryClientProvider);if(!f)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!l)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!qe(l))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!et(f))throw new Error("Provided QueryClient dependencies are not valid.");const d=new f({defaultOptions:{mutations:{...o},queries:{getNextPageParam:(g,P,b)=>g.length+(b||0),refetchOnWindowFocus:!1,retry:3,...n}}});return Y.jsx(l,{client:d,children:t})},rt=t=>{var E,g,P;const{libraries:n}=h.useContext(k),o=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),a=((E=t==null?void 0:t.i18)==null?void 0:E.translateFunction)||((g=n==null?void 0:n.i18)==null?void 0:g.translateFunction),c=((P=o==null?void 0:o.i18next)==null?void 0:P.t)||a||(b=>b),{unknownErrorTranslationKey:f="error.unknownError"}=t||{},l=c(f),d=h.useCallback(b=>{var R,j,T,w,_,D,L,N,O;const{response:u}=b||{};return u!=null&&u.reason?String(u.reason):(R=u==null?void 0:u.data)!=null&&R.reason?String(u.data.reason):(j=u==null?void 0:u.data)!=null&&j.message?String(u.data.message):(w=(T=u==null?void 0:u.data)==null?void 0:T.detail)!=null&&w.length&&Array.isArray((_=u==null?void 0:u.data)==null?void 0:_.detail)&&((L=(D=u==null?void 0:u.data)==null?void 0:D.detail[0])!=null&&L.msg)&&typeof((O=(N=u==null?void 0:u.data)==null?void 0:N.detail[0])==null?void 0:O.msg)=="string"?String(u.data.detail[0].msg):l},[l]);return{getErrorCode:h.useCallback(b=>{var R,j,T;const{response:u}=b||{};return u!=null&&u.error_code?String(u==null?void 0:u.error_code):(R=u==null?void 0:u.data)!=null&&R.error_code?String((j=u==null?void 0:u.data)==null?void 0:j.error_code):u!=null&&u.error_code?String(u==null?void 0:u.error_code):(T=u==null?void 0:u.data)!=null&&T.error_code?String(u.data.error_code):"unknown_error_code"},[]),printError:d}},nt=({data:t,fetchNextPage:n,isFetchingNextPage:o,isInitialLoading:a,isLoading:c,enabled:f=!0})=>{const l=h.useCallback(async s=>{o||!f||await n({pageParam:(s==null?void 0:s.pageParam)||s.visibleRowsCount})},[f,n,o]),d=h.useMemo(()=>{if(t)return t.pages.reduce((s,E)=>[...s,...E],[])},[t]);return{fetchNextPageOnRowsScrollEnd:l,isLoading:o||c,loadingVariant:a?"skeleton":"linear",rows:d}},ot=t=>{const{libraries:n}=h.useContext(k),o=(t==null?void 0:t.axios)||(n==null?void 0:n.axios),a=(t==null?void 0:t.localStorageKey)||"user";if(!o)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");const c=h.useCallback(({tokenType:l,accessToken:d})=>{o.defaults.headers.common.Authorization=`${l} ${d}`},[o.defaults.headers.common]),f=()=>{o.defaults.headers.common.Authorization=null};return h.useEffect(()=>{const l=({newValue:d,key:s})=>{if(s===a&&d)try{const{accessToken:E,tokenType:g}=JSON.parse(d);c({accessToken:E,tokenType:g})}catch(E){console.error("Failed to parse newValue from localStorage:",E)}};return window.addEventListener("storage",l),()=>{window.removeEventListener("storage",l)}},[a,c]),{clearAuthenticationToken:f,setAuthenticationToken:c}},ve=({library:t,date:n,format:o="ll"})=>t(n).format(o),ge=(t,n="km")=>{const o=Number(t);return Number.isNaN(o)?`0 ${n}`:`${o.toFixed(2)} ${n}`},at=t=>t!=null&&t.startsWith("/")?t!=null&&t.startsWith("/files")?t:`/files${t}`:t!=null&&t.startsWith("files")?`/${t}`:`/files/${t}`,it=({path:t,size:n,apiURL:o})=>{if(!t)return"";const a=at(t),c=`${o}${a}`,f=c.match(/\.(jpeg|jpg|png|gif|bmp|webp|svg|avif)$/)!==null;return typeof n=="number"&&f?`${c.replace("/files",`/thumbs/${n}`)}`:c},ct=t=>{const{apiURL:n,libraries:o}=h.useContext(k),a=(t==null?void 0:t.dayjs)||(o==null?void 0:o.dayjs);return{dateAdapter:(l,d)=>{if(!a)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return ve({date:l,format:d,library:a})},distanceAdapter:ge,filePathAdapter:(l,d)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return it({apiURL:n,path:l,size:d})}}},H=(t,n)=>n==="short"?t.split("-")[0]:t,st=(t,n="full")=>{const[o,a]=h.useState(()=>{const c=(t==null?void 0:t.language)||navigator.language;return t&&"isInitialized"in t&&t.isInitialized,H(c,n)});return h.useEffect(()=>{var f;t&&"isInitialized"in t&&t.isInitialized&&t.language&&a(H(t.language,n));const c=l=>{a(H(l,n))};return(f=t==null?void 0:t.on)==null||f.call(t,"languageChanged",c),()=>{var l;(l=t==null?void 0:t.off)==null||l.call(t,"languageChanged",c)}},[t,n]),o},ut="tracktor.filter",he=(t,n,o)=>`${o}_${t}=>${n}`,lt=t=>{const{libraries:n,localStorageKeys:o}=h.useContext(k),a=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),{useLocation:c,useSearchParams:f}=a,{pathname:l}=c(),[d,s]=f(),E=(o==null?void 0:o.filter)||ut;if(!a)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const g=(R,j,T=!0)=>{const w=he(R,(t==null?void 0:t.pathname)||l,E);if(!j||Array.isArray(j)&&!j.length){d.delete(R),s(d),localStorage.removeItem(w);return}T&&j&&localStorage.setItem(w,JSON.stringify({...d,[R]:j})),j&&(d.set(R,JSON.stringify(j)),s(d))};return{getFilter:(R,j)=>{const T=d.get(R);if(T)try{return JSON.parse(T)}catch{return T}const w=he(R,(t==null?void 0:t.pathname)||l,E),_=localStorage.getItem(w);if(_)try{return JSON.parse(_)[R]}catch{}return j},getFilters:()=>{const R=Object.fromEntries(d.entries()),T=Object.keys(localStorage).filter(w=>w.startsWith(E)&&w.endsWith((t==null?void 0:t.pathname)||l)).reduce((w,_)=>{var L,N;const D=localStorage.getItem(_);if(D){const O=JSON.parse(D),X=(L=Object.keys(O))==null?void 0:L[0];w[X]=(N=Object.values(O))==null?void 0:N[0]}return w},{});return{...R,...T}},handleFilter:(R,j)=>(T,w)=>{if(w||Array.isArray(w)&&w.length===0){const _=j||"value",D=typeof w=="object"&&_ in w?w[_||"value"]:w;g(R,D);return}g(R,void 0)},setFilter:g}},ft=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),dt=t=>{const a=t.split("/").filter(c=>c.length>0).map(c=>c.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join("")).join("");return a.charAt(0).toLowerCase()+a.slice(1)},vt=t=>(t.split("/").pop()||t).replace(/\.json$/,"").replace(/^openapi\./,""),gt=(t,n,o)=>{const a=dt(n),c=ft(o);return`${a}${c}`},ht=t=>{if(t)return(t==null?void 0:t.reduce((n,o)=>(n[o]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},yt=t=>(Array.isArray(t)?t:[t]).reduce((o,a)=>{const{output:c,operationsToGenerateInfiniteQueryHook:f,input:l="./openapi.json"}=a||{},d=vt(l);return{...o,[d]:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:l,output:{baseUrl:c==null?void 0:c.baseUrl,client:"react-query",mode:"tags-split",override:{...(f==null?void 0:f.length)&&{operations:ht(f)},header:s=>["Generated by orval 🍺",...s.title?[s.title]:[],...s.description?[s.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/axiosCustomInstance.ts`},operationName:gt,query:{useQuery:!0}},schemas:(c==null?void 0:c.schemas)||`src/api/${d}/model`,target:(c==null?void 0:c.target)||`src/api/${d}/services/api.ts`,...c}}}},{});p.GTMSendPageView=Ge,p.InitializeAxiosConfig=Be,p.InitializeDaysJSConfig=Ze,p.InitializeI18nConfig=Qe,p.InitializeMapBoxConfig=Xe,p.InitializeSentryConfig=Ke,p.InjectDependenciesContext=k,p.InjectDependenciesProvider=Ve,p.MaskTextField=He,p.PreloadErrorHandler=$e,p.QueryClientProviderWithConfig=tt,p.RequireAuth=Ue,p.dateAdapter=ve,p.distanceAdapter=ge,p.getOrvalConfig=yt,p.useAdapter=ct,p.useAuth=ot,p.useCurrentLanguage=st,p.useFilters=lt,p.useInfiniteDataGrid=nt,p.useResponseError=rt,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "2.6.3",
3
+ "version": "2.7.0",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",
@@ -1,3 +0,0 @@
1
- import useAdapter from "./useAdapter";
2
- export default useAdapter;
3
- export * from "./useAdapter";
@@ -1,2 +0,0 @@
1
- import useInfiniteDataGrid from "./useAuth";
2
- export default useInfiniteDataGrid;
@@ -1,3 +0,0 @@
1
- import useCurrentLanguage from "./useCurrentLanguage";
2
- export default useCurrentLanguage;
3
- export * from "./useCurrentLanguage";
@@ -1,2 +0,0 @@
1
- import useInfiniteDataGrid from "./useInfiniteDataGrid";
2
- export default useInfiniteDataGrid;
@@ -1,3 +0,0 @@
1
- import useResponseError from "./useResponseError";
2
- export default useResponseError;
3
- export * from "./useResponseError";