react-transporter
Advanced tools
Comparing version 0.5.21 to 0.6.0
@@ -1,24 +0,23 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("redux"),require("react"),require("crypto"),require("react-redux"),require("graphql/utilities/valueFromASTUntyped")):"function"==typeof define&&define.amd?define(["exports","redux","react","crypto","react-redux","graphql/utilities/valueFromASTUntyped"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["react-transporter"]={},t.Redux,t.React,t.require$$0,t.ReactRedux,t.valueFromASTUntyped)}(this,(function(t,e,n,r,i,o){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var s=a(n),u=a(r);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function d(t,e,n){return e&&f(t.prototype,e),n&&f(t,n),t}function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function h(){return(h=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),!0).forEach((function(e){p(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function m(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&g(t,e)}function b(t){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function g(t,e){return(g=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function E(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function S(t,e,n){return(S=E()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&g(i,n.prototype),i}).apply(null,arguments)}function w(t){var e="function"==typeof Map?new Map:void 0;return(w=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return S(t,arguments,b(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),g(r,t)})(t)}function R(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function O(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function k(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?O(t):e}function T(t){var e=E();return function(){var n,r=b(t);if(e){var i=b(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return k(this,n)}}function _(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=!0,o=t}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}(t,e)||P(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function j(t){return function(t){if(Array.isArray(t))return A(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||P(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function P(t,e){if(t){if("string"==typeof t)return A(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(t,e):void 0}}function A(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function D(t,e){return v({type:"TRANSPORTER_QUERY",query:t},e)}function C(){return(new Date).getTime()}function x(t){return"string"==typeof t||t instanceof String}var N=function t(e){var n=Object.keys(e);n.sort();var r=n.map((function(n){var r=function(e){return null===e?null:"object"===c(e)?t(e):JSON.stringify(e)}(e[n]);return null===r?r:'"'.concat(n,'":').concat(r)})).filter((function(t){return null!==t}));return 0===r.length?null:"{".concat(r.join(","),"}")};function M(t){if(x(t))return t;var e=N(t[1]);return"".concat(t[0]).concat(e?"(".concat(e,")"):"")}function U(t){return!!t&&(Object.prototype.hasOwnProperty.call(t,"link")&&"function"!=typeof t.link)}function L(t){return!(null===t||x(t[0]))}var I=function(){function t(e,n){l(this,t),e?U(e)?(this.meta=e.meta,this.link=e.link):this.link=[e,n]:this.link=null}return d(t,[{key:"setMeta",value:function(t){return this.meta="function"==typeof t?t(this.meta):t,this}},{key:"toSource",value:function(){return{link:this.link,meta:this.meta}}}]),t}();function q(t,e){return t[0]===e[0]&&t[1]===e[1]}function B(t,e){return U(t)?L(t.link)?t.link:[t.link]:x(t)?x(e)?[[t,e]]:e.map((function(e){return[t,e]})):t}function F(t,e){return t.filter((function(t){return!e.some((function(e){return q(t,e)}))}))}var $=function(){function t(e,n){l(this,t),e?(U(e)&&(this.meta=e.meta),this.link=B(e,n)):this.link=[]}return d(t,[{key:"prepend",value:function(t,e){var n=B(t,e);return this.link=[].concat(j(n),j(this.link)),this}},{key:"append",value:function(t,e){var n=B(t,e);return this.link=[].concat(j(this.link),j(n)),this}},{key:"syncPrepend",value:function(t,e){var n=B(t,e),r=F(this.link,n);return this.link=[].concat(j(n),j(r)),this}},{key:"syncAppend",value:function(t,e){var n=B(t,e),r=F(this.link,n);return this.link=[].concat(j(r),j(n)),this}},{key:"detach",value:function(t,e){var n=B(t,e);return this.link=null===n?[]:F(this.link,n),this}},{key:"setMeta",value:function(t){return this.meta="function"==typeof t?t(this.meta):t,this}},{key:"toSource",value:function(){return{link:this.link,meta:this.meta}}}]),t}(),Q=function(t){m(n,t);var e=T(n);function n(t,r){var i;return l(this,n),(i=x(r)?e.call(this,"".concat(t," [").concat(r,"]")):r?e.call(this,"".concat(t," [").concat(r[0],", ").concat(r[1],"]")):e.call(this,t)).name="StoreError",console.error("StoreError: ".concat(i.message)),k(i)}return n}(w(Error));function W(t,e,n,r){var i=function(t,e,n,r){return void 0!==e[t]?e[t]:r&&"UPDATE"===r.type&&void 0!==r.data[t]?r.data[t].originalValue:n[t]}(t,e,n,r);return U(i)?L(i.link)?new $(i):new I(i):i}function V(t,e,n){var r,i="function"==typeof n?n(e):n;return U(i)?i.toSource():(r=i,"[object Date]"===Object.prototype.toString.call(r)?i.toISOString():i)}function J(t,e,n,r){if(void 0!==e){if(U(e)&&!U(n)){var i='Cannot set field "'.concat(t,'", because it needs a scalar value, not a connection.');throw new Q(i,r)}if(!U(e)&&U(n)){var o='Cannot set field "'.concat(t,'", because it needs a connection, not a scalar value.');throw new Q(o,r)}if(U(e)&&U(n)){if(L(e.link)&&!L(n.link)){var a='Cannot set field "'.concat(t,'", because it is of type ManyLink, not Link.');throw new Q(a,r)}if(!L(e.link)&&L(n.link)){var s='Cannot set field "'.concat(t,'", because it is of type Link, not ManyLink.');throw new Q(s,r)}}}}var Y=function(){function t(e,n,r,i){l(this,t),this.type=e,this.id=n,this.originalData=r||{},this.data={},this.optimistic=i}return d(t,[{key:"get",value:function(t){if(void 0===this.data[t]&&void 0===this.originalData[t]){var e='Cannot get field "'.concat(t,'", because it does not exist.');throw new Q(e,[this.type,this.id])}return W(t,this.data[t],this.originalData[t],this.optimistic)}},{key:"setDistinct",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.set(t,e)}},{key:"set",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=M(t),r=W(n,this.data,this.originalData,this.optimistic),i=V(0,r,e);J(n,r,i,[this.type,this.id]),this.data[n]=i}},{key:"fill",value:function(t){var e=this;Object.keys(t).forEach((function(n){e.set(n,t[n])}))}}]),t}(),H=function(){function t(e){l(this,t),this.obj=e||{}}return d(t,[{key:"forEach",value:function(t){var e=this;Object.keys(this.obj).forEach((function(n){Object.keys(e.obj[n]).forEach((function(r){t([e.obj[n][r],n,r])}))}))}},{key:"get",value:function(t,e){if(this.obj[t]&&this.obj[t][e])return this.obj[t][e]}},{key:"set",value:function(t,e,n){this.obj[t]||(this.obj[t]={}),this.obj[t][e]=n}},{key:"delete",value:function(t,e){if(!this.obj[t]||!this.obj[t][e])throw new Error("Cannot delete entity [".concat(t,", ").concat(e,"], because entity does not exist."));delete this.obj[t][e],0===Object.keys(this.obj[t]).length&&delete this.obj[t]}},{key:"toSource",value:function(){return this.obj}}]),t}();var G=function(){function t(e,n){l(this,t),this.data={entities:new H(e.entities.data),roots:e.roots.data},this.optimistic={entities:new H(e.entities.optimistic),roots:e.roots.optimistic},this.response={entities:new H(n&&n.entities),roots:n&&n.roots||{},trash:[]}}return d(t,[{key:"insert",value:function(t,e,n){!function(t,e,n){if(t)throw new Q("Cannot insert entity, because entity already exists.",n);if(e&&"DELETE"===e.type)throw new Q("Cannot perform insert on optimistically deleted entity.",n)}(this.data.entities.get(t,e),this.optimistic.entities.get(t,e),[t,e]);var r=new Y(t,e);n(r),this.response.entities.set(t,e,r.data)}},{key:"update",value:function(t,e,n){var r=this.data.entities.get(t,e),i=this.optimistic.entities.get(t,e);!function(t,e,n){if(!t){var r=e&&"DELETE"===e.type?"Cannot perform update on optimistically deleted entity.":"Cannot update entity, because entity does not exist.";throw new Q(r,n)}if(e&&"CREATE"===e.type)throw new Q("Cannot perform update on optimistically created entity.",n)}(r,i,[t,e]);var o=new Y(t,e,r,i);n(o);var a=this.response.entities.get(t,e),s=a?v(v({},a),o.data):o.data;this.response.entities.set(t,e,s)}},{key:"delete",value:function(t,e){!function(t,e,n){if(!t){var r=e&&"DELETE"===e.type?"Cannot perform delete on optimistically deleted entity.":"Cannot delete entity, because entity does not exist.";throw new Q(r,n)}if(e&&"CREATE"===e.type)throw new Q("Cannot perform delete on optimistically created entity.",n)}(this.data.entities.get(t,e),this.optimistic.entities.get(t,e),[t,e]),this.response.trash.push([t,e])}},{key:"setRoot",value:function(t,e){var n=M(t),r=W(n,this.response.roots,this.data.roots,this.optimistic.roots),i=V(0,r,e);J(n,r,i,"root"),this.response.roots[n]=i}},{key:"toSource",value:function(){var t={},e=this.response.entities.toSource();Object.keys(e).length>0&&(t.entities=e);var n=this.response.roots;Object.keys(n).length>0&&(t.roots=n);var r=this.response.trash;return r.length>0&&(t.trash=r),t}}]),t}(),z=function(){function t(){l(this,t)}return d(t,null,[{key:"generate",value:function(){return this.counter+=1,this.counter}}]),t}();p(z,"counter",1);var K,X=function(t){m(n,t);var e=T(n);function n(t,r,i,o){var a;return l(this,n),(a=e.call(this,r)).name="TransporterError",a.type=t,a.data=i,a.code=o,a}return n}(w(Error));function Z(t,e){var n=C(),r="TRANSPORTER_MUTATION"===t.type,i=t.id||z.generate(),o=r?t.mutation.loc.source.body:t.query.loc.source.body;function a(t,e,n){var i=n?v({},n):null;if(i&&r&&delete i.roots,!t)return i;var o=new G(e.transporter,i);return t(o,n),o.toSource()}return function(s,u){function c(e,n,r){return s({type:"TRANSPORTER_REQUEST_ERROR",id:i,endTime:C(),optimisticData:r,data:n,error:{type:e.type,message:e.message,data:e.data}}),K&&K(e,t),Promise.reject(e)}var l;if(r)try{l=a(t.optimisticUpdater,u())}catch(t){if("StoreError"===t.name){var f=new X("StoreError","Request failed (StoreError)",{error:t.message});return K&&K(f),Promise.reject(f)}throw t}return s({type:"TRANSPORTER_REQUEST_START",id:i,startTime:n,optimisticData:l}),e(o,t.variables).then((function(e){return e.json().then((function(r){if(!e.ok)return c(new X("HttpError","Request failed (HttpError - ".concat(e.status,")"),r,e.status),null,l);var o,f=u();if(f.transporter.info.lastReset>=n){var d=new Q("Store reset after request was started.");return c(new X("StoreError","Request failed (StoreError)",{error:d.message}),null,null)}if(r.errors)return r.errors.forEach((function(t){console.error("GraphQLError: ".concat(t.message))})),c(new X("GraphQLError","Request failed (GraphQLError)",{errors:r.errors}),r.data,l);if(r.data)try{o=a(t.updater,f,r.data)}catch(d){if("StoreError"===d.name)return c(new X("StoreError","Request failed (StoreError)",{error:d.message}),r.data,l);throw d}return s({type:"TRANSPORTER_REQUEST_COMPLETED",id:i,endTime:C(),optimisticData:l,data:o}),r.data}),(function(t){return e.ok?c(new X("JsonError","".concat(t.message," (JsonError)")),null,l):c(new X("HttpError","Request failed (HttpError - ".concat(e.status,")"),null,e.status),null,l)}))}),(function(t){return c(new X("NetworkError","".concat(t.message," (NetworkError)")),null,l)}))}}function tt(t,e){return{data:e,optimistic:{type:"CREATE",id:t}}}function et(t,e,n,r){var i=v({},n),o={type:"UPDATE",data:r?v({},r.data):{}};return Object.keys(e).forEach((function(r){i[r]=e[r];var a=o.data[r]?{originalValue:o.data[r].originalValue,values:j(o.data[r].values)}:{originalValue:n[r],values:[]};a.values.push({active:!0,id:t,value:e[r]}),o.data[r]=a})),{data:i,optimistic:o}}function nt(t,e){return{optimistic:{type:"DELETE",id:t,data:e}}}function rt(t,e,n,r,i){var o={data:r,optimistic:i};return Object.keys(e).forEach((function(e){var r=i.data[e].values.findIndex((function(e){return e.id===t}));if(-1===r)throw new Error("Position not found.");o.data=function(t,e,n,r,i){var o=i.data[e],a=o.originalValue,s=o.values;if(t!==s.length-1||!s[t].active)return r;var u=v({},r);return n&&void 0!==n[e]?u[e]=n[e]:1===s.length?void 0===a?delete u[e]:u[e]=a:u[e]=s[t-1].value,u}(r,e,n,o.data,o.optimistic),o.optimistic=function(t,e,n,r){var i=r.data[e].values,o={type:"UPDATE",data:v({},r.data)};if(1===i.length)return delete o.data[e],o;var a=n&&void 0!==n[e],s={originalValue:o.data[e].originalValue,values:j(o.data[e].values)};return a&&i[t].active&&(s.originalValue=n[e],s.values=s.values.map((function(e,n){return n<t?v(v({},e),{},{active:!1}):e}))),s.values.splice(t,1),o.data[e]=s,o}(r,e,n,o.optimistic)})),0===Object.keys(o.optimistic.data).length&&(o.optimistic=null),o}function it(t,e,n,r){if(r.id!==t)throw new Error("Optimistic deletion was processed by other request.");return e&&e.some((function(t){return q(t,n)}))?{data:null}:{data:r.data}}function ot(t,e){var n=Object.keys(t);return e?n.filter((function(t){return void 0===e[t]})):n}function at(t,e){return e?t.filter((function(t){return e.some((function(e){return q(t,e)}))})):t}function st(t){var e={};return Object.keys(t).forEach((function(n){e[n]=v({},t[n])})),e}function ut(t){var e={data:t,optimistic:{}};return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;if("TRANSPORTER_STORE_RESET"===n.type)return n.data&&n.data.entities?{data:n.data.entities,optimistic:{}}:e;if("TRANSPORTER_REQUEST_START"===n.type&&n.optimisticData){var r=new H(st(t.data)),i=new H(st(t.optimistic));if(n.optimisticData.entities){var o=new H(n.optimisticData.entities);o.forEach((function(t){var e=_(t,3),o=e[0],a=e[1],s=e[2];if(!r.get(a,s)){var u=tt(n.id,o),c=u.data,l=u.optimistic;r.set(a,s,c),i.set(a,s,l)}else{var f=et(n.id,o,r.get(a,s),i.get(a,s)),d=f.data,p=f.optimistic;r.set(a,s,d),i.set(a,s,p)}}))}if(n.optimisticData.trash){var a=n.optimisticData.trash;a.forEach((function(t){var e=_(t,2),o=e[0],a=e[1],s=nt(n.id,r.get(o,a)).optimistic;r.delete(o,a),i.set(o,a,s)}))}return{data:r.toSource(),optimistic:i.toSource()}}if("TRANSPORTER_REQUEST_COMPLETED"===n.type||"TRANSPORTER_REQUEST_ERROR"===n.type){var s=new H(st(t.data)),u=new H(st(t.optimistic));if(n.optimisticData&&n.optimisticData.entities){var c=new H(n.data&&n.data.entities),l=new H(n.optimisticData.entities);l.forEach((function(t){var e=_(t,3),r=e[0],i=e[1],o=e[2];if(u.get(i,o)&&"CREATE"===u.get(i,o).type)s.delete(i,o),u.delete(i,o);else{var a=rt(n.id,r,c.get(i,o),s.get(i,o),u.get(i,o)),l=a.data,f=a.optimistic;s.set(i,o,l),f?u.set(i,o,f):u.delete(i,o)}}))}if(n.optimisticData&&n.optimisticData.trash){var f=n.data&&n.data.trash,d=n.optimisticData.trash;d.forEach((function(t){var e=_(t,2),r=e[0],i=e[1],o=it(n.id,f,[r,i],u.get(r,i)).data;o&&s.set(r,i,o),u.delete(r,i)}))}if(n.data&&n.data.entities){var p=new H(n.data.entities),h=new H(n.optimisticData&&n.optimisticData.entities);p.forEach((function(t){var e=_(t,3),n=e[0],r=e[1],i=e[2],o=s.get(r,i);o?(ot(n,h.get(r,i)).forEach((function(t){o[t]=n[t]})),s.set(r,i,o)):s.set(r,i,n)}))}if(n.data&&n.data.trash){var y=n.data.trash,v=n.optimisticData&&n.optimisticData.trash,m=at(y,v);m.forEach((function(t){var e=_(t,2),n=e[0],r=e[1];s.delete(n,r)}))}return{data:s.toSource(),optimistic:u.toSource()}}return t}}function ct(){var t=[];return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t,n=arguments.length>1?arguments[1]:void 0,r=j(e);if("TRANSPORTER_REQUEST_START"===n.type&&r.push({id:n.id,startTime:n.startTime,endTime:null,loading:!0,errors:null}),"TRANSPORTER_REQUEST_COMPLETED"===n.type){var i=r.findIndex((function(t){return t.id===n.id}));r[i]=v(v({},r[i]),{},{endTime:n.endTime,loading:!1})}if("TRANSPORTER_REQUEST_COMPLETED"===n.type){var o=r.findIndex((function(t){return t.id===n.id}));r[o]=v(v({},r[o]),{},{endTime:n.endTime,loading:!1,errors:n.errors})}return r}}function lt(){var t={lastReset:null};return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t,n=arguments.length>1?arguments[1]:void 0;return"TRANSPORTER_STORE_RESET"===n.type?{lastReset:n.lastReset}:e}}var ft=function(){function t(e){l(this,t),this.network=e.network,this.initialData=e.initialData}return d(t,[{key:"middleware",value:function(){var t=this;return function(){return function(e){return function(n){return"TRANSPORTER_QUERY"===n.type||"TRANSPORTER_MUTATION"===n.type?e(Z(n,t.network.fetch)):e(n)}}}}},{key:"reducer",value:function(){return function(t,n){return e.combineReducers({roots:(r=t,i={data:r,optimistic:null},function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,e=arguments.length>1?arguments[1]:void 0;if("TRANSPORTER_STORE_RESET"===e.type)return e.data&&e.data.roots?{data:e.data.roots,optimistic:null}:i;if("TRANSPORTER_REQUEST_START"===e.type&&e.optimisticData&&e.optimisticData.roots)return et(e.id,e.optimisticData.roots,t.data,t.optimistic);if("TRANSPORTER_REQUEST_COMPLETED"===e.type||"TRANSPORTER_REQUEST_ERROR"===e.type){var n=e.optimisticData&&e.optimisticData.roots?rt(e.id,e.optimisticData.roots,e.data&&e.data.roots,t.data,t.optimistic):{data:v({},t.data),optimistic:t.optimistic};if(e.data&&e.data.roots)ot(e.data.roots,e.optimisticData&&e.optimisticData.roots).forEach((function(t){n.data[t]=e.data.roots[t]}));return n}return t}),entities:ut(n),requests:ct(),info:lt()});var r,i}(this.initialData&&this.initialData.roots?this.initialData.roots:{},this.initialData&&this.initialData.entities?this.initialData.entities:{})}},{key:"getConfig",value:function(){return this.config}}]),t}(),dt=u.default.randomBytes,pt=function(){for(var t=dt(16),e="",n=0;n<16;++n)e+=t[n].toString(16);return e}(),ht=new RegExp('(\\\\)?"@__(F|R|D|M|S|A|U|I|B)-'+pt+'-(\\d+)__@"',"g"),yt=/\{\s*\[native code\]\s*\}/g,vt=/function.*?\(/,mt=/.*?=>.*?/,bt=/[<>\/\u2028\u2029]/g,gt=["*","async"],Et={"<":"\\u003C",">":"\\u003E","/":"\\u002F","\u2028":"\\u2028","\u2029":"\\u2029"};function St(t){return Et[t]}var wt=function t(e,n){n||(n={}),"number"!=typeof n&&"string"!=typeof n||(n={space:n});var r,i=[],o=[],a=[],s=[],u=[],c=[],l=[],f=[],d=[];return n.ignoreFunction&&"function"==typeof e&&(e=void 0),void 0===e?String(e):"string"!=typeof(r=n.isJSON&&!n.space?JSON.stringify(e):JSON.stringify(e,n.isJSON?null:function(t,e){if(n.ignoreFunction&&function(t){var e=[];for(var n in t)"function"==typeof t[n]&&e.push(n);for(var r=0;r<e.length;r++)delete t[e[r]]}(e),!e&&void 0!==e)return e;var r=this[t],p=typeof r;if("object"===p){if(r instanceof RegExp)return"@__R-"+pt+"-"+(o.push(r)-1)+"__@";if(r instanceof Date)return"@__D-"+pt+"-"+(a.push(r)-1)+"__@";if(r instanceof Map)return"@__M-"+pt+"-"+(s.push(r)-1)+"__@";if(r instanceof Set)return"@__S-"+pt+"-"+(u.push(r)-1)+"__@";if(r instanceof Array&&r.filter((function(){return!0})).length!==r.length)return"@__A-"+pt+"-"+(c.push(r)-1)+"__@"}return"function"===p?"@__F-"+pt+"-"+(i.push(r)-1)+"__@":"undefined"===p?"@__U-"+pt+"-"+(l.push(r)-1)+"__@":"number"!==p||isNaN(r)||isFinite(r)?"bigint"===p?"@__B-"+pt+"-"+(d.push(r)-1)+"__@":e:"@__I-"+pt+"-"+(f.push(r)-1)+"__@"},n.space))?String(r):(!0!==n.unsafe&&(r=r.replace(bt,St)),0===i.length&&0===o.length&&0===a.length&&0===s.length&&0===u.length&&0===c.length&&0===l.length&&0===f.length&&0===d.length?r:r.replace(ht,(function(e,r,l,p){return r?e:"D"===l?'new Date("'+a[p].toISOString()+'")':"R"===l?"new RegExp("+t(o[p].source)+', "'+o[p].flags+'")':"M"===l?"new Map("+t(Array.from(s[p].entries()),n)+")":"S"===l?"new Set("+t(Array.from(u[p].values()),n)+")":"A"===l?"Array.prototype.slice.call("+t(Object.assign({length:c[p].length},c[p]),n)+")":"U"===l?"undefined":"I"===l?f[p]:"B"===l?'BigInt("'+d[p]+'")':function(t){var e=t.toString();if(yt.test(e))throw new TypeError("Serializing native function: "+t.name);if(vt.test(e))return e;if(mt.test(e))return e;var n=e.indexOf("("),r=e.substr(0,n).trim().split(" ").filter((function(t){return t.length>0}));return r.filter((function(t){return-1===gt.indexOf(t)})).length>0?(r.indexOf("async")>-1?"async ":"")+"function"+(r.join("").indexOf("*")>-1?"*":"")+e.substr(n):e}(i[p])})))},Rt={componentWillUnmount:!1},Ot=Symbol.for("react.forward_ref"),kt=function(t,e){var n=[];return function(t,e,n){return new Promise((function(r,i){var o=t[Symbol.iterator](),a=0;!function t(n){var s=o.next();s.done?r(n):Promise.all([n,s.value]).then((function(n){t(e(n[0],n[1],a++))})).catch(i)}(n)}))}(t,(function(t,r,i){return Promise.resolve(e(r,i)).then((function(t){n.push(t)}))})).then((function(){return n}))},Tt=function t(e){return e&&"function"==typeof e.render?t(e.render()):e},_t=function(t){return t.props&&t.props.children?t.props.children:t.children?t.children:void 0},jt=function(t){return t.type||t.nodeName},Pt=function(t){return t.props||t.attributes},At=function(t){return!!jt(t)},Dt=function(t){return t.prototype&&(t.prototype.render||t.prototype.isReactComponent||t.prototype.isPureReactComponent)},Ct=function(t){return t.type&&t.type.$$typeof===Ot},xt=function(t){return!!t.getChildContext};var Nt=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Rt;return new Promise((function(i,o){var a=function(){try{return e.apply(void 0,arguments)}catch(t){o(t)}};(function t(e,n){if(Array.isArray(e))return Promise.all(e.map((function(e){return t(e,n)})));if(!e)return Promise.resolve();if("string"==typeof e||"number"==typeof e)return a(e,null,n),Promise.resolve();if(e.type&&(e.type._context&&(e.type._context._currentValue=e.props.value),e.type.Provider&&e.type.Consumer)){var i=e.props.children(e.type.Provider._context._currentValue);return t(i,n)}return At(e)?new Promise((function(i){var s=function(n,r,s,u){return Promise.resolve(a(e,r,s,u)).then((function(e){if(!1!==e){var r=n(),a=Tt(r);if(a)return Array.isArray(a)?kt(a,(function(e){return e?t(e,u):Promise.resolve()})).then(i,o).catch(o):t(a,u).then(i,o).catch(o)}})).catch(o)};if("function"==typeof jt(e)||Ct(e)){var u=jt(e),c=Object.assign({},u.defaultProps,Pt(e),{children:_t(e)});if(Ct(e))s((function(){return e.type.render(c)}),null,n,n).then(i);else if(Dt(u)){var l=new u(c,n);if(Object.defineProperty(l,"props",{value:l.props||c}),l.context=l.context||n,l.state=l.state||null,l.setState=function(t){"function"==typeof t&&(t=t(l.state,l.props,l.context)),l.state=Object.assign({},l.state,t)},u.getDerivedStateFromProps){var f=u.getDerivedStateFromProps(l.props,l.state);null!==f&&(l.state=Object.assign({},l.state,f))}else l.UNSAFE_componentWillMount?l.UNSAFE_componentWillMount():l.componentWillMount&&l.componentWillMount();var d=xt(l)?Object.assign({},n,l.getChildContext()):n;s((function(){return l.render(l.props,l.state)}),l,n,d).then((function(){r.componentWillUnmount&&l.componentWillUnmount&&l.componentWillUnmount()})).then(i)}else s((function(){return u(c,n)}),null,n,n).then(i)}else s((function(){return _t(e)}),null,n,n).then(i)})):e.containerInfo&&e.children&&e.children.props&&Array.isArray(e.children.props.children)?Promise.all(e.children.props.children.map((function(e){return t(e,n)}))):Promise.resolve()})(t,n).then(i,o)}))},Mt="undefined"!=typeof window,Ut=new(function(){function t(){l(this,t),p(this,"env",void 0),p(this,"phase",void 0),this.env=Mt?"browser":"node",this.phase="BOOTSTRAPPING",this.errors=Mt&&window.__ASYNC_DATA__?window.__ASYNC_DATA__.errors:{},this.ssr=!Mt||Mt&&window.__ASYNC_DATA__&&!!window.__ASYNC_DATA__.errors,this.ids={}}return d(t,[{key:"isSSREnabled",value:function(){return this.ssr}},{key:"generateId",value:function(t){var e=this.ids[t]?this.ids[t]+1:1;return this.ids[t]=e,e}},{key:"setPhaseToFirstRender",value:function(){this.phase="FIRST_RENDER",this.ids={}}},{key:"setPhaseToRender",value:function(){this.phase="RENDER",this.ids={}}},{key:"addError",value:function(t,e,n){this.errors[t]||(this.errors[t]={}),this.errors[t][e]=n}},{key:"getError",value:function(t,e){return this.errors[t]&&this.errors[t][e]&&0!==Object.keys(this.errors[t][e]).length?this.errors[t][e]:null}},{key:"getErrors",value:function(){return this.errors}},{key:"getEnv",value:function(){return this.env}},{key:"getPhase",value:function(){return this.phase}}]),t}());function Lt(t){var e={exports:{}};return t(e,e.exports),e.exports | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("react-dom"),require("graphql/utilities/valueFromASTUntyped")):"function"==typeof define&&define.amd?define(["exports","react","react-dom","graphql/utilities/valueFromASTUntyped"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["react-transporter"]={},t.React,t.reactDom,t.valueFromASTUntyped)}(this,(function(t,e,n,r){"use strict";function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=o(e);function a(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})})),e}function u(t){var e={exports:{}};return t(e,e.exports),e.exports | ||
/** @license React v16.13.1 | ||
* react-is.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/}var It="function"==typeof Symbol&&Symbol.for,qt=It?Symbol.for("react.element"):60103,Bt=It?Symbol.for("react.portal"):60106,Ft=It?Symbol.for("react.fragment"):60107,$t=It?Symbol.for("react.strict_mode"):60108,Qt=It?Symbol.for("react.profiler"):60114,Wt=It?Symbol.for("react.provider"):60109,Vt=It?Symbol.for("react.context"):60110,Jt=It?Symbol.for("react.async_mode"):60111,Yt=It?Symbol.for("react.concurrent_mode"):60111,Ht=It?Symbol.for("react.forward_ref"):60112,Gt=It?Symbol.for("react.suspense"):60113,zt=It?Symbol.for("react.suspense_list"):60120,Kt=It?Symbol.for("react.memo"):60115,Xt=It?Symbol.for("react.lazy"):60116,Zt=It?Symbol.for("react.block"):60121,te=It?Symbol.for("react.fundamental"):60117,ee=It?Symbol.for("react.responder"):60118,ne=It?Symbol.for("react.scope"):60119;function re(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case qt:switch(t=t.type){case Jt:case Yt:case Ft:case Qt:case $t:case Gt:return t;default:switch(t=t&&t.$$typeof){case Vt:case Ht:case Xt:case Kt:case Wt:return t;default:return e}}case Bt:return e}}}function ie(t){return re(t)===Yt}var oe={AsyncMode:Jt,ConcurrentMode:Yt,ContextConsumer:Vt,ContextProvider:Wt,Element:qt,ForwardRef:Ht,Fragment:Ft,Lazy:Xt,Memo:Kt,Portal:Bt,Profiler:Qt,StrictMode:$t,Suspense:Gt,isAsyncMode:function(t){return ie(t)||re(t)===Jt},isConcurrentMode:ie,isContextConsumer:function(t){return re(t)===Vt},isContextProvider:function(t){return re(t)===Wt},isElement:function(t){return"object"==typeof t&&null!==t&&t.$$typeof===qt},isForwardRef:function(t){return re(t)===Ht},isFragment:function(t){return re(t)===Ft},isLazy:function(t){return re(t)===Xt},isMemo:function(t){return re(t)===Kt},isPortal:function(t){return re(t)===Bt},isProfiler:function(t){return re(t)===Qt},isStrictMode:function(t){return re(t)===$t},isSuspense:function(t){return re(t)===Gt},isValidElementType:function(t){return"string"==typeof t||"function"==typeof t||t===Ft||t===Yt||t===Qt||t===$t||t===Gt||t===zt||"object"==typeof t&&null!==t&&(t.$$typeof===Xt||t.$$typeof===Kt||t.$$typeof===Wt||t.$$typeof===Vt||t.$$typeof===Ht||t.$$typeof===te||t.$$typeof===ee||t.$$typeof===ne||t.$$typeof===Zt)},typeOf:re}; | ||
* react-is.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/}var c="function"==typeof Symbol&&Symbol.for,s=c?Symbol.for("react.element"):60103,f=c?Symbol.for("react.portal"):60106,l=c?Symbol.for("react.fragment"):60107,p=c?Symbol.for("react.strict_mode"):60108,d=c?Symbol.for("react.profiler"):60114,y=c?Symbol.for("react.provider"):60109,v=c?Symbol.for("react.context"):60110,h=c?Symbol.for("react.async_mode"):60111,m=c?Symbol.for("react.concurrent_mode"):60111,b=c?Symbol.for("react.forward_ref"):60112,g=c?Symbol.for("react.suspense"):60113,E=c?Symbol.for("react.suspense_list"):60120,O=c?Symbol.for("react.memo"):60115,w=c?Symbol.for("react.lazy"):60116,S=c?Symbol.for("react.block"):60121,T=c?Symbol.for("react.fundamental"):60117,R=c?Symbol.for("react.responder"):60118,P=c?Symbol.for("react.scope"):60119;function j(t){if("object"==typeof t&&null!==t){var e=t.$$typeof;switch(e){case s:switch(t=t.type){case h:case m:case l:case d:case p:case g:return t;default:switch(t=t&&t.$$typeof){case v:case b:case w:case O:case y:return t;default:return e}}case f:return e}}}function k(t){return j(t)===m}var _={AsyncMode:h,ConcurrentMode:m,ContextConsumer:v,ContextProvider:y,Element:s,ForwardRef:b,Fragment:l,Lazy:w,Memo:O,Portal:f,Profiler:d,StrictMode:p,Suspense:g,isAsyncMode:function(t){return k(t)||j(t)===h},isConcurrentMode:k,isContextConsumer:function(t){return j(t)===v},isContextProvider:function(t){return j(t)===y},isElement:function(t){return"object"==typeof t&&null!==t&&t.$$typeof===s},isForwardRef:function(t){return j(t)===b},isFragment:function(t){return j(t)===l},isLazy:function(t){return j(t)===w},isMemo:function(t){return j(t)===O},isPortal:function(t){return j(t)===f},isProfiler:function(t){return j(t)===d},isStrictMode:function(t){return j(t)===p},isSuspense:function(t){return j(t)===g},isValidElementType:function(t){return"string"==typeof t||"function"==typeof t||t===l||t===m||t===d||t===p||t===g||t===E||"object"==typeof t&&null!==t&&(t.$$typeof===w||t.$$typeof===O||t.$$typeof===y||t.$$typeof===v||t.$$typeof===b||t.$$typeof===T||t.$$typeof===R||t.$$typeof===P||t.$$typeof===S)},typeOf:j}; | ||
/** @license React v16.13.1 | ||
* react-is.development.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
Lt((function(t,e){})),Lt((function(t){t.exports=oe})); | ||
* react-is.development.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
u((function(t,e){}));var C=u((function(t){t.exports=_})); | ||
/* | ||
object-assign | ||
(c) Sindre Sorhus | ||
@license MIT | ||
*/ | ||
Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;!function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()||Object.assign;function ae(){}function se(){}Function.call.bind(Object.prototype.hasOwnProperty),se.resetWarningCache=ae;var ue=Lt((function(t){t.exports=function(){function t(t,e,n,r,i,o){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==o){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:se,resetWarningCache:ae};return n.PropTypes=n,n}()}));function ce(t,e){var n={};return t?(Object.keys(t).forEach((function(r){n[r]=function(){return e(t[r].apply(t,arguments))}})),n):n}function le(t,e){var n={};return t?(Object.keys(t).forEach((function(r){n[r]=t[r](e)})),n):n}var fe=i.connect((function(t,e){return le(e.selectors,t)}),(function(t,e){return ce(e.actions,t)}),(function(t,e,n){return v(v(v({},n.props),t),e)})),de={disabled:!1,defer:!0,error:null,loading:null},pe=function(t){return t&&t.async?v(v({},de),t.async):de},he={store:ue.object,isInBoundary:ue.bool},ye={isInBoundary:ue.bool};var ve=function(t,e){if(t&&!e||!t&&e)return!1;if(t&&e){if(Object.keys(t).some((function(n){return t[n]!==e[n]})))return!1;if(Object.keys(e).some((function(n){return t[n]!==e[n]})))return!1}return!0};function me(t,e,n){switch(e){case"=":return t===n;case">":return t>n;case">=":return t>=n;case"<":return t<n;case"<=":return t<=n;default:throw new Q("Unknown operator '".concat(e,"'"))}}function be(t,e,n){var r=n.get(t,e);if(!r)throw new Q("Joined entity not found.",[t,e]);var i={__typename:t,id:e};return Object.keys(r).forEach((function(t){U(r[t])||(i[t]=r[t])})),i}function ge(t,e,n,r,i){var o=i.get(t,e);if(!o[n])throw new Q('Joined relation "'.concat(n,'" not found.'),[t,e]);if(!U(o[n]))throw new Q('Joined relation "'.concat(n,'" is not a connection.'),[t,e]);return null===o[n].link?null:we(o[n].link,r,i)}function Ee(t,e){var n=v({},t);return Object.entries(e).forEach((function(e){var r=_(e,2),i=r[0],o=r[1];n[o]=t[i]})),n}var Se=function(){function t(e,n){l(this,t),this.link=e,this.isManyLink=L(e),this.data=this.isManyLink?e.map((function(t){return be.apply(void 0,j(t).concat([n]))})):be.apply(void 0,j(e).concat([n])),this.entities=n,this.aliases={}}return d(t,[{key:"where",value:function(t,e,n){var r=n||e,i=n?e:"=";return this.isManyLink||me(this.data[t],i,r)||(this.data=null),this.isManyLink&&(this.data=this.data.filter((function(e){return me(e[t],i,r)}))),this}},{key:"alias",value:function(t){var e=x(t)?t:t[0];return this.aliases[M(t)]=e,this}},{key:"orderBy",value:function(){return this}},{key:"limit",value:function(){return this}},{key:"join",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=M(t),i=x(t)?t:t[0];if(this.isManyLink)this.link.forEach((function(t,o){var a=ge.apply(void 0,j(e.link[o]).concat([r,n,e.entities]));e.data[o][i]=a}));else{var o=ge.apply(void 0,j(this.link).concat([r,n,this.entities]));this.data[i]=o}return this}},{key:"getData",value:function(){var t=this;return this.aliases&&this.data?this.isManyLink?this.data.map((function(e){return Ee(e,t.aliases)})):Ee(this.data,this.aliases):this.data}}]),t}();function we(t,e,n){if(null===t)return null;var r=new Se(t,n);return(e?e(r):r).getData()}function Re(t,e){if(!t.arguments||0===t.arguments.length)return t.name.value;var n={};return t.arguments.forEach((function(t){n[t.name.value]=o.valueFromASTUntyped(t.value,e)})),[t.name.value,n]}function Oe(t,e){return function(n){return t.selections.forEach((function(t){if("Field"===t.kind){var r=Re(t,e.variables);t.selectionSet?n.join(r,Oe(t.selectionSet,e)):x(r)||n.alias(r)}})),n}}var ke=function(){function t(e){l(this,t),this.roots=e.roots.data,this.entities=new H(e.entities.data)}return d(t,[{key:"select",value:function(t,e){return e.entry?this.selectByFragmentAST(t,e):this.selectByOperationAST(t,e)}},{key:"selectByFragmentAST",value:function(t,e){var n=t.definitions.find((function(t){return"FragmentDefinition"===t.kind}));if(!n)throw new Q("Option entry is set, but no fragment node found.");return this.selectByEntity.apply(this,j(e.entry).concat([Oe(n.selectionSet,e)]))}},{key:"selectByOperationAST",value:function(t,e){var n=t.definitions.find((function(t){return"OperationDefinition"===t.kind}));if(!n)throw new Q("No operation node found.");var r=n.selectionSet.selections[0];return this.selectByRoot(Re(r,e.variables),Oe(r.selectionSet,e))}},{key:"selectByEntity",value:function(t,e,n){if(!this.entities.get(t,e))throw new Q("Selected entity not found.",[t,e]);return we([t,e],n,this.entities)}},{key:"selectByRoot",value:function(t,e){var n=M(t);if(!this.roots[n])throw new Q("Selected root '".concat(n,"' not found."),"root");return we(this.roots[n].link,e,this.entities)}},{key:"selectByRelation",value:function(t,e,n,r){var i=M(n),o=this.entities.get(t,e);if(!o||!o[i])throw new Q("Selected relation '".concat(i,"' not found."),[t,e]);return we(o[i].link,r,this.entities)}}]),t}();function Te(t){return function(e,n){return t(new ke(e.transporter),n)}}t.Link=I,t.ManyLink=$,t.TransporterClient=ft,t.TransporterNetwork=function t(e){var n=this;l(this,t),p(this,"fetch",(function(t,e){return n.request(t,e)})),this.request=e},t.bootstrapper=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=function(t,e){if(e&&"function"==typeof e.bootstrap)return e.bootstrap()};Nt(t,r,n).then((function(){if(Ut.setPhaseToFirstRender(),"node"===Ut.getEnv()){var t={errors:Ut.getErrors()};e({getScriptTag:function(){return'<script charset="UTF-8">window.__ASYNC_DATA__='.concat(wt(t),";<\/script>")},getScriptElement:function(){return s.default.createElement("script",{dangerouslySetInnerHTML:{__html:t}})}})}else e();Ut.setPhaseToRender()})).catch((function(t){return console.error(t)}))},t.createAsyncContainer=function(t,n,r){var i={middleware:r&&r.middleware||null,async:pe(r)},o=function(t){var e=n(t);return v(v({},e),{},{loaders:e.loaders||{}})},a=t.name&&t.bundle,u=t.displayName||t.name||"Component",f=function(e){m(r,e);var n=T(r);function r(e,s){var c;l(this,r),c=n.call(this,e,s);var f=o(c.props),d=c.isPreload();s.isInBoundary&&!i.async.defer&&console.warn('Option "defer" is set to false inside a boundary.'),c.phase=Ut.getPhase(),c.hasUnmounted=!1,d&&(c.containerName="".concat(u,"-").concat(Ut.generateId(u)));var p={startTime:d?null:C(),endTime:null},h=a?{bundle:v(v({},p),{},{loading:d||a?"block":null,error:d?Ut.getError(c.containerName,"bundle"):null})}:{};return Object.keys(f.loaders).forEach((function(t){h[t]=v(v({},p),{},{loading:d?null:"block",error:d?Ut.getError(c.containerName,t):null})})),c.state={loaders:h},c.component={Component:a?null:t,isConnected:!1},c.cache={},c.handleLoad=c.handleLoad.bind(O(c)),c}return d(r,[{key:"getChildContext",value:function(){return{isInBoundary:i.async.boundary}}},{key:"bootstrap",value:function(){var e=this,n=o(this.props),r=this.isPreload();if(!r)return!1;var s=[];return"node"===Ut.getEnv()&&Object.keys(n.loaders).forEach((function(t){var i=n.loaders[t],o=e.getCacheProvider();i.request({load:function(n){s.push(e.handleLoad(t,n,r))},cache:o},e.context.store.dispatch)})),a&&s.push(this.handleLoad("bundle",t.bundle(),r)),Promise.all(s).then((function(){return!i.async.boundary}))}},{key:"componentDidMount",value:function(){var e=this,n=o(this.props);this.isPreload()||(Object.keys(n.loaders).forEach((function(t){var r=n.loaders[t],i=e.getCacheProvider();r.request({load:function(n){return e.handleLoad(t,n,!1)},cache:i},e.context.store.dispatch)})),a&&!this.component.Component&&this.handleLoad("bundle",t.bundle(),!1))}},{key:"componentWillReceiveProps",value:function(t,e){var n=this,r=o(t);Object.keys(r.loaders).forEach((function(i){var o=r.loaders[i];if(o.shouldReload&&!n.state.loaders[i].loading&&o.shouldReload({info:n.state.loaders[i],cache:n.getCacheProvider()},t,e.store.getState())){n.setRequestState(i,"block",null);var a=n.getCacheProvider();o.request({load:function(t,e){return n.handleLoad(i,t,!1,e)},cache:a},n.context.store.dispatch)}}))}},{key:"componentWillUnmount",value:function(){this.hasUnmounted=!0}},{key:"handleLoad",value:function(t,e,n){var r=this;return e.then((function(e){"bundle"===t&&(r.component.Component=function(t){return null==t||"function"!=typeof t&&"object"!==c(t)||!t.default?t:t.default}(e)),n||r.hasUnmounted||r.setRequestState(t,null,null)})).catch((function(e){n?(Ut.addError(r.containerName,t,e),r.state.loaders[t].error=e):r.hasUnmounted||r.setRequestState(t,null,e)}))}},{key:"getCacheProvider",value:function(){var t=this;return{get:function(e){return t.cache[e]},set:function(e,n){t.cache[e]=n}}}},{key:"setRequestState",value:function(t,e,n){var r=C();this.setState((function(i){return{loaders:v(v({},i.loaders),{},p({},t,{startTime:e?r:i.loaders[t].startTime,endTime:e?i.loaders[t].endTime:r,loading:e,error:void 0===n?i.loaders[t].error:n}))}}))}},{key:"isPreload",value:function(){return!(!Ut.isSSREnabled()||this.context.isInBoundary||i.async.defer)&&("BOOTSTRAPPING"===this.phase||"FIRST_RENDER"===this.phase)}},{key:"render",value:function(){var t=this,e=o(this.props),n={};if(Object.keys(e.loaders).forEach((function(r){var i=e.loaders[r];if(i.props){var o=t.getCacheProvider();n[r]=v(v({},t.state.loaders[r]),i.props({load:function(e,n){t.state.loaders[r].loading?console.error("Resource ".concat(u," ").concat(r," is already loading.")):(t.setRequestState(r,n&&n.showWhileLoading?"show":"block"),t.handleLoad(r,e,!1))},cache:o},t.context.store.dispatch))}})),Object.values(this.state.loaders).some((function(t){return"block"===t.loading}))){if(!i.async.loading)return null;var r=i.async.loading;return s.default.createElement(r,h({},n,this.props))}if(Object.values(this.state.loaders).some((function(t){return null!==t.error}))){if(!i.async.error)return null;var a=i.async.error;return s.default.createElement(a,h({},n,this.props))}var c=v(v({},n),this.props);if(e.selectors||e.actions){this.component.isConnected||(this.component.Component=fe(this.component.Component),this.component.isConnected=!0);var l=this.component.Component;return s.default.createElement(l,{selectors:e.selectors,actions:e.actions,props:c})}var f=this.component.Component;return s.default.createElement(f,c)}}]),r}(s.default.Component);return f.displayName="Load(".concat(u,")"),f.contextTypes=he,f.childContextTypes=ye,i.middleware?e.compose.apply(void 0,j(i.middleware))(f):f},t.createContainer=function(t,n,r){var o={middleware:r&&r.middleware||null},a=i.connect((function(t,e){return le(n(e).selectors,t)}),(function(t,e){return ce(n(e).actions,t)}));return o.middleware?e.compose.apply(void 0,j(o.middleware).concat([a]))(t):a(t)},t.createMutation=function(t,e){return v({type:"TRANSPORTER_MUTATION",mutation:t},e)},t.createQuery=D,t.onError=function(t){K=t},t.query=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.loaderOptions,r=R(e,["loaderOptions"]);return{request:function(e,i){var o=e.load;return e.cache.set("variables",r.variables),n&&n.skip?o(new Promise((function(t){return t()}))):o(i(D(t,r)))},props:function(e,n){var i=e.load,o=e.cache;return{refetch:function(){o.set("variables",r.variables);for(var e=arguments.length,a=new Array(e),s=0;s<e;s++)a[s]=arguments[s];return i(n(D(t,v(v({},r),a))))},fetchMore:function(){o.set("variables",r.variables);for(var e=arguments.length,a=new Array(e),s=0;s<e;s++)a[s]=arguments[s];return i(n(D(t,v(v({},r),a)),{showWhileLoading:!0}))},startPolling:function(e){var a=setInterval((function(){i(n(D(t,r),{showWhileLoading:!0}))}),e);o.set("timeout",a)},endPolling:function(){clearInterval(o.get("timeout")),o.set("timeout",null)}}},shouldReload:function(t,e,n){var i=t.info,o=t.cache,a=o.get("variables");return o.set("variables",r.variables),i.startTime<n.transporter.info.lastReset||!ve(a,r.variables)}}},t.resetStore=function(t){return{type:"TRANSPORTER_STORE_RESET",data:t,lastReset:C()}},t.select=function(t,e){return Te((function(n){return n.select(t,e||{})}))},t.selectAdvanced=Te,t.selectByEntity=function(t,e,n){return Te((function(r){return r.selectByEntity(t,e,n)}))},t.selectByRelation=function(t,e,n,r){return Te((function(i){return i.selectByRelation(t,e,n,r)}))},t.selectByRoot=function(t,e){return Te((function(n){return n.selectByRoot(t,e)}))},Object.defineProperty(t,"__esModule",{value:!0})})); | ||
object-assign | ||
(c) Sindre Sorhus | ||
@license MIT | ||
*/Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;!function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()||Object.assign;function D(){}function N(){}Function.call.bind(Object.prototype.hasOwnProperty),N.resetWarningCache=D;u((function(t){t.exports=function(){function t(t,e,n,r,o,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var a=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw a.name="Invariant Violation",a}}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:N,resetWarningCache:D};return n.PropTypes=n,n}()}));var A=i.default.createContext(null);var M=function(t){t()},x=function(){return M};var q={notify:function(){},get:function(){return[]}};function U(t,e){var n,r=q;function o(){a.onStateChange&&a.onStateChange()}function i(){n||(n=e?e.addNestedSub(o):t.subscribe(o),r=function(){var t=x(),e=null,n=null;return{clear:function(){e=null,n=null},notify:function(){t((function(){for(var t=e;t;)t.callback(),t=t.next}))},get:function(){for(var t=[],n=e;n;)t.push(n),n=n.next;return t},subscribe:function(t){var r=!0,o=n={callback:t,next:null,prev:n};return o.prev?o.prev.next=o:e=o,function(){r&&null!==e&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}())}var a={addNestedSub:function(t){return i(),r.subscribe(t)},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:o,isSubscribed:function(){return Boolean(n)},trySubscribe:i,tryUnsubscribe:function(){n&&(n(),n=void 0,r.clear(),r=q)},getListeners:function(){return r}};return a}var L="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e.useLayoutEffect:e.useEffect;function I(t){var n=t.store,r=t.context,o=t.children,a=e.useMemo((function(){var t=U(n);return t.onStateChange=t.notifyNestedSubs,{store:n,subscription:t}}),[n]),u=e.useMemo((function(){return n.getState()}),[n]);L((function(){var t=a.subscription;return t.trySubscribe(),u!==n.getState()&&t.notifyNestedSubs(),function(){t.tryUnsubscribe(),t.onStateChange=null}}),[a,u]);var c=r||A;return i.default.createElement(c.Provider,{value:a},o)}function $(){return($=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function B(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}var F={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},Q={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},W={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},V={};function H(t){return C.isMemo(t)?W:V[t.$$typeof]||F}V[C.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},V[C.Memo]=W;var J=Object.defineProperty,K=Object.getOwnPropertyNames,z=Object.getOwnPropertySymbols,X=Object.getOwnPropertyDescriptor,Y=Object.getPrototypeOf,G=Object.prototype;var Z=function t(e,n,r){if("string"!=typeof n){if(G){var o=Y(n);o&&o!==G&&t(e,o,r)}var i=K(n);z&&(i=i.concat(z(n)));for(var a=H(e),u=H(n),c=0;c<i.length;++c){var s=i[c];if(!(Q[s]||r&&r[s]||u&&u[s]||a&&a[s])){var f=X(n,s);try{J(e,s,f)}catch(t){}}}}return e},tt=["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef","forwardRef","context"],et=["reactReduxForwardedRef"],nt=[],rt=[null,null];function ot(t,e){var n=t[1];return[e.payload,n+1]}function it(t,e,n){L((function(){return t.apply(void 0,e)}),n)}function at(t,e,n,r,o,i,a){t.current=r,e.current=o,n.current=!1,i.current&&(i.current=null,a())}function ut(t,e,n,r,o,i,a,u,c,s){if(t){var f=!1,l=null,p=function(){if(!f){var t,n,p=e.getState();try{t=r(p,o.current)}catch(t){n=t,l=t}n||(l=null),t===i.current?a.current||c():(i.current=t,u.current=t,a.current=!0,s({type:"STORE_UPDATED",payload:{error:n}}))}};n.onStateChange=p,n.trySubscribe(),p();return function(){if(f=!0,n.tryUnsubscribe(),n.onStateChange=null,l)throw l}}}var ct=function(){return[null,0]};function st(t,n){void 0===n&&(n={});var r=n,o=r.getDisplayName,a=void 0===o?function(t){return"ConnectAdvanced("+t+")"}:o,u=r.methodName,c=void 0===u?"connectAdvanced":u,s=r.renderCountProp,f=void 0===s?void 0:s,l=r.shouldHandleStateChanges,p=void 0===l||l,d=r.storeKey,y=void 0===d?"store":d;r.withRef;var v=r.forwardRef,h=void 0!==v&&v,m=r.context,b=void 0===m?A:m,g=B(r,tt),E=b;return function(n){var r=n.displayName||n.name||"Component",o=a(r),u=$({},g,{getDisplayName:a,methodName:c,renderCountProp:f,shouldHandleStateChanges:p,storeKey:y,displayName:o,wrappedComponentName:r,WrappedComponent:n}),s=g.pure;var l=s?e.useMemo:function(t){return t()};function d(r){var o=e.useMemo((function(){var t=r.reactReduxForwardedRef,e=B(r,et);return[r.context,t,e]}),[r]),a=o[0],c=o[1],s=o[2],f=e.useMemo((function(){return a&&a.Consumer&&C.isContextConsumer(i.default.createElement(a.Consumer,null))?a:E}),[a,E]),d=e.useContext(f),y=Boolean(r.store)&&Boolean(r.store.getState)&&Boolean(r.store.dispatch);Boolean(d)&&Boolean(d.store);var v=y?r.store:d.store,h=e.useMemo((function(){return function(e){return t(e.dispatch,u)}(v)}),[v]),m=e.useMemo((function(){if(!p)return rt;var t=U(v,y?null:d.subscription),e=t.notifyNestedSubs.bind(t);return[t,e]}),[v,y,d]),b=m[0],g=m[1],O=e.useMemo((function(){return y?d:$({},d,{subscription:b})}),[y,d,b]),w=e.useReducer(ot,nt,ct),S=w[0][0],T=w[1];if(S&&S.error)throw S.error;var R=e.useRef(),P=e.useRef(s),j=e.useRef(),k=e.useRef(!1),_=l((function(){return j.current&&s===P.current?j.current:h(v.getState(),s)}),[v,S,s]);it(at,[P,R,k,s,_,j,g]),it(ut,[p,v,b,h,P,R,k,j,g,T],[v,b,h]);var D=e.useMemo((function(){return i.default.createElement(n,$({},_,{ref:c}))}),[c,n,_]);return e.useMemo((function(){return p?i.default.createElement(f.Provider,{value:O},D):D}),[f,D,O])}var v=s?i.default.memo(d):d;if(v.WrappedComponent=n,v.displayName=d.displayName=o,h){var m=i.default.forwardRef((function(t,e){return i.default.createElement(v,$({},t,{reactReduxForwardedRef:e}))}));return m.displayName=o,m.WrappedComponent=n,Z(m,n)}return Z(v,n)}}function ft(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function lt(t,e){if(ft(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!Object.prototype.hasOwnProperty.call(e,n[o])||!ft(t[n[o]],e[n[o]]))return!1;return!0}function pt(t){return function(e,n){var r=t(e,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function dt(t){return null!==t.dependsOnOwnProps&&void 0!==t.dependsOnOwnProps?Boolean(t.dependsOnOwnProps):1!==t.length}function yt(t,e){return function(e,n){n.displayName;var r=function(t,e){return r.dependsOnOwnProps?r.mapToProps(t,e):r.mapToProps(t)};return r.dependsOnOwnProps=!0,r.mapToProps=function(e,n){r.mapToProps=t,r.dependsOnOwnProps=dt(t);var o=r(e,n);return"function"==typeof o&&(r.mapToProps=o,r.dependsOnOwnProps=dt(o),o=r(e,n)),o},r}}var vt=[function(t){return"function"==typeof t?yt(t):void 0},function(t){return t?void 0:pt((function(t){return{dispatch:t}}))},function(t){return t&&"object"==typeof t?pt((function(e){return function(t,e){var n={},r=function(r){var o=t[r];"function"==typeof o&&(n[r]=function(){return e(o.apply(void 0,arguments))})};for(var o in t)r(o);return n}(t,e)})):void 0}];var ht=[function(t){return"function"==typeof t?yt(t):void 0},function(t){return t?void 0:pt((function(){return{}}))}];function mt(t,e,n){return $({},n,t,e)}var bt=[function(t){return"function"==typeof t?function(t){return function(e,n){n.displayName;var r,o=n.pure,i=n.areMergedPropsEqual,a=!1;return function(e,n,u){var c=t(e,n,u);return a?o&&i(c,r)||(r=c):(a=!0,r=c),r}}}(t):void 0},function(t){return t?void 0:function(){return mt}}],gt=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function Et(t,e,n,r){return function(o,i){return n(t(o,i),e(r,i),i)}}function Ot(t,e,n,r,o){var i,a,u,c,s,f=o.areStatesEqual,l=o.areOwnPropsEqual,p=o.areStatePropsEqual,d=!1;function y(o,d){var y,v,h=!l(d,a),m=!f(o,i);return i=o,a=d,h&&m?(u=t(i,a),e.dependsOnOwnProps&&(c=e(r,a)),s=n(u,c,a)):h?(t.dependsOnOwnProps&&(u=t(i,a)),e.dependsOnOwnProps&&(c=e(r,a)),s=n(u,c,a)):m?(y=t(i,a),v=!p(y,u),u=y,v&&(s=n(u,c,a)),s):s}return function(o,f){return d?y(o,f):(u=t(i=o,a=f),c=e(r,a),s=n(u,c,a),d=!0,s)}}function wt(t,e){var n=e.initMapStateToProps,r=e.initMapDispatchToProps,o=e.initMergeProps,i=B(e,gt),a=n(t,i),u=r(t,i),c=o(t,i);return(i.pure?Ot:Et)(a,u,c,t,i)}var St=["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"];function Tt(t,e,n){for(var r=e.length-1;r>=0;r--){var o=e[r](t);if(o)return o}return function(e,r){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function Rt(t,e){return t===e}function Pt(t){var e=void 0===t?{}:t,n=e.connectHOC,r=void 0===n?st:n,o=e.mapStateToPropsFactories,i=void 0===o?ht:o,a=e.mapDispatchToPropsFactories,u=void 0===a?vt:a,c=e.mergePropsFactories,s=void 0===c?bt:c,f=e.selectorFactory,l=void 0===f?wt:f;return function(t,e,n,o){void 0===o&&(o={});var a=o,c=a.pure,f=void 0===c||c,p=a.areStatesEqual,d=void 0===p?Rt:p,y=a.areOwnPropsEqual,v=void 0===y?lt:y,h=a.areStatePropsEqual,m=void 0===h?lt:h,b=a.areMergedPropsEqual,g=void 0===b?lt:b,E=B(a,St),O=Tt(t,i,"mapStateToProps"),w=Tt(e,u,"mapDispatchToProps"),S=Tt(n,s,"mergeProps");return r(l,$({methodName:"connect",getDisplayName:function(t){return"Connect("+t+")"},shouldHandleStateChanges:Boolean(t),initMapStateToProps:O,initMapDispatchToProps:w,initMergeProps:S,pure:f,areStatesEqual:d,areOwnPropsEqual:v,areStatePropsEqual:m,areMergedPropsEqual:g},E))}}var jt=Pt();function kt(){return e.useContext(A)}function _t(t){void 0===t&&(t=A);var n=t===A?kt:function(){return e.useContext(t)};return function(){return n().store}}var Ct=_t();function Dt(t){void 0===t&&(t=A);var e=t===A?Ct:_t(t);return function(){return e().dispatch}}var Nt,At=Dt();function Mt(t){return(Mt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function xt(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function qt(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Ut(t,e,n){return e&&qt(t.prototype,e),n&&qt(t,n),t}function Lt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function It(){return(It=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function $t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Bt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?$t(Object(n),!0).forEach((function(e){Lt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$t(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ft(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&Wt(t,e)}function Qt(t){return(Qt=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function Wt(t,e){return(Wt=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function Vt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Ht(t,e,n){return(Ht=Vt()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&Wt(o,n.prototype),o}).apply(null,arguments)}function Jt(t){var e="function"==typeof Map?new Map:void 0;return(Jt=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return Ht(t,arguments,Qt(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Wt(r,t)})(t)}function Kt(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function zt(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function Xt(t){var e=Vt();return function(){var n,r=Qt(t);if(e){var o=Qt(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return zt(this,n)}}function Yt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(t,e)||Zt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gt(t){return function(t){if(Array.isArray(t))return te(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||Zt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zt(t,e){if(t){if("string"==typeof t)return te(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(t,e):void 0}}function te(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function ee(t,e){return Bt({type:"TRANSPORTER_QUERY",query:t},e)}function ne(){return(new Date).getTime()}function re(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function oe(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ie(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?oe(Object(n),!0).forEach((function(e){re(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ae(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}Nt=n.unstable_batchedUpdates,M=Nt;var ue="function"==typeof Symbol&&Symbol.observable||"@@observable",ce=function(){return Math.random().toString(36).substring(7).split("").join(".")},se={INIT:"@@redux/INIT"+ce(),REPLACE:"@@redux/REPLACE"+ce(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ce()}};function fe(t){if("object"!=typeof t||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function le(t,e,n){var r;if("function"==typeof e&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(ae(0));if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error(ae(1));return n(le)(t,e)}if("function"!=typeof t)throw new Error(ae(2));var o=t,i=e,a=[],u=a,c=!1;function s(){u===a&&(u=a.slice())}function f(){if(c)throw new Error(ae(3));return i}function l(t){if("function"!=typeof t)throw new Error(ae(4));if(c)throw new Error(ae(5));var e=!0;return s(),u.push(t),function(){if(e){if(c)throw new Error(ae(6));e=!1,s();var n=u.indexOf(t);u.splice(n,1),a=null}}}function p(t){if(!fe(t))throw new Error(ae(7));if(void 0===t.type)throw new Error(ae(8));if(c)throw new Error(ae(9));try{c=!0,i=o(i,t)}finally{c=!1}for(var e=a=u,n=0;n<e.length;n++){(0,e[n])()}return t}function d(t){if("function"!=typeof t)throw new Error(ae(10));o=t,p({type:se.REPLACE})}function y(){var t,e=l;return(t={subscribe:function(t){if("object"!=typeof t||null===t)throw new Error(ae(11));function n(){t.next&&t.next(f())}return n(),{unsubscribe:e(n)}}})[ue]=function(){return this},t}return p({type:se.INIT}),(r={dispatch:p,subscribe:l,getState:f,replaceReducer:d})[ue]=y,r}function pe(t){for(var e=Object.keys(t),n={},r=0;r<e.length;r++){var o=e[r];"function"==typeof t[o]&&(n[o]=t[o])}var i,a=Object.keys(n);try{!function(t){Object.keys(t).forEach((function(e){var n=t[e];if(void 0===n(void 0,{type:se.INIT}))throw new Error(ae(12));if(void 0===n(void 0,{type:se.PROBE_UNKNOWN_ACTION()}))throw new Error(ae(13))}))}(n)}catch(t){i=t}return function(t,e){if(void 0===t&&(t={}),i)throw i;for(var r=!1,o={},u=0;u<a.length;u++){var c=a[u],s=n[c],f=t[c],l=s(f,e);if(void 0===l)throw e&&e.type,new Error(ae(14));o[c]=l,r=r||l!==f}return(r=r||a.length!==Object.keys(t).length)?o:t}}function de(t,e){return function(){return e(t.apply(this,arguments))}}function ye(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce((function(t,e){return function(){return t(e.apply(void 0,arguments))}}))}function ve(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return function(t){return function(){var n=t.apply(void 0,arguments),r=function(){throw new Error(ae(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=e.map((function(t){return t(o)}));return r=ye.apply(void 0,i)(n.dispatch),ie(ie({},n),{},{dispatch:r})}}}var he=Object.freeze({__proto__:null,__DO_NOT_USE__ActionTypes:se,applyMiddleware:ve,bindActionCreators:function(t,e){if("function"==typeof t)return de(t,e);if("object"!=typeof t||null===t)throw new Error(ae(16));var n={};for(var r in t){var o=t[r];"function"==typeof o&&(n[r]=de(o,e))}return n},combineReducers:pe,compose:ye,createStore:le});function me(t,e){var n={};return t?(Object.keys(t).forEach((function(r){n[r]=function(){return e(t[r].apply(t,arguments))}})),n):n}function be(t,e){var n={};return t?(Object.keys(t).forEach((function(r){n[r]=t[r](e)})),n):n}var ge=jt((function(t,e){return be(e.selectors,t)}),(function(t,e){return me(e.actions,t)}),(function(t,e,n){return Bt(Bt(Bt({},n.props),t),e)}));var Ee={disabled:!1,defer:!0,error:null,loading:null},Oe=function(t){return t&&t.async?Bt(Bt({},Ee),t.async):Ee};var we=function(t,e){if(t&&!e||!t&&e)return!1;if(t&&e){if(Object.keys(t).some((function(n){return t[n]!==e[n]})))return!1;if(Object.keys(e).some((function(n){return t[n]!==e[n]})))return!1}return!0};function Se(t){return"string"==typeof t||t instanceof String}var Te=function t(e){var n=Object.keys(e);n.sort();var r=n.map((function(n){var r=function(e){return null===e?null:"object"===Mt(e)?t(e):JSON.stringify(e)}(e[n]);return null===r?r:'"'.concat(n,'":').concat(r)})).filter((function(t){return null!==t}));return 0===r.length?null:"{".concat(r.join(","),"}")};function Re(t){if(Se(t))return t;var e=Te(t[1]);return"".concat(t[0]).concat(e?"(".concat(e,")"):"")}function Pe(t){return!!t&&(Object.prototype.hasOwnProperty.call(t,"link")&&"function"!=typeof t.link)}function je(t){return!(null===t||Se(t[0]))}var ke=function(){function t(e,n){xt(this,t),e?Pe(e)?(this.meta=e.meta,this.link=e.link):this.link=[e,n]:this.link=null}return Ut(t,[{key:"setMeta",value:function(t){return this.meta="function"==typeof t?t(this.meta):t,this}},{key:"toSource",value:function(){return{link:this.link,meta:this.meta}}}]),t}();function _e(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ce(t,e){return Pe(t)?je(t.link)?t.link:[t.link]:Se(t)?Se(e)?[[t,e]]:e.map((function(e){return[t,e]})):t}function De(t,e){return t.filter((function(t){return!e.some((function(e){return _e(t,e)}))}))}var Ne=function(){function t(e,n){xt(this,t),e?(Pe(e)&&(this.meta=e.meta),this.link=Ce(e,n)):this.link=[]}return Ut(t,[{key:"prepend",value:function(t,e){var n=Ce(t,e);return this.link=[].concat(Gt(n),Gt(this.link)),this}},{key:"append",value:function(t,e){var n=Ce(t,e);return this.link=[].concat(Gt(this.link),Gt(n)),this}},{key:"syncPrepend",value:function(t,e){var n=Ce(t,e),r=De(this.link,n);return this.link=[].concat(Gt(n),Gt(r)),this}},{key:"syncAppend",value:function(t,e){var n=Ce(t,e),r=De(this.link,n);return this.link=[].concat(Gt(r),Gt(n)),this}},{key:"detach",value:function(t,e){var n=Ce(t,e);return this.link=null===n?[]:De(this.link,n),this}},{key:"setMeta",value:function(t){return this.meta="function"==typeof t?t(this.meta):t,this}},{key:"toSource",value:function(){return{link:this.link,meta:this.meta}}}]),t}(),Ae=function(t){Ft(n,t);var e=Xt(n);function n(t,r){var o;return xt(this,n),(o=Se(r)?e.call(this,"".concat(t," [").concat(r,"]")):r?e.call(this,"".concat(t," [").concat(r[0],", ").concat(r[1],"]")):e.call(this,t)).name="StoreError",console.error("StoreError: ".concat(o.message)),zt(o)}return n}(Jt(Error));function Me(t,e,n,r){var o=function(t,e,n,r){return void 0!==e[t]?e[t]:r&&"UPDATE"===r.type&&void 0!==r.data[t]?r.data[t].originalValue:n[t]}(t,e,n,r);return Pe(o)?je(o.link)?new Ne(o):new ke(o):o}function xe(t,e,n){var r,o="function"==typeof n?n(e):n;return Pe(o)?o.toSource():(r=o,"[object Date]"===Object.prototype.toString.call(r)?o.toISOString():o)}function qe(t,e,n,r){if(void 0!==e){if(Pe(e)&&!Pe(n)){var o='Cannot set field "'.concat(t,'", because it needs a scalar value, not a connection.');throw new Ae(o,r)}if(!Pe(e)&&Pe(n)){var i='Cannot set field "'.concat(t,'", because it needs a connection, not a scalar value.');throw new Ae(i,r)}if(Pe(e)&&Pe(n)){if(je(e.link)&&!je(n.link)){var a='Cannot set field "'.concat(t,'", because it is of type ManyLink, not Link.');throw new Ae(a,r)}if(!je(e.link)&&je(n.link)){var u='Cannot set field "'.concat(t,'", because it is of type Link, not ManyLink.');throw new Ae(u,r)}}}}var Ue=function(){function t(e,n,r,o){xt(this,t),this.type=e,this.id=n,this.originalData=r||{},this.data={},this.optimistic=o}return Ut(t,[{key:"get",value:function(t){if(void 0===this.data[t]&&void 0===this.originalData[t]){var e='Cannot get field "'.concat(t,'", because it does not exist.');throw new Ae(e,[this.type,this.id])}return Me(t,this.data[t],this.originalData[t],this.optimistic)}},{key:"setDistinct",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;this.set(t,e)}},{key:"set",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=Re(t),r=Me(n,this.data,this.originalData,this.optimistic),o=xe(0,r,e);qe(n,r,o,[this.type,this.id]),this.data[n]=o}},{key:"fill",value:function(t){var e=this;Object.keys(t).forEach((function(n){e.set(n,t[n])}))}}]),t}(),Le=function(){function t(e){xt(this,t),this.obj=e||{}}return Ut(t,[{key:"forEach",value:function(t){var e=this;Object.keys(this.obj).forEach((function(n){Object.keys(e.obj[n]).forEach((function(r){t([e.obj[n][r],n,r])}))}))}},{key:"get",value:function(t,e){if(this.obj[t]&&this.obj[t][e])return this.obj[t][e]}},{key:"set",value:function(t,e,n){this.obj[t]||(this.obj[t]={}),this.obj[t][e]=n}},{key:"delete",value:function(t,e){if(!this.obj[t]||!this.obj[t][e])throw new Error("Cannot delete entity [".concat(t,", ").concat(e,"], because entity does not exist."));delete this.obj[t][e],0===Object.keys(this.obj[t]).length&&delete this.obj[t]}},{key:"toSource",value:function(){return this.obj}}]),t}();var Ie=function(){function t(e,n){xt(this,t),this.data={entities:new Le(e.entities.data),roots:e.roots.data},this.optimistic={entities:new Le(e.entities.optimistic),roots:e.roots.optimistic},this.response={entities:new Le(n&&n.entities),roots:n&&n.roots||{},trash:[]}}return Ut(t,[{key:"insert",value:function(t,e,n){!function(t,e,n){if(t)throw new Ae("Cannot insert entity, because entity already exists.",n);if(e&&"DELETE"===e.type)throw new Ae("Cannot perform insert on optimistically deleted entity.",n)}(this.data.entities.get(t,e),this.optimistic.entities.get(t,e),[t,e]);var r=new Ue(t,e);n(r),this.response.entities.set(t,e,r.data)}},{key:"update",value:function(t,e,n){var r=this.data.entities.get(t,e),o=this.optimistic.entities.get(t,e);!function(t,e,n){if(!t){var r=e&&"DELETE"===e.type?"Cannot perform update on optimistically deleted entity.":"Cannot update entity, because entity does not exist.";throw new Ae(r,n)}if(e&&"CREATE"===e.type)throw new Ae("Cannot perform update on optimistically created entity.",n)}(r,o,[t,e]);var i=new Ue(t,e,r,o);n(i);var a=this.response.entities.get(t,e),u=a?Bt(Bt({},a),i.data):i.data;this.response.entities.set(t,e,u)}},{key:"delete",value:function(t,e){!function(t,e,n){if(!t){var r=e&&"DELETE"===e.type?"Cannot perform delete on optimistically deleted entity.":"Cannot delete entity, because entity does not exist.";throw new Ae(r,n)}if(e&&"CREATE"===e.type)throw new Ae("Cannot perform delete on optimistically created entity.",n)}(this.data.entities.get(t,e),this.optimistic.entities.get(t,e),[t,e]),this.response.trash.push([t,e])}},{key:"setRoot",value:function(t,e){var n=Re(t),r=Me(n,this.response.roots,this.data.roots,this.optimistic.roots),o=xe(0,r,e);qe(n,r,o,"root"),this.response.roots[n]=o}},{key:"toSource",value:function(){var t={},e=this.response.entities.toSource();Object.keys(e).length>0&&(t.entities=e);var n=this.response.roots;Object.keys(n).length>0&&(t.roots=n);var r=this.response.trash;return r.length>0&&(t.trash=r),t}}]),t}(),$e=function(){function t(){xt(this,t)}return Ut(t,null,[{key:"generate",value:function(){return this.counter+=1,this.counter}}]),t}();Lt($e,"counter",1);var Be,Fe=function(t){Ft(n,t);var e=Xt(n);function n(t,r,o,i){var a;return xt(this,n),(a=e.call(this,r)).name="TransporterError",a.type=t,a.data=o,a.code=i,a}return n}(Jt(Error));function Qe(t,e){var n=ne(),r="TRANSPORTER_MUTATION"===t.type,o=t.id||$e.generate(),i=r?t.mutation.loc.source.body:t.query.loc.source.body;function a(t,e,n){var o=n?Bt({},n):null;if(o&&r&&delete o.roots,!t)return o;var i=new Ie(e,o);return t(i,n),i.toSource()}return function(u,c){function s(e,n,r){return u({type:"TRANSPORTER_REQUEST_ERROR",id:o,endTime:ne(),optimisticData:r,data:n,error:{type:e.type,message:e.message,data:e.data}}),Be&&Be(e,t),Promise.reject(e)}var f;if(r)try{f=a(t.optimisticUpdater,c())}catch(t){if("StoreError"===t.name){var l=new Fe("StoreError","Request failed (StoreError)",{error:t.message});return Be&&Be(l),Promise.reject(l)}throw t}return u({type:"TRANSPORTER_REQUEST_START",id:o,startTime:n,optimisticData:f}),e(i,t.variables).then((function(e){return e.json().then((function(r){if(!e.ok)return s(new Fe("HttpError","Request failed (HttpError - ".concat(e.status,")"),r,e.status),null,f);var i,l=c();if(l.info.lastReset>=n){var p=new Ae("Store reset after request was started.");return s(new Fe("StoreError","Request failed (StoreError)",{error:p.message}),null,null)}if(r.errors)return r.errors.forEach((function(t){console.error("GraphQLError: ".concat(t.message))})),s(new Fe("GraphQLError","Request failed (GraphQLError)",{errors:r.errors}),r.data,f);if(r.data)try{i=a(t.updater,l,r.data)}catch(p){if("StoreError"===p.name)return s(new Fe("StoreError","Request failed (StoreError)",{error:p.message}),r.data,f);throw p}return u({type:"TRANSPORTER_REQUEST_COMPLETED",id:o,endTime:ne(),optimisticData:f,data:i}),r.data}),(function(t){return e.ok?s(new Fe("JsonError","".concat(t.message," (JsonError)")),null,f):s(new Fe("HttpError","Request failed (HttpError - ".concat(e.status,")"),null,e.status),null,f)}))}),(function(t){return s(new Fe("NetworkError","".concat(t.message," (NetworkError)")),null,f)}))}}function We(t,e,n){switch(e){case"=":return t===n;case">":return t>n;case">=":return t>=n;case"<":return t<n;case"<=":return t<=n;default:throw new Ae("Unknown operator '".concat(e,"'"))}}function Ve(t,e,n){var r=n.get(t,e);if(!r)throw new Ae("Joined entity not found.",[t,e]);var o={__typename:t,id:e};return Object.keys(r).forEach((function(t){Pe(r[t])||(o[t]=r[t])})),o}function He(t,e,n,r,o){var i=o.get(t,e);if(!i[n])throw new Ae('Joined relation "'.concat(n,'" not found.'),[t,e]);if(!Pe(i[n]))throw new Ae('Joined relation "'.concat(n,'" is not a connection.'),[t,e]);return null===i[n].link?null:ze(i[n].link,r,o)}function Je(t,e){var n=Bt({},t);return Object.entries(e).forEach((function(e){var r=Yt(e,2),o=r[0],i=r[1];n[i]=t[o]})),n}var Ke=function(){function t(e,n){xt(this,t),this.link=e,this.isManyLink=je(e),this.data=this.isManyLink?e.map((function(t){return Ve.apply(void 0,Gt(t).concat([n]))})):Ve.apply(void 0,Gt(e).concat([n])),this.entities=n,this.aliases={}}return Ut(t,[{key:"where",value:function(t,e,n){var r=n||e,o=n?e:"=";return this.isManyLink||We(this.data[t],o,r)||(this.data=null),this.isManyLink&&(this.data=this.data.filter((function(e){return We(e[t],o,r)}))),this}},{key:"alias",value:function(t){var e=Se(t)?t:t[0];return this.aliases[Re(t)]=e,this}},{key:"orderBy",value:function(){return this}},{key:"limit",value:function(){return this}},{key:"join",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=Re(t),o=Se(t)?t:t[0];if(this.isManyLink)this.link.forEach((function(t,i){var a=He.apply(void 0,Gt(e.link[i]).concat([r,n,e.entities]));e.data[i][o]=a}));else{var i=He.apply(void 0,Gt(this.link).concat([r,n,this.entities]));this.data[o]=i}return this}},{key:"getData",value:function(){var t=this;return this.aliases&&this.data?this.isManyLink?this.data.map((function(e){return Je(e,t.aliases)})):Je(this.data,this.aliases):this.data}}]),t}();function ze(t,e,n){if(null===t)return null;var r=new Ke(t,n);return(e?e(r):r).getData()}function Xe(t,e){if(!t.arguments||0===t.arguments.length)return t.name.value;var n={};return t.arguments.forEach((function(t){n[t.name.value]=r.valueFromASTUntyped(t.value,e)})),[t.name.value,n]}function Ye(t,e){return function(n){return t.selections.forEach((function(t){if("Field"===t.kind){var r=Xe(t,e.variables);t.selectionSet?n.join(r,Ye(t.selectionSet,e)):Se(r)||n.alias(r)}})),n}}var Ge=function(){function t(e){xt(this,t),this.roots=e.roots.data,this.entities=new Le(e.entities.data)}return Ut(t,[{key:"select",value:function(t,e){return e.entry?this.selectByFragmentAST(t,e):this.selectByOperationAST(t,e)}},{key:"selectByFragmentAST",value:function(t,e){var n=t.definitions.find((function(t){return"FragmentDefinition"===t.kind}));if(!n)throw new Ae("Option entry is set, but no fragment node found.");return this.selectByEntity.apply(this,Gt(e.entry).concat([Ye(n.selectionSet,e)]))}},{key:"selectByOperationAST",value:function(t,e){var n=t.definitions.find((function(t){return"OperationDefinition"===t.kind}));if(!n)throw new Ae("No operation node found.");var r=n.selectionSet.selections[0];return this.selectByRoot(Xe(r,e.variables),Ye(r.selectionSet,e))}},{key:"selectByEntity",value:function(t,e,n){if(!this.entities.get(t,e))throw new Ae("Selected entity not found.",[t,e]);return ze([t,e],n,this.entities)}},{key:"selectByRoot",value:function(t,e){var n=Re(t);if(!this.roots[n])throw new Ae("Selected root '".concat(n,"' not found."),"root");return ze(this.roots[n].link,e,this.entities)}},{key:"selectByRelation",value:function(t,e,n,r){var o=Re(n),i=this.entities.get(t,e);if(!i||!i[o])throw new Ae("Selected relation '".concat(o,"' not found."),[t,e]);return ze(i[o].link,r,this.entities)}}]),t}();function Ze(t){return function(e,n){return t(new Ge(e),n)}}function tn(t){return function(e){var n=e.dispatch,r=e.getState;return function(e){return function(o){return"function"==typeof o?o(n,r,t):e(o)}}}}var en=tn();en.withExtraArgument=tn;var nn=a(he).compose,rn="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?nn:nn.apply(null,arguments)};function on(t,e){return{data:e,optimistic:{type:"CREATE",id:t}}}function an(t,e,n,r){var o=Bt({},n),i={type:"UPDATE",data:r?Bt({},r.data):{}};return Object.keys(e).forEach((function(r){o[r]=e[r];var a=i.data[r]?{originalValue:i.data[r].originalValue,values:Gt(i.data[r].values)}:{originalValue:n[r],values:[]};a.values.push({active:!0,id:t,value:e[r]}),i.data[r]=a})),{data:o,optimistic:i}}function un(t,e){return{optimistic:{type:"DELETE",id:t,data:e}}}function cn(t,e,n,r,o){var i={data:r,optimistic:o};return Object.keys(e).forEach((function(e){var r=o.data[e].values.findIndex((function(e){return e.id===t}));if(-1===r)throw new Error("Position not found.");i.data=function(t,e,n,r,o){var i=o.data[e],a=i.originalValue,u=i.values;if(t!==u.length-1||!u[t].active)return r;var c=Bt({},r);return n&&void 0!==n[e]?c[e]=n[e]:1===u.length?void 0===a?delete c[e]:c[e]=a:c[e]=u[t-1].value,c}(r,e,n,i.data,i.optimistic),i.optimistic=function(t,e,n,r){var o=r.data[e].values,i={type:"UPDATE",data:Bt({},r.data)};if(1===o.length)return delete i.data[e],i;var a=n&&void 0!==n[e],u={originalValue:i.data[e].originalValue,values:Gt(i.data[e].values)};return a&&o[t].active&&(u.originalValue=n[e],u.values=u.values.map((function(e,n){return n<t?Bt(Bt({},e),{},{active:!1}):e}))),u.values.splice(t,1),i.data[e]=u,i}(r,e,n,i.optimistic)})),0===Object.keys(i.optimistic.data).length&&(i.optimistic=null),i}function sn(t,e,n,r){if(r.id!==t)throw new Error("Optimistic deletion was processed by other request.");return e&&e.some((function(t){return _e(t,n)}))?{data:null}:{data:r.data}}function fn(t,e){var n=Object.keys(t);return e?n.filter((function(t){return void 0===e[t]})):n}function ln(t,e){return e?t.filter((function(t){return e.some((function(e){return _e(t,e)}))})):t}function pn(t){var e={};return Object.keys(t).forEach((function(n){e[n]=Bt({},t[n])})),e}function dn(t){var e={data:t,optimistic:{}};return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=arguments.length>1?arguments[1]:void 0;if("TRANSPORTER_STORE_RESET"===n.type)return n.data&&n.data.entities?{data:n.data.entities,optimistic:{}}:e;if("TRANSPORTER_REQUEST_START"===n.type&&n.optimisticData){var r=new Le(pn(t.data)),o=new Le(pn(t.optimistic));if(n.optimisticData.entities){var i=new Le(n.optimisticData.entities);i.forEach((function(t){var e=Yt(t,3),i=e[0],a=e[1],u=e[2];if(!r.get(a,u)){var c=on(n.id,i),s=c.data,f=c.optimistic;r.set(a,u,s),o.set(a,u,f)}else{var l=an(n.id,i,r.get(a,u),o.get(a,u)),p=l.data,d=l.optimistic;r.set(a,u,p),o.set(a,u,d)}}))}if(n.optimisticData.trash){var a=n.optimisticData.trash;a.forEach((function(t){var e=Yt(t,2),i=e[0],a=e[1],u=un(n.id,r.get(i,a)).optimistic;r.delete(i,a),o.set(i,a,u)}))}return{data:r.toSource(),optimistic:o.toSource()}}if("TRANSPORTER_REQUEST_COMPLETED"===n.type||"TRANSPORTER_REQUEST_ERROR"===n.type){var u=new Le(pn(t.data)),c=new Le(pn(t.optimistic));if(n.optimisticData&&n.optimisticData.entities){var s=new Le(n.data&&n.data.entities),f=new Le(n.optimisticData.entities);f.forEach((function(t){var e=Yt(t,3),r=e[0],o=e[1],i=e[2];if(c.get(o,i)&&"CREATE"===c.get(o,i).type)u.delete(o,i),c.delete(o,i);else{var a=cn(n.id,r,s.get(o,i),u.get(o,i),c.get(o,i)),f=a.data,l=a.optimistic;u.set(o,i,f),l?c.set(o,i,l):c.delete(o,i)}}))}if(n.optimisticData&&n.optimisticData.trash){var l=n.data&&n.data.trash,p=n.optimisticData.trash;p.forEach((function(t){var e=Yt(t,2),r=e[0],o=e[1],i=sn(n.id,l,[r,o],c.get(r,o)).data;i&&u.set(r,o,i),c.delete(r,o)}))}if(n.data&&n.data.entities){var d=new Le(n.data.entities),y=new Le(n.optimisticData&&n.optimisticData.entities);d.forEach((function(t){var e=Yt(t,3),n=e[0],r=e[1],o=e[2],i=u.get(r,o);i?(fn(n,y.get(r,o)).forEach((function(t){i[t]=n[t]})),u.set(r,o,i)):u.set(r,o,n)}))}if(n.data&&n.data.trash){var v=n.data.trash,h=n.optimisticData&&n.optimisticData.trash,m=ln(v,h);m.forEach((function(t){var e=Yt(t,2),n=e[0],r=e[1];u.delete(n,r)}))}return{data:u.toSource(),optimistic:c.toSource()}}return t}}function yn(){var t=[];return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t,n=arguments.length>1?arguments[1]:void 0,r=Gt(e);if("TRANSPORTER_REQUEST_START"===n.type&&r.push({id:n.id,startTime:n.startTime,endTime:null,loading:!0,errors:null}),"TRANSPORTER_REQUEST_COMPLETED"===n.type){var o=r.findIndex((function(t){return t.id===n.id}));r[o]=Bt(Bt({},r[o]),{},{endTime:n.endTime,loading:!1})}if("TRANSPORTER_REQUEST_COMPLETED"===n.type){var i=r.findIndex((function(t){return t.id===n.id}));r[i]=Bt(Bt({},r[i]),{},{endTime:n.endTime,loading:!1,errors:n.errors})}return r}}function vn(){var t={lastReset:null};return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t,n=arguments.length>1?arguments[1]:void 0;return"TRANSPORTER_STORE_RESET"===n.type?{lastReset:n.lastReset}:e}}function hn(t,e){var n=rn(ve((function(){return function(t){return function(n){return["TRANSPORTER_QUERY","TRANSPORTER_MUTATION"].includes(n.type)?t(Qe(n,e.fetch)):t(n)}}}),en)),r=le(function(t,e){return pe({roots:(n=t,r={data:n,optimistic:null},function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r,e=arguments.length>1?arguments[1]:void 0;if("TRANSPORTER_STORE_RESET"===e.type)return e.data&&e.data.roots?{data:e.data.roots,optimistic:null}:r;if("TRANSPORTER_REQUEST_START"===e.type&&e.optimisticData&&e.optimisticData.roots)return an(e.id,e.optimisticData.roots,t.data,t.optimistic);if("TRANSPORTER_REQUEST_COMPLETED"===e.type||"TRANSPORTER_REQUEST_ERROR"===e.type){var n=e.optimisticData&&e.optimisticData.roots?cn(e.id,e.optimisticData.roots,e.data&&e.data.roots,t.data,t.optimistic):{data:Bt({},t.data),optimistic:t.optimistic};if(e.data&&e.data.roots)fn(e.data.roots,e.optimisticData&&e.optimisticData.roots).forEach((function(t){n.data[t]=e.data.roots[t]}));return n}return t}),entities:dn(e),requests:yn(),info:vn()});var n,r}(t&&t.roots?t.roots:{},t&&t.entities?t.entities:{}),{},n);return r.asyncReducers={},r}var mn=function(){function t(e){xt(this,t),this.config=e,this.store=null}return Ut(t,[{key:"buildStore",value:function(){if(this.store)throw new Error("Store was built before.");return this.store=hn(this.config.initialData,this.config.network),this.store}},{key:"getStore",value:function(){return this.store}},{key:"getConfig",value:function(){return this.config}}]),t}();t.Link=ke,t.ManyLink=Ne,t.Provider=function(t){var n=t.children,r=t.client;if(!r)throw new Error("You must provide a transporter client.");var o=e.useMemo((function(){return r.buildStore()}),[]);return i.default.createElement(I,{store:o},n)},t.TransporterClient=mn,t.TransporterNetwork=function t(e){var n=this;xt(this,t),Lt(this,"fetch",(function(t,e){return n.request(t,e)})),this.request=e},t.createAsyncContainer=function(t,n,r){var o={middleware:r&&r.middleware||null,async:Oe(r)},a=t.name&&t.bundle,u=t.displayName||t.name||"Component";function c(r){var c=Ct(),s=e.useMemo((function(){return function(t){var e=n(t);return Bt(Bt({},e),{},{loaders:e.loaders||{}})}(r)}),[]),f=e.useRef(!1),l=e.useMemo((function(){var t={};return{get:function(e){return t[e]},set:function(e,n){t[e]=n}}}),[]),p=function(t,n){var r=e.useMemo((function(){var e={startTime:ne(),endTime:null},r=n?{bundle:Bt(Bt({},e),{},{loading:n?"block":null,error:null})}:{};return Object.keys(t.loaders).forEach((function(t){r[t]=Bt(Bt({},e),{},{loading:"block",error:null})})),{loaders:r}}),[]),o=Yt(e.useState(r),2),i=o[0],a=o[1];return[i,e.useCallback((function(t,e,n){var r=ne();a((function(o){return{loaders:Bt(Bt({},o.loaders),{},Lt({},t,{startTime:e?r:o.loaders[t].startTime,endTime:e?o.loaders[t].endTime:r,loading:e,error:void 0===n?o.loaders[t].error:n}))}}))}),[])]}(s,a),d=Yt(p,2),y=d[0],v=d[1],h=e.useMemo((function(){return{Component:a?null:t,isConnected:!1}}),[]),m=e.useCallback((function(t,e){return e.then((function(e){"bundle"===t&&(h.Component=function(t){return null==t||"function"!=typeof t&&"object"!==Mt(t)||!t.default?t:t.default}(e)),f.current||v(t,null,null)})).catch((function(e){f.current||v(t,null,e)}))}),[]);e.useEffect((function(){return Object.keys(s.loaders).forEach((function(t){s.loaders[t].request({load:function(e){return m(t,e,!1)},cache:l},c.dispatch)})),a&&!h.Component&&m("bundle",t.bundle(),!1),function(){f.current=!0}}),[]),e.useEffect((function(){Object.keys(s.loaders).forEach((function(t){var e=s.loaders[t];if(e.shouldReload&&!y.loaders[t].loading&&e.shouldReload({info:y.loaders[t],cache:l},r,c.getState())){v(t,"block",null);e.request({load:function(e,n){return m(t,e,!1,n)},cache:l},c.dispatch)}}))}));var b={};if(Object.keys(s.loaders).forEach((function(t){var e=s.loaders[t];if(e.props){b[t]=Bt(Bt({},y.loaders[t]),e.props({load:function(e,n){y.loaders[t].loading?console.error("Resource ".concat(u," ").concat(t," is already loading.")):(v(t,n&&n.showWhileLoading?"show":"block"),m(t,e,!1))},cache:l},c.dispatch))}})),Object.values(y.loaders).some((function(t){return"block"===t.loading}))){if(!o.async.loading)return null;var g=o.async.loading;return i.default.createElement(g,It({},b,r))}if(Object.values(y.loaders).some((function(t){return null!==t.error}))){if(!o.async.error)return null;var E=o.async.error;return i.default.createElement(E,It({},b,r))}if(s.selectors||s.actions){h.isConnected||(h.Component=ge(h.Component),h.isConnected=!0);var O=h.Component;return i.default.createElement(O,{selectors:s.selectors,actions:s.actions,props:Bt(Bt({},b),r)})}var w=h.Component;return i.default.createElement(w,It({},b,r))}return c.displayName="Load(".concat(u,")"),o.middleware?ye.apply(void 0,Gt(o.middleware))(c):c},t.createContainer=function(t,e,n){var r={middleware:n&&n.middleware||null},o=jt((function(t,n){return be(e(n).selectors,t)}),(function(t,n){return me(e(n).actions,t)}));return r.middleware?ye.apply(void 0,Gt(r.middleware).concat([o]))(t):o(t)},t.createMutation=function(t,e){return Bt({type:"TRANSPORTER_MUTATION",mutation:t},e)},t.createQuery=ee,t.onError=function(t){Be=t},t.query=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.loaderOptions,r=Kt(e,["loaderOptions"]);return{request:function(e,o){var i=e.load;return e.cache.set("variables",r.variables),n&&n.skip?i(new Promise((function(t){return t()}))):i(o(ee(t,r)))},props:function(e,n){var o=e.load,i=e.cache;return{refetch:function(){i.set("variables",r.variables);for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];return o(n(ee(t,Bt(Bt({},r),a))))},fetchMore:function(){i.set("variables",r.variables);for(var e=arguments.length,a=new Array(e),u=0;u<e;u++)a[u]=arguments[u];return o(n(ee(t,Bt(Bt({},r),a)),{showWhileLoading:!0}))},startPolling:function(e){var a=setInterval((function(){o(n(ee(t,r),{showWhileLoading:!0}))}),e);i.set("timeout",a)},endPolling:function(){clearInterval(i.get("timeout")),i.set("timeout",null)}}},shouldReload:function(t,e,n){var o=t.info,i=t.cache,a=i.get("variables");return i.set("variables",r.variables),o.startTime<n.info.lastReset||!we(a,r.variables)}}},t.resetStore=function(t){return{type:"TRANSPORTER_STORE_RESET",data:t,lastReset:ne()}},t.select=function(t,e){return Ze((function(n){return n.select(t,e||{})}))},t.selectAdvanced=Ze,t.selectByEntity=function(t,e,n){return Ze((function(r){return r.selectByEntity(t,e,n)}))},t.selectByRelation=function(t,e,n,r){return Ze((function(o){return o.selectByRelation(t,e,n,r)}))},t.selectByRoot=function(t,e){return Ze((function(n){return n.selectByRoot(t,e)}))},t.useDispatch=At,Object.defineProperty(t,"__esModule",{value:!0})})); |
{ | ||
"name": "react-transporter", | ||
"version": "0.5.21", | ||
"version": "0.6.0", | ||
"description": "React.js Redux GraphQL client", | ||
@@ -29,19 +29,16 @@ "author": "Markus Wetzel <markuswetzel@gmx.net>", | ||
"prop-types": "^15.7.2", | ||
"react-tree-walker": "^4.3.0", | ||
"serialize-javascript": "^5.0.1" | ||
"react-redux": "^7.2.5", | ||
"redux": "^4.1.1", | ||
"redux-devtools-extension": "^2.13.9", | ||
"redux-thunk": "^2.3.0", | ||
"serialize-javascript": "^6.0.0" | ||
}, | ||
"devDependencies": { | ||
"graphql": "15.5.0", | ||
"graphql": "15.5.3", | ||
"packsy": "0.2.2", | ||
"react": "16.8.6", | ||
"react-redux": "5.1.1", | ||
"redux": "4.0.5", | ||
"redux-thunk": "2.3.0" | ||
"react": "16.13.1" | ||
}, | ||
"peerDependencies": { | ||
"graphql": ">=14", | ||
"react": ">=15", | ||
"react-redux": ">=5", | ||
"redux": ">=3", | ||
"redux-thunk": ">=2" | ||
"react": ">=16" | ||
}, | ||
@@ -48,0 +45,0 @@ "husky": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
382394
3
8924
5
+ Addedreact-redux@^7.2.5
+ Addedredux@^4.1.1
+ Addedredux-thunk@^2.3.0
+ Added@babel/runtime@7.26.0(transitive)
+ Added@types/hoist-non-react-statics@3.3.5(transitive)
+ Added@types/prop-types@15.7.13(transitive)
+ Added@types/react@18.3.12(transitive)
+ Added@types/react-redux@7.1.34(transitive)
+ Addedcsstype@3.1.3(transitive)
+ Addedhoist-non-react-statics@3.3.2(transitive)
+ Addedreact-is@17.0.2(transitive)
+ Addedreact-redux@7.2.9(transitive)
+ Addedredux@4.2.1(transitive)
+ Addedredux-devtools-extension@2.13.9(transitive)
+ Addedredux-thunk@2.4.2(transitive)
+ Addedregenerator-runtime@0.14.1(transitive)
+ Addedserialize-javascript@6.0.2(transitive)
- Removedreact-tree-walker@^4.3.0
- Removed@types/use-sync-external-store@0.0.3(transitive)
- Removedreact@16.14.0(transitive)
- Removedreact-redux@9.1.2(transitive)
- Removedreact-tree-walker@4.3.0(transitive)
- Removedredux@5.0.1(transitive)
- Removedredux-thunk@3.1.0(transitive)
- Removedserialize-javascript@5.0.1(transitive)
- Removeduse-sync-external-store@1.2.2(transitive)
Updatedserialize-javascript@^6.0.0