@feardread/feature-factory 4.0.8 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,4 +7,4 @@ var version=function(e){"use strict";function t(e){return`Minified Redux error #
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */function wa(){return ga||(ga=1,function(e,t){"production"!==process.env.NODE_ENV&&function(){function r(e,t){Object.defineProperty(o.prototype,e,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}function n(e,t){var r=(e=(e=e.constructor)&&(e.displayName||e.name)||"ReactClass")+"."+t;z[r]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),z[r]=!0)}function o(e,t,r){this.props=e,this.context=t,this.refs=K,this.updater=r||B}function i(){}function a(e,t,r){this.props=e,this.context=t,this.refs=K,this.updater=r||B}function s(e){return""+e}function c(e){try{s(e);var t=!1}catch(e){t=!0}if(t){var r=(t=console).error,n="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),s(e)}}function u(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===X?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case C:return"Fragment";case I:return"Profiler";case N:return"StrictMode";case F:return"Suspense";case M:return"SuspenseList";case $:return"Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case k:return"Portal";case D:return(e.displayName||"Context")+".Provider";case x:return(e._context.displayName||"Context")+".Consumer";case q:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case U:return null!==(t=e.displayName||null)?t:u(e.type)||"Memo";case L:t=e._payload,e=e._init;try{return u(e(t))}catch(e){}}return null}function l(e){if(e===C)return"<>";if("object"==typeof e&&null!==e&&e.$$typeof===L)return"<...>";try{var t=u(e);return t?"<"+t+">":"<...>"}catch(e){return"<...>"}}function f(){var e=Z.A;return null===e?null:e.getOwner()}function d(){return Error("react-stack-top-frame")}function p(e){if(ee.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}function y(){var e=u(this.type);return re[e]||(re[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(e=this.props.ref)?e:null}function h(e,t,r,n,o,i,a,s){return r=i.ref,e={$$typeof:j,type:e,key:t,props:i,_owner:o},null!==(void 0!==r?r:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:y}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function m(e){return"object"==typeof e&&null!==e&&e.$$typeof===j}function g(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(c(e.key),r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36);var r,n}function b(){}function v(e,t,r,n,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var a,s,u,l=!1;if(null===e)l=!0;else switch(i){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case j:case k:l=!0;break;case L:return v((l=e._init)(e._payload),t,r,n,o)}}if(l){o=o(l=e);var f=""===n?"."+g(l,0):n;return Y(o)?(r="",null!=f&&(r=f.replace(ae,"$&/")+"/"),v(o,t,r,"",function(e){return e})):null!=o&&(m(o)&&(null!=o.key&&(l&&l.key===o.key||c(o.key)),a=o,s=r+(null==o.key||l&&l.key===o.key?"":(""+o.key).replace(ae,"$&/")+"/")+f,s=h(a.type,s,void 0,0,a._owner,a.props,a._debugStack,a._debugTask),a._store&&(s._store.validated=a._store.validated),r=s,""!==n&&null!=l&&m(l)&&null==l.key&&l._store&&!l._store.validated&&(r._store.validated=2),o=r),t.push(o)),1}if(l=0,f=""===n?".":n+":",Y(e))for(var d=0;d<e.length;d++)l+=v(n=e[d],t,r,i=f+g(n,d),o);else if("function"==typeof(d=null===(u=e)||"object"!=typeof u?null:"function"==typeof(u=Q&&u[Q]||u["@@iterator"])?u:null))for(d===e.entries&&(ie||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ie=!0),e=d.call(e),d=0;!(n=e.next()).done;)l+=v(n=n.value,t,r,i=f+g(n,d++),o);else if("object"===i){if("function"==typeof e.then)return v(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(b,b):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,r,n,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function w(e,t,r){if(null==e)return e;var n=[],o=0;return v(e,n,"","",function(e){return t.call(r,e,o++)}),n}function E(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return void 0===(t=e._result)&&console.error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",t),"default"in t||console.error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",t),t.default;throw e._result}function S(){var e=Z.H;return null===e&&console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."),e}function O(){}function _(t){if(null===ue)try{var r=("require"+Math.random()).slice(0,7);ue=(e&&e[r]).call(e,"timers").setImmediate}catch(e){ue=function(e){!1===ce&&(ce=!0,"undefined"==typeof MessageChannel&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}return ue(t)}function A(e){return 1<e.length&&"function"==typeof AggregateError?new AggregateError(e):e[0]}function T(e,t){t!==le-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),le=t}function R(e,t,r){var n=Z.actQueue;if(null!==n)if(0!==n.length)try{return P(n),void _(function(){return R(e,t,r)})}catch(e){Z.thrownErrors.push(e)}else Z.actQueue=null;0<Z.thrownErrors.length?(n=A(Z.thrownErrors),Z.thrownErrors.length=0,r(n)):t(e)}function P(e){if(!de){de=!0;var t=0;try{for(;t<e.length;t++)for(var r=e[t];;){Z.didUsePromise=!1;var n=r(!1);if(null===n)break;if(Z.didUsePromise)return e[t]=r,void e.splice(0,t);r=n}e.length=0}catch(r){e.splice(0,t+1),Z.thrownErrors.push(r)}finally{de=!1}}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var j=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),D=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),Q=Symbol.iterator,z={},B={isMounted:function(){return!1},enqueueForceUpdate:function(e){n(e,"forceUpdate")},enqueueReplaceState:function(e){n(e,"replaceState")},enqueueSetState:function(e){n(e,"setState")}},V=Object.assign,K={};Object.freeze(K),o.prototype.isReactComponent={},o.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var H,W={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(H in W)W.hasOwnProperty(H)&&r(H,W[H]);i.prototype=o.prototype,(W=a.prototype=new i).constructor=a,V(W,o.prototype),W.isPureReactComponent=!0;var G,J,Y=Array.isArray,X=Symbol.for("react.client.reference"),Z={H:null,A:null,T:null,S:null,V:null,actQueue:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},ee=Object.prototype.hasOwnProperty,te=console.createTask?console.createTask:function(){return null},re={},ne=(W={"react-stack-bottom-frame":function(e){return e()}})["react-stack-bottom-frame"].bind(W,d)(),oe=te(l(d)),ie=!1,ae=/\/+/g,se="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},ce=!1,ue=null,le=0,fe=!1,de=!1,pe="function"==typeof queueMicrotask?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:_;W=Object.freeze({__proto__:null,c:function(e){return S().useMemoCache(e)}}),t.Children={map:w,forEach:function(e,t,r){w(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return w(e,function(){t++}),t},toArray:function(e){return w(e,function(e){return e})||[]},only:function(e){if(!m(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=o,t.Fragment=C,t.Profiler=I,t.PureComponent=a,t.StrictMode=N,t.Suspense=F,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,t.__COMPILER_RUNTIME=W,t.act=function(e){var t=Z.actQueue,r=le;le++;var n=Z.actQueue=null!==t?t:[],o=!1;try{var i=e()}catch(e){Z.thrownErrors.push(e)}if(0<Z.thrownErrors.length)throw T(0,r),e=A(Z.thrownErrors),Z.thrownErrors.length=0,e;if(null!==i&&"object"==typeof i&&"function"==typeof i.then){var a=i;return pe(function(){o||fe||(fe=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(e,t){o=!0,a.then(function(o){if(T(0,r),0===r){try{P(n),_(function(){return R(o,e,t)})}catch(e){Z.thrownErrors.push(e)}if(0<Z.thrownErrors.length){var i=A(Z.thrownErrors);Z.thrownErrors.length=0,t(i)}}else e(o)},function(e){T(0,r),0<Z.thrownErrors.length?(e=A(Z.thrownErrors),Z.thrownErrors.length=0,t(e)):t(e)})}}}var s=i;if(T(0,r),0===r&&(P(n),0!==n.length&&pe(function(){o||fe||(fe=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),Z.actQueue=null),0<Z.thrownErrors.length)throw e=A(Z.thrownErrors),Z.thrownErrors.length=0,e;return{then:function(e,t){o=!0,0===r?(Z.actQueue=n,_(function(){return R(s,e,t)})):e(s)}}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.captureOwnerStack=function(){var e=Z.getCurrentStack;return null===e?null:e()},t.cloneElement=function(e,t,r){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var n,o=V({},e.props),i=e.key,a=e._owner;if(null!=t)for(s in(n=!(ee.call(t,"ref")&&(n=Object.getOwnPropertyDescriptor(t,"ref").get)&&n.isReactWarning)&&void 0!==t.ref)&&(a=f()),p(t)&&(c(t.key),i=""+t.key),t)!ee.call(t,s)||"key"===s||"__self"===s||"__source"===s||"ref"===s&&void 0===t.ref||(o[s]=t[s]);var s=arguments.length-2;if(1===s)o.children=r;else if(1<s){n=Array(s);for(var u=0;u<s;u++)n[u]=arguments[u+2];o.children=n}for(o=h(e.type,i,void 0,0,a,o,e._debugStack,e._debugTask),i=2;i<arguments.length;i++)m(a=arguments[i])&&a._store&&(a._store.validated=1);return o},t.createContext=function(e){return(e={$$typeof:D,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:x,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},t.createElement=function(e,t,r){for(var n=2;n<arguments.length;n++){var o=arguments[n];m(o)&&o._store&&(o._store.validated=1)}if(n={},o=null,null!=t)for(u in J||!("__self"in t)||"key"in t||(J=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),p(t)&&(c(t.key),o=""+t.key),t)ee.call(t,u)&&"key"!==u&&"__self"!==u&&"__source"!==u&&(n[u]=t[u]);var i=arguments.length-2;if(1===i)n.children=r;else if(1<i){for(var a=Array(i),s=0;s<i;s++)a[s]=arguments[s+2];Object.freeze&&Object.freeze(a),n.children=a}if(e&&e.defaultProps)for(u in i=e.defaultProps)void 0===n[u]&&(n[u]=i[u]);o&&function(e,t){function r(){G||(G=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}(n,"function"==typeof e?e.displayName||e.name||"Unknown":e);var u=1e4>Z.recentlyCreatedOwnerStacks++;return h(e,o,void 0,0,f(),n,u?Error("react-stack-top-frame"):ne,u?te(l(e)):oe)},t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){null!=e&&e.$$typeof===U?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?console.error("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&null!=e.defaultProps&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var t,r={$$typeof:q,render:e};return Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(r){t=r,e.name||e.displayName||(Object.defineProperty(e,"name",{value:r}),e.displayName=r)}}),r},t.isValidElement=m,t.lazy=function(e){return{$$typeof:L,_payload:{_status:-1,_result:e},_init:E}},t.memo=function(e,t){var r;return null==e&&console.error("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),t={$$typeof:U,type:e,compare:void 0===t?null:t},Object.defineProperty(t,"displayName",{enumerable:!1,configurable:!0,get:function(){return r},set:function(t){r=t,e.name||e.displayName||(Object.defineProperty(e,"name",{value:t}),e.displayName=t)}}),t},t.startTransition=function(e){var t=Z.T,r={};Z.T=r,r._updatedFibers=new Set;try{var n=e(),o=Z.S;null!==o&&o(r,n),"object"==typeof n&&null!==n&&"function"==typeof n.then&&n.then(O,se)}catch(e){se(e)}finally{null===t&&r._updatedFibers&&(e=r._updatedFibers.size,r._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),Z.T=t}},t.unstable_useCacheRefresh=function(){return S().useCacheRefresh()},t.use=function(e){return S().use(e)},t.useActionState=function(e,t,r){return S().useActionState(e,t,r)},t.useCallback=function(e,t){return S().useCallback(e,t)},t.useContext=function(e){var t=S();return e.$$typeof===x&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),t.useContext(e)},t.useDebugValue=function(e,t){return S().useDebugValue(e,t)},t.useDeferredValue=function(e,t){return S().useDeferredValue(e,t)},t.useEffect=function(e,t,r){null==e&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");var n=S();if("function"==typeof r)throw Error("useEffect CRUD overload is not enabled in this build of React.");return n.useEffect(e,t)},t.useId=function(){return S().useId()},t.useImperativeHandle=function(e,t,r){return S().useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return null==e&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),S().useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return null==e&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),S().useLayoutEffect(e,t)},t.useMemo=function(e,t){return S().useMemo(e,t)},t.useOptimistic=function(e,t){return S().useOptimistic(e,t)},t.useReducer=function(e,t,r){return S().useReducer(e,t,r)},t.useRef=function(e){return S().useRef(e)},t.useState=function(e){return S().useState(e)},t.useSyncExternalStore=function(e,t,r){return S().useSyncExternalStore(e,t,r)},t.useTransition=function(){return S().useTransition()},t.version="19.1.0","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}(va,va.exports)),va.exports}function Ea(){return ba||(ba=1,"production"===process.env.NODE_ENV?ha.exports=function(){if(ya)return ma;ya=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),f=Symbol.iterator,d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,y={};function h(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||d}function m(){}function g(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||d}h.prototype.isReactComponent={},h.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},h.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=h.prototype;var b=g.prototype=new m;b.constructor=g,p(b,h.prototype),b.isPureReactComponent=!0;var v=Array.isArray,w={H:null,A:null,T:null,S:null,V:null},E=Object.prototype.hasOwnProperty;function S(t,r,n,o,i,a){return n=a.ref,{$$typeof:e,type:t,key:r,ref:void 0!==n?n:null,props:a}}function O(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var _=/\/+/g;function A(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36);var r,n}function T(){}function R(r,n,o,i,a){var s=typeof r;"undefined"!==s&&"boolean"!==s||(r=null);var c,u,d=!1;if(null===r)d=!0;else switch(s){case"bigint":case"string":case"number":d=!0;break;case"object":switch(r.$$typeof){case e:case t:d=!0;break;case l:return R((d=r._init)(r._payload),n,o,i,a)}}if(d)return a=a(r),d=""===i?"."+A(r,0):i,v(a)?(o="",null!=d&&(o=d.replace(_,"$&/")+"/"),R(a,n,o,"",function(e){return e})):null!=a&&(O(a)&&(c=a,u=o+(null==a.key||r&&r.key===a.key?"":(""+a.key).replace(_,"$&/")+"/")+d,a=S(c.type,u,void 0,0,0,c.props)),n.push(a)),1;d=0;var p,y=""===i?".":i+":";if(v(r))for(var h=0;h<r.length;h++)d+=R(i=r[h],n,o,s=y+A(i,h),a);else if("function"==typeof(h=null===(p=r)||"object"!=typeof p?null:"function"==typeof(p=f&&p[f]||p["@@iterator"])?p:null))for(r=h.call(r),h=0;!(i=r.next()).done;)d+=R(i=i.value,n,o,s=y+A(i,h++),a);else if("object"===s){if("function"==typeof r.then)return R(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(T,T):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(r),n,o,i,a);throw n=String(r),Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(r).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.")}return d}function P(e,t,r){if(null==e)return e;var n=[],o=0;return R(e,n,"","",function(e){return t.call(r,e,o++)}),n}function j(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var k="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function C(){}return ma.Children={map:P,forEach:function(e,t,r){P(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},ma.Component=h,ma.Fragment=r,ma.Profiler=o,ma.PureComponent=g,ma.StrictMode=n,ma.Suspense=c,ma.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,ma.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},ma.cache=function(e){return function(){return e.apply(null,arguments)}},ma.cloneElement=function(e,t,r){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var n=p({},e.props),o=e.key;if(null!=t)for(i in t.ref,void 0!==t.key&&(o=""+t.key),t)!E.call(t,i)||"key"===i||"__self"===i||"__source"===i||"ref"===i&&void 0===t.ref||(n[i]=t[i]);var i=arguments.length-2;if(1===i)n.children=r;else if(1<i){for(var a=Array(i),s=0;s<i;s++)a[s]=arguments[s+2];n.children=a}return S(e.type,o,void 0,0,0,n)},ma.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:i,_context:e},e},ma.createElement=function(e,t,r){var n,o={},i=null;if(null!=t)for(n in void 0!==t.key&&(i=""+t.key),t)E.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(o[n]=t[n]);var a=arguments.length-2;if(1===a)o.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];o.children=s}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===o[n]&&(o[n]=a[n]);return S(e,i,void 0,0,0,o)},ma.createRef=function(){return{current:null}},ma.forwardRef=function(e){return{$$typeof:s,render:e}},ma.isValidElement=O,ma.lazy=function(e){return{$$typeof:l,_payload:{_status:-1,_result:e},_init:j}},ma.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},ma.startTransition=function(e){var t=w.T,r={};w.T=r;try{var n=e(),o=w.S;null!==o&&o(r,n),"object"==typeof n&&null!==n&&"function"==typeof n.then&&n.then(C,k)}catch(e){k(e)}finally{w.T=t}},ma.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},ma.use=function(e){return w.H.use(e)},ma.useActionState=function(e,t,r){return w.H.useActionState(e,t,r)},ma.useCallback=function(e,t){return w.H.useCallback(e,t)},ma.useContext=function(e){return w.H.useContext(e)},ma.useDebugValue=function(){},ma.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},ma.useEffect=function(e,t,r){var n=w.H;if("function"==typeof r)throw Error("useEffect CRUD overload is not enabled in this build of React.");return n.useEffect(e,t)},ma.useId=function(){return w.H.useId()},ma.useImperativeHandle=function(e,t,r){return w.H.useImperativeHandle(e,t,r)},ma.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},ma.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},ma.useMemo=function(e,t){return w.H.useMemo(e,t)},ma.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},ma.useReducer=function(e,t,r){return w.H.useReducer(e,t,r)},ma.useRef=function(e){return w.H.useRef(e)},ma.useState=function(e){return w.H.useState(e)},ma.useSyncExternalStore=function(e,t,r){return w.H.useSyncExternalStore(e,t,r)},ma.useTransition=function(){return w.H.useTransition()},ma.version="19.1.0",ma}():ha.exports=wa()),ha.exports}var Sa,Oa,_a,Aa=Ea(),Ta={exports:{}},Ra={},Pa={},ja=(_a||(_a=1,"production"===process.env.NODE_ENV?Ta.exports=function(){if(Sa)return Ra;Sa=1;var e=Ea(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;return Ra.useSyncExternalStoreWithSelector=function(e,s,c,u,l){var f=n(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i(function(){function e(e){if(!o){if(o=!0,r=e,e=u(e),void 0!==l&&d.hasValue){var i=d.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var a=u(e);return void 0!==l&&l(i,a)?(r=e,i):(r=e,n=a)}var r,n,o=!1,i=void 0===c?null:c;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,c,u,l]);var p=r(e,f[0],f[1]);return o(function(){d.hasValue=!0,d.value=p},[p]),a(p),p},Ra}():Ta.exports=(Oa||(Oa=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=Ea(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;Pa.useSyncExternalStoreWithSelector=function(e,s,c,u,l){var f=n(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i(function(){function e(e){if(!o){if(o=!0,r=e,e=u(e),void 0!==l&&d.hasValue){var i=d.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var a=u(e);return void 0!==l&&l(i,a)?(r=e,i):(r=e,n=a)}var r,n,o=!1,i=void 0===c?null:c;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,c,u,l]);var p=r(e,f[0],f[1]);return o(function(){d.hasValue=!0,d.value=p},[p]),a(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Pa)),Ta.exports);function ka(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Ca(e,t){if(ka(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!ka(e[r[n]],t[r[n]]))return!1;return!0}var Na=Symbol.for("react-redux-context"),Ia="undefined"!=typeof globalThis?globalThis:{};var xa=function(){if(!Aa.createContext)return{};const e=Ia[Na]??=new Map;let t=e.get(Aa.createContext);return t||(t=Aa.createContext(null),"production"!==process.env.NODE_ENV&&(t.displayName="ReactRedux"),e.set(Aa.createContext,t)),t}();function Da(e=xa){return function(){const t=Aa.useContext(e);if("production"!==process.env.NODE_ENV&&!t)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return t}}var qa=Da();function Fa(e=xa){const t=e===xa?qa:Da(e),r=()=>{const{store:e}=t();return e};return Object.assign(r,{withTypes:()=>r}),r}var Ma=Fa();var Ua=function(e=xa){const t=e===xa?Ma:Fa(e),r=()=>t().dispatch;return Object.assign(r,{withTypes:()=>r}),r}(),La=(e,t)=>e===t;var $a=function(e=xa){const t=e===xa?qa:Da(e),r=(e,r={})=>{const{equalityFn:n=La}="function"==typeof r?{equalityFn:r}:r;if("production"!==process.env.NODE_ENV){if(!e)throw new Error("You must pass a selector to useSelector");if("function"!=typeof e)throw new Error("You must pass a function as a selector to useSelector");if("function"!=typeof n)throw new Error("You must pass a function as an equality function to useSelector")}const o=t(),{store:i,subscription:a,getServerState:s}=o,c=Aa.useRef(!0),u=Aa.useCallback({[e.name](t){const i=e(t);if("production"!==process.env.NODE_ENV){const{devModeChecks:a={}}="function"==typeof r?{}:r,{identityFunctionCheck:s,stabilityCheck:u}=o,{identityFunctionCheck:l,stabilityCheck:f}={stabilityCheck:u,identityFunctionCheck:s,...a};if("always"===f||"once"===f&&c.current){const r=e(t);if(!n(i,r)){let n;try{throw new Error}catch(e){({stack:n}=e)}console.warn("Selector "+(e.name||"unknown")+" returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization",{state:t,selected:i,selected2:r,stack:n})}}if(("always"===l||"once"===l&&c.current)&&i===t){let t;try{throw new Error}catch(e){({stack:t}=e)}console.warn("Selector "+(e.name||"unknown")+" returned the root state when called. This can lead to unnecessary rerenders.\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.",{stack:t})}c.current&&(c.current=!1)}return i}}[e.name],[e]),l=ja.useSyncExternalStoreWithSelector(a.addNestedSub,i.getState,s||i.getState,u,n);return Aa.useDebugValue(l),l};return Object.assign(r,{withTypes:()=>r}),r}(),Qa=function(e){e()};function za(e){return e.replace(e[0],e[0].toUpperCase())}function Ba(e){let t=0;for(const r in e)t++;return t}function Va(e){return"infinitequery"===e.type}function Ka(e,...t){return Object.assign(e,...t)}var Ha=Symbol();function Wa(e,t,r,n){const o=Aa.useMemo(()=>({queryArgs:e,serialized:"object"==typeof e?t({queryArgs:e,endpointDefinition:r,endpointName:n}):e}),[e,t,r,n]),i=Aa.useRef(o);return Aa.useEffect(()=>{i.current.serialized!==o.serialized&&(i.current=o)},[o]),i.current.serialized===o.serialized?i.current.queryArgs:e}function Ga(e){const t=Aa.useRef(e);return Aa.useEffect(()=>{Ca(t.current,e)||(t.current=e)},[e]),Ca(t.current,e)?t.current:e}var Ja=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Ya="undefined"!=typeof navigator&&"ReactNative"===navigator.product,Xa=Ja||Ya?Aa.useLayoutEffect:Aa.useEffect,Za=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:hi.pending}:e;function es(e,...t){const r={};return t.forEach(t=>{r[t]=e[t]}),r}var ts=["data","status","isLoading","isSuccess","isError","error"],rs=Symbol(),ns=function(...e){return function(t){const r=fe(e=>t.extractRehydrationInfo?.(e,{reducerPath:t.reducerPath??"api"})),n={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...t,extractRehydrationInfo:r,serializeQueryArgs(e){let r=ra;if("serializeQueryArgs"in e.endpointDefinition){const t=e.endpointDefinition.serializeQueryArgs;r=e=>{const r=t(e);return"string"==typeof r?r:ra({...e,queryArgs:r})}}else t.serializeQueryArgs&&(r=t.serializeQueryArgs);return r(e)},tagTypes:[...t.tagTypes||[]]},o={endpointDefinitions:{},batch(e){e()},apiUid:Ie(),extractRehydrationInfo:r,hasRehydrationInfo:fe(e=>null!=r(e))},i={injectEndpoints:function(e){const t=e.endpoints({query:e=>({...e,type:"query"}),mutation:e=>({...e,type:"mutation"}),infiniteQuery:e=>({...e,type:"infinitequery"})});for(const[r,n]of Object.entries(t))if(!0!==e.overrideExisting&&r in o.endpointDefinitions){if("throw"===e.overrideExisting)throw new Error("production"===process.env.NODE_ENV?tt(39):`called \`injectEndpoints\` to override already-existing endpointName ${r} without specifying \`overrideExisting: true\``);"undefined"!=typeof process&&"development"===process.env.NODE_ENV&&console.error(`called \`injectEndpoints\` to override already-existing endpointName ${r} without specifying \`overrideExisting: true\``)}else{if("undefined"!=typeof process&&"development"===process.env.NODE_ENV&&Ii(n)){const{infiniteQueryOptions:e}=n,{maxPages:t,getPreviousPageParam:o}=e;if("number"==typeof t){if(t<1)throw new Error("production"===process.env.NODE_ENV?tt(40):`maxPages for endpoint '${r}' must be a number greater than 0`);if("function"!=typeof o)throw new Error("production"===process.env.NODE_ENV?tt(41):`getPreviousPageParam for endpoint '${r}' must be a function if maxPages is used`)}}o.endpointDefinitions[r]=n;for(const e of a)e.injectEndpoint(r,n)}return i},enhanceEndpoints({addTagTypes:e,endpoints:t}){if(e)for(const t of e)n.tagTypes.includes(t)||n.tagTypes.push(t);if(t)for(const[e,r]of Object.entries(t))"function"==typeof r?r(o.endpointDefinitions[e]):Object.assign(o.endpointDefinitions[e]||{},r);return i}},a=e.map(e=>e.init(i,n,o));return i.injectEndpoints({endpoints:t.endpoints})}}(pa(),(({batch:e=Qa,hooks:t={useDispatch:Ua,useSelector:$a,useStore:Ma},createSelector:r=pe,unstable__sideEffectsInRender:n=!1,...o}={})=>{if("production"!==process.env.NODE_ENV){const e=["useDispatch","useSelector","useStore"];let r=!1;for(const n of e)if(Ba(o)>0&&(o[n]&&(r||(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 } })`"),r=!0)),t[n]=o[n]),"function"!=typeof t[n])throw new Error("production"===process.env.NODE_ENV?tt(36):`When using custom hooks for context, all ${e.length} hooks need to be provided: ${e.join(", ")}.\nHook ${n} was either not provided or not a function.`)}return{name:rs,init(o,{serializeQueryArgs:i},a){const s=o,{buildQueryHooks:c,buildInfiniteQueryHooks:u,buildMutationHook:l,usePrefetch:f}=function({api:e,moduleOptions:{batch:t,hooks:{useDispatch:r,useSelector:n,useStore:o},unstable__sideEffectsInRender:i,createSelector:a},serializeQueryArgs:s,context:c}){const u=i?e=>e():Aa.useEffect;return{buildQueryHooks:function(n){const o=(e,t={})=>{const[r]=d(n,e,t);return y(r),Aa.useMemo(()=>({refetch:()=>h(r)}),[r])},i=({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:a=0,skipPollingIfUnfocused:s=!1}={})=>{const{initiate:c}=e.endpoints[n],l=r(),[f,d]=Aa.useState(Ha),p=Aa.useRef(void 0),y=Ga({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:a,skipPollingIfUnfocused:s});u(()=>{const e=p.current?.subscriptionOptions;y!==e&&p.current?.updateSubscriptionOptions(y)},[y]);const h=Aa.useRef(y);u(()=>{h.current=y},[y]);const m=Aa.useCallback(function(e,r=!1){let n;return t(()=>{p.current?.unsubscribe(),p.current=n=l(c(e,{subscriptionOptions:h.current,forceRefetch:!r})),d(e)}),n},[l,c]),g=Aa.useCallback(()=>{p.current?.queryCacheKey&&l(e.internalActions.removeQueryResult({queryCacheKey:p.current?.queryCacheKey}))},[l]);return Aa.useEffect(()=>()=>{p?.current?.unsubscribe()},[]),Aa.useEffect(()=>{f===Ha||p.current||m(f,!0)},[f,m]),Aa.useMemo(()=>[m,f,{reset:g}],[m,f,g])},a=p(n,l);return{useQueryState:a,useQuerySubscription:o,useLazyQuerySubscription:i,useLazyQuery(e){const[t,r,{reset:n}]=i(e),o=a(r,{...e,skip:r===Ha}),s=Aa.useMemo(()=>({lastArg:r}),[r]);return Aa.useMemo(()=>[t,{...o,reset:n},s],[t,o,n,s])},useQuery(e,t){const r=o(e,t),n=a(e,{selectFromResult:e===Yi||t?.skip?void 0:Za,...t}),i=es(n,...ts);return Aa.useDebugValue(i),Aa.useMemo(()=>({...n,...r}),[n,r])}}},buildInfiniteQueryHooks:function(e){const r=(r,n={})=>{const[o,i,a,s]=d(e,r,n),l=Aa.useRef(s);u(()=>{l.current=s},[s]);const f=Aa.useCallback(function(e,r){let n;return t(()=>{o.current?.unsubscribe(),o.current=n=i(a(e,{subscriptionOptions:l.current,direction:r}))}),n},[o,i,a]);y(o);const p=Wa(n.skip?Yi:r,ra,c.endpointDefinitions[e],e),m=Aa.useCallback(()=>h(o),[o]);return Aa.useMemo(()=>({trigger:f,refetch:m,fetchNextPage:()=>f(p,"forward"),fetchPreviousPage:()=>f(p,"backward")}),[m,f,p])},n=p(e,f);return{useInfiniteQueryState:n,useInfiniteQuerySubscription:r,useInfiniteQuery(e,t){const{refetch:o,fetchNextPage:i,fetchPreviousPage:a}=r(e,t),s=n(e,{selectFromResult:e===Yi||t?.skip?void 0:Za,...t}),c=es(s,...ts,"hasNextPage","hasPreviousPage");return Aa.useDebugValue(c),Aa.useMemo(()=>({...s,fetchNextPage:i,fetchPreviousPage:a,refetch:o}),[s,i,a,o])}}},buildMutationHook:function(o){return({selectFromResult:i,fixedCacheKey:s}={})=>{const{select:c,initiate:u}=e.endpoints[o],l=r(),[f,d]=Aa.useState();Aa.useEffect(()=>()=>{f?.arg.fixedCacheKey||f?.reset()},[f]);const p=Aa.useCallback(function(e){const t=l(u(e,{fixedCacheKey:s}));return d(t),t},[l,u,s]),{requestId:y}=f||{},h=Aa.useMemo(()=>c({fixedCacheKey:s,requestId:f?.requestId}),[s,f,c]),m=Aa.useMemo(()=>i?a([h],i):h,[i,h]),g=n(m,Ca),b=null==s?f?.arg.originalArgs:void 0,v=Aa.useCallback(()=>{t(()=>{f&&d(void 0),s&&l(e.internalActions.removeMutationResult({requestId:y,fixedCacheKey:s}))})},[l,s,f,y]),w=es(g,...ts,"endpointName");Aa.useDebugValue(w);const E=Aa.useMemo(()=>({...g,originalArgs:b,reset:v}),[g,b,v]);return Aa.useMemo(()=>[p,E],[p,E])}},usePrefetch:function(t,n){const o=r(),i=Ga(n);return Aa.useCallback((r,n)=>o(e.util.prefetch(t,r,{...i,...n})),[t,o,i])}};function l(e,t,r){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,n=c.endpointDefinitions[e];r!==Yi&&s({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===s({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);const o=void 0!==n,i=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!o&&i,u=e.isSuccess||o&&(i&&!t?.isError||e.isUninitialized);return{...e,data:n,currentData:e.data,isFetching:i,isLoading:a,isSuccess:u}}function f(e,t,r){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,n=c.endpointDefinitions[e];r!==Yi&&s({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===s({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);const o=void 0!==n,i=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!o&&i,u=e.isSuccess||i&&o;return{...e,data:n,currentData:e.data,isFetching:i,isLoading:a,isSuccess:u}}function d(t,n,{refetchOnReconnect:o,refetchOnFocus:i,refetchOnMountOrArgChange:a,skip:s=!1,pollingInterval:l=0,skipPollingIfUnfocused:f=!1,...d}={}){const{initiate:p}=e.endpoints[t],y=r(),h=Aa.useRef(void 0);if(!h.current){const t=y(e.internalActions.internal_getRTKQSubscriptions());if("production"!==process.env.NODE_ENV&&("object"!=typeof t||"string"==typeof t?.type))throw new Error("production"===process.env.NODE_ENV?tt(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.\n You must add the middleware for RTK-Query to function correctly!`);h.current=t}const m=Wa(s?Yi:n,ra,c.endpointDefinitions[t],t),g=Ga({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:l,skipPollingIfUnfocused:f}),b=Ga(d.initialPageParam),v=Aa.useRef(void 0);let{queryCacheKey:w,requestId:E}=v.current||{},S=!1;w&&E&&(S=h.current.isRequestSubscribed(w,E));const O=!S&&void 0!==v.current;return u(()=>{O&&(v.current=void 0)},[O]),u(()=>{const e=v.current;if("undefined"!=typeof process&&"removeMeOnCompilation"===process.env.NODE_ENV&&console.log(O),m===Yi)return e?.unsubscribe(),void(v.current=void 0);const r=v.current?.subscriptionOptions;if(e&&e.arg===m)g!==r&&e.updateSubscriptionOptions(g);else{e?.unsubscribe();const r=y(p(m,{subscriptionOptions:g,forceRefetch:a,...Va(c.endpointDefinitions[t])?{initialPageParam:b}:{}}));v.current=r}},[y,p,a,m,g,O,b,t]),[v,y,p,g]}function p(t,r){return(i,{skip:u=!1,selectFromResult:l}={})=>{const{select:f}=e.endpoints[t],d=Wa(u?Yi:i,s,c.endpointDefinitions[t],t),p=Aa.useRef(void 0),y=Aa.useMemo(()=>a([f(d),(e,t)=>t,e=>d],r,{memoizeOptions:{resultEqualityCheck:Ca}}),[f,d]),h=Aa.useMemo(()=>l?a([y],l,{devModeChecks:{identityFunctionCheck:"never"}}):y,[y,l]),m=n(e=>h(e,p.current),Ca),g=o(),b=y(g.getState(),p.current);return Xa(()=>{p.current=b},[b]),m}}function y(e){Aa.useEffect(()=>()=>{e.current?.unsubscribe?.(),e.current=void 0},[e])}function h(e){if(!e.current)throw new Error("production"===process.env.NODE_ENV?tt(38):"Cannot refetch a query that has not been started yet.");return e.current.refetch()}}({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:n,createSelector:r},serializeQueryArgs:i,context:a});return Ka(s,{usePrefetch:f}),Ka(a,{batch:e}),{injectEndpoint(e,t){if("query"===t.type){const{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:a}=c(e);Ka(s.endpoints[e],{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:a}),o[`use${za(e)}Query`]=t,o[`useLazy${za(e)}Query`]=r}if(function(e){return"mutation"===e.type}(t)){const t=l(e);Ka(s.endpoints[e],{useMutation:t}),o[`use${za(e)}Mutation`]=t}else if(Va(t)){const{useInfiniteQuery:t,useInfiniteQuerySubscription:r,useInfiniteQueryState:n}=u(e);Ka(s.endpoints[e],{useInfiniteQuery:t,useInfiniteQuerySubscription:r,useInfiniteQueryState:n}),o[`use${za(e)}InfiniteQuery`]=t}}}}}})());const os={baseUrl:process.env.REACT_APP_API_BASE_URL||"http://localhost:4000/fear/api/",timeout:3e4,credentials:"include",prepareHeaders:(e,{getState:t})=>{e.set("Content-Type","application/json");const r=t()?.auth?.token;return r&&e.set("Authorization",`Bearer ${r}`),e}},is={GET:"GET",POST:"POST",PUT:"PUT",PATCH:"PATCH",DELETE:"DELETE"},as={getAll:{method:is.GET,url:e=>`${e}/all`,providesTags:e=>[{type:e,id:"LIST"}]},getById:{method:is.GET,url:(e,t)=>`${e}/${t}`,providesTags:(e,t)=>[{type:e,id:t}]},create:{method:is.POST,url:e=>`${e}`,invalidatesTags:e=>[{type:e,id:"LIST"}]},update:{method:is.PUT,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},patch:{method:is.PATCH,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},delete:{method:is.DELETE,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},search:{method:is.GET,url:e=>`${e}/search`,providesTags:e=>[{type:e,id:"SEARCH"}]}},ss=e=>e.status?{status:e.status,message:e.data?.message||`HTTP Error ${e.status}`,data:e.data}:{status:"FETCH_ERROR",message:e.message||"Network error occurred",error:e.error},cs=(e,t,r={})=>{const{method:n,url:o}=e;let i={method:n,url:"function"==typeof o?o(t,r.id,r):o};return n!==is.GET&&n!==is.DELETE&&(i.body=r.data||r),n===is.GET&&r.params&&(i.params=r.params),i},us=(e,t={})=>{(e=>{if(!e||"string"!=typeof e)throw new Error("SliceName must be a non-empty string")})(e);const r={tagTypes:["Product","Order","User","Category"],baseQuery:{},includeStandardEndpoints:!0,...t},n=(o=e).charAt(0).toUpperCase()+o.slice(1);var o;r.tagTypes.includes(n)||r.tagTypes.push(n);const i={...os,...r.baseQuery},a=ns({reducerPath:`${e}Api`,tagTypes:r.tagTypes,baseQuery:Ti(i),endpoints:()=>({})}),s=(t,r)=>{const{method:n=is.GET,url:o,type:i=(n===is.GET?"query":"mutation"),providesTags:s,invalidatesTags:c,transformResponse:u,transformErrorResponse:l=ss}=r;return a.injectEndpoints({endpoints:r=>({[t]:r[i]({query:(t={})=>cs({method:n,url:o},e,t),providesTags:s?(t,r,n)=>s(e,n?.id,t,r,n):void 0,invalidatesTags:c?(t,r,n)=>c(e,n?.id,t,r,n):void 0,transformResponse:u,transformErrorResponse:l})})})},c=t=>a.injectEndpoints({endpoints:r=>{const n={};return Object.entries(t).forEach(([t,o])=>{const{method:i=is.GET,url:a,type:s=(i===is.GET?"query":"mutation"),providesTags:c,invalidatesTags:u,transformResponse:l,transformErrorResponse:f=ss}=o;n[t]=r[s]({query:(t={})=>cs({method:i,url:a},e,t),providesTags:c?(t,r,n)=>c(e,n?.id,t,r,n):void 0,invalidatesTags:u?(t,r,n)=>u(e,n?.id,t,r,n):void 0,transformResponse:l,transformErrorResponse:f})}),n}}),u=()=>{const e={};return Object.entries(as).forEach(([t,r])=>{e[t]={method:r.method,url:r.url,providesTags:r.providesTags,invalidatesTags:r.invalidatesTags}}),c(e)};return{sliceName:e,entityTagType:n,baseApi:a,inject:s,injectMany:c,create:()=>{let e=a;return r.includeStandardEndpoints&&(e=u()),e},createStandard:u,createBulk:()=>{const t={bulkCreate:{method:is.POST,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]},bulkUpdate:{method:is.PUT,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]},bulkDelete:{method:is.DELETE,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]}};return c(t)},createCustom:(e,t)=>s(e,t),getTagTypes:()=>[...r.tagTypes],getBaseUrl:()=>i.baseUrl,getReducerPath:()=>a.reducerPath,withAuth:t=>us(e,{...r,baseQuery:{...i,prepareHeaders:(e,r)=>(e.set("Authorization",`Bearer ${t}`),os.prepareHeaders(e,r))}}),withBaseUrl:t=>us(e,{...r,baseQuery:{...i,baseUrl:t}})}};return us.createComplete=(e,t={})=>us(e,t).create(),us.createCustom=(e,t,r={})=>us(e,{...r,includeStandardEndpoints:!1}).injectMany(t),us.getStandardEndpoints=()=>({...as}),us.getHttpMethods=()=>({...is}),e.ApiFactory=us,e.CacheFactory=Bo,e.FeatureFactory=function(e,t={},r=null){if(!e||"string"!=typeof e)throw new Error("Entity name must be provided as a string");const n=function(e={}){const{selectId:t,sortComparer:r}={sortComparer:!1,selectId:e=>e.id,...e},n=r?function(e,t){const{removeOne:r,removeMany:n,removeAll:o}=Ze(e);function i(t,r,n){t=Je(t);const o=new Set(n??Ye(r.ids)),i=t.filter(t=>!o.has(Ge(t,e)));0!==i.length&&u(r,i)}function a(t,r){if(0!==(t=Je(t)).length){for(const n of t)delete r.entities[e(n)];u(r,t)}}function s(t,r){let n=!1,o=!1;for(let i of t){const t=r.entities[i.id];if(!t)continue;n=!0,Object.assign(t,i.changes);const a=e(t);if(i.id!==a){o=!0,delete r.entities[i.id];const e=r.ids.indexOf(i.id);r.ids[e]=a,r.entities[a]=t}}n&&u(r,[],n,o)}function c(t,r){const[n,o,a]=Xe(t,e,r);n.length&&i(n,r,a),o.length&&s(o,r)}const u=(r,n,o,i)=>{const a=Ye(r.entities),s=Ye(r.ids),c=r.entities;let u=s;i&&(u=new Set(s));let l=[];for(const e of u){const t=a[e];t&&l.push(t)}const f=0===l.length;for(const r of n)c[e(r)]=r,f||et(l,r,t);f?l=n.slice().sort(t):o&&l.sort(t);const d=l.map(e);(function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0})(s,d)||(r.ids=d)};return{removeOne:r,removeMany:n,removeAll:o,addOne:We(function(e,t){return i([e],t)}),updateOne:We(function(e,t){return s([e],t)}),upsertOne:We(function(e,t){return c([e],t)}),setOne:We(function(e,t){return a([e],t)}),setMany:We(a),setAll:We(function(e,t){e=Je(e),t.entities={},t.ids=[],i(e,t,[])}),addMany:We(i),updateMany:We(s),upsertMany:We(c)}}(t,r):Ze(t),o=function(e){return{getInitialState:function(t={},r){const n=Object.assign({ids:[],entities:{}},t);return r?e.setAll(n,r):n}}}(n),i={getSelectors:function(e,t={}){const{createSelector:r=he}=t,n=e=>e.ids,o=e=>e.entities,i=r(n,o,(e,t)=>e.map(e=>t[e])),a=(e,t)=>t,s=(e,t)=>e[t],c=r(n,e=>e.length);if(!e)return{selectIds:n,selectEntities:o,selectAll:i,selectTotal:c,selectById:r(o,a,s)};const u=r(e,o);return{selectIds:r(e,n),selectEntities:u,selectAll:r(e,i),selectTotal:r(e,c),selectById:r(u,a,s)}}};return{selectId:t,sortComparer:r,...o,...i,...n}}(),o=(e,t)=>{if(!e||!t)throw new Error("Both source and destination objects must be provided");return Object.keys(e).reduce((t,r)=>(Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]),t),{...t})},i=(e,t,r)=>{Object.entries(t).forEach(([t,n])=>{e.addCase(n.pending,e=>{e.loading=!0,e.error=null}).addCase(n.fulfilled,(e,n)=>{e.loading=!1,e.success=!0,e.data=n.payload.result,("fetchOne"===t&&Array.isArray(n.payload)||Array.isArray(n.payload)&&n.payload.length>0)&&(e[r]=n.payload[0].result)}).addCase(n.rejected,(e,t)=>{e.loading=!1,e.success=!1,e.error=t.error||t.payload})})};return{entity:e,reducers:t,adapter:n,manager:(e={})=>{const t={...e};let r=s(t);return{reduce:(e,t)=>r(e,t),add:(e,n)=>{e&&"string"==typeof e?t[e]?console.warn(`Reducer with key '${e}' already exists`):(t[e]=n,r=s(t)):console.warn("Invalid reducer key provided")},remove:e=>{e&&t[e]?(delete t[e],r=s(t)):console.warn(`Reducer with key '${e}' does not exist`)},getReducerMap:()=>({...t})}},inject:o,create:(r={})=>{const{service:n=null,initialState:a=null}=r,s=e,c=(e=>({fetch:ci.create(e,"all"),fetchOne:ci.create(e,"one"),search:ci.post(e,"search")}))(s);return{slice:Be({name:s,initialState:a||pi(s),reducers:t,extraReducers:e=>{if(i(e,c,s),n&&"object"==typeof n){const t=Object.entries(n).reduce((e,[t,r])=>(c[t]||(e[t]=r),e),{});i(e,t,s)}}}),asyncActions:n?o(c,n):c}},getEntityName:()=>e,getAdapter:()=>n}},e.StateFactory=pi,e.ThunkFactory=ci,e}({});
10
+ */function wa(){return ga||(ga=1,function(e,t){"production"!==process.env.NODE_ENV&&function(){function r(e,t){Object.defineProperty(o.prototype,e,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}function n(e,t){var r=(e=(e=e.constructor)&&(e.displayName||e.name)||"ReactClass")+"."+t;z[r]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),z[r]=!0)}function o(e,t,r){this.props=e,this.context=t,this.refs=K,this.updater=r||B}function i(){}function a(e,t,r){this.props=e,this.context=t,this.refs=K,this.updater=r||B}function s(e){return""+e}function c(e){try{s(e);var t=!1}catch(e){t=!0}if(t){var r=(t=console).error,n="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),s(e)}}function u(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===X?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case C:return"Fragment";case I:return"Profiler";case N:return"StrictMode";case F:return"Suspense";case M:return"SuspenseList";case $:return"Activity"}if("object"==typeof e)switch("number"==typeof e.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case k:return"Portal";case D:return(e.displayName||"Context")+".Provider";case x:return(e._context.displayName||"Context")+".Consumer";case q:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case U:return null!==(t=e.displayName||null)?t:u(e.type)||"Memo";case L:t=e._payload,e=e._init;try{return u(e(t))}catch(e){}}return null}function l(e){if(e===C)return"<>";if("object"==typeof e&&null!==e&&e.$$typeof===L)return"<...>";try{var t=u(e);return t?"<"+t+">":"<...>"}catch(e){return"<...>"}}function f(){var e=Z.A;return null===e?null:e.getOwner()}function d(){return Error("react-stack-top-frame")}function p(e){if(ee.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}function y(){var e=u(this.type);return re[e]||(re[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(e=this.props.ref)?e:null}function h(e,t,r,n,o,i,a,s){return r=i.ref,e={$$typeof:j,type:e,key:t,props:i,_owner:o},null!==(void 0!==r?r:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:y}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:a}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function m(e){return"object"==typeof e&&null!==e&&e.$$typeof===j}function g(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(c(e.key),r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36);var r,n}function b(){}function v(e,t,r,n,o){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var a,s,u,l=!1;if(null===e)l=!0;else switch(i){case"bigint":case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case j:case k:l=!0;break;case L:return v((l=e._init)(e._payload),t,r,n,o)}}if(l){o=o(l=e);var f=""===n?"."+g(l,0):n;return Y(o)?(r="",null!=f&&(r=f.replace(ae,"$&/")+"/"),v(o,t,r,"",function(e){return e})):null!=o&&(m(o)&&(null!=o.key&&(l&&l.key===o.key||c(o.key)),a=o,s=r+(null==o.key||l&&l.key===o.key?"":(""+o.key).replace(ae,"$&/")+"/")+f,s=h(a.type,s,void 0,0,a._owner,a.props,a._debugStack,a._debugTask),a._store&&(s._store.validated=a._store.validated),r=s,""!==n&&null!=l&&m(l)&&null==l.key&&l._store&&!l._store.validated&&(r._store.validated=2),o=r),t.push(o)),1}if(l=0,f=""===n?".":n+":",Y(e))for(var d=0;d<e.length;d++)l+=v(n=e[d],t,r,i=f+g(n,d),o);else if("function"==typeof(d=null===(u=e)||"object"!=typeof u?null:"function"==typeof(u=Q&&u[Q]||u["@@iterator"])?u:null))for(d===e.entries&&(ie||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),ie=!0),e=d.call(e),d=0;!(n=e.next()).done;)l+=v(n=n.value,t,r,i=f+g(n,d++),o);else if("object"===i){if("function"==typeof e.then)return v(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(b,b):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,r,n,o);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return l}function w(e,t,r){if(null==e)return e;var n=[],o=0;return v(e,n,"","",function(e){return t.call(r,e,o++)}),n}function E(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return void 0===(t=e._result)&&console.error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))\n\nDid you accidentally put curly braces around the import?",t),"default"in t||console.error("lazy: Expected the result of a dynamic import() call. Instead received: %s\n\nYour code should look like: \n const MyComponent = lazy(() => import('./MyComponent'))",t),t.default;throw e._result}function S(){var e=Z.H;return null===e&&console.error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."),e}function O(){}function _(t){if(null===ue)try{var r=("require"+Math.random()).slice(0,7);ue=(e&&e[r]).call(e,"timers").setImmediate}catch(e){ue=function(e){!1===ce&&(ce=!0,"undefined"==typeof MessageChannel&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(void 0)}}return ue(t)}function A(e){return 1<e.length&&"function"==typeof AggregateError?new AggregateError(e):e[0]}function T(e,t){t!==le-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),le=t}function R(e,t,r){var n=Z.actQueue;if(null!==n)if(0!==n.length)try{return P(n),void _(function(){return R(e,t,r)})}catch(e){Z.thrownErrors.push(e)}else Z.actQueue=null;0<Z.thrownErrors.length?(n=A(Z.thrownErrors),Z.thrownErrors.length=0,r(n)):t(e)}function P(e){if(!de){de=!0;var t=0;try{for(;t<e.length;t++)for(var r=e[t];;){Z.didUsePromise=!1;var n=r(!1);if(null===n)break;if(Z.didUsePromise)return e[t]=r,void e.splice(0,t);r=n}e.length=0}catch(r){e.splice(0,t+1),Z.thrownErrors.push(r)}finally{de=!1}}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var j=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),x=Symbol.for("react.consumer"),D=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),F=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),Q=Symbol.iterator,z={},B={isMounted:function(){return!1},enqueueForceUpdate:function(e){n(e,"forceUpdate")},enqueueReplaceState:function(e){n(e,"replaceState")},enqueueSetState:function(e){n(e,"setState")}},V=Object.assign,K={};Object.freeze(K),o.prototype.isReactComponent={},o.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},o.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var H,W={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(H in W)W.hasOwnProperty(H)&&r(H,W[H]);i.prototype=o.prototype,(W=a.prototype=new i).constructor=a,V(W,o.prototype),W.isPureReactComponent=!0;var G,J,Y=Array.isArray,X=Symbol.for("react.client.reference"),Z={H:null,A:null,T:null,S:null,V:null,actQueue:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},ee=Object.prototype.hasOwnProperty,te=console.createTask?console.createTask:function(){return null},re={},ne=(W={"react-stack-bottom-frame":function(e){return e()}})["react-stack-bottom-frame"].bind(W,d)(),oe=te(l(d)),ie=!1,ae=/\/+/g,se="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)},ce=!1,ue=null,le=0,fe=!1,de=!1,pe="function"==typeof queueMicrotask?function(e){queueMicrotask(function(){return queueMicrotask(e)})}:_;W=Object.freeze({__proto__:null,c:function(e){return S().useMemoCache(e)}}),t.Children={map:w,forEach:function(e,t,r){w(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return w(e,function(){t++}),t},toArray:function(e){return w(e,function(e){return e})||[]},only:function(e){if(!m(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=o,t.Fragment=C,t.Profiler=I,t.PureComponent=a,t.StrictMode=N,t.Suspense=F,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,t.__COMPILER_RUNTIME=W,t.act=function(e){var t=Z.actQueue,r=le;le++;var n=Z.actQueue=null!==t?t:[],o=!1;try{var i=e()}catch(e){Z.thrownErrors.push(e)}if(0<Z.thrownErrors.length)throw T(0,r),e=A(Z.thrownErrors),Z.thrownErrors.length=0,e;if(null!==i&&"object"==typeof i&&"function"==typeof i.then){var a=i;return pe(function(){o||fe||(fe=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(e,t){o=!0,a.then(function(o){if(T(0,r),0===r){try{P(n),_(function(){return R(o,e,t)})}catch(e){Z.thrownErrors.push(e)}if(0<Z.thrownErrors.length){var i=A(Z.thrownErrors);Z.thrownErrors.length=0,t(i)}}else e(o)},function(e){T(0,r),0<Z.thrownErrors.length?(e=A(Z.thrownErrors),Z.thrownErrors.length=0,t(e)):t(e)})}}}var s=i;if(T(0,r),0===r&&(P(n),0!==n.length&&pe(function(){o||fe||(fe=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),Z.actQueue=null),0<Z.thrownErrors.length)throw e=A(Z.thrownErrors),Z.thrownErrors.length=0,e;return{then:function(e,t){o=!0,0===r?(Z.actQueue=n,_(function(){return R(s,e,t)})):e(s)}}},t.cache=function(e){return function(){return e.apply(null,arguments)}},t.captureOwnerStack=function(){var e=Z.getCurrentStack;return null===e?null:e()},t.cloneElement=function(e,t,r){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var n,o=V({},e.props),i=e.key,a=e._owner;if(null!=t)for(s in(n=!(ee.call(t,"ref")&&(n=Object.getOwnPropertyDescriptor(t,"ref").get)&&n.isReactWarning)&&void 0!==t.ref)&&(a=f()),p(t)&&(c(t.key),i=""+t.key),t)!ee.call(t,s)||"key"===s||"__self"===s||"__source"===s||"ref"===s&&void 0===t.ref||(o[s]=t[s]);var s=arguments.length-2;if(1===s)o.children=r;else if(1<s){n=Array(s);for(var u=0;u<s;u++)n[u]=arguments[u+2];o.children=n}for(o=h(e.type,i,void 0,0,a,o,e._debugStack,e._debugTask),i=2;i<arguments.length;i++)m(a=arguments[i])&&a._store&&(a._store.validated=1);return o},t.createContext=function(e){return(e={$$typeof:D,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:x,_context:e},e._currentRenderer=null,e._currentRenderer2=null,e},t.createElement=function(e,t,r){for(var n=2;n<arguments.length;n++){var o=arguments[n];m(o)&&o._store&&(o._store.validated=1)}if(n={},o=null,null!=t)for(u in J||!("__self"in t)||"key"in t||(J=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),p(t)&&(c(t.key),o=""+t.key),t)ee.call(t,u)&&"key"!==u&&"__self"!==u&&"__source"!==u&&(n[u]=t[u]);var i=arguments.length-2;if(1===i)n.children=r;else if(1<i){for(var a=Array(i),s=0;s<i;s++)a[s]=arguments[s+2];Object.freeze&&Object.freeze(a),n.children=a}if(e&&e.defaultProps)for(u in i=e.defaultProps)void 0===n[u]&&(n[u]=i[u]);o&&function(e,t){function r(){G||(G=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}(n,"function"==typeof e?e.displayName||e.name||"Unknown":e);var u=1e4>Z.recentlyCreatedOwnerStacks++;return h(e,o,void 0,0,f(),n,u?Error("react-stack-top-frame"):ne,u?te(l(e)):oe)},t.createRef=function(){var e={current:null};return Object.seal(e),e},t.forwardRef=function(e){null!=e&&e.$$typeof===U?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?console.error("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&null!=e.defaultProps&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var t,r={$$typeof:q,render:e};return Object.defineProperty(r,"displayName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(r){t=r,e.name||e.displayName||(Object.defineProperty(e,"name",{value:r}),e.displayName=r)}}),r},t.isValidElement=m,t.lazy=function(e){return{$$typeof:L,_payload:{_status:-1,_result:e},_init:E}},t.memo=function(e,t){var r;return null==e&&console.error("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),t={$$typeof:U,type:e,compare:void 0===t?null:t},Object.defineProperty(t,"displayName",{enumerable:!1,configurable:!0,get:function(){return r},set:function(t){r=t,e.name||e.displayName||(Object.defineProperty(e,"name",{value:t}),e.displayName=t)}}),t},t.startTransition=function(e){var t=Z.T,r={};Z.T=r,r._updatedFibers=new Set;try{var n=e(),o=Z.S;null!==o&&o(r,n),"object"==typeof n&&null!==n&&"function"==typeof n.then&&n.then(O,se)}catch(e){se(e)}finally{null===t&&r._updatedFibers&&(e=r._updatedFibers.size,r._updatedFibers.clear(),10<e&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),Z.T=t}},t.unstable_useCacheRefresh=function(){return S().useCacheRefresh()},t.use=function(e){return S().use(e)},t.useActionState=function(e,t,r){return S().useActionState(e,t,r)},t.useCallback=function(e,t){return S().useCallback(e,t)},t.useContext=function(e){var t=S();return e.$$typeof===x&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),t.useContext(e)},t.useDebugValue=function(e,t){return S().useDebugValue(e,t)},t.useDeferredValue=function(e,t){return S().useDeferredValue(e,t)},t.useEffect=function(e,t,r){null==e&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");var n=S();if("function"==typeof r)throw Error("useEffect CRUD overload is not enabled in this build of React.");return n.useEffect(e,t)},t.useId=function(){return S().useId()},t.useImperativeHandle=function(e,t,r){return S().useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return null==e&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),S().useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return null==e&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),S().useLayoutEffect(e,t)},t.useMemo=function(e,t){return S().useMemo(e,t)},t.useOptimistic=function(e,t){return S().useOptimistic(e,t)},t.useReducer=function(e,t,r){return S().useReducer(e,t,r)},t.useRef=function(e){return S().useRef(e)},t.useState=function(e){return S().useState(e)},t.useSyncExternalStore=function(e,t,r){return S().useSyncExternalStore(e,t,r)},t.useTransition=function(){return S().useTransition()},t.version="19.1.0","undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}(va,va.exports)),va.exports}function Ea(){return ba||(ba=1,"production"===process.env.NODE_ENV?ha.exports=function(){if(ya)return ma;ya=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),a=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),l=Symbol.for("react.lazy"),f=Symbol.iterator,d={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},p=Object.assign,y={};function h(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||d}function m(){}function g(e,t,r){this.props=e,this.context=t,this.refs=y,this.updater=r||d}h.prototype.isReactComponent={},h.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},h.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=h.prototype;var b=g.prototype=new m;b.constructor=g,p(b,h.prototype),b.isPureReactComponent=!0;var v=Array.isArray,w={H:null,A:null,T:null,S:null,V:null},E=Object.prototype.hasOwnProperty;function S(t,r,n,o,i,a){return n=a.ref,{$$typeof:e,type:t,key:r,ref:void 0!==n?n:null,props:a}}function O(t){return"object"==typeof t&&null!==t&&t.$$typeof===e}var _=/\/+/g;function A(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(r=""+e.key,n={"=":"=0",":":"=2"},"$"+r.replace(/[=:]/g,function(e){return n[e]})):t.toString(36);var r,n}function T(){}function R(r,n,o,i,a){var s=typeof r;"undefined"!==s&&"boolean"!==s||(r=null);var c,u,d=!1;if(null===r)d=!0;else switch(s){case"bigint":case"string":case"number":d=!0;break;case"object":switch(r.$$typeof){case e:case t:d=!0;break;case l:return R((d=r._init)(r._payload),n,o,i,a)}}if(d)return a=a(r),d=""===i?"."+A(r,0):i,v(a)?(o="",null!=d&&(o=d.replace(_,"$&/")+"/"),R(a,n,o,"",function(e){return e})):null!=a&&(O(a)&&(c=a,u=o+(null==a.key||r&&r.key===a.key?"":(""+a.key).replace(_,"$&/")+"/")+d,a=S(c.type,u,void 0,0,0,c.props)),n.push(a)),1;d=0;var p,y=""===i?".":i+":";if(v(r))for(var h=0;h<r.length;h++)d+=R(i=r[h],n,o,s=y+A(i,h),a);else if("function"==typeof(h=null===(p=r)||"object"!=typeof p?null:"function"==typeof(p=f&&p[f]||p["@@iterator"])?p:null))for(r=h.call(r),h=0;!(i=r.next()).done;)d+=R(i=i.value,n,o,s=y+A(i,h++),a);else if("object"===s){if("function"==typeof r.then)return R(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"==typeof e.status?e.then(T,T):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(r),n,o,i,a);throw n=String(r),Error("Objects are not valid as a React child (found: "+("[object Object]"===n?"object with keys {"+Object.keys(r).join(", ")+"}":n)+"). If you meant to render a collection of children, use an array instead.")}return d}function P(e,t,r){if(null==e)return e;var n=[],o=0;return R(e,n,"","",function(e){return t.call(r,e,o++)}),n}function j(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var k="function"==typeof reportError?reportError:function(e){if("object"==typeof window&&"function"==typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"==typeof e&&null!==e&&"string"==typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"==typeof process&&"function"==typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function C(){}return ma.Children={map:P,forEach:function(e,t,r){P(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},ma.Component=h,ma.Fragment=r,ma.Profiler=o,ma.PureComponent=g,ma.StrictMode=n,ma.Suspense=c,ma.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,ma.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},ma.cache=function(e){return function(){return e.apply(null,arguments)}},ma.cloneElement=function(e,t,r){if(null==e)throw Error("The argument must be a React element, but you passed "+e+".");var n=p({},e.props),o=e.key;if(null!=t)for(i in t.ref,void 0!==t.key&&(o=""+t.key),t)!E.call(t,i)||"key"===i||"__self"===i||"__source"===i||"ref"===i&&void 0===t.ref||(n[i]=t[i]);var i=arguments.length-2;if(1===i)n.children=r;else if(1<i){for(var a=Array(i),s=0;s<i;s++)a[s]=arguments[s+2];n.children=a}return S(e.type,o,void 0,0,0,n)},ma.createContext=function(e){return(e={$$typeof:a,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:i,_context:e},e},ma.createElement=function(e,t,r){var n,o={},i=null;if(null!=t)for(n in void 0!==t.key&&(i=""+t.key),t)E.call(t,n)&&"key"!==n&&"__self"!==n&&"__source"!==n&&(o[n]=t[n]);var a=arguments.length-2;if(1===a)o.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];o.children=s}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===o[n]&&(o[n]=a[n]);return S(e,i,void 0,0,0,o)},ma.createRef=function(){return{current:null}},ma.forwardRef=function(e){return{$$typeof:s,render:e}},ma.isValidElement=O,ma.lazy=function(e){return{$$typeof:l,_payload:{_status:-1,_result:e},_init:j}},ma.memo=function(e,t){return{$$typeof:u,type:e,compare:void 0===t?null:t}},ma.startTransition=function(e){var t=w.T,r={};w.T=r;try{var n=e(),o=w.S;null!==o&&o(r,n),"object"==typeof n&&null!==n&&"function"==typeof n.then&&n.then(C,k)}catch(e){k(e)}finally{w.T=t}},ma.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},ma.use=function(e){return w.H.use(e)},ma.useActionState=function(e,t,r){return w.H.useActionState(e,t,r)},ma.useCallback=function(e,t){return w.H.useCallback(e,t)},ma.useContext=function(e){return w.H.useContext(e)},ma.useDebugValue=function(){},ma.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},ma.useEffect=function(e,t,r){var n=w.H;if("function"==typeof r)throw Error("useEffect CRUD overload is not enabled in this build of React.");return n.useEffect(e,t)},ma.useId=function(){return w.H.useId()},ma.useImperativeHandle=function(e,t,r){return w.H.useImperativeHandle(e,t,r)},ma.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},ma.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},ma.useMemo=function(e,t){return w.H.useMemo(e,t)},ma.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},ma.useReducer=function(e,t,r){return w.H.useReducer(e,t,r)},ma.useRef=function(e){return w.H.useRef(e)},ma.useState=function(e){return w.H.useState(e)},ma.useSyncExternalStore=function(e,t,r){return w.H.useSyncExternalStore(e,t,r)},ma.useTransition=function(){return w.H.useTransition()},ma.version="19.1.0",ma}():ha.exports=wa()),ha.exports}var Sa,Oa,_a,Aa=Ea(),Ta={exports:{}},Ra={},Pa={},ja=(_a||(_a=1,"production"===process.env.NODE_ENV?Ta.exports=function(){if(Sa)return Ra;Sa=1;var e=Ea(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;return Ra.useSyncExternalStoreWithSelector=function(e,s,c,u,l){var f=n(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i(function(){function e(e){if(!o){if(o=!0,r=e,e=u(e),void 0!==l&&d.hasValue){var i=d.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var a=u(e);return void 0!==l&&l(i,a)?(r=e,i):(r=e,n=a)}var r,n,o=!1,i=void 0===c?null:c;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,c,u,l]);var p=r(e,f[0],f[1]);return o(function(){d.hasValue=!0,d.value=p},[p]),a(p),p},Ra}():Ta.exports=(Oa||(Oa=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=Ea(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;Pa.useSyncExternalStoreWithSelector=function(e,s,c,u,l){var f=n(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i(function(){function e(e){if(!o){if(o=!0,r=e,e=u(e),void 0!==l&&d.hasValue){var i=d.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var a=u(e);return void 0!==l&&l(i,a)?(r=e,i):(r=e,n=a)}var r,n,o=!1,i=void 0===c?null:c;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,c,u,l]);var p=r(e,f[0],f[1]);return o(function(){d.hasValue=!0,d.value=p},[p]),a(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Pa)),Ta.exports);function ka(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Ca(e,t){if(ka(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!ka(e[r[n]],t[r[n]]))return!1;return!0}var Na=Symbol.for("react-redux-context"),Ia="undefined"!=typeof globalThis?globalThis:{};var xa=function(){if(!Aa.createContext)return{};const e=Ia[Na]??=new Map;let t=e.get(Aa.createContext);return t||(t=Aa.createContext(null),"production"!==process.env.NODE_ENV&&(t.displayName="ReactRedux"),e.set(Aa.createContext,t)),t}();function Da(e=xa){return function(){const t=Aa.useContext(e);if("production"!==process.env.NODE_ENV&&!t)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return t}}var qa=Da();function Fa(e=xa){const t=e===xa?qa:Da(e),r=()=>{const{store:e}=t();return e};return Object.assign(r,{withTypes:()=>r}),r}var Ma=Fa();var Ua=function(e=xa){const t=e===xa?Ma:Fa(e),r=()=>t().dispatch;return Object.assign(r,{withTypes:()=>r}),r}(),La=(e,t)=>e===t;var $a=function(e=xa){const t=e===xa?qa:Da(e),r=(e,r={})=>{const{equalityFn:n=La}="function"==typeof r?{equalityFn:r}:r;if("production"!==process.env.NODE_ENV){if(!e)throw new Error("You must pass a selector to useSelector");if("function"!=typeof e)throw new Error("You must pass a function as a selector to useSelector");if("function"!=typeof n)throw new Error("You must pass a function as an equality function to useSelector")}const o=t(),{store:i,subscription:a,getServerState:s}=o,c=Aa.useRef(!0),u=Aa.useCallback({[e.name](t){const i=e(t);if("production"!==process.env.NODE_ENV){const{devModeChecks:a={}}="function"==typeof r?{}:r,{identityFunctionCheck:s,stabilityCheck:u}=o,{identityFunctionCheck:l,stabilityCheck:f}={stabilityCheck:u,identityFunctionCheck:s,...a};if("always"===f||"once"===f&&c.current){const r=e(t);if(!n(i,r)){let n;try{throw new Error}catch(e){({stack:n}=e)}console.warn("Selector "+(e.name||"unknown")+" returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization",{state:t,selected:i,selected2:r,stack:n})}}if(("always"===l||"once"===l&&c.current)&&i===t){let t;try{throw new Error}catch(e){({stack:t}=e)}console.warn("Selector "+(e.name||"unknown")+" returned the root state when called. This can lead to unnecessary rerenders.\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.",{stack:t})}c.current&&(c.current=!1)}return i}}[e.name],[e]),l=ja.useSyncExternalStoreWithSelector(a.addNestedSub,i.getState,s||i.getState,u,n);return Aa.useDebugValue(l),l};return Object.assign(r,{withTypes:()=>r}),r}(),Qa=function(e){e()};function za(e){return e.replace(e[0],e[0].toUpperCase())}function Ba(e){let t=0;for(const r in e)t++;return t}function Va(e){return"infinitequery"===e.type}function Ka(e,...t){return Object.assign(e,...t)}var Ha=Symbol();function Wa(e,t,r,n){const o=Aa.useMemo(()=>({queryArgs:e,serialized:"object"==typeof e?t({queryArgs:e,endpointDefinition:r,endpointName:n}):e}),[e,t,r,n]),i=Aa.useRef(o);return Aa.useEffect(()=>{i.current.serialized!==o.serialized&&(i.current=o)},[o]),i.current.serialized===o.serialized?i.current.queryArgs:e}function Ga(e){const t=Aa.useRef(e);return Aa.useEffect(()=>{Ca(t.current,e)||(t.current=e)},[e]),Ca(t.current,e)?t.current:e}var Ja=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),Ya="undefined"!=typeof navigator&&"ReactNative"===navigator.product,Xa=Ja||Ya?Aa.useLayoutEffect:Aa.useEffect,Za=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:hi.pending}:e;function es(e,...t){const r={};return t.forEach(t=>{r[t]=e[t]}),r}var ts=["data","status","isLoading","isSuccess","isError","error"],rs=Symbol(),ns=function(...e){return function(t){const r=fe(e=>t.extractRehydrationInfo?.(e,{reducerPath:t.reducerPath??"api"})),n={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...t,extractRehydrationInfo:r,serializeQueryArgs(e){let r=ra;if("serializeQueryArgs"in e.endpointDefinition){const t=e.endpointDefinition.serializeQueryArgs;r=e=>{const r=t(e);return"string"==typeof r?r:ra({...e,queryArgs:r})}}else t.serializeQueryArgs&&(r=t.serializeQueryArgs);return r(e)},tagTypes:[...t.tagTypes||[]]},o={endpointDefinitions:{},batch(e){e()},apiUid:Ie(),extractRehydrationInfo:r,hasRehydrationInfo:fe(e=>null!=r(e))},i={injectEndpoints:function(e){const t=e.endpoints({query:e=>({...e,type:"query"}),mutation:e=>({...e,type:"mutation"}),infiniteQuery:e=>({...e,type:"infinitequery"})});for(const[r,n]of Object.entries(t))if(!0!==e.overrideExisting&&r in o.endpointDefinitions){if("throw"===e.overrideExisting)throw new Error("production"===process.env.NODE_ENV?tt(39):`called \`injectEndpoints\` to override already-existing endpointName ${r} without specifying \`overrideExisting: true\``);"undefined"!=typeof process&&"development"===process.env.NODE_ENV&&console.error(`called \`injectEndpoints\` to override already-existing endpointName ${r} without specifying \`overrideExisting: true\``)}else{if("undefined"!=typeof process&&"development"===process.env.NODE_ENV&&Ii(n)){const{infiniteQueryOptions:e}=n,{maxPages:t,getPreviousPageParam:o}=e;if("number"==typeof t){if(t<1)throw new Error("production"===process.env.NODE_ENV?tt(40):`maxPages for endpoint '${r}' must be a number greater than 0`);if("function"!=typeof o)throw new Error("production"===process.env.NODE_ENV?tt(41):`getPreviousPageParam for endpoint '${r}' must be a function if maxPages is used`)}}o.endpointDefinitions[r]=n;for(const e of a)e.injectEndpoint(r,n)}return i},enhanceEndpoints({addTagTypes:e,endpoints:t}){if(e)for(const t of e)n.tagTypes.includes(t)||n.tagTypes.push(t);if(t)for(const[e,r]of Object.entries(t))"function"==typeof r?r(o.endpointDefinitions[e]):Object.assign(o.endpointDefinitions[e]||{},r);return i}},a=e.map(e=>e.init(i,n,o));return i.injectEndpoints({endpoints:t.endpoints})}}(pa(),(({batch:e=Qa,hooks:t={useDispatch:Ua,useSelector:$a,useStore:Ma},createSelector:r=pe,unstable__sideEffectsInRender:n=!1,...o}={})=>{if("production"!==process.env.NODE_ENV){const e=["useDispatch","useSelector","useStore"];let r=!1;for(const n of e)if(Ba(o)>0&&(o[n]&&(r||(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 } })`"),r=!0)),t[n]=o[n]),"function"!=typeof t[n])throw new Error("production"===process.env.NODE_ENV?tt(36):`When using custom hooks for context, all ${e.length} hooks need to be provided: ${e.join(", ")}.\nHook ${n} was either not provided or not a function.`)}return{name:rs,init(o,{serializeQueryArgs:i},a){const s=o,{buildQueryHooks:c,buildInfiniteQueryHooks:u,buildMutationHook:l,usePrefetch:f}=function({api:e,moduleOptions:{batch:t,hooks:{useDispatch:r,useSelector:n,useStore:o},unstable__sideEffectsInRender:i,createSelector:a},serializeQueryArgs:s,context:c}){const u=i?e=>e():Aa.useEffect;return{buildQueryHooks:function(n){const o=(e,t={})=>{const[r]=d(n,e,t);return y(r),Aa.useMemo(()=>({refetch:()=>h(r)}),[r])},i=({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:a=0,skipPollingIfUnfocused:s=!1}={})=>{const{initiate:c}=e.endpoints[n],l=r(),[f,d]=Aa.useState(Ha),p=Aa.useRef(void 0),y=Ga({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:a,skipPollingIfUnfocused:s});u(()=>{const e=p.current?.subscriptionOptions;y!==e&&p.current?.updateSubscriptionOptions(y)},[y]);const h=Aa.useRef(y);u(()=>{h.current=y},[y]);const m=Aa.useCallback(function(e,r=!1){let n;return t(()=>{p.current?.unsubscribe(),p.current=n=l(c(e,{subscriptionOptions:h.current,forceRefetch:!r})),d(e)}),n},[l,c]),g=Aa.useCallback(()=>{p.current?.queryCacheKey&&l(e.internalActions.removeQueryResult({queryCacheKey:p.current?.queryCacheKey}))},[l]);return Aa.useEffect(()=>()=>{p?.current?.unsubscribe()},[]),Aa.useEffect(()=>{f===Ha||p.current||m(f,!0)},[f,m]),Aa.useMemo(()=>[m,f,{reset:g}],[m,f,g])},a=p(n,l);return{useQueryState:a,useQuerySubscription:o,useLazyQuerySubscription:i,useLazyQuery(e){const[t,r,{reset:n}]=i(e),o=a(r,{...e,skip:r===Ha}),s=Aa.useMemo(()=>({lastArg:r}),[r]);return Aa.useMemo(()=>[t,{...o,reset:n},s],[t,o,n,s])},useQuery(e,t){const r=o(e,t),n=a(e,{selectFromResult:e===Yi||t?.skip?void 0:Za,...t}),i=es(n,...ts);return Aa.useDebugValue(i),Aa.useMemo(()=>({...n,...r}),[n,r])}}},buildInfiniteQueryHooks:function(e){const r=(r,n={})=>{const[o,i,a,s]=d(e,r,n),l=Aa.useRef(s);u(()=>{l.current=s},[s]);const f=Aa.useCallback(function(e,r){let n;return t(()=>{o.current?.unsubscribe(),o.current=n=i(a(e,{subscriptionOptions:l.current,direction:r}))}),n},[o,i,a]);y(o);const p=Wa(n.skip?Yi:r,ra,c.endpointDefinitions[e],e),m=Aa.useCallback(()=>h(o),[o]);return Aa.useMemo(()=>({trigger:f,refetch:m,fetchNextPage:()=>f(p,"forward"),fetchPreviousPage:()=>f(p,"backward")}),[m,f,p])},n=p(e,f);return{useInfiniteQueryState:n,useInfiniteQuerySubscription:r,useInfiniteQuery(e,t){const{refetch:o,fetchNextPage:i,fetchPreviousPage:a}=r(e,t),s=n(e,{selectFromResult:e===Yi||t?.skip?void 0:Za,...t}),c=es(s,...ts,"hasNextPage","hasPreviousPage");return Aa.useDebugValue(c),Aa.useMemo(()=>({...s,fetchNextPage:i,fetchPreviousPage:a,refetch:o}),[s,i,a,o])}}},buildMutationHook:function(o){return({selectFromResult:i,fixedCacheKey:s}={})=>{const{select:c,initiate:u}=e.endpoints[o],l=r(),[f,d]=Aa.useState();Aa.useEffect(()=>()=>{f?.arg.fixedCacheKey||f?.reset()},[f]);const p=Aa.useCallback(function(e){const t=l(u(e,{fixedCacheKey:s}));return d(t),t},[l,u,s]),{requestId:y}=f||{},h=Aa.useMemo(()=>c({fixedCacheKey:s,requestId:f?.requestId}),[s,f,c]),m=Aa.useMemo(()=>i?a([h],i):h,[i,h]),g=n(m,Ca),b=null==s?f?.arg.originalArgs:void 0,v=Aa.useCallback(()=>{t(()=>{f&&d(void 0),s&&l(e.internalActions.removeMutationResult({requestId:y,fixedCacheKey:s}))})},[l,s,f,y]),w=es(g,...ts,"endpointName");Aa.useDebugValue(w);const E=Aa.useMemo(()=>({...g,originalArgs:b,reset:v}),[g,b,v]);return Aa.useMemo(()=>[p,E],[p,E])}},usePrefetch:function(t,n){const o=r(),i=Ga(n);return Aa.useCallback((r,n)=>o(e.util.prefetch(t,r,{...i,...n})),[t,o,i])}};function l(e,t,r){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,n=c.endpointDefinitions[e];r!==Yi&&s({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===s({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);const o=void 0!==n,i=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!o&&i,u=e.isSuccess||o&&(i&&!t?.isError||e.isUninitialized);return{...e,data:n,currentData:e.data,isFetching:i,isLoading:a,isSuccess:u}}function f(e,t,r){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,n=c.endpointDefinitions[e];r!==Yi&&s({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===s({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);const o=void 0!==n,i=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!o&&i,u=e.isSuccess||i&&o;return{...e,data:n,currentData:e.data,isFetching:i,isLoading:a,isSuccess:u}}function d(t,n,{refetchOnReconnect:o,refetchOnFocus:i,refetchOnMountOrArgChange:a,skip:s=!1,pollingInterval:l=0,skipPollingIfUnfocused:f=!1,...d}={}){const{initiate:p}=e.endpoints[t],y=r(),h=Aa.useRef(void 0);if(!h.current){const t=y(e.internalActions.internal_getRTKQSubscriptions());if("production"!==process.env.NODE_ENV&&("object"!=typeof t||"string"==typeof t?.type))throw new Error("production"===process.env.NODE_ENV?tt(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.\n You must add the middleware for RTK-Query to function correctly!`);h.current=t}const m=Wa(s?Yi:n,ra,c.endpointDefinitions[t],t),g=Ga({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:l,skipPollingIfUnfocused:f}),b=Ga(d.initialPageParam),v=Aa.useRef(void 0);let{queryCacheKey:w,requestId:E}=v.current||{},S=!1;w&&E&&(S=h.current.isRequestSubscribed(w,E));const O=!S&&void 0!==v.current;return u(()=>{O&&(v.current=void 0)},[O]),u(()=>{const e=v.current;if("undefined"!=typeof process&&"removeMeOnCompilation"===process.env.NODE_ENV&&console.log(O),m===Yi)return e?.unsubscribe(),void(v.current=void 0);const r=v.current?.subscriptionOptions;if(e&&e.arg===m)g!==r&&e.updateSubscriptionOptions(g);else{e?.unsubscribe();const r=y(p(m,{subscriptionOptions:g,forceRefetch:a,...Va(c.endpointDefinitions[t])?{initialPageParam:b}:{}}));v.current=r}},[y,p,a,m,g,O,b,t]),[v,y,p,g]}function p(t,r){return(i,{skip:u=!1,selectFromResult:l}={})=>{const{select:f}=e.endpoints[t],d=Wa(u?Yi:i,s,c.endpointDefinitions[t],t),p=Aa.useRef(void 0),y=Aa.useMemo(()=>a([f(d),(e,t)=>t,e=>d],r,{memoizeOptions:{resultEqualityCheck:Ca}}),[f,d]),h=Aa.useMemo(()=>l?a([y],l,{devModeChecks:{identityFunctionCheck:"never"}}):y,[y,l]),m=n(e=>h(e,p.current),Ca),g=o(),b=y(g.getState(),p.current);return Xa(()=>{p.current=b},[b]),m}}function y(e){Aa.useEffect(()=>()=>{e.current?.unsubscribe?.(),e.current=void 0},[e])}function h(e){if(!e.current)throw new Error("production"===process.env.NODE_ENV?tt(38):"Cannot refetch a query that has not been started yet.");return e.current.refetch()}}({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:n,createSelector:r},serializeQueryArgs:i,context:a});return Ka(s,{usePrefetch:f}),Ka(a,{batch:e}),{injectEndpoint(e,t){if("query"===t.type){const{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:a}=c(e);Ka(s.endpoints[e],{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:a}),o[`use${za(e)}Query`]=t,o[`useLazy${za(e)}Query`]=r}if(function(e){return"mutation"===e.type}(t)){const t=l(e);Ka(s.endpoints[e],{useMutation:t}),o[`use${za(e)}Mutation`]=t}else if(Va(t)){const{useInfiniteQuery:t,useInfiniteQuerySubscription:r,useInfiniteQueryState:n}=u(e);Ka(s.endpoints[e],{useInfiniteQuery:t,useInfiniteQuerySubscription:r,useInfiniteQueryState:n}),o[`use${za(e)}InfiniteQuery`]=t}}}}}})());const os={baseUrl:process.env.REACT_APP_API_BASE_URL||"http://localhost:4000/fear/api/",timeout:3e4,credentials:"include",prepareHeaders:(e,{getState:t})=>{e.set("Content-Type","application/json");const r=t()?.auth?.token;return r&&e.set("Authorization",`Bearer ${r}`),e}},is={GET:"GET",POST:"POST",PUT:"PUT",PATCH:"PATCH",DELETE:"DELETE"},as={getAll:{method:is.GET,url:e=>`${e}/all`,providesTags:e=>[{type:e,id:"LIST"}]},getById:{method:is.GET,url:(e,t)=>`${e}/${t}`,providesTags:(e,t)=>[{type:e,id:t}]},create:{method:is.POST,url:e=>`${e}`,invalidatesTags:e=>[{type:e,id:"LIST"}]},update:{method:is.PUT,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},patch:{method:is.PATCH,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},delete:{method:is.DELETE,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},search:{method:is.GET,url:e=>`${e}/search`,providesTags:e=>[{type:e,id:"SEARCH"}]}},ss=e=>e.status?{status:e.status,message:e.data?.message||`HTTP Error ${e.status}`,data:e.data}:{status:"FETCH_ERROR",message:e.message||"Network error occurred",error:e.error},cs=(e,t,r={})=>{const{method:n,url:o}=e;let i={method:n,url:"function"==typeof o?o(t,r.id,r):o};return n!==is.GET&&n!==is.DELETE&&(i.body=r.data||r),n===is.GET&&r.params&&(i.params=r.params),i},us=(e,t={})=>{(e=>{if(!e||"string"!=typeof e)throw new Error("SliceName must be a non-empty string")})(e);const r={tagTypes:["Product","Order","User","Category"],baseQuery:{},includeStandardEndpoints:!0,...t},n=(o=e).charAt(0).toUpperCase()+o.slice(1);var o;r.tagTypes.includes(n)||r.tagTypes.push(n);const i={...os,...r.baseQuery},a=ns({reducerPath:`${e}Api`,tagTypes:r.tagTypes,baseQuery:Ti(i),endpoints:()=>({})}),s=(t,r)=>{const{method:n=is.GET,url:o,type:i=(n===is.GET?"query":"mutation"),providesTags:s,invalidatesTags:c,transformResponse:u,transformErrorResponse:l=ss}=r;return a.injectEndpoints({endpoints:r=>({[t]:r[i]({query:(t={})=>cs({method:n,url:o},e,t),providesTags:s?(t,r,n)=>s(e,n?.id,t,r,n):void 0,invalidatesTags:c?(t,r,n)=>c(e,n?.id,t,r,n):void 0,transformResponse:u,transformErrorResponse:l})})})},c=t=>a.injectEndpoints({endpoints:r=>{const n={};return Object.entries(t).forEach(([t,o])=>{const{method:i=is.GET,url:a,type:s=(i===is.GET?"query":"mutation"),providesTags:c,invalidatesTags:u,transformResponse:l,transformErrorResponse:f=ss}=o;n[t]=r[s]({query:(t={})=>cs({method:i,url:a},e,t),providesTags:c?(t,r,n)=>c(e,n?.id,t,r,n):void 0,invalidatesTags:u?(t,r,n)=>u(e,n?.id,t,r,n):void 0,transformResponse:l,transformErrorResponse:f})}),n}}),u=()=>{const e={};return Object.entries(as).forEach(([t,r])=>{e[t]={method:r.method,url:r.url,providesTags:r.providesTags,invalidatesTags:r.invalidatesTags}}),c(e)};return{sliceName:e,entityTagType:n,baseApi:a,inject:s,injectMany:c,create:()=>{let e=a;return r.includeStandardEndpoints&&(e=u()),e},createStandard:u,createBulk:()=>{const t={bulkCreate:{method:is.POST,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]},bulkUpdate:{method:is.PUT,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]},bulkDelete:{method:is.DELETE,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]}};return c(t)},createCustom:(e,t)=>s(e,t),getTagTypes:()=>[...r.tagTypes],getBaseUrl:()=>i.baseUrl,getReducerPath:()=>a.reducerPath,withAuth:t=>us(e,{...r,baseQuery:{...i,prepareHeaders:(e,r)=>(e.set("Authorization",`Bearer ${t}`),os.prepareHeaders(e,r))}}),withBaseUrl:t=>us(e,{...r,baseQuery:{...i,baseUrl:t}})}};return us.createComplete=(e,t={})=>us(e,t).create(),us.createCustom=(e,t,r={})=>us(e,{...r,includeStandardEndpoints:!1}).injectMany(t),us.getStandardEndpoints=()=>({...as}),us.getHttpMethods=()=>({...is}),e.API=ni,e.ApiFactory=us,e.CacheFactory=Bo,e.FeatureFactory=function(e,t={},r=null){if(!e||"string"!=typeof e)throw new Error("Entity name must be provided as a string");const n=function(e={}){const{selectId:t,sortComparer:r}={sortComparer:!1,selectId:e=>e.id,...e},n=r?function(e,t){const{removeOne:r,removeMany:n,removeAll:o}=Ze(e);function i(t,r,n){t=Je(t);const o=new Set(n??Ye(r.ids)),i=t.filter(t=>!o.has(Ge(t,e)));0!==i.length&&u(r,i)}function a(t,r){if(0!==(t=Je(t)).length){for(const n of t)delete r.entities[e(n)];u(r,t)}}function s(t,r){let n=!1,o=!1;for(let i of t){const t=r.entities[i.id];if(!t)continue;n=!0,Object.assign(t,i.changes);const a=e(t);if(i.id!==a){o=!0,delete r.entities[i.id];const e=r.ids.indexOf(i.id);r.ids[e]=a,r.entities[a]=t}}n&&u(r,[],n,o)}function c(t,r){const[n,o,a]=Xe(t,e,r);n.length&&i(n,r,a),o.length&&s(o,r)}const u=(r,n,o,i)=>{const a=Ye(r.entities),s=Ye(r.ids),c=r.entities;let u=s;i&&(u=new Set(s));let l=[];for(const e of u){const t=a[e];t&&l.push(t)}const f=0===l.length;for(const r of n)c[e(r)]=r,f||et(l,r,t);f?l=n.slice().sort(t):o&&l.sort(t);const d=l.map(e);(function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0})(s,d)||(r.ids=d)};return{removeOne:r,removeMany:n,removeAll:o,addOne:We(function(e,t){return i([e],t)}),updateOne:We(function(e,t){return s([e],t)}),upsertOne:We(function(e,t){return c([e],t)}),setOne:We(function(e,t){return a([e],t)}),setMany:We(a),setAll:We(function(e,t){e=Je(e),t.entities={},t.ids=[],i(e,t,[])}),addMany:We(i),updateMany:We(s),upsertMany:We(c)}}(t,r):Ze(t),o=function(e){return{getInitialState:function(t={},r){const n=Object.assign({ids:[],entities:{}},t);return r?e.setAll(n,r):n}}}(n),i={getSelectors:function(e,t={}){const{createSelector:r=he}=t,n=e=>e.ids,o=e=>e.entities,i=r(n,o,(e,t)=>e.map(e=>t[e])),a=(e,t)=>t,s=(e,t)=>e[t],c=r(n,e=>e.length);if(!e)return{selectIds:n,selectEntities:o,selectAll:i,selectTotal:c,selectById:r(o,a,s)};const u=r(e,o);return{selectIds:r(e,n),selectEntities:u,selectAll:r(e,i),selectTotal:r(e,c),selectById:r(u,a,s)}}};return{selectId:t,sortComparer:r,...o,...i,...n}}(),o=(e,t)=>{if(!e||!t)throw new Error("Both source and destination objects must be provided");return Object.keys(e).reduce((t,r)=>(Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]),t),{...t})},i=(e,t,r)=>{Object.entries(t).forEach(([t,n])=>{e.addCase(n.pending,e=>{e.loading=!0,e.error=null}).addCase(n.fulfilled,(e,n)=>{e.loading=!1,e.success=!0,e.data=n.payload.result,("fetchOne"===t&&Array.isArray(n.payload)||Array.isArray(n.payload)&&n.payload.length>0)&&(e[r]=n.payload[0].result)}).addCase(n.rejected,(e,t)=>{e.loading=!1,e.success=!1,e.error=t.error||t.payload})})};return{entity:e,reducers:t,adapter:n,manager:(e={})=>{const t={...e};let r=s(t);return{reduce:(e,t)=>r(e,t),add:(e,n)=>{e&&"string"==typeof e?t[e]?console.warn(`Reducer with key '${e}' already exists`):(t[e]=n,r=s(t)):console.warn("Invalid reducer key provided")},remove:e=>{e&&t[e]?(delete t[e],r=s(t)):console.warn(`Reducer with key '${e}' does not exist`)},getReducerMap:()=>({...t})}},inject:o,create:(r={})=>{const{service:n=null,initialState:a=null}=r,s=e,c=(e=>({fetch:ci.create(e,"all"),fetchOne:ci.create(e,"one"),search:ci.post(e,"search")}))(s);return{slice:Be({name:s,initialState:a||pi(s),reducers:t,extraReducers:e=>{if(i(e,c,s),n&&"object"==typeof n){const t=Object.entries(n).reduce((e,[t,r])=>(c[t]||(e[t]=r),e),{});i(e,t,s)}}}),asyncActions:n?o(c,n):c}},getEntityName:()=>e,getAdapter:()=>n}},e.StateFactory=pi,e.ThunkFactory=ci,e}({});
package/dist/index.esm.js CHANGED
@@ -16,5 +16,5 @@ function e(e){return`Minified Redux error #${e}; visit https://redux.js.org/Erro
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var is=(ns||(ns=1,"production"===process.env.NODE_ENV?es.exports=function(){if(Xa)return ts;Xa=1;var e=Ya(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;return ts.useSyncExternalStoreWithSelector=function(e,s,c,u,l){var f=n(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i(function(){function e(e){if(!o){if(o=!0,r=e,e=u(e),void 0!==l&&d.hasValue){var i=d.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var a=u(e);return void 0!==l&&l(i,a)?(r=e,i):(r=e,n=a)}var r,n,o=!1,i=void 0===c?null:c;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,c,u,l]);var p=r(e,f[0],f[1]);return o(function(){d.hasValue=!0,d.value=p},[p]),a(p),p},ts}():es.exports=(rs||(rs=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=Ya(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;os.useSyncExternalStoreWithSelector=function(e,s,c,u,l){var f=n(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i(function(){function e(e){if(!o){if(o=!0,r=e,e=u(e),void 0!==l&&d.hasValue){var i=d.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var a=u(e);return void 0!==l&&l(i,a)?(r=e,i):(r=e,n=a)}var r,n,o=!1,i=void 0===c?null:c;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,c,u,l]);var p=r(e,f[0],f[1]);return o(function(){d.hasValue=!0,d.value=p},[p]),a(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),os)),es.exports);function as(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function ss(e,t){if(as(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!as(e[r[n]],t[r[n]]))return!1;return!0}var cs=Symbol.for("react-redux-context"),us="undefined"!=typeof globalThis?globalThis:{};function ls(){if(!Za.createContext)return{};const e=us[cs]??=new Map;let t=e.get(Za.createContext);return t||(t=Za.createContext(null),"production"!==process.env.NODE_ENV&&(t.displayName="ReactRedux"),e.set(Za.createContext,t)),t}var fs=ls();function ds(e=fs){return function(){const t=Za.useContext(e);if("production"!==process.env.NODE_ENV&&!t)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return t}}var ps=ds();function ys(e=fs){const t=e===fs?ps:ds(e),r=()=>{const{store:e}=t();return e};return Object.assign(r,{withTypes:()=>r}),r}var hs=ys();function ms(e=fs){const t=e===fs?hs:ys(e),r=()=>t().dispatch;return Object.assign(r,{withTypes:()=>r}),r}var gs=ms(),bs=(e,t)=>e===t;function vs(e=fs){const t=e===fs?ps:ds(e),r=(e,r={})=>{const{equalityFn:n=bs}="function"==typeof r?{equalityFn:r}:r;if("production"!==process.env.NODE_ENV){if(!e)throw new Error("You must pass a selector to useSelector");if("function"!=typeof e)throw new Error("You must pass a function as a selector to useSelector");if("function"!=typeof n)throw new Error("You must pass a function as an equality function to useSelector")}const o=t(),{store:i,subscription:a,getServerState:s}=o,c=Za.useRef(!0),u=Za.useCallback({[e.name](t){const i=e(t);if("production"!==process.env.NODE_ENV){const{devModeChecks:a={}}="function"==typeof r?{}:r,{identityFunctionCheck:s,stabilityCheck:u}=o,{identityFunctionCheck:l,stabilityCheck:f}={stabilityCheck:u,identityFunctionCheck:s,...a};if("always"===f||"once"===f&&c.current){const r=e(t);if(!n(i,r)){let n;try{throw new Error}catch(e){({stack:n}=e)}console.warn("Selector "+(e.name||"unknown")+" returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization",{state:t,selected:i,selected2:r,stack:n})}}if(("always"===l||"once"===l&&c.current)&&i===t){let t;try{throw new Error}catch(e){({stack:t}=e)}console.warn("Selector "+(e.name||"unknown")+" returned the root state when called. This can lead to unnecessary rerenders.\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.",{stack:t})}c.current&&(c.current=!1)}return i}}[e.name],[e]),l=is.useSyncExternalStoreWithSelector(a.addNestedSub,i.getState,s||i.getState,u,n);return Za.useDebugValue(l),l};return Object.assign(r,{withTypes:()=>r}),r}var ws=vs(),Es=function(e){e()};function Ss(e){return e.replace(e[0],e[0].toUpperCase())}function Os(e){let t=0;for(const r in e)t++;return t}function _s(e){return"infinitequery"===e.type}function As(e,...t){return Object.assign(e,...t)}var Ts=Symbol();function Rs(e,t,r,n){const o=Za.useMemo(()=>({queryArgs:e,serialized:"object"==typeof e?t({queryArgs:e,endpointDefinition:r,endpointName:n}):e}),[e,t,r,n]),i=Za.useRef(o);return Za.useEffect(()=>{i.current.serialized!==o.serialized&&(i.current=o)},[o]),i.current.serialized===o.serialized?i.current.queryArgs:e}function Ps(e){const t=Za.useRef(e);return Za.useEffect(()=>{ss(t.current,e)||(t.current=e)},[e]),ss(t.current,e)?t.current:e}var js=(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),ks=(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),Cs=(()=>js||ks?Za.useLayoutEffect:Za.useEffect)(),Ns=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:$i.pending}:e;function Is(e,...t){const r={};return t.forEach(t=>{r[t]=e[t]}),r}var xs=["data","status","isLoading","isSuccess","isError","error"];var Ds=Symbol(),qs=ka(Qa(),(({batch:e=Es,hooks:t={useDispatch:gs,useSelector:ws,useStore:hs},createSelector:r=ye,unstable__sideEffectsInRender:n=!1,...o}={})=>{if("production"!==process.env.NODE_ENV){const e=["useDispatch","useSelector","useStore"];let r=!1;for(const n of e)if(Os(o)>0&&(o[n]&&(r||(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 } })`"),r=!0)),t[n]=o[n]),"function"!=typeof t[n])throw new Error("production"===process.env.NODE_ENV?ot(36):`When using custom hooks for context, all ${e.length} hooks need to be provided: ${e.join(", ")}.\nHook ${n} was either not provided or not a function.`)}return{name:Ds,init(o,{serializeQueryArgs:i},a){const s=o,{buildQueryHooks:c,buildInfiniteQueryHooks:u,buildMutationHook:l,usePrefetch:f}=function({api:e,moduleOptions:{batch:t,hooks:{useDispatch:r,useSelector:n,useStore:o},unstable__sideEffectsInRender:i,createSelector:a},serializeQueryArgs:s,context:c}){const u=i?e=>e():Za.useEffect;return{buildQueryHooks:function(n){const o=(e,t={})=>{const[r]=d(n,e,t);return y(r),Za.useMemo(()=>({refetch:()=>h(r)}),[r])},i=({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:a=0,skipPollingIfUnfocused:s=!1}={})=>{const{initiate:c}=e.endpoints[n],l=r(),[f,d]=Za.useState(Ts),p=Za.useRef(void 0),y=Ps({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:a,skipPollingIfUnfocused:s});u(()=>{const e=p.current?.subscriptionOptions;y!==e&&p.current?.updateSubscriptionOptions(y)},[y]);const h=Za.useRef(y);u(()=>{h.current=y},[y]);const m=Za.useCallback(function(e,r=!1){let n;return t(()=>{p.current?.unsubscribe(),p.current=n=l(c(e,{subscriptionOptions:h.current,forceRefetch:!r})),d(e)}),n},[l,c]),g=Za.useCallback(()=>{p.current?.queryCacheKey&&l(e.internalActions.removeQueryResult({queryCacheKey:p.current?.queryCacheKey}))},[l]);return Za.useEffect(()=>()=>{p?.current?.unsubscribe()},[]),Za.useEffect(()=>{f===Ts||p.current||m(f,!0)},[f,m]),Za.useMemo(()=>[m,f,{reset:g}],[m,f,g])},a=p(n,l);return{useQueryState:a,useQuerySubscription:o,useLazyQuerySubscription:i,useLazyQuery(e){const[t,r,{reset:n}]=i(e),o=a(r,{...e,skip:r===Ts}),s=Za.useMemo(()=>({lastArg:r}),[r]);return Za.useMemo(()=>[t,{...o,reset:n},s],[t,o,n,s])},useQuery(e,t){const r=o(e,t),n=a(e,{selectFromResult:e===_a||t?.skip?void 0:Ns,...t}),i=Is(n,...xs);return Za.useDebugValue(i),Za.useMemo(()=>({...n,...r}),[n,r])}}},buildInfiniteQueryHooks:function(e){const r=(r,n={})=>{const[o,i,a,s]=d(e,r,n),l=Za.useRef(s);u(()=>{l.current=s},[s]);const f=Za.useCallback(function(e,r){let n;return t(()=>{o.current?.unsubscribe(),o.current=n=i(a(e,{subscriptionOptions:l.current,direction:r}))}),n},[o,i,a]);y(o);const p=Rs(n.skip?_a:r,ja,c.endpointDefinitions[e],e),m=Za.useCallback(()=>h(o),[o]);return Za.useMemo(()=>({trigger:f,refetch:m,fetchNextPage:()=>f(p,"forward"),fetchPreviousPage:()=>f(p,"backward")}),[m,f,p])},n=p(e,f);return{useInfiniteQueryState:n,useInfiniteQuerySubscription:r,useInfiniteQuery(e,t){const{refetch:o,fetchNextPage:i,fetchPreviousPage:a}=r(e,t),s=n(e,{selectFromResult:e===_a||t?.skip?void 0:Ns,...t}),c=Is(s,...xs,"hasNextPage","hasPreviousPage");return Za.useDebugValue(c),Za.useMemo(()=>({...s,fetchNextPage:i,fetchPreviousPage:a,refetch:o}),[s,i,a,o])}}},buildMutationHook:function(o){return({selectFromResult:i,fixedCacheKey:s}={})=>{const{select:c,initiate:u}=e.endpoints[o],l=r(),[f,d]=Za.useState();Za.useEffect(()=>()=>{f?.arg.fixedCacheKey||f?.reset()},[f]);const p=Za.useCallback(function(e){const t=l(u(e,{fixedCacheKey:s}));return d(t),t},[l,u,s]),{requestId:y}=f||{},h=Za.useMemo(()=>c({fixedCacheKey:s,requestId:f?.requestId}),[s,f,c]),m=Za.useMemo(()=>i?a([h],i):h,[i,h]),g=n(m,ss),b=null==s?f?.arg.originalArgs:void 0,v=Za.useCallback(()=>{t(()=>{f&&d(void 0),s&&l(e.internalActions.removeMutationResult({requestId:y,fixedCacheKey:s}))})},[l,s,f,y]),w=Is(g,...xs,"endpointName");Za.useDebugValue(w);const E=Za.useMemo(()=>({...g,originalArgs:b,reset:v}),[g,b,v]);return Za.useMemo(()=>[p,E],[p,E])}},usePrefetch:function(t,n){const o=r(),i=Ps(n);return Za.useCallback((r,n)=>o(e.util.prefetch(t,r,{...i,...n})),[t,o,i])}};function l(e,t,r){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,n=c.endpointDefinitions[e];r!==_a&&s({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===s({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);const o=void 0!==n,i=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!o&&i,u=e.isSuccess||o&&(i&&!t?.isError||e.isUninitialized);return{...e,data:n,currentData:e.data,isFetching:i,isLoading:a,isSuccess:u}}function f(e,t,r){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,n=c.endpointDefinitions[e];r!==_a&&s({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===s({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);const o=void 0!==n,i=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!o&&i,u=e.isSuccess||i&&o;return{...e,data:n,currentData:e.data,isFetching:i,isLoading:a,isSuccess:u}}function d(t,n,{refetchOnReconnect:o,refetchOnFocus:i,refetchOnMountOrArgChange:a,skip:s=!1,pollingInterval:l=0,skipPollingIfUnfocused:f=!1,...d}={}){const{initiate:p}=e.endpoints[t],y=r(),h=Za.useRef(void 0);if(!h.current){const t=y(e.internalActions.internal_getRTKQSubscriptions());if("production"!==process.env.NODE_ENV&&("object"!=typeof t||"string"==typeof t?.type))throw new Error("production"===process.env.NODE_ENV?ot(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.\n You must add the middleware for RTK-Query to function correctly!`);h.current=t}const m=Rs(s?_a:n,ja,c.endpointDefinitions[t],t),g=Ps({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:l,skipPollingIfUnfocused:f}),b=Ps(d.initialPageParam),v=Za.useRef(void 0);let{queryCacheKey:w,requestId:E}=v.current||{},S=!1;w&&E&&(S=h.current.isRequestSubscribed(w,E));const O=!S&&void 0!==v.current;return u(()=>{O&&(v.current=void 0)},[O]),u(()=>{const e=v.current;if("undefined"!=typeof process&&"removeMeOnCompilation"===process.env.NODE_ENV&&console.log(O),m===_a)return e?.unsubscribe(),void(v.current=void 0);const r=v.current?.subscriptionOptions;if(e&&e.arg===m)g!==r&&e.updateSubscriptionOptions(g);else{e?.unsubscribe();const r=y(p(m,{subscriptionOptions:g,forceRefetch:a,..._s(c.endpointDefinitions[t])?{initialPageParam:b}:{}}));v.current=r}},[y,p,a,m,g,O,b,t]),[v,y,p,g]}function p(t,r){return(i,{skip:u=!1,selectFromResult:l}={})=>{const{select:f}=e.endpoints[t],d=Rs(u?_a:i,s,c.endpointDefinitions[t],t),p=Za.useRef(void 0),y=Za.useMemo(()=>a([f(d),(e,t)=>t,e=>d],r,{memoizeOptions:{resultEqualityCheck:ss}}),[f,d]),h=Za.useMemo(()=>l?a([y],l,{devModeChecks:{identityFunctionCheck:"never"}}):y,[y,l]),m=n(e=>h(e,p.current),ss),g=o(),b=y(g.getState(),p.current);return Cs(()=>{p.current=b},[b]),m}}function y(e){Za.useEffect(()=>()=>{e.current?.unsubscribe?.(),e.current=void 0},[e])}function h(e){if(!e.current)throw new Error("production"===process.env.NODE_ENV?ot(38):"Cannot refetch a query that has not been started yet.");return e.current.refetch()}}({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:n,createSelector:r},serializeQueryArgs:i,context:a});return As(s,{usePrefetch:f}),As(a,{batch:e}),{injectEndpoint(e,t){if("query"===t.type){const{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:a}=c(e);As(s.endpoints[e],{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:a}),o[`use${Ss(e)}Query`]=t,o[`useLazy${Ss(e)}Query`]=r}if(function(e){return"mutation"===e.type}(t)){const t=l(e);As(s.endpoints[e],{useMutation:t}),o[`use${Ss(e)}Mutation`]=t}else if(_s(t)){const{useInfiniteQuery:t,useInfiniteQuerySubscription:r,useInfiniteQueryState:n}=u(e);As(s.endpoints[e],{useInfiniteQuery:t,useInfiniteQuerySubscription:r,useInfiniteQueryState:n}),o[`use${Ss(e)}InfiniteQuery`]=t}}}}}})());const Fs={baseUrl:process.env.REACT_APP_API_BASE_URL||"http://localhost:4000/fear/api/",timeout:3e4,credentials:"include",prepareHeaders:(e,{getState:t})=>{e.set("Content-Type","application/json");const r=t()?.auth?.token;return r&&e.set("Authorization",`Bearer ${r}`),e}},Ms={GET:"GET",POST:"POST",PUT:"PUT",PATCH:"PATCH",DELETE:"DELETE"},Us={getAll:{method:Ms.GET,url:e=>`${e}/all`,providesTags:e=>[{type:e,id:"LIST"}]},getById:{method:Ms.GET,url:(e,t)=>`${e}/${t}`,providesTags:(e,t)=>[{type:e,id:t}]},create:{method:Ms.POST,url:e=>`${e}`,invalidatesTags:e=>[{type:e,id:"LIST"}]},update:{method:Ms.PUT,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},patch:{method:Ms.PATCH,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},delete:{method:Ms.DELETE,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},search:{method:Ms.GET,url:e=>`${e}/search`,providesTags:e=>[{type:e,id:"SEARCH"}]}},Ls=e=>e.status?{status:e.status,message:e.data?.message||`HTTP Error ${e.status}`,data:e.data}:{status:"FETCH_ERROR",message:e.message||"Network error occurred",error:e.error},$s=(e,t,r={})=>{const{method:n,url:o}=e;let i={method:n,url:"function"==typeof o?o(t,r.id,r):o};return n!==Ms.GET&&n!==Ms.DELETE&&(i.body=r.data||r),n===Ms.GET&&r.params&&(i.params=r.params),i},Qs=(e,t={})=>{(e=>{if(!e||"string"!=typeof e)throw new Error("SliceName must be a non-empty string")})(e);const r={tagTypes:["Product","Order","User","Category"],baseQuery:{},includeStandardEndpoints:!0,...t},n=(o=e).charAt(0).toUpperCase()+o.slice(1);var o;r.tagTypes.includes(n)||r.tagTypes.push(n);const i={...Fs,...r.baseQuery},a=qs({reducerPath:`${e}Api`,tagTypes:r.tagTypes,baseQuery:Zi(i),endpoints:()=>({})}),s=(t,r)=>{const{method:n=Ms.GET,url:o,type:i=(n===Ms.GET?"query":"mutation"),providesTags:s,invalidatesTags:c,transformResponse:u,transformErrorResponse:l=Ls}=r;return a.injectEndpoints({endpoints:r=>({[t]:r[i]({query:(t={})=>$s({method:n,url:o},e,t),providesTags:s?(t,r,n)=>s(e,n?.id,t,r,n):void 0,invalidatesTags:c?(t,r,n)=>c(e,n?.id,t,r,n):void 0,transformResponse:u,transformErrorResponse:l})})})},c=t=>a.injectEndpoints({endpoints:r=>{const n={};return Object.entries(t).forEach(([t,o])=>{const{method:i=Ms.GET,url:a,type:s=(i===Ms.GET?"query":"mutation"),providesTags:c,invalidatesTags:u,transformResponse:l,transformErrorResponse:f=Ls}=o;n[t]=r[s]({query:(t={})=>$s({method:i,url:a},e,t),providesTags:c?(t,r,n)=>c(e,n?.id,t,r,n):void 0,invalidatesTags:u?(t,r,n)=>u(e,n?.id,t,r,n):void 0,transformResponse:l,transformErrorResponse:f})}),n}}),u=()=>{const e={};return Object.entries(Us).forEach(([t,r])=>{e[t]={method:r.method,url:r.url,providesTags:r.providesTags,invalidatesTags:r.invalidatesTags}}),c(e)};return{sliceName:e,entityTagType:n,baseApi:a,inject:s,injectMany:c,create:()=>{let e=a;return r.includeStandardEndpoints&&(e=u()),e},createStandard:u,createBulk:()=>{const t={bulkCreate:{method:Ms.POST,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]},bulkUpdate:{method:Ms.PUT,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]},bulkDelete:{method:Ms.DELETE,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]}};return c(t)},createCustom:(e,t)=>s(e,t),getTagTypes:()=>[...r.tagTypes],getBaseUrl:()=>i.baseUrl,getReducerPath:()=>a.reducerPath,withAuth:t=>Qs(e,{...r,baseQuery:{...i,prepareHeaders:(e,r)=>(e.set("Authorization",`Bearer ${t}`),Fs.prepareHeaders(e,r))}}),withBaseUrl:t=>Qs(e,{...r,baseQuery:{...i,baseUrl:t}})}};Qs.createComplete=(e,t={})=>Qs(e,t).create(),Qs.createCustom=(e,t,r={})=>Qs(e,{...r,includeStandardEndpoints:!1}).injectMany(t),Qs.getStandardEndpoints=()=>({...Us}),Qs.getHttpMethods=()=>({...Ms});export{Qs as ApiFactory,hi as CacheFactory,Ui as FeatureFactory,Mi as StateFactory,Ii as ThunkFactory};
19
+ */var is=(ns||(ns=1,"production"===process.env.NODE_ENV?es.exports=function(){if(Xa)return ts;Xa=1;var e=Ya(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;return ts.useSyncExternalStoreWithSelector=function(e,s,c,u,l){var f=n(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i(function(){function e(e){if(!o){if(o=!0,r=e,e=u(e),void 0!==l&&d.hasValue){var i=d.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var a=u(e);return void 0!==l&&l(i,a)?(r=e,i):(r=e,n=a)}var r,n,o=!1,i=void 0===c?null:c;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,c,u,l]);var p=r(e,f[0],f[1]);return o(function(){d.hasValue=!0,d.value=p},[p]),a(p),p},ts}():es.exports=(rs||(rs=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=Ya(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;os.useSyncExternalStoreWithSelector=function(e,s,c,u,l){var f=n(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i(function(){function e(e){if(!o){if(o=!0,r=e,e=u(e),void 0!==l&&d.hasValue){var i=d.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var a=u(e);return void 0!==l&&l(i,a)?(r=e,i):(r=e,n=a)}var r,n,o=!1,i=void 0===c?null:c;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,c,u,l]);var p=r(e,f[0],f[1]);return o(function(){d.hasValue=!0,d.value=p},[p]),a(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),os)),es.exports);function as(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function ss(e,t){if(as(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!as(e[r[n]],t[r[n]]))return!1;return!0}var cs=Symbol.for("react-redux-context"),us="undefined"!=typeof globalThis?globalThis:{};function ls(){if(!Za.createContext)return{};const e=us[cs]??=new Map;let t=e.get(Za.createContext);return t||(t=Za.createContext(null),"production"!==process.env.NODE_ENV&&(t.displayName="ReactRedux"),e.set(Za.createContext,t)),t}var fs=ls();function ds(e=fs){return function(){const t=Za.useContext(e);if("production"!==process.env.NODE_ENV&&!t)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return t}}var ps=ds();function ys(e=fs){const t=e===fs?ps:ds(e),r=()=>{const{store:e}=t();return e};return Object.assign(r,{withTypes:()=>r}),r}var hs=ys();function ms(e=fs){const t=e===fs?hs:ys(e),r=()=>t().dispatch;return Object.assign(r,{withTypes:()=>r}),r}var gs=ms(),bs=(e,t)=>e===t;function vs(e=fs){const t=e===fs?ps:ds(e),r=(e,r={})=>{const{equalityFn:n=bs}="function"==typeof r?{equalityFn:r}:r;if("production"!==process.env.NODE_ENV){if(!e)throw new Error("You must pass a selector to useSelector");if("function"!=typeof e)throw new Error("You must pass a function as a selector to useSelector");if("function"!=typeof n)throw new Error("You must pass a function as an equality function to useSelector")}const o=t(),{store:i,subscription:a,getServerState:s}=o,c=Za.useRef(!0),u=Za.useCallback({[e.name](t){const i=e(t);if("production"!==process.env.NODE_ENV){const{devModeChecks:a={}}="function"==typeof r?{}:r,{identityFunctionCheck:s,stabilityCheck:u}=o,{identityFunctionCheck:l,stabilityCheck:f}={stabilityCheck:u,identityFunctionCheck:s,...a};if("always"===f||"once"===f&&c.current){const r=e(t);if(!n(i,r)){let n;try{throw new Error}catch(e){({stack:n}=e)}console.warn("Selector "+(e.name||"unknown")+" returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization",{state:t,selected:i,selected2:r,stack:n})}}if(("always"===l||"once"===l&&c.current)&&i===t){let t;try{throw new Error}catch(e){({stack:t}=e)}console.warn("Selector "+(e.name||"unknown")+" returned the root state when called. This can lead to unnecessary rerenders.\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.",{stack:t})}c.current&&(c.current=!1)}return i}}[e.name],[e]),l=is.useSyncExternalStoreWithSelector(a.addNestedSub,i.getState,s||i.getState,u,n);return Za.useDebugValue(l),l};return Object.assign(r,{withTypes:()=>r}),r}var ws=vs(),Es=function(e){e()};function Ss(e){return e.replace(e[0],e[0].toUpperCase())}function Os(e){let t=0;for(const r in e)t++;return t}function _s(e){return"infinitequery"===e.type}function As(e,...t){return Object.assign(e,...t)}var Ts=Symbol();function Rs(e,t,r,n){const o=Za.useMemo(()=>({queryArgs:e,serialized:"object"==typeof e?t({queryArgs:e,endpointDefinition:r,endpointName:n}):e}),[e,t,r,n]),i=Za.useRef(o);return Za.useEffect(()=>{i.current.serialized!==o.serialized&&(i.current=o)},[o]),i.current.serialized===o.serialized?i.current.queryArgs:e}function Ps(e){const t=Za.useRef(e);return Za.useEffect(()=>{ss(t.current,e)||(t.current=e)},[e]),ss(t.current,e)?t.current:e}var js=(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),ks=(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),Cs=(()=>js||ks?Za.useLayoutEffect:Za.useEffect)(),Ns=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:$i.pending}:e;function Is(e,...t){const r={};return t.forEach(t=>{r[t]=e[t]}),r}var xs=["data","status","isLoading","isSuccess","isError","error"];var Ds=Symbol(),qs=ka(Qa(),(({batch:e=Es,hooks:t={useDispatch:gs,useSelector:ws,useStore:hs},createSelector:r=ye,unstable__sideEffectsInRender:n=!1,...o}={})=>{if("production"!==process.env.NODE_ENV){const e=["useDispatch","useSelector","useStore"];let r=!1;for(const n of e)if(Os(o)>0&&(o[n]&&(r||(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 } })`"),r=!0)),t[n]=o[n]),"function"!=typeof t[n])throw new Error("production"===process.env.NODE_ENV?ot(36):`When using custom hooks for context, all ${e.length} hooks need to be provided: ${e.join(", ")}.\nHook ${n} was either not provided or not a function.`)}return{name:Ds,init(o,{serializeQueryArgs:i},a){const s=o,{buildQueryHooks:c,buildInfiniteQueryHooks:u,buildMutationHook:l,usePrefetch:f}=function({api:e,moduleOptions:{batch:t,hooks:{useDispatch:r,useSelector:n,useStore:o},unstable__sideEffectsInRender:i,createSelector:a},serializeQueryArgs:s,context:c}){const u=i?e=>e():Za.useEffect;return{buildQueryHooks:function(n){const o=(e,t={})=>{const[r]=d(n,e,t);return y(r),Za.useMemo(()=>({refetch:()=>h(r)}),[r])},i=({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:a=0,skipPollingIfUnfocused:s=!1}={})=>{const{initiate:c}=e.endpoints[n],l=r(),[f,d]=Za.useState(Ts),p=Za.useRef(void 0),y=Ps({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:a,skipPollingIfUnfocused:s});u(()=>{const e=p.current?.subscriptionOptions;y!==e&&p.current?.updateSubscriptionOptions(y)},[y]);const h=Za.useRef(y);u(()=>{h.current=y},[y]);const m=Za.useCallback(function(e,r=!1){let n;return t(()=>{p.current?.unsubscribe(),p.current=n=l(c(e,{subscriptionOptions:h.current,forceRefetch:!r})),d(e)}),n},[l,c]),g=Za.useCallback(()=>{p.current?.queryCacheKey&&l(e.internalActions.removeQueryResult({queryCacheKey:p.current?.queryCacheKey}))},[l]);return Za.useEffect(()=>()=>{p?.current?.unsubscribe()},[]),Za.useEffect(()=>{f===Ts||p.current||m(f,!0)},[f,m]),Za.useMemo(()=>[m,f,{reset:g}],[m,f,g])},a=p(n,l);return{useQueryState:a,useQuerySubscription:o,useLazyQuerySubscription:i,useLazyQuery(e){const[t,r,{reset:n}]=i(e),o=a(r,{...e,skip:r===Ts}),s=Za.useMemo(()=>({lastArg:r}),[r]);return Za.useMemo(()=>[t,{...o,reset:n},s],[t,o,n,s])},useQuery(e,t){const r=o(e,t),n=a(e,{selectFromResult:e===_a||t?.skip?void 0:Ns,...t}),i=Is(n,...xs);return Za.useDebugValue(i),Za.useMemo(()=>({...n,...r}),[n,r])}}},buildInfiniteQueryHooks:function(e){const r=(r,n={})=>{const[o,i,a,s]=d(e,r,n),l=Za.useRef(s);u(()=>{l.current=s},[s]);const f=Za.useCallback(function(e,r){let n;return t(()=>{o.current?.unsubscribe(),o.current=n=i(a(e,{subscriptionOptions:l.current,direction:r}))}),n},[o,i,a]);y(o);const p=Rs(n.skip?_a:r,ja,c.endpointDefinitions[e],e),m=Za.useCallback(()=>h(o),[o]);return Za.useMemo(()=>({trigger:f,refetch:m,fetchNextPage:()=>f(p,"forward"),fetchPreviousPage:()=>f(p,"backward")}),[m,f,p])},n=p(e,f);return{useInfiniteQueryState:n,useInfiniteQuerySubscription:r,useInfiniteQuery(e,t){const{refetch:o,fetchNextPage:i,fetchPreviousPage:a}=r(e,t),s=n(e,{selectFromResult:e===_a||t?.skip?void 0:Ns,...t}),c=Is(s,...xs,"hasNextPage","hasPreviousPage");return Za.useDebugValue(c),Za.useMemo(()=>({...s,fetchNextPage:i,fetchPreviousPage:a,refetch:o}),[s,i,a,o])}}},buildMutationHook:function(o){return({selectFromResult:i,fixedCacheKey:s}={})=>{const{select:c,initiate:u}=e.endpoints[o],l=r(),[f,d]=Za.useState();Za.useEffect(()=>()=>{f?.arg.fixedCacheKey||f?.reset()},[f]);const p=Za.useCallback(function(e){const t=l(u(e,{fixedCacheKey:s}));return d(t),t},[l,u,s]),{requestId:y}=f||{},h=Za.useMemo(()=>c({fixedCacheKey:s,requestId:f?.requestId}),[s,f,c]),m=Za.useMemo(()=>i?a([h],i):h,[i,h]),g=n(m,ss),b=null==s?f?.arg.originalArgs:void 0,v=Za.useCallback(()=>{t(()=>{f&&d(void 0),s&&l(e.internalActions.removeMutationResult({requestId:y,fixedCacheKey:s}))})},[l,s,f,y]),w=Is(g,...xs,"endpointName");Za.useDebugValue(w);const E=Za.useMemo(()=>({...g,originalArgs:b,reset:v}),[g,b,v]);return Za.useMemo(()=>[p,E],[p,E])}},usePrefetch:function(t,n){const o=r(),i=Ps(n);return Za.useCallback((r,n)=>o(e.util.prefetch(t,r,{...i,...n})),[t,o,i])}};function l(e,t,r){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,n=c.endpointDefinitions[e];r!==_a&&s({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===s({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);const o=void 0!==n,i=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!o&&i,u=e.isSuccess||o&&(i&&!t?.isError||e.isUninitialized);return{...e,data:n,currentData:e.data,isFetching:i,isLoading:a,isSuccess:u}}function f(e,t,r){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,n=c.endpointDefinitions[e];r!==_a&&s({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===s({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);const o=void 0!==n,i=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!o&&i,u=e.isSuccess||i&&o;return{...e,data:n,currentData:e.data,isFetching:i,isLoading:a,isSuccess:u}}function d(t,n,{refetchOnReconnect:o,refetchOnFocus:i,refetchOnMountOrArgChange:a,skip:s=!1,pollingInterval:l=0,skipPollingIfUnfocused:f=!1,...d}={}){const{initiate:p}=e.endpoints[t],y=r(),h=Za.useRef(void 0);if(!h.current){const t=y(e.internalActions.internal_getRTKQSubscriptions());if("production"!==process.env.NODE_ENV&&("object"!=typeof t||"string"==typeof t?.type))throw new Error("production"===process.env.NODE_ENV?ot(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.\n You must add the middleware for RTK-Query to function correctly!`);h.current=t}const m=Rs(s?_a:n,ja,c.endpointDefinitions[t],t),g=Ps({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:l,skipPollingIfUnfocused:f}),b=Ps(d.initialPageParam),v=Za.useRef(void 0);let{queryCacheKey:w,requestId:E}=v.current||{},S=!1;w&&E&&(S=h.current.isRequestSubscribed(w,E));const O=!S&&void 0!==v.current;return u(()=>{O&&(v.current=void 0)},[O]),u(()=>{const e=v.current;if("undefined"!=typeof process&&"removeMeOnCompilation"===process.env.NODE_ENV&&console.log(O),m===_a)return e?.unsubscribe(),void(v.current=void 0);const r=v.current?.subscriptionOptions;if(e&&e.arg===m)g!==r&&e.updateSubscriptionOptions(g);else{e?.unsubscribe();const r=y(p(m,{subscriptionOptions:g,forceRefetch:a,..._s(c.endpointDefinitions[t])?{initialPageParam:b}:{}}));v.current=r}},[y,p,a,m,g,O,b,t]),[v,y,p,g]}function p(t,r){return(i,{skip:u=!1,selectFromResult:l}={})=>{const{select:f}=e.endpoints[t],d=Rs(u?_a:i,s,c.endpointDefinitions[t],t),p=Za.useRef(void 0),y=Za.useMemo(()=>a([f(d),(e,t)=>t,e=>d],r,{memoizeOptions:{resultEqualityCheck:ss}}),[f,d]),h=Za.useMemo(()=>l?a([y],l,{devModeChecks:{identityFunctionCheck:"never"}}):y,[y,l]),m=n(e=>h(e,p.current),ss),g=o(),b=y(g.getState(),p.current);return Cs(()=>{p.current=b},[b]),m}}function y(e){Za.useEffect(()=>()=>{e.current?.unsubscribe?.(),e.current=void 0},[e])}function h(e){if(!e.current)throw new Error("production"===process.env.NODE_ENV?ot(38):"Cannot refetch a query that has not been started yet.");return e.current.refetch()}}({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:n,createSelector:r},serializeQueryArgs:i,context:a});return As(s,{usePrefetch:f}),As(a,{batch:e}),{injectEndpoint(e,t){if("query"===t.type){const{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:a}=c(e);As(s.endpoints[e],{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:a}),o[`use${Ss(e)}Query`]=t,o[`useLazy${Ss(e)}Query`]=r}if(function(e){return"mutation"===e.type}(t)){const t=l(e);As(s.endpoints[e],{useMutation:t}),o[`use${Ss(e)}Mutation`]=t}else if(_s(t)){const{useInfiniteQuery:t,useInfiniteQuerySubscription:r,useInfiniteQueryState:n}=u(e);As(s.endpoints[e],{useInfiniteQuery:t,useInfiniteQuerySubscription:r,useInfiniteQueryState:n}),o[`use${Ss(e)}InfiniteQuery`]=t}}}}}})());const Fs={baseUrl:process.env.REACT_APP_API_BASE_URL||"http://localhost:4000/fear/api/",timeout:3e4,credentials:"include",prepareHeaders:(e,{getState:t})=>{e.set("Content-Type","application/json");const r=t()?.auth?.token;return r&&e.set("Authorization",`Bearer ${r}`),e}},Ms={GET:"GET",POST:"POST",PUT:"PUT",PATCH:"PATCH",DELETE:"DELETE"},Us={getAll:{method:Ms.GET,url:e=>`${e}/all`,providesTags:e=>[{type:e,id:"LIST"}]},getById:{method:Ms.GET,url:(e,t)=>`${e}/${t}`,providesTags:(e,t)=>[{type:e,id:t}]},create:{method:Ms.POST,url:e=>`${e}`,invalidatesTags:e=>[{type:e,id:"LIST"}]},update:{method:Ms.PUT,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},patch:{method:Ms.PATCH,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},delete:{method:Ms.DELETE,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},search:{method:Ms.GET,url:e=>`${e}/search`,providesTags:e=>[{type:e,id:"SEARCH"}]}},Ls=e=>e.status?{status:e.status,message:e.data?.message||`HTTP Error ${e.status}`,data:e.data}:{status:"FETCH_ERROR",message:e.message||"Network error occurred",error:e.error},$s=(e,t,r={})=>{const{method:n,url:o}=e;let i={method:n,url:"function"==typeof o?o(t,r.id,r):o};return n!==Ms.GET&&n!==Ms.DELETE&&(i.body=r.data||r),n===Ms.GET&&r.params&&(i.params=r.params),i},Qs=(e,t={})=>{(e=>{if(!e||"string"!=typeof e)throw new Error("SliceName must be a non-empty string")})(e);const r={tagTypes:["Product","Order","User","Category"],baseQuery:{},includeStandardEndpoints:!0,...t},n=(o=e).charAt(0).toUpperCase()+o.slice(1);var o;r.tagTypes.includes(n)||r.tagTypes.push(n);const i={...Fs,...r.baseQuery},a=qs({reducerPath:`${e}Api`,tagTypes:r.tagTypes,baseQuery:Zi(i),endpoints:()=>({})}),s=(t,r)=>{const{method:n=Ms.GET,url:o,type:i=(n===Ms.GET?"query":"mutation"),providesTags:s,invalidatesTags:c,transformResponse:u,transformErrorResponse:l=Ls}=r;return a.injectEndpoints({endpoints:r=>({[t]:r[i]({query:(t={})=>$s({method:n,url:o},e,t),providesTags:s?(t,r,n)=>s(e,n?.id,t,r,n):void 0,invalidatesTags:c?(t,r,n)=>c(e,n?.id,t,r,n):void 0,transformResponse:u,transformErrorResponse:l})})})},c=t=>a.injectEndpoints({endpoints:r=>{const n={};return Object.entries(t).forEach(([t,o])=>{const{method:i=Ms.GET,url:a,type:s=(i===Ms.GET?"query":"mutation"),providesTags:c,invalidatesTags:u,transformResponse:l,transformErrorResponse:f=Ls}=o;n[t]=r[s]({query:(t={})=>$s({method:i,url:a},e,t),providesTags:c?(t,r,n)=>c(e,n?.id,t,r,n):void 0,invalidatesTags:u?(t,r,n)=>u(e,n?.id,t,r,n):void 0,transformResponse:l,transformErrorResponse:f})}),n}}),u=()=>{const e={};return Object.entries(Us).forEach(([t,r])=>{e[t]={method:r.method,url:r.url,providesTags:r.providesTags,invalidatesTags:r.invalidatesTags}}),c(e)};return{sliceName:e,entityTagType:n,baseApi:a,inject:s,injectMany:c,create:()=>{let e=a;return r.includeStandardEndpoints&&(e=u()),e},createStandard:u,createBulk:()=>{const t={bulkCreate:{method:Ms.POST,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]},bulkUpdate:{method:Ms.PUT,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]},bulkDelete:{method:Ms.DELETE,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]}};return c(t)},createCustom:(e,t)=>s(e,t),getTagTypes:()=>[...r.tagTypes],getBaseUrl:()=>i.baseUrl,getReducerPath:()=>a.reducerPath,withAuth:t=>Qs(e,{...r,baseQuery:{...i,prepareHeaders:(e,r)=>(e.set("Authorization",`Bearer ${t}`),Fs.prepareHeaders(e,r))}}),withBaseUrl:t=>Qs(e,{...r,baseQuery:{...i,baseUrl:t}})}};Qs.createComplete=(e,t={})=>Qs(e,t).create(),Qs.createCustom=(e,t,r={})=>Qs(e,{...r,includeStandardEndpoints:!1}).injectMany(t),Qs.getStandardEndpoints=()=>({...Us}),Qs.getHttpMethods=()=>({...Ms});export{Pi as API,Qs as ApiFactory,hi as CacheFactory,Ui as FeatureFactory,Mi as StateFactory,Ii as ThunkFactory};
20
20
  //# sourceMappingURL=index.esm.js.map
package/dist/index.js CHANGED
@@ -16,5 +16,5 @@
16
16
  *
17
17
  * This source code is licensed under the MIT license found in the
18
18
  * LICENSE file in the root directory of this source tree.
19
- */var os=(rs||(rs=1,"production"===process.env.NODE_ENV?Za.exports=function(){if(Ya)return es;Ya=1;var e=Ja(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;return es.useSyncExternalStoreWithSelector=function(e,s,c,u,l){var f=n(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i(function(){function e(e){if(!o){if(o=!0,r=e,e=u(e),void 0!==l&&d.hasValue){var i=d.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var a=u(e);return void 0!==l&&l(i,a)?(r=e,i):(r=e,n=a)}var r,n,o=!1,i=void 0===c?null:c;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,c,u,l]);var p=r(e,f[0],f[1]);return o(function(){d.hasValue=!0,d.value=p},[p]),a(p),p},es}():Za.exports=(ts||(ts=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=Ja(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;ns.useSyncExternalStoreWithSelector=function(e,s,c,u,l){var f=n(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i(function(){function e(e){if(!o){if(o=!0,r=e,e=u(e),void 0!==l&&d.hasValue){var i=d.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var a=u(e);return void 0!==l&&l(i,a)?(r=e,i):(r=e,n=a)}var r,n,o=!1,i=void 0===c?null:c;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,c,u,l]);var p=r(e,f[0],f[1]);return o(function(){d.hasValue=!0,d.value=p},[p]),a(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ns)),Za.exports);function is(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function as(e,t){if(is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!is(e[r[n]],t[r[n]]))return!1;return!0}var ss=Symbol.for("react-redux-context"),cs="undefined"!=typeof globalThis?globalThis:{};function us(){if(!Xa.createContext)return{};const e=cs[ss]??=new Map;let t=e.get(Xa.createContext);return t||(t=Xa.createContext(null),"production"!==process.env.NODE_ENV&&(t.displayName="ReactRedux"),e.set(Xa.createContext,t)),t}var ls=us();function fs(e=ls){return function(){const t=Xa.useContext(e);if("production"!==process.env.NODE_ENV&&!t)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return t}}var ds=fs();function ps(e=ls){const t=e===ls?ds:fs(e),r=()=>{const{store:e}=t();return e};return Object.assign(r,{withTypes:()=>r}),r}var ys=ps();function hs(e=ls){const t=e===ls?ys:ps(e),r=()=>t().dispatch;return Object.assign(r,{withTypes:()=>r}),r}var ms=hs(),gs=(e,t)=>e===t;function bs(e=ls){const t=e===ls?ds:fs(e),r=(e,r={})=>{const{equalityFn:n=gs}="function"==typeof r?{equalityFn:r}:r;if("production"!==process.env.NODE_ENV){if(!e)throw new Error("You must pass a selector to useSelector");if("function"!=typeof e)throw new Error("You must pass a function as a selector to useSelector");if("function"!=typeof n)throw new Error("You must pass a function as an equality function to useSelector")}const o=t(),{store:i,subscription:a,getServerState:s}=o,c=Xa.useRef(!0),u=Xa.useCallback({[e.name](t){const i=e(t);if("production"!==process.env.NODE_ENV){const{devModeChecks:a={}}="function"==typeof r?{}:r,{identityFunctionCheck:s,stabilityCheck:u}=o,{identityFunctionCheck:l,stabilityCheck:f}={stabilityCheck:u,identityFunctionCheck:s,...a};if("always"===f||"once"===f&&c.current){const r=e(t);if(!n(i,r)){let n;try{throw new Error}catch(e){({stack:n}=e)}console.warn("Selector "+(e.name||"unknown")+" returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization",{state:t,selected:i,selected2:r,stack:n})}}if(("always"===l||"once"===l&&c.current)&&i===t){let t;try{throw new Error}catch(e){({stack:t}=e)}console.warn("Selector "+(e.name||"unknown")+" returned the root state when called. This can lead to unnecessary rerenders.\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.",{stack:t})}c.current&&(c.current=!1)}return i}}[e.name],[e]),l=os.useSyncExternalStoreWithSelector(a.addNestedSub,i.getState,s||i.getState,u,n);return Xa.useDebugValue(l),l};return Object.assign(r,{withTypes:()=>r}),r}var vs=bs(),ws=function(e){e()};function Es(e){return e.replace(e[0],e[0].toUpperCase())}function Ss(e){let t=0;for(const r in e)t++;return t}function Os(e){return"infinitequery"===e.type}function _s(e,...t){return Object.assign(e,...t)}var As=Symbol();function Ts(e,t,r,n){const o=Xa.useMemo(()=>({queryArgs:e,serialized:"object"==typeof e?t({queryArgs:e,endpointDefinition:r,endpointName:n}):e}),[e,t,r,n]),i=Xa.useRef(o);return Xa.useEffect(()=>{i.current.serialized!==o.serialized&&(i.current=o)},[o]),i.current.serialized===o.serialized?i.current.queryArgs:e}function Rs(e){const t=Xa.useRef(e);return Xa.useEffect(()=>{as(t.current,e)||(t.current=e)},[e]),as(t.current,e)?t.current:e}var Ps=(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),js=(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),ks=(()=>Ps||js?Xa.useLayoutEffect:Xa.useEffect)(),Cs=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:Li.pending}:e;function Ns(e,...t){const r={};return t.forEach(t=>{r[t]=e[t]}),r}var Is=["data","status","isLoading","isSuccess","isError","error"];var xs=Symbol(),Ds=ja($a(),(({batch:e=ws,hooks:t={useDispatch:ms,useSelector:vs,useStore:ys},createSelector:r=ye,unstable__sideEffectsInRender:n=!1,...o}={})=>{if("production"!==process.env.NODE_ENV){const e=["useDispatch","useSelector","useStore"];let r=!1;for(const n of e)if(Ss(o)>0&&(o[n]&&(r||(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 } })`"),r=!0)),t[n]=o[n]),"function"!=typeof t[n])throw new Error("production"===process.env.NODE_ENV?ot(36):`When using custom hooks for context, all ${e.length} hooks need to be provided: ${e.join(", ")}.\nHook ${n} was either not provided or not a function.`)}return{name:xs,init(o,{serializeQueryArgs:i},a){const s=o,{buildQueryHooks:c,buildInfiniteQueryHooks:u,buildMutationHook:l,usePrefetch:f}=function({api:e,moduleOptions:{batch:t,hooks:{useDispatch:r,useSelector:n,useStore:o},unstable__sideEffectsInRender:i,createSelector:a},serializeQueryArgs:s,context:c}){const u=i?e=>e():Xa.useEffect;return{buildQueryHooks:function(n){const o=(e,t={})=>{const[r]=d(n,e,t);return y(r),Xa.useMemo(()=>({refetch:()=>h(r)}),[r])},i=({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:a=0,skipPollingIfUnfocused:s=!1}={})=>{const{initiate:c}=e.endpoints[n],l=r(),[f,d]=Xa.useState(As),p=Xa.useRef(void 0),y=Rs({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:a,skipPollingIfUnfocused:s});u(()=>{const e=p.current?.subscriptionOptions;y!==e&&p.current?.updateSubscriptionOptions(y)},[y]);const h=Xa.useRef(y);u(()=>{h.current=y},[y]);const m=Xa.useCallback(function(e,r=!1){let n;return t(()=>{p.current?.unsubscribe(),p.current=n=l(c(e,{subscriptionOptions:h.current,forceRefetch:!r})),d(e)}),n},[l,c]),g=Xa.useCallback(()=>{p.current?.queryCacheKey&&l(e.internalActions.removeQueryResult({queryCacheKey:p.current?.queryCacheKey}))},[l]);return Xa.useEffect(()=>()=>{p?.current?.unsubscribe()},[]),Xa.useEffect(()=>{f===As||p.current||m(f,!0)},[f,m]),Xa.useMemo(()=>[m,f,{reset:g}],[m,f,g])},a=p(n,l);return{useQueryState:a,useQuerySubscription:o,useLazyQuerySubscription:i,useLazyQuery(e){const[t,r,{reset:n}]=i(e),o=a(r,{...e,skip:r===As}),s=Xa.useMemo(()=>({lastArg:r}),[r]);return Xa.useMemo(()=>[t,{...o,reset:n},s],[t,o,n,s])},useQuery(e,t){const r=o(e,t),n=a(e,{selectFromResult:e===Oa||t?.skip?void 0:Cs,...t}),i=Ns(n,...Is);return Xa.useDebugValue(i),Xa.useMemo(()=>({...n,...r}),[n,r])}}},buildInfiniteQueryHooks:function(e){const r=(r,n={})=>{const[o,i,a,s]=d(e,r,n),l=Xa.useRef(s);u(()=>{l.current=s},[s]);const f=Xa.useCallback(function(e,r){let n;return t(()=>{o.current?.unsubscribe(),o.current=n=i(a(e,{subscriptionOptions:l.current,direction:r}))}),n},[o,i,a]);y(o);const p=Ts(n.skip?Oa:r,Pa,c.endpointDefinitions[e],e),m=Xa.useCallback(()=>h(o),[o]);return Xa.useMemo(()=>({trigger:f,refetch:m,fetchNextPage:()=>f(p,"forward"),fetchPreviousPage:()=>f(p,"backward")}),[m,f,p])},n=p(e,f);return{useInfiniteQueryState:n,useInfiniteQuerySubscription:r,useInfiniteQuery(e,t){const{refetch:o,fetchNextPage:i,fetchPreviousPage:a}=r(e,t),s=n(e,{selectFromResult:e===Oa||t?.skip?void 0:Cs,...t}),c=Ns(s,...Is,"hasNextPage","hasPreviousPage");return Xa.useDebugValue(c),Xa.useMemo(()=>({...s,fetchNextPage:i,fetchPreviousPage:a,refetch:o}),[s,i,a,o])}}},buildMutationHook:function(o){return({selectFromResult:i,fixedCacheKey:s}={})=>{const{select:c,initiate:u}=e.endpoints[o],l=r(),[f,d]=Xa.useState();Xa.useEffect(()=>()=>{f?.arg.fixedCacheKey||f?.reset()},[f]);const p=Xa.useCallback(function(e){const t=l(u(e,{fixedCacheKey:s}));return d(t),t},[l,u,s]),{requestId:y}=f||{},h=Xa.useMemo(()=>c({fixedCacheKey:s,requestId:f?.requestId}),[s,f,c]),m=Xa.useMemo(()=>i?a([h],i):h,[i,h]),g=n(m,as),b=null==s?f?.arg.originalArgs:void 0,v=Xa.useCallback(()=>{t(()=>{f&&d(void 0),s&&l(e.internalActions.removeMutationResult({requestId:y,fixedCacheKey:s}))})},[l,s,f,y]),w=Ns(g,...Is,"endpointName");Xa.useDebugValue(w);const E=Xa.useMemo(()=>({...g,originalArgs:b,reset:v}),[g,b,v]);return Xa.useMemo(()=>[p,E],[p,E])}},usePrefetch:function(t,n){const o=r(),i=Rs(n);return Xa.useCallback((r,n)=>o(e.util.prefetch(t,r,{...i,...n})),[t,o,i])}};function l(e,t,r){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,n=c.endpointDefinitions[e];r!==Oa&&s({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===s({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);const o=void 0!==n,i=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!o&&i,u=e.isSuccess||o&&(i&&!t?.isError||e.isUninitialized);return{...e,data:n,currentData:e.data,isFetching:i,isLoading:a,isSuccess:u}}function f(e,t,r){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,n=c.endpointDefinitions[e];r!==Oa&&s({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===s({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);const o=void 0!==n,i=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!o&&i,u=e.isSuccess||i&&o;return{...e,data:n,currentData:e.data,isFetching:i,isLoading:a,isSuccess:u}}function d(t,n,{refetchOnReconnect:o,refetchOnFocus:i,refetchOnMountOrArgChange:a,skip:s=!1,pollingInterval:l=0,skipPollingIfUnfocused:f=!1,...d}={}){const{initiate:p}=e.endpoints[t],y=r(),h=Xa.useRef(void 0);if(!h.current){const t=y(e.internalActions.internal_getRTKQSubscriptions());if("production"!==process.env.NODE_ENV&&("object"!=typeof t||"string"==typeof t?.type))throw new Error("production"===process.env.NODE_ENV?ot(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.\n You must add the middleware for RTK-Query to function correctly!`);h.current=t}const m=Ts(s?Oa:n,Pa,c.endpointDefinitions[t],t),g=Rs({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:l,skipPollingIfUnfocused:f}),b=Rs(d.initialPageParam),v=Xa.useRef(void 0);let{queryCacheKey:w,requestId:E}=v.current||{},S=!1;w&&E&&(S=h.current.isRequestSubscribed(w,E));const O=!S&&void 0!==v.current;return u(()=>{O&&(v.current=void 0)},[O]),u(()=>{const e=v.current;if("undefined"!=typeof process&&"removeMeOnCompilation"===process.env.NODE_ENV&&console.log(O),m===Oa)return e?.unsubscribe(),void(v.current=void 0);const r=v.current?.subscriptionOptions;if(e&&e.arg===m)g!==r&&e.updateSubscriptionOptions(g);else{e?.unsubscribe();const r=y(p(m,{subscriptionOptions:g,forceRefetch:a,...Os(c.endpointDefinitions[t])?{initialPageParam:b}:{}}));v.current=r}},[y,p,a,m,g,O,b,t]),[v,y,p,g]}function p(t,r){return(i,{skip:u=!1,selectFromResult:l}={})=>{const{select:f}=e.endpoints[t],d=Ts(u?Oa:i,s,c.endpointDefinitions[t],t),p=Xa.useRef(void 0),y=Xa.useMemo(()=>a([f(d),(e,t)=>t,e=>d],r,{memoizeOptions:{resultEqualityCheck:as}}),[f,d]),h=Xa.useMemo(()=>l?a([y],l,{devModeChecks:{identityFunctionCheck:"never"}}):y,[y,l]),m=n(e=>h(e,p.current),as),g=o(),b=y(g.getState(),p.current);return ks(()=>{p.current=b},[b]),m}}function y(e){Xa.useEffect(()=>()=>{e.current?.unsubscribe?.(),e.current=void 0},[e])}function h(e){if(!e.current)throw new Error("production"===process.env.NODE_ENV?ot(38):"Cannot refetch a query that has not been started yet.");return e.current.refetch()}}({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:n,createSelector:r},serializeQueryArgs:i,context:a});return _s(s,{usePrefetch:f}),_s(a,{batch:e}),{injectEndpoint(e,t){if("query"===t.type){const{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:a}=c(e);_s(s.endpoints[e],{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:a}),o[`use${Es(e)}Query`]=t,o[`useLazy${Es(e)}Query`]=r}if(function(e){return"mutation"===e.type}(t)){const t=l(e);_s(s.endpoints[e],{useMutation:t}),o[`use${Es(e)}Mutation`]=t}else if(Os(t)){const{useInfiniteQuery:t,useInfiniteQuerySubscription:r,useInfiniteQueryState:n}=u(e);_s(s.endpoints[e],{useInfiniteQuery:t,useInfiniteQuerySubscription:r,useInfiniteQueryState:n}),o[`use${Es(e)}InfiniteQuery`]=t}}}}}})());const qs={baseUrl:process.env.REACT_APP_API_BASE_URL||"http://localhost:4000/fear/api/",timeout:3e4,credentials:"include",prepareHeaders:(e,{getState:t})=>{e.set("Content-Type","application/json");const r=t()?.auth?.token;return r&&e.set("Authorization",`Bearer ${r}`),e}},Fs={GET:"GET",POST:"POST",PUT:"PUT",PATCH:"PATCH",DELETE:"DELETE"},Ms={getAll:{method:Fs.GET,url:e=>`${e}/all`,providesTags:e=>[{type:e,id:"LIST"}]},getById:{method:Fs.GET,url:(e,t)=>`${e}/${t}`,providesTags:(e,t)=>[{type:e,id:t}]},create:{method:Fs.POST,url:e=>`${e}`,invalidatesTags:e=>[{type:e,id:"LIST"}]},update:{method:Fs.PUT,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},patch:{method:Fs.PATCH,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},delete:{method:Fs.DELETE,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},search:{method:Fs.GET,url:e=>`${e}/search`,providesTags:e=>[{type:e,id:"SEARCH"}]}},Us=e=>e.status?{status:e.status,message:e.data?.message||`HTTP Error ${e.status}`,data:e.data}:{status:"FETCH_ERROR",message:e.message||"Network error occurred",error:e.error},Ls=(e,t,r={})=>{const{method:n,url:o}=e;let i={method:n,url:"function"==typeof o?o(t,r.id,r):o};return n!==Fs.GET&&n!==Fs.DELETE&&(i.body=r.data||r),n===Fs.GET&&r.params&&(i.params=r.params),i},$s=(e,t={})=>{(e=>{if(!e||"string"!=typeof e)throw new Error("SliceName must be a non-empty string")})(e);const r={tagTypes:["Product","Order","User","Category"],baseQuery:{},includeStandardEndpoints:!0,...t},n=(o=e).charAt(0).toUpperCase()+o.slice(1);var o;r.tagTypes.includes(n)||r.tagTypes.push(n);const i={...qs,...r.baseQuery},a=Ds({reducerPath:`${e}Api`,tagTypes:r.tagTypes,baseQuery:Xi(i),endpoints:()=>({})}),s=(t,r)=>{const{method:n=Fs.GET,url:o,type:i=(n===Fs.GET?"query":"mutation"),providesTags:s,invalidatesTags:c,transformResponse:u,transformErrorResponse:l=Us}=r;return a.injectEndpoints({endpoints:r=>({[t]:r[i]({query:(t={})=>Ls({method:n,url:o},e,t),providesTags:s?(t,r,n)=>s(e,n?.id,t,r,n):void 0,invalidatesTags:c?(t,r,n)=>c(e,n?.id,t,r,n):void 0,transformResponse:u,transformErrorResponse:l})})})},c=t=>a.injectEndpoints({endpoints:r=>{const n={};return Object.entries(t).forEach(([t,o])=>{const{method:i=Fs.GET,url:a,type:s=(i===Fs.GET?"query":"mutation"),providesTags:c,invalidatesTags:u,transformResponse:l,transformErrorResponse:f=Us}=o;n[t]=r[s]({query:(t={})=>Ls({method:i,url:a},e,t),providesTags:c?(t,r,n)=>c(e,n?.id,t,r,n):void 0,invalidatesTags:u?(t,r,n)=>u(e,n?.id,t,r,n):void 0,transformResponse:l,transformErrorResponse:f})}),n}}),u=()=>{const e={};return Object.entries(Ms).forEach(([t,r])=>{e[t]={method:r.method,url:r.url,providesTags:r.providesTags,invalidatesTags:r.invalidatesTags}}),c(e)};return{sliceName:e,entityTagType:n,baseApi:a,inject:s,injectMany:c,create:()=>{let e=a;return r.includeStandardEndpoints&&(e=u()),e},createStandard:u,createBulk:()=>{const t={bulkCreate:{method:Fs.POST,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]},bulkUpdate:{method:Fs.PUT,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]},bulkDelete:{method:Fs.DELETE,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]}};return c(t)},createCustom:(e,t)=>s(e,t),getTagTypes:()=>[...r.tagTypes],getBaseUrl:()=>i.baseUrl,getReducerPath:()=>a.reducerPath,withAuth:t=>$s(e,{...r,baseQuery:{...i,prepareHeaders:(e,r)=>(e.set("Authorization",`Bearer ${t}`),qs.prepareHeaders(e,r))}}),withBaseUrl:t=>$s(e,{...r,baseQuery:{...i,baseUrl:t}})}};$s.createComplete=(e,t={})=>$s(e,t).create(),$s.createCustom=(e,t,r={})=>$s(e,{...r,includeStandardEndpoints:!1}).injectMany(t),$s.getStandardEndpoints=()=>({...Ms}),$s.getHttpMethods=()=>({...Fs}),exports.ApiFactory=$s,exports.CacheFactory=hi,exports.FeatureFactory=function(e,t={},r=null){if(!e||"string"!=typeof e)throw new Error("Entity name must be provided as a string");const n=nt(),o=(e,t)=>{if(!e||!t)throw new Error("Both source and destination objects must be provided");return Object.keys(e).reduce((t,r)=>(Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]),t),{...t})},i=(e,t,r)=>{Object.entries(t).forEach(([t,n])=>{e.addCase(n.pending,e=>{e.loading=!0,e.error=null}).addCase(n.fulfilled,(e,n)=>{e.loading=!1,e.success=!0,e.data=n.payload.result,("fetchOne"===t&&Array.isArray(n.payload)||Array.isArray(n.payload)&&n.payload.length>0)&&(e[r]=n.payload[0].result)}).addCase(n.rejected,(e,t)=>{e.loading=!1,e.success=!1,e.error=t.error||t.payload})})};return{entity:e,reducers:t,adapter:n,manager:(e={})=>{const t={...e};let r=s(t);return{reduce:(e,t)=>r(e,t),add:(e,n)=>{e&&"string"==typeof e?t[e]?console.warn(`Reducer with key '${e}' already exists`):(t[e]=n,r=s(t)):console.warn("Invalid reducer key provided")},remove:e=>{e&&t[e]?(delete t[e],r=s(t)):console.warn(`Reducer with key '${e}' does not exist`)},getReducerMap:()=>({...t})}},inject:o,create:(r={})=>{const{service:n=null,initialState:a=null}=r,s=e,c=(e=>({fetch:Ii.create(e,"all"),fetchOne:Ii.create(e,"one"),search:Ii.post(e,"search")}))(s);return{slice:Ke({name:s,initialState:a||Mi(s),reducers:t,extraReducers:e=>{if(i(e,c,s),n&&"object"==typeof n){const t=Object.entries(n).reduce((e,[t,r])=>(c[t]||(e[t]=r),e),{});i(e,t,s)}}}),asyncActions:n?o(c,n):c}},getEntityName:()=>e,getAdapter:()=>n}},exports.StateFactory=Mi,exports.ThunkFactory=Ii;
19
+ */var os=(rs||(rs=1,"production"===process.env.NODE_ENV?Za.exports=function(){if(Ya)return es;Ya=1;var e=Ja(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;return es.useSyncExternalStoreWithSelector=function(e,s,c,u,l){var f=n(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i(function(){function e(e){if(!o){if(o=!0,r=e,e=u(e),void 0!==l&&d.hasValue){var i=d.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var a=u(e);return void 0!==l&&l(i,a)?(r=e,i):(r=e,n=a)}var r,n,o=!1,i=void 0===c?null:c;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,c,u,l]);var p=r(e,f[0],f[1]);return o(function(){d.hasValue=!0,d.value=p},[p]),a(p),p},es}():Za.exports=(ts||(ts=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=Ja(),t="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useSyncExternalStore,n=e.useRef,o=e.useEffect,i=e.useMemo,a=e.useDebugValue;ns.useSyncExternalStoreWithSelector=function(e,s,c,u,l){var f=n(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;f=i(function(){function e(e){if(!o){if(o=!0,r=e,e=u(e),void 0!==l&&d.hasValue){var i=d.value;if(l(i,e))return n=i}return n=e}if(i=n,t(r,e))return i;var a=u(e);return void 0!==l&&l(i,a)?(r=e,i):(r=e,n=a)}var r,n,o=!1,i=void 0===c?null:c;return[function(){return e(s())},null===i?void 0:function(){return e(i())}]},[s,c,u,l]);var p=r(e,f[0],f[1]);return o(function(){d.hasValue=!0,d.value=p},[p]),a(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ns)),Za.exports);function is(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function as(e,t){if(is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let n=0;n<r.length;n++)if(!Object.prototype.hasOwnProperty.call(t,r[n])||!is(e[r[n]],t[r[n]]))return!1;return!0}var ss=Symbol.for("react-redux-context"),cs="undefined"!=typeof globalThis?globalThis:{};function us(){if(!Xa.createContext)return{};const e=cs[ss]??=new Map;let t=e.get(Xa.createContext);return t||(t=Xa.createContext(null),"production"!==process.env.NODE_ENV&&(t.displayName="ReactRedux"),e.set(Xa.createContext,t)),t}var ls=us();function fs(e=ls){return function(){const t=Xa.useContext(e);if("production"!==process.env.NODE_ENV&&!t)throw new Error("could not find react-redux context value; please ensure the component is wrapped in a <Provider>");return t}}var ds=fs();function ps(e=ls){const t=e===ls?ds:fs(e),r=()=>{const{store:e}=t();return e};return Object.assign(r,{withTypes:()=>r}),r}var ys=ps();function hs(e=ls){const t=e===ls?ys:ps(e),r=()=>t().dispatch;return Object.assign(r,{withTypes:()=>r}),r}var ms=hs(),gs=(e,t)=>e===t;function bs(e=ls){const t=e===ls?ds:fs(e),r=(e,r={})=>{const{equalityFn:n=gs}="function"==typeof r?{equalityFn:r}:r;if("production"!==process.env.NODE_ENV){if(!e)throw new Error("You must pass a selector to useSelector");if("function"!=typeof e)throw new Error("You must pass a function as a selector to useSelector");if("function"!=typeof n)throw new Error("You must pass a function as an equality function to useSelector")}const o=t(),{store:i,subscription:a,getServerState:s}=o,c=Xa.useRef(!0),u=Xa.useCallback({[e.name](t){const i=e(t);if("production"!==process.env.NODE_ENV){const{devModeChecks:a={}}="function"==typeof r?{}:r,{identityFunctionCheck:s,stabilityCheck:u}=o,{identityFunctionCheck:l,stabilityCheck:f}={stabilityCheck:u,identityFunctionCheck:s,...a};if("always"===f||"once"===f&&c.current){const r=e(t);if(!n(i,r)){let n;try{throw new Error}catch(e){({stack:n}=e)}console.warn("Selector "+(e.name||"unknown")+" returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization",{state:t,selected:i,selected2:r,stack:n})}}if(("always"===l||"once"===l&&c.current)&&i===t){let t;try{throw new Error}catch(e){({stack:t}=e)}console.warn("Selector "+(e.name||"unknown")+" returned the root state when called. This can lead to unnecessary rerenders.\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.",{stack:t})}c.current&&(c.current=!1)}return i}}[e.name],[e]),l=os.useSyncExternalStoreWithSelector(a.addNestedSub,i.getState,s||i.getState,u,n);return Xa.useDebugValue(l),l};return Object.assign(r,{withTypes:()=>r}),r}var vs=bs(),ws=function(e){e()};function Es(e){return e.replace(e[0],e[0].toUpperCase())}function Ss(e){let t=0;for(const r in e)t++;return t}function Os(e){return"infinitequery"===e.type}function _s(e,...t){return Object.assign(e,...t)}var As=Symbol();function Ts(e,t,r,n){const o=Xa.useMemo(()=>({queryArgs:e,serialized:"object"==typeof e?t({queryArgs:e,endpointDefinition:r,endpointName:n}):e}),[e,t,r,n]),i=Xa.useRef(o);return Xa.useEffect(()=>{i.current.serialized!==o.serialized&&(i.current=o)},[o]),i.current.serialized===o.serialized?i.current.queryArgs:e}function Rs(e){const t=Xa.useRef(e);return Xa.useEffect(()=>{as(t.current,e)||(t.current=e)},[e]),as(t.current,e)?t.current:e}var Ps=(()=>!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement))(),js=(()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product)(),ks=(()=>Ps||js?Xa.useLayoutEffect:Xa.useEffect)(),Cs=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:void 0===e.data,status:Li.pending}:e;function Ns(e,...t){const r={};return t.forEach(t=>{r[t]=e[t]}),r}var Is=["data","status","isLoading","isSuccess","isError","error"];var xs=Symbol(),Ds=ja($a(),(({batch:e=ws,hooks:t={useDispatch:ms,useSelector:vs,useStore:ys},createSelector:r=ye,unstable__sideEffectsInRender:n=!1,...o}={})=>{if("production"!==process.env.NODE_ENV){const e=["useDispatch","useSelector","useStore"];let r=!1;for(const n of e)if(Ss(o)>0&&(o[n]&&(r||(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 } })`"),r=!0)),t[n]=o[n]),"function"!=typeof t[n])throw new Error("production"===process.env.NODE_ENV?ot(36):`When using custom hooks for context, all ${e.length} hooks need to be provided: ${e.join(", ")}.\nHook ${n} was either not provided or not a function.`)}return{name:xs,init(o,{serializeQueryArgs:i},a){const s=o,{buildQueryHooks:c,buildInfiniteQueryHooks:u,buildMutationHook:l,usePrefetch:f}=function({api:e,moduleOptions:{batch:t,hooks:{useDispatch:r,useSelector:n,useStore:o},unstable__sideEffectsInRender:i,createSelector:a},serializeQueryArgs:s,context:c}){const u=i?e=>e():Xa.useEffect;return{buildQueryHooks:function(n){const o=(e,t={})=>{const[r]=d(n,e,t);return y(r),Xa.useMemo(()=>({refetch:()=>h(r)}),[r])},i=({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:a=0,skipPollingIfUnfocused:s=!1}={})=>{const{initiate:c}=e.endpoints[n],l=r(),[f,d]=Xa.useState(As),p=Xa.useRef(void 0),y=Rs({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:a,skipPollingIfUnfocused:s});u(()=>{const e=p.current?.subscriptionOptions;y!==e&&p.current?.updateSubscriptionOptions(y)},[y]);const h=Xa.useRef(y);u(()=>{h.current=y},[y]);const m=Xa.useCallback(function(e,r=!1){let n;return t(()=>{p.current?.unsubscribe(),p.current=n=l(c(e,{subscriptionOptions:h.current,forceRefetch:!r})),d(e)}),n},[l,c]),g=Xa.useCallback(()=>{p.current?.queryCacheKey&&l(e.internalActions.removeQueryResult({queryCacheKey:p.current?.queryCacheKey}))},[l]);return Xa.useEffect(()=>()=>{p?.current?.unsubscribe()},[]),Xa.useEffect(()=>{f===As||p.current||m(f,!0)},[f,m]),Xa.useMemo(()=>[m,f,{reset:g}],[m,f,g])},a=p(n,l);return{useQueryState:a,useQuerySubscription:o,useLazyQuerySubscription:i,useLazyQuery(e){const[t,r,{reset:n}]=i(e),o=a(r,{...e,skip:r===As}),s=Xa.useMemo(()=>({lastArg:r}),[r]);return Xa.useMemo(()=>[t,{...o,reset:n},s],[t,o,n,s])},useQuery(e,t){const r=o(e,t),n=a(e,{selectFromResult:e===Oa||t?.skip?void 0:Cs,...t}),i=Ns(n,...Is);return Xa.useDebugValue(i),Xa.useMemo(()=>({...n,...r}),[n,r])}}},buildInfiniteQueryHooks:function(e){const r=(r,n={})=>{const[o,i,a,s]=d(e,r,n),l=Xa.useRef(s);u(()=>{l.current=s},[s]);const f=Xa.useCallback(function(e,r){let n;return t(()=>{o.current?.unsubscribe(),o.current=n=i(a(e,{subscriptionOptions:l.current,direction:r}))}),n},[o,i,a]);y(o);const p=Ts(n.skip?Oa:r,Pa,c.endpointDefinitions[e],e),m=Xa.useCallback(()=>h(o),[o]);return Xa.useMemo(()=>({trigger:f,refetch:m,fetchNextPage:()=>f(p,"forward"),fetchPreviousPage:()=>f(p,"backward")}),[m,f,p])},n=p(e,f);return{useInfiniteQueryState:n,useInfiniteQuerySubscription:r,useInfiniteQuery(e,t){const{refetch:o,fetchNextPage:i,fetchPreviousPage:a}=r(e,t),s=n(e,{selectFromResult:e===Oa||t?.skip?void 0:Cs,...t}),c=Ns(s,...Is,"hasNextPage","hasPreviousPage");return Xa.useDebugValue(c),Xa.useMemo(()=>({...s,fetchNextPage:i,fetchPreviousPage:a,refetch:o}),[s,i,a,o])}}},buildMutationHook:function(o){return({selectFromResult:i,fixedCacheKey:s}={})=>{const{select:c,initiate:u}=e.endpoints[o],l=r(),[f,d]=Xa.useState();Xa.useEffect(()=>()=>{f?.arg.fixedCacheKey||f?.reset()},[f]);const p=Xa.useCallback(function(e){const t=l(u(e,{fixedCacheKey:s}));return d(t),t},[l,u,s]),{requestId:y}=f||{},h=Xa.useMemo(()=>c({fixedCacheKey:s,requestId:f?.requestId}),[s,f,c]),m=Xa.useMemo(()=>i?a([h],i):h,[i,h]),g=n(m,as),b=null==s?f?.arg.originalArgs:void 0,v=Xa.useCallback(()=>{t(()=>{f&&d(void 0),s&&l(e.internalActions.removeMutationResult({requestId:y,fixedCacheKey:s}))})},[l,s,f,y]),w=Ns(g,...Is,"endpointName");Xa.useDebugValue(w);const E=Xa.useMemo(()=>({...g,originalArgs:b,reset:v}),[g,b,v]);return Xa.useMemo(()=>[p,E],[p,E])}},usePrefetch:function(t,n){const o=r(),i=Rs(n);return Xa.useCallback((r,n)=>o(e.util.prefetch(t,r,{...i,...n})),[t,o,i])}};function l(e,t,r){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,n=c.endpointDefinitions[e];r!==Oa&&s({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===s({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);const o=void 0!==n,i=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!o&&i,u=e.isSuccess||o&&(i&&!t?.isError||e.isUninitialized);return{...e,data:n,currentData:e.data,isFetching:i,isLoading:a,isSuccess:u}}function f(e,t,r){if(t?.endpointName&&e.isUninitialized){const{endpointName:e}=t,n=c.endpointDefinitions[e];r!==Oa&&s({queryArgs:t.originalArgs,endpointDefinition:n,endpointName:e})===s({queryArgs:r,endpointDefinition:n,endpointName:e})&&(t=void 0)}let n=e.isSuccess?e.data:t?.data;void 0===n&&(n=e.data);const o=void 0!==n,i=e.isLoading,a=(!t||t.isLoading||t.isUninitialized)&&!o&&i,u=e.isSuccess||i&&o;return{...e,data:n,currentData:e.data,isFetching:i,isLoading:a,isSuccess:u}}function d(t,n,{refetchOnReconnect:o,refetchOnFocus:i,refetchOnMountOrArgChange:a,skip:s=!1,pollingInterval:l=0,skipPollingIfUnfocused:f=!1,...d}={}){const{initiate:p}=e.endpoints[t],y=r(),h=Xa.useRef(void 0);if(!h.current){const t=y(e.internalActions.internal_getRTKQSubscriptions());if("production"!==process.env.NODE_ENV&&("object"!=typeof t||"string"==typeof t?.type))throw new Error("production"===process.env.NODE_ENV?ot(37):`Warning: Middleware for RTK-Query API at reducerPath "${e.reducerPath}" has not been added to the store.\n You must add the middleware for RTK-Query to function correctly!`);h.current=t}const m=Ts(s?Oa:n,Pa,c.endpointDefinitions[t],t),g=Rs({refetchOnReconnect:o,refetchOnFocus:i,pollingInterval:l,skipPollingIfUnfocused:f}),b=Rs(d.initialPageParam),v=Xa.useRef(void 0);let{queryCacheKey:w,requestId:E}=v.current||{},S=!1;w&&E&&(S=h.current.isRequestSubscribed(w,E));const O=!S&&void 0!==v.current;return u(()=>{O&&(v.current=void 0)},[O]),u(()=>{const e=v.current;if("undefined"!=typeof process&&"removeMeOnCompilation"===process.env.NODE_ENV&&console.log(O),m===Oa)return e?.unsubscribe(),void(v.current=void 0);const r=v.current?.subscriptionOptions;if(e&&e.arg===m)g!==r&&e.updateSubscriptionOptions(g);else{e?.unsubscribe();const r=y(p(m,{subscriptionOptions:g,forceRefetch:a,...Os(c.endpointDefinitions[t])?{initialPageParam:b}:{}}));v.current=r}},[y,p,a,m,g,O,b,t]),[v,y,p,g]}function p(t,r){return(i,{skip:u=!1,selectFromResult:l}={})=>{const{select:f}=e.endpoints[t],d=Ts(u?Oa:i,s,c.endpointDefinitions[t],t),p=Xa.useRef(void 0),y=Xa.useMemo(()=>a([f(d),(e,t)=>t,e=>d],r,{memoizeOptions:{resultEqualityCheck:as}}),[f,d]),h=Xa.useMemo(()=>l?a([y],l,{devModeChecks:{identityFunctionCheck:"never"}}):y,[y,l]),m=n(e=>h(e,p.current),as),g=o(),b=y(g.getState(),p.current);return ks(()=>{p.current=b},[b]),m}}function y(e){Xa.useEffect(()=>()=>{e.current?.unsubscribe?.(),e.current=void 0},[e])}function h(e){if(!e.current)throw new Error("production"===process.env.NODE_ENV?ot(38):"Cannot refetch a query that has not been started yet.");return e.current.refetch()}}({api:o,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:n,createSelector:r},serializeQueryArgs:i,context:a});return _s(s,{usePrefetch:f}),_s(a,{batch:e}),{injectEndpoint(e,t){if("query"===t.type){const{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:a}=c(e);_s(s.endpoints[e],{useQuery:t,useLazyQuery:r,useLazyQuerySubscription:n,useQueryState:i,useQuerySubscription:a}),o[`use${Es(e)}Query`]=t,o[`useLazy${Es(e)}Query`]=r}if(function(e){return"mutation"===e.type}(t)){const t=l(e);_s(s.endpoints[e],{useMutation:t}),o[`use${Es(e)}Mutation`]=t}else if(Os(t)){const{useInfiniteQuery:t,useInfiniteQuerySubscription:r,useInfiniteQueryState:n}=u(e);_s(s.endpoints[e],{useInfiniteQuery:t,useInfiniteQuerySubscription:r,useInfiniteQueryState:n}),o[`use${Es(e)}InfiniteQuery`]=t}}}}}})());const qs={baseUrl:process.env.REACT_APP_API_BASE_URL||"http://localhost:4000/fear/api/",timeout:3e4,credentials:"include",prepareHeaders:(e,{getState:t})=>{e.set("Content-Type","application/json");const r=t()?.auth?.token;return r&&e.set("Authorization",`Bearer ${r}`),e}},Fs={GET:"GET",POST:"POST",PUT:"PUT",PATCH:"PATCH",DELETE:"DELETE"},Ms={getAll:{method:Fs.GET,url:e=>`${e}/all`,providesTags:e=>[{type:e,id:"LIST"}]},getById:{method:Fs.GET,url:(e,t)=>`${e}/${t}`,providesTags:(e,t)=>[{type:e,id:t}]},create:{method:Fs.POST,url:e=>`${e}`,invalidatesTags:e=>[{type:e,id:"LIST"}]},update:{method:Fs.PUT,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},patch:{method:Fs.PATCH,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},delete:{method:Fs.DELETE,url:(e,t)=>`${e}/${t}`,invalidatesTags:(e,t)=>[{type:e,id:t},{type:e,id:"LIST"}]},search:{method:Fs.GET,url:e=>`${e}/search`,providesTags:e=>[{type:e,id:"SEARCH"}]}},Us=e=>e.status?{status:e.status,message:e.data?.message||`HTTP Error ${e.status}`,data:e.data}:{status:"FETCH_ERROR",message:e.message||"Network error occurred",error:e.error},Ls=(e,t,r={})=>{const{method:n,url:o}=e;let i={method:n,url:"function"==typeof o?o(t,r.id,r):o};return n!==Fs.GET&&n!==Fs.DELETE&&(i.body=r.data||r),n===Fs.GET&&r.params&&(i.params=r.params),i},$s=(e,t={})=>{(e=>{if(!e||"string"!=typeof e)throw new Error("SliceName must be a non-empty string")})(e);const r={tagTypes:["Product","Order","User","Category"],baseQuery:{},includeStandardEndpoints:!0,...t},n=(o=e).charAt(0).toUpperCase()+o.slice(1);var o;r.tagTypes.includes(n)||r.tagTypes.push(n);const i={...qs,...r.baseQuery},a=Ds({reducerPath:`${e}Api`,tagTypes:r.tagTypes,baseQuery:Xi(i),endpoints:()=>({})}),s=(t,r)=>{const{method:n=Fs.GET,url:o,type:i=(n===Fs.GET?"query":"mutation"),providesTags:s,invalidatesTags:c,transformResponse:u,transformErrorResponse:l=Us}=r;return a.injectEndpoints({endpoints:r=>({[t]:r[i]({query:(t={})=>Ls({method:n,url:o},e,t),providesTags:s?(t,r,n)=>s(e,n?.id,t,r,n):void 0,invalidatesTags:c?(t,r,n)=>c(e,n?.id,t,r,n):void 0,transformResponse:u,transformErrorResponse:l})})})},c=t=>a.injectEndpoints({endpoints:r=>{const n={};return Object.entries(t).forEach(([t,o])=>{const{method:i=Fs.GET,url:a,type:s=(i===Fs.GET?"query":"mutation"),providesTags:c,invalidatesTags:u,transformResponse:l,transformErrorResponse:f=Us}=o;n[t]=r[s]({query:(t={})=>Ls({method:i,url:a},e,t),providesTags:c?(t,r,n)=>c(e,n?.id,t,r,n):void 0,invalidatesTags:u?(t,r,n)=>u(e,n?.id,t,r,n):void 0,transformResponse:l,transformErrorResponse:f})}),n}}),u=()=>{const e={};return Object.entries(Ms).forEach(([t,r])=>{e[t]={method:r.method,url:r.url,providesTags:r.providesTags,invalidatesTags:r.invalidatesTags}}),c(e)};return{sliceName:e,entityTagType:n,baseApi:a,inject:s,injectMany:c,create:()=>{let e=a;return r.includeStandardEndpoints&&(e=u()),e},createStandard:u,createBulk:()=>{const t={bulkCreate:{method:Fs.POST,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]},bulkUpdate:{method:Fs.PUT,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]},bulkDelete:{method:Fs.DELETE,url:`${e}/bulk`,invalidatesTags:()=>[{type:n,id:"LIST"}]}};return c(t)},createCustom:(e,t)=>s(e,t),getTagTypes:()=>[...r.tagTypes],getBaseUrl:()=>i.baseUrl,getReducerPath:()=>a.reducerPath,withAuth:t=>$s(e,{...r,baseQuery:{...i,prepareHeaders:(e,r)=>(e.set("Authorization",`Bearer ${t}`),qs.prepareHeaders(e,r))}}),withBaseUrl:t=>$s(e,{...r,baseQuery:{...i,baseUrl:t}})}};$s.createComplete=(e,t={})=>$s(e,t).create(),$s.createCustom=(e,t,r={})=>$s(e,{...r,includeStandardEndpoints:!1}).injectMany(t),$s.getStandardEndpoints=()=>({...Ms}),$s.getHttpMethods=()=>({...Fs}),exports.API=Pi,exports.ApiFactory=$s,exports.CacheFactory=hi,exports.FeatureFactory=function(e,t={},r=null){if(!e||"string"!=typeof e)throw new Error("Entity name must be provided as a string");const n=nt(),o=(e,t)=>{if(!e||!t)throw new Error("Both source and destination objects must be provided");return Object.keys(e).reduce((t,r)=>(Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]),t),{...t})},i=(e,t,r)=>{Object.entries(t).forEach(([t,n])=>{e.addCase(n.pending,e=>{e.loading=!0,e.error=null}).addCase(n.fulfilled,(e,n)=>{e.loading=!1,e.success=!0,e.data=n.payload.result,("fetchOne"===t&&Array.isArray(n.payload)||Array.isArray(n.payload)&&n.payload.length>0)&&(e[r]=n.payload[0].result)}).addCase(n.rejected,(e,t)=>{e.loading=!1,e.success=!1,e.error=t.error||t.payload})})};return{entity:e,reducers:t,adapter:n,manager:(e={})=>{const t={...e};let r=s(t);return{reduce:(e,t)=>r(e,t),add:(e,n)=>{e&&"string"==typeof e?t[e]?console.warn(`Reducer with key '${e}' already exists`):(t[e]=n,r=s(t)):console.warn("Invalid reducer key provided")},remove:e=>{e&&t[e]?(delete t[e],r=s(t)):console.warn(`Reducer with key '${e}' does not exist`)},getReducerMap:()=>({...t})}},inject:o,create:(r={})=>{const{service:n=null,initialState:a=null}=r,s=e,c=(e=>({fetch:Ii.create(e,"all"),fetchOne:Ii.create(e,"one"),search:Ii.post(e,"search")}))(s);return{slice:Ke({name:s,initialState:a||Mi(s),reducers:t,extraReducers:e=>{if(i(e,c,s),n&&"object"==typeof n){const t=Object.entries(n).reduce((e,[t,r])=>(c[t]||(e[t]=r),e),{});i(e,t,s)}}}),asyncActions:n?o(c,n):c}},getEntityName:()=>e,getAdapter:()=>n}},exports.StateFactory=Mi,exports.ThunkFactory=Ii;
20
20
  //# sourceMappingURL=index.js.map