UNPKG

ngrx-etc

Version:
3 lines (2 loc) 32.8 kB
import{createAction as t,on as r,createReducer as e}from"@ngrx/store";import{isDevMode as n}from"@angular/core";function o(){return(o=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t}).apply(this,arguments)}function i(){return u(t.apply(void 0,[].slice.call(arguments)))}function u(t){var r=function(){var r=t.apply(void 0,[].slice.call(arguments));return o({},r,{__correlationId:Date.now().toString()})};return function(t,r){Object.defineProperty(r,"type",{value:t,writable:!1})}(t.type,r),r}var c=function(t,r){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(t,r)};function s(t,r){function e(){this.constructor=t}c(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}function a(t){return"function"==typeof t}var f=!1,p={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){f=t},get useDeprecatedSynchronousErrorHandling(){return f}};function l(t){setTimeout(function(){throw t},0)}var h={closed:!0,next:function(t){},error:function(t){if(p.useDeprecatedSynchronousErrorHandling)throw t;l(t)},complete:function(){}},d=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}();function y(t){return null!==t&&"object"==typeof t}var v=function(){function t(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(t,r){return r+1+") "+t.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return t.prototype=Object.create(Error.prototype),t}(),b=function(){function t(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return t.prototype.unsubscribe=function(){var r;if(!this.closed){var e=this._parentOrParents,n=this._ctorUnsubscribe,o=this._unsubscribe,i=this._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,e instanceof t)e.remove(this);else if(null!==e)for(var u=0;u<e.length;++u)e[u].remove(this);if(a(o)){n&&(this._unsubscribe=void 0);try{o.call(this)}catch(t){r=t instanceof v?m(t.errors):[t]}}if(d(i)){u=-1;for(var c=i.length;++u<c;){var s=i[u];if(y(s))try{s.unsubscribe()}catch(t){r=r||[],t instanceof v?r=r.concat(m(t.errors)):r.push(t)}}}if(r)throw new v(r)}},t.prototype.add=function(r){var e=r;if(!r)return t.EMPTY;switch(typeof r){case"function":e=new t(r);case"object":if(e===this||e.closed||"function"!=typeof e.unsubscribe)return e;if(this.closed)return e.unsubscribe(),e;if(!(e instanceof t)){var n=e;(e=new t)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+r+" added to Subscription.")}var o=e._parentOrParents;if(null===o)e._parentOrParents=this;else if(o instanceof t){if(o===this)return e;e._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return e;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[e]:i.push(e),e},t.prototype.remove=function(t){var r=this._subscriptions;if(r){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}},t.EMPTY=function(t){return t.closed=!0,t}(new t),t}();function m(t){return t.reduce(function(t,r){return t.concat(r instanceof v?r.errors:r)},[])}var g=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),_=function(t){function r(e,n,o){var i=t.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=h;break;case 1:if(!e){i.destination=h;break}if("object"==typeof e){e instanceof r?(i.syncErrorThrowable=e.syncErrorThrowable,i.destination=e,e.add(i)):(i.syncErrorThrowable=!0,i.destination=new w(i,e));break}default:i.syncErrorThrowable=!0,i.destination=new w(i,e,n,o)}return i}return s(r,t),r.prototype[g]=function(){return this},r.create=function(t,e,n){var o=new r(t,e,n);return o.syncErrorThrowable=!1,o},r.prototype.next=function(t){this.isStopped||this._next(t)},r.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},r.prototype._next=function(t){this.destination.next(t)},r.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},r.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},r.prototype._unsubscribeAndRecycle=function(){var t=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=t,this},r}(b),w=function(t){function r(r,e,n,o){var i,u=t.call(this)||this;u._parentSubscriber=r;var c=u;return a(e)?i=e:e&&(i=e.next,n=e.error,o=e.complete,e!==h&&(a((c=Object.create(e)).unsubscribe)&&u.add(c.unsubscribe.bind(c)),c.unsubscribe=u.unsubscribe.bind(u))),u._context=c,u._next=i,u._error=n,u._complete=o,u}return s(r,t),r.prototype.next=function(t){if(!this.isStopped&&this._next){var r=this._parentSubscriber;p.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable?this.__tryOrSetError(r,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},r.prototype.error=function(t){if(!this.isStopped){var r=this._parentSubscriber,e=p.useDeprecatedSynchronousErrorHandling;if(this._error)e&&r.syncErrorThrowable?(this.__tryOrSetError(r,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else if(r.syncErrorThrowable)e?(r.syncErrorValue=t,r.syncErrorThrown=!0):l(t),this.unsubscribe();else{if(this.unsubscribe(),e)throw t;l(t)}}},r.prototype.complete=function(){var t=this;if(!this.isStopped){var r=this._parentSubscriber;if(this._complete){var e=function(){return t._complete.call(t._context)};p.useDeprecatedSynchronousErrorHandling&&r.syncErrorThrowable?(this.__tryOrSetError(r,e),this.unsubscribe()):(this.__tryOrUnsub(e),this.unsubscribe())}else this.unsubscribe()}},r.prototype.__tryOrUnsub=function(t,r){try{t.call(this._context,r)}catch(t){if(this.unsubscribe(),p.useDeprecatedSynchronousErrorHandling)throw t;l(t)}},r.prototype.__tryOrSetError=function(t,r,e){if(!p.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{r.call(this._context,e)}catch(r){return p.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=r,t.syncErrorThrown=!0,!0):(l(r),!0)}return!1},r.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},r}(_),O=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function P(t){return t}function E(t){return 0===t.length?P:1===t.length?t[0]:function(r){return t.reduce(function(t,r){return r(t)},r)}}var S=function(){function t(t){this._isScalar=!1,t&&(this._subscribe=t)}return t.prototype.lift=function(r){var e=new t;return e.source=this,e.operator=r,e},t.prototype.subscribe=function(t,r,e){var n=this.operator,o=function(t,r,e){if(t){if(t instanceof _)return t;if(t[g])return t[g]()}return t||r||e?new _(t,r,e):new _(h)}(t,r,e);if(o.add(n?n.call(o,this.source):this.source||p.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),p.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){p.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=r),function(t){for(;t;){var r=t.destination;if(t.closed||t.isStopped)return!1;t=r&&r instanceof _?r:null}return!0}(t)?t.error(r):console.warn(r)}},t.prototype.forEach=function(t,r){var e=this;return new(r=j(r))(function(r,n){var o;o=e.subscribe(function(r){try{t(r)}catch(t){n(t),o&&o.unsubscribe()}},n,r)})},t.prototype._subscribe=function(t){var r=this.source;return r&&r.subscribe(t)},t.prototype[O]=function(){return this},t.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return 0===t.length?this:E(t)(this)},t.prototype.toPromise=function(t){var r=this;return new(t=j(t))(function(t,e){var n;r.subscribe(function(t){return n=t},function(t){return e(t)},function(){return t(n)})})},t.create=function(r){return new t(r)},t}();function j(t){if(t||(t=Promise),!t)throw new Error("no Promise impl found");return t}function x(t){return t&&"function"==typeof t.schedule}var A=function(t){return function(r){for(var e=0,n=t.length;e<n&&!r.closed;e++)r.next(t[e]);r.complete()}};function D(t,r){return new S(function(e){var n=new b,o=0;return n.add(r.schedule(function(){o!==t.length?(e.next(t[o++]),e.closed||n.add(this.schedule())):e.complete()})),n})}function I(t,r){return r?D(t,r):new S(A(t))}function N(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=t[t.length-1];return x(e)?(t.pop(),D(t,e)):I(t)}function T(t,r){return function(e){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return e.lift(new k(t,r))}}var k=function(){function t(t,r){this.project=t,this.thisArg=r}return t.prototype.call=function(t,r){return r.subscribe(new M(t,this.project,this.thisArg))},t}(),M=function(t){function r(r,e,n){var o=t.call(this,r)||this;return o.project=e,o.count=0,o.thisArg=n||o,o}return s(r,t),r.prototype._next=function(t){var r;try{r=this.project.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}this.destination.next(r)},r}(_);function F(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var z=F(),C=function(t){if(t&&"function"==typeof t[O])return n=t,function(t){var r=n[O]();if("function"!=typeof r.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(t)};if(function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}(t))return A(t);if(function(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}(t))return e=t,function(t){return e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,l),t};if(t&&"function"==typeof t[z])return r=t,function(t){for(var e=r[z]();;){var n=void 0;try{n=e.next()}catch(r){return t.error(r),t}if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}return"function"==typeof e.return&&t.add(function(){e.return&&e.return()}),t};var r,e,n,o=y(t)?"an invalid object":"'"+t+"'";throw new TypeError("You provided "+o+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")},V=function(t){function r(r){var e=t.call(this)||this;return e.parent=r,e}return s(r,t),r.prototype._next=function(t){this.parent.notifyNext(t)},r.prototype._error=function(t){this.parent.notifyError(t),this.unsubscribe()},r.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},r}(_),H=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return s(r,t),r.prototype.notifyNext=function(t){this.destination.next(t)},r.prototype.notifyError=function(t){this.destination.error(t)},r.prototype.notifyComplete=function(){this.destination.complete()},r}(_);function R(t,r,e){return void 0===e&&(e=Number.POSITIVE_INFINITY),"function"==typeof r?function(n){return n.pipe(R(function(e,n){return(o=t(e,n),o instanceof S?o:new S(C(o))).pipe(T(function(t,o){return r(e,t,n,o)}));var o},e))}:("number"==typeof r&&(e=r),function(r){return r.lift(new U(t,e))})}var U=function(){function t(t,r){void 0===r&&(r=Number.POSITIVE_INFINITY),this.project=t,this.concurrent=r}return t.prototype.call=function(t,r){return r.subscribe(new K(t,this.project,this.concurrent))},t}(),K=function(t){function r(r,e,n){void 0===n&&(n=Number.POSITIVE_INFINITY);var o=t.call(this,r)||this;return o.project=e,o.concurrent=n,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return s(r,t),r.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},r.prototype._tryNext=function(t){var r,e=this.index++;try{r=this.project(t,e)}catch(t){return void this.destination.error(t)}this.active++,this._innerSub(r)},r.prototype._innerSub=function(t){var r=new V(this),e=this.destination;e.add(r);var n=function(t,r){if(!r.closed){if(t instanceof S)return t.subscribe(r);var e;try{e=C(t)(r)}catch(t){r.error(t)}return e}}(t,r);n!==r&&e.add(n)},r.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},r.prototype.notifyNext=function(t){this.destination.next(t)},r.prototype.notifyComplete=function(){var t=this.buffer;this.active--,t.length>0?this._next(t.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},r}(H),Y=function(){function t(t,r){this.predicate=t,this.thisArg=r}return t.prototype.call=function(t,r){return r.subscribe(new J(t,this.predicate,this.thisArg))},t}(),J=function(t){function r(r,e,n){var o=t.call(this,r)||this;return o.predicate=e,o.thisArg=n,o.count=0,o}return s(r,t),r.prototype._next=function(t){var r;try{r=this.predicate.call(this.thisArg,t,this.count++)}catch(t){return void this.destination.error(t)}r&&this.destination.next(t)},r}(_);function W(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function $(t,r,e){return t(e={path:r,exports:{},require:function(t,r){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},e.exports),e.exports}var q=$(function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.identity=function(t){return t}}),G=W($(function(t,r){function e(t){return 0===t.length?q.identity:1===t.length?t[0]:function(r){return t.reduce(function(t,r){return r(t)},r)}}Object.defineProperty(r,"__esModule",{value:!0}),r.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e(t)},r.pipeFromArray=e}));function X(){var t=[].slice.call(arguments);if(0===t.length)throw new TypeError("Expected operators, received nothing");return function(r){return r.pipe(R(function(r){return N(r).pipe(G.pipeFromArray(t),T(function(t){if(!L(r))return t;var e=o({},t,{__correlationId:r.__correlationId});return Q(r,e),e}))}))}}function B(t){return r=function(r){return r.__correlationId===t.__correlationId},function(t){return t.lift(new Y(r,void 0))};var r}function L(t){return t&&"__correlationId"in t}function Q(t,r){if(n()){var e=window._actionCorrelations||{};e[t.__correlationId]=(e[t.__correlationId]||[t]).concat(r),window._actionCorrelations=e}}function Z(t){for(var r=arguments.length,e=Array(r>1?r-1:0),n=1;n<r;n++)e[n-1]=arguments[n];if("production"!==process.env.NODE_ENV){var o=Gt[t],i=o?"function"==typeof o?o.apply(null,e):o:"unknown error nr: "+t;throw Error("[Immer] "+i)}throw Error("[Immer] minified error nr: "+t+(e.length?" "+e.map(function(t){return"'"+t+"'"}).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function tt(t){return!!t&&!!t[$t]}function rt(t){return!!t&&(function(t){if(!t||"object"!=typeof t)return!1;var r=Object.getPrototypeOf(t);if(null===r)return!0;var e=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return e===Object||"function"==typeof e&&Function.toString.call(e)===Xt}(t)||Array.isArray(t)||!!t[Wt]||!!t.constructor[Wt]||st(t)||at(t))}function et(t,r,e){void 0===e&&(e=!1),0===nt(t)?(e?Object.keys:Bt)(t).forEach(function(n){e&&"symbol"==typeof n||r(n,t[n],t)}):t.forEach(function(e,n){return r(n,e,t)})}function nt(t){var r=t[$t];return r?r.i>3?r.i-4:r.i:Array.isArray(t)?1:st(t)?2:at(t)?3:0}function ot(t,r){return 2===nt(t)?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function it(t,r){return 2===nt(t)?t.get(r):t[r]}function ut(t,r,e){var n=nt(t);2===n?t.set(r,e):3===n?(t.delete(r),t.add(e)):t[r]=e}function ct(t,r){return t===r?0!==t||1/t==1/r:t!=t&&r!=r}function st(t){return Ut&&t instanceof Map}function at(t){return Kt&&t instanceof Set}function ft(t){return t.o||t.t}function pt(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var r=Lt(t);delete r[$t];for(var e=Bt(r),n=0;n<e.length;n++){var o=e[n],i=r[o];!1===i.writable&&(i.writable=!0,i.configurable=!0),(i.get||i.set)&&(r[o]={configurable:!0,writable:!0,enumerable:i.enumerable,value:t[o]})}return Object.create(Object.getPrototypeOf(t),r)}function lt(t,r){return void 0===r&&(r=!1),dt(t)||tt(t)||!rt(t)||(nt(t)>1&&(t.set=t.add=t.clear=t.delete=ht),Object.freeze(t),r&&et(t,function(t,r){return lt(r,!0)},!0)),t}function ht(){Z(2)}function dt(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function yt(t){var r=Qt[t];return r||Z(18,t),r}function vt(t,r){Qt[t]||(Qt[t]=r)}function bt(){return"production"===process.env.NODE_ENV||Ht||Z(0),Ht}function mt(t,r){r&&(yt("Patches"),t.u=[],t.s=[],t.v=r)}function gt(t){_t(t),t.p.forEach(Ot),t.p=null}function _t(t){t===Ht&&(Ht=t.l)}function wt(t){return Ht={p:[],l:Ht,h:t,m:!0,_:0}}function Ot(t){var r=t[$t];0===r.i||1===r.i?r.j():r.O=!0}function Pt(t,r){r._=r.p.length;var e=r.p[0],n=void 0!==t&&t!==e;return r.h.g||yt("ES5").S(r,t,n),n?(e[$t].P&&(gt(r),Z(4)),rt(t)&&(t=Et(r,t),r.l||jt(r,t)),r.u&&yt("Patches").M(e[$t],t,r.u,r.s)):t=Et(r,e,[]),gt(r),r.u&&r.v(r.u,r.s),t!==Jt?t:void 0}function Et(t,r,e){if(dt(r))return r;var n=r[$t];if(!n)return et(r,function(o,i){return St(t,n,r,o,i,e)},!0),r;if(n.A!==t)return r;if(!n.P)return jt(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=pt(n.k):n.o;et(3===n.i?new Set(o):o,function(r,i){return St(t,n,o,r,i,e)}),jt(t,o,!1),e&&t.u&&yt("Patches").R(n,e,t.u,t.s)}return n.o}function St(t,r,e,n,o,i){if("production"!==process.env.NODE_ENV&&o===e&&Z(5),tt(o)){var u=Et(t,o,i&&r&&3!==r.i&&!ot(r.D,n)?i.concat(n):void 0);if(ut(e,n,u),!tt(u))return;t.m=!1}if(rt(o)&&!dt(o)){if(!t.h.F&&t._<1)return;Et(t,o),r&&r.A.l||jt(t,o)}}function jt(t,r,e){void 0===e&&(e=!1),t.h.F&&t.m&&lt(r,e)}function xt(t,r){var e=t[$t];return(e?ft(e):t)[r]}function At(t,r){if(r in t)for(var e=Object.getPrototypeOf(t);e;){var n=Object.getOwnPropertyDescriptor(e,r);if(n)return n;e=Object.getPrototypeOf(e)}}function Dt(t){t.P||(t.P=!0,t.l&&Dt(t.l))}function It(t){t.o||(t.o=pt(t.t))}function Nt(t,r,e){var n=st(r)?yt("MapSet").N(r,e):at(r)?yt("MapSet").T(r,e):t.g?function(t,r){var e=Array.isArray(t),n={i:e?1:0,A:r?r.A:bt(),P:!1,I:!1,D:{},l:r,t:t,k:null,o:null,j:null,C:!1},o=n,i=Zt;e&&(o=[n],i=tr);var u=Proxy.revocable(o,i),c=u.revoke,s=u.proxy;return n.k=s,n.j=c,s}(r,e):yt("ES5").J(r,e);return(e?e.A:bt()).p.push(n),n}function Tt(t){return tt(t)||Z(22,t),function t(r){if(!rt(r))return r;var e,n=r[$t],o=nt(r);if(n){if(!n.P&&(n.i<4||!yt("ES5").K(n)))return n.t;n.I=!0,e=kt(r,o),n.I=!1}else e=kt(r,o);return et(e,function(r,o){n&&it(n.t,r)===o||ut(e,r,t(o))}),3===o?new Set(e):e}(t)}function kt(t,r){switch(r){case 2:return new Map(t);case 3:return Array.from(t)}return pt(t)}function Mt(){function t(t,r){var e=i[t];return e?e.enumerable=r:i[t]=e={configurable:!0,enumerable:r,get:function(){var r=this[$t];return"production"!==process.env.NODE_ENV&&o(r),Zt.get(r,t)},set:function(r){var e=this[$t];"production"!==process.env.NODE_ENV&&o(e),Zt.set(e,t,r)}},e}function r(t){for(var r=t.length-1;r>=0;r--){var o=t[r][$t];if(!o.P)switch(o.i){case 5:n(o)&&Dt(o);break;case 4:e(o)&&Dt(o)}}}function e(t){for(var r=t.t,e=t.k,n=Bt(e),o=n.length-1;o>=0;o--){var i=n[o];if(i!==$t){var u=r[i];if(void 0===u&&!ot(r,i))return!0;var c=e[i],s=c&&c[$t];if(s?s.t!==u:!ct(c,u))return!0}}var a=!!r[$t];return n.length!==Bt(r).length+(a?0:1)}function n(t){var r=t.k;if(r.length!==t.t.length)return!0;var e=Object.getOwnPropertyDescriptor(r,r.length-1);return!(!e||e.get)}function o(t){t.O&&Z(3,JSON.stringify(ft(t)))}var i={};vt("ES5",{J:function(r,e){var n=Array.isArray(r),o=function(r,e){if(r){for(var n=Array(e.length),o=0;o<e.length;o++)Object.defineProperty(n,""+o,t(o,!0));return n}var i=Lt(e);delete i[$t];for(var u=Bt(i),c=0;c<u.length;c++){var s=u[c];i[s]=t(s,r||!!i[s].enumerable)}return Object.create(Object.getPrototypeOf(e),i)}(n,r),i={i:n?5:4,A:e?e.A:bt(),P:!1,I:!1,D:{},l:e,t:r,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,$t,{value:i,writable:!0}),o},S:function(t,e,o){o?tt(e)&&e[$t].A===t&&r(t.p):(t.u&&function t(r){if(r&&"object"==typeof r){var e=r[$t];if(e){var o=e.t,i=e.k,u=e.D,c=e.i;if(4===c)et(i,function(r){r!==$t&&(void 0!==o[r]||ot(o,r)?u[r]||t(i[r]):(u[r]=!0,Dt(e)))}),et(o,function(t){void 0!==i[t]||ot(i,t)||(u[t]=!1,Dt(e))});else if(5===c){if(n(e)&&(Dt(e),u.length=!0),i.length<o.length)for(var s=i.length;s<o.length;s++)u[s]=!1;else for(var a=o.length;a<i.length;a++)u[a]=!0;for(var f=Math.min(i.length,o.length),p=0;p<f;p++)void 0===u[p]&&t(i[p])}}}}(t.p[0]),r(t.p))},K:function(t){return 4===t.i?e(t):n(t)}})}function Ft(){function t(r){if(!rt(r))return r;if(Array.isArray(r))return r.map(t);if(st(r))return new Map(Array.from(r.entries()).map(function(r){return[r[0],t(r[1])]}));if(at(r))return new Set(Array.from(r).map(t));var e=Object.create(Object.getPrototypeOf(r));for(var n in r)e[n]=t(r[n]);return ot(r,Wt)&&(e[Wt]=r[Wt]),e}function r(r){return tt(r)?t(r):r}var e="add";vt("Patches",{$:function(r,n){return n.forEach(function(n){for(var o=n.path,i=n.op,u=r,c=0;c<o.length-1;c++){var s=nt(u),a=""+o[c];0!==s&&1!==s||"__proto__"!==a&&"constructor"!==a||Z(24),"function"==typeof u&&"prototype"===a&&Z(24),"object"!=typeof(u=it(u,a))&&Z(15,o.join("/"))}var f=nt(u),p=t(n.value),l=o[o.length-1];switch(i){case"replace":switch(f){case 2:return u.set(l,p);case 3:Z(16);default:return u[l]=p}case e:switch(f){case 1:return u.splice(l,0,p);case 2:return u.set(l,p);case 3:return u.add(p);default:return u[l]=p}case"remove":switch(f){case 1:return u.splice(l,1);case 2:return u.delete(l);case 3:return u.delete(n.value);default:return delete u[l]}default:Z(17,i)}}),r},R:function(t,n,o,i){switch(t.i){case 0:case 4:case 2:return function(t,n,o,i){var u=t.t,c=t.o;et(t.D,function(t,s){var a=it(u,t),f=it(c,t),p=s?ot(u,t)?"replace":e:"remove";if(a!==f||"replace"!==p){var l=n.concat(t);o.push("remove"===p?{op:p,path:l}:{op:p,path:l,value:f}),i.push(p===e?{op:"remove",path:l}:"remove"===p?{op:e,path:l,value:r(a)}:{op:"replace",path:l,value:r(a)})}})}(t,n,o,i);case 5:case 1:return function(t,n,o,i){var u=t.t,c=t.D,s=t.o;if(s.length<u.length){var a=[s,u];u=a[0],s=a[1];var f=[i,o];o=f[0],i=f[1]}for(var p=0;p<u.length;p++)if(c[p]&&s[p]!==u[p]){var l=n.concat([p]);o.push({op:"replace",path:l,value:r(s[p])}),i.push({op:"replace",path:l,value:r(u[p])})}for(var h=u.length;h<s.length;h++){var d=n.concat([h]);o.push({op:e,path:d,value:r(s[h])})}u.length<s.length&&i.push({op:"replace",path:n.concat(["length"]),value:u.length})}(t,n,o,i);case 3:return function(t,r,n,o){var i=t.t,u=t.o,c=0;i.forEach(function(t){if(!u.has(t)){var i=r.concat([c]);n.push({op:"remove",path:i,value:t}),o.unshift({op:e,path:i,value:t})}c++}),c=0,u.forEach(function(t){if(!i.has(t)){var u=r.concat([c]);n.push({op:e,path:u,value:t}),o.unshift({op:"remove",path:u,value:t})}c++})}(t,n,o,i)}},M:function(t,r,e,n){e.push({op:"replace",path:[],value:r===Jt?void 0:r}),n.push({op:"replace",path:[],value:t.t})}})}function zt(){function t(t,r){function e(){this.constructor=t}o(t,r),t.prototype=(e.prototype=r.prototype,new e)}function r(t){t.o||(t.D=new Map,t.o=new Map(t.t))}function e(t){t.o||(t.o=new Set,t.t.forEach(function(r){if(rt(r)){var e=Nt(t.A.h,r,t);t.p.set(r,e),t.o.add(e)}else t.o.add(r)}))}function n(t){t.O&&Z(3,JSON.stringify(ft(t)))}var o=function(t,r){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var e in r)r.hasOwnProperty(e)&&(t[e]=r[e])})(t,r)},i=function(){function e(t,r){return this[$t]={i:2,l:r,A:r?r.A:bt(),P:!1,I:!1,o:void 0,D:void 0,t:t,k:this,C:!1,O:!1},this}t(e,Map);var o=e.prototype;return Object.defineProperty(o,"size",{get:function(){return ft(this[$t]).size}}),o.has=function(t){return ft(this[$t]).has(t)},o.set=function(t,e){var o=this[$t];return n(o),ft(o).has(t)&&ft(o).get(t)===e||(r(o),Dt(o),o.D.set(t,!0),o.o.set(t,e),o.D.set(t,!0)),this},o.delete=function(t){if(!this.has(t))return!1;var e=this[$t];return n(e),r(e),Dt(e),e.D.set(t,!1),e.o.delete(t),!0},o.clear=function(){var t=this[$t];n(t),ft(t).size&&(r(t),Dt(t),t.D=new Map,et(t.t,function(r){t.D.set(r,!1)}),t.o.clear())},o.forEach=function(t,r){var e=this;ft(this[$t]).forEach(function(n,o){t.call(r,e.get(o),o,e)})},o.get=function(t){var e=this[$t];n(e);var o=ft(e).get(t);if(e.I||!rt(o))return o;if(o!==e.t.get(t))return o;var i=Nt(e.A.h,o,e);return r(e),e.o.set(t,i),i},o.keys=function(){return ft(this[$t]).keys()},o.values=function(){var t,r=this,e=this.keys();return(t={})[qt]=function(){return r.values()},t.next=function(){var t=e.next();return t.done?t:{done:!1,value:r.get(t.value)}},t},o.entries=function(){var t,r=this,e=this.keys();return(t={})[qt]=function(){return r.entries()},t.next=function(){var t=e.next();if(t.done)return t;var n=r.get(t.value);return{done:!1,value:[t.value,n]}},t},o[qt]=function(){return this.entries()},e}(),u=function(){function r(t,r){return this[$t]={i:3,l:r,A:r?r.A:bt(),P:!1,I:!1,o:void 0,t:t,k:this,p:new Map,O:!1,C:!1},this}t(r,Set);var o=r.prototype;return Object.defineProperty(o,"size",{get:function(){return ft(this[$t]).size}}),o.has=function(t){var r=this[$t];return n(r),r.o?!!r.o.has(t)||!(!r.p.has(t)||!r.o.has(r.p.get(t))):r.t.has(t)},o.add=function(t){var r=this[$t];return n(r),this.has(t)||(e(r),Dt(r),r.o.add(t)),this},o.delete=function(t){if(!this.has(t))return!1;var r=this[$t];return n(r),e(r),Dt(r),r.o.delete(t)||!!r.p.has(t)&&r.o.delete(r.p.get(t))},o.clear=function(){var t=this[$t];n(t),ft(t).size&&(e(t),Dt(t),t.o.clear())},o.values=function(){var t=this[$t];return n(t),e(t),t.o.values()},o.entries=function(){var t=this[$t];return n(t),e(t),t.o.entries()},o.keys=function(){return this.values()},o[qt]=function(){return this.values()},o.forEach=function(t,r){for(var e=this.values(),n=e.next();!n.done;)t.call(r,n.value,n.value,this),n=e.next()},r}();vt("MapSet",{N:function(t,r){return new i(t,r)},T:function(t,r){return new u(t,r)}})}function Ct(){Mt(),zt(),Ft()}var Vt,Ht,Rt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Ut="undefined"!=typeof Map,Kt="undefined"!=typeof Set,Yt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Jt=Rt?Symbol.for("immer-nothing"):((Vt={})["immer-nothing"]=!0,Vt),Wt=Rt?Symbol.for("immer-draftable"):"__$immer_draftable",$t=Rt?Symbol.for("immer-state"):"__$immer_state",qt="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Gt={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(t){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+t},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(t){return"Cannot apply patch, path doesn't resolve: "+t},16:'Sets cannot have "replace" patches.',17:function(t){return"Unsupported patch operation: "+t},18:function(t){return"The plugin for '"+t+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+t+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(t){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+t+"'"},22:function(t){return"'current' expects a draft, got: "+t},23:function(t){return"'original' expects a draft, got: "+t},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Xt=""+Object.prototype.constructor,Bt="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,Lt=Object.getOwnPropertyDescriptors||function(t){var r={};return Bt(t).forEach(function(e){r[e]=Object.getOwnPropertyDescriptor(t,e)}),r},Qt={},Zt={get:function(t,r){if(r===$t)return t;var e=ft(t);if(!ot(e,r))return function(t,r,e){var n,o=At(r,e);return o?"value"in o?o.value:null===(n=o.get)||void 0===n?void 0:n.call(t.k):void 0}(t,e,r);var n=e[r];return t.I||!rt(n)?n:n===xt(t.t,r)?(It(t),t.o[r]=Nt(t.A.h,n,t)):n},has:function(t,r){return r in ft(t)},ownKeys:function(t){return Reflect.ownKeys(ft(t))},set:function(t,r,e){var n=At(ft(t),r);if(null==n?void 0:n.set)return n.set.call(t.k,e),!0;if(!t.P){var o=xt(ft(t),r),i=null==o?void 0:o[$t];if(i&&i.t===e)return t.o[r]=e,t.D[r]=!1,!0;if(ct(e,o)&&(void 0!==e||ot(t.t,r)))return!0;It(t),Dt(t)}return t.o[r]===e&&"number"!=typeof e&&(void 0!==e||r in t.o)||(t.o[r]=e,t.D[r]=!0,!0)},deleteProperty:function(t,r){return void 0!==xt(t.t,r)||r in t.t?(t.D[r]=!1,It(t),Dt(t)):delete t.D[r],t.o&&delete t.o[r],!0},getOwnPropertyDescriptor:function(t,r){var e=ft(t),n=Reflect.getOwnPropertyDescriptor(e,r);return n?{writable:!0,configurable:1!==t.i||"length"!==r,enumerable:n.enumerable,value:e[r]}:n},defineProperty:function(){Z(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){Z(12)}},tr={};et(Zt,function(t,r){tr[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),tr.deleteProperty=function(t,r){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(r))&&Z(13),Zt.deleteProperty.call(this,t[0],r)},tr.set=function(t,r,e){return"production"!==process.env.NODE_ENV&&"length"!==r&&isNaN(parseInt(r))&&Z(14),Zt.set.call(this,t[0],r,e,t[0])};var rr=new(function(){function t(t){var r=this;this.g=Yt,this.F=!0,this.produce=function(t,e,n){if("function"==typeof t&&"function"!=typeof e){var o=e;e=t;var i=r;return function(t){var r=this;void 0===t&&(t=o);for(var n=arguments.length,u=Array(n>1?n-1:0),c=1;c<n;c++)u[c-1]=arguments[c];return i.produce(t,function(t){var n;return(n=e).call.apply(n,[r,t].concat(u))})}}var u;if("function"!=typeof e&&Z(6),void 0!==n&&"function"!=typeof n&&Z(7),rt(t)){var c=wt(r),s=Nt(r,t,void 0),a=!0;try{u=e(s),a=!1}finally{a?gt(c):_t(c)}return"undefined"!=typeof Promise&&u instanceof Promise?u.then(function(t){return mt(c,n),Pt(t,c)},function(t){throw gt(c),t}):(mt(c,n),Pt(u,c))}if(!t||"object"!=typeof t){if((u=e(t))===Jt)return;return void 0===u&&(u=t),r.F&&lt(u,!0),u}Z(21,t)},this.produceWithPatches=function(t,e){return"function"==typeof t?function(e){for(var n=arguments.length,o=Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];return r.produceWithPatches(e,function(r){return t.apply(void 0,[r].concat(o))})}:[r.produce(t,e,function(t,r){n=t,o=r}),n,o];var 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 r=t.prototype;return r.createDraft=function(t){rt(t)||Z(8),tt(t)&&(t=Tt(t));var r=wt(this),e=Nt(this,t,void 0);return e[$t].C=!0,_t(r),e},r.finishDraft=function(t,r){var e=t&&t[$t];"production"!==process.env.NODE_ENV&&(e&&e.C||Z(9),e.I&&Z(10));var n=e.A;return mt(n,r),Pt(void 0,n)},r.setAutoFreeze=function(t){this.F=t},r.setUseProxies=function(t){t&&!Yt&&Z(20),this.g=t},r.applyPatches=function(t,r){var e;for(e=r.length-1;e>=0;e--){var n=r[e];if(0===n.path.length&&"replace"===n.op){t=n.value;break}}var o=yt("Patches").$;return tt(t)?o(t,r):this.produce(t,function(t){return o(t,r.slice(e+1))})},t}()),er=rr.produce;function nr(t){return(r,e)=>er(r,r=>t(r,e))}function or(...t){const e=t.pop();return r(...t,nr(e))}function ir(t,...r){const n=e(t,...r);return function(r=t,e){return nr(n)(r,e)}}rr.produceWithPatches.bind(rr),rr.setAutoFreeze.bind(rr),rr.setUseProxies.bind(rr),rr.applyPatches.bind(rr),rr.createDraft.bind(rr),rr.finishDraft.bind(rr);export{X as correlate,u as correlateAction,i as createActionWithCorrelation,ir as createMutableReducer,Ct as enableAllPlugins,Mt as enableES5,zt as enableMapSet,Ft as enablePatches,or as mutableOn,B as withSameCorrelationAs}; //# sourceMappingURL=ngrx-etc.esm.js.map