@tracktor/shared-module 1.0.9 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -2
- package/README.md +13 -10
- package/dist/_commonjsHelpers-f3sTPFkQ.js +8 -0
- package/dist/components/Utils/GTMSendPageView.d.ts +13 -1
- package/dist/components/Utils/InitializeAxiosConfig.d.ts +5 -0
- package/dist/components/Utils/InitializeDaysJSConfig.d.ts +10 -1
- package/dist/components/Utils/InitializeI18nConfig.d.ts +6 -1
- package/dist/components/Utils/InitializeMapBoxConfig.d.ts +7 -1
- package/dist/components/Utils/InitializeSentryConfig.d.ts +10 -1
- package/dist/components/Utils/RequireAuth.d.ts +22 -12
- package/dist/context/InjectDependenciesProvider.d.ts +42 -4
- package/dist/context/QueryClientProviderWithConfig.d.ts +12 -4
- package/dist/{en-bFWwYyLH.js → en-0dymtpPB.js} +1 -1
- package/dist/{fr-WPlDe-ow.js → fr-gOnMbGck.js} +5 -5
- package/dist/hooks/useAdapter/useAdapter.d.ts +13 -2
- package/dist/hooks/useAuth/useAuth.d.ts +8 -1
- package/dist/hooks/useResponseError/useResponseError.d.ts +6 -1
- package/dist/localizedFormat-EVzQkWw5.js +48 -0
- package/dist/main.js +950 -19
- package/dist/main.umd.cjs +10 -10
- package/dist/utils/adapter/dateAdapter.d.ts +5 -2
- package/package.json +3 -20
- package/dist/main-YTkqJNOe.js +0 -944
package/dist/main.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(b,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("react"),require("dayjs")):typeof define=="function"&&define.amd?define(["exports","react","dayjs"],g):(b=typeof globalThis<"u"?globalThis:b||self,g(b["@tracktor/shared-module"]={},b.React,b.require$$0$1))})(this,function(b,g,Ve){"use strict";function Ue(t,n){for(var a=0;a<n.length;a++){const i=n[a];if(typeof i!="string"&&!Array.isArray(i)){for(const s in i)if(s!=="default"&&!(s in t)){const c=Object.getOwnPropertyDescriptor(i,s);c&&Object.defineProperty(t,s,c.get?c:{enumerable:!0,get:()=>i[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var ee=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Be(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var te={exports:{}},V={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.development.js
|
|
4
4
|
*
|
|
@@ -6,17 +6,17 @@
|
|
|
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
|
|
10
|
-
`+
|
|
11
|
-
`),
|
|
12
|
-
`),
|
|
13
|
-
`+
|
|
9
|
+
*/var le;function Ge(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var t=g,n=Symbol.for("react.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),o=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),E=Symbol.for("react.lazy"),D=Symbol.for("react.offscreen"),S=Symbol.iterator,O="@@iterator";function x(e){if(e===null||typeof e!="object")return null;var r=S&&e[S]||e[O];return typeof r=="function"?r:null}var M=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(e){{for(var r=arguments.length,u=new Array(r>1?r-1:0),v=1;v<r;v++)u[v-1]=arguments[v];N("error",e,u)}}function N(e,r,u){{var v=M.ReactDebugCurrentFrame,p=v.getStackAddendum();p!==""&&(r+="%s",u=u.concat([p]));var R=u.map(function(y){return String(y)});R.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,R)}}var H=!1,Q=!1,T=!1,ge=!1,pe=!1,B;B=Symbol.for("react.module.reference");function pt(e){return!!(typeof e=="string"||typeof e=="function"||e===i||e===c||pe||e===s||e===o||e===h||ge||e===D||H||Q||T||typeof e=="object"&&e!==null&&(e.$$typeof===E||e.$$typeof===_||e.$$typeof===l||e.$$typeof===d||e.$$typeof===f||e.$$typeof===B||e.getModuleId!==void 0))}function _t(e,r,u){var v=e.displayName;if(v)return v;var p=r.displayName||r.name||"";return p!==""?u+"("+p+")":u}function _e(e){return e.displayName||"Context"}function I(e){if(e==null)return null;if(typeof e.tag=="number"&&w("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 i:return"Fragment";case a:return"Portal";case c:return"Profiler";case s:return"StrictMode";case o:return"Suspense";case h:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case d:var r=e;return _e(r)+".Consumer";case l:var u=e;return _e(u._context)+".Provider";case f:return _t(e,e.render,"ForwardRef");case _:var v=e.displayName||null;return v!==null?v:I(e.type)||"Memo";case E:{var p=e,R=p._payload,y=p._init;try{return I(y(R))}catch{return null}}}return null}var F=Object.assign,G=0,Ee,Re,be,we,Ce,je,Te;function Se(){}Se.__reactDisabledLog=!0;function Et(){{if(G===0){Ee=console.log,Re=console.info,be=console.warn,we=console.error,Ce=console.group,je=console.groupCollapsed,Te=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Se,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}G++}}function Rt(){{if(G--,G===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},e,{value:Ee}),info:F({},e,{value:Re}),warn:F({},e,{value:be}),error:F({},e,{value:we}),group:F({},e,{value:Ce}),groupCollapsed:F({},e,{value:je}),groupEnd:F({},e,{value:Te})})}G<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=M.ReactCurrentDispatcher,ne;function X(e,r,u){{if(ne===void 0)try{throw Error()}catch(p){var v=p.stack.trim().match(/\n( *(at )?)/);ne=v&&v[1]||""}return`
|
|
10
|
+
`+ne+e}}var oe=!1,K;{var bt=typeof WeakMap=="function"?WeakMap:Map;K=new bt}function Pe(e,r){if(!e||oe)return"";{var u=K.get(e);if(u!==void 0)return u}var v;oe=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var R;R=re.current,re.current=null,Et();try{if(r){var y=function(){throw Error()};if(Object.defineProperty(y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(y,[])}catch(L){v=L}Reflect.construct(e,[],y)}else{try{y.call()}catch(L){v=L}e.call(y.prototype)}}else{try{throw Error()}catch(L){v=L}e()}}catch(L){if(L&&v&&typeof L.stack=="string"){for(var m=L.stack.split(`
|
|
11
|
+
`),P=v.stack.split(`
|
|
12
|
+
`),C=m.length-1,j=P.length-1;C>=1&&j>=0&&m[C]!==P[j];)j--;for(;C>=1&&j>=0;C--,j--)if(m[C]!==P[j]){if(C!==1||j!==1)do if(C--,j--,j<0||m[C]!==P[j]){var Y=`
|
|
13
|
+
`+m[C].replace(" at new "," at ");return e.displayName&&Y.includes("<anonymous>")&&(Y=Y.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,Y),Y}while(C>=1&&j>=0);break}}}finally{oe=!1,re.current=R,Rt(),Error.prepareStackTrace=p}var z=e?e.displayName||e.name:"",ze=z?X(z):"";return typeof e=="function"&&K.set(e,ze),ze}function wt(e,r,u){return Pe(e,!1)}function Ct(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Z(e,r,u){if(e==null)return"";if(typeof e=="function")return Pe(e,Ct(e));if(typeof e=="string")return X(e);switch(e){case o:return X("Suspense");case h:return X("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return wt(e.render);case _:return Z(e.type,r,u);case E:{var v=e,p=v._payload,R=v._init;try{return Z(R(p),r,u)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,Oe={},xe=M.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,u=Z(e.type,e._source,r?r.type:null);xe.setExtraStackFrame(u)}else xe.setExtraStackFrame(null)}function jt(e,r,u,v,p){{var R=Function.call.bind($);for(var y in e)if(R(e,y)){var m=void 0;try{if(typeof e[y]!="function"){var P=Error((v||"React class")+": "+u+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw P.name="Invariant Violation",P}m=e[y](r,y,v,u,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(C){m=C}m&&!(m instanceof Error)&&(q(p),w("%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",u,y,typeof m),q(null)),m instanceof Error&&!(m.message in Oe)&&(Oe[m.message]=!0,q(p),w("Failed %s type: %s",u,m.message),q(null))}}}var Tt=Array.isArray;function ae(e){return Tt(e)}function St(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,u=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return u}}function Pt(e){try{return Ae(e),!1}catch{return!0}}function Ae(e){return""+e}function De(e){if(Pt(e))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",St(e)),Ae(e)}var J=M.ReactCurrentOwner,Ot={key:!0,ref:!0,__self:!0,__source:!0},Me,Ye,ie;ie={};function xt(e){if($.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($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Dt(e,r){if(typeof e.ref=="string"&&J.current&&r&&J.current.stateNode!==r){var u=I(J.current.type);ie[u]||(w('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',I(J.current.type),e.ref),ie[u]=!0)}}function Mt(e,r){{var u=function(){Me||(Me=!0,w("%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))};u.isReactWarning=!0,Object.defineProperty(e,"key",{get:u,configurable:!0})}}function Yt(e,r){{var u=function(){Ye||(Ye=!0,w("%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))};u.isReactWarning=!0,Object.defineProperty(e,"ref",{get:u,configurable:!0})}}var kt=function(e,r,u,v,p,R,y){var m={$$typeof:n,type:e,key:r,ref:u,props:y,_owner:R};return m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(m,"_self",{configurable:!1,enumerable:!1,writable:!1,value:v}),Object.defineProperty(m,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m};function It(e,r,u,v,p){{var R,y={},m=null,P=null;u!==void 0&&(De(u),m=""+u),At(r)&&(De(r.key),m=""+r.key),xt(r)&&(P=r.ref,Dt(r,p));for(R in r)$.call(r,R)&&!Ot.hasOwnProperty(R)&&(y[R]=r[R]);if(e&&e.defaultProps){var C=e.defaultProps;for(R in C)y[R]===void 0&&(y[R]=C[R])}if(m||P){var j=typeof e=="function"?e.displayName||e.name||"Unknown":e;m&&Mt(y,j),P&&Yt(y,j)}return kt(e,m,P,p,v,J.current,y)}}var ue=M.ReactCurrentOwner,ke=M.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,u=Z(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(u)}else ke.setExtraStackFrame(null)}var se;se=!1;function ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Ie(){{if(ue.current){var e=I(ue.current.type);if(e)return`
|
|
14
14
|
|
|
15
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
15
|
+
Check the render method of \``+e+"`."}return""}}function Lt(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),u=e.lineNumber;return`
|
|
16
16
|
|
|
17
|
-
Check your code at `+
|
|
17
|
+
Check your code at `+r+":"+u+"."}return""}}var Le={};function Ft(e){{var r=Ie();if(!r){var u=typeof e=="string"?e:e.displayName||e.name;u&&(r=`
|
|
18
18
|
|
|
19
|
-
Check the top-level render call using <`+
|
|
19
|
+
Check the top-level render call using <`+u+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var u=Ft(r);if(Le[u])return;Le[u]=!0;var v="";e&&e._owner&&e._owner!==ue.current&&(v=" It was passed a child from "+I(e._owner.type)+"."),W(e),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',u,v),W(null)}}function Ne(e,r){{if(typeof e!="object")return;if(ae(e))for(var u=0;u<e.length;u++){var v=e[u];ce(v)&&Fe(v,r)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var p=x(e);if(typeof p=="function"&&p!==e.entries)for(var R=p.call(e),y;!(y=R.next()).done;)ce(y.value)&&Fe(y.value,r)}}}function Nt(e){{var r=e.type;if(r==null||typeof r=="string")return;var u;if(typeof r=="function")u=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===_))u=r.propTypes;else return;if(u){var v=I(r);jt(u,e.props,"prop",v,e)}else if(r.PropTypes!==void 0&&!se){se=!0;var p=I(r);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&w("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),u=0;u<r.length;u++){var v=r[u];if(v!=="children"&&v!=="key"){W(e),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",v),W(null);break}}e.ref!==null&&(W(e),w("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function We(e,r,u,v,p,R){{var y=pt(e);if(!y){var m="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(m+=" 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 P=Lt(p);P?m+=P:m+=Ie();var C;e===null?C="null":ae(e)?C="array":e!==void 0&&e.$$typeof===n?(C="<"+(I(e.type)||"Unknown")+" />",m=" Did you accidentally export a JSX literal instead of a component?"):C=typeof e,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",C,m)}var j=It(e,r,u,p,R);if(j==null)return j;if(y){var Y=r.children;if(Y!==void 0)if(v)if(ae(Y)){for(var z=0;z<Y.length;z++)Ne(Y[z],e);Object.freeze&&Object.freeze(Y)}else w("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(Y,e)}return e===i?Wt(j):Nt(j),j}}function zt(e,r,u){return We(e,r,u,!0)}function Vt(e,r,u){return We(e,r,u,!1)}var Ut=Vt,Bt=zt;V.Fragment=i,V.jsx=Ut,V.jsxs=Bt}()),V}var U={};/**
|
|
20
20
|
* @license React
|
|
21
21
|
* react-jsx-runtime.production.min.js
|
|
22
22
|
*
|
|
@@ -24,4 +24,4 @@ Check the top-level render call using <`+o+">.")}return t}}function Ne(e,t){{if(
|
|
|
24
24
|
*
|
|
25
25
|
* This source code is licensed under the MIT license found in the
|
|
26
26
|
* LICENSE file in the root directory of this source tree.
|
|
27
|
-
*/var ve;function Ke(){if(ve)return U;ve=1;var r=E,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,p=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function a(l,c,_){var b,S={},j=null,P=null;_!==void 0&&(j=""+_),c.key!==void 0&&(j=""+c.key),c.ref!==void 0&&(P=c.ref);for(b in c)u.call(c,b)&&!y.hasOwnProperty(b)&&(S[b]=c[b]);if(l&&l.defaultProps)for(b in c=l.defaultProps,c)S[b]===void 0&&(S[b]=c[b]);return{$$typeof:n,type:l,key:j,ref:P,props:S,_owner:p.current}}return U.Fragment=i,U.jsx=a,U.jsxs=a,U}process.env.NODE_ENV==="production"?te.exports=Ke():te.exports=Xe();var L=te.exports;const Ze=({Fallback:r,loginPath:n="/login",localStorageKey:i="user",redirect401Path:u="/login",isLogged:p})=>{var S,j,P,x;const[y,a]=E.useState(null),l=k.useLocation(),c=E.useRef(!1),_=typeof p=="function"?p():!!p,b=typeof _=="boolean"?_:_==null?void 0:_.isLogged;return E.useEffect(()=>{c.current||(c.current=!0,M==null||M.interceptors.response.use(h=>h,async h=>{var C;return typeof h=="object"&&h&&"response"in h&&h.response&&typeof h.response=="object"&&"status"in h.response&&h.response&&typeof h.response=="object"&&"status"in h.response&&((C=h==null?void 0:h.response)==null?void 0:C.status)===401&&(M.defaults.headers.common.Authorization=null,localStorage.removeItem(i),a(u)),Promise.reject(h)}))},[i,u]),b&&!y?L.jsx(E.Suspense,{fallback:r,children:(j=(S=l.state)==null?void 0:S.from)!=null&&j.state&&((x=(P=l.state)==null?void 0:P.from)==null?void 0:x.pathname)===n?L.jsx(k.Navigate,{to:l.state.from.state.from.pathname+l.state.from.state.from.search,replace:!0}):L.jsx(k.Outlet,{})}):L.jsx(k.Navigate,{to:n,state:{from:l},replace:!0})},Qe=()=>{const{pathname:r}=k.useLocation(),{sendEvent:n}=Ue.useGoogleTagManager();return E.useEffect(()=>{n({event:"pageView",pathname:r})},[r,n]),L.jsx(k.Outlet,{})},G=E.createContext({apiURL:void 0,children:void 0}),et=({children:r,apiURL:n})=>{const i=E.useMemo(()=>({apiURL:n}),[n]);return L.jsx(G.Provider,{value:i,children:r})},tt=({tokenTypeKey:r="tokenType",userLocalStorageKey:n="user",tokenKey:i="accessToken",postContentType:u="application/json",...p})=>{const{apiURL:y=p.apiURL}=E.useContext(G);if(!M.defaults)return null;const a=localStorage.getItem(n),l=a?JSON.parse(a):null,c=l!=null&&l[r]?l[r]:null,_=l!=null&&l[i]?l[i]:null,b=a?`${c} ${_}`:null;return M.defaults.baseURL=y,M.defaults.headers.post["Content-Type"]=u,b&&(M.defaults.headers.common.Authorization=b),null},rt=({debug:r,resources:n})=>(A!=null&&A.isInitialized||(A.use($e).use(Be.initReactI18next).init({debug:r,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==A.resolvedLanguage&&A.resolvedLanguage&&document.documentElement.setAttribute("lang",A.resolvedLanguage)}),A.on("languageChanged",i=>{document.documentElement.setAttribute("lang",i)})),null),nt=({dsn:r,integrations:n,tracesSampleRate:i,replaysSessionSampleRate:u,replaysOnErrorSampleRate:p,tracePropagationTargets:y,ignoreErrors:a,debug:l,environment:c})=>(Q.isInitialized()||(l||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&Q.init({debug:l,dsn:r,environment:c||"production",ignoreErrors:[...a||[],/dynamically imported module/],integrations:[Q.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:k.createRoutesFromChildren,matchRoutes:k.matchRoutes,useEffect:E.useEffect,useLocation:k.useLocation,useNavigationType:k.useNavigationType}),...n||[]],replaysOnErrorSampleRate:p||1,replaysSessionSampleRate:u||.1,tracePropagationTargets:y,tracesSampleRate:i||1}),null),at=({IMaskMixin:r,...n})=>{const i=E.useMemo(()=>r(({TextField:u,...p})=>L.jsx(u,{...p})),[r]);return L.jsx(i,{...n})},ot=({accessToken:r})=>(r&&(Je.accessToken=r),null);var pe={exports:{}};(function(r,n){(function(i,u){r.exports=u()})(ee,function(){var i={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(u,p,y){var a=p.prototype,l=a.format;y.en.formats=i,a.format=function(c){c===void 0&&(c="YYYY-MM-DDTHH:mm:ssZ");var _=this.$locale().formats,b=function(S,j){return S.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(P,x,h){var J=h&&h.toUpperCase();return x||j[h]||i[h]||j[J].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(I,C,re){return C||re.slice(1)})})}(c,_===void 0?{}:_);return l.call(this,b)}}})})(pe);var it=pe.exports;const ut=He(it);N.extend(ut);const st=({language:r})=>(E.useEffect(()=>{var i;const n=r||((i=navigator.language)==null?void 0:i.slice(0,2))||"en";if(n==="en"){Promise.resolve().then(()=>he).then(()=>{N.locale(n)});return}n==="fr"&&Promise.resolve().then(()=>Rt).then(()=>{N.locale(n)}).catch(()=>{Promise.resolve().then(()=>he).then(()=>{N.locale("en")})})},[r]),null),ct=({children:r,defaultQueriesOptions:n,defaultMutationsOptions:i})=>{const u=new fe.QueryClient({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(p,y,a)=>p.length+(a||0),refetchOnWindowFocus:!1,retry:3,...n}}});return L.jsx(fe.QueryClientProvider,{client:u,children:r})},lt=r=>{const{unknownErrorTranslationKey:n="error.unknownError"}=r||{},i=A.t(n),u=E.useCallback(y=>{var l,c,_,b,S,j,P,x,h;const{response:a}=y||{};return a!=null&&a.reason?String(a.reason):(l=a==null?void 0:a.data)!=null&&l.reason?String(a.data.reason):(c=a==null?void 0:a.data)!=null&&c.message?String(a.data.message):(b=(_=a==null?void 0:a.data)==null?void 0:_.detail)!=null&&b.length&&Array.isArray((S=a==null?void 0:a.data)==null?void 0:S.detail)&&((P=(j=a==null?void 0:a.data)==null?void 0:j.detail[0])!=null&&P.msg)&&typeof((h=(x=a==null?void 0:a.data)==null?void 0:x.detail[0])==null?void 0:h.msg)=="string"?String(a.data.detail[0].msg):i},[i]);return{getErrorCode:E.useCallback(y=>{var l,c,_;const{response:a}=y||{};return a!=null&&a.error_code?String(a==null?void 0:a.error_code):(l=a==null?void 0:a.data)!=null&&l.error_code?String((c=a==null?void 0:a.data)==null?void 0:c.error_code):a!=null&&a.error_code?String(a==null?void 0:a.error_code):(_=a==null?void 0:a.data)!=null&&_.error_code?String(a.data.error_code):"unknown_error_code"},[]),printError:u}},ft=({data:r,fetchNextPage:n,isFetchingNextPage:i,isInitialLoading:u,isLoading:p,enabled:y=!0})=>{const a=E.useCallback(async c=>{i||!y||await n({pageParam:(c==null?void 0:c.pageParam)||c.visibleRowsCount})},[y,n,i]),l=E.useMemo(()=>{if(r)return r.pages.reduce((c,_)=>[...c,..._],[])},[r]);return{fetchNextPageOnRowsScrollEnd:a,isLoading:i||p,loadingVariant:u?"skeleton":"linear",rows:l}},dt=()=>({clearAuthenticationToken:()=>{M.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:i,accessToken:u})=>{M.defaults.headers.common.Authorization=`${i} ${u}`}}),me=(r,n="ll")=>N(r).format(n),ge=(r,n="km")=>{const i=Number(r);return Number.isNaN(i)?`0 ${n}`:`${i.toFixed(2)} ${n}`},vt=r=>{const n=r&&typeof r=="object"&&"pathname"in r&&r.pathname?r.pathname:r;return typeof n=="string"?n!=null&&n.startsWith("/")?n!=null&&n.startsWith("/files")?n:`/files${n}`:n!=null&&n.startsWith("files")?`/${n}`:n!=null&&n.startsWith("files")?`/${n}`:`/files/${n}`:n},_e=(r,n)=>{if(!r)return"";const i=vt(r),u=typeof r=="object"&&"pathname"in r?`${r.origin}${i}`:r;return typeof n=="number"?`${u.replace("/files",`/thumbs/${n}`)}`:u},pt=()=>{const{apiURL:r}=E.useContext(G);return{dateAdapter:me,distanceAdapter:ge,filePathAdapter:(i,u)=>_e(r&&typeof i=="string"?{origin:r,pathname:i}:i,u)}},mt=r=>r.charAt(0).toUpperCase()+r.slice(1).toLowerCase(),gt=r=>{const u=r.split("/").filter(p=>p.length>0).map(p=>p.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(c=>c.charAt(0).toUpperCase()+c.slice(1)).join("")).join("");return u.charAt(0).toLowerCase()+u.slice(1)},_t=(r,n,i)=>{const u=gt(n),p=mt(i);return`${u}${p}`},ht=r=>{if(r)return(r==null?void 0:r.reduce((n,i)=>(n[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},yt=r=>{const{input:n="./openapi.json",operationsToGenerateInfiniteQueryHook:i=void 0}=r||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:n,output:{client:"react-query",mode:"tags-split",override:{header:u=>["Generated by orval 🍺",...u.title?[u.title]:[],...u.description?[u.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:_t,...(i==null?void 0:i.length)&&{operations:ht(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};var bt={exports:{}};(function(r,n){(function(i,u){r.exports=u()})(ee,function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(i){var u=["th","st","nd","rd"],p=i%100;return"["+i+(u[(p-20)%10]||u[p]||u[0])+"]"}}})})(bt);const he=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Et={exports:{}};(function(r,n){(function(i,u){r.exports=u(N)})(ee,function(i){function u(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var p=u(i),y={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(a){return""+a+(a===1?"er":"")}};return p.default.locale(y,null,!0),y})})(Et);const Rt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));d.GTMSendPageView=Qe,d.InitializeAxiosConfig=tt,d.InitializeDaysJSConfig=st,d.InitializeI18nConfig=rt,d.InitializeMapBoxConfig=ot,d.InitializeSentryConfig=nt,d.InjectDependenciesContext=G,d.InjectDependenciesProvider=et,d.MaskTextField=at,d.QueryClientProviderWithConfig=ct,d.RequireAuth=Ze,d.dateAdapter=me,d.distanceAdapter=ge,d.getOrvalConfig=yt,d.useAdapter=pt,d.useAuth=dt,d.useInfiniteDataGrid=ft,d.useResponseError=lt,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
|
|
27
|
+
*/var fe;function Je(){if(fe)return U;fe=1;var t=g,n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(d,f,o){var h,_={},E=null,D=null;o!==void 0&&(E=""+o),f.key!==void 0&&(E=""+f.key),f.ref!==void 0&&(D=f.ref);for(h in f)i.call(f,h)&&!c.hasOwnProperty(h)&&(_[h]=f[h]);if(d&&d.defaultProps)for(h in f=d.defaultProps,f)_[h]===void 0&&(_[h]=f[h]);return{$$typeof:n,type:d,key:E,ref:D,props:_,_owner:s.current}}return U.Fragment=a,U.jsx=l,U.jsxs=l,U}process.env.NODE_ENV==="production"?te.exports=Je():te.exports=Ge();var k=te.exports;const A=g.createContext({}),He=({children:t,apiURL:n,libraries:a})=>{const i=g.useMemo(()=>({apiURL:n,libraries:a}),[n,a]);return k.jsx(A.Provider,{value:i,children:t})},Qe=({Fallback:t,isLogged:n,loginPath:a="/login",localStorageKey:i="user",redirect401Path:s="/login",...c})=>{var w,N,H,Q;const{libraries:l}=g.useContext(A),d=(c==null?void 0:c.axios)||(l==null?void 0:l.axios),f=(c==null?void 0:c.reactRouter)||(l==null?void 0:l.reactRouter);if(f===void 0)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(d===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[o,h]=g.useState(null),{useLocation:_,Navigate:E,Outlet:D}=f,S=_(),O=g.useRef(!1),x=typeof n=="function"?n():!!n,M=typeof x=="boolean"?x:x==null?void 0:x.isLogged;return g.useLayoutEffect(()=>{O.current||(O.current=!0,d==null||d.interceptors.response.use(T=>T,async T=>{var B;return typeof T=="object"&&T&&"response"in T&&T.response&&typeof T.response=="object"&&"status"in T.response&&T.response&&typeof T.response=="object"&&"status"in T.response&&((B=T==null?void 0:T.response)==null?void 0:B.status)===401&&(d.defaults.headers.common.Authorization=null,localStorage.removeItem(i),h(s)),Promise.reject(T)}))},[d==null?void 0:d.defaults.headers.common,d==null?void 0:d.interceptors.response,i,s]),M&&!o?k.jsx(g.Suspense,{fallback:t,children:(N=(w=S.state)==null?void 0:w.from)!=null&&N.state&&((Q=(H=S.state)==null?void 0:H.from)==null?void 0:Q.pathname)===a?k.jsx(E,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):k.jsx(D,{})}):k.jsx(E,{to:a,state:{from:S},replace:!0})},Xe=({...t})=>{const{libraries:n}=g.useContext(A),a=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),i=(t==null?void 0:t.gtm)||(n==null?void 0:n.gtm);if(a===void 0)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(i===void 0)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const{useGoogleTagManager:s}=i,{useLocation:c,Outlet:l}=a,{pathname:d}=c(),{sendEvent:f}=s();return g.useEffect(()=>{f({event:"pageView",pathname:d})},[d,f]),k.jsx(l,{})},Ke=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:a="accessToken",postContentType:i="application/json",...s})=>{const{apiURL:c=s.apiURL,libraries:l}=g.useContext(A),d=(s==null?void 0:s.axios)||(l==null?void 0:l.axios);if(d===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!d.defaults)return null;const f=localStorage.getItem(n),o=f?JSON.parse(f):null,h=o!=null&&o[t]?o[t]:null,_=o!=null&&o[a]?o[a]:null,E=f?`${h} ${_}`:null;return d.defaults.baseURL=c,d.defaults.headers.post["Content-Type"]=i,E&&(d.defaults.headers.common.Authorization=E),null},Ze=({debug:t,resources:n,...a})=>{const{libraries:i}=g.useContext(A),s=(a==null?void 0:a.i18)||(i==null?void 0:i.i18),{i18next:c,initReactI18next:l,languageDetector:d}=s||{};if(s===void 0)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return c!=null&&c.isInitialized||(c.use(d).use(l).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==c.resolvedLanguage&&c.resolvedLanguage&&document.documentElement.setAttribute("lang",c.resolvedLanguage)}),c.on("languageChanged",f=>{document.documentElement.setAttribute("lang",f)})),null},$e=({dsn:t,integrations:n,tracesSampleRate:a,replaysSessionSampleRate:i,replaysOnErrorSampleRate:s,tracePropagationTargets:c,ignoreErrors:l,debug:d,environment:f,...o})=>{const{libraries:h}=g.useContext(A),_=(o==null?void 0:o.sentry)||(h==null?void 0:h.sentry),E=(o==null?void 0:o.reactRouter)||(h==null?void 0:h.reactRouter),{createRoutesFromChildren:D,matchRoutes:S,useLocation:O,useNavigationType:x}=E;if(_===void 0)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(E===void 0)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return _.isInitialized()||(d||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:d,dsn:t,environment:f||"production",ignoreErrors:[...l||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:D,matchRoutes:S,useEffect:g.useEffect,useLocation:O,useNavigationType:x}),...n||[]],replaysOnErrorSampleRate:s||1,replaysSessionSampleRate:i||.1,tracePropagationTargets:c,tracesSampleRate:a||1}),null},qe=({IMaskMixin:t,...n})=>{const a=g.useMemo(()=>t(({TextField:i,...s})=>k.jsx(i,{...s})),[t]);return k.jsx(a,{...n})},et=({accessToken:t,...n})=>{const{libraries:a}=g.useContext(A),i=(n==null?void 0:n.mapbox)||(a==null?void 0:a.mapbox);if(i===void 0)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return t&&(i.accessToken=t),null},tt=({language:t,...n})=>{const{libraries:a}=g.useContext(A),i=(n==null?void 0:n.dayjs)||(a==null?void 0:a.dayjs);if(i===void 0)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return g.useLayoutEffect(()=>{(async()=>{var l;Promise.resolve().then(()=>mt).then(d=>{i.extend(d.default)});const c=t||((l=navigator.language)==null?void 0:l.slice(0,2))||"en";if(c==="en"){Promise.resolve().then(()=>ye).then(()=>{i.locale(c)});return}c==="fr"&&Promise.resolve().then(()=>gt).then(()=>{i.locale(c)}).catch(()=>{Promise.resolve().then(()=>ye).then(()=>{i.locale("en")})})})().then()},[i,t]),null},rt=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:a,...i})=>{var f,o;const{libraries:s}=g.useContext(A),c=(i==null?void 0:i.QueryClient)||((f=s==null?void 0:s.reactQuery)==null?void 0:f.QueryClient),l=(i==null?void 0:i.QueryClientProvider)||((o=s==null?void 0:s.reactQuery)==null?void 0:o.QueryClientProvider);if(c===void 0)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(l===void 0)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const d=new c({defaultOptions:{mutations:{...a},queries:{getNextPageParam:(h,_,E)=>h.length+(E||0),refetchOnWindowFocus:!1,retry:3,...n}}});return k.jsx(l,{client:d,children:t})},nt=t=>{const{libraries:n}=g.useContext(A),a=(t==null?void 0:t.i18)||(n==null?void 0:n.i18);if(a===void 0)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in params of useResponseError.");const{t:i}=a.i18next,{unknownErrorTranslationKey:s="error.unknownError"}=t||{},c=i(s),l=g.useCallback(f=>{var h,_,E,D,S,O,x,M,w;const{response:o}=f||{};return o!=null&&o.reason?String(o.reason):(h=o==null?void 0:o.data)!=null&&h.reason?String(o.data.reason):(_=o==null?void 0:o.data)!=null&&_.message?String(o.data.message):(D=(E=o==null?void 0:o.data)==null?void 0:E.detail)!=null&&D.length&&Array.isArray((S=o==null?void 0:o.data)==null?void 0:S.detail)&&((x=(O=o==null?void 0:o.data)==null?void 0:O.detail[0])!=null&&x.msg)&&typeof((w=(M=o==null?void 0:o.data)==null?void 0:M.detail[0])==null?void 0:w.msg)=="string"?String(o.data.detail[0].msg):c},[c]);return{getErrorCode:g.useCallback(f=>{var h,_,E;const{response:o}=f||{};return o!=null&&o.error_code?String(o==null?void 0:o.error_code):(h=o==null?void 0:o.data)!=null&&h.error_code?String((_=o==null?void 0:o.data)==null?void 0:_.error_code):o!=null&&o.error_code?String(o==null?void 0:o.error_code):(E=o==null?void 0:o.data)!=null&&E.error_code?String(o.data.error_code):"unknown_error_code"},[]),printError:l}},ot=({data:t,fetchNextPage:n,isFetchingNextPage:a,isInitialLoading:i,isLoading:s,enabled:c=!0})=>{const l=g.useCallback(async f=>{a||!c||await n({pageParam:(f==null?void 0:f.pageParam)||f.visibleRowsCount})},[c,n,a]),d=g.useMemo(()=>{if(t)return t.pages.reduce((f,o)=>[...f,...o],[])},[t]);return{fetchNextPageOnRowsScrollEnd:l,isLoading:a||s,loadingVariant:i?"skeleton":"linear",rows:d}},at=t=>{const{libraries:n}=g.useContext(A),a=(t==null?void 0:t.axios)||(n==null?void 0:n.axios);if(a===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");return{clearAuthenticationToken:()=>{a.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:c,accessToken:l})=>{a.defaults.headers.common.Authorization=`${c} ${l}`}}},de=(t,n="km")=>{const a=Number(t);return Number.isNaN(a)?`0 ${n}`:`${a.toFixed(2)} ${n}`},it=t=>{const n=t&&typeof t=="object"&&"pathname"in t&&t.pathname?t.pathname:t;return typeof n=="string"?n!=null&&n.startsWith("/")?n!=null&&n.startsWith("/files")?n:`/files${n}`:n!=null&&n.startsWith("files")?`/${n}`:n!=null&&n.startsWith("files")?`/${n}`:`/files/${n}`:n},ve=(t,n)=>{if(!t)return"";const a=it(t),i=typeof t=="object"&&"pathname"in t?`${t.origin}${a}`:t;return typeof n=="number"?`${i.replace("/files",`/thumbs/${n}`)}`:i},ut=t=>{const{apiURL:n,libraries:a}=g.useContext(A),i=(t==null?void 0:t.dayjs)||(a==null?void 0:a.dayjs);return{dateAdapter:(l,d="ll")=>i(l).format(d),distanceAdapter:de,filePathAdapter:(l,d)=>ve(n&&typeof l=="string"?{origin:n,pathname:l}:l,d)}},st=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),ct=t=>{const i=t.split("/").filter(s=>s.length>0).map(s=>s.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(f=>f.charAt(0).toUpperCase()+f.slice(1)).join("")).join("");return i.charAt(0).toLowerCase()+i.slice(1)},lt=(t,n,a)=>{const i=ct(n),s=st(a);return`${i}${s}`},ft=t=>{if(t)return(t==null?void 0:t.reduce((n,a)=>(n[a]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},dt=t=>{const{input:n="./openapi.json",operationsToGenerateInfiniteQueryHook:a=void 0}=t||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:n,output:{client:"react-query",mode:"tags-split",override:{header:i=>["Generated by orval 🍺",...i.title?[i.title]:[],...i.description?[i.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:lt,...(a==null?void 0:a.length)&&{operations:ft(a)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}},vt=(t,n,a="ll")=>String(t(n).format(a));var me={exports:{}};(function(t,n){(function(a,i){t.exports=i()})(ee,function(){var a={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(i,s,c){var l=s.prototype,d=l.format;c.en.formats=a,l.format=function(f){f===void 0&&(f="YYYY-MM-DDTHH:mm:ssZ");var o=this.$locale().formats,h=function(_,E){return _.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(D,S,O){var x=O&&O.toUpperCase();return S||E[O]||a[O]||E[x].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(M,w,N){return w||N.slice(1)})})}(f,o===void 0?{}:o);return d.call(this,h)}}})})(me);var he=me.exports;const mt=Ue({__proto__:null,default:Be(he)},[he]);var ht={exports:{}};(function(t,n){(function(a,i){t.exports=i()})(ee,function(){return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(a){var i=["th","st","nd","rd"],s=a%100;return"["+a+(i[(s-20)%10]||i[s]||i[0])+"]"}}})})(ht);const ye=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var yt={exports:{}};(function(t,n){(function(a,i){t.exports=i(Ve)})(ee,function(a){function i(l){return l&&typeof l=="object"&&"default"in l?l:{default:l}}var s=i(a),c={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(l){return""+l+(l===1?"er":"")}};return s.default.locale(c,null,!0),c})})(yt);const gt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));b.GTMSendPageView=Xe,b.InitializeAxiosConfig=Ke,b.InitializeDaysJSConfig=tt,b.InitializeI18nConfig=Ze,b.InitializeMapBoxConfig=et,b.InitializeSentryConfig=$e,b.InjectDependenciesContext=A,b.InjectDependenciesProvider=He,b.MaskTextField=qe,b.QueryClientProviderWithConfig=rt,b.RequireAuth=Qe,b.dateAdapter=vt,b.distanceAdapter=de,b.getOrvalConfig=dt,b.useAdapter=ut,b.useAuth=at,b.useInfiniteDataGrid=ot,b.useResponseError=nt,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
type DateAdapterDate = string | number | Date | null | undefined;
|
|
2
2
|
/**
|
|
3
3
|
* Format date to own specific format
|
|
4
|
+
* @param library
|
|
4
5
|
* @param date
|
|
5
6
|
* @param format
|
|
6
7
|
*/
|
|
7
|
-
export declare const dateAdapter: (date:
|
|
8
|
+
export declare const dateAdapter: <T extends (date: DateAdapterDate) => {
|
|
9
|
+
format: (f: string) => {};
|
|
10
|
+
}>(library: T, date: DateAdapterDate, format?: string) => string;
|
|
8
11
|
export default dateAdapter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tracktor/shared-module",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"types": "./dist/main.d.ts",
|
|
@@ -33,24 +33,15 @@
|
|
|
33
33
|
"prepare": "yarn run build && husky install"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@sentry/react": "^8.7.0",
|
|
37
|
-
"@tanstack/react-query": "^5.40.1",
|
|
38
|
-
"@tracktor/react-google-tag-manager": "^1.2.4",
|
|
39
36
|
"axios": "^1.7.2",
|
|
40
37
|
"dayjs": "^1.11.11",
|
|
41
|
-
"i18next": "^23.11.5",
|
|
42
|
-
"i18next-browser-languagedetector": "^8.0.0",
|
|
43
|
-
"mapbox-gl": "^3.4.0",
|
|
44
38
|
"react": "^18.2.0",
|
|
45
|
-
"react-dom": "^18.2.0"
|
|
46
|
-
"react-i18next": "^14.1.2",
|
|
47
|
-
"react-router-dom": "^6.23.1"
|
|
39
|
+
"react-dom": "^18.2.0"
|
|
48
40
|
},
|
|
49
41
|
"devDependencies": {
|
|
50
42
|
"@testing-library/jest-dom": "^5.17.0",
|
|
51
43
|
"@testing-library/react": "^14.0.0",
|
|
52
44
|
"@testing-library/user-event": "^14.5.1",
|
|
53
|
-
"@types/mapbox-gl": "^3.1.0",
|
|
54
45
|
"@types/react": "^18.2.30",
|
|
55
46
|
"@types/react-dom": "^18.2.14",
|
|
56
47
|
"@vitejs/plugin-react": "^4.2.1",
|
|
@@ -64,17 +55,9 @@
|
|
|
64
55
|
"vitest": "^1.3.1"
|
|
65
56
|
},
|
|
66
57
|
"peerDependencies": {
|
|
67
|
-
"@sentry/react": "*",
|
|
68
|
-
"@tanstack/react-query": "*",
|
|
69
|
-
"@tracktor/react-google-tag-manager": "*",
|
|
70
58
|
"axios": "*",
|
|
71
59
|
"dayjs": "*",
|
|
72
|
-
"i18next": "*",
|
|
73
|
-
"i18next-browser-languagedetector": "*",
|
|
74
|
-
"mapbox-gl": "*",
|
|
75
60
|
"react": ">=18.0.0",
|
|
76
|
-
"react-dom": ">=18.0.0"
|
|
77
|
-
"react-i18next": "*",
|
|
78
|
-
"react-router-dom": ">=6.0.0"
|
|
61
|
+
"react-dom": ">=18.0.0"
|
|
79
62
|
}
|
|
80
63
|
}
|