@infinityloop.labs/frontend-modules 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/frontend-modules/src/features/services/auth/container/index.d.ts +34 -0
- package/dist/frontend-modules/src/features/services/auth/index.d.ts +4 -1
- package/dist/frontend-modules/src/index.d.ts +1 -0
- package/dist/index.es.js +1549 -1530
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +11 -10
- package/dist/index.umd.js.map +1 -0
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
(function(N,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("@reduxjs/toolkit"),require("react-redux"),require("react"),require("@infinityloop.labs/utils"),require("@infinityloop.labs/event-bus"),require("@infinityloop.labs/routing"),require("react-router"),require("@generated/hooks/auth")):typeof define=="function"&&define.amd?define(["exports","@reduxjs/toolkit","react-redux","react","@infinityloop.labs/utils","@infinityloop.labs/event-bus","@infinityloop.labs/routing","react-router","@generated/hooks/auth"],$):(N=typeof globalThis<"u"?globalThis:N||self,$((N["@infinityloop"]=N["@infinityloop"]||{},N["@infinityloop"]["labs/frontend-modules"]={}),N.ReduxToolkit,N.ReactRedux,N.React,N.InfinityloopLabsUtils,N.InfinityloopLabsEventBus,N.InfinityloopLabsRouting,N.ReactRouter,N.GeneratedAuthHooks))})(this,function(N,$,L,k,de,ie,Gt,$s,Nn){"use strict";var nu=Object.defineProperty;var ru=(N,$,L)=>$ in N?nu(N,$,{enumerable:!0,configurable:!0,writable:!0,value:L}):N[$]=L;var Ds=(N,$,L)=>(ru(N,typeof $!="symbol"?$+"":$,L),L);var Zt=Symbol.for("immer-nothing"),Be=Symbol.for("immer-draftable"),X=Symbol.for("immer-state"),Mn=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Y(e,...t){if(process.env.NODE_ENV!=="production"){const n=Mn[e],r=_e(n)?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var re=Object,Ie=re.getPrototypeOf,We="constructor",Ge="prototype",Yt="configurable",mt="enumerable",gt="writable",Ze="value",oe=e=>!!e&&!!e[X];function ce(e){var t;return e?Rn(e)||Xe(e)||!!e[Be]||!!((t=e[We])!=null&&t[Be])||et(e)||tt(e):!1}var Cs=re[Ge][We].toString(),kn=new WeakMap;function Rn(e){if(!e||!je(e))return!1;const t=Ie(e);if(t===null||t===re[Ge])return!0;const n=re.hasOwnProperty.call(t,We)&&t[We];if(n===Object)return!0;if(!_e(n))return!1;let r=kn.get(n);return r===void 0&&(r=Function.toString.call(n),kn.set(n,r)),r===Cs}function xs(e){return oe(e)||Y(15,e),e[X].base_}function Ye(e,t,n=!0){Fe(e)===0?(n?Reflect.ownKeys(e):re.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((r,s)=>t(s,r,e))}function Fe(e){const t=e[X];return t?t.type_:Xe(e)?1:et(e)?2:tt(e)?3:0}var Je=(e,t,n=Fe(e))=>n===2?e.has(t):re[Ge].hasOwnProperty.call(e,t),me=(e,t,n=Fe(e))=>n===2?e.get(t):e[t],bt=(e,t,n,r=Fe(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Ns(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Xe=Array.isArray,et=e=>e instanceof Map,tt=e=>e instanceof Set,je=e=>typeof e=="object",_e=e=>typeof e=="function",Jt=e=>typeof e=="boolean";function Ms(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ks=e=>je(e)?e==null?void 0:e[X]:null,ge=e=>e.copy_||e.base_,Xt=e=>e.modified_?e.copy_:e.base_;function en(e,t){if(et(e))return new Map(e);if(tt(e))return new Set(e);if(Xe(e))return Array[Ge].slice.call(e);const n=Rn(e);if(t===!0||t==="class_only"&&!n){const r=re.getOwnPropertyDescriptors(e);delete r[X];let s=Reflect.ownKeys(r);for(let i=0;i<s.length;i++){const o=s[i],a=r[o];a[gt]===!1&&(a[gt]=!0,a[Yt]=!0),(a.get||a.set)&&(r[o]={[Yt]:!0,[gt]:!0,[mt]:a[mt],[Ze]:e[o]})}return re.create(Ie(e),r)}else{const r=Ie(e);if(r!==null&&n)return{...e};const s=re.create(r);return re.assign(s,e)}}function tn(e,t=!1){return vt(e)||oe(e)||!ce(e)||(Fe(e)>1&&re.defineProperties(e,{set:St,add:St,clear:St,delete:St}),re.freeze(e),t&&Ye(e,(n,r)=>{tn(r,!0)},!1)),e}function Rs(){Y(2)}var St={[Ze]:Rs};function vt(e){return e===null||!je(e)?!0:re.isFrozen(e)}var Et="MapSet",_t="Patches",jn="ArrayMethods",wt={};function De(e){const t=wt[e];return t||Y(0,e),t}var zn=e=>!!wt[e];function js(e,t){wt[e]||(wt[e]=t)}var nt,Qn=()=>nt,zs=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:zn(Et)?De(Et):void 0,arrayMethodsPlugin_:zn(jn)?De(jn):void 0});function qn(e,t){t&&(e.patchPlugin_=De(_t),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function nn(e){rn(e),e.drafts_.forEach(Qs),e.drafts_=null}function rn(e){e===nt&&(nt=e.parent_)}var Ln=e=>nt=zs(nt,e);function Qs(e){const t=e[X];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Un(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[X].modified_&&(nn(t),Y(4)),ce(e)&&(e=Vn(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(n[X].base_,e,t)}else e=Vn(t,n);return qs(t,e,!0),nn(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Zt?e:void 0}function Vn(e,t){if(vt(t))return t;const n=t[X];if(!n)return Ot(t,e.handledSet_,e);if(!At(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);Bn(n,e)}return n.copy_}function qs(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&tn(t,n)}function Kn(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var At=(e,t)=>e.scope_===t,Ls=[];function Hn(e,t,n,r){const s=ge(e),i=e.type_;if(r!==void 0&&me(s,r,i)===t){bt(s,r,n,i);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;Ye(s,(h,p)=>{if(oe(p)){const _=a.get(p)||[];_.push(h),a.set(p,_)}})}const o=e.draftLocations_.get(t)??Ls;for(const a of o)bt(s,a,n,i)}function Us(e,t,n){e.callbacks_.push(function(s){var a;const i=t;if(!i||!At(i,s))return;(a=s.mapSetPlugin_)==null||a.fixSetContents(i);const o=Xt(i);Hn(e,i.draft_??i,o,n),Bn(i,s)})}function Bn(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:s}=t;if(s){const i=s.getPath(e);i&&s.generatePatches_(e,i,t)}Kn(e)}}function Vs(e,t,n){const{scope_:r}=e;if(oe(n)){const s=n[X];At(s,r)&&s.callbacks_.push(function(){Pt(e);const o=Xt(s);Hn(e,n,o,t)})}else ce(n)&&e.callbacks_.push(function(){const i=ge(e);e.type_===3?i.has(n)&&Ot(n,r.handledSet_,r):me(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ot(me(e.copy_,t,e.type_),r.handledSet_,r)})}function Ot(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||oe(e)||t.has(e)||!ce(e)||vt(e)||(t.add(e),Ye(e,(r,s)=>{if(oe(s)){const i=s[X];if(At(i,n)){const o=Xt(i);bt(e,r,o,e.type_),Kn(i)}}else ce(s)&&Ot(s,t,n)})),e}function Ks(e,t){const n=Xe(e),r={type_:n?1:0,scope_:t?t.scope_:Qn(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let s=r,i=Tt;n&&(s=[r],i=rt);const{revoke:o,proxy:a}=Proxy.revocable(s,i);return r.draft_=a,r.revoke_=o,[a,r]}var Tt={get(e,t){if(t===X)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const s=ge(e);if(!Je(s,t,e.type_))return Hs(e,s,t);const i=s[t];if(e.finalized_||!ce(i)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&Ms(t))return i;if(i===sn(e.base_,t)){Pt(e);const o=e.type_===1?+t:t,a=an(e.scope_,i,e,o);return e.copy_[o]=a}return i},has(e,t){return t in ge(e)},ownKeys(e){return Reflect.ownKeys(ge(e))},set(e,t,n){const r=Wn(ge(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const s=sn(ge(e),t),i=s==null?void 0:s[X];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Ns(n,s)&&(n!==void 0||Je(e.base_,t,e.type_)))return!0;Pt(e),on(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Vs(e,t,n)),!0},deleteProperty(e,t){return Pt(e),sn(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),on(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ge(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[gt]:!0,[Yt]:e.type_!==1||t!=="length",[mt]:r[mt],[Ze]:n[t]}},defineProperty(){Y(11)},getPrototypeOf(e){return Ie(e.base_)},setPrototypeOf(){Y(12)}},rt={};for(let e in Tt){let t=Tt[e];rt[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}rt.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Y(13),rt.set.call(this,e,t,void 0)},rt.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Y(14),Tt.set.call(this,e[0],t,n,e[0])};function sn(e,t){const n=e[X];return(n?ge(n):e)[t]}function Hs(e,t,n){var s;const r=Wn(t,n);return r?Ze in r?r[Ze]:(s=r.get)==null?void 0:s.call(e.draft_):void 0}function Wn(e,t){if(!(t in e))return;let n=Ie(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ie(n)}}function on(e){e.modified_||(e.modified_=!0,e.parent_&&on(e.parent_))}function Pt(e){e.copy_||(e.assigned_=new Map,e.copy_=en(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Bs=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(_e(t)&&!_e(n)){const i=n;n=t;const o=this;return function(h=i,...p){return o.produce(h,_=>n.call(this,_,...p))}}_e(n)||Y(6),r!==void 0&&!_e(r)&&Y(7);let s;if(ce(t)){const i=Ln(this),o=an(i,t,void 0);let a=!0;try{s=n(o),a=!1}finally{a?nn(i):rn(i)}return qn(i,r),Un(s,i)}else if(!t||!je(t)){if(s=n(t),s===void 0&&(s=t),s===Zt&&(s=void 0),this.autoFreeze_&&tn(s,!0),r){const i=[],o=[];De(_t).generateReplacementPatches_(t,s,{patches_:i,inversePatches_:o}),r(i,o)}return s}else Y(1,t)},this.produceWithPatches=(t,n)=>{if(_e(t))return(o,...a)=>this.produceWithPatches(o,h=>t(h,...a));let r,s;return[this.produce(t,n,(o,a)=>{r=o,s=a}),r,s]},Jt(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Jt(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Jt(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ce(e)||Y(8),oe(e)&&(e=Gn(e));const t=Ln(this),n=an(t,e,void 0);return n[X].isManual_=!0,rn(t),n}finishDraft(e,t){const n=e&&e[X];(!n||!n.isManual_)&&Y(9);const{scope_:r}=n;return qn(r,t),Un(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const r=De(_t).applyPatches_;return oe(e)?r(e,t):this.produce(e,s=>r(s,t))}};function an(e,t,n,r){const[s,i]=et(t)?De(Et).proxyMap_(t,n):tt(t)?De(Et).proxySet_(t,n):Ks(t,n);return((n==null?void 0:n.scope_)??Qn()).drafts_.push(s),i.callbacks_=(n==null?void 0:n.callbacks_)??[],i.key_=r,n&&r!==void 0?Us(n,i,r):i.callbacks_.push(function(h){var _;(_=h.mapSetPlugin_)==null||_.fixSetContents(i);const{patchPlugin_:p}=h;i.modified_&&p&&p.generatePatches_(i,[],h)}),s}function Gn(e){return oe(e)||Y(10,e),Zn(e)}function Zn(e){if(!ce(e)||vt(e))return e;const t=e[X];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=en(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=en(e,!0);return Ye(n,(s,i)=>{bt(n,s,Zn(i))},r),t&&(t.finalized_=!1),n}function Ws(){process.env.NODE_ENV!=="production"&&Mn.push('Sets cannot have "replace" patches.',function(g){return"Unsupported patch operation: "+g},function(g){return"Cannot apply patch, path doesn't resolve: "+g},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");function t(g,E=[]){if(g.key_!==void 0){const y=g.parent_.copy_??g.parent_.base_,P=ks(me(y,g.key_)),D=me(y,g.key_);if(D===void 0||D!==g.draft_&&D!==g.base_&&D!==g.copy_||P!=null&&P.base_!==g.base_)return null;const v=g.parent_.type_===3;let O;if(v){const l=g.parent_;O=Array.from(l.drafts_.keys()).indexOf(g.key_)}else O=g.key_;if(!(v&&y.size>O||Je(y,O)))return null;E.push(O)}if(g.parent_)return t(g.parent_,E);E.reverse();try{n(g.copy_,E)}catch{return null}return E}function n(g,E){let y=g;for(let P=0;P<E.length-1;P++){const D=E[P];if(y=me(y,D),!je(y)||y===null)throw new Error(`Cannot resolve path at '${E.join("/")}'`)}return y}const r="replace",s="add",i="remove";function o(g,E,y){if(g.scope_.processedForPatches_.has(g))return;g.scope_.processedForPatches_.add(g);const{patches_:P,inversePatches_:D}=y;switch(g.type_){case 0:case 2:return h(g,E,P,D);case 1:return a(g,E,P,D);case 3:return p(g,E,P,D)}}function a(g,E,y,P){let{base_:D,assigned_:v}=g,O=g.copy_;O.length<D.length&&([D,O]=[O,D],[y,P]=[P,y]);const l=g.allIndicesReassigned_===!0;for(let f=0;f<D.length;f++){const b=O[f],A=D[f];if((l||(v==null?void 0:v.get(f.toString())))&&b!==A){const d=b==null?void 0:b[X];if(d&&d.modified_)continue;const u=E.concat([f]);y.push({op:r,path:u,value:F(b)}),P.push({op:r,path:u,value:F(A)})}}for(let f=D.length;f<O.length;f++){const b=E.concat([f]);y.push({op:s,path:b,value:F(O[f])})}for(let f=O.length-1;D.length<=f;--f){const b=E.concat([f]);P.push({op:i,path:b})}}function h(g,E,y,P){const{base_:D,copy_:v,type_:O}=g;Ye(g.assigned_,(l,f)=>{const b=me(D,l,O),A=me(v,l,O),m=f?Je(D,l)?r:s:i;if(b===A&&m===r)return;const d=E.concat(l);y.push(m===i?{op:m,path:d}:{op:m,path:d,value:F(A)}),P.push(m===s?{op:i,path:d}:m===i?{op:s,path:d,value:F(b)}:{op:r,path:d,value:F(b)})})}function p(g,E,y,P){let{base_:D,copy_:v}=g,O=0;D.forEach(l=>{if(!v.has(l)){const f=E.concat([O]);y.push({op:i,path:f,value:l}),P.unshift({op:s,path:f,value:l})}O++}),O=0,v.forEach(l=>{if(!D.has(l)){const f=E.concat([O]);y.push({op:s,path:f,value:l}),P.unshift({op:i,path:f,value:l})}O++})}function _(g,E,y){const{patches_:P,inversePatches_:D}=y;P.push({op:r,path:[],value:E===Zt?void 0:E}),D.push({op:r,path:[],value:g})}function T(g,E){return E.forEach(y=>{const{path:P,op:D}=y;let v=g;for(let b=0;b<P.length-1;b++){const A=Fe(v);let m=P[b];typeof m!="string"&&typeof m!="number"&&(m=""+m),(A===0||A===1)&&(m==="__proto__"||m===We)&&Y(16+3),_e(v)&&m===Ge&&Y(16+3),v=me(v,m),je(v)||Y(16+2,P.join("/"))}const O=Fe(v),l=I(y.value),f=P[P.length-1];switch(D){case r:switch(O){case 2:return v.set(f,l);case 3:Y(16);default:return v[f]=l}case s:switch(O){case 1:return f==="-"?v.push(l):v.splice(f,0,l);case 2:return v.set(f,l);case 3:return v.add(l);default:return v[f]=l}case i:switch(O){case 1:return v.splice(f,1);case 2:return v.delete(f);case 3:return v.delete(y.value);default:return delete v[f]}default:Y(16+1,D)}}),g}function I(g){if(!ce(g))return g;if(Xe(g))return g.map(I);if(et(g))return new Map(Array.from(g.entries()).map(([y,P])=>[y,I(P)]));if(tt(g))return new Set(Array.from(g).map(I));const E=Object.create(Ie(g));for(const y in g)E[y]=I(g[y]);return Je(g,Be)&&(E[Be]=g[Be]),E}function F(g){return oe(g)?I(g):g}js(_t,{applyPatches_:T,generatePatches_:o,generateReplacementPatches_:_,getPath:t})}var st=new Bs;st.produce;var Yn=st.produceWithPatches.bind(st),Jn=st.applyPatches.bind(st),Gs=class extends Error{constructor(t){super(t[0].message);Ds(this,"issues");this.name="SchemaError",this.issues=t}},Zs=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const s={};e(s)===s&&(r=!0)}catch{}if(r){let s;try{throw new Error}catch(i){({stack:s}=i)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
1
|
+
(function(N,$){typeof exports=="object"&&typeof module<"u"?$(exports,require("@reduxjs/toolkit"),require("react-redux"),require("react"),require("@infinityloop.labs/utils"),require("@infinityloop.labs/event-bus"),require("@infinityloop.labs/routing"),require("react-router")):typeof define=="function"&&define.amd?define(["exports","@reduxjs/toolkit","react-redux","react","@infinityloop.labs/utils","@infinityloop.labs/event-bus","@infinityloop.labs/routing","react-router"],$):(N=typeof globalThis<"u"?globalThis:N||self,$((N["@infinityloop"]=N["@infinityloop"]||{},N["@infinityloop"]["labs/frontend-modules"]={}),N.ReduxToolkit,N.ReactRedux,N.React,N.InfinityloopLabsUtils,N.InfinityloopLabsEventBus,N.InfinityloopLabsRouting,N.ReactRouter))})(this,function(N,$,L,k,de,ie,Gt,$s){"use strict";var ru=Object.defineProperty;var su=(N,$,L)=>$ in N?ru(N,$,{enumerable:!0,configurable:!0,writable:!0,value:L}):N[$]=L;var Fs=(N,$,L)=>(su(N,typeof $!="symbol"?$+"":$,L),L);var Zt=Symbol.for("immer-nothing"),Be=Symbol.for("immer-draftable"),X=Symbol.for("immer-state"),Nn=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function Y(e,...t){if(process.env.NODE_ENV!=="production"){const n=Nn[e],r=_e(n)?n.apply(null,t):n;throw new Error(`[Immer] ${r}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var re=Object,Ie=re.getPrototypeOf,We="constructor",Ge="prototype",Yt="configurable",mt="enumerable",gt="writable",Ze="value",oe=e=>!!e&&!!e[X];function ce(e){var t;return e?kn(e)||Xe(e)||!!e[Be]||!!((t=e[We])!=null&&t[Be])||et(e)||tt(e):!1}var Cs=re[Ge][We].toString(),Mn=new WeakMap;function kn(e){if(!e||!je(e))return!1;const t=Ie(e);if(t===null||t===re[Ge])return!0;const n=re.hasOwnProperty.call(t,We)&&t[We];if(n===Object)return!0;if(!_e(n))return!1;let r=Mn.get(n);return r===void 0&&(r=Function.toString.call(n),Mn.set(n,r)),r===Cs}function xs(e){return oe(e)||Y(15,e),e[X].base_}function Ye(e,t,n=!0){De(e)===0?(n?Reflect.ownKeys(e):re.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((r,s)=>t(s,r,e))}function De(e){const t=e[X];return t?t.type_:Xe(e)?1:et(e)?2:tt(e)?3:0}var Je=(e,t,n=De(e))=>n===2?e.has(t):re[Ge].hasOwnProperty.call(e,t),me=(e,t,n=De(e))=>n===2?e.get(t):e[t],bt=(e,t,n,r=De(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Ns(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Xe=Array.isArray,et=e=>e instanceof Map,tt=e=>e instanceof Set,je=e=>typeof e=="object",_e=e=>typeof e=="function",Jt=e=>typeof e=="boolean";function Ms(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var ks=e=>je(e)?e==null?void 0:e[X]:null,ge=e=>e.copy_||e.base_,Xt=e=>e.modified_?e.copy_:e.base_;function en(e,t){if(et(e))return new Map(e);if(tt(e))return new Set(e);if(Xe(e))return Array[Ge].slice.call(e);const n=kn(e);if(t===!0||t==="class_only"&&!n){const r=re.getOwnPropertyDescriptors(e);delete r[X];let s=Reflect.ownKeys(r);for(let i=0;i<s.length;i++){const o=s[i],a=r[o];a[gt]===!1&&(a[gt]=!0,a[Yt]=!0),(a.get||a.set)&&(r[o]={[Yt]:!0,[gt]:!0,[mt]:a[mt],[Ze]:e[o]})}return re.create(Ie(e),r)}else{const r=Ie(e);if(r!==null&&n)return{...e};const s=re.create(r);return re.assign(s,e)}}function tn(e,t=!1){return vt(e)||oe(e)||!ce(e)||(De(e)>1&&re.defineProperties(e,{set:St,add:St,clear:St,delete:St}),re.freeze(e),t&&Ye(e,(n,r)=>{tn(r,!0)},!1)),e}function Rs(){Y(2)}var St={[Ze]:Rs};function vt(e){return e===null||!je(e)?!0:re.isFrozen(e)}var Et="MapSet",_t="Patches",Rn="ArrayMethods",wt={};function Fe(e){const t=wt[e];return t||Y(0,e),t}var jn=e=>!!wt[e];function js(e,t){wt[e]||(wt[e]=t)}var nt,zn=()=>nt,zs=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:jn(Et)?Fe(Et):void 0,arrayMethodsPlugin_:jn(Rn)?Fe(Rn):void 0});function Qn(e,t){t&&(e.patchPlugin_=Fe(_t),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function nn(e){rn(e),e.drafts_.forEach(Qs),e.drafts_=null}function rn(e){e===nt&&(nt=e.parent_)}var qn=e=>nt=zs(nt,e);function Qs(e){const t=e[X];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ln(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[X].modified_&&(nn(t),Y(4)),ce(e)&&(e=Un(t,e));const{patchPlugin_:s}=t;s&&s.generateReplacementPatches_(n[X].base_,e,t)}else e=Un(t,n);return qs(t,e,!0),nn(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Zt?e:void 0}function Un(e,t){if(vt(t))return t;const n=t[X];if(!n)return Ot(t,e.handledSet_,e);if(!At(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);Hn(n,e)}return n.copy_}function qs(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&tn(t,n)}function Vn(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var At=(e,t)=>e.scope_===t,Ls=[];function Kn(e,t,n,r){const s=ge(e),i=e.type_;if(r!==void 0&&me(s,r,i)===t){bt(s,r,n,i);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;Ye(s,(h,y)=>{if(oe(y)){const E=a.get(y)||[];E.push(h),a.set(y,E)}})}const o=e.draftLocations_.get(t)??Ls;for(const a of o)bt(s,a,n,i)}function Us(e,t,n){e.callbacks_.push(function(s){var a;const i=t;if(!i||!At(i,s))return;(a=s.mapSetPlugin_)==null||a.fixSetContents(i);const o=Xt(i);Kn(e,i.draft_??i,o,n),Hn(i,s)})}function Hn(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:s}=t;if(s){const i=s.getPath(e);i&&s.generatePatches_(e,i,t)}Vn(e)}}function Vs(e,t,n){const{scope_:r}=e;if(oe(n)){const s=n[X];At(s,r)&&s.callbacks_.push(function(){Pt(e);const o=Xt(s);Kn(e,n,o,t)})}else ce(n)&&e.callbacks_.push(function(){const i=ge(e);e.type_===3?i.has(n)&&Ot(n,r.handledSet_,r):me(i,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Ot(me(e.copy_,t,e.type_),r.handledSet_,r)})}function Ot(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||oe(e)||t.has(e)||!ce(e)||vt(e)||(t.add(e),Ye(e,(r,s)=>{if(oe(s)){const i=s[X];if(At(i,n)){const o=Xt(i);bt(e,r,o,e.type_),Vn(i)}}else ce(s)&&Ot(s,t,n)})),e}function Ks(e,t){const n=Xe(e),r={type_:n?1:0,scope_:t?t.scope_:zn(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let s=r,i=Tt;n&&(s=[r],i=rt);const{revoke:o,proxy:a}=Proxy.revocable(s,i);return r.draft_=a,r.revoke_=o,[a,r]}var Tt={get(e,t){if(t===X)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const s=ge(e);if(!Je(s,t,e.type_))return Hs(e,s,t);const i=s[t];if(e.finalized_||!ce(i)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&Ms(t))return i;if(i===sn(e.base_,t)){Pt(e);const o=e.type_===1?+t:t,a=an(e.scope_,i,e,o);return e.copy_[o]=a}return i},has(e,t){return t in ge(e)},ownKeys(e){return Reflect.ownKeys(ge(e))},set(e,t,n){const r=Bn(ge(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const s=sn(ge(e),t),i=s==null?void 0:s[X];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Ns(n,s)&&(n!==void 0||Je(e.base_,t,e.type_)))return!0;Pt(e),on(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Vs(e,t,n)),!0},deleteProperty(e,t){return Pt(e),sn(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),on(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=ge(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[gt]:!0,[Yt]:e.type_!==1||t!=="length",[mt]:r[mt],[Ze]:n[t]}},defineProperty(){Y(11)},getPrototypeOf(e){return Ie(e.base_)},setPrototypeOf(){Y(12)}},rt={};for(let e in Tt){let t=Tt[e];rt[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}rt.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&Y(13),rt.set.call(this,e,t,void 0)},rt.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&Y(14),Tt.set.call(this,e[0],t,n,e[0])};function sn(e,t){const n=e[X];return(n?ge(n):e)[t]}function Hs(e,t,n){var s;const r=Bn(t,n);return r?Ze in r?r[Ze]:(s=r.get)==null?void 0:s.call(e.draft_):void 0}function Bn(e,t){if(!(t in e))return;let n=Ie(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ie(n)}}function on(e){e.modified_||(e.modified_=!0,e.parent_&&on(e.parent_))}function Pt(e){e.copy_||(e.assigned_=new Map,e.copy_=en(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Bs=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(_e(t)&&!_e(n)){const i=n;n=t;const o=this;return function(h=i,...y){return o.produce(h,E=>n.call(this,E,...y))}}_e(n)||Y(6),r!==void 0&&!_e(r)&&Y(7);let s;if(ce(t)){const i=qn(this),o=an(i,t,void 0);let a=!0;try{s=n(o),a=!1}finally{a?nn(i):rn(i)}return Qn(i,r),Ln(s,i)}else if(!t||!je(t)){if(s=n(t),s===void 0&&(s=t),s===Zt&&(s=void 0),this.autoFreeze_&&tn(s,!0),r){const i=[],o=[];Fe(_t).generateReplacementPatches_(t,s,{patches_:i,inversePatches_:o}),r(i,o)}return s}else Y(1,t)},this.produceWithPatches=(t,n)=>{if(_e(t))return(o,...a)=>this.produceWithPatches(o,h=>t(h,...a));let r,s;return[this.produce(t,n,(o,a)=>{r=o,s=a}),r,s]},Jt(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),Jt(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),Jt(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){ce(e)||Y(8),oe(e)&&(e=Wn(e));const t=qn(this),n=an(t,e,void 0);return n[X].isManual_=!0,rn(t),n}finishDraft(e,t){const n=e&&e[X];(!n||!n.isManual_)&&Y(9);const{scope_:r}=n;return Qn(r,t),Ln(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const r=Fe(_t).applyPatches_;return oe(e)?r(e,t):this.produce(e,s=>r(s,t))}};function an(e,t,n,r){const[s,i]=et(t)?Fe(Et).proxyMap_(t,n):tt(t)?Fe(Et).proxySet_(t,n):Ks(t,n);return((n==null?void 0:n.scope_)??zn()).drafts_.push(s),i.callbacks_=(n==null?void 0:n.callbacks_)??[],i.key_=r,n&&r!==void 0?Us(n,i,r):i.callbacks_.push(function(h){var E;(E=h.mapSetPlugin_)==null||E.fixSetContents(i);const{patchPlugin_:y}=h;i.modified_&&y&&y.generatePatches_(i,[],h)}),s}function Wn(e){return oe(e)||Y(10,e),Gn(e)}function Gn(e){if(!ce(e)||vt(e))return e;const t=e[X];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=en(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=en(e,!0);return Ye(n,(s,i)=>{bt(n,s,Gn(i))},r),t&&(t.finalized_=!1),n}function Ws(){process.env.NODE_ENV!=="production"&&Nn.push('Sets cannot have "replace" patches.',function(v){return"Unsupported patch operation: "+v},function(v){return"Cannot apply patch, path doesn't resolve: "+v},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");function t(v,O=[]){if(v.key_!==void 0){const p=v.parent_.copy_??v.parent_.base_,T=ks(me(p,v.key_)),D=me(p,v.key_);if(D===void 0||D!==v.draft_&&D!==v.base_&&D!==v.copy_||T!=null&&T.base_!==v.base_)return null;const g=v.parent_.type_===3;let w;if(g){const l=v.parent_;w=Array.from(l.drafts_.keys()).indexOf(v.key_)}else w=v.key_;if(!(g&&p.size>w||Je(p,w)))return null;O.push(w)}if(v.parent_)return t(v.parent_,O);O.reverse();try{n(v.copy_,O)}catch{return null}return O}function n(v,O){let p=v;for(let T=0;T<O.length-1;T++){const D=O[T];if(p=me(p,D),!je(p)||p===null)throw new Error(`Cannot resolve path at '${O.join("/")}'`)}return p}const r="replace",s="add",i="remove";function o(v,O,p){if(v.scope_.processedForPatches_.has(v))return;v.scope_.processedForPatches_.add(v);const{patches_:T,inversePatches_:D}=p;switch(v.type_){case 0:case 2:return h(v,O,T,D);case 1:return a(v,O,T,D);case 3:return y(v,O,T,D)}}function a(v,O,p,T){let{base_:D,assigned_:g}=v,w=v.copy_;w.length<D.length&&([D,w]=[w,D],[p,T]=[T,p]);const l=v.allIndicesReassigned_===!0;for(let f=0;f<D.length;f++){const b=w[f],A=D[f];if((l||(g==null?void 0:g.get(f.toString())))&&b!==A){const d=b==null?void 0:b[X];if(d&&d.modified_)continue;const u=O.concat([f]);p.push({op:r,path:u,value:F(b)}),T.push({op:r,path:u,value:F(A)})}}for(let f=D.length;f<w.length;f++){const b=O.concat([f]);p.push({op:s,path:b,value:F(w[f])})}for(let f=w.length-1;D.length<=f;--f){const b=O.concat([f]);T.push({op:i,path:b})}}function h(v,O,p,T){const{base_:D,copy_:g,type_:w}=v;Ye(v.assigned_,(l,f)=>{const b=me(D,l,w),A=me(g,l,w),m=f?Je(D,l)?r:s:i;if(b===A&&m===r)return;const d=O.concat(l);p.push(m===i?{op:m,path:d}:{op:m,path:d,value:F(A)}),T.push(m===s?{op:i,path:d}:m===i?{op:s,path:d,value:F(b)}:{op:r,path:d,value:F(b)})})}function y(v,O,p,T){let{base_:D,copy_:g}=v,w=0;D.forEach(l=>{if(!g.has(l)){const f=O.concat([w]);p.push({op:i,path:f,value:l}),T.unshift({op:s,path:f,value:l})}w++}),w=0,g.forEach(l=>{if(!D.has(l)){const f=O.concat([w]);p.push({op:s,path:f,value:l}),T.unshift({op:i,path:f,value:l})}w++})}function E(v,O,p){const{patches_:T,inversePatches_:D}=p;T.push({op:r,path:[],value:O===Zt?void 0:O}),D.push({op:r,path:[],value:v})}function P(v,O){return O.forEach(p=>{const{path:T,op:D}=p;let g=v;for(let b=0;b<T.length-1;b++){const A=De(g);let m=T[b];typeof m!="string"&&typeof m!="number"&&(m=""+m),(A===0||A===1)&&(m==="__proto__"||m===We)&&Y(16+3),_e(g)&&m===Ge&&Y(16+3),g=me(g,m),je(g)||Y(16+2,T.join("/"))}const w=De(g),l=I(p.value),f=T[T.length-1];switch(D){case r:switch(w){case 2:return g.set(f,l);case 3:Y(16);default:return g[f]=l}case s:switch(w){case 1:return f==="-"?g.push(l):g.splice(f,0,l);case 2:return g.set(f,l);case 3:return g.add(l);default:return g[f]=l}case i:switch(w){case 1:return g.splice(f,1);case 2:return g.delete(f);case 3:return g.delete(p.value);default:return delete g[f]}default:Y(16+1,D)}}),v}function I(v){if(!ce(v))return v;if(Xe(v))return v.map(I);if(et(v))return new Map(Array.from(v.entries()).map(([p,T])=>[p,I(T)]));if(tt(v))return new Set(Array.from(v).map(I));const O=Object.create(Ie(v));for(const p in v)O[p]=I(v[p]);return Je(v,Be)&&(O[Be]=v[Be]),O}function F(v){return oe(v)?I(v):v}js(_t,{applyPatches_:P,generatePatches_:o,generateReplacementPatches_:E,getPath:t})}var st=new Bs;st.produce;var Zn=st.produceWithPatches.bind(st),Yn=st.applyPatches.bind(st),Gs=class extends Error{constructor(t){super(t[0].message);Fs(this,"issues");this.name="SchemaError",this.issues=t}},Zs=(e,t,n)=>{if(t.length===1&&t[0]===n){let r=!1;try{const s={};e(s)===s&&(r=!0)}catch{}if(r){let s;try{throw new Error}catch(i){({stack:s}=i)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
2
2
|
\`createSelector([state => state.todos], todos => todos)\`
|
|
3
3
|
This could lead to inefficient memoization and unnecessary re-renders.
|
|
4
|
-
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:s})}}},Ys=(e,t,n)=>{const{memoize:r,memoizeOptions:s}=t,{inputSelectorResults:i,inputSelectorResultsCopy:o}=e,a=r(()=>({}),...s);if(!(a.apply(null,i)===a.apply(null,o))){let
|
|
4
|
+
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:s})}}},Ys=(e,t,n)=>{const{memoize:r,memoizeOptions:s}=t,{inputSelectorResults:i,inputSelectorResultsCopy:o}=e,a=r(()=>({}),...s);if(!(a.apply(null,i)===a.apply(null,o))){let y;try{throw new Error}catch(E){({stack:y}=E)}console.warn(`An input selector returned a different result when passed same arguments.
|
|
5
5
|
This means your output selector will likely run more frequently than intended.
|
|
6
6
|
Avoid returning a new reference inside your input selector, e.g.
|
|
7
|
-
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:i,secondInputs:o,stack:p})}},Js={inputStabilityCheck:"once",identityFunctionCheck:"once"};function Xs(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ei(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function ti(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Xn=e=>Array.isArray(e)?e:[e];function ni(e){const t=Array.isArray(e[0])?e[0]:e;return ti(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function er(e,t){const n=[],{length:r}=e;for(let s=0;s<r;s++)n.push(e[s].apply(null,t));return n}var ri=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...Js,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:Zs},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:Ys}}},si=class{constructor(e){this.value=e}deref(){return this.value}},ii=typeof WeakRef<"u"?WeakRef:si,oi=0,tr=1;function It(){return{s:oi,v:void 0,o:null,p:null}}function Ft(e,t={}){let n=It();const{resultEqualityCheck:r}=t;let s,i=0;function o(){var T;let a=n;const{length:h}=arguments;for(let I=0,F=h;I<F;I++){const g=arguments[I];if(typeof g=="function"||typeof g=="object"&&g!==null){let E=a.o;E===null&&(a.o=E=new WeakMap);const y=E.get(g);y===void 0?(a=It(),E.set(g,a)):a=y}else{let E=a.p;E===null&&(a.p=E=new Map);const y=E.get(g);y===void 0?(a=It(),E.set(g,a)):a=y}}const p=a;let _;if(a.s===tr)_=a.v;else if(_=e.apply(null,arguments),i++,r){const I=((T=s==null?void 0:s.deref)==null?void 0:T.call(s))??s;I!=null&&r(I,_)&&(_=I,i!==0&&i--),s=typeof _=="object"&&_!==null||typeof _=="function"?new ii(_):_}return p.s=tr,p.v=_,_}return o.clearCache=()=>{n=It(),o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function ai(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...s)=>{let i=0,o=0,a,h={},p=s.pop();typeof p=="object"&&(h=p,p=s.pop()),Xs(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const _={...n,...h},{memoize:T,memoizeOptions:I=[],argsMemoize:F=Ft,argsMemoizeOptions:g=[],devModeChecks:E={}}=_,y=Xn(I),P=Xn(g),D=ni(s),v=T(function(){return i++,p.apply(null,arguments)},...y);let O=!0;const l=F(function(){o++;const b=er(D,arguments);if(a=v.apply(null,b),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:A,inputStabilityCheck:m}=ri(O,E);if(A.shouldRun&&A.run(p,b,a),m.shouldRun){const d=er(D,arguments);m.run({inputSelectorResults:b,inputSelectorResultsCopy:d},{memoize:T,memoizeOptions:y},arguments)}O&&(O=!1)}return a},...P);return Object.assign(l,{resultFunc:p,memoizedResultFunc:v,dependencies:D,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>a,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:T,argsMemoize:F})};return Object.assign(r,{withTypes:()=>r}),r}var nr=ai(Ft),ui=Object.assign((e,t=nr)=>{ei(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(i=>e[i]);return t(r,(...i)=>i.reduce((o,a,h)=>(o[n[h]]=a,o),{}))},{withTypes:()=>ui}),rr=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(rr||{}),be="uninitialized",un="pending",it="fulfilled",ot="rejected";function sr(e){return{status:e,isUninitialized:e===be,isLoading:e===un,isSuccess:e===it,isError:e===ot}}var ir=$.isPlainObject;function cn(e,t){if(e===t||!(ir(e)&&ir(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let s=n.length===r.length;const i=Array.isArray(t)?[]:{};for(const o of n)i[o]=cn(e[o],t[o]),s&&(s=e[o]===i[o]);return s?e:i}function ln(e,t,n){return e.reduce((r,s,i)=>(t(s,i)&&r.push(n(s,i)),r),[]).flat()}function ci(e){return new RegExp("(^|:)//").test(e)}function li(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function fn(e){return e!=null}function or(e){return[...(e==null?void 0:e.values())??[]].filter(fn)}function fi(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var di=e=>e.replace(/\/$/,""),hi=e=>e.replace(/^\//,"");function pi(e,t){if(!e)return t;if(!t)return e;if(ci(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=di(e),t=hi(t),`${e}${n}${t}`}function Dt(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var dn=()=>new Map,yi=e=>{const t=new AbortController;return setTimeout(()=>{const n="signal timed out",r="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(n,r):Object.assign(new Error(n),{name:r}))},e),t.signal},mi=(...e)=>{for(const n of e)if(n.aborted)return AbortSignal.abort(n.reason);const t=new AbortController;for(const n of e)n.addEventListener("abort",()=>t.abort(n.reason),{signal:t.signal,once:!0});return t.signal},ar=(...e)=>fetch(...e),gi=e=>e.status>=200&&e.status<=299,bi=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function ur(e){if(!$.isPlainObject(e))return e;const t={...e};for(const[n,r]of Object.entries(t))r===void 0&&delete t[n];return t}var Si=e=>typeof e=="object"&&($.isPlainObject(e)||Array.isArray(e)||typeof e.toJSON=="function");function vi({baseUrl:e,prepareHeaders:t=T=>T,fetchFn:n=ar,paramsSerializer:r,isJsonContentType:s=bi,jsonContentType:i="application/json",jsonReplacer:o,timeout:a,responseHandler:h,validateStatus:p,..._}={}){return typeof fetch>"u"&&n===ar&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(I,F,g)=>{const{getState:E,extra:y,endpoint:P,forced:D,type:v}=F;let O,{url:l,headers:f=new Headers(_.headers),params:b=void 0,responseHandler:A=h??"json",validateStatus:m=p??gi,timeout:d=a,...u}=typeof I=="string"?{url:I}:I,c={..._,signal:d?mi(F.signal,yi(d)):F.signal,...u};f=new Headers(ur(f)),c.headers=await t(f,{getState:E,arg:I,extra:y,endpoint:P,forced:D,type:v,extraOptions:g})||f;const S=Si(c.body);if(c.body!=null&&!S&&typeof c.body!="string"&&c.headers.delete("content-type"),!c.headers.has("content-type")&&S&&c.headers.set("content-type",i),S&&s(c.headers)&&(c.body=JSON.stringify(c.body,o)),c.headers.has("accept")||(A==="json"?c.headers.set("accept","application/json"):A==="text"&&c.headers.set("accept","text/plain, text/html, */*")),b){const j=~l.indexOf("?")?"&":"?",z=r?r(b):new URLSearchParams(ur(b));l+=j+z}l=pi(e,l);const w=new Request(l,c);O={request:new Request(l,c)};let M;try{M=await n(w)}catch(j){return{error:{status:(j instanceof Error||typeof DOMException<"u"&&j instanceof DOMException)&&j.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(j)},meta:O}}const Q=M.clone();O.response=Q;let R,C="";try{let j;if(await Promise.all([T(M,A).then(z=>R=z,z=>j=z),Q.text().then(z=>C=z,()=>{})]),j)throw j}catch(j){return{error:{status:"PARSING_ERROR",originalStatus:M.status,data:C,error:String(j)},meta:O}}return m(M,R)?{data:R,meta:O}:{error:{status:M.status,data:R},meta:O}};async function T(I,F){if(typeof F=="function")return F(I);if(F==="content-type"&&(F=s(I.headers)?"json":"text"),F==="json"){const g=await I.text();return g.length?JSON.parse(g):null}return I.text()}}var ze=class{constructor(e,t=void 0){this.value=e,this.meta=t}};async function Ei(e=0,t=5,n){const r=Math.min(e,t),s=~~((Math.random()+.4)*(300<<r));await new Promise((i,o)=>{const a=setTimeout(()=>i(),s);if(n){const h=()=>{clearTimeout(a),o(new Error("Aborted"))};n.aborted?(clearTimeout(a),o(new Error("Aborted"))):n.addEventListener("abort",h,{once:!0})}})}function cr(e,t){throw Object.assign(new ze({error:e,meta:t}),{throwImmediately:!0})}function hn(e){e.aborted&&cr({status:"CUSTOM_ERROR",error:"Aborted"})}var lr={},_i=(e,t)=>async(n,r,s)=>{const i=[5,(t||lr).maxRetries,(s||lr).maxRetries].filter(_=>_!==void 0),[o]=i.slice(-1),h={maxRetries:o,backoff:Ei,retryCondition:(_,T,{attempt:I})=>I<=o,...t,...s};let p=0;for(;;){hn(r.signal);try{const _=await e(n,r,s);if(_.error)throw new ze(_);return _}catch(_){if(p++,_.throwImmediately){if(_ instanceof ze)return _.value;throw _}if(_ instanceof ze){if(!h.retryCondition(_.value.error,n,{attempt:p,baseQueryApi:r,extraOptions:s}))return _.value}else if(p>h.maxRetries)return{error:_};hn(r.signal);try{await h.backoff(p,h.maxRetries,r.signal)}catch(T){throw hn(r.signal),T}}}},wi=Object.assign(_i,{fail:cr}),$t="__rtkq/",fr="online",dr="offline",Ai="focus",hr="focused",Oi="visibilitychange",at=$.createAction(`${$t}${hr}`),Ct=$.createAction(`${$t}un${hr}`),ut=$.createAction(`${$t}${fr}`),xt=$.createAction(`${$t}${dr}`),Ti={onFocus:at,onFocusLost:Ct,onOnline:ut,onOffline:xt},Nt=!1;function Pi(e,t){function n(){const[r,s,i,o]=[at,Ct,ut,xt].map(p=>()=>e(p())),a=()=>{window.document.visibilityState==="visible"?r():s()};let h=()=>{Nt=!1};if(!Nt&&typeof window<"u"&&window.addEventListener){let p=function(T){Object.entries(_).forEach(([I,F])=>{T?window.addEventListener(I,F,!1):window.removeEventListener(I,F)})};const _={[Ai]:r,[Oi]:a,[fr]:i,[dr]:o};p(!0),Nt=!0,h=()=>{p(!1),Nt=!1}}return h}return t?t(e,Ti):n()}var ct="query",pr="mutation",yr="infinitequery";function Mt(e){return e.type===ct}function Ii(e){return e.type===pr}function lt(e){return e.type===yr}function kt(e){return Mt(e)||lt(e)}function pn(e,t,n,r,s,i){const o=Fi(e)?e(t,n,r,s):e;return o?ln(o,fn,a=>i(mr(a))):[]}function Fi(e){return typeof e=="function"}function mr(e){return typeof e=="string"?{type:e}:e}function Di(e,t){return e.catch(t)}var Qe=(e,t)=>e.endpointDefinitions[t],ft=Symbol("forceQueryFn"),yn=e=>typeof e[ft]=="function";function $i({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:r,api:s,context:i,getInternalState:o}){const a=l=>{var f;return(f=o(l))==null?void 0:f.runningQueries},h=l=>{var f;return(f=o(l))==null?void 0:f.runningMutations},{unsubscribeQueryResult:p,removeMutationResult:_,updateSubscriptionOptions:T}=s.internalActions;return{buildInitiateQuery:D,buildInitiateInfiniteQuery:v,buildInitiateMutation:O,getRunningQueryThunk:I,getRunningMutationThunk:F,getRunningQueriesThunk:g,getRunningMutationsThunk:E};function I(l,f){return b=>{var d;const A=Qe(i,l),m=e({queryArgs:f,endpointDefinition:A,endpointName:l});return(d=a(b))==null?void 0:d.get(m)}}function F(l,f){return b=>{var A;return(A=h(b))==null?void 0:A.get(f)}}function g(){return l=>or(a(l))}function E(){return l=>or(h(l))}function y(l){if(process.env.NODE_ENV!=="production"){if(y.triggered)return;const f=l(s.internalActions.internal_getRTKQSubscriptions());if(y.triggered=!0,typeof f!="object"||typeof(f==null?void 0:f.type)=="string")throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(34):`Warning: Middleware for RTK-Query API at reducerPath "${s.reducerPath}" has not been added to the store.
|
|
8
|
-
You must add the middleware for RTK-Query to function correctly!`)}}function
|
|
7
|
+
\`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)\``,{arguments:n,firstInputs:i,secondInputs:o,stack:y})}},Js={inputStabilityCheck:"once",identityFunctionCheck:"once"};function Xs(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function ei(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function ti(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var Jn=e=>Array.isArray(e)?e:[e];function ni(e){const t=Array.isArray(e[0])?e[0]:e;return ti(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Xn(e,t){const n=[],{length:r}=e;for(let s=0;s<r;s++)n.push(e[s].apply(null,t));return n}var ri=(e,t)=>{const{identityFunctionCheck:n,inputStabilityCheck:r}={...Js,...t};return{identityFunctionCheck:{shouldRun:n==="always"||n==="once"&&e,run:Zs},inputStabilityCheck:{shouldRun:r==="always"||r==="once"&&e,run:Ys}}},si=class{constructor(e){this.value=e}deref(){return this.value}},ii=typeof WeakRef<"u"?WeakRef:si,oi=0,er=1;function It(){return{s:oi,v:void 0,o:null,p:null}}function Dt(e,t={}){let n=It();const{resultEqualityCheck:r}=t;let s,i=0;function o(){var P;let a=n;const{length:h}=arguments;for(let I=0,F=h;I<F;I++){const v=arguments[I];if(typeof v=="function"||typeof v=="object"&&v!==null){let O=a.o;O===null&&(a.o=O=new WeakMap);const p=O.get(v);p===void 0?(a=It(),O.set(v,a)):a=p}else{let O=a.p;O===null&&(a.p=O=new Map);const p=O.get(v);p===void 0?(a=It(),O.set(v,a)):a=p}}const y=a;let E;if(a.s===er)E=a.v;else if(E=e.apply(null,arguments),i++,r){const I=((P=s==null?void 0:s.deref)==null?void 0:P.call(s))??s;I!=null&&r(I,E)&&(E=I,i!==0&&i--),s=typeof E=="object"&&E!==null||typeof E=="function"?new ii(E):E}return y.s=er,y.v=E,E}return o.clearCache=()=>{n=It(),o.resetResultsCount()},o.resultsCount=()=>i,o.resetResultsCount=()=>{i=0},o}function ai(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...s)=>{let i=0,o=0,a,h={},y=s.pop();typeof y=="object"&&(h=y,y=s.pop()),Xs(y,`createSelector expects an output function after the inputs, but received: [${typeof y}]`);const E={...n,...h},{memoize:P,memoizeOptions:I=[],argsMemoize:F=Dt,argsMemoizeOptions:v=[],devModeChecks:O={}}=E,p=Jn(I),T=Jn(v),D=ni(s),g=P(function(){return i++,y.apply(null,arguments)},...p);let w=!0;const l=F(function(){o++;const b=Xn(D,arguments);if(a=g.apply(null,b),process.env.NODE_ENV!=="production"){const{identityFunctionCheck:A,inputStabilityCheck:m}=ri(w,O);if(A.shouldRun&&A.run(y,b,a),m.shouldRun){const d=Xn(D,arguments);m.run({inputSelectorResults:b,inputSelectorResultsCopy:d},{memoize:P,memoizeOptions:p},arguments)}w&&(w=!1)}return a},...T);return Object.assign(l,{resultFunc:y,memoizedResultFunc:g,dependencies:D,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>a,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:P,argsMemoize:F})};return Object.assign(r,{withTypes:()=>r}),r}var tr=ai(Dt),ui=Object.assign((e,t=tr)=>{ei(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(i=>e[i]);return t(r,(...i)=>i.reduce((o,a,h)=>(o[n[h]]=a,o),{}))},{withTypes:()=>ui}),nr=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(nr||{}),be="uninitialized",un="pending",it="fulfilled",ot="rejected";function rr(e){return{status:e,isUninitialized:e===be,isLoading:e===un,isSuccess:e===it,isError:e===ot}}var sr=$.isPlainObject;function cn(e,t){if(e===t||!(sr(e)&&sr(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),r=Object.keys(e);let s=n.length===r.length;const i=Array.isArray(t)?[]:{};for(const o of n)i[o]=cn(e[o],t[o]),s&&(s=e[o]===i[o]);return s?e:i}function ln(e,t,n){return e.reduce((r,s,i)=>(t(s,i)&&r.push(n(s,i)),r),[]).flat()}function ci(e){return new RegExp("(^|:)//").test(e)}function li(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function fn(e){return e!=null}function ir(e){return[...(e==null?void 0:e.values())??[]].filter(fn)}function fi(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var di=e=>e.replace(/\/$/,""),hi=e=>e.replace(/^\//,"");function pi(e,t){if(!e)return t;if(!t)return e;if(ci(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=di(e),t=hi(t),`${e}${n}${t}`}function Ft(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var dn=()=>new Map,yi=e=>{const t=new AbortController;return setTimeout(()=>{const n="signal timed out",r="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(n,r):Object.assign(new Error(n),{name:r}))},e),t.signal},mi=(...e)=>{for(const n of e)if(n.aborted)return AbortSignal.abort(n.reason);const t=new AbortController;for(const n of e)n.addEventListener("abort",()=>t.abort(n.reason),{signal:t.signal,once:!0});return t.signal},or=(...e)=>fetch(...e),gi=e=>e.status>=200&&e.status<=299,bi=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function ar(e){if(!$.isPlainObject(e))return e;const t={...e};for(const[n,r]of Object.entries(t))r===void 0&&delete t[n];return t}var Si=e=>typeof e=="object"&&($.isPlainObject(e)||Array.isArray(e)||typeof e.toJSON=="function");function vi({baseUrl:e,prepareHeaders:t=P=>P,fetchFn:n=or,paramsSerializer:r,isJsonContentType:s=bi,jsonContentType:i="application/json",jsonReplacer:o,timeout:a,responseHandler:h,validateStatus:y,...E}={}){return typeof fetch>"u"&&n===or&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(I,F,v)=>{const{getState:O,extra:p,endpoint:T,forced:D,type:g}=F;let w,{url:l,headers:f=new Headers(E.headers),params:b=void 0,responseHandler:A=h??"json",validateStatus:m=y??gi,timeout:d=a,...u}=typeof I=="string"?{url:I}:I,c={...E,signal:d?mi(F.signal,yi(d)):F.signal,...u};f=new Headers(ar(f)),c.headers=await t(f,{getState:O,arg:I,extra:p,endpoint:T,forced:D,type:g,extraOptions:v})||f;const S=Si(c.body);if(c.body!=null&&!S&&typeof c.body!="string"&&c.headers.delete("content-type"),!c.headers.has("content-type")&&S&&c.headers.set("content-type",i),S&&s(c.headers)&&(c.body=JSON.stringify(c.body,o)),c.headers.has("accept")||(A==="json"?c.headers.set("accept","application/json"):A==="text"&&c.headers.set("accept","text/plain, text/html, */*")),b){const j=~l.indexOf("?")?"&":"?",z=r?r(b):new URLSearchParams(ar(b));l+=j+z}l=pi(e,l);const _=new Request(l,c);w={request:new Request(l,c)};let M;try{M=await n(_)}catch(j){return{error:{status:(j instanceof Error||typeof DOMException<"u"&&j instanceof DOMException)&&j.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(j)},meta:w}}const Q=M.clone();w.response=Q;let R,C="";try{let j;if(await Promise.all([P(M,A).then(z=>R=z,z=>j=z),Q.text().then(z=>C=z,()=>{})]),j)throw j}catch(j){return{error:{status:"PARSING_ERROR",originalStatus:M.status,data:C,error:String(j)},meta:w}}return m(M,R)?{data:R,meta:w}:{error:{status:M.status,data:R},meta:w}};async function P(I,F){if(typeof F=="function")return F(I);if(F==="content-type"&&(F=s(I.headers)?"json":"text"),F==="json"){const v=await I.text();return v.length?JSON.parse(v):null}return I.text()}}var ze=class{constructor(e,t=void 0){this.value=e,this.meta=t}};async function Ei(e=0,t=5,n){const r=Math.min(e,t),s=~~((Math.random()+.4)*(300<<r));await new Promise((i,o)=>{const a=setTimeout(()=>i(),s);if(n){const h=()=>{clearTimeout(a),o(new Error("Aborted"))};n.aborted?(clearTimeout(a),o(new Error("Aborted"))):n.addEventListener("abort",h,{once:!0})}})}function ur(e,t){throw Object.assign(new ze({error:e,meta:t}),{throwImmediately:!0})}function hn(e){e.aborted&&ur({status:"CUSTOM_ERROR",error:"Aborted"})}var cr={},_i=(e,t)=>async(n,r,s)=>{const i=[5,(t||cr).maxRetries,(s||cr).maxRetries].filter(E=>E!==void 0),[o]=i.slice(-1),h={maxRetries:o,backoff:Ei,retryCondition:(E,P,{attempt:I})=>I<=o,...t,...s};let y=0;for(;;){hn(r.signal);try{const E=await e(n,r,s);if(E.error)throw new ze(E);return E}catch(E){if(y++,E.throwImmediately){if(E instanceof ze)return E.value;throw E}if(E instanceof ze){if(!h.retryCondition(E.value.error,n,{attempt:y,baseQueryApi:r,extraOptions:s}))return E.value}else if(y>h.maxRetries)return{error:E};hn(r.signal);try{await h.backoff(y,h.maxRetries,r.signal)}catch(P){throw hn(r.signal),P}}}},wi=Object.assign(_i,{fail:ur}),$t="__rtkq/",lr="online",fr="offline",Ai="focus",dr="focused",Oi="visibilitychange",at=$.createAction(`${$t}${dr}`),Ct=$.createAction(`${$t}un${dr}`),ut=$.createAction(`${$t}${lr}`),xt=$.createAction(`${$t}${fr}`),Ti={onFocus:at,onFocusLost:Ct,onOnline:ut,onOffline:xt},Nt=!1;function Pi(e,t){function n(){const[r,s,i,o]=[at,Ct,ut,xt].map(y=>()=>e(y())),a=()=>{window.document.visibilityState==="visible"?r():s()};let h=()=>{Nt=!1};if(!Nt&&typeof window<"u"&&window.addEventListener){let y=function(P){Object.entries(E).forEach(([I,F])=>{P?window.addEventListener(I,F,!1):window.removeEventListener(I,F)})};const E={[Ai]:r,[Oi]:a,[lr]:i,[fr]:o};y(!0),Nt=!0,h=()=>{y(!1),Nt=!1}}return h}return t?t(e,Ti):n()}var ct="query",hr="mutation",pr="infinitequery";function Mt(e){return e.type===ct}function Ii(e){return e.type===hr}function lt(e){return e.type===pr}function kt(e){return Mt(e)||lt(e)}function pn(e,t,n,r,s,i){const o=Di(e)?e(t,n,r,s):e;return o?ln(o,fn,a=>i(yr(a))):[]}function Di(e){return typeof e=="function"}function yr(e){return typeof e=="string"?{type:e}:e}function Fi(e,t){return e.catch(t)}var Qe=(e,t)=>e.endpointDefinitions[t],ft=Symbol("forceQueryFn"),yn=e=>typeof e[ft]=="function";function $i({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:r,api:s,context:i,getInternalState:o}){const a=l=>{var f;return(f=o(l))==null?void 0:f.runningQueries},h=l=>{var f;return(f=o(l))==null?void 0:f.runningMutations},{unsubscribeQueryResult:y,removeMutationResult:E,updateSubscriptionOptions:P}=s.internalActions;return{buildInitiateQuery:D,buildInitiateInfiniteQuery:g,buildInitiateMutation:w,getRunningQueryThunk:I,getRunningMutationThunk:F,getRunningQueriesThunk:v,getRunningMutationsThunk:O};function I(l,f){return b=>{var d;const A=Qe(i,l),m=e({queryArgs:f,endpointDefinition:A,endpointName:l});return(d=a(b))==null?void 0:d.get(m)}}function F(l,f){return b=>{var A;return(A=h(b))==null?void 0:A.get(f)}}function v(){return l=>ir(a(l))}function O(){return l=>ir(h(l))}function p(l){if(process.env.NODE_ENV!=="production"){if(p.triggered)return;const f=l(s.internalActions.internal_getRTKQSubscriptions());if(p.triggered=!0,typeof f!="object"||typeof(f==null?void 0:f.type)=="string")throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(34):`Warning: Middleware for RTK-Query API at reducerPath "${s.reducerPath}" has not been added to the store.
|
|
8
|
+
You must add the middleware for RTK-Query to function correctly!`)}}function T(l,f){const b=(A,{subscribe:m=!0,forceRefetch:d,subscriptionOptions:u,[ft]:c,...S}={})=>(_,x)=>{var H;const M=e({queryArgs:A,endpointDefinition:f,endpointName:l});let Q;const R={...S,type:ct,subscribe:m,forceRefetch:d,subscriptionOptions:u,endpointName:l,originalArgs:A,queryCacheKey:M,[ft]:c};if(Mt(f))Q=t(R);else{const{direction:U,initialPageParam:ne,refetchCachedPages:K}=S;Q=n({...R,direction:U,initialPageParam:ne,refetchCachedPages:K})}const C=s.endpoints[l].select(A),j=_(Q),z=C(x());p(_);const{requestId:B,abort:G}=j,W=z.requestId!==B,J=(H=a(_))==null?void 0:H.get(M),Z=()=>C(x()),q=Object.assign(c?j.then(Z):W&&!J?Promise.resolve(z):Promise.all([J,j]).then(Z),{arg:A,requestId:B,subscriptionOptions:u,queryCacheKey:M,abort:G,async unwrap(){const U=await q;if(U.isError)throw U.error;return U.data},refetch:U=>_(b(A,{subscribe:!1,forceRefetch:!0,...U})),unsubscribe(){m&&_(y({queryCacheKey:M,requestId:B}))},updateSubscriptionOptions(U){q.subscriptionOptions=U,_(P({endpointName:l,requestId:B,queryCacheKey:M,options:U}))}});if(!J&&!W&&!c){const U=a(_);U.set(M,q),q.then(()=>{U.delete(M)})}return q};return b}function D(l,f){return T(l,f)}function g(l,f){return T(l,f)}function w(l){return(f,{track:b=!0,fixedCacheKey:A}={})=>(m,d)=>{const u=r({type:"mutation",endpointName:l,originalArgs:f,track:b,fixedCacheKey:A}),c=m(u);p(m);const{requestId:S,abort:_,unwrap:x}=c,M=Fi(c.unwrap().then(j=>({data:j})),j=>({error:j})),Q=()=>{m(E({requestId:S,fixedCacheKey:A}))},R=Object.assign(M,{arg:c.arg,requestId:S,abort:_,unwrap:x,reset:Q}),C=h(m);return C.set(S,R),R.then(()=>{C.delete(S)}),A&&(C.set(A,R),R.then(()=>{C.get(A)===R&&C.delete(A)})),R}}}var mr=class extends Gs{constructor(e,t,n,r){super(e),this.value=t,this.schemaName=n,this._bqMeta=r}},$e=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function Ce(e,t,n,r){const s=await e["~standard"].validate(t);if(s.issues)throw new mr(s.issues,t,n,r);return s.value}function gr(e){return e}var dt=(e={})=>({...e,[$.SHOULD_AUTOBATCH]:!0});function Ci({reducerPath:e,baseQuery:t,context:{endpointDefinitions:n},serializeQueryArgs:r,api:s,assertTagType:i,selectors:o,onSchemaFailure:a,catchSchemaFailure:h,skipSchemaValidation:y}){const E=(u,c,S,_)=>(x,M)=>{const Q=n[u],R=r({queryArgs:c,endpointDefinition:Q,endpointName:u});if(x(s.internalActions.queryResultPatched({queryCacheKey:R,patches:S})),!_)return;const C=s.endpoints[u].select(c)(M()),j=pn(Q.providesTags,C.data,void 0,c,{},i);x(s.internalActions.updateProvidedBy([{queryCacheKey:R,providedTags:j}]))};function P(u,c,S=0){const _=[c,...u];return S&&_.length>S?_.slice(0,-1):_}function I(u,c,S=0){const _=[...u,c];return S&&_.length>S?_.slice(1):_}const F=(u,c,S,_=!0)=>(x,M)=>{const R=s.endpoints[u].select(c)(M()),C={patches:[],inversePatches:[],undo:()=>x(s.util.patchQueryData(u,c,C.inversePatches,_))};if(R.status===be)return C;let j;if("data"in R)if(ce(R.data)){const[z,B,G]=Zn(R.data,S);C.patches.push(...B),C.inversePatches.push(...G),j=z}else j=S(R.data),C.patches.push({op:"replace",path:[],value:j}),C.inversePatches.push({op:"replace",path:[],value:R.data});return C.patches.length===0||x(s.util.patchQueryData(u,c,C.patches,_)),C},v=(u,c,S)=>_=>_(s.endpoints[u].initiate(c,{subscribe:!1,forceRefetch:!0,[ft]:()=>({data:S})})),O=(u,c)=>u.query&&u[c]?u[c]:gr,p=async(u,{signal:c,abort:S,rejectWithValue:_,fulfillWithValue:x,dispatch:M,getState:Q,extra:R})=>{var G,W;const C=n[u.endpointName],{metaSchema:j,skipSchemaValidation:z=y}=C,B=u.type===ct;try{let J=gr;const Z={signal:c,abort:S,dispatch:M,getState:Q,extra:R,endpoint:u.endpointName,type:u.type,forced:B?T(u,Q()):void 0,queryCacheKey:B?u.queryCacheKey:void 0},q=B?u[ft]:void 0;let H;const U=async(K,V,Oe,se)=>{if(V==null&&K.pages.length)return Promise.resolve({data:K});const Ke={queryArg:u.originalArgs,pageParam:V},le=await ne(Ke),He=se?P:I;return{data:{pages:He(K.pages,le.data,Oe),pageParams:He(K.pageParams,V,Oe)},meta:le.meta}};async function ne(K){let V;const{extraOptions:Oe,argSchema:se,rawResponseSchema:Ke,responseSchema:le}=C;if(se&&!$e(z,"arg")&&(K=await Ce(se,K,"argSchema",{})),q?V=q():C.query?(J=O(C,"transformResponse"),V=await t(C.query(K),Z,Oe)):V=await C.queryFn(K,Z,Oe,ue=>t(ue,Z,Oe)),typeof process<"u"&&process.env.NODE_ENV==="development"){const ue=C.query?"`baseQuery`":"`queryFn`";let fe;if(!V)fe=`${ue} did not return anything.`;else if(typeof V!="object")fe=`${ue} did not return an object.`;else if(V.error&&V.data)fe=`${ue} returned an object containing both \`error\` and \`result\`.`;else if(V.error===void 0&&V.data===void 0)fe=`${ue} returned an object containing neither a valid \`error\` and \`result\`. At least one of them should not be \`undefined\``;else for(const Pe of Object.keys(V))if(Pe!=="error"&&Pe!=="data"&&Pe!=="meta"){fe=`The object returned by ${ue} has the unknown property ${Pe}.`;break}fe&&console.error(`Error encountered handling the endpoint ${u.endpointName}.
|
|
9
9
|
${fe}
|
|
10
10
|
It needs to return an object with either the shape \`{ data: <value> }\` or \`{ error: <value> }\` that may contain an optional \`meta\` property.
|
|
11
|
-
Object returned was:`,V)}if(V.error)throw new ze(V.error,V.meta);let{data:He}=V;Ke&&!$e(z,"rawResponse")&&(He=await Ce(Ke,V.data,"rawResponseSchema",V.meta));let Te=await J(He,V.meta,K);return le&&!$e(z,"response")&&(Te=await Ce(le,Te,"responseSchema",V.meta)),{...V,data:Te}}if(B&&"infiniteQueryOptions"in C){const{infiniteQueryOptions:K}=C,{maxPages:V=1/0}=K,Oe=u.refetchCachedPages??K.refetchCachedPages??!0;let se;const Ke={pages:[],pageParams:[]},le=(G=o.selectQueryEntry(Q(),u.queryCacheKey))==null?void 0:G.data,Te=
|
|
12
|
-
In the case of an unhandled error, no tags will be "provided" or "invalidated".`,Z):console.error(Z),Z}};function P(u,c){const S=o.selectQueryEntry(c,u.queryCacheKey),w=o.selectConfig(c).refetchOnMountOrArgChange,x=S==null?void 0:S.fulfilledTimeStamp,M=u.forceRefetch??(u.subscribe&&w);return M?M===!0||(Number(new Date)-Number(x))/1e3>=M:!1}const D=()=>$.createAsyncThunk(`${e}/executeQuery`,y,{getPendingMeta({arg:c}){const S=n[c.endpointName];return dt({startedTimeStamp:Date.now(),...lt(S)?{direction:c.direction}:{}})},condition(c,{getState:S}){var z;const w=S(),x=o.selectQueryEntry(w,c.queryCacheKey),M=x==null?void 0:x.fulfilledTimeStamp,Q=c.originalArgs,R=x==null?void 0:x.originalArgs,C=n[c.endpointName],j=c.direction;return yn(c)?!0:(x==null?void 0:x.status)==="pending"?!1:P(c,w)||Mt(C)&&((z=C==null?void 0:C.forceRefetch)!=null&&z.call(C,{currentArg:Q,previousArg:R,endpointState:x,state:w}))?!0:!(M&&!j)},dispatchConditionRejection:!0}),v=D(),O=D(),l=$.createAsyncThunk(`${e}/executeMutation`,y,{getPendingMeta(){return dt({startedTimeStamp:Date.now()})}}),f=u=>"force"in u,b=u=>"ifOlderThan"in u,A=(u,c,S={})=>(w,x)=>{const M=f(S)&&S.force,Q=b(S)&&S.ifOlderThan,R=(j=!0)=>{const z={forceRefetch:j,subscribe:!1};return s.endpoints[u].initiate(c,z)},C=s.endpoints[u].select(c)(x());if(M)w(R());else if(Q){const j=C==null?void 0:C.fulfilledTimeStamp;if(!j){w(R());return}(Number(new Date)-Number(new Date(j)))/1e3>=Q&&w(R())}else w(R(!1))};function m(u){return c=>{var S,w;return((w=(S=c==null?void 0:c.meta)==null?void 0:S.arg)==null?void 0:w.endpointName)===u}}function d(u,c){return{matchPending:$.isAllOf($.isPending(u),m(c)),matchFulfilled:$.isAllOf($.isFulfilled(u),m(c)),matchRejected:$.isAllOf($.isRejected(u),m(c))}}return{queryThunk:v,mutationThunk:l,infiniteQueryThunk:O,prefetch:A,updateQueryData:F,upsertQueryData:g,patchQueryData:_,buildMatchThunkActions:d}}function mn(e,{pages:t,pageParams:n},r){const s=t.length-1;return e.getNextPageParam(t[s],t,n[s],n,r)}function Sr(e,{pages:t,pageParams:n},r){var s;return(s=e.getPreviousPageParam)==null?void 0:s.call(e,t[0],t,n[0],n,r)}function vr(e,t,n,r){return pn(n[e.meta.arg.endpointName][t],$.isFulfilled(e)?e.payload:void 0,$.isRejectedWithValue(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function Er(e){return oe(e)?Gn(e):e}function Rt(e,t,n){const r=e[t];r&&n(r)}function ht(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function _r(e,t,n){const r=e[ht(t)];r&&n(r)}var jt={};function xi({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:r,context:{endpointDefinitions:s,apiUid:i,extractRehydrationInfo:o,hasRehydrationInfo:a},assertTagType:h,config:p}){const _=$.createAction(`${e}/resetApiState`);function T(m,d,u,c){var S;m[S=d.queryCacheKey]??(m[S]={status:be,endpointName:d.endpointName}),Rt(m,d.queryCacheKey,w=>{w.status=un,w.requestId=u&&w.requestId?w.requestId:c.requestId,d.originalArgs!==void 0&&(w.originalArgs=d.originalArgs),w.startedTimeStamp=c.startedTimeStamp;const x=s[c.arg.endpointName];lt(x)&&"direction"in d&&(w.direction=d.direction)})}function I(m,d,u,c){Rt(m,d.arg.queryCacheKey,S=>{if(S.requestId!==d.requestId&&!c)return;const{merge:w}=s[d.arg.endpointName];if(S.status=it,w)if(S.data!==void 0){const{fulfilledTimeStamp:x,arg:M,baseQueryMeta:Q,requestId:R}=d;let C=$.createNextState(S.data,j=>w(j,u,{arg:M.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:x,requestId:R}));S.data=C}else S.data=u;else S.data=s[d.arg.endpointName].structuralSharing??!0?cn(oe(S.data)?xs(S.data):S.data,u):u;delete S.error,S.fulfilledTimeStamp=d.fulfilledTimeStamp})}const F=$.createSlice({name:`${e}/queries`,initialState:jt,reducers:{removeQueryResult:{reducer(m,{payload:{queryCacheKey:d}}){delete m[d]},prepare:$.prepareAutoBatched()},cacheEntriesUpserted:{reducer(m,d){for(const u of d.payload){const{queryDescription:c,value:S}=u;T(m,c,!0,{arg:c,requestId:d.meta.requestId,startedTimeStamp:d.meta.timestamp}),I(m,{arg:c,requestId:d.meta.requestId,fulfilledTimeStamp:d.meta.timestamp,baseQueryMeta:{}},S,!0)}},prepare:m=>({payload:m.map(c=>{const{endpointName:S,arg:w,value:x}=c,M=s[S];return{queryDescription:{type:ct,endpointName:S,originalArgs:c.arg,queryCacheKey:r({queryArgs:w,endpointDefinition:M,endpointName:S})},value:x}}),meta:{[$.SHOULD_AUTOBATCH]:!0,requestId:$.nanoid(),timestamp:Date.now()}})},queryResultPatched:{reducer(m,{payload:{queryCacheKey:d,patches:u}}){Rt(m,d,c=>{c.data=Jn(c.data,u.concat())})},prepare:$.prepareAutoBatched()}},extraReducers(m){m.addCase(t.pending,(d,{meta:u,meta:{arg:c}})=>{const S=yn(c);T(d,c,S,u)}).addCase(t.fulfilled,(d,{meta:u,payload:c})=>{const S=yn(u.arg);I(d,u,c,S)}).addCase(t.rejected,(d,{meta:{condition:u,arg:c,requestId:S},error:w,payload:x})=>{Rt(d,c.queryCacheKey,M=>{if(!u){if(M.requestId!==S)return;M.status=ot,M.error=x??w}})}).addMatcher(a,(d,u)=>{const{queries:c}=o(u);for(const[S,w]of Object.entries(c))((w==null?void 0:w.status)===it||(w==null?void 0:w.status)===ot)&&(d[S]=w)})}}),g=$.createSlice({name:`${e}/mutations`,initialState:jt,reducers:{removeMutationResult:{reducer(m,{payload:d}){const u=ht(d);u in m&&delete m[u]},prepare:$.prepareAutoBatched()}},extraReducers(m){m.addCase(n.pending,(d,{meta:u,meta:{requestId:c,arg:S,startedTimeStamp:w}})=>{S.track&&(d[ht(u)]={requestId:c,status:un,endpointName:S.endpointName,startedTimeStamp:w})}).addCase(n.fulfilled,(d,{payload:u,meta:c})=>{c.arg.track&&_r(d,c,S=>{S.requestId===c.requestId&&(S.status=it,S.data=u,S.fulfilledTimeStamp=c.fulfilledTimeStamp)})}).addCase(n.rejected,(d,{payload:u,error:c,meta:S})=>{S.arg.track&&_r(d,S,w=>{w.requestId===S.requestId&&(w.status=ot,w.error=u??c)})}).addMatcher(a,(d,u)=>{const{mutations:c}=o(u);for(const[S,w]of Object.entries(c))((w==null?void 0:w.status)===it||(w==null?void 0:w.status)===ot)&&S!==(w==null?void 0:w.requestId)&&(d[S]=w)})}}),E={tags:{},keys:{}},y=$.createSlice({name:`${e}/invalidation`,initialState:E,reducers:{updateProvidedBy:{reducer(m,d){var u,c,S;for(const{queryCacheKey:w,providedTags:x}of d.payload){P(m,w);for(const{type:M,id:Q}of x){const R=(c=(u=m.tags)[M]??(u[M]={}))[S=Q||"__internal_without_id"]??(c[S]=[]);R.includes(w)||R.push(w)}m.keys[w]=x}},prepare:$.prepareAutoBatched()}},extraReducers(m){m.addCase(F.actions.removeQueryResult,(d,{payload:{queryCacheKey:u}})=>{P(d,u)}).addMatcher(a,(d,u)=>{var S,w,x;const{provided:c}=o(u);for(const[M,Q]of Object.entries(c.tags??{}))for(const[R,C]of Object.entries(Q)){const j=(w=(S=d.tags)[M]??(S[M]={}))[x=R||"__internal_without_id"]??(w[x]=[]);for(const z of C)j.includes(z)||j.push(z),d.keys[z]=c.keys[z]}}).addMatcher($.isAnyOf($.isFulfilled(t),$.isRejectedWithValue(t)),(d,u)=>{D(d,[u])}).addMatcher(F.actions.cacheEntriesUpserted.match,(d,u)=>{const c=u.payload.map(({queryDescription:S,value:w})=>({type:"UNKNOWN",payload:w,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:S}}));D(d,c)})}});function P(m,d){var c;const u=Er(m.keys[d]??[]);for(const S of u){const w=S.type,x=S.id??"__internal_without_id",M=(c=m.tags[w])==null?void 0:c[x];M&&(m.tags[w][x]=Er(M).filter(Q=>Q!==d))}delete m.keys[d]}function D(m,d){const u=d.map(c=>{const S=vr(c,"providesTags",s,h),{queryCacheKey:w}=c.meta.arg;return{queryCacheKey:w,providedTags:S}});y.caseReducers.updateProvidedBy(m,y.actions.updateProvidedBy(u))}const v=$.createSlice({name:`${e}/subscriptions`,initialState:jt,reducers:{updateSubscriptionOptions(m,d){},unsubscribeQueryResult(m,d){},internal_getRTKQSubscriptions(){}}}),O=$.createSlice({name:`${e}/internalSubscriptions`,initialState:jt,reducers:{subscriptionsUpdated:{reducer(m,d){return Jn(m,d.payload)},prepare:$.prepareAutoBatched()}}}),l=$.createSlice({name:`${e}/config`,initialState:{online:fi(),focused:li(),middlewareRegistered:!1,...p},reducers:{middlewareRegistered(m,{payload:d}){m.middlewareRegistered=m.middlewareRegistered==="conflict"||i!==d?"conflict":!0}},extraReducers:m=>{m.addCase(ut,d=>{d.online=!0}).addCase(xt,d=>{d.online=!1}).addCase(at,d=>{d.focused=!0}).addCase(Ct,d=>{d.focused=!1}).addMatcher(a,d=>({...d}))}}),f=$.combineReducers({queries:F.reducer,mutations:g.reducer,provided:y.reducer,subscriptions:O.reducer,config:l.reducer}),b=(m,d)=>f(_.match(d)?void 0:m,d),A={...l.actions,...F.actions,...v.actions,...O.actions,...g.actions,...y.actions,resetApiState:_};return{reducer:b,actions:A}}var ae=Symbol.for("RTKQ/skipToken"),wr={status:be},Ar=$.createNextState(wr,()=>{}),Or=$.createNextState(wr,()=>{});function Ni({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const r=v=>Ar,s=v=>Or;return{buildQuerySelector:I,buildInfiniteQuerySelector:F,buildMutationSelector:g,selectInvalidatedBy:E,selectCachedArgsForQuery:y,selectApiState:o,selectQueries:a,selectMutations:p,selectQueryEntry:h,selectConfig:_};function i(v){return{...v,...sr(v.status)}}function o(v){const O=v[t];if(process.env.NODE_ENV!=="production"&&!O){if(o.triggered)return O;o.triggered=!0,console.error(`Error: No data found at \`state.${t}\`. Did you forget to add the reducer to the store?`)}return O}function a(v){var O;return(O=o(v))==null?void 0:O.queries}function h(v,O){var l;return(l=a(v))==null?void 0:l[O]}function p(v){var O;return(O=o(v))==null?void 0:O.mutations}function _(v){var O;return(O=o(v))==null?void 0:O.config}function T(v,O,l){return f=>{if(f===ae)return n(r,l);const b=e({queryArgs:f,endpointDefinition:O,endpointName:v});return n(m=>h(m,b)??Ar,l)}}function I(v,O){return T(v,O,i)}function F(v,O){const{infiniteQueryOptions:l}=O;function f(b){const A={...b,...sr(b.status)},{isLoading:m,isError:d,direction:u}=A,c=u==="forward",S=u==="backward";return{...A,hasNextPage:P(l,A.data,A.originalArgs),hasPreviousPage:D(l,A.data,A.originalArgs),isFetchingNextPage:m&&c,isFetchingPreviousPage:m&&S,isFetchNextPageError:d&&c,isFetchPreviousPageError:d&&S}}return T(v,O,f)}function g(){return v=>{let O;return typeof v=="object"?O=ht(v)??ae:O=v,n(O===ae?s:b=>{var A,m;return((m=(A=o(b))==null?void 0:A.mutations)==null?void 0:m[O])??Or},i)}}function E(v,O){const l=v[t],f=new Set,b=ln(O,fn,mr);for(const A of b){const m=l.provided.tags[A.type];if(!m)continue;let d=(A.id!==void 0?m[A.id]:Object.values(m).flat())??[];for(const u of d)f.add(u)}return Array.from(f.values()).flatMap(A=>{const m=l.queries[A];return m?{queryCacheKey:A,endpointName:m.endpointName,originalArgs:m.originalArgs}:[]})}function y(v,O){return ln(Object.values(a(v)),l=>(l==null?void 0:l.endpointName)===O&&l.status!==be,l=>l.originalArgs)}function P(v,O,l){return O?mn(v,O,l)!=null:!1}function D(v,O,l){return!O||!v.getPreviousPageParam?!1:Sr(v,O,l)!=null}}var qe=WeakMap?new WeakMap:void 0,Tr=({endpointName:e,queryArgs:t})=>{let n="";const r=qe==null?void 0:qe.get(t);if(typeof r=="string")n=r;else{const s=JSON.stringify(t,(i,o)=>(o=typeof o=="bigint"?{$bigint:o.toString()}:o,o=$.isPlainObject(o)?Object.keys(o).sort().reduce((a,h)=>(a[h]=o[h],a),{}):o,o));$.isPlainObject(t)&&(qe==null||qe.set(t,s)),n=s}return`${e}(${n})`};function Mi(...e){return function(n){const r=Ft(p=>{var _;return(_=n.extractRehydrationInfo)==null?void 0:_.call(n,p,{reducerPath:n.reducerPath??"api"})}),s={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(p){let _=Tr;if("serializeQueryArgs"in p.endpointDefinition){const T=p.endpointDefinition.serializeQueryArgs;_=I=>{const F=T(I);return typeof F=="string"?F:Tr({...I,queryArgs:F})}}else n.serializeQueryArgs&&(_=n.serializeQueryArgs);return _(p)},tagTypes:[...n.tagTypes||[]]},i={endpointDefinitions:{},batch(p){p()},apiUid:$.nanoid(),extractRehydrationInfo:r,hasRehydrationInfo:Ft(p=>r(p)!=null)},o={injectEndpoints:h,enhanceEndpoints({addTagTypes:p,endpoints:_}){if(p)for(const T of p)s.tagTypes.includes(T)||s.tagTypes.push(T);if(_)for(const[T,I]of Object.entries(_))typeof I=="function"?I(Qe(i,T)):Object.assign(Qe(i,T)||{},I);return o}},a=e.map(p=>p.init(o,s,i));function h(p){const _=p.endpoints({query:T=>({...T,type:ct}),mutation:T=>({...T,type:pr}),infiniteQuery:T=>({...T,type:yr})});for(const[T,I]of Object.entries(_)){if(p.overrideExisting!==!0&&T in i.endpointDefinitions){if(p.overrideExisting==="throw")throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(39):`called \`injectEndpoints\` to override already-existing endpointName ${T} without specifying \`overrideExisting: true\``);typeof process<"u"&&process.env.NODE_ENV==="development"&&console.error(`called \`injectEndpoints\` to override already-existing endpointName ${T} without specifying \`overrideExisting: true\``);continue}if(typeof process<"u"&&process.env.NODE_ENV==="development"&<(I)){const{infiniteQueryOptions:F}=I,{maxPages:g,getPreviousPageParam:E}=F;if(typeof g=="number"){if(g<1)throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(40):`maxPages for endpoint '${T}' must be a number greater than 0`);if(typeof E!="function")throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(41):`getPreviousPageParam for endpoint '${T}' must be a function if maxPages is used`)}}i.endpointDefinitions[T]=I;for(const F of a)F.injectEndpoint(T,I)}return o}return o.injectEndpoints({endpoints:n.endpoints})}}function Se(e,...t){return Object.assign(e,...t)}var ki=({api:e,queryThunk:t,internalState:n,mwApi:r})=>{const s=`${e.reducerPath}/subscriptions`;let i=null,o=null;const{updateSubscriptionOptions:a,unsubscribeQueryResult:h}=e.internalActions,p=(E,y)=>{if(a.match(y)){const{queryCacheKey:D,requestId:v,options:O}=y.payload,l=E.get(D);return l!=null&&l.has(v)&&l.set(v,O),!0}if(h.match(y)){const{queryCacheKey:D,requestId:v}=y.payload,O=E.get(D);return O&&O.delete(v),!0}if(e.internalActions.removeQueryResult.match(y))return E.delete(y.payload.queryCacheKey),!0;if(t.pending.match(y)){const{meta:{arg:D,requestId:v}}=y,O=Dt(E,D.queryCacheKey,dn);return D.subscribe&&O.set(v,D.subscriptionOptions??O.get(v)??{}),!0}let P=!1;if(t.rejected.match(y)){const{meta:{condition:D,arg:v,requestId:O}}=y;if(D&&v.subscribe){const l=Dt(E,v.queryCacheKey,dn);l.set(O,v.subscriptionOptions??l.get(O)??{}),P=!0}}return P},_=()=>n.currentSubscriptions,F={getSubscriptions:_,getSubscriptionCount:E=>{const P=_().get(E);return(P==null?void 0:P.size)??0},isRequestSubscribed:(E,y)=>{var D;const P=_();return!!((D=P==null?void 0:P.get(E))!=null&&D.get(y))}};function g(E){return JSON.parse(JSON.stringify(Object.fromEntries([...E].map(([y,P])=>[y,Object.fromEntries(P)]))))}return(E,y)=>{if(i||(i=g(n.currentSubscriptions)),e.util.resetApiState.match(E))return i={},n.currentSubscriptions.clear(),o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(E))return[!1,F];const P=p(n.currentSubscriptions,E);let D=!0;if(process.env.NODE_ENV==="test"&&typeof E.type=="string"&&E.type===`${e.reducerPath}/getPolling`)return[!1,n.currentPolls];if(P){o||(o=setTimeout(()=>{const l=g(n.currentSubscriptions),[,f]=Yn(i,()=>l);y.next(e.internalActions.subscriptionsUpdated(f)),i=l,o=null},500));const v=typeof E.type=="string"&&!!E.type.startsWith(s),O=t.rejected.match(E)&&E.meta.condition&&!!E.meta.arg.subscribe;D=!v&&!O}return[D,!1]}},Ri=2147483647/1e3-1,ji=({reducerPath:e,api:t,queryThunk:n,context:r,internalState:s,selectors:{selectQueryEntry:i,selectConfig:o},getRunningQueryThunk:a,mwApi:h})=>{const{removeQueryResult:p,unsubscribeQueryResult:_,cacheEntriesUpserted:T}=t.internalActions,I=$.isAnyOf(_.match,n.fulfilled,n.rejected,T.match);function F(v){const O=s.currentSubscriptions.get(v);return O?O.size>0:!1}const g={};function E(v){var O;for(const l of v.values())(O=l==null?void 0:l.abort)==null||O.call(l)}const y=(v,O)=>{const l=O.getState(),f=o(l);if(I(v)){let b;if(T.match(v))b=v.payload.map(A=>A.queryDescription.queryCacheKey);else{const{queryCacheKey:A}=_.match(v)?v.payload:v.meta.arg;b=[A]}P(b,O,f)}if(t.util.resetApiState.match(v)){for(const[b,A]of Object.entries(g))A&&clearTimeout(A),delete g[b];E(s.runningQueries),E(s.runningMutations)}if(r.hasRehydrationInfo(v)){const{queries:b}=r.extractRehydrationInfo(v);P(Object.keys(b),O,f)}};function P(v,O,l){const f=O.getState();for(const b of v){const A=i(f,b);A!=null&&A.endpointName&&D(b,A.endpointName,O,l)}}function D(v,O,l,f){const b=Qe(r,O),A=(b==null?void 0:b.keepUnusedDataFor)??f.keepUnusedDataFor;if(A===1/0)return;const m=Math.max(0,Math.min(A,Ri));if(!F(v)){const d=g[v];d&&clearTimeout(d),g[v]=setTimeout(()=>{if(!F(v)){const u=i(l.getState(),v);if(u!=null&&u.endpointName){const c=l.dispatch(a(u.endpointName,u.originalArgs));c==null||c.abort()}l.dispatch(p({queryCacheKey:v}))}delete g[v]},m*1e3)}}return y},Pr=new Error("Promise never resolved before cacheEntryRemoved."),zi=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:s,internalState:i,selectors:{selectQueryEntry:o,selectApiState:a}})=>{const h=$.isAsyncThunkAction(r),p=$.isAsyncThunkAction(s),_=$.isFulfilled(r,s),T={},{removeQueryResult:I,removeMutationResult:F,cacheEntriesUpserted:g}=e.internalActions;function E(l,f,b){const A=T[l];A!=null&&A.valueResolved&&(A.valueResolved({data:f,meta:b}),delete A.valueResolved)}function y(l){const f=T[l];f&&(delete T[l],f.cacheEntryRemoved())}function P(l){const{arg:f,requestId:b}=l.meta,{endpointName:A,originalArgs:m}=f;return[A,m,b]}const D=(l,f,b)=>{const A=v(l);function m(d,u,c,S){const w=o(b,u),x=o(f.getState(),u);!w&&x&&O(d,S,u,f,c)}if(r.pending.match(l)){const[d,u,c]=P(l);m(d,A,c,u)}else if(g.match(l))for(const{queryDescription:d,value:u}of l.payload){const{endpointName:c,originalArgs:S,queryCacheKey:w}=d;m(c,w,l.meta.requestId,S),E(w,u,{})}else if(s.pending.match(l)){if(f.getState()[t].mutations[A]){const[u,c,S]=P(l);O(u,c,A,f,S)}}else if(_(l))E(A,l.payload,l.meta.baseQueryMeta);else if(I.match(l)||F.match(l))y(A);else if(e.util.resetApiState.match(l))for(const d of Object.keys(T))y(d)};function v(l){return h(l)?l.meta.arg.queryCacheKey:p(l)?l.meta.arg.fixedCacheKey??l.meta.requestId:I.match(l)?l.payload.queryCacheKey:F.match(l)?ht(l.payload):""}function O(l,f,b,A,m){const d=Qe(n,l),u=d==null?void 0:d.onCacheEntryAdded;if(!u)return;const c={},S=new Promise(C=>{c.cacheEntryRemoved=C}),w=Promise.race([new Promise(C=>{c.valueResolved=C}),S.then(()=>{throw Pr})]);w.catch(()=>{}),T[b]=c;const x=e.endpoints[l].select(kt(d)?f:b),M=A.dispatch((C,j,z)=>z),Q={...A,getCacheEntry:()=>x(A.getState()),requestId:m,extra:M,updateCachedData:kt(d)?C=>A.dispatch(e.util.updateQueryData(l,f,C)):void 0,cacheDataLoaded:w,cacheEntryRemoved:S},R=u(f,Q);Promise.resolve(R).catch(C=>{if(C!==Pr)throw C})}return D},Qi=({api:e,context:{apiUid:t},reducerPath:n})=>(r,s)=>{var i,o;e.util.resetApiState.match(r)&&s.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"&&process.env.NODE_ENV==="development"&&e.internalActions.middlewareRegistered.match(r)&&r.payload===t&&((o=(i=s.getState()[n])==null?void 0:i.config)==null?void 0:o.middlewareRegistered)==="conflict"&&console.warn(`There is a mismatch between slice and middleware for the reducerPath "${n}".
|
|
11
|
+
Object returned was:`,V)}if(V.error)throw new ze(V.error,V.meta);let{data:He}=V;Ke&&!$e(z,"rawResponse")&&(He=await Ce(Ke,V.data,"rawResponseSchema",V.meta));let Te=await J(He,V.meta,K);return le&&!$e(z,"response")&&(Te=await Ce(le,Te,"responseSchema",V.meta)),{...V,data:Te}}if(B&&"infiniteQueryOptions"in C){const{infiniteQueryOptions:K}=C,{maxPages:V=1/0}=K,Oe=u.refetchCachedPages??K.refetchCachedPages??!0;let se;const Ke={pages:[],pageParams:[]},le=(G=o.selectQueryEntry(Q(),u.queryCacheKey))==null?void 0:G.data,Te=T(u,Q())&&!u.direction||!le?Ke:le;if("direction"in u&&u.direction&&Te.pages.length){const ue=u.direction==="backward",Pe=(ue?br:mn)(K,Te,u.originalArgs);se=await U(Te,Pe,V,ue)}else{const{initialPageParam:ue=K.initialPageParam}=u,fe=(le==null?void 0:le.pageParams)??[],Pe=fe[0]??ue,tu=fe.length;if(se=await U(Te,Pe,V),q&&(se={data:se.data.pages[0]}),Oe)for(let Ds=1;Ds<tu;Ds++){const nu=mn(K,se.data,u.originalArgs);se=await U(se.data,nu,V)}}H=se}else H=await ne(u.originalArgs);return j&&!$e(z,"meta")&&H.meta&&(H.meta=await Ce(j,H.meta,"metaSchema",H.meta)),x(H.data,dt({fulfilledTimeStamp:Date.now(),baseQueryMeta:H.meta}))}catch(J){let Z=J;if(Z instanceof ze){let q=O(C,"transformErrorResponse");const{rawErrorResponseSchema:H,errorResponseSchema:U}=C;let{value:ne,meta:K}=Z;try{H&&!$e(z,"rawErrorResponse")&&(ne=await Ce(H,ne,"rawErrorResponseSchema",K)),j&&!$e(z,"meta")&&(K=await Ce(j,K,"metaSchema",K));let V=await q(ne,K,u.originalArgs);return U&&!$e(z,"errorResponse")&&(V=await Ce(U,V,"errorResponseSchema",K)),_(V,dt({baseQueryMeta:K}))}catch(V){Z=V}}try{if(Z instanceof mr){const q={endpoint:u.endpointName,arg:u.originalArgs,type:u.type,queryCacheKey:B?u.queryCacheKey:void 0};(W=C.onSchemaFailure)==null||W.call(C,Z,q),a==null||a(Z,q);const{catchSchemaFailure:H=h}=C;if(H)return _(H(Z,q),dt({baseQueryMeta:Z._bqMeta}))}}catch(q){Z=q}throw typeof process<"u"&&process.env.NODE_ENV!=="production"?console.error(`An unhandled error occurred processing a request for the endpoint "${u.endpointName}".
|
|
12
|
+
In the case of an unhandled error, no tags will be "provided" or "invalidated".`,Z):console.error(Z),Z}};function T(u,c){const S=o.selectQueryEntry(c,u.queryCacheKey),_=o.selectConfig(c).refetchOnMountOrArgChange,x=S==null?void 0:S.fulfilledTimeStamp,M=u.forceRefetch??(u.subscribe&&_);return M?M===!0||(Number(new Date)-Number(x))/1e3>=M:!1}const D=()=>$.createAsyncThunk(`${e}/executeQuery`,p,{getPendingMeta({arg:c}){const S=n[c.endpointName];return dt({startedTimeStamp:Date.now(),...lt(S)?{direction:c.direction}:{}})},condition(c,{getState:S}){var z;const _=S(),x=o.selectQueryEntry(_,c.queryCacheKey),M=x==null?void 0:x.fulfilledTimeStamp,Q=c.originalArgs,R=x==null?void 0:x.originalArgs,C=n[c.endpointName],j=c.direction;return yn(c)?!0:(x==null?void 0:x.status)==="pending"?!1:T(c,_)||Mt(C)&&((z=C==null?void 0:C.forceRefetch)!=null&&z.call(C,{currentArg:Q,previousArg:R,endpointState:x,state:_}))?!0:!(M&&!j)},dispatchConditionRejection:!0}),g=D(),w=D(),l=$.createAsyncThunk(`${e}/executeMutation`,p,{getPendingMeta(){return dt({startedTimeStamp:Date.now()})}}),f=u=>"force"in u,b=u=>"ifOlderThan"in u,A=(u,c,S={})=>(_,x)=>{const M=f(S)&&S.force,Q=b(S)&&S.ifOlderThan,R=(j=!0)=>{const z={forceRefetch:j,subscribe:!1};return s.endpoints[u].initiate(c,z)},C=s.endpoints[u].select(c)(x());if(M)_(R());else if(Q){const j=C==null?void 0:C.fulfilledTimeStamp;if(!j){_(R());return}(Number(new Date)-Number(new Date(j)))/1e3>=Q&&_(R())}else _(R(!1))};function m(u){return c=>{var S,_;return((_=(S=c==null?void 0:c.meta)==null?void 0:S.arg)==null?void 0:_.endpointName)===u}}function d(u,c){return{matchPending:$.isAllOf($.isPending(u),m(c)),matchFulfilled:$.isAllOf($.isFulfilled(u),m(c)),matchRejected:$.isAllOf($.isRejected(u),m(c))}}return{queryThunk:g,mutationThunk:l,infiniteQueryThunk:w,prefetch:A,updateQueryData:F,upsertQueryData:v,patchQueryData:E,buildMatchThunkActions:d}}function mn(e,{pages:t,pageParams:n},r){const s=t.length-1;return e.getNextPageParam(t[s],t,n[s],n,r)}function br(e,{pages:t,pageParams:n},r){var s;return(s=e.getPreviousPageParam)==null?void 0:s.call(e,t[0],t,n[0],n,r)}function Sr(e,t,n,r){return pn(n[e.meta.arg.endpointName][t],$.isFulfilled(e)?e.payload:void 0,$.isRejectedWithValue(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,r)}function vr(e){return oe(e)?Wn(e):e}function Rt(e,t,n){const r=e[t];r&&n(r)}function ht(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Er(e,t,n){const r=e[ht(t)];r&&n(r)}var jt={};function xi({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:r,context:{endpointDefinitions:s,apiUid:i,extractRehydrationInfo:o,hasRehydrationInfo:a},assertTagType:h,config:y}){const E=$.createAction(`${e}/resetApiState`);function P(m,d,u,c){var S;m[S=d.queryCacheKey]??(m[S]={status:be,endpointName:d.endpointName}),Rt(m,d.queryCacheKey,_=>{_.status=un,_.requestId=u&&_.requestId?_.requestId:c.requestId,d.originalArgs!==void 0&&(_.originalArgs=d.originalArgs),_.startedTimeStamp=c.startedTimeStamp;const x=s[c.arg.endpointName];lt(x)&&"direction"in d&&(_.direction=d.direction)})}function I(m,d,u,c){Rt(m,d.arg.queryCacheKey,S=>{if(S.requestId!==d.requestId&&!c)return;const{merge:_}=s[d.arg.endpointName];if(S.status=it,_)if(S.data!==void 0){const{fulfilledTimeStamp:x,arg:M,baseQueryMeta:Q,requestId:R}=d;let C=$.createNextState(S.data,j=>_(j,u,{arg:M.originalArgs,baseQueryMeta:Q,fulfilledTimeStamp:x,requestId:R}));S.data=C}else S.data=u;else S.data=s[d.arg.endpointName].structuralSharing??!0?cn(oe(S.data)?xs(S.data):S.data,u):u;delete S.error,S.fulfilledTimeStamp=d.fulfilledTimeStamp})}const F=$.createSlice({name:`${e}/queries`,initialState:jt,reducers:{removeQueryResult:{reducer(m,{payload:{queryCacheKey:d}}){delete m[d]},prepare:$.prepareAutoBatched()},cacheEntriesUpserted:{reducer(m,d){for(const u of d.payload){const{queryDescription:c,value:S}=u;P(m,c,!0,{arg:c,requestId:d.meta.requestId,startedTimeStamp:d.meta.timestamp}),I(m,{arg:c,requestId:d.meta.requestId,fulfilledTimeStamp:d.meta.timestamp,baseQueryMeta:{}},S,!0)}},prepare:m=>({payload:m.map(c=>{const{endpointName:S,arg:_,value:x}=c,M=s[S];return{queryDescription:{type:ct,endpointName:S,originalArgs:c.arg,queryCacheKey:r({queryArgs:_,endpointDefinition:M,endpointName:S})},value:x}}),meta:{[$.SHOULD_AUTOBATCH]:!0,requestId:$.nanoid(),timestamp:Date.now()}})},queryResultPatched:{reducer(m,{payload:{queryCacheKey:d,patches:u}}){Rt(m,d,c=>{c.data=Yn(c.data,u.concat())})},prepare:$.prepareAutoBatched()}},extraReducers(m){m.addCase(t.pending,(d,{meta:u,meta:{arg:c}})=>{const S=yn(c);P(d,c,S,u)}).addCase(t.fulfilled,(d,{meta:u,payload:c})=>{const S=yn(u.arg);I(d,u,c,S)}).addCase(t.rejected,(d,{meta:{condition:u,arg:c,requestId:S},error:_,payload:x})=>{Rt(d,c.queryCacheKey,M=>{if(!u){if(M.requestId!==S)return;M.status=ot,M.error=x??_}})}).addMatcher(a,(d,u)=>{const{queries:c}=o(u);for(const[S,_]of Object.entries(c))((_==null?void 0:_.status)===it||(_==null?void 0:_.status)===ot)&&(d[S]=_)})}}),v=$.createSlice({name:`${e}/mutations`,initialState:jt,reducers:{removeMutationResult:{reducer(m,{payload:d}){const u=ht(d);u in m&&delete m[u]},prepare:$.prepareAutoBatched()}},extraReducers(m){m.addCase(n.pending,(d,{meta:u,meta:{requestId:c,arg:S,startedTimeStamp:_}})=>{S.track&&(d[ht(u)]={requestId:c,status:un,endpointName:S.endpointName,startedTimeStamp:_})}).addCase(n.fulfilled,(d,{payload:u,meta:c})=>{c.arg.track&&Er(d,c,S=>{S.requestId===c.requestId&&(S.status=it,S.data=u,S.fulfilledTimeStamp=c.fulfilledTimeStamp)})}).addCase(n.rejected,(d,{payload:u,error:c,meta:S})=>{S.arg.track&&Er(d,S,_=>{_.requestId===S.requestId&&(_.status=ot,_.error=u??c)})}).addMatcher(a,(d,u)=>{const{mutations:c}=o(u);for(const[S,_]of Object.entries(c))((_==null?void 0:_.status)===it||(_==null?void 0:_.status)===ot)&&S!==(_==null?void 0:_.requestId)&&(d[S]=_)})}}),O={tags:{},keys:{}},p=$.createSlice({name:`${e}/invalidation`,initialState:O,reducers:{updateProvidedBy:{reducer(m,d){var u,c,S;for(const{queryCacheKey:_,providedTags:x}of d.payload){T(m,_);for(const{type:M,id:Q}of x){const R=(c=(u=m.tags)[M]??(u[M]={}))[S=Q||"__internal_without_id"]??(c[S]=[]);R.includes(_)||R.push(_)}m.keys[_]=x}},prepare:$.prepareAutoBatched()}},extraReducers(m){m.addCase(F.actions.removeQueryResult,(d,{payload:{queryCacheKey:u}})=>{T(d,u)}).addMatcher(a,(d,u)=>{var S,_,x;const{provided:c}=o(u);for(const[M,Q]of Object.entries(c.tags??{}))for(const[R,C]of Object.entries(Q)){const j=(_=(S=d.tags)[M]??(S[M]={}))[x=R||"__internal_without_id"]??(_[x]=[]);for(const z of C)j.includes(z)||j.push(z),d.keys[z]=c.keys[z]}}).addMatcher($.isAnyOf($.isFulfilled(t),$.isRejectedWithValue(t)),(d,u)=>{D(d,[u])}).addMatcher(F.actions.cacheEntriesUpserted.match,(d,u)=>{const c=u.payload.map(({queryDescription:S,value:_})=>({type:"UNKNOWN",payload:_,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:S}}));D(d,c)})}});function T(m,d){var c;const u=vr(m.keys[d]??[]);for(const S of u){const _=S.type,x=S.id??"__internal_without_id",M=(c=m.tags[_])==null?void 0:c[x];M&&(m.tags[_][x]=vr(M).filter(Q=>Q!==d))}delete m.keys[d]}function D(m,d){const u=d.map(c=>{const S=Sr(c,"providesTags",s,h),{queryCacheKey:_}=c.meta.arg;return{queryCacheKey:_,providedTags:S}});p.caseReducers.updateProvidedBy(m,p.actions.updateProvidedBy(u))}const g=$.createSlice({name:`${e}/subscriptions`,initialState:jt,reducers:{updateSubscriptionOptions(m,d){},unsubscribeQueryResult(m,d){},internal_getRTKQSubscriptions(){}}}),w=$.createSlice({name:`${e}/internalSubscriptions`,initialState:jt,reducers:{subscriptionsUpdated:{reducer(m,d){return Yn(m,d.payload)},prepare:$.prepareAutoBatched()}}}),l=$.createSlice({name:`${e}/config`,initialState:{online:fi(),focused:li(),middlewareRegistered:!1,...y},reducers:{middlewareRegistered(m,{payload:d}){m.middlewareRegistered=m.middlewareRegistered==="conflict"||i!==d?"conflict":!0}},extraReducers:m=>{m.addCase(ut,d=>{d.online=!0}).addCase(xt,d=>{d.online=!1}).addCase(at,d=>{d.focused=!0}).addCase(Ct,d=>{d.focused=!1}).addMatcher(a,d=>({...d}))}}),f=$.combineReducers({queries:F.reducer,mutations:v.reducer,provided:p.reducer,subscriptions:w.reducer,config:l.reducer}),b=(m,d)=>f(E.match(d)?void 0:m,d),A={...l.actions,...F.actions,...g.actions,...w.actions,...v.actions,...p.actions,resetApiState:E};return{reducer:b,actions:A}}var ae=Symbol.for("RTKQ/skipToken"),_r={status:be},wr=$.createNextState(_r,()=>{}),Ar=$.createNextState(_r,()=>{});function Ni({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const r=g=>wr,s=g=>Ar;return{buildQuerySelector:I,buildInfiniteQuerySelector:F,buildMutationSelector:v,selectInvalidatedBy:O,selectCachedArgsForQuery:p,selectApiState:o,selectQueries:a,selectMutations:y,selectQueryEntry:h,selectConfig:E};function i(g){return{...g,...rr(g.status)}}function o(g){const w=g[t];if(process.env.NODE_ENV!=="production"&&!w){if(o.triggered)return w;o.triggered=!0,console.error(`Error: No data found at \`state.${t}\`. Did you forget to add the reducer to the store?`)}return w}function a(g){var w;return(w=o(g))==null?void 0:w.queries}function h(g,w){var l;return(l=a(g))==null?void 0:l[w]}function y(g){var w;return(w=o(g))==null?void 0:w.mutations}function E(g){var w;return(w=o(g))==null?void 0:w.config}function P(g,w,l){return f=>{if(f===ae)return n(r,l);const b=e({queryArgs:f,endpointDefinition:w,endpointName:g});return n(m=>h(m,b)??wr,l)}}function I(g,w){return P(g,w,i)}function F(g,w){const{infiniteQueryOptions:l}=w;function f(b){const A={...b,...rr(b.status)},{isLoading:m,isError:d,direction:u}=A,c=u==="forward",S=u==="backward";return{...A,hasNextPage:T(l,A.data,A.originalArgs),hasPreviousPage:D(l,A.data,A.originalArgs),isFetchingNextPage:m&&c,isFetchingPreviousPage:m&&S,isFetchNextPageError:d&&c,isFetchPreviousPageError:d&&S}}return P(g,w,f)}function v(){return g=>{let w;return typeof g=="object"?w=ht(g)??ae:w=g,n(w===ae?s:b=>{var A,m;return((m=(A=o(b))==null?void 0:A.mutations)==null?void 0:m[w])??Ar},i)}}function O(g,w){const l=g[t],f=new Set,b=ln(w,fn,yr);for(const A of b){const m=l.provided.tags[A.type];if(!m)continue;let d=(A.id!==void 0?m[A.id]:Object.values(m).flat())??[];for(const u of d)f.add(u)}return Array.from(f.values()).flatMap(A=>{const m=l.queries[A];return m?{queryCacheKey:A,endpointName:m.endpointName,originalArgs:m.originalArgs}:[]})}function p(g,w){return ln(Object.values(a(g)),l=>(l==null?void 0:l.endpointName)===w&&l.status!==be,l=>l.originalArgs)}function T(g,w,l){return w?mn(g,w,l)!=null:!1}function D(g,w,l){return!w||!g.getPreviousPageParam?!1:br(g,w,l)!=null}}var qe=WeakMap?new WeakMap:void 0,Or=({endpointName:e,queryArgs:t})=>{let n="";const r=qe==null?void 0:qe.get(t);if(typeof r=="string")n=r;else{const s=JSON.stringify(t,(i,o)=>(o=typeof o=="bigint"?{$bigint:o.toString()}:o,o=$.isPlainObject(o)?Object.keys(o).sort().reduce((a,h)=>(a[h]=o[h],a),{}):o,o));$.isPlainObject(t)&&(qe==null||qe.set(t,s)),n=s}return`${e}(${n})`};function Mi(...e){return function(n){const r=Dt(y=>{var E;return(E=n.extractRehydrationInfo)==null?void 0:E.call(n,y,{reducerPath:n.reducerPath??"api"})}),s={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:r,serializeQueryArgs(y){let E=Or;if("serializeQueryArgs"in y.endpointDefinition){const P=y.endpointDefinition.serializeQueryArgs;E=I=>{const F=P(I);return typeof F=="string"?F:Or({...I,queryArgs:F})}}else n.serializeQueryArgs&&(E=n.serializeQueryArgs);return E(y)},tagTypes:[...n.tagTypes||[]]},i={endpointDefinitions:{},batch(y){y()},apiUid:$.nanoid(),extractRehydrationInfo:r,hasRehydrationInfo:Dt(y=>r(y)!=null)},o={injectEndpoints:h,enhanceEndpoints({addTagTypes:y,endpoints:E}){if(y)for(const P of y)s.tagTypes.includes(P)||s.tagTypes.push(P);if(E)for(const[P,I]of Object.entries(E))typeof I=="function"?I(Qe(i,P)):Object.assign(Qe(i,P)||{},I);return o}},a=e.map(y=>y.init(o,s,i));function h(y){const E=y.endpoints({query:P=>({...P,type:ct}),mutation:P=>({...P,type:hr}),infiniteQuery:P=>({...P,type:pr})});for(const[P,I]of Object.entries(E)){if(y.overrideExisting!==!0&&P in i.endpointDefinitions){if(y.overrideExisting==="throw")throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(39):`called \`injectEndpoints\` to override already-existing endpointName ${P} without specifying \`overrideExisting: true\``);typeof process<"u"&&process.env.NODE_ENV==="development"&&console.error(`called \`injectEndpoints\` to override already-existing endpointName ${P} without specifying \`overrideExisting: true\``);continue}if(typeof process<"u"&&process.env.NODE_ENV==="development"&<(I)){const{infiniteQueryOptions:F}=I,{maxPages:v,getPreviousPageParam:O}=F;if(typeof v=="number"){if(v<1)throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(40):`maxPages for endpoint '${P}' must be a number greater than 0`);if(typeof O!="function")throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(41):`getPreviousPageParam for endpoint '${P}' must be a function if maxPages is used`)}}i.endpointDefinitions[P]=I;for(const F of a)F.injectEndpoint(P,I)}return o}return o.injectEndpoints({endpoints:n.endpoints})}}function Se(e,...t){return Object.assign(e,...t)}var ki=({api:e,queryThunk:t,internalState:n,mwApi:r})=>{const s=`${e.reducerPath}/subscriptions`;let i=null,o=null;const{updateSubscriptionOptions:a,unsubscribeQueryResult:h}=e.internalActions,y=(O,p)=>{if(a.match(p)){const{queryCacheKey:D,requestId:g,options:w}=p.payload,l=O.get(D);return l!=null&&l.has(g)&&l.set(g,w),!0}if(h.match(p)){const{queryCacheKey:D,requestId:g}=p.payload,w=O.get(D);return w&&w.delete(g),!0}if(e.internalActions.removeQueryResult.match(p))return O.delete(p.payload.queryCacheKey),!0;if(t.pending.match(p)){const{meta:{arg:D,requestId:g}}=p,w=Ft(O,D.queryCacheKey,dn);return D.subscribe&&w.set(g,D.subscriptionOptions??w.get(g)??{}),!0}let T=!1;if(t.rejected.match(p)){const{meta:{condition:D,arg:g,requestId:w}}=p;if(D&&g.subscribe){const l=Ft(O,g.queryCacheKey,dn);l.set(w,g.subscriptionOptions??l.get(w)??{}),T=!0}}return T},E=()=>n.currentSubscriptions,F={getSubscriptions:E,getSubscriptionCount:O=>{const T=E().get(O);return(T==null?void 0:T.size)??0},isRequestSubscribed:(O,p)=>{var D;const T=E();return!!((D=T==null?void 0:T.get(O))!=null&&D.get(p))}};function v(O){return JSON.parse(JSON.stringify(Object.fromEntries([...O].map(([p,T])=>[p,Object.fromEntries(T)]))))}return(O,p)=>{if(i||(i=v(n.currentSubscriptions)),e.util.resetApiState.match(O))return i={},n.currentSubscriptions.clear(),o=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(O))return[!1,F];const T=y(n.currentSubscriptions,O);let D=!0;if(process.env.NODE_ENV==="test"&&typeof O.type=="string"&&O.type===`${e.reducerPath}/getPolling`)return[!1,n.currentPolls];if(T){o||(o=setTimeout(()=>{const l=v(n.currentSubscriptions),[,f]=Zn(i,()=>l);p.next(e.internalActions.subscriptionsUpdated(f)),i=l,o=null},500));const g=typeof O.type=="string"&&!!O.type.startsWith(s),w=t.rejected.match(O)&&O.meta.condition&&!!O.meta.arg.subscribe;D=!g&&!w}return[D,!1]}},Ri=2147483647/1e3-1,ji=({reducerPath:e,api:t,queryThunk:n,context:r,internalState:s,selectors:{selectQueryEntry:i,selectConfig:o},getRunningQueryThunk:a,mwApi:h})=>{const{removeQueryResult:y,unsubscribeQueryResult:E,cacheEntriesUpserted:P}=t.internalActions,I=$.isAnyOf(E.match,n.fulfilled,n.rejected,P.match);function F(g){const w=s.currentSubscriptions.get(g);return w?w.size>0:!1}const v={};function O(g){var w;for(const l of g.values())(w=l==null?void 0:l.abort)==null||w.call(l)}const p=(g,w)=>{const l=w.getState(),f=o(l);if(I(g)){let b;if(P.match(g))b=g.payload.map(A=>A.queryDescription.queryCacheKey);else{const{queryCacheKey:A}=E.match(g)?g.payload:g.meta.arg;b=[A]}T(b,w,f)}if(t.util.resetApiState.match(g)){for(const[b,A]of Object.entries(v))A&&clearTimeout(A),delete v[b];O(s.runningQueries),O(s.runningMutations)}if(r.hasRehydrationInfo(g)){const{queries:b}=r.extractRehydrationInfo(g);T(Object.keys(b),w,f)}};function T(g,w,l){const f=w.getState();for(const b of g){const A=i(f,b);A!=null&&A.endpointName&&D(b,A.endpointName,w,l)}}function D(g,w,l,f){const b=Qe(r,w),A=(b==null?void 0:b.keepUnusedDataFor)??f.keepUnusedDataFor;if(A===1/0)return;const m=Math.max(0,Math.min(A,Ri));if(!F(g)){const d=v[g];d&&clearTimeout(d),v[g]=setTimeout(()=>{if(!F(g)){const u=i(l.getState(),g);if(u!=null&&u.endpointName){const c=l.dispatch(a(u.endpointName,u.originalArgs));c==null||c.abort()}l.dispatch(y({queryCacheKey:g}))}delete v[g]},m*1e3)}}return p},Tr=new Error("Promise never resolved before cacheEntryRemoved."),zi=({api:e,reducerPath:t,context:n,queryThunk:r,mutationThunk:s,internalState:i,selectors:{selectQueryEntry:o,selectApiState:a}})=>{const h=$.isAsyncThunkAction(r),y=$.isAsyncThunkAction(s),E=$.isFulfilled(r,s),P={},{removeQueryResult:I,removeMutationResult:F,cacheEntriesUpserted:v}=e.internalActions;function O(l,f,b){const A=P[l];A!=null&&A.valueResolved&&(A.valueResolved({data:f,meta:b}),delete A.valueResolved)}function p(l){const f=P[l];f&&(delete P[l],f.cacheEntryRemoved())}function T(l){const{arg:f,requestId:b}=l.meta,{endpointName:A,originalArgs:m}=f;return[A,m,b]}const D=(l,f,b)=>{const A=g(l);function m(d,u,c,S){const _=o(b,u),x=o(f.getState(),u);!_&&x&&w(d,S,u,f,c)}if(r.pending.match(l)){const[d,u,c]=T(l);m(d,A,c,u)}else if(v.match(l))for(const{queryDescription:d,value:u}of l.payload){const{endpointName:c,originalArgs:S,queryCacheKey:_}=d;m(c,_,l.meta.requestId,S),O(_,u,{})}else if(s.pending.match(l)){if(f.getState()[t].mutations[A]){const[u,c,S]=T(l);w(u,c,A,f,S)}}else if(E(l))O(A,l.payload,l.meta.baseQueryMeta);else if(I.match(l)||F.match(l))p(A);else if(e.util.resetApiState.match(l))for(const d of Object.keys(P))p(d)};function g(l){return h(l)?l.meta.arg.queryCacheKey:y(l)?l.meta.arg.fixedCacheKey??l.meta.requestId:I.match(l)?l.payload.queryCacheKey:F.match(l)?ht(l.payload):""}function w(l,f,b,A,m){const d=Qe(n,l),u=d==null?void 0:d.onCacheEntryAdded;if(!u)return;const c={},S=new Promise(C=>{c.cacheEntryRemoved=C}),_=Promise.race([new Promise(C=>{c.valueResolved=C}),S.then(()=>{throw Tr})]);_.catch(()=>{}),P[b]=c;const x=e.endpoints[l].select(kt(d)?f:b),M=A.dispatch((C,j,z)=>z),Q={...A,getCacheEntry:()=>x(A.getState()),requestId:m,extra:M,updateCachedData:kt(d)?C=>A.dispatch(e.util.updateQueryData(l,f,C)):void 0,cacheDataLoaded:_,cacheEntryRemoved:S},R=u(f,Q);Promise.resolve(R).catch(C=>{if(C!==Tr)throw C})}return D},Qi=({api:e,context:{apiUid:t},reducerPath:n})=>(r,s)=>{var i,o;e.util.resetApiState.match(r)&&s.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"&&process.env.NODE_ENV==="development"&&e.internalActions.middlewareRegistered.match(r)&&r.payload===t&&((o=(i=s.getState()[n])==null?void 0:i.config)==null?void 0:o.middlewareRegistered)==="conflict"&&console.warn(`There is a mismatch between slice and middleware for the reducerPath "${n}".
|
|
13
13
|
You can only have one api per reducer path, this will lead to crashes in various situations!${n==="api"?`
|
|
14
|
-
If you have multiple apis, you *have* to specify the reducerPath option when using createApi!`:""}`)},qi=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:r,queryThunk:s,api:i,assertTagType:o,refetchQuery:a,internalState:h})=>{const{removeQueryResult:p}=i.internalActions,_=$.isAnyOf($.isFulfilled(r),$.isRejectedWithValue(r)),T=$.isAnyOf($.isFulfilled(s,r),$.isRejected(s,r));let I=[],F=0;const g=(P,D)=>{(s.pending.match(P)||r.pending.match(P))&&F++,T(P)&&(F=Math.max(0,F-1)),_(P)?y(vr(P,"invalidatesTags",n,o),D):T(P)?y([],D):i.util.invalidateTags.match(P)&&y(pn(P.payload,void 0,void 0,void 0,void 0,o),D)};function E(){return F>0}function y(P,D){const v=D.getState(),O=v[e];if(I.push(...P),O.config.invalidationBehavior==="delayed"&&E())return;const l=I;if(I=[],l.length===0)return;const f=i.util.selectInvalidatedBy(v,l);t.batch(()=>{const b=Array.from(f.values());for(const{queryCacheKey:A}of b){const m=O.queries[A],d=Dt(h.currentSubscriptions,A,dn);m&&(d.size===0?D.dispatch(p({queryCacheKey:A})):m.status!==be&&D.dispatch(a(m)))}})}return g},Li=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:s})=>{const{currentPolls:i,currentSubscriptions:o}=s,a=new Set;let h=null;const p=(y,P)=>{(n.internalActions.updateSubscriptionOptions.match(y)||n.internalActions.unsubscribeQueryResult.match(y))&&_(y.payload.queryCacheKey,P),(t.pending.match(y)||t.rejected.match(y)&&y.meta.condition)&&_(y.meta.arg.queryCacheKey,P),(t.fulfilled.match(y)||t.rejected.match(y)&&!y.meta.condition)&&T(y.meta.arg,P),n.util.resetApiState.match(y)&&(g(),h&&(clearTimeout(h),h=null),a.clear())};function _(y,P){a.add(y),h||(h=setTimeout(()=>{for(const D of a)I({queryCacheKey:D},P);a.clear(),h=null},0))}function T({queryCacheKey:y},P){const D=P.getState()[e],v=D.queries[y],O=o.get(y);if(!v||v.status===be)return;const{lowestPollingInterval:l,skipPollingIfUnfocused:f}=E(O);if(!Number.isFinite(l))return;const b=i.get(y);b!=null&&b.timeout&&(clearTimeout(b.timeout),b.timeout=void 0);const A=Date.now()+l;i.set(y,{nextPollTimestamp:A,pollingInterval:l,timeout:setTimeout(()=>{(D.config.focused||!f)&&P.dispatch(r(v)),T({queryCacheKey:y},P)},l)})}function I({queryCacheKey:y},P){const v=P.getState()[e].queries[y],O=o.get(y);if(!v||v.status===be)return;const{lowestPollingInterval:l}=E(O);if(process.env.NODE_ENV==="test"){const A=i.pollUpdateCounters??(i.pollUpdateCounters={});A[y]??(A[y]=0),A[y]++}if(!Number.isFinite(l)){F(y);return}const f=i.get(y),b=Date.now()+l;(!f||b<f.nextPollTimestamp)&&T({queryCacheKey:y},P)}function F(y){const P=i.get(y);P!=null&&P.timeout&&clearTimeout(P.timeout),i.delete(y)}function g(){for(const y of i.keys())F(y)}function E(y=new Map){let P=!1,D=Number.POSITIVE_INFINITY;for(const v of y.values())v.pollingInterval&&(D=Math.min(v.pollingInterval,D),P=v.skipPollingIfUnfocused||P);return{lowestPollingInterval:D,skipPollingIfUnfocused:P}}return p},Ui=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const s=$.isPending(n,r),i=$.isRejected(n,r),o=$.isFulfilled(n,r),a={};return(p,_)=>{var T,I;if(s(p)){const{requestId:F,arg:{endpointName:g,originalArgs:E}}=p.meta,y=Qe(t,g),P=y==null?void 0:y.onQueryStarted;if(P){const D={},v=new Promise((b,A)=>{D.resolve=b,D.reject=A});v.catch(()=>{}),a[F]=D;const O=e.endpoints[g].select(kt(y)?E:F),l=_.dispatch((b,A,m)=>m),f={..._,getCacheEntry:()=>O(_.getState()),requestId:F,extra:l,updateCachedData:kt(y)?b=>_.dispatch(e.util.updateQueryData(g,E,b)):void 0,queryFulfilled:v};P(E,f)}}else if(o(p)){const{requestId:F,baseQueryMeta:g}=p.meta;(T=a[F])==null||T.resolve({data:p.payload,meta:g}),delete a[F]}else if(i(p)){const{requestId:F,rejectedWithValue:g,baseQueryMeta:E}=p.meta;(I=a[F])==null||I.reject({error:p.payload??p.error,isUnhandledError:!g,meta:E}),delete a[F]}}},Vi=({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:s})=>{const{removeQueryResult:i}=n.internalActions,o=(h,p)=>{at.match(h)&&a(p,"refetchOnFocus"),ut.match(h)&&a(p,"refetchOnReconnect")};function a(h,p){const _=h.getState()[e],T=_.queries,I=s.currentSubscriptions;t.batch(()=>{for(const F of I.keys()){const g=T[F],E=I.get(F);if(!E||!g)continue;const y=[...E.values()];(y.some(D=>D[p]===!0)||y.every(D=>D[p]===void 0)&&_.config[p])&&(E.size===0?h.dispatch(i({queryCacheKey:F})):g.status!==be&&h.dispatch(r(g)))}})}return o};function Ki(e){const{reducerPath:t,queryThunk:n,api:r,context:s,getInternalState:i}=e,{apiUid:o}=s,a={invalidateTags:$.createAction(`${t}/invalidateTags`)},h=I=>I.type.startsWith(`${t}/`),p=[Qi,ji,qi,Li,zi,Ui];return{middleware:I=>{let F=!1;const g=i(I.dispatch),E={...e,internalState:g,refetchQuery:T,isThisApiSliceAction:h,mwApi:I},y=p.map(v=>v(E)),P=ki(E),D=Vi(E);return v=>O=>{if(!$.isAction(O))return v(O);F||(F=!0,I.dispatch(r.internalActions.middlewareRegistered(o)));const l={...I,next:v},f=I.getState(),[b,A]=P(O,l,f);let m;if(b?m=v(O):m=A,I.getState()[t]&&(D(O,l,f),h(O)||s.hasRehydrationInfo(O)))for(const d of y)d(O,l,f);return m}},actions:a};function T(I){return e.api.endpoints[I.endpointName].initiate(I.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Ir=Symbol(),Hi=({createSelector:e=$.createSelector}={})=>({name:Ir,init(t,{baseQuery:n,tagTypes:r,reducerPath:s,serializeQueryArgs:i,keepUnusedDataFor:o,refetchOnMountOrArgChange:a,refetchOnFocus:h,refetchOnReconnect:p,invalidationBehavior:_,onSchemaFailure:T,catchSchemaFailure:I,skipSchemaValidation:F},g){Ws();const E=q=>(typeof process<"u"&&process.env.NODE_ENV==="development"&&(r.includes(q.type)||console.error(`Tag type '${q.type}' was used, but not specified in \`tagTypes\`!`)),q);Object.assign(t,{reducerPath:s,endpoints:{},internalActions:{onOnline:ut,onOffline:xt,onFocus:at,onFocusLost:Ct},util:{}});const y=Ni({serializeQueryArgs:i,reducerPath:s,createSelector:e}),{selectInvalidatedBy:P,selectCachedArgsForQuery:D,buildQuerySelector:v,buildInfiniteQuerySelector:O,buildMutationSelector:l}=y;Se(t.util,{selectInvalidatedBy:P,selectCachedArgsForQuery:D});const{queryThunk:f,infiniteQueryThunk:b,mutationThunk:A,patchQueryData:m,updateQueryData:d,upsertQueryData:u,prefetch:c,buildMatchThunkActions:S}=Ci({baseQuery:n,reducerPath:s,context:g,api:t,serializeQueryArgs:i,assertTagType:E,selectors:y,onSchemaFailure:T,catchSchemaFailure:I,skipSchemaValidation:F}),{reducer:w,actions:x}=xi({context:g,queryThunk:f,infiniteQueryThunk:b,mutationThunk:A,serializeQueryArgs:i,reducerPath:s,assertTagType:E,config:{refetchOnFocus:h,refetchOnReconnect:p,refetchOnMountOrArgChange:a,keepUnusedDataFor:o,reducerPath:s,invalidationBehavior:_}});Se(t.util,{patchQueryData:m,updateQueryData:d,upsertQueryData:u,prefetch:c,resetApiState:x.resetApiState,upsertQueryEntries:x.cacheEntriesUpserted}),Se(t.internalActions,x);const M=new WeakMap,Q=q=>Dt(M,q,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:R,buildInitiateInfiniteQuery:C,buildInitiateMutation:j,getRunningMutationThunk:z,getRunningMutationsThunk:B,getRunningQueriesThunk:G,getRunningQueryThunk:W}=$i({queryThunk:f,mutationThunk:A,infiniteQueryThunk:b,api:t,serializeQueryArgs:i,context:g,getInternalState:Q});Se(t.util,{getRunningMutationThunk:z,getRunningMutationsThunk:B,getRunningQueryThunk:W,getRunningQueriesThunk:G});const{middleware:J,actions:Z}=Ki({reducerPath:s,context:g,queryThunk:f,mutationThunk:A,infiniteQueryThunk:b,api:t,assertTagType:E,selectors:y,getRunningQueryThunk:W,getInternalState:Q});return Se(t.util,Z),Se(t,{reducer:w,middleware:J}),{name:Ir,injectEndpoint(q,H){var K;const ne=(K=t.endpoints)[q]??(K[q]={});Mt(H)&&Se(ne,{name:q,select:v(q,H),initiate:R(q,H)},S(f,q)),Ii(H)&&Se(ne,{name:q,select:l(),initiate:j(q)},S(A,q)),lt(H)&&Se(ne,{name:q,select:O(q,H),initiate:C(q,H)},S(f,q))}}}});function zt(e){return e.replace(e[0],e[0].toUpperCase())}function Bi(e){let t=0;for(const n in e)t++;return t}var Wi="query",Gi="mutation",Zi="infinitequery";function Yi(e){return e.type===Wi}function Ji(e){return e.type===Gi}function Fr(e){return e.type===Zi}function pt(e,...t){return Object.assign(e,...t)}var gn=Symbol();function bn(e){const t=k.useRef(e),n=k.useMemo(()=>cn(t.current,e),[e]);return k.useEffect(()=>{t.current!==n&&(t.current=n)},[n]),n}function Le(e){const t=k.useRef(e);return k.useEffect(()=>{L.shallowEqual(t.current,e)||(t.current=e)},[e]),L.shallowEqual(t.current,e)?t.current:e}var Xi=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eo=Xi(),to=()=>typeof navigator<"u"&&navigator.product==="ReactNative",no=to(),ro=()=>eo||no?k.useLayoutEffect:k.useEffect,so=ro(),Dr=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:rr.pending}:e;function Sn(e,...t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}var vn=["data","status","isLoading","isSuccess","isError","error"];function io({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:r,useStore:s},unstable__sideEffectsInRender:i,createSelector:o},serializeQueryArgs:a,context:h}){const p=i?f=>f():k.useEffect,_=f=>{var b,A;return(A=(b=f.current)==null?void 0:b.unsubscribe)==null?void 0:A.call(b)},T=h.endpointDefinitions;return{buildQueryHooks:v,buildInfiniteQueryHooks:O,buildMutationHook:l,usePrefetch:g};function I(f,b,A){if(b!=null&&b.endpointName&&f.isUninitialized){const{endpointName:w}=b,x=T[w];A!==ae&&a({queryArgs:b.originalArgs,endpointDefinition:x,endpointName:w})===a({queryArgs:A,endpointDefinition:x,endpointName:w})&&(b=void 0)}let m=f.isSuccess?f.data:b==null?void 0:b.data;m===void 0&&(m=f.data);const d=m!==void 0,u=f.isLoading,c=(!b||b.isLoading||b.isUninitialized)&&!d&&u,S=f.isSuccess||d&&(u&&!(b!=null&&b.isError)||f.isUninitialized);return{...f,data:m,currentData:f.data,isFetching:u,isLoading:c,isSuccess:S}}function F(f,b,A){if(b!=null&&b.endpointName&&f.isUninitialized){const{endpointName:w}=b,x=T[w];A!==ae&&a({queryArgs:b.originalArgs,endpointDefinition:x,endpointName:w})===a({queryArgs:A,endpointDefinition:x,endpointName:w})&&(b=void 0)}let m=f.isSuccess?f.data:b==null?void 0:b.data;m===void 0&&(m=f.data);const d=m!==void 0,u=f.isLoading,c=(!b||b.isLoading||b.isUninitialized)&&!d&&u,S=f.isSuccess||u&&d;return{...f,data:m,currentData:f.data,isFetching:u,isLoading:c,isSuccess:S}}function g(f,b){const A=n(),m=Le(b);return k.useCallback((d,u)=>A(e.util.prefetch(f,d,{...m,...u})),[f,A,m])}function E(f,b,{refetchOnReconnect:A,refetchOnFocus:m,refetchOnMountOrArgChange:d,skip:u=!1,pollingInterval:c=0,skipPollingIfUnfocused:S=!1,...w}={}){const{initiate:x}=e.endpoints[f],M=n(),Q=k.useRef(void 0);if(!Q.current){const U=M(e.internalActions.internal_getRTKQSubscriptions());if(process.env.NODE_ENV!=="production"&&(typeof U!="object"||typeof(U==null?void 0:U.type)=="string"))throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.
|
|
15
|
-
You must add the middleware for RTK-Query to function correctly!`);Q.current=U}const R=bn(u?ae:b),C=Le({refetchOnReconnect:A,refetchOnFocus:m,pollingInterval:c,skipPollingIfUnfocused:S}),j=
|
|
16
|
-
Hook ${a} was either not provided or not a function.`)}return{name:oo,init(i,{serializeQueryArgs:o},a){const h=i,{buildQueryHooks:p,buildInfiniteQueryHooks:_,buildMutationHook:T,usePrefetch:I}=io({api:i,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:r,createSelector:n},serializeQueryArgs:o,context:a});return pt(h,{usePrefetch:I}),pt(a,{batch:e}),{injectEndpoint(F,g){if(Yi(g)){const{useQuery:E,useLazyQuery:y,useLazyQuerySubscription:P,useQueryState:D,useQuerySubscription:v}=p(F);pt(h.endpoints[F],{useQuery:E,useLazyQuery:y,useLazyQuerySubscription:P,useQueryState:D,useQuerySubscription:v}),i[`use${zt(F)}Query`]=E,i[`useLazy${zt(F)}Query`]=y}if(Ji(g)){const E=T(F);pt(h.endpoints[F],{useMutation:E}),i[`use${zt(F)}Mutation`]=E}else if(Fr(g)){const{useInfiniteQuery:E,useInfiniteQuerySubscription:y,useInfiniteQueryState:P}=_(F);pt(h.endpoints[F],{useInfiniteQuery:E,useInfiniteQuerySubscription:y,useInfiniteQueryState:P}),i[`use${zt(F)}InfiniteQuery`]=E}}}}}},uo=Mi(Hi(),ao());function co(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var En=()=>Math.random().toString(36).substring(7).split("").join(".");`${En()}`,`${En()}`;function lo(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(po(e))return"date";if(ho(e))return"error";const n=fo(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function fo(e){return typeof e.constructor=="function"?e.constructor.name:null}function ho(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function po(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function yo(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=lo(e)),t}function $r(e,t){return function(...n){return t(e.apply(this,n))}}function he(e,t){if(typeof e=="function")return $r(e,t);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?co(16):`bindActionCreators expected an object or a function, but instead received: '${yo(e)}'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);const n={};for(const r in e){const s=e[r];typeof s=="function"&&(n[r]=$r(s,t))}return n}const Cr="[@infinityloop.labs/frontend-modules - Indexeddb - Service]",mo={isIndexedDBInitialized:!1},xr=$.createSlice({name:Cr,initialState:mo,reducers:{setIsIndexedDBInitialized(e,t){e.isIndexedDBInitialized=t.payload}}}),Nr={...xr.actions},go=xr.reducer,Mr=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Nr,e),[e])},bo=(e=[])=>{const{setIsIndexedDBInitialized:t}=Mr();k.useEffect(()=>{if(!e.length){t(!1);return}let n=!0;return(async()=>{const s=await Promise.all(e.map(async({instance:i,tableNames:o,version:a})=>{try{return await i.createObjectStore(o,a)}catch{return!1}}));n&&t(s.every(Boolean))})().catch(()=>{n&&t(!1)}),()=>{n=!1}},[t])},So={service:(e=[])=>()=>bo(e)},kr="[@infinityloop.labs/frontend-modules - Forms - Service]",vo={formsRegistry:{}},Rr=$.createSlice({name:kr,initialState:vo,reducers:{registerForm:(e,t)=>{e.formsRegistry[t.payload.id]=t.payload},unregisterForm:(e,t)=>{delete e.formsRegistry[t.payload]}}}),jr={...Rr.actions},Eo=Rr.reducer,_o=()=>{const e=L.useDispatch();return k.useMemo(()=>he(jr,e),[e])},zr=async e=>{const n=(await Promise.all(e.map(s=>s.trigger()))).every(Boolean),r=e.map(s=>s.getValues());return{isOk:n,values:r}},wo=()=>{const e=L.useSelector(t=>{var n;return((n=t.forms)==null?void 0:n.formsRegistry)??{}});return async t=>{const n=t.map(r=>e[r]).filter(r=>!!r);return zr(n)}},Ao="[@infinityloop.labs/frontend-modules - appSize - Service]",xe={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Qr=xe.md,Oo={isMobile:!1,isTablet:!1,isHorizontal:!1,screenFlags:{isSM:!1,isMD:!1,isLG:!1,isXL:!1,is2XL:!1},appSize:{innerWidth:null,innerHeight:null,clientWidth:null,clientHeight:null}},qr=$.createSlice({name:Ao,initialState:Oo,reducers:{setIsMobile(e,t){e.isMobile=t.payload},setScreenFlagsByWidth(e,t){const n=Number.isFinite(t.payload)?t.payload:0;e.screenFlags={isSM:n>=xe.sm,isMD:n>=xe.md,isLG:n>=xe.lg,isXL:n>=xe.xl,is2XL:n>=xe["2xl"]}},setAppSize(e,t){e.appSize=t.payload}}}),yt={...qr.actions},To=qr.reducer,Po=()=>{const e=L.useDispatch(),{innerWidth:t,innerHeight:n,clientWidth:r,clientHeight:s}=de.useSizeDetect(),i=L.useSelector(a=>{var h;return!!((h=a.appSize)!=null&&h.isMobile)}),o=de.useDebounce(({nextClientHeight:a,nextClientWidth:h,nextInnerHeight:p,nextInnerWidth:_})=>{const T=_<=Qr;T!==i&&e(yt.setIsMobile(T)),e(yt.setScreenFlagsByWidth(_)),e(yt.setAppSize({clientHeight:a,clientWidth:h,innerHeight:p,innerWidth:_}))},100,[e,i]);k.useEffect(()=>{o({nextClientHeight:s,nextClientWidth:r,nextInnerHeight:n,nextInnerWidth:t})},[s,r,n,t,o])},Io=()=>{const e=L.useDispatch();return k.useMemo(()=>he(yt,e),[e])},Fo={service:Po},Do="[@infinityloop.labs/frontend-modules - Notify - Service]",$o={notifyArray:[]},Lr=$.createSlice({name:Do,initialState:$o,reducers:{addNotify(e,t){e.notifyArray.push(t.payload)},removeNotify(e){e.notifyArray.shift()}}}),Ur={...Lr.actions},Co=Lr.reducer,Vr=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Ur,e),[e])},xo={service:()=>{const{addNotify:e}=Vr();ie.useSubscribe({type:ie.EventTransferActionsEnum.AddNotify,callback:e})}},No="[@infinityloop.labs/frontend-modules - Popup - Service]",Mo={modals:{}},Kr=$.createSlice({name:No,initialState:Mo,reducers:{addModal(e,t){e.modals[t.payload.id]=t.payload},removeModal(e,t){delete e.modals[t.payload.id]}}}),Qt={...Kr.actions},ko=Kr.reducer,Ro=()=>{const e=L.useDispatch(),t=r=>{e(Qt.addModal(r))},n=r=>{e(Qt.removeModal(r))};ie.useSubscribe({type:ie.EventTransferActionsEnum.AddPopUp,callback:t}),ie.useSubscribe({type:ie.EventTransferActionsEnum.RemovePopUp,callback:n})},jo=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Qt,e),[e])},zo={service:Ro},Qo="[@infinityloop.labs/frontend-modules - Router - Service]",qo="/a",Lo={filters:{},isRouterInitialized:!1,pages:["/c","/p","/a","/login"].reduce((e,t)=>(e[t]=!1,e),{})},Hr=$.createSlice({name:Qo,initialState:Lo,reducers:{setQueryParameters(e,t){e.filters=t.payload},setQueryParameter(e,t){e.filters[t.payload.key]=t.payload.value},setIsRouterInitialized(e,t){e.isRouterInitialized=t.payload},setPathNameFlags(e,t){const n=Object.keys(e.pages).reduce((s,i)=>(s[i]=!1,s),{}),r=t.payload?`/${t.payload}`:qo;e.pages={...n,[r]:!0}}}}),Br={...Hr.actions},Uo=Hr.reducer,Wr=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Br,e),[e])},Vo={service:()=>{const e=Gt.useQueryParams(),{pathname:t}=$s.useLocation(),{setQueryParameters:n,setIsRouterInitialized:r,setPathNameFlags:s}=Wr();k.useEffect(()=>{n(e)},[e]),k.useEffect(()=>{const i=t.split("/").filter(Boolean);s(i[0])},[t]),k.useEffect(()=>{r(!0)},[]),k.useEffect(()=>{window.scrollTo({top:0,behavior:"smooth"})},[t])}},Ko=()=>{const e=L.useSelector(t=>{var n;return!!((n=t.theme)!=null&&n.isDarkTheme)});k.useEffect(()=>{if(e){document.body.classList.add("dark");return}document.body.classList.remove("dark")},[e])},Ho="[@infinityloop.labs/frontend-modules - Theme - Service]",Bo={isDarkTheme:!1},Gr=$.createSlice({name:Ho,initialState:Bo,reducers:{setDarkThemeMode(e,t){e.isDarkTheme=t.payload}}}),Zr={...Gr.actions},Wo=Gr.reducer,Go=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Zr,e),[e])},Zo={service:Ko},Yo="[@infinityloop.labs/frontend-modules - Roles - Service]",Jo={isRolesInitialized:!1,currentUserId:null},Yr=$.createSlice({name:Yo,initialState:Jo,reducers:{setRolesInitialized(e,t){e.isRolesInitialized=t.payload},setCurrentUserID(e,t){e.currentUserId=t.payload}}}),Jr={...Yr.actions},Xo=Yr.reducer,_n=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Jr,e),[e])},ea=()=>{const e=L.useSelector(n=>n.roles),t=_n();k.useEffect(()=>{},[e,t])};var Xr=(e=>(e.FIELD="FIELD",e))(Xr||{});function ta(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ne(e){this._maxSize=e,this.clear()}Ne.prototype.clear=function(){this._size=0,this._values=Object.create(null)},Ne.prototype.get=function(e){return this._values[e]},Ne.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var na=/[^.^\]^[]+|(?=\[\]|\.\.)/g,es=/^\d+$/,ra=/^\d/,sa=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,ia=/^\s*(['"]?)(.*?)(\1)\s*$/,wn=512,ts=new Ne(wn),ns=new Ne(wn),rs=new Ne(wn),Me={Cache:Ne,split:On,normalizePath:An,setter:function(e){var t=An(e);return ns.get(e)||ns.set(e,function(r,s){for(var i=0,o=t.length,a=r;i<o-1;){var h=t[i];if(h==="__proto__"||h==="constructor"||h==="prototype")return r;a=a[t[i++]]}a[t[i]]=s})},getter:function(e,t){var n=An(e);return rs.get(e)||rs.set(e,function(s){for(var i=0,o=n.length;i<o;)if(s!=null||!t)s=s[n[i++]];else return;return s})},join:function(e){return e.reduce(function(t,n){return t+(Tn(n)||es.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){oa(Array.isArray(e)?e:On(e),t,n)}};function An(e){return ts.get(e)||ts.set(e,On(e).map(function(t){return t.replace(ia,"$2")}))}function On(e){return e.match(na)||[""]}function oa(e,t,n){var r=e.length,s,i,o,a;for(i=0;i<r;i++)s=e[i],s&&(ca(s)&&(s='"'+s+'"'),a=Tn(s),o=!a&&/^\d+$/.test(s),t.call(n,s,a,o,i,e))}function Tn(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function aa(e){return e.match(ra)&&!e.match(es)}function ua(e){return sa.test(e)}function ca(e){return!Tn(e)&&(aa(e)||ua(e))}const la=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,qt=e=>e.match(la)||[],Lt=e=>e[0].toUpperCase()+e.slice(1),Pn=(e,t)=>qt(e).join(t).toLowerCase(),ss=e=>qt(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,"");var In={words:qt,upperFirst:Lt,camelCase:ss,pascalCase:e=>Lt(ss(e)),snakeCase:e=>Pn(e,"_"),kebabCase:e=>Pn(e,"-"),sentenceCase:e=>Lt(Pn(e," ")),titleCase:e=>qt(e).map(Lt).join(" ")},Fn={exports:{}};Fn.exports=function(e){return is(fa(e),e)},Fn.exports.array=is;function is(e,t){var n=e.length,r=new Array(n),s={},i=n,o=da(t),a=ha(e);for(t.forEach(function(p){if(!a.has(p[0])||!a.has(p[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)s[i]||h(e[i],i,new Set);return r;function h(p,_,T){if(T.has(p)){var I;try{I=", node was:"+JSON.stringify(p)}catch{I=""}throw new Error("Cyclic dependency"+I)}if(!a.has(p))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(p));if(!s[_]){s[_]=!0;var F=o.get(p)||new Set;if(F=Array.from(F),_=F.length){T.add(p);do{var g=F[--_];h(g,a.get(g),T)}while(_);T.delete(p)}r[--n]=p}}}function fa(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var s=e[n];t.add(s[0]),t.add(s[1])}return Array.from(t)}function da(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var s=e[n];t.has(s[0])||t.set(s[0],new Set),t.has(s[1])||t.set(s[1],new Set),t.get(s[0]).add(s[1])}return t}function ha(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var pa=Fn.exports;const ya=ta(pa),ma=Object.prototype.toString,ga=Error.prototype.toString,ba=RegExp.prototype.toString,Sa=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",va=/^Symbol\((.*)\)(.*)$/;function Ea(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function os(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return Ea(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return Sa.call(e).replace(va,"Symbol($1)");const r=ma.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+ga.call(e)+"]":r==="RegExp"?ba.call(e):null}function we(e,t){let n=os(e,t);return n!==null?n:JSON.stringify(e,function(r,s){let i=os(this[r],t);return i!==null?i:s},2)}function as(e){return e==null?[]:[].concat(e)}let us,cs,ls,_a=/\$\{\s*(\w+)\s*\}/g;us=Symbol.toStringTag;class fs{constructor(t,n,r,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[us]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=s,this.errors=[],this.inner=[],as(t).forEach(i=>{if(ee.isError(i)){this.errors.push(...i.errors);const o=i.inner.length?i.inner:[i];this.inner.push(...o)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}cs=Symbol.hasInstance,ls=Symbol.toStringTag;class ee extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(_a,(s,i)=>we(n[i])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,s,i){const o=new fs(t,n,r,s);if(i)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[ls]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ee)}static[cs](t){return fs[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let pe={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const s=r!=null&&r!==n?` (cast from the value \`${we(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${we(n,!0)}\``+s:`${e} must match the configured type. The validated value was: \`${we(n,!0)}\``+s}},te={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},wa={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Dn={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Aa={isValue:"${path} field must be ${value}"},Ut={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:pe,string:te,number:wa,date:Dn,object:Ut,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:Aa,tuple:{notType:e=>{const{path:t,value:n,spec:r}=e,s=r.types.length;if(Array.isArray(n)){if(n.length<s)return`${t} tuple value has too few items, expected a length of ${s} but got ${n.length} for value: \`${we(n,!0)}\``;if(n.length>s)return`${t} tuple value has too many items, expected a length of ${s} but got ${n.length} for value: \`${we(n,!0)}\``}return ee.formatError(pe.notType,e)}}});const $n=e=>e&&e.__isYupSchema__;class Vt{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:s,otherwise:i}=n,o=typeof r=="function"?r:(...a)=>a.every(h=>h===r);return new Vt(t,(a,h)=>{var p;let _=o(...a)?s:i;return(p=_==null?void 0:_(h))!=null?p:h})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(i=>i.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),s=this.fn(r,t,n);if(s===void 0||s===t)return t;if(!$n(s))throw new TypeError("conditions must return a schema object");return s.resolve(n)}}const Kt={context:"$",value:"."};class ke{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Kt.context,this.isValue=this.key[0]===Kt.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Kt.context:this.isValue?Kt.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Me.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let s=this.isContext?r:this.isValue?t:n;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}ke.prototype.__isYupRef=!0;const Re=e=>e==null;function Ue(e){function t({value:n,path:r="",options:s,originalValue:i,schema:o},a,h){const{name:p,test:_,params:T,message:I,skipAbsent:F}=e;let{parent:g,context:E,abortEarly:y=o.spec.abortEarly,disableStackTrace:P=o.spec.disableStackTrace}=s;const D={value:n,parent:g,context:E};function v(u={}){const c=ds(Object.assign({value:n,originalValue:i,label:o.spec.label,path:u.path||r,spec:o.spec,disableStackTrace:u.disableStackTrace||P},T,u.params),D),S=new ee(ee.formatError(u.message||I,c),n,c.path,u.type||p,c.disableStackTrace);return S.params=c,S}const O=y?a:h;let l={path:r,parent:g,type:p,from:s.from,createError:v,resolve(u){return hs(u,D)},options:s,originalValue:i,schema:o};const f=u=>{ee.isError(u)?O(u):u?h(null):O(v())},b=u=>{ee.isError(u)?O(u):a(u)};if(F&&Re(n))return f(!0);let m;try{var d;if(m=_.call(l,n,l),typeof((d=m)==null?void 0:d.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${l.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(m).then(f,b)}}catch(u){b(u);return}f(m)}return t.OPTIONS=e,t}function ds(e,t){if(!e)return e;for(const n of Object.keys(e))e[n]=hs(e[n],t);return e}function hs(e,t){return ke.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function Oa(e,t,n,r=n){let s,i,o;return t?(Me.forEach(t,(a,h,p)=>{let _=h?a.slice(1,a.length-1):a;e=e.resolve({context:r,parent:s,value:n});let T=e.type==="tuple",I=p?parseInt(_,10):0;if(e.innerType||T){if(T&&!p)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&I>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);s=n,n=n&&n[I],e=T?e.spec.types[I]:e.innerType}if(!p){if(!e.fields||!e.fields[_])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);s=n,n=n&&n[_],e=e.fields[_]}i=_,o=h?"["+a+"]":"."+a}),{schema:e,parent:s,parentPath:i}):{parent:s,parentPath:t,schema:e}}class Ht extends Set{describe(){const t=[];for(const n of this.values())t.push(ke.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new Ht(this.values())}merge(t,n){const r=this.clone();return t.forEach(s=>r.add(s)),n.forEach(s=>r.delete(s)),r}}function Ve(e,t=new Map){if($n(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Ve(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,s]of e.entries())n.set(r,Ve(s,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Ve(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,s]of Object.entries(e))n[r]=Ve(s,t)}else throw Error(`Unable to clone ${e}`);return n}function Ta(e){if(!(e!=null&&e.length))return;const t=[];let n="",r=!1,s=!1;for(let i=0;i<e.length;i++){const o=e[i];if(o==="["&&!s){n&&(t.push(...n.split(".").filter(Boolean)),n=""),r=!0;continue}if(o==="]"&&!s){n&&(/^\d+$/.test(n)?t.push(n):t.push(n.replace(/^"|"$/g,"")),n=""),r=!1;continue}if(o==='"'){s=!s;continue}if(o==="."&&!r&&!s){n&&(t.push(n),n="");continue}n+=o}return n&&t.push(...n.split(".").filter(Boolean)),t}function Pa(e,t){const n=t?`${t}.${e.path}`:e.path;return e.errors.map(r=>({message:r,path:Ta(n)}))}function ps(e,t){var n;if(!((n=e.inner)!=null&&n.length)&&e.errors.length)return Pa(e,t);const r=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(s=>ps(s,r))}class ye{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Ht,this._blacklist=new Ht,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(pe.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Ve(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const s=Object.assign({},n.spec,r.spec);return r.spec=s,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(i=>{t.tests.forEach(o=>{i.test(o.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((s,i)=>i.resolve(s,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,s,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(s=t.recursive)!=null?s:this.spec.recursive,disableStackTrace:(i=t.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({},n,{value:t})),s=n.assert==="ignore-optionality",i=r._cast(t,n);if(n.assert!==!1&&!r.isType(i)){if(s&&Re(i))return i;let o=we(t),a=we(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
14
|
+
If you have multiple apis, you *have* to specify the reducerPath option when using createApi!`:""}`)},qi=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:r,queryThunk:s,api:i,assertTagType:o,refetchQuery:a,internalState:h})=>{const{removeQueryResult:y}=i.internalActions,E=$.isAnyOf($.isFulfilled(r),$.isRejectedWithValue(r)),P=$.isAnyOf($.isFulfilled(s,r),$.isRejected(s,r));let I=[],F=0;const v=(T,D)=>{(s.pending.match(T)||r.pending.match(T))&&F++,P(T)&&(F=Math.max(0,F-1)),E(T)?p(Sr(T,"invalidatesTags",n,o),D):P(T)?p([],D):i.util.invalidateTags.match(T)&&p(pn(T.payload,void 0,void 0,void 0,void 0,o),D)};function O(){return F>0}function p(T,D){const g=D.getState(),w=g[e];if(I.push(...T),w.config.invalidationBehavior==="delayed"&&O())return;const l=I;if(I=[],l.length===0)return;const f=i.util.selectInvalidatedBy(g,l);t.batch(()=>{const b=Array.from(f.values());for(const{queryCacheKey:A}of b){const m=w.queries[A],d=Ft(h.currentSubscriptions,A,dn);m&&(d.size===0?D.dispatch(y({queryCacheKey:A})):m.status!==be&&D.dispatch(a(m)))}})}return v},Li=({reducerPath:e,queryThunk:t,api:n,refetchQuery:r,internalState:s})=>{const{currentPolls:i,currentSubscriptions:o}=s,a=new Set;let h=null;const y=(p,T)=>{(n.internalActions.updateSubscriptionOptions.match(p)||n.internalActions.unsubscribeQueryResult.match(p))&&E(p.payload.queryCacheKey,T),(t.pending.match(p)||t.rejected.match(p)&&p.meta.condition)&&E(p.meta.arg.queryCacheKey,T),(t.fulfilled.match(p)||t.rejected.match(p)&&!p.meta.condition)&&P(p.meta.arg,T),n.util.resetApiState.match(p)&&(v(),h&&(clearTimeout(h),h=null),a.clear())};function E(p,T){a.add(p),h||(h=setTimeout(()=>{for(const D of a)I({queryCacheKey:D},T);a.clear(),h=null},0))}function P({queryCacheKey:p},T){const D=T.getState()[e],g=D.queries[p],w=o.get(p);if(!g||g.status===be)return;const{lowestPollingInterval:l,skipPollingIfUnfocused:f}=O(w);if(!Number.isFinite(l))return;const b=i.get(p);b!=null&&b.timeout&&(clearTimeout(b.timeout),b.timeout=void 0);const A=Date.now()+l;i.set(p,{nextPollTimestamp:A,pollingInterval:l,timeout:setTimeout(()=>{(D.config.focused||!f)&&T.dispatch(r(g)),P({queryCacheKey:p},T)},l)})}function I({queryCacheKey:p},T){const g=T.getState()[e].queries[p],w=o.get(p);if(!g||g.status===be)return;const{lowestPollingInterval:l}=O(w);if(process.env.NODE_ENV==="test"){const A=i.pollUpdateCounters??(i.pollUpdateCounters={});A[p]??(A[p]=0),A[p]++}if(!Number.isFinite(l)){F(p);return}const f=i.get(p),b=Date.now()+l;(!f||b<f.nextPollTimestamp)&&P({queryCacheKey:p},T)}function F(p){const T=i.get(p);T!=null&&T.timeout&&clearTimeout(T.timeout),i.delete(p)}function v(){for(const p of i.keys())F(p)}function O(p=new Map){let T=!1,D=Number.POSITIVE_INFINITY;for(const g of p.values())g.pollingInterval&&(D=Math.min(g.pollingInterval,D),T=g.skipPollingIfUnfocused||T);return{lowestPollingInterval:D,skipPollingIfUnfocused:T}}return y},Ui=({api:e,context:t,queryThunk:n,mutationThunk:r})=>{const s=$.isPending(n,r),i=$.isRejected(n,r),o=$.isFulfilled(n,r),a={};return(y,E)=>{var P,I;if(s(y)){const{requestId:F,arg:{endpointName:v,originalArgs:O}}=y.meta,p=Qe(t,v),T=p==null?void 0:p.onQueryStarted;if(T){const D={},g=new Promise((b,A)=>{D.resolve=b,D.reject=A});g.catch(()=>{}),a[F]=D;const w=e.endpoints[v].select(kt(p)?O:F),l=E.dispatch((b,A,m)=>m),f={...E,getCacheEntry:()=>w(E.getState()),requestId:F,extra:l,updateCachedData:kt(p)?b=>E.dispatch(e.util.updateQueryData(v,O,b)):void 0,queryFulfilled:g};T(O,f)}}else if(o(y)){const{requestId:F,baseQueryMeta:v}=y.meta;(P=a[F])==null||P.resolve({data:y.payload,meta:v}),delete a[F]}else if(i(y)){const{requestId:F,rejectedWithValue:v,baseQueryMeta:O}=y.meta;(I=a[F])==null||I.reject({error:y.payload??y.error,isUnhandledError:!v,meta:O}),delete a[F]}}},Vi=({reducerPath:e,context:t,api:n,refetchQuery:r,internalState:s})=>{const{removeQueryResult:i}=n.internalActions,o=(h,y)=>{at.match(h)&&a(y,"refetchOnFocus"),ut.match(h)&&a(y,"refetchOnReconnect")};function a(h,y){const E=h.getState()[e],P=E.queries,I=s.currentSubscriptions;t.batch(()=>{for(const F of I.keys()){const v=P[F],O=I.get(F);if(!O||!v)continue;const p=[...O.values()];(p.some(D=>D[y]===!0)||p.every(D=>D[y]===void 0)&&E.config[y])&&(O.size===0?h.dispatch(i({queryCacheKey:F})):v.status!==be&&h.dispatch(r(v)))}})}return o};function Ki(e){const{reducerPath:t,queryThunk:n,api:r,context:s,getInternalState:i}=e,{apiUid:o}=s,a={invalidateTags:$.createAction(`${t}/invalidateTags`)},h=I=>I.type.startsWith(`${t}/`),y=[Qi,ji,qi,Li,zi,Ui];return{middleware:I=>{let F=!1;const v=i(I.dispatch),O={...e,internalState:v,refetchQuery:P,isThisApiSliceAction:h,mwApi:I},p=y.map(g=>g(O)),T=ki(O),D=Vi(O);return g=>w=>{if(!$.isAction(w))return g(w);F||(F=!0,I.dispatch(r.internalActions.middlewareRegistered(o)));const l={...I,next:g},f=I.getState(),[b,A]=T(w,l,f);let m;if(b?m=g(w):m=A,I.getState()[t]&&(D(w,l,f),h(w)||s.hasRehydrationInfo(w)))for(const d of p)d(w,l,f);return m}},actions:a};function P(I){return e.api.endpoints[I.endpointName].initiate(I.originalArgs,{subscribe:!1,forceRefetch:!0})}}var Pr=Symbol(),Hi=({createSelector:e=$.createSelector}={})=>({name:Pr,init(t,{baseQuery:n,tagTypes:r,reducerPath:s,serializeQueryArgs:i,keepUnusedDataFor:o,refetchOnMountOrArgChange:a,refetchOnFocus:h,refetchOnReconnect:y,invalidationBehavior:E,onSchemaFailure:P,catchSchemaFailure:I,skipSchemaValidation:F},v){Ws();const O=q=>(typeof process<"u"&&process.env.NODE_ENV==="development"&&(r.includes(q.type)||console.error(`Tag type '${q.type}' was used, but not specified in \`tagTypes\`!`)),q);Object.assign(t,{reducerPath:s,endpoints:{},internalActions:{onOnline:ut,onOffline:xt,onFocus:at,onFocusLost:Ct},util:{}});const p=Ni({serializeQueryArgs:i,reducerPath:s,createSelector:e}),{selectInvalidatedBy:T,selectCachedArgsForQuery:D,buildQuerySelector:g,buildInfiniteQuerySelector:w,buildMutationSelector:l}=p;Se(t.util,{selectInvalidatedBy:T,selectCachedArgsForQuery:D});const{queryThunk:f,infiniteQueryThunk:b,mutationThunk:A,patchQueryData:m,updateQueryData:d,upsertQueryData:u,prefetch:c,buildMatchThunkActions:S}=Ci({baseQuery:n,reducerPath:s,context:v,api:t,serializeQueryArgs:i,assertTagType:O,selectors:p,onSchemaFailure:P,catchSchemaFailure:I,skipSchemaValidation:F}),{reducer:_,actions:x}=xi({context:v,queryThunk:f,infiniteQueryThunk:b,mutationThunk:A,serializeQueryArgs:i,reducerPath:s,assertTagType:O,config:{refetchOnFocus:h,refetchOnReconnect:y,refetchOnMountOrArgChange:a,keepUnusedDataFor:o,reducerPath:s,invalidationBehavior:E}});Se(t.util,{patchQueryData:m,updateQueryData:d,upsertQueryData:u,prefetch:c,resetApiState:x.resetApiState,upsertQueryEntries:x.cacheEntriesUpserted}),Se(t.internalActions,x);const M=new WeakMap,Q=q=>Ft(M,q,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:R,buildInitiateInfiniteQuery:C,buildInitiateMutation:j,getRunningMutationThunk:z,getRunningMutationsThunk:B,getRunningQueriesThunk:G,getRunningQueryThunk:W}=$i({queryThunk:f,mutationThunk:A,infiniteQueryThunk:b,api:t,serializeQueryArgs:i,context:v,getInternalState:Q});Se(t.util,{getRunningMutationThunk:z,getRunningMutationsThunk:B,getRunningQueryThunk:W,getRunningQueriesThunk:G});const{middleware:J,actions:Z}=Ki({reducerPath:s,context:v,queryThunk:f,mutationThunk:A,infiniteQueryThunk:b,api:t,assertTagType:O,selectors:p,getRunningQueryThunk:W,getInternalState:Q});return Se(t.util,Z),Se(t,{reducer:_,middleware:J}),{name:Pr,injectEndpoint(q,H){var K;const ne=(K=t.endpoints)[q]??(K[q]={});Mt(H)&&Se(ne,{name:q,select:g(q,H),initiate:R(q,H)},S(f,q)),Ii(H)&&Se(ne,{name:q,select:l(),initiate:j(q)},S(A,q)),lt(H)&&Se(ne,{name:q,select:w(q,H),initiate:C(q,H)},S(f,q))}}}});function zt(e){return e.replace(e[0],e[0].toUpperCase())}function Bi(e){let t=0;for(const n in e)t++;return t}var Wi="query",Gi="mutation",Zi="infinitequery";function Yi(e){return e.type===Wi}function Ji(e){return e.type===Gi}function Ir(e){return e.type===Zi}function pt(e,...t){return Object.assign(e,...t)}var gn=Symbol();function bn(e){const t=k.useRef(e),n=k.useMemo(()=>cn(t.current,e),[e]);return k.useEffect(()=>{t.current!==n&&(t.current=n)},[n]),n}function Le(e){const t=k.useRef(e);return k.useEffect(()=>{L.shallowEqual(t.current,e)||(t.current=e)},[e]),L.shallowEqual(t.current,e)?t.current:e}var Xi=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",eo=Xi(),to=()=>typeof navigator<"u"&&navigator.product==="ReactNative",no=to(),ro=()=>eo||no?k.useLayoutEffect:k.useEffect,so=ro(),Dr=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:nr.pending}:e;function Sn(e,...t){const n={};return t.forEach(r=>{n[r]=e[r]}),n}var vn=["data","status","isLoading","isSuccess","isError","error"];function io({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:r,useStore:s},unstable__sideEffectsInRender:i,createSelector:o},serializeQueryArgs:a,context:h}){const y=i?f=>f():k.useEffect,E=f=>{var b,A;return(A=(b=f.current)==null?void 0:b.unsubscribe)==null?void 0:A.call(b)},P=h.endpointDefinitions;return{buildQueryHooks:g,buildInfiniteQueryHooks:w,buildMutationHook:l,usePrefetch:v};function I(f,b,A){if(b!=null&&b.endpointName&&f.isUninitialized){const{endpointName:_}=b,x=P[_];A!==ae&&a({queryArgs:b.originalArgs,endpointDefinition:x,endpointName:_})===a({queryArgs:A,endpointDefinition:x,endpointName:_})&&(b=void 0)}let m=f.isSuccess?f.data:b==null?void 0:b.data;m===void 0&&(m=f.data);const d=m!==void 0,u=f.isLoading,c=(!b||b.isLoading||b.isUninitialized)&&!d&&u,S=f.isSuccess||d&&(u&&!(b!=null&&b.isError)||f.isUninitialized);return{...f,data:m,currentData:f.data,isFetching:u,isLoading:c,isSuccess:S}}function F(f,b,A){if(b!=null&&b.endpointName&&f.isUninitialized){const{endpointName:_}=b,x=P[_];A!==ae&&a({queryArgs:b.originalArgs,endpointDefinition:x,endpointName:_})===a({queryArgs:A,endpointDefinition:x,endpointName:_})&&(b=void 0)}let m=f.isSuccess?f.data:b==null?void 0:b.data;m===void 0&&(m=f.data);const d=m!==void 0,u=f.isLoading,c=(!b||b.isLoading||b.isUninitialized)&&!d&&u,S=f.isSuccess||u&&d;return{...f,data:m,currentData:f.data,isFetching:u,isLoading:c,isSuccess:S}}function v(f,b){const A=n(),m=Le(b);return k.useCallback((d,u)=>A(e.util.prefetch(f,d,{...m,...u})),[f,A,m])}function O(f,b,{refetchOnReconnect:A,refetchOnFocus:m,refetchOnMountOrArgChange:d,skip:u=!1,pollingInterval:c=0,skipPollingIfUnfocused:S=!1,..._}={}){const{initiate:x}=e.endpoints[f],M=n(),Q=k.useRef(void 0);if(!Q.current){const U=M(e.internalActions.internal_getRTKQSubscriptions());if(process.env.NODE_ENV!=="production"&&(typeof U!="object"||typeof(U==null?void 0:U.type)=="string"))throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.
|
|
15
|
+
You must add the middleware for RTK-Query to function correctly!`);Q.current=U}const R=bn(u?ae:b),C=Le({refetchOnReconnect:A,refetchOnFocus:m,pollingInterval:c,skipPollingIfUnfocused:S}),j=_.initialPageParam,z=Le(j),B=_.refetchCachedPages,G=Le(B),W=k.useRef(void 0);let{queryCacheKey:J,requestId:Z}=W.current||{},q=!1;J&&Z&&(q=Q.current.isRequestSubscribed(J,Z));const H=!q&&W.current!==void 0;return y(()=>{H&&(W.current=void 0)},[H]),y(()=>{var K;const U=W.current;if(typeof process<"u"&&process.env.NODE_ENV==="removeMeOnCompilation"&&console.log(H),R===ae){U==null||U.unsubscribe(),W.current=void 0;return}const ne=(K=W.current)==null?void 0:K.subscriptionOptions;if(!U||U.arg!==R){U==null||U.unsubscribe();const V=M(x(R,{subscriptionOptions:C,forceRefetch:d,...Ir(P[f])?{initialPageParam:z,refetchCachedPages:G}:{}}));W.current=V}else C!==ne&&U.updateSubscriptionOptions(C)},[M,x,d,R,C,H,z,G,f]),[W,M,x,C]}function p(f,b){return(m,{skip:d=!1,selectFromResult:u}={})=>{const{select:c}=e.endpoints[f],S=bn(d?ae:m),_=k.useRef(void 0),x=k.useMemo(()=>o([c(S),(j,z)=>z,j=>S],b,{memoizeOptions:{resultEqualityCheck:L.shallowEqual}}),[c,S]),M=k.useMemo(()=>u?o([x],u,{devModeChecks:{identityFunctionCheck:"never"}}):x,[x,u]),Q=r(j=>M(j,_.current),L.shallowEqual),R=s(),C=x(R.getState(),_.current);return so(()=>{_.current=C},[C]),Q}}function T(f){k.useEffect(()=>()=>{E(f),f.current=void 0},[f])}function D(f){if(!f.current)throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(38):"Cannot refetch a query that has not been started yet.");return f.current.refetch()}function g(f){const b=(d,u={})=>{const[c]=O(f,d,u);return T(c),k.useMemo(()=>({refetch:()=>D(c)}),[c])},A=({refetchOnReconnect:d,refetchOnFocus:u,pollingInterval:c=0,skipPollingIfUnfocused:S=!1}={})=>{const{initiate:_}=e.endpoints[f],x=n(),[M,Q]=k.useState(gn),R=k.useRef(void 0),C=Le({refetchOnReconnect:d,refetchOnFocus:u,pollingInterval:c,skipPollingIfUnfocused:S});y(()=>{var W,J;const G=(W=R.current)==null?void 0:W.subscriptionOptions;C!==G&&((J=R.current)==null||J.updateSubscriptionOptions(C))},[C]);const j=k.useRef(C);y(()=>{j.current=C},[C]);const z=k.useCallback(function(G,W=!1){let J;return t(()=>{E(R),R.current=J=x(_(G,{subscriptionOptions:j.current,forceRefetch:!W})),Q(G)}),J},[x,_]),B=k.useCallback(()=>{var G,W;(G=R.current)!=null&&G.queryCacheKey&&x(e.internalActions.removeQueryResult({queryCacheKey:(W=R.current)==null?void 0:W.queryCacheKey}))},[x]);return k.useEffect(()=>()=>{E(R)},[]),k.useEffect(()=>{M!==gn&&!R.current&&z(M,!0)},[M,z]),k.useMemo(()=>[z,M,{reset:B}],[z,M,B])},m=p(f,I);return{useQueryState:m,useQuerySubscription:b,useLazyQuerySubscription:A,useLazyQuery(d){const[u,c,{reset:S}]=A(d),_=m(c,{...d,skip:c===gn}),x=k.useMemo(()=>({lastArg:c}),[c]);return k.useMemo(()=>[u,{..._,reset:S},x],[u,_,S,x])},useQuery(d,u){const c=b(d,u),S=m(d,{selectFromResult:d===ae||u!=null&&u.skip?void 0:Dr,...u}),_=Sn(S,...vn);return k.useDebugValue(_),k.useMemo(()=>({...S,...c}),[S,c])}}}function w(f){const b=(m,d={})=>{const[u,c,S,_]=O(f,m,d),x=k.useRef(_);y(()=>{x.current=_},[_]);const M=d.refetchCachedPages,Q=Le(M),R=k.useCallback(function(z,B){let G;return t(()=>{E(u),u.current=G=c(S(z,{subscriptionOptions:x.current,direction:B}))}),G},[u,c,S]);T(u);const C=bn(d.skip?ae:m),j=k.useCallback(z=>{if(!u.current)throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(38):"Cannot refetch a query that has not been started yet.");const B={refetchCachedPages:(z==null?void 0:z.refetchCachedPages)??Q};return u.current.refetch(B)},[u,Q]);return k.useMemo(()=>({trigger:R,refetch:j,fetchNextPage:()=>R(C,"forward"),fetchPreviousPage:()=>R(C,"backward")}),[j,R,C])},A=p(f,F);return{useInfiniteQueryState:A,useInfiniteQuerySubscription:b,useInfiniteQuery(m,d){const{refetch:u,fetchNextPage:c,fetchPreviousPage:S}=b(m,d),_=A(m,{selectFromResult:m===ae||d!=null&&d.skip?void 0:Dr,...d}),x=Sn(_,...vn,"hasNextPage","hasPreviousPage");return k.useDebugValue(x),k.useMemo(()=>({..._,fetchNextPage:c,fetchPreviousPage:S,refetch:u}),[_,c,S,u])}}}function l(f){return({selectFromResult:b,fixedCacheKey:A}={})=>{const{select:m,initiate:d}=e.endpoints[f],u=n(),[c,S]=k.useState();k.useEffect(()=>()=>{c!=null&&c.arg.fixedCacheKey||c==null||c.reset()},[c]);const _=k.useCallback(function(G){const W=u(d(G,{fixedCacheKey:A}));return S(W),W},[u,d,A]),{requestId:x}=c||{},M=k.useMemo(()=>m({fixedCacheKey:A,requestId:c==null?void 0:c.requestId}),[A,c,m]),Q=k.useMemo(()=>b?o([M],b):M,[b,M]),R=r(Q,L.shallowEqual),C=A==null?c==null?void 0:c.arg.originalArgs:void 0,j=k.useCallback(()=>{t(()=>{c&&S(void 0),A&&u(e.internalActions.removeMutationResult({requestId:x,fixedCacheKey:A}))})},[u,A,c,x]),z=Sn(R,...vn,"endpointName");k.useDebugValue(z);const B=k.useMemo(()=>({...R,originalArgs:C,reset:j}),[R,C,j]);return k.useMemo(()=>[_,B],[_,B])}}}var oo=Symbol(),ao=({batch:e=L.batch,hooks:t={useDispatch:L.useDispatch,useSelector:L.useSelector,useStore:L.useStore},createSelector:n=tr,unstable__sideEffectsInRender:r=!1,...s}={})=>{if(process.env.NODE_ENV!=="production"){const i=["useDispatch","useSelector","useStore"];let o=!1;for(const a of i)if(Bi(s)>0&&(s[a]&&(o||(console.warn("As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`"),o=!0)),t[a]=s[a]),typeof t[a]!="function")throw new Error(process.env.NODE_ENV==="production"?$.formatProdErrorMessage(36):`When using custom hooks for context, all ${i.length} hooks need to be provided: ${i.join(", ")}.
|
|
16
|
+
Hook ${a} was either not provided or not a function.`)}return{name:oo,init(i,{serializeQueryArgs:o},a){const h=i,{buildQueryHooks:y,buildInfiniteQueryHooks:E,buildMutationHook:P,usePrefetch:I}=io({api:i,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:r,createSelector:n},serializeQueryArgs:o,context:a});return pt(h,{usePrefetch:I}),pt(a,{batch:e}),{injectEndpoint(F,v){if(Yi(v)){const{useQuery:O,useLazyQuery:p,useLazyQuerySubscription:T,useQueryState:D,useQuerySubscription:g}=y(F);pt(h.endpoints[F],{useQuery:O,useLazyQuery:p,useLazyQuerySubscription:T,useQueryState:D,useQuerySubscription:g}),i[`use${zt(F)}Query`]=O,i[`useLazy${zt(F)}Query`]=p}if(Ji(v)){const O=P(F);pt(h.endpoints[F],{useMutation:O}),i[`use${zt(F)}Mutation`]=O}else if(Ir(v)){const{useInfiniteQuery:O,useInfiniteQuerySubscription:p,useInfiniteQueryState:T}=E(F);pt(h.endpoints[F],{useInfiniteQuery:O,useInfiniteQuerySubscription:p,useInfiniteQueryState:T}),i[`use${zt(F)}InfiniteQuery`]=O}}}}}},uo=Mi(Hi(),ao());function co(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var En=()=>Math.random().toString(36).substring(7).split("").join(".");`${En()}`,`${En()}`;function lo(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(po(e))return"date";if(ho(e))return"error";const n=fo(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function fo(e){return typeof e.constructor=="function"?e.constructor.name:null}function ho(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function po(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function yo(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=lo(e)),t}function Fr(e,t){return function(...n){return t(e.apply(this,n))}}function he(e,t){if(typeof e=="function")return Fr(e,t);if(typeof e!="object"||e===null)throw new Error(process.env.NODE_ENV==="production"?co(16):`bindActionCreators expected an object or a function, but instead received: '${yo(e)}'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);const n={};for(const r in e){const s=e[r];typeof s=="function"&&(n[r]=Fr(s,t))}return n}const $r="[@infinityloop.labs/frontend-modules - Indexeddb - Service]",mo={isIndexedDBInitialized:!1},Cr=$.createSlice({name:$r,initialState:mo,reducers:{setIsIndexedDBInitialized(e,t){e.isIndexedDBInitialized=t.payload}}}),xr={...Cr.actions},go=Cr.reducer,Nr=()=>{const e=L.useDispatch();return k.useMemo(()=>he(xr,e),[e])},bo=(e=[])=>{const{setIsIndexedDBInitialized:t}=Nr();k.useEffect(()=>{if(!e.length){t(!1);return}let n=!0;return(async()=>{const s=await Promise.all(e.map(async({instance:i,tableNames:o,version:a})=>{try{return await i.createObjectStore(o,a)}catch{return!1}}));n&&t(s.every(Boolean))})().catch(()=>{n&&t(!1)}),()=>{n=!1}},[t])},So={service:(e=[])=>()=>bo(e)},Mr="[@infinityloop.labs/frontend-modules - Forms - Service]",vo={formsRegistry:{}},kr=$.createSlice({name:Mr,initialState:vo,reducers:{registerForm:(e,t)=>{e.formsRegistry[t.payload.id]=t.payload},unregisterForm:(e,t)=>{delete e.formsRegistry[t.payload]}}}),Rr={...kr.actions},Eo=kr.reducer,_o=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Rr,e),[e])},jr=async e=>{const n=(await Promise.all(e.map(s=>s.trigger()))).every(Boolean),r=e.map(s=>s.getValues());return{isOk:n,values:r}},wo=()=>{const e=L.useSelector(t=>{var n;return((n=t.forms)==null?void 0:n.formsRegistry)??{}});return async t=>{const n=t.map(r=>e[r]).filter(r=>!!r);return jr(n)}},Ao="[@infinityloop.labs/frontend-modules - appSize - Service]",xe={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},zr=xe.md,Oo={isMobile:!1,isTablet:!1,isHorizontal:!1,screenFlags:{isSM:!1,isMD:!1,isLG:!1,isXL:!1,is2XL:!1},appSize:{innerWidth:null,innerHeight:null,clientWidth:null,clientHeight:null}},Qr=$.createSlice({name:Ao,initialState:Oo,reducers:{setIsMobile(e,t){e.isMobile=t.payload},setScreenFlagsByWidth(e,t){const n=Number.isFinite(t.payload)?t.payload:0;e.screenFlags={isSM:n>=xe.sm,isMD:n>=xe.md,isLG:n>=xe.lg,isXL:n>=xe.xl,is2XL:n>=xe["2xl"]}},setAppSize(e,t){e.appSize=t.payload}}}),yt={...Qr.actions},To=Qr.reducer,Po=()=>{const e=L.useDispatch(),{innerWidth:t,innerHeight:n,clientWidth:r,clientHeight:s}=de.useSizeDetect(),i=L.useSelector(a=>{var h;return!!((h=a.appSize)!=null&&h.isMobile)}),o=de.useDebounce(({nextClientHeight:a,nextClientWidth:h,nextInnerHeight:y,nextInnerWidth:E})=>{const P=E<=zr;P!==i&&e(yt.setIsMobile(P)),e(yt.setScreenFlagsByWidth(E)),e(yt.setAppSize({clientHeight:a,clientWidth:h,innerHeight:y,innerWidth:E}))},100,[e,i]);k.useEffect(()=>{o({nextClientHeight:s,nextClientWidth:r,nextInnerHeight:n,nextInnerWidth:t})},[s,r,n,t,o])},Io=()=>{const e=L.useDispatch();return k.useMemo(()=>he(yt,e),[e])},Do={service:Po},Fo="[@infinityloop.labs/frontend-modules - Notify - Service]",$o={notifyArray:[]},qr=$.createSlice({name:Fo,initialState:$o,reducers:{addNotify(e,t){e.notifyArray.push(t.payload)},removeNotify(e){e.notifyArray.shift()}}}),Lr={...qr.actions},Co=qr.reducer,Ur=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Lr,e),[e])},xo={service:()=>{const{addNotify:e}=Ur();ie.useSubscribe({type:ie.EventTransferActionsEnum.AddNotify,callback:e})}},No="[@infinityloop.labs/frontend-modules - Popup - Service]",Mo={modals:{}},Vr=$.createSlice({name:No,initialState:Mo,reducers:{addModal(e,t){e.modals[t.payload.id]=t.payload},removeModal(e,t){delete e.modals[t.payload.id]}}}),Qt={...Vr.actions},ko=Vr.reducer,Ro=()=>{const e=L.useDispatch(),t=r=>{e(Qt.addModal(r))},n=r=>{e(Qt.removeModal(r))};ie.useSubscribe({type:ie.EventTransferActionsEnum.AddPopUp,callback:t}),ie.useSubscribe({type:ie.EventTransferActionsEnum.RemovePopUp,callback:n})},jo=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Qt,e),[e])},zo={service:Ro},Qo="[@infinityloop.labs/frontend-modules - Router - Service]",qo="/a",Lo={filters:{},isRouterInitialized:!1,pages:["/c","/p","/a","/login"].reduce((e,t)=>(e[t]=!1,e),{})},Kr=$.createSlice({name:Qo,initialState:Lo,reducers:{setQueryParameters(e,t){e.filters=t.payload},setQueryParameter(e,t){e.filters[t.payload.key]=t.payload.value},setIsRouterInitialized(e,t){e.isRouterInitialized=t.payload},setPathNameFlags(e,t){const n=Object.keys(e.pages).reduce((s,i)=>(s[i]=!1,s),{}),r=t.payload?`/${t.payload}`:qo;e.pages={...n,[r]:!0}}}}),Hr={...Kr.actions},Uo=Kr.reducer,Br=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Hr,e),[e])},Vo={service:()=>{const e=Gt.useQueryParams(),{pathname:t}=$s.useLocation(),{setQueryParameters:n,setIsRouterInitialized:r,setPathNameFlags:s}=Br();k.useEffect(()=>{n(e)},[e]),k.useEffect(()=>{const i=t.split("/").filter(Boolean);s(i[0])},[t]),k.useEffect(()=>{r(!0)},[]),k.useEffect(()=>{window.scrollTo({top:0,behavior:"smooth"})},[t])}},Ko=()=>{const e=L.useSelector(t=>{var n;return!!((n=t.theme)!=null&&n.isDarkTheme)});k.useEffect(()=>{if(e){document.body.classList.add("dark");return}document.body.classList.remove("dark")},[e])},Ho="[@infinityloop.labs/frontend-modules - Theme - Service]",Bo={isDarkTheme:!1},Wr=$.createSlice({name:Ho,initialState:Bo,reducers:{setDarkThemeMode(e,t){e.isDarkTheme=t.payload}}}),Gr={...Wr.actions},Wo=Wr.reducer,Go=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Gr,e),[e])},Zo={service:Ko},Yo="[@infinityloop.labs/frontend-modules - Roles - Service]",Jo={isRolesInitialized:!1,currentUserId:null},Zr=$.createSlice({name:Yo,initialState:Jo,reducers:{setRolesInitialized(e,t){e.isRolesInitialized=t.payload},setCurrentUserID(e,t){e.currentUserId=t.payload}}}),Yr={...Zr.actions},Xo=Zr.reducer,_n=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Yr,e),[e])},ea=()=>{const e=L.useSelector(n=>n.roles),t=_n();k.useEffect(()=>{},[e,t])};var Jr=(e=>(e.FIELD="FIELD",e))(Jr||{});function ta(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ne(e){this._maxSize=e,this.clear()}Ne.prototype.clear=function(){this._size=0,this._values=Object.create(null)},Ne.prototype.get=function(e){return this._values[e]},Ne.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var na=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Xr=/^\d+$/,ra=/^\d/,sa=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,ia=/^\s*(['"]?)(.*?)(\1)\s*$/,wn=512,es=new Ne(wn),ts=new Ne(wn),ns=new Ne(wn),Me={Cache:Ne,split:On,normalizePath:An,setter:function(e){var t=An(e);return ts.get(e)||ts.set(e,function(r,s){for(var i=0,o=t.length,a=r;i<o-1;){var h=t[i];if(h==="__proto__"||h==="constructor"||h==="prototype")return r;a=a[t[i++]]}a[t[i]]=s})},getter:function(e,t){var n=An(e);return ns.get(e)||ns.set(e,function(s){for(var i=0,o=n.length;i<o;)if(s!=null||!t)s=s[n[i++]];else return;return s})},join:function(e){return e.reduce(function(t,n){return t+(Tn(n)||Xr.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){oa(Array.isArray(e)?e:On(e),t,n)}};function An(e){return es.get(e)||es.set(e,On(e).map(function(t){return t.replace(ia,"$2")}))}function On(e){return e.match(na)||[""]}function oa(e,t,n){var r=e.length,s,i,o,a;for(i=0;i<r;i++)s=e[i],s&&(ca(s)&&(s='"'+s+'"'),a=Tn(s),o=!a&&/^\d+$/.test(s),t.call(n,s,a,o,i,e))}function Tn(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function aa(e){return e.match(ra)&&!e.match(Xr)}function ua(e){return sa.test(e)}function ca(e){return!Tn(e)&&(aa(e)||ua(e))}const la=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,qt=e=>e.match(la)||[],Lt=e=>e[0].toUpperCase()+e.slice(1),Pn=(e,t)=>qt(e).join(t).toLowerCase(),rs=e=>qt(e).reduce((t,n)=>`${t}${t?n[0].toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()}`,"");var In={words:qt,upperFirst:Lt,camelCase:rs,pascalCase:e=>Lt(rs(e)),snakeCase:e=>Pn(e,"_"),kebabCase:e=>Pn(e,"-"),sentenceCase:e=>Lt(Pn(e," ")),titleCase:e=>qt(e).map(Lt).join(" ")},Dn={exports:{}};Dn.exports=function(e){return ss(fa(e),e)},Dn.exports.array=ss;function ss(e,t){var n=e.length,r=new Array(n),s={},i=n,o=da(t),a=ha(e);for(t.forEach(function(y){if(!a.has(y[0])||!a.has(y[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});i--;)s[i]||h(e[i],i,new Set);return r;function h(y,E,P){if(P.has(y)){var I;try{I=", node was:"+JSON.stringify(y)}catch{I=""}throw new Error("Cyclic dependency"+I)}if(!a.has(y))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(y));if(!s[E]){s[E]=!0;var F=o.get(y)||new Set;if(F=Array.from(F),E=F.length){P.add(y);do{var v=F[--E];h(v,a.get(v),P)}while(E);P.delete(y)}r[--n]=y}}}function fa(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var s=e[n];t.add(s[0]),t.add(s[1])}return Array.from(t)}function da(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var s=e[n];t.has(s[0])||t.set(s[0],new Set),t.has(s[1])||t.set(s[1],new Set),t.get(s[0]).add(s[1])}return t}function ha(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var pa=Dn.exports;const ya=ta(pa),ma=Object.prototype.toString,ga=Error.prototype.toString,ba=RegExp.prototype.toString,Sa=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",va=/^Symbol\((.*)\)(.*)$/;function Ea(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function is(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return Ea(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return Sa.call(e).replace(va,"Symbol($1)");const r=ma.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+ga.call(e)+"]":r==="RegExp"?ba.call(e):null}function we(e,t){let n=is(e,t);return n!==null?n:JSON.stringify(e,function(r,s){let i=is(this[r],t);return i!==null?i:s},2)}function os(e){return e==null?[]:[].concat(e)}let as,us,cs,_a=/\$\{\s*(\w+)\s*\}/g;as=Symbol.toStringTag;class ls{constructor(t,n,r,s){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[as]="Error",this.name="ValidationError",this.value=n,this.path=r,this.type=s,this.errors=[],this.inner=[],os(t).forEach(i=>{if(ee.isError(i)){this.errors.push(...i.errors);const o=i.inner.length?i.inner:[i];this.inner.push(...o)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}us=Symbol.hasInstance,cs=Symbol.toStringTag;class ee extends Error{static formatError(t,n){const r=n.label||n.path||"this";return n=Object.assign({},n,{path:r,originalPath:n.path}),typeof t=="string"?t.replace(_a,(s,i)=>we(n[i])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,s,i){const o=new ls(t,n,r,s);if(i)return o;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[cs]="Error",this.name=o.name,this.message=o.message,this.type=o.type,this.value=o.value,this.path=o.path,this.errors=o.errors,this.inner=o.inner,Error.captureStackTrace&&Error.captureStackTrace(this,ee)}static[us](t){return ls[Symbol.hasInstance](t)||super[Symbol.hasInstance](t)}}let pe={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{const s=r!=null&&r!==n?` (cast from the value \`${we(r,!0)}\`).`:".";return t!=="mixed"?`${e} must be a \`${t}\` type, but the final value was: \`${we(n,!0)}\``+s:`${e} must match the configured type. The validated value was: \`${we(n,!0)}\``+s}},te={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},wa={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Fn={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Aa={isValue:"${path} field must be ${value}"},Ut={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:pe,string:te,number:wa,date:Fn,object:Ut,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:Aa,tuple:{notType:e=>{const{path:t,value:n,spec:r}=e,s=r.types.length;if(Array.isArray(n)){if(n.length<s)return`${t} tuple value has too few items, expected a length of ${s} but got ${n.length} for value: \`${we(n,!0)}\``;if(n.length>s)return`${t} tuple value has too many items, expected a length of ${s} but got ${n.length} for value: \`${we(n,!0)}\``}return ee.formatError(pe.notType,e)}}});const $n=e=>e&&e.__isYupSchema__;class Vt{static fromOptions(t,n){if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:s,otherwise:i}=n,o=typeof r=="function"?r:(...a)=>a.every(h=>h===r);return new Vt(t,(a,h)=>{var y;let E=o(...a)?s:i;return(y=E==null?void 0:E(h))!=null?y:h})}constructor(t,n){this.fn=void 0,this.refs=t,this.refs=t,this.fn=n}resolve(t,n){let r=this.refs.map(i=>i.getValue(n==null?void 0:n.value,n==null?void 0:n.parent,n==null?void 0:n.context)),s=this.fn(r,t,n);if(s===void 0||s===t)return t;if(!$n(s))throw new TypeError("conditions must return a schema object");return s.resolve(n)}}const Kt={context:"$",value:"."};class ke{constructor(t,n={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Kt.context,this.isValue=this.key[0]===Kt.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Kt.context:this.isValue?Kt.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Me.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let s=this.isContext?r:this.isValue?t:n;return this.getter&&(s=this.getter(s||{})),this.map&&(s=this.map(s)),s}cast(t,n){return this.getValue(t,n==null?void 0:n.parent,n==null?void 0:n.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}ke.prototype.__isYupRef=!0;const Re=e=>e==null;function Ue(e){function t({value:n,path:r="",options:s,originalValue:i,schema:o},a,h){const{name:y,test:E,params:P,message:I,skipAbsent:F}=e;let{parent:v,context:O,abortEarly:p=o.spec.abortEarly,disableStackTrace:T=o.spec.disableStackTrace}=s;const D={value:n,parent:v,context:O};function g(u={}){const c=fs(Object.assign({value:n,originalValue:i,label:o.spec.label,path:u.path||r,spec:o.spec,disableStackTrace:u.disableStackTrace||T},P,u.params),D),S=new ee(ee.formatError(u.message||I,c),n,c.path,u.type||y,c.disableStackTrace);return S.params=c,S}const w=p?a:h;let l={path:r,parent:v,type:y,from:s.from,createError:g,resolve(u){return ds(u,D)},options:s,originalValue:i,schema:o};const f=u=>{ee.isError(u)?w(u):u?h(null):w(g())},b=u=>{ee.isError(u)?w(u):a(u)};if(F&&Re(n))return f(!0);let m;try{var d;if(m=E.call(l,n,l),typeof((d=m)==null?void 0:d.then)=="function"){if(s.sync)throw new Error(`Validation test of type: "${l.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(m).then(f,b)}}catch(u){b(u);return}f(m)}return t.OPTIONS=e,t}function fs(e,t){if(!e)return e;for(const n of Object.keys(e))e[n]=ds(e[n],t);return e}function ds(e,t){return ke.isRef(e)?e.getValue(t.value,t.parent,t.context):e}function Oa(e,t,n,r=n){let s,i,o;return t?(Me.forEach(t,(a,h,y)=>{let E=h?a.slice(1,a.length-1):a;e=e.resolve({context:r,parent:s,value:n});let P=e.type==="tuple",I=y?parseInt(E,10):0;if(e.innerType||P){if(P&&!y)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${o}" must contain an index to the tuple element, e.g. "${o}[0]"`);if(n&&I>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${a}, in the path: ${t}. because there is no value at that index. `);s=n,n=n&&n[I],e=P?e.spec.types[I]:e.innerType}if(!y){if(!e.fields||!e.fields[E])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e.type}")`);s=n,n=n&&n[E],e=e.fields[E]}i=E,o=h?"["+a+"]":"."+a}),{schema:e,parent:s,parentPath:i}):{parent:s,parentPath:t,schema:e}}class Ht extends Set{describe(){const t=[];for(const n of this.values())t.push(ke.isRef(n)?n.describe():n);return t}resolveAll(t){let n=[];for(const r of this.values())n.push(t(r));return n}clone(){return new Ht(this.values())}merge(t,n){const r=this.clone();return t.forEach(s=>r.add(s)),n.forEach(s=>r.delete(s)),r}}function Ve(e,t=new Map){if($n(e)||!e||typeof e!="object")return e;if(t.has(e))return t.get(e);let n;if(e instanceof Date)n=new Date(e.getTime()),t.set(e,n);else if(e instanceof RegExp)n=new RegExp(e),t.set(e,n);else if(Array.isArray(e)){n=new Array(e.length),t.set(e,n);for(let r=0;r<e.length;r++)n[r]=Ve(e[r],t)}else if(e instanceof Map){n=new Map,t.set(e,n);for(const[r,s]of e.entries())n.set(r,Ve(s,t))}else if(e instanceof Set){n=new Set,t.set(e,n);for(const r of e)n.add(Ve(r,t))}else if(e instanceof Object){n={},t.set(e,n);for(const[r,s]of Object.entries(e))n[r]=Ve(s,t)}else throw Error(`Unable to clone ${e}`);return n}function Ta(e){if(!(e!=null&&e.length))return;const t=[];let n="",r=!1,s=!1;for(let i=0;i<e.length;i++){const o=e[i];if(o==="["&&!s){n&&(t.push(...n.split(".").filter(Boolean)),n=""),r=!0;continue}if(o==="]"&&!s){n&&(/^\d+$/.test(n)?t.push(n):t.push(n.replace(/^"|"$/g,"")),n=""),r=!1;continue}if(o==='"'){s=!s;continue}if(o==="."&&!r&&!s){n&&(t.push(n),n="");continue}n+=o}return n&&t.push(...n.split(".").filter(Boolean)),t}function Pa(e,t){const n=t?`${t}.${e.path}`:e.path;return e.errors.map(r=>({message:r,path:Ta(n)}))}function hs(e,t){var n;if(!((n=e.inner)!=null&&n.length)&&e.errors.length)return Pa(e,t);const r=t?`${t}.${e.path}`:e.path;return e.inner.flatMap(s=>hs(s,r))}class ye{constructor(t){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new Ht,this._blacklist=new Ht,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(pe.notType)}),this.type=t.type,this._typeCheck=t.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},t==null?void 0:t.spec),this.withMutation(n=>{n.nonNullable()})}get _type(){return this.type}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeCheck=this._typeCheck,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.internalTests=Object.assign({},this.internalTests),n.exclusiveTests=Object.assign({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Ve(Object.assign({},this.spec,t)),n}label(t){let n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const s=Object.assign({},n.spec,r.spec);return r.spec=s,r.internalTests=Object.assign({},n.internalTests,r.internalTests),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(i=>{t.tests.forEach(o=>{i.test(o.OPTIONS)})}),r.transforms=[...n.transforms,...r.transforms],r}isType(t){return t==null?!!(this.spec.nullable&&t===null||this.spec.optional&&t===void 0):this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((s,i)=>i.resolve(s,t),n),n=n.resolve(t)}return n}resolveOptions(t){var n,r,s,i;return Object.assign({},t,{from:t.from||[],strict:(n=t.strict)!=null?n:this.spec.strict,abortEarly:(r=t.abortEarly)!=null?r:this.spec.abortEarly,recursive:(s=t.recursive)!=null?s:this.spec.recursive,disableStackTrace:(i=t.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(t,n={}){let r=this.resolve(Object.assign({},n,{value:t})),s=n.assert==="ignore-optionality",i=r._cast(t,n);if(n.assert!==!1&&!r.isType(i)){if(s&&Re(i))return i;let o=we(t),a=we(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r.type}".
|
|
17
17
|
|
|
18
18
|
attempted value: ${o}
|
|
19
|
-
`+(a!==o?`result of cast: ${a}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((s,i)=>i.call(this,s,t,this,n),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,s){let{path:i,originalValue:o=t,strict:a=this.spec.strict}=n,h=t;a||(h=this._cast(h,Object.assign({assert:!1},n)));let p=[];for(let _ of Object.values(this.internalTests))_&&p.push(_);this.runTests({path:i,value:h,originalValue:o,options:n,tests:p},r,_=>{if(_.length)return s(_,h);this.runTests({path:i,value:h,originalValue:o,options:n,tests:this.tests},r,s)})}runTests(t,n,r){let s=!1,{tests:i,value:o,originalValue:a,path:h,options:p}=t,_=E=>{s||(s=!0,n(E,o))},T=E=>{s||(s=!0,r(E,o))},I=i.length,F=[];if(!I)return T([]);let g={value:o,originalValue:a,path:h,options:p,schema:this};for(let E=0;E<i.length;E++){const y=i[E];y(g,_,function(D){D&&(Array.isArray(D)?F.push(...D):F.push(D)),--I<=0&&T(F)})}}asNestedTest({key:t,index:n,parent:r,parentPath:s,originalParent:i,options:o}){const a=t??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const h=typeof a=="number";let p=r[a];const _=Object.assign({},o,{strict:!0,parent:r,value:p,originalValue:i[a],key:void 0,[h?"index":"key"]:a,path:h||a.includes(".")?`${s||""}[${h?a:`"${a}"`}]`:(s?`${s}.`:"")+t});return(T,I,F)=>this.resolve(_)._validate(p,_,I,F)}validate(t,n){var r;let s=this.resolve(Object.assign({},n,{value:t})),i=(r=n==null?void 0:n.disableStackTrace)!=null?r:s.spec.disableStackTrace;return new Promise((o,a)=>s._validate(t,n,(h,p)=>{ee.isError(h)&&(h.value=p),a(h)},(h,p)=>{h.length?a(new ee(h,p,void 0,void 0,i)):o(p)}))}validateSync(t,n){var r;let s=this.resolve(Object.assign({},n,{value:t})),i,o=(r=n==null?void 0:n.disableStackTrace)!=null?r:s.spec.disableStackTrace;return s._validate(t,Object.assign({},n,{sync:!0}),(a,h)=>{throw ee.isError(a)&&(a.value=h),a},(a,h)=>{if(a.length)throw new ee(a,t,void 0,void 0,o);i=h}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(ee.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(ee.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Ve(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=Ue({message:n,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=Ue({message:n,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=pe.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=pe.notNull){return this.nullability(!1,t)}required(t=pe.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=pe.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),s=Ue(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(i||o.OPTIONS.test===s.OPTIONS.test))),r.tests.push(s),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),s=as(t).map(i=>new ke(i));return s.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new Vt(s,n):Vt.fromOptions(s,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=Ue({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=pe.oneOf){let r=this.clone();return t.forEach(s=>{r._whitelist.add(s),r._blacklist.delete(s)}),r.internalTests.whiteList=Ue({message:n,name:"oneOf",skipAbsent:!0,test(s){let i=this.schema._whitelist,o=i.resolveAll(this.resolve);return o.includes(s)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:o}})}}),r}notOneOf(t,n=pe.notOneOf){let r=this.clone();return t.forEach(s=>{r._blacklist.add(s),r._whitelist.delete(s)}),r.internalTests.blacklist=Ue({message:n,name:"notOneOf",test(s){let i=this.schema._blacklist,o=i.resolveAll(this.resolve);return o.includes(s)?this.createError({params:{values:Array.from(i).join(", "),resolved:o}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:s,optional:i,nullable:o}=n.spec;return{meta:s,label:r,optional:i,nullable:o,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.filter((h,p,_)=>_.findIndex(T=>T.OPTIONS.name===h.OPTIONS.name)===p).map(h=>{const p=h.OPTIONS.params&&t?ds(Object.assign({},h.OPTIONS.params),t):h.OPTIONS.params;return{name:h.OPTIONS.name,params:p}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(r){try{return{value:await t.validate(r,{abortEarly:!1})}}catch(s){if(s instanceof ee)return{issues:ps(s)};throw s}}}}}ye.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ye.prototype[`${e}At`]=function(t,n,r={}){const{parent:s,parentPath:i,schema:o}=Oa(this,t,n,r.context);return o[e](s&&s[i],Object.assign({},r,{parent:s,path:t}))};for(const e of["equals","is"])ye.prototype[e]=ye.prototype.oneOf;for(const e of["not","nope"])ye.prototype[e]=ye.prototype.notOneOf;const Ia=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Fa(e){const t=Cn(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function Cn(e){var t,n;const r=Ia.exec(e);return r?{year:ve(r[1]),month:ve(r[2],1)-1,day:ve(r[3],1),hour:ve(r[4]),minute:ve(r[5]),second:ve(r[6]),millisecond:r[7]?ve(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:ve(r[10]),minuteOffset:ve(r[11])}:null}function ve(e,t=0){return Number(e)||t}let Da=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,$a=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Ca=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,xa="^\\d{4}-\\d{2}-\\d{2}",Na="\\d{2}:\\d{2}:\\d{2}",Ma="(([+-]\\d{2}(:?\\d{2})?)|Z)",ka=new RegExp(`${xa}T${Na}(\\.\\d+)?${Ma}$`),Ra=e=>Re(e)||e===e.trim(),ja={}.toString();function ys(){return new ms}class ms extends ye{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n)=>{if(!this.spec.coerce||this.isType(t)||Array.isArray(t))return t;const r=t!=null&&t.toString?t.toString():t;return r===ja?t:r})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||pe.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=te.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=te.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=te.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,s,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:s,name:i}=n:s=n),this.test({name:i||"matches",message:s||te.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=te.email){return this.matches(Da,{name:"email",message:t,excludeEmptyString:!0})}url(t=te.url){return this.matches($a,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=te.uuid){return this.matches(Ca,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,s;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:s=void 0}=t:n=t),this.matches(ka,{name:"datetime",message:n||te.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||te.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const o=Cn(i);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||te.datetime_precision,params:{precision:s},skipAbsent:!0,test:i=>{if(!i||s==null)return!0;const o=Cn(i);return o?o.precision===s:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=te.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:Ra})}lowercase(t=te.lowercase){return this.transform(n=>Re(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Re(n)||n===n.toLowerCase()})}uppercase(t=te.uppercase){return this.transform(n=>Re(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Re(n)||n===n.toUpperCase()})}}ys.prototype=ms.prototype;let za=new Date(""),Qa=e=>Object.prototype.toString.call(e)==="[object Date]";class Bt extends ye{constructor(){super({type:"date",check(t){return Qa(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n)=>!this.spec.coerce||this.isType(t)||t===null?t:(t=Fa(t),isNaN(t)?Bt.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(ke.isRef(t))r=t;else{let s=this.cast(t);if(!this._typeCheck(s))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=s}return r}min(t,n=Dn.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s>=this.resolve(r)}})}max(t,n=Dn.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(s){return s<=this.resolve(r)}})}}Bt.INVALID_DATE=za,Bt.prototype;function qa(e,t=[]){let n=[],r=new Set,s=new Set(t.map(([o,a])=>`${o}-${a}`));function i(o,a){let h=Me.split(o)[0];r.add(h),s.has(`${a}-${h}`)||n.push([a,h])}for(const o of Object.keys(e)){let a=e[o];r.add(o),ke.isRef(a)&&a.isSibling?i(a.path,o):$n(a)&&"deps"in a&&a.deps.forEach(h=>i(h,o))}return ya.array(Array.from(r),n).reverse()}function gs(e,t){let n=1/0;return e.some((r,s)=>{var i;if((i=t.path)!=null&&i.includes(r))return n=s,!0}),n}function bs(e){return(t,n)=>gs(e,t)-gs(e,n)}const La=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function Wt(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=Wt(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=Wt(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(Wt)}):"optional"in e?e.optional():e}const Ua=(e,t)=>{const n=[...Me.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),s=Me.getter(Me.join(n),!0)(e);return!!(s&&r in s)};let Ss=e=>Object.prototype.toString.call(e)==="[object Object]";function vs(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const Va=bs([]);function Es(e){return new _s(e)}class _s extends ye{constructor(t){super({type:"object",check(n){return Ss(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=Va,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let s=super._cast(t,n);if(s===void 0)return this.getDefault(n);if(!this._typeCheck(s))return s;let i=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(s).filter(T=>!this._nodes.includes(T))),h={},p=Object.assign({},n,{parent:h,__validating:n.__validating||!1}),_=!1;for(const T of a){let I=i[T],F=T in s,g=s[T];if(I){let E;p.path=(n.path?`${n.path}.`:"")+T,I=I.resolve({value:g,context:n.context,parent:h});let y=I instanceof ye?I.spec:void 0,P=y==null?void 0:y.strict;if(y!=null&&y.strip){_=_||T in s;continue}E=!n.__validating||!P?I.cast(g,p):g,E!==void 0&&(h[T]=E)}else F&&!o&&(h[T]=g);(F!==T in h||h[T]!==g)&&(_=!0)}return _?h:s}_validate(t,n={},r,s){let{from:i=[],originalValue:o=t,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:o},...i],n.__validating=!0,n.originalValue=o,super._validate(t,n,r,(h,p)=>{if(!a||!Ss(p)){s(h,p);return}o=o||p;let _=[];for(let T of this._nodes){let I=this.fields[T];!I||ke.isRef(I)||_.push(I.asNestedTest({options:n,key:T,parent:p,parentPath:n.path,originalParent:o}))}this.runTests({tests:_,value:p,originalValue:o,options:n},r,T=>{s(T.sort(this._sortErrors).concat(h),p)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[s,i]of Object.entries(this.fields)){const o=r[s];r[s]=o===void 0?i:o}return n.withMutation(s=>s.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var s;const i=this.fields[r];let o=t;(s=o)!=null&&s.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(o):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=qa(t,n),r._sortErrors=bs(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let s=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),s=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),s)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return Wt(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,s])=>t.includes(r)&&t.includes(s)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let s=Me.getter(t,!0);return this.transform(i=>{if(!i)return i;let o=i;return Ua(i,t)&&(o=Object.assign({},i),r||delete o[t],o[n]=s(i)),o})}json(){return this.transform(La)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Ut.exact,test(n){if(n==null)return!0;const r=vs(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=Ut.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(s){if(s==null)return!0;const i=vs(this.schema,s);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=Ut.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const s of Object.keys(n))r[t(s)]=n[s];return r})}camelCase(){return this.transformKeys(In.camelCase)}snakeCase(){return this.transformKeys(In.snakeCase)}constantCase(){return this.transformKeys(t=>In.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[i,o]of Object.entries(n.fields)){var s;let a=t;(s=a)!=null&&s.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),r.fields[i]=o.describe(a)}return r}}Es.prototype=_s.prototype,Es({[Xr.FIELD]:ys().nullable().defined()});const Ka={service:ea},Ha="[@infinityloop.labs/frontend-modules - analyticsEngine - Service]",Ba={isAnalyticsEngineInitialized:!1,scrollStopPoints:[],guardPassPoints:[],yScrollPointsArray:[],isUpperScrolling:!0,isDownScrolling:!1,currentBlocksInViewport:[]},ws=$.createSlice({name:Ha,initialState:Ba,reducers:{setAnalyticsEngineLoading(e,t){e.isAnalyticsEngineInitialized=t.payload},addScrollStopPoint(e,t){e.scrollStopPoints.push(t.payload)},addGuardPassPoint(e,t){e.guardPassPoints.push(t.payload)},addYScrollPoint(e,t){const n=[...e.yScrollPointsArray,t.payload];n.length>2&&n.shift();const s=n[0],i=n[1];e.isDownScrolling=s<i,e.isUpperScrolling=s>i,e.yScrollPointsArray=[...n]},clearAnalyticsPoints(e){e.scrollStopPoints=[],e.guardPassPoints=[]},addBlockToViewportArray(e,t){const n=new Set(e.currentBlocksInViewport);n.add(t.payload),e.currentBlocksInViewport=Array.from(n)},removeBlockFromViewportArray(e,t){e.currentBlocksInViewport=e.currentBlocksInViewport.filter(n=>n!==t.payload)}}}),As={...ws.actions},Wa=ws.reducer,Os=()=>{const e=L.useDispatch();return k.useMemo(()=>he(As,e),[e])},Ga={service:()=>{const{guardPassPoints:e,scrollStopPoints:t,isAnalyticsEngineInitialized:n}=L.useSelector(h=>h.analyticsEngine),{setAnalyticsEngineLoading:r,clearAnalyticsPoints:s,addYScrollPoint:i}=Os();k.useEffect(()=>()=>{s()},[s]),k.useEffect(()=>{const h=e.length>0||t.length>0;h!==n&&r(h)},[e.length,n,t.length,r]);const o=()=>{i(window.scrollY)},a=de.useThrottle(o,600);k.useEffect(()=>(window.addEventListener("scroll",a,{passive:!0}),()=>{window.removeEventListener("scroll",a)}),[])}},Za="[@infinityloop.labs/frontend-modules - Auth - Service]";var Ae=(e=>(e.REFRESH_TOKEN="tra",e.ACCESS_TOKEN="taa",e.LAST_PAGE_BEFORE_LOGIN="lpl",e))(Ae||{}),xn=(e=>(e.HOME="/",e.COURSES="/a",e.COURSE="/c",e.PREVIEW="/p",e.DRAFTS="/d",e.ADMIN_DASHBOARD="/admin-dashboard",e.LOGIN="/login",e))(xn||{}),Ee=(e=>(e.PAGE="page",e.PAGE_SIZE="pageSize",e.REFRESH_TOKEN="refresh_token",e.ACCESS_TOKEN="access_token",e.IS_SOCKET_MODAL_OPEN="is_socket_modal_open",e.IS_BLOCK_MODAL_OPEN="is_block_modal_open",e.SELECTED_MODULE_ID="selected_module_id",e.SELECTED_SOCKET_ID="selected_socket_id",e))(Ee||{});const Ya={isAuthenticated:!0},Ts=$.createSlice({name:Za,initialState:Ya,reducers:{setIsAuthenticated(e,t){e.isAuthenticated=t.payload}}}),Ps={...Ts.actions},Ja=Ts.reducer,Is=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Ps,e),[e])},Xa={service:()=>{const{filters:e}=L.useSelector(E=>E.router),{setIsAuthenticated:t}=Is(),{setCurrentUserID:n}=_n(),r=Gt.useAppSimpleNavigation(),s=k.useRef(e);s.current=e;const{pathname:i}=Gt.useAppLocation(),o=!!i.match(xn.LOGIN),a=()=>{const E=de.getFromLocalStorage(Ae.LAST_PAGE_BEFORE_LOGIN);E!=null&&E.match(xn.LOGIN)||E!=null&&E.trim()?r(E||"/",{...s.current,[Ee.REFRESH_TOKEN]:"",[Ee.ACCESS_TOKEN]:""}):r("/"),de.setToLocalStorage(Ae.LAST_PAGE_BEFORE_LOGIN,"")};k.useEffect(()=>{e[Ee.ACCESS_TOKEN]&&de.setToLocalStorage(Ae.ACCESS_TOKEN,e[Ee.ACCESS_TOKEN]),e[Ee.REFRESH_TOKEN]&&de.setToLocalStorage(Ae.REFRESH_TOKEN,e[Ee.REFRESH_TOKEN])},[e]);const{data:h,isSuccess:p,refetch:_}=Nn.useGetApiMeQuery();k.useEffect(()=>{p&&(o?a():r(null,{...s.current,[Ee.REFRESH_TOKEN]:"",[Ee.ACCESS_TOKEN]:""}),t(!0),n((h==null?void 0:h.user_id)||null)),p||(t(!1),n(null))},[p]);const[T,{data:I,isError:F,isSuccess:g}]=Nn.usePostApiRefreshMutation();k.useEffect(()=>{g&&I&&(de.setToLocalStorage(Ae.ACCESS_TOKEN,I.access_token??""),de.setToLocalStorage(Ae.REFRESH_TOKEN,I.refresh_token??""),ie.eventTransfer({name:ie.EventTransferActionsEnum.RefreshTokenComplete,data:{}}),_())},[g,I]),k.useEffect(()=>{F&&ie.eventTransfer({name:ie.EventTransferActionsEnum.RefreshTokenError,data:{}})},[F]),ie.useSubscribe({type:ie.EventTransferActionsEnum.RefreshTokenStart,callback:()=>{T({domainAuthRefreshRequestDto:{refresh_token:de.getFromLocalStorage(Ae.REFRESH_TOKEN)||""}})}})}};Object.defineProperty(N,"combineReducers",{enumerable:!0,get:()=>$.combineReducers}),Object.defineProperty(N,"configureStore",{enumerable:!0,get:()=>$.configureStore}),Object.defineProperty(N,"createAsyncThunk",{enumerable:!0,get:()=>$.createAsyncThunk}),Object.defineProperty(N,"createListenerMiddleware",{enumerable:!0,get:()=>$.createListenerMiddleware}),Object.defineProperty(N,"createSelector",{enumerable:!0,get:()=>$.createSelector}),Object.defineProperty(N,"createSlice",{enumerable:!0,get:()=>$.createSlice}),Object.defineProperty(N,"Provider",{enumerable:!0,get:()=>L.Provider}),Object.defineProperty(N,"shallowEqual",{enumerable:!0,get:()=>L.shallowEqual}),Object.defineProperty(N,"useDispatch",{enumerable:!0,get:()=>L.useDispatch}),Object.defineProperty(N,"useSelector",{enumerable:!0,get:()=>L.useSelector}),Object.defineProperty(N,"useStore",{enumerable:!0,get:()=>L.useStore}),N.MOBILE_BREAKPOINT=Qr,N.TAILWIND_SCREEN_BREAKPOINTS=xe,N.analyticsEngine=Ga,N.analyticsEngineActions=As,N.analyticsEngineReducer=Wa,N.appSize=Fo,N.appSizeActions=yt,N.appSizeReducer=To,N.auth=Xa,N.authActions=Ps,N.authReducer=Ja,N.createApi=uo,N.fetchBaseQuery=vi,N.formsActions=jr,N.formsName=kr,N.formsReducer=Eo,N.indexeddb=So,N.indexeddbActions=Nr,N.indexeddbName=Cr,N.indexeddbReducer=go,N.notify=xo,N.notifyActions=Ur,N.notifyReducer=Co,N.popup=zo,N.popupActions=Qt,N.popupReducer=ko,N.retry=wi,N.roles=Ka,N.rolesActions=Jr,N.rolesReducer=Xo,N.router=Vo,N.routerActions=Br,N.routerReducer=Uo,N.setupListeners=Pi,N.skipToken=ae,N.theme=Zo,N.themeActions=Zr,N.themeReducer=Wo,N.useAnalyticsEngineActions=Os,N.useAppSizeActions=Io,N.useAuthActions=Is,N.useFormsActions=_o,N.useIndexeddbActions=Mr,N.useNotifyActions=Vr,N.usePopupActions=jo,N.useRolesActions=_n,N.useRouterActions=Wr,N.useThemeActions=Go,N.useValidateDistributedForm=wo,N.validateForms=zr,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
|
19
|
+
`+(a!==o?`result of cast: ${a}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((s,i)=>i.call(this,s,t,this,n),t);return r===void 0&&(r=this.getDefault(n)),r}_validate(t,n={},r,s){let{path:i,originalValue:o=t,strict:a=this.spec.strict}=n,h=t;a||(h=this._cast(h,Object.assign({assert:!1},n)));let y=[];for(let E of Object.values(this.internalTests))E&&y.push(E);this.runTests({path:i,value:h,originalValue:o,options:n,tests:y},r,E=>{if(E.length)return s(E,h);this.runTests({path:i,value:h,originalValue:o,options:n,tests:this.tests},r,s)})}runTests(t,n,r){let s=!1,{tests:i,value:o,originalValue:a,path:h,options:y}=t,E=O=>{s||(s=!0,n(O,o))},P=O=>{s||(s=!0,r(O,o))},I=i.length,F=[];if(!I)return P([]);let v={value:o,originalValue:a,path:h,options:y,schema:this};for(let O=0;O<i.length;O++){const p=i[O];p(v,E,function(D){D&&(Array.isArray(D)?F.push(...D):F.push(D)),--I<=0&&P(F)})}}asNestedTest({key:t,index:n,parent:r,parentPath:s,originalParent:i,options:o}){const a=t??n;if(a==null)throw TypeError("Must include `key` or `index` for nested validations");const h=typeof a=="number";let y=r[a];const E=Object.assign({},o,{strict:!0,parent:r,value:y,originalValue:i[a],key:void 0,[h?"index":"key"]:a,path:h||a.includes(".")?`${s||""}[${h?a:`"${a}"`}]`:(s?`${s}.`:"")+t});return(P,I,F)=>this.resolve(E)._validate(y,E,I,F)}validate(t,n){var r;let s=this.resolve(Object.assign({},n,{value:t})),i=(r=n==null?void 0:n.disableStackTrace)!=null?r:s.spec.disableStackTrace;return new Promise((o,a)=>s._validate(t,n,(h,y)=>{ee.isError(h)&&(h.value=y),a(h)},(h,y)=>{h.length?a(new ee(h,y,void 0,void 0,i)):o(y)}))}validateSync(t,n){var r;let s=this.resolve(Object.assign({},n,{value:t})),i,o=(r=n==null?void 0:n.disableStackTrace)!=null?r:s.spec.disableStackTrace;return s._validate(t,Object.assign({},n,{sync:!0}),(a,h)=>{throw ee.isError(a)&&(a.value=h),a},(a,h)=>{if(a.length)throw new ee(a,t,void 0,void 0,o);i=h}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(ee.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(ee.isError(r))return!1;throw r}}_getDefault(t){let n=this.spec.default;return n==null?n:typeof n=="function"?n.call(this,t):Ve(n)}getDefault(t){return this.resolve(t||{})._getDefault(t)}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){return this.clone({strict:t})}nullability(t,n){const r=this.clone({nullable:t});return r.internalTests.nullable=Ue({message:n,name:"nullable",test(s){return s===null?this.schema.spec.nullable:!0}}),r}optionality(t,n){const r=this.clone({optional:t});return r.internalTests.optionality=Ue({message:n,name:"optionality",test(s){return s===void 0?this.schema.spec.optional:!0}}),r}optional(){return this.optionality(!0)}defined(t=pe.defined){return this.optionality(!1,t)}nullable(){return this.nullability(!0)}nonNullable(t=pe.notNull){return this.nullability(!1,t)}required(t=pe.required){return this.clone().withMutation(n=>n.nonNullable(t).defined(t))}notRequired(){return this.clone().withMutation(t=>t.nullable().optional())}transform(t){let n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=pe.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),s=Ue(n),i=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(i||o.OPTIONS.test===s.OPTIONS.test))),r.tests.push(s),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),s=os(t).map(i=>new ke(i));return s.forEach(i=>{i.isSibling&&r.deps.push(i.key)}),r.conditions.push(typeof n=="function"?new Vt(s,n):Vt.fromOptions(s,n)),r}typeError(t){let n=this.clone();return n.internalTests.typeError=Ue({message:t,name:"typeError",skipAbsent:!0,test(r){return this.schema._typeCheck(r)?!0:this.createError({params:{type:this.schema.type}})}}),n}oneOf(t,n=pe.oneOf){let r=this.clone();return t.forEach(s=>{r._whitelist.add(s),r._blacklist.delete(s)}),r.internalTests.whiteList=Ue({message:n,name:"oneOf",skipAbsent:!0,test(s){let i=this.schema._whitelist,o=i.resolveAll(this.resolve);return o.includes(s)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:o}})}}),r}notOneOf(t,n=pe.notOneOf){let r=this.clone();return t.forEach(s=>{r._blacklist.add(s),r._whitelist.delete(s)}),r.internalTests.blacklist=Ue({message:n,name:"notOneOf",test(s){let i=this.schema._blacklist,o=i.resolveAll(this.resolve);return o.includes(s)?this.createError({params:{values:Array.from(i).join(", "),resolved:o}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(t){const n=(t?this.resolve(t):this).clone(),{label:r,meta:s,optional:i,nullable:o}=n.spec;return{meta:s,label:r,optional:i,nullable:o,default:n.getDefault(t),type:n.type,oneOf:n._whitelist.describe(),notOneOf:n._blacklist.describe(),tests:n.tests.filter((h,y,E)=>E.findIndex(P=>P.OPTIONS.name===h.OPTIONS.name)===y).map(h=>{const y=h.OPTIONS.params&&t?fs(Object.assign({},h.OPTIONS.params),t):h.OPTIONS.params;return{name:h.OPTIONS.name,params:y}})}}get"~standard"(){const t=this;return{version:1,vendor:"yup",async validate(r){try{return{value:await t.validate(r,{abortEarly:!1})}}catch(s){if(s instanceof ee)return{issues:hs(s)};throw s}}}}}ye.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ye.prototype[`${e}At`]=function(t,n,r={}){const{parent:s,parentPath:i,schema:o}=Oa(this,t,n,r.context);return o[e](s&&s[i],Object.assign({},r,{parent:s,path:t}))};for(const e of["equals","is"])ye.prototype[e]=ye.prototype.oneOf;for(const e of["not","nope"])ye.prototype[e]=ye.prototype.notOneOf;const Ia=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function Da(e){const t=Cn(e);if(!t)return Date.parse?Date.parse(e):Number.NaN;if(t.z===void 0&&t.plusMinus===void 0)return new Date(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond).valueOf();let n=0;return t.z!=="Z"&&t.plusMinus!==void 0&&(n=t.hourOffset*60+t.minuteOffset,t.plusMinus==="+"&&(n=0-n)),Date.UTC(t.year,t.month,t.day,t.hour,t.minute+n,t.second,t.millisecond)}function Cn(e){var t,n;const r=Ia.exec(e);return r?{year:ve(r[1]),month:ve(r[2],1)-1,day:ve(r[3],1),hour:ve(r[4]),minute:ve(r[5]),second:ve(r[6]),millisecond:r[7]?ve(r[7].substring(0,3)):0,precision:(t=(n=r[7])==null?void 0:n.length)!=null?t:void 0,z:r[8]||void 0,plusMinus:r[9]||void 0,hourOffset:ve(r[10]),minuteOffset:ve(r[11])}:null}function ve(e,t=0){return Number(e)||t}let Fa=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,$a=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Ca=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,xa="^\\d{4}-\\d{2}-\\d{2}",Na="\\d{2}:\\d{2}:\\d{2}",Ma="(([+-]\\d{2}(:?\\d{2})?)|Z)",ka=new RegExp(`${xa}T${Na}(\\.\\d+)?${Ma}$`),Ra=e=>Re(e)||e===e.trim(),ja={}.toString();function ps(){return new ys}class ys extends ye{constructor(){super({type:"string",check(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}}),this.withMutation(()=>{this.transform((t,n)=>{if(!this.spec.coerce||this.isType(t)||Array.isArray(t))return t;const r=t!=null&&t.toString?t.toString():t;return r===ja?t:r})})}required(t){return super.required(t).withMutation(n=>n.test({message:t||pe.required,name:"required",skipAbsent:!0,test:r=>!!r.length}))}notRequired(){return super.notRequired().withMutation(t=>(t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t))}length(t,n=te.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},skipAbsent:!0,test(r){return r.length===this.resolve(t)}})}min(t,n=te.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(r){return r.length>=this.resolve(t)}})}max(t,n=te.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},skipAbsent:!0,test(r){return r.length<=this.resolve(t)}})}matches(t,n){let r=!1,s,i;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:s,name:i}=n:s=n),this.test({name:i||"matches",message:s||te.matches,params:{regex:t},skipAbsent:!0,test:o=>o===""&&r||o.search(t)!==-1})}email(t=te.email){return this.matches(Fa,{name:"email",message:t,excludeEmptyString:!0})}url(t=te.url){return this.matches($a,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=te.uuid){return this.matches(Ca,{name:"uuid",message:t,excludeEmptyString:!1})}datetime(t){let n="",r,s;return t&&(typeof t=="object"?{message:n="",allowOffset:r=!1,precision:s=void 0}=t:n=t),this.matches(ka,{name:"datetime",message:n||te.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:n||te.datetime_offset,params:{allowOffset:r},skipAbsent:!0,test:i=>{if(!i||r)return!0;const o=Cn(i);return o?!!o.z:!1}}).test({name:"datetime_precision",message:n||te.datetime_precision,params:{precision:s},skipAbsent:!0,test:i=>{if(!i||s==null)return!0;const o=Cn(i);return o?o.precision===s:!1}})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=te.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:Ra})}lowercase(t=te.lowercase){return this.transform(n=>Re(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Re(n)||n===n.toLowerCase()})}uppercase(t=te.uppercase){return this.transform(n=>Re(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,skipAbsent:!0,test:n=>Re(n)||n===n.toUpperCase()})}}ps.prototype=ys.prototype;let za=new Date(""),Qa=e=>Object.prototype.toString.call(e)==="[object Date]";class Bt extends ye{constructor(){super({type:"date",check(t){return Qa(t)&&!isNaN(t.getTime())}}),this.withMutation(()=>{this.transform((t,n)=>!this.spec.coerce||this.isType(t)||t===null?t:(t=Da(t),isNaN(t)?Bt.INVALID_DATE:new Date(t)))})}prepareParam(t,n){let r;if(ke.isRef(t))r=t;else{let s=this.cast(t);if(!this._typeCheck(s))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=s}return r}min(t,n=Fn.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},skipAbsent:!0,test(s){return s>=this.resolve(r)}})}max(t,n=Fn.max){let r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},skipAbsent:!0,test(s){return s<=this.resolve(r)}})}}Bt.INVALID_DATE=za,Bt.prototype;function qa(e,t=[]){let n=[],r=new Set,s=new Set(t.map(([o,a])=>`${o}-${a}`));function i(o,a){let h=Me.split(o)[0];r.add(h),s.has(`${a}-${h}`)||n.push([a,h])}for(const o of Object.keys(e)){let a=e[o];r.add(o),ke.isRef(a)&&a.isSibling?i(a.path,o):$n(a)&&"deps"in a&&a.deps.forEach(h=>i(h,o))}return ya.array(Array.from(r),n).reverse()}function ms(e,t){let n=1/0;return e.some((r,s)=>{var i;if((i=t.path)!=null&&i.includes(r))return n=s,!0}),n}function gs(e){return(t,n)=>ms(e,t)-ms(e,n)}const La=(e,t,n)=>{if(typeof e!="string")return e;let r=e;try{r=JSON.parse(e)}catch{}return n.isType(r)?r:e};function Wt(e){if("fields"in e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=Wt(r);return e.setFields(t)}if(e.type==="array"){const t=e.optional();return t.innerType&&(t.innerType=Wt(t.innerType)),t}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(Wt)}):"optional"in e?e.optional():e}const Ua=(e,t)=>{const n=[...Me.normalizePath(t)];if(n.length===1)return n[0]in e;let r=n.pop(),s=Me.getter(Me.join(n),!0)(e);return!!(s&&r in s)};let bs=e=>Object.prototype.toString.call(e)==="[object Object]";function Ss(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const Va=gs([]);function vs(e){return new Es(e)}class Es extends ye{constructor(t){super({type:"object",check(n){return bs(n)||typeof n=="function"}}),this.fields=Object.create(null),this._sortErrors=Va,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{t&&this.shape(t)})}_cast(t,n={}){var r;let s=super._cast(t,n);if(s===void 0)return this.getDefault(n);if(!this._typeCheck(s))return s;let i=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,a=[].concat(this._nodes,Object.keys(s).filter(P=>!this._nodes.includes(P))),h={},y=Object.assign({},n,{parent:h,__validating:n.__validating||!1}),E=!1;for(const P of a){let I=i[P],F=P in s,v=s[P];if(I){let O;y.path=(n.path?`${n.path}.`:"")+P,I=I.resolve({value:v,context:n.context,parent:h});let p=I instanceof ye?I.spec:void 0,T=p==null?void 0:p.strict;if(p!=null&&p.strip){E=E||P in s;continue}O=!n.__validating||!T?I.cast(v,y):v,O!==void 0&&(h[P]=O)}else F&&!o&&(h[P]=v);(F!==P in h||h[P]!==v)&&(E=!0)}return E?h:s}_validate(t,n={},r,s){let{from:i=[],originalValue:o=t,recursive:a=this.spec.recursive}=n;n.from=[{schema:this,value:o},...i],n.__validating=!0,n.originalValue=o,super._validate(t,n,r,(h,y)=>{if(!a||!bs(y)){s(h,y);return}o=o||y;let E=[];for(let P of this._nodes){let I=this.fields[P];!I||ke.isRef(I)||E.push(I.asNestedTest({options:n,key:P,parent:y,parentPath:n.path,originalParent:o}))}this.runTests({tests:E,value:y,originalValue:o,options:n},r,P=>{s(P.sort(this._sortErrors).concat(h),y)})})}clone(t){const n=super.clone(t);return n.fields=Object.assign({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[s,i]of Object.entries(this.fields)){const o=r[s];r[s]=o===void 0?i:o}return n.withMutation(s=>s.setFields(r,[...this._excludedEdges,...t._excludedEdges]))}_getDefault(t){if("default"in this.spec)return super._getDefault(t);if(!this._nodes.length)return;let n={};return this._nodes.forEach(r=>{var s;const i=this.fields[r];let o=t;(s=o)!=null&&s.value&&(o=Object.assign({},o,{parent:o.value,value:o.value[r]})),n[r]=i&&"getDefault"in i?i.getDefault(o):void 0}),n}setFields(t,n){let r=this.clone();return r.fields=t,r._nodes=qa(t,n),r._sortErrors=gs(Object.keys(t)),n&&(r._excludedEdges=n),r}shape(t,n=[]){return this.clone().withMutation(r=>{let s=r._excludedEdges;return n.length&&(Array.isArray(n[0])||(n=[n]),s=[...r._excludedEdges,...n]),r.setFields(Object.assign(r.fields,t),s)})}partial(){const t={};for(const[n,r]of Object.entries(this.fields))t[n]="optional"in r&&r.optional instanceof Function?r.optional():r;return this.setFields(t)}deepPartial(){return Wt(this)}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.setFields(n,this._excludedEdges.filter(([r,s])=>t.includes(r)&&t.includes(s)))}omit(t){const n=[];for(const r of Object.keys(this.fields))t.includes(r)||n.push(r);return this.pick(n)}from(t,n,r){let s=Me.getter(t,!0);return this.transform(i=>{if(!i)return i;let o=i;return Ua(i,t)&&(o=Object.assign({},i),r||delete o[t],o[n]=s(i)),o})}json(){return this.transform(La)}exact(t){return this.test({name:"exact",exclusive:!0,message:t||Ut.exact,test(n){if(n==null)return!0;const r=Ss(this.schema,n);return r.length===0||this.createError({params:{properties:r.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(t=!0,n=Ut.noUnknown){typeof t!="boolean"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(s){if(s==null)return!0;const i=Ss(this.schema,s);return!t||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=Ut.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>{if(!n)return n;const r={};for(const s of Object.keys(n))r[t(s)]=n[s];return r})}camelCase(){return this.transformKeys(In.camelCase)}snakeCase(){return this.transformKeys(In.snakeCase)}constantCase(){return this.transformKeys(t=>In.snakeCase(t).toUpperCase())}describe(t){const n=(t?this.resolve(t):this).clone(),r=super.describe(t);r.fields={};for(const[i,o]of Object.entries(n.fields)){var s;let a=t;(s=a)!=null&&s.value&&(a=Object.assign({},a,{parent:a.value,value:a.value[i]})),r.fields[i]=o.describe(a)}return r}}vs.prototype=Es.prototype,vs({[Jr.FIELD]:ps().nullable().defined()});const Ka={service:ea},Ha="[@infinityloop.labs/frontend-modules - analyticsEngine - Service]",Ba={isAnalyticsEngineInitialized:!1,scrollStopPoints:[],guardPassPoints:[],yScrollPointsArray:[],isUpperScrolling:!0,isDownScrolling:!1,currentBlocksInViewport:[]},_s=$.createSlice({name:Ha,initialState:Ba,reducers:{setAnalyticsEngineLoading(e,t){e.isAnalyticsEngineInitialized=t.payload},addScrollStopPoint(e,t){e.scrollStopPoints.push(t.payload)},addGuardPassPoint(e,t){e.guardPassPoints.push(t.payload)},addYScrollPoint(e,t){const n=[...e.yScrollPointsArray,t.payload];n.length>2&&n.shift();const s=n[0],i=n[1];e.isDownScrolling=s<i,e.isUpperScrolling=s>i,e.yScrollPointsArray=[...n]},clearAnalyticsPoints(e){e.scrollStopPoints=[],e.guardPassPoints=[]},addBlockToViewportArray(e,t){const n=new Set(e.currentBlocksInViewport);n.add(t.payload),e.currentBlocksInViewport=Array.from(n)},removeBlockFromViewportArray(e,t){e.currentBlocksInViewport=e.currentBlocksInViewport.filter(n=>n!==t.payload)}}}),ws={..._s.actions},Wa=_s.reducer,As=()=>{const e=L.useDispatch();return k.useMemo(()=>he(ws,e),[e])},Ga={service:()=>{const{guardPassPoints:e,scrollStopPoints:t,isAnalyticsEngineInitialized:n}=L.useSelector(h=>h.analyticsEngine),{setAnalyticsEngineLoading:r,clearAnalyticsPoints:s,addYScrollPoint:i}=As();k.useEffect(()=>()=>{s()},[s]),k.useEffect(()=>{const h=e.length>0||t.length>0;h!==n&&r(h)},[e.length,n,t.length,r]);const o=()=>{i(window.scrollY)},a=de.useThrottle(o,600);k.useEffect(()=>(window.addEventListener("scroll",a,{passive:!0}),()=>{window.removeEventListener("scroll",a)}),[])}},Za="[@infinityloop.labs/frontend-modules - Auth - Service]";var Ae=(e=>(e.REFRESH_TOKEN="tra",e.ACCESS_TOKEN="taa",e.LAST_PAGE_BEFORE_LOGIN="lpl",e))(Ae||{}),xn=(e=>(e.HOME="/",e.COURSES="/a",e.COURSE="/c",e.PREVIEW="/p",e.DRAFTS="/d",e.ADMIN_DASHBOARD="/admin-dashboard",e.LOGIN="/login",e))(xn||{}),Ee=(e=>(e.PAGE="page",e.PAGE_SIZE="pageSize",e.REFRESH_TOKEN="refresh_token",e.ACCESS_TOKEN="access_token",e.IS_SOCKET_MODAL_OPEN="is_socket_modal_open",e.IS_BLOCK_MODAL_OPEN="is_block_modal_open",e.SELECTED_MODULE_ID="selected_module_id",e.SELECTED_SOCKET_ID="selected_socket_id",e))(Ee||{});const Ya={isAuthenticated:!0},Os=$.createSlice({name:Za,initialState:Ya,reducers:{setIsAuthenticated(e,t){e.isAuthenticated=t.payload}}}),Ts={...Os.actions},Ja=Os.reducer,Ps=()=>{const e=L.useDispatch();return k.useMemo(()=>he(Ts,e),[e])},Xa={authUserId:e=>(e==null?void 0:e.user_id)??null,refreshRequest:({refreshToken:e})=>({domainAuthRefreshRequestDto:{refresh_token:e}})},Is=({hooks:e,mappers:t})=>{const{useGetApiMeQuery:n,usePostApiRefreshMutation:r}=e,s={...Xa,...t};return()=>{const{filters:o}=L.useSelector(l=>l.router),{setIsAuthenticated:a}=Ps(),{setCurrentUserID:h}=_n(),y=Gt.useAppSimpleNavigation(),E=k.useRef(o);E.current=o;const{pathname:P}=Gt.useAppLocation(),I=!!P.match(xn.LOGIN),F=()=>{const l=de.getFromLocalStorage(Ae.LAST_PAGE_BEFORE_LOGIN);l!=null&&l.match(xn.LOGIN)||l!=null&&l.trim()?y(l||"/",{...E.current,[Ee.REFRESH_TOKEN]:"",[Ee.ACCESS_TOKEN]:""}):y("/"),de.setToLocalStorage(Ae.LAST_PAGE_BEFORE_LOGIN,"")};k.useEffect(()=>{o[Ee.ACCESS_TOKEN]&&de.setToLocalStorage(Ae.ACCESS_TOKEN,o[Ee.ACCESS_TOKEN]),o[Ee.REFRESH_TOKEN]&&de.setToLocalStorage(Ae.REFRESH_TOKEN,o[Ee.REFRESH_TOKEN])},[o]);const{data:v,isSuccess:O,refetch:p}=n();k.useEffect(()=>{O&&(I?F():y(null,{...E.current,[Ee.REFRESH_TOKEN]:"",[Ee.ACCESS_TOKEN]:""}),a(!0),h(s.authUserId(v))),O||(a(!1),h(null))},[O]);const[T,{data:D,isError:g,isSuccess:w}]=r();k.useEffect(()=>{w&&D&&(de.setToLocalStorage(Ae.ACCESS_TOKEN,D.access_token??""),de.setToLocalStorage(Ae.REFRESH_TOKEN,D.refresh_token??""),ie.eventTransfer({name:ie.EventTransferActionsEnum.RefreshTokenComplete,data:{}}),p())},[w,D]),k.useEffect(()=>{g&&ie.eventTransfer({name:ie.EventTransferActionsEnum.RefreshTokenError,data:{}})},[g]),ie.useSubscribe({type:ie.EventTransferActionsEnum.RefreshTokenStart,callback:()=>{T(s.refreshRequest({refreshToken:de.getFromLocalStorage(Ae.REFRESH_TOKEN)||""}))}})}},eu={service:Is};Object.defineProperty(N,"combineReducers",{enumerable:!0,get:()=>$.combineReducers}),Object.defineProperty(N,"configureStore",{enumerable:!0,get:()=>$.configureStore}),Object.defineProperty(N,"createAsyncThunk",{enumerable:!0,get:()=>$.createAsyncThunk}),Object.defineProperty(N,"createListenerMiddleware",{enumerable:!0,get:()=>$.createListenerMiddleware}),Object.defineProperty(N,"createSelector",{enumerable:!0,get:()=>$.createSelector}),Object.defineProperty(N,"createSlice",{enumerable:!0,get:()=>$.createSlice}),Object.defineProperty(N,"Provider",{enumerable:!0,get:()=>L.Provider}),Object.defineProperty(N,"shallowEqual",{enumerable:!0,get:()=>L.shallowEqual}),Object.defineProperty(N,"useDispatch",{enumerable:!0,get:()=>L.useDispatch}),Object.defineProperty(N,"useSelector",{enumerable:!0,get:()=>L.useSelector}),Object.defineProperty(N,"useStore",{enumerable:!0,get:()=>L.useStore}),N.MOBILE_BREAKPOINT=zr,N.TAILWIND_SCREEN_BREAKPOINTS=xe,N.analyticsEngine=Ga,N.analyticsEngineActions=ws,N.analyticsEngineReducer=Wa,N.appSize=Do,N.appSizeActions=yt,N.appSizeReducer=To,N.auth=eu,N.authActions=Ts,N.authReducer=Ja,N.createApi=uo,N.createAuthContainer=Is,N.fetchBaseQuery=vi,N.formsActions=Rr,N.formsName=Mr,N.formsReducer=Eo,N.indexeddb=So,N.indexeddbActions=xr,N.indexeddbName=$r,N.indexeddbReducer=go,N.notify=xo,N.notifyActions=Lr,N.notifyReducer=Co,N.popup=zo,N.popupActions=Qt,N.popupReducer=ko,N.retry=wi,N.roles=Ka,N.rolesActions=Yr,N.rolesReducer=Xo,N.router=Vo,N.routerActions=Hr,N.routerReducer=Uo,N.setupListeners=Pi,N.skipToken=ae,N.theme=Zo,N.themeActions=Gr,N.themeReducer=Wo,N.useAnalyticsEngineActions=As,N.useAppSizeActions=Io,N.useAuthActions=Ps,N.useFormsActions=_o,N.useIndexeddbActions=Nr,N.useNotifyActions=Ur,N.usePopupActions=jo,N.useRolesActions=_n,N.useRouterActions=Br,N.useThemeActions=Go,N.useValidateDistributedForm=wo,N.validateForms=jr,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})});
|
|
20
|
+
//# sourceMappingURL=index.umd.js.map
|