@tracktor/shared-module 2.0.0-beta.9 → 2.0.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/dist/main.umd.cjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(C,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],p):(C=typeof globalThis<"u"?globalThis:C||self,p(C["@tracktor/shared-module"]={},C.React))})(this,function(C,p){"use strict";var ee={exports:{}},G={};/**
1
+ (function(w,m){typeof exports=="object"&&typeof module<"u"?m(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],m):(w=typeof globalThis<"u"?globalThis:w||self,m(w["@tracktor/shared-module"]={},w.React))})(this,function(w,m){"use strict";var ee={exports:{}},B={};/**
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 le;function ze(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){var t=p,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),s=Symbol.for("react.offscreen"),x=Symbol.iterator,D="@@iterator";function O(e){if(e===null||typeof e!="object")return null;var r=x&&e[x]||e[D];return typeof r=="function"?r:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function P(e){{for(var r=arguments.length,o=new Array(r>1?r-1:0),f=1;f<r;f++)o[f-1]=arguments[f];M("error",e,o)}}function M(e,r,o){{var f=k.ReactDebugCurrentFrame,m=f.getStackAddendum();m!==""&&(r+="%s",o=o.concat([m]));var R=o.map(function(h){return String(h)});R.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,R)}}var W=!1,L=!1,S=!1,ge=!1,pe=!1,Q;Q=Symbol.for("react.module.reference");function yt(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===v||pe||e===l||e===g||e===E||ge||e===s||W||L||S||typeof e=="object"&&e!==null&&(e.$$typeof===w||e.$$typeof===_||e.$$typeof===d||e.$$typeof===c||e.$$typeof===u||e.$$typeof===Q||e.getModuleId!==void 0))}function ht(e,r,o){var f=e.displayName;if(f)return f;var m=r.displayName||r.name||"";return m!==""?o+"("+m+")":o}function me(e){return e.displayName||"Context"}function N(e){if(e==null)return null;if(typeof e.tag=="number"&&P("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 i:return"Portal";case v:return"Profiler";case l:return"StrictMode";case g:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var r=e;return me(r)+".Consumer";case d:var o=e;return me(o._context)+".Provider";case u:return ht(e,e.render,"ForwardRef");case _:var f=e.displayName||null;return f!==null?f:N(e.type)||"Memo";case w:{var m=e,R=m._payload,h=m._init;try{return N(h(R))}catch{return null}}}return null}var z=Object.assign,J=0,Ee,Re,we,Ce,_e,Pe,Te;function Se(){}Se.__reactDisabledLog=!0;function gt(){{if(J===0){Ee=console.log,Re=console.info,we=console.warn,Ce=console.error,_e=console.group,Pe=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})}J++}}function pt(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:Ee}),info:z({},e,{value:Re}),warn:z({},e,{value:we}),error:z({},e,{value:Ce}),group:z({},e,{value:_e}),groupCollapsed:z({},e,{value:Pe}),groupEnd:z({},e,{value:Te})})}J<0&&P("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ne=k.ReactCurrentDispatcher,oe;function H(e,r,o){{if(oe===void 0)try{throw Error()}catch(m){var f=m.stack.trim().match(/\n( *(at )?)/);oe=f&&f[1]||""}return`
10
- `+oe+e}}var ie=!1,K;{var mt=typeof WeakMap=="function"?WeakMap:Map;K=new mt}function be(e,r){if(!e||ie)return"";{var o=K.get(e);if(o!==void 0)return o}var f;ie=!0;var m=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var R;R=ne.current,ne.current=null,gt();try{if(r){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(Y){f=Y}Reflect.construct(e,[],h)}else{try{h.call()}catch(Y){f=Y}e.call(h.prototype)}}else{try{throw Error()}catch(Y){f=Y}e()}}catch(Y){if(Y&&f&&typeof Y.stack=="string"){for(var y=Y.stack.split(`
11
- `),j=f.stack.split(`
12
- `),T=y.length-1,b=j.length-1;T>=1&&b>=0&&y[T]!==j[b];)b--;for(;T>=1&&b>=0;T--,b--)if(y[T]!==j[b]){if(T!==1||b!==1)do if(T--,b--,b<0||y[T]!==j[b]){var I=`
13
- `+y[T].replace(" at new "," at ");return e.displayName&&I.includes("<anonymous>")&&(I=I.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,I),I}while(T>=1&&b>=0);break}}}finally{ie=!1,ne.current=R,pt(),Error.prepareStackTrace=m}var U=e?e.displayName||e.name:"",Le=U?H(U):"";return typeof e=="function"&&K.set(e,Le),Le}function Et(e,r,o){return be(e,!1)}function Rt(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function Z(e,r,o){if(e==null)return"";if(typeof e=="function")return be(e,Rt(e));if(typeof e=="string")return H(e);switch(e){case g:return H("Suspense");case E:return H("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case u:return Et(e.render);case _:return Z(e.type,r,o);case w:{var f=e,m=f._payload,R=f._init;try{return Z(R(m),r,o)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,xe={},Oe=k.ReactDebugCurrentFrame;function q(e){if(e){var r=e._owner,o=Z(e.type,e._source,r?r.type:null);Oe.setExtraStackFrame(o)}else Oe.setExtraStackFrame(null)}function wt(e,r,o,f,m){{var R=Function.call.bind($);for(var h in e)if(R(e,h)){var y=void 0;try{if(typeof e[h]!="function"){var j=Error((f||"React class")+": "+o+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw j.name="Invariant Violation",j}y=e[h](r,h,f,o,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(T){y=T}y&&!(y instanceof Error)&&(q(m),P("%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).",f||"React class",o,h,typeof y),q(null)),y instanceof Error&&!(y.message in xe)&&(xe[y.message]=!0,q(m),P("Failed %s type: %s",o,y.message),q(null))}}}var Ct=Array.isArray;function ae(e){return Ct(e)}function _t(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,o=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o}}function Pt(e){try{return je(e),!1}catch{return!0}}function je(e){return""+e}function Ae(e){if(Pt(e))return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",_t(e)),je(e)}var X=k.ReactCurrentOwner,Tt={key:!0,ref:!0,__self:!0,__source:!0},De,Ie,se;se={};function St(e){if($.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function bt(e){if($.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"&&X.current&&r&&X.current.stateNode!==r){var o=N(X.current.type);se[o]||(P('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',N(X.current.type),e.ref),se[o]=!0)}}function Ot(e,r){{var o=function(){De||(De=!0,P("%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))};o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}}function jt(e,r){{var o=function(){Ie||(Ie=!0,P("%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))};o.isReactWarning=!0,Object.defineProperty(e,"ref",{get:o,configurable:!0})}}var At=function(e,r,o,f,m,R,h){var y={$$typeof:n,type:e,key:r,ref:o,props:h,_owner:R};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:f}),Object.defineProperty(y,"_source",{configurable:!1,enumerable:!1,writable:!1,value:m}),Object.freeze&&(Object.freeze(y.props),Object.freeze(y)),y};function Dt(e,r,o,f,m){{var R,h={},y=null,j=null;o!==void 0&&(Ae(o),y=""+o),bt(r)&&(Ae(r.key),y=""+r.key),St(r)&&(j=r.ref,xt(r,m));for(R in r)$.call(r,R)&&!Tt.hasOwnProperty(R)&&(h[R]=r[R]);if(e&&e.defaultProps){var T=e.defaultProps;for(R in T)h[R]===void 0&&(h[R]=T[R])}if(y||j){var b=typeof e=="function"?e.displayName||e.name||"Unknown":e;y&&Ot(h,b),j&&jt(h,b)}return At(e,y,j,m,f,X.current,h)}}var ce=k.ReactCurrentOwner,ke=k.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,o=Z(e.type,e._source,r?r.type:null);ke.setExtraStackFrame(o)}else ke.setExtraStackFrame(null)}var ue;ue=!1;function fe(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Fe(){{if(ce.current){var e=N(ce.current.type);if(e)return`
9
+ */var se;function Ne(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var r=m,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),u=Symbol.for("react.offscreen"),S=Symbol.iterator,I="@@iterator";function O(e){if(e===null||typeof e!="object")return null;var t=S&&e[S]||e[I];return typeof t=="function"?t:null}var k=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){{for(var t=arguments.length,o=new Array(t>1?t-1:0),f=1;f<t;f++)o[f-1]=arguments[f];N("error",e,o)}}function N(e,t,o){{var f=k.ReactDebugCurrentFrame,E=f.getStackAddendum();E!==""&&(t+="%s",o=o.concat([E]));var p=o.map(function(y){return String(y)});p.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,p)}}var L=!1,M=!1,j=!1,ve=!1,ge=!1,Q;Q=Symbol.for("react.module.reference");function st(e){return!!(typeof e=="string"||typeof e=="function"||e===a||e===d||ge||e===l||e===h||e===R||ve||e===u||L||M||j||typeof e=="object"&&e!==null&&(e.$$typeof===C||e.$$typeof===_||e.$$typeof===v||e.$$typeof===c||e.$$typeof===s||e.$$typeof===Q||e.getModuleId!==void 0))}function lt(e,t,o){var f=e.displayName;if(f)return f;var E=t.displayName||t.name||"";return E!==""?o+"("+E+")":o}function ye(e){return e.displayName||"Context"}function Y(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 a:return"Fragment";case i:return"Portal";case d:return"Profiler";case l:return"StrictMode";case h:return"Suspense";case R:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case c:var t=e;return ye(t)+".Consumer";case v:var o=e;return ye(o._context)+".Provider";case s:return lt(e,e.render,"ForwardRef");case _:var f=e.displayName||null;return f!==null?f:Y(e.type)||"Memo";case C:{var E=e,p=E._payload,y=E._init;try{return Y(y(p))}catch{return null}}}return null}var z=Object.assign,J=0,he,me,Ee,Re,pe,we,Ce;function _e(){}_e.__reactDisabledLog=!0;function ft(){{if(J===0){he=console.log,me=console.info,Ee=console.warn,Re=console.error,pe=console.group,we=console.groupCollapsed,Ce=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})}J++}}function dt(){{if(J--,J===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},e,{value:he}),info:z({},e,{value:me}),warn:z({},e,{value:Ee}),error:z({},e,{value:Re}),group:z({},e,{value:pe}),groupCollapsed:z({},e,{value:we}),groupEnd:z({},e,{value:Ce})})}J<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=k.ReactCurrentDispatcher,re;function H(e,t,o){{if(re===void 0)try{throw Error()}catch(E){var f=E.stack.trim().match(/\n( *(at )?)/);re=f&&f[1]||""}return`
10
+ `+re+e}}var ne=!1,K;{var vt=typeof WeakMap=="function"?WeakMap:Map;K=new vt}function be(e,t){if(!e||ne)return"";{var o=K.get(e);if(o!==void 0)return o}var f;ne=!0;var E=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var p;p=te.current,te.current=null,ft();try{if(t){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(W){f=W}Reflect.construct(e,[],y)}else{try{y.call()}catch(W){f=W}e.call(y.prototype)}}else{try{throw Error()}catch(W){f=W}e()}}catch(W){if(W&&f&&typeof W.stack=="string"){for(var g=W.stack.split(`
11
+ `),x=f.stack.split(`
12
+ `),P=g.length-1,T=x.length-1;P>=1&&T>=0&&g[P]!==x[T];)T--;for(;P>=1&&T>=0;P--,T--)if(g[P]!==x[T]){if(P!==1||T!==1)do if(P--,T--,T<0||g[P]!==x[T]){var D=`
13
+ `+g[P].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),typeof e=="function"&&K.set(e,D),D}while(P>=1&&T>=0);break}}}finally{ne=!1,te.current=p,dt(),Error.prepareStackTrace=E}var U=e?e.displayName||e.name:"",We=U?H(U):"";return typeof e=="function"&&K.set(e,We),We}function gt(e,t,o){return be(e,!1)}function yt(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function Z(e,t,o){if(e==null)return"";if(typeof e=="function")return be(e,yt(e));if(typeof e=="string")return H(e);switch(e){case h:return H("Suspense");case R:return H("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case s:return gt(e.render);case _:return Z(e.type,t,o);case C:{var f=e,E=f._payload,p=f._init;try{return Z(p(E),t,o)}catch{}}}return""}var $=Object.prototype.hasOwnProperty,Pe={},je=k.ReactDebugCurrentFrame;function q(e){if(e){var t=e._owner,o=Z(e.type,e._source,t?t.type:null);je.setExtraStackFrame(o)}else je.setExtraStackFrame(null)}function ht(e,t,o,f,E){{var p=Function.call.bind($);for(var y in e)if(p(e,y)){var g=void 0;try{if(typeof e[y]!="function"){var x=Error((f||"React class")+": "+o+" 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 x.name="Invariant Violation",x}g=e[y](t,y,f,o,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){g=P}g&&!(g instanceof Error)&&(q(E),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).",f||"React class",o,y,typeof g),q(null)),g instanceof Error&&!(g.message in Pe)&&(Pe[g.message]=!0,q(E),b("Failed %s type: %s",o,g.message),q(null))}}}var mt=Array.isArray;function oe(e){return mt(e)}function Et(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,o=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o}}function Rt(e){try{return Te(e),!1}catch{return!0}}function Te(e){return""+e}function Se(e){if(Rt(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Et(e)),Te(e)}var X=k.ReactCurrentOwner,pt={key:!0,ref:!0,__self:!0,__source:!0},Oe,xe,ie;ie={};function wt(e){if($.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Ct(e){if($.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function _t(e,t){if(typeof e.ref=="string"&&X.current&&t&&X.current.stateNode!==t){var o=Y(X.current.type);ie[o]||(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',Y(X.current.type),e.ref),ie[o]=!0)}}function bt(e,t){{var o=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)",t))};o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}}function Pt(e,t){{var o=function(){xe||(xe=!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)",t))};o.isReactWarning=!0,Object.defineProperty(e,"ref",{get:o,configurable:!0})}}var jt=function(e,t,o,f,E,p,y){var g={$$typeof:n,type:e,key:t,ref:o,props:y,_owner:p};return g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(g,"_self",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.defineProperty(g,"_source",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g};function Tt(e,t,o,f,E){{var p,y={},g=null,x=null;o!==void 0&&(Se(o),g=""+o),Ct(t)&&(Se(t.key),g=""+t.key),wt(t)&&(x=t.ref,_t(t,E));for(p in t)$.call(t,p)&&!pt.hasOwnProperty(p)&&(y[p]=t[p]);if(e&&e.defaultProps){var P=e.defaultProps;for(p in P)y[p]===void 0&&(y[p]=P[p])}if(g||x){var T=typeof e=="function"?e.displayName||e.name||"Unknown":e;g&&bt(y,T),x&&Pt(y,T)}return jt(e,g,x,E,f,X.current,y)}}var ae=k.ReactCurrentOwner,Ae=k.ReactDebugCurrentFrame;function V(e){if(e){var t=e._owner,o=Z(e.type,e._source,t?t.type:null);Ae.setExtraStackFrame(o)}else Ae.setExtraStackFrame(null)}var ue;ue=!1;function ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Ie(){{if(ae.current){var e=Y(ae.current.type);if(e)return`
14
14
 
15
- Check the render method of \``+e+"`."}return""}}function It(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),o=e.lineNumber;return`
15
+ Check the render method of \``+e+"`."}return""}}function St(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),o=e.lineNumber;return`
16
16
 
17
- Check your code at `+r+":"+o+"."}return""}}var Ne={};function kt(e){{var r=Fe();if(!r){var o=typeof e=="string"?e:e.displayName||e.name;o&&(r=`
17
+ Check your code at `+t+":"+o+"."}return""}}var De={};function Ot(e){{var t=Ie();if(!t){var o=typeof e=="string"?e:e.displayName||e.name;o&&(t=`
18
18
 
19
- Check the top-level render call using <`+o+">.")}return r}}function Ye(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=kt(r);if(Ne[o])return;Ne[o]=!0;var f="";e&&e._owner&&e._owner!==ce.current&&(f=" It was passed a child from "+N(e._owner.type)+"."),V(e),P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,f),V(null)}}function Me(e,r){{if(typeof e!="object")return;if(ae(e))for(var o=0;o<e.length;o++){var f=e[o];fe(f)&&Ye(f,r)}else if(fe(e))e._store&&(e._store.validated=!0);else if(e){var m=O(e);if(typeof m=="function"&&m!==e.entries)for(var R=m.call(e),h;!(h=R.next()).done;)fe(h.value)&&Ye(h.value,r)}}}function Ft(e){{var r=e.type;if(r==null||typeof r=="string")return;var o;if(typeof r=="function")o=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===u||r.$$typeof===_))o=r.propTypes;else return;if(o){var f=N(r);wt(o,e.props,"prop",f,e)}else if(r.PropTypes!==void 0&&!ue){ue=!0;var m=N(r);P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",m||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Nt(e){{for(var r=Object.keys(e.props),o=0;o<r.length;o++){var f=r[o];if(f!=="children"&&f!=="key"){V(e),P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),V(null);break}}e.ref!==null&&(V(e),P("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function We(e,r,o,f,m,R){{var h=yt(e);if(!h){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 j=It(m);j?y+=j:y+=Fe();var T;e===null?T="null":ae(e)?T="array":e!==void 0&&e.$$typeof===n?(T="<"+(N(e.type)||"Unknown")+" />",y=" Did you accidentally export a JSX literal instead of a component?"):T=typeof e,P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",T,y)}var b=Dt(e,r,o,m,R);if(b==null)return b;if(h){var I=r.children;if(I!==void 0)if(f)if(ae(I)){for(var U=0;U<I.length;U++)Me(I[U],e);Object.freeze&&Object.freeze(I)}else P("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 Me(I,e)}return e===a?Nt(b):Ft(b),b}}function Yt(e,r,o){return We(e,r,o,!0)}function Mt(e,r,o){return We(e,r,o,!1)}var Wt=Mt,Lt=Yt;G.Fragment=a,G.jsx=Wt,G.jsxs=Lt}()),G}var B={};/**
19
+ Check the top-level render call using <`+o+">.")}return t}}function ke(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=Ot(t);if(De[o])return;De[o]=!0;var f="";e&&e._owner&&e._owner!==ae.current&&(f=" It was passed a child from "+Y(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.',o,f),V(null)}}function Fe(e,t){{if(typeof e!="object")return;if(oe(e))for(var o=0;o<e.length;o++){var f=e[o];ce(f)&&ke(f,t)}else if(ce(e))e._store&&(e._store.validated=!0);else if(e){var E=O(e);if(typeof E=="function"&&E!==e.entries)for(var p=E.call(e),y;!(y=p.next()).done;)ce(y.value)&&ke(y.value,t)}}}function xt(e){{var t=e.type;if(t==null||typeof t=="string")return;var o;if(typeof t=="function")o=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===s||t.$$typeof===_))o=t.propTypes;else return;if(o){var f=Y(t);ht(o,e.props,"prop",f,e)}else if(t.PropTypes!==void 0&&!ue){ue=!0;var E=Y(t);b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",E||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function At(e){{for(var t=Object.keys(e.props),o=0;o<t.length;o++){var f=t[o];if(f!=="children"&&f!=="key"){V(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),V(null);break}}e.ref!==null&&(V(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}function Ye(e,t,o,f,E,p){{var y=st(e);if(!y){var g="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(g+=" 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 x=St(E);x?g+=x:g+=Ie();var P;e===null?P="null":oe(e)?P="array":e!==void 0&&e.$$typeof===n?(P="<"+(Y(e.type)||"Unknown")+" />",g=" 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,g)}var T=Tt(e,t,o,E,p);if(T==null)return T;if(y){var D=t.children;if(D!==void 0)if(f)if(oe(D)){for(var U=0;U<D.length;U++)Fe(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 Fe(D,e)}return e===a?At(T):xt(T),T}}function It(e,t,o){return Ye(e,t,o,!0)}function Dt(e,t,o){return Ye(e,t,o,!1)}var kt=Dt,Ft=It;B.Fragment=a,B.jsx=kt,B.jsxs=Ft}()),B}var G={};/**
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 r}}function Ye(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 de;function Ve(){if(de)return B;de=1;var t=p,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,v={key:!0,ref:!0,__self:!0,__source:!0};function d(c,u,g){var E,_={},w=null,s=null;g!==void 0&&(w=""+g),u.key!==void 0&&(w=""+u.key),u.ref!==void 0&&(s=u.ref);for(E in u)a.call(u,E)&&!v.hasOwnProperty(E)&&(_[E]=u[E]);if(c&&c.defaultProps)for(E in u=c.defaultProps,u)_[E]===void 0&&(_[E]=u[E]);return{$$typeof:n,type:c,key:w,ref:s,props:_,_owner:l.current}}return B.Fragment=i,B.jsx=d,B.jsxs=d,B}process.env.NODE_ENV==="production"?ee.exports=Ve():ee.exports=ze();var F=ee.exports;const A=p.createContext({}),Ue=({children:t,apiURL:n,libraries:i})=>{const a=p.useMemo(()=>({apiURL:n,libraries:i}),[n,i]);return F.jsx(A.Provider,{value:a,children:t})},Ge=t=>t&&typeof t=="object"&&typeof t.useGoogleTagManager=="function",ve=t=>t&&typeof t=="object"&&typeof t.locale=="function"&&typeof t.extend=="function"&&typeof t.format=="function"&&typeof t()=="function"&&typeof t().format=="function",te=t=>t&&typeof t=="object"&&typeof t.useLocation=="function"&&typeof t.Outlet=="function"&&t.Outlet.prototype&&t.Outlet.prototype.isReactComponent&&typeof t.Navigate=="function"&&t.Navigate.prototype&&t.Navigate.prototype.isReactComponent&&typeof t.createRoutesFromChildren=="function"&&typeof t.matchRoutes=="function"&&typeof t.useNavigationType=="function",re=t=>t&&typeof t=="object"&&typeof t.defaults=="object"&&typeof t.defaults.baseURL=="string"&&typeof t.defaults.headers=="object"&&typeof t.defaults.headers.post=="object"&&typeof t.defaults.headers.post["Content-Type"]=="string"&&typeof t.defaults.headers.common=="object"&&typeof t.defaults.headers.common.Authorization=="string"&&typeof t.interceptors=="object"&&typeof t.interceptors.response=="object"&&typeof t.interceptors.response.use=="function",Be=({Fallback:t,isLogged:n,loginPath:i="/login",localStorageKey:a="user",redirect401Path:l="/login",...v})=>{var P,M,W,L;const{libraries:d}=p.useContext(A),c=(v==null?void 0:v.axios)||(d==null?void 0:d.axios),u=(v==null?void 0:v.reactRouter)||(d==null?void 0:d.reactRouter);if(!u)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!re(c))throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!te(u))throw new Error("Provided React Router dependencies are not valid.");const[g,E]=p.useState(null),{useLocation:_,Navigate:w,Outlet:s}=u,x=_(),D=p.useRef(!1),O=typeof n=="function"?n():!!n,k=typeof O=="boolean"?O:O==null?void 0:O.isLogged;return p.useEffect(()=>{D.current||(D.current=!0,c==null||c.interceptors.response.use(S=>S,async S=>{var Q;return typeof S=="object"&&S&&"response"in S&&S.response&&typeof S.response=="object"&&"status"in S.response&&S.response&&typeof S.response=="object"&&"status"in S.response&&((Q=S==null?void 0:S.response)==null?void 0:Q.status)===401&&(c.defaults.headers.common.Authorization=null,localStorage.removeItem(a),E(l)),Promise.reject(S)}))},[c==null?void 0:c.defaults.headers.common,c==null?void 0:c.interceptors.response,a,l]),k&&!g?F.jsx(p.Suspense,{fallback:t,children:(M=(P=x.state)==null?void 0:P.from)!=null&&M.state&&((L=(W=x.state)==null?void 0:W.from)==null?void 0:L.pathname)===i?F.jsx(w,{to:x.state.from.state.from.pathname+x.state.from.state.from.search,replace:!0}):F.jsx(s,{})}):F.jsx(w,{to:i,state:{from:x},replace:!0})},Qe=({...t})=>{const{libraries:n}=p.useContext(A),i=(t==null?void 0:t.reactRouter)||(n==null?void 0:n.reactRouter),a=(t==null?void 0:t.gtm)||(n==null?void 0:n.gtm);if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!a)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!Ge(a))throw new Error("Provided GTM dependencies are not valid.");if(!te(i))throw new Error("Provided React Router dependencies are not valid.");const{useGoogleTagManager:l}=a,{useLocation:v,Outlet:d}=i,{pathname:c}=v(),{sendEvent:u}=l();return p.useEffect(()=>{u({event:"pageView",pathname:c})},[c,u]),F.jsx(d,{})},Je=({tokenTypeKey:t="tokenType",userLocalStorageKey:n="user",tokenKey:i="accessToken",postContentType:a="application/json",...l})=>{const{apiURL:v=l.apiURL,libraries:d}=p.useContext(A),c=(l==null?void 0:l.axios)||(d==null?void 0:d.axios);if(!c)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!re(c))throw new Error("Provided Axios dependencies are not valid.");if(!(c!=null&&c.defaults))return null;const u=localStorage.getItem(n),g=u?JSON.parse(u):null,E=g!=null&&g[t]?g[t]:null,_=g!=null&&g[i]?g[i]:null,w=u?`${E} ${_}`:null;return c.defaults.baseURL=v,c.defaults.headers.post["Content-Type"]=a,w&&(c.defaults.headers.common.Authorization=w),null},Xe=({debug:t,resources:n,...i})=>{const{libraries:a}=p.useContext(A),l=(i==null?void 0:i.i18)||(a==null?void 0:a.i18),{i18next:v,initReactI18next:d,languageDetector:c}=l||{};if(!l)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return v!=null&&v.isInitialized||(v.use(c).use(d).init({debug:t,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:!1,useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==v.resolvedLanguage&&v.resolvedLanguage&&document.documentElement.setAttribute("lang",v.resolvedLanguage)}),v.on("languageChanged",u=>{document.documentElement.setAttribute("lang",u)})),null},He=({dsn:t,integrations:n,tracesSampleRate:i,replaysSessionSampleRate:a,replaysOnErrorSampleRate:l,tracePropagationTargets:v,ignoreErrors:d,debug:c,environment:u,...g})=>{const{libraries:E}=p.useContext(A),_=(g==null?void 0:g.sentry)||(E==null?void 0:E.sentry),w=(g==null?void 0:g.reactRouter)||(E==null?void 0:E.reactRouter);if(!_)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!w)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!te(w))throw new Error("Provided React Router dependencies are not valid.");if(_.isInitialized())return null;const{createRoutesFromChildren:s,matchRoutes:x,useLocation:D,useNavigationType:O}=w;return(c||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:c,dsn:t,environment:u||"production",ignoreErrors:[...d||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:s,matchRoutes:x,useEffect:p.useEffect,useLocation:D,useNavigationType:O}),...n||[]],replaysOnErrorSampleRate:l||1,replaysSessionSampleRate:a||.1,tracePropagationTargets:v,tracesSampleRate:i||1}),null},Ke=({IMaskMixin:t,...n})=>{const i=p.useMemo(()=>t(({TextField:a,...l})=>F.jsx(a,{...l})),[t]);return F.jsx(i,{...n})},Ze=t=>t&&typeof t=="object"&&typeof t.accessToken=="string",$e=({accessToken:t,...n})=>{const{libraries:i}=p.useContext(A),a=(n==null?void 0:n.mapbox)||(i==null?void 0:i.mapbox);if(!a)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!Ze(a))throw new Error("Provided Mapbox instance is not valid.");return t&&(a.accessToken=t),null},qe=({language:t,...n})=>{const{libraries:i}=p.useContext(A),a=(n==null?void 0:n.dayjs)||(i==null?void 0:i.dayjs),l=(n==null?void 0:n.dayjsPlugin)||(i==null?void 0:i.dayjsPlugin);if(!a)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");if(!ve(a))throw new Error("Provided dayjs instance is not valid.");return p.useEffect(()=>{(async()=>{var c;const d=t||((c=navigator.language)==null?void 0:c.slice(0,2))||"en";l&&l.forEach(u=>{u&&typeof u=="object"&&"default"in u&&a.extend(u.default)}),a.locale(d)})().then()},[a,l,t]),null},et=t=>t&&typeof t=="function",tt=t=>t&&typeof t=="function",rt=({children:t,defaultQueriesOptions:n,defaultMutationsOptions:i,...a})=>{var u,g;const{libraries:l}=p.useContext(A),v=(a==null?void 0:a.QueryClient)||((u=l==null?void 0:l.reactQuery)==null?void 0:u.QueryClient),d=(a==null?void 0:a.QueryClientProvider)||((g=l==null?void 0:l.reactQuery)==null?void 0:g.QueryClientProvider);if(!v)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!d)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!et(d))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!tt(v))throw new Error("Provided QueryClient dependencies are not valid.");const c=new v({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(E,_,w)=>E.length+(w||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(d,{client:c,children:t})},nt=t=>{var g,E,_;const{libraries:n}=p.useContext(A),i=(t==null?void 0:t.i18)||(n==null?void 0:n.i18),a=((g=t==null?void 0:t.i18)==null?void 0:g.translateFunction)||((E=n==null?void 0:n.i18)==null?void 0:E.translateFunction),l=((_=i==null?void 0:i.i18next)==null?void 0:_.t)||a||(w=>w),{unknownErrorTranslationKey:v="error.unknownError"}=t||{},d=l(v),c=p.useCallback(w=>{var x,D,O,k,P,M,W,L,S;const{response:s}=w||{};return s!=null&&s.reason?String(s.reason):(x=s==null?void 0:s.data)!=null&&x.reason?String(s.data.reason):(D=s==null?void 0:s.data)!=null&&D.message?String(s.data.message):(k=(O=s==null?void 0:s.data)==null?void 0:O.detail)!=null&&k.length&&Array.isArray((P=s==null?void 0:s.data)==null?void 0:P.detail)&&((W=(M=s==null?void 0:s.data)==null?void 0:M.detail[0])!=null&&W.msg)&&typeof((S=(L=s==null?void 0:s.data)==null?void 0:L.detail[0])==null?void 0:S.msg)=="string"?String(s.data.detail[0].msg):d},[d]);return{getErrorCode:p.useCallback(w=>{var x,D,O;const{response:s}=w||{};return s!=null&&s.error_code?String(s==null?void 0:s.error_code):(x=s==null?void 0:s.data)!=null&&x.error_code?String((D=s==null?void 0:s.data)==null?void 0:D.error_code):s!=null&&s.error_code?String(s==null?void 0:s.error_code):(O=s==null?void 0:s.data)!=null&&O.error_code?String(s.data.error_code):"unknown_error_code"},[]),printError:c}},ot=({data:t,fetchNextPage:n,isFetchingNextPage:i,isInitialLoading:a,isLoading:l,enabled:v=!0})=>{const d=p.useCallback(async u=>{i||!v||await n({pageParam:(u==null?void 0:u.pageParam)||u.visibleRowsCount})},[v,n,i]),c=p.useMemo(()=>{if(t)return t.pages.reduce((u,g)=>[...u,...g],[])},[t]);return{fetchNextPageOnRowsScrollEnd:d,isLoading:i||l,loadingVariant:a?"skeleton":"linear",rows:c}},it=t=>{const{libraries:n}=p.useContext(A),i=(t==null?void 0:t.axios)||(n==null?void 0:n.axios);if(i===void 0)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");if(!re(i))throw new Error("Provided Axios dependencies are not valid.");return{clearAuthenticationToken:()=>{i.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:v,accessToken:d})=>{i.defaults.headers.common.Authorization=`${v} ${d}`}}},ye=(t,n="km")=>{const i=Number(t);return Number.isNaN(i)?`0 ${n}`:`${i.toFixed(2)} ${n}`},at=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},he=(t,n)=>{if(!t)return"";const i=at(t),a=typeof t=="object"&&"pathname"in t?`${t.origin}${i}`:t;return typeof n=="number"?`${a.replace("/files",`/thumbs/${n}`)}`:a},st=t=>{const{apiURL:n,libraries:i}=p.useContext(A),a=(t==null?void 0:t.dayjs)||(i==null?void 0:i.dayjs);return{dateAdapter:(d,c="ll")=>{if(a===void 0)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!ve(a))throw new Error("Provided dayjs instance is not valid.");return a(d).format(c)},distanceAdapter:ye,filePathAdapter:(d,c)=>he(n&&typeof d=="string"?{origin:n,pathname:d}:d,c)}},ct=t=>t.charAt(0).toUpperCase()+t.slice(1).toLowerCase(),ut=t=>{const a=t.split("/").filter(l=>l.length>0).map(l=>l.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(u=>u.charAt(0).toUpperCase()+u.slice(1)).join("")).join("");return a.charAt(0).toLowerCase()+a.slice(1)},ft=(t,n,i)=>{const a=ut(n),l=ct(i);return`${a}${l}`},lt=t=>{if(t)return(t==null?void 0:t.reduce((n,i)=>(n[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},dt=t=>{const{input:n="./openapi.json",operationsToGenerateInfiniteQueryHook:i=void 0}=t||{};return{api:{hooks:{afterAllFilesWrite:"prettier src/api/ --write"},input:n,output:{client:"react-query",mode:"tags-split",override:{header:a=>["Generated by orval 🍺",...a.title?[a.title]:[],...a.description?[a.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:ft,...(i==null?void 0:i.length)&&{operations:lt(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}},vt=(t,n,i="ll")=>t(n).format(i);C.GTMSendPageView=Qe,C.InitializeAxiosConfig=Je,C.InitializeDaysJSConfig=qe,C.InitializeI18nConfig=Xe,C.InitializeMapBoxConfig=$e,C.InitializeSentryConfig=He,C.InjectDependenciesContext=A,C.InjectDependenciesProvider=Ue,C.MaskTextField=Ke,C.QueryClientProviderWithConfig=rt,C.RequireAuth=Be,C.dateAdapter=vt,C.distanceAdapter=ye,C.getOrvalConfig=dt,C.useAdapter=st,C.useAuth=it,C.useInfiniteDataGrid=ot,C.useResponseError=nt,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
27
+ */var le;function Le(){if(le)return G;le=1;var r=m,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,d={key:!0,ref:!0,__self:!0,__source:!0};function v(c,s,h){var R,_={},C=null,u=null;h!==void 0&&(C=""+h),s.key!==void 0&&(C=""+s.key),s.ref!==void 0&&(u=s.ref);for(R in s)a.call(s,R)&&!d.hasOwnProperty(R)&&(_[R]=s[R]);if(c&&c.defaultProps)for(R in s=c.defaultProps,s)_[R]===void 0&&(_[R]=s[R]);return{$$typeof:n,type:c,key:C,ref:u,props:_,_owner:l.current}}return G.Fragment=i,G.jsx=v,G.jsxs=v,G}process.env.NODE_ENV==="production"?ee.exports=Le():ee.exports=Ne();var F=ee.exports;const A=m.createContext({}),Me=({children:r,apiURL:n,libraries:i})=>{const a=m.useMemo(()=>({apiURL:n,libraries:i}),[n,i]);return F.jsx(A.Provider,{value:a,children:r})},ze=({Fallback:r,isLogged:n,loginPath:i="/login",localStorageKey:a="user",redirect401Path:l="/login",...d})=>{var b,N,L,M;const{libraries:v}=m.useContext(A),c=(d==null?void 0:d.axios)||(v==null?void 0:v.axios),s=(d==null?void 0:d.reactRouter)||(v==null?void 0:v.reactRouter);if(!s)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!c)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");const[h,R]=m.useState(null),{useLocation:_,Navigate:C,Outlet:u}=s,S=_(),I=m.useRef(!1),O=typeof n=="function"?n():!!n,k=typeof O=="boolean"?O:O==null?void 0:O.isLogged;return m.useEffect(()=>{I.current||(I.current=!0,c==null||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,localStorage.removeItem(a),R(l)),Promise.reject(j)}))},[c==null?void 0:c.defaults.headers.common,c==null?void 0:c.interceptors.response,a,l]),k&&!h?F.jsx(m.Suspense,{fallback:r,children:(N=(b=S.state)==null?void 0:b.from)!=null&&N.state&&((M=(L=S.state)==null?void 0:L.from)==null?void 0:M.pathname)===i?F.jsx(C,{to:S.state.from.state.from.pathname+S.state.from.state.from.search,replace:!0}):F.jsx(u,{})}):F.jsx(C,{to:i,state:{from:S},replace:!0})},Ve=({...r})=>{const{libraries:n}=m.useContext(A),i=(r==null?void 0:r.reactRouter)||(n==null?void 0:n.reactRouter),a=(r==null?void 0:r.gtm)||(n==null?void 0:n.gtm);if(!i)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");if(!a)throw new Error("GTM is not provided. You can provide it with InjectDependenciesProvider or directly in props of GTMSendPageView.");const{useGoogleTagManager:l}=a,{useLocation:d,Outlet:v}=i,{pathname:c}=d(),{sendEvent:s}=l();return m.useEffect(()=>{s({event:"pageView",pathname:c})},[c,s]),F.jsx(v,{})},Ue=({tokenTypeKey:r="tokenType",userLocalStorageKey:n="user",tokenKey:i="accessToken",postContentType:a="application/json",...l})=>{const{apiURL:d=l.apiURL,libraries:v}=m.useContext(A),c=(l==null?void 0:l.axios)||(v==null?void 0:v.axios);if(!c)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!(c!=null&&c.defaults))return null;const s=localStorage.getItem(n),h=s?JSON.parse(s):null,R=h!=null&&h[r]?h[r]:null,_=h!=null&&h[i]?h[i]:null,C=s?`${R} ${_}`:null;return c.defaults.baseURL=d,c.defaults.headers.post["Content-Type"]=a,C&&(c.defaults.headers.common.Authorization=C),null},Be=({debug:r,resources:n,...i})=>{const{libraries:a}=m.useContext(A),l=(i==null?void 0:i.i18)||(a==null?void 0:a.i18),{i18next:d,initReactI18next:v,languageDetector:c}=l||{};if(!l)throw new Error("i18 is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return d!=null&&d.isInitialized||(d.use(c).use(v).init({debug:r,fallbackLng:"en",interpolation:{escapeValue:!1},load:"languageOnly",react:{bindI18n:"languageChanged loaded",useSuspense:!0},resources:n,returnNull:!1}).then(()=>{document.documentElement.lang!==d.resolvedLanguage&&d.resolvedLanguage&&document.documentElement.setAttribute("lang",d.resolvedLanguage)}),d.on("languageChanged",s=>{document.documentElement.setAttribute("lang",s)})),null},Ge=({dsn:r,integrations:n,tracesSampleRate:i,replaysSessionSampleRate:a,replaysOnErrorSampleRate:l,tracePropagationTargets:d,ignoreErrors:v,debug:c,environment:s,...h})=>{const{libraries:R}=m.useContext(A),_=(h==null?void 0:h.sentry)||(R==null?void 0:R.sentry),C=(h==null?void 0:h.reactRouter)||(R==null?void 0:R.reactRouter);if(!_)throw new Error("Sentry is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!C)throw new Error("React Router is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(_.isInitialized())return null;const{createRoutesFromChildren:u,matchRoutes:S,useLocation:I,useNavigationType:O}=C;return(c||process.env.NODE_ENV==="prod"||process.env.NODE_ENV==="production")&&_.init({debug:c,dsn:r,environment:s||"production",ignoreErrors:[...v||[],/dynamically imported module/],integrations:[_.reactRouterV6BrowserTracingIntegration({createRoutesFromChildren:u,matchRoutes:S,useEffect:m.useEffect,useLocation:I,useNavigationType:O}),...n||[]],replaysOnErrorSampleRate:l||1,replaysSessionSampleRate:a||.1,tracePropagationTargets:d,tracesSampleRate:i||1}),null},Qe=({IMaskMixin:r,...n})=>{const i=m.useMemo(()=>r(({TextField:a,...l})=>F.jsx(a,{...l})),[r]);return F.jsx(i,{...n})},Je=({accessToken:r,...n})=>{const{libraries:i}=m.useContext(A),a=(n==null?void 0:n.mapbox)||(i==null?void 0:i.mapbox);if(!a)throw new Error("Mapbox is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return r&&(a.accessToken=r),null},Xe=({language:r,...n})=>{const{libraries:i}=m.useContext(A),a=(n==null?void 0:n.dayjs)||(i==null?void 0:i.dayjs),l=(n==null?void 0:n.plugin)||(i==null?void 0:i.dayjsPlugin);if(!a)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props of InitializeDaysJSConfig.");return m.useEffect(()=>{(async()=>{var c;const v=r||((c=navigator.language)==null?void 0:c.slice(0,2))||"en";if(l&&l.forEach(s=>{s&&a.extend(s)}),v==="fr"){const s=await import("dayjs/locale/fr");a.locale(s.default)}})().then()},[a,l,r]),null},He=r=>r&&typeof r=="function",Ke=r=>r&&typeof r=="function",Ze=({children:r,defaultQueriesOptions:n,defaultMutationsOptions:i,...a})=>{var s,h;const{libraries:l}=m.useContext(A),d=(a==null?void 0:a.QueryClient)||((s=l==null?void 0:l.reactQuery)==null?void 0:s.QueryClient),v=(a==null?void 0:a.QueryClientProvider)||((h=l==null?void 0:l.reactQuery)==null?void 0:h.QueryClientProvider);if(!d)throw new Error("QueryClient is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!v)throw new Error("QueryClientProvider is not provided. You can provide it with InjectDependenciesProvider or directly in props.");if(!He(v))throw new Error("Provided QueryClientProvider dependencies are not valid.");if(!Ke(d))throw new Error("Provided QueryClient dependencies are not valid.");const c=new d({defaultOptions:{mutations:{...i},queries:{getNextPageParam:(R,_,C)=>R.length+(C||0),refetchOnWindowFocus:!1,retry:3,...n}}});return F.jsx(v,{client:c,children:r})},$e=r=>{var h,R,_;const{libraries:n}=m.useContext(A),i=(r==null?void 0:r.i18)||(n==null?void 0:n.i18),a=((h=r==null?void 0:r.i18)==null?void 0:h.translateFunction)||((R=n==null?void 0:n.i18)==null?void 0:R.translateFunction),l=((_=i==null?void 0:i.i18next)==null?void 0:_.t)||a||(C=>C),{unknownErrorTranslationKey:d="error.unknownError"}=r||{},v=l(d),c=m.useCallback(C=>{var S,I,O,k,b,N,L,M,j;const{response:u}=C||{};return u!=null&&u.reason?String(u.reason):(S=u==null?void 0:u.data)!=null&&S.reason?String(u.data.reason):(I=u==null?void 0:u.data)!=null&&I.message?String(u.data.message):(k=(O=u==null?void 0:u.data)==null?void 0:O.detail)!=null&&k.length&&Array.isArray((b=u==null?void 0:u.data)==null?void 0:b.detail)&&((L=(N=u==null?void 0:u.data)==null?void 0:N.detail[0])!=null&&L.msg)&&typeof((j=(M=u==null?void 0:u.data)==null?void 0:M.detail[0])==null?void 0:j.msg)=="string"?String(u.data.detail[0].msg):v},[v]);return{getErrorCode:m.useCallback(C=>{var S,I,O;const{response:u}=C||{};return u!=null&&u.error_code?String(u==null?void 0:u.error_code):(S=u==null?void 0:u.data)!=null&&S.error_code?String((I=u==null?void 0:u.data)==null?void 0:I.error_code):u!=null&&u.error_code?String(u==null?void 0:u.error_code):(O=u==null?void 0:u.data)!=null&&O.error_code?String(u.data.error_code):"unknown_error_code"},[]),printError:c}},qe=({data:r,fetchNextPage:n,isFetchingNextPage:i,isInitialLoading:a,isLoading:l,enabled:d=!0})=>{const v=m.useCallback(async s=>{i||!d||await n({pageParam:(s==null?void 0:s.pageParam)||s.visibleRowsCount})},[d,n,i]),c=m.useMemo(()=>{if(r)return r.pages.reduce((s,h)=>[...s,...h],[])},[r]);return{fetchNextPageOnRowsScrollEnd:v,isLoading:i||l,loadingVariant:a?"skeleton":"linear",rows:c}},et=r=>{const{libraries:n}=m.useContext(A),i=(r==null?void 0:r.axios)||(n==null?void 0:n.axios);if(!i)throw new Error("Axios is not provided. You can provide it with InjectDependenciesProvider or directly in params of useAuth.");return{clearAuthenticationToken:()=>{i.defaults.headers.common.Authorization=null},setAuthenticationToken:({tokenType:d,accessToken:v})=>{i.defaults.headers.common.Authorization=`${d} ${v}`}}},fe=({library:r,date:n,format:i="ll"})=>r(n).format(i),de=(r,n="km")=>{const i=Number(r);return Number.isNaN(i)?`0 ${n}`:`${i.toFixed(2)} ${n}`},tt=r=>r!=null&&r.startsWith("/")?r!=null&&r.startsWith("/files")?r:`/files${r}`:r!=null&&r.startsWith("files")?`/${r}`:r!=null&&r.startsWith("files")?`/${r}`:`/files/${r}`,rt=({path:r,size:n,apiURL:i})=>{const a=tt(r),l=`${i}${a}`;return typeof n=="number"?`${l.replace("/files",`/thumbs/${n}`)}`:l},nt=r=>{const{apiURL:n,libraries:i}=m.useContext(A),a=(r==null?void 0:r.dayjs)||(i==null?void 0:i.dayjs);return{dateAdapter:(v,c)=>{if(!a)throw new Error("Dayjs is not provided. You can provide it with InjectDependenciesProvider or directly in props.");return fe({date:v,format:c,library:a})},distanceAdapter:de,filePathAdapter:(v,c)=>{if(!n)throw new Error("API URL is not provided. You can provide it with InjectDependenciesProvider or directly in props to filePathAdapter.");return rt({apiURL:n,path:v,size:c})}}},ot=r=>r.charAt(0).toUpperCase()+r.slice(1).toLowerCase(),it=r=>{const a=r.split("/").filter(l=>l.length>0).map(l=>l.replace(/\${([^}]*)}/g,"$1").split(/[_-]/).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join("")).join("");return a.charAt(0).toLowerCase()+a.slice(1)},at=(r,n,i)=>{const a=it(n),l=ot(i);return`${a}${l}`},ut=r=>{if(r)return(r==null?void 0:r.reduce((n,i)=>(n[i]={query:{useInfinite:!0,useInfiniteQueryParam:"offset",useQuery:!0}},n),{}))||{}},ct=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:a=>["Generated by orval 🍺",...a.title?[a.title]:[],...a.description?[a.description]:[]],mutator:{name:"axiosCustomInstance",path:`${__dirname}/config/orval/mutator/axiosCustomInstance.ts`},operationName:at,...(i==null?void 0:i.length)&&{operations:ut(i)},query:{useQuery:!0}},schemas:"src/api/model",target:"src/api/services/api.ts"}}}};w.GTMSendPageView=Ve,w.InitializeAxiosConfig=Ue,w.InitializeDaysJSConfig=Xe,w.InitializeI18nConfig=Be,w.InitializeMapBoxConfig=Je,w.InitializeSentryConfig=Ge,w.InjectDependenciesContext=A,w.InjectDependenciesProvider=Me,w.MaskTextField=Qe,w.QueryClientProviderWithConfig=Ze,w.RequireAuth=ze,w.dateAdapter=fe,w.distanceAdapter=de,w.getOrvalConfig=ct,w.useAdapter=nt,w.useAuth=et,w.useInfiniteDataGrid=qe,w.useResponseError=$e,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
@@ -4,11 +4,16 @@ interface Library {
4
4
  format: (format: string) => string;
5
5
  };
