@spritz-finance/api-client 0.0.4 → 0.0.5
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.
- package/LICENCE +15 -0
- package/README.md +161 -21
- package/dist/spritz-api-client.d.ts +89 -21
- package/dist/spritz-api-client.js +64 -46
- package/dist/spritz-api-client.js.map +1 -1
- package/dist/spritz-api-client.mjs +64 -46
- package/dist/spritz-api-client.mjs.map +1 -1
- package/package.json +4 -6
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`),
|
|
3
|
-
`)}function
|
|
1
|
+
"use strict";var at=require("axios"),Ai=Object.getOwnPropertyNames,Z=(e,n)=>function(){return n||(0,e[Ai(e)[0]])((n={exports:{}}).exports,n),n.exports};function xe(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?xe=function(t){return typeof t}:xe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xe(e)}function oe(e){return xe(e)=="object"&&e!==null}var ot=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator",G=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";function In(e,n){for(var t=/\r\n|[\n\r]/g,i=1,r=n+1,a;(a=t.exec(e.body))&&a.index<n;)i+=1,r=n+1-(a.index+a[0].length);return{line:i,column:r}}function Di(e){return st(e.source,In(e.source,e.start))}function st(e,n){var t=e.locationOffset.column-1,i=qe(t)+e.body,r=n.line-1,a=e.locationOffset.line-1,u=n.line+a,o=n.line===1?t:0,s=n.column+o,l="".concat(e.name,":").concat(u,":").concat(s,`
|
|
2
|
+
`),g=i.split(/\r\n|[\n\r]/g),E=g[r];if(E.length>120){for(var y=Math.floor(s/80),d=s%80,N=[],w=0;w<E.length;w+=80)N.push(E.slice(w,w+80));return l+ut([["".concat(u),N[0]]].concat(N.slice(1,y+1).map(function(O){return["",O]}),[[" ",qe(d-1)+"^"],["",N[y+1]]]))}return l+ut([["".concat(u-1),g[r-1]],["".concat(u),E],["",qe(s-1)+"^"],["".concat(u+1),g[r+1]]])}function ut(e){var n=e.filter(function(i){i[0];var r=i[1];return r!==void 0}),t=Math.max.apply(Math,n.map(function(i){var r=i[0];return r.length}));return n.map(function(i){var r=i[0],a=i[1];return Oi(t,r)+(a?" | "+a:" |")}).join(`
|
|
3
|
+
`)}function qe(e){return Array(e+1).join(" ")}function Oi(e,n){return qe(e-n.length)+n}function Ce(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ce=function(t){return typeof t}:Ce=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ce(e)}function ct(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,i)}return t}function _i(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};n%2?ct(Object(t),!0).forEach(function(i){Fi(e,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ct(Object(t)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(t,i))})}return e}function Fi(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function Li(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function lt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ri(e,n,t){return n&<(e.prototype,n),t&<(e,t),e}function Pi(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(n&&n.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),n&&Ae(e,n)}function Ui(e){var n=dt();return function(){var i=De(e),r;if(n){var a=De(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return ft(this,r)}}function ft(e,n){return n&&(Ce(n)==="object"||typeof n=="function")?n:we(e)}function we(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wn(e){var n=typeof Map=="function"?new Map:void 0;return wn=function(i){if(i===null||!Bi(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof n<"u"){if(n.has(i))return n.get(i);n.set(i,r)}function r(){return je(i,arguments,De(this).constructor)}return r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Ae(r,i)},wn(e)}function je(e,n,t){return dt()?je=Reflect.construct:je=function(r,a,u){var o=[null];o.push.apply(o,a);var s=Function.bind.apply(r,o),l=new s;return u&&Ae(l,u.prototype),l},je.apply(null,arguments)}function dt(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Bi(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ae(e,n){return Ae=Object.setPrototypeOf||function(i,r){return i.__proto__=r,i},Ae(e,n)}function De(e){return De=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},De(e)}var U=function(e){Pi(t,e);var n=Ui(t);function t(i,r,a,u,o,s,l){var g,E,y,d;Li(this,t),d=n.call(this,i),d.name="GraphQLError",d.originalError=s??void 0,d.nodes=vt(Array.isArray(r)?r:r?[r]:void 0);for(var N=[],w=0,O=(D=d.nodes)!==null&&D!==void 0?D:[];w<O.length;w++){var D,P=O[w],L=P.loc;L!=null&&N.push(L)}N=vt(N),d.source=a??((g=N)===null||g===void 0?void 0:g[0].source),d.positions=u??((E=N)===null||E===void 0?void 0:E.map(function(c){return c.start})),d.locations=u&&a?u.map(function(c){return In(a,c)}):(y=N)===null||y===void 0?void 0:y.map(function(c){return In(c.source,c.start)}),d.path=o??void 0;var f=s?.extensions;return l==null&&oe(f)?d.extensions=_i({},f):d.extensions=l??{},Object.defineProperties(we(d),{message:{enumerable:!0},locations:{enumerable:d.locations!=null},path:{enumerable:d.path!=null},extensions:{enumerable:d.extensions!=null&&Object.keys(d.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),s!=null&&s.stack?(Object.defineProperty(we(d),"stack",{value:s.stack,writable:!0,configurable:!0}),ft(d)):(Error.captureStackTrace?Error.captureStackTrace(we(d),t):Object.defineProperty(we(d),"stack",{value:Error().stack,writable:!0,configurable:!0}),d)}return Ri(t,[{key:"toString",value:function(){return Vi(this)}},{key:G,get:function(){return"Object"}}]),t}(wn(Error));function vt(e){return e===void 0||e.length===0?void 0:e}function Vi(e){var n=e.message;if(e.nodes)for(var t=0,i=e.nodes;t<i.length;t++){var r=i[t];r.loc&&(n+=`
|
|
4
4
|
|
|
5
|
-
`+
|
|
5
|
+
`+Di(r.loc))}else if(e.source&&e.locations)for(var a=0,u=e.locations;a<u.length;a++){var o=u[a];n+=`
|
|
6
6
|
|
|
7
|
-
`+
|
|
7
|
+
`+st(e.source,o)}return n}var h=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});function Oe(e,n){var t=!!e;if(!t)throw new Error(n??"Unexpected invariant triggered.")}var Mi=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,An=Mi;function H(e){var n=e.prototype.toJSON;typeof n=="function"||Oe(0),e.prototype.inspect=n,An&&(e.prototype[An]=n)}var xi=function(){function e(t,i,r){this.start=t.start,this.end=i.end,this.startToken=t,this.endToken=i,this.source=r}var n=e.prototype;return n.toJSON=function(){return{start:this.start,end:this.end}},e}();H(xi);var qi=function(){function e(t,i,r,a,u,o,s){this.kind=t,this.start=i,this.end=r,this.line=a,this.column=u,this.value=s,this.prev=o,this.next=null}var n=e.prototype;return n.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e}();H(qi);function Dn(e){return e!=null&&typeof e.kind=="string"}function Ge(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ge=function(t){return typeof t}:Ge=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ge(e)}var Ci=10,pt=2;function F(e){return $e(e,[])}function $e(e,n){switch(Ge(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return e===null?"null":ji(e,n);default:return String(e)}}function ji(e,n){if(n.indexOf(e)!==-1)return"[Circular]";var t=[].concat(n,[e]),i=Qi(e);if(i!==void 0){var r=i.call(e);if(r!==e)return typeof r=="string"?r:$e(r,t)}else if(Array.isArray(e))return $i(e,t);return Gi(e,t)}function Gi(e,n){var t=Object.keys(e);if(t.length===0)return"{}";if(n.length>pt)return"["+Ji(e)+"]";var i=t.map(function(r){var a=$e(e[r],n);return r+": "+a});return"{ "+i.join(", ")+" }"}function $i(e,n){if(e.length===0)return"[]";if(n.length>pt)return"[Array]";for(var t=Math.min(Ci,e.length),i=e.length-t,r=[],a=0;a<t;++a)r.push($e(e[a],n));return i===1?r.push("... 1 more item"):i>1&&r.push("... ".concat(i," more items")),"["+r.join(", ")+"]"}function Qi(e){var n=e[String(An)];if(typeof n=="function")return n;if(typeof e.inspect=="function")return e.inspect}function Ji(e){var n=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(n==="Object"&&typeof e.constructor=="function"){var t=e.constructor.name;if(typeof t=="string"&&t!=="")return t}return n}function _(e,n){var t=!!e;if(!t)throw new Error(n)}function Qe(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Qe=function(t){return typeof t}:Qe=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qe(e)}var ee=function(n,t){if(n instanceof t)return!0;if(Qe(n)==="object"&&n!==null){var i,r=t.prototype[Symbol.toStringTag],a=Symbol.toStringTag in n?n[Symbol.toStringTag]:(i=n.constructor)===null||i===void 0?void 0:i.name;if(r===a){var u=F(n);throw new Error("Cannot use ".concat(r,' "').concat(u,`" from another module or realm.
|
|
8
8
|
|
|
9
9
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
10
10
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -15,31 +15,31 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
15
15
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
16
16
|
versions may have different capabilities and behavior. The data from one
|
|
17
17
|
version used in the function from another could produce confusing and
|
|
18
|
-
spurious results.`))}}return!1};function
|
|
19
|
-
`)===-1,
|
|
20
|
-
`+
|
|
21
|
-
`+
|
|
22
|
-
`),'"""'+
|
|
18
|
+
spurious results.`))}}return!1};function mt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Hi(e,n,t){return n&&mt(e.prototype,n),t&&mt(e,t),e}(function(){function e(n){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof n=="string"||_(0,"Body must be a string. Received: ".concat(F(n),".")),this.body=n,this.name=t,this.locationOffset=i,this.locationOffset.line>0||_(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||_(0,"column in locationOffset is 1-indexed and must be positive.")}return Hi(e,[{key:G,get:function(){return"Source"}}]),e})();var R=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});function zi(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=e.indexOf(`
|
|
19
|
+
`)===-1,r=e[0]===" "||e[0]===" ",a=e[e.length-1]==='"',u=e[e.length-1]==="\\",o=!i||a||u||t,s="";return o&&!(i&&r)&&(s+=`
|
|
20
|
+
`+n),s+=n?e.replace(/\n/g,`
|
|
21
|
+
`+n):e,o&&(s+=`
|
|
22
|
+
`),'"""'+s.replace(/"""/g,'\\"""')+'"""'}var Yi={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"]},Xi=Object.freeze({});function ht(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yi,i=void 0,r=Array.isArray(e),a=[e],u=-1,o=[],s=void 0,l=void 0,g=void 0,E=[],y=[],d=e;do{u++;var N=u===a.length,w=N&&o.length!==0;if(N){if(l=y.length===0?void 0:E[E.length-1],s=g,g=y.pop(),w){if(r)s=s.slice();else{for(var O={},D=0,P=Object.keys(s);D<P.length;D++){var L=P[D];O[L]=s[L]}s=O}for(var f=0,c=0;c<o.length;c++){var S=o[c][0],v=o[c][1];r&&(S-=f),r&&v===null?(s.splice(S,1),f++):s[S]=v}}u=i.index,a=i.keys,o=i.edits,r=i.inArray,i=i.prev}else{if(l=g?r?u:a[u]:void 0,s=g?g[l]:d,s==null)continue;g&&E.push(l)}var b=void 0;if(!Array.isArray(s)){if(!Dn(s))throw new Error("Invalid AST Node: ".concat(F(s),"."));var A=On(n,s.kind,N);if(A){if(b=A.call(n,s,l,g,E,y),b===Xi)break;if(b===!1){if(!N){E.pop();continue}}else if(b!==void 0&&(o.push([l,b]),!N))if(Dn(b))s=b;else{E.pop();continue}}}if(b===void 0&&w&&o.push([l,s]),N)E.pop();else{var m;i={inArray:r,index:u,keys:a,edits:o,prev:i},r=Array.isArray(s),a=r?s:(m=t[s.kind])!==null&&m!==void 0?m:[],u=-1,o=[],g&&y.push(g),g=s}}while(i!==void 0);return o.length!==0&&(d=o[o.length-1][1]),d}function On(e,n,t){var i=e[n];if(i){if(!t&&typeof i=="function")return i;var r=t?i.leave:i.enter;if(typeof r=="function")return r}else{var a=t?e.leave:e.enter;if(a){if(typeof a=="function")return a;var u=a[n];if(typeof u=="function")return u}}}var Ki=Array.prototype.find?function(e,n){return Array.prototype.find.call(e,n)}:function(e,n){for(var t=0;t<e.length;t++){var i=e[t];if(n(i))return i}},yt=Ki,Wi=Object.values||function(e){return Object.keys(e).map(function(n){return e[n]})},se=Wi,Zi=Object.entries||function(e){return Object.keys(e).map(function(n){return[n,e[n]]})},_e=Zi;function gt(e,n){return e.reduce(function(t,i){return t[n(i)]=i,t},Object.create(null))}function Je(e,n){for(var t=Object.create(null),i=0,r=_e(e);i<r.length;i++){var a=r[i],u=a[0],o=a[1];t[u]=n(o,u)}return t}function j(e){if(Object.getPrototypeOf(e)===null)return e;for(var n=Object.create(null),t=0,i=_e(e);t<i.length;t++){var r=i[t],a=r[0],u=r[1];n[a]=u}return n}function _n(e,n,t){return e.reduce(function(i,r){return i[n(r)]=t(r),i},Object.create(null))}var er=5;function nr(e,n){var t=typeof e=="string"?[e,n]:[void 0,e],i=t[0],r=t[1],a=" Did you mean ";i&&(a+=i+" ");var u=r.map(function(l){return'"'.concat(l,'"')});switch(u.length){case 0:return"";case 1:return a+u[0]+"?";case 2:return a+u[0]+" or "+u[1]+"?"}var o=u.slice(0,er),s=o.pop();return a+o.join(", ")+", or "+s+"?"}function kt(e){return e}function tr(e,n){for(var t=0,i=0;t<e.length&&i<n.length;){var r=e.charCodeAt(t),a=n.charCodeAt(i);if(He(r)&&He(a)){var u=0;do++t,u=u*10+r-Fn,r=e.charCodeAt(t);while(He(r)&&u>0);var o=0;do++i,o=o*10+a-Fn,a=n.charCodeAt(i);while(He(a)&&o>0);if(u<o)return-1;if(u>o)return 1}else{if(r<a)return-1;if(r>a)return 1;++t,++i}}return e.length-n.length}var Fn=48,ir=57;function He(e){return!isNaN(e)&&Fn<=e&&e<=ir}function rr(e,n){for(var t=Object.create(null),i=new ar(e),r=Math.floor(e.length*.4)+1,a=0;a<n.length;a++){var u=n[a],o=i.measure(u,r);o!==void 0&&(t[u]=o)}return Object.keys(t).sort(function(s,l){var g=t[s]-t[l];return g!==0?g:tr(s,l)})}var ar=function(){function e(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=St(this._inputLowerCase),this._rows=[new Array(t.length+1).fill(0),new Array(t.length+1).fill(0),new Array(t.length+1).fill(0)]}var n=e.prototype;return n.measure=function(i,r){if(this._input===i)return 0;var a=i.toLowerCase();if(this._inputLowerCase===a)return 1;var u=St(a),o=this._inputArray;if(u.length<o.length){var s=u;u=o,o=s}var l=u.length,g=o.length;if(!(l-g>r)){for(var E=this._rows,y=0;y<=g;y++)E[0][y]=y;for(var d=1;d<=l;d++){for(var N=E[(d-1)%3],w=E[d%3],O=w[0]=d,D=1;D<=g;D++){var P=u[d-1]===o[D-1]?0:1,L=Math.min(N[D]+1,w[D-1]+1,N[D-1]+P);if(d>1&&D>1&&u[d-1]===o[D-2]&&u[d-2]===o[D-1]){var f=E[(d-2)%3][D-2];L=Math.min(L,f+1)}L<O&&(O=L),w[D]=L}if(O>r)return}var c=E[l%3][g];return c<=r?c:void 0}},e}();function St(e){for(var n=e.length,t=new Array(n),i=0;i<n;++i)t[i]=e.charCodeAt(i);return t}function ne(e){return ht(e,{leave:sr})}var or=80,sr={Name:function(n){return n.value},Variable:function(n){return"$"+n.name},Document:function(n){return k(n.definitions,`
|
|
23
23
|
|
|
24
24
|
`)+`
|
|
25
|
-
`},OperationDefinition:function(
|
|
26
|
-
`,
|
|
25
|
+
`},OperationDefinition:function(n){var t=n.operation,i=n.name,r=B("(",k(n.variableDefinitions,", "),")"),a=k(n.directives," "),u=n.selectionSet;return!i&&!a&&!r&&t==="query"?u:k([t,k([i,r]),a,u]," ")},VariableDefinition:function(n){var t=n.variable,i=n.type,r=n.defaultValue,a=n.directives;return t+": "+i+B(" = ",r)+B(" ",k(a," "))},SelectionSet:function(n){var t=n.selections;return Y(t)},Field:function(n){var t=n.alias,i=n.name,r=n.arguments,a=n.directives,u=n.selectionSet,o=B("",t,": ")+i,s=o+B("(",k(r,", "),")");return s.length>or&&(s=o+B(`(
|
|
26
|
+
`,ze(k(r,`
|
|
27
27
|
`)),`
|
|
28
|
-
)`)),
|
|
29
|
-
`,
|
|
28
|
+
)`)),k([s,k(a," "),u]," ")},Argument:function(n){var t=n.name,i=n.value;return t+": "+i},FragmentSpread:function(n){var t=n.name,i=n.directives;return"..."+t+B(" ",k(i," "))},InlineFragment:function(n){var t=n.typeCondition,i=n.directives,r=n.selectionSet;return k(["...",B("on ",t),k(i," "),r]," ")},FragmentDefinition:function(n){var t=n.name,i=n.typeCondition,r=n.variableDefinitions,a=n.directives,u=n.selectionSet;return"fragment ".concat(t).concat(B("(",k(r,", "),")")," ")+"on ".concat(i," ").concat(B("",k(a," ")," "))+u},IntValue:function(n){var t=n.value;return t},FloatValue:function(n){var t=n.value;return t},StringValue:function(n,t){var i=n.value,r=n.block;return r?zi(i,t==="description"?"":" "):JSON.stringify(i)},BooleanValue:function(n){var t=n.value;return t?"true":"false"},NullValue:function(){return"null"},EnumValue:function(n){var t=n.value;return t},ListValue:function(n){var t=n.values;return"["+k(t,", ")+"]"},ObjectValue:function(n){var t=n.fields;return"{"+k(t,", ")+"}"},ObjectField:function(n){var t=n.name,i=n.value;return t+": "+i},Directive:function(n){var t=n.name,i=n.arguments;return"@"+t+B("(",k(i,", "),")")},NamedType:function(n){var t=n.name;return t},ListType:function(n){var t=n.type;return"["+t+"]"},NonNullType:function(n){var t=n.type;return t+"!"},SchemaDefinition:z(function(e){var n=e.directives,t=e.operationTypes;return k(["schema",k(n," "),Y(t)]," ")}),OperationTypeDefinition:function(n){var t=n.operation,i=n.type;return t+": "+i},ScalarTypeDefinition:z(function(e){var n=e.name,t=e.directives;return k(["scalar",n,k(t," ")]," ")}),ObjectTypeDefinition:z(function(e){var n=e.name,t=e.interfaces,i=e.directives,r=e.fields;return k(["type",n,B("implements ",k(t," & ")),k(i," "),Y(r)]," ")}),FieldDefinition:z(function(e){var n=e.name,t=e.arguments,i=e.type,r=e.directives;return n+(Tt(t)?B(`(
|
|
29
|
+
`,ze(k(t,`
|
|
30
30
|
`)),`
|
|
31
|
-
)`):
|
|
32
|
-
`,
|
|
31
|
+
)`):B("(",k(t,", "),")"))+": "+i+B(" ",k(r," "))}),InputValueDefinition:z(function(e){var n=e.name,t=e.type,i=e.defaultValue,r=e.directives;return k([n+": "+t,B("= ",i),k(r," ")]," ")}),InterfaceTypeDefinition:z(function(e){var n=e.name,t=e.interfaces,i=e.directives,r=e.fields;return k(["interface",n,B("implements ",k(t," & ")),k(i," "),Y(r)]," ")}),UnionTypeDefinition:z(function(e){var n=e.name,t=e.directives,i=e.types;return k(["union",n,k(t," "),i&&i.length!==0?"= "+k(i," | "):""]," ")}),EnumTypeDefinition:z(function(e){var n=e.name,t=e.directives,i=e.values;return k(["enum",n,k(t," "),Y(i)]," ")}),EnumValueDefinition:z(function(e){var n=e.name,t=e.directives;return k([n,k(t," ")]," ")}),InputObjectTypeDefinition:z(function(e){var n=e.name,t=e.directives,i=e.fields;return k(["input",n,k(t," "),Y(i)]," ")}),DirectiveDefinition:z(function(e){var n=e.name,t=e.arguments,i=e.repeatable,r=e.locations;return"directive @"+n+(Tt(t)?B(`(
|
|
32
|
+
`,ze(k(t,`
|
|
33
33
|
`)),`
|
|
34
|
-
)`):
|
|
35
|
-
`)}}function
|
|
36
|
-
`,
|
|
34
|
+
)`):B("(",k(t,", "),")"))+(i?" repeatable":"")+" on "+k(r," | ")}),SchemaExtension:function(n){var t=n.directives,i=n.operationTypes;return k(["extend schema",k(t," "),Y(i)]," ")},ScalarTypeExtension:function(n){var t=n.name,i=n.directives;return k(["extend scalar",t,k(i," ")]," ")},ObjectTypeExtension:function(n){var t=n.name,i=n.interfaces,r=n.directives,a=n.fields;return k(["extend type",t,B("implements ",k(i," & ")),k(r," "),Y(a)]," ")},InterfaceTypeExtension:function(n){var t=n.name,i=n.interfaces,r=n.directives,a=n.fields;return k(["extend interface",t,B("implements ",k(i," & ")),k(r," "),Y(a)]," ")},UnionTypeExtension:function(n){var t=n.name,i=n.directives,r=n.types;return k(["extend union",t,k(i," "),r&&r.length!==0?"= "+k(r," | "):""]," ")},EnumTypeExtension:function(n){var t=n.name,i=n.directives,r=n.values;return k(["extend enum",t,k(i," "),Y(r)]," ")},InputObjectTypeExtension:function(n){var t=n.name,i=n.directives,r=n.fields;return k(["extend input",t,k(i," "),Y(r)]," ")}};function z(e){return function(n){return k([n.description,e(n)],`
|
|
35
|
+
`)}}function k(e){var n,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(n=e?.filter(function(i){return i}).join(t))!==null&&n!==void 0?n:""}function Y(e){return B(`{
|
|
36
|
+
`,ze(k(e,`
|
|
37
37
|
`)),`
|
|
38
|
-
}`)}function
|
|
39
|
-
`))}function
|
|
40
|
-
`)!==-1}function Ai(e){return e!=null&&e.some(oa)}function Mt(e,t){switch(e.kind){case v.NULL:return null;case v.INT:return parseInt(e.value,10);case v.FLOAT:return parseFloat(e.value);case v.STRING:case v.ENUM:case v.BOOLEAN:return e.value;case v.LIST:return e.values.map(function(n){return Mt(n,t)});case v.OBJECT:return Vt(e.fields,function(n){return n.name.value},function(n){return Mt(n.value,t)});case v.VARIABLE:return t?.[e.name.value]}Me(0,"Unexpected value node: "+_(e))}function Di(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function ke(e,t,n){return t&&Di(e.prototype,t),n&&Di(e,n),e}function wi(e){return Ge(e)||ie(e)||H(e)||le(e)||fe(e)||he(e)||je(e)||Se(e)}function sa(e){if(!wi(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL type."));return e}function Ge(e){return oe(e,ye)}function ie(e){return oe(e,de)}function H(e){return oe(e,Li)}function le(e){return oe(e,xi)}function fe(e){return oe(e,st)}function he(e){return oe(e,Ui)}function je(e){return oe(e,j)}function Se(e){return oe(e,I)}function Ne(e){return Ge(e)||fe(e)||he(e)||Gt(e)&&Ne(e.ofType)}function at(e){return Ge(e)||ie(e)||H(e)||le(e)||fe(e)||Gt(e)&&at(e.ofType)}function ua(e){return Ge(e)||fe(e)}function Ct(e){return ie(e)||H(e)||le(e)}function ca(e){return H(e)||le(e)}function j(e){if(this instanceof j)this.ofType=sa(e);else return new j(e)}j.prototype.toString=function(){return"["+String(this.ofType)+"]"},j.prototype.toJSON=function(){return this.toString()},Object.defineProperty(j.prototype,Y,{get:function(){return"GraphQLList"}}),W(j);function I(e){if(this instanceof I)this.ofType=fa(e);else return new I(e)}I.prototype.toString=function(){return String(this.ofType)+"!"},I.prototype.toJSON=function(){return this.toString()},Object.defineProperty(I.prototype,Y,{get:function(){return"GraphQLNonNull"}}),W(I);function Gt(e){return je(e)||Se(e)}function la(e){return wi(e)&&!Se(e)}function fa(e){if(!la(e))throw new Error("Expected ".concat(_(e)," to be a GraphQL nullable type."));return e}function da(e){if(e)return Se(e)?e.ofType:e}function qe(e){if(e){for(var t=e;Gt(t);)t=t.ofType;return t}}function ot(e){return typeof e=="function"?e():e}function Te(e){return e&&e.length>0?e:void 0}var ye=function(){function e(n){var i,a,o,u=(i=n.parseValue)!==null&&i!==void 0?i:Ei;this.name=n.name,this.description=n.description,this.specifiedByUrl=n.specifiedByUrl,this.serialize=(a=n.serialize)!==null&&a!==void 0?a:Ei,this.parseValue=u,this.parseLiteral=(o=n.parseLiteral)!==null&&o!==void 0?o:function(s,c){return u(Mt(s,c))},this.extensions=n.extensions&&z(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=Te(n.extensionASTNodes),typeof n.name=="string"||O(0,"Must provide name."),n.specifiedByUrl==null||typeof n.specifiedByUrl=="string"||O(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat(_(n.specifiedByUrl),".")),n.serialize==null||typeof n.serialize=="function"||O(0,"".concat(this.name,' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.')),n.parseLiteral&&(typeof n.parseValue=="function"&&typeof n.parseLiteral=="function"||O(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var t=e.prototype;return t.toConfig=function(){var i;return{name:this.name,description:this.description,specifiedByUrl:this.specifiedByUrl,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},ke(e,[{key:Y,get:function(){return"GraphQLScalarType"}}]),e}();W(ye);var de=function(){function e(n){this.name=n.name,this.description=n.description,this.isTypeOf=n.isTypeOf,this.extensions=n.extensions&&z(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=Te(n.extensionASTNodes),this._fields=Fi.bind(void 0,n),this._interfaces=Oi.bind(void 0,n),typeof n.name=="string"||O(0,"Must provide name."),n.isTypeOf==null||typeof n.isTypeOf=="function"||O(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat(_(n.isTypeOf),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:_i(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},ke(e,[{key:Y,get:function(){return"GraphQLObjectType"}}]),e}();W(de);function Oi(e){var t,n=(t=ot(e.interfaces))!==null&&t!==void 0?t:[];return Array.isArray(n)||O(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),n}function Fi(e){var t=ot(e.fields);return be(t)||O(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),tt(t,function(n,i){var a;be(n)||O(0,"".concat(e.name,".").concat(i," field config must be an object.")),!("isDeprecated"in n)||O(0,"".concat(e.name,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),n.resolve==null||typeof n.resolve=="function"||O(0,"".concat(e.name,".").concat(i," field resolver must be a function if ")+"provided, but got: ".concat(_(n.resolve),"."));var o=(a=n.args)!==null&&a!==void 0?a:{};be(o)||O(0,"".concat(e.name,".").concat(i," args must be an object with argument names as keys."));var u=Ce(o).map(function(s){var c=s[0],l=s[1];return{name:c,description:l.description,type:l.type,defaultValue:l.defaultValue,deprecationReason:l.deprecationReason,extensions:l.extensions&&z(l.extensions),astNode:l.astNode}});return{name:i,description:n.description,type:n.type,args:u,resolve:n.resolve,subscribe:n.subscribe,isDeprecated:n.deprecationReason!=null,deprecationReason:n.deprecationReason,extensions:n.extensions&&z(n.extensions),astNode:n.astNode}})}function be(e){return ve(e)&&!Array.isArray(e)}function _i(e){return tt(e,function(t){return{description:t.description,type:t.type,args:Ri(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function Ri(e){return Vt(e,function(t){return t.name},function(t){return{description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}var Li=function(){function e(n){this.name=n.name,this.description=n.description,this.resolveType=n.resolveType,this.extensions=n.extensions&&z(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=Te(n.extensionASTNodes),this._fields=Fi.bind(void 0,n),this._interfaces=Oi.bind(void 0,n),typeof n.name=="string"||O(0,"Must provide name."),n.resolveType==null||typeof n.resolveType=="function"||O(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(_(n.resolveType),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){var i;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:_i(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},ke(e,[{key:Y,get:function(){return"GraphQLInterfaceType"}}]),e}();W(Li);var xi=function(){function e(n){this.name=n.name,this.description=n.description,this.resolveType=n.resolveType,this.extensions=n.extensions&&z(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=Te(n.extensionASTNodes),this._types=pa.bind(void 0,n),typeof n.name=="string"||O(0,"Must provide name."),n.resolveType==null||typeof n.resolveType=="function"||O(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(_(n.resolveType),"."))}var t=e.prototype;return t.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},t.toConfig=function(){var i;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},ke(e,[{key:Y,get:function(){return"GraphQLUnionType"}}]),e}();W(xi);function pa(e){var t=ot(e.types);return Array.isArray(t)||O(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),t}var st=function(){function e(n){this.name=n.name,this.description=n.description,this.extensions=n.extensions&&z(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=Te(n.extensionASTNodes),this._values=va(this.name,n.values),this._valueLookup=new Map(this._values.map(function(i){return[i.value,i]})),this._nameLookup=bi(this._values,function(i){return i.name}),typeof n.name=="string"||O(0,"Must provide name.")}var t=e.prototype;return t.getValues=function(){return this._values},t.getValue=function(i){return this._nameLookup[i]},t.serialize=function(i){var a=this._valueLookup.get(i);if(a===void 0)throw new x('Enum "'.concat(this.name,'" cannot represent value: ').concat(_(i)));return a.name},t.parseValue=function(i){if(typeof i!="string"){var a=_(i);throw new x('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(a,".")+ut(this,a))}var o=this.getValue(i);if(o==null)throw new x('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+ut(this,i));return o.value},t.parseLiteral=function(i,a){if(i.kind!==v.ENUM){var o=se(i);throw new x('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(o,".")+ut(this,o),i)}var u=this.getValue(i.value);if(u==null){var s=se(i);throw new x('Value "'.concat(s,'" does not exist in "').concat(this.name,'" enum.')+ut(this,s),i)}return u.value},t.toConfig=function(){var i,a=Vt(this.getValues(),function(o){return o.name},function(o){return{description:o.description,value:o.value,deprecationReason:o.deprecationReason,extensions:o.extensions,astNode:o.astNode}});return{name:this.name,description:this.description,values:a,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},ke(e,[{key:Y,get:function(){return"GraphQLEnumType"}}]),e}();W(st);function ut(e,t){var n=e.getValues().map(function(a){return a.name}),i=ta(t,n);return Zr("the enum value",i)}function va(e,t){return be(t)||O(0,"".concat(e," values must be an object with value names as keys.")),Ce(t).map(function(n){var i=n[0],a=n[1];return be(a)||O(0,"".concat(e,".").concat(i,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat(_(a),".")),!("isDeprecated"in a)||O(0,"".concat(e,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),{name:i,description:a.description,value:a.value!==void 0?a.value:i,isDeprecated:a.deprecationReason!=null,deprecationReason:a.deprecationReason,extensions:a.extensions&&z(a.extensions),astNode:a.astNode}})}var Ui=function(){function e(n){this.name=n.name,this.description=n.description,this.extensions=n.extensions&&z(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=Te(n.extensionASTNodes),this._fields=ma.bind(void 0,n),typeof n.name=="string"||O(0,"Must provide name.")}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.toConfig=function(){var i,a=tt(this.getFields(),function(o){return{description:o.description,type:o.type,defaultValue:o.defaultValue,deprecationReason:o.deprecationReason,extensions:o.extensions,astNode:o.astNode}});return{name:this.name,description:this.description,fields:a,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},ke(e,[{key:Y,get:function(){return"GraphQLInputObjectType"}}]),e}();W(Ui);function ma(e){var t=ot(e.fields);return be(t)||O(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),tt(t,function(n,i){return!("resolve"in n)||O(0,"".concat(e.name,".").concat(i," field has a resolve property, but Input Types cannot define resolvers.")),{name:i,description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions&&z(n.extensions),astNode:n.astNode}})}var ha=Array.from||function(e,t,n){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var i=e[fi];if(typeof i=="function"){for(var a=i.call(e),o=[],u,s=0;!(u=a.next()).done;++s)if(o.push(t.call(n,u.value,s)),s>9999999)throw new TypeError("Near-infinite iteration.");return o}var c=e.length;if(typeof c=="number"&&c>=0&&c%1===0){for(var l=[],y=0;y<c;++y)Object.prototype.hasOwnProperty.call(e,y)&&l.push(t.call(n,e[y],y));return l}return[]},ya=ha,ga=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},Qe=ga;function ct(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ct=function(n){return typeof n}:ct=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ct(e)}function ka(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(y){return y};if(e==null||ct(e)!=="object")return null;if(Array.isArray(e))return e.map(t);var n=e[fi];if(typeof n=="function"){for(var i=n.call(e),a=[],o,u=0;!(o=i.next()).done;++u)a.push(t(o.value,u));return a}var s=e.length;if(typeof s=="number"&&s>=0&&s%1===0){for(var c=[],l=0;l<s;++l){if(!Object.prototype.hasOwnProperty.call(e,l))return null;c.push(t(e[String(l)],l))}return c}return null}var Sa=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},lt=Sa,jt=2147483647,qt=-2147483648;function Na(e){var t=$e(e);if(typeof t=="boolean")return t?1:0;var n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),!lt(n))throw new x("Int cannot represent non-integer value: ".concat(_(t)));if(n>jt||n<qt)throw new x("Int cannot represent non 32-bit signed integer value: "+_(t));return n}function Ta(e){if(!lt(e))throw new x("Int cannot represent non-integer value: ".concat(_(e)));if(e>jt||e<qt)throw new x("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var ba=new ye({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize:Na,parseValue:Ta,parseLiteral:function(t){if(t.kind!==v.INT)throw new x("Int cannot represent non-integer value: ".concat(se(t)),t);var n=parseInt(t.value,10);if(n>jt||n<qt)throw new x("Int cannot represent non 32-bit signed integer value: ".concat(t.value),t);return n}});function Ea(e){var t=$e(e);if(typeof t=="boolean")return t?1:0;var n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),!Qe(n))throw new x("Float cannot represent non numeric value: ".concat(_(t)));return n}function Ia(e){if(!Qe(e))throw new x("Float cannot represent non numeric value: ".concat(_(e)));return e}var Aa=new ye({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize:Ea,parseValue:Ia,parseLiteral:function(t){if(t.kind!==v.FLOAT&&t.kind!==v.INT)throw new x("Float cannot represent non numeric value: ".concat(se(t)),t);return parseFloat(t.value)}});function $e(e){if(ve(e)){if(typeof e.valueOf=="function"){var t=e.valueOf();if(!ve(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function Da(e){var t=$e(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(Qe(t))return t.toString();throw new x("String cannot represent value: ".concat(_(e)))}function wa(e){if(typeof e!="string")throw new x("String cannot represent a non string value: ".concat(_(e)));return e}var B=new ye({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize:Da,parseValue:wa,parseLiteral:function(t){if(t.kind!==v.STRING)throw new x("String cannot represent a non string value: ".concat(se(t)),t);return t.value}});function Oa(e){var t=$e(e);if(typeof t=="boolean")return t;if(Qe(t))return t!==0;throw new x("Boolean cannot represent a non boolean value: ".concat(_(t)))}function Fa(e){if(typeof e!="boolean")throw new x("Boolean cannot represent a non boolean value: ".concat(_(e)));return e}var K=new ye({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:Oa,parseValue:Fa,parseLiteral:function(t){if(t.kind!==v.BOOLEAN)throw new x("Boolean cannot represent a non boolean value: ".concat(se(t)),t);return t.value}});function _a(e){var t=$e(e);if(typeof t=="string")return t;if(lt(t))return String(t);throw new x("ID cannot represent value: ".concat(_(e)))}function Ra(e){if(typeof e=="string")return e;if(lt(e))return e.toString();throw new x("ID cannot represent value: ".concat(_(e)))}var Pi=new ye({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize:_a,parseValue:Ra,parseLiteral:function(t){if(t.kind!==v.STRING&&t.kind!==v.INT)throw new x("ID cannot represent a non-string and non-integer value: "+se(t),t);return t.value}}),Vi=Object.freeze([B,ba,Aa,K,Pi]);function Je(e,t){if(Se(t)){var n=Je(e,t.ofType);return n?.kind===v.NULL?null:n}if(e===null)return{kind:v.NULL};if(e===void 0)return null;if(je(t)){var i=t.ofType,a=ka(e);if(a!=null){for(var o=[],u=0;u<a.length;u++){var s=a[u],c=Je(s,i);c!=null&&o.push(c)}return{kind:v.LIST,values:o}}return Je(e,i)}if(he(t)){if(!ve(e))return null;for(var l=[],y=0,g=me(t.getFields());y<g.length;y++){var D=g[y],k=Je(e[D.name],D.type);k&&l.push({kind:v.OBJECT_FIELD,name:{kind:v.NAME,value:D.name},value:k})}return{kind:v.OBJECT,fields:l}}if(ua(t)){var S=t.serialize(e);if(S==null)return null;if(typeof S=="boolean")return{kind:v.BOOLEAN,value:S};if(typeof S=="number"&&Qe(S)){var w=String(S);return Bi.test(w)?{kind:v.INT,value:w}:{kind:v.FLOAT,value:w}}if(typeof S=="string")return fe(t)?{kind:v.ENUM,value:S}:t===Pi&&Bi.test(S)?{kind:v.INT,value:S}:{kind:v.STRING,value:S};throw new TypeError("Cannot convert value to AST: ".concat(_(S),"."))}Me(0,"Unexpected input type: "+_(t))}var Bi=/^-?(?:0|[1-9][0-9]*)$/,Qt=new de({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{description:{type:B,resolve:function(n){return n.description}},types:{description:"A list of all types supported by this server.",type:new I(new j(new I(ne))),resolve:function(n){return me(n.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new I(ne),resolve:function(n){return n.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:ne,resolve:function(n){return n.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:ne,resolve:function(n){return n.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new I(new j(new I(Mi))),resolve:function(n){return n.getDirectives()}}}}}),Mi=new de({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
38
|
+
}`)}function B(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return n!=null&&n!==""?e+n+t:""}function ze(e){return B(" ",e.replace(/\n/g,`
|
|
39
|
+
`))}function ur(e){return e.indexOf(`
|
|
40
|
+
`)!==-1}function Tt(e){return e!=null&&e.some(ur)}function Ln(e,n){switch(e.kind){case h.NULL:return null;case h.INT:return parseInt(e.value,10);case h.FLOAT:return parseFloat(e.value);case h.STRING:case h.ENUM:case h.BOOLEAN:return e.value;case h.LIST:return e.values.map(function(t){return Ln(t,n)});case h.OBJECT:return _n(e.fields,function(t){return t.name.value},function(t){return Ln(t.value,n)});case h.VARIABLE:return n?.[e.name.value]}Oe(0,"Unexpected value node: "+F(e))}function Nt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function fe(e,n,t){return n&&Nt(e.prototype,n),t&&Nt(e,t),e}function bt(e){return Fe(e)||W(e)||$(e)||te(e)||ie(e)||ue(e)||Le(e)||de(e)}function cr(e){if(!bt(e))throw new Error("Expected ".concat(F(e)," to be a GraphQL type."));return e}function Fe(e){return ee(e,ce)}function W(e){return ee(e,re)}function $(e){return ee(e,Dt)}function te(e){return ee(e,Ot)}function ie(e){return ee(e,Ke)}function ue(e){return ee(e,_t)}function Le(e){return ee(e,q)}function de(e){return ee(e,I)}function ve(e){return Fe(e)||ie(e)||ue(e)||Pn(e)&&ve(e.ofType)}function Ye(e){return Fe(e)||W(e)||$(e)||te(e)||ie(e)||Pn(e)&&Ye(e.ofType)}function lr(e){return Fe(e)||ie(e)}function Rn(e){return W(e)||$(e)||te(e)}function fr(e){return $(e)||te(e)}function q(e){if(this instanceof q)this.ofType=cr(e);else return new q(e)}q.prototype.toString=function(){return"["+String(this.ofType)+"]"},q.prototype.toJSON=function(){return this.toString()},Object.defineProperty(q.prototype,G,{get:function(){return"GraphQLList"}}),H(q);function I(e){if(this instanceof I)this.ofType=vr(e);else return new I(e)}I.prototype.toString=function(){return String(this.ofType)+"!"},I.prototype.toJSON=function(){return this.toString()},Object.defineProperty(I.prototype,G,{get:function(){return"GraphQLNonNull"}}),H(I);function Pn(e){return Le(e)||de(e)}function dr(e){return bt(e)&&!de(e)}function vr(e){if(!dr(e))throw new Error("Expected ".concat(F(e)," to be a GraphQL nullable type."));return e}function pr(e){if(e)return de(e)?e.ofType:e}function Re(e){if(e){for(var n=e;Pn(n);)n=n.ofType;return n}}function Xe(e){return typeof e=="function"?e():e}function pe(e){return e&&e.length>0?e:void 0}var ce=function(){function e(t){var i,r,a,u=(i=t.parseValue)!==null&&i!==void 0?i:kt;this.name=t.name,this.description=t.description,this.specifiedByUrl=t.specifiedByUrl,this.serialize=(r=t.serialize)!==null&&r!==void 0?r:kt,this.parseValue=u,this.parseLiteral=(a=t.parseLiteral)!==null&&a!==void 0?a:function(o,s){return u(Ln(o,s))},this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),typeof t.name=="string"||_(0,"Must provide name."),t.specifiedByUrl==null||typeof t.specifiedByUrl=="string"||_(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat(F(t.specifiedByUrl),".")),t.serialize==null||typeof t.serialize=="function"||_(0,"".concat(this.name,' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.')),t.parseLiteral&&(typeof t.parseValue=="function"&&typeof t.parseLiteral=="function"||_(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var n=e.prototype;return n.toConfig=function(){var i;return{name:this.name,description:this.description,specifiedByUrl:this.specifiedByUrl,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLScalarType"}}]),e}();H(ce);var re=function(){function e(t){this.name=t.name,this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._fields=It.bind(void 0,t),this._interfaces=Et.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name."),t.isTypeOf==null||typeof t.isTypeOf=="function"||_(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat(F(t.isTypeOf),"."))}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},n.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:wt(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLObjectType"}}]),e}();H(re);function Et(e){var n,t=(n=Xe(e.interfaces))!==null&&n!==void 0?n:[];return Array.isArray(t)||_(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),t}function It(e){var n=Xe(e.fields);return me(n)||_(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Je(n,function(t,i){var r;me(t)||_(0,"".concat(e.name,".").concat(i," field config must be an object.")),!("isDeprecated"in t)||_(0,"".concat(e.name,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),t.resolve==null||typeof t.resolve=="function"||_(0,"".concat(e.name,".").concat(i," field resolver must be a function if ")+"provided, but got: ".concat(F(t.resolve),"."));var a=(r=t.args)!==null&&r!==void 0?r:{};me(a)||_(0,"".concat(e.name,".").concat(i," args must be an object with argument names as keys."));var u=_e(a).map(function(o){var s=o[0],l=o[1];return{name:s,description:l.description,type:l.type,defaultValue:l.defaultValue,deprecationReason:l.deprecationReason,extensions:l.extensions&&j(l.extensions),astNode:l.astNode}});return{name:i,description:t.description,type:t.type,args:u,resolve:t.resolve,subscribe:t.subscribe,isDeprecated:t.deprecationReason!=null,deprecationReason:t.deprecationReason,extensions:t.extensions&&j(t.extensions),astNode:t.astNode}})}function me(e){return oe(e)&&!Array.isArray(e)}function wt(e){return Je(e,function(n){return{description:n.description,type:n.type,args:At(n.args),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}function At(e){return _n(e,function(n){return n.name},function(n){return{description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}})}var Dt=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._fields=It.bind(void 0,t),this._interfaces=Et.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||_(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(F(t.resolveType),"."))}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},n.toConfig=function(){var i;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:wt(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLInterfaceType"}}]),e}();H(Dt);var Ot=function(){function e(t){this.name=t.name,this.description=t.description,this.resolveType=t.resolveType,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._types=mr.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name."),t.resolveType==null||typeof t.resolveType=="function"||_(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat(F(t.resolveType),"."))}var n=e.prototype;return n.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},n.toConfig=function(){var i;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLUnionType"}}]),e}();H(Ot);function mr(e){var n=Xe(e.types);return Array.isArray(n)||_(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),n}var Ke=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._values=hr(this.name,t.values),this._valueLookup=new Map(this._values.map(function(i){return[i.value,i]})),this._nameLookup=gt(this._values,function(i){return i.name}),typeof t.name=="string"||_(0,"Must provide name.")}var n=e.prototype;return n.getValues=function(){return this._values},n.getValue=function(i){return this._nameLookup[i]},n.serialize=function(i){var r=this._valueLookup.get(i);if(r===void 0)throw new U('Enum "'.concat(this.name,'" cannot represent value: ').concat(F(i)));return r.name},n.parseValue=function(i){if(typeof i!="string"){var r=F(i);throw new U('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(r,".")+We(this,r))}var a=this.getValue(i);if(a==null)throw new U('Value "'.concat(i,'" does not exist in "').concat(this.name,'" enum.')+We(this,i));return a.value},n.parseLiteral=function(i,r){if(i.kind!==h.ENUM){var a=ne(i);throw new U('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(a,".")+We(this,a),i)}var u=this.getValue(i.value);if(u==null){var o=ne(i);throw new U('Value "'.concat(o,'" does not exist in "').concat(this.name,'" enum.')+We(this,o),i)}return u.value},n.toConfig=function(){var i,r=_n(this.getValues(),function(a){return a.name},function(a){return{description:a.description,value:a.value,deprecationReason:a.deprecationReason,extensions:a.extensions,astNode:a.astNode}});return{name:this.name,description:this.description,values:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLEnumType"}}]),e}();H(Ke);function We(e,n){var t=e.getValues().map(function(r){return r.name}),i=rr(n,t);return nr("the enum value",i)}function hr(e,n){return me(n)||_(0,"".concat(e," values must be an object with value names as keys.")),_e(n).map(function(t){var i=t[0],r=t[1];return me(r)||_(0,"".concat(e,".").concat(i,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat(F(r),".")),!("isDeprecated"in r)||_(0,"".concat(e,".").concat(i,' should provide "deprecationReason" instead of "isDeprecated".')),{name:i,description:r.description,value:r.value!==void 0?r.value:i,isDeprecated:r.deprecationReason!=null,deprecationReason:r.deprecationReason,extensions:r.extensions&&j(r.extensions),astNode:r.astNode}})}var _t=function(){function e(t){this.name=t.name,this.description=t.description,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=pe(t.extensionASTNodes),this._fields=yr.bind(void 0,t),typeof t.name=="string"||_(0,"Must provide name.")}var n=e.prototype;return n.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},n.toConfig=function(){var i,r=Je(this.getFields(),function(a){return{description:a.description,type:a.type,defaultValue:a.defaultValue,deprecationReason:a.deprecationReason,extensions:a.extensions,astNode:a.astNode}});return{name:this.name,description:this.description,fields:r,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[]}},n.toString=function(){return this.name},n.toJSON=function(){return this.toString()},fe(e,[{key:G,get:function(){return"GraphQLInputObjectType"}}]),e}();H(_t);function yr(e){var n=Xe(e.fields);return me(n)||_(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),Je(n,function(t,i){return!("resolve"in t)||_(0,"".concat(e.name,".").concat(i," field has a resolve property, but Input Types cannot define resolvers.")),{name:i,description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions&&j(t.extensions),astNode:t.astNode}})}var gr=Array.from||function(e,n,t){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var i=e[ot];if(typeof i=="function"){for(var r=i.call(e),a=[],u,o=0;!(u=r.next()).done;++o)if(a.push(n.call(t,u.value,o)),o>9999999)throw new TypeError("Near-infinite iteration.");return a}var s=e.length;if(typeof s=="number"&&s>=0&&s%1===0){for(var l=[],g=0;g<s;++g)Object.prototype.hasOwnProperty.call(e,g)&&l.push(n.call(t,e[g],g));return l}return[]},kr=gr,Sr=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},Pe=Sr;function Ze(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Ze=function(t){return typeof t}:Ze=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(e)}function Tr(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(g){return g};if(e==null||Ze(e)!=="object")return null;if(Array.isArray(e))return e.map(n);var t=e[ot];if(typeof t=="function"){for(var i=t.call(e),r=[],a,u=0;!(a=i.next()).done;++u)r.push(n(a.value,u));return r}var o=e.length;if(typeof o=="number"&&o>=0&&o%1===0){for(var s=[],l=0;l<o;++l){if(!Object.prototype.hasOwnProperty.call(e,l))return null;s.push(n(e[String(l)],l))}return s}return null}var Nr=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},en=Nr,Un=2147483647,Bn=-2147483648;function br(e){var n=Ue(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!en(t))throw new U("Int cannot represent non-integer value: ".concat(F(n)));if(t>Un||t<Bn)throw new U("Int cannot represent non 32-bit signed integer value: "+F(n));return t}function Er(e){if(!en(e))throw new U("Int cannot represent non-integer value: ".concat(F(e)));if(e>Un||e<Bn)throw new U("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var Ir=new ce({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize:br,parseValue:Er,parseLiteral:function(n){if(n.kind!==h.INT)throw new U("Int cannot represent non-integer value: ".concat(ne(n)),n);var t=parseInt(n.value,10);if(t>Un||t<Bn)throw new U("Int cannot represent non 32-bit signed integer value: ".concat(n.value),n);return t}});function wr(e){var n=Ue(e);if(typeof n=="boolean")return n?1:0;var t=n;if(typeof n=="string"&&n!==""&&(t=Number(n)),!Pe(t))throw new U("Float cannot represent non numeric value: ".concat(F(n)));return t}function Ar(e){if(!Pe(e))throw new U("Float cannot represent non numeric value: ".concat(F(e)));return e}var Dr=new ce({name:"Float",description:"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).",serialize:wr,parseValue:Ar,parseLiteral:function(n){if(n.kind!==h.FLOAT&&n.kind!==h.INT)throw new U("Float cannot represent non numeric value: ".concat(ne(n)),n);return parseFloat(n.value)}});function Ue(e){if(oe(e)){if(typeof e.valueOf=="function"){var n=e.valueOf();if(!oe(n))return n}if(typeof e.toJSON=="function")return e.toJSON()}return e}function Or(e){var n=Ue(e);if(typeof n=="string")return n;if(typeof n=="boolean")return n?"true":"false";if(Pe(n))return n.toString();throw new U("String cannot represent value: ".concat(F(e)))}function _r(e){if(typeof e!="string")throw new U("String cannot represent a non string value: ".concat(F(e)));return e}var V=new ce({name:"String",description:"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.",serialize:Or,parseValue:_r,parseLiteral:function(n){if(n.kind!==h.STRING)throw new U("String cannot represent a non string value: ".concat(ne(n)),n);return n.value}});function Fr(e){var n=Ue(e);if(typeof n=="boolean")return n;if(Pe(n))return n!==0;throw new U("Boolean cannot represent a non boolean value: ".concat(F(n)))}function Lr(e){if(typeof e!="boolean")throw new U("Boolean cannot represent a non boolean value: ".concat(F(e)));return e}var Q=new ce({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:Fr,parseValue:Lr,parseLiteral:function(n){if(n.kind!==h.BOOLEAN)throw new U("Boolean cannot represent a non boolean value: ".concat(ne(n)),n);return n.value}});function Rr(e){var n=Ue(e);if(typeof n=="string")return n;if(en(n))return String(n);throw new U("ID cannot represent value: ".concat(F(e)))}function Pr(e){if(typeof e=="string")return e;if(en(e))return e.toString();throw new U("ID cannot represent value: ".concat(F(e)))}var Ft=new ce({name:"ID",description:'The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID.',serialize:Rr,parseValue:Pr,parseLiteral:function(n){if(n.kind!==h.STRING&&n.kind!==h.INT)throw new U("ID cannot represent a non-string and non-integer value: "+ne(n),n);return n.value}}),Lt=Object.freeze([V,Ir,Dr,Q,Ft]);function Be(e,n){if(de(n)){var t=Be(e,n.ofType);return t?.kind===h.NULL?null:t}if(e===null)return{kind:h.NULL};if(e===void 0)return null;if(Le(n)){var i=n.ofType,r=Tr(e);if(r!=null){for(var a=[],u=0;u<r.length;u++){var o=r[u],s=Be(o,i);s!=null&&a.push(s)}return{kind:h.LIST,values:a}}return Be(e,i)}if(ue(n)){if(!oe(e))return null;for(var l=[],g=0,E=se(n.getFields());g<E.length;g++){var y=E[g],d=Be(e[y.name],y.type);d&&l.push({kind:h.OBJECT_FIELD,name:{kind:h.NAME,value:y.name},value:d})}return{kind:h.OBJECT,fields:l}}if(lr(n)){var N=n.serialize(e);if(N==null)return null;if(typeof N=="boolean")return{kind:h.BOOLEAN,value:N};if(typeof N=="number"&&Pe(N)){var w=String(N);return Rt.test(w)?{kind:h.INT,value:w}:{kind:h.FLOAT,value:w}}if(typeof N=="string")return ie(n)?{kind:h.ENUM,value:N}:n===Ft&&Rt.test(N)?{kind:h.INT,value:N}:{kind:h.STRING,value:N};throw new TypeError("Cannot convert value to AST: ".concat(F(N),"."))}Oe(0,"Unexpected input type: "+F(n))}var Rt=/^-?(?:0|[1-9][0-9]*)$/,Vn=new re({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{description:{type:V,resolve:function(t){return t.description}},types:{description:"A list of all types supported by this server.",type:new I(new q(new I(X))),resolve:function(t){return se(t.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new I(X),resolve:function(t){return t.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:X,resolve:function(t){return t.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:X,resolve:function(t){return t.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new I(new q(new I(Pt))),resolve:function(t){return t.getDirectives()}}}}}),Pt=new re({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
41
41
|
|
|
42
|
-
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:function(){return{name:{type:new I(B),resolve:function(n){return n.name}},description:{type:B,resolve:function(n){return n.description}},isRepeatable:{type:new I(K),resolve:function(n){return n.isRepeatable}},locations:{type:new I(new j(new I(Ci))),resolve:function(n){return n.locations}},args:{type:new I(new j(new I(ft))),args:{includeDeprecated:{type:K,defaultValue:!1}},resolve:function(n,i){var a=i.includeDeprecated;return a?n.args:n.args.filter(function(o){return o.deprecationReason==null})}}}}}),Ci=new st({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:R.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:R.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:R.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:R.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:R.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:R.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:R.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:R.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:R.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:R.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:R.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:R.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:R.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:R.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:R.UNION,description:"Location adjacent to a union definition."},ENUM:{value:R.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:R.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:R.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:R.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),ne=new de({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:new I(qi),resolve:function(n){if(Ge(n))return $.SCALAR;if(ie(n))return $.OBJECT;if(H(n))return $.INTERFACE;if(le(n))return $.UNION;if(fe(n))return $.ENUM;if(he(n))return $.INPUT_OBJECT;if(je(n))return $.LIST;if(Se(n))return $.NON_NULL;Me(0,'Unexpected type: "'.concat(_(n),'".'))}},name:{type:B,resolve:function(n){return n.name!==void 0?n.name:void 0}},description:{type:B,resolve:function(n){return n.description!==void 0?n.description:void 0}},specifiedByUrl:{type:B,resolve:function(n){return n.specifiedByUrl!==void 0?n.specifiedByUrl:void 0}},fields:{type:new j(new I(Gi)),args:{includeDeprecated:{type:K,defaultValue:!1}},resolve:function(n,i){var a=i.includeDeprecated;if(ie(n)||H(n)){var o=me(n.getFields());return a?o:o.filter(function(u){return u.deprecationReason==null})}}},interfaces:{type:new j(new I(ne)),resolve:function(n){if(ie(n)||H(n))return n.getInterfaces()}},possibleTypes:{type:new j(new I(ne)),resolve:function(n,i,a,o){var u=o.schema;if(ca(n))return u.getPossibleTypes(n)}},enumValues:{type:new j(new I(ji)),args:{includeDeprecated:{type:K,defaultValue:!1}},resolve:function(n,i){var a=i.includeDeprecated;if(fe(n)){var o=n.getValues();return a?o:o.filter(function(u){return u.deprecationReason==null})}}},inputFields:{type:new j(new I(ft)),args:{includeDeprecated:{type:K,defaultValue:!1}},resolve:function(n,i){var a=i.includeDeprecated;if(he(n)){var o=me(n.getFields());return a?o:o.filter(function(u){return u.deprecationReason==null})}}},ofType:{type:ne,resolve:function(n){return n.ofType!==void 0?n.ofType:void 0}}}}}),Gi=new de({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:new I(B),resolve:function(n){return n.name}},description:{type:B,resolve:function(n){return n.description}},args:{type:new I(new j(new I(ft))),args:{includeDeprecated:{type:K,defaultValue:!1}},resolve:function(n,i){var a=i.includeDeprecated;return a?n.args:n.args.filter(function(o){return o.deprecationReason==null})}},type:{type:new I(ne),resolve:function(n){return n.type}},isDeprecated:{type:new I(K),resolve:function(n){return n.deprecationReason!=null}},deprecationReason:{type:B,resolve:function(n){return n.deprecationReason}}}}}),ft=new de({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:new I(B),resolve:function(n){return n.name}},description:{type:B,resolve:function(n){return n.description}},type:{type:new I(ne),resolve:function(n){return n.type}},defaultValue:{type:B,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(n){var i=n.type,a=n.defaultValue,o=Je(a,i);return o?se(o):null}},isDeprecated:{type:new I(K),resolve:function(n){return n.deprecationReason!=null}},deprecationReason:{type:B,resolve:function(n){return n.deprecationReason}}}}}),ji=new de({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new I(B),resolve:function(n){return n.name}},description:{type:B,resolve:function(n){return n.description}},isDeprecated:{type:new I(K),resolve:function(n){return n.deprecationReason!=null}},deprecationReason:{type:B,resolve:function(n){return n.deprecationReason}}}}}),$=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),qi=new st({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:$.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:$.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:$.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:$.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:$.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:$.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:$.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:$.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),Qi={name:"__schema",type:new I(Qt),description:"Access the current type schema of this server.",args:[],resolve:function(t,n,i,a){var o=a.schema;return o},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},$i={name:"__type",type:ne,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new I(B),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(t,n,i,a){var o=n.name,u=a.schema;return u.getType(o)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},Ji={name:"__typename",type:new I(B),description:"The name of the current Object type at runtime.",args:[],resolve:function(t,n,i,a){var o=a.parentType;return o.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},zi=Object.freeze([Qt,Mi,Ci,ne,Gi,ft,ji,qi]);function Yi(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function La(e,t,n){return t&&Yi(e.prototype,t),n&&Yi(e,n),e}function xa(e){return oe(e,Ee)}var Ee=function(){function e(n){var i,a;this.name=n.name,this.description=n.description,this.locations=n.locations,this.isRepeatable=(i=n.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=n.extensions&&z(n.extensions),this.astNode=n.astNode,n.name||O(0,"Directive must be named."),Array.isArray(n.locations)||O(0,"@".concat(n.name," locations must be an Array."));var o=(a=n.args)!==null&&a!==void 0?a:{};ve(o)&&!Array.isArray(o)||O(0,"@".concat(n.name," args must be an object with argument names as keys.")),this.args=Ce(o).map(function(u){var s=u[0],c=u[1];return{name:s,description:c.description,type:c.type,defaultValue:c.defaultValue,deprecationReason:c.deprecationReason,extensions:c.extensions&&z(c.extensions),astNode:c.astNode}})}var t=e.prototype;return t.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:Ri(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},t.toString=function(){return"@"+this.name},t.toJSON=function(){return this.toString()},La(e,[{key:Y,get:function(){return"GraphQLDirective"}}]),e}();W(Ee);var Ua=new Ee({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[R.FIELD,R.FRAGMENT_SPREAD,R.INLINE_FRAGMENT],args:{if:{type:new I(K),description:"Included when true."}}}),Pa=new Ee({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[R.FIELD,R.FRAGMENT_SPREAD,R.INLINE_FRAGMENT],args:{if:{type:new I(K),description:"Skipped when true."}}}),Va="No longer supported",Ba=new Ee({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[R.FIELD_DEFINITION,R.ARGUMENT_DEFINITION,R.INPUT_FIELD_DEFINITION,R.ENUM_VALUE],args:{reason:{type:B,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:Va}}}),Ma=new Ee({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[R.SCALAR],args:{url:{type:new I(B),description:"The URL that specifies the behaviour of this scalar."}}}),Ca=Object.freeze([Ua,Pa,Ba,Ma]);function Hi(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ga(e,t,n){return t&&Hi(e.prototype,t),n&&Hi(e,n),e}(function(){function e(n){var i;this.__validationErrors=n.assumeValid===!0?[]:void 0,ve(n)||O(0,"Must provide configuration object."),!n.types||Array.isArray(n.types)||O(0,'"types" must be Array if provided but got: '.concat(_(n.types),".")),!n.directives||Array.isArray(n.directives)||O(0,'"directives" must be Array if provided but got: '+"".concat(_(n.directives),".")),this.description=n.description,this.extensions=n.extensions&&z(n.extensions),this.astNode=n.astNode,this.extensionASTNodes=n.extensionASTNodes,this._queryType=n.query,this._mutationType=n.mutation,this._subscriptionType=n.subscription,this._directives=(i=n.directives)!==null&&i!==void 0?i:Ca;var a=new Set(n.types);if(n.types!=null)for(var o=0,u=n.types;o<u.length;o++){var s=u[o];a.delete(s),te(s,a)}this._queryType!=null&&te(this._queryType,a),this._mutationType!=null&&te(this._mutationType,a),this._subscriptionType!=null&&te(this._subscriptionType,a);for(var c=0,l=this._directives;c<l.length;c++){var y=l[c];if(xa(y))for(var g=0,D=y.args;g<D.length;g++){var k=D[g];te(k.type,a)}}te(Qt,a),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var S=0,w=ya(a);S<w.length;S++){var A=w[S];if(A!=null){var F=A.name;if(F||O(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[F]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(F,'".'));if(this._typeMap[F]=A,H(A))for(var Q=0,V=A.getInterfaces();Q<V.length;Q++){var G=V[Q];if(H(G)){var L=this._implementationsMap[G.name];L===void 0&&(L=this._implementationsMap[G.name]={objects:[],interfaces:[]}),L.interfaces.push(A)}}else if(ie(A))for(var J=0,X=A.getInterfaces();J<X.length;J++){var q=X[J];if(H(q)){var re=this._implementationsMap[q.name];re===void 0&&(re=this._implementationsMap[q.name]={objects:[],interfaces:[]}),re.objects.push(A)}}}}}var t=e.prototype;return t.getQueryType=function(){return this._queryType},t.getMutationType=function(){return this._mutationType},t.getSubscriptionType=function(){return this._subscriptionType},t.getTypeMap=function(){return this._typeMap},t.getType=function(i){return this.getTypeMap()[i]},t.getPossibleTypes=function(i){return le(i)?i.getTypes():this.getImplementations(i).objects},t.getImplementations=function(i){var a=this._implementationsMap[i.name];return a??{objects:[],interfaces:[]}},t.isPossibleType=function(i,a){return this.isSubType(i,a)},t.isSubType=function(i,a){var o=this._subTypeMap[i.name];if(o===void 0){if(o=Object.create(null),le(i))for(var u=0,s=i.getTypes();u<s.length;u++){var c=s[u];o[c.name]=!0}else{for(var l=this.getImplementations(i),y=0,g=l.objects;y<g.length;y++){var D=g[y];o[D.name]=!0}for(var k=0,S=l.interfaces;k<S.length;k++){var w=S[k];o[w.name]=!0}}this._subTypeMap[i.name]=o}return o[a.name]!==void 0},t.getDirectives=function(){return this._directives},t.getDirective=function(i){return Ti(this.getDirectives(),function(a){return a.name===i})},t.toConfig=function(){var i;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:me(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[],assumeValid:this.__validationErrors!==void 0}},Ga(e,[{key:Y,get:function(){return"GraphQLSchema"}}]),e})();function te(e,t){var n=qe(e);if(!t.has(n)){if(t.add(n),le(n))for(var i=0,a=n.getTypes();i<a.length;i++){var o=a[i];te(o,t)}else if(ie(n)||H(n)){for(var u=0,s=n.getInterfaces();u<s.length;u++){var c=s[u];te(c,t)}for(var l=0,y=me(n.getFields());l<y.length;l++){var g=y[l];te(g.type,t);for(var D=0,k=g.args;D<k.length;D++){var S=k[D];te(S.type,t)}}}else if(he(n))for(var w=0,A=me(n.getFields());w<A.length;w++){var F=A[w];te(F.type,t)}}return t}function dt(e,t){var n;if(t.kind===v.LIST_TYPE)return n=dt(e,t.type),n&&new j(n);if(t.kind===v.NON_NULL_TYPE)return n=dt(e,t.type),n&&new I(n);if(t.kind===v.NAMED_TYPE)return e.getType(t.name.value);Me(0,"Unexpected type node: "+_(t))}var ja=function(){function e(n,i,a){this._schema=n,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??qa,a&&(Ne(a)&&this._inputTypeStack.push(a),Ct(a)&&this._parentTypeStack.push(a),at(a)&&this._typeStack.push(a))}var t=e.prototype;return t.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},t.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},t.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},t.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},t.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},t.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},t.getDirective=function(){return this._directive},t.getArgument=function(){return this._argument},t.getEnumValue=function(){return this._enumValue},t.enter=function(i){var a=this._schema;switch(i.kind){case v.SELECTION_SET:{var o=qe(this.getType());this._parentTypeStack.push(Ct(o)?o:void 0);break}case v.FIELD:{var u=this.getParentType(),s,c;u&&(s=this._getFieldDef(a,u,i),s&&(c=s.type)),this._fieldDefStack.push(s),this._typeStack.push(at(c)?c:void 0);break}case v.DIRECTIVE:this._directive=a.getDirective(i.name.value);break;case v.OPERATION_DEFINITION:{var l;switch(i.operation){case"query":l=a.getQueryType();break;case"mutation":l=a.getMutationType();break;case"subscription":l=a.getSubscriptionType();break}this._typeStack.push(ie(l)?l:void 0);break}case v.INLINE_FRAGMENT:case v.FRAGMENT_DEFINITION:{var y=i.typeCondition,g=y?dt(a,y):qe(this.getType());this._typeStack.push(at(g)?g:void 0);break}case v.VARIABLE_DEFINITION:{var D=dt(a,i.type);this._inputTypeStack.push(Ne(D)?D:void 0);break}case v.ARGUMENT:{var k,S,w,A=(k=this.getDirective())!==null&&k!==void 0?k:this.getFieldDef();A&&(S=Ti(A.args,function(q){return q.name===i.name.value}),S&&(w=S.type)),this._argument=S,this._defaultValueStack.push(S?S.defaultValue:void 0),this._inputTypeStack.push(Ne(w)?w:void 0);break}case v.LIST:{var F=da(this.getInputType()),Q=je(F)?F.ofType:F;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Ne(Q)?Q:void 0);break}case v.OBJECT_FIELD:{var V=qe(this.getInputType()),G,L;he(V)&&(L=V.getFields()[i.name.value],L&&(G=L.type)),this._defaultValueStack.push(L?L.defaultValue:void 0),this._inputTypeStack.push(Ne(G)?G:void 0);break}case v.ENUM:{var J=qe(this.getInputType()),X;fe(J)&&(X=J.getValue(i.value)),this._enumValue=X;break}}},t.leave=function(i){switch(i.kind){case v.SELECTION_SET:this._parentTypeStack.pop();break;case v.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case v.DIRECTIVE:this._directive=null;break;case v.OPERATION_DEFINITION:case v.INLINE_FRAGMENT:case v.FRAGMENT_DEFINITION:this._typeStack.pop();break;case v.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case v.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case v.LIST:case v.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case v.ENUM:this._enumValue=null;break}},e}();function qa(e,t,n){var i=n.name.value;if(i===Qi.name&&e.getQueryType()===t)return Qi;if(i===$i.name&&e.getQueryType()===t)return $i;if(i===Ji.name&&Ct(t))return Ji;if(ie(t)||H(t))return t.getFields()[i]}function Qa(e,t){return{enter:function(i){e.enter(i);var a=Pt(t,i.kind,!1);if(a){var o=a.apply(t,arguments);return o!==void 0&&(e.leave(i),Ut(o)&&e.enter(o)),o}},leave:function(i){var a=Pt(t,i.kind,!0),o;return a&&(o=a.apply(t,arguments)),e.leave(i),o}}}[].concat(Vi,zi).map(function(e){return e.name});var pe;function Ie(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}pe={},Ie(pe,v.SCALAR_TYPE_DEFINITION,v.SCALAR_TYPE_EXTENSION),Ie(pe,v.OBJECT_TYPE_DEFINITION,v.OBJECT_TYPE_EXTENSION),Ie(pe,v.INTERFACE_TYPE_DEFINITION,v.INTERFACE_TYPE_EXTENSION),Ie(pe,v.UNION_TYPE_DEFINITION,v.UNION_TYPE_EXTENSION),Ie(pe,v.ENUM_TYPE_DEFINITION,v.ENUM_TYPE_EXTENSION),Ie(pe,v.INPUT_OBJECT_TYPE_DEFINITION,v.INPUT_OBJECT_TYPE_EXTENSION);function Ki(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Xi=function(){function e(n,i){this._ast=n,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=i}var t=e.prototype;return t.reportError=function(i){this._onError(i)},t.getDocument=function(){return this._ast},t.getFragment=function(i){var a=this._fragments;return a||(this._fragments=a=this.getDocument().definitions.reduce(function(o,u){return u.kind===v.FRAGMENT_DEFINITION&&(o[u.name.value]=u),o},Object.create(null))),a[i]},t.getFragmentSpreads=function(i){var a=this._fragmentSpreads.get(i);if(!a){a=[];for(var o=[i];o.length!==0;)for(var u=o.pop(),s=0,c=u.selections;s<c.length;s++){var l=c[s];l.kind===v.FRAGMENT_SPREAD?a.push(l):l.selectionSet&&o.push(l.selectionSet)}this._fragmentSpreads.set(i,a)}return a},t.getRecursivelyReferencedFragments=function(i){var a=this._recursivelyReferencedFragments.get(i);if(!a){a=[];for(var o=Object.create(null),u=[i.selectionSet];u.length!==0;)for(var s=u.pop(),c=0,l=this.getFragmentSpreads(s);c<l.length;c++){var y=l[c],g=y.name.value;if(o[g]!==!0){o[g]=!0;var D=this.getFragment(g);D&&(a.push(D),u.push(D.selectionSet))}}this._recursivelyReferencedFragments.set(i,a)}return a},e}();(function(e){Ki(t,e);function t(i,a,o){var u;return u=e.call(this,i,o)||this,u._schema=a,u}var n=t.prototype;return n.getSchema=function(){return this._schema},t})(Xi),function(e){Ki(t,e);function t(i,a,o,u){var s;return s=e.call(this,a,u)||this,s._schema=i,s._typeInfo=o,s._variableUsages=new Map,s._recursiveVariableUsages=new Map,s}var n=t.prototype;return n.getSchema=function(){return this._schema},n.getVariableUsages=function(a){var o=this._variableUsages.get(a);if(!o){var u=[],s=new ja(this._schema);Ni(a,Qa(s,{VariableDefinition:function(){return!1},Variable:function(l){u.push({node:l,type:s.getInputType(),defaultValue:s.getDefaultValue()})}})),o=u,this._variableUsages.set(a,o)}return o},n.getRecursiveVariableUsages=function(a){var o=this._recursiveVariableUsages.get(a);if(!o){o=this.getVariableUsages(a);for(var u=0,s=this.getRecursivelyReferencedFragments(a);u<s.length;u++){var c=s[u];o=o.concat(this.getVariableUsages(c))}this._recursiveVariableUsages.set(a,o)}return o},n.getType=function(){return this._typeInfo.getType()},n.getParentType=function(){return this._typeInfo.getParentType()},n.getInputType=function(){return this._typeInfo.getInputType()},n.getParentInputType=function(){return this._typeInfo.getParentInputType()},n.getFieldDef=function(){return this._typeInfo.getFieldDef()},n.getDirective=function(){return this._typeInfo.getDirective()},n.getArgument=function(){return this._typeInfo.getArgument()},n.getEnumValue=function(){return this._typeInfo.getEnumValue()},t}(Xi),bi(Vi.concat(zi),function(e){return e.name});const $a={staging:{graphEndpoint:"https://api-staging.spritz.finance/graphql"},production:{graphEndpoint:"https://api.spritz.finance/graphql"}};class ze extends Error{date;constructor(t,...n){super(...n),Error.captureStackTrace&&Error.captureStackTrace(this,ze),this.name="SpritzApiError",this.message=t,this.date=new Date}}const Ja=e=>ci.create(e);class za{client;constructor(t,n){this.client=Ja({baseURL:$a[t].graphEndpoint,headers:{"Content-Type":"application/json",Authorization:"Bearer "+n}})}async query({query:t,variables:n}){try{const i=await this.client.post("",{query:se(t),variables:n,operationName:t?.definitions?.[0]?.name?.value});if(i.data.errors)throw new ze(`Spritz GraphQL Error: ${i.data.errors[0].message}`);return i.data.data}catch(i){if(ci.isAxiosError(i)){const a=i.response?.data.Message??i.response?.data.message;throw new ze(`Spritz Request Error: ${a}`)}else throw new ze(`Spritz Request Error: ${i.message}`)}}}var pt={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PayableAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PayableAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:501}};pt.loc.source={body:`fragment PayableAccountFragment on PayableAccount {
|
|
42
|
+
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},isRepeatable:{type:new I(Q),resolve:function(t){return t.isRepeatable}},locations:{type:new I(new q(new I(Ut))),resolve:function(t){return t.locations}},args:{type:new I(new q(new I(nn))),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;return r?t.args:t.args.filter(function(a){return a.deprecationReason==null})}}}}}),Ut=new Ke({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:R.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:R.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:R.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:R.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:R.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:R.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:R.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:R.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:R.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:R.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:R.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:R.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:R.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:R.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:R.UNION,description:"Location adjacent to a union definition."},ENUM:{value:R.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:R.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:R.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:R.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),X=new re({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:new I(Mt),resolve:function(t){if(Fe(t))return C.SCALAR;if(W(t))return C.OBJECT;if($(t))return C.INTERFACE;if(te(t))return C.UNION;if(ie(t))return C.ENUM;if(ue(t))return C.INPUT_OBJECT;if(Le(t))return C.LIST;if(de(t))return C.NON_NULL;Oe(0,'Unexpected type: "'.concat(F(t),'".'))}},name:{type:V,resolve:function(t){return t.name!==void 0?t.name:void 0}},description:{type:V,resolve:function(t){return t.description!==void 0?t.description:void 0}},specifiedByUrl:{type:V,resolve:function(t){return t.specifiedByUrl!==void 0?t.specifiedByUrl:void 0}},fields:{type:new q(new I(Bt)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;if(W(t)||$(t)){var a=se(t.getFields());return r?a:a.filter(function(u){return u.deprecationReason==null})}}},interfaces:{type:new q(new I(X)),resolve:function(t){if(W(t)||$(t))return t.getInterfaces()}},possibleTypes:{type:new q(new I(X)),resolve:function(t,i,r,a){var u=a.schema;if(fr(t))return u.getPossibleTypes(t)}},enumValues:{type:new q(new I(Vt)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;if(ie(t)){var a=t.getValues();return r?a:a.filter(function(u){return u.deprecationReason==null})}}},inputFields:{type:new q(new I(nn)),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;if(ue(t)){var a=se(t.getFields());return r?a:a.filter(function(u){return u.deprecationReason==null})}}},ofType:{type:X,resolve:function(t){return t.ofType!==void 0?t.ofType:void 0}}}}}),Bt=new re({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},args:{type:new I(new q(new I(nn))),args:{includeDeprecated:{type:Q,defaultValue:!1}},resolve:function(t,i){var r=i.includeDeprecated;return r?t.args:t.args.filter(function(a){return a.deprecationReason==null})}},type:{type:new I(X),resolve:function(t){return t.type}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),nn=new re({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},type:{type:new I(X),resolve:function(t){return t.type}},defaultValue:{type:V,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(t){var i=t.type,r=t.defaultValue,a=Be(r,i);return a?ne(a):null}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),Vt=new re({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new I(V),resolve:function(t){return t.name}},description:{type:V,resolve:function(t){return t.description}},isDeprecated:{type:new I(Q),resolve:function(t){return t.deprecationReason!=null}},deprecationReason:{type:V,resolve:function(t){return t.deprecationReason}}}}}),C=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"}),Mt=new Ke({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:C.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:C.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:C.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:C.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:C.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:C.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:C.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:C.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),xt={name:"__schema",type:new I(Vn),description:"Access the current type schema of this server.",args:[],resolve:function(n,t,i,r){var a=r.schema;return a},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},qt={name:"__type",type:X,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new I(V),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(n,t,i,r){var a=t.name,u=r.schema;return u.getType(a)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},Ct={name:"__typename",type:new I(V),description:"The name of the current Object type at runtime.",args:[],resolve:function(n,t,i,r){var a=r.parentType;return a.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0},jt=Object.freeze([Vn,Pt,Ut,X,Bt,nn,Vt,Mt]);function Gt(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ur(e,n,t){return n&&Gt(e.prototype,n),t&&Gt(e,t),e}function Br(e){return ee(e,he)}var he=function(){function e(t){var i,r;this.name=t.name,this.description=t.description,this.locations=t.locations,this.isRepeatable=(i=t.isRepeatable)!==null&&i!==void 0?i:!1,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,t.name||_(0,"Directive must be named."),Array.isArray(t.locations)||_(0,"@".concat(t.name," locations must be an Array."));var a=(r=t.args)!==null&&r!==void 0?r:{};oe(a)&&!Array.isArray(a)||_(0,"@".concat(t.name," args must be an object with argument names as keys.")),this.args=_e(a).map(function(u){var o=u[0],s=u[1];return{name:o,description:s.description,type:s.type,defaultValue:s.defaultValue,deprecationReason:s.deprecationReason,extensions:s.extensions&&j(s.extensions),astNode:s.astNode}})}var n=e.prototype;return n.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:At(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},n.toString=function(){return"@"+this.name},n.toJSON=function(){return this.toString()},Ur(e,[{key:G,get:function(){return"GraphQLDirective"}}]),e}();H(he);var Vr=new he({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[R.FIELD,R.FRAGMENT_SPREAD,R.INLINE_FRAGMENT],args:{if:{type:new I(Q),description:"Included when true."}}}),Mr=new he({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[R.FIELD,R.FRAGMENT_SPREAD,R.INLINE_FRAGMENT],args:{if:{type:new I(Q),description:"Skipped when true."}}}),xr="No longer supported",qr=new he({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[R.FIELD_DEFINITION,R.ARGUMENT_DEFINITION,R.INPUT_FIELD_DEFINITION,R.ENUM_VALUE],args:{reason:{type:V,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:xr}}}),Cr=new he({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[R.SCALAR],args:{url:{type:new I(V),description:"The URL that specifies the behaviour of this scalar."}}}),jr=Object.freeze([Vr,Mr,qr,Cr]);function $t(e,n){for(var t=0;t<n.length;t++){var i=n[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Gr(e,n,t){return n&&$t(e.prototype,n),t&&$t(e,t),e}(function(){function e(t){var i;this.__validationErrors=t.assumeValid===!0?[]:void 0,oe(t)||_(0,"Must provide configuration object."),!t.types||Array.isArray(t.types)||_(0,'"types" must be Array if provided but got: '.concat(F(t.types),".")),!t.directives||Array.isArray(t.directives)||_(0,'"directives" must be Array if provided but got: '+"".concat(F(t.directives),".")),this.description=t.description,this.extensions=t.extensions&&j(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=t.extensionASTNodes,this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(i=t.directives)!==null&&i!==void 0?i:jr;var r=new Set(t.types);if(t.types!=null)for(var a=0,u=t.types;a<u.length;a++){var o=u[a];r.delete(o),K(o,r)}this._queryType!=null&&K(this._queryType,r),this._mutationType!=null&&K(this._mutationType,r),this._subscriptionType!=null&&K(this._subscriptionType,r);for(var s=0,l=this._directives;s<l.length;s++){var g=l[s];if(Br(g))for(var E=0,y=g.args;E<y.length;E++){var d=y[E];K(d.type,r)}}K(Vn,r),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var N=0,w=kr(r);N<w.length;N++){var O=w[N];if(O!=null){var D=O.name;if(D||_(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[D]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(D,'".'));if(this._typeMap[D]=O,$(O))for(var P=0,L=O.getInterfaces();P<L.length;P++){var f=L[P];if($(f)){var c=this._implementationsMap[f.name];c===void 0&&(c=this._implementationsMap[f.name]={objects:[],interfaces:[]}),c.interfaces.push(O)}}else if(W(O))for(var S=0,v=O.getInterfaces();S<v.length;S++){var b=v[S];if($(b)){var A=this._implementationsMap[b.name];A===void 0&&(A=this._implementationsMap[b.name]={objects:[],interfaces:[]}),A.objects.push(O)}}}}}var n=e.prototype;return n.getQueryType=function(){return this._queryType},n.getMutationType=function(){return this._mutationType},n.getSubscriptionType=function(){return this._subscriptionType},n.getTypeMap=function(){return this._typeMap},n.getType=function(i){return this.getTypeMap()[i]},n.getPossibleTypes=function(i){return te(i)?i.getTypes():this.getImplementations(i).objects},n.getImplementations=function(i){var r=this._implementationsMap[i.name];return r??{objects:[],interfaces:[]}},n.isPossibleType=function(i,r){return this.isSubType(i,r)},n.isSubType=function(i,r){var a=this._subTypeMap[i.name];if(a===void 0){if(a=Object.create(null),te(i))for(var u=0,o=i.getTypes();u<o.length;u++){var s=o[u];a[s.name]=!0}else{for(var l=this.getImplementations(i),g=0,E=l.objects;g<E.length;g++){var y=E[g];a[y.name]=!0}for(var d=0,N=l.interfaces;d<N.length;d++){var w=N[d];a[w.name]=!0}}this._subTypeMap[i.name]=a}return a[r.name]!==void 0},n.getDirectives=function(){return this._directives},n.getDirective=function(i){return yt(this.getDirectives(),function(r){return r.name===i})},n.toConfig=function(){var i;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:se(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(i=this.extensionASTNodes)!==null&&i!==void 0?i:[],assumeValid:this.__validationErrors!==void 0}},Gr(e,[{key:G,get:function(){return"GraphQLSchema"}}]),e})();function K(e,n){var t=Re(e);if(!n.has(t)){if(n.add(t),te(t))for(var i=0,r=t.getTypes();i<r.length;i++){var a=r[i];K(a,n)}else if(W(t)||$(t)){for(var u=0,o=t.getInterfaces();u<o.length;u++){var s=o[u];K(s,n)}for(var l=0,g=se(t.getFields());l<g.length;l++){var E=g[l];K(E.type,n);for(var y=0,d=E.args;y<d.length;y++){var N=d[y];K(N.type,n)}}}else if(ue(t))for(var w=0,O=se(t.getFields());w<O.length;w++){var D=O[w];K(D.type,n)}}return n}function tn(e,n){var t;if(n.kind===h.LIST_TYPE)return t=tn(e,n.type),t&&new q(t);if(n.kind===h.NON_NULL_TYPE)return t=tn(e,n.type),t&&new I(t);if(n.kind===h.NAMED_TYPE)return e.getType(n.name.value);Oe(0,"Unexpected type node: "+F(n))}var $r=function(){function e(t,i,r){this._schema=t,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=i??Qr,r&&(ve(r)&&this._inputTypeStack.push(r),Rn(r)&&this._parentTypeStack.push(r),Ye(r)&&this._typeStack.push(r))}var n=e.prototype;return n.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},n.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},n.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},n.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},n.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},n.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},n.getDirective=function(){return this._directive},n.getArgument=function(){return this._argument},n.getEnumValue=function(){return this._enumValue},n.enter=function(i){var r=this._schema;switch(i.kind){case h.SELECTION_SET:{var a=Re(this.getType());this._parentTypeStack.push(Rn(a)?a:void 0);break}case h.FIELD:{var u=this.getParentType(),o,s;u&&(o=this._getFieldDef(r,u,i),o&&(s=o.type)),this._fieldDefStack.push(o),this._typeStack.push(Ye(s)?s:void 0);break}case h.DIRECTIVE:this._directive=r.getDirective(i.name.value);break;case h.OPERATION_DEFINITION:{var l;switch(i.operation){case"query":l=r.getQueryType();break;case"mutation":l=r.getMutationType();break;case"subscription":l=r.getSubscriptionType();break}this._typeStack.push(W(l)?l:void 0);break}case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:{var g=i.typeCondition,E=g?tn(r,g):Re(this.getType());this._typeStack.push(Ye(E)?E:void 0);break}case h.VARIABLE_DEFINITION:{var y=tn(r,i.type);this._inputTypeStack.push(ve(y)?y:void 0);break}case h.ARGUMENT:{var d,N,w,O=(d=this.getDirective())!==null&&d!==void 0?d:this.getFieldDef();O&&(N=yt(O.args,function(b){return b.name===i.name.value}),N&&(w=N.type)),this._argument=N,this._defaultValueStack.push(N?N.defaultValue:void 0),this._inputTypeStack.push(ve(w)?w:void 0);break}case h.LIST:{var D=pr(this.getInputType()),P=Le(D)?D.ofType:D;this._defaultValueStack.push(void 0),this._inputTypeStack.push(ve(P)?P:void 0);break}case h.OBJECT_FIELD:{var L=Re(this.getInputType()),f,c;ue(L)&&(c=L.getFields()[i.name.value],c&&(f=c.type)),this._defaultValueStack.push(c?c.defaultValue:void 0),this._inputTypeStack.push(ve(f)?f:void 0);break}case h.ENUM:{var S=Re(this.getInputType()),v;ie(S)&&(v=S.getValue(i.value)),this._enumValue=v;break}}},n.leave=function(i){switch(i.kind){case h.SELECTION_SET:this._parentTypeStack.pop();break;case h.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case h.DIRECTIVE:this._directive=null;break;case h.OPERATION_DEFINITION:case h.INLINE_FRAGMENT:case h.FRAGMENT_DEFINITION:this._typeStack.pop();break;case h.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case h.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.LIST:case h.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case h.ENUM:this._enumValue=null;break}},e}();function Qr(e,n,t){var i=t.name.value;if(i===xt.name&&e.getQueryType()===n)return xt;if(i===qt.name&&e.getQueryType()===n)return qt;if(i===Ct.name&&Rn(n))return Ct;if(W(n)||$(n))return n.getFields()[i]}function Jr(e,n){return{enter:function(i){e.enter(i);var r=On(n,i.kind,!1);if(r){var a=r.apply(n,arguments);return a!==void 0&&(e.leave(i),Dn(a)&&e.enter(a)),a}},leave:function(i){var r=On(n,i.kind,!0),a;return r&&(a=r.apply(n,arguments)),e.leave(i),a}}}[].concat(Lt,jt).map(function(e){return e.name});var ae;function ye(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}ae={},ye(ae,h.SCALAR_TYPE_DEFINITION,h.SCALAR_TYPE_EXTENSION),ye(ae,h.OBJECT_TYPE_DEFINITION,h.OBJECT_TYPE_EXTENSION),ye(ae,h.INTERFACE_TYPE_DEFINITION,h.INTERFACE_TYPE_EXTENSION),ye(ae,h.UNION_TYPE_DEFINITION,h.UNION_TYPE_EXTENSION),ye(ae,h.ENUM_TYPE_DEFINITION,h.ENUM_TYPE_EXTENSION),ye(ae,h.INPUT_OBJECT_TYPE_DEFINITION,h.INPUT_OBJECT_TYPE_EXTENSION);function Qt(e,n){e.prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n}var Jt=function(){function e(t,i){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=i}var n=e.prototype;return n.reportError=function(i){this._onError(i)},n.getDocument=function(){return this._ast},n.getFragment=function(i){var r=this._fragments;return r||(this._fragments=r=this.getDocument().definitions.reduce(function(a,u){return u.kind===h.FRAGMENT_DEFINITION&&(a[u.name.value]=u),a},Object.create(null))),r[i]},n.getFragmentSpreads=function(i){var r=this._fragmentSpreads.get(i);if(!r){r=[];for(var a=[i];a.length!==0;)for(var u=a.pop(),o=0,s=u.selections;o<s.length;o++){var l=s[o];l.kind===h.FRAGMENT_SPREAD?r.push(l):l.selectionSet&&a.push(l.selectionSet)}this._fragmentSpreads.set(i,r)}return r},n.getRecursivelyReferencedFragments=function(i){var r=this._recursivelyReferencedFragments.get(i);if(!r){r=[];for(var a=Object.create(null),u=[i.selectionSet];u.length!==0;)for(var o=u.pop(),s=0,l=this.getFragmentSpreads(o);s<l.length;s++){var g=l[s],E=g.name.value;if(a[E]!==!0){a[E]=!0;var y=this.getFragment(E);y&&(r.push(y),u.push(y.selectionSet))}}this._recursivelyReferencedFragments.set(i,r)}return r},e}();(function(e){Qt(n,e);function n(i,r,a){var u;return u=e.call(this,i,a)||this,u._schema=r,u}var t=n.prototype;return t.getSchema=function(){return this._schema},n})(Jt),function(e){Qt(n,e);function n(i,r,a,u){var o;return o=e.call(this,r,u)||this,o._schema=i,o._typeInfo=a,o._variableUsages=new Map,o._recursiveVariableUsages=new Map,o}var t=n.prototype;return t.getSchema=function(){return this._schema},t.getVariableUsages=function(r){var a=this._variableUsages.get(r);if(!a){var u=[],o=new $r(this._schema);ht(r,Jr(o,{VariableDefinition:function(){return!1},Variable:function(l){u.push({node:l,type:o.getInputType(),defaultValue:o.getDefaultValue()})}})),a=u,this._variableUsages.set(r,a)}return a},t.getRecursiveVariableUsages=function(r){var a=this._recursiveVariableUsages.get(r);if(!a){a=this.getVariableUsages(r);for(var u=0,o=this.getRecursivelyReferencedFragments(r);u<o.length;u++){var s=o[u];a=a.concat(this.getVariableUsages(s))}this._recursiveVariableUsages.set(r,a)}return a},t.getType=function(){return this._typeInfo.getType()},t.getParentType=function(){return this._typeInfo.getParentType()},t.getInputType=function(){return this._typeInfo.getInputType()},t.getParentInputType=function(){return this._typeInfo.getParentInputType()},t.getFieldDef=function(){return this._typeInfo.getFieldDef()},t.getDirective=function(){return this._typeInfo.getDirective()},t.getArgument=function(){return this._typeInfo.getArgument()},t.getEnumValue=function(){return this._typeInfo.getEnumValue()},n}(Jt),gt(Lt.concat(jt),function(e){return e.name});const Hr={staging:{graphEndpoint:"https://api-staging.spritz.finance/graphql"},production:{graphEndpoint:"https://api.spritz.finance/graphql"}};let Mn=class Ii extends Error{date;constructor(n,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,Ii),this.name="SpritzApiError",this.message=n,this.date=new Date}};const zr=e=>at.create(e);class Yr{client;constructor(n,t,i){this.client=zr({baseURL:Hr[n].graphEndpoint,headers:{"Content-Type":"application/json",Authorization:"Bearer "+t,...i?{"X-INTEGRATION-KEY":i}:{}}})}async query({query:n,variables:t}){try{const i=await this.client.post("",{query:ne(n),variables:t,operationName:n?.definitions?.[0]?.name?.value});if(i.data.errors)throw new Mn(`Spritz GraphQL Error: ${i.data.errors[0].message}`);return i.data.data}catch(i){if(at.isAxiosError(i)){const r=i.response?.data.Message??i.response?.data.message;throw new Mn(`Spritz Request Error: ${r}`)}else throw new Mn(`Spritz Request Error: ${i.message}`)}}}var rn={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PayableAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"PayableAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:501}};rn.loc.source={body:`fragment PayableAccountFragment on PayableAccount {
|
|
43
43
|
id
|
|
44
44
|
name
|
|
45
45
|
userId
|
|
@@ -68,14 +68,14 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
68
68
|
currency
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function
|
|
71
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function an(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){an(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){an(i,n)}),e.definitions&&e.definitions.forEach(function(i){an(i,n)})}var xn={};(function(){rn.definitions.forEach(function(n){if(n.name){var t=new Set;an(n,t),xn[n.name.value]=t}})})();function Ht(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Xr(e,n){var t={kind:e.kind,definitions:[Ht(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=xn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=xn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=Ht(e,o);s&&t.definitions.push(s)}),t}Xr(rn,"PayableAccountFragment");var ge={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateUSBankAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createUSAccountInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createUSBankAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createUSAccountInput"},value:{kind:"Variable",name:{kind:"Name",value:"createUSAccountInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PayableAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:241}};ge.loc.source={body:`#import "../queries/payableAccountFragment.graphql"
|
|
72
72
|
|
|
73
73
|
mutation CreateUSBankAccount($createUSAccountInput: USBankAccountInput!) {
|
|
74
74
|
createUSBankAccount(createUSAccountInput: $createUSAccountInput) {
|
|
75
75
|
...PayableAccountFragment
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
78
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var zt={};function Kr(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return zt[t]?!1:(zt[t]=!0,!0)})}ge.definitions=ge.definitions.concat(Kr(rn.definitions));function on(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){on(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){on(i,n)}),e.definitions&&e.definitions.forEach(function(i){on(i,n)})}var qn={};(function(){ge.definitions.forEach(function(n){if(n.name){var t=new Set;on(n,t),qn[n.name.value]=t}})})();function Yt(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Wr(e,n){var t={kind:e.kind,definitions:[Yt(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=qn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=qn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=Yt(e,o);s&&t.definitions.push(s)}),t}Wr(ge,"CreateUSBankAccount");var ke={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"BankAccountFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"BankAccount"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"accountNumber"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountSubType"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"holder"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"ownedByUser"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"bankAccountDetails"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"USBankAccountDetails"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"routingNumber"},arguments:[],directives:[]}]}}]}}]}},{kind:"Field",name:{kind:"Name",value:"institution"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"name"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logo"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"currency"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:495}};ke.loc.source={body:`fragment BankAccountFragment on BankAccount {
|
|
79
79
|
id
|
|
80
80
|
name
|
|
81
81
|
userId
|
|
@@ -104,44 +104,69 @@ mutation CreateUSBankAccount($createUSAccountInput: USBankAccountInput!) {
|
|
|
104
104
|
currency
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function
|
|
107
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function sn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){sn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){sn(i,n)}),e.definitions&&e.definitions.forEach(function(i){sn(i,n)})}var Cn={};(function(){ke.definitions.forEach(function(n){if(n.name){var t=new Set;sn(n,t),Cn[n.name.value]=t}})})();function Xt(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Zr(e,n){var t={kind:e.kind,definitions:[Xt(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Cn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Cn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=Xt(e,o);s&&t.definitions.push(s)}),t}Zr(ke,"BankAccountFragment");var Se={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RenameBankAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"renamePayableAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:218}};Se.loc.source={body:`#import "../queries/bankAccountFragment.graphql"
|
|
108
108
|
|
|
109
109
|
mutation RenameBankAccount($accountId: String!, $name: String!) {
|
|
110
110
|
renamePayableAccount(accountId: $accountId, name: $name) {
|
|
111
111
|
...BankAccountFragment
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
114
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Kt={};function ea(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Kt[t]?!1:(Kt[t]=!0,!0)})}Se.definitions=Se.definitions.concat(ea(ke.definitions));function un(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){un(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){un(i,n)}),e.definitions&&e.definitions.forEach(function(i){un(i,n)})}var jn={};(function(){Se.definitions.forEach(function(n){if(n.name){var t=new Set;un(n,t),jn[n.name.value]=t}})})();function Wt(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function na(e,n){var t={kind:e.kind,definitions:[Wt(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=jn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=jn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=Wt(e,o);s&&t.definitions.push(s)}),t}na(Se,"RenameBankAccount");var Te={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteBankAccount"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletePayableAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:189}};Te.loc.source={body:`#import "../queries/bankAccountFragment.graphql"
|
|
115
115
|
|
|
116
116
|
mutation DeleteBankAccount($accountId: String!) {
|
|
117
117
|
deletePayableAccount(accountId: $accountId) {
|
|
118
118
|
...BankAccountFragment
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
121
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Zt={};function ta(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Zt[t]?!1:(Zt[t]=!0,!0)})}Te.definitions=Te.definitions.concat(ta(ke.definitions));function cn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){cn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){cn(i,n)}),e.definitions&&e.definitions.forEach(function(i){cn(i,n)})}var Gn={};(function(){Te.definitions.forEach(function(n){if(n.name){var t=new Set;cn(n,t),Gn[n.name.value]=t}})})();function ei(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function ia(e,n){var t={kind:e.kind,definitions:[ei(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Gn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Gn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=ei(e,o);s&&t.definitions.push(s)}),t}ia(Te,"DeleteBankAccount");var Ne={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserBankAccounts"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userBankAccounts"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"BankAccountFragment"},directives:[]}]}}]}}],loc:{start:0,end:128}};Ne.loc.source={body:`#import "./bankAccountFragment.graphql"
|
|
122
122
|
|
|
123
123
|
query UserBankAccounts {
|
|
124
124
|
userBankAccounts {
|
|
125
125
|
...BankAccountFragment
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
128
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var ni={};function ra(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ni[t]?!1:(ni[t]=!0,!0)})}Ne.definitions=Ne.definitions.concat(ra(ke.definitions));function ln(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){ln(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){ln(i,n)}),e.definitions&&e.definitions.forEach(function(i){ln(i,n)})}var $n={};(function(){Ne.definitions.forEach(function(n){if(n.name){var t=new Set;ln(n,t),$n[n.name.value]=t}})})();function ti(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function aa(e,n){var t={kind:e.kind,definitions:[ti(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=$n[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=$n[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=ti(e,o);s&&t.definitions.push(s)}),t}aa(Ne,"UserBankAccounts");var Qn=(e=>(e.CHECKBOOK="CHECKBOOK",e.METHOD_FI="METHOD_FI",e))(Qn||{}),ii=(e=>(e.Business="Business",e.Checking="Checking",e.Savings="Savings",e))(ii||{}),Jn=(e=>(e.USBankAccount="USBankAccount",e))(Jn||{}),ri=(e=>(e.COMPLETED="COMPLETED",e.CONFIRMED="CONFIRMED",e.CREATED="CREATED",e.FAILED="FAILED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.TRANSACTION_FAILED="TRANSACTION_FAILED",e.TRANSACTION_PENDING="TRANSACTION_PENDING",e))(ri||{}),ai=(e=>(e.ACTIVE="ACTIVE",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.LOADING="LOADING",e.UNAVAILABLE="UNAVAILABLE",e.UNINITIALIZED="UNINITIALIZED",e))(ai||{}),oi=(e=>(e.BankAccount="BankAccount",e.Bill="Bill",e.DebitCard="DebitCard",e))(oi||{}),si=(e=>(e.CANCELLED="CANCELLED",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.INITIALIZED="INITIALIZED",e.PENDING="PENDING",e.REFUNDED="REFUNDED",e.REVERSAL_IN_PROGRESS="REVERSAL_IN_PROGRESS",e.REVERSED="REVERSED",e.SCHEDULED="SCHEDULED",e.SENT="SENT",e))(si||{});const oa={[Jn.USBankAccount]:e=>({query:ge,variables:{createUSAccountInput:e},response:"createUSBankAccount"})},sa=(e,n)=>oa[e]?.(n)??null;class ua{client;constructor(n){this.client=n}async list(){return(await this.client.query({query:Ne}))?.userBankAccounts??null}async rename(n,t){return(await this.client.query({query:Se,variables:{accountId:n,name:t}}))?.renamePayableAccount??null}async delete(n){return(await this.client.query({query:Te,variables:{accountId:n}}))?.deletePayableAccount??null}async create(n,t){const i=sa(n,t);if(!i)throw new Error("Invalid bank account type");return(await this.client.query({query:i.query,variables:i.variables}))?.[i.response]??null}}var Ve={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"Payment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]}]}}],loc:{start:0,end:122}};Ve.loc.source={body:`fragment PaymentFragment on Payment {
|
|
129
|
+
id
|
|
130
|
+
userId
|
|
131
|
+
status
|
|
132
|
+
accountId
|
|
133
|
+
amount
|
|
134
|
+
feeAmount
|
|
135
|
+
createdAt
|
|
136
|
+
}
|
|
137
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function fn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){fn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){fn(i,n)}),e.definitions&&e.definitions.forEach(function(i){fn(i,n)})}var Hn={};(function(){Ve.definitions.forEach(function(n){if(n.name){var t=new Set;fn(n,t),Hn[n.name.value]=t}})})();function ui(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function ca(e,n){var t={kind:e.kind,definitions:[ui(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Hn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Hn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=ui(e,o);s&&t.definitions.push(s)}),t}ca(Ve,"PaymentFragment");var be={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"PaymentRequestPayment"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"paymentRequestId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paymentForPaymentRequest"},arguments:[{kind:"Argument",name:{kind:"Name",value:"paymentRequestId"},value:{kind:"Variable",name:{kind:"Name",value:"paymentRequestId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:198}};be.loc.source={body:`#import "./paymentFragment.graphql"
|
|
138
|
+
|
|
139
|
+
query PaymentRequestPayment($paymentRequestId: String!) {
|
|
140
|
+
paymentForPaymentRequest(paymentRequestId: $paymentRequestId) {
|
|
141
|
+
...PaymentFragment
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var ci={};function la(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return ci[t]?!1:(ci[t]=!0,!0)})}be.definitions=be.definitions.concat(la(Ve.definitions));function dn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){dn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){dn(i,n)}),e.definitions&&e.definitions.forEach(function(i){dn(i,n)})}var zn={};(function(){be.definitions.forEach(function(n){if(n.name){var t=new Set;dn(n,t),zn[n.name.value]=t}})})();function li(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function fa(e,n){var t={kind:e.kind,definitions:[li(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=zn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=zn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=li(e,o);s&&t.definitions.push(s)}),t}fa(be,"PaymentRequestPayment");var Ee={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"AccountPayments"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"accountId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"paymentsForAccount"},arguments:[{kind:"Argument",name:{kind:"Name",value:"accountId"},value:{kind:"Variable",name:{kind:"Name",value:"accountId"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentFragment"},directives:[]}]}}]}}],loc:{start:0,end:165}};Ee.loc.source={body:`#import "./paymentFragment.graphql"
|
|
145
|
+
|
|
146
|
+
query AccountPayments($accountId: String!) {
|
|
147
|
+
paymentsForAccount(accountId: $accountId) {
|
|
148
|
+
...PaymentFragment
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var fi={};function da(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return fi[t]?!1:(fi[t]=!0,!0)})}Ee.definitions=Ee.definitions.concat(da(Ve.definitions));function vn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){vn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){vn(i,n)}),e.definitions&&e.definitions.forEach(function(i){vn(i,n)})}var Yn={};(function(){Ee.definitions.forEach(function(n){if(n.name){var t=new Set;vn(n,t),Yn[n.name.value]=t}})})();function di(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function va(e,n){var t={kind:e.kind,definitions:[di(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Yn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Yn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=di(e,o);s&&t.definitions.push(s)}),t}va(Ee,"AccountPayments");class pa{client;constructor(n){this.client=n}async listForAccount(n){return(await this.client.query({query:Ee,variables:{accountId:n}}))?.paymentsForAccount??[]}async getForPaymentRequest(n){return(await this.client.query({query:be,variables:{paymentRequestId:n}}))?.paymentForPaymentRequest??null}}var pn={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"PaymentRequestFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"DirectPayment"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"accountId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"feeAmount"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"amountDue"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"network"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]}]}}],loc:{start:0,end:161}};pn.loc.source={body:`fragment PaymentRequestFragment on DirectPayment {
|
|
129
152
|
id
|
|
130
153
|
userId
|
|
131
154
|
accountId
|
|
132
155
|
status
|
|
133
156
|
amount
|
|
157
|
+
feeAmount
|
|
158
|
+
amountDue
|
|
134
159
|
network
|
|
135
160
|
createdAt
|
|
136
161
|
}
|
|
137
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function
|
|
162
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function mn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){mn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){mn(i,n)}),e.definitions&&e.definitions.forEach(function(i){mn(i,n)})}var Xn={};(function(){pn.definitions.forEach(function(n){if(n.name){var t=new Set;mn(n,t),Xn[n.name.value]=t}})})();function vi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function ma(e,n){var t={kind:e.kind,definitions:[vi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Xn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Xn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=vi(e,o);s&&t.definitions.push(s)}),t}ma(pn,"PaymentRequestFragment");var le={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreatePaymentRequest"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createDirectPaymentInput"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"CreateDirectPaymentInput"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createDirectPayment"},arguments:[{kind:"Argument",name:{kind:"Name",value:"createDirectPaymentInput"},value:{kind:"Variable",name:{kind:"Name",value:"createDirectPaymentInput"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"PaymentRequestFragment"},directives:[]}]}}]}}],loc:{start:0,end:260}};le.loc.source={body:`#import "../queries/paymentRequestFragment.graphql"
|
|
138
163
|
|
|
139
164
|
mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInput!) {
|
|
140
165
|
createDirectPayment(createDirectPaymentInput: $createDirectPaymentInput) {
|
|
141
166
|
...PaymentRequestFragment
|
|
142
167
|
}
|
|
143
168
|
}
|
|
144
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
169
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var pi={};function ha(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return pi[t]?!1:(pi[t]=!0,!0)})}le.definitions=le.definitions.concat(ha(pn.definitions));function hn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){hn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){hn(i,n)}),e.definitions&&e.definitions.forEach(function(i){hn(i,n)})}var Kn={};(function(){le.definitions.forEach(function(n){if(n.name){var t=new Set;hn(n,t),Kn[n.name.value]=t}})})();function mi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function ya(e,n){var t={kind:e.kind,definitions:[mi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Kn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Kn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=mi(e,o);s&&t.definitions.push(s)}),t}ya(le,"CreatePaymentRequest");var yn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetSpritzPayParams"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"amount"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"Float"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"reference"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"network"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"spritzPayParams"},arguments:[{kind:"Argument",name:{kind:"Name",value:"tokenAddress"},value:{kind:"Variable",name:{kind:"Name",value:"tokenAddress"}}},{kind:"Argument",name:{kind:"Name",value:"amount"},value:{kind:"Variable",name:{kind:"Name",value:"amount"}}},{kind:"Argument",name:{kind:"Name",value:"reference"},value:{kind:"Variable",name:{kind:"Name",value:"reference"}}},{kind:"Argument",name:{kind:"Name",value:"network"},value:{kind:"Variable",name:{kind:"Name",value:"network"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contractAddress"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"method"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"calldata"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"value"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"requiredTokenInput"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"suggestedGasLimit"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:399}};yn.loc.source={body:`query GetSpritzPayParams(
|
|
145
170
|
$tokenAddress: String!
|
|
146
171
|
$amount: Float!
|
|
147
172
|
$reference: String!
|
|
@@ -161,18 +186,11 @@ mutation CreatePaymentRequest($createDirectPaymentInput: CreateDirectPaymentInpu
|
|
|
161
186
|
suggestedGasLimit
|
|
162
187
|
}
|
|
163
188
|
}
|
|
164
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Et(e,t){if(e.kind==="FragmentSpread")t.add(e.name.value);else if(e.kind==="VariableDefinition"){var n=e.type;n.kind==="NamedType"&&t.add(n.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Et(i,t)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Et(i,t)}),e.definitions&&e.definitions.forEach(function(i){Et(i,t)})}var ni={};(function(){bt.definitions.forEach(function(t){if(t.name){var n=new Set;Et(t,n),ni[t.name.value]=n}})})();function mr(e,t){for(var n=0;n<e.definitions.length;n++){var i=e.definitions[n];if(i.name&&i.name.value==t)return i}}function lo(e,t){var n={kind:e.kind,definitions:[mr(e,t)]};e.hasOwnProperty("loc")&&(n.loc=e.loc);var i=ni[t]||new Set,a=new Set,o=new Set;for(i.forEach(function(s){o.add(s)});o.size>0;){var u=o;o=new Set,u.forEach(function(s){if(!a.has(s)){a.add(s);var c=ni[s]||new Set;c.forEach(function(l){o.add(l)})}})}return a.forEach(function(s){var c=mr(e,s);c&&n.definitions.push(c)}),n}lo(bt,"GetSpritzPayParams");const fo=e=>Math.round((e+Number.EPSILON)*100)/100;var po=li({"node_modules/js-sha3/src/sha3.js"(e,t){(function(){var n="input is invalid type",i="finalize already called",a=typeof window=="object",o=a?window:{};o.JS_SHA3_NO_WINDOW&&(a=!1);var u=!a&&typeof self=="object",s=!o.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?o=global:u&&(o=self);var c=!o.JS_SHA3_NO_COMMON_JS&&typeof t=="object"&&t.exports,l=typeof define=="function"&&define.amd,y=!o.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",g="0123456789abcdef".split(""),D=[31,7936,2031616,520093696],k=[4,1024,262144,67108864],S=[1,256,65536,16777216],w=[6,1536,393216,100663296],A=[0,8,16,24],F=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],Q=[224,256,384,512],V=[128,256],G=["hex","buffer","arrayBuffer","array","digest"],L={128:168,256:136};(o.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(r){return Object.prototype.toString.call(r)==="[object Array]"}),y&&(o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(r){return typeof r=="object"&&r.buffer&&r.buffer.constructor===ArrayBuffer});for(var J=function(r,f,d){return function(p){return new M(r,f,r).update(p)[d]()}},X=function(r,f,d){return function(p,h){return new M(r,f,h).update(p)[d]()}},q=function(r,f,d){return function(p,h,T,b){return ae["cshake"+r].update(p,h,T,b)[d]()}},re=function(r,f,d){return function(p,h,T,b){return ae["kmac"+r].update(p,h,T,b)[d]()}},ue=function(r,f,d,p){for(var h=0;h<G.length;++h){var T=G[h];r[T]=f(d,p,T)}return r},oi=function(r,f){var d=J(r,f,"hex");return d.create=function(){return new M(r,f,r)},d.update=function(p){return d.create().update(p)},ue(d,J,r,f)},Tr=function(r,f){var d=X(r,f,"hex");return d.create=function(p){return new M(r,f,p)},d.update=function(p,h){return d.create(h).update(p)},ue(d,X,r,f)},br=function(r,f){var d=L[r],p=q(r,f,"hex");return p.create=function(h,T,b){return!T&&!b?ae["shake"+r].create(h):new M(r,f,h).bytepad([T,b],d)},p.update=function(h,T,b,N){return p.create(T,b,N).update(h)},ue(p,q,r,f)},Er=function(r,f){var d=L[r],p=re(r,f,"hex");return p.create=function(h,T,b){return new _t(r,f,T).bytepad(["KMAC",b],d).bytepad([h],d)},p.update=function(h,T,b,N){return p.create(h,b,N).update(T)},ue(p,re,r,f)},si=[{name:"keccak",padding:S,bits:Q,createMethod:oi},{name:"sha3",padding:w,bits:Q,createMethod:oi},{name:"shake",padding:D,bits:V,createMethod:Tr},{name:"cshake",padding:k,bits:V,createMethod:br},{name:"kmac",padding:k,bits:V,createMethod:Er}],ae={},Le=[],ce=0;ce<si.length;++ce)for(var ge=si[ce],Ye=ge.bits,xe=0;xe<Ye.length;++xe){var Ft=ge.name+"_"+Ye[xe];if(Le.push(Ft),ae[Ft]=ge.createMethod(Ye[xe],ge.padding),ge.name!=="sha3"){var ui=ge.name+Ye[xe];Le.push(ui),ae[ui]=ae[Ft]}}function M(r,f,d){this.blocks=[],this.s=[],this.padding=f,this.outputBits=d,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(r<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=d>>5,this.extraBytes=(d&31)>>3;for(var p=0;p<50;++p)this.s[p]=0}M.prototype.update=function(r){if(this.finalized)throw new Error(i);var f,d=typeof r;if(d!=="string"){if(d==="object"){if(r===null)throw new Error(n);if(y&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!y||!ArrayBuffer.isView(r)))throw new Error(n)}else throw new Error(n);f=!0}for(var p=this.blocks,h=this.byteCount,T=r.length,b=this.blockCount,N=0,C=this.s,E,P;N<T;){if(this.reset)for(this.reset=!1,p[0]=this.block,E=1;E<b+1;++E)p[E]=0;if(f)for(E=this.start;N<T&&E<h;++N)p[E>>2]|=r[N]<<A[E++&3];else for(E=this.start;N<T&&E<h;++N)P=r.charCodeAt(N),P<128?p[E>>2]|=P<<A[E++&3]:P<2048?(p[E>>2]|=(192|P>>6)<<A[E++&3],p[E>>2]|=(128|P&63)<<A[E++&3]):P<55296||P>=57344?(p[E>>2]|=(224|P>>12)<<A[E++&3],p[E>>2]|=(128|P>>6&63)<<A[E++&3],p[E>>2]|=(128|P&63)<<A[E++&3]):(P=65536+((P&1023)<<10|r.charCodeAt(++N)&1023),p[E>>2]|=(240|P>>18)<<A[E++&3],p[E>>2]|=(128|P>>12&63)<<A[E++&3],p[E>>2]|=(128|P>>6&63)<<A[E++&3],p[E>>2]|=(128|P&63)<<A[E++&3]);if(this.lastByteIndex=E,E>=h){for(this.start=E-h,this.block=p[b],E=0;E<b;++E)C[E]^=p[E];Ue(C),this.reset=!0}else this.start=E}return this},M.prototype.encode=function(r,f){var d=r&255,p=1,h=[d];for(r=r>>8,d=r&255;d>0;)h.unshift(d),r=r>>8,d=r&255,++p;return f?h.push(p):h.unshift(p),this.update(h),h.length},M.prototype.encodeString=function(r){var f,d=typeof r;if(d!=="string"){if(d==="object"){if(r===null)throw new Error(n);if(y&&r.constructor===ArrayBuffer)r=new Uint8Array(r);else if(!Array.isArray(r)&&(!y||!ArrayBuffer.isView(r)))throw new Error(n)}else throw new Error(n);f=!0}var p=0,h=r.length;if(f)p=h;else for(var T=0;T<r.length;++T){var b=r.charCodeAt(T);b<128?p+=1:b<2048?p+=2:b<55296||b>=57344?p+=3:(b=65536+((b&1023)<<10|r.charCodeAt(++T)&1023),p+=4)}return p+=this.encode(p*8),this.update(r),p},M.prototype.bytepad=function(r,f){for(var d=this.encode(f),p=0;p<r.length;++p)d+=this.encodeString(r[p]);var h=f-d%f,T=[];return T.length=h,this.update(T),this},M.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var r=this.blocks,f=this.lastByteIndex,d=this.blockCount,p=this.s;if(r[f>>2]|=this.padding[f&3],this.lastByteIndex===this.byteCount)for(r[0]=r[d],f=1;f<d+1;++f)r[f]=0;for(r[d-1]|=2147483648,f=0;f<d;++f)p[f]^=r[f];Ue(p)}},M.prototype.toString=M.prototype.hex=function(){this.finalize();for(var r=this.blockCount,f=this.s,d=this.outputBlocks,p=this.extraBytes,h=0,T=0,b="",N;T<d;){for(h=0;h<r&&T<d;++h,++T)N=f[h],b+=g[N>>4&15]+g[N&15]+g[N>>12&15]+g[N>>8&15]+g[N>>20&15]+g[N>>16&15]+g[N>>28&15]+g[N>>24&15];T%r===0&&(Ue(f),h=0)}return p&&(N=f[h],b+=g[N>>4&15]+g[N&15],p>1&&(b+=g[N>>12&15]+g[N>>8&15]),p>2&&(b+=g[N>>20&15]+g[N>>16&15])),b},M.prototype.arrayBuffer=function(){this.finalize();var r=this.blockCount,f=this.s,d=this.outputBlocks,p=this.extraBytes,h=0,T=0,b=this.outputBits>>3,N;p?N=new ArrayBuffer(d+1<<2):N=new ArrayBuffer(b);for(var C=new Uint32Array(N);T<d;){for(h=0;h<r&&T<d;++h,++T)C[T]=f[h];T%r===0&&Ue(f)}return p&&(C[h]=f[h],N=N.slice(0,b)),N},M.prototype.buffer=M.prototype.arrayBuffer,M.prototype.digest=M.prototype.array=function(){this.finalize();for(var r=this.blockCount,f=this.s,d=this.outputBlocks,p=this.extraBytes,h=0,T=0,b=[],N,C;T<d;){for(h=0;h<r&&T<d;++h,++T)N=T<<2,C=f[h],b[N]=C&255,b[N+1]=C>>8&255,b[N+2]=C>>16&255,b[N+3]=C>>24&255;T%r===0&&Ue(f)}return p&&(N=T<<2,C=f[h],b[N]=C&255,p>1&&(b[N+1]=C>>8&255),p>2&&(b[N+2]=C>>16&255)),b};function _t(r,f,d){M.call(this,r,f,d)}_t.prototype=new M,_t.prototype.finalize=function(){return this.encode(this.outputBits,!0),M.prototype.finalize.call(this)};var Ue=function(r){var f,d,p,h,T,b,N,C,E,P,He,Ke,Xe,We,Ze,en,nn,tn,rn,an,on,sn,un,cn,ln,fn,dn,pn,vn,mn,hn,yn,gn,kn,Sn,Nn,Tn,bn,En,In,An,Dn,wn,On,Fn,_n,Rn,Ln,xn,Un,Pn,Vn,Bn,Mn,Cn,Gn,jn,qn,Qn,$n,Jn,zn,Yn;for(p=0;p<48;p+=2)h=r[0]^r[10]^r[20]^r[30]^r[40],T=r[1]^r[11]^r[21]^r[31]^r[41],b=r[2]^r[12]^r[22]^r[32]^r[42],N=r[3]^r[13]^r[23]^r[33]^r[43],C=r[4]^r[14]^r[24]^r[34]^r[44],E=r[5]^r[15]^r[25]^r[35]^r[45],P=r[6]^r[16]^r[26]^r[36]^r[46],He=r[7]^r[17]^r[27]^r[37]^r[47],Ke=r[8]^r[18]^r[28]^r[38]^r[48],Xe=r[9]^r[19]^r[29]^r[39]^r[49],f=Ke^(b<<1|N>>>31),d=Xe^(N<<1|b>>>31),r[0]^=f,r[1]^=d,r[10]^=f,r[11]^=d,r[20]^=f,r[21]^=d,r[30]^=f,r[31]^=d,r[40]^=f,r[41]^=d,f=h^(C<<1|E>>>31),d=T^(E<<1|C>>>31),r[2]^=f,r[3]^=d,r[12]^=f,r[13]^=d,r[22]^=f,r[23]^=d,r[32]^=f,r[33]^=d,r[42]^=f,r[43]^=d,f=b^(P<<1|He>>>31),d=N^(He<<1|P>>>31),r[4]^=f,r[5]^=d,r[14]^=f,r[15]^=d,r[24]^=f,r[25]^=d,r[34]^=f,r[35]^=d,r[44]^=f,r[45]^=d,f=C^(Ke<<1|Xe>>>31),d=E^(Xe<<1|Ke>>>31),r[6]^=f,r[7]^=d,r[16]^=f,r[17]^=d,r[26]^=f,r[27]^=d,r[36]^=f,r[37]^=d,r[46]^=f,r[47]^=d,f=P^(h<<1|T>>>31),d=He^(T<<1|h>>>31),r[8]^=f,r[9]^=d,r[18]^=f,r[19]^=d,r[28]^=f,r[29]^=d,r[38]^=f,r[39]^=d,r[48]^=f,r[49]^=d,We=r[0],Ze=r[1],_n=r[11]<<4|r[10]>>>28,Rn=r[10]<<4|r[11]>>>28,pn=r[20]<<3|r[21]>>>29,vn=r[21]<<3|r[20]>>>29,$n=r[31]<<9|r[30]>>>23,Jn=r[30]<<9|r[31]>>>23,Dn=r[40]<<18|r[41]>>>14,wn=r[41]<<18|r[40]>>>14,kn=r[2]<<1|r[3]>>>31,Sn=r[3]<<1|r[2]>>>31,en=r[13]<<12|r[12]>>>20,nn=r[12]<<12|r[13]>>>20,Ln=r[22]<<10|r[23]>>>22,xn=r[23]<<10|r[22]>>>22,mn=r[33]<<13|r[32]>>>19,hn=r[32]<<13|r[33]>>>19,zn=r[42]<<2|r[43]>>>30,Yn=r[43]<<2|r[42]>>>30,Mn=r[5]<<30|r[4]>>>2,Cn=r[4]<<30|r[5]>>>2,Nn=r[14]<<6|r[15]>>>26,Tn=r[15]<<6|r[14]>>>26,tn=r[25]<<11|r[24]>>>21,rn=r[24]<<11|r[25]>>>21,Un=r[34]<<15|r[35]>>>17,Pn=r[35]<<15|r[34]>>>17,yn=r[45]<<29|r[44]>>>3,gn=r[44]<<29|r[45]>>>3,cn=r[6]<<28|r[7]>>>4,ln=r[7]<<28|r[6]>>>4,Gn=r[17]<<23|r[16]>>>9,jn=r[16]<<23|r[17]>>>9,bn=r[26]<<25|r[27]>>>7,En=r[27]<<25|r[26]>>>7,an=r[36]<<21|r[37]>>>11,on=r[37]<<21|r[36]>>>11,Vn=r[47]<<24|r[46]>>>8,Bn=r[46]<<24|r[47]>>>8,On=r[8]<<27|r[9]>>>5,Fn=r[9]<<27|r[8]>>>5,fn=r[18]<<20|r[19]>>>12,dn=r[19]<<20|r[18]>>>12,qn=r[29]<<7|r[28]>>>25,Qn=r[28]<<7|r[29]>>>25,In=r[38]<<8|r[39]>>>24,An=r[39]<<8|r[38]>>>24,sn=r[48]<<14|r[49]>>>18,un=r[49]<<14|r[48]>>>18,r[0]=We^~en&tn,r[1]=Ze^~nn&rn,r[10]=cn^~fn&pn,r[11]=ln^~dn&vn,r[20]=kn^~Nn&bn,r[21]=Sn^~Tn&En,r[30]=On^~_n&Ln,r[31]=Fn^~Rn&xn,r[40]=Mn^~Gn&qn,r[41]=Cn^~jn&Qn,r[2]=en^~tn&an,r[3]=nn^~rn&on,r[12]=fn^~pn&mn,r[13]=dn^~vn&hn,r[22]=Nn^~bn&In,r[23]=Tn^~En&An,r[32]=_n^~Ln&Un,r[33]=Rn^~xn&Pn,r[42]=Gn^~qn&$n,r[43]=jn^~Qn&Jn,r[4]=tn^~an&sn,r[5]=rn^~on&un,r[14]=pn^~mn&yn,r[15]=vn^~hn&gn,r[24]=bn^~In&Dn,r[25]=En^~An&wn,r[34]=Ln^~Un&Vn,r[35]=xn^~Pn&Bn,r[44]=qn^~$n&zn,r[45]=Qn^~Jn&Yn,r[6]=an^~sn&We,r[7]=on^~un&Ze,r[16]=mn^~yn&cn,r[17]=hn^~gn&ln,r[26]=In^~Dn&kn,r[27]=An^~wn&Sn,r[36]=Un^~Vn&On,r[37]=Pn^~Bn&Fn,r[46]=$n^~zn&Mn,r[47]=Jn^~Yn&Cn,r[8]=sn^~We&en,r[9]=un^~Ze&nn,r[18]=yn^~cn&fn,r[19]=gn^~ln&dn,r[28]=Dn^~kn&Nn,r[29]=wn^~Sn&Tn,r[38]=Vn^~On&_n,r[39]=Bn^~Fn&Rn,r[48]=zn^~Mn&Gn,r[49]=Yn^~Cn&jn,r[0]^=F[p],r[1]^=F[p+1]};if(c)t.exports=ae;else{for(ce=0;ce<Le.length;++ce)o[Le[ce]]=ae[Le[ce]];l&&define(function(){return ae})}})()}}),vo=li({"optimize-deps:js-sha3"(e,t){t.exports=po()}}),mo=vo();/*! Bundled license information:
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
(
|
|
168
|
-
|
|
169
|
-
*
|
|
170
|
-
* @version 0.8.0
|
|
171
|
-
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
172
|
-
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
173
|
-
* @license MIT
|
|
174
|
-
*)
|
|
175
|
-
*/function ho(e,t=!1){if(!/^0x[0-9a-fA-F]{40}$/.test(e))return!1;if(t){const n=e.substring(2),i=mo.keccak256.hex(n.toLowerCase());for(let a=0;a<40;a++){const o=n.charAt(a),u=parseInt(i.charAt(a),16);if(u>7&&o.toUpperCase()!==o||u<=7&&o.toLowerCase()!==o)return!1}}return!0}class yo{client;constructor(t){this.client=t}async create(t){return(await this.client.query({query:_e,variables:{createDirectPaymentInput:{...t,provider:Xt.CHECKBOOK}}}))?.createDirectPayment}async getWeb3PaymentParams(t,n=!1){if(!ho(t.paymentTokenAddress,n))throw new Error("Invalid token address");return(await this.client.query({query:bt,variables:{amount:fo(t.amount),network:t.network,tokenAddress:t.paymentTokenAddress,reference:t.paymentRequestId}}))?.spritzPayParams}}var It={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"UserFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sub"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"picture"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timezone"},arguments:[],directives:[]}]}}],loc:{start:0,end:135}};It.loc.source={body:`fragment UserFragment on User {
|
|
189
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function gn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){gn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){gn(i,n)}),e.definitions&&e.definitions.forEach(function(i){gn(i,n)})}var Wn={};(function(){yn.definitions.forEach(function(n){if(n.name){var t=new Set;gn(n,t),Wn[n.name.value]=t}})})();function hi(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function ga(e,n){var t={kind:e.kind,definitions:[hi(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=Wn[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=Wn[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=hi(e,o);s&&t.definitions.push(s)}),t}ga(yn,"GetSpritzPayParams");var yi=Z({"node_modules/@noble/hashes/_assert.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.output=e.exists=e.hash=e.bytes=e.bool=e.number=void 0;function n(s){if(!Number.isSafeInteger(s)||s<0)throw new Error(`Wrong positive integer: ${s}`)}e.number=n;function t(s){if(typeof s!="boolean")throw new Error(`Expected boolean, not ${s}`)}e.bool=t;function i(s,...l){if(!(s instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length>0&&!l.includes(s.length))throw new TypeError(`Expected Uint8Array of length ${l}, not of length=${s.length}`)}e.bytes=i;function r(s){if(typeof s!="function"||typeof s.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");n(s.outputLen),n(s.blockLen)}e.hash=r;function a(s,l=!0){if(s.destroyed)throw new Error("Hash instance has been destroyed");if(l&&s.finished)throw new Error("Hash#digest() has already been called")}e.exists=a;function u(s,l){i(s);const g=l.outputLen;if(s.length<g)throw new Error(`digestInto() expects output buffer of length at least ${g}`)}e.output=u;var o={number:n,bool:t,bytes:i,hash:r,exists:a,output:u};e.default=o}}),ka=Z({"node_modules/@noble/hashes/crypto.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=void 0,e.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0}}),Zn=Z({"node_modules/@noble/hashes/utils.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.randomBytes=e.wrapConstructorWithOpts=e.wrapConstructor=e.checkOpts=e.Hash=e.concatBytes=e.toBytes=e.utf8ToBytes=e.asyncLoop=e.nextTick=e.hexToBytes=e.bytesToHex=e.isLE=e.rotr=e.createView=e.u32=e.u8=void 0;var n=ka(),t=f=>new Uint8Array(f.buffer,f.byteOffset,f.byteLength);e.u8=t;var i=f=>new Uint32Array(f.buffer,f.byteOffset,Math.floor(f.byteLength/4));e.u32=i;var r=f=>new DataView(f.buffer,f.byteOffset,f.byteLength);e.createView=r;var a=(f,c)=>f<<32-c|f>>>c;if(e.rotr=a,e.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,!e.isLE)throw new Error("Non little-endian hardware is not supported");var u=Array.from({length:256},(f,c)=>c.toString(16).padStart(2,"0"));function o(f){if(!(f instanceof Uint8Array))throw new Error("Uint8Array expected");let c="";for(let S=0;S<f.length;S++)c+=u[f[S]];return c}e.bytesToHex=o;function s(f){if(typeof f!="string")throw new TypeError("hexToBytes: expected string, got "+typeof f);if(f.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const c=new Uint8Array(f.length/2);for(let S=0;S<c.length;S++){const v=S*2,b=f.slice(v,v+2),A=Number.parseInt(b,16);if(Number.isNaN(A)||A<0)throw new Error("Invalid byte sequence");c[S]=A}return c}e.hexToBytes=s;var l=async()=>{};e.nextTick=l;async function g(f,c,S){let v=Date.now();for(let b=0;b<f;b++){S(b);const A=Date.now()-v;A>=0&&A<c||(await(0,e.nextTick)(),v+=A)}}e.asyncLoop=g;function E(f){if(typeof f!="string")throw new TypeError(`utf8ToBytes expected string, got ${typeof f}`);return new TextEncoder().encode(f)}e.utf8ToBytes=E;function y(f){if(typeof f=="string"&&(f=E(f)),!(f instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof f})`);return f}e.toBytes=y;function d(...f){if(!f.every(v=>v instanceof Uint8Array))throw new Error("Uint8Array list expected");if(f.length===1)return f[0];const c=f.reduce((v,b)=>v+b.length,0),S=new Uint8Array(c);for(let v=0,b=0;v<f.length;v++){const A=f[v];S.set(A,b),b+=A.length}return S}e.concatBytes=d;var N=class{clone(){return this._cloneInto()}};e.Hash=N;var w=f=>Object.prototype.toString.call(f)==="[object Object]"&&f.constructor===Object;function O(f,c){if(c!==void 0&&(typeof c!="object"||!w(c)))throw new TypeError("Options should be object or undefined");return Object.assign(f,c)}e.checkOpts=O;function D(f){const c=v=>f().update(y(v)).digest(),S=f();return c.outputLen=S.outputLen,c.blockLen=S.blockLen,c.create=()=>f(),c}e.wrapConstructor=D;function P(f){const c=(v,b)=>f(b).update(y(v)).digest(),S=f({});return c.outputLen=S.outputLen,c.blockLen=S.blockLen,c.create=v=>f(v),c}e.wrapConstructorWithOpts=P;function L(f=32){if(n.crypto&&typeof n.crypto.getRandomValues=="function")return n.crypto.getRandomValues(new Uint8Array(f));throw new Error("crypto.getRandomValues must be defined")}e.randomBytes=L}}),gi=Z({"node_modules/ethereum-cryptography/utils.js"(e,n){var t=e&&e.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(e,"__esModule",{value:!0}),e.crypto=e.wrapHash=e.equalsBytes=e.hexToBytes=e.bytesToUtf8=e.utf8ToBytes=e.createView=e.concatBytes=e.toHex=e.bytesToHex=e.assertBytes=e.assertBool=void 0;var i=t(yi()),r=Zn(),a=i.default.bool;e.assertBool=a;var u=i.default.bytes;e.assertBytes=u;var o=Zn();Object.defineProperty(e,"bytesToHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(e,"toHex",{enumerable:!0,get:function(){return o.bytesToHex}}),Object.defineProperty(e,"concatBytes",{enumerable:!0,get:function(){return o.concatBytes}}),Object.defineProperty(e,"createView",{enumerable:!0,get:function(){return o.createView}}),Object.defineProperty(e,"utf8ToBytes",{enumerable:!0,get:function(){return o.utf8ToBytes}});function s(y){if(!(y instanceof Uint8Array))throw new TypeError(`bytesToUtf8 expected Uint8Array, got ${typeof y}`);return new TextDecoder().decode(y)}e.bytesToUtf8=s;function l(y){const d=y.startsWith("0x")?y.substring(2):y;return(0,r.hexToBytes)(d)}e.hexToBytes=l;function g(y,d){if(y.length!==d.length)return!1;for(let N=0;N<y.length;N++)if(y[N]!==d[N])return!1;return!0}e.equalsBytes=g;function E(y){return d=>(i.default.bytes(d),y(d))}e.wrapHash=E,e.crypto=(()=>{const y=typeof self=="object"&&"crypto"in self?self.crypto:void 0,d=typeof n<"u"&&typeof n.require=="function"&&n.require.bind(n);return{node:d&&!y?d("crypto"):void 0,web:y}})()}});/*! Bundled license information:
|
|
190
|
+
|
|
191
|
+
@noble/hashes/utils.js:
|
|
192
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
193
|
+
*/var Sa=Z({"node_modules/@noble/hashes/_u64.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.add=e.toBig=e.split=e.fromBig=void 0;var n=BigInt(2**32-1),t=BigInt(32);function i(m,p=!1){return p?{h:Number(m&n),l:Number(m>>t&n)}:{h:Number(m>>t&n)|0,l:Number(m&n)|0}}e.fromBig=i;function r(m,p=!1){let T=new Uint32Array(m.length),M=new Uint32Array(m.length);for(let x=0;x<m.length;x++){const{h:J,l:En}=i(m[x],p);[T[x],M[x]]=[J,En]}return[T,M]}e.split=r;var a=(m,p)=>BigInt(m>>>0)<<t|BigInt(p>>>0);e.toBig=a;var u=(m,p,T)=>m>>>T,o=(m,p,T)=>m<<32-T|p>>>T,s=(m,p,T)=>m>>>T|p<<32-T,l=(m,p,T)=>m<<32-T|p>>>T,g=(m,p,T)=>m<<64-T|p>>>T-32,E=(m,p,T)=>m>>>T-32|p<<64-T,y=(m,p)=>p,d=(m,p)=>m,N=(m,p,T)=>m<<T|p>>>32-T,w=(m,p,T)=>p<<T|m>>>32-T,O=(m,p,T)=>p<<T-32|m>>>64-T,D=(m,p,T)=>m<<T-32|p>>>64-T;function P(m,p,T,M){const x=(p>>>0)+(M>>>0);return{h:m+T+(x/2**32|0)|0,l:x|0}}e.add=P;var L=(m,p,T)=>(m>>>0)+(p>>>0)+(T>>>0),f=(m,p,T,M)=>p+T+M+(m/2**32|0)|0,c=(m,p,T,M)=>(m>>>0)+(p>>>0)+(T>>>0)+(M>>>0),S=(m,p,T,M,x)=>p+T+M+x+(m/2**32|0)|0,v=(m,p,T,M,x)=>(m>>>0)+(p>>>0)+(T>>>0)+(M>>>0)+(x>>>0),b=(m,p,T,M,x,J)=>p+T+M+x+J+(m/2**32|0)|0,A={fromBig:i,split:r,toBig:e.toBig,shrSH:u,shrSL:o,rotrSH:s,rotrSL:l,rotrBH:g,rotrBL:E,rotr32H:y,rotr32L:d,rotlSH:N,rotlSL:w,rotlBH:O,rotlBL:D,add:P,add3L:L,add3H:f,add4L:c,add4H:S,add5H:b,add5L:v};e.default=A}}),Ta=Z({"node_modules/@noble/hashes/sha3.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.shake256=e.shake128=e.keccak_512=e.keccak_384=e.keccak_256=e.keccak_224=e.sha3_512=e.sha3_384=e.sha3_256=e.sha3_224=e.Keccak=e.keccakP=void 0;var n=yi(),t=Sa(),i=Zn(),[r,a,u]=[[],[],[]],o=BigInt(0),s=BigInt(1),l=BigInt(2),g=BigInt(7),E=BigInt(256),y=BigInt(113);for(let c=0,S=s,v=1,b=0;c<24;c++){[v,b]=[b,(2*v+3*b)%5],r.push(2*(5*b+v)),a.push((c+1)*(c+2)/2%64);let A=o;for(let m=0;m<7;m++)S=(S<<s^(S>>g)*y)%E,S&l&&(A^=s<<(s<<BigInt(m))-s);u.push(A)}var[d,N]=t.default.split(u,!0),w=(c,S,v)=>v>32?t.default.rotlBH(c,S,v):t.default.rotlSH(c,S,v),O=(c,S,v)=>v>32?t.default.rotlBL(c,S,v):t.default.rotlSL(c,S,v);function D(c,S=24){const v=new Uint32Array(10);for(let b=24-S;b<24;b++){for(let p=0;p<10;p++)v[p]=c[p]^c[p+10]^c[p+20]^c[p+30]^c[p+40];for(let p=0;p<10;p+=2){const T=(p+8)%10,M=(p+2)%10,x=v[M],J=v[M+1],En=w(x,J,1)^v[T],wi=O(x,J,1)^v[T+1];for(let Me=0;Me<50;Me+=10)c[p+Me]^=En,c[p+Me+1]^=wi}let A=c[2],m=c[3];for(let p=0;p<24;p++){const T=a[p],M=w(A,m,T),x=O(A,m,T),J=r[p];A=c[J],m=c[J+1],c[J]=M,c[J+1]=x}for(let p=0;p<50;p+=10){for(let T=0;T<10;T++)v[T]=c[p+T];for(let T=0;T<10;T++)c[p+T]^=~v[(T+2)%10]&v[(T+4)%10]}c[0]^=d[b],c[1]^=N[b]}v.fill(0)}e.keccakP=D;var P=class extends i.Hash{constructor(c,S,v,b=!1,A=24){if(super(),this.blockLen=c,this.suffix=S,this.outputLen=v,this.enableXOF=b,this.rounds=A,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,n.default.number(v),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}keccak(){D(this.state32,this.rounds),this.posOut=0,this.pos=0}update(c){n.default.exists(this);const{blockLen:S,state:v}=this;c=(0,i.toBytes)(c);const b=c.length;for(let A=0;A<b;){const m=Math.min(S-this.pos,b-A);for(let p=0;p<m;p++)v[this.pos++]^=c[A++];this.pos===S&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:c,suffix:S,pos:v,blockLen:b}=this;c[v]^=S,S&128&&v===b-1&&this.keccak(),c[b-1]^=128,this.keccak()}writeInto(c){n.default.exists(this,!1),n.default.bytes(c),this.finish();const S=this.state,{blockLen:v}=this;for(let b=0,A=c.length;b<A;){this.posOut>=v&&this.keccak();const m=Math.min(v-this.posOut,A-b);c.set(S.subarray(this.posOut,this.posOut+m),b),this.posOut+=m,b+=m}return c}xofInto(c){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(c)}xof(c){return n.default.number(c),this.xofInto(new Uint8Array(c))}digestInto(c){if(n.default.output(c,this),this.finished)throw new Error("digest() was already called");return this.writeInto(c),this.destroy(),c}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(c){const{blockLen:S,suffix:v,outputLen:b,rounds:A,enableXOF:m}=this;return c||(c=new P(S,v,b,m,A)),c.state32.set(this.state32),c.pos=this.pos,c.posOut=this.posOut,c.finished=this.finished,c.rounds=A,c.suffix=v,c.outputLen=b,c.enableXOF=m,c.destroyed=this.destroyed,c}};e.Keccak=P;var L=(c,S,v)=>(0,i.wrapConstructor)(()=>new P(S,c,v));e.sha3_224=L(6,144,224/8),e.sha3_256=L(6,136,256/8),e.sha3_384=L(6,104,384/8),e.sha3_512=L(6,72,512/8),e.keccak_224=L(1,144,224/8),e.keccak_256=L(1,136,256/8),e.keccak_384=L(1,104,384/8),e.keccak_512=L(1,72,512/8);var f=(c,S,v)=>(0,i.wrapConstructorWithOpts)((b={})=>new P(S,c,b.dkLen===void 0?v:b.dkLen,!0));e.shake128=f(31,168,128/8),e.shake256=f(31,136,256/8)}}),Na=Z({"node_modules/ethereum-cryptography/keccak.js"(e){Object.defineProperty(e,"__esModule",{value:!0}),e.keccak512=e.keccak384=e.keccak256=e.keccak224=void 0;var n=Ta(),t=gi();e.keccak224=(0,t.wrapHash)(n.keccak_224),e.keccak256=(()=>{const i=(0,t.wrapHash)(n.keccak_256);return i.create=n.keccak_256.create,i})(),e.keccak384=(0,t.wrapHash)(n.keccak_384),e.keccak512=(0,t.wrapHash)(n.keccak_512)}}),ba=Z({"optimize-deps:ethereum-cryptography/keccak"(e,n){n.exports=Na()}}),Ea=ba(),Ia=Z({"optimize-deps:ethereum-cryptography/utils"(e,n){n.exports=gi()}}),wa=Ia();function Aa(e){let n="0x";for(const t of e){const i=t.toString(16);n+=i.length===1?`0${i}`:i}return n}const Da=e=>{if(!/^(0x)?[0-9a-f]{40}$/i.test(e))return!1;const n=e.slice(2),t=wa.utf8ToBytes(n.toLowerCase()),i=Aa(Ea.keccak256(t)).slice(2);for(let r=0;r<40;r+=1)if(parseInt(i[r],16)>7&&n[r].toUpperCase()!==n[r]||parseInt(i[r],16)<=7&&n[r].toLowerCase()!==n[r])return!1;return!0};function Oa(e){return/^0x[0-9a-f]{40}$/i.test(e)?/^0x[0-9a-f]{40}$/.test(e)||/^(0x|0X)[0-9A-F]{40}$/.test(e)?!0:Da(e):!1}const et=e=>Math.round((e+Number.EPSILON)*100)/100;class _a{client;constructor(n){this.client=n}async create(n){return(await this.client.query({query:le,variables:{createDirectPaymentInput:{...n,amount:et(n.amount),provider:Qn.CHECKBOOK}}}))?.createDirectPayment}async transactionPrice(n){return(await this.client.query({query:le,variables:{amount:et(n)}}))?.transactionPrice??0}async getWeb3PaymentParams(n){if(!Oa(n.paymentTokenAddress))throw new Error("Invalid token address");return(await this.client.query({query:yn,variables:{amount:et(n.paymentRequest.amountDue),network:n.paymentRequest.network,tokenAddress:n.paymentTokenAddress,reference:n.paymentRequest.id}}))?.spritzPayParams}}var kn={kind:"Document",definitions:[{kind:"FragmentDefinition",name:{kind:"Name",value:"UserFragment"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"User"}},directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"sub"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"picture"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"phone"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"createdAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"timezone"},arguments:[],directives:[]}]}}],loc:{start:0,end:135}};kn.loc.source={body:`fragment UserFragment on User {
|
|
176
194
|
id
|
|
177
195
|
sub
|
|
178
196
|
email
|
|
@@ -183,14 +201,14 @@ js-sha3/src/sha3.js:
|
|
|
183
201
|
createdAt
|
|
184
202
|
timezone
|
|
185
203
|
}
|
|
186
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function
|
|
204
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function Sn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Sn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Sn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Sn(i,n)})}var nt={};(function(){kn.definitions.forEach(function(n){if(n.name){var t=new Set;Sn(n,t),nt[n.name.value]=t}})})();function ki(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Fa(e,n){var t={kind:e.kind,definitions:[ki(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=nt[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=nt[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=ki(e,o);s&&t.definitions.push(s)}),t}Fa(kn,"UserFragment");var Ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"CurrentUser"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"me"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"UserFragment"},directives:[]}]}}]}}],loc:{start:0,end:95}};Ie.loc.source={body:`#import "./userFragment.graphql"
|
|
187
205
|
|
|
188
206
|
query CurrentUser {
|
|
189
207
|
me {
|
|
190
208
|
...UserFragment
|
|
191
209
|
}
|
|
192
210
|
}
|
|
193
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var
|
|
211
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};var Si={};function La(e){return e.filter(function(n){if(n.kind!=="FragmentDefinition")return!0;var t=n.name.value;return Si[t]?!1:(Si[t]=!0,!0)})}Ie.definitions=Ie.definitions.concat(La(kn.definitions));function Tn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){Tn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){Tn(i,n)}),e.definitions&&e.definitions.forEach(function(i){Tn(i,n)})}var tt={};(function(){Ie.definitions.forEach(function(n){if(n.name){var t=new Set;Tn(n,t),tt[n.name.value]=t}})})();function Ti(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Ra(e,n){var t={kind:e.kind,definitions:[Ti(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=tt[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=tt[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=Ti(e,o);s&&t.definitions.push(s)}),t}Ra(Ie,"CurrentUser");var Nn={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"UserVerification"},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"verification"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"userId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"identity"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"status"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"country"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"verificationUrl"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"user"},arguments:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"firstName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"lastName"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"email"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"completedAt"},arguments:[],directives:[]}]}}]}}]}}]}}],loc:{start:0,end:297}};Nn.loc.source={body:`query UserVerification {
|
|
194
212
|
verification {
|
|
195
213
|
userId
|
|
196
214
|
identity {
|
|
@@ -206,5 +224,5 @@ query CurrentUser {
|
|
|
206
224
|
}
|
|
207
225
|
}
|
|
208
226
|
}
|
|
209
|
-
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function
|
|
227
|
+
`,name:"GraphQL request",locationOffset:{line:1,column:1}};function bn(e,n){if(e.kind==="FragmentSpread")n.add(e.name.value);else if(e.kind==="VariableDefinition"){var t=e.type;t.kind==="NamedType"&&n.add(t.name.value)}e.selectionSet&&e.selectionSet.selections.forEach(function(i){bn(i,n)}),e.variableDefinitions&&e.variableDefinitions.forEach(function(i){bn(i,n)}),e.definitions&&e.definitions.forEach(function(i){bn(i,n)})}var it={};(function(){Nn.definitions.forEach(function(n){if(n.name){var t=new Set;bn(n,t),it[n.name.value]=t}})})();function Ni(e,n){for(var t=0;t<e.definitions.length;t++){var i=e.definitions[t];if(i.name&&i.name.value==n)return i}}function Pa(e,n){var t={kind:e.kind,definitions:[Ni(e,n)]};e.hasOwnProperty("loc")&&(t.loc=e.loc);var i=it[n]||new Set,r=new Set,a=new Set;for(i.forEach(function(o){a.add(o)});a.size>0;){var u=a;a=new Set,u.forEach(function(o){if(!r.has(o)){r.add(o);var s=it[o]||new Set;s.forEach(function(l){a.add(l)})}})}return r.forEach(function(o){var s=Ni(e,o);s&&t.definitions.push(s)}),t}Pa(Nn,"UserVerification");class Ua{client;constructor(n){this.client=n}async getCurrentUser(){return(await this.client.query({query:Ie}))?.me??null}async getUserVerification(){return(await this.client.query({query:Nn}))?.verification??null}}class rt{client;user;bankAccount;paymentRequest;payment;static initialize({environment:n,apiKey:t,integrationKey:i}){const r=new rt;return r.init(n,t,i),r}init(n,t,i){this.client=new Yr(n,t,i),this.user=new Ua(this.client),this.bankAccount=new ua(this.client),this.paymentRequest=new _a(this.client),this.payment=new pa(this.client)}}var bi=(e=>(e.Staging="staging",e.Production="production",e))(bi||{}),Ei=(e=>(e.Ethereum="ethereum",e.Polygon="polygon",e.Optimism="optimism",e.Arbitrum="arbitrum",e.Binance="binance-smart-chain",e.Avalanche="avalanche",e.Bitcoin="bitcoin",e.BitcoinTestnet="bitcoin-testnet",e.Dash="dash",e.DashTestnet="dash-testnet",e))(Ei||{});exports.AccountProvider=Qn,exports.BankAccountSubType=ii,exports.BankAccountType=Jn,exports.DirectPaymentStatus=ri,exports.Environment=bi,exports.ModuleStatus=ai,exports.PayableAccountType=oi,exports.PaymentNetwork=Ei,exports.PaymentStatus=si,exports.SpritzApiClient=rt;
|
|
210
228
|
//# sourceMappingURL=spritz-api-client.js.map
|