@tracktor/shared-module 0.22.0 → 0.23.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/CHANGELOG.md +2 -2
- package/dist/main.d.ts +0 -4
- package/dist/main.js +2 -3
- package/dist/main.umd.cjs +6 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/main.d.ts
CHANGED
|
@@ -26,7 +26,3 @@ export { default as useAdapter } from './hooks/useAdapter';
|
|
|
26
26
|
export * from './hooks/useAdapter';
|
|
27
27
|
export { default as getOrvalConfig } from './config/orval';
|
|
28
28
|
export * from './config/orval';
|
|
29
|
-
export { default as distanceAdapter } from './utils/adapter/distanceAdapter';
|
|
30
|
-
export * from './utils/adapter/distanceAdapter';
|
|
31
|
-
export { default as filePathAdapter } from './utils/adapter/filePathAdapter';
|
|
32
|
-
export * from './utils/adapter/filePathAdapter';
|
package/dist/main.js
CHANGED
|
@@ -876,7 +876,8 @@ const q = pr({
|
|
|
876
876
|
return (t == null ? void 0 : t.reduce((o, i) => (o[i] = {
|
|
877
877
|
query: {
|
|
878
878
|
useInfinite: !0,
|
|
879
|
-
useInfiniteQueryParam: "offset"
|
|
879
|
+
useInfiniteQueryParam: "offset",
|
|
880
|
+
useQuery: !0
|
|
880
881
|
}
|
|
881
882
|
}, o), {})) || {};
|
|
882
883
|
}, Vr = (t) => {
|
|
@@ -923,8 +924,6 @@ export {
|
|
|
923
924
|
Lr as QueryClientConfigProvider,
|
|
924
925
|
Pr as RequireAuth,
|
|
925
926
|
$r as SentryConfig,
|
|
926
|
-
_r as distanceAdapter,
|
|
927
|
-
Ie as filePathAdapter,
|
|
928
927
|
Vr as getOrvalConfig,
|
|
929
928
|
Mr as useAdapter,
|
|
930
929
|
Wr as useAuth,
|
package/dist/main.umd.cjs
CHANGED
|
@@ -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
|
-
`+
|
|
9
|
+
*/var se;function Ne(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var t=E,o=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),n=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),F=Symbol.iterator,I="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=F&&e[F]||e[I];return typeof r=="function"?r:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function C(e){{for(var r=arguments.length,a=new Array(r>1?r-1:0),u=1;u<r;u++)a[u-1]=arguments[u];w("error",e,a)}}function w(e,r,a){{var u=k.ReactDebugCurrentFrame,p=u.getStackAddendum();p!==""&&(r+="%s",a=a.concat([p]));var g=a.map(function(d){return String(d)});g.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,g)}}var fe=!1,de=!1,J=!1,ar=!1,or=!1,ve;ve=Symbol.for("react.module.reference");function ir(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===v||or||e===c||e===h||e===m||ar||e===O||fe||de||J||typeof e=="object"&&e!==null&&(e.$$typeof===j||e.$$typeof===S||e.$$typeof===y||e.$$typeof===n||e.$$typeof===l||e.$$typeof===ve||e.getModuleId!==void 0))}function ur(e,r,a){var u=e.displayName;if(u)return u;var p=r.displayName||r.name||"";return p!==""?a+"("+p+")":a}function pe(e){return e.displayName||"Context"}function x(e){if(e==null)return null;if(typeof e.tag=="number"&&C("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 i:return"Portal";case v:return"Profiler";case c:return"StrictMode";case h:return"Suspense";case m:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n:var r=e;return pe(r)+".Consumer";case y:var a=e;return pe(a._context)+".Provider";case l:return ur(e,e.render,"ForwardRef");case S:var u=e.displayName||null;return u!==null?u:x(e.type)||"Memo";case j:{var p=e,g=p._payload,d=p._init;try{return x(d(g))}catch{return null}}}return null}var N=Object.assign,z=0,ge,me,he,Ee,ye,be,Re;function _e(){}_e.__reactDisabledLog=!0;function sr(){{if(z===0){ge=console.log,me=console.info,he=console.warn,Ee=console.error,ye=console.group,be=console.groupCollapsed,Re=console.groupEnd;var e={configurable:!0,enumerable:!0,value:_e,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}z++}}function cr(){{if(z--,z===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:N({},e,{value:ge}),info:N({},e,{value:me}),warn:N({},e,{value:he}),error:N({},e,{value:Ee}),group:N({},e,{value:ye}),groupCollapsed:N({},e,{value:be}),groupEnd:N({},e,{value:Re})})}z<0&&C("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ee=k.ReactCurrentDispatcher,re;function $(e,r,a){{if(re===void 0)try{throw Error()}catch(p){var u=p.stack.trim().match(/\n( *(at )?)/);re=u&&u[1]||""}return`
|
|
10
|
+
`+re+e}}var te=!1,X;{var lr=typeof WeakMap=="function"?WeakMap:Map;X=new lr}function Ce(e,r){if(!e||te)return"";{var a=X.get(e);if(a!==void 0)return a}var u;te=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var g;g=ee.current,ee.current=null,sr();try{if(r){var d=function(){throw Error()};if(Object.defineProperty(d.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(d,[])}catch(D){u=D}Reflect.construct(e,[],d)}else{try{d.call()}catch(D){u=D}e.call(d.prototype)}}else{try{throw Error()}catch(D){u=D}e()}}catch(D){if(D&&u&&typeof D.stack=="string"){for(var f=D.stack.split(`
|
|
11
11
|
`),T=u.stack.split(`
|
|
12
12
|
`),R=f.length-1,_=T.length-1;R>=1&&_>=0&&f[R]!==T[_];)_--;for(;R>=1&&_>=0;R--,_--)if(f[R]!==T[_]){if(R!==1||_!==1)do if(R--,_--,_<0||f[R]!==T[_]){var P=`
|
|
13
|
-
`+f[R].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&X.set(e,P),P}while(R>=1&&_>=0);break}}}finally{
|
|
13
|
+
`+f[R].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),typeof e=="function"&&X.set(e,P),P}while(R>=1&&_>=0);break}}}finally{te=!1,ee.current=g,cr(),Error.prepareStackTrace=p}var V=e?e.displayName||e.name:"",Le=V?$(V):"";return typeof e=="function"&&X.set(e,Le),Le}function fr(e,r,a){return Ce(e,!1)}function dr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function H(e,r,a){if(e==null)return"";if(typeof e=="function")return Ce(e,dr(e));if(typeof e=="string")return $(e);switch(e){case h:return $("Suspense");case m:return $("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return fr(e.render);case S:return H(e.type,r,a);case j:{var u=e,p=u._payload,g=u._init;try{return H(g(p),r,a)}catch{}}}return""}var K=Object.prototype.hasOwnProperty,we={},Te=k.ReactDebugCurrentFrame;function Z(e){if(e){var r=e._owner,a=H(e.type,e._source,r?r.type:null);Te.setExtraStackFrame(a)}else Te.setExtraStackFrame(null)}function vr(e,r,a,u,p){{var g=Function.call.bind(K);for(var d in e)if(g(e,d)){var f=void 0;try{if(typeof e[d]!="function"){var T=Error((u||"React class")+": "+a+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw T.name="Invariant Violation",T}f=e[d](r,d,u,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(R){f=R}f&&!(f instanceof Error)&&(Z(p),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).",u||"React class",a,d,typeof f),Z(null)),f instanceof Error&&!(f.message in we)&&(we[f.message]=!0,Z(p),C("Failed %s type: %s",a,f.message),Z(null))}}}var pr=Array.isArray;function ne(e){return pr(e)}function gr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,a=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function mr(e){try{return Se(e),!1}catch{return!0}}function Se(e){return""+e}function Oe(e){if(mr(e))return C("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",gr(e)),Se(e)}var B=k.ReactCurrentOwner,hr={key:!0,ref:!0,__self:!0,__source:!0},je,Pe,ae;ae={};function Er(e){if(K.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function yr(e){if(K.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function br(e,r){if(typeof e.ref=="string"&&B.current&&r&&B.current.stateNode!==r){var a=x(B.current.type);ae[a]||(C('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',x(B.current.type),e.ref),ae[a]=!0)}}function Rr(e,r){{var a=function(){je||(je=!0,C("%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 _r(e,r){{var a=function(){Pe||(Pe=!0,C("%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 Cr=function(e,r,a,u,p,g,d){var f={$$typeof:o,type:e,key:r,ref:a,props:d,_owner:g};return f._store={},Object.defineProperty(f._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(f,"_self",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.defineProperty(f,"_source",{configurable:!1,enumerable:!1,writable:!1,value:p}),Object.freeze&&(Object.freeze(f.props),Object.freeze(f)),f};function wr(e,r,a,u,p){{var g,d={},f=null,T=null;a!==void 0&&(Oe(a),f=""+a),yr(r)&&(Oe(r.key),f=""+r.key),Er(r)&&(T=r.ref,br(r,p));for(g in r)K.call(r,g)&&!hr.hasOwnProperty(g)&&(d[g]=r[g]);if(e&&e.defaultProps){var R=e.defaultProps;for(g in R)d[g]===void 0&&(d[g]=R[g])}if(f||T){var _=typeof e=="function"?e.displayName||e.name||"Unknown":e;f&&Rr(d,_),T&&_r(d,_)}return Cr(e,f,T,p,u,B.current,d)}}var oe=k.ReactCurrentOwner,Ae=k.ReactDebugCurrentFrame;function W(e){if(e){var r=e._owner,a=H(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(a)}else Ae.setExtraStackFrame(null)}var ie;ie=!1;function ue(e){return typeof e=="object"&&e!==null&&e.$$typeof===o}function ke(){{if(oe.current){var e=x(oe.current.type);if(e)return`
|
|
14
14
|
|
|
15
15
|
Check the render method of \``+e+"`."}return""}}function Tr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),a=e.lineNumber;return`
|
|
16
16
|
|
|
17
|
-
Check your code at `+r+":"+a+"."}return""}}var
|
|
17
|
+
Check your code at `+r+":"+a+"."}return""}}var xe={};function Sr(e){{var r=ke();if(!r){var a=typeof e=="string"?e:e.displayName||e.name;a&&(r=`
|
|
18
18
|
|
|
19
|
-
Check the top-level render call using <`+a+">.")}return r}}function
|
|
19
|
+
Check the top-level render call using <`+a+">.")}return r}}function De(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=Sr(r);if(xe[a])return;xe[a]=!0;var u="";e&&e._owner&&e._owner!==oe.current&&(u=" It was passed a child from "+x(e._owner.type)+"."),W(e),C('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,u),W(null)}}function Fe(e,r){{if(typeof e!="object")return;if(ne(e))for(var a=0;a<e.length;a++){var u=e[a];ue(u)&&De(u,r)}else if(ue(e))e._store&&(e._store.validated=!0);else if(e){var p=L(e);if(typeof p=="function"&&p!==e.entries)for(var g=p.call(e),d;!(d=g.next()).done;)ue(d.value)&&De(d.value,r)}}}function Or(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===l||r.$$typeof===S))a=r.propTypes;else return;if(a){var u=x(r);vr(a,e.props,"prop",u,e)}else if(r.PropTypes!==void 0&&!ie){ie=!0;var p=x(r);C("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",p||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&C("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function jr(e){{for(var r=Object.keys(e.props),a=0;a<r.length;a++){var u=r[a];if(u!=="children"&&u!=="key"){W(e),C("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",u),W(null);break}}e.ref!==null&&(W(e),C("Invalid attribute `ref` supplied to `React.Fragment`."),W(null))}}function Ie(e,r,a,u,p,g){{var d=ir(e);if(!d){var f="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(f+=" 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 T=Tr(p);T?f+=T:f+=ke();var R;e===null?R="null":ne(e)?R="array":e!==void 0&&e.$$typeof===o?(R="<"+(x(e.type)||"Unknown")+" />",f=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,C("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,f)}var _=wr(e,r,a,p,g);if(_==null)return _;if(d){var P=r.children;if(P!==void 0)if(u)if(ne(P)){for(var V=0;V<P.length;V++)Fe(P[V],e);Object.freeze&&Object.freeze(P)}else C("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 Fe(P,e)}return e===s?jr(_):Or(_),_}}function Pr(e,r,a){return Ie(e,r,a,!0)}function Ar(e,r,a){return Ie(e,r,a,!1)}var kr=Ar,xr=Pr;Y.Fragment=s,Y.jsx=kr,Y.jsxs=xr}()),Y}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 <`+a+">.")}return r}}function Fe(e,r){{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
|
|
27
|
+
*/var ce;function Me(){if(ce)return U;ce=1;var t=E,o=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,c=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function y(n,l,h){var m,S={},j=null,O=null;h!==void 0&&(j=""+h),l.key!==void 0&&(j=""+l.key),l.ref!==void 0&&(O=l.ref);for(m in l)s.call(l,m)&&!v.hasOwnProperty(m)&&(S[m]=l[m]);if(n&&n.defaultProps)for(m in l=n.defaultProps,l)S[m]===void 0&&(S[m]=l[m]);return{$$typeof:o,type:n,key:j,ref:O,props:S,_owner:c.current}}return U.Fragment=i,U.jsx=y,U.jsxs=y,U}process.env.NODE_ENV==="production"?q.exports=Me():q.exports=Ne();var A=q.exports;const M=E.createContext({apiURL:void 0,axios:void 0,children:void 0,Navigate:void 0,Outlet:void 0,translate:void 0,useAuth:void 0,useLocation:void 0}),We=({axios:t,children:o,translate:i,useAuth:s,Outlet:c,Navigate:v,useLocation:y,useGoogleTagManager:n,apiURL:l})=>{const h=E.useMemo(()=>({apiURL:l,axios:t,Navigate:v,Outlet:c,translate:i,useAuth:s,useGoogleTagManager:n,useLocation:y}),[v,c,l,t,i,s,n,y]);return A.jsx(M.Provider,{value:h,children:o})},G=t=>`RequireAuth require « ${t} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ve=({Fallback:t,loginPath:o="/login",localStorageKey:i="user",redirect401Path:s="/login",...c})=>{var I,L,k,C;const{axios:v=c.axios,useLocation:y=c.useLocation,useAuth:n=c.useAuth,Outlet:l=c.Outlet,Navigate:h=c.Navigate}=E.useContext(M);if(n===void 0)throw new Error(G("useAuth"));if(y===void 0)throw new Error(G("useLocation"));if(l===void 0)throw new Error(G("Outlet"));if(h===void 0)throw new Error(G("Navigate"));const[m,S]=E.useState(null),{isLogged:j}=n(),O=y(),F=E.useRef(!1);return E.useLayoutEffect(()=>{F.current||(F.current=!0,v==null||v.interceptors.response.use(w=>w,async w=>{var J;return typeof w=="object"&&w&&"response"in w&&w.response&&typeof w.response=="object"&&"status"in w.response&&w.response&&typeof w.response=="object"&&"status"in w.response&&((J=w==null?void 0:w.response)==null?void 0:J.status)===401&&(v.defaults.headers.common.Authorization=null,localStorage.removeItem(i),S(s)),Promise.reject(w)}))},[v==null?void 0:v.defaults.headers.common,v==null?void 0:v.interceptors.response,i,s]),j&&!m?A.jsx(E.Suspense,{fallback:t,children:(L=(I=O.state)==null?void 0:I.from)!=null&&L.state&&((C=(k=O.state)==null?void 0:k.from)==null?void 0:C.pathname)===o?A.jsx(h,{to:O.state.from.state.from.pathname+O.state.from.state.from.search,replace:!0}):A.jsx(l,{})}):A.jsx(h,{to:o,state:{from:O},replace:!0})},Q=t=>`GTMSendPageView require « ${t} » dependency. You can provide with InjectDependenciesProvider or directly in props.`,Ye=({...t})=>{const{useLocation:o=t.useLocation,Outlet:i=t.Outlet,useGoogleTagManager:s=t.useGoogleTagManager}=E.useContext(M);if(o===void 0)throw new Error(Q("useLocation"));if(i===void 0)throw new Error(Q("Outlet"));if(s===void 0)throw new Error(Q("useGoogleTagManager"));const{pathname:c}=o(),{sendEvent:v}=s();return E.useEffect(()=>{v({event:"pageView",pathname:c})},[c,v]),A.jsx(i,{})},Ue=({axios:t,baseURL:o,tokenTypeKey:i="tokenType",userLocalStorageKey:s="user",tokenKey:c="accessToken",postContentType:v="application/json"})=>{if(!t.defaults)return null;const y=localStorage.getItem(s),n=y?JSON.parse(y):null,l=n!=null&&n[i]?n[i]:null,h=n!=null&&n[c]?n[c]:null,m=y?`${l} ${h}`:null;return t.defaults.baseURL=o,t.defaults.headers.post["Content-Type"]=v,m&&(t.defaults.headers.common.Authorization=m),null},ze=({i18n:t,debug:o,initReactI18next:i,resources:s,LanguageDetector:c})=>(t!=null&&t.isInitialized||(t.use(c).use(i).init({debug:o,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:s,returnNull:!1}).then(()=>{document.documentElement.lang!==t.resolvedLanguage&&t.resolvedLanguage&&document.documentElement.setAttribute("lang",t.resolvedLanguage)}),t.on("languageChanged",v=>{document.documentElement.setAttribute("lang",v)})),null),Be=({dsn:t,sentry:o,integrations:i,tracesSampleRate:s,routingInstrumentationDependencies:c,replaysSessionSampleRate:v,replaysOnErrorSampleRate:y,tracePropagationTargets:n,ignoreErrors:l,debug:h,environment:m})=>(o.isInitialized()||(h||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&o.init({debug:h,dsn:t,environment:m||"production",ignoreErrors:l||[/Failed to fetch dynamically imported module/],integrations:[new o.BrowserTracing({routingInstrumentation:o.reactRouterV6Instrumentation(c.useEffect,c.useLocation,c.useNavigationType,c.createRoutesFromChildren,c.matchRoutes)}),o.replayIntegration(),...i||[]],replaysOnErrorSampleRate:y||1,replaysSessionSampleRate:v||.1,tracePropagationTargets:n,tracesSampleRate:s||1}),null),Ge=({IMaskMixin:t,...o})=>{const i=E.useMemo(()=>t(({TextField:s,...c})=>A.jsx(s,{...c})),[t]);return A.jsx(i,{...o})},Je=({mapbox:t,accessToken:o})=>(t&&o&&(t.accessToken=o),null),$e=({children:t,defaultOptions:o,QueryClient:i,QueryClientProvider:s})=>{const c=new i({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:3,...o}}});return A.jsx(s,{client:c,children:t})},Xe=t=>{const{unknownErrorTranslationKey:o="error.unknownError"}=t||{},{translate:i=t==null?void 0:t.translate}=E.useContext(M),s=i?i(o):"Unknown error",c=E.useCallback(y=>{var l,h,m,S,j,O,F,I,L;const{response:n}=y||{};return n!=null&&n.reason?String(n.reason):(l=n==null?void 0:n.data)!=null&&l.reason?String(n.data.reason):(h=n==null?void 0:n.data)!=null&&h.message?String(n.data.message):(S=(m=n==null?void 0:n.data)==null?void 0:m.detail)!=null&&S.length&&Array.isArray((j=n==null?void 0:n.data)==null?void 0:j.detail)&&((F=(O=n==null?void 0:n.data)==null?void 0:O.detail[0])!=null&&F.msg)&&typeof((L=(I=n==null?void 0:n.data)==null?void 0:I.detail[0])==null?void 0:L.msg)=="string"?String(n.data.detail[0].msg):s},[s]);return{getErrorCode:E.useCallback(y=>{var l,h,m;const{response:n}=y||{};return n!=null&&n.error_code?String(n==null?void 0:n.error_code):(l=n==null?void 0:n.data)!=null&&l.error_code?String((h=n==null?void 0:n.data)==null?void 0:h.error_code):n!=null&&n.error_code?String(n==null?void 0:n.error_code):(m=n==null?void 0:n.data)!=null&&m.error_code?String(n.data.error_code):"unknown_error_code"},[]),printError:c}},He=({data:t,fetchNextPage:o,isFetchingNextPage:i,isInitialLoading:s,isLoading:c,enabled:v=!0})=>{const y=E.useCallback(async l=>{i||!v||await o({pageParam:(l==null?void 0:l.pageParam)||l.visibleRowsCount})},[v,o,i]),n=E.useMemo(()=>{if(t)return t.pages.reduce((l,h)=>[...l,...h],[])},[t]);return{fetchNextPageOnRowsScrollEnd:y,isLoading:i||c,loadingVariant:s?"skeleton":"linear",rows:n}},Ke=t=>{const o=E.useCallback(({tokenType:s,accessToken:c})=>{t.defaults.headers.common.Authorization=`${s} ${c}`},[t.defaults.headers.common]);return{clearAuthenticationToken:E.useCallback(()=>{t.defaults.headers.common.Authorization=null},[t.defaults.headers.common]),setAuthenticationToken:o}},Ze=(t,o="km")=>{const i=Number(t);return Number.isNaN(i)?`0 ${o}`:`${i.toFixed(2)} ${o}`},le=(t,o)=>{if(!t)return"";const i=typeof t=="object"&&"pathname"in t?`${t.origin}${t.pathname}`:t;return typeof o=="number"?`${i.replace("/files",`/thumbs/${o}`)}`:i},qe=()=>{const{apiURL:t}=E.useContext(M);return{distanceAdapter:Ze,filePathAdapter:(i,s)=>le(t&&typeof i=="string"?{origin:t,pathname:i}:i,s)}},Qe=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),er=t=>{const s=t.split("/").filter(c=>c.length>0).map(c=>c.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(l=>l.charAt(0).toUpperCase()+l.slice(1)).join("")).join("");return s.charAt(0).toLowerCase()+s.slice(1)},rr=(t,o,i)=>{const s=er(o),c=Qe(i);return`${s}${c}`},tr=t=>{if(t)return(t==null?void 0:t.reduce((o,i)=>(o[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},o),{}))||{}},nr=t=>{const{input:o="./openapi.json",operationsToGenerateInfiniteQueryHook:i=void 0}=t||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:o,output:{client:"react-query",mode:"tags-split",override:{header:s=>["Generated by orval 🍺",...s.title?[s.title]:[],...s.description?[s.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:rr,...(i==null?void 0:i.length)&&{operations:tr(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};b.AxiosConfig=Ue,b.GTMSendPageView=Ye,b.I18nConfig=ze,b.InjectDependenciesContext=M,b.InjectDependenciesProvider=We,b.MapBoxConfig=Je,b.MaskTextField=Ge,b.QueryClientConfigProvider=$e,b.RequireAuth=Ve,b.SentryConfig=Be,b.getOrvalConfig=nr,b.useAdapter=qe,b.useAuth=Ke,b.useInfiniteDataGrid=He,b.useResponseError=Xe,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});
|