From 47a61fab14a538afff9c55f76e12b613478be574 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Fri, 12 Jun 2020 13:18:29 -0600 Subject: [PATCH 1/5] Write initial context post --- .../2020-06-11-a-hierarchy-of-context.md | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md diff --git a/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md b/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md new file mode 100644 index 00000000..b8aa4010 --- /dev/null +++ b/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md @@ -0,0 +1,40 @@ +{:title "Guide: A Hierarchy of Context" + :layout :post + :toc true + :author "@devth" + :summary "Context is everything." + :tags ["guide" "2020" "ops"]} + +Context is everything. It acts as a constraining factor, letting us make +assumptions, frames conversations, and is at the heart of every delightful +UX and DX. + +In chat systems, we can construct a hierarchy of context. Let's start with the +widest. + +When a message arrives, we can ignore everything about its origin, such as the +channel it came from or user responsible for sending it. This is the *global +context*. When we configure Yetibot through the available means, we are setting +the global context that Yeibot operates within. + +Next on the spectrum, when a message arrives, we can look at the channel that it +originated from, but again ignore who sent it. This is the *channel context*. We +can parameterize things at the team level per channel. Things like the issue +tracking project, the locations to check for weather, the group's favorite stock +prices, whether or not embedded commands are enabled, or the local fallback +command. + +Finally, when a message arrives, we can can look at the user who sent it, which +is of course the *user context*. This is our narrowest context, and is the lever +for varying parameters between users. This may be a user's zip code, GitHub +username, or any other user-specific parameter that could vary across built in +commands or aliases. + +So how do we use this? + +We can construct aliases that rely on any of these available contexts. But we +can also rely on cascading fallbacks that start with the most specific and +progressively fall back to the next-most specific to obtain the value of a +parameter. + +Let's use some examples to illustrate. From b48ea647bda76d7f11e2fda9e7bf38a343a8dc64 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Fri, 12 Jun 2020 13:20:38 -0600 Subject: [PATCH 2/5] Tweak typography --- .../md/posts/2020-06-11-a-hierarchy-of-context.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md b/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md index b8aa4010..486bdea9 100644 --- a/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md +++ b/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md @@ -3,29 +3,28 @@ :toc true :author "@devth" :summary "Context is everything." - :tags ["guide" "2020" "ops"]} + :tags ["guide" "2020" "ops" "config"]} Context is everything. It acts as a constraining factor, letting us make -assumptions, frames conversations, and is at the heart of every delightful -UX and DX. +assumptions, frames ideas, and is at the heart of every delightful UX and DX. In chat systems, we can construct a hierarchy of context. Let's start with the widest. When a message arrives, we can ignore everything about its origin, such as the -channel it came from or user responsible for sending it. This is the *global -context*. When we configure Yetibot through the available means, we are setting +channel it came from or user responsible for sending it. This is the **global +context**. When we configure Yetibot through the available means, we are setting the global context that Yeibot operates within. Next on the spectrum, when a message arrives, we can look at the channel that it -originated from, but again ignore who sent it. This is the *channel context*. We +originated from, but again ignore who sent it. This is the **channel context**. We can parameterize things at the team level per channel. Things like the issue tracking project, the locations to check for weather, the group's favorite stock prices, whether or not embedded commands are enabled, or the local fallback command. Finally, when a message arrives, we can can look at the user who sent it, which -is of course the *user context*. This is our narrowest context, and is the lever +is of course the **user context**. This is our narrowest context, and is the lever for varying parameters between users. This may be a user's zip code, GitHub username, or any other user-specific parameter that could vary across built in commands or aliases. From 8d40d4eed3365269314fd0a34b760feef7fb885a Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Fri, 12 Jun 2020 14:44:02 -0600 Subject: [PATCH 3/5] Start adding examples --- .../2020-06-11-a-hierarchy-of-context.md | 61 ++++++++++++++++++- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md b/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md index 486bdea9..a8b6bd58 100644 --- a/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md +++ b/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md @@ -11,10 +11,14 @@ assumptions, frames ideas, and is at the heart of every delightful UX and DX. In chat systems, we can construct a hierarchy of context. Let's start with the widest. +## Global + When a message arrives, we can ignore everything about its origin, such as the -channel it came from or user responsible for sending it. This is the **global -context**. When we configure Yetibot through the available means, we are setting -the global context that Yeibot operates within. +channel it came from or user responsible for sending it. This is the +**global context**. When we configure Yetibot through the available means, we +are setting the global context that Yeibot operates within. + +## Channel Next on the spectrum, when a message arrives, we can look at the channel that it originated from, but again ignore who sent it. This is the **channel context**. We @@ -23,12 +27,16 @@ tracking project, the locations to check for weather, the group's favorite stock prices, whether or not embedded commands are enabled, or the local fallback command. +## User + Finally, when a message arrives, we can can look at the user who sent it, which is of course the **user context**. This is our narrowest context, and is the lever for varying parameters between users. This may be a user's zip code, GitHub username, or any other user-specific parameter that could vary across built in commands or aliases. +## Usage and examples + So how do we use this? We can construct aliases that rely on any of these available contexts. But we @@ -37,3 +45,50 @@ progressively fall back to the next-most specific to obtain the value of a parameter. Let's use some examples to illustrate. + +### Weather + +**Use case**: quickly list the current weather for all members in the channel. + +There are a couple ways to do this. But first, let's define a helper alias: + +```yetibot +!alias loctemp = "weather $s | render {{temp|multiply:1.8|add:32|round}}°F, Humidity {{rh}}% - {{weather.description}}, {{city_name}}, {{state_code}} {{country_code}}" +``` + +#### Channel settings + +Now, let's say you have people in the channel from Seattle, Chicago, and New +York City. We can encode that in a channel setting: + +```yetibot +!channel set locs = Seattle, Chicago, New York City +``` + +```yetibot +!alias chantemps = "channel settings locs | list | xargs loctemp | sort" +``` + +Finally, try it out: + +```yetibot +!chantemps +``` + +This allows us to vary the set of `locs` from channel to channel. +The result of `chantemps` will reflect the local channel settings. + +#### User settings + +Another way to solve this weather look up use case would be for individuals to +set their individual locations via `my`. + +```yetibot +!help my +``` + +This is interesting, because once a user sets their location, a command that +utilizes the locations of all members in a channel would vary from channel to +channel automatically, depending on who is present. When a user leaves or joins +a channel, the context is updated accordingly. + From 1077de7506a88317003e61254ccaa00b42b40a40 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Fri, 19 Jun 2020 10:44:27 -0600 Subject: [PATCH 4/5] Add Adapter config to context post --- .../2020-06-11-a-hierarchy-of-context.md | 49 +++++++++++++++++-- resources/templates/themes/devth/js/dist.js | 2 +- src/index.js | 4 +- 3 files changed, 48 insertions(+), 7 deletions(-) diff --git a/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md b/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md index a8b6bd58..3b5c0199 100644 --- a/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md +++ b/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md @@ -2,9 +2,13 @@ :layout :post :toc true :author "@devth" - :summary "Context is everything." + :summary "Mine, ours, theirs" :tags ["guide" "2020" "ops" "config"]} +```yetibot +!complete context is +``` + Context is everything. It acts as a constraining factor, letting us make assumptions, frames ideas, and is at the heart of every delightful UX and DX. @@ -14,9 +18,14 @@ widest. ## Global When a message arrives, we can ignore everything about its origin, such as the -channel it came from or user responsible for sending it. This is the -**global context**. When we configure Yetibot through the available means, we -are setting the global context that Yeibot operates within. +channel it came from or user responsible for sending it. This is the +**global context**. It spans an entire Yetibot instance across all configured +adapters. + +## Adapter + +Slightly more specific, when a message arrives we can look at the adapter that +it originated from. This is the **adapter context**. ## Channel @@ -92,3 +101,35 @@ utilizes the locations of all members in a channel would vary from channel to channel automatically, depending on who is present. When a user leaves or joins a channel, the context is updated accordingly. +We can get that list of values using `our`: + +```yetibot +!help our +``` + +```yetibot +!our zip +``` + +### Stocks + +Use case: list stock prices. + +This time let's rely on `ours`. + +```yetibot +!my stocks = aapl,goog,tsla +``` + +Now if another user specified: + +```yetibot +``` + +## Future + +In the future, as part of +[The great configuration overhaul of 2020](https://github.com/yetibot/yetibot/projects/5), +we may provide the ability to override immutable Yetibot configuration at +runtime with mutable (i.e. stored in the database) config. + diff --git a/resources/templates/themes/devth/js/dist.js b/resources/templates/themes/devth/js/dist.js index fa111ab7..57933d73 100644 --- a/resources/templates/themes/devth/js/dist.js +++ b/resources/templates/themes/devth/js/dist.js @@ -42,7 +42,7 @@ object-assign * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r,i,o,a,l;if(Object.defineProperty(t,"__esModule",{value:!0}),"undefined"==typeof window||"function"!=typeof MessageChannel){var s=null,u=null,c=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(e){throw setTimeout(c,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==s?setTimeout(r,0,e):(s=e,setTimeout(c,0))},i=function(e,t){u=setTimeout(e,t)},o=function(){clearTimeout(u)},a=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,p=window.Date,m=window.setTimeout,h=window.clearTimeout,v=window.requestAnimationFrame,y=window.cancelAnimationFrame;if("undefined"!=typeof console&&("function"!=typeof v&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")),"object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var b=p.now();t.unstable_now=function(){return p.now()-b}}var g=!1,w=null,x=-1,k=5,E=0;a=function(){return t.unstable_now()>=E},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125N(a,n))void 0!==s&&0>N(s,a)?(e[r]=s,e[l]=n,r=l):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==s&&0>N(s,n)))break e;e[r]=s,e[l]=n,r=l}}}return t}return null}function N(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var j=[],I=[],P=1,D=null,R=3,A=!1,F=!1,M=!1;function L(e){for(var t=C(I);null!==t;){if(null===t.callback)_(I);else{if(!(t.startTime<=e))break;_(I),t.sortIndex=t.expirationTime,O(j,t)}t=C(I)}}function q(e){if(M=!1,L(e),!F)if(null!==C(j))F=!0,r(z);else{var t=C(I);null!==t&&i(q,t.startTime-e)}}function z(e,n){F=!1,M&&(M=!1,o()),A=!0;var r=R;try{for(L(n),D=C(j);null!==D&&(!(D.expirationTime>n)||e&&!a());){var l=D.callback;if(null!==l){D.callback=null,R=D.priorityLevel;var s=l(D.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?D.callback=s:D===C(j)&&_(j),L(n)}else _(j);D=C(j)}if(null!==D)var u=!0;else{var c=C(I);null!==c&&i(q,c.startTime-n),u=!1}return u}finally{D=null,R=r,A=!1}}function Q(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var V=l;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=R;R=e;try{return t()}finally{R=n}},t.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var n=R;R=t;try{return e()}finally{R=n}},t.unstable_scheduleCallback=function(e,n,a){var l=t.unstable_now();if("object"==typeof a&&null!==a){var s=a.delay;s="number"==typeof s&&0l?(e.sortIndex=s,O(I,e),null===C(j)&&e===C(I)&&(M?o():M=!0,i(q,s-l))):(e.sortIndex=a,O(j,e),F||A||(F=!0,r(z))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=R;return function(){var n=R;R=t;try{return e.apply(this,arguments)}finally{R=n}}},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_shouldYield=function(){var e=t.unstable_now();L(e);var n=C(j);return n!==D&&null!==D&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime1,i=!1,o=arguments[1],a=o;return new n((function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){r.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))}},{key:u,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=f(t,u);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(a("iterator")&&(r=f(t,s)))return new n((function(e){h((function(){if(!e.closed){var n=!0,i=!1,o=void 0;try{for(var a,l=r.call(t)[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){var s=a.value;if(e.next(s),e.closed)return}}catch(e){i=!0,o=e}finally{try{!n&&l.return&&l.return()}finally{if(i)throw o}}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){h((function(){if(!e.closed){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:e.prototype.toString;e.prototype.toJSON=t,e.prototype.inspect=t,o.a&&(e.prototype[o.a]=t)}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n,r=/\r\n|[\n\r]/g,i=1,o=t+1;(n=r.exec(e.body))&&n.index120){for(var m=Math.floor(s/80),h=s%80,v=[],y=0;y0||i(0,"line in locationOffset is 1-indexed and must be positive"),this.locationOffset.column>0||i(0,"column in locationOffset is 1-indexed and must be positive")};v=y,"function"==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(v.prototype,Symbol.toStringTag,{get:function(){return this.constructor.name}});var b=n(8),g=Object.freeze({SOF:"",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function w(){return this.lastToken=this.token,this.token=this.lookahead()}function x(){var e=this.token;if(e.kind!==g.EOF)do{e=e.next||(e.next=S(this,e))}while(e.kind===g.COMMENT);return e}function k(e,t,n,r,i,o,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=o,this.next=null}function E(e){return isNaN(e)?g.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function S(e,t){var n=e.source,r=n.body,i=r.length,o=function(e,t,n){var r=e.length,i=t;for(;i=i)return new k(g.EOF,i,i,a,l,t);var s=r.charCodeAt(o);switch(s){case 33:return new k(g.BANG,o,o+1,a,l,t);case 35:return function(e,t,n,r,i){var o,a=e.body,l=t;do{o=a.charCodeAt(++l)}while(!isNaN(o)&&(o>31||9===o));return new k(g.COMMENT,t,l,n,r,i,a.slice(t+1,l))}(n,o,a,l,t);case 36:return new k(g.DOLLAR,o,o+1,a,l,t);case 38:return new k(g.AMP,o,o+1,a,l,t);case 40:return new k(g.PAREN_L,o,o+1,a,l,t);case 41:return new k(g.PAREN_R,o,o+1,a,l,t);case 46:if(46===r.charCodeAt(o+1)&&46===r.charCodeAt(o+2))return new k(g.SPREAD,o,o+3,a,l,t);break;case 58:return new k(g.COLON,o,o+1,a,l,t);case 61:return new k(g.EQUALS,o,o+1,a,l,t);case 64:return new k(g.AT,o,o+1,a,l,t);case 91:return new k(g.BRACKET_L,o,o+1,a,l,t);case 93:return new k(g.BRACKET_R,o,o+1,a,l,t);case 123:return new k(g.BRACE_L,o,o+1,a,l,t);case 124:return new k(g.PIPE,o,o+1,a,l,t);case 125:return new k(g.BRACE_R,o,o+1,a,l,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return function(e,t,n,r,i){var o=e.body,a=o.length,l=t+1,s=0;for(;l!==a&&!isNaN(s=o.charCodeAt(l))&&(95===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122);)++l;return new k(g.NAME,t,l,n,r,i,o.slice(t,l))}(n,o,a,l,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return function(e,t,n,r,i,o){var a=e.body,l=n,s=t,u=!1;45===l&&(l=a.charCodeAt(++s));if(48===l){if((l=a.charCodeAt(++s))>=48&&l<=57)throw m(e,s,"Invalid number, unexpected digit after 0: ".concat(E(l),"."))}else s=T(e,s,l),l=a.charCodeAt(s);46===l&&(u=!0,l=a.charCodeAt(++s),s=T(e,s,l),l=a.charCodeAt(s));69!==l&&101!==l||(u=!0,43!==(l=a.charCodeAt(++s))&&45!==l||(l=a.charCodeAt(++s)),s=T(e,s,l),l=a.charCodeAt(s));if(46===l||69===l||101===l)throw m(e,s,"Invalid number, expected digit but got: ".concat(E(l),"."));return new k(u?g.FLOAT:g.INT,t,s,r,i,o,a.slice(t,s))}(n,o,s,a,l,t);case 34:return 34===r.charCodeAt(o+1)&&34===r.charCodeAt(o+2)?function(e,t,n,r,i,o){var a=e.body,l=t+3,s=l,u=0,c="";for(;l=48&&o<=57){do{o=r.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw m(e,i,"Invalid number, expected digit but got: ".concat(E(o),"."))}function O(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}a(k,(function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}));var C=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function _(e,t){return new I(e,t).parseDocument()}function N(e,t){var n=new I(e,t);n.expectToken(g.SOF);var r=n.parseValueLiteral(!1);return n.expectToken(g.EOF),r}function j(e,t){var n=new I(e,t);n.expectToken(g.SOF);var r=n.parseTypeReference();return n.expectToken(g.EOF),r}n.d(t,"parse",(function(){return _})),n.d(t,"parseValue",(function(){return N})),n.d(t,"parseType",(function(){return j}));var I=function(){function e(e,t){var n="string"==typeof e?new y(e):e;n instanceof y||i(0,"Must provide Source. Received: ".concat(Object(r.a)(n))),this._lexer=function(e,t){var n=new k(g.SOF,0,0,0,0,null);return{source:e,options:t,lastToken:n,token:n,line:1,lineStart:0,advance:w,lookahead:x}}(n),this._options=t||{}}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(g.NAME);return{kind:h.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:h.DOCUMENT,definitions:this.many(g.SOF,this.parseDefinition,g.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(g.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(g.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(g.BRACE_L))return{kind:h.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,n=this.parseOperationType();return this.peek(g.NAME)&&(t=this.parseName()),{kind:h.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(g.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(g.PAREN_L,this.parseVariableDefinition,g.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(g.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(g.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(g.DOLLAR),{kind:h.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:h.SELECTION_SET,selections:this.many(g.BRACE_L,this.parseSelection,g.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(g.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(g.COLON)?(e=r,t=this.parseName()):t=r,{kind:h.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(g.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(g.PAREN_L,t,g.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(g.COLON),{kind:h.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:h.ARGUMENT,name:this.parseName(),value:(this.expectToken(g.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(g.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(g.NAME)?{kind:h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e=this._lexer.token;return this.expectKeyword("fragment"),this._options.experimentalFragmentVariables?{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}:{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case g.BRACKET_L:return this.parseList(e);case g.BRACE_L:return this.parseObject(e);case g.INT:return this._lexer.advance(),{kind:h.INT,value:t.value,loc:this.loc(t)};case g.FLOAT:return this._lexer.advance(),{kind:h.FLOAT,value:t.value,loc:this.loc(t)};case g.STRING:case g.BLOCK_STRING:return this.parseStringLiteral();case g.NAME:return"true"===t.value||"false"===t.value?(this._lexer.advance(),{kind:h.BOOLEAN,value:"true"===t.value,loc:this.loc(t)}):"null"===t.value?(this._lexer.advance(),{kind:h.NULL,loc:this.loc(t)}):(this._lexer.advance(),{kind:h.ENUM,value:t.value,loc:this.loc(t)});case g.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:h.STRING,value:e.value,block:e.kind===g.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token;return{kind:h.LIST,values:this.any(g.BRACKET_L,(function(){return t.parseValueLiteral(e)}),g.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token;return{kind:h.OBJECT,fields:this.any(g.BRACE_L,(function(){return t.parseObjectField(e)}),g.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(g.COLON),{kind:h.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(g.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(g.AT),{kind:h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(g.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(g.BRACKET_R),e={kind:h.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(g.BANG)?{kind:h.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:h.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===g.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(g.STRING)||this.peek(g.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token;this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.many(g.BRACE_L,this.parseOperationTypeDefinition,g.BRACE_R);return{kind:h.SCHEMA_DEFINITION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(g.COLON);var n=this.parseNamedType();return{kind:h.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:h.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:h.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e=[];if(this.expectOptionalKeyword("implements")){this.expectOptionalToken(g.AMP);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(g.AMP)||this._options.allowLegacySDLImplementsInterfaces&&this.peek(g.NAME))}return e},t.parseFieldsDefinition=function(){return this._options.allowLegacySDLEmptyFields&&this.peek(g.BRACE_L)&&this._lexer.lookahead().kind===g.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(g.BRACE_L,this.parseFieldDefinition,g.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(g.COLON);var i=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:h.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(g.PAREN_L,this.parseInputValueDef,g.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(g.COLON);var r,i=this.parseTypeReference();this.expectOptionalToken(g.EQUALS)&&(r=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:h.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:o,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();return{kind:h.INTERFACE_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:h.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){var e=[];if(this.expectOptionalToken(g.EQUALS)){this.expectOptionalToken(g.PIPE);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(g.PIPE))}return e},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:h.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(g.BRACE_L,this.parseEnumValueDefinition,g.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:h.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(g.BRACE_L,this.parseInputValueDef,g.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===g.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(g.BRACE_L,this.parseOperationTypeDefinition,g.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:h.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:h.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:h.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:h.INTERFACE_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:h.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:h.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(g.AT);var n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:h.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o,loc:this.loc(e)}},t.parseDirectiveLocations=function(){this.expectOptionalToken(g.PIPE);var e=[];do{e.push(this.parseDirectiveLocation())}while(this.expectOptionalToken(g.PIPE));return e},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==C[t.value])return t;throw this.unexpected(e)},t.loc=function(e){if(!this._options.noLocation)return new P(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw m(this._lexer.source,t.start,"Expected ".concat(e,", found ").concat(D(t)))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==g.NAME||t.value!==e)throw m(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(D(t)));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===g.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=e||this._lexer.token;return m(this._lexer.source,t.start,"Unexpected ".concat(D(t)))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r},e}();function P(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}function D(e){var t=e.value;return t?"".concat(e.kind,' "').concat(t,'"'):e.kind}a(P,(function(){return{start:this.start,end:this.end}}))},function(e,t,n){"use strict";n.r(t);var r=n(22),i=n.n(r),o=n(23),a=n.n(o),l=n(5),s=n.n(l),u=n(0),c=n(1),f=n(21),d=n(27),p=n.n(d).a,m=n(2);!function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}Object(u.c)(t,e)}(Error);function h(e){return e.request.length<=1}function v(e){return new p((function(t){t.error(e)}))}function y(e,t){var n=Object(u.a)({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n="function"==typeof e?Object(u.a)({},n,e(n)):Object(u.a)({},n,e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return Object(u.a)({},n)}}),Object.defineProperty(t,"toKey",{enumerable:!1,value:function(){return function(e){var t=e.query,n=e.variables,r=e.operationName;return JSON.stringify([r,t,n])}(t)}}),t}function b(e,t){return t?t(e):p.of()}function g(e){return"function"==typeof e?new E(e):e}function w(){return new E((function(){return p.of()}))}function x(e){return 0===e.length?w():e.map(g).reduce((function(e,t){return e.concat(t)}))}function k(e,t,n){var r=g(t),i=g(n||new E(b));return h(r)&&h(i)?new E((function(t){return e(t)?r.request(t)||p.of():i.request(t)||p.of()})):new E((function(t,n){return e(t)?r.request(t,n)||p.of():i.request(t,n)||p.of()}))}var E=function(){function e(e){e&&(this.request=e)}return e.prototype.split=function(t,n,r){return this.concat(k(t,n,r||new e(b)))},e.prototype.concat=function(e){return function(e,t){var n=g(e);if(h(n))return n;var r=g(t);return h(r)?new E((function(e){return n.request(e,(function(e){return r.request(e)||p.of()}))||p.of()})):new E((function(e,t){return n.request(e,(function(e){return r.request(e,t)||p.of()}))||p.of()}))}(this,e)},e.prototype.request=function(e,t){throw new m.a(1)},e.empty=w,e.from=x,e.split=k,e.execute=S,e}();function S(e,t){return e.request(y(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Object(c.n)(t.query):""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n0}var I,P=function(e){var t="";return j(e.graphQLErrors)&&e.graphQLErrors.forEach((function(e){var n=e?e.message:"Error message not found.";t+="GraphQL error: "+n+"\n"})),e.networkError&&(t+="Network error: "+e.networkError.message+"\n"),t=t.replace(/\n$/,"")},D=function(e){function t(n){var r=n.graphQLErrors,i=n.networkError,o=n.errorMessage,a=n.extraInfo,l=e.call(this,o)||this;return l.graphQLErrors=r||[],l.networkError=i||null,l.message=o||P(l),l.extraInfo=a,l.__proto__=t.prototype,l}return Object(u.c)(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(I||(I={}));var R=function(e){function t(t){var n=t.queryManager,r=t.options,i=t.shouldSubscribe,o=void 0===i||i,a=e.call(this,(function(e){return a.onSubscribe(e)}))||this;a.observers=new Set,a.subscriptions=new Set,a.isTornDown=!1,a.options=r,a.variables=r.variables||{},a.queryId=n.generateQueryId(),a.shouldSubscribe=o;var l=Object(c.m)(r.query);return a.queryName=l&&l.name&&l.name.value,a.queryManager=n,a}return Object(u.c)(t,e),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=e.subscribe(r)}))},t.prototype.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},t.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:T.error}}var t,n,r,i=this.queryManager.getCurrentQueryResult(this),o=i.data,a=i.partial,l=this.queryManager.queryStore.get(this.queryId),s=this.options.fetchPolicy,c="network-only"===s||"no-cache"===s;if(l){var f=l.networkStatus;if(n=l,void 0===(r=this.options.errorPolicy)&&(r="none"),n&&(n.networkError||"none"===r&&j(n.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:f,error:new D({graphQLErrors:l.graphQLErrors,networkError:l.networkError})};l.variables&&(this.options.variables=Object(u.a)({},this.options.variables,l.variables),this.variables=this.options.variables),t={data:o,loading:_(f),networkStatus:f},l.graphQLErrors&&"all"===this.options.errorPolicy&&(t.errors=l.graphQLErrors)}else{var d=c||a&&"cache-only"!==s;t={data:o,loading:d,networkStatus:d?T.loading:T.ready}}return a||this.updateLastResult(Object(u.a)({},t,{stale:!1})),Object(u.a)({},t,{partial:a})},t.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&Object(f.a)(t.data,e.data))},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},t.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject(new m.a(3)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),Object(f.a)(this.variables,e)||(this.variables=Object(u.a)({},this.variables,e)),Object(f.a)(this.options.variables,this.variables)||(this.options.variables=Object(u.a)({},this.options.variables,this.variables)),this.queryManager.fetchQuery(this.queryId,Object(u.a)({},this.options,{fetchPolicy:t}),I.refetch))},t.prototype.fetchMore=function(e){var t=this;Object(m.b)(e.updateQuery,4);var n=Object(u.a)({},e.query?e:Object(u.a)({},this.options,e,{variables:Object(u.a)({},this.variables,e.variables)}),{fetchPolicy:"network-only"}),r=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(r,n,I.normal,this.queryId).then((function(i){return t.updateQuery((function(t){return e.updateQuery(t,{fetchMoreResult:i.data,variables:n.variables})})),t.queryManager.stopQuery(r),i}),(function(e){throw t.queryManager.stopQuery(r),e}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})}))},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){var t=this.options.fetchPolicy;this.options=Object(u.a)({},this.options,e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var n=e.fetchPolicy;return this.setVariables(this.options.variables,t!==n&&("cache-only"===t||"standby"===t||"network-only"===n),e.fetchResults)},t.prototype.setVariables=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=!0),this.isTornDown=!1,e=e||this.variables,!t&&Object(f.a)(e,this.variables)?this.observers.size&&n?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=t.getQueryWithPreviousResult(this.queryId),r=n.previousResult,i=n.variables,o=n.document,a=Object(c.I)((function(){return e(r,{variables:i})}));a&&(t.dataStore.markUpdateQueryResult(o,i,a),t.broadcastQueries())},t.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},t.prototype.startPolling=function(e){M(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:Object(c.f)(e),t},t.prototype.onSubscribe=function(e){var t=this;try{var n=e._subscription._observer;n&&!n.error&&(n.error=A)}catch(e){}var r=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),r&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.setUpQuery=function(){var e=this,t=this.queryManager,n=this.queryId;this.shouldSubscribe&&t.addObservableQuery(n,this),this.options.pollInterval&&(M(this),t.startPollingQuery(this.options,n));var r=function(t){e.updateLastResult(Object(u.a)({},e.lastResult,{errors:t.graphQLErrors,networkStatus:T.error,loading:!1})),F(e.observers,"error",e.lastError=t)};t.observeQuery(n,this.options,{next:function(n){if(e.lastError||e.isDifferentFromLastResult(n)){var r=e.updateLastResult(n),i=e.options,o=i.query,a=i.variables,l=i.fetchPolicy;t.transform(o).hasClientExports?t.getLocalState().addExportedVariables(o,a).then((function(i){var a=e.variables;e.variables=e.options.variables=i,!n.loading&&r&&"cache-only"!==l&&t.transform(o).serverQuery&&!Object(f.a)(a,i)?e.refetch():F(e.observers,"next",n)})):F(e.observers,"next",n)}},error:r}).catch(r)},t.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},t}(N);function A(e){}function F(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function M(e){var t=e.options.fetchPolicy;Object(m.b)("cache-first"!==t&&"cache-only"!==t,5)}var L=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,n){this.store[e]={mutation:t,variables:n||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var n=this.store[e];n&&(n.loading=!1,n.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),q=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var t=this.store[e.queryId];Object(m.b)(!t||t.document===e.document||Object(f.a)(t.document,e.document),19);var n,r=!1,i=null;e.storePreviousVariables&&t&&t.networkStatus!==T.loading&&(Object(f.a)(t.variables,e.variables)||(r=!0,i=t.variables)),n=r?T.setVariables:e.isPoll?T.poll:e.isRefetch?T.refetch:T.loading;var o=[];t&&t.graphQLErrors&&(o=t.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:i,networkError:null,graphQLErrors:o,networkStatus:n,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=T.fetchMore)},e.prototype.markQueryResult=function(e,t,n){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=j(t.errors)?t.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=T.ready,"string"==typeof n&&this.store[n]&&(this.store[n].networkStatus=T.ready))},e.prototype.markQueryError=function(e,t,n){this.store&&this.store[e]&&(this.store[e].networkError=t,this.store[e].networkStatus=T.error,"string"==typeof n&&this.markQueryResultClient(n,!0))},e.prototype.markQueryResultClient=function(e,t){var n=this.store&&this.store[e];n&&(n.networkError=null,n.previousVariables=null,t&&(n.networkStatus=T.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var t=this;Object.keys(this.store).forEach((function(n){e.indexOf(n)<0?t.stopQuery(n):t.store[n].networkStatus=T.loading}))},e}();var z=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Object(c.A)(t.resolvers,e)})):this.resolvers=Object(c.A)(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return Object(u.b)(this,void 0,void 0,(function(){return Object(u.d)(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,a).then((function(e){return Object(u.a)({},n,{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Object(c.s)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return this.resolvers?Object(c.C)(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return Object(u.a)({},e,{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);Object(m.b)(!1,6)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),Object(u.b)(this,void 0,void 0,(function(){return Object(u.d)(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return Object(u.a)({},t,e.exportedVariables)}))]:[2,Object(u.a)({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Object(C.b)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return C.a}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Object(c.d)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,i,o){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),Object(u.b)(this,void 0,void 0,(function(){var a,l,s,f,d,p,m,h,v;return Object(u.d)(this,(function(y){var b;return a=Object(c.l)(e),l=Object(c.j)(e),s=Object(c.g)(l),f=a.operation,d=f?(b=f).charAt(0).toUpperCase()+b.slice(1):"Query",m=(p=this).cache,h=p.client,v={fragmentMap:s,context:Object(u.a)({},n,{cache:m,client:h}),variables:r,fragmentMatcher:i,defaultOperationType:d,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,t,v).then((function(e){return{result:e,exportedVariables:v.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n){return Object(u.b)(this,void 0,void 0,(function(){var r,i,o,a,l,s=this;return Object(u.d)(this,(function(f){return r=n.fragmentMap,i=n.context,o=n.variables,a=[t],l=function(e){return Object(u.b)(s,void 0,void 0,(function(){var l,s;return Object(u.d)(this,(function(u){return Object(c.F)(e,o)?Object(c.t)(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&a.push(((n={})[Object(c.E)(e)]=t,n))}))]:(Object(c.v)(e)?l=e:(l=r[e.name.value],Object(m.b)(l,7)),l&&l.typeCondition&&(s=l.typeCondition.name.value,n.fragmentMatcher(t,s,i))?[2,this.resolveSelectionSet(l.selectionSet,t,n).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(l)).then((function(){return Object(c.B)(a)}))]}))}))},e.prototype.resolveField=function(e,t,n){return Object(u.b)(this,void 0,void 0,(function(){var r,i,o,a,l,s,f,d,p,m=this;return Object(u.d)(this,(function(u){return r=n.variables,i=e.name.value,o=Object(c.E)(e),a=i!==o,l=t[o]||t[i],s=Promise.resolve(l),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(f=t.__typename||n.defaultOperationType,(d=this.resolvers&&this.resolvers[f])&&(p=d[a?i:o])&&(s=Promise.resolve(p(t,Object(c.b)(e,r),n.context,{field:e})))),[2,s.then((function(t){return void 0===t&&(t=l),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?m.resolveSubSelectedArray(e,t,n):e.selectionSet?m.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},e}();function Q(e){var t=new Set,n=null;return new N((function(r){return t.add(r),n=n||e.subscribe({next:function(e){t.forEach((function(t){return t.next&&t.next(e)}))},error:function(e){t.forEach((function(t){return t.error&&t.error(e)}))},complete:function(){t.forEach((function(e){return e.complete&&e.complete()}))}}),function(){t.delete(r)&&!t.size&&n&&(n.unsubscribe(),n=null)}}))}var V=Object.prototype.hasOwnProperty,U=function(){function e(e){var t=e.link,n=e.queryDeduplication,r=void 0!==n&&n,i=e.store,o=e.onBroadcast,a=void 0===o?function(){}:o,l=e.ssrMode,s=void 0!==l&&l,u=e.clientAwareness,f=void 0===u?{}:u,d=e.localState,p=e.assumeImmutableResults;this.mutationStore=new L,this.queryStore=new q,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(c.e?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=t,this.queryDeduplication=r,this.dataStore=i,this.onBroadcast=a,this.clientAwareness=f,this.localState=d||new z({cache:i.getCache()}),this.ssrMode=s,this.assumeImmutableResults=!!p}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.fetchQueryRejectFns.forEach((function(e){e(new m.a(8))}))},e.prototype.mutate=function(e){var t=e.mutation,n=e.variables,r=e.optimisticResponse,i=e.updateQueries,o=e.refetchQueries,a=void 0===o?[]:o,l=e.awaitRefetchQueries,s=void 0!==l&&l,f=e.update,d=e.errorPolicy,p=void 0===d?"none":d,h=e.fetchPolicy,v=e.context,y=void 0===v?{}:v;return Object(u.b)(this,void 0,void 0,(function(){var e,o,l,d=this;return Object(u.d)(this,(function(v){switch(v.label){case 0:return Object(m.b)(t,9),Object(m.b)(!h||"no-cache"===h,10),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,(function(){return{document:t}})),n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,y)]:[3,2];case 1:n=v.sent(),v.label=2;case 2:return o=function(){var e={};return i&&d.queries.forEach((function(t,n){var r=t.observableQuery;if(r){var o=r.queryName;o&&V.call(i,o)&&(e[n]={updater:i[o],query:d.queryStore.get(n)})}})),e},this.mutationStore.initMutation(e,t,n),this.dataStore.markMutationInit({mutationId:e,document:t,variables:n,updateQueries:o(),update:f,optimisticResponse:r}),this.broadcastQueries(),l=this,[2,new Promise((function(i,d){var m,v;l.getObservableFromLink(t,Object(u.a)({},y,{optimisticResponse:r}),n,!1).subscribe({next:function(r){Object(c.q)(r)&&"none"===p?v=new D({graphQLErrors:r.errors}):(l.mutationStore.markMutationResult(e),"no-cache"!==h&&l.dataStore.markMutationResult({mutationId:e,result:r,document:t,variables:n,updateQueries:o(),update:f}),m=r)},error:function(t){l.mutationStore.markMutationError(e,t),l.dataStore.markMutationComplete({mutationId:e,optimisticResponse:r}),l.broadcastQueries(),l.setQuery(e,(function(){return{document:null}})),d(new D({networkError:t}))},complete:function(){if(v&&l.mutationStore.markMutationError(e,v),l.dataStore.markMutationComplete({mutationId:e,optimisticResponse:r}),l.broadcastQueries(),v)d(v);else{"function"==typeof a&&(a=a(m));var t=[];j(a)&&a.forEach((function(e){if("string"==typeof e)l.queries.forEach((function(n){var r=n.observableQuery;r&&r.queryName===e&&t.push(r.refetch())}));else{var n={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(n.context=e.context),t.push(l.query(n))}})),Promise.all(s?t:[]).then((function(){l.setQuery(e,(function(){return{document:null}})),"ignore"===p&&m&&Object(c.q)(m)&&delete m.errors,i(m)}))}}})}))]}}))}))},e.prototype.fetchQuery=function(e,t,n,r){return Object(u.b)(this,void 0,void 0,(function(){var i,o,a,l,s,f,d,p,m,h,v,y,b,g,w,x,k,E,S=this;return Object(u.d)(this,(function(T){switch(T.label){case 0:return i=t.metadata,o=void 0===i?null:i,a=t.fetchPolicy,l=void 0===a?"cache-first":a,s=t.context,f=void 0===s?{}:s,d=this.transform(t.query).document,p=this.getVariables(d,t.variables),this.transform(d).hasClientExports?[4,this.localState.addExportedVariables(d,p,f)]:[3,2];case 1:p=T.sent(),T.label=2;case 2:if(t=Object(u.a)({},t,{variables:p}),v=h="network-only"===l||"no-cache"===l,h||(y=this.dataStore.getCache().diff({query:d,variables:p,returnPartialData:!0,optimistic:!1}),b=y.complete,g=y.result,v=!b||"cache-and-network"===l,m=g),w=v&&"cache-only"!==l&&"standby"!==l,Object(c.s)(["live"],d)&&(w=!0),x=this.idCounter++,k="no-cache"!==l?this.updateQueryWatch(e,d,t):void 0,this.setQuery(e,(function(){return{document:d,lastRequestId:x,invalidated:!0,cancel:k}})),this.invalidate(r),this.queryStore.initQuery({queryId:e,document:d,storePreviousVariables:w,variables:p,isPoll:n===I.poll,isRefetch:n===I.refetch,metadata:o,fetchMoreForQueryId:r}),this.broadcastQueries(),w){if(E=this.fetchRequest({requestId:x,queryId:e,document:d,options:t,fetchMoreForQueryId:r}).catch((function(t){throw t.hasOwnProperty("graphQLErrors")?t:(x>=S.getQuery(e).lastRequestId&&(S.queryStore.markQueryError(e,t,r),S.invalidate(e),S.invalidate(r),S.broadcastQueries()),new D({networkError:t}))})),"cache-and-network"!==l)return[2,E];E.catch((function(){}))}return this.queryStore.markQueryResultClient(e,!w),this.invalidate(e),this.invalidate(r),this.transform(d).hasForcedResolvers?[2,this.localState.runResolvers({document:d,remoteResult:{data:m},context:f,variables:p,onlyRunForcedResolvers:!0}).then((function(n){return S.markQueryResult(e,n,t,r),S.broadcastQueries(),n}))]:(this.broadcastQueries(),[2,{data:m}])}}))}))},e.prototype.markQueryResult=function(e,t,n,r){var i=n.fetchPolicy,o=n.variables,a=n.errorPolicy;"no-cache"===i?this.setQuery(e,(function(){return{newData:{result:t.data,complete:!0}}})):this.dataStore.markQueryResult(t,this.getQuery(e).document,o,r,"ignore"===a||"all"===a)},e.prototype.queryListenerForObserver=function(e,t,n){var r=this;function i(e,t){if(n[e])try{n[e](t)}catch(e){}}return function(n,o){if(r.invalidate(e,!1),n){var a=r.getQuery(e),l=a.observableQuery,s=a.document,u=l?l.options.fetchPolicy:t.fetchPolicy;if("standby"!==u){var c=_(n.networkStatus),f=l&&l.getLastResult(),d=!(!f||f.networkStatus===n.networkStatus),p=t.returnPartialData||!o&&n.previousVariables||d&&t.notifyOnNetworkStatusChange||"cache-only"===u||"cache-and-network"===u;if(!c||p){var m=j(n.graphQLErrors),h=l&&l.options.errorPolicy||t.errorPolicy||"none";if("none"===h&&m||n.networkError)return i("error",new D({graphQLErrors:n.graphQLErrors,networkError:n.networkError}));try{var v=void 0,y=void 0;if(o)"no-cache"!==u&&"network-only"!==u&&r.setQuery(e,(function(){return{newData:null}})),v=o.result,y=!o.complete;else{var b=l&&l.getLastError(),g="none"!==h&&(b&&b.graphQLErrors)!==n.graphQLErrors;if(f&&f.data&&!g)v=f.data,y=!1;else{var w=r.dataStore.getCache().diff({query:s,variables:n.previousVariables||n.variables,returnPartialData:!0,optimistic:!0});v=w.result,y=!w.complete}}var x=y&&!(t.returnPartialData||"cache-only"===u),k={data:x?f&&f.data:v,loading:c,networkStatus:n.networkStatus,stale:x};"all"===h&&m&&(k.errors=n.graphQLErrors),i("next",k)}catch(e){i("error",new D({networkError:e}))}}}}}},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.dataStore.getCache(),r=n.transformDocument(e),i=Object(c.D)(n.transformForLink(r)),o=this.localState.clientQuery(r),a=this.localState.serverQuery(i),l={document:r,hasClientExports:Object(c.r)(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:o,serverQuery:a,defaultVars:Object(c.h)(Object(c.m)(r))},s=function(e){e&&!t.has(e)&&t.set(e,l)};s(e),s(r),s(o),s(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return Object(u.a)({},this.transform(e).defaultVars,t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),Object(m.b)("standby"!==e.fetchPolicy,11),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var n=Object(u.a)({},e);return new R({queryManager:this,options:n,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return Object(m.b)(e.query,12),Object(m.b)("Document"===e.query.kind,13),Object(m.b)(!e.returnPartialData,14),Object(m.b)(!e.pollInterval,15),new Promise((function(n,r){var i=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+i.queryId,r),i.result().then(n,r).then((function(){return t.fetchQueryRejectFns.delete("query:"+i.queryId)}))}))},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,(function(e){return e.listeners.add(t),{invalidated:!1}}))},e.prototype.updateQueryWatch=function(e,t,n){var r=this,i=this.getQuery(e).cancel;i&&i();return this.dataStore.getCache().watch({query:t,variables:n.variables,optimistic:!0,previousResult:function(){var t=null,n=r.getQuery(e).observableQuery;if(n){var i=n.getLastResult();i&&(t=i.data)}return t},callback:function(t){r.setQuery(e,(function(){return{invalidated:!0,newData:t}}))}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,(function(){return{observableQuery:t}}))},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,(function(){return{observableQuery:null}})),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach((function(e){e(new m.a(16))}));var e=[];return this.queries.forEach((function(t,n){t.observableQuery&&e.push(n)})),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then((function(){return e.reFetchObservableQueries()}))},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.queries.forEach((function(r,i){var o=r.observableQuery;if(o){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!e&&"standby"===a||n.push(o.refetch()),t.setQuery(i,(function(){return{newData:null}})),t.invalidate(i)}})),this.broadcastQueries(),Promise.all(n)},e.prototype.observeQuery=function(e,t,n){return this.addQueryListener(e,this.queryListenerForObserver(e,t,n)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,n){return this.addQueryListener(e,n),this.fetchQuery(e,t).catch((function(){})),e},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.variables;n=this.transform(n).document,i=this.getVariables(n,i);var o=function(e){return t.getObservableFromLink(n,{},e,!1).map((function(i){if(r&&"no-cache"===r||(t.dataStore.markSubscriptionResult(i,n,e),t.broadcastQueries()),Object(c.q)(i))throw new D({graphQLErrors:i.errors});return i}))};if(this.transform(n).hasClientExports){var a=this.localState.addExportedVariables(n,i).then(o);return new N((function(e){var t=null;return a.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return o(i)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach((function(e){return e.unsubscribe()})),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var n=e.options,r=n.variables,i=n.query,o=n.fetchPolicy,a=n.returnPartialData,l=e.getLastResult(),s=this.getQuery(e.queryId).newData;if(s&&s.complete)return{data:s.result,partial:!1};if("no-cache"===o||"network-only"===o)return{data:void 0,partial:!1};var u=this.dataStore.getCache().diff({query:i,variables:r,previousResult:l?l.data:void 0,returnPartialData:!0,optimistic:t}),c=u.result,f=u.complete;return{data:f||a?c:void 0,partial:!f}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var n=this.getQuery(e).observableQuery;Object(m.b)(n,17),t=n}else t=e;var r=t.options,i=r.variables,o=r.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:i,document:o}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach((function(t,n){t.invalidated&&t.listeners.forEach((function(r){r&&r(e.queryStore.get(n),t.newData)}))}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var i,o=this;void 0===r&&(r=this.queryDeduplication);var a=this.transform(e).serverQuery;if(a){var l=this.inFlightLinkObservables,s=this.link,f={query:a,variables:n,operationName:Object(c.n)(a)||void 0,context:this.prepareContext(Object(u.a)({},t,{forceFetch:!r}))};if(t=f.context,r){var d=l.get(a)||new Map;l.set(a,d);var p=JSON.stringify(n);if(!(i=d.get(p))){d.set(p,i=Q(S(s,f)));var m=function(){d.delete(p),d.size||l.delete(a),h.unsubscribe()},h=i.subscribe({next:m,error:m,complete:m})}}else i=Q(S(s,f))}else i=N.of({data:{}}),t=this.prepareContext(t);var v=this.transform(e).clientQuery;return v&&(i=function(e,t){return new N((function(n){var r=n.next,i=n.error,o=n.complete,a=0,l=!1,s={next:function(e){++a,new Promise((function(n){n(t(e))})).then((function(e){--a,r&&r.call(n,e),l&&s.complete()}),(function(e){--a,i&&i.call(n,e)}))},error:function(e){i&&i.call(n,e)},complete:function(){l=!0,a||o&&o.call(n)}},u=e.subscribe(s);return function(){return u.unsubscribe()}}))}(i,(function(e){return o.localState.runResolvers({document:v,remoteResult:e,context:t,variables:n})}))),i},e.prototype.fetchRequest=function(e){var t,n,r=this,i=e.requestId,o=e.queryId,a=e.document,l=e.options,s=e.fetchMoreForQueryId,u=l.variables,c=l.errorPolicy,f=void 0===c?"none":c,d=l.fetchPolicy;return new Promise((function(e,c){var p=r.getObservableFromLink(a,l.context,u),m="fetchRequest:"+o;r.fetchQueryRejectFns.set(m,c);var h=function(){r.fetchQueryRejectFns.delete(m),r.setQuery(o,(function(e){e.subscriptions.delete(v)}))},v=p.map((function(e){if(i>=r.getQuery(o).lastRequestId&&(r.markQueryResult(o,e,l,s),r.queryStore.markQueryResult(o,e,s),r.invalidate(o),r.invalidate(s),r.broadcastQueries()),"none"===f&&j(e.errors))return c(new D({graphQLErrors:e.errors}));if("all"===f&&(n=e.errors),s||"no-cache"===d)t=e.data;else{var p=r.dataStore.getCache().diff({variables:u,query:a,optimistic:!1,returnPartialData:!0}),m=p.result;(p.complete||l.returnPartialData)&&(t=m)}})).subscribe({error:function(e){h(),c(e)},complete:function(){h(),e({data:t,errors:n,loading:!1,networkStatus:T.ready,stale:!1})}});r.setQuery(o,(function(e){e.subscriptions.add(v)}))}))},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var n=this.getQuery(e),r=Object(u.a)({},n,t(n));this.queries.set(e,r)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,(function(){return{invalidated:t}}))},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return Object(u.a)({},t,{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var t=this.queryStore.get(e);return t&&t.networkStatus!==T.ready&&t.networkStatus!==T.error},e.prototype.startPollingQuery=function(e,t,n){var r=this,i=e.pollInterval;if(Object(m.b)(i,18),!this.ssrMode){var o=this.pollingInfoByQueryId.get(t);o||this.pollingInfoByQueryId.set(t,o={}),o.interval=i,o.options=Object(u.a)({},e,{fetchPolicy:"network-only"});var a=function(){var e=r.pollingInfoByQueryId.get(t);e&&(r.checkInFlight(t)?l():r.fetchQuery(t,e.options,I.poll).then(l,l))},l=function(){var e=r.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(a,e.interval))};n&&this.addQueryListener(t,n),l()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),B=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,n,r,i){void 0===i&&(i=!1);var o=!Object(c.q)(e);i&&Object(c.q)(e)&&e.data&&(o=!0),!r&&o&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:n})},e.prototype.markSubscriptionResult=function(e,t,n){Object(c.q)(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:n})},e.prototype.markMutationInit=function(e){var t,n=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction((function(r){var i=n.cache;n.cache=r;try{n.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{n.cache=i}}),e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!Object(c.q)(e.result)){var n=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],r=e.updateQueries;r&&Object.keys(r).forEach((function(i){var o=r[i],a=o.query,l=o.updater,s=t.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),u=s.result;if(s.complete){var f=Object(c.I)((function(){return l(u,{mutationResult:e.result,queryName:Object(c.n)(a.document)||void 0,queryVariables:a.variables})}));f&&n.push({result:f,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}})),this.cache.performTransaction((function(t){n.forEach((function(e){return t.write(e)}));var r=e.update;r&&Object(c.I)((function(){return r(t,e.result)}))}))}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,n){this.cache.write({result:n,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),G="2.6.4",K=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.cache,r=e.ssrMode,i=void 0!==r&&r,o=e.ssrForceFetchDelay,a=void 0===o?0:o,l=e.connectToDevTools,s=e.queryDeduplication,u=void 0===s||s,c=e.defaultOptions,f=e.assumeImmutableResults,d=void 0!==f&&f,p=e.resolvers,h=e.typeDefs,v=e.fragmentMatcher,y=e.name,b=e.version,g=e.link;if(!g&&p&&(g=E.empty()),!g||!n)throw new m.a(1);this.link=g,this.cache=n,this.store=new B(n),this.disableNetworkFetches=i||a>0,this.queryDeduplication=u,this.defaultOptions=c||{},this.typeDefs=h,a&&setTimeout((function(){return t.disableNetworkFetches=!1}),a),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this);void 0!==l&&(l&&"undefined"!=typeof window)&&(window.__APOLLO_CLIENT__=this),this.version=G,this.localState=new z({cache:n,client:this,resolvers:p,fragmentMatcher:v}),this.queryManager=new U({link:this.link,store:this.store,queryDeduplication:u,ssrMode:i,clientAwareness:{name:y,version:b},localState:this.localState,assumeImmutableResults:d,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Object(u.a)({},this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=Object(u.a)({},e,{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Object(u.a)({},this.defaultOptions.query,e)),Object(m.b)("cache-and-network"!==e.fetchPolicy,2),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=Object(u.a)({},e,{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Object(u.a)({},this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return S(this.link,e)},e.prototype.initQueryManager=function(){return this.queryManager},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e}();function W(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:H(e)}]}}function H(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return null;if(Array.isArray(e))return H(e[0]);var t=[];return Object.keys(e).forEach((function(n){var r={kind:"Field",name:{kind:"Name",value:n},selectionSet:H(e[n])||void 0};t.push(r)})),{kind:"SelectionSet",selections:t}}var Y,$={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},J=function(){function e(){}return e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.read({query:Object(c.k)(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,optimistic:t})},e.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},e.prototype.writeFragment=function(e){this.write({dataId:e.id,result:e.data,variables:e.variables,query:Object(c.k)(e.fragment,e.fragmentName)})},e.prototype.writeData=function(e){var t,n,r=e.id,i=e.data;if(void 0!==r){var o=null;try{o=this.read({rootId:r,optimistic:!1,query:$})}catch(e){}var a=o&&o.__typename||"__ClientData",l=Object.assign({__typename:a},i);this.writeFragment({id:r,fragment:(t=l,n=a,{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:n||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:H(t)}]}),data:l})}else this.writeQuery({query:W(i),data:i})},e}();Y||(Y={});var X=null,Z={},ee=1,te=Array,ne=te["@wry/context:Slot"]||function(){var e=function(){function e(){this.id=["slot",ee++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=X;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Z)break;return e!==X&&(X.slots[this.id]=t),!0}return X&&(X.slots[this.id]=Z),!1},e.prototype.getValue=function(){if(this.hasValue())return X.slots[this.id]},e.prototype.withValue=function(e,t,n,r){var i,o=((i={__proto__:null})[this.id]=e,i),a=X;X={parent:a,slots:o};try{return t.apply(r,n)}finally{X=a}},e.bind=function(e){var t=X;return function(){var n=X;try{return X=t,e.apply(this,arguments)}finally{X=n}}},e.noContext=function(e,t,n){if(!X)return e.apply(n,t);var r=X;try{return X=null,e.apply(n,t)}finally{X=r}},e}();try{Object.defineProperty(te,"@wry/context:Slot",{value:te["@wry/context:Slot"]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();ne.bind,ne.noContext;function re(){}var ie=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=re),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getEntry(e);return t&&t.value},e.prototype.getEntry=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getEntry(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),oe=new ne,ae=[],le=[],se=100;function ue(e,t){if(!e)throw new Error(t||"assertion failure")}function ce(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var fe=function(){function e(t,n){this.fn=t,this.args=n,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],++e.count}return e.prototype.recompute=function(){if(ue(!this.recomputing,"already recomputing"),function(e){var t=oe.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),pe(e)?ve(t,e):ye(t,e),t}(this)||!ge(this))return pe(this)?function(e){var t=we(e);oe.withValue(e,de,[e]),function(e){if("function"==typeof e.subscribe)try{ke(e),e.unsubscribe=e.subscribe.apply(null,e.args)}catch(t){return e.setDirty(),!1}return!0}(e)&&function(e){if(e.dirty=!1,pe(e))return;he(e)}(e);return t.forEach(ge),ce(e.value)}(this):ce(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,me(this),ke(this))},e.prototype.dispose=function(){var e=this;we(this).forEach(ge),ke(this),this.parents.forEach((function(t){t.setDirty(),xe(t,e)}))},e.count=0,e}();function de(e){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,e.args)}catch(t){e.value[1]=t}e.recomputing=!1}function pe(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function me(e){e.parents.forEach((function(t){return ve(t,e)}))}function he(e){e.parents.forEach((function(t){return ye(t,e)}))}function ve(e,t){if(ue(e.childValues.has(t)),ue(pe(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=le.pop()||new Set;e.dirtyChildren.add(t),me(e)}function ye(e,t){ue(e.childValues.has(t)),ue(!pe(t));var n,r,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(n=o,r=t.value,(i=n.length)>0&&i===r.length&&n[i-1]===r[i-1]||e.setDirty()),be(e,t),pe(e)||he(e)}function be(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(le.length0&&(t=[],e.childValues.forEach((function(n,r){xe(e,r),t.push(r)}))),ue(null===e.dirtyChildren),t}function xe(e,t){t.parents.delete(e),e.childValues.delete(t),be(e,t)}function ke(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Ee=function(){function e(e){this.weakness=e}return e.prototype.lookup=function(){for(var e=[],t=0;t-1)},e.prototype.parseIntrospectionResult=function(e){var t={};return e.__schema.types.forEach((function(e){"UNION"!==e.kind&&"INTERFACE"!==e.kind||(t[e.name]=e.possibleTypes.map((function(e){return e.name})))})),t}}(),Object.prototype.hasOwnProperty),Pe=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=Ce((function(e){return t.data[e]}),{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){Ie.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach((function(n){t.set(n,e[n])})),Object.keys(this.data).forEach((function(n){Ie.call(e,n)||t.delete(n)}))):Object.keys(this.data).forEach((function(e){t.delete(e)}))},e}();function De(e){return new Pe(e)}var Re=function(){function e(e){var t=this,n=void 0===e?{}:e,r=n.cacheKeyRoot,i=void 0===r?new Ee(c.e):r,o=n.freezeResults,a=void 0!==o&&o,l=this.executeStoreQuery,s=this.executeSelectionSet,u=this.executeSubSelectedArray;this.freezeResults=a,this.executeStoreQuery=Ce((function(e){return l.call(t,e)}),{makeCacheKey:function(e){var t=e.query,n=e.rootValue,r=e.contextValue,o=e.variableValues,a=e.fragmentMatcher;if(r.store instanceof Pe)return i.lookup(r.store,t,a,JSON.stringify(o),n.id)}}),this.executeSelectionSet=Ce((function(e){return s.call(t,e)}),{makeCacheKey:function(e){var t=e.selectionSet,n=e.rootValue,r=e.execContext;if(r.contextValue.store instanceof Pe)return i.lookup(r.contextValue.store,t,r.fragmentMatcher,JSON.stringify(r.variableValues),n.id)}}),this.executeSubSelectedArray=Ce((function(e){return u.call(t,e)}),{makeCacheKey:function(e){var t=e.field,n=e.array,r=e.execContext;if(r.contextValue.store instanceof Pe)return i.lookup(r.contextValue.store,t,n,JSON.stringify(r.variableValues))}})}return e.prototype.readQueryFromStore=function(e){return this.diffQueryAgainstStore(Object(u.a)({},e,{returnPartialData:!1})).result},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.variables,i=e.previousResult,o=e.returnPartialData,a=void 0===o||o,l=e.rootId,s=void 0===l?"ROOT_QUERY":l,u=e.fragmentMatcherFunction,d=e.config,p=Object(c.o)(n);r=Object(c.c)({},Object(c.h)(p),r);var h={store:t,dataIdFromObject:d&&d.dataIdFromObject,cacheRedirects:d&&d.cacheRedirects||{}},v=this.executeStoreQuery({query:n,rootValue:{type:"id",id:s,generated:!0,typename:"Query"},contextValue:h,variableValues:r,fragmentMatcher:u}),y=v.missing&&v.missing.length>0;return y&&!a&&v.missing.forEach((function(e){if(!e.tolerable)throw new m.a(8)})),i&&Object(f.a)(i,v.result)&&(v.result=i),{result:v.result,complete:!y}},e.prototype.executeStoreQuery=function(e){var t=e.query,n=e.rootValue,r=e.contextValue,i=e.variableValues,o=e.fragmentMatcher,a=void 0===o?Fe:o,l=Object(c.l)(t),s=Object(c.j)(t),u={query:t,fragmentMap:Object(c.g)(s),contextValue:r,variableValues:i,fragmentMatcher:a};return this.executeSelectionSet({selectionSet:l.selectionSet,rootValue:n,execContext:u})},e.prototype.executeSelectionSet=function(e){var t=this,n=e.selectionSet,r=e.rootValue,i=e.execContext,o=i.fragmentMap,a=i.contextValue,l=i.variableValues,s={result:null},f=[],d=a.store.get(r.id),p=d&&d.__typename||"ROOT_QUERY"===r.id&&"Query"||void 0;function h(e){var t;return e.missing&&(s.missing=s.missing||[],(t=s.missing).push.apply(t,e.missing)),e.result}return n.selections.forEach((function(e){var n;if(Object(c.F)(e,l))if(Object(c.t)(e)){var s=h(t.executeField(d,p,e,i));void 0!==s&&f.push(((n={})[Object(c.E)(e)]=s,n))}else{var v=void 0;if(Object(c.v)(e))v=e;else if(!(v=o[e.name.value]))throw new m.a(9);var y=v.typeCondition&&v.typeCondition.name.value,b=!y||i.fragmentMatcher(r,y,a);if(b){var g=t.executeSelectionSet({selectionSet:v.selectionSet,rootValue:r,execContext:i});"heuristic"===b&&g.missing&&(g=Object(u.a)({},g,{missing:g.missing.map((function(e){return Object(u.a)({},e,{tolerable:!0})}))})),f.push(h(g))}}})),s.result=Object(c.B)(f),this.freezeResults,s},e.prototype.executeField=function(e,t,n,r){var i=r.variableValues,o=r.contextValue,a=function(e,t,n,r,i,o){o.resultKey;var a=o.directives,l=n;(r||a)&&(l=Object(c.p)(l,r,a));var s=void 0;if(e&&void 0===(s=e[l])&&i.cacheRedirects&&"string"==typeof t){var u=i.cacheRedirects[t];if(u){var f=u[n];f&&(s=f(e,r,{getCacheKey:function(e){var t=i.dataIdFromObject(e);return t&&Object(c.H)({id:t,typename:e.__typename})}}))}}if(void 0===s)return{result:s,missing:[{object:e,fieldName:l,tolerable:!1}]};Object(c.w)(s)&&(s=s.json);return{result:s}}(e,t,n.name.value,Object(c.b)(n,i),o,{resultKey:Object(c.E)(n),directives:Object(c.i)(n,i)});return Array.isArray(a.result)?this.combineExecResults(a,this.executeSubSelectedArray({field:n,array:a.result,execContext:r})):n.selectionSet?null==a.result?a:this.combineExecResults(a,this.executeSelectionSet({selectionSet:n.selectionSet,rootValue:a.result,execContext:r})):(Ae(n,a.result),this.freezeResults,a)},e.prototype.combineExecResults=function(){for(var e,t=[],n=0;n=0)return!0;n[e].push(t)}else n[e]=[t];return!1}var Ve={fragmentMatcher:new je,dataIdFromObject:function(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null},addTypename:!0,resultCaching:!0,freezeResults:!1};var Ue=Object.prototype.hasOwnProperty,Be=function(e){function t(t,n,r){var i=e.call(this,Object.create(null))||this;return i.optimisticId=t,i.parent=n,i.transaction=r,i}return Object(u.c)(t,e),t.prototype.toObject=function(){return Object(u.a)({},this.parent.toObject(),this.data)},t.prototype.get=function(e){return Ue.call(this.data,e)?this.data[e]:this.parent.get(e)},t}(Me),Ge=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;n.watches=new Set,n.typenameDocumentCache=new Map,n.cacheKeyRoot=new Ee(c.e),n.silenceBroadcast=!1,n.config=Object(u.a)({},Ve,t),n.config.customResolvers&&(n.config.cacheRedirects=n.config.customResolvers),n.config.cacheResolvers&&(n.config.cacheRedirects=n.config.cacheResolvers),n.addTypename=!!n.config.addTypename,n.data=n.config.resultCaching?new Pe:new Me,n.optimisticData=n.data,n.storeWriter=new qe,n.storeReader=new Re({cacheKeyRoot:n.cacheKeyRoot,freezeResults:t.freezeResults});var r=n,i=r.maybeBroadcastWatch;return n.maybeBroadcastWatch=Ce((function(e){return i.call(n,e)}),{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return r.data instanceof Pe?r.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),n}return Object(u.c)(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},t.prototype.read=function(e){if("string"==typeof e.rootId&&void 0===this.data.get(e.rootId))return null;var t=this.config.fragmentMatcher,n=t&&t.match;return this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:n,previousResult:e.previousResult,config:this.config})||null},t.prototype.write=function(e){var t=this.config.fragmentMatcher,n=t&&t.match;this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:n}),this.broadcastWatches()},t.prototype.diff=function(e){var t=this.config.fragmentMatcher,n=t&&t.match;return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:n,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},t.prototype.evict=function(e){throw new m.a(1)},t.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){for(var t=[],n=0,r=this.optimisticData;r instanceof Be;)r.optimisticId===e?++n:t.push(r),r=r.parent;if(n>0){for(this.optimisticData=r;t.length>0;){var i=t.pop();this.performTransaction(i.transaction,i.optimisticId)}this.broadcastWatches()}},t.prototype.performTransaction=function(e,t){var n=this.data,r=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new Be(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=r,this.data=n}this.broadcastWatches()},t.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=Object(c.a)(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach((function(t){return e.maybeBroadcastWatch(t)}))},t.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},t}(J),Ke=n(8);function We(e){return Object(C.b)(e,{leave:He})}var He={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return $e(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=Xe("(",$e(e.variableDefinitions,", "),")"),i=$e(e.directives," "),o=e.selectionSet;return n||i||r||"query"!==t?$e([t,$e([n,r]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+Xe(" = ",r)+Xe(" ",$e(i," "))},SelectionSet:function(e){return Je(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,o=e.selectionSet;return $e([Xe("",t,": ")+n+Xe("(",$e(r,", "),")"),$e(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+Xe(" ",$e(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return $e(["...",Xe("on ",t),$e(n," "),r]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,i=e.directives,o=e.selectionSet;return("fragment ".concat(t).concat(Xe("(",$e(r,", "),")")," ")+"on ".concat(n," ").concat(Xe("",$e(i," ")," "))+o)},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?Object(Ke.b)(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+$e(e.values,", ")+"]"},ObjectValue:function(e){return"{"+$e(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+Xe("(",$e(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:function(e){var t=e.directives,n=e.operationTypes;return $e(["schema",$e(t," "),Je(n)]," ")},OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:Ye((function(e){return $e(["scalar",e.name,$e(e.directives," ")]," ")})),ObjectTypeDefinition:Ye((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return $e(["type",t,Xe("implements ",$e(n," & ")),$e(r," "),Je(i)]," ")})),FieldDefinition:Ye((function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(tt(n)?Xe("(\n",Ze($e(n,"\n")),"\n)"):Xe("(",$e(n,", "),")"))+": "+r+Xe(" ",$e(i," "))})),InputValueDefinition:Ye((function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return $e([t+": "+n,Xe("= ",r),$e(i," ")]," ")})),InterfaceTypeDefinition:Ye((function(e){var t=e.name,n=e.directives,r=e.fields;return $e(["interface",t,$e(n," "),Je(r)]," ")})),UnionTypeDefinition:Ye((function(e){var t=e.name,n=e.directives,r=e.types;return $e(["union",t,$e(n," "),r&&0!==r.length?"= "+$e(r," | "):""]," ")})),EnumTypeDefinition:Ye((function(e){var t=e.name,n=e.directives,r=e.values;return $e(["enum",t,$e(n," "),Je(r)]," ")})),EnumValueDefinition:Ye((function(e){return $e([e.name,$e(e.directives," ")]," ")})),InputObjectTypeDefinition:Ye((function(e){var t=e.name,n=e.directives,r=e.fields;return $e(["input",t,$e(n," "),Je(r)]," ")})),DirectiveDefinition:Ye((function(e){var t=e.name,n=e.arguments,r=e.repeatable,i=e.locations;return"directive @"+t+(tt(n)?Xe("(\n",Ze($e(n,"\n")),"\n)"):Xe("(",$e(n,", "),")"))+(r?" repeatable":"")+" on "+$e(i," | ")})),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return $e(["extend schema",$e(t," "),Je(n)]," ")},ScalarTypeExtension:function(e){return $e(["extend scalar",e.name,$e(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return $e(["extend type",t,Xe("implements ",$e(n," & ")),$e(r," "),Je(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return $e(["extend interface",t,$e(n," "),Je(r)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return $e(["extend union",t,$e(n," "),r&&0!==r.length?"= "+$e(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return $e(["extend enum",t,$e(n," "),Je(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return $e(["extend input",t,$e(n," "),Je(r)]," ")}};function Ye(e){return function(t){return $e([t.description,e(t)],"\n")}}function $e(e,t){return e?e.filter((function(e){return e})).join(t||""):""}function Je(e){return e&&0!==e.length?"{\n"+Ze($e(e,"\n"))+"\n}":""}function Xe(e,t,n){return t?e+t+(n||""):""}function Ze(e){return e&&" "+e.replace(/\n/g,"\n ")}function et(e){return-1!==e.indexOf("\n")}function tt(e){return e&&e.some(et)}var nt={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},rt=function(e,t,n){var r=new Error(n);throw r.name="ServerError",r.response=e,r.statusCode=e.status,r.result=t,r},it=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=new m.a(2);throw r.parseError=e,r}return n},ot=function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,r=e.fetch,i=e.includeExtensions,o=e.useGETForQueries,a=Object(u.e)(e,["uri","fetch","includeExtensions","useGETForQueries"]);!function(e){if(!e&&"undefined"==typeof fetch){throw"undefined"==typeof window&&"node-fetch",new m.a(1)}}(r),r||(r=fetch);var l={http:{includeExtensions:i},options:a.fetchOptions,credentials:a.credentials,headers:a.headers};return new E((function(e){var t=function(e,t){var n=e.getContext().uri;return n||("function"==typeof t?t(e):t||"/graphql")}(e,n),i=e.getContext(),a={};if(i.clientAwareness){var s=i.clientAwareness,c=s.name,f=s.version;c&&(a["apollographql-client-name"]=c),f&&(a["apollographql-client-version"]=f)}var d,m=Object(u.a)({},a,i.headers),h={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:m},y=function(e,t){for(var n=[],r=2;r=300&&rt(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||t.hasOwnProperty("data")||t.hasOwnProperty("errors")||rt(e,t,"Server response was missing for query '"+(Array.isArray(i)?i.map((function(e){return e.operationName})):i.operationName)+"'."),t}))})).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){d&&d.abort()}}))}))};var at=function(e){function t(t){return e.call(this,ot(t).request)||this}return Object(u.c)(t,e),t}(E);function lt(e){return new E((function(t,n){return new p((function(r){var i,o,a;try{i=n(t).subscribe({next:function(i){i.errors&&(a=e({graphQLErrors:i.errors,response:i,operation:t,forward:n}))?o=a.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}):r.next(i)},error:function(i){(a=e({operation:t,networkError:i,graphQLErrors:i&&i.result&&i.result.errors,forward:n}))?o=a.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}):r.error(i)},complete:function(){a||r.complete.bind(r)()}})}catch(i){e({networkError:i,operation:t,forward:n}),r.error(i)}return function(){i&&i.unsubscribe(),o&&i.unsubscribe()}}))}))}!function(e){function t(t){var n=e.call(this)||this;return n.link=lt(t),n}Object(u.c)(t,e),t.prototype.request=function(e,t){return this.link.request(e,t)}}(E);var st=["request","uri","credentials","headers","fetch","fetchOptions","clientState","onError","cacheRedirects","cache","name","version","resolvers","typeDefs","fragmentMatcher"],ut=function(e){function t(t){void 0===t&&(t={});t&&Object.keys(t).filter((function(e){return-1===st.indexOf(e)})).length;var n=t.request,r=t.uri,i=t.credentials,o=t.headers,a=t.fetch,l=t.fetchOptions,s=t.clientState,u=t.cacheRedirects,c=t.onError,f=t.name,d=t.version,h=t.resolvers,v=t.typeDefs,y=t.fragmentMatcher,b=t.cache;Object(m.b)(!b||!u,1),b||(b=u?new Ge({cacheRedirects:u}):new Ge);var g=lt(c||function(e){var t=e.graphQLErrors;e.networkError;t&&t.map((function(e){e.message,e.locations,e.path;return!0}))}),w=!!n&&new E((function(e,t){return new p((function(r){var i;return Promise.resolve(e).then((function(e){return n(e)})).then((function(){i=t(e).subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)})})).catch(r.error.bind(r)),function(){i&&i.unsubscribe()}}))})),x=new at({uri:r||"/graphql",fetch:a,fetchOptions:l||{},credentials:i||"same-origin",headers:o||{}}),k=E.from([g,w,x].filter((function(e){return!!e}))),S=h,T=v,O=y;return s&&(s.defaults&&b.writeData({data:s.defaults}),S=s.resolvers,T=s.typeDefs,O=s.fragmentMatcher),e.call(this,{cache:b,link:k,name:f,version:d,resolvers:S,typeDefs:T,fragmentMatcher:O})||this}return Object(u.c)(t,e),t}(K),ct=n(24),ft=n.n(ct),dt=n(25),pt=n.n(dt),mt=n(6),ht=n.n(mt);n.d(t,"yetibotEval",(function(){return wt}));const vt=document.querySelector(".core-team");if(vt){const e=ht.a.createFactory(ft.a);pt.a.render(e({org:"yetibot",shouldShuffle:!1,columns:6}),vt)}const yt=new ut({uri:"https://public.yetibot.com/graphql"}),bt=document.querySelector(".toc.column .content");console.log(bt),bt&&(window.innerWidth>768&&a.a.init({tocSelector:".toc .content",contentSelector:".main-content",headingSelector:"h1, h2, h3, h4",positionFixedSelector:".toc.column .content",positionFixedClass:"fixed",fixedSidebarOffset:230,headingsOffset:-15}),bt.classList.add("ready"));const gt=s.a` + */var r,i,o,a,l;if(Object.defineProperty(t,"__esModule",{value:!0}),"undefined"==typeof window||"function"!=typeof MessageChannel){var s=null,u=null,c=function(){if(null!==s)try{var e=t.unstable_now();s(!0,e),s=null}catch(e){throw setTimeout(c,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==s?setTimeout(r,0,e):(s=e,setTimeout(c,0))},i=function(e,t){u=setTimeout(e,t)},o=function(){clearTimeout(u)},a=function(){return!1},l=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,p=window.Date,m=window.setTimeout,h=window.clearTimeout,v=window.requestAnimationFrame,y=window.cancelAnimationFrame;if("undefined"!=typeof console&&("function"!=typeof v&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof y&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")),"object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var b=p.now();t.unstable_now=function(){return p.now()-b}}var g=!1,w=null,x=-1,k=5,E=0;a=function(){return t.unstable_now()>=E},l=function(){},t.unstable_forceFrameRate=function(e){0>e||125N(a,n))void 0!==s&&0>N(s,a)?(e[r]=s,e[l]=n,r=l):(e[r]=a,e[o]=n,r=o);else{if(!(void 0!==s&&0>N(s,n)))break e;e[r]=s,e[l]=n,r=l}}}return t}return null}function N(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var j=[],I=[],P=1,D=null,R=3,A=!1,F=!1,M=!1;function L(e){for(var t=C(I);null!==t;){if(null===t.callback)_(I);else{if(!(t.startTime<=e))break;_(I),t.sortIndex=t.expirationTime,O(j,t)}t=C(I)}}function q(e){if(M=!1,L(e),!F)if(null!==C(j))F=!0,r(z);else{var t=C(I);null!==t&&i(q,t.startTime-e)}}function z(e,n){F=!1,M&&(M=!1,o()),A=!0;var r=R;try{for(L(n),D=C(j);null!==D&&(!(D.expirationTime>n)||e&&!a());){var l=D.callback;if(null!==l){D.callback=null,R=D.priorityLevel;var s=l(D.expirationTime<=n);n=t.unstable_now(),"function"==typeof s?D.callback=s:D===C(j)&&_(j),L(n)}else _(j);D=C(j)}if(null!==D)var u=!0;else{var c=C(I);null!==c&&i(q,c.startTime-n),u=!1}return u}finally{D=null,R=r,A=!1}}function Q(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var V=l;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=R;R=e;try{return t()}finally{R=n}},t.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var n=R;R=t;try{return e()}finally{R=n}},t.unstable_scheduleCallback=function(e,n,a){var l=t.unstable_now();if("object"==typeof a&&null!==a){var s=a.delay;s="number"==typeof s&&0l?(e.sortIndex=s,O(I,e),null===C(j)&&e===C(I)&&(M?o():M=!0,i(q,s-l))):(e.sortIndex=a,O(j,e),F||A||(F=!0,r(z))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=R;return function(){var n=R;R=t;try{return e.apply(this,arguments)}finally{R=n}}},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_shouldYield=function(){var e=t.unstable_now();L(e);var n=C(j);return n!==D&&null!==D&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime1,i=!1,o=arguments[1],a=o;return new n((function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))}},{key:"concat",value:function(){for(var e=this,t=arguments.length,n=Array(t),r=0;r=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){r.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))}},{key:u,value:function(){return this}}],[{key:"from",value:function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=f(t,u);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return p(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(a("iterator")&&(r=f(t,s)))return new n((function(e){h((function(){if(!e.closed){var n=!0,i=!1,o=void 0;try{for(var a,l=r.call(t)[Symbol.iterator]();!(n=(a=l.next()).done);n=!0){var s=a.value;if(e.next(s),e.closed)return}}catch(e){i=!0,o=e}finally{try{!n&&l.return&&l.return()}finally{if(i)throw o}}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){h((function(){if(!e.closed){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:e.prototype.toString;e.prototype.toJSON=t,e.prototype.inspect=t,o.a&&(e.prototype[o.a]=t)}function l(e){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){for(var n,r=/\r\n|[\n\r]/g,i=1,o=t+1;(n=r.exec(e.body))&&n.index120){for(var m=Math.floor(s/80),h=s%80,v=[],y=0;y0||i(0,"line in locationOffset is 1-indexed and must be positive"),this.locationOffset.column>0||i(0,"column in locationOffset is 1-indexed and must be positive")};v=y,"function"==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(v.prototype,Symbol.toStringTag,{get:function(){return this.constructor.name}});var b=n(8),g=Object.freeze({SOF:"",EOF:"",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});function w(){return this.lastToken=this.token,this.token=this.lookahead()}function x(){var e=this.token;if(e.kind!==g.EOF)do{e=e.next||(e.next=S(this,e))}while(e.kind===g.COMMENT);return e}function k(e,t,n,r,i,o,a){this.kind=e,this.start=t,this.end=n,this.line=r,this.column=i,this.value=a,this.prev=o,this.next=null}function E(e){return isNaN(e)?g.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function S(e,t){var n=e.source,r=n.body,i=r.length,o=function(e,t,n){var r=e.length,i=t;for(;i=i)return new k(g.EOF,i,i,a,l,t);var s=r.charCodeAt(o);switch(s){case 33:return new k(g.BANG,o,o+1,a,l,t);case 35:return function(e,t,n,r,i){var o,a=e.body,l=t;do{o=a.charCodeAt(++l)}while(!isNaN(o)&&(o>31||9===o));return new k(g.COMMENT,t,l,n,r,i,a.slice(t+1,l))}(n,o,a,l,t);case 36:return new k(g.DOLLAR,o,o+1,a,l,t);case 38:return new k(g.AMP,o,o+1,a,l,t);case 40:return new k(g.PAREN_L,o,o+1,a,l,t);case 41:return new k(g.PAREN_R,o,o+1,a,l,t);case 46:if(46===r.charCodeAt(o+1)&&46===r.charCodeAt(o+2))return new k(g.SPREAD,o,o+3,a,l,t);break;case 58:return new k(g.COLON,o,o+1,a,l,t);case 61:return new k(g.EQUALS,o,o+1,a,l,t);case 64:return new k(g.AT,o,o+1,a,l,t);case 91:return new k(g.BRACKET_L,o,o+1,a,l,t);case 93:return new k(g.BRACKET_R,o,o+1,a,l,t);case 123:return new k(g.BRACE_L,o,o+1,a,l,t);case 124:return new k(g.PIPE,o,o+1,a,l,t);case 125:return new k(g.BRACE_R,o,o+1,a,l,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return function(e,t,n,r,i){var o=e.body,a=o.length,l=t+1,s=0;for(;l!==a&&!isNaN(s=o.charCodeAt(l))&&(95===s||s>=48&&s<=57||s>=65&&s<=90||s>=97&&s<=122);)++l;return new k(g.NAME,t,l,n,r,i,o.slice(t,l))}(n,o,a,l,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return function(e,t,n,r,i,o){var a=e.body,l=n,s=t,u=!1;45===l&&(l=a.charCodeAt(++s));if(48===l){if((l=a.charCodeAt(++s))>=48&&l<=57)throw m(e,s,"Invalid number, unexpected digit after 0: ".concat(E(l),"."))}else s=T(e,s,l),l=a.charCodeAt(s);46===l&&(u=!0,l=a.charCodeAt(++s),s=T(e,s,l),l=a.charCodeAt(s));69!==l&&101!==l||(u=!0,43!==(l=a.charCodeAt(++s))&&45!==l||(l=a.charCodeAt(++s)),s=T(e,s,l),l=a.charCodeAt(s));if(46===l||69===l||101===l)throw m(e,s,"Invalid number, expected digit but got: ".concat(E(l),"."));return new k(u?g.FLOAT:g.INT,t,s,r,i,o,a.slice(t,s))}(n,o,s,a,l,t);case 34:return 34===r.charCodeAt(o+1)&&34===r.charCodeAt(o+2)?function(e,t,n,r,i,o){var a=e.body,l=t+3,s=l,u=0,c="";for(;l=48&&o<=57){do{o=r.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw m(e,i,"Invalid number, expected digit but got: ".concat(E(o),"."))}function O(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}a(k,(function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}));var C=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function _(e,t){return new I(e,t).parseDocument()}function N(e,t){var n=new I(e,t);n.expectToken(g.SOF);var r=n.parseValueLiteral(!1);return n.expectToken(g.EOF),r}function j(e,t){var n=new I(e,t);n.expectToken(g.SOF);var r=n.parseTypeReference();return n.expectToken(g.EOF),r}n.d(t,"parse",(function(){return _})),n.d(t,"parseValue",(function(){return N})),n.d(t,"parseType",(function(){return j}));var I=function(){function e(e,t){var n="string"==typeof e?new y(e):e;n instanceof y||i(0,"Must provide Source. Received: ".concat(Object(r.a)(n))),this._lexer=function(e,t){var n=new k(g.SOF,0,0,0,0,null);return{source:e,options:t,lastToken:n,token:n,line:1,lineStart:0,advance:w,lookahead:x}}(n),this._options=t||{}}var t=e.prototype;return t.parseName=function(){var e=this.expectToken(g.NAME);return{kind:h.NAME,value:e.value,loc:this.loc(e)}},t.parseDocument=function(){var e=this._lexer.token;return{kind:h.DOCUMENT,definitions:this.many(g.SOF,this.parseDefinition,g.EOF),loc:this.loc(e)}},t.parseDefinition=function(){if(this.peek(g.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(g.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var e=this._lexer.token;if(this.peek(g.BRACE_L))return{kind:h.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(e)};var t,n=this.parseOperationType();return this.peek(g.NAME)&&(t=this.parseName()),{kind:h.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseOperationType=function(){var e=this.expectToken(g.NAME);switch(e.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(e)},t.parseVariableDefinitions=function(){return this.optionalMany(g.PAREN_L,this.parseVariableDefinition,g.PAREN_R)},t.parseVariableDefinition=function(){var e=this._lexer.token;return{kind:h.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(g.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(g.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(e)}},t.parseVariable=function(){var e=this._lexer.token;return this.expectToken(g.DOLLAR),{kind:h.VARIABLE,name:this.parseName(),loc:this.loc(e)}},t.parseSelectionSet=function(){var e=this._lexer.token;return{kind:h.SELECTION_SET,selections:this.many(g.BRACE_L,this.parseSelection,g.BRACE_R),loc:this.loc(e)}},t.parseSelection=function(){return this.peek(g.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var e,t,n=this._lexer.token,r=this.parseName();return this.expectOptionalToken(g.COLON)?(e=r,t=this.parseName()):t=r,{kind:h.FIELD,alias:e,name:t,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(g.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(e){var t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(g.PAREN_L,t,g.PAREN_R)},t.parseArgument=function(){var e=this._lexer.token,t=this.parseName();return this.expectToken(g.COLON),{kind:h.ARGUMENT,name:t,value:this.parseValueLiteral(!1),loc:this.loc(e)}},t.parseConstArgument=function(){var e=this._lexer.token;return{kind:h.ARGUMENT,name:this.parseName(),value:(this.expectToken(g.COLON),this.parseValueLiteral(!0)),loc:this.loc(e)}},t.parseFragment=function(){var e=this._lexer.token;this.expectToken(g.SPREAD);var t=this.expectOptionalKeyword("on");return!t&&this.peek(g.NAME)?{kind:h.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(e)}:{kind:h.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentDefinition=function(){var e=this._lexer.token;return this.expectKeyword("fragment"),this._options.experimentalFragmentVariables?{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}:{kind:h.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},t.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(e){var t=this._lexer.token;switch(t.kind){case g.BRACKET_L:return this.parseList(e);case g.BRACE_L:return this.parseObject(e);case g.INT:return this._lexer.advance(),{kind:h.INT,value:t.value,loc:this.loc(t)};case g.FLOAT:return this._lexer.advance(),{kind:h.FLOAT,value:t.value,loc:this.loc(t)};case g.STRING:case g.BLOCK_STRING:return this.parseStringLiteral();case g.NAME:return"true"===t.value||"false"===t.value?(this._lexer.advance(),{kind:h.BOOLEAN,value:"true"===t.value,loc:this.loc(t)}):"null"===t.value?(this._lexer.advance(),{kind:h.NULL,loc:this.loc(t)}):(this._lexer.advance(),{kind:h.ENUM,value:t.value,loc:this.loc(t)});case g.DOLLAR:if(!e)return this.parseVariable()}throw this.unexpected()},t.parseStringLiteral=function(){var e=this._lexer.token;return this._lexer.advance(),{kind:h.STRING,value:e.value,block:e.kind===g.BLOCK_STRING,loc:this.loc(e)}},t.parseList=function(e){var t=this,n=this._lexer.token;return{kind:h.LIST,values:this.any(g.BRACKET_L,(function(){return t.parseValueLiteral(e)}),g.BRACKET_R),loc:this.loc(n)}},t.parseObject=function(e){var t=this,n=this._lexer.token;return{kind:h.OBJECT,fields:this.any(g.BRACE_L,(function(){return t.parseObjectField(e)}),g.BRACE_R),loc:this.loc(n)}},t.parseObjectField=function(e){var t=this._lexer.token,n=this.parseName();return this.expectToken(g.COLON),{kind:h.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e),loc:this.loc(t)}},t.parseDirectives=function(e){for(var t=[];this.peek(g.AT);)t.push(this.parseDirective(e));return t},t.parseDirective=function(e){var t=this._lexer.token;return this.expectToken(g.AT),{kind:h.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e),loc:this.loc(t)}},t.parseTypeReference=function(){var e,t=this._lexer.token;return this.expectOptionalToken(g.BRACKET_L)?(e=this.parseTypeReference(),this.expectToken(g.BRACKET_R),e={kind:h.LIST_TYPE,type:e,loc:this.loc(t)}):e=this.parseNamedType(),this.expectOptionalToken(g.BANG)?{kind:h.NON_NULL_TYPE,type:e,loc:this.loc(t)}:e},t.parseNamedType=function(){var e=this._lexer.token;return{kind:h.NAMED_TYPE,name:this.parseName(),loc:this.loc(e)}},t.parseTypeSystemDefinition=function(){var e=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(e.kind===g.NAME)switch(e.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}throw this.unexpected(e)},t.peekDescription=function(){return this.peek(g.STRING)||this.peek(g.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var e=this._lexer.token;this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.many(g.BRACE_L,this.parseOperationTypeDefinition,g.BRACE_R);return{kind:h.SCHEMA_DEFINITION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseOperationTypeDefinition=function(){var e=this._lexer.token,t=this.parseOperationType();this.expectToken(g.COLON);var n=this.parseNamedType();return{kind:h.OPERATION_TYPE_DEFINITION,operation:t,type:n,loc:this.loc(e)}},t.parseScalarTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");var n=this.parseName(),r=this.parseDirectives(!0);return{kind:h.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");var n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:h.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o,loc:this.loc(e)}},t.parseImplementsInterfaces=function(){var e=[];if(this.expectOptionalKeyword("implements")){this.expectOptionalToken(g.AMP);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(g.AMP)||this._options.allowLegacySDLImplementsInterfaces&&this.peek(g.NAME))}return e},t.parseFieldsDefinition=function(){return this._options.allowLegacySDLEmptyFields&&this.peek(g.BRACE_L)&&this._lexer.lookahead().kind===g.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(g.BRACE_L,this.parseFieldDefinition,g.BRACE_R)},t.parseFieldDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(g.COLON);var i=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:h.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o,loc:this.loc(e)}},t.parseArgumentDefs=function(){return this.optionalMany(g.PAREN_L,this.parseInputValueDef,g.PAREN_R)},t.parseInputValueDef=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(g.COLON);var r,i=this.parseTypeReference();this.expectOptionalToken(g.EQUALS)&&(r=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:h.INPUT_VALUE_DEFINITION,description:t,name:n,type:i,defaultValue:r,directives:o,loc:this.loc(e)}},t.parseInterfaceTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();return{kind:h.INTERFACE_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},t.parseUnionTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:h.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i,loc:this.loc(e)}},t.parseUnionMemberTypes=function(){var e=[];if(this.expectOptionalToken(g.EQUALS)){this.expectOptionalToken(g.PIPE);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(g.PIPE))}return e},t.parseEnumTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:h.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i,loc:this.loc(e)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(g.BRACE_L,this.parseEnumValueDefinition,g.BRACE_R)},t.parseEnumValueDefinition=function(){var e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseDirectives(!0);return{kind:h.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r,loc:this.loc(e)}},t.parseInputObjectTypeDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");var n=this.parseName(),r=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:h.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(g.BRACE_L,this.parseInputValueDef,g.BRACE_R)},t.parseTypeSystemExtension=function(){var e=this._lexer.lookahead();if(e.kind===g.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)},t.parseSchemaExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var t=this.parseDirectives(!0),n=this.optionalMany(g.BRACE_L,this.parseOperationTypeDefinition,g.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return{kind:h.SCHEMA_EXTENSION,directives:t,operationTypes:n,loc:this.loc(e)}},t.parseScalarTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var t=this.parseName(),n=this.parseDirectives(!0);if(0===n.length)throw this.unexpected();return{kind:h.SCALAR_TYPE_EXTENSION,name:t,directives:n,loc:this.loc(e)}},t.parseObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return{kind:h.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i,loc:this.loc(e)}},t.parseInterfaceTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:h.INTERFACE_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseUnionTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:h.UNION_TYPE_EXTENSION,name:t,directives:n,types:r,loc:this.loc(e)}},t.parseEnumTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:h.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r,loc:this.loc(e)}},t.parseInputObjectTypeExtension=function(){var e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var t=this.parseName(),n=this.parseDirectives(!0),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return{kind:h.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r,loc:this.loc(e)}},t.parseDirectiveDefinition=function(){var e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(g.AT);var n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:h.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o,loc:this.loc(e)}},t.parseDirectiveLocations=function(){this.expectOptionalToken(g.PIPE);var e=[];do{e.push(this.parseDirectiveLocation())}while(this.expectOptionalToken(g.PIPE));return e},t.parseDirectiveLocation=function(){var e=this._lexer.token,t=this.parseName();if(void 0!==C[t.value])return t;throw this.unexpected(e)},t.loc=function(e){if(!this._options.noLocation)return new P(e,this._lexer.lastToken,this._lexer.source)},t.peek=function(e){return this._lexer.token.kind===e},t.expectToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t;throw m(this._lexer.source,t.start,"Expected ".concat(e,", found ").concat(D(t)))},t.expectOptionalToken=function(e){var t=this._lexer.token;if(t.kind===e)return this._lexer.advance(),t},t.expectKeyword=function(e){var t=this._lexer.token;if(t.kind!==g.NAME||t.value!==e)throw m(this._lexer.source,t.start,'Expected "'.concat(e,'", found ').concat(D(t)));this._lexer.advance()},t.expectOptionalKeyword=function(e){var t=this._lexer.token;return t.kind===g.NAME&&t.value===e&&(this._lexer.advance(),!0)},t.unexpected=function(e){var t=e||this._lexer.token;return m(this._lexer.source,t.start,"Unexpected ".concat(D(t)))},t.any=function(e,t,n){this.expectToken(e);for(var r=[];!this.expectOptionalToken(n);)r.push(t.call(this));return r},t.optionalMany=function(e,t,n){if(this.expectOptionalToken(e)){var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}return[]},t.many=function(e,t,n){this.expectToken(e);var r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r},e}();function P(e,t,n){this.start=e.start,this.end=t.end,this.startToken=e,this.endToken=t,this.source=n}function D(e){var t=e.value;return t?"".concat(e.kind,' "').concat(t,'"'):e.kind}a(P,(function(){return{start:this.start,end:this.end}}))},function(e,t,n){"use strict";n.r(t);var r=n(22),i=n.n(r),o=n(23),a=n.n(o),l=n(5),s=n.n(l),u=n(0),c=n(1),f=n(21),d=n(27),p=n.n(d).a,m=n(2);!function(e){function t(t,n){var r=e.call(this,t)||this;return r.link=n,r}Object(u.c)(t,e)}(Error);function h(e){return e.request.length<=1}function v(e){return new p((function(t){t.error(e)}))}function y(e,t){var n=Object(u.a)({},e);return Object.defineProperty(t,"setContext",{enumerable:!1,value:function(e){n="function"==typeof e?Object(u.a)({},n,e(n)):Object(u.a)({},n,e)}}),Object.defineProperty(t,"getContext",{enumerable:!1,value:function(){return Object(u.a)({},n)}}),Object.defineProperty(t,"toKey",{enumerable:!1,value:function(){return function(e){var t=e.query,n=e.variables,r=e.operationName;return JSON.stringify([r,t,n])}(t)}}),t}function b(e,t){return t?t(e):p.of()}function g(e){return"function"==typeof e?new E(e):e}function w(){return new E((function(){return p.of()}))}function x(e){return 0===e.length?w():e.map(g).reduce((function(e,t){return e.concat(t)}))}function k(e,t,n){var r=g(t),i=g(n||new E(b));return h(r)&&h(i)?new E((function(t){return e(t)?r.request(t)||p.of():i.request(t)||p.of()})):new E((function(t,n){return e(t)?r.request(t,n)||p.of():i.request(t,n)||p.of()}))}var E=function(){function e(e){e&&(this.request=e)}return e.prototype.split=function(t,n,r){return this.concat(k(t,n,r||new e(b)))},e.prototype.concat=function(e){return function(e,t){var n=g(e);if(h(n))return n;var r=g(t);return h(r)?new E((function(e){return n.request(e,(function(e){return r.request(e)||p.of()}))||p.of()})):new E((function(e,t){return n.request(e,(function(e){return r.request(e,t)||p.of()}))||p.of()}))}(this,e)},e.prototype.request=function(e,t){throw new m.a(1)},e.empty=w,e.from=x,e.split=k,e.execute=S,e}();function S(e,t){return e.request(y(t.context,function(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName="string"!=typeof t.query?Object(c.n)(t.query):""),t}(function(e){for(var t=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(e);n0}var I,P=function(e){var t="";return j(e.graphQLErrors)&&e.graphQLErrors.forEach((function(e){var n=e?e.message:"Error message not found.";t+="GraphQL error: "+n+"\n"})),e.networkError&&(t+="Network error: "+e.networkError.message+"\n"),t=t.replace(/\n$/,"")},D=function(e){function t(n){var r=n.graphQLErrors,i=n.networkError,o=n.errorMessage,a=n.extraInfo,l=e.call(this,o)||this;return l.graphQLErrors=r||[],l.networkError=i||null,l.message=o||P(l),l.extraInfo=a,l.__proto__=t.prototype,l}return Object(u.c)(t,e),t}(Error);!function(e){e[e.normal=1]="normal",e[e.refetch=2]="refetch",e[e.poll=3]="poll"}(I||(I={}));var R=function(e){function t(t){var n=t.queryManager,r=t.options,i=t.shouldSubscribe,o=void 0===i||i,a=e.call(this,(function(e){return a.onSubscribe(e)}))||this;a.observers=new Set,a.subscriptions=new Set,a.isTornDown=!1,a.options=r,a.variables=r.variables||{},a.queryId=n.generateQueryId(),a.shouldSubscribe=o;var l=Object(c.m)(r.query);return a.queryName=l&&l.name&&l.name.value,a.queryManager=n,a}return Object(u.c)(t,e),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=e.subscribe(r)}))},t.prototype.currentResult=function(){var e=this.getCurrentResult();return void 0===e.data&&(e.data={}),e},t.prototype.getCurrentResult=function(){if(this.isTornDown){var e=this.lastResult;return{data:!this.lastError&&e&&e.data||void 0,error:this.lastError,loading:!1,networkStatus:T.error}}var t,n,r,i=this.queryManager.getCurrentQueryResult(this),o=i.data,a=i.partial,l=this.queryManager.queryStore.get(this.queryId),s=this.options.fetchPolicy,c="network-only"===s||"no-cache"===s;if(l){var f=l.networkStatus;if(n=l,void 0===(r=this.options.errorPolicy)&&(r="none"),n&&(n.networkError||"none"===r&&j(n.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:f,error:new D({graphQLErrors:l.graphQLErrors,networkError:l.networkError})};l.variables&&(this.options.variables=Object(u.a)({},this.options.variables,l.variables),this.variables=this.options.variables),t={data:o,loading:_(f),networkStatus:f},l.graphQLErrors&&"all"===this.options.errorPolicy&&(t.errors=l.graphQLErrors)}else{var d=c||a&&"cache-only"!==s;t={data:o,loading:d,networkStatus:d?T.loading:T.ready}}return a||this.updateLastResult(Object(u.a)({},t,{stale:!1})),Object(u.a)({},t,{partial:a})},t.prototype.isDifferentFromLastResult=function(e){var t=this.lastResultSnapshot;return!(t&&e&&t.networkStatus===e.networkStatus&&t.stale===e.stale&&Object(f.a)(t.data,e.data))},t.prototype.getLastResult=function(){return this.lastResult},t.prototype.getLastError=function(){return this.lastError},t.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){var e=this.queryManager.queryStore.get(this.queryId);e&&(e.networkError=null,e.graphQLErrors=[])},t.prototype.refetch=function(e){var t=this.options.fetchPolicy;return"cache-only"===t?Promise.reject(new m.a(3)):("no-cache"!==t&&"cache-and-network"!==t&&(t="network-only"),Object(f.a)(this.variables,e)||(this.variables=Object(u.a)({},this.variables,e)),Object(f.a)(this.options.variables,this.variables)||(this.options.variables=Object(u.a)({},this.options.variables,this.variables)),this.queryManager.fetchQuery(this.queryId,Object(u.a)({},this.options,{fetchPolicy:t}),I.refetch))},t.prototype.fetchMore=function(e){var t=this;Object(m.b)(e.updateQuery,4);var n=Object(u.a)({},e.query?e:Object(u.a)({},this.options,e,{variables:Object(u.a)({},this.variables,e.variables)}),{fetchPolicy:"network-only"}),r=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(r,n,I.normal,this.queryId).then((function(i){return t.updateQuery((function(t){return e.updateQuery(t,{fetchMoreResult:i.data,variables:n.variables})})),t.queryManager.stopQuery(r),i}),(function(e){throw t.queryManager.stopQuery(r),e}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})}))},error:function(t){e.onError&&e.onError(t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){var t=this.options.fetchPolicy;this.options=Object(u.a)({},this.options,e),e.pollInterval?this.startPolling(e.pollInterval):0===e.pollInterval&&this.stopPolling();var n=e.fetchPolicy;return this.setVariables(this.options.variables,t!==n&&("cache-only"===t||"standby"===t||"network-only"===n),e.fetchResults)},t.prototype.setVariables=function(e,t,n){return void 0===t&&(t=!1),void 0===n&&(n=!0),this.isTornDown=!1,e=e||this.variables,!t&&Object(f.a)(e,this.variables)?this.observers.size&&n?this.result():Promise.resolve():(this.variables=this.options.variables=e,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=t.getQueryWithPreviousResult(this.queryId),r=n.previousResult,i=n.variables,o=n.document,a=Object(c.I)((function(){return e(r,{variables:i})}));a&&(t.dataStore.markUpdateQueryResult(o,i,a),t.broadcastQueries())},t.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},t.prototype.startPolling=function(e){M(this),this.options.pollInterval=e,this.queryManager.startPollingQuery(this.options,this.queryId)},t.prototype.updateLastResult=function(e){var t=this.lastResult;return this.lastResult=e,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?e:Object(c.f)(e),t},t.prototype.onSubscribe=function(e){var t=this;try{var n=e._subscription._observer;n&&!n.error&&(n.error=A)}catch(e){}var r=!this.observers.size;return this.observers.add(e),e.next&&this.lastResult&&e.next(this.lastResult),e.error&&this.lastError&&e.error(this.lastError),r&&this.setUpQuery(),function(){t.observers.delete(e)&&!t.observers.size&&t.tearDownQuery()}},t.prototype.setUpQuery=function(){var e=this,t=this.queryManager,n=this.queryId;this.shouldSubscribe&&t.addObservableQuery(n,this),this.options.pollInterval&&(M(this),t.startPollingQuery(this.options,n));var r=function(t){e.updateLastResult(Object(u.a)({},e.lastResult,{errors:t.graphQLErrors,networkStatus:T.error,loading:!1})),F(e.observers,"error",e.lastError=t)};t.observeQuery(n,this.options,{next:function(n){if(e.lastError||e.isDifferentFromLastResult(n)){var r=e.updateLastResult(n),i=e.options,o=i.query,a=i.variables,l=i.fetchPolicy;t.transform(o).hasClientExports?t.getLocalState().addExportedVariables(o,a).then((function(i){var a=e.variables;e.variables=e.options.variables=i,!n.loading&&r&&"cache-only"!==l&&t.transform(o).serverQuery&&!Object(f.a)(a,i)?e.refetch():F(e.observers,"next",n)})):F(e.observers,"next",n)}},error:r}).catch(r)},t.prototype.tearDownQuery=function(){var e=this.queryManager;this.isTornDown=!0,e.stopPollingQuery(this.queryId),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),e.removeObservableQuery(this.queryId),e.stopQuery(this.queryId),this.observers.clear()},t}(N);function A(e){}function F(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function M(e){var t=e.options.fetchPolicy;Object(m.b)("cache-first"!==t&&"cache-only"!==t,5)}var L=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initMutation=function(e,t,n){this.store[e]={mutation:t,variables:n||{},loading:!0,error:null}},e.prototype.markMutationError=function(e,t){var n=this.store[e];n&&(n.loading=!1,n.error=t)},e.prototype.markMutationResult=function(e){var t=this.store[e];t&&(t.loading=!1,t.error=null)},e.prototype.reset=function(){this.store={}},e}(),q=function(){function e(){this.store={}}return e.prototype.getStore=function(){return this.store},e.prototype.get=function(e){return this.store[e]},e.prototype.initQuery=function(e){var t=this.store[e.queryId];Object(m.b)(!t||t.document===e.document||Object(f.a)(t.document,e.document),19);var n,r=!1,i=null;e.storePreviousVariables&&t&&t.networkStatus!==T.loading&&(Object(f.a)(t.variables,e.variables)||(r=!0,i=t.variables)),n=r?T.setVariables:e.isPoll?T.poll:e.isRefetch?T.refetch:T.loading;var o=[];t&&t.graphQLErrors&&(o=t.graphQLErrors),this.store[e.queryId]={document:e.document,variables:e.variables,previousVariables:i,networkError:null,graphQLErrors:o,networkStatus:n,metadata:e.metadata},"string"==typeof e.fetchMoreForQueryId&&this.store[e.fetchMoreForQueryId]&&(this.store[e.fetchMoreForQueryId].networkStatus=T.fetchMore)},e.prototype.markQueryResult=function(e,t,n){this.store&&this.store[e]&&(this.store[e].networkError=null,this.store[e].graphQLErrors=j(t.errors)?t.errors:[],this.store[e].previousVariables=null,this.store[e].networkStatus=T.ready,"string"==typeof n&&this.store[n]&&(this.store[n].networkStatus=T.ready))},e.prototype.markQueryError=function(e,t,n){this.store&&this.store[e]&&(this.store[e].networkError=t,this.store[e].networkStatus=T.error,"string"==typeof n&&this.markQueryResultClient(n,!0))},e.prototype.markQueryResultClient=function(e,t){var n=this.store&&this.store[e];n&&(n.networkError=null,n.previousVariables=null,t&&(n.networkStatus=T.ready))},e.prototype.stopQuery=function(e){delete this.store[e]},e.prototype.reset=function(e){var t=this;Object.keys(this.store).forEach((function(n){e.indexOf(n)<0?t.stopQuery(n):t.store[n].networkStatus=T.loading}))},e}();var z=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=Object(c.A)(t.resolvers,e)})):this.resolvers=Object(c.A)(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return Object(u.b)(this,void 0,void 0,(function(){return Object(u.d)(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,a).then((function(e){return Object(u.a)({},n,{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return Object(c.s)(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return this.resolvers?Object(c.C)(e):e},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.cache;return Object(u.a)({},e,{cache:t,getCacheKey:function(e){if(t.config)return t.config.dataIdFromObject(e);Object(m.b)(!1,6)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),Object(u.b)(this,void 0,void 0,(function(){return Object(u.d)(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return Object(u.a)({},t,e.exportedVariables)}))]:[2,Object(u.a)({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return Object(C.b)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return C.a}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:Object(c.d)(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,i,o){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),Object(u.b)(this,void 0,void 0,(function(){var a,l,s,f,d,p,m,h,v;return Object(u.d)(this,(function(y){var b;return a=Object(c.l)(e),l=Object(c.j)(e),s=Object(c.g)(l),f=a.operation,d=f?(b=f).charAt(0).toUpperCase()+b.slice(1):"Query",m=(p=this).cache,h=p.client,v={fragmentMap:s,context:Object(u.a)({},n,{cache:m,client:h}),variables:r,fragmentMatcher:i,defaultOperationType:d,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,t,v).then((function(e){return{result:e,exportedVariables:v.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n){return Object(u.b)(this,void 0,void 0,(function(){var r,i,o,a,l,s=this;return Object(u.d)(this,(function(f){return r=n.fragmentMap,i=n.context,o=n.variables,a=[t],l=function(e){return Object(u.b)(s,void 0,void 0,(function(){var l,s;return Object(u.d)(this,(function(u){return Object(c.F)(e,o)?Object(c.t)(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&a.push(((n={})[Object(c.E)(e)]=t,n))}))]:(Object(c.v)(e)?l=e:(l=r[e.name.value],Object(m.b)(l,7)),l&&l.typeCondition&&(s=l.typeCondition.name.value,n.fragmentMatcher(t,s,i))?[2,this.resolveSelectionSet(l.selectionSet,t,n).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(l)).then((function(){return Object(c.B)(a)}))]}))}))},e.prototype.resolveField=function(e,t,n){return Object(u.b)(this,void 0,void 0,(function(){var r,i,o,a,l,s,f,d,p,m=this;return Object(u.d)(this,(function(u){return r=n.variables,i=e.name.value,o=Object(c.E)(e),a=i!==o,l=t[o]||t[i],s=Promise.resolve(l),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(f=t.__typename||n.defaultOperationType,(d=this.resolvers&&this.resolvers[f])&&(p=d[a?i:o])&&(s=Promise.resolve(p(t,Object(c.b)(e,r),n.context,{field:e})))),[2,s.then((function(t){return void 0===t&&(t=l),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?m.resolveSubSelectedArray(e,t,n):e.selectionSet?m.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},e}();function Q(e){var t=new Set,n=null;return new N((function(r){return t.add(r),n=n||e.subscribe({next:function(e){t.forEach((function(t){return t.next&&t.next(e)}))},error:function(e){t.forEach((function(t){return t.error&&t.error(e)}))},complete:function(){t.forEach((function(e){return e.complete&&e.complete()}))}}),function(){t.delete(r)&&!t.size&&n&&(n.unsubscribe(),n=null)}}))}var V=Object.prototype.hasOwnProperty,U=function(){function e(e){var t=e.link,n=e.queryDeduplication,r=void 0!==n&&n,i=e.store,o=e.onBroadcast,a=void 0===o?function(){}:o,l=e.ssrMode,s=void 0!==l&&l,u=e.clientAwareness,f=void 0===u?{}:u,d=e.localState,p=e.assumeImmutableResults;this.mutationStore=new L,this.queryStore=new q,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(c.e?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=t,this.queryDeduplication=r,this.dataStore=i,this.onBroadcast=a,this.clientAwareness=f,this.localState=d||new z({cache:i.getCache()}),this.ssrMode=s,this.assumeImmutableResults=!!p}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.fetchQueryRejectFns.forEach((function(e){e(new m.a(8))}))},e.prototype.mutate=function(e){var t=e.mutation,n=e.variables,r=e.optimisticResponse,i=e.updateQueries,o=e.refetchQueries,a=void 0===o?[]:o,l=e.awaitRefetchQueries,s=void 0!==l&&l,f=e.update,d=e.errorPolicy,p=void 0===d?"none":d,h=e.fetchPolicy,v=e.context,y=void 0===v?{}:v;return Object(u.b)(this,void 0,void 0,(function(){var e,o,l,d=this;return Object(u.d)(this,(function(v){switch(v.label){case 0:return Object(m.b)(t,9),Object(m.b)(!h||"no-cache"===h,10),e=this.generateQueryId(),t=this.transform(t).document,this.setQuery(e,(function(){return{document:t}})),n=this.getVariables(t,n),this.transform(t).hasClientExports?[4,this.localState.addExportedVariables(t,n,y)]:[3,2];case 1:n=v.sent(),v.label=2;case 2:return o=function(){var e={};return i&&d.queries.forEach((function(t,n){var r=t.observableQuery;if(r){var o=r.queryName;o&&V.call(i,o)&&(e[n]={updater:i[o],query:d.queryStore.get(n)})}})),e},this.mutationStore.initMutation(e,t,n),this.dataStore.markMutationInit({mutationId:e,document:t,variables:n,updateQueries:o(),update:f,optimisticResponse:r}),this.broadcastQueries(),l=this,[2,new Promise((function(i,d){var m,v;l.getObservableFromLink(t,Object(u.a)({},y,{optimisticResponse:r}),n,!1).subscribe({next:function(r){Object(c.q)(r)&&"none"===p?v=new D({graphQLErrors:r.errors}):(l.mutationStore.markMutationResult(e),"no-cache"!==h&&l.dataStore.markMutationResult({mutationId:e,result:r,document:t,variables:n,updateQueries:o(),update:f}),m=r)},error:function(t){l.mutationStore.markMutationError(e,t),l.dataStore.markMutationComplete({mutationId:e,optimisticResponse:r}),l.broadcastQueries(),l.setQuery(e,(function(){return{document:null}})),d(new D({networkError:t}))},complete:function(){if(v&&l.mutationStore.markMutationError(e,v),l.dataStore.markMutationComplete({mutationId:e,optimisticResponse:r}),l.broadcastQueries(),v)d(v);else{"function"==typeof a&&(a=a(m));var t=[];j(a)&&a.forEach((function(e){if("string"==typeof e)l.queries.forEach((function(n){var r=n.observableQuery;r&&r.queryName===e&&t.push(r.refetch())}));else{var n={query:e.query,variables:e.variables,fetchPolicy:"network-only"};e.context&&(n.context=e.context),t.push(l.query(n))}})),Promise.all(s?t:[]).then((function(){l.setQuery(e,(function(){return{document:null}})),"ignore"===p&&m&&Object(c.q)(m)&&delete m.errors,i(m)}))}}})}))]}}))}))},e.prototype.fetchQuery=function(e,t,n,r){return Object(u.b)(this,void 0,void 0,(function(){var i,o,a,l,s,f,d,p,m,h,v,y,b,g,w,x,k,E,S=this;return Object(u.d)(this,(function(T){switch(T.label){case 0:return i=t.metadata,o=void 0===i?null:i,a=t.fetchPolicy,l=void 0===a?"cache-first":a,s=t.context,f=void 0===s?{}:s,d=this.transform(t.query).document,p=this.getVariables(d,t.variables),this.transform(d).hasClientExports?[4,this.localState.addExportedVariables(d,p,f)]:[3,2];case 1:p=T.sent(),T.label=2;case 2:if(t=Object(u.a)({},t,{variables:p}),v=h="network-only"===l||"no-cache"===l,h||(y=this.dataStore.getCache().diff({query:d,variables:p,returnPartialData:!0,optimistic:!1}),b=y.complete,g=y.result,v=!b||"cache-and-network"===l,m=g),w=v&&"cache-only"!==l&&"standby"!==l,Object(c.s)(["live"],d)&&(w=!0),x=this.idCounter++,k="no-cache"!==l?this.updateQueryWatch(e,d,t):void 0,this.setQuery(e,(function(){return{document:d,lastRequestId:x,invalidated:!0,cancel:k}})),this.invalidate(r),this.queryStore.initQuery({queryId:e,document:d,storePreviousVariables:w,variables:p,isPoll:n===I.poll,isRefetch:n===I.refetch,metadata:o,fetchMoreForQueryId:r}),this.broadcastQueries(),w){if(E=this.fetchRequest({requestId:x,queryId:e,document:d,options:t,fetchMoreForQueryId:r}).catch((function(t){throw t.hasOwnProperty("graphQLErrors")?t:(x>=S.getQuery(e).lastRequestId&&(S.queryStore.markQueryError(e,t,r),S.invalidate(e),S.invalidate(r),S.broadcastQueries()),new D({networkError:t}))})),"cache-and-network"!==l)return[2,E];E.catch((function(){}))}return this.queryStore.markQueryResultClient(e,!w),this.invalidate(e),this.invalidate(r),this.transform(d).hasForcedResolvers?[2,this.localState.runResolvers({document:d,remoteResult:{data:m},context:f,variables:p,onlyRunForcedResolvers:!0}).then((function(n){return S.markQueryResult(e,n,t,r),S.broadcastQueries(),n}))]:(this.broadcastQueries(),[2,{data:m}])}}))}))},e.prototype.markQueryResult=function(e,t,n,r){var i=n.fetchPolicy,o=n.variables,a=n.errorPolicy;"no-cache"===i?this.setQuery(e,(function(){return{newData:{result:t.data,complete:!0}}})):this.dataStore.markQueryResult(t,this.getQuery(e).document,o,r,"ignore"===a||"all"===a)},e.prototype.queryListenerForObserver=function(e,t,n){var r=this;function i(e,t){if(n[e])try{n[e](t)}catch(e){}}return function(n,o){if(r.invalidate(e,!1),n){var a=r.getQuery(e),l=a.observableQuery,s=a.document,u=l?l.options.fetchPolicy:t.fetchPolicy;if("standby"!==u){var c=_(n.networkStatus),f=l&&l.getLastResult(),d=!(!f||f.networkStatus===n.networkStatus),p=t.returnPartialData||!o&&n.previousVariables||d&&t.notifyOnNetworkStatusChange||"cache-only"===u||"cache-and-network"===u;if(!c||p){var m=j(n.graphQLErrors),h=l&&l.options.errorPolicy||t.errorPolicy||"none";if("none"===h&&m||n.networkError)return i("error",new D({graphQLErrors:n.graphQLErrors,networkError:n.networkError}));try{var v=void 0,y=void 0;if(o)"no-cache"!==u&&"network-only"!==u&&r.setQuery(e,(function(){return{newData:null}})),v=o.result,y=!o.complete;else{var b=l&&l.getLastError(),g="none"!==h&&(b&&b.graphQLErrors)!==n.graphQLErrors;if(f&&f.data&&!g)v=f.data,y=!1;else{var w=r.dataStore.getCache().diff({query:s,variables:n.previousVariables||n.variables,returnPartialData:!0,optimistic:!0});v=w.result,y=!w.complete}}var x=y&&!(t.returnPartialData||"cache-only"===u),k={data:x?f&&f.data:v,loading:c,networkStatus:n.networkStatus,stale:x};"all"===h&&m&&(k.errors=n.graphQLErrors),i("next",k)}catch(e){i("error",new D({networkError:e}))}}}}}},e.prototype.transform=function(e){var t=this.transformCache;if(!t.has(e)){var n=this.dataStore.getCache(),r=n.transformDocument(e),i=Object(c.D)(n.transformForLink(r)),o=this.localState.clientQuery(r),a=this.localState.serverQuery(i),l={document:r,hasClientExports:Object(c.r)(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:o,serverQuery:a,defaultVars:Object(c.h)(Object(c.m)(r))},s=function(e){e&&!t.has(e)&&t.set(e,l)};s(e),s(r),s(o),s(a)}return t.get(e)},e.prototype.getVariables=function(e,t){return Object(u.a)({},this.transform(e).defaultVars,t)},e.prototype.watchQuery=function(e,t){void 0===t&&(t=!0),Object(m.b)("standby"!==e.fetchPolicy,11),e.variables=this.getVariables(e.query,e.variables),void 0===e.notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var n=Object(u.a)({},e);return new R({queryManager:this,options:n,shouldSubscribe:t})},e.prototype.query=function(e){var t=this;return Object(m.b)(e.query,12),Object(m.b)("Document"===e.query.kind,13),Object(m.b)(!e.returnPartialData,14),Object(m.b)(!e.pollInterval,15),new Promise((function(n,r){var i=t.watchQuery(e,!1);t.fetchQueryRejectFns.set("query:"+i.queryId,r),i.result().then(n,r).then((function(){return t.fetchQueryRejectFns.delete("query:"+i.queryId)}))}))},e.prototype.generateQueryId=function(){return String(this.idCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){this.stopPollingQuery(e),this.queryStore.stopQuery(e),this.invalidate(e)},e.prototype.addQueryListener=function(e,t){this.setQuery(e,(function(e){return e.listeners.add(t),{invalidated:!1}}))},e.prototype.updateQueryWatch=function(e,t,n){var r=this,i=this.getQuery(e).cancel;i&&i();return this.dataStore.getCache().watch({query:t,variables:n.variables,optimistic:!0,previousResult:function(){var t=null,n=r.getQuery(e).observableQuery;if(n){var i=n.getLastResult();i&&(t=i.data)}return t},callback:function(t){r.setQuery(e,(function(){return{invalidated:!0,newData:t}}))}})},e.prototype.addObservableQuery=function(e,t){this.setQuery(e,(function(){return{observableQuery:t}}))},e.prototype.removeObservableQuery=function(e){var t=this.getQuery(e).cancel;this.setQuery(e,(function(){return{observableQuery:null}})),t&&t()},e.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach((function(e){e(new m.a(16))}));var e=[];return this.queries.forEach((function(t,n){t.observableQuery&&e.push(n)})),this.queryStore.reset(e),this.mutationStore.reset(),this.dataStore.reset()},e.prototype.resetStore=function(){var e=this;return this.clearStore().then((function(){return e.reFetchObservableQueries()}))},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.queries.forEach((function(r,i){var o=r.observableQuery;if(o){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!e&&"standby"===a||n.push(o.refetch()),t.setQuery(i,(function(){return{newData:null}})),t.invalidate(i)}})),this.broadcastQueries(),Promise.all(n)},e.prototype.observeQuery=function(e,t,n){return this.addQueryListener(e,this.queryListenerForObserver(e,t,n)),this.fetchQuery(e,t)},e.prototype.startQuery=function(e,t,n){return this.addQueryListener(e,n),this.fetchQuery(e,t).catch((function(){})),e},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.variables;n=this.transform(n).document,i=this.getVariables(n,i);var o=function(e){return t.getObservableFromLink(n,{},e,!1).map((function(i){if(r&&"no-cache"===r||(t.dataStore.markSubscriptionResult(i,n,e),t.broadcastQueries()),Object(c.q)(i))throw new D({graphQLErrors:i.errors});return i}))};if(this.transform(n).hasClientExports){var a=this.localState.addExportedVariables(n,i).then(o);return new N((function(e){var t=null;return a.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return o(i)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchQueryRejectFns.delete("query:"+e),this.fetchQueryRejectFns.delete("fetchRequest:"+e),this.getQuery(e).subscriptions.forEach((function(e){return e.unsubscribe()})),this.queries.delete(e)},e.prototype.getCurrentQueryResult=function(e,t){void 0===t&&(t=!0);var n=e.options,r=n.variables,i=n.query,o=n.fetchPolicy,a=n.returnPartialData,l=e.getLastResult(),s=this.getQuery(e.queryId).newData;if(s&&s.complete)return{data:s.result,partial:!1};if("no-cache"===o||"network-only"===o)return{data:void 0,partial:!1};var u=this.dataStore.getCache().diff({query:i,variables:r,previousResult:l?l.data:void 0,returnPartialData:!0,optimistic:t}),c=u.result,f=u.complete;return{data:f||a?c:void 0,partial:!f}},e.prototype.getQueryWithPreviousResult=function(e){var t;if("string"==typeof e){var n=this.getQuery(e).observableQuery;Object(m.b)(n,17),t=n}else t=e;var r=t.options,i=r.variables,o=r.query;return{previousResult:this.getCurrentQueryResult(t,!1).data,variables:i,document:o}},e.prototype.broadcastQueries=function(){var e=this;this.onBroadcast(),this.queries.forEach((function(t,n){t.invalidated&&t.listeners.forEach((function(r){r&&r(e.queryStore.get(n),t.newData)}))}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var i,o=this;void 0===r&&(r=this.queryDeduplication);var a=this.transform(e).serverQuery;if(a){var l=this.inFlightLinkObservables,s=this.link,f={query:a,variables:n,operationName:Object(c.n)(a)||void 0,context:this.prepareContext(Object(u.a)({},t,{forceFetch:!r}))};if(t=f.context,r){var d=l.get(a)||new Map;l.set(a,d);var p=JSON.stringify(n);if(!(i=d.get(p))){d.set(p,i=Q(S(s,f)));var m=function(){d.delete(p),d.size||l.delete(a),h.unsubscribe()},h=i.subscribe({next:m,error:m,complete:m})}}else i=Q(S(s,f))}else i=N.of({data:{}}),t=this.prepareContext(t);var v=this.transform(e).clientQuery;return v&&(i=function(e,t){return new N((function(n){var r=n.next,i=n.error,o=n.complete,a=0,l=!1,s={next:function(e){++a,new Promise((function(n){n(t(e))})).then((function(e){--a,r&&r.call(n,e),l&&s.complete()}),(function(e){--a,i&&i.call(n,e)}))},error:function(e){i&&i.call(n,e)},complete:function(){l=!0,a||o&&o.call(n)}},u=e.subscribe(s);return function(){return u.unsubscribe()}}))}(i,(function(e){return o.localState.runResolvers({document:v,remoteResult:e,context:t,variables:n})}))),i},e.prototype.fetchRequest=function(e){var t,n,r=this,i=e.requestId,o=e.queryId,a=e.document,l=e.options,s=e.fetchMoreForQueryId,u=l.variables,c=l.errorPolicy,f=void 0===c?"none":c,d=l.fetchPolicy;return new Promise((function(e,c){var p=r.getObservableFromLink(a,l.context,u),m="fetchRequest:"+o;r.fetchQueryRejectFns.set(m,c);var h=function(){r.fetchQueryRejectFns.delete(m),r.setQuery(o,(function(e){e.subscriptions.delete(v)}))},v=p.map((function(e){if(i>=r.getQuery(o).lastRequestId&&(r.markQueryResult(o,e,l,s),r.queryStore.markQueryResult(o,e,s),r.invalidate(o),r.invalidate(s),r.broadcastQueries()),"none"===f&&j(e.errors))return c(new D({graphQLErrors:e.errors}));if("all"===f&&(n=e.errors),s||"no-cache"===d)t=e.data;else{var p=r.dataStore.getCache().diff({variables:u,query:a,optimistic:!1,returnPartialData:!0}),m=p.result;(p.complete||l.returnPartialData)&&(t=m)}})).subscribe({error:function(e){h(),c(e)},complete:function(){h(),e({data:t,errors:n,loading:!1,networkStatus:T.ready,stale:!1})}});r.setQuery(o,(function(e){e.subscriptions.add(v)}))}))},e.prototype.getQuery=function(e){return this.queries.get(e)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},e.prototype.setQuery=function(e,t){var n=this.getQuery(e),r=Object(u.a)({},n,t(n));this.queries.set(e,r)},e.prototype.invalidate=function(e,t){void 0===t&&(t=!0),e&&this.setQuery(e,(function(){return{invalidated:t}}))},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return Object(u.a)({},t,{clientAwareness:this.clientAwareness})},e.prototype.checkInFlight=function(e){var t=this.queryStore.get(e);return t&&t.networkStatus!==T.ready&&t.networkStatus!==T.error},e.prototype.startPollingQuery=function(e,t,n){var r=this,i=e.pollInterval;if(Object(m.b)(i,18),!this.ssrMode){var o=this.pollingInfoByQueryId.get(t);o||this.pollingInfoByQueryId.set(t,o={}),o.interval=i,o.options=Object(u.a)({},e,{fetchPolicy:"network-only"});var a=function(){var e=r.pollingInfoByQueryId.get(t);e&&(r.checkInFlight(t)?l():r.fetchQuery(t,e.options,I.poll).then(l,l))},l=function(){var e=r.pollingInfoByQueryId.get(t);e&&(clearTimeout(e.timeout),e.timeout=setTimeout(a,e.interval))};n&&this.addQueryListener(t,n),l()}return t},e.prototype.stopPollingQuery=function(e){this.pollingInfoByQueryId.delete(e)},e}(),B=function(){function e(e){this.cache=e}return e.prototype.getCache=function(){return this.cache},e.prototype.markQueryResult=function(e,t,n,r,i){void 0===i&&(i=!1);var o=!Object(c.q)(e);i&&Object(c.q)(e)&&e.data&&(o=!0),!r&&o&&this.cache.write({result:e.data,dataId:"ROOT_QUERY",query:t,variables:n})},e.prototype.markSubscriptionResult=function(e,t,n){Object(c.q)(e)||this.cache.write({result:e.data,dataId:"ROOT_SUBSCRIPTION",query:t,variables:n})},e.prototype.markMutationInit=function(e){var t,n=this;e.optimisticResponse&&(t="function"==typeof e.optimisticResponse?e.optimisticResponse(e.variables):e.optimisticResponse,this.cache.recordOptimisticTransaction((function(r){var i=n.cache;n.cache=r;try{n.markMutationResult({mutationId:e.mutationId,result:{data:t},document:e.document,variables:e.variables,updateQueries:e.updateQueries,update:e.update})}finally{n.cache=i}}),e.mutationId))},e.prototype.markMutationResult=function(e){var t=this;if(!Object(c.q)(e.result)){var n=[{result:e.result.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables}],r=e.updateQueries;r&&Object.keys(r).forEach((function(i){var o=r[i],a=o.query,l=o.updater,s=t.cache.diff({query:a.document,variables:a.variables,returnPartialData:!0,optimistic:!1}),u=s.result;if(s.complete){var f=Object(c.I)((function(){return l(u,{mutationResult:e.result,queryName:Object(c.n)(a.document)||void 0,queryVariables:a.variables})}));f&&n.push({result:f,dataId:"ROOT_QUERY",query:a.document,variables:a.variables})}})),this.cache.performTransaction((function(t){n.forEach((function(e){return t.write(e)}));var r=e.update;r&&Object(c.I)((function(){return r(t,e.result)}))}))}},e.prototype.markMutationComplete=function(e){var t=e.mutationId;e.optimisticResponse&&this.cache.removeOptimistic(t)},e.prototype.markUpdateQueryResult=function(e,t,n){this.cache.write({result:n,dataId:"ROOT_QUERY",variables:t,query:e})},e.prototype.reset=function(){return this.cache.reset()},e}(),G="2.6.4",K=function(){function e(e){var t=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.cache,r=e.ssrMode,i=void 0!==r&&r,o=e.ssrForceFetchDelay,a=void 0===o?0:o,l=e.connectToDevTools,s=e.queryDeduplication,u=void 0===s||s,c=e.defaultOptions,f=e.assumeImmutableResults,d=void 0!==f&&f,p=e.resolvers,h=e.typeDefs,v=e.fragmentMatcher,y=e.name,b=e.version,g=e.link;if(!g&&p&&(g=E.empty()),!g||!n)throw new m.a(1);this.link=g,this.cache=n,this.store=new B(n),this.disableNetworkFetches=i||a>0,this.queryDeduplication=u,this.defaultOptions=c||{},this.typeDefs=h,a&&setTimeout((function(){return t.disableNetworkFetches=!1}),a),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this);void 0!==l&&(l&&"undefined"!=typeof window)&&(window.__APOLLO_CLIENT__=this),this.version=G,this.localState=new z({cache:n,client:this,resolvers:p,fragmentMatcher:v}),this.queryManager=new U({link:this.link,store:this.store,queryDeduplication:u,ssrMode:i,clientAwareness:{name:y,version:b},localState:this.localState,assumeImmutableResults:d,onBroadcast:function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.queryStore.getStore(),mutations:t.queryManager.mutationStore.getStore()},dataWithOptimisticResults:t.cache.extract(!0)})}})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=Object(u.a)({},this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=Object(u.a)({},e,{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=Object(u.a)({},this.defaultOptions.query,e)),Object(m.b)("cache-and-network"!==e.fetchPolicy,2),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=Object(u.a)({},e,{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=Object(u.a)({},this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){var t=this.cache.writeQuery(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeFragment=function(e){var t=this.cache.writeFragment(e);return this.queryManager.broadcastQueries(),t},e.prototype.writeData=function(e){var t=this.cache.writeData(e);return this.queryManager.broadcastQueries(),t},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return S(this.link,e)},e.prototype.initQueryManager=function(){return this.queryManager},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore()})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e}();function W(e){return{kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:H(e)}]}}function H(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e||null==e)return null;if(Array.isArray(e))return H(e[0]);var t=[];return Object.keys(e).forEach((function(n){var r={kind:"Field",name:{kind:"Name",value:n},selectionSet:H(e[n])||void 0};t.push(r)})),{kind:"SelectionSet",selections:t}}var Y,$={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:null,variableDefinitions:null,directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",alias:null,name:{kind:"Name",value:"__typename"},arguments:[],directives:[],selectionSet:null}]}}]},J=function(){function e(){}return e.prototype.transformDocument=function(e){return e},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.read({query:e.query,variables:e.variables,optimistic:t})},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.read({query:Object(c.k)(e.fragment,e.fragmentName),variables:e.variables,rootId:e.id,optimistic:t})},e.prototype.writeQuery=function(e){this.write({dataId:"ROOT_QUERY",result:e.data,query:e.query,variables:e.variables})},e.prototype.writeFragment=function(e){this.write({dataId:e.id,result:e.data,variables:e.variables,query:Object(c.k)(e.fragment,e.fragmentName)})},e.prototype.writeData=function(e){var t,n,r=e.id,i=e.data;if(void 0!==r){var o=null;try{o=this.read({rootId:r,optimistic:!1,query:$})}catch(e){}var a=o&&o.__typename||"__ClientData",l=Object.assign({__typename:a},i);this.writeFragment({id:r,fragment:(t=l,n=a,{kind:"Document",definitions:[{kind:"FragmentDefinition",typeCondition:{kind:"NamedType",name:{kind:"Name",value:n||"__FakeType"}},name:{kind:"Name",value:"GeneratedClientQuery"},selectionSet:H(t)}]}),data:l})}else this.writeQuery({query:W(i),data:i})},e}();Y||(Y={});var X=null,Z={},ee=1,te=Array,ne=te["@wry/context:Slot"]||function(){var e=function(){function e(){this.id=["slot",ee++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=X;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===Z)break;return e!==X&&(X.slots[this.id]=t),!0}return X&&(X.slots[this.id]=Z),!1},e.prototype.getValue=function(){if(this.hasValue())return X.slots[this.id]},e.prototype.withValue=function(e,t,n,r){var i,o=((i={__proto__:null})[this.id]=e,i),a=X;X={parent:a,slots:o};try{return t.apply(r,n)}finally{X=a}},e.bind=function(e){var t=X;return function(){var n=X;try{return X=t,e.apply(this,arguments)}finally{X=n}}},e.noContext=function(e,t,n){if(!X)return e.apply(n,t);var r=X;try{return X=null,e.apply(n,t)}finally{X=r}},e}();try{Object.defineProperty(te,"@wry/context:Slot",{value:te["@wry/context:Slot"]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();ne.bind,ne.noContext;function re(){}var ie=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=re),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getEntry(e);return t&&t.value},e.prototype.getEntry=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getEntry(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),oe=new ne,ae=[],le=[],se=100;function ue(e,t){if(!e)throw new Error(t||"assertion failure")}function ce(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var fe=function(){function e(t,n){this.fn=t,this.args=n,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],++e.count}return e.prototype.recompute=function(){if(ue(!this.recomputing,"already recomputing"),function(e){var t=oe.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),pe(e)?ve(t,e):ye(t,e),t}(this)||!ge(this))return pe(this)?function(e){var t=we(e);oe.withValue(e,de,[e]),function(e){if("function"==typeof e.subscribe)try{ke(e),e.unsubscribe=e.subscribe.apply(null,e.args)}catch(t){return e.setDirty(),!1}return!0}(e)&&function(e){if(e.dirty=!1,pe(e))return;he(e)}(e);return t.forEach(ge),ce(e.value)}(this):ce(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,me(this),ke(this))},e.prototype.dispose=function(){var e=this;we(this).forEach(ge),ke(this),this.parents.forEach((function(t){t.setDirty(),xe(t,e)}))},e.count=0,e}();function de(e){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,e.args)}catch(t){e.value[1]=t}e.recomputing=!1}function pe(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function me(e){e.parents.forEach((function(t){return ve(t,e)}))}function he(e){e.parents.forEach((function(t){return ye(t,e)}))}function ve(e,t){if(ue(e.childValues.has(t)),ue(pe(t)),e.dirtyChildren){if(e.dirtyChildren.has(t))return}else e.dirtyChildren=le.pop()||new Set;e.dirtyChildren.add(t),me(e)}function ye(e,t){ue(e.childValues.has(t)),ue(!pe(t));var n,r,i,o=e.childValues.get(t);0===o.length?e.childValues.set(t,t.value.slice(0)):(n=o,r=t.value,(i=n.length)>0&&i===r.length&&n[i-1]===r[i-1]||e.setDirty()),be(e,t),pe(e)||he(e)}function be(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(le.length0&&(t=[],e.childValues.forEach((function(n,r){xe(e,r),t.push(r)}))),ue(null===e.dirtyChildren),t}function xe(e,t){t.parents.delete(e),e.childValues.delete(t),be(e,t)}function ke(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Ee=function(){function e(e){this.weakness=e}return e.prototype.lookup=function(){for(var e=[],t=0;t-1)},e.prototype.parseIntrospectionResult=function(e){var t={};return e.__schema.types.forEach((function(e){"UNION"!==e.kind&&"INTERFACE"!==e.kind||(t[e.name]=e.possibleTypes.map((function(e){return e.name})))})),t}}(),Object.prototype.hasOwnProperty),Pe=function(){function e(e){var t=this;void 0===e&&(e=Object.create(null)),this.data=e,this.depend=Ce((function(e){return t.data[e]}),{disposable:!0,makeCacheKey:function(e){return e}})}return e.prototype.toObject=function(){return this.data},e.prototype.get=function(e){return this.depend(e),this.data[e]},e.prototype.set=function(e,t){t!==this.data[e]&&(this.data[e]=t,this.depend.dirty(e))},e.prototype.delete=function(e){Ie.call(this.data,e)&&(delete this.data[e],this.depend.dirty(e))},e.prototype.clear=function(){this.replace(null)},e.prototype.replace=function(e){var t=this;e?(Object.keys(e).forEach((function(n){t.set(n,e[n])})),Object.keys(this.data).forEach((function(n){Ie.call(e,n)||t.delete(n)}))):Object.keys(this.data).forEach((function(e){t.delete(e)}))},e}();function De(e){return new Pe(e)}var Re=function(){function e(e){var t=this,n=void 0===e?{}:e,r=n.cacheKeyRoot,i=void 0===r?new Ee(c.e):r,o=n.freezeResults,a=void 0!==o&&o,l=this.executeStoreQuery,s=this.executeSelectionSet,u=this.executeSubSelectedArray;this.freezeResults=a,this.executeStoreQuery=Ce((function(e){return l.call(t,e)}),{makeCacheKey:function(e){var t=e.query,n=e.rootValue,r=e.contextValue,o=e.variableValues,a=e.fragmentMatcher;if(r.store instanceof Pe)return i.lookup(r.store,t,a,JSON.stringify(o),n.id)}}),this.executeSelectionSet=Ce((function(e){return s.call(t,e)}),{makeCacheKey:function(e){var t=e.selectionSet,n=e.rootValue,r=e.execContext;if(r.contextValue.store instanceof Pe)return i.lookup(r.contextValue.store,t,r.fragmentMatcher,JSON.stringify(r.variableValues),n.id)}}),this.executeSubSelectedArray=Ce((function(e){return u.call(t,e)}),{makeCacheKey:function(e){var t=e.field,n=e.array,r=e.execContext;if(r.contextValue.store instanceof Pe)return i.lookup(r.contextValue.store,t,n,JSON.stringify(r.variableValues))}})}return e.prototype.readQueryFromStore=function(e){return this.diffQueryAgainstStore(Object(u.a)({},e,{returnPartialData:!1})).result},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.variables,i=e.previousResult,o=e.returnPartialData,a=void 0===o||o,l=e.rootId,s=void 0===l?"ROOT_QUERY":l,u=e.fragmentMatcherFunction,d=e.config,p=Object(c.o)(n);r=Object(c.c)({},Object(c.h)(p),r);var h={store:t,dataIdFromObject:d&&d.dataIdFromObject,cacheRedirects:d&&d.cacheRedirects||{}},v=this.executeStoreQuery({query:n,rootValue:{type:"id",id:s,generated:!0,typename:"Query"},contextValue:h,variableValues:r,fragmentMatcher:u}),y=v.missing&&v.missing.length>0;return y&&!a&&v.missing.forEach((function(e){if(!e.tolerable)throw new m.a(8)})),i&&Object(f.a)(i,v.result)&&(v.result=i),{result:v.result,complete:!y}},e.prototype.executeStoreQuery=function(e){var t=e.query,n=e.rootValue,r=e.contextValue,i=e.variableValues,o=e.fragmentMatcher,a=void 0===o?Fe:o,l=Object(c.l)(t),s=Object(c.j)(t),u={query:t,fragmentMap:Object(c.g)(s),contextValue:r,variableValues:i,fragmentMatcher:a};return this.executeSelectionSet({selectionSet:l.selectionSet,rootValue:n,execContext:u})},e.prototype.executeSelectionSet=function(e){var t=this,n=e.selectionSet,r=e.rootValue,i=e.execContext,o=i.fragmentMap,a=i.contextValue,l=i.variableValues,s={result:null},f=[],d=a.store.get(r.id),p=d&&d.__typename||"ROOT_QUERY"===r.id&&"Query"||void 0;function h(e){var t;return e.missing&&(s.missing=s.missing||[],(t=s.missing).push.apply(t,e.missing)),e.result}return n.selections.forEach((function(e){var n;if(Object(c.F)(e,l))if(Object(c.t)(e)){var s=h(t.executeField(d,p,e,i));void 0!==s&&f.push(((n={})[Object(c.E)(e)]=s,n))}else{var v=void 0;if(Object(c.v)(e))v=e;else if(!(v=o[e.name.value]))throw new m.a(9);var y=v.typeCondition&&v.typeCondition.name.value,b=!y||i.fragmentMatcher(r,y,a);if(b){var g=t.executeSelectionSet({selectionSet:v.selectionSet,rootValue:r,execContext:i});"heuristic"===b&&g.missing&&(g=Object(u.a)({},g,{missing:g.missing.map((function(e){return Object(u.a)({},e,{tolerable:!0})}))})),f.push(h(g))}}})),s.result=Object(c.B)(f),this.freezeResults,s},e.prototype.executeField=function(e,t,n,r){var i=r.variableValues,o=r.contextValue,a=function(e,t,n,r,i,o){o.resultKey;var a=o.directives,l=n;(r||a)&&(l=Object(c.p)(l,r,a));var s=void 0;if(e&&void 0===(s=e[l])&&i.cacheRedirects&&"string"==typeof t){var u=i.cacheRedirects[t];if(u){var f=u[n];f&&(s=f(e,r,{getCacheKey:function(e){var t=i.dataIdFromObject(e);return t&&Object(c.H)({id:t,typename:e.__typename})}}))}}if(void 0===s)return{result:s,missing:[{object:e,fieldName:l,tolerable:!1}]};Object(c.w)(s)&&(s=s.json);return{result:s}}(e,t,n.name.value,Object(c.b)(n,i),o,{resultKey:Object(c.E)(n),directives:Object(c.i)(n,i)});return Array.isArray(a.result)?this.combineExecResults(a,this.executeSubSelectedArray({field:n,array:a.result,execContext:r})):n.selectionSet?null==a.result?a:this.combineExecResults(a,this.executeSelectionSet({selectionSet:n.selectionSet,rootValue:a.result,execContext:r})):(Ae(n,a.result),this.freezeResults,a)},e.prototype.combineExecResults=function(){for(var e,t=[],n=0;n=0)return!0;n[e].push(t)}else n[e]=[t];return!1}var Ve={fragmentMatcher:new je,dataIdFromObject:function(e){if(e.__typename){if(void 0!==e.id)return e.__typename+":"+e.id;if(void 0!==e._id)return e.__typename+":"+e._id}return null},addTypename:!0,resultCaching:!0,freezeResults:!1};var Ue=Object.prototype.hasOwnProperty,Be=function(e){function t(t,n,r){var i=e.call(this,Object.create(null))||this;return i.optimisticId=t,i.parent=n,i.transaction=r,i}return Object(u.c)(t,e),t.prototype.toObject=function(){return Object(u.a)({},this.parent.toObject(),this.data)},t.prototype.get=function(e){return Ue.call(this.data,e)?this.data[e]:this.parent.get(e)},t}(Me),Ge=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;n.watches=new Set,n.typenameDocumentCache=new Map,n.cacheKeyRoot=new Ee(c.e),n.silenceBroadcast=!1,n.config=Object(u.a)({},Ve,t),n.config.customResolvers&&(n.config.cacheRedirects=n.config.customResolvers),n.config.cacheResolvers&&(n.config.cacheRedirects=n.config.cacheResolvers),n.addTypename=!!n.config.addTypename,n.data=n.config.resultCaching?new Pe:new Me,n.optimisticData=n.data,n.storeWriter=new qe,n.storeReader=new Re({cacheKeyRoot:n.cacheKeyRoot,freezeResults:t.freezeResults});var r=n,i=r.maybeBroadcastWatch;return n.maybeBroadcastWatch=Ce((function(e){return i.call(n,e)}),{makeCacheKey:function(e){if(!e.optimistic&&!e.previousResult)return r.data instanceof Pe?r.cacheKeyRoot.lookup(e.query,JSON.stringify(e.variables)):void 0}}),n}return Object(u.c)(t,e),t.prototype.restore=function(e){return e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).toObject()},t.prototype.read=function(e){if("string"==typeof e.rootId&&void 0===this.data.get(e.rootId))return null;var t=this.config.fragmentMatcher,n=t&&t.match;return this.storeReader.readQueryFromStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,rootId:e.rootId,fragmentMatcherFunction:n,previousResult:e.previousResult,config:this.config})||null},t.prototype.write=function(e){var t=this.config.fragmentMatcher,n=t&&t.match;this.storeWriter.writeResultToStore({dataId:e.dataId,result:e.result,variables:e.variables,document:this.transformDocument(e.query),store:this.data,dataIdFromObject:this.config.dataIdFromObject,fragmentMatcherFunction:n}),this.broadcastWatches()},t.prototype.diff=function(e){var t=this.config.fragmentMatcher,n=t&&t.match;return this.storeReader.diffQueryAgainstStore({store:e.optimistic?this.optimisticData:this.data,query:this.transformDocument(e.query),variables:e.variables,returnPartialData:e.returnPartialData,previousResult:e.previousResult,fragmentMatcherFunction:n,config:this.config})},t.prototype.watch=function(e){var t=this;return this.watches.add(e),function(){t.watches.delete(e)}},t.prototype.evict=function(e){throw new m.a(1)},t.prototype.reset=function(){return this.data.clear(),this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){for(var t=[],n=0,r=this.optimisticData;r instanceof Be;)r.optimisticId===e?++n:t.push(r),r=r.parent;if(n>0){for(this.optimisticData=r;t.length>0;){var i=t.pop();this.performTransaction(i.transaction,i.optimisticId)}this.broadcastWatches()}},t.prototype.performTransaction=function(e,t){var n=this.data,r=this.silenceBroadcast;this.silenceBroadcast=!0,"string"==typeof t&&(this.data=this.optimisticData=new Be(t,this.optimisticData,e));try{e(this)}finally{this.silenceBroadcast=r,this.data=n}this.broadcastWatches()},t.prototype.recordOptimisticTransaction=function(e,t){return this.performTransaction(e,t)},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=Object(c.a)(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(){var e=this;this.silenceBroadcast||this.watches.forEach((function(t){return e.maybeBroadcastWatch(t)}))},t.prototype.maybeBroadcastWatch=function(e){e.callback(this.diff({query:e.query,variables:e.variables,previousResult:e.previousResult&&e.previousResult(),optimistic:e.optimistic}))},t}(J),Ke=n(8);function We(e){return Object(C.b)(e,{leave:He})}var He={Name:function(e){return e.value},Variable:function(e){return"$"+e.name},Document:function(e){return $e(e.definitions,"\n\n")+"\n"},OperationDefinition:function(e){var t=e.operation,n=e.name,r=Xe("(",$e(e.variableDefinitions,", "),")"),i=$e(e.directives," "),o=e.selectionSet;return n||i||r||"query"!==t?$e([t,$e([n,r]),i,o]," "):o},VariableDefinition:function(e){var t=e.variable,n=e.type,r=e.defaultValue,i=e.directives;return t+": "+n+Xe(" = ",r)+Xe(" ",$e(i," "))},SelectionSet:function(e){return Je(e.selections)},Field:function(e){var t=e.alias,n=e.name,r=e.arguments,i=e.directives,o=e.selectionSet;return $e([Xe("",t,": ")+n+Xe("(",$e(r,", "),")"),$e(i," "),o]," ")},Argument:function(e){return e.name+": "+e.value},FragmentSpread:function(e){return"..."+e.name+Xe(" ",$e(e.directives," "))},InlineFragment:function(e){var t=e.typeCondition,n=e.directives,r=e.selectionSet;return $e(["...",Xe("on ",t),$e(n," "),r]," ")},FragmentDefinition:function(e){var t=e.name,n=e.typeCondition,r=e.variableDefinitions,i=e.directives,o=e.selectionSet;return("fragment ".concat(t).concat(Xe("(",$e(r,", "),")")," ")+"on ".concat(n," ").concat(Xe("",$e(i," ")," "))+o)},IntValue:function(e){return e.value},FloatValue:function(e){return e.value},StringValue:function(e,t){var n=e.value;return e.block?Object(Ke.b)(n,"description"===t?"":" "):JSON.stringify(n)},BooleanValue:function(e){return e.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(e){return e.value},ListValue:function(e){return"["+$e(e.values,", ")+"]"},ObjectValue:function(e){return"{"+$e(e.fields,", ")+"}"},ObjectField:function(e){return e.name+": "+e.value},Directive:function(e){return"@"+e.name+Xe("(",$e(e.arguments,", "),")")},NamedType:function(e){return e.name},ListType:function(e){return"["+e.type+"]"},NonNullType:function(e){return e.type+"!"},SchemaDefinition:function(e){var t=e.directives,n=e.operationTypes;return $e(["schema",$e(t," "),Je(n)]," ")},OperationTypeDefinition:function(e){return e.operation+": "+e.type},ScalarTypeDefinition:Ye((function(e){return $e(["scalar",e.name,$e(e.directives," ")]," ")})),ObjectTypeDefinition:Ye((function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return $e(["type",t,Xe("implements ",$e(n," & ")),$e(r," "),Je(i)]," ")})),FieldDefinition:Ye((function(e){var t=e.name,n=e.arguments,r=e.type,i=e.directives;return t+(tt(n)?Xe("(\n",Ze($e(n,"\n")),"\n)"):Xe("(",$e(n,", "),")"))+": "+r+Xe(" ",$e(i," "))})),InputValueDefinition:Ye((function(e){var t=e.name,n=e.type,r=e.defaultValue,i=e.directives;return $e([t+": "+n,Xe("= ",r),$e(i," ")]," ")})),InterfaceTypeDefinition:Ye((function(e){var t=e.name,n=e.directives,r=e.fields;return $e(["interface",t,$e(n," "),Je(r)]," ")})),UnionTypeDefinition:Ye((function(e){var t=e.name,n=e.directives,r=e.types;return $e(["union",t,$e(n," "),r&&0!==r.length?"= "+$e(r," | "):""]," ")})),EnumTypeDefinition:Ye((function(e){var t=e.name,n=e.directives,r=e.values;return $e(["enum",t,$e(n," "),Je(r)]," ")})),EnumValueDefinition:Ye((function(e){return $e([e.name,$e(e.directives," ")]," ")})),InputObjectTypeDefinition:Ye((function(e){var t=e.name,n=e.directives,r=e.fields;return $e(["input",t,$e(n," "),Je(r)]," ")})),DirectiveDefinition:Ye((function(e){var t=e.name,n=e.arguments,r=e.repeatable,i=e.locations;return"directive @"+t+(tt(n)?Xe("(\n",Ze($e(n,"\n")),"\n)"):Xe("(",$e(n,", "),")"))+(r?" repeatable":"")+" on "+$e(i," | ")})),SchemaExtension:function(e){var t=e.directives,n=e.operationTypes;return $e(["extend schema",$e(t," "),Je(n)]," ")},ScalarTypeExtension:function(e){return $e(["extend scalar",e.name,$e(e.directives," ")]," ")},ObjectTypeExtension:function(e){var t=e.name,n=e.interfaces,r=e.directives,i=e.fields;return $e(["extend type",t,Xe("implements ",$e(n," & ")),$e(r," "),Je(i)]," ")},InterfaceTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return $e(["extend interface",t,$e(n," "),Je(r)]," ")},UnionTypeExtension:function(e){var t=e.name,n=e.directives,r=e.types;return $e(["extend union",t,$e(n," "),r&&0!==r.length?"= "+$e(r," | "):""]," ")},EnumTypeExtension:function(e){var t=e.name,n=e.directives,r=e.values;return $e(["extend enum",t,$e(n," "),Je(r)]," ")},InputObjectTypeExtension:function(e){var t=e.name,n=e.directives,r=e.fields;return $e(["extend input",t,$e(n," "),Je(r)]," ")}};function Ye(e){return function(t){return $e([t.description,e(t)],"\n")}}function $e(e,t){return e?e.filter((function(e){return e})).join(t||""):""}function Je(e){return e&&0!==e.length?"{\n"+Ze($e(e,"\n"))+"\n}":""}function Xe(e,t,n){return t?e+t+(n||""):""}function Ze(e){return e&&" "+e.replace(/\n/g,"\n ")}function et(e){return-1!==e.indexOf("\n")}function tt(e){return e&&e.some(et)}var nt={http:{includeQuery:!0,includeExtensions:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},rt=function(e,t,n){var r=new Error(n);throw r.name="ServerError",r.response=e,r.statusCode=e.status,r.result=t,r},it=function(e,t){var n;try{n=JSON.stringify(e)}catch(e){var r=new m.a(2);throw r.parseError=e,r}return n},ot=function(e){void 0===e&&(e={});var t=e.uri,n=void 0===t?"/graphql":t,r=e.fetch,i=e.includeExtensions,o=e.useGETForQueries,a=Object(u.e)(e,["uri","fetch","includeExtensions","useGETForQueries"]);!function(e){if(!e&&"undefined"==typeof fetch){throw"undefined"==typeof window&&"node-fetch",new m.a(1)}}(r),r||(r=fetch);var l={http:{includeExtensions:i},options:a.fetchOptions,credentials:a.credentials,headers:a.headers};return new E((function(e){var t=function(e,t){var n=e.getContext().uri;return n||("function"==typeof t?t(e):t||"/graphql")}(e,n),i=e.getContext(),a={};if(i.clientAwareness){var s=i.clientAwareness,c=s.name,f=s.version;c&&(a["apollographql-client-name"]=c),f&&(a["apollographql-client-version"]=f)}var d,m=Object(u.a)({},a,i.headers),h={http:i.http,options:i.fetchOptions,credentials:i.credentials,headers:m},y=function(e,t){for(var n=[],r=2;r=300&&rt(e,t,"Response not successful: Received status code "+e.status),Array.isArray(t)||t.hasOwnProperty("data")||t.hasOwnProperty("errors")||rt(e,t,"Server response was missing for query '"+(Array.isArray(i)?i.map((function(e){return e.operationName})):i.operationName)+"'."),t}))})).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){d&&d.abort()}}))}))};var at=function(e){function t(t){return e.call(this,ot(t).request)||this}return Object(u.c)(t,e),t}(E);function lt(e){return new E((function(t,n){return new p((function(r){var i,o,a;try{i=n(t).subscribe({next:function(i){i.errors&&(a=e({graphQLErrors:i.errors,response:i,operation:t,forward:n}))?o=a.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}):r.next(i)},error:function(i){(a=e({operation:t,networkError:i,graphQLErrors:i&&i.result&&i.result.errors,forward:n}))?o=a.subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)}):r.error(i)},complete:function(){a||r.complete.bind(r)()}})}catch(i){e({networkError:i,operation:t,forward:n}),r.error(i)}return function(){i&&i.unsubscribe(),o&&i.unsubscribe()}}))}))}!function(e){function t(t){var n=e.call(this)||this;return n.link=lt(t),n}Object(u.c)(t,e),t.prototype.request=function(e,t){return this.link.request(e,t)}}(E);var st=["request","uri","credentials","headers","fetch","fetchOptions","clientState","onError","cacheRedirects","cache","name","version","resolvers","typeDefs","fragmentMatcher"],ut=function(e){function t(t){void 0===t&&(t={});t&&Object.keys(t).filter((function(e){return-1===st.indexOf(e)})).length;var n=t.request,r=t.uri,i=t.credentials,o=t.headers,a=t.fetch,l=t.fetchOptions,s=t.clientState,u=t.cacheRedirects,c=t.onError,f=t.name,d=t.version,h=t.resolvers,v=t.typeDefs,y=t.fragmentMatcher,b=t.cache;Object(m.b)(!b||!u,1),b||(b=u?new Ge({cacheRedirects:u}):new Ge);var g=lt(c||function(e){var t=e.graphQLErrors;e.networkError;t&&t.map((function(e){e.message,e.locations,e.path;return!0}))}),w=!!n&&new E((function(e,t){return new p((function(r){var i;return Promise.resolve(e).then((function(e){return n(e)})).then((function(){i=t(e).subscribe({next:r.next.bind(r),error:r.error.bind(r),complete:r.complete.bind(r)})})).catch(r.error.bind(r)),function(){i&&i.unsubscribe()}}))})),x=new at({uri:r||"/graphql",fetch:a,fetchOptions:l||{},credentials:i||"same-origin",headers:o||{}}),k=E.from([g,w,x].filter((function(e){return!!e}))),S=h,T=v,O=y;return s&&(s.defaults&&b.writeData({data:s.defaults}),S=s.resolvers,T=s.typeDefs,O=s.fragmentMatcher),e.call(this,{cache:b,link:k,name:f,version:d,resolvers:S,typeDefs:T,fragmentMatcher:O})||this}return Object(u.c)(t,e),t}(K),ct=n(24),ft=n.n(ct),dt=n(25),pt=n.n(dt),mt=n(6),ht=n.n(mt);n.d(t,"yetibotEval",(function(){return wt}));const vt=document.querySelector(".core-team");if(vt){const e=ht.a.createFactory(ft.a);pt.a.render(e({org:"yetibot",shouldShuffle:!1,columns:6}),vt)}const yt=new ut({uri:"http://localhost:3003/graphql"}),bt=document.querySelector(".toc.column .content");console.log(bt),bt&&(window.innerWidth>768&&a.a.init({tocSelector:".toc .content",contentSelector:".main-content",headingSelector:"h1, h2, h3, h4",positionFixedSelector:".toc.column .content",positionFixedClass:"fixed",fixedSidebarOffset:230,headingsOffset:-15}),bt.classList.add("ready"));const gt=s.a` query EvalQuery($expr: String!) { eval(expr: $expr) } diff --git a/src/index.js b/src/index.js index 30e684dd..1f1543ed 100644 --- a/src/index.js +++ b/src/index.js @@ -20,9 +20,9 @@ if (team) { }), team); } -const endpoint = "https://public.yetibot.com/graphql"; +// const endpoint = "https://public.yetibot.com/graphql"; // switch to this for local dev against yetibot.core -// const endpoint = "http://localhost:3003/graphql"; +const endpoint = "http://localhost:3003/graphql"; const client = new ApolloClient({uri: endpoint}); // TOC interactive - desktop only for now From e7ce9a886309073eee3d162250c41ec291e96a70 Mon Sep 17 00:00:00 2001 From: Trevor Hartman Date: Fri, 17 Jul 2020 13:10:46 -0600 Subject: [PATCH 5/5] Update hierarchy post --- .../2020-06-11-a-hierarchy-of-context.md | 67 +++++++++++-------- 1 file changed, 39 insertions(+), 28 deletions(-) diff --git a/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md b/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md index 3b5c0199..2fb2461b 100644 --- a/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md +++ b/resources/templates/md/posts/2020-06-11-a-hierarchy-of-context.md @@ -1,9 +1,9 @@ -{:title "Guide: A Hierarchy of Context" +{:title "A Hierarchy of Context" :layout :post :toc true :author "@devth" :summary "Mine, ours, theirs" - :tags ["guide" "2020" "ops" "config"]} + :tags ["2020" "ops" "config"]} ```yetibot !complete context is @@ -12,37 +12,32 @@ Context is everything. It acts as a constraining factor, letting us make assumptions, frames ideas, and is at the heart of every delightful UX and DX. -In chat systems, we can construct a hierarchy of context. Let's start with the -widest. +In chat systems, we can construct a hierarchy of context. From widest to +narrowest: -## Global +- **Global**: when a message arrives, we ignore everything about its origin, + such as the adapter and channel it originated from or the user responsible for + sending it. The global context spans an entire Yetibot instance across all + configured adapters. -When a message arrives, we can ignore everything about its origin, such as the -channel it came from or user responsible for sending it. This is the -**global context**. It spans an entire Yetibot instance across all configured -adapters. +- **Adapter**: slightly more specific than global, when a message arrives we + dispatch on the adapter that it originated from. -## Adapter +- **Channel**: next on the spectrum, we dispatch on the channel that a message + originated from, but again ignore who sent it. The channel context is useful + for parameterizing things at the **team** level, such as the issue tracker + project key, ssh servers, github repos, the group's favorite stock prices, + whether or not embedded commands are enabled, or the local fallback command. -Slightly more specific, when a message arrives we can look at the adapter that -it originated from. This is the **adapter context**. +- **Our**: this context is similar to **channel**, except it's dynamically + determined by the set of users present in a channel. That means when a user + joins or leaves a channel, the context of values are automatically adjusted, + making it a more organic set of values than channel KVs. -## Channel - -Next on the spectrum, when a message arrives, we can look at the channel that it -originated from, but again ignore who sent it. This is the **channel context**. We -can parameterize things at the team level per channel. Things like the issue -tracking project, the locations to check for weather, the group's favorite stock -prices, whether or not embedded commands are enabled, or the local fallback -command. - -## User - -Finally, when a message arrives, we can can look at the user who sent it, which -is of course the **user context**. This is our narrowest context, and is the lever -for varying parameters between users. This may be a user's zip code, GitHub -username, or any other user-specific parameter that could vary across built in -commands or aliases. +- **User**: finally, we dispatch on user who sent a message. This is our + narrowest context, and is the lever for varying parameters between users. This + may be a user's zip code, GitHub username, or any other user-specific + parameter that could vary across built in commands or aliases. ## Usage and examples @@ -65,6 +60,12 @@ There are a couple ways to do this. But first, let's define a helper alias: !alias loctemp = "weather $s | render {{temp|multiply:1.8|add:32|round}}°F, Humidity {{rh}}% - {{weather.description}}, {{city_name}}, {{state_code}} {{country_code}}" ``` +Try it: + +```yetibot +!loctemp Seattle +``` + #### Channel settings Now, let's say you have people in the channel from Seattle, Chicago, and New @@ -126,6 +127,16 @@ Now if another user specified: ```yetibot ``` +### Hierarchy + +The above examples demonstrate how to pull values from a specific context, but +we can also dynamically resolve a value from the narrowest available context. + + +### Dealing with unset values + +So far we've assumed config + ## Future In the future, as part of