@stonecrop/graphql-client 0.4.5 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,20 @@
1
- (function(Z,de){typeof exports=="object"&&typeof module<"u"?de(exports):typeof define=="function"&&define.amd?define(["exports"],de):(Z=typeof globalThis<"u"?globalThis:Z||self,de(Z["@stonecrop/graphql-client"]={}))})(this,function(Z){"use strict";function de(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in e)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}/*!
1
+ (function(Z,he){typeof exports=="object"&&typeof module<"u"?he(exports):typeof define=="function"&&define.amd?define(["exports"],he):(Z=typeof globalThis<"u"?globalThis:Z||self,he(Z["@stonecrop/graphql-client"]={}))})(this,function(Z){"use strict";function he(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in e)){const s=Object.getOwnPropertyDescriptor(i,r);s&&Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}/*!
2
2
  * decimal.js v10.4.3
3
3
  * An arbitrary-precision Decimal type for JavaScript.
4
4
  * https://github.com/MikeMcl/decimal.js
5
5
  * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
6
6
  * MIT Licence
7
- */var oe=9e15,W=1e9,Fe="0123456789abcdef",ve="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",we="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Pe={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-oe,maxE:oe,crypto:!1},Ke,Q,O=!0,Te="[DecimalError] ",K=Te+"Invalid argument: ",et=Te+"Precision limit exceeded",tt=Te+"crypto unavailable",nt="[object Decimal]",U=Math.floor,F=Math.pow,kt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Rt=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Lt=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,it=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,G=1e7,A=7,Ft=9007199254740991,Pt=ve.length-1,Me=we.length-1,m={toStringTag:nt};m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),T(e)},m.ceil=function(){return T(new this.constructor(this),this.e+1,2)},m.clampedTo=m.clamp=function(e,t){var n,i=this,r=i.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(K+t);return n=i.cmp(e),n<0?e:i.cmp(t)>0?t:new r(i)},m.comparedTo=m.cmp=function(e){var t,n,i,r,s=this,o=s.d,a=(e=new s.constructor(e)).d,u=s.s,c=e.s;if(!o||!a)return!u||!c?NaN:u!==c?u:o===a?0:!o^u<0?1:-1;if(!o[0]||!a[0])return o[0]?u:a[0]?-c:0;if(u!==c)return u;if(s.e!==e.e)return s.e>e.e^u<0?1:-1;for(i=o.length,r=a.length,t=0,n=i<r?i:r;t<n;++t)if(o[t]!==a[t])return o[t]>a[t]^u<0?1:-1;return i===r?0:i>r^u<0?1:-1},m.cosine=m.cos=function(){var e,t,n=this,i=n.constructor;return n.d?n.d[0]?(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+A,i.rounding=1,n=Mt(i,ut(i,n)),i.precision=e,i.rounding=t,T(Q==2||Q==3?n.neg():n,e,t,!0)):new i(1):new i(NaN)},m.cubeRoot=m.cbrt=function(){var e,t,n,i,r,s,o,a,u,c,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(O=!1,s=l.s*F(l.s*l,1/3),!s||Math.abs(s)==1/0?(n=M(l.d),e=l.e,(s=(e-n.length+1)%3)&&(n+=s==1||s==-2?"0":"00"),s=F(n,1/3),e=U((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?n="5e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),i=new f(n),i.s=l.s):i=new f(s.toString()),o=(e=f.precision)+3;;)if(a=i,u=a.times(a).times(a),c=u.plus(l),i=C(c.plus(l).times(a),c.plus(u),o+2,1),M(a.d).slice(0,o)===(n=M(i.d)).slice(0,o))if(n=n.slice(o-3,o+1),n=="9999"||!r&&n=="4999"){if(!r&&(T(a,e+1,0),a.times(a).times(a).eq(l))){i=a;break}o+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(T(i,e+1,1),t=!i.times(i).times(i).eq(l));break}return O=!0,T(i,e,f.rounding,t)},m.decimalPlaces=m.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-U(this.e/A))*A,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},m.dividedBy=m.div=function(e){return C(this,new this.constructor(e))},m.dividedToIntegerBy=m.divToInt=function(e){var t=this,n=t.constructor;return T(C(t,new n(e),0,1,1),n.precision,n.rounding)},m.equals=m.eq=function(e){return this.cmp(e)===0},m.floor=function(){return T(new this.constructor(this),this.e+1,3)},m.greaterThan=m.gt=function(e){return this.cmp(e)>0},m.greaterThanOrEqualTo=m.gte=function(e){var t=this.cmp(e);return t==1||t===0},m.hyperbolicCosine=m.cosh=function(){var e,t,n,i,r,s=this,o=s.constructor,a=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return a;n=o.precision,i=o.rounding,o.precision=n+Math.max(s.e,s.sd())+4,o.rounding=1,r=s.d.length,r<32?(e=Math.ceil(r/3),t=(1/_e(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),s=ae(o,1,s.times(t),new o(1),!0);for(var u,c=e,l=new o(8);c--;)u=s.times(s),s=a.minus(u.times(l.minus(u.times(l))));return T(s,o.precision=n,o.rounding=i,!0)},m.hyperbolicSine=m.sinh=function(){var e,t,n,i,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(t=s.precision,n=s.rounding,s.precision=t+Math.max(r.e,r.sd())+4,s.rounding=1,i=r.d.length,i<3)r=ae(s,2,r,r,!0);else{e=1.4*Math.sqrt(i),e=e>16?16:e|0,r=r.times(1/_e(5,e)),r=ae(s,2,r,r,!0);for(var o,a=new s(5),u=new s(16),c=new s(20);e--;)o=r.times(r),r=r.times(a.plus(o.times(u.times(o).plus(c))))}return s.precision=t,s.rounding=n,T(r,t,n,!0)},m.hyperbolicTangent=m.tanh=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+7,i.rounding=1,C(n.sinh(),n.cosh(),i.precision=e,i.rounding=t)):new i(n.s)},m.inverseCosine=m.acos=function(){var e,t=this,n=t.constructor,i=t.abs().cmp(1),r=n.precision,s=n.rounding;return i!==-1?i===0?t.isNeg()?Y(n,r,s):new n(0):new n(NaN):t.isZero()?Y(n,r+4,s).times(.5):(n.precision=r+6,n.rounding=1,t=t.asin(),e=Y(n,r+4,s).times(.5),n.precision=r,n.rounding=s,e.minus(t))},m.inverseHyperbolicCosine=m.acosh=function(){var e,t,n=this,i=n.constructor;return n.lte(1)?new i(n.eq(1)?0:NaN):n.isFinite()?(e=i.precision,t=i.rounding,i.precision=e+Math.max(Math.abs(n.e),n.sd())+4,i.rounding=1,O=!1,n=n.times(n).minus(1).sqrt().plus(n),O=!0,i.precision=e,i.rounding=t,n.ln()):new i(n)},m.inverseHyperbolicSine=m.asinh=function(){var e,t,n=this,i=n.constructor;return!n.isFinite()||n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,i.rounding=1,O=!1,n=n.times(n).plus(1).sqrt().plus(n),O=!0,i.precision=e,i.rounding=t,n.ln())},m.inverseHyperbolicTangent=m.atanh=function(){var e,t,n,i,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=s.precision,t=s.rounding,i=r.sd(),Math.max(i,e)<2*-r.e-1?T(new s(r),e,t,!0):(s.precision=n=i-r.e,r=C(r.plus(1),new s(1).minus(r),n+e,1),s.precision=e+4,s.rounding=1,r=r.ln(),s.precision=e,s.rounding=t,r.times(.5))):new s(NaN)},m.inverseSine=m.asin=function(){var e,t,n,i,r=this,s=r.constructor;return r.isZero()?new s(r):(t=r.abs().cmp(1),n=s.precision,i=s.rounding,t!==-1?t===0?(e=Y(s,n+4,i).times(.5),e.s=r.s,e):new s(NaN):(s.precision=n+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=n,s.rounding=i,r.times(2)))},m.inverseTangent=m.atan=function(){var e,t,n,i,r,s,o,a,u,c=this,l=c.constructor,f=l.precision,h=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&f+4<=Me)return o=Y(l,f+4,h).times(.25),o.s=c.s,o}else{if(!c.s)return new l(NaN);if(f+4<=Me)return o=Y(l,f+4,h).times(.5),o.s=c.s,o}for(l.precision=a=f+10,l.rounding=1,n=Math.min(28,a/A+2|0),e=n;e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(O=!1,t=Math.ceil(a/A),i=1,u=c.times(c),o=new l(c),r=c;e!==-1;)if(r=r.times(u),s=o.minus(r.div(i+=2)),r=r.times(u),o=s.plus(r.div(i+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===s.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),O=!0,T(o,l.precision=f,l.rounding=h,!0)},m.isFinite=function(){return!!this.d},m.isInteger=m.isInt=function(){return!!this.d&&U(this.e/A)>this.d.length-2},m.isNaN=function(){return!this.s},m.isNegative=m.isNeg=function(){return this.s<0},m.isPositive=m.isPos=function(){return this.s>0},m.isZero=function(){return!!this.d&&this.d[0]===0},m.lessThan=m.lt=function(e){return this.cmp(e)<0},m.lessThanOrEqualTo=m.lte=function(e){return this.cmp(e)<1},m.logarithm=m.log=function(e){var t,n,i,r,s,o,a,u,c=this,l=c.constructor,f=l.precision,h=l.rounding,E=5;if(e==null)e=new l(10),t=!0;else{if(e=new l(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new l(n&&!n[0]?-1/0:c.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)s=!0;else{for(r=n[0];r%10===0;)r/=10;s=r!==1}if(O=!1,a=f+E,o=te(c,a),i=t?Oe(l,a+10):te(e,a),u=C(o,i,a,1),pe(u.d,r=f,h))do if(a+=10,o=te(c,a),i=t?Oe(l,a+10):te(e,a),u=C(o,i,a,1),!s){+M(u.d).slice(r+1,r+15)+1==1e14&&(u=T(u,f+1,0));break}while(pe(u.d,r+=10,h));return O=!0,T(u,f,h)},m.minus=m.sub=function(e){var t,n,i,r,s,o,a,u,c,l,f,h,E=this,N=E.constructor;if(e=new N(e),!E.d||!e.d)return!E.s||!e.s?e=new N(NaN):E.d?e.s=-e.s:e=new N(e.d||E.s!==e.s?E:NaN),e;if(E.s!=e.s)return e.s=-e.s,E.plus(e);if(c=E.d,h=e.d,a=N.precision,u=N.rounding,!c[0]||!h[0]){if(h[0])e.s=-e.s;else if(c[0])e=new N(E);else return new N(u===3?-0:0);return O?T(e,a,u):e}if(n=U(e.e/A),l=U(E.e/A),c=c.slice(),s=l-n,s){for(f=s<0,f?(t=c,s=-s,o=h.length):(t=h,n=l,o=c.length),i=Math.max(Math.ceil(a/A),o)+2,s>i&&(s=i,t.length=1),t.reverse(),i=s;i--;)t.push(0);t.reverse()}else{for(i=c.length,o=h.length,f=i<o,f&&(o=i),i=0;i<o;i++)if(c[i]!=h[i]){f=c[i]<h[i];break}s=0}for(f&&(t=c,c=h,h=t,e.s=-e.s),o=c.length,i=h.length-o;i>0;--i)c[o++]=0;for(i=h.length;i>s;){if(c[--i]<h[i]){for(r=i;r&&c[--r]===0;)c[r]=G-1;--c[r],c[i]+=G}c[i]-=h[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(e.d=c,e.e=Ie(c,n),O?T(e,a,u):e):new N(u===3?-0:0)},m.modulo=m.mod=function(e){var t,n=this,i=n.constructor;return e=new i(e),!n.d||!e.s||e.d&&!e.d[0]?new i(NaN):!e.d||n.d&&!n.d[0]?T(new i(n),i.precision,i.rounding):(O=!1,i.modulo==9?(t=C(n,e.abs(),0,3,1),t.s*=e.s):t=C(n,e,0,i.modulo,1),t=t.times(e),O=!0,n.minus(t))},m.naturalExponential=m.exp=function(){return Be(this)},m.naturalLogarithm=m.ln=function(){return te(this)},m.negated=m.neg=function(){var e=new this.constructor(this);return e.s=-e.s,T(e)},m.plus=m.add=function(e){var t,n,i,r,s,o,a,u,c,l,f=this,h=f.constructor;if(e=new h(e),!f.d||!e.d)return!f.s||!e.s?e=new h(NaN):f.d||(e=new h(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(c=f.d,l=e.d,a=h.precision,u=h.rounding,!c[0]||!l[0])return l[0]||(e=new h(f)),O?T(e,a,u):e;if(s=U(f.e/A),i=U(e.e/A),c=c.slice(),r=s-i,r){for(r<0?(n=c,r=-r,o=l.length):(n=l,i=s,o=c.length),s=Math.ceil(a/A),o=s>o?s+1:o+1,r>o&&(r=o,n.length=1),n.reverse();r--;)n.push(0);n.reverse()}for(o=c.length,r=l.length,o-r<0&&(r=o,n=l,l=c,c=n),t=0;r;)t=(c[--r]=c[r]+l[r]+t)/G|0,c[r]%=G;for(t&&(c.unshift(t),++i),o=c.length;c[--o]==0;)c.pop();return e.d=c,e.e=Ie(c,i),O?T(e,a,u):e},m.precision=m.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(K+e);return n.d?(t=rt(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},m.round=function(){var e=this,t=e.constructor;return T(new t(e),e.e+1,t.rounding)},m.sine=m.sin=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+A,i.rounding=1,n=Ut(i,ut(i,n)),i.precision=e,i.rounding=t,T(Q>2?n.neg():n,e,t,!0)):new i(NaN)},m.squareRoot=m.sqrt=function(){var e,t,n,i,r,s,o=this,a=o.d,u=o.e,c=o.s,l=o.constructor;if(c!==1||!a||!a[0])return new l(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);for(O=!1,c=Math.sqrt(+o),c==0||c==1/0?(t=M(a),(t.length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=U((u+1)/2)-(u<0||u%2),c==1/0?t="5e"+u:(t=c.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),i=new l(t)):i=new l(c.toString()),n=(u=l.precision)+3;;)if(s=i,i=s.plus(C(o,s,n+2,1)).times(.5),M(s.d).slice(0,n)===(t=M(i.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!r&&t=="4999"){if(!r&&(T(s,u+1,0),s.times(s).eq(o))){i=s;break}n+=4,r=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(T(i,u+1,1),e=!i.times(i).eq(o));break}return O=!0,T(i,u,l.rounding,e)},m.tangent=m.tan=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+10,i.rounding=1,n=n.sin(),n.s=1,n=C(n,new i(1).minus(n.times(n)).sqrt(),e+10,0),i.precision=e,i.rounding=t,T(Q==2||Q==4?n.neg():n,e,t,!0)):new i(NaN)},m.times=m.mul=function(e){var t,n,i,r,s,o,a,u,c,l=this,f=l.constructor,h=l.d,E=(e=new f(e)).d;if(e.s*=l.s,!h||!h[0]||!E||!E[0])return new f(!e.s||h&&!h[0]&&!E||E&&!E[0]&&!h?NaN:!h||!E?e.s/0:e.s*0);for(n=U(l.e/A)+U(e.e/A),u=h.length,c=E.length,u<c&&(s=h,h=E,E=s,o=u,u=c,c=o),s=[],o=u+c,i=o;i--;)s.push(0);for(i=c;--i>=0;){for(t=0,r=u+i;r>i;)a=s[r]+E[i]*h[r-i-1]+t,s[r--]=a%G|0,t=a/G|0;s[r]=(s[r]+t)%G|0}for(;!s[--o];)s.pop();return t?++n:s.shift(),e.d=s,e.e=Ie(s,n),O?T(e,f.precision,f.rounding):e},m.toBinary=function(e,t){return qe(this,2,e,t)},m.toDecimalPlaces=m.toDP=function(e,t){var n=this,i=n.constructor;return n=new i(n),e===void 0?n:(j(e,0,W),t===void 0?t=i.rounding:j(t,0,8),T(n,e+n.e+1,t))},m.toExponential=function(e,t){var n,i=this,r=i.constructor;return e===void 0?n=X(i,!0):(j(e,0,W),t===void 0?t=r.rounding:j(t,0,8),i=T(new r(i),e+1,t),n=X(i,!0,e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},m.toFixed=function(e,t){var n,i,r=this,s=r.constructor;return e===void 0?n=X(r):(j(e,0,W),t===void 0?t=s.rounding:j(t,0,8),i=T(new s(r),e+r.e+1,t),n=X(i,!1,e+i.e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},m.toFraction=function(e){var t,n,i,r,s,o,a,u,c,l,f,h,E=this,N=E.d,y=E.constructor;if(!N)return new y(E);if(c=n=new y(1),i=u=new y(0),t=new y(i),s=t.e=rt(N)-E.e-1,o=s%A,t.d[0]=F(10,o<0?A+o:o),e==null)e=s>0?t:c;else{if(a=new y(e),!a.isInt()||a.lt(c))throw Error(K+a);e=a.gt(t)?s>0?t:c:a}for(O=!1,a=new y(M(N)),l=y.precision,y.precision=s=N.length*A*2;f=C(a,t,0,1,1),r=n.plus(f.times(i)),r.cmp(e)!=1;)n=i,i=r,r=c,c=u.plus(f.times(r)),u=r,r=t,t=a.minus(f.times(r)),a=r;return r=C(e.minus(n),i,0,1,1),u=u.plus(r.times(c)),n=n.plus(r.times(i)),u.s=c.s=E.s,h=C(c,i,s,1).minus(E).abs().cmp(C(u,n,s,1).minus(E).abs())<1?[c,i]:[u,n],y.precision=l,O=!0,h},m.toHexadecimal=m.toHex=function(e,t){return qe(this,16,e,t)},m.toNearest=function(e,t){var n=this,i=n.constructor;if(n=new i(n),e==null){if(!n.d)return n;e=new i(1),t=i.rounding}else{if(e=new i(e),t===void 0?t=i.rounding:j(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(O=!1,n=C(n,e,0,t,1).times(e),O=!0,T(n)):(e.s=n.s,n=e),n},m.toNumber=function(){return+this},m.toOctal=function(e,t){return qe(this,8,e,t)},m.toPower=m.pow=function(e){var t,n,i,r,s,o,a=this,u=a.constructor,c=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(F(+a,c));if(a=new u(a),a.eq(1))return a;if(i=u.precision,s=u.rounding,e.eq(1))return T(a,i,s);if(t=U(e.e/A),t>=e.d.length-1&&(n=c<0?-c:c)<=Ft)return r=st(u,a,n,i),e.s<0?new u(1).div(r):T(r,i,s);if(o=a.s,o<0){if(t<e.d.length-1)return new u(NaN);if(e.d[t]&1||(o=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=o,a}return n=F(+a,c),t=n==0||!isFinite(n)?U(c*(Math.log("0."+M(a.d))/Math.LN10+a.e+1)):new u(n+"").e,t>u.maxE+1||t<u.minE-1?new u(t>0?o/0:0):(O=!1,u.rounding=a.s=1,n=Math.min(12,(t+"").length),r=Be(e.times(te(a,i+n)),i),r.d&&(r=T(r,i+5,1),pe(r.d,i,s)&&(t=i+10,r=T(Be(e.times(te(a,t+n)),t),t+5,1),+M(r.d).slice(i+1,i+15)+1==1e14&&(r=T(r,i+1,0)))),r.s=o,O=!0,u.rounding=s,T(r,i,s))},m.toPrecision=function(e,t){var n,i=this,r=i.constructor;return e===void 0?n=X(i,i.e<=r.toExpNeg||i.e>=r.toExpPos):(j(e,1,W),t===void 0?t=r.rounding:j(t,0,8),i=T(new r(i),e,t),n=X(i,e<=i.e||i.e<=r.toExpNeg,e)),i.isNeg()&&!i.isZero()?"-"+n:n},m.toSignificantDigits=m.toSD=function(e,t){var n=this,i=n.constructor;return e===void 0?(e=i.precision,t=i.rounding):(j(e,1,W),t===void 0?t=i.rounding:j(t,0,8)),T(new i(n),e,t)},m.toString=function(){var e=this,t=e.constructor,n=X(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},m.truncated=m.trunc=function(){return T(new this.constructor(this),this.e+1,1)},m.valueOf=m.toJSON=function(){var e=this,t=e.constructor,n=X(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function M(e){var t,n,i,r=e.length-1,s="",o=e[0];if(r>0){for(s+=o,t=1;t<r;t++)i=e[t]+"",n=A-i.length,n&&(s+=ee(n)),s+=i;o=e[t],i=o+"",n=A-i.length,n&&(s+=ee(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}function j(e,t,n){if(e!==~~e||e<t||e>n)throw Error(K+e)}function pe(e,t,n,i){var r,s,o,a;for(s=e[0];s>=10;s/=10)--t;return--t<0?(t+=A,r=0):(r=Math.ceil((t+1)/A),t%=A),s=F(10,A-t),a=e[r]%s|0,i==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),o=n<4&&a==99999||n>3&&a==49999||a==5e4||a==0):o=(n<4&&a+1==s||n>3&&a+1==s/2)&&(e[r+1]/s/100|0)==F(10,t-2)-1||(a==s/2||a==0)&&(e[r+1]/s/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),o=(i||n<4)&&a==9999||!i&&n>3&&a==4999):o=((i||n<4)&&a+1==s||!i&&n>3&&a+1==s/2)&&(e[r+1]/s/1e3|0)==F(10,t-3)-1,o}function Ae(e,t,n){for(var i,r=[0],s,o=0,a=e.length;o<a;){for(s=r.length;s--;)r[s]*=t;for(r[0]+=Fe.indexOf(e.charAt(o++)),i=0;i<r.length;i++)r[i]>n-1&&(r[i+1]===void 0&&(r[i+1]=0),r[i+1]+=r[i]/n|0,r[i]%=n)}return r.reverse()}function Mt(e,t){var n,i,r;if(t.isZero())return t;i=t.d.length,i<32?(n=Math.ceil(i/3),r=(1/_e(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10"),e.precision+=n,t=ae(e,1,t.times(r),new e(1));for(var s=n;s--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var C=function(){function e(i,r,s){var o,a=0,u=i.length;for(i=i.slice();u--;)o=i[u]*r+a,i[u]=o%s|0,a=o/s|0;return a&&i.unshift(a),i}function t(i,r,s,o){var a,u;if(s!=o)u=s>o?1:-1;else for(a=u=0;a<s;a++)if(i[a]!=r[a]){u=i[a]>r[a]?1:-1;break}return u}function n(i,r,s,o){for(var a=0;s--;)i[s]-=a,a=i[s]<r[s]?1:0,i[s]=a*o+i[s]-r[s];for(;!i[0]&&i.length>1;)i.shift()}return function(i,r,s,o,a,u){var c,l,f,h,E,N,y,S,b,q,_,x,z,$,ne,H,se,Ne,R,he,ie=i.constructor,d=i.s==r.s?1:-1,g=i.d,v=r.d;if(!g||!g[0]||!v||!v[0])return new ie(!i.s||!r.s||(g?v&&g[0]==v[0]:!v)?NaN:g&&g[0]==0||!v?d*0:d/0);for(u?(E=1,l=i.e-r.e):(u=G,E=A,l=U(i.e/E)-U(r.e/E)),R=v.length,se=g.length,b=new ie(d),q=b.d=[],f=0;v[f]==(g[f]||0);f++);if(v[f]>(g[f]||0)&&l--,s==null?($=s=ie.precision,o=ie.rounding):a?$=s+(i.e-r.e)+1:$=s,$<0)q.push(1),N=!0;else{if($=$/E+2|0,f=0,R==1){for(h=0,v=v[0],$++;(f<se||h)&&$--;f++)ne=h*u+(g[f]||0),q[f]=ne/v|0,h=ne%v|0;N=h||f<se}else{for(h=u/(v[0]+1)|0,h>1&&(v=e(v,h,u),g=e(g,h,u),R=v.length,se=g.length),H=R,_=g.slice(0,R),x=_.length;x<R;)_[x++]=0;he=v.slice(),he.unshift(0),Ne=v[0],v[1]>=u/2&&++Ne;do h=0,c=t(v,_,R,x),c<0?(z=_[0],R!=x&&(z=z*u+(_[1]||0)),h=z/Ne|0,h>1?(h>=u&&(h=u-1),y=e(v,h,u),S=y.length,x=_.length,c=t(y,_,S,x),c==1&&(h--,n(y,R<S?he:v,S,u))):(h==0&&(c=h=1),y=v.slice()),S=y.length,S<x&&y.unshift(0),n(_,y,x,u),c==-1&&(x=_.length,c=t(v,_,R,x),c<1&&(h++,n(_,R<x?he:v,x,u))),x=_.length):c===0&&(h++,_=[0]),q[f++]=h,c&&_[0]?_[x++]=g[H]||0:(_=[g[H]],x=1);while((H++<se||_[0]!==void 0)&&$--);N=_[0]!==void 0}q[0]||q.shift()}if(E==1)b.e=l,Ke=N;else{for(f=1,h=q[0];h>=10;h/=10)f++;b.e=f+l*E-1,T(b,a?s+b.e+1:s,o,N)}return b}}();function T(e,t,n,i){var r,s,o,a,u,c,l,f,h,E=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(r=1,a=f[0];a>=10;a/=10)r++;if(s=t-r,s<0)s+=A,o=t,l=f[h=0],u=l/F(10,r-o-1)%10|0;else if(h=Math.ceil((s+1)/A),a=f.length,h>=a)if(i){for(;a++<=h;)f.push(0);l=u=0,r=1,s%=A,o=s-A+1}else break e;else{for(l=a=f[h],r=1;a>=10;a/=10)r++;s%=A,o=s-A+r,u=o<0?0:l/F(10,r-o-1)%10|0}if(i=i||t<0||f[h+1]!==void 0||(o<0?l:l%F(10,r-o-1)),c=n<4?(u||i)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||i||n==6&&(s>0?o>0?l/F(10,r-o):0:f[h-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=F(10,(A-t%A)%A),e.e=-t||0):f[0]=e.e=0,e;if(s==0?(f.length=h,a=1,h--):(f.length=h+1,a=F(10,A-s),f[h]=o>0?(l/F(10,r-o)%F(10,o)|0)*a:0),c)for(;;)if(h==0){for(s=1,o=f[0];o>=10;o/=10)s++;for(o=f[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(e.e++,f[0]==G&&(f[0]=1));break}else{if(f[h]+=a,f[h]!=G)break;f[h--]=0,a=1}for(s=f.length;f[--s]===0;)f.pop()}return O&&(e.e>E.maxE?(e.d=null,e.e=NaN):e.e<E.minE&&(e.e=0,e.d=[0])),e}function X(e,t,n){if(!e.isFinite())return ct(e);var i,r=e.e,s=M(e.d),o=s.length;return t?(n&&(i=n-o)>0?s=s.charAt(0)+"."+s.slice(1)+ee(i):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):r<0?(s="0."+ee(-r-1)+s,n&&(i=n-o)>0&&(s+=ee(i))):r>=o?(s+=ee(r+1-o),n&&(i=n-r-1)>0&&(s=s+"."+ee(i))):((i=r+1)<o&&(s=s.slice(0,i)+"."+s.slice(i)),n&&(i=n-o)>0&&(r+1===o&&(s+="."),s+=ee(i))),s}function Ie(e,t){var n=e[0];for(t*=A;n>=10;n/=10)t++;return t}function Oe(e,t,n){if(t>Pt)throw O=!0,n&&(e.precision=n),Error(et);return T(new e(ve),t,1,!0)}function Y(e,t,n){if(t>Me)throw Error(et);return T(new e(we),t,n,!0)}function rt(e){var t=e.length-1,n=t*A+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function ee(e){for(var t="";e--;)t+="0";return t}function st(e,t,n,i){var r,s=new e(1),o=Math.ceil(i/A+4);for(O=!1;;){if(n%2&&(s=s.times(t),lt(s.d,o)&&(r=!0)),n=U(n/2),n===0){n=s.d.length-1,r&&s.d[n]===0&&++s.d[n];break}t=t.times(t),lt(t.d,o)}return O=!0,s}function ot(e){return e.d[e.d.length-1]&1}function at(e,t,n){for(var i,r=new e(t[0]),s=0;++s<t.length;)if(i=new e(t[s]),i.s)r[n](i)&&(r=i);else{r=i;break}return r}function Be(e,t){var n,i,r,s,o,a,u,c=0,l=0,f=0,h=e.constructor,E=h.rounding,N=h.precision;if(!e.d||!e.d[0]||e.e>17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(O=!1,u=N):u=t,a=new h(.03125);e.e>-2;)e=e.times(a),f+=5;for(i=Math.log(F(2,f))/Math.LN10*2+5|0,u+=i,n=s=o=new h(1),h.precision=u;;){if(s=T(s.times(e),u,1),n=n.times(++l),a=o.plus(C(s,n,u,1)),M(a.d).slice(0,u)===M(o.d).slice(0,u)){for(r=f;r--;)o=T(o.times(o),u,1);if(t==null)if(c<3&&pe(o.d,u-i,E,c))h.precision=u+=10,n=s=a=new h(1),l=0,c++;else return T(o,h.precision=N,E,O=!0);else return h.precision=N,o}o=a}}function te(e,t){var n,i,r,s,o,a,u,c,l,f,h,E=1,N=10,y=e,S=y.d,b=y.constructor,q=b.rounding,_=b.precision;if(y.s<0||!S||!S[0]||!y.e&&S[0]==1&&S.length==1)return new b(S&&!S[0]?-1/0:y.s!=1?NaN:S?0:y);if(t==null?(O=!1,l=_):l=t,b.precision=l+=N,n=M(S),i=n.charAt(0),Math.abs(s=y.e)<15e14){for(;i<7&&i!=1||i==1&&n.charAt(1)>3;)y=y.times(e),n=M(y.d),i=n.charAt(0),E++;s=y.e,i>1?(y=new b("0."+n),s++):y=new b(i+"."+n.slice(1))}else return c=Oe(b,l+2,_).times(s+""),y=te(new b(i+"."+n.slice(1)),l-N).plus(c),b.precision=_,t==null?T(y,_,q,O=!0):y;for(f=y,u=o=y=C(y.minus(1),y.plus(1),l,1),h=T(y.times(y),l,1),r=3;;){if(o=T(o.times(h),l,1),c=u.plus(C(o,new b(r),l,1)),M(c.d).slice(0,l)===M(u.d).slice(0,l))if(u=u.times(2),s!==0&&(u=u.plus(Oe(b,l+2,_).times(s+""))),u=C(u,new b(E),l,1),t==null)if(pe(u.d,l-N,q,a))b.precision=l+=N,c=o=y=C(f.minus(1),f.plus(1),l,1),h=T(y.times(y),l,1),r=a=1;else return T(u,b.precision=_,q,O=!0);else return b.precision=_,u;u=c,r+=2}}function ct(e){return String(e.s*e.s/0)}function Ue(e,t){var n,i,r;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(i=t.search(/e/i))>0?(n<0&&(n=i),n+=+t.slice(i+1),t=t.substring(0,i)):n<0&&(n=t.length),i=0;t.charCodeAt(i)===48;i++);for(r=t.length;t.charCodeAt(r-1)===48;--r);if(t=t.slice(i,r),t){if(r-=i,e.e=n=n-i-1,e.d=[],i=(n+1)%A,n<0&&(i+=A),i<r){for(i&&e.d.push(+t.slice(0,i)),r-=A;i<r;)e.d.push(+t.slice(i,i+=A));t=t.slice(i),i=A-t.length}else i-=r;for(;i--;)t+="0";e.d.push(+t),O&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Bt(e,t){var n,i,r,s,o,a,u,c,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),it.test(t))return Ue(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Rt.test(t))n=16,t=t.toLowerCase();else if(kt.test(t))n=2;else if(Lt.test(t))n=8;else throw Error(K+t);for(s=t.search(/p/i),s>0?(u=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),s=t.indexOf("."),o=s>=0,i=e.constructor,o&&(t=t.replace(".",""),a=t.length,s=a-s,r=st(i,new i(n),s,s*2)),c=Ae(t,n,G),l=c.length-1,s=l;c[s]===0;--s)c.pop();return s<0?new i(e.s*0):(e.e=Ie(c,l),e.d=c,O=!1,o&&(e=C(e,r,a*4)),u&&(e=e.times(Math.abs(u)<54?F(2,u):ce.pow(2,u))),O=!0,e)}function Ut(e,t){var n,i=t.d.length;if(i<3)return t.isZero()?t:ae(e,2,t,t);n=1.4*Math.sqrt(i),n=n>16?16:n|0,t=t.times(1/_e(5,n)),t=ae(e,2,t,t);for(var r,s=new e(5),o=new e(16),a=new e(20);n--;)r=t.times(t),t=t.times(s.plus(r.times(o.times(r).minus(a))));return t}function ae(e,t,n,i,r){var s,o,a,u,c=e.precision,l=Math.ceil(c/A);for(O=!1,u=n.times(n),a=new e(i);;){if(o=C(a.times(u),new e(t++*t++),c,1),a=r?i.plus(o):i.minus(o),i=C(o.times(u),new e(t++*t++),c,1),o=a.plus(i),o.d[l]!==void 0){for(s=l;o.d[s]===a.d[s]&&s--;);if(s==-1)break}s=a,a=i,i=o,o=s}return O=!0,o.d.length=l+1,o}function _e(e,t){for(var n=e;--t;)n*=e;return n}function ut(e,t){var n,i=t.s<0,r=Y(e,e.precision,1),s=r.times(.5);if(t=t.abs(),t.lte(s))return Q=i?4:1,t;if(n=t.divToInt(r),n.isZero())Q=i?3:2;else{if(t=t.minus(n.times(r)),t.lte(s))return Q=ot(n)?i?2:3:i?4:1,t;Q=ot(n)?i?1:4:i?3:2}return t.minus(r).abs()}function qe(e,t,n,i){var r,s,o,a,u,c,l,f,h,E=e.constructor,N=n!==void 0;if(N?(j(n,1,W),i===void 0?i=E.rounding:j(i,0,8)):(n=E.precision,i=E.rounding),!e.isFinite())l=ct(e);else{for(l=X(e),o=l.indexOf("."),N?(r=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):r=t,o>=0&&(l=l.replace(".",""),h=new E(1),h.e=l.length-o,h.d=Ae(X(h),10,r),h.e=h.d.length),f=Ae(l,10,r),s=u=f.length;f[--u]==0;)f.pop();if(!f[0])l=N?"0p+0":"0";else{if(o<0?s--:(e=new E(e),e.d=f,e.e=s,e=C(e,h,n,i,0,r),f=e.d,s=e.e,c=Ke),o=f[n],a=r/2,c=c||f[n+1]!==void 0,c=i<4?(o!==void 0||c)&&(i===0||i===(e.s<0?3:2)):o>a||o===a&&(i===4||c||i===6&&f[n-1]&1||i===(e.s<0?8:7)),f.length=n,c)for(;++f[--n]>r-1;)f[n]=0,n||(++s,f.unshift(1));for(u=f.length;!f[u-1];--u);for(o=0,l="";o<u;o++)l+=Fe.charAt(f[o]);if(N){if(u>1)if(t==16||t==8){for(o=t==16?4:3,--u;u%o;u++)l+="0";for(f=Ae(l,r,t),u=f.length;!f[u-1];--u);for(o=1,l="1.";o<u;o++)l+=Fe.charAt(f[o])}else l=l.charAt(0)+"."+l.slice(1);l=l+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)l="0"+l;l="0."+l}else if(++s>u)for(s-=u;s--;)l+="0";else s<u&&(l=l.slice(0,s)+"."+l.slice(s))}l=(t==16?"0x":t==2?"0b":t==8?"0o":"")+l}return e.s<0?"-"+l:l}function lt(e,t){if(e.length>t)return e.length=t,!0}function qt(e){return new this(e).abs()}function Vt(e){return new this(e).acos()}function jt(e){return new this(e).acosh()}function $t(e,t){return new this(e).plus(t)}function Ht(e){return new this(e).asin()}function Gt(e){return new this(e).asinh()}function Yt(e){return new this(e).atan()}function Jt(e){return new this(e).atanh()}function zt(e,t){e=new this(e),t=new this(t);var n,i=this.precision,r=this.rounding,s=i+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=Y(this,s,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?Y(this,i,r):new this(0),n.s=e.s):!e.d||t.isZero()?(n=Y(this,s,1).times(.5),n.s=e.s):t.s<0?(this.precision=s,this.rounding=1,n=this.atan(C(e,t,s,1)),t=Y(this,s,1),this.precision=i,this.rounding=r,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(C(e,t,s,1)),n}function Xt(e){return new this(e).cbrt()}function Qt(e){return T(e=new this(e),e.e+1,2)}function Zt(e,t,n){return new this(e).clamp(t,n)}function Wt(e){if(!e||typeof e!="object")throw Error(Te+"Object expected");var t,n,i,r=e.defaults===!0,s=["precision",1,W,"rounding",0,8,"toExpNeg",-oe,0,"toExpPos",0,oe,"maxE",0,oe,"minE",-oe,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(n=s[t],r&&(this[n]=Pe[n]),(i=e[n])!==void 0)if(U(i)===i&&i>=s[t+1]&&i<=s[t+2])this[n]=i;else throw Error(K+n+": "+i);if(n="crypto",r&&(this[n]=Pe[n]),(i=e[n])!==void 0)if(i===!0||i===!1||i===0||i===1)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(tt);else this[n]=!1;else throw Error(K+n+": "+i);return this}function Kt(e){return new this(e).cos()}function en(e){return new this(e).cosh()}function ft(e){var t,n,i;function r(s){var o,a,u,c=this;if(!(c instanceof r))return new r(s);if(c.constructor=r,ht(s)){c.s=s.s,O?!s.d||s.e>r.maxE?(c.e=NaN,c.d=null):s.e<r.minE?(c.e=0,c.d=[0]):(c.e=s.e,c.d=s.d.slice()):(c.e=s.e,c.d=s.d?s.d.slice():s.d);return}if(u=typeof s,u==="number"){if(s===0){c.s=1/s<0?-1:1,c.e=0,c.d=[0];return}if(s<0?(s=-s,c.s=-1):c.s=1,s===~~s&&s<1e7){for(o=0,a=s;a>=10;a/=10)o++;O?o>r.maxE?(c.e=NaN,c.d=null):o<r.minE?(c.e=0,c.d=[0]):(c.e=o,c.d=[s]):(c.e=o,c.d=[s]);return}else if(s*0!==0){s||(c.s=NaN),c.e=NaN,c.d=null;return}return Ue(c,s.toString())}else if(u!=="string")throw Error(K+s);return(a=s.charCodeAt(0))===45?(s=s.slice(1),c.s=-1):(a===43&&(s=s.slice(1)),c.s=1),it.test(s)?Ue(c,s):Bt(c,s)}if(r.prototype=m,r.ROUND_UP=0,r.ROUND_DOWN=1,r.ROUND_CEIL=2,r.ROUND_FLOOR=3,r.ROUND_HALF_UP=4,r.ROUND_HALF_DOWN=5,r.ROUND_HALF_EVEN=6,r.ROUND_HALF_CEIL=7,r.ROUND_HALF_FLOOR=8,r.EUCLID=9,r.config=r.set=Wt,r.clone=ft,r.isDecimal=ht,r.abs=qt,r.acos=Vt,r.acosh=jt,r.add=$t,r.asin=Ht,r.asinh=Gt,r.atan=Yt,r.atanh=Jt,r.atan2=zt,r.cbrt=Xt,r.ceil=Qt,r.clamp=Zt,r.cos=Kt,r.cosh=en,r.div=tn,r.exp=nn,r.floor=rn,r.hypot=sn,r.ln=on,r.log=an,r.log10=un,r.log2=cn,r.max=ln,r.min=fn,r.mod=hn,r.mul=dn,r.pow=pn,r.random=mn,r.round=gn,r.sign=En,r.sin=Nn,r.sinh=yn,r.sqrt=vn,r.sub=wn,r.sum=Tn,r.tan=An,r.tanh=In,r.trunc=On,e===void 0&&(e={}),e&&e.defaults!==!0)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<i.length;)e.hasOwnProperty(n=i[t++])||(e[n]=this[n]);return r.config(e),r}function tn(e,t){return new this(e).div(t)}function nn(e){return new this(e).exp()}function rn(e){return T(e=new this(e),e.e+1,3)}function sn(){var e,t,n=new this(0);for(O=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return O=!0,new this(1/0);n=t}return O=!0,n.sqrt()}function ht(e){return e instanceof ce||e&&e.toStringTag===nt||!1}function on(e){return new this(e).ln()}function an(e,t){return new this(e).log(t)}function cn(e){return new this(e).log(2)}function un(e){return new this(e).log(10)}function ln(){return at(this,arguments,"lt")}function fn(){return at(this,arguments,"gt")}function hn(e,t){return new this(e).mod(t)}function dn(e,t){return new this(e).mul(t)}function pn(e,t){return new this(e).pow(t)}function mn(e){var t,n,i,r,s=0,o=new this(1),a=[];if(e===void 0?e=this.precision:j(e,1,W),i=Math.ceil(e/A),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));s<i;)r=t[s],r>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=r%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=4);s<i;)r=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((t[s+3]&127)<<24),r>=214e7?crypto.randomBytes(4).copy(t,s):(a.push(r%1e7),s+=4);s=i/4}else throw Error(tt);else for(;s<i;)a[s++]=Math.random()*1e7|0;for(i=a[--s],e%=A,i&&e&&(r=F(10,A-e),a[s]=(i/r|0)*r);a[s]===0;s--)a.pop();if(s<0)n=0,a=[0];else{for(n=-1;a[0]===0;n-=A)a.shift();for(i=1,r=a[0];r>=10;r/=10)i++;i<A&&(n-=A-i)}return o.e=n,o.d=a,o}function gn(e){return T(e=new this(e),e.e+1,this.rounding)}function En(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function Nn(e){return new this(e).sin()}function yn(e){return new this(e).sinh()}function vn(e){return new this(e).sqrt()}function wn(e,t){return new this(e).sub(t)}function Tn(){var e=0,t=arguments,n=new this(t[e]);for(O=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return O=!0,T(n,this.precision,this.rounding)}function An(e){return new this(e).tan()}function In(e){return new this(e).tanh()}function On(e){return T(e=new this(e),e.e+1,1)}m[Symbol.for("nodejs.util.inspect.custom")]=m.toString,m[Symbol.toStringTag]="Decimal";var ce=m.constructor=ft(Pe);ve=new ce(ve),we=new ce(we);const Ve=JSON,_n=e=>e.toUpperCase(),bn=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},Dn=(e,t,n)=>e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0},Sn=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0},xn=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};function be(e,t){if(!!!e)throw new Error(t)}function Cn(e){return typeof e=="object"&&e!==null}function kn(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const Rn=/\r\n|[\n\r]/g;function je(e,t){let n=0,i=1;for(const r of e.body.matchAll(Rn)){if(typeof r.index=="number"||kn(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function Ln(e){return dt(e.source,je(e.source,e.start))}function dt(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=t.line===1?n:0,u=t.column+a,c=`${e.name}:${o}:${u}
7
+ */var Fe=9e15,W=1e9,Pe="0123456789abcdef",ve="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",we="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Me={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-9e15,maxE:Fe,crypto:!1},Ke,Q,O=!0,Te="[DecimalError] ",K=Te+"Invalid argument: ",et=Te+"Precision limit exceeded",tt=Te+"crypto unavailable",nt="[object Decimal]",U=Math.floor,F=Math.pow,Rt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Lt=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ft=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,it=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,G=1e7,A=7,Pt=9007199254740991,Mt=ve.length-1,Be=we.length-1,m={toStringTag:nt};m.absoluteValue=m.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),T(e)},m.ceil=function(){return T(new this.constructor(this),this.e+1,2)},m.clampedTo=m.clamp=function(e,t){var n,i=this,r=i.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(K+t);return n=i.cmp(e),n<0?e:i.cmp(t)>0?t:new r(i)},m.comparedTo=m.cmp=function(e){var t,n,i,r,s=this,o=s.d,a=(e=new s.constructor(e)).d,u=s.s,c=e.s;if(!o||!a)return!u||!c?NaN:u!==c?u:o===a?0:!o^u<0?1:-1;if(!o[0]||!a[0])return o[0]?u:a[0]?-c:0;if(u!==c)return u;if(s.e!==e.e)return s.e>e.e^u<0?1:-1;for(i=o.length,r=a.length,t=0,n=i<r?i:r;t<n;++t)if(o[t]!==a[t])return o[t]>a[t]^u<0?1:-1;return i===r?0:i>r^u<0?1:-1},m.cosine=m.cos=function(){var e,t,n=this,i=n.constructor;return n.d?n.d[0]?(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+A,i.rounding=1,n=Bt(i,ut(i,n)),i.precision=e,i.rounding=t,T(Q==2||Q==3?n.neg():n,e,t,!0)):new i(1):new i(NaN)},m.cubeRoot=m.cbrt=function(){var e,t,n,i,r,s,o,a,u,c,l=this,f=l.constructor;if(!l.isFinite()||l.isZero())return new f(l);for(O=!1,s=l.s*F(l.s*l,1/3),!s||Math.abs(s)==1/0?(n=M(l.d),e=l.e,(s=(e-n.length+1)%3)&&(n+=s==1||s==-2?"0":"00"),s=F(n,1/3),e=U((e+1)/3)-(e%3==(e<0?-1:2)),s==1/0?n="5e"+e:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+e),i=new f(n),i.s=l.s):i=new f(s.toString()),o=(e=f.precision)+3;;)if(a=i,u=a.times(a).times(a),c=u.plus(l),i=C(c.plus(l).times(a),c.plus(u),o+2,1),M(a.d).slice(0,o)===(n=M(i.d)).slice(0,o))if(n=n.slice(o-3,o+1),n=="9999"||!r&&n=="4999"){if(!r&&(T(a,e+1,0),a.times(a).times(a).eq(l))){i=a;break}o+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(T(i,e+1,1),t=!i.times(i).times(i).eq(l));break}return O=!0,T(i,e,f.rounding,t)},m.decimalPlaces=m.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-U(this.e/A))*A,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},m.dividedBy=m.div=function(e){return C(this,new this.constructor(e))},m.dividedToIntegerBy=m.divToInt=function(e){var t=this,n=t.constructor;return T(C(t,new n(e),0,1,1),n.precision,n.rounding)},m.equals=m.eq=function(e){return this.cmp(e)===0},m.floor=function(){return T(new this.constructor(this),this.e+1,3)},m.greaterThan=m.gt=function(e){return this.cmp(e)>0},m.greaterThanOrEqualTo=m.gte=function(e){var t=this.cmp(e);return t==1||t===0},m.hyperbolicCosine=m.cosh=function(){var e,t,n,i,r,s=this,o=s.constructor,a=new o(1);if(!s.isFinite())return new o(s.s?1/0:NaN);if(s.isZero())return a;n=o.precision,i=o.rounding,o.precision=n+Math.max(s.e,s.sd())+4,o.rounding=1,r=s.d.length,r<32?(e=Math.ceil(r/3),t=(1/_e(4,e)).toString()):(e=16,t="2.3283064365386962890625e-10"),s=oe(o,1,s.times(t),new o(1),!0);for(var u,c=e,l=new o(8);c--;)u=s.times(s),s=a.minus(u.times(l.minus(u.times(l))));return T(s,o.precision=n,o.rounding=i,!0)},m.hyperbolicSine=m.sinh=function(){var e,t,n,i,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(t=s.precision,n=s.rounding,s.precision=t+Math.max(r.e,r.sd())+4,s.rounding=1,i=r.d.length,i<3)r=oe(s,2,r,r,!0);else{e=1.4*Math.sqrt(i),e=e>16?16:e|0,r=r.times(1/_e(5,e)),r=oe(s,2,r,r,!0);for(var o,a=new s(5),u=new s(16),c=new s(20);e--;)o=r.times(r),r=r.times(a.plus(o.times(u.times(o).plus(c))))}return s.precision=t,s.rounding=n,T(r,t,n,!0)},m.hyperbolicTangent=m.tanh=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+7,i.rounding=1,C(n.sinh(),n.cosh(),i.precision=e,i.rounding=t)):new i(n.s)},m.inverseCosine=m.acos=function(){var e,t=this,n=t.constructor,i=t.abs().cmp(1),r=n.precision,s=n.rounding;return i!==-1?i===0?t.isNeg()?Y(n,r,s):new n(0):new n(NaN):t.isZero()?Y(n,r+4,s).times(.5):(n.precision=r+6,n.rounding=1,t=t.asin(),e=Y(n,r+4,s).times(.5),n.precision=r,n.rounding=s,e.minus(t))},m.inverseHyperbolicCosine=m.acosh=function(){var e,t,n=this,i=n.constructor;return n.lte(1)?new i(n.eq(1)?0:NaN):n.isFinite()?(e=i.precision,t=i.rounding,i.precision=e+Math.max(Math.abs(n.e),n.sd())+4,i.rounding=1,O=!1,n=n.times(n).minus(1).sqrt().plus(n),O=!0,i.precision=e,i.rounding=t,n.ln()):new i(n)},m.inverseHyperbolicSine=m.asinh=function(){var e,t,n=this,i=n.constructor;return!n.isFinite()||n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,i.rounding=1,O=!1,n=n.times(n).plus(1).sqrt().plus(n),O=!0,i.precision=e,i.rounding=t,n.ln())},m.inverseHyperbolicTangent=m.atanh=function(){var e,t,n,i,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(e=s.precision,t=s.rounding,i=r.sd(),Math.max(i,e)<2*-r.e-1?T(new s(r),e,t,!0):(s.precision=n=i-r.e,r=C(r.plus(1),new s(1).minus(r),n+e,1),s.precision=e+4,s.rounding=1,r=r.ln(),s.precision=e,s.rounding=t,r.times(.5))):new s(NaN)},m.inverseSine=m.asin=function(){var e,t,n,i,r=this,s=r.constructor;return r.isZero()?new s(r):(t=r.abs().cmp(1),n=s.precision,i=s.rounding,t!==-1?t===0?(e=Y(s,n+4,i).times(.5),e.s=r.s,e):new s(NaN):(s.precision=n+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=n,s.rounding=i,r.times(2)))},m.inverseTangent=m.atan=function(){var e,t,n,i,r,s,o,a,u,c=this,l=c.constructor,f=l.precision,h=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&f+4<=Be)return o=Y(l,f+4,h).times(.25),o.s=c.s,o}else{if(!c.s)return new l(NaN);if(f+4<=Be)return o=Y(l,f+4,h).times(.5),o.s=c.s,o}for(l.precision=a=f+10,l.rounding=1,n=Math.min(28,a/A+2|0),e=n;e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(O=!1,t=Math.ceil(a/A),i=1,u=c.times(c),o=new l(c),r=c;e!==-1;)if(r=r.times(u),s=o.minus(r.div(i+=2)),r=r.times(u),o=s.plus(r.div(i+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===s.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),O=!0,T(o,l.precision=f,l.rounding=h,!0)},m.isFinite=function(){return!!this.d},m.isInteger=m.isInt=function(){return!!this.d&&U(this.e/A)>this.d.length-2},m.isNaN=function(){return!this.s},m.isNegative=m.isNeg=function(){return this.s<0},m.isPositive=m.isPos=function(){return this.s>0},m.isZero=function(){return!!this.d&&this.d[0]===0},m.lessThan=m.lt=function(e){return this.cmp(e)<0},m.lessThanOrEqualTo=m.lte=function(e){return this.cmp(e)<1},m.logarithm=m.log=function(e){var t,n,i,r,s,o,a,u,c=this,l=c.constructor,f=l.precision,h=l.rounding,E=5;if(e==null)e=new l(10),t=!0;else{if(e=new l(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new l(NaN);t=e.eq(10)}if(n=c.d,c.s<0||!n||!n[0]||c.eq(1))return new l(n&&!n[0]?-1/0:c.s!=1?NaN:n?0:1/0);if(t)if(n.length>1)s=!0;else{for(r=n[0];r%10===0;)r/=10;s=r!==1}if(O=!1,a=f+E,o=te(c,a),i=t?Oe(l,a+10):te(e,a),u=C(o,i,a,1),de(u.d,r=f,h))do if(a+=10,o=te(c,a),i=t?Oe(l,a+10):te(e,a),u=C(o,i,a,1),!s){+M(u.d).slice(r+1,r+15)+1==1e14&&(u=T(u,f+1,0));break}while(de(u.d,r+=10,h));return O=!0,T(u,f,h)},m.minus=m.sub=function(e){var t,n,i,r,s,o,a,u,c,l,f,h,E=this,N=E.constructor;if(e=new N(e),!E.d||!e.d)return!E.s||!e.s?e=new N(NaN):E.d?e.s=-e.s:e=new N(e.d||E.s!==e.s?E:NaN),e;if(E.s!=e.s)return e.s=-e.s,E.plus(e);if(c=E.d,h=e.d,a=N.precision,u=N.rounding,!c[0]||!h[0]){if(h[0])e.s=-e.s;else if(c[0])e=new N(E);else return new N(u===3?-0:0);return O?T(e,a,u):e}if(n=U(e.e/A),l=U(E.e/A),c=c.slice(),s=l-n,s){for(f=s<0,f?(t=c,s=-s,o=h.length):(t=h,n=l,o=c.length),i=Math.max(Math.ceil(a/A),o)+2,s>i&&(s=i,t.length=1),t.reverse(),i=s;i--;)t.push(0);t.reverse()}else{for(i=c.length,o=h.length,f=i<o,f&&(o=i),i=0;i<o;i++)if(c[i]!=h[i]){f=c[i]<h[i];break}s=0}for(f&&(t=c,c=h,h=t,e.s=-e.s),o=c.length,i=h.length-o;i>0;--i)c[o++]=0;for(i=h.length;i>s;){if(c[--i]<h[i]){for(r=i;r&&c[--r]===0;)c[r]=G-1;--c[r],c[i]+=G}c[i]-=h[i]}for(;c[--o]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(e.d=c,e.e=Ie(c,n),O?T(e,a,u):e):new N(u===3?-0:0)},m.modulo=m.mod=function(e){var t,n=this,i=n.constructor;return e=new i(e),!n.d||!e.s||e.d&&!e.d[0]?new i(NaN):!e.d||n.d&&!n.d[0]?T(new i(n),i.precision,i.rounding):(O=!1,i.modulo==9?(t=C(n,e.abs(),0,3,1),t.s*=e.s):t=C(n,e,0,i.modulo,1),t=t.times(e),O=!0,n.minus(t))},m.naturalExponential=m.exp=function(){return Ue(this)},m.naturalLogarithm=m.ln=function(){return te(this)},m.negated=m.neg=function(){var e=new this.constructor(this);return e.s=-e.s,T(e)},m.plus=m.add=function(e){var t,n,i,r,s,o,a,u,c,l,f=this,h=f.constructor;if(e=new h(e),!f.d||!e.d)return!f.s||!e.s?e=new h(NaN):f.d||(e=new h(e.d||f.s===e.s?f:NaN)),e;if(f.s!=e.s)return e.s=-e.s,f.minus(e);if(c=f.d,l=e.d,a=h.precision,u=h.rounding,!c[0]||!l[0])return l[0]||(e=new h(f)),O?T(e,a,u):e;if(s=U(f.e/A),i=U(e.e/A),c=c.slice(),r=s-i,r){for(r<0?(n=c,r=-r,o=l.length):(n=l,i=s,o=c.length),s=Math.ceil(a/A),o=s>o?s+1:o+1,r>o&&(r=o,n.length=1),n.reverse();r--;)n.push(0);n.reverse()}for(o=c.length,r=l.length,o-r<0&&(r=o,n=l,l=c,c=n),t=0;r;)t=(c[--r]=c[r]+l[r]+t)/G|0,c[r]%=G;for(t&&(c.unshift(t),++i),o=c.length;c[--o]==0;)c.pop();return e.d=c,e.e=Ie(c,i),O?T(e,a,u):e},m.precision=m.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(K+e);return n.d?(t=rt(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},m.round=function(){var e=this,t=e.constructor;return T(new t(e),e.e+1,t.rounding)},m.sine=m.sin=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+Math.max(n.e,n.sd())+A,i.rounding=1,n=qt(i,ut(i,n)),i.precision=e,i.rounding=t,T(Q>2?n.neg():n,e,t,!0)):new i(NaN)},m.squareRoot=m.sqrt=function(){var e,t,n,i,r,s,o=this,a=o.d,u=o.e,c=o.s,l=o.constructor;if(c!==1||!a||!a[0])return new l(!c||c<0&&(!a||a[0])?NaN:a?o:1/0);for(O=!1,c=Math.sqrt(+o),c==0||c==1/0?(t=M(a),(t.length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=U((u+1)/2)-(u<0||u%2),c==1/0?t="5e"+u:(t=c.toExponential(),t=t.slice(0,t.indexOf("e")+1)+u),i=new l(t)):i=new l(c.toString()),n=(u=l.precision)+3;;)if(s=i,i=s.plus(C(o,s,n+2,1)).times(.5),M(s.d).slice(0,n)===(t=M(i.d)).slice(0,n))if(t=t.slice(n-3,n+1),t=="9999"||!r&&t=="4999"){if(!r&&(T(s,u+1,0),s.times(s).eq(o))){i=s;break}n+=4,r=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(T(i,u+1,1),e=!i.times(i).eq(o));break}return O=!0,T(i,u,l.rounding,e)},m.tangent=m.tan=function(){var e,t,n=this,i=n.constructor;return n.isFinite()?n.isZero()?new i(n):(e=i.precision,t=i.rounding,i.precision=e+10,i.rounding=1,n=n.sin(),n.s=1,n=C(n,new i(1).minus(n.times(n)).sqrt(),e+10,0),i.precision=e,i.rounding=t,T(Q==2||Q==4?n.neg():n,e,t,!0)):new i(NaN)},m.times=m.mul=function(e){var t,n,i,r,s,o,a,u,c,l=this,f=l.constructor,h=l.d,E=(e=new f(e)).d;if(e.s*=l.s,!h||!h[0]||!E||!E[0])return new f(!e.s||h&&!h[0]&&!E||E&&!E[0]&&!h?NaN:!h||!E?e.s/0:e.s*0);for(n=U(l.e/A)+U(e.e/A),u=h.length,c=E.length,u<c&&(s=h,h=E,E=s,o=u,u=c,c=o),s=[],o=u+c,i=o;i--;)s.push(0);for(i=c;--i>=0;){for(t=0,r=u+i;r>i;)a=s[r]+E[i]*h[r-i-1]+t,s[r--]=a%G|0,t=a/G|0;s[r]=(s[r]+t)%G|0}for(;!s[--o];)s.pop();return t?++n:s.shift(),e.d=s,e.e=Ie(s,n),O?T(e,f.precision,f.rounding):e},m.toBinary=function(e,t){return Ve(this,2,e,t)},m.toDecimalPlaces=m.toDP=function(e,t){var n=this,i=n.constructor;return n=new i(n),e===void 0?n:(j(e,0,W),t===void 0?t=i.rounding:j(t,0,8),T(n,e+n.e+1,t))},m.toExponential=function(e,t){var n,i=this,r=i.constructor;return e===void 0?n=X(i,!0):(j(e,0,W),t===void 0?t=r.rounding:j(t,0,8),i=T(new r(i),e+1,t),n=X(i,!0,e+1)),i.isNeg()&&!i.isZero()?"-"+n:n},m.toFixed=function(e,t){var n,i,r=this,s=r.constructor;return e===void 0?n=X(r):(j(e,0,W),t===void 0?t=s.rounding:j(t,0,8),i=T(new s(r),e+r.e+1,t),n=X(i,!1,e+i.e+1)),r.isNeg()&&!r.isZero()?"-"+n:n},m.toFraction=function(e){var t,n,i,r,s,o,a,u,c,l,f,h,E=this,N=E.d,y=E.constructor;if(!N)return new y(E);if(c=n=new y(1),i=u=new y(0),t=new y(i),s=t.e=rt(N)-E.e-1,o=s%A,t.d[0]=F(10,o<0?A+o:o),e==null)e=s>0?t:c;else{if(a=new y(e),!a.isInt()||a.lt(c))throw Error(K+a);e=a.gt(t)?s>0?t:c:a}for(O=!1,a=new y(M(N)),l=y.precision,y.precision=s=N.length*A*2;f=C(a,t,0,1,1),r=n.plus(f.times(i)),r.cmp(e)!=1;)n=i,i=r,r=c,c=u.plus(f.times(r)),u=r,r=t,t=a.minus(f.times(r)),a=r;return r=C(e.minus(n),i,0,1,1),u=u.plus(r.times(c)),n=n.plus(r.times(i)),u.s=c.s=E.s,h=C(c,i,s,1).minus(E).abs().cmp(C(u,n,s,1).minus(E).abs())<1?[c,i]:[u,n],y.precision=l,O=!0,h},m.toHexadecimal=m.toHex=function(e,t){return Ve(this,16,e,t)},m.toNearest=function(e,t){var n=this,i=n.constructor;if(n=new i(n),e==null){if(!n.d)return n;e=new i(1),t=i.rounding}else{if(e=new i(e),t===void 0?t=i.rounding:j(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&(e.s=n.s),e}return e.d[0]?(O=!1,n=C(n,e,0,t,1).times(e),O=!0,T(n)):(e.s=n.s,n=e),n},m.toNumber=function(){return+this},m.toOctal=function(e,t){return Ve(this,8,e,t)},m.toPower=m.pow=function(e){var t,n,i,r,s,o,a=this,u=a.constructor,c=+(e=new u(e));if(!a.d||!e.d||!a.d[0]||!e.d[0])return new u(F(+a,c));if(a=new u(a),a.eq(1))return a;if(i=u.precision,s=u.rounding,e.eq(1))return T(a,i,s);if(t=U(e.e/A),t>=e.d.length-1&&(n=c<0?-c:c)<=Pt)return r=st(u,a,n,i),e.s<0?new u(1).div(r):T(r,i,s);if(o=a.s,o<0){if(t<e.d.length-1)return new u(NaN);if(e.d[t]&1||(o=1),a.e==0&&a.d[0]==1&&a.d.length==1)return a.s=o,a}return n=F(+a,c),t=n==0||!isFinite(n)?U(c*(Math.log("0."+M(a.d))/Math.LN10+a.e+1)):new u(n+"").e,t>u.maxE+1||t<u.minE-1?new u(t>0?o/0:0):(O=!1,u.rounding=a.s=1,n=Math.min(12,(t+"").length),r=Ue(e.times(te(a,i+n)),i),r.d&&(r=T(r,i+5,1),de(r.d,i,s)&&(t=i+10,r=T(Ue(e.times(te(a,t+n)),t),t+5,1),+M(r.d).slice(i+1,i+15)+1==1e14&&(r=T(r,i+1,0)))),r.s=o,O=!0,u.rounding=s,T(r,i,s))},m.toPrecision=function(e,t){var n,i=this,r=i.constructor;return e===void 0?n=X(i,i.e<=r.toExpNeg||i.e>=r.toExpPos):(j(e,1,W),t===void 0?t=r.rounding:j(t,0,8),i=T(new r(i),e,t),n=X(i,e<=i.e||i.e<=r.toExpNeg,e)),i.isNeg()&&!i.isZero()?"-"+n:n},m.toSignificantDigits=m.toSD=function(e,t){var n=this,i=n.constructor;return e===void 0?(e=i.precision,t=i.rounding):(j(e,1,W),t===void 0?t=i.rounding:j(t,0,8)),T(new i(n),e,t)},m.toString=function(){var e=this,t=e.constructor,n=X(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+n:n},m.truncated=m.trunc=function(){return T(new this.constructor(this),this.e+1,1)},m.valueOf=m.toJSON=function(){var e=this,t=e.constructor,n=X(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+n:n};function M(e){var t,n,i,r=e.length-1,s="",o=e[0];if(r>0){for(s+=o,t=1;t<r;t++)i=e[t]+"",n=A-i.length,n&&(s+=ee(n)),s+=i;o=e[t],i=o+"",n=A-i.length,n&&(s+=ee(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return s+o}function j(e,t,n){if(e!==~~e||e<t||e>n)throw Error(K+e)}function de(e,t,n,i){var r,s,o,a;for(s=e[0];s>=10;s/=10)--t;return--t<0?(t+=A,r=0):(r=Math.ceil((t+1)/A),t%=A),s=F(10,A-t),a=e[r]%s|0,i==null?t<3?(t==0?a=a/100|0:t==1&&(a=a/10|0),o=n<4&&a==99999||n>3&&a==49999||a==5e4||a==0):o=(n<4&&a+1==s||n>3&&a+1==s/2)&&(e[r+1]/s/100|0)==F(10,t-2)-1||(a==s/2||a==0)&&(e[r+1]/s/100|0)==0:t<4?(t==0?a=a/1e3|0:t==1?a=a/100|0:t==2&&(a=a/10|0),o=(i||n<4)&&a==9999||!i&&n>3&&a==4999):o=((i||n<4)&&a+1==s||!i&&n>3&&a+1==s/2)&&(e[r+1]/s/1e3|0)==F(10,t-3)-1,o}function Ae(e,t,n){for(var i,r=[0],s,o=0,a=e.length;o<a;){for(s=r.length;s--;)r[s]*=t;for(r[0]+=Pe.indexOf(e.charAt(o++)),i=0;i<r.length;i++)r[i]>n-1&&(r[i+1]===void 0&&(r[i+1]=0),r[i+1]+=r[i]/n|0,r[i]%=n)}return r.reverse()}function Bt(e,t){var n,i,r;if(t.isZero())return t;i=t.d.length,i<32?(n=Math.ceil(i/3),r=(1/_e(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10"),e.precision+=n,t=oe(e,1,t.times(r),new e(1));for(var s=n;s--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var C=function(){function e(i,r,s){var o,a=0,u=i.length;for(i=i.slice();u--;)o=i[u]*r+a,i[u]=o%s|0,a=o/s|0;return a&&i.unshift(a),i}function t(i,r,s,o){var a,u;if(s!=o)u=s>o?1:-1;else for(a=u=0;a<s;a++)if(i[a]!=r[a]){u=i[a]>r[a]?1:-1;break}return u}function n(i,r,s,o){for(var a=0;s--;)i[s]-=a,a=i[s]<r[s]?1:0,i[s]=a*o+i[s]-r[s];for(;!i[0]&&i.length>1;)i.shift()}return function(i,r,s,o,a,u){var c,l,f,h,E,N,y,S,b,q,_,x,z,$,ne,H,se,Ne,R,fe,ie=i.constructor,d=i.s==r.s?1:-1,g=i.d,v=r.d;if(!g||!g[0]||!v||!v[0])return new ie(!i.s||!r.s||(g?v&&g[0]==v[0]:!v)?NaN:g&&g[0]==0||!v?d*0:d/0);for(u?(E=1,l=i.e-r.e):(u=G,E=A,l=U(i.e/E)-U(r.e/E)),R=v.length,se=g.length,b=new ie(d),q=b.d=[],f=0;v[f]==(g[f]||0);f++);if(v[f]>(g[f]||0)&&l--,s==null?($=s=ie.precision,o=ie.rounding):a?$=s+(i.e-r.e)+1:$=s,$<0)q.push(1),N=!0;else{if($=$/E+2|0,f=0,R==1){for(h=0,v=v[0],$++;(f<se||h)&&$--;f++)ne=h*u+(g[f]||0),q[f]=ne/v|0,h=ne%v|0;N=h||f<se}else{for(h=u/(v[0]+1)|0,h>1&&(v=e(v,h,u),g=e(g,h,u),R=v.length,se=g.length),H=R,_=g.slice(0,R),x=_.length;x<R;)_[x++]=0;fe=v.slice(),fe.unshift(0),Ne=v[0],v[1]>=u/2&&++Ne;do h=0,c=t(v,_,R,x),c<0?(z=_[0],R!=x&&(z=z*u+(_[1]||0)),h=z/Ne|0,h>1?(h>=u&&(h=u-1),y=e(v,h,u),S=y.length,x=_.length,c=t(y,_,S,x),c==1&&(h--,n(y,R<S?fe:v,S,u))):(h==0&&(c=h=1),y=v.slice()),S=y.length,S<x&&y.unshift(0),n(_,y,x,u),c==-1&&(x=_.length,c=t(v,_,R,x),c<1&&(h++,n(_,R<x?fe:v,x,u))),x=_.length):c===0&&(h++,_=[0]),q[f++]=h,c&&_[0]?_[x++]=g[H]||0:(_=[g[H]],x=1);while((H++<se||_[0]!==void 0)&&$--);N=_[0]!==void 0}q[0]||q.shift()}if(E==1)b.e=l,Ke=N;else{for(f=1,h=q[0];h>=10;h/=10)f++;b.e=f+l*E-1,T(b,a?s+b.e+1:s,o,N)}return b}}();function T(e,t,n,i){var r,s,o,a,u,c,l,f,h,E=e.constructor;e:if(t!=null){if(f=e.d,!f)return e;for(r=1,a=f[0];a>=10;a/=10)r++;if(s=t-r,s<0)s+=A,o=t,l=f[h=0],u=l/F(10,r-o-1)%10|0;else if(h=Math.ceil((s+1)/A),a=f.length,h>=a)if(i){for(;a++<=h;)f.push(0);l=u=0,r=1,s%=A,o=s-A+1}else break e;else{for(l=a=f[h],r=1;a>=10;a/=10)r++;s%=A,o=s-A+r,u=o<0?0:l/F(10,r-o-1)%10|0}if(i=i||t<0||f[h+1]!==void 0||(o<0?l:l%F(10,r-o-1)),c=n<4?(u||i)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||i||n==6&&(s>0?o>0?l/F(10,r-o):0:f[h-1])%10&1||n==(e.s<0?8:7)),t<1||!f[0])return f.length=0,c?(t-=e.e+1,f[0]=F(10,(A-t%A)%A),e.e=-t||0):f[0]=e.e=0,e;if(s==0?(f.length=h,a=1,h--):(f.length=h+1,a=F(10,A-s),f[h]=o>0?(l/F(10,r-o)%F(10,o)|0)*a:0),c)for(;;)if(h==0){for(s=1,o=f[0];o>=10;o/=10)s++;for(o=f[0]+=a,a=1;o>=10;o/=10)a++;s!=a&&(e.e++,f[0]==G&&(f[0]=1));break}else{if(f[h]+=a,f[h]!=G)break;f[h--]=0,a=1}for(s=f.length;f[--s]===0;)f.pop()}return O&&(e.e>E.maxE?(e.d=null,e.e=NaN):e.e<E.minE&&(e.e=0,e.d=[0])),e}function X(e,t,n){if(!e.isFinite())return ct(e);var i,r=e.e,s=M(e.d),o=s.length;return t?(n&&(i=n-o)>0?s=s.charAt(0)+"."+s.slice(1)+ee(i):o>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(e.e<0?"e":"e+")+e.e):r<0?(s="0."+ee(-r-1)+s,n&&(i=n-o)>0&&(s+=ee(i))):r>=o?(s+=ee(r+1-o),n&&(i=n-r-1)>0&&(s=s+"."+ee(i))):((i=r+1)<o&&(s=s.slice(0,i)+"."+s.slice(i)),n&&(i=n-o)>0&&(r+1===o&&(s+="."),s+=ee(i))),s}function Ie(e,t){var n=e[0];for(t*=A;n>=10;n/=10)t++;return t}function Oe(e,t,n){if(t>Mt)throw O=!0,n&&(e.precision=n),Error(et);return T(new e(ve),t,1,!0)}function Y(e,t,n){if(t>Be)throw Error(et);return T(new e(we),t,n,!0)}function rt(e){var t=e.length-1,n=t*A+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function ee(e){for(var t="";e--;)t+="0";return t}function st(e,t,n,i){var r,s=new e(1),o=Math.ceil(i/A+4);for(O=!1;;){if(n%2&&(s=s.times(t),lt(s.d,o)&&(r=!0)),n=U(n/2),n===0){n=s.d.length-1,r&&s.d[n]===0&&++s.d[n];break}t=t.times(t),lt(t.d,o)}return O=!0,s}function ot(e){return e.d[e.d.length-1]&1}function at(e,t,n){for(var i,r=new e(t[0]),s=0;++s<t.length;)if(i=new e(t[s]),i.s)r[n](i)&&(r=i);else{r=i;break}return r}function Ue(e,t){var n,i,r,s,o,a,u,c=0,l=0,f=0,h=e.constructor,E=h.rounding,N=h.precision;if(!e.d||!e.d[0]||e.e>17)return new h(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(O=!1,u=N):u=t,a=new h(.03125);e.e>-2;)e=e.times(a),f+=5;for(i=Math.log(F(2,f))/Math.LN10*2+5|0,u+=i,n=s=o=new h(1),h.precision=u;;){if(s=T(s.times(e),u,1),n=n.times(++l),a=o.plus(C(s,n,u,1)),M(a.d).slice(0,u)===M(o.d).slice(0,u)){for(r=f;r--;)o=T(o.times(o),u,1);if(t==null)if(c<3&&de(o.d,u-i,E,c))h.precision=u+=10,n=s=a=new h(1),l=0,c++;else return T(o,h.precision=N,E,O=!0);else return h.precision=N,o}o=a}}function te(e,t){var n,i,r,s,o,a,u,c,l,f,h,E=1,N=10,y=e,S=y.d,b=y.constructor,q=b.rounding,_=b.precision;if(y.s<0||!S||!S[0]||!y.e&&S[0]==1&&S.length==1)return new b(S&&!S[0]?-1/0:y.s!=1?NaN:S?0:y);if(t==null?(O=!1,l=_):l=t,b.precision=l+=N,n=M(S),i=n.charAt(0),Math.abs(s=y.e)<15e14){for(;i<7&&i!=1||i==1&&n.charAt(1)>3;)y=y.times(e),n=M(y.d),i=n.charAt(0),E++;s=y.e,i>1?(y=new b("0."+n),s++):y=new b(i+"."+n.slice(1))}else return c=Oe(b,l+2,_).times(s+""),y=te(new b(i+"."+n.slice(1)),l-N).plus(c),b.precision=_,t==null?T(y,_,q,O=!0):y;for(f=y,u=o=y=C(y.minus(1),y.plus(1),l,1),h=T(y.times(y),l,1),r=3;;){if(o=T(o.times(h),l,1),c=u.plus(C(o,new b(r),l,1)),M(c.d).slice(0,l)===M(u.d).slice(0,l))if(u=u.times(2),s!==0&&(u=u.plus(Oe(b,l+2,_).times(s+""))),u=C(u,new b(E),l,1),t==null)if(de(u.d,l-N,q,a))b.precision=l+=N,c=o=y=C(f.minus(1),f.plus(1),l,1),h=T(y.times(y),l,1),r=a=1;else return T(u,b.precision=_,q,O=!0);else return b.precision=_,u;u=c,r+=2}}function ct(e){return String(e.s*e.s/0)}function qe(e,t){var n,i,r;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(i=t.search(/e/i))>0?(n<0&&(n=i),n+=+t.slice(i+1),t=t.substring(0,i)):n<0&&(n=t.length),i=0;t.charCodeAt(i)===48;i++);for(r=t.length;t.charCodeAt(r-1)===48;--r);if(t=t.slice(i,r),t){if(r-=i,e.e=n=n-i-1,e.d=[],i=(n+1)%A,n<0&&(i+=A),i<r){for(i&&e.d.push(+t.slice(0,i)),r-=A;i<r;)e.d.push(+t.slice(i,i+=A));t=t.slice(i),i=A-t.length}else i-=r;for(;i--;)t+="0";e.d.push(+t),O&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Ut(e,t){var n,i,r,s,o,a,u,c,l;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),it.test(t))return qe(e,t)}else if(t==="Infinity"||t==="NaN")return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Lt.test(t))n=16,t=t.toLowerCase();else if(Rt.test(t))n=2;else if(Ft.test(t))n=8;else throw Error(K+t);for(s=t.search(/p/i),s>0?(u=+t.slice(s+1),t=t.substring(2,s)):t=t.slice(2),s=t.indexOf("."),o=s>=0,i=e.constructor,o&&(t=t.replace(".",""),a=t.length,s=a-s,r=st(i,new i(n),s,s*2)),c=Ae(t,n,G),l=c.length-1,s=l;c[s]===0;--s)c.pop();return s<0?new i(e.s*0):(e.e=Ie(c,l),e.d=c,O=!1,o&&(e=C(e,r,a*4)),u&&(e=e.times(Math.abs(u)<54?F(2,u):ae.pow(2,u))),O=!0,e)}function qt(e,t){var n,i=t.d.length;if(i<3)return t.isZero()?t:oe(e,2,t,t);n=1.4*Math.sqrt(i),n=n>16?16:n|0,t=t.times(1/_e(5,n)),t=oe(e,2,t,t);for(var r,s=new e(5),o=new e(16),a=new e(20);n--;)r=t.times(t),t=t.times(s.plus(r.times(o.times(r).minus(a))));return t}function oe(e,t,n,i,r){var s,o,a,u,c=e.precision,l=Math.ceil(c/A);for(O=!1,u=n.times(n),a=new e(i);;){if(o=C(a.times(u),new e(t++*t++),c,1),a=r?i.plus(o):i.minus(o),i=C(o.times(u),new e(t++*t++),c,1),o=a.plus(i),o.d[l]!==void 0){for(s=l;o.d[s]===a.d[s]&&s--;);if(s==-1)break}s=a,a=i,i=o,o=s}return O=!0,o.d.length=l+1,o}function _e(e,t){for(var n=e;--t;)n*=e;return n}function ut(e,t){var n,i=t.s<0,r=Y(e,e.precision,1),s=r.times(.5);if(t=t.abs(),t.lte(s))return Q=i?4:1,t;if(n=t.divToInt(r),n.isZero())Q=i?3:2;else{if(t=t.minus(n.times(r)),t.lte(s))return Q=ot(n)?i?2:3:i?4:1,t;Q=ot(n)?i?1:4:i?3:2}return t.minus(r).abs()}function Ve(e,t,n,i){var r,s,o,a,u,c,l,f,h,E=e.constructor,N=n!==void 0;if(N?(j(n,1,W),i===void 0?i=E.rounding:j(i,0,8)):(n=E.precision,i=E.rounding),!e.isFinite())l=ct(e);else{for(l=X(e),o=l.indexOf("."),N?(r=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):r=t,o>=0&&(l=l.replace(".",""),h=new E(1),h.e=l.length-o,h.d=Ae(X(h),10,r),h.e=h.d.length),f=Ae(l,10,r),s=u=f.length;f[--u]==0;)f.pop();if(!f[0])l=N?"0p+0":"0";else{if(o<0?s--:(e=new E(e),e.d=f,e.e=s,e=C(e,h,n,i,0,r),f=e.d,s=e.e,c=Ke),o=f[n],a=r/2,c=c||f[n+1]!==void 0,c=i<4?(o!==void 0||c)&&(i===0||i===(e.s<0?3:2)):o>a||o===a&&(i===4||c||i===6&&f[n-1]&1||i===(e.s<0?8:7)),f.length=n,c)for(;++f[--n]>r-1;)f[n]=0,n||(++s,f.unshift(1));for(u=f.length;!f[u-1];--u);for(o=0,l="";o<u;o++)l+=Pe.charAt(f[o]);if(N){if(u>1)if(t==16||t==8){for(o=t==16?4:3,--u;u%o;u++)l+="0";for(f=Ae(l,r,t),u=f.length;!f[u-1];--u);for(o=1,l="1.";o<u;o++)l+=Pe.charAt(f[o])}else l=l.charAt(0)+"."+l.slice(1);l=l+(s<0?"p":"p+")+s}else if(s<0){for(;++s;)l="0"+l;l="0."+l}else if(++s>u)for(s-=u;s--;)l+="0";else s<u&&(l=l.slice(0,s)+"."+l.slice(s))}l=(t==16?"0x":t==2?"0b":t==8?"0o":"")+l}return e.s<0?"-"+l:l}function lt(e,t){if(e.length>t)return e.length=t,!0}function Vt(e){return new this(e).abs()}function jt(e){return new this(e).acos()}function $t(e){return new this(e).acosh()}function Ht(e,t){return new this(e).plus(t)}function Gt(e){return new this(e).asin()}function Yt(e){return new this(e).asinh()}function Jt(e){return new this(e).atan()}function zt(e){return new this(e).atanh()}function Xt(e,t){e=new this(e),t=new this(t);var n,i=this.precision,r=this.rounding,s=i+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=Y(this,s,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?Y(this,i,r):new this(0),n.s=e.s):!e.d||t.isZero()?(n=Y(this,s,1).times(.5),n.s=e.s):t.s<0?(this.precision=s,this.rounding=1,n=this.atan(C(e,t,s,1)),t=Y(this,s,1),this.precision=i,this.rounding=r,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(C(e,t,s,1)),n}function Qt(e){return new this(e).cbrt()}function Zt(e){return T(e=new this(e),e.e+1,2)}function Wt(e,t,n){return new this(e).clamp(t,n)}function Kt(e){if(!e||typeof e!="object")throw Error(Te+"Object expected");var t,n,i,r=e.defaults===!0,s=["precision",1,W,"rounding",0,8,"toExpNeg",-9e15,0,"toExpPos",0,Fe,"maxE",0,Fe,"minE",-9e15,0,"modulo",0,9];for(t=0;t<s.length;t+=3)if(n=s[t],r&&(this[n]=Me[n]),(i=e[n])!==void 0)if(U(i)===i&&i>=s[t+1]&&i<=s[t+2])this[n]=i;else throw Error(K+n+": "+i);if(n="crypto",r&&(this[n]=Me[n]),(i=e[n])!==void 0)if(i===!0||i===!1||i===0||i===1)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(tt);else this[n]=!1;else throw Error(K+n+": "+i);return this}function en(e){return new this(e).cos()}function tn(e){return new this(e).cosh()}function ft(e){var t,n,i;function r(s){var o,a,u,c=this;if(!(c instanceof r))return new r(s);if(c.constructor=r,ht(s)){c.s=s.s,O?!s.d||s.e>r.maxE?(c.e=NaN,c.d=null):s.e<r.minE?(c.e=0,c.d=[0]):(c.e=s.e,c.d=s.d.slice()):(c.e=s.e,c.d=s.d?s.d.slice():s.d);return}if(u=typeof s,u==="number"){if(s===0){c.s=1/s<0?-1:1,c.e=0,c.d=[0];return}if(s<0?(s=-s,c.s=-1):c.s=1,s===~~s&&s<1e7){for(o=0,a=s;a>=10;a/=10)o++;O?o>r.maxE?(c.e=NaN,c.d=null):o<r.minE?(c.e=0,c.d=[0]):(c.e=o,c.d=[s]):(c.e=o,c.d=[s]);return}else if(s*0!==0){s||(c.s=NaN),c.e=NaN,c.d=null;return}return qe(c,s.toString())}else if(u!=="string")throw Error(K+s);return(a=s.charCodeAt(0))===45?(s=s.slice(1),c.s=-1):(a===43&&(s=s.slice(1)),c.s=1),it.test(s)?qe(c,s):Ut(c,s)}if(r.prototype=m,r.ROUND_UP=0,r.ROUND_DOWN=1,r.ROUND_CEIL=2,r.ROUND_FLOOR=3,r.ROUND_HALF_UP=4,r.ROUND_HALF_DOWN=5,r.ROUND_HALF_EVEN=6,r.ROUND_HALF_CEIL=7,r.ROUND_HALF_FLOOR=8,r.EUCLID=9,r.config=r.set=Kt,r.clone=ft,r.isDecimal=ht,r.abs=Vt,r.acos=jt,r.acosh=$t,r.add=Ht,r.asin=Gt,r.asinh=Yt,r.atan=Jt,r.atanh=zt,r.atan2=Xt,r.cbrt=Qt,r.ceil=Zt,r.clamp=Wt,r.cos=en,r.cosh=tn,r.div=nn,r.exp=rn,r.floor=sn,r.hypot=on,r.ln=an,r.log=cn,r.log10=ln,r.log2=un,r.max=fn,r.min=hn,r.mod=dn,r.mul=pn,r.pow=mn,r.random=gn,r.round=En,r.sign=Nn,r.sin=yn,r.sinh=vn,r.sqrt=wn,r.sub=Tn,r.sum=An,r.tan=In,r.tanh=On,r.trunc=_n,e===void 0&&(e={}),e&&e.defaults!==!0)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],t=0;t<i.length;)e.hasOwnProperty(n=i[t++])||(e[n]=this[n]);return r.config(e),r}function nn(e,t){return new this(e).div(t)}function rn(e){return new this(e).exp()}function sn(e){return T(e=new this(e),e.e+1,3)}function on(){var e,t,n=new this(0);for(O=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return O=!0,new this(1/0);n=t}return O=!0,n.sqrt()}function ht(e){return e instanceof ae||e&&e.toStringTag===nt||!1}function an(e){return new this(e).ln()}function cn(e,t){return new this(e).log(t)}function un(e){return new this(e).log(2)}function ln(e){return new this(e).log(10)}function fn(){return at(this,arguments,"lt")}function hn(){return at(this,arguments,"gt")}function dn(e,t){return new this(e).mod(t)}function pn(e,t){return new this(e).mul(t)}function mn(e,t){return new this(e).pow(t)}function gn(e){var t,n,i,r,s=0,o=new this(1),a=[];if(e===void 0?e=this.precision:j(e,1,W),i=Math.ceil(e/A),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(i));s<i;)r=t[s],r>=429e7?t[s]=crypto.getRandomValues(new Uint32Array(1))[0]:a[s++]=r%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(i*=4);s<i;)r=t[s]+(t[s+1]<<8)+(t[s+2]<<16)+((t[s+3]&127)<<24),r>=214e7?crypto.randomBytes(4).copy(t,s):(a.push(r%1e7),s+=4);s=i/4}else throw Error(tt);else for(;s<i;)a[s++]=Math.random()*1e7|0;for(i=a[--s],e%=A,i&&e&&(r=F(10,A-e),a[s]=(i/r|0)*r);a[s]===0;s--)a.pop();if(s<0)n=0,a=[0];else{for(n=-1;a[0]===0;n-=A)a.shift();for(i=1,r=a[0];r>=10;r/=10)i++;i<A&&(n-=A-i)}return o.e=n,o.d=a,o}function En(e){return T(e=new this(e),e.e+1,this.rounding)}function Nn(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function yn(e){return new this(e).sin()}function vn(e){return new this(e).sinh()}function wn(e){return new this(e).sqrt()}function Tn(e,t){return new this(e).sub(t)}function An(){var e=0,t=arguments,n=new this(t[e]);for(O=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return O=!0,T(n,this.precision,this.rounding)}function In(e){return new this(e).tan()}function On(e){return new this(e).tanh()}function _n(e){return T(e=new this(e),e.e+1,1)}m[Symbol.for("nodejs.util.inspect.custom")]=m.toString,m[Symbol.toStringTag]="Decimal";var ae=m.constructor=ft(Me);ve=new ae(ve),we=new ae(we);const je=JSON,bn=e=>e.toUpperCase(),Dn=e=>{const t={};return e.forEach((n,i)=>{t[i]=n}),t},Sn=(e,t,n)=>e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0},xn=(e,t,n)=>e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0},Cn=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};function be(e,t){if(!!!e)throw new Error(t)}function kn(e){return typeof e=="object"&&e!==null}function Rn(e,t){if(!!!e)throw new Error("Unexpected invariant triggered.")}const Ln=/\r\n|[\n\r]/g;function $e(e,t){let n=0,i=1;for(const r of e.body.matchAll(Ln)){if(typeof r.index=="number"||Rn(!1),r.index>=t)break;n=r.index+r[0].length,i+=1}return{line:i,column:t+1-n}}function Fn(e){return dt(e.source,$e(e.source,e.start))}function dt(e,t){const n=e.locationOffset.column-1,i="".padStart(n)+e.body,r=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=t.line===1?n:0,u=t.column+a,c=`${e.name}:${o}:${u}
8
8
  `,l=i.split(/\r\n|[\n\r]/g),f=l[r];if(f.length>120){const h=Math.floor(u/80),E=u%80,N=[];for(let y=0;y<f.length;y+=80)N.push(f.slice(y,y+80));return c+pt([[`${o} |`,N[0]],...N.slice(1,h+1).map(y=>["|",y]),["|","^".padStart(E)],["|",N[h+1]]])}return c+pt([[`${o-1} |`,l[r-1]],[`${o} |`,f],["|","^".padStart(u)],[`${o+1} |`,l[r+1]]])}function pt(e){const t=e.filter(([i,r])=>r!==void 0),n=Math.max(...t.map(([i])=>i.length));return t.map(([i,r])=>i.padStart(n)+(r?" "+r:"")).join(`
9
- `)}function Fn(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class $e extends Error{constructor(t,...n){var i,r,s;const{nodes:o,source:a,positions:u,path:c,originalError:l,extensions:f}=Fn(n);super(t),this.name="GraphQLError",this.path=c??void 0,this.originalError=l??void 0,this.nodes=mt(Array.isArray(o)?o:o?[o]:void 0);const h=mt((i=this.nodes)===null||i===void 0?void 0:i.map(N=>N.loc).filter(N=>N!=null));this.source=a??(h==null||(r=h[0])===null||r===void 0?void 0:r.source),this.positions=u??(h==null?void 0:h.map(N=>N.start)),this.locations=u&&a?u.map(N=>je(a,N)):h==null?void 0:h.map(N=>je(N.source,N.start));const E=Cn(l==null?void 0:l.extensions)?l==null?void 0:l.extensions:void 0;this.extensions=(s=f??E)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,$e):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+=`
9
+ `)}function Pn(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class He extends Error{constructor(t,...n){var i,r,s;const{nodes:o,source:a,positions:u,path:c,originalError:l,extensions:f}=Pn(n);super(t),this.name="GraphQLError",this.path=c??void 0,this.originalError=l??void 0,this.nodes=mt(Array.isArray(o)?o:o?[o]:void 0);const h=mt((i=this.nodes)===null||i===void 0?void 0:i.map(N=>N.loc).filter(N=>N!=null));this.source=a??(h==null||(r=h[0])===null||r===void 0?void 0:r.source),this.positions=u??(h==null?void 0:h.map(N=>N.start)),this.locations=u&&a?u.map(N=>$e(a,N)):h==null?void 0:h.map(N=>$e(N.source,N.start));const E=kn(l==null?void 0:l.extensions)?l==null?void 0:l.extensions:void 0;this.extensions=(s=f??E)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),l!=null&&l.stack?Object.defineProperty(this,"stack",{value:l.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,He):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+=`
10
10
 
11
- `+Ln(n.loc));else if(this.source&&this.locations)for(const n of this.locations)t+=`
11
+ `+Fn(n.loc));else if(this.source&&this.locations)for(const n of this.locations)t+=`
12
12
 
13
- `+dt(this.source,n);return t}toJSON(){const t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function mt(e){return e===void 0||e.length===0?void 0:e}function P(e,t,n){return new $e(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Pn{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class gt{constructor(t,n,i,r,s,o){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Et={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Mn=new Set(Object.keys(Et));function Nt(e){const t=e==null?void 0:e.kind;return typeof t=="string"&&Mn.has(t)}var ue;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(ue||(ue={}));var He;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(He||(He={}));var I;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(I||(I={}));function Ge(e){return e===9||e===32}function me(e){return e>=48&&e<=57}function yt(e){return e>=97&&e<=122||e>=65&&e<=90}function vt(e){return yt(e)||e===95}function Bn(e){return yt(e)||me(e)||e===95}function Un(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let o=0;o<e.length;++o){var s;const a=e[o],u=qn(a);u!==a.length&&(i=(s=i)!==null&&s!==void 0?s:o,r=o,o!==0&&u<n&&(n=u))}return e.map((o,a)=>a===0?o:o.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function qn(e){let t=0;for(;t<e.length&&Ge(e.charCodeAt(t));)++t;return t}function Vn(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,s=i.length>1&&i.slice(1).every(E=>E.length===0||Ge(E.charCodeAt(0))),o=n.endsWith('\\"""'),a=e.endsWith('"')&&!o,u=e.endsWith("\\"),c=a||u,l=!r||e.length>70||c||s||o;let f="";const h=r&&Ge(e.charCodeAt(0));return(l&&!h||s)&&(f+=`
13
+ `+dt(this.source,n);return t}toJSON(){const t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function mt(e){return e===void 0||e.length===0?void 0:e}function P(e,t,n){return new He(`Syntax Error: ${n}`,{source:e,positions:[t]})}class Mn{constructor(t,n,i){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=i}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class gt{constructor(t,n,i,r,s,o){this.kind=t,this.start=n,this.end=i,this.line=r,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const Et={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["description","directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","interfaces","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","interfaces","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},Bn=new Set(Object.keys(Et));function Nt(e){const t=e==null?void 0:e.kind;return typeof t=="string"&&Bn.has(t)}var ce;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(ce||(ce={}));var Ge;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(Ge||(Ge={}));var I;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(I||(I={}));function Ye(e){return e===9||e===32}function pe(e){return e>=48&&e<=57}function yt(e){return e>=97&&e<=122||e>=65&&e<=90}function vt(e){return yt(e)||e===95}function Un(e){return yt(e)||pe(e)||e===95}function qn(e){var t;let n=Number.MAX_SAFE_INTEGER,i=null,r=-1;for(let o=0;o<e.length;++o){var s;const a=e[o],u=Vn(a);u!==a.length&&(i=(s=i)!==null&&s!==void 0?s:o,r=o,o!==0&&u<n&&(n=u))}return e.map((o,a)=>a===0?o:o.slice(n)).slice((t=i)!==null&&t!==void 0?t:0,r+1)}function Vn(e){let t=0;for(;t<e.length&&Ye(e.charCodeAt(t));)++t;return t}function jn(e,t){const n=e.replace(/"""/g,'\\"""'),i=n.split(/\r\n|[\n\r]/g),r=i.length===1,s=i.length>1&&i.slice(1).every(E=>E.length===0||Ye(E.charCodeAt(0))),o=n.endsWith('\\"""'),a=e.endsWith('"')&&!o,u=e.endsWith("\\"),c=a||u,l=!r||e.length>70||c||s||o;let f="";const h=r&&Ye(e.charCodeAt(0));return(l&&!h||s)&&(f+=`
14
14
  `),f+=n,(l||c)&&(f+=`
15
- `),'"""'+f+'"""'}var p;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(p||(p={}));class jn{constructor(t){const n=new gt(p.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==p.EOF)do if(t.next)t=t.next;else{const n=Hn(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===p.COMMENT);return t}}function $n(e){return e===p.BANG||e===p.DOLLAR||e===p.AMP||e===p.PAREN_L||e===p.PAREN_R||e===p.SPREAD||e===p.COLON||e===p.EQUALS||e===p.AT||e===p.BRACKET_L||e===p.BRACKET_R||e===p.BRACE_L||e===p.PIPE||e===p.BRACE_R}function le(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function De(e,t){return wt(e.charCodeAt(t))&&Tt(e.charCodeAt(t+1))}function wt(e){return e>=55296&&e<=56319}function Tt(e){return e>=56320&&e<=57343}function re(e,t){const n=e.source.body.codePointAt(t);if(n===void 0)return p.EOF;if(n>=32&&n<=126){const i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function L(e,t,n,i,r){const s=e.line,o=1+n-e.lineStart;return new gt(t,n,i,s,o,r)}function Hn(e,t){const n=e.source.body,i=n.length;let r=t;for(;r<i;){const s=n.charCodeAt(r);switch(s){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return Gn(e,r);case 33:return L(e,p.BANG,r,r+1);case 36:return L(e,p.DOLLAR,r,r+1);case 38:return L(e,p.AMP,r,r+1);case 40:return L(e,p.PAREN_L,r,r+1);case 41:return L(e,p.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return L(e,p.SPREAD,r,r+3);break;case 58:return L(e,p.COLON,r,r+1);case 61:return L(e,p.EQUALS,r,r+1);case 64:return L(e,p.AT,r,r+1);case 91:return L(e,p.BRACKET_L,r,r+1);case 93:return L(e,p.BRACKET_R,r,r+1);case 123:return L(e,p.BRACE_L,r,r+1);case 124:return L(e,p.PIPE,r,r+1);case 125:return L(e,p.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?Zn(e,r):Jn(e,r)}if(me(s)||s===45)return Yn(e,r,s);if(vt(s))return Wn(e,r);throw P(e.source,r,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:le(s)||De(n,r)?`Unexpected character: ${re(e,r)}.`:`Invalid character: ${re(e,r)}.`)}return L(e,p.EOF,i,i)}function Gn(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if(s===10||s===13)break;if(le(s))++r;else if(De(n,r))r+=2;else break}return L(e,p.COMMENT,t,r,n.slice(t+1,r))}function Yn(e,t,n){const i=e.source.body;let r=t,s=n,o=!1;if(s===45&&(s=i.charCodeAt(++r)),s===48){if(s=i.charCodeAt(++r),me(s))throw P(e.source,r,`Invalid number, unexpected digit after 0: ${re(e,r)}.`)}else r=Ye(e,r,s),s=i.charCodeAt(r);if(s===46&&(o=!0,s=i.charCodeAt(++r),r=Ye(e,r,s),s=i.charCodeAt(r)),(s===69||s===101)&&(o=!0,s=i.charCodeAt(++r),(s===43||s===45)&&(s=i.charCodeAt(++r)),r=Ye(e,r,s),s=i.charCodeAt(r)),s===46||vt(s))throw P(e.source,r,`Invalid number, expected digit but got: ${re(e,r)}.`);return L(e,o?p.FLOAT:p.INT,t,r,i.slice(t,r))}function Ye(e,t,n){if(!me(n))throw P(e.source,t,`Invalid number, expected digit but got: ${re(e,t)}.`);const i=e.source.body;let r=t+1;for(;me(i.charCodeAt(r));)++r;return r}function Jn(e,t){const n=e.source.body,i=n.length;let r=t+1,s=r,o="";for(;r<i;){const a=n.charCodeAt(r);if(a===34)return o+=n.slice(s,r),L(e,p.STRING,t,r+1,o);if(a===92){o+=n.slice(s,r);const u=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?zn(e,r):Xn(e,r):Qn(e,r);o+=u.value,r+=u.size,s=r;continue}if(a===10||a===13)break;if(le(a))++r;else if(De(n,r))r+=2;else throw P(e.source,r,`Invalid character within String: ${re(e,r)}.`)}throw P(e.source,r,"Unterminated string.")}function zn(e,t){const n=e.source.body;let i=0,r=3;for(;r<12;){const s=n.charCodeAt(t+r++);if(s===125){if(r<5||!le(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|ge(s),i<0)break}throw P(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function Xn(e,t){const n=e.source.body,i=At(n,t+2);if(le(i))return{value:String.fromCodePoint(i),size:6};if(wt(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){const r=At(n,t+8);if(Tt(r))return{value:String.fromCodePoint(i,r),size:12}}throw P(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function At(e,t){return ge(e.charCodeAt(t))<<12|ge(e.charCodeAt(t+1))<<8|ge(e.charCodeAt(t+2))<<4|ge(e.charCodeAt(t+3))}function ge(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Qn(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
16
- `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw P(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Zn(e,t){const n=e.source.body,i=n.length;let r=e.lineStart,s=t+3,o=s,a="";const u=[];for(;s<i;){const c=n.charCodeAt(s);if(c===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){a+=n.slice(o,s),u.push(a);const l=L(e,p.BLOCK_STRING,t,s+3,Un(u).join(`
17
- `));return e.line+=u.length-1,e.lineStart=r,l}if(c===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(c===10||c===13){a+=n.slice(o,s),u.push(a),c===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,r=s;continue}if(le(c))++s;else if(De(n,s))s+=2;else throw P(e.source,s,`Invalid character within String: ${re(e,s)}.`)}throw P(e.source,s,"Unterminated string.")}function Wn(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if(Bn(s))++r;else break}return L(e,p.NAME,t,r,n.slice(t,r))}const Kn=10,It=2;function Je(e){return Se(e,[])}function Se(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return ei(e,t);default:return String(e)}}function ei(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(ti(e)){const i=e.toJSON();if(i!==e)return typeof i=="string"?i:Se(i,n)}else if(Array.isArray(e))return ii(e,n);return ni(e,n)}function ti(e){return typeof e.toJSON=="function"}function ni(e,t){const n=Object.entries(e);return n.length===0?"{}":t.length>It?"["+ri(e)+"]":"{ "+n.map(([r,s])=>r+": "+Se(s,t)).join(", ")+" }"}function ii(e,t){if(e.length===0)return"[]";if(t.length>It)return"[Array]";const n=Math.min(Kn,e.length),i=e.length-n,r=[];for(let s=0;s<n;++s)r.push(Se(e[s],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function ri(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}const si=process.env.NODE_ENV==="production"?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;const r=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===s){const o=Je(t);throw new Error(`Cannot use ${r} "${o}" from another module or realm.
15
+ `),'"""'+f+'"""'}var p;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(p||(p={}));class $n{constructor(t){const n=new gt(p.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==p.EOF)do if(t.next)t=t.next;else{const n=Gn(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===p.COMMENT);return t}}function Hn(e){return e===p.BANG||e===p.DOLLAR||e===p.AMP||e===p.PAREN_L||e===p.PAREN_R||e===p.SPREAD||e===p.COLON||e===p.EQUALS||e===p.AT||e===p.BRACKET_L||e===p.BRACKET_R||e===p.BRACE_L||e===p.PIPE||e===p.BRACE_R}function ue(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function De(e,t){return wt(e.charCodeAt(t))&&Tt(e.charCodeAt(t+1))}function wt(e){return e>=55296&&e<=56319}function Tt(e){return e>=56320&&e<=57343}function re(e,t){const n=e.source.body.codePointAt(t);if(n===void 0)return p.EOF;if(n>=32&&n<=126){const i=String.fromCodePoint(n);return i==='"'?`'"'`:`"${i}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function L(e,t,n,i,r){const s=e.line,o=1+n-e.lineStart;return new gt(t,n,i,s,o,r)}function Gn(e,t){const n=e.source.body,i=n.length;let r=t;for(;r<i;){const s=n.charCodeAt(r);switch(s){case 65279:case 9:case 32:case 44:++r;continue;case 10:++r,++e.line,e.lineStart=r;continue;case 13:n.charCodeAt(r+1)===10?r+=2:++r,++e.line,e.lineStart=r;continue;case 35:return Yn(e,r);case 33:return L(e,p.BANG,r,r+1);case 36:return L(e,p.DOLLAR,r,r+1);case 38:return L(e,p.AMP,r,r+1);case 40:return L(e,p.PAREN_L,r,r+1);case 41:return L(e,p.PAREN_R,r,r+1);case 46:if(n.charCodeAt(r+1)===46&&n.charCodeAt(r+2)===46)return L(e,p.SPREAD,r,r+3);break;case 58:return L(e,p.COLON,r,r+1);case 61:return L(e,p.EQUALS,r,r+1);case 64:return L(e,p.AT,r,r+1);case 91:return L(e,p.BRACKET_L,r,r+1);case 93:return L(e,p.BRACKET_R,r,r+1);case 123:return L(e,p.BRACE_L,r,r+1);case 124:return L(e,p.PIPE,r,r+1);case 125:return L(e,p.BRACE_R,r,r+1);case 34:return n.charCodeAt(r+1)===34&&n.charCodeAt(r+2)===34?Wn(e,r):zn(e,r)}if(pe(s)||s===45)return Jn(e,r,s);if(vt(s))return Kn(e,r);throw P(e.source,r,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:ue(s)||De(n,r)?`Unexpected character: ${re(e,r)}.`:`Invalid character: ${re(e,r)}.`)}return L(e,p.EOF,i,i)}function Yn(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if(s===10||s===13)break;if(ue(s))++r;else if(De(n,r))r+=2;else break}return L(e,p.COMMENT,t,r,n.slice(t+1,r))}function Jn(e,t,n){const i=e.source.body;let r=t,s=n,o=!1;if(s===45&&(s=i.charCodeAt(++r)),s===48){if(s=i.charCodeAt(++r),pe(s))throw P(e.source,r,`Invalid number, unexpected digit after 0: ${re(e,r)}.`)}else r=Je(e,r,s),s=i.charCodeAt(r);if(s===46&&(o=!0,s=i.charCodeAt(++r),r=Je(e,r,s),s=i.charCodeAt(r)),(s===69||s===101)&&(o=!0,s=i.charCodeAt(++r),(s===43||s===45)&&(s=i.charCodeAt(++r)),r=Je(e,r,s),s=i.charCodeAt(r)),s===46||vt(s))throw P(e.source,r,`Invalid number, expected digit but got: ${re(e,r)}.`);return L(e,o?p.FLOAT:p.INT,t,r,i.slice(t,r))}function Je(e,t,n){if(!pe(n))throw P(e.source,t,`Invalid number, expected digit but got: ${re(e,t)}.`);const i=e.source.body;let r=t+1;for(;pe(i.charCodeAt(r));)++r;return r}function zn(e,t){const n=e.source.body,i=n.length;let r=t+1,s=r,o="";for(;r<i;){const a=n.charCodeAt(r);if(a===34)return o+=n.slice(s,r),L(e,p.STRING,t,r+1,o);if(a===92){o+=n.slice(s,r);const u=n.charCodeAt(r+1)===117?n.charCodeAt(r+2)===123?Xn(e,r):Qn(e,r):Zn(e,r);o+=u.value,r+=u.size,s=r;continue}if(a===10||a===13)break;if(ue(a))++r;else if(De(n,r))r+=2;else throw P(e.source,r,`Invalid character within String: ${re(e,r)}.`)}throw P(e.source,r,"Unterminated string.")}function Xn(e,t){const n=e.source.body;let i=0,r=3;for(;r<12;){const s=n.charCodeAt(t+r++);if(s===125){if(r<5||!ue(i))break;return{value:String.fromCodePoint(i),size:r}}if(i=i<<4|me(s),i<0)break}throw P(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+r)}".`)}function Qn(e,t){const n=e.source.body,i=At(n,t+2);if(ue(i))return{value:String.fromCodePoint(i),size:6};if(wt(i)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){const r=At(n,t+8);if(Tt(r))return{value:String.fromCodePoint(i,r),size:12}}throw P(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function At(e,t){return me(e.charCodeAt(t))<<12|me(e.charCodeAt(t+1))<<8|me(e.charCodeAt(t+2))<<4|me(e.charCodeAt(t+3))}function me(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Zn(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
16
+ `,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw P(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function Wn(e,t){const n=e.source.body,i=n.length;let r=e.lineStart,s=t+3,o=s,a="";const u=[];for(;s<i;){const c=n.charCodeAt(s);if(c===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){a+=n.slice(o,s),u.push(a);const l=L(e,p.BLOCK_STRING,t,s+3,qn(u).join(`
17
+ `));return e.line+=u.length-1,e.lineStart=r,l}if(c===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(c===10||c===13){a+=n.slice(o,s),u.push(a),c===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,r=s;continue}if(ue(c))++s;else if(De(n,s))s+=2;else throw P(e.source,s,`Invalid character within String: ${re(e,s)}.`)}throw P(e.source,s,"Unterminated string.")}function Kn(e,t){const n=e.source.body,i=n.length;let r=t+1;for(;r<i;){const s=n.charCodeAt(r);if(Un(s))++r;else break}return L(e,p.NAME,t,r,n.slice(t,r))}const ei=10,It=2;function ze(e){return Se(e,[])}function Se(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return ti(e,t);default:return String(e)}}function ti(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(ni(e)){const i=e.toJSON();if(i!==e)return typeof i=="string"?i:Se(i,n)}else if(Array.isArray(e))return ri(e,n);return ii(e,n)}function ni(e){return typeof e.toJSON=="function"}function ii(e,t){const n=Object.entries(e);return n.length===0?"{}":t.length>It?"["+si(e)+"]":"{ "+n.map(([r,s])=>r+": "+Se(s,t)).join(", ")+" }"}function ri(e,t){if(e.length===0)return"[]";if(t.length>It)return"[Array]";const n=Math.min(ei,e.length),i=e.length-n,r=[];for(let s=0;s<n;++s)r.push(Se(e[s],t));return i===1?r.push("... 1 more item"):i>1&&r.push(`... ${i} more items`),"["+r.join(", ")+"]"}function si(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}const oi=process.env.NODE_ENV==="production"?function(t,n){return t instanceof n}:function(t,n){if(t instanceof n)return!0;if(typeof t=="object"&&t!==null){var i;const r=n.prototype[Symbol.toStringTag],s=Symbol.toStringTag in t?t[Symbol.toStringTag]:(i=t.constructor)===null||i===void 0?void 0:i.name;if(r===s){const o=ze(t);throw new Error(`Cannot use ${r} "${o}" from another module or realm.
18
18
 
19
19
  Ensure that there is only one instance of "graphql" in the node_modules
20
20
  directory. If different versions of "graphql" are the dependencies of other
@@ -25,12 +25,12 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
25
25
  Duplicate "graphql" modules cannot be used at the same time since different
26
26
  versions may have different capabilities and behavior. The data from one
27
27
  version used in the function from another could produce confusing and
28
- spurious results.`)}}return!1};class Ot{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||be(!1,`Body must be a string. Received: ${Je(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||be(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||be(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function oi(e){return si(e,Ot)}function ai(e,t){return new ci(e,t).parseDocument()}class ci{constructor(t,n={}){const i=oi(t)?t:new Ot(t);this._lexer=new jn(i),this._options=n,this._tokenCounter=0}parseName(){const t=this.expectToken(p.NAME);return this.node(t,{kind:I.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:I.DOCUMENT,definitions:this.many(p.SOF,this.parseDefinition,p.EOF)})}parseDefinition(){if(this.peek(p.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===p.NAME){switch(n.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()}if(t)throw P(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(p.BRACE_L))return this.node(t,{kind:I.OPERATION_DEFINITION,operation:ue.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(p.NAME)&&(i=this.parseName()),this.node(t,{kind:I.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(p.NAME);switch(t.value){case"query":return ue.QUERY;case"mutation":return ue.MUTATION;case"subscription":return ue.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(p.PAREN_L,this.parseVariableDefinition,p.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:I.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(p.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(p.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(p.DOLLAR),this.node(t,{kind:I.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:I.SELECTION_SET,selections:this.many(p.BRACE_L,this.parseSelection,p.BRACE_R)})}parseSelection(){return this.peek(p.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,r;return this.expectOptionalToken(p.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:I.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(p.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(p.PAREN_L,n,p.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(p.COLON),this.node(n,{kind:I.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(p.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(p.NAME)?this.node(t,{kind:I.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:I.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:I.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:I.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case p.BRACKET_L:return this.parseList(t);case p.BRACE_L:return this.parseObject(t);case p.INT:return this.advanceLexer(),this.node(n,{kind:I.INT,value:n.value});case p.FLOAT:return this.advanceLexer(),this.node(n,{kind:I.FLOAT,value:n.value});case p.STRING:case p.BLOCK_STRING:return this.parseStringLiteral();case p.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:I.BOOLEAN,value:!0});case"false":return this.node(n,{kind:I.BOOLEAN,value:!1});case"null":return this.node(n,{kind:I.NULL});default:return this.node(n,{kind:I.ENUM,value:n.value})}case p.DOLLAR:if(t)if(this.expectToken(p.DOLLAR),this._lexer.token.kind===p.NAME){const i=this._lexer.token.value;throw P(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:I.STRING,value:t.value,block:t.kind===p.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:I.LIST,values:this.any(p.BRACKET_L,n,p.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:I.OBJECT,fields:this.any(p.BRACE_L,n,p.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(p.COLON),this.node(n,{kind:I.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(p.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(p.AT),this.node(n,{kind:I.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(p.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(p.BRACKET_R),n=this.node(t,{kind:I.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(p.BANG)?this.node(t,{kind:I.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:I.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(p.STRING)||this.peek(p.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),r=this.many(p.BRACE_L,this.parseOperationTypeDefinition,p.BRACE_R);return this.node(t,{kind:I.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(p.COLON);const i=this.parseNamedType();return this.node(t,{kind:I.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:I.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:I.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(p.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(p.BRACE_L,this.parseFieldDefinition,p.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(p.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:I.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(p.PAREN_L,this.parseInputValueDef,p.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(p.COLON);const r=this.parseTypeReference();let s;this.expectOptionalToken(p.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:I.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:I.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:I.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(p.EQUALS)?this.delimitedMany(p.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:I.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(p.BRACE_L,this.parseEnumValueDefinition,p.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:I.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw P(this._lexer.source,this._lexer.token.start,`${xe(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:I.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(p.BRACE_L,this.parseInputValueDef,p.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===p.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)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(p.BRACE_L,this.parseOperationTypeDefinition,p.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:I.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:I.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:I.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:I.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:I.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:I.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:I.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(p.AT);const i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:I.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(p.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(He,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Pn(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw P(this._lexer.source,n.start,`Expected ${_t(t)}, found ${xe(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const n=this._lexer.token;if(n.kind===p.NAME&&n.value===t)this.advanceLexer();else throw P(this._lexer.source,n.start,`Expected "${t}", found ${xe(n)}.`)}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===p.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const n=t??this._lexer.token;return P(this._lexer.source,n.start,`Unexpected ${xe(n)}.`)}any(t,n,i){this.expectToken(t);const r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==p.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw P(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function xe(e){const t=e.value;return _t(e.kind)+(t!=null?` "${t}"`:"")}function _t(e){return $n(e)?`"${e}"`:e}function ui(e){return`"${e.replace(li,fi)}"`}const li=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function fi(e){return hi[e.charCodeAt(0)]}const hi=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],di=Object.freeze({});function pi(e,t,n=Et){const i=new Map;for(const b of Object.values(I))i.set(b,mi(t,b));let r,s=Array.isArray(e),o=[e],a=-1,u=[],c=e,l,f;const h=[],E=[];do{a++;const b=a===o.length,q=b&&u.length!==0;if(b){if(l=E.length===0?void 0:h[h.length-1],c=f,f=E.pop(),q)if(s){c=c.slice();let x=0;for(const[z,$]of u){const ne=z-x;$===null?(c.splice(ne,1),x++):c[ne]=$}}else{c=Object.defineProperties({},Object.getOwnPropertyDescriptors(c));for(const[x,z]of u)c[x]=z}a=r.index,o=r.keys,u=r.edits,s=r.inArray,r=r.prev}else if(f){if(l=s?a:o[a],c=f[l],c==null)continue;h.push(l)}let _;if(!Array.isArray(c)){var N,y;Nt(c)||be(!1,`Invalid AST Node: ${Je(c)}.`);const x=b?(N=i.get(c.kind))===null||N===void 0?void 0:N.leave:(y=i.get(c.kind))===null||y===void 0?void 0:y.enter;if(_=x==null?void 0:x.call(t,c,l,f,h,E),_===di)break;if(_===!1){if(!b){h.pop();continue}}else if(_!==void 0&&(u.push([l,_]),!b))if(Nt(_))c=_;else{h.pop();continue}}if(_===void 0&&q&&u.push([l,c]),b)h.pop();else{var S;r={inArray:s,index:a,keys:o,edits:u,prev:r},s=Array.isArray(c),o=s?c:(S=n[c.kind])!==null&&S!==void 0?S:[],a=-1,u=[],f&&E.push(f),f=c}}while(r!==void 0);return u.length!==0?u[u.length-1][1]:e}function mi(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function gi(e){return pi(e,Ni)}const Ei=80,Ni={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>w(e.definitions,`
28
+ spurious results.`)}}return!1};class Ot{constructor(t,n="GraphQL request",i={line:1,column:1}){typeof t=="string"||be(!1,`Body must be a string. Received: ${ze(t)}.`),this.body=t,this.name=n,this.locationOffset=i,this.locationOffset.line>0||be(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||be(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function ai(e){return oi(e,Ot)}function ci(e,t){return new ui(e,t).parseDocument()}class ui{constructor(t,n={}){const i=ai(t)?t:new Ot(t);this._lexer=new $n(i),this._options=n,this._tokenCounter=0}parseName(){const t=this.expectToken(p.NAME);return this.node(t,{kind:I.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:I.DOCUMENT,definitions:this.many(p.SOF,this.parseDefinition,p.EOF)})}parseDefinition(){if(this.peek(p.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===p.NAME){switch(n.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()}if(t)throw P(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(p.BRACE_L))return this.node(t,{kind:I.OPERATION_DEFINITION,operation:ce.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let i;return this.peek(p.NAME)&&(i=this.parseName()),this.node(t,{kind:I.OPERATION_DEFINITION,operation:n,name:i,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(p.NAME);switch(t.value){case"query":return ce.QUERY;case"mutation":return ce.MUTATION;case"subscription":return ce.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(p.PAREN_L,this.parseVariableDefinition,p.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:I.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(p.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(p.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(p.DOLLAR),this.node(t,{kind:I.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:I.SELECTION_SET,selections:this.many(p.BRACE_L,this.parseSelection,p.BRACE_R)})}parseSelection(){return this.peek(p.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let i,r;return this.expectOptionalToken(p.COLON)?(i=n,r=this.parseName()):r=n,this.node(t,{kind:I.FIELD,alias:i,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(p.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(p.PAREN_L,n,p.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,i=this.parseName();return this.expectToken(p.COLON),this.node(n,{kind:I.ARGUMENT,name:i,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(p.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(p.NAME)?this.node(t,{kind:I.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:I.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:I.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:I.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case p.BRACKET_L:return this.parseList(t);case p.BRACE_L:return this.parseObject(t);case p.INT:return this.advanceLexer(),this.node(n,{kind:I.INT,value:n.value});case p.FLOAT:return this.advanceLexer(),this.node(n,{kind:I.FLOAT,value:n.value});case p.STRING:case p.BLOCK_STRING:return this.parseStringLiteral();case p.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:I.BOOLEAN,value:!0});case"false":return this.node(n,{kind:I.BOOLEAN,value:!1});case"null":return this.node(n,{kind:I.NULL});default:return this.node(n,{kind:I.ENUM,value:n.value})}case p.DOLLAR:if(t)if(this.expectToken(p.DOLLAR),this._lexer.token.kind===p.NAME){const i=this._lexer.token.value;throw P(this._lexer.source,n.start,`Unexpected variable "$${i}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:I.STRING,value:t.value,block:t.kind===p.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:I.LIST,values:this.any(p.BRACKET_L,n,p.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:I.OBJECT,fields:this.any(p.BRACE_L,n,p.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,i=this.parseName();return this.expectToken(p.COLON),this.node(n,{kind:I.OBJECT_FIELD,name:i,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(p.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(p.AT),this.node(n,{kind:I.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(p.BRACKET_L)){const i=this.parseTypeReference();this.expectToken(p.BRACKET_R),n=this.node(t,{kind:I.LIST_TYPE,type:i})}else n=this.parseNamedType();return this.expectOptionalToken(p.BANG)?this.node(t,{kind:I.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:I.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(p.STRING)||this.peek(p.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const i=this.parseConstDirectives(),r=this.many(p.BRACE_L,this.parseOperationTypeDefinition,p.BRACE_R);return this.node(t,{kind:I.SCHEMA_DEFINITION,description:n,directives:i,operationTypes:r})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(p.COLON);const i=this.parseNamedType();return this.node(t,{kind:I.OPERATION_TYPE_DEFINITION,operation:n,type:i})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const i=this.parseName(),r=this.parseConstDirectives();return this.node(t,{kind:I.SCALAR_TYPE_DEFINITION,description:n,name:i,directives:r})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:I.OBJECT_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(p.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(p.BRACE_L,this.parseFieldDefinition,p.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName(),r=this.parseArgumentDefs();this.expectToken(p.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:I.FIELD_DEFINITION,description:n,name:i,arguments:r,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(p.PAREN_L,this.parseInputValueDef,p.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseName();this.expectToken(p.COLON);const r=this.parseTypeReference();let s;this.expectOptionalToken(p.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:I.INPUT_VALUE_DEFINITION,description:n,name:i,type:r,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const i=this.parseName(),r=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:I.INTERFACE_TYPE_DEFINITION,description:n,name:i,interfaces:r,directives:s,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:I.UNION_TYPE_DEFINITION,description:n,name:i,directives:r,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(p.EQUALS)?this.delimitedMany(p.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:I.ENUM_TYPE_DEFINITION,description:n,name:i,directives:r,values:s})}parseEnumValuesDefinition(){return this.optionalMany(p.BRACE_L,this.parseEnumValueDefinition,p.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),i=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(t,{kind:I.ENUM_VALUE_DEFINITION,description:n,name:i,directives:r})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw P(this._lexer.source,this._lexer.token.start,`${xe(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const i=this.parseName(),r=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:I.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:i,directives:r,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(p.BRACE_L,this.parseInputValueDef,p.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===p.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)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),i=this.optionalMany(p.BRACE_L,this.parseOperationTypeDefinition,p.BRACE_R);if(n.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:I.SCHEMA_EXTENSION,directives:n,operationTypes:i})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),i=this.parseConstDirectives();if(i.length===0)throw this.unexpected();return this.node(t,{kind:I.SCALAR_TYPE_EXTENSION,name:n,directives:i})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:I.OBJECT_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),i=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(i.length===0&&r.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:I.INTERFACE_TYPE_EXTENSION,name:n,interfaces:i,directives:r,fields:s})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:I.UNION_TYPE_EXTENSION,name:n,directives:i,types:r})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:I.ENUM_TYPE_EXTENSION,name:n,directives:i,values:r})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),i=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(i.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:I.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:i,fields:r})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(p.AT);const i=this.parseName(),r=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:I.DIRECTIVE_DEFINITION,description:n,name:i,arguments:r,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(p.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(Ge,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new Mn(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw P(this._lexer.source,n.start,`Expected ${_t(t)}, found ${xe(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const n=this._lexer.token;if(n.kind===p.NAME&&n.value===t)this.advanceLexer();else throw P(this._lexer.source,n.start,`Expected "${t}", found ${xe(n)}.`)}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===p.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const n=t??this._lexer.token;return P(this._lexer.source,n.start,`Unexpected ${xe(n)}.`)}any(t,n,i){this.expectToken(t);const r=[];for(;!this.expectOptionalToken(i);)r.push(n.call(this));return r}optionalMany(t,n,i){if(this.expectOptionalToken(t)){const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}return[]}many(t,n,i){this.expectToken(t);const r=[];do r.push(n.call(this));while(!this.expectOptionalToken(i));return r}delimitedMany(t,n){this.expectOptionalToken(t);const i=[];do i.push(n.call(this));while(this.expectOptionalToken(t));return i}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==p.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw P(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function xe(e){const t=e.value;return _t(e.kind)+(t!=null?` "${t}"`:"")}function _t(e){return Hn(e)?`"${e}"`:e}function li(e){return`"${e.replace(fi,hi)}"`}const fi=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function hi(e){return di[e.charCodeAt(0)]}const di=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],pi=Object.freeze({});function mi(e,t,n=Et){const i=new Map;for(const b of Object.values(I))i.set(b,gi(t,b));let r,s=Array.isArray(e),o=[e],a=-1,u=[],c=e,l,f;const h=[],E=[];do{a++;const b=a===o.length,q=b&&u.length!==0;if(b){if(l=E.length===0?void 0:h[h.length-1],c=f,f=E.pop(),q)if(s){c=c.slice();let x=0;for(const[z,$]of u){const ne=z-x;$===null?(c.splice(ne,1),x++):c[ne]=$}}else{c=Object.defineProperties({},Object.getOwnPropertyDescriptors(c));for(const[x,z]of u)c[x]=z}a=r.index,o=r.keys,u=r.edits,s=r.inArray,r=r.prev}else if(f){if(l=s?a:o[a],c=f[l],c==null)continue;h.push(l)}let _;if(!Array.isArray(c)){var N,y;Nt(c)||be(!1,`Invalid AST Node: ${ze(c)}.`);const x=b?(N=i.get(c.kind))===null||N===void 0?void 0:N.leave:(y=i.get(c.kind))===null||y===void 0?void 0:y.enter;if(_=x==null?void 0:x.call(t,c,l,f,h,E),_===pi)break;if(_===!1){if(!b){h.pop();continue}}else if(_!==void 0&&(u.push([l,_]),!b))if(Nt(_))c=_;else{h.pop();continue}}if(_===void 0&&q&&u.push([l,c]),b)h.pop();else{var S;r={inArray:s,index:a,keys:o,edits:u,prev:r},s=Array.isArray(c),o=s?c:(S=n[c.kind])!==null&&S!==void 0?S:[],a=-1,u=[],f&&E.push(f),f=c}}while(r!==void 0);return u.length!==0?u[u.length-1][1]:e}function gi(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function Ei(e){return mi(e,yi)}const Ni=80,yi={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>w(e.definitions,`
29
29
 
30
- `)},OperationDefinition:{leave(e){const t=D("(",w(e.variableDefinitions,", "),")"),n=w([e.operation,w([e.name,t]),w(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i})=>e+": "+t+D(" = ",n)+D(" ",w(i," "))},SelectionSet:{leave:({selections:e})=>J(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){const s=D("",e,": ")+t;let o=s+D("(",w(n,", "),")");return o.length>Ei&&(o=s+D(`(
30
+ `)},OperationDefinition:{leave(e){const t=D("(",w(e.variableDefinitions,", "),")"),n=w([e.operation,w([e.name,t]),w(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:i})=>e+": "+t+D(" = ",n)+D(" ",w(i," "))},SelectionSet:{leave:({selections:e})=>J(e)},Field:{leave({alias:e,name:t,arguments:n,directives:i,selectionSet:r}){const s=D("",e,": ")+t;let o=s+D("(",w(n,", "),")");return o.length>Ni&&(o=s+D(`(
31
31
  `,Ce(w(n,`
32
32
  `)),`
33
- )`)),w([o,w(i," "),r]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+D(" ",w(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>w(["...",D("on ",e),w(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r})=>`fragment ${e}${D("(",w(n,", "),")")} on ${t} ${D("",w(i," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Vn(e):ui(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+w(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+w(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+D("(",w(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>D("",e,`
33
+ )`)),w([o,w(i," "),r]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+D(" ",w(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>w(["...",D("on ",e),w(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:i,selectionSet:r})=>`fragment ${e}${D("(",w(n,", "),")")} on ${t} ${D("",w(i," ")," ")}`+r},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?jn(e):li(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+w(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+w(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+D("(",w(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>D("",e,`
34
34
  `)+w(["schema",w(t," "),J(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>D("",e,`
35
35
  `)+w(["scalar",t,w(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:i,fields:r})=>D("",e,`
36
36
  `)+w(["type",t,D("implements ",w(n," & ")),w(i," "),J(r)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:i,directives:r})=>D("",e,`
@@ -52,7 +52,7 @@ spurious results.`)}}return!1};class Ot{constructor(t,n="GraphQL request",i={lin
52
52
  `)),`
53
53
  }`)}function D(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function Ce(e){return D(" ",e.replace(/\n/g,`
54
54
  `))}function bt(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(`
55
- `)))!==null&&t!==void 0?t:!1}const Dt=e=>{var i,r;let t;const n=e.definitions.filter(s=>s.kind==="OperationDefinition");return n.length===1&&(t=(r=(i=n[0])==null?void 0:i.name)==null?void 0:r.value),t},ze=e=>{if(typeof e=="string"){let n;try{const i=ai(e);n=Dt(i)}catch{}return{query:e,operationName:n}}const t=Dt(e);return{query:gi(e),operationName:t}};class Ee extends Error{constructor(t,n){const i=`${Ee.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,Ee.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Ee)}static extractMessage(t){var n,i;return((i=(n=t.errors)==null?void 0:n[0])==null?void 0:i.message)??`GraphQL Error (Code: ${t.status})`}}var yi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xe={exports:{}};(function(e,t){var n=typeof self<"u"?self:yi,i=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function u(d){return d&&DataView.prototype.isPrototypeOf(d)}if(a.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(d){return d&&c.indexOf(Object.prototype.toString.call(d))>-1};function f(d){if(typeof d!="string"&&(d=String(d)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(d))throw new TypeError("Invalid character in header field name");return d.toLowerCase()}function h(d){return typeof d!="string"&&(d=String(d)),d}function E(d){var g={next:function(){var v=d.shift();return{done:v===void 0,value:v}}};return a.iterable&&(g[Symbol.iterator]=function(){return g}),g}function N(d){this.map={},d instanceof N?d.forEach(function(g,v){this.append(v,g)},this):Array.isArray(d)?d.forEach(function(g){this.append(g[0],g[1])},this):d&&Object.getOwnPropertyNames(d).forEach(function(g){this.append(g,d[g])},this)}N.prototype.append=function(d,g){d=f(d),g=h(g);var v=this.map[d];this.map[d]=v?v+", "+g:g},N.prototype.delete=function(d){delete this.map[f(d)]},N.prototype.get=function(d){return d=f(d),this.has(d)?this.map[d]:null},N.prototype.has=function(d){return this.map.hasOwnProperty(f(d))},N.prototype.set=function(d,g){this.map[f(d)]=h(g)},N.prototype.forEach=function(d,g){for(var v in this.map)this.map.hasOwnProperty(v)&&d.call(g,this.map[v],v,this)},N.prototype.keys=function(){var d=[];return this.forEach(function(g,v){d.push(v)}),E(d)},N.prototype.values=function(){var d=[];return this.forEach(function(g){d.push(g)}),E(d)},N.prototype.entries=function(){var d=[];return this.forEach(function(g,v){d.push([v,g])}),E(d)},a.iterable&&(N.prototype[Symbol.iterator]=N.prototype.entries);function y(d){if(d.bodyUsed)return Promise.reject(new TypeError("Already read"));d.bodyUsed=!0}function S(d){return new Promise(function(g,v){d.onload=function(){g(d.result)},d.onerror=function(){v(d.error)}})}function b(d){var g=new FileReader,v=S(g);return g.readAsArrayBuffer(d),v}function q(d){var g=new FileReader,v=S(g);return g.readAsText(d),v}function _(d){for(var g=new Uint8Array(d),v=new Array(g.length),V=0;V<g.length;V++)v[V]=String.fromCharCode(g[V]);return v.join("")}function x(d){if(d.slice)return d.slice(0);var g=new Uint8Array(d.byteLength);return g.set(new Uint8Array(d)),g.buffer}function z(){return this.bodyUsed=!1,this._initBody=function(d){this._bodyInit=d,d?typeof d=="string"?this._bodyText=d:a.blob&&Blob.prototype.isPrototypeOf(d)?this._bodyBlob=d:a.formData&&FormData.prototype.isPrototypeOf(d)?this._bodyFormData=d:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(d)?this._bodyText=d.toString():a.arrayBuffer&&a.blob&&u(d)?(this._bodyArrayBuffer=x(d.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(d)||l(d))?this._bodyArrayBuffer=x(d):this._bodyText=d=Object.prototype.toString.call(d):this._bodyText="",this.headers.get("content-type")||(typeof d=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(d)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var d=y(this);if(d)return d;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var d=y(this);if(d)return d;if(this._bodyBlob)return q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(_(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(se)}),this.json=function(){return this.text().then(JSON.parse)},this}var $=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ne(d){var g=d.toUpperCase();return $.indexOf(g)>-1?g:d}function H(d,g){g=g||{};var v=g.body;if(d instanceof H){if(d.bodyUsed)throw new TypeError("Already read");this.url=d.url,this.credentials=d.credentials,g.headers||(this.headers=new N(d.headers)),this.method=d.method,this.mode=d.mode,this.signal=d.signal,!v&&d._bodyInit!=null&&(v=d._bodyInit,d.bodyUsed=!0)}else this.url=String(d);if(this.credentials=g.credentials||this.credentials||"same-origin",(g.headers||!this.headers)&&(this.headers=new N(g.headers)),this.method=ne(g.method||this.method||"GET"),this.mode=g.mode||this.mode||null,this.signal=g.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&v)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(v)}H.prototype.clone=function(){return new H(this,{body:this._bodyInit})};function se(d){var g=new FormData;return d.trim().split("&").forEach(function(v){if(v){var V=v.split("="),B=V.shift().replace(/\+/g," "),k=V.join("=").replace(/\+/g," ");g.append(decodeURIComponent(B),decodeURIComponent(k))}}),g}function Ne(d){var g=new N,v=d.replace(/\r?\n[\t ]+/g," ");return v.split(/\r?\n/).forEach(function(V){var B=V.split(":"),k=B.shift().trim();if(k){var Le=B.join(":").trim();g.append(k,Le)}}),g}z.call(H.prototype);function R(d,g){g||(g={}),this.type="default",this.status=g.status===void 0?200:g.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in g?g.statusText:"OK",this.headers=new N(g.headers),this.url=g.url||"",this._initBody(d)}z.call(R.prototype),R.prototype.clone=function(){return new R(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new N(this.headers),url:this.url})},R.error=function(){var d=new R(null,{status:0,statusText:""});return d.type="error",d};var he=[301,302,303,307,308];R.redirect=function(d,g){if(he.indexOf(g)===-1)throw new RangeError("Invalid status code");return new R(null,{status:g,headers:{location:d}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(g,v){this.message=g,this.name=v;var V=Error(g);this.stack=V.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function ie(d,g){return new Promise(function(v,V){var B=new H(d,g);if(B.signal&&B.signal.aborted)return V(new o.DOMException("Aborted","AbortError"));var k=new XMLHttpRequest;function Le(){k.abort()}k.onload=function(){var ye={status:k.status,statusText:k.statusText,headers:Ne(k.getAllResponseHeaders()||"")};ye.url="responseURL"in k?k.responseURL:ye.headers.get("X-Request-URL");var We="response"in k?k.response:k.responseText;v(new R(We,ye))},k.onerror=function(){V(new TypeError("Network request failed"))},k.ontimeout=function(){V(new TypeError("Network request failed"))},k.onabort=function(){V(new o.DOMException("Aborted","AbortError"))},k.open(B.method,B.url,!0),B.credentials==="include"?k.withCredentials=!0:B.credentials==="omit"&&(k.withCredentials=!1),"responseType"in k&&a.blob&&(k.responseType="blob"),B.headers.forEach(function(ye,We){k.setRequestHeader(We,ye)}),B.signal&&(B.signal.addEventListener("abort",Le),k.onreadystatechange=function(){k.readyState===4&&B.signal.removeEventListener("abort",Le)}),k.send(typeof B._bodyInit>"u"?null:B._bodyInit)})}return ie.polyfill=!0,s.fetch||(s.fetch=ie,s.Headers=N,s.Request=H,s.Response=R),o.Headers=N,o.Request=H,o.Response=R,o.fetch=ie,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;t=r.fetch,t.default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t})(Xe,Xe.exports);var ke=Xe.exports;const Re=vi(ke),wi=de({__proto__:null,default:Re},[ke]),fe=e=>{let t={};return e&&(typeof Headers<"u"&&e instanceof Headers||wi&&ke.Headers&&e instanceof ke.Headers?t=bn(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):t=e),t},St=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),Ti=e=>{if(!Array.isArray(e.query)){const i=e,r=[`query=${encodeURIComponent(St(i.query))}`];return e.variables&&r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`),i.operationName&&r.push(`operationName=${encodeURIComponent(i.operationName)}`),r.join("&")}if(typeof e.variables<"u"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,n=e.query.reduce((i,r,s)=>(i.push({query:St(r),variables:t.variables?t.jsonSerializer.stringify(t.variables[s]):void 0}),i),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`},Ai=e=>async t=>{const{url:n,query:i,variables:r,operationName:s,fetch:o,fetchOptions:a,middleware:u}=t,c={...t.headers};let l="",f;e==="POST"?(f=Oi(i,r,s,a.jsonSerializer),typeof f=="string"&&(c["Content-Type"]="application/json")):l=Ti({query:i,variables:r,operationName:s,jsonSerializer:a.jsonSerializer??Ve});const h={method:e,headers:c,body:f,...a};let E=n,N=h;if(u){const y=await Promise.resolve(u({...h,url:n,operationName:s,variables:r})),{url:S,...b}=y;E=S,N=b}return l&&(E=`${E}?${l}`),await o(E,N)};class Ii{constructor(t,n={}){this.url=t,this.requestConfig=n,this.rawRequest=async(...i)=>{const[r,s,o]=i,a=Sn(r,s,o),{headers:u,fetch:c=Re,method:l="POST",requestMiddleware:f,responseMiddleware:h,...E}=this.requestConfig,{url:N}=this;a.signal!==void 0&&(E.signal=a.signal);const{operationName:y}=ze(a.query);return Qe({url:N,query:a.query,variables:a.variables,headers:{...fe(Ze(u)),...fe(a.requestHeaders)},operationName:y,fetch:c,method:l,fetchOptions:E,middleware:f}).then(S=>(h&&h(S),S)).catch(S=>{throw h&&h(S),S})}}async request(t,...n){const[i,r]=n,s=Dn(t,i,r),{headers:o,fetch:a=Re,method:u="POST",requestMiddleware:c,responseMiddleware:l,...f}=this.requestConfig,{url:h}=this;s.signal!==void 0&&(f.signal=s.signal);const{query:E,operationName:N}=ze(s.document);return Qe({url:h,query:E,variables:s.variables,headers:{...fe(Ze(o)),...fe(s.requestHeaders)},operationName:N,fetch:a,method:u,fetchOptions:f,middleware:c}).then(y=>(l&&l(y),y.data)).catch(y=>{throw l&&l(y),y})}batchRequests(t,n){const i=xn(t,n),{headers:r,...s}=this.requestConfig;i.signal!==void 0&&(s.signal=i.signal);const o=i.documents.map(({document:u})=>ze(u).query),a=i.documents.map(({variables:u})=>u);return Qe({url:this.url,query:o,variables:a,headers:{...fe(Ze(r)),...fe(i.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??Re,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(u=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(u),u.data)).catch(u=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(u),u})}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,n){const{headers:i}=this.requestConfig;return i?i[t]=n:this.requestConfig.headers={[t]:n},this}setEndpoint(t){return this.url=t,this}}const Qe=async e=>{const{query:t,variables:n,fetchOptions:i}=e,r=Ai(_n(e.method??"post")),s=Array.isArray(e.query),o=await r(e),a=await _i(o,i.jsonSerializer??Ve),u=Array.isArray(a)?!a.some(({data:l})=>!l):!!a.data,c=Array.isArray(a)||!a.errors||Array.isArray(a.errors)&&!a.errors.length||i.errorPolicy==="all"||i.errorPolicy==="ignore";if(o.ok&&c&&u){const{errors:l,...f}=(Array.isArray(a),a),h=i.errorPolicy==="ignore"?f:a;return{...s?{data:h}:h,headers:o.headers,status:o.status}}else{const l=typeof a=="string"?{error:a}:a;throw new Ee({...l,status:o.status,headers:o.headers},{query:t,variables:n})}},Oi=(e,t,n,i)=>{const r=i??Ve;if(!Array.isArray(e))return r.stringify({query:e,variables:t,operationName:n});if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const s=e.reduce((o,a,u)=>(o.push({query:a,variables:t?t[u]:void 0}),o),[]);return r.stringify(s)},_i=async(e,t)=>{let n;return e.headers.forEach((i,r)=>{r.toLowerCase()==="content-type"&&(n=i)}),n&&(n.toLowerCase().startsWith("application/json")||n.toLowerCase().startsWith("application/graphql+json")||n.toLowerCase().startsWith("application/graphql-response+json"))?t.parse(await e.text()):e.text()},Ze=e=>typeof e=="function"?e():e,xt=(e,...t)=>e.reduce((n,i,r)=>`${n}${i}${r in t?String(t[r]):""}`,""),Ct={getMeta:xt`
55
+ `)))!==null&&t!==void 0?t:!1}const Dt=e=>{var i,r;let t;const n=e.definitions.filter(s=>s.kind==="OperationDefinition");return n.length===1&&(t=(r=(i=n[0])==null?void 0:i.name)==null?void 0:r.value),t},Xe=e=>{if(typeof e=="string"){let n;try{const i=ci(e);n=Dt(i)}catch{}return{query:e,operationName:n}}const t=Dt(e);return{query:Ei(e),operationName:t}};class ge extends Error{constructor(t,n){const i=`${ge.extractMessage(t)}: ${JSON.stringify({response:t,request:n})}`;super(i),Object.setPrototypeOf(this,ge.prototype),this.response=t,this.request=n,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ge)}static extractMessage(t){var n,i;return((i=(n=t.errors)==null?void 0:n[0])==null?void 0:i.message)??`GraphQL Error (Code: ${t.status})`}}function vi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ee={exports:{}},wi=Ee.exports,St;function Ti(){return St||(St=1,function(e,t){var n=typeof self<"u"?self:wi,i=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function u(d){return d&&DataView.prototype.isPrototypeOf(d)}if(a.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(d){return d&&c.indexOf(Object.prototype.toString.call(d))>-1};function f(d){if(typeof d!="string"&&(d=String(d)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(d))throw new TypeError("Invalid character in header field name");return d.toLowerCase()}function h(d){return typeof d!="string"&&(d=String(d)),d}function E(d){var g={next:function(){var v=d.shift();return{done:v===void 0,value:v}}};return a.iterable&&(g[Symbol.iterator]=function(){return g}),g}function N(d){this.map={},d instanceof N?d.forEach(function(g,v){this.append(v,g)},this):Array.isArray(d)?d.forEach(function(g){this.append(g[0],g[1])},this):d&&Object.getOwnPropertyNames(d).forEach(function(g){this.append(g,d[g])},this)}N.prototype.append=function(d,g){d=f(d),g=h(g);var v=this.map[d];this.map[d]=v?v+", "+g:g},N.prototype.delete=function(d){delete this.map[f(d)]},N.prototype.get=function(d){return d=f(d),this.has(d)?this.map[d]:null},N.prototype.has=function(d){return this.map.hasOwnProperty(f(d))},N.prototype.set=function(d,g){this.map[f(d)]=h(g)},N.prototype.forEach=function(d,g){for(var v in this.map)this.map.hasOwnProperty(v)&&d.call(g,this.map[v],v,this)},N.prototype.keys=function(){var d=[];return this.forEach(function(g,v){d.push(v)}),E(d)},N.prototype.values=function(){var d=[];return this.forEach(function(g){d.push(g)}),E(d)},N.prototype.entries=function(){var d=[];return this.forEach(function(g,v){d.push([v,g])}),E(d)},a.iterable&&(N.prototype[Symbol.iterator]=N.prototype.entries);function y(d){if(d.bodyUsed)return Promise.reject(new TypeError("Already read"));d.bodyUsed=!0}function S(d){return new Promise(function(g,v){d.onload=function(){g(d.result)},d.onerror=function(){v(d.error)}})}function b(d){var g=new FileReader,v=S(g);return g.readAsArrayBuffer(d),v}function q(d){var g=new FileReader,v=S(g);return g.readAsText(d),v}function _(d){for(var g=new Uint8Array(d),v=new Array(g.length),V=0;V<g.length;V++)v[V]=String.fromCharCode(g[V]);return v.join("")}function x(d){if(d.slice)return d.slice(0);var g=new Uint8Array(d.byteLength);return g.set(new Uint8Array(d)),g.buffer}function z(){return this.bodyUsed=!1,this._initBody=function(d){this._bodyInit=d,d?typeof d=="string"?this._bodyText=d:a.blob&&Blob.prototype.isPrototypeOf(d)?this._bodyBlob=d:a.formData&&FormData.prototype.isPrototypeOf(d)?this._bodyFormData=d:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(d)?this._bodyText=d.toString():a.arrayBuffer&&a.blob&&u(d)?(this._bodyArrayBuffer=x(d.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(d)||l(d))?this._bodyArrayBuffer=x(d):this._bodyText=d=Object.prototype.toString.call(d):this._bodyText="",this.headers.get("content-type")||(typeof d=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(d)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var d=y(this);if(d)return d;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?y(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(b)}),this.text=function(){var d=y(this);if(d)return d;if(this._bodyBlob)return q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(_(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(se)}),this.json=function(){return this.text().then(JSON.parse)},this}var $=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ne(d){var g=d.toUpperCase();return $.indexOf(g)>-1?g:d}function H(d,g){g=g||{};var v=g.body;if(d instanceof H){if(d.bodyUsed)throw new TypeError("Already read");this.url=d.url,this.credentials=d.credentials,g.headers||(this.headers=new N(d.headers)),this.method=d.method,this.mode=d.mode,this.signal=d.signal,!v&&d._bodyInit!=null&&(v=d._bodyInit,d.bodyUsed=!0)}else this.url=String(d);if(this.credentials=g.credentials||this.credentials||"same-origin",(g.headers||!this.headers)&&(this.headers=new N(g.headers)),this.method=ne(g.method||this.method||"GET"),this.mode=g.mode||this.mode||null,this.signal=g.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&v)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(v)}H.prototype.clone=function(){return new H(this,{body:this._bodyInit})};function se(d){var g=new FormData;return d.trim().split("&").forEach(function(v){if(v){var V=v.split("="),B=V.shift().replace(/\+/g," "),k=V.join("=").replace(/\+/g," ");g.append(decodeURIComponent(B),decodeURIComponent(k))}}),g}function Ne(d){var g=new N,v=d.replace(/\r?\n[\t ]+/g," ");return v.split(/\r?\n/).forEach(function(V){var B=V.split(":"),k=B.shift().trim();if(k){var Le=B.join(":").trim();g.append(k,Le)}}),g}z.call(H.prototype);function R(d,g){g||(g={}),this.type="default",this.status=g.status===void 0?200:g.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in g?g.statusText:"OK",this.headers=new N(g.headers),this.url=g.url||"",this._initBody(d)}z.call(R.prototype),R.prototype.clone=function(){return new R(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new N(this.headers),url:this.url})},R.error=function(){var d=new R(null,{status:0,statusText:""});return d.type="error",d};var fe=[301,302,303,307,308];R.redirect=function(d,g){if(fe.indexOf(g)===-1)throw new RangeError("Invalid status code");return new R(null,{status:g,headers:{location:d}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(g,v){this.message=g,this.name=v;var V=Error(g);this.stack=V.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function ie(d,g){return new Promise(function(v,V){var B=new H(d,g);if(B.signal&&B.signal.aborted)return V(new o.DOMException("Aborted","AbortError"));var k=new XMLHttpRequest;function Le(){k.abort()}k.onload=function(){var ye={status:k.status,statusText:k.statusText,headers:Ne(k.getAllResponseHeaders()||"")};ye.url="responseURL"in k?k.responseURL:ye.headers.get("X-Request-URL");var We="response"in k?k.response:k.responseText;v(new R(We,ye))},k.onerror=function(){V(new TypeError("Network request failed"))},k.ontimeout=function(){V(new TypeError("Network request failed"))},k.onabort=function(){V(new o.DOMException("Aborted","AbortError"))},k.open(B.method,B.url,!0),B.credentials==="include"?k.withCredentials=!0:B.credentials==="omit"&&(k.withCredentials=!1),"responseType"in k&&a.blob&&(k.responseType="blob"),B.headers.forEach(function(ye,We){k.setRequestHeader(We,ye)}),B.signal&&(B.signal.addEventListener("abort",Le),k.onreadystatechange=function(){k.readyState===4&&B.signal.removeEventListener("abort",Le)}),k.send(typeof B._bodyInit>"u"?null:B._bodyInit)})}return ie.polyfill=!0,s.fetch||(s.fetch=ie,s.Headers=N,s.Request=H,s.Response=R),o.Headers=N,o.Request=H,o.Response=R,o.fetch=ie,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var r=i;t=r.fetch,t.default=r.fetch,t.fetch=r.fetch,t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response,e.exports=t}(Ee,Ee.exports)),Ee.exports}var ke=Ti();const Re=vi(ke),Ai=he({__proto__:null,default:Re},[ke]),le=e=>{let t={};return e&&(typeof Headers<"u"&&e instanceof Headers||Ai&&ke.Headers&&e instanceof ke.Headers?t=Dn(e):Array.isArray(e)?e.forEach(([n,i])=>{n&&i!==void 0&&(t[n]=i)}):t=e),t},xt=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),Ii=e=>{if(!Array.isArray(e.query)){const i=e,r=[`query=${encodeURIComponent(xt(i.query))}`];return e.variables&&r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`),i.operationName&&r.push(`operationName=${encodeURIComponent(i.operationName)}`),r.join("&")}if(typeof e.variables<"u"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,n=e.query.reduce((i,r,s)=>(i.push({query:xt(r),variables:t.variables?t.jsonSerializer.stringify(t.variables[s]):void 0}),i),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`},Oi=e=>async t=>{const{url:n,query:i,variables:r,operationName:s,fetch:o,fetchOptions:a,middleware:u}=t,c={...t.headers};let l="",f;e==="POST"?(f=bi(i,r,s,a.jsonSerializer),typeof f=="string"&&(c["Content-Type"]="application/json")):l=Ii({query:i,variables:r,operationName:s,jsonSerializer:a.jsonSerializer??je});const h={method:e,headers:c,body:f,...a};let E=n,N=h;if(u){const y=await Promise.resolve(u({...h,url:n,operationName:s,variables:r})),{url:S,...b}=y;E=S,N=b}return l&&(E=`${E}?${l}`),await o(E,N)};class _i{constructor(t,n={}){this.url=t,this.requestConfig=n,this.rawRequest=async(...i)=>{const[r,s,o]=i,a=xn(r,s,o),{headers:u,fetch:c=Re,method:l="POST",requestMiddleware:f,responseMiddleware:h,...E}=this.requestConfig,{url:N}=this;a.signal!==void 0&&(E.signal=a.signal);const{operationName:y}=Xe(a.query);return Qe({url:N,query:a.query,variables:a.variables,headers:{...le(Ze(u)),...le(a.requestHeaders)},operationName:y,fetch:c,method:l,fetchOptions:E,middleware:f}).then(S=>(h&&h(S),S)).catch(S=>{throw h&&h(S),S})}}async request(t,...n){const[i,r]=n,s=Sn(t,i,r),{headers:o,fetch:a=Re,method:u="POST",requestMiddleware:c,responseMiddleware:l,...f}=this.requestConfig,{url:h}=this;s.signal!==void 0&&(f.signal=s.signal);const{query:E,operationName:N}=Xe(s.document);return Qe({url:h,query:E,variables:s.variables,headers:{...le(Ze(o)),...le(s.requestHeaders)},operationName:N,fetch:a,method:u,fetchOptions:f,middleware:c}).then(y=>(l&&l(y),y.data)).catch(y=>{throw l&&l(y),y})}batchRequests(t,n){const i=Cn(t,n),{headers:r,...s}=this.requestConfig;i.signal!==void 0&&(s.signal=i.signal);const o=i.documents.map(({document:u})=>Xe(u).query),a=i.documents.map(({variables:u})=>u);return Qe({url:this.url,query:o,variables:a,headers:{...le(Ze(r)),...le(i.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??Re,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware}).then(u=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(u),u.data)).catch(u=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(u),u})}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,n){const{headers:i}=this.requestConfig;return i?i[t]=n:this.requestConfig.headers={[t]:n},this}setEndpoint(t){return this.url=t,this}}const Qe=async e=>{const{query:t,variables:n,fetchOptions:i}=e,r=Oi(bn(e.method??"post")),s=Array.isArray(e.query),o=await r(e),a=await Di(o,i.jsonSerializer??je),u=Array.isArray(a)?!a.some(({data:l})=>!l):!!a.data,c=Array.isArray(a)||!a.errors||Array.isArray(a.errors)&&!a.errors.length||i.errorPolicy==="all"||i.errorPolicy==="ignore";if(o.ok&&c&&u){const{errors:l,...f}=(Array.isArray(a),a),h=i.errorPolicy==="ignore"?f:a;return{...s?{data:h}:h,headers:o.headers,status:o.status}}else{const l=typeof a=="string"?{error:a}:a;throw new ge({...l,status:o.status,headers:o.headers},{query:t,variables:n})}},bi=(e,t,n,i)=>{const r=i??je;if(!Array.isArray(e))return r.stringify({query:e,variables:t,operationName:n});if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const s=e.reduce((o,a,u)=>(o.push({query:a,variables:t?t[u]:void 0}),o),[]);return r.stringify(s)},Di=async(e,t)=>{let n;return e.headers.forEach((i,r)=>{r.toLowerCase()==="content-type"&&(n=i)}),n&&(n.toLowerCase().startsWith("application/json")||n.toLowerCase().startsWith("application/graphql+json")||n.toLowerCase().startsWith("application/graphql-response+json"))?t.parse(await e.text()):e.text()},Ze=e=>typeof e=="function"?e():e,Ct=(e,...t)=>e.reduce((n,i,r)=>`${n}${i}${r in t?String(t[r]):""}`,""),kt={getMeta:Ct`
56
56
  query getDoctype($doctype: String!) {
57
57
  getMeta(doctype: $doctype) {
58
58
  id
@@ -62,7 +62,7 @@ spurious results.`)}}return!1};class Ot{constructor(t,n="GraphQL request",i={lin
62
62
  actions
63
63
  }
64
64
  }
65
- `},bi=xt`
65
+ `},Si=Ct`
66
66
  type Doctype {
67
67
  id: ID!
68
68
  name: String!
@@ -108,5 +108,5 @@ spurious results.`)}}return!1};class Ot{constructor(t,n="GraphQL request",i={lin
108
108
  query: Query
109
109
  mutation: Mutation
110
110
  }
111
- `,Di=e=>JSON.parse(e,(t,n)=>{if(typeof n=="string")try{return JSON.parse(n,(i,r)=>typeof r=="string"&&!isNaN(Number(r))?new ce(r):r)}catch{return n}else if(!isNaN(Number(n)))return new ce(n);return n}),Si={getMeta:async(e,t)=>{const n=new Ii(t||"/graphql",{jsonSerializer:{stringify:r=>JSON.stringify(r),parse:Di}}),{getMeta:i}=await n.request({document:Ct.getMeta,variables:{doctype:e}});return i}};Z.methods=Si,Z.queries=Ct,Z.typeDefs=bi,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
111
+ `,xi=e=>JSON.parse(e,(t,n)=>{if(typeof n=="string")try{return JSON.parse(n,(i,r)=>typeof r=="string"&&!isNaN(Number(r))?new ae(r):r)}catch{return n}else if(!isNaN(Number(n)))return new ae(n);return n}),Ci={getMeta:async(e,t)=>{const n=new _i(t||"/graphql",{jsonSerializer:{stringify:r=>JSON.stringify(r),parse:xi}}),{getMeta:i}=await n.request({document:kt.getMeta,variables:{doctype:e}});return i}};Z.methods=Ci,Z.queries=kt,Z.typeDefs=Si,Object.defineProperty(Z,Symbol.toStringTag,{value:"Module"})});
112
112
  //# sourceMappingURL=graphql-client.umd.cjs.map