@tealca/core-components 1.0.21 → 1.0.23
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.
|
@@ -56,7 +56,7 @@ Take a look at the logic that dispatched this action: `,g,`
|
|
|
56
56
|
(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)`,`
|
|
57
57
|
(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),o||(x.measureTime(()=>{const y=h.getState(),w=Ya(y,"",t,r,i,f);if(w){const{keyPath:O,value:S}=w;console.error(`A non-serializable value was detected in the state, in the path: \`${O}\`. Value:`,S,`
|
|
58
58
|
Take a look at the reducer(s) handling this action type: ${g.type}.
|
|
59
|
-
(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),x.warnIfExceeded()),m}}}function Es(e){return typeof e=="boolean"}var fE=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{};let a=new Oh;if(r&&(Es(r)?a.push(tE):a.push(rE(r.extraArgument))),process.env.NODE_ENV!=="production"){if(n){let o={};Es(n)||(o=n),a.unshift(uE(o))}if(s){let o={};Es(s)||(o=s),a.push(dE(o))}if(i){let o={};Es(i)||(o=i),a.unshift(oE(o))}}return a},hE="RTK_autoBatch",Zu=e=>t=>{setTimeout(t,e)},pE=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let s=!0,i=!1,a=!1;const o=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Zu(10):e.type==="callback"?e.queueNotification:Zu(e.timeout),d=()=>{a=!1,i&&(i=!1,o.forEach(f=>f()))};return Object.assign({},n,{subscribe(f){const h=()=>s&&f(),p=n.subscribe(h);return o.add(f),()=>{p(),o.delete(f)}},dispatch(f){try{return s=!f?.meta?.[hE],i=!s,i&&(a||(a=!0,c(d))),n.dispatch(f)}finally{s=!0}}})},mE=e=>function(r){const{autoBatch:n=!0}=r??{};let s=new Oh(e);return n&&s.push(pE(typeof n=="object"?n:void 0)),s};function jh(e){const t=fE(),{reducer:r=void 0,middleware:n,devTools:s=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let c;if(typeof r=="function")c=r;else if(Kn(r))c=dh(r);else throw new Error(process.env.NODE_ENV==="production"?Oe(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&n&&typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(2):"`middleware` field must be a callback");let d;if(typeof n=="function"){if(d=n(t),process.env.NODE_ENV!=="production"&&!Array.isArray(d))throw new Error(process.env.NODE_ENV==="production"?Oe(3):"when using a middleware builder function, an array of middleware must be returned")}else d=t();if(process.env.NODE_ENV!=="production"&&d.some(x=>typeof x!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&i){let x=new Set;d.forEach(y=>{if(x.has(y))throw new Error(process.env.NODE_ENV==="production"?Oe(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");x.add(y)})}let f=ri;s&&(f=nE({trace:process.env.NODE_ENV!=="production",...typeof s=="object"&&s}));const h=Fw(...d),p=mE(h);if(process.env.NODE_ENV!=="production"&&o&&typeof o!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(5):"`enhancers` field must be a callback");let g=typeof o=="function"?o(p):p();if(process.env.NODE_ENV!=="production"&&!Array.isArray(g))throw new Error(process.env.NODE_ENV==="production"?Oe(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&g.some(x=>typeof x!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&d.length&&!g.includes(h)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const m=f(...g);return _o(c,a,m)}function Mh(e){const t={},r=[];let n;const s={addCase(i,a){if(process.env.NODE_ENV!=="production"){if(r.length>0)throw new Error(process.env.NODE_ENV==="production"?Oe(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(n)throw new Error(process.env.NODE_ENV==="production"?Oe(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const o=typeof i=="string"?i:i.type;if(!o)throw new Error(process.env.NODE_ENV==="production"?Oe(28):"`builder.addCase` cannot be called with an empty action type");if(o in t)throw new Error(process.env.NODE_ENV==="production"?Oe(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${o}'`);return t[o]=a,s},addAsyncThunk(i,a){if(process.env.NODE_ENV!=="production"&&n)throw new Error(process.env.NODE_ENV==="production"?Oe(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),s},addMatcher(i,a){if(process.env.NODE_ENV!=="production"&&n)throw new Error(process.env.NODE_ENV==="production"?Oe(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return r.push({matcher:i,reducer:a}),s},addDefaultCase(i){if(process.env.NODE_ENV!=="production"&&n)throw new Error(process.env.NODE_ENV==="production"?Oe(31):"`builder.addDefaultCase` can only be called once");return n=i,s}};return e(s),[t,r,n]}function gE(e){return typeof e=="function"}function vE(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[r,n,s]=Mh(t),i;if(gE(e))i=()=>qu(e());else{const o=qu(e);i=()=>o}function a(o=i(),c){let d=[r[c.type],...n.filter(({matcher:f})=>f(c)).map(({reducer:f})=>f)];return d.filter(f=>!!f).length===0&&(d=[s]),d.reduce((f,h)=>{if(h)if(Ut(f)){const g=h(f,c);return g===void 0?f:g}else{if(mt(f))return Eh(f,p=>h(p,c));{const p=h(f,c);if(p===void 0){if(f===null)return f;throw Error("A case reducer on a non-draftable value must not return undefined")}return p}}return f},o)}return a.getInitialState=i,a}var yE=Symbol.for("rtk-slice-createasyncthunk");function xE(e,t){return`${e}/${t}`}function bE({creators:e}={}){const t=e?.asyncThunk?.[yE];return function(n){const{name:s,reducerPath:i=s}=n;if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&n.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const a=(typeof n.reducers=="function"?n.reducers(SE()):n.reducers)||{},o=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(S,E){const v=typeof S=="string"?S:S.type;if(!v)throw new Error(process.env.NODE_ENV==="production"?Oe(12):"`context.addCase` cannot be called with an empty action type");if(v in c.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?Oe(13):"`context.addCase` cannot be called with two reducers for the same action type: "+v);return c.sliceCaseReducersByType[v]=E,d},addMatcher(S,E){return c.sliceMatchers.push({matcher:S,reducer:E}),d},exposeAction(S,E){return c.actionCreators[S]=E,d},exposeCaseReducer(S,E){return c.sliceCaseReducersByName[S]=E,d}};o.forEach(S=>{const E=a[S],v={reducerName:S,type:xE(s,S),createNotation:typeof n.reducers=="function"};OE(E)?CE(v,E,d,t):kE(v,E,d)});function f(){if(process.env.NODE_ENV!=="production"&&typeof n.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[S={},E=[],v=void 0]=typeof n.extraReducers=="function"?Mh(n.extraReducers):[n.extraReducers],b={...S,...c.sliceCaseReducersByType};return vE(n.initialState,k=>{for(let C in b)k.addCase(C,b[C]);for(let C of c.sliceMatchers)k.addMatcher(C.matcher,C.reducer);for(let C of E)k.addMatcher(C.matcher,C.reducer);v&&k.addDefaultCase(v)})}const h=S=>S,p=new Map,g=new WeakMap;let m;function x(S,E){return m||(m=f()),m(S,E)}function y(){return m||(m=f()),m.getInitialState()}function w(S,E=!1){function v(k){let C=k[S];if(typeof C>"u"){if(E)C=ws(g,v,y);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(15):"selectSlice returned undefined for an uninjected slice reducer")}return C}function b(k=h){const C=ws(p,E,()=>new WeakMap);return ws(C,k,()=>{const _={};for(const[M,D]of Object.entries(n.selectors??{}))_[M]=wE(D,k,()=>ws(g,k,y),E);return _})}return{reducerPath:S,getSelectors:b,get selectors(){return b(v)},selectSlice:v}}const O={name:s,reducer:x,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...w(i),injectInto(S,{reducerPath:E,...v}={}){const b=E??i;return S.inject({reducerPath:b,reducer:x},v),{...O,...w(b,!0)}}};return O}}function wE(e,t,r,n){function s(i,...a){let o=t(i);if(typeof o>"u"){if(n)o=r();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(16):"selectState returned undefined for an uninjected slice reducer")}return e(o,...a)}return s.unwrapped=e,s}var EE=bE();function SE(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function kE({type:e,reducerName:t,createNotation:r},n,s){let i,a;if("reducer"in n){if(r&&!_E(n))throw new Error(process.env.NODE_ENV==="production"?Oe(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");i=n.reducer,a=n.prepare}else i=n;s.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?Gu(e,a):Gu(e))}function OE(e){return e._reducerDefinitionType==="asyncThunk"}function _E(e){return e._reducerDefinitionType==="reducerWithPrepare"}function CE({type:e,reducerName:t},r,n,s){if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:i,fulfilled:a,pending:o,rejected:c,settled:d,options:f}=r,h=s(e,i,f);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),o&&n.addCase(h.pending,o),c&&n.addCase(h.rejected,c),d&&n.addMatcher(h.settled,d),n.exposeCaseReducer(t,{fulfilled:a||Ss,pending:o||Ss,rejected:c||Ss,settled:d||Ss})}function Ss(){}function Oe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const LE={isLoggedIn:!1,user:null,accessToken:null,refreshToken:null},Th=EE({name:"auth",initialState:LE,reducers:{login:(e,t)=>{e.isLoggedIn=!0,e.user=t.payload.user,e.accessToken=t.payload.accessToken,e.refreshToken=t.payload.refreshToken},logout:e=>{e.isLoggedIn=!1,e.user=null,e.accessToken=null,e.refreshToken=null}}}),{login:Dh,logout:hC}=Th.actions,NE=Th.reducer;var ks={exports:{}},ma={};/**
|
|
59
|
+
(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),x.warnIfExceeded()),m}}}function Es(e){return typeof e=="boolean"}var fE=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:s=!0,actionCreatorCheck:i=!0}=t??{};let a=new Oh;if(r&&(Es(r)?a.push(tE):a.push(rE(r.extraArgument))),process.env.NODE_ENV!=="production"){if(n){let o={};Es(n)||(o=n),a.unshift(uE(o))}if(s){let o={};Es(s)||(o=s),a.push(dE(o))}if(i){let o={};Es(i)||(o=i),a.unshift(oE(o))}}return a},hE="RTK_autoBatch",Zu=e=>t=>{setTimeout(t,e)},pE=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let s=!0,i=!1,a=!1;const o=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Zu(10):e.type==="callback"?e.queueNotification:Zu(e.timeout),d=()=>{a=!1,i&&(i=!1,o.forEach(f=>f()))};return Object.assign({},n,{subscribe(f){const h=()=>s&&f(),p=n.subscribe(h);return o.add(f),()=>{p(),o.delete(f)}},dispatch(f){try{return s=!f?.meta?.[hE],i=!s,i&&(a||(a=!0,c(d))),n.dispatch(f)}finally{s=!0}}})},mE=e=>function(r){const{autoBatch:n=!0}=r??{};let s=new Oh(e);return n&&s.push(pE(typeof n=="object"?n:void 0)),s};function jh(e){const t=fE(),{reducer:r=void 0,middleware:n,devTools:s=!0,duplicateMiddlewareCheck:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let c;if(typeof r=="function")c=r;else if(Kn(r))c=dh(r);else throw new Error(process.env.NODE_ENV==="production"?Oe(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&n&&typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(2):"`middleware` field must be a callback");let d;if(typeof n=="function"){if(d=n(t),process.env.NODE_ENV!=="production"&&!Array.isArray(d))throw new Error(process.env.NODE_ENV==="production"?Oe(3):"when using a middleware builder function, an array of middleware must be returned")}else d=t();if(process.env.NODE_ENV!=="production"&&d.some(x=>typeof x!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&i){let x=new Set;d.forEach(y=>{if(x.has(y))throw new Error(process.env.NODE_ENV==="production"?Oe(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");x.add(y)})}let f=ri;s&&(f=nE({trace:process.env.NODE_ENV!=="production",...typeof s=="object"&&s}));const h=Fw(...d),p=mE(h);if(process.env.NODE_ENV!=="production"&&o&&typeof o!="function")throw new Error(process.env.NODE_ENV==="production"?Oe(5):"`enhancers` field must be a callback");let g=typeof o=="function"?o(p):p();if(process.env.NODE_ENV!=="production"&&!Array.isArray(g))throw new Error(process.env.NODE_ENV==="production"?Oe(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&g.some(x=>typeof x!="function"))throw new Error(process.env.NODE_ENV==="production"?Oe(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&d.length&&!g.includes(h)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const m=f(...g);return _o(c,a,m)}function Mh(e){const t={},r=[];let n;const s={addCase(i,a){if(process.env.NODE_ENV!=="production"){if(r.length>0)throw new Error(process.env.NODE_ENV==="production"?Oe(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(n)throw new Error(process.env.NODE_ENV==="production"?Oe(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const o=typeof i=="string"?i:i.type;if(!o)throw new Error(process.env.NODE_ENV==="production"?Oe(28):"`builder.addCase` cannot be called with an empty action type");if(o in t)throw new Error(process.env.NODE_ENV==="production"?Oe(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${o}'`);return t[o]=a,s},addAsyncThunk(i,a){if(process.env.NODE_ENV!=="production"&&n)throw new Error(process.env.NODE_ENV==="production"?Oe(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),s},addMatcher(i,a){if(process.env.NODE_ENV!=="production"&&n)throw new Error(process.env.NODE_ENV==="production"?Oe(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return r.push({matcher:i,reducer:a}),s},addDefaultCase(i){if(process.env.NODE_ENV!=="production"&&n)throw new Error(process.env.NODE_ENV==="production"?Oe(31):"`builder.addDefaultCase` can only be called once");return n=i,s}};return e(s),[t,r,n]}function gE(e){return typeof e=="function"}function vE(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[r,n,s]=Mh(t),i;if(gE(e))i=()=>qu(e());else{const o=qu(e);i=()=>o}function a(o=i(),c){let d=[r[c.type],...n.filter(({matcher:f})=>f(c)).map(({reducer:f})=>f)];return d.filter(f=>!!f).length===0&&(d=[s]),d.reduce((f,h)=>{if(h)if(Ut(f)){const g=h(f,c);return g===void 0?f:g}else{if(mt(f))return Eh(f,p=>h(p,c));{const p=h(f,c);if(p===void 0){if(f===null)return f;throw Error("A case reducer on a non-draftable value must not return undefined")}return p}}return f},o)}return a.getInitialState=i,a}var yE=Symbol.for("rtk-slice-createasyncthunk");function xE(e,t){return`${e}/${t}`}function bE({creators:e}={}){const t=e?.asyncThunk?.[yE];return function(n){const{name:s,reducerPath:i=s}=n;if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&n.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const a=(typeof n.reducers=="function"?n.reducers(SE()):n.reducers)||{},o=Object.keys(a),c={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(S,E){const v=typeof S=="string"?S:S.type;if(!v)throw new Error(process.env.NODE_ENV==="production"?Oe(12):"`context.addCase` cannot be called with an empty action type");if(v in c.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?Oe(13):"`context.addCase` cannot be called with two reducers for the same action type: "+v);return c.sliceCaseReducersByType[v]=E,d},addMatcher(S,E){return c.sliceMatchers.push({matcher:S,reducer:E}),d},exposeAction(S,E){return c.actionCreators[S]=E,d},exposeCaseReducer(S,E){return c.sliceCaseReducersByName[S]=E,d}};o.forEach(S=>{const E=a[S],v={reducerName:S,type:xE(s,S),createNotation:typeof n.reducers=="function"};OE(E)?CE(v,E,d,t):kE(v,E,d)});function f(){if(process.env.NODE_ENV!=="production"&&typeof n.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?Oe(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[S={},E=[],v=void 0]=typeof n.extraReducers=="function"?Mh(n.extraReducers):[n.extraReducers],b={...S,...c.sliceCaseReducersByType};return vE(n.initialState,k=>{for(let C in b)k.addCase(C,b[C]);for(let C of c.sliceMatchers)k.addMatcher(C.matcher,C.reducer);for(let C of E)k.addMatcher(C.matcher,C.reducer);v&&k.addDefaultCase(v)})}const h=S=>S,p=new Map,g=new WeakMap;let m;function x(S,E){return m||(m=f()),m(S,E)}function y(){return m||(m=f()),m.getInitialState()}function w(S,E=!1){function v(k){let C=k[S];if(typeof C>"u"){if(E)C=ws(g,v,y);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(15):"selectSlice returned undefined for an uninjected slice reducer")}return C}function b(k=h){const C=ws(p,E,()=>new WeakMap);return ws(C,k,()=>{const _={};for(const[M,D]of Object.entries(n.selectors??{}))_[M]=wE(D,k,()=>ws(g,k,y),E);return _})}return{reducerPath:S,getSelectors:b,get selectors(){return b(v)},selectSlice:v}}const O={name:s,reducer:x,actions:c.actionCreators,caseReducers:c.sliceCaseReducersByName,getInitialState:y,...w(i),injectInto(S,{reducerPath:E,...v}={}){const b=E??i;return S.inject({reducerPath:b,reducer:x},v),{...O,...w(b,!0)}}};return O}}function wE(e,t,r,n){function s(i,...a){let o=t(i);if(typeof o>"u"){if(n)o=r();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?Oe(16):"selectState returned undefined for an uninjected slice reducer")}return e(o,...a)}return s.unwrapped=e,s}var EE=bE();function SE(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function kE({type:e,reducerName:t,createNotation:r},n,s){let i,a;if("reducer"in n){if(r&&!_E(n))throw new Error(process.env.NODE_ENV==="production"?Oe(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");i=n.reducer,a=n.prepare}else i=n;s.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?Gu(e,a):Gu(e))}function OE(e){return e._reducerDefinitionType==="asyncThunk"}function _E(e){return e._reducerDefinitionType==="reducerWithPrepare"}function CE({type:e,reducerName:t},r,n,s){if(!s)throw new Error(process.env.NODE_ENV==="production"?Oe(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:i,fulfilled:a,pending:o,rejected:c,settled:d,options:f}=r,h=s(e,i,f);n.exposeAction(t,h),a&&n.addCase(h.fulfilled,a),o&&n.addCase(h.pending,o),c&&n.addCase(h.rejected,c),d&&n.addMatcher(h.settled,d),n.exposeCaseReducer(t,{fulfilled:a||Ss,pending:o||Ss,rejected:c||Ss,settled:d||Ss})}function Ss(){}function Oe(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}const LE={isAuthenticated:!1,user:null,accessToken:null,refreshToken:null},Th=EE({name:"auth",initialState:LE,reducers:{login:(e,t)=>{e.isAuthenticated=!0,e.user=t.payload.user,e.accessToken=t.payload.accessToken,e.refreshToken=t.payload.refreshToken},logout:e=>{e.isAuthenticated=!1,e.user=null,e.accessToken=null,e.refreshToken=null}}}),{login:Dh,logout:hC}=Th.actions,NE=Th.reducer;var ks={exports:{}},ma={};/**
|
|
60
60
|
* @license React
|
|
61
61
|
* use-sync-external-store-with-selector.production.js
|
|
62
62
|
*
|
|
@@ -83,4 +83,4 @@ var Uh;function R(){return Uh.apply(null,arguments)}function nS(e){Uh=e}function
|
|
|
83
83
|
[`+i+"] ";for(a in arguments[0])ye(arguments[0],a)&&(s+=a+": "+arguments[0][a]+", ");s=s.slice(0,-2)}else s=arguments[i];n.push(s)}zh(e+`
|
|
84
84
|
Arguments: `+Array.prototype.slice.call(n).join("")+`
|
|
85
85
|
`+new Error().stack),r=!1}return t.apply(this,arguments)},t)}var ed={};function Bh(e,t){R.deprecationHandler!=null&&R.deprecationHandler(e,t),ed[e]||(zh(t),ed[e]=!0)}R.suppressDeprecationWarnings=!1;R.deprecationHandler=null;function Ct(e){return typeof Function<"u"&&e instanceof Function||Object.prototype.toString.call(e)==="[object Function]"}function iS(e){var t,r;for(r in e)ye(e,r)&&(t=e[r],Ct(t)?this[r]=t:this["_"+r]=t);this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function Ga(e,t){var r=er({},e),n;for(n in t)ye(t,n)&&(Sr(e[n])&&Sr(t[n])?(r[n]={},er(r[n],e[n]),er(r[n],t[n])):t[n]!=null?r[n]=t[n]:delete r[n]);for(n in e)ye(e,n)&&!ye(t,n)&&Sr(e[n])&&(r[n]=er({},r[n]));return r}function Po(e){e!=null&&this.set(e)}var qa;Object.keys?qa=Object.keys:qa=function(e){var t,r=[];for(t in e)ye(e,t)&&r.push(t);return r};var aS={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function oS(e,t,r){var n=this._calendar[e]||this._calendar.sameElse;return Ct(n)?n.call(t,r):n}function kt(e,t,r){var n=""+Math.abs(e),s=t-n.length,i=e>=0;return(i?r?"+":"":"-")+Math.pow(10,Math.max(0,s)).toString().substr(1)+n}var Ao=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Os=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ya={},Hr={};function q(e,t,r,n){var s=n;typeof n=="string"&&(s=function(){return this[n]()}),e&&(Hr[e]=s),t&&(Hr[t[0]]=function(){return kt(s.apply(this,arguments),t[1],t[2])}),r&&(Hr[r]=function(){return this.localeData().ordinal(s.apply(this,arguments),e)})}function lS(e){return e.match(/\[[\s\S]/)?e.replace(/^\[|\]$/g,""):e.replace(/\\/g,"")}function cS(e){var t=e.match(Ao),r,n;for(r=0,n=t.length;r<n;r++)Hr[t[r]]?t[r]=Hr[t[r]]:t[r]=lS(t[r]);return function(s){var i="",a;for(a=0;a<n;a++)i+=Ct(t[a])?t[a].call(s,e):t[a];return i}}function Rs(e,t){return e.isValid()?(t=Wh(t,e.localeData()),ya[t]=ya[t]||cS(t),ya[t](e)):e.localeData().invalidDate()}function Wh(e,t){var r=5;function n(s){return t.longDateFormat(s)||s}for(Os.lastIndex=0;r>=0&&Os.test(e);)e=e.replace(Os,n),Os.lastIndex=0,r-=1;return e}var uS={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"};function dS(e){var t=this._longDateFormat[e],r=this._longDateFormat[e.toUpperCase()];return t||!r?t:(this._longDateFormat[e]=r.match(Ao).map(function(n){return n==="MMMM"||n==="MM"||n==="DD"||n==="dddd"?n.slice(1):n}).join(""),this._longDateFormat[e])}var fS="Invalid date";function hS(){return this._invalidDate}var pS="%d",mS=/\d{1,2}/;function gS(e){return this._ordinal.replace("%d",e)}var vS={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function yS(e,t,r,n){var s=this._relativeTime[r];return Ct(s)?s(e,t,r,n):s.replace(/%d/i,e)}function xS(e,t){var r=this._relativeTime[e>0?"future":"past"];return Ct(r)?r(t):r.replace(/%s/i,t)}var td={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ft(e){return typeof e=="string"?td[e]||td[e.toLowerCase()]:void 0}function Ro(e){var t={},r,n;for(n in e)ye(e,n)&&(r=ft(n),r&&(t[r]=e[n]));return t}var bS={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function wS(e){var t=[],r;for(r in e)ye(e,r)&&t.push({unit:r,priority:bS[r]});return t.sort(function(n,s){return n.priority-s.priority}),t}var Yh=/\d/,nt=/\d\d/,Hh=/\d{3}/,Io=/\d{4}/,Ri=/[+-]?\d{6}/,Me=/\d\d?/,Gh=/\d\d\d\d?/,qh=/\d\d\d\d\d\d?/,Ii=/\d{1,3}/,Fo=/\d{1,4}/,Fi=/[+-]?\d{1,6}/,un=/\d+/,$i=/[+-]?\d+/,ES=/Z|[+-]\d\d:?\d\d/gi,Ui=/Z|[+-]\d\d(?::?\d\d)?/gi,SS=/[+-]?\d+(\.\d{1,3})?/,es=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,dn=/^[1-9]\d?/,$o=/^([1-9]\d|\d)/,ci;ci={};function V(e,t,r){ci[e]=Ct(t)?t:function(n,s){return n&&r?r:t}}function kS(e,t){return ye(ci,e)?ci[e](t._strict,t._locale):new RegExp(OS(e))}function OS(e){return Ft(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,r,n,s,i){return r||n||s||i}))}function Ft(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function lt(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function pe(e){var t=+e,r=0;return t!==0&&isFinite(t)&&(r=lt(t)),r}var Za={};function ke(e,t){var r,n=t,s;for(typeof e=="string"&&(e=[e]),Vt(t)&&(n=function(i,a){a[t]=pe(i)}),s=e.length,r=0;r<s;r++)Za[e[r]]=n}function ts(e,t){ke(e,function(r,n,s,i){s._w=s._w||{},t(r,s._w,s,i)})}function _S(e,t,r){t!=null&&ye(Za,e)&&Za[e](t,r._a,r,e)}function Vi(e){return e%4===0&&e%100!==0||e%400===0}var Ye=0,Rt=1,Et=2,Re=3,pt=4,It=5,yr=6,CS=7,LS=8;q("Y",0,0,function(){var e=this.year();return e<=9999?kt(e,4):"+"+e});q(0,["YY",2],0,function(){return this.year()%100});q(0,["YYYY",4],0,"year");q(0,["YYYYY",5],0,"year");q(0,["YYYYYY",6,!0],0,"year");V("Y",$i);V("YY",Me,nt);V("YYYY",Fo,Io);V("YYYYY",Fi,Ri);V("YYYYYY",Fi,Ri);ke(["YYYYY","YYYYYY"],Ye);ke("YYYY",function(e,t){t[Ye]=e.length===2?R.parseTwoDigitYear(e):pe(e)});ke("YY",function(e,t){t[Ye]=R.parseTwoDigitYear(e)});ke("Y",function(e,t){t[Ye]=parseInt(e,10)});function Cn(e){return Vi(e)?366:365}R.parseTwoDigitYear=function(e){return pe(e)+(pe(e)>68?1900:2e3)};var Zh=fn("FullYear",!0);function NS(){return Vi(this.year())}function fn(e,t){return function(r){return r!=null?(Kh(this,e,r),R.updateOffset(this,t),this):$n(this,e)}}function $n(e,t){if(!e.isValid())return NaN;var r=e._d,n=e._isUTC;switch(t){case"Milliseconds":return n?r.getUTCMilliseconds():r.getMilliseconds();case"Seconds":return n?r.getUTCSeconds():r.getSeconds();case"Minutes":return n?r.getUTCMinutes():r.getMinutes();case"Hours":return n?r.getUTCHours():r.getHours();case"Date":return n?r.getUTCDate():r.getDate();case"Day":return n?r.getUTCDay():r.getDay();case"Month":return n?r.getUTCMonth():r.getMonth();case"FullYear":return n?r.getUTCFullYear():r.getFullYear();default:return NaN}}function Kh(e,t,r){var n,s,i,a,o;if(!(!e.isValid()||isNaN(r))){switch(n=e._d,s=e._isUTC,t){case"Milliseconds":return void(s?n.setUTCMilliseconds(r):n.setMilliseconds(r));case"Seconds":return void(s?n.setUTCSeconds(r):n.setSeconds(r));case"Minutes":return void(s?n.setUTCMinutes(r):n.setMinutes(r));case"Hours":return void(s?n.setUTCHours(r):n.setHours(r));case"Date":return void(s?n.setUTCDate(r):n.setDate(r));case"FullYear":break;default:return}i=r,a=e.month(),o=e.date(),o=o===29&&a===1&&!Vi(i)?28:o,s?n.setUTCFullYear(i,a,o):n.setFullYear(i,a,o)}}function jS(e){return e=ft(e),Ct(this[e])?this[e]():this}function MS(e,t){if(typeof e=="object"){e=Ro(e);var r=wS(e),n,s=r.length;for(n=0;n<s;n++)this[r[n].unit](e[r[n].unit])}else if(e=ft(e),Ct(this[e]))return this[e](t);return this}function TS(e,t){return(e%t+t)%t}var Pe;Array.prototype.indexOf?Pe=Array.prototype.indexOf:Pe=function(e){var t;for(t=0;t<this.length;++t)if(this[t]===e)return t;return-1};function Uo(e,t){if(isNaN(e)||isNaN(t))return NaN;var r=TS(t,12);return e+=(t-r)/12,r===1?Vi(e)?29:28:31-r%7%2}q("M",["MM",2],"Mo",function(){return this.month()+1});q("MMM",0,0,function(e){return this.localeData().monthsShort(this,e)});q("MMMM",0,0,function(e){return this.localeData().months(this,e)});V("M",Me,dn);V("MM",Me,nt);V("MMM",function(e,t){return t.monthsShortRegex(e)});V("MMMM",function(e,t){return t.monthsRegex(e)});ke(["M","MM"],function(e,t){t[Rt]=pe(e)-1});ke(["MMM","MMMM"],function(e,t,r,n){var s=r._locale.monthsParse(e,n,r._strict);s!=null?t[Rt]=s:ae(r).invalidMonth=e});var DS="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Jh="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Xh=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,PS=es,AS=es;function RS(e,t){return e?gt(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Xh).test(t)?"format":"standalone"][e.month()]:gt(this._months)?this._months:this._months.standalone}function IS(e,t){return e?gt(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Xh.test(t)?"format":"standalone"][e.month()]:gt(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function FS(e,t,r){var n,s,i,a=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)i=_t([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(i,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(i,"").toLocaleLowerCase();return r?t==="MMM"?(s=Pe.call(this._shortMonthsParse,a),s!==-1?s:null):(s=Pe.call(this._longMonthsParse,a),s!==-1?s:null):t==="MMM"?(s=Pe.call(this._shortMonthsParse,a),s!==-1?s:(s=Pe.call(this._longMonthsParse,a),s!==-1?s:null)):(s=Pe.call(this._longMonthsParse,a),s!==-1?s:(s=Pe.call(this._shortMonthsParse,a),s!==-1?s:null))}function $S(e,t,r){var n,s,i;if(this._monthsParseExact)return FS.call(this,e,t,r);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(s=_t([2e3,n]),r&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(s,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(s,"").replace(".","")+"$","i")),!r&&!this._monthsParse[n]&&(i="^"+this.months(s,"")+"|^"+this.monthsShort(s,""),this._monthsParse[n]=new RegExp(i.replace(".",""),"i")),r&&t==="MMMM"&&this._longMonthsParse[n].test(e))return n;if(r&&t==="MMM"&&this._shortMonthsParse[n].test(e))return n;if(!r&&this._monthsParse[n].test(e))return n}}function Qh(e,t){if(!e.isValid())return e;if(typeof t=="string"){if(/^\d+$/.test(t))t=pe(t);else if(t=e.localeData().monthsParse(t),!Vt(t))return e}var r=t,n=e.date();return n=n<29?n:Math.min(n,Uo(e.year(),r)),e._isUTC?e._d.setUTCMonth(r,n):e._d.setMonth(r,n),e}function ep(e){return e!=null?(Qh(this,e),R.updateOffset(this,!0),this):$n(this,"Month")}function US(){return Uo(this.year(),this.month())}function VS(e){return this._monthsParseExact?(ye(this,"_monthsRegex")||tp.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(ye(this,"_monthsShortRegex")||(this._monthsShortRegex=PS),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)}function zS(e){return this._monthsParseExact?(ye(this,"_monthsRegex")||tp.call(this),e?this._monthsStrictRegex:this._monthsRegex):(ye(this,"_monthsRegex")||(this._monthsRegex=AS),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)}function tp(){function e(c,d){return d.length-c.length}var t=[],r=[],n=[],s,i,a,o;for(s=0;s<12;s++)i=_t([2e3,s]),a=Ft(this.monthsShort(i,"")),o=Ft(this.months(i,"")),t.push(a),r.push(o),n.push(o),n.push(a);t.sort(e),r.sort(e),n.sort(e),this._monthsRegex=new RegExp("^("+n.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+t.join("|")+")","i")}function BS(e,t,r,n,s,i,a){var o;return e<100&&e>=0?(o=new Date(e+400,t,r,n,s,i,a),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,r,n,s,i,a),o}function Un(e){var t,r;return e<100&&e>=0?(r=Array.prototype.slice.call(arguments),r[0]=e+400,t=new Date(Date.UTC.apply(null,r)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)):t=new Date(Date.UTC.apply(null,arguments)),t}function ui(e,t,r){var n=7+t-r,s=(7+Un(e,0,n).getUTCDay()-t)%7;return-s+n-1}function rp(e,t,r,n,s){var i=(7+r-n)%7,a=ui(e,n,s),o=1+7*(t-1)+i+a,c,d;return o<=0?(c=e-1,d=Cn(c)+o):o>Cn(e)?(c=e+1,d=o-Cn(e)):(c=e,d=o),{year:c,dayOfYear:d}}function Vn(e,t,r){var n=ui(e.year(),t,r),s=Math.floor((e.dayOfYear()-n-1)/7)+1,i,a;return s<1?(a=e.year()-1,i=s+$t(a,t,r)):s>$t(e.year(),t,r)?(i=s-$t(e.year(),t,r),a=e.year()+1):(a=e.year(),i=s),{week:i,year:a}}function $t(e,t,r){var n=ui(e,t,r),s=ui(e+1,t,r);return(Cn(e)-n+s)/7}q("w",["ww",2],"wo","week");q("W",["WW",2],"Wo","isoWeek");V("w",Me,dn);V("ww",Me,nt);V("W",Me,dn);V("WW",Me,nt);ts(["w","ww","W","WW"],function(e,t,r,n){t[n.substr(0,1)]=pe(e)});function WS(e){return Vn(e,this._week.dow,this._week.doy).week}var YS={dow:0,doy:6};function HS(){return this._week.dow}function GS(){return this._week.doy}function qS(e){var t=this.localeData().week(this);return e==null?t:this.add((e-t)*7,"d")}function ZS(e){var t=Vn(this,1,4).week;return e==null?t:this.add((e-t)*7,"d")}q("d",0,"do","day");q("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)});q("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)});q("dddd",0,0,function(e){return this.localeData().weekdays(this,e)});q("e",0,0,"weekday");q("E",0,0,"isoWeekday");V("d",Me);V("e",Me);V("E",Me);V("dd",function(e,t){return t.weekdaysMinRegex(e)});V("ddd",function(e,t){return t.weekdaysShortRegex(e)});V("dddd",function(e,t){return t.weekdaysRegex(e)});ts(["dd","ddd","dddd"],function(e,t,r,n){var s=r._locale.weekdaysParse(e,n,r._strict);s!=null?t.d=s:ae(r).invalidWeekday=e});ts(["d","e","E"],function(e,t,r,n){t[n]=pe(e)});function KS(e,t){return typeof e!="string"?e:isNaN(e)?(e=t.weekdaysParse(e),typeof e=="number"?e:null):parseInt(e,10)}function JS(e,t){return typeof e=="string"?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}function Vo(e,t){return e.slice(t,7).concat(e.slice(0,t))}var XS="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),np="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),QS="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ek=es,tk=es,rk=es;function nk(e,t){var r=gt(this._weekdays)?this._weekdays:this._weekdays[e&&e!==!0&&this._weekdays.isFormat.test(t)?"format":"standalone"];return e===!0?Vo(r,this._week.dow):e?r[e.day()]:r}function sk(e){return e===!0?Vo(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort}function ik(e){return e===!0?Vo(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin}function ak(e,t,r){var n,s,i,a=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)i=_t([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(i,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(i,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(i,"").toLocaleLowerCase();return r?t==="dddd"?(s=Pe.call(this._weekdaysParse,a),s!==-1?s:null):t==="ddd"?(s=Pe.call(this._shortWeekdaysParse,a),s!==-1?s:null):(s=Pe.call(this._minWeekdaysParse,a),s!==-1?s:null):t==="dddd"?(s=Pe.call(this._weekdaysParse,a),s!==-1||(s=Pe.call(this._shortWeekdaysParse,a),s!==-1)?s:(s=Pe.call(this._minWeekdaysParse,a),s!==-1?s:null)):t==="ddd"?(s=Pe.call(this._shortWeekdaysParse,a),s!==-1||(s=Pe.call(this._weekdaysParse,a),s!==-1)?s:(s=Pe.call(this._minWeekdaysParse,a),s!==-1?s:null)):(s=Pe.call(this._minWeekdaysParse,a),s!==-1||(s=Pe.call(this._weekdaysParse,a),s!==-1)?s:(s=Pe.call(this._shortWeekdaysParse,a),s!==-1?s:null))}function ok(e,t,r){var n,s,i;if(this._weekdaysParseExact)return ak.call(this,e,t,r);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(s=_t([2e3,1]).day(n),r&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(s,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(s,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(s,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(i="^"+this.weekdays(s,"")+"|^"+this.weekdaysShort(s,"")+"|^"+this.weekdaysMin(s,""),this._weekdaysParse[n]=new RegExp(i.replace(".",""),"i")),r&&t==="dddd"&&this._fullWeekdaysParse[n].test(e))return n;if(r&&t==="ddd"&&this._shortWeekdaysParse[n].test(e))return n;if(r&&t==="dd"&&this._minWeekdaysParse[n].test(e))return n;if(!r&&this._weekdaysParse[n].test(e))return n}}function lk(e){if(!this.isValid())return e!=null?this:NaN;var t=$n(this,"Day");return e!=null?(e=KS(e,this.localeData()),this.add(e-t,"d")):t}function ck(e){if(!this.isValid())return e!=null?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return e==null?t:this.add(e-t,"d")}function uk(e){if(!this.isValid())return e!=null?this:NaN;if(e!=null){var t=JS(e,this.localeData());return this.day(this.day()%7?t:t-7)}else return this.day()||7}function dk(e){return this._weekdaysParseExact?(ye(this,"_weekdaysRegex")||zo.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(ye(this,"_weekdaysRegex")||(this._weekdaysRegex=ek),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)}function fk(e){return this._weekdaysParseExact?(ye(this,"_weekdaysRegex")||zo.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(ye(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=tk),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function hk(e){return this._weekdaysParseExact?(ye(this,"_weekdaysRegex")||zo.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(ye(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=rk),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function zo(){function e(f,h){return h.length-f.length}var t=[],r=[],n=[],s=[],i,a,o,c,d;for(i=0;i<7;i++)a=_t([2e3,1]).day(i),o=Ft(this.weekdaysMin(a,"")),c=Ft(this.weekdaysShort(a,"")),d=Ft(this.weekdays(a,"")),t.push(o),r.push(c),n.push(d),s.push(o),s.push(c),s.push(d);t.sort(e),r.sort(e),n.sort(e),s.sort(e),this._weekdaysRegex=new RegExp("^("+s.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+n.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+t.join("|")+")","i")}function Bo(){return this.hours()%12||12}function pk(){return this.hours()||24}q("H",["HH",2],0,"hour");q("h",["hh",2],0,Bo);q("k",["kk",2],0,pk);q("hmm",0,0,function(){return""+Bo.apply(this)+kt(this.minutes(),2)});q("hmmss",0,0,function(){return""+Bo.apply(this)+kt(this.minutes(),2)+kt(this.seconds(),2)});q("Hmm",0,0,function(){return""+this.hours()+kt(this.minutes(),2)});q("Hmmss",0,0,function(){return""+this.hours()+kt(this.minutes(),2)+kt(this.seconds(),2)});function sp(e,t){q(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}sp("a",!0);sp("A",!1);function ip(e,t){return t._meridiemParse}V("a",ip);V("A",ip);V("H",Me,$o);V("h",Me,dn);V("k",Me,dn);V("HH",Me,nt);V("hh",Me,nt);V("kk",Me,nt);V("hmm",Gh);V("hmmss",qh);V("Hmm",Gh);V("Hmmss",qh);ke(["H","HH"],Re);ke(["k","kk"],function(e,t,r){var n=pe(e);t[Re]=n===24?0:n});ke(["a","A"],function(e,t,r){r._isPm=r._locale.isPM(e),r._meridiem=e});ke(["h","hh"],function(e,t,r){t[Re]=pe(e),ae(r).bigHour=!0});ke("hmm",function(e,t,r){var n=e.length-2;t[Re]=pe(e.substr(0,n)),t[pt]=pe(e.substr(n)),ae(r).bigHour=!0});ke("hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Re]=pe(e.substr(0,n)),t[pt]=pe(e.substr(n,2)),t[It]=pe(e.substr(s)),ae(r).bigHour=!0});ke("Hmm",function(e,t,r){var n=e.length-2;t[Re]=pe(e.substr(0,n)),t[pt]=pe(e.substr(n))});ke("Hmmss",function(e,t,r){var n=e.length-4,s=e.length-2;t[Re]=pe(e.substr(0,n)),t[pt]=pe(e.substr(n,2)),t[It]=pe(e.substr(s))});function mk(e){return(e+"").toLowerCase().charAt(0)==="p"}var gk=/[ap]\.?m?\.?/i,vk=fn("Hours",!0);function yk(e,t,r){return e>11?r?"pm":"PM":r?"am":"AM"}var ap={calendar:aS,longDateFormat:uS,invalidDate:fS,ordinal:pS,dayOfMonthOrdinalParse:mS,relativeTime:vS,months:DS,monthsShort:Jh,week:YS,weekdays:XS,weekdaysMin:QS,weekdaysShort:np,meridiemParse:gk},Te={},bn={},zn;function xk(e,t){var r,n=Math.min(e.length,t.length);for(r=0;r<n;r+=1)if(e[r]!==t[r])return r;return n}function rd(e){return e&&e.toLowerCase().replace("_","-")}function bk(e){for(var t=0,r,n,s,i;t<e.length;){for(i=rd(e[t]).split("-"),r=i.length,n=rd(e[t+1]),n=n?n.split("-"):null;r>0;){if(s=zi(i.slice(0,r).join("-")),s)return s;if(n&&n.length>=r&&xk(i,n)>=r-1)break;r--}t++}return zn}function wk(e){return!!(e&&e.match("^[^/\\\\]*$"))}function zi(e){var t=null,r;if(Te[e]===void 0&&typeof module<"u"&&module&&module.exports&&wk(e))try{t=zn._abbr,r=require,r("./locale/"+e),sr(t)}catch{Te[e]=null}return Te[e]}function sr(e,t){var r;return e&&(Ze(t)?r=Bt(e):r=Wo(e,t),r?zn=r:typeof console<"u"&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),zn._abbr}function Wo(e,t){if(t!==null){var r,n=ap;if(t.abbr=e,Te[e]!=null)Bh("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=Te[e]._config;else if(t.parentLocale!=null)if(Te[t.parentLocale]!=null)n=Te[t.parentLocale]._config;else if(r=zi(t.parentLocale),r!=null)n=r._config;else return bn[t.parentLocale]||(bn[t.parentLocale]=[]),bn[t.parentLocale].push({name:e,config:t}),null;return Te[e]=new Po(Ga(n,t)),bn[e]&&bn[e].forEach(function(s){Wo(s.name,s.config)}),sr(e),Te[e]}else return delete Te[e],null}function Ek(e,t){if(t!=null){var r,n,s=ap;Te[e]!=null&&Te[e].parentLocale!=null?Te[e].set(Ga(Te[e]._config,t)):(n=zi(e),n!=null&&(s=n._config),t=Ga(s,t),n==null&&(t.abbr=e),r=new Po(t),r.parentLocale=Te[e],Te[e]=r),sr(e)}else Te[e]!=null&&(Te[e].parentLocale!=null?(Te[e]=Te[e].parentLocale,e===sr()&&sr(e)):Te[e]!=null&&delete Te[e]);return Te[e]}function Bt(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return zn;if(!gt(e)){if(t=zi(e),t)return t;e=[e]}return bk(e)}function Sk(){return qa(Te)}function Yo(e){var t,r=e._a;return r&&ae(e).overflow===-2&&(t=r[Rt]<0||r[Rt]>11?Rt:r[Et]<1||r[Et]>Uo(r[Ye],r[Rt])?Et:r[Re]<0||r[Re]>24||r[Re]===24&&(r[pt]!==0||r[It]!==0||r[yr]!==0)?Re:r[pt]<0||r[pt]>59?pt:r[It]<0||r[It]>59?It:r[yr]<0||r[yr]>999?yr:-1,ae(e)._overflowDayOfYear&&(t<Ye||t>Et)&&(t=Et),ae(e)._overflowWeeks&&t===-1&&(t=CS),ae(e)._overflowWeekday&&t===-1&&(t=LS),ae(e).overflow=t),e}var kk=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Ok=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_k=/Z|[+-]\d\d(?::?\d\d)?/,_s=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],xa=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Ck=/^\/?Date\((-?\d+)/i,Lk=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Nk={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function op(e){var t,r,n=e._i,s=kk.exec(n)||Ok.exec(n),i,a,o,c,d=_s.length,f=xa.length;if(s){for(ae(e).iso=!0,t=0,r=d;t<r;t++)if(_s[t][1].exec(s[1])){a=_s[t][0],i=_s[t][2]!==!1;break}if(a==null){e._isValid=!1;return}if(s[3]){for(t=0,r=f;t<r;t++)if(xa[t][1].exec(s[3])){o=(s[2]||" ")+xa[t][0];break}if(o==null){e._isValid=!1;return}}if(!i&&o!=null){e._isValid=!1;return}if(s[4])if(_k.exec(s[4]))c="Z";else{e._isValid=!1;return}e._f=a+(o||"")+(c||""),Go(e)}else e._isValid=!1}function jk(e,t,r,n,s,i){var a=[Mk(e),Jh.indexOf(t),parseInt(r,10),parseInt(n,10),parseInt(s,10)];return i&&a.push(parseInt(i,10)),a}function Mk(e){var t=parseInt(e,10);return t<=49?2e3+t:t<=999?1900+t:t}function Tk(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Dk(e,t,r){if(e){var n=np.indexOf(e),s=new Date(t[0],t[1],t[2]).getDay();if(n!==s)return ae(r).weekdayMismatch=!0,r._isValid=!1,!1}return!0}function Pk(e,t,r){if(e)return Nk[e];if(t)return 0;var n=parseInt(r,10),s=n%100,i=(n-s)/100;return i*60+s}function lp(e){var t=Lk.exec(Tk(e._i)),r;if(t){if(r=jk(t[4],t[3],t[2],t[5],t[6],t[7]),!Dk(t[1],r,e))return;e._a=r,e._tzm=Pk(t[8],t[9],t[10]),e._d=Un.apply(null,e._a),e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),ae(e).rfc2822=!0}else e._isValid=!1}function Ak(e){var t=Ck.exec(e._i);if(t!==null){e._d=new Date(+t[1]);return}if(op(e),e._isValid===!1)delete e._isValid;else return;if(lp(e),e._isValid===!1)delete e._isValid;else return;e._strict?e._isValid=!1:R.createFromInputFallback(e)}R.createFromInputFallback=dt("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(e){e._d=new Date(e._i+(e._useUTC?" UTC":""))});function Vr(e,t,r){return e??t??r}function Rk(e){var t=new Date(R.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}function Ho(e){var t,r,n=[],s,i,a;if(!e._d){for(s=Rk(e),e._w&&e._a[Et]==null&&e._a[Rt]==null&&Ik(e),e._dayOfYear!=null&&(a=Vr(e._a[Ye],s[Ye]),(e._dayOfYear>Cn(a)||e._dayOfYear===0)&&(ae(e)._overflowDayOfYear=!0),r=Un(a,0,e._dayOfYear),e._a[Rt]=r.getUTCMonth(),e._a[Et]=r.getUTCDate()),t=0;t<3&&e._a[t]==null;++t)e._a[t]=n[t]=s[t];for(;t<7;t++)e._a[t]=n[t]=e._a[t]==null?t===2?1:0:e._a[t];e._a[Re]===24&&e._a[pt]===0&&e._a[It]===0&&e._a[yr]===0&&(e._nextDay=!0,e._a[Re]=0),e._d=(e._useUTC?Un:BS).apply(null,n),i=e._useUTC?e._d.getUTCDay():e._d.getDay(),e._tzm!=null&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[Re]=24),e._w&&typeof e._w.d<"u"&&e._w.d!==i&&(ae(e).weekdayMismatch=!0)}}function Ik(e){var t,r,n,s,i,a,o,c,d;t=e._w,t.GG!=null||t.W!=null||t.E!=null?(i=1,a=4,r=Vr(t.GG,e._a[Ye],Vn(je(),1,4).year),n=Vr(t.W,1),s=Vr(t.E,1),(s<1||s>7)&&(c=!0)):(i=e._locale._week.dow,a=e._locale._week.doy,d=Vn(je(),i,a),r=Vr(t.gg,e._a[Ye],d.year),n=Vr(t.w,d.week),t.d!=null?(s=t.d,(s<0||s>6)&&(c=!0)):t.e!=null?(s=t.e+i,(t.e<0||t.e>6)&&(c=!0)):s=i),n<1||n>$t(r,i,a)?ae(e)._overflowWeeks=!0:c!=null?ae(e)._overflowWeekday=!0:(o=rp(r,n,s,i,a),e._a[Ye]=o.year,e._dayOfYear=o.dayOfYear)}R.ISO_8601=function(){};R.RFC_2822=function(){};function Go(e){if(e._f===R.ISO_8601){op(e);return}if(e._f===R.RFC_2822){lp(e);return}e._a=[],ae(e).empty=!0;var t=""+e._i,r,n,s,i,a,o=t.length,c=0,d,f;for(s=Wh(e._f,e._locale).match(Ao)||[],f=s.length,r=0;r<f;r++)i=s[r],n=(t.match(kS(i,e))||[])[0],n&&(a=t.substr(0,t.indexOf(n)),a.length>0&&ae(e).unusedInput.push(a),t=t.slice(t.indexOf(n)+n.length),c+=n.length),Hr[i]?(n?ae(e).empty=!1:ae(e).unusedTokens.push(i),_S(i,n,e)):e._strict&&!n&&ae(e).unusedTokens.push(i);ae(e).charsLeftOver=o-c,t.length>0&&ae(e).unusedInput.push(t),e._a[Re]<=12&&ae(e).bigHour===!0&&e._a[Re]>0&&(ae(e).bigHour=void 0),ae(e).parsedDateParts=e._a.slice(0),ae(e).meridiem=e._meridiem,e._a[Re]=Fk(e._locale,e._a[Re],e._meridiem),d=ae(e).era,d!==null&&(e._a[Ye]=e._locale.erasConvertYear(d,e._a[Ye])),Ho(e),Yo(e)}function Fk(e,t,r){var n;return r==null?t:e.meridiemHour!=null?e.meridiemHour(t,r):(e.isPM!=null&&(n=e.isPM(r),n&&t<12&&(t+=12),!n&&t===12&&(t=0)),t)}function $k(e){var t,r,n,s,i,a,o=!1,c=e._f.length;if(c===0){ae(e).invalidFormat=!0,e._d=new Date(NaN);return}for(s=0;s<c;s++)i=0,a=!1,t=Do({},e),e._useUTC!=null&&(t._useUTC=e._useUTC),t._f=e._f[s],Go(t),To(t)&&(a=!0),i+=ae(t).charsLeftOver,i+=ae(t).unusedTokens.length*10,ae(t).score=i,o?i<n&&(n=i,r=t):(n==null||i<n||a)&&(n=i,r=t,a&&(o=!0));er(e,r||t)}function Uk(e){if(!e._d){var t=Ro(e._i),r=t.day===void 0?t.date:t.day;e._a=Vh([t.year,t.month,r,t.hour,t.minute,t.second,t.millisecond],function(n){return n&&parseInt(n,10)}),Ho(e)}}function Vk(e){var t=new Qn(Yo(cp(e)));return t._nextDay&&(t.add(1,"d"),t._nextDay=void 0),t}function cp(e){var t=e._i,r=e._f;return e._locale=e._locale||Bt(e._l),t===null||r===void 0&&t===""?Ai({nullInput:!0}):(typeof t=="string"&&(e._i=t=e._locale.preparse(t)),vt(t)?new Qn(Yo(t)):(Xn(t)?e._d=t:gt(r)?$k(e):r?Go(e):zk(e),To(e)||(e._d=null),e))}function zk(e){var t=e._i;Ze(t)?e._d=new Date(R.now()):Xn(t)?e._d=new Date(t.valueOf()):typeof t=="string"?Ak(e):gt(t)?(e._a=Vh(t.slice(0),function(r){return parseInt(r,10)}),Ho(e)):Sr(t)?Uk(e):Vt(t)?e._d=new Date(t):R.createFromInputFallback(e)}function up(e,t,r,n,s){var i={};return(t===!0||t===!1)&&(n=t,t=void 0),(r===!0||r===!1)&&(n=r,r=void 0),(Sr(e)&&Mo(e)||gt(e)&&e.length===0)&&(e=void 0),i._isAMomentObject=!0,i._useUTC=i._isUTC=s,i._l=r,i._i=e,i._f=t,i._strict=n,Vk(i)}function je(e,t,r,n){return up(e,t,r,n,!1)}var Bk=dt("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=je.apply(null,arguments);return this.isValid()&&e.isValid()?e<this?this:e:Ai()}),Wk=dt("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var e=je.apply(null,arguments);return this.isValid()&&e.isValid()?e>this?this:e:Ai()});function dp(e,t){var r,n;if(t.length===1&>(t[0])&&(t=t[0]),!t.length)return je();for(r=t[0],n=1;n<t.length;++n)(!t[n].isValid()||t[n][e](r))&&(r=t[n]);return r}function Yk(){var e=[].slice.call(arguments,0);return dp("isBefore",e)}function Hk(){var e=[].slice.call(arguments,0);return dp("isAfter",e)}var Gk=function(){return Date.now?Date.now():+new Date},wn=["year","quarter","month","week","day","hour","minute","second","millisecond"];function qk(e){var t,r=!1,n,s=wn.length;for(t in e)if(ye(e,t)&&!(Pe.call(wn,t)!==-1&&(e[t]==null||!isNaN(e[t]))))return!1;for(n=0;n<s;++n)if(e[wn[n]]){if(r)return!1;parseFloat(e[wn[n]])!==pe(e[wn[n]])&&(r=!0)}return!0}function Zk(){return this._isValid}function Kk(){return xt(NaN)}function Bi(e){var t=Ro(e),r=t.year||0,n=t.quarter||0,s=t.month||0,i=t.week||t.isoWeek||0,a=t.day||0,o=t.hour||0,c=t.minute||0,d=t.second||0,f=t.millisecond||0;this._isValid=qk(t),this._milliseconds=+f+d*1e3+c*6e4+o*1e3*60*60,this._days=+a+i*7,this._months=+s+n*3+r*12,this._data={},this._locale=Bt(),this._bubble()}function Is(e){return e instanceof Bi}function Ka(e){return e<0?Math.round(-1*e)*-1:Math.round(e)}function Jk(e,t,r){var n=Math.min(e.length,t.length),s=Math.abs(e.length-t.length),i=0,a;for(a=0;a<n;a++)pe(e[a])!==pe(t[a])&&i++;return i+s}function fp(e,t){q(e,0,0,function(){var r=this.utcOffset(),n="+";return r<0&&(r=-r,n="-"),n+kt(~~(r/60),2)+t+kt(~~r%60,2)})}fp("Z",":");fp("ZZ","");V("Z",Ui);V("ZZ",Ui);ke(["Z","ZZ"],function(e,t,r){r._useUTC=!0,r._tzm=qo(Ui,e)});var Xk=/([\+\-]|\d\d)/gi;function qo(e,t){var r=(t||"").match(e),n,s,i;return r===null?null:(n=r[r.length-1]||[],s=(n+"").match(Xk)||["-",0,0],i=+(s[1]*60)+pe(s[2]),i===0?0:s[0]==="+"?i:-i)}function Zo(e,t){var r,n;return t._isUTC?(r=t.clone(),n=(vt(e)||Xn(e)?e.valueOf():je(e).valueOf())-r.valueOf(),r._d.setTime(r._d.valueOf()+n),R.updateOffset(r,!1),r):je(e).local()}function Ja(e){return-Math.round(e._d.getTimezoneOffset())}R.updateOffset=function(){};function Qk(e,t,r){var n=this._offset||0,s;if(!this.isValid())return e!=null?this:NaN;if(e!=null){if(typeof e=="string"){if(e=qo(Ui,e),e===null)return this}else Math.abs(e)<16&&!r&&(e=e*60);return!this._isUTC&&t&&(s=Ja(this)),this._offset=e,this._isUTC=!0,s!=null&&this.add(s,"m"),n!==e&&(!t||this._changeInProgress?mp(this,xt(e-n,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,R.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?n:Ja(this)}function e4(e,t){return e!=null?(typeof e!="string"&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}function t4(e){return this.utcOffset(0,e)}function r4(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(Ja(this),"m")),this}function n4(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var e=qo(ES,this._i);e!=null?this.utcOffset(e):this.utcOffset(0,!0)}return this}function s4(e){return this.isValid()?(e=e?je(e).utcOffset():0,(this.utcOffset()-e)%60===0):!1}function i4(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function a4(){if(!Ze(this._isDSTShifted))return this._isDSTShifted;var e={},t;return Do(e,this),e=cp(e),e._a?(t=e._isUTC?_t(e._a):je(e._a),this._isDSTShifted=this.isValid()&&Jk(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function o4(){return this.isValid()?!this._isUTC:!1}function l4(){return this.isValid()?this._isUTC:!1}function hp(){return this.isValid()?this._isUTC&&this._offset===0:!1}var c4=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,u4=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function xt(e,t){var r=e,n=null,s,i,a;return Is(e)?r={ms:e._milliseconds,d:e._days,M:e._months}:Vt(e)||!isNaN(+e)?(r={},t?r[t]=+e:r.milliseconds=+e):(n=c4.exec(e))?(s=n[1]==="-"?-1:1,r={y:0,d:pe(n[Et])*s,h:pe(n[Re])*s,m:pe(n[pt])*s,s:pe(n[It])*s,ms:pe(Ka(n[yr]*1e3))*s}):(n=u4.exec(e))?(s=n[1]==="-"?-1:1,r={y:fr(n[2],s),M:fr(n[3],s),w:fr(n[4],s),d:fr(n[5],s),h:fr(n[6],s),m:fr(n[7],s),s:fr(n[8],s)}):r==null?r={}:typeof r=="object"&&("from"in r||"to"in r)&&(a=d4(je(r.from),je(r.to)),r={},r.ms=a.milliseconds,r.M=a.months),i=new Bi(r),Is(e)&&ye(e,"_locale")&&(i._locale=e._locale),Is(e)&&ye(e,"_isValid")&&(i._isValid=e._isValid),i}xt.fn=Bi.prototype;xt.invalid=Kk;function fr(e,t){var r=e&&parseFloat(e.replace(",","."));return(isNaN(r)?0:r)*t}function nd(e,t){var r={};return r.months=t.month()-e.month()+(t.year()-e.year())*12,e.clone().add(r.months,"M").isAfter(t)&&--r.months,r.milliseconds=+t-+e.clone().add(r.months,"M"),r}function d4(e,t){var r;return e.isValid()&&t.isValid()?(t=Zo(t,e),e.isBefore(t)?r=nd(e,t):(r=nd(t,e),r.milliseconds=-r.milliseconds,r.months=-r.months),r):{milliseconds:0,months:0}}function pp(e,t){return function(r,n){var s,i;return n!==null&&!isNaN(+n)&&(Bh(t,"moment()."+t+"(period, number) is deprecated. Please use moment()."+t+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),i=r,r=n,n=i),s=xt(r,n),mp(this,s,e),this}}function mp(e,t,r,n){var s=t._milliseconds,i=Ka(t._days),a=Ka(t._months);e.isValid()&&(n=n??!0,a&&Qh(e,$n(e,"Month")+a*r),i&&Kh(e,"Date",$n(e,"Date")+i*r),s&&e._d.setTime(e._d.valueOf()+s*r),n&&R.updateOffset(e,i||a))}var f4=pp(1,"add"),h4=pp(-1,"subtract");function gp(e){return typeof e=="string"||e instanceof String}function p4(e){return vt(e)||Xn(e)||gp(e)||Vt(e)||g4(e)||m4(e)||e===null||e===void 0}function m4(e){var t=Sr(e)&&!Mo(e),r=!1,n=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],s,i,a=n.length;for(s=0;s<a;s+=1)i=n[s],r=r||ye(e,i);return t&&r}function g4(e){var t=gt(e),r=!1;return t&&(r=e.filter(function(n){return!Vt(n)&&gp(e)}).length===0),t&&r}function v4(e){var t=Sr(e)&&!Mo(e),r=!1,n=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],s,i;for(s=0;s<n.length;s+=1)i=n[s],r=r||ye(e,i);return t&&r}function y4(e,t){var r=e.diff(t,"days",!0);return r<-6?"sameElse":r<-1?"lastWeek":r<0?"lastDay":r<1?"sameDay":r<2?"nextDay":r<7?"nextWeek":"sameElse"}function x4(e,t){arguments.length===1&&(arguments[0]?p4(arguments[0])?(e=arguments[0],t=void 0):v4(arguments[0])&&(t=arguments[0],e=void 0):(e=void 0,t=void 0));var r=e||je(),n=Zo(r,this).startOf("day"),s=R.calendarFormat(this,n)||"sameElse",i=t&&(Ct(t[s])?t[s].call(this,r):t[s]);return this.format(i||this.localeData().calendar(s,this,je(r)))}function b4(){return new Qn(this)}function w4(e,t){var r=vt(e)?e:je(e);return this.isValid()&&r.isValid()?(t=ft(t)||"millisecond",t==="millisecond"?this.valueOf()>r.valueOf():r.valueOf()<this.clone().startOf(t).valueOf()):!1}function E4(e,t){var r=vt(e)?e:je(e);return this.isValid()&&r.isValid()?(t=ft(t)||"millisecond",t==="millisecond"?this.valueOf()<r.valueOf():this.clone().endOf(t).valueOf()<r.valueOf()):!1}function S4(e,t,r,n){var s=vt(e)?e:je(e),i=vt(t)?t:je(t);return this.isValid()&&s.isValid()&&i.isValid()?(n=n||"()",(n[0]==="("?this.isAfter(s,r):!this.isBefore(s,r))&&(n[1]===")"?this.isBefore(i,r):!this.isAfter(i,r))):!1}function k4(e,t){var r=vt(e)?e:je(e),n;return this.isValid()&&r.isValid()?(t=ft(t)||"millisecond",t==="millisecond"?this.valueOf()===r.valueOf():(n=r.valueOf(),this.clone().startOf(t).valueOf()<=n&&n<=this.clone().endOf(t).valueOf())):!1}function O4(e,t){return this.isSame(e,t)||this.isAfter(e,t)}function _4(e,t){return this.isSame(e,t)||this.isBefore(e,t)}function C4(e,t,r){var n,s,i;if(!this.isValid())return NaN;if(n=Zo(e,this),!n.isValid())return NaN;switch(s=(n.utcOffset()-this.utcOffset())*6e4,t=ft(t),t){case"year":i=Fs(this,n)/12;break;case"month":i=Fs(this,n);break;case"quarter":i=Fs(this,n)/3;break;case"second":i=(this-n)/1e3;break;case"minute":i=(this-n)/6e4;break;case"hour":i=(this-n)/36e5;break;case"day":i=(this-n-s)/864e5;break;case"week":i=(this-n-s)/6048e5;break;default:i=this-n}return r?i:lt(i)}function Fs(e,t){if(e.date()<t.date())return-Fs(t,e);var r=(t.year()-e.year())*12+(t.month()-e.month()),n=e.clone().add(r,"months"),s,i;return t-n<0?(s=e.clone().add(r-1,"months"),i=(t-n)/(n-s)):(s=e.clone().add(r+1,"months"),i=(t-n)/(s-n)),-(r+i)||0}R.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";R.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function L4(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function N4(e){if(!this.isValid())return null;var t=e!==!0,r=t?this.clone().utc():this;return r.year()<0||r.year()>9999?Rs(r,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Ct(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Rs(r,"Z")):Rs(r,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function j4(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="",r,n,s,i;return this.isLocal()||(e=this.utcOffset()===0?"moment.utc":"moment.parseZone",t="Z"),r="["+e+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",s="-MM-DD[T]HH:mm:ss.SSS",i=t+'[")]',this.format(r+n+s+i)}function M4(e){e||(e=this.isUtc()?R.defaultFormatUtc:R.defaultFormat);var t=Rs(this,e);return this.localeData().postformat(t)}function T4(e,t){return this.isValid()&&(vt(e)&&e.isValid()||je(e).isValid())?xt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function D4(e){return this.from(je(),e)}function P4(e,t){return this.isValid()&&(vt(e)&&e.isValid()||je(e).isValid())?xt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()}function A4(e){return this.to(je(),e)}function vp(e){var t;return e===void 0?this._locale._abbr:(t=Bt(e),t!=null&&(this._locale=t),this)}var yp=dt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(e){return e===void 0?this.localeData():this.locale(e)});function xp(){return this._locale}var di=1e3,Gr=60*di,fi=60*Gr,bp=(365*400+97)*24*fi;function qr(e,t){return(e%t+t)%t}function wp(e,t,r){return e<100&&e>=0?new Date(e+400,t,r)-bp:new Date(e,t,r).valueOf()}function Ep(e,t,r){return e<100&&e>=0?Date.UTC(e+400,t,r)-bp:Date.UTC(e,t,r)}function R4(e){var t,r;if(e=ft(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?Ep:wp,e){case"year":t=r(this.year(),0,1);break;case"quarter":t=r(this.year(),this.month()-this.month()%3,1);break;case"month":t=r(this.year(),this.month(),1);break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":t=r(this.year(),this.month(),this.date());break;case"hour":t=this._d.valueOf(),t-=qr(t+(this._isUTC?0:this.utcOffset()*Gr),fi);break;case"minute":t=this._d.valueOf(),t-=qr(t,Gr);break;case"second":t=this._d.valueOf(),t-=qr(t,di);break}return this._d.setTime(t),R.updateOffset(this,!0),this}function I4(e){var t,r;if(e=ft(e),e===void 0||e==="millisecond"||!this.isValid())return this;switch(r=this._isUTC?Ep:wp,e){case"year":t=r(this.year()+1,0,1)-1;break;case"quarter":t=r(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=r(this.year(),this.month()+1,1)-1;break;case"week":t=r(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=r(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=r(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=fi-qr(t+(this._isUTC?0:this.utcOffset()*Gr),fi)-1;break;case"minute":t=this._d.valueOf(),t+=Gr-qr(t,Gr)-1;break;case"second":t=this._d.valueOf(),t+=di-qr(t,di)-1;break}return this._d.setTime(t),R.updateOffset(this,!0),this}function F4(){return this._d.valueOf()-(this._offset||0)*6e4}function $4(){return Math.floor(this.valueOf()/1e3)}function U4(){return new Date(this.valueOf())}function V4(){var e=this;return[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second(),e.millisecond()]}function z4(){var e=this;return{years:e.year(),months:e.month(),date:e.date(),hours:e.hours(),minutes:e.minutes(),seconds:e.seconds(),milliseconds:e.milliseconds()}}function B4(){return this.isValid()?this.toISOString():null}function W4(){return To(this)}function Y4(){return er({},ae(this))}function H4(){return ae(this).overflow}function G4(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}q("N",0,0,"eraAbbr");q("NN",0,0,"eraAbbr");q("NNN",0,0,"eraAbbr");q("NNNN",0,0,"eraName");q("NNNNN",0,0,"eraNarrow");q("y",["y",1],"yo","eraYear");q("y",["yy",2],0,"eraYear");q("y",["yyy",3],0,"eraYear");q("y",["yyyy",4],0,"eraYear");V("N",Ko);V("NN",Ko);V("NNN",Ko);V("NNNN",sO);V("NNNNN",iO);ke(["N","NN","NNN","NNNN","NNNNN"],function(e,t,r,n){var s=r._locale.erasParse(e,n,r._strict);s?ae(r).era=s:ae(r).invalidEra=e});V("y",un);V("yy",un);V("yyy",un);V("yyyy",un);V("yo",aO);ke(["y","yy","yyy","yyyy"],Ye);ke(["yo"],function(e,t,r,n){var s;r._locale._eraYearOrdinalRegex&&(s=e.match(r._locale._eraYearOrdinalRegex)),r._locale.eraYearOrdinalParse?t[Ye]=r._locale.eraYearOrdinalParse(e,s):t[Ye]=parseInt(e,10)});function q4(e,t){var r,n,s,i=this._eras||Bt("en")._eras;for(r=0,n=i.length;r<n;++r){switch(typeof i[r].since){case"string":s=R(i[r].since).startOf("day"),i[r].since=s.valueOf();break}switch(typeof i[r].until){case"undefined":i[r].until=1/0;break;case"string":s=R(i[r].until).startOf("day").valueOf(),i[r].until=s.valueOf();break}}return i}function Z4(e,t,r){var n,s,i=this.eras(),a,o,c;for(e=e.toUpperCase(),n=0,s=i.length;n<s;++n)if(a=i[n].name.toUpperCase(),o=i[n].abbr.toUpperCase(),c=i[n].narrow.toUpperCase(),r)switch(t){case"N":case"NN":case"NNN":if(o===e)return i[n];break;case"NNNN":if(a===e)return i[n];break;case"NNNNN":if(c===e)return i[n];break}else if([a,o,c].indexOf(e)>=0)return i[n]}function K4(e,t){var r=e.since<=e.until?1:-1;return t===void 0?R(e.since).year():R(e.since).year()+(t-e.offset)*r}function J4(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until||n[e].until<=r&&r<=n[e].since)return n[e].name;return""}function X4(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until||n[e].until<=r&&r<=n[e].since)return n[e].narrow;return""}function Q4(){var e,t,r,n=this.localeData().eras();for(e=0,t=n.length;e<t;++e)if(r=this.clone().startOf("day").valueOf(),n[e].since<=r&&r<=n[e].until||n[e].until<=r&&r<=n[e].since)return n[e].abbr;return""}function eO(){var e,t,r,n,s=this.localeData().eras();for(e=0,t=s.length;e<t;++e)if(r=s[e].since<=s[e].until?1:-1,n=this.clone().startOf("day").valueOf(),s[e].since<=n&&n<=s[e].until||s[e].until<=n&&n<=s[e].since)return(this.year()-R(s[e].since).year())*r+s[e].offset;return this.year()}function tO(e){return ye(this,"_erasNameRegex")||Jo.call(this),e?this._erasNameRegex:this._erasRegex}function rO(e){return ye(this,"_erasAbbrRegex")||Jo.call(this),e?this._erasAbbrRegex:this._erasRegex}function nO(e){return ye(this,"_erasNarrowRegex")||Jo.call(this),e?this._erasNarrowRegex:this._erasRegex}function Ko(e,t){return t.erasAbbrRegex(e)}function sO(e,t){return t.erasNameRegex(e)}function iO(e,t){return t.erasNarrowRegex(e)}function aO(e,t){return t._eraYearOrdinalRegex||un}function Jo(){var e=[],t=[],r=[],n=[],s,i,a,o,c,d=this.eras();for(s=0,i=d.length;s<i;++s)a=Ft(d[s].name),o=Ft(d[s].abbr),c=Ft(d[s].narrow),t.push(a),e.push(o),r.push(c),n.push(a),n.push(o),n.push(c);this._erasRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+t.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+e.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+r.join("|")+")","i")}q(0,["gg",2],0,function(){return this.weekYear()%100});q(0,["GG",2],0,function(){return this.isoWeekYear()%100});function Wi(e,t){q(0,[e,e.length],0,t)}Wi("gggg","weekYear");Wi("ggggg","weekYear");Wi("GGGG","isoWeekYear");Wi("GGGGG","isoWeekYear");V("G",$i);V("g",$i);V("GG",Me,nt);V("gg",Me,nt);V("GGGG",Fo,Io);V("gggg",Fo,Io);V("GGGGG",Fi,Ri);V("ggggg",Fi,Ri);ts(["gggg","ggggg","GGGG","GGGGG"],function(e,t,r,n){t[n.substr(0,2)]=pe(e)});ts(["gg","GG"],function(e,t,r,n){t[n]=R.parseTwoDigitYear(e)});function oO(e){return Sp.call(this,e,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function lO(e){return Sp.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)}function cO(){return $t(this.year(),1,4)}function uO(){return $t(this.isoWeekYear(),1,4)}function dO(){var e=this.localeData()._week;return $t(this.year(),e.dow,e.doy)}function fO(){var e=this.localeData()._week;return $t(this.weekYear(),e.dow,e.doy)}function Sp(e,t,r,n,s){var i;return e==null?Vn(this,n,s).year:(i=$t(e,n,s),t>i&&(t=i),hO.call(this,e,t,r,n,s))}function hO(e,t,r,n,s){var i=rp(e,t,r,n,s),a=Un(i.year,0,i.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}q("Q",0,"Qo","quarter");V("Q",Yh);ke("Q",function(e,t){t[Rt]=(pe(e)-1)*3});function pO(e){return e==null?Math.ceil((this.month()+1)/3):this.month((e-1)*3+this.month()%3)}q("D",["DD",2],"Do","date");V("D",Me,dn);V("DD",Me,nt);V("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient});ke(["D","DD"],Et);ke("Do",function(e,t){t[Et]=pe(e.match(Me)[0])});var kp=fn("Date",!0);q("DDD",["DDDD",3],"DDDo","dayOfYear");V("DDD",Ii);V("DDDD",Hh);ke(["DDD","DDDD"],function(e,t,r){r._dayOfYear=pe(e)});function mO(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return e==null?t:this.add(e-t,"d")}q("m",["mm",2],0,"minute");V("m",Me,$o);V("mm",Me,nt);ke(["m","mm"],pt);var gO=fn("Minutes",!1);q("s",["ss",2],0,"second");V("s",Me,$o);V("ss",Me,nt);ke(["s","ss"],It);var vO=fn("Seconds",!1);q("S",0,0,function(){return~~(this.millisecond()/100)});q(0,["SS",2],0,function(){return~~(this.millisecond()/10)});q(0,["SSS",3],0,"millisecond");q(0,["SSSS",4],0,function(){return this.millisecond()*10});q(0,["SSSSS",5],0,function(){return this.millisecond()*100});q(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3});q(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4});q(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5});q(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6});V("S",Ii,Yh);V("SS",Ii,nt);V("SSS",Ii,Hh);var tr,Op;for(tr="SSSS";tr.length<=9;tr+="S")V(tr,un);function yO(e,t){t[yr]=pe(("0."+e)*1e3)}for(tr="S";tr.length<=9;tr+="S")ke(tr,yO);Op=fn("Milliseconds",!1);q("z",0,0,"zoneAbbr");q("zz",0,0,"zoneName");function xO(){return this._isUTC?"UTC":""}function bO(){return this._isUTC?"Coordinated Universal Time":""}var P=Qn.prototype;P.add=f4;P.calendar=x4;P.clone=b4;P.diff=C4;P.endOf=I4;P.format=M4;P.from=T4;P.fromNow=D4;P.to=P4;P.toNow=A4;P.get=jS;P.invalidAt=H4;P.isAfter=w4;P.isBefore=E4;P.isBetween=S4;P.isSame=k4;P.isSameOrAfter=O4;P.isSameOrBefore=_4;P.isValid=W4;P.lang=yp;P.locale=vp;P.localeData=xp;P.max=Wk;P.min=Bk;P.parsingFlags=Y4;P.set=MS;P.startOf=R4;P.subtract=h4;P.toArray=V4;P.toObject=z4;P.toDate=U4;P.toISOString=N4;P.inspect=j4;typeof Symbol<"u"&&Symbol.for!=null&&(P[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"});P.toJSON=B4;P.toString=L4;P.unix=$4;P.valueOf=F4;P.creationData=G4;P.eraName=J4;P.eraNarrow=X4;P.eraAbbr=Q4;P.eraYear=eO;P.year=Zh;P.isLeapYear=NS;P.weekYear=oO;P.isoWeekYear=lO;P.quarter=P.quarters=pO;P.month=ep;P.daysInMonth=US;P.week=P.weeks=qS;P.isoWeek=P.isoWeeks=ZS;P.weeksInYear=dO;P.weeksInWeekYear=fO;P.isoWeeksInYear=cO;P.isoWeeksInISOWeekYear=uO;P.date=kp;P.day=P.days=lk;P.weekday=ck;P.isoWeekday=uk;P.dayOfYear=mO;P.hour=P.hours=vk;P.minute=P.minutes=gO;P.second=P.seconds=vO;P.millisecond=P.milliseconds=Op;P.utcOffset=Qk;P.utc=t4;P.local=r4;P.parseZone=n4;P.hasAlignedHourOffset=s4;P.isDST=i4;P.isLocal=o4;P.isUtcOffset=l4;P.isUtc=hp;P.isUTC=hp;P.zoneAbbr=xO;P.zoneName=bO;P.dates=dt("dates accessor is deprecated. Use date instead.",kp);P.months=dt("months accessor is deprecated. Use month instead",ep);P.years=dt("years accessor is deprecated. Use year instead",Zh);P.zone=dt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",e4);P.isDSTShifted=dt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",a4);function wO(e){return je(e*1e3)}function EO(){return je.apply(null,arguments).parseZone()}function _p(e){return e}var xe=Po.prototype;xe.calendar=oS;xe.longDateFormat=dS;xe.invalidDate=hS;xe.ordinal=gS;xe.preparse=_p;xe.postformat=_p;xe.relativeTime=yS;xe.pastFuture=xS;xe.set=iS;xe.eras=q4;xe.erasParse=Z4;xe.erasConvertYear=K4;xe.erasAbbrRegex=rO;xe.erasNameRegex=tO;xe.erasNarrowRegex=nO;xe.months=RS;xe.monthsShort=IS;xe.monthsParse=$S;xe.monthsRegex=zS;xe.monthsShortRegex=VS;xe.week=WS;xe.firstDayOfYear=GS;xe.firstDayOfWeek=HS;xe.weekdays=nk;xe.weekdaysMin=ik;xe.weekdaysShort=sk;xe.weekdaysParse=ok;xe.weekdaysRegex=dk;xe.weekdaysShortRegex=fk;xe.weekdaysMinRegex=hk;xe.isPM=mk;xe.meridiem=yk;function hi(e,t,r,n){var s=Bt(),i=_t().set(n,t);return s[r](i,e)}function Cp(e,t,r){if(Vt(e)&&(t=e,e=void 0),e=e||"",t!=null)return hi(e,t,r,"month");var n,s=[];for(n=0;n<12;n++)s[n]=hi(e,n,r,"month");return s}function Xo(e,t,r,n){typeof e=="boolean"?(Vt(t)&&(r=t,t=void 0),t=t||""):(t=e,r=t,e=!1,Vt(t)&&(r=t,t=void 0),t=t||"");var s=Bt(),i=e?s._week.dow:0,a,o=[];if(r!=null)return hi(t,(r+i)%7,n,"day");for(a=0;a<7;a++)o[a]=hi(t,(a+i)%7,n,"day");return o}function SO(e,t){return Cp(e,t,"months")}function kO(e,t){return Cp(e,t,"monthsShort")}function OO(e,t,r){return Xo(e,t,r,"weekdays")}function _O(e,t,r){return Xo(e,t,r,"weekdaysShort")}function CO(e,t,r){return Xo(e,t,r,"weekdaysMin")}sr("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,r=pe(e%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th";return e+r}});R.lang=dt("moment.lang is deprecated. Use moment.locale instead.",sr);R.langData=dt("moment.langData is deprecated. Use moment.localeData instead.",Bt);var Nt=Math.abs;function LO(){var e=this._data;return this._milliseconds=Nt(this._milliseconds),this._days=Nt(this._days),this._months=Nt(this._months),e.milliseconds=Nt(e.milliseconds),e.seconds=Nt(e.seconds),e.minutes=Nt(e.minutes),e.hours=Nt(e.hours),e.months=Nt(e.months),e.years=Nt(e.years),this}function Lp(e,t,r,n){var s=xt(t,r);return e._milliseconds+=n*s._milliseconds,e._days+=n*s._days,e._months+=n*s._months,e._bubble()}function NO(e,t){return Lp(this,e,t,1)}function jO(e,t){return Lp(this,e,t,-1)}function sd(e){return e<0?Math.floor(e):Math.ceil(e)}function MO(){var e=this._milliseconds,t=this._days,r=this._months,n=this._data,s,i,a,o,c;return e>=0&&t>=0&&r>=0||e<=0&&t<=0&&r<=0||(e+=sd(Xa(r)+t)*864e5,t=0,r=0),n.milliseconds=e%1e3,s=lt(e/1e3),n.seconds=s%60,i=lt(s/60),n.minutes=i%60,a=lt(i/60),n.hours=a%24,t+=lt(a/24),c=lt(Np(t)),r+=c,t-=sd(Xa(c)),o=lt(r/12),r%=12,n.days=t,n.months=r,n.years=o,this}function Np(e){return e*4800/146097}function Xa(e){return e*146097/4800}function TO(e){if(!this.isValid())return NaN;var t,r,n=this._milliseconds;if(e=ft(e),e==="month"||e==="quarter"||e==="year")switch(t=this._days+n/864e5,r=this._months+Np(t),e){case"month":return r;case"quarter":return r/3;case"year":return r/12}else switch(t=this._days+Math.round(Xa(this._months)),e){case"week":return t/7+n/6048e5;case"day":return t+n/864e5;case"hour":return t*24+n/36e5;case"minute":return t*1440+n/6e4;case"second":return t*86400+n/1e3;case"millisecond":return Math.floor(t*864e5)+n;default:throw new Error("Unknown unit "+e)}}function Wt(e){return function(){return this.as(e)}}var jp=Wt("ms"),DO=Wt("s"),PO=Wt("m"),AO=Wt("h"),RO=Wt("d"),IO=Wt("w"),FO=Wt("M"),$O=Wt("Q"),UO=Wt("y"),VO=jp;function zO(){return xt(this)}function BO(e){return e=ft(e),this.isValid()?this[e+"s"]():NaN}function Dr(e){return function(){return this.isValid()?this._data[e]:NaN}}var WO=Dr("milliseconds"),YO=Dr("seconds"),HO=Dr("minutes"),GO=Dr("hours"),qO=Dr("days"),ZO=Dr("months"),KO=Dr("years");function JO(){return lt(this.days()/7)}var Mt=Math.round,Wr={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function XO(e,t,r,n,s){return s.relativeTime(t||1,!!r,e,n)}function QO(e,t,r,n){var s=xt(e).abs(),i=Mt(s.as("s")),a=Mt(s.as("m")),o=Mt(s.as("h")),c=Mt(s.as("d")),d=Mt(s.as("M")),f=Mt(s.as("w")),h=Mt(s.as("y")),p=i<=r.ss&&["s",i]||i<r.s&&["ss",i]||a<=1&&["m"]||a<r.m&&["mm",a]||o<=1&&["h"]||o<r.h&&["hh",o]||c<=1&&["d"]||c<r.d&&["dd",c];return r.w!=null&&(p=p||f<=1&&["w"]||f<r.w&&["ww",f]),p=p||d<=1&&["M"]||d<r.M&&["MM",d]||h<=1&&["y"]||["yy",h],p[2]=t,p[3]=+e>0,p[4]=n,XO.apply(null,p)}function e_(e){return e===void 0?Mt:typeof e=="function"?(Mt=e,!0):!1}function t_(e,t){return Wr[e]===void 0?!1:t===void 0?Wr[e]:(Wr[e]=t,e==="s"&&(Wr.ss=t-1),!0)}function r_(e,t){if(!this.isValid())return this.localeData().invalidDate();var r=!1,n=Wr,s,i;return typeof e=="object"&&(t=e,e=!1),typeof e=="boolean"&&(r=e),typeof t=="object"&&(n=Object.assign({},Wr,t),t.s!=null&&t.ss==null&&(n.ss=t.s-1)),s=this.localeData(),i=QO(this,!r,n,s),r&&(i=s.pastFuture(+this,i)),s.postformat(i)}var ba=Math.abs;function Ur(e){return(e>0)-(e<0)||+e}function Yi(){if(!this.isValid())return this.localeData().invalidDate();var e=ba(this._milliseconds)/1e3,t=ba(this._days),r=ba(this._months),n,s,i,a,o=this.asSeconds(),c,d,f,h;return o?(n=lt(e/60),s=lt(n/60),e%=60,n%=60,i=lt(r/12),r%=12,a=e?e.toFixed(3).replace(/\.?0+$/,""):"",c=o<0?"-":"",d=Ur(this._months)!==Ur(o)?"-":"",f=Ur(this._days)!==Ur(o)?"-":"",h=Ur(this._milliseconds)!==Ur(o)?"-":"",c+"P"+(i?d+i+"Y":"")+(r?d+r+"M":"")+(t?f+t+"D":"")+(s||n||e?"T":"")+(s?h+s+"H":"")+(n?h+n+"M":"")+(e?h+a+"S":"")):"P0D"}var me=Bi.prototype;me.isValid=Zk;me.abs=LO;me.add=NO;me.subtract=jO;me.as=TO;me.asMilliseconds=jp;me.asSeconds=DO;me.asMinutes=PO;me.asHours=AO;me.asDays=RO;me.asWeeks=IO;me.asMonths=FO;me.asQuarters=$O;me.asYears=UO;me.valueOf=VO;me._bubble=MO;me.clone=zO;me.get=BO;me.milliseconds=WO;me.seconds=YO;me.minutes=HO;me.hours=GO;me.days=qO;me.weeks=JO;me.months=ZO;me.years=KO;me.humanize=r_;me.toISOString=Yi;me.toString=Yi;me.toJSON=Yi;me.locale=vp;me.localeData=xp;me.toIsoString=dt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Yi);me.lang=yp;q("X",0,0,"unix");q("x",0,0,"valueOf");V("x",$i);V("X",SS);ke("X",function(e,t,r){r._d=new Date(parseFloat(e)*1e3)});ke("x",function(e,t,r){r._d=new Date(pe(e))});//! moment.js
|
|
86
|
-
R.version="2.30.1";nS(je);R.fn=P;R.min=Yk;R.max=Hk;R.now=Gk;R.utc=_t;R.unix=wO;R.months=SO;R.isDate=Xn;R.locale=sr;R.invalid=Ai;R.duration=xt;R.isMoment=vt;R.weekdays=OO;R.parseZone=EO;R.localeData=Bt;R.isDuration=Is;R.monthsShort=kO;R.weekdaysMin=CO;R.defineLocale=Wo;R.updateLocale=Ek;R.locales=Sk;R.weekdaysShort=_O;R.normalizeUnits=ft;R.relativeTimeRounding=e_;R.relativeTimeThreshold=t_;R.calendarFormat=y4;R.prototype=P;R.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};var Pt=(e=>(e[e.STANDARD=60]="STANDARD",e[e.DOCUMENT=61]="DOCUMENT",e[e.INTERNATIONAL_DOCUMENT=62]="INTERNATIONAL_DOCUMENT",e[e.INTERNATIONAL_STANDARD=63]="INTERNATIONAL_STANDARD",e[e.ECONOMIC=64]="ECONOMIC",e[e.SAVER=70]="SAVER",e[e.NATIONAL_LOCKER=81]="NATIONAL_LOCKER",e[e.INTERNAL_MAIL=99]="INTERNAL_MAIL",e))(Pt||{}),Mp=(e=>(e[e.ANULLED=6]="ANULLED",e[e.PAID=10]="PAID",e[e.PENDING=11]="PENDING",e[e.PARTIAL_PAID=20]="PARTIAL_PAID",e[e.TO_ISSUE=59]="TO_ISSUE",e[e.ISSUED=60]="ISSUED",e))(Mp||{}),Ln=(e=>(e[e.INVOICE=2]="INVOICE",e[e.CREDIT_NOTE=4]="CREDIT_NOTE",e[e.ORDER=6]="ORDER",e))(Ln||{}),Qo=(e=>(e[e.CASH=1]="CASH",e[e.COD=2]="COD",e[e.CREDIT=3]="CREDIT",e[e.BOXOFFICE_CREDIT=4]="BOXOFFICE_CREDIT",e[e.DEST_BOXOFFICE_CREDIT=5]="DEST_BOXOFFICE_CREDIT",e[e.EXEMPT=6]="EXEMPT",e))(Qo||{}),Tp=(e=>(e[e.INTERNATIONAL=1]="INTERNATIONAL",e[e.NATIONAL=2]="NATIONAL",e))(Tp||{}),Ie=(e=>(e[e.OFFICE=10]="OFFICE",e[e.HOME=20]="HOME",e[e.INTERNATIONAL=21]="INTERNATIONAL",e))(Ie||{}),rr=(e=>(e[e.PERSON=0]="PERSON",e[e.BOX_ACCOUNT=1]="BOX_ACCOUNT",e))(rr||{});const Dp={shipper:null,consigneeType:{id:"0",value:0,label:"Persona"},consignee:null,boxAccount:null,pickupType:{id:Ie.OFFICE.toString(),value:{deliveryTypeID:Ie.OFFICE,deliveryTypeName:"Tienda"},label:"Tienda"},originStore:null,originAddress:null,deliveryType:{id:Ie.OFFICE.toString(),value:{deliveryTypeID:Ie.OFFICE,deliveryTypeName:"Tienda"},label:"Tienda"},destinationStore:null,destinationAddress:null};var gr=(e=>(e[e.ACTIVE=1]="ACTIVE",e[e.ANNULLED=3]="ANNULLED",e[e.DRAFT=5]="DRAFT",e[e.REPLACED=55]="REPLACED",e[e.DELIVERED=30]="DELIVERED",e))(gr||{});const Pp=({invoice:e,onClick:t})=>{const r=u.useMemo(()=>{switch(e.type){case Ln.INVOICE:return"Factura:";case Ln.CREDIT_NOTE:return"Nota de Crédito:";case Ln.ORDER:return"Orden:"}},[e.type]);return l.jsxs("div",{className:"border cursor-pointer border-gray-300 dark:border-gray-700 rounded-lg p-4 hover:shadow-md transition-all text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 duration-100",onClick:t,children:[l.jsxs("div",{className:"flex items-center justify-between mb-3 gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(fv,{className:"w-4 h-4 text-indigo-600 dark:text-indigo-400"}),l.jsxs("span",{className:"font-semibold text-sm text-card-foreground dark:text-gray-200",children:[r," ",l.jsx("span",{className:"text-gray-900 dark:text-gray-100 font-bold",children:e.invoiceNumber})]})]}),l.jsx(Zr,{color:"primary",children:e.statusName})]}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[l.jsxs("div",{className:"col-span-3 md:col-span-2",children:[l.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[l.jsx(tf,{className:"w-3 h-3 text-indigo-600 dark:text-indigo-400"}),l.jsx("h3",{className:"font-semibold text-xs text-card-foreground dark:text-gray-200",children:"Cliente"})]}),l.jsx("p",{className:"text-sm font-bold text-card-foreground dark:text-gray-100",children:e.accountFullName}),l.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground mt-0.5 text-gray-600 dark:text-gray-400",children:[l.jsx(ef,{className:"w-3 h-3"}),l.jsx("span",{className:"text-xs",children:R(e.invoiceDate).format("DD/MM/YYYY, hh:mm A")})]})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[l.jsx(YE,{className:"w-3 h-3 text-indigo-600 dark:text-indigo-400"}),l.jsx("h3",{className:"font-semibold text-xs text-card-foreground dark:text-gray-200",children:"Total"})]}),l.jsxs("p",{className:"text-sm font-bold text-card-foreground dark:text-indigo-400",children:["$",e.totalAmount.toFixed(2)]}),l.jsx("p",{className:"text-xs text-muted-foreground text-gray-600 dark:text-gray-400",children:"Con IVA"})]}),e.balanceAmount>=0&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[l.jsx(en,{className:"w-3 h-3 text-indigo-600 dark:text-indigo-400"}),l.jsx("h3",{className:"font-semibold text-xs text-card-foreground dark:text-gray-200",children:"Por Cobrar"})]}),l.jsxs("p",{className:"text-sm font-bold text-card-foreground dark:text-indigo-400",children:["$",Math.max(e.balanceAmount,0).toFixed(2)]}),l.jsx("p",{className:"text-xs text-muted-foreground text-gray-600 dark:text-gray-400",children:"Saldo pendiente"})]}),e.balanceAmount<0&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[l.jsx(en,{className:"w-3 h-3 text-indigo-600 dark:text-indigo-400"}),l.jsx("h3",{className:"font-semibold text-xs text-card-foreground dark:text-gray-200",children:"Reintegrar"})]}),l.jsxs("p",{className:"text-sm font-bold text-card-foreground dark:text-indigo-400",children:["$",Math.max(-e.balanceAmount,0).toFixed(2)]}),l.jsx("p",{className:"text-xs text-muted-foreground text-gray-600 dark:text-gray-400",children:"Monto a devolver"})]})]})]})};function n_(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14 3v4a1 1 0 0 0 1 1h4"},child:[]},{tag:"path",attr:{d:"M19 12v7a1.78 1.78 0 0 1 -3.1 1.4a1.65 1.65 0 0 0 -2.6 0a1.65 1.65 0 0 1 -2.6 0a1.65 1.65 0 0 0 -2.6 0a1.78 1.78 0 0 1 -3.1 -1.4v-14a2 2 0 0 1 2 -2h7l5 5v4.25"},child:[]}]})(e)}function s_(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14.916 11.707a3 3 0 1 0 -2.916 2.293"},child:[]},{tag:"path",attr:{d:"M11.991 21.485a1.994 1.994 0 0 1 -1.404 -.585l-4.244 -4.243a8 8 0 1 1 13.651 -5.351"},child:[]},{tag:"path",attr:{d:"M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"},child:[]},{tag:"path",attr:{d:"M20.2 20.2l1.8 1.8"},child:[]}]})(e)}function i_(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 20m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M10 20h-6"},child:[]},{tag:"path",attr:{d:"M14 20h6"},child:[]},{tag:"path",attr:{d:"M12 15l-2 -2h-3a1 1 0 0 1 -1 -1v-8a1 1 0 0 1 1 -1h10a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-3l-2 2z"},child:[]},{tag:"path",attr:{d:"M12 6v2"},child:[]},{tag:"path",attr:{d:"M12 11v.01"},child:[]}]})(e)}const Ap=({invoices:e,onInvoiceClick:t,wrapperClassName:r})=>l.jsx("div",{className:A("w-full mx-auto",r),children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(n_,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-lg font-bold",children:"Facturas"})]})}),l.jsx("div",{className:"p-2 md:p-4 space-y-4",children:e.map(n=>l.jsx(Pp,{invoice:n,onClick:()=>t?.(n)},n.invoiceID))})]})}),a_={category:null,weight:null,height:null,width:null,length:null,quantity:1},o_=({serviceId:e,categoryTypeId:t,formik:r,warningSchema:n})=>{const{values:s,touched:i,errors:a,handleChange:o,handleBlur:c,handleSubmit:d,setFieldValue:f}=r,h=u.useContext(on),[p,g]=u.useState(null),[m,x]=u.useState(null),[y,w]=u.useState([]),[O,S]=u.useState(""),[E,v]=u.useState({}),b=u.useMemo(()=>a,[a]);return u.useEffect(()=>{(async()=>{const C=await ch(h.api,t);C.error||!C.data||(w(C.data.map(_=>({id:_.categoryId.toString(),label:_.categoryName,value:_}))),x(C.data.find(_=>nx.includes(_.categoryId))??null),g(C.data.find(_=>rx.includes(_.categoryId))??null))})()},[t,h.api]),u.useEffect(()=>{p&&(e===Pt.DOCUMENT||e===Pt.INTERNATIONAL_DOCUMENT)?(S(p.categoryName),f("category",{id:p.categoryId.toString(),label:p.categoryName,value:p}),f("height",ia.HEIGHT),f("width",ia.WIDTH),f("length",ia.LENGTH)):(S(""),f("category",null),f("height",""),f("width",""),f("length",""))},[e,p,f]),u.useEffect(()=>{(async(C,_)=>{try{return await C.validate(_,{abortEarly:!1}),{}}catch(M){if(M instanceof ze){const D={};return M.inner.forEach(F=>{F.path&&(D[F.path]=F.message)}),D}return{}}})(n,s).then(C=>{v(C)})},[s,n]),l.jsx("div",{className:"w-full max-w-2xl",children:l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"space-y-2",children:l.jsx(ct,{label:"Categoría",id:"category",name:"category",placeholder:"Seleccione una categoría",options:y,selected:s.category,searchText:O,disabled:e===Pt.DOCUMENT,error:i.category&&a.category,onSelectOption:k=>f("category",k),onBlur:c,setSearchText:S,footerOption:m?{label:m.categoryName,id:m.categoryId.toString(),value:m}:void 0})}),l.jsxs("div",{className:A("space-y-2",{hidden:e===Pt.DOCUMENT}),children:[l.jsx("h4",{className:"text-gray-700 dark:text-white",children:"Dimensiones en cm."}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[l.jsx("div",{className:"space-y-2",children:l.jsx(Be,{label:"Altura",id:"height",name:"height",type:"number",step:"0.01",placeholder:"0.00",value:s.height??"",onChange:o,onBlur:c,error:i.height&&a.height})}),l.jsx("div",{className:"space-y-2",children:l.jsx(Be,{label:"Ancho",id:"width",name:"width",type:"number",step:"0.01",placeholder:"0.00",value:s.width??"",onChange:o,onBlur:c,error:i.width&&a.width})}),l.jsx("div",{className:"space-y-2",children:l.jsx(Be,{label:"Largo",id:"length",name:"length",type:"number",step:"0.01",placeholder:"0.00",value:s.length??"",onChange:o,onBlur:c,error:i.length&&a.length})})]})]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsx("div",{className:"space-y-2",children:l.jsx(Be,{label:"Peso (kg)",id:"weight",name:"weight",type:"number",step:"0.01",placeholder:"0.00",value:s.weight??"",onChange:o,onBlur:c,error:i.weight&&a.weight})}),l.jsx("div",{className:"space-y-2",children:l.jsx(Lf,{label:"Cantidad",id:"quantity",name:"quantity",min:"1",value:s.quantity,disabled:e===Pt.DOCUMENT,onChange:o,onBlur:c,error:i.quantity&&a.quantity})})]}),l.jsxs("div",{className:"flex flex-col gap-2",children:[E.totalWeightWarn&&l.jsx(Xd,{description:E.totalWeightWarn}),b.totalWeightError&&l.jsx(En,{description:b.totalWeightError}),b.minVolumeError&&l.jsx(En,{description:b.minVolumeError}),b.maxVolumeError&&l.jsx(En,{description:b.maxVolumeError}),b.densityError&&l.jsx(En,{description:b.densityError})]}),l.jsx(rt,{type:"submit",className:"w-full",onClick:()=>d(),children:"+ Agregar"})]})})},l_=({serviceId:e,categoryTypeId:t,totalWeight:r,validationConfig:n,onSubmit:s})=>{const i=u.useMemo(()=>{const{minWeight:o=0,minVolume:c,maxVolume:d,minDensity:f,maxDensity:h,maxDocumentWeight:p=1/0,maxTotalWeight:g=1/0}=n??{};let{maxWeight:m=1/0}=n??{};return(e===Pt.DOCUMENT||e===Pt.INTERNATIONAL_DOCUMENT)&&(m=p),ar({category:ir().nullable().required("La categoría es requerida"),weight:ht().typeError("Debe ser un número").required("El peso es requerido").test({name:"min-weight",exclusive:!1,test:x=>x==null||x>=o,message:`El peso mínimo es ${o.toFixed(2)}kg`}).test({name:"max-weight",exclusive:!1,test:x=>x==null||x<=m,message:`El peso máximo es ${m.toFixed(2)}kg`}),height:ht().typeError("Debe ser un número").integer("Debe ser un número entero").positive("Debe ser mayor a 0").required("La altura es requerida"),width:ht().typeError("Debe ser un número").integer("Debe ser un número entero").positive("Debe ser mayor a 0").required("El ancho es requerido"),length:ht().typeError("Debe ser un número").integer("Debe ser un número entero").positive("Debe ser mayor a 0").required("El largo es requerido"),quantity:ht().typeError("Debe ser un número").integer("Debe ser un número entero").min(1,"Debe ser al menos 1").required("La cantidad es requerida")}).test({name:"total-weight-check-global",test:function(x){const{weight:y,quantity:w}=x;if(y===null||r===void 0)return!0;const O=y*w,S=r+O;return g!==void 0&&S>g?this.createError({path:"totalWeightError",message:`El peso total (${S.toFixed(2)}kg) excede el máximo (${g.toFixed(2)}kg)`}):!0}}).test({name:"volume-check",test:function(x){const{height:y,width:w,length:O}=x;if(y===null||w===null||O===null)return!0;const S=y*w*O;return c!==void 0&&S<c?this.createError({path:"minVolumeError",message:`El volumen (${S.toFixed(2)}cm³) es menor al mínimo (${c.toFixed(2)}cm³)`}):d!==void 0&&S>d?this.createError({path:"maxVolumeError",message:`El volumen (${S.toFixed(2)}cm³) es mayor al máximo (${d.toFixed(2)}cm³)`}):!0}}).test({name:"density-check",test:function(x){const{height:y,width:w,length:O,weight:S}=x;if(y===null||w===null||O===null||S===null)return!0;const E=y*w*O;if(E===0)return!0;const v=S/E;return f!==void 0&&v<f||h!==void 0&&v>h?this.createError({path:"densityError",message:"Las medidas son inválidas, por favor revíselas y corríjalas"}):!0}})},[n,r,e]),a=u.useMemo(()=>{const{maxTotalWeightWarn:o=1/0}=n??{};return ar({category:ir().nullable().required(),weight:ht().required(),height:ht().required(),width:ht().required(),length:ht().required(),quantity:ht().required()}).test({name:"total-weight-check-global-warn",test:function(c){const{weight:d,quantity:f}=c;if(!d||!f||r===void 0)return!0;const h=d*f,p=r+h;return o!==void 0&&p>o?this.createError({path:"totalWeightWarn",message:`El peso total (${p.toFixed(2)}kg) excede el recomendado (${o.toFixed(2)}kg)`}):!0}})},[n,r]);return l.jsx(Zn,{initialValues:a_,validationSchema:i,onSubmit:s,children:o=>l.jsx(o_,{serviceId:e,categoryTypeId:t,formik:o,warningSchema:a})})},Rp=({parcel:e,index:t,checked:r,editable:n,editing:s,disabledActions:i,onChangeChecked:a,onPrintParcel:o,onDuplicate:c,onEdit:d})=>l.jsxs("tr",{className:A("hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors duration-100 font-normal text-xs h-12",s&&"border-2 border-indigo-600 dark:border-indigo-400",t%2===0?"bg-gray-100 dark:bg-gray-700":"bg-gray-200 dark:bg-gray-800"),children:[l.jsxs("td",{className:"text-muted-foreground px-3 sm:px-4 font-bold",children:[n&&l.jsx(mi,{label:"",id:`parcel-${e.pieceNumber}-checkbox`,checked:r,disabled:i,onChangeChecked:a}),!n&&e.pieceNumber]}),l.jsxs("td",{className:"sm:hidden px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3 truncate font-semibold",children:[l.jsxs("p",{children:[e.weight.toFixed(2)," kg"]}),l.jsxs("p",{children:[e.length,"x",e.width,"x",e.height," cm"]}),l.jsx("p",{className:"font-normal",children:e.contentDescription})]}),l.jsxs("td",{className:"hidden sm:table-cell px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3 truncate font-semibold",children:[e.weight.toFixed(2)," kg"]}),l.jsxs("td",{className:"hidden sm:table-cell px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3 truncate font-semibold",children:[e.length,"x",e.width,"x",e.height," cm"]}),l.jsx("td",{className:"hidden sm:table-cell text-muted-foreground px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3",children:e.contentDescription}),l.jsxs("td",{className:"text-right px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3",children:[n&&!i&&l.jsxs("div",{className:"flex gap-2 items-cetner justify-end",children:[l.jsx("button",{type:"button",className:"inline-flex items-center justify-center h-6 w-6 sm:h-8 sm:w-8 rounded hover:bg-indigo-100 dark:hover:bg-indigo-800 transition-colors text-indigo-600 dark:text-indigo-300 hover:text-indigo-900 dark:hover:text-white cursor-pointer",title:"Acciones",onClick:c,children:l.jsx(qE,{className:"h-4 w-4"})}),l.jsx("button",{type:"button",className:"inline-flex items-center justify-center h-6 w-6 sm:h-8 sm:w-8 rounded hover:bg-indigo-100 dark:hover:bg-indigo-800 transition-colors text-indigo-600 dark:text-indigo-300 hover:text-indigo-900 dark:hover:text-white cursor-pointer",title:"Acciones",onClick:d,children:l.jsx($h,{className:"h-4 w-4"})})]}),!n&&!i&&l.jsx("button",{type:"button",className:"inline-flex items-center justify-center h-8 w-8 rounded hover:bg-indigo-100 dark:hover:bg-indigo-800 transition-colors text-indigo-600 dark:text-indigo-300 hover:text-indigo-900 dark:hover:text-white cursor-pointer",title:"Imprimir",onClick:o,children:l.jsx(XE,{className:"h-4 w-4"})}),s&&l.jsx("span",{className:"italic",children:"Editando"})]})]}),Ip=({parcels:e,totalPhysicalWeight:t,totalDimensionalWeight:r,totalChargedWeight:n,totalVolume:s,dimensionalFactor:i,editingParcel:a,editable:o,onPrintParcel:c,onDelete:d,onDuplicate:f,onSelectEdit:h,onCancelEdit:p,onPrintShipment:g,wrapperClassName:m})=>{const[x,y]=u.useState([]),w=u.useMemo(()=>x.every(E=>E),[x]),O=(E,v)=>{y(b=>[...b.slice(0,v),E,...b.slice(v+1)])},S=()=>{y(w?Array.from({length:e.length},()=>!1):Array.from({length:e.length},()=>!0))};return u.useEffect(()=>{y(Array.from({length:e.length},()=>!1))},[e.length,a]),l.jsx("div",{className:A("w-full mx-auto",m),children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(en,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-xl font-bold",children:"Piezas"})]})}),l.jsxs("div",{className:"p-4",children:[l.jsxs(vi,{children:[l.jsx("thead",{className:"sticky top-0 z-10 bg-gray-50 dark:bg-gray-800",children:l.jsxs("tr",{className:"border-b-2",children:[l.jsxs("th",{className:"w-16 font-bold text-xs uppercase tracking-wider text-left px-3 sm:px-4 py-2",children:[o&&l.jsx(mi,{label:"",id:"parcel-table-all-checked-checkbox",checked:w,disabled:!!a,onChangeChecked:S}),!o&&"#"]}),l.jsx("th",{className:"sm:hidden text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(X0,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Pieza"})]})}),l.jsx("th",{className:"hidden sm:table-cell text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(rS,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Peso"})]})}),l.jsx("th",{className:"hidden sm:table-cell text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(QE,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Dimensiones"})]})}),l.jsx("th",{className:"hidden sm:table-cell text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Nd,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Categoría"})]})}),l.jsx("th",{className:"w-24 text-right text-xs uppercase font-semibold tracking-wider px-4 py-2",children:l.jsxs("div",{className:"flex items-center w-full justify-end gap-2",children:[l.jsx(KE,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{className:"hidden sm:inline-block",children:"Acciones"})]})})]})}),l.jsx("tbody",{children:e.map((E,v)=>l.jsx(Rp,{parcel:E,index:v,editing:a?.pieceNumber===E.pieceNumber,checked:x[v],disabledActions:!!a,onChangeChecked:b=>O(b,v),onPrintParcel:()=>c?.(E),onDuplicate:()=>f?.(E),onEdit:()=>h?.(E),editable:o},E.pieceNumber))})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-between text-xs mt-4",children:[l.jsxs("div",{className:"flex flex-col sm:block w-full sm:w-fit justify-center items-center",children:[!o&&g&&l.jsxs(rt,{className:"w-full md:w-36",onClick:g,children:[l.jsx(av,{className:"w-4 h-4 inline mr-2"}),"Imprimir Guía"]}),o&&!a&&l.jsxs(Tn,{className:"!w-full my-2 sm:my-0",disabled:x.every(E=>!E),onClick:()=>d?.(e.filter((E,v)=>x[v])),children:[l.jsx(U0,{className:"mr-2 w-4 h-4"}),"Eliminar"]}),!!a&&l.jsxs(Tn,{onClick:p,children:[l.jsx(Md,{className:"mr-2 w-5 h-5"}),"Cancelar Edición"]})]}),l.jsxs("div",{className:"space-y-1 text-gray-800 dark:text-gray-300",children:[l.jsxs("div",{className:"flex items-center justify-between gap-12",children:[l.jsx("span",{className:"text-muted-foreground font-semibold",children:"Peso por facturar"}),l.jsxs("span",{className:"font-bold text-indigo-600 dark:text-indigo-400 truncate",children:[n.toFixed(2)," kg"]})]}),l.jsx(Kr,{}),l.jsxs("div",{className:"flex items-center justify-between gap-12",children:[l.jsx("span",{className:"text-muted-foreground",children:"Peso físico"}),l.jsxs("span",{className:"text-indigo-600 dark:text-indigo-400 truncate",children:[t.toFixed(2)," kg"]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-12",children:[l.jsx("span",{className:"text-muted-foreground",children:"Peso volumétrico"}),l.jsxs("span",{className:"text-indigo-600 dark:text-indigo-400 truncate",children:[r.toFixed(2)," kg"]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-12",children:[l.jsx("span",{className:"text-muted-foreground",children:"Volumen"}),l.jsxs("span",{className:"text-indigo-600 dark:text-indigo-400 truncate",children:[s.toFixed(2)," cm",l.jsx("sup",{children:"3"})]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-12",children:[l.jsx("span",{className:"text-muted-foreground",children:"Factor volumétrico"}),l.jsx("span",{className:"text-indigo-600 dark:text-indigo-400 truncate",children:i.toFixed(2)})]})]})]})]})]})})},Qa=({isShipper:e=!1,account:t,store:r,deliveryType:n,isAccountBillTo:s,address:i})=>{const a=u.useMemo(()=>n===Ie.HOME&&e?"Recolecta":n===Ie.HOME&&!e?"A Domicilio":"En Tienda",[e,n]);return l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-600/10 dark:bg-indigo-900 p-2",children:l.jsx(tf,{className:"h-5 w-5 text-indigo-600 dark:text-indigo-300"})}),l.jsxs("div",{children:[l.jsx("h2",{className:"font-semibold text-div-foreground text-gray-900 dark:text-gray-200",children:e?"Remitente":"Destinatario"}),s&&l.jsx(Zr,{color:"primary",children:"Cuenta a facturar"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("div",{children:l.jsx("p",{className:"text-lg font-bold text-div-foreground text-gray-900 dark:text-gray-200",children:t.fullName})}),l.jsx(Kr,{className:"my-2"}),l.jsxs("div",{className:"space-y-1.5 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-gray-700 dark:text-gray-400",children:[l.jsx(HE,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsxs("span",{className:"font-mono",children:[t.taxIdentificationType,"-",t.identificationNumber]})]}),l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-gray-700 dark:text-gray-400",children:[l.jsx(Ym,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:t.email})]}),l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-gray-700 dark:text-gray-400",children:[l.jsx(JE,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:t.phone})]}),l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-gray-700 dark:text-gray-400",children:[l.jsx(jd,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:a})]}),l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-gray-700 dark:text-gray-400",children:[l.jsx(eS,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsxs("span",{children:[r.code," - ",r.commercialName]})]}),i&&n===Ie.HOME&&l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-gray-700 dark:text-gray-400",children:[l.jsx(ZE,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:i.addressLine1})]})]})]})]})},Fp=({shipment:e,wrapperClassName:t})=>{const r=u.useMemo(()=>{const n={lat:e.originAddress.latitude,lng:e.originAddress.longitude,name:`Origen (${e.pickupType.deliveryTypeID===Ie.OFFICE?"En Tienda":"Recolecta"})`},s={lat:e.destinationAddress.latitude,lng:e.destinationAddress.longitude,name:`Destino (${e.deliveryType.deliveryTypeID===Ie.OFFICE?"En Tienda":"A Domicilio"})`};return[n,s]},[e]);return l.jsx("div",{className:A("w-full mx-auto",t),children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg w-full h-full flex flex-col",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(qd,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-xl font-bold",children:"Ruta"})]})}),l.jsxs("div",{className:"flex flex-col p-4 w-full h-full flex-1 gap-2",children:[l.jsx("div",{className:"w-full h-full",children:l.jsx(Kd,{coordinates:r})}),l.jsxs("p",{className:"text-xs text-gray-800 dark:text-gray-300",children:["Ubicación actual:"," ",l.jsxs("span",{className:"font-semibold",children:[e.lastKnowStoreLocation.code," -"," ",e.lastKnowStoreLocation.commercialName]})]}),l.jsx("div",{className:"flex items-center justify-center w-full text-center",children:l.jsx(Ae,{children:"Agregar recargo por entrega a domicilio"})})]})]})})},$p=[{id:Ie.OFFICE.toString(),label:"Tienda",value:{deliveryTypeID:Ie.OFFICE,deliveryTypeName:"Tienda"}},{id:Ie.HOME.toString(),label:"A Domicilio",value:{deliveryTypeID:Ie.HOME,deliveryTypeName:"A Domicilio"}}],c_=[...$p,{id:Ie.INTERNATIONAL.toString(),label:"Internacional",value:{deliveryTypeID:Ie.INTERNATIONAL,deliveryTypeName:"Internacional"}}],Up=({formik:e})=>{const{values:t,touched:r,errors:n,handleBlur:s,setFieldValue:i}=e,{store:a}=u.useContext(go),o=d=>{i("pickupType",d),d.value.deliveryTypeID===Ie.OFFICE?(i("originStore",a),i("originAddress",a?.address??null)):(i("originStore",null),i("originAddress",null))},c=d=>{i("deliveryType",d),i("destinationStore",null),i("destinationAddress",null)};return l.jsx("div",{className:"w-full mx-auto",children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(s_,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-lg font-bold",children:"Direcciones"})]})}),l.jsxs("div",{className:"flex flex-col w-full gap-4 p-4",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-8 pr-2 justify-between text-sm font-medium leading-6 text-gray-700 truncate dark:text-gray-200",children:[l.jsxs("p",{children:["Origen ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("div",{className:"mb-1",children:l.jsx(ei,{id:"pickupType",name:"pickupType",label:"",options:$p,selected:t.pickupType,onSelectOption:o,onBlur:s,wrapperClassName:"flex-row"})})]}),l.jsx("div",{className:"w-full",children:t.pickupType?.value.deliveryTypeID===Ie.OFFICE&&l.jsx(ct,{disabled:!0,label:"",id:"originStore",name:"originStore",placeholder:"Seleccione una tienda",options:[],selected:t.originStore,searchText:t.originStore?.value.commercialName,error:r.originStore&&n.originStore,onSelectOption:()=>{},onBlur:s})})]}),l.jsx("div",{className:"flex-1",children:l.jsxs("div",{className:"flex items-center gap-8 pr-2 justify-between text-sm font-medium leading-6 text-gray-700 truncate dark:text-gray-200",children:[l.jsxs("p",{children:["Destino ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("div",{className:"mb-1",children:l.jsx(ei,{id:"deliveryType",name:"deliveryType",label:"",options:c_,selected:t.deliveryType,onSelectOption:c,onBlur:s,wrapperClassName:"flex-row"})})]})})]})]})})},Vp=({user:e,date:t,observation:r,wrapperClassName:n})=>l.jsxs("div",{className:A("flex flex-col gap-6 rounded-lg border p-6 border-gray-300 dark:border-gray-700 text-gray-800 dark:text-gray-300 bg-gray-50 dark:bg-gray-800 max-w-full",n),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-600/60 dark:bg-indigo-300/20 p-2 backdrop-blur-sm text-gray-100",children:l.jsx(Hm,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-lg font-bold",children:"Entrega"})]}),l.jsxs("div",{className:"space-y-0.5",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-foreground",children:"Usuario: "}),l.jsx("span",{className:"text-sm text-muted-foreground",children:e})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-foreground",children:"Fecha: "}),l.jsx("span",{className:"text-sm text-muted-foreground",children:R(t).format("DD/MM/YYYY, hh:mm A")})]}),l.jsxs("div",{children:[l.jsxs("span",{className:"text-sm font-medium text-foreground",children:["Observaciones:"," "]}),l.jsx("span",{className:"text-sm text-muted-foreground",children:r||"—"})]})]})]}),u_=e=>{switch(e){case gr.ACTIVE:return"primary";case gr.ANNULLED:return"danger";case gr.DELIVERED:return"success";case gr.DRAFT:return"warning";case gr.REPLACED:default:return"default"}},zp=({shipment:e,onSubstituteForClick:t,onSubstitutedByClick:r})=>l.jsx("div",{className:"bg-gradient-subtle",children:l.jsxs("div",{className:"mx-auto max-w-6xl",children:[l.jsx("div",{className:"mb-6 overflow-hidden border-none shadow-lg",children:l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 p-6 dark:from-indigo-800 dark:to-indigo-600",children:l.jsxs("div",{className:"flex relative items-start justify-between",children:[l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-3 backdrop-blur-sm hidden md:block",children:l.jsx(en,{className:"h-8 w-8"})}),l.jsxs("div",{children:[l.jsx("p",{className:"mb-1 text-sm font-medium opacity-90",children:"Número de Guía"}),l.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:e.shipmentNumber}),l.jsxs("p",{className:"mt-2 text-sm opacity-90",children:["Creación:"," ",R(e.shipmentHeaderDate).format("DD/MM/YYYY, hh:mm A")]}),l.jsxs("p",{className:A("text-sm",!e.substituteFor&&"hidden"),children:["Sustituto de:"," ",l.jsx(Ae,{className:"text-white hover:text-white/80 underline dark:no-underline font-semibold",onClick:t,children:e.substituteFor})]}),l.jsxs("p",{className:A("text-sm",!e.substitutedBy&&"hidden"),children:["Sustituido por:"," ",l.jsx(Ae,{className:"text-white hover:text-white/80 underline dark:no-underline font-semibold",onClick:r,children:e.substitutedBy})]})]})]}),l.jsx(Zr,{color:u_(e.status.id),className:"!text-base absolute top-0 right-0",children:e.status.name})]})})}),l.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[l.jsx("div",{className:"lg:col-span-2",children:l.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[l.jsx("div",{className:"border-none shadow-md transition-all hover:shadow-xl p-6 bg-gray-100 dark:bg-gray-800 rounded-lg",children:l.jsx(Qa,{isShipper:!0,account:e.shipper,store:e.originStore,deliveryType:e.pickupType.deliveryTypeID,isAccountBillTo:e.billTo.id===e.shipper.id,address:e.originAddress})}),l.jsx("div",{className:"border-none shadow-md transition-all hover:shadow-xl p-6 bg-gray-100 dark:bg-gray-800 rounded-lg",children:l.jsx(Qa,{account:e.consignee,store:e.destinationStore,deliveryType:e.deliveryType.deliveryTypeID,isAccountBillTo:e.billTo.id===e.consignee.id,address:e.destinationAddress})})]})}),l.jsx("div",{className:"lg:col-span-1",children:l.jsxs("div",{className:"sticky top-8 border-none shadow-lg bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-400 rounded-b-lg",children:[l.jsx("div",{className:"bg-indigo-600 text-gray-100 dark:bg-indigo-700 p-4",children:l.jsxs("h2",{className:"flex items-center gap-2 text-lg font-semibold",children:[l.jsx(en,{className:"h-5 w-5"}),"Resumen"]})}),l.jsxs("div",{className:"p-6",children:[l.jsxs("div",{className:"gap-2 mb-2",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Servicio"}),l.jsx("p",{className:"font-semibold text-div-foreground text-gray-900 dark:text-gray-200",children:e.service.serviceShortName})]}),l.jsxs("div",{className:"gap-2 mb-2",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Modalidad de Pago"}),l.jsx("p",{className:"font-semibold text-div-foreground text-gray-900 dark:text-gray-200",children:e.paymentMode.paymentModeName})]}),e.paymentMode.paymentModeID===Qo.CREDIT&&l.jsxs("div",{className:"gap-2",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Crédito de"}),l.jsx("p",{className:"font-semibold text-div-foreground text-gray-900 dark:text-gray-200",children:e.billTo.fullName})]}),l.jsx(Kr,{className:"my-4"}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Con impuestos"}),l.jsxs("span",{className:"text-lg font-bold text-indigo-600 dark:text-indigo-400",children:["$",e.totalAmount.toFixed(2)]})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Nº de piezas"}),l.jsx("span",{className:"font-semibold text-div-foreground text-gray-900 dark:text-gray-200",children:e.totalPieces})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Peso por facturar"}),l.jsxs("span",{className:"font-semibold text-div-foreground text-gray-900 dark:text-gray-200",children:[e.totalChargedWeight.toFixed(2)," Kg"]})]})]})]})]})})]})]})}),Bp=({item:e,index:t})=>l.jsxs("tr",{className:A("hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors duration-100 font-normal text-xs h-12",t%2===0?"bg-gray-100 dark:bg-gray-700":"bg-gray-200 dark:bg-gray-800"),children:[l.jsxs("td",{className:"text-muted-foreground px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3 font-semibold",children:[l.jsx("p",{children:e.itemDescription}),l.jsx("p",{className:"sm:hidden font-normal",children:e.itemDetails})]}),l.jsx("td",{className:"hidden sm:table-cell text-muted-foreground px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3",children:e.itemDetails}),l.jsxs("td",{className:"px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3 truncate font-semibold text-right text-sm",children:[e.subTotalAmount<0&&"-","$",Math.abs(e.subTotalAmount).toFixed(2)]})]}),Wp=({items:e,subTotalAmount:t,vatAmount:r,postalTaxAmount:n,totalAmount:s,wrapperClassName:i})=>l.jsx("div",{className:A("w-full mx-auto",i),children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(nv,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-xl font-bold",children:"Items"})]})}),l.jsxs("div",{className:"p-4",children:[l.jsxs(vi,{children:[l.jsx("thead",{className:"sticky top-0 z-10 bg-gray-50 dark:bg-gray-800",children:l.jsxs("tr",{className:"border-b-2",children:[l.jsx("th",{className:"text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Nd,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Servicio"})]})}),l.jsx("th",{className:"hidden sm:table-cell text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(rv,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Detalles"})]})}),l.jsx("th",{className:"w-24 text-right text-xs uppercase font-semibold tracking-wider px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(GE,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Costo"})]})})]})}),l.jsx("tbody",{children:e.map((a,o)=>l.jsx(Bp,{item:a,index:o},a.itemID))})]}),l.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-end text-sm mt-4",children:l.jsxs("div",{className:"space-y-1 text-gray-800 dark:text-gray-300",children:[l.jsxs("div",{className:"flex items-center justify-between gap-16",children:[l.jsx("span",{className:"text-muted-foreground font-semibold uppercase",children:"Subtotal"}),l.jsxs("span",{className:"font-bold text-indigo-600 dark:text-indigo-400 truncate",children:["$",t.toFixed(2)]})]}),l.jsx(Kr,{}),l.jsxs("div",{className:"flex items-center justify-between gap-16",children:[l.jsx("span",{className:"text-muted-foreground",children:"IVA (16%)"}),l.jsxs("span",{className:"text-indigo-600 dark:text-indigo-400 truncate",children:["$",r.toFixed(2)]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-16",children:[l.jsx("span",{className:"text-muted-foreground",children:"Franqueo Postal"}),l.jsxs("span",{className:"text-indigo-600 dark:text-indigo-400 truncate",children:["$",n.toFixed(2)]})]}),l.jsx(Kr,{}),l.jsxs("div",{className:"flex items-center justify-between gap-16",children:[l.jsx("span",{className:"font-bold text-muted-foreground uppercase",children:"Total"}),l.jsxs("span",{className:"font-bold text-indigo-600 dark:text-indigo-400 truncate",children:["$",s.toFixed(2)]})]})]})})]})]})}),Yp=({tracking:e,index:t})=>l.jsxs("tr",{className:A("hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors duration-100 font-normal text-xs h-12",t%2===0?"bg-gray-100 dark:bg-gray-700":"bg-gray-200 dark:bg-gray-800"),children:[l.jsx("td",{className:"text-muted-foreground px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3 font-semibold",children:R(e.date).format("DD/MM/YYYY, hh:mm A")}),l.jsxs("td",{className:"text-muted-foreground px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3",children:[l.jsx("p",{className:"font-semibold text-indigo-600 dark:text-indigo-400",children:e.description}),l.jsx("p",{className:"font-normal",children:e.details})]})]}),Hp=({trackings:e,onPublicAppClick:t,wrapperClassName:r})=>l.jsx("div",{className:A("w-full mx-auto",r),children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(jd,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-xl font-bold",children:"Tracking"})]})}),l.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[l.jsx("p",{className:A(!t&&"hidden"),children:l.jsx(Ae,{onClick:t,children:"Ver guía en Tealca Consultas"})}),l.jsxs(vi,{children:[l.jsx("thead",{className:"sticky top-0 z-10 bg-gray-50 dark:bg-gray-800",children:l.jsxs("tr",{className:"border-b-2",children:[l.jsx("th",{className:"text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ef,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Fecha"})]})}),l.jsx("th",{className:"text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(i_,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Evento"})]})})]})}),l.jsx("tbody",{children:e.map((n,s)=>l.jsx(Yp,{tracking:n,index:s},n.trackingID))})]})]})]})}),Gp=({showPOD:e,showInvoice:t,isPhysicalLiability:r,isPhysicalPOD:n,invoiceNumber:s,onShowLiabilityWaiver:i,onDownloadLiabilityWaiver:a,onShowPOD:o,onDownloadPOD:c,onShowInvoiceAttachments:d,wrapperClassName:f})=>l.jsxs("div",{className:A("flex flex-col gap-6 rounded-lg border p-6 border-gray-300 dark:border-gray-700 text-gray-800 dark:text-gray-300 bg-gray-50 dark:bg-gray-800 max-w-full",f),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-600/60 dark:bg-indigo-300/20 p-2 backdrop-blur-sm text-gray-100",children:l.jsx(Y0,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-lg font-bold",children:"Documentos Digitales"})]}),l.jsxs("div",{className:"space-y-0.5",children:[l.jsxs("div",{children:[l.jsxs("span",{className:"text-sm font-medium text-foreground",children:["Declaración Jurada:"," "]}),l.jsx("span",{className:A("ml-3 text-sm text-muted-foreground",!r&&"hidden"),children:"Llenada en el documento físico"}),l.jsx("p",{className:"ml-4",children:l.jsx(Ae,{onClick:i,className:A("text-sm text-muted-foreground",r&&"hidden"),children:"Ver Declaración Jurada"})}),l.jsx("p",{className:"ml-4",children:l.jsx(Ae,{onClick:a,className:A("text-sm text-muted-foreground",r&&"hidden"),children:"Descargar Declaración Jurada"})})]}),l.jsxs("div",{className:A(!e&&"hidden"),children:[l.jsx("span",{className:"text-sm font-medium text-foreground",children:"POD: "}),l.jsx("span",{className:A("ml-3 text-sm text-muted-foreground",!n&&"hidden"),children:"Llenada en el documento físico"}),l.jsx("p",{className:"ml-4",children:l.jsx(Ae,{onClick:o,className:A("text-sm text-muted-foreground",n&&"hidden"),children:"Ver POD"})}),l.jsx("p",{className:"ml-4",children:l.jsx(Ae,{onClick:c,className:A("text-sm text-muted-foreground",n&&"hidden"),children:"Descargar POD"})})]}),l.jsxs("div",{className:A(!t&&"hidden"),children:[l.jsxs("span",{className:"text-sm font-medium text-foreground",children:["Factura de la mercancia:"," "]}),l.jsx("p",{className:"ml-4 text-sm text-muted-foreground",children:l.jsx("span",{children:s})}),l.jsx("p",{className:"ml-4 text-sm text-muted-foreground",children:l.jsx(Ae,{onClick:d,children:"Ver Adjuntos"})})]})]})]}),d_=({shipment:e,trackings:t,showLiabilityWaiver:r,showPOD:n,showInvoice:s,isPhysicalLiability:i,isPhysicalPOD:a,invoiceNumber:o,onSubstituteForClick:c,onSubstitutedByClick:d,onInvoiceClick:f,onPublicAppClick:h,onShowLiabilityWaiver:p,onDownloadLiabilityWaiver:g,onShowPOD:m,onDownloadPOD:x,onShowInvoiceAttachments:y,onPrintParcel:w,onPrintShipment:O,onEdit:S,onCancel:E,onDeliver:v})=>{const[b,k]=u.useState(!1);return l.jsxs("div",{className:"flex flex-col gap-8",children:[l.jsx(zp,{shipment:e,onSubstituteForClick:c,onSubstitutedByClick:d}),l.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800 shadow-sm overflow-hidden",children:[l.jsxs("div",{className:"w-full flex items-center justify-between p-5 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700 text-xl font-bold text-gray-800 dark:text-gray-200",onClick:()=>k(!b),children:[l.jsx("span",{children:"Detalles"}),l.jsx(uo,{className:A("ml-2 transition-transform duration-1000 text-gray-500 dark:text-gray-300",b?"rotate-180":"rotate-0"),"aria-label":b?"Colapsar":"Expandir"})]}),l.jsx(_d,{active:b,duration:1e3,children:l.jsxs("div",{className:"flex flex-col p-2 md:p-4 lg:p-6 gap-14 pb-16",children:[e.invoices.length>0&&l.jsx(Ap,{invoices:e.invoices,onInvoiceClick:f}),e.parcels.length>0&&l.jsx(Ip,{parcels:e.parcels,totalPhysicalWeight:e.totalPhysicalWeight,totalDimensionalWeight:e.totalDimensionalWeight,totalChargedWeight:e.totalChargedWeight,totalVolume:e.totalVolume,dimensionalFactor:e.dimensionalFactor,onPrintParcel:w,onPrintShipment:O}),e.items.length>0&&l.jsx(Wp,{items:e.items,subTotalAmount:e.subTotalAmount,vatAmount:e.vatAmount,postalTaxAmount:e.postalTaxAmount,totalAmount:e.totalAmount}),t.length>0&&l.jsx(Hp,{trackings:t,onPublicAppClick:h}),l.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.deliveryDate&&e.deliveryUser&&l.jsx(Vp,{user:e.deliveryUser,date:e.deliveryDate,observation:e.deliveryObservation}),r&&l.jsx(Gp,{showPOD:n,showInvoice:s,isPhysicalLiability:i,isPhysicalPOD:a,invoiceNumber:o,onShowLiabilityWaiver:p,onDownloadLiabilityWaiver:g,onShowPOD:m,onDownloadPOD:x,onShowInvoiceAttachments:y})]}),l.jsx(Fp,{shipment:e,wrapperClassName:"h-[30rem]"})]})})]}),l.jsx("div",{className:"mt-2 md:mt-6 w-full flex flex-col gap-4 md:gap-0",children:l.jsxs("div",{className:"w-full flex flex-col-reverse md:flex-row justify-between items-center gap-4",children:[l.jsx("div",{className:"flex flex-col-reverse md:flex-row gap-4 items-center w-full",children:E&&l.jsxs(Ae,{onClick:E,children:[l.jsx(Md,{className:"w-5 h-5 inline mr-1 mb-0.5"}),"Anular"]})}),l.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-center w-full md:w-fit",children:[S&&l.jsxs(rt,{className:"w-full md:w-36",onClick:S,children:[l.jsx($h,{className:"w-4 h-4 inline mr-2"}),"Editar"]}),v&&l.jsxs(rt,{className:"w-full md:w-36",onClick:v,children:[l.jsx(dv,{className:"w-4 h-4 inline mr-2"}),"Entregar"]})]})]})})]})},id={id:"",label:"Crear nuevo",value:null},f_=[{id:rr.PERSON.toString(),label:"Persona",value:rr.PERSON},{id:rr.BOX_ACCOUNT.toString(),label:"Casillero",value:rr.BOX_ACCOUNT}],qp=({formik:e})=>{const{values:t,touched:r,errors:n,handleBlur:s,setFieldValue:i}=e,[a,o]=u.useState(!1),[c,d]=u.useState(!1),[f,h]=u.useState(""),[p,g]=u.useState(""),m=w=>{if(w.value===null){o(!0);return}i("shipper",w),i("consigneeType",{id:rr.PERSON.toString(),label:"Persona",value:rr.PERSON}),i("consignee",null)},x=w=>{i("consigneeType",w),i("consignee",null)},y=w=>{if(w.value===null){d(!0);return}i("consignee",w)};return l.jsx("div",{className:"w-full mx-auto",children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(tS,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-lg font-bold",children:"Partes Involucradas"})]})}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 w-full gap-4 p-4 md:h-28",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx(ct,{required:!0,label:"Remitente",id:"shipper",name:"shipper",placeholder:"Seleccione un remitente",options:[],selected:t.shipper,searchText:f,error:r.shipper&&n.shipper,onSelectOption:m,onBlur:s,setSearchText:h,footerOption:id}),l.jsxs(Xs,{open:a,onClose:()=>o(!1),children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-white mb-4",children:"Crear nuevo cliente"}),l.jsx(Ra,{onSubmit:()=>{},onCancel:w=>{o(!1),w.resetForm()}})]})]}),l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-8 pr-2 justify-between text-sm font-medium leading-6 text-gray-700 truncate dark:text-gray-200",children:[l.jsxs("p",{children:["Destinatario ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("div",{className:"mb-1",children:l.jsx(ei,{id:"consigneeType",name:"consigneeType",label:"",options:f_,selected:t.consigneeType,disabled:!t.shipper,onSelectOption:x,onBlur:s,wrapperClassName:"flex-row"})})]}),l.jsx("div",{className:"w-full",children:l.jsx(ct,{label:"",id:"consignee",name:"consignee",placeholder:"Seleccione un destinatario",options:[],selected:t.consignee,disabled:!t.shipper,searchText:p,error:r.consignee&&n.consignee,onSelectOption:y,onBlur:s,setSearchText:g,footerOption:id})}),l.jsxs(Xs,{open:c,onClose:()=>d(!1),children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-white mb-4",children:"Crear nuevo cliente"}),l.jsx(Ra,{onSubmit:()=>{},onCancel:w=>{d(!1),w.resetForm()}})]})]})]})]})})},h_=({formik:e})=>l.jsxs("div",{className:"flex flex-col gap-6",children:[l.jsx(qp,{formik:e}),l.jsx(Up,{formik:e})]}),p_=({index:e,shipment:t})=>l.jsxs("div",{className:"flex flex-col gap-8 w-full",children:[l.jsx("div",{className:"overflow-hidden border-none shadow-lg",children:l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 p-6 dark:from-indigo-800 dark:to-indigo-600",children:l.jsx("div",{className:"flex relative items-start justify-between",children:l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-3 backdrop-blur-sm hidden md:block",children:l.jsx(en,{className:"h-8 w-8"})}),t&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("p",{className:"mb-1 text-sm font-medium opacity-90",children:"Número de Guía"}),l.jsxs("h1",{className:"text-3xl font-bold tracking-tight",children:[t.shipmentNumber," ",l.jsx("span",{className:"font-normal italic",children:"(Edición)"})]}),l.jsxs("p",{className:"mt-2 text-sm opacity-90",children:["Creación:"," ",R(t.shipmentHeaderDate).format("DD/MM/YYYY, hh:mm A")]})]}),l.jsx(Zr,{color:"default",className:"!text-base absolute top-0 right-0",children:t.status.name})]}),!t&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("p",{className:"mb-1 text-sm font-medium opacity-90",children:"Guía Número"}),l.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:e.toString().padStart(3,"0")})]}),l.jsx(Zr,{color:"primary",className:"!text-base absolute top-0 right-0",children:"Nueva Guía"})]})]})})})}),l.jsx(Zn,{initialValues:Dp,onSubmit:()=>{},children:r=>l.jsx(h_,{formik:r})})]}),m_=(e,t=!1)=>{const r=t?"-":"_";return e.replace(/[A-Z]/g,n=>`${r}${n.toLowerCase()}`)},tn=(e,t=!1)=>Array.isArray(e)?e.map(r=>tn(r)):e!==null&&e.constructor===Object?Object.keys(e).reduce((r,n)=>(r[m_(n,t)]=tn(e[n]),r),{}):e;function g_(e){return e.replace(/([-_][a-z])/gi,t=>t.toUpperCase().replace("-","").replace("_",""))}function pi(e){if(Array.isArray(e))return e.map(pi);if(e!==null&&typeof e=="object"){const t={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const n=g_(r);t[n]=pi(e[r])}return t}return e}const Zp=(e,t)=>{const r=Fh();return u.useMemo(()=>{const s=Ne.create({baseURL:e});return s.interceptors.request.use(i=>{const a=r.getState().auth.accessToken;return a&&i.headers&&(i.headers.Authorization=`Bearer ${a}`),i.data&&(i.data=tn(i.data)),i.params&&(i.params=tn(i.params,!0)),i},i=>Promise.reject(i)),s.interceptors.response.use(i=>(i.data&&(i.data=pi(i.data)),i),async i=>{const a=i.config;if(i.response?.status===401&&!a._retry){a._retry=!0;const o=r.getState().auth.refreshToken;if(o)try{const c=await lh(t,o);if(c.data){const{accessToken:d}=c.data,f=r.getState().auth;if(f.user)return r.dispatch(Dh({user:f.user,...c.data})),a.headers.Authorization=`Bearer ${d}`,Ne(a)}}catch(c){return Promise.reject(c)}}return Promise.reject(i)}),s},[e,t,r])},Kp=e=>u.useMemo(()=>{const r=Ne.create({baseURL:e,headers:{"Content-Type":"application/json"}});return r.interceptors.request.use(n=>(n.data&&(n.data=tn(n.data)),n.params&&(n.params=tn(n.params,!0)),n),n=>Promise.reject(n)),r.interceptors.response.use(n=>(n.data&&(n.data=pi(n.data)),n),n=>Promise.reject(n)),r},[e]),v_=({children:e,applicationId:t})=>{const r=Kp("http://localhost:8000/api"),n=Zp("http://localhost:8000/api",r),[s,i]=u.useState(null);return u.useEffect(()=>{(async()=>{const o=await sh(r,t);if(o.error||!o.data){console.error(o.message);return}i(o.data)})()},[t,r]),l.jsx(on.Provider,{value:{application:s,googleMapsApiKey:"AIzaSyD0g8yZAA0ZaqaLsrRkGmDQdFbhCEAPdYs",clientId:"docuNxInnND1MUSqVr3ROV8ms986ZRjnbyA77ypt",clientSecret:"0SAgl6C4IsMObrysxXHG6npwGyH8jgIkiMtLoGD6Pchu1tBGPZvIZjmjYmAo3pItBoIqOHipjkQNcI03URn1i7LgtaAsDOHFSdv3suDFz9J3kS8WHMnq0tE1Lg1advs7",api:n,basicApi:r},children:e})};var el="persist:",tl="persist/FLUSH",Hi="persist/REHYDRATE",rl="persist/PAUSE",nl="persist/PERSIST",sl="persist/PURGE",il="persist/REGISTER",y_=-1;function Nn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Nn=function(r){return typeof r}:Nn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Nn(e)}function ad(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function x_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ad(r,!0).forEach(function(n){b_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ad(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function b_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w_(e,t,r,n){var s=n.debug,i=x_({},r);return e&&Nn(e)==="object"&&Object.keys(e).forEach(function(a){if(a!=="_persist"){if(t[a]!==r[a]){process.env.NODE_ENV!=="production"&&s&&console.log("redux-persist/stateReconciler: sub state for key `%s` modified, skipping.",a);return}i[a]=e[a]}}),process.env.NODE_ENV!=="production"&&s&&e&&Nn(e)==="object"&&console.log("redux-persist/stateReconciler: rehydrated keys '".concat(Object.keys(e).join(", "),"'")),i}function E_(e){var t=e.blacklist||null,r=e.whitelist||null,n=e.transforms||[],s=e.throttle||0,i="".concat(e.keyPrefix!==void 0?e.keyPrefix:el).concat(e.key),a=e.storage,o;e.serialize===!1?o=function(v){return v}:typeof e.serialize=="function"?o=e.serialize:o=S_;var c=e.writeFailHandler||null,d={},f={},h=[],p=null,g=null,m=function(v){Object.keys(v).forEach(function(b){w(b)&&d[b]!==v[b]&&h.indexOf(b)===-1&&h.push(b)}),Object.keys(d).forEach(function(b){v[b]===void 0&&w(b)&&h.indexOf(b)===-1&&d[b]!==void 0&&h.push(b)}),p===null&&(p=setInterval(x,s)),d=v};function x(){if(h.length===0){p&&clearInterval(p),p=null;return}var E=h.shift(),v=n.reduce(function(b,k){return k.in(b,E,d)},d[E]);if(v!==void 0)try{f[E]=o(v)}catch(b){console.error("redux-persist/createPersistoid: error serializing state",b)}else delete f[E];h.length===0&&y()}function y(){Object.keys(f).forEach(function(E){d[E]===void 0&&delete f[E]}),g=a.setItem(i,o(f)).catch(O)}function w(E){return!(r&&r.indexOf(E)===-1&&E!=="_persist"||t&&t.indexOf(E)!==-1)}function O(E){c&&c(E),E&&process.env.NODE_ENV!=="production"&&console.error("Error storing data",E)}var S=function(){for(;h.length!==0;)x();return g||Promise.resolve()};return{update:m,flush:S}}function S_(e){return JSON.stringify(e)}function k_(e){var t=e.transforms||[],r="".concat(e.keyPrefix!==void 0?e.keyPrefix:el).concat(e.key),n=e.storage,s=e.debug,i;return e.deserialize===!1?i=function(o){return o}:typeof e.deserialize=="function"?i=e.deserialize:i=O_,n.getItem(r).then(function(a){if(a)try{var o={},c=i(a);return Object.keys(c).forEach(function(d){o[d]=t.reduceRight(function(f,h){return h.out(f,d,c)},i(c[d]))}),o}catch(d){throw process.env.NODE_ENV!=="production"&&s&&console.log("redux-persist/getStoredState: Error restoring data ".concat(a),d),d}else return})}function O_(e){return JSON.parse(e)}function __(e){var t=e.storage,r="".concat(e.keyPrefix!==void 0?e.keyPrefix:el).concat(e.key);return t.removeItem(r,C_)}function C_(e){e&&process.env.NODE_ENV!=="production"&&console.error("redux-persist/purgeStoredState: Error purging data stored state",e)}function od(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function jt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?od(r,!0).forEach(function(n){L_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):od(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function L_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N_(e,t){if(e==null)return{};var r=j_(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function j_(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,i;for(i=0;i<n.length;i++)s=n[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}var M_=5e3;function T_(e,t){if(process.env.NODE_ENV!=="production"){if(!e)throw new Error("config is required for persistReducer");if(!e.key)throw new Error("key is required in persistor config");if(!e.storage)throw new Error("redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`")}var r=e.version!==void 0?e.version:y_;e.debug;var n=e.stateReconciler===void 0?w_:e.stateReconciler,s=e.getStoredState||k_,i=e.timeout!==void 0?e.timeout:M_,a=null,o=!1,c=!0,d=function(h){return h._persist.rehydrated&&a&&!c&&a.update(h),h};return function(f,h){var p=f||{},g=p._persist,m=N_(p,["_persist"]),x=m;if(h.type===nl){var y=!1,w=function(C,_){process.env.NODE_ENV!=="production"&&y&&console.error('redux-persist: rehydrate for "'.concat(e.key,'" called after timeout.'),C,_),y||(h.rehydrate(e.key,C,_),y=!0)};if(i&&setTimeout(function(){!y&&w(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},i),c=!1,a||(a=E_(e)),g)return jt({},t(x,h),{_persist:g});if(typeof h.rehydrate!="function"||typeof h.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return h.register(e.key),s(e).then(function(k){var C=e.migrate||function(_,M){return Promise.resolve(_)};C(k,r).then(function(_){w(_)},function(_){process.env.NODE_ENV!=="production"&&_&&console.error("redux-persist: migration error",_),w(void 0,_)})},function(k){w(void 0,k)}),jt({},t(x,h),{_persist:{version:r,rehydrated:!1}})}else{if(h.type===sl)return o=!0,h.result(__(e)),jt({},t(x,h),{_persist:g});if(h.type===tl)return h.result(a&&a.flush()),jt({},t(x,h),{_persist:g});if(h.type===rl)c=!0;else if(h.type===Hi){if(o)return jt({},x,{_persist:jt({},g,{rehydrated:!0})});if(h.key===e.key){var O=t(x,h),S=h.payload,E=n!==!1&&S!==void 0?n(S,f,O,e):O,v=jt({},E,{_persist:jt({},g,{rehydrated:!0})});return d(v)}}}if(!g)return t(f,h);var b=t(x,h);return b===x?f:d(jt({},b,{_persist:g}))}}function ld(e){return A_(e)||P_(e)||D_()}function D_(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function P_(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function A_(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function cd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function eo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cd(r,!0).forEach(function(n){R_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cd(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function R_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Jp={registry:[],bootstrapped:!1},I_=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Jp,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case il:return eo({},t,{registry:[].concat(ld(t.registry),[r.key])});case Hi:var n=t.registry.indexOf(r.key),s=ld(t.registry);return s.splice(n,1),eo({},t,{registry:s,bootstrapped:s.length===0});default:return t}};function F_(e,t,r){if(process.env.NODE_ENV!=="production"){var n={},s=["blacklist","whitelist","transforms","storage","keyPrefix","migrate"];s.forEach(function(d){n[d]&&console.error('redux-persist: invalid option passed to persistStore: "'.concat(d,'". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.'))})}var i=_o(I_,Jp,void 0),a=function(f){i.dispatch({type:il,key:f})},o=function(f,h,p){var g={type:Hi,payload:h,err:p,key:f};e.dispatch(g),i.dispatch(g)},c=eo({},i,{purge:function(){var f=[];return e.dispatch({type:sl,result:function(p){f.push(p)}}),Promise.all(f)},flush:function(){var f=[];return e.dispatch({type:tl,result:function(p){f.push(p)}}),Promise.all(f)},pause:function(){e.dispatch({type:rl})},persist:function(){e.dispatch({type:nl,register:a,rehydrate:o})}});return c.persist(),c}var Cs={},Ls={},ud;function $_(){if(ud)return Ls;ud=1,Ls.__esModule=!0,Ls.default=s;function e(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=function(o){return typeof o}:e=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},e(i)}function t(){}var r={getItem:t,setItem:t,removeItem:t};function n(i){if((typeof self>"u"?"undefined":e(self))!=="object"||!(i in self))return!1;try{var a=self[i],o="redux-persist ".concat(i," test");a.setItem(o,"test"),a.getItem(o),a.removeItem(o)}catch{return process.env.NODE_ENV!=="production"&&console.warn("redux-persist ".concat(i," test failed, persistence will be disabled.")),!1}return!0}function s(i){var a="".concat(i,"Storage");return n(a)?self[a]:(process.env.NODE_ENV!=="production"&&console.error("redux-persist failed to create sync storage. falling back to noop storage."),r)}return Ls}var dd;function U_(){if(dd)return Cs;dd=1,Cs.__esModule=!0,Cs.default=r;var e=t($_());function t(n){return n&&n.__esModule?n:{default:n}}function r(n){var s=(0,e.default)(n);return{getItem:function(a){return new Promise(function(o,c){o(s.getItem(a))})},setItem:function(a,o){return new Promise(function(c,d){c(s.setItem(a,o))})},removeItem:function(a){return new Promise(function(o,c){o(s.removeItem(a))})}}}return Cs}var V_=U_();const z_=to(V_),B_=()=>({getItem(e){return Promise.resolve(null)},setItem(e,t){return Promise.resolve(t)},removeItem(e){return Promise.resolve()}}),W_=typeof window<"u"?z_("local"):B_(),Y_={key:"persist",storage:W_},Xp=dh({user:NE}),H_=()=>jh({reducer:Xp}),G_=()=>{if(typeof window>"u")return H_();{const t=T_(Y_,Xp),r=jh({reducer:t,middleware:n=>n({serializableCheck:{ignoredActions:[tl,Hi,rl,nl,sl,il]}})});return r.__persistor=F_(r),r}};exports.AccountForm=Ra;exports.AnimatedCollapse=_d;exports.AppContext=on;exports.AppProvider=v_;exports.AuthContext=go;exports.Badge=Zr;exports.Button=so;exports.CategoryTypeID=Tp;exports.Checkbox=mi;exports.ConsigneeType=rr;exports.DeliveryTypeID=Ie;exports.ErrorCard=En;exports.ForgotPassword=Nw;exports.GoogleMap=Kd;exports.InputCheckboxSelect=Wy;exports.InputDate=Yy;exports.InputFile=Hy;exports.InputFileDrop=Gy;exports.InputGoogleMap=Cf;exports.InputInteger=Lf;exports.InputLocationSelect=Qy;exports.InputRadioSelect=ei;exports.InputSelect=ct;exports.InputSelectGrouped=ex;exports.InputText=Be;exports.InputTextArea=tx;exports.InvoiceStatus=Mp;exports.InvoiceSummary=Pp;exports.InvoiceSummaryList=Ap;exports.InvoiceType=Ln;exports.Link=Ae;exports.LoadingSpinner=gi;exports.Login=WE;exports.Modal=Xs;exports.ParcelForm=l_;exports.ParcelRow=Rp;exports.ParcelTable=Ip;exports.PaymentModeID=Qo;exports.Popover=Jd;exports.PopoverMenu=B0;exports.PrimaryButton=rt;exports.SecondaryButton=Tn;exports.Separator=Kr;exports.ServiceID=Pt;exports.ShipmentAccountSummary=Qa;exports.ShipmentAddresses=Fp;exports.ShipmentAddressesForm=Up;exports.ShipmentDeliveryData=Vp;exports.ShipmentDetails=d_;exports.ShipmentDocument=Gp;exports.ShipmentForm=p_;exports.ShipmentItemRow=Bp;exports.ShipmentItemTable=Wp;exports.ShipmentPartiesForm=qp;exports.ShipmentStatusID=gr;exports.ShipmentSummary=zp;exports.SideMenu=zy;exports.Switch=W0;exports.Table=vi;exports.TrackingRow=Yp;exports.TrackingTable=Hp;exports.WarningCard=Xd;exports.getApplication=sh;exports.getCategories=ch;exports.getCountries=ah;exports.getTaxIdentificationTypes=ih;exports.getToken=oh;exports.makeStore=G_;exports.refreshToken=lh;exports.shipmentInitialValues=Dp;exports.useApi=Zp;exports.useAppDispatch=Ih;exports.useAppSelector=zE;exports.useAppStore=Fh;exports.useBasicApi=Kp;
|
|
86
|
+
R.version="2.30.1";nS(je);R.fn=P;R.min=Yk;R.max=Hk;R.now=Gk;R.utc=_t;R.unix=wO;R.months=SO;R.isDate=Xn;R.locale=sr;R.invalid=Ai;R.duration=xt;R.isMoment=vt;R.weekdays=OO;R.parseZone=EO;R.localeData=Bt;R.isDuration=Is;R.monthsShort=kO;R.weekdaysMin=CO;R.defineLocale=Wo;R.updateLocale=Ek;R.locales=Sk;R.weekdaysShort=_O;R.normalizeUnits=ft;R.relativeTimeRounding=e_;R.relativeTimeThreshold=t_;R.calendarFormat=y4;R.prototype=P;R.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};var Pt=(e=>(e[e.STANDARD=60]="STANDARD",e[e.DOCUMENT=61]="DOCUMENT",e[e.INTERNATIONAL_DOCUMENT=62]="INTERNATIONAL_DOCUMENT",e[e.INTERNATIONAL_STANDARD=63]="INTERNATIONAL_STANDARD",e[e.ECONOMIC=64]="ECONOMIC",e[e.SAVER=70]="SAVER",e[e.NATIONAL_LOCKER=81]="NATIONAL_LOCKER",e[e.INTERNAL_MAIL=99]="INTERNAL_MAIL",e))(Pt||{}),Mp=(e=>(e[e.ANULLED=6]="ANULLED",e[e.PAID=10]="PAID",e[e.PENDING=11]="PENDING",e[e.PARTIAL_PAID=20]="PARTIAL_PAID",e[e.TO_ISSUE=59]="TO_ISSUE",e[e.ISSUED=60]="ISSUED",e))(Mp||{}),Ln=(e=>(e[e.INVOICE=2]="INVOICE",e[e.CREDIT_NOTE=4]="CREDIT_NOTE",e[e.ORDER=6]="ORDER",e))(Ln||{}),Qo=(e=>(e[e.CASH=1]="CASH",e[e.COD=2]="COD",e[e.CREDIT=3]="CREDIT",e[e.BOXOFFICE_CREDIT=4]="BOXOFFICE_CREDIT",e[e.DEST_BOXOFFICE_CREDIT=5]="DEST_BOXOFFICE_CREDIT",e[e.EXEMPT=6]="EXEMPT",e))(Qo||{}),Tp=(e=>(e[e.INTERNATIONAL=1]="INTERNATIONAL",e[e.NATIONAL=2]="NATIONAL",e))(Tp||{}),Ie=(e=>(e[e.OFFICE=10]="OFFICE",e[e.HOME=20]="HOME",e[e.INTERNATIONAL=21]="INTERNATIONAL",e))(Ie||{}),rr=(e=>(e[e.PERSON=0]="PERSON",e[e.BOX_ACCOUNT=1]="BOX_ACCOUNT",e))(rr||{});const Dp={shipper:null,consigneeType:{id:"0",value:0,label:"Persona"},consignee:null,boxAccount:null,pickupType:{id:Ie.OFFICE.toString(),value:{deliveryTypeID:Ie.OFFICE,deliveryTypeName:"Tienda"},label:"Tienda"},originStore:null,originAddress:null,deliveryType:{id:Ie.OFFICE.toString(),value:{deliveryTypeID:Ie.OFFICE,deliveryTypeName:"Tienda"},label:"Tienda"},destinationStore:null,destinationAddress:null};var gr=(e=>(e[e.ACTIVE=1]="ACTIVE",e[e.ANNULLED=3]="ANNULLED",e[e.DRAFT=5]="DRAFT",e[e.REPLACED=55]="REPLACED",e[e.DELIVERED=30]="DELIVERED",e))(gr||{});const Pp=({invoice:e,onClick:t})=>{const r=u.useMemo(()=>{switch(e.type){case Ln.INVOICE:return"Factura:";case Ln.CREDIT_NOTE:return"Nota de Crédito:";case Ln.ORDER:return"Orden:"}},[e.type]);return l.jsxs("div",{className:"border cursor-pointer border-gray-300 dark:border-gray-700 rounded-lg p-4 hover:shadow-md transition-all text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 duration-100",onClick:t,children:[l.jsxs("div",{className:"flex items-center justify-between mb-3 gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(fv,{className:"w-4 h-4 text-indigo-600 dark:text-indigo-400"}),l.jsxs("span",{className:"font-semibold text-sm text-card-foreground dark:text-gray-200",children:[r," ",l.jsx("span",{className:"text-gray-900 dark:text-gray-100 font-bold",children:e.invoiceNumber})]})]}),l.jsx(Zr,{color:"primary",children:e.statusName})]}),l.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[l.jsxs("div",{className:"col-span-3 md:col-span-2",children:[l.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[l.jsx(tf,{className:"w-3 h-3 text-indigo-600 dark:text-indigo-400"}),l.jsx("h3",{className:"font-semibold text-xs text-card-foreground dark:text-gray-200",children:"Cliente"})]}),l.jsx("p",{className:"text-sm font-bold text-card-foreground dark:text-gray-100",children:e.accountFullName}),l.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground mt-0.5 text-gray-600 dark:text-gray-400",children:[l.jsx(ef,{className:"w-3 h-3"}),l.jsx("span",{className:"text-xs",children:R(e.invoiceDate).format("DD/MM/YYYY, hh:mm A")})]})]}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[l.jsx(YE,{className:"w-3 h-3 text-indigo-600 dark:text-indigo-400"}),l.jsx("h3",{className:"font-semibold text-xs text-card-foreground dark:text-gray-200",children:"Total"})]}),l.jsxs("p",{className:"text-sm font-bold text-card-foreground dark:text-indigo-400",children:["$",e.totalAmount.toFixed(2)]}),l.jsx("p",{className:"text-xs text-muted-foreground text-gray-600 dark:text-gray-400",children:"Con IVA"})]}),e.balanceAmount>=0&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[l.jsx(en,{className:"w-3 h-3 text-indigo-600 dark:text-indigo-400"}),l.jsx("h3",{className:"font-semibold text-xs text-card-foreground dark:text-gray-200",children:"Por Cobrar"})]}),l.jsxs("p",{className:"text-sm font-bold text-card-foreground dark:text-indigo-400",children:["$",Math.max(e.balanceAmount,0).toFixed(2)]}),l.jsx("p",{className:"text-xs text-muted-foreground text-gray-600 dark:text-gray-400",children:"Saldo pendiente"})]}),e.balanceAmount<0&&l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-1 mb-1",children:[l.jsx(en,{className:"w-3 h-3 text-indigo-600 dark:text-indigo-400"}),l.jsx("h3",{className:"font-semibold text-xs text-card-foreground dark:text-gray-200",children:"Reintegrar"})]}),l.jsxs("p",{className:"text-sm font-bold text-card-foreground dark:text-indigo-400",children:["$",Math.max(-e.balanceAmount,0).toFixed(2)]}),l.jsx("p",{className:"text-xs text-muted-foreground text-gray-600 dark:text-gray-400",children:"Monto a devolver"})]})]})]})};function n_(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14 3v4a1 1 0 0 0 1 1h4"},child:[]},{tag:"path",attr:{d:"M19 12v7a1.78 1.78 0 0 1 -3.1 1.4a1.65 1.65 0 0 0 -2.6 0a1.65 1.65 0 0 1 -2.6 0a1.65 1.65 0 0 0 -2.6 0a1.78 1.78 0 0 1 -3.1 -1.4v-14a2 2 0 0 1 2 -2h7l5 5v4.25"},child:[]}]})(e)}function s_(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M14.916 11.707a3 3 0 1 0 -2.916 2.293"},child:[]},{tag:"path",attr:{d:"M11.991 21.485a1.994 1.994 0 0 1 -1.404 -.585l-4.244 -4.243a8 8 0 1 1 13.651 -5.351"},child:[]},{tag:"path",attr:{d:"M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0"},child:[]},{tag:"path",attr:{d:"M20.2 20.2l1.8 1.8"},child:[]}]})(e)}function i_(e){return H({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M12 20m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"},child:[]},{tag:"path",attr:{d:"M10 20h-6"},child:[]},{tag:"path",attr:{d:"M14 20h6"},child:[]},{tag:"path",attr:{d:"M12 15l-2 -2h-3a1 1 0 0 1 -1 -1v-8a1 1 0 0 1 1 -1h10a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-3l-2 2z"},child:[]},{tag:"path",attr:{d:"M12 6v2"},child:[]},{tag:"path",attr:{d:"M12 11v.01"},child:[]}]})(e)}const Ap=({invoices:e,onInvoiceClick:t,wrapperClassName:r})=>l.jsx("div",{className:A("w-full mx-auto",r),children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(n_,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-lg font-bold",children:"Facturas"})]})}),l.jsx("div",{className:"p-2 md:p-4 space-y-4",children:e.map(n=>l.jsx(Pp,{invoice:n,onClick:()=>t?.(n)},n.invoiceID))})]})}),a_={category:null,weight:null,height:null,width:null,length:null,quantity:1},o_=({serviceId:e,categoryTypeId:t,formik:r,warningSchema:n})=>{const{values:s,touched:i,errors:a,handleChange:o,handleBlur:c,handleSubmit:d,setFieldValue:f}=r,h=u.useContext(on),[p,g]=u.useState(null),[m,x]=u.useState(null),[y,w]=u.useState([]),[O,S]=u.useState(""),[E,v]=u.useState({}),b=u.useMemo(()=>a,[a]);return u.useEffect(()=>{(async()=>{const C=await ch(h.api,t);C.error||!C.data||(w(C.data.map(_=>({id:_.categoryId.toString(),label:_.categoryName,value:_}))),x(C.data.find(_=>nx.includes(_.categoryId))??null),g(C.data.find(_=>rx.includes(_.categoryId))??null))})()},[t,h.api]),u.useEffect(()=>{p&&(e===Pt.DOCUMENT||e===Pt.INTERNATIONAL_DOCUMENT)?(S(p.categoryName),f("category",{id:p.categoryId.toString(),label:p.categoryName,value:p}),f("height",ia.HEIGHT),f("width",ia.WIDTH),f("length",ia.LENGTH)):(S(""),f("category",null),f("height",""),f("width",""),f("length",""))},[e,p,f]),u.useEffect(()=>{(async(C,_)=>{try{return await C.validate(_,{abortEarly:!1}),{}}catch(M){if(M instanceof ze){const D={};return M.inner.forEach(F=>{F.path&&(D[F.path]=F.message)}),D}return{}}})(n,s).then(C=>{v(C)})},[s,n]),l.jsx("div",{className:"w-full max-w-2xl",children:l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"space-y-2",children:l.jsx(ct,{label:"Categoría",id:"category",name:"category",placeholder:"Seleccione una categoría",options:y,selected:s.category,searchText:O,disabled:e===Pt.DOCUMENT,error:i.category&&a.category,onSelectOption:k=>f("category",k),onBlur:c,setSearchText:S,footerOption:m?{label:m.categoryName,id:m.categoryId.toString(),value:m}:void 0})}),l.jsxs("div",{className:A("space-y-2",{hidden:e===Pt.DOCUMENT}),children:[l.jsx("h4",{className:"text-gray-700 dark:text-white",children:"Dimensiones en cm."}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[l.jsx("div",{className:"space-y-2",children:l.jsx(Be,{label:"Altura",id:"height",name:"height",type:"number",step:"0.01",placeholder:"0.00",value:s.height??"",onChange:o,onBlur:c,error:i.height&&a.height})}),l.jsx("div",{className:"space-y-2",children:l.jsx(Be,{label:"Ancho",id:"width",name:"width",type:"number",step:"0.01",placeholder:"0.00",value:s.width??"",onChange:o,onBlur:c,error:i.width&&a.width})}),l.jsx("div",{className:"space-y-2",children:l.jsx(Be,{label:"Largo",id:"length",name:"length",type:"number",step:"0.01",placeholder:"0.00",value:s.length??"",onChange:o,onBlur:c,error:i.length&&a.length})})]})]}),l.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[l.jsx("div",{className:"space-y-2",children:l.jsx(Be,{label:"Peso (kg)",id:"weight",name:"weight",type:"number",step:"0.01",placeholder:"0.00",value:s.weight??"",onChange:o,onBlur:c,error:i.weight&&a.weight})}),l.jsx("div",{className:"space-y-2",children:l.jsx(Lf,{label:"Cantidad",id:"quantity",name:"quantity",min:"1",value:s.quantity,disabled:e===Pt.DOCUMENT,onChange:o,onBlur:c,error:i.quantity&&a.quantity})})]}),l.jsxs("div",{className:"flex flex-col gap-2",children:[E.totalWeightWarn&&l.jsx(Xd,{description:E.totalWeightWarn}),b.totalWeightError&&l.jsx(En,{description:b.totalWeightError}),b.minVolumeError&&l.jsx(En,{description:b.minVolumeError}),b.maxVolumeError&&l.jsx(En,{description:b.maxVolumeError}),b.densityError&&l.jsx(En,{description:b.densityError})]}),l.jsx(rt,{type:"submit",className:"w-full",onClick:()=>d(),children:"+ Agregar"})]})})},l_=({serviceId:e,categoryTypeId:t,totalWeight:r,validationConfig:n,onSubmit:s})=>{const i=u.useMemo(()=>{const{minWeight:o=0,minVolume:c,maxVolume:d,minDensity:f,maxDensity:h,maxDocumentWeight:p=1/0,maxTotalWeight:g=1/0}=n??{};let{maxWeight:m=1/0}=n??{};return(e===Pt.DOCUMENT||e===Pt.INTERNATIONAL_DOCUMENT)&&(m=p),ar({category:ir().nullable().required("La categoría es requerida"),weight:ht().typeError("Debe ser un número").required("El peso es requerido").test({name:"min-weight",exclusive:!1,test:x=>x==null||x>=o,message:`El peso mínimo es ${o.toFixed(2)}kg`}).test({name:"max-weight",exclusive:!1,test:x=>x==null||x<=m,message:`El peso máximo es ${m.toFixed(2)}kg`}),height:ht().typeError("Debe ser un número").integer("Debe ser un número entero").positive("Debe ser mayor a 0").required("La altura es requerida"),width:ht().typeError("Debe ser un número").integer("Debe ser un número entero").positive("Debe ser mayor a 0").required("El ancho es requerido"),length:ht().typeError("Debe ser un número").integer("Debe ser un número entero").positive("Debe ser mayor a 0").required("El largo es requerido"),quantity:ht().typeError("Debe ser un número").integer("Debe ser un número entero").min(1,"Debe ser al menos 1").required("La cantidad es requerida")}).test({name:"total-weight-check-global",test:function(x){const{weight:y,quantity:w}=x;if(y===null||r===void 0)return!0;const O=y*w,S=r+O;return g!==void 0&&S>g?this.createError({path:"totalWeightError",message:`El peso total (${S.toFixed(2)}kg) excede el máximo (${g.toFixed(2)}kg)`}):!0}}).test({name:"volume-check",test:function(x){const{height:y,width:w,length:O}=x;if(y===null||w===null||O===null)return!0;const S=y*w*O;return c!==void 0&&S<c?this.createError({path:"minVolumeError",message:`El volumen (${S.toFixed(2)}cm³) es menor al mínimo (${c.toFixed(2)}cm³)`}):d!==void 0&&S>d?this.createError({path:"maxVolumeError",message:`El volumen (${S.toFixed(2)}cm³) es mayor al máximo (${d.toFixed(2)}cm³)`}):!0}}).test({name:"density-check",test:function(x){const{height:y,width:w,length:O,weight:S}=x;if(y===null||w===null||O===null||S===null)return!0;const E=y*w*O;if(E===0)return!0;const v=S/E;return f!==void 0&&v<f||h!==void 0&&v>h?this.createError({path:"densityError",message:"Las medidas son inválidas, por favor revíselas y corríjalas"}):!0}})},[n,r,e]),a=u.useMemo(()=>{const{maxTotalWeightWarn:o=1/0}=n??{};return ar({category:ir().nullable().required(),weight:ht().required(),height:ht().required(),width:ht().required(),length:ht().required(),quantity:ht().required()}).test({name:"total-weight-check-global-warn",test:function(c){const{weight:d,quantity:f}=c;if(!d||!f||r===void 0)return!0;const h=d*f,p=r+h;return o!==void 0&&p>o?this.createError({path:"totalWeightWarn",message:`El peso total (${p.toFixed(2)}kg) excede el recomendado (${o.toFixed(2)}kg)`}):!0}})},[n,r]);return l.jsx(Zn,{initialValues:a_,validationSchema:i,onSubmit:s,children:o=>l.jsx(o_,{serviceId:e,categoryTypeId:t,formik:o,warningSchema:a})})},Rp=({parcel:e,index:t,checked:r,editable:n,editing:s,disabledActions:i,onChangeChecked:a,onPrintParcel:o,onDuplicate:c,onEdit:d})=>l.jsxs("tr",{className:A("hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors duration-100 font-normal text-xs h-12",s&&"border-2 border-indigo-600 dark:border-indigo-400",t%2===0?"bg-gray-100 dark:bg-gray-700":"bg-gray-200 dark:bg-gray-800"),children:[l.jsxs("td",{className:"text-muted-foreground px-3 sm:px-4 font-bold",children:[n&&l.jsx(mi,{label:"",id:`parcel-${e.pieceNumber}-checkbox`,checked:r,disabled:i,onChangeChecked:a}),!n&&e.pieceNumber]}),l.jsxs("td",{className:"sm:hidden px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3 truncate font-semibold",children:[l.jsxs("p",{children:[e.weight.toFixed(2)," kg"]}),l.jsxs("p",{children:[e.length,"x",e.width,"x",e.height," cm"]}),l.jsx("p",{className:"font-normal",children:e.contentDescription})]}),l.jsxs("td",{className:"hidden sm:table-cell px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3 truncate font-semibold",children:[e.weight.toFixed(2)," kg"]}),l.jsxs("td",{className:"hidden sm:table-cell px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3 truncate font-semibold",children:[e.length,"x",e.width,"x",e.height," cm"]}),l.jsx("td",{className:"hidden sm:table-cell text-muted-foreground px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3",children:e.contentDescription}),l.jsxs("td",{className:"text-right px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3",children:[n&&!i&&l.jsxs("div",{className:"flex gap-2 items-cetner justify-end",children:[l.jsx("button",{type:"button",className:"inline-flex items-center justify-center h-6 w-6 sm:h-8 sm:w-8 rounded hover:bg-indigo-100 dark:hover:bg-indigo-800 transition-colors text-indigo-600 dark:text-indigo-300 hover:text-indigo-900 dark:hover:text-white cursor-pointer",title:"Acciones",onClick:c,children:l.jsx(qE,{className:"h-4 w-4"})}),l.jsx("button",{type:"button",className:"inline-flex items-center justify-center h-6 w-6 sm:h-8 sm:w-8 rounded hover:bg-indigo-100 dark:hover:bg-indigo-800 transition-colors text-indigo-600 dark:text-indigo-300 hover:text-indigo-900 dark:hover:text-white cursor-pointer",title:"Acciones",onClick:d,children:l.jsx($h,{className:"h-4 w-4"})})]}),!n&&!i&&l.jsx("button",{type:"button",className:"inline-flex items-center justify-center h-8 w-8 rounded hover:bg-indigo-100 dark:hover:bg-indigo-800 transition-colors text-indigo-600 dark:text-indigo-300 hover:text-indigo-900 dark:hover:text-white cursor-pointer",title:"Imprimir",onClick:o,children:l.jsx(XE,{className:"h-4 w-4"})}),s&&l.jsx("span",{className:"italic",children:"Editando"})]})]}),Ip=({parcels:e,totalPhysicalWeight:t,totalDimensionalWeight:r,totalChargedWeight:n,totalVolume:s,dimensionalFactor:i,editingParcel:a,editable:o,onPrintParcel:c,onDelete:d,onDuplicate:f,onSelectEdit:h,onCancelEdit:p,onPrintShipment:g,wrapperClassName:m})=>{const[x,y]=u.useState([]),w=u.useMemo(()=>x.every(E=>E),[x]),O=(E,v)=>{y(b=>[...b.slice(0,v),E,...b.slice(v+1)])},S=()=>{y(w?Array.from({length:e.length},()=>!1):Array.from({length:e.length},()=>!0))};return u.useEffect(()=>{y(Array.from({length:e.length},()=>!1))},[e.length,a]),l.jsx("div",{className:A("w-full mx-auto",m),children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(en,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-xl font-bold",children:"Piezas"})]})}),l.jsxs("div",{className:"p-4",children:[l.jsxs(vi,{children:[l.jsx("thead",{className:"sticky top-0 z-10 bg-gray-50 dark:bg-gray-800",children:l.jsxs("tr",{className:"border-b-2",children:[l.jsxs("th",{className:"w-16 font-bold text-xs uppercase tracking-wider text-left px-3 sm:px-4 py-2",children:[o&&l.jsx(mi,{label:"",id:"parcel-table-all-checked-checkbox",checked:w,disabled:!!a,onChangeChecked:S}),!o&&"#"]}),l.jsx("th",{className:"sm:hidden text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(X0,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Pieza"})]})}),l.jsx("th",{className:"hidden sm:table-cell text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(rS,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Peso"})]})}),l.jsx("th",{className:"hidden sm:table-cell text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(QE,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Dimensiones"})]})}),l.jsx("th",{className:"hidden sm:table-cell text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Nd,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Categoría"})]})}),l.jsx("th",{className:"w-24 text-right text-xs uppercase font-semibold tracking-wider px-4 py-2",children:l.jsxs("div",{className:"flex items-center w-full justify-end gap-2",children:[l.jsx(KE,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{className:"hidden sm:inline-block",children:"Acciones"})]})})]})}),l.jsx("tbody",{children:e.map((E,v)=>l.jsx(Rp,{parcel:E,index:v,editing:a?.pieceNumber===E.pieceNumber,checked:x[v],disabledActions:!!a,onChangeChecked:b=>O(b,v),onPrintParcel:()=>c?.(E),onDuplicate:()=>f?.(E),onEdit:()=>h?.(E),editable:o},E.pieceNumber))})]}),l.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 justify-between text-xs mt-4",children:[l.jsxs("div",{className:"flex flex-col sm:block w-full sm:w-fit justify-center items-center",children:[!o&&g&&l.jsxs(rt,{className:"w-full md:w-36",onClick:g,children:[l.jsx(av,{className:"w-4 h-4 inline mr-2"}),"Imprimir Guía"]}),o&&!a&&l.jsxs(Tn,{className:"!w-full my-2 sm:my-0",disabled:x.every(E=>!E),onClick:()=>d?.(e.filter((E,v)=>x[v])),children:[l.jsx(U0,{className:"mr-2 w-4 h-4"}),"Eliminar"]}),!!a&&l.jsxs(Tn,{onClick:p,children:[l.jsx(Md,{className:"mr-2 w-5 h-5"}),"Cancelar Edición"]})]}),l.jsxs("div",{className:"space-y-1 text-gray-800 dark:text-gray-300",children:[l.jsxs("div",{className:"flex items-center justify-between gap-12",children:[l.jsx("span",{className:"text-muted-foreground font-semibold",children:"Peso por facturar"}),l.jsxs("span",{className:"font-bold text-indigo-600 dark:text-indigo-400 truncate",children:[n.toFixed(2)," kg"]})]}),l.jsx(Kr,{}),l.jsxs("div",{className:"flex items-center justify-between gap-12",children:[l.jsx("span",{className:"text-muted-foreground",children:"Peso físico"}),l.jsxs("span",{className:"text-indigo-600 dark:text-indigo-400 truncate",children:[t.toFixed(2)," kg"]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-12",children:[l.jsx("span",{className:"text-muted-foreground",children:"Peso volumétrico"}),l.jsxs("span",{className:"text-indigo-600 dark:text-indigo-400 truncate",children:[r.toFixed(2)," kg"]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-12",children:[l.jsx("span",{className:"text-muted-foreground",children:"Volumen"}),l.jsxs("span",{className:"text-indigo-600 dark:text-indigo-400 truncate",children:[s.toFixed(2)," cm",l.jsx("sup",{children:"3"})]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-12",children:[l.jsx("span",{className:"text-muted-foreground",children:"Factor volumétrico"}),l.jsx("span",{className:"text-indigo-600 dark:text-indigo-400 truncate",children:i.toFixed(2)})]})]})]})]})]})})},Qa=({isShipper:e=!1,account:t,store:r,deliveryType:n,isAccountBillTo:s,address:i})=>{const a=u.useMemo(()=>n===Ie.HOME&&e?"Recolecta":n===Ie.HOME&&!e?"A Domicilio":"En Tienda",[e,n]);return l.jsxs("div",{children:[l.jsxs("div",{className:"mb-2 flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-600/10 dark:bg-indigo-900 p-2",children:l.jsx(tf,{className:"h-5 w-5 text-indigo-600 dark:text-indigo-300"})}),l.jsxs("div",{children:[l.jsx("h2",{className:"font-semibold text-div-foreground text-gray-900 dark:text-gray-200",children:e?"Remitente":"Destinatario"}),s&&l.jsx(Zr,{color:"primary",children:"Cuenta a facturar"})]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("div",{children:l.jsx("p",{className:"text-lg font-bold text-div-foreground text-gray-900 dark:text-gray-200",children:t.fullName})}),l.jsx(Kr,{className:"my-2"}),l.jsxs("div",{className:"space-y-1.5 text-xs",children:[l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-gray-700 dark:text-gray-400",children:[l.jsx(HE,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsxs("span",{className:"font-mono",children:[t.taxIdentificationType,"-",t.identificationNumber]})]}),l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-gray-700 dark:text-gray-400",children:[l.jsx(Ym,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:t.email})]}),l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-gray-700 dark:text-gray-400",children:[l.jsx(JE,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:t.phone})]}),l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-gray-700 dark:text-gray-400",children:[l.jsx(jd,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:a})]}),l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-gray-700 dark:text-gray-400",children:[l.jsx(eS,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsxs("span",{children:[r.code," - ",r.commercialName]})]}),i&&n===Ie.HOME&&l.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-gray-700 dark:text-gray-400",children:[l.jsx(ZE,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:i.addressLine1})]})]})]})]})},Fp=({shipment:e,wrapperClassName:t})=>{const r=u.useMemo(()=>{const n={lat:e.originAddress.latitude,lng:e.originAddress.longitude,name:`Origen (${e.pickupType.deliveryTypeID===Ie.OFFICE?"En Tienda":"Recolecta"})`},s={lat:e.destinationAddress.latitude,lng:e.destinationAddress.longitude,name:`Destino (${e.deliveryType.deliveryTypeID===Ie.OFFICE?"En Tienda":"A Domicilio"})`};return[n,s]},[e]);return l.jsx("div",{className:A("w-full mx-auto",t),children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg w-full h-full flex flex-col",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(qd,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-xl font-bold",children:"Ruta"})]})}),l.jsxs("div",{className:"flex flex-col p-4 w-full h-full flex-1 gap-2",children:[l.jsx("div",{className:"w-full h-full",children:l.jsx(Kd,{coordinates:r})}),l.jsxs("p",{className:"text-xs text-gray-800 dark:text-gray-300",children:["Ubicación actual:"," ",l.jsxs("span",{className:"font-semibold",children:[e.lastKnowStoreLocation.code," -"," ",e.lastKnowStoreLocation.commercialName]})]}),l.jsx("div",{className:"flex items-center justify-center w-full text-center",children:l.jsx(Ae,{children:"Agregar recargo por entrega a domicilio"})})]})]})})},$p=[{id:Ie.OFFICE.toString(),label:"Tienda",value:{deliveryTypeID:Ie.OFFICE,deliveryTypeName:"Tienda"}},{id:Ie.HOME.toString(),label:"A Domicilio",value:{deliveryTypeID:Ie.HOME,deliveryTypeName:"A Domicilio"}}],c_=[...$p,{id:Ie.INTERNATIONAL.toString(),label:"Internacional",value:{deliveryTypeID:Ie.INTERNATIONAL,deliveryTypeName:"Internacional"}}],Up=({formik:e})=>{const{values:t,touched:r,errors:n,handleBlur:s,setFieldValue:i}=e,{store:a}=u.useContext(go),o=d=>{i("pickupType",d),d.value.deliveryTypeID===Ie.OFFICE?(i("originStore",a),i("originAddress",a?.address??null)):(i("originStore",null),i("originAddress",null))},c=d=>{i("deliveryType",d),i("destinationStore",null),i("destinationAddress",null)};return l.jsx("div",{className:"w-full mx-auto",children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(s_,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-lg font-bold",children:"Direcciones"})]})}),l.jsxs("div",{className:"flex flex-col w-full gap-4 p-4",children:[l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-8 pr-2 justify-between text-sm font-medium leading-6 text-gray-700 truncate dark:text-gray-200",children:[l.jsxs("p",{children:["Origen ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("div",{className:"mb-1",children:l.jsx(ei,{id:"pickupType",name:"pickupType",label:"",options:$p,selected:t.pickupType,onSelectOption:o,onBlur:s,wrapperClassName:"flex-row"})})]}),l.jsx("div",{className:"w-full",children:t.pickupType?.value.deliveryTypeID===Ie.OFFICE&&l.jsx(ct,{disabled:!0,label:"",id:"originStore",name:"originStore",placeholder:"Seleccione una tienda",options:[],selected:t.originStore,searchText:t.originStore?.value.commercialName,error:r.originStore&&n.originStore,onSelectOption:()=>{},onBlur:s})})]}),l.jsx("div",{className:"flex-1",children:l.jsxs("div",{className:"flex items-center gap-8 pr-2 justify-between text-sm font-medium leading-6 text-gray-700 truncate dark:text-gray-200",children:[l.jsxs("p",{children:["Destino ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("div",{className:"mb-1",children:l.jsx(ei,{id:"deliveryType",name:"deliveryType",label:"",options:c_,selected:t.deliveryType,onSelectOption:c,onBlur:s,wrapperClassName:"flex-row"})})]})})]})]})})},Vp=({user:e,date:t,observation:r,wrapperClassName:n})=>l.jsxs("div",{className:A("flex flex-col gap-6 rounded-lg border p-6 border-gray-300 dark:border-gray-700 text-gray-800 dark:text-gray-300 bg-gray-50 dark:bg-gray-800 max-w-full",n),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-600/60 dark:bg-indigo-300/20 p-2 backdrop-blur-sm text-gray-100",children:l.jsx(Hm,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-lg font-bold",children:"Entrega"})]}),l.jsxs("div",{className:"space-y-0.5",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-foreground",children:"Usuario: "}),l.jsx("span",{className:"text-sm text-muted-foreground",children:e})]}),l.jsxs("div",{children:[l.jsx("span",{className:"text-sm font-medium text-foreground",children:"Fecha: "}),l.jsx("span",{className:"text-sm text-muted-foreground",children:R(t).format("DD/MM/YYYY, hh:mm A")})]}),l.jsxs("div",{children:[l.jsxs("span",{className:"text-sm font-medium text-foreground",children:["Observaciones:"," "]}),l.jsx("span",{className:"text-sm text-muted-foreground",children:r||"—"})]})]})]}),u_=e=>{switch(e){case gr.ACTIVE:return"primary";case gr.ANNULLED:return"danger";case gr.DELIVERED:return"success";case gr.DRAFT:return"warning";case gr.REPLACED:default:return"default"}},zp=({shipment:e,onSubstituteForClick:t,onSubstitutedByClick:r})=>l.jsx("div",{className:"bg-gradient-subtle",children:l.jsxs("div",{className:"mx-auto max-w-6xl",children:[l.jsx("div",{className:"mb-6 overflow-hidden border-none shadow-lg",children:l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 p-6 dark:from-indigo-800 dark:to-indigo-600",children:l.jsxs("div",{className:"flex relative items-start justify-between",children:[l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-3 backdrop-blur-sm hidden md:block",children:l.jsx(en,{className:"h-8 w-8"})}),l.jsxs("div",{children:[l.jsx("p",{className:"mb-1 text-sm font-medium opacity-90",children:"Número de Guía"}),l.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:e.shipmentNumber}),l.jsxs("p",{className:"mt-2 text-sm opacity-90",children:["Creación:"," ",R(e.shipmentHeaderDate).format("DD/MM/YYYY, hh:mm A")]}),l.jsxs("p",{className:A("text-sm",!e.substituteFor&&"hidden"),children:["Sustituto de:"," ",l.jsx(Ae,{className:"text-white hover:text-white/80 underline dark:no-underline font-semibold",onClick:t,children:e.substituteFor})]}),l.jsxs("p",{className:A("text-sm",!e.substitutedBy&&"hidden"),children:["Sustituido por:"," ",l.jsx(Ae,{className:"text-white hover:text-white/80 underline dark:no-underline font-semibold",onClick:r,children:e.substitutedBy})]})]})]}),l.jsx(Zr,{color:u_(e.status.id),className:"!text-base absolute top-0 right-0",children:e.status.name})]})})}),l.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[l.jsx("div",{className:"lg:col-span-2",children:l.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[l.jsx("div",{className:"border-none shadow-md transition-all hover:shadow-xl p-6 bg-gray-100 dark:bg-gray-800 rounded-lg",children:l.jsx(Qa,{isShipper:!0,account:e.shipper,store:e.originStore,deliveryType:e.pickupType.deliveryTypeID,isAccountBillTo:e.billTo.id===e.shipper.id,address:e.originAddress})}),l.jsx("div",{className:"border-none shadow-md transition-all hover:shadow-xl p-6 bg-gray-100 dark:bg-gray-800 rounded-lg",children:l.jsx(Qa,{account:e.consignee,store:e.destinationStore,deliveryType:e.deliveryType.deliveryTypeID,isAccountBillTo:e.billTo.id===e.consignee.id,address:e.destinationAddress})})]})}),l.jsx("div",{className:"lg:col-span-1",children:l.jsxs("div",{className:"sticky top-8 border-none shadow-lg bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-400 rounded-b-lg",children:[l.jsx("div",{className:"bg-indigo-600 text-gray-100 dark:bg-indigo-700 p-4",children:l.jsxs("h2",{className:"flex items-center gap-2 text-lg font-semibold",children:[l.jsx(en,{className:"h-5 w-5"}),"Resumen"]})}),l.jsxs("div",{className:"p-6",children:[l.jsxs("div",{className:"gap-2 mb-2",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Servicio"}),l.jsx("p",{className:"font-semibold text-div-foreground text-gray-900 dark:text-gray-200",children:e.service.serviceShortName})]}),l.jsxs("div",{className:"gap-2 mb-2",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Modalidad de Pago"}),l.jsx("p",{className:"font-semibold text-div-foreground text-gray-900 dark:text-gray-200",children:e.paymentMode.paymentModeName})]}),e.paymentMode.paymentModeID===Qo.CREDIT&&l.jsxs("div",{className:"gap-2",children:[l.jsx("p",{className:"text-sm text-muted-foreground",children:"Crédito de"}),l.jsx("p",{className:"font-semibold text-div-foreground text-gray-900 dark:text-gray-200",children:e.billTo.fullName})]}),l.jsx(Kr,{className:"my-4"}),l.jsxs("div",{className:"space-y-1",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Con impuestos"}),l.jsxs("span",{className:"text-lg font-bold text-indigo-600 dark:text-indigo-400",children:["$",e.totalAmount.toFixed(2)]})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Nº de piezas"}),l.jsx("span",{className:"font-semibold text-div-foreground text-gray-900 dark:text-gray-200",children:e.totalPieces})]}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-sm text-muted-foreground",children:"Peso por facturar"}),l.jsxs("span",{className:"font-semibold text-div-foreground text-gray-900 dark:text-gray-200",children:[e.totalChargedWeight.toFixed(2)," Kg"]})]})]})]})]})})]})]})}),Bp=({item:e,index:t})=>l.jsxs("tr",{className:A("hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors duration-100 font-normal text-xs h-12",t%2===0?"bg-gray-100 dark:bg-gray-700":"bg-gray-200 dark:bg-gray-800"),children:[l.jsxs("td",{className:"text-muted-foreground px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3 font-semibold",children:[l.jsx("p",{children:e.itemDescription}),l.jsx("p",{className:"sm:hidden font-normal",children:e.itemDetails})]}),l.jsx("td",{className:"hidden sm:table-cell text-muted-foreground px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3",children:e.itemDetails}),l.jsxs("td",{className:"px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3 truncate font-semibold text-right text-sm",children:[e.subTotalAmount<0&&"-","$",Math.abs(e.subTotalAmount).toFixed(2)]})]}),Wp=({items:e,subTotalAmount:t,vatAmount:r,postalTaxAmount:n,totalAmount:s,wrapperClassName:i})=>l.jsx("div",{className:A("w-full mx-auto",i),children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(nv,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-xl font-bold",children:"Items"})]})}),l.jsxs("div",{className:"p-4",children:[l.jsxs(vi,{children:[l.jsx("thead",{className:"sticky top-0 z-10 bg-gray-50 dark:bg-gray-800",children:l.jsxs("tr",{className:"border-b-2",children:[l.jsx("th",{className:"text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Nd,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Servicio"})]})}),l.jsx("th",{className:"hidden sm:table-cell text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(rv,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Detalles"})]})}),l.jsx("th",{className:"w-24 text-right text-xs uppercase font-semibold tracking-wider px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(GE,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Costo"})]})})]})}),l.jsx("tbody",{children:e.map((a,o)=>l.jsx(Bp,{item:a,index:o},a.itemID))})]}),l.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-end text-sm mt-4",children:l.jsxs("div",{className:"space-y-1 text-gray-800 dark:text-gray-300",children:[l.jsxs("div",{className:"flex items-center justify-between gap-16",children:[l.jsx("span",{className:"text-muted-foreground font-semibold uppercase",children:"Subtotal"}),l.jsxs("span",{className:"font-bold text-indigo-600 dark:text-indigo-400 truncate",children:["$",t.toFixed(2)]})]}),l.jsx(Kr,{}),l.jsxs("div",{className:"flex items-center justify-between gap-16",children:[l.jsx("span",{className:"text-muted-foreground",children:"IVA (16%)"}),l.jsxs("span",{className:"text-indigo-600 dark:text-indigo-400 truncate",children:["$",r.toFixed(2)]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-16",children:[l.jsx("span",{className:"text-muted-foreground",children:"Franqueo Postal"}),l.jsxs("span",{className:"text-indigo-600 dark:text-indigo-400 truncate",children:["$",n.toFixed(2)]})]}),l.jsx(Kr,{}),l.jsxs("div",{className:"flex items-center justify-between gap-16",children:[l.jsx("span",{className:"font-bold text-muted-foreground uppercase",children:"Total"}),l.jsxs("span",{className:"font-bold text-indigo-600 dark:text-indigo-400 truncate",children:["$",s.toFixed(2)]})]})]})})]})]})}),Yp=({tracking:e,index:t})=>l.jsxs("tr",{className:A("hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors duration-100 font-normal text-xs h-12",t%2===0?"bg-gray-100 dark:bg-gray-700":"bg-gray-200 dark:bg-gray-800"),children:[l.jsx("td",{className:"text-muted-foreground px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3 font-semibold",children:R(e.date).format("DD/MM/YYYY, hh:mm A")}),l.jsxs("td",{className:"text-muted-foreground px-2 py-1 sm:px-3 sm:py-2 md:px-4 md:py-3",children:[l.jsx("p",{className:"font-semibold text-indigo-600 dark:text-indigo-400",children:e.description}),l.jsx("p",{className:"font-normal",children:e.details})]})]}),Hp=({trackings:e,onPublicAppClick:t,wrapperClassName:r})=>l.jsx("div",{className:A("w-full mx-auto",r),children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(jd,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-xl font-bold",children:"Tracking"})]})}),l.jsxs("div",{className:"flex flex-col gap-4 p-4",children:[l.jsx("p",{className:A(!t&&"hidden"),children:l.jsx(Ae,{onClick:t,children:"Ver guía en Tealca Consultas"})}),l.jsxs(vi,{children:[l.jsx("thead",{className:"sticky top-0 z-10 bg-gray-50 dark:bg-gray-800",children:l.jsxs("tr",{className:"border-b-2",children:[l.jsx("th",{className:"text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(ef,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Fecha"})]})}),l.jsx("th",{className:"text-xs uppercase font-semibold tracking-wider text-left px-4 py-2",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(i_,{className:"h-4 w-4 text-indigo-600 dark:text-indigo-300"}),l.jsx("span",{children:"Evento"})]})})]})}),l.jsx("tbody",{children:e.map((n,s)=>l.jsx(Yp,{tracking:n,index:s},n.trackingID))})]})]})]})}),Gp=({showPOD:e,showInvoice:t,isPhysicalLiability:r,isPhysicalPOD:n,invoiceNumber:s,onShowLiabilityWaiver:i,onDownloadLiabilityWaiver:a,onShowPOD:o,onDownloadPOD:c,onShowInvoiceAttachments:d,wrapperClassName:f})=>l.jsxs("div",{className:A("flex flex-col gap-6 rounded-lg border p-6 border-gray-300 dark:border-gray-700 text-gray-800 dark:text-gray-300 bg-gray-50 dark:bg-gray-800 max-w-full",f),children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-600/60 dark:bg-indigo-300/20 p-2 backdrop-blur-sm text-gray-100",children:l.jsx(Y0,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-lg font-bold",children:"Documentos Digitales"})]}),l.jsxs("div",{className:"space-y-0.5",children:[l.jsxs("div",{children:[l.jsxs("span",{className:"text-sm font-medium text-foreground",children:["Declaración Jurada:"," "]}),l.jsx("span",{className:A("ml-3 text-sm text-muted-foreground",!r&&"hidden"),children:"Llenada en el documento físico"}),l.jsx("p",{className:"ml-4",children:l.jsx(Ae,{onClick:i,className:A("text-sm text-muted-foreground",r&&"hidden"),children:"Ver Declaración Jurada"})}),l.jsx("p",{className:"ml-4",children:l.jsx(Ae,{onClick:a,className:A("text-sm text-muted-foreground",r&&"hidden"),children:"Descargar Declaración Jurada"})})]}),l.jsxs("div",{className:A(!e&&"hidden"),children:[l.jsx("span",{className:"text-sm font-medium text-foreground",children:"POD: "}),l.jsx("span",{className:A("ml-3 text-sm text-muted-foreground",!n&&"hidden"),children:"Llenada en el documento físico"}),l.jsx("p",{className:"ml-4",children:l.jsx(Ae,{onClick:o,className:A("text-sm text-muted-foreground",n&&"hidden"),children:"Ver POD"})}),l.jsx("p",{className:"ml-4",children:l.jsx(Ae,{onClick:c,className:A("text-sm text-muted-foreground",n&&"hidden"),children:"Descargar POD"})})]}),l.jsxs("div",{className:A(!t&&"hidden"),children:[l.jsxs("span",{className:"text-sm font-medium text-foreground",children:["Factura de la mercancia:"," "]}),l.jsx("p",{className:"ml-4 text-sm text-muted-foreground",children:l.jsx("span",{children:s})}),l.jsx("p",{className:"ml-4 text-sm text-muted-foreground",children:l.jsx(Ae,{onClick:d,children:"Ver Adjuntos"})})]})]})]}),d_=({shipment:e,trackings:t,showLiabilityWaiver:r,showPOD:n,showInvoice:s,isPhysicalLiability:i,isPhysicalPOD:a,invoiceNumber:o,onSubstituteForClick:c,onSubstitutedByClick:d,onInvoiceClick:f,onPublicAppClick:h,onShowLiabilityWaiver:p,onDownloadLiabilityWaiver:g,onShowPOD:m,onDownloadPOD:x,onShowInvoiceAttachments:y,onPrintParcel:w,onPrintShipment:O,onEdit:S,onCancel:E,onDeliver:v})=>{const[b,k]=u.useState(!1);return l.jsxs("div",{className:"flex flex-col gap-8",children:[l.jsx(zp,{shipment:e,onSubstituteForClick:c,onSubstitutedByClick:d}),l.jsxs("div",{className:"rounded-lg border border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-800 shadow-sm overflow-hidden",children:[l.jsxs("div",{className:"w-full flex items-center justify-between p-5 cursor-pointer hover:bg-gray-200 dark:hover:bg-gray-700 text-xl font-bold text-gray-800 dark:text-gray-200",onClick:()=>k(!b),children:[l.jsx("span",{children:"Detalles"}),l.jsx(uo,{className:A("ml-2 transition-transform duration-1000 text-gray-500 dark:text-gray-300",b?"rotate-180":"rotate-0"),"aria-label":b?"Colapsar":"Expandir"})]}),l.jsx(_d,{active:b,duration:1e3,children:l.jsxs("div",{className:"flex flex-col p-2 md:p-4 lg:p-6 gap-14 pb-16",children:[e.invoices.length>0&&l.jsx(Ap,{invoices:e.invoices,onInvoiceClick:f}),e.parcels.length>0&&l.jsx(Ip,{parcels:e.parcels,totalPhysicalWeight:e.totalPhysicalWeight,totalDimensionalWeight:e.totalDimensionalWeight,totalChargedWeight:e.totalChargedWeight,totalVolume:e.totalVolume,dimensionalFactor:e.dimensionalFactor,onPrintParcel:w,onPrintShipment:O}),e.items.length>0&&l.jsx(Wp,{items:e.items,subTotalAmount:e.subTotalAmount,vatAmount:e.vatAmount,postalTaxAmount:e.postalTaxAmount,totalAmount:e.totalAmount}),t.length>0&&l.jsx(Hp,{trackings:t,onPublicAppClick:h}),l.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.deliveryDate&&e.deliveryUser&&l.jsx(Vp,{user:e.deliveryUser,date:e.deliveryDate,observation:e.deliveryObservation}),r&&l.jsx(Gp,{showPOD:n,showInvoice:s,isPhysicalLiability:i,isPhysicalPOD:a,invoiceNumber:o,onShowLiabilityWaiver:p,onDownloadLiabilityWaiver:g,onShowPOD:m,onDownloadPOD:x,onShowInvoiceAttachments:y})]}),l.jsx(Fp,{shipment:e,wrapperClassName:"h-[30rem]"})]})})]}),l.jsx("div",{className:"mt-2 md:mt-6 w-full flex flex-col gap-4 md:gap-0",children:l.jsxs("div",{className:"w-full flex flex-col-reverse md:flex-row justify-between items-center gap-4",children:[l.jsx("div",{className:"flex flex-col-reverse md:flex-row gap-4 items-center w-full",children:E&&l.jsxs(Ae,{onClick:E,children:[l.jsx(Md,{className:"w-5 h-5 inline mr-1 mb-0.5"}),"Anular"]})}),l.jsxs("div",{className:"flex flex-col md:flex-row gap-4 items-center w-full md:w-fit",children:[S&&l.jsxs(rt,{className:"w-full md:w-36",onClick:S,children:[l.jsx($h,{className:"w-4 h-4 inline mr-2"}),"Editar"]}),v&&l.jsxs(rt,{className:"w-full md:w-36",onClick:v,children:[l.jsx(dv,{className:"w-4 h-4 inline mr-2"}),"Entregar"]})]})]})})]})},id={id:"",label:"Crear nuevo",value:null},f_=[{id:rr.PERSON.toString(),label:"Persona",value:rr.PERSON},{id:rr.BOX_ACCOUNT.toString(),label:"Casillero",value:rr.BOX_ACCOUNT}],qp=({formik:e})=>{const{values:t,touched:r,errors:n,handleBlur:s,setFieldValue:i}=e,[a,o]=u.useState(!1),[c,d]=u.useState(!1),[f,h]=u.useState(""),[p,g]=u.useState(""),m=w=>{if(w.value===null){o(!0);return}i("shipper",w),i("consigneeType",{id:rr.PERSON.toString(),label:"Persona",value:rr.PERSON}),i("consignee",null)},x=w=>{i("consigneeType",w),i("consignee",null)},y=w=>{if(w.value===null){d(!0);return}i("consignee",w)};return l.jsx("div",{className:"w-full mx-auto",children:l.jsxs("div",{className:"shadow-lg bg-white dark:bg-gray-900 rounded-lg",children:[l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 dark:from-indigo-800 dark:to-indigo-600 p-3",children:l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-2 backdrop-blur-sm",children:l.jsx(tS,{className:"w-5 h-5"})}),l.jsx("h1",{className:"text-lg font-bold",children:"Partes Involucradas"})]})}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 w-full gap-4 p-4 md:h-28",children:[l.jsxs("div",{className:"flex-1",children:[l.jsx(ct,{required:!0,label:"Remitente",id:"shipper",name:"shipper",placeholder:"Seleccione un remitente",options:[],selected:t.shipper,searchText:f,error:r.shipper&&n.shipper,onSelectOption:m,onBlur:s,setSearchText:h,footerOption:id}),l.jsxs(Xs,{open:a,onClose:()=>o(!1),children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-white mb-4",children:"Crear nuevo cliente"}),l.jsx(Ra,{onSubmit:()=>{},onCancel:w=>{o(!1),w.resetForm()}})]})]}),l.jsxs("div",{className:"flex-1",children:[l.jsxs("div",{className:"flex items-center gap-8 pr-2 justify-between text-sm font-medium leading-6 text-gray-700 truncate dark:text-gray-200",children:[l.jsxs("p",{children:["Destinatario ",l.jsx("span",{className:"text-red-500",children:"*"})]}),l.jsx("div",{className:"mb-1",children:l.jsx(ei,{id:"consigneeType",name:"consigneeType",label:"",options:f_,selected:t.consigneeType,disabled:!t.shipper,onSelectOption:x,onBlur:s,wrapperClassName:"flex-row"})})]}),l.jsx("div",{className:"w-full",children:l.jsx(ct,{label:"",id:"consignee",name:"consignee",placeholder:"Seleccione un destinatario",options:[],selected:t.consignee,disabled:!t.shipper,searchText:p,error:r.consignee&&n.consignee,onSelectOption:y,onBlur:s,setSearchText:g,footerOption:id})}),l.jsxs(Xs,{open:c,onClose:()=>d(!1),children:[l.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-white mb-4",children:"Crear nuevo cliente"}),l.jsx(Ra,{onSubmit:()=>{},onCancel:w=>{d(!1),w.resetForm()}})]})]})]})]})})},h_=({formik:e})=>l.jsxs("div",{className:"flex flex-col gap-6",children:[l.jsx(qp,{formik:e}),l.jsx(Up,{formik:e})]}),p_=({index:e,shipment:t})=>l.jsxs("div",{className:"flex flex-col gap-8 w-full",children:[l.jsx("div",{className:"overflow-hidden border-none shadow-lg",children:l.jsx("div",{className:"bg-gradient-to-r from-indigo-600 to-indigo-400 p-6 dark:from-indigo-800 dark:to-indigo-600",children:l.jsx("div",{className:"flex relative items-start justify-between",children:l.jsxs("div",{className:"flex items-start gap-4",children:[l.jsx("div",{className:"rounded-lg bg-indigo-100/20 dark:bg-indigo-300/20 p-3 backdrop-blur-sm hidden md:block",children:l.jsx(en,{className:"h-8 w-8"})}),t&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("p",{className:"mb-1 text-sm font-medium opacity-90",children:"Número de Guía"}),l.jsxs("h1",{className:"text-3xl font-bold tracking-tight",children:[t.shipmentNumber," ",l.jsx("span",{className:"font-normal italic",children:"(Edición)"})]}),l.jsxs("p",{className:"mt-2 text-sm opacity-90",children:["Creación:"," ",R(t.shipmentHeaderDate).format("DD/MM/YYYY, hh:mm A")]})]}),l.jsx(Zr,{color:"default",className:"!text-base absolute top-0 right-0",children:t.status.name})]}),!t&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{children:[l.jsx("p",{className:"mb-1 text-sm font-medium opacity-90",children:"Guía Número"}),l.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:e.toString().padStart(3,"0")})]}),l.jsx(Zr,{color:"primary",className:"!text-base absolute top-0 right-0",children:"Nueva Guía"})]})]})})})}),l.jsx(Zn,{initialValues:Dp,onSubmit:()=>{},children:r=>l.jsx(h_,{formik:r})})]}),m_=(e,t=!1)=>{const r=t?"-":"_";return e.replace(/[A-Z]/g,n=>`${r}${n.toLowerCase()}`)},tn=(e,t=!1)=>Array.isArray(e)?e.map(r=>tn(r)):e!==null&&e.constructor===Object?Object.keys(e).reduce((r,n)=>(r[m_(n,t)]=tn(e[n]),r),{}):e;function g_(e){return e.replace(/([-_][a-z])/gi,t=>t.toUpperCase().replace("-","").replace("_",""))}function pi(e){if(Array.isArray(e))return e.map(pi);if(e!==null&&typeof e=="object"){const t={};for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const n=g_(r);t[n]=pi(e[r])}return t}return e}const Zp=(e,t)=>{const r=Fh();return u.useMemo(()=>{const s=Ne.create({baseURL:e});return s.interceptors.request.use(i=>{const a=r.getState().auth.accessToken;return a&&i.headers&&(i.headers.Authorization=`Bearer ${a}`),i.data&&(i.data=tn(i.data)),i.params&&(i.params=tn(i.params,!0)),i},i=>Promise.reject(i)),s.interceptors.response.use(i=>(i.data&&(i.data=pi(i.data)),i),async i=>{const a=i.config;if(i.response?.status===401&&!a._retry){a._retry=!0;const o=r.getState().auth.refreshToken;if(o)try{const c=await lh(t,o);if(c.data){const{accessToken:d}=c.data,f=r.getState().auth;if(f.user)return r.dispatch(Dh({user:f.user,...c.data})),a.headers.Authorization=`Bearer ${d}`,Ne(a)}}catch(c){return Promise.reject(c)}}return Promise.reject(i)}),s},[e,t,r])},Kp=e=>u.useMemo(()=>{const r=Ne.create({baseURL:e,headers:{"Content-Type":"application/json"}});return r.interceptors.request.use(n=>(n.data&&(n.data=tn(n.data)),n.params&&(n.params=tn(n.params,!0)),n),n=>Promise.reject(n)),r.interceptors.response.use(n=>(n.data&&(n.data=pi(n.data)),n),n=>Promise.reject(n)),r},[e]),v_=({children:e,applicationId:t})=>{const r=Kp("http://localhost:8000/api"),n=Zp("http://localhost:8000/api",r),[s,i]=u.useState(null);return u.useEffect(()=>{(async()=>{const o=await sh(r,t);if(o.error||!o.data){console.error(o.message);return}i(o.data)})()},[t,r]),l.jsx(on.Provider,{value:{application:s,googleMapsApiKey:"AIzaSyD0g8yZAA0ZaqaLsrRkGmDQdFbhCEAPdYs",clientId:"docuNxInnND1MUSqVr3ROV8ms986ZRjnbyA77ypt",clientSecret:"0SAgl6C4IsMObrysxXHG6npwGyH8jgIkiMtLoGD6Pchu1tBGPZvIZjmjYmAo3pItBoIqOHipjkQNcI03URn1i7LgtaAsDOHFSdv3suDFz9J3kS8WHMnq0tE1Lg1advs7",api:n,basicApi:r},children:e})};var el="persist:",tl="persist/FLUSH",Hi="persist/REHYDRATE",rl="persist/PAUSE",nl="persist/PERSIST",sl="persist/PURGE",il="persist/REGISTER",y_=-1;function Nn(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Nn=function(r){return typeof r}:Nn=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Nn(e)}function ad(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function x_(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ad(r,!0).forEach(function(n){b_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ad(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function b_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w_(e,t,r,n){var s=n.debug,i=x_({},r);return e&&Nn(e)==="object"&&Object.keys(e).forEach(function(a){if(a!=="_persist"){if(t[a]!==r[a]){process.env.NODE_ENV!=="production"&&s&&console.log("redux-persist/stateReconciler: sub state for key `%s` modified, skipping.",a);return}i[a]=e[a]}}),process.env.NODE_ENV!=="production"&&s&&e&&Nn(e)==="object"&&console.log("redux-persist/stateReconciler: rehydrated keys '".concat(Object.keys(e).join(", "),"'")),i}function E_(e){var t=e.blacklist||null,r=e.whitelist||null,n=e.transforms||[],s=e.throttle||0,i="".concat(e.keyPrefix!==void 0?e.keyPrefix:el).concat(e.key),a=e.storage,o;e.serialize===!1?o=function(v){return v}:typeof e.serialize=="function"?o=e.serialize:o=S_;var c=e.writeFailHandler||null,d={},f={},h=[],p=null,g=null,m=function(v){Object.keys(v).forEach(function(b){w(b)&&d[b]!==v[b]&&h.indexOf(b)===-1&&h.push(b)}),Object.keys(d).forEach(function(b){v[b]===void 0&&w(b)&&h.indexOf(b)===-1&&d[b]!==void 0&&h.push(b)}),p===null&&(p=setInterval(x,s)),d=v};function x(){if(h.length===0){p&&clearInterval(p),p=null;return}var E=h.shift(),v=n.reduce(function(b,k){return k.in(b,E,d)},d[E]);if(v!==void 0)try{f[E]=o(v)}catch(b){console.error("redux-persist/createPersistoid: error serializing state",b)}else delete f[E];h.length===0&&y()}function y(){Object.keys(f).forEach(function(E){d[E]===void 0&&delete f[E]}),g=a.setItem(i,o(f)).catch(O)}function w(E){return!(r&&r.indexOf(E)===-1&&E!=="_persist"||t&&t.indexOf(E)!==-1)}function O(E){c&&c(E),E&&process.env.NODE_ENV!=="production"&&console.error("Error storing data",E)}var S=function(){for(;h.length!==0;)x();return g||Promise.resolve()};return{update:m,flush:S}}function S_(e){return JSON.stringify(e)}function k_(e){var t=e.transforms||[],r="".concat(e.keyPrefix!==void 0?e.keyPrefix:el).concat(e.key),n=e.storage,s=e.debug,i;return e.deserialize===!1?i=function(o){return o}:typeof e.deserialize=="function"?i=e.deserialize:i=O_,n.getItem(r).then(function(a){if(a)try{var o={},c=i(a);return Object.keys(c).forEach(function(d){o[d]=t.reduceRight(function(f,h){return h.out(f,d,c)},i(c[d]))}),o}catch(d){throw process.env.NODE_ENV!=="production"&&s&&console.log("redux-persist/getStoredState: Error restoring data ".concat(a),d),d}else return})}function O_(e){return JSON.parse(e)}function __(e){var t=e.storage,r="".concat(e.keyPrefix!==void 0?e.keyPrefix:el).concat(e.key);return t.removeItem(r,C_)}function C_(e){e&&process.env.NODE_ENV!=="production"&&console.error("redux-persist/purgeStoredState: Error purging data stored state",e)}function od(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function jt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?od(r,!0).forEach(function(n){L_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):od(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function L_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function N_(e,t){if(e==null)return{};var r=j_(e,t),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(s=0;s<i.length;s++)n=i[s],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function j_(e,t){if(e==null)return{};var r={},n=Object.keys(e),s,i;for(i=0;i<n.length;i++)s=n[i],!(t.indexOf(s)>=0)&&(r[s]=e[s]);return r}var M_=5e3;function T_(e,t){if(process.env.NODE_ENV!=="production"){if(!e)throw new Error("config is required for persistReducer");if(!e.key)throw new Error("key is required in persistor config");if(!e.storage)throw new Error("redux-persist: config.storage is required. Try using one of the provided storage engines `import storage from 'redux-persist/lib/storage'`")}var r=e.version!==void 0?e.version:y_;e.debug;var n=e.stateReconciler===void 0?w_:e.stateReconciler,s=e.getStoredState||k_,i=e.timeout!==void 0?e.timeout:M_,a=null,o=!1,c=!0,d=function(h){return h._persist.rehydrated&&a&&!c&&a.update(h),h};return function(f,h){var p=f||{},g=p._persist,m=N_(p,["_persist"]),x=m;if(h.type===nl){var y=!1,w=function(C,_){process.env.NODE_ENV!=="production"&&y&&console.error('redux-persist: rehydrate for "'.concat(e.key,'" called after timeout.'),C,_),y||(h.rehydrate(e.key,C,_),y=!0)};if(i&&setTimeout(function(){!y&&w(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},i),c=!1,a||(a=E_(e)),g)return jt({},t(x,h),{_persist:g});if(typeof h.rehydrate!="function"||typeof h.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return h.register(e.key),s(e).then(function(k){var C=e.migrate||function(_,M){return Promise.resolve(_)};C(k,r).then(function(_){w(_)},function(_){process.env.NODE_ENV!=="production"&&_&&console.error("redux-persist: migration error",_),w(void 0,_)})},function(k){w(void 0,k)}),jt({},t(x,h),{_persist:{version:r,rehydrated:!1}})}else{if(h.type===sl)return o=!0,h.result(__(e)),jt({},t(x,h),{_persist:g});if(h.type===tl)return h.result(a&&a.flush()),jt({},t(x,h),{_persist:g});if(h.type===rl)c=!0;else if(h.type===Hi){if(o)return jt({},x,{_persist:jt({},g,{rehydrated:!0})});if(h.key===e.key){var O=t(x,h),S=h.payload,E=n!==!1&&S!==void 0?n(S,f,O,e):O,v=jt({},E,{_persist:jt({},g,{rehydrated:!0})});return d(v)}}}if(!g)return t(f,h);var b=t(x,h);return b===x?f:d(jt({},b,{_persist:g}))}}function ld(e){return A_(e)||P_(e)||D_()}function D_(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function P_(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function A_(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}function cd(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),r.push.apply(r,n)}return r}function eo(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?cd(r,!0).forEach(function(n){R_(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):cd(r).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function R_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Jp={registry:[],bootstrapped:!1},I_=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Jp,r=arguments.length>1?arguments[1]:void 0;switch(r.type){case il:return eo({},t,{registry:[].concat(ld(t.registry),[r.key])});case Hi:var n=t.registry.indexOf(r.key),s=ld(t.registry);return s.splice(n,1),eo({},t,{registry:s,bootstrapped:s.length===0});default:return t}};function F_(e,t,r){if(process.env.NODE_ENV!=="production"){var n={},s=["blacklist","whitelist","transforms","storage","keyPrefix","migrate"];s.forEach(function(d){n[d]&&console.error('redux-persist: invalid option passed to persistStore: "'.concat(d,'". You may be incorrectly passing persistConfig into persistStore, whereas it should be passed into persistReducer.'))})}var i=_o(I_,Jp,void 0),a=function(f){i.dispatch({type:il,key:f})},o=function(f,h,p){var g={type:Hi,payload:h,err:p,key:f};e.dispatch(g),i.dispatch(g)},c=eo({},i,{purge:function(){var f=[];return e.dispatch({type:sl,result:function(p){f.push(p)}}),Promise.all(f)},flush:function(){var f=[];return e.dispatch({type:tl,result:function(p){f.push(p)}}),Promise.all(f)},pause:function(){e.dispatch({type:rl})},persist:function(){e.dispatch({type:nl,register:a,rehydrate:o})}});return c.persist(),c}var Cs={},Ls={},ud;function $_(){if(ud)return Ls;ud=1,Ls.__esModule=!0,Ls.default=s;function e(i){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=function(o){return typeof o}:e=function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},e(i)}function t(){}var r={getItem:t,setItem:t,removeItem:t};function n(i){if((typeof self>"u"?"undefined":e(self))!=="object"||!(i in self))return!1;try{var a=self[i],o="redux-persist ".concat(i," test");a.setItem(o,"test"),a.getItem(o),a.removeItem(o)}catch{return process.env.NODE_ENV!=="production"&&console.warn("redux-persist ".concat(i," test failed, persistence will be disabled.")),!1}return!0}function s(i){var a="".concat(i,"Storage");return n(a)?self[a]:(process.env.NODE_ENV!=="production"&&console.error("redux-persist failed to create sync storage. falling back to noop storage."),r)}return Ls}var dd;function U_(){if(dd)return Cs;dd=1,Cs.__esModule=!0,Cs.default=r;var e=t($_());function t(n){return n&&n.__esModule?n:{default:n}}function r(n){var s=(0,e.default)(n);return{getItem:function(a){return new Promise(function(o,c){o(s.getItem(a))})},setItem:function(a,o){return new Promise(function(c,d){c(s.setItem(a,o))})},removeItem:function(a){return new Promise(function(o,c){o(s.removeItem(a))})}}}return Cs}var V_=U_();const z_=to(V_),B_=()=>({getItem(e){return Promise.resolve(null)},setItem(e,t){return Promise.resolve(t)},removeItem(e){return Promise.resolve()}}),W_=typeof window<"u"?z_("local"):B_(),Y_={key:"persist",storage:W_},Xp=dh({auth:NE}),H_=()=>jh({reducer:Xp}),G_=()=>{if(typeof window>"u")return H_();{const t=T_(Y_,Xp),r=jh({reducer:t,middleware:n=>n({serializableCheck:{ignoredActions:[tl,Hi,rl,nl,sl,il]}})});return r.__persistor=F_(r),r}};exports.AccountForm=Ra;exports.AnimatedCollapse=_d;exports.AppContext=on;exports.AppProvider=v_;exports.AuthContext=go;exports.Badge=Zr;exports.Button=so;exports.CategoryTypeID=Tp;exports.Checkbox=mi;exports.ConsigneeType=rr;exports.DeliveryTypeID=Ie;exports.ErrorCard=En;exports.ForgotPassword=Nw;exports.GoogleMap=Kd;exports.InputCheckboxSelect=Wy;exports.InputDate=Yy;exports.InputFile=Hy;exports.InputFileDrop=Gy;exports.InputGoogleMap=Cf;exports.InputInteger=Lf;exports.InputLocationSelect=Qy;exports.InputRadioSelect=ei;exports.InputSelect=ct;exports.InputSelectGrouped=ex;exports.InputText=Be;exports.InputTextArea=tx;exports.InvoiceStatus=Mp;exports.InvoiceSummary=Pp;exports.InvoiceSummaryList=Ap;exports.InvoiceType=Ln;exports.Link=Ae;exports.LoadingSpinner=gi;exports.Login=WE;exports.Modal=Xs;exports.ParcelForm=l_;exports.ParcelRow=Rp;exports.ParcelTable=Ip;exports.PaymentModeID=Qo;exports.Popover=Jd;exports.PopoverMenu=B0;exports.PrimaryButton=rt;exports.SecondaryButton=Tn;exports.Separator=Kr;exports.ServiceID=Pt;exports.ShipmentAccountSummary=Qa;exports.ShipmentAddresses=Fp;exports.ShipmentAddressesForm=Up;exports.ShipmentDeliveryData=Vp;exports.ShipmentDetails=d_;exports.ShipmentDocument=Gp;exports.ShipmentForm=p_;exports.ShipmentItemRow=Bp;exports.ShipmentItemTable=Wp;exports.ShipmentPartiesForm=qp;exports.ShipmentStatusID=gr;exports.ShipmentSummary=zp;exports.SideMenu=zy;exports.Switch=W0;exports.Table=vi;exports.TrackingRow=Yp;exports.TrackingTable=Hp;exports.WarningCard=Xd;exports.getApplication=sh;exports.getCategories=ch;exports.getCountries=ah;exports.getTaxIdentificationTypes=ih;exports.getToken=oh;exports.makeStore=G_;exports.refreshToken=lh;exports.shipmentInitialValues=Dp;exports.useApi=Zp;exports.useAppDispatch=Ih;exports.useAppSelector=zE;exports.useAppStore=Fh;exports.useBasicApi=Kp;
|
|
@@ -14191,7 +14191,7 @@ function Ne(e) {
|
|
|
14191
14191
|
return `Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `;
|
|
14192
14192
|
}
|
|
14193
14193
|
const pk = {
|
|
14194
|
-
|
|
14194
|
+
isAuthenticated: !1,
|
|
14195
14195
|
user: null,
|
|
14196
14196
|
accessToken: null,
|
|
14197
14197
|
refreshToken: null
|
|
@@ -14206,7 +14206,7 @@ const pk = {
|
|
|
14206
14206
|
* @param action - The action containing the login response.
|
|
14207
14207
|
*/
|
|
14208
14208
|
login: (e, t) => {
|
|
14209
|
-
e.
|
|
14209
|
+
e.isAuthenticated = !0, e.user = t.payload.user, e.accessToken = t.payload.accessToken, e.refreshToken = t.payload.refreshToken;
|
|
14210
14210
|
},
|
|
14211
14211
|
/**
|
|
14212
14212
|
* Logs the user out.
|
|
@@ -14214,7 +14214,7 @@ const pk = {
|
|
|
14214
14214
|
* @param state - The current state.
|
|
14215
14215
|
*/
|
|
14216
14216
|
logout: (e) => {
|
|
14217
|
-
e.
|
|
14217
|
+
e.isAuthenticated = !1, e.user = null, e.accessToken = null, e.refreshToken = null;
|
|
14218
14218
|
}
|
|
14219
14219
|
}
|
|
14220
14220
|
}), { login: Ih, logout: CL } = Rh.actions, gk = Rh.reducer;
|
|
@@ -19392,7 +19392,7 @@ const B_ = /* @__PURE__ */ fo(z_), W_ = () => ({
|
|
|
19392
19392
|
key: "persist",
|
|
19393
19393
|
storage: Y_
|
|
19394
19394
|
}, Rp = ph({
|
|
19395
|
-
|
|
19395
|
+
auth: gk
|
|
19396
19396
|
}), G_ = () => Ph({
|
|
19397
19397
|
reducer: Rp
|
|
19398
19398
|
}), RL = () => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tealca/core-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.23",
|
|
5
5
|
"description": "A collection of shared UI components for Tealca's applications.",
|
|
6
6
|
"main": "dist/tealca-core-components.cjs.js",
|
|
7
7
|
"module": "dist/tealca-core-components.es.js",
|