6
6
  }
7
+ interface DateAdapterParams<T> {
8
+ library: T;
9
+ date: DateType;
10
+ format?: string;
11
+ }
7
12
  /**
8
13
  * Format date to own specific format
9
14
  * @param library
10
15
  * @param date
11
16
  * @param format
12
17
  */
13
- export declare const dateAdapter: <T extends Library>(library: T, date: DateType, format?: string) => string;
18
+ export declare const dateAdapter: <T extends Library>({ library, date, format }: DateAdapterParams<T>) => string;
14
19
  export default dateAdapter;
@@ -1,10 +1,13 @@
1
+ interface FilePathAdapterParams {
2
+ path?: string | null;
3
+ size?: number | "full";
4
+ apiURL: string;
5
+ }
1
6
  /**
2
7
  * Adapt file path from server to display file on client
3
8
  * @param location
4
9
  * @param size - full or number for thumbs
10
+ * @param apiURL
5
11
  */
6
- declare const filePathAdapter: (location?: string | null | {
7
- pathname: string;
8
- origin?: string;
9
- }, size?: number | "full") => string;
12
+ declare const filePathAdapter: ({ path, size, apiURL }: FilePathAdapterParams) => string;
10
13
  export default filePathAdapter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tracktor/shared-module",
3
- "version": "2.0.0-beta.9",
3
+ "version": "2.0.1",
4
4
  "type": "module",
