@betarena/ad-engine 0.0.10 → 0.0.12
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/dist/index.js +282 -9
- package/package.json +8 -2
- package/src/lib/Widget-AdEngine.svelte +42 -23
- package/src/lib/Widget-AdGeneral.svelte +7 -2
- package/src/lib/Widget-AdvertSlide.svelte +7 -2
- package/src/lib/constants/instance.ts +2 -2
- package/src/lib/store.ts +1 -1
- package/vite.config.ts +7 -6
package/dist/index.js
CHANGED
|
@@ -1,11 +1,284 @@
|
|
|
1
|
-
var
|
|
2
|
-
`;for(let
|
|
3
|
-
`}const c
|
|
4
|
-
}`,p=`__svelte_${ht(c)}_${f}`,g=Fe(e),{stylesheet:m,rules:y}=fe.get(g)||pt(g,e);y[p]||(y[p]=!0,m.insertRule(`@keyframes ${p} ${c}`,m.cssRules.length));const _=e.style.animation||"";return e.style.animation=`${_?`${_}, `:""}${p} ${n}ms linear ${i}ms 1 both`,ue+=1,p}function be(e,t){const r=(e.style.animation||"").split(", "),n=r.filter(t?o=>o.indexOf(t)<0:o=>o.indexOf("__svelte")===-1),i=r.length-n.length;i&&(e.style.animation=n.join(", "),ue-=i,ue||yt())}function yt(){Te(()=>{ue||(fe.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&I(t)}),fe.clear())})}let oe;function re(e){oe=e}function mt(){if(!oe)throw new Error("Function called outside component initialization");return oe}function Ve(e){mt().$$.on_mount.push(e)}const G=[],Ie=[];let J=[];const De=[],_t=Promise.resolve();let we=!1;function gt(){we||(we=!0,_t.then(Ge))}function M(e){J.push(e)}const _e=new Set;let H=0;function Ge(){if(H!==0)return;const e=oe;do{try{for(;H<G.length;){const t=G[H];H++,re(t),bt(t.$$)}}catch(t){throw G.length=0,H=0,t}for(re(null),G.length=0,H=0;Ie.length;)Ie.pop()();for(let t=0;t<J.length;t+=1){const r=J[t];_e.has(r)||(_e.add(r),r())}J.length=0}while(G.length);for(;De.length;)De.pop()();we=!1,_e.clear(),re(e)}function bt(e){if(e.fragment!==null){e.update(),Z(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(M)}}function wt(e){const t=[],r=[];J.forEach(n=>e.indexOf(n)===-1?t.push(n):r.push(n)),r.forEach(n=>n()),J=t}let te;function We(){return te||(te=Promise.resolve(),te.then(()=>{te=null})),te}function ce(e,t,r){e.dispatchEvent(dt(`${t?"intro":"outro"}${r}`))}const le=new Set;let U;function vt(){U={r:0,c:[],p:U}}function At(){U.r||Z(U.c),U=U.p}function ne(e,t){e&&e.i&&(le.delete(e),e.i(t))}function ve(e,t,r,n){if(e&&e.o){if(le.has(e))return;le.add(e),U.c.push(()=>{le.delete(e),n&&(r&&e.d(1),n())}),e.o(t)}else n&&n()}const Je={duration:0};function Ze(e,t,r){const n={direction:"in"};let i=t(e,r,n),o=!1,a,f,h=0;function s(){a&&be(e,a)}function c(){const{delay:g=0,duration:m=300,easing:y=je,tick:_=C,css:w}=i||Je;w&&(a=He(e,0,1,m,g,y,w,h++)),_(0,1);const E=ze()+g,D=E+m;f&&f.abort(),o=!0,M(()=>ce(e,!0,"start")),f=Ne(T=>{if(o){if(T>=D)return _(1,0),ce(e,!0,"end"),s(),o=!1;if(T>=E){const b=y((T-E)/m);_(b,1-b)}}return o})}let p=!1;return{start(){p||(p=!0,be(e),he(i)?(i=i(n),We().then(c)):c())},invalidate(){p=!1},end(){o&&(s(),o=!1)}}}function Xe(e,t,r){const n={direction:"out"};let i=t(e,r,n),o=!0,a;const f=U;f.r+=1;let h;function s(){const{delay:c=0,duration:p=300,easing:g=je,tick:m=C,css:y}=i||Je;y&&(a=He(e,1,0,p,c,g,y));const _=ze()+c,w=_+p;M(()=>ce(e,!1,"start")),"inert"in e&&(h=e.inert,e.inert=!0),Ne(E=>{if(o){if(E>=w)return m(0,1),ce(e,!1,"end"),--f.r||Z(f.c),!1;if(E>=_){const D=g((E-_)/p);m(1-D,D)}}return o})}return he(i)?We().then(()=>{i=i(n),s()}):s(),{end(c){c&&"inert"in e&&(e.inert=h),c&&i.tick&&i.tick(1,0),o&&(a&&be(e,a),o=!1)}}}function Tt(e){e&&e.c()}function Ke(e,t,r){const{fragment:n,after_update:i}=e.$$;n&&n.m(t,r),M(()=>{const o=e.$$.on_mount.map(Re).filter(he);e.$$.on_destroy?e.$$.on_destroy.push(...o):Z(o),e.$$.on_mount=[]}),i.forEach(M)}function Qe(e,t){const r=e.$$;r.fragment!==null&&(wt(r.after_update),Z(r.on_destroy),r.fragment&&r.fragment.d(t),r.on_destroy=r.fragment=null,r.ctx=[])}function Et(e,t){e.$$.dirty[0]===-1&&(G.push(e),gt(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function pe(e,t,r,n,i,o,a=null,f=[-1]){const h=oe;re(e);const s=e.$$={fragment:null,ctx:[],props:o,update:C,not_equal:i,bound:Se(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(h?h.$$.context:[])),callbacks:Se(),dirty:f,skip_bound:!1,root:t.target||h.$$.root};a&&a(s.root);let c=!1;if(s.ctx=r?r(e,t.props||{},(p,g,...m)=>{const y=m.length?m[0]:g;return s.ctx&&i(s.ctx[p],s.ctx[p]=y)&&(!s.skip_bound&&s.bound[p]&&s.bound[p](y),c&&Et(e,p)),g}):[],s.update(),c=!0,Z(s.before_update),s.fragment=n?n(s.ctx):!1,t.target){if(t.hydrate){const p=ct(t.target);s.fragment&&s.fragment.l(p),p.forEach(I)}else s.fragment&&s.fragment.c();t.intro&&ne(e.$$.fragment),Ke(e,t.target,t.anchor),Ge()}re(h)}class ye{constructor(){me(this,"$$");me(this,"$$set")}$destroy(){Qe(this,1),this.$destroy=C}$on(t,r){if(!he(r))return C;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(r),()=>{const i=n.indexOf(r);i!==-1&&n.splice(i,1)}}$set(t){this.$$set&&!ot(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Bt="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Bt);const St="http://localhost:58749",V=[];function $t(e,t=C){let r;const n=new Set;function i(f){if(se(e,f)&&(e=f,r)){const h=!V.length;for(const s of n)s[1](),V.push(s,e);if(h){for(let s=0;s<V.length;s+=2)V[s][0](V[s+1]);V.length=0}}}function o(f){i(f(e))}function a(f,h=C){const s=[f,h];return n.add(s),n.size===1&&(r=t(i,o)||C),f(e),()=>{n.delete(s),n.size===0&&r&&(r(),r=null)}}return{set:i,update:o,subscribe:a}}const It={isBetarenaAdShownForToday:!1,advertDateLastShown:null};function Dt(e){const{subscribe:t,set:r,update:n}=$t(It),i={useLocalStorage:()=>{var a;let o=i.parseLocalStorage();o==null&&(o={isBetarenaAdShownForToday:!1,advertDateLastShown:null}),o.isBetarenaAdShownForToday&&((a=o.advertDateLastShown)==null?void 0:a.getDate())!=new Date().getDate()&&i.updateData([["toggleAdShownState",void 0]]),i.setLocalStorage(o)},parseLocalStorage:()=>{const o=localStorage.getItem(e);return o?JSON.parse(o):null},setLocalStorage:o=>{localStorage.setItem(e,JSON.stringify(o)),r(o)},updateData:o=>{const a=i.parseLocalStorage();if(a){for(const f of o){const h=f[0];f[1],h=="toggleAdShownState"&&(a.isBetarenaAdShownForToday=!a.isBetarenaAdShownForToday,a.isBetarenaAdShownForToday?a.advertDateLastShown=new Date:a.advertDateLastShown=null)}i.setLocalStorage(a)}}};return{subscribe:t,set:r,update:n,...i}}const Ae=Dt("betarena-ad-engine");var O=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},L={searchParams:"URLSearchParams"in O,iterable:"Symbol"in O&&"iterator"in Symbol,blob:"FileReader"in O&&"Blob"in O&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in O,arrayBuffer:"ArrayBuffer"in O};function Ot(e){return e&&DataView.prototype.isPrototypeOf(e)}if(L.arrayBuffer)var kt=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Lt=ArrayBuffer.isView||function(e){return e&&kt.indexOf(Object.prototype.toString.call(e))>-1};function X(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Ee(e){return typeof e!="string"&&(e=String(e)),e}function Be(e){var t={next:function(){var r=e.shift();return{done:r===void 0,value:r}}};return L.iterable&&(t[Symbol.iterator]=function(){return t}),t}function S(e){this.map={},e instanceof S?e.forEach(function(t,r){this.append(r,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}S.prototype.append=function(e,t){e=X(e),t=Ee(t);var r=this.map[e];this.map[e]=r?r+", "+t:t};S.prototype.delete=function(e){delete this.map[X(e)]};S.prototype.get=function(e){return e=X(e),this.has(e)?this.map[e]:null};S.prototype.has=function(e){return this.map.hasOwnProperty(X(e))};S.prototype.set=function(e,t){this.map[X(e)]=Ee(t)};S.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)};S.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),Be(e)};S.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),Be(e)};S.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),Be(e)};L.iterable&&(S.prototype[Symbol.iterator]=S.prototype.entries);function ge(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function Ye(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function Ct(e){var t=new FileReader,r=Ye(t);return t.readAsArrayBuffer(e),r}function Pt(e){var t=new FileReader,r=Ye(t),n=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=n?n[1]:"utf-8";return t.readAsText(e,i),r}function jt(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function Oe(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function et(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:L.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:L.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:L.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():L.arrayBuffer&&L.blob&&Ot(e)?(this._bodyArrayBuffer=Oe(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):L.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||Lt(e))?this._bodyArrayBuffer=Oe(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):L.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},L.blob&&(this.blob=function(){var e=ge(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=ge(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(L.blob)return this.blob().then(Ct);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=ge(this);if(e)return e;if(this._bodyBlob)return Pt(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(jt(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},L.formData&&(this.formData=function(){return this.text().then(zt)}),this.json=function(){return this.text().then(JSON.parse)},this}var Rt=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function xt(e){var t=e.toUpperCase();return Rt.indexOf(t)>-1?t:e}function q(e,t){if(!(this instanceof q))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var r=t.body;if(e instanceof q){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new S(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!r&&e._bodyInit!=null&&(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new S(t.headers)),this.method=xt(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in O){var o=new AbortController;return o.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}q.prototype.clone=function(){return new q(this,{body:this._bodyInit})};function zt(e){var t=new FormData;return e.trim().split("&").forEach(function(r){if(r){var n=r.split("="),i=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}}),t}function Ut(e){var t=new S,r=e.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
|
|
5
|
-
`)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),o=i.shift().trim();if(o){var a=i.join(":").trim();try{t.append(o,a)}catch(f){console.warn("Response "+f.message)}}}),t}et.call(q.prototype);function z(e,t){if(!(this instanceof z))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new S(t.headers),this.url=t.url||"",this._initBody(e)}et.call(z.prototype);z.prototype.clone=function(){return new z(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new S(this.headers),url:this.url})};z.error=function(){var e=new z(null,{status:200,statusText:""});return e.status=0,e.type="error",e};var Nt=[301,302,303,307,308];z.redirect=function(e,t){if(Nt.indexOf(t)===-1)throw new RangeError("Invalid status code");return new z(null,{status:t,headers:{location:e}})};var N=O.DOMException;try{new N}catch{N=function(t,r){this.message=t,this.name=r;var n=Error(t);this.stack=n.stack},N.prototype=Object.create(Error.prototype),N.prototype.constructor=N}function tt(e,t){return new Promise(function(r,n){var i=new q(e,t);if(i.signal&&i.signal.aborted)return n(new N("Aborted","AbortError"));var o=new XMLHttpRequest;function a(){o.abort()}o.onload=function(){var s={statusText:o.statusText,headers:Ut(o.getAllResponseHeaders()||"")};i.url.startsWith("file://")&&(o.status<200||o.status>599)?s.status=200:s.status=o.status,s.url="responseURL"in o?o.responseURL:s.headers.get("X-Request-URL");var c="response"in o?o.response:o.responseText;setTimeout(function(){r(new z(c,s))},0)},o.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},o.onabort=function(){setTimeout(function(){n(new N("Aborted","AbortError"))},0)};function f(s){try{return s===""&&O.location.href?O.location.href:s}catch{return s}}if(o.open(i.method,f(i.url),!0),i.credentials==="include"?o.withCredentials=!0:i.credentials==="omit"&&(o.withCredentials=!1),"responseType"in o&&(L.blob?o.responseType="blob":L.arrayBuffer&&(o.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof S||O.Headers&&t.headers instanceof O.Headers)){var h=[];Object.getOwnPropertyNames(t.headers).forEach(function(s){h.push(X(s)),o.setRequestHeader(s,Ee(t.headers[s]))}),i.headers.forEach(function(s,c){h.indexOf(c)===-1&&o.setRequestHeader(c,s)})}else i.headers.forEach(function(s,c){o.setRequestHeader(c,s)});i.signal&&(i.signal.addEventListener("abort",a),o.onreadystatechange=function(){o.readyState===4&&i.signal.removeEventListener("abort",a)}),o.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}tt.polyfill=!0;O.fetch||(O.fetch=tt,O.Headers=S,O.Request=q,O.Response=z);self.fetch.bind(self);const Ft=async(e,t)=>{try{return await e()}catch(r){return t!=null?t(r):(console.error(`🚏 checkpoint ➤ tryCatchAsync(..) error :: ❌ ${JSON.stringify(r)}`),null)}};async function Mt(e,t){return console.log("path",e),console.log("data",t),await Ft(async()=>{const r=await fetch(e,{method:"POST",credentials:"include",body:JSON.stringify(t),mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json"}}),n=await r.json();if(!r.ok)throw new Error(JSON.stringify(n)??"network response was not ok");return n},r=>(console.error(`💀 Unhandled :: ${r}`),{error:!0,errorLogs:r}))}function ke(){const e=navigator.userAgent.toLowerCase(),t=e.includes("mobile"),r=/tablet|ipad/.test(e);return t?"mobile":r?"tablet":"desktop"}async function qt(){return await(await fetch("https://get.geojs.io/v1/ip/geo.json",{method:"GET"})).json()}function Ht(e){const t=e-1;return t*t*t+1}function de(e,{delay:t=0,duration:r=400,easing:n=Ht,x:i=0,y:o=0,opacity:a=0}={}){const f=getComputedStyle(e),h=+f.opacity,s=f.transform==="none"?"":f.transform,c=h*(1-a),[p,g]=$e(i),[m,y]=$e(o);return{delay:t,duration:r,easing:n,css:(_,w)=>`
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
var Ta=Object.defineProperty;var ba=(e,t,n)=>t in e?Ta(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var yr=(e,t,n)=>(ba(e,typeof t!="symbol"?t+"":t,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function $e(){}const ls=e=>e;function fs(e){return e()}function Si(){return Object.create(null)}function jt(e){e.forEach(fs)}function Wn(e){return typeof e=="function"}function hn(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let On;function Xe(e,t){return e===t?!0:(On||(On=document.createElement("a")),On.href=t,e===On.href)}function _a(e){return Object.keys(e).length===0}function Na(e,...t){if(e==null){for(const r of t)r(void 0);return $e}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Ia(e,t,n){e.$$.on_destroy.push(Na(t,n))}function Ri(e){const t=typeof e=="string"&&e.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return t?[parseFloat(t[1]),t[2]||"px"]:[e,"px"]}const ds=typeof window<"u";let ps=ds?()=>window.performance.now():()=>Date.now(),Pr=ds?e=>requestAnimationFrame(e):$e;const Lt=new Set;function hs(e){Lt.forEach(t=>{t.c(e)||(Lt.delete(t),t.f())}),Lt.size!==0&&Pr(hs)}function ms(e){let t;return Lt.size===0&&Pr(hs),{promise:new Promise(n=>{Lt.add(t={c:e,f:n})}),abort(){Lt.delete(t)}}}function ue(e,t){e.appendChild(t)}function ys(e){if(!e)return document;const t=e.getRootNode?e.getRootNode():e.ownerDocument;return t&&t.host?t:e.ownerDocument}function wa(e){const t=ce("style");return t.textContent="/* empty */",Oa(ys(e),t),t.sheet}function Oa(e,t){return ue(e.head||e,t),t.sheet}function Se(e,t,n){e.insertBefore(t,n||null)}function Ie(e){e.parentNode&&e.parentNode.removeChild(e)}function ce(e){return document.createElement(e)}function bt(e){return document.createTextNode(e)}function He(){return bt(" ")}function Da(){return bt("")}function vs(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function V(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Aa(e){return Array.from(e.childNodes)}function on(e,t){t=""+t,e.data!==t&&(e.data=t)}function Mn(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,r?"important":"")}function Sa(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}const Vn=new Map;let Pn=0;function Ra(e){let t=5381,n=e.length;for(;n--;)t=(t<<5)-t^e.charCodeAt(n);return t>>>0}function La(e,t){const n={stylesheet:wa(t),rules:{}};return Vn.set(e,n),n}function Es(e,t,n,r,i,s,o,a=0){const u=16.666/r;let c=`{
|
|
2
|
+
`;for(let M=0;M<=1;M+=u){const j=t+(n-t)*s(M);c+=M*100+`%{${o(j,1-j)}}
|
|
3
|
+
`}const f=c+`100% {${o(n,1-n)}}
|
|
4
|
+
}`,d=`__svelte_${Ra(f)}_${a}`,p=ys(e),{stylesheet:y,rules:E}=Vn.get(p)||La(p,e);E[d]||(E[d]=!0,y.insertRule(`@keyframes ${d} ${f}`,y.cssRules.length));const x=e.style.animation||"";return e.style.animation=`${x?`${x}, `:""}${d} ${r}ms linear ${i}ms 1 both`,Pn+=1,d}function Ir(e,t){const n=(e.style.animation||"").split(", "),r=n.filter(t?s=>s.indexOf(t)<0:s=>s.indexOf("__svelte")===-1),i=n.length-r.length;i&&(e.style.animation=r.join(", "),Pn-=i,Pn||ka())}function ka(){Pr(()=>{Pn||(Vn.forEach(e=>{const{ownerNode:t}=e.stylesheet;t&&Ie(t)}),Vn.clear())})}let an;function tn(e){an=e}function Fa(){if(!an)throw new Error("Function called outside component initialization");return an}function gs(e){Fa().$$.on_mount.push(e)}const St=[],Li=[];let kt=[];const ki=[],$a=Promise.resolve();let wr=!1;function xa(){wr||(wr=!0,$a.then(Ts))}function _t(e){kt.push(e)}const vr=new Set;let Dt=0;function Ts(){if(Dt!==0)return;const e=an;do{try{for(;Dt<St.length;){const t=St[Dt];Dt++,tn(t),Ca(t.$$)}}catch(t){throw St.length=0,Dt=0,t}for(tn(null),St.length=0,Dt=0;Li.length;)Li.pop()();for(let t=0;t<kt.length;t+=1){const n=kt[t];vr.has(n)||(vr.add(n),n())}kt.length=0}while(St.length);for(;ki.length;)ki.pop()();wr=!1,vr.clear(),tn(e)}function Ca(e){if(e.fragment!==null){e.update(),jt(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(_t)}}function Ma(e){const t=[],n=[];kt.forEach(r=>e.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),kt=t}let Xt;function bs(){return Xt||(Xt=Promise.resolve(),Xt.then(()=>{Xt=null})),Xt}function Un(e,t,n){e.dispatchEvent(Sa(`${t?"intro":"outro"}${n}`))}const Fn=new Set;let lt;function Va(){lt={r:0,c:[],p:lt}}function Pa(){lt.r||jt(lt.c),lt=lt.p}function nn(e,t){e&&e.i&&(Fn.delete(e),e.i(t))}function Or(e,t,n,r){if(e&&e.o){if(Fn.has(e))return;Fn.add(e),lt.c.push(()=>{Fn.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}const _s={duration:0};function Ns(e,t,n){const r={direction:"in"};let i=t(e,n,r),s=!1,o,a,u=0;function c(){o&&Ir(e,o)}function f(){const{delay:p=0,duration:y=300,easing:E=ls,tick:x=$e,css:M}=i||_s;M&&(o=Es(e,0,1,y,p,E,M,u++)),x(0,1);const j=ps()+p,Z=j+y;a&&a.abort(),s=!0,_t(()=>Un(e,!0,"start")),a=ms(H=>{if(s){if(H>=Z)return x(1,0),Un(e,!0,"end"),c(),s=!1;if(H>=j){const B=E((H-j)/y);x(B,1-B)}}return s})}let d=!1;return{start(){d||(d=!0,Ir(e),Wn(i)?(i=i(r),bs().then(f)):f())},invalidate(){d=!1},end(){s&&(c(),s=!1)}}}function Is(e,t,n){const r={direction:"out"};let i=t(e,n,r),s=!0,o;const a=lt;a.r+=1;let u;function c(){const{delay:f=0,duration:d=300,easing:p=ls,tick:y=$e,css:E}=i||_s;E&&(o=Es(e,1,0,d,f,p,E));const x=ps()+f,M=x+d;_t(()=>Un(e,!1,"start")),"inert"in e&&(u=e.inert,e.inert=!0),ms(j=>{if(s){if(j>=M)return y(0,1),Un(e,!1,"end"),--a.r||jt(a.c),!1;if(j>=x){const Z=p((j-x)/d);y(1-Z,Z)}}return s})}return Wn(i)?bs().then(()=>{i=i(r),c()}):c(),{end(f){f&&"inert"in e&&(e.inert=u),f&&i.tick&&i.tick(1,0),s&&(o&&Ir(e,o),s=!1)}}}function Ua(e){e&&e.c()}function ws(e,t,n){const{fragment:r,after_update:i}=e.$$;r&&r.m(t,n),_t(()=>{const s=e.$$.on_mount.map(fs).filter(Wn);e.$$.on_destroy?e.$$.on_destroy.push(...s):jt(s),e.$$.on_mount=[]}),i.forEach(_t)}function Os(e,t){const n=e.$$;n.fragment!==null&&(Ma(n.after_update),jt(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function ja(e,t){e.$$.dirty[0]===-1&&(St.push(e),xa(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function Kn(e,t,n,r,i,s,o=null,a=[-1]){const u=an;tn(e);const c=e.$$={fragment:null,ctx:[],props:s,update:$e,not_equal:i,bound:Si(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:Si(),dirty:a,skip_bound:!1,root:t.target||u.$$.root};o&&o(c.root);let f=!1;if(c.ctx=n?n(e,t.props||{},(d,p,...y)=>{const E=y.length?y[0]:p;return c.ctx&&i(c.ctx[d],c.ctx[d]=E)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](E),f&&ja(e,d)),p}):[],c.update(),f=!0,jt(c.before_update),c.fragment=r?r(c.ctx):!1,t.target){if(t.hydrate){const d=Aa(t.target);c.fragment&&c.fragment.l(d),d.forEach(Ie)}else c.fragment&&c.fragment.c();t.intro&&nn(e.$$.fragment),ws(e,t.target,t.anchor),Ts()}tn(u)}class Zn{constructor(){yr(this,"$$");yr(this,"$$set")}$destroy(){Os(this,1),this.$destroy=$e}$on(t,n){if(!Wn(n))return $e;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!_a(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ba="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ba);const qa="http://localhost:58749",At=[];function Ga(e,t=$e){let n;const r=new Set;function i(a){if(hn(e,a)&&(e=a,n)){const u=!At.length;for(const c of r)c[1](),At.push(c,e);if(u){for(let c=0;c<At.length;c+=2)At[c][0](At[c+1]);At.length=0}}}function s(a){i(a(e))}function o(a,u=$e){const c=[a,u];return r.add(c),r.size===1&&(n=t(i,s)||$e),a(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:s,subscribe:o}}const Qa={isBetarenaAdShownForToday:!1,advertDateLastShown:null};function Ya(e){const{subscribe:t,set:n,update:r}=Ga(Qa),i={useLocalStorage:()=>{let s=i.parseLocalStorage();s==null&&(s={isBetarenaAdShownForToday:!1,advertDateLastShown:null}),s.isBetarenaAdShownForToday&&new Date(s.advertDateLastShown).getDate()!=new Date().getDate()&&i.updateData([["toggleAdShownState",void 0]]),i.setLocalStorage(s)},parseLocalStorage:()=>{const s=localStorage.getItem(e);return s?JSON.parse(s):null},setLocalStorage:s=>{localStorage.setItem(e,JSON.stringify(s)),n(s)},updateData:s=>{const o=i.parseLocalStorage();if(o){for(const a of s){const u=a[0];a[1],u=="toggleAdShownState"&&(o.isBetarenaAdShownForToday=!o.isBetarenaAdShownForToday,o.isBetarenaAdShownForToday?o.advertDateLastShown=new Date:o.advertDateLastShown=null)}i.setLocalStorage(o)}}};return{subscribe:t,set:n,update:r,...i}}const Dr=Ya("betarena-ad-engine");var se=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ja(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var we=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Re={searchParams:"URLSearchParams"in we,iterable:"Symbol"in we&&"iterator"in Symbol,blob:"FileReader"in we&&"Blob"in we&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in we,arrayBuffer:"ArrayBuffer"in we};function Ha(e){return e&&DataView.prototype.isPrototypeOf(e)}if(Re.arrayBuffer)var za=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Xa=ArrayBuffer.isView||function(e){return e&&za.indexOf(Object.prototype.toString.call(e))>-1};function Bt(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Ur(e){return typeof e!="string"&&(e=String(e)),e}function jr(e){var t={next:function(){var n=e.shift();return{done:n===void 0,value:n}}};return Re.iterable&&(t[Symbol.iterator]=function(){return t}),t}function _e(e){this.map={},e instanceof _e?e.forEach(function(t,n){this.append(n,t)},this):Array.isArray(e)?e.forEach(function(t){if(t.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}_e.prototype.append=function(e,t){e=Bt(e),t=Ur(t);var n=this.map[e];this.map[e]=n?n+", "+t:t};_e.prototype.delete=function(e){delete this.map[Bt(e)]};_e.prototype.get=function(e){return e=Bt(e),this.has(e)?this.map[e]:null};_e.prototype.has=function(e){return this.map.hasOwnProperty(Bt(e))};_e.prototype.set=function(e,t){this.map[Bt(e)]=Ur(t)};_e.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)};_e.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),jr(e)};_e.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),jr(e)};_e.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),jr(e)};Re.iterable&&(_e.prototype[Symbol.iterator]=_e.prototype.entries);function Er(e){if(!e._noBody){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}}function Ds(e){return new Promise(function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}})}function Wa(e){var t=new FileReader,n=Ds(t);return t.readAsArrayBuffer(e),n}function Ka(e){var t=new FileReader,n=Ds(t),r=/charset=([A-Za-z0-9_-]+)/.exec(e.type),i=r?r[1]:"utf-8";return t.readAsText(e,i),n}function Za(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}function Fi(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function As(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:Re.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:Re.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:Re.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():Re.arrayBuffer&&Re.blob&&Ha(e)?(this._bodyArrayBuffer=Fi(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Re.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||Xa(e))?this._bodyArrayBuffer=Fi(e):this._bodyText=e=Object.prototype.toString.call(e):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Re.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Re.blob&&(this.blob=function(){var e=Er(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=Er(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(Re.blob)return this.blob().then(Wa);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var e=Er(this);if(e)return e;if(this._bodyBlob)return Ka(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Za(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Re.formData&&(this.formData=function(){return this.text().then(nu)}),this.json=function(){return this.text().then(JSON.parse)},this}var eu=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function tu(e){var t=e.toUpperCase();return eu.indexOf(t)>-1?t:e}function Nt(e,t){if(!(this instanceof Nt))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t=t||{};var n=t.body;if(e instanceof Nt){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new _e(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!n&&e._bodyInit!=null&&(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new _e(t.headers)),this.method=tu(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal||function(){if("AbortController"in we){var s=new AbortController;return s.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&n)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(n),(this.method==="GET"||this.method==="HEAD")&&(t.cache==="no-store"||t.cache==="no-cache")){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Nt.prototype.clone=function(){return new Nt(this,{body:this._bodyInit})};function nu(e){var t=new FormData;return e.trim().split("&").forEach(function(n){if(n){var r=n.split("="),i=r.shift().replace(/\+/g," "),s=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(s))}}),t}function ru(e){var t=new _e,n=e.replace(/\r?\n[\t ]+/g," ");return n.split("\r").map(function(r){return r.indexOf(`
|
|
5
|
+
`)===0?r.substr(1,r.length):r}).forEach(function(r){var i=r.split(":"),s=i.shift().trim();if(s){var o=i.join(":").trim();try{t.append(s,o)}catch(a){console.warn("Response "+a.message)}}}),t}As.call(Nt.prototype);function et(e,t){if(!(this instanceof et))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(t||(t={}),this.type="default",this.status=t.status===void 0?200:t.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText===void 0?"":""+t.statusText,this.headers=new _e(t.headers),this.url=t.url||"",this._initBody(e)}As.call(et.prototype);et.prototype.clone=function(){return new et(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new _e(this.headers),url:this.url})};et.error=function(){var e=new et(null,{status:200,statusText:""});return e.status=0,e.type="error",e};var iu=[301,302,303,307,308];et.redirect=function(e,t){if(iu.indexOf(t)===-1)throw new RangeError("Invalid status code");return new et(null,{status:t,headers:{location:e}})};var gt=we.DOMException;try{new gt}catch{gt=function(t,n){this.message=t,this.name=n;var r=Error(t);this.stack=r.stack},gt.prototype=Object.create(Error.prototype),gt.prototype.constructor=gt}function Ss(e,t){return new Promise(function(n,r){var i=new Nt(e,t);if(i.signal&&i.signal.aborted)return r(new gt("Aborted","AbortError"));var s=new XMLHttpRequest;function o(){s.abort()}s.onload=function(){var c={statusText:s.statusText,headers:ru(s.getAllResponseHeaders()||"")};i.url.startsWith("file://")&&(s.status<200||s.status>599)?c.status=200:c.status=s.status,c.url="responseURL"in s?s.responseURL:c.headers.get("X-Request-URL");var f="response"in s?s.response:s.responseText;setTimeout(function(){n(new et(f,c))},0)},s.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},s.onabort=function(){setTimeout(function(){r(new gt("Aborted","AbortError"))},0)};function a(c){try{return c===""&&we.location.href?we.location.href:c}catch{return c}}if(s.open(i.method,a(i.url),!0),i.credentials==="include"?s.withCredentials=!0:i.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(Re.blob?s.responseType="blob":Re.arrayBuffer&&(s.responseType="arraybuffer")),t&&typeof t.headers=="object"&&!(t.headers instanceof _e||we.Headers&&t.headers instanceof we.Headers)){var u=[];Object.getOwnPropertyNames(t.headers).forEach(function(c){u.push(Bt(c)),s.setRequestHeader(c,Ur(t.headers[c]))}),i.headers.forEach(function(c,f){u.indexOf(f)===-1&&s.setRequestHeader(f,c)})}else i.headers.forEach(function(c,f){s.setRequestHeader(f,c)});i.signal&&(i.signal.addEventListener("abort",o),s.onreadystatechange=function(){s.readyState===4&&i.signal.removeEventListener("abort",o)}),s.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}Ss.polyfill=!0;we.fetch||(we.fetch=Ss,we.Headers=_e,we.Request=Nt,we.Response=et);self.fetch.bind(self);const su=async(e,t)=>{try{return await e()}catch(n){return t!=null?t(n):(console.error(`🚏 checkpoint ➤ tryCatchAsync(..) error :: ❌ ${JSON.stringify(n)}`),null)}};async function ou(e,t){return console.log("path",e),console.log("data",t),await su(async()=>{const n=await fetch(e,{method:"POST",credentials:"include",body:JSON.stringify(t),mode:"cors",headers:{Accept:"application/json","Content-Type":"application/json"}}),r=await n.json();if(!n.ok)throw new Error(JSON.stringify(r)??"network response was not ok");return r},n=>(console.error(`💀 Unhandled :: ${n}`),{error:!0,errorLogs:n}))}function $i(){const e=navigator.userAgent.toLowerCase(),t=e.includes("mobile"),n=/tablet|ipad/.test(e);return t?"mobile":n?"tablet":"desktop"}async function au(){return await(await fetch("https://get.geojs.io/v1/ip/geo.json",{method:"GET"})).json()}var qt={},Ar={exports:{}};(function(e,t){var n=typeof self<"u"?self:se,r=function(){function s(){this.fetch=!1,this.DOMException=n.DOMException}return s.prototype=n,new s}();(function(s){(function(o){var a={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function u(m){return m&&DataView.prototype.isPrototypeOf(m)}if(a.arrayBuffer)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(m){return m&&c.indexOf(Object.prototype.toString.call(m))>-1};function d(m){if(typeof m!="string"&&(m=String(m)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(m))throw new TypeError("Invalid character in header field name");return m.toLowerCase()}function p(m){return typeof m!="string"&&(m=String(m)),m}function y(m){var A={next:function(){var q=m.shift();return{done:q===void 0,value:q}}};return a.iterable&&(A[Symbol.iterator]=function(){return A}),A}function E(m){this.map={},m instanceof E?m.forEach(function(A,q){this.append(q,A)},this):Array.isArray(m)?m.forEach(function(A){this.append(A[0],A[1])},this):m&&Object.getOwnPropertyNames(m).forEach(function(A){this.append(A,m[A])},this)}E.prototype.append=function(m,A){m=d(m),A=p(A);var q=this.map[m];this.map[m]=q?q+", "+A:A},E.prototype.delete=function(m){delete this.map[d(m)]},E.prototype.get=function(m){return m=d(m),this.has(m)?this.map[m]:null},E.prototype.has=function(m){return this.map.hasOwnProperty(d(m))},E.prototype.set=function(m,A){this.map[d(m)]=p(A)},E.prototype.forEach=function(m,A){for(var q in this.map)this.map.hasOwnProperty(q)&&m.call(A,this.map[q],q,this)},E.prototype.keys=function(){var m=[];return this.forEach(function(A,q){m.push(q)}),y(m)},E.prototype.values=function(){var m=[];return this.forEach(function(A){m.push(A)}),y(m)},E.prototype.entries=function(){var m=[];return this.forEach(function(A,q){m.push([q,A])}),y(m)},a.iterable&&(E.prototype[Symbol.iterator]=E.prototype.entries);function x(m){if(m.bodyUsed)return Promise.reject(new TypeError("Already read"));m.bodyUsed=!0}function M(m){return new Promise(function(A,q){m.onload=function(){A(m.result)},m.onerror=function(){q(m.error)}})}function j(m){var A=new FileReader,q=M(A);return A.readAsArrayBuffer(m),q}function Z(m){var A=new FileReader,q=M(A);return A.readAsText(m),q}function H(m){for(var A=new Uint8Array(m),q=new Array(A.length),T=0;T<A.length;T++)q[T]=String.fromCharCode(A[T]);return q.join("")}function B(m){if(m.slice)return m.slice(0);var A=new Uint8Array(m.byteLength);return A.set(new Uint8Array(m)),A.buffer}function U(){return this.bodyUsed=!1,this._initBody=function(m){this._bodyInit=m,m?typeof m=="string"?this._bodyText=m:a.blob&&Blob.prototype.isPrototypeOf(m)?this._bodyBlob=m:a.formData&&FormData.prototype.isPrototypeOf(m)?this._bodyFormData=m:a.searchParams&&URLSearchParams.prototype.isPrototypeOf(m)?this._bodyText=m.toString():a.arrayBuffer&&a.blob&&u(m)?(this._bodyArrayBuffer=B(m.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(m)||f(m))?this._bodyArrayBuffer=B(m):this._bodyText=m=Object.prototype.toString.call(m):this._bodyText="",this.headers.get("content-type")||(typeof m=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):a.searchParams&&URLSearchParams.prototype.isPrototypeOf(m)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a.blob&&(this.blob=function(){var m=x(this);if(m)return m;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?x(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(j)}),this.text=function(){var m=x(this);if(m)return m;if(this._bodyBlob)return Z(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(H(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a.formData&&(this.formData=function(){return this.text().then(g)}),this.json=function(){return this.text().then(JSON.parse)},this}var k=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function D(m){var A=m.toUpperCase();return k.indexOf(A)>-1?A:m}function Q(m,A){A=A||{};var q=A.body;if(m instanceof Q){if(m.bodyUsed)throw new TypeError("Already read");this.url=m.url,this.credentials=m.credentials,A.headers||(this.headers=new E(m.headers)),this.method=m.method,this.mode=m.mode,this.signal=m.signal,!q&&m._bodyInit!=null&&(q=m._bodyInit,m.bodyUsed=!0)}else this.url=String(m);if(this.credentials=A.credentials||this.credentials||"same-origin",(A.headers||!this.headers)&&(this.headers=new E(A.headers)),this.method=D(A.method||this.method||"GET"),this.mode=A.mode||this.mode||null,this.signal=A.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&q)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(q)}Q.prototype.clone=function(){return new Q(this,{body:this._bodyInit})};function g(m){var A=new FormData;return m.trim().split("&").forEach(function(q){if(q){var T=q.split("="),w=T.shift().replace(/\+/g," "),b=T.join("=").replace(/\+/g," ");A.append(decodeURIComponent(w),decodeURIComponent(b))}}),A}function v(m){var A=new E,q=m.replace(/\r?\n[\t ]+/g," ");return q.split(/\r?\n/).forEach(function(T){var w=T.split(":"),b=w.shift().trim();if(b){var S=w.join(":").trim();A.append(b,S)}}),A}U.call(Q.prototype);function C(m,A){A||(A={}),this.type="default",this.status=A.status===void 0?200:A.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in A?A.statusText:"OK",this.headers=new E(A.headers),this.url=A.url||"",this._initBody(m)}U.call(C.prototype),C.prototype.clone=function(){return new C(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new E(this.headers),url:this.url})},C.error=function(){var m=new C(null,{status:0,statusText:""});return m.type="error",m};var z=[301,302,303,307,308];C.redirect=function(m,A){if(z.indexOf(A)===-1)throw new RangeError("Invalid status code");return new C(null,{status:A,headers:{location:m}})},o.DOMException=s.DOMException;try{new o.DOMException}catch{o.DOMException=function(A,q){this.message=A,this.name=q;var T=Error(A);this.stack=T.stack},o.DOMException.prototype=Object.create(Error.prototype),o.DOMException.prototype.constructor=o.DOMException}function ie(m,A){return new Promise(function(q,T){var w=new Q(m,A);if(w.signal&&w.signal.aborted)return T(new o.DOMException("Aborted","AbortError"));var b=new XMLHttpRequest;function S(){b.abort()}b.onload=function(){var L={status:b.status,statusText:b.statusText,headers:v(b.getAllResponseHeaders()||"")};L.url="responseURL"in b?b.responseURL:L.headers.get("X-Request-URL");var h="response"in b?b.response:b.responseText;q(new C(h,L))},b.onerror=function(){T(new TypeError("Network request failed"))},b.ontimeout=function(){T(new TypeError("Network request failed"))},b.onabort=function(){T(new o.DOMException("Aborted","AbortError"))},b.open(w.method,w.url,!0),w.credentials==="include"?b.withCredentials=!0:w.credentials==="omit"&&(b.withCredentials=!1),"responseType"in b&&a.blob&&(b.responseType="blob"),w.headers.forEach(function(L,h){b.setRequestHeader(h,L)}),w.signal&&(w.signal.addEventListener("abort",S),b.onreadystatechange=function(){b.readyState===4&&w.signal.removeEventListener("abort",S)}),b.send(typeof w._bodyInit>"u"?null:w._bodyInit)})}return ie.polyfill=!0,s.fetch||(s.fetch=ie,s.Headers=E,s.Request=Q,s.Response=C),o.Headers=E,o.Request=Q,o.Response=C,o.fetch=ie,Object.defineProperty(o,"__esModule",{value:!0}),o})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var i=r;t=i.fetch,t.default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t})(Ar,Ar.exports);var uu=Ar.exports,Br={},er={},Rs=function(t){var n=t.uri,r=t.name,i=t.type;this.uri=n,this.name=r,this.type=i},cu=Rs,Ls=function(t){return typeof File<"u"&&t instanceof File||typeof Blob<"u"&&t instanceof Blob||t instanceof cu},lu=Ls,fu=function e(t,n,r){n===void 0&&(n=""),r===void 0&&(r=lu);var i,s=new Map;function o(f,d){var p=s.get(d);p?p.push.apply(p,f):s.set(d,f)}if(r(t))i=null,o([n],t);else{var a=n?n+".":"";if(typeof FileList<"u"&&t instanceof FileList)i=Array.prototype.map.call(t,function(f,d){return o([""+a+d],f),null});else if(Array.isArray(t))i=t.map(function(f,d){var p=e(f,""+a+d,r);return p.files.forEach(o),p.clone});else if(t&&t.constructor===Object){i={};for(var u in t){var c=e(t[u],""+a+u,r);c.files.forEach(o),i[u]=c.clone}}else i=t}return{clone:i,files:s}};er.ReactNativeFile=Rs;er.extractFiles=fu;er.isExtractableFile=Ls;var du=typeof self=="object"?self.FormData:window.FormData,mn={};Object.defineProperty(mn,"__esModule",{value:!0});mn.defaultJsonSerializer=void 0;mn.defaultJsonSerializer={parse:JSON.parse,stringify:JSON.stringify};var pu=se&&se.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Br,"__esModule",{value:!0});var ks=er,hu=pu(du),mu=mn,yu=function(e){return(0,ks.isExtractableFile)(e)||e!==null&&typeof e=="object"&&typeof e.pipe=="function"};function vu(e,t,n,r){r===void 0&&(r=mu.defaultJsonSerializer);var i=(0,ks.extractFiles)({query:e,variables:t,operationName:n},"",yu),s=i.clone,o=i.files;if(o.size===0){if(!Array.isArray(e))return r.stringify(s);if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");var a=e.reduce(function(p,y,E){return p.push({query:y,variables:t?t[E]:void 0}),p},[]);return r.stringify(a)}var u=typeof FormData>"u"?hu.default:FormData,c=new u;c.append("operations",r.stringify(s));var f={},d=0;return o.forEach(function(p){f[++d]=p}),c.append("map",r.stringify(f)),d=0,o.forEach(function(p,y){c.append("".concat(++d),y)}),c}Br.default=vu;var ke={};Object.defineProperty(ke,"__esModule",{value:!0});ke.parseBatchRequestsExtendedArgs=ke.parseRawRequestExtendedArgs=ke.parseRequestExtendedArgs=ke.parseBatchRequestArgs=ke.parseRawRequestArgs=ke.parseRequestArgs=void 0;function Eu(e,t,n){return e.document?e:{document:e,variables:t,requestHeaders:n,signal:void 0}}ke.parseRequestArgs=Eu;function gu(e,t,n){return e.query?e:{query:e,variables:t,requestHeaders:n,signal:void 0}}ke.parseRawRequestArgs=gu;function Tu(e,t){return e.documents?e:{documents:e,requestHeaders:t,signal:void 0}}ke.parseBatchRequestArgs=Tu;function bu(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0],s=n[1];return e.document?e:{url:e,document:t,variables:i,requestHeaders:s,signal:void 0}}ke.parseRequestExtendedArgs=bu;function _u(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=n[0],s=n[1];return e.query?e:{url:e,query:t,variables:i,requestHeaders:s,signal:void 0}}ke.parseRawRequestExtendedArgs=_u;function Nu(e,t,n){return e.documents?e:{url:e,documents:t,requestHeaders:n,signal:void 0}}ke.parseBatchRequestsExtendedArgs=Nu;var yn={},Iu=se&&se.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(yn,"__esModule",{value:!0});yn.ClientError=void 0;var wu=function(e){Iu(t,e);function t(n,r){var i=this,s="".concat(t.extractMessage(n),": ").concat(JSON.stringify({response:n,request:r}));return i=e.call(this,s)||this,Object.setPrototypeOf(i,t.prototype),i.response=n,i.request=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(i,t),i}return t.extractMessage=function(n){try{return n.errors[0].message}catch{return"GraphQL Error (Code: ".concat(n.status,")")}},t}(Error);yn.ClientError=wu;var $t={};const Ou="16.6.0",Du=Object.freeze({major:16,minor:6,patch:0,preReleaseTag:null});function K(e,t){if(!!!e)throw new Error(t)}function Ve(e){return typeof(e==null?void 0:e.then)=="function"}function Pe(e){return typeof e=="object"&&e!==null}function ye(e,t){if(!!!e)throw new Error(t??"Unexpected invariant triggered.")}const Au=/\r\n|[\n\r]/g;function jn(e,t){let n=0,r=1;for(const i of e.body.matchAll(Au)){if(typeof i.index=="number"||ye(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function Fs(e){return qr(e.source,jn(e.source,e.start))}function qr(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,s=e.locationOffset.line-1,o=t.line+s,a=t.line===1?n:0,u=t.column+a,c=`${e.name}:${o}:${u}
|
|
6
|
+
`,f=r.split(/\r\n|[\n\r]/g),d=f[i];if(d.length>120){const p=Math.floor(u/80),y=u%80,E=[];for(let x=0;x<d.length;x+=80)E.push(d.slice(x,x+80));return c+xi([[`${o} |`,E[0]],...E.slice(1,p+1).map(x=>["|",x]),["|","^".padStart(y)],["|",E[p+1]]])}return c+xi([[`${o-1} |`,f[i-1]],[`${o} |`,d],["|","^".padStart(u)],[`${o+1} |`,f[i+1]]])}function xi(e){const t=e.filter(([r,i])=>i!==void 0),n=Math.max(...t.map(([r])=>r.length));return t.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
|
|
7
|
+
`)}function Su(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class _ extends Error{constructor(t,...n){var r,i,s;const{nodes:o,source:a,positions:u,path:c,originalError:f,extensions:d}=Su(n);super(t),this.name="GraphQLError",this.path=c??void 0,this.originalError=f??void 0,this.nodes=Ci(Array.isArray(o)?o:o?[o]:void 0);const p=Ci((r=this.nodes)===null||r===void 0?void 0:r.map(E=>E.loc).filter(E=>E!=null));this.source=a??(p==null||(i=p[0])===null||i===void 0?void 0:i.source),this.positions=u??(p==null?void 0:p.map(E=>E.start)),this.locations=u&&a?u.map(E=>jn(a,E)):p==null?void 0:p.map(E=>jn(E.source,E.start));const y=Pe(f==null?void 0:f.extensions)?f==null?void 0:f.extensions:void 0;this.extensions=(s=d??y)!==null&&s!==void 0?s:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),f!=null&&f.stack?Object.defineProperty(this,"stack",{value:f.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,_):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+=`
|
|
8
|
+
|
|
9
|
+
`+Fs(n.loc));else if(this.source&&this.locations)for(const n of this.locations)t+=`
|
|
10
|
+
|
|
11
|
+
`+qr(this.source,n);return t}toJSON(){const t={message:this.message};return this.locations!=null&&(t.locations=this.locations),this.path!=null&&(t.path=this.path),this.extensions!=null&&Object.keys(this.extensions).length>0&&(t.extensions=this.extensions),t}}function Ci(e){return e===void 0||e.length===0?void 0:e}function Ru(e){return e.toString()}function Lu(e){return e.toJSON()}function Te(e,t,n){return new _(`Syntax Error: ${n}`,{source:e,positions:[t]})}class $s{constructor(t,n,r){this.start=t.start,this.end=n.end,this.startToken=t,this.endToken=n,this.source=r}get[Symbol.toStringTag](){return"Location"}toJSON(){return{start:this.start,end:this.end}}}class Gr{constructor(t,n,r,i,s,o){this.kind=t,this.start=n,this.end=r,this.line=i,this.column=s,this.value=o,this.prev=null,this.next=null}get[Symbol.toStringTag](){return"Token"}toJSON(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}}}const xs={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"]},ku=new Set(Object.keys(xs));function Sr(e){const t=e==null?void 0:e.kind;return typeof t=="string"&&ku.has(t)}var be;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(be||(be={}));var G;(function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"})(G||(G={}));var l;(function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"})(l||(l={}));function Rr(e){return e===9||e===32}function un(e){return e>=48&&e<=57}function Cs(e){return e>=97&&e<=122||e>=65&&e<=90}function Qr(e){return Cs(e)||e===95}function Ms(e){return Cs(e)||un(e)||e===95}function Fu(e){var t;let n=Number.MAX_SAFE_INTEGER,r=null,i=-1;for(let o=0;o<e.length;++o){var s;const a=e[o],u=$u(a);u!==a.length&&(r=(s=r)!==null&&s!==void 0?s:o,i=o,o!==0&&u<n&&(n=u))}return e.map((o,a)=>a===0?o:o.slice(n)).slice((t=r)!==null&&t!==void 0?t:0,i+1)}function $u(e){let t=0;for(;t<e.length&&Rr(e.charCodeAt(t));)++t;return t}function xu(e){if(e==="")return!0;let t=!0,n=!1,r=!0,i=!1;for(let s=0;s<e.length;++s)switch(e.codePointAt(s)){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 11:case 12:case 14:case 15:return!1;case 13:return!1;case 10:if(t&&!i)return!1;i=!0,t=!0,n=!1;break;case 9:case 32:n||(n=t);break;default:r&&(r=n),t=!1}return!(t||r&&i)}function Vs(e,t){const n=e.replace(/"""/g,'\\"""'),r=n.split(/\r\n|[\n\r]/g),i=r.length===1,s=r.length>1&&r.slice(1).every(y=>y.length===0||Rr(y.charCodeAt(0))),o=n.endsWith('\\"""'),a=e.endsWith('"')&&!o,u=e.endsWith("\\"),c=a||u,f=!(t!=null&&t.minimize)&&(!i||e.length>70||c||s||o);let d="";const p=i&&Rr(e.charCodeAt(0));return(f&&!p||s)&&(d+=`
|
|
12
|
+
`),d+=n,(f||c)&&(d+=`
|
|
13
|
+
`),'"""'+d+'"""'}var N;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})(N||(N={}));class Yr{constructor(t){const n=new Gr(N.SOF,0,0,0,0);this.source=t,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let t=this.token;if(t.kind!==N.EOF)do if(t.next)t=t.next;else{const n=Cu(this,t.end);t.next=n,n.prev=t,t=n}while(t.kind===N.COMMENT);return t}}function Ps(e){return e===N.BANG||e===N.DOLLAR||e===N.AMP||e===N.PAREN_L||e===N.PAREN_R||e===N.SPREAD||e===N.COLON||e===N.EQUALS||e===N.AT||e===N.BRACKET_L||e===N.BRACKET_R||e===N.BRACE_L||e===N.PIPE||e===N.BRACE_R}function Gt(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function tr(e,t){return Us(e.charCodeAt(t))&&js(e.charCodeAt(t+1))}function Us(e){return e>=55296&&e<=56319}function js(e){return e>=56320&&e<=57343}function It(e,t){const n=e.source.body.codePointAt(t);if(n===void 0)return N.EOF;if(n>=32&&n<=126){const r=String.fromCodePoint(n);return r==='"'?`'"'`:`"${r}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function Ee(e,t,n,r,i){const s=e.line,o=1+n-e.lineStart;return new Gr(t,n,r,s,o,i)}function Cu(e,t){const n=e.source.body,r=n.length;let i=t;for(;i<r;){const s=n.charCodeAt(i);switch(s){case 65279:case 9:case 32:case 44:++i;continue;case 10:++i,++e.line,e.lineStart=i;continue;case 13:n.charCodeAt(i+1)===10?i+=2:++i,++e.line,e.lineStart=i;continue;case 35:return Mu(e,i);case 33:return Ee(e,N.BANG,i,i+1);case 36:return Ee(e,N.DOLLAR,i,i+1);case 38:return Ee(e,N.AMP,i,i+1);case 40:return Ee(e,N.PAREN_L,i,i+1);case 41:return Ee(e,N.PAREN_R,i,i+1);case 46:if(n.charCodeAt(i+1)===46&&n.charCodeAt(i+2)===46)return Ee(e,N.SPREAD,i,i+3);break;case 58:return Ee(e,N.COLON,i,i+1);case 61:return Ee(e,N.EQUALS,i,i+1);case 64:return Ee(e,N.AT,i,i+1);case 91:return Ee(e,N.BRACKET_L,i,i+1);case 93:return Ee(e,N.BRACKET_R,i,i+1);case 123:return Ee(e,N.BRACE_L,i,i+1);case 124:return Ee(e,N.PIPE,i,i+1);case 125:return Ee(e,N.BRACE_R,i,i+1);case 34:return n.charCodeAt(i+1)===34&&n.charCodeAt(i+2)===34?qu(e,i):Pu(e,i)}if(un(s)||s===45)return Vu(e,i,s);if(Qr(s))return Gu(e,i);throw Te(e.source,i,s===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:Gt(s)||tr(n,i)?`Unexpected character: ${It(e,i)}.`:`Invalid character: ${It(e,i)}.`)}return Ee(e,N.EOF,r,r)}function Mu(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const s=n.charCodeAt(i);if(s===10||s===13)break;if(Gt(s))++i;else if(tr(n,i))i+=2;else break}return Ee(e,N.COMMENT,t,i,n.slice(t+1,i))}function Vu(e,t,n){const r=e.source.body;let i=t,s=n,o=!1;if(s===45&&(s=r.charCodeAt(++i)),s===48){if(s=r.charCodeAt(++i),un(s))throw Te(e.source,i,`Invalid number, unexpected digit after 0: ${It(e,i)}.`)}else i=gr(e,i,s),s=r.charCodeAt(i);if(s===46&&(o=!0,s=r.charCodeAt(++i),i=gr(e,i,s),s=r.charCodeAt(i)),(s===69||s===101)&&(o=!0,s=r.charCodeAt(++i),(s===43||s===45)&&(s=r.charCodeAt(++i)),i=gr(e,i,s),s=r.charCodeAt(i)),s===46||Qr(s))throw Te(e.source,i,`Invalid number, expected digit but got: ${It(e,i)}.`);return Ee(e,o?N.FLOAT:N.INT,t,i,r.slice(t,i))}function gr(e,t,n){if(!un(n))throw Te(e.source,t,`Invalid number, expected digit but got: ${It(e,t)}.`);const r=e.source.body;let i=t+1;for(;un(r.charCodeAt(i));)++i;return i}function Pu(e,t){const n=e.source.body,r=n.length;let i=t+1,s=i,o="";for(;i<r;){const a=n.charCodeAt(i);if(a===34)return o+=n.slice(s,i),Ee(e,N.STRING,t,i+1,o);if(a===92){o+=n.slice(s,i);const u=n.charCodeAt(i+1)===117?n.charCodeAt(i+2)===123?Uu(e,i):ju(e,i):Bu(e,i);o+=u.value,i+=u.size,s=i;continue}if(a===10||a===13)break;if(Gt(a))++i;else if(tr(n,i))i+=2;else throw Te(e.source,i,`Invalid character within String: ${It(e,i)}.`)}throw Te(e.source,i,"Unterminated string.")}function Uu(e,t){const n=e.source.body;let r=0,i=3;for(;i<12;){const s=n.charCodeAt(t+i++);if(s===125){if(i<5||!Gt(r))break;return{value:String.fromCodePoint(r),size:i}}if(r=r<<4|Kt(s),r<0)break}throw Te(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+i)}".`)}function ju(e,t){const n=e.source.body,r=Mi(n,t+2);if(Gt(r))return{value:String.fromCodePoint(r),size:6};if(Us(r)&&n.charCodeAt(t+6)===92&&n.charCodeAt(t+7)===117){const i=Mi(n,t+8);if(js(i))return{value:String.fromCodePoint(r,i),size:12}}throw Te(e.source,t,`Invalid Unicode escape sequence: "${n.slice(t,t+6)}".`)}function Mi(e,t){return Kt(e.charCodeAt(t))<<12|Kt(e.charCodeAt(t+1))<<8|Kt(e.charCodeAt(t+2))<<4|Kt(e.charCodeAt(t+3))}function Kt(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function Bu(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:`
|
|
14
|
+
`,size:2};case 114:return{value:"\r",size:2};case 116:return{value:" ",size:2}}throw Te(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function qu(e,t){const n=e.source.body,r=n.length;let i=e.lineStart,s=t+3,o=s,a="";const u=[];for(;s<r;){const c=n.charCodeAt(s);if(c===34&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34){a+=n.slice(o,s),u.push(a);const f=Ee(e,N.BLOCK_STRING,t,s+3,Fu(u).join(`
|
|
15
|
+
`));return e.line+=u.length-1,e.lineStart=i,f}if(c===92&&n.charCodeAt(s+1)===34&&n.charCodeAt(s+2)===34&&n.charCodeAt(s+3)===34){a+=n.slice(o,s),o=s+1,s+=4;continue}if(c===10||c===13){a+=n.slice(o,s),u.push(a),c===13&&n.charCodeAt(s+1)===10?s+=2:++s,a="",o=s,i=s;continue}if(Gt(c))++s;else if(tr(n,s))s+=2;else throw Te(e.source,s,`Invalid character within String: ${It(e,s)}.`)}throw Te(e.source,s,"Unterminated string.")}function Gu(e,t){const n=e.source.body,r=n.length;let i=t+1;for(;i<r;){const s=n.charCodeAt(i);if(Ms(s))++i;else break}return Ee(e,N.NAME,t,i,n.slice(t,i))}const Qu=10,Bs=2;function I(e){return nr(e,[])}function nr(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return Yu(e,t);default:return String(e)}}function Yu(e,t){if(e===null)return"null";if(t.includes(e))return"[Circular]";const n=[...t,e];if(Ju(e)){const r=e.toJSON();if(r!==e)return typeof r=="string"?r:nr(r,n)}else if(Array.isArray(e))return zu(e,n);return Hu(e,n)}function Ju(e){return typeof e.toJSON=="function"}function Hu(e,t){const n=Object.entries(e);return n.length===0?"{}":t.length>Bs?"["+Xu(e)+"]":"{ "+n.map(([i,s])=>i+": "+nr(s,t)).join(", ")+" }"}function zu(e,t){if(e.length===0)return"[]";if(t.length>Bs)return"[Array]";const n=Math.min(Qu,e.length),r=e.length-n,i=[];for(let s=0;s<n;++s)i.push(nr(e[s],t));return r===1?i.push("... 1 more item"):r>1&&i.push(`... ${r} more items`),"["+i.join(", ")+"]"}function Xu(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){const n=e.constructor.name;if(typeof n=="string"&&n!=="")return n}return t}const We=function(t,n){return t instanceof n};class rr{constructor(t,n="GraphQL request",r={line:1,column:1}){typeof t=="string"||K(!1,`Body must be a string. Received: ${I(t)}.`),this.body=t,this.name=n,this.locationOffset=r,this.locationOffset.line>0||K(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||K(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}function qs(e){return We(e,rr)}function ir(e,t){return new sr(e,t).parseDocument()}function Gs(e,t){const n=new sr(e,t);n.expectToken(N.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(N.EOF),r}function Wu(e,t){const n=new sr(e,t);n.expectToken(N.SOF);const r=n.parseConstValueLiteral();return n.expectToken(N.EOF),r}function Ku(e,t){const n=new sr(e,t);n.expectToken(N.SOF);const r=n.parseTypeReference();return n.expectToken(N.EOF),r}class sr{constructor(t,n={}){const r=qs(t)?t:new rr(t);this._lexer=new Yr(r),this._options=n,this._tokenCounter=0}parseName(){const t=this.expectToken(N.NAME);return this.node(t,{kind:l.NAME,value:t.value})}parseDocument(){return this.node(this._lexer.token,{kind:l.DOCUMENT,definitions:this.many(N.SOF,this.parseDefinition,N.EOF)})}parseDefinition(){if(this.peek(N.BRACE_L))return this.parseOperationDefinition();const t=this.peekDescription(),n=t?this._lexer.lookahead():this._lexer.token;if(n.kind===N.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(t)throw Te(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const t=this._lexer.token;if(this.peek(N.BRACE_L))return this.node(t,{kind:l.OPERATION_DEFINITION,operation:be.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let r;return this.peek(N.NAME)&&(r=this.parseName()),this.node(t,{kind:l.OPERATION_DEFINITION,operation:n,name:r,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const t=this.expectToken(N.NAME);switch(t.value){case"query":return be.QUERY;case"mutation":return be.MUTATION;case"subscription":return be.SUBSCRIPTION}throw this.unexpected(t)}parseVariableDefinitions(){return this.optionalMany(N.PAREN_L,this.parseVariableDefinition,N.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:l.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(N.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(N.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const t=this._lexer.token;return this.expectToken(N.DOLLAR),this.node(t,{kind:l.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:l.SELECTION_SET,selections:this.many(N.BRACE_L,this.parseSelection,N.BRACE_R)})}parseSelection(){return this.peek(N.SPREAD)?this.parseFragment():this.parseField()}parseField(){const t=this._lexer.token,n=this.parseName();let r,i;return this.expectOptionalToken(N.COLON)?(r=n,i=this.parseName()):i=n,this.node(t,{kind:l.FIELD,alias:r,name:i,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(N.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(t){const n=t?this.parseConstArgument:this.parseArgument;return this.optionalMany(N.PAREN_L,n,N.PAREN_R)}parseArgument(t=!1){const n=this._lexer.token,r=this.parseName();return this.expectToken(N.COLON),this.node(n,{kind:l.ARGUMENT,name:r,value:this.parseValueLiteral(t)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const t=this._lexer.token;this.expectToken(N.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(N.NAME)?this.node(t,{kind:l.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(t,{kind:l.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const t=this._lexer.token;return this.expectKeyword("fragment"),this._options.allowLegacyFragmentVariables===!0?this.node(t,{kind:l.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(t,{kind:l.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()}parseValueLiteral(t){const n=this._lexer.token;switch(n.kind){case N.BRACKET_L:return this.parseList(t);case N.BRACE_L:return this.parseObject(t);case N.INT:return this.advanceLexer(),this.node(n,{kind:l.INT,value:n.value});case N.FLOAT:return this.advanceLexer(),this.node(n,{kind:l.FLOAT,value:n.value});case N.STRING:case N.BLOCK_STRING:return this.parseStringLiteral();case N.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:l.BOOLEAN,value:!0});case"false":return this.node(n,{kind:l.BOOLEAN,value:!1});case"null":return this.node(n,{kind:l.NULL});default:return this.node(n,{kind:l.ENUM,value:n.value})}case N.DOLLAR:if(t)if(this.expectToken(N.DOLLAR),this._lexer.token.kind===N.NAME){const r=this._lexer.token.value;throw Te(this._lexer.source,n.start,`Unexpected variable "$${r}" in constant value.`)}else throw this.unexpected(n);return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const t=this._lexer.token;return this.advanceLexer(),this.node(t,{kind:l.STRING,value:t.value,block:t.kind===N.BLOCK_STRING})}parseList(t){const n=()=>this.parseValueLiteral(t);return this.node(this._lexer.token,{kind:l.LIST,values:this.any(N.BRACKET_L,n,N.BRACKET_R)})}parseObject(t){const n=()=>this.parseObjectField(t);return this.node(this._lexer.token,{kind:l.OBJECT,fields:this.any(N.BRACE_L,n,N.BRACE_R)})}parseObjectField(t){const n=this._lexer.token,r=this.parseName();return this.expectToken(N.COLON),this.node(n,{kind:l.OBJECT_FIELD,name:r,value:this.parseValueLiteral(t)})}parseDirectives(t){const n=[];for(;this.peek(N.AT);)n.push(this.parseDirective(t));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(t){const n=this._lexer.token;return this.expectToken(N.AT),this.node(n,{kind:l.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(t)})}parseTypeReference(){const t=this._lexer.token;let n;if(this.expectOptionalToken(N.BRACKET_L)){const r=this.parseTypeReference();this.expectToken(N.BRACKET_R),n=this.node(t,{kind:l.LIST_TYPE,type:r})}else n=this.parseNamedType();return this.expectOptionalToken(N.BANG)?this.node(t,{kind:l.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:l.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(N.STRING)||this.peek(N.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const r=this.parseConstDirectives(),i=this.many(N.BRACE_L,this.parseOperationTypeDefinition,N.BRACE_R);return this.node(t,{kind:l.SCHEMA_DEFINITION,description:n,directives:r,operationTypes:i})}parseOperationTypeDefinition(){const t=this._lexer.token,n=this.parseOperationType();this.expectToken(N.COLON);const r=this.parseNamedType();return this.node(t,{kind:l.OPERATION_TYPE_DEFINITION,operation:n,type:r})}parseScalarTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const r=this.parseName(),i=this.parseConstDirectives();return this.node(t,{kind:l.SCALAR_TYPE_DEFINITION,description:n,name:r,directives:i})}parseObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:l.OBJECT_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(N.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(N.BRACE_L,this.parseFieldDefinition,N.BRACE_R)}parseFieldDefinition(){const t=this._lexer.token,n=this.parseDescription(),r=this.parseName(),i=this.parseArgumentDefs();this.expectToken(N.COLON);const s=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(t,{kind:l.FIELD_DEFINITION,description:n,name:r,arguments:i,type:s,directives:o})}parseArgumentDefs(){return this.optionalMany(N.PAREN_L,this.parseInputValueDef,N.PAREN_R)}parseInputValueDef(){const t=this._lexer.token,n=this.parseDescription(),r=this.parseName();this.expectToken(N.COLON);const i=this.parseTypeReference();let s;this.expectOptionalToken(N.EQUALS)&&(s=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(t,{kind:l.INPUT_VALUE_DEFINITION,description:n,name:r,type:i,defaultValue:s,directives:o})}parseInterfaceTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const r=this.parseName(),i=this.parseImplementsInterfaces(),s=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(t,{kind:l.INTERFACE_TYPE_DEFINITION,description:n,name:r,interfaces:i,directives:s,fields:o})}parseUnionTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseUnionMemberTypes();return this.node(t,{kind:l.UNION_TYPE_DEFINITION,description:n,name:r,directives:i,types:s})}parseUnionMemberTypes(){return this.expectOptionalToken(N.EQUALS)?this.delimitedMany(N.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseEnumValuesDefinition();return this.node(t,{kind:l.ENUM_TYPE_DEFINITION,description:n,name:r,directives:i,values:s})}parseEnumValuesDefinition(){return this.optionalMany(N.BRACE_L,this.parseEnumValueDefinition,N.BRACE_R)}parseEnumValueDefinition(){const t=this._lexer.token,n=this.parseDescription(),r=this.parseEnumValueName(),i=this.parseConstDirectives();return this.node(t,{kind:l.ENUM_VALUE_DEFINITION,description:n,name:r,directives:i})}parseEnumValueName(){if(this._lexer.token.value==="true"||this._lexer.token.value==="false"||this._lexer.token.value==="null")throw Te(this._lexer.source,this._lexer.token.start,`${Dn(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const r=this.parseName(),i=this.parseConstDirectives(),s=this.parseInputFieldsDefinition();return this.node(t,{kind:l.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:r,directives:i,fields:s})}parseInputFieldsDefinition(){return this.optionalMany(N.BRACE_L,this.parseInputValueDef,N.BRACE_R)}parseTypeSystemExtension(){const t=this._lexer.lookahead();if(t.kind===N.NAME)switch(t.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(t)}parseSchemaExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.optionalMany(N.BRACE_L,this.parseOperationTypeDefinition,N.BRACE_R);if(n.length===0&&r.length===0)throw this.unexpected();return this.node(t,{kind:l.SCHEMA_EXTENSION,directives:n,operationTypes:r})}parseScalarTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();if(r.length===0)throw this.unexpected();return this.node(t,{kind:l.SCALAR_TYPE_EXTENSION,name:n,directives:r})}parseObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:l.OBJECT_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseInterfaceTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),s=this.parseFieldsDefinition();if(r.length===0&&i.length===0&&s.length===0)throw this.unexpected();return this.node(t,{kind:l.INTERFACE_TYPE_EXTENSION,name:n,interfaces:r,directives:i,fields:s})}parseUnionTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:l.UNION_TYPE_EXTENSION,name:n,directives:r,types:i})}parseEnumTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:l.ENUM_TYPE_EXTENSION,name:n,directives:r,values:i})}parseInputObjectTypeExtension(){const t=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();if(r.length===0&&i.length===0)throw this.unexpected();return this.node(t,{kind:l.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:r,fields:i})}parseDirectiveDefinition(){const t=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(N.AT);const r=this.parseName(),i=this.parseArgumentDefs(),s=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(t,{kind:l.DIRECTIVE_DEFINITION,description:n,name:r,arguments:i,repeatable:s,locations:o})}parseDirectiveLocations(){return this.delimitedMany(N.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const t=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(G,n.value))return n;throw this.unexpected(t)}node(t,n){return this._options.noLocation!==!0&&(n.loc=new $s(t,this._lexer.lastToken,this._lexer.source)),n}peek(t){return this._lexer.token.kind===t}expectToken(t){const n=this._lexer.token;if(n.kind===t)return this.advanceLexer(),n;throw Te(this._lexer.source,n.start,`Expected ${Qs(t)}, found ${Dn(n)}.`)}expectOptionalToken(t){return this._lexer.token.kind===t?(this.advanceLexer(),!0):!1}expectKeyword(t){const n=this._lexer.token;if(n.kind===N.NAME&&n.value===t)this.advanceLexer();else throw Te(this._lexer.source,n.start,`Expected "${t}", found ${Dn(n)}.`)}expectOptionalKeyword(t){const n=this._lexer.token;return n.kind===N.NAME&&n.value===t?(this.advanceLexer(),!0):!1}unexpected(t){const n=t??this._lexer.token;return Te(this._lexer.source,n.start,`Unexpected ${Dn(n)}.`)}any(t,n,r){this.expectToken(t);const i=[];for(;!this.expectOptionalToken(r);)i.push(n.call(this));return i}optionalMany(t,n,r){if(this.expectOptionalToken(t)){const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}return[]}many(t,n,r){this.expectToken(t);const i=[];do i.push(n.call(this));while(!this.expectOptionalToken(r));return i}delimitedMany(t,n){this.expectOptionalToken(t);const r=[];do r.push(n.call(this));while(this.expectOptionalToken(t));return r}advanceLexer(){const{maxTokens:t}=this._options,n=this._lexer.advance();if(t!==void 0&&n.kind!==N.EOF&&(++this._tokenCounter,this._tokenCounter>t))throw Te(this._lexer.source,n.start,`Document contains more that ${t} tokens. Parsing aborted.`)}}function Dn(e){const t=e.value;return Qs(e.kind)+(t!=null?` "${t}"`:"")}function Qs(e){return Ps(e)?`"${e}"`:e}const Zu=5;function ot(e,t){const[n,r]=t?[e,t]:[void 0,e];let i=" Did you mean ";n&&(i+=n+" ");const s=r.map(u=>`"${u}"`);switch(s.length){case 0:return"";case 1:return i+s[0]+"?";case 2:return i+s[0]+" or "+s[1]+"?"}const o=s.slice(0,Zu),a=o.pop();return i+o.join(", ")+", or "+a+"?"}function Vi(e){return e}function at(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}function ft(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}function st(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}function vn(e,t){let n=0,r=0;for(;n<e.length&&r<t.length;){let i=e.charCodeAt(n),s=t.charCodeAt(r);if(An(i)&&An(s)){let o=0;do++n,o=o*10+i-Lr,i=e.charCodeAt(n);while(An(i)&&o>0);let a=0;do++r,a=a*10+s-Lr,s=t.charCodeAt(r);while(An(s)&&a>0);if(o<a)return-1;if(o>a)return 1}else{if(i<s)return-1;if(i>s)return 1;++n,++r}}return e.length-t.length}const Lr=48,ec=57;function An(e){return!isNaN(e)&&Lr<=e&&e<=ec}function mt(e,t){const n=Object.create(null),r=new tc(e),i=Math.floor(e.length*.4)+1;for(const s of t){const o=r.measure(s,i);o!==void 0&&(n[s]=o)}return Object.keys(n).sort((s,o)=>{const a=n[s]-n[o];return a!==0?a:vn(s,o)})}class tc{constructor(t){this._input=t,this._inputLowerCase=t.toLowerCase(),this._inputArray=Pi(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)]}measure(t,n){if(this._input===t)return 0;const r=t.toLowerCase();if(this._inputLowerCase===r)return 1;let i=Pi(r),s=this._inputArray;if(i.length<s.length){const f=i;i=s,s=f}const o=i.length,a=s.length;if(o-a>n)return;const u=this._rows;for(let f=0;f<=a;f++)u[0][f]=f;for(let f=1;f<=o;f++){const d=u[(f-1)%3],p=u[f%3];let y=p[0]=f;for(let E=1;E<=a;E++){const x=i[f-1]===s[E-1]?0:1;let M=Math.min(d[E]+1,p[E-1]+1,d[E-1]+x);if(f>1&&E>1&&i[f-1]===s[E-2]&&i[f-2]===s[E-1]){const j=u[(f-2)%3][E-2];M=Math.min(M,j+1)}M<y&&(y=M),p[E]=M}if(y>n)return}const c=u[o%3][a];return c<=n?c:void 0}}function Pi(e){const t=e.length,n=new Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r);return n}function Qe(e){if(e==null)return Object.create(null);if(Object.getPrototypeOf(e)===null)return e;const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]=r;return t}function nc(e){return`"${e.replace(rc,ic)}"`}const rc=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function ic(e){return sc[e.charCodeAt(0)]}const sc=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"],Rt=Object.freeze({});function Qt(e,t,n=xs){const r=new Map;for(const j of Object.values(l))r.set(j,xt(t,j));let i,s=Array.isArray(e),o=[e],a=-1,u=[],c=e,f,d;const p=[],y=[];do{a++;const j=a===o.length,Z=j&&u.length!==0;if(j){if(f=y.length===0?void 0:p[p.length-1],c=d,d=y.pop(),Z)if(s){c=c.slice();let B=0;for(const[U,k]of u){const D=U-B;k===null?(c.splice(D,1),B++):c[D]=k}}else{c=Object.defineProperties({},Object.getOwnPropertyDescriptors(c));for(const[B,U]of u)c[B]=U}a=i.index,o=i.keys,u=i.edits,s=i.inArray,i=i.prev}else if(d){if(f=s?a:o[a],c=d[f],c==null)continue;p.push(f)}let H;if(!Array.isArray(c)){var E,x;Sr(c)||K(!1,`Invalid AST Node: ${I(c)}.`);const B=j?(E=r.get(c.kind))===null||E===void 0?void 0:E.leave:(x=r.get(c.kind))===null||x===void 0?void 0:x.enter;if(H=B==null?void 0:B.call(t,c,f,d,p,y),H===Rt)break;if(H===!1){if(!j){p.pop();continue}}else if(H!==void 0&&(u.push([f,H]),!j))if(Sr(H))c=H;else{p.pop();continue}}if(H===void 0&&Z&&u.push([f,c]),j)p.pop();else{var M;i={inArray:s,index:a,keys:o,edits:u,prev:i},s=Array.isArray(c),o=s?c:(M=n[c.kind])!==null&&M!==void 0?M:[],a=-1,u=[],d&&y.push(d),d=c}}while(i!==void 0);return u.length!==0?u[u.length-1][1]:e}function Jr(e){const t=new Array(e.length).fill(null),n=Object.create(null);for(const r of Object.values(l)){let i=!1;const s=new Array(e.length).fill(void 0),o=new Array(e.length).fill(void 0);for(let u=0;u<e.length;++u){const{enter:c,leave:f}=xt(e[u],r);i||(i=c!=null||f!=null),s[u]=c,o[u]=f}if(!i)continue;const a={enter(...u){const c=u[0];for(let d=0;d<e.length;d++)if(t[d]===null){var f;const p=(f=s[d])===null||f===void 0?void 0:f.apply(e[d],u);if(p===!1)t[d]=c;else if(p===Rt)t[d]=Rt;else if(p!==void 0)return p}},leave(...u){const c=u[0];for(let d=0;d<e.length;d++)if(t[d]===null){var f;const p=(f=o[d])===null||f===void 0?void 0:f.apply(e[d],u);if(p===Rt)t[d]=Rt;else if(p!==void 0&&p!==!1)return p}else t[d]===c&&(t[d]=null)}};n[r]=a}return n}function xt(e,t){const n=e[t];return typeof n=="object"?n:typeof n=="function"?{enter:n,leave:void 0}:{enter:e.enter,leave:e.leave}}function oc(e,t,n){const{enter:r,leave:i}=xt(e,t);return n?i:r}function le(e){return Qt(e,uc)}const ac=80,uc={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>P(e.definitions,`
|
|
16
|
+
|
|
17
|
+
`)},OperationDefinition:{leave(e){const t=ee("(",P(e.variableDefinitions,", "),")"),n=P([e.operation,P([e.name,t]),P(e.directives," ")]," ");return(n==="query"?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+ee(" = ",n)+ee(" ",P(r," "))},SelectionSet:{leave:({selections:e})=>Ye(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const s=ee("",e,": ")+t;let o=s+ee("(",P(n,", "),")");return o.length>ac&&(o=s+ee(`(
|
|
18
|
+
`,$n(P(n,`
|
|
19
|
+
`)),`
|
|
20
|
+
)`)),P([o,P(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+ee(" ",P(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>P(["...",ee("on ",e),P(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${ee("(",P(n,", "),")")} on ${t} ${ee("",P(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?Vs(e):nc(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+P(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+P(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+ee("(",P(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>ee("",e,`
|
|
21
|
+
`)+P(["schema",P(t," "),Ye(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>ee("",e,`
|
|
22
|
+
`)+P(["scalar",t,P(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>ee("",e,`
|
|
23
|
+
`)+P(["type",t,ee("implements ",P(n," & ")),P(r," "),Ye(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>ee("",e,`
|
|
24
|
+
`)+t+(Ui(n)?ee(`(
|
|
25
|
+
`,$n(P(n,`
|
|
26
|
+
`)),`
|
|
27
|
+
)`):ee("(",P(n,", "),")"))+": "+r+ee(" ",P(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>ee("",e,`
|
|
28
|
+
`)+P([t+": "+n,ee("= ",r),P(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>ee("",e,`
|
|
29
|
+
`)+P(["interface",t,ee("implements ",P(n," & ")),P(r," "),Ye(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>ee("",e,`
|
|
30
|
+
`)+P(["union",t,P(n," "),ee("= ",P(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>ee("",e,`
|
|
31
|
+
`)+P(["enum",t,P(n," "),Ye(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>ee("",e,`
|
|
32
|
+
`)+P([t,P(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>ee("",e,`
|
|
33
|
+
`)+P(["input",t,P(n," "),Ye(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>ee("",e,`
|
|
34
|
+
`)+"directive @"+t+(Ui(n)?ee(`(
|
|
35
|
+
`,$n(P(n,`
|
|
36
|
+
`)),`
|
|
37
|
+
)`):ee("(",P(n,", "),")"))+(r?" repeatable":"")+" on "+P(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>P(["extend schema",P(e," "),Ye(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>P(["extend scalar",e,P(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>P(["extend type",e,ee("implements ",P(t," & ")),P(n," "),Ye(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>P(["extend interface",e,ee("implements ",P(t," & ")),P(n," "),Ye(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>P(["extend union",e,P(t," "),ee("= ",P(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>P(["extend enum",e,P(t," "),Ye(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>P(["extend input",e,P(t," "),Ye(n)]," ")}};function P(e,t=""){var n;return(n=e==null?void 0:e.filter(r=>r).join(t))!==null&&n!==void 0?n:""}function Ye(e){return ee(`{
|
|
38
|
+
`,$n(P(e,`
|
|
39
|
+
`)),`
|
|
40
|
+
}`)}function ee(e,t,n=""){return t!=null&&t!==""?e+t+n:""}function $n(e){return ee(" ",e.replace(/\n/g,`
|
|
41
|
+
`))}function Ui(e){var t;return(t=e==null?void 0:e.some(n=>n.includes(`
|
|
42
|
+
`)))!==null&&t!==void 0?t:!1}function Bn(e,t){switch(e.kind){case l.NULL:return null;case l.INT:return parseInt(e.value,10);case l.FLOAT:return parseFloat(e.value);case l.STRING:case l.ENUM:case l.BOOLEAN:return e.value;case l.LIST:return e.values.map(n=>Bn(n,t));case l.OBJECT:return ft(e.fields,n=>n.name.value,n=>Bn(n.value,t));case l.VARIABLE:return t==null?void 0:t[e.name.value]}}function Ue(e){if(e!=null||K(!1,"Must provide name."),typeof e=="string"||K(!1,"Expected name to be a string."),e.length===0)throw new _("Expected name to be a non-empty string.");for(let t=1;t<e.length;++t)if(!Ms(e.charCodeAt(t)))throw new _(`Names must only contain [_a-zA-Z0-9] but "${e}" does not.`);if(!Qr(e.charCodeAt(0)))throw new _(`Names must start with [_a-zA-Z] but "${e}" does not.`);return e}function Ys(e){if(e==="true"||e==="false"||e==="null")throw new _(`Enum values cannot be named: ${e}`);return Ue(e)}function En(e){return je(e)||te(e)||re(e)||Ne(e)||ge(e)||de(e)||fe(e)||X(e)}function cc(e){if(!En(e))throw new Error(`Expected ${I(e)} to be a GraphQL type.`);return e}function je(e){return We(e,rt)}function lc(e){if(!je(e))throw new Error(`Expected ${I(e)} to be a GraphQL Scalar type.`);return e}function te(e){return We(e,qe)}function Js(e){if(!te(e))throw new Error(`Expected ${I(e)} to be a GraphQL Object type.`);return e}function re(e){return We(e,Ct)}function Hs(e){if(!re(e))throw new Error(`Expected ${I(e)} to be a GraphQL Interface type.`);return e}function Ne(e){return We(e,Mt)}function fc(e){if(!Ne(e))throw new Error(`Expected ${I(e)} to be a GraphQL Union type.`);return e}function ge(e){return We(e,ht)}function dc(e){if(!ge(e))throw new Error(`Expected ${I(e)} to be a GraphQL Enum type.`);return e}function de(e){return We(e,Vt)}function pc(e){if(!de(e))throw new Error(`Expected ${I(e)} to be a GraphQL Input Object type.`);return e}function fe(e){return We(e,Oe)}function hc(e){if(!fe(e))throw new Error(`Expected ${I(e)} to be a GraphQL List type.`);return e}function X(e){return We(e,W)}function mc(e){if(!X(e))throw new Error(`Expected ${I(e)} to be a GraphQL Non-Null type.`);return e}function Fe(e){return je(e)||ge(e)||de(e)||gn(e)&&Fe(e.ofType)}function yc(e){if(!Fe(e))throw new Error(`Expected ${I(e)} to be a GraphQL input type.`);return e}function pt(e){return je(e)||te(e)||re(e)||Ne(e)||ge(e)||gn(e)&&pt(e.ofType)}function vc(e){if(!pt(e))throw new Error(`Expected ${I(e)} to be a GraphQL output type.`);return e}function tt(e){return je(e)||ge(e)}function Ec(e){if(!tt(e))throw new Error(`Expected ${I(e)} to be a GraphQL leaf type.`);return e}function nt(e){return te(e)||re(e)||Ne(e)}function gc(e){if(!nt(e))throw new Error(`Expected ${I(e)} to be a GraphQL composite type.`);return e}function Ze(e){return re(e)||Ne(e)}function Tc(e){if(!Ze(e))throw new Error(`Expected ${I(e)} to be a GraphQL abstract type.`);return e}class Oe{constructor(t){En(t)||K(!1,`Expected ${I(t)} to be a GraphQL type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLList"}toString(){return"["+String(this.ofType)+"]"}toJSON(){return this.toString()}}class W{constructor(t){Hr(t)||K(!1,`Expected ${I(t)} to be a GraphQL nullable type.`),this.ofType=t}get[Symbol.toStringTag](){return"GraphQLNonNull"}toString(){return String(this.ofType)+"!"}toJSON(){return this.toString()}}function gn(e){return fe(e)||X(e)}function bc(e){if(!gn(e))throw new Error(`Expected ${I(e)} to be a GraphQL wrapping type.`);return e}function Hr(e){return En(e)&&!X(e)}function zs(e){if(!Hr(e))throw new Error(`Expected ${I(e)} to be a GraphQL nullable type.`);return e}function zr(e){if(e)return X(e)?e.ofType:e}function Tn(e){return je(e)||te(e)||re(e)||Ne(e)||ge(e)||de(e)}function _c(e){if(!Tn(e))throw new Error(`Expected ${I(e)} to be a GraphQL named type.`);return e}function Le(e){if(e){let t=e;for(;gn(t);)t=t.ofType;return t}}function Xr(e){return typeof e=="function"?e():e}function Wr(e){return typeof e=="function"?e():e}class rt{constructor(t){var n,r,i,s;const o=(n=t.parseValue)!==null&&n!==void 0?n:Vi;this.name=Ue(t.name),this.description=t.description,this.specifiedByURL=t.specifiedByURL,this.serialize=(r=t.serialize)!==null&&r!==void 0?r:Vi,this.parseValue=o,this.parseLiteral=(i=t.parseLiteral)!==null&&i!==void 0?i:(a,u)=>o(Bn(a,u)),this.extensions=Qe(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(s=t.extensionASTNodes)!==null&&s!==void 0?s:[],t.specifiedByURL==null||typeof t.specifiedByURL=="string"||K(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${I(t.specifiedByURL)}.`),t.serialize==null||typeof t.serialize=="function"||K(!1,`${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"||K(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){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:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class qe{constructor(t){var n;this.name=Ue(t.name),this.description=t.description,this.isTypeOf=t.isTypeOf,this.extensions=Qe(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=()=>Ws(t),this._interfaces=()=>Xs(t),t.isTypeOf==null||typeof t.isTypeOf=="function"||K(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${I(t.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Zs(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Xs(e){var t;const n=Xr((t=e.interfaces)!==null&&t!==void 0?t:[]);return Array.isArray(n)||K(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function Ws(e){const t=Wr(e.fields);return Ft(t)||K(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),st(t,(n,r)=>{var i;Ft(n)||K(!1,`${e.name}.${r} field config must be an object.`),n.resolve==null||typeof n.resolve=="function"||K(!1,`${e.name}.${r} field resolver must be a function if provided, but got: ${I(n.resolve)}.`);const s=(i=n.args)!==null&&i!==void 0?i:{};return Ft(s)||K(!1,`${e.name}.${r} args must be an object with argument names as keys.`),{name:Ue(r),description:n.description,type:n.type,args:Ks(s),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:Qe(n.extensions),astNode:n.astNode}})}function Ks(e){return Object.entries(e).map(([t,n])=>({name:Ue(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:Qe(n.extensions),astNode:n.astNode}))}function Ft(e){return Pe(e)&&!Array.isArray(e)}function Zs(e){return st(e,t=>({description:t.description,type:t.type,args:eo(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function eo(e){return ft(e,t=>t.name,t=>({description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}))}function yt(e){return X(e.type)&&e.defaultValue===void 0}class Ct{constructor(t){var n;this.name=Ue(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=Qe(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=Ws.bind(void 0,t),this._interfaces=Xs.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||K(!1,`${this.name} must provide "resolveType" as a function, but got: ${I(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}getInterfaces(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:Zs(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}class Mt{constructor(t){var n;this.name=Ue(t.name),this.description=t.description,this.resolveType=t.resolveType,this.extensions=Qe(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._types=Nc.bind(void 0,t),t.resolveType==null||typeof t.resolveType=="function"||K(!1,`${this.name} must provide "resolveType" as a function, but got: ${I(t.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return typeof this._types=="function"&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Nc(e){const t=Xr(e.types);return Array.isArray(t)||K(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}class ht{constructor(t){var n;this.name=Ue(t.name),this.description=t.description,this.extensions=Qe(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._values=Ic(this.name,t.values),this._valueLookup=new Map(this._values.map(r=>[r.value,r])),this._nameLookup=at(this._values,r=>r.name)}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(t){return this._nameLookup[t]}serialize(t){const n=this._valueLookup.get(t);if(n===void 0)throw new _(`Enum "${this.name}" cannot represent value: ${I(t)}`);return n.name}parseValue(t){if(typeof t!="string"){const r=I(t);throw new _(`Enum "${this.name}" cannot represent non-string value: ${r}.`+Sn(this,r))}const n=this.getValue(t);if(n==null)throw new _(`Value "${t}" does not exist in "${this.name}" enum.`+Sn(this,t));return n.value}parseLiteral(t,n){if(t.kind!==l.ENUM){const i=le(t);throw new _(`Enum "${this.name}" cannot represent non-enum value: ${i}.`+Sn(this,i),{nodes:t})}const r=this.getValue(t.value);if(r==null){const i=le(t);throw new _(`Value "${i}" does not exist in "${this.name}" enum.`+Sn(this,i),{nodes:t})}return r.value}toConfig(){const t=ft(this.getValues(),n=>n.name,n=>({description:n.description,value:n.value,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,values:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Sn(e,t){const n=e.getValues().map(i=>i.name),r=mt(t,n);return ot("the enum value",r)}function Ic(e,t){return Ft(t)||K(!1,`${e} values must be an object with value names as keys.`),Object.entries(t).map(([n,r])=>(Ft(r)||K(!1,`${e}.${n} must refer to an object with a "value" key representing an internal value but got: ${I(r)}.`),{name:Ys(n),description:r.description,value:r.value!==void 0?r.value:n,deprecationReason:r.deprecationReason,extensions:Qe(r.extensions),astNode:r.astNode}))}class Vt{constructor(t){var n;this.name=Ue(t.name),this.description=t.description,this.extensions=Qe(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._fields=wc.bind(void 0,t)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields}toConfig(){const t=st(this.getFields(),n=>({description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:n.extensions,astNode:n.astNode}));return{name:this.name,description:this.description,fields:t,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function wc(e){const t=Wr(e.fields);return Ft(t)||K(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),st(t,(n,r)=>(!("resolve"in n)||K(!1,`${e.name}.${r} field has a resolve property, but Input Types cannot define resolvers.`),{name:Ue(r),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:Qe(n.extensions),astNode:n.astNode}))}function or(e){return X(e.type)&&e.defaultValue===void 0}function qn(e,t){return e===t?!0:X(e)&&X(t)||fe(e)&&fe(t)?qn(e.ofType,t.ofType):!1}function Tt(e,t,n){return t===n?!0:X(n)?X(t)?Tt(e,t.ofType,n.ofType):!1:X(t)?Tt(e,t.ofType,n):fe(n)?fe(t)?Tt(e,t.ofType,n.ofType):!1:fe(t)?!1:Ze(n)&&(re(t)||te(t))&&e.isSubType(n,t)}function kr(e,t,n){return t===n?!0:Ze(t)?Ze(n)?e.getPossibleTypes(t).some(r=>e.isSubType(n,r)):e.isSubType(t,n):Ze(n)?e.isSubType(n,t):!1}const xn=2147483647,Cn=-2147483648,to=new rt({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(e){const t=_n(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isInteger(n))throw new _(`Int cannot represent non-integer value: ${I(t)}`);if(n>xn||n<Cn)throw new _("Int cannot represent non 32-bit signed integer value: "+I(t));return n},parseValue(e){if(typeof e!="number"||!Number.isInteger(e))throw new _(`Int cannot represent non-integer value: ${I(e)}`);if(e>xn||e<Cn)throw new _(`Int cannot represent non 32-bit signed integer value: ${e}`);return e},parseLiteral(e){if(e.kind!==l.INT)throw new _(`Int cannot represent non-integer value: ${le(e)}`,{nodes:e});const t=parseInt(e.value,10);if(t>xn||t<Cn)throw new _(`Int cannot represent non 32-bit signed integer value: ${e.value}`,{nodes:e});return t}}),no=new rt({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(e){const t=_n(e);if(typeof t=="boolean")return t?1:0;let n=t;if(typeof t=="string"&&t!==""&&(n=Number(t)),typeof n!="number"||!Number.isFinite(n))throw new _(`Float cannot represent non numeric value: ${I(t)}`);return n},parseValue(e){if(typeof e!="number"||!Number.isFinite(e))throw new _(`Float cannot represent non numeric value: ${I(e)}`);return e},parseLiteral(e){if(e.kind!==l.FLOAT&&e.kind!==l.INT)throw new _(`Float cannot represent non numeric value: ${le(e)}`,e);return parseFloat(e.value)}}),me=new rt({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(e){const t=_n(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if(typeof t=="number"&&Number.isFinite(t))return t.toString();throw new _(`String cannot represent value: ${I(e)}`)},parseValue(e){if(typeof e!="string")throw new _(`String cannot represent a non string value: ${I(e)}`);return e},parseLiteral(e){if(e.kind!==l.STRING)throw new _(`String cannot represent a non string value: ${le(e)}`,{nodes:e});return e.value}}),Me=new rt({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize(e){const t=_n(e);if(typeof t=="boolean")return t;if(Number.isFinite(t))return t!==0;throw new _(`Boolean cannot represent a non boolean value: ${I(t)}`)},parseValue(e){if(typeof e!="boolean")throw new _(`Boolean cannot represent a non boolean value: ${I(e)}`);return e},parseLiteral(e){if(e.kind!==l.BOOLEAN)throw new _(`Boolean cannot represent a non boolean value: ${le(e)}`,{nodes:e});return e.value}}),Kr=new rt({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(e){const t=_n(e);if(typeof t=="string")return t;if(Number.isInteger(t))return String(t);throw new _(`ID cannot represent value: ${I(e)}`)},parseValue(e){if(typeof e=="string")return e;if(typeof e=="number"&&Number.isInteger(e))return e.toString();throw new _(`ID cannot represent value: ${I(e)}`)},parseLiteral(e){if(e.kind!==l.STRING&&e.kind!==l.INT)throw new _("ID cannot represent a non-string and non-integer value: "+le(e),{nodes:e});return e.value}}),bn=Object.freeze([me,to,no,Me,Kr]);function ar(e){return bn.some(({name:t})=>e.name===t)}function _n(e){if(Pe(e)){if(typeof e.valueOf=="function"){const t=e.valueOf();if(!Pe(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function ur(e){return We(e,it)}function Oc(e){if(!ur(e))throw new Error(`Expected ${I(e)} to be a GraphQL directive.`);return e}class it{constructor(t){var n,r;this.name=Ue(t.name),this.description=t.description,this.locations=t.locations,this.isRepeatable=(n=t.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=Qe(t.extensions),this.astNode=t.astNode,Array.isArray(t.locations)||K(!1,`@${t.name} locations must be an Array.`);const i=(r=t.args)!==null&&r!==void 0?r:{};Pe(i)&&!Array.isArray(i)||K(!1,`@${t.name} args must be an object with argument names as keys.`),this.args=Ks(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:eo(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}const Zr=new it({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[G.FIELD,G.FRAGMENT_SPREAD,G.INLINE_FRAGMENT],args:{if:{type:new W(Me),description:"Included when true."}}}),ei=new it({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[G.FIELD,G.FRAGMENT_SPREAD,G.INLINE_FRAGMENT],args:{if:{type:new W(Me),description:"Skipped when true."}}}),ti="No longer supported",cr=new it({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[G.FIELD_DEFINITION,G.ARGUMENT_DEFINITION,G.INPUT_FIELD_DEFINITION,G.ENUM_VALUE],args:{reason:{type:me,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:ti}}}),ni=new it({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[G.SCALAR],args:{url:{type:new W(me),description:"The URL that specifies the behavior of this scalar."}}}),vt=Object.freeze([Zr,ei,cr,ni]);function ri(e){return vt.some(({name:t})=>t===e.name)}function ii(e){return typeof e=="object"&&typeof(e==null?void 0:e[Symbol.iterator])=="function"}function dt(e,t){if(X(t)){const n=dt(e,t.ofType);return(n==null?void 0:n.kind)===l.NULL?null:n}if(e===null)return{kind:l.NULL};if(e===void 0)return null;if(fe(t)){const n=t.ofType;if(ii(e)){const r=[];for(const i of e){const s=dt(i,n);s!=null&&r.push(s)}return{kind:l.LIST,values:r}}return dt(e,n)}if(de(t)){if(!Pe(e))return null;const n=[];for(const r of Object.values(t.getFields())){const i=dt(e[r.name],r.type);i&&n.push({kind:l.OBJECT_FIELD,name:{kind:l.NAME,value:r.name},value:i})}return{kind:l.OBJECT,fields:n}}if(tt(t)){const n=t.serialize(e);if(n==null)return null;if(typeof n=="boolean")return{kind:l.BOOLEAN,value:n};if(typeof n=="number"&&Number.isFinite(n)){const r=String(n);return ji.test(r)?{kind:l.INT,value:r}:{kind:l.FLOAT,value:r}}if(typeof n=="string")return ge(t)?{kind:l.ENUM,value:n}:t===Kr&&ji.test(n)?{kind:l.INT,value:n}:{kind:l.STRING,value:n};throw new TypeError(`Cannot convert value to AST: ${I(n)}.`)}ye(!1,"Unexpected input type: "+I(t))}const ji=/^-?(?:0|[1-9][0-9]*)$/,lr=new qe({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:()=>({description:{type:me,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new W(new Oe(new W(Be))),resolve(e){return Object.values(e.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new W(Be),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Be,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Be,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new W(new Oe(new W(si))),resolve:e=>e.getDirectives()}})}),si=new qe({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
43
|
+
|
|
44
|
+
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:()=>({name:{type:new W(me),resolve:e=>e.name},description:{type:me,resolve:e=>e.description},isRepeatable:{type:new W(Me),resolve:e=>e.isRepeatable},locations:{type:new W(new Oe(new W(oi))),resolve:e=>e.locations},args:{type:new W(new Oe(new W(Nn))),args:{includeDeprecated:{type:Me,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}}})}),oi=new ht({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:G.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:G.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:G.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:G.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:G.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:G.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:G.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:G.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:G.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:G.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:G.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:G.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:G.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:G.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:G.UNION,description:"Location adjacent to a union definition."},ENUM:{value:G.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:G.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:G.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:G.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}}),Be=new qe({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:()=>({kind:{type:new W(ci),resolve(e){if(je(e))return oe.SCALAR;if(te(e))return oe.OBJECT;if(re(e))return oe.INTERFACE;if(Ne(e))return oe.UNION;if(ge(e))return oe.ENUM;if(de(e))return oe.INPUT_OBJECT;if(fe(e))return oe.LIST;if(X(e))return oe.NON_NULL;ye(!1,`Unexpected type: "${I(e)}".`)}},name:{type:me,resolve:e=>"name"in e?e.name:void 0},description:{type:me,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:me,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new Oe(new W(ai)),args:{includeDeprecated:{type:Me,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(te(e)||re(e)){const n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},interfaces:{type:new Oe(new W(Be)),resolve(e){if(te(e)||re(e))return e.getInterfaces()}},possibleTypes:{type:new Oe(new W(Be)),resolve(e,t,n,{schema:r}){if(Ze(e))return r.getPossibleTypes(e)}},enumValues:{type:new Oe(new W(ui)),args:{includeDeprecated:{type:Me,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(ge(e)){const n=e.getValues();return t?n:n.filter(r=>r.deprecationReason==null)}}},inputFields:{type:new Oe(new W(Nn)),args:{includeDeprecated:{type:Me,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if(de(e)){const n=Object.values(e.getFields());return t?n:n.filter(r=>r.deprecationReason==null)}}},ofType:{type:Be,resolve:e=>"ofType"in e?e.ofType:void 0}})}),ai=new qe({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:()=>({name:{type:new W(me),resolve:e=>e.name},description:{type:me,resolve:e=>e.description},args:{type:new W(new Oe(new W(Nn))),args:{includeDeprecated:{type:Me,defaultValue:!1}},resolve(e,{includeDeprecated:t}){return t?e.args:e.args.filter(n=>n.deprecationReason==null)}},type:{type:new W(Be),resolve:e=>e.type},isDeprecated:{type:new W(Me),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:me,resolve:e=>e.deprecationReason}})}),Nn=new qe({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:()=>({name:{type:new W(me),resolve:e=>e.name},description:{type:me,resolve:e=>e.description},type:{type:new W(Be),resolve:e=>e.type},defaultValue:{type:me,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=dt(n,t);return r?le(r):null}},isDeprecated:{type:new W(Me),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:me,resolve:e=>e.deprecationReason}})}),ui=new qe({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:()=>({name:{type:new W(me),resolve:e=>e.name},description:{type:me,resolve:e=>e.description},isDeprecated:{type:new W(Me),resolve:e=>e.deprecationReason!=null},deprecationReason:{type:me,resolve:e=>e.deprecationReason}})});var oe;(function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"})(oe||(oe={}));const ci=new ht({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:oe.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:oe.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:oe.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:oe.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:oe.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:oe.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:oe.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:oe.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}}),cn={name:"__schema",type:new W(lr),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},ln={name:"__type",type:Be,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new W(me),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},fn={name:"__typename",type:new W(me),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0},In=Object.freeze([lr,si,oi,Be,ai,Nn,ui,ci]);function Ot(e){return In.some(({name:t})=>e.name===t)}function ro(e){return We(e,Yt)}function li(e){if(!ro(e))throw new Error(`Expected ${I(e)} to be a GraphQL schema.`);return e}class Yt{constructor(t){var n,r;this.__validationErrors=t.assumeValid===!0?[]:void 0,Pe(t)||K(!1,"Must provide configuration object."),!t.types||Array.isArray(t.types)||K(!1,`"types" must be Array if provided but got: ${I(t.types)}.`),!t.directives||Array.isArray(t.directives)||K(!1,`"directives" must be Array if provided but got: ${I(t.directives)}.`),this.description=t.description,this.extensions=Qe(t.extensions),this.astNode=t.astNode,this.extensionASTNodes=(n=t.extensionASTNodes)!==null&&n!==void 0?n:[],this._queryType=t.query,this._mutationType=t.mutation,this._subscriptionType=t.subscription,this._directives=(r=t.directives)!==null&&r!==void 0?r:vt;const i=new Set(t.types);if(t.types!=null)for(const s of t.types)i.delete(s),Je(s,i);this._queryType!=null&&Je(this._queryType,i),this._mutationType!=null&&Je(this._mutationType,i),this._subscriptionType!=null&&Je(this._subscriptionType,i);for(const s of this._directives)if(ur(s))for(const o of s.args)Je(o.type,i);Je(lr,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(const s of i){if(s==null)continue;const o=s.name;if(o||K(!1,"One of the provided types for building the Schema is missing a name."),this._typeMap[o]!==void 0)throw new Error(`Schema must contain uniquely named types but contains multiple types named "${o}".`);if(this._typeMap[o]=s,re(s)){for(const a of s.getInterfaces())if(re(a)){let u=this._implementationsMap[a.name];u===void 0&&(u=this._implementationsMap[a.name]={objects:[],interfaces:[]}),u.interfaces.push(s)}}else if(te(s)){for(const a of s.getInterfaces())if(re(a)){let u=this._implementationsMap[a.name];u===void 0&&(u=this._implementationsMap[a.name]={objects:[],interfaces:[]}),u.objects.push(s)}}}}get[Symbol.toStringTag](){return"GraphQLSchema"}getQueryType(){return this._queryType}getMutationType(){return this._mutationType}getSubscriptionType(){return this._subscriptionType}getRootType(t){switch(t){case be.QUERY:return this.getQueryType();case be.MUTATION:return this.getMutationType();case be.SUBSCRIPTION:return this.getSubscriptionType()}}getTypeMap(){return this._typeMap}getType(t){return this.getTypeMap()[t]}getPossibleTypes(t){return Ne(t)?t.getTypes():this.getImplementations(t).objects}getImplementations(t){const n=this._implementationsMap[t.name];return n??{objects:[],interfaces:[]}}isSubType(t,n){let r=this._subTypeMap[t.name];if(r===void 0){if(r=Object.create(null),Ne(t))for(const i of t.getTypes())r[i.name]=!0;else{const i=this.getImplementations(t);for(const s of i.objects)r[s.name]=!0;for(const s of i.interfaces)r[s.name]=!0}this._subTypeMap[t.name]=r}return r[n.name]!==void 0}getDirectives(){return this._directives}getDirective(t){return this.getDirectives().find(n=>n.name===t)}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:this.__validationErrors!==void 0}}}function Je(e,t){const n=Le(e);if(!t.has(n)){if(t.add(n),Ne(n))for(const r of n.getTypes())Je(r,t);else if(te(n)||re(n)){for(const r of n.getInterfaces())Je(r,t);for(const r of Object.values(n.getFields())){Je(r.type,t);for(const i of r.args)Je(i.type,t)}}else if(de(n))for(const r of Object.values(n.getFields()))Je(r.type,t)}return t}function fi(e){if(li(e),e.__validationErrors)return e.__validationErrors;const t=new Dc(e);Ac(t),Sc(t),Rc(t);const n=t.getErrors();return e.__validationErrors=n,n}function di(e){const t=fi(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(`
|
|
45
|
+
|
|
46
|
+
`))}class Dc{constructor(t){this._errors=[],this.schema=t}reportError(t,n){const r=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new _(t,{nodes:r}))}getErrors(){return this._errors}}function Ac(e){const t=e.schema,n=t.getQueryType();if(!n)e.reportError("Query root type must be provided.",t.astNode);else if(!te(n)){var r;e.reportError(`Query root type must be Object type, it cannot be ${I(n)}.`,(r=Tr(t,be.QUERY))!==null&&r!==void 0?r:n.astNode)}const i=t.getMutationType();if(i&&!te(i)){var s;e.reportError(`Mutation root type must be Object type if provided, it cannot be ${I(i)}.`,(s=Tr(t,be.MUTATION))!==null&&s!==void 0?s:i.astNode)}const o=t.getSubscriptionType();if(o&&!te(o)){var a;e.reportError(`Subscription root type must be Object type if provided, it cannot be ${I(o)}.`,(a=Tr(t,be.SUBSCRIPTION))!==null&&a!==void 0?a:o.astNode)}}function Tr(e,t){var n;return(n=[e.astNode,...e.extensionASTNodes].flatMap(r=>{var i;return(i=r==null?void 0:r.operationTypes)!==null&&i!==void 0?i:[]}).find(r=>r.operation===t))===null||n===void 0?void 0:n.type}function Sc(e){for(const n of e.schema.getDirectives()){if(!ur(n)){e.reportError(`Expected directive but got: ${I(n)}.`,n==null?void 0:n.astNode);continue}wt(e,n);for(const r of n.args)if(wt(e,r),Fe(r.type)||e.reportError(`The type of @${n.name}(${r.name}:) must be Input Type but got: ${I(r.type)}.`,r.astNode),yt(r)&&r.deprecationReason!=null){var t;e.reportError(`Required argument @${n.name}(${r.name}:) cannot be deprecated.`,[pi(r.astNode),(t=r.astNode)===null||t===void 0?void 0:t.type])}}}function wt(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function Rc(e){const t=Cc(e),n=e.schema.getTypeMap();for(const r of Object.values(n)){if(!Tn(r)){e.reportError(`Expected GraphQL named type but got: ${I(r)}.`,r.astNode);continue}Ot(r)||wt(e,r),te(r)||re(r)?(Bi(e,r),qi(e,r)):Ne(r)?Fc(e,r):ge(r)?$c(e,r):de(r)&&(xc(e,r),t(r))}}function Bi(e,t){const n=Object.values(t.getFields());n.length===0&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const o of n){if(wt(e,o),!pt(o.type)){var r;e.reportError(`The type of ${t.name}.${o.name} must be Output Type but got: ${I(o.type)}.`,(r=o.astNode)===null||r===void 0?void 0:r.type)}for(const a of o.args){const u=a.name;if(wt(e,a),!Fe(a.type)){var i;e.reportError(`The type of ${t.name}.${o.name}(${u}:) must be Input Type but got: ${I(a.type)}.`,(i=a.astNode)===null||i===void 0?void 0:i.type)}if(yt(a)&&a.deprecationReason!=null){var s;e.reportError(`Required argument ${t.name}.${o.name}(${u}:) cannot be deprecated.`,[pi(a.astNode),(s=a.astNode)===null||s===void 0?void 0:s.type])}}}}function qi(e,t){const n=Object.create(null);for(const r of t.getInterfaces()){if(!re(r)){e.reportError(`Type ${I(t)} must only implement Interface types, it cannot implement ${I(r)}.`,rn(t,r));continue}if(t===r){e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,rn(t,r));continue}if(n[r.name]){e.reportError(`Type ${t.name} can only implement ${r.name} once.`,rn(t,r));continue}n[r.name]=!0,kc(e,t,r),Lc(e,t,r)}}function Lc(e,t,n){const r=t.getFields();for(const u of Object.values(n.getFields())){const c=u.name,f=r[c];if(!f){e.reportError(`Interface field ${n.name}.${c} expected but ${t.name} does not provide it.`,[u.astNode,t.astNode,...t.extensionASTNodes]);continue}if(!Tt(e.schema,f.type,u.type)){var i,s;e.reportError(`Interface field ${n.name}.${c} expects type ${I(u.type)} but ${t.name}.${c} is type ${I(f.type)}.`,[(i=u.astNode)===null||i===void 0?void 0:i.type,(s=f.astNode)===null||s===void 0?void 0:s.type])}for(const d of u.args){const p=d.name,y=f.args.find(E=>E.name===p);if(!y){e.reportError(`Interface field argument ${n.name}.${c}(${p}:) expected but ${t.name}.${c} does not provide it.`,[d.astNode,f.astNode]);continue}if(!qn(d.type,y.type)){var o,a;e.reportError(`Interface field argument ${n.name}.${c}(${p}:) expects type ${I(d.type)} but ${t.name}.${c}(${p}:) is type ${I(y.type)}.`,[(o=d.astNode)===null||o===void 0?void 0:o.type,(a=y.astNode)===null||a===void 0?void 0:a.type])}}for(const d of f.args){const p=d.name;!u.args.find(E=>E.name===p)&&yt(d)&&e.reportError(`Object field ${t.name}.${c} includes required argument ${p} that is missing from the Interface field ${n.name}.${c}.`,[d.astNode,u.astNode])}}}function kc(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...rn(n,i),...rn(t,n)])}function Fc(e,t){const n=t.getTypes();n.length===0&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const r=Object.create(null);for(const i of n){if(r[i.name]){e.reportError(`Union type ${t.name} can only include type ${i.name} once.`,Gi(t,i.name));continue}r[i.name]=!0,te(i)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${I(i)}.`,Gi(t,String(i)))}}function $c(e,t){const n=t.getValues();n.length===0&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const r of n)wt(e,r)}function xc(e,t){const n=Object.values(t.getFields());n.length===0&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const s of n){if(wt(e,s),!Fe(s.type)){var r;e.reportError(`The type of ${t.name}.${s.name} must be Input Type but got: ${I(s.type)}.`,(r=s.astNode)===null||r===void 0?void 0:r.type)}if(or(s)&&s.deprecationReason!=null){var i;e.reportError(`Required input field ${t.name}.${s.name} cannot be deprecated.`,[pi(s.astNode),(i=s.astNode)===null||i===void 0?void 0:i.type])}}}function Cc(e){const t=Object.create(null),n=[],r=Object.create(null);return i;function i(s){if(t[s.name])return;t[s.name]=!0,r[s.name]=n.length;const o=Object.values(s.getFields());for(const a of o)if(X(a.type)&&de(a.type.ofType)){const u=a.type.ofType,c=r[u.name];if(n.push(a),c===void 0)i(u);else{const f=n.slice(c),d=f.map(p=>p.name).join(".");e.reportError(`Cannot reference Input Object "${u.name}" within itself through a series of non-null fields: "${d}".`,f.map(p=>p.astNode))}n.pop()}r[s.name]=void 0}}function rn(e,t){const{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(s=>{var o;return(o=s.interfaces)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===t.name)}function Gi(e,t){const{astNode:n,extensionASTNodes:r}=e;return(n!=null?[n,...r]:r).flatMap(s=>{var o;return(o=s.types)!==null&&o!==void 0?o:[]}).filter(s=>s.name.value===t)}function pi(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(n=>n.name.value===cr.name)}function xe(e,t){switch(t.kind){case l.LIST_TYPE:{const n=xe(e,t.type);return n&&new Oe(n)}case l.NON_NULL_TYPE:{const n=xe(e,t.type);return n&&new W(n)}case l.NAMED_TYPE:return e.getType(t.name.value)}}class hi{constructor(t,n,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=r??Mc,n&&(Fe(n)&&this._inputTypeStack.push(n),nt(n)&&this._parentTypeStack.push(n),pt(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(t){const n=this._schema;switch(t.kind){case l.SELECTION_SET:{const i=Le(this.getType());this._parentTypeStack.push(nt(i)?i:void 0);break}case l.FIELD:{const i=this.getParentType();let s,o;i&&(s=this._getFieldDef(n,i,t),s&&(o=s.type)),this._fieldDefStack.push(s),this._typeStack.push(pt(o)?o:void 0);break}case l.DIRECTIVE:this._directive=n.getDirective(t.name.value);break;case l.OPERATION_DEFINITION:{const i=n.getRootType(t.operation);this._typeStack.push(te(i)?i:void 0);break}case l.INLINE_FRAGMENT:case l.FRAGMENT_DEFINITION:{const i=t.typeCondition,s=i?xe(n,i):Le(this.getType());this._typeStack.push(pt(s)?s:void 0);break}case l.VARIABLE_DEFINITION:{const i=xe(n,t.type);this._inputTypeStack.push(Fe(i)?i:void 0);break}case l.ARGUMENT:{var r;let i,s;const o=(r=this.getDirective())!==null&&r!==void 0?r:this.getFieldDef();o&&(i=o.args.find(a=>a.name===t.name.value),i&&(s=i.type)),this._argument=i,this._defaultValueStack.push(i?i.defaultValue:void 0),this._inputTypeStack.push(Fe(s)?s:void 0);break}case l.LIST:{const i=zr(this.getInputType()),s=fe(i)?i.ofType:i;this._defaultValueStack.push(void 0),this._inputTypeStack.push(Fe(s)?s:void 0);break}case l.OBJECT_FIELD:{const i=Le(this.getInputType());let s,o;de(i)&&(o=i.getFields()[t.name.value],o&&(s=o.type)),this._defaultValueStack.push(o?o.defaultValue:void 0),this._inputTypeStack.push(Fe(s)?s:void 0);break}case l.ENUM:{const i=Le(this.getInputType());let s;ge(i)&&(s=i.getValue(t.value)),this._enumValue=s;break}}}leave(t){switch(t.kind){case l.SELECTION_SET:this._parentTypeStack.pop();break;case l.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case l.DIRECTIVE:this._directive=null;break;case l.OPERATION_DEFINITION:case l.INLINE_FRAGMENT:case l.FRAGMENT_DEFINITION:this._typeStack.pop();break;case l.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case l.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case l.LIST:case l.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case l.ENUM:this._enumValue=null;break}}}function Mc(e,t,n){const r=n.name.value;if(r===cn.name&&e.getQueryType()===t)return cn;if(r===ln.name&&e.getQueryType()===t)return ln;if(r===fn.name&&nt(t))return fn;if(te(t)||re(t))return t.getFields()[r]}function mi(e,t){return{enter(...n){const r=n[0];e.enter(r);const i=xt(t,r.kind).enter;if(i){const s=i.apply(t,n);return s!==void 0&&(e.leave(r),Sr(s)&&e.enter(s)),s}},leave(...n){const r=n[0],i=xt(t,r.kind).leave;let s;return i&&(s=i.apply(t,n)),e.leave(r),s}}}function Vc(e){return yi(e)||vi(e)||Ei(e)}function yi(e){return e.kind===l.OPERATION_DEFINITION||e.kind===l.FRAGMENT_DEFINITION}function Pc(e){return e.kind===l.FIELD||e.kind===l.FRAGMENT_SPREAD||e.kind===l.INLINE_FRAGMENT}function io(e){return e.kind===l.VARIABLE||e.kind===l.INT||e.kind===l.FLOAT||e.kind===l.STRING||e.kind===l.BOOLEAN||e.kind===l.NULL||e.kind===l.ENUM||e.kind===l.LIST||e.kind===l.OBJECT}function Fr(e){return io(e)&&(e.kind===l.LIST?e.values.some(Fr):e.kind===l.OBJECT?e.fields.some(t=>Fr(t.value)):e.kind!==l.VARIABLE)}function Uc(e){return e.kind===l.NAMED_TYPE||e.kind===l.LIST_TYPE||e.kind===l.NON_NULL_TYPE}function vi(e){return e.kind===l.SCHEMA_DEFINITION||Jt(e)||e.kind===l.DIRECTIVE_DEFINITION}function Jt(e){return e.kind===l.SCALAR_TYPE_DEFINITION||e.kind===l.OBJECT_TYPE_DEFINITION||e.kind===l.INTERFACE_TYPE_DEFINITION||e.kind===l.UNION_TYPE_DEFINITION||e.kind===l.ENUM_TYPE_DEFINITION||e.kind===l.INPUT_OBJECT_TYPE_DEFINITION}function Ei(e){return e.kind===l.SCHEMA_EXTENSION||fr(e)}function fr(e){return e.kind===l.SCALAR_TYPE_EXTENSION||e.kind===l.OBJECT_TYPE_EXTENSION||e.kind===l.INTERFACE_TYPE_EXTENSION||e.kind===l.UNION_TYPE_EXTENSION||e.kind===l.ENUM_TYPE_EXTENSION||e.kind===l.INPUT_OBJECT_TYPE_EXTENSION}function so(e){return{Document(t){for(const n of t.definitions)if(!yi(n)){const r=n.kind===l.SCHEMA_DEFINITION||n.kind===l.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new _(`The ${r} definition is not executable.`,{nodes:n}))}return!1}}}function oo(e){return{Field(t){const n=e.getParentType();if(n&&!e.getFieldDef()){const i=e.getSchema(),s=t.name.value;let o=ot("to use an inline fragment on",jc(i,n,s));o===""&&(o=ot(Bc(n,s))),e.reportError(new _(`Cannot query field "${s}" on type "${n.name}".`+o,{nodes:t}))}}}}function jc(e,t,n){if(!Ze(t))return[];const r=new Set,i=Object.create(null);for(const o of e.getPossibleTypes(t))if(o.getFields()[n]){r.add(o),i[o.name]=1;for(const a of o.getInterfaces()){var s;a.getFields()[n]&&(r.add(a),i[a.name]=((s=i[a.name])!==null&&s!==void 0?s:0)+1)}}return[...r].sort((o,a)=>{const u=i[a.name]-i[o.name];return u!==0?u:re(o)&&e.isSubType(o,a)?-1:re(a)&&e.isSubType(a,o)?1:vn(o.name,a.name)}).map(o=>o.name)}function Bc(e,t){if(te(e)||re(e)){const n=Object.keys(e.getFields());return mt(t,n)}return[]}function ao(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const r=xe(e.getSchema(),n);if(r&&!nt(r)){const i=le(n);e.reportError(new _(`Fragment cannot condition on non composite type "${i}".`,{nodes:n}))}}},FragmentDefinition(t){const n=xe(e.getSchema(),t.typeCondition);if(n&&!nt(n)){const r=le(t.typeCondition);e.reportError(new _(`Fragment "${t.name.value}" cannot condition on non composite type "${r}".`,{nodes:t.typeCondition}))}}}}function uo(e){return{...co(e),Argument(t){const n=e.getArgument(),r=e.getFieldDef(),i=e.getParentType();if(!n&&r&&i){const s=t.name.value,o=r.args.map(u=>u.name),a=mt(s,o);e.reportError(new _(`Unknown argument "${s}" on field "${i.name}.${r.name}".`+ot(a),{nodes:t}))}}}}function co(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():vt;for(const o of r)t[o.name]=o.args.map(a=>a.name);const i=e.getDocument().definitions;for(const o of i)if(o.kind===l.DIRECTIVE_DEFINITION){var s;const a=(s=o.arguments)!==null&&s!==void 0?s:[];t[o.name.value]=a.map(u=>u.name.value)}return{Directive(o){const a=o.name.value,u=t[a];if(o.arguments&&u)for(const c of o.arguments){const f=c.name.value;if(!u.includes(f)){const d=mt(f,u);e.reportError(new _(`Unknown argument "${f}" on directive "@${a}".`+ot(d),{nodes:c}))}}return!1}}}function gi(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():vt;for(const s of r)t[s.name]=s.locations;const i=e.getDocument().definitions;for(const s of i)s.kind===l.DIRECTIVE_DEFINITION&&(t[s.name.value]=s.locations.map(o=>o.value));return{Directive(s,o,a,u,c){const f=s.name.value,d=t[f];if(!d){e.reportError(new _(`Unknown directive "@${f}".`,{nodes:s}));return}const p=qc(c);p&&!d.includes(p)&&e.reportError(new _(`Directive "@${f}" may not be used on ${p}.`,{nodes:s}))}}}function qc(e){const t=e[e.length-1];switch("kind"in t||ye(!1),t.kind){case l.OPERATION_DEFINITION:return Gc(t.operation);case l.FIELD:return G.FIELD;case l.FRAGMENT_SPREAD:return G.FRAGMENT_SPREAD;case l.INLINE_FRAGMENT:return G.INLINE_FRAGMENT;case l.FRAGMENT_DEFINITION:return G.FRAGMENT_DEFINITION;case l.VARIABLE_DEFINITION:return G.VARIABLE_DEFINITION;case l.SCHEMA_DEFINITION:case l.SCHEMA_EXTENSION:return G.SCHEMA;case l.SCALAR_TYPE_DEFINITION:case l.SCALAR_TYPE_EXTENSION:return G.SCALAR;case l.OBJECT_TYPE_DEFINITION:case l.OBJECT_TYPE_EXTENSION:return G.OBJECT;case l.FIELD_DEFINITION:return G.FIELD_DEFINITION;case l.INTERFACE_TYPE_DEFINITION:case l.INTERFACE_TYPE_EXTENSION:return G.INTERFACE;case l.UNION_TYPE_DEFINITION:case l.UNION_TYPE_EXTENSION:return G.UNION;case l.ENUM_TYPE_DEFINITION:case l.ENUM_TYPE_EXTENSION:return G.ENUM;case l.ENUM_VALUE_DEFINITION:return G.ENUM_VALUE;case l.INPUT_OBJECT_TYPE_DEFINITION:case l.INPUT_OBJECT_TYPE_EXTENSION:return G.INPUT_OBJECT;case l.INPUT_VALUE_DEFINITION:{const n=e[e.length-3];return"kind"in n||ye(!1),n.kind===l.INPUT_OBJECT_TYPE_DEFINITION?G.INPUT_FIELD_DEFINITION:G.ARGUMENT_DEFINITION}default:ye(!1,"Unexpected kind: "+I(t.kind))}}function Gc(e){switch(e){case be.QUERY:return G.QUERY;case be.MUTATION:return G.MUTATION;case be.SUBSCRIPTION:return G.SUBSCRIPTION}}function lo(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new _(`Unknown fragment "${n}".`,{nodes:t.name}))}}}function Ti(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);for(const s of e.getDocument().definitions)Jt(s)&&(r[s.name.value]=!0);const i=[...Object.keys(n),...Object.keys(r)];return{NamedType(s,o,a,u,c){const f=s.name.value;if(!n[f]&&!r[f]){var d;const p=(d=c[2])!==null&&d!==void 0?d:a,y=p!=null&&Qc(p);if(y&&Qi.includes(f))return;const E=mt(f,y?Qi.concat(i):i);e.reportError(new _(`Unknown type "${f}".`+ot(E),{nodes:s}))}}}}const Qi=[...bn,...In].map(e=>e.name);function Qc(e){return"kind"in e&&(vi(e)||Ei(e))}function fo(e){let t=0;return{Document(n){t=n.definitions.filter(r=>r.kind===l.OPERATION_DEFINITION).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new _("This anonymous operation must be the only defined operation.",{nodes:n}))}}}function po(e){var t,n,r;const i=e.getSchema(),s=(t=(n=(r=i==null?void 0:i.astNode)!==null&&r!==void 0?r:i==null?void 0:i.getQueryType())!==null&&n!==void 0?n:i==null?void 0:i.getMutationType())!==null&&t!==void 0?t:i==null?void 0:i.getSubscriptionType();let o=0;return{SchemaDefinition(a){if(s){e.reportError(new _("Cannot define a new schema within a schema extension.",{nodes:a}));return}o>0&&e.reportError(new _("Must provide only one schema definition.",{nodes:a})),++o}}}function ho(e){const t=Object.create(null),n=[],r=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(s){return i(s),!1}};function i(s){if(t[s.name.value])return;const o=s.name.value;t[o]=!0;const a=e.getFragmentSpreads(s.selectionSet);if(a.length!==0){r[o]=n.length;for(const u of a){const c=u.name.value,f=r[c];if(n.push(u),f===void 0){const d=e.getFragment(c);d&&i(d)}else{const d=n.slice(f),p=d.slice(0,-1).map(y=>'"'+y.name.value+'"').join(", ");e.reportError(new _(`Cannot spread fragment "${c}" within itself`+(p!==""?` via ${p}.`:"."),{nodes:d}))}n.pop()}r[o]=void 0}}}function mo(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:i}of r){const s=i.name.value;t[s]!==!0&&e.reportError(new _(n.name?`Variable "$${s}" is not defined by operation "${n.name.value}".`:`Variable "$${s}" is not defined.`,{nodes:[i,n]}))}}},VariableDefinition(n){t[n.variable.name.value]=!0}}}function yo(e){const t=[],n=[];return{OperationDefinition(r){return t.push(r),!1},FragmentDefinition(r){return n.push(r),!1},Document:{leave(){const r=Object.create(null);for(const i of t)for(const s of e.getRecursivelyReferencedFragments(i))r[s.name.value]=!0;for(const i of n){const s=i.name.value;r[s]!==!0&&e.reportError(new _(`Fragment "${s}" is never used.`,{nodes:i}))}}}}}function vo(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){const r=Object.create(null),i=e.getRecursiveVariableUsages(n);for(const{node:s}of i)r[s.name.value]=!0;for(const s of t){const o=s.variable.name.value;r[o]!==!0&&e.reportError(new _(n.name?`Variable "$${o}" is never used in operation "${n.name.value}".`:`Variable "$${o}" is never used.`,{nodes:s}))}}},VariableDefinition(n){t.push(n)}}}function dr(e){switch(e.kind){case l.OBJECT:return{...e,fields:Yc(e.fields)};case l.LIST:return{...e,values:e.values.map(dr)};case l.INT:case l.FLOAT:case l.STRING:case l.BOOLEAN:case l.NULL:case l.ENUM:case l.VARIABLE:return e}}function Yc(e){return e.map(t=>({...t,value:dr(t.value)})).sort((t,n)=>vn(t.name.value,n.name.value))}function Eo(e){return Array.isArray(e)?e.map(([t,n])=>`subfields "${t}" conflict because `+Eo(n)).join(" and "):e}function go(e){const t=new Wc,n=new Map;return{SelectionSet(r){const i=Jc(e,n,t,e.getParentType(),r);for(const[[s,o],a,u]of i){const c=Eo(o);e.reportError(new _(`Fields "${s}" conflict because ${c}. Use different aliases on the fields to fetch both if this was intentional.`,{nodes:a.concat(u)}))}}}}function Jc(e,t,n,r,i){const s=[],[o,a]=Yn(e,t,r,i);if(zc(e,s,t,n,o),a.length!==0)for(let u=0;u<a.length;u++){Gn(e,s,t,n,!1,o,a[u]);for(let c=u+1;c<a.length;c++)Qn(e,s,t,n,!1,a[u],a[c])}return s}function Gn(e,t,n,r,i,s,o){const a=e.getFragment(o);if(!a)return;const[u,c]=xr(e,n,a);if(s!==u){bi(e,t,n,r,i,s,u);for(const f of c)r.has(f,o,i)||(r.add(f,o,i),Gn(e,t,n,r,i,s,f))}}function Qn(e,t,n,r,i,s,o){if(s===o||r.has(s,o,i))return;r.add(s,o,i);const a=e.getFragment(s),u=e.getFragment(o);if(!a||!u)return;const[c,f]=xr(e,n,a),[d,p]=xr(e,n,u);bi(e,t,n,r,i,c,d);for(const y of p)Qn(e,t,n,r,i,s,y);for(const y of f)Qn(e,t,n,r,i,y,o)}function Hc(e,t,n,r,i,s,o,a){const u=[],[c,f]=Yn(e,t,i,s),[d,p]=Yn(e,t,o,a);bi(e,u,t,n,r,c,d);for(const y of p)Gn(e,u,t,n,r,c,y);for(const y of f)Gn(e,u,t,n,r,d,y);for(const y of f)for(const E of p)Qn(e,u,t,n,r,y,E);return u}function zc(e,t,n,r,i){for(const[s,o]of Object.entries(i))if(o.length>1)for(let a=0;a<o.length;a++)for(let u=a+1;u<o.length;u++){const c=To(e,n,r,!1,s,o[a],o[u]);c&&t.push(c)}}function bi(e,t,n,r,i,s,o){for(const[a,u]of Object.entries(s)){const c=o[a];if(c)for(const f of u)for(const d of c){const p=To(e,n,r,i,a,f,d);p&&t.push(p)}}}function To(e,t,n,r,i,s,o){const[a,u,c]=s,[f,d,p]=o,y=r||a!==f&&te(a)&&te(f);if(!y){const Z=u.name.value,H=d.name.value;if(Z!==H)return[[i,`"${Z}" and "${H}" are different fields`],[u],[d]];if(Yi(u)!==Yi(d))return[[i,"they have differing arguments"],[u],[d]]}const E=c==null?void 0:c.type,x=p==null?void 0:p.type;if(E&&x&&$r(E,x))return[[i,`they return conflicting types "${I(E)}" and "${I(x)}"`],[u],[d]];const M=u.selectionSet,j=d.selectionSet;if(M&&j){const Z=Hc(e,t,n,y,Le(E),M,Le(x),j);return Xc(Z,i,u,d)}}function Yi(e){var t;const n=(t=e.arguments)!==null&&t!==void 0?t:[],r={kind:l.OBJECT,fields:n.map(i=>({kind:l.OBJECT_FIELD,name:i.name,value:i.value}))};return le(dr(r))}function $r(e,t){return fe(e)?fe(t)?$r(e.ofType,t.ofType):!0:fe(t)?!0:X(e)?X(t)?$r(e.ofType,t.ofType):!0:X(t)?!0:tt(e)||tt(t)?e!==t:!1}function Yn(e,t,n,r){const i=t.get(r);if(i)return i;const s=Object.create(null),o=Object.create(null);bo(e,n,r,s,o);const a=[s,Object.keys(o)];return t.set(r,a),a}function xr(e,t,n){const r=t.get(n.selectionSet);if(r)return r;const i=xe(e.getSchema(),n.typeCondition);return Yn(e,t,i,n.selectionSet)}function bo(e,t,n,r,i){for(const s of n.selections)switch(s.kind){case l.FIELD:{const o=s.name.value;let a;(te(t)||re(t))&&(a=t.getFields()[o]);const u=s.alias?s.alias.value:o;r[u]||(r[u]=[]),r[u].push([t,s,a]);break}case l.FRAGMENT_SPREAD:i[s.name.value]=!0;break;case l.INLINE_FRAGMENT:{const o=s.typeCondition,a=o?xe(e.getSchema(),o):t;bo(e,a,s.selectionSet,r,i);break}}}function Xc(e,t,n,r){if(e.length>0)return[[t,e.map(([i])=>i)],[n,...e.map(([,i])=>i).flat()],[r,...e.map(([,,i])=>i).flat()]]}class Wc{constructor(){this._data=new Map}has(t,n,r){var i;const[s,o]=t<n?[t,n]:[n,t],a=(i=this._data.get(s))===null||i===void 0?void 0:i.get(o);return a===void 0?!1:r?!0:r===a}add(t,n,r){const[i,s]=t<n?[t,n]:[n,t],o=this._data.get(i);o===void 0?this._data.set(i,new Map([[s,r]])):o.set(s,r)}}function _o(e){return{InlineFragment(t){const n=e.getType(),r=e.getParentType();if(nt(n)&&nt(r)&&!kr(e.getSchema(),n,r)){const i=I(r),s=I(n);e.reportError(new _(`Fragment cannot be spread here as objects of type "${i}" can never be of type "${s}".`,{nodes:t}))}},FragmentSpread(t){const n=t.name.value,r=Kc(e,n),i=e.getParentType();if(r&&i&&!kr(e.getSchema(),r,i)){const s=I(i),o=I(r);e.reportError(new _(`Fragment "${n}" cannot be spread here as objects of type "${s}" can never be of type "${o}".`,{nodes:t}))}}}}function Kc(e,t){const n=e.getFragment(t);if(n){const r=xe(e.getSchema(),n.typeCondition);if(nt(r))return r}}function No(e){const t=e.getSchema(),n=Object.create(null);for(const i of e.getDocument().definitions)Jt(i)&&(n[i.name.value]=i);return{ScalarTypeExtension:r,ObjectTypeExtension:r,InterfaceTypeExtension:r,UnionTypeExtension:r,EnumTypeExtension:r,InputObjectTypeExtension:r};function r(i){const s=i.name.value,o=n[s],a=t==null?void 0:t.getType(s);let u;if(o?u=Zc[o.kind]:a&&(u=el(a)),u){if(u!==i.kind){const c=tl(i.kind);e.reportError(new _(`Cannot extend non-${c} type "${s}".`,{nodes:o?[o,i]:i}))}}else{const c=Object.keys({...n,...t==null?void 0:t.getTypeMap()}),f=mt(s,c);e.reportError(new _(`Cannot extend type "${s}" because it is not defined.`+ot(f),{nodes:i.name}))}}}const Zc={[l.SCALAR_TYPE_DEFINITION]:l.SCALAR_TYPE_EXTENSION,[l.OBJECT_TYPE_DEFINITION]:l.OBJECT_TYPE_EXTENSION,[l.INTERFACE_TYPE_DEFINITION]:l.INTERFACE_TYPE_EXTENSION,[l.UNION_TYPE_DEFINITION]:l.UNION_TYPE_EXTENSION,[l.ENUM_TYPE_DEFINITION]:l.ENUM_TYPE_EXTENSION,[l.INPUT_OBJECT_TYPE_DEFINITION]:l.INPUT_OBJECT_TYPE_EXTENSION};function el(e){if(je(e))return l.SCALAR_TYPE_EXTENSION;if(te(e))return l.OBJECT_TYPE_EXTENSION;if(re(e))return l.INTERFACE_TYPE_EXTENSION;if(Ne(e))return l.UNION_TYPE_EXTENSION;if(ge(e))return l.ENUM_TYPE_EXTENSION;if(de(e))return l.INPUT_OBJECT_TYPE_EXTENSION;ye(!1,"Unexpected type: "+I(e))}function tl(e){switch(e){case l.SCALAR_TYPE_EXTENSION:return"scalar";case l.OBJECT_TYPE_EXTENSION:return"object";case l.INTERFACE_TYPE_EXTENSION:return"interface";case l.UNION_TYPE_EXTENSION:return"union";case l.ENUM_TYPE_EXTENSION:return"enum";case l.INPUT_OBJECT_TYPE_EXTENSION:return"input object";default:ye(!1,"Unexpected kind: "+I(e))}}function Io(e){return{...wo(e),Field:{leave(t){var n;const r=e.getFieldDef();if(!r)return!1;const i=new Set((n=t.arguments)===null||n===void 0?void 0:n.map(s=>s.name.value));for(const s of r.args)if(!i.has(s.name)&&yt(s)){const o=I(s.type);e.reportError(new _(`Field "${r.name}" argument "${s.name}" of type "${o}" is required, but it was not provided.`,{nodes:t}))}}}}}function wo(e){var t;const n=Object.create(null),r=e.getSchema(),i=(t=r==null?void 0:r.getDirectives())!==null&&t!==void 0?t:vt;for(const a of i)n[a.name]=at(a.args.filter(yt),u=>u.name);const s=e.getDocument().definitions;for(const a of s)if(a.kind===l.DIRECTIVE_DEFINITION){var o;const u=(o=a.arguments)!==null&&o!==void 0?o:[];n[a.name.value]=at(u.filter(nl),c=>c.name.value)}return{Directive:{leave(a){const u=a.name.value,c=n[u];if(c){var f;const d=(f=a.arguments)!==null&&f!==void 0?f:[],p=new Set(d.map(y=>y.name.value));for(const[y,E]of Object.entries(c))if(!p.has(y)){const x=En(E.type)?I(E.type):le(E.type);e.reportError(new _(`Directive "@${u}" argument "${y}" of type "${x}" is required, but it was not provided.`,{nodes:a}))}}}}}}function nl(e){return e.type.kind===l.NON_NULL_TYPE&&e.defaultValue==null}function Oo(e){return{Field(t){const n=e.getType(),r=t.selectionSet;if(n){if(tt(Le(n))){if(r){const i=t.name.value,s=I(n);e.reportError(new _(`Field "${i}" must not have a selection since type "${s}" has no subfields.`,{nodes:r}))}}else if(!r){const i=t.name.value,s=I(n);e.reportError(new _(`Field "${i}" of type "${s}" must have a selection of subfields. Did you mean "${i} { ... }"?`,{nodes:t}))}}}}}function Do(e){return e.map(t=>typeof t=="number"?"["+t.toString()+"]":"."+t).join("")}function Pt(e,t,n){return{prev:e,key:t,typename:n}}function Ce(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}function Ao(e,t,n=rl){return Zt(e,t,n,void 0)}function rl(e,t,n){let r="Invalid value "+I(t);throw e.length>0&&(r+=` at "value${Do(e)}"`),n.message=r+": "+n.message,n}function Zt(e,t,n,r){if(X(t)){if(e!=null)return Zt(e,t.ofType,n,r);n(Ce(r),e,new _(`Expected non-nullable type "${I(t)}" not to be null.`));return}if(e==null)return null;if(fe(t)){const i=t.ofType;return ii(e)?Array.from(e,(s,o)=>{const a=Pt(r,o,void 0);return Zt(s,i,n,a)}):[Zt(e,i,n,r)]}if(de(t)){if(!Pe(e)){n(Ce(r),e,new _(`Expected type "${t.name}" to be an object.`));return}const i={},s=t.getFields();for(const o of Object.values(s)){const a=e[o.name];if(a===void 0){if(o.defaultValue!==void 0)i[o.name]=o.defaultValue;else if(X(o.type)){const u=I(o.type);n(Ce(r),e,new _(`Field "${o.name}" of required type "${u}" was not provided.`))}continue}i[o.name]=Zt(a,o.type,n,Pt(r,o.name,t.name))}for(const o of Object.keys(e))if(!s[o]){const a=mt(o,Object.keys(t.getFields()));n(Ce(r),e,new _(`Field "${o}" is not defined by type "${t.name}".`+ot(a)))}return i}if(tt(t)){let i;try{i=t.parseValue(e)}catch(s){s instanceof _?n(Ce(r),e,s):n(Ce(r),e,new _(`Expected type "${t.name}". `+s.message,{originalError:s}));return}return i===void 0&&n(Ce(r),e,new _(`Expected type "${t.name}".`)),i}ye(!1,"Unexpected input type: "+I(t))}function Ke(e,t,n){if(e){if(e.kind===l.VARIABLE){const r=e.name.value;if(n==null||n[r]===void 0)return;const i=n[r];return i===null&&X(t)?void 0:i}if(X(t))return e.kind===l.NULL?void 0:Ke(e,t.ofType,n);if(e.kind===l.NULL)return null;if(fe(t)){const r=t.ofType;if(e.kind===l.LIST){const s=[];for(const o of e.values)if(Ji(o,n)){if(X(r))return;s.push(null)}else{const a=Ke(o,r,n);if(a===void 0)return;s.push(a)}return s}const i=Ke(e,r,n);return i===void 0?void 0:[i]}if(de(t)){if(e.kind!==l.OBJECT)return;const r=Object.create(null),i=at(e.fields,s=>s.name.value);for(const s of Object.values(t.getFields())){const o=i[s.name];if(!o||Ji(o.value,n)){if(s.defaultValue!==void 0)r[s.name]=s.defaultValue;else if(X(s.type))return;continue}const a=Ke(o.value,s.type,n);if(a===void 0)return;r[s.name]=a}return r}if(tt(t)){let r;try{r=t.parseLiteral(e,n)}catch{return}return r===void 0?void 0:r}ye(!1,"Unexpected input type: "+I(t))}}function Ji(e,t){return e.kind===l.VARIABLE&&(t==null||t[e.name.value]===void 0)}function So(e,t,n,r){const i=[],s=r==null?void 0:r.maxErrors;try{const o=il(e,t,n,a=>{if(s!=null&&i.length>=s)throw new _("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:o}}catch(o){i.push(o)}return{errors:i}}function il(e,t,n,r){const i={};for(const s of t){const o=s.variable.name.value,a=xe(e,s.type);if(!Fe(a)){const c=le(s.type);r(new _(`Variable "$${o}" expected value of type "${c}" which cannot be used as an input type.`,{nodes:s.type}));continue}if(!Ro(n,o)){if(s.defaultValue)i[o]=Ke(s.defaultValue,a);else if(X(a)){const c=I(a);r(new _(`Variable "$${o}" of required type "${c}" was not provided.`,{nodes:s}))}continue}const u=n[o];if(u===null&&X(a)){const c=I(a);r(new _(`Variable "$${o}" of non-null type "${c}" must not be null.`,{nodes:s}));continue}i[o]=Ao(u,a,(c,f,d)=>{let p=`Variable "$${o}" got invalid value `+I(f);c.length>0&&(p+=` at "${o}${Do(c)}"`),r(new _(p+"; "+d.message,{nodes:s,originalError:d.originalError}))})}return i}function pr(e,t,n){var r;const i={},s=(r=t.arguments)!==null&&r!==void 0?r:[],o=at(s,a=>a.name.value);for(const a of e.args){const u=a.name,c=a.type,f=o[u];if(!f){if(a.defaultValue!==void 0)i[u]=a.defaultValue;else if(X(c))throw new _(`Argument "${u}" of required type "${I(c)}" was not provided.`,{nodes:t});continue}const d=f.value;let p=d.kind===l.NULL;if(d.kind===l.VARIABLE){const E=d.name.value;if(n==null||!Ro(n,E)){if(a.defaultValue!==void 0)i[u]=a.defaultValue;else if(X(c))throw new _(`Argument "${u}" of required type "${I(c)}" was provided the variable "$${E}" which was not provided a runtime value.`,{nodes:d});continue}p=n[E]==null}if(p&&X(c))throw new _(`Argument "${u}" of non-null type "${I(c)}" must not be null.`,{nodes:d});const y=Ke(d,c,n);if(y===void 0)throw new _(`Argument "${u}" has invalid value ${le(d)}.`,{nodes:d});i[u]=y}return i}function dn(e,t,n){var r;const i=(r=t.directives)===null||r===void 0?void 0:r.find(s=>s.name.value===e.name);if(i)return pr(e,i,n)}function Ro(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function _i(e,t,n,r,i){const s=new Map;return Jn(e,t,n,r,i,s,new Set),s}function sl(e,t,n,r,i){const s=new Map,o=new Set;for(const a of i)a.selectionSet&&Jn(e,t,n,r,a.selectionSet,s,o);return s}function Jn(e,t,n,r,i,s,o){for(const a of i.selections)switch(a.kind){case l.FIELD:{if(!br(n,a))continue;const u=ol(a),c=s.get(u);c!==void 0?c.push(a):s.set(u,[a]);break}case l.INLINE_FRAGMENT:{if(!br(n,a)||!Hi(e,a,r))continue;Jn(e,t,n,r,a.selectionSet,s,o);break}case l.FRAGMENT_SPREAD:{const u=a.name.value;if(o.has(u)||!br(n,a))continue;o.add(u);const c=t[u];if(!c||!Hi(e,c,r))continue;Jn(e,t,n,r,c.selectionSet,s,o);break}}}function br(e,t){const n=dn(ei,t,e);if((n==null?void 0:n.if)===!0)return!1;const r=dn(Zr,t,e);return(r==null?void 0:r.if)!==!1}function Hi(e,t,n){const r=t.typeCondition;if(!r)return!0;const i=xe(e,r);return i===n?!0:Ze(i)?e.isSubType(i,n):!1}function ol(e){return e.alias?e.alias.value:e.name.value}function Lo(e){return{OperationDefinition(t){if(t.operation==="subscription"){const n=e.getSchema(),r=n.getSubscriptionType();if(r){const i=t.name?t.name.value:null,s=Object.create(null),o=e.getDocument(),a=Object.create(null);for(const c of o.definitions)c.kind===l.FRAGMENT_DEFINITION&&(a[c.name.value]=c);const u=_i(n,a,s,r,t.selectionSet);if(u.size>1){const d=[...u.values()].slice(1).flat();e.reportError(new _(i!=null?`Subscription "${i}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:d}))}for(const c of u.values())c[0].name.value.startsWith("__")&&e.reportError(new _(i!=null?`Subscription "${i}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:c}))}}}}}function Ni(e,t){const n=new Map;for(const r of e){const i=t(r),s=n.get(i);s===void 0?n.set(i,[r]):s.push(r)}return n}function ko(e){return{DirectiveDefinition(r){var i;const s=(i=r.arguments)!==null&&i!==void 0?i:[];return n(`@${r.name.value}`,s)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(r){var i;const s=r.name.value,o=(i=r.fields)!==null&&i!==void 0?i:[];for(const u of o){var a;const c=u.name.value,f=(a=u.arguments)!==null&&a!==void 0?a:[];n(`${s}.${c}`,f)}return!1}function n(r,i){const s=Ni(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&e.reportError(new _(`Argument "${r}(${o}:)" can only be defined once.`,{nodes:a.map(u=>u.name)}));return!1}}function Ii(e){return{Field:t,Directive:t};function t(n){var r;const i=(r=n.arguments)!==null&&r!==void 0?r:[],s=Ni(i,o=>o.name.value);for(const[o,a]of s)a.length>1&&e.reportError(new _(`There can be only one argument named "${o}".`,{nodes:a.map(u=>u.name)}))}}function Fo(e){const t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(r){const i=r.name.value;if(n!=null&&n.getDirective(i)){e.reportError(new _(`Directive "@${i}" already exists in the schema. It cannot be redefined.`,{nodes:r.name}));return}return t[i]?e.reportError(new _(`There can be only one directive named "@${i}".`,{nodes:[t[i],r.name]})):t[i]=r.name,!1}}}function wi(e){const t=Object.create(null),n=e.getSchema(),r=n?n.getDirectives():vt;for(const a of r)t[a.name]=!a.isRepeatable;const i=e.getDocument().definitions;for(const a of i)a.kind===l.DIRECTIVE_DEFINITION&&(t[a.name.value]=!a.repeatable);const s=Object.create(null),o=Object.create(null);return{enter(a){if(!("directives"in a)||!a.directives)return;let u;if(a.kind===l.SCHEMA_DEFINITION||a.kind===l.SCHEMA_EXTENSION)u=s;else if(Jt(a)||fr(a)){const c=a.name.value;u=o[c],u===void 0&&(o[c]=u=Object.create(null))}else u=Object.create(null);for(const c of a.directives){const f=c.name.value;t[f]&&(u[f]?e.reportError(new _(`The directive "@${f}" can only be used once at this location.`,{nodes:[u[f],c]})):u[f]=c)}}}}function $o(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const u=(o=s.values)!==null&&o!==void 0?o:[],c=r[a];for(const f of u){const d=f.name.value,p=n[a];ge(p)&&p.getValue(d)?e.reportError(new _(`Enum value "${a}.${d}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:f.name})):c[d]?e.reportError(new _(`Enum value "${a}.${d}" can only be defined once.`,{nodes:[c[d],f.name]})):c[d]=f.name}return!1}}function xo(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),r=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(s){var o;const a=s.name.value;r[a]||(r[a]=Object.create(null));const u=(o=s.fields)!==null&&o!==void 0?o:[],c=r[a];for(const f of u){const d=f.name.value;al(n[a],d)?e.reportError(new _(`Field "${a}.${d}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:f.name})):c[d]?e.reportError(new _(`Field "${a}.${d}" can only be defined once.`,{nodes:[c[d],f.name]})):c[d]=f.name}return!1}}function al(e,t){return te(e)||re(e)||de(e)?e.getFields()[t]!=null:!1}function Co(e){const t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const r=n.name.value;return t[r]?e.reportError(new _(`There can be only one fragment named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name,!1}}}function Oi(e){const t=[];let n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){const r=t.pop();r||ye(!1),n=r}},ObjectField(r){const i=r.name.value;n[i]?e.reportError(new _(`There can be only one input field named "${i}".`,{nodes:[n[i],r.name]})):n[i]=r.name}}}function Mo(e){const t=Object.create(null);return{OperationDefinition(n){const r=n.name;return r&&(t[r.value]?e.reportError(new _(`There can be only one operation named "${r.value}".`,{nodes:[t[r.value],r]})):t[r.value]=r),!1},FragmentDefinition:()=>!1}}function Vo(e){const t=e.getSchema(),n=Object.create(null),r=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(s){var o;const a=(o=s.operationTypes)!==null&&o!==void 0?o:[];for(const u of a){const c=u.operation,f=n[c];r[c]?e.reportError(new _(`Type for ${c} already defined in the schema. It cannot be redefined.`,{nodes:u})):f?e.reportError(new _(`There can be only one ${c} type in schema.`,{nodes:[f,u]})):n[c]=u}return!1}}function Po(e){const t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:r,ObjectTypeDefinition:r,InterfaceTypeDefinition:r,UnionTypeDefinition:r,EnumTypeDefinition:r,InputObjectTypeDefinition:r};function r(i){const s=i.name.value;if(n!=null&&n.getType(s)){e.reportError(new _(`Type "${s}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}));return}return t[s]?e.reportError(new _(`There can be only one type named "${s}".`,{nodes:[t[s],i.name]})):t[s]=i.name,!1}}function Uo(e){return{OperationDefinition(t){var n;const r=(n=t.variableDefinitions)!==null&&n!==void 0?n:[],i=Ni(r,s=>s.variable.name.value);for(const[s,o]of i)o.length>1&&e.reportError(new _(`There can be only one variable named "$${s}".`,{nodes:o.map(a=>a.variable.name)}))}}}function jo(e){return{ListValue(t){const n=zr(e.getParentInputType());if(!fe(n))return Et(e,t),!1},ObjectValue(t){const n=Le(e.getInputType());if(!de(n))return Et(e,t),!1;const r=at(t.fields,i=>i.name.value);for(const i of Object.values(n.getFields()))if(!r[i.name]&&or(i)){const o=I(i.type);e.reportError(new _(`Field "${n.name}.${i.name}" of required type "${o}" was not provided.`,{nodes:t}))}},ObjectField(t){const n=Le(e.getParentInputType());if(!e.getInputType()&&de(n)){const i=mt(t.name.value,Object.keys(n.getFields()));e.reportError(new _(`Field "${t.name.value}" is not defined by type "${n.name}".`+ot(i),{nodes:t}))}},NullValue(t){const n=e.getInputType();X(n)&&e.reportError(new _(`Expected value of type "${I(n)}", found ${le(t)}.`,{nodes:t}))},EnumValue:t=>Et(e,t),IntValue:t=>Et(e,t),FloatValue:t=>Et(e,t),StringValue:t=>Et(e,t),BooleanValue:t=>Et(e,t)}}function Et(e,t){const n=e.getInputType();if(!n)return;const r=Le(n);if(!tt(r)){const i=I(n);e.reportError(new _(`Expected value of type "${i}", found ${le(t)}.`,{nodes:t}));return}try{if(r.parseLiteral(t,void 0)===void 0){const s=I(n);e.reportError(new _(`Expected value of type "${s}", found ${le(t)}.`,{nodes:t}))}}catch(i){const s=I(n);i instanceof _?e.reportError(i):e.reportError(new _(`Expected value of type "${s}", found ${le(t)}; `+i.message,{nodes:t,originalError:i}))}}function Bo(e){return{VariableDefinition(t){const n=xe(e.getSchema(),t.type);if(n!==void 0&&!Fe(n)){const r=t.variable.name.value,i=le(t.type);e.reportError(new _(`Variable "$${r}" cannot be non-input type "${i}".`,{nodes:t.type}))}}}}function qo(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const r=e.getRecursiveVariableUsages(n);for(const{node:i,type:s,defaultValue:o}of r){const a=i.name.value,u=t[a];if(u&&s){const c=e.getSchema(),f=xe(c,u.type);if(f&&!ul(c,f,u.defaultValue,s,o)){const d=I(f),p=I(s);e.reportError(new _(`Variable "$${a}" of type "${d}" used in position expecting type "${p}".`,{nodes:[u,i]}))}}}}},VariableDefinition(n){t[n.variable.name.value]=n}}}function ul(e,t,n,r,i){if(X(r)&&!X(t)){if(!(n!=null&&n.kind!==l.NULL)&&!(i!==void 0))return!1;const a=r.ofType;return Tt(e,t,a)}return Tt(e,t,r)}const Go=Object.freeze([so,Mo,fo,Lo,Ti,ao,Bo,Oo,oo,Co,lo,yo,_o,ho,Uo,mo,vo,gi,wi,uo,Ii,jo,Io,qo,go,Oi]),cl=Object.freeze([po,Vo,Po,$o,xo,ko,Fo,Ti,gi,wi,No,co,Ii,Oi,wo]);class Qo{constructor(t,n){this._ast=t,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(t){this._onError(t)}getDocument(){return this._ast}getFragment(t){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(const r of this.getDocument().definitions)r.kind===l.FRAGMENT_DEFINITION&&(n[r.name.value]=r);this._fragments=n}return n[t]}getFragmentSpreads(t){let n=this._fragmentSpreads.get(t);if(!n){n=[];const r=[t];let i;for(;i=r.pop();)for(const s of i.selections)s.kind===l.FRAGMENT_SPREAD?n.push(s):s.selectionSet&&r.push(s.selectionSet);this._fragmentSpreads.set(t,n)}return n}getRecursivelyReferencedFragments(t){let n=this._recursivelyReferencedFragments.get(t);if(!n){n=[];const r=Object.create(null),i=[t.selectionSet];let s;for(;s=i.pop();)for(const o of this.getFragmentSpreads(s)){const a=o.name.value;if(r[a]!==!0){r[a]=!0;const u=this.getFragment(a);u&&(n.push(u),i.push(u.selectionSet))}}this._recursivelyReferencedFragments.set(t,n)}return n}}class ll extends Qo{constructor(t,n,r){super(t,r),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}class Yo extends Qo{constructor(t,n,r,i){super(n,i),this._schema=t,this._typeInfo=r,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(t){let n=this._variableUsages.get(t);if(!n){const r=[],i=new hi(this._schema);Qt(t,mi(i,{VariableDefinition:()=>!1,Variable(s){r.push({node:s,type:i.getInputType(),defaultValue:i.getDefaultValue()})}})),n=r,this._variableUsages.set(t,n)}return n}getRecursiveVariableUsages(t){let n=this._recursiveVariableUsages.get(t);if(!n){n=this.getVariableUsages(t);for(const r of this.getRecursivelyReferencedFragments(t))n=n.concat(this.getVariableUsages(r));this._recursiveVariableUsages.set(t,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}function Jo(e,t,n=Go,r,i=new hi(e)){var s;const o=(s=r==null?void 0:r.maxErrors)!==null&&s!==void 0?s:100;t||K(!1,"Must provide document."),di(e);const a=Object.freeze({}),u=[],c=new Yo(e,t,i,d=>{if(u.length>=o)throw u.push(new _("Too many validation errors, error limit reached. Validation aborted.")),a;u.push(d)}),f=Jr(n.map(d=>d(c)));try{Qt(t,mi(i,f))}catch(d){if(d!==a)throw d}return u}function Ho(e,t,n=cl){const r=[],i=new ll(e,t,o=>{r.push(o)}),s=n.map(o=>o(i));return Qt(e,Jr(s)),r}function fl(e){const t=Ho(e);if(t.length!==0)throw new Error(t.map(n=>n.message).join(`
|
|
47
|
+
|
|
48
|
+
`))}function dl(e,t){const n=Ho(e,t);if(n.length!==0)throw new Error(n.map(r=>r.message).join(`
|
|
49
|
+
|
|
50
|
+
`))}function pl(e){let t;return function(r,i,s){t===void 0&&(t=new WeakMap);let o=t.get(r);o===void 0&&(o=new WeakMap,t.set(r,o));let a=o.get(i);a===void 0&&(a=new WeakMap,o.set(i,a));let u=a.get(s);return u===void 0&&(u=e(r,i,s),a.set(s,u)),u}}function hl(e){return Promise.all(Object.values(e)).then(t=>{const n=Object.create(null);for(const[r,i]of Object.keys(e).entries())n[i]=t[r];return n})}function ml(e,t,n){let r=n;for(const i of e)r=Ve(r)?r.then(s=>t(s,i)):t(r,i);return r}function yl(e){return e instanceof Error?e:new vl(e)}class vl extends Error{constructor(t){super("Unexpected error value: "+I(t)),this.name="NonErrorThrown",this.thrownValue=t}}function Ut(e,t,n){var r;const i=yl(e);return El(i)?i:new _(i.message,{nodes:(r=i.nodes)!==null&&r!==void 0?r:t,source:i.source,positions:i.positions,path:n,originalError:i})}function El(e){return Array.isArray(e.path)}const gl=pl((e,t,n)=>sl(e.schema,e.fragments,e.variableValues,t,n));function hr(e){arguments.length<2||K(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,document:n,variableValues:r,rootValue:i}=e;Xo(t,n,r);const s=Wo(e);if(!("schema"in s))return{errors:s};try{const{operation:o}=s,a=Tl(s,o,i);return Ve(a)?a.then(u=>Rn(u,s.errors),u=>(s.errors.push(u),Rn(null,s.errors))):Rn(a,s.errors)}catch(o){return s.errors.push(o),Rn(null,s.errors)}}function zo(e){const t=hr(e);if(Ve(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function Rn(e,t){return t.length===0?{data:e}:{errors:t,data:e}}function Xo(e,t,n){t||K(!1,"Must provide document."),di(e),n==null||Pe(n)||K(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function Wo(e){var t,n;const{schema:r,document:i,rootValue:s,contextValue:o,variableValues:a,operationName:u,fieldResolver:c,typeResolver:f,subscribeFieldResolver:d}=e;let p;const y=Object.create(null);for(const M of i.definitions)switch(M.kind){case l.OPERATION_DEFINITION:if(u==null){if(p!==void 0)return[new _("Must provide operation name if query contains multiple operations.")];p=M}else((t=M.name)===null||t===void 0?void 0:t.value)===u&&(p=M);break;case l.FRAGMENT_DEFINITION:y[M.name.value]=M;break}if(!p)return u!=null?[new _(`Unknown operation named "${u}".`)]:[new _("Must provide an operation.")];const E=(n=p.variableDefinitions)!==null&&n!==void 0?n:[],x=So(r,E,a??{},{maxErrors:50});return x.errors?x.errors:{schema:r,fragments:y,rootValue:s,contextValue:o,operation:p,variableValues:x.coerced,fieldResolver:c??Mr,typeResolver:f??ea,subscribeFieldResolver:d??Mr,errors:[]}}function Tl(e,t,n){const r=e.schema.getRootType(t.operation);if(r==null)throw new _(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});const i=_i(e.schema,e.fragments,e.variableValues,r,t.selectionSet),s=void 0;switch(t.operation){case be.QUERY:return Hn(e,r,n,s,i);case be.MUTATION:return bl(e,r,n,s,i);case be.SUBSCRIPTION:return Hn(e,r,n,s,i)}}function bl(e,t,n,r,i){return ml(i.entries(),(s,[o,a])=>{const u=Pt(r,o,t.name),c=Ko(e,t,n,a,u);return c===void 0?s:Ve(c)?c.then(f=>(s[o]=f,s)):(s[o]=c,s)},Object.create(null))}function Hn(e,t,n,r,i){const s=Object.create(null);let o=!1;for(const[a,u]of i.entries()){const c=Pt(r,a,t.name),f=Ko(e,t,n,u,c);f!==void 0&&(s[a]=f,Ve(f)&&(o=!0))}return o?hl(s):s}function Ko(e,t,n,r,i){var s;const o=ta(e.schema,t,r[0]);if(!o)return;const a=o.type,u=(s=o.resolve)!==null&&s!==void 0?s:e.fieldResolver,c=Zo(e,o,r,t,i);try{const f=pr(o,r[0],e.variableValues),d=e.contextValue,p=u(n,f,d,c);let y;return Ve(p)?y=p.then(E=>pn(e,a,r,c,i,E)):y=pn(e,a,r,c,i,p),Ve(y)?y.then(void 0,E=>{const x=Ut(E,r,Ce(i));return zn(x,a,e)}):y}catch(f){const d=Ut(f,r,Ce(i));return zn(d,a,e)}}function Zo(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function zn(e,t,n){if(X(t))throw e;return n.errors.push(e),null}function pn(e,t,n,r,i,s){if(s instanceof Error)throw s;if(X(t)){const o=pn(e,t.ofType,n,r,i,s);if(o===null)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return o}if(s==null)return null;if(fe(t))return _l(e,t,n,r,i,s);if(tt(t))return Nl(t,s);if(Ze(t))return Il(e,t,n,r,i,s);if(te(t))return Cr(e,t,n,r,i,s);ye(!1,"Cannot complete value of unexpected output type: "+I(t))}function _l(e,t,n,r,i,s){if(!ii(s))throw new _(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);const o=t.ofType;let a=!1;const u=Array.from(s,(c,f)=>{const d=Pt(i,f,void 0);try{let p;return Ve(c)?p=c.then(y=>pn(e,o,n,r,d,y)):p=pn(e,o,n,r,d,c),Ve(p)?(a=!0,p.then(void 0,y=>{const E=Ut(y,n,Ce(d));return zn(E,o,e)})):p}catch(p){const y=Ut(p,n,Ce(d));return zn(y,o,e)}});return a?Promise.all(u):u}function Nl(e,t){const n=e.serialize(t);if(n==null)throw new Error(`Expected \`${I(e)}.serialize(${I(t)})\` to return non-nullable value, returned: ${I(n)}`);return n}function Il(e,t,n,r,i,s){var o;const a=(o=t.resolveType)!==null&&o!==void 0?o:e.typeResolver,u=e.contextValue,c=a(s,u,r,t);return Ve(c)?c.then(f=>Cr(e,zi(f,e,t,n,r,s),n,r,i,s)):Cr(e,zi(c,e,t,n,r,s),n,r,i,s)}function zi(e,t,n,r,i,s){if(e==null)throw new _(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if(te(e))throw new _("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if(typeof e!="string")throw new _(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${i.parentType.name}.${i.fieldName}" with value ${I(s)}, received "${I(e)}".`);const o=t.schema.getType(e);if(o==null)throw new _(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!te(o))throw new _(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,o))throw new _(`Runtime Object type "${o.name}" is not a possible type for "${n.name}".`,{nodes:r});return o}function Cr(e,t,n,r,i,s){const o=gl(e,t,n);if(t.isTypeOf){const a=t.isTypeOf(s,e.contextValue,r);if(Ve(a))return a.then(u=>{if(!u)throw Xi(t,s,n);return Hn(e,t,s,i,o)});if(!a)throw Xi(t,s,n)}return Hn(e,t,s,i,o)}function Xi(e,t,n){return new _(`Expected value of type "${e.name}" but got: ${I(t)}.`,{nodes:n})}const ea=function(e,t,n,r){if(Pe(e)&&typeof e.__typename=="string")return e.__typename;const i=n.schema.getPossibleTypes(r),s=[];for(let o=0;o<i.length;o++){const a=i[o];if(a.isTypeOf){const u=a.isTypeOf(e,t,n);if(Ve(u))s[o]=u;else if(u)return a.name}}if(s.length)return Promise.all(s).then(o=>{for(let a=0;a<o.length;a++)if(o[a])return i[a].name})},Mr=function(e,t,n,r){if(Pe(e)||typeof e=="function"){const i=e[r.fieldName];return typeof i=="function"?e[r.fieldName](t,n,r):i}};function ta(e,t,n){const r=n.name.value;return r===cn.name&&e.getQueryType()===t?cn:r===ln.name&&e.getQueryType()===t?ln:r===fn.name?fn:t.getFields()[r]}function wl(e){return new Promise(t=>t(na(e)))}function Ol(e){const t=na(e);if(Ve(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function na(e){arguments.length<2||K(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,source:n,rootValue:r,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:u}=e,c=fi(t);if(c.length>0)return{errors:c};let f;try{f=ir(n)}catch(p){return{errors:[p]}}const d=Jo(t,f);return d.length>0?{errors:d}:hr({schema:t,document:f,rootValue:r,contextValue:i,variableValues:s,operationName:o,fieldResolver:a,typeResolver:u})}function ra(e){return typeof(e==null?void 0:e[Symbol.asyncIterator])=="function"}function Dl(e,t){const n=e[Symbol.asyncIterator]();async function r(i){if(i.done)return i;try{return{value:await t(i.value),done:!1}}catch(s){if(typeof n.return=="function")try{await n.return()}catch{}throw s}}return{async next(){return r(await n.next())},async return(){return typeof n.return=="function"?r(await n.return()):{value:void 0,done:!0}},async throw(i){if(typeof n.throw=="function")return r(await n.throw(i));throw i},[Symbol.asyncIterator](){return this}}}async function Al(e){arguments.length<2||K(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const t=await ia(e);return ra(t)?Dl(t,r=>hr({...e,rootValue:r})):t}function Sl(e){const t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}async function ia(...e){const t=Sl(e),{schema:n,document:r,variableValues:i}=t;Xo(n,r,i);const s=Wo(t);if(!("schema"in s))return{errors:s};try{const o=await Rl(s);if(!ra(o))throw new Error(`Subscription field must return Async Iterable. Received: ${I(o)}.`);return o}catch(o){if(o instanceof _)return{errors:[o]};throw o}}async function Rl(e){const{schema:t,fragments:n,operation:r,variableValues:i,rootValue:s}=e,o=t.getSubscriptionType();if(o==null)throw new _("Schema is not configured to execute subscription operation.",{nodes:r});const a=_i(t,n,i,o,r.selectionSet),[u,c]=[...a.entries()][0],f=ta(t,o,c[0]);if(!f){const E=c[0].name.value;throw new _(`The subscription field "${E}" is not defined.`,{nodes:c})}const d=Pt(void 0,u,o.name),p=Zo(e,f,c,o,d);try{var y;const E=pr(f,c[0],i),x=e.contextValue,j=await((y=f.subscribe)!==null&&y!==void 0?y:e.subscribeFieldResolver)(s,E,x,p);if(j instanceof Error)throw j;return j}catch(E){throw Ut(E,c,Ce(d))}}function Ll(e){return{Field(t){const n=e.getFieldDef(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){const i=e.getParentType();i!=null||ye(!1),e.reportError(new _(`The field ${i.name}.${n.name} is deprecated. ${r}`,{nodes:t}))}},Argument(t){const n=e.getArgument(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){const i=e.getDirective();if(i!=null)e.reportError(new _(`Directive "@${i.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}));else{const s=e.getParentType(),o=e.getFieldDef();s!=null&&o!=null||ye(!1),e.reportError(new _(`Field "${s.name}.${o.name}" argument "${n.name}" is deprecated. ${r}`,{nodes:t}))}}},ObjectField(t){const n=Le(e.getParentInputType());if(de(n)){const r=n.getFields()[t.name.value],i=r==null?void 0:r.deprecationReason;i!=null&&e.reportError(new _(`The input field ${n.name}.${r.name} is deprecated. ${i}`,{nodes:t}))}},EnumValue(t){const n=e.getEnumValue(),r=n==null?void 0:n.deprecationReason;if(n&&r!=null){const i=Le(e.getInputType());i!=null||ye(!1),e.reportError(new _(`The enum value "${i.name}.${n.name}" is deprecated. ${r}`,{nodes:t}))}}}}function kl(e){return{Field(t){const n=Le(e.getType());n&&Ot(n)&&e.reportError(new _(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}}function sa(e){const t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...e},n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"",s=t.schemaDescription?n:"";function o(a){return t.inputValueDeprecation?a:""}return`
|
|
51
|
+
query IntrospectionQuery {
|
|
52
|
+
__schema {
|
|
53
|
+
${s}
|
|
54
|
+
queryType { name }
|
|
55
|
+
mutationType { name }
|
|
56
|
+
subscriptionType { name }
|
|
57
|
+
types {
|
|
58
|
+
...FullType
|
|
59
|
+
}
|
|
60
|
+
directives {
|
|
61
|
+
name
|
|
62
|
+
${n}
|
|
63
|
+
${i}
|
|
64
|
+
locations
|
|
65
|
+
args${o("(includeDeprecated: true)")} {
|
|
66
|
+
...InputValue
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
fragment FullType on __Type {
|
|
73
|
+
kind
|
|
74
|
+
name
|
|
75
|
+
${n}
|
|
76
|
+
${r}
|
|
77
|
+
fields(includeDeprecated: true) {
|
|
78
|
+
name
|
|
79
|
+
${n}
|
|
80
|
+
args${o("(includeDeprecated: true)")} {
|
|
81
|
+
...InputValue
|
|
82
|
+
}
|
|
83
|
+
type {
|
|
84
|
+
...TypeRef
|
|
85
|
+
}
|
|
86
|
+
isDeprecated
|
|
87
|
+
deprecationReason
|
|
88
|
+
}
|
|
89
|
+
inputFields${o("(includeDeprecated: true)")} {
|
|
90
|
+
...InputValue
|
|
91
|
+
}
|
|
92
|
+
interfaces {
|
|
93
|
+
...TypeRef
|
|
94
|
+
}
|
|
95
|
+
enumValues(includeDeprecated: true) {
|
|
96
|
+
name
|
|
97
|
+
${n}
|
|
98
|
+
isDeprecated
|
|
99
|
+
deprecationReason
|
|
100
|
+
}
|
|
101
|
+
possibleTypes {
|
|
102
|
+
...TypeRef
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
fragment InputValue on __InputValue {
|
|
107
|
+
name
|
|
108
|
+
${n}
|
|
109
|
+
type { ...TypeRef }
|
|
110
|
+
defaultValue
|
|
111
|
+
${o("isDeprecated")}
|
|
112
|
+
${o("deprecationReason")}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
fragment TypeRef on __Type {
|
|
116
|
+
kind
|
|
117
|
+
name
|
|
118
|
+
ofType {
|
|
119
|
+
kind
|
|
120
|
+
name
|
|
121
|
+
ofType {
|
|
122
|
+
kind
|
|
123
|
+
name
|
|
124
|
+
ofType {
|
|
125
|
+
kind
|
|
126
|
+
name
|
|
127
|
+
ofType {
|
|
128
|
+
kind
|
|
129
|
+
name
|
|
130
|
+
ofType {
|
|
131
|
+
kind
|
|
132
|
+
name
|
|
133
|
+
ofType {
|
|
134
|
+
kind
|
|
135
|
+
name
|
|
136
|
+
ofType {
|
|
137
|
+
kind
|
|
138
|
+
name
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
`}function Fl(e,t){let n=null;for(const i of e.definitions)if(i.kind===l.OPERATION_DEFINITION){var r;if(t==null){if(n)return null;n=i}else if(((r=i.name)===null||r===void 0?void 0:r.value)===t)return i}return n}function $l(e,t){if(t.operation==="query"){const n=e.getQueryType();if(!n)throw new _("Schema does not define the required query root type.",{nodes:t});return n}if(t.operation==="mutation"){const n=e.getMutationType();if(!n)throw new _("Schema is not configured for mutations.",{nodes:t});return n}if(t.operation==="subscription"){const n=e.getSubscriptionType();if(!n)throw new _("Schema is not configured for subscriptions.",{nodes:t});return n}throw new _("Can only have query, mutation and subscription operations.",{nodes:t})}function xl(e,t){const n={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,...t},r=ir(sa(n)),i=zo({schema:e,document:r});return!i.errors&&i.data||ye(!1),i.data}function Cl(e,t){Pe(e)&&Pe(e.__schema)||K(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${I(e)}.`);const n=e.__schema,r=ft(n.types,g=>g.name,g=>p(g));for(const g of[...bn,...In])r[g.name]&&(r[g.name]=g);const i=n.queryType?f(n.queryType):null,s=n.mutationType?f(n.mutationType):null,o=n.subscriptionType?f(n.subscriptionType):null,a=n.directives?n.directives.map(Q):[];return new Yt({description:n.description,query:i,mutation:s,subscription:o,types:Object.values(r),directives:a,assumeValid:t==null?void 0:t.assumeValid});function u(g){if(g.kind===oe.LIST){const v=g.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");return new Oe(u(v))}if(g.kind===oe.NON_NULL){const v=g.ofType;if(!v)throw new Error("Decorated type deeper than introspection query.");const C=u(v);return new W(zs(C))}return c(g)}function c(g){const v=g.name;if(!v)throw new Error(`Unknown type reference: ${I(g)}.`);const C=r[v];if(!C)throw new Error(`Invalid or incomplete schema, unknown type: ${v}. Ensure that a full introspection query is used in order to build a client schema.`);return C}function f(g){return Js(c(g))}function d(g){return Hs(c(g))}function p(g){if(g!=null&&g.name!=null&&g.kind!=null)switch(g.kind){case oe.SCALAR:return y(g);case oe.OBJECT:return x(g);case oe.INTERFACE:return M(g);case oe.UNION:return j(g);case oe.ENUM:return Z(g);case oe.INPUT_OBJECT:return H(g)}const v=I(g);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${v}.`)}function y(g){return new rt({name:g.name,description:g.description,specifiedByURL:g.specifiedByURL})}function E(g){if(g.interfaces===null&&g.kind===oe.INTERFACE)return[];if(!g.interfaces){const v=I(g);throw new Error(`Introspection result missing interfaces: ${v}.`)}return g.interfaces.map(d)}function x(g){return new qe({name:g.name,description:g.description,interfaces:()=>E(g),fields:()=>B(g)})}function M(g){return new Ct({name:g.name,description:g.description,interfaces:()=>E(g),fields:()=>B(g)})}function j(g){if(!g.possibleTypes){const v=I(g);throw new Error(`Introspection result missing possibleTypes: ${v}.`)}return new Mt({name:g.name,description:g.description,types:()=>g.possibleTypes.map(f)})}function Z(g){if(!g.enumValues){const v=I(g);throw new Error(`Introspection result missing enumValues: ${v}.`)}return new ht({name:g.name,description:g.description,values:ft(g.enumValues,v=>v.name,v=>({description:v.description,deprecationReason:v.deprecationReason}))})}function H(g){if(!g.inputFields){const v=I(g);throw new Error(`Introspection result missing inputFields: ${v}.`)}return new Vt({name:g.name,description:g.description,fields:()=>k(g.inputFields)})}function B(g){if(!g.fields)throw new Error(`Introspection result missing fields: ${I(g)}.`);return ft(g.fields,v=>v.name,U)}function U(g){const v=u(g.type);if(!pt(v)){const C=I(v);throw new Error(`Introspection must provide output type for fields, but received: ${C}.`)}if(!g.args){const C=I(g);throw new Error(`Introspection result missing field args: ${C}.`)}return{description:g.description,deprecationReason:g.deprecationReason,type:v,args:k(g.args)}}function k(g){return ft(g,v=>v.name,D)}function D(g){const v=u(g.type);if(!Fe(v)){const z=I(v);throw new Error(`Introspection must provide input type for arguments, but received: ${z}.`)}const C=g.defaultValue!=null?Ke(Gs(g.defaultValue),v):void 0;return{description:g.description,type:v,defaultValue:C,deprecationReason:g.deprecationReason}}function Q(g){if(!g.args){const v=I(g);throw new Error(`Introspection result missing directive args: ${v}.`)}if(!g.locations){const v=I(g);throw new Error(`Introspection result missing directive locations: ${v}.`)}return new it({name:g.name,description:g.description,isRepeatable:g.isRepeatable,locations:g.locations.slice(),args:k(g.args)})}}function Ml(e,t,n){li(e),t!=null&&t.kind===l.DOCUMENT||K(!1,"Must provide valid Document AST."),(n==null?void 0:n.assumeValid)!==!0&&(n==null?void 0:n.assumeValidSDL)!==!0&&dl(t,e);const r=e.toConfig(),i=oa(r,t,n);return r===i?e:new Yt(i)}function oa(e,t,n){var r,i,s,o;const a=[],u=Object.create(null),c=[];let f;const d=[];for(const h of t.definitions)if(h.kind===l.SCHEMA_DEFINITION)f=h;else if(h.kind===l.SCHEMA_EXTENSION)d.push(h);else if(Jt(h))a.push(h);else if(fr(h)){const R=h.name.value,O=u[R];u[R]=O?O.concat([h]):[h]}else h.kind===l.DIRECTIVE_DEFINITION&&c.push(h);if(Object.keys(u).length===0&&a.length===0&&c.length===0&&d.length===0&&f==null)return e;const p=Object.create(null);for(const h of e.types)p[h.name]=Z(h);for(const h of a){var y;const R=h.name.value;p[R]=(y=Wi[R])!==null&&y!==void 0?y:L(h)}const E={query:e.query&&M(e.query),mutation:e.mutation&&M(e.mutation),subscription:e.subscription&&M(e.subscription),...f&&C([f]),...C(d)};return{description:(r=f)===null||r===void 0||(i=r.description)===null||i===void 0?void 0:i.value,...E,types:Object.values(p),directives:[...e.directives.map(j),...c.map(m)],extensions:Object.create(null),astNode:(s=f)!==null&&s!==void 0?s:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(d),assumeValid:(o=n==null?void 0:n.assumeValid)!==null&&o!==void 0?o:!1};function x(h){return fe(h)?new Oe(x(h.ofType)):X(h)?new W(x(h.ofType)):M(h)}function M(h){return p[h.name]}function j(h){const R=h.toConfig();return new it({...R,args:st(R.args,v)})}function Z(h){if(Ot(h)||ar(h))return h;if(je(h))return U(h);if(te(h))return k(h);if(re(h))return D(h);if(Ne(h))return Q(h);if(ge(h))return B(h);if(de(h))return H(h);ye(!1,"Unexpected type: "+I(h))}function H(h){var R;const O=h.toConfig(),F=(R=u[O.name])!==null&&R!==void 0?R:[];return new Vt({...O,fields:()=>({...st(O.fields,$=>({...$,type:x($.type)})),...T(F)}),extensionASTNodes:O.extensionASTNodes.concat(F)})}function B(h){var R;const O=h.toConfig(),F=(R=u[h.name])!==null&&R!==void 0?R:[];return new ht({...O,values:{...O.values,...w(F)},extensionASTNodes:O.extensionASTNodes.concat(F)})}function U(h){var R;const O=h.toConfig(),F=(R=u[O.name])!==null&&R!==void 0?R:[];let $=O.specifiedByURL;for(const J of F){var Y;$=(Y=Ki(J))!==null&&Y!==void 0?Y:$}return new rt({...O,specifiedByURL:$,extensionASTNodes:O.extensionASTNodes.concat(F)})}function k(h){var R;const O=h.toConfig(),F=(R=u[O.name])!==null&&R!==void 0?R:[];return new qe({...O,interfaces:()=>[...h.getInterfaces().map(M),...b(F)],fields:()=>({...st(O.fields,g),...A(F)}),extensionASTNodes:O.extensionASTNodes.concat(F)})}function D(h){var R;const O=h.toConfig(),F=(R=u[O.name])!==null&&R!==void 0?R:[];return new Ct({...O,interfaces:()=>[...h.getInterfaces().map(M),...b(F)],fields:()=>({...st(O.fields,g),...A(F)}),extensionASTNodes:O.extensionASTNodes.concat(F)})}function Q(h){var R;const O=h.toConfig(),F=(R=u[O.name])!==null&&R!==void 0?R:[];return new Mt({...O,types:()=>[...h.getTypes().map(M),...S(F)],extensionASTNodes:O.extensionASTNodes.concat(F)})}function g(h){return{...h,type:x(h.type),args:h.args&&st(h.args,v)}}function v(h){return{...h,type:x(h.type)}}function C(h){const R={};for(const F of h){var O;const $=(O=F.operationTypes)!==null&&O!==void 0?O:[];for(const Y of $)R[Y.operation]=z(Y.type)}return R}function z(h){var R;const O=h.name.value,F=(R=Wi[O])!==null&&R!==void 0?R:p[O];if(F===void 0)throw new Error(`Unknown type: "${O}".`);return F}function ie(h){return h.kind===l.LIST_TYPE?new Oe(ie(h.type)):h.kind===l.NON_NULL_TYPE?new W(ie(h.type)):z(h)}function m(h){var R;return new it({name:h.name.value,description:(R=h.description)===null||R===void 0?void 0:R.value,locations:h.locations.map(({value:O})=>O),isRepeatable:h.repeatable,args:q(h.arguments),astNode:h})}function A(h){const R=Object.create(null);for(const $ of h){var O;const Y=(O=$.fields)!==null&&O!==void 0?O:[];for(const J of Y){var F;R[J.name.value]={type:ie(J.type),description:(F=J.description)===null||F===void 0?void 0:F.value,args:q(J.arguments),deprecationReason:Ln(J),astNode:J}}}return R}function q(h){const R=h??[],O=Object.create(null);for(const $ of R){var F;const Y=ie($.type);O[$.name.value]={type:Y,description:(F=$.description)===null||F===void 0?void 0:F.value,defaultValue:Ke($.defaultValue,Y),deprecationReason:Ln($),astNode:$}}return O}function T(h){const R=Object.create(null);for(const $ of h){var O;const Y=(O=$.fields)!==null&&O!==void 0?O:[];for(const J of Y){var F;const ne=ie(J.type);R[J.name.value]={type:ne,description:(F=J.description)===null||F===void 0?void 0:F.value,defaultValue:Ke(J.defaultValue,ne),deprecationReason:Ln(J),astNode:J}}}return R}function w(h){const R=Object.create(null);for(const $ of h){var O;const Y=(O=$.values)!==null&&O!==void 0?O:[];for(const J of Y){var F;R[J.name.value]={description:(F=J.description)===null||F===void 0?void 0:F.value,deprecationReason:Ln(J),astNode:J}}}return R}function b(h){return h.flatMap(R=>{var O,F;return(O=(F=R.interfaces)===null||F===void 0?void 0:F.map(z))!==null&&O!==void 0?O:[]})}function S(h){return h.flatMap(R=>{var O,F;return(O=(F=R.types)===null||F===void 0?void 0:F.map(z))!==null&&O!==void 0?O:[]})}function L(h){var R;const O=h.name.value,F=(R=u[O])!==null&&R!==void 0?R:[];switch(h.kind){case l.OBJECT_TYPE_DEFINITION:{var $;const pe=[h,...F];return new qe({name:O,description:($=h.description)===null||$===void 0?void 0:$.value,interfaces:()=>b(pe),fields:()=>A(pe),astNode:h,extensionASTNodes:F})}case l.INTERFACE_TYPE_DEFINITION:{var Y;const pe=[h,...F];return new Ct({name:O,description:(Y=h.description)===null||Y===void 0?void 0:Y.value,interfaces:()=>b(pe),fields:()=>A(pe),astNode:h,extensionASTNodes:F})}case l.ENUM_TYPE_DEFINITION:{var J;const pe=[h,...F];return new ht({name:O,description:(J=h.description)===null||J===void 0?void 0:J.value,values:w(pe),astNode:h,extensionASTNodes:F})}case l.UNION_TYPE_DEFINITION:{var ne;const pe=[h,...F];return new Mt({name:O,description:(ne=h.description)===null||ne===void 0?void 0:ne.value,types:()=>S(pe),astNode:h,extensionASTNodes:F})}case l.SCALAR_TYPE_DEFINITION:{var ve;return new rt({name:O,description:(ve=h.description)===null||ve===void 0?void 0:ve.value,specifiedByURL:Ki(h),astNode:h,extensionASTNodes:F})}case l.INPUT_OBJECT_TYPE_DEFINITION:{var ae;const pe=[h,...F];return new Vt({name:O,description:(ae=h.description)===null||ae===void 0?void 0:ae.value,fields:()=>T(pe),astNode:h,extensionASTNodes:F})}}}}const Wi=at([...bn,...In],e=>e.name);function Ln(e){const t=dn(cr,e);return t==null?void 0:t.reason}function Ki(e){const t=dn(ni,e);return t==null?void 0:t.url}function aa(e,t){e!=null&&e.kind===l.DOCUMENT||K(!1,"Must provide valid Document AST."),(t==null?void 0:t.assumeValid)!==!0&&(t==null?void 0:t.assumeValidSDL)!==!0&&fl(e);const r=oa({description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},e,t);if(r.astNode==null)for(const s of r.types)switch(s.name){case"Query":r.query=s;break;case"Mutation":r.mutation=s;break;case"Subscription":r.subscription=s;break}const i=[...r.directives,...vt.filter(s=>r.directives.every(o=>o.name!==s.name))];return new Yt({...r,directives:i})}function Vl(e,t){const n=ir(e,{noLocation:t==null?void 0:t.noLocation,allowLegacyFragmentVariables:t==null?void 0:t.allowLegacyFragmentVariables});return aa(n,{assumeValidSDL:t==null?void 0:t.assumeValidSDL,assumeValid:t==null?void 0:t.assumeValid})}function Pl(e){const t=e.toConfig(),n=ft(_r(t.types),p=>p.name,d);return new Yt({...t,types:Object.values(n),directives:_r(t.directives).map(o),query:s(t.query),mutation:s(t.mutation),subscription:s(t.subscription)});function r(p){return fe(p)?new Oe(r(p.ofType)):X(p)?new W(r(p.ofType)):i(p)}function i(p){return n[p.name]}function s(p){return p&&i(p)}function o(p){const y=p.toConfig();return new it({...y,locations:ua(y.locations,E=>E),args:a(y.args)})}function a(p){return kn(p,y=>({...y,type:r(y.type)}))}function u(p){return kn(p,y=>({...y,type:r(y.type),args:y.args&&a(y.args)}))}function c(p){return kn(p,y=>({...y,type:r(y.type)}))}function f(p){return _r(p).map(i)}function d(p){if(je(p)||Ot(p))return p;if(te(p)){const y=p.toConfig();return new qe({...y,interfaces:()=>f(y.interfaces),fields:()=>u(y.fields)})}if(re(p)){const y=p.toConfig();return new Ct({...y,interfaces:()=>f(y.interfaces),fields:()=>u(y.fields)})}if(Ne(p)){const y=p.toConfig();return new Mt({...y,types:()=>f(y.types)})}if(ge(p)){const y=p.toConfig();return new ht({...y,values:kn(y.values,E=>E)})}if(de(p)){const y=p.toConfig();return new Vt({...y,fields:()=>c(y.fields)})}ye(!1,"Unexpected type: "+I(p))}}function kn(e,t){const n=Object.create(null);for(const r of Object.keys(e).sort(vn))n[r]=t(e[r]);return n}function _r(e){return ua(e,t=>t.name)}function ua(e,t){return e.slice().sort((n,r)=>{const i=t(n),s=t(r);return vn(i,s)})}function Ul(e){return ca(e,t=>!ri(t),Bl)}function jl(e){return ca(e,ri,Ot)}function Bl(e){return!ar(e)&&!Ot(e)}function ca(e,t,n){const r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[ql(e),...r.map(s=>Wl(s)),...i.map(s=>la(s))].filter(Boolean).join(`
|
|
148
|
+
|
|
149
|
+
`)}function ql(e){if(e.description==null&&Gl(e))return;const t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);const r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);const i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),Ge(e)+`schema {
|
|
150
|
+
${t.join(`
|
|
151
|
+
`)}
|
|
152
|
+
}`}function Gl(e){const t=e.getQueryType();if(t&&t.name!=="Query")return!1;const n=e.getMutationType();if(n&&n.name!=="Mutation")return!1;const r=e.getSubscriptionType();return!(r&&r.name!=="Subscription")}function la(e){if(je(e))return Ql(e);if(te(e))return Yl(e);if(re(e))return Jl(e);if(Ne(e))return Hl(e);if(ge(e))return zl(e);if(de(e))return Xl(e);ye(!1,"Unexpected type: "+I(e))}function Ql(e){return Ge(e)+`scalar ${e.name}`+Kl(e)}function fa(e){const t=e.getInterfaces();return t.length?" implements "+t.map(n=>n.name).join(" & "):""}function Yl(e){return Ge(e)+`type ${e.name}`+fa(e)+da(e)}function Jl(e){return Ge(e)+`interface ${e.name}`+fa(e)+da(e)}function Hl(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return Ge(e)+"union "+e.name+n}function zl(e){const t=e.getValues().map((n,r)=>Ge(n," ",!r)+" "+n.name+Ai(n.deprecationReason));return Ge(e)+`enum ${e.name}`+Di(t)}function Xl(e){const t=Object.values(e.getFields()).map((n,r)=>Ge(n," ",!r)+" "+Vr(n));return Ge(e)+`input ${e.name}`+Di(t)}function da(e){const t=Object.values(e.getFields()).map((n,r)=>Ge(n," ",!r)+" "+n.name+pa(n.args," ")+": "+String(n.type)+Ai(n.deprecationReason));return Di(t)}function Di(e){return e.length!==0?` {
|
|
153
|
+
`+e.join(`
|
|
154
|
+
`)+`
|
|
155
|
+
}`:""}function pa(e,t=""){return e.length===0?"":e.every(n=>!n.description)?"("+e.map(Vr).join(", ")+")":`(
|
|
156
|
+
`+e.map((n,r)=>Ge(n," "+t,!r)+" "+t+Vr(n)).join(`
|
|
157
|
+
`)+`
|
|
158
|
+
`+t+")"}function Vr(e){const t=dt(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=` = ${le(t)}`),n+Ai(e.deprecationReason)}function Wl(e){return Ge(e)+"directive @"+e.name+pa(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function Ai(e){return e==null?"":e!==ti?` @deprecated(reason: ${le({kind:l.STRING,value:e})})`:" @deprecated"}function Kl(e){return e.specifiedByURL==null?"":` @specifiedBy(url: ${le({kind:l.STRING,value:e.specifiedByURL})})`}function Ge(e,t="",n=!0){const{description:r}=e;if(r==null)return"";const i=le({kind:l.STRING,value:r,block:xu(r)});return(t&&!n?`
|
|
159
|
+
`+t:t)+i.replace(/\n/g,`
|
|
160
|
+
`+t)+`
|
|
161
|
+
`}function Zl(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:l.DOCUMENT,definitions:t}}function ef(e){const t=[],n=Object.create(null);for(const i of e.definitions)switch(i.kind){case l.OPERATION_DEFINITION:t.push(i);break;case l.FRAGMENT_DEFINITION:n[i.name.value]=Zi(i.selectionSet);break}const r=Object.create(null);for(const i of t){const s=new Set;for(const a of Zi(i.selectionSet))ha(s,n,a);const o=i.name?i.name.value:"";r[o]={kind:l.DOCUMENT,definitions:e.definitions.filter(a=>a===i||a.kind===l.FRAGMENT_DEFINITION&&s.has(a.name.value))}}return r}function ha(e,t,n){if(!e.has(n)){e.add(n);const r=t[n];if(r!==void 0)for(const i of r)ha(e,t,i)}}function Zi(e){const t=[];return Qt(e,{FragmentSpread(n){t.push(n.name.value)}}),t}function tf(e){const t=qs(e)?e:new rr(e),n=t.body,r=new Yr(t);let i="",s=!1;for(;r.advance().kind!==N.EOF;){const o=r.token,a=o.kind,u=!Ps(o.kind);s&&(u||o.kind===N.SPREAD)&&(i+=" ");const c=n.slice(o.start,o.end);a===N.BLOCK_STRING?i+=Vs(o.value,{minimize:!0}):i+=c,s=u}return i}function nf(e){const t=ma(e);if(t)throw t;return e}function ma(e){if(typeof e=="string"||K(!1,"Expected name to be a string."),e.startsWith("__"))return new _(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{Ue(e)}catch(t){return t}}var he;(function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"})(he||(he={}));var ze;(function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"})(ze||(ze={}));function rf(e,t){return ya(e,t).filter(n=>n.type in he)}function sf(e,t){return ya(e,t).filter(n=>n.type in ze)}function ya(e,t){return[...af(e,t),...of(e,t)]}function of(e,t){const n=[],r=ut(e.getDirectives(),t.getDirectives());for(const i of r.removed)n.push({type:he.DIRECTIVE_REMOVED,description:`${i.name} was removed.`});for(const[i,s]of r.persisted){const o=ut(i.args,s.args);for(const a of o.added)yt(a)&&n.push({type:he.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${a.name} on directive ${i.name} was added.`});for(const a of o.removed)n.push({type:he.DIRECTIVE_ARG_REMOVED,description:`${a.name} was removed from ${i.name}.`});i.isRepeatable&&!s.isRepeatable&&n.push({type:he.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${i.name}.`});for(const a of i.locations)s.locations.includes(a)||n.push({type:he.DIRECTIVE_LOCATION_REMOVED,description:`${a} was removed from ${i.name}.`})}return n}function af(e,t){const n=[],r=ut(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(const i of r.removed)n.push({type:he.TYPE_REMOVED,description:ar(i)?`Standard scalar ${i.name} was removed because it is not referenced anymore.`:`${i.name} was removed.`});for(const[i,s]of r.persisted)ge(i)&&ge(s)?n.push(...lf(i,s)):Ne(i)&&Ne(s)?n.push(...cf(i,s)):de(i)&&de(s)?n.push(...uf(i,s)):te(i)&&te(s)?n.push(...ts(i,s),...es(i,s)):re(i)&&re(s)?n.push(...ts(i,s),...es(i,s)):i.constructor!==s.constructor&&n.push({type:he.TYPE_CHANGED_KIND,description:`${i.name} changed from ${ns(i)} to ${ns(s)}.`});return n}function uf(e,t){const n=[],r=ut(Object.values(e.getFields()),Object.values(t.getFields()));for(const i of r.added)or(i)?n.push({type:he.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${i.name} on input type ${e.name} was added.`}):n.push({type:ze.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${i.name} on input type ${e.name} was added.`});for(const i of r.removed)n.push({type:he.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)sn(i.type,s.type)||n.push({type:he.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function cf(e,t){const n=[],r=ut(e.getTypes(),t.getTypes());for(const i of r.added)n.push({type:ze.TYPE_ADDED_TO_UNION,description:`${i.name} was added to union type ${e.name}.`});for(const i of r.removed)n.push({type:he.TYPE_REMOVED_FROM_UNION,description:`${i.name} was removed from union type ${e.name}.`});return n}function lf(e,t){const n=[],r=ut(e.getValues(),t.getValues());for(const i of r.added)n.push({type:ze.VALUE_ADDED_TO_ENUM,description:`${i.name} was added to enum type ${e.name}.`});for(const i of r.removed)n.push({type:he.VALUE_REMOVED_FROM_ENUM,description:`${i.name} was removed from enum type ${e.name}.`});return n}function es(e,t){const n=[],r=ut(e.getInterfaces(),t.getInterfaces());for(const i of r.added)n.push({type:ze.IMPLEMENTED_INTERFACE_ADDED,description:`${i.name} added to interfaces implemented by ${e.name}.`});for(const i of r.removed)n.push({type:he.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${i.name}.`});return n}function ts(e,t){const n=[],r=ut(Object.values(e.getFields()),Object.values(t.getFields()));for(const i of r.removed)n.push({type:he.FIELD_REMOVED,description:`${e.name}.${i.name} was removed.`});for(const[i,s]of r.persisted)n.push(...ff(e,i,s)),en(i.type,s.type)||n.push({type:he.FIELD_CHANGED_KIND,description:`${e.name}.${i.name} changed type from ${String(i.type)} to ${String(s.type)}.`});return n}function ff(e,t,n){const r=[],i=ut(t.args,n.args);for(const s of i.removed)r.push({type:he.ARG_REMOVED,description:`${e.name}.${t.name} arg ${s.name} was removed.`});for(const[s,o]of i.persisted)if(!sn(s.type,o.type))r.push({type:he.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${s.name} has changed type from ${String(s.type)} to ${String(o.type)}.`});else if(s.defaultValue!==void 0)if(o.defaultValue===void 0)r.push({type:ze.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${s.name} defaultValue was removed.`});else{const u=rs(s.defaultValue,s.type),c=rs(o.defaultValue,o.type);u!==c&&r.push({type:ze.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${s.name} has changed defaultValue from ${u} to ${c}.`})}for(const s of i.added)yt(s)?r.push({type:he.REQUIRED_ARG_ADDED,description:`A required arg ${s.name} on ${e.name}.${t.name} was added.`}):r.push({type:ze.OPTIONAL_ARG_ADDED,description:`An optional arg ${s.name} on ${e.name}.${t.name} was added.`});return r}function en(e,t){return fe(e)?fe(t)&&en(e.ofType,t.ofType)||X(t)&&en(e,t.ofType):X(e)?X(t)&&en(e.ofType,t.ofType):Tn(t)&&e.name===t.name||X(t)&&en(e,t.ofType)}function sn(e,t){return fe(e)?fe(t)&&sn(e.ofType,t.ofType):X(e)?X(t)&&sn(e.ofType,t.ofType)||!X(t)&&sn(e.ofType,t):Tn(t)&&e.name===t.name}function ns(e){if(je(e))return"a Scalar type";if(te(e))return"an Object type";if(re(e))return"an Interface type";if(Ne(e))return"a Union type";if(ge(e))return"an Enum type";if(de(e))return"an Input type";ye(!1,"Unexpected type: "+I(e))}function rs(e,t){const n=dt(e,t);return n!=null||ye(!1),le(dr(n))}function ut(e,t){const n=[],r=[],i=[],s=at(e,({name:a})=>a),o=at(t,({name:a})=>a);for(const a of e){const u=o[a.name];u===void 0?r.push(a):i.push([a,u])}for(const a of t)s[a.name]===void 0&&n.push(a);return{added:n,persisted:i,removed:r}}const df=Object.freeze(Object.defineProperty({__proto__:null,BREAK:Rt,get BreakingChangeType(){return he},DEFAULT_DEPRECATION_REASON:ti,get DangerousChangeType(){return ze},get DirectiveLocation(){return G},ExecutableDefinitionsRule:so,FieldsOnCorrectTypeRule:oo,FragmentsOnCompositeTypesRule:ao,GRAPHQL_MAX_INT:xn,GRAPHQL_MIN_INT:Cn,GraphQLBoolean:Me,GraphQLDeprecatedDirective:cr,GraphQLDirective:it,GraphQLEnumType:ht,GraphQLError:_,GraphQLFloat:no,GraphQLID:Kr,GraphQLIncludeDirective:Zr,GraphQLInputObjectType:Vt,GraphQLInt:to,GraphQLInterfaceType:Ct,GraphQLList:Oe,GraphQLNonNull:W,GraphQLObjectType:qe,GraphQLScalarType:rt,GraphQLSchema:Yt,GraphQLSkipDirective:ei,GraphQLSpecifiedByDirective:ni,GraphQLString:me,GraphQLUnionType:Mt,get Kind(){return l},KnownArgumentNamesRule:uo,KnownDirectivesRule:gi,KnownFragmentNamesRule:lo,KnownTypeNamesRule:Ti,Lexer:Yr,Location:$s,LoneAnonymousOperationRule:fo,LoneSchemaDefinitionRule:po,NoDeprecatedCustomRule:Ll,NoFragmentCyclesRule:ho,NoSchemaIntrospectionCustomRule:kl,NoUndefinedVariablesRule:mo,NoUnusedFragmentsRule:yo,NoUnusedVariablesRule:vo,get OperationTypeNode(){return be},OverlappingFieldsCanBeMergedRule:go,PossibleFragmentSpreadsRule:_o,PossibleTypeExtensionsRule:No,ProvidedRequiredArgumentsRule:Io,ScalarLeafsRule:Oo,SchemaMetaFieldDef:cn,SingleFieldSubscriptionsRule:Lo,Source:rr,Token:Gr,get TokenKind(){return N},TypeInfo:hi,get TypeKind(){return oe},TypeMetaFieldDef:ln,TypeNameMetaFieldDef:fn,UniqueArgumentDefinitionNamesRule:ko,UniqueArgumentNamesRule:Ii,UniqueDirectiveNamesRule:Fo,UniqueDirectivesPerLocationRule:wi,UniqueEnumValueNamesRule:$o,UniqueFieldDefinitionNamesRule:xo,UniqueFragmentNamesRule:Co,UniqueInputFieldNamesRule:Oi,UniqueOperationNamesRule:Mo,UniqueOperationTypesRule:Vo,UniqueTypeNamesRule:Po,UniqueVariableNamesRule:Uo,ValidationContext:Yo,ValuesOfCorrectTypeRule:jo,VariablesAreInputTypesRule:Bo,VariablesInAllowedPositionRule:qo,__Directive:si,__DirectiveLocation:oi,__EnumValue:ui,__Field:ai,__InputValue:Nn,__Schema:lr,__Type:Be,__TypeKind:ci,assertAbstractType:Tc,assertCompositeType:gc,assertDirective:Oc,assertEnumType:dc,assertEnumValueName:Ys,assertInputObjectType:pc,assertInputType:yc,assertInterfaceType:Hs,assertLeafType:Ec,assertListType:hc,assertName:Ue,assertNamedType:_c,assertNonNullType:mc,assertNullableType:zs,assertObjectType:Js,assertOutputType:vc,assertScalarType:lc,assertSchema:li,assertType:cc,assertUnionType:fc,assertValidName:nf,assertValidSchema:di,assertWrappingType:bc,astFromValue:dt,buildASTSchema:aa,buildClientSchema:Cl,buildSchema:Vl,coerceInputValue:Ao,concatAST:Zl,createSourceEventStream:ia,defaultFieldResolver:Mr,defaultTypeResolver:ea,doTypesOverlap:kr,execute:hr,executeSync:zo,extendSchema:Ml,findBreakingChanges:rf,findDangerousChanges:sf,formatError:Lu,getArgumentValues:pr,getDirectiveValues:dn,getEnterLeaveForKind:xt,getIntrospectionQuery:sa,getLocation:jn,getNamedType:Le,getNullableType:zr,getOperationAST:Fl,getOperationRootType:$l,getVariableValues:So,getVisitFn:oc,graphql:wl,graphqlSync:Ol,introspectionFromSchema:xl,introspectionTypes:In,isAbstractType:Ze,isCompositeType:nt,isConstValueNode:Fr,isDefinitionNode:Vc,isDirective:ur,isEnumType:ge,isEqualType:qn,isExecutableDefinitionNode:yi,isInputObjectType:de,isInputType:Fe,isInterfaceType:re,isIntrospectionType:Ot,isLeafType:tt,isListType:fe,isNamedType:Tn,isNonNullType:X,isNullableType:Hr,isObjectType:te,isOutputType:pt,isRequiredArgument:yt,isRequiredInputField:or,isScalarType:je,isSchema:ro,isSelectionNode:Pc,isSpecifiedDirective:ri,isSpecifiedScalarType:ar,isType:En,isTypeDefinitionNode:Jt,isTypeExtensionNode:fr,isTypeNode:Uc,isTypeSubTypeOf:Tt,isTypeSystemDefinitionNode:vi,isTypeSystemExtensionNode:Ei,isUnionType:Ne,isValidNameError:ma,isValueNode:io,isWrappingType:gn,lexicographicSortSchema:Pl,locatedError:Ut,parse:ir,parseConstValue:Wu,parseType:Ku,parseValue:Gs,print:le,printError:Ru,printIntrospectionSchema:jl,printLocation:Fs,printSchema:Ul,printSourceLocation:qr,printType:la,resolveObjMapThunk:Wr,resolveReadonlyArrayThunk:Xr,responsePathAsArray:Ce,separateOperations:ef,specifiedDirectives:vt,specifiedRules:Go,specifiedScalarTypes:bn,stripIgnoredCharacters:tf,subscribe:Al,syntaxError:Te,typeFromAST:xe,validate:Jo,validateSchema:fi,valueFromAST:Ke,valueFromASTUntyped:Bn,version:Ou,versionInfo:Du,visit:Qt,visitInParallel:Jr,visitWithTypeInfo:mi},Symbol.toStringTag,{value:"Module"})),pf=Ja(df);Object.defineProperty($t,"__esModule",{value:!0});$t.resolveRequestDocument=void 0;var is=pf;function ss(e){var t,n=void 0,r=e.definitions.filter(function(i){return i.kind==="OperationDefinition"});return r.length===1&&(n=(t=r[0].name)===null||t===void 0?void 0:t.value),n}function hf(e){if(typeof e=="string"){var t=void 0;try{var n=(0,is.parse)(e);t=ss(n)}catch{}return{query:e,operationName:t}}var r=ss(e);return{query:(0,is.print)(e),operationName:r}}$t.resolveRequestDocument=hf;var Wt={},os;function mf(){if(os)return Wt;os=1;var e=se&&se.__assign||function(){return e=Object.assign||function(U){for(var k,D=1,Q=arguments.length;D<Q;D++){k=arguments[D];for(var g in k)Object.prototype.hasOwnProperty.call(k,g)&&(U[g]=k[g])}return U},e.apply(this,arguments)},t=se&&se.__awaiter||function(U,k,D,Q){function g(v){return v instanceof D?v:new D(function(C){C(v)})}return new(D||(D=Promise))(function(v,C){function z(A){try{m(Q.next(A))}catch(q){C(q)}}function ie(A){try{m(Q.throw(A))}catch(q){C(q)}}function m(A){A.done?v(A.value):g(A.value).then(z,ie)}m((Q=Q.apply(U,k||[])).next())})},n=se&&se.__generator||function(U,k){var D={label:0,sent:function(){if(v[0]&1)throw v[1];return v[1]},trys:[],ops:[]},Q,g,v,C;return C={next:z(0),throw:z(1),return:z(2)},typeof Symbol=="function"&&(C[Symbol.iterator]=function(){return this}),C;function z(m){return function(A){return ie([m,A])}}function ie(m){if(Q)throw new TypeError("Generator is already executing.");for(;D;)try{if(Q=1,g&&(v=m[0]&2?g.return:m[0]?g.throw||((v=g.return)&&v.call(g),0):g.next)&&!(v=v.call(g,m[1])).done)return v;switch(g=0,v&&(m=[m[0]&2,v.value]),m[0]){case 0:case 1:v=m;break;case 4:return D.label++,{value:m[1],done:!1};case 5:D.label++,g=m[1],m=[0];continue;case 7:m=D.ops.pop(),D.trys.pop();continue;default:if(v=D.trys,!(v=v.length>0&&v[v.length-1])&&(m[0]===6||m[0]===2)){D=0;continue}if(m[0]===3&&(!v||m[1]>v[0]&&m[1]<v[3])){D.label=m[1];break}if(m[0]===6&&D.label<v[1]){D.label=v[1],v=m;break}if(v&&D.label<v[2]){D.label=v[2],D.ops.push(m);break}v[2]&&D.ops.pop(),D.trys.pop();continue}m=k.call(U,D)}catch(A){m=[6,A],g=0}finally{Q=v=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.GraphQLWebSocketClient=void 0;var r=yn,i=$t,s="connection_init",o="connection_ack",a="ping",u="pong",c="subscribe",f="next",d="error",p="complete",y=function(){function U(k,D,Q){this._type=k,this._payload=D,this._id=Q}return Object.defineProperty(U.prototype,"type",{get:function(){return this._type},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"payload",{get:function(){return this._payload},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"text",{get:function(){var k={type:this.type};return this.id!=null&&this.id!=null&&(k.id=this.id),this.payload!=null&&this.payload!=null&&(k.payload=this.payload),JSON.stringify(k)},enumerable:!1,configurable:!0}),U.parse=function(k,D){var Q=JSON.parse(k),g=Q.type,v=Q.payload,C=Q.id;return new U(g,D(v),C)},U}(),E=function(){function U(k,D){var Q=D.onInit,g=D.onAcknowledged,v=D.onPing,C=D.onPong,z=this;this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=k,k.onopen=function(ie){return t(z,void 0,void 0,function(){var m,A,q,T;return n(this,function(w){switch(w.label){case 0:return this.socketState.acknowledged=!1,this.socketState.subscriptions={},A=(m=k).send,q=M,Q?[4,Q()]:[3,2];case 1:return T=w.sent(),[3,3];case 2:T=null,w.label=3;case 3:return A.apply(m,[q.apply(void 0,[T]).text]),[2]}})})},k.onclose=function(ie){z.socketState.acknowledged=!1,z.socketState.subscriptions={}},k.onerror=function(ie){console.error(ie)},k.onmessage=function(ie){try{var m=x(ie.data);switch(m.type){case o:{z.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(z.socketState.acknowledged=!0,g&&g(m.payload));return}case a:{v?v(m.payload).then(function(b){return k.send(Z(b).text)}):k.send(Z(null).text);return}case u:{C&&C(m.payload);return}}if(!z.socketState.acknowledged||m.id===void 0||m.id===null||!z.socketState.subscriptions[m.id])return;var A=z.socketState.subscriptions[m.id],q=A.query,T=A.variables,w=A.subscriber;switch(m.type){case f:{!m.payload.errors&&m.payload.data&&w.next&&w.next(m.payload.data),m.payload.errors&&w.error&&w.error(new r.ClientError(e(e({},m.payload),{status:200}),{query:q,variables:T}));return}case d:{w.error&&w.error(new r.ClientError({errors:m.payload,status:200},{query:q,variables:T}));return}case p:{w.complete&&w.complete(),delete z.socketState.subscriptions[m.id];return}}}catch(b){console.error(b),k.close(1006)}k.close(4400,"Unknown graphql-ws message.")}}return U.prototype.makeSubscribe=function(k,D,Q,g){var v=this,C=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[C]={query:k,variables:g,subscriber:Q},this.socket.send(H(C,{query:k,operationName:D,variables:g}).text),function(){v.socket.send(B(C).text),delete v.socketState.subscriptions[C]}},U.prototype.rawRequest=function(k,D){var Q=this;return new Promise(function(g,v){var C;Q.rawSubscribe(k,{next:function(z,ie){return C={data:z,extensions:ie}},error:v,complete:function(){return g(C)}},D)})},U.prototype.request=function(k,D){var Q=this;return new Promise(function(g,v){var C;Q.subscribe(k,{next:function(z){return C=z},error:v,complete:function(){return g(C)}},D)})},U.prototype.subscribe=function(k,D,Q){var g=(0,i.resolveRequestDocument)(k),v=g.query,C=g.operationName;return this.makeSubscribe(v,C,D,Q)},U.prototype.rawSubscribe=function(k,D,Q){return this.makeSubscribe(k,void 0,D,Q)},U.prototype.ping=function(k){this.socket.send(j(k).text)},U.prototype.close=function(){this.socket.close(1e3)},U.PROTOCOL="graphql-transport-ws",U}();Wt.GraphQLWebSocketClient=E;function x(U,k){k===void 0&&(k=function(Q){return Q});var D=y.parse(U,k);return D}function M(U){return new y(s,U)}function j(U){return new y(a,U,void 0)}function Z(U){return new y(u,U,void 0)}function H(U,k){return new y(c,k,U)}function B(U){return new y(p,void 0,U)}return Wt}(function(e){var t=se&&se.__assign||function(){return t=Object.assign||function(T){for(var w,b=1,S=arguments.length;b<S;b++){w=arguments[b];for(var L in w)Object.prototype.hasOwnProperty.call(w,L)&&(T[L]=w[L])}return T},t.apply(this,arguments)},n=se&&se.__createBinding||(Object.create?function(T,w,b,S){S===void 0&&(S=b);var L=Object.getOwnPropertyDescriptor(w,b);(!L||("get"in L?!w.__esModule:L.writable||L.configurable))&&(L={enumerable:!0,get:function(){return w[b]}}),Object.defineProperty(T,S,L)}:function(T,w,b,S){S===void 0&&(S=b),T[S]=w[b]}),r=se&&se.__setModuleDefault||(Object.create?function(T,w){Object.defineProperty(T,"default",{enumerable:!0,value:w})}:function(T,w){T.default=w}),i=se&&se.__importStar||function(T){if(T&&T.__esModule)return T;var w={};if(T!=null)for(var b in T)b!=="default"&&Object.prototype.hasOwnProperty.call(T,b)&&n(w,T,b);return r(w,T),w},s=se&&se.__awaiter||function(T,w,b,S){function L(h){return h instanceof b?h:new b(function(R){R(h)})}return new(b||(b=Promise))(function(h,R){function O(Y){try{$(S.next(Y))}catch(J){R(J)}}function F(Y){try{$(S.throw(Y))}catch(J){R(J)}}function $(Y){Y.done?h(Y.value):L(Y.value).then(O,F)}$((S=S.apply(T,w||[])).next())})},o=se&&se.__generator||function(T,w){var b={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},S,L,h,R;return R={next:O(0),throw:O(1),return:O(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function O($){return function(Y){return F([$,Y])}}function F($){if(S)throw new TypeError("Generator is already executing.");for(;b;)try{if(S=1,L&&(h=$[0]&2?L.return:$[0]?L.throw||((h=L.return)&&h.call(L),0):L.next)&&!(h=h.call(L,$[1])).done)return h;switch(L=0,h&&($=[$[0]&2,h.value]),$[0]){case 0:case 1:h=$;break;case 4:return b.label++,{value:$[1],done:!1};case 5:b.label++,L=$[1],$=[0];continue;case 7:$=b.ops.pop(),b.trys.pop();continue;default:if(h=b.trys,!(h=h.length>0&&h[h.length-1])&&($[0]===6||$[0]===2)){b=0;continue}if($[0]===3&&(!h||$[1]>h[0]&&$[1]<h[3])){b.label=$[1];break}if($[0]===6&&b.label<h[1]){b.label=h[1],h=$;break}if(h&&b.label<h[2]){b.label=h[2],b.ops.push($);break}h[2]&&b.ops.pop(),b.trys.pop();continue}$=w.call(T,b)}catch(Y){$=[6,Y],L=0}finally{S=h=0}if($[0]&5)throw $[1];return{value:$[0]?$[1]:void 0,done:!0}}},a=se&&se.__rest||function(T,w){var b={};for(var S in T)Object.prototype.hasOwnProperty.call(T,S)&&w.indexOf(S)<0&&(b[S]=T[S]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var L=0,S=Object.getOwnPropertySymbols(T);L<S.length;L++)w.indexOf(S[L])<0&&Object.prototype.propertyIsEnumerable.call(T,S[L])&&(b[S[L]]=T[S[L]]);return b},u=se&&se.__spreadArray||function(T,w,b){if(b||arguments.length===2)for(var S=0,L=w.length,h;S<L;S++)(h||!(S in w))&&(h||(h=Array.prototype.slice.call(w,0,S)),h[S]=w[S]);return T.concat(h||Array.prototype.slice.call(w))},c=se&&se.__importDefault||function(T){return T&&T.__esModule?T:{default:T}};Object.defineProperty(e,"__esModule",{value:!0}),e.resolveRequestDocument=e.GraphQLWebSocketClient=e.gql=e.batchRequests=e.request=e.rawRequest=e.GraphQLClient=e.ClientError=void 0;var f=i(uu),d=f,p=c(Br),y=mn,E=ke,x=yn;Object.defineProperty(e,"ClientError",{enumerable:!0,get:function(){return x.ClientError}});var M=$t,j=function(T){var w={};return T&&(typeof Headers<"u"&&T instanceof Headers||d&&d.Headers&&T instanceof d.Headers?w=m(T):Array.isArray(T)?T.forEach(function(b){var S=b[0],L=b[1];w[S]=L}):w=T),w},Z=function(T){return T.replace(/([\s,]|#[^\n\r]+)+/g," ").trim()},H=function(T){var w=T.query,b=T.variables,S=T.operationName,L=T.jsonSerializer;if(!Array.isArray(w)){var h=["query=".concat(encodeURIComponent(Z(w)))];return b&&h.push("variables=".concat(encodeURIComponent(L.stringify(b)))),S&&h.push("operationName=".concat(encodeURIComponent(S))),h.join("&")}if(typeof b<"u"&&!Array.isArray(b))throw new Error("Cannot create query with given variable type, array expected");var R=w.reduce(function(O,F,$){return O.push({query:Z(F),variables:b?L.stringify(b[$]):void 0}),O},[]);return"query=".concat(encodeURIComponent(L.stringify(R)))},B=function(T){var w=T.url,b=T.query,S=T.variables,L=T.operationName,h=T.headers,R=T.fetch,O=T.fetchOptions,F=T.middleware;return s(void 0,void 0,void 0,function(){var $,Y,J;return o(this,function(ne){switch(ne.label){case 0:return $=(0,p.default)(b,S,L,O.jsonSerializer),Y=t({method:"POST",headers:t(t({},typeof $=="string"?{"Content-Type":"application/json"}:{}),h),body:$},O),F?[4,Promise.resolve(F(t(t({},Y),{url:w,operationName:L,variables:S})))]:[3,2];case 1:J=ne.sent(),w=J.url,Y=a(J,["url"]),ne.label=2;case 2:return[4,R(w,Y)];case 3:return[2,ne.sent()]}})})},U=function(T){var w=T.url,b=T.query,S=T.variables,L=T.operationName,h=T.headers,R=T.fetch,O=T.fetchOptions,F=T.middleware;return s(void 0,void 0,void 0,function(){var $,Y,J;return o(this,function(ne){switch(ne.label){case 0:return $=H({query:b,variables:S,operationName:L,jsonSerializer:O.jsonSerializer}),Y=t({method:"GET",headers:h},O),F?[4,Promise.resolve(F(t(t({},Y),{url:w,operationName:L,variables:S})))]:[3,2];case 1:J=ne.sent(),w=J.url,Y=a(J,["url"]),ne.label=2;case 2:return[4,R("".concat(w,"?").concat($),Y)];case 3:return[2,ne.sent()]}})})},k=function(){function T(w,b){b===void 0&&(b={}),this.url=w,this.options=b}return T.prototype.rawRequest=function(w,b,S){return s(this,void 0,void 0,function(){var L,h,R,O,F,$,Y,J,ne,ve,ae,pe;return o(this,function(De){return L=(0,E.parseRawRequestArgs)(w,b,S),h=this.options,R=h.headers,O=h.fetch,F=O===void 0?f.default:O,$=h.method,Y=$===void 0?"POST":$,J=h.requestMiddleware,ne=h.responseMiddleware,ve=a(h,["headers","fetch","method","requestMiddleware","responseMiddleware"]),ae=this.url,L.signal!==void 0&&(ve.signal=L.signal),pe=(0,M.resolveRequestDocument)(L.query).operationName,[2,D({url:ae,query:L.query,variables:L.variables,headers:t(t({},j(z(R))),j(L.requestHeaders)),operationName:pe,fetch:F,method:Y,fetchOptions:ve,middleware:J}).then(function(Ae){return ne&&ne(Ae),Ae}).catch(function(Ae){throw ne&&ne(Ae),Ae})]})})},T.prototype.request=function(w){for(var b=[],S=1;S<arguments.length;S++)b[S-1]=arguments[S];return s(this,void 0,void 0,function(){var L,h,R,O,F,$,Y,J,ne,ve,ae,pe,De,Ae,Ht,zt;return o(this,function(wn){return L=b[0],h=b[1],R=(0,E.parseRequestArgs)(w,L,h),O=this.options,F=O.headers,$=O.fetch,Y=$===void 0?f.default:$,J=O.method,ne=J===void 0?"POST":J,ve=O.requestMiddleware,ae=O.responseMiddleware,pe=a(O,["headers","fetch","method","requestMiddleware","responseMiddleware"]),De=this.url,R.signal!==void 0&&(pe.signal=R.signal),Ae=(0,M.resolveRequestDocument)(R.document),Ht=Ae.query,zt=Ae.operationName,[2,D({url:De,query:Ht,variables:R.variables,headers:t(t({},j(z(F))),j(R.requestHeaders)),operationName:zt,fetch:Y,method:ne,fetchOptions:pe,middleware:ve}).then(function(ct){return ae&&ae(ct),ct.data}).catch(function(ct){throw ae&&ae(ct),ct})]})})},T.prototype.batchRequests=function(w,b){var S=(0,E.parseBatchRequestArgs)(w,b),L=this.options,h=L.headers,R=L.fetch,O=R===void 0?f.default:R,F=L.method,$=F===void 0?"POST":F,Y=L.requestMiddleware,J=L.responseMiddleware,ne=a(L,["headers","fetch","method","requestMiddleware","responseMiddleware"]),ve=this.url;S.signal!==void 0&&(ne.signal=S.signal);var ae=S.documents.map(function(De){var Ae=De.document;return(0,M.resolveRequestDocument)(Ae).query}),pe=S.documents.map(function(De){var Ae=De.variables;return Ae});return D({url:ve,query:ae,variables:pe,headers:t(t({},j(z(h))),j(S.requestHeaders)),operationName:void 0,fetch:O,method:$,fetchOptions:ne,middleware:Y}).then(function(De){return J&&J(De),De.data}).catch(function(De){throw J&&J(De),De})},T.prototype.setHeaders=function(w){return this.options.headers=w,this},T.prototype.setHeader=function(w,b){var S,L=this.options.headers;return L?L[w]=b:this.options.headers=(S={},S[w]=b,S),this},T.prototype.setEndpoint=function(w){return this.url=w,this},T}();e.GraphQLClient=k;function D(T){var w=T.url,b=T.query,S=T.variables,L=T.headers,h=T.operationName,R=T.fetch,O=T.method,F=O===void 0?"POST":O,$=T.fetchOptions,Y=T.middleware;return s(this,void 0,void 0,function(){var J,ne,ve,ae,pe,De,Ae,Ht,zt,wn,ct;return o(this,function(mr){switch(mr.label){case 0:return J=F.toUpperCase()==="POST"?B:U,ne=Array.isArray(b),[4,J({url:w,query:b,variables:S,operationName:h,headers:L,fetch:R,fetchOptions:$,middleware:Y})];case 1:return ve=mr.sent(),[4,C(ve,$.jsonSerializer)];case 2:if(ae=mr.sent(),pe=ne&&Array.isArray(ae)?!ae.some(function(Ea){var ga=Ea.data;return!ga}):!!ae.data,De=!ae.errors||$.errorPolicy==="all"||$.errorPolicy==="ignore",ve.ok&&De&&pe)return Ae=ve.headers,Ht=ve.status,ae.errors,zt=a(ae,["errors"]),wn=$.errorPolicy==="ignore"?zt:ae,[2,t(t({},ne?{data:wn}:wn),{headers:Ae,status:Ht})];throw ct=typeof ae=="string"?{error:ae}:ae,new x.ClientError(t(t({},ct),{status:ve.status,headers:ve.headers}),{query:b,variables:S})}})})}function Q(T,w){for(var b=[],S=2;S<arguments.length;S++)b[S-2]=arguments[S];return s(this,void 0,void 0,function(){var L,h;return o(this,function(R){return L=E.parseRawRequestExtendedArgs.apply(void 0,u([T,w],b,!1)),h=new k(L.url),[2,h.rawRequest(t({},L))]})})}e.rawRequest=Q;function g(T,w){for(var b=[],S=2;S<arguments.length;S++)b[S-2]=arguments[S];return s(this,void 0,void 0,function(){var L,h;return o(this,function(R){return L=E.parseRequestExtendedArgs.apply(void 0,u([T,w],b,!1)),h=new k(L.url),[2,h.request(t({},L))]})})}e.request=g;function v(T,w,b){return s(this,void 0,void 0,function(){var S,L;return o(this,function(h){return S=(0,E.parseBatchRequestsExtendedArgs)(T,w,b),L=new k(S.url),[2,L.batchRequests(t({},S))]})})}e.batchRequests=v,e.default=g;function C(T,w){return w===void 0&&(w=y.defaultJsonSerializer),s(this,void 0,void 0,function(){var b,S,L;return o(this,function(h){switch(h.label){case 0:return T.headers.forEach(function(R,O){O.toLowerCase()==="content-type"&&(b=R)}),b&&(b.toLowerCase().startsWith("application/json")||b.toLowerCase().startsWith("application/graphql+json")||b.toLowerCase().startsWith("application/graphql-response+json"))?(L=(S=w).parse,[4,T.text()]):[3,2];case 1:return[2,L.apply(S,[h.sent()])];case 2:return[2,T.text()]}})})}function z(T){return typeof T=="function"?T():T}function ie(T){for(var w=[],b=1;b<arguments.length;b++)w[b-1]=arguments[b];return T.reduce(function(S,L,h){return"".concat(S).concat(L).concat(h in w?w[h]:"")},"")}e.gql=ie;function m(T){var w={};return T.forEach(function(b,S){w[S]=b}),w}var A=mf();Object.defineProperty(e,"GraphQLWebSocketClient",{enumerable:!0,get:function(){return A.GraphQLWebSocketClient}});var q=$t;Object.defineProperty(e,"resolveRequestDocument",{enumerable:!0,get:function(){return q.resolveRequestDocument}})})(qt);qt.gql`
|
|
162
|
+
query GET_HREFLANG_DATA
|
|
163
|
+
@cached
|
|
164
|
+
(ttl: 300)
|
|
165
|
+
{
|
|
166
|
+
scores_hreflang
|
|
167
|
+
{
|
|
168
|
+
hreflang
|
|
169
|
+
link
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
`;qt.gql`
|
|
173
|
+
query B_CC_Q_D_0
|
|
174
|
+
(
|
|
175
|
+
$leagueIds: [numeric!]
|
|
176
|
+
)
|
|
177
|
+
@cached
|
|
178
|
+
(ttl: 300)
|
|
179
|
+
{
|
|
180
|
+
|
|
181
|
+
scores_football_seasons_details
|
|
182
|
+
(
|
|
183
|
+
where:
|
|
184
|
+
{
|
|
185
|
+
league_id:
|
|
186
|
+
{
|
|
187
|
+
_in: $leagueIds
|
|
188
|
+
},
|
|
189
|
+
is_current_season:
|
|
190
|
+
{
|
|
191
|
+
_eq: true
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
{
|
|
196
|
+
id
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
}
|
|
200
|
+
`;qt.gql`
|
|
201
|
+
query CURRENT_SEASON_IDS
|
|
202
|
+
@cached
|
|
203
|
+
(ttl: 300)
|
|
204
|
+
{
|
|
205
|
+
scores_football_seasons_details
|
|
206
|
+
(
|
|
207
|
+
where:
|
|
208
|
+
{
|
|
209
|
+
is_current_season:
|
|
210
|
+
{
|
|
211
|
+
_eq: true
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
)
|
|
215
|
+
{
|
|
216
|
+
id
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
`;qt.gql`
|
|
220
|
+
query ALL_LEAGUE_IDS
|
|
221
|
+
@cached
|
|
222
|
+
(ttl: 300)
|
|
223
|
+
{
|
|
224
|
+
scores_football_leagues
|
|
225
|
+
{
|
|
226
|
+
id
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
`;qt.gql`
|
|
230
|
+
query ALL_TARGET_SEASON_FIXTURE_IDS
|
|
231
|
+
(
|
|
232
|
+
$limit: Int,
|
|
233
|
+
$offset: Int,
|
|
234
|
+
$seasonIds: [Int!]
|
|
235
|
+
)
|
|
236
|
+
@cached
|
|
237
|
+
(ttl: 300)
|
|
238
|
+
{
|
|
239
|
+
historic_fixtures_aggregate
|
|
240
|
+
(
|
|
241
|
+
where:
|
|
242
|
+
{
|
|
243
|
+
season_id:
|
|
244
|
+
{
|
|
245
|
+
_in: $seasonIds
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
)
|
|
249
|
+
{
|
|
250
|
+
aggregate
|
|
251
|
+
{
|
|
252
|
+
totalCount: count
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
historic_fixtures
|
|
256
|
+
(
|
|
257
|
+
order_by:
|
|
258
|
+
{
|
|
259
|
+
fixture_day: asc,
|
|
260
|
+
id: asc
|
|
261
|
+
},
|
|
262
|
+
limit: $limit,
|
|
263
|
+
offset: $offset,
|
|
264
|
+
where:
|
|
265
|
+
{
|
|
266
|
+
season_id:
|
|
267
|
+
{
|
|
268
|
+
_in: $seasonIds
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
{
|
|
273
|
+
id
|
|
274
|
+
league_id
|
|
275
|
+
season_id
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
`;function Nr(e){return e==null?void 0:e.filter(t=>t!=null)}function yf(e){const t=e-1;return t*t*t+1}function Xn(e,{delay:t=0,duration:n=400,easing:r=yf,x:i=0,y:s=0,opacity:o=0}={}){const a=getComputedStyle(e),u=+a.opacity,c=a.transform==="none"?"":a.transform,f=u*(1-o),[d,p]=Ri(i),[y,E]=Ri(s);return{delay:t,duration:n,easing:r,css:(x,M)=>`
|
|
279
|
+
transform: ${c} translate(${(1-x)*d}${p}, ${(1-x)*y}${E});
|
|
280
|
+
opacity: ${u-f*M}`}}const vf="/icon-close.svg",va="data:image/svg+xml,%3csvg%20width='15'%20height='14'%20viewBox='0%200%2015%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M13.1215%201.08392L1.64569%2012.5597'%20stroke='white'%20stroke-width='1.73876'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M5.06506%201.02606L13.1213%201.08286L13.1793%209.14027'%20stroke='white'%20stroke-width='1.73876'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";function as(e){var Q,g;let t,n,r,i,s,o=((Q=e[0].data)==null?void 0:Q.title)+"",a,u,c,f,d=(((g=e[0].data)==null?void 0:g.cta_title)??"Recieve Bonus")+"",p,y,E,x,M,j,Z,H,B=e[2]&&us(e);function U(v,C){var z;if((v[0].type==1||v[0].type==4)&&((z=v[0].data)!=null&&z.media))return gf;if(v[0].type==2)return Ef}let k=U(e),D=k&&k(e);return{c(){var v;t=ce("div"),B&&B.c(),n=He(),D&&D.c(),r=He(),i=ce("div"),s=ce("p"),a=bt(o),u=He(),c=ce("a"),f=ce("button"),p=bt(d),y=He(),E=ce("img"),V(s,"id","title"),V(s,"class","svelte-zpfjus"),V(E,"id",""),Xe(E.src,x=va)||V(E,"src",x),V(E,"alt","icon-arrow"),V(E,"title","icon-arrow"),V(E,"loading","lazy"),Mn(E,"margin-left","10px"),V(f,"class","svelte-zpfjus"),V(c,"href",M=(v=e[0].data)==null?void 0:v.cta_link),V(c,"target","_blank"),V(c,"rel",`
|
|
8
281
|
noopener
|
|
9
282
|
noreferrer
|
|
10
|
-
`),
|
|
11
|
-
noreferrer`),
|
|
283
|
+
`),V(i,"id","main-box"),V(i,"class","svelte-zpfjus"),V(t,"id",bf),V(t,"class","svelte-zpfjus")},m(v,C){Se(v,t,C),B&&B.m(t,null),ue(t,n),D&&D.m(t,null),ue(t,r),ue(t,i),ue(i,s),ue(s,a),ue(i,u),ue(i,c),ue(c,f),ue(f,p),ue(f,y),ue(f,E),H=!0},p(v,C){var z,ie,m;v[2]?B?B.p(v,C):(B=us(v),B.c(),B.m(t,n)):B&&(B.d(1),B=null),k===(k=U(v))&&D?D.p(v,C):(D&&D.d(1),D=k&&k(v),D&&(D.c(),D.m(t,r))),(!H||C&1)&&o!==(o=((z=v[0].data)==null?void 0:z.title)+"")&&on(a,o),(!H||C&1)&&d!==(d=(((ie=v[0].data)==null?void 0:ie.cta_title)??"Recieve Bonus")+"")&&on(p,d),(!H||C&1&&M!==(M=(m=v[0].data)==null?void 0:m.cta_link))&&V(c,"href",M)},i(v){H||(v&&_t(()=>{H&&(Z&&Z.end(1),j=Ns(t,Xn,{y:500,duration:500}),j.start())}),H=!0)},o(v){j&&j.invalidate(),v&&(Z=Is(t,Xn,{y:500,duration:500})),H=!1},d(v){v&&Ie(t),B&&B.d(),D&&D.d(),v&&Z&&Z.end()}}}function us(e){let t,n,r,i;return{c(){t=ce("img"),V(t,"id","close"),Xe(t.src,n=vf)||V(t,"src",n),V(t,"alt","icon-close"),V(t,"title","icon-close"),V(t,"loading","lazy"),V(t,"class","svelte-zpfjus")},m(s,o){Se(s,t,o),r||(i=vs(t,"click",e[5]),r=!0)},p:$e,d(s){s&&Ie(t),r=!1,i()}}}function Ef(e){let t,n;return{c(){var r;t=ce("img"),V(t,"id","banner"),Xe(t.src,n=(r=e[0].data)==null?void 0:r.media)||V(t,"src",n),V(t,"alt",""),V(t,"title",""),V(t,"loading","lazy"),V(t,"class","svelte-zpfjus")},m(r,i){Se(r,t,i)},p(r,i){var s;i&1&&!Xe(t.src,n=(s=r[0].data)==null?void 0:s.media)&&V(t,"src",n)},d(r){r&&Ie(t)}}}function gf(e){let t,n;return{c(){var r;t=ce("iframe"),V(t,"width","250"),V(t,"height","250"),Xe(t.src,n=(r=e[0].data)==null?void 0:r.media)||V(t,"src",n),V(t,"class","svelte-zpfjus")},m(r,i){Se(r,t,i)},p(r,i){var s;i&1&&!Xe(t.src,n=(s=r[0].data)==null?void 0:s.media)&&V(t,"src",n)},d(r){r&&Ie(t)}}}function Tf(e){let t,n,r,i=e[1]&&!e[3]&&as(e);return{c(){t=ce("p"),t.textContent="Global Advert Sample is Triggered",n=He(),i&&i.c(),r=Da(),Mn(t,"color","blueviolet")},m(s,o){Se(s,t,o),Se(s,n,o),i&&i.m(s,o),Se(s,r,o)},p(s,[o]){s[1]&&!s[3]?i?(i.p(s,o),o&10&&nn(i,1)):(i=as(s),i.c(),nn(i,1),i.m(r.parentNode,r)):i&&(Va(),Or(i,1,1,()=>{i=null}),Pa())},i(s){nn(i)},o(s){Or(i)},d(s){s&&(Ie(t),Ie(n),Ie(r)),i&&i.d(s)}}}const bf="global⮕widget⮕betarenaAdEngine⮕main";function _f(e,t,n){let r,i;Ia(e,Dr,c=>n(4,i=c));let{adData:s}=t,o=!1,a=!1;gs(()=>{setTimeout(()=>{n(1,o=!0)},0),setTimeout(()=>{n(2,a=!0)},0)});const u=()=>{Dr.updateData([["toggleAdShownState",void 0]])};return e.$$set=c=>{"adData"in c&&n(0,s=c.adData)},e.$$.update=()=>{e.$$.dirty&16&&n(3,{isBetarenaAdShownForToday:r}={...i},r)},[s,o,a,r,i,u]}class cs extends Zn{constructor(t){super(),Kn(this,t,_f,Tf,hn,{adData:0})}}function Nf(e){let t,n;return{c(){var r;t=ce("img"),V(t,"id","banner"),Xe(t.src,n=(r=e[0].data)==null?void 0:r.media)||V(t,"src",n),V(t,"alt",""),V(t,"title",""),V(t,"loading","lazy"),V(t,"class","svelte-166eewm")},m(r,i){Se(r,t,i)},p(r,i){var s;i&1&&!Xe(t.src,n=(s=r[0].data)==null?void 0:s.media)&&V(t,"src",n)},d(r){r&&Ie(t)}}}function If(e){let t,n;return{c(){var r;t=ce("iframe"),V(t,"width","250"),V(t,"height","250"),Xe(t.src,n=(r=e[0].data)==null?void 0:r.media)||V(t,"src",n),V(t,"class","svelte-166eewm")},m(r,i){Se(r,t,i)},p(r,i){var s;i&1&&!Xe(t.src,n=(s=r[0].data)==null?void 0:s.media)&&V(t,"src",n)},d(r){r&&Ie(t)}}}function wf(e){var Q,g;let t,n,r,i,s,o,a=((Q=e[0].data)==null?void 0:Q.title)+"",u,c,f,d,p=(((g=e[0].data)==null?void 0:g.cta_title)??"Recieve Bonus")+"",y,E,x,M,j,Z,H,B;function U(v,C){var z;if((v[0].type==1||v[0].type==4)&&((z=v[0].data)!=null&&z.media))return If;if(v[0].type==2)return Nf}let k=U(e),D=k&&k(e);return{c(){var v;t=ce("p"),t.textContent="General Advert Sample is Triggered",n=He(),r=ce("div"),D&&D.c(),i=He(),s=ce("div"),o=ce("p"),u=bt(a),c=He(),f=ce("a"),d=ce("button"),y=bt(p),E=He(),x=ce("img"),Mn(t,"color","violet"),V(o,"id","title"),V(o,"class","svelte-166eewm"),V(x,"id",""),Xe(x.src,M=va)||V(x,"src",M),V(x,"alt","icon-arrow"),V(x,"title","icon-arrow"),V(x,"loading","lazy"),Mn(x,"margin-left","10px"),V(d,"class","svelte-166eewm"),V(f,"href",j=(v=e[0].data)==null?void 0:v.cta_link),V(f,"target","_blank"),V(f,"rel",`noopener
|
|
284
|
+
noreferrer`),V(f,"class","svelte-166eewm"),V(s,"id","main-box"),V(s,"class","svelte-166eewm"),V(r,"id",Of),V(r,"class","svelte-166eewm")},m(v,C){Se(v,t,C),Se(v,n,C),Se(v,r,C),D&&D.m(r,null),ue(r,i),ue(r,s),ue(s,o),ue(o,u),ue(s,c),ue(s,f),ue(f,d),ue(d,y),ue(d,E),ue(d,x),B=!0},p(v,[C]){var z,ie,m;k===(k=U(v))&&D?D.p(v,C):(D&&D.d(1),D=k&&k(v),D&&(D.c(),D.m(r,i))),(!B||C&1)&&a!==(a=((z=v[0].data)==null?void 0:z.title)+"")&&on(u,a),(!B||C&1)&&p!==(p=(((ie=v[0].data)==null?void 0:ie.cta_title)??"Recieve Bonus")+"")&&on(y,p),(!B||C&1&&j!==(j=(m=v[0].data)==null?void 0:m.cta_link))&&V(f,"href",j)},i(v){B||(v&&_t(()=>{B&&(H&&H.end(1),Z=Ns(r,Xn,{y:500,duration:500}),Z.start())}),B=!0)},o(v){Z&&Z.invalidate(),v&&(H=Is(r,Xn,{y:500,duration:500})),B=!1},d(v){v&&(Ie(t),Ie(n),Ie(r)),D&&D.d(),v&&H&&H.end()}}}const Of="global⮕widget⮕betarenaAdEngineX1⮕main";function Df(e,t,n){let{adData:r}=t;return e.$$set=i=>{"adData"in i&&n(0,r=i.adData)},[r]}class Af extends Zn{constructor(t){super(),Kn(this,t,Df,wf,hn,{adData:0})}}function Sf(e){var d;let t,n,r,i,s=((d=e[0])==null?void 0:d.country_code)+"",o,a,u,c,f;return{c(){t=ce("div"),n=ce("p"),n.textContent=`Device Type: ${e[1]}`,r=He(),i=ce("p"),o=bt(s),a=He(),u=ce("div"),u.innerHTML="",V(u,"data-betarena-zone-id","1")},m(p,y){Se(p,t,y),ue(t,n),ue(t,r),ue(t,i),ue(i,o),Se(p,a,y),Se(p,u,y),c||(f=vs(window,"resize",e[5]),c=!0)},p(p,[y]){var E;y&1&&s!==(s=((E=p[0])==null?void 0:E.country_code)+"")&&on(o,s)},i:$e,o:$e,d(p){p&&(Ie(t),Ie(a),Ie(u)),c=!1,f()}}}function Rf(e,t,n){let{deviceWidthList:r=[768,1024],authorId:i=null,authorArticleTagIds:s=[]}=t,o="desktop",a=null,u=new Map;function c(){var E;const y=document.querySelectorAll("[data-betarena-zone-id]");for(const x of y){const M=(E=x.attributes.getNamedItem("data-betarena-zone-id"))==null?void 0:E.value;M&&u.set(parseInt(M),x)}}async function f(y){if(!document)return;const E=await ou(`${qa}/ads`,y);console.log("response",E);const x=new Map(E.ads??[]),M=new Map(E.mapZoneIdToCampaignId);new Map(E.mapCampaignIdToCreativeId);const j=new Map(E.mapZoneIdToAuthorIds),Z=new Map(E.mapZoneIdToTagIds);for(const[H,B]of u){if(!a)continue;const U=M.get(H)??[],k=Nr(U.map(D=>{if(x.has(D))return x.get(D)}));for(const D of k??[])new Af({target:B,props:{adData:D}})}if(i||s.length>0){for(const[H,B]of j){if(i&&!B.includes(i))continue;const U=M.get(H)??[],k=Nr(U.map(D=>{if(x.has(D))return x.get(D)}));console.log("creativeAdData",k);for(const D of k)new cs({target:document.body,props:{adData:D}})}for(const[H,B]of Z){if(i&&!B.includes(i))continue;const U=M.get(H)??[],k=Nr(U.map(D=>{if(x.has(D))return x.get(D)}));for(const D of k)new cs({target:document.body,props:{adData:D}})}}}async function d(){$i(),n(0,a=await au()),c(),f({deviceType:o,isoCountryCode:(a==null?void 0:a.country_code)??"EB",authorId:i,tagIds:s,zoneIds:[...u.keys()]})}gs(async()=>{Dr.useLocalStorage(),await d()});const p=()=>{$i()};return e.$$set=y=>{"deviceWidthList"in y&&n(2,r=y.deviceWidthList),"authorId"in y&&n(3,i=y.authorId),"authorArticleTagIds"in y&&n(4,s=y.authorArticleTagIds)},[a,o,r,i,s,p]}class Lf extends Zn{constructor(t){super(),Kn(this,t,Rf,Sf,hn,{deviceWidthList:2,authorId:3,authorArticleTagIds:4})}}function kf(e){let t,n,r;return n=new Lf({}),{c(){t=ce("main"),Ua(n.$$.fragment)},m(i,s){Se(i,t,s),ws(n,t,null),r=!0},p:$e,i(i){r||(nn(n.$$.fragment,i),r=!0)},o(i){Or(n.$$.fragment,i),r=!1},d(i){i&&Ie(t),Os(n)}}}class Ff extends Zn{constructor(t){super(),Kn(this,t,null,kf,hn,{})}}typeof document>"u"||new Ff({target:document.body});
|
package/package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@betarena/ad-engine",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Betarena Ad-Engine Component",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"svelte": "./src/lib//Widget-AdEngine.svelte"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"svelte": "./src/lib//Widget-AdEngine.svelte",
|
|
7
13
|
"keywords": [
|
|
8
14
|
"betarena",
|
|
9
15
|
"ad-engine",
|
|
@@ -24,7 +30,6 @@
|
|
|
24
30
|
"sass|:|watch": "sass --watch static/app.scss static/app.css"
|
|
25
31
|
},
|
|
26
32
|
"devDependencies": {
|
|
27
|
-
"@betarena/scores-lib": "1.11.0-alpha.15",
|
|
28
33
|
"@sveltejs/vite-plugin-svelte": "3.0.2",
|
|
29
34
|
"@tsconfig/svelte": "5.0.2",
|
|
30
35
|
"@typescript-eslint/eslint-plugin": "5.59.1",
|
|
@@ -40,6 +45,7 @@
|
|
|
40
45
|
"vite": "5.1.6"
|
|
41
46
|
},
|
|
42
47
|
"dependencies": {
|
|
48
|
+
"@betarena/scores-lib": "1.11.0-alpha.15",
|
|
43
49
|
"@fontsource/roboto": "5.0.12"
|
|
44
50
|
}
|
|
45
51
|
}
|
|
@@ -45,12 +45,14 @@
|
|
|
45
45
|
import { postMod } from './utils/fetch.js';
|
|
46
46
|
import { detectDeviceType } from './utils/device.js';
|
|
47
47
|
import { getUserLocation } from './utils/geo.js';
|
|
48
|
+
import { removeNull } from '@betarena/scores-lib/src/functions/func.common.js';
|
|
48
49
|
|
|
49
50
|
import WidgetAdvertSlide from './Widget-AdvertSlide.svelte';
|
|
50
51
|
import WidgetAdGeneral from './Widget-AdGeneral.svelte';
|
|
51
52
|
|
|
52
53
|
import type { IAdsRequestBody, IAdsResponseBody } from '@betarena/scores-lib/types/ad-engine/index.js';
|
|
53
54
|
import type { GeoJsResponse } from './types/geojs.js';
|
|
55
|
+
import type { AdsCreativeMain } from '@betarena/scores-lib/types/_AUTO-HASURA_.js';
|
|
54
56
|
|
|
55
57
|
// #endregion ➤ 📦 Package Imports
|
|
56
58
|
|
|
@@ -206,7 +208,7 @@
|
|
|
206
208
|
;
|
|
207
209
|
|
|
208
210
|
// [🐞]
|
|
209
|
-
console.log(response);
|
|
211
|
+
console.log('response', response);
|
|
210
212
|
|
|
211
213
|
const
|
|
212
214
|
/**
|
|
@@ -257,17 +259,25 @@
|
|
|
257
259
|
* 📝 `List` of creative data point(s)
|
|
258
260
|
*/
|
|
259
261
|
creativeAdData
|
|
260
|
-
=
|
|
262
|
+
= removeNull
|
|
261
263
|
(
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
264
|
+
zoneIdCampaignIds.map
|
|
265
|
+
(
|
|
266
|
+
x =>
|
|
267
|
+
{
|
|
268
|
+
if (dataMap.has(x))
|
|
269
|
+
return dataMap.get(x);
|
|
270
|
+
}
|
|
271
|
+
)
|
|
272
|
+
) as AdsCreativeMain[]
|
|
268
273
|
;
|
|
269
274
|
|
|
270
|
-
|
|
275
|
+
// [🐞]
|
|
276
|
+
// console.log('zoneIdCampaignIds', zoneIdCampaignIds);
|
|
277
|
+
// console.log('dataMap', dataMap);
|
|
278
|
+
// console.log('creativeAdData', creativeAdData);
|
|
279
|
+
|
|
280
|
+
for (const adData of (creativeAdData ?? []))
|
|
271
281
|
{
|
|
272
282
|
new WidgetAdGeneral
|
|
273
283
|
(
|
|
@@ -306,16 +316,22 @@
|
|
|
306
316
|
* 📝 `List` of creative data point(s)
|
|
307
317
|
*/
|
|
308
318
|
creativeAdData
|
|
309
|
-
=
|
|
319
|
+
= removeNull
|
|
310
320
|
(
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
321
|
+
zoneIdCampaignIds.map
|
|
322
|
+
(
|
|
323
|
+
x =>
|
|
324
|
+
{
|
|
325
|
+
if (dataMap.has(x))
|
|
326
|
+
return dataMap.get(x);
|
|
327
|
+
}
|
|
328
|
+
)
|
|
329
|
+
) as AdsCreativeMain[]
|
|
317
330
|
;
|
|
318
331
|
|
|
332
|
+
// [🐞]
|
|
333
|
+
console.log('creativeAdData', creativeAdData);
|
|
334
|
+
|
|
319
335
|
for (const adData of creativeAdData)
|
|
320
336
|
{
|
|
321
337
|
new WidgetAdvertSlide
|
|
@@ -349,14 +365,17 @@
|
|
|
349
365
|
* 📝 `List` of creative data point(s)
|
|
350
366
|
*/
|
|
351
367
|
creativeAdData
|
|
352
|
-
=
|
|
368
|
+
= removeNull
|
|
353
369
|
(
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
370
|
+
zoneIdCampaignIds.map
|
|
371
|
+
(
|
|
372
|
+
x =>
|
|
373
|
+
{
|
|
374
|
+
if (dataMap.has(x))
|
|
375
|
+
return dataMap.get(x);
|
|
376
|
+
}
|
|
377
|
+
)
|
|
378
|
+
) as AdsCreativeMain[]
|
|
360
379
|
;
|
|
361
380
|
|
|
362
381
|
for (const adData of creativeAdData)
|
|
@@ -149,8 +149,13 @@
|
|
|
149
149
|
╰──────────────────────────────────────────────────────────────────────────────────╯
|
|
150
150
|
-->
|
|
151
151
|
|
|
152
|
-
<p
|
|
153
|
-
|
|
152
|
+
<p
|
|
153
|
+
style=
|
|
154
|
+
"
|
|
155
|
+
color: blueviolet;
|
|
156
|
+
"
|
|
157
|
+
>
|
|
158
|
+
Global Advert Sample is Triggered
|
|
154
159
|
</p>
|
|
155
160
|
|
|
156
161
|
{#if isAdvertShown && !isBetarenaAdShownForToday}
|
|
@@ -4,7 +4,7 @@ export const
|
|
|
4
4
|
* 📝 Respective Betarena API endpoint for Ad-Engine Data
|
|
5
5
|
* @example
|
|
6
6
|
* - (local) http://localhost:58749
|
|
7
|
-
* - (dev)
|
|
7
|
+
* - (dev) http://betarena-test-e2748dab12f5.herokuapp.com
|
|
8
8
|
*/
|
|
9
|
-
betarenaEndpoint = '
|
|
9
|
+
betarenaEndpoint = 'http://localhost:58749'
|
|
10
10
|
;
|
package/src/lib/store.ts
CHANGED
|
@@ -123,7 +123,7 @@ function createLocalStore
|
|
|
123
123
|
if
|
|
124
124
|
(
|
|
125
125
|
localStore.isBetarenaAdShownForToday
|
|
126
|
-
&& localStore.advertDateLastShown
|
|
126
|
+
&& new Date(localStore.advertDateLastShown!).getDate() != new Date().getDate()
|
|
127
127
|
)
|
|
128
128
|
methods.updateData
|
|
129
129
|
(
|
package/vite.config.ts
CHANGED
|
@@ -12,11 +12,6 @@ export default defineConfig
|
|
|
12
12
|
) =>
|
|
13
13
|
{
|
|
14
14
|
return {
|
|
15
|
-
plugins:
|
|
16
|
-
[
|
|
17
|
-
svelte()
|
|
18
|
-
],
|
|
19
|
-
|
|
20
15
|
build:
|
|
21
16
|
{
|
|
22
17
|
rollupOptions:
|
|
@@ -27,7 +22,13 @@ export default defineConfig
|
|
|
27
22
|
assetFileNames: '[name].[ext]',
|
|
28
23
|
},
|
|
29
24
|
},
|
|
30
|
-
}
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
plugins:
|
|
28
|
+
[
|
|
29
|
+
svelte()
|
|
30
|
+
]
|
|
31
|
+
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
34
|
);
|