From 6447563ea008e7b1c7eb7efdde5cec70cfcd8ab7 Mon Sep 17 00:00:00 2001 From: Tornado Contrib Date: Tue, 7 May 2024 12:54:03 +0000 Subject: [PATCH] Fixed nullifier service bug --- assets/nullifier.worker.js | 32 +++++++++++++++----------------- static/nullifier.worker.js | 2 +- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/assets/nullifier.worker.js b/assets/nullifier.worker.js index 9a4f8cb..e24d100 100644 --- a/assets/nullifier.worker.js +++ b/assets/nullifier.worker.js @@ -140,26 +140,24 @@ const getNullifiers = async (blockFrom) => { events.push(...graphEvents) blockFrom = lastSyncBlock + numbers.ONE } + + let nodeEvents = await self.BatchEventsService.getBatchEvents({ + fromBlock: blockFrom, + type: 'NewNullifier' + }) - if (!blockTo || blockTo > blockFrom) { - let nodeEvents = await self.BatchEventsService.getBatchEvents({ - fromBlock: blockFrom, - type: 'NewNullifier' + if (nodeEvents && nodeEvents.length) { + nodeEvents = nodeEvents.map(({ blockNumber, transactionHash, args }) => ({ + blockNumber, + transactionHash, + nullifier: args.nullifier, + })) + + console.log({ + nodeEvents }) - if (nodeEvents && nodeEvents.length) { - nodeEvents = nodeEvents.map(({ blockNumber, transactionHash, args }) => ({ - blockNumber, - transactionHash, - nullifier: args.nullifier, - })) - - console.log({ - nodeEvents - }) - - events.push(...nodeEvents) - } + events.push(...nodeEvents) } return events diff --git a/static/nullifier.worker.js b/static/nullifier.worker.js index 864042a..cea86c0 100644 --- a/static/nullifier.worker.js +++ b/static/nullifier.worker.js @@ -14,4 +14,4 @@ * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT - */!function(){"use strict";var s="input is invalid type",a="object"==typeof window,u=a?window:{};u.JS_SHA3_NO_WINDOW&&(a=!1);var c=!a&&"object"==typeof self;!u.JS_SHA3_NO_NODE_JS&&"object"==typeof n&&n.versions&&n.versions.node?u=i:c&&(u=self);var l=!u.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,h=r(58),f=!u.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[4,1024,262144,67108864],m=[0,8,16,24],g=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],y=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};!u.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!f||!u.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var _=function(t,e,r){return function(n){return new D(t,e,t).update(n)[r]()}},E=function(t,e,r){return function(n,i){return new D(t,e,i).update(n)[r]()}},A=function(t,e,r){return function(e,n,i,o){return T["cshake"+t].update(e,n,i,o)[r]()}},O=function(t,e,r){return function(e,n,i,o){return T["kmac"+t].update(e,n,i,o)[r]()}},k=function(t,e,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function B(t,e,r){D.call(this,t,e,r)}D.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}for(var n,i,o=this.blocks,a=this.byteCount,u=t.length,c=this.blockCount,l=0,h=this.s;l>2]|=t[l]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=n-a,this.block=o[c],n=0;n>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},D.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}var n=0,i=t.length;if(e)n=i;else for(var o=0;o=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(t),n},D.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];s%e==0&&(F(r),o=0)}return i&&(t=r[o],a+=d[t>>4&15]+d[15&t],i>1&&(a+=d[t>>12&15]+d[t>>8&15]),i>2&&(a+=d[t>>20&15]+d[t>>16&15])),a},D.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&F(n)}return o&&(t=a<<2,e=n[s],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},B.prototype=new D,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),D.prototype.finalize.call(this)};var F=function(t){var e,r,n,i,o,s,a,u,c,l,h,f,d,p,m,v,y,b,w,_,E,A,O,k,S,M,T,N,x,I,P,R,j,C,D,B,F,L,U,q,V,z,G,K,Q,H,W,J,Y,X,Z,$,tt,et,rt,nt,it,ot,st,at,ut,ct,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],h=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|h>>>31),r=a^(h<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(f<<1|d>>>31),r=c^(d<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|o>>>31),r=h^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],m=t[1],H=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,N=t[20]<<3|t[21]>>>29,x=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,G=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,D=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,B=t[14]<<6|t[15]>>>26,F=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,j=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,L=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,E=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,Q=t[9]<<27|t[8]>>>5,M=t[18]<<20|t[19]>>>12,T=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,q=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,O=t[49]<<14|t[48]>>>18,t[0]=p^~v&b,t[1]=m^~y&w,t[10]=k^~M&N,t[11]=S^~T&x,t[20]=C^~B&L,t[21]=D^~F&U,t[30]=K^~H&J,t[31]=Q^~W&Y,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=v^~b&_,t[3]=y^~w&E,t[12]=M^~N&I,t[13]=T^~x&P,t[22]=B^~L&q,t[23]=F^~U&V,t[32]=H^~J&X,t[33]=W^~Y&Z,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=b^~_&A,t[5]=w^~E&O,t[14]=N^~I&R,t[15]=x^~P&j,t[24]=L^~q&z,t[25]=U^~V&G,t[34]=J^~X&$,t[35]=Y^~Z&tt,t[44]=ot^~at&ct,t[45]=st^~ut<,t[6]=_^~A&p,t[7]=E^~O&m,t[16]=I^~R&k,t[17]=P^~j&S,t[26]=q^~z&C,t[27]=V^~G&D,t[36]=X^~$&K,t[37]=Z^~tt&Q,t[46]=at^~ct&et,t[47]=ut^~lt&rt,t[8]=A^~p&v,t[9]=O^~m&y,t[18]=R^~k&M,t[19]=j^~S&T,t[28]=z^~C&B,t[29]=G^~D&F,t[38]=$^~K&H,t[39]=tt^~Q&W,t[48]=ct^~et&nt,t[49]=lt^~rt&it,t[0]^=g[n],t[1]^=g[n+1]};if(l)t.exports=T;else{for(x=0;x=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(t){o.prototype.inspect=h}else o.prototype.inspect=h;function h(){return(this.red?""}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=p[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modrn(l).toString(t);r=(h=h.idivn(l)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,h=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],v=8191&g,y=g>>>13,b=0|s[3],w=8191&b,_=b>>>13,E=0|s[4],A=8191&E,O=E>>>13,k=0|s[5],S=8191&k,M=k>>>13,T=0|s[6],N=8191&T,x=T>>>13,I=0|s[7],P=8191&I,R=I>>>13,j=0|s[8],C=8191&j,D=j>>>13,B=0|s[9],F=8191&B,L=B>>>13,U=0|a[0],q=8191&U,V=U>>>13,z=0|a[1],G=8191&z,K=z>>>13,Q=0|a[2],H=8191&Q,W=Q>>>13,J=0|a[3],Y=8191&J,X=J>>>13,Z=0|a[4],$=8191&Z,tt=Z>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191<,ft=lt>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,q))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,V))+Math.imul(m,q)|0,o=Math.imul(m,V);var vt=(c+(n=n+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,G)|0))<<13)|0;c=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,q),i=(i=Math.imul(v,V))+Math.imul(y,q)|0,o=Math.imul(y,V),n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(f,H)|0))<<13)|0;c=((o=o+Math.imul(f,W)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,V))+Math.imul(_,q)|0,o=Math.imul(_,V),n=n+Math.imul(v,G)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var bt=(c+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(f,Y)|0))<<13)|0;c=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,q),i=(i=Math.imul(A,V))+Math.imul(O,q)|0,o=Math.imul(O,V),n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,X)|0;var wt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,V))+Math.imul(M,q)|0,o=Math.imul(M,V),n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(N,q),i=(i=Math.imul(N,V))+Math.imul(x,q)|0,o=Math.imul(x,V),n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,K)|0,n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Et=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,q),i=(i=Math.imul(P,V))+Math.imul(R,q)|0,o=Math.imul(R,V),n=n+Math.imul(N,G)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var At=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,q),i=(i=Math.imul(C,V))+Math.imul(D,q)|0,o=Math.imul(D,V),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var Ot=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,V))+Math.imul(L,q)|0,o=Math.imul(L,V),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var kt=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,G),i=(i=Math.imul(F,K))+Math.imul(L,G)|0,o=Math.imul(L,K),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,ht)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var St=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,W))+Math.imul(L,H)|0,o=Math.imul(L,W),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Mt=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(F,Y),i=(i=Math.imul(F,X))+Math.imul(L,Y)|0,o=Math.imul(L,X),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ct)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ct)|0,n=n+Math.imul(A,ht)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var Tt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,tt))+Math.imul(L,$)|0,o=Math.imul(L,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ct)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Nt=(c+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(F,rt),i=(i=Math.imul(F,nt))+Math.imul(L,rt)|0,o=Math.imul(L,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ct)|0,n=n+Math.imul(N,ht)|0,i=(i=i+Math.imul(N,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var xt=(c+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(M,pt)|0))<<13)|0;c=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(F,ot),i=(i=Math.imul(F,st))+Math.imul(L,ot)|0,o=Math.imul(L,st),n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var It=(c+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(F,ut),i=(i=Math.imul(F,ct))+Math.imul(L,ut)|0,o=Math.imul(L,ct),n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,ft)|0;var Pt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(R,pt)|0))<<13)|0;c=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(F,ht),i=(i=Math.imul(F,ft))+Math.imul(L,ht)|0,o=Math.imul(L,ft);var Rt=(c+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var jt=(c+(n=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,mt))+Math.imul(L,pt)|0))<<13)|0;return c=((o=Math.imul(L,mt))+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=Et,u[7]=At,u[8]=Ot,u[9]=kt,u[10]=St,u[11]=Mt,u[12]=Tt,u[13]=Nt,u[14]=xt,u[15]=It,u[16]=Pt,u[17]=Rt,u[18]=jt,0!==c&&(u[19]=c,r.length++),r};function v(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function y(t,e,r){return v(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?v(this,t,e):y(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=f)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function O(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},i(E,_),E.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},E.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new E;else if("p224"===t)e=new A;else if("p192"===t)e=new O;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new k}return w[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var h=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},i(M,S),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(24)(t))},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));const n="random/5.7.0"},function(t,e,r){const{isEmpty:n}=r(34),{BigNumber:i,Contract:o}=r(39),{IndexedDB:s}=r(62),{BatchEventsService:a}=r(63),{getAllNullifiers:u}=r(64),{ExtendedProvider:c}=r(66),{POOL_CONTRACT:l,RPC_LIST:h,FALLBACK_RPC_LIST:f,workerEvents:d,numbers:p}=r(27),{sleep:m}=r(38),{poolAbi:g}=r(67),v=t=>{self.chainId=t;const e=(t=>new c(h[t],t,f[t]))(t);y(t,e),(async()=>{try{const t=new s({stores:[{keyPath:"nullifier",name:"nullifier_events_100",indexes:[{name:"transactionHash",unique:!1}]}],dbName:"tornado_pool_nullifier"});await t.initDB(),self.$indexedDB=t}catch(t){console.log("err",t.message)}})()},y=(t,e)=>{self.poolContract=new o(l[t],g,e),self.BatchEventsService=new a({provider:e,contract:self.poolContract})},b=async(t,e=!0)=>{let r={blockFrom:p.DEPLOYED_BLOCK,cachedEvents:[]};try{if(t&&t.length){const[e]=t.sort((t,e)=>e.blockNumber-t.blockNumber),n=await self.poolContract.provider.getBlockNumber(),i=Number(e.blockNumber)+p.ONE;e.blockNumber===n&&(r.blockFrom=p.DEPLOYED_BLOCK),r.blockFrom=i>n?n:i,r.cachedEvents=t}else r=await(async()=>{let t=p.DEPLOYED_BLOCK;self.$indexedDB||await m(p.RECALL_DELAY);const e=await self.$indexedDB.getAll({storeName:"nullifier_events_100"});if(e&&e.length){const[r]=e.sort((t,e)=>e.blockNumber-t.blockNumber),n=await self.poolContract.provider.getBlockNumber(),i=Number(r.blockNumber)+p.ONE;if(r.blockNumber===n)return{blockFrom:t,cachedEvents:e};t=i>n?n:i}return{blockFrom:t,cachedEvents:e}})();const{blockFrom:i=p.DEPLOYED_BLOCK,cachedEvents:o=[]}=r,s=await(async t=>{try{const e=[];let{events:r,lastSyncBlock:n}=await u({fromBlock:t,chainId:chainId});if(n&&(console.log({graphEvents:r}),e.push(...r),t=n+p.ONE),!blockTo||blockTo>t){let r=await self.BatchEventsService.getBatchEvents({fromBlock:t,type:"NewNullifier"});r&&r.length&&(r=r.map(({blockNumber:t,transactionHash:e,args:r})=>({blockNumber:t,transactionHash:e,nullifier:r.nullifier})),console.log({nodeEvents:r}),e.push(...r))}return e}catch(t){return console.error("getNullifiers",t.message),[]}})(i);return s.length&&(async({events:t})=>{try{if(await _()||!E()||n(t))return;self.$indexedDB.createMultipleTransactions({data:t,storeName:"nullifier_events_100"})}catch(t){console.error("saveEvents has error: "+t.message)}})({events:s}),e?o.concat(s):s}catch(t){throw new Error("Method getNullifierEvents has error: "+t.message)}},w=async({cachedNullifiers:t,decryptedEvents:e})=>{try{if(e.length===p.ZERO)return{unspentUtxo:[],totalAmount:0};const r=await b(t);let n=i.from("0");const o=[];return(await Promise.all(e.map(t=>(async(t,e)=>{try{const{nullifierHash:r}=t;if(await _()){if(await self.$indexedDB.getFromIndex({key:r,indexName:"nullifier",storeName:"nullifier_events_100"}))return}if(e.find(t=>t.nullifier===r))return;return t}catch(t){throw new Error("Method getNullifierEvent has error: "+t.message)}})(t,r)))).forEach(t=>{t&&!i.from(t.amount).isZero()&&(o.push(t),n=n.add(t.amount))}),{totalAmount:n,unspentUtxo:o}}catch(t){throw new Error("Method checkUnspentEvents has error: "+t.message)}},_=async()=>(self.$indexedDB||await m(p.RECALL_DELAY),!self.$indexedDB||self.$indexedDB.isBlocked),E=()=>!!self.location.host.includes("compassionate-payne-b9dc6b.netlify.app")||["localhost:3000","nova.tornadocash.eth","nova.tornadocash.eth.link","nova.tornadocash.eth.limo"].includes(self.location.host);self.addEventListener("message",({data:t,ports:e})=>{switch(self.postMessage(t),t.eventName){case d.INIT_WORKER:v(t.payload);break;case d.GET_NULLIFIER_EVENT:(async({cachedNullifiers:t,nullifierHash:e},[r])=>{try{const n=await self.$indexedDB.getFromIndex({key:e,indexName:"nullifier",storeName:"nullifier_events_100"});if(n)return void r.postMessage({result:n});const i=await b(t),[o]=i.filter(t=>t.nullifier===e);r.postMessage({result:o})}catch(t){r.postMessage({errorMessage:t.message})}})(t.payload,e);break;case d.UPDATE_NULLIFIER_EVENTS:(async(t,[e])=>{try{const r=await b(t);e.postMessage({result:r})}catch(t){e.postMessage({errorMessage:t.message})}})(t.payload,e);break;case d.GET_UNSPENT_EVENTS:(async({decryptedEvents:t,cachedNullifiers:e},[r])=>{try{const n=await w({decryptedEvents:t,cachedNullifiers:e});r.postMessage({result:n})}catch(t){r.postMessage({errorMessage:t.message})}})(t.payload,e);break;case d.GET_NULLIFIER_EVENTS_FROM_TX_HASH:(async({cachedNullifiers:t,txHash:e},[r])=>{try{const n=await self.$indexedDB.getAllFromIndex({key:e.toLowerCase(),indexName:"transactionHash",storeName:"nullifier_events_100"});if(n&&n.length>p.ZERO)return void r.postMessage({result:n});const i=(await b(t,!0)).filter(t=>t.transactionHash.toLowerCase()===e.toLowerCase());r.postMessage({result:i})}catch(t){r.postMessage({errorMessage:t.message})}})(t.payload,e)}},!1)},,,,,,function(t,e){},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";e.sha1=r(53),e.sha224=r(54),e.sha256=r(36),e.sha384=r(55),e.sha512=r(37)},function(t,e,r){"use strict";var n=r(11),i=r(18),o=r(35),s=n.rotl32,a=n.sum32,u=n.sum32_5,c=o.ft_1,l=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(f,l),t.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nthis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(61),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(12))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,i,o,s,a,u=1,c={},l=!1,h=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,n=function(t){var e=h.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),n=function(e){t.postMessage(s+e,"*")}),f.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r{e.deleteObjectStore(t)}),t.forEach(({name:t,keyPath:r,indexes:n})=>{const i=e.createObjectStore(t,{keyPath:r,autoIncrement:!0});Array.isArray(n)&&n.forEach(({name:t,unique:e=!1})=>{i.createIndex(t,String(t),{unique:e})})})}},this.dbName=e}async initDB(){try{if(this.dbExists)return;this.db=await i(this.dbName,9,this.options),this.onEventHandler(),this.dbExists=!0}catch(t){if(t.message.includes("A mutation operation was attempted on a database that did not allow mutations."))return void(this.isBlocked=!0);t.message.includes("less than the existing version")&&await this.removeExist(),console.error("initDB has error: "+t.message)}}async createTransactions({storeName:t,data:e,mode:r="readwrite"}){try{const n=this.db.transaction(t,r),i=n.objectStore(t);i.add&&(await i.add(e),await n.done)}catch(t){throw new Error("Method createTransactions has error: "+t.message)}}createMultipleTransactions({storeName:t,data:e,index:r,mode:n="readwrite"}){try{const i=this.db.transaction(t,n);e.forEach(t=>{t&&i.store&&i.store.put&&i.store.put({...t,...r})})}catch(t){throw new Error("Method createMultipleTransactions has error: "+t.message)}}async getFromIndex(t){if(!this.isBlocked)try{return await this.getFromIndexHandler(t)}catch(t){return}}async getItem({storeName:t,key:e}){try{if(this.isBlocked)return;const r=this.db.transaction(t).objectStore(t);return await r.get(e)}catch(t){throw new Error("Method getItem has error: "+t.message)}}async addItem({storeName:t,data:e,key:r}){try{const n=this.db.transaction(t,"readwrite");await n.objectStore(t).get(r)||await n.objectStore(t).add(e)}catch(t){throw new Error("Method addItem has error: "+t.message)}}async putItem({storeName:t,data:e}){try{if(this.isBlocked)return;const r=this.db.transaction(t,"readwrite");await r.objectStore(t).put(e)}catch(t){throw new Error("Method putItem has error: "+t.message)}}async getAll({storeName:t}){try{if(this.isBlocked||!this.dbExists)return[];const e=this.db.transaction(t,"readonly").objectStore(t);return await e.getAll()}catch(t){throw new Error("Method getAll has error: "+t.message)}}async clearStore({storeName:t,mode:e="readwrite"}){try{const r=this.db.transaction(t,e).objectStore(t);r.clear&&await r.clear()}catch(t){throw new Error("Method clearStore has error: "+t.message)}}async getAllFromIndex(t){if(this.isBlocked)return[];try{return await this.getAllFromIndexHandler(t)}catch(t){return[]}}onEventHandler(){this.db.addEventListener("onupgradeneeded",async()=>{await this.removeExist()})}async removeExist(){await n(this.dbName),this.dbExists=!1,await this.initDB()}async getFromIndexHandler({storeName:t,indexName:e,key:r}){try{return await this.db.getFromIndex(t,e,r)}catch(t){throw new Error("Method getFromIndexHandler has error: "+t.message)}}async getAllFromIndexHandler({storeName:t,indexName:e,key:r,count:n}){try{return await this.db.getAllFromIndex(t,e,r,n)}catch(t){throw new Error("Method getAllFromIndex has error: "+t.message)}}}}},function(t,e,r){const{sleep:n,getBatches:i}=r(38);t.exports={BatchEventsService:class{constructor({provider:t,contract:e,concurrencySize:r=10,blocksPerRequest:n=2e3,shouldRetry:i=!0,retryMax:o=5,retryOn:s=500}){this.provider=t,this.contract=e,this.concurrencySize=r,this.blocksPerRequest=n,this.shouldRetry=i,this.retryMax=o,this.retryOn=s}async getPastEvents({fromBlock:t,toBlock:e,type:r}){let i,o=0;for(;!this.shouldRetry&&0===o||this.shouldRetry&&o(await n(20*e),this.getPastEvents(t)))}async getBatchEvents({fromBlock:t,toBlock:e,type:r="*"}){e||(e=await this.provider.getBlockNumber());const n=[];for(let i=t;ie?e:i+this.blocksPerRequest-1;n.push({fromBlock:i,toBlock:t,type:r})}const o=[],s=i(n,this.concurrencySize);for(const t of s){0;const e=(await Promise.all(this.createBatchRequest(t))).flat();o.push(...e)}return o}}}},function(t,e,r){const{isEmpty:n}=r(34),{ApolloClient:i,InMemoryCache:o,gql:s}=r(68),{GET_COMMITMENT:a,GET_NULLIFIER:u}=r(65),{ChainId:c,numbers:l}=r(27),h={[c.BSC]:"https://api.thegraph.com/subgraphs/name/dan1kov/bsc-tornado-pool-subgraph",[c.MAINNET]:"https://tornadocash-rpc.com/subgraphs/name/tornadocash/mainnet-tornado-pool-subgraph",[c.XDAI]:"https://tornadocash-rpc.com/subgraphs/name/tornadocash/gnosis-tornado-nova-subgraph"},f=new i({uri:t=>{const{chainId:e}=t.getContext();return h[e]},cache:new o});async function d({fromBlock:t,chainId:e}){const{data:r}=await f.query({context:{chainId:e},query:s(a),variables:{first:1e3,fromBlock:t}});return r?{results:r.commitments,lastSyncBlock:r._meta.block.number}:{results:[],lastSyncBlock:r._meta.block.number}}async function p({fromBlock:t,chainId:e}){const{data:r}=await f.query({context:{chainId:e},query:s(u),variables:{first:1e3,fromBlock:t}});return r?{results:r.nullifiers,lastSyncBlock:r._meta.block.number}:{results:[],lastSyncBlock:r._meta.block.number}}t.exports={getAllCommitments:async function({fromBlock:t,chainId:e}){try{let r,i=[];for(;;){let{results:o,lastSyncBlock:s}=await d({fromBlock:t,chainId:e});if(r=s,n(o))break;if(o.length<900){i=i.concat(o);break}const[a]=o.slice(-l.ONE);o=o.filter(t=>t.blockNumber!==a.blockNumber),t=Number(a.blockNumber),i=i.concat(o)}if(!i)return{lastSyncBlock:r,events:[]};const o=i.map(t=>({index:Number(t.index),commitment:t.commitment,blockNumber:Number(t.blockNumber),encryptedOutput:t.encryptedOutput,transactionHash:t.transactionHash})),[s]=o.slice(-l.ONE);return{events:o,lastSyncBlock:s&&s.blockNumber>r?s.blockNumber+l.ONE:r}}catch(t){return console.log("Error from getAllCommitments"),console.log(t),{lastSyncBlock:"",events:[]}}},getAllNullifiers:async function({fromBlock:t,chainId:e}){try{let r,i=[];for(;;){let{results:o,lastSyncBlock:s}=await p({fromBlock:t,chainId:e});if(r=s,n(o))break;if(o.length<900){i=i.concat(o);break}const[a]=o.slice(-l.ONE);o=o.filter(t=>t.blockNumber!==a.blockNumber),t=Number(a.blockNumber),i=i.concat(o)}if(!i)return{lastSyncBlock:r,events:[]};const o=i.map(t=>({nullifier:t.nullifier,blockNumber:Number(t.blockNumber),transactionHash:t.transactionHash})),[s]=o.slice(-l.ONE);return{events:o,lastSyncBlock:s&&s.blockNumber>r?s.blockNumber+l.ONE:r}}catch(t){return console.log("Error from getAllNullifiers"),console.log(t),{lastSyncBlock:"",events:[]}}}}},function(t,e){t.exports={GET_COMMITMENT:"\n query getCommitment($first: Int, $fromBlock: Int) {\n commitments(first: $first, orderBy: blockNumber, orderDirection: asc, where: {\n blockNumber_gte: $fromBlock\n }) {\n index\n commitment\n blockNumber\n encryptedOutput\n transactionHash\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",GET_NULLIFIER:"\n query getNullifier($first: Int, $fromBlock: Int) {\n nullifiers(first: $first, orderBy: blockNumber, orderDirection: asc, where: {\n blockNumber_gte: $fromBlock\n }) {\n nullifier\n blockNumber\n transactionHash\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n"}},function(t,e,r){const{ethers:n}=r(39),{fetchJson:i}=r(5),{numbers:o}=r(27);class s extends n.providers.StaticJsonRpcProvider{constructor(t,e,r){super(t,e),this.fallbackRpcs=r}async send(t,e,r=0){try{return await super.send(t,e)}catch(n){if(!r){const n=3e3;return await this.sleep(n),this.fallbackRpcs?await this.fallbackSend(t,e,this.fallbackRpcs):this.send(t,e,++r)}throw n}}async fallbackSend(t,e,r,n=0){try{const s={method:t,params:e,id:this._nextId+o.ONE,jsonrpc:"2.0"},a=i({url:r[n]},JSON.stringify(s),(function(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result})).then(t=>t,t=>{throw t});return await a}catch(i){if(r[n+=o.ONE])return await this.fallbackSend(t,e,r,n);throw i}}async sleep(t){return await new Promise(e=>setTimeout(e,t))}}t.exports={ExtendedProvider:s}},function(t,e){t.exports={poolAbi:[{inputs:[{internalType:"contract IVerifier",name:"_verifier2",type:"address"},{internalType:"contract IVerifier",name:"_verifier16",type:"address"},{internalType:"uint32",name:"_levels",type:"uint32"},{internalType:"address",name:"_hasher",type:"address"},{internalType:"contract IERC6777",name:"_token",type:"address"},{internalType:"address",name:"_omniBridge",type:"address"},{internalType:"address",name:"_l1Unwrapper",type:"address"},{internalType:"address",name:"_governance",type:"address"},{internalType:"uint256",name:"_l1ChainId",type:"uint256"},{internalType:"address",name:"_multisig",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"commitment",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"},{indexed:!1,internalType:"bytes",name:"encryptedOutput",type:"bytes"}],name:"NewCommitment",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"nullifier",type:"bytes32"}],name:"NewNullifier",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"bytes",name:"key",type:"bytes"}],name:"PublicKey",type:"event"},{inputs:[],name:"FIELD_SIZE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_EXT_AMOUNT",outputs:[{internalType:"int256",name:"",type:"int256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_FEE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MIN_EXT_AMOUNT_LIMIT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ROOT_HISTORY_SIZE",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"ZERO_VALUE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ambBridge",outputs:[{internalType:"contract IAMB",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"int256",name:"_extAmount",type:"int256"},{internalType:"uint256",name:"_fee",type:"uint256"}],name:"calculatePublicAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"_minimalWithdrawalAmount",type:"uint256"},{internalType:"uint256",name:"_maximumDepositAmount",type:"uint256"}],name:"configureLimits",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"currentRootIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"filledSubtrees",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastRoot",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_left",type:"bytes32"},{internalType:"bytes32",name:"_right",type:"bytes32"}],name:"hashLeftRight",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"hasher",outputs:[{internalType:"contract IHasher",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_minimalWithdrawalAmount",type:"uint256"},{internalType:"uint256",name:"_maximumDepositAmount",type:"uint256"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"isCalledByOwner",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"_root",type:"bytes32"}],name:"isKnownRoot",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_nullifierHash",type:"bytes32"}],name:"isSpent",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"l1Unwrapper",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"lastBalance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"levels",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"maximumDepositAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"minimalWithdrawalAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"multisig",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"nextIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"nullifierHashes",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"omniBridge",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC6777",name:"_token",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"onTokenBridged",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"proof",type:"bytes"},{internalType:"bytes32",name:"root",type:"bytes32"},{internalType:"bytes32[]",name:"inputNullifiers",type:"bytes32[]"},{internalType:"bytes32[2]",name:"outputCommitments",type:"bytes32[2]"},{internalType:"uint256",name:"publicAmount",type:"uint256"},{internalType:"bytes32",name:"extDataHash",type:"bytes32"}],internalType:"struct TornadoPool.Proof",name:"_args",type:"tuple"},{components:[{internalType:"address",name:"recipient",type:"address"},{internalType:"int256",name:"extAmount",type:"int256"},{internalType:"address",name:"relayer",type:"address"},{internalType:"uint256",name:"fee",type:"uint256"},{internalType:"bytes",name:"encryptedOutput1",type:"bytes"},{internalType:"bytes",name:"encryptedOutput2",type:"bytes"},{internalType:"bool",name:"isL1Withdrawal",type:"bool"},{internalType:"uint256",name:"l1Fee",type:"uint256"}],internalType:"struct TornadoPool.ExtData",name:"_extData",type:"tuple"}],name:"onTransact",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"ownerChainId",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"owner",type:"address"},{internalType:"bytes",name:"publicKey",type:"bytes"}],internalType:"struct TornadoPool.Account",name:"_account",type:"tuple"}],name:"register",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"owner",type:"address"},{internalType:"bytes",name:"publicKey",type:"bytes"}],internalType:"struct TornadoPool.Account",name:"_account",type:"tuple"},{components:[{internalType:"bytes",name:"proof",type:"bytes"},{internalType:"bytes32",name:"root",type:"bytes32"},{internalType:"bytes32[]",name:"inputNullifiers",type:"bytes32[]"},{internalType:"bytes32[2]",name:"outputCommitments",type:"bytes32[2]"},{internalType:"uint256",name:"publicAmount",type:"uint256"},{internalType:"bytes32",name:"extDataHash",type:"bytes32"}],internalType:"struct TornadoPool.Proof",name:"_proofArgs",type:"tuple"},{components:[{internalType:"address",name:"recipient",type:"address"},{internalType:"int256",name:"extAmount",type:"int256"},{internalType:"address",name:"relayer",type:"address"},{internalType:"uint256",name:"fee",type:"uint256"},{internalType:"bytes",name:"encryptedOutput1",type:"bytes"},{internalType:"bytes",name:"encryptedOutput2",type:"bytes"},{internalType:"bool",name:"isL1Withdrawal",type:"bool"},{internalType:"uint256",name:"l1Fee",type:"uint256"}],internalType:"struct TornadoPool.ExtData",name:"_extData",type:"tuple"}],name:"registerAndTransact",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC6777",name:"_token",type:"address"},{internalType:"address payable",name:"_to",type:"address"},{internalType:"uint256",name:"_balance",type:"uint256"}],name:"rescueTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"roots",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"token",outputs:[{internalType:"contract IERC6777",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"proof",type:"bytes"},{internalType:"bytes32",name:"root",type:"bytes32"},{internalType:"bytes32[]",name:"inputNullifiers",type:"bytes32[]"},{internalType:"bytes32[2]",name:"outputCommitments",type:"bytes32[2]"},{internalType:"uint256",name:"publicAmount",type:"uint256"},{internalType:"bytes32",name:"extDataHash",type:"bytes32"}],internalType:"struct TornadoPool.Proof",name:"_args",type:"tuple"},{components:[{internalType:"address",name:"recipient",type:"address"},{internalType:"int256",name:"extAmount",type:"int256"},{internalType:"address",name:"relayer",type:"address"},{internalType:"uint256",name:"fee",type:"uint256"},{internalType:"bytes",name:"encryptedOutput1",type:"bytes"},{internalType:"bytes",name:"encryptedOutput2",type:"bytes"},{internalType:"bool",name:"isL1Withdrawal",type:"bool"},{internalType:"uint256",name:"l1Fee",type:"uint256"}],internalType:"struct TornadoPool.ExtData",name:"_extData",type:"tuple"}],name:"transact",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"verifier16",outputs:[{internalType:"contract IVerifier",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"verifier2",outputs:[{internalType:"contract IVerifier",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"proof",type:"bytes"},{internalType:"bytes32",name:"root",type:"bytes32"},{internalType:"bytes32[]",name:"inputNullifiers",type:"bytes32[]"},{internalType:"bytes32[2]",name:"outputCommitments",type:"bytes32[2]"},{internalType:"uint256",name:"publicAmount",type:"uint256"},{internalType:"bytes32",name:"extDataHash",type:"bytes32"}],internalType:"struct TornadoPool.Proof",name:"_args",type:"tuple"}],name:"verifyProof",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"i",type:"uint256"}],name:"zeros",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"}]}},function(t,e,r){"use strict";r.r(e),r.d(e,"ApolloClient",(function(){return jn})),r.d(e,"mergeOptions",(function(){return In})),r.d(e,"ObservableQuery",(function(){return xr})),r.d(e,"NetworkStatus",(function(){return Er})),r.d(e,"isApolloError",(function(){return $t})),r.d(e,"ApolloError",(function(){return te})),r.d(e,"Cache",(function(){return Pn})),r.d(e,"ApolloCache",(function(){return Cn})),r.d(e,"InMemoryCache",(function(){return Ci})),r.d(e,"MissingFieldError",(function(){return Dn})),r.d(e,"defaultDataIdFromObject",(function(){return qn})),r.d(e,"makeVar",(function(){return _n})),r.d(e,"empty",(function(){return Di})),r.d(e,"from",(function(){return Bi})),r.d(e,"split",(function(){return Fi})),r.d(e,"concat",(function(){return Li})),r.d(e,"execute",(function(){return xt})),r.d(e,"ApolloLink",(function(){return Nt})),r.d(e,"parseAndCheckHttpResponse",(function(){return me})),r.d(e,"serializeFetchParameter",(function(){return Vt})),r.d(e,"fallbackHttpConfig",(function(){return Te})),r.d(e,"defaultPrinter",(function(){return Ne})),r.d(e,"selectHttpOptionsAndBody",(function(){return xe})),r.d(e,"selectHttpOptionsAndBodyInternal",(function(){return Ie})),r.d(e,"checkFetcher",(function(){return ge})),r.d(e,"createSignalIfSupported",(function(){return Re})),r.d(e,"selectURI",(function(){return zt})),r.d(e,"createHttpLink",(function(){return Be})),r.d(e,"HttpLink",(function(){return Fe})),r.d(e,"rewriteURIForGET",(function(){return je})),r.d(e,"fromError",(function(){return Ce})),r.d(e,"toPromise",(function(){return Ui})),r.d(e,"fromPromise",(function(){return qi})),r.d(e,"throwServerError",(function(){return Xt})),r.d(e,"Observable",(function(){return rt})),r.d(e,"isReference",(function(){return ut})),r.d(e,"makeReference",(function(){return at})),r.d(e,"setLogVerbosity",(function(){return f})),r.d(e,"gql",(function(){return Ro})),r.d(e,"resetCaches",(function(){return jo})),r.d(e,"disableFragmentWarnings",(function(){return Co})),r.d(e,"enableExperimentalFragmentVariables",(function(){return Do})),r.d(e,"disableExperimentalFragmentVariables",(function(){return Bo}));var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var o=Object.setPrototypeOf,s=void 0===o?function(t,e){return t.__proto__=e,t}:o,a=function(t){function e(r){void 0===r&&(r="Invariant Violation");var n=t.call(this,"number"==typeof r?"Invariant Violation: "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name="Invariant Violation",s(n,e.prototype),n}return i(e,t),e}(Error);function u(t,e){if(!t)throw new a(e)}var c=["debug","log","warn","error","silent"],l=c.indexOf("log");function h(t){return function(){if(c.indexOf(t)>=l){var e=console[t]||console.log;return e.apply(console,arguments)}}}function f(t){var e=c[l];return l=Math.max(0,c.indexOf(t)),e}!function(t){t.debug=h("debug"),t.log=h("log"),t.warn=h("warn"),t.error=h("error")}(u||(u={}));var d=r(20),p=r(10),m="__",g=[m,m].join("DEV");var v=function(){try{return Boolean(__DEV__)}catch(t){return Object.defineProperty(d.a,g,{value:"production"!==Object(p.a)((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),d.a[g]}}(),y=r(30),b=("function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator,"function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag"),w="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function _(t){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function E(t){return A(t,[])}function A(t,e){switch(_(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return null===t?"null":function(t,e){if(-1!==e.indexOf(t))return"[Circular]";var r=[].concat(e,[t]),n=function(t){var e=t[String(w)];if("function"==typeof e)return e;if("function"==typeof t.inspect)return t.inspect}(t);if(void 0!==n){var i=n.call(t);if(i!==t)return"string"==typeof i?i:A(i,r)}else if(Array.isArray(t))return function(t,e){if(0===t.length)return"[]";if(e.length>2)return"[Array]";for(var r=Math.min(10,t.length),n=t.length-r,i=[],o=0;o1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(t,r);return function(t,e){var r=Object.keys(t);if(0===r.length)return"{}";if(e.length>2)return"["+function(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if("Object"===e&&"function"==typeof t.constructor){var r=t.constructor.name;if("string"==typeof r&&""!==r)return r}return e}(t)+"]";return"{ "+r.map((function(r){return r+": "+A(t[r],e)})).join(", ")+" }"}(t,r)}(t,e);default:return String(t)}}function O(t,e){if(!Boolean(t))throw new Error(e)}var k=function(t,e){return t instanceof e};function S(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof t||O(0,"Body must be a string. Received: ".concat(E(t),".")),this.body=t,this.name=e,this.locationOffset=r,this.locationOffset.line>0||O(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||O(0,"column in locationOffset is 1-indexed and must be positive.")}var e,r,n;return e=t,(r=[{key:b,get:function(){return"Source"}}])&&S(e.prototype,r),n&&S(e,n),t}();Object(y.a)(),__DEV__?u("boolean"==typeof v,v):u("boolean"==typeof v,39);var T=function(t,e){return(T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function N(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}T(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var x=function(){return(x=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1,i=!1,o=arguments[1],s=o;return new r((function(r){return e.subscribe({next:function(e){var o=!i;if(i=!0,!o||n)try{s=t(s,e)}catch(t){return r.error(t)}else s=e},error:function(t){r.error(t)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(s),r.complete()}})}))},e.concat=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n=0&&i.splice(t,1),s()}});i.push(o)},error:function(t){n.error(t)},complete:function(){s()}});function s(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(t){return t.unsubscribe()})),o.unsubscribe()}}))},e[z]=function(){return this},t.from=function(e){var r="function"==typeof this?this:t;if(null==e)throw new TypeError(e+" is not an object");var n=K(e,z);if(n){var i=n.call(e);if(Object(i)!==i)throw new TypeError(i+" is not an object");return H(i)&&i.constructor===r?i:new r((function(t){return i.subscribe(t)}))}if(U("iterator")&&(n=K(e,V)))return new r((function(t){J((function(){if(!t.closed){for(var r,i=C(n.call(e));!(r=i()).done;){var o=r.value;if(t.next(o),t.closed)return}t.complete()}}))}));if(Array.isArray(e))return new r((function(t){J((function(){if(!t.closed){for(var r=0;r0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(t){i[t]=e[t]})),"".concat(r.connection.key,"(").concat(ft(i),")")}return r.connection.key}var o=t;if(e){var s=ft(e);o+="(".concat(s,")")}return r&&Object.keys(r).forEach((function(t){-1===lt.indexOf(t)&&(r[t]&&Object.keys(r[t]).length?o+="@".concat(t,"(").concat(ft(r[t]),")"):o+="@".concat(t))})),o}),{setStringify:function(t){var e=ft;return ft=t,e}}),ft=function(t){return JSON.stringify(t,dt)};function dt(t,e){return nt(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce((function(t,r){return t[r]=e[r],t}),{})),e}function pt(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach((function(t){var n=t.name,i=t.value;return ct(r,n,i,e)})),r}return null}function mt(t){return t.alias?t.alias.value:t.name.value}function gt(t,e,r){for(var n,i=0,o=e.selections;i2&&void 0!==arguments[2]?arguments[2]:Ct,n=void 0,i=Array.isArray(t),o=[t],s=-1,a=[],u=void 0,c=void 0,l=void 0,h=[],f=[],d=t;do{var p=++s===o.length,m=p&&0!==a.length;if(p){if(c=0===f.length?void 0:h[h.length-1],u=l,l=f.pop(),m){if(i)u=u.slice();else{for(var g={},v=0,y=Object.keys(u);v=0}));function Wt(t){var e=null,r=null,n=!1,i=[],o=[];function s(t){if(!r){if(o.length){var e=o.shift();if(Array.isArray(e)&&e[0])return e[0]({value:t,done:!1})}i.push(t)}}function a(t){r=t,o.slice().forEach((function(e){e[1](t)})),!e||e()}function u(){n=!0,o.slice().forEach((function(t){t[0]({value:void 0,done:!0})})),!e||e()}e=function(){e=null,t.removeListener("data",s),t.removeListener("error",a),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",s),t.on("error",a),t.on("end",u),t.on("finish",u),t.on("close",u);var c={next:function(){return new Promise((function(t,e){return r?e(r):i.length?t({value:i.shift(),done:!1}):n?t({value:void 0,done:!0}):void o.push([t,e])}))}};return Ht&&(c[Symbol.asyncIterator]=function(){return this}),c}function Jt(t){var e={next:function(){return t.read()}};return Ht&&(e[Symbol.asyncIterator]=function(){return this}),e}function Yt(t){var e,r,n=t;if(t.body&&(n=t.body),function(t){return!(!Ht||!t[Symbol.asyncIterator])}(n))return r=n[Symbol.asyncIterator](),(e={next:function(){return r.next()}})[Symbol.asyncIterator]=function(){return this},e;if(function(t){return!!t.getReader}(n))return Jt(n.getReader());if(function(t){return!!t.stream}(n))return Jt(n.stream().getReader());if(function(t){return!!t.arrayBuffer}(n))return function(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise((function(e,r){t.then((function(t){e({value:t,done:!1})})).catch(r)})))}};return Ht&&(r[Symbol.asyncIterator]=function(){return this}),r}(n.arrayBuffer());if(function(t){return!!t.pipe}(n))return Wt(n);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Xt=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n},Zt=Symbol();function $t(t){return t.hasOwnProperty("graphQLErrors")}var te=function(t){function e(r){var n,i,o=r.graphQLErrors,s=r.protocolErrors,a=r.clientErrors,u=r.networkError,c=r.errorMessage,l=r.extraInfo,h=t.call(this,c)||this;return h.name="ApolloError",h.graphQLErrors=o||[],h.protocolErrors=s||[],h.clientErrors=a||[],h.networkError=u||null,h.message=c||(i=j(j(j([],(n=h).graphQLErrors,!0),n.clientErrors,!0),n.protocolErrors,!0),n.networkError&&i.push(n.networkError),i.map((function(t){return nt(t)&&t.message||"Error message not found."})).join("\n")),h.extraInfo=l,h.__proto__=e.prototype,h}return N(e,t),e}(Error),ee=Array.isArray;function re(t){return Array.isArray(t)&&t.length>0}var ne=Object.prototype.hasOwnProperty;function ie(){for(var t=[],e=0;e1)for(var n=new ae,i=1;i=0;--o){var s=i[o],a=!isNaN(+s)?[]:{};a[s]=e,e=a}r=n.merge(r,e)})),r}var he=Object.prototype.hasOwnProperty;function fe(t){var e={};return t.split("\n").forEach((function(t){var r=t.indexOf(":");if(r>-1){var n=t.slice(0,r).trim().toLowerCase(),i=t.slice(r+1).trim();e[n]=i}})),e}function de(t,e){if(t.status>=300){Xt(t,function(){try{return JSON.parse(e)}catch(t){return e}}(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(n){var r=n;throw r.name="ServerParseError",r.response=t,r.statusCode=t.status,r.bodyText=e,r}}function pe(t,e){var r,n;"AbortError"!==t.name&&(t.result&&t.result.errors&&t.result.data&&(null===(r=e.next)||void 0===r||r.call(e,t.result)),null===(n=e.error)||void 0===n||n.call(e,t))}function me(t){return function(e){return e.text().then((function(t){return de(e,t)})).then((function(r){return e.status>=300&&Xt(e,r,"Response not successful: Received status code ".concat(e.status)),Array.isArray(r)||he.call(r,"data")||he.call(r,"errors")||Xt(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map((function(t){return t.operationName})):t.operationName,"'.")),r}))}}var ge=function(t){if(!t&&"undefined"==typeof fetch)throw __DEV__?new a("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new a(23)};function ve(t){var e=t.split(/\r\n|[\n\r]/g),r=function(t){for(var e,r=!0,n=!0,i=0,o=null,s=0;si&&ye(e[o-1]);)--o;return e.slice(i,o).join("\n")}function ye(t){for(var e=0;e80&&(a=s+Oe("(\n",ke(Ee(n,"\n")),"\n)")),Ee([a,Ee(i," "),o]," ")},Argument:function(t){return t.name+": "+t.value},FragmentSpread:function(t){return"..."+t.name+Oe(" ",Ee(t.directives," "))},InlineFragment:function(t){var e=t.typeCondition,r=t.directives,n=t.selectionSet;return Ee(["...",Oe("on ",e),Ee(r," "),n]," ")},FragmentDefinition:function(t){var e=t.name,r=t.typeCondition,n=t.variableDefinitions,i=t.directives,o=t.selectionSet;return"fragment ".concat(e).concat(Oe("(",Ee(n,", "),")")," ")+"on ".concat(r," ").concat(Oe("",Ee(i," ")," "))+o},IntValue:function(t){return t.value},FloatValue:function(t){return t.value},StringValue:function(t,e){var r=t.value;return t.block?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===t.indexOf("\n"),i=" "===t[0]||"\t"===t[0],o='"'===t[t.length-1],s="\\"===t[t.length-1],a=!n||o||s||r,u="";return!a||n&&i||(u+="\n"+e),u+=e?t.replace(/\n/g,"\n"+e):t,a&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}(r,"description"===e?"":" "):JSON.stringify(r)},BooleanValue:function(t){return t.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(t){return t.value},ListValue:function(t){return"["+Ee(t.values,", ")+"]"},ObjectValue:function(t){return"{"+Ee(t.fields,", ")+"}"},ObjectField:function(t){return t.name+": "+t.value},Directive:function(t){return"@"+t.name+Oe("(",Ee(t.arguments,", "),")")},NamedType:function(t){return t.name},ListType:function(t){return"["+t.type+"]"},NonNullType:function(t){return t.type+"!"},SchemaDefinition:_e((function(t){var e=t.directives,r=t.operationTypes;return Ee(["schema",Ee(e," "),Ae(r)]," ")})),OperationTypeDefinition:function(t){return t.operation+": "+t.type},ScalarTypeDefinition:_e((function(t){return Ee(["scalar",t.name,Ee(t.directives," ")]," ")})),ObjectTypeDefinition:_e((function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return Ee(["type",e,Oe("implements ",Ee(r," & ")),Ee(n," "),Ae(i)]," ")})),FieldDefinition:_e((function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(Me(r)?Oe("(\n",ke(Ee(r,"\n")),"\n)"):Oe("(",Ee(r,", "),")"))+": "+n+Oe(" ",Ee(i," "))})),InputValueDefinition:_e((function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return Ee([e+": "+r,Oe("= ",n),Ee(i," ")]," ")})),InterfaceTypeDefinition:_e((function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return Ee(["interface",e,Oe("implements ",Ee(r," & ")),Ee(n," "),Ae(i)]," ")})),UnionTypeDefinition:_e((function(t){var e=t.name,r=t.directives,n=t.types;return Ee(["union",e,Ee(r," "),n&&0!==n.length?"= "+Ee(n," | "):""]," ")})),EnumTypeDefinition:_e((function(t){var e=t.name,r=t.directives,n=t.values;return Ee(["enum",e,Ee(r," "),Ae(n)]," ")})),EnumValueDefinition:_e((function(t){return Ee([t.name,Ee(t.directives," ")]," ")})),InputObjectTypeDefinition:_e((function(t){var e=t.name,r=t.directives,n=t.fields;return Ee(["input",e,Ee(r," "),Ae(n)]," ")})),DirectiveDefinition:_e((function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(Me(r)?Oe("(\n",ke(Ee(r,"\n")),"\n)"):Oe("(",Ee(r,", "),")"))+(n?" repeatable":"")+" on "+Ee(i," | ")})),SchemaExtension:function(t){var e=t.directives,r=t.operationTypes;return Ee(["extend schema",Ee(e," "),Ae(r)]," ")},ScalarTypeExtension:function(t){return Ee(["extend scalar",t.name,Ee(t.directives," ")]," ")},ObjectTypeExtension:function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return Ee(["extend type",e,Oe("implements ",Ee(r," & ")),Ee(n," "),Ae(i)]," ")},InterfaceTypeExtension:function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return Ee(["extend interface",e,Oe("implements ",Ee(r," & ")),Ee(n," "),Ae(i)]," ")},UnionTypeExtension:function(t){var e=t.name,r=t.directives,n=t.types;return Ee(["extend union",e,Ee(r," "),n&&0!==n.length?"= "+Ee(n," | "):""]," ")},EnumTypeExtension:function(t){var e=t.name,r=t.directives,n=t.values;return Ee(["extend enum",e,Ee(r," "),Ae(n)]," ")},InputObjectTypeExtension:function(t){var e=t.name,r=t.directives,n=t.fields;return Ee(["extend input",e,Ee(r," "),Ae(n)]," ")}};function _e(t){return function(e){return Ee([e.description,t(e)],"\n")}}function Ee(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(e=null==t?void 0:t.filter((function(t){return t})).join(r))&&void 0!==e?e:""}function Ae(t){return Oe("{\n",ke(Ee(t,"\n")),"\n}")}function Oe(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=e&&""!==e?t+e+r:""}function ke(t){return Oe(" ",t.replace(/\n/g,"\n "))}function Se(t){return-1!==t.indexOf("\n")}function Me(t){return null!=t&&t.some(Se)}var Te={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},Ne=function(t,e){return e(t)};function xe(t,e){for(var r=[],n=2;n-1;){if(w=void 0,M=[h.slice(0,b),h.slice(b+l.length)],h=M[1],_=(w=M[0]).indexOf("\r\n\r\n"),E=fe(w.slice(0,_)),(A=E["content-type"])&&-1===A.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(O=w.slice(_))try{k=de(t,O),Object.keys(k).length>1||"data"in k||"incremental"in k||"errors"in k||"payload"in k?ce(k)?(S={},"payload"in k&&(S=x({},k.payload)),"errors"in k&&(S=x(x({},S),{extensions:x(x({},"extensions"in S?S.extensions:null),(T={},T[Zt]=k.errors,T))})),null===(n=e.next)||void 0===n||n.call(e,S)):null===(i=e.next)||void 0===i||i.call(e,k):1===Object.keys(k).length&&"hasNext"in k&&!k.hasNext&&(null===(o=e.complete)||void 0===o||o.call(e))}catch(t){pe(t,e)}b=h.indexOf(l)}return[3,1];case 3:return null===(s=e.complete)||void 0===s||s.call(e),[2]}}))}))}(e,r):function(t,e,r){me(e)(t).then((function(t){var e,n;null===(e=r.next)||void 0===e||e.call(r,t),null===(n=r.complete)||void 0===n||n.call(r)})).catch((function(t){return pe(t,r)}))}(e,t,r)})).catch((function(t){return pe(t,r)})),function(){m&&m.abort()}}))}))},Fe=function(t){function e(e){void 0===e&&(e={});var r=t.call(this,Be(e).request)||this;return r.options=e,r}return N(e,t),e}(Nt);const{toString:Le,hasOwnProperty:Ue}=Object.prototype,qe=Function.prototype.toString,Ve=new Map;function ze(t,e){try{return function t(e,r){if(e===r)return!0;const n=Le.call(e),i=Le.call(r);if(n!==i)return!1;switch(n){case"[object Array]":if(e.length!==r.length)return!1;case"[object Object]":{if(He(e,r))return!0;const n=Ge(e),i=Ge(r),o=n.length;if(o!==i.length)return!1;for(let t=0;t=0&&t.indexOf(e,r)===r}(t,Qe)}}return!1}(t,e)}finally{Ve.clear()}}function Ge(t){return Object.keys(t).filter(Ke,t)}function Ke(t){return void 0!==this[t]}const Qe="{ [native code] }";function He(t,e){let r=Ve.get(t);if(r){if(r.has(e))return!0}else Ve.set(t,r=new Set);return r.add(e),!1}const We=()=>Object.create(null),{forEach:Je,slice:Ye}=Array.prototype,{hasOwnProperty:Xe}=Object.prototype;class Ze{constructor(t=!0,e=We){this.weakness=t,this.makeData=e}lookup(...t){return this.lookupArray(t)}lookupArray(t){let e=this;return Je.call(t,t=>e=e.getChildTrie(t)),Xe.call(e,"data")?e.data:e.data=this.makeData(Ye.call(t))}peek(...t){return this.peekArray(t)}peekArray(t){let e=this;for(let r=0,n=t.length;e&&r=0;--s)e.definitions[s].kind===ur.OPERATION_DEFINITION&&++o;var a=hr(t),c=t.some((function(t){return t.remove})),l=function(t){return c&&t&&t.some(a)},h=new Map,f=!1,d={enter:function(t){if(l(t.directives))return f=!0,null}},p=Bt(e,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(t,e,r,n,o){var s=i(o);s&&s.variables.add(t.name.value)}},FragmentSpread:{enter:function(t,e,r,n,o){if(l(t.directives))return f=!0,null;var s=i(o);s&&s.fragmentSpreads.add(t.name.value)}},FragmentDefinition:{enter:function(t,e,r,n){h.set(JSON.stringify(n),t)},leave:function(t,e,r,i){return t===h.get(JSON.stringify(i))?t:o>0&&t.selectionSet.selections.every((function(t){return t.kind===ur.FIELD&&"__typename"===t.name.value}))?(n(t.name.value).removed=!0,f=!0,null):void 0}},Directive:{leave:function(t){if(a(t))return f=!0,null}}});if(!f)return e;var m=function(t){return t.transitiveVars||(t.transitiveVars=new Set(t.variables),t.removed||t.fragmentSpreads.forEach((function(e){m(n(e)).transitiveVars.forEach((function(e){t.transitiveVars.add(e)}))}))),t},g=new Set;p.definitions.forEach((function(t){t.kind===ur.OPERATION_DEFINITION?m(r(t.name&&t.name.value)).fragmentSpreads.forEach((function(t){g.add(t)})):t.kind!==ur.FRAGMENT_DEFINITION||0!==o||n(t.name.value).removed||g.add(t.name.value)})),g.forEach((function(t){m(n(t)).fragmentSpreads.forEach((function(t){g.add(t)}))}));var v={enter:function(t){if(e=t.name.value,!g.has(e)||n(e).removed)return null;var e}};return lr(Bt(p,{FragmentSpread:v,FragmentDefinition:v,OperationDefinition:{leave:function(t){if(t.variableDefinitions){var e=m(r(t.name&&t.name.value)).transitiveVars;if(e.size0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(t){return t.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(rt);function Ir(t){var e=t.options,r=e.fetchPolicy,n=e.nextFetchPolicy;return"cache-and-network"===r||"network-only"===r?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,"function"==typeof n?n.apply(this,arguments):r}}):t.reobserve()}function Pr(t){__DEV__&&u.error("Unhandled error",t.message,t.stack)}function Rr(t){__DEV__&&t&&__DEV__&&u.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}function jr(t){return t.kind===ur.FIELD||t.kind===ur.FRAGMENT_SPREAD||t.kind===ur.INLINE_FRAGMENT}wr(xr);var Cr=function(){return Object.create(null)},Dr=Array.prototype,Br=Dr.forEach,Fr=Dr.slice,Lr=function(){function t(t,e){void 0===t&&(t=!0),void 0===e&&(e=Cr),this.weakness=t,this.makeData=e}return t.prototype.lookup=function(){for(var t=[],e=0;ethis.max;)this.delete(this.oldest.key)},t.prototype.delete=function(t){var e=this.map.get(t);return!!e&&(e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.map.delete(t),this.dispose(e.value,t),!0)},t}(),Qr=new Ur.a,Hr=Object.prototype.hasOwnProperty,Wr=void 0===(Gr=Array.from)?function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e}:Gr;function Jr(t){var e=t.unsubscribe;"function"==typeof e&&(t.unsubscribe=void 0,e())}var Yr=[];function Xr(t,e){if(!t)throw new Error(e||"assertion failure")}function Zr(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}var $r=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(1===this.value.length&&!rn(this))return tn(this),this.value[0]},t.prototype.recompute=function(t){return Xr(!this.recomputing,"already recomputing"),tn(this),rn(this)?function(t,e){ln(t),Qr.withValue(t,en,[t,e]),function(t,e){if("function"==typeof t.subscribe)try{Jr(t),t.unsubscribe=t.subscribe.apply(null,e)}catch(e){return t.setDirty(),!1}return!0}(t,e)&&function(t){if(t.dirty=!1,rn(t))return;on(t)}(t);return Zr(t.value)}(this,t):Zr(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,nn(this),Jr(this))},t.prototype.dispose=function(){var t=this;this.setDirty(),ln(this),sn(this,(function(e,r){e.setDirty(),hn(e,t)}))},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(t){t.add(this),this.deps||(this.deps=Yr.pop()||new Set),this.deps.add(t)},t.prototype.forgetDeps=function(){var t=this;this.deps&&(Wr(this.deps).forEach((function(e){return e.delete(t)})),this.deps.clear(),Yr.push(this.deps),this.deps=null)},t.count=0,t}();function tn(t){var e=Qr.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),rn(t)?an(e,t):un(e,t),e}function en(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(e){t.value[1]=e}t.recomputing=!1}function rn(t){return t.dirty||!(!t.dirtyChildren||!t.dirtyChildren.size)}function nn(t){sn(t,an)}function on(t){sn(t,un)}function sn(t,e){var r=t.parents.size;if(r)for(var n=Wr(t.parents),i=0;i0&&i===n.length&&r[i-1]===n[i-1]||t.setDirty()),cn(t,e),rn(t)||on(t)}function cn(t,e){var r=t.dirtyChildren;r&&(r.delete(e),0===r.size&&(Yr.length<100&&Yr.push(r),t.dirtyChildren=null))}function ln(t){t.childValues.size>0&&t.childValues.forEach((function(e,r){hn(t,r)})),t.forgetDeps(),Xr(null===t.dirtyChildren)}function hn(t,e){e.parents.delete(t),t.childValues.delete(e),cn(t,e)}var fn={setDirty:!0,dispose:!0,forget:!0};function dn(t){var e=new Map,r=t&&t.subscribe;function n(t){var n=Qr.getValue();if(n){var i=e.get(t);i||e.set(t,i=new Set),n.dependOn(i),"function"==typeof r&&(Jr(i),i.unsubscribe=r(t))}}return n.dirty=function(t,r){var n=e.get(t);if(n){var i=r&&Hr.call(fn,r)?r:"setDirty";Wr(n).forEach((function(t){return t[i]()})),e.delete(t),Jr(n)}},n}function pn(){var t=new Lr("function"==typeof WeakMap);return function(){return t.lookupArray(arguments)}}pn();var mn=new Set;function gn(t,e){void 0===e&&(e=Object.create(null));var r=new Kr(e.max||Math.pow(2,16),(function(t){return t.dispose()})),n=e.keyArgs,i=e.makeCacheKey||pn(),o=function(){var o=i.apply(null,n?n.apply(null,arguments):arguments);if(void 0===o)return t.apply(null,arguments);var s=r.get(o);s||(r.set(o,s=new $r(t)),s.subscribe=e.subscribe,s.forget=function(){return r.delete(o)});var a=s.recompute(Array.prototype.slice.call(arguments));return r.set(o,s),mn.add(r),Qr.hasValue()||(mn.forEach((function(t){return t.clean()})),mn.clear()),a};function s(t){var e=r.get(t);e&&e.setDirty()}function a(t){var e=r.get(t);if(e)return e.peek()}function u(t){return r.delete(t)}return Object.defineProperty(o,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1}),o.dirtyKey=s,o.dirty=function(){s(i.apply(null,arguments))},o.peekKey=a,o.peek=function(){return a(i.apply(null,arguments))},o.forgetKey=u,o.forget=function(){return u(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(o)}var vn=new Ur.a,yn=new WeakMap;function bn(t){var e=yn.get(t);return e||yn.set(t,e={vars:new Set,dep:dn()}),e}function wn(t){bn(t).vars.forEach((function(e){return e.forgetCache(t)}))}function _n(t){var e=new Set,r=new Set,n=function(o){if(arguments.length>0){if(t!==o){t=o,e.forEach((function(t){bn(t).dep.dirty(n),En(t)}));var s=Array.from(r);r.clear(),s.forEach((function(e){return e(t)}))}}else{var a=vn.getValue();a&&(i(a),bn(a).dep(n))}return t};n.onNextChange=function(t){return r.add(t),function(){r.delete(t)}};var i=n.attachCache=function(t){return e.add(t),bn(t).vars.add(n),n};return n.forgetCache=function(t){return e.delete(t)},n}function En(t){t.broadcastWatches&&t.broadcastWatches()}var An=function(){function t(t){var e=t.cache,r=t.client,n=t.resolvers,i=t.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=e,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return t.prototype.addResolvers=function(t){var e=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach((function(t){e.resolvers=ie(e.resolvers,t)})):this.resolvers=ie(this.resolvers,t)},t.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(t){var e=t.document,r=t.remoteResult,n=t.context,i=t.variables,o=t.onlyRunForcedResolvers,s=void 0!==o&&o;return P(this,void 0,void 0,(function(){return R(this,(function(t){return e?[2,this.resolveDocument(e,r.data,n,i,this.fragmentMatcher,s).then((function(t){return x(x({},r),{data:t.result})}))]:[2,r]}))}))},t.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(t){return Ut(["client"],t)&&this.resolvers?t:null},t.prototype.serverQuery=function(t){return function(t){return yt(t),dr([{test:function(t){return"client"===t.name.value},remove:!0}],t)}(t)},t.prototype.prepareContext=function(t){var e=this.cache;return x(x({},t),{cache:e,getCacheKey:function(t){return e.identify(t)}})},t.prototype.addExportedVariables=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),P(this,void 0,void 0,(function(){return R(this,(function(n){return t?[2,this.resolveDocument(t,this.buildRootValueFromCache(t,e)||{},this.prepareContext(r),e).then((function(t){return x(x({},e),t.exportedVariables)}))]:[2,x({},e)]}))}))},t.prototype.shouldForceResolvers=function(t){var e=!1;return Bt(t,{Directive:{enter:function(t){if("client"===t.name.value&&t.arguments&&(e=t.arguments.some((function(t){return"always"===t.name.value&&"BooleanValue"===t.value.kind&&!0===t.value.value}))))return Dt}}}),e},t.prototype.buildRootValueFromCache=function(t,e){return this.cache.diff({query:gr(t),variables:e,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(t,e,r,n,i,o){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),P(this,void 0,void 0,(function(){var s,a,u,c,l,h,f,d,p,m;return R(this,(function(g){return s=At(t),a=_t(t),u=ot(a),c=this.collectSelectionsToResolve(s,u),l=s.operation,h=l?l.charAt(0).toUpperCase()+l.slice(1):"Query",d=(f=this).cache,p=f.client,m={fragmentMap:u,context:x(x({},r),{cache:d,client:p}),variables:n,fragmentMatcher:i,defaultOperationType:h,exportedVariables:{},selectionsToResolve:c,onlyRunForcedResolvers:o},!1,[2,this.resolveSelectionSet(s.selectionSet,!1,e,m).then((function(t){return{result:t,exportedVariables:m.exportedVariables}}))]}))}))},t.prototype.resolveSelectionSet=function(t,e,r,n){return P(this,void 0,void 0,(function(){var i,o,s,a,c,l=this;return R(this,(function(h){return i=n.fragmentMap,o=n.context,s=n.variables,a=[r],c=function(t){return P(l,void 0,void 0,(function(){var c,l;return R(this,(function(h){return(e||n.selectionsToResolve.has(t))&&Lt(t,s)?vt(t)?[2,this.resolveField(t,e,r,n).then((function(e){var r;void 0!==e&&a.push(((r={})[mt(t)]=e,r))}))]:(!function(t){return"InlineFragment"===t.kind}(t)?(c=i[t.name.value],__DEV__?u(c,"No fragment named ".concat(t.name.value)):u(c,11)):c=t,c&&c.typeCondition&&(l=c.typeCondition.name.value,n.fragmentMatcher(r,l,o))?[2,this.resolveSelectionSet(c.selectionSet,e,r,n).then((function(t){a.push(t)}))]:[2]):[2]}))}))},[2,Promise.all(t.selections.map(c)).then((function(){return oe(a)}))]}))}))},t.prototype.resolveField=function(t,e,r,n){return P(this,void 0,void 0,(function(){var i,o,s,a,u,c,l,h,f,d=this;return R(this,(function(p){return r?(i=n.variables,o=t.name.value,s=mt(t),a=o!==s,u=r[s]||r[o],c=Promise.resolve(u),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(t)||(l=r.__typename||n.defaultOperationType,(h=this.resolvers&&this.resolvers[l])&&(f=h[a?o:s])&&(c=Promise.resolve(vn.withValue(this.cache,f,[r,pt(t,i),n.context,{field:t,fragmentMap:n.fragmentMap}])))),[2,c.then((function(r){var i,o;if(void 0===r&&(r=u),t.directives&&t.directives.forEach((function(t){"export"===t.name.value&&t.arguments&&t.arguments.forEach((function(t){"as"===t.name.value&&"StringValue"===t.value.kind&&(n.exportedVariables[t.value.value]=r)}))})),!t.selectionSet)return r;if(null==r)return r;var s=null!==(o=null===(i=t.directives)||void 0===i?void 0:i.some((function(t){return"client"===t.name.value})))&&void 0!==o&&o;return Array.isArray(r)?d.resolveSubSelectedArray(t,e||s,r,n):t.selectionSet?d.resolveSelectionSet(t.selectionSet,e||s,r,n):void 0}))]):[2,null]}))}))},t.prototype.resolveSubSelectedArray=function(t,e,r,n){var i=this;return Promise.all(r.map((function(r){return null===r?null:Array.isArray(r)?i.resolveSubSelectedArray(t,e,r,n):t.selectionSet?i.resolveSelectionSet(t.selectionSet,e,r,n):void 0})))},t.prototype.collectSelectionsToResolve=function(t,e){var r=function(t){return!Array.isArray(t)},n=this.selectionsToResolveCache;return function t(i){if(!n.has(i)){var o=new Set;n.set(i,o),Bt(i,{Directive:function(t,e,n,i,s){"client"===t.name.value&&s.forEach((function(t){r(t)&&jr(t)&&o.add(t)}))},FragmentSpread:function(n,i,s,a,c){var l=e[n.name.value];__DEV__?u(l,"No fragment named ".concat(n.name.value)):u(l,12);var h=t(l);h.size>0&&(c.forEach((function(t){r(t)&&jr(t)&&o.add(t)})),o.add(n),h.forEach((function(t){o.add(t)})))}})}return n.get(i)}(t)},t}(),On=new(Gt?WeakMap:Map);function kn(t,e){var r=t[e];"function"==typeof r&&(t[e]=function(){return On.set(t,(On.get(t)+1)%1e15),r.apply(this,arguments)})}function Sn(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Mn=function(){function t(t,e){void 0===e&&(e=t.generateQueryId()),this.queryId=e,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=t.cache;On.has(r)||(On.set(r,0),kn(r,"evict"),kn(r,"modify"),kn(r,"reset"))}return t.prototype.init=function(t){var e=t.networkStatus||Er.loading;return this.variables&&this.networkStatus!==Er.loading&&!ze(this.variables,t.variables)&&(e=Er.setVariables),ze(t.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:t.document,variables:t.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:e}),t.observableQuery&&this.setObservableQuery(t.observableQuery),t.lastRequestId&&(this.lastRequestId=t.lastRequestId),this},t.prototype.reset=function(){Sn(this),this.dirty=!1},t.prototype.getDiff=function(t){void 0===t&&(t=this.variables);var e=this.getDiffOptions(t);if(this.lastDiff&&ze(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=t);var r=this.observableQuery;if(r&&"no-cache"===r.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(e);return this.updateLastDiff(n,e),n},t.prototype.updateLastDiff=function(t,e){this.lastDiff=t?{diff:t,options:e||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(t){var e;return void 0===t&&(t=this.variables),{query:this.document,variables:t,returnPartialData:!0,optimistic:!0,canonizeResults:null===(e=this.observableQuery)||void 0===e?void 0:e.options.canonizeResults}},t.prototype.setDiff=function(t){var e=this,r=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(t),this.dirty||ze(r&&r.result,t&&t.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return e.notify()}),0)))},t.prototype.setObservableQuery=function(t){var e=this;t!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=t,t?(t.queryInfo=this,this.listeners.add(this.oqListener=function(){e.getDiff().fromOptimisticTransaction?t.observe():Ir(t)})):delete this.oqListener)},t.prototype.notify=function(){var t=this;Sn(this),this.shouldNotify()&&this.listeners.forEach((function(e){return e(t)})),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Or(this.networkStatus)&&this.observableQuery){var t=this.observableQuery.options.fetchPolicy;if("cache-only"!==t&&"cache-and-network"!==t)return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach((function(t){return t.unsubscribe()}));var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(t){var e=this;void 0===t&&(t=this.variables);var r=this.observableQuery;if(!r||"no-cache"!==r.options.fetchPolicy){var n=x(x({},this.getDiffOptions(t)),{watcher:this,callback:function(t){return e.setDiff(t)}});this.lastWatch&&ze(n,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=n))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(t,e){var r=this.lastWrite;return!(r&&r.dmCount===On.get(this.cache)&&ze(e,r.variables)&&ze(t.data,r.result.data))},t.prototype.markResult=function(t,e,r,n){var i=this,o=new ae,s=re(t.errors)?t.errors.slice(0):[];if(this.reset(),"incremental"in t&&re(t.incremental)){var a=le(this.getDiff().result,t);t.data=a}else if("hasNext"in t&&t.hasNext){var u=this.getDiff();t.data=o.merge(u.result,t.data)}this.graphQLErrors=s,"no-cache"===r.fetchPolicy?this.updateLastDiff({result:t.data,complete:!0},this.getDiffOptions(r.variables)):0!==n&&(Tn(t,r.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(t,r.variables))o.writeQuery({query:e,data:t.data,variables:r.variables,overwrite:1===n}),i.lastWrite={result:t,variables:r.variables,dmCount:On.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(t.data=i.lastDiff.diff.result);var s=i.getDiffOptions(r.variables),a=o.diff(s);i.stopped||i.updateWatch(r.variables),i.updateLastDiff(a,s),a.complete&&(t.data=a.result)})):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Er.ready},t.prototype.markError=function(t){return this.networkStatus=Er.error,this.lastWrite=void 0,this.reset(),t.graphQLErrors&&(this.graphQLErrors=t.graphQLErrors),t.networkError&&(this.networkError=t.networkError),t},t}();function Tn(t,e){void 0===e&&(e="none");var r="ignore"===e||"all"===e,n=!sr(t);return!n&&r&&t.data&&(n=!0),n}var Nn=Object.prototype.hasOwnProperty,xn=function(){function t(t){var e=t.cache,r=t.link,n=t.defaultOptions,i=t.queryDeduplication,o=void 0!==i&&i,s=t.onBroadcast,a=t.ssrMode,u=void 0!==a&&a,c=t.clientAwareness,l=void 0===c?{}:c,h=t.localState,f=t.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Gt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=e,this.link=r,this.defaultOptions=n||Object.create(null),this.queryDeduplication=o,this.clientAwareness=l,this.localState=h||new An({cache:e}),this.ssrMode=u,this.assumeImmutableResults=!!f,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var t=this;this.queries.forEach((function(e,r){t.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(__DEV__?new a("QueryManager stopped while query was in flight"):new a(14))},t.prototype.cancelPendingFetches=function(t){this.fetchCancelFns.forEach((function(e){return e(t)})),this.fetchCancelFns.clear()},t.prototype.mutate=function(t){var e,r,n=t.mutation,i=t.variables,o=t.optimisticResponse,s=t.updateQueries,a=t.refetchQueries,c=void 0===a?[]:a,l=t.awaitRefetchQueries,h=void 0!==l&&l,f=t.update,d=t.onQueryUpdated,p=t.fetchPolicy,m=void 0===p?(null===(e=this.defaultOptions.mutate)||void 0===e?void 0:e.fetchPolicy)||"network-only":p,g=t.errorPolicy,v=void 0===g?(null===(r=this.defaultOptions.mutate)||void 0===r?void 0:r.errorPolicy)||"none":g,y=t.keepRootFields,b=t.context;return P(this,void 0,void 0,(function(){var t,e,r,a,l,p;return R(this,(function(g){switch(g.label){case 0:return __DEV__?u(n,"mutation option is required. You must specify your GraphQL document in the mutation option."):u(n,15),__DEV__?u("network-only"===m||"no-cache"===m,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):u("network-only"===m||"no-cache"===m,16),t=this.generateMutationId(),e=this.transform(n),r=e.document,a=e.hasClientExports,n=this.cache.transformForLink(r),i=this.getVariables(n,i),a?[4,this.localState.addExportedVariables(n,i,b)]:[3,2];case 1:i=g.sent(),g.label=2;case 2:return l=this.mutationStore&&(this.mutationStore[t]={mutation:n,variables:i,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:t,document:n,variables:i,fetchPolicy:m,errorPolicy:v,context:b,updateQueries:s,update:f,keepRootFields:y}),this.broadcastQueries(),p=this,[2,new Promise((function(e,r){return or(p.getObservableFromLink(n,x(x({},b),{optimisticResponse:o}),i,!1),(function(e){if(sr(e)&&"none"===v)throw new te({graphQLErrors:ar(e)});l&&(l.loading=!1,l.error=null);var r=x({},e);return"function"==typeof c&&(c=c(r)),"ignore"===v&&sr(r)&&delete r.errors,p.markMutationResult({mutationId:t,result:r,document:n,variables:i,fetchPolicy:m,errorPolicy:v,context:b,update:f,updateQueries:s,awaitRefetchQueries:h,refetchQueries:c,removeOptimistic:o?t:void 0,onQueryUpdated:d,keepRootFields:y})})).subscribe({next:function(t){p.broadcastQueries(),"hasNext"in t&&!1!==t.hasNext||e(t)},error:function(e){l&&(l.loading=!1,l.error=e),o&&p.cache.removeOptimistic(t),p.broadcastQueries(),r(e instanceof te?e:new te({networkError:e}))}})}))]}}))}))},t.prototype.markMutationResult=function(t,e){var r=this;void 0===e&&(e=this.cache);var n=t.result,i=[],o="no-cache"===t.fetchPolicy;if(!o&&Tn(n,t.errorPolicy)){if(ue(n)||i.push({result:n.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),ue(n)&&re(n.incremental)){var s=e.diff({id:"ROOT_MUTATION",query:this.transform(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),a=void 0;s.result&&(a=le(s.result,n)),void 0!==a&&(n.data=a,i.push({result:a,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var u=t.updateQueries;u&&this.queries.forEach((function(t,o){var s=t.observableQuery,a=s&&s.queryName;if(a&&Nn.call(u,a)){var c=u[a],l=r.queries.get(o),h=l.document,f=l.variables,d=e.diff({query:h,variables:f,returnPartialData:!0,optimistic:!1}),p=d.result;if(d.complete&&p){var m=c(p,{mutationResult:n,queryName:h&&wt(h)||void 0,queryVariables:f});m&&i.push({result:m,dataId:"ROOT_QUERY",query:h,variables:f})}}}))}if(i.length>0||t.refetchQueries||t.update||t.onQueryUpdated||t.removeOptimistic){var c=[];if(this.refetchQueries({updateCache:function(e){o||i.forEach((function(t){return e.write(t)}));var s,a=t.update,u=!(ue(s=n)||function(t){return"hasNext"in t&&"data"in t}(s))||ue(n)&&!n.hasNext;if(a){if(!o){var c=e.diff({id:"ROOT_MUTATION",query:r.transform(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});c.complete&&("incremental"in(n=x(x({},n),{data:c.result}))&&delete n.incremental,"hasNext"in n&&delete n.hasNext)}u&&a(e,n,{context:t.context,variables:t.variables})}o||t.keepRootFields||!u||e.modify({id:"ROOT_MUTATION",fields:function(t,e){var r=e.fieldName,n=e.DELETE;return"__typename"===r?t:n}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach((function(t){return c.push(t)})),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(c).then((function(){return n}))}return Promise.resolve(n)},t.prototype.markMutationOptimistic=function(t,e){var r=this,n="function"==typeof t?t(e.variables):t;return this.cache.recordOptimisticTransaction((function(t){try{r.markMutationResult(x(x({},e),{result:{data:n}}),t)}catch(t){__DEV__&&u.error(t)}}),e.mutationId)},t.prototype.fetchQuery=function(t,e,r){return this.fetchQueryObservable(t,e,r).promise},t.prototype.getQueryStore=function(){var t=Object.create(null);return this.queries.forEach((function(e,r){t[r]={variables:e.variables,networkStatus:e.networkStatus,networkError:e.networkError,graphQLErrors:e.graphQLErrors}})),t},t.prototype.resetErrors=function(t){var e=this.queries.get(t);e&&(e.networkError=void 0,e.graphQLErrors=[])},t.prototype.transform=function(t){var e=this.transformCache;if(!e.has(t)){var r=this.cache.transformDocument(t),n=dr([mr],yt(r)),i=this.localState.clientQuery(r),o=n&&this.localState.serverQuery(n),s={document:r,hasClientExports:qt(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:i,serverQuery:o,defaultVars:Ot(bt(r)),asQuery:x(x({},r),{definitions:r.definitions.map((function(t){return"OperationDefinition"===t.kind&&"query"!==t.operation?x(x({},t),{operation:"query"}):t}))})},a=function(t){t&&!e.has(t)&&e.set(t,s)};a(t),a(r),a(i),a(o)}return e.get(t)},t.prototype.getVariables=function(t,e){return x(x({},this.transform(t).defaultVars),e)},t.prototype.watchQuery=function(t){void 0===(t=x(x({},t),{variables:this.getVariables(t.query,t.variables)})).notifyOnNetworkStatusChange&&(t.notifyOnNetworkStatusChange=!1);var e=new Mn(this),r=new xr({queryManager:this,queryInfo:e,options:t});return this.queries.set(r.queryId,e),e.init({document:r.query,observableQuery:r,variables:r.variables}),r},t.prototype.query=function(t,e){var r=this;return void 0===e&&(e=this.generateQueryId()),__DEV__?u(t.query,"query option is required. You must specify your GraphQL document in the query option."):u(t.query,17),__DEV__?u("Document"===t.query.kind,'You must wrap the query string in a "gql" tag.'):u("Document"===t.query.kind,18),__DEV__?u(!t.returnPartialData,"returnPartialData option only supported on watchQuery."):u(!t.returnPartialData,19),__DEV__?u(!t.pollInterval,"pollInterval option only supported on watchQuery."):u(!t.pollInterval,20),this.fetchQuery(e,t).finally((function(){return r.stopQuery(e)}))},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(t){var e=this.queries.get(t);e&&e.stop()},t.prototype.clearStore=function(t){return void 0===t&&(t={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new a("Store reset while query was in flight (not completed in link chain)"):new a(21)),this.queries.forEach((function(t){t.observableQuery?t.networkStatus=Er.loading:t.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(t)},t.prototype.getObservableQueries=function(t){var e=this;void 0===t&&(t="active");var r=new Map,n=new Map,i=new Set;return Array.isArray(t)&&t.forEach((function(t){var r;"string"==typeof t?n.set(t,!1):nt(r=t)&&"Document"===r.kind&&Array.isArray(r.definitions)?n.set(e.transform(t).document,!1):nt(t)&&t.query&&i.add(t)})),this.queries.forEach((function(e,i){var o=e.observableQuery,s=e.document;if(o){if("all"===t)return void r.set(i,o);var a=o.queryName;if("standby"===o.options.fetchPolicy||"active"===t&&!o.hasObservers())return;("active"===t||a&&n.has(a)||s&&n.has(s))&&(r.set(i,o),a&&n.set(a,!0),s&&n.set(s,!0))}})),i.size&&i.forEach((function(t){var n=yr("legacyOneTimeQuery"),i=e.getQuery(n).init({document:t.query,variables:t.variables}),o=new xr({queryManager:e,queryInfo:i,options:x(x({},t),{fetchPolicy:"network-only"})});u(o.queryId===n),i.setObservableQuery(o),r.set(n,o)})),__DEV__&&n.size&&n.forEach((function(t,e){t||__DEV__&&u.warn("Unknown query ".concat("string"==typeof e?"named ":"").concat(JSON.stringify(e,null,2)," requested in refetchQueries options.include array"))})),r},t.prototype.reFetchObservableQueries=function(t){var e=this;void 0===t&&(t=!1);var r=[];return this.getObservableQueries(t?"all":"active").forEach((function(n,i){var o=n.options.fetchPolicy;n.resetLastResults(),(t||"standby"!==o&&"cache-only"!==o)&&r.push(n.refetch()),e.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(r)},t.prototype.setObservableQuery=function(t){this.getQuery(t.queryId).setObservableQuery(t)},t.prototype.startGraphQLSubscription=function(t){var e=this,r=t.query,n=t.fetchPolicy,i=t.errorPolicy,o=t.variables,s=t.context,a=void 0===s?{}:s;r=this.transform(r).document,o=this.getVariables(r,o);var u=function(t){return e.getObservableFromLink(r,a,t).map((function(o){"no-cache"!==n&&(Tn(o,i)&&e.cache.write({query:r,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:t}),e.broadcastQueries());var s=sr(o),a=function(t){return!!t.extensions&&Array.isArray(t.extensions[Zt])}(o);if(s||a){var u={};throw s&&(u.graphQLErrors=o.errors),a&&(u.protocolErrors=o.extensions[Zt]),new te(u)}return o}))};if(this.transform(r).hasClientExports){var c=this.localState.addExportedVariables(r,o,a).then(u);return new rt((function(t){var e=null;return c.then((function(r){return e=r.subscribe(t)}),t.error),function(){return e&&e.unsubscribe()}}))}return u(o)},t.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},t.prototype.removeQuery=function(t){this.fetchCancelFns.delete(t),this.queries.has(t)&&(this.getQuery(t).stop(),this.queries.delete(t))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(t){return t.notify()}))},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(t,e,r,n){var i,o,s=this;void 0===n&&(n=null!==(i=null==e?void 0:e.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var a=this.transform(t).serverQuery;if(a){var u=this.inFlightLinkObservables,c=this.link,l={query:a,variables:r,operationName:wt(a)||void 0,context:this.prepareContext(x(x({},e),{forceFetch:!n}))};if(e=l.context,n){var h=u.get(a)||new Map;u.set(a,h);var f=nr(r);if(!(o=h.get(f))){var d=new Ar([xt(c,l)]);h.set(f,o=d),d.beforeNext((function(){h.delete(f)&&h.size<1&&u.delete(a)}))}}else o=new Ar([xt(c,l)])}else o=new Ar([rt.of({data:{}})]),e=this.prepareContext(e);var p=this.transform(t).clientQuery;return p&&(o=or(o,(function(t){return s.localState.runResolvers({document:p,remoteResult:t,context:e,variables:r})}))),o},t.prototype.getResultsFromLink=function(t,e,r){var n=t.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(this.transform(t.document).document);return or(this.getObservableFromLink(i,r.context,r.variables),(function(o){var s=ar(o),a=s.length>0;if(n>=t.lastRequestId){if(a&&"none"===r.errorPolicy)throw t.markError(new te({graphQLErrors:s}));t.markResult(o,i,r,e),t.markReady()}var u={data:o.data,loading:!1,networkStatus:Er.ready};return a&&"ignore"!==r.errorPolicy&&(u.errors=s,u.networkStatus=Er.error),u}),(function(e){var r=$t(e)?e:new te({networkError:e});throw n>=t.lastRequestId&&t.markError(r),r}))},t.prototype.fetchQueryObservable=function(t,e,r){return this.fetchConcastWithInfo(t,e,r).concast},t.prototype.fetchConcastWithInfo=function(t,e,r){var n=this;void 0===r&&(r=Er.loading);var i,o,s=this.transform(e.query).document,a=this.getVariables(s,e.variables),u=this.getQuery(t),c=this.defaultOptions.watchQuery,l=e.fetchPolicy,h=void 0===l?c&&c.fetchPolicy||"cache-first":l,f=e.errorPolicy,d=void 0===f?c&&c.errorPolicy||"none":f,p=e.returnPartialData,m=void 0!==p&&p,g=e.notifyOnNetworkStatusChange,v=void 0!==g&&g,y=e.context,b=void 0===y?{}:y,w=Object.assign({},e,{query:s,variables:a,fetchPolicy:h,errorPolicy:d,returnPartialData:m,notifyOnNetworkStatusChange:v,context:b}),_=function(t){w.variables=t;var i=n.fetchQueryByPolicy(u,w,r);return"standby"!==w.fetchPolicy&&i.sources.length>0&&u.observableQuery&&u.observableQuery.applyNextFetchPolicy("after-fetch",e),i},E=function(){return n.fetchCancelFns.delete(t)};if(this.fetchCancelFns.set(t,(function(t){E(),setTimeout((function(){return i.cancel(t)}))})),this.transform(w.query).hasClientExports)i=new Ar(this.localState.addExportedVariables(w.query,w.variables,w.context).then(_).then((function(t){return t.sources}))),o=!0;else{var A=_(w.variables);o=A.fromLink,i=new Ar(A.sources)}return i.promise.then(E,E),{concast:i,fromLink:o}},t.prototype.refetchQueries=function(t){var e=this,r=t.updateCache,n=t.include,i=t.optimistic,o=void 0!==i&&i,s=t.removeOptimistic,a=void 0===s?o?yr("refetchQueries"):void 0:s,u=t.onQueryUpdated,c=new Map;n&&this.getObservableQueries(n).forEach((function(t,r){c.set(r,{oq:t,lastDiff:e.getQuery(r).getDiff()})}));var l=new Map;return r&&this.cache.batch({update:r,optimistic:o&&a||!1,removeOptimistic:a,onWatchUpdated:function(t,e,r){var n=t.watcher instanceof Mn&&t.watcher.observableQuery;if(n){if(u){c.delete(n.queryId);var i=u(n,e,r);return!0===i&&(i=n.refetch()),!1!==i&&l.set(n,i),i}null!==u&&c.set(n.queryId,{oq:n,lastDiff:r,diff:e})}}}),c.size&&c.forEach((function(t,r){var n,i=t.oq,o=t.lastDiff,s=t.diff;if(u){if(!s){var a=i.queryInfo;a.reset(),s=a.getDiff()}n=u(i,s,o)}u&&!0!==n||(n=i.refetch()),!1!==n&&l.set(i,n),r.indexOf("legacyOneTimeQuery")>=0&&e.stopQueryNoBroadcast(r)})),a&&this.cache.removeOptimistic(a),l},t.prototype.fetchQueryByPolicy=function(t,e,r){var n=this,i=e.query,o=e.variables,s=e.fetchPolicy,a=e.refetchWritePolicy,u=e.errorPolicy,c=e.returnPartialData,l=e.context,h=e.notifyOnNetworkStatusChange,f=t.networkStatus;t.init({document:this.transform(i).document,variables:o,networkStatus:r});var d=function(){return t.getDiff(o)},p=function(e,r){void 0===r&&(r=t.networkStatus||Er.loading);var s=e.result;!__DEV__||c||ze(s,{})||Rr(e.missing);var a=function(t){return rt.of(x({data:t,loading:Or(r),networkStatus:r},e.complete?null:{partial:!0}))};return s&&n.transform(i).hasForcedResolvers?n.localState.runResolvers({document:i,remoteResult:{data:s},context:l,variables:o,onlyRunForcedResolvers:!0}).then((function(t){return a(t.data||void 0)})):"none"===u&&r===Er.refetch&&Array.isArray(e.missing)?a(void 0):a(s)},m="no-cache"===s?0:r===Er.refetch&&"merge"!==a?1:2,g=function(){return n.getResultsFromLink(t,m,{variables:o,context:l,fetchPolicy:s,errorPolicy:u})},v=h&&"number"==typeof f&&f!==r&&Or(r);switch(s){default:case"cache-first":return(y=d()).complete?{fromLink:!1,sources:[p(y,t.markReady())]}:c||v?{fromLink:!0,sources:[p(y),g()]}:{fromLink:!0,sources:[g()]};case"cache-and-network":var y;return(y=d()).complete||c||v?{fromLink:!0,sources:[p(y),g()]}:{fromLink:!0,sources:[g()]};case"cache-only":return{fromLink:!1,sources:[p(d(),t.markReady())]};case"network-only":return v?{fromLink:!0,sources:[p(d()),g()]}:{fromLink:!0,sources:[g()]};case"no-cache":return v?{fromLink:!0,sources:[p(t.getDiff()),g()]}:{fromLink:!0,sources:[g()]};case"standby":return{fromLink:!1,sources:[]}}},t.prototype.getQuery=function(t){return t&&!this.queries.has(t)&&this.queries.set(t,new Mn(this,t)),this.queries.get(t)},t.prototype.prepareContext=function(t){void 0===t&&(t={});var e=this.localState.prepareContext(t);return x(x({},e),{clientAwareness:this.clientAwareness})},t}();function In(t,e){return Mr(t,e,e.variables&&{variables:x(x({},t&&t.variables),e.variables)})}var Pn,Rn=!1,jn=function(){function t(t){var e=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=t.uri,n=t.credentials,i=t.headers,o=t.cache,s=t.ssrMode,c=void 0!==s&&s,l=t.ssrForceFetchDelay,h=void 0===l?0:l,f=t.connectToDevTools,d=void 0===f?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:f,p=t.queryDeduplication,m=void 0===p||p,g=t.defaultOptions,v=t.assumeImmutableResults,y=void 0!==v&&v,b=t.resolvers,w=t.typeDefs,_=t.fragmentMatcher,E=t.name,A=t.version,O=t.link;if(O||(O=r?new Fe({uri:r,credentials:n,headers:i}):Nt.empty()),!o)throw __DEV__?new a("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new a(9);if(this.link=O,this.cache=o,this.disableNetworkFetches=c||h>0,this.queryDeduplication=m,this.defaultOptions=g||Object.create(null),this.typeDefs=w,h&&setTimeout((function(){return e.disableNetworkFetches=!1}),h),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),d&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!Rn&&d&&__DEV__&&(Rn=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var k=window.navigator,S=k&&k.userAgent,M=void 0;"string"==typeof S&&(S.indexOf("Chrome/")>-1?M="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":S.indexOf("Firefox/")>-1&&(M="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),M&&__DEV__&&u.log("Download the Apollo DevTools for a better development experience: "+M)}this.version="3.7.16",this.localState=new An({cache:o,client:this,resolvers:b,fragmentMatcher:_}),this.queryManager=new xn({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:m,ssrMode:c,clientAwareness:{name:E,version:A},localState:this.localState,assumeImmutableResults:y,onBroadcast:d?function(){e.devToolsHookCb&&e.devToolsHookCb({action:{},state:{queries:e.queryManager.getQueryStore(),mutations:e.queryManager.mutationStore||{}},dataWithOptimisticResults:e.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=In(this.defaultOptions.watchQuery,t)),!this.disableNetworkFetches||"network-only"!==t.fetchPolicy&&"cache-and-network"!==t.fetchPolicy||(t=x(x({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},t.prototype.query=function(t){return this.defaultOptions.query&&(t=In(this.defaultOptions.query,t)),__DEV__?u("cache-and-network"!==t.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):u("cache-and-network"!==t.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===t.fetchPolicy&&(t=x(x({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},t.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=In(this.defaultOptions.mutate,t)),this.queryManager.mutate(t)},t.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},t.prototype.readQuery=function(t,e){return void 0===e&&(e=!1),this.cache.readQuery(t,e)},t.prototype.readFragment=function(t,e){return void 0===e&&(e=!1),this.cache.readFragment(t,e)},t.prototype.writeQuery=function(t){var e=this.cache.writeQuery(t);return!1!==t.broadcast&&this.queryManager.broadcastQueries(),e},t.prototype.writeFragment=function(t){var e=this.cache.writeFragment(t);return!1!==t.broadcast&&this.queryManager.broadcastQueries(),e},t.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},t.prototype.__requestRaw=function(t){return xt(this.link,t)},t.prototype.resetStore=function(){var t=this;return Promise.resolve().then((function(){return t.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(t.resetStoreCallbacks.map((function(t){return t()})))})).then((function(){return t.reFetchObservableQueries()}))},t.prototype.clearStore=function(){var t=this;return Promise.resolve().then((function(){return t.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(t.clearStoreCallbacks.map((function(t){return t()})))}))},t.prototype.onResetStore=function(t){var e=this;return this.resetStoreCallbacks.push(t),function(){e.resetStoreCallbacks=e.resetStoreCallbacks.filter((function(e){return e!==t}))}},t.prototype.onClearStore=function(t){var e=this;return this.clearStoreCallbacks.push(t),function(){e.clearStoreCallbacks=e.clearStoreCallbacks.filter((function(e){return e!==t}))}},t.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},t.prototype.refetchQueries=function(t){var e=this.queryManager.refetchQueries(t),r=[],n=[];e.forEach((function(t,e){r.push(e),n.push(t)}));var i=Promise.all(n);return i.queries=r,i.results=n,i.catch((function(t){__DEV__&&u.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(t))})),i},t.prototype.getObservableQueries=function(t){return void 0===t&&(t="active"),this.queryManager.getObservableQueries(t)},t.prototype.extract=function(t){return this.cache.extract(t)},t.prototype.restore=function(t){return this.cache.restore(t)},t.prototype.addResolvers=function(t){this.localState.addResolvers(t)},t.prototype.setResolvers=function(t){this.localState.setResolvers(t)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},t.prototype.setLink=function(t){this.link=this.queryManager.link=t},t}();Pn||(Pn={});var Cn=function(){function t(){this.getFragmentDoc=gn(it)}return t.prototype.batch=function(t){var e,r=this,n="string"==typeof t.optimistic?t.optimistic:!1===t.optimistic?null:void 0;return this.performTransaction((function(){return e=t.update(r)}),n),e},t.prototype.recordOptimisticTransaction=function(t,e){this.performTransaction(t,e)},t.prototype.transformDocument=function(t){return t},t.prototype.transformForLink=function(t){return t},t.prototype.identify=function(t){},t.prototype.gc=function(){return[]},t.prototype.modify=function(t){return!1},t.prototype.readQuery=function(t,e){return void 0===e&&(e=!!t.optimistic),this.read(x(x({},t),{rootId:t.id||"ROOT_QUERY",optimistic:e}))},t.prototype.readFragment=function(t,e){return void 0===e&&(e=!!t.optimistic),this.read(x(x({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:e}))},t.prototype.writeQuery=function(t){var e=t.id,r=t.data,n=I(t,["id","data"]);return this.write(Object.assign(n,{dataId:e||"ROOT_QUERY",result:r}))},t.prototype.writeFragment=function(t){var e=t.id,r=t.data,n=t.fragment,i=t.fragmentName,o=I(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(n,i),dataId:e,result:r}))},t.prototype.updateQuery=function(t,e){return this.batch({update:function(r){var n=r.readQuery(t),i=e(n);return null==i?n:(r.writeQuery(x(x({},t),{data:i})),i)}})},t.prototype.updateFragment=function(t,e){return this.batch({update:function(r){var n=r.readFragment(t),i=e(n);return null==i?n:(r.writeFragment(x(x({},t),{data:i})),i)}})},t}(),Dn=function(t){function e(r,n,i,o){var s,a=t.call(this,r)||this;if(a.message=r,a.path=n,a.query=i,a.variables=o,Array.isArray(a.path)){a.missing=a.message;for(var u=a.path.length-1;u>=0;--u)a.missing=((s={})[a.path[u]]=a.missing,s)}else a.missing=a.path;return a.__proto__=e.prototype,a}return N(e,t),e}(Error);function Bn(t){var e=new Set([t]);return e.forEach((function(t){nt(t)&&function(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(t){if(t instanceof TypeError)return null;throw t}return t}(t)===t&&Object.getOwnPropertyNames(t).forEach((function(r){nt(t[r])&&e.add(t[r])}))})),t}function Fn(t){return __DEV__&&Bn(t),t}var Ln=Object.prototype.hasOwnProperty;function Un(t){return null==t}function qn(t,e){var r=t.__typename,n=t.id,i=t._id;if("string"==typeof r&&(e&&(e.keyObject=Un(n)?Un(i)?void 0:{_id:i}:{id:n}),Un(n)&&!Un(i)&&(n=i),!Un(n)))return"".concat(r,":").concat("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))}var Vn={dataIdFromObject:qn,addTypename:!0,resultCaching:!0,canonizeResults:!1};function zn(t){var e=t.canonizeResults;return void 0===e?Vn.canonizeResults:e}var Gn=/^[_a-z][_0-9a-z]*/i;function Kn(t){var e=t.match(Gn);return e?e[0]:t}function Qn(t,e,r){return!!nt(e)&&(ee(e)?e.every((function(e){return Qn(t,e,r)})):t.selections.every((function(t){if(vt(t)&&Lt(t,r)){var n=mt(t);return Ln.call(e,n)&&(!t.selectionSet||Qn(t.selectionSet,e[n],r))}return!0})))}function Hn(t){return nt(t)&&!ut(t)&&!ee(t)}function Wn(t,e){var r=ot(_t(t));return{fragmentMap:r,lookupFragment:function(t){var n=r[t];return!n&&e&&(n=e.lookup(t)),n||null}}}var Jn,Yn,Xn=Object.create(null),Zn=function(){return Xn},$n=Object.create(null),ti=function(){function t(t,e){var r=this;this.policies=t,this.group=e,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(t,e){return Fn(ut(t)?r.get(t.__ref,e):t&&t[e])},this.canRead=function(t){return ut(t)?r.has(t.__ref):"object"==typeof t},this.toReference=function(t,e){if("string"==typeof t)return at(t);if(ut(t))return t;var n=r.policies.identify(t)[0];if(n){var i=at(n);return e&&r.merge(n,t),i}}}return t.prototype.toObject=function(){return x({},this.data)},t.prototype.has=function(t){return void 0!==this.lookup(t,!0)},t.prototype.get=function(t,e){if(this.group.depend(t,e),Ln.call(this.data,t)){var r=this.data[t];if(r&&Ln.call(r,e))return r[e]}return"__typename"===e&&Ln.call(this.policies.rootTypenamesById,t)?this.policies.rootTypenamesById[t]:this instanceof ii?this.parent.get(t,e):void 0},t.prototype.lookup=function(t,e){return e&&this.group.depend(t,"__exists"),Ln.call(this.data,t)?this.data[t]:this instanceof ii?this.parent.lookup(t,e):this.policies.rootTypenamesById[t]?Object.create(null):void 0},t.prototype.merge=function(t,e){var r,n=this;ut(t)&&(t=t.__ref),ut(e)&&(e=e.__ref);var i="string"==typeof t?this.lookup(r=t):t,o="string"==typeof e?this.lookup(r=e):e;if(o){__DEV__?u("string"==typeof r,"store.merge expects a string ID"):u("string"==typeof r,1);var s=new ae(si).merge(i,o);if(this.data[r]=s,s!==i&&(delete this.refs[r],this.group.caching)){var a=Object.create(null);i||(a.__exists=1),Object.keys(o).forEach((function(t){if(!i||i[t]!==s[t]){a[t]=1;var e=Kn(t);e===t||n.policies.hasKeyArgs(s.__typename,e)||(a[e]=1),void 0!==s[t]||n instanceof ii||delete s[t]}})),!a.__typename||i&&i.__typename||this.policies.rootTypenamesById[r]!==s.__typename||delete a.__typename,Object.keys(a).forEach((function(t){return n.group.dirty(r,t)}))}}},t.prototype.modify=function(t,e){var r=this,n=this.lookup(t);if(n){var i=Object.create(null),o=!1,s=!0,a={DELETE:Xn,INVALIDATE:$n,isReference:ut,toReference:this.toReference,canRead:this.canRead,readField:function(e,n){return r.policies.readField("string"==typeof e?{fieldName:e,from:n||at(t)}:e,{store:r})}};if(Object.keys(n).forEach((function(u){var c=Kn(u),l=n[u];if(void 0!==l){var h="function"==typeof e?e:e[u]||e[c];if(h){var f=h===Zn?Xn:h(Fn(l),x(x({},a),{fieldName:c,storeFieldName:u,storage:r.getStorage(t,u)}));f===$n?r.group.dirty(t,u):(f===Xn&&(f=void 0),f!==l&&(i[u]=f,o=!0,l=f))}void 0!==l&&(s=!1)}})),o)return this.merge(t,i),s&&(this instanceof ii?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},t.prototype.delete=function(t,e,r){var n,i=this.lookup(t);if(i){var o=this.getFieldValue(i,"__typename"),s=e&&r?this.policies.getStoreFieldName({typename:o,fieldName:e,args:r}):e;return this.modify(t,s?((n={})[s]=Zn,n):Zn)}return!1},t.prototype.evict=function(t,e){var r=!1;return t.id&&(Ln.call(this.data,t.id)&&(r=this.delete(t.id,t.fieldName,t.args)),this instanceof ii&&this!==e&&(r=this.parent.evict(t,e)||r),(t.fieldName||r)&&this.group.dirty(t.id,t.fieldName||"__exists")),r},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var t=this,e=this.toObject(),r=[];return this.getRootIdSet().forEach((function(e){Ln.call(t.policies.rootTypenamesById,e)||r.push(e)})),r.length&&(e.__META={extraRootIds:r.sort()}),e},t.prototype.replace=function(t){var e=this;if(Object.keys(this.data).forEach((function(r){t&&Ln.call(t,r)||e.delete(r)})),t){var r=t.__META,n=I(t,["__META"]);Object.keys(n).forEach((function(t){e.merge(t,n[t])})),r&&r.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(t){return this.rootIds[t]=(this.rootIds[t]||0)+1},t.prototype.release=function(t){if(this.rootIds[t]>0){var e=--this.rootIds[t];return e||delete this.rootIds[t],e}return 0},t.prototype.getRootIdSet=function(t){return void 0===t&&(t=new Set),Object.keys(this.rootIds).forEach(t.add,t),this instanceof ii?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t},t.prototype.gc=function(){var t=this,e=this.getRootIdSet(),r=this.toObject();e.forEach((function(n){Ln.call(r,n)&&(Object.keys(t.findChildRefIds(n)).forEach(e.add,e),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof ii;)i=i.parent;n.forEach((function(t){return i.delete(t)}))}return n},t.prototype.findChildRefIds=function(t){if(!Ln.call(this.refs,t)){var e=this.refs[t]=Object.create(null),r=this.data[t];if(!r)return e;var n=new Set([r]);n.forEach((function(t){ut(t)&&(e[t.__ref]=!0),nt(t)&&Object.keys(t).forEach((function(e){var r=t[e];nt(r)&&n.add(r)}))}))}return this.refs[t]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),ei=function(){function t(t,e){void 0===e&&(e=null),this.caching=t,this.parent=e,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?dn():null,this.keyMaker=new Ze(Gt)},t.prototype.depend=function(t,e){if(this.d){this.d(ri(t,e));var r=Kn(e);r!==e&&this.d(ri(t,r)),this.parent&&this.parent.depend(t,e)}},t.prototype.dirty=function(t,e){this.d&&this.d.dirty(ri(t,e),"__exists"===e?"forget":"setDirty")},t}();function ri(t,e){return e+"#"+t}function ni(t,e){ai(t)&&t.group.depend(e,"__exists")}Jn=ti||(ti={}),Yn=function(t){function e(e){var r=e.policies,n=e.resultCaching,i=void 0===n||n,o=e.seed,s=t.call(this,r,new ei(i))||this;return s.stump=new oi(s),s.storageTrie=new Ze(Gt),o&&s.replace(o),s}return N(e,t),e.prototype.addLayer=function(t,e){return this.stump.addLayer(t,e)},e.prototype.removeLayer=function(){return this},e.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},e}(Jn),Jn.Root=Yn;var ii=function(t){function e(e,r,n,i){var o=t.call(this,r.policies,i)||this;return o.id=e,o.parent=r,o.replay=n,o.group=i,n(o),o}return N(e,t),e.prototype.addLayer=function(t,r){return new e(t,this,r,this.group)},e.prototype.removeLayer=function(t){var e=this,r=this.parent.removeLayer(t);return t===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(t){var n=e.data[t],i=r.lookup(t);i?n?n!==i&&Object.keys(n).forEach((function(r){ze(n[r],i[r])||e.group.dirty(t,r)})):(e.group.dirty(t,"__exists"),Object.keys(i).forEach((function(r){e.group.dirty(t,r)}))):e.delete(t)})),r):r===this.parent?this:r.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return x(x({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(e){var r=this.parent.findChildRefIds(e);return Ln.call(this.data,e)?x(x({},r),t.prototype.findChildRefIds.call(this,e)):r},e.prototype.getStorage=function(){for(var t=this.parent;t.parent;)t=t.parent;return t.getStorage.apply(t,arguments)},e}(ti),oi=function(t){function e(e){return t.call(this,"EntityStore.Stump",e,(function(){}),new ei(e.group.caching,e.group))||this}return N(e,t),e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(ii);function si(t,e,r){var n=t[r],i=e[r];return ze(n,i)?n:i}function ai(t){return!!(t instanceof ti&&t.group.caching)}function ui(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var ci=function(){function t(t){var e=this;this.knownResults=new(Gt?WeakMap:Map),this.config=Mr(t,{addTypename:!1!==t.addTypename,canonizeResults:zn(t)}),this.canon=t.canon||new rr,this.executeSelectionSet=gn((function(t){var r,n=t.context.canonizeResults,i=ui(t);i[3]=!n;var o=(r=e.executeSelectionSet).peek.apply(r,i);return o?n?x(x({},o),{result:e.canon.admit(o.result)}):o:(ni(t.context.store,t.enclosingRef.__ref),e.execSelectionSetImpl(t))}),{max:this.config.resultCacheMaxSize,keyArgs:ui,makeCacheKey:function(t,e,r,n){if(ai(r.store))return r.store.makeCacheKey(t,ut(e)?e.__ref:e,r.varString,n)}}),this.executeSubSelectedArray=gn((function(t){return ni(t.context.store,t.enclosingRef.__ref),e.execSubSelectedArrayImpl(t)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(t){var e=t.field,r=t.array,n=t.context;if(ai(n.store))return n.store.makeCacheKey(e,r,n.varString)}})}return t.prototype.resetCanon=function(){this.canon=new rr},t.prototype.diffQueryAgainstStore=function(t){var e=t.store,r=t.query,n=t.rootId,i=void 0===n?"ROOT_QUERY":n,o=t.variables,s=t.returnPartialData,a=void 0===s||s,u=t.canonizeResults,c=void 0===u?this.config.canonizeResults:u,l=this.config.cache.policies;o=x(x({},Ot(Et(r))),o);var h,f=at(i),d=this.executeSelectionSet({selectionSet:At(r).selectionSet,objectOrReference:f,enclosingRef:f,context:x({store:e,query:r,policies:l,variables:o,varString:nr(o),canonizeResults:c},Wn(r,this.config.fragments))});if(d.missing&&(h=[new Dn(li(d.missing),d.missing,r,o)],!a))throw h[0];return{result:d.result,complete:!h,missing:h}},t.prototype.isFresh=function(t,e,r,n){if(ai(n.store)&&this.knownResults.get(t)===r){var i=this.executeSelectionSet.peek(r,e,n,this.canon.isKnown(t));if(i&&t===i.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(t){var e=this,r=t.selectionSet,n=t.objectOrReference,i=t.enclosingRef,o=t.context;if(ut(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(n.__ref," object")};var s,u=o.variables,c=o.policies,l=o.store.getFieldValue(n,"__typename"),h=[],f=new ae;function d(t,e){var r;return t.missing&&(s=f.merge(s,((r={})[e]=t.missing,r))),t.result}this.config.addTypename&&"string"==typeof l&&!c.rootIdsByTypename[l]&&h.push({__typename:l});var p=new Set(r.selections);p.forEach((function(t){var r,m;if(Lt(t,u))if(vt(t)){var g=c.readField({fieldName:t.name.value,field:t,variables:o.variables,from:n},o),v=mt(t);void 0===g?pr.added(t)||(s=f.merge(s,((r={})[v]="Can't find field '".concat(t.name.value,"' on ").concat(ut(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),r))):ee(g)?g=d(e.executeSubSelectedArray({field:t,array:g,enclosingRef:i,context:o}),v):t.selectionSet?null!=g&&(g=d(e.executeSelectionSet({selectionSet:t.selectionSet,objectOrReference:g,enclosingRef:ut(g)?g:i,context:o}),v)):o.canonizeResults&&(g=e.canon.pass(g)),void 0!==g&&h.push(((m={})[v]=g,m))}else{var y=st(t,o.lookupFragment);if(!y&&t.kind===ur.FRAGMENT_SPREAD)throw __DEV__?new a("No fragment named ".concat(t.name.value)):new a(5);y&&c.fragmentMatches(y,l)&&y.selectionSet.selections.forEach(p.add,p)}}));var m={result:oe(h),missing:s},g=o.canonizeResults?this.canon.admit(m):Fn(m);return g.result&&this.knownResults.set(g.result,r),g},t.prototype.execSubSelectedArrayImpl=function(t){var e,r=this,n=t.field,i=t.array,o=t.enclosingRef,s=t.context,a=new ae;function c(t,r){var n;return t.missing&&(e=a.merge(e,((n={})[r]=t.missing,n))),t.result}return n.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map((function(t,e){return null===t?null:ee(t)?c(r.executeSubSelectedArray({field:n,array:t,enclosingRef:o,context:s}),e):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:t,enclosingRef:ut(t)?t:o,context:s}),e):(__DEV__&&function(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach((function(r){nt(r)&&(__DEV__?u(!ut(r),"Missing selection set for object of type ".concat(function(t,e){return ut(e)?t.get(e.__ref,"__typename"):e&&e.__typename}(t,r)," returned for query field ").concat(e.name.value)):u(!ut(r),6),Object.values(r).forEach(n.add,n))}))}}(s.store,n,t),t)})),{result:s.canonizeResults?this.canon.admit(i):i,missing:e}},t}();function li(t){try{JSON.stringify(t,(function(t,e){if("string"==typeof e)throw e;return e}))}catch(t){return t}}var hi=Object.create(null);function fi(t){var e=JSON.stringify(t);return hi[e]||(hi[e]=Object.create(null))}function di(t){var e=fi(t);return e.keyFieldsFn||(e.keyFieldsFn=function(e,r){var n=function(t,e){return r.readField(e,t)},i=r.keyObject=mi(t,(function(t){var i=vi(r.storeObject,t,n);return void 0===i&&e!==r.storeObject&&Ln.call(e,t[0])&&(i=vi(e,t,gi)),__DEV__?u(void 0!==i,"Missing field '".concat(t.join("."),"' while extracting keyFields from ").concat(JSON.stringify(e))):u(void 0!==i,2),i}));return"".concat(r.typename,":").concat(JSON.stringify(i))})}function pi(t){var e=fi(t);return e.keyArgsFn||(e.keyArgsFn=function(e,r){var n=r.field,i=r.variables,o=r.fieldName,s=mi(t,(function(t){var r=t[0],o=r.charAt(0);if("@"!==o)if("$"!==o){if(e)return vi(e,t)}else{var s=r.slice(1);if(i&&Ln.call(i,s)){var a=t.slice(0);return a[0]=s,vi(i,a)}}else if(n&&re(n.directives)){var u=r.slice(1),c=n.directives.find((function(t){return t.name.value===u})),l=c&&pt(c,i);return l&&vi(l,t.slice(1))}})),a=JSON.stringify(s);return(e||"{}"!==a)&&(o+=":"+a),o})}function mi(t,e){var r=new ae;return function t(e){var r=fi(e);if(!r.paths){var n=r.paths=[],i=[];e.forEach((function(r,o){ee(r)?(t(r).forEach((function(t){return n.push(i.concat(t))})),i.length=0):(i.push(r),ee(e[o+1])||(n.push(i.slice(0)),i.length=0))}))}return r.paths}(t).reduce((function(t,n){var i,o=e(n);if(void 0!==o){for(var s=n.length-1;s>=0;--s)(i={})[n[s]]=o,o=i;t=r.merge(t,o)}return t}),Object.create(null))}function gi(t,e){return t[e]}function vi(t,e,r){return r=r||gi,yi(e.reduce((function t(e,n){return ee(e)?e.map((function(e){return t(e,n)})):e&&r(e,n)}),t))}function yi(t){return nt(t)?ee(t)?t.map(yi):mi(Object.keys(t).sort(),(function(e){return vi(t,e)})):t}function bi(t){return void 0!==t.args?t.args:t.field?pt(t.field,t.variables):null}ht.setStringify(nr);var wi=function(){},_i=function(t,e){return e.fieldName},Ei=function(t,e,r){return(0,r.mergeObjects)(t,e)},Ai=function(t,e){return e},Oi=function(){function t(t){this.config=t,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=x({dataIdFromObject:qn},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return t.prototype.identify=function(t,e){var r,n=this,i=e&&(e.typename||(null===(r=e.storeObject)||void 0===r?void 0:r.__typename))||t.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o,s=e&&e.storeObject||t,a=x(x({},e),{typename:i,storeObject:s,readField:e&&e.readField||function(){var t=Si(arguments,s);return n.readField(t,{store:n.cache.data,variables:t.variables})}}),u=i&&this.getTypePolicy(i),c=u&&u.keyFn||this.config.dataIdFromObject;c;){var l=c(x(x({},t),s),a);if(!ee(l)){o=l;break}c=di(l)}return o=o?String(o):void 0,a.keyObject?[o,a.keyObject]:[o]},t.prototype.addTypePolicies=function(t){var e=this;Object.keys(t).forEach((function(r){var n=t[r],i=n.queryType,o=n.mutationType,s=n.subscriptionType,a=I(n,["queryType","mutationType","subscriptionType"]);i&&e.setRootTypename("Query",r),o&&e.setRootTypename("Mutation",r),s&&e.setRootTypename("Subscription",r),Ln.call(e.toBeAdded,r)?e.toBeAdded[r].push(a):e.toBeAdded[r]=[a]}))},t.prototype.updateTypePolicy=function(t,e){var r=this,n=this.getTypePolicy(t),i=e.keyFields,o=e.fields;function s(t,e){t.merge="function"==typeof e?e:!0===e?Ei:!1===e?Ai:t.merge}s(n,e.merge),n.keyFn=!1===i?wi:ee(i)?di(i):"function"==typeof i?i:n.keyFn,o&&Object.keys(o).forEach((function(e){var n=r.getFieldPolicy(t,e,!0),i=o[e];if("function"==typeof i)n.read=i;else{var a=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===a?_i:ee(a)?pi(a):"function"==typeof a?a:n.keyFn,"function"==typeof u&&(n.read=u),s(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||_i)}))},t.prototype.setRootTypename=function(t,e){void 0===e&&(e=t);var r="ROOT_"+t.toUpperCase(),n=this.rootTypenamesById[r];e!==n&&(__DEV__?u(!n||n===t,"Cannot change root ".concat(t," __typename more than once")):u(!n||n===t,3),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[e]=r,this.rootTypenamesById[r]=e)},t.prototype.addPossibleTypes=function(t){var e=this;this.usingPossibleTypes=!0,Object.keys(t).forEach((function(r){e.getSupertypeSet(r,!0),t[r].forEach((function(t){e.getSupertypeSet(t,!0).add(r);var n=t.match(Gn);n&&n[0]===t||e.fuzzySubtypes.set(t,new RegExp(t))}))}))},t.prototype.getTypePolicy=function(t){var e=this;if(!Ln.call(this.typePolicies,t)){var r=this.typePolicies[t]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(t);n&&n.size&&n.forEach((function(t){var n=e.getTypePolicy(t),i=n.fields,o=I(n,["fields"]);Object.assign(r,o),Object.assign(r.fields,i)}))}var i=this.toBeAdded[t];return i&&i.length&&i.splice(0).forEach((function(r){e.updateTypePolicy(t,r)})),this.typePolicies[t]},t.prototype.getFieldPolicy=function(t,e,r){if(t){var n=this.getTypePolicy(t).fields;return n[e]||r&&(n[e]=Object.create(null))}},t.prototype.getSupertypeSet=function(t,e){var r=this.supertypeMap.get(t);return!r&&e&&this.supertypeMap.set(t,r=new Set),r},t.prototype.fragmentMatches=function(t,e,r,n){var i=this;if(!t.typeCondition)return!0;if(!e)return!1;var o=t.typeCondition.name.value;if(e===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(e,!0),a=[s],c=function(t){var e=i.getSupertypeSet(t,!1);e&&e.size&&a.indexOf(e)<0&&a.push(e)},l=!(!r||!this.fuzzySubtypes.size),h=!1,f=0;f1?a:e}:(n=x({},s),Ln.call(n,"from")||(n.from=e)),__DEV__&&void 0===n.from&&__DEV__&&u.warn("Undefined 'from' passed to readField with arguments ".concat((i=Array.from(t),o=yr("stringifyForDisplay"),JSON.stringify(i,(function(t,e){return void 0===e?o:e})).split(JSON.stringify(o)).join("")))),void 0===n.variables&&(n.variables=r),n}function Mi(t){return function(e,r){if(ee(e)||ee(r))throw __DEV__?new a("Cannot automatically merge arrays"):new a(4);if(nt(e)&&nt(r)){var n=t.getFieldValue(e,"__typename"),i=t.getFieldValue(r,"__typename");if(n&&i&&n!==i)return r;if(ut(e)&&Hn(r))return t.merge(e.__ref,r),e;if(Hn(e)&&ut(r))return t.merge(e,r.__ref),r;if(Hn(e)&&Hn(r))return x(x({},e),r)}return r}}function Ti(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:x(x({},t),{clientOnly:e,deferred:r})),i}var Ni=function(){function t(t,e,r){this.cache=t,this.reader=e,this.fragments=r}return t.prototype.writeToStore=function(t,e){var r=this,n=e.query,i=e.result,o=e.dataId,s=e.variables,c=e.overwrite,l=bt(n),h=new ae;s=x(x({},Ot(l)),s);var f=x(x({store:t,written:Object.create(null),merge:function(t,e){return h.merge(t,e)},variables:s,varString:nr(s)},Wn(n,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),d=this.processSelectionSet({result:i||Object.create(null),dataId:o,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:f});if(!ut(d))throw __DEV__?new a("Could not identify object ".concat(JSON.stringify(i))):new a(7);return f.incomingById.forEach((function(e,n){var i=e.storeObject,o=e.mergeTree,s=e.fieldNodeSet,a=at(n);if(o&&o.map.size){var c=r.applyMerges(o,a,i,f);if(ut(c))return;i=c}if(__DEV__&&!f.overwrite){var l=Object.create(null);s.forEach((function(t){t.selectionSet&&(l[t.name.value]=!0)}));Object.keys(i).forEach((function(t){(function(t){return!0===l[Kn(t)]})(t)&&!function(t){var e=o&&o.map.get(t);return Boolean(e&&e.info&&e.info.merge)}(t)&&function(t,e,r,n){var i=function(t){var e=n.getFieldValue(t,r);return"object"==typeof e&&e},o=i(t);if(!o)return;var s=i(e);if(!s)return;if(ut(o))return;if(ze(o,s))return;if(Object.keys(o).every((function(t){return void 0!==n.getFieldValue(s,t)})))return;var a=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),c=Kn(r),l="".concat(a,".").concat(c);if(ji.has(l))return;ji.add(l);var h=[];ee(o)||ee(s)||[o,s].forEach((function(t){var e=n.getFieldValue(t,"__typename");"string"!=typeof e||h.includes(e)||h.push(e)}));__DEV__&&u.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(a," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(h.length?"either ensure all objects of type "+h.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(l," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(o).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(s).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}(a,i,t,f.store)}))}t.merge(n,i)})),t.retain(d.__ref),d},t.prototype.processSelectionSet=function(t){var e=this,r=t.dataId,n=t.result,i=t.selectionSet,o=t.context,s=t.mergeTree,a=this.cache.policies,c=Object.create(null),l=r&&a.rootTypenamesById[r]||gt(n,i,o.fragmentMap)||r&&o.store.get(r,"__typename");"string"==typeof l&&(c.__typename=l);var h=function(){var t=Si(arguments,c,o.variables);if(ut(t.from)){var e=o.incomingById.get(t.from.__ref);if(e){var r=a.readField(x(x({},t),{from:e.storeObject}),o);if(void 0!==r)return r}}return a.readField(t,o)},f=new Set;this.flattenFields(i,n,o,l).forEach((function(t,r){var i,o=mt(r),d=n[o];if(f.add(r),void 0!==d){var p=a.getStoreFieldName({typename:l,fieldName:r.name.value,field:r,variables:t.variables}),m=Ii(s,p),g=e.processFieldValue(d,r,r.selectionSet?Ti(t,!1,!1):t,m),v=void 0;r.selectionSet&&(ut(g)||Hn(g))&&(v=h("__typename",g));var y=a.getMergeFunction(l,r.name.value,v);y?m.info={field:r,typename:l,merge:y}:Ri(s,p),c=t.merge(c,((i={})[p]=g,i))}else!__DEV__||t.clientOnly||t.deferred||pr.added(r)||a.getReadFunction(l,r.name.value)||__DEV__&&u.error("Missing field '".concat(mt(r),"' while writing result ").concat(JSON.stringify(n,null,2)).substring(0,1e3))}));try{var d=a.identify(n,{typename:l,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:c,readField:h}),p=d[0],m=d[1];r=r||p,m&&(c=o.merge(c,m))}catch(t){if(!r)throw t}if("string"==typeof r){var g=at(r),v=o.written[r]||(o.written[r]=[]);if(v.indexOf(i)>=0)return g;if(v.push(i),this.reader&&this.reader.isFresh(n,g,i,o))return g;var y=o.incomingById.get(r);return y?(y.storeObject=o.merge(y.storeObject,c),y.mergeTree=function t(e,r){if(e===r||!r||Pi(r))return e;if(!e||Pi(e))return r;var n=e.info&&r.info?x(x({},e.info),r.info):e.info||r.info,i=e.map.size&&r.map.size,o=i?new Map:e.map.size?e.map:r.map,s={info:n,map:o};if(i){var a=new Set(r.map.keys());e.map.forEach((function(e,n){s.map.set(n,t(e,r.map.get(n))),a.delete(n)})),a.forEach((function(n){s.map.set(n,t(r.map.get(n),e.map.get(n)))}))}return s}(y.mergeTree,s),f.forEach((function(t){return y.fieldNodeSet.add(t)}))):o.incomingById.set(r,{storeObject:c,mergeTree:Pi(s)?void 0:s,fieldNodeSet:f}),g}return c},t.prototype.processFieldValue=function(t,e,r,n){var i=this;return e.selectionSet&&null!==t?ee(t)?t.map((function(t,o){var s=i.processFieldValue(t,e,r,Ii(n,o));return Ri(n,o),s})):this.processSelectionSet({result:t,selectionSet:e.selectionSet,context:r,mergeTree:n}):__DEV__?Sr(t):t},t.prototype.flattenFields=function(t,e,r,n){void 0===n&&(n=gt(e,t,r.fragmentMap));var i=new Map,o=this.cache.policies,s=new Ze(!1);return function t(u,c){var l=s.lookup(u,c.clientOnly,c.deferred);l.visited||(l.visited=!0,u.selections.forEach((function(s){if(Lt(s,r.variables)){var u=c.clientOnly,l=c.deferred;if(u&&l||!re(s.directives)||s.directives.forEach((function(t){var e=t.name.value;if("client"===e&&(u=!0),"defer"===e){var n=pt(t,r.variables);n&&!1===n.if||(l=!0)}})),vt(s)){var h=i.get(s);h&&(u=u&&h.clientOnly,l=l&&h.deferred),i.set(s,Ti(r,u,l))}else{var f=st(s,r.lookupFragment);if(!f&&s.kind===ur.FRAGMENT_SPREAD)throw __DEV__?new a("No fragment named ".concat(s.name.value)):new a(8);f&&o.fragmentMatches(f,n,e,r.variables)&&t(f.selectionSet,Ti(r,u,l))}}})))}(t,r),i},t.prototype.applyMerges=function(t,e,r,n,i){var o,s=this;if(t.map.size&&!ut(r)){var a,c=ee(r)||!ut(e)&&!Hn(e)?void 0:e,l=r;c&&!i&&(i=[ut(c)?c.__ref:c]);var h=function(t,e){return ee(t)?"number"==typeof e?t[e]:void 0:n.store.getFieldValue(t,String(e))};t.map.forEach((function(t,e){var r=h(c,e),o=h(l,e);if(void 0!==o){i&&i.push(e);var f=s.applyMerges(t,r,o,n,i);f!==o&&(a=a||new Map).set(e,f),i&&u(i.pop()===e)}})),a&&(r=ee(l)?l.slice(0):x({},l),a.forEach((function(t,e){r[e]=t})))}return t.info?this.cache.policies.runMergeFunction(e,r,t.info,n,i&&(o=n.store).getStorage.apply(o,i)):r},t}(),xi=[];function Ii(t,e){var r=t.map;return r.has(e)||r.set(e,xi.pop()||{map:new Map}),r.get(e)}function Pi(t){return!t||!(t.info||t.map.size)}function Ri(t,e){var r=t.map,n=r.get(e);n&&Pi(n)&&(xi.push(n),r.delete(e))}var ji=new Set;var Ci=function(t){function e(e){void 0===e&&(e={});var r=t.call(this)||this;return r.watches=new Set,r.typenameDocumentCache=new Map,r.makeVar=_n,r.txCount=0,r.config=function(t){return Mr(Vn,t)}(e),r.addTypename=!!r.config.addTypename,r.policies=new Oi({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return N(e,t),e.prototype.init=function(){var t=this.data=new ti.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=t.stump,this.resetResultCache()},e.prototype.resetResultCache=function(t){var e=this,r=this.storeReader,n=this.config.fragments;this.storeWriter=new Ni(this,this.storeReader=new ci({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:zn(this.config),canon:t?void 0:r&&r.canon,fragments:n}),n),this.maybeBroadcastWatch=gn((function(t,r){return e.broadcastWatch(t,r)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(t){var r=t.optimistic?e.optimisticData:e.data;if(ai(r)){var n=t.optimistic,i=t.id,o=t.variables;return r.makeCacheKey(t.query,t.callback,nr({optimistic:n,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(t){return t.resetCaching()}))},e.prototype.restore=function(t){return this.init(),t&&this.data.replace(t),this},e.prototype.extract=function(t){return void 0===t&&(t=!1),(t?this.optimisticData:this.data).extract()},e.prototype.read=function(t){var e=t.returnPartialData,r=void 0!==e&&e;try{return this.storeReader.diffQueryAgainstStore(x(x({},t),{store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r})).result||null}catch(t){if(t instanceof Dn)return null;throw t}},e.prototype.write=function(t){try{return++this.txCount,this.storeWriter.writeToStore(this.data,t)}finally{--this.txCount||!1===t.broadcast||this.broadcastWatches()}},e.prototype.modify=function(t){if(Ln.call(t,"id")&&!t.id)return!1;var e=t.optimistic?this.optimisticData:this.data;try{return++this.txCount,e.modify(t.id||"ROOT_QUERY",t.fields)}finally{--this.txCount||!1===t.broadcast||this.broadcastWatches()}},e.prototype.diff=function(t){return this.storeReader.diffQueryAgainstStore(x(x({},t),{store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(t){var e,r=this;return this.watches.size||bn(e=this).vars.forEach((function(t){return t.attachCache(e)})),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),function(){r.watches.delete(t)&&!r.watches.size&&wn(r),r.maybeBroadcastWatch.forget(t)}},e.prototype.gc=function(t){nr.reset();var e=this.optimisticData.gc();return t&&!this.txCount&&(t.resetResultCache?this.resetResultCache(t.resetResultIdentities):t.resetResultIdentities&&this.storeReader.resetCanon()),e},e.prototype.retain=function(t,e){return(e?this.optimisticData:this.data).retain(t)},e.prototype.release=function(t,e){return(e?this.optimisticData:this.data).release(t)},e.prototype.identify=function(t){if(ut(t))return t.__ref;try{return this.policies.identify(t)[0]}catch(t){__DEV__&&u.warn(t)}},e.prototype.evict=function(t){if(!t.id){if(Ln.call(t,"id"))return!1;t=x(x({},t),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{--this.txCount||!1===t.broadcast||this.broadcastWatches()}},e.prototype.reset=function(t){var e=this;return this.init(),nr.reset(),t&&t.discardWatches?(this.watches.forEach((function(t){return e.maybeBroadcastWatch.forget(t)})),this.watches.clear(),wn(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(t){var e=this.optimisticData.removeLayer(t);e!==this.optimisticData&&(this.optimisticData=e,this.broadcastWatches())},e.prototype.batch=function(t){var e,r=this,n=t.update,i=t.optimistic,o=void 0===i||i,s=t.removeOptimistic,a=t.onWatchUpdated,u=function(t){var i=r,o=i.data,s=i.optimisticData;++r.txCount,t&&(r.data=r.optimisticData=t);try{return e=n(r)}finally{--r.txCount,r.data=o,r.optimisticData=s}},c=new Set;return a&&!this.txCount&&this.broadcastWatches(x(x({},t),{onWatchUpdated:function(t){return c.add(t),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,u):!1===o?u(this.data):u(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),a&&c.size?(this.broadcastWatches(x(x({},t),{onWatchUpdated:function(t,e){var r=a.call(this,t,e);return!1!==r&&c.delete(t),r}})),c.size&&c.forEach((function(t){return r.maybeBroadcastWatch.dirty(t)}))):this.broadcastWatches(t),e},e.prototype.performTransaction=function(t,e){return this.batch({update:t,optimistic:e||null!==e})},e.prototype.transformDocument=function(t){if(this.addTypename){var e=this.typenameDocumentCache.get(t);return e||(e=pr(t),this.typenameDocumentCache.set(t,e),this.typenameDocumentCache.set(e,e)),e}return t},e.prototype.transformForLink=function(t){var e=this.config.fragments;return e?e.transform(t):t},e.prototype.broadcastWatches=function(t){var e=this;this.txCount||this.watches.forEach((function(r){return e.maybeBroadcastWatch(r,t)}))},e.prototype.broadcastWatch=function(t,e){var r=t.lastDiff,n=this.diff(t);e&&(t.optimistic&&"string"==typeof e.optimistic&&(n.fromOptimisticTransaction=!0),e.onWatchUpdated&&!1===e.onWatchUpdated.call(this,t,n,r))||r&&ze(r.result,n.result)||t.callback(t.lastDiff=n,r)},e}(Cn),Di=Nt.empty,Bi=Nt.from,Fi=Nt.split,Li=Nt.concat;function Ui(t){var e=!1;return new Promise((function(r,n){t.subscribe({next:function(t){e?__DEV__&&u.warn("Promise Wrapper does not support multiple results from Observable"):(e=!0,r(t))},error:n})}))}function qi(t){return new rt((function(e){t.then((function(t){e.next(t),e.complete()})).catch(e.error.bind(e))}))}var Vi=function(){return(Vi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r120){for(var f=Math.floor(u/80),d=u%80,p=[],m=0;m0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=o&&o.stack?(Object.defineProperty(to(f),"stack",{value:o.stack,writable:!0,configurable:!0}),$i(f)):(Error.captureStackTrace?Error.captureStackTrace(to(f),a):Object.defineProperty(to(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return n=a,(i=[{key:"toString",value:function(){return function(t){var e=t.message;if(t.nodes)for(var r=0,n=t.nodes;r",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"}),lo=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"}),ho=function(){function t(t){var e=new Rt(co.SOF,0,0,0,0,null);this.source=t,this.lastToken=e,this.token=e,this.line=1,this.lineStart=0}var e=t.prototype;return e.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},e.lookahead=function(){var t=this.token;if(t.kind!==co.EOF)do{var e;t=null!==(e=t.next)&&void 0!==e?e:t.next=po(this,t)}while(t.kind===co.COMMENT);return t},t}();function fo(t){return isNaN(t)?co.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function po(t,e){for(var r=t.source,n=r.body,i=n.length,o=e.end;o31||9===o));return new Rt(co.COMMENT,e,a,r,n,i,s.slice(e+1,a))}function vo(t,e,r,n,i,o){var s=t.body,a=r,u=e,c=!1;if(45===a&&(a=s.charCodeAt(++u)),48===a){if((a=s.charCodeAt(++u))>=48&&a<=57)throw uo(t,u,"Invalid number, unexpected digit after 0: ".concat(fo(a),"."))}else u=yo(t,u,a),a=s.charCodeAt(u);if(46===a&&(c=!0,a=s.charCodeAt(++u),u=yo(t,u,a),a=s.charCodeAt(u)),69!==a&&101!==a||(c=!0,43!==(a=s.charCodeAt(++u))&&45!==a||(a=s.charCodeAt(++u)),u=yo(t,u,a),a=s.charCodeAt(u)),46===a||function(t){return 95===t||t>=65&&t<=90||t>=97&&t<=122}(a))throw uo(t,u,"Invalid number, expected digit but got: ".concat(fo(a),"."));return new Rt(c?co.FLOAT:co.INT,e,u,n,i,o,s.slice(e,u))}function yo(t,e,r){var n=t.body,i=e,o=r;if(o>=48&&o<=57){do{o=n.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw uo(t,i,"Invalid number, expected digit but got: ".concat(fo(o),"."))}function bo(t,e,r,n,i){for(var o,s,a,u,c=t.body,l=e+1,h=l,f=0,d="";l=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Eo(t,e,r,n,i){for(var o=t.body,s=o.length,a=e+1,u=0;a!==s&&!isNaN(u=o.charCodeAt(a))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++a;return new Rt(co.NAME,e,a,r,n,i,o.slice(e,a))}var Ao=function(){function t(t,e){var r=function(t){return k(t,M)}(t)?t:new M(t);this._lexer=new ho(r),this._options=e}var e=t.prototype;return e.parseName=function(){var t=this.expectToken(co.NAME);return{kind:ur.NAME,value:t.value,loc:this.loc(t)}},e.parseDocument=function(){var t=this._lexer.token;return{kind:ur.DOCUMENT,definitions:this.many(co.SOF,this.parseDefinition,co.EOF),loc:this.loc(t)}},e.parseDefinition=function(){if(this.peek(co.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(co.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var t=this._lexer.token;if(this.peek(co.BRACE_L))return{kind:ur.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(t)};var e,r=this.parseOperationType();return this.peek(co.NAME)&&(e=this.parseName()),{kind:ur.OPERATION_DEFINITION,operation:r,name:e,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},e.parseOperationType=function(){var t=this.expectToken(co.NAME);switch(t.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(t)},e.parseVariableDefinitions=function(){return this.optionalMany(co.PAREN_L,this.parseVariableDefinition,co.PAREN_R)},e.parseVariableDefinition=function(){var t=this._lexer.token;return{kind:ur.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(co.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(co.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(t)}},e.parseVariable=function(){var t=this._lexer.token;return this.expectToken(co.DOLLAR),{kind:ur.VARIABLE,name:this.parseName(),loc:this.loc(t)}},e.parseSelectionSet=function(){var t=this._lexer.token;return{kind:ur.SELECTION_SET,selections:this.many(co.BRACE_L,this.parseSelection,co.BRACE_R),loc:this.loc(t)}},e.parseSelection=function(){return this.peek(co.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var t,e,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(co.COLON)?(t=n,e=this.parseName()):e=n,{kind:ur.FIELD,alias:t,name:e,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(co.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},e.parseArguments=function(t){var e=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(co.PAREN_L,e,co.PAREN_R)},e.parseArgument=function(){var t=this._lexer.token,e=this.parseName();return this.expectToken(co.COLON),{kind:ur.ARGUMENT,name:e,value:this.parseValueLiteral(!1),loc:this.loc(t)}},e.parseConstArgument=function(){var t=this._lexer.token;return{kind:ur.ARGUMENT,name:this.parseName(),value:(this.expectToken(co.COLON),this.parseValueLiteral(!0)),loc:this.loc(t)}},e.parseFragment=function(){var t=this._lexer.token;this.expectToken(co.SPREAD);var e=this.expectOptionalKeyword("on");return!e&&this.peek(co.NAME)?{kind:ur.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(t)}:{kind:ur.INLINE_FRAGMENT,typeCondition:e?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},e.parseFragmentDefinition=function(){var t,e=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(t=this._options)||void 0===t?void 0:t.experimentalFragmentVariables)?{kind:ur.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:ur.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},e.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(t){var e=this._lexer.token;switch(e.kind){case co.BRACKET_L:return this.parseList(t);case co.BRACE_L:return this.parseObject(t);case co.INT:return this._lexer.advance(),{kind:ur.INT,value:e.value,loc:this.loc(e)};case co.FLOAT:return this._lexer.advance(),{kind:ur.FLOAT,value:e.value,loc:this.loc(e)};case co.STRING:case co.BLOCK_STRING:return this.parseStringLiteral();case co.NAME:switch(this._lexer.advance(),e.value){case"true":return{kind:ur.BOOLEAN,value:!0,loc:this.loc(e)};case"false":return{kind:ur.BOOLEAN,value:!1,loc:this.loc(e)};case"null":return{kind:ur.NULL,loc:this.loc(e)};default:return{kind:ur.ENUM,value:e.value,loc:this.loc(e)}}case co.DOLLAR:if(!t)return this.parseVariable()}throw this.unexpected()},e.parseStringLiteral=function(){var t=this._lexer.token;return this._lexer.advance(),{kind:ur.STRING,value:t.value,block:t.kind===co.BLOCK_STRING,loc:this.loc(t)}},e.parseList=function(t){var e=this,r=this._lexer.token;return{kind:ur.LIST,values:this.any(co.BRACKET_L,(function(){return e.parseValueLiteral(t)}),co.BRACKET_R),loc:this.loc(r)}},e.parseObject=function(t){var e=this,r=this._lexer.token;return{kind:ur.OBJECT,fields:this.any(co.BRACE_L,(function(){return e.parseObjectField(t)}),co.BRACE_R),loc:this.loc(r)}},e.parseObjectField=function(t){var e=this._lexer.token,r=this.parseName();return this.expectToken(co.COLON),{kind:ur.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t),loc:this.loc(e)}},e.parseDirectives=function(t){for(var e=[];this.peek(co.AT);)e.push(this.parseDirective(t));return e},e.parseDirective=function(t){var e=this._lexer.token;return this.expectToken(co.AT),{kind:ur.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t),loc:this.loc(e)}},e.parseTypeReference=function(){var t,e=this._lexer.token;return this.expectOptionalToken(co.BRACKET_L)?(t=this.parseTypeReference(),this.expectToken(co.BRACKET_R),t={kind:ur.LIST_TYPE,type:t,loc:this.loc(e)}):t=this.parseNamedType(),this.expectOptionalToken(co.BANG)?{kind:ur.NON_NULL_TYPE,type:t,loc:this.loc(e)}:t},e.parseNamedType=function(){var t=this._lexer.token;return{kind:ur.NAMED_TYPE,name:this.parseName(),loc:this.loc(t)}},e.parseTypeSystemDefinition=function(){var t=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(t.kind===co.NAME)switch(t.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(t)},e.peekDescription=function(){return this.peek(co.STRING)||this.peek(co.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(co.BRACE_L,this.parseOperationTypeDefinition,co.BRACE_R);return{kind:ur.SCHEMA_DEFINITION,description:e,directives:r,operationTypes:n,loc:this.loc(t)}},e.parseOperationTypeDefinition=function(){var t=this._lexer.token,e=this.parseOperationType();this.expectToken(co.COLON);var r=this.parseNamedType();return{kind:ur.OPERATION_TYPE_DEFINITION,operation:e,type:r,loc:this.loc(t)}},e.parseScalarTypeDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:ur.SCALAR_TYPE_DEFINITION,description:e,name:r,directives:n,loc:this.loc(t)}},e.parseObjectTypeDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:ur.OBJECT_TYPE_DEFINITION,description:e,name:r,interfaces:n,directives:i,fields:o,loc:this.loc(t)}},e.parseImplementsInterfaces=function(){var t;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(t=this._options)||void 0===t?void 0:t.allowLegacySDLImplementsInterfaces)){var e=[];this.expectOptionalToken(co.AMP);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(co.AMP)||this.peek(co.NAME));return e}return this.delimitedMany(co.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var t;return!0===(null===(t=this._options)||void 0===t?void 0:t.allowLegacySDLEmptyFields)&&this.peek(co.BRACE_L)&&this._lexer.lookahead().kind===co.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(co.BRACE_L,this.parseFieldDefinition,co.BRACE_R)},e.parseFieldDefinition=function(){var t=this._lexer.token,e=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(co.COLON);var i=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:ur.FIELD_DEFINITION,description:e,name:r,arguments:n,type:i,directives:o,loc:this.loc(t)}},e.parseArgumentDefs=function(){return this.optionalMany(co.PAREN_L,this.parseInputValueDef,co.PAREN_R)},e.parseInputValueDef=function(){var t=this._lexer.token,e=this.parseDescription(),r=this.parseName();this.expectToken(co.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(co.EQUALS)&&(n=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:ur.INPUT_VALUE_DEFINITION,description:e,name:r,type:i,defaultValue:n,directives:o,loc:this.loc(t)}},e.parseInterfaceTypeDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:ur.INTERFACE_TYPE_DEFINITION,description:e,name:r,interfaces:n,directives:i,fields:o,loc:this.loc(t)}},e.parseUnionTypeDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:ur.UNION_TYPE_DEFINITION,description:e,name:r,directives:n,types:i,loc:this.loc(t)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(co.EQUALS)?this.delimitedMany(co.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:ur.ENUM_TYPE_DEFINITION,description:e,name:r,directives:n,values:i,loc:this.loc(t)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(co.BRACE_L,this.parseEnumValueDefinition,co.BRACE_R)},e.parseEnumValueDefinition=function(){var t=this._lexer.token,e=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:ur.ENUM_VALUE_DEFINITION,description:e,name:r,directives:n,loc:this.loc(t)}},e.parseInputObjectTypeDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:ur.INPUT_OBJECT_TYPE_DEFINITION,description:e,name:r,directives:n,fields:i,loc:this.loc(t)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(co.BRACE_L,this.parseInputValueDef,co.BRACE_R)},e.parseTypeSystemExtension=function(){var t=this._lexer.lookahead();if(t.kind===co.NAME)switch(t.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(t)},e.parseSchemaExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var e=this.parseDirectives(!0),r=this.optionalMany(co.BRACE_L,this.parseOperationTypeDefinition,co.BRACE_R);if(0===e.length&&0===r.length)throw this.unexpected();return{kind:ur.SCHEMA_EXTENSION,directives:e,operationTypes:r,loc:this.loc(t)}},e.parseScalarTypeExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var e=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:ur.SCALAR_TYPE_EXTENSION,name:e,directives:r,loc:this.loc(t)}},e.parseObjectTypeExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var e=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:ur.OBJECT_TYPE_EXTENSION,name:e,interfaces:r,directives:n,fields:i,loc:this.loc(t)}},e.parseInterfaceTypeExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var e=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:ur.INTERFACE_TYPE_EXTENSION,name:e,interfaces:r,directives:n,fields:i,loc:this.loc(t)}},e.parseUnionTypeExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var e=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:ur.UNION_TYPE_EXTENSION,name:e,directives:r,types:n,loc:this.loc(t)}},e.parseEnumTypeExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var e=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:ur.ENUM_TYPE_EXTENSION,name:e,directives:r,values:n,loc:this.loc(t)}},e.parseInputObjectTypeExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var e=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:ur.INPUT_OBJECT_TYPE_EXTENSION,name:e,directives:r,fields:n,loc:this.loc(t)}},e.parseDirectiveDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("directive"),this.expectToken(co.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:ur.DIRECTIVE_DEFINITION,description:e,name:r,arguments:n,repeatable:i,locations:o,loc:this.loc(t)}},e.parseDirectiveLocations=function(){return this.delimitedMany(co.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var t=this._lexer.token,e=this.parseName();if(void 0!==lo[e.value])return e;throw this.unexpected(t)},e.loc=function(t){var e;if(!0!==(null===(e=this._options)||void 0===e?void 0:e.noLocation))return new Pt(t,this._lexer.lastToken,this._lexer.source)},e.peek=function(t){return this._lexer.token.kind===t},e.expectToken=function(t){var e=this._lexer.token;if(e.kind===t)return this._lexer.advance(),e;throw uo(this._lexer.source,e.start,"Expected ".concat(ko(t),", found ").concat(Oo(e),"."))},e.expectOptionalToken=function(t){var e=this._lexer.token;if(e.kind===t)return this._lexer.advance(),e},e.expectKeyword=function(t){var e=this._lexer.token;if(e.kind!==co.NAME||e.value!==t)throw uo(this._lexer.source,e.start,'Expected "'.concat(t,'", found ').concat(Oo(e),"."));this._lexer.advance()},e.expectOptionalKeyword=function(t){var e=this._lexer.token;return e.kind===co.NAME&&e.value===t&&(this._lexer.advance(),!0)},e.unexpected=function(t){var e=null!=t?t:this._lexer.token;return uo(this._lexer.source,e.start,"Unexpected ".concat(Oo(e),"."))},e.any=function(t,e,r){this.expectToken(t);for(var n=[];!this.expectOptionalToken(r);)n.push(e.call(this));return n},e.optionalMany=function(t,e,r){if(this.expectOptionalToken(t)){var n=[];do{n.push(e.call(this))}while(!this.expectOptionalToken(r));return n}return[]},e.many=function(t,e,r){this.expectToken(t);var n=[];do{n.push(e.call(this))}while(!this.expectOptionalToken(r));return n},e.delimitedMany=function(t,e){this.expectOptionalToken(t);var r=[];do{r.push(e.call(this))}while(this.expectOptionalToken(t));return r},t}();function Oo(t){var e=t.value;return ko(t.kind)+(null!=e?' "'.concat(e,'"'):"")}function ko(t){return function(t){return t===co.BANG||t===co.DOLLAR||t===co.AMP||t===co.PAREN_L||t===co.PAREN_R||t===co.SPREAD||t===co.COLON||t===co.EQUALS||t===co.AT||t===co.BRACKET_L||t===co.BRACKET_R||t===co.BRACE_L||t===co.PIPE||t===co.BRACE_R}(t)?'"'.concat(t,'"'):t}var So=new Map,Mo=new Map,To=!0,No=!1;function xo(t){return t.replace(/[\s,]+/g," ").trim()}function Io(t){var e=new Set,r=[];return t.definitions.forEach((function(t){if("FragmentDefinition"===t.kind){var n=t.name.value,i=xo((s=t.loc).source.body.substring(s.start,s.end)),o=Mo.get(n);o&&!o.has(i)?To&&console.warn("Warning: fragment with name "+n+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||Mo.set(n,o=new Set),o.add(i),e.has(i)||(e.add(i),r.push(t))}else r.push(t);var s})),Vi(Vi({},t),{definitions:r})}function Po(t){var e=xo(t);if(!So.has(e)){var r=function(t,e){return new Ao(t,e).parseDocument()}(t,{experimentalFragmentVariables:No,allowLegacyFragmentVariables:No});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");So.set(e,function(t){var e=new Set(t.definitions);e.forEach((function(t){t.loc&&delete t.loc,Object.keys(t).forEach((function(r){var n=t[r];n&&"object"==typeof n&&e.add(n)}))}));var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}(Io(r)))}return So.get(e)}function Ro(t){for(var e=[],r=1;r(t[e]=r,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function h(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(i||(i=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(p(this),e),d(o.get(this))}:function(...e){return d(t.apply(p(this),e))}:function(e,...r){const n=t.call(p(this),e,...r);return a.set(n,e.sort?e.sort():[e]),d(n)}}function f(t){return"function"==typeof t?h(t):(t instanceof IDBTransaction&&function(t){if(s.has(t))return;const e=new Promise((e,r)=>{const n=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",o),t.removeEventListener("abort",o)},i=()=>{e(),n()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),n()};t.addEventListener("complete",i),t.addEventListener("error",o),t.addEventListener("abort",o)});s.set(t,e)}(t),e=t,(n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(t=>e instanceof t)?new Proxy(t,l):t);var e}function d(t){if(t instanceof IDBRequest)return function(t){const e=new Promise((e,r)=>{const n=()=>{t.removeEventListener("success",i),t.removeEventListener("error",o)},i=()=>{e(d(t.result)),n()},o=()=>{r(t.error),n()};t.addEventListener("success",i),t.addEventListener("error",o)});return e.then(e=>{e instanceof IDBCursor&&o.set(e,t)}).catch(()=>{}),c.set(e,t),e}(t);if(u.has(t))return u.get(t);const e=f(t);return e!==t&&(u.set(t,e),c.set(e,t)),e}const p=t=>c.get(t);function m(t,e,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(t,e),a=d(s);return n&&s.addEventListener("upgradeneeded",t=>{n(d(s.result),t.oldVersion,t.newVersion,d(s.transaction))}),r&&s.addEventListener("blocked",()=>r()),a.then(t=>{o&&t.addEventListener("close",()=>o()),i&&t.addEventListener("versionchange",()=>i())}).catch(()=>{}),a}function g(t,{blocked:e}={}){const r=indexedDB.deleteDatabase(t);return e&&r.addEventListener("blocked",()=>e()),d(r).then(()=>{})}const v=["get","getKey","getAll","getAllKeys","count"],y=["put","add","delete","clear"],b=new Map;function w(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(b.get(e))return b.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=y.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!v.includes(r))return;const o=async function(t,...e){const o=this.transaction(t,i?"readwrite":"readonly");let s=o.store;return n&&(s=s.index(e.shift())),(await Promise.all([s[r](...e),i&&o.done]))[0]};return b.set(e,o),o}l=(t=>({...t,get:(e,r,n)=>w(e,r)||t.get(e,r,n),has:(e,r)=>!!w(e,r)||t.has(e,r)}))(l)},,function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return c}));var n=r(0),i=r(2),o=r(43);const s=new i.b(o.a);const a=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==t)return t;throw new Error("unable to locate global object")}();let u=a.crypto||a.msCrypto;function c(t){(t<=0||t>1024||t%1||t!=t)&&s.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return u.getRandomValues(e),Object(n.a)(e)}u&&u.getRandomValues||(s.warn("WARNING: Missing strong random number source"),u={getRandomValues:function(t){return s.throwError("no secure random source avaialble",i.b.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r(12))}]); \ No newline at end of file + */!function(){"use strict";var s="input is invalid type",a="object"==typeof window,u=a?window:{};u.JS_SHA3_NO_WINDOW&&(a=!1);var c=!a&&"object"==typeof self;!u.JS_SHA3_NO_NODE_JS&&"object"==typeof n&&n.versions&&n.versions.node?u=i:c&&(u=self);var l=!u.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,h=r(58),f=!u.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[4,1024,262144,67108864],m=[0,8,16,24],g=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],y=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};!u.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),!f||!u.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var _=function(t,e,r){return function(n){return new D(t,e,t).update(n)[r]()}},E=function(t,e,r){return function(n,i){return new D(t,e,i).update(n)[r]()}},A=function(t,e,r){return function(e,n,i,o){return T["cshake"+t].update(e,n,i,o)[r]()}},O=function(t,e,r){return function(e,n,i,o){return T["kmac"+t].update(e,n,i,o)[r]()}},k=function(t,e,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function B(t,e,r){D.call(this,t,e,r)}D.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}for(var n,i,o=this.blocks,a=this.byteCount,u=t.length,c=this.blockCount,l=0,h=this.s;l>2]|=t[l]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=n-a,this.block=o[c],n=0;n>=8);r>0;)i.unshift(r),r=255&(t>>=8),++n;return e?i.push(n):i.unshift(n),this.update(i),i.length},D.prototype.encodeString=function(t){var e,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(s);if(null===t)throw new Error(s);if(f&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||f&&ArrayBuffer.isView(t)))throw new Error(s);e=!0}var n=0,i=t.length;if(e)n=i;else for(var o=0;o=57344?n+=3:(a=65536+((1023&a)<<10|1023&t.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(t),n},D.prototype.bytepad=function(t,e){for(var r=this.encode(e),n=0;n>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15];s%e==0&&(F(r),o=0)}return i&&(t=r[o],a+=d[t>>4&15]+d[15&t],i>1&&(a+=d[t>>12&15]+d[t>>8&15]),i>2&&(a+=d[t>>20&15]+d[t>>16&15])),a},D.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&F(n)}return o&&(t=a<<2,e=n[s],u[t]=255&e,o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u},B.prototype=new D,B.prototype.finalize=function(){return this.encode(this.outputBits,!0),D.prototype.finalize.call(this)};var F=function(t){var e,r,n,i,o,s,a,u,c,l,h,f,d,p,m,v,y,b,w,_,E,A,O,k,S,M,T,N,x,I,P,R,j,C,D,B,F,L,U,q,V,z,G,K,Q,H,W,J,Y,X,Z,$,tt,et,rt,nt,it,ot,st,at,ut,ct,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],u=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],h=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(d=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|h>>>31),r=a^(h<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=u^(f<<1|d>>>31),r=c^(d<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(i<<1|o>>>31),r=h^(o<<1|i>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],m=t[1],H=t[11]<<4|t[10]>>>28,W=t[10]<<4|t[11]>>>28,N=t[20]<<3|t[21]>>>29,x=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,G=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,D=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,Y=t[23]<<10|t[22]>>>22,I=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ct=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,B=t[14]<<6|t[15]>>>26,F=t[15]<<6|t[14]>>>26,b=t[25]<<11|t[24]>>>21,w=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,R=t[45]<<29|t[44]>>>3,j=t[44]<<29|t[45]>>>3,k=t[6]<<28|t[7]>>>4,S=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,L=t[26]<<25|t[27]>>>7,U=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,E=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,Q=t[9]<<27|t[8]>>>5,M=t[18]<<20|t[19]>>>12,T=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,q=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,O=t[49]<<14|t[48]>>>18,t[0]=p^~v&b,t[1]=m^~y&w,t[10]=k^~M&N,t[11]=S^~T&x,t[20]=C^~B&L,t[21]=D^~F&U,t[30]=K^~H&J,t[31]=Q^~W&Y,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=v^~b&_,t[3]=y^~w&E,t[12]=M^~N&I,t[13]=T^~x&P,t[22]=B^~L&q,t[23]=F^~U&V,t[32]=H^~J&X,t[33]=W^~Y&Z,t[42]=nt^~ot&at,t[43]=it^~st&ut,t[4]=b^~_&A,t[5]=w^~E&O,t[14]=N^~I&R,t[15]=x^~P&j,t[24]=L^~q&z,t[25]=U^~V&G,t[34]=J^~X&$,t[35]=Y^~Z&tt,t[44]=ot^~at&ct,t[45]=st^~ut<,t[6]=_^~A&p,t[7]=E^~O&m,t[16]=I^~R&k,t[17]=P^~j&S,t[26]=q^~z&C,t[27]=V^~G&D,t[36]=X^~$&K,t[37]=Z^~tt&Q,t[46]=at^~ct&et,t[47]=ut^~lt&rt,t[8]=A^~p&v,t[9]=O^~m&y,t[18]=R^~k&M,t[19]=j^~S&T,t[28]=z^~C&B,t[29]=G^~D&F,t[38]=$^~K&H,t[39]=tt^~Q&W,t[48]=ct^~et&nt,t[49]=lt^~rt&it,t[0]^=g[n],t[1]^=g[n+1]};if(l)t.exports=T;else{for(x=0;x=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+t)}function u(t,e,r){var n=a(t,r);return r-1>=e&&(n|=a(t,r-1)<<4),n}function c(t,e,r,i){for(var o=0,s=0,a=Math.min(t.length,r),u=e;u=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&s0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=u(t,e,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(t){o.prototype.inspect=h}else o.prototype.inspect=h;function h(){return(this.red?""}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,o=0,s=0;s>>24-i&16777215,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=d[t],l=p[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modrn(l).toString(t);r=(h=h.idivn(l)).isZero()?m+r:f[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(s,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function m(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var c=1;c>>26,h=67108863&u,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+h)/67108864|0,h=67108863&s}r.words[c]=0|h,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,n=0,i=0,o=0;i>8&255),r>16&255),6===o?(r>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(t[r--]=n;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],v=8191&g,y=g>>>13,b=0|s[3],w=8191&b,_=b>>>13,E=0|s[4],A=8191&E,O=E>>>13,k=0|s[5],S=8191&k,M=k>>>13,T=0|s[6],N=8191&T,x=T>>>13,I=0|s[7],P=8191&I,R=I>>>13,j=0|s[8],C=8191&j,D=j>>>13,B=0|s[9],F=8191&B,L=B>>>13,U=0|a[0],q=8191&U,V=U>>>13,z=0|a[1],G=8191&z,K=z>>>13,Q=0|a[2],H=8191&Q,W=Q>>>13,J=0|a[3],Y=8191&J,X=J>>>13,Z=0|a[4],$=8191&Z,tt=Z>>>13,et=0|a[5],rt=8191&et,nt=et>>>13,it=0|a[6],ot=8191&it,st=it>>>13,at=0|a[7],ut=8191&at,ct=at>>>13,lt=0|a[8],ht=8191<,ft=lt>>>13,dt=0|a[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,q))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,q)|0))<<13)|0;c=((o=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,q),i=(i=Math.imul(p,V))+Math.imul(m,q)|0,o=Math.imul(m,V);var vt=(c+(n=n+Math.imul(h,G)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,G)|0))<<13)|0;c=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,q),i=(i=Math.imul(v,V))+Math.imul(y,q)|0,o=Math.imul(y,V),n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,K)|0;var yt=(c+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(f,H)|0))<<13)|0;c=((o=o+Math.imul(f,W)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,V))+Math.imul(_,q)|0,o=Math.imul(_,V),n=n+Math.imul(v,G)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var bt=(c+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(f,Y)|0))<<13)|0;c=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(A,q),i=(i=Math.imul(A,V))+Math.imul(O,q)|0,o=Math.imul(O,V),n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,W)|0)+Math.imul(y,H)|0,o=o+Math.imul(y,W)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,Y)|0,o=o+Math.imul(m,X)|0;var wt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(S,q),i=(i=Math.imul(S,V))+Math.imul(M,q)|0,o=Math.imul(M,V),n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(v,Y)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(N,q),i=(i=Math.imul(N,V))+Math.imul(x,q)|0,o=Math.imul(x,V),n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,K)|0,n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(O,H)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var Et=(c+(n=n+Math.imul(h,ot)|0)|0)+((8191&(i=(i=i+Math.imul(h,st)|0)+Math.imul(f,ot)|0))<<13)|0;c=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(P,q),i=(i=Math.imul(P,V))+Math.imul(R,q)|0,o=Math.imul(R,V),n=n+Math.imul(N,G)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,K)|0,n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,X)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var At=(c+(n=n+Math.imul(h,ut)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,ut)|0))<<13)|0;c=((o=o+Math.imul(f,ct)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,q),i=(i=Math.imul(C,V))+Math.imul(D,q)|0,o=Math.imul(D,V),n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(S,Y)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,X)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var Ot=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(F,q),i=(i=Math.imul(F,V))+Math.imul(L,q)|0,o=Math.imul(L,V),n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,K)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(N,Y)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,X)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ht)|0,o=o+Math.imul(m,ft)|0;var kt=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(F,G),i=(i=Math.imul(F,K))+Math.imul(L,G)|0,o=Math.imul(L,K),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(D,H)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,ht)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(y,ht)|0,o=o+Math.imul(y,ft)|0;var St=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(F,H),i=(i=Math.imul(F,W))+Math.imul(L,H)|0,o=Math.imul(L,W),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(D,Y)|0,o=o+Math.imul(D,X)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(A,ut)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(w,ht)|0,i=(i=i+Math.imul(w,ft)|0)+Math.imul(_,ht)|0,o=o+Math.imul(_,ft)|0;var Mt=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(F,Y),i=(i=Math.imul(F,X))+Math.imul(L,Y)|0,o=Math.imul(L,X),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ct)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ct)|0,n=n+Math.imul(A,ht)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(O,ht)|0,o=o+Math.imul(O,ft)|0;var Tt=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(F,$),i=(i=Math.imul(F,tt))+Math.imul(L,$)|0,o=Math.imul(L,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(x,ut)|0,o=o+Math.imul(x,ct)|0,n=n+Math.imul(S,ht)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(M,ht)|0,o=o+Math.imul(M,ft)|0;var Nt=(c+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(F,rt),i=(i=Math.imul(F,nt))+Math.imul(L,rt)|0,o=Math.imul(L,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,st)|0,n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ct)|0,n=n+Math.imul(N,ht)|0,i=(i=i+Math.imul(N,ft)|0)+Math.imul(x,ht)|0,o=o+Math.imul(x,ft)|0;var xt=(c+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(M,pt)|0))<<13)|0;c=((o=o+Math.imul(M,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(F,ot),i=(i=Math.imul(F,st))+Math.imul(L,ot)|0,o=Math.imul(L,st),n=n+Math.imul(C,ut)|0,i=(i=i+Math.imul(C,ct)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ct)|0,n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(R,ht)|0,o=o+Math.imul(R,ft)|0;var It=(c+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(F,ut),i=(i=Math.imul(F,ct))+Math.imul(L,ut)|0,o=Math.imul(L,ct),n=n+Math.imul(C,ht)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(D,ht)|0,o=o+Math.imul(D,ft)|0;var Pt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(R,pt)|0))<<13)|0;c=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(F,ht),i=(i=Math.imul(F,ft))+Math.imul(L,ht)|0,o=Math.imul(L,ft);var Rt=(c+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((o=o+Math.imul(D,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var jt=(c+(n=Math.imul(F,pt))|0)+((8191&(i=(i=Math.imul(F,mt))+Math.imul(L,pt)|0))<<13)|0;return c=((o=Math.imul(L,mt))+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=Et,u[7]=At,u[8]=Ot,u[9]=kt,u[10]=St,u[11]=Mt,u[12]=Tt,u[13]=Nt,u[14]=xt,u[15]=It,u[16]=Pt,u[17]=Rt,u[18]=jt,0!==c&&(u[19]=c,r.length++),r};function v(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function y(t,e,r){return v(t,e,r)}function b(t,e){this.x=t,this.y=e}Math.imul||(g=m),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?g(this,t,e):r<63?m(this,t,e):r<1024?v(this,t,e):y(this,t,e)},b.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},b.prototype.permute=function(t,e,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,r+=o/67108864|0,r+=s>>>26,this.words[i]=67108863&s}return 0!==r&&(this.words[i]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==l||c>=i);c--){var h=0|this.words[c];this.words[c]=l<<26-o|h>>>o,l=h&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var c=0;c=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=f)}return a&&a._strip(),n._strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(i=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var i,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=(1<<26)%t,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%t;return e?-i:i},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),n(t<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(h)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(a),s.isub(u)):(r.isub(e),a.isub(i),u.isub(s))}return{a:a,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0==(e.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,f=1;0==(r.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(i=0===e.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function _(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function O(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},_.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(t,e){t.iushrn(this.n,0,e)},_.prototype.imulK=function(t){return t.imul(this.k)},i(E,_),E.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},E.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(w[t])return w[t];var e;if("k256"===t)e=new E;else if("p224"===t)e=new A;else if("p192"===t)e=new O;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new k}return w[t]=e,e},S.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var h=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(a);){for(var m=d,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],l=u-1;l>=0;l--){var h=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},i(M,S),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(24)(t))},function(t,e,r){"use strict";r.d(e,"a",(function(){return n}));const n="random/5.7.0"},function(t,e,r){const{isEmpty:n}=r(34),{BigNumber:i,Contract:o}=r(39),{IndexedDB:s}=r(62),{BatchEventsService:a}=r(63),{getAllNullifiers:u}=r(64),{ExtendedProvider:c}=r(66),{POOL_CONTRACT:l,RPC_LIST:h,FALLBACK_RPC_LIST:f,workerEvents:d,numbers:p}=r(27),{sleep:m}=r(38),{poolAbi:g}=r(67),v=t=>{self.chainId=t;const e=(t=>new c(h[t],t,f[t]))(t);y(t,e),(async()=>{try{const t=new s({stores:[{keyPath:"nullifier",name:"nullifier_events_100",indexes:[{name:"transactionHash",unique:!1}]}],dbName:"tornado_pool_nullifier"});await t.initDB(),self.$indexedDB=t}catch(t){console.log("err",t.message)}})()},y=(t,e)=>{self.poolContract=new o(l[t],g,e),self.BatchEventsService=new a({provider:e,contract:self.poolContract})},b=async(t,e=!0)=>{let r={blockFrom:p.DEPLOYED_BLOCK,cachedEvents:[]};try{if(t&&t.length){const[e]=t.sort((t,e)=>e.blockNumber-t.blockNumber),n=await self.poolContract.provider.getBlockNumber(),i=Number(e.blockNumber)+p.ONE;e.blockNumber===n&&(r.blockFrom=p.DEPLOYED_BLOCK),r.blockFrom=i>n?n:i,r.cachedEvents=t}else r=await(async()=>{let t=p.DEPLOYED_BLOCK;self.$indexedDB||await m(p.RECALL_DELAY);const e=await self.$indexedDB.getAll({storeName:"nullifier_events_100"});if(e&&e.length){const[r]=e.sort((t,e)=>e.blockNumber-t.blockNumber),n=await self.poolContract.provider.getBlockNumber(),i=Number(r.blockNumber)+p.ONE;if(r.blockNumber===n)return{blockFrom:t,cachedEvents:e};t=i>n?n:i}return{blockFrom:t,cachedEvents:e}})();const{blockFrom:i=p.DEPLOYED_BLOCK,cachedEvents:o=[]}=r,s=await(async t=>{try{const e=[];let{events:r,lastSyncBlock:n}=await u({fromBlock:t,chainId:chainId});n&&(console.log({graphEvents:r}),e.push(...r),t=n+p.ONE);let i=await self.BatchEventsService.getBatchEvents({fromBlock:t,type:"NewNullifier"});return i&&i.length&&(i=i.map(({blockNumber:t,transactionHash:e,args:r})=>({blockNumber:t,transactionHash:e,nullifier:r.nullifier})),console.log({nodeEvents:i}),e.push(...i)),e}catch(t){return console.error("getNullifiers",t.message),[]}})(i);return s.length&&(async({events:t})=>{try{if(await _()||!E()||n(t))return;self.$indexedDB.createMultipleTransactions({data:t,storeName:"nullifier_events_100"})}catch(t){console.error("saveEvents has error: "+t.message)}})({events:s}),e?o.concat(s):s}catch(t){throw new Error("Method getNullifierEvents has error: "+t.message)}},w=async({cachedNullifiers:t,decryptedEvents:e})=>{try{if(e.length===p.ZERO)return{unspentUtxo:[],totalAmount:0};const r=await b(t);let n=i.from("0");const o=[];return(await Promise.all(e.map(t=>(async(t,e)=>{try{const{nullifierHash:r}=t;if(await _()){if(await self.$indexedDB.getFromIndex({key:r,indexName:"nullifier",storeName:"nullifier_events_100"}))return}if(e.find(t=>t.nullifier===r))return;return t}catch(t){throw new Error("Method getNullifierEvent has error: "+t.message)}})(t,r)))).forEach(t=>{t&&!i.from(t.amount).isZero()&&(o.push(t),n=n.add(t.amount))}),{totalAmount:n,unspentUtxo:o}}catch(t){throw new Error("Method checkUnspentEvents has error: "+t.message)}},_=async()=>(self.$indexedDB||await m(p.RECALL_DELAY),!self.$indexedDB||self.$indexedDB.isBlocked),E=()=>!!self.location.host.includes("compassionate-payne-b9dc6b.netlify.app")||["localhost:3000","nova.tornadocash.eth","nova.tornadocash.eth.link","nova.tornadocash.eth.limo"].includes(self.location.host);self.addEventListener("message",({data:t,ports:e})=>{switch(self.postMessage(t),t.eventName){case d.INIT_WORKER:v(t.payload);break;case d.GET_NULLIFIER_EVENT:(async({cachedNullifiers:t,nullifierHash:e},[r])=>{try{const n=await self.$indexedDB.getFromIndex({key:e,indexName:"nullifier",storeName:"nullifier_events_100"});if(n)return void r.postMessage({result:n});const i=await b(t),[o]=i.filter(t=>t.nullifier===e);r.postMessage({result:o})}catch(t){r.postMessage({errorMessage:t.message})}})(t.payload,e);break;case d.UPDATE_NULLIFIER_EVENTS:(async(t,[e])=>{try{const r=await b(t);e.postMessage({result:r})}catch(t){e.postMessage({errorMessage:t.message})}})(t.payload,e);break;case d.GET_UNSPENT_EVENTS:(async({decryptedEvents:t,cachedNullifiers:e},[r])=>{try{const n=await w({decryptedEvents:t,cachedNullifiers:e});r.postMessage({result:n})}catch(t){r.postMessage({errorMessage:t.message})}})(t.payload,e);break;case d.GET_NULLIFIER_EVENTS_FROM_TX_HASH:(async({cachedNullifiers:t,txHash:e},[r])=>{try{const n=await self.$indexedDB.getAllFromIndex({key:e.toLowerCase(),indexName:"transactionHash",storeName:"nullifier_events_100"});if(n&&n.length>p.ZERO)return void r.postMessage({result:n});const i=(await b(t,!0)).filter(t=>t.transactionHash.toLowerCase()===e.toLowerCase());r.postMessage({result:i})}catch(t){r.postMessage({errorMessage:t.message})}})(t.payload,e)}},!1)},,,,,,function(t,e){},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},function(t,e,r){"use strict";e.sha1=r(53),e.sha224=r(54),e.sha256=r(36),e.sha384=r(55),e.sha512=r(37)},function(t,e,r){"use strict";var n=r(11),i=r(18),o=r(35),s=n.rotl32,a=n.sum32,u=n.sum32_5,c=o.ft_1,l=i.BlockHash,h=[1518500249,1859775393,2400959708,3395469782];function f(){if(!(this instanceof f))return new f;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(f,l),t.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.prototype._update=function(t,e){for(var r=this.W,n=0;n<16;n++)r[n]=t[e+n];for(;nthis.blockSize&&(t=(new this.Hash).update(t).digest()),i(t.length<=this.blockSize);for(var e=t.length;e=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r(61),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(12))},function(t,e,r){(function(t,e){!function(t,r){"use strict";if(!t.setImmediate){var n,i,o,s,a,u=1,c={},l=!1,h=t.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(t);f=f&&f.setTimeout?f:t,"[object process]"==={}.toString.call(t.process)?n=function(t){e.nextTick((function(){p(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,r=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=r,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){p(t.data)},n=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,n=function(t){var e=h.createElement("script");e.onreadystatechange=function(){p(t),e.onreadystatechange=null,i.removeChild(e),e=null},i.appendChild(e)}):n=function(t){setTimeout(p,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&p(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),n=function(e){t.postMessage(s+e,"*")}),f.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),r=0;r{e.deleteObjectStore(t)}),t.forEach(({name:t,keyPath:r,indexes:n})=>{const i=e.createObjectStore(t,{keyPath:r,autoIncrement:!0});Array.isArray(n)&&n.forEach(({name:t,unique:e=!1})=>{i.createIndex(t,String(t),{unique:e})})})}},this.dbName=e}async initDB(){try{if(this.dbExists)return;this.db=await i(this.dbName,9,this.options),this.onEventHandler(),this.dbExists=!0}catch(t){if(t.message.includes("A mutation operation was attempted on a database that did not allow mutations."))return void(this.isBlocked=!0);t.message.includes("less than the existing version")&&await this.removeExist(),console.error("initDB has error: "+t.message)}}async createTransactions({storeName:t,data:e,mode:r="readwrite"}){try{const n=this.db.transaction(t,r),i=n.objectStore(t);i.add&&(await i.add(e),await n.done)}catch(t){throw new Error("Method createTransactions has error: "+t.message)}}createMultipleTransactions({storeName:t,data:e,index:r,mode:n="readwrite"}){try{const i=this.db.transaction(t,n);e.forEach(t=>{t&&i.store&&i.store.put&&i.store.put({...t,...r})})}catch(t){throw new Error("Method createMultipleTransactions has error: "+t.message)}}async getFromIndex(t){if(!this.isBlocked)try{return await this.getFromIndexHandler(t)}catch(t){return}}async getItem({storeName:t,key:e}){try{if(this.isBlocked)return;const r=this.db.transaction(t).objectStore(t);return await r.get(e)}catch(t){throw new Error("Method getItem has error: "+t.message)}}async addItem({storeName:t,data:e,key:r}){try{const n=this.db.transaction(t,"readwrite");await n.objectStore(t).get(r)||await n.objectStore(t).add(e)}catch(t){throw new Error("Method addItem has error: "+t.message)}}async putItem({storeName:t,data:e}){try{if(this.isBlocked)return;const r=this.db.transaction(t,"readwrite");await r.objectStore(t).put(e)}catch(t){throw new Error("Method putItem has error: "+t.message)}}async getAll({storeName:t}){try{if(this.isBlocked||!this.dbExists)return[];const e=this.db.transaction(t,"readonly").objectStore(t);return await e.getAll()}catch(t){throw new Error("Method getAll has error: "+t.message)}}async clearStore({storeName:t,mode:e="readwrite"}){try{const r=this.db.transaction(t,e).objectStore(t);r.clear&&await r.clear()}catch(t){throw new Error("Method clearStore has error: "+t.message)}}async getAllFromIndex(t){if(this.isBlocked)return[];try{return await this.getAllFromIndexHandler(t)}catch(t){return[]}}onEventHandler(){this.db.addEventListener("onupgradeneeded",async()=>{await this.removeExist()})}async removeExist(){await n(this.dbName),this.dbExists=!1,await this.initDB()}async getFromIndexHandler({storeName:t,indexName:e,key:r}){try{return await this.db.getFromIndex(t,e,r)}catch(t){throw new Error("Method getFromIndexHandler has error: "+t.message)}}async getAllFromIndexHandler({storeName:t,indexName:e,key:r,count:n}){try{return await this.db.getAllFromIndex(t,e,r,n)}catch(t){throw new Error("Method getAllFromIndex has error: "+t.message)}}}}},function(t,e,r){const{sleep:n,getBatches:i}=r(38);t.exports={BatchEventsService:class{constructor({provider:t,contract:e,concurrencySize:r=10,blocksPerRequest:n=2e3,shouldRetry:i=!0,retryMax:o=5,retryOn:s=500}){this.provider=t,this.contract=e,this.concurrencySize=r,this.blocksPerRequest=n,this.shouldRetry=i,this.retryMax=o,this.retryOn=s}async getPastEvents({fromBlock:t,toBlock:e,type:r}){let i,o=0;for(;!this.shouldRetry&&0===o||this.shouldRetry&&o(await n(20*e),this.getPastEvents(t)))}async getBatchEvents({fromBlock:t,toBlock:e,type:r="*"}){e||(e=await this.provider.getBlockNumber());const n=[];for(let i=t;ie?e:i+this.blocksPerRequest-1;n.push({fromBlock:i,toBlock:t,type:r})}const o=[],s=i(n,this.concurrencySize);for(const t of s){0;const e=(await Promise.all(this.createBatchRequest(t))).flat();o.push(...e)}return o}}}},function(t,e,r){const{isEmpty:n}=r(34),{ApolloClient:i,InMemoryCache:o,gql:s}=r(68),{GET_COMMITMENT:a,GET_NULLIFIER:u}=r(65),{ChainId:c,numbers:l}=r(27),h={[c.BSC]:"https://api.thegraph.com/subgraphs/name/dan1kov/bsc-tornado-pool-subgraph",[c.MAINNET]:"https://tornadocash-rpc.com/subgraphs/name/tornadocash/mainnet-tornado-pool-subgraph",[c.XDAI]:"https://tornadocash-rpc.com/subgraphs/name/tornadocash/gnosis-tornado-nova-subgraph"},f=new i({uri:t=>{const{chainId:e}=t.getContext();return h[e]},cache:new o});async function d({fromBlock:t,chainId:e}){const{data:r}=await f.query({context:{chainId:e},query:s(a),variables:{first:1e3,fromBlock:t}});return r?{results:r.commitments,lastSyncBlock:r._meta.block.number}:{results:[],lastSyncBlock:r._meta.block.number}}async function p({fromBlock:t,chainId:e}){const{data:r}=await f.query({context:{chainId:e},query:s(u),variables:{first:1e3,fromBlock:t}});return r?{results:r.nullifiers,lastSyncBlock:r._meta.block.number}:{results:[],lastSyncBlock:r._meta.block.number}}t.exports={getAllCommitments:async function({fromBlock:t,chainId:e}){try{let r,i=[];for(;;){let{results:o,lastSyncBlock:s}=await d({fromBlock:t,chainId:e});if(r=s,n(o))break;if(o.length<900){i=i.concat(o);break}const[a]=o.slice(-l.ONE);o=o.filter(t=>t.blockNumber!==a.blockNumber),t=Number(a.blockNumber),i=i.concat(o)}if(!i)return{lastSyncBlock:r,events:[]};const o=i.map(t=>({index:Number(t.index),commitment:t.commitment,blockNumber:Number(t.blockNumber),encryptedOutput:t.encryptedOutput,transactionHash:t.transactionHash})),[s]=o.slice(-l.ONE);return{events:o,lastSyncBlock:s&&s.blockNumber>r?s.blockNumber+l.ONE:r}}catch(t){return console.log("Error from getAllCommitments"),console.log(t),{lastSyncBlock:"",events:[]}}},getAllNullifiers:async function({fromBlock:t,chainId:e}){try{let r,i=[];for(;;){let{results:o,lastSyncBlock:s}=await p({fromBlock:t,chainId:e});if(r=s,n(o))break;if(o.length<900){i=i.concat(o);break}const[a]=o.slice(-l.ONE);o=o.filter(t=>t.blockNumber!==a.blockNumber),t=Number(a.blockNumber),i=i.concat(o)}if(!i)return{lastSyncBlock:r,events:[]};const o=i.map(t=>({nullifier:t.nullifier,blockNumber:Number(t.blockNumber),transactionHash:t.transactionHash})),[s]=o.slice(-l.ONE);return{events:o,lastSyncBlock:s&&s.blockNumber>r?s.blockNumber+l.ONE:r}}catch(t){return console.log("Error from getAllNullifiers"),console.log(t),{lastSyncBlock:"",events:[]}}}}},function(t,e){t.exports={GET_COMMITMENT:"\n query getCommitment($first: Int, $fromBlock: Int) {\n commitments(first: $first, orderBy: blockNumber, orderDirection: asc, where: {\n blockNumber_gte: $fromBlock\n }) {\n index\n commitment\n blockNumber\n encryptedOutput\n transactionHash\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n",GET_NULLIFIER:"\n query getNullifier($first: Int, $fromBlock: Int) {\n nullifiers(first: $first, orderBy: blockNumber, orderDirection: asc, where: {\n blockNumber_gte: $fromBlock\n }) {\n nullifier\n blockNumber\n transactionHash\n }\n _meta {\n block {\n number\n }\n hasIndexingErrors\n }\n }\n"}},function(t,e,r){const{ethers:n}=r(39),{fetchJson:i}=r(5),{numbers:o}=r(27);class s extends n.providers.StaticJsonRpcProvider{constructor(t,e,r){super(t,e),this.fallbackRpcs=r}async send(t,e,r=0){try{return await super.send(t,e)}catch(n){if(!r){const n=3e3;return await this.sleep(n),this.fallbackRpcs?await this.fallbackSend(t,e,this.fallbackRpcs):this.send(t,e,++r)}throw n}}async fallbackSend(t,e,r,n=0){try{const s={method:t,params:e,id:this._nextId+o.ONE,jsonrpc:"2.0"},a=i({url:r[n]},JSON.stringify(s),(function(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result})).then(t=>t,t=>{throw t});return await a}catch(i){if(r[n+=o.ONE])return await this.fallbackSend(t,e,r,n);throw i}}async sleep(t){return await new Promise(e=>setTimeout(e,t))}}t.exports={ExtendedProvider:s}},function(t,e){t.exports={poolAbi:[{inputs:[{internalType:"contract IVerifier",name:"_verifier2",type:"address"},{internalType:"contract IVerifier",name:"_verifier16",type:"address"},{internalType:"uint32",name:"_levels",type:"uint32"},{internalType:"address",name:"_hasher",type:"address"},{internalType:"contract IERC6777",name:"_token",type:"address"},{internalType:"address",name:"_omniBridge",type:"address"},{internalType:"address",name:"_l1Unwrapper",type:"address"},{internalType:"address",name:"_governance",type:"address"},{internalType:"uint256",name:"_l1ChainId",type:"uint256"},{internalType:"address",name:"_multisig",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"commitment",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"},{indexed:!1,internalType:"bytes",name:"encryptedOutput",type:"bytes"}],name:"NewCommitment",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"nullifier",type:"bytes32"}],name:"NewNullifier",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!1,internalType:"bytes",name:"key",type:"bytes"}],name:"PublicKey",type:"event"},{inputs:[],name:"FIELD_SIZE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_EXT_AMOUNT",outputs:[{internalType:"int256",name:"",type:"int256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MAX_FEE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"MIN_EXT_AMOUNT_LIMIT",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ROOT_HISTORY_SIZE",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"ZERO_VALUE",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ambBridge",outputs:[{internalType:"contract IAMB",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"int256",name:"_extAmount",type:"int256"},{internalType:"uint256",name:"_fee",type:"uint256"}],name:"calculatePublicAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"_minimalWithdrawalAmount",type:"uint256"},{internalType:"uint256",name:"_maximumDepositAmount",type:"uint256"}],name:"configureLimits",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"currentRootIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"filledSubtrees",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastRoot",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_left",type:"bytes32"},{internalType:"bytes32",name:"_right",type:"bytes32"}],name:"hashLeftRight",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"hasher",outputs:[{internalType:"contract IHasher",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_minimalWithdrawalAmount",type:"uint256"},{internalType:"uint256",name:"_maximumDepositAmount",type:"uint256"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"isCalledByOwner",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"_root",type:"bytes32"}],name:"isKnownRoot",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"_nullifierHash",type:"bytes32"}],name:"isSpent",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"l1Unwrapper",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"lastBalance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"levels",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[],name:"maximumDepositAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"minimalWithdrawalAmount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"multisig",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"nextIndex",outputs:[{internalType:"uint32",name:"",type:"uint32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"nullifierHashes",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"omniBridge",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IERC6777",name:"_token",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"onTokenBridged",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"proof",type:"bytes"},{internalType:"bytes32",name:"root",type:"bytes32"},{internalType:"bytes32[]",name:"inputNullifiers",type:"bytes32[]"},{internalType:"bytes32[2]",name:"outputCommitments",type:"bytes32[2]"},{internalType:"uint256",name:"publicAmount",type:"uint256"},{internalType:"bytes32",name:"extDataHash",type:"bytes32"}],internalType:"struct TornadoPool.Proof",name:"_args",type:"tuple"},{components:[{internalType:"address",name:"recipient",type:"address"},{internalType:"int256",name:"extAmount",type:"int256"},{internalType:"address",name:"relayer",type:"address"},{internalType:"uint256",name:"fee",type:"uint256"},{internalType:"bytes",name:"encryptedOutput1",type:"bytes"},{internalType:"bytes",name:"encryptedOutput2",type:"bytes"},{internalType:"bool",name:"isL1Withdrawal",type:"bool"},{internalType:"uint256",name:"l1Fee",type:"uint256"}],internalType:"struct TornadoPool.ExtData",name:"_extData",type:"tuple"}],name:"onTransact",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"ownerChainId",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"owner",type:"address"},{internalType:"bytes",name:"publicKey",type:"bytes"}],internalType:"struct TornadoPool.Account",name:"_account",type:"tuple"}],name:"register",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"owner",type:"address"},{internalType:"bytes",name:"publicKey",type:"bytes"}],internalType:"struct TornadoPool.Account",name:"_account",type:"tuple"},{components:[{internalType:"bytes",name:"proof",type:"bytes"},{internalType:"bytes32",name:"root",type:"bytes32"},{internalType:"bytes32[]",name:"inputNullifiers",type:"bytes32[]"},{internalType:"bytes32[2]",name:"outputCommitments",type:"bytes32[2]"},{internalType:"uint256",name:"publicAmount",type:"uint256"},{internalType:"bytes32",name:"extDataHash",type:"bytes32"}],internalType:"struct TornadoPool.Proof",name:"_proofArgs",type:"tuple"},{components:[{internalType:"address",name:"recipient",type:"address"},{internalType:"int256",name:"extAmount",type:"int256"},{internalType:"address",name:"relayer",type:"address"},{internalType:"uint256",name:"fee",type:"uint256"},{internalType:"bytes",name:"encryptedOutput1",type:"bytes"},{internalType:"bytes",name:"encryptedOutput2",type:"bytes"},{internalType:"bool",name:"isL1Withdrawal",type:"bool"},{internalType:"uint256",name:"l1Fee",type:"uint256"}],internalType:"struct TornadoPool.ExtData",name:"_extData",type:"tuple"}],name:"registerAndTransact",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"contract IERC6777",name:"_token",type:"address"},{internalType:"address payable",name:"_to",type:"address"},{internalType:"uint256",name:"_balance",type:"uint256"}],name:"rescueTokens",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"roots",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"token",outputs:[{internalType:"contract IERC6777",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"proof",type:"bytes"},{internalType:"bytes32",name:"root",type:"bytes32"},{internalType:"bytes32[]",name:"inputNullifiers",type:"bytes32[]"},{internalType:"bytes32[2]",name:"outputCommitments",type:"bytes32[2]"},{internalType:"uint256",name:"publicAmount",type:"uint256"},{internalType:"bytes32",name:"extDataHash",type:"bytes32"}],internalType:"struct TornadoPool.Proof",name:"_args",type:"tuple"},{components:[{internalType:"address",name:"recipient",type:"address"},{internalType:"int256",name:"extAmount",type:"int256"},{internalType:"address",name:"relayer",type:"address"},{internalType:"uint256",name:"fee",type:"uint256"},{internalType:"bytes",name:"encryptedOutput1",type:"bytes"},{internalType:"bytes",name:"encryptedOutput2",type:"bytes"},{internalType:"bool",name:"isL1Withdrawal",type:"bool"},{internalType:"uint256",name:"l1Fee",type:"uint256"}],internalType:"struct TornadoPool.ExtData",name:"_extData",type:"tuple"}],name:"transact",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"verifier16",outputs:[{internalType:"contract IVerifier",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"verifier2",outputs:[{internalType:"contract IVerifier",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bytes",name:"proof",type:"bytes"},{internalType:"bytes32",name:"root",type:"bytes32"},{internalType:"bytes32[]",name:"inputNullifiers",type:"bytes32[]"},{internalType:"bytes32[2]",name:"outputCommitments",type:"bytes32[2]"},{internalType:"uint256",name:"publicAmount",type:"uint256"},{internalType:"bytes32",name:"extDataHash",type:"bytes32"}],internalType:"struct TornadoPool.Proof",name:"_args",type:"tuple"}],name:"verifyProof",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"i",type:"uint256"}],name:"zeros",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"pure",type:"function"}]}},function(t,e,r){"use strict";r.r(e),r.d(e,"ApolloClient",(function(){return jn})),r.d(e,"mergeOptions",(function(){return In})),r.d(e,"ObservableQuery",(function(){return xr})),r.d(e,"NetworkStatus",(function(){return Er})),r.d(e,"isApolloError",(function(){return $t})),r.d(e,"ApolloError",(function(){return te})),r.d(e,"Cache",(function(){return Pn})),r.d(e,"ApolloCache",(function(){return Cn})),r.d(e,"InMemoryCache",(function(){return Ci})),r.d(e,"MissingFieldError",(function(){return Dn})),r.d(e,"defaultDataIdFromObject",(function(){return qn})),r.d(e,"makeVar",(function(){return _n})),r.d(e,"empty",(function(){return Di})),r.d(e,"from",(function(){return Bi})),r.d(e,"split",(function(){return Fi})),r.d(e,"concat",(function(){return Li})),r.d(e,"execute",(function(){return xt})),r.d(e,"ApolloLink",(function(){return Nt})),r.d(e,"parseAndCheckHttpResponse",(function(){return me})),r.d(e,"serializeFetchParameter",(function(){return Vt})),r.d(e,"fallbackHttpConfig",(function(){return Te})),r.d(e,"defaultPrinter",(function(){return Ne})),r.d(e,"selectHttpOptionsAndBody",(function(){return xe})),r.d(e,"selectHttpOptionsAndBodyInternal",(function(){return Ie})),r.d(e,"checkFetcher",(function(){return ge})),r.d(e,"createSignalIfSupported",(function(){return Re})),r.d(e,"selectURI",(function(){return zt})),r.d(e,"createHttpLink",(function(){return Be})),r.d(e,"HttpLink",(function(){return Fe})),r.d(e,"rewriteURIForGET",(function(){return je})),r.d(e,"fromError",(function(){return Ce})),r.d(e,"toPromise",(function(){return Ui})),r.d(e,"fromPromise",(function(){return qi})),r.d(e,"throwServerError",(function(){return Xt})),r.d(e,"Observable",(function(){return rt})),r.d(e,"isReference",(function(){return ut})),r.d(e,"makeReference",(function(){return at})),r.d(e,"setLogVerbosity",(function(){return f})),r.d(e,"gql",(function(){return Ro})),r.d(e,"resetCaches",(function(){return jo})),r.d(e,"disableFragmentWarnings",(function(){return Co})),r.d(e,"enableExperimentalFragmentVariables",(function(){return Do})),r.d(e,"disableExperimentalFragmentVariables",(function(){return Bo}));var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}Object.create;Object.create;"function"==typeof SuppressedError&&SuppressedError;var o=Object.setPrototypeOf,s=void 0===o?function(t,e){return t.__proto__=e,t}:o,a=function(t){function e(r){void 0===r&&(r="Invariant Violation");var n=t.call(this,"number"==typeof r?"Invariant Violation: "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name="Invariant Violation",s(n,e.prototype),n}return i(e,t),e}(Error);function u(t,e){if(!t)throw new a(e)}var c=["debug","log","warn","error","silent"],l=c.indexOf("log");function h(t){return function(){if(c.indexOf(t)>=l){var e=console[t]||console.log;return e.apply(console,arguments)}}}function f(t){var e=c[l];return l=Math.max(0,c.indexOf(t)),e}!function(t){t.debug=h("debug"),t.log=h("log"),t.warn=h("warn"),t.error=h("error")}(u||(u={}));var d=r(20),p=r(10),m="__",g=[m,m].join("DEV");var v=function(){try{return Boolean(__DEV__)}catch(t){return Object.defineProperty(d.a,g,{value:"production"!==Object(p.a)((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),d.a[g]}}(),y=r(30),b=("function"==typeof Symbol&&null!=Symbol.iterator&&Symbol.iterator,"function"==typeof Symbol&&null!=Symbol.asyncIterator&&Symbol.asyncIterator,"function"==typeof Symbol&&null!=Symbol.toStringTag?Symbol.toStringTag:"@@toStringTag"),w="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):void 0;function _(t){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function E(t){return A(t,[])}function A(t,e){switch(_(t)){case"string":return JSON.stringify(t);case"function":return t.name?"[function ".concat(t.name,"]"):"[function]";case"object":return null===t?"null":function(t,e){if(-1!==e.indexOf(t))return"[Circular]";var r=[].concat(e,[t]),n=function(t){var e=t[String(w)];if("function"==typeof e)return e;if("function"==typeof t.inspect)return t.inspect}(t);if(void 0!==n){var i=n.call(t);if(i!==t)return"string"==typeof i?i:A(i,r)}else if(Array.isArray(t))return function(t,e){if(0===t.length)return"[]";if(e.length>2)return"[Array]";for(var r=Math.min(10,t.length),n=t.length-r,i=[],o=0;o1&&i.push("... ".concat(n," more items"));return"["+i.join(", ")+"]"}(t,r);return function(t,e){var r=Object.keys(t);if(0===r.length)return"{}";if(e.length>2)return"["+function(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if("Object"===e&&"function"==typeof t.constructor){var r=t.constructor.name;if("string"==typeof r&&""!==r)return r}return e}(t)+"]";return"{ "+r.map((function(r){return r+": "+A(t[r],e)})).join(", ")+" }"}(t,r)}(t,e);default:return String(t)}}function O(t,e){if(!Boolean(t))throw new Error(e)}var k=function(t,e){return t instanceof e};function S(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"GraphQL request",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{line:1,column:1};"string"==typeof t||O(0,"Body must be a string. Received: ".concat(E(t),".")),this.body=t,this.name=e,this.locationOffset=r,this.locationOffset.line>0||O(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||O(0,"column in locationOffset is 1-indexed and must be positive.")}var e,r,n;return e=t,(r=[{key:b,get:function(){return"Source"}}])&&S(e.prototype,r),n&&S(e,n),t}();Object(y.a)(),__DEV__?u("boolean"==typeof v,v):u("boolean"==typeof v,39);var T=function(t,e){return(T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(t,e)};function N(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}T(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var x=function(){return(x=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1,i=!1,o=arguments[1],s=o;return new r((function(r){return e.subscribe({next:function(e){var o=!i;if(i=!0,!o||n)try{s=t(s,e)}catch(t){return r.error(t)}else s=e},error:function(t){r.error(t)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(s),r.complete()}})}))},e.concat=function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n=0&&i.splice(t,1),s()}});i.push(o)},error:function(t){n.error(t)},complete:function(){s()}});function s(){o.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(t){return t.unsubscribe()})),o.unsubscribe()}}))},e[z]=function(){return this},t.from=function(e){var r="function"==typeof this?this:t;if(null==e)throw new TypeError(e+" is not an object");var n=K(e,z);if(n){var i=n.call(e);if(Object(i)!==i)throw new TypeError(i+" is not an object");return H(i)&&i.constructor===r?i:new r((function(t){return i.subscribe(t)}))}if(U("iterator")&&(n=K(e,V)))return new r((function(t){J((function(){if(!t.closed){for(var r,i=C(n.call(e));!(r=i()).done;){var o=r.value;if(t.next(o),t.closed)return}t.complete()}}))}));if(Array.isArray(e))return new r((function(t){J((function(){if(!t.closed){for(var r=0;r0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach((function(t){i[t]=e[t]})),"".concat(r.connection.key,"(").concat(ft(i),")")}return r.connection.key}var o=t;if(e){var s=ft(e);o+="(".concat(s,")")}return r&&Object.keys(r).forEach((function(t){-1===lt.indexOf(t)&&(r[t]&&Object.keys(r[t]).length?o+="@".concat(t,"(").concat(ft(r[t]),")"):o+="@".concat(t))})),o}),{setStringify:function(t){var e=ft;return ft=t,e}}),ft=function(t){return JSON.stringify(t,dt)};function dt(t,e){return nt(e)&&!Array.isArray(e)&&(e=Object.keys(e).sort().reduce((function(t,r){return t[r]=e[r],t}),{})),e}function pt(t,e){if(t.arguments&&t.arguments.length){var r={};return t.arguments.forEach((function(t){var n=t.name,i=t.value;return ct(r,n,i,e)})),r}return null}function mt(t){return t.alias?t.alias.value:t.name.value}function gt(t,e,r){for(var n,i=0,o=e.selections;i2&&void 0!==arguments[2]?arguments[2]:Ct,n=void 0,i=Array.isArray(t),o=[t],s=-1,a=[],u=void 0,c=void 0,l=void 0,h=[],f=[],d=t;do{var p=++s===o.length,m=p&&0!==a.length;if(p){if(c=0===f.length?void 0:h[h.length-1],u=l,l=f.pop(),m){if(i)u=u.slice();else{for(var g={},v=0,y=Object.keys(u);v=0}));function Wt(t){var e=null,r=null,n=!1,i=[],o=[];function s(t){if(!r){if(o.length){var e=o.shift();if(Array.isArray(e)&&e[0])return e[0]({value:t,done:!1})}i.push(t)}}function a(t){r=t,o.slice().forEach((function(e){e[1](t)})),!e||e()}function u(){n=!0,o.slice().forEach((function(t){t[0]({value:void 0,done:!0})})),!e||e()}e=function(){e=null,t.removeListener("data",s),t.removeListener("error",a),t.removeListener("end",u),t.removeListener("finish",u),t.removeListener("close",u)},t.on("data",s),t.on("error",a),t.on("end",u),t.on("finish",u),t.on("close",u);var c={next:function(){return new Promise((function(t,e){return r?e(r):i.length?t({value:i.shift(),done:!1}):n?t({value:void 0,done:!0}):void o.push([t,e])}))}};return Ht&&(c[Symbol.asyncIterator]=function(){return this}),c}function Jt(t){var e={next:function(){return t.read()}};return Ht&&(e[Symbol.asyncIterator]=function(){return this}),e}function Yt(t){var e,r,n=t;if(t.body&&(n=t.body),function(t){return!(!Ht||!t[Symbol.asyncIterator])}(n))return r=n[Symbol.asyncIterator](),(e={next:function(){return r.next()}})[Symbol.asyncIterator]=function(){return this},e;if(function(t){return!!t.getReader}(n))return Jt(n.getReader());if(function(t){return!!t.stream}(n))return Jt(n.stream().getReader());if(function(t){return!!t.arrayBuffer}(n))return function(t){var e=!1,r={next:function(){return e?Promise.resolve({value:void 0,done:!0}):(e=!0,new Promise((function(e,r){t.then((function(t){e({value:t,done:!1})})).catch(r)})))}};return Ht&&(r[Symbol.asyncIterator]=function(){return this}),r}(n.arrayBuffer());if(function(t){return!!t.pipe}(n))return Wt(n);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Xt=function(t,e,r){var n=new Error(r);throw n.name="ServerError",n.response=t,n.statusCode=t.status,n.result=e,n},Zt=Symbol();function $t(t){return t.hasOwnProperty("graphQLErrors")}var te=function(t){function e(r){var n,i,o=r.graphQLErrors,s=r.protocolErrors,a=r.clientErrors,u=r.networkError,c=r.errorMessage,l=r.extraInfo,h=t.call(this,c)||this;return h.name="ApolloError",h.graphQLErrors=o||[],h.protocolErrors=s||[],h.clientErrors=a||[],h.networkError=u||null,h.message=c||(i=j(j(j([],(n=h).graphQLErrors,!0),n.clientErrors,!0),n.protocolErrors,!0),n.networkError&&i.push(n.networkError),i.map((function(t){return nt(t)&&t.message||"Error message not found."})).join("\n")),h.extraInfo=l,h.__proto__=e.prototype,h}return N(e,t),e}(Error),ee=Array.isArray;function re(t){return Array.isArray(t)&&t.length>0}var ne=Object.prototype.hasOwnProperty;function ie(){for(var t=[],e=0;e1)for(var n=new ae,i=1;i=0;--o){var s=i[o],a=!isNaN(+s)?[]:{};a[s]=e,e=a}r=n.merge(r,e)})),r}var he=Object.prototype.hasOwnProperty;function fe(t){var e={};return t.split("\n").forEach((function(t){var r=t.indexOf(":");if(r>-1){var n=t.slice(0,r).trim().toLowerCase(),i=t.slice(r+1).trim();e[n]=i}})),e}function de(t,e){if(t.status>=300){Xt(t,function(){try{return JSON.parse(e)}catch(t){return e}}(),"Response not successful: Received status code ".concat(t.status))}try{return JSON.parse(e)}catch(n){var r=n;throw r.name="ServerParseError",r.response=t,r.statusCode=t.status,r.bodyText=e,r}}function pe(t,e){var r,n;"AbortError"!==t.name&&(t.result&&t.result.errors&&t.result.data&&(null===(r=e.next)||void 0===r||r.call(e,t.result)),null===(n=e.error)||void 0===n||n.call(e,t))}function me(t){return function(e){return e.text().then((function(t){return de(e,t)})).then((function(r){return e.status>=300&&Xt(e,r,"Response not successful: Received status code ".concat(e.status)),Array.isArray(r)||he.call(r,"data")||he.call(r,"errors")||Xt(e,r,"Server response was missing for query '".concat(Array.isArray(t)?t.map((function(t){return t.operationName})):t.operationName,"'.")),r}))}}var ge=function(t){if(!t&&"undefined"==typeof fetch)throw __DEV__?new a("\n\"fetch\" has not been found globally and no fetcher has been configured. To fix this, install a fetch package (like https://www.npmjs.com/package/cross-fetch), instantiate the fetcher, and pass it into your HttpLink constructor. For example:\n\nimport fetch from 'cross-fetch';\nimport { ApolloClient, HttpLink } from '@apollo/client';\nconst client = new ApolloClient({\n link: new HttpLink({ uri: '/graphql', fetch })\n});\n "):new a(23)};function ve(t){var e=t.split(/\r\n|[\n\r]/g),r=function(t){for(var e,r=!0,n=!0,i=0,o=null,s=0;si&&ye(e[o-1]);)--o;return e.slice(i,o).join("\n")}function ye(t){for(var e=0;e80&&(a=s+Oe("(\n",ke(Ee(n,"\n")),"\n)")),Ee([a,Ee(i," "),o]," ")},Argument:function(t){return t.name+": "+t.value},FragmentSpread:function(t){return"..."+t.name+Oe(" ",Ee(t.directives," "))},InlineFragment:function(t){var e=t.typeCondition,r=t.directives,n=t.selectionSet;return Ee(["...",Oe("on ",e),Ee(r," "),n]," ")},FragmentDefinition:function(t){var e=t.name,r=t.typeCondition,n=t.variableDefinitions,i=t.directives,o=t.selectionSet;return"fragment ".concat(e).concat(Oe("(",Ee(n,", "),")")," ")+"on ".concat(r," ").concat(Oe("",Ee(i," ")," "))+o},IntValue:function(t){return t.value},FloatValue:function(t){return t.value},StringValue:function(t,e){var r=t.value;return t.block?function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=-1===t.indexOf("\n"),i=" "===t[0]||"\t"===t[0],o='"'===t[t.length-1],s="\\"===t[t.length-1],a=!n||o||s||r,u="";return!a||n&&i||(u+="\n"+e),u+=e?t.replace(/\n/g,"\n"+e):t,a&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}(r,"description"===e?"":" "):JSON.stringify(r)},BooleanValue:function(t){return t.value?"true":"false"},NullValue:function(){return"null"},EnumValue:function(t){return t.value},ListValue:function(t){return"["+Ee(t.values,", ")+"]"},ObjectValue:function(t){return"{"+Ee(t.fields,", ")+"}"},ObjectField:function(t){return t.name+": "+t.value},Directive:function(t){return"@"+t.name+Oe("(",Ee(t.arguments,", "),")")},NamedType:function(t){return t.name},ListType:function(t){return"["+t.type+"]"},NonNullType:function(t){return t.type+"!"},SchemaDefinition:_e((function(t){var e=t.directives,r=t.operationTypes;return Ee(["schema",Ee(e," "),Ae(r)]," ")})),OperationTypeDefinition:function(t){return t.operation+": "+t.type},ScalarTypeDefinition:_e((function(t){return Ee(["scalar",t.name,Ee(t.directives," ")]," ")})),ObjectTypeDefinition:_e((function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return Ee(["type",e,Oe("implements ",Ee(r," & ")),Ee(n," "),Ae(i)]," ")})),FieldDefinition:_e((function(t){var e=t.name,r=t.arguments,n=t.type,i=t.directives;return e+(Me(r)?Oe("(\n",ke(Ee(r,"\n")),"\n)"):Oe("(",Ee(r,", "),")"))+": "+n+Oe(" ",Ee(i," "))})),InputValueDefinition:_e((function(t){var e=t.name,r=t.type,n=t.defaultValue,i=t.directives;return Ee([e+": "+r,Oe("= ",n),Ee(i," ")]," ")})),InterfaceTypeDefinition:_e((function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return Ee(["interface",e,Oe("implements ",Ee(r," & ")),Ee(n," "),Ae(i)]," ")})),UnionTypeDefinition:_e((function(t){var e=t.name,r=t.directives,n=t.types;return Ee(["union",e,Ee(r," "),n&&0!==n.length?"= "+Ee(n," | "):""]," ")})),EnumTypeDefinition:_e((function(t){var e=t.name,r=t.directives,n=t.values;return Ee(["enum",e,Ee(r," "),Ae(n)]," ")})),EnumValueDefinition:_e((function(t){return Ee([t.name,Ee(t.directives," ")]," ")})),InputObjectTypeDefinition:_e((function(t){var e=t.name,r=t.directives,n=t.fields;return Ee(["input",e,Ee(r," "),Ae(n)]," ")})),DirectiveDefinition:_e((function(t){var e=t.name,r=t.arguments,n=t.repeatable,i=t.locations;return"directive @"+e+(Me(r)?Oe("(\n",ke(Ee(r,"\n")),"\n)"):Oe("(",Ee(r,", "),")"))+(n?" repeatable":"")+" on "+Ee(i," | ")})),SchemaExtension:function(t){var e=t.directives,r=t.operationTypes;return Ee(["extend schema",Ee(e," "),Ae(r)]," ")},ScalarTypeExtension:function(t){return Ee(["extend scalar",t.name,Ee(t.directives," ")]," ")},ObjectTypeExtension:function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return Ee(["extend type",e,Oe("implements ",Ee(r," & ")),Ee(n," "),Ae(i)]," ")},InterfaceTypeExtension:function(t){var e=t.name,r=t.interfaces,n=t.directives,i=t.fields;return Ee(["extend interface",e,Oe("implements ",Ee(r," & ")),Ee(n," "),Ae(i)]," ")},UnionTypeExtension:function(t){var e=t.name,r=t.directives,n=t.types;return Ee(["extend union",e,Ee(r," "),n&&0!==n.length?"= "+Ee(n," | "):""]," ")},EnumTypeExtension:function(t){var e=t.name,r=t.directives,n=t.values;return Ee(["extend enum",e,Ee(r," "),Ae(n)]," ")},InputObjectTypeExtension:function(t){var e=t.name,r=t.directives,n=t.fields;return Ee(["extend input",e,Ee(r," "),Ae(n)]," ")}};function _e(t){return function(e){return Ee([e.description,t(e)],"\n")}}function Ee(t){var e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return null!==(e=null==t?void 0:t.filter((function(t){return t})).join(r))&&void 0!==e?e:""}function Ae(t){return Oe("{\n",ke(Ee(t,"\n")),"\n}")}function Oe(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return null!=e&&""!==e?t+e+r:""}function ke(t){return Oe(" ",t.replace(/\n/g,"\n "))}function Se(t){return-1!==t.indexOf("\n")}function Me(t){return null!=t&&t.some(Se)}var Te={http:{includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},headers:{accept:"*/*","content-type":"application/json"},options:{method:"POST"}},Ne=function(t,e){return e(t)};function xe(t,e){for(var r=[],n=2;n-1;){if(w=void 0,M=[h.slice(0,b),h.slice(b+l.length)],h=M[1],_=(w=M[0]).indexOf("\r\n\r\n"),E=fe(w.slice(0,_)),(A=E["content-type"])&&-1===A.toLowerCase().indexOf("application/json"))throw new Error("Unsupported patch content type: application/json is required.");if(O=w.slice(_))try{k=de(t,O),Object.keys(k).length>1||"data"in k||"incremental"in k||"errors"in k||"payload"in k?ce(k)?(S={},"payload"in k&&(S=x({},k.payload)),"errors"in k&&(S=x(x({},S),{extensions:x(x({},"extensions"in S?S.extensions:null),(T={},T[Zt]=k.errors,T))})),null===(n=e.next)||void 0===n||n.call(e,S)):null===(i=e.next)||void 0===i||i.call(e,k):1===Object.keys(k).length&&"hasNext"in k&&!k.hasNext&&(null===(o=e.complete)||void 0===o||o.call(e))}catch(t){pe(t,e)}b=h.indexOf(l)}return[3,1];case 3:return null===(s=e.complete)||void 0===s||s.call(e),[2]}}))}))}(e,r):function(t,e,r){me(e)(t).then((function(t){var e,n;null===(e=r.next)||void 0===e||e.call(r,t),null===(n=r.complete)||void 0===n||n.call(r)})).catch((function(t){return pe(t,r)}))}(e,t,r)})).catch((function(t){return pe(t,r)})),function(){m&&m.abort()}}))}))},Fe=function(t){function e(e){void 0===e&&(e={});var r=t.call(this,Be(e).request)||this;return r.options=e,r}return N(e,t),e}(Nt);const{toString:Le,hasOwnProperty:Ue}=Object.prototype,qe=Function.prototype.toString,Ve=new Map;function ze(t,e){try{return function t(e,r){if(e===r)return!0;const n=Le.call(e),i=Le.call(r);if(n!==i)return!1;switch(n){case"[object Array]":if(e.length!==r.length)return!1;case"[object Object]":{if(He(e,r))return!0;const n=Ge(e),i=Ge(r),o=n.length;if(o!==i.length)return!1;for(let t=0;t=0&&t.indexOf(e,r)===r}(t,Qe)}}return!1}(t,e)}finally{Ve.clear()}}function Ge(t){return Object.keys(t).filter(Ke,t)}function Ke(t){return void 0!==this[t]}const Qe="{ [native code] }";function He(t,e){let r=Ve.get(t);if(r){if(r.has(e))return!0}else Ve.set(t,r=new Set);return r.add(e),!1}const We=()=>Object.create(null),{forEach:Je,slice:Ye}=Array.prototype,{hasOwnProperty:Xe}=Object.prototype;class Ze{constructor(t=!0,e=We){this.weakness=t,this.makeData=e}lookup(...t){return this.lookupArray(t)}lookupArray(t){let e=this;return Je.call(t,t=>e=e.getChildTrie(t)),Xe.call(e,"data")?e.data:e.data=this.makeData(Ye.call(t))}peek(...t){return this.peekArray(t)}peekArray(t){let e=this;for(let r=0,n=t.length;e&&r=0;--s)e.definitions[s].kind===ur.OPERATION_DEFINITION&&++o;var a=hr(t),c=t.some((function(t){return t.remove})),l=function(t){return c&&t&&t.some(a)},h=new Map,f=!1,d={enter:function(t){if(l(t.directives))return f=!0,null}},p=Bt(e,{Field:d,InlineFragment:d,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(t,e,r,n,o){var s=i(o);s&&s.variables.add(t.name.value)}},FragmentSpread:{enter:function(t,e,r,n,o){if(l(t.directives))return f=!0,null;var s=i(o);s&&s.fragmentSpreads.add(t.name.value)}},FragmentDefinition:{enter:function(t,e,r,n){h.set(JSON.stringify(n),t)},leave:function(t,e,r,i){return t===h.get(JSON.stringify(i))?t:o>0&&t.selectionSet.selections.every((function(t){return t.kind===ur.FIELD&&"__typename"===t.name.value}))?(n(t.name.value).removed=!0,f=!0,null):void 0}},Directive:{leave:function(t){if(a(t))return f=!0,null}}});if(!f)return e;var m=function(t){return t.transitiveVars||(t.transitiveVars=new Set(t.variables),t.removed||t.fragmentSpreads.forEach((function(e){m(n(e)).transitiveVars.forEach((function(e){t.transitiveVars.add(e)}))}))),t},g=new Set;p.definitions.forEach((function(t){t.kind===ur.OPERATION_DEFINITION?m(r(t.name&&t.name.value)).fragmentSpreads.forEach((function(t){g.add(t)})):t.kind!==ur.FRAGMENT_DEFINITION||0!==o||n(t.name.value).removed||g.add(t.name.value)})),g.forEach((function(t){m(n(t)).fragmentSpreads.forEach((function(t){g.add(t)}))}));var v={enter:function(t){if(e=t.name.value,!g.has(e)||n(e).removed)return null;var e}};return lr(Bt(p,{FragmentSpread:v,FragmentDefinition:v,OperationDefinition:{leave:function(t){if(t.variableDefinitions){var e=m(r(t.name&&t.name.value)).transitiveVars;if(e.size0},e.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(t){return t.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},e}(rt);function Ir(t){var e=t.options,r=e.fetchPolicy,n=e.nextFetchPolicy;return"cache-and-network"===r||"network-only"===r?t.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=n,"function"==typeof n?n.apply(this,arguments):r}}):t.reobserve()}function Pr(t){__DEV__&&u.error("Unhandled error",t.message,t.stack)}function Rr(t){__DEV__&&t&&__DEV__&&u.debug("Missing cache result fields: ".concat(JSON.stringify(t)),t)}function jr(t){return t.kind===ur.FIELD||t.kind===ur.FRAGMENT_SPREAD||t.kind===ur.INLINE_FRAGMENT}wr(xr);var Cr=function(){return Object.create(null)},Dr=Array.prototype,Br=Dr.forEach,Fr=Dr.slice,Lr=function(){function t(t,e){void 0===t&&(t=!0),void 0===e&&(e=Cr),this.weakness=t,this.makeData=e}return t.prototype.lookup=function(){for(var t=[],e=0;ethis.max;)this.delete(this.oldest.key)},t.prototype.delete=function(t){var e=this.map.get(t);return!!e&&(e===this.newest&&(this.newest=e.older),e===this.oldest&&(this.oldest=e.newer),e.newer&&(e.newer.older=e.older),e.older&&(e.older.newer=e.newer),this.map.delete(t),this.dispose(e.value,t),!0)},t}(),Qr=new Ur.a,Hr=Object.prototype.hasOwnProperty,Wr=void 0===(Gr=Array.from)?function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e}:Gr;function Jr(t){var e=t.unsubscribe;"function"==typeof e&&(t.unsubscribe=void 0,e())}var Yr=[];function Xr(t,e){if(!t)throw new Error(e||"assertion failure")}function Zr(t){switch(t.length){case 0:throw new Error("unknown value");case 1:return t[0];case 2:throw t[1]}}var $r=function(){function t(e){this.fn=e,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++t.count}return t.prototype.peek=function(){if(1===this.value.length&&!rn(this))return tn(this),this.value[0]},t.prototype.recompute=function(t){return Xr(!this.recomputing,"already recomputing"),tn(this),rn(this)?function(t,e){ln(t),Qr.withValue(t,en,[t,e]),function(t,e){if("function"==typeof t.subscribe)try{Jr(t),t.unsubscribe=t.subscribe.apply(null,e)}catch(e){return t.setDirty(),!1}return!0}(t,e)&&function(t){if(t.dirty=!1,rn(t))return;on(t)}(t);return Zr(t.value)}(this,t):Zr(this.value)},t.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,nn(this),Jr(this))},t.prototype.dispose=function(){var t=this;this.setDirty(),ln(this),sn(this,(function(e,r){e.setDirty(),hn(e,t)}))},t.prototype.forget=function(){this.dispose()},t.prototype.dependOn=function(t){t.add(this),this.deps||(this.deps=Yr.pop()||new Set),this.deps.add(t)},t.prototype.forgetDeps=function(){var t=this;this.deps&&(Wr(this.deps).forEach((function(e){return e.delete(t)})),this.deps.clear(),Yr.push(this.deps),this.deps=null)},t.count=0,t}();function tn(t){var e=Qr.getValue();if(e)return t.parents.add(e),e.childValues.has(t)||e.childValues.set(t,[]),rn(t)?an(e,t):un(e,t),e}function en(t,e){t.recomputing=!0,t.value.length=0;try{t.value[0]=t.fn.apply(null,e)}catch(e){t.value[1]=e}t.recomputing=!1}function rn(t){return t.dirty||!(!t.dirtyChildren||!t.dirtyChildren.size)}function nn(t){sn(t,an)}function on(t){sn(t,un)}function sn(t,e){var r=t.parents.size;if(r)for(var n=Wr(t.parents),i=0;i0&&i===n.length&&r[i-1]===n[i-1]||t.setDirty()),cn(t,e),rn(t)||on(t)}function cn(t,e){var r=t.dirtyChildren;r&&(r.delete(e),0===r.size&&(Yr.length<100&&Yr.push(r),t.dirtyChildren=null))}function ln(t){t.childValues.size>0&&t.childValues.forEach((function(e,r){hn(t,r)})),t.forgetDeps(),Xr(null===t.dirtyChildren)}function hn(t,e){e.parents.delete(t),t.childValues.delete(e),cn(t,e)}var fn={setDirty:!0,dispose:!0,forget:!0};function dn(t){var e=new Map,r=t&&t.subscribe;function n(t){var n=Qr.getValue();if(n){var i=e.get(t);i||e.set(t,i=new Set),n.dependOn(i),"function"==typeof r&&(Jr(i),i.unsubscribe=r(t))}}return n.dirty=function(t,r){var n=e.get(t);if(n){var i=r&&Hr.call(fn,r)?r:"setDirty";Wr(n).forEach((function(t){return t[i]()})),e.delete(t),Jr(n)}},n}function pn(){var t=new Lr("function"==typeof WeakMap);return function(){return t.lookupArray(arguments)}}pn();var mn=new Set;function gn(t,e){void 0===e&&(e=Object.create(null));var r=new Kr(e.max||Math.pow(2,16),(function(t){return t.dispose()})),n=e.keyArgs,i=e.makeCacheKey||pn(),o=function(){var o=i.apply(null,n?n.apply(null,arguments):arguments);if(void 0===o)return t.apply(null,arguments);var s=r.get(o);s||(r.set(o,s=new $r(t)),s.subscribe=e.subscribe,s.forget=function(){return r.delete(o)});var a=s.recompute(Array.prototype.slice.call(arguments));return r.set(o,s),mn.add(r),Qr.hasValue()||(mn.forEach((function(t){return t.clean()})),mn.clear()),a};function s(t){var e=r.get(t);e&&e.setDirty()}function a(t){var e=r.get(t);if(e)return e.peek()}function u(t){return r.delete(t)}return Object.defineProperty(o,"size",{get:function(){return r.map.size},configurable:!1,enumerable:!1}),o.dirtyKey=s,o.dirty=function(){s(i.apply(null,arguments))},o.peekKey=a,o.peek=function(){return a(i.apply(null,arguments))},o.forgetKey=u,o.forget=function(){return u(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=n?function(){return i.apply(null,n.apply(null,arguments))}:i,Object.freeze(o)}var vn=new Ur.a,yn=new WeakMap;function bn(t){var e=yn.get(t);return e||yn.set(t,e={vars:new Set,dep:dn()}),e}function wn(t){bn(t).vars.forEach((function(e){return e.forgetCache(t)}))}function _n(t){var e=new Set,r=new Set,n=function(o){if(arguments.length>0){if(t!==o){t=o,e.forEach((function(t){bn(t).dep.dirty(n),En(t)}));var s=Array.from(r);r.clear(),s.forEach((function(e){return e(t)}))}}else{var a=vn.getValue();a&&(i(a),bn(a).dep(n))}return t};n.onNextChange=function(t){return r.add(t),function(){r.delete(t)}};var i=n.attachCache=function(t){return e.add(t),bn(t).vars.add(n),n};return n.forgetCache=function(t){return e.delete(t)},n}function En(t){t.broadcastWatches&&t.broadcastWatches()}var An=function(){function t(t){var e=t.cache,r=t.client,n=t.resolvers,i=t.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=e,r&&(this.client=r),n&&this.addResolvers(n),i&&this.setFragmentMatcher(i)}return t.prototype.addResolvers=function(t){var e=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach((function(t){e.resolvers=ie(e.resolvers,t)})):this.resolvers=ie(this.resolvers,t)},t.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(t){var e=t.document,r=t.remoteResult,n=t.context,i=t.variables,o=t.onlyRunForcedResolvers,s=void 0!==o&&o;return P(this,void 0,void 0,(function(){return R(this,(function(t){return e?[2,this.resolveDocument(e,r.data,n,i,this.fragmentMatcher,s).then((function(t){return x(x({},r),{data:t.result})}))]:[2,r]}))}))},t.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(t){return Ut(["client"],t)&&this.resolvers?t:null},t.prototype.serverQuery=function(t){return function(t){return yt(t),dr([{test:function(t){return"client"===t.name.value},remove:!0}],t)}(t)},t.prototype.prepareContext=function(t){var e=this.cache;return x(x({},t),{cache:e,getCacheKey:function(t){return e.identify(t)}})},t.prototype.addExportedVariables=function(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),P(this,void 0,void 0,(function(){return R(this,(function(n){return t?[2,this.resolveDocument(t,this.buildRootValueFromCache(t,e)||{},this.prepareContext(r),e).then((function(t){return x(x({},e),t.exportedVariables)}))]:[2,x({},e)]}))}))},t.prototype.shouldForceResolvers=function(t){var e=!1;return Bt(t,{Directive:{enter:function(t){if("client"===t.name.value&&t.arguments&&(e=t.arguments.some((function(t){return"always"===t.name.value&&"BooleanValue"===t.value.kind&&!0===t.value.value}))))return Dt}}}),e},t.prototype.buildRootValueFromCache=function(t,e){return this.cache.diff({query:gr(t),variables:e,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(t,e,r,n,i,o){return void 0===r&&(r={}),void 0===n&&(n={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),P(this,void 0,void 0,(function(){var s,a,u,c,l,h,f,d,p,m;return R(this,(function(g){return s=At(t),a=_t(t),u=ot(a),c=this.collectSelectionsToResolve(s,u),l=s.operation,h=l?l.charAt(0).toUpperCase()+l.slice(1):"Query",d=(f=this).cache,p=f.client,m={fragmentMap:u,context:x(x({},r),{cache:d,client:p}),variables:n,fragmentMatcher:i,defaultOperationType:h,exportedVariables:{},selectionsToResolve:c,onlyRunForcedResolvers:o},!1,[2,this.resolveSelectionSet(s.selectionSet,!1,e,m).then((function(t){return{result:t,exportedVariables:m.exportedVariables}}))]}))}))},t.prototype.resolveSelectionSet=function(t,e,r,n){return P(this,void 0,void 0,(function(){var i,o,s,a,c,l=this;return R(this,(function(h){return i=n.fragmentMap,o=n.context,s=n.variables,a=[r],c=function(t){return P(l,void 0,void 0,(function(){var c,l;return R(this,(function(h){return(e||n.selectionsToResolve.has(t))&&Lt(t,s)?vt(t)?[2,this.resolveField(t,e,r,n).then((function(e){var r;void 0!==e&&a.push(((r={})[mt(t)]=e,r))}))]:(!function(t){return"InlineFragment"===t.kind}(t)?(c=i[t.name.value],__DEV__?u(c,"No fragment named ".concat(t.name.value)):u(c,11)):c=t,c&&c.typeCondition&&(l=c.typeCondition.name.value,n.fragmentMatcher(r,l,o))?[2,this.resolveSelectionSet(c.selectionSet,e,r,n).then((function(t){a.push(t)}))]:[2]):[2]}))}))},[2,Promise.all(t.selections.map(c)).then((function(){return oe(a)}))]}))}))},t.prototype.resolveField=function(t,e,r,n){return P(this,void 0,void 0,(function(){var i,o,s,a,u,c,l,h,f,d=this;return R(this,(function(p){return r?(i=n.variables,o=t.name.value,s=mt(t),a=o!==s,u=r[s]||r[o],c=Promise.resolve(u),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(t)||(l=r.__typename||n.defaultOperationType,(h=this.resolvers&&this.resolvers[l])&&(f=h[a?o:s])&&(c=Promise.resolve(vn.withValue(this.cache,f,[r,pt(t,i),n.context,{field:t,fragmentMap:n.fragmentMap}])))),[2,c.then((function(r){var i,o;if(void 0===r&&(r=u),t.directives&&t.directives.forEach((function(t){"export"===t.name.value&&t.arguments&&t.arguments.forEach((function(t){"as"===t.name.value&&"StringValue"===t.value.kind&&(n.exportedVariables[t.value.value]=r)}))})),!t.selectionSet)return r;if(null==r)return r;var s=null!==(o=null===(i=t.directives)||void 0===i?void 0:i.some((function(t){return"client"===t.name.value})))&&void 0!==o&&o;return Array.isArray(r)?d.resolveSubSelectedArray(t,e||s,r,n):t.selectionSet?d.resolveSelectionSet(t.selectionSet,e||s,r,n):void 0}))]):[2,null]}))}))},t.prototype.resolveSubSelectedArray=function(t,e,r,n){var i=this;return Promise.all(r.map((function(r){return null===r?null:Array.isArray(r)?i.resolveSubSelectedArray(t,e,r,n):t.selectionSet?i.resolveSelectionSet(t.selectionSet,e,r,n):void 0})))},t.prototype.collectSelectionsToResolve=function(t,e){var r=function(t){return!Array.isArray(t)},n=this.selectionsToResolveCache;return function t(i){if(!n.has(i)){var o=new Set;n.set(i,o),Bt(i,{Directive:function(t,e,n,i,s){"client"===t.name.value&&s.forEach((function(t){r(t)&&jr(t)&&o.add(t)}))},FragmentSpread:function(n,i,s,a,c){var l=e[n.name.value];__DEV__?u(l,"No fragment named ".concat(n.name.value)):u(l,12);var h=t(l);h.size>0&&(c.forEach((function(t){r(t)&&jr(t)&&o.add(t)})),o.add(n),h.forEach((function(t){o.add(t)})))}})}return n.get(i)}(t)},t}(),On=new(Gt?WeakMap:Map);function kn(t,e){var r=t[e];"function"==typeof r&&(t[e]=function(){return On.set(t,(On.get(t)+1)%1e15),r.apply(this,arguments)})}function Sn(t){t.notifyTimeout&&(clearTimeout(t.notifyTimeout),t.notifyTimeout=void 0)}var Mn=function(){function t(t,e){void 0===e&&(e=t.generateQueryId()),this.queryId=e,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var r=this.cache=t.cache;On.has(r)||(On.set(r,0),kn(r,"evict"),kn(r,"modify"),kn(r,"reset"))}return t.prototype.init=function(t){var e=t.networkStatus||Er.loading;return this.variables&&this.networkStatus!==Er.loading&&!ze(this.variables,t.variables)&&(e=Er.setVariables),ze(t.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:t.document,variables:t.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:e}),t.observableQuery&&this.setObservableQuery(t.observableQuery),t.lastRequestId&&(this.lastRequestId=t.lastRequestId),this},t.prototype.reset=function(){Sn(this),this.dirty=!1},t.prototype.getDiff=function(t){void 0===t&&(t=this.variables);var e=this.getDiffOptions(t);if(this.lastDiff&&ze(e,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=t);var r=this.observableQuery;if(r&&"no-cache"===r.options.fetchPolicy)return{complete:!1};var n=this.cache.diff(e);return this.updateLastDiff(n,e),n},t.prototype.updateLastDiff=function(t,e){this.lastDiff=t?{diff:t,options:e||this.getDiffOptions()}:void 0},t.prototype.getDiffOptions=function(t){var e;return void 0===t&&(t=this.variables),{query:this.document,variables:t,returnPartialData:!0,optimistic:!0,canonizeResults:null===(e=this.observableQuery)||void 0===e?void 0:e.options.canonizeResults}},t.prototype.setDiff=function(t){var e=this,r=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(t),this.dirty||ze(r&&r.result,t&&t.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return e.notify()}),0)))},t.prototype.setObservableQuery=function(t){var e=this;t!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=t,t?(t.queryInfo=this,this.listeners.add(this.oqListener=function(){e.getDiff().fromOptimisticTransaction?t.observe():Ir(t)})):delete this.oqListener)},t.prototype.notify=function(){var t=this;Sn(this),this.shouldNotify()&&this.listeners.forEach((function(e){return e(t)})),this.dirty=!1},t.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(Or(this.networkStatus)&&this.observableQuery){var t=this.observableQuery.options.fetchPolicy;if("cache-only"!==t&&"cache-and-network"!==t)return!1}return!0},t.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=t.prototype.cancel,this.subscriptions.forEach((function(t){return t.unsubscribe()}));var e=this.observableQuery;e&&e.stopPolling()}},t.prototype.cancel=function(){},t.prototype.updateWatch=function(t){var e=this;void 0===t&&(t=this.variables);var r=this.observableQuery;if(!r||"no-cache"!==r.options.fetchPolicy){var n=x(x({},this.getDiffOptions(t)),{watcher:this,callback:function(t){return e.setDiff(t)}});this.lastWatch&&ze(n,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=n))}},t.prototype.resetLastWrite=function(){this.lastWrite=void 0},t.prototype.shouldWrite=function(t,e){var r=this.lastWrite;return!(r&&r.dmCount===On.get(this.cache)&&ze(e,r.variables)&&ze(t.data,r.result.data))},t.prototype.markResult=function(t,e,r,n){var i=this,o=new ae,s=re(t.errors)?t.errors.slice(0):[];if(this.reset(),"incremental"in t&&re(t.incremental)){var a=le(this.getDiff().result,t);t.data=a}else if("hasNext"in t&&t.hasNext){var u=this.getDiff();t.data=o.merge(u.result,t.data)}this.graphQLErrors=s,"no-cache"===r.fetchPolicy?this.updateLastDiff({result:t.data,complete:!0},this.getDiffOptions(r.variables)):0!==n&&(Tn(t,r.errorPolicy)?this.cache.performTransaction((function(o){if(i.shouldWrite(t,r.variables))o.writeQuery({query:e,data:t.data,variables:r.variables,overwrite:1===n}),i.lastWrite={result:t,variables:r.variables,dmCount:On.get(i.cache)};else if(i.lastDiff&&i.lastDiff.diff.complete)return void(t.data=i.lastDiff.diff.result);var s=i.getDiffOptions(r.variables),a=o.diff(s);i.stopped||i.updateWatch(r.variables),i.updateLastDiff(a,s),a.complete&&(t.data=a.result)})):this.lastWrite=void 0)},t.prototype.markReady=function(){return this.networkError=null,this.networkStatus=Er.ready},t.prototype.markError=function(t){return this.networkStatus=Er.error,this.lastWrite=void 0,this.reset(),t.graphQLErrors&&(this.graphQLErrors=t.graphQLErrors),t.networkError&&(this.networkError=t.networkError),t},t}();function Tn(t,e){void 0===e&&(e="none");var r="ignore"===e||"all"===e,n=!sr(t);return!n&&r&&t.data&&(n=!0),n}var Nn=Object.prototype.hasOwnProperty,xn=function(){function t(t){var e=t.cache,r=t.link,n=t.defaultOptions,i=t.queryDeduplication,o=void 0!==i&&i,s=t.onBroadcast,a=t.ssrMode,u=void 0!==a&&a,c=t.clientAwareness,l=void 0===c?{}:c,h=t.localState,f=t.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(Gt?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=e,this.link=r,this.defaultOptions=n||Object.create(null),this.queryDeduplication=o,this.clientAwareness=l,this.localState=h||new An({cache:e}),this.ssrMode=u,this.assumeImmutableResults=!!f,(this.onBroadcast=s)&&(this.mutationStore=Object.create(null))}return t.prototype.stop=function(){var t=this;this.queries.forEach((function(e,r){t.stopQueryNoBroadcast(r)})),this.cancelPendingFetches(__DEV__?new a("QueryManager stopped while query was in flight"):new a(14))},t.prototype.cancelPendingFetches=function(t){this.fetchCancelFns.forEach((function(e){return e(t)})),this.fetchCancelFns.clear()},t.prototype.mutate=function(t){var e,r,n=t.mutation,i=t.variables,o=t.optimisticResponse,s=t.updateQueries,a=t.refetchQueries,c=void 0===a?[]:a,l=t.awaitRefetchQueries,h=void 0!==l&&l,f=t.update,d=t.onQueryUpdated,p=t.fetchPolicy,m=void 0===p?(null===(e=this.defaultOptions.mutate)||void 0===e?void 0:e.fetchPolicy)||"network-only":p,g=t.errorPolicy,v=void 0===g?(null===(r=this.defaultOptions.mutate)||void 0===r?void 0:r.errorPolicy)||"none":g,y=t.keepRootFields,b=t.context;return P(this,void 0,void 0,(function(){var t,e,r,a,l,p;return R(this,(function(g){switch(g.label){case 0:return __DEV__?u(n,"mutation option is required. You must specify your GraphQL document in the mutation option."):u(n,15),__DEV__?u("network-only"===m||"no-cache"===m,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):u("network-only"===m||"no-cache"===m,16),t=this.generateMutationId(),e=this.transform(n),r=e.document,a=e.hasClientExports,n=this.cache.transformForLink(r),i=this.getVariables(n,i),a?[4,this.localState.addExportedVariables(n,i,b)]:[3,2];case 1:i=g.sent(),g.label=2;case 2:return l=this.mutationStore&&(this.mutationStore[t]={mutation:n,variables:i,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:t,document:n,variables:i,fetchPolicy:m,errorPolicy:v,context:b,updateQueries:s,update:f,keepRootFields:y}),this.broadcastQueries(),p=this,[2,new Promise((function(e,r){return or(p.getObservableFromLink(n,x(x({},b),{optimisticResponse:o}),i,!1),(function(e){if(sr(e)&&"none"===v)throw new te({graphQLErrors:ar(e)});l&&(l.loading=!1,l.error=null);var r=x({},e);return"function"==typeof c&&(c=c(r)),"ignore"===v&&sr(r)&&delete r.errors,p.markMutationResult({mutationId:t,result:r,document:n,variables:i,fetchPolicy:m,errorPolicy:v,context:b,update:f,updateQueries:s,awaitRefetchQueries:h,refetchQueries:c,removeOptimistic:o?t:void 0,onQueryUpdated:d,keepRootFields:y})})).subscribe({next:function(t){p.broadcastQueries(),"hasNext"in t&&!1!==t.hasNext||e(t)},error:function(e){l&&(l.loading=!1,l.error=e),o&&p.cache.removeOptimistic(t),p.broadcastQueries(),r(e instanceof te?e:new te({networkError:e}))}})}))]}}))}))},t.prototype.markMutationResult=function(t,e){var r=this;void 0===e&&(e=this.cache);var n=t.result,i=[],o="no-cache"===t.fetchPolicy;if(!o&&Tn(n,t.errorPolicy)){if(ue(n)||i.push({result:n.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),ue(n)&&re(n.incremental)){var s=e.diff({id:"ROOT_MUTATION",query:this.transform(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),a=void 0;s.result&&(a=le(s.result,n)),void 0!==a&&(n.data=a,i.push({result:a,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var u=t.updateQueries;u&&this.queries.forEach((function(t,o){var s=t.observableQuery,a=s&&s.queryName;if(a&&Nn.call(u,a)){var c=u[a],l=r.queries.get(o),h=l.document,f=l.variables,d=e.diff({query:h,variables:f,returnPartialData:!0,optimistic:!1}),p=d.result;if(d.complete&&p){var m=c(p,{mutationResult:n,queryName:h&&wt(h)||void 0,queryVariables:f});m&&i.push({result:m,dataId:"ROOT_QUERY",query:h,variables:f})}}}))}if(i.length>0||t.refetchQueries||t.update||t.onQueryUpdated||t.removeOptimistic){var c=[];if(this.refetchQueries({updateCache:function(e){o||i.forEach((function(t){return e.write(t)}));var s,a=t.update,u=!(ue(s=n)||function(t){return"hasNext"in t&&"data"in t}(s))||ue(n)&&!n.hasNext;if(a){if(!o){var c=e.diff({id:"ROOT_MUTATION",query:r.transform(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});c.complete&&("incremental"in(n=x(x({},n),{data:c.result}))&&delete n.incremental,"hasNext"in n&&delete n.hasNext)}u&&a(e,n,{context:t.context,variables:t.variables})}o||t.keepRootFields||!u||e.modify({id:"ROOT_MUTATION",fields:function(t,e){var r=e.fieldName,n=e.DELETE;return"__typename"===r?t:n}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach((function(t){return c.push(t)})),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(c).then((function(){return n}))}return Promise.resolve(n)},t.prototype.markMutationOptimistic=function(t,e){var r=this,n="function"==typeof t?t(e.variables):t;return this.cache.recordOptimisticTransaction((function(t){try{r.markMutationResult(x(x({},e),{result:{data:n}}),t)}catch(t){__DEV__&&u.error(t)}}),e.mutationId)},t.prototype.fetchQuery=function(t,e,r){return this.fetchQueryObservable(t,e,r).promise},t.prototype.getQueryStore=function(){var t=Object.create(null);return this.queries.forEach((function(e,r){t[r]={variables:e.variables,networkStatus:e.networkStatus,networkError:e.networkError,graphQLErrors:e.graphQLErrors}})),t},t.prototype.resetErrors=function(t){var e=this.queries.get(t);e&&(e.networkError=void 0,e.graphQLErrors=[])},t.prototype.transform=function(t){var e=this.transformCache;if(!e.has(t)){var r=this.cache.transformDocument(t),n=dr([mr],yt(r)),i=this.localState.clientQuery(r),o=n&&this.localState.serverQuery(n),s={document:r,hasClientExports:qt(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:i,serverQuery:o,defaultVars:Ot(bt(r)),asQuery:x(x({},r),{definitions:r.definitions.map((function(t){return"OperationDefinition"===t.kind&&"query"!==t.operation?x(x({},t),{operation:"query"}):t}))})},a=function(t){t&&!e.has(t)&&e.set(t,s)};a(t),a(r),a(i),a(o)}return e.get(t)},t.prototype.getVariables=function(t,e){return x(x({},this.transform(t).defaultVars),e)},t.prototype.watchQuery=function(t){void 0===(t=x(x({},t),{variables:this.getVariables(t.query,t.variables)})).notifyOnNetworkStatusChange&&(t.notifyOnNetworkStatusChange=!1);var e=new Mn(this),r=new xr({queryManager:this,queryInfo:e,options:t});return this.queries.set(r.queryId,e),e.init({document:r.query,observableQuery:r,variables:r.variables}),r},t.prototype.query=function(t,e){var r=this;return void 0===e&&(e=this.generateQueryId()),__DEV__?u(t.query,"query option is required. You must specify your GraphQL document in the query option."):u(t.query,17),__DEV__?u("Document"===t.query.kind,'You must wrap the query string in a "gql" tag.'):u("Document"===t.query.kind,18),__DEV__?u(!t.returnPartialData,"returnPartialData option only supported on watchQuery."):u(!t.returnPartialData,19),__DEV__?u(!t.pollInterval,"pollInterval option only supported on watchQuery."):u(!t.pollInterval,20),this.fetchQuery(e,t).finally((function(){return r.stopQuery(e)}))},t.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},t.prototype.generateRequestId=function(){return this.requestIdCounter++},t.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},t.prototype.stopQueryInStore=function(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(t){var e=this.queries.get(t);e&&e.stop()},t.prototype.clearStore=function(t){return void 0===t&&(t={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new a("Store reset while query was in flight (not completed in link chain)"):new a(21)),this.queries.forEach((function(t){t.observableQuery?t.networkStatus=Er.loading:t.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(t)},t.prototype.getObservableQueries=function(t){var e=this;void 0===t&&(t="active");var r=new Map,n=new Map,i=new Set;return Array.isArray(t)&&t.forEach((function(t){var r;"string"==typeof t?n.set(t,!1):nt(r=t)&&"Document"===r.kind&&Array.isArray(r.definitions)?n.set(e.transform(t).document,!1):nt(t)&&t.query&&i.add(t)})),this.queries.forEach((function(e,i){var o=e.observableQuery,s=e.document;if(o){if("all"===t)return void r.set(i,o);var a=o.queryName;if("standby"===o.options.fetchPolicy||"active"===t&&!o.hasObservers())return;("active"===t||a&&n.has(a)||s&&n.has(s))&&(r.set(i,o),a&&n.set(a,!0),s&&n.set(s,!0))}})),i.size&&i.forEach((function(t){var n=yr("legacyOneTimeQuery"),i=e.getQuery(n).init({document:t.query,variables:t.variables}),o=new xr({queryManager:e,queryInfo:i,options:x(x({},t),{fetchPolicy:"network-only"})});u(o.queryId===n),i.setObservableQuery(o),r.set(n,o)})),__DEV__&&n.size&&n.forEach((function(t,e){t||__DEV__&&u.warn("Unknown query ".concat("string"==typeof e?"named ":"").concat(JSON.stringify(e,null,2)," requested in refetchQueries options.include array"))})),r},t.prototype.reFetchObservableQueries=function(t){var e=this;void 0===t&&(t=!1);var r=[];return this.getObservableQueries(t?"all":"active").forEach((function(n,i){var o=n.options.fetchPolicy;n.resetLastResults(),(t||"standby"!==o&&"cache-only"!==o)&&r.push(n.refetch()),e.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(r)},t.prototype.setObservableQuery=function(t){this.getQuery(t.queryId).setObservableQuery(t)},t.prototype.startGraphQLSubscription=function(t){var e=this,r=t.query,n=t.fetchPolicy,i=t.errorPolicy,o=t.variables,s=t.context,a=void 0===s?{}:s;r=this.transform(r).document,o=this.getVariables(r,o);var u=function(t){return e.getObservableFromLink(r,a,t).map((function(o){"no-cache"!==n&&(Tn(o,i)&&e.cache.write({query:r,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:t}),e.broadcastQueries());var s=sr(o),a=function(t){return!!t.extensions&&Array.isArray(t.extensions[Zt])}(o);if(s||a){var u={};throw s&&(u.graphQLErrors=o.errors),a&&(u.protocolErrors=o.extensions[Zt]),new te(u)}return o}))};if(this.transform(r).hasClientExports){var c=this.localState.addExportedVariables(r,o,a).then(u);return new rt((function(t){var e=null;return c.then((function(r){return e=r.subscribe(t)}),t.error),function(){return e&&e.unsubscribe()}}))}return u(o)},t.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},t.prototype.removeQuery=function(t){this.fetchCancelFns.delete(t),this.queries.has(t)&&(this.getQuery(t).stop(),this.queries.delete(t))},t.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(t){return t.notify()}))},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(t,e,r,n){var i,o,s=this;void 0===n&&(n=null!==(i=null==e?void 0:e.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var a=this.transform(t).serverQuery;if(a){var u=this.inFlightLinkObservables,c=this.link,l={query:a,variables:r,operationName:wt(a)||void 0,context:this.prepareContext(x(x({},e),{forceFetch:!n}))};if(e=l.context,n){var h=u.get(a)||new Map;u.set(a,h);var f=nr(r);if(!(o=h.get(f))){var d=new Ar([xt(c,l)]);h.set(f,o=d),d.beforeNext((function(){h.delete(f)&&h.size<1&&u.delete(a)}))}}else o=new Ar([xt(c,l)])}else o=new Ar([rt.of({data:{}})]),e=this.prepareContext(e);var p=this.transform(t).clientQuery;return p&&(o=or(o,(function(t){return s.localState.runResolvers({document:p,remoteResult:t,context:e,variables:r})}))),o},t.prototype.getResultsFromLink=function(t,e,r){var n=t.lastRequestId=this.generateRequestId(),i=this.cache.transformForLink(this.transform(t.document).document);return or(this.getObservableFromLink(i,r.context,r.variables),(function(o){var s=ar(o),a=s.length>0;if(n>=t.lastRequestId){if(a&&"none"===r.errorPolicy)throw t.markError(new te({graphQLErrors:s}));t.markResult(o,i,r,e),t.markReady()}var u={data:o.data,loading:!1,networkStatus:Er.ready};return a&&"ignore"!==r.errorPolicy&&(u.errors=s,u.networkStatus=Er.error),u}),(function(e){var r=$t(e)?e:new te({networkError:e});throw n>=t.lastRequestId&&t.markError(r),r}))},t.prototype.fetchQueryObservable=function(t,e,r){return this.fetchConcastWithInfo(t,e,r).concast},t.prototype.fetchConcastWithInfo=function(t,e,r){var n=this;void 0===r&&(r=Er.loading);var i,o,s=this.transform(e.query).document,a=this.getVariables(s,e.variables),u=this.getQuery(t),c=this.defaultOptions.watchQuery,l=e.fetchPolicy,h=void 0===l?c&&c.fetchPolicy||"cache-first":l,f=e.errorPolicy,d=void 0===f?c&&c.errorPolicy||"none":f,p=e.returnPartialData,m=void 0!==p&&p,g=e.notifyOnNetworkStatusChange,v=void 0!==g&&g,y=e.context,b=void 0===y?{}:y,w=Object.assign({},e,{query:s,variables:a,fetchPolicy:h,errorPolicy:d,returnPartialData:m,notifyOnNetworkStatusChange:v,context:b}),_=function(t){w.variables=t;var i=n.fetchQueryByPolicy(u,w,r);return"standby"!==w.fetchPolicy&&i.sources.length>0&&u.observableQuery&&u.observableQuery.applyNextFetchPolicy("after-fetch",e),i},E=function(){return n.fetchCancelFns.delete(t)};if(this.fetchCancelFns.set(t,(function(t){E(),setTimeout((function(){return i.cancel(t)}))})),this.transform(w.query).hasClientExports)i=new Ar(this.localState.addExportedVariables(w.query,w.variables,w.context).then(_).then((function(t){return t.sources}))),o=!0;else{var A=_(w.variables);o=A.fromLink,i=new Ar(A.sources)}return i.promise.then(E,E),{concast:i,fromLink:o}},t.prototype.refetchQueries=function(t){var e=this,r=t.updateCache,n=t.include,i=t.optimistic,o=void 0!==i&&i,s=t.removeOptimistic,a=void 0===s?o?yr("refetchQueries"):void 0:s,u=t.onQueryUpdated,c=new Map;n&&this.getObservableQueries(n).forEach((function(t,r){c.set(r,{oq:t,lastDiff:e.getQuery(r).getDiff()})}));var l=new Map;return r&&this.cache.batch({update:r,optimistic:o&&a||!1,removeOptimistic:a,onWatchUpdated:function(t,e,r){var n=t.watcher instanceof Mn&&t.watcher.observableQuery;if(n){if(u){c.delete(n.queryId);var i=u(n,e,r);return!0===i&&(i=n.refetch()),!1!==i&&l.set(n,i),i}null!==u&&c.set(n.queryId,{oq:n,lastDiff:r,diff:e})}}}),c.size&&c.forEach((function(t,r){var n,i=t.oq,o=t.lastDiff,s=t.diff;if(u){if(!s){var a=i.queryInfo;a.reset(),s=a.getDiff()}n=u(i,s,o)}u&&!0!==n||(n=i.refetch()),!1!==n&&l.set(i,n),r.indexOf("legacyOneTimeQuery")>=0&&e.stopQueryNoBroadcast(r)})),a&&this.cache.removeOptimistic(a),l},t.prototype.fetchQueryByPolicy=function(t,e,r){var n=this,i=e.query,o=e.variables,s=e.fetchPolicy,a=e.refetchWritePolicy,u=e.errorPolicy,c=e.returnPartialData,l=e.context,h=e.notifyOnNetworkStatusChange,f=t.networkStatus;t.init({document:this.transform(i).document,variables:o,networkStatus:r});var d=function(){return t.getDiff(o)},p=function(e,r){void 0===r&&(r=t.networkStatus||Er.loading);var s=e.result;!__DEV__||c||ze(s,{})||Rr(e.missing);var a=function(t){return rt.of(x({data:t,loading:Or(r),networkStatus:r},e.complete?null:{partial:!0}))};return s&&n.transform(i).hasForcedResolvers?n.localState.runResolvers({document:i,remoteResult:{data:s},context:l,variables:o,onlyRunForcedResolvers:!0}).then((function(t){return a(t.data||void 0)})):"none"===u&&r===Er.refetch&&Array.isArray(e.missing)?a(void 0):a(s)},m="no-cache"===s?0:r===Er.refetch&&"merge"!==a?1:2,g=function(){return n.getResultsFromLink(t,m,{variables:o,context:l,fetchPolicy:s,errorPolicy:u})},v=h&&"number"==typeof f&&f!==r&&Or(r);switch(s){default:case"cache-first":return(y=d()).complete?{fromLink:!1,sources:[p(y,t.markReady())]}:c||v?{fromLink:!0,sources:[p(y),g()]}:{fromLink:!0,sources:[g()]};case"cache-and-network":var y;return(y=d()).complete||c||v?{fromLink:!0,sources:[p(y),g()]}:{fromLink:!0,sources:[g()]};case"cache-only":return{fromLink:!1,sources:[p(d(),t.markReady())]};case"network-only":return v?{fromLink:!0,sources:[p(d()),g()]}:{fromLink:!0,sources:[g()]};case"no-cache":return v?{fromLink:!0,sources:[p(t.getDiff()),g()]}:{fromLink:!0,sources:[g()]};case"standby":return{fromLink:!1,sources:[]}}},t.prototype.getQuery=function(t){return t&&!this.queries.has(t)&&this.queries.set(t,new Mn(this,t)),this.queries.get(t)},t.prototype.prepareContext=function(t){void 0===t&&(t={});var e=this.localState.prepareContext(t);return x(x({},e),{clientAwareness:this.clientAwareness})},t}();function In(t,e){return Mr(t,e,e.variables&&{variables:x(x({},t&&t.variables),e.variables)})}var Pn,Rn=!1,jn=function(){function t(t){var e=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var r=t.uri,n=t.credentials,i=t.headers,o=t.cache,s=t.ssrMode,c=void 0!==s&&s,l=t.ssrForceFetchDelay,h=void 0===l?0:l,f=t.connectToDevTools,d=void 0===f?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:f,p=t.queryDeduplication,m=void 0===p||p,g=t.defaultOptions,v=t.assumeImmutableResults,y=void 0!==v&&v,b=t.resolvers,w=t.typeDefs,_=t.fragmentMatcher,E=t.name,A=t.version,O=t.link;if(O||(O=r?new Fe({uri:r,credentials:n,headers:i}):Nt.empty()),!o)throw __DEV__?new a("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new a(9);if(this.link=O,this.cache=o,this.disableNetworkFetches=c||h>0,this.queryDeduplication=m,this.defaultOptions=g||Object.create(null),this.typeDefs=w,h&&setTimeout((function(){return e.disableNetworkFetches=!1}),h),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),d&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!Rn&&d&&__DEV__&&(Rn=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var k=window.navigator,S=k&&k.userAgent,M=void 0;"string"==typeof S&&(S.indexOf("Chrome/")>-1?M="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":S.indexOf("Firefox/")>-1&&(M="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),M&&__DEV__&&u.log("Download the Apollo DevTools for a better development experience: "+M)}this.version="3.7.16",this.localState=new An({cache:o,client:this,resolvers:b,fragmentMatcher:_}),this.queryManager=new xn({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:m,ssrMode:c,clientAwareness:{name:E,version:A},localState:this.localState,assumeImmutableResults:y,onBroadcast:d?function(){e.devToolsHookCb&&e.devToolsHookCb({action:{},state:{queries:e.queryManager.getQueryStore(),mutations:e.queryManager.mutationStore||{}},dataWithOptimisticResults:e.cache.extract(!0)})}:void 0})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=In(this.defaultOptions.watchQuery,t)),!this.disableNetworkFetches||"network-only"!==t.fetchPolicy&&"cache-and-network"!==t.fetchPolicy||(t=x(x({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},t.prototype.query=function(t){return this.defaultOptions.query&&(t=In(this.defaultOptions.query,t)),__DEV__?u("cache-and-network"!==t.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):u("cache-and-network"!==t.fetchPolicy,10),this.disableNetworkFetches&&"network-only"===t.fetchPolicy&&(t=x(x({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},t.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=In(this.defaultOptions.mutate,t)),this.queryManager.mutate(t)},t.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},t.prototype.readQuery=function(t,e){return void 0===e&&(e=!1),this.cache.readQuery(t,e)},t.prototype.readFragment=function(t,e){return void 0===e&&(e=!1),this.cache.readFragment(t,e)},t.prototype.writeQuery=function(t){var e=this.cache.writeQuery(t);return!1!==t.broadcast&&this.queryManager.broadcastQueries(),e},t.prototype.writeFragment=function(t){var e=this.cache.writeFragment(t);return!1!==t.broadcast&&this.queryManager.broadcastQueries(),e},t.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},t.prototype.__requestRaw=function(t){return xt(this.link,t)},t.prototype.resetStore=function(){var t=this;return Promise.resolve().then((function(){return t.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(t.resetStoreCallbacks.map((function(t){return t()})))})).then((function(){return t.reFetchObservableQueries()}))},t.prototype.clearStore=function(){var t=this;return Promise.resolve().then((function(){return t.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(t.clearStoreCallbacks.map((function(t){return t()})))}))},t.prototype.onResetStore=function(t){var e=this;return this.resetStoreCallbacks.push(t),function(){e.resetStoreCallbacks=e.resetStoreCallbacks.filter((function(e){return e!==t}))}},t.prototype.onClearStore=function(t){var e=this;return this.clearStoreCallbacks.push(t),function(){e.clearStoreCallbacks=e.clearStoreCallbacks.filter((function(e){return e!==t}))}},t.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},t.prototype.refetchQueries=function(t){var e=this.queryManager.refetchQueries(t),r=[],n=[];e.forEach((function(t,e){r.push(e),n.push(t)}));var i=Promise.all(n);return i.queries=r,i.results=n,i.catch((function(t){__DEV__&&u.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(t))})),i},t.prototype.getObservableQueries=function(t){return void 0===t&&(t="active"),this.queryManager.getObservableQueries(t)},t.prototype.extract=function(t){return this.cache.extract(t)},t.prototype.restore=function(t){return this.cache.restore(t)},t.prototype.addResolvers=function(t){this.localState.addResolvers(t)},t.prototype.setResolvers=function(t){this.localState.setResolvers(t)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},t.prototype.setLink=function(t){this.link=this.queryManager.link=t},t}();Pn||(Pn={});var Cn=function(){function t(){this.getFragmentDoc=gn(it)}return t.prototype.batch=function(t){var e,r=this,n="string"==typeof t.optimistic?t.optimistic:!1===t.optimistic?null:void 0;return this.performTransaction((function(){return e=t.update(r)}),n),e},t.prototype.recordOptimisticTransaction=function(t,e){this.performTransaction(t,e)},t.prototype.transformDocument=function(t){return t},t.prototype.transformForLink=function(t){return t},t.prototype.identify=function(t){},t.prototype.gc=function(){return[]},t.prototype.modify=function(t){return!1},t.prototype.readQuery=function(t,e){return void 0===e&&(e=!!t.optimistic),this.read(x(x({},t),{rootId:t.id||"ROOT_QUERY",optimistic:e}))},t.prototype.readFragment=function(t,e){return void 0===e&&(e=!!t.optimistic),this.read(x(x({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:e}))},t.prototype.writeQuery=function(t){var e=t.id,r=t.data,n=I(t,["id","data"]);return this.write(Object.assign(n,{dataId:e||"ROOT_QUERY",result:r}))},t.prototype.writeFragment=function(t){var e=t.id,r=t.data,n=t.fragment,i=t.fragmentName,o=I(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(n,i),dataId:e,result:r}))},t.prototype.updateQuery=function(t,e){return this.batch({update:function(r){var n=r.readQuery(t),i=e(n);return null==i?n:(r.writeQuery(x(x({},t),{data:i})),i)}})},t.prototype.updateFragment=function(t,e){return this.batch({update:function(r){var n=r.readFragment(t),i=e(n);return null==i?n:(r.writeFragment(x(x({},t),{data:i})),i)}})},t}(),Dn=function(t){function e(r,n,i,o){var s,a=t.call(this,r)||this;if(a.message=r,a.path=n,a.query=i,a.variables=o,Array.isArray(a.path)){a.missing=a.message;for(var u=a.path.length-1;u>=0;--u)a.missing=((s={})[a.path[u]]=a.missing,s)}else a.missing=a.path;return a.__proto__=e.prototype,a}return N(e,t),e}(Error);function Bn(t){var e=new Set([t]);return e.forEach((function(t){nt(t)&&function(t){if(__DEV__&&!Object.isFrozen(t))try{Object.freeze(t)}catch(t){if(t instanceof TypeError)return null;throw t}return t}(t)===t&&Object.getOwnPropertyNames(t).forEach((function(r){nt(t[r])&&e.add(t[r])}))})),t}function Fn(t){return __DEV__&&Bn(t),t}var Ln=Object.prototype.hasOwnProperty;function Un(t){return null==t}function qn(t,e){var r=t.__typename,n=t.id,i=t._id;if("string"==typeof r&&(e&&(e.keyObject=Un(n)?Un(i)?void 0:{_id:i}:{id:n}),Un(n)&&!Un(i)&&(n=i),!Un(n)))return"".concat(r,":").concat("number"==typeof n||"string"==typeof n?n:JSON.stringify(n))}var Vn={dataIdFromObject:qn,addTypename:!0,resultCaching:!0,canonizeResults:!1};function zn(t){var e=t.canonizeResults;return void 0===e?Vn.canonizeResults:e}var Gn=/^[_a-z][_0-9a-z]*/i;function Kn(t){var e=t.match(Gn);return e?e[0]:t}function Qn(t,e,r){return!!nt(e)&&(ee(e)?e.every((function(e){return Qn(t,e,r)})):t.selections.every((function(t){if(vt(t)&&Lt(t,r)){var n=mt(t);return Ln.call(e,n)&&(!t.selectionSet||Qn(t.selectionSet,e[n],r))}return!0})))}function Hn(t){return nt(t)&&!ut(t)&&!ee(t)}function Wn(t,e){var r=ot(_t(t));return{fragmentMap:r,lookupFragment:function(t){var n=r[t];return!n&&e&&(n=e.lookup(t)),n||null}}}var Jn,Yn,Xn=Object.create(null),Zn=function(){return Xn},$n=Object.create(null),ti=function(){function t(t,e){var r=this;this.policies=t,this.group=e,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(t,e){return Fn(ut(t)?r.get(t.__ref,e):t&&t[e])},this.canRead=function(t){return ut(t)?r.has(t.__ref):"object"==typeof t},this.toReference=function(t,e){if("string"==typeof t)return at(t);if(ut(t))return t;var n=r.policies.identify(t)[0];if(n){var i=at(n);return e&&r.merge(n,t),i}}}return t.prototype.toObject=function(){return x({},this.data)},t.prototype.has=function(t){return void 0!==this.lookup(t,!0)},t.prototype.get=function(t,e){if(this.group.depend(t,e),Ln.call(this.data,t)){var r=this.data[t];if(r&&Ln.call(r,e))return r[e]}return"__typename"===e&&Ln.call(this.policies.rootTypenamesById,t)?this.policies.rootTypenamesById[t]:this instanceof ii?this.parent.get(t,e):void 0},t.prototype.lookup=function(t,e){return e&&this.group.depend(t,"__exists"),Ln.call(this.data,t)?this.data[t]:this instanceof ii?this.parent.lookup(t,e):this.policies.rootTypenamesById[t]?Object.create(null):void 0},t.prototype.merge=function(t,e){var r,n=this;ut(t)&&(t=t.__ref),ut(e)&&(e=e.__ref);var i="string"==typeof t?this.lookup(r=t):t,o="string"==typeof e?this.lookup(r=e):e;if(o){__DEV__?u("string"==typeof r,"store.merge expects a string ID"):u("string"==typeof r,1);var s=new ae(si).merge(i,o);if(this.data[r]=s,s!==i&&(delete this.refs[r],this.group.caching)){var a=Object.create(null);i||(a.__exists=1),Object.keys(o).forEach((function(t){if(!i||i[t]!==s[t]){a[t]=1;var e=Kn(t);e===t||n.policies.hasKeyArgs(s.__typename,e)||(a[e]=1),void 0!==s[t]||n instanceof ii||delete s[t]}})),!a.__typename||i&&i.__typename||this.policies.rootTypenamesById[r]!==s.__typename||delete a.__typename,Object.keys(a).forEach((function(t){return n.group.dirty(r,t)}))}}},t.prototype.modify=function(t,e){var r=this,n=this.lookup(t);if(n){var i=Object.create(null),o=!1,s=!0,a={DELETE:Xn,INVALIDATE:$n,isReference:ut,toReference:this.toReference,canRead:this.canRead,readField:function(e,n){return r.policies.readField("string"==typeof e?{fieldName:e,from:n||at(t)}:e,{store:r})}};if(Object.keys(n).forEach((function(u){var c=Kn(u),l=n[u];if(void 0!==l){var h="function"==typeof e?e:e[u]||e[c];if(h){var f=h===Zn?Xn:h(Fn(l),x(x({},a),{fieldName:c,storeFieldName:u,storage:r.getStorage(t,u)}));f===$n?r.group.dirty(t,u):(f===Xn&&(f=void 0),f!==l&&(i[u]=f,o=!0,l=f))}void 0!==l&&(s=!1)}})),o)return this.merge(t,i),s&&(this instanceof ii?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},t.prototype.delete=function(t,e,r){var n,i=this.lookup(t);if(i){var o=this.getFieldValue(i,"__typename"),s=e&&r?this.policies.getStoreFieldName({typename:o,fieldName:e,args:r}):e;return this.modify(t,s?((n={})[s]=Zn,n):Zn)}return!1},t.prototype.evict=function(t,e){var r=!1;return t.id&&(Ln.call(this.data,t.id)&&(r=this.delete(t.id,t.fieldName,t.args)),this instanceof ii&&this!==e&&(r=this.parent.evict(t,e)||r),(t.fieldName||r)&&this.group.dirty(t.id,t.fieldName||"__exists")),r},t.prototype.clear=function(){this.replace(null)},t.prototype.extract=function(){var t=this,e=this.toObject(),r=[];return this.getRootIdSet().forEach((function(e){Ln.call(t.policies.rootTypenamesById,e)||r.push(e)})),r.length&&(e.__META={extraRootIds:r.sort()}),e},t.prototype.replace=function(t){var e=this;if(Object.keys(this.data).forEach((function(r){t&&Ln.call(t,r)||e.delete(r)})),t){var r=t.__META,n=I(t,["__META"]);Object.keys(n).forEach((function(t){e.merge(t,n[t])})),r&&r.extraRootIds.forEach(this.retain,this)}},t.prototype.retain=function(t){return this.rootIds[t]=(this.rootIds[t]||0)+1},t.prototype.release=function(t){if(this.rootIds[t]>0){var e=--this.rootIds[t];return e||delete this.rootIds[t],e}return 0},t.prototype.getRootIdSet=function(t){return void 0===t&&(t=new Set),Object.keys(this.rootIds).forEach(t.add,t),this instanceof ii?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t},t.prototype.gc=function(){var t=this,e=this.getRootIdSet(),r=this.toObject();e.forEach((function(n){Ln.call(r,n)&&(Object.keys(t.findChildRefIds(n)).forEach(e.add,e),delete r[n])}));var n=Object.keys(r);if(n.length){for(var i=this;i instanceof ii;)i=i.parent;n.forEach((function(t){return i.delete(t)}))}return n},t.prototype.findChildRefIds=function(t){if(!Ln.call(this.refs,t)){var e=this.refs[t]=Object.create(null),r=this.data[t];if(!r)return e;var n=new Set([r]);n.forEach((function(t){ut(t)&&(e[t.__ref]=!0),nt(t)&&Object.keys(t).forEach((function(e){var r=t[e];nt(r)&&n.add(r)}))}))}return this.refs[t]},t.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},t}(),ei=function(){function t(t,e){void 0===e&&(e=null),this.caching=t,this.parent=e,this.d=null,this.resetCaching()}return t.prototype.resetCaching=function(){this.d=this.caching?dn():null,this.keyMaker=new Ze(Gt)},t.prototype.depend=function(t,e){if(this.d){this.d(ri(t,e));var r=Kn(e);r!==e&&this.d(ri(t,r)),this.parent&&this.parent.depend(t,e)}},t.prototype.dirty=function(t,e){this.d&&this.d.dirty(ri(t,e),"__exists"===e?"forget":"setDirty")},t}();function ri(t,e){return e+"#"+t}function ni(t,e){ai(t)&&t.group.depend(e,"__exists")}Jn=ti||(ti={}),Yn=function(t){function e(e){var r=e.policies,n=e.resultCaching,i=void 0===n||n,o=e.seed,s=t.call(this,r,new ei(i))||this;return s.stump=new oi(s),s.storageTrie=new Ze(Gt),o&&s.replace(o),s}return N(e,t),e.prototype.addLayer=function(t,e){return this.stump.addLayer(t,e)},e.prototype.removeLayer=function(){return this},e.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},e}(Jn),Jn.Root=Yn;var ii=function(t){function e(e,r,n,i){var o=t.call(this,r.policies,i)||this;return o.id=e,o.parent=r,o.replay=n,o.group=i,n(o),o}return N(e,t),e.prototype.addLayer=function(t,r){return new e(t,this,r,this.group)},e.prototype.removeLayer=function(t){var e=this,r=this.parent.removeLayer(t);return t===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(t){var n=e.data[t],i=r.lookup(t);i?n?n!==i&&Object.keys(n).forEach((function(r){ze(n[r],i[r])||e.group.dirty(t,r)})):(e.group.dirty(t,"__exists"),Object.keys(i).forEach((function(r){e.group.dirty(t,r)}))):e.delete(t)})),r):r===this.parent?this:r.addLayer(this.id,this.replay)},e.prototype.toObject=function(){return x(x({},this.parent.toObject()),this.data)},e.prototype.findChildRefIds=function(e){var r=this.parent.findChildRefIds(e);return Ln.call(this.data,e)?x(x({},r),t.prototype.findChildRefIds.call(this,e)):r},e.prototype.getStorage=function(){for(var t=this.parent;t.parent;)t=t.parent;return t.getStorage.apply(t,arguments)},e}(ti),oi=function(t){function e(e){return t.call(this,"EntityStore.Stump",e,(function(){}),new ei(e.group.caching,e.group))||this}return N(e,t),e.prototype.removeLayer=function(){return this},e.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},e}(ii);function si(t,e,r){var n=t[r],i=e[r];return ze(n,i)?n:i}function ai(t){return!!(t instanceof ti&&t.group.caching)}function ui(t){return[t.selectionSet,t.objectOrReference,t.context,t.context.canonizeResults]}var ci=function(){function t(t){var e=this;this.knownResults=new(Gt?WeakMap:Map),this.config=Mr(t,{addTypename:!1!==t.addTypename,canonizeResults:zn(t)}),this.canon=t.canon||new rr,this.executeSelectionSet=gn((function(t){var r,n=t.context.canonizeResults,i=ui(t);i[3]=!n;var o=(r=e.executeSelectionSet).peek.apply(r,i);return o?n?x(x({},o),{result:e.canon.admit(o.result)}):o:(ni(t.context.store,t.enclosingRef.__ref),e.execSelectionSetImpl(t))}),{max:this.config.resultCacheMaxSize,keyArgs:ui,makeCacheKey:function(t,e,r,n){if(ai(r.store))return r.store.makeCacheKey(t,ut(e)?e.__ref:e,r.varString,n)}}),this.executeSubSelectedArray=gn((function(t){return ni(t.context.store,t.enclosingRef.__ref),e.execSubSelectedArrayImpl(t)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(t){var e=t.field,r=t.array,n=t.context;if(ai(n.store))return n.store.makeCacheKey(e,r,n.varString)}})}return t.prototype.resetCanon=function(){this.canon=new rr},t.prototype.diffQueryAgainstStore=function(t){var e=t.store,r=t.query,n=t.rootId,i=void 0===n?"ROOT_QUERY":n,o=t.variables,s=t.returnPartialData,a=void 0===s||s,u=t.canonizeResults,c=void 0===u?this.config.canonizeResults:u,l=this.config.cache.policies;o=x(x({},Ot(Et(r))),o);var h,f=at(i),d=this.executeSelectionSet({selectionSet:At(r).selectionSet,objectOrReference:f,enclosingRef:f,context:x({store:e,query:r,policies:l,variables:o,varString:nr(o),canonizeResults:c},Wn(r,this.config.fragments))});if(d.missing&&(h=[new Dn(li(d.missing),d.missing,r,o)],!a))throw h[0];return{result:d.result,complete:!h,missing:h}},t.prototype.isFresh=function(t,e,r,n){if(ai(n.store)&&this.knownResults.get(t)===r){var i=this.executeSelectionSet.peek(r,e,n,this.canon.isKnown(t));if(i&&t===i.result)return!0}return!1},t.prototype.execSelectionSetImpl=function(t){var e=this,r=t.selectionSet,n=t.objectOrReference,i=t.enclosingRef,o=t.context;if(ut(n)&&!o.policies.rootTypenamesById[n.__ref]&&!o.store.has(n.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(n.__ref," object")};var s,u=o.variables,c=o.policies,l=o.store.getFieldValue(n,"__typename"),h=[],f=new ae;function d(t,e){var r;return t.missing&&(s=f.merge(s,((r={})[e]=t.missing,r))),t.result}this.config.addTypename&&"string"==typeof l&&!c.rootIdsByTypename[l]&&h.push({__typename:l});var p=new Set(r.selections);p.forEach((function(t){var r,m;if(Lt(t,u))if(vt(t)){var g=c.readField({fieldName:t.name.value,field:t,variables:o.variables,from:n},o),v=mt(t);void 0===g?pr.added(t)||(s=f.merge(s,((r={})[v]="Can't find field '".concat(t.name.value,"' on ").concat(ut(n)?n.__ref+" object":"object "+JSON.stringify(n,null,2)),r))):ee(g)?g=d(e.executeSubSelectedArray({field:t,array:g,enclosingRef:i,context:o}),v):t.selectionSet?null!=g&&(g=d(e.executeSelectionSet({selectionSet:t.selectionSet,objectOrReference:g,enclosingRef:ut(g)?g:i,context:o}),v)):o.canonizeResults&&(g=e.canon.pass(g)),void 0!==g&&h.push(((m={})[v]=g,m))}else{var y=st(t,o.lookupFragment);if(!y&&t.kind===ur.FRAGMENT_SPREAD)throw __DEV__?new a("No fragment named ".concat(t.name.value)):new a(5);y&&c.fragmentMatches(y,l)&&y.selectionSet.selections.forEach(p.add,p)}}));var m={result:oe(h),missing:s},g=o.canonizeResults?this.canon.admit(m):Fn(m);return g.result&&this.knownResults.set(g.result,r),g},t.prototype.execSubSelectedArrayImpl=function(t){var e,r=this,n=t.field,i=t.array,o=t.enclosingRef,s=t.context,a=new ae;function c(t,r){var n;return t.missing&&(e=a.merge(e,((n={})[r]=t.missing,n))),t.result}return n.selectionSet&&(i=i.filter(s.store.canRead)),i=i.map((function(t,e){return null===t?null:ee(t)?c(r.executeSubSelectedArray({field:n,array:t,enclosingRef:o,context:s}),e):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:t,enclosingRef:ut(t)?t:o,context:s}),e):(__DEV__&&function(t,e,r){if(!e.selectionSet){var n=new Set([r]);n.forEach((function(r){nt(r)&&(__DEV__?u(!ut(r),"Missing selection set for object of type ".concat(function(t,e){return ut(e)?t.get(e.__ref,"__typename"):e&&e.__typename}(t,r)," returned for query field ").concat(e.name.value)):u(!ut(r),6),Object.values(r).forEach(n.add,n))}))}}(s.store,n,t),t)})),{result:s.canonizeResults?this.canon.admit(i):i,missing:e}},t}();function li(t){try{JSON.stringify(t,(function(t,e){if("string"==typeof e)throw e;return e}))}catch(t){return t}}var hi=Object.create(null);function fi(t){var e=JSON.stringify(t);return hi[e]||(hi[e]=Object.create(null))}function di(t){var e=fi(t);return e.keyFieldsFn||(e.keyFieldsFn=function(e,r){var n=function(t,e){return r.readField(e,t)},i=r.keyObject=mi(t,(function(t){var i=vi(r.storeObject,t,n);return void 0===i&&e!==r.storeObject&&Ln.call(e,t[0])&&(i=vi(e,t,gi)),__DEV__?u(void 0!==i,"Missing field '".concat(t.join("."),"' while extracting keyFields from ").concat(JSON.stringify(e))):u(void 0!==i,2),i}));return"".concat(r.typename,":").concat(JSON.stringify(i))})}function pi(t){var e=fi(t);return e.keyArgsFn||(e.keyArgsFn=function(e,r){var n=r.field,i=r.variables,o=r.fieldName,s=mi(t,(function(t){var r=t[0],o=r.charAt(0);if("@"!==o)if("$"!==o){if(e)return vi(e,t)}else{var s=r.slice(1);if(i&&Ln.call(i,s)){var a=t.slice(0);return a[0]=s,vi(i,a)}}else if(n&&re(n.directives)){var u=r.slice(1),c=n.directives.find((function(t){return t.name.value===u})),l=c&&pt(c,i);return l&&vi(l,t.slice(1))}})),a=JSON.stringify(s);return(e||"{}"!==a)&&(o+=":"+a),o})}function mi(t,e){var r=new ae;return function t(e){var r=fi(e);if(!r.paths){var n=r.paths=[],i=[];e.forEach((function(r,o){ee(r)?(t(r).forEach((function(t){return n.push(i.concat(t))})),i.length=0):(i.push(r),ee(e[o+1])||(n.push(i.slice(0)),i.length=0))}))}return r.paths}(t).reduce((function(t,n){var i,o=e(n);if(void 0!==o){for(var s=n.length-1;s>=0;--s)(i={})[n[s]]=o,o=i;t=r.merge(t,o)}return t}),Object.create(null))}function gi(t,e){return t[e]}function vi(t,e,r){return r=r||gi,yi(e.reduce((function t(e,n){return ee(e)?e.map((function(e){return t(e,n)})):e&&r(e,n)}),t))}function yi(t){return nt(t)?ee(t)?t.map(yi):mi(Object.keys(t).sort(),(function(e){return vi(t,e)})):t}function bi(t){return void 0!==t.args?t.args:t.field?pt(t.field,t.variables):null}ht.setStringify(nr);var wi=function(){},_i=function(t,e){return e.fieldName},Ei=function(t,e,r){return(0,r.mergeObjects)(t,e)},Ai=function(t,e){return e},Oi=function(){function t(t){this.config=t,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=x({dataIdFromObject:qn},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return t.prototype.identify=function(t,e){var r,n=this,i=e&&(e.typename||(null===(r=e.storeObject)||void 0===r?void 0:r.__typename))||t.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o,s=e&&e.storeObject||t,a=x(x({},e),{typename:i,storeObject:s,readField:e&&e.readField||function(){var t=Si(arguments,s);return n.readField(t,{store:n.cache.data,variables:t.variables})}}),u=i&&this.getTypePolicy(i),c=u&&u.keyFn||this.config.dataIdFromObject;c;){var l=c(x(x({},t),s),a);if(!ee(l)){o=l;break}c=di(l)}return o=o?String(o):void 0,a.keyObject?[o,a.keyObject]:[o]},t.prototype.addTypePolicies=function(t){var e=this;Object.keys(t).forEach((function(r){var n=t[r],i=n.queryType,o=n.mutationType,s=n.subscriptionType,a=I(n,["queryType","mutationType","subscriptionType"]);i&&e.setRootTypename("Query",r),o&&e.setRootTypename("Mutation",r),s&&e.setRootTypename("Subscription",r),Ln.call(e.toBeAdded,r)?e.toBeAdded[r].push(a):e.toBeAdded[r]=[a]}))},t.prototype.updateTypePolicy=function(t,e){var r=this,n=this.getTypePolicy(t),i=e.keyFields,o=e.fields;function s(t,e){t.merge="function"==typeof e?e:!0===e?Ei:!1===e?Ai:t.merge}s(n,e.merge),n.keyFn=!1===i?wi:ee(i)?di(i):"function"==typeof i?i:n.keyFn,o&&Object.keys(o).forEach((function(e){var n=r.getFieldPolicy(t,e,!0),i=o[e];if("function"==typeof i)n.read=i;else{var a=i.keyArgs,u=i.read,c=i.merge;n.keyFn=!1===a?_i:ee(a)?pi(a):"function"==typeof a?a:n.keyFn,"function"==typeof u&&(n.read=u),s(n,c)}n.read&&n.merge&&(n.keyFn=n.keyFn||_i)}))},t.prototype.setRootTypename=function(t,e){void 0===e&&(e=t);var r="ROOT_"+t.toUpperCase(),n=this.rootTypenamesById[r];e!==n&&(__DEV__?u(!n||n===t,"Cannot change root ".concat(t," __typename more than once")):u(!n||n===t,3),n&&delete this.rootIdsByTypename[n],this.rootIdsByTypename[e]=r,this.rootTypenamesById[r]=e)},t.prototype.addPossibleTypes=function(t){var e=this;this.usingPossibleTypes=!0,Object.keys(t).forEach((function(r){e.getSupertypeSet(r,!0),t[r].forEach((function(t){e.getSupertypeSet(t,!0).add(r);var n=t.match(Gn);n&&n[0]===t||e.fuzzySubtypes.set(t,new RegExp(t))}))}))},t.prototype.getTypePolicy=function(t){var e=this;if(!Ln.call(this.typePolicies,t)){var r=this.typePolicies[t]=Object.create(null);r.fields=Object.create(null);var n=this.supertypeMap.get(t);n&&n.size&&n.forEach((function(t){var n=e.getTypePolicy(t),i=n.fields,o=I(n,["fields"]);Object.assign(r,o),Object.assign(r.fields,i)}))}var i=this.toBeAdded[t];return i&&i.length&&i.splice(0).forEach((function(r){e.updateTypePolicy(t,r)})),this.typePolicies[t]},t.prototype.getFieldPolicy=function(t,e,r){if(t){var n=this.getTypePolicy(t).fields;return n[e]||r&&(n[e]=Object.create(null))}},t.prototype.getSupertypeSet=function(t,e){var r=this.supertypeMap.get(t);return!r&&e&&this.supertypeMap.set(t,r=new Set),r},t.prototype.fragmentMatches=function(t,e,r,n){var i=this;if(!t.typeCondition)return!0;if(!e)return!1;var o=t.typeCondition.name.value;if(e===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(e,!0),a=[s],c=function(t){var e=i.getSupertypeSet(t,!1);e&&e.size&&a.indexOf(e)<0&&a.push(e)},l=!(!r||!this.fuzzySubtypes.size),h=!1,f=0;f1?a:e}:(n=x({},s),Ln.call(n,"from")||(n.from=e)),__DEV__&&void 0===n.from&&__DEV__&&u.warn("Undefined 'from' passed to readField with arguments ".concat((i=Array.from(t),o=yr("stringifyForDisplay"),JSON.stringify(i,(function(t,e){return void 0===e?o:e})).split(JSON.stringify(o)).join("")))),void 0===n.variables&&(n.variables=r),n}function Mi(t){return function(e,r){if(ee(e)||ee(r))throw __DEV__?new a("Cannot automatically merge arrays"):new a(4);if(nt(e)&&nt(r)){var n=t.getFieldValue(e,"__typename"),i=t.getFieldValue(r,"__typename");if(n&&i&&n!==i)return r;if(ut(e)&&Hn(r))return t.merge(e.__ref,r),e;if(Hn(e)&&ut(r))return t.merge(e,r.__ref),r;if(Hn(e)&&Hn(r))return x(x({},e),r)}return r}}function Ti(t,e,r){var n="".concat(e).concat(r),i=t.flavors.get(n);return i||t.flavors.set(n,i=t.clientOnly===e&&t.deferred===r?t:x(x({},t),{clientOnly:e,deferred:r})),i}var Ni=function(){function t(t,e,r){this.cache=t,this.reader=e,this.fragments=r}return t.prototype.writeToStore=function(t,e){var r=this,n=e.query,i=e.result,o=e.dataId,s=e.variables,c=e.overwrite,l=bt(n),h=new ae;s=x(x({},Ot(l)),s);var f=x(x({store:t,written:Object.create(null),merge:function(t,e){return h.merge(t,e)},variables:s,varString:nr(s)},Wn(n,this.fragments)),{overwrite:!!c,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),d=this.processSelectionSet({result:i||Object.create(null),dataId:o,selectionSet:l.selectionSet,mergeTree:{map:new Map},context:f});if(!ut(d))throw __DEV__?new a("Could not identify object ".concat(JSON.stringify(i))):new a(7);return f.incomingById.forEach((function(e,n){var i=e.storeObject,o=e.mergeTree,s=e.fieldNodeSet,a=at(n);if(o&&o.map.size){var c=r.applyMerges(o,a,i,f);if(ut(c))return;i=c}if(__DEV__&&!f.overwrite){var l=Object.create(null);s.forEach((function(t){t.selectionSet&&(l[t.name.value]=!0)}));Object.keys(i).forEach((function(t){(function(t){return!0===l[Kn(t)]})(t)&&!function(t){var e=o&&o.map.get(t);return Boolean(e&&e.info&&e.info.merge)}(t)&&function(t,e,r,n){var i=function(t){var e=n.getFieldValue(t,r);return"object"==typeof e&&e},o=i(t);if(!o)return;var s=i(e);if(!s)return;if(ut(o))return;if(ze(o,s))return;if(Object.keys(o).every((function(t){return void 0!==n.getFieldValue(s,t)})))return;var a=n.getFieldValue(t,"__typename")||n.getFieldValue(e,"__typename"),c=Kn(r),l="".concat(a,".").concat(c);if(ji.has(l))return;ji.add(l);var h=[];ee(o)||ee(s)||[o,s].forEach((function(t){var e=n.getFieldValue(t,"__typename");"string"!=typeof e||h.includes(e)||h.push(e)}));__DEV__&&u.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(a," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(h.length?"either ensure all objects of type "+h.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(l," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(o).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(s).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}(a,i,t,f.store)}))}t.merge(n,i)})),t.retain(d.__ref),d},t.prototype.processSelectionSet=function(t){var e=this,r=t.dataId,n=t.result,i=t.selectionSet,o=t.context,s=t.mergeTree,a=this.cache.policies,c=Object.create(null),l=r&&a.rootTypenamesById[r]||gt(n,i,o.fragmentMap)||r&&o.store.get(r,"__typename");"string"==typeof l&&(c.__typename=l);var h=function(){var t=Si(arguments,c,o.variables);if(ut(t.from)){var e=o.incomingById.get(t.from.__ref);if(e){var r=a.readField(x(x({},t),{from:e.storeObject}),o);if(void 0!==r)return r}}return a.readField(t,o)},f=new Set;this.flattenFields(i,n,o,l).forEach((function(t,r){var i,o=mt(r),d=n[o];if(f.add(r),void 0!==d){var p=a.getStoreFieldName({typename:l,fieldName:r.name.value,field:r,variables:t.variables}),m=Ii(s,p),g=e.processFieldValue(d,r,r.selectionSet?Ti(t,!1,!1):t,m),v=void 0;r.selectionSet&&(ut(g)||Hn(g))&&(v=h("__typename",g));var y=a.getMergeFunction(l,r.name.value,v);y?m.info={field:r,typename:l,merge:y}:Ri(s,p),c=t.merge(c,((i={})[p]=g,i))}else!__DEV__||t.clientOnly||t.deferred||pr.added(r)||a.getReadFunction(l,r.name.value)||__DEV__&&u.error("Missing field '".concat(mt(r),"' while writing result ").concat(JSON.stringify(n,null,2)).substring(0,1e3))}));try{var d=a.identify(n,{typename:l,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:c,readField:h}),p=d[0],m=d[1];r=r||p,m&&(c=o.merge(c,m))}catch(t){if(!r)throw t}if("string"==typeof r){var g=at(r),v=o.written[r]||(o.written[r]=[]);if(v.indexOf(i)>=0)return g;if(v.push(i),this.reader&&this.reader.isFresh(n,g,i,o))return g;var y=o.incomingById.get(r);return y?(y.storeObject=o.merge(y.storeObject,c),y.mergeTree=function t(e,r){if(e===r||!r||Pi(r))return e;if(!e||Pi(e))return r;var n=e.info&&r.info?x(x({},e.info),r.info):e.info||r.info,i=e.map.size&&r.map.size,o=i?new Map:e.map.size?e.map:r.map,s={info:n,map:o};if(i){var a=new Set(r.map.keys());e.map.forEach((function(e,n){s.map.set(n,t(e,r.map.get(n))),a.delete(n)})),a.forEach((function(n){s.map.set(n,t(r.map.get(n),e.map.get(n)))}))}return s}(y.mergeTree,s),f.forEach((function(t){return y.fieldNodeSet.add(t)}))):o.incomingById.set(r,{storeObject:c,mergeTree:Pi(s)?void 0:s,fieldNodeSet:f}),g}return c},t.prototype.processFieldValue=function(t,e,r,n){var i=this;return e.selectionSet&&null!==t?ee(t)?t.map((function(t,o){var s=i.processFieldValue(t,e,r,Ii(n,o));return Ri(n,o),s})):this.processSelectionSet({result:t,selectionSet:e.selectionSet,context:r,mergeTree:n}):__DEV__?Sr(t):t},t.prototype.flattenFields=function(t,e,r,n){void 0===n&&(n=gt(e,t,r.fragmentMap));var i=new Map,o=this.cache.policies,s=new Ze(!1);return function t(u,c){var l=s.lookup(u,c.clientOnly,c.deferred);l.visited||(l.visited=!0,u.selections.forEach((function(s){if(Lt(s,r.variables)){var u=c.clientOnly,l=c.deferred;if(u&&l||!re(s.directives)||s.directives.forEach((function(t){var e=t.name.value;if("client"===e&&(u=!0),"defer"===e){var n=pt(t,r.variables);n&&!1===n.if||(l=!0)}})),vt(s)){var h=i.get(s);h&&(u=u&&h.clientOnly,l=l&&h.deferred),i.set(s,Ti(r,u,l))}else{var f=st(s,r.lookupFragment);if(!f&&s.kind===ur.FRAGMENT_SPREAD)throw __DEV__?new a("No fragment named ".concat(s.name.value)):new a(8);f&&o.fragmentMatches(f,n,e,r.variables)&&t(f.selectionSet,Ti(r,u,l))}}})))}(t,r),i},t.prototype.applyMerges=function(t,e,r,n,i){var o,s=this;if(t.map.size&&!ut(r)){var a,c=ee(r)||!ut(e)&&!Hn(e)?void 0:e,l=r;c&&!i&&(i=[ut(c)?c.__ref:c]);var h=function(t,e){return ee(t)?"number"==typeof e?t[e]:void 0:n.store.getFieldValue(t,String(e))};t.map.forEach((function(t,e){var r=h(c,e),o=h(l,e);if(void 0!==o){i&&i.push(e);var f=s.applyMerges(t,r,o,n,i);f!==o&&(a=a||new Map).set(e,f),i&&u(i.pop()===e)}})),a&&(r=ee(l)?l.slice(0):x({},l),a.forEach((function(t,e){r[e]=t})))}return t.info?this.cache.policies.runMergeFunction(e,r,t.info,n,i&&(o=n.store).getStorage.apply(o,i)):r},t}(),xi=[];function Ii(t,e){var r=t.map;return r.has(e)||r.set(e,xi.pop()||{map:new Map}),r.get(e)}function Pi(t){return!t||!(t.info||t.map.size)}function Ri(t,e){var r=t.map,n=r.get(e);n&&Pi(n)&&(xi.push(n),r.delete(e))}var ji=new Set;var Ci=function(t){function e(e){void 0===e&&(e={});var r=t.call(this)||this;return r.watches=new Set,r.typenameDocumentCache=new Map,r.makeVar=_n,r.txCount=0,r.config=function(t){return Mr(Vn,t)}(e),r.addTypename=!!r.config.addTypename,r.policies=new Oi({cache:r,dataIdFromObject:r.config.dataIdFromObject,possibleTypes:r.config.possibleTypes,typePolicies:r.config.typePolicies}),r.init(),r}return N(e,t),e.prototype.init=function(){var t=this.data=new ti.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=t.stump,this.resetResultCache()},e.prototype.resetResultCache=function(t){var e=this,r=this.storeReader,n=this.config.fragments;this.storeWriter=new Ni(this,this.storeReader=new ci({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:zn(this.config),canon:t?void 0:r&&r.canon,fragments:n}),n),this.maybeBroadcastWatch=gn((function(t,r){return e.broadcastWatch(t,r)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(t){var r=t.optimistic?e.optimisticData:e.data;if(ai(r)){var n=t.optimistic,i=t.id,o=t.variables;return r.makeCacheKey(t.query,t.callback,nr({optimistic:n,id:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(t){return t.resetCaching()}))},e.prototype.restore=function(t){return this.init(),t&&this.data.replace(t),this},e.prototype.extract=function(t){return void 0===t&&(t=!1),(t?this.optimisticData:this.data).extract()},e.prototype.read=function(t){var e=t.returnPartialData,r=void 0!==e&&e;try{return this.storeReader.diffQueryAgainstStore(x(x({},t),{store:t.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:r})).result||null}catch(t){if(t instanceof Dn)return null;throw t}},e.prototype.write=function(t){try{return++this.txCount,this.storeWriter.writeToStore(this.data,t)}finally{--this.txCount||!1===t.broadcast||this.broadcastWatches()}},e.prototype.modify=function(t){if(Ln.call(t,"id")&&!t.id)return!1;var e=t.optimistic?this.optimisticData:this.data;try{return++this.txCount,e.modify(t.id||"ROOT_QUERY",t.fields)}finally{--this.txCount||!1===t.broadcast||this.broadcastWatches()}},e.prototype.diff=function(t){return this.storeReader.diffQueryAgainstStore(x(x({},t),{store:t.optimistic?this.optimisticData:this.data,rootId:t.id||"ROOT_QUERY",config:this.config}))},e.prototype.watch=function(t){var e,r=this;return this.watches.size||bn(e=this).vars.forEach((function(t){return t.attachCache(e)})),this.watches.add(t),t.immediate&&this.maybeBroadcastWatch(t),function(){r.watches.delete(t)&&!r.watches.size&&wn(r),r.maybeBroadcastWatch.forget(t)}},e.prototype.gc=function(t){nr.reset();var e=this.optimisticData.gc();return t&&!this.txCount&&(t.resetResultCache?this.resetResultCache(t.resetResultIdentities):t.resetResultIdentities&&this.storeReader.resetCanon()),e},e.prototype.retain=function(t,e){return(e?this.optimisticData:this.data).retain(t)},e.prototype.release=function(t,e){return(e?this.optimisticData:this.data).release(t)},e.prototype.identify=function(t){if(ut(t))return t.__ref;try{return this.policies.identify(t)[0]}catch(t){__DEV__&&u.warn(t)}},e.prototype.evict=function(t){if(!t.id){if(Ln.call(t,"id"))return!1;t=x(x({},t),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(t,this.data)}finally{--this.txCount||!1===t.broadcast||this.broadcastWatches()}},e.prototype.reset=function(t){var e=this;return this.init(),nr.reset(),t&&t.discardWatches?(this.watches.forEach((function(t){return e.maybeBroadcastWatch.forget(t)})),this.watches.clear(),wn(this)):this.broadcastWatches(),Promise.resolve()},e.prototype.removeOptimistic=function(t){var e=this.optimisticData.removeLayer(t);e!==this.optimisticData&&(this.optimisticData=e,this.broadcastWatches())},e.prototype.batch=function(t){var e,r=this,n=t.update,i=t.optimistic,o=void 0===i||i,s=t.removeOptimistic,a=t.onWatchUpdated,u=function(t){var i=r,o=i.data,s=i.optimisticData;++r.txCount,t&&(r.data=r.optimisticData=t);try{return e=n(r)}finally{--r.txCount,r.data=o,r.optimisticData=s}},c=new Set;return a&&!this.txCount&&this.broadcastWatches(x(x({},t),{onWatchUpdated:function(t){return c.add(t),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,u):!1===o?u(this.data):u(),"string"==typeof s&&(this.optimisticData=this.optimisticData.removeLayer(s)),a&&c.size?(this.broadcastWatches(x(x({},t),{onWatchUpdated:function(t,e){var r=a.call(this,t,e);return!1!==r&&c.delete(t),r}})),c.size&&c.forEach((function(t){return r.maybeBroadcastWatch.dirty(t)}))):this.broadcastWatches(t),e},e.prototype.performTransaction=function(t,e){return this.batch({update:t,optimistic:e||null!==e})},e.prototype.transformDocument=function(t){if(this.addTypename){var e=this.typenameDocumentCache.get(t);return e||(e=pr(t),this.typenameDocumentCache.set(t,e),this.typenameDocumentCache.set(e,e)),e}return t},e.prototype.transformForLink=function(t){var e=this.config.fragments;return e?e.transform(t):t},e.prototype.broadcastWatches=function(t){var e=this;this.txCount||this.watches.forEach((function(r){return e.maybeBroadcastWatch(r,t)}))},e.prototype.broadcastWatch=function(t,e){var r=t.lastDiff,n=this.diff(t);e&&(t.optimistic&&"string"==typeof e.optimistic&&(n.fromOptimisticTransaction=!0),e.onWatchUpdated&&!1===e.onWatchUpdated.call(this,t,n,r))||r&&ze(r.result,n.result)||t.callback(t.lastDiff=n,r)},e}(Cn),Di=Nt.empty,Bi=Nt.from,Fi=Nt.split,Li=Nt.concat;function Ui(t){var e=!1;return new Promise((function(r,n){t.subscribe({next:function(t){e?__DEV__&&u.warn("Promise Wrapper does not support multiple results from Observable"):(e=!0,r(t))},error:n})}))}function qi(t){return new rt((function(e){t.then((function(t){e.next(t),e.complete()})).catch(e.error.bind(e))}))}var Vi=function(){return(Vi=Object.assign||function(t){for(var e,r=1,n=arguments.length;r120){for(var f=Math.floor(u/80),d=u%80,p=[],m=0;m0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=o&&o.stack?(Object.defineProperty(to(f),"stack",{value:o.stack,writable:!0,configurable:!0}),$i(f)):(Error.captureStackTrace?Error.captureStackTrace(to(f),a):Object.defineProperty(to(f),"stack",{value:Error().stack,writable:!0,configurable:!0}),f)}return n=a,(i=[{key:"toString",value:function(){return function(t){var e=t.message;if(t.nodes)for(var r=0,n=t.nodes;r",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"}),lo=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"}),ho=function(){function t(t){var e=new Rt(co.SOF,0,0,0,0,null);this.source=t,this.lastToken=e,this.token=e,this.line=1,this.lineStart=0}var e=t.prototype;return e.advance=function(){return this.lastToken=this.token,this.token=this.lookahead()},e.lookahead=function(){var t=this.token;if(t.kind!==co.EOF)do{var e;t=null!==(e=t.next)&&void 0!==e?e:t.next=po(this,t)}while(t.kind===co.COMMENT);return t},t}();function fo(t){return isNaN(t)?co.EOF:t<127?JSON.stringify(String.fromCharCode(t)):'"\\u'.concat(("00"+t.toString(16).toUpperCase()).slice(-4),'"')}function po(t,e){for(var r=t.source,n=r.body,i=n.length,o=e.end;o31||9===o));return new Rt(co.COMMENT,e,a,r,n,i,s.slice(e+1,a))}function vo(t,e,r,n,i,o){var s=t.body,a=r,u=e,c=!1;if(45===a&&(a=s.charCodeAt(++u)),48===a){if((a=s.charCodeAt(++u))>=48&&a<=57)throw uo(t,u,"Invalid number, unexpected digit after 0: ".concat(fo(a),"."))}else u=yo(t,u,a),a=s.charCodeAt(u);if(46===a&&(c=!0,a=s.charCodeAt(++u),u=yo(t,u,a),a=s.charCodeAt(u)),69!==a&&101!==a||(c=!0,43!==(a=s.charCodeAt(++u))&&45!==a||(a=s.charCodeAt(++u)),u=yo(t,u,a),a=s.charCodeAt(u)),46===a||function(t){return 95===t||t>=65&&t<=90||t>=97&&t<=122}(a))throw uo(t,u,"Invalid number, expected digit but got: ".concat(fo(a),"."));return new Rt(c?co.FLOAT:co.INT,e,u,n,i,o,s.slice(e,u))}function yo(t,e,r){var n=t.body,i=e,o=r;if(o>=48&&o<=57){do{o=n.charCodeAt(++i)}while(o>=48&&o<=57);return i}throw uo(t,i,"Invalid number, expected digit but got: ".concat(fo(o),"."))}function bo(t,e,r,n,i){for(var o,s,a,u,c=t.body,l=e+1,h=l,f=0,d="";l=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:-1}function Eo(t,e,r,n,i){for(var o=t.body,s=o.length,a=e+1,u=0;a!==s&&!isNaN(u=o.charCodeAt(a))&&(95===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++a;return new Rt(co.NAME,e,a,r,n,i,o.slice(e,a))}var Ao=function(){function t(t,e){var r=function(t){return k(t,M)}(t)?t:new M(t);this._lexer=new ho(r),this._options=e}var e=t.prototype;return e.parseName=function(){var t=this.expectToken(co.NAME);return{kind:ur.NAME,value:t.value,loc:this.loc(t)}},e.parseDocument=function(){var t=this._lexer.token;return{kind:ur.DOCUMENT,definitions:this.many(co.SOF,this.parseDefinition,co.EOF),loc:this.loc(t)}},e.parseDefinition=function(){if(this.peek(co.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(co.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},e.parseOperationDefinition=function(){var t=this._lexer.token;if(this.peek(co.BRACE_L))return{kind:ur.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(t)};var e,r=this.parseOperationType();return this.peek(co.NAME)&&(e=this.parseName()),{kind:ur.OPERATION_DEFINITION,operation:r,name:e,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},e.parseOperationType=function(){var t=this.expectToken(co.NAME);switch(t.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(t)},e.parseVariableDefinitions=function(){return this.optionalMany(co.PAREN_L,this.parseVariableDefinition,co.PAREN_R)},e.parseVariableDefinition=function(){var t=this._lexer.token;return{kind:ur.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(co.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(co.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(t)}},e.parseVariable=function(){var t=this._lexer.token;return this.expectToken(co.DOLLAR),{kind:ur.VARIABLE,name:this.parseName(),loc:this.loc(t)}},e.parseSelectionSet=function(){var t=this._lexer.token;return{kind:ur.SELECTION_SET,selections:this.many(co.BRACE_L,this.parseSelection,co.BRACE_R),loc:this.loc(t)}},e.parseSelection=function(){return this.peek(co.SPREAD)?this.parseFragment():this.parseField()},e.parseField=function(){var t,e,r=this._lexer.token,n=this.parseName();return this.expectOptionalToken(co.COLON)?(t=n,e=this.parseName()):e=n,{kind:ur.FIELD,alias:t,name:e,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(co.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(r)}},e.parseArguments=function(t){var e=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(co.PAREN_L,e,co.PAREN_R)},e.parseArgument=function(){var t=this._lexer.token,e=this.parseName();return this.expectToken(co.COLON),{kind:ur.ARGUMENT,name:e,value:this.parseValueLiteral(!1),loc:this.loc(t)}},e.parseConstArgument=function(){var t=this._lexer.token;return{kind:ur.ARGUMENT,name:this.parseName(),value:(this.expectToken(co.COLON),this.parseValueLiteral(!0)),loc:this.loc(t)}},e.parseFragment=function(){var t=this._lexer.token;this.expectToken(co.SPREAD);var e=this.expectOptionalKeyword("on");return!e&&this.peek(co.NAME)?{kind:ur.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(t)}:{kind:ur.INLINE_FRAGMENT,typeCondition:e?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(t)}},e.parseFragmentDefinition=function(){var t,e=this._lexer.token;return this.expectKeyword("fragment"),!0===(null===(t=this._options)||void 0===t?void 0:t.experimentalFragmentVariables)?{kind:ur.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:ur.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(e)}},e.parseFragmentName=function(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()},e.parseValueLiteral=function(t){var e=this._lexer.token;switch(e.kind){case co.BRACKET_L:return this.parseList(t);case co.BRACE_L:return this.parseObject(t);case co.INT:return this._lexer.advance(),{kind:ur.INT,value:e.value,loc:this.loc(e)};case co.FLOAT:return this._lexer.advance(),{kind:ur.FLOAT,value:e.value,loc:this.loc(e)};case co.STRING:case co.BLOCK_STRING:return this.parseStringLiteral();case co.NAME:switch(this._lexer.advance(),e.value){case"true":return{kind:ur.BOOLEAN,value:!0,loc:this.loc(e)};case"false":return{kind:ur.BOOLEAN,value:!1,loc:this.loc(e)};case"null":return{kind:ur.NULL,loc:this.loc(e)};default:return{kind:ur.ENUM,value:e.value,loc:this.loc(e)}}case co.DOLLAR:if(!t)return this.parseVariable()}throw this.unexpected()},e.parseStringLiteral=function(){var t=this._lexer.token;return this._lexer.advance(),{kind:ur.STRING,value:t.value,block:t.kind===co.BLOCK_STRING,loc:this.loc(t)}},e.parseList=function(t){var e=this,r=this._lexer.token;return{kind:ur.LIST,values:this.any(co.BRACKET_L,(function(){return e.parseValueLiteral(t)}),co.BRACKET_R),loc:this.loc(r)}},e.parseObject=function(t){var e=this,r=this._lexer.token;return{kind:ur.OBJECT,fields:this.any(co.BRACE_L,(function(){return e.parseObjectField(t)}),co.BRACE_R),loc:this.loc(r)}},e.parseObjectField=function(t){var e=this._lexer.token,r=this.parseName();return this.expectToken(co.COLON),{kind:ur.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t),loc:this.loc(e)}},e.parseDirectives=function(t){for(var e=[];this.peek(co.AT);)e.push(this.parseDirective(t));return e},e.parseDirective=function(t){var e=this._lexer.token;return this.expectToken(co.AT),{kind:ur.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t),loc:this.loc(e)}},e.parseTypeReference=function(){var t,e=this._lexer.token;return this.expectOptionalToken(co.BRACKET_L)?(t=this.parseTypeReference(),this.expectToken(co.BRACKET_R),t={kind:ur.LIST_TYPE,type:t,loc:this.loc(e)}):t=this.parseNamedType(),this.expectOptionalToken(co.BANG)?{kind:ur.NON_NULL_TYPE,type:t,loc:this.loc(e)}:t},e.parseNamedType=function(){var t=this._lexer.token;return{kind:ur.NAMED_TYPE,name:this.parseName(),loc:this.loc(t)}},e.parseTypeSystemDefinition=function(){var t=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(t.kind===co.NAME)switch(t.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(t)},e.peekDescription=function(){return this.peek(co.STRING)||this.peek(co.BLOCK_STRING)},e.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},e.parseSchemaDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("schema");var r=this.parseDirectives(!0),n=this.many(co.BRACE_L,this.parseOperationTypeDefinition,co.BRACE_R);return{kind:ur.SCHEMA_DEFINITION,description:e,directives:r,operationTypes:n,loc:this.loc(t)}},e.parseOperationTypeDefinition=function(){var t=this._lexer.token,e=this.parseOperationType();this.expectToken(co.COLON);var r=this.parseNamedType();return{kind:ur.OPERATION_TYPE_DEFINITION,operation:e,type:r,loc:this.loc(t)}},e.parseScalarTypeDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("scalar");var r=this.parseName(),n=this.parseDirectives(!0);return{kind:ur.SCALAR_TYPE_DEFINITION,description:e,name:r,directives:n,loc:this.loc(t)}},e.parseObjectTypeDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("type");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:ur.OBJECT_TYPE_DEFINITION,description:e,name:r,interfaces:n,directives:i,fields:o,loc:this.loc(t)}},e.parseImplementsInterfaces=function(){var t;if(!this.expectOptionalKeyword("implements"))return[];if(!0===(null===(t=this._options)||void 0===t?void 0:t.allowLegacySDLImplementsInterfaces)){var e=[];this.expectOptionalToken(co.AMP);do{e.push(this.parseNamedType())}while(this.expectOptionalToken(co.AMP)||this.peek(co.NAME));return e}return this.delimitedMany(co.AMP,this.parseNamedType)},e.parseFieldsDefinition=function(){var t;return!0===(null===(t=this._options)||void 0===t?void 0:t.allowLegacySDLEmptyFields)&&this.peek(co.BRACE_L)&&this._lexer.lookahead().kind===co.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(co.BRACE_L,this.parseFieldDefinition,co.BRACE_R)},e.parseFieldDefinition=function(){var t=this._lexer.token,e=this.parseDescription(),r=this.parseName(),n=this.parseArgumentDefs();this.expectToken(co.COLON);var i=this.parseTypeReference(),o=this.parseDirectives(!0);return{kind:ur.FIELD_DEFINITION,description:e,name:r,arguments:n,type:i,directives:o,loc:this.loc(t)}},e.parseArgumentDefs=function(){return this.optionalMany(co.PAREN_L,this.parseInputValueDef,co.PAREN_R)},e.parseInputValueDef=function(){var t=this._lexer.token,e=this.parseDescription(),r=this.parseName();this.expectToken(co.COLON);var n,i=this.parseTypeReference();this.expectOptionalToken(co.EQUALS)&&(n=this.parseValueLiteral(!0));var o=this.parseDirectives(!0);return{kind:ur.INPUT_VALUE_DEFINITION,description:e,name:r,type:i,defaultValue:n,directives:o,loc:this.loc(t)}},e.parseInterfaceTypeDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("interface");var r=this.parseName(),n=this.parseImplementsInterfaces(),i=this.parseDirectives(!0),o=this.parseFieldsDefinition();return{kind:ur.INTERFACE_TYPE_DEFINITION,description:e,name:r,interfaces:n,directives:i,fields:o,loc:this.loc(t)}},e.parseUnionTypeDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("union");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseUnionMemberTypes();return{kind:ur.UNION_TYPE_DEFINITION,description:e,name:r,directives:n,types:i,loc:this.loc(t)}},e.parseUnionMemberTypes=function(){return this.expectOptionalToken(co.EQUALS)?this.delimitedMany(co.PIPE,this.parseNamedType):[]},e.parseEnumTypeDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("enum");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseEnumValuesDefinition();return{kind:ur.ENUM_TYPE_DEFINITION,description:e,name:r,directives:n,values:i,loc:this.loc(t)}},e.parseEnumValuesDefinition=function(){return this.optionalMany(co.BRACE_L,this.parseEnumValueDefinition,co.BRACE_R)},e.parseEnumValueDefinition=function(){var t=this._lexer.token,e=this.parseDescription(),r=this.parseName(),n=this.parseDirectives(!0);return{kind:ur.ENUM_VALUE_DEFINITION,description:e,name:r,directives:n,loc:this.loc(t)}},e.parseInputObjectTypeDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("input");var r=this.parseName(),n=this.parseDirectives(!0),i=this.parseInputFieldsDefinition();return{kind:ur.INPUT_OBJECT_TYPE_DEFINITION,description:e,name:r,directives:n,fields:i,loc:this.loc(t)}},e.parseInputFieldsDefinition=function(){return this.optionalMany(co.BRACE_L,this.parseInputValueDef,co.BRACE_R)},e.parseTypeSystemExtension=function(){var t=this._lexer.lookahead();if(t.kind===co.NAME)switch(t.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(t)},e.parseSchemaExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var e=this.parseDirectives(!0),r=this.optionalMany(co.BRACE_L,this.parseOperationTypeDefinition,co.BRACE_R);if(0===e.length&&0===r.length)throw this.unexpected();return{kind:ur.SCHEMA_EXTENSION,directives:e,operationTypes:r,loc:this.loc(t)}},e.parseScalarTypeExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var e=this.parseName(),r=this.parseDirectives(!0);if(0===r.length)throw this.unexpected();return{kind:ur.SCALAR_TYPE_EXTENSION,name:e,directives:r,loc:this.loc(t)}},e.parseObjectTypeExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var e=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:ur.OBJECT_TYPE_EXTENSION,name:e,interfaces:r,directives:n,fields:i,loc:this.loc(t)}},e.parseInterfaceTypeExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var e=this.parseName(),r=this.parseImplementsInterfaces(),n=this.parseDirectives(!0),i=this.parseFieldsDefinition();if(0===r.length&&0===n.length&&0===i.length)throw this.unexpected();return{kind:ur.INTERFACE_TYPE_EXTENSION,name:e,interfaces:r,directives:n,fields:i,loc:this.loc(t)}},e.parseUnionTypeExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var e=this.parseName(),r=this.parseDirectives(!0),n=this.parseUnionMemberTypes();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:ur.UNION_TYPE_EXTENSION,name:e,directives:r,types:n,loc:this.loc(t)}},e.parseEnumTypeExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var e=this.parseName(),r=this.parseDirectives(!0),n=this.parseEnumValuesDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:ur.ENUM_TYPE_EXTENSION,name:e,directives:r,values:n,loc:this.loc(t)}},e.parseInputObjectTypeExtension=function(){var t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var e=this.parseName(),r=this.parseDirectives(!0),n=this.parseInputFieldsDefinition();if(0===r.length&&0===n.length)throw this.unexpected();return{kind:ur.INPUT_OBJECT_TYPE_EXTENSION,name:e,directives:r,fields:n,loc:this.loc(t)}},e.parseDirectiveDefinition=function(){var t=this._lexer.token,e=this.parseDescription();this.expectKeyword("directive"),this.expectToken(co.AT);var r=this.parseName(),n=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var o=this.parseDirectiveLocations();return{kind:ur.DIRECTIVE_DEFINITION,description:e,name:r,arguments:n,repeatable:i,locations:o,loc:this.loc(t)}},e.parseDirectiveLocations=function(){return this.delimitedMany(co.PIPE,this.parseDirectiveLocation)},e.parseDirectiveLocation=function(){var t=this._lexer.token,e=this.parseName();if(void 0!==lo[e.value])return e;throw this.unexpected(t)},e.loc=function(t){var e;if(!0!==(null===(e=this._options)||void 0===e?void 0:e.noLocation))return new Pt(t,this._lexer.lastToken,this._lexer.source)},e.peek=function(t){return this._lexer.token.kind===t},e.expectToken=function(t){var e=this._lexer.token;if(e.kind===t)return this._lexer.advance(),e;throw uo(this._lexer.source,e.start,"Expected ".concat(ko(t),", found ").concat(Oo(e),"."))},e.expectOptionalToken=function(t){var e=this._lexer.token;if(e.kind===t)return this._lexer.advance(),e},e.expectKeyword=function(t){var e=this._lexer.token;if(e.kind!==co.NAME||e.value!==t)throw uo(this._lexer.source,e.start,'Expected "'.concat(t,'", found ').concat(Oo(e),"."));this._lexer.advance()},e.expectOptionalKeyword=function(t){var e=this._lexer.token;return e.kind===co.NAME&&e.value===t&&(this._lexer.advance(),!0)},e.unexpected=function(t){var e=null!=t?t:this._lexer.token;return uo(this._lexer.source,e.start,"Unexpected ".concat(Oo(e),"."))},e.any=function(t,e,r){this.expectToken(t);for(var n=[];!this.expectOptionalToken(r);)n.push(e.call(this));return n},e.optionalMany=function(t,e,r){if(this.expectOptionalToken(t)){var n=[];do{n.push(e.call(this))}while(!this.expectOptionalToken(r));return n}return[]},e.many=function(t,e,r){this.expectToken(t);var n=[];do{n.push(e.call(this))}while(!this.expectOptionalToken(r));return n},e.delimitedMany=function(t,e){this.expectOptionalToken(t);var r=[];do{r.push(e.call(this))}while(this.expectOptionalToken(t));return r},t}();function Oo(t){var e=t.value;return ko(t.kind)+(null!=e?' "'.concat(e,'"'):"")}function ko(t){return function(t){return t===co.BANG||t===co.DOLLAR||t===co.AMP||t===co.PAREN_L||t===co.PAREN_R||t===co.SPREAD||t===co.COLON||t===co.EQUALS||t===co.AT||t===co.BRACKET_L||t===co.BRACKET_R||t===co.BRACE_L||t===co.PIPE||t===co.BRACE_R}(t)?'"'.concat(t,'"'):t}var So=new Map,Mo=new Map,To=!0,No=!1;function xo(t){return t.replace(/[\s,]+/g," ").trim()}function Io(t){var e=new Set,r=[];return t.definitions.forEach((function(t){if("FragmentDefinition"===t.kind){var n=t.name.value,i=xo((s=t.loc).source.body.substring(s.start,s.end)),o=Mo.get(n);o&&!o.has(i)?To&&console.warn("Warning: fragment with name "+n+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||Mo.set(n,o=new Set),o.add(i),e.has(i)||(e.add(i),r.push(t))}else r.push(t);var s})),Vi(Vi({},t),{definitions:r})}function Po(t){var e=xo(t);if(!So.has(e)){var r=function(t,e){return new Ao(t,e).parseDocument()}(t,{experimentalFragmentVariables:No,allowLegacyFragmentVariables:No});if(!r||"Document"!==r.kind)throw new Error("Not a valid GraphQL document.");So.set(e,function(t){var e=new Set(t.definitions);e.forEach((function(t){t.loc&&delete t.loc,Object.keys(t).forEach((function(r){var n=t[r];n&&"object"==typeof n&&e.add(n)}))}));var r=t.loc;return r&&(delete r.startToken,delete r.endToken),t}(Io(r)))}return So.get(e)}function Ro(t){for(var e=[],r=1;r(t[e]=r,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function h(t){return t!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(i||(i=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(p(this),e),d(o.get(this))}:function(...e){return d(t.apply(p(this),e))}:function(e,...r){const n=t.call(p(this),e,...r);return a.set(n,e.sort?e.sort():[e]),d(n)}}function f(t){return"function"==typeof t?h(t):(t instanceof IDBTransaction&&function(t){if(s.has(t))return;const e=new Promise((e,r)=>{const n=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",o),t.removeEventListener("abort",o)},i=()=>{e(),n()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),n()};t.addEventListener("complete",i),t.addEventListener("error",o),t.addEventListener("abort",o)});s.set(t,e)}(t),e=t,(n||(n=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(t=>e instanceof t)?new Proxy(t,l):t);var e}function d(t){if(t instanceof IDBRequest)return function(t){const e=new Promise((e,r)=>{const n=()=>{t.removeEventListener("success",i),t.removeEventListener("error",o)},i=()=>{e(d(t.result)),n()},o=()=>{r(t.error),n()};t.addEventListener("success",i),t.addEventListener("error",o)});return e.then(e=>{e instanceof IDBCursor&&o.set(e,t)}).catch(()=>{}),c.set(e,t),e}(t);if(u.has(t))return u.get(t);const e=f(t);return e!==t&&(u.set(t,e),c.set(e,t)),e}const p=t=>c.get(t);function m(t,e,{blocked:r,upgrade:n,blocking:i,terminated:o}={}){const s=indexedDB.open(t,e),a=d(s);return n&&s.addEventListener("upgradeneeded",t=>{n(d(s.result),t.oldVersion,t.newVersion,d(s.transaction))}),r&&s.addEventListener("blocked",()=>r()),a.then(t=>{o&&t.addEventListener("close",()=>o()),i&&t.addEventListener("versionchange",()=>i())}).catch(()=>{}),a}function g(t,{blocked:e}={}){const r=indexedDB.deleteDatabase(t);return e&&r.addEventListener("blocked",()=>e()),d(r).then(()=>{})}const v=["get","getKey","getAll","getAllKeys","count"],y=["put","add","delete","clear"],b=new Map;function w(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(b.get(e))return b.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,i=y.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!i&&!v.includes(r))return;const o=async function(t,...e){const o=this.transaction(t,i?"readwrite":"readonly");let s=o.store;return n&&(s=s.index(e.shift())),(await Promise.all([s[r](...e),i&&o.done]))[0]};return b.set(e,o),o}l=(t=>({...t,get:(e,r,n)=>w(e,r)||t.get(e,r,n),has:(e,r)=>!!w(e,r)||t.has(e,r)}))(l)},,function(t,e,r){"use strict";(function(t){r.d(e,"a",(function(){return c}));var n=r(0),i=r(2),o=r(43);const s=new i.b(o.a);const a=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==t)return t;throw new Error("unable to locate global object")}();let u=a.crypto||a.msCrypto;function c(t){(t<=0||t>1024||t%1||t!=t)&&s.throwArgumentError("invalid length","length",t);const e=new Uint8Array(t);return u.getRandomValues(e),Object(n.a)(e)}u&&u.getRandomValues||(s.warn("WARNING: Missing strong random number source"),u={getRandomValues:function(t){return s.throwError("no secure random source avaialble",i.b.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r(12))}]); \ No newline at end of file