5
5
  "license": "UNLICENSED",
6
6
  "types": "./dist/main.d.ts",
@@ -1,56 +0,0 @@
1
- import { ComponentType } from "react";
2
- /**
3
- * Type guard check if provided object is GTM library
4
- * @param obj
5
- */
6
- export declare const isGTM: (obj: any) => obj is {
7
- useGoogleTagManager: () => any;
8
- };
9
- /**
10
- * Type guard check if provided object is dayjs library
11
- * @param obj
12
- */
13
- export declare const isDayjs: (obj: any) => obj is {
14
- (date: any): any;
15
- locale: (locale: string) => void;
16
- extend: (plugin: any) => void;
17
- format: (format: string) => string;
18
- };
19
- /**
20
- * Type guard check if provided object is react router library
21
- * @param obj
22
- */
23
- export declare const isReactRouter: (obj: any) => obj is {
24
- useLocation: () => any;
25
- Outlet: ComponentType;
26
- createRoutesFromChildren: (children: any) => any;
27
- matchRoutes: (routes: any, pathname: string) => any;
28
- useNavigationType: () => any;
29
- Navigate: ComponentType<{
30
- to: string;
31
- replace?: boolean;
32
- state?: any;
33
- }>;
34
- };
35
- /**
36
- * Type guard check if provided object is axios library
37
- * @param obj
38
- */
39
- export declare const isAxios: (obj: any) => obj is {
40
- interceptors: {
41
- response: {
42
- use: (onFulfilled: any, onRejected: any) => void;
43
- };
44
- };
45
- defaults: {
46
- baseURL?: string;
47
- headers: {
48
- post: {
49
- "Content-Type": string;
50
- };
51
- common: {
52
- Authorization: string | null;
53
- };
54
- };
55
- };
56
- };
@@ -1,7 +0,0 @@
1
- declare const _default: {
2
- useInfiniteDataGrid: (location?: string | {
3
- pathname: string;
4
- origin?: string | undefined;
5
- } | null | undefined, size?: number | "full" | undefined) => string;
6
- };
7
- export default _default;