ngrx-etc
Version:
Utilities for NgRx
3 lines (2 loc) • 32.7 kB
JavaScript
var t=require("@ngrx/store"),r=require("@angular/core");function e(){return(e=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 n(t){var r=function(){var r=t.apply(void 0,[].slice.call(arguments));return e({},r,{__correlationId:Date.now().toString()})};return function(t,r){Object.defineProperty(r,"type",{value:t,writable:!1})}(t.type,r),r}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)};function i(t,r){function e(){this.constructor=t}o(t,r),t.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}function u(t){return"function"==typeof t}var c=!1,s={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){c=t},get useDeprecatedSynchronousErrorHandling(){return c}};function a(t){setTimeout(function(){throw t},0)}var f={closed:!0,next:function(t){},error:function(t){if(s.useDeprecatedSynchronousErrorHandling)throw t;a(t)},complete:function(){}},p=function(){return Array.isArray||function(t){return t&&"number"==typeof t.length}}();function l(t){return null!==t&&"object"==typeof t}var h=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}(),d=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 c=0;c<e.length;++c)e[c].remove(this);if(u(o)){n&&(this._unsubscribe=void 0);try{o.call(this)}catch(t){r=t instanceof h?y(t.errors):[t]}}if(p(i)){c=-1;for(var s=i.length;++c<s;){var a=i[c];if(l(a))try{a.unsubscribe()}catch(t){r=r||[],t instanceof h?r=r.concat(y(t.errors)):r.push(t)}}}if(r)throw new h(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 y(t){return t.reduce(function(t,r){return t.concat(r instanceof h?r.errors:r)},[])}var v=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),b=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=f;break;case 1:if(!e){i.destination=f;break}if("object"==typeof e){e instanceof r?(i.syncErrorThrowable=e.syncErrorThrowable,i.destination=e,e.add(i)):(i.syncErrorThrowable=!0,i.destination=new g(i,e));break}default:i.syncErrorThrowable=!0,i.destination=new g(i,e,n,o)}return i}return i(r,t),r.prototype[v]=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}(d),g=function(t){function r(r,e,n,o){var i,c=t.call(this)||this;c._parentSubscriber=r;var s=c;return u(e)?i=e:e&&(i=e.next,n=e.error,o=e.complete,e!==f&&(u((s=Object.create(e)).unsubscribe)&&c.add(s.unsubscribe.bind(s)),s.unsubscribe=c.unsubscribe.bind(c))),c._context=s,c._next=i,c._error=n,c._complete=o,c}return i(r,t),r.prototype.next=function(t){if(!this.isStopped&&this._next){var r=this._parentSubscriber;s.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=s.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):a(t),this.unsubscribe();else{if(this.unsubscribe(),e)throw t;a(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)};s.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(),s.useDeprecatedSynchronousErrorHandling)throw t;a(t)}},r.prototype.__tryOrSetError=function(t,r,e){if(!s.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{r.call(this._context,e)}catch(r){return s.useDeprecatedSynchronousErrorHandling?(t.syncErrorValue=r,t.syncErrorThrown=!0,!0):(a(r),!0)}return!1},r.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},r}(b),m=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function _(t){return t}function w(t){return 0===t.length?_:1===t.length?t[0]:function(r){return t.reduce(function(t,r){return r(t)},r)}}var O=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 b)return t;if(t[v])return t[v]()}return t||r||e?new b(t,r,e):new b(f)}(t,r,e);if(o.add(n?n.call(o,this.source):this.source||s.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),s.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){s.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 b?r:null}return!0}(t)?t.error(r):console.warn(r)}},t.prototype.forEach=function(t,r){var e=this;return new(r=P(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[m]=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:w(t)(this)},t.prototype.toPromise=function(t){var r=this;return new(t=P(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 P(t){if(t||(t=Promise),!t)throw new Error("no Promise impl found");return t}function E(t){return t&&"function"==typeof t.schedule}var S=function(t){return function(r){for(var e=0,n=t.length;e<n&&!r.closed;e++)r.next(t[e]);r.complete()}};function x(t,r){return new O(function(e){var n=new d,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 j(t,r){return r?x(t,r):new O(S(t))}function A(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=t[t.length-1];return E(e)?(t.pop(),x(t,e)):j(t)}function D(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 I(t,r))}}var I=function(){function t(t,r){this.project=t,this.thisArg=r}return t.prototype.call=function(t,r){return r.subscribe(new N(t,this.project,this.thisArg))},t}(),N=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 i(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}(b);function T(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var k=T(),M=function(t){if(t&&"function"==typeof t[m])return n=t,function(t){var r=n[m]();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 S(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,a),t};if(t&&"function"==typeof t[k])return r=t,function(t){for(var e=r[k]();;){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=l(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.")},F=function(t){function r(r){var e=t.call(this)||this;return e.parent=r,e}return i(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}(b),C=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return i(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}(b);function z(t,r,e){return void 0===e&&(e=Number.POSITIVE_INFINITY),"function"==typeof r?function(n){return n.pipe(z(function(e,n){return(o=t(e,n),o instanceof O?o:new O(M(o))).pipe(D(function(t,o){return r(e,t,n,o)}));var o},e))}:("number"==typeof r&&(e=r),function(r){return r.lift(new V(t,e))})}var V=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 H(t,this.project,this.concurrent))},t}(),H=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 i(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 F(this),e=this.destination;e.add(r);var n=function(t,r){if(!r.closed){if(t instanceof O)return t.subscribe(r);var e;try{e=M(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}(C),R=function(){function t(t,r){this.predicate=t,this.thisArg=r}return t.prototype.call=function(t,r){return r.subscribe(new U(t,this.predicate,this.thisArg))},t}(),U=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 i(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}(b);function K(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Y(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 W=Y(function(t,r){Object.defineProperty(r,"__esModule",{value:!0}),r.identity=function(t){return t}}),q=K(Y(function(t,r){function e(t){return 0===t.length?W.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 J(t){return t&&"__correlationId"in t}function $(t,e){if(r.isDevMode()){var n=window._actionCorrelations||{};n[t.__correlationId]=(n[t.__correlationId]||[t]).concat(e),window._actionCorrelations=n}}function G(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=Kt[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 X(t){return!!t&&!!t[Rt]}function B(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)===Yt}(t)||Array.isArray(t)||!!t[Ht]||!!t.constructor[Ht]||nt(t)||ot(t))}function L(t,r,e){void 0===e&&(e=!1),0===Q(t)?(e?Object.keys:Wt)(t).forEach(function(n){e&&"symbol"==typeof n||r(n,t[n],t)}):t.forEach(function(e,n){return r(n,e,t)})}function Q(t){var r=t[Rt];return r?r.i>3?r.i-4:r.i:Array.isArray(t)?1:nt(t)?2:ot(t)?3:0}function Z(t,r){return 2===Q(t)?t.has(r):Object.prototype.hasOwnProperty.call(t,r)}function tt(t,r){return 2===Q(t)?t.get(r):t[r]}function rt(t,r,e){var n=Q(t);2===n?t.set(r,e):3===n?(t.delete(r),t.add(e)):t[r]=e}function et(t,r){return t===r?0!==t||1/t==1/r:t!=t&&r!=r}function nt(t){return Ft&&t instanceof Map}function ot(t){return Ct&&t instanceof Set}function it(t){return t.o||t.t}function ut(t){if(Array.isArray(t))return Array.prototype.slice.call(t);var r=qt(t);delete r[Rt];for(var e=Wt(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 ct(t,r){return void 0===r&&(r=!1),at(t)||X(t)||!B(t)||(Q(t)>1&&(t.set=t.add=t.clear=t.delete=st),Object.freeze(t),r&&L(t,function(t,r){return ct(r,!0)},!0)),t}function st(){G(2)}function at(t){return null==t||"object"!=typeof t||Object.isFrozen(t)}function ft(t){var r=Jt[t];return r||G(18,t),r}function pt(t,r){Jt[t]||(Jt[t]=r)}function lt(){return"production"===process.env.NODE_ENV||kt||G(0),kt}function ht(t,r){r&&(ft("Patches"),t.u=[],t.s=[],t.v=r)}function dt(t){yt(t),t.p.forEach(bt),t.p=null}function yt(t){t===kt&&(kt=t.l)}function vt(t){return kt={p:[],l:kt,h:t,m:!0,_:0}}function bt(t){var r=t[Rt];0===r.i||1===r.i?r.j():r.O=!0}function gt(t,r){r._=r.p.length;var e=r.p[0],n=void 0!==t&&t!==e;return r.h.g||ft("ES5").S(r,t,n),n?(e[Rt].P&&(dt(r),G(4)),B(t)&&(t=mt(r,t),r.l||wt(r,t)),r.u&&ft("Patches").M(e[Rt],t,r.u,r.s)):t=mt(r,e,[]),dt(r),r.u&&r.v(r.u,r.s),t!==Vt?t:void 0}function mt(t,r,e){if(at(r))return r;var n=r[Rt];if(!n)return L(r,function(o,i){return _t(t,n,r,o,i,e)},!0),r;if(n.A!==t)return r;if(!n.P)return wt(t,n.t,!0),n.t;if(!n.I){n.I=!0,n.A._--;var o=4===n.i||5===n.i?n.o=ut(n.k):n.o;L(3===n.i?new Set(o):o,function(r,i){return _t(t,n,o,r,i,e)}),wt(t,o,!1),e&&t.u&&ft("Patches").R(n,e,t.u,t.s)}return n.o}function _t(t,r,e,n,o,i){if("production"!==process.env.NODE_ENV&&o===e&&G(5),X(o)){var u=mt(t,o,i&&r&&3!==r.i&&!Z(r.D,n)?i.concat(n):void 0);if(rt(e,n,u),!X(u))return;t.m=!1}if(B(o)&&!at(o)){if(!t.h.F&&t._<1)return;mt(t,o),r&&r.A.l||wt(t,o)}}function wt(t,r,e){void 0===e&&(e=!1),t.h.F&&t.m&&ct(r,e)}function Ot(t,r){var e=t[Rt];return(e?it(e):t)[r]}function Pt(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 Et(t){t.P||(t.P=!0,t.l&&Et(t.l))}function St(t){t.o||(t.o=ut(t.t))}function xt(t,r,e){var n=nt(r)?ft("MapSet").N(r,e):ot(r)?ft("MapSet").T(r,e):t.g?function(t,r){var e=Array.isArray(t),n={i:e?1:0,A:r?r.A:lt(),P:!1,I:!1,D:{},l:r,t:t,k:null,o:null,j:null,C:!1},o=n,i=$t;e&&(o=[n],i=Gt);var u=Proxy.revocable(o,i),c=u.revoke,s=u.proxy;return n.k=s,n.j=c,s}(r,e):ft("ES5").J(r,e);return(e?e.A:lt()).p.push(n),n}function jt(t){return X(t)||G(22,t),function t(r){if(!B(r))return r;var e,n=r[Rt],o=Q(r);if(n){if(!n.P&&(n.i<4||!ft("ES5").K(n)))return n.t;n.I=!0,e=At(r,o),n.I=!1}else e=At(r,o);return L(e,function(r,o){n&&tt(n.t,r)===o||rt(e,r,t(o))}),3===o?new Set(e):e}(t)}function At(t,r){switch(r){case 2:return new Map(t);case 3:return Array.from(t)}return ut(t)}function Dt(){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[Rt];return"production"!==process.env.NODE_ENV&&o(r),$t.get(r,t)},set:function(r){var e=this[Rt];"production"!==process.env.NODE_ENV&&o(e),$t.set(e,t,r)}},e}function r(t){for(var r=t.length-1;r>=0;r--){var o=t[r][Rt];if(!o.P)switch(o.i){case 5:n(o)&&Et(o);break;case 4:e(o)&&Et(o)}}}function e(t){for(var r=t.t,e=t.k,n=Wt(e),o=n.length-1;o>=0;o--){var i=n[o];if(i!==Rt){var u=r[i];if(void 0===u&&!Z(r,i))return!0;var c=e[i],s=c&&c[Rt];if(s?s.t!==u:!et(c,u))return!0}}var a=!!r[Rt];return n.length!==Wt(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&&G(3,JSON.stringify(it(t)))}var i={};pt("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=qt(e);delete i[Rt];for(var u=Wt(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:lt(),P:!1,I:!1,D:{},l:e,t:r,k:o,o:null,O:!1,C:!1};return Object.defineProperty(o,Rt,{value:i,writable:!0}),o},S:function(t,e,o){o?X(e)&&e[Rt].A===t&&r(t.p):(t.u&&function t(r){if(r&&"object"==typeof r){var e=r[Rt];if(e){var o=e.t,i=e.k,u=e.D,c=e.i;if(4===c)L(i,function(r){r!==Rt&&(void 0!==o[r]||Z(o,r)?u[r]||t(i[r]):(u[r]=!0,Et(e)))}),L(o,function(t){void 0!==i[t]||Z(i,t)||(u[t]=!1,Et(e))});else if(5===c){if(n(e)&&(Et(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 It(){function t(r){if(!B(r))return r;if(Array.isArray(r))return r.map(t);if(nt(r))return new Map(Array.from(r.entries()).map(function(r){return[r[0],t(r[1])]}));if(ot(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 Z(r,Ht)&&(e[Ht]=r[Ht]),e}function r(r){return X(r)?t(r):r}var e="add";pt("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=Q(u),a=""+o[c];0!==s&&1!==s||"__proto__"!==a&&"constructor"!==a||G(24),"function"==typeof u&&"prototype"===a&&G(24),"object"!=typeof(u=tt(u,a))&&G(15,o.join("/"))}var f=Q(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:G(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:G(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;L(t.D,function(t,s){var a=tt(u,t),f=tt(c,t),p=s?Z(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===Vt?void 0:r}),n.push({op:"replace",path:[],value:t.t})}})}function Nt(){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(B(r)){var e=xt(t.A.h,r,t);t.p.set(r,e),t.o.add(e)}else t.o.add(r)}))}function n(t){t.O&&G(3,JSON.stringify(it(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[Rt]={i:2,l:r,A:r?r.A:lt(),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 it(this[Rt]).size}}),o.has=function(t){return it(this[Rt]).has(t)},o.set=function(t,e){var o=this[Rt];return n(o),it(o).has(t)&&it(o).get(t)===e||(r(o),Et(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[Rt];return n(e),r(e),Et(e),e.D.set(t,!1),e.o.delete(t),!0},o.clear=function(){var t=this[Rt];n(t),it(t).size&&(r(t),Et(t),t.D=new Map,L(t.t,function(r){t.D.set(r,!1)}),t.o.clear())},o.forEach=function(t,r){var e=this;it(this[Rt]).forEach(function(n,o){t.call(r,e.get(o),o,e)})},o.get=function(t){var e=this[Rt];n(e);var o=it(e).get(t);if(e.I||!B(o))return o;if(o!==e.t.get(t))return o;var i=xt(e.A.h,o,e);return r(e),e.o.set(t,i),i},o.keys=function(){return it(this[Rt]).keys()},o.values=function(){var t,r=this,e=this.keys();return(t={})[Ut]=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={})[Ut]=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[Ut]=function(){return this.entries()},e}(),u=function(){function r(t,r){return this[Rt]={i:3,l:r,A:r?r.A:lt(),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 it(this[Rt]).size}}),o.has=function(t){var r=this[Rt];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[Rt];return n(r),this.has(t)||(e(r),Et(r),r.o.add(t)),this},o.delete=function(t){if(!this.has(t))return!1;var r=this[Rt];return n(r),e(r),Et(r),r.o.delete(t)||!!r.p.has(t)&&r.o.delete(r.p.get(t))},o.clear=function(){var t=this[Rt];n(t),it(t).size&&(e(t),Et(t),t.o.clear())},o.values=function(){var t=this[Rt];return n(t),e(t),t.o.values()},o.entries=function(){var t=this[Rt];return n(t),e(t),t.o.entries()},o.keys=function(){return this.values()},o[Ut]=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}();pt("MapSet",{N:function(t,r){return new i(t,r)},T:function(t,r){return new u(t,r)}})}var Tt,kt,Mt="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Ft="undefined"!=typeof Map,Ct="undefined"!=typeof Set,zt="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Vt=Mt?Symbol.for("immer-nothing"):((Tt={})["immer-nothing"]=!0,Tt),Ht=Mt?Symbol.for("immer-draftable"):"__$immer_draftable",Rt=Mt?Symbol.for("immer-state"):"__$immer_state",Ut="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Kt={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"},Yt=""+Object.prototype.constructor,Wt="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:Object.getOwnPropertyNames,qt=Object.getOwnPropertyDescriptors||function(t){var r={};return Wt(t).forEach(function(e){r[e]=Object.getOwnPropertyDescriptor(t,e)}),r},Jt={},$t={get:function(t,r){if(r===Rt)return t;var e=it(t);if(!Z(e,r))return function(t,r,e){var n,o=Pt(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||!B(n)?n:n===Ot(t.t,r)?(St(t),t.o[r]=xt(t.A.h,n,t)):n},has:function(t,r){return r in it(t)},ownKeys:function(t){return Reflect.ownKeys(it(t))},set:function(t,r,e){var n=Pt(it(t),r);if(null==n?void 0:n.set)return n.set.call(t.k,e),!0;if(!t.P){var o=Ot(it(t),r),i=null==o?void 0:o[Rt];if(i&&i.t===e)return t.o[r]=e,t.D[r]=!1,!0;if(et(e,o)&&(void 0!==e||Z(t.t,r)))return!0;St(t),Et(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!==Ot(t.t,r)||r in t.t?(t.D[r]=!1,St(t),Et(t)):delete t.D[r],t.o&&delete t.o[r],!0},getOwnPropertyDescriptor:function(t,r){var e=it(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(){G(11)},getPrototypeOf:function(t){return Object.getPrototypeOf(t.t)},setPrototypeOf:function(){G(12)}},Gt={};L($t,function(t,r){Gt[t]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}}),Gt.deleteProperty=function(t,r){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(r))&&G(13),$t.deleteProperty.call(this,t[0],r)},Gt.set=function(t,r,e){return"production"!==process.env.NODE_ENV&&"length"!==r&&isNaN(parseInt(r))&&G(14),$t.set.call(this,t[0],r,e,t[0])};var Xt=new(function(){function t(t){var r=this;this.g=zt,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&&G(6),void 0!==n&&"function"!=typeof n&&G(7),B(t)){var c=vt(r),s=xt(r,t,void 0),a=!0;try{u=e(s),a=!1}finally{a?dt(c):yt(c)}return"undefined"!=typeof Promise&&u instanceof Promise?u.then(function(t){return ht(c,n),gt(t,c)},function(t){throw dt(c),t}):(ht(c,n),gt(u,c))}if(!t||"object"!=typeof t){if((u=e(t))===Vt)return;return void 0===u&&(u=t),r.F&&ct(u,!0),u}G(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){B(t)||G(8),X(t)&&(t=jt(t));var r=vt(this),e=xt(this,t,void 0);return e[Rt].C=!0,yt(r),e},r.finishDraft=function(t,r){var e=t&&t[Rt];"production"!==process.env.NODE_ENV&&(e&&e.C||G(9),e.I&&G(10));var n=e.A;return ht(n,r),gt(void 0,n)},r.setAutoFreeze=function(t){this.F=t},r.setUseProxies=function(t){t&&!zt&&G(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=ft("Patches").$;return X(t)?o(t,r):this.produce(t,function(t){return o(t,r.slice(e+1))})},t}()),Bt=Xt.produce;function Lt(t){return(r,e)=>Bt(r,r=>t(r,e))}Xt.produceWithPatches.bind(Xt),Xt.setAutoFreeze.bind(Xt),Xt.setUseProxies.bind(Xt),Xt.applyPatches.bind(Xt),Xt.createDraft.bind(Xt),Xt.finishDraft.bind(Xt),exports.correlate=function(){var t=[].slice.call(arguments);if(0===t.length)throw new TypeError("Expected operators, received nothing");return function(r){return r.pipe(z(function(r){return A(r).pipe(q.pipeFromArray(t),D(function(t){if(!J(r))return t;var n=e({},t,{__correlationId:r.__correlationId});return $(r,n),n}))}))}},exports.correlateAction=n,exports.createActionWithCorrelation=function(){return n(t.createAction.apply(void 0,[].slice.call(arguments)))},exports.createMutableReducer=function(r,...e){const n=t.createReducer(r,...e);return function(t=r,e){return Lt(n)(t,e)}},exports.enableAllPlugins=function(){Dt(),Nt(),It()},exports.enableES5=Dt,exports.enableMapSet=Nt,exports.enablePatches=It,exports.mutableOn=function(...r){const e=r.pop();return t.on(...r,Lt(e))},exports.withSameCorrelationAs=function(t){return r=function(r){return r.__correlationId===t.__correlationId},function(t){return t.lift(new R(r,void 0))};var r};
//# sourceMappingURL=ngrx-etc.js.map