@brigad/redux-rest-easy
Advanced tools
Comparing version 2.8.1 to 2.8.2
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-redux")):"function"==typeof define&&define.amd?define(["exports","react","react-redux"],t):t(e.ReduxRestEasy={},e.React,e.ReactRedux)}(this,function(e,t,r){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e,t){return e(t={exports:{}},t.exports),t.exports}o(function(e){!function(t){var r,n=Object.prototype,o=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag",s=t.regeneratorRuntime;if(s)e.exports=s;else{(s=t.regeneratorRuntime=e.exports).wrap=b;var f="suspendedStart",l="suspendedYield",d="executing",p="completed",h={},y={};y[i]=function(){return this};var v=Object.getPrototypeOf,g=v&&v(v(R([])));g&&g!==n&&o.call(g,i)&&(y=g);var m=E.prototype=_.prototype=Object.create(y);j.prototype=m.constructor=E,E.constructor=j,E[c]=j.displayName="GeneratorFunction",s.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===j||"GeneratorFunction"===(t.displayName||t.name))},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(m),e},s.awrap=function(e){return{__await:e}},O(w.prototype),w.prototype[u]=function(){return this},s.AsyncIterator=w,s.async=function(e,t,r,n){var o=new w(b(e,t,r,n));return s.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},O(m),m[c]="Generator",m[i]=function(){return this},m.toString=function(){return"[object Generator]"},s.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},s.values=R,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(I),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return u.type="throw",u.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],u=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=o.call(i,"catchLoc"),s=o.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(this.prev>=n.tryLoc&&o.call(n,"finallyLoc")&&n.finallyLoc>this.prev){var a=n;break}}!a||"break"!==e&&"continue"!==e||a.tryLoc>t||t>a.finallyLoc||(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),h}}}function b(e,t,r,n){var o=Object.create((t&&t.prototype instanceof _?t:_).prototype),a=new S(n||[]);return o._invoke=function(e,t,r){var n=f;return function(o,a){if(n===d)throw Error("Generator is already running");if(n===p){if("throw"===o)throw a;return q()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=C(i,r);if(u){if(u===h)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var c=A(e,t,r);if("normal"===c.type){if(n=r.done?p:l,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=p,r.method="throw",r.arg=c.arg)}}}(e,r,a),o}function A(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function _(){}function j(){}function E(){}function O(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function w(e){var t;this._invoke=function(r,n){function a(){return new Promise(function(t,a){!function t(r,n,a,i){var u=A(e[r],e,n);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==typeof s&&o.call(s,"__await")?Promise.resolve(s.__await).then(function(e){t("next",e,a,i)},function(e){t("throw",e,a,i)}):Promise.resolve(s).then(function(e){c.value=e,a(c)},i)}i(u.arg)}(r,n,t,a)})}return t=t?t.then(a,a):a()}}function C(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=r,C(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=A(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,h):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function R(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=r,t.done=!0,t};return a.next=a}}return{next:q}}function q(){return{value:r,done:!0}}}(function(){return this}()||Function("return this")())});var a,i,u,c,s=o(function(e,t){var r,n,o,a,i,u,c,s;e.exports=(r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o=Object.defineProperty,a=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,s=(c=Object.getPrototypeOf)&&c(Object),function e(t,f,l){if("string"!=typeof f){if(s){var d=c(f);d&&d!==s&&e(t,d,l)}var p=a(f);i&&(p=p.concat(i(f)));for(var h=0;p.length>h;++h){var y=p[h];if(!(r[y]||n[y]||l&&l[y])){var v=u(f,y);try{o(t,y,v)}catch(e){}}}return t}return t})}),f=function(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){return function n(o,a){try{var i=t[o](a),u=i.value}catch(e){return void r(e)}if(!i.done)return Promise.resolve(u).then(function(e){n("next",e)},function(e){n("throw",e)});e(u)}("next")})}},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},d=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},h=function(e){return function(t,n){for(var o=arguments.length,a=Array(o>2?o-2:0),i=2;o>i;i++)a[i-2]=arguments[i];return r.connect.apply(void 0,[t,n&&"function"==typeof n?function(){var t=n.apply(void 0,arguments);return Object.keys(t).reduce(function(r,n){var o;return d({},r,((o={})[n]=function(){var r=t[n].apply(t,arguments);return r&&r.__actionName&&r.__requestURL&&(e(r.__actionName,r.__requestURL),delete r.__actionName,delete r.__requestURL),r},o))},{})}:n].concat(a))}},y=function(e,t){return function(r){return{type:e,resourceName:t,resourceId:r}}},v=function(e,t,r){return"@@rest-easy/"+e+"/"+t+"/"+r.toUpperCase()},g=function(e){var t=function(e){return{INVALIDATE_RESOURCE:v(e,"@invalidate","INVALIDATE_RESOURCE"),INVALIDATE_ID:v(e,"@invalidate","INVALIDATE_ID"),RESET_RESOURCE:v(e,"@reset","RESET_RESOURCE")}}(e),r=t.INVALIDATE_ID,n=t.RESET_RESOURCE;return{resource:{invalidate:y(t.INVALIDATE_RESOURCE,e),invalidateId:y(r,e),reset:y(n,e)}}},m=function(e,t){return function(r,n,o,a,i){return{type:t,url:r,resourceId:n,payload:o&&Object.keys(o).length?o:void 0,metadata:a,principalResourceIds:"string"==typeof i?[i]:i,cacheLifetime:e}}},b=function(e,t,r){var n=function(e,t){return{REQUEST:v(e,t,"REQUEST"),RECEIVE:v(e,t,"RECEIVE"),FAIL:v(e,t,"FAIL"),RECEIVE_FROM_CACHE:v(e,t,"RECEIVE_FROM_CACHE")}}(e,t),o=n.RECEIVE,a=n.FAIL,i=n.RECEIVE_FROM_CACHE;return{REQUEST:m(r,n.REQUEST),RECEIVE:m(r,o),FAIL:m(r,a),RECEIVE_FROM_CACHE:m(r,i)}},A={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},_=function(e){throw{name:"SyntaxError",message:e,at:a,text:u}},j=function(e){return e&&e!==i&&_("Expected '"+e+"' instead of '"+i+"'"),i=u.charAt(a),a+=1,i},E=function(){var e,t="";for("-"===i&&(t="-",j("-"));i>="0"&&"9">=i;)t+=i,j();if("."===i)for(t+=".";j()&&i>="0"&&"9">=i;)t+=i;if("e"===i||"E"===i)for(t+=i,j(),"-"!==i&&"+"!==i||(t+=i,j());i>="0"&&"9">=i;)t+=i,j();if(isFinite(e=+t))return e;_("Bad number")},O=function(){var e,t,r,n="";if('"'===i)for(;j();){if('"'===i)return j(),n;if("\\"===i)if(j(),"u"===i){for(r=0,t=0;4>t&&(e=parseInt(j(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof A[i])break;n+=A[i]}else n+=i}_("Bad string")},w=function(){for(;i&&" ">=i;)j()};c=function(){switch(w(),i){case"{":return function(){var e,t={};if("{"===i){if(j("{"),w(),"}"===i)return j("}"),t;for(;i;){if(e=O(),w(),j(":"),Object.hasOwnProperty.call(t,e)&&_('Duplicate key "'+e+'"'),t[e]=c(),w(),"}"===i)return j("}"),t;j(","),w()}}_("Bad object")}();case"[":return function(){var e=[];if("["===i){if(j("["),w(),"]"===i)return j("]"),e;for(;i;){if(e.push(c()),w(),"]"===i)return j("]"),e;j(","),w()}}_("Bad array")}();case'"':return O();case"-":return E();default:return"0">i||i>"9"?function(){switch(i){case"t":return j("t"),j("r"),j("u"),j("e"),!0;case"f":return j("f"),j("a"),j("l"),j("s"),j("e"),!1;case"n":return j("n"),j("u"),j("l"),j("l"),null}_("Unexpected '"+i+"'")}():E()}};var C,x,I,S=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,R={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function q(e){return S.lastIndex=0,S.test(e)?'"'+e.replace(S,function(e){var t=R[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}var k,T=void 0!==JSON?JSON:{parse:function(e,t){var r;return u=e,a=0,i=" ",r=c(),w(),i&&_("Syntax error"),"function"==typeof t?function e(r,n){var o,a,i=r[n];if(i&&"object"==typeof i)for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(void 0!==(a=e(i,o))?i[o]=a:delete i[o]);return t.call(r,n,i)}({"":r},""):r},stringify:function(e,t,r){var n;if(C="",x="","number"==typeof r)for(n=0;r>n;n+=1)x+=" ";else"string"==typeof r&&(x=r);if(I=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw Error("JSON.stringify");return function e(t,r){var n,o,a,i,u,c=C,s=r[t];switch(s&&"object"==typeof s&&"function"==typeof s.toJSON&&(s=s.toJSON(t)),"function"==typeof I&&(s=I.call(r,t,s)),typeof s){case"string":return q(s);case"number":return isFinite(s)?s+"":"null";case"boolean":case"null":return s+"";case"object":if(!s)return"null";if(C+=x,u=[],"[object Array]"===Object.prototype.toString.apply(s)){for(i=s.length,n=0;i>n;n+=1)u[n]=e(n,s)||"null";return a=0===u.length?"[]":C?"[\n"+C+u.join(",\n"+C)+"\n"+c+"]":"["+u.join(",")+"]",C=c,a}if(I&&"object"==typeof I)for(i=I.length,n=0;i>n;n+=1)"string"==typeof(o=I[n])&&(a=e(o,s))&&u.push(q(o)+(C?": ":":")+a);else for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(a=e(o,s))&&u.push(q(o)+(C?": ":":")+a);return a=0===u.length?"{}":C?"{\n"+C+u.join(",\n"+C)+"\n"+c+"}":"{"+u.join(",")+"}",C=c,a}}("",{"":e})}},L=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var n,o="boolean"==typeof t.cycles&&t.cycles,a=t.replacer||function(e,t){return t},i=t.cmp&&(n=t.cmp,function(e){return function(t,r){return n({key:t,value:e[t]},{key:r,value:e[r]})}}),u=[];return function e(t,n,c,s){var f=r?"\n"+Array(s+1).join(r):"",l=r?": ":":";if(c&&c.toJSON&&"function"==typeof c.toJSON&&(c=c.toJSON()),void 0!==(c=a.call(t,n,c))){if("object"!=typeof c||null===c)return T.stringify(c);if(N(c)){for(var d=[],p=0;c.length>p;p++){var h=e(c,p,c[p],s+1)||T.stringify(null);d.push(f+r+h)}return"["+d.join(",")+f+"]"}if(-1!==u.indexOf(c)){if(o)return T.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}u.push(c);var y=P(c).sort(i&&i(c));for(d=[],p=0;y.length>p;p++){var v=e(c,n=y[p],c[n],s+1);if(v){var g=T.stringify(n)+l+v;d.push(f+r+g)}}return u.splice(u.indexOf(c),1),"{"+d.join(",")+f+"}"}}({"":e},"",e,0)},N=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},P=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},r=[];for(var n in e)t.call(e,n)&&r.push(n);return r},F=o(function(e,t){var r=Object.prototype.hasOwnProperty,n=function(){for(var e=[],t=0;256>t;++t)e.push("%"+((16>t?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;e.length>n;++n)void 0!==e[n]&&(r[n]=e[n]);return r},t.merge=function(e,n,o){if(!n)return e;if("object"!=typeof n){if(Array.isArray(e))e.push(n);else{if("object"!=typeof e)return[e,n];(o.plainObjects||o.allowPrototypes||!r.call(Object.prototype,n))&&(e[n]=!0)}return e}if("object"!=typeof e)return[e].concat(n);var a=e;return Array.isArray(e)&&!Array.isArray(n)&&(a=t.arrayToObject(e,o)),Array.isArray(e)&&Array.isArray(n)?(n.forEach(function(n,a){r.call(e,a)?e[a]&&"object"==typeof e[a]?e[a]=t.merge(e[a],n,o):e.push(n):e[a]=n}),e):Object.keys(n).reduce(function(e,a){var i=n[a];return e[a]=r.call(e,a)?t.merge(e[a],i,o):i,e},a)},t.assign=function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:e+"",r="",o=0;t.length>o;++o){var a=t.charCodeAt(o);45!==a&&46!==a&&95!==a&&126!==a&&(48>a||a>57)&&(65>a||a>90)&&(97>a||a>122)?128>a?r+=n[a]:2048>a?r+=n[192|a>>6]+n[128|63&a]:a>=55296&&57344>a?(a=65536+((1023&a)<<10|1023&t.charCodeAt(o+=1)),r+=n[240|a>>18]+n[128|a>>12&63]+n[128|a>>6&63]+n[128|63&a]):r+=n[224|a>>12]+n[128|a>>6&63]+n[128|63&a]:r+=t.charAt(o)}return r},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;t.length>n;++n)for(var o=t[n],a=o.obj[o.prop],i=Object.keys(a),u=0;i.length>u;++u){var c=i[u],s=a[c];"object"==typeof s&&null!==s&&-1===r.indexOf(s)&&(t.push({obj:a,prop:c}),r.push(s))}return function(e){for(var t;e.length;){var r=e.pop();if(Array.isArray(t=r.obj[r.prop])){for(var n=[],o=0;t.length>o;++o)void 0!==t[o]&&n.push(t[o]);r.obj[r.prop]=n}}return t}(t)},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}}),H=String.prototype.replace,D=/%20/g,U={default:"RFC3986",formatters:{RFC1738:function(e){return H.call(e,D,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"},z={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},B=Date.prototype.toISOString,V={delimiter:"&",encode:!0,encoder:F.encode,encodeValuesOnly:!1,serializeDate:function(e){return B.call(e)},skipNulls:!1,strictNullHandling:!1},M=function e(t,r,n,o,a,i,u,c,s,f,l,d){var p=t;if("function"==typeof u)p=u(r,p);else if(p instanceof Date)p=f(p);else if(null===p){if(o)return i&&!d?i(r,V.encoder):r;p=""}if("string"==typeof p||"number"==typeof p||"boolean"==typeof p||F.isBuffer(p))return i?[l(d?r:i(r,V.encoder))+"="+l(i(p,V.encoder))]:[l(r)+"="+l(p+"")];var h,y=[];if(void 0===p)return y;if(Array.isArray(u))h=u;else{var v=Object.keys(p);h=c?v.sort(c):v}for(var g=0;h.length>g;++g){var m=h[g];a&&null===p[m]||(y=y.concat(e(p[m],Array.isArray(p)?n(r,m):r+(s?"."+m:"["+m+"]"),n,o,a,i,u,c,s,f,l,d)))}return y},G=function(e,t){var r=e,n=t?F.assign({},t):{};if(null!=n.encoder&&"function"!=typeof n.encoder)throw new TypeError("Encoder has to be a function.");var o=void 0===n.delimiter?V.delimiter:n.delimiter,a="boolean"==typeof n.strictNullHandling?n.strictNullHandling:V.strictNullHandling,i="boolean"==typeof n.skipNulls?n.skipNulls:V.skipNulls,u="boolean"==typeof n.encode?n.encode:V.encode,c="function"==typeof n.encoder?n.encoder:V.encoder,s="function"==typeof n.sort?n.sort:null,f=void 0!==n.allowDots&&n.allowDots,l="function"==typeof n.serializeDate?n.serializeDate:V.serializeDate,d="boolean"==typeof n.encodeValuesOnly?n.encodeValuesOnly:V.encodeValuesOnly;if(void 0===n.format)n.format=U.default;else if(!Object.prototype.hasOwnProperty.call(U.formatters,n.format))throw new TypeError("Unknown format option provided.");var p,h,y=U.formatters[n.format];"function"==typeof n.filter?r=(h=n.filter)("",r):Array.isArray(n.filter)&&(p=h=n.filter);var v=[];if("object"!=typeof r||null===r)return"";var g=z[n.arrayFormat in z?n.arrayFormat:"indices"in n?n.indices?"indices":"repeat":"indices"];p||(p=Object.keys(r)),s&&p.sort(s);for(var m=0;p.length>m;++m){var b=p[m];i&&null===r[b]||(v=v.concat(M(r[b],b,g,a,i,u?c:null,h,s,f,l,y,d)))}var A=v.join(o);return A.length>0?(!0===n.addQueryPrefix?"?":"")+A:""},J=function(e){var t,r=(t=e)&&Object.keys(t)?G(t):"";return r?"?"+r:""},Q=function(e){return e&&e.restEasy?e.restEasy:(console.error('\n There doesn\'t seem to be a "restEasy" key in your state.\n\n For more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/reducer.md#reducer\n '),null)},K=function(e){return"never"!==e&&(!e||new Date>new Date(e))},Y=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];if(e&&"function"==typeof e)return e.apply(void 0,r)},$=window,W={getToken:function(){return"token"},requestGET:function(){var e=this;return f(regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.getToken,!t.t0){t.next=5;break}return t.next=4,e.getToken();case 4:t.t0=t.sent;case 5:return t.abrupt("return",{method:"GET",headers:d({Accept:"application/json"},(r=t.t0)?{Authorization:"Bearer "+r}:{})});case 7:case"end":return t.stop()}},t,e)}))()},requestPATCH:function(e){var t=this;return f(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=t.getToken,!r.t0){r.next=5;break}return r.next=4,t.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"PATCH",headers:d({Accept:"application/json","Content-Type":"application/json"},(n=r.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return r.stop()}},r,t)}))()},requestPUT:function(e){var t=this;return f(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=t.getToken,!r.t0){r.next=5;break}return r.next=4,t.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"PUT",headers:d({Accept:"application/json","Content-Type":"application/json"},(n=r.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return r.stop()}},r,t)}))()},requestPOST:function(e){var t=this;return f(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=t.getToken,!r.t0){r.next=5;break}return r.next=4,t.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"POST",headers:d({Accept:"application/json","Content-Type":"application/json"},(n=r.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return r.stop()}},r,t)}))()},requestDELETE:function(){var e=this;return f(regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.getToken,!t.t0){t.next=5;break}return t.next=4,e.getToken();case 4:t.t0=t.sent;case 5:return r=t.t0,t.abrupt("return",{method:"DELETE",headers:d({Accept:"application/json"},e.getToken&&e.getToken()?{Authorization:"Bearer "+r}:{})});case 7:case"end":return t.stop()}},t,e)}))()},handleStatusCode:function(e){if(e){if(e.status>=200&&300>e.status)return e;var t=Error(e.statusText);throw t.response=e,t}return null},handleError:(k=f(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!t||!t.response){e.next=8;break}return e.next=4,t.response.json();case 4:console.error(e.sent),e.next=9;break;case 8:console.error(t);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.error(e.t0);case 14:case"end":return e.stop()}},e,$,[[0,11]])})),function(e,t){return k.apply(this,arguments)})},X=W,Z=function(){return X},ee=window,te=function(e,t,r,n,o,a,i,u){return function(e,c,s){return function(){var l,p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},h=p.query,y=void 0===h?{}:h,v=p.body,g=void 0===v?{}:v,m=p.urlParams,b=void 0===m?{}:m,A=p.onSuccess,_=p.onError,j=function(e,t){var r={};for(var n in e)0>t.indexOf(n)&&Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(p,["query","body","urlParams","onSuccess","onError"]);return l=f(regeneratorRuntime.mark(function f(l,p){var h,v,m,E,O,w,C,x;return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return h=d({},Z(),u||{}),l(t.REQUEST(c,s)),f.prev=2,f.next=5,Y(n,b,y,g,j,l);case 5:return v=f.sent||g,f.t0=fetch,f.t1=e,f.next=11,h["request"+r](v);case 11:return f.t2=f.sent,f.next=14,(0,f.t0)(f.t1,f.t2);case 14:if(h.handleStatusCode(m=f.sent),204===m.status){f.next=22;break}return f.next=19,m.json();case 19:f.t3=f.sent,f.next=23;break;case 22:f.t3={};case 23:return E=f.t3,O=o?o(E,Q(p()).resources,b,y,v,j):{entities:E},w=O.entities,C=O.result,x=a?a(E,Q(p()).resources,b,y,v,j):null,l(t.RECEIVE(c,s,w,x,Array.isArray(C)?C:[C])),f.next=30,Y(i,w||{},b,y,v,j,l);case 30:return Y(A,w||{},j),f.abrupt("return",{normalizedPayload:w||{},otherArgs:j});case 34:return f.prev=34,f.t4=f.catch(2),l(t.FAIL(c,s)),h.handleError(f.t4,l),Y(_,f.t4),f.abrupt("return",{error:f.t4});case 40:case"end":return f.stop()}},f,ee,[[2,34]])})),function(e,t){return l.apply(this,arguments)}}}},re=function(e,t,r,n){var o=r[n],a=o.method,i=o.url,u=o.cacheHint,c=o.beforeHook,s=o.normalizer,f=o.metadataNormalizer,l=o.afterHook,d=o.networkHelpers,p=b(e,n,t),h=te(0,p,a,c,s,f,l,d);return function(t){return function(r,o){var c=Q(o()),s=t||{},f=s.urlParams,l=s.query,d=s.body,y=s.otherArgs,v=function(e){var t=("string"!=typeof e?e():e).split("/").reverse(),r=t.findIndex(function(e){return e.startsWith("::")});return-1!==r?t.length-1-r:-1}(i),g=function(e,t,r){var n="string"!=typeof e?e():e;t&&Object.keys(t).forEach(function(e){n=n.replace("::"+e,t[e]).replace(":"+e,t[e])});var o=r?J(JSON.parse(L(r))):"";return""+n+o}(i,f,l),m=u?u(f,l,d,y):null,b=function(e,t,r){return(e||"")+(t?":"+t:"")+(r?":"+J(r):"")}(n,g,m),A=function(e,t){if(!e||!t&&0!==t||-1===t)return null;for(var r=0,n=0;t>n;n+=1)r=e.indexOf("/",r+1);var o=e.indexOf("/",r+1);return e.substr(r+1,-1!==o?o-r-1:e.length)}(b,v),_=void 0;(function(e,t){return!(e&&t&&e.requests&&e.requests[t]&&!e.requests[t].endedAt)})(c,b)&&function(e,t,r){if(!("GET"===t&&e&&r&&e.requests&&e.requests[r]))return!0;var n=e.requests[r];return!n.hasSucceeded||n.didInvalidate||K(n.expireAt)}(c,a,b)&&(_=function(e,t,r,n){return!!("GET"===t&&e&&e.requests&&r&&null!==n)&&Object.values(e.requests).some(function(e){var t=e.expireAt,o=e.payloadIds;return e.hasSucceeded&&!e.didInvalidate&&(r===e.resourceName&&n===e.resourceId||o&&o[r]&&o[r].includes(n))&&!K(t)})}(c,a,e,A)?function(){var t,n;return r(p.RECEIVE_FROM_CACHE(b,A,((n={})[e]=((t={})[A]=null,t),n),null,[A]))}:function(){return r(h(g,b,A)(t))});var j=_?_():{};return j.__actionName=n,j.__requestURL=b,j}}},ne=function(e,t,r,n){var o,a=function(e){return{INVALIDATE_REQUEST:v(e,"@invalidate","INVALIDATE_REQUEST")}}(e).INVALIDATE_REQUEST;return(o={})[n]={perform:re(e,t,r,n),invalidate:function(e,t){return function(r){return{type:e,url:r,resourceName:t}}}(a,e)},o},oe="[object Object]";var ae,ie,ue=Object.prototype,ce=Function.prototype.toString,se=ue.hasOwnProperty,fe=ce.call(Object),le=ue.toString,de=(ae=Object.getPrototypeOf,ie=Object,function(e){return ae(ie(e))});var pe,he=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||le.call(e)!=oe||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=de(e);if(null===t)return!0;var r=se.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ce.call(r)==fe},ye=function(e){return function(t){throw Error("redux-rest-easy: "+e+" "+t)}},ve=function(e){return"string"==typeof e},ge=function(e){return"function"==typeof e},me=function(e){return void 0!==e},be=["method","url"],Ae=[].concat(be,["cacheHint","beforeHook","normalizer","metadataNormalizer","afterHook","networkHelpers"]),_e=["GET","POST","PATCH","PUT","DELETE"],je=function(e){return e+" >"},Ee=function(e,t){return e+' "'+t+'" is invalid. Expected a valid function.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'},Oe=function(e,t){if(t){if(!he(t)||!Object.keys(t).length)ye(je(e)+" createResource >")("You have to provide a valid actions configuration.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource.md#createresourceresourcename-optionsactions");Object.keys(t).forEach(function(r){var n=ye(je(e)+" "+function(e){return e+" >"}(r)+" createResource >"),o=t[r],a=Object.keys(o);be.forEach(function(e){a.includes(e)||n('Key "'+e+'" is missing.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig')}),a.forEach(function(e){Ae.includes(e)||n(function(e){return'Unknown key "'+e+'".\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'}(e))});var i=o.method,u=o.url,c=o.cacheHint,s=o.beforeHook,f=o.normalizer,l=o.metadataNormalizer,d=o.afterHook,p=o.networkHelpers;ve(i)&&_e.includes(i)||n(function(e){return'Method "'+e+'" is invalid. Expected one of: '+_e.join(", ")+".\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig"}(i)),u&&(ve(u)||ge(u))||n(function(e){return'URL "'+e+'" is invalid. Expected a string or a function returning a string.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'}(u)),me(c)&&!ge(c)&&n(Ee("cacheHint",c)),me(s)&&!ge(s)&&n(Ee("beforeHook",s)),me(f)&&!ge(f)&&n(Ee("normalizer",f)),me(l)&&!ge(l)&&n(Ee("metadataNormalizer",l)),me(d)&&!ge(d)&&n(Ee("afterHook",d)),me(p)&&!he(p)&&n("networkHelpers"+' "'+p+'" is invalid. Expected a valid object.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'),Object.keys(p||{}).forEach(function(e){me(p[e])&&!ge(p[e])&&n(e+' "networkHelpers.'+p[e]+'" is invalid. Expected a valid function.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig')})})}},we=function(e){return void 0!==e},Ce=["cacheLifetime","denormalizer"],xe=function(e,t){var r,n=(r=function(e){return e+" >"}(e||"[no resource name]")+" createResource >",function(e){throw Error("redux-rest-easy: "+r+" "+e)});if(e&&"string"==typeof e||n("You have to provide a valid resource name."),t){he(t)&&Object.keys(t).length||n("You have to provide a valid resource configuration (or not at all)."),Object.keys(t).forEach(function(e){Ce.includes(e)||n(function(e){return'Unknown key "'+e+'" in resource config.'}(e))});var o=t.cacheLifetime,a=t.denormalizer;!we(o)||function(e){return"number"==typeof e}(o)&&o>=0||n(function(e){return'cacheLifetime "'+e+'" in resource config is invalid. Expected a number between 0 and Infinity.'}(o)),we(a)&&!function(e){return"function"==typeof e}(a)&&n(function(e,t){return e+' "'+t+'" in resource config is invalid. Expected a valid function.'}("denormalizer",a))}},Ie=o(function(e,t){function r(e,t){return e===t}function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=null,o=null;return function(){return function(e,t,r){if(null===t||null===r||t.length!==r.length)return!1;for(var n=t.length,o=0;n>o;o++)if(!e(t[o],r[o]))return!1;return!0}(t,n,arguments)||(o=e.apply(null,arguments)),n=arguments,o}}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];return function(){for(var t=arguments.length,o=Array(t),a=0;t>a;a++)o[a]=arguments[a];var i=0,u=o.pop(),c=function(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var r=t.map(function(e){return typeof e}).join(", ");throw Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+r+"]")}return t}(o),s=e.apply(void 0,[function(){return i++,u.apply(null,arguments)}].concat(r)),f=n(function(){for(var e=[],t=c.length,r=0;t>r;r++)e.push(c[r].apply(null,arguments));return s.apply(null,e)});return f.resultFunc=u,f.recomputations=function(){return i},f.resetRecomputations=function(){return i=0},f}}t.__esModule=!0,t.defaultMemoize=n,t.createSelectorCreator=o,t.createStructuredSelector=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;if("object"!=typeof e)throw Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var r=Object.keys(e);return t(r.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return t.reduce(function(e,t,n){return e[r[n]]=t,e},{})})};var a=t.createSelector=o(n)});(pe=Ie)&&pe.__esModule&&Object.prototype.hasOwnProperty.call(pe,"default");var Se=Ie.createSelectorCreator,Re=Ie.createSelector,qe=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ke=function(){function e(){qe(this,e),this._cache={}}return e.prototype.set=function(e,t){this._cache[e]=t},e.prototype.get=function(e){return this._cache[e]},e.prototype.remove=function(e){delete this._cache[e]},e.prototype.clear=function(){this._cache={}},e}();function Te(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=ke;return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=void 0,a=void 0;"function"==typeof r?(console.warn('[re-reselect] Deprecation warning: "selectorCreator" argument is discouraged and will be removed in the upcoming major release. Please use "options.selectorCreator" instead.'),o=new n,a=r):(o=r.cacheObject||new n,a=r.selectorCreator||Re);var i=function(){var r=e.apply(void 0,arguments);if("string"==typeof r||"number"==typeof r){var n=o.get(r);return void 0===n&&(n=a.apply(void 0,t),o.set(r,n)),n.apply(void 0,arguments)}};return i.getMatchingSelector=function(){var t=e.apply(void 0,arguments);return o.get(t)},i.removeMatchingSelector=function(){var t=e.apply(void 0,arguments);o.remove(t)},i.clearCache=function(){o.clear()},i.resultFunc=t[t.length-1],i}}var Le=function(e){return e.split(":")[0]},Ne=function(e,t,r){return r?r.__requestURLsByActionKey?r.__requestURLsByActionKey[t]:(console.error("You may have forgotten to use redux-rest-easy's connect on a Component which requested "+e+"."+t+"\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/connect.md#connectconnectargs"),""):(console.error("You may have forgotten to pass ownProps to a selector related to "+e+"."+t+"\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/selectors.md#actionrequest"),"")},Pe={selectorCreator:Se(function(e){var t=null;return function(){return t||(t=e.apply(void 0,arguments)),t}})},Fe=function(){return Pe},He=function(e,t,r){return t?Object.keys(t).reduce(function(n,o){var a;return d({},n,((a={})[o]=o===e?r:Object.keys(t[o]||{}),a))},{}):{}},De=o(function(e,t){!function(r,n){var o={version:"2.1.2",x86:{},x64:{}};function a(e,t){return(65535&e)*t+(((e>>>16)*t&65535)<<16)}function i(e,t){return e<<t|e>>>32-t}function u(e){return e=a(e^=e>>>16,2246822507),e=a(e^=e>>>13,3266489909),e^=e>>>16}function c(e,t){var r=[0,0,0,0];return r[3]+=(e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]])[3]+(t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]])[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]+t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]+t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]+t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function s(e,t){var r=[0,0,0,0];return r[3]+=(e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]])[3]*(t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]])[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]*t[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=e[3]*t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]*t[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[2]*t[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[3]*t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function f(e,t){return 32===(t%=64)?[e[1],e[0]]:32>t?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:[e[1]<<(t-=32)|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t]}function l(e,t){return 0===(t%=64)?e:32>t?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function d(e,t){return[e[0]^t[0],e[1]^t[1]]}function p(e){return e=d(e=s(e=d(e=s(e=d(e,[0,e[0]>>>1]),[4283543511,3981806797]),[0,e[0]>>>1]),[3301882366,444984403]),[0,e[0]>>>1])}o.x86.hash32=function(e,t){for(var r=(e=e||"").length%4,n=e.length-r,o=t=t||0,c=0,s=3432918353,f=461845907,l=0;n>l;l+=4)o=a(o=i(o^=c=a(c=i(c=a(c=255&e.charCodeAt(l)|(255&e.charCodeAt(l+1))<<8|(255&e.charCodeAt(l+2))<<16|(255&e.charCodeAt(l+3))<<24,s),15),f),13),5)+3864292196;switch(c=0,r){case 3:c^=(255&e.charCodeAt(l+2))<<16;case 2:c^=(255&e.charCodeAt(l+1))<<8;case 1:o^=c=a(c=i(c=a(c^=255&e.charCodeAt(l),s),15),f)}return(o=u(o^=e.length))>>>0},o.x86.hash128=function(e,t){for(var r=(e=e||"").length%16,n=e.length-r,o=t=t||0,c=t,s=t,f=t,l=0,d=0,p=0,h=0,y=597399067,v=2869860233,g=951274213,m=2716044179,b=0;n>b;b+=16)l=255&e.charCodeAt(b)|(255&e.charCodeAt(b+1))<<8|(255&e.charCodeAt(b+2))<<16|(255&e.charCodeAt(b+3))<<24,d=255&e.charCodeAt(b+4)|(255&e.charCodeAt(b+5))<<8|(255&e.charCodeAt(b+6))<<16|(255&e.charCodeAt(b+7))<<24,p=255&e.charCodeAt(b+8)|(255&e.charCodeAt(b+9))<<8|(255&e.charCodeAt(b+10))<<16|(255&e.charCodeAt(b+11))<<24,h=255&e.charCodeAt(b+12)|(255&e.charCodeAt(b+13))<<8|(255&e.charCodeAt(b+14))<<16|(255&e.charCodeAt(b+15))<<24,o=i(o^=l=a(l=i(l=a(l,y),15),v),19),o=a(o+=c,5)+1444728091,c=i(c^=d=a(d=i(d=a(d,v),16),g),17),c=a(c+=s,5)+197830471,s=i(s^=p=a(p=i(p=a(p,g),17),m),15),s=a(s+=f,5)+2530024501,f=i(f^=h=a(h=i(h=a(h,m),18),y),13),f=a(f+=o,5)+850148119;switch(l=0,d=0,p=0,h=0,r){case 15:h^=e.charCodeAt(b+14)<<16;case 14:h^=e.charCodeAt(b+13)<<8;case 13:f^=h=a(h=i(h=a(h^=e.charCodeAt(b+12),m),18),y);case 12:p^=e.charCodeAt(b+11)<<24;case 11:p^=e.charCodeAt(b+10)<<16;case 10:p^=e.charCodeAt(b+9)<<8;case 9:s^=p=a(p=i(p=a(p^=e.charCodeAt(b+8),g),17),m);case 8:d^=e.charCodeAt(b+7)<<24;case 7:d^=e.charCodeAt(b+6)<<16;case 6:d^=e.charCodeAt(b+5)<<8;case 5:c^=d=a(d=i(d=a(d^=e.charCodeAt(b+4),v),16),g);case 4:l^=e.charCodeAt(b+3)<<24;case 3:l^=e.charCodeAt(b+2)<<16;case 2:l^=e.charCodeAt(b+1)<<8;case 1:o^=l=a(l=i(l=a(l^=e.charCodeAt(b),y),15),v)}return o^=e.length,o+=c^=e.length,o+=s^=e.length,c+=o+=f^=e.length,s+=o,f+=o,o=u(o),o+=c=u(c),o+=s=u(s),c+=o+=f=u(f),s+=o,f+=o,("00000000"+(o>>>0).toString(16)).slice(-8)+("00000000"+(c>>>0).toString(16)).slice(-8)+("00000000"+(s>>>0).toString(16)).slice(-8)+("00000000"+(f>>>0).toString(16)).slice(-8)},o.x64.hash128=function(e,t){for(var r=(e=e||"").length%16,n=e.length-r,o=[0,t=t||0],a=[0,t],i=[0,0],u=[0,0],h=[2277735313,289559509],y=[1291169091,658871167],v=0;n>v;v+=16)i=[255&e.charCodeAt(v+4)|(255&e.charCodeAt(v+5))<<8|(255&e.charCodeAt(v+6))<<16|(255&e.charCodeAt(v+7))<<24,255&e.charCodeAt(v)|(255&e.charCodeAt(v+1))<<8|(255&e.charCodeAt(v+2))<<16|(255&e.charCodeAt(v+3))<<24],u=[255&e.charCodeAt(v+12)|(255&e.charCodeAt(v+13))<<8|(255&e.charCodeAt(v+14))<<16|(255&e.charCodeAt(v+15))<<24,255&e.charCodeAt(v+8)|(255&e.charCodeAt(v+9))<<8|(255&e.charCodeAt(v+10))<<16|(255&e.charCodeAt(v+11))<<24],o=c(s(o=c(o=f(o=d(o,i=s(i=f(i=s(i,h),31),y)),27),a),[0,5]),[0,1390208809]),a=c(s(a=c(a=f(a=d(a,u=s(u=f(u=s(u,y),33),h)),31),o),[0,5]),[0,944331445]);switch(i=[0,0],u=[0,0],r){case 15:u=d(u,l([0,e.charCodeAt(v+14)],48));case 14:u=d(u,l([0,e.charCodeAt(v+13)],40));case 13:u=d(u,l([0,e.charCodeAt(v+12)],32));case 12:u=d(u,l([0,e.charCodeAt(v+11)],24));case 11:u=d(u,l([0,e.charCodeAt(v+10)],16));case 10:u=d(u,l([0,e.charCodeAt(v+9)],8));case 9:a=d(a,u=s(u=f(u=s(u=d(u,[0,e.charCodeAt(v+8)]),y),33),h));case 8:i=d(i,l([0,e.charCodeAt(v+7)],56));case 7:i=d(i,l([0,e.charCodeAt(v+6)],48));case 6:i=d(i,l([0,e.charCodeAt(v+5)],40));case 5:i=d(i,l([0,e.charCodeAt(v+4)],32));case 4:i=d(i,l([0,e.charCodeAt(v+3)],24));case 3:i=d(i,l([0,e.charCodeAt(v+2)],16));case 2:i=d(i,l([0,e.charCodeAt(v+1)],8));case 1:o=d(o,i=s(i=f(i=s(i=d(i,[0,e.charCodeAt(v)]),h),31),y))}return o=d(o,[0,e.length]),a=c(a=d(a,[0,e.length]),o=c(o,a)),o=p(o),a=c(a=p(a),o=c(o,a)),("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)},e.exports&&(t=e.exports=o),t.murmurHash3=o}()}),Ue=De,ze=o(function(e){e.exports={v3:Ue},function(){throw Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}.main===e&&console.log(e.exports.v3)}).v3,Be=function(e){return ze.x64.hash128(L(e||null))},Ve=Be([]),Me=function(e,t,r,n,o){var a,i,u=e.requests,c=void 0===u?{}:u,s=e.resources,f=void 0===s?{}:s,l=e.resolversHashes,p=void 0===l?{}:l,h=He(t,n,o);return d({},p,{requests:d({},p.requests||{},(a={},a[r]=Object.keys(h).reduce(function(e,t){var n;return d({},e,((n={})[t]=c[r]&&c[r].payloadIds&&c[r].payloadIds[t]?Be(c[r].payloadIds[t]):Ve,n))},{}),a)),resources:d({},p.resources||{},(i={_getResourcesHash:function(){return Be(f)}},i[t]=f[t]?Be(f[t]):Ve,i))})},Ge=function(){return Ve},Je=function(e,t,r){return e&&e.requests&&e.requests[t]&&e.requests[t][r]?e.requests[t][r]:Ve},Qe=function(e,t){return e&&e.resources&&e.resources[t]?e.resources[t]:Ve},Ke=[],Ye=function(e,t){return("number"==typeof e?""+e:e)===("number"==typeof t?""+t:t)},$e=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1;return!!e.requests&&Object.entries(e.requests).some(function(e){var o=e[1],a=o.resourceName,i=o.resourceId,u=o.endedAt;return Le(e[0])===r&&a===t&&(-1===n||null!==i&&Ye(i,n))&&!u})},We=function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=e.requests&&Object.entries(e.requests).filter(function(e){var n=e[1],a=n.resourceName,i=n.resourceId,u=n.endedAt,c=n.payloadIds;return Le(e[0])===r&&a===t&&(-1===o||null!==i&&Ye(i,o)||!!u&&c&&c[t]&&c[t].includes(o))}).map(function(e){return e[1]});return!(!a||!a.length)&&a.reduce(function(e,t){return t.endedAt&&e.endedAt&&t.endedAt>e.endedAt?t:e},a[0])[n]},Xe=function(e,t){return e.resources&&e.resources[t]?e.resources[t]:null},Ze=function(e,t,r){return e.requests&&e.requests[r]&&e.requests[r].payloadIds&&e.requests[r].payloadIds[t]?e.requests[r].payloadIds[t]:null},et=Te(function(e){return e.resources},Xe,Ze,function(e,t,r,n){return n},function(e,t,r,n,o){return o},function(e,t,r,n,o){return t&&r?n&&o?o(r,e):r.reduce(function(e,r){return[].concat(e,[t[r]])},[]):Ke})(function(e,t,r,n,o){var a=Xe(e,t),i=Ze(e,t,r),u=function(e){return e.resolversHashes}(e);return a&&i?n&&o?n+"-"+Object.keys(e.requests[r].payloadIds).map(function(e){return Je(u,r,e)+"-"+Qe(u,e)}).join("--"):n+"-"+Je(u,r,t)+"-"+Qe(u,t):Ge()},Fe()),tt=function(e,t){return!(!e.requests||!e.requests[t]||e.requests[t].endedAt)},rt=function(e,t,r){return!!(e.requests&&e.requests[t]&&e.requests[t][r])},nt=[],ot=function(e,t){return e.resources&&e.resources[t]?e.resources[t]:null},at=Te(function(e){return e.resources},ot,function(e,t,r){return r},function(e,t,r,n){return n},function(e,t,r,n){return t?r&&n?n(Object.keys(t),e):Object.values(t):nt})(function(e,t,r,n){var o=ot(e,t),a=function(e){return e.resolversHashes}(e);return o?r&&n?r+"-"+function(e){return e&&e.resources&&e.resources._getResourcesHash?e.resources._getResourcesHash():Ve}(a):r+"-"+Qe(a,t):Ge()},Fe()),it=function(e){var t=e.split("/");return{resourceName:t[1],actionName:t[2],caseName:t[3]}},ut=o(function(e,t){var r=200,o="__lodash_hash_undefined__",a=800,i=16,u=9007199254740991,c="[object Arguments]",s="[object AsyncFunction]",f="[object Function]",l="[object GeneratorFunction]",d="[object Null]",p="[object Object]",h="[object Proxy]",y="[object Undefined]",v=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,m={};m["[object Float32Array]"]=m["[object Float64Array]"]=m["[object Int8Array]"]=m["[object Int16Array]"]=m["[object Int32Array]"]=m["[object Uint8Array]"]=m["[object Uint8ClampedArray]"]=m["[object Uint16Array]"]=m["[object Uint32Array]"]=!0,m[c]=m["[object Array]"]=m["[object ArrayBuffer]"]=m["[object Boolean]"]=m["[object DataView]"]=m["[object Date]"]=m["[object Error]"]=m[f]=m["[object Map]"]=m["[object Number]"]=m[p]=m["[object RegExp]"]=m["[object Set]"]=m["[object String]"]=m["[object WeakMap]"]=!1;var b="object"==typeof n&&n&&n.Object===Object&&n,A="object"==typeof self&&self&&self.Object===Object&&self,_=b||A||Function("return this")(),j=t&&!t.nodeType&&t,E=j&&e&&!e.nodeType&&e,O=E&&E.exports===j,w=O&&b.process,C=function(){try{return w&&w.binding&&w.binding("util")}catch(e){}}(),x=C&&C.isTypedArray;function I(e,t){return"__proto__"==t?void 0:e[t]}var S,R,q,k=Array.prototype,T=Object.prototype,L=_["__core-js_shared__"],N=Function.prototype.toString,P=T.hasOwnProperty,F=(S=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",H=T.toString,D=N.call(Object),U=RegExp("^"+N.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),z=O?_.Buffer:void 0,B=_.Symbol,V=_.Uint8Array,M=z?z.allocUnsafe:void 0,G=(R=Object.getPrototypeOf,q=Object,function(e){return R(q(e))}),J=Object.create,Q=T.propertyIsEnumerable,K=k.splice,Y=B?B.toStringTag:void 0,$=function(){try{var e=_e(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),W=z?z.isBuffer:void 0,X=Math.max,Z=Date.now,ee=_e(_,"Map"),te=_e(Object,"create"),re=function(){function e(){}return function(t){if(!ke(t))return{};if(J)return J(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ie(e){var t=this.__data__=new oe(e);this.size=t.size}function ue(e,t){var r=xe(e),n=!r&&Ce(e),o=!r&&!n&&Se(e),a=!r&&!n&&!o&&Le(e),i=r||n||o||a,u=i?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=u.length;for(var s in e)!t&&!P.call(e,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||je(s,c))||u.push(s);return u}function ce(e,t,r){(void 0===r||we(e[t],r))&&(void 0!==r||t in e)||le(e,t,r)}function se(e,t,r){var n=e[t];P.call(e,t)&&we(n,r)&&(void 0!==r||t in e)||le(e,t,r)}function fe(e,t){for(var r=e.length;r--;)if(we(e[r][0],t))return r;return-1}function le(e,t,r){"__proto__"==t&&$?$(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}ne.prototype.clear=function(){this.__data__=te?te(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(te){var r=t[e];return r===o?void 0:r}return P.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:P.call(t,e)},ne.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=te&&void 0===t?o:t,this},oe.prototype.clear=function(){this.__data__=[],this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=fe(t,e);return r>=0&&(r==t.length-1?t.pop():K.call(t,r,1),--this.size,!0)},oe.prototype.get=function(e){var t=this.__data__,r=fe(t,e);return 0>r?void 0:t[r][1]},oe.prototype.has=function(e){return fe(this.__data__,e)>-1},oe.prototype.set=function(e,t){var r=this.__data__,n=fe(r,e);return 0>n?(++this.size,r.push([e,t])):r[n][1]=t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(ee||oe),string:new ne}},ae.prototype.delete=function(e){var t=Ae(this,e).delete(e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return Ae(this,e).get(e)},ae.prototype.has=function(e){return Ae(this,e).has(e)},ae.prototype.set=function(e,t){var r=Ae(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ie.prototype.clear=function(){this.__data__=new oe,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var o=n.__data__;if(!ee||r-1>o.length)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new ae(o)}return n.set(e,t),this.size=n.size,this};var de,pe=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),i=a.length;i--;){var u=a[de?i:++n];if(!1===t(o[u],u,o))break}return e};function he(e){return null==e?void 0===e?y:d:Y&&Y in Object(e)?function(e){var t=P.call(e,Y),r=e[Y];try{e[Y]=void 0;var n=!0}catch(e){}var o=H.call(e);n&&(t?e[Y]=r:delete e[Y]);return o}(e):function(e){return H.call(e)}(e)}function ye(e){return Te(e)&&he(e)==c}function ve(e){return!(!ke(e)||F&&F in e)&&(Re(e)?U:v).test(function(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ge(e){if(!ke(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=Ee(e),r=[];for(var n in e)("constructor"!=n||!t&&P.call(e,n))&&r.push(n);return r}function me(e,t,r,n,o){e!==t&&pe(t,function(a,i){if(ke(a))o||(o=new ie),function(e,t,r,n,o,a,i){var u=I(e,r),c=I(t,r),s=i.get(c);if(s)return void ce(e,r,s);var f=a?a(u,c,r+"",e,t,i):void 0,l=void 0===f;if(l){var d=xe(c),h=!d&&Se(c),y=!d&&!h&&Le(c);f=c,d||h||y?xe(u)?f=u:Te(A=u)&&Ie(A)?f=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(u):h?(l=!1,f=function(e,t){if(t)return e.slice();var r=e.length,n=M?M(r):new e.constructor(r);return e.copy(n),n}(c,!0)):y?(l=!1,v=c,g=!0?(new V(b=new(m=v.buffer).constructor(m.byteLength)).set(new V(m)),b):v.buffer,f=new v.constructor(g,v.byteOffset,v.length)):f=[]:function(e){if(!Te(e)||he(e)!=p)return!1;var t=G(e);if(null===t)return!0;var r=P.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&N.call(r)==D}(c)||Ce(c)?(f=u,Ce(u)?f=function(e){return function(e,t,r,n){var o=!r;r||(r={});var a=-1,i=t.length;for(;++a<i;){var u=t[a],c=n?n(r[u],e[u],u,r,e):void 0;void 0===c&&(c=e[u]),o?le(r,u,c):se(r,u,c)}return r}(e,Ne(e))}(u):(!ke(u)||n&&Re(u))&&(f=function(e){return"function"!=typeof e.constructor||Ee(e)?{}:re(G(e))}(c))):l=!1}var v,g,m,b;var A;l&&(i.set(c,f),o(f,c,n,a,i),i.delete(c));ce(e,r,f)}(e,t,i,r,me,n,o);else{var u=n?n(I(e,i),a,i+"",e,t,o):void 0;void 0===u&&(u=a),ce(e,i,u)}},Ne)}function be(e,t){return Oe(function(e,t,r){return t=X(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=X(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var u=Array(t+1);++o<t;)u[o]=n[o];return u[t]=r(i),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,u)}}(e,t,He),e+"")}function Ae(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function _e(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ve(r)?r:void 0}function je(e,t){var r=typeof e;return!!(t=null==t?u:t)&&("number"==r||"symbol"!=r&&g.test(e))&&e>-1&&e%1==0&&t>e}function Ee(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||T)}var Oe=function(e){var t=0,r=0;return function(){var n=Z(),o=i-(n-r);if(r=n,o>0){if(++t>=a)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}($?function(e,t){return $(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:He);function we(e,t){return e===t||e!=e&&t!=t}var Ce=ye(function(){return arguments}())?ye:function(e){return Te(e)&&P.call(e,"callee")&&!Q.call(e,"callee")},xe=Array.isArray;function Ie(e){return null!=e&&qe(e.length)&&!Re(e)}var Se=W||function(){return!1};function Re(e){if(!ke(e))return!1;var t=he(e);return t==f||t==l||t==s||t==h}function qe(e){return"number"==typeof e&&e>-1&&e%1==0&&u>=e}function ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Te(e){return null!=e&&"object"==typeof e}var Le=x?function(e){return function(t){return e(t)}}(x):function(e){return Te(e)&&qe(e.length)&&!!m[he(e)]};function Ne(e){return Ie(e)?ue(e,!0):ge(e)}var Pe,Fe=(Pe=function(e,t,r,n){me(e,t,r,n)},be(function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=Pe.length>3&&"function"==typeof o?(n--,o):void 0,a&&function(e,t,r){if(!ke(r))return!1;var n=typeof t;return!!("number"==n?Ie(r)&&je(t,r.length):"string"==n&&t in r)&&we(r[t],e)}(t[0],t[1],a)&&(o=3>n?void 0:o,n=1),e=Object(e);++r<n;){var i=t[r];i&&Pe(e,i,r,o)}return e}));function He(e){return e}e.exports=Fe}),ct=function(e,t){return ut(e.resources,t,function(e,t){return he(e)?d({},e,t):void 0})},st={},ft={REQUEST:function(e,t){var r,n=t.url,o=t.resourceId;return d({},e,{requests:d({},e.requests||{},(r={},r[n]=d({},e.requests&&e.requests[n]?e.requests[n]:{},{resourceName:it(t.type).resourceName,resourceId:o,startedAt:(new Date).toISOString(),endedAt:null,expireAt:null,hasSucceeded:!(!e.requests||!e.requests[n])&&e.requests[n].hasSucceeded,hasFailed:!(!e.requests||!e.requests[n])&&e.requests[n].hasFailed,didInvalidate:!(!e.requests||!e.requests[n])&&e.requests[n].didInvalidate,fromCache:!(!e.requests||!e.requests[n])&&e.requests[n].fromCache}),r))})},RECEIVE:function(e,t){var r,n=t.url,o=t.payload,a=t.principalResourceIds,i=t.metadata,u=t.cacheLifetime,c=void 0===u?0:u,s=it(t.type).resourceName,f=d({},e,{requests:d({},e.requests||{},(r={},r[n]=d({},e.requests&&e.requests[n]?e.requests[n]:{},{endedAt:(new Date).toISOString(),expireAt:c!==1/0?new Date((new Date).getTime()+1e3*c).toISOString():"never",hasSucceeded:!0,hasFailed:!1,didInvalidate:!1,fromCache:!1,payloadIds:He(s,o,a),metadata:i}),r)),resources:ct(e,o)});return d({},f,{resolversHashes:Me(f,s,n,o,a)})},FAIL:function(e,t){var r,n=t.url;return d({},e,{requests:d({},e.requests||{},(r={},r[n]=d({},e.requests&&e.requests[n]?e.requests[n]:{},{endedAt:(new Date).toISOString(),hasSucceeded:!1,hasFailed:!0}),r))})},RECEIVE_FROM_CACHE:function(e,t){var r,n=t.type,o=t.url,a=t.resourceId,i=t.payload,u=t.principalResourceIds,c=t.metadata,s=t.cacheLifetime,f=void 0===s?0:s,l=it(n).resourceName,p=d({},e,{requests:d({},e.requests||{},(r={},r[o]=d({},e.requests&&e.requests[o]?e.requests[o]:{},{resourceName:it(n).resourceName,resourceId:a,startedAt:(new Date).toISOString(),endedAt:(new Date).toISOString(),expireAt:f!==1/0?new Date((new Date).getTime()+1e3*f).toISOString():"never",hasSucceeded:!0,hasFailed:!1,didInvalidate:!1,fromCache:!0,payloadIds:He(l,i,u),metadata:c}),r)),resources:ct(e,i)});return d({},p,{resolversHashes:Me(p,l,o,i,u)})},INVALIDATE_RESOURCE:function(e,t){var r=t.resourceName;return d({},e,{requests:d({},Object.entries(e.requests||{}).reduce(function(e,t){var n,o=t[1];return d({},e,((n={})[t[0]]=!o.didInvalidate&&(o.resourceName===r||o.payloadIds&&o.payloadIds[r])?d({},o,{didInvalidate:!0}):o,n))},{}))})},INVALIDATE_ID:function(e,t){var r=t.resourceName,n=t.resourceId;return d({},e,{requests:d({},Object.entries(e.requests||{}).reduce(function(e,t){var o,a=t[1];return d({},e,((o={})[t[0]]=!a.didInvalidate&&(a.resourceName===r&&a.resourceId===n||a.payloadIds&&a.payloadIds[r]&&a.payloadIds[r].map(function(e){return""+e}).includes(""+n))?d({},a,{didInvalidate:!0}):a,o))},{}))})},INVALIDATE_REQUEST:function(e,t){var r,n=t.url;return d({},e,{requests:d({},e.requests||{},(r={},r[n]=d({},e.requests&&e.requests[n]?e.requests[n]:{},{didInvalidate:!0}),r))})},RESET_RESOURCE:function(e,t){var r,n=t.resourceName,o=d({},e,{requests:d({},Object.entries(e.requests||{}).filter(function(e){var t=e[1],r=t.payloadIds;return!(n===t.resourceName||r&&Object.keys(r).includes(n))}).reduce(function(e,t){var r;return d({},e,((r={})[t[0]]=t[1],r))},{})),resources:d({},e.resources||{},(r={},r[n]=void 0,r))});return d({},o,{resolversHashes:function(e,t){var r,n=e.requests,o=void 0===n?{}:n,a=e.resolversHashes,i=void 0===a?{}:a;return d({},i,{requests:d({},Object.entries(i.requests||{}).reduce(function(e,t){var r,n=t[0],a=t[1];return d({},e,Object.keys(o).includes(n)?((r={})[n]=a,r):{})},{})),resources:d({},i.resources||{},(r={},r[t]=Ve,r))})}(o,n)})},RESET_ALL:function(){return{}}},lt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:st;return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0===t)return e;if(!r.type||!r.type.startsWith("@@rest-easy"))return t;var n=ft[it(r.type).caseName];return n?n(t,r):t}}(),dt=function(){var e,t={RESET_ALL:v("@global","@reset","RESET_ALL")};return{resetAll:(e=t.RESET_ALL,function(){return{type:e}})}};e.connect=function(){for(var e=arguments.length,r=Array(e),n=0;e>n;n++)r[n]=arguments[n];return function(e){var n=e.displayName||e.name||"Component",o=function(n){function o(t){l(this,o);var a=p(this,n.call(this,t));return a.onInjectProps=function(e,t){a.setState(function(r){var n;return r.__requestURLsByActionKey[e]!==t?{__requestURLsByActionKey:d({},r.__requestURLsByActionKey,(n={},n[e]=t,n))}:null})},a.getWrappedInstance=function(){return a.innerRef&&a.innerRef.getWrappedInstance?a.innerRef.getWrappedInstance():null},a.state={__requestURLsByActionKey:{}},a.ConnectedComponent=h(a.onInjectProps).apply(void 0,r)(e),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,n),o.prototype.render=function(){var e=this,r=this.ConnectedComponent,n=d({},this.props,this.state);return t.createElement(r,d({ref:function(t){e.innerRef=t}},n))},o}(t.Component);return o.displayName="EasyConnect("+n+")",s(o,e)}},e.createResource=function(e,t){return function(r){xe(e,t),Oe(e,r);var n=t||{},o=n.cacheLifetime,a=void 0===o?0:o,i=n.denormalizer,u=d({},g(e)),c=d({},function(e,t){return{resource:{getResource:function(r){var n=1>=arguments.length||void 0===arguments[1]||arguments[1];return at(Q(r),e,n,t)},getResourceById:function(r,n){var o=2>=arguments.length||void 0===arguments[2]||arguments[2];return function(e,t,r,n,o){return n&&o?o([r],e.resources)[0]||null:e.resources&&e.resources[t]&&e.resources[t][r]?e.resources[t][r]:null}(Q(r),e,n,o,t)}}}}(e,i));return Object.keys(r||{}).forEach(function(t){u=d({},u,ne(e,a,r||{},t)),c=d({},c,function(e,t,r){var n;return(n={})[t]={resource:{couldPerform:function(r){return!$e(Q(r),e,t)},isPerforming:function(r){return $e(Q(r),e,t)},isValid:function(r){return!We(Q(r),e,t,"didInvalidate")},hasSucceeded:function(r){return We(Q(r),e,t,"hasSucceeded")},hasFailed:function(r){return We(Q(r),e,t,"hasFailed")},couldPerformOnId:function(r,n){return!$e(Q(r),e,t,n)},isPerformingOnId:function(r,n){return $e(Q(r),e,t,n)},hasSucceededOnId:function(r,n){return We(Q(r),e,t,"hasSucceeded",n)},hasFailedOnId:function(r,n){return We(Q(r),e,t,"hasFailed",n)},isValidId:function(r,n){return!We(Q(r),e,t,"didInvalidate",n)}},request:{getResource:function(n,o){var a=2>=arguments.length||void 0===arguments[2]||arguments[2];return et(Q(n),e,Ne(e,t,o),a,r)},getMetadata:function(r,n){return function(e,t){return e.requests&&e.requests[t]&&e.requests[t].metadata?e.requests[t].metadata:{}}(Q(r),Ne(e,t,n))},couldPerform:function(r,n){return!tt(Q(r),Ne(e,t,n))},isPerforming:function(r,n){return tt(Q(r),Ne(e,t,n))},isValid:function(r,n){return!rt(Q(r),Ne(e,t,n),"didInvalidate")},hasSucceeded:function(r,n){return rt(Q(r),Ne(e,t,n),"hasSucceeded")},hasFailed:function(r,n){return rt(Q(r),Ne(e,t,n),"hasFailed")}}},n}(e,t,i))}),{actions:u,selectors:c}}},e.reducer=lt,e.reset=function(){return(0,dt().resetAll)()},e.initializeNetworkHelpers=function(e){!function(e){X=e?d({},W,e):W}(e)},e.getPersistableState=function(e,t){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.alwaysPersist,n=t.neverPersist;if(!e||!Object.keys(e).length)return{};var o="string"==typeof r?[r]:r,a="string"==typeof n?[n]:n,i=Object.entries(e.requests||{}).reduce(function(e,t){var r,n,i=t[0],u=t[1];return d({},e,u.endedAt&&o&&u.payloadIds&&Object.keys(u.payloadIds).some(function(e){return o.includes(e)})?((r={})[i]=u,r):a&&u.payloadIds&&Object.keys(u.payloadIds).some(function(e){return a.includes(e)})||!u.endedAt||u.didInvalidate||K(u.expireAt)?{}:((n={})[i]="never"===u.expireAt?d({},u,{didInvalidate:!0}):u,n))},{}),u=Object.values(i||{}).reduce(function(e,t){return d({},e,Object.entries(t.payloadIds||{}).reduce(function(e,t){var r,n=t[0];return d({},e,((r={})[n]=[].concat(e[n]||[],t[1].map(function(e){return""+e})),r))},{}))},{}),c=Object.entries(e.resources||{}).reduce(function(e,t){var r,n=t[0];return d({},e,((r={})[n]=Object.entries(t[1]||{}).reduce(function(e,t){var r,o=t[0],a=t[1];return d({},e,u[n]&&u[n].includes(o)?((r={})[o]=a,r):{})},{}),r))},{}),s=Object.entries(c||{}).reduce(function(e,t){var r,n=t[0],o=t[1];return d({},e,Object.keys(o).length?((r={})[n]=o,r):{})},{}),f=d({},e.resolversHashes||{},{requests:Object.entries(e.resolversHashes&&e.resolversHashes.requests?e.resolversHashes.requests:{}).reduce(function(e,t){var r,n=t[0];return d({},e,i[n]?((r={})[n]=t[1],r):{})},{}),resources:Object.entries(e.resolversHashes&&e.resolversHashes.resources?e.resolversHashes.resources:{}).reduce(function(t,r){var n,o=r[0],a=r[1];return d({},t,s[o]&&Object.keys(e.resources&&e.resources[o]?e.resources[o]:{}).length===Object.keys(s[o]||{}).length?((n={})[o]=a,n):{})},{})});return d({},e,{requests:i,resources:s,resolversHashes:f})}(e,t)},Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-redux")):"function"==typeof define&&define.amd?define(["exports","react","react-redux"],t):t(e.ReduxRestEasy={},e.React,e.ReactRedux)}(this,function(e,t,r){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var n="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function o(e,t){return e(t={exports:{}},t.exports),t.exports}o(function(e){!function(t){var r,n=Object.prototype,o=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag",s=t.regeneratorRuntime;if(s)e.exports=s;else{(s=t.regeneratorRuntime=e.exports).wrap=b;var f="suspendedStart",l="suspendedYield",d="executing",p="completed",h={},v={};v[i]=function(){return this};var y=Object.getPrototypeOf,g=y&&y(y(R([])));g&&g!==n&&o.call(g,i)&&(v=g);var m=E.prototype=_.prototype=Object.create(v);j.prototype=m.constructor=E,E.constructor=j,E[c]=j.displayName="GeneratorFunction",s.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===j||"GeneratorFunction"===(t.displayName||t.name))},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,c in e||(e[c]="GeneratorFunction")),e.prototype=Object.create(m),e},s.awrap=function(e){return{__await:e}},O(w.prototype),w.prototype[u]=function(){return this},s.AsyncIterator=w,s.async=function(e,t,r,n){var o=new w(b(e,t,r,n));return s.isGeneratorFunction(t)?o:o.next().then(function(e){return e.done?e.value:o.next()})},O(m),m[c]="Generator",m[i]=function(){return this},m.toString=function(){return"[object Generator]"},s.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},s.values=R,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=r,this.done=!1,this.delegate=null,this.method="next",this.arg=r,this.tryEntries.forEach(I),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=r)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,o){return u.type="throw",u.arg=e,t.next=n,o&&(t.method="next",t.arg=r),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],u=i.completion;if("root"===i.tryLoc)return n("end");if(this.prev>=i.tryLoc){var c=o.call(i,"catchLoc"),s=o.call(i,"finallyLoc");if(c&&s){if(i.catchLoc>this.prev)return n(i.catchLoc,!0);if(i.finallyLoc>this.prev)return n(i.finallyLoc)}else if(c){if(i.catchLoc>this.prev)return n(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(i.finallyLoc>this.prev)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(this.prev>=n.tryLoc&&o.call(n,"finallyLoc")&&n.finallyLoc>this.prev){var a=n;break}}!a||"break"!==e&&"continue"!==e||a.tryLoc>t||t>a.finallyLoc||(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:R(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),h}}}function b(e,t,r,n){var o=Object.create((t&&t.prototype instanceof _?t:_).prototype),a=new S(n||[]);return o._invoke=function(e,t,r){var n=f;return function(o,a){if(n===d)throw Error("Generator is already running");if(n===p){if("throw"===o)throw a;return q()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var u=C(i,r);if(u){if(u===h)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===f)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var c=A(e,t,r);if("normal"===c.type){if(n=r.done?p:l,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=p,r.method="throw",r.arg=c.arg)}}}(e,r,a),o}function A(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function _(){}function j(){}function E(){}function O(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function w(e){var t;this._invoke=function(r,n){function a(){return new Promise(function(t,a){!function t(r,n,a,i){var u=A(e[r],e,n);if("throw"!==u.type){var c=u.arg,s=c.value;return s&&"object"==typeof s&&o.call(s,"__await")?Promise.resolve(s.__await).then(function(e){t("next",e,a,i)},function(e){t("throw",e,a,i)}):Promise.resolve(s).then(function(e){c.value=e,a(c)},i)}i(u.arg)}(r,n,t,a)})}return t=t?t.then(a,a):a()}}function C(e,t){var n=e.iterator[t.method];if(n===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=r,C(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var o=A(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,h;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,h):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function R(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n<e.length;)if(o.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=r,t.done=!0,t};return a.next=a}}return{next:q}}function q(){return{value:r,done:!0}}}(function(){return this}()||Function("return this")())});var a,i,u,c,s=o(function(e,t){var r,n,o,a,i,u,c,s;e.exports=(r={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o=Object.defineProperty,a=Object.getOwnPropertyNames,i=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,s=(c=Object.getPrototypeOf)&&c(Object),function e(t,f,l){if("string"!=typeof f){if(s){var d=c(f);d&&d!==s&&e(t,d,l)}var p=a(f);i&&(p=p.concat(i(f)));for(var h=0;p.length>h;++h){var v=p[h];if(!(r[v]||n[v]||l&&l[v])){var y=u(f,v);try{o(t,v,y)}catch(e){}}}return t}return t})}),f=function(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){return function n(o,a){try{var i=t[o](a),u=i.value}catch(e){return void r(e)}if(!i.done)return Promise.resolve(u).then(function(e){n("next",e)},function(e){n("throw",e)});e(u)}("next")})}},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},d=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},p=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},h=function(e){return function(t,n){for(var o=arguments.length,a=Array(o>2?o-2:0),i=2;o>i;i++)a[i-2]=arguments[i];return r.connect.apply(void 0,[t,n&&"function"==typeof n?function(){var t=n.apply(void 0,arguments);return Object.keys(t).reduce(function(r,n){var o;return d({},r,((o={})[n]=function(){var r=t[n].apply(t,arguments);return r&&r.__actionName&&r.__requestURL&&(e(r.__actionName,r.__requestURL),delete r.__actionName,delete r.__requestURL),r},o))},{})}:n].concat(a))}},v=function(e,t){return function(r){return{type:e,resourceName:t,resourceId:r}}},y=function(e,t,r){return"@@rest-easy/"+e+"/"+t+"/"+r.toUpperCase()},g=function(e){var t=function(e){return{INVALIDATE_RESOURCE:y(e,"@invalidate","INVALIDATE_RESOURCE"),INVALIDATE_ID:y(e,"@invalidate","INVALIDATE_ID"),RESET_RESOURCE:y(e,"@reset","RESET_RESOURCE")}}(e),r=t.INVALIDATE_ID,n=t.RESET_RESOURCE;return{resource:{invalidate:v(t.INVALIDATE_RESOURCE,e),invalidateId:v(r,e),reset:v(n,e)}}},m=function(e,t){return function(r,n,o,a,i){return{type:t,url:r,resourceId:n,payload:o&&Object.keys(o).length?o:void 0,metadata:a,principalResourceIds:"string"==typeof i?[i]:i,cacheLifetime:e}}},b=function(e,t,r){var n=function(e,t){return{REQUEST:y(e,t,"REQUEST"),RECEIVE:y(e,t,"RECEIVE"),FAIL:y(e,t,"FAIL"),RECEIVE_FROM_CACHE:y(e,t,"RECEIVE_FROM_CACHE")}}(e,t),o=n.RECEIVE,a=n.FAIL,i=n.RECEIVE_FROM_CACHE;return{REQUEST:m(r,n.REQUEST),RECEIVE:m(r,o),FAIL:m(r,a),RECEIVE_FROM_CACHE:m(r,i)}},A={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},_=function(e){throw{name:"SyntaxError",message:e,at:a,text:u}},j=function(e){return e&&e!==i&&_("Expected '"+e+"' instead of '"+i+"'"),i=u.charAt(a),a+=1,i},E=function(){var e,t="";for("-"===i&&(t="-",j("-"));i>="0"&&"9">=i;)t+=i,j();if("."===i)for(t+=".";j()&&i>="0"&&"9">=i;)t+=i;if("e"===i||"E"===i)for(t+=i,j(),"-"!==i&&"+"!==i||(t+=i,j());i>="0"&&"9">=i;)t+=i,j();if(isFinite(e=+t))return e;_("Bad number")},O=function(){var e,t,r,n="";if('"'===i)for(;j();){if('"'===i)return j(),n;if("\\"===i)if(j(),"u"===i){for(r=0,t=0;4>t&&(e=parseInt(j(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof A[i])break;n+=A[i]}else n+=i}_("Bad string")},w=function(){for(;i&&" ">=i;)j()};c=function(){switch(w(),i){case"{":return function(){var e,t={};if("{"===i){if(j("{"),w(),"}"===i)return j("}"),t;for(;i;){if(e=O(),w(),j(":"),Object.hasOwnProperty.call(t,e)&&_('Duplicate key "'+e+'"'),t[e]=c(),w(),"}"===i)return j("}"),t;j(","),w()}}_("Bad object")}();case"[":return function(){var e=[];if("["===i){if(j("["),w(),"]"===i)return j("]"),e;for(;i;){if(e.push(c()),w(),"]"===i)return j("]"),e;j(","),w()}}_("Bad array")}();case'"':return O();case"-":return E();default:return"0">i||i>"9"?function(){switch(i){case"t":return j("t"),j("r"),j("u"),j("e"),!0;case"f":return j("f"),j("a"),j("l"),j("s"),j("e"),!1;case"n":return j("n"),j("u"),j("l"),j("l"),null}_("Unexpected '"+i+"'")}():E()}};var C,x,I,S=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,R={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function q(e){return S.lastIndex=0,S.test(e)?'"'+e.replace(S,function(e){var t=R[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}var k,T=void 0!==JSON?JSON:{parse:function(e,t){var r;return u=e,a=0,i=" ",r=c(),w(),i&&_("Syntax error"),"function"==typeof t?function e(r,n){var o,a,i=r[n];if(i&&"object"==typeof i)for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(void 0!==(a=e(i,o))?i[o]=a:delete i[o]);return t.call(r,n,i)}({"":r},""):r},stringify:function(e,t,r){var n;if(C="",x="","number"==typeof r)for(n=0;r>n;n+=1)x+=" ";else"string"==typeof r&&(x=r);if(I=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw Error("JSON.stringify");return function e(t,r){var n,o,a,i,u,c=C,s=r[t];switch(s&&"object"==typeof s&&"function"==typeof s.toJSON&&(s=s.toJSON(t)),"function"==typeof I&&(s=I.call(r,t,s)),typeof s){case"string":return q(s);case"number":return isFinite(s)?s+"":"null";case"boolean":case"null":return s+"";case"object":if(!s)return"null";if(C+=x,u=[],"[object Array]"===Object.prototype.toString.apply(s)){for(i=s.length,n=0;i>n;n+=1)u[n]=e(n,s)||"null";return a=0===u.length?"[]":C?"[\n"+C+u.join(",\n"+C)+"\n"+c+"]":"["+u.join(",")+"]",C=c,a}if(I&&"object"==typeof I)for(i=I.length,n=0;i>n;n+=1)"string"==typeof(o=I[n])&&(a=e(o,s))&&u.push(q(o)+(C?": ":":")+a);else for(o in s)Object.prototype.hasOwnProperty.call(s,o)&&(a=e(o,s))&&u.push(q(o)+(C?": ":":")+a);return a=0===u.length?"{}":C?"{\n"+C+u.join(",\n"+C)+"\n"+c+"}":"{"+u.join(",")+"}",C=c,a}}("",{"":e})}},L=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var n,o="boolean"==typeof t.cycles&&t.cycles,a=t.replacer||function(e,t){return t},i=t.cmp&&(n=t.cmp,function(e){return function(t,r){return n({key:t,value:e[t]},{key:r,value:e[r]})}}),u=[];return function e(t,n,c,s){var f=r?"\n"+Array(s+1).join(r):"",l=r?": ":":";if(c&&c.toJSON&&"function"==typeof c.toJSON&&(c=c.toJSON()),void 0!==(c=a.call(t,n,c))){if("object"!=typeof c||null===c)return T.stringify(c);if(N(c)){for(var d=[],p=0;c.length>p;p++){var h=e(c,p,c[p],s+1)||T.stringify(null);d.push(f+r+h)}return"["+d.join(",")+f+"]"}if(-1!==u.indexOf(c)){if(o)return T.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}u.push(c);var v=P(c).sort(i&&i(c));for(d=[],p=0;v.length>p;p++){var y=e(c,n=v[p],c[n],s+1);if(y){var g=T.stringify(n)+l+y;d.push(f+r+g)}}return u.splice(u.indexOf(c),1),"{"+d.join(",")+f+"}"}}({"":e},"",e,0)},N=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},P=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},r=[];for(var n in e)t.call(e,n)&&r.push(n);return r},F=o(function(e,t){var r=Object.prototype.hasOwnProperty,n=function(){for(var e=[],t=0;256>t;++t)e.push("%"+((16>t?"0":"")+t.toString(16)).toUpperCase());return e}();t.arrayToObject=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;e.length>n;++n)void 0!==e[n]&&(r[n]=e[n]);return r},t.merge=function(e,n,o){if(!n)return e;if("object"!=typeof n){if(Array.isArray(e))e.push(n);else{if("object"!=typeof e)return[e,n];(o.plainObjects||o.allowPrototypes||!r.call(Object.prototype,n))&&(e[n]=!0)}return e}if("object"!=typeof e)return[e].concat(n);var a=e;return Array.isArray(e)&&!Array.isArray(n)&&(a=t.arrayToObject(e,o)),Array.isArray(e)&&Array.isArray(n)?(n.forEach(function(n,a){r.call(e,a)?e[a]&&"object"==typeof e[a]?e[a]=t.merge(e[a],n,o):e.push(n):e[a]=n}),e):Object.keys(n).reduce(function(e,a){var i=n[a];return e[a]=r.call(e,a)?t.merge(e[a],i,o):i,e},a)},t.assign=function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},t.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},t.encode=function(e){if(0===e.length)return e;for(var t="string"==typeof e?e:e+"",r="",o=0;t.length>o;++o){var a=t.charCodeAt(o);45!==a&&46!==a&&95!==a&&126!==a&&(48>a||a>57)&&(65>a||a>90)&&(97>a||a>122)?128>a?r+=n[a]:2048>a?r+=n[192|a>>6]+n[128|63&a]:a>=55296&&57344>a?(a=65536+((1023&a)<<10|1023&t.charCodeAt(o+=1)),r+=n[240|a>>18]+n[128|a>>12&63]+n[128|a>>6&63]+n[128|63&a]):r+=n[224|a>>12]+n[128|a>>6&63]+n[128|63&a]:r+=t.charAt(o)}return r},t.compact=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;t.length>n;++n)for(var o=t[n],a=o.obj[o.prop],i=Object.keys(a),u=0;i.length>u;++u){var c=i[u],s=a[c];"object"==typeof s&&null!==s&&-1===r.indexOf(s)&&(t.push({obj:a,prop:c}),r.push(s))}return function(e){for(var t;e.length;){var r=e.pop();if(Array.isArray(t=r.obj[r.prop])){for(var n=[],o=0;t.length>o;++o)void 0!==t[o]&&n.push(t[o]);r.obj[r.prop]=n}}return t}(t)},t.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},t.isBuffer=function(e){return null!=e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}}),H=String.prototype.replace,D=/%20/g,U={default:"RFC3986",formatters:{RFC1738:function(e){return H.call(e,D,"+")},RFC3986:function(e){return e}},RFC1738:"RFC1738",RFC3986:"RFC3986"},z={brackets:function(e){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},B=Date.prototype.toISOString,V={delimiter:"&",encode:!0,encoder:F.encode,encodeValuesOnly:!1,serializeDate:function(e){return B.call(e)},skipNulls:!1,strictNullHandling:!1},M=function e(t,r,n,o,a,i,u,c,s,f,l,d){var p=t;if("function"==typeof u)p=u(r,p);else if(p instanceof Date)p=f(p);else if(null===p){if(o)return i&&!d?i(r,V.encoder):r;p=""}if("string"==typeof p||"number"==typeof p||"boolean"==typeof p||F.isBuffer(p))return i?[l(d?r:i(r,V.encoder))+"="+l(i(p,V.encoder))]:[l(r)+"="+l(p+"")];var h,v=[];if(void 0===p)return v;if(Array.isArray(u))h=u;else{var y=Object.keys(p);h=c?y.sort(c):y}for(var g=0;h.length>g;++g){var m=h[g];a&&null===p[m]||(v=v.concat(e(p[m],Array.isArray(p)?n(r,m):r+(s?"."+m:"["+m+"]"),n,o,a,i,u,c,s,f,l,d)))}return v},G=function(e,t){var r=e,n=t?F.assign({},t):{};if(null!=n.encoder&&"function"!=typeof n.encoder)throw new TypeError("Encoder has to be a function.");var o=void 0===n.delimiter?V.delimiter:n.delimiter,a="boolean"==typeof n.strictNullHandling?n.strictNullHandling:V.strictNullHandling,i="boolean"==typeof n.skipNulls?n.skipNulls:V.skipNulls,u="boolean"==typeof n.encode?n.encode:V.encode,c="function"==typeof n.encoder?n.encoder:V.encoder,s="function"==typeof n.sort?n.sort:null,f=void 0!==n.allowDots&&n.allowDots,l="function"==typeof n.serializeDate?n.serializeDate:V.serializeDate,d="boolean"==typeof n.encodeValuesOnly?n.encodeValuesOnly:V.encodeValuesOnly;if(void 0===n.format)n.format=U.default;else if(!Object.prototype.hasOwnProperty.call(U.formatters,n.format))throw new TypeError("Unknown format option provided.");var p,h,v=U.formatters[n.format];"function"==typeof n.filter?r=(h=n.filter)("",r):Array.isArray(n.filter)&&(p=h=n.filter);var y=[];if("object"!=typeof r||null===r)return"";var g=z[n.arrayFormat in z?n.arrayFormat:"indices"in n?n.indices?"indices":"repeat":"indices"];p||(p=Object.keys(r)),s&&p.sort(s);for(var m=0;p.length>m;++m){var b=p[m];i&&null===r[b]||(y=y.concat(M(r[b],b,g,a,i,u?c:null,h,s,f,l,v,d)))}var A=y.join(o);return A.length>0?(!0===n.addQueryPrefix?"?":"")+A:""},J=function(e){var t,r=(t=e)&&Object.keys(t)?G(t):"";return r?"?"+r:""},Q=function(e){return e&&e.restEasy?e.restEasy:(console.error('\n There doesn\'t seem to be a "restEasy" key in your state.\n\n For more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/reducer.md#reducer\n '),null)},K=function(e){return"never"!==e&&(!e||new Date>new Date(e))},Y=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];if(e&&"function"==typeof e)return e.apply(void 0,r)},$=window,W={getToken:function(){return"token"},requestGET:function(){var e=this;return f(regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.getToken,!t.t0){t.next=5;break}return t.next=4,e.getToken();case 4:t.t0=t.sent;case 5:return t.abrupt("return",{method:"GET",headers:d({Accept:"application/json"},(r=t.t0)?{Authorization:"Bearer "+r}:{})});case 7:case"end":return t.stop()}},t,e)}))()},requestPATCH:function(e){var t=this;return f(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=t.getToken,!r.t0){r.next=5;break}return r.next=4,t.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"PATCH",headers:d({Accept:"application/json","Content-Type":"application/json"},(n=r.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return r.stop()}},r,t)}))()},requestPUT:function(e){var t=this;return f(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=t.getToken,!r.t0){r.next=5;break}return r.next=4,t.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"PUT",headers:d({Accept:"application/json","Content-Type":"application/json"},(n=r.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return r.stop()}},r,t)}))()},requestPOST:function(e){var t=this;return f(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.t0=t.getToken,!r.t0){r.next=5;break}return r.next=4,t.getToken();case 4:r.t0=r.sent;case 5:return r.abrupt("return",{method:"POST",headers:d({Accept:"application/json","Content-Type":"application/json"},(n=r.t0)?{Authorization:"Bearer "+n}:{}),body:JSON.stringify(e)});case 7:case"end":return r.stop()}},r,t)}))()},requestDELETE:function(){var e=this;return f(regeneratorRuntime.mark(function t(){var r;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=e.getToken,!t.t0){t.next=5;break}return t.next=4,e.getToken();case 4:t.t0=t.sent;case 5:return r=t.t0,t.abrupt("return",{method:"DELETE",headers:d({Accept:"application/json"},e.getToken&&e.getToken()?{Authorization:"Bearer "+r}:{})});case 7:case"end":return t.stop()}},t,e)}))()},handleStatusCode:function(e){if(e){if(e.status>=200&&300>e.status)return e;var t=Error(e.statusText);throw t.response=e,t}return null},handleError:(k=f(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!t||!t.response){e.next=8;break}return e.next=4,t.response.json();case 4:console.error(e.sent),e.next=9;break;case 8:console.error(t);case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(0),console.error(e.t0);case 14:case"end":return e.stop()}},e,$,[[0,11]])})),function(e,t){return k.apply(this,arguments)})},X=W,Z=function(){return X},ee=window,te=function(e,t,r,n,o,a,i,u){return function(e,c,s){return function(){var l,p=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},h=p.query,v=void 0===h?{}:h,y=p.body,g=void 0===y?{}:y,m=p.urlParams,b=void 0===m?{}:m,A=p.onSuccess,_=p.onError,j=function(e,t){var r={};for(var n in e)0>t.indexOf(n)&&Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(p,["query","body","urlParams","onSuccess","onError"]);return l=f(regeneratorRuntime.mark(function f(l,p){var h,y,m,E,O,w,C,x;return regeneratorRuntime.wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return h=d({},Z(),u||{}),l(t.REQUEST(c,s)),f.prev=2,f.next=5,Y(n,b,v,g,j,l);case 5:return y=f.sent||g,f.t0=fetch,f.t1=e,f.next=11,h["request"+r](y);case 11:return f.t2=f.sent,f.next=14,(0,f.t0)(f.t1,f.t2);case 14:if(h.handleStatusCode(m=f.sent),204===m.status){f.next=22;break}return f.next=19,m.json();case 19:f.t3=f.sent,f.next=23;break;case 22:f.t3={};case 23:return E=f.t3,O=o?o(E,Q(p()).resources,b,v,y,j):{entities:E},w=O.entities,C=O.result,x=a?a(E,Q(p()).resources,b,v,y,j):null,l(t.RECEIVE(c,s,w,x,Array.isArray(C)?C:[C])),f.next=30,Y(i,w||{},b,v,y,j,l);case 30:return Y(A,w||{},j),f.abrupt("return",{normalizedPayload:w||{},otherArgs:j});case 34:return f.prev=34,f.t4=f.catch(2),l(t.FAIL(c,s)),h.handleError(f.t4,l),Y(_,f.t4),f.abrupt("return",{error:f.t4});case 40:case"end":return f.stop()}},f,ee,[[2,34]])})),function(e,t){return l.apply(this,arguments)}}}},re=function(e,t,r,n){var o=r[n],a=o.method,i=o.url,u=o.cacheHint,c=o.beforeHook,s=o.normalizer,f=o.metadataNormalizer,l=o.afterHook,d=o.networkHelpers,p=b(e,n,t),h=te(0,p,a,c,s,f,l,d);return function(t){return function(r,o){var c=Q(o()),s=t||{},f=s.urlParams,l=s.query,d=s.body,v=s.otherArgs,y=function(e){var t=("string"!=typeof e?e():e).split("/").reverse(),r=t.findIndex(function(e){return e.startsWith("::")});return-1!==r?t.length-1-r:-1}(i),g=function(e,t,r){var n="string"!=typeof e?e():e;t&&Object.keys(t).forEach(function(e){n=n.replace("::"+e,t[e]).replace(":"+e,t[e])});var o=r?J(JSON.parse(L(r))):"";return""+n+o}(i,f,l),m=u?u(f,l,d,v):null,b=function(e,t,r){return(e||"")+(t?":"+t:"")+(r?":"+J(r):"")}(n,g,m),A=function(e,t){if(!e||!t&&0!==t||-1===t)return null;for(var r=0,n=0;t>n;n+=1)r=e.indexOf("/",r+1);var o=e.indexOf("/",r+1);return e.substr(r+1,-1!==o?o-r-1:e.length)}(b,y),_=void 0;(function(e,t){return!(e&&t&&e.requests&&e.requests[t]&&!e.requests[t].endedAt)})(c,b)&&function(e,t,r){if(!("GET"===t&&e&&r&&e.requests&&e.requests[r]))return!0;var n=e.requests[r];return!n.hasSucceeded||n.didInvalidate||K(n.expireAt)}(c,a,b)&&(_=function(e,t,r,n){return!!("GET"===t&&e&&e.requests&&r&&null!==n)&&Object.values(e.requests).some(function(e){var t=e.expireAt,o=e.payloadIds;return e.hasSucceeded&&!e.didInvalidate&&(r===e.resourceName&&n===e.resourceId||o&&o[r]&&o[r].includes(n))&&!K(t)})}(c,a,e,A)?function(){var t,n;return r(p.RECEIVE_FROM_CACHE(b,A,((n={})[e]=((t={})[A]=null,t),n),null,[A]))}:function(){return r(h(g,b,A)(t))});var j=_?_():{};return j.__actionName=n,j.__requestURL=b,j}}},ne=function(e,t,r,n){var o,a=function(e){return{INVALIDATE_REQUEST:y(e,"@invalidate","INVALIDATE_REQUEST")}}(e).INVALIDATE_REQUEST;return(o={})[n]={perform:re(e,t,r,n),invalidate:function(e,t){return function(r){return{type:e,url:r,resourceName:t}}}(a,e)},o},oe="[object Object]";var ae,ie,ue=Object.prototype,ce=Function.prototype.toString,se=ue.hasOwnProperty,fe=ce.call(Object),le=ue.toString,de=(ae=Object.getPrototypeOf,ie=Object,function(e){return ae(ie(e))});var pe,he=function(e){if(!function(e){return!!e&&"object"==typeof e}(e)||le.call(e)!=oe||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e))return!1;var t=de(e);if(null===t)return!0;var r=se.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&ce.call(r)==fe},ve=function(e){return function(t){throw Error("redux-rest-easy: "+e+" "+t)}},ye=function(e){return"string"==typeof e},ge=function(e){return"function"==typeof e},me=function(e){return void 0!==e},be=["method","url"],Ae=[].concat(be,["cacheHint","beforeHook","normalizer","metadataNormalizer","afterHook","networkHelpers"]),_e=["GET","POST","PATCH","PUT","DELETE"],je=function(e){return e+" >"},Ee=function(e,t){return e+' "'+t+'" is invalid. Expected a valid function.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'},Oe=function(e,t){if(t){if(!he(t)||!Object.keys(t).length)ve(je(e)+" createResource >")("You have to provide a valid actions configuration.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource.md#createresourceresourcename-optionsactions");Object.keys(t).forEach(function(r){var n=ve(je(e)+" "+function(e){return e+" >"}(r)+" createResource >"),o=t[r],a=Object.keys(o);be.forEach(function(e){a.includes(e)||n('Key "'+e+'" is missing.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig')}),a.forEach(function(e){Ae.includes(e)||n(function(e){return'Unknown key "'+e+'".\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'}(e))});var i=o.method,u=o.url,c=o.cacheHint,s=o.beforeHook,f=o.normalizer,l=o.metadataNormalizer,d=o.afterHook,p=o.networkHelpers;ye(i)&&_e.includes(i)||n(function(e){return'Method "'+e+'" is invalid. Expected one of: '+_e.join(", ")+".\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig"}(i)),u&&(ye(u)||ge(u))||n(function(e){return'URL "'+e+'" is invalid. Expected a string or a function returning a string.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'}(u)),me(c)&&!ge(c)&&n(Ee("cacheHint",c)),me(s)&&!ge(s)&&n(Ee("beforeHook",s)),me(f)&&!ge(f)&&n(Ee("normalizer",f)),me(l)&&!ge(l)&&n(Ee("metadataNormalizer",l)),me(d)&&!ge(d)&&n(Ee("afterHook",d)),me(p)&&!he(p)&&n("networkHelpers"+' "'+p+'" is invalid. Expected a valid object.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig'),Object.keys(p||{}).forEach(function(e){me(p[e])&&!ge(p[e])&&n(e+' "networkHelpers.'+p[e]+'" is invalid. Expected a valid function.\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/actionsConfig.md#actionsconfig')})})}},we=function(e){return void 0!==e},Ce=["cacheLifetime","denormalizer"],xe=function(e,t){var r,n=(r=function(e){return e+" >"}(e||"[no resource name]")+" createResource >",function(e){throw Error("redux-rest-easy: "+r+" "+e)});if(e&&"string"==typeof e||n("You have to provide a valid resource name."),t){he(t)&&Object.keys(t).length||n("You have to provide a valid resource configuration (or not at all)."),Object.keys(t).forEach(function(e){Ce.includes(e)||n(function(e){return'Unknown key "'+e+'" in resource config.'}(e))});var o=t.cacheLifetime,a=t.denormalizer;!we(o)||function(e){return"number"==typeof e}(o)&&o>=0||n(function(e){return'cacheLifetime "'+e+'" in resource config is invalid. Expected a number between 0 and Infinity.'}(o)),we(a)&&!function(e){return"function"==typeof e}(a)&&n(function(e,t){return e+' "'+t+'" in resource config is invalid. Expected a valid function.'}("denormalizer",a))}},Ie=o(function(e,t){function r(e,t){return e===t}function n(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:r,n=null,o=null;return function(){return function(e,t,r){if(null===t||null===r||t.length!==r.length)return!1;for(var n=t.length,o=0;n>o;o++)if(!e(t[o],r[o]))return!1;return!0}(t,n,arguments)||(o=e.apply(null,arguments)),n=arguments,o}}function o(e){for(var t=arguments.length,r=Array(t>1?t-1:0),o=1;t>o;o++)r[o-1]=arguments[o];return function(){for(var t=arguments.length,o=Array(t),a=0;t>a;a++)o[a]=arguments[a];var i=0,u=o.pop(),c=function(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every(function(e){return"function"==typeof e})){var r=t.map(function(e){return typeof e}).join(", ");throw Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+r+"]")}return t}(o),s=e.apply(void 0,[function(){return i++,u.apply(null,arguments)}].concat(r)),f=n(function(){for(var e=[],t=c.length,r=0;t>r;r++)e.push(c[r].apply(null,arguments));return s.apply(null,e)});return f.resultFunc=u,f.recomputations=function(){return i},f.resetRecomputations=function(){return i=0},f}}t.__esModule=!0,t.defaultMemoize=n,t.createSelectorCreator=o,t.createStructuredSelector=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;if("object"!=typeof e)throw Error("createStructuredSelector expects first argument to be an object where each property is a selector, instead received a "+typeof e);var r=Object.keys(e);return t(r.map(function(t){return e[t]}),function(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return t.reduce(function(e,t,n){return e[r[n]]=t,e},{})})};var a=t.createSelector=o(n)});(pe=Ie)&&pe.__esModule&&Object.prototype.hasOwnProperty.call(pe,"default");var Se=Ie.createSelectorCreator,Re=Ie.createSelector,qe=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},ke=function(){function e(){qe(this,e),this._cache={}}return e.prototype.set=function(e,t){this._cache[e]=t},e.prototype.get=function(e){return this._cache[e]},e.prototype.remove=function(e){delete this._cache[e]},e.prototype.clear=function(){this._cache={}},e}();function Te(){for(var e=arguments.length,t=Array(e),r=0;e>r;r++)t[r]=arguments[r];var n=ke;return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=void 0,a=void 0;"function"==typeof r?(console.warn('[re-reselect] Deprecation warning: "selectorCreator" argument is discouraged and will be removed in the upcoming major release. Please use "options.selectorCreator" instead.'),o=new n,a=r):(o=r.cacheObject||new n,a=r.selectorCreator||Re);var i=function(){var r=e.apply(void 0,arguments);if("string"==typeof r||"number"==typeof r){var n=o.get(r);return void 0===n&&(n=a.apply(void 0,t),o.set(r,n)),n.apply(void 0,arguments)}};return i.getMatchingSelector=function(){var t=e.apply(void 0,arguments);return o.get(t)},i.removeMatchingSelector=function(){var t=e.apply(void 0,arguments);o.remove(t)},i.clearCache=function(){o.clear()},i.resultFunc=t[t.length-1],i}}var Le=function(e){return e.split(":")[0]},Ne=function(e,t,r){return r?r.__requestURLsByActionKey?r.__requestURLsByActionKey[t]:(console.error("You may have forgotten to use redux-rest-easy's connect on a Component which requested "+e+"."+t+"\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/connect.md#connectconnectargs"),""):(console.error("You may have forgotten to pass ownProps to a selector related to "+e+"."+t+"\n\nFor more information, browse the related documentation: https://github.com/Brigad/redux-rest-easy/blob/master/docs/api/createResource/selectors.md#actionrequest"),"")},Pe={selectorCreator:Se(function(e){var t=null;return function(){return t||(t=e.apply(void 0,arguments)),t}})},Fe=function(){return Pe},He=function(e,t,r){return t?Object.keys(t).reduce(function(n,o){var a;return d({},n,((a={})[o]=o===e?r:Object.keys(t[o]||{}),a))},{}):{}},De=o(function(e,t){!function(r,n){var o={version:"2.1.2",x86:{},x64:{}};function a(e,t){return(65535&e)*t+(((e>>>16)*t&65535)<<16)}function i(e,t){return e<<t|e>>>32-t}function u(e){return e=a(e^=e>>>16,2246822507),e=a(e^=e>>>13,3266489909),e^=e>>>16}function c(e,t){var r=[0,0,0,0];return r[3]+=(e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]])[3]+(t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]])[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]+t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]+t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]+t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function s(e,t){var r=[0,0,0,0];return r[3]+=(e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]])[3]*(t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]])[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=e[2]*t[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=e[3]*t[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=e[1]*t[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[2]*t[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=e[3]*t[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]}function f(e,t){return 32===(t%=64)?[e[1],e[0]]:32>t?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:[e[1]<<(t-=32)|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t]}function l(e,t){return 0===(t%=64)?e:32>t?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function d(e,t){return[e[0]^t[0],e[1]^t[1]]}function p(e){return e=d(e=s(e=d(e=s(e=d(e,[0,e[0]>>>1]),[4283543511,3981806797]),[0,e[0]>>>1]),[3301882366,444984403]),[0,e[0]>>>1])}o.x86.hash32=function(e,t){for(var r=(e=e||"").length%4,n=e.length-r,o=t=t||0,c=0,s=3432918353,f=461845907,l=0;n>l;l+=4)o=a(o=i(o^=c=a(c=i(c=a(c=255&e.charCodeAt(l)|(255&e.charCodeAt(l+1))<<8|(255&e.charCodeAt(l+2))<<16|(255&e.charCodeAt(l+3))<<24,s),15),f),13),5)+3864292196;switch(c=0,r){case 3:c^=(255&e.charCodeAt(l+2))<<16;case 2:c^=(255&e.charCodeAt(l+1))<<8;case 1:o^=c=a(c=i(c=a(c^=255&e.charCodeAt(l),s),15),f)}return(o=u(o^=e.length))>>>0},o.x86.hash128=function(e,t){for(var r=(e=e||"").length%16,n=e.length-r,o=t=t||0,c=t,s=t,f=t,l=0,d=0,p=0,h=0,v=597399067,y=2869860233,g=951274213,m=2716044179,b=0;n>b;b+=16)l=255&e.charCodeAt(b)|(255&e.charCodeAt(b+1))<<8|(255&e.charCodeAt(b+2))<<16|(255&e.charCodeAt(b+3))<<24,d=255&e.charCodeAt(b+4)|(255&e.charCodeAt(b+5))<<8|(255&e.charCodeAt(b+6))<<16|(255&e.charCodeAt(b+7))<<24,p=255&e.charCodeAt(b+8)|(255&e.charCodeAt(b+9))<<8|(255&e.charCodeAt(b+10))<<16|(255&e.charCodeAt(b+11))<<24,h=255&e.charCodeAt(b+12)|(255&e.charCodeAt(b+13))<<8|(255&e.charCodeAt(b+14))<<16|(255&e.charCodeAt(b+15))<<24,o=i(o^=l=a(l=i(l=a(l,v),15),y),19),o=a(o+=c,5)+1444728091,c=i(c^=d=a(d=i(d=a(d,y),16),g),17),c=a(c+=s,5)+197830471,s=i(s^=p=a(p=i(p=a(p,g),17),m),15),s=a(s+=f,5)+2530024501,f=i(f^=h=a(h=i(h=a(h,m),18),v),13),f=a(f+=o,5)+850148119;switch(l=0,d=0,p=0,h=0,r){case 15:h^=e.charCodeAt(b+14)<<16;case 14:h^=e.charCodeAt(b+13)<<8;case 13:f^=h=a(h=i(h=a(h^=e.charCodeAt(b+12),m),18),v);case 12:p^=e.charCodeAt(b+11)<<24;case 11:p^=e.charCodeAt(b+10)<<16;case 10:p^=e.charCodeAt(b+9)<<8;case 9:s^=p=a(p=i(p=a(p^=e.charCodeAt(b+8),g),17),m);case 8:d^=e.charCodeAt(b+7)<<24;case 7:d^=e.charCodeAt(b+6)<<16;case 6:d^=e.charCodeAt(b+5)<<8;case 5:c^=d=a(d=i(d=a(d^=e.charCodeAt(b+4),y),16),g);case 4:l^=e.charCodeAt(b+3)<<24;case 3:l^=e.charCodeAt(b+2)<<16;case 2:l^=e.charCodeAt(b+1)<<8;case 1:o^=l=a(l=i(l=a(l^=e.charCodeAt(b),v),15),y)}return o^=e.length,o+=c^=e.length,o+=s^=e.length,c+=o+=f^=e.length,s+=o,f+=o,o=u(o),o+=c=u(c),o+=s=u(s),c+=o+=f=u(f),s+=o,f+=o,("00000000"+(o>>>0).toString(16)).slice(-8)+("00000000"+(c>>>0).toString(16)).slice(-8)+("00000000"+(s>>>0).toString(16)).slice(-8)+("00000000"+(f>>>0).toString(16)).slice(-8)},o.x64.hash128=function(e,t){for(var r=(e=e||"").length%16,n=e.length-r,o=[0,t=t||0],a=[0,t],i=[0,0],u=[0,0],h=[2277735313,289559509],v=[1291169091,658871167],y=0;n>y;y+=16)i=[255&e.charCodeAt(y+4)|(255&e.charCodeAt(y+5))<<8|(255&e.charCodeAt(y+6))<<16|(255&e.charCodeAt(y+7))<<24,255&e.charCodeAt(y)|(255&e.charCodeAt(y+1))<<8|(255&e.charCodeAt(y+2))<<16|(255&e.charCodeAt(y+3))<<24],u=[255&e.charCodeAt(y+12)|(255&e.charCodeAt(y+13))<<8|(255&e.charCodeAt(y+14))<<16|(255&e.charCodeAt(y+15))<<24,255&e.charCodeAt(y+8)|(255&e.charCodeAt(y+9))<<8|(255&e.charCodeAt(y+10))<<16|(255&e.charCodeAt(y+11))<<24],o=c(s(o=c(o=f(o=d(o,i=s(i=f(i=s(i,h),31),v)),27),a),[0,5]),[0,1390208809]),a=c(s(a=c(a=f(a=d(a,u=s(u=f(u=s(u,v),33),h)),31),o),[0,5]),[0,944331445]);switch(i=[0,0],u=[0,0],r){case 15:u=d(u,l([0,e.charCodeAt(y+14)],48));case 14:u=d(u,l([0,e.charCodeAt(y+13)],40));case 13:u=d(u,l([0,e.charCodeAt(y+12)],32));case 12:u=d(u,l([0,e.charCodeAt(y+11)],24));case 11:u=d(u,l([0,e.charCodeAt(y+10)],16));case 10:u=d(u,l([0,e.charCodeAt(y+9)],8));case 9:a=d(a,u=s(u=f(u=s(u=d(u,[0,e.charCodeAt(y+8)]),v),33),h));case 8:i=d(i,l([0,e.charCodeAt(y+7)],56));case 7:i=d(i,l([0,e.charCodeAt(y+6)],48));case 6:i=d(i,l([0,e.charCodeAt(y+5)],40));case 5:i=d(i,l([0,e.charCodeAt(y+4)],32));case 4:i=d(i,l([0,e.charCodeAt(y+3)],24));case 3:i=d(i,l([0,e.charCodeAt(y+2)],16));case 2:i=d(i,l([0,e.charCodeAt(y+1)],8));case 1:o=d(o,i=s(i=f(i=s(i=d(i,[0,e.charCodeAt(y)]),h),31),v))}return o=d(o,[0,e.length]),a=c(a=d(a,[0,e.length]),o=c(o,a)),o=p(o),a=c(a=p(a),o=c(o,a)),("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)+("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)},e.exports&&(t=e.exports=o),t.murmurHash3=o}()}),Ue=De,ze=o(function(e){e.exports={v3:Ue},function(){throw Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}.main===e&&console.log(e.exports.v3)}).v3,Be=function(e){return ze.x64.hash128(L(e||null))},Ve=Be([]),Me=function(e,t,r,n,o){var a,i,u=e.requests,c=void 0===u?{}:u,s=e.resources,f=void 0===s?{}:s,l=e.resolversHashes,p=void 0===l?{}:l,h=He(t,n,o);return d({},p,{requests:d({},p.requests||{},(a={},a[r]=Object.keys(h).reduce(function(e,t){var n;return d({},e,((n={})[t]=c[r]&&c[r].payloadIds&&c[r].payloadIds[t]?Be(c[r].payloadIds[t]):Ve,n))},{}),a)),resources:d({},p.resources||{},(i={_getResourcesHash:function(){return Be(f)}},i[t]=f[t]?Be(f[t]):Ve,i))})},Ge=function(){return Ve},Je=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).resolversHashes,t=void 0===e?{}:e,r=arguments[1],n=arguments[2];return t.requests&&t.requests[r]&&t.requests[r][n]?t.requests[r][n]:Ve},Qe=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).resolversHashes,t=void 0===e?{}:e,r=arguments[1];return t.resources&&t.resources[r]?t.resources[r]:Ve},Ke=[],Ye=function(e,t){return("number"==typeof e?""+e:e)===("number"==typeof t?""+t:t)},$e=function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:-1;return!!e.requests&&Object.entries(e.requests).some(function(e){var o=e[1],a=o.resourceName,i=o.resourceId,u=o.endedAt;return Le(e[0])===r&&a===t&&(-1===n||null!==i&&Ye(i,n))&&!u})},We=function(e,t,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:-1,a=e.requests&&Object.entries(e.requests).filter(function(e){var n=e[1],a=n.resourceName,i=n.resourceId,u=n.endedAt,c=n.payloadIds;return Le(e[0])===r&&a===t&&(-1===o||null!==i&&Ye(i,o)||!!u&&c&&c[t]&&c[t].includes(o))}).map(function(e){return e[1]});return!(!a||!a.length)&&a.reduce(function(e,t){return t.endedAt&&e.endedAt&&t.endedAt>e.endedAt?t:e},a[0])[n]},Xe=function(e,t){return e.resources&&e.resources[t]?e.resources[t]:null},Ze=function(e,t,r){return e.requests&&e.requests[r]&&e.requests[r].payloadIds&&e.requests[r].payloadIds[t]?e.requests[r].payloadIds[t]:null},et=Te(function(e){return e.resources},Xe,Ze,function(e,t,r,n){return n},function(e,t,r,n,o){return o},function(e,t,r,n,o){return t&&r?n&&o?o(r,e):r.reduce(function(e,r){return[].concat(e,[t[r]])},[]):Ke})(function(e,t,r,n,o){var a=Xe(e,t),i=Ze(e,t,r);return a&&i?n&&o?!(!n||!o)+"-"+Object.keys(e.requests[r].payloadIds).map(function(t){return Je(e,r,t)+"-"+Qe(e,t)}).join("--"):!(!n||!o)+"-"+Je(e,r,t)+"-"+Qe(e,t):Ge()},Fe()),tt=function(e,t){return!(!e.requests||!e.requests[t]||e.requests[t].endedAt)},rt=function(e,t,r){return!!(e.requests&&e.requests[t]&&e.requests[t][r])},nt=[],ot=function(e,t){return e.resources&&e.resources[t]?e.resources[t]:null},at=Te(function(e){return e.resources},ot,function(e,t,r){return r},function(e,t,r,n){return n},function(e,t,r,n){return t?r&&n?n(Object.keys(t),e):Object.values(t):nt})(function(e,t,r,n){return ot(e,t)?r&&n?!(!r||!n)+"-"+function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).resolversHashes,t=void 0===e?{}:e;return t.resources&&t.resources._getResourcesHash?t.resources._getResourcesHash():Ve}(e):!(!r||!n)+"-"+Qe(e,t):Ge()},Fe()),it=function(e,t){return{resource:{getResource:function(r){var n=1>=arguments.length||void 0===arguments[1]||arguments[1];return at(Q(r),e,n,t)},getResourceById:function(r,n){var o=2>=arguments.length||void 0===arguments[2]||arguments[2];return function(e,t,r,n,o){var a=e.resources&&e.resources[t]&&e.resources[t][r]?e.resources[t][r]:null;if(!n||!o||!a)return a;var i=Object.entries(e.resources).reduce(function(e,n){var o,i,u=n[0],c=n[1];return d({},e,((i={})[u]=u===t?((o={})[r]=a,o):c,i))},{});return o([r],i)[0]||null}(Q(r),e,n,o,t)}}}},ut=function(e){var t=e.split("/");return{resourceName:t[1],actionName:t[2],caseName:t[3]}},ct=o(function(e,t){var r=200,o="__lodash_hash_undefined__",a=800,i=16,u=9007199254740991,c="[object Arguments]",s="[object AsyncFunction]",f="[object Function]",l="[object GeneratorFunction]",d="[object Null]",p="[object Object]",h="[object Proxy]",v="[object Undefined]",y=/^\[object .+?Constructor\]$/,g=/^(?:0|[1-9]\d*)$/,m={};m["[object Float32Array]"]=m["[object Float64Array]"]=m["[object Int8Array]"]=m["[object Int16Array]"]=m["[object Int32Array]"]=m["[object Uint8Array]"]=m["[object Uint8ClampedArray]"]=m["[object Uint16Array]"]=m["[object Uint32Array]"]=!0,m[c]=m["[object Array]"]=m["[object ArrayBuffer]"]=m["[object Boolean]"]=m["[object DataView]"]=m["[object Date]"]=m["[object Error]"]=m[f]=m["[object Map]"]=m["[object Number]"]=m[p]=m["[object RegExp]"]=m["[object Set]"]=m["[object String]"]=m["[object WeakMap]"]=!1;var b="object"==typeof n&&n&&n.Object===Object&&n,A="object"==typeof self&&self&&self.Object===Object&&self,_=b||A||Function("return this")(),j=t&&!t.nodeType&&t,E=j&&e&&!e.nodeType&&e,O=E&&E.exports===j,w=O&&b.process,C=function(){try{return w&&w.binding&&w.binding("util")}catch(e){}}(),x=C&&C.isTypedArray;function I(e,t){return"__proto__"==t?void 0:e[t]}var S,R,q,k=Array.prototype,T=Object.prototype,L=_["__core-js_shared__"],N=Function.prototype.toString,P=T.hasOwnProperty,F=(S=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",H=T.toString,D=N.call(Object),U=RegExp("^"+N.call(P).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),z=O?_.Buffer:void 0,B=_.Symbol,V=_.Uint8Array,M=z?z.allocUnsafe:void 0,G=(R=Object.getPrototypeOf,q=Object,function(e){return R(q(e))}),J=Object.create,Q=T.propertyIsEnumerable,K=k.splice,Y=B?B.toStringTag:void 0,$=function(){try{var e=_e(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),W=z?z.isBuffer:void 0,X=Math.max,Z=Date.now,ee=_e(_,"Map"),te=_e(Object,"create"),re=function(){function e(){}return function(t){if(!ke(t))return{};if(J)return J(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();function ne(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function oe(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function ie(e){var t=this.__data__=new oe(e);this.size=t.size}function ue(e,t){var r=xe(e),n=!r&&Ce(e),o=!r&&!n&&Se(e),a=!r&&!n&&!o&&Le(e),i=r||n||o||a,u=i?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],c=u.length;for(var s in e)!t&&!P.call(e,s)||i&&("length"==s||o&&("offset"==s||"parent"==s)||a&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||je(s,c))||u.push(s);return u}function ce(e,t,r){(void 0===r||we(e[t],r))&&(void 0!==r||t in e)||le(e,t,r)}function se(e,t,r){var n=e[t];P.call(e,t)&&we(n,r)&&(void 0!==r||t in e)||le(e,t,r)}function fe(e,t){for(var r=e.length;r--;)if(we(e[r][0],t))return r;return-1}function le(e,t,r){"__proto__"==t&&$?$(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}ne.prototype.clear=function(){this.__data__=te?te(null):{},this.size=0},ne.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ne.prototype.get=function(e){var t=this.__data__;if(te){var r=t[e];return r===o?void 0:r}return P.call(t,e)?t[e]:void 0},ne.prototype.has=function(e){var t=this.__data__;return te?void 0!==t[e]:P.call(t,e)},ne.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=te&&void 0===t?o:t,this},oe.prototype.clear=function(){this.__data__=[],this.size=0},oe.prototype.delete=function(e){var t=this.__data__,r=fe(t,e);return r>=0&&(r==t.length-1?t.pop():K.call(t,r,1),--this.size,!0)},oe.prototype.get=function(e){var t=this.__data__,r=fe(t,e);return 0>r?void 0:t[r][1]},oe.prototype.has=function(e){return fe(this.__data__,e)>-1},oe.prototype.set=function(e,t){var r=this.__data__,n=fe(r,e);return 0>n?(++this.size,r.push([e,t])):r[n][1]=t,this},ae.prototype.clear=function(){this.size=0,this.__data__={hash:new ne,map:new(ee||oe),string:new ne}},ae.prototype.delete=function(e){var t=Ae(this,e).delete(e);return this.size-=t?1:0,t},ae.prototype.get=function(e){return Ae(this,e).get(e)},ae.prototype.has=function(e){return Ae(this,e).has(e)},ae.prototype.set=function(e,t){var r=Ae(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ie.prototype.clear=function(){this.__data__=new oe,this.size=0},ie.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},ie.prototype.get=function(e){return this.__data__.get(e)},ie.prototype.has=function(e){return this.__data__.has(e)},ie.prototype.set=function(e,t){var n=this.__data__;if(n instanceof oe){var o=n.__data__;if(!ee||r-1>o.length)return o.push([e,t]),this.size=++n.size,this;n=this.__data__=new ae(o)}return n.set(e,t),this.size=n.size,this};var de,pe=function(e,t,r){for(var n=-1,o=Object(e),a=r(e),i=a.length;i--;){var u=a[de?i:++n];if(!1===t(o[u],u,o))break}return e};function he(e){return null==e?void 0===e?v:d:Y&&Y in Object(e)?function(e){var t=P.call(e,Y),r=e[Y];try{e[Y]=void 0;var n=!0}catch(e){}var o=H.call(e);n&&(t?e[Y]=r:delete e[Y]);return o}(e):function(e){return H.call(e)}(e)}function ve(e){return Te(e)&&he(e)==c}function ye(e){return!(!ke(e)||F&&F in e)&&(Re(e)?U:y).test(function(e){if(null!=e){try{return N.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}function ge(e){if(!ke(e))return function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}(e);var t=Ee(e),r=[];for(var n in e)("constructor"!=n||!t&&P.call(e,n))&&r.push(n);return r}function me(e,t,r,n,o){e!==t&&pe(t,function(a,i){if(ke(a))o||(o=new ie),function(e,t,r,n,o,a,i){var u=I(e,r),c=I(t,r),s=i.get(c);if(s)return void ce(e,r,s);var f=a?a(u,c,r+"",e,t,i):void 0,l=void 0===f;if(l){var d=xe(c),h=!d&&Se(c),v=!d&&!h&&Le(c);f=c,d||h||v?xe(u)?f=u:Te(A=u)&&Ie(A)?f=function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(u):h?(l=!1,f=function(e,t){if(t)return e.slice();var r=e.length,n=M?M(r):new e.constructor(r);return e.copy(n),n}(c,!0)):v?(l=!1,y=c,g=!0?(new V(b=new(m=y.buffer).constructor(m.byteLength)).set(new V(m)),b):y.buffer,f=new y.constructor(g,y.byteOffset,y.length)):f=[]:function(e){if(!Te(e)||he(e)!=p)return!1;var t=G(e);if(null===t)return!0;var r=P.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&N.call(r)==D}(c)||Ce(c)?(f=u,Ce(u)?f=function(e){return function(e,t,r,n){var o=!r;r||(r={});var a=-1,i=t.length;for(;++a<i;){var u=t[a],c=n?n(r[u],e[u],u,r,e):void 0;void 0===c&&(c=e[u]),o?le(r,u,c):se(r,u,c)}return r}(e,Ne(e))}(u):(!ke(u)||n&&Re(u))&&(f=function(e){return"function"!=typeof e.constructor||Ee(e)?{}:re(G(e))}(c))):l=!1}var y,g,m,b;var A;l&&(i.set(c,f),o(f,c,n,a,i),i.delete(c));ce(e,r,f)}(e,t,i,r,me,n,o);else{var u=n?n(I(e,i),a,i+"",e,t,o):void 0;void 0===u&&(u=a),ce(e,i,u)}},Ne)}function be(e,t){return Oe(function(e,t,r){return t=X(void 0===t?e.length-1:t,0),function(){for(var n=arguments,o=-1,a=X(n.length-t,0),i=Array(a);++o<a;)i[o]=n[t+o];o=-1;for(var u=Array(t+1);++o<t;)u[o]=n[o];return u[t]=r(i),function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}(e,this,u)}}(e,t,He),e+"")}function Ae(e,t){var r,n,o=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof t?"string":"hash"]:o.map}function _e(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return ye(r)?r:void 0}function je(e,t){var r=typeof e;return!!(t=null==t?u:t)&&("number"==r||"symbol"!=r&&g.test(e))&&e>-1&&e%1==0&&t>e}function Ee(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||T)}var Oe=function(e){var t=0,r=0;return function(){var n=Z(),o=i-(n-r);if(r=n,o>0){if(++t>=a)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}($?function(e,t){return $(e,"toString",{configurable:!0,enumerable:!1,value:(r=t,function(){return r}),writable:!0});var r}:He);function we(e,t){return e===t||e!=e&&t!=t}var Ce=ve(function(){return arguments}())?ve:function(e){return Te(e)&&P.call(e,"callee")&&!Q.call(e,"callee")},xe=Array.isArray;function Ie(e){return null!=e&&qe(e.length)&&!Re(e)}var Se=W||function(){return!1};function Re(e){if(!ke(e))return!1;var t=he(e);return t==f||t==l||t==s||t==h}function qe(e){return"number"==typeof e&&e>-1&&e%1==0&&u>=e}function ke(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Te(e){return null!=e&&"object"==typeof e}var Le=x?function(e){return function(t){return e(t)}}(x):function(e){return Te(e)&&qe(e.length)&&!!m[he(e)]};function Ne(e){return Ie(e)?ue(e,!0):ge(e)}var Pe,Fe=(Pe=function(e,t,r,n){me(e,t,r,n)},be(function(e,t){var r=-1,n=t.length,o=n>1?t[n-1]:void 0,a=n>2?t[2]:void 0;for(o=Pe.length>3&&"function"==typeof o?(n--,o):void 0,a&&function(e,t,r){if(!ke(r))return!1;var n=typeof t;return!!("number"==n?Ie(r)&&je(t,r.length):"string"==n&&t in r)&&we(r[t],e)}(t[0],t[1],a)&&(o=3>n?void 0:o,n=1),e=Object(e);++r<n;){var i=t[r];i&&Pe(e,i,r,o)}return e}));function He(e){return e}e.exports=Fe}),st=function(e,t){return ct(e.resources,t,function(e,t){return he(e)?d({},e,t):void 0})},ft={},lt={REQUEST:function(e,t){var r,n=t.url,o=t.resourceId;return d({},e,{requests:d({},e.requests||{},(r={},r[n]=d({},e.requests&&e.requests[n]?e.requests[n]:{},{resourceName:ut(t.type).resourceName,resourceId:o,startedAt:(new Date).toISOString(),endedAt:null,expireAt:null,hasSucceeded:!(!e.requests||!e.requests[n])&&e.requests[n].hasSucceeded,hasFailed:!(!e.requests||!e.requests[n])&&e.requests[n].hasFailed,didInvalidate:!(!e.requests||!e.requests[n])&&e.requests[n].didInvalidate,fromCache:!(!e.requests||!e.requests[n])&&e.requests[n].fromCache}),r))})},RECEIVE:function(e,t){var r,n=t.url,o=t.payload,a=t.principalResourceIds,i=t.metadata,u=t.cacheLifetime,c=void 0===u?0:u,s=ut(t.type).resourceName,f=d({},e,{requests:d({},e.requests||{},(r={},r[n]=d({},e.requests&&e.requests[n]?e.requests[n]:{},{endedAt:(new Date).toISOString(),expireAt:c!==1/0?new Date((new Date).getTime()+1e3*c).toISOString():"never",hasSucceeded:!0,hasFailed:!1,didInvalidate:!1,fromCache:!1,payloadIds:He(s,o,a),metadata:i}),r)),resources:st(e,o)});return d({},f,{resolversHashes:Me(f,s,n,o,a)})},FAIL:function(e,t){var r,n=t.url;return d({},e,{requests:d({},e.requests||{},(r={},r[n]=d({},e.requests&&e.requests[n]?e.requests[n]:{},{endedAt:(new Date).toISOString(),hasSucceeded:!1,hasFailed:!0}),r))})},RECEIVE_FROM_CACHE:function(e,t){var r,n=t.type,o=t.url,a=t.resourceId,i=t.payload,u=t.principalResourceIds,c=t.metadata,s=t.cacheLifetime,f=void 0===s?0:s,l=ut(n).resourceName,p=d({},e,{requests:d({},e.requests||{},(r={},r[o]=d({},e.requests&&e.requests[o]?e.requests[o]:{},{resourceName:ut(n).resourceName,resourceId:a,startedAt:(new Date).toISOString(),endedAt:(new Date).toISOString(),expireAt:f!==1/0?new Date((new Date).getTime()+1e3*f).toISOString():"never",hasSucceeded:!0,hasFailed:!1,didInvalidate:!1,fromCache:!0,payloadIds:He(l,i,u),metadata:c}),r)),resources:st(e,i)});return d({},p,{resolversHashes:Me(p,l,o,i,u)})},INVALIDATE_RESOURCE:function(e,t){var r=t.resourceName;return d({},e,{requests:d({},Object.entries(e.requests||{}).reduce(function(e,t){var n,o=t[1];return d({},e,((n={})[t[0]]=!o.didInvalidate&&(o.resourceName===r||o.payloadIds&&o.payloadIds[r])?d({},o,{didInvalidate:!0}):o,n))},{}))})},INVALIDATE_ID:function(e,t){var r=t.resourceName,n=t.resourceId;return d({},e,{requests:d({},Object.entries(e.requests||{}).reduce(function(e,t){var o,a=t[1];return d({},e,((o={})[t[0]]=!a.didInvalidate&&(a.resourceName===r&&a.resourceId===n||a.payloadIds&&a.payloadIds[r]&&a.payloadIds[r].map(function(e){return""+e}).includes(""+n))?d({},a,{didInvalidate:!0}):a,o))},{}))})},INVALIDATE_REQUEST:function(e,t){var r,n=t.url;return d({},e,{requests:d({},e.requests||{},(r={},r[n]=d({},e.requests&&e.requests[n]?e.requests[n]:{},{didInvalidate:!0}),r))})},RESET_RESOURCE:function(e,t){var r,n=t.resourceName,o=d({},e,{requests:d({},Object.entries(e.requests||{}).filter(function(e){var t=e[1],r=t.payloadIds;return!(n===t.resourceName||r&&Object.keys(r).includes(n))}).reduce(function(e,t){var r;return d({},e,((r={})[t[0]]=t[1],r))},{})),resources:d({},e.resources||{},(r={},r[n]=void 0,r))});return d({},o,{resolversHashes:function(e,t){var r,n=e.requests,o=void 0===n?{}:n,a=e.resolversHashes,i=void 0===a?{}:a;return d({},i,{requests:d({},Object.entries(i.requests||{}).reduce(function(e,t){var r,n=t[0],a=t[1];return d({},e,Object.keys(o).includes(n)?((r={})[n]=a,r):{})},{})),resources:d({},i.resources||{},(r={},r[t]=Ve,r))})}(o,n)})},RESET_ALL:function(){return{}}},dt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ft;return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(void 0===t)return e;if(!r.type||!r.type.startsWith("@@rest-easy"))return t;var n=lt[ut(r.type).caseName];return n?n(t,r):t}}(),pt=function(){var e,t={RESET_ALL:y("@global","@reset","RESET_ALL")};return{resetAll:(e=t.RESET_ALL,function(){return{type:e}})}};e.connect=function(){for(var e=arguments.length,r=Array(e),n=0;e>n;n++)r[n]=arguments[n];return function(e){var n=e.displayName||e.name||"Component",o=function(n){function o(t){l(this,o);var a=p(this,n.call(this,t));return a.onInjectProps=function(e,t){a.setState(function(r){var n;return r.__requestURLsByActionKey[e]!==t?{__requestURLsByActionKey:d({},r.__requestURLsByActionKey,(n={},n[e]=t,n))}:null})},a.getWrappedInstance=function(){return a.innerRef&&a.innerRef.getWrappedInstance?a.innerRef.getWrappedInstance():null},a.state={__requestURLsByActionKey:{}},a.ConnectedComponent=h(a.onInjectProps).apply(void 0,r)(e),a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,n),o.prototype.render=function(){var e=this,r=this.ConnectedComponent,n=d({},this.props,this.state);return t.createElement(r,d({ref:function(t){e.innerRef=t}},n))},o}(t.Component);return o.displayName="EasyConnect("+n+")",s(o,e)}},e.createResource=function(e,t){return function(r){xe(e,t),Oe(e,r);var n=t||{},o=n.cacheLifetime,a=void 0===o?0:o,i=n.denormalizer,u=d({},g(e)),c=d({},it(e,i));return Object.keys(r||{}).forEach(function(t){u=d({},u,ne(e,a,r||{},t)),c=d({},c,function(e,t,r){var n;return(n={})[t]={resource:{couldPerform:function(r){return!$e(Q(r),e,t)},isPerforming:function(r){return $e(Q(r),e,t)},isValid:function(r){return!We(Q(r),e,t,"didInvalidate")},hasSucceeded:function(r){return We(Q(r),e,t,"hasSucceeded")},hasFailed:function(r){return We(Q(r),e,t,"hasFailed")},couldPerformOnId:function(r,n){return!$e(Q(r),e,t,n)},isPerformingOnId:function(r,n){return $e(Q(r),e,t,n)},hasSucceededOnId:function(r,n){return We(Q(r),e,t,"hasSucceeded",n)},hasFailedOnId:function(r,n){return We(Q(r),e,t,"hasFailed",n)},isValidId:function(r,n){return!We(Q(r),e,t,"didInvalidate",n)}},request:{getResource:function(n,o){var a=2>=arguments.length||void 0===arguments[2]||arguments[2];return et(Q(n),e,Ne(e,t,o),a,r)},getMetadata:function(r,n){return function(e,t){return e.requests&&e.requests[t]&&e.requests[t].metadata?e.requests[t].metadata:{}}(Q(r),Ne(e,t,n))},couldPerform:function(r,n){return!tt(Q(r),Ne(e,t,n))},isPerforming:function(r,n){return tt(Q(r),Ne(e,t,n))},isValid:function(r,n){return!rt(Q(r),Ne(e,t,n),"didInvalidate")},hasSucceeded:function(r,n){return rt(Q(r),Ne(e,t,n),"hasSucceeded")},hasFailed:function(r,n){return rt(Q(r),Ne(e,t,n),"hasFailed")}}},n}(e,t,i))}),{actions:u,selectors:c}}},e.reducer=dt,e.reset=function(){return(0,pt().resetAll)()},e.initializeNetworkHelpers=function(e){!function(e){X=e?d({},W,e):W}(e)},e.getPersistableState=function(e,t){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.alwaysPersist,n=t.neverPersist;if(!e||!Object.keys(e).length)return{};var o="string"==typeof r?[r]:r,a="string"==typeof n?[n]:n,i=Object.entries(e.requests||{}).reduce(function(e,t){var r,n,i=t[0],u=t[1];return d({},e,u.endedAt&&o&&u.payloadIds&&Object.keys(u.payloadIds).some(function(e){return o.includes(e)})?((r={})[i]=u,r):a&&u.payloadIds&&Object.keys(u.payloadIds).some(function(e){return a.includes(e)})||!u.endedAt||u.didInvalidate||K(u.expireAt)?{}:((n={})[i]="never"===u.expireAt?d({},u,{didInvalidate:!0}):u,n))},{}),u=Object.values(i||{}).reduce(function(e,t){return d({},e,Object.entries(t.payloadIds||{}).reduce(function(e,t){var r,n=t[0];return d({},e,((r={})[n]=[].concat(e[n]||[],t[1].map(function(e){return""+e})),r))},{}))},{}),c=Object.entries(e.resources||{}).reduce(function(e,t){var r,n=t[0];return d({},e,((r={})[n]=Object.entries(t[1]||{}).reduce(function(e,t){var r,o=t[0],a=t[1];return d({},e,u[n]&&u[n].includes(o)?((r={})[o]=a,r):{})},{}),r))},{}),s=Object.entries(c||{}).reduce(function(e,t){var r,n=t[0],o=t[1];return d({},e,Object.keys(o).length?((r={})[n]=o,r):{})},{}),f=d({},e.resolversHashes||{},{requests:Object.entries(e.resolversHashes&&e.resolversHashes.requests?e.resolversHashes.requests:{}).reduce(function(e,t){var r,n=t[0];return d({},e,i[n]?((r={})[n]=t[1],r):{})},{}),resources:Object.entries(e.resolversHashes&&e.resolversHashes.resources?e.resolversHashes.resources:{}).reduce(function(t,r){var n,o=r[0],a=r[1];return d({},t,s[o]&&Object.keys(e.resources&&e.resources[o]?e.resources[o]:{}).length===Object.keys(s[o]||{}).length?((n={})[o]=a,n):{})},{})});return d({},e,{requests:i,resources:s,resolversHashes:f})}(e,t)},Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -75,6 +75,2 @@ import createCachedSelector from 're-reselect'; | ||
var resolversHashesSelector = function resolversHashesSelector(state) { | ||
return state.resolversHashes; | ||
}; | ||
var applyDenormalizerSelector = function applyDenormalizerSelector(state, resourceName, normalizedURL, applyDenormalizer) { | ||
@@ -101,7 +97,6 @@ return applyDenormalizer; | ||
var payloadIds = payloadIdsSelector(state, resourceName, normalizedURL); | ||
var resolversHashes = resolversHashesSelector(state); | ||
if (resource && payloadIds) { | ||
return !applyDenormalizer || !denormalizer ? applyDenormalizer + '-' + getPayloadIdsHash(resolversHashes, normalizedURL, resourceName) + '-' + getResourceHash(resolversHashes, resourceName) : applyDenormalizer + '-' + Object.keys(state.requests[normalizedURL].payloadIds).map(function (resourceKey) { | ||
return getPayloadIdsHash(resolversHashes, normalizedURL, resourceKey) + '-' + getResourceHash(resolversHashes, resourceKey); | ||
return !(applyDenormalizer && denormalizer) ? !!(applyDenormalizer && denormalizer) + '-' + getPayloadIdsHash(state, normalizedURL, resourceName) + '-' + getResourceHash(state, resourceName) : !!(applyDenormalizer && denormalizer) + '-' + Object.keys(state.requests[normalizedURL].payloadIds).map(function (resourceKey) { | ||
return getPayloadIdsHash(state, normalizedURL, resourceKey) + '-' + getResourceHash(state, resourceKey); | ||
}).join('--'); | ||
@@ -108,0 +103,0 @@ } |
@@ -0,1 +1,3 @@ | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
import createCachedSelector from 're-reselect'; | ||
@@ -18,6 +20,2 @@ | ||
var resolversHashesSelector = function resolversHashesSelector(state) { | ||
return state.resolversHashes; | ||
}; | ||
var applyDenormalizerSelector = function applyDenormalizerSelector(state, resourceName, applyDenormalizer) { | ||
@@ -41,6 +39,5 @@ return applyDenormalizer; | ||
var resource = resourceSelector(state, resourceName); | ||
var resolversHashes = resolversHashesSelector(state); | ||
if (resource) { | ||
return !applyDenormalizer || !denormalizer ? applyDenormalizer + '-' + getResourceHash(resolversHashes, resourceName) : applyDenormalizer + '-' + getResourcesHash(resolversHashes); | ||
return !(applyDenormalizer && denormalizer) ? !!(applyDenormalizer && denormalizer) + '-' + getResourceHash(state, resourceName) : !!(applyDenormalizer && denormalizer) + '-' + getResourcesHash(state); | ||
} | ||
@@ -54,7 +51,17 @@ | ||
var _getResourceById = function _getResourceById(state, resourceName, resourceId, applyDenormalizer, denormalizer) { | ||
if (!applyDenormalizer || !denormalizer) { | ||
return state.resources && state.resources[resourceName] && state.resources[resourceName][resourceId] ? state.resources[resourceName][resourceId] : EMPTY_RESOURCE_ID; | ||
var resource = state.resources && state.resources[resourceName] && state.resources[resourceName][resourceId] ? state.resources[resourceName][resourceId] : EMPTY_RESOURCE_ID; | ||
if (!applyDenormalizer || !denormalizer || !resource) { | ||
return resource; | ||
} | ||
return denormalizer([resourceId], state.resources)[0] || EMPTY_RESOURCE_ID; | ||
var resources = Object.entries(state.resources).reduce(function (prev, _ref) { | ||
var _ref2, _extends2; | ||
var name = _ref[0], | ||
value = _ref[1]; | ||
return _extends({}, prev, (_extends2 = {}, _extends2[name] = name === resourceName ? (_ref2 = {}, _ref2[resourceId] = resource, _ref2) : value, _extends2)); | ||
}, {}); | ||
return denormalizer([resourceId], resources)[0] || EMPTY_RESOURCE_ID; | ||
}; | ||
@@ -61,0 +68,0 @@ |
@@ -59,14 +59,29 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
export var getPayloadIdsHash = function getPayloadIdsHash(resolversHashes, normalizedURL, resourceName) { | ||
return resolversHashes && resolversHashes.requests && resolversHashes.requests[normalizedURL] && resolversHashes.requests[normalizedURL][resourceName] ? resolversHashes.requests[normalizedURL][resourceName] : EMPTY_HASH; | ||
export var getPayloadIdsHash = function getPayloadIdsHash() { | ||
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref5$resolversHashes = _ref5.resolversHashes, | ||
resolversHashes = _ref5$resolversHashes === undefined ? {} : _ref5$resolversHashes; | ||
var normalizedURL = arguments[1]; | ||
var resourceName = arguments[2]; | ||
return resolversHashes.requests && resolversHashes.requests[normalizedURL] && resolversHashes.requests[normalizedURL][resourceName] ? resolversHashes.requests[normalizedURL][resourceName] : EMPTY_HASH; | ||
}; | ||
/* eslint-disable no-underscore-dangle */ | ||
export var getResourcesHash = function getResourcesHash(resolversHashes) { | ||
return resolversHashes && resolversHashes.resources && resolversHashes.resources._getResourcesHash ? resolversHashes.resources._getResourcesHash() : EMPTY_HASH; | ||
export var getResourcesHash = function getResourcesHash() { | ||
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref6$resolversHashes = _ref6.resolversHashes, | ||
resolversHashes = _ref6$resolversHashes === undefined ? {} : _ref6$resolversHashes; | ||
return resolversHashes.resources && resolversHashes.resources._getResourcesHash ? resolversHashes.resources._getResourcesHash() : EMPTY_HASH; | ||
}; | ||
/* eslint-enable no-underscore-dangle */ | ||
export var getResourceHash = function getResourceHash(resolversHashes, resourceName) { | ||
return resolversHashes && resolversHashes.resources && resolversHashes.resources[resourceName] ? resolversHashes.resources[resourceName] : EMPTY_HASH; | ||
export var getResourceHash = function getResourceHash() { | ||
var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref7$resolversHashes = _ref7.resolversHashes, | ||
resolversHashes = _ref7$resolversHashes === undefined ? {} : _ref7$resolversHashes; | ||
var resourceName = arguments[1]; | ||
return resolversHashes.resources && resolversHashes.resources[resourceName] ? resolversHashes.resources[resourceName] : EMPTY_HASH; | ||
}; |
@@ -75,6 +75,2 @@ import createCachedSelector from 're-reselect'; | ||
var resolversHashesSelector = function resolversHashesSelector(state) { | ||
return state.resolversHashes; | ||
}; | ||
var applyDenormalizerSelector = function applyDenormalizerSelector(state, resourceName, normalizedURL, applyDenormalizer) { | ||
@@ -101,7 +97,6 @@ return applyDenormalizer; | ||
var payloadIds = payloadIdsSelector(state, resourceName, normalizedURL); | ||
var resolversHashes = resolversHashesSelector(state); | ||
if (resource && payloadIds) { | ||
return !applyDenormalizer || !denormalizer ? applyDenormalizer + '-' + getPayloadIdsHash(resolversHashes, normalizedURL, resourceName) + '-' + getResourceHash(resolversHashes, resourceName) : applyDenormalizer + '-' + Object.keys(state.requests[normalizedURL].payloadIds).map(function (resourceKey) { | ||
return getPayloadIdsHash(resolversHashes, normalizedURL, resourceKey) + '-' + getResourceHash(resolversHashes, resourceKey); | ||
return !(applyDenormalizer && denormalizer) ? !!(applyDenormalizer && denormalizer) + '-' + getPayloadIdsHash(state, normalizedURL, resourceName) + '-' + getResourceHash(state, resourceName) : !!(applyDenormalizer && denormalizer) + '-' + Object.keys(state.requests[normalizedURL].payloadIds).map(function (resourceKey) { | ||
return getPayloadIdsHash(state, normalizedURL, resourceKey) + '-' + getResourceHash(state, resourceKey); | ||
}).join('--'); | ||
@@ -108,0 +103,0 @@ } |
@@ -0,1 +1,3 @@ | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
import createCachedSelector from 're-reselect'; | ||
@@ -18,6 +20,2 @@ | ||
var resolversHashesSelector = function resolversHashesSelector(state) { | ||
return state.resolversHashes; | ||
}; | ||
var applyDenormalizerSelector = function applyDenormalizerSelector(state, resourceName, applyDenormalizer) { | ||
@@ -41,6 +39,5 @@ return applyDenormalizer; | ||
var resource = resourceSelector(state, resourceName); | ||
var resolversHashes = resolversHashesSelector(state); | ||
if (resource) { | ||
return !applyDenormalizer || !denormalizer ? applyDenormalizer + '-' + getResourceHash(resolversHashes, resourceName) : applyDenormalizer + '-' + getResourcesHash(resolversHashes); | ||
return !(applyDenormalizer && denormalizer) ? !!(applyDenormalizer && denormalizer) + '-' + getResourceHash(state, resourceName) : !!(applyDenormalizer && denormalizer) + '-' + getResourcesHash(state); | ||
} | ||
@@ -54,7 +51,17 @@ | ||
var _getResourceById = function _getResourceById(state, resourceName, resourceId, applyDenormalizer, denormalizer) { | ||
if (!applyDenormalizer || !denormalizer) { | ||
return state.resources && state.resources[resourceName] && state.resources[resourceName][resourceId] ? state.resources[resourceName][resourceId] : EMPTY_RESOURCE_ID; | ||
var resource = state.resources && state.resources[resourceName] && state.resources[resourceName][resourceId] ? state.resources[resourceName][resourceId] : EMPTY_RESOURCE_ID; | ||
if (!applyDenormalizer || !denormalizer || !resource) { | ||
return resource; | ||
} | ||
return denormalizer([resourceId], state.resources)[0] || EMPTY_RESOURCE_ID; | ||
var resources = Object.entries(state.resources).reduce(function (prev, _ref) { | ||
var _ref2, _extends2; | ||
var name = _ref[0], | ||
value = _ref[1]; | ||
return _extends({}, prev, (_extends2 = {}, _extends2[name] = name === resourceName ? (_ref2 = {}, _ref2[resourceId] = resource, _ref2) : value, _extends2)); | ||
}, {}); | ||
return denormalizer([resourceId], resources)[0] || EMPTY_RESOURCE_ID; | ||
}; | ||
@@ -61,0 +68,0 @@ |
@@ -59,14 +59,29 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
export var getPayloadIdsHash = function getPayloadIdsHash(resolversHashes, normalizedURL, resourceName) { | ||
return resolversHashes && resolversHashes.requests && resolversHashes.requests[normalizedURL] && resolversHashes.requests[normalizedURL][resourceName] ? resolversHashes.requests[normalizedURL][resourceName] : EMPTY_HASH; | ||
export var getPayloadIdsHash = function getPayloadIdsHash() { | ||
var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref5$resolversHashes = _ref5.resolversHashes, | ||
resolversHashes = _ref5$resolversHashes === undefined ? {} : _ref5$resolversHashes; | ||
var normalizedURL = arguments[1]; | ||
var resourceName = arguments[2]; | ||
return resolversHashes.requests && resolversHashes.requests[normalizedURL] && resolversHashes.requests[normalizedURL][resourceName] ? resolversHashes.requests[normalizedURL][resourceName] : EMPTY_HASH; | ||
}; | ||
/* eslint-disable no-underscore-dangle */ | ||
export var getResourcesHash = function getResourcesHash(resolversHashes) { | ||
return resolversHashes && resolversHashes.resources && resolversHashes.resources._getResourcesHash ? resolversHashes.resources._getResourcesHash() : EMPTY_HASH; | ||
export var getResourcesHash = function getResourcesHash() { | ||
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref6$resolversHashes = _ref6.resolversHashes, | ||
resolversHashes = _ref6$resolversHashes === undefined ? {} : _ref6$resolversHashes; | ||
return resolversHashes.resources && resolversHashes.resources._getResourcesHash ? resolversHashes.resources._getResourcesHash() : EMPTY_HASH; | ||
}; | ||
/* eslint-enable no-underscore-dangle */ | ||
export var getResourceHash = function getResourceHash(resolversHashes, resourceName) { | ||
return resolversHashes && resolversHashes.resources && resolversHashes.resources[resourceName] ? resolversHashes.resources[resourceName] : EMPTY_HASH; | ||
export var getResourceHash = function getResourceHash() { | ||
var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref7$resolversHashes = _ref7.resolversHashes, | ||
resolversHashes = _ref7$resolversHashes === undefined ? {} : _ref7$resolversHashes; | ||
var resourceName = arguments[1]; | ||
return resolversHashes.resources && resolversHashes.resources[resourceName] ? resolversHashes.resources[resourceName] : EMPTY_HASH; | ||
}; |
{ | ||
"name": "@brigad/redux-rest-easy", | ||
"version": "2.8.1", | ||
"version": "2.8.2", | ||
"description": "Redux/React/React Native framework generating actions, reducers and selectors to perform network requests", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -95,4 +95,2 @@ import createCachedSelector from 're-reselect'; | ||
const resolversHashesSelector = state => state.resolversHashes; | ||
const applyDenormalizerSelector = ( | ||
@@ -138,12 +136,11 @@ state, | ||
const payloadIds = payloadIdsSelector(state, resourceName, normalizedURL); | ||
const resolversHashes = resolversHashesSelector(state); | ||
if (resource && payloadIds) { | ||
return !applyDenormalizer || !denormalizer | ||
? `${applyDenormalizer}-${getPayloadIdsHash( | ||
resolversHashes, | ||
return !(applyDenormalizer && denormalizer) | ||
? `${!!(applyDenormalizer && denormalizer)}-${getPayloadIdsHash( | ||
state, | ||
normalizedURL, | ||
resourceName, | ||
)}-${getResourceHash(resolversHashes, resourceName)}` | ||
: `${applyDenormalizer}-${Object.keys( | ||
)}-${getResourceHash(state, resourceName)}` | ||
: `${!!(applyDenormalizer && denormalizer)}-${Object.keys( | ||
state.requests[normalizedURL].payloadIds, | ||
@@ -154,6 +151,6 @@ ) | ||
`${getPayloadIdsHash( | ||
resolversHashes, | ||
state, | ||
normalizedURL, | ||
resourceKey, | ||
)}-${getResourceHash(resolversHashes, resourceKey)}`, | ||
)}-${getResourceHash(state, resourceKey)}`, | ||
) | ||
@@ -160,0 +157,0 @@ .join('--')}`; |
@@ -21,4 +21,2 @@ import createCachedSelector from 're-reselect'; | ||
const resolversHashesSelector = state => state.resolversHashes; | ||
const applyDenormalizerSelector = (state, resourceName, applyDenormalizer) => | ||
@@ -56,8 +54,10 @@ applyDenormalizer; | ||
const resource = resourceSelector(state, resourceName); | ||
const resolversHashes = resolversHashesSelector(state); | ||
if (resource) { | ||
return !applyDenormalizer || !denormalizer | ||
? `${applyDenormalizer}-${getResourceHash(resolversHashes, resourceName)}` | ||
: `${applyDenormalizer}-${getResourcesHash(resolversHashes)}`; | ||
return !(applyDenormalizer && denormalizer) | ||
? `${!!(applyDenormalizer && denormalizer)}-${getResourceHash( | ||
state, | ||
resourceName, | ||
)}` | ||
: `${!!(applyDenormalizer && denormalizer)}-${getResourcesHash(state)}`; | ||
} | ||
@@ -83,11 +83,27 @@ | ||
) => { | ||
if (!applyDenormalizer || !denormalizer) { | ||
return state.resources | ||
&& state.resources[resourceName] | ||
&& state.resources[resourceName][resourceId] | ||
const resource | ||
= state.resources | ||
&& state.resources[resourceName] | ||
&& state.resources[resourceName][resourceId] | ||
? state.resources[resourceName][resourceId] | ||
: EMPTY_RESOURCE_ID; | ||
if (!applyDenormalizer || !denormalizer || !resource) { | ||
return resource; | ||
} | ||
return denormalizer([resourceId], state.resources)[0] || EMPTY_RESOURCE_ID; | ||
const resources = Object.entries(state.resources).reduce( | ||
(prev, [name, value]) => ({ | ||
...prev, | ||
[name]: | ||
name === resourceName | ||
? { | ||
[resourceId]: resource, | ||
} | ||
: value, | ||
}), | ||
{}, | ||
); | ||
return denormalizer([resourceId], resources)[0] || EMPTY_RESOURCE_ID; | ||
}; | ||
@@ -94,0 +110,0 @@ |
@@ -73,8 +73,7 @@ import getResourceIdsByResourceNameFromNormalizedPayload from '../utils/getResourceIdsByResourceNameFromNormalizedPayload'; | ||
export const getPayloadIdsHash = ( | ||
resolversHashes, | ||
{ resolversHashes = {} } = {}, | ||
normalizedURL, | ||
resourceName, | ||
) => | ||
resolversHashes | ||
&& resolversHashes.requests | ||
resolversHashes.requests | ||
&& resolversHashes.requests[normalizedURL] | ||
@@ -86,6 +85,4 @@ && resolversHashes.requests[normalizedURL][resourceName] | ||
/* eslint-disable no-underscore-dangle */ | ||
export const getResourcesHash = resolversHashes => | ||
resolversHashes | ||
&& resolversHashes.resources | ||
&& resolversHashes.resources._getResourcesHash | ||
export const getResourcesHash = ({ resolversHashes = {} } = {}) => | ||
resolversHashes.resources && resolversHashes.resources._getResourcesHash | ||
? resolversHashes.resources._getResourcesHash() | ||
@@ -95,7 +92,5 @@ : EMPTY_HASH; | ||
export const getResourceHash = (resolversHashes, resourceName) => | ||
resolversHashes | ||
&& resolversHashes.resources | ||
&& resolversHashes.resources[resourceName] | ||
export const getResourceHash = ({ resolversHashes = {} } = {}, resourceName) => | ||
resolversHashes.resources && resolversHashes.resources[resourceName] | ||
? resolversHashes.resources[resourceName] | ||
: EMPTY_HASH; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
514643
10885