react-hoax
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["React"],t):"object"==typeof exports?exports["react-hoax"]=t(require("react")):e["react-hoax"]=t(e.React)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=95)}([function(t,r){t.exports=e},function(e,t){e.exports=function(e){return e}},function(e,t,r){var n=r(18),o="object"==typeof self&&self&&self.Object===Object&&self,u=n||o||Function("return this")();e.exports=u},function(e,t,r){var n=r(27);e.exports=function(e,t){return n(e,t)}},function(e,t,r){var n=r(40),o=r(46);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},function(e,t,r){!function(e,t){t=t&&t.hasOwnProperty("default")?t.default:t;var r=Symbol(),n=function(e,n){var o=e[r];if(!o)throw new Error;var u=t.useReducer((function(e){return e+1}),0)[1],i=t.useContext(e),c=n(i),a=t.useRef(null);return t.useLayoutEffect((function(){a.current={f:n,v:i,s:c}})),t.useLayoutEffect((function(){var e=function(e){try{if(a.current.v===e||Object.is(a.current.s,a.current.f(e)))return}catch(e){}u()};return o.add(e),function(){o.delete(e)}}),[o]),c};e.createContext=function(e){var n,o,u=t.createContext(e,(function(){return 0}));return u[r]=new Set,u.Provider=(n=u.Provider,o=u[r],t.memo((function(e){var r=e.value,u=e.children;return o.forEach((function(e){e(r)})),t.createElement(n,{value:r},u)}))),delete u.Consumer,u},e.useContext=function(e){return n(e,(function(e){return e}))},e.useContextSelector=n}(t,r(0))},function(e,t,r){var n=r(30),o=r(31),u=r(32),i=r(33),c=r(34);function a(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])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=u,a.prototype.has=i,a.prototype.set=c,e.exports=a},function(e,t,r){var n=r(16);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},function(e,t,r){var n=r(14),o=r(42),u=r(43),i="[object Null]",c="[object Undefined]",a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?c:i:a&&a in Object(e)?o(e):u(e)}},function(e,t,r){var n=r(4)(Object,"create");e.exports=n},function(e,t,r){var n=r(55);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){e.exports=function(e){return null==e}},function(e,t,r){var n=r(4)(r(2),"Map");e.exports=n},function(e,t,r){var n=r(2).Symbol;e.exports=n},function(e,t){var r=Array.isArray;e.exports=r},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,r){var n=r(8),o=r(19),u="[object AsyncFunction]",i="[object Function]",c="[object GeneratorFunction]",a="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=n(e);return t==i||t==c||t==u||t==a}},function(e,t,r){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(41))},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var r=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,r){var n=r(47),o=r(54),u=r(56),i=r(57),c=r(58);function a(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])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=u,a.prototype.has=i,a.prototype.set=c,e.exports=a},function(e,t,r){var n=r(59),o=r(62),u=r(63),i=1,c=2;e.exports=function(e,t,r,a,f,s){var l=r&i,p=e.length,y=t.length;if(p!=y&&!(l&&y>p))return!1;var b=s.get(e);if(b&&s.get(t))return b==t;var v=-1,d=!0,O=r&c?new n:void 0;for(s.set(e,t),s.set(t,e);++v<p;){var h=e[v],j=t[v];if(a)var g=l?a(j,h,v,t,e,s):a(h,j,v,e,t,s);if(void 0!==g){if(g)continue;d=!1;break}if(O){if(!o(t,(function(e,t){if(!u(O,t)&&(h===e||f(h,e,r,a,s)))return O.push(t)}))){d=!1;break}}else if(h!==j&&!f(h,j,r,a,s)){d=!1;break}}return s.delete(e),s.delete(t),d}},function(e,t,r){(function(e){var n=r(2),o=r(80),u=t&&!t.nodeType&&t,i=u&&"object"==typeof e&&e&&!e.nodeType&&e,c=i&&i.exports===u?n.Buffer:void 0,a=(c?c.isBuffer:void 0)||o;e.exports=a}).call(this,r(24)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){var n=r(82),o=r(83),u=r(84),i=u&&u.isTypedArray,c=i?o(i):n;e.exports=c},function(e,t){var r=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}},function(e,t,r){var n=r(28),o=r(11);e.exports=function e(t,r,u,i,c){return t===r||(null==t||null==r||!o(t)&&!o(r)?t!=t&&r!=r:n(t,r,u,i,e,c))}},function(e,t,r){var n=r(29),o=r(22),u=r(64),i=r(68),c=r(90),a=r(15),f=r(23),s=r(25),l=1,p="[object Arguments]",y="[object Array]",b="[object Object]",v=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,d,O,h){var j=a(e),g=a(t),m=j?y:c(e),P=g?y:c(t),w=(m=m==p?b:m)==b,x=(P=P==p?b:P)==b,_=m==P;if(_&&f(e)){if(!f(t))return!1;j=!0,w=!1}if(_&&!w)return h||(h=new n),j||s(e)?o(e,t,r,d,O,h):u(e,t,m,r,d,O,h);if(!(r&l)){var S=w&&v.call(e,"__wrapped__"),A=x&&v.call(t,"__wrapped__");if(S||A){var R=S?e.value():e,E=A?t.value():t;return h||(h=new n),O(R,E,r,d,h)}}return!!_&&(h||(h=new n),i(e,t,r,d,O,h))}},function(e,t,r){var n=r(6),o=r(35),u=r(36),i=r(37),c=r(38),a=r(39);function f(e){var t=this.__data__=new n(e);this.size=t.size}f.prototype.clear=o,f.prototype.delete=u,f.prototype.get=i,f.prototype.has=c,f.prototype.set=a,e.exports=f},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,r){var n=r(7),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():o.call(t,r,1),--this.size,!0)}},function(e,t,r){var n=r(7);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},function(e,t,r){var n=r(7);e.exports=function(e){return n(this.__data__,e)>-1}},function(e,t,r){var n=r(7);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},function(e,t,r){var n=r(6);e.exports=function(){this.__data__=new n,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,r){var n=r(6),o=r(13),u=r(21),i=200;e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var c=r.__data__;if(!o||c.length<i-1)return c.push([e,t]),this.size=++r.size,this;r=this.__data__=new u(c)}return r.set(e,t),this.size=r.size,this}},function(e,t,r){var n=r(17),o=r(44),u=r(19),i=r(20),c=/^\[object .+?Constructor\]$/,a=Function.prototype,f=Object.prototype,s=a.toString,l=f.hasOwnProperty,p=RegExp("^"+s.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!u(e)||o(e))&&(n(e)?p:c).test(i(e))}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(14),o=Object.prototype,u=o.hasOwnProperty,i=o.toString,c=n?n.toStringTag:void 0;e.exports=function(e){var t=u.call(e,c),r=e[c];try{e[c]=void 0;var n=!0}catch(e){}var o=i.call(e);return n&&(t?e[c]=r:delete e[c]),o}},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t,r){var n,o=r(45),u=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!u&&u in e}},function(e,t,r){var n=r(2)["__core-js_shared__"];e.exports=n},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,r){var n=r(48),o=r(6),u=r(13);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(u||o),string:new n}}},function(e,t,r){var n=r(49),o=r(50),u=r(51),i=r(52),c=r(53);function a(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])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=u,a.prototype.has=i,a.prototype.set=c,e.exports=a},function(e,t,r){var n=r(9);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,r){var n=r(9),o="__lodash_hash_undefined__",u=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return r===o?void 0:r}return u.call(t,e)?t[e]:void 0}},function(e,t,r){var n=r(9),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},function(e,t,r){var n=r(9),o="__lodash_hash_undefined__";e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?o:t,this}},function(e,t,r){var n=r(10);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,r){var n=r(10);e.exports=function(e){return n(this,e).get(e)}},function(e,t,r){var n=r(10);e.exports=function(e){return n(this,e).has(e)}},function(e,t,r){var n=r(10);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},function(e,t,r){var n=r(21),o=r(60),u=r(61);function i(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=u,e.exports=i},function(e,t){var r="__lodash_hash_undefined__";e.exports=function(e){return this.__data__.set(e,r),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,r){var n=r(14),o=r(65),u=r(16),i=r(22),c=r(66),a=r(67),f=1,s=2,l="[object Boolean]",p="[object Date]",y="[object Error]",b="[object Map]",v="[object Number]",d="[object RegExp]",O="[object Set]",h="[object String]",j="[object Symbol]",g="[object ArrayBuffer]",m="[object DataView]",P=n?n.prototype:void 0,w=P?P.valueOf:void 0;e.exports=function(e,t,r,n,P,x,_){switch(r){case m:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case g:return!(e.byteLength!=t.byteLength||!x(new o(e),new o(t)));case l:case p:case v:return u(+e,+t);case y:return e.name==t.name&&e.message==t.message;case d:case h:return e==t+"";case b:var S=c;case O:var A=n&f;if(S||(S=a),e.size!=t.size&&!A)return!1;var R=_.get(e);if(R)return R==t;n|=s,_.set(e,t);var E=i(S(e),S(t),n,P,x,_);return _.delete(e),E;case j:if(w)return w.call(e)==w.call(t)}return!1}},function(e,t,r){var n=r(2).Uint8Array;e.exports=n},function(e,t){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},function(e,t){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},function(e,t,r){var n=r(69),o=1,u=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,i,c,a){var f=r&o,s=n(e),l=s.length;if(l!=n(t).length&&!f)return!1;for(var p=l;p--;){var y=s[p];if(!(f?y in t:u.call(t,y)))return!1}var b=a.get(e);if(b&&a.get(t))return b==t;var v=!0;a.set(e,t),a.set(t,e);for(var d=f;++p<l;){var O=e[y=s[p]],h=t[y];if(i)var j=f?i(h,O,y,t,e,a):i(O,h,y,e,t,a);if(!(void 0===j?O===h||c(O,h,r,i,a):j)){v=!1;break}d||(d="constructor"==y)}if(v&&!d){var g=e.constructor,m=t.constructor;g!=m&&"constructor"in e&&"constructor"in t&&!("function"==typeof g&&g instanceof g&&"function"==typeof m&&m instanceof m)&&(v=!1)}return a.delete(e),a.delete(t),v}},function(e,t,r){var n=r(70),o=r(72),u=r(75);e.exports=function(e){return n(e,u,o)}},function(e,t,r){var n=r(71),o=r(15);e.exports=function(e,t,r){var u=t(e);return o(e)?u:n(u,r(e))}},function(e,t){e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}},function(e,t,r){var n=r(73),o=r(74),u=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,c=i?function(e){return null==e?[]:(e=Object(e),n(i(e),(function(t){return u.call(e,t)})))}:o;e.exports=c},function(e,t){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,u=[];++r<n;){var i=e[r];t(i,r,e)&&(u[o++]=i)}return u}},function(e,t){e.exports=function(){return[]}},function(e,t,r){var n=r(76),o=r(85),u=r(89);e.exports=function(e){return u(e)?n(e):o(e)}},function(e,t,r){var n=r(77),o=r(78),u=r(15),i=r(23),c=r(81),a=r(25),f=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=u(e),s=!r&&o(e),l=!r&&!s&&i(e),p=!r&&!s&&!l&&a(e),y=r||s||l||p,b=y?n(e.length,String):[],v=b.length;for(var d in e)!t&&!f.call(e,d)||y&&("length"==d||l&&("offset"==d||"parent"==d)||p&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||c(d,v))||b.push(d);return b}},function(e,t){e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},function(e,t,r){var n=r(79),o=r(11),u=Object.prototype,i=u.hasOwnProperty,c=u.propertyIsEnumerable,a=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!c.call(e,"callee")};e.exports=a},function(e,t,r){var n=r(8),o=r(11),u="[object Arguments]";e.exports=function(e){return o(e)&&n(e)==u}},function(e,t){e.exports=function(){return!1}},function(e,t){var r=9007199254740991,n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var o=typeof e;return!!(t=null==t?r:t)&&("number"==o||"symbol"!=o&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,r){var n=r(8),o=r(26),u=r(11),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return u(e)&&o(e.length)&&!!i[n(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,r){(function(e){var n=r(18),o=t&&!t.nodeType&&t,u=o&&"object"==typeof e&&e&&!e.nodeType&&e,i=u&&u.exports===o&&n.process,c=function(){try{var e=u&&u.require&&u.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=c}).call(this,r(24)(e))},function(e,t,r){var n=r(86),o=r(87),u=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=[];for(var r in Object(e))u.call(e,r)&&"constructor"!=r&&t.push(r);return t}},function(e,t){var r=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},function(e,t,r){var n=r(88)(Object.keys,Object);e.exports=n},function(e,t){e.exports=function(e,t){return function(r){return e(t(r))}}},function(e,t,r){var n=r(17),o=r(26);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},function(e,t,r){var n=r(91),o=r(13),u=r(92),i=r(93),c=r(94),a=r(8),f=r(20),s=f(n),l=f(o),p=f(u),y=f(i),b=f(c),v=a;(n&&"[object DataView]"!=v(new n(new ArrayBuffer(1)))||o&&"[object Map]"!=v(new o)||u&&"[object Promise]"!=v(u.resolve())||i&&"[object Set]"!=v(new i)||c&&"[object WeakMap]"!=v(new c))&&(v=function(e){var t=a(e),r="[object Object]"==t?e.constructor:void 0,n=r?f(r):"";if(n)switch(n){case s:return"[object DataView]";case l:return"[object Map]";case p:return"[object Promise]";case y:return"[object Set]";case b:return"[object WeakMap]"}return t}),e.exports=v},function(e,t,r){var n=r(4)(r(2),"DataView");e.exports=n},function(e,t,r){var n=r(4)(r(2),"Promise");e.exports=n},function(e,t,r){var n=r(4)(r(2),"Set");e.exports=n},function(e,t,r){var n=r(4)(r(2),"WeakMap");e.exports=n},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"initialize",(function(){return P})),r.d(n,"update",(function(){return w})),r.d(n,"updateBatch",(function(){return x})),r.d(n,"updateOnChange",(function(){return _})),r.d(n,"reset",(function(){return S})),r.d(n,"resetPristine",(function(){return A})),r.d(n,"resetPristineKey",(function(){return R})),r.d(n,"startFetch",(function(){return E})),r.d(n,"doneFetch",(function(){return D})),r.d(n,"failFetch",(function(){return I})),r.d(n,"startProcess",(function(){return k})),r.d(n,"doneProcess",(function(){return C}));var o={};r.r(o),r.d(o,"initializeResource",(function(){return Ae})),r.d(o,"updateResource",(function(){return Re})),r.d(o,"updateBatchResource",(function(){return Ee})),r.d(o,"updateOnChangeResource",(function(){return De})),r.d(o,"removeResource",(function(){return Ie})),r.d(o,"resetResource",(function(){return ke})),r.d(o,"resetPristineResource",(function(){return Ce})),r.d(o,"resetPristineKeyResource",(function(){return ze})),r.d(o,"startFetchResource",(function(){return Fe})),r.d(o,"doneFetchResource",(function(){return Te})),r.d(o,"failFetchResource",(function(){return Me})),r.d(o,"startProcessResource",(function(){return Be})),r.d(o,"doneProcessResource",(function(){return Ke}));var u=r(0),i=r.n(u);function c(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var a=function(e){var t=Object(u.useRef)();return Object(u.useEffect)((function(){t.current=e}),[e]),t.current},f=r(3),s=r.n(f),l=r(1),p=r.n(l),y=function(e,t){var r=Array.isArray(t),n=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.length?r.reduce((function(e,t){return[].concat(c(e),[a(t)])}),[a(e)]):a(e)}(e),o=Object(u.useRef)();Object(u.useEffect)((function(){return o.current=r?t:[],o.current.forEach((function(t){return t(e,n)})),function(){return o.current=[]}}),[e])};function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function O(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var h=function(e,t,r,n,o){if("function"!=typeof e)return t(e);var u=e.apply(void 0,O(n));return"function"==typeof u?u(t,r,o):t(u)},j=function(e,t){var r=t.initialState,n=t.init,o=void 0===n?p.a:n,i=t.actions,c=void 0===i?{}:i,a=t.observers,f=t.extraArgument,s=d(Object(u.useReducer)(e,r,o),2),l=s[0],O=s[1],j=Object(u.useRef)();j.current=l,y(l,a);var g=Object(u.useRef)();if(g.current)return[l,g.current];var m=function(){return j.current};return g.current=Object.keys(c).reduce((function(e,t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(r,!0).forEach((function(t){v(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,v({},t,(function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return h(c[t],O,m,r,f)})))}),{dispatch:O}),[l,g.current]};function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var P=function(e){return{type:"initialize",values:e}},w=function(e,t){return{type:"update",attr:e,value:t}},x=function(e){return{type:"updateBatch",values:e}},_=function(e){var t=e.target;return w(t.name,t.value)},S={type:"reset"},A={type:"resetPristine"},R=function(e){return{type:"resetPristineKey",attr:e}},E={type:"startFetch"},D=function(e){return{type:"doneFetch",values:e}},I=function(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(r,!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{type:"failFetch"})},k={type:"startProcess"},C={type:"doneProcess"},z=r(5),F=function(){return[Object(z.createContext)({}),Object(z.createContext)({})]};function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var K=function(e){var t=e.initialState,r=e.defaultInitialState;return t&&"object"===B(t)?(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(r,!0).forEach((function(t){M(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},r,{},t),function(){return t}):(console.error("Hoax needs an object as initial state - empty object will be used instead"),function(){return r})},U=r(12),L=r.n(U);function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(r,!0).forEach((function(t){N(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pristine",t=function(){return N({},e,{})},r=function(t,r){var n;return null===(n=t[e])||void 0===n?void 0:n.hasOwnProperty(r)},n=function(t,r){return q({},t,N({},e,q({},t[e],N({},r,t[r]))))},o=function(n,o){return o?r(n,o)?(delete n[e][o],q({},n,N({},e,q({},n[e])))):n:q({},n,{},t())};return{updatePristine:function(t,u,i){var c=r(t,u);return c||s()(i,t[u])?c&&s()(i,t[e][u])?o(t,u):t:n(t,u)},removePristine:o,getInitialPristineState:t}};function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?W(r,!0).forEach((function(t){G(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function G(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var J=function(e,t,r){return Array.isArray(r)?function(e,t,r){return r.reduce((function(t,r){var n=r.attr,o=r.value;return H({},t,{},e(t,n,o))}),t)}(e,t,r):function(e,t,r){return Object.keys(r).reduce((function(t,n){return H({},t,{},e(t,n,r[n]))}),t)}(e,t,r)};function Q(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(r,!0).forEach((function(t){Z(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ee=function(e,t){var r=V("pristine"),n=r.getInitialPristineState,o=r.updatePristine,u=r.removePristine,i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Y({},e(),{},t,{},n())},c=function(t,r,n){return n=function(t,r){return L()(r)?e()[t]:r}(r,n),Y({},t=o(t,r,n),Z({},r,n))};return{reducer:function(e,r){var n=r.type,o=Q(r,["type"]);switch("function"===t&&t(e,Y({type:n},o)),n){case"initialize":return i(o.values);case"update":return c(e,o.attr,o.value);case"updateBatch":return J(c,e,o.values);case"reset":return i();case"resetPristine":return u(e);case"resetPristineKey":return u(e,o.attr);case"startProcess":return Y({},e,{processing:!0});case"doneProcess":return Y({},e,{processing:!1});default:return e}},init:i}},te=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.a,r=Object(u.useRef)();return Object(z.useContextSelector)(e,(function(e){var n=t(e);return s()(r.current,n)||(r.current=n),r.current}))};function re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ne(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function oe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var ue=function(e){return function(t){return e?t.updateResource:t.update}},ie=function(e,t){return function(r){var n=r.fieldKey,o=r.resourceId,i=r.getUpdate,c=void 0===i?ue:i,a=r.select,f=void 0===a?p.a:a,s=Object(u.useCallback)((function(e){var t=o?f(o)(e):f(e);return[t[n],t.errors]}),[o,n]),l=oe(te(e,s),2),y=l[0],b=l[1],v=Object(u.useCallback)((function(e){var t=c(o)(e);if("function"!=typeof t)throw new Error("useMember expects an 'update' dispatch function");return o?function(e,r){return t(o,e,r)}:t}),[o]),d=te(t,v);return[y,Object(u.useCallback)((function(e){return d(n,e)}),[d,n]),b[n],Object(u.useCallback)((function(e){return d("errors",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?re(r,!0).forEach((function(t){ne(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},b,ne({},n,e)))}),[d,b])]}};function ce(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function ae(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var fe=function(e,t){var r=ie(e,t);return function(e){var t=e.fieldKey,n=e.resourceId,o=e.uniq,i=e.getUpdate,c=e.select,a=ce(r({fieldKey:t,resourceId:n,getUpdate:i,select:c}),4),f=a[0],s=a[1],l=a[2],y=a[3],b=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?function(e){return ae(new Set(e))}:p.a}(o),v=Object(u.useCallback)((function(e){e<0||e>=f.length||s(b([].concat(ae(f.slice(0,e)),ae(f.slice(e+1)))))}),[f]),d=Object(u.useCallback)((function(e,t){e<0||e>=f.length||s(b([].concat(ae(f.slice(0,e)),[t],ae(f.slice(e+1)))))}),[f]),O=Object(u.useCallback)((function(e,t){e<0||s(b([].concat(ae(f.slice(0,e)),[t],ae(f.slice(e)))))}),[f]),h=Object(u.useCallback)((function(e){return O(f.length,e)}),[f]),j=Object(u.useCallback)((function(e,t){if(!(e<0||e>=f.length||t<0||t>=f.length)){var r=ae(f),n=ce(r.splice(e,1),1)[0];r.splice(t,0,n),s(b(r))}}),[f]);return{collection:f,set:s,add:O,push:h,edit:d,remove:v,reorder:j,error:l,setError:y}}};function se(){return(se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function le(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function pe(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var ye=function(e){return e.target.value},be=function(e){return e.target.checked},ve=function(e){var t=function(t){var r=t.Component,n=void 0===r?"input":r,o=t.fieldKey,c=t.select,a=t.resourceId,f=(t.getUpdate,t.onChange),s=void 0===f?p.a:f,l=pe(t,["Component","fieldKey","select","resourceId","getUpdate","onChange"]),y=le(e({fieldKey:o,select:c,resourceId:a}),3),b=y[0],v=y[1],d=y[2],O=function(){return v(s.apply(void 0,arguments))};return Object(u.useMemo)((function(){return i.a.createElement(n,se(function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({name:o,"data-testid":o,onChange:O,value:b,error:d},"name",o),l))}),[b,d])};return{Select:function(e){var r=e.Component,n=void 0===r?"select":r,o=e.onChange,u=void 0===o?be:o,c=e.options,a=void 0===c?[]:c,f=pe(e,["Component","onChange","options"]);i.a.createElement(t,se({Component:n,onChange:u,options:a},f))},Checkbox:function(e){var r=e.type,n=void 0===r?"checkbox":r,o=e.onChange,u=void 0===o?be:o,c=pe(e,["type","onChange"]);return i.a.createElement(t,se({type:n,onChange:u},c))},Input:function(e){var r=e.onChange,n=void 0===r?ye:r,o=pe(e,["onChange"]);return i.a.createElement(t,se({type:"text",onChange:n},o))}}},de=function(e,t){return{useSelector:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p.a;return te(e,t)},useAction:function(e){return te(t,(function(t){return t[e]}))}}},Oe={loading:!0,loaded:!1,processing:!1,errors:{}};function he(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function je(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?he(r,!0).forEach((function(t){ge(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):he(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ge(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function me(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var Pe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.initialState,o=t.customReducer,u=t.customActions,c=K({initialState:r,defaultInitialState:Oe}),a=ee(c,o),f=a.reducer,s=a.init,l=F(),p=me(l,2),y=p[0],b=p[1],v=ie(y,b),d=fe(y,b),O=ve(v),h=de(y,b),g=h.useSelector,m=h.useAction,P=function(e){var t=e.children,r=e.extraArgument,o=me(j(f,{init:s,actions:je({},n,{},u),extraArgument:r}),2),c=o[0],a=o[1];return i.a.createElement(b.Provider,{value:a},i.a.createElement(y.Provider,{value:c},t))};return P.displayName=e,{Provider:P,useMember:v,useCollection:d,useSelector:g,useAction:m,Field:O}},we={loading:!0,loaded:!1,processing:!1,byId:{},ids:[]},xe={loading:!0,loaded:!1,processing:!1,errors:{}};function _e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Se(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ae=function(e,t){return{type:"initializeResource",id:e,values:t}},Re=function(e,t,r){return{type:"updateResource",id:e,attr:t,value:r}},Ee=function(e,t){return{type:"updateBatchResource",id:e,values:t}},De=function(e,t){var r=t.target;return Re(e,r.name,r.value)},Ie=function(e){return{type:"removeResource",id:e}},ke=function(e){return{type:"resetResource",id:e}},Ce=function(e){return{type:"resetPristineResource",id:e}},ze=function(e,t){return{type:"resetPristineKeyResource",id:e,attr:t}},Fe=function(e){return{type:"startFetchResource",id:e}},Te=function(e,t){return{type:"doneFetchResource",id:e,values:t}},Me=function(e,t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?_e(r,!0).forEach((function(t){Se(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_e(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{type:"failFetchResource",id:e})},Be=function(e){return{type:"startProcessResource",id:e}},Ke=function(e){return{type:"doneProcessResource",id:e}};function Ue(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Le(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function $e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$e(r,!0).forEach((function(t){Ne(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$e(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ne(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ve=function(e){var t=e.getInitialState,r=e.customReducer,n=e.resourceReducer,o=e.initResource,u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return qe({id:id},t(),{},e)},i=function(e,t,r){var u=e.byId[t]||o();return n(u,qe({id:t},r))},c=function(e,t,r){var n=t.toString(),o=e.byId.hasOwnProperty(n)?e.ids:[].concat(Le(e.ids),[n]);return qe({},e,{byId:qe({},e.byId,Ne({},n,i(e,n,{type:"updateBatchResource",values:r}))),ids:o})};return{reducer:function(e,t){var n=t.type,o=Ue(t,["type"]);switch("function"===r&&r(e,qe({type:n},o)),n){case"update":return c(e,o.attr,o.value);case"updateBatch":return J(c,e,o.values);case"reset":return u();case"startFetch":return qe({},e,{loading:!0});case"doneFetch":return function(e,t){var r=[],n=t.reduce((function(t,n){return r.push(n.id),qe({},t,Ne({},n.id,i(e,n.id,{type:"initializeResource",values:n})))}),{});return qe({},e,{byId:qe({},e.byId,{},n),ids:Le(new Set([].concat(Le(e.ids),r))),loading:!1,loaded:!0})}(e,o.values);case"failFetch":return qe({},e,{loading:!1});case"removeResource":return function(e,t){var r=delete e.byId[t],n=e.ids.filter((function(e){return e!==t}));return qe({},e,{byId:qe({},r),ids:n})}(e,o.id);case"initializeResource":case"updateResource":case"updateBatchResource":case"resetResource":case"resetPristineResource":case"resetPristineKeyResource":case"startProcessResource":case"doneProcessResource":return function(e,t){var r=t.id,n=Ue(t,["id"]),o=i(e,r,n);return qe({},e,{byId:qe({},e.byId,Ne({},r,o))})}(e,qe({type:n},o));default:return e}},init:u}},We=function(e){return function(t){return t.byId[e]}},He=function(e,t){return{useSelector:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p.a;return te(e,t)},useResourceSelector:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.a,n=Object(u.useCallback)((function(e){return r(We(t)(e))}),[]);return te(e,n)},useAction:function(e){return te(t,(function(t){return t[e]}))}}};function Ge(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Je(r,!0).forEach((function(t){Xe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Je(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ye=function(e,t){var r=V("pristine"),n=r.getInitialPristineState,o=r.updatePristine,u=r.removePristine,i=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Qe({id:t},e(),{},r,{},n())},c=function(t,r,n){return n=function(t,r){return L()(r)?e()[t]:r}(r,n),Qe({},t=o(t,r,n),Xe({},r,n))};return{reducer:function(e,r){var n=r.type,o=r.id,a=Ge(r,["type","id"]);switch("function"===t&&t(e,Qe({type:n},a)),n){case"initializeResource":return i(o,a.values);case"updateResource":return c(e,a.attr,a.value);case"updateBatchResource":return J(c,e,a.values);case"resetResource":return i(o);case"resetPristineResource":return u(e);case"resetPristineKeyResource":return u(e,a.attr);case"startProcessResource":return Qe({},e,{processing:!0});case"doneProcessResource":return Qe({},e,{processing:!1});default:return e}},init:i}};function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ze(r,!0).forEach((function(t){tt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var nt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.initialState,u=t.customReducer,c=t.customActions,a=t.resourceOptions,f=void 0===a?{}:a,s=K({initialState:r,defaultInitialState:we}),l=K({initialState:f.initialState,defaultInitialState:xe}),p=Ye(l,f.reducer),y=p.reducer,b=p.init,v=Ve({getInitialState:s,customReducer:u,resourceReducer:y,initResource:b}),d=v.reducer,O=(v.init,F()),h=rt(O,2),g=h[0],m=h[1],P=fe(g,m),w=ie(g,m),x=ve(w),_=He(g,m),S=_.useSelector,A=_.useAction,R=_.useResourceSelector,E=function(e){var t=e.children,r=e.extraArgument,u=rt(j(d,{actions:et({},n,{},o,{},c),init:s,extraArgument:r}),2),a=u[0],f=u[1];return i.a.createElement(m.Provider,{value:f},i.a.createElement(g.Provider,{value:a},t))};return E.displayName=e,{Provider:E,useCollection:P,useMember:w,useSelector:S,useAction:A,useResourceSelector:R,Field:x}};r.d(t,"makeMemberHoax",(function(){return Pe})),r.d(t,"makeCollectionHoax",(function(){return nt}))}])})); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["React"],t):"object"==typeof exports?exports["react-hoax"]=t(require("react")):e["react-hoax"]=t(e.React)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=95)}([function(t,r){t.exports=e},function(e,t){e.exports=function(e){return e}},function(e,t,r){var n=r(18),o="object"==typeof self&&self&&self.Object===Object&&self,u=n||o||Function("return this")();e.exports=u},function(e,t,r){var n=r(27);e.exports=function(e,t){return n(e,t)}},function(e,t,r){var n=r(40),o=r(46);e.exports=function(e,t){var r=o(e,t);return n(r)?r:void 0}},function(e,t,r){!function(e,t){t=t&&t.hasOwnProperty("default")?t.default:t;var r=Symbol(),n=function(e,n){var o=e[r];if(!o)throw new Error;var u=t.useReducer((function(e){return e+1}),0)[1],i=t.useContext(e),c=n(i),a=t.useRef(null);return t.useLayoutEffect((function(){a.current={f:n,v:i,s:c}})),t.useLayoutEffect((function(){var e=function(e){try{if(a.current.v===e||Object.is(a.current.s,a.current.f(e)))return}catch(e){}u()};return o.add(e),function(){o.delete(e)}}),[o]),c};e.createContext=function(e){var n,o,u=t.createContext(e,(function(){return 0}));return u[r]=new Set,u.Provider=(n=u.Provider,o=u[r],t.memo((function(e){var r=e.value,u=e.children;return o.forEach((function(e){e(r)})),t.createElement(n,{value:r},u)}))),delete u.Consumer,u},e.useContext=function(e){return n(e,(function(e){return e}))},e.useContextSelector=n}(t,r(0))},function(e,t,r){var n=r(30),o=r(31),u=r(32),i=r(33),c=r(34);function a(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])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=u,a.prototype.has=i,a.prototype.set=c,e.exports=a},function(e,t,r){var n=r(16);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},function(e,t,r){var n=r(14),o=r(42),u=r(43),i="[object Null]",c="[object Undefined]",a=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?c:i:a&&a in Object(e)?o(e):u(e)}},function(e,t,r){var n=r(4)(Object,"create");e.exports=n},function(e,t,r){var n=r(55);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t){e.exports=function(e){return null==e}},function(e,t,r){var n=r(4)(r(2),"Map");e.exports=n},function(e,t,r){var n=r(2).Symbol;e.exports=n},function(e,t){var r=Array.isArray;e.exports=r},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,r){var n=r(8),o=r(19),u="[object AsyncFunction]",i="[object Function]",c="[object GeneratorFunction]",a="[object Proxy]";e.exports=function(e){if(!o(e))return!1;var t=n(e);return t==i||t==c||t==u||t==a}},function(e,t,r){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(41))},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t){var r=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,r){var n=r(47),o=r(54),u=r(56),i=r(57),c=r(58);function a(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])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=u,a.prototype.has=i,a.prototype.set=c,e.exports=a},function(e,t,r){var n=r(59),o=r(62),u=r(63),i=1,c=2;e.exports=function(e,t,r,a,f,s){var l=r&i,p=e.length,y=t.length;if(p!=y&&!(l&&y>p))return!1;var b=s.get(e);if(b&&s.get(t))return b==t;var v=-1,d=!0,O=r&c?new n:void 0;for(s.set(e,t),s.set(t,e);++v<p;){var h=e[v],j=t[v];if(a)var g=l?a(j,h,v,t,e,s):a(h,j,v,e,t,s);if(void 0!==g){if(g)continue;d=!1;break}if(O){if(!o(t,(function(e,t){if(!u(O,t)&&(h===e||f(h,e,r,a,s)))return O.push(t)}))){d=!1;break}}else if(h!==j&&!f(h,j,r,a,s)){d=!1;break}}return s.delete(e),s.delete(t),d}},function(e,t,r){(function(e){var n=r(2),o=r(80),u=t&&!t.nodeType&&t,i=u&&"object"==typeof e&&e&&!e.nodeType&&e,c=i&&i.exports===u?n.Buffer:void 0,a=(c?c.isBuffer:void 0)||o;e.exports=a}).call(this,r(24)(e))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){var n=r(82),o=r(83),u=r(84),i=u&&u.isTypedArray,c=i?o(i):n;e.exports=c},function(e,t){var r=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}},function(e,t,r){var n=r(28),o=r(11);e.exports=function e(t,r,u,i,c){return t===r||(null==t||null==r||!o(t)&&!o(r)?t!=t&&r!=r:n(t,r,u,i,e,c))}},function(e,t,r){var n=r(29),o=r(22),u=r(64),i=r(68),c=r(90),a=r(15),f=r(23),s=r(25),l=1,p="[object Arguments]",y="[object Array]",b="[object Object]",v=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,d,O,h){var j=a(e),g=a(t),m=j?y:c(e),P=g?y:c(t),w=(m=m==p?b:m)==b,x=(P=P==p?b:P)==b,_=m==P;if(_&&f(e)){if(!f(t))return!1;j=!0,w=!1}if(_&&!w)return h||(h=new n),j||s(e)?o(e,t,r,d,O,h):u(e,t,m,r,d,O,h);if(!(r&l)){var S=w&&v.call(e,"__wrapped__"),A=x&&v.call(t,"__wrapped__");if(S||A){var R=S?e.value():e,E=A?t.value():t;return h||(h=new n),O(R,E,r,d,h)}}return!!_&&(h||(h=new n),i(e,t,r,d,O,h))}},function(e,t,r){var n=r(6),o=r(35),u=r(36),i=r(37),c=r(38),a=r(39);function f(e){var t=this.__data__=new n(e);this.size=t.size}f.prototype.clear=o,f.prototype.delete=u,f.prototype.get=i,f.prototype.has=c,f.prototype.set=a,e.exports=f},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,r){var n=r(7),o=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():o.call(t,r,1),--this.size,!0)}},function(e,t,r){var n=r(7);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},function(e,t,r){var n=r(7);e.exports=function(e){return n(this.__data__,e)>-1}},function(e,t,r){var n=r(7);e.exports=function(e,t){var r=this.__data__,o=n(r,e);return o<0?(++this.size,r.push([e,t])):r[o][1]=t,this}},function(e,t,r){var n=r(6);e.exports=function(){this.__data__=new n,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,r){var n=r(6),o=r(13),u=r(21),i=200;e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var c=r.__data__;if(!o||c.length<i-1)return c.push([e,t]),this.size=++r.size,this;r=this.__data__=new u(c)}return r.set(e,t),this.size=r.size,this}},function(e,t,r){var n=r(17),o=r(44),u=r(19),i=r(20),c=/^\[object .+?Constructor\]$/,a=Function.prototype,f=Object.prototype,s=a.toString,l=f.hasOwnProperty,p=RegExp("^"+s.call(l).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!u(e)||o(e))&&(n(e)?p:c).test(i(e))}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){var n=r(14),o=Object.prototype,u=o.hasOwnProperty,i=o.toString,c=n?n.toStringTag:void 0;e.exports=function(e){var t=u.call(e,c),r=e[c];try{e[c]=void 0;var n=!0}catch(e){}var o=i.call(e);return n&&(t?e[c]=r:delete e[c]),o}},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t,r){var n,o=r(45),u=(n=/[^.]+$/.exec(o&&o.keys&&o.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!u&&u in e}},function(e,t,r){var n=r(2)["__core-js_shared__"];e.exports=n},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,r){var n=r(48),o=r(6),u=r(13);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(u||o),string:new n}}},function(e,t,r){var n=r(49),o=r(50),u=r(51),i=r(52),c=r(53);function a(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])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=u,a.prototype.has=i,a.prototype.set=c,e.exports=a},function(e,t,r){var n=r(9);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,r){var n=r(9),o="__lodash_hash_undefined__",u=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return r===o?void 0:r}return u.call(t,e)?t[e]:void 0}},function(e,t,r){var n=r(9),o=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:o.call(t,e)}},function(e,t,r){var n=r(9),o="__lodash_hash_undefined__";e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?o:t,this}},function(e,t,r){var n=r(10);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,r){var n=r(10);e.exports=function(e){return n(this,e).get(e)}},function(e,t,r){var n=r(10);e.exports=function(e){return n(this,e).has(e)}},function(e,t,r){var n=r(10);e.exports=function(e,t){var r=n(this,e),o=r.size;return r.set(e,t),this.size+=r.size==o?0:1,this}},function(e,t,r){var n=r(21),o=r(60),u=r(61);function i(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}i.prototype.add=i.prototype.push=o,i.prototype.has=u,e.exports=i},function(e,t){var r="__lodash_hash_undefined__";e.exports=function(e){return this.__data__.set(e,r),this}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}},function(e,t){e.exports=function(e,t){return e.has(t)}},function(e,t,r){var n=r(14),o=r(65),u=r(16),i=r(22),c=r(66),a=r(67),f=1,s=2,l="[object Boolean]",p="[object Date]",y="[object Error]",b="[object Map]",v="[object Number]",d="[object RegExp]",O="[object Set]",h="[object String]",j="[object Symbol]",g="[object ArrayBuffer]",m="[object DataView]",P=n?n.prototype:void 0,w=P?P.valueOf:void 0;e.exports=function(e,t,r,n,P,x,_){switch(r){case m:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case g:return!(e.byteLength!=t.byteLength||!x(new o(e),new o(t)));case l:case p:case v:return u(+e,+t);case y:return e.name==t.name&&e.message==t.message;case d:case h:return e==t+"";case b:var S=c;case O:var A=n&f;if(S||(S=a),e.size!=t.size&&!A)return!1;var R=_.get(e);if(R)return R==t;n|=s,_.set(e,t);var E=i(S(e),S(t),n,P,x,_);return _.delete(e),E;case j:if(w)return w.call(e)==w.call(t)}return!1}},function(e,t,r){var n=r(2).Uint8Array;e.exports=n},function(e,t){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}},function(e,t){e.exports=function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}},function(e,t,r){var n=r(69),o=1,u=Object.prototype.hasOwnProperty;e.exports=function(e,t,r,i,c,a){var f=r&o,s=n(e),l=s.length;if(l!=n(t).length&&!f)return!1;for(var p=l;p--;){var y=s[p];if(!(f?y in t:u.call(t,y)))return!1}var b=a.get(e);if(b&&a.get(t))return b==t;var v=!0;a.set(e,t),a.set(t,e);for(var d=f;++p<l;){var O=e[y=s[p]],h=t[y];if(i)var j=f?i(h,O,y,t,e,a):i(O,h,y,e,t,a);if(!(void 0===j?O===h||c(O,h,r,i,a):j)){v=!1;break}d||(d="constructor"==y)}if(v&&!d){var g=e.constructor,m=t.constructor;g!=m&&"constructor"in e&&"constructor"in t&&!("function"==typeof g&&g instanceof g&&"function"==typeof m&&m instanceof m)&&(v=!1)}return a.delete(e),a.delete(t),v}},function(e,t,r){var n=r(70),o=r(72),u=r(75);e.exports=function(e){return n(e,u,o)}},function(e,t,r){var n=r(71),o=r(15);e.exports=function(e,t,r){var u=t(e);return o(e)?u:n(u,r(e))}},function(e,t){e.exports=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e}},function(e,t,r){var n=r(73),o=r(74),u=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,c=i?function(e){return null==e?[]:(e=Object(e),n(i(e),(function(t){return u.call(e,t)})))}:o;e.exports=c},function(e,t){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,u=[];++r<n;){var i=e[r];t(i,r,e)&&(u[o++]=i)}return u}},function(e,t){e.exports=function(){return[]}},function(e,t,r){var n=r(76),o=r(85),u=r(89);e.exports=function(e){return u(e)?n(e):o(e)}},function(e,t,r){var n=r(77),o=r(78),u=r(15),i=r(23),c=r(81),a=r(25),f=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=u(e),s=!r&&o(e),l=!r&&!s&&i(e),p=!r&&!s&&!l&&a(e),y=r||s||l||p,b=y?n(e.length,String):[],v=b.length;for(var d in e)!t&&!f.call(e,d)||y&&("length"==d||l&&("offset"==d||"parent"==d)||p&&("buffer"==d||"byteLength"==d||"byteOffset"==d)||c(d,v))||b.push(d);return b}},function(e,t){e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},function(e,t,r){var n=r(79),o=r(11),u=Object.prototype,i=u.hasOwnProperty,c=u.propertyIsEnumerable,a=n(function(){return arguments}())?n:function(e){return o(e)&&i.call(e,"callee")&&!c.call(e,"callee")};e.exports=a},function(e,t,r){var n=r(8),o=r(11),u="[object Arguments]";e.exports=function(e){return o(e)&&n(e)==u}},function(e,t){e.exports=function(){return!1}},function(e,t){var r=9007199254740991,n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var o=typeof e;return!!(t=null==t?r:t)&&("number"==o||"symbol"!=o&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,r){var n=r(8),o=r(26),u=r(11),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return u(e)&&o(e.length)&&!!i[n(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,r){(function(e){var n=r(18),o=t&&!t.nodeType&&t,u=o&&"object"==typeof e&&e&&!e.nodeType&&e,i=u&&u.exports===o&&n.process,c=function(){try{var e=u&&u.require&&u.require("util").types;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=c}).call(this,r(24)(e))},function(e,t,r){var n=r(86),o=r(87),u=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=[];for(var r in Object(e))u.call(e,r)&&"constructor"!=r&&t.push(r);return t}},function(e,t){var r=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},function(e,t,r){var n=r(88)(Object.keys,Object);e.exports=n},function(e,t){e.exports=function(e,t){return function(r){return e(t(r))}}},function(e,t,r){var n=r(17),o=r(26);e.exports=function(e){return null!=e&&o(e.length)&&!n(e)}},function(e,t,r){var n=r(91),o=r(13),u=r(92),i=r(93),c=r(94),a=r(8),f=r(20),s=f(n),l=f(o),p=f(u),y=f(i),b=f(c),v=a;(n&&"[object DataView]"!=v(new n(new ArrayBuffer(1)))||o&&"[object Map]"!=v(new o)||u&&"[object Promise]"!=v(u.resolve())||i&&"[object Set]"!=v(new i)||c&&"[object WeakMap]"!=v(new c))&&(v=function(e){var t=a(e),r="[object Object]"==t?e.constructor:void 0,n=r?f(r):"";if(n)switch(n){case s:return"[object DataView]";case l:return"[object Map]";case p:return"[object Promise]";case y:return"[object Set]";case b:return"[object WeakMap]"}return t}),e.exports=v},function(e,t,r){var n=r(4)(r(2),"DataView");e.exports=n},function(e,t,r){var n=r(4)(r(2),"Promise");e.exports=n},function(e,t,r){var n=r(4)(r(2),"Set");e.exports=n},function(e,t,r){var n=r(4)(r(2),"WeakMap");e.exports=n},function(e,t,r){"use strict";r.r(t);var n={};r.r(n),r.d(n,"initialize",(function(){return P})),r.d(n,"update",(function(){return w})),r.d(n,"updateBatch",(function(){return x})),r.d(n,"updateOnChange",(function(){return _})),r.d(n,"reset",(function(){return S})),r.d(n,"resetPristine",(function(){return A})),r.d(n,"resetPristineKey",(function(){return R})),r.d(n,"startFetch",(function(){return E})),r.d(n,"doneFetch",(function(){return D})),r.d(n,"failFetch",(function(){return I})),r.d(n,"startProcess",(function(){return k})),r.d(n,"doneProcess",(function(){return C}));var o={};r.r(o),r.d(o,"initializeResource",(function(){return Ee})),r.d(o,"updateResource",(function(){return De})),r.d(o,"updateBatchResource",(function(){return Ie})),r.d(o,"updateOnChangeResource",(function(){return ke})),r.d(o,"removeResource",(function(){return Ce})),r.d(o,"resetResource",(function(){return ze})),r.d(o,"resetPristineResource",(function(){return Fe})),r.d(o,"resetPristineKeyResource",(function(){return Te})),r.d(o,"startFetchResource",(function(){return Me})),r.d(o,"doneFetchResource",(function(){return Be})),r.d(o,"failFetchResource",(function(){return Ke})),r.d(o,"startProcessResource",(function(){return Ue})),r.d(o,"doneProcessResource",(function(){return Le}));var u=r(0),i=r.n(u);function c(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var a=function(e){var t=Object(u.useRef)();return Object(u.useEffect)((function(){t.current=e}),[e]),t.current},f=r(3),s=r.n(f),l=r(1),p=r.n(l),y=function(e,t){var r=Array.isArray(t),n=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.length?r.reduce((function(e,t){return[].concat(c(e),[a(t)])}),[a(e)]):a(e)}(e),o=Object(u.useRef)();Object(u.useEffect)((function(){return o.current=r?t:[],o.current.forEach((function(t){return t(e,n)})),function(){return o.current=[]}}),[e])};function b(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function O(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var h=function(e,t,r,n,o){if("function"!=typeof e)return t(e);var u=e.apply(void 0,O(n));return"function"==typeof u?u(t,r,o):t(u)},j=function(e,t){var r=t.initialState,n=t.init,o=void 0===n?p.a:n,i=t.actions,c=void 0===i?{}:i,a=t.observers,f=t.extraArgument,s=d(Object(u.useReducer)(e,r,o),2),l=s[0],O=s[1],j=Object(u.useRef)();j.current=l,y(l,a);var g=Object(u.useRef)();if(g.current)return[l,g.current];var m=function(){return j.current};return g.current=Object.keys(c).reduce((function(e,t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?b(r,!0).forEach((function(t){v(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,v({},t,(function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return h(c[t],O,m,r,f)})))}),{dispatch:O}),[l,g.current]};function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var P=function(e){return{type:"initialize",values:e}},w=function(e,t){return{type:"update",attr:e,value:t}},x=function(e){return{type:"updateBatch",values:e}},_=function(e){var t=e.target;return w(t.name,t.value)},S={type:"reset"},A={type:"resetPristine"},R=function(e){return{type:"resetPristineKey",attr:e}},E={type:"startFetch"},D=function(e){return{type:"doneFetch",values:e}},I=function(e){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(r,!0).forEach((function(t){m(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},e,{type:"failFetch"})},k={type:"startProcess"},C={type:"doneProcess"},z=r(5),F=function(){return[Object(z.createContext)({}),Object(z.createContext)({})]};function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function M(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B(e){return(B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var K=function(e){var t=e.initialState,r=e.defaultInitialState;return t&&"object"===B(t)?(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(r,!0).forEach((function(t){M(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},r,{},t),function(){return t}):(console.error("Hoax needs an object as initial state - empty object will be used instead"),function(){return r})},U=r(12),L=r.n(U);function $(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function q(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$(r,!0).forEach((function(t){N(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function N(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var V=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"pristine",t=function(){return N({},e,{})},r=function(t,r){var n;return null===(n=t[e])||void 0===n?void 0:n.hasOwnProperty(r)},n=function(t,r){return q({},t,N({},e,q({},t[e],N({},r,t[r]))))},o=function(n,o){return o?r(n,o)?(delete n[e][o],q({},n,N({},e,q({},n[e])))):n:q({},n,{},t())};return{updatePristine:function(t,u,i){var c=r(t,u);return c||s()(i,t[u])?c&&s()(i,t[e][u])?o(t,u):t:n(t,u)},removePristine:o,getInitialPristineState:t}};function W(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function H(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?W(r,!0).forEach((function(t){G(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):W(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function G(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var J=function(e,t,r){return Array.isArray(r)?function(e,t,r){return r.reduce((function(t,r){var n=r.attr,o=r.value;return H({},t,{},e(t,n,o))}),t)}(e,t,r):function(e,t,r){return Object.keys(r).reduce((function(t,n){return H({},t,{},e(t,n,r[n]))}),t)}(e,t,r)};function Q(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function X(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?X(r,!0).forEach((function(t){Z(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):X(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Z(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var ee=function(e,t){var r=V("pristine"),n=r.getInitialPristineState,o=r.updatePristine,u=r.removePristine,i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Y({},e(),{},t,{},n())},c=function(t,r,n){return n=function(t,r){return L()(r)?e()[t]:r}(r,n),Y({},t=o(t,r,n),Z({},r,n))};return{reducer:function(e,r){var n=r.type,o=Q(r,["type"]);switch("function"===t&&t(e,Y({type:n},o)),n){case"initialize":return i(o.values);case"update":return c(e,o.attr,o.value);case"updateBatch":return J(c,e,o.values);case"reset":return i();case"resetPristine":return u(e);case"resetPristineKey":return u(e,o.attr);case"startProcess":return Y({},e,{processing:!0});case"doneProcess":return Y({},e,{processing:!1});default:return e}},init:i}},te=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.a,r=Object(u.useRef)();return Object(z.useContextSelector)(e,(function(e){var n=t(e);return s()(r.current,n)||(r.current=n),r.current}))},re=function(e){return function(t){return t.byId[e]}},ne=function(e,t){return{useSelector:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p.a;return te(e,t)},useResourceSelector:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p.a,n=Object(u.useCallback)((function(e){return r(re(t)(e))}),[]);return te(e,n)},useAction:function(e){return te(t,(function(t){return t[e]}))}}};function oe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ue(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ie(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var ce=function(e){return function(t){return e?t.updateResource:t.update}},ae=function(e,t,r){return function(r){var n=r.fieldKey,o=r.resourceId,i=r.getUpdate,c=void 0===i?ce:i,a=r.select,f=void 0===a?o?re:p.a:a,s=Object(u.useCallback)((function(e){var t=o?f(o)(e):f(e);return[t[n],t.errors]}),[o,n]),l=ie(te(e,s),2),y=l[0],b=l[1],v=Object(u.useCallback)((function(e){var t=c(o)(e);if("function"!=typeof t)throw new Error("useMember expects an 'update' dispatch function");return o?function(e,r){return t(o,e,r)}:t}),[o]),d=te(t,v);return[y,Object(u.useCallback)((function(e){return d(n,e)}),[d,n]),b[n],Object(u.useCallback)((function(e){return d("errors",function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?oe(r,!0).forEach((function(t){ue(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},b,ue({},n,e)))}),[d,b])]}};function fe(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function se(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var le=function(e,t){var r=ae(e,t);return function(e){var t=e.fieldKey,n=e.resourceId,o=e.uniq,i=e.getUpdate,c=e.select,a=fe(r({fieldKey:t,resourceId:n,getUpdate:i,select:c}),4),f=a[0],s=a[1],l=a[2],y=a[3],b=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?function(e){return se(new Set(e))}:p.a}(o),v=Object(u.useCallback)((function(e){e<0||e>=f.length||s(b([].concat(se(f.slice(0,e)),se(f.slice(e+1)))))}),[f]),d=Object(u.useCallback)((function(e,t){e<0||e>=f.length||s(b([].concat(se(f.slice(0,e)),[t],se(f.slice(e+1)))))}),[f]),O=Object(u.useCallback)((function(e,t){e<0||s(b([].concat(se(f.slice(0,e)),[t],se(f.slice(e)))))}),[f]),h=Object(u.useCallback)((function(e){return O(f.length,e)}),[f]),j=Object(u.useCallback)((function(e,t){if(!(e<0||e>=f.length||t<0||t>=f.length)){var r=se(f),n=fe(r.splice(e,1),1)[0];r.splice(t,0,n),s(b(r))}}),[f]);return{collection:f,set:s,add:O,push:h,edit:d,remove:v,reorder:j,error:l,setError:y}}};function pe(){return(pe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function ye(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function be(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var ve=function(e){return e.target.value},de=function(e){return e.target.checked},Oe=function(e){var t=function(t){var r=t.Component,n=void 0===r?"input":r,o=t.fieldKey,c=t.select,a=t.resourceId,f=(t.getUpdate,t.onChange),s=void 0===f?p.a:f,l=be(t,["Component","fieldKey","select","resourceId","getUpdate","onChange"]),y=ye(e({fieldKey:o,select:c,resourceId:a}),3),b=y[0],v=y[1],d=y[2],O=function(){return v(s.apply(void 0,arguments))};return Object(u.useMemo)((function(){return i.a.createElement(n,pe(function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}({name:o,"data-testid":o,onChange:O,value:b,error:d},"name",o),l))}),[b,d])};return{Select:function(e){var r=e.Component,n=void 0===r?"select":r,o=e.onChange,u=void 0===o?de:o,c=e.options,a=void 0===c?[]:c,f=be(e,["Component","onChange","options"]);i.a.createElement(t,pe({Component:n,onChange:u,options:a},f))},Checkbox:function(e){var r=e.type,n=void 0===r?"checkbox":r,o=e.onChange,u=void 0===o?de:o,c=be(e,["type","onChange"]);return i.a.createElement(t,pe({type:n,onChange:u},c))},Input:function(e){var r=e.onChange,n=void 0===r?ve:r,o=be(e,["onChange"]);return i.a.createElement(t,pe({type:"text",onChange:n},o))}}},he=function(e,t){return{useSelector:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p.a;return te(e,t)},useAction:function(e){return te(t,(function(t){return t[e]}))}}},je={loading:!0,loaded:!1,processing:!1,errors:{}};function ge(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function me(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ge(r,!0).forEach((function(t){Pe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ge(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Pe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function we(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var xe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.initialState,o=t.customReducer,u=t.customActions,c=K({initialState:r,defaultInitialState:je}),a=ee(c,o),f=a.reducer,s=a.init,l=F(),p=we(l,2),y=p[0],b=p[1],v=ae(y,b),d=le(y,b),O=Oe(v),h=he(y,b),g=h.useSelector,m=h.useAction,P=function(e){var t=e.children,r=e.extraArgument,o=we(j(f,{init:s,actions:me({},n,{},u),extraArgument:r}),2),c=o[0],a=o[1];return i.a.createElement(b.Provider,{value:a},i.a.createElement(y.Provider,{value:c},t))};return P.displayName=e,{Provider:P,useMember:v,useCollection:d,useSelector:g,useAction:m,Field:O}},_e={loading:!0,loaded:!1,processing:!1,byId:{},ids:[]},Se={loading:!0,loaded:!1,processing:!1,errors:{}};function Ae(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Re(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ee=function(e,t){return{type:"initializeResource",id:e,values:t}},De=function(e,t,r){return{type:"updateResource",id:e,attr:t,value:r}},Ie=function(e,t){return{type:"updateBatchResource",id:e,values:t}},ke=function(e,t){var r=t.target;return De(e,r.name,r.value)},Ce=function(e){return{type:"removeResource",id:e}},ze=function(e){return{type:"resetResource",id:e}},Fe=function(e){return{type:"resetPristineResource",id:e}},Te=function(e,t){return{type:"resetPristineKeyResource",id:e,attr:t}},Me=function(e){return{type:"startFetchResource",id:e}},Be=function(e,t){return{type:"doneFetchResource",id:e,values:t}},Ke=function(e,t){return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ae(r,!0).forEach((function(t){Re(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ae(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{type:"failFetchResource",id:e})},Ue=function(e){return{type:"startProcessResource",id:e}},Le=function(e){return{type:"doneProcessResource",id:e}};function $e(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function qe(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Ne(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ve(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ne(r,!0).forEach((function(t){We(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ne(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function We(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var He=function(e){var t=e.getInitialState,r=e.customReducer,n=e.resourceReducer,o=e.initResource,u=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve({id:id},t(),{},e)},i=function(e,t,r){var u=e.byId[t]||o();return n(u,Ve({id:t},r))},c=function(e,t,r){var n=t.toString(),o=e.byId.hasOwnProperty(n)?e.ids:[].concat(qe(e.ids),[n]);return Ve({},e,{byId:Ve({},e.byId,We({},n,i(e,n,{type:"updateBatchResource",values:r}))),ids:o})};return{reducer:function(e,t){var n=t.type,o=$e(t,["type"]);switch("function"===r&&r(e,Ve({type:n},o)),n){case"update":return c(e,o.attr,o.value);case"updateBatch":return J(c,e,o.values);case"reset":return u();case"startFetch":return Ve({},e,{loading:!0});case"doneFetch":return function(e,t){var r=[],n=t.reduce((function(t,n){return r.push(n.id),Ve({},t,We({},n.id,i(e,n.id,{type:"initializeResource",values:n})))}),{});return Ve({},e,{byId:Ve({},e.byId,{},n),ids:qe(new Set([].concat(qe(e.ids),r))),loading:!1,loaded:!0})}(e,o.values);case"failFetch":return Ve({},e,{loading:!1});case"removeResource":return function(e,t){var r=delete e.byId[t],n=e.ids.filter((function(e){return e!==t}));return Ve({},e,{byId:Ve({},r),ids:n})}(e,o.id);case"initializeResource":case"updateResource":case"updateBatchResource":case"resetResource":case"resetPristineResource":case"resetPristineKeyResource":case"startProcessResource":case"doneProcessResource":return function(e,t){var r=t.id,n=$e(t,["id"]),o=i(e,r,n);return Ve({},e,{byId:Ve({},e.byId,We({},r,o))})}(e,Ve({type:n},o));default:return e}},init:u}};function Ge(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)r=u[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Je(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Qe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Je(r,!0).forEach((function(t){Xe(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Je(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Xe(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ye=function(e,t){var r=V("pristine"),n=r.getInitialPristineState,o=r.updatePristine,u=r.removePristine,i=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Qe({id:t},e(),{},r,{},n())},c=function(t,r,n){return n=function(t,r){return L()(r)?e()[t]:r}(r,n),Qe({},t=o(t,r,n),Xe({},r,n))};return{reducer:function(e,r){var n=r.type,o=r.id,a=Ge(r,["type","id"]);switch("function"===t&&t(e,Qe({type:n},a)),n){case"initializeResource":return i(o,a.values);case"updateResource":return c(e,a.attr,a.value);case"updateBatchResource":return J(c,e,a.values);case"resetResource":return i(o);case"resetPristineResource":return u(e);case"resetPristineKeyResource":return u(e,a.attr);case"startProcessResource":return Qe({},e,{processing:!0});case"doneProcessResource":return Qe({},e,{processing:!1});default:return e}},init:i}};function Ze(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function et(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ze(r,!0).forEach((function(t){tt(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ze(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var r=[],n=!0,o=!1,u=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,u=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw u}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var nt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.initialState,u=t.customReducer,c=t.customActions,a=t.resourceOptions,f=void 0===a?{}:a,s=K({initialState:r,defaultInitialState:_e}),l=K({initialState:f.initialState,defaultInitialState:Se}),p=Ye(l,f.reducer),y=p.reducer,b=p.init,v=He({getInitialState:s,customReducer:u,resourceReducer:y,initResource:b}),d=v.reducer,O=(v.init,F()),h=rt(O,2),g=h[0],m=h[1],P=le(g,m),w=ae(g,m),x=Oe(w),_=ne(g,m),S=_.useSelector,A=_.useAction,R=_.useResourceSelector,E=function(e){var t=e.children,r=e.extraArgument,u=rt(j(d,{actions:et({},n,{},o,{},c),init:s,extraArgument:r}),2),a=u[0],f=u[1];return i.a.createElement(m.Provider,{value:f},i.a.createElement(g.Provider,{value:a},t))};return E.displayName=e,{Provider:E,useCollection:P,useMember:w,useSelector:S,useAction:A,useResourceSelector:R,Field:x}};r.d(t,"makeMemberHoax",(function(){return xe})),r.d(t,"makeCollectionHoax",(function(){return nt}))}])})); |
{ | ||
"name": "react-hoax", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Idiomatic resourceful context", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -26,5 +26,7 @@ # React Hoax | ||
#### For multiple resources [here](https://novykh.github.io/react-hoax/collectionHoax.html) | ||
The `byId` pattern is persuaded, check the [initialState](https://novykh.github.io/react-hoax/collectionHoax.html#.initialState). | ||
Example, | ||
``` | ||
@@ -52,4 +54,6 @@ import { makeCollectionHoax } from "react-hoax"; | ||
``` | ||
As you can see, React Hoax provides you with the essentials to start coding right away. | ||
This will create a Context provider, with the state: | ||
``` | ||
@@ -64,4 +68,6 @@ { | ||
``` | ||
Which works for multiple resources of the same type. | ||
Adding a resource of `id=1`, will change the state to: | ||
``` | ||
@@ -79,3 +85,3 @@ { | ||
pristine: {}, | ||
// plus our custom attributes needed | ||
@@ -94,5 +100,7 @@ title: "", | ||
#### For a single resource [here](file:///Users/johnnyklironomos/Projects/react-hoax/docs/memberHoax.html) | ||
It keeps it simple, check the [initialState](https://novykh.github.io/react-hoax/memberHoax.html#.initialState). | ||
Example, | ||
``` | ||
@@ -118,2 +126,3 @@ import { makeMemberHoax } from "react-hoax"; | ||
React Hoax provides global actions for the everyday needs: | ||
``` | ||
@@ -133,4 +142,7 @@ initialize | ||
``` | ||
but you can add more yourself. _documentation is coming soon..._ | ||
but you can add more yourself. | ||
_documentation is coming soon..._ | ||
## Reducers | ||
@@ -146,2 +158,3 @@ | ||
#### Selectors | ||
For performant retrieving part of state (or all of it) of a resource. (i.e. `useResourceSelector`, `useSelector`) | ||
@@ -151,2 +164,3 @@ But, also, for getting the action needed for dispatch from the resource's context. (i.e. `useAction`) | ||
#### useMember & useCollection | ||
Are you bored of passing down the components tree props and actions for simple CRUD operations on the state? | ||
@@ -156,8 +170,11 @@ Those two selector hooks on steroids will save you the time and the sanity! | ||
Check the API of `useMember`: | ||
``` | ||
const [value, setValue, error, seError] = useMember({fieldKey: 'keyOnYourState'}); | ||
const [value, setValue, error, setError] = useMember({fieldKey: 'keyOnYourState'}); | ||
``` | ||
How fun is that? | ||
Now check the API of `useCollection` _(it's basically helping with values on state that are arrays)_ | ||
``` | ||
@@ -168,2 +185,3 @@ const {collection, setCollection, add, push, edit, remove, reorder, error, setError} = useCollection({fieldKey: 'keyOnYourState'}); | ||
## Fields | ||
_COMING SOON_ | ||
@@ -170,0 +188,0 @@ |
import { useCallback } from "react"; | ||
import useContextSelector from "../useContextSelector"; | ||
import identity from "lodash/identity"; | ||
import { makeByIdSelector } from "../collection/makeUseSelector"; | ||
@@ -18,7 +19,7 @@ /** | ||
export default (StateCtx, DispatchCtx) => ({ | ||
export default (StateCtx, DispatchCtx, useResourceSelector) => ({ | ||
fieldKey, | ||
resourceId, | ||
getUpdate = defaultGetUpdate, | ||
select = identity | ||
select = resourceId ? makeByIdSelector : identity | ||
}) => { | ||
@@ -25,0 +26,0 @@ const selector = useCallback( |
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
117889
2023
186