@appsflow/redux
Version:
AppFlow redux
2 lines (1 loc) • 27.1 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("react-redux"),require("@appsflow/core")):"function"==typeof define&&define.amd?define(["exports","react","react-redux","@appsflow/core"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["$flow.redux"]={},t.React,t.ReactRedux,t.$flow)}(this,(function(t,e,r,n){"use strict";function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=o(n);function u(t){for(var e=arguments.length,r=Array(e>1?e-1:0),n=1;e>n;n++)r[n-1]=arguments[n];throw Error("[Immer] minified error nr: "+t+(r.length?" "+r.map((function(t){return"'"+t+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function a(t){return!!t&&!!t[B]}function c(t){var e;return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;var r=Object.hasOwnProperty.call(e,"constructor")&&e.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===J}(t)||Array.isArray(t)||!!t[X]||!!(null===(e=t.constructor)||void 0===e?void 0:e[X])||y(t)||v(t))}function f(t,e,r){void 0===r&&(r=!1),0===l(t)?(r?Object.keys:G)(t).forEach((function(n){r&&"symbol"==typeof n||e(n,t[n],t)})):t.forEach((function(r,n){return e(n,r,t)}))}function l(t){var e=t[B];return e?e.i>3?e.i-4:e.i:Array.isArray(t)?1:y(t)?2:v(t)?3:0}function s(t,e){return 2===l(t)?t.has(e):Object.prototype.hasOwnProperty.call(t,e)}function p(t,e,r){var n=l(t);2===n?t.set(e,r):3===n?(t.delete(e),t.add(r)):t[e]=r}function d(t,e){return t===e?0!==t||1/t==1/e:t!=t&&e!=e}function y(t){return L&&t instanceof Map}function v(t){return U&&t instanceof Set}function h(t){return t.o||t.t}function b(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var e=H(t);delete e[B];for(var r=G(e),n=0;r.length>n;n++){var o=r[n],i=e[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(e[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[o]})}return Object.create(Object.getPrototypeOf(t),e)}function g(t,e){return void 0===e&&(e=!1),O(t)||a(t)||!c(t)||(l(t)>1&&(t.set=t.add=t.clear=t.delete=m),Object.freeze(t),e&&f(t,(function(t,e){return g(e,!0)}),!0)),t}function m(){u(2)}function O(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function w(t){var e=Q[t];return e||u(18,t),e}function P(){return K}function j(t,e){e&&(w("Patches"),t.u=[],t.s=[],t.v=e)}function S(t){E(t),t.p.forEach(x),t.p=null}function E(t){t===K&&(K=t.l)}function A(t){return K={p:[],l:K,h:t,m:!0,_:0}}function x(t){var e=t[B];0===e.i||1===e.i?e.j():e.O=!0}function R(t,e){e._=e.p.length;var r=e.p[0],n=void 0!==t&&t!==r;return e.h.g||w("ES5").S(e,t,n),n?(r[B].P&&(S(e),u(4)),c(t)&&(t=_(e,t),e.l||I(e,t)),e.u&&w("Patches").M(r[B].t,t,e.u,e.s)):t=_(e,r,[]),S(e),e.u&&e.v(e.u,e.s),t!==V?t:void 0}function _(t,e,r){if(O(e))return e;var n=e[B];if(!n)return f(e,(function(o,i){return C(t,n,e,o,i,r)}),!0),e;if(n.A!==t)return e;if(!n.P)return I(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=b(n.k):n.o;f(3===n.i?new Set(o):o,(function(e,i){return C(t,n,o,e,i,r)})),I(t,o,!1),r&&t.u&&w("Patches").R(n,r,t.u,t.s)}return n.o}function C(t,e,r,n,o,i){if(a(o)){var u=_(t,o,i&&e&&3!==e.i&&!s(e.D,n)?i.concat(n):void 0);if(p(r,n,u),!a(u))return;t.m=!1}if(c(o)&&!O(o)){if(!t.h.F&&1>t._)return;_(t,o),e&&e.A.l||I(t,o)}}function I(t,e,r){void 0===r&&(r=!1),t.h.F&&t.m&&g(e,r)}function k(t,e){var r=t[B];return(r?h(r):t)[e]}function D(t,e){if(e in t)for(var r=Object.getPrototypeOf(t);r;){var n=Object.getOwnPropertyDescriptor(r,e);if(n)return n;r=Object.getPrototypeOf(r)}}function N(t){t.P||(t.P=!0,t.l&&N(t.l))}function T(t){t.o||(t.o=b(t.t))}function M(t,e,r){var n=y(e)?w("MapSet").N(e,r):v(e)?w("MapSet").T(e,r):t.g?function(t,e){var r=Array.isArray(t),n={i:r?1:0,A:e?e.A:P(),P:!1,I:!1,D:{},l:e,t:t,k:null,o:null,j:null,C:!1},o=n,i=Y;r&&(o=[n],i=Z);var u=Proxy.revocable(o,i),a=u.revoke,c=u.proxy;return n.k=c,n.j=a,c}(e,r):w("ES5").J(e,r);return(r?r.A:P()).p.push(n),n}function F(t){return a(t)||u(22,t),function t(e){if(!c(e))return e;var r,n=e[B],o=l(e);if(n){if(!n.P&&(4>n.i||!w("ES5").K(n)))return n.t;n.I=!0,r=q(e,o),n.I=!1}else r=q(e,o);return f(r,(function(e,o){n&&function(t,e){return 2===l(t)?t.get(e):t[e]}(n.t,e)===o||p(r,e,t(o))})),3===o?new Set(r):r}(t)}function q(t,e){switch(e){case 2:return new Map(t);case 3:return Array.from(t)}return b(t)}var W,K,z="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),L="undefined"!=typeof Map,U="undefined"!=typeof Set,$="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,V=z?Symbol.for("immer-nothing"):((W={})["immer-nothing"]=!0,W),X=z?Symbol.for("immer-draftable"):"__$immer_draftable",B=z?Symbol.for("immer-state"):"__$immer_state",J=""+Object.prototype.constructor,G="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,H=Object.getOwnPropertyDescriptors||function(t){var e={};return G(t).forEach((function(r){e[r]=Object.getOwnPropertyDescriptor(t,r)})),e},Q={},Y={get:function(t,e){if(e===B)return t;var r=h(t);if(!s(r,e))return function(t,e,r){var n,o=D(e,r);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(t.k):void 0}(t,r,e);var n=r[e];return t.I||!c(n)?n:n===k(t.t,e)?(T(t),t.o[e]=M(t.A.h,n,t)):n},has:function(t,e){return e in h(t)},ownKeys:function(t){return Reflect.ownKeys(h(t))},set:function(t,e,r){var n=D(h(t),e);if(null==n?void 0:n.set)return n.set.call(t.k,r),!0;if(!t.P){var o=k(h(t),e),i=null==o?void 0:o[B];if(i&&i.t===r)return t.o[e]=r,t.D[e]=!1,!0;if(d(r,o)&&(void 0!==r||s(t.t,e)))return!0;T(t),N(t)}return t.o[e]===r&&"number"!=typeof r&&(void 0!==r||e in t.o)||(t.o[e]=r,t.D[e]=!0,!0)},deleteProperty:function(t,e){return void 0!==k(t.t,e)||e in t.t?(t.D[e]=!1,T(t),N(t)):delete t.D[e],t.o&&delete t.o[e],!0},getOwnPropertyDescriptor:function(t,e){var r=h(t),n=Reflect.getOwnPropertyDescriptor(r,e);return n?{writable:!0,configurable:1!==t.i||"length"!==e,enumerable:n.enumerable,value:r[e]}:n},defineProperty:function(){u(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){u(12)}},Z={};f(Y,(function(t,e){Z[t]=function(){return arguments[0]=arguments[0][0],e.apply(this,arguments)}})),Z.deleteProperty=function(t,e){return Z.set.call(this,t,e,void 0)},Z.set=function(t,e,r){return Y.set.call(this,t[0],e,r,t[0])};var tt=function(){function t(t){var e=this;this.g=$,this.F=!0,this.produce=function(t,r,n){if("function"==typeof t&&"function"!=typeof r){var o=r;r=t;var i=e;return function(t){var e=this;void 0===t&&(t=o);for(var n=arguments.length,u=Array(n>1?n-1:0),a=1;n>a;a++)u[a-1]=arguments[a];return i.produce(t,(function(t){var n;return(n=r).call.apply(n,[e,t].concat(u))}))}}var a;if("function"!=typeof r&&u(6),void 0!==n&&"function"!=typeof n&&u(7),c(t)){var f=A(e),l=M(e,t,void 0),s=!0;try{a=r(l),s=!1}finally{s?S(f):E(f)}return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(t){return j(f,n),R(t,f)}),(function(t){throw S(f),t})):(j(f,n),R(a,f))}if(!t||"object"!=typeof t){if(void 0===(a=r(t))&&(a=t),a===V&&(a=void 0),e.F&&g(a,!0),n){var p=[],d=[];w("Patches").M(t,a,p,d),n(p,d)}return a}u(21,t)},this.produceWithPatches=function(t,r){if("function"==typeof t)return function(r){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;n>i;i++)o[i-1]=arguments[i];return e.produceWithPatches(r,(function(e){return t.apply(void 0,[e].concat(o))}))};var n,o,i=e.produce(t,r,(function(t,e){n=t,o=e}));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(t){return[t,n,o]})):[i,n,o]},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var e=t.prototype;return e.createDraft=function(t){c(t)||u(8),a(t)&&(t=F(t));var e=A(this),r=M(this,t,void 0);return r[B].C=!0,E(e),r},e.finishDraft=function(t,e){var r=(t&&t[B]).A;return j(r,e),R(void 0,r)},e.setAutoFreeze=function(t){this.F=t},e.setUseProxies=function(t){t&&!$&&u(20),this.g=t},e.applyPatches=function(t,e){var r;for(r=e.length-1;r>=0;r--){var n=e[r];if(0===n.path.length&&"replace"===n.op){t=n.value;break}}r>-1&&(e=e.slice(r+1));var o=w("Patches").$;return a(t)?o(t,e):this.produce(t,(function(t){return o(t,e)}))},t}(),et=new tt,rt=et.produce;function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function ot(t){var e=function(t,e){if("object"!==nt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===nt(e)?e:e+""}function it(t,e,r){return(e=ot(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ut(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function at(t){for(var e=1;arguments.length>e;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ut(Object(r),!0).forEach((function(e){it(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ut(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function ct(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}et.produceWithPatches.bind(et),et.setAutoFreeze.bind(et),et.setUseProxies.bind(et),et.applyPatches.bind(et),et.createDraft.bind(et),et.finishDraft.bind(et);var ft="function"==typeof Symbol&&Symbol.observable||"@@observable",lt=function(){return Math.random().toString(36).substring(7).split("").join(".")},st={INIT:"@@redux/INIT"+lt(),REPLACE:"@@redux/REPLACE"+lt(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+lt()}};function pt(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function dt(t,e,r){var n;if("function"==typeof e&&"function"==typeof r||"function"==typeof r&&"function"==typeof arguments[3])throw Error(ct(0));if("function"==typeof e&&void 0===r&&(r=e,e=void 0),void 0!==r){if("function"!=typeof r)throw Error(ct(1));return r(dt)(t,e)}if("function"!=typeof t)throw Error(ct(2));var o=t,i=e,u=[],a=u,c=!1;function f(){a===u&&(a=u.slice())}function l(){if(c)throw Error(ct(3));return i}function s(t){if("function"!=typeof t)throw Error(ct(4));if(c)throw Error(ct(5));var e=!0;return f(),a.push(t),function(){if(e){if(c)throw Error(ct(6));e=!1,f();var r=a.indexOf(t);a.splice(r,1),u=null}}}function p(t){if(!pt(t))throw Error(ct(7));if(void 0===t.type)throw Error(ct(8));if(c)throw Error(ct(9));try{c=!0,i=o(i,t)}finally{c=!1}for(var e=u=a,r=0;e.length>r;r++){(0,e[r])()}return t}function d(t){if("function"!=typeof t)throw Error(ct(10));o=t,p({type:st.REPLACE})}function y(){var t,e=s;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw Error(ct(11));function r(){t.next&&t.next(l())}return r(),{unsubscribe:e(r)}}})[ft]=function(){return this},t}return p({type:st.INIT}),(n={dispatch:p,subscribe:s,getState:l,replaceReducer:d})[ft]=y,n}function yt(t){for(var e=Object.keys(t),r={},n=0;e.length>n;n++){var o=e[n];"function"==typeof t[o]&&(r[o]=t[o])}var i,u=Object.keys(r);try{!function(t){Object.keys(t).forEach((function(e){var r=t[e];if(void 0===r(void 0,{type:st.INIT}))throw Error(ct(12));if(void 0===r(void 0,{type:st.PROBE_UNKNOWN_ACTION()}))throw Error(ct(13))}))}(r)}catch(t){i=t}return function(t,e){if(void 0===t&&(t={}),i)throw i;for(var n=!1,o={},a=0;u.length>a;a++){var c=u[a],f=t[c],l=(0,r[c])(f,e);if(void 0===l)throw Error(ct(14));o[c]=l,n=n||l!==f}return(n=n||u.length!==Object.keys(t).length)?o:t}}function vt(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function ht(){for(var t=arguments.length,e=Array(t),r=0;t>r;r++)e[r]=arguments[r];return function(t){return function(){var r=t.apply(void 0,arguments),n=function(){throw Error(ct(15))},o={getState:r.getState,dispatch:function(){return n.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return n=vt.apply(void 0,i)(r.dispatch),at(at({},r),{},{dispatch:n})}}}function bt(t){return function(e){var r=e.dispatch,n=e.getState;return function(e){return function(o){return"function"==typeof o?o(r,n,t):e(o)}}}}var gt=bt();gt.withExtraArgument=bt;var mt,Ot=gt,wt=(mt=function(t,e){return mt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},mt(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+e+" is not a constructor or null");function r(){this.constructor=t}mt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),Pt=function(t,e){var r,n,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;u;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return u.label++,{value:i[1],done:!1};case 5:u.label++,n=i[1],i=[0];continue;case 7:i=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){u=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&o[3]>i[1])){u.label=i[1];break}if(6===i[0]&&o[1]>u.label){u.label=o[1],o=i;break}if(o&&o[2]>u.label){u.label=o[2],u.ops.push(i);break}o[2]&&u.ops.pop(),u.trys.pop();continue}i=e.call(t,u)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}},jt=function(t,e){for(var r=0,n=e.length,o=t.length;n>r;r++,o++)t[o]=e[r];return t},St=Object.defineProperty,Et=Object.defineProperties,At=Object.getOwnPropertyDescriptors,xt=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,_t=Object.prototype.propertyIsEnumerable,Ct=function(t,e,r){return e in t?St(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r},It=function(t,e){for(var r in e||(e={}))Rt.call(e,r)&&Ct(t,r,e[r]);if(xt)for(var n=0,o=xt(e);o.length>n;n++){_t.call(e,r=o[n])&&Ct(t,r,e[r])}return t},kt=function(t,e){return Et(t,At(e))},Dt="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?vt:vt.apply(null,arguments)};var Nt=function(t){function e(){for(var r=[],n=0;arguments.length>n;n++)r[n]=arguments[n];var o=t.apply(this,r)||this;return Object.setPrototypeOf(o,e.prototype),o}return wt(e,t),Object.defineProperty(e,Symbol.species,{get:function(){return e},enumerable:!1,configurable:!0}),e.prototype.concat=function(){for(var e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];return t.prototype.concat.apply(this,e)},e.prototype.prepend=function(){for(var t=[],r=0;arguments.length>r;r++)t[r]=arguments[r];return 1===t.length&&Array.isArray(t[0])?new(e.bind.apply(e,jt([void 0],t[0].concat(this)))):new(e.bind.apply(e,jt([void 0],t.concat(this))))},e}(Array);function Tt(t){return c(t)?rt(t,(function(){})):t}function Mt(){return function(t){return function(t){void 0===t&&(t={});var e=t.thunk,r=void 0===e||e;var n=new Nt;r&&(!function(t){return"boolean"==typeof t}(r)?n.push(Ot.withExtraArgument(r.extraArgument)):n.push(Ot));return n}(t)}}function Ft(t){var e,r=Mt(),n=t||{},o=n.reducer,i=void 0===o?void 0:o,u=n.middleware,a=void 0===u?r():u,c=n.devTools,f=void 0===c||c,l=n.preloadedState,s=void 0===l?void 0:l,p=n.enhancers,d=void 0===p?void 0:p;if("function"==typeof i)e=i;else{if(!function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var r=e;null!==Object.getPrototypeOf(r);)r=Object.getPrototypeOf(r);return e===r}(i))throw Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');e=yt(i)}var y=a;"function"==typeof y&&(y=y(r));var v=ht.apply(void 0,y),h=vt;f&&(h=Dt(It({trace:!1},"object"==typeof f&&f)));var b=[v];return Array.isArray(d)?b=jt([v],d):"function"==typeof d&&(b=d(b)),dt(e,s,h.apply(void 0,b))}function qt(t,e){function r(){for(var r=[],n=0;arguments.length>n;n++)r[n]=arguments[n];if(e){var o=e.apply(void 0,r);if(!o)throw Error("prepareAction did not return an object");return It(It({type:t,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:t,payload:r[0]}}return r.toString=function(){return""+t},r.type=t,r.match=function(e){return e.type===t},r}function Wt(t){var e,r={},n=[],o={addCase:function(t,e){var n="string"==typeof t?t:t.type;if(n in r)throw Error("addCase cannot be called with two reducers for the same action type");return r[n]=e,o},addMatcher:function(t,e){return n.push({matcher:t,reducer:e}),o},addDefaultCase:function(t){return e=t,o}};return t(o),[r,n,e]}function Kt(t){var e=t.name;if(!e)throw Error("`name` is a required option for createSlice");var r,n="function"==typeof t.initialState?t.initialState:Tt(t.initialState),o=t.reducers||{},i={},u={},f={};function l(){var e="function"==typeof t.extraReducers?Wt(t.extraReducers):[t.extraReducers],r=e[0],o=e[1],i=void 0===o?[]:o,f=e[2],l=void 0===f?void 0:f,s=It(It({},void 0===r?{}:r),u);return function(t,e,r,n){void 0===r&&(r=[]);var o,i="function"==typeof e?Wt(e):[e,r,n],u=i[0],f=i[1],l=i[2];if(function(t){return"function"==typeof t}(t))o=function(){return Tt(t())};else{var s=Tt(t);o=function(){return s}}function p(t,e){void 0===t&&(t=o());var r=jt([u[e.type]],f.filter((function(t){return(0,t.matcher)(e)})).map((function(t){return t.reducer})));return 0===r.filter((function(t){return!!t})).length&&(r=[l]),r.reduce((function(t,r){if(r){var n;if(a(t))return void 0===(n=r(t,e))?t:n;if(c(t))return rt(t,(function(t){return r(t,e)}));if(void 0===(n=r(t,e))){if(null===t)return t;throw Error("A case reducer on a non-draftable value must not return undefined")}return n}return t}),t)}return p.getInitialState=o,p}(n,(function(t){for(var e in s)t.addCase(e,s[e]);for(var r=0,n=i;n.length>r;r++){var o=n[r];t.addMatcher(o.matcher,o.reducer)}l&&t.addDefaultCase(l)}))}return Object.keys(o).forEach((function(t){var r,n,a=o[t],c=e+"/"+t;"reducer"in a?(r=a.reducer,n=a.prepare):r=a,i[t]=r,u[c]=r,f[t]=n?qt(c,n):qt(c)})),{name:e,reducer:function(t,e){return r||(r=l()),r(t,e)},actions:f,caseReducers:i,getInitialState:function(){return r||(r=l()),r.getInitialState()}}}var zt=["name","message","stack","code"],Lt=function(t,e){this.payload=t,this.meta=e},Ut=function(t,e){this.payload=t,this.meta=e},$t=function(t){if("object"==typeof t&&null!==t){for(var e={},r=0,n=zt;n.length>r;r++){var o=n[r];"string"==typeof t[o]&&(e[o]=t[o])}return e}return{message:t+""}};function Vt(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}!function(){function t(t,e,r){var n=qt(t+"/fulfilled",(function(t,e,r,n){return{payload:t,meta:kt(It({},n||{}),{arg:r,requestId:e,requestStatus:"fulfilled"})}})),o=qt(t+"/pending",(function(t,e,r){return{payload:void 0,meta:kt(It({},r||{}),{arg:e,requestId:t,requestStatus:"pending"})}})),i=qt(t+"/rejected",(function(t,e,n,o,i){return{payload:o,error:(r&&r.serializeError||$t)(t||"Rejected"),meta:kt(It({},i||{}),{arg:n,requestId:e,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==t?void 0:t.name),condition:"ConditionError"===(null==t?void 0:t.name)})}})),u="undefined"!=typeof AbortController?AbortController:function(){function t(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return t.prototype.abort=function(){},t}();return Object.assign((function(t){return function(a,c,f){var l,s=(null==r?void 0:r.idGenerator)?r.idGenerator(t):function(t){void 0===t&&(t=21);for(var e="",r=t;r--;)e+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return e}(),p=new u;function d(t){l=t,p.abort()}var y=function(){return u=this,y=null,v=function(){var u,y,v,h,b,g;return Pt(this,(function(m){switch(m.label){case 0:return m.trys.push([0,4,,5]),h=null==(u=null==r?void 0:r.condition)?void 0:u.call(r,t,{getState:c,extra:f}),null===(O=h)||"object"!=typeof O||"function"!=typeof O.then?[3,2]:[4,h];case 1:h=m.sent(),m.label=2;case 2:if(!1===h||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return b=new Promise((function(t,e){return p.signal.addEventListener("abort",(function(){return e({name:"AbortError",message:l||"Aborted"})}))})),a(o(s,t,null==(y=null==r?void 0:r.getPendingMeta)?void 0:y.call(r,{requestId:s,arg:t},{getState:c,extra:f}))),[4,Promise.race([b,Promise.resolve(e(t,{dispatch:a,getState:c,extra:f,requestId:s,signal:p.signal,abort:d,rejectWithValue:function(t,e){return new Lt(t,e)},fulfillWithValue:function(t,e){return new Ut(t,e)}})).then((function(e){if(e instanceof Lt)throw e;return e instanceof Ut?n(e.payload,s,t,e.meta):n(e,s,t)}))])];case 3:return v=m.sent(),[3,5];case 4:return g=m.sent(),v=g instanceof Lt?i(null,s,t,g.payload,g.meta):i(g,s,t),[3,5];case 5:return r&&!r.dispatchConditionRejection&&i.match(v)&&v.meta.condition||a(v),[2,v]}var O}))},new Promise((function(t,e){var r=function(t){try{o(v.next(t))}catch(t){e(t)}},n=function(t){try{o(v.throw(t))}catch(t){e(t)}},o=function(e){return e.done?t(e.value):Promise.resolve(e.value).then(r,n)};o((v=v.apply(u,y)).next())}));var u,y,v}();return Object.assign(y,{abort:d,requestId:s,arg:t,unwrap:function(){return y.then(Vt)}})}}),{pending:o,rejected:i,fulfilled:n,typePrefix:t})}t.withTypes=function(){return t}}();var Xt="listenerMiddleware";qt(Xt+"/add"),qt(Xt+"/removeAll"),qt(Xt+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:"undefined"!=typeof global?global:globalThis),function(){function t(t,e){var r=o[t];return r?r.enumerable=e:o[t]=r={configurable:!0,enumerable:e,get:function(){return Y.get(this[B],t)},set:function(e){Y.set(this[B],t,e)}},r}function e(t){for(var e=t.length-1;e>=0;e--){var o=t[e][B];if(!o.P)switch(o.i){case 5:n(o)&&N(o);break;case 4:r(o)&&N(o)}}}function r(t){for(var e=t.t,r=t.k,n=G(r),o=n.length-1;o>=0;o--){var i=n[o];if(i!==B){var u=e[i];if(void 0===u&&!s(e,i))return!0;var a=r[i],c=a&&a[B];if(c?c.t!==u:!d(a,u))return!0}}var f=!!e[B];return n.length!==G(e).length+(f?0:1)}function n(t){var e=t.k;if(e.length!==t.t.length)return!0;var r=Object.getOwnPropertyDescriptor(e,e.length-1);if(r&&!r.get)return!0;for(var n=0;e.length>n;n++)if(!e.hasOwnProperty(n))return!0;return!1}var o={};!function(t,e){Q[t]||(Q[t]=e)}("ES5",{J:function(e,r){var n=Array.isArray(e),o=function(e,r){if(e){for(var n=Array(r.length),o=0;r.length>o;o++)Object.defineProperty(n,""+o,t(o,!0));return n}var i=H(r);delete i[B];for(var u=G(i),a=0;u.length>a;a++){var c=u[a];i[c]=t(c,e||!!i[c].enumerable)}return Object.create(Object.getPrototypeOf(r),i)}(n,e),i={i:n?5:4,A:r?r.A:P(),P:!1,I:!1,D:{},l:r,t:e,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,B,{value:i,writable:!0}),o},S:function(t,r,o){o?a(r)&&r[B].A===t&&e(t.p):(t.u&&function t(e){if(e&&"object"==typeof e){var r=e[B];if(r){var o=r.t,i=r.k,u=r.D,a=r.i;if(4===a)f(i,(function(e){e!==B&&(void 0!==o[e]||s(o,e)?u[e]||t(i[e]):(u[e]=!0,N(r)))})),f(o,(function(t){void 0!==i[t]||s(i,t)||(u[t]=!1,N(r))}));else if(5===a){if(n(r)&&(N(r),u.length=!0),o.length>i.length)for(var c=i.length;o.length>c;c++)u[c]=!1;else for(var l=o.length;i.length>l;l++)u[l]=!0;for(var p=Math.min(i.length,o.length),d=0;p>d;d++)i.hasOwnProperty(d)||(u[d]=!0),void 0===u[d]&&t(i[d])}}}}(t.p[0]),e(t.p))},K:function(t){return 4===t.i?r(t):n(t)}})}();class Bt extends n.commandBases.CommandPublic{static setCommand(t){return this.command=t}static setController(t){this.controller=t}static getController(){return this.controller}static getName(){return this.command.name}apply(t={},e={}){return new(0,this.constructor)(t,e)}}class Jt extends i.default.managers().Commands{currentRoute={};constructor(t){super(),this.store=t}static getName(){return"Flow/Redux/Managers/Routes"}async to(t,e={}){return await super.run(t,e)}register(t,e){const r=t.map((t=>{const r=class extends Bt{};return r.setCommand(t),r.setController(e),r}));return super.register(r,e)}attachCurrent(t,e={}){super.attachCurrent(t,e)}}let Gt,Ht;function Qt(){return Gt||(Gt=new Jt(globalThis.$flow.redux.store),globalThis.$flow.redux.routes=Gt,Gt)}class Yt extends i.default.Controller{routes={};constructor(){super();const t=this.constructor.getSliceInitialState();Object.keys(t).length&&(this.slice=this.createSlice())}static getName(){return"Flow/Redux/Controller"}static getSliceInitialState(){return{}}initialize(){this.register(),this.setupHooks()}setupHooks(){}registerRoutes(){this.routes=Qt().register(Object.values(this.getRoutes()),this)}getCommands(){return super.getCommands()}getData(){return super.getData()}getInternal(){return super.getInternal()}getRoutes(){return{}}getReducers(){throw new n.errors.ForceMethod(this,"getReducers")}getSlice(){return this.slice}getState(){return Zt().getState()[this.getName()]}createSlice(){const t=this.constructor;return Kt({name:t.getName(),initialState:t.getSliceInitialState(),reducers:this.getReducers()})}}function Zt(){return Ht}const te=t=>r.useSelector(t);t.Controller=Yt,t.Routes=Jt,t.getRoutes=Qt,t.getStore=Zt,t.initStore=function(){const t=Object.values(i.default.managers().controllers.getAll()).filter((t=>t instanceof Yt)),e={},r=Object.values(t).map((t=>t.getSlice())).filter((t=>!!t));r.forEach((t=>{e[t.name]=t.reducer})),Ht=Ft({reducer:e}),globalThis.$flow.redux={store:Ht},Qt(),t.forEach((t=>t.registerRoutes()))},t.useController=function(t){return te((e=>e[t]))},t.useControllerProperty=function(t,e){return te((r=>r[t][e]))},t.useCurrentRoute=()=>{const t=e.useState(Qt().currentRoute),[r,n]=t;return{unsubscribe:Zt().subscribe((()=>{const t=Zt().getState()["Flow/Redux/Routes"];JSON.stringify(r.current)!==JSON.stringify(t.current)&&n(t)})),current:r}},Object.defineProperty(t,"__esModule",{value:!0})}));