UNPKG

altair-static

Version:

Static package for altair graphql client

3 lines (2 loc) 248 kB
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="82d0cc08-bd83-5665-a091-00e9a933ec64")}catch(e){}}(); (self.webpackChunkaltair=self.webpackChunkaltair||[]).push([[460],{95317:(ee,_,i)=>{"use strict";i.d(_,{k:()=>k});var y=i(31351),N=i(48126),k=function(){function g(){this.getFragmentDoc=(0,y.LV)(N.ct)}return g.prototype.recordOptimisticTransaction=function(I,C){this.performTransaction(I,C)},g.prototype.transformDocument=function(I){return I},g.prototype.identify=function(I){},g.prototype.gc=function(){return[]},g.prototype.modify=function(I){return!1},g.prototype.transformForLink=function(I){return I},g.prototype.readQuery=function(I,C){return void 0===C&&(C=!!I.optimistic),this.read({rootId:I.id||"ROOT_QUERY",query:I.query,variables:I.variables,returnPartialData:I.returnPartialData,optimistic:C})},g.prototype.readFragment=function(I,C){return void 0===C&&(C=!!I.optimistic),this.read({query:this.getFragmentDoc(I.fragment,I.fragmentName),variables:I.variables,rootId:I.id,returnPartialData:I.returnPartialData,optimistic:C})},g.prototype.writeQuery=function(I){return this.write({dataId:I.id||"ROOT_QUERY",result:I.data,query:I.query,variables:I.variables,broadcast:I.broadcast})},g.prototype.writeFragment=function(I){return this.write({dataId:I.id,result:I.data,variables:I.variables,query:this.getFragmentDoc(I.fragment,I.fragmentName),broadcast:I.broadcast})},g}()},13559:(ee,_,i)=>{"use strict";var y;i.d(_,{l:()=>y}),y||(y={})},17152:(ee,_,i)=>{"use strict";i.d(_,{Z:()=>y});var y=function(){return function N(k,g,I,C,h){this.message=k,this.path=g,this.query=I,this.clientOnly=C,this.variables=h}}()},29901:(ee,_,i)=>{"use strict";i.d(_,{$3:()=>g,T9:()=>c,d1:()=>b,gk:()=>C,iJ:()=>h,mv:()=>M});var y=i(65769),N=i(53353),k=i(20317),g=Object.prototype.hasOwnProperty,C=/^[_a-z][_0-9a-z]*/i;function h(E){var L=E.match(C);return L?L[0]:E}function c(E,L,o){return!(!L||"object"!=typeof L)&&(Array.isArray(L)?L.every(function(P){return c(E,P,o)}):E.selections.every(function(P){if((0,y.dt)(P)&&(0,N.MS)(P,o)){var l=(0,y.ue)(P);return g.call(L,l)&&(!P.selectionSet||c(P.selectionSet,L[l],o))}return!0}))}function b(E){return null!==E&&"object"==typeof E&&!(0,y.A_)(E)&&!Array.isArray(E)}function M(){return new k.ZI}},57280:(ee,_,i)=>{"use strict";i.d(_,{D:()=>j});var U,r,y=i(40909),N=i(31351),k=i(95317),g=i(17152),I=i(65769),C=i(61355),h=i(65812),c=i(37179),b=i(48126),M=i(53353),E=i(20317),L=i(16409),o=i(20194),P=i(64422),l=i(29901),O=Object.create(null),v=function(){return O},m=Object.create(null),A=function(){function U(r,d){var p=this;this.policies=r,this.group=d,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(S,D){return(0,o.G)((0,I.A_)(S)?p.get(S.__ref,D):S&&S[D])},this.canRead=function(S){return(0,I.A_)(S)?p.has(S.__ref):"object"==typeof S},this.toReference=function(S,D){if("string"==typeof S)return(0,I.WU)(S);if((0,I.A_)(S))return S;var B=p.policies.identify(S)[0];if(B){var q=(0,I.WU)(B);return D&&p.merge(B,S),q}}}return U.prototype.toObject=function(){return(0,y.__assign)({},this.data)},U.prototype.has=function(r){return void 0!==this.lookup(r,!0)},U.prototype.get=function(r,d){if(this.group.depend(r,d),l.$3.call(this.data,r)){var p=this.data[r];if(p&&l.$3.call(p,d))return p[d]}return"__typename"===d&&l.$3.call(this.policies.rootTypenamesById,r)?this.policies.rootTypenamesById[r]:this instanceof W?this.parent.get(r,d):void 0},U.prototype.lookup=function(r,d){return d&&this.group.depend(r,"__exists"),l.$3.call(this.data,r)?this.data[r]:this instanceof W?this.parent.lookup(r,d):this.policies.rootTypenamesById[r]?Object.create(null):void 0},U.prototype.merge=function(r,d){var p=this,S=this.lookup(r),D=new E.ZI(u).merge(S,d);if(this.data[r]=D,D!==S&&(delete this.refs[r],this.group.caching)){var B=Object.create(null);S||(B.__exists=1),Object.keys(d).forEach(function(q){if(!S||S[q]!==D[q]){B[q]=1;var $=(0,l.iJ)(q);$!==q&&!p.policies.hasKeyArgs(D.__typename,$)&&(B[$]=1),void 0===D[q]&&!(p instanceof W)&&delete D[q]}}),Object.keys(B).forEach(function(q){return p.group.dirty(r,q)})}},U.prototype.modify=function(r,d){var p=this,S=this.lookup(r);if(S){var D=Object.create(null),B=!1,q=!0,$={DELETE:O,INVALIDATE:m,isReference:I.A_,toReference:this.toReference,canRead:this.canRead,readField:function(Z,ne){return p.policies.readField("string"==typeof Z?{fieldName:Z,from:ne||(0,I.WU)(r)}:Z,{store:p})}};if(Object.keys(S).forEach(function(Z){var ne=(0,l.iJ)(Z),ae=S[Z];if(void 0!==ae){var ie="function"==typeof d?d:d[Z]||d[ne];if(ie){var se=ie===v?O:ie((0,o.G)(ae),(0,y.__assign)((0,y.__assign)({},$),{fieldName:ne,storeFieldName:Z,storage:p.getStorage(r,Z)}));se===m?p.group.dirty(r,Z):(se===O&&(se=void 0),se!==ae&&(D[Z]=se,B=!0,ae=se))}void 0!==ae&&(q=!1)}}),B)return this.merge(r,D),q&&(this instanceof W?this.data[r]=void 0:delete this.data[r],this.group.dirty(r,"__exists")),!0}return!1},U.prototype.delete=function(r,d,p){var S,D=this.lookup(r);if(D){var B=this.getFieldValue(D,"__typename"),q=d&&p?this.policies.getStoreFieldName({typename:B,fieldName:d,args:p}):d;return this.modify(r,q?((S={})[q]=v,S):v)}return!1},U.prototype.evict=function(r){var d=!1;return r.id&&(l.$3.call(this.data,r.id)&&(d=this.delete(r.id,r.fieldName,r.args)),this instanceof W&&(d=this.parent.evict(r)||d),(r.fieldName||d)&&this.group.dirty(r.id,r.fieldName||"__exists")),d},U.prototype.clear=function(){this.replace(null)},U.prototype.extract=function(){var r=this,d=this.toObject(),p=[];return this.getRootIdSet().forEach(function(S){l.$3.call(r.policies.rootTypenamesById,S)||p.push(S)}),p.length&&(d.__META={extraRootIds:p.sort()}),d},U.prototype.replace=function(r){var d=this;if(Object.keys(this.data).forEach(function(D){r&&l.$3.call(r,D)||d.delete(D)}),r){var p=r.__META,S=(0,y.__rest)(r,["__META"]);Object.keys(S).forEach(function(D){d.merge(D,S[D])}),p&&p.extraRootIds.forEach(this.retain,this)}},U.prototype.retain=function(r){return this.rootIds[r]=(this.rootIds[r]||0)+1},U.prototype.release=function(r){if(this.rootIds[r]>0){var d=--this.rootIds[r];return d||delete this.rootIds[r],d}return 0},U.prototype.getRootIdSet=function(r){return void 0===r&&(r=new Set),Object.keys(this.rootIds).forEach(r.add,r),this instanceof W?this.parent.getRootIdSet(r):Object.keys(this.policies.rootTypenamesById).forEach(r.add,r),r},U.prototype.gc=function(){var r=this,d=this.getRootIdSet(),p=this.toObject();d.forEach(function(B){l.$3.call(p,B)&&(Object.keys(r.findChildRefIds(B)).forEach(d.add,d),delete p[B])});var S=Object.keys(p);if(S.length){for(var D=this;D instanceof W;)D=D.parent;S.forEach(function(B){return D.delete(B)})}return S},U.prototype.findChildRefIds=function(r){if(!l.$3.call(this.refs,r)){var d=this.refs[r]=Object.create(null),p=new Set([this.data[r]]),S=function(D){return null!==D&&"object"==typeof D};p.forEach(function(D){(0,I.A_)(D)?d[D.__ref]=!0:S(D)&&Object.values(D).filter(S).forEach(p.add,p)})}return this.refs[r]},U.prototype.makeCacheKey=function(){for(var r=[],d=0;d<arguments.length;d++)r[d]=arguments[d];return this.group.keyMaker.lookupArray(r)},U}(),K=function(){function U(r){this.caching=r,this.d=null,this.keyMaker=new N.oZ(P.e),this.d=r?(0,N.yN)():null}return U.prototype.depend=function(r,d){if(this.d){this.d(Q(r,d));var p=(0,l.iJ)(d);p!==d&&this.d(Q(r,p))}},U.prototype.dirty=function(r,d){this.d&&this.d.dirty(Q(r,d))},U}();function Q(U,r){return r+"#"+U}r=function(d){function p(S){var B=S.resultCaching,q=void 0===B||B,$=S.seed,Z=d.call(this,S.policies,new K(q))||this;return Z.storageTrie=new N.oZ(P.e),Z.sharedLayerGroup=new K(q),$&&Z.replace($),Z}return(0,y.__extends)(p,d),p.prototype.addLayer=function(S,D){return new W(S,this,D,this.sharedLayerGroup)},p.prototype.removeLayer=function(){return this},p.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},p}(U=A||(A={})),U.Root=r;var W=function(U){function r(d,p,S,D){var B=U.call(this,p.policies,D)||this;return B.id=d,B.parent=p,B.replay=S,B.group=D,S(B),B}return(0,y.__extends)(r,U),r.prototype.addLayer=function(d,p){return new r(d,this,p,this.group)},r.prototype.removeLayer=function(d){var p=this,S=this.parent.removeLayer(d);return d===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(D){p.data[D]!==S.lookup(D)&&p.delete(D)}),S):S===this.parent?this:S.addLayer(this.id,this.replay)},r.prototype.toObject=function(){return(0,y.__assign)((0,y.__assign)({},this.parent.toObject()),this.data)},r.prototype.findChildRefIds=function(d){var p=this.parent.findChildRefIds(d);return l.$3.call(this.data,d)?(0,y.__assign)((0,y.__assign)({},p),U.prototype.findChildRefIds.call(this,d)):p},r.prototype.getStorage=function(){for(var d=this.parent;d.parent;)d=d.parent;return d.getStorage.apply(d,arguments)},r}(A);function u(U,r,d){var p=U[d],S=r[d];return(0,L.L)(p,S)?p:S}function R(U){return!!(U instanceof A&&U.group.caching)}function n(U,r){return new g.Z(U.message,r.path.slice(),r.query,r.clientOnly,r.variables)}var e=function(){function U(r){var d=this;this.config=r,this.executeSelectionSet=(0,N.LV)(function(p){return d.execSelectionSetImpl(p)},{keyArgs:function(p){return[p.selectionSet,p.objectOrReference,p.context]},makeCacheKey:function(p,S,D){if(R(D.store))return D.store.makeCacheKey(p,(0,I.A_)(S)?S.__ref:S,D.varString)}}),this.knownResults=new WeakMap,this.executeSubSelectedArray=(0,N.LV)(function(p){return d.execSubSelectedArrayImpl(p)},{makeCacheKey:function(p){var S=p.field,D=p.array,B=p.context;if(R(B.store))return B.store.makeCacheKey(S,D,B.varString)}}),this.config=(0,y.__assign)({addTypename:!0},r)}return U.prototype.diffQueryAgainstStore=function(r){var d=r.store,p=r.query,S=r.rootId,D=void 0===S?"ROOT_QUERY":S,B=r.variables,q=r.returnPartialData,$=void 0===q||q,Z=this.config.cache.policies;B=(0,y.__assign)((0,y.__assign)({},(0,c.wY)((0,c.AT)(p))),B);var ne=this.executeSelectionSet({selectionSet:(0,c.Vn)(p).selectionSet,objectOrReference:(0,I.WU)(D),context:{store:d,query:p,policies:Z,variables:B,varString:JSON.stringify(B),fragmentMap:(0,b.JG)((0,c.zK)(p)),path:[],clientOnly:!1}}),ae=ne.missing&&ne.missing.length>0;if(ae&&!$)throw ne.missing[0];return{result:ne.result,missing:ne.missing,complete:!ae}},U.prototype.isFresh=function(r,d,p,S){if(R(S.store)&&this.knownResults.get(r)===p){var D=this.executeSelectionSet.peek(p,d,S);if(D&&r===D.result)return!0}return!1},U.prototype.execSelectionSetImpl=function(r){var d=this,p=r.selectionSet,S=r.objectOrReference,D=r.context;if((0,I.A_)(S)&&!D.policies.rootTypenamesById[S.__ref]&&!D.store.has(S.__ref))return{result:{},missing:[n(new h.zU(4),D)]};var B=D.variables,q=D.policies,Z=[],ne={result:null},ae=D.store.getFieldValue(S,"__typename");function ie(){return ne.missing||(ne.missing=[])}function se(oe){var ce;return oe.missing&&(ce=ie()).push.apply(ce,oe.missing),oe.result}this.config.addTypename&&"string"==typeof ae&&!q.rootIdsByTypename[ae]&&Z.push({__typename:ae});var ue=new Set(p.selections);return ue.forEach(function(oe){var ce;if((0,M.MS)(oe,B))if((0,I.dt)(oe)){var F=q.readField({fieldName:oe.name.value,field:oe,variables:D.variables,from:S},D),a=(0,I.ue)(oe);D.path.push(a);var f=D.clientOnly;D.clientOnly=f||!(!oe.directives||!oe.directives.some(function(J){return"client"===J.name.value})),void 0===F?C.XY.added(oe)||ie().push(n(new h.zU(5),D)):Array.isArray(F)?F=se(d.executeSubSelectedArray({field:oe,array:F,context:D})):oe.selectionSet&&null!=F&&(F=se(d.executeSelectionSet({selectionSet:oe.selectionSet,objectOrReference:F,context:D}))),void 0!==F&&Z.push(((ce={})[a]=F,ce)),D.clientOnly=f,(0,h.V1)(D.path.pop()===a)}else{var V=(0,b.HQ)(oe,D.fragmentMap);V&&q.fragmentMatches(V,ae)&&V.selectionSet.selections.forEach(ue.add,ue)}}),ne.result=(0,E.IM)(Z),this.knownResults.set(ne.result,p),ne},U.prototype.execSubSelectedArrayImpl=function(r){var B,d=this,p=r.field,S=r.array,D=r.context;function q($,Z){return $.missing&&(B=B||[]).push.apply(B,$.missing),(0,h.V1)(D.path.pop()===Z),$.result}return p.selectionSet&&(S=S.filter(D.store.canRead)),{result:S=S.map(function($,Z){return null===$?null:(D.path.push(Z),Array.isArray($)?q(d.executeSubSelectedArray({field:p,array:$,context:D}),Z):p.selectionSet?q(d.executeSelectionSet({selectionSet:p.selectionSet,objectOrReference:$,context:D}),Z):((0,h.V1)(D.path.pop()===Z),$))}),missing:B}},U}(),s=function(){function U(r,d){this.cache=r,this.reader=d}return U.prototype.writeToStore=function(r){var d=r.query,p=r.result,S=r.dataId,D=r.store,B=r.variables,q=(0,c.Vu)(d),$=(0,l.mv)();B=(0,y.__assign)((0,y.__assign)({},(0,c.wY)(q)),B);var Z=this.processSelectionSet({result:p||Object.create(null),dataId:S,selectionSet:q.selectionSet,mergeTree:{map:new Map},context:{store:D,written:Object.create(null),merge:function(ne,ae){return $.merge(ne,ae)},variables:B,varString:JSON.stringify(B),fragmentMap:(0,b.JG)((0,c.zK)(d))}});if(!(0,I.A_)(Z))throw new h.zU(7);return D.retain(Z.__ref),Z},U.prototype.processSelectionSet=function(r){var d=this,p=r.dataId,S=r.result,D=r.selectionSet,B=r.context,q=r.mergeTree,$=this.cache.policies,Z=$.identify(S,D,B.fragmentMap),ae=Z[1];if("string"==typeof(p=p||Z[0])){var ie=B.written[p]||(B.written[p]=[]),se=(0,I.WU)(p);if(ie.indexOf(D)>=0||(ie.push(D),this.reader&&this.reader.isFresh(S,se,D,B)))return se}var ue=Object.create(null);ae&&(ue=B.merge(ue,ae));var oe=p&&$.rootTypenamesById[p]||(0,I.D$)(S,D,B.fragmentMap)||p&&B.store.get(p,"__typename");"string"==typeof oe&&(ue.__typename=oe);var ce=new Set(D.selections);if(ce.forEach(function(J){var te;if((0,M.MS)(J,B.variables))if((0,I.dt)(J)){var re=(0,I.ue)(J),fe=S[re];if(typeof fe<"u"){var le=$.getStoreFieldName({typename:oe,fieldName:J.name.value,field:J,variables:B.variables}),he=T(q,le),ve=d.processFieldValue(fe,J,B,he),de=J.selectionSet&&B.store.getFieldValue(ve,"__typename")||void 0,pe=$.getMergeFunction(oe,J.name.value,de);pe?he.info={field:J,typename:oe,merge:pe}:x(q,le),ue=B.merge(ue,((te={})[le]=ve,te))}else if($.usingPossibleTypes&&!(0,M.d8)(["defer","client"],J))throw new h.zU(8)}else{var ye=(0,b.HQ)(J,B.fragmentMap);ye&&$.fragmentMatches(ye,oe,S,B.variables)&&ye.selectionSet.selections.forEach(ce.add,ce)}}),"string"==typeof p){var F=(0,I.WU)(p);return q.map.size&&(ue=this.applyMerges(q,F,ue,B)),B.store.merge(p,ue),F}return ue},U.prototype.processFieldValue=function(r,d,p,S){var D=this;return d.selectionSet&&null!==r?Array.isArray(r)?r.map(function(B,q){var $=D.processFieldValue(B,d,p,T(S,q));return x(S,q),$}):this.processSelectionSet({result:r,selectionSet:d.selectionSet,context:p,mergeTree:S}):r},U.prototype.applyMerges=function(r,d,p,S,D){var B,q=this;if(r.map.size&&!(0,I.A_)(p)){var $=Array.isArray(p)||!(0,I.A_)(d)&&!(0,l.d1)(d)?void 0:d,Z=p;$&&!D&&(D=[(0,I.A_)($)?$.__ref:$]);var ne,ae=function(ie,se){return Array.isArray(ie)?"number"==typeof se?ie[se]:void 0:S.store.getFieldValue(ie,String(se))};r.map.forEach(function(ie,se){D&&D.push(se);var ue=ae($,se),oe=ae(Z,se),ce=q.applyMerges(ie,ue,oe,S,D);ce!==oe&&(ne=ne||new Map).set(se,ce),D&&(0,h.V1)(D.pop()===se)}),ne&&(p=Array.isArray(Z)?Z.slice(0):(0,y.__assign)({},Z),ne.forEach(function(ie,se){p[se]=ie}))}return r.info?this.cache.policies.runMergeFunction(d,p,r.info,S,D&&(B=S.store).getStorage.apply(B,D)):p},U}(),w=[];function T(U,r){var d=U.map;return d.has(r)||d.set(r,w.pop()||{map:new Map}),d.get(r)}function x(U,r){var d=U.map,p=d.get(r);p&&!p.info&&!p.map.size&&(w.push(p),d.delete(r))}var H=i(88059),X=i(47916),Y={dataIdFromObject:X.o,addTypename:!0,resultCaching:!0,typePolicies:{}},j=function(U){function r(d){void 0===d&&(d={});var p=U.call(this)||this;return p.watches=new Set,p.typenameDocumentCache=new Map,p.makeVar=H.UT,p.txCount=0,p.maybeBroadcastWatch=(0,N.LV)(function(S,D){return p.broadcastWatch.call(p,S,!!D)},{makeCacheKey:function(S){var D=S.optimistic?p.optimisticData:p.data;if(R(D))return D.makeCacheKey(S.query,S.callback,JSON.stringify({optimistic:S.optimistic,rootId:S.rootId,variables:S.variables}))}}),p.watchDep=(0,N.yN)(),p.config=(0,y.__assign)((0,y.__assign)({},Y),d),p.addTypename=!!p.config.addTypename,p.policies=new X.l({cache:p,dataIdFromObject:p.config.dataIdFromObject,possibleTypes:p.config.possibleTypes,typePolicies:p.config.typePolicies}),p.data=new A.Root({policies:p.policies,resultCaching:p.config.resultCaching}),p.optimisticData=p.data,p.storeWriter=new s(p,p.storeReader=new e({cache:p,addTypename:p.addTypename})),p}return(0,y.__extends)(r,U),r.prototype.restore=function(d){return d&&this.data.replace(d),this},r.prototype.extract=function(d){return void 0===d&&(d=!1),(d?this.optimisticData:this.data).extract()},r.prototype.read=function(d){var p=d.returnPartialData,S=void 0!==p&&p;try{return this.storeReader.diffQueryAgainstStore({store:d.optimistic?this.optimisticData:this.data,query:d.query,variables:d.variables,rootId:d.rootId,config:this.config,returnPartialData:S}).result||null}catch(D){if(D instanceof g.Z)return null;throw D}},r.prototype.write=function(d){try{return++this.txCount,this.storeWriter.writeToStore({store:this.data,query:d.query,result:d.result,dataId:d.dataId,variables:d.variables})}finally{! --this.txCount&&!1!==d.broadcast&&this.broadcastWatches()}},r.prototype.modify=function(d){if(l.$3.call(d,"id")&&!d.id)return!1;var p=d.optimistic?this.optimisticData:this.data;try{return++this.txCount,p.modify(d.id||"ROOT_QUERY",d.fields)}finally{! --this.txCount&&!1!==d.broadcast&&this.broadcastWatches()}},r.prototype.diff=function(d){return this.storeReader.diffQueryAgainstStore({store:d.optimistic?this.optimisticData:this.data,rootId:d.id||"ROOT_QUERY",query:d.query,variables:d.variables,returnPartialData:d.returnPartialData,config:this.config})},r.prototype.watch=function(d){var p=this;return this.watches.size||(0,H.MS)(this),this.watches.add(d),d.immediate&&this.maybeBroadcastWatch(d),function(){p.watches.delete(d)&&!p.watches.size&&(0,H.WR)(p),p.watchDep.dirty(d),p.maybeBroadcastWatch.forget(d)}},r.prototype.gc=function(){return this.optimisticData.gc()},r.prototype.retain=function(d,p){return(p?this.optimisticData:this.data).retain(d)},r.prototype.release=function(d,p){return(p?this.optimisticData:this.data).release(d)},r.prototype.identify=function(d){return(0,I.A_)(d)?d.__ref:this.policies.identify(d)[0]},r.prototype.evict=function(d){if(!d.id){if(l.$3.call(d,"id"))return!1;d=(0,y.__assign)((0,y.__assign)({},d),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(d)}finally{! --this.txCount&&!1!==d.broadcast&&this.broadcastWatches()}},r.prototype.reset=function(){return this.data.clear(),this.optimisticData=this.data,this.broadcastWatches(),Promise.resolve()},r.prototype.removeOptimistic=function(d){var p=this.optimisticData.removeLayer(d);p!==this.optimisticData&&(this.optimisticData=p,this.broadcastWatches())},r.prototype.performTransaction=function(d,p){var S=this,D=function(q){var Z=S.data,ne=S.optimisticData;++S.txCount,q&&(S.data=S.optimisticData=q);try{d(S)}finally{--S.txCount,S.data=Z,S.optimisticData=ne}},B=!1;"string"==typeof p?(this.optimisticData=this.optimisticData.addLayer(p,D),B=!0):null===p?D(this.data):D(),this.broadcastWatches(B)},r.prototype.transformDocument=function(d){if(this.addTypename){var p=this.typenameDocumentCache.get(d);return p||(p=(0,C.XY)(d),this.typenameDocumentCache.set(d,p),this.typenameDocumentCache.set(p,p)),p}return d},r.prototype.broadcastWatches=function(d){var p=this;this.txCount||this.watches.forEach(function(S){return p.maybeBroadcastWatch(S,d)})},r.prototype.broadcastWatch=function(d,p){this.watchDep.dirty(d),this.watchDep(d);var S=this.diff({query:d.query,variables:d.variables,optimistic:d.optimistic});d.optimistic&&p&&(S.fromOptimisticTransaction=!0),d.callback(S)},r}(k.k)},47916:(ee,_,i)=>{"use strict";i.d(_,{l:()=>l,o:()=>M});var y=i(40909),N=i(31351),k=i(65812),g=i(65769),I=i(64422),C=i(48126),h=i(29901),c=i(88059);function b(W){return void 0!==W.args?W.args:W.field?(0,g.MB)(W.field,W.variables):null}var M=function(W,u){var R=W.__typename,n=W.id,e=W._id;if("string"==typeof R&&(u&&(u.keyObject=void 0!==n?{id:n}:void 0!==e?{_id:e}:void 0),void 0===n&&(n=e),void 0!==n))return R+":"+("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))},E=function(){},L=function(W,u){return u.fieldName},o=function(W,u,R){return(0,R.mergeObjects)(W,u)},P=function(W,u){return u},l=function(){function W(u){this.config=u,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=(0,y.__assign)({dataIdFromObject:M},u),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),u.possibleTypes&&this.addPossibleTypes(u.possibleTypes),u.typePolicies&&this.addTypePolicies(u.typePolicies)}return W.prototype.identify=function(u,R,n){var e=R&&n?(0,g.D$)(u,R,n):u.__typename;if(e===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var s,t={typename:e,selectionSet:R,fragmentMap:n},w=e&&this.getTypePolicy(e),T=w&&w.keyFn||this.config.dataIdFromObject;T;){var x=T(u,t);if(!Array.isArray(x)){s=x;break}T=A(x)}return s=s?String(s):void 0,t.keyObject?[s,t.keyObject]:[s]},W.prototype.addTypePolicies=function(u){var R=this;Object.keys(u).forEach(function(n){var e=u[n],t=e.queryType,s=e.mutationType,w=e.subscriptionType,T=(0,y.__rest)(e,["queryType","mutationType","subscriptionType"]);t&&R.setRootTypename("Query",n),s&&R.setRootTypename("Mutation",n),w&&R.setRootTypename("Subscription",n),h.$3.call(R.toBeAdded,n)?R.toBeAdded[n].push(T):R.toBeAdded[n]=[T]})},W.prototype.updateTypePolicy=function(u,R){var n=this,e=this.getTypePolicy(u),t=R.keyFields,s=R.fields;function w(T,x){T.merge="function"==typeof x?x:!0===x?o:!1===x?P:T.merge}w(e,R.merge),e.keyFn=!1===t?E:Array.isArray(t)?A(t):"function"==typeof t?t:e.keyFn,s&&Object.keys(s).forEach(function(T){var x=n.getFieldPolicy(u,T,!0),G=s[T];if("function"==typeof G)x.read=G;else{var z=G.keyArgs,H=G.read,X=G.merge;x.keyFn=!1===z?L:Array.isArray(z)?m(z):"function"==typeof z?z:x.keyFn,"function"==typeof H&&(x.read=H),w(x,X)}x.read&&x.merge&&(x.keyFn=x.keyFn||L)})},W.prototype.setRootTypename=function(u,R){void 0===R&&(R=u);var n="ROOT_"+u.toUpperCase(),e=this.rootTypenamesById[n];R!==e&&((0,k.V1)(!e||e===u,1),e&&delete this.rootIdsByTypename[e],this.rootIdsByTypename[R]=n,this.rootTypenamesById[n]=R)},W.prototype.addPossibleTypes=function(u){var R=this;this.usingPossibleTypes=!0,Object.keys(u).forEach(function(n){R.getSupertypeSet(n,!0),u[n].forEach(function(e){R.getSupertypeSet(e,!0).add(n);var t=e.match(h.gk);(!t||t[0]!==e)&&R.fuzzySubtypes.set(e,new RegExp(e))})})},W.prototype.getTypePolicy=function(u){var R=this;if(!h.$3.call(this.typePolicies,u)){var n=this.typePolicies[u]=Object.create(null);n.fields=Object.create(null);var e=this.supertypeMap.get(u);e&&e.size&&e.forEach(function(s){var w=R.getTypePolicy(s),T=w.fields,x=(0,y.__rest)(w,["fields"]);Object.assign(n,x),Object.assign(n.fields,T)})}var t=this.toBeAdded[u];return t&&t.length&&t.splice(0).forEach(function(s){R.updateTypePolicy(u,s)}),this.typePolicies[u]},W.prototype.getFieldPolicy=function(u,R,n){if(u){var e=this.getTypePolicy(u).fields;return e[R]||n&&(e[R]=Object.create(null))}},W.prototype.getSupertypeSet=function(u,R){var n=this.supertypeMap.get(u);return!n&&R&&this.supertypeMap.set(u,n=new Set),n},W.prototype.fragmentMatches=function(u,R,n,e){var t=this;if(!u.typeCondition)return!0;if(!R)return!1;var s=u.typeCondition.name.value;if(R===s)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(s))for(var w=this.getSupertypeSet(R,!0),T=[w],x=function(Y){var j=t.getSupertypeSet(Y,!1);j&&j.size&&T.indexOf(j)<0&&T.push(j)},G=!(!n||!this.fuzzySubtypes.size),H=0;H<T.length;++H){var X=T[H];if(X.has(s))return w.has(s)||w.add(s),!0;X.forEach(x),G&&H===T.length-1&&(0,h.T9)(u.selectionSet,n,e)&&(G=!1,this.fuzzySubtypes.forEach(function(Y,j){var U=R.match(Y);U&&U[0]===R&&x(j)}))}return!1},W.prototype.hasKeyArgs=function(u,R){var n=this.getFieldPolicy(u,R,!1);return!(!n||!n.keyFn)},W.prototype.getStoreFieldName=function(u){var t,R=u.typename,n=u.fieldName,e=this.getFieldPolicy(R,n,!1),s=e&&e.keyFn;if(s&&R)for(var w={typename:R,fieldName:n,field:u.field||null,variables:u.variables},T=b(u);s;){var x=s(T,w);if(!Array.isArray(x)){t=x||n;break}s=m(x)}return void 0===t&&(t=u.field?(0,g.Ii)(u.field,u.variables):(0,g.o5)(n,b(u))),!1===t?n:n===(0,h.iJ)(t)?t:n+":"+t},W.prototype.readField=function(u,R){var n=u.from;if(n&&(u.field||u.fieldName)){if(void 0===u.typename){var t=R.store.getFieldValue(n,"__typename");t&&(u.typename=t)}var s=this.getStoreFieldName(u),w=(0,h.iJ)(s),T=R.store.getFieldValue(n,s),x=this.getFieldPolicy(u.typename,w,!1),G=x&&x.read;if(G){var z=O(this,n,u,R,R.store.getStorage((0,g.A_)(n)?n.__ref:n,s));return c.bl.withValue(this.cache,G,[T,z])}return T}},W.prototype.getMergeFunction=function(u,R,n){var e=this.getFieldPolicy(u,R,!1),t=e&&e.merge;return!t&&n&&(t=(e=this.getTypePolicy(n))&&e.merge),t},W.prototype.runMergeFunction=function(u,R,n,e,t){var s=n.field,w=n.typename,T=n.merge;return T===o?v(e.store.getFieldValue)(u,R):T===P?R:T(u,R,O(this,void 0,{typename:w,fieldName:s.name.value,field:s,variables:e.variables},e,t||Object.create(null)))},W}();function O(W,u,R,n,e){var t=W.getStoreFieldName(R),s=(0,h.iJ)(t),w=R.variables||n.variables,T=n.store,x=T.getFieldValue,G=T.toReference,z=T.canRead;return{args:b(R),field:R.field||null,fieldName:s,storeFieldName:t,variables:w,isReference:g.A_,toReference:G,storage:e,cache:W.cache,canRead:z,readField:function(H,X){var Y="string"==typeof H?{fieldName:H,from:X}:(0,y.__assign)({},H);return void 0===Y.from&&(Y.from=u),void 0===Y.variables&&(Y.variables=w),W.readField(Y,n)},mergeObjects:v(x)}}function v(W){return function(R,n){if(Array.isArray(R)||Array.isArray(n))throw new k.zU(2);if(R&&"object"==typeof R&&n&&"object"==typeof n){var e=W(R,"__typename"),t=W(n,"__typename");return e&&t&&e!==t||!(0,h.d1)(R)||!(0,h.d1)(n)?n:(0,y.__assign)((0,y.__assign)({},R),n)}return n}}function m(W){return function(u,R){return u?R.fieldName+":"+JSON.stringify(Q(u,W,!1)):R.fieldName}}function A(W){var u=new N.oZ(I.e);return function(R,n){var e;if(n.selectionSet&&n.fragmentMap){var t=u.lookupArray([n.selectionSet,n.fragmentMap]);e=t.aliasMap||(t.aliasMap=K(n.selectionSet,n.fragmentMap))}var s=n.keyObject=Q(R,W,!0,e);return n.typename+":"+JSON.stringify(s)}}function K(W,u){var R=Object.create(null),n=new Set([W]);return n.forEach(function(e){e.selections.forEach(function(t){if((0,g.dt)(t)){if(t.alias){var s=t.alias.value,w=t.name.value;w!==s&&((R.aliases||(R.aliases=Object.create(null)))[w]=s)}t.selectionSet&&((R.subsets||(R.subsets=Object.create(null)))[t.name.value]=K(t.selectionSet,u))}else{var G=(0,C.HQ)(t,u);G&&n.add(G.selectionSet)}})}),R}function Q(W,u,R,n){var t,e=Object.create(null);return u.forEach(function(s){if(Array.isArray(s)){if("string"==typeof t){var w=n&&n.subsets;e[t]=Q(W[t],s,R,w&&w[t])}}else{var x=n&&n.aliases,G=x&&x[s]||s;h.$3.call(W,G)?e[t=s]=W[G]:((0,k.V1)(!R,3),t=void 0)}}),e}},88059:(ee,_,i)=>{"use strict";i.d(_,{MS:()=>h,UT:()=>c,WR:()=>C,bl:()=>k});var y=i(31351),k=new(i(79664).DX),g=new WeakMap;function I(M){var E=g.get(M);return E||g.set(M,E={vars:new Set,dep:(0,y.yN)()}),E}function C(M){I(M).vars.forEach(function(E){return E.forgetCache(M)})}function h(M){I(M).vars.forEach(function(E){return E.attachCache(M)})}function c(M){var E=new Set,L=new Set,o=function(l){if(arguments.length>0){if(M!==l){M=l,E.forEach(function(m){I(m).dep.dirty(o),function b(M){M.broadcastWatches&&M.broadcastWatches()}(m)});var O=Array.from(L);L.clear(),O.forEach(function(m){return m(M)})}}else{var v=k.getValue();v&&(P(v),I(v).dep(o))}return M};o.onNextChange=function(l){return L.add(l),function(){L.delete(l)}};var P=o.attachCache=function(l){return E.add(l),I(l).vars.add(o),o};return o.forgetCache=function(l){return E.delete(l)},o}},52565:()=>{},97319:(ee,_,i)=>{"use strict";i.d(_,{R:()=>j,l:()=>Y});var y=i(40909),N=i(65812),k=i(76704),g=i(97700),I=i(14382),h=i(75938),c=i(16409),b=i(64422),M=i(57080),E=i(91589),L=i(37179),o=i(61355),P=i(53353),l=i(72101),O=i.n(l),v=i(56687),m=i(16976),A=i(90912),K=i(96020),Q=i(1172),W=i(41888),u=i(20317),R=i(48126),n=i(65769),e=i(88059),t=function(){function U(r){var p=r.client,S=r.resolvers,D=r.fragmentMatcher;this.cache=r.cache,p&&(this.client=p),S&&this.addResolvers(S),D&&this.setFragmentMatcher(D)}return U.prototype.addResolvers=function(r){var d=this;this.resolvers=this.resolvers||{},Array.isArray(r)?r.forEach(function(p){d.resolvers=(0,u.D9)(d.resolvers,p)}):this.resolvers=(0,u.D9)(this.resolvers,r)},U.prototype.setResolvers=function(r){this.resolvers={},this.addResolvers(r)},U.prototype.getResolvers=function(){return this.resolvers||{}},U.prototype.runResolvers=function(r){var d=r.document,p=r.remoteResult,S=r.context,D=r.variables,B=r.onlyRunForcedResolvers,q=void 0!==B&&B;return(0,y.__awaiter)(this,void 0,void 0,function(){return(0,y.__generator)(this,function($){return d?[2,this.resolveDocument(d,p.data,S,D,this.fragmentMatcher,q).then(function(Z){return(0,y.__assign)((0,y.__assign)({},p),{data:Z.result})})]:[2,p]})})},U.prototype.setFragmentMatcher=function(r){this.fragmentMatcher=r},U.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},U.prototype.clientQuery=function(r){return(0,P.d8)(["client"],r)&&this.resolvers?r:null},U.prototype.serverQuery=function(r){return(0,o.er)(r)},U.prototype.prepareContext=function(r){var d=this.cache;return(0,y.__assign)((0,y.__assign)({},r),{cache:d,getCacheKey:function(p){return d.identify(p)}})},U.prototype.addExportedVariables=function(r,d,p){return void 0===d&&(d={}),void 0===p&&(p={}),(0,y.__awaiter)(this,void 0,void 0,function(){return(0,y.__generator)(this,function(S){return r?[2,this.resolveDocument(r,this.buildRootValueFromCache(r,d)||{},this.prepareContext(p),d).then(function(D){return(0,y.__assign)((0,y.__assign)({},d),D.exportedVariables)})]:[2,(0,y.__assign)({},d)]})})},U.prototype.shouldForceResolvers=function(r){var d=!1;return(0,W.YR)(r,{Directive:{enter:function(p){if("client"===p.name.value&&p.arguments&&(d=p.arguments.some(function(S){return"always"===S.name.value&&"BooleanValue"===S.value.kind&&!0===S.value.value})))return W.sP}}}),d},U.prototype.buildRootValueFromCache=function(r,d){return this.cache.diff({query:(0,o.zc)(r),variables:d,returnPartialData:!0,optimistic:!1}).result},U.prototype.resolveDocument=function(r,d,p,S,D,B){return void 0===p&&(p={}),void 0===S&&(S={}),void 0===D&&(D=function(){return!0}),void 0===B&&(B=!1),(0,y.__awaiter)(this,void 0,void 0,function(){var q,$,Z,ne,ae,ie,se,ue,oe;return(0,y.__generator)(this,function(ce){return q=(0,L.Vn)(r),$=(0,L.zK)(r),Z=(0,R.JG)($),ae=(ne=q.operation)?ne.charAt(0).toUpperCase()+ne.slice(1):"Query",se=(ie=this).cache,ue=ie.client,oe={fragmentMap:Z,context:(0,y.__assign)((0,y.__assign)({},p),{cache:se,client:ue}),variables:S,fragmentMatcher:D,defaultOperationType:ae,exportedVariables:{},onlyRunForcedResolvers:B},[2,this.resolveSelectionSet(q.selectionSet,d,oe).then(function(F){return{result:F,exportedVariables:oe.exportedVariables}})]})})},U.prototype.resolveSelectionSet=function(r,d,p){return(0,y.__awaiter)(this,void 0,void 0,function(){var S,D,B,q,Z=this;return(0,y.__generator)(this,function(ne){return S=p.fragmentMap,D=p.context,B=p.variables,q=[d],[2,Promise.all(r.selections.map(function(ae){return(0,y.__awaiter)(Z,void 0,void 0,function(){var ie;return(0,y.__generator)(this,function(ue){return(0,P.MS)(ae,B)?(0,n.dt)(ae)?[2,this.resolveField(ae,d,p).then(function(oe){var ce;typeof oe<"u"&&q.push(((ce={})[(0,n.ue)(ae)]=oe,ce))})]:((0,n.kd)(ae)?ie=ae:(0,N.V1)(ie=S[ae.name.value],11),ie&&ie.typeCondition&&p.fragmentMatcher(d,ie.typeCondition.name.value,D)?[2,this.resolveSelectionSet(ie.selectionSet,d,p).then(function(oe){q.push(oe)})]:[2]):[2]})})})).then(function(){return(0,u.IM)(q)})]})})},U.prototype.resolveField=function(r,d,p){return(0,y.__awaiter)(this,void 0,void 0,function(){var S,D,B,q,$,Z,ne,ae,ie,se=this;return(0,y.__generator)(this,function(ue){return S=p.variables,D=r.name.value,B=(0,n.ue)(r),q=D!==B,$=d[B]||d[D],Z=Promise.resolve($),(!p.onlyRunForcedResolvers||this.shouldForceResolvers(r))&&(ne=d.__typename||p.defaultOperationType,(ae=this.resolvers&&this.resolvers[ne])&&(ie=ae[q?D:B])&&(Z=Promise.resolve(e.bl.withValue(this.cache,ie,[d,(0,n.MB)(r,S),p.context,{field:r,fragmentMap:p.fragmentMap}])))),[2,Z.then(function(oe){return void 0===oe&&(oe=$),r.directives&&r.directives.forEach(function(ce){"export"===ce.name.value&&ce.arguments&&ce.arguments.forEach(function(F){"as"===F.name.value&&"StringValue"===F.value.kind&&(p.exportedVariables[F.value.value]=oe)})}),r.selectionSet&&null!=oe?Array.isArray(oe)?se.resolveSubSelectedArray(r,oe,p):r.selectionSet?se.resolveSelectionSet(r.selectionSet,oe,p):void 0:oe})]})})},U.prototype.resolveSubSelectedArray=function(r,d,p){var S=this;return Promise.all(d.map(function(D){return null===D?null:Array.isArray(D)?S.resolveSubSelectedArray(r,D,p):r.selectionSet?S.resolveSelectionSet(r.selectionSet,D,p):void 0}))},U}(),s=new(b.e?WeakMap:Map);function w(U,r){var d=U[r];"function"==typeof d&&(U[r]=function(){return s.set(U,(s.get(U)+1)%1e15),d.apply(this,arguments)})}function T(U){U.notifyTimeout&&(clearTimeout(U.notifyTimeout),U.notifyTimeout=void 0)}var x=function(){function U(r){this.cache=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.diff=null,this.observableQuery=null,s.has(r)||(s.set(r,0),w(r,"evict"),w(r,"modify"),w(r,"reset"))}return U.prototype.init=function(r){var d=r.networkStatus||Q.p.loading;return this.variables&&this.networkStatus!==Q.p.loading&&!(0,c.L)(this.variables,r.variables)&&(d=Q.p.setVariables),(0,c.L)(r.variables,this.variables)||(this.diff=null),Object.assign(this,{document:r.document,variables:r.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:d}),r.observableQuery&&this.setObservableQuery(r.observableQuery),r.lastRequestId&&(this.lastRequestId=r.lastRequestId),this},U.prototype.reset=function(){T(this),this.diff=null,this.dirty=!1},U.prototype.getDiff=function(r){return void 0===r&&(r=this.variables),this.diff&&(0,c.L)(r,this.variables)?this.diff:(this.updateWatch(this.variables=r),this.diff=this.cache.diff({query:this.document,variables:r,returnPartialData:!0,optimistic:!0}))},U.prototype.setDiff=function(r){var d=this,p=this.diff;this.diff=r,!this.dirty&&(r&&r.result)!==(p&&p.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return d.notify()},0)))},U.prototype.setObservableQuery=function(r){var d=this;r!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=r,r?(r.queryInfo=this,this.listeners.add(this.oqListener=function(){d.getDiff().fromOptimisticTransaction?r.observe():r.reobserve()})):delete this.oqListener)},U.prototype.notify=function(){var r=this;T(this),this.shouldNotify()&&this.listeners.forEach(function(d){return d(r)}),this.dirty=!1},U.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if((0,Q.b)(this.networkStatus)&&this.observableQuery){var r=this.observableQuery.options.fetchPolicy;if("cache-only"!==r&&"cache-and-network"!==r)return!1}return!0},U.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),delete this.cancel,this.subscriptions.forEach(function(d){return d.unsubscribe()});var r=this.observableQuery;r&&r.stopPolling()}},U.prototype.cancel=function(){},U.prototype.updateWatch=function(r){var d=this;void 0===r&&(r=this.variables);var p=this.observableQuery;p&&"no-cache"===p.options.fetchPolicy||(!this.lastWatch||this.lastWatch.query!==this.document||!(0,c.L)(r,this.lastWatch.variables))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch={query:this.document,variables:r,optimistic:!0,callback:function(S){return d.setDiff(S)}}))},U.prototype.shouldWrite=function(r,d){var p=this.lastWrite;return!(p&&p.dmCount===s.get(this.cache)&&(0,c.L)(d,p.variables)&&(0,c.L)(r.data,p.result.data))},U.prototype.markResult=function(r,d,p){var S=this;this.graphQLErrors=(0,E.E)(r.errors)?r.errors:[],this.reset(),"no-cache"===d.fetchPolicy?this.diff={result:r.data,complete:!0}:!this.stopped&&p&&(G(r,d.errorPolicy)?this.cache.performTransaction(function(D){if(S.shouldWrite(r,d.variables))D.writeQuery({query:S.document,data:r.data,variables:d.variables}),S.lastWrite={result:r,variables:d.variables,dmCount:s.get(S.cache)};else if(S.diff&&S.diff.complete)return void(r.data=S.diff.result);var B=D.diff({query:S.document,variables:d.variables,returnPartialData:!0,optimistic:!0});S.stopped||S.updateWatch(d.variables),S.diff=B,B.complete&&(r.data=B.result)}):this.lastWrite=void 0)},U.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Q.p.ready},U.prototype.markError=function(r){return this.networkStatus=Q.p.error,this.lastWrite=void 0,this.reset(),r.graphQLErrors&&(this.graphQLErrors=r.graphQLErrors),r.networkError&&(this.networkError=r.networkError),r},U}();function G(U,r){void 0===r&&(r="none");var d="ignore"===r||"all"===r,p=!(0,M.t)(U);return!p&&d&&U.data&&(p=!0),p}var z=Object.prototype.hasOwnProperty,H=function(){function U(r){var d=r.cache,p=r.link,S=r.queryDeduplication,D=void 0!==S&&S,B=r.onBroadcast,q=r.ssrMode,$=void 0!==q&&q,Z=r.clientAwareness,ne=void 0===Z?{}:Z,ae=r.localState,ie=r.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(b.e?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=d,this.link=p,this.queryDeduplication=D,this.clientAwareness=ne,this.localState=ae||new t({cache:d}),this.ssrMode=$,this.assumeImmutableResults=!!ie,(this.onBroadcast=B)&&(this.mutationStore=Object.create(null))}return U.prototype.stop=function(){var r=this;this.queries.forEach(function(d,p){r.stopQueryNoBroadcast(p)}),this.cancelPendingFetches(new N.zU(12))},U.prototype.cancelPendingFetches=function(r){this.fetchCancelFns.forEach(function(d){return d(r)}),this.fetchCancelFns.clear()},U.prototype.mutate=function(r){var d=r.mutation,p=r.variables,S=r.optimisticResponse,D=r.updateQueries,B=r.refetchQueries,q=void 0===B?[]:B,$=r.awaitRefetchQueries,Z=void 0!==$&&$,ne=r.update,ae=r.errorPolicy,ie=void 0===ae?"none":ae,se=r.fetchPolicy,ue=r.context,oe=void 0===ue?{}:ue;return(0,y.__awaiter)(this,void 0,void 0,function(){var ce,F,a;return(0,y.__generator)(this,function(f){switch(f.label){case 0:return(0,N.V1)(d,13),(0,N.V1)(!se||"no-cache"===se,14),ce=this.generateMutationId(),d=this.transform(d).document,p=this.getVariables(d,p),this.transform(d).hasClientExports?[4,this.localState.addExportedVariables(d,p,oe)]:[3,2];case 1:p=f.sent(),f.label=2;case 2:return F=this.mutationStore&&(this.mutationStore[ce]={mutation:d,variables:p,loading:!0,error:null}),S&&this.markMutationOptimistic(S,{mutationId:ce,document:d,variables:p,errorPolicy:ie,updateQueries:D,update:ne}),this.broadcastQueries(),a=this,[2,new Promise(function(V,J){var te,re;a.getObservableFromLink(d,(0,y.__assign)((0,y.__assign)({},oe),{optimisticResponse:S}),p,!1).subscribe({next:function(fe){if((0,M.t)(fe)&&"none"===ie)re=new A.K({graphQLErrors:fe.errors});else{if(F&&(F.loading=!1,F.error=null),"no-cache"!==se)try{a.markMutationResult({mutationId:ce,result:fe,document:d,variables:p,errorPolicy:ie,updateQueries:D,update:ne})}catch(le){return void(re=new A.K({networkError:le}))}te=fe}},error:function(fe){F&&(F.loading=!1,F.error=fe),S&&a.cache.removeOptimistic(ce),a.broadcastQueries(),J(new A.K({networkError:fe}))},complete:function(){if(re&&F&&(F.loading=!1,F.error=re),S&&a.cache.removeOptimistic(ce),a.broadcastQueries(),re)J(re);else{"function"==typeof q&&(q=q(te));var fe=[];(0,E.E)(q)&&q.forEach(function(le){if("string"==typeof le)a.queries.forEach(function(ve){var de=ve.observableQuery;de&&de.hasObservers()&&de.queryName===le&&fe.push(de.refetch())});else{var he={query:le.query,variables:le.variables,fetchPolicy:"network-only"};le.context&&(he.context=le.context),fe.push(a.query(he))}}),Promise.all(Z?fe:[]).then(function(){"ignore"===ie&&te&&(0,M.t)(te)&&delete te.errors,V(te)},J)}}})})]}})})},U.prototype.markMutationResult=function(r,d){var p=this;if(void 0===d&&(d=this.cache),G(r.result,r.errorPolicy)){var S=[{result:r.result.data,dataId:"ROOT_MUTATION",query:r.document,variables:r.variables}],D=r.updateQueries;D&&this.queries.forEach(function(B,q){var $=B.observableQuery,Z=$&&$.queryName;if(Z&&z.call(D,Z)){var ne=D[Z],ae=p.queries.get(q),ie=ae.document,se=ae.variables,ue=d.diff({query:ie,variables:se,returnPartialData:!0,optimistic:!1}),oe=ue.result;if(ue.complete&&oe){var F=ne(oe,{mutationResult:r.result,queryName:ie&&(0,L.n4)(ie)||void 0,queryVariables:se});F&&S.push({result:F,dataId:"ROOT_QUERY",query:ie,variables:se})}}}),d.performTransaction(function(B){S.forEach(function($){return B.write($)});var q=r.update;q&&q(B,r.result)},null)}},U.prototype.markMutationOptimistic=function(r,d){var p=this,S="function"==typeof r?r(d.variables):r;return this.cache.recordOptimisticTransaction(function(D){try{p.markMutationResult((0,y.__assign)((0,y.__assign)({},d),{result:{data:S}}),D)}catch{}},d.mutationId)},U.prototype.fetchQuery=function(r,d,p){return this.fetchQueryObservable(r,d,p).promise},U.prototype.getQueryStore=function(){var r=Object.create(null);return this.queries.forEach(function(d,p){r[p]={variables:d.variables,networkStatus:d.networkStatus,networkError:d.networkError,graphQLErrors:d.graphQLErrors}}),r},U.prototype.resetErrors=function(r){var d=this.queries.get(r);d&&(d.networkError=void 0,d.graphQLErrors=[])},U.prototype.transform=function(r){var d=this.transformCache;if(!d.has(r)){var p=this.cache.transformDocument(r),S=(0,o.hX)(this.cache.transformForLink(p)),D=this.localState.clientQuery(p),B=S&&this.localState.serverQuery(S),q={document:p,hasClientExports:(0,P.f2)(p),hasForcedResolvers:this.localState.shouldForceResolvers(p),clientQuery:D,serverQuery:B,defaultVars:(0,L.wY)((0,L.Vu)(p))},$=function(Z){Z&&!d.has(Z)&&d.set(Z,q)};$(r),$(p),$(D),$(B)}return d.get(r)},U.prototype.getVariables=function(r,d){return(0,y.__assign)((0,y.__assign)({},this.transform(r).defaultVars),d)},U.prototype.watchQuery=function(r){typeof(r=(0,y.__assign)((0,y.__assign)({},r),{variables:this.getVariables(r.query,r.variables)})).notifyOnNetworkStatusChange>"u"&&(r.notifyOnNetworkStatusChange=!1);var d=new x(this.cache),p=new K.U({queryManager:this,queryInfo:d,options:r});return this.queries.set(p.queryId,d),d.init({document:r.query,observableQuery:p,variables:r.variables}),p},U.prototype.query=function(r){var d=this;(0,N.V1)(r.query,15),(0,N.V1)("Document"===r.query.kind,16),(0,N.V1)(!r.returnPartialData,17),(0,N.V1)(!r.pollInterval,18);var p=this.generateQueryId();return this.fetchQuery(p,r).finally(function(){return d.stopQuery(p)})},U.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},U.prototype.generateRequestId=function(){return this.requestIdCounter++},U.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},U.prototype.stopQueryInStore=function(r){this.stopQueryInStoreNoBroadcast(r),this.broadcastQueries()},U.prototype.stopQueryInStoreNoBroadcast=function(r){var d=this.queries.get(r);d&&d.stop()},U.prototype.clearStore=function(){return this.cancelPendingFetches(new N.zU(19)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=Q.p.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset()},U.prototype.resetStore=function(){var r=this;return this.clearStore().then(function(){return r.reFetchObservableQueries()})},U.prototype.reFetchObservableQueries=function(r){var d=this;void 0===r&&(r=!1);var p=[];return this.queries.forEach(function(S,D){var B=S.observableQuery;if(B&&B.hasObservers()){var q=B.options.fetchPolicy;B.resetLastResults(),"cache-only"!==q&&(r||"standby"!==q)&&p.push(B.refetch()),d.getQuery(D).setDiff(null)}}),this.broadcastQueries(),Promise.all(p)},U.prototype.setObservableQuery=function(r){this.getQuery(r.queryId).setObservableQuery(r)},U.prototype.startGraphQLSubscription=function(r){var d=this,p=r.query,S=r.fetchPolicy,D=r.errorPolicy,B=r.variables,q=r.context,$=void 0===q?{}:q;p=this.transform(p).document,B=this.getVariables(p,B);var Z=function(ae){return d.getObservableFromLink(p,$,ae,!1).map(function(ie){if("no-cache"!==S&&(G(ie,D)&&d.cache.write({query:p,result:ie.data,dataId:"ROOT_SUBSCRIPTION",variables:ae}),d.broadcastQueries()),(0,M.t)(ie))throw new A.K({graphQLErrors:ie.errors});return ie})};if(this.transform(p).hasClientExports){var ne=this.localState.addExportedVariables(p,B,$).then(Z);return new(O())(function(ae){var ie=null;return ne.then(function(se){return ie=se.subscribe(ae)},ae.error),function(){return ie&&ie.unsubscribe()}})}return Z(B)},U.prototype.stopQuery=function(r){this.stopQueryNoBroadcast(r),this.broadcastQueries()},U.prototype.stopQueryNoBroadcast=function(r){this.stopQueryInStoreNoBroadcast(r),this.removeQuery(r)},U.prototype.removeQuery=function(r){this.fetchCancelFns.delete(r),this.getQuery(r).stop(),this.queries.delete(r)},U.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(r){return r.notify()})},U.prototype.getLocalState=function(){return this.localState},U.prototype.getObservableFromLink=function(r,d,p,S){var B,D=this;void 0===S&&(S=null!==(B=d?.queryDeduplication)&&void 0!==B?B:this.queryDeduplication);var q,$=this.transform(r).serverQuery;if($){var ne=this.inFlightLinkObservables,ae=this.link,ie={query:$,variables:p,operationName:(0,L.n4)($)||void 0,context:this.prepareContext((0,y.__assign)((0,y.__assign)({},d),{forceFetch:!S}))};if(d=ie.context,S){var se=ne.get($)||new Map;ne.set($,se);var ue=JSON.stringify(p);if(!(q=se.get(ue))){var oe=new v.E([(0,g.g)(ae,ie)]);se.set(ue,q=oe),oe.cleanup(function(){se.delete(ue)&&se.size<1&&ne.delete($)})}}else q=new v.E([(0,g.g)(ae,ie)])}else q=new v.E([O().of({data:{}})]),d=this.prepareContext(d);var ce=this.transform(r).clientQuery;return ce&&(q=(0,m.x)(q,function(F){return D.localState.runResolvers({document:ce,remoteResult:F,context:d,variables:p})})),q},U.prototype.getResultsFromLink=function(r,d,p){var S=r.lastRequestId=this.generateRequestId();return(0,m.x)(this.getObservableFromLink(r.document,p.context,p.variables),function(D){var B=(0,E.E)(D.errors);if(S>=r.lastRequestId){if(B&&"none"===p.errorPolicy)throw r.markError(new A.K({graphQLErrors:D.errors}));r.markResult(D,p,d),r.markReady()}var q={data:D.data,loading:!1,networkStatus:r.networkStatus||Q.p.ready};return B&&"ignore"!==p.errorPolicy&&(q.errors=D.errors),q},function(D){var B=(0,A.M)(D)?D:new A.K({networkError:D});throw S>=r.lastRequestId&&r.markError(B),B})},U.prototype.fetchQueryObservable=function(r,d,p){var S=this;void 0===p&&(p=Q.p.loading);var D=this.transform(d.query).document,B=this.getVariables(D,d.variables),q=this.getQuery(r),$=q.networkStatus,Z=d.fetchPolicy,ne=void 0===Z?"cache-first":Z,ae=d.errorPolicy,ie=void 0===ae?"none":ae,se=d.returnPartialData,ue=void 0!==se&&se,oe=d.notifyOnNetworkStatusChange,ce=void 0!==oe&&oe,F=d.context,a=void 0===F?{}:F;("cache-first"===ne||"cache-and-network"===ne||"network-only"===ne||"no-cache"===ne)&&ce&&"number"==typeof $&&$!==p&&(0,Q.b)(p)&&("cache-first"!==ne&&(ne="cache-and-network"),ue=!0);var V=Object.assign({},d,{query:D,variables:B,fetchPolicy:ne,errorPolicy:ie,returnPartialData:ue,notifyOnNetworkStatusChange:ce,context:a}),J=function(re){return V.variables=re,S.fetchQueryByPolicy(q,V,p)};this.fetchCancelFns.set(r,function(re){Promise.resolve().then(function(){return te.cancel(re)})});var te=new v.E(this.transform(V.query).hasClientExports?this.localState.addExportedVariables(V.query,V.variables,V.context).then(J):J(V.variables));return te.cleanup(function(){S.fetchCancelFns.delete(r);var re=d.nextFetchPolicy;re&&(d.nextFetchPolicy=void 0,d.fetchPolicy="function"==typeof re?re.call(d,d.fetchPolicy||"cache-first"):re)}),te},U.prototype.fetchQueryByPolicy=function(r,d,p){var S=this,D=d.query,B=d.variables,q=d.fetchPolicy,$=d.errorPolicy,Z=d.returnPartialData,ne=d.context;r.init({document:D,variables:B,networkStatus:p});var ae=function(){return r.getDiff(B)},ie=function(oe,ce){void 0===ce&&(ce=r.networkStatus||Q.p.loading);var F=oe.result,a=function(f){return O().of((0,y.__assign)({data:f,loading:(0,Q.b)(ce),networkStatus:ce},oe.complete?null:{partial:!0}))};return S.transform(D).hasForcedResolvers?S.localState.runResolvers({document:D,remoteResult:{data:F},context:ne,variables:B,onlyRunForcedResolvers:!0}).then(function(f){return a(f.data)}):a(F)},se=function(oe){return S.getResultsFromLink(r,oe,{variables:B,context:ne,fetchPolicy:q,errorPolicy:$})};switch(q){default:case"cache-first":return(ue=ae()).complete?[ie(ue,r.markReady())]:Z?[ie(ue),se(!0)]:[se(!0)];case"cache-and-network":var ue;return(ue=ae()).complete||Z?[ie(ue),se(!0)]:[se(!0)];case"cache-only":return[ie(ae(),r.markReady())];case"network-only":return[se(!0)];case"no-cache":return[se(!1)];case"standby":return[]}},U.prototype.getQuery=function(r){return r&&!this.queries.has(r)&&this.queries.set(r,new x(this.cache)),this.queries.get(r)},U.prototype.prepareContext=function(r){void 0===r&&(r={});var d=this.localState.prepareContext(r);return(0,y.__assign)((0,y.__assign)({},d),{clientAwareness:this.clientAwareness})},U}();function Y(U,r){return(0,I.o)(U,r,r.variables&&{variables:(0,y.__assign)((0,y.__assign)({},U.variables),r.variables)})}var j=function(){function U(r){var d=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCal