zion-mcp 2.8.3 → 2.8.4
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/README.md +4 -3
- package/dist/{chunk-7VVKHGGT.js → chunk-F6G5HJEE.js} +1 -1
- package/dist/{chunk-EP2OX7PH.js → chunk-JFVHUMRW.js} +54 -43
- package/dist/{chunk-75A6HWF6.js → chunk-RHCRYTGJ.js} +1 -1
- package/dist/{chunk-QTOGKZCE.js → chunk-SZUP67MU.js} +1 -1
- package/dist/{chunk-YUFE5SO6.js → chunk-UDGZVTYO.js} +1 -1
- package/dist/{chunk-ATGTMFY5.js → chunk-Z77UGRGO.js} +1 -1
- package/dist/{cli-XXSHELNV.js → cli-6KHB3H46.js} +148 -151
- package/dist/{corpus-73N3F2LB.js → corpus-7ZWN7347.js} +65 -19
- package/dist/{index.cjs-ERRJ7ONN.js → index.cjs-Q3J34ILP.js} +1 -1
- package/dist/{json-crdt-DOM7HQ5E.js → json-crdt-QFFJIYYD.js} +1 -1
- package/dist/{json-crdt-patch-3KSX2FWP.js → json-crdt-patch-24M3UY2O.js} +1 -1
- package/dist/server.js +1 -1
- package/dist/{surface-JK45KCNT.js → surface-DTE36JY5.js} +1 -1
- package/dist/{ztype-G7EMRCO5.js → ztype-3UJE3G55.js} +2783 -111
- package/package.json +1 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { createRequire as __nodeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __nodeCreateRequire(import.meta.url);
|
|
3
|
-
import{a as
|
|
4
|
-
`)}displayWidth(t){return
|
|
3
|
+
import{a as Yl,b as ci,c as No,d as Ro,f as gv,g as yv}from"./chunk-RHCRYTGJ.js";import{A as wv,B as Ov,V as Av,W as ep,X as xv,Y as Nv,Z as Rv,_ as Cv,a as vv,b as Jl,c as Ev,d as Xl,e as C,f as Rt,g as _v,h as Ct,i as bv,j as Zl,k as Sv,l as Tv,s as Iv}from"./chunk-JFVHUMRW.js";import{a as qr,b as fv,c as _n,d as Y,e as bn,f as hv,g as Ia,i as mv}from"./chunk-UDGZVTYO.js";import{a as M,c as y,e as qe,g as p}from"./chunk-Z77UGRGO.js";var Co=y(rp=>{p();var wa=class extends Error{constructor(t,r,n){super(n),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=t,this.nestedError=void 0}},tp=class extends wa{constructor(t){super(1,"commander.invalidArgument",t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};rp.CommanderError=wa;rp.InvalidArgumentError=tp});var Oa=y(ip=>{p();var{InvalidArgumentError:dD}=Co(),np=class{constructor(t,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,t[0]){case"<":this.required=!0,this._name=t.slice(1,-1);break;case"[":this.required=!1,this._name=t.slice(1,-1);break;default:this.required=!0,this._name=t;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}argParser(t){return this.parseArg=t,this}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new dD(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function fD(e){let t=e.name()+(e.variadic===!0?"...":"");return e.required?"<"+t+">":"["+t+"]"}ip.Argument=np;ip.humanReadableArgName=fD});var ap=y(sp=>{p();var{humanReadableArgName:hD}=Oa(),op=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(t){this.helpWidth=this.helpWidth??t.helpWidth??80}visibleCommands(t){let r=t.commands.filter(i=>!i._hidden),n=t._getHelpCommand();return n&&!n._hidden&&r.push(n),this.sortSubcommands&&r.sort((i,o)=>i.name().localeCompare(o.name())),r}compareOptions(t,r){let n=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return n(t).localeCompare(n(r))}visibleOptions(t){let r=t.options.filter(i=>!i.hidden),n=t._getHelpOption();if(n&&!n.hidden){let i=n.short&&t._findOption(n.short),o=n.long&&t._findOption(n.long);!i&&!o?r.push(n):n.long&&!o?r.push(t.createOption(n.long,n.description)):n.short&&!i&&r.push(t.createOption(n.short,n.description))}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];let r=[];for(let n=t.parent;n;n=n.parent){let i=n.options.filter(o=>!o.hidden);r.push(...i)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(t){return t._argsDescription&&t.registeredArguments.forEach(r=>{r.description=r.description||t._argsDescription[r.name()]||""}),t.registeredArguments.find(r=>r.description)?t.registeredArguments:[]}subcommandTerm(t){let r=t.registeredArguments.map(n=>hD(n)).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,r){return r.visibleCommands(t).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleSubcommandTerm(r.subcommandTerm(i)))),0)}longestOptionTermLength(t,r){return r.visibleOptions(t).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestGlobalOptionTermLength(t,r){return r.visibleGlobalOptions(t).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleOptionTerm(r.optionTerm(i)))),0)}longestArgumentTermLength(t,r){return r.visibleArguments(t).reduce((n,i)=>Math.max(n,this.displayWidth(r.styleArgumentTerm(r.argumentTerm(i)))),0)}commandUsage(t){let r=t._name;t._aliases[0]&&(r=r+"|"+t._aliases[0]);let n="";for(let i=t.parent;i;i=i.parent)n=i.name()+" "+n;return n+r+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&(t.required||t.optional||t.isBoolean()&&typeof t.defaultValue=="boolean")&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),t.presetArg!==void 0&&t.optional&&r.push(`preset: ${JSON.stringify(t.presetArg)}`),t.envVar!==void 0&&r.push(`env: ${t.envVar}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}argumentDescription(t){let r=[];if(t.argChoices&&r.push(`choices: ${t.argChoices.map(n=>JSON.stringify(n)).join(", ")}`),t.defaultValue!==void 0&&r.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`),r.length>0){let n=`(${r.join(", ")})`;return t.description?`${t.description} ${n}`:n}return t.description}formatItemList(t,r,n){return r.length===0?[]:[n.styleTitle(t),...r,""]}groupItems(t,r,n){let i=new Map;return t.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[])}),r.forEach(o=>{let s=n(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(t,r){let n=r.padWidth(t,r),i=r.helpWidth??80;function o(d,f){return r.formatItem(d,n,f,r)}let s=[`${r.styleTitle("Usage:")} ${r.styleUsage(r.commandUsage(t))}`,""],a=r.commandDescription(t);a.length>0&&(s=s.concat([r.boxWrap(r.styleCommandDescription(a),i),""]));let u=r.visibleArguments(t).map(d=>o(r.styleArgumentTerm(r.argumentTerm(d)),r.styleArgumentDescription(r.argumentDescription(d))));if(s=s.concat(this.formatItemList("Arguments:",u,r)),this.groupItems(t.options,r.visibleOptions(t),d=>d.helpGroupHeading??"Options:").forEach((d,f)=>{let h=d.map(g=>o(r.styleOptionTerm(r.optionTerm(g)),r.styleOptionDescription(r.optionDescription(g))));s=s.concat(this.formatItemList(f,h,r))}),r.showGlobalOptions){let d=r.visibleGlobalOptions(t).map(f=>o(r.styleOptionTerm(r.optionTerm(f)),r.styleOptionDescription(r.optionDescription(f))));s=s.concat(this.formatItemList("Global Options:",d,r))}return this.groupItems(t.commands,r.visibleCommands(t),d=>d.helpGroup()||"Commands:").forEach((d,f)=>{let h=d.map(g=>o(r.styleSubcommandTerm(r.subcommandTerm(g)),r.styleSubcommandDescription(r.subcommandDescription(g))));s=s.concat(this.formatItemList(f,h,r))}),s.join(`
|
|
4
|
+
`)}displayWidth(t){return Pv(t).length}styleTitle(t){return t}styleUsage(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r==="[command]"?this.styleSubcommandText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleCommandText(r)).join(" ")}styleCommandDescription(t){return this.styleDescriptionText(t)}styleOptionDescription(t){return this.styleDescriptionText(t)}styleSubcommandDescription(t){return this.styleDescriptionText(t)}styleArgumentDescription(t){return this.styleDescriptionText(t)}styleDescriptionText(t){return t}styleOptionTerm(t){return this.styleOptionText(t)}styleSubcommandTerm(t){return t.split(" ").map(r=>r==="[options]"?this.styleOptionText(r):r[0]==="["||r[0]==="<"?this.styleArgumentText(r):this.styleSubcommandText(r)).join(" ")}styleArgumentTerm(t){return this.styleArgumentText(t)}styleOptionText(t){return t}styleArgumentText(t){return t}styleSubcommandText(t){return t}styleCommandText(t){return t}padWidth(t,r){return Math.max(r.longestOptionTermLength(t,r),r.longestGlobalOptionTermLength(t,r),r.longestSubcommandTermLength(t,r),r.longestArgumentTermLength(t,r))}preformatted(t){return/\n[^\S\r\n]/.test(t)}formatItem(t,r,n,i){let s=" ".repeat(2);if(!n)return s+t;let a=t.padEnd(r+t.length-i.displayWidth(t)),u=2,l=(this.helpWidth??80)-r-u-2,d;return l<this.minWidthToWrap||i.preformatted(n)?d=n:d=i.boxWrap(n,l).replace(/\n/g,`
|
|
5
5
|
`+" ".repeat(r+u)),s+a+" ".repeat(u)+d.replace(/\n/g,`
|
|
6
6
|
${s}`)}boxWrap(t,r){if(r<this.minWidthToWrap)return t;let n=t.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return n.forEach(s=>{let a=s.match(i);if(a===null){o.push("");return}let u=[a.shift()],c=this.displayWidth(u[0]);a.forEach(l=>{let d=this.displayWidth(l);if(c+d<=r){u.push(l),c+=d;return}o.push(u.join(""));let f=l.trimStart();u=[f],c=this.displayWidth(f)}),o.push(u.join(""))}),o.join(`
|
|
7
|
-
`)}};function
|
|
7
|
+
`)}};function Pv(e){let t=/\x1b\[\d*(;\d*)*m/g;return e.replace(t,"")}sp.Help=op;sp.stripColor=Pv});var pp=y(lp=>{p();var{InvalidArgumentError:mD}=Co(),up=class{constructor(t,r){this.flags=t,this.description=r||"",this.required=t.includes("<"),this.optional=t.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(t),this.mandatory=!1;let n=gD(t);this.short=n.shortFlag,this.long=n.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0,this.helpGroupHeading=void 0}default(t,r){return this.defaultValue=t,this.defaultValueDescription=r,this}preset(t){return this.presetArg=t,this}conflicts(t){return this.conflictsWith=this.conflictsWith.concat(t),this}implies(t){let r=t;return typeof t=="string"&&(r={[t]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(t){return this.envVar=t,this}argParser(t){return this.parseArg=t,this}makeOptionMandatory(t=!0){return this.mandatory=!!t,this}hideHelp(t=!0){return this.hidden=!!t,this}_collectValue(t,r){return r===this.defaultValue||!Array.isArray(r)?[t]:(r.push(t),r)}choices(t){return this.argChoices=t.slice(),this.parseArg=(r,n)=>{if(!this.argChoices.includes(r))throw new mD(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(r,n):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Dv(this.name().replace(/^no-/,"")):Dv(this.name())}helpGroup(t){return this.helpGroupHeading=t,this}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}},cp=class{constructor(t){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,t.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,n)=>{this.positiveOptions.has(n)&&this.dualOptions.add(n)})}valueFromOption(t,r){let n=r.attributeName();if(!this.dualOptions.has(n))return!0;let i=this.negativeOptions.get(n).presetArg,o=i!==void 0?i:!1;return r.negate===(o===t)}};function Dv(e){return e.split("-").reduce((t,r)=>t+r[0].toUpperCase()+r.slice(1))}function gD(e){let t,r,n=/^-[^-]$/,i=/^--[^-]/,o=e.split(/[ |,]+/).concat("guard");if(n.test(o[0])&&(t=o.shift()),i.test(o[0])&&(r=o.shift()),!t&&n.test(o[0])&&(t=o.shift()),!t&&i.test(o[0])&&(t=r,r=o.shift()),o[0].startsWith("-")){let s=o[0],a=`option creation failed due to '${s}' in option flags '${e}'`;throw/^-[^-][^-]/.test(s)?new Error(`${a}
|
|
8
8
|
- a short flag is a single dash and a single character
|
|
9
9
|
- either use a single dash and a single character (for a short flag)
|
|
10
10
|
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):n.test(s)?new Error(`${a}
|
|
11
11
|
- too many short flags`):i.test(s)?new Error(`${a}
|
|
12
12
|
- too many long flags`):new Error(`${a}
|
|
13
|
-
- unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}
|
|
13
|
+
- unrecognised flag format`)}if(t===void 0&&r===void 0)throw new Error(`option creation failed due to no flags found in '${e}'.`);return{shortFlag:t,longFlag:r}}lp.Option=up;lp.DualOptions=cp});var kv=y(Lv=>{p();function yD(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let r=[];for(let n=0;n<=e.length;n++)r[n]=[n];for(let n=0;n<=t.length;n++)r[0][n]=n;for(let n=1;n<=t.length;n++)for(let i=1;i<=e.length;i++){let o=1;e[i-1]===t[n-1]?o=0:o=1,r[i][n]=Math.min(r[i-1][n]+1,r[i][n-1]+1,r[i-1][n-1]+o),i>1&&n>1&&e[i-1]===t[n-2]&&e[i-2]===t[n-1]&&(r[i][n]=Math.min(r[i][n],r[i-2][n-2]+1))}return r[e.length][t.length]}function vD(e,t){if(!t||t.length===0)return"";t=Array.from(new Set(t));let r=e.startsWith("--");r&&(e=e.slice(2),t=t.map(s=>s.slice(2)));let n=[],i=3,o=.4;return t.forEach(s=>{if(s.length<=1)return;let a=yD(e,s),u=Math.max(e.length,s.length);(u-a)/u>o&&(a<i?(i=a,n=[s]):a===i&&n.push(s))}),n.sort((s,a)=>s.localeCompare(a)),r&&(n=n.map(s=>`--${s}`)),n.length>1?`
|
|
14
14
|
(Did you mean one of ${n.join(", ")}?)`:n.length===1?`
|
|
15
|
-
(Did you mean ${n[0]}?)`:""}
|
|
16
|
-
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new
|
|
17
|
-
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,n){this._exitCallback&&this._exitCallback(new
|
|
18
|
-
- already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=i=>[i.name()].concat(i.aliases()),n=r(t).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(t).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let o=t.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let i=(o,s,a)=>{o==null&&t.presetArg!==void 0&&(o=t.presetArg);let u=this.getOptionValue(n);o!==null&&t.parseArg?o=this._callParseArg(t,o,u,s):o!==null&&t.variadic&&(o=t._collectValue(o,u)),o==null&&(t.negate?o=!1:t.isBoolean()||t.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${t.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${t.flags}' value '${o}' from env '${t.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(t,r,n,i,o){if(typeof r=="object"&&r instanceof
|
|
19
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,n){if(
|
|
15
|
+
(Did you mean ${n[0]}?)`:""}Lv.suggestSimilar=vD});var qv=y(gp=>{p();var ED=M("node:events").EventEmitter,dp=M("node:child_process"),_r=M("node:path"),Aa=M("node:fs"),de=M("node:process"),{Argument:_D,humanReadableArgName:bD}=Oa(),{CommanderError:fp}=Co(),{Help:SD,stripColor:TD}=ap(),{Option:jv,DualOptions:ID}=pp(),{suggestSimilar:Mv}=kv(),hp=class e extends ED{constructor(t){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=t||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:r=>de.stdout.write(r),writeErr:r=>de.stderr.write(r),outputError:(r,n)=>n(r),getOutHelpWidth:()=>de.stdout.isTTY?de.stdout.columns:void 0,getErrHelpWidth:()=>de.stderr.isTTY?de.stderr.columns:void 0,getOutHasColors:()=>mp()??(de.stdout.isTTY&&de.stdout.hasColors?.()),getErrHasColors:()=>mp()??(de.stderr.isTTY&&de.stderr.hasColors?.()),stripColor:r=>TD(r)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={},this._helpGroupHeading=void 0,this._defaultCommandGroup=void 0,this._defaultOptionGroup=void 0}copyInheritedSettings(t){return this._outputConfiguration=t._outputConfiguration,this._helpOption=t._helpOption,this._helpCommand=t._helpCommand,this._helpConfiguration=t._helpConfiguration,this._exitCallback=t._exitCallback,this._storeOptionsAsProperties=t._storeOptionsAsProperties,this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue,this._allowExcessArguments=t._allowExcessArguments,this._enablePositionalOptions=t._enablePositionalOptions,this._showHelpAfterError=t._showHelpAfterError,this._showSuggestionAfterError=t._showSuggestionAfterError,this}_getCommandAndAncestors(){let t=[];for(let r=this;r;r=r.parent)t.push(r);return t}command(t,r,n){let i=r,o=n;typeof i=="object"&&i!==null&&(o=i,i=null),o=o||{};let[,s,a]=t.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return i&&(u.description(i),u._executableHandler=!0),o.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(o.noHelp||o.hidden),u._executableFile=o.executableFile||null,a&&u.arguments(a),this._registerCommand(u),u.parent=this,u.copyInheritedSettings(this),i?this:u}createCommand(t){return new e(t)}createHelp(){return Object.assign(new SD,this.configureHelp())}configureHelp(t){return t===void 0?this._helpConfiguration:(this._helpConfiguration=t,this)}configureOutput(t){return t===void 0?this._outputConfiguration:(this._outputConfiguration={...this._outputConfiguration,...t},this)}showHelpAfterError(t=!0){return typeof t!="string"&&(t=!!t),this._showHelpAfterError=t,this}showSuggestionAfterError(t=!0){return this._showSuggestionAfterError=!!t,this}addCommand(t,r){if(!t._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
16
|
+
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=t._name),(r.noHelp||r.hidden)&&(t._hidden=!0),this._registerCommand(t),t.parent=this,t._checkForBrokenPassThrough(),this}createArgument(t,r){return new _D(t,r)}argument(t,r,n,i){let o=this.createArgument(t,r);return typeof n=="function"?o.default(i).argParser(n):o.default(n),this.addArgument(o),this}arguments(t){return t.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(t){let r=this.registeredArguments.slice(-1)[0];if(r?.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(t.required&&t.defaultValue!==void 0&&t.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${t.name()}'`);return this.registeredArguments.push(t),this}helpCommand(t,r){if(typeof t=="boolean")return this._addImplicitHelpCommand=t,t&&this._defaultCommandGroup&&this._initCommandGroup(this._getHelpCommand()),this;let n=t??"help [command]",[,i,o]=n.match(/([^ ]+) *(.*)/),s=r??"display help for command",a=this.createCommand(i);return a.helpOption(!1),o&&a.arguments(o),s&&a.description(s),this._addImplicitHelpCommand=!0,this._helpCommand=a,(t||r)&&this._initCommandGroup(a),this}addHelpCommand(t,r){return typeof t!="object"?(this.helpCommand(t,r),this):(this._addImplicitHelpCommand=!0,this._helpCommand=t,this._initCommandGroup(t),this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(t,r){let n=["preSubcommand","preAction","postAction"];if(!n.includes(t))throw new Error(`Unexpected value for event passed to hook : '${t}'.
|
|
17
|
+
Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[t]?this._lifeCycleHooks[t].push(r):this._lifeCycleHooks[t]=[r],this}exitOverride(t){return t?this._exitCallback=t:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(t,r,n){this._exitCallback&&this._exitCallback(new fp(t,r,n)),de.exit(t)}action(t){let r=n=>{let i=this.registeredArguments.length,o=n.slice(0,i);return this._storeOptionsAsProperties?o[i]=this:o[i]=this.opts(),o.push(this),t.apply(this,o)};return this._actionHandler=r,this}createOption(t,r){return new jv(t,r)}_callParseArg(t,r,n,i){try{return t.parseArg(r,n)}catch(o){if(o.code==="commander.invalidArgument"){let s=`${i} ${o.message}`;this.error(s,{exitCode:o.exitCode,code:o.code})}throw o}}_registerOption(t){let r=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(r){let n=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${n}'
|
|
18
|
+
- already used by option '${r.flags}'`)}this._initOptionGroup(t),this.options.push(t)}_registerCommand(t){let r=i=>[i.name()].concat(i.aliases()),n=r(t).find(i=>this._findCommand(i));if(n){let i=r(this._findCommand(n)).join("|"),o=r(t).join("|");throw new Error(`cannot add command '${o}' as already have command '${i}'`)}this._initCommandGroup(t),this.commands.push(t)}addOption(t){this._registerOption(t);let r=t.name(),n=t.attributeName();if(t.negate){let o=t.long.replace(/^--no-/,"--");this._findOption(o)||this.setOptionValueWithSource(n,t.defaultValue===void 0?!0:t.defaultValue,"default")}else t.defaultValue!==void 0&&this.setOptionValueWithSource(n,t.defaultValue,"default");let i=(o,s,a)=>{o==null&&t.presetArg!==void 0&&(o=t.presetArg);let u=this.getOptionValue(n);o!==null&&t.parseArg?o=this._callParseArg(t,o,u,s):o!==null&&t.variadic&&(o=t._collectValue(o,u)),o==null&&(t.negate?o=!1:t.isBoolean()||t.optional?o=!0:o=""),this.setOptionValueWithSource(n,o,a)};return this.on("option:"+r,o=>{let s=`error: option '${t.flags}' argument '${o}' is invalid.`;i(o,s,"cli")}),t.envVar&&this.on("optionEnv:"+r,o=>{let s=`error: option '${t.flags}' value '${o}' from env '${t.envVar}' is invalid.`;i(o,s,"env")}),this}_optionEx(t,r,n,i,o){if(typeof r=="object"&&r instanceof jv)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,n);if(s.makeOptionMandatory(!!t.mandatory),typeof i=="function")s.default(o).argParser(i);else if(i instanceof RegExp){let a=i;i=(u,c)=>{let l=a.exec(u);return l?l[0]:c},s.default(o).argParser(i)}else s.default(i);return this.addOption(s)}option(t,r,n,i){return this._optionEx({},t,r,n,i)}requiredOption(t,r,n,i){return this._optionEx({mandatory:!0},t,r,n,i)}combineFlagAndOptionalValue(t=!0){return this._combineFlagAndOptionalValue=!!t,this}allowUnknownOption(t=!0){return this._allowUnknownOption=!!t,this}allowExcessArguments(t=!0){return this._allowExcessArguments=!!t,this}enablePositionalOptions(t=!0){return this._enablePositionalOptions=!!t,this}passThroughOptions(t=!0){return this._passThroughOptions=!!t,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(t=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!t,this}getOptionValue(t){return this._storeOptionsAsProperties?this[t]:this._optionValues[t]}setOptionValue(t,r){return this.setOptionValueWithSource(t,r,void 0)}setOptionValueWithSource(t,r,n){return this._storeOptionsAsProperties?this[t]=r:this._optionValues[t]=r,this._optionValueSources[t]=n,this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let r;return this._getCommandAndAncestors().forEach(n=>{n.getOptionValueSource(t)!==void 0&&(r=n.getOptionValueSource(t))}),r}_prepareUserArgs(t,r){if(t!==void 0&&!Array.isArray(t))throw new Error("first parameter to parse must be array or undefined");if(r=r||{},t===void 0&&r.from===void 0){de.versions?.electron&&(r.from="electron");let i=de.execArgv??[];(i.includes("-e")||i.includes("--eval")||i.includes("-p")||i.includes("--print"))&&(r.from="eval")}t===void 0&&(t=de.argv),this.rawArgs=t.slice();let n;switch(r.from){case void 0:case"node":this._scriptPath=t[1],n=t.slice(2);break;case"electron":de.defaultApp?(this._scriptPath=t[1],n=t.slice(2)):n=t.slice(1);break;case"user":n=t.slice(0);break;case"eval":n=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",n}parse(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return this._parseCommand([],n),this}async parseAsync(t,r){this._prepareForParse();let n=this._prepareUserArgs(t,r);return await this._parseCommand([],n),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
19
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(t,r,n){if(Aa.existsSync(t))return;let i=r?`searched for local subcommand relative to directory '${r}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",o=`'${t}' does not exist
|
|
20
20
|
- if '${n}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
21
21
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
22
|
-
- ${i}`;throw new Error(o)}_executeSubCommand(t,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(l,d){let f=_r.resolve(l,d);if(
|
|
22
|
+
- ${i}`;throw new Error(o)}_executeSubCommand(t,r){r=r.slice();let n=!1,i=[".js",".ts",".tsx",".mjs",".cjs"];function o(l,d){let f=_r.resolve(l,d);if(Aa.existsSync(f))return f;if(i.includes(_r.extname(d)))return;let h=i.find(g=>Aa.existsSync(`${f}${g}`));if(h)return`${f}${h}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=t._executableFile||`${this._name}-${t._name}`,a=this._executableDir||"";if(this._scriptPath){let l;try{l=Aa.realpathSync(this._scriptPath)}catch{l=this._scriptPath}a=_r.resolve(_r.dirname(l),a)}if(a){let l=o(a,s);if(!l&&!t._executableFile&&this._scriptPath){let d=_r.basename(this._scriptPath,_r.extname(this._scriptPath));d!==this._name&&(l=o(a,`${d}-${t._name}`))}s=l||s}n=i.includes(_r.extname(s));let u;de.platform!=="win32"?n?(r.unshift(s),r=Fv(de.execArgv).concat(r),u=dp.spawn(de.argv[0],r,{stdio:"inherit"})):u=dp.spawn(s,r,{stdio:"inherit"}):(this._checkForMissingExecutable(s,a,t._name),r.unshift(s),r=Fv(de.execArgv).concat(r),u=dp.spawn(de.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(d=>{de.on(d,()=>{u.killed===!1&&u.exitCode===null&&u.kill(d)})});let c=this._exitCallback;u.on("close",l=>{l=l??1,c?c(new fp(l,"commander.executeSubCommandAsync","(close)")):de.exit(l)}),u.on("error",l=>{if(l.code==="ENOENT")this._checkForMissingExecutable(s,a,t._name);else if(l.code==="EACCES")throw new Error(`'${s}' not executable`);if(!c)de.exit(1);else{let d=new fp(1,"commander.executeSubCommandAsync","(error)");d.nestedError=l,c(d)}}),this.runningCommand=u}_dispatchSubcommand(t,r,n){let i=this._findCommand(t);i||this.help({error:!0}),i._prepareForParse();let o;return o=this._chainOrCallSubCommandHook(o,i,"preSubcommand"),o=this._chainOrCall(o,()=>{if(i._executableHandler)this._executeSubCommand(i,r.concat(n));else return i._parseCommand(r,n)}),o}_dispatchHelpCommand(t){t||this.help();let r=this._findCommand(t);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((t,r)=>{t.required&&this.args[r]==null&&this.missingArgument(t.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let t=(n,i,o)=>{let s=i;if(i!==null&&n.parseArg){let a=`error: command-argument value '${i}' is invalid for argument '${n.name()}'.`;s=this._callParseArg(n,i,o,a)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((n,i)=>{let o=n.defaultValue;n.variadic?i<this.args.length?(o=this.args.slice(i),n.parseArg&&(o=o.reduce((s,a)=>t(n,a,s),n.defaultValue))):o===void 0&&(o=[]):i<this.args.length&&(o=this.args[i],n.parseArg&&(o=t(n,o,n.defaultValue))),r[i]=o}),this.processedArgs=r}_chainOrCall(t,r){return t?.then&&typeof t.then=="function"?t.then(()=>r()):r()}_chainOrCallHooks(t,r){let n=t,i=[];return this._getCommandAndAncestors().reverse().filter(o=>o._lifeCycleHooks[r]!==void 0).forEach(o=>{o._lifeCycleHooks[r].forEach(s=>{i.push({hookedCommand:o,callback:s})})}),r==="postAction"&&i.reverse(),i.forEach(o=>{n=this._chainOrCall(n,()=>o.callback(o.hookedCommand,this))}),n}_chainOrCallSubCommandHook(t,r,n){let i=t;return this._lifeCycleHooks[n]!==void 0&&this._lifeCycleHooks[n].forEach(o=>{i=this._chainOrCall(i,()=>o(this,r))}),i}_parseCommand(t,r){let n=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),t=t.concat(n.operands),r=n.unknown,this.args=t.concat(r),t&&this._findCommand(t[0]))return this._dispatchSubcommand(t[0],t.slice(1),r);if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(t[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(r),this._dispatchSubcommand(this._defaultCommandName,t,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(n.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=()=>{n.unknown.length>0&&this.unknownOption(n.unknown[0])},o=`command:${this.name()}`;if(this._actionHandler){i(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(o,t,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent?.listenerCount(o))i(),this._processArguments(),this.parent.emit(o,t,r);else if(t.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",t,r);this.listenerCount("command:*")?this.emit("command:*",t,r):this.commands.length?this.unknownCommand():(i(),this._processArguments())}else this.commands.length?(i(),this.help({error:!0})):(i(),this._processArguments())}_findCommand(t){if(t)return this.commands.find(r=>r._name===t||r._aliases.includes(t))}_findOption(t){return this.options.find(r=>r.is(t))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(t=>{t.options.forEach(r=>{r.mandatory&&t.getOptionValue(r.attributeName())===void 0&&t.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let t=this.options.filter(n=>{let i=n.attributeName();return this.getOptionValue(i)===void 0?!1:this.getOptionValueSource(i)!=="default"});t.filter(n=>n.conflictsWith.length>0).forEach(n=>{let i=t.find(o=>n.conflictsWith.includes(o.attributeName()));i&&this._conflictingOption(n,i)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(t=>{t._checkForConflictingLocalOptions()})}parseOptions(t){let r=[],n=[],i=r;function o(l){return l.length>1&&l[0]==="-"}let s=l=>/^-(\d+|\d*\.\d+)(e[+-]?\d+)?$/.test(l)?!this._getCommandAndAncestors().some(d=>d.options.map(f=>f.short).some(f=>/^-\d$/.test(f))):!1,a=null,u=null,c=0;for(;c<t.length||u;){let l=u??t[c++];if(u=null,l==="--"){i===n&&i.push(l),i.push(...t.slice(c));break}if(a&&(!o(l)||s(l))){this.emit(`option:${a.name()}`,l);continue}if(a=null,o(l)){let d=this._findOption(l);if(d){if(d.required){let f=t[c++];f===void 0&&this.optionMissingArgument(d),this.emit(`option:${d.name()}`,f)}else if(d.optional){let f=null;c<t.length&&(!o(t[c])||s(t[c]))&&(f=t[c++]),this.emit(`option:${d.name()}`,f)}else this.emit(`option:${d.name()}`);a=d.variadic?d:null;continue}}if(l.length>2&&l[0]==="-"&&l[1]!=="-"){let d=this._findOption(`-${l[1]}`);if(d){d.required||d.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${d.name()}`,l.slice(2)):(this.emit(`option:${d.name()}`),u=`-${l.slice(2)}`);continue}}if(/^--[^=]+=/.test(l)){let d=l.indexOf("="),f=this._findOption(l.slice(0,d));if(f&&(f.required||f.optional)){this.emit(`option:${f.name()}`,l.slice(d+1));continue}}if(i===r&&o(l)&&!(this.commands.length===0&&s(l))&&(i=n),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&n.length===0){if(this._findCommand(l)){r.push(l),n.push(...t.slice(c));break}else if(this._getHelpCommand()&&l===this._getHelpCommand().name()){r.push(l,...t.slice(c));break}else if(this._defaultCommandName){n.push(l,...t.slice(c));break}}if(this._passThroughOptions){i.push(l,...t.slice(c));break}i.push(l)}return{operands:r,unknown:n}}opts(){if(this._storeOptionsAsProperties){let t={},r=this.options.length;for(let n=0;n<r;n++){let i=this.options[n].attributeName();t[i]=i===this._versionOptionName?this._version:this[i]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((t,r)=>Object.assign(t,r.opts()),{})}error(t,r){this._outputConfiguration.outputError(`${t}
|
|
23
23
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
24
24
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
25
|
-
`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in de.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,de.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new
|
|
26
|
-
`),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(t);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>
|
|
25
|
+
`),this.outputHelp({error:!0}));let n=r||{},i=n.exitCode||1,o=n.code||"commander.error";this._exit(i,o,t)}_parseOptionsEnv(){this.options.forEach(t=>{if(t.envVar&&t.envVar in de.env){let r=t.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(t.required||t.optional?this.emit(`optionEnv:${t.name()}`,de.env[t.envVar]):this.emit(`optionEnv:${t.name()}`))}})}_parseOptionsImplied(){let t=new ID(this.options),r=n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n));this.options.filter(n=>n.implied!==void 0&&r(n.attributeName())&&t.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!r(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(t){let r=`error: missing required argument '${t}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(t){let r=`error: option '${t.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){let r=`error: required option '${t.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,r){let n=s=>{let a=s.attributeName(),u=this.getOptionValue(a),c=this.options.find(d=>d.negate&&a===d.attributeName()),l=this.options.find(d=>!d.negate&&a===d.attributeName());return c&&(c.presetArg===void 0&&u===!1||c.presetArg!==void 0&&u===c.presetArg)?c:l||s},i=s=>{let a=n(s),u=a.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${a.envVar}'`:`option '${a.flags}'`},o=`error: ${i(t)} cannot be used with ${i(r)}`;this.error(o,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let r="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[],o=this;do{let s=o.createHelp().visibleOptions(o).filter(a=>a.long).map(a=>a.long);i=i.concat(s),o=o.parent}while(o&&!o._enablePositionalOptions);r=Mv(t,i)}let n=`error: unknown option '${t}'${r}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,n=r===1?"":"s",o=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${n} but got ${t.length}.`;this.error(o,{code:"commander.excessArguments"})}unknownCommand(){let t=this.args[0],r="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(o=>{i.push(o.name()),o.alias()&&i.push(o.alias())}),r=Mv(t,i)}let n=`error: unknown command '${t}'${r}`;this.error(n,{code:"commander.unknownCommand"})}version(t,r,n){if(t===void 0)return this._version;this._version=t,r=r||"-V, --version",n=n||"output the version number";let i=this.createOption(r,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${t}
|
|
26
|
+
`),this._exit(0,"commander.version",t)}),this}description(t,r){return t===void 0&&r===void 0?this._description:(this._description=t,r&&(this._argsDescription=r),this)}summary(t){return t===void 0?this._summary:(this._summary=t,this)}alias(t){if(t===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),t===r._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(t);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${i}'`)}return r._aliases.push(t),this}aliases(t){return t===void 0?this._aliases:(t.forEach(r=>this.alias(r)),this)}usage(t){if(t===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(n=>bD(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=t,this}name(t){return t===void 0?this._name:(this._name=t,this)}helpGroup(t){return t===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=t,this)}commandsGroup(t){return t===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=t,this)}optionsGroup(t){return t===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=t,this)}_initOptionGroup(t){this._defaultOptionGroup&&!t.helpGroupHeading&&t.helpGroup(this._defaultOptionGroup)}_initCommandGroup(t){this._defaultCommandGroup&&!t.helpGroup()&&t.helpGroup(this._defaultCommandGroup)}nameFromFilename(t){return this._name=_r.basename(t,_r.extname(t)),this}executableDir(t){return t===void 0?this._executableDir:(this._executableDir=t,this)}helpInformation(t){let r=this.createHelp(),n=this._getOutputContext(t);r.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=r.formatHelp(this,r);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(t){t=t||{};let r=!!t.error,n,i,o;return r?(n=a=>this._outputConfiguration.writeErr(a),i=this._outputConfiguration.getErrHasColors(),o=this._outputConfiguration.getErrHelpWidth()):(n=a=>this._outputConfiguration.writeOut(a),i=this._outputConfiguration.getOutHasColors(),o=this._outputConfiguration.getOutHelpWidth()),{error:r,write:a=>(i||(a=this._outputConfiguration.stripColor(a)),n(a)),hasColors:i,helpWidth:o}}outputHelp(t){let r;typeof t=="function"&&(r=t,t=void 0);let n=this._getOutputContext(t),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(s=>s.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let o=this.helpInformation({error:n.error});if(r&&(o=r(o),typeof o!="string"&&!Buffer.isBuffer(o)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(o),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(s=>s.emit("afterAllHelp",i))}helpOption(t,r){return typeof t=="boolean"?(t?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(t??"-h, --help",r??"display help for command"),(t||r)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(t){return this._helpOption=t,this._initOptionGroup(t),this}help(t){this.outputHelp(t);let r=Number(de.exitCode??0);r===0&&t&&typeof t!="function"&&t.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(t,r){let n=["beforeAll","before","after","afterAll"];if(!n.includes(t))throw new Error(`Unexpected value for position to addHelpText.
|
|
27
27
|
Expecting one of '${n.join("', '")}'`);let i=`${t}Help`;return this.on(i,o=>{let s;typeof r=="function"?s=r({error:o.error,command:o.command}):s=r,s&&o.write(`${s}
|
|
28
|
-
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function
|
|
28
|
+
`)}),this}_outputHelpIfRequested(t){let r=this._getHelpOption();r&&t.find(i=>r.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function Fv(e){return e.map(t=>{if(!t.startsWith("--inspect"))return t;let r,n="127.0.0.1",i="9229",o;return(o=t.match(/^(--inspect(-brk)?)$/))!==null?r=o[1]:(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=o[1],/^\d+$/.test(o[3])?i=o[3]:n=o[3]):(o=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=o[1],n=o[3],i=o[4]),r&&i!=="0"?`${r}=${n}:${parseInt(i)+1}`:t})}function mp(){if(de.env.NO_COLOR||de.env.FORCE_COLOR==="0"||de.env.FORCE_COLOR==="false")return!1;if(de.env.FORCE_COLOR||de.env.CLICOLOR_FORCE!==void 0)return!0}gp.Command=hp;gp.useColor=mp});var $v=y(Pt=>{p();var{Argument:Uv}=Oa(),{Command:yp}=qv(),{CommanderError:wD,InvalidArgumentError:Vv}=Co(),{Help:OD}=ap(),{Option:Gv}=pp();Pt.program=new yp;Pt.createCommand=e=>new yp(e);Pt.createOption=(e,t)=>new Gv(e,t);Pt.createArgument=(e,t)=>new Uv(e,t);Pt.Command=yp;Pt.Option=Gv;Pt.Argument=Uv;Pt.Help=OD;Pt.CommanderError=wD;Pt.InvalidArgumentError=Vv;Pt.InvalidOptionArgumentError=Vv});var li=y((Ep,Qv)=>{p();var xa=M("buffer"),or=xa.Buffer;function Hv(e,t){for(var r in e)t[r]=e[r]}or.from&&or.alloc&&or.allocUnsafe&&or.allocUnsafeSlow?Qv.exports=xa:(Hv(xa,Ep),Ep.Buffer=Sn);function Sn(e,t,r){return or(e,t,r)}Sn.prototype=Object.create(or.prototype);Hv(or,Sn);Sn.from=function(e,t,r){if(typeof e=="number")throw new TypeError("Argument must not be a number");return or(e,t,r)};Sn.alloc=function(e,t,r){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=or(e);return t!==void 0?typeof r=="string"?n.fill(t,r):n.fill(t):n.fill(0),n};Sn.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return or(e)};Sn.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return xa.SlowBuffer(e)}});var _p=y((IZ,Wv)=>{p();var Na=li().Buffer,AD=M("stream"),xD=M("util");function Ra(e){if(this.buffer=null,this.writable=!0,this.readable=!0,!e)return this.buffer=Na.alloc(0),this;if(typeof e.pipe=="function")return this.buffer=Na.alloc(0),e.pipe(this),this;if(e.length||typeof e=="object")return this.buffer=e,this.writable=!1,process.nextTick(function(){this.emit("end",e),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof e+")")}xD.inherits(Ra,AD);Ra.prototype.write=function(t){this.buffer=Na.concat([this.buffer,Na.from(t)]),this.emit("data",t)};Ra.prototype.end=function(t){t&&this.write(t),this.emit("end",t),this.emit("close"),this.writable=!1,this.readable=!1};Wv.exports=Ra});var Yv=y((OZ,zv)=>{"use strict";p();function bp(e){var t=(e/8|0)+(e%8===0?0:1);return t}var ND={ES256:bp(256),ES384:bp(384),ES512:bp(521)};function RD(e){var t=ND[e];if(t)return t;throw new Error('Unknown algorithm "'+e+'"')}zv.exports=RD});var nE=y((xZ,rE)=>{"use strict";p();var Ca=li().Buffer,Xv=Yv(),Pa=128,Zv=0,CD=32,PD=16,DD=2,eE=PD|CD|Zv<<6,Da=DD|Zv<<6;function LD(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function tE(e){if(Ca.isBuffer(e))return e;if(typeof e=="string")return Ca.from(e,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function kD(e,t){e=tE(e);var r=Xv(t),n=r+1,i=e.length,o=0;if(e[o++]!==eE)throw new Error('Could not find expected "seq"');var s=e[o++];if(s===(Pa|1)&&(s=e[o++]),i-o<s)throw new Error('"seq" specified length of "'+s+'", only "'+(i-o)+'" remaining');if(e[o++]!==Da)throw new Error('Could not find expected "int" for "r"');var a=e[o++];if(i-o-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-o-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var u=o;if(o+=a,e[o++]!==Da)throw new Error('Could not find expected "int" for "s"');var c=e[o++];if(i-o!==c)throw new Error('"s" specified length of "'+c+'", expected "'+(i-o)+'"');if(n<c)throw new Error('"s" specified length of "'+c+'", max of "'+n+'" is acceptable');var l=o;if(o+=c,o!==i)throw new Error('Expected to consume entire buffer, but "'+(i-o)+'" bytes remain');var d=r-a,f=r-c,h=Ca.allocUnsafe(d+a+f+c);for(o=0;o<d;++o)h[o]=0;e.copy(h,o,u+Math.max(-d,0),u+a),o=r;for(var g=o;o<g+f;++o)h[o]=0;return e.copy(h,o,l+Math.max(-f,0),l+c),h=h.toString("base64"),h=LD(h),h}function Jv(e,t,r){for(var n=0;t+n<r&&e[t+n]===0;)++n;var i=e[t+n]>=Pa;return i&&--n,n}function jD(e,t){e=tE(e);var r=Xv(t),n=e.length;if(n!==r*2)throw new TypeError('"'+t+'" signatures must be "'+r*2+'" bytes, saw "'+n+'"');var i=Jv(e,0,r),o=Jv(e,r,e.length),s=r-i,a=r-o,u=2+s+1+1+a,c=u<Pa,l=Ca.allocUnsafe((c?2:3)+u),d=0;return l[d++]=eE,c?l[d++]=u:(l[d++]=Pa|1,l[d++]=u&255),l[d++]=Da,l[d++]=s,i<0?(l[d++]=0,d+=e.copy(l,d,0,r)):d+=e.copy(l,d,i,r),l[d++]=Da,l[d++]=a,o<0?(l[d++]=0,e.copy(l,d,r)):e.copy(l,d,r+o),l}rE.exports={derToJose:kD,joseToDer:jD}});var oE=y((RZ,iE)=>{"use strict";p();var Po=M("buffer").Buffer,Sp=M("buffer").SlowBuffer;iE.exports=La;function La(e,t){if(!Po.isBuffer(e)||!Po.isBuffer(t)||e.length!==t.length)return!1;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return r===0}La.install=function(){Po.prototype.equal=Sp.prototype.equal=function(t){return La(this,t)}};var MD=Po.prototype.equal,FD=Sp.prototype.equal;La.restore=function(){Po.prototype.equal=MD,Sp.prototype.equal=FD}});var Op=y((PZ,hE)=>{p();var di=li().Buffer,Dt=M("crypto"),aE=nE(),sE=M("util"),qD=`"%s" is not a valid algorithm.
|
|
29
29
|
Supported algorithms are:
|
|
30
|
-
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Po="secret must be a string or buffer",li="key must be a string or a buffer",PD="key must be a string, a buffer or an object",bp=typeof Dt.createPublicKey=="function";bp&&(li+=" or a KeyObject",Po+="or a KeyObject");function nE(e){if(!pi.isBuffer(e)&&typeof e!="string"&&(!bp||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw Qt(li)}function iE(e){if(!pi.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw Qt(PD)}function DD(e){if(!pi.isBuffer(e)){if(typeof e=="string")return e;if(!bp||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw Qt(Po)}}function Sp(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function oE(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function Qt(e){var t=[].slice.call(arguments,1),r=tE.format.bind(tE,e).apply(null,t);return new TypeError(r)}function LD(e){return pi.isBuffer(e)||typeof e=="string"}function Do(e){return LD(e)||(e=JSON.stringify(e)),e}function sE(e){return function(r,n){DD(n),r=Do(r);var i=Dt.createHmac("sha"+e,n),o=(i.update(r),i.digest("base64"));return Sp(o)}}var _p,kD="timingSafeEqual"in Dt?function(t,r){return t.byteLength!==r.byteLength?!1:Dt.timingSafeEqual(t,r)}:function(t,r){return _p||(_p=eE()),_p(t,r)};function jD(e){return function(r,n,i){var o=sE(e)(r,i);return kD(pi.from(n),pi.from(o))}}function aE(e){return function(r,n){iE(n),r=Do(r);var i=Dt.createSign("RSA-SHA"+e),o=(i.update(r),i.sign(n,"base64"));return Sp(o)}}function uE(e){return function(r,n,i){nE(i),r=Do(r),n=oE(n);var o=Dt.createVerify("RSA-SHA"+e);return o.update(r),o.verify(i,n,"base64")}}function MD(e){return function(r,n){iE(n),r=Do(r);var i=Dt.createSign("RSA-SHA"+e),o=(i.update(r),i.sign({key:n,padding:Dt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Dt.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Sp(o)}}function FD(e){return function(r,n,i){nE(i),r=Do(r),n=oE(n);var o=Dt.createVerify("RSA-SHA"+e);return o.update(r),o.verify({key:i,padding:Dt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Dt.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function qD(e){var t=aE(e);return function(){var n=t.apply(null,arguments);return n=rE.derToJose(n,"ES"+e),n}}function UD(e){var t=uE(e);return function(n,i,o){i=rE.joseToDer(i,"ES"+e).toString("base64");var s=t(n,i,o);return s}}function VD(){return function(){return""}}function GD(){return function(t,r){return r===""}}cE.exports=function(t){var r={hs:sE,rs:aE,ps:MD,es:qD,none:VD},n={hs:jD,rs:uE,ps:FD,es:UD,none:GD},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Qt(CD,t);var o=(i[1]||i[3]).toLowerCase(),s=i[2];return{sign:r[o](s),verify:n[o](s)}}});var Ip=y((OZ,lE)=>{p();var BD=M("buffer").Buffer;lE.exports=function(t){return typeof t=="string"?t:typeof t=="number"||BD.isBuffer(t)?t.toString():JSON.stringify(t)}});var gE=y((AZ,mE)=>{p();var $D=ci().Buffer,pE=yp(),KD=Tp(),HD=M("stream"),dE=Ip(),Op=M("util");function fE(e,t){return $D.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function QD(e,t,r){r=r||"utf8";var n=fE(dE(e),"binary"),i=fE(dE(t),r);return Op.format("%s.%s",n,i)}function hE(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,i=e.encoding,o=KD(t.alg),s=QD(t,r,i),a=o.sign(s,n);return Op.format("%s.%s",s,a)}function Da(e){var t=e.secret;if(t=t??e.privateKey,t=t??e.key,/^hs/i.test(e.header.alg)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new pE(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new pE(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}Op.inherits(Da,HD);Da.prototype.sign=function(){try{var t=hE({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};Da.sign=hE;mE.exports=Da});var wE=y((NZ,OE)=>{p();var vE=ci().Buffer,yE=yp(),WD=Tp(),zD=M("stream"),EE=Ip(),YD=M("util"),JD=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function XD(e){return Object.prototype.toString.call(e)==="[object Object]"}function ZD(e){if(XD(e))return e;try{return JSON.parse(e)}catch{return}}function _E(e){var t=e.split(".",1)[0];return ZD(vE.from(t,"base64").toString("binary"))}function eL(e){return e.split(".",2).join(".")}function bE(e){return e.split(".")[2]}function tL(e,t){t=t||"utf8";var r=e.split(".")[1];return vE.from(r,"base64").toString(t)}function SE(e){return JD.test(e)&&!!_E(e)}function TE(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=EE(e);var i=bE(e),o=eL(e),s=WD(t);return s.verify(o,i,r)}function IE(e,t){if(t=t||{},e=EE(e),!SE(e))return null;var r=_E(e);if(!r)return null;var n=tL(e);return(r.typ==="JWT"||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:bE(e)}}function di(e){e=e||{};var t=e.secret;if(t=t??e.publicKey,t=t??e.key,/^hs/i.test(e.algorithm)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new yE(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new yE(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}YD.inherits(di,zD);di.prototype.verify=function(){try{var t=TE(this.signature.buffer,this.algorithm,this.key.buffer),r=IE(this.signature.buffer,this.encoding);return this.emit("done",t,r),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};di.decode=IE;di.isValid=SE;di.verify=TE;OE.exports=di});var ka=y(Ur=>{p();var AE=gE(),La=wE(),rL=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Ur.ALGORITHMS=rL;Ur.sign=AE.sign;Ur.verify=La.verify;Ur.decode=La.decode;Ur.isValid=La.isValid;Ur.createSign=function(t){return new AE(t)};Ur.createVerify=function(t){return new La(t)}});var wp=y((DZ,xE)=>{p();var nL=ka();xE.exports=function(e,t){t=t||{};var r=nL.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var i=JSON.parse(n);i!==null&&typeof i=="object"&&(n=i)}catch{}return t.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var Lo=y((kZ,NE)=>{p();var ja=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};ja.prototype=Object.create(Error.prototype);ja.prototype.constructor=ja;NE.exports=ja});var Ap=y((MZ,CE)=>{p();var RE=Lo(),Ma=function(e,t){RE.call(this,e),this.name="NotBeforeError",this.date=t};Ma.prototype=Object.create(RE.prototype);Ma.prototype.constructor=Ma;CE.exports=Ma});var xp=y((qZ,DE)=>{p();var PE=Lo(),Fa=function(e,t){PE.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};Fa.prototype=Object.create(PE.prototype);Fa.prototype.constructor=Fa;DE.exports=Fa});var kE=y((VZ,LE)=>{p();var fi=1e3,hi=fi*60,mi=hi*60,Sn=mi*24,iL=Sn*7,oL=Sn*365.25;LE.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return sL(e);if(r==="number"&&isFinite(e))return t.long?uL(e):aL(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function sL(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*oL;case"weeks":case"week":case"w":return r*iL;case"days":case"day":case"d":return r*Sn;case"hours":case"hour":case"hrs":case"hr":case"h":return r*mi;case"minutes":case"minute":case"mins":case"min":case"m":return r*hi;case"seconds":case"second":case"secs":case"sec":case"s":return r*fi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function aL(e){var t=Math.abs(e);return t>=Sn?Math.round(e/Sn)+"d":t>=mi?Math.round(e/mi)+"h":t>=hi?Math.round(e/hi)+"m":t>=fi?Math.round(e/fi)+"s":e+"ms"}function uL(e){var t=Math.abs(e);return t>=Sn?qa(e,t,Sn,"day"):t>=mi?qa(e,t,mi,"hour"):t>=hi?qa(e,t,hi,"minute"):t>=fi?qa(e,t,fi,"second"):e+" ms"}function qa(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Np=y((BZ,jE)=>{p();var cL=kE();jE.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if(typeof e=="string"){var n=cL(e);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof e=="number"?r+e:void 0}});var gi=y((KZ,ME)=>{"use strict";p();var lL="2.0.0",pL=Number.MAX_SAFE_INTEGER||9007199254740991,dL=16,fL=250,hL=["major","premajor","minor","preminor","patch","prepatch","prerelease"];ME.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:dL,MAX_SAFE_BUILD_LENGTH:fL,MAX_SAFE_INTEGER:pL,RELEASE_TYPES:hL,SEMVER_SPEC_VERSION:lL,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var ko=y((QZ,FE)=>{"use strict";p();var mL=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};FE.exports=mL});var yi=y((sr,qE)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:Rp,MAX_SAFE_BUILD_LENGTH:gL,MAX_LENGTH:yL}=gi(),vL=ko();sr=qE.exports={};var EL=sr.re=[],_L=sr.safeRe=[],k=sr.src=[],bL=sr.safeSrc=[],j=sr.t={},SL=0,Cp="[a-zA-Z0-9-]",TL=[["\\s",1],["\\d",yL],[Cp,gL]],IL=e=>{for(let[t,r]of TL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},z=(e,t,r)=>{let n=IL(t),i=SL++;vL(e,i,t),j[e]=i,k[i]=t,bL[i]=n,EL[i]=new RegExp(t,r?"g":void 0),_L[i]=new RegExp(n,r?"g":void 0)};z("NUMERICIDENTIFIER","0|[1-9]\\d*");z("NUMERICIDENTIFIERLOOSE","\\d+");z("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Cp}*`);z("MAINVERSION",`(${k[j.NUMERICIDENTIFIER]})\\.(${k[j.NUMERICIDENTIFIER]})\\.(${k[j.NUMERICIDENTIFIER]})`);z("MAINVERSIONLOOSE",`(${k[j.NUMERICIDENTIFIERLOOSE]})\\.(${k[j.NUMERICIDENTIFIERLOOSE]})\\.(${k[j.NUMERICIDENTIFIERLOOSE]})`);z("PRERELEASEIDENTIFIER",`(?:${k[j.NONNUMERICIDENTIFIER]}|${k[j.NUMERICIDENTIFIER]})`);z("PRERELEASEIDENTIFIERLOOSE",`(?:${k[j.NONNUMERICIDENTIFIER]}|${k[j.NUMERICIDENTIFIERLOOSE]})`);z("PRERELEASE",`(?:-(${k[j.PRERELEASEIDENTIFIER]}(?:\\.${k[j.PRERELEASEIDENTIFIER]})*))`);z("PRERELEASELOOSE",`(?:-?(${k[j.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${k[j.PRERELEASEIDENTIFIERLOOSE]})*))`);z("BUILDIDENTIFIER",`${Cp}+`);z("BUILD",`(?:\\+(${k[j.BUILDIDENTIFIER]}(?:\\.${k[j.BUILDIDENTIFIER]})*))`);z("FULLPLAIN",`v?${k[j.MAINVERSION]}${k[j.PRERELEASE]}?${k[j.BUILD]}?`);z("FULL",`^${k[j.FULLPLAIN]}$`);z("LOOSEPLAIN",`[v=\\s]*${k[j.MAINVERSIONLOOSE]}${k[j.PRERELEASELOOSE]}?${k[j.BUILD]}?`);z("LOOSE",`^${k[j.LOOSEPLAIN]}$`);z("GTLT","((?:<|>)?=?)");z("XRANGEIDENTIFIERLOOSE",`${k[j.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);z("XRANGEIDENTIFIER",`${k[j.NUMERICIDENTIFIER]}|x|X|\\*`);z("XRANGEPLAIN",`[v=\\s]*(${k[j.XRANGEIDENTIFIER]})(?:\\.(${k[j.XRANGEIDENTIFIER]})(?:\\.(${k[j.XRANGEIDENTIFIER]})(?:${k[j.PRERELEASE]})?${k[j.BUILD]}?)?)?`);z("XRANGEPLAINLOOSE",`[v=\\s]*(${k[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${k[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${k[j.XRANGEIDENTIFIERLOOSE]})(?:${k[j.PRERELEASELOOSE]})?${k[j.BUILD]}?)?)?`);z("XRANGE",`^${k[j.GTLT]}\\s*${k[j.XRANGEPLAIN]}$`);z("XRANGELOOSE",`^${k[j.GTLT]}\\s*${k[j.XRANGEPLAINLOOSE]}$`);z("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Rp}})(?:\\.(\\d{1,${Rp}}))?(?:\\.(\\d{1,${Rp}}))?`);z("COERCE",`${k[j.COERCEPLAIN]}(?:$|[^\\d])`);z("COERCEFULL",k[j.COERCEPLAIN]+`(?:${k[j.PRERELEASE]})?(?:${k[j.BUILD]})?(?:$|[^\\d])`);z("COERCERTL",k[j.COERCE],!0);z("COERCERTLFULL",k[j.COERCEFULL],!0);z("LONETILDE","(?:~>?)");z("TILDETRIM",`(\\s*)${k[j.LONETILDE]}\\s+`,!0);sr.tildeTrimReplace="$1~";z("TILDE",`^${k[j.LONETILDE]}${k[j.XRANGEPLAIN]}$`);z("TILDELOOSE",`^${k[j.LONETILDE]}${k[j.XRANGEPLAINLOOSE]}$`);z("LONECARET","(?:\\^)");z("CARETTRIM",`(\\s*)${k[j.LONECARET]}\\s+`,!0);sr.caretTrimReplace="$1^";z("CARET",`^${k[j.LONECARET]}${k[j.XRANGEPLAIN]}$`);z("CARETLOOSE",`^${k[j.LONECARET]}${k[j.XRANGEPLAINLOOSE]}$`);z("COMPARATORLOOSE",`^${k[j.GTLT]}\\s*(${k[j.LOOSEPLAIN]})$|^$`);z("COMPARATOR",`^${k[j.GTLT]}\\s*(${k[j.FULLPLAIN]})$|^$`);z("COMPARATORTRIM",`(\\s*)${k[j.GTLT]}\\s*(${k[j.LOOSEPLAIN]}|${k[j.XRANGEPLAIN]})`,!0);sr.comparatorTrimReplace="$1$2$3";z("HYPHENRANGE",`^\\s*(${k[j.XRANGEPLAIN]})\\s+-\\s+(${k[j.XRANGEPLAIN]})\\s*$`);z("HYPHENRANGELOOSE",`^\\s*(${k[j.XRANGEPLAINLOOSE]})\\s+-\\s+(${k[j.XRANGEPLAINLOOSE]})\\s*$`);z("STAR","(<|>)?=?\\s*\\*");z("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");z("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ua=y((YZ,UE)=>{"use strict";p();var OL=Object.freeze({loose:!0}),wL=Object.freeze({}),AL=e=>e?typeof e!="object"?OL:e:wL;UE.exports=AL});var Pp=y((XZ,BE)=>{"use strict";p();var VE=/^[0-9]+$/,GE=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=VE.test(e),n=VE.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},xL=(e,t)=>GE(t,e);BE.exports={compareIdentifiers:GE,rcompareIdentifiers:xL}});var Je=y((e9,KE)=>{"use strict";p();var Va=ko(),{MAX_LENGTH:$E,MAX_SAFE_INTEGER:Ga}=gi(),{safeRe:Ba,t:$a}=yi(),NL=Ua(),{compareIdentifiers:Dp}=Pp(),Lp=class e{constructor(t,r){if(r=NL(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>$E)throw new TypeError(`version is longer than ${$E} characters`);Va("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?Ba[$a.LOOSE]:Ba[$a.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ga||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ga||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ga||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<Ga)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Va("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if(Va("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Dp(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if(Va("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return Dp(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?Ba[$a.PRERELEASELOOSE]:Ba[$a.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),Dp(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};KE.exports=Lp});var Vr=y((r9,QE)=>{"use strict";p();var HE=Je(),RL=(e,t,r=!1)=>{if(e instanceof HE)return e;try{return new HE(e,t)}catch(n){if(!r)return null;throw n}};QE.exports=RL});var zE=y((i9,WE)=>{"use strict";p();var CL=Vr(),PL=(e,t)=>{let r=CL(e,t);return r?r.version:null};WE.exports=PL});var JE=y((s9,YE)=>{"use strict";p();var DL=Vr(),LL=(e,t)=>{let r=DL(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};YE.exports=LL});var e_=y((u9,ZE)=>{"use strict";p();var XE=Je(),kL=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new XE(e instanceof XE?e.version:e,r).inc(t,n,i).version}catch{return null}};ZE.exports=kL});var n_=y((l9,r_)=>{"use strict";p();var t_=Vr(),jL=(e,t)=>{let r=t_(e,null,!0),n=t_(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};r_.exports=jL});var o_=y((d9,i_)=>{"use strict";p();var ML=Je(),FL=(e,t)=>new ML(e,t).major;i_.exports=FL});var a_=y((h9,s_)=>{"use strict";p();var qL=Je(),UL=(e,t)=>new qL(e,t).minor;s_.exports=UL});var c_=y((g9,u_)=>{"use strict";p();var VL=Je(),GL=(e,t)=>new VL(e,t).patch;u_.exports=GL});var p_=y((v9,l_)=>{"use strict";p();var BL=Vr(),$L=(e,t)=>{let r=BL(e,t);return r&&r.prerelease.length?r.prerelease:null};l_.exports=$L});var Lt=y((_9,f_)=>{"use strict";p();var d_=Je(),KL=(e,t,r)=>new d_(e,r).compare(new d_(t,r));f_.exports=KL});var m_=y((S9,h_)=>{"use strict";p();var HL=Lt(),QL=(e,t,r)=>HL(t,e,r);h_.exports=QL});var y_=y((I9,g_)=>{"use strict";p();var WL=Lt(),zL=(e,t)=>WL(e,t,!0);g_.exports=zL});var Ka=y((w9,E_)=>{"use strict";p();var v_=Je(),YL=(e,t,r)=>{let n=new v_(e,r),i=new v_(t,r);return n.compare(i)||n.compareBuild(i)};E_.exports=YL});var b_=y((x9,__)=>{"use strict";p();var JL=Ka(),XL=(e,t)=>e.sort((r,n)=>JL(r,n,t));__.exports=XL});var T_=y((R9,S_)=>{"use strict";p();var ZL=Ka(),ek=(e,t)=>e.sort((r,n)=>ZL(n,r,t));S_.exports=ek});var jo=y((P9,I_)=>{"use strict";p();var tk=Lt(),rk=(e,t,r)=>tk(e,t,r)>0;I_.exports=rk});var Ha=y((L9,O_)=>{"use strict";p();var nk=Lt(),ik=(e,t,r)=>nk(e,t,r)<0;O_.exports=ik});var kp=y((j9,w_)=>{"use strict";p();var ok=Lt(),sk=(e,t,r)=>ok(e,t,r)===0;w_.exports=sk});var jp=y((F9,A_)=>{"use strict";p();var ak=Lt(),uk=(e,t,r)=>ak(e,t,r)!==0;A_.exports=uk});var Qa=y((U9,x_)=>{"use strict";p();var ck=Lt(),lk=(e,t,r)=>ck(e,t,r)>=0;x_.exports=lk});var Wa=y((G9,N_)=>{"use strict";p();var pk=Lt(),dk=(e,t,r)=>pk(e,t,r)<=0;N_.exports=dk});var Mp=y(($9,R_)=>{"use strict";p();var fk=kp(),hk=jp(),mk=jo(),gk=Qa(),yk=Ha(),vk=Wa(),Ek=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return fk(e,r,n);case"!=":return hk(e,r,n);case">":return mk(e,r,n);case">=":return gk(e,r,n);case"<":return yk(e,r,n);case"<=":return vk(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};R_.exports=Ek});var P_=y((H9,C_)=>{"use strict";p();var _k=Je(),bk=Vr(),{safeRe:za,t:Ya}=yi(),Sk=(e,t)=>{if(e instanceof _k)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?za[Ya.COERCEFULL]:za[Ya.COERCE]);else{let u=t.includePrerelease?za[Ya.COERCERTLFULL]:za[Ya.COERCERTL],c;for(;(c=u.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return bk(`${n}.${i}.${o}${s}${a}`,t)};C_.exports=Sk});var L_=y((W9,D_)=>{"use strict";p();var Tk=Vr(),Ik=gi(),Ok=Je(),wk=(e,t,r)=>{if(!Ik.RELEASE_TYPES.includes(t))return null;let n=Ak(e,r);return n&&xk(n,t)},Ak=(e,t)=>{let r=e instanceof Ok?e.version:e;return Tk(r,t)},xk=(e,t)=>{if(Nk(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Nk=e=>e.startsWith("pre");D_.exports=wk});var j_=y((Y9,k_)=>{"use strict";p();var Fp=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}};k_.exports=Fp});var kt=y((X9,U_)=>{"use strict";p();var Rk=/\s+/g,qp=class e{constructor(t,r){if(r=Pk(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof Up)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(Rk," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!F_(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Vk(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(Uk,"");let n=((this.options.includePrerelease&&Fk)|(this.options.loose&&qk))+":"+t,i=M_.get(n);if(i)return i;let o=this.options.loose,s=o?ut[Xe.HYPHENRANGELOOSE]:ut[Xe.HYPHENRANGE];t=t.replace(s,Jk(this.options.includePrerelease)),Te("hyphen replace",t),t=t.replace(ut[Xe.COMPARATORTRIM],kk),Te("comparator trim",t),t=t.replace(ut[Xe.TILDETRIM],jk),Te("tilde trim",t),t=t.replace(ut[Xe.CARETTRIM],Mk),Te("caret trim",t);let a=t.split(" ").map(d=>Gk(d,this.options)).join(" ").split(/\s+/).map(d=>Yk(d,this.options));o&&(a=a.filter(d=>(Te("loose invalid filter",d,this.options),!!d.match(ut[Xe.COMPARATORLOOSE])))),Te("range list",a);let u=new Map,c=a.map(d=>new Up(d,this.options));for(let d of c){if(F_(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return M_.set(n,l),l}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>q_(n,r)&&t.set.some(i=>q_(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new Dk(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Xk(this.set[r],t,this.options))return!0;return!1}};U_.exports=qp;var Ck=j_(),M_=new Ck,Pk=Ua(),Up=Mo(),Te=ko(),Dk=Je(),{safeRe:ut,src:Lk,t:Xe,comparatorTrimReplace:kk,tildeTrimReplace:jk,caretTrimReplace:Mk}=yi(),{FLAG_INCLUDE_PRERELEASE:Fk,FLAG_LOOSE:qk}=gi(),Uk=new RegExp(Lk[Xe.BUILD],"g"),F_=e=>e.value==="<0.0.0-0",Vk=e=>e.value==="",q_=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,t)),i=n.pop();return r},Gk=(e,t)=>(e=e.replace(ut[Xe.BUILD],""),Te("comp",e,t),e=Kk(e,t),Te("caret",e),e=Bk(e,t),Te("tildes",e),e=Qk(e,t),Te("xrange",e),e=zk(e,t),Te("stars",e),e),ct=e=>!e||e.toLowerCase()==="x"||e==="*",Bk=(e,t)=>e.trim().split(/\s+/).map(r=>$k(r,t)).join(" "),$k=(e,t)=>{let r=t.loose?ut[Xe.TILDELOOSE]:ut[Xe.TILDE];return e.replace(r,(n,i,o,s,a)=>{Te("tilde",e,n,i,o,s,a);let u;return ct(i)?u="":ct(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:ct(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(Te("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,Te("tilde return",u),u})},Kk=(e,t)=>e.trim().split(/\s+/).map(r=>Hk(r,t)).join(" "),Hk=(e,t)=>{Te("caret",e,t);let r=t.loose?ut[Xe.CARETLOOSE]:ut[Xe.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,u)=>{Te("caret",e,i,o,s,a,u);let c;return ct(o)?c="":ct(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:ct(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?(Te("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):(Te("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Te("caret return",c),c})},Qk=(e,t)=>(Te("replaceXRanges",e,t),e.split(/\s+/).map(r=>Wk(r,t)).join(" ")),Wk=(e,t)=>{e=e.trim();let r=t.loose?ut[Xe.XRANGELOOSE]:ut[Xe.XRANGE];return e.replace(r,(n,i,o,s,a,u)=>{Te("xRange",e,n,i,o,s,a,u);let c=ct(o),l=c||ct(s),d=l||ct(a),f=d;return i==="="&&f&&(i=""),u=t.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&f?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):l?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:d&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),Te("xRange return",n),n})},zk=(e,t)=>(Te("replaceStars",e,t),e.trim().replace(ut[Xe.STAR],"")),Yk=(e,t)=>(Te("replaceGTE0",e,t),e.trim().replace(ut[t.includePrerelease?Xe.GTE0PRE:Xe.GTE0],"")),Jk=e=>(t,r,n,i,o,s,a,u,c,l,d,f)=>(ct(n)?r="":ct(i)?r=`>=${n}.0.0${e?"-0":""}`:ct(o)?r=`>=${n}.${i}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,ct(c)?u="":ct(l)?u=`<${+c+1}.0.0-0`:ct(d)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${d}-${f}`:e?u=`<${c}.${l}.${+d+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),Xk=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Te(e[n].semver),e[n].semver!==Up.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var Mo=y((e7,H_)=>{"use strict";p();var Fo=Symbol("SemVer ANY"),Bp=class e{static get ANY(){return Fo}constructor(t,r){if(r=V_(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),Gp("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===Fo?this.value="":this.value=this.operator+this.semver.version,Gp("comp",this)}parse(t){let r=this.options.loose?G_[B_.COMPARATORLOOSE]:G_[B_.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new $_(n[2],this.options.loose):this.semver=Fo}toString(){return this.value}test(t){if(Gp("Comparator.test",t,this.options.loose),this.semver===Fo||t===Fo)return!0;if(typeof t=="string")try{t=new $_(t,this.options)}catch{return!1}return Vp(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new K_(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new K_(this.value,r).test(t.semver):(r=V_(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||Vp(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||Vp(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};H_.exports=Bp;var V_=Ua(),{safeRe:G_,t:B_}=yi(),Vp=Mp(),Gp=ko(),$_=Je(),K_=kt()});var qo=y((r7,Q_)=>{"use strict";p();var Zk=kt(),ej=(e,t,r)=>{try{t=new Zk(t,r)}catch{return!1}return t.test(e)};Q_.exports=ej});var z_=y((i7,W_)=>{"use strict";p();var tj=kt(),rj=(e,t)=>new tj(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));W_.exports=rj});var J_=y((s7,Y_)=>{"use strict";p();var nj=Je(),ij=kt(),oj=(e,t,r)=>{let n=null,i=null,o=null;try{o=new ij(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new nj(n,r))}),n};Y_.exports=oj});var Z_=y((u7,X_)=>{"use strict";p();var sj=Je(),aj=kt(),uj=(e,t,r)=>{let n=null,i=null,o=null;try{o=new aj(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new sj(n,r))}),n};X_.exports=uj});var rb=y((l7,tb)=>{"use strict";p();var $p=Je(),cj=kt(),eb=jo(),lj=(e,t)=>{e=new cj(e,t);let r=new $p("0.0.0");if(e.test(r)||(r=new $p("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;i.forEach(s=>{let a=new $p(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||eb(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||eb(r,o))&&(r=o)}return r&&e.test(r)?r:null};tb.exports=lj});var ib=y((d7,nb)=>{"use strict";p();var pj=kt(),dj=(e,t)=>{try{return new pj(e,t).range||"*"}catch{return null}};nb.exports=dj});var Ja=y((h7,ub)=>{"use strict";p();var fj=Je(),ab=Mo(),{ANY:hj}=ab,mj=kt(),gj=qo(),ob=jo(),sb=Ha(),yj=Wa(),vj=Qa(),Ej=(e,t,r,n)=>{e=new fj(e,n),t=new mj(t,n);let i,o,s,a,u;switch(r){case">":i=ob,o=yj,s=sb,a=">",u=">=";break;case"<":i=sb,o=vj,s=ob,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(gj(e,t,n))return!1;for(let c=0;c<t.set.length;++c){let l=t.set[c],d=null,f=null;if(l.forEach(h=>{h.semver===hj&&(h=new ab(">=0.0.0")),d=d||h,f=f||h,i(h.semver,d.semver,n)?d=h:s(h.semver,f.semver,n)&&(f=h)}),d.operator===a||d.operator===u||(!f.operator||f.operator===a)&&o(e,f.semver))return!1;if(f.operator===u&&s(e,f.semver))return!1}return!0};ub.exports=Ej});var lb=y((g7,cb)=>{"use strict";p();var _j=Ja(),bj=(e,t,r)=>_j(e,t,">",r);cb.exports=bj});var db=y((v7,pb)=>{"use strict";p();var Sj=Ja(),Tj=(e,t,r)=>Sj(e,t,"<",r);pb.exports=Tj});var mb=y((_7,hb)=>{"use strict";p();var fb=kt(),Ij=(e,t,r)=>(e=new fb(e,r),t=new fb(t,r),e.intersects(t,r));hb.exports=Ij});var yb=y((S7,gb)=>{"use strict";p();var Oj=qo(),wj=Lt();gb.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((l,d)=>wj(l,d,r));for(let l of s)Oj(l,t,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,d]of n)l===d?a.push(l):!d&&l===s[0]?a.push("*"):d?l===s[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof t.raw=="string"?t.raw:String(t);return u.length<c.length?u:t}});var Tb=y((I7,Sb)=>{"use strict";p();var vb=kt(),Qp=Mo(),{ANY:Kp}=Qp,Hp=qo(),Wp=Lt(),Aj=(e,t,r={})=>{if(e===t)return!0;e=new vb(e,r),t=new vb(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=Nj(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},xj=[new Qp(">=0.0.0-0")],Eb=[new Qp(">=0.0.0")],Nj=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Kp){if(t.length===1&&t[0].semver===Kp)return!0;r.includePrerelease?e=xj:e=Eb}if(t.length===1&&t[0].semver===Kp){if(r.includePrerelease)return!0;t=Eb}let n=new Set,i,o;for(let h of e)h.operator===">"||h.operator===">="?i=_b(i,h,r):h.operator==="<"||h.operator==="<="?o=bb(o,h,r):n.add(h.semver);if(n.size>1)return null;let s;if(i&&o){if(s=Wp(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let h of n){if(i&&!Hp(h,String(i),r)||o&&!Hp(h,String(o),r))return null;for(let g of t)if(!Hp(h,String(g),r))return!1;return!0}let a,u,c,l,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let h of t){if(l=l||h.operator===">"||h.operator===">=",c=c||h.operator==="<"||h.operator==="<=",i){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=_b(i,h,r),a===h&&a!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(o){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(u=bb(o,h,r),u===h&&u!==o)return!1}else if(o.operator==="<="&&!h.test(o.semver))return!1}if(!h.operator&&(o||i)&&s!==0)return!1}return!(i&&c&&!o&&s!==0||o&&l&&!i&&s!==0||f||d)},_b=(e,t,r)=>{if(!e)return t;let n=Wp(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},bb=(e,t,r)=>{if(!e)return t;let n=Wp(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};Sb.exports=Aj});var Xa=y((w7,wb)=>{"use strict";p();var zp=yi(),Ib=gi(),Rj=Je(),Ob=Pp(),Cj=Vr(),Pj=zE(),Dj=JE(),Lj=e_(),kj=n_(),jj=o_(),Mj=a_(),Fj=c_(),qj=p_(),Uj=Lt(),Vj=m_(),Gj=y_(),Bj=Ka(),$j=b_(),Kj=T_(),Hj=jo(),Qj=Ha(),Wj=kp(),zj=jp(),Yj=Qa(),Jj=Wa(),Xj=Mp(),Zj=P_(),eM=L_(),tM=Mo(),rM=kt(),nM=qo(),iM=z_(),oM=J_(),sM=Z_(),aM=rb(),uM=ib(),cM=Ja(),lM=lb(),pM=db(),dM=mb(),fM=yb(),hM=Tb();wb.exports={parse:Cj,valid:Pj,clean:Dj,inc:Lj,diff:kj,major:jj,minor:Mj,patch:Fj,prerelease:qj,compare:Uj,rcompare:Vj,compareLoose:Gj,compareBuild:Bj,sort:$j,rsort:Kj,gt:Hj,lt:Qj,eq:Wj,neq:zj,gte:Yj,lte:Jj,cmp:Xj,coerce:Zj,truncate:eM,Comparator:tM,Range:rM,satisfies:nM,toComparators:iM,maxSatisfying:oM,minSatisfying:sM,minVersion:aM,validRange:uM,outside:cM,gtr:lM,ltr:pM,intersects:dM,simplifyRange:fM,subset:hM,SemVer:Rj,re:zp.re,src:zp.src,tokens:zp.t,SEMVER_SPEC_VERSION:Ib.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ib.RELEASE_TYPES,compareIdentifiers:Ob.compareIdentifiers,rcompareIdentifiers:Ob.rcompareIdentifiers}});var xb=y((x7,Ab)=>{p();var mM=Xa();Ab.exports=mM.satisfies(process.version,">=15.7.0")});var Rb=y((R7,Nb)=>{p();var gM=Xa();Nb.exports=gM.satisfies(process.version,">=16.9.0")});var Yp=y((P7,Cb)=>{p();var yM=xb(),vM=Rb(),EM={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},_M={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};Cb.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=EM[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(yM)switch(r){case"ec":let i=t.asymmetricKeyDetails.namedCurve,o=_M[e];if(i!==o)throw new Error(`"alg" parameter "${e}" requires curve "${o}".`);break;case"rsa-pss":if(vM){let s=parseInt(e.slice(-3),10),{hashAlgorithm:a,mgf1HashAlgorithm:u,saltLength:c}=t.asymmetricKeyDetails;if(a!==`sha${s}`||u!==a)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(c!==void 0&&c>s>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}}});var Jp=y((L7,Pb)=>{p();var bM=Xa();Pb.exports=bM.satisfies(process.version,"^6.12.0 || >=8.0.0")});var kb=y((j7,Lb)=>{p();var Se=Lo(),SM=Ap(),Db=xp(),TM=wp(),IM=Np(),OM=Yp(),wM=Jp(),AM=ka(),{KeyObject:xM,createSecretKey:NM,createPublicKey:RM}=M("crypto"),Xp=["RS256","RS384","RS512"],CM=["ES256","ES384","ES512"],Zp=["RS256","RS384","RS512"],PM=["HS256","HS384","HS512"];wM&&(Xp.splice(Xp.length,0,"PS256","PS384","PS512"),Zp.splice(Zp.length,0,"PS256","PS384","PS512"));Lb.exports=function(e,t,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let i;if(n?i=n:i=function(l,d){if(l)throw l;return d},r.clockTimestamp&&typeof r.clockTimestamp!="number")return i(new Se("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return i(new Se("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return i(new Se("allowInvalidAsymmetricKeyTypes must be a boolean"));let o=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return i(new Se("jwt must be provided"));if(typeof e!="string")return i(new Se("jwt must be a string"));let s=e.split(".");if(s.length!==3)return i(new Se("jwt malformed"));let a;try{a=TM(e,{complete:!0})}catch(l){return i(l)}if(!a)return i(new Se("invalid token"));let u=a.header,c;if(typeof t=="function"){if(!n)return i(new Se("verify must be called asynchronous if secret or public key is provided as a callback"));c=t}else c=function(l,d){return d(null,t)};return c(u,function(l,d){if(l)return i(new Se("error in secret or public key callback: "+l.message));let f=s[2].trim()!=="";if(!f&&d)return i(new Se("jwt signature is required"));if(f&&!d)return i(new Se("secret or public key must be provided"));if(!f&&!r.algorithms)return i(new Se('please specify "none" in "algorithms" to verify unsigned tokens'));if(d!=null&&!(d instanceof xM))try{d=RM(d)}catch{try{d=NM(typeof d=="string"?Buffer.from(d):d)}catch{return i(new Se("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(d.type==="secret"?r.algorithms=PM:["rsa","rsa-pss"].includes(d.asymmetricKeyType)?r.algorithms=Zp:d.asymmetricKeyType==="ec"?r.algorithms=CM:r.algorithms=Xp),r.algorithms.indexOf(a.header.alg)===-1)return i(new Se("invalid algorithm"));if(u.alg.startsWith("HS")&&d.type!=="secret")return i(new Se(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&d.type!=="public")return i(new Se(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{OM(u.alg,d)}catch(v){return i(v)}let h;try{h=AM.verify(e,a.header.alg,d)}catch(v){return i(v)}if(!h)return i(new Se("invalid signature"));let g=a.payload;if(typeof g.nbf<"u"&&!r.ignoreNotBefore){if(typeof g.nbf!="number")return i(new Se("invalid nbf value"));if(g.nbf>o+(r.clockTolerance||0))return i(new SM("jwt not active",new Date(g.nbf*1e3)))}if(typeof g.exp<"u"&&!r.ignoreExpiration){if(typeof g.exp!="number")return i(new Se("invalid exp value"));if(o>=g.exp+(r.clockTolerance||0))return i(new Db("jwt expired",new Date(g.exp*1e3)))}if(r.audience){let v=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(g.aud)?g.aud:[g.aud]).some(function(b){return v.some(function(A){return A instanceof RegExp?A.test(b):A===b})}))return i(new Se("jwt audience invalid. expected: "+v.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&g.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(g.iss)===-1))return i(new Se("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&g.sub!==r.subject)return i(new Se("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&g.jti!==r.jwtid)return i(new Se("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&g.nonce!==r.nonce)return i(new Se("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof g.iat!="number")return i(new Se("iat required when maxAge is specified"));let v=IM(r.maxAge,g.iat);if(typeof v>"u")return i(new Se('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(o>=v+(r.clockTolerance||0))return i(new Db("maxAge exceeded",new Date(v*1e3)))}if(r.complete===!0){let v=a.signature;return i(null,{header:u,payload:g,signature:v})}return i(null,g)})}});var Vb=y((F7,Ub)=>{p();var jb=1/0,Fb=9007199254740991,DM=17976931348623157e292,Mb=NaN,LM="[object Arguments]",kM="[object Function]",jM="[object GeneratorFunction]",MM="[object String]",FM="[object Symbol]",qM=/^\s+|\s+$/g,UM=/^[-+]0x[0-9a-f]+$/i,VM=/^0b[01]+$/i,GM=/^0o[0-7]+$/i,BM=/^(?:0|[1-9]\d*)$/,$M=parseInt;function KM(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function HM(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function QM(e,t,r){if(t!==t)return HM(e,WM,r);for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function WM(e){return e!==e}function zM(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function YM(e,t){return KM(t,function(r){return e[r]})}function JM(e,t){return function(r){return e(t(r))}}var Za=Object.prototype,td=Za.hasOwnProperty,eu=Za.toString,XM=Za.propertyIsEnumerable,ZM=JM(Object.keys,Object),eF=Math.max;function tF(e,t){var r=qb(e)||sF(e)?zM(e.length,String):[],n=r.length,i=!!n;for(var o in e)(t||td.call(e,o))&&!(i&&(o=="length"||nF(o,n)))&&r.push(o);return r}function rF(e){if(!iF(e))return ZM(e);var t=[];for(var r in Object(e))td.call(e,r)&&r!="constructor"&&t.push(r);return t}function nF(e,t){return t=t??Fb,!!t&&(typeof e=="number"||BM.test(e))&&e>-1&&e%1==0&&e<t}function iF(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Za;return e===r}function oF(e,t,r,n){e=rd(e)?e:gF(e),r=r&&!n?fF(r):0;var i=e.length;return r<0&&(r=eF(i+r,0)),lF(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&QM(e,t,r)>-1}function sF(e){return aF(e)&&td.call(e,"callee")&&(!XM.call(e,"callee")||eu.call(e)==LM)}var qb=Array.isArray;function rd(e){return e!=null&&cF(e.length)&&!uF(e)}function aF(e){return nd(e)&&rd(e)}function uF(e){var t=ed(e)?eu.call(e):"";return t==kM||t==jM}function cF(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Fb}function ed(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function nd(e){return!!e&&typeof e=="object"}function lF(e){return typeof e=="string"||!qb(e)&&nd(e)&&eu.call(e)==MM}function pF(e){return typeof e=="symbol"||nd(e)&&eu.call(e)==FM}function dF(e){if(!e)return e===0?e:0;if(e=hF(e),e===jb||e===-jb){var t=e<0?-1:1;return t*DM}return e===e?e:0}function fF(e){var t=dF(e),r=t%1;return t===t?r?t-r:t:0}function hF(e){if(typeof e=="number")return e;if(pF(e))return Mb;if(ed(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=ed(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(qM,"");var r=VM.test(e);return r||GM.test(e)?$M(e.slice(2),r?2:8):UM.test(e)?Mb:+e}function mF(e){return rd(e)?tF(e):rF(e)}function gF(e){return e?YM(e,mF(e)):[]}Ub.exports=oF});var Bb=y((U7,Gb)=>{p();var yF="[object Boolean]",vF=Object.prototype,EF=vF.toString;function _F(e){return e===!0||e===!1||bF(e)&&EF.call(e)==yF}function bF(e){return!!e&&typeof e=="object"}Gb.exports=_F});var Wb=y((G7,Qb)=>{p();var $b=1/0,SF=17976931348623157e292,Kb=NaN,TF="[object Symbol]",IF=/^\s+|\s+$/g,OF=/^[-+]0x[0-9a-f]+$/i,wF=/^0b[01]+$/i,AF=/^0o[0-7]+$/i,xF=parseInt,NF=Object.prototype,RF=NF.toString;function CF(e){return typeof e=="number"&&e==kF(e)}function Hb(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function PF(e){return!!e&&typeof e=="object"}function DF(e){return typeof e=="symbol"||PF(e)&&RF.call(e)==TF}function LF(e){if(!e)return e===0?e:0;if(e=jF(e),e===$b||e===-$b){var t=e<0?-1:1;return t*SF}return e===e?e:0}function kF(e){var t=LF(e),r=t%1;return t===t?r?t-r:t:0}function jF(e){if(typeof e=="number")return e;if(DF(e))return Kb;if(Hb(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Hb(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(IF,"");var r=wF.test(e);return r||AF.test(e)?xF(e.slice(2),r?2:8):OF.test(e)?Kb:+e}Qb.exports=CF});var Yb=y(($7,zb)=>{p();var MF="[object Number]",FF=Object.prototype,qF=FF.toString;function UF(e){return!!e&&typeof e=="object"}function VF(e){return typeof e=="number"||UF(e)&&qF.call(e)==MF}zb.exports=VF});var eS=y((H7,Zb)=>{p();var GF="[object Object]";function BF(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function $F(e,t){return function(r){return e(t(r))}}var KF=Function.prototype,Jb=Object.prototype,Xb=KF.toString,HF=Jb.hasOwnProperty,QF=Xb.call(Object),WF=Jb.toString,zF=$F(Object.getPrototypeOf,Object);function YF(e){return!!e&&typeof e=="object"}function JF(e){if(!YF(e)||WF.call(e)!=GF||BF(e))return!1;var t=zF(e);if(t===null)return!0;var r=HF.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Xb.call(r)==QF}Zb.exports=JF});var rS=y((W7,tS)=>{p();var XF="[object String]",ZF=Object.prototype,eq=ZF.toString,tq=Array.isArray;function rq(e){return!!e&&typeof e=="object"}function nq(e){return typeof e=="string"||!tq(e)&&rq(e)&&eq.call(e)==XF}tS.exports=nq});var aS=y((Y7,sS)=>{p();var iq="Expected a function",nS=1/0,oq=17976931348623157e292,iS=NaN,sq="[object Symbol]",aq=/^\s+|\s+$/g,uq=/^[-+]0x[0-9a-f]+$/i,cq=/^0b[01]+$/i,lq=/^0o[0-7]+$/i,pq=parseInt,dq=Object.prototype,fq=dq.toString;function hq(e,t){var r;if(typeof t!="function")throw new TypeError(iq);return e=Eq(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}function mq(e){return hq(2,e)}function oS(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function gq(e){return!!e&&typeof e=="object"}function yq(e){return typeof e=="symbol"||gq(e)&&fq.call(e)==sq}function vq(e){if(!e)return e===0?e:0;if(e=_q(e),e===nS||e===-nS){var t=e<0?-1:1;return t*oq}return e===e?e:0}function Eq(e){var t=vq(e),r=t%1;return t===t?r?t-r:t:0}function _q(e){if(typeof e=="number")return e;if(yq(e))return iS;if(oS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=oS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(aq,"");var r=cq.test(e);return r||lq.test(e)?pq(e.slice(2),r?2:8):uq.test(e)?iS:+e}sS.exports=mq});var gS=y((X7,mS)=>{p();var uS=Np(),bq=Jp(),Sq=Yp(),cS=ka(),Tq=Vb(),tu=Bb(),lS=Wb(),id=Yb(),dS=eS(),Gr=rS(),Iq=aS(),{KeyObject:Oq,createSecretKey:wq,createPrivateKey:Aq}=M("crypto"),fS=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];bq&&fS.splice(3,0,"PS256","PS384","PS512");var xq={expiresIn:{isValid:function(e){return lS(e)||Gr(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return lS(e)||Gr(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return Gr(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:Tq.bind(null,fS),message:'"algorithm" must be a valid string enum value'},header:{isValid:dS,message:'"header" must be an object'},encoding:{isValid:Gr,message:'"encoding" must be a string'},issuer:{isValid:Gr,message:'"issuer" must be a string'},subject:{isValid:Gr,message:'"subject" must be a string'},jwtid:{isValid:Gr,message:'"jwtid" must be a string'},noTimestamp:{isValid:tu,message:'"noTimestamp" must be a boolean'},keyid:{isValid:Gr,message:'"keyid" must be a string'},mutatePayload:{isValid:tu,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:tu,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:tu,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},Nq={iat:{isValid:id,message:'"iat" should be a number of seconds'},exp:{isValid:id,message:'"exp" should be a number of seconds'},nbf:{isValid:id,message:'"nbf" should be a number of seconds'}};function hS(e,t,r,n){if(!dS(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let o=e[i];if(!o){if(!t)throw new Error('"'+i+'" is not allowed in "'+n+'"');return}if(!o.isValid(r[i]))throw new Error(o.message)})}function Rq(e){return hS(xq,!1,e,"options")}function Cq(e){return hS(Nq,!0,e,"payload")}var pS={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},Pq=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];mS.exports=function(e,t,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let i=typeof e=="object"&&!Buffer.isBuffer(e),o=Object.assign({alg:r.algorithm||"HS256",typ:i?"JWT":void 0,kid:r.keyid},r.header);function s(c){if(n)return n(c);throw c}if(!t&&r.algorithm!=="none")return s(new Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof Oq))try{t=Aq(t)}catch{try{t=wq(typeof t=="string"?Buffer.from(t):t)}catch{return s(new Error("secretOrPrivateKey is not valid key material"))}}if(o.alg.startsWith("HS")&&t.type!=="secret")return s(new Error(`secretOrPrivateKey must be a symmetric key when using ${o.alg}`));if(/^(?:RS|PS|ES)/.test(o.alg)){if(t.type!=="private")return s(new Error(`secretOrPrivateKey must be an asymmetric key when using ${o.alg}`));if(!r.allowInsecureKeySizes&&!o.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return s(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`))}if(typeof e>"u")return s(new Error("payload is required"));if(i){try{Cq(e)}catch(c){return s(c)}r.mutatePayload||(e=Object.assign({},e))}else{let c=Pq.filter(function(l){return typeof r[l]<"u"});if(c.length>0)return s(new Error("invalid "+c.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return s(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return s(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{Rq(r)}catch(c){return s(c)}if(!r.allowInvalidAsymmetricKeyTypes)try{Sq(o.alg,t)}catch(c){return s(c)}let a=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:i&&(e.iat=a),typeof r.notBefore<"u"){try{e.nbf=uS(r.notBefore,a)}catch(c){return s(c)}if(typeof e.nbf>"u")return s(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof e=="object"){try{e.exp=uS(r.expiresIn,a)}catch(c){return s(c)}if(typeof e.exp>"u")return s(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(pS).forEach(function(c){let l=pS[c];if(typeof r[c]<"u"){if(typeof e[l]<"u")return s(new Error('Bad "options.'+c+'" option. The payload already has an "'+l+'" property.'));e[l]=r[c]}});let u=r.encoding||"utf8";if(typeof n=="function")n=n&&Iq(n),cS.createSign({header:o,privateKey:t,payload:e,encoding:u}).once("error",n).once("done",function(c){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&c.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`));n(null,c)});else{let c=cS.sign({header:o,payload:e,secret:t,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&c.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`);return c}}});var Uo=y((eee,yS)=>{p();yS.exports={decode:wp(),verify:kb(),sign:gS(),JsonWebTokenError:Lo(),NotBeforeError:Ap(),TokenExpiredError:xp()}});var TS=y(vi=>{"use strict";p();Object.defineProperty(vi,"__esModule",{value:!0});vi.versionInfo=vi.version=void 0;var Mq="15.10.2";vi.version=Mq;var Fq=Object.freeze({major:15,minor:10,patch:2,preReleaseTag:null});vi.versionInfo=Fq});var iu=y(ad=>{"use strict";p();Object.defineProperty(ad,"__esModule",{value:!0});ad.default=qq;function qq(e){return typeof e?.then=="function"}});var jt=y(ud=>{"use strict";p();Object.defineProperty(ud,"__esModule",{value:!0});ud.default=Uq;function Uq(e,t){var r=!!e;if(!r)throw new Error(t)}});var ar=y(cd=>{"use strict";p();Object.defineProperty(cd,"__esModule",{value:!0});cd.default=Vq;function ou(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ou=function(r){return typeof r}:ou=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ou(e)}function Vq(e){return ou(e)=="object"&&e!==null}});var ur=y($r=>{"use strict";p();Object.defineProperty($r,"__esModule",{value:!0});$r.SYMBOL_TO_STRING_TAG=$r.SYMBOL_ASYNC_ITERATOR=$r.SYMBOL_ITERATOR=void 0;var Gq=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator";$r.SYMBOL_ITERATOR=Gq;var Bq=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator";$r.SYMBOL_ASYNC_ITERATOR=Bq;var $q=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";$r.SYMBOL_TO_STRING_TAG=$q});var su=y(ld=>{"use strict";p();Object.defineProperty(ld,"__esModule",{value:!0});ld.getLocation=Kq;function Kq(e,t){for(var r=/\r\n|[\n\r]/g,n=1,i=t+1,o;(o=r.exec(e.body))&&o.index<t;)n+=1,i=t+1-(o.index+o[0].length);return{line:n,column:i}}});var pd=y(uu=>{"use strict";p();Object.defineProperty(uu,"__esModule",{value:!0});uu.printLocation=Qq;uu.printSourceLocation=OS;var Hq=su();function Qq(e){return OS(e.source,(0,Hq.getLocation)(e.source,e.start))}function OS(e,t){var r=e.locationOffset.column-1,n=au(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?r:0,u=t.column+a,c="".concat(e.name,":").concat(s,":").concat(u,`
|
|
31
|
-
`),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var f=Math.floor(u/80),h=u%80,g=[],v=0;v<d.length;v+=80)g.push(d.slice(v,v+80));return c+
|
|
32
|
-
`)}function
|
|
30
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Do="secret must be a string or buffer",pi="key must be a string or a buffer",UD="key must be a string, a buffer or an object",Ip=typeof Dt.createPublicKey=="function";Ip&&(pi+=" or a KeyObject",Do+="or a KeyObject");function uE(e){if(!di.isBuffer(e)&&typeof e!="string"&&(!Ip||typeof e!="object"||typeof e.type!="string"||typeof e.asymmetricKeyType!="string"||typeof e.export!="function"))throw Qt(pi)}function cE(e){if(!di.isBuffer(e)&&typeof e!="string"&&typeof e!="object")throw Qt(UD)}function VD(e){if(!di.isBuffer(e)){if(typeof e=="string")return e;if(!Ip||typeof e!="object"||e.type!=="secret"||typeof e.export!="function")throw Qt(Do)}}function wp(e){return e.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function lE(e){e=e.toString();var t=4-e.length%4;if(t!==4)for(var r=0;r<t;++r)e+="=";return e.replace(/\-/g,"+").replace(/_/g,"/")}function Qt(e){var t=[].slice.call(arguments,1),r=sE.format.bind(sE,e).apply(null,t);return new TypeError(r)}function GD(e){return di.isBuffer(e)||typeof e=="string"}function Lo(e){return GD(e)||(e=JSON.stringify(e)),e}function pE(e){return function(r,n){VD(n),r=Lo(r);var i=Dt.createHmac("sha"+e,n),o=(i.update(r),i.digest("base64"));return wp(o)}}var Tp,$D="timingSafeEqual"in Dt?function(t,r){return t.byteLength!==r.byteLength?!1:Dt.timingSafeEqual(t,r)}:function(t,r){return Tp||(Tp=oE()),Tp(t,r)};function BD(e){return function(r,n,i){var o=pE(e)(r,i);return $D(di.from(n),di.from(o))}}function dE(e){return function(r,n){cE(n),r=Lo(r);var i=Dt.createSign("RSA-SHA"+e),o=(i.update(r),i.sign(n,"base64"));return wp(o)}}function fE(e){return function(r,n,i){uE(i),r=Lo(r),n=lE(n);var o=Dt.createVerify("RSA-SHA"+e);return o.update(r),o.verify(i,n,"base64")}}function KD(e){return function(r,n){cE(n),r=Lo(r);var i=Dt.createSign("RSA-SHA"+e),o=(i.update(r),i.sign({key:n,padding:Dt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Dt.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return wp(o)}}function HD(e){return function(r,n,i){uE(i),r=Lo(r),n=lE(n);var o=Dt.createVerify("RSA-SHA"+e);return o.update(r),o.verify({key:i,padding:Dt.constants.RSA_PKCS1_PSS_PADDING,saltLength:Dt.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function QD(e){var t=dE(e);return function(){var n=t.apply(null,arguments);return n=aE.derToJose(n,"ES"+e),n}}function WD(e){var t=fE(e);return function(n,i,o){i=aE.joseToDer(i,"ES"+e).toString("base64");var s=t(n,i,o);return s}}function zD(){return function(){return""}}function YD(){return function(t,r){return r===""}}hE.exports=function(t){var r={hs:pE,rs:dE,ps:KD,es:QD,none:zD},n={hs:BD,rs:fE,ps:HD,es:WD,none:YD},i=t.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Qt(qD,t);var o=(i[1]||i[3]).toLowerCase(),s=i[2];return{sign:r[o](s),verify:n[o](s)}}});var Ap=y((LZ,mE)=>{p();var JD=M("buffer").Buffer;mE.exports=function(t){return typeof t=="string"?t:typeof t=="number"||JD.isBuffer(t)?t.toString():JSON.stringify(t)}});var bE=y((jZ,_E)=>{p();var XD=li().Buffer,gE=_p(),ZD=Op(),eL=M("stream"),yE=Ap(),xp=M("util");function vE(e,t){return XD.from(e,t).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function tL(e,t,r){r=r||"utf8";var n=vE(yE(e),"binary"),i=vE(yE(t),r);return xp.format("%s.%s",n,i)}function EE(e){var t=e.header,r=e.payload,n=e.secret||e.privateKey,i=e.encoding,o=ZD(t.alg),s=tL(t,r,i),a=o.sign(s,n);return xp.format("%s.%s",s,a)}function ka(e){var t=e.secret;if(t=t??e.privateKey,t=t??e.key,/^hs/i.test(e.header.alg)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new gE(t);this.readable=!0,this.header=e.header,this.encoding=e.encoding,this.secret=this.privateKey=this.key=r,this.payload=new gE(e.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}xp.inherits(ka,eL);ka.prototype.sign=function(){try{var t=EE({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",t),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(r){this.readable=!1,this.emit("error",r),this.emit("close")}};ka.sign=EE;_E.exports=ka});var CE=y((FZ,RE)=>{p();var TE=li().Buffer,SE=_p(),rL=Op(),nL=M("stream"),IE=Ap(),iL=M("util"),oL=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function sL(e){return Object.prototype.toString.call(e)==="[object Object]"}function aL(e){if(sL(e))return e;try{return JSON.parse(e)}catch{return}}function wE(e){var t=e.split(".",1)[0];return aL(TE.from(t,"base64").toString("binary"))}function uL(e){return e.split(".",2).join(".")}function OE(e){return e.split(".")[2]}function cL(e,t){t=t||"utf8";var r=e.split(".")[1];return TE.from(r,"base64").toString(t)}function AE(e){return oL.test(e)&&!!wE(e)}function xE(e,t,r){if(!t){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}e=IE(e);var i=OE(e),o=uL(e),s=rL(t);return s.verify(o,i,r)}function NE(e,t){if(t=t||{},e=IE(e),!AE(e))return null;var r=wE(e);if(!r)return null;var n=cL(e);return(r.typ==="JWT"||t.json)&&(n=JSON.parse(n,t.encoding)),{header:r,payload:n,signature:OE(e)}}function fi(e){e=e||{};var t=e.secret;if(t=t??e.publicKey,t=t??e.key,/^hs/i.test(e.algorithm)===!0&&t==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var r=new SE(t);this.readable=!0,this.algorithm=e.algorithm,this.encoding=e.encoding,this.secret=this.publicKey=this.key=r,this.signature=new SE(e.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}iL.inherits(fi,nL);fi.prototype.verify=function(){try{var t=xE(this.signature.buffer,this.algorithm,this.key.buffer),r=NE(this.signature.buffer,this.encoding);return this.emit("done",t,r),this.emit("data",t),this.emit("end"),this.readable=!1,t}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};fi.decode=NE;fi.isValid=AE;fi.verify=xE;RE.exports=fi});var Ma=y(Ur=>{p();var PE=bE(),ja=CE(),lL=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Ur.ALGORITHMS=lL;Ur.sign=PE.sign;Ur.verify=ja.verify;Ur.decode=ja.decode;Ur.isValid=ja.isValid;Ur.createSign=function(t){return new PE(t)};Ur.createVerify=function(t){return new ja(t)}});var Np=y((GZ,DE)=>{p();var pL=Ma();DE.exports=function(e,t){t=t||{};var r=pL.decode(e,t);if(!r)return null;var n=r.payload;if(typeof n=="string")try{var i=JSON.parse(n);i!==null&&typeof i=="object"&&(n=i)}catch{}return t.complete===!0?{header:r.header,payload:n,signature:r.signature}:n}});var ko=y((BZ,LE)=>{p();var Fa=function(e,t){Error.call(this,e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="JsonWebTokenError",this.message=e,t&&(this.inner=t)};Fa.prototype=Object.create(Error.prototype);Fa.prototype.constructor=Fa;LE.exports=Fa});var Rp=y((HZ,jE)=>{p();var kE=ko(),qa=function(e,t){kE.call(this,e),this.name="NotBeforeError",this.date=t};qa.prototype=Object.create(kE.prototype);qa.prototype.constructor=qa;jE.exports=qa});var Cp=y((WZ,FE)=>{p();var ME=ko(),Ua=function(e,t){ME.call(this,e),this.name="TokenExpiredError",this.expiredAt=t};Ua.prototype=Object.create(ME.prototype);Ua.prototype.constructor=Ua;FE.exports=Ua});var UE=y((YZ,qE)=>{p();var hi=1e3,mi=hi*60,gi=mi*60,Tn=gi*24,dL=Tn*7,fL=Tn*365.25;qE.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return hL(e);if(r==="number"&&isFinite(e))return t.long?gL(e):mL(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function hL(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*fL;case"weeks":case"week":case"w":return r*dL;case"days":case"day":case"d":return r*Tn;case"hours":case"hour":case"hrs":case"hr":case"h":return r*gi;case"minutes":case"minute":case"mins":case"min":case"m":return r*mi;case"seconds":case"second":case"secs":case"sec":case"s":return r*hi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function mL(e){var t=Math.abs(e);return t>=Tn?Math.round(e/Tn)+"d":t>=gi?Math.round(e/gi)+"h":t>=mi?Math.round(e/mi)+"m":t>=hi?Math.round(e/hi)+"s":e+"ms"}function gL(e){var t=Math.abs(e);return t>=Tn?Va(e,t,Tn,"day"):t>=gi?Va(e,t,gi,"hour"):t>=mi?Va(e,t,mi,"minute"):t>=hi?Va(e,t,hi,"second"):e+" ms"}function Va(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Pp=y((XZ,VE)=>{p();var yL=UE();VE.exports=function(e,t){var r=t||Math.floor(Date.now()/1e3);if(typeof e=="string"){var n=yL(e);return typeof n>"u"?void 0:Math.floor(r+n/1e3)}else return typeof e=="number"?r+e:void 0}});var yi=y((e9,GE)=>{"use strict";p();var vL="2.0.0",EL=Number.MAX_SAFE_INTEGER||9007199254740991,_L=16,bL=250,SL=["major","premajor","minor","preminor","patch","prepatch","prerelease"];GE.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:_L,MAX_SAFE_BUILD_LENGTH:bL,MAX_SAFE_INTEGER:EL,RELEASE_TYPES:SL,SEMVER_SPEC_VERSION:vL,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var jo=y((r9,$E)=>{"use strict";p();var TL=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};$E.exports=TL});var vi=y((sr,BE)=>{"use strict";p();var{MAX_SAFE_COMPONENT_LENGTH:Dp,MAX_SAFE_BUILD_LENGTH:IL,MAX_LENGTH:wL}=yi(),OL=jo();sr=BE.exports={};var AL=sr.re=[],xL=sr.safeRe=[],k=sr.src=[],NL=sr.safeSrc=[],j=sr.t={},RL=0,Lp="[a-zA-Z0-9-]",CL=[["\\s",1],["\\d",wL],[Lp,IL]],PL=e=>{for(let[t,r]of CL)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},z=(e,t,r)=>{let n=PL(t),i=RL++;OL(e,i,t),j[e]=i,k[i]=t,NL[i]=n,AL[i]=new RegExp(t,r?"g":void 0),xL[i]=new RegExp(n,r?"g":void 0)};z("NUMERICIDENTIFIER","0|[1-9]\\d*");z("NUMERICIDENTIFIERLOOSE","\\d+");z("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Lp}*`);z("MAINVERSION",`(${k[j.NUMERICIDENTIFIER]})\\.(${k[j.NUMERICIDENTIFIER]})\\.(${k[j.NUMERICIDENTIFIER]})`);z("MAINVERSIONLOOSE",`(${k[j.NUMERICIDENTIFIERLOOSE]})\\.(${k[j.NUMERICIDENTIFIERLOOSE]})\\.(${k[j.NUMERICIDENTIFIERLOOSE]})`);z("PRERELEASEIDENTIFIER",`(?:${k[j.NONNUMERICIDENTIFIER]}|${k[j.NUMERICIDENTIFIER]})`);z("PRERELEASEIDENTIFIERLOOSE",`(?:${k[j.NONNUMERICIDENTIFIER]}|${k[j.NUMERICIDENTIFIERLOOSE]})`);z("PRERELEASE",`(?:-(${k[j.PRERELEASEIDENTIFIER]}(?:\\.${k[j.PRERELEASEIDENTIFIER]})*))`);z("PRERELEASELOOSE",`(?:-?(${k[j.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${k[j.PRERELEASEIDENTIFIERLOOSE]})*))`);z("BUILDIDENTIFIER",`${Lp}+`);z("BUILD",`(?:\\+(${k[j.BUILDIDENTIFIER]}(?:\\.${k[j.BUILDIDENTIFIER]})*))`);z("FULLPLAIN",`v?${k[j.MAINVERSION]}${k[j.PRERELEASE]}?${k[j.BUILD]}?`);z("FULL",`^${k[j.FULLPLAIN]}$`);z("LOOSEPLAIN",`[v=\\s]*${k[j.MAINVERSIONLOOSE]}${k[j.PRERELEASELOOSE]}?${k[j.BUILD]}?`);z("LOOSE",`^${k[j.LOOSEPLAIN]}$`);z("GTLT","((?:<|>)?=?)");z("XRANGEIDENTIFIERLOOSE",`${k[j.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);z("XRANGEIDENTIFIER",`${k[j.NUMERICIDENTIFIER]}|x|X|\\*`);z("XRANGEPLAIN",`[v=\\s]*(${k[j.XRANGEIDENTIFIER]})(?:\\.(${k[j.XRANGEIDENTIFIER]})(?:\\.(${k[j.XRANGEIDENTIFIER]})(?:${k[j.PRERELEASE]})?${k[j.BUILD]}?)?)?`);z("XRANGEPLAINLOOSE",`[v=\\s]*(${k[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${k[j.XRANGEIDENTIFIERLOOSE]})(?:\\.(${k[j.XRANGEIDENTIFIERLOOSE]})(?:${k[j.PRERELEASELOOSE]})?${k[j.BUILD]}?)?)?`);z("XRANGE",`^${k[j.GTLT]}\\s*${k[j.XRANGEPLAIN]}$`);z("XRANGELOOSE",`^${k[j.GTLT]}\\s*${k[j.XRANGEPLAINLOOSE]}$`);z("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Dp}})(?:\\.(\\d{1,${Dp}}))?(?:\\.(\\d{1,${Dp}}))?`);z("COERCE",`${k[j.COERCEPLAIN]}(?:$|[^\\d])`);z("COERCEFULL",k[j.COERCEPLAIN]+`(?:${k[j.PRERELEASE]})?(?:${k[j.BUILD]})?(?:$|[^\\d])`);z("COERCERTL",k[j.COERCE],!0);z("COERCERTLFULL",k[j.COERCEFULL],!0);z("LONETILDE","(?:~>?)");z("TILDETRIM",`(\\s*)${k[j.LONETILDE]}\\s+`,!0);sr.tildeTrimReplace="$1~";z("TILDE",`^${k[j.LONETILDE]}${k[j.XRANGEPLAIN]}$`);z("TILDELOOSE",`^${k[j.LONETILDE]}${k[j.XRANGEPLAINLOOSE]}$`);z("LONECARET","(?:\\^)");z("CARETTRIM",`(\\s*)${k[j.LONECARET]}\\s+`,!0);sr.caretTrimReplace="$1^";z("CARET",`^${k[j.LONECARET]}${k[j.XRANGEPLAIN]}$`);z("CARETLOOSE",`^${k[j.LONECARET]}${k[j.XRANGEPLAINLOOSE]}$`);z("COMPARATORLOOSE",`^${k[j.GTLT]}\\s*(${k[j.LOOSEPLAIN]})$|^$`);z("COMPARATOR",`^${k[j.GTLT]}\\s*(${k[j.FULLPLAIN]})$|^$`);z("COMPARATORTRIM",`(\\s*)${k[j.GTLT]}\\s*(${k[j.LOOSEPLAIN]}|${k[j.XRANGEPLAIN]})`,!0);sr.comparatorTrimReplace="$1$2$3";z("HYPHENRANGE",`^\\s*(${k[j.XRANGEPLAIN]})\\s+-\\s+(${k[j.XRANGEPLAIN]})\\s*$`);z("HYPHENRANGELOOSE",`^\\s*(${k[j.XRANGEPLAINLOOSE]})\\s+-\\s+(${k[j.XRANGEPLAINLOOSE]})\\s*$`);z("STAR","(<|>)?=?\\s*\\*");z("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");z("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Ga=y((o9,KE)=>{"use strict";p();var DL=Object.freeze({loose:!0}),LL=Object.freeze({}),kL=e=>e?typeof e!="object"?DL:e:LL;KE.exports=kL});var kp=y((a9,WE)=>{"use strict";p();var HE=/^[0-9]+$/,QE=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:e<t?-1:1;let r=HE.test(e),n=HE.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},jL=(e,t)=>QE(t,e);WE.exports={compareIdentifiers:QE,rcompareIdentifiers:jL}});var Je=y((c9,YE)=>{"use strict";p();var $a=jo(),{MAX_LENGTH:zE,MAX_SAFE_INTEGER:Ba}=yi(),{safeRe:Ka,t:Ha}=vi(),ML=Ga(),{compareIdentifiers:jp}=kp(),Mp=class e{constructor(t,r){if(r=ML(r),t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>zE)throw new TypeError(`version is longer than ${zE} characters`);$a("SemVer",t,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=t.trim().match(r.loose?Ka[Ha.LOOSE]:Ka[Ha.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>Ba||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Ba||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Ba||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<Ba)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if($a("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),this.major<t.major?-1:this.major>t.major?1:this.minor<t.minor?-1:this.minor>t.minor?1:this.patch<t.patch?-1:this.patch>t.patch?1:0}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=t.prerelease[r];if($a("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return jp(n,i)}while(++r)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let r=0;do{let n=this.build[r],i=t.build[r];if($a("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return jp(n,i)}while(++r)}inc(t,r,n){if(t.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?Ka[Ha.PRERELEASELOOSE]:Ka[Ha.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),jp(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};YE.exports=Mp});var Vr=y((p9,XE)=>{"use strict";p();var JE=Je(),FL=(e,t,r=!1)=>{if(e instanceof JE)return e;try{return new JE(e,t)}catch(n){if(!r)return null;throw n}};XE.exports=FL});var e_=y((f9,ZE)=>{"use strict";p();var qL=Vr(),UL=(e,t)=>{let r=qL(e,t);return r?r.version:null};ZE.exports=UL});var r_=y((m9,t_)=>{"use strict";p();var VL=Vr(),GL=(e,t)=>{let r=VL(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};t_.exports=GL});var o_=y((y9,i_)=>{"use strict";p();var n_=Je(),$L=(e,t,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new n_(e instanceof n_?e.version:e,r).inc(t,n,i).version}catch{return null}};i_.exports=$L});var u_=y((E9,a_)=>{"use strict";p();var s_=Vr(),BL=(e,t)=>{let r=s_(e,null,!0),n=s_(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,u=!!s.prerelease.length;if(!!a.prerelease.length&&!u){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"};a_.exports=BL});var l_=y((b9,c_)=>{"use strict";p();var KL=Je(),HL=(e,t)=>new KL(e,t).major;c_.exports=HL});var d_=y((T9,p_)=>{"use strict";p();var QL=Je(),WL=(e,t)=>new QL(e,t).minor;p_.exports=WL});var h_=y((w9,f_)=>{"use strict";p();var zL=Je(),YL=(e,t)=>new zL(e,t).patch;f_.exports=YL});var g_=y((A9,m_)=>{"use strict";p();var JL=Vr(),XL=(e,t)=>{let r=JL(e,t);return r&&r.prerelease.length?r.prerelease:null};m_.exports=XL});var Lt=y((N9,v_)=>{"use strict";p();var y_=Je(),ZL=(e,t,r)=>new y_(e,r).compare(new y_(t,r));v_.exports=ZL});var __=y((C9,E_)=>{"use strict";p();var ek=Lt(),tk=(e,t,r)=>ek(t,e,r);E_.exports=tk});var S_=y((D9,b_)=>{"use strict";p();var rk=Lt(),nk=(e,t)=>rk(e,t,!0);b_.exports=nk});var Qa=y((k9,I_)=>{"use strict";p();var T_=Je(),ik=(e,t,r)=>{let n=new T_(e,r),i=new T_(t,r);return n.compare(i)||n.compareBuild(i)};I_.exports=ik});var O_=y((M9,w_)=>{"use strict";p();var ok=Qa(),sk=(e,t)=>e.sort((r,n)=>ok(r,n,t));w_.exports=sk});var x_=y((q9,A_)=>{"use strict";p();var ak=Qa(),uk=(e,t)=>e.sort((r,n)=>ak(n,r,t));A_.exports=uk});var Mo=y((V9,N_)=>{"use strict";p();var ck=Lt(),lk=(e,t,r)=>ck(e,t,r)>0;N_.exports=lk});var Wa=y(($9,R_)=>{"use strict";p();var pk=Lt(),dk=(e,t,r)=>pk(e,t,r)<0;R_.exports=dk});var Fp=y((K9,C_)=>{"use strict";p();var fk=Lt(),hk=(e,t,r)=>fk(e,t,r)===0;C_.exports=hk});var qp=y((Q9,P_)=>{"use strict";p();var mk=Lt(),gk=(e,t,r)=>mk(e,t,r)!==0;P_.exports=gk});var za=y((z9,D_)=>{"use strict";p();var yk=Lt(),vk=(e,t,r)=>yk(e,t,r)>=0;D_.exports=vk});var Ya=y((J9,L_)=>{"use strict";p();var Ek=Lt(),_k=(e,t,r)=>Ek(e,t,r)<=0;L_.exports=_k});var Up=y((Z9,k_)=>{"use strict";p();var bk=Fp(),Sk=qp(),Tk=Mo(),Ik=za(),wk=Wa(),Ok=Ya(),Ak=(e,t,r,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e===r;case"!==":return typeof e=="object"&&(e=e.version),typeof r=="object"&&(r=r.version),e!==r;case"":case"=":case"==":return bk(e,r,n);case"!=":return Sk(e,r,n);case">":return Tk(e,r,n);case">=":return Ik(e,r,n);case"<":return wk(e,r,n);case"<=":return Ok(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}};k_.exports=Ak});var M_=y((t7,j_)=>{"use strict";p();var xk=Je(),Nk=Vr(),{safeRe:Ja,t:Xa}=vi(),Rk=(e,t)=>{if(e instanceof xk)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?Ja[Xa.COERCEFULL]:Ja[Xa.COERCE]);else{let u=t.includePrerelease?Ja[Xa.COERCERTLFULL]:Ja[Xa.COERCERTL],c;for(;(c=u.exec(e))&&(!r||r.index+r[0].length!==e.length);)(!r||c.index+c[0].length!==r.index+r[0].length)&&(r=c),u.lastIndex=c.index+c[1].length+c[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Nk(`${n}.${i}.${o}${s}${a}`,t)};j_.exports=Rk});var q_=y((n7,F_)=>{"use strict";p();var Ck=Vr(),Pk=yi(),Dk=Je(),Lk=(e,t,r)=>{if(!Pk.RELEASE_TYPES.includes(t))return null;let n=kk(e,r);return n&&jk(n,t)},kk=(e,t)=>{let r=e instanceof Dk?e.version:e;return Ck(r,t)},jk=(e,t)=>{if(Mk(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},Mk=e=>e.startsWith("pre");F_.exports=Lk});var V_=y((o7,U_)=>{"use strict";p();var Vp=class{constructor(){this.max=1e3,this.map=new Map}get(t){let r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}delete(t){return this.map.delete(t)}set(t,r){if(!this.delete(t)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(t,r)}return this}};U_.exports=Vp});var kt=y((a7,K_)=>{"use strict";p();var Fk=/\s+/g,Gp=class e{constructor(t,r){if(r=Uk(r),t instanceof e)return t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease?t:new e(t.raw,r);if(t instanceof $p)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=t.trim().replace(Fk," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!$_(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&zk(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let r=this.set[t];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){t=t.replace(Wk,"");let n=((this.options.includePrerelease&&Hk)|(this.options.loose&&Qk))+":"+t,i=G_.get(n);if(i)return i;let o=this.options.loose,s=o?ut[Xe.HYPHENRANGELOOSE]:ut[Xe.HYPHENRANGE];t=t.replace(s,oj(this.options.includePrerelease)),Te("hyphen replace",t),t=t.replace(ut[Xe.COMPARATORTRIM],$k),Te("comparator trim",t),t=t.replace(ut[Xe.TILDETRIM],Bk),Te("tilde trim",t),t=t.replace(ut[Xe.CARETTRIM],Kk),Te("caret trim",t);let a=t.split(" ").map(d=>Yk(d,this.options)).join(" ").split(/\s+/).map(d=>ij(d,this.options));o&&(a=a.filter(d=>(Te("loose invalid filter",d,this.options),!!d.match(ut[Xe.COMPARATORLOOSE])))),Te("range list",a);let u=new Map,c=a.map(d=>new $p(d,this.options));for(let d of c){if($_(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let l=[...u.values()];return G_.set(n,l),l}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(n=>B_(n,r)&&t.set.some(i=>B_(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new Vk(t,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(sj(this.set[r],t,this.options))return!0;return!1}};K_.exports=Gp;var qk=V_(),G_=new qk,Uk=Ga(),$p=Fo(),Te=jo(),Vk=Je(),{safeRe:ut,src:Gk,t:Xe,comparatorTrimReplace:$k,tildeTrimReplace:Bk,caretTrimReplace:Kk}=vi(),{FLAG_INCLUDE_PRERELEASE:Hk,FLAG_LOOSE:Qk}=yi(),Wk=new RegExp(Gk[Xe.BUILD],"g"),$_=e=>e.value==="<0.0.0-0",zk=e=>e.value==="",B_=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,t)),i=n.pop();return r},Yk=(e,t)=>(e=e.replace(ut[Xe.BUILD],""),Te("comp",e,t),e=Zk(e,t),Te("caret",e),e=Jk(e,t),Te("tildes",e),e=tj(e,t),Te("xrange",e),e=nj(e,t),Te("stars",e),e),ct=e=>!e||e.toLowerCase()==="x"||e==="*",Jk=(e,t)=>e.trim().split(/\s+/).map(r=>Xk(r,t)).join(" "),Xk=(e,t)=>{let r=t.loose?ut[Xe.TILDELOOSE]:ut[Xe.TILDE];return e.replace(r,(n,i,o,s,a)=>{Te("tilde",e,n,i,o,s,a);let u;return ct(i)?u="":ct(o)?u=`>=${i}.0.0 <${+i+1}.0.0-0`:ct(s)?u=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(Te("replaceTilde pr",a),u=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):u=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,Te("tilde return",u),u})},Zk=(e,t)=>e.trim().split(/\s+/).map(r=>ej(r,t)).join(" "),ej=(e,t)=>{Te("caret",e,t);let r=t.loose?ut[Xe.CARETLOOSE]:ut[Xe.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,u)=>{Te("caret",e,i,o,s,a,u);let c;return ct(o)?c="":ct(s)?c=`>=${o}.0.0${n} <${+o+1}.0.0-0`:ct(a)?o==="0"?c=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:u?(Te("replaceCaret pr",u),o==="0"?s==="0"?c=`>=${o}.${s}.${a}-${u} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}-${u} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a}-${u} <${+o+1}.0.0-0`):(Te("no pr"),o==="0"?s==="0"?c=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:c=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:c=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),Te("caret return",c),c})},tj=(e,t)=>(Te("replaceXRanges",e,t),e.split(/\s+/).map(r=>rj(r,t)).join(" ")),rj=(e,t)=>{e=e.trim();let r=t.loose?ut[Xe.XRANGELOOSE]:ut[Xe.XRANGE];return e.replace(r,(n,i,o,s,a,u)=>{Te("xRange",e,n,i,o,s,a,u);let c=ct(o),l=c||ct(s),d=l||ct(a),f=d;return i==="="&&f&&(i=""),u=t.includePrerelease?"-0":"",c?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&f?(l&&(s=0),a=0,i===">"?(i=">=",l?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",l?o=+o+1:s=+s+1),i==="<"&&(u="-0"),n=`${i+o}.${s}.${a}${u}`):l?n=`>=${o}.0.0${u} <${+o+1}.0.0-0`:d&&(n=`>=${o}.${s}.0${u} <${o}.${+s+1}.0-0`),Te("xRange return",n),n})},nj=(e,t)=>(Te("replaceStars",e,t),e.trim().replace(ut[Xe.STAR],"")),ij=(e,t)=>(Te("replaceGTE0",e,t),e.trim().replace(ut[t.includePrerelease?Xe.GTE0PRE:Xe.GTE0],"")),oj=e=>(t,r,n,i,o,s,a,u,c,l,d,f)=>(ct(n)?r="":ct(i)?r=`>=${n}.0.0${e?"-0":""}`:ct(o)?r=`>=${n}.${i}.0${e?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${e?"-0":""}`,ct(c)?u="":ct(l)?u=`<${+c+1}.0.0-0`:ct(d)?u=`<${c}.${+l+1}.0-0`:f?u=`<=${c}.${l}.${d}-${f}`:e?u=`<${c}.${l}.${+d+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),sj=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++)if(Te(e[n].semver),e[n].semver!==$p.ANY&&e[n].semver.prerelease.length>0){let i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}});var Fo=y((c7,J_)=>{"use strict";p();var qo=Symbol("SemVer ANY"),Hp=class e{static get ANY(){return qo}constructor(t,r){if(r=H_(r),t instanceof e){if(t.loose===!!r.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),Kp("comparator",t,r),this.options=r,this.loose=!!r.loose,this.parse(t),this.semver===qo?this.value="":this.value=this.operator+this.semver.version,Kp("comp",this)}parse(t){let r=this.options.loose?Q_[W_.COMPARATORLOOSE]:Q_[W_.COMPARATOR],n=t.match(r);if(!n)throw new TypeError(`Invalid comparator: ${t}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new z_(n[2],this.options.loose):this.semver=qo}toString(){return this.value}test(t){if(Kp("Comparator.test",t,this.options.loose),this.semver===qo||t===qo)return!0;if(typeof t=="string")try{t=new z_(t,this.options)}catch{return!1}return Bp(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Y_(t.value,r).test(this.value):t.operator===""?t.value===""?!0:new Y_(this.value,r).test(t.semver):(r=H_(r),r.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||Bp(this.semver,"<",t.semver,r)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||Bp(this.semver,">",t.semver,r)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};J_.exports=Hp;var H_=Ga(),{safeRe:Q_,t:W_}=vi(),Bp=Up(),Kp=jo(),z_=Je(),Y_=kt()});var Uo=y((p7,X_)=>{"use strict";p();var aj=kt(),uj=(e,t,r)=>{try{t=new aj(t,r)}catch{return!1}return t.test(e)};X_.exports=uj});var eb=y((f7,Z_)=>{"use strict";p();var cj=kt(),lj=(e,t)=>new cj(e,t).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));Z_.exports=lj});var rb=y((m7,tb)=>{"use strict";p();var pj=Je(),dj=kt(),fj=(e,t,r)=>{let n=null,i=null,o=null;try{o=new dj(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new pj(n,r))}),n};tb.exports=fj});var ib=y((y7,nb)=>{"use strict";p();var hj=Je(),mj=kt(),gj=(e,t,r)=>{let n=null,i=null,o=null;try{o=new mj(t,r)}catch{return null}return e.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new hj(n,r))}),n};nb.exports=gj});var ab=y((E7,sb)=>{"use strict";p();var Qp=Je(),yj=kt(),ob=Mo(),vj=(e,t)=>{e=new yj(e,t);let r=new Qp("0.0.0");if(e.test(r)||(r=new Qp("0.0.0-0"),e.test(r)))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;i.forEach(s=>{let a=new Qp(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||ob(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||ob(r,o))&&(r=o)}return r&&e.test(r)?r:null};sb.exports=vj});var cb=y((b7,ub)=>{"use strict";p();var Ej=kt(),_j=(e,t)=>{try{return new Ej(e,t).range||"*"}catch{return null}};ub.exports=_j});var Za=y((T7,fb)=>{"use strict";p();var bj=Je(),db=Fo(),{ANY:Sj}=db,Tj=kt(),Ij=Uo(),lb=Mo(),pb=Wa(),wj=Ya(),Oj=za(),Aj=(e,t,r,n)=>{e=new bj(e,n),t=new Tj(t,n);let i,o,s,a,u;switch(r){case">":i=lb,o=wj,s=pb,a=">",u=">=";break;case"<":i=pb,o=Oj,s=lb,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ij(e,t,n))return!1;for(let c=0;c<t.set.length;++c){let l=t.set[c],d=null,f=null;if(l.forEach(h=>{h.semver===Sj&&(h=new db(">=0.0.0")),d=d||h,f=f||h,i(h.semver,d.semver,n)?d=h:s(h.semver,f.semver,n)&&(f=h)}),d.operator===a||d.operator===u||(!f.operator||f.operator===a)&&o(e,f.semver))return!1;if(f.operator===u&&s(e,f.semver))return!1}return!0};fb.exports=Aj});var mb=y((w7,hb)=>{"use strict";p();var xj=Za(),Nj=(e,t,r)=>xj(e,t,">",r);hb.exports=Nj});var yb=y((A7,gb)=>{"use strict";p();var Rj=Za(),Cj=(e,t,r)=>Rj(e,t,"<",r);gb.exports=Cj});var _b=y((N7,Eb)=>{"use strict";p();var vb=kt(),Pj=(e,t,r)=>(e=new vb(e,r),t=new vb(t,r),e.intersects(t,r));Eb.exports=Pj});var Sb=y((C7,bb)=>{"use strict";p();var Dj=Uo(),Lj=Lt();bb.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((l,d)=>Lj(l,d,r));for(let l of s)Dj(l,t,r)?(o=l,i||(i=l)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[l,d]of n)l===d?a.push(l):!d&&l===s[0]?a.push("*"):d?l===s[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let u=a.join(" || "),c=typeof t.raw=="string"?t.raw:String(t);return u.length<c.length?u:t}});var xb=y((D7,Ab)=>{"use strict";p();var Tb=kt(),Yp=Fo(),{ANY:Wp}=Yp,zp=Uo(),Jp=Lt(),kj=(e,t,r={})=>{if(e===t)return!0;e=new Tb(e,r),t=new Tb(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=Mj(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},jj=[new Yp(">=0.0.0-0")],Ib=[new Yp(">=0.0.0")],Mj=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Wp){if(t.length===1&&t[0].semver===Wp)return!0;r.includePrerelease?e=jj:e=Ib}if(t.length===1&&t[0].semver===Wp){if(r.includePrerelease)return!0;t=Ib}let n=new Set,i,o;for(let h of e)h.operator===">"||h.operator===">="?i=wb(i,h,r):h.operator==="<"||h.operator==="<="?o=Ob(o,h,r):n.add(h.semver);if(n.size>1)return null;let s;if(i&&o){if(s=Jp(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let h of n){if(i&&!zp(h,String(i),r)||o&&!zp(h,String(o),r))return null;for(let g of t)if(!zp(h,String(g),r))return!1;return!0}let a,u,c,l,d=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,f=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;d&&d.prerelease.length===1&&o.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let h of t){if(l=l||h.operator===">"||h.operator===">=",c=c||h.operator==="<"||h.operator==="<=",i){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator===">"||h.operator===">="){if(a=wb(i,h,r),a===h&&a!==i)return!1}else if(i.operator===">="&&!h.test(i.semver))return!1}if(o){if(d&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===d.major&&h.semver.minor===d.minor&&h.semver.patch===d.patch&&(d=!1),h.operator==="<"||h.operator==="<="){if(u=Ob(o,h,r),u===h&&u!==o)return!1}else if(o.operator==="<="&&!h.test(o.semver))return!1}if(!h.operator&&(o||i)&&s!==0)return!1}return!(i&&c&&!o&&s!==0||o&&l&&!i&&s!==0||f||d)},wb=(e,t,r)=>{if(!e)return t;let n=Jp(e.semver,t.semver,r);return n>0?e:n<0||t.operator===">"&&e.operator===">="?t:e},Ob=(e,t,r)=>{if(!e)return t;let n=Jp(e.semver,t.semver,r);return n<0?e:n>0||t.operator==="<"&&e.operator==="<="?t:e};Ab.exports=kj});var eu=y((k7,Cb)=>{"use strict";p();var Xp=vi(),Nb=yi(),Fj=Je(),Rb=kp(),qj=Vr(),Uj=e_(),Vj=r_(),Gj=o_(),$j=u_(),Bj=l_(),Kj=d_(),Hj=h_(),Qj=g_(),Wj=Lt(),zj=__(),Yj=S_(),Jj=Qa(),Xj=O_(),Zj=x_(),eM=Mo(),tM=Wa(),rM=Fp(),nM=qp(),iM=za(),oM=Ya(),sM=Up(),aM=M_(),uM=q_(),cM=Fo(),lM=kt(),pM=Uo(),dM=eb(),fM=rb(),hM=ib(),mM=ab(),gM=cb(),yM=Za(),vM=mb(),EM=yb(),_M=_b(),bM=Sb(),SM=xb();Cb.exports={parse:qj,valid:Uj,clean:Vj,inc:Gj,diff:$j,major:Bj,minor:Kj,patch:Hj,prerelease:Qj,compare:Wj,rcompare:zj,compareLoose:Yj,compareBuild:Jj,sort:Xj,rsort:Zj,gt:eM,lt:tM,eq:rM,neq:nM,gte:iM,lte:oM,cmp:sM,coerce:aM,truncate:uM,Comparator:cM,Range:lM,satisfies:pM,toComparators:dM,maxSatisfying:fM,minSatisfying:hM,minVersion:mM,validRange:gM,outside:yM,gtr:vM,ltr:EM,intersects:_M,simplifyRange:bM,subset:SM,SemVer:Fj,re:Xp.re,src:Xp.src,tokens:Xp.t,SEMVER_SPEC_VERSION:Nb.SEMVER_SPEC_VERSION,RELEASE_TYPES:Nb.RELEASE_TYPES,compareIdentifiers:Rb.compareIdentifiers,rcompareIdentifiers:Rb.rcompareIdentifiers}});var Db=y((M7,Pb)=>{p();var TM=eu();Pb.exports=TM.satisfies(process.version,">=15.7.0")});var kb=y((q7,Lb)=>{p();var IM=eu();Lb.exports=IM.satisfies(process.version,">=16.9.0")});var Zp=y((V7,jb)=>{p();var wM=Db(),OM=kb(),AM={ec:["ES256","ES384","ES512"],rsa:["RS256","PS256","RS384","PS384","RS512","PS512"],"rsa-pss":["PS256","PS384","PS512"]},xM={ES256:"prime256v1",ES384:"secp384r1",ES512:"secp521r1"};jb.exports=function(e,t){if(!e||!t)return;let r=t.asymmetricKeyType;if(!r)return;let n=AM[r];if(!n)throw new Error(`Unknown key type "${r}".`);if(!n.includes(e))throw new Error(`"alg" parameter for "${r}" key type must be one of: ${n.join(", ")}.`);if(wM)switch(r){case"ec":let i=t.asymmetricKeyDetails.namedCurve,o=xM[e];if(i!==o)throw new Error(`"alg" parameter "${e}" requires curve "${o}".`);break;case"rsa-pss":if(OM){let s=parseInt(e.slice(-3),10),{hashAlgorithm:a,mgf1HashAlgorithm:u,saltLength:c}=t.asymmetricKeyDetails;if(a!==`sha${s}`||u!==a)throw new Error(`Invalid key for this operation, its RSA-PSS parameters do not meet the requirements of "alg" ${e}.`);if(c!==void 0&&c>s>>3)throw new Error(`Invalid key for this operation, its RSA-PSS parameter saltLength does not meet the requirements of "alg" ${e}.`)}break}}});var ed=y(($7,Mb)=>{p();var NM=eu();Mb.exports=NM.satisfies(process.version,"^6.12.0 || >=8.0.0")});var Ub=y((K7,qb)=>{p();var Se=ko(),RM=Rp(),Fb=Cp(),CM=Np(),PM=Pp(),DM=Zp(),LM=ed(),kM=Ma(),{KeyObject:jM,createSecretKey:MM,createPublicKey:FM}=M("crypto"),td=["RS256","RS384","RS512"],qM=["ES256","ES384","ES512"],rd=["RS256","RS384","RS512"],UM=["HS256","HS384","HS512"];LM&&(td.splice(td.length,0,"PS256","PS384","PS512"),rd.splice(rd.length,0,"PS256","PS384","PS512"));qb.exports=function(e,t,r,n){typeof r=="function"&&!n&&(n=r,r={}),r||(r={}),r=Object.assign({},r);let i;if(n?i=n:i=function(l,d){if(l)throw l;return d},r.clockTimestamp&&typeof r.clockTimestamp!="number")return i(new Se("clockTimestamp must be a number"));if(r.nonce!==void 0&&(typeof r.nonce!="string"||r.nonce.trim()===""))return i(new Se("nonce must be a non-empty string"));if(r.allowInvalidAsymmetricKeyTypes!==void 0&&typeof r.allowInvalidAsymmetricKeyTypes!="boolean")return i(new Se("allowInvalidAsymmetricKeyTypes must be a boolean"));let o=r.clockTimestamp||Math.floor(Date.now()/1e3);if(!e)return i(new Se("jwt must be provided"));if(typeof e!="string")return i(new Se("jwt must be a string"));let s=e.split(".");if(s.length!==3)return i(new Se("jwt malformed"));let a;try{a=CM(e,{complete:!0})}catch(l){return i(l)}if(!a)return i(new Se("invalid token"));let u=a.header,c;if(typeof t=="function"){if(!n)return i(new Se("verify must be called asynchronous if secret or public key is provided as a callback"));c=t}else c=function(l,d){return d(null,t)};return c(u,function(l,d){if(l)return i(new Se("error in secret or public key callback: "+l.message));let f=s[2].trim()!=="";if(!f&&d)return i(new Se("jwt signature is required"));if(f&&!d)return i(new Se("secret or public key must be provided"));if(!f&&!r.algorithms)return i(new Se('please specify "none" in "algorithms" to verify unsigned tokens'));if(d!=null&&!(d instanceof jM))try{d=FM(d)}catch{try{d=MM(typeof d=="string"?Buffer.from(d):d)}catch{return i(new Se("secretOrPublicKey is not valid key material"))}}if(r.algorithms||(d.type==="secret"?r.algorithms=UM:["rsa","rsa-pss"].includes(d.asymmetricKeyType)?r.algorithms=rd:d.asymmetricKeyType==="ec"?r.algorithms=qM:r.algorithms=td),r.algorithms.indexOf(a.header.alg)===-1)return i(new Se("invalid algorithm"));if(u.alg.startsWith("HS")&&d.type!=="secret")return i(new Se(`secretOrPublicKey must be a symmetric key when using ${u.alg}`));if(/^(?:RS|PS|ES)/.test(u.alg)&&d.type!=="public")return i(new Se(`secretOrPublicKey must be an asymmetric key when using ${u.alg}`));if(!r.allowInvalidAsymmetricKeyTypes)try{DM(u.alg,d)}catch(v){return i(v)}let h;try{h=kM.verify(e,a.header.alg,d)}catch(v){return i(v)}if(!h)return i(new Se("invalid signature"));let g=a.payload;if(typeof g.nbf<"u"&&!r.ignoreNotBefore){if(typeof g.nbf!="number")return i(new Se("invalid nbf value"));if(g.nbf>o+(r.clockTolerance||0))return i(new RM("jwt not active",new Date(g.nbf*1e3)))}if(typeof g.exp<"u"&&!r.ignoreExpiration){if(typeof g.exp!="number")return i(new Se("invalid exp value"));if(o>=g.exp+(r.clockTolerance||0))return i(new Fb("jwt expired",new Date(g.exp*1e3)))}if(r.audience){let v=Array.isArray(r.audience)?r.audience:[r.audience];if(!(Array.isArray(g.aud)?g.aud:[g.aud]).some(function(b){return v.some(function(A){return A instanceof RegExp?A.test(b):A===b})}))return i(new Se("jwt audience invalid. expected: "+v.join(" or ")))}if(r.issuer&&(typeof r.issuer=="string"&&g.iss!==r.issuer||Array.isArray(r.issuer)&&r.issuer.indexOf(g.iss)===-1))return i(new Se("jwt issuer invalid. expected: "+r.issuer));if(r.subject&&g.sub!==r.subject)return i(new Se("jwt subject invalid. expected: "+r.subject));if(r.jwtid&&g.jti!==r.jwtid)return i(new Se("jwt jwtid invalid. expected: "+r.jwtid));if(r.nonce&&g.nonce!==r.nonce)return i(new Se("jwt nonce invalid. expected: "+r.nonce));if(r.maxAge){if(typeof g.iat!="number")return i(new Se("iat required when maxAge is specified"));let v=PM(r.maxAge,g.iat);if(typeof v>"u")return i(new Se('"maxAge" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'));if(o>=v+(r.clockTolerance||0))return i(new Fb("maxAge exceeded",new Date(v*1e3)))}if(r.complete===!0){let v=a.signature;return i(null,{header:u,payload:g,signature:v})}return i(null,g)})}});var Hb=y((Q7,Kb)=>{p();var Vb=1/0,$b=9007199254740991,VM=17976931348623157e292,Gb=NaN,GM="[object Arguments]",$M="[object Function]",BM="[object GeneratorFunction]",KM="[object String]",HM="[object Symbol]",QM=/^\s+|\s+$/g,WM=/^[-+]0x[0-9a-f]+$/i,zM=/^0b[01]+$/i,YM=/^0o[0-7]+$/i,JM=/^(?:0|[1-9]\d*)$/,XM=parseInt;function ZM(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function eF(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function tF(e,t,r){if(t!==t)return eF(e,rF,r);for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}function rF(e){return e!==e}function nF(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function iF(e,t){return ZM(t,function(r){return e[r]})}function oF(e,t){return function(r){return e(t(r))}}var tu=Object.prototype,id=tu.hasOwnProperty,ru=tu.toString,sF=tu.propertyIsEnumerable,aF=oF(Object.keys,Object),uF=Math.max;function cF(e,t){var r=Bb(e)||hF(e)?nF(e.length,String):[],n=r.length,i=!!n;for(var o in e)(t||id.call(e,o))&&!(i&&(o=="length"||pF(o,n)))&&r.push(o);return r}function lF(e){if(!dF(e))return aF(e);var t=[];for(var r in Object(e))id.call(e,r)&&r!="constructor"&&t.push(r);return t}function pF(e,t){return t=t??$b,!!t&&(typeof e=="number"||JM.test(e))&&e>-1&&e%1==0&&e<t}function dF(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||tu;return e===r}function fF(e,t,r,n){e=od(e)?e:IF(e),r=r&&!n?bF(r):0;var i=e.length;return r<0&&(r=uF(i+r,0)),vF(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&tF(e,t,r)>-1}function hF(e){return mF(e)&&id.call(e,"callee")&&(!sF.call(e,"callee")||ru.call(e)==GM)}var Bb=Array.isArray;function od(e){return e!=null&&yF(e.length)&&!gF(e)}function mF(e){return sd(e)&&od(e)}function gF(e){var t=nd(e)?ru.call(e):"";return t==$M||t==BM}function yF(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=$b}function nd(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function sd(e){return!!e&&typeof e=="object"}function vF(e){return typeof e=="string"||!Bb(e)&&sd(e)&&ru.call(e)==KM}function EF(e){return typeof e=="symbol"||sd(e)&&ru.call(e)==HM}function _F(e){if(!e)return e===0?e:0;if(e=SF(e),e===Vb||e===-Vb){var t=e<0?-1:1;return t*VM}return e===e?e:0}function bF(e){var t=_F(e),r=t%1;return t===t?r?t-r:t:0}function SF(e){if(typeof e=="number")return e;if(EF(e))return Gb;if(nd(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=nd(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(QM,"");var r=zM.test(e);return r||YM.test(e)?XM(e.slice(2),r?2:8):WM.test(e)?Gb:+e}function TF(e){return od(e)?cF(e):lF(e)}function IF(e){return e?iF(e,TF(e)):[]}Kb.exports=fF});var Wb=y((z7,Qb)=>{p();var wF="[object Boolean]",OF=Object.prototype,AF=OF.toString;function xF(e){return e===!0||e===!1||NF(e)&&AF.call(e)==wF}function NF(e){return!!e&&typeof e=="object"}Qb.exports=xF});var Zb=y((J7,Xb)=>{p();var zb=1/0,RF=17976931348623157e292,Yb=NaN,CF="[object Symbol]",PF=/^\s+|\s+$/g,DF=/^[-+]0x[0-9a-f]+$/i,LF=/^0b[01]+$/i,kF=/^0o[0-7]+$/i,jF=parseInt,MF=Object.prototype,FF=MF.toString;function qF(e){return typeof e=="number"&&e==$F(e)}function Jb(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function UF(e){return!!e&&typeof e=="object"}function VF(e){return typeof e=="symbol"||UF(e)&&FF.call(e)==CF}function GF(e){if(!e)return e===0?e:0;if(e=BF(e),e===zb||e===-zb){var t=e<0?-1:1;return t*RF}return e===e?e:0}function $F(e){var t=GF(e),r=t%1;return t===t?r?t-r:t:0}function BF(e){if(typeof e=="number")return e;if(VF(e))return Yb;if(Jb(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Jb(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(PF,"");var r=LF.test(e);return r||kF.test(e)?jF(e.slice(2),r?2:8):DF.test(e)?Yb:+e}Xb.exports=qF});var tS=y((Z7,eS)=>{p();var KF="[object Number]",HF=Object.prototype,QF=HF.toString;function WF(e){return!!e&&typeof e=="object"}function zF(e){return typeof e=="number"||WF(e)&&QF.call(e)==KF}eS.exports=zF});var oS=y((tee,iS)=>{p();var YF="[object Object]";function JF(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}function XF(e,t){return function(r){return e(t(r))}}var ZF=Function.prototype,rS=Object.prototype,nS=ZF.toString,eq=rS.hasOwnProperty,tq=nS.call(Object),rq=rS.toString,nq=XF(Object.getPrototypeOf,Object);function iq(e){return!!e&&typeof e=="object"}function oq(e){if(!iq(e)||rq.call(e)!=YF||JF(e))return!1;var t=nq(e);if(t===null)return!0;var r=eq.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&nS.call(r)==tq}iS.exports=oq});var aS=y((nee,sS)=>{p();var sq="[object String]",aq=Object.prototype,uq=aq.toString,cq=Array.isArray;function lq(e){return!!e&&typeof e=="object"}function pq(e){return typeof e=="string"||!cq(e)&&lq(e)&&uq.call(e)==sq}sS.exports=pq});var dS=y((oee,pS)=>{p();var dq="Expected a function",uS=1/0,fq=17976931348623157e292,cS=NaN,hq="[object Symbol]",mq=/^\s+|\s+$/g,gq=/^[-+]0x[0-9a-f]+$/i,yq=/^0b[01]+$/i,vq=/^0o[0-7]+$/i,Eq=parseInt,_q=Object.prototype,bq=_q.toString;function Sq(e,t){var r;if(typeof t!="function")throw new TypeError(dq);return e=Aq(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=void 0),r}}function Tq(e){return Sq(2,e)}function lS(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Iq(e){return!!e&&typeof e=="object"}function wq(e){return typeof e=="symbol"||Iq(e)&&bq.call(e)==hq}function Oq(e){if(!e)return e===0?e:0;if(e=xq(e),e===uS||e===-uS){var t=e<0?-1:1;return t*fq}return e===e?e:0}function Aq(e){var t=Oq(e),r=t%1;return t===t?r?t-r:t:0}function xq(e){if(typeof e=="number")return e;if(wq(e))return cS;if(lS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=lS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(mq,"");var r=yq.test(e);return r||vq.test(e)?Eq(e.slice(2),r?2:8):gq.test(e)?cS:+e}pS.exports=Tq});var bS=y((aee,_S)=>{p();var fS=Pp(),Nq=ed(),Rq=Zp(),hS=Ma(),Cq=Hb(),nu=Wb(),mS=Zb(),ad=tS(),yS=oS(),Gr=aS(),Pq=dS(),{KeyObject:Dq,createSecretKey:Lq,createPrivateKey:kq}=M("crypto"),vS=["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512","none"];Nq&&vS.splice(3,0,"PS256","PS384","PS512");var jq={expiresIn:{isValid:function(e){return mS(e)||Gr(e)&&e},message:'"expiresIn" should be a number of seconds or string representing a timespan'},notBefore:{isValid:function(e){return mS(e)||Gr(e)&&e},message:'"notBefore" should be a number of seconds or string representing a timespan'},audience:{isValid:function(e){return Gr(e)||Array.isArray(e)},message:'"audience" must be a string or array'},algorithm:{isValid:Cq.bind(null,vS),message:'"algorithm" must be a valid string enum value'},header:{isValid:yS,message:'"header" must be an object'},encoding:{isValid:Gr,message:'"encoding" must be a string'},issuer:{isValid:Gr,message:'"issuer" must be a string'},subject:{isValid:Gr,message:'"subject" must be a string'},jwtid:{isValid:Gr,message:'"jwtid" must be a string'},noTimestamp:{isValid:nu,message:'"noTimestamp" must be a boolean'},keyid:{isValid:Gr,message:'"keyid" must be a string'},mutatePayload:{isValid:nu,message:'"mutatePayload" must be a boolean'},allowInsecureKeySizes:{isValid:nu,message:'"allowInsecureKeySizes" must be a boolean'},allowInvalidAsymmetricKeyTypes:{isValid:nu,message:'"allowInvalidAsymmetricKeyTypes" must be a boolean'}},Mq={iat:{isValid:ad,message:'"iat" should be a number of seconds'},exp:{isValid:ad,message:'"exp" should be a number of seconds'},nbf:{isValid:ad,message:'"nbf" should be a number of seconds'}};function ES(e,t,r,n){if(!yS(r))throw new Error('Expected "'+n+'" to be a plain object.');Object.keys(r).forEach(function(i){let o=e[i];if(!o){if(!t)throw new Error('"'+i+'" is not allowed in "'+n+'"');return}if(!o.isValid(r[i]))throw new Error(o.message)})}function Fq(e){return ES(jq,!1,e,"options")}function qq(e){return ES(Mq,!0,e,"payload")}var gS={audience:"aud",issuer:"iss",subject:"sub",jwtid:"jti"},Uq=["expiresIn","notBefore","noTimestamp","audience","issuer","subject","jwtid"];_S.exports=function(e,t,r,n){typeof r=="function"?(n=r,r={}):r=r||{};let i=typeof e=="object"&&!Buffer.isBuffer(e),o=Object.assign({alg:r.algorithm||"HS256",typ:i?"JWT":void 0,kid:r.keyid},r.header);function s(c){if(n)return n(c);throw c}if(!t&&r.algorithm!=="none")return s(new Error("secretOrPrivateKey must have a value"));if(t!=null&&!(t instanceof Dq))try{t=kq(t)}catch{try{t=Lq(typeof t=="string"?Buffer.from(t):t)}catch{return s(new Error("secretOrPrivateKey is not valid key material"))}}if(o.alg.startsWith("HS")&&t.type!=="secret")return s(new Error(`secretOrPrivateKey must be a symmetric key when using ${o.alg}`));if(/^(?:RS|PS|ES)/.test(o.alg)){if(t.type!=="private")return s(new Error(`secretOrPrivateKey must be an asymmetric key when using ${o.alg}`));if(!r.allowInsecureKeySizes&&!o.alg.startsWith("ES")&&t.asymmetricKeyDetails!==void 0&&t.asymmetricKeyDetails.modulusLength<2048)return s(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`))}if(typeof e>"u")return s(new Error("payload is required"));if(i){try{qq(e)}catch(c){return s(c)}r.mutatePayload||(e=Object.assign({},e))}else{let c=Uq.filter(function(l){return typeof r[l]<"u"});if(c.length>0)return s(new Error("invalid "+c.join(",")+" option for "+typeof e+" payload"))}if(typeof e.exp<"u"&&typeof r.expiresIn<"u")return s(new Error('Bad "options.expiresIn" option the payload already has an "exp" property.'));if(typeof e.nbf<"u"&&typeof r.notBefore<"u")return s(new Error('Bad "options.notBefore" option the payload already has an "nbf" property.'));try{Fq(r)}catch(c){return s(c)}if(!r.allowInvalidAsymmetricKeyTypes)try{Rq(o.alg,t)}catch(c){return s(c)}let a=e.iat||Math.floor(Date.now()/1e3);if(r.noTimestamp?delete e.iat:i&&(e.iat=a),typeof r.notBefore<"u"){try{e.nbf=fS(r.notBefore,a)}catch(c){return s(c)}if(typeof e.nbf>"u")return s(new Error('"notBefore" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}if(typeof r.expiresIn<"u"&&typeof e=="object"){try{e.exp=fS(r.expiresIn,a)}catch(c){return s(c)}if(typeof e.exp>"u")return s(new Error('"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60'))}Object.keys(gS).forEach(function(c){let l=gS[c];if(typeof r[c]<"u"){if(typeof e[l]<"u")return s(new Error('Bad "options.'+c+'" option. The payload already has an "'+l+'" property.'));e[l]=r[c]}});let u=r.encoding||"utf8";if(typeof n=="function")n=n&&Pq(n),hS.createSign({header:o,privateKey:t,payload:e,encoding:u}).once("error",n).once("done",function(c){if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&c.length<256)return n(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`));n(null,c)});else{let c=hS.sign({header:o,payload:e,secret:t,encoding:u});if(!r.allowInsecureKeySizes&&/^(?:RS|PS)/.test(o.alg)&&c.length<256)throw new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${o.alg}`);return c}}});var Vo=y((cee,SS)=>{p();SS.exports={decode:Np(),verify:Ub(),sign:bS(),JsonWebTokenError:ko(),NotBeforeError:Rp(),TokenExpiredError:Cp()}});var xS=y(Ei=>{"use strict";p();Object.defineProperty(Ei,"__esModule",{value:!0});Ei.versionInfo=Ei.version=void 0;var Kq="15.10.2";Ei.version=Kq;var Hq=Object.freeze({major:15,minor:10,patch:2,preReleaseTag:null});Ei.versionInfo=Hq});var su=y(ld=>{"use strict";p();Object.defineProperty(ld,"__esModule",{value:!0});ld.default=Qq;function Qq(e){return typeof e?.then=="function"}});var jt=y(pd=>{"use strict";p();Object.defineProperty(pd,"__esModule",{value:!0});pd.default=Wq;function Wq(e,t){var r=!!e;if(!r)throw new Error(t)}});var ar=y(dd=>{"use strict";p();Object.defineProperty(dd,"__esModule",{value:!0});dd.default=zq;function au(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?au=function(r){return typeof r}:au=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},au(e)}function zq(e){return au(e)=="object"&&e!==null}});var ur=y(Br=>{"use strict";p();Object.defineProperty(Br,"__esModule",{value:!0});Br.SYMBOL_TO_STRING_TAG=Br.SYMBOL_ASYNC_ITERATOR=Br.SYMBOL_ITERATOR=void 0;var Yq=typeof Symbol=="function"&&Symbol.iterator!=null?Symbol.iterator:"@@iterator";Br.SYMBOL_ITERATOR=Yq;var Jq=typeof Symbol=="function"&&Symbol.asyncIterator!=null?Symbol.asyncIterator:"@@asyncIterator";Br.SYMBOL_ASYNC_ITERATOR=Jq;var Xq=typeof Symbol=="function"&&Symbol.toStringTag!=null?Symbol.toStringTag:"@@toStringTag";Br.SYMBOL_TO_STRING_TAG=Xq});var uu=y(fd=>{"use strict";p();Object.defineProperty(fd,"__esModule",{value:!0});fd.getLocation=Zq;function Zq(e,t){for(var r=/\r\n|[\n\r]/g,n=1,i=t+1,o;(o=r.exec(e.body))&&o.index<t;)n+=1,i=t+1-(o.index+o[0].length);return{line:n,column:i}}});var hd=y(lu=>{"use strict";p();Object.defineProperty(lu,"__esModule",{value:!0});lu.printLocation=tU;lu.printSourceLocation=RS;var eU=uu();function tU(e){return RS(e.source,(0,eU.getLocation)(e.source,e.start))}function RS(e,t){var r=e.locationOffset.column-1,n=cu(r)+e.body,i=t.line-1,o=e.locationOffset.line-1,s=t.line+o,a=t.line===1?r:0,u=t.column+a,c="".concat(e.name,":").concat(s,":").concat(u,`
|
|
31
|
+
`),l=n.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){for(var f=Math.floor(u/80),h=u%80,g=[],v=0;v<d.length;v+=80)g.push(d.slice(v,v+80));return c+NS([["".concat(s),g[0]]].concat(g.slice(1,f+1).map(function(_){return["",_]}),[[" ",cu(h-1)+"^"],["",g[f+1]]]))}return c+NS([["".concat(s-1),l[i-1]],["".concat(s),d],["",cu(u-1)+"^"],["".concat(s+1),l[i+1]]])}function NS(e){var t=e.filter(function(n){var i=n[0],o=n[1];return o!==void 0}),r=Math.max.apply(Math,t.map(function(n){var i=n[0];return i.length}));return t.map(function(n){var i=n[0],o=n[1];return rU(r,i)+(o?" | "+o:" |")}).join(`
|
|
32
|
+
`)}function cu(e){return Array(e+1).join(" ")}function rU(e,t){return cu(e-t.length)+t}});var K=y(_i=>{"use strict";p();function pu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pu=function(r){return typeof r}:pu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},pu(e)}Object.defineProperty(_i,"__esModule",{value:!0});_i.printError=qS;_i.formatError=US;_i.GraphQLError=void 0;var nU=jS(jt()),iU=jS(ar()),oU=ur(),CS=uu(),PS=hd();function jS(e){return e&&e.__esModule?e:{default:e}}function DS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sU(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DS(Object(r),!0).forEach(function(n){aU(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DS(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function aU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uU(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function LS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function cU(e,t,r){return t&&LS(e.prototype,t),r&&LS(e,r),e}function lU(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Bo(e,t)}function pU(e){var t=FS();return function(){var n=Ko(e),i;if(t){var o=Ko(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return MS(this,i)}}function MS(e,t){return t&&(pu(t)==="object"||typeof t=="function")?t:$o(e)}function $o(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function md(e){var t=typeof Map=="function"?new Map:void 0;return md=function(n){if(n===null||!dU(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return du(n,arguments,Ko(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Bo(i,n)},md(e)}function du(e,t,r){return FS()?du=Reflect.construct:du=function(i,o,s){var a=[null];a.push.apply(a,o);var u=Function.bind.apply(i,a),c=new u;return s&&Bo(c,s.prototype),c},du.apply(null,arguments)}function FS(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function dU(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Bo(e,t){return Bo=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},Bo(e,t)}function Ko(e){return Ko=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},Ko(e)}var fU=(function(e){lU(r,e);var t=pU(r);function r(n,i,o,s,a,u,c){var l,d,f,h;uU(this,r),h=t.call(this,n),h.name="GraphQLError",h.originalError=u??void 0,h.nodes=kS(Array.isArray(i)?i:i?[i]:void 0);for(var g=[],v=0,_=(S=h.nodes)!==null&&S!==void 0?S:[];v<_.length;v++){var S,b=_[v],A=b.loc;A!=null&&g.push(A)}g=kS(g),h.source=o??((l=g)===null||l===void 0?void 0:l[0].source),h.positions=s??((d=g)===null||d===void 0?void 0:d.map(function(T){return T.start})),h.locations=s&&o?s.map(function(T){return(0,CS.getLocation)(o,T)}):(f=g)===null||f===void 0?void 0:f.map(function(T){return(0,CS.getLocation)(T.source,T.start)}),h.path=a??void 0;var O=u?.extensions;return c==null&&(0,iU.default)(O)?h.extensions=sU({},O):h.extensions=c??{},Object.defineProperties($o(h),{message:{enumerable:!0},locations:{enumerable:h.locations!=null},path:{enumerable:h.path!=null},extensions:{enumerable:h.extensions!=null&&Object.keys(h.extensions).length>0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),u!=null&&u.stack?(Object.defineProperty($o(h),"stack",{value:u.stack,writable:!0,configurable:!0}),MS(h)):(Error.captureStackTrace?Error.captureStackTrace($o(h),r):Object.defineProperty($o(h),"stack",{value:Error().stack,writable:!0,configurable:!0}),h)}return cU(r,[{key:"toString",value:function(){return qS(this)}},{key:"toJSON",value:function(){return US(this)}},{key:oU.SYMBOL_TO_STRING_TAG,get:function(){return"Object"}}]),r})(md(Error));_i.GraphQLError=fU;function kS(e){return e===void 0||e.length===0?void 0:e}function qS(e){var t=e.message;if(e.nodes)for(var r=0,n=e.nodes;r<n.length;r++){var i=n[r];i.loc&&(t+=`
|
|
33
33
|
|
|
34
|
-
`+(0,
|
|
34
|
+
`+(0,PS.printLocation)(i.loc))}else if(e.source&&e.locations)for(var o=0,s=e.locations;o<s.length;o++){var a=s[o];t+=`
|
|
35
35
|
|
|
36
|
-
`+(0,
|
|
36
|
+
`+(0,PS.printSourceLocation)(e.source,a)}return t}function US(e){var t;e||(0,nU.default)(0,"Received null or undefined error.");var r=(t=e.message)!==null&&t!==void 0?t:"An unknown error occurred.",n=e.locations,i=e.path,o=e.extensions;return o&&Object.keys(o).length>0?{message:r,locations:n,path:i,extensions:o}:{message:r,locations:n,path:i}}});var fu=y(gd=>{"use strict";p();Object.defineProperty(gd,"__esModule",{value:!0});gd.syntaxError=mU;var hU=K();function mU(e,t,r){return new hU.GraphQLError("Syntax Error: ".concat(r),void 0,e,[t])}});var Ee=y(hu=>{"use strict";p();Object.defineProperty(hu,"__esModule",{value:!0});hu.Kind=void 0;var gU=Object.freeze({NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType",SCHEMA_DEFINITION:"SchemaDefinition",OPERATION_TYPE_DEFINITION:"OperationTypeDefinition",SCALAR_TYPE_DEFINITION:"ScalarTypeDefinition",OBJECT_TYPE_DEFINITION:"ObjectTypeDefinition",FIELD_DEFINITION:"FieldDefinition",INPUT_VALUE_DEFINITION:"InputValueDefinition",INTERFACE_TYPE_DEFINITION:"InterfaceTypeDefinition",UNION_TYPE_DEFINITION:"UnionTypeDefinition",ENUM_TYPE_DEFINITION:"EnumTypeDefinition",ENUM_VALUE_DEFINITION:"EnumValueDefinition",INPUT_OBJECT_TYPE_DEFINITION:"InputObjectTypeDefinition",DIRECTIVE_DEFINITION:"DirectiveDefinition",SCHEMA_EXTENSION:"SchemaExtension",SCALAR_TYPE_EXTENSION:"ScalarTypeExtension",OBJECT_TYPE_EXTENSION:"ObjectTypeExtension",INTERFACE_TYPE_EXTENSION:"InterfaceTypeExtension",UNION_TYPE_EXTENSION:"UnionTypeExtension",ENUM_TYPE_EXTENSION:"EnumTypeExtension",INPUT_OBJECT_TYPE_EXTENSION:"InputObjectTypeExtension"});hu.Kind=gU});var et=y(yd=>{"use strict";p();Object.defineProperty(yd,"__esModule",{value:!0});yd.default=yU;function yU(e,t){var r=!!e;if(!r)throw new Error(t??"Unexpected invariant triggered.")}});var vd=y(mu=>{"use strict";p();Object.defineProperty(mu,"__esModule",{value:!0});mu.default=void 0;var vU=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):void 0,EU=vU;mu.default=EU});var gu=y(Ed=>{"use strict";p();Object.defineProperty(Ed,"__esModule",{value:!0});Ed.default=bU;var _U=GS(et()),VS=GS(vd());function GS(e){return e&&e.__esModule?e:{default:e}}function bU(e){var t=e.prototype.toJSON;typeof t=="function"||(0,_U.default)(0),e.prototype.inspect=t,VS.default&&(e.prototype[VS.default]=t)}});var bi=y(An=>{"use strict";p();Object.defineProperty(An,"__esModule",{value:!0});An.isNode=TU;An.Token=An.Location=void 0;var $S=SU(gu());function SU(e){return e&&e.__esModule?e:{default:e}}var BS=(function(){function e(r,n,i){this.start=r.start,this.end=n.end,this.startToken=r,this.endToken=n,this.source=i}var t=e.prototype;return t.toJSON=function(){return{start:this.start,end:this.end}},e})();An.Location=BS;(0,$S.default)(BS);var KS=(function(){function e(r,n,i,o,s,a,u){this.kind=r,this.start=n,this.end=i,this.line=o,this.column=s,this.value=u,this.prev=a,this.next=null}var t=e.prototype;return t.toJSON=function(){return{kind:this.kind,value:this.value,line:this.line,column:this.column}},e})();An.Token=KS;(0,$S.default)(KS);function TU(e){return e!=null&&typeof e.kind=="string"}});var Si=y(yu=>{"use strict";p();Object.defineProperty(yu,"__esModule",{value:!0});yu.TokenKind=void 0;var IU=Object.freeze({SOF:"<SOF>",EOF:"<EOF>",BANG:"!",DOLLAR:"$",AMP:"&",PAREN_L:"(",PAREN_R:")",SPREAD:"...",COLON:":",EQUALS:"=",AT:"@",BRACKET_L:"[",BRACKET_R:"]",BRACE_L:"{",PIPE:"|",BRACE_R:"}",NAME:"Name",INT:"Int",FLOAT:"Float",STRING:"String",BLOCK_STRING:"BlockString",COMMENT:"Comment"});yu.TokenKind=IU});var se=y(_d=>{"use strict";p();Object.defineProperty(_d,"__esModule",{value:!0});_d.default=xU;var wU=OU(vd());function OU(e){return e&&e.__esModule?e:{default:e}}function vu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?vu=function(r){return typeof r}:vu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},vu(e)}var AU=10,HS=2;function xU(e){return Eu(e,[])}function Eu(e,t){switch(vu(e)){case"string":return JSON.stringify(e);case"function":return e.name?"[function ".concat(e.name,"]"):"[function]";case"object":return e===null?"null":NU(e,t);default:return String(e)}}function NU(e,t){if(t.indexOf(e)!==-1)return"[Circular]";var r=[].concat(t,[e]),n=PU(e);if(n!==void 0){var i=n.call(e);if(i!==e)return typeof i=="string"?i:Eu(i,r)}else if(Array.isArray(e))return CU(e,r);return RU(e,r)}function RU(e,t){var r=Object.keys(e);if(r.length===0)return"{}";if(t.length>HS)return"["+DU(e)+"]";var n=r.map(function(i){var o=Eu(e[i],t);return i+": "+o});return"{ "+n.join(", ")+" }"}function CU(e,t){if(e.length===0)return"[]";if(t.length>HS)return"[Array]";for(var r=Math.min(AU,e.length),n=e.length-r,i=[],o=0;o<r;++o)i.push(Eu(e[o],t));return n===1?i.push("... 1 more item"):n>1&&i.push("... ".concat(n," more items")),"["+i.join(", ")+"]"}function PU(e){var t=e[String(wU.default)];if(typeof t=="function")return t;if(typeof e.inspect=="function")return e.inspect}function DU(e){var t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if(t==="Object"&&typeof e.constructor=="function"){var r=e.constructor.name;if(typeof r=="string"&&r!=="")return r}return t}});var Ho=y(bu=>{"use strict";p();Object.defineProperty(bu,"__esModule",{value:!0});bu.default=void 0;var LU=kU(se());function kU(e){return e&&e.__esModule?e:{default:e}}function _u(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?_u=function(r){return typeof r}:_u=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},_u(e)}var jU=process.env.NODE_ENV==="production"?function(t,r){return t instanceof r}:function(t,r){if(t instanceof r)return!0;if(_u(t)==="object"&&t!==null){var n,i=r.prototype[Symbol.toStringTag],o=Symbol.toStringTag in t?t[Symbol.toStringTag]:(n=t.constructor)===null||n===void 0?void 0:n.name;if(i===o){var s=(0,LU.default)(t);throw new Error("Cannot use ".concat(i,' "').concat(s,`" from another module or realm.
|
|
37
37
|
|
|
38
38
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
39
39
|
directory. If different versions of "graphql" are the dependencies of other
|
|
@@ -44,39 +44,39 @@ https://yarnpkg.com/en/docs/selective-version-resolutions
|
|
|
44
44
|
Duplicate "graphql" modules cannot be used at the same time since different
|
|
45
45
|
versions may have different capabilities and behavior. The data from one
|
|
46
46
|
version used in the function from another could produce confusing and
|
|
47
|
-
spurious results.`))}}return!1};
|
|
48
|
-
`)}function
|
|
47
|
+
spurious results.`))}}return!1};bu.default=jU});var Su=y(Qo=>{"use strict";p();Object.defineProperty(Qo,"__esModule",{value:!0});Qo.isSource=VU;Qo.Source=void 0;var MU=ur(),FU=Sd(se()),bd=Sd(jt()),qU=Sd(Ho());function Sd(e){return e&&e.__esModule?e:{default:e}}function QS(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function UU(e,t,r){return t&&QS(e.prototype,t),r&&QS(e,r),e}var WS=(function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GraphQL request",n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{line:1,column:1};typeof t=="string"||(0,bd.default)(0,"Body must be a string. Received: ".concat((0,FU.default)(t),".")),this.body=t,this.name=r,this.locationOffset=n,this.locationOffset.line>0||(0,bd.default)(0,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,bd.default)(0,"column in locationOffset is 1-indexed and must be positive.")}return UU(e,[{key:MU.SYMBOL_TO_STRING_TAG,get:function(){return"Source"}}]),e})();Qo.Source=WS;function VU(e){return(0,qU.default)(e,WS)}});var Ti=y(Tu=>{"use strict";p();Object.defineProperty(Tu,"__esModule",{value:!0});Tu.DirectiveLocation=void 0;var GU=Object.freeze({QUERY:"QUERY",MUTATION:"MUTATION",SUBSCRIPTION:"SUBSCRIPTION",FIELD:"FIELD",FRAGMENT_DEFINITION:"FRAGMENT_DEFINITION",FRAGMENT_SPREAD:"FRAGMENT_SPREAD",INLINE_FRAGMENT:"INLINE_FRAGMENT",VARIABLE_DEFINITION:"VARIABLE_DEFINITION",SCHEMA:"SCHEMA",SCALAR:"SCALAR",OBJECT:"OBJECT",FIELD_DEFINITION:"FIELD_DEFINITION",ARGUMENT_DEFINITION:"ARGUMENT_DEFINITION",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",ENUM_VALUE:"ENUM_VALUE",INPUT_OBJECT:"INPUT_OBJECT",INPUT_FIELD_DEFINITION:"INPUT_FIELD_DEFINITION"});Tu.DirectiveLocation=GU});var Ii=y(Wo=>{"use strict";p();Object.defineProperty(Wo,"__esModule",{value:!0});Wo.dedentBlockStringValue=$U;Wo.getBlockStringIndentation=YS;Wo.printBlockString=BU;function $U(e){var t=e.split(/\r\n|[\n\r]/g),r=YS(e);if(r!==0)for(var n=1;n<t.length;n++)t[n]=t[n].slice(r);for(var i=0;i<t.length&&zS(t[i]);)++i;for(var o=t.length;o>i&&zS(t[o-1]);)--o;return t.slice(i,o).join(`
|
|
48
|
+
`)}function zS(e){for(var t=0;t<e.length;++t)if(e[t]!==" "&&e[t]!==" ")return!1;return!0}function YS(e){for(var t,r=!0,n=!0,i=0,o=null,s=0;s<e.length;++s)switch(e.charCodeAt(s)){case 13:e.charCodeAt(s+1)===10&&++s;case 10:r=!1,n=!0,i=0;break;case 9:case 32:++i;break;default:n&&!r&&(o===null||i<o)&&(o=i),n=!1}return(t=o)!==null&&t!==void 0?t:0}function BU(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=e.indexOf(`
|
|
49
49
|
`)===-1,i=e[0]===" "||e[0]===" ",o=e[e.length-1]==='"',s=e[e.length-1]==="\\",a=!n||o||s||r,u="";return a&&!(n&&i)&&(u+=`
|
|
50
50
|
`+t),u+=t?e.replace(/\n/g,`
|
|
51
51
|
`+t):e,a&&(u+=`
|
|
52
|
-
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}});var
|
|
53
|
-
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=HU(o.charCodeAt(s+1),o.charCodeAt(s+2),o.charCodeAt(s+3),o.charCodeAt(s+4));if(l<0){var d=o.slice(s+1,s+5);throw(0,cr.syntaxError)(e,s,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),s+=4;break}default:throw(0,cr.syntaxError)(e,s,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++s,a=s}}throw(0,cr.syntaxError)(e,s,"Unterminated string.")}function KU(e,t,r,n,i,o){for(var s=e.body,a=t+3,u=a,c=0,l="";a<s.length&&!isNaN(c=s.charCodeAt(a));){if(c===34&&s.charCodeAt(a+1)===34&&s.charCodeAt(a+2)===34)return l+=s.slice(u,a),new ke.Token(Z.TokenKind.BLOCK_STRING,t,a+3,r,n,i,(0,MU.dedentBlockStringValue)(l));if(c<32&&c!==9&&c!==10&&c!==13)throw(0,cr.syntaxError)(e,a,"Invalid character within String: ".concat(An(c),"."));c===10?(++a,++o.line,o.lineStart=a):c===13?(s.charCodeAt(a+1)===10?a+=2:++a,++o.line,o.lineStart=a):c===92&&s.charCodeAt(a+1)===34&&s.charCodeAt(a+2)===34&&s.charCodeAt(a+3)===34?(l+=s.slice(u,a)+'"""',a+=4,u=a):++a}throw(0,cr.syntaxError)(e,a,"Unterminated string.")}function HU(e,t,r,n){return Su(e)<<12|Su(t)<<8|Su(r)<<4|Su(n)}function Su(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function QU(e,t,r,n,i){for(var o=e.body,s=o.length,a=t+1,u=0;a!==s&&!isNaN(u=o.charCodeAt(a))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++a;return new ke.Token(Z.TokenKind.NAME,t,a,r,n,i,o.slice(t,a))}function WU(e){return e===95||e>=65&&e<=90||e>=97&&e<=122}});var Ii=y(xn=>{"use strict";p();Object.defineProperty(xn,"__esModule",{value:!0});xn.parse=JU;xn.parseValue=XU;xn.parseType=ZU;xn.Parser=void 0;var bd=pu(),Q=Ee(),zU=_i(),D=bi(),HS=_u(),YU=Si(),QS=Tu();function JU(e,t){var r=new Iu(e,t);return r.parseDocument()}function XU(e,t){var r=new Iu(e,t);r.expectToken(D.TokenKind.SOF);var n=r.parseValueLiteral(!1);return r.expectToken(D.TokenKind.EOF),n}function ZU(e,t){var r=new Iu(e,t);r.expectToken(D.TokenKind.SOF);var n=r.parseTypeReference();return r.expectToken(D.TokenKind.EOF),n}var Iu=(function(){function e(r,n){var i=(0,HS.isSource)(r)?r:new HS.Source(r);this._lexer=new QS.Lexer(i),this._options=n}var t=e.prototype;return t.parseName=function(){var n=this.expectToken(D.TokenKind.NAME);return{kind:Q.Kind.NAME,value:n.value,loc:this.loc(n)}},t.parseDocument=function(){var n=this._lexer.token;return{kind:Q.Kind.DOCUMENT,definitions:this.many(D.TokenKind.SOF,this.parseDefinition,D.TokenKind.EOF),loc:this.loc(n)}},t.parseDefinition=function(){if(this.peek(D.TokenKind.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(D.TokenKind.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(D.TokenKind.BRACE_L))return{kind:Q.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),o;return this.peek(D.TokenKind.NAME)&&(o=this.parseName()),{kind:Q.Kind.OPERATION_DEFINITION,operation:i,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.parseOperationType=function(){var n=this.expectToken(D.TokenKind.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},t.parseVariableDefinitions=function(){return this.optionalMany(D.TokenKind.PAREN_L,this.parseVariableDefinition,D.TokenKind.PAREN_R)},t.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:Q.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(D.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(D.TokenKind.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},t.parseVariable=function(){var n=this._lexer.token;return this.expectToken(D.TokenKind.DOLLAR),{kind:Q.Kind.VARIABLE,name:this.parseName(),loc:this.loc(n)}},t.parseSelectionSet=function(){var n=this._lexer.token;return{kind:Q.Kind.SELECTION_SET,selections:this.many(D.TokenKind.BRACE_L,this.parseSelection,D.TokenKind.BRACE_R),loc:this.loc(n)}},t.parseSelection=function(){return this.peek(D.TokenKind.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var n=this._lexer.token,i=this.parseName(),o,s;return this.expectOptionalToken(D.TokenKind.COLON)?(o=i,s=this.parseName()):s=i,{kind:Q.Kind.FIELD,alias:o,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(D.TokenKind.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(D.TokenKind.PAREN_L,i,D.TokenKind.PAREN_R)},t.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(D.TokenKind.COLON),{kind:Q.Kind.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},t.parseConstArgument=function(){var n=this._lexer.token;return{kind:Q.Kind.ARGUMENT,name:this.parseName(),value:(this.expectToken(D.TokenKind.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},t.parseFragment=function(){var n=this._lexer.token;this.expectToken(D.TokenKind.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(D.TokenKind.NAME)?{kind:Q.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:Q.Kind.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:Q.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:Q.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},t.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case D.TokenKind.BRACKET_L:return this.parseList(n);case D.TokenKind.BRACE_L:return this.parseObject(n);case D.TokenKind.INT:return this._lexer.advance(),{kind:Q.Kind.INT,value:i.value,loc:this.loc(i)};case D.TokenKind.FLOAT:return this._lexer.advance(),{kind:Q.Kind.FLOAT,value:i.value,loc:this.loc(i)};case D.TokenKind.STRING:case D.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case D.TokenKind.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:Q.Kind.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:Q.Kind.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:Q.Kind.NULL,loc:this.loc(i)};default:return{kind:Q.Kind.ENUM,value:i.value,loc:this.loc(i)}}case D.TokenKind.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},t.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:Q.Kind.STRING,value:n.value,block:n.kind===D.TokenKind.BLOCK_STRING,loc:this.loc(n)}},t.parseList=function(n){var i=this,o=this._lexer.token,s=function(){return i.parseValueLiteral(n)};return{kind:Q.Kind.LIST,values:this.any(D.TokenKind.BRACKET_L,s,D.TokenKind.BRACKET_R),loc:this.loc(o)}},t.parseObject=function(n){var i=this,o=this._lexer.token,s=function(){return i.parseObjectField(n)};return{kind:Q.Kind.OBJECT,fields:this.any(D.TokenKind.BRACE_L,s,D.TokenKind.BRACE_R),loc:this.loc(o)}},t.parseObjectField=function(n){var i=this._lexer.token,o=this.parseName();return this.expectToken(D.TokenKind.COLON),{kind:Q.Kind.OBJECT_FIELD,name:o,value:this.parseValueLiteral(n),loc:this.loc(i)}},t.parseDirectives=function(n){for(var i=[];this.peek(D.TokenKind.AT);)i.push(this.parseDirective(n));return i},t.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(D.TokenKind.AT),{kind:Q.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},t.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(D.TokenKind.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(D.TokenKind.BRACKET_R),i={kind:Q.Kind.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(D.TokenKind.BANG)?{kind:Q.Kind.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},t.parseNamedType=function(){var n=this._lexer.token;return{kind:Q.Kind.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},t.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===D.TokenKind.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()}throw this.unexpected(n)},t.peekDescription=function(){return this.peek(D.TokenKind.STRING)||this.peek(D.TokenKind.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var o=this.parseDirectives(!0),s=this.many(D.TokenKind.BRACE_L,this.parseOperationTypeDefinition,D.TokenKind.BRACE_R);return{kind:Q.Kind.SCHEMA_DEFINITION,description:i,directives:o,operationTypes:s,loc:this.loc(n)}},t.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(D.TokenKind.COLON);var o=this.parseNamedType();return{kind:Q.Kind.OPERATION_TYPE_DEFINITION,operation:i,type:o,loc:this.loc(n)}},t.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var o=this.parseName(),s=this.parseDirectives(!0);return{kind:Q.Kind.SCALAR_TYPE_DEFINITION,description:i,name:o,directives:s,loc:this.loc(n)}},t.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var o=this.parseName(),s=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:Q.Kind.OBJECT_TYPE_DEFINITION,description:i,name:o,interfaces:s,directives:a,fields:u,loc:this.loc(n)}},t.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(D.TokenKind.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(D.TokenKind.AMP)||this.peek(D.TokenKind.NAME));return i}return this.delimitedMany(D.TokenKind.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(D.TokenKind.BRACE_L)&&this._lexer.lookahead().kind===D.TokenKind.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(D.TokenKind.BRACE_L,this.parseFieldDefinition,D.TokenKind.BRACE_R)},t.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName(),s=this.parseArgumentDefs();this.expectToken(D.TokenKind.COLON);var a=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:Q.Kind.FIELD_DEFINITION,description:i,name:o,arguments:s,type:a,directives:u,loc:this.loc(n)}},t.parseArgumentDefs=function(){return this.optionalMany(D.TokenKind.PAREN_L,this.parseInputValueDef,D.TokenKind.PAREN_R)},t.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName();this.expectToken(D.TokenKind.COLON);var s=this.parseTypeReference(),a;this.expectOptionalToken(D.TokenKind.EQUALS)&&(a=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:Q.Kind.INPUT_VALUE_DEFINITION,description:i,name:o,type:s,defaultValue:a,directives:u,loc:this.loc(n)}},t.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var o=this.parseName(),s=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:Q.Kind.INTERFACE_TYPE_DEFINITION,description:i,name:o,interfaces:s,directives:a,fields:u,loc:this.loc(n)}},t.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var o=this.parseName(),s=this.parseDirectives(!0),a=this.parseUnionMemberTypes();return{kind:Q.Kind.UNION_TYPE_DEFINITION,description:i,name:o,directives:s,types:a,loc:this.loc(n)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(D.TokenKind.EQUALS)?this.delimitedMany(D.TokenKind.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var o=this.parseName(),s=this.parseDirectives(!0),a=this.parseEnumValuesDefinition();return{kind:Q.Kind.ENUM_TYPE_DEFINITION,description:i,name:o,directives:s,values:a,loc:this.loc(n)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(D.TokenKind.BRACE_L,this.parseEnumValueDefinition,D.TokenKind.BRACE_R)},t.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName(),s=this.parseDirectives(!0);return{kind:Q.Kind.ENUM_VALUE_DEFINITION,description:i,name:o,directives:s,loc:this.loc(n)}},t.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var o=this.parseName(),s=this.parseDirectives(!0),a=this.parseInputFieldsDefinition();return{kind:Q.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:o,directives:s,fields:a,loc:this.loc(n)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(D.TokenKind.BRACE_L,this.parseInputValueDef,D.TokenKind.BRACE_R)},t.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===D.TokenKind.NAME)switch(n.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(n)},t.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),o=this.optionalMany(D.TokenKind.BRACE_L,this.parseOperationTypeDefinition,D.TokenKind.BRACE_R);if(i.length===0&&o.length===0)throw this.unexpected();return{kind:Q.Kind.SCHEMA_EXTENSION,directives:i,operationTypes:o,loc:this.loc(n)}},t.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),o=this.parseDirectives(!0);if(o.length===0)throw this.unexpected();return{kind:Q.Kind.SCALAR_TYPE_EXTENSION,name:i,directives:o,loc:this.loc(n)}},t.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(o.length===0&&s.length===0&&a.length===0)throw this.unexpected();return{kind:Q.Kind.OBJECT_TYPE_EXTENSION,name:i,interfaces:o,directives:s,fields:a,loc:this.loc(n)}},t.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(o.length===0&&s.length===0&&a.length===0)throw this.unexpected();return{kind:Q.Kind.INTERFACE_TYPE_EXTENSION,name:i,interfaces:o,directives:s,fields:a,loc:this.loc(n)}},t.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();if(o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.Kind.UNION_TYPE_EXTENSION,name:i,directives:o,types:s,loc:this.loc(n)}},t.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();if(o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.Kind.ENUM_TYPE_EXTENSION,name:i,directives:o,values:s,loc:this.loc(n)}},t.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();if(o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:o,fields:s,loc:this.loc(n)}},t.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(D.TokenKind.AT);var o=this.parseName(),s=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:Q.Kind.DIRECTIVE_DEFINITION,description:i,name:o,arguments:s,repeatable:a,locations:u,loc:this.loc(n)}},t.parseDirectiveLocations=function(){return this.delimitedMany(D.TokenKind.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(YU.DirectiveLocation[i.value]!==void 0)return i;throw this.unexpected(n)},t.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new zU.Location(n,this._lexer.lastToken,this._lexer.source)},t.peek=function(n){return this._lexer.token.kind===n},t.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw(0,bd.syntaxError)(this._lexer.source,i.start,"Expected ".concat(WS(n),", found ").concat(Sd(i),"."))},t.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},t.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===D.TokenKind.NAME&&i.value===n)this._lexer.advance();else throw(0,bd.syntaxError)(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(Sd(i),"."))},t.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===D.TokenKind.NAME&&i.value===n?(this._lexer.advance(),!0):!1},t.unexpected=function(n){var i=n??this._lexer.token;return(0,bd.syntaxError)(this._lexer.source,i.start,"Unexpected ".concat(Sd(i),"."))},t.any=function(n,i,o){this.expectToken(n);for(var s=[];!this.expectOptionalToken(o);)s.push(i.call(this));return s},t.optionalMany=function(n,i,o){if(this.expectOptionalToken(n)){var s=[];do s.push(i.call(this));while(!this.expectOptionalToken(o));return s}return[]},t.many=function(n,i,o){this.expectToken(n);var s=[];do s.push(i.call(this));while(!this.expectOptionalToken(o));return s},t.delimitedMany=function(n,i){this.expectOptionalToken(n);var o=[];do o.push(i.call(this));while(this.expectOptionalToken(n));return o},e})();xn.Parser=Iu;function Sd(e){var t=e.value;return WS(e.kind)+(t!=null?' "'.concat(t,'"'):"")}function WS(e){return(0,QS.isPunctuatorTokenKind)(e)?'"'.concat(e,'"'):e}});var Kr=y(Sr=>{"use strict";p();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.visit=rV;Sr.visitInParallel=nV;Sr.getVisitFn=Ou;Sr.BREAK=Sr.QueryDocumentKeys=void 0;var eV=tV(se()),zS=_i();function tV(e){return e&&e.__esModule?e:{default:e}}var YS={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"]};Sr.QueryDocumentKeys=YS;var Oi=Object.freeze({});Sr.BREAK=Oi;function rV(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:YS,n=void 0,i=Array.isArray(e),o=[e],s=-1,a=[],u=void 0,c=void 0,l=void 0,d=[],f=[],h=e;do{s++;var g=s===o.length,v=g&&a.length!==0;if(g){if(c=f.length===0?void 0:d[d.length-1],u=l,l=f.pop(),v){if(i)u=u.slice();else{for(var _={},S=0,b=Object.keys(u);S<b.length;S++){var A=b[S];_[A]=u[A]}u=_}for(var w=0,T=0;T<a.length;T++){var x=a[T][0],U=a[T][1];i&&(x-=w),i&&U===null?(u.splice(x,1),w++):u[x]=U}}s=n.index,o=n.keys,a=n.edits,i=n.inArray,n=n.prev}else{if(c=l?i?s:o[s]:void 0,u=l?l[c]:h,u==null)continue;l&&d.push(c)}var N=void 0;if(!Array.isArray(u)){if(!(0,zS.isNode)(u))throw new Error("Invalid AST Node: ".concat((0,eV.default)(u),"."));var te=Ou(t,u.kind,g);if(te){if(N=te.call(t,u,c,l,d,f),N===Oi)break;if(N===!1){if(!g){d.pop();continue}}else if(N!==void 0&&(a.push([c,N]),!g))if((0,zS.isNode)(N))u=N;else{d.pop();continue}}}if(N===void 0&&v&&a.push([c,u]),g)d.pop();else{var pe;n={inArray:i,index:s,keys:o,edits:a,prev:n},i=Array.isArray(u),o=i?u:(pe=r[u.kind])!==null&&pe!==void 0?pe:[],s=-1,a=[],l&&f.push(l),l=u}}while(n!==void 0);return a.length!==0&&(h=a[a.length-1][1]),h}function nV(e){var t=new Array(e.length);return{enter:function(n){for(var i=0;i<e.length;i++)if(t[i]==null){var o=Ou(e[i],n.kind,!1);if(o){var s=o.apply(e[i],arguments);if(s===!1)t[i]=n;else if(s===Oi)t[i]=Oi;else if(s!==void 0)return s}}},leave:function(n){for(var i=0;i<e.length;i++)if(t[i]==null){var o=Ou(e[i],n.kind,!0);if(o){var s=o.apply(e[i],arguments);if(s===Oi)t[i]=Oi;else if(s!==void 0&&s!==!1)return s}}else t[i]===n&&(t[i]=null)}}}function Ou(e,t,r){var n=e[t];if(n){if(!r&&typeof n=="function")return n;var i=r?n.leave:n.enter;if(typeof i=="function")return i}else{var o=r?e.leave:e.enter;if(o){if(typeof o=="function")return o;var s=o[t];if(typeof s=="function")return s}}}});var wi=y(wu=>{"use strict";p();Object.defineProperty(wu,"__esModule",{value:!0});wu.default=void 0;var iV=Array.prototype.find?function(e,t){return Array.prototype.find.call(e,t)}:function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t(n))return n}},oV=iV;wu.default=oV});var bt=y(Au=>{"use strict";p();Object.defineProperty(Au,"__esModule",{value:!0});Au.default=void 0;var sV=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},aV=sV;Au.default=aV});var zo=y(Td=>{"use strict";p();Object.defineProperty(Td,"__esModule",{value:!0});Td.locatedError=pV;var uV=lV(se()),cV=K();function lV(e){return e&&e.__esModule?e:{default:e}}function pV(e,t,r){var n,i=e instanceof Error?e:new Error("Unexpected error value: "+(0,uV.default)(e));return Array.isArray(i.path)?i:new cV.GraphQLError(i.message,(n=i.nodes)!==null&&n!==void 0?n:t,i.source,i.positions,r,i)}});var Id=y(xu=>{"use strict";p();Object.defineProperty(xu,"__esModule",{value:!0});xu.assertValidName=mV;xu.isValidNameError=XS;var dV=fV(jt()),JS=K();function fV(e){return e&&e.__esModule?e:{default:e}}var hV=/^[_a-zA-Z][_a-zA-Z0-9]*$/;function mV(e){var t=XS(e);if(t)throw t;return e}function XS(e){if(typeof e=="string"||(0,dV.default)(0,"Expected name to be a string."),e.length>1&&e[0]==="_"&&e[1]==="_")return new JS.GraphQLError('Name "'.concat(e,'" must not begin with "__", which is reserved by GraphQL introspection.'));if(!hV.test(e))return new JS.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(e,'" does not.'))}});var Ai=y(Nu=>{"use strict";p();Object.defineProperty(Nu,"__esModule",{value:!0});Nu.default=void 0;var gV=Object.entries||function(e){return Object.keys(e).map(function(t){return[t,e[t]]})},yV=gV;Nu.default=yV});var Hr=y(Od=>{"use strict";p();Object.defineProperty(Od,"__esModule",{value:!0});Od.default=vV;function vV(e,t){return e.reduce(function(r,n){return r[t(n)]=n,r},Object.create(null))}});var Ad=y(wd=>{"use strict";p();Object.defineProperty(wd,"__esModule",{value:!0});wd.default=bV;var EV=_V(Ai());function _V(e){return e&&e.__esModule?e:{default:e}}function bV(e,t){for(var r=Object.create(null),n=0,i=(0,EV.default)(e);n<i.length;n++){var o=i[n],s=o[0],a=o[1];r[s]=t(a,s)}return r}});var Ru=y(xd=>{"use strict";p();Object.defineProperty(xd,"__esModule",{value:!0});xd.default=IV;var SV=TV(Ai());function TV(e){return e&&e.__esModule?e:{default:e}}function IV(e){if(Object.getPrototypeOf(e)===null)return e;for(var t=Object.create(null),r=0,n=(0,SV.default)(e);r<n.length;r++){var i=n[r],o=i[0],s=i[1];t[o]=s}return t}});var Yo=y(Nd=>{"use strict";p();Object.defineProperty(Nd,"__esModule",{value:!0});Nd.default=OV;function OV(e,t,r){return e.reduce(function(n,i){return n[t(i)]=r(i),n},Object.create(null))}});var Qr=y(Rd=>{"use strict";p();Object.defineProperty(Rd,"__esModule",{value:!0});Rd.default=AV;var wV=5;function AV(e,t){var r=typeof e=="string"?[e,t]:[void 0,e],n=r[0],i=r[1],o=" Did you mean ";n&&(o+=n+" ");var s=i.map(function(c){return'"'.concat(c,'"')});switch(s.length){case 0:return"";case 1:return o+s[0]+"?";case 2:return o+s[0]+" or "+s[1]+"?"}var a=s.slice(0,wV),u=a.pop();return o+a.join(", ")+", or "+u+"?"}});var ZS=y(Cd=>{"use strict";p();Object.defineProperty(Cd,"__esModule",{value:!0});Cd.default=xV;function xV(e){return e}});var Jo=y(Dd=>{"use strict";p();Object.defineProperty(Dd,"__esModule",{value:!0});Dd.default=NV;function NV(e,t){for(var r=0,n=0;r<e.length&&n<t.length;){var i=e.charCodeAt(r),o=t.charCodeAt(n);if(Cu(i)&&Cu(o)){var s=0;do++r,s=s*10+i-Pd,i=e.charCodeAt(r);while(Cu(i)&&s>0);var a=0;do++n,a=a*10+o-Pd,o=t.charCodeAt(n);while(Cu(o)&&a>0);if(s<a)return-1;if(s>a)return 1}else{if(i<o)return-1;if(i>o)return 1;++r,++n}}return e.length-t.length}var Pd=48,RV=57;function Cu(e){return!isNaN(e)&&Pd<=e&&e<=RV}});var Wr=y(Ld=>{"use strict";p();Object.defineProperty(Ld,"__esModule",{value:!0});Ld.default=DV;var CV=PV(Jo());function PV(e){return e&&e.__esModule?e:{default:e}}function DV(e,t){for(var r=Object.create(null),n=new LV(e),i=Math.floor(e.length*.4)+1,o=0;o<t.length;o++){var s=t[o],a=n.measure(s,i);a!==void 0&&(r[s]=a)}return Object.keys(r).sort(function(u,c){var l=r[u]-r[c];return l!==0?l:(0,CV.default)(u,c)})}var LV=(function(){function e(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=eT(this._inputLowerCase),this._rows=[new Array(r.length+1).fill(0),new Array(r.length+1).fill(0),new Array(r.length+1).fill(0)]}var t=e.prototype;return t.measure=function(n,i){if(this._input===n)return 0;var o=n.toLowerCase();if(this._inputLowerCase===o)return 1;var s=eT(o),a=this._inputArray;if(s.length<a.length){var u=s;s=a,a=u}var c=s.length,l=a.length;if(!(c-l>i)){for(var d=this._rows,f=0;f<=l;f++)d[0][f]=f;for(var h=1;h<=c;h++){for(var g=d[(h-1)%3],v=d[h%3],_=v[0]=h,S=1;S<=l;S++){var b=s[h-1]===a[S-1]?0:1,A=Math.min(g[S]+1,v[S-1]+1,g[S-1]+b);if(h>1&&S>1&&s[h-1]===a[S-2]&&s[h-2]===a[S-1]){var w=d[(h-2)%3][S-2];A=Math.min(A,w+1)}A<_&&(_=A),v[S]=A}if(_>i)return}var T=d[c%3][l];return T<=i?T:void 0}},e})();function eT(e){for(var t=e.length,r=new Array(t),n=0;n<t;++n)r[n]=e.charCodeAt(n);return r}});var mt=y(kd=>{"use strict";p();Object.defineProperty(kd,"__esModule",{value:!0});kd.print=MV;var kV=Kr(),jV=Ti();function MV(e){return(0,kV.visit)(e,{leave:qV})}var FV=80,qV={Name:function(t){return t.value},Variable:function(t){return"$"+t.name},Document:function(t){return F(t.definitions,`
|
|
52
|
+
`),'"""'+u.replace(/"""/g,'\\"""')+'"""'}});var wu=y(zo=>{"use strict";p();Object.defineProperty(zo,"__esModule",{value:!0});zo.isPunctuatorTokenKind=QU;zo.Lexer=void 0;var cr=fu(),ke=bi(),Z=Si(),KU=Ii(),HU=(function(){function e(r){var n=new ke.Token(Z.TokenKind.SOF,0,0,0,0,null);this.source=r,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}var t=e.prototype;return t.advance=function(){this.lastToken=this.token;var n=this.token=this.lookahead();return n},t.lookahead=function(){var n=this.token;if(n.kind!==Z.TokenKind.EOF)do{var i;n=(i=n.next)!==null&&i!==void 0?i:n.next=WU(this,n)}while(n.kind===Z.TokenKind.COMMENT);return n},e})();zo.Lexer=HU;function QU(e){return e===Z.TokenKind.BANG||e===Z.TokenKind.DOLLAR||e===Z.TokenKind.AMP||e===Z.TokenKind.PAREN_L||e===Z.TokenKind.PAREN_R||e===Z.TokenKind.SPREAD||e===Z.TokenKind.COLON||e===Z.TokenKind.EQUALS||e===Z.TokenKind.AT||e===Z.TokenKind.BRACKET_L||e===Z.TokenKind.BRACKET_R||e===Z.TokenKind.BRACE_L||e===Z.TokenKind.PIPE||e===Z.TokenKind.BRACE_R}function xn(e){return isNaN(e)?Z.TokenKind.EOF:e<127?JSON.stringify(String.fromCharCode(e)):'"\\u'.concat(("00"+e.toString(16).toUpperCase()).slice(-4),'"')}function WU(e,t){for(var r=e.source,n=r.body,i=n.length,o=t.end;o<i;){var s=n.charCodeAt(o),a=e.line,u=1+o-e.lineStart;switch(s){case 65279:case 9:case 32:case 44:++o;continue;case 10:++o,++e.line,e.lineStart=o;continue;case 13:n.charCodeAt(o+1)===10?o+=2:++o,++e.line,e.lineStart=o;continue;case 33:return new ke.Token(Z.TokenKind.BANG,o,o+1,a,u,t);case 35:return YU(r,o,a,u,t);case 36:return new ke.Token(Z.TokenKind.DOLLAR,o,o+1,a,u,t);case 38:return new ke.Token(Z.TokenKind.AMP,o,o+1,a,u,t);case 40:return new ke.Token(Z.TokenKind.PAREN_L,o,o+1,a,u,t);case 41:return new ke.Token(Z.TokenKind.PAREN_R,o,o+1,a,u,t);case 46:if(n.charCodeAt(o+1)===46&&n.charCodeAt(o+2)===46)return new ke.Token(Z.TokenKind.SPREAD,o,o+3,a,u,t);break;case 58:return new ke.Token(Z.TokenKind.COLON,o,o+1,a,u,t);case 61:return new ke.Token(Z.TokenKind.EQUALS,o,o+1,a,u,t);case 64:return new ke.Token(Z.TokenKind.AT,o,o+1,a,u,t);case 91:return new ke.Token(Z.TokenKind.BRACKET_L,o,o+1,a,u,t);case 93:return new ke.Token(Z.TokenKind.BRACKET_R,o,o+1,a,u,t);case 123:return new ke.Token(Z.TokenKind.BRACE_L,o,o+1,a,u,t);case 124:return new ke.Token(Z.TokenKind.PIPE,o,o+1,a,u,t);case 125:return new ke.Token(Z.TokenKind.BRACE_R,o,o+1,a,u,t);case 34:return n.charCodeAt(o+1)===34&&n.charCodeAt(o+2)===34?ZU(r,o,a,u,t,e):XU(r,o,a,u,t);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return JU(r,o,s,a,u,t);case 65:case 66:case 67:case 68:case 69:case 70:case 71:case 72:case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:case 81:case 82:case 83:case 84:case 85:case 86:case 87:case 88:case 89:case 90:case 95:case 97:case 98:case 99:case 100:case 101:case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:case 115:case 116:case 117:case 118:case 119:case 120:case 121:case 122:return tV(r,o,a,u,t)}throw(0,cr.syntaxError)(r,o,zU(s))}var c=e.line,l=1+o-e.lineStart;return new ke.Token(Z.TokenKind.EOF,i,i,c,l,t)}function zU(e){return e<32&&e!==9&&e!==10&&e!==13?"Cannot contain the invalid character ".concat(xn(e),"."):e===39?`Unexpected single quote character ('), did you mean to use a double quote (")?`:"Cannot parse the unexpected character ".concat(xn(e),".")}function YU(e,t,r,n,i){var o=e.body,s,a=t;do s=o.charCodeAt(++a);while(!isNaN(s)&&(s>31||s===9));return new ke.Token(Z.TokenKind.COMMENT,t,a,r,n,i,o.slice(t+1,a))}function JU(e,t,r,n,i,o){var s=e.body,a=r,u=t,c=!1;if(a===45&&(a=s.charCodeAt(++u)),a===48){if(a=s.charCodeAt(++u),a>=48&&a<=57)throw(0,cr.syntaxError)(e,u,"Invalid number, unexpected digit after 0: ".concat(xn(a),"."))}else u=Td(e,u,a),a=s.charCodeAt(u);if(a===46&&(c=!0,a=s.charCodeAt(++u),u=Td(e,u,a),a=s.charCodeAt(u)),(a===69||a===101)&&(c=!0,a=s.charCodeAt(++u),(a===43||a===45)&&(a=s.charCodeAt(++u)),u=Td(e,u,a),a=s.charCodeAt(u)),a===46||rV(a))throw(0,cr.syntaxError)(e,u,"Invalid number, expected digit but got: ".concat(xn(a),"."));return new ke.Token(c?Z.TokenKind.FLOAT:Z.TokenKind.INT,t,u,n,i,o,s.slice(t,u))}function Td(e,t,r){var n=e.body,i=t,o=r;if(o>=48&&o<=57){do o=n.charCodeAt(++i);while(o>=48&&o<=57);return i}throw(0,cr.syntaxError)(e,i,"Invalid number, expected digit but got: ".concat(xn(o),"."))}function XU(e,t,r,n,i){for(var o=e.body,s=t+1,a=s,u=0,c="";s<o.length&&!isNaN(u=o.charCodeAt(s))&&u!==10&&u!==13;){if(u===34)return c+=o.slice(a,s),new ke.Token(Z.TokenKind.STRING,t,s+1,r,n,i,c);if(u<32&&u!==9)throw(0,cr.syntaxError)(e,s,"Invalid character within String: ".concat(xn(u),"."));if(++s,u===92){switch(c+=o.slice(a,s-1),u=o.charCodeAt(s),u){case 34:c+='"';break;case 47:c+="/";break;case 92:c+="\\";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
|
|
53
|
+
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:{var l=eV(o.charCodeAt(s+1),o.charCodeAt(s+2),o.charCodeAt(s+3),o.charCodeAt(s+4));if(l<0){var d=o.slice(s+1,s+5);throw(0,cr.syntaxError)(e,s,"Invalid character escape sequence: \\u".concat(d,"."))}c+=String.fromCharCode(l),s+=4;break}default:throw(0,cr.syntaxError)(e,s,"Invalid character escape sequence: \\".concat(String.fromCharCode(u),"."))}++s,a=s}}throw(0,cr.syntaxError)(e,s,"Unterminated string.")}function ZU(e,t,r,n,i,o){for(var s=e.body,a=t+3,u=a,c=0,l="";a<s.length&&!isNaN(c=s.charCodeAt(a));){if(c===34&&s.charCodeAt(a+1)===34&&s.charCodeAt(a+2)===34)return l+=s.slice(u,a),new ke.Token(Z.TokenKind.BLOCK_STRING,t,a+3,r,n,i,(0,KU.dedentBlockStringValue)(l));if(c<32&&c!==9&&c!==10&&c!==13)throw(0,cr.syntaxError)(e,a,"Invalid character within String: ".concat(xn(c),"."));c===10?(++a,++o.line,o.lineStart=a):c===13?(s.charCodeAt(a+1)===10?a+=2:++a,++o.line,o.lineStart=a):c===92&&s.charCodeAt(a+1)===34&&s.charCodeAt(a+2)===34&&s.charCodeAt(a+3)===34?(l+=s.slice(u,a)+'"""',a+=4,u=a):++a}throw(0,cr.syntaxError)(e,a,"Unterminated string.")}function eV(e,t,r,n){return Iu(e)<<12|Iu(t)<<8|Iu(r)<<4|Iu(n)}function Iu(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function tV(e,t,r,n,i){for(var o=e.body,s=o.length,a=t+1,u=0;a!==s&&!isNaN(u=o.charCodeAt(a))&&(u===95||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122);)++a;return new ke.Token(Z.TokenKind.NAME,t,a,r,n,i,o.slice(t,a))}function rV(e){return e===95||e>=65&&e<=90||e>=97&&e<=122}});var wi=y(Nn=>{"use strict";p();Object.defineProperty(Nn,"__esModule",{value:!0});Nn.parse=oV;Nn.parseValue=sV;Nn.parseType=aV;Nn.Parser=void 0;var Id=fu(),Q=Ee(),nV=bi(),D=Si(),JS=Su(),iV=Ti(),XS=wu();function oV(e,t){var r=new Ou(e,t);return r.parseDocument()}function sV(e,t){var r=new Ou(e,t);r.expectToken(D.TokenKind.SOF);var n=r.parseValueLiteral(!1);return r.expectToken(D.TokenKind.EOF),n}function aV(e,t){var r=new Ou(e,t);r.expectToken(D.TokenKind.SOF);var n=r.parseTypeReference();return r.expectToken(D.TokenKind.EOF),n}var Ou=(function(){function e(r,n){var i=(0,JS.isSource)(r)?r:new JS.Source(r);this._lexer=new XS.Lexer(i),this._options=n}var t=e.prototype;return t.parseName=function(){var n=this.expectToken(D.TokenKind.NAME);return{kind:Q.Kind.NAME,value:n.value,loc:this.loc(n)}},t.parseDocument=function(){var n=this._lexer.token;return{kind:Q.Kind.DOCUMENT,definitions:this.many(D.TokenKind.SOF,this.parseDefinition,D.TokenKind.EOF),loc:this.loc(n)}},t.parseDefinition=function(){if(this.peek(D.TokenKind.NAME))switch(this._lexer.token.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"schema":case"scalar":case"type":case"interface":case"union":case"enum":case"input":case"directive":return this.parseTypeSystemDefinition();case"extend":return this.parseTypeSystemExtension()}else{if(this.peek(D.TokenKind.BRACE_L))return this.parseOperationDefinition();if(this.peekDescription())return this.parseTypeSystemDefinition()}throw this.unexpected()},t.parseOperationDefinition=function(){var n=this._lexer.token;if(this.peek(D.TokenKind.BRACE_L))return{kind:Q.Kind.OPERATION_DEFINITION,operation:"query",name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet(),loc:this.loc(n)};var i=this.parseOperationType(),o;return this.peek(D.TokenKind.NAME)&&(o=this.parseName()),{kind:Q.Kind.OPERATION_DEFINITION,operation:i,name:o,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.parseOperationType=function(){var n=this.expectToken(D.TokenKind.NAME);switch(n.value){case"query":return"query";case"mutation":return"mutation";case"subscription":return"subscription"}throw this.unexpected(n)},t.parseVariableDefinitions=function(){return this.optionalMany(D.TokenKind.PAREN_L,this.parseVariableDefinition,D.TokenKind.PAREN_R)},t.parseVariableDefinition=function(){var n=this._lexer.token;return{kind:Q.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(D.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(D.TokenKind.EQUALS)?this.parseValueLiteral(!0):void 0,directives:this.parseDirectives(!0),loc:this.loc(n)}},t.parseVariable=function(){var n=this._lexer.token;return this.expectToken(D.TokenKind.DOLLAR),{kind:Q.Kind.VARIABLE,name:this.parseName(),loc:this.loc(n)}},t.parseSelectionSet=function(){var n=this._lexer.token;return{kind:Q.Kind.SELECTION_SET,selections:this.many(D.TokenKind.BRACE_L,this.parseSelection,D.TokenKind.BRACE_R),loc:this.loc(n)}},t.parseSelection=function(){return this.peek(D.TokenKind.SPREAD)?this.parseFragment():this.parseField()},t.parseField=function(){var n=this._lexer.token,i=this.parseName(),o,s;return this.expectOptionalToken(D.TokenKind.COLON)?(o=i,s=this.parseName()):s=i,{kind:Q.Kind.FIELD,alias:o,name:s,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(D.TokenKind.BRACE_L)?this.parseSelectionSet():void 0,loc:this.loc(n)}},t.parseArguments=function(n){var i=n?this.parseConstArgument:this.parseArgument;return this.optionalMany(D.TokenKind.PAREN_L,i,D.TokenKind.PAREN_R)},t.parseArgument=function(){var n=this._lexer.token,i=this.parseName();return this.expectToken(D.TokenKind.COLON),{kind:Q.Kind.ARGUMENT,name:i,value:this.parseValueLiteral(!1),loc:this.loc(n)}},t.parseConstArgument=function(){var n=this._lexer.token;return{kind:Q.Kind.ARGUMENT,name:this.parseName(),value:(this.expectToken(D.TokenKind.COLON),this.parseValueLiteral(!0)),loc:this.loc(n)}},t.parseFragment=function(){var n=this._lexer.token;this.expectToken(D.TokenKind.SPREAD);var i=this.expectOptionalKeyword("on");return!i&&this.peek(D.TokenKind.NAME)?{kind:Q.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1),loc:this.loc(n)}:{kind:Q.Kind.INLINE_FRAGMENT,typeCondition:i?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(n)}},t.parseFragmentDefinition=function(){var n,i=this._lexer.token;return this.expectKeyword("fragment"),((n=this._options)===null||n===void 0?void 0:n.experimentalFragmentVariables)===!0?{kind:Q.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}:{kind:Q.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet(),loc:this.loc(i)}},t.parseFragmentName=function(){if(this._lexer.token.value==="on")throw this.unexpected();return this.parseName()},t.parseValueLiteral=function(n){var i=this._lexer.token;switch(i.kind){case D.TokenKind.BRACKET_L:return this.parseList(n);case D.TokenKind.BRACE_L:return this.parseObject(n);case D.TokenKind.INT:return this._lexer.advance(),{kind:Q.Kind.INT,value:i.value,loc:this.loc(i)};case D.TokenKind.FLOAT:return this._lexer.advance(),{kind:Q.Kind.FLOAT,value:i.value,loc:this.loc(i)};case D.TokenKind.STRING:case D.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case D.TokenKind.NAME:switch(this._lexer.advance(),i.value){case"true":return{kind:Q.Kind.BOOLEAN,value:!0,loc:this.loc(i)};case"false":return{kind:Q.Kind.BOOLEAN,value:!1,loc:this.loc(i)};case"null":return{kind:Q.Kind.NULL,loc:this.loc(i)};default:return{kind:Q.Kind.ENUM,value:i.value,loc:this.loc(i)}}case D.TokenKind.DOLLAR:if(!n)return this.parseVariable();break}throw this.unexpected()},t.parseStringLiteral=function(){var n=this._lexer.token;return this._lexer.advance(),{kind:Q.Kind.STRING,value:n.value,block:n.kind===D.TokenKind.BLOCK_STRING,loc:this.loc(n)}},t.parseList=function(n){var i=this,o=this._lexer.token,s=function(){return i.parseValueLiteral(n)};return{kind:Q.Kind.LIST,values:this.any(D.TokenKind.BRACKET_L,s,D.TokenKind.BRACKET_R),loc:this.loc(o)}},t.parseObject=function(n){var i=this,o=this._lexer.token,s=function(){return i.parseObjectField(n)};return{kind:Q.Kind.OBJECT,fields:this.any(D.TokenKind.BRACE_L,s,D.TokenKind.BRACE_R),loc:this.loc(o)}},t.parseObjectField=function(n){var i=this._lexer.token,o=this.parseName();return this.expectToken(D.TokenKind.COLON),{kind:Q.Kind.OBJECT_FIELD,name:o,value:this.parseValueLiteral(n),loc:this.loc(i)}},t.parseDirectives=function(n){for(var i=[];this.peek(D.TokenKind.AT);)i.push(this.parseDirective(n));return i},t.parseDirective=function(n){var i=this._lexer.token;return this.expectToken(D.TokenKind.AT),{kind:Q.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(n),loc:this.loc(i)}},t.parseTypeReference=function(){var n=this._lexer.token,i;return this.expectOptionalToken(D.TokenKind.BRACKET_L)?(i=this.parseTypeReference(),this.expectToken(D.TokenKind.BRACKET_R),i={kind:Q.Kind.LIST_TYPE,type:i,loc:this.loc(n)}):i=this.parseNamedType(),this.expectOptionalToken(D.TokenKind.BANG)?{kind:Q.Kind.NON_NULL_TYPE,type:i,loc:this.loc(n)}:i},t.parseNamedType=function(){var n=this._lexer.token;return{kind:Q.Kind.NAMED_TYPE,name:this.parseName(),loc:this.loc(n)}},t.parseTypeSystemDefinition=function(){var n=this.peekDescription()?this._lexer.lookahead():this._lexer.token;if(n.kind===D.TokenKind.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()}throw this.unexpected(n)},t.peekDescription=function(){return this.peek(D.TokenKind.STRING)||this.peek(D.TokenKind.BLOCK_STRING)},t.parseDescription=function(){if(this.peekDescription())return this.parseStringLiteral()},t.parseSchemaDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("schema");var o=this.parseDirectives(!0),s=this.many(D.TokenKind.BRACE_L,this.parseOperationTypeDefinition,D.TokenKind.BRACE_R);return{kind:Q.Kind.SCHEMA_DEFINITION,description:i,directives:o,operationTypes:s,loc:this.loc(n)}},t.parseOperationTypeDefinition=function(){var n=this._lexer.token,i=this.parseOperationType();this.expectToken(D.TokenKind.COLON);var o=this.parseNamedType();return{kind:Q.Kind.OPERATION_TYPE_DEFINITION,operation:i,type:o,loc:this.loc(n)}},t.parseScalarTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("scalar");var o=this.parseName(),s=this.parseDirectives(!0);return{kind:Q.Kind.SCALAR_TYPE_DEFINITION,description:i,name:o,directives:s,loc:this.loc(n)}},t.parseObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("type");var o=this.parseName(),s=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:Q.Kind.OBJECT_TYPE_DEFINITION,description:i,name:o,interfaces:s,directives:a,fields:u,loc:this.loc(n)}},t.parseImplementsInterfaces=function(){var n;if(!this.expectOptionalKeyword("implements"))return[];if(((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLImplementsInterfaces)===!0){var i=[];this.expectOptionalToken(D.TokenKind.AMP);do i.push(this.parseNamedType());while(this.expectOptionalToken(D.TokenKind.AMP)||this.peek(D.TokenKind.NAME));return i}return this.delimitedMany(D.TokenKind.AMP,this.parseNamedType)},t.parseFieldsDefinition=function(){var n;return((n=this._options)===null||n===void 0?void 0:n.allowLegacySDLEmptyFields)===!0&&this.peek(D.TokenKind.BRACE_L)&&this._lexer.lookahead().kind===D.TokenKind.BRACE_R?(this._lexer.advance(),this._lexer.advance(),[]):this.optionalMany(D.TokenKind.BRACE_L,this.parseFieldDefinition,D.TokenKind.BRACE_R)},t.parseFieldDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName(),s=this.parseArgumentDefs();this.expectToken(D.TokenKind.COLON);var a=this.parseTypeReference(),u=this.parseDirectives(!0);return{kind:Q.Kind.FIELD_DEFINITION,description:i,name:o,arguments:s,type:a,directives:u,loc:this.loc(n)}},t.parseArgumentDefs=function(){return this.optionalMany(D.TokenKind.PAREN_L,this.parseInputValueDef,D.TokenKind.PAREN_R)},t.parseInputValueDef=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName();this.expectToken(D.TokenKind.COLON);var s=this.parseTypeReference(),a;this.expectOptionalToken(D.TokenKind.EQUALS)&&(a=this.parseValueLiteral(!0));var u=this.parseDirectives(!0);return{kind:Q.Kind.INPUT_VALUE_DEFINITION,description:i,name:o,type:s,defaultValue:a,directives:u,loc:this.loc(n)}},t.parseInterfaceTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("interface");var o=this.parseName(),s=this.parseImplementsInterfaces(),a=this.parseDirectives(!0),u=this.parseFieldsDefinition();return{kind:Q.Kind.INTERFACE_TYPE_DEFINITION,description:i,name:o,interfaces:s,directives:a,fields:u,loc:this.loc(n)}},t.parseUnionTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("union");var o=this.parseName(),s=this.parseDirectives(!0),a=this.parseUnionMemberTypes();return{kind:Q.Kind.UNION_TYPE_DEFINITION,description:i,name:o,directives:s,types:a,loc:this.loc(n)}},t.parseUnionMemberTypes=function(){return this.expectOptionalToken(D.TokenKind.EQUALS)?this.delimitedMany(D.TokenKind.PIPE,this.parseNamedType):[]},t.parseEnumTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("enum");var o=this.parseName(),s=this.parseDirectives(!0),a=this.parseEnumValuesDefinition();return{kind:Q.Kind.ENUM_TYPE_DEFINITION,description:i,name:o,directives:s,values:a,loc:this.loc(n)}},t.parseEnumValuesDefinition=function(){return this.optionalMany(D.TokenKind.BRACE_L,this.parseEnumValueDefinition,D.TokenKind.BRACE_R)},t.parseEnumValueDefinition=function(){var n=this._lexer.token,i=this.parseDescription(),o=this.parseName(),s=this.parseDirectives(!0);return{kind:Q.Kind.ENUM_VALUE_DEFINITION,description:i,name:o,directives:s,loc:this.loc(n)}},t.parseInputObjectTypeDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("input");var o=this.parseName(),s=this.parseDirectives(!0),a=this.parseInputFieldsDefinition();return{kind:Q.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:i,name:o,directives:s,fields:a,loc:this.loc(n)}},t.parseInputFieldsDefinition=function(){return this.optionalMany(D.TokenKind.BRACE_L,this.parseInputValueDef,D.TokenKind.BRACE_R)},t.parseTypeSystemExtension=function(){var n=this._lexer.lookahead();if(n.kind===D.TokenKind.NAME)switch(n.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(n)},t.parseSchemaExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");var i=this.parseDirectives(!0),o=this.optionalMany(D.TokenKind.BRACE_L,this.parseOperationTypeDefinition,D.TokenKind.BRACE_R);if(i.length===0&&o.length===0)throw this.unexpected();return{kind:Q.Kind.SCHEMA_EXTENSION,directives:i,operationTypes:o,loc:this.loc(n)}},t.parseScalarTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");var i=this.parseName(),o=this.parseDirectives(!0);if(o.length===0)throw this.unexpected();return{kind:Q.Kind.SCALAR_TYPE_EXTENSION,name:i,directives:o,loc:this.loc(n)}},t.parseObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");var i=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(o.length===0&&s.length===0&&a.length===0)throw this.unexpected();return{kind:Q.Kind.OBJECT_TYPE_EXTENSION,name:i,interfaces:o,directives:s,fields:a,loc:this.loc(n)}},t.parseInterfaceTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");var i=this.parseName(),o=this.parseImplementsInterfaces(),s=this.parseDirectives(!0),a=this.parseFieldsDefinition();if(o.length===0&&s.length===0&&a.length===0)throw this.unexpected();return{kind:Q.Kind.INTERFACE_TYPE_EXTENSION,name:i,interfaces:o,directives:s,fields:a,loc:this.loc(n)}},t.parseUnionTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");var i=this.parseName(),o=this.parseDirectives(!0),s=this.parseUnionMemberTypes();if(o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.Kind.UNION_TYPE_EXTENSION,name:i,directives:o,types:s,loc:this.loc(n)}},t.parseEnumTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");var i=this.parseName(),o=this.parseDirectives(!0),s=this.parseEnumValuesDefinition();if(o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.Kind.ENUM_TYPE_EXTENSION,name:i,directives:o,values:s,loc:this.loc(n)}},t.parseInputObjectTypeExtension=function(){var n=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");var i=this.parseName(),o=this.parseDirectives(!0),s=this.parseInputFieldsDefinition();if(o.length===0&&s.length===0)throw this.unexpected();return{kind:Q.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:i,directives:o,fields:s,loc:this.loc(n)}},t.parseDirectiveDefinition=function(){var n=this._lexer.token,i=this.parseDescription();this.expectKeyword("directive"),this.expectToken(D.TokenKind.AT);var o=this.parseName(),s=this.parseArgumentDefs(),a=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");var u=this.parseDirectiveLocations();return{kind:Q.Kind.DIRECTIVE_DEFINITION,description:i,name:o,arguments:s,repeatable:a,locations:u,loc:this.loc(n)}},t.parseDirectiveLocations=function(){return this.delimitedMany(D.TokenKind.PIPE,this.parseDirectiveLocation)},t.parseDirectiveLocation=function(){var n=this._lexer.token,i=this.parseName();if(iV.DirectiveLocation[i.value]!==void 0)return i;throw this.unexpected(n)},t.loc=function(n){var i;if(((i=this._options)===null||i===void 0?void 0:i.noLocation)!==!0)return new nV.Location(n,this._lexer.lastToken,this._lexer.source)},t.peek=function(n){return this._lexer.token.kind===n},t.expectToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i;throw(0,Id.syntaxError)(this._lexer.source,i.start,"Expected ".concat(ZS(n),", found ").concat(wd(i),"."))},t.expectOptionalToken=function(n){var i=this._lexer.token;if(i.kind===n)return this._lexer.advance(),i},t.expectKeyword=function(n){var i=this._lexer.token;if(i.kind===D.TokenKind.NAME&&i.value===n)this._lexer.advance();else throw(0,Id.syntaxError)(this._lexer.source,i.start,'Expected "'.concat(n,'", found ').concat(wd(i),"."))},t.expectOptionalKeyword=function(n){var i=this._lexer.token;return i.kind===D.TokenKind.NAME&&i.value===n?(this._lexer.advance(),!0):!1},t.unexpected=function(n){var i=n??this._lexer.token;return(0,Id.syntaxError)(this._lexer.source,i.start,"Unexpected ".concat(wd(i),"."))},t.any=function(n,i,o){this.expectToken(n);for(var s=[];!this.expectOptionalToken(o);)s.push(i.call(this));return s},t.optionalMany=function(n,i,o){if(this.expectOptionalToken(n)){var s=[];do s.push(i.call(this));while(!this.expectOptionalToken(o));return s}return[]},t.many=function(n,i,o){this.expectToken(n);var s=[];do s.push(i.call(this));while(!this.expectOptionalToken(o));return s},t.delimitedMany=function(n,i){this.expectOptionalToken(n);var o=[];do o.push(i.call(this));while(this.expectOptionalToken(n));return o},e})();Nn.Parser=Ou;function wd(e){var t=e.value;return ZS(e.kind)+(t!=null?' "'.concat(t,'"'):"")}function ZS(e){return(0,XS.isPunctuatorTokenKind)(e)?'"'.concat(e,'"'):e}});var Kr=y(Sr=>{"use strict";p();Object.defineProperty(Sr,"__esModule",{value:!0});Sr.visit=lV;Sr.visitInParallel=pV;Sr.getVisitFn=Au;Sr.BREAK=Sr.QueryDocumentKeys=void 0;var uV=cV(se()),eT=bi();function cV(e){return e&&e.__esModule?e:{default:e}}var tT={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"]};Sr.QueryDocumentKeys=tT;var Oi=Object.freeze({});Sr.BREAK=Oi;function lV(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:tT,n=void 0,i=Array.isArray(e),o=[e],s=-1,a=[],u=void 0,c=void 0,l=void 0,d=[],f=[],h=e;do{s++;var g=s===o.length,v=g&&a.length!==0;if(g){if(c=f.length===0?void 0:d[d.length-1],u=l,l=f.pop(),v){if(i)u=u.slice();else{for(var _={},S=0,b=Object.keys(u);S<b.length;S++){var A=b[S];_[A]=u[A]}u=_}for(var O=0,T=0;T<a.length;T++){var x=a[T][0],U=a[T][1];i&&(x-=O),i&&U===null?(u.splice(x,1),O++):u[x]=U}}s=n.index,o=n.keys,a=n.edits,i=n.inArray,n=n.prev}else{if(c=l?i?s:o[s]:void 0,u=l?l[c]:h,u==null)continue;l&&d.push(c)}var N=void 0;if(!Array.isArray(u)){if(!(0,eT.isNode)(u))throw new Error("Invalid AST Node: ".concat((0,uV.default)(u),"."));var te=Au(t,u.kind,g);if(te){if(N=te.call(t,u,c,l,d,f),N===Oi)break;if(N===!1){if(!g){d.pop();continue}}else if(N!==void 0&&(a.push([c,N]),!g))if((0,eT.isNode)(N))u=N;else{d.pop();continue}}}if(N===void 0&&v&&a.push([c,u]),g)d.pop();else{var pe;n={inArray:i,index:s,keys:o,edits:a,prev:n},i=Array.isArray(u),o=i?u:(pe=r[u.kind])!==null&&pe!==void 0?pe:[],s=-1,a=[],l&&f.push(l),l=u}}while(n!==void 0);return a.length!==0&&(h=a[a.length-1][1]),h}function pV(e){var t=new Array(e.length);return{enter:function(n){for(var i=0;i<e.length;i++)if(t[i]==null){var o=Au(e[i],n.kind,!1);if(o){var s=o.apply(e[i],arguments);if(s===!1)t[i]=n;else if(s===Oi)t[i]=Oi;else if(s!==void 0)return s}}},leave:function(n){for(var i=0;i<e.length;i++)if(t[i]==null){var o=Au(e[i],n.kind,!0);if(o){var s=o.apply(e[i],arguments);if(s===Oi)t[i]=Oi;else if(s!==void 0&&s!==!1)return s}}else t[i]===n&&(t[i]=null)}}}function Au(e,t,r){var n=e[t];if(n){if(!r&&typeof n=="function")return n;var i=r?n.leave:n.enter;if(typeof i=="function")return i}else{var o=r?e.leave:e.enter;if(o){if(typeof o=="function")return o;var s=o[t];if(typeof s=="function")return s}}}});var Ai=y(xu=>{"use strict";p();Object.defineProperty(xu,"__esModule",{value:!0});xu.default=void 0;var dV=Array.prototype.find?function(e,t){return Array.prototype.find.call(e,t)}:function(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(t(n))return n}},fV=dV;xu.default=fV});var bt=y(Nu=>{"use strict";p();Object.defineProperty(Nu,"__esModule",{value:!0});Nu.default=void 0;var hV=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},mV=hV;Nu.default=mV});var Yo=y(Od=>{"use strict";p();Object.defineProperty(Od,"__esModule",{value:!0});Od.locatedError=EV;var gV=vV(se()),yV=K();function vV(e){return e&&e.__esModule?e:{default:e}}function EV(e,t,r){var n,i=e instanceof Error?e:new Error("Unexpected error value: "+(0,gV.default)(e));return Array.isArray(i.path)?i:new yV.GraphQLError(i.message,(n=i.nodes)!==null&&n!==void 0?n:t,i.source,i.positions,r,i)}});var Ad=y(Ru=>{"use strict";p();Object.defineProperty(Ru,"__esModule",{value:!0});Ru.assertValidName=TV;Ru.isValidNameError=nT;var _V=bV(jt()),rT=K();function bV(e){return e&&e.__esModule?e:{default:e}}var SV=/^[_a-zA-Z][_a-zA-Z0-9]*$/;function TV(e){var t=nT(e);if(t)throw t;return e}function nT(e){if(typeof e=="string"||(0,_V.default)(0,"Expected name to be a string."),e.length>1&&e[0]==="_"&&e[1]==="_")return new rT.GraphQLError('Name "'.concat(e,'" must not begin with "__", which is reserved by GraphQL introspection.'));if(!SV.test(e))return new rT.GraphQLError('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "'.concat(e,'" does not.'))}});var xi=y(Cu=>{"use strict";p();Object.defineProperty(Cu,"__esModule",{value:!0});Cu.default=void 0;var IV=Object.entries||function(e){return Object.keys(e).map(function(t){return[t,e[t]]})},wV=IV;Cu.default=wV});var Hr=y(xd=>{"use strict";p();Object.defineProperty(xd,"__esModule",{value:!0});xd.default=OV;function OV(e,t){return e.reduce(function(r,n){return r[t(n)]=n,r},Object.create(null))}});var Rd=y(Nd=>{"use strict";p();Object.defineProperty(Nd,"__esModule",{value:!0});Nd.default=NV;var AV=xV(xi());function xV(e){return e&&e.__esModule?e:{default:e}}function NV(e,t){for(var r=Object.create(null),n=0,i=(0,AV.default)(e);n<i.length;n++){var o=i[n],s=o[0],a=o[1];r[s]=t(a,s)}return r}});var Pu=y(Cd=>{"use strict";p();Object.defineProperty(Cd,"__esModule",{value:!0});Cd.default=PV;var RV=CV(xi());function CV(e){return e&&e.__esModule?e:{default:e}}function PV(e){if(Object.getPrototypeOf(e)===null)return e;for(var t=Object.create(null),r=0,n=(0,RV.default)(e);r<n.length;r++){var i=n[r],o=i[0],s=i[1];t[o]=s}return t}});var Jo=y(Pd=>{"use strict";p();Object.defineProperty(Pd,"__esModule",{value:!0});Pd.default=DV;function DV(e,t,r){return e.reduce(function(n,i){return n[t(i)]=r(i),n},Object.create(null))}});var Qr=y(Dd=>{"use strict";p();Object.defineProperty(Dd,"__esModule",{value:!0});Dd.default=kV;var LV=5;function kV(e,t){var r=typeof e=="string"?[e,t]:[void 0,e],n=r[0],i=r[1],o=" Did you mean ";n&&(o+=n+" ");var s=i.map(function(c){return'"'.concat(c,'"')});switch(s.length){case 0:return"";case 1:return o+s[0]+"?";case 2:return o+s[0]+" or "+s[1]+"?"}var a=s.slice(0,LV),u=a.pop();return o+a.join(", ")+", or "+u+"?"}});var iT=y(Ld=>{"use strict";p();Object.defineProperty(Ld,"__esModule",{value:!0});Ld.default=jV;function jV(e){return e}});var Xo=y(jd=>{"use strict";p();Object.defineProperty(jd,"__esModule",{value:!0});jd.default=MV;function MV(e,t){for(var r=0,n=0;r<e.length&&n<t.length;){var i=e.charCodeAt(r),o=t.charCodeAt(n);if(Du(i)&&Du(o)){var s=0;do++r,s=s*10+i-kd,i=e.charCodeAt(r);while(Du(i)&&s>0);var a=0;do++n,a=a*10+o-kd,o=t.charCodeAt(n);while(Du(o)&&a>0);if(s<a)return-1;if(s>a)return 1}else{if(i<o)return-1;if(i>o)return 1;++r,++n}}return e.length-t.length}var kd=48,FV=57;function Du(e){return!isNaN(e)&&kd<=e&&e<=FV}});var Wr=y(Md=>{"use strict";p();Object.defineProperty(Md,"__esModule",{value:!0});Md.default=VV;var qV=UV(Xo());function UV(e){return e&&e.__esModule?e:{default:e}}function VV(e,t){for(var r=Object.create(null),n=new GV(e),i=Math.floor(e.length*.4)+1,o=0;o<t.length;o++){var s=t[o],a=n.measure(s,i);a!==void 0&&(r[s]=a)}return Object.keys(r).sort(function(u,c){var l=r[u]-r[c];return l!==0?l:(0,qV.default)(u,c)})}var GV=(function(){function e(r){this._input=r,this._inputLowerCase=r.toLowerCase(),this._inputArray=oT(this._inputLowerCase),this._rows=[new Array(r.length+1).fill(0),new Array(r.length+1).fill(0),new Array(r.length+1).fill(0)]}var t=e.prototype;return t.measure=function(n,i){if(this._input===n)return 0;var o=n.toLowerCase();if(this._inputLowerCase===o)return 1;var s=oT(o),a=this._inputArray;if(s.length<a.length){var u=s;s=a,a=u}var c=s.length,l=a.length;if(!(c-l>i)){for(var d=this._rows,f=0;f<=l;f++)d[0][f]=f;for(var h=1;h<=c;h++){for(var g=d[(h-1)%3],v=d[h%3],_=v[0]=h,S=1;S<=l;S++){var b=s[h-1]===a[S-1]?0:1,A=Math.min(g[S]+1,v[S-1]+1,g[S-1]+b);if(h>1&&S>1&&s[h-1]===a[S-2]&&s[h-2]===a[S-1]){var O=d[(h-2)%3][S-2];A=Math.min(A,O+1)}A<_&&(_=A),v[S]=A}if(_>i)return}var T=d[c%3][l];return T<=i?T:void 0}},e})();function oT(e){for(var t=e.length,r=new Array(t),n=0;n<t;++n)r[n]=e.charCodeAt(n);return r}});var mt=y(Fd=>{"use strict";p();Object.defineProperty(Fd,"__esModule",{value:!0});Fd.print=KV;var $V=Kr(),BV=Ii();function KV(e){return(0,$V.visit)(e,{leave:QV})}var HV=80,QV={Name:function(t){return t.value},Variable:function(t){return"$"+t.name},Document:function(t){return F(t.definitions,`
|
|
54
54
|
|
|
55
55
|
`)+`
|
|
56
|
-
`},OperationDefinition:function(t){var r=t.operation,n=t.name,i=Ce("(",F(t.variableDefinitions,", "),")"),o=F(t.directives," "),s=t.selectionSet;return!n&&!o&&!i&&r==="query"?s:F([r,F([n,i]),o,s]," ")},VariableDefinition:function(t){var r=t.variable,n=t.type,i=t.defaultValue,o=t.directives;return r+": "+n+Ce(" = ",i)+Ce(" ",F(o," "))},SelectionSet:function(t){var r=t.selections;return zt(r)},Field:function(t){var r=t.alias,n=t.name,i=t.arguments,o=t.directives,s=t.selectionSet,a=Ce("",r,": ")+n,u=a+Ce("(",F(i,", "),")");return u.length>
|
|
57
|
-
`,
|
|
56
|
+
`},OperationDefinition:function(t){var r=t.operation,n=t.name,i=Ce("(",F(t.variableDefinitions,", "),")"),o=F(t.directives," "),s=t.selectionSet;return!n&&!o&&!i&&r==="query"?s:F([r,F([n,i]),o,s]," ")},VariableDefinition:function(t){var r=t.variable,n=t.type,i=t.defaultValue,o=t.directives;return r+": "+n+Ce(" = ",i)+Ce(" ",F(o," "))},SelectionSet:function(t){var r=t.selections;return zt(r)},Field:function(t){var r=t.alias,n=t.name,i=t.arguments,o=t.directives,s=t.selectionSet,a=Ce("",r,": ")+n,u=a+Ce("(",F(i,", "),")");return u.length>HV&&(u=a+Ce(`(
|
|
57
|
+
`,Lu(F(i,`
|
|
58
58
|
`)),`
|
|
59
|
-
)`)),F([u,F(o," "),s]," ")},Argument:function(t){var r=t.name,n=t.value;return r+": "+n},FragmentSpread:function(t){var r=t.name,n=t.directives;return"..."+r+Ce(" ",F(n," "))},InlineFragment:function(t){var r=t.typeCondition,n=t.directives,i=t.selectionSet;return F(["...",Ce("on ",r),F(n," "),i]," ")},FragmentDefinition:function(t){var r=t.name,n=t.typeCondition,i=t.variableDefinitions,o=t.directives,s=t.selectionSet;return"fragment ".concat(r).concat(Ce("(",F(i,", "),")")," ")+"on ".concat(n," ").concat(Ce("",F(o," ")," "))+s},IntValue:function(t){var r=t.value;return r},FloatValue:function(t){var r=t.value;return r},StringValue:function(t,r){var n=t.value,i=t.block;return i?(0,
|
|
60
|
-
`,
|
|
59
|
+
)`)),F([u,F(o," "),s]," ")},Argument:function(t){var r=t.name,n=t.value;return r+": "+n},FragmentSpread:function(t){var r=t.name,n=t.directives;return"..."+r+Ce(" ",F(n," "))},InlineFragment:function(t){var r=t.typeCondition,n=t.directives,i=t.selectionSet;return F(["...",Ce("on ",r),F(n," "),i]," ")},FragmentDefinition:function(t){var r=t.name,n=t.typeCondition,i=t.variableDefinitions,o=t.directives,s=t.selectionSet;return"fragment ".concat(r).concat(Ce("(",F(i,", "),")")," ")+"on ".concat(n," ").concat(Ce("",F(o," ")," "))+s},IntValue:function(t){var r=t.value;return r},FloatValue:function(t){var r=t.value;return r},StringValue:function(t,r){var n=t.value,i=t.block;return i?(0,BV.printBlockString)(n,r==="description"?"":" "):JSON.stringify(n)},BooleanValue:function(t){var r=t.value;return r?"true":"false"},NullValue:function(){return"null"},EnumValue:function(t){var r=t.value;return r},ListValue:function(t){var r=t.values;return"["+F(r,", ")+"]"},ObjectValue:function(t){var r=t.fields;return"{"+F(r,", ")+"}"},ObjectField:function(t){var r=t.name,n=t.value;return r+": "+n},Directive:function(t){var r=t.name,n=t.arguments;return"@"+r+Ce("(",F(n,", "),")")},NamedType:function(t){var r=t.name;return r},ListType:function(t){var r=t.type;return"["+r+"]"},NonNullType:function(t){var r=t.type;return r+"!"},SchemaDefinition:Wt(function(e){var t=e.directives,r=e.operationTypes;return F(["schema",F(t," "),zt(r)]," ")}),OperationTypeDefinition:function(t){var r=t.operation,n=t.type;return r+": "+n},ScalarTypeDefinition:Wt(function(e){var t=e.name,r=e.directives;return F(["scalar",t,F(r," ")]," ")}),ObjectTypeDefinition:Wt(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return F(["type",t,Ce("implements ",F(r," & ")),F(n," "),zt(i)]," ")}),FieldDefinition:Wt(function(e){var t=e.name,r=e.arguments,n=e.type,i=e.directives;return t+(sT(r)?Ce(`(
|
|
60
|
+
`,Lu(F(r,`
|
|
61
61
|
`)),`
|
|
62
|
-
)`):Ce("(",F(r,", "),")"))+": "+n+Ce(" ",F(i," "))}),InputValueDefinition:Wt(function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return F([t+": "+r,Ce("= ",n),F(i," ")]," ")}),InterfaceTypeDefinition:Wt(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return F(["interface",t,Ce("implements ",F(r," & ")),F(n," "),zt(i)]," ")}),UnionTypeDefinition:Wt(function(e){var t=e.name,r=e.directives,n=e.types;return F(["union",t,F(r," "),n&&n.length!==0?"= "+F(n," | "):""]," ")}),EnumTypeDefinition:Wt(function(e){var t=e.name,r=e.directives,n=e.values;return F(["enum",t,F(r," "),zt(n)]," ")}),EnumValueDefinition:Wt(function(e){var t=e.name,r=e.directives;return F([t,F(r," ")]," ")}),InputObjectTypeDefinition:Wt(function(e){var t=e.name,r=e.directives,n=e.fields;return F(["input",t,F(r," "),zt(n)]," ")}),DirectiveDefinition:Wt(function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(
|
|
63
|
-
`,
|
|
62
|
+
)`):Ce("(",F(r,", "),")"))+": "+n+Ce(" ",F(i," "))}),InputValueDefinition:Wt(function(e){var t=e.name,r=e.type,n=e.defaultValue,i=e.directives;return F([t+": "+r,Ce("= ",n),F(i," ")]," ")}),InterfaceTypeDefinition:Wt(function(e){var t=e.name,r=e.interfaces,n=e.directives,i=e.fields;return F(["interface",t,Ce("implements ",F(r," & ")),F(n," "),zt(i)]," ")}),UnionTypeDefinition:Wt(function(e){var t=e.name,r=e.directives,n=e.types;return F(["union",t,F(r," "),n&&n.length!==0?"= "+F(n," | "):""]," ")}),EnumTypeDefinition:Wt(function(e){var t=e.name,r=e.directives,n=e.values;return F(["enum",t,F(r," "),zt(n)]," ")}),EnumValueDefinition:Wt(function(e){var t=e.name,r=e.directives;return F([t,F(r," ")]," ")}),InputObjectTypeDefinition:Wt(function(e){var t=e.name,r=e.directives,n=e.fields;return F(["input",t,F(r," "),zt(n)]," ")}),DirectiveDefinition:Wt(function(e){var t=e.name,r=e.arguments,n=e.repeatable,i=e.locations;return"directive @"+t+(sT(r)?Ce(`(
|
|
63
|
+
`,Lu(F(r,`
|
|
64
64
|
`)),`
|
|
65
65
|
)`):Ce("(",F(r,", "),")"))+(n?" repeatable":"")+" on "+F(i," | ")}),SchemaExtension:function(t){var r=t.directives,n=t.operationTypes;return F(["extend schema",F(r," "),zt(n)]," ")},ScalarTypeExtension:function(t){var r=t.name,n=t.directives;return F(["extend scalar",r,F(n," ")]," ")},ObjectTypeExtension:function(t){var r=t.name,n=t.interfaces,i=t.directives,o=t.fields;return F(["extend type",r,Ce("implements ",F(n," & ")),F(i," "),zt(o)]," ")},InterfaceTypeExtension:function(t){var r=t.name,n=t.interfaces,i=t.directives,o=t.fields;return F(["extend interface",r,Ce("implements ",F(n," & ")),F(i," "),zt(o)]," ")},UnionTypeExtension:function(t){var r=t.name,n=t.directives,i=t.types;return F(["extend union",r,F(n," "),i&&i.length!==0?"= "+F(i," | "):""]," ")},EnumTypeExtension:function(t){var r=t.name,n=t.directives,i=t.values;return F(["extend enum",r,F(n," "),zt(i)]," ")},InputObjectTypeExtension:function(t){var r=t.name,n=t.directives,i=t.fields;return F(["extend input",r,F(n," "),zt(i)]," ")}};function Wt(e){return function(t){return F([t.description,e(t)],`
|
|
66
66
|
`)}}function F(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";return(t=e?.filter(function(n){return n}).join(r))!==null&&t!==void 0?t:""}function zt(e){return Ce(`{
|
|
67
|
-
`,
|
|
67
|
+
`,Lu(F(e,`
|
|
68
68
|
`)),`
|
|
69
|
-
}`)}function Ce(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return t!=null&&t!==""?e+t+r:""}function
|
|
70
|
-
`))}function
|
|
71
|
-
`)!==-1}function tT(e){return e!=null&&e.some(UV)}});var qd=y(Fd=>{"use strict";p();Object.defineProperty(Fd,"__esModule",{value:!0});Fd.valueFromASTUntyped=jd;var VV=Md(se()),GV=Md(et()),BV=Md(Yo()),Tr=Ee();function Md(e){return e&&e.__esModule?e:{default:e}}function jd(e,t){switch(e.kind){case Tr.Kind.NULL:return null;case Tr.Kind.INT:return parseInt(e.value,10);case Tr.Kind.FLOAT:return parseFloat(e.value);case Tr.Kind.STRING:case Tr.Kind.ENUM:case Tr.Kind.BOOLEAN:return e.value;case Tr.Kind.LIST:return e.values.map(function(r){return jd(r,t)});case Tr.Kind.OBJECT:return(0,BV.default)(e.fields,function(r){return r.name.value},function(r){return jd(r.value,t)});case Tr.Kind.VARIABLE:return t?.[e.name.value]}(0,GV.default)(0,"Unexpected value node: "+(0,VV.default)(e))}});var ie=y(B=>{"use strict";p();Object.defineProperty(B,"__esModule",{value:!0});B.isType=Ud;B.assertType=aT;B.isScalarType=Nn;B.assertScalarType=YV;B.isObjectType=Ri;B.assertObjectType=JV;B.isInterfaceType=Rn;B.assertInterfaceType=XV;B.isUnionType=Cn;B.assertUnionType=ZV;B.isEnumType=Pn;B.assertEnumType=eG;B.isInputObjectType=Zo;B.assertInputObjectType=tG;B.isListType=ku;B.assertListType=rG;B.isNonNullType=en;B.assertNonNullType=nG;B.isInputType=Vd;B.assertInputType=iG;B.isOutputType=Gd;B.assertOutputType=oG;B.isLeafType=uT;B.assertLeafType=sG;B.isCompositeType=cT;B.assertCompositeType=aG;B.isAbstractType=lT;B.assertAbstractType=uG;B.GraphQLList=zr;B.GraphQLNonNull=Yr;B.isWrappingType=es;B.assertWrappingType=cG;B.isNullableType=pT;B.assertNullableType=dT;B.getNullableType=lG;B.isNamedType=fT;B.assertNamedType=pG;B.getNamedType=dG;B.argsToArgsConfig=yT;B.isRequiredArgument=fG;B.isRequiredInputField=yG;B.GraphQLInputObjectType=B.GraphQLEnumType=B.GraphQLUnionType=B.GraphQLInterfaceType=B.GraphQLObjectType=B.GraphQLScalarType=void 0;var oT=St(Ai()),Jr=ur(),Ie=St(se()),$V=St(Hr()),Lu=St(Ad()),lr=St(Ru()),we=St(jt()),sT=St(Yo()),Xr=St(Ko()),KV=St(Qr()),HV=St(ar()),rT=St(ZS()),Zr=St(hu()),QV=St(Wr()),Xo=K(),WV=Ee(),nT=mt(),zV=qd();function St(e){return e&&e.__esModule?e:{default:e}}function iT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ni(e,t,r){return t&&iT(e.prototype,t),r&&iT(e,r),e}function Ud(e){return Nn(e)||Ri(e)||Rn(e)||Cn(e)||Pn(e)||Zo(e)||ku(e)||en(e)}function aT(e){if(!Ud(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL type."));return e}function Nn(e){return(0,Xr.default)(e,Bd)}function YV(e){if(!Nn(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Scalar type."));return e}function Ri(e){return(0,Xr.default)(e,$d)}function JV(e){if(!Ri(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Object type."));return e}function Rn(e){return(0,Xr.default)(e,Kd)}function XV(e){if(!Rn(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Interface type."));return e}function Cn(e){return(0,Xr.default)(e,Hd)}function ZV(e){if(!Cn(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Union type."));return e}function Pn(e){return(0,Xr.default)(e,Qd)}function eG(e){if(!Pn(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Enum type."));return e}function Zo(e){return(0,Xr.default)(e,Wd)}function tG(e){if(!Zo(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Input Object type."));return e}function ku(e){return(0,Xr.default)(e,zr)}function rG(e){if(!ku(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL List type."));return e}function en(e){return(0,Xr.default)(e,Yr)}function nG(e){if(!en(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Non-Null type."));return e}function Vd(e){return Nn(e)||Pn(e)||Zo(e)||es(e)&&Vd(e.ofType)}function iG(e){if(!Vd(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL input type."));return e}function Gd(e){return Nn(e)||Ri(e)||Rn(e)||Cn(e)||Pn(e)||es(e)&&Gd(e.ofType)}function oG(e){if(!Gd(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL output type."));return e}function uT(e){return Nn(e)||Pn(e)}function sG(e){if(!uT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL leaf type."));return e}function cT(e){return Ri(e)||Rn(e)||Cn(e)}function aG(e){if(!cT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL composite type."));return e}function lT(e){return Rn(e)||Cn(e)}function uG(e){if(!lT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL abstract type."));return e}function zr(e){if(this instanceof zr)this.ofType=aT(e);else return new zr(e)}zr.prototype.toString=function(){return"["+String(this.ofType)+"]"};zr.prototype.toJSON=function(){return this.toString()};Object.defineProperty(zr.prototype,Jr.SYMBOL_TO_STRING_TAG,{get:function(){return"GraphQLList"}});(0,Zr.default)(zr);function Yr(e){if(this instanceof Yr)this.ofType=dT(e);else return new Yr(e)}Yr.prototype.toString=function(){return String(this.ofType)+"!"};Yr.prototype.toJSON=function(){return this.toString()};Object.defineProperty(Yr.prototype,Jr.SYMBOL_TO_STRING_TAG,{get:function(){return"GraphQLNonNull"}});(0,Zr.default)(Yr);function es(e){return ku(e)||en(e)}function cG(e){if(!es(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL wrapping type."));return e}function pT(e){return Ud(e)&&!en(e)}function dT(e){if(!pT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL nullable type."));return e}function lG(e){if(e)return en(e)?e.ofType:e}function fT(e){return Nn(e)||Ri(e)||Rn(e)||Cn(e)||Pn(e)||Zo(e)}function pG(e){if(!fT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL named type."));return e}function dG(e){if(e){for(var t=e;es(t);)t=t.ofType;return t}}function ju(e){return typeof e=="function"?e():e}function Ci(e){return e&&e.length>0?e:void 0}var Bd=(function(){function e(r){var n,i,o,s=(n=r.parseValue)!==null&&n!==void 0?n:rT.default;this.name=r.name,this.description=r.description,this.specifiedByUrl=r.specifiedByUrl,this.serialize=(i=r.serialize)!==null&&i!==void 0?i:rT.default,this.parseValue=s,this.parseLiteral=(o=r.parseLiteral)!==null&&o!==void 0?o:function(a,u){return s((0,zV.valueFromASTUntyped)(a,u))},this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Ci(r.extensionASTNodes),typeof r.name=="string"||(0,we.default)(0,"Must provide name."),r.specifiedByUrl==null||typeof r.specifiedByUrl=="string"||(0,we.default)(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat((0,Ie.default)(r.specifiedByUrl),".")),r.serialize==null||typeof r.serialize=="function"||(0,we.default)(0,"".concat(this.name,' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.')),r.parseLiteral&&(typeof r.parseValue=="function"&&typeof r.parseLiteral=="function"||(0,we.default)(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var t=e.prototype;return t.toConfig=function(){var n;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:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ni(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLScalarType"}}]),e})();B.GraphQLScalarType=Bd;(0,Zr.default)(Bd);var $d=(function(){function e(r){this.name=r.name,this.description=r.description,this.isTypeOf=r.isTypeOf,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Ci(r.extensionASTNodes),this._fields=mT.bind(void 0,r),this._interfaces=hT.bind(void 0,r),typeof r.name=="string"||(0,we.default)(0,"Must provide name."),r.isTypeOf==null||typeof r.isTypeOf=="function"||(0,we.default)(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat((0,Ie.default)(r.isTypeOf),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:gT(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ni(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLObjectType"}}]),e})();B.GraphQLObjectType=$d;(0,Zr.default)($d);function hT(e){var t,r=(t=ju(e.interfaces))!==null&&t!==void 0?t:[];return Array.isArray(r)||(0,we.default)(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),r}function mT(e){var t=ju(e.fields);return xi(t)||(0,we.default)(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),(0,Lu.default)(t,function(r,n){var i;xi(r)||(0,we.default)(0,"".concat(e.name,".").concat(n," field config must be an object.")),!("isDeprecated"in r)||(0,we.default)(0,"".concat(e.name,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),r.resolve==null||typeof r.resolve=="function"||(0,we.default)(0,"".concat(e.name,".").concat(n," field resolver must be a function if ")+"provided, but got: ".concat((0,Ie.default)(r.resolve),"."));var o=(i=r.args)!==null&&i!==void 0?i:{};xi(o)||(0,we.default)(0,"".concat(e.name,".").concat(n," args must be an object with argument names as keys."));var s=(0,oT.default)(o).map(function(a){var u=a[0],c=a[1];return{name:u,description:c.description,type:c.type,defaultValue:c.defaultValue,deprecationReason:c.deprecationReason,extensions:c.extensions&&(0,lr.default)(c.extensions),astNode:c.astNode}});return{name:n,description:r.description,type:r.type,args:s,resolve:r.resolve,subscribe:r.subscribe,isDeprecated:r.deprecationReason!=null,deprecationReason:r.deprecationReason,extensions:r.extensions&&(0,lr.default)(r.extensions),astNode:r.astNode}})}function xi(e){return(0,HV.default)(e)&&!Array.isArray(e)}function gT(e){return(0,Lu.default)(e,function(t){return{description:t.description,type:t.type,args:yT(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function yT(e){return(0,sT.default)(e,function(t){return t.name},function(t){return{description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function fG(e){return en(e.type)&&e.defaultValue===void 0}var Kd=(function(){function e(r){this.name=r.name,this.description=r.description,this.resolveType=r.resolveType,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Ci(r.extensionASTNodes),this._fields=mT.bind(void 0,r),this._interfaces=hT.bind(void 0,r),typeof r.name=="string"||(0,we.default)(0,"Must provide name."),r.resolveType==null||typeof r.resolveType=="function"||(0,we.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,Ie.default)(r.resolveType),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){var n;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:gT(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ni(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLInterfaceType"}}]),e})();B.GraphQLInterfaceType=Kd;(0,Zr.default)(Kd);var Hd=(function(){function e(r){this.name=r.name,this.description=r.description,this.resolveType=r.resolveType,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Ci(r.extensionASTNodes),this._types=hG.bind(void 0,r),typeof r.name=="string"||(0,we.default)(0,"Must provide name."),r.resolveType==null||typeof r.resolveType=="function"||(0,we.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,Ie.default)(r.resolveType),"."))}var t=e.prototype;return t.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},t.toConfig=function(){var n;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ni(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLUnionType"}}]),e})();B.GraphQLUnionType=Hd;(0,Zr.default)(Hd);function hG(e){var t=ju(e.types);return Array.isArray(t)||(0,we.default)(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),t}var Qd=(function(){function e(r){this.name=r.name,this.description=r.description,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Ci(r.extensionASTNodes),this._values=mG(this.name,r.values),this._valueLookup=new Map(this._values.map(function(n){return[n.value,n]})),this._nameLookup=(0,$V.default)(this._values,function(n){return n.name}),typeof r.name=="string"||(0,we.default)(0,"Must provide name.")}var t=e.prototype;return t.getValues=function(){return this._values},t.getValue=function(n){return this._nameLookup[n]},t.serialize=function(n){var i=this._valueLookup.get(n);if(i===void 0)throw new Xo.GraphQLError('Enum "'.concat(this.name,'" cannot represent value: ').concat((0,Ie.default)(n)));return i.name},t.parseValue=function(n){if(typeof n!="string"){var i=(0,Ie.default)(n);throw new Xo.GraphQLError('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(i,".")+Du(this,i))}var o=this.getValue(n);if(o==null)throw new Xo.GraphQLError('Value "'.concat(n,'" does not exist in "').concat(this.name,'" enum.')+Du(this,n));return o.value},t.parseLiteral=function(n,i){if(n.kind!==WV.Kind.ENUM){var o=(0,nT.print)(n);throw new Xo.GraphQLError('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(o,".")+Du(this,o),n)}var s=this.getValue(n.value);if(s==null){var a=(0,nT.print)(n);throw new Xo.GraphQLError('Value "'.concat(a,'" does not exist in "').concat(this.name,'" enum.')+Du(this,a),n)}return s.value},t.toConfig=function(){var n,i=(0,sT.default)(this.getValues(),function(o){return o.name},function(o){return{description:o.description,value:o.value,deprecationReason:o.deprecationReason,extensions:o.extensions,astNode:o.astNode}});return{name:this.name,description:this.description,values:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ni(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLEnumType"}}]),e})();B.GraphQLEnumType=Qd;(0,Zr.default)(Qd);function Du(e,t){var r=e.getValues().map(function(i){return i.name}),n=(0,QV.default)(t,r);return(0,KV.default)("the enum value",n)}function mG(e,t){return xi(t)||(0,we.default)(0,"".concat(e," values must be an object with value names as keys.")),(0,oT.default)(t).map(function(r){var n=r[0],i=r[1];return xi(i)||(0,we.default)(0,"".concat(e,".").concat(n,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat((0,Ie.default)(i),".")),!("isDeprecated"in i)||(0,we.default)(0,"".concat(e,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),{name:n,description:i.description,value:i.value!==void 0?i.value:n,isDeprecated:i.deprecationReason!=null,deprecationReason:i.deprecationReason,extensions:i.extensions&&(0,lr.default)(i.extensions),astNode:i.astNode}})}var Wd=(function(){function e(r){this.name=r.name,this.description=r.description,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Ci(r.extensionASTNodes),this._fields=gG.bind(void 0,r),typeof r.name=="string"||(0,we.default)(0,"Must provide name.")}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.toConfig=function(){var n,i=(0,Lu.default)(this.getFields(),function(o){return{description:o.description,type:o.type,defaultValue:o.defaultValue,deprecationReason:o.deprecationReason,extensions:o.extensions,astNode:o.astNode}});return{name:this.name,description:this.description,fields:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ni(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLInputObjectType"}}]),e})();B.GraphQLInputObjectType=Wd;(0,Zr.default)(Wd);function gG(e){var t=ju(e.fields);return xi(t)||(0,we.default)(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),(0,Lu.default)(t,function(r,n){return!("resolve"in r)||(0,we.default)(0,"".concat(e.name,".").concat(n," field has a resolve property, but Input Types cannot define resolvers.")),{name:n,description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions&&(0,lr.default)(r.extensions),astNode:r.astNode}})}function yG(e){return en(e.type)&&e.defaultValue===void 0}});var rs=y(ts=>{"use strict";p();Object.defineProperty(ts,"__esModule",{value:!0});ts.isEqualType=zd;ts.isTypeSubTypeOf=Mu;ts.doTypesOverlap=vG;var nt=ie();function zd(e,t){return e===t?!0:(0,nt.isNonNullType)(e)&&(0,nt.isNonNullType)(t)||(0,nt.isListType)(e)&&(0,nt.isListType)(t)?zd(e.ofType,t.ofType):!1}function Mu(e,t,r){return t===r?!0:(0,nt.isNonNullType)(r)?(0,nt.isNonNullType)(t)?Mu(e,t.ofType,r.ofType):!1:(0,nt.isNonNullType)(t)?Mu(e,t.ofType,r):(0,nt.isListType)(r)?(0,nt.isListType)(t)?Mu(e,t.ofType,r.ofType):!1:(0,nt.isListType)(t)?!1:(0,nt.isAbstractType)(r)&&((0,nt.isInterfaceType)(t)||(0,nt.isObjectType)(t))&&e.isSubType(r,t)}function vG(e,t,r){return t===r?!0:(0,nt.isAbstractType)(t)?(0,nt.isAbstractType)(r)?e.getPossibleTypes(t).some(function(n){return e.isSubType(r,n)}):e.isSubType(t,r):(0,nt.isAbstractType)(r)?e.isSubType(r,t):!1}});var Yd=y(Fu=>{"use strict";p();Object.defineProperty(Fu,"__esModule",{value:!0});Fu.default=void 0;var EG=ur(),_G=Array.from||function(e,t,r){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n=e[EG.SYMBOL_ITERATOR];if(typeof n=="function"){for(var i=n.call(e),o=[],s,a=0;!(s=i.next()).done;++a)if(o.push(t.call(r,s.value,a)),a>9999999)throw new TypeError("Near-infinite iteration.");return o}var u=e.length;if(typeof u=="number"&&u>=0&&u%1===0){for(var c=[],l=0;l<u;++l)Object.prototype.hasOwnProperty.call(e,l)&&c.push(t.call(r,e[l],l));return c}return[]},bG=_G;Fu.default=bG});var Jd=y(qu=>{"use strict";p();Object.defineProperty(qu,"__esModule",{value:!0});qu.default=void 0;var SG=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},TG=SG;qu.default=TG});var Vu=y(Xd=>{"use strict";p();Object.defineProperty(Xd,"__esModule",{value:!0});Xd.default=OG;var IG=ur();function Uu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Uu=function(r){return typeof r}:Uu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Uu(e)}function OG(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(l){return l};if(e==null||Uu(e)!=="object")return null;if(Array.isArray(e))return e.map(t);var r=e[IG.SYMBOL_ITERATOR];if(typeof r=="function"){for(var n=r.call(e),i=[],o,s=0;!(o=n.next()).done;++s)i.push(t(o.value,s));return i}var a=e.length;if(typeof a=="number"&&a>=0&&a%1===0){for(var u=[],c=0;c<a;++c){if(!Object.prototype.hasOwnProperty.call(e,c))return null;u.push(t(e[String(c)],c))}return u}return null}});var vT=y(Gu=>{"use strict";p();Object.defineProperty(Gu,"__esModule",{value:!0});Gu.default=void 0;var wG=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},AG=wG;Gu.default=AG});var pr=y(lt=>{"use strict";p();Object.defineProperty(lt,"__esModule",{value:!0});lt.isSpecifiedScalarType=FG;lt.specifiedScalarTypes=lt.GraphQLID=lt.GraphQLBoolean=lt.GraphQLString=lt.GraphQLFloat=lt.GraphQLInt=void 0;var Bu=Ku(Jd()),$u=Ku(vT()),Yt=Ku(se()),ET=Ku(ar()),Dn=Ee(),ns=mt(),We=K(),is=ie();function Ku(e){return e&&e.__esModule?e:{default:e}}var Zd=2147483647,ef=-2147483648;function xG(e){var t=os(e);if(typeof t=="boolean")return t?1:0;var r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),!(0,$u.default)(r))throw new We.GraphQLError("Int cannot represent non-integer value: ".concat((0,Yt.default)(t)));if(r>Zd||r<ef)throw new We.GraphQLError("Int cannot represent non 32-bit signed integer value: "+(0,Yt.default)(t));return r}function NG(e){if(!(0,$u.default)(e))throw new We.GraphQLError("Int cannot represent non-integer value: ".concat((0,Yt.default)(e)));if(e>Zd||e<ef)throw new We.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var _T=new is.GraphQLScalarType({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:xG,parseValue:NG,parseLiteral:function(t){if(t.kind!==Dn.Kind.INT)throw new We.GraphQLError("Int cannot represent non-integer value: ".concat((0,ns.print)(t)),t);var r=parseInt(t.value,10);if(r>Zd||r<ef)throw new We.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(t.value),t);return r}});lt.GraphQLInt=_T;function RG(e){var t=os(e);if(typeof t=="boolean")return t?1:0;var r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),!(0,Bu.default)(r))throw new We.GraphQLError("Float cannot represent non numeric value: ".concat((0,Yt.default)(t)));return r}function CG(e){if(!(0,Bu.default)(e))throw new We.GraphQLError("Float cannot represent non numeric value: ".concat((0,Yt.default)(e)));return e}var bT=new is.GraphQLScalarType({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:RG,parseValue:CG,parseLiteral:function(t){if(t.kind!==Dn.Kind.FLOAT&&t.kind!==Dn.Kind.INT)throw new We.GraphQLError("Float cannot represent non numeric value: ".concat((0,ns.print)(t)),t);return parseFloat(t.value)}});lt.GraphQLFloat=bT;function os(e){if((0,ET.default)(e)){if(typeof e.valueOf=="function"){var t=e.valueOf();if(!(0,ET.default)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function PG(e){var t=os(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if((0,Bu.default)(t))return t.toString();throw new We.GraphQLError("String cannot represent value: ".concat((0,Yt.default)(e)))}function DG(e){if(typeof e!="string")throw new We.GraphQLError("String cannot represent a non string value: ".concat((0,Yt.default)(e)));return e}var ST=new is.GraphQLScalarType({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:PG,parseValue:DG,parseLiteral:function(t){if(t.kind!==Dn.Kind.STRING)throw new We.GraphQLError("String cannot represent a non string value: ".concat((0,ns.print)(t)),t);return t.value}});lt.GraphQLString=ST;function LG(e){var t=os(e);if(typeof t=="boolean")return t;if((0,Bu.default)(t))return t!==0;throw new We.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,Yt.default)(t)))}function kG(e){if(typeof e!="boolean")throw new We.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,Yt.default)(e)));return e}var TT=new is.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:LG,parseValue:kG,parseLiteral:function(t){if(t.kind!==Dn.Kind.BOOLEAN)throw new We.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,ns.print)(t)),t);return t.value}});lt.GraphQLBoolean=TT;function jG(e){var t=os(e);if(typeof t=="string")return t;if((0,$u.default)(t))return String(t);throw new We.GraphQLError("ID cannot represent value: ".concat((0,Yt.default)(e)))}function MG(e){if(typeof e=="string")return e;if((0,$u.default)(e))return e.toString();throw new We.GraphQLError("ID cannot represent value: ".concat((0,Yt.default)(e)))}var IT=new is.GraphQLScalarType({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:jG,parseValue:MG,parseLiteral:function(t){if(t.kind!==Dn.Kind.STRING&&t.kind!==Dn.Kind.INT)throw new We.GraphQLError("ID cannot represent a non-string and non-integer value: "+(0,ns.print)(t),t);return t.value}});lt.GraphQLID=IT;var OT=Object.freeze([ST,_T,bT,TT,IT]);lt.specifiedScalarTypes=OT;function FG(e){return OT.some(function(t){var r=t.name;return e.name===r})}});var us=y(tf=>{"use strict";p();Object.defineProperty(tf,"__esModule",{value:!0});tf.astFromValue=as;var qG=Pi(Jd()),UG=Pi(bt()),wT=Pi(se()),VG=Pi(et()),GG=Pi(ar()),BG=Pi(Vu()),Mt=Ee(),$G=pr(),ss=ie();function Pi(e){return e&&e.__esModule?e:{default:e}}function as(e,t){if((0,ss.isNonNullType)(t)){var r=as(e,t.ofType);return r?.kind===Mt.Kind.NULL?null:r}if(e===null)return{kind:Mt.Kind.NULL};if(e===void 0)return null;if((0,ss.isListType)(t)){var n=t.ofType,i=(0,BG.default)(e);if(i!=null){for(var o=[],s=0;s<i.length;s++){var a=i[s],u=as(a,n);u!=null&&o.push(u)}return{kind:Mt.Kind.LIST,values:o}}return as(e,n)}if((0,ss.isInputObjectType)(t)){if(!(0,GG.default)(e))return null;for(var c=[],l=0,d=(0,UG.default)(t.getFields());l<d.length;l++){var f=d[l],h=as(e[f.name],f.type);h&&c.push({kind:Mt.Kind.OBJECT_FIELD,name:{kind:Mt.Kind.NAME,value:f.name},value:h})}return{kind:Mt.Kind.OBJECT,fields:c}}if((0,ss.isLeafType)(t)){var g=t.serialize(e);if(g==null)return null;if(typeof g=="boolean")return{kind:Mt.Kind.BOOLEAN,value:g};if(typeof g=="number"&&(0,qG.default)(g)){var v=String(g);return AT.test(v)?{kind:Mt.Kind.INT,value:v}:{kind:Mt.Kind.FLOAT,value:v}}if(typeof g=="string")return(0,ss.isEnumType)(t)?{kind:Mt.Kind.ENUM,value:g}:t===$G.GraphQLID&&AT.test(g)?{kind:Mt.Kind.INT,value:g}:{kind:Mt.Kind.STRING,value:g};throw new TypeError("Cannot convert value to AST: ".concat((0,wT.default)(g),"."))}(0,VG.default)(0,"Unexpected input type: "+(0,wT.default)(t))}var AT=/^-?(?:0|[1-9][0-9]*)$/});var qt=y(ye=>{"use strict";p();Object.defineProperty(ye,"__esModule",{value:!0});ye.isIntrospectionType=XG;ye.introspectionTypes=ye.TypeNameMetaFieldDef=ye.TypeMetaFieldDef=ye.SchemaMetaFieldDef=ye.__TypeKind=ye.TypeKind=ye.__EnumValue=ye.__InputValue=ye.__Field=ye.__Type=ye.__DirectiveLocation=ye.__Directive=ye.__Schema=void 0;var rf=nf(bt()),KG=nf(se()),HG=nf(et()),QG=mt(),Be=Si(),WG=us(),_e=pr(),q=ie();function nf(e){return e&&e.__esModule?e:{default:e}}var of=new q.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{description:{type:_e.GraphQLString,resolve:function(r){return r.description}},types:{description:"A list of all types supported by this server.",type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(Ft))),resolve:function(r){return(0,rf.default)(r.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new q.GraphQLNonNull(Ft),resolve:function(r){return r.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ft,resolve:function(r){return r.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ft,resolve:function(r){return r.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(sf))),resolve:function(r){return r.getDirectives()}}}}});ye.__Schema=of;var sf=new q.GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
69
|
+
}`)}function Ce(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return t!=null&&t!==""?e+t+r:""}function Lu(e){return Ce(" ",e.replace(/\n/g,`
|
|
70
|
+
`))}function WV(e){return e.indexOf(`
|
|
71
|
+
`)!==-1}function sT(e){return e!=null&&e.some(WV)}});var Gd=y(Vd=>{"use strict";p();Object.defineProperty(Vd,"__esModule",{value:!0});Vd.valueFromASTUntyped=qd;var zV=Ud(se()),YV=Ud(et()),JV=Ud(Jo()),Tr=Ee();function Ud(e){return e&&e.__esModule?e:{default:e}}function qd(e,t){switch(e.kind){case Tr.Kind.NULL:return null;case Tr.Kind.INT:return parseInt(e.value,10);case Tr.Kind.FLOAT:return parseFloat(e.value);case Tr.Kind.STRING:case Tr.Kind.ENUM:case Tr.Kind.BOOLEAN:return e.value;case Tr.Kind.LIST:return e.values.map(function(r){return qd(r,t)});case Tr.Kind.OBJECT:return(0,JV.default)(e.fields,function(r){return r.name.value},function(r){return qd(r.value,t)});case Tr.Kind.VARIABLE:return t?.[e.name.value]}(0,YV.default)(0,"Unexpected value node: "+(0,zV.default)(e))}});var ie=y($=>{"use strict";p();Object.defineProperty($,"__esModule",{value:!0});$.isType=$d;$.assertType=dT;$.isScalarType=Rn;$.assertScalarType=iG;$.isObjectType=Ci;$.assertObjectType=oG;$.isInterfaceType=Cn;$.assertInterfaceType=sG;$.isUnionType=Pn;$.assertUnionType=aG;$.isEnumType=Dn;$.assertEnumType=uG;$.isInputObjectType=es;$.assertInputObjectType=cG;$.isListType=Mu;$.assertListType=lG;$.isNonNullType=en;$.assertNonNullType=pG;$.isInputType=Bd;$.assertInputType=dG;$.isOutputType=Kd;$.assertOutputType=fG;$.isLeafType=fT;$.assertLeafType=hG;$.isCompositeType=hT;$.assertCompositeType=mG;$.isAbstractType=mT;$.assertAbstractType=gG;$.GraphQLList=zr;$.GraphQLNonNull=Yr;$.isWrappingType=ts;$.assertWrappingType=yG;$.isNullableType=gT;$.assertNullableType=yT;$.getNullableType=vG;$.isNamedType=vT;$.assertNamedType=EG;$.getNamedType=_G;$.argsToArgsConfig=ST;$.isRequiredArgument=bG;$.isRequiredInputField=wG;$.GraphQLInputObjectType=$.GraphQLEnumType=$.GraphQLUnionType=$.GraphQLInterfaceType=$.GraphQLObjectType=$.GraphQLScalarType=void 0;var lT=St(xi()),Jr=ur(),Ie=St(se()),XV=St(Hr()),ju=St(Rd()),lr=St(Pu()),Oe=St(jt()),pT=St(Jo()),Xr=St(Ho()),ZV=St(Qr()),eG=St(ar()),aT=St(iT()),Zr=St(gu()),tG=St(Wr()),Zo=K(),rG=Ee(),uT=mt(),nG=Gd();function St(e){return e&&e.__esModule?e:{default:e}}function cT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ri(e,t,r){return t&&cT(e.prototype,t),r&&cT(e,r),e}function $d(e){return Rn(e)||Ci(e)||Cn(e)||Pn(e)||Dn(e)||es(e)||Mu(e)||en(e)}function dT(e){if(!$d(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL type."));return e}function Rn(e){return(0,Xr.default)(e,Hd)}function iG(e){if(!Rn(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Scalar type."));return e}function Ci(e){return(0,Xr.default)(e,Qd)}function oG(e){if(!Ci(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Object type."));return e}function Cn(e){return(0,Xr.default)(e,Wd)}function sG(e){if(!Cn(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Interface type."));return e}function Pn(e){return(0,Xr.default)(e,zd)}function aG(e){if(!Pn(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Union type."));return e}function Dn(e){return(0,Xr.default)(e,Yd)}function uG(e){if(!Dn(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Enum type."));return e}function es(e){return(0,Xr.default)(e,Jd)}function cG(e){if(!es(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Input Object type."));return e}function Mu(e){return(0,Xr.default)(e,zr)}function lG(e){if(!Mu(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL List type."));return e}function en(e){return(0,Xr.default)(e,Yr)}function pG(e){if(!en(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL Non-Null type."));return e}function Bd(e){return Rn(e)||Dn(e)||es(e)||ts(e)&&Bd(e.ofType)}function dG(e){if(!Bd(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL input type."));return e}function Kd(e){return Rn(e)||Ci(e)||Cn(e)||Pn(e)||Dn(e)||ts(e)&&Kd(e.ofType)}function fG(e){if(!Kd(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL output type."));return e}function fT(e){return Rn(e)||Dn(e)}function hG(e){if(!fT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL leaf type."));return e}function hT(e){return Ci(e)||Cn(e)||Pn(e)}function mG(e){if(!hT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL composite type."));return e}function mT(e){return Cn(e)||Pn(e)}function gG(e){if(!mT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL abstract type."));return e}function zr(e){if(this instanceof zr)this.ofType=dT(e);else return new zr(e)}zr.prototype.toString=function(){return"["+String(this.ofType)+"]"};zr.prototype.toJSON=function(){return this.toString()};Object.defineProperty(zr.prototype,Jr.SYMBOL_TO_STRING_TAG,{get:function(){return"GraphQLList"}});(0,Zr.default)(zr);function Yr(e){if(this instanceof Yr)this.ofType=yT(e);else return new Yr(e)}Yr.prototype.toString=function(){return String(this.ofType)+"!"};Yr.prototype.toJSON=function(){return this.toString()};Object.defineProperty(Yr.prototype,Jr.SYMBOL_TO_STRING_TAG,{get:function(){return"GraphQLNonNull"}});(0,Zr.default)(Yr);function ts(e){return Mu(e)||en(e)}function yG(e){if(!ts(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL wrapping type."));return e}function gT(e){return $d(e)&&!en(e)}function yT(e){if(!gT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL nullable type."));return e}function vG(e){if(e)return en(e)?e.ofType:e}function vT(e){return Rn(e)||Ci(e)||Cn(e)||Pn(e)||Dn(e)||es(e)}function EG(e){if(!vT(e))throw new Error("Expected ".concat((0,Ie.default)(e)," to be a GraphQL named type."));return e}function _G(e){if(e){for(var t=e;ts(t);)t=t.ofType;return t}}function Fu(e){return typeof e=="function"?e():e}function Pi(e){return e&&e.length>0?e:void 0}var Hd=(function(){function e(r){var n,i,o,s=(n=r.parseValue)!==null&&n!==void 0?n:aT.default;this.name=r.name,this.description=r.description,this.specifiedByUrl=r.specifiedByUrl,this.serialize=(i=r.serialize)!==null&&i!==void 0?i:aT.default,this.parseValue=s,this.parseLiteral=(o=r.parseLiteral)!==null&&o!==void 0?o:function(a,u){return s((0,nG.valueFromASTUntyped)(a,u))},this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),typeof r.name=="string"||(0,Oe.default)(0,"Must provide name."),r.specifiedByUrl==null||typeof r.specifiedByUrl=="string"||(0,Oe.default)(0,"".concat(this.name,' must provide "specifiedByUrl" as a string, ')+"but got: ".concat((0,Ie.default)(r.specifiedByUrl),".")),r.serialize==null||typeof r.serialize=="function"||(0,Oe.default)(0,"".concat(this.name,' must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.')),r.parseLiteral&&(typeof r.parseValue=="function"&&typeof r.parseLiteral=="function"||(0,Oe.default)(0,"".concat(this.name,' must provide both "parseValue" and "parseLiteral" functions.')))}var t=e.prototype;return t.toConfig=function(){var n;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:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLScalarType"}}]),e})();$.GraphQLScalarType=Hd;(0,Zr.default)(Hd);var Qd=(function(){function e(r){this.name=r.name,this.description=r.description,this.isTypeOf=r.isTypeOf,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._fields=_T.bind(void 0,r),this._interfaces=ET.bind(void 0,r),typeof r.name=="string"||(0,Oe.default)(0,"Must provide name."),r.isTypeOf==null||typeof r.isTypeOf=="function"||(0,Oe.default)(0,"".concat(this.name,' must provide "isTypeOf" as a function, ')+"but got: ".concat((0,Ie.default)(r.isTypeOf),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:bT(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes||[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLObjectType"}}]),e})();$.GraphQLObjectType=Qd;(0,Zr.default)(Qd);function ET(e){var t,r=(t=Fu(e.interfaces))!==null&&t!==void 0?t:[];return Array.isArray(r)||(0,Oe.default)(0,"".concat(e.name," interfaces must be an Array or a function which returns an Array.")),r}function _T(e){var t=Fu(e.fields);return Ni(t)||(0,Oe.default)(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),(0,ju.default)(t,function(r,n){var i;Ni(r)||(0,Oe.default)(0,"".concat(e.name,".").concat(n," field config must be an object.")),!("isDeprecated"in r)||(0,Oe.default)(0,"".concat(e.name,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),r.resolve==null||typeof r.resolve=="function"||(0,Oe.default)(0,"".concat(e.name,".").concat(n," field resolver must be a function if ")+"provided, but got: ".concat((0,Ie.default)(r.resolve),"."));var o=(i=r.args)!==null&&i!==void 0?i:{};Ni(o)||(0,Oe.default)(0,"".concat(e.name,".").concat(n," args must be an object with argument names as keys."));var s=(0,lT.default)(o).map(function(a){var u=a[0],c=a[1];return{name:u,description:c.description,type:c.type,defaultValue:c.defaultValue,deprecationReason:c.deprecationReason,extensions:c.extensions&&(0,lr.default)(c.extensions),astNode:c.astNode}});return{name:n,description:r.description,type:r.type,args:s,resolve:r.resolve,subscribe:r.subscribe,isDeprecated:r.deprecationReason!=null,deprecationReason:r.deprecationReason,extensions:r.extensions&&(0,lr.default)(r.extensions),astNode:r.astNode}})}function Ni(e){return(0,eG.default)(e)&&!Array.isArray(e)}function bT(e){return(0,ju.default)(e,function(t){return{description:t.description,type:t.type,args:ST(t.args),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function ST(e){return(0,pT.default)(e,function(t){return t.name},function(t){return{description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:t.extensions,astNode:t.astNode}})}function bG(e){return en(e.type)&&e.defaultValue===void 0}var Wd=(function(){function e(r){this.name=r.name,this.description=r.description,this.resolveType=r.resolveType,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._fields=_T.bind(void 0,r),this._interfaces=ET.bind(void 0,r),typeof r.name=="string"||(0,Oe.default)(0,"Must provide name."),r.resolveType==null||typeof r.resolveType=="function"||(0,Oe.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,Ie.default)(r.resolveType),"."))}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.getInterfaces=function(){return typeof this._interfaces=="function"&&(this._interfaces=this._interfaces()),this._interfaces},t.toConfig=function(){var n;return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:bT(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLInterfaceType"}}]),e})();$.GraphQLInterfaceType=Wd;(0,Zr.default)(Wd);var zd=(function(){function e(r){this.name=r.name,this.description=r.description,this.resolveType=r.resolveType,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._types=SG.bind(void 0,r),typeof r.name=="string"||(0,Oe.default)(0,"Must provide name."),r.resolveType==null||typeof r.resolveType=="function"||(0,Oe.default)(0,"".concat(this.name,' must provide "resolveType" as a function, ')+"but got: ".concat((0,Ie.default)(r.resolveType),"."))}var t=e.prototype;return t.getTypes=function(){return typeof this._types=="function"&&(this._types=this._types()),this._types},t.toConfig=function(){var n;return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLUnionType"}}]),e})();$.GraphQLUnionType=zd;(0,Zr.default)(zd);function SG(e){var t=Fu(e.types);return Array.isArray(t)||(0,Oe.default)(0,"Must provide Array of types or a function which returns such an array for Union ".concat(e.name,".")),t}var Yd=(function(){function e(r){this.name=r.name,this.description=r.description,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._values=TG(this.name,r.values),this._valueLookup=new Map(this._values.map(function(n){return[n.value,n]})),this._nameLookup=(0,XV.default)(this._values,function(n){return n.name}),typeof r.name=="string"||(0,Oe.default)(0,"Must provide name.")}var t=e.prototype;return t.getValues=function(){return this._values},t.getValue=function(n){return this._nameLookup[n]},t.serialize=function(n){var i=this._valueLookup.get(n);if(i===void 0)throw new Zo.GraphQLError('Enum "'.concat(this.name,'" cannot represent value: ').concat((0,Ie.default)(n)));return i.name},t.parseValue=function(n){if(typeof n!="string"){var i=(0,Ie.default)(n);throw new Zo.GraphQLError('Enum "'.concat(this.name,'" cannot represent non-string value: ').concat(i,".")+ku(this,i))}var o=this.getValue(n);if(o==null)throw new Zo.GraphQLError('Value "'.concat(n,'" does not exist in "').concat(this.name,'" enum.')+ku(this,n));return o.value},t.parseLiteral=function(n,i){if(n.kind!==rG.Kind.ENUM){var o=(0,uT.print)(n);throw new Zo.GraphQLError('Enum "'.concat(this.name,'" cannot represent non-enum value: ').concat(o,".")+ku(this,o),n)}var s=this.getValue(n.value);if(s==null){var a=(0,uT.print)(n);throw new Zo.GraphQLError('Value "'.concat(a,'" does not exist in "').concat(this.name,'" enum.')+ku(this,a),n)}return s.value},t.toConfig=function(){var n,i=(0,pT.default)(this.getValues(),function(o){return o.name},function(o){return{description:o.description,value:o.value,deprecationReason:o.deprecationReason,extensions:o.extensions,astNode:o.astNode}});return{name:this.name,description:this.description,values:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLEnumType"}}]),e})();$.GraphQLEnumType=Yd;(0,Zr.default)(Yd);function ku(e,t){var r=e.getValues().map(function(i){return i.name}),n=(0,tG.default)(t,r);return(0,ZV.default)("the enum value",n)}function TG(e,t){return Ni(t)||(0,Oe.default)(0,"".concat(e," values must be an object with value names as keys.")),(0,lT.default)(t).map(function(r){var n=r[0],i=r[1];return Ni(i)||(0,Oe.default)(0,"".concat(e,".").concat(n,' must refer to an object with a "value" key ')+"representing an internal value but got: ".concat((0,Ie.default)(i),".")),!("isDeprecated"in i)||(0,Oe.default)(0,"".concat(e,".").concat(n,' should provide "deprecationReason" instead of "isDeprecated".')),{name:n,description:i.description,value:i.value!==void 0?i.value:n,isDeprecated:i.deprecationReason!=null,deprecationReason:i.deprecationReason,extensions:i.extensions&&(0,lr.default)(i.extensions),astNode:i.astNode}})}var Jd=(function(){function e(r){this.name=r.name,this.description=r.description,this.extensions=r.extensions&&(0,lr.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=Pi(r.extensionASTNodes),this._fields=IG.bind(void 0,r),typeof r.name=="string"||(0,Oe.default)(0,"Must provide name.")}var t=e.prototype;return t.getFields=function(){return typeof this._fields=="function"&&(this._fields=this._fields()),this._fields},t.toConfig=function(){var n,i=(0,ju.default)(this.getFields(),function(o){return{description:o.description,type:o.type,defaultValue:o.defaultValue,deprecationReason:o.deprecationReason,extensions:o.extensions,astNode:o.astNode}});return{name:this.name,description:this.description,fields:i,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[]}},t.toString=function(){return this.name},t.toJSON=function(){return this.toString()},Ri(e,[{key:Jr.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLInputObjectType"}}]),e})();$.GraphQLInputObjectType=Jd;(0,Zr.default)(Jd);function IG(e){var t=Fu(e.fields);return Ni(t)||(0,Oe.default)(0,"".concat(e.name," fields must be an object with field names as keys or a function which returns such an object.")),(0,ju.default)(t,function(r,n){return!("resolve"in r)||(0,Oe.default)(0,"".concat(e.name,".").concat(n," field has a resolve property, but Input Types cannot define resolvers.")),{name:n,description:r.description,type:r.type,defaultValue:r.defaultValue,deprecationReason:r.deprecationReason,extensions:r.extensions&&(0,lr.default)(r.extensions),astNode:r.astNode}})}function wG(e){return en(e.type)&&e.defaultValue===void 0}});var ns=y(rs=>{"use strict";p();Object.defineProperty(rs,"__esModule",{value:!0});rs.isEqualType=Xd;rs.isTypeSubTypeOf=qu;rs.doTypesOverlap=OG;var nt=ie();function Xd(e,t){return e===t?!0:(0,nt.isNonNullType)(e)&&(0,nt.isNonNullType)(t)||(0,nt.isListType)(e)&&(0,nt.isListType)(t)?Xd(e.ofType,t.ofType):!1}function qu(e,t,r){return t===r?!0:(0,nt.isNonNullType)(r)?(0,nt.isNonNullType)(t)?qu(e,t.ofType,r.ofType):!1:(0,nt.isNonNullType)(t)?qu(e,t.ofType,r):(0,nt.isListType)(r)?(0,nt.isListType)(t)?qu(e,t.ofType,r.ofType):!1:(0,nt.isListType)(t)?!1:(0,nt.isAbstractType)(r)&&((0,nt.isInterfaceType)(t)||(0,nt.isObjectType)(t))&&e.isSubType(r,t)}function OG(e,t,r){return t===r?!0:(0,nt.isAbstractType)(t)?(0,nt.isAbstractType)(r)?e.getPossibleTypes(t).some(function(n){return e.isSubType(r,n)}):e.isSubType(t,r):(0,nt.isAbstractType)(r)?e.isSubType(r,t):!1}});var Zd=y(Uu=>{"use strict";p();Object.defineProperty(Uu,"__esModule",{value:!0});Uu.default=void 0;var AG=ur(),xG=Array.from||function(e,t,r){if(e==null)throw new TypeError("Array.from requires an array-like object - not null or undefined");var n=e[AG.SYMBOL_ITERATOR];if(typeof n=="function"){for(var i=n.call(e),o=[],s,a=0;!(s=i.next()).done;++a)if(o.push(t.call(r,s.value,a)),a>9999999)throw new TypeError("Near-infinite iteration.");return o}var u=e.length;if(typeof u=="number"&&u>=0&&u%1===0){for(var c=[],l=0;l<u;++l)Object.prototype.hasOwnProperty.call(e,l)&&c.push(t.call(r,e[l],l));return c}return[]},NG=xG;Uu.default=NG});var ef=y(Vu=>{"use strict";p();Object.defineProperty(Vu,"__esModule",{value:!0});Vu.default=void 0;var RG=Number.isFinite||function(e){return typeof e=="number"&&isFinite(e)},CG=RG;Vu.default=CG});var $u=y(tf=>{"use strict";p();Object.defineProperty(tf,"__esModule",{value:!0});tf.default=DG;var PG=ur();function Gu(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Gu=function(r){return typeof r}:Gu=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},Gu(e)}function DG(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(l){return l};if(e==null||Gu(e)!=="object")return null;if(Array.isArray(e))return e.map(t);var r=e[PG.SYMBOL_ITERATOR];if(typeof r=="function"){for(var n=r.call(e),i=[],o,s=0;!(o=n.next()).done;++s)i.push(t(o.value,s));return i}var a=e.length;if(typeof a=="number"&&a>=0&&a%1===0){for(var u=[],c=0;c<a;++c){if(!Object.prototype.hasOwnProperty.call(e,c))return null;u.push(t(e[String(c)],c))}return u}return null}});var TT=y(Bu=>{"use strict";p();Object.defineProperty(Bu,"__esModule",{value:!0});Bu.default=void 0;var LG=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e},kG=LG;Bu.default=kG});var pr=y(lt=>{"use strict";p();Object.defineProperty(lt,"__esModule",{value:!0});lt.isSpecifiedScalarType=HG;lt.specifiedScalarTypes=lt.GraphQLID=lt.GraphQLBoolean=lt.GraphQLString=lt.GraphQLFloat=lt.GraphQLInt=void 0;var Ku=Qu(ef()),Hu=Qu(TT()),Yt=Qu(se()),IT=Qu(ar()),Ln=Ee(),is=mt(),We=K(),os=ie();function Qu(e){return e&&e.__esModule?e:{default:e}}var rf=2147483647,nf=-2147483648;function jG(e){var t=ss(e);if(typeof t=="boolean")return t?1:0;var r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),!(0,Hu.default)(r))throw new We.GraphQLError("Int cannot represent non-integer value: ".concat((0,Yt.default)(t)));if(r>rf||r<nf)throw new We.GraphQLError("Int cannot represent non 32-bit signed integer value: "+(0,Yt.default)(t));return r}function MG(e){if(!(0,Hu.default)(e))throw new We.GraphQLError("Int cannot represent non-integer value: ".concat((0,Yt.default)(e)));if(e>rf||e<nf)throw new We.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(e));return e}var wT=new os.GraphQLScalarType({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:jG,parseValue:MG,parseLiteral:function(t){if(t.kind!==Ln.Kind.INT)throw new We.GraphQLError("Int cannot represent non-integer value: ".concat((0,is.print)(t)),t);var r=parseInt(t.value,10);if(r>rf||r<nf)throw new We.GraphQLError("Int cannot represent non 32-bit signed integer value: ".concat(t.value),t);return r}});lt.GraphQLInt=wT;function FG(e){var t=ss(e);if(typeof t=="boolean")return t?1:0;var r=t;if(typeof t=="string"&&t!==""&&(r=Number(t)),!(0,Ku.default)(r))throw new We.GraphQLError("Float cannot represent non numeric value: ".concat((0,Yt.default)(t)));return r}function qG(e){if(!(0,Ku.default)(e))throw new We.GraphQLError("Float cannot represent non numeric value: ".concat((0,Yt.default)(e)));return e}var OT=new os.GraphQLScalarType({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:FG,parseValue:qG,parseLiteral:function(t){if(t.kind!==Ln.Kind.FLOAT&&t.kind!==Ln.Kind.INT)throw new We.GraphQLError("Float cannot represent non numeric value: ".concat((0,is.print)(t)),t);return parseFloat(t.value)}});lt.GraphQLFloat=OT;function ss(e){if((0,IT.default)(e)){if(typeof e.valueOf=="function"){var t=e.valueOf();if(!(0,IT.default)(t))return t}if(typeof e.toJSON=="function")return e.toJSON()}return e}function UG(e){var t=ss(e);if(typeof t=="string")return t;if(typeof t=="boolean")return t?"true":"false";if((0,Ku.default)(t))return t.toString();throw new We.GraphQLError("String cannot represent value: ".concat((0,Yt.default)(e)))}function VG(e){if(typeof e!="string")throw new We.GraphQLError("String cannot represent a non string value: ".concat((0,Yt.default)(e)));return e}var AT=new os.GraphQLScalarType({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:UG,parseValue:VG,parseLiteral:function(t){if(t.kind!==Ln.Kind.STRING)throw new We.GraphQLError("String cannot represent a non string value: ".concat((0,is.print)(t)),t);return t.value}});lt.GraphQLString=AT;function GG(e){var t=ss(e);if(typeof t=="boolean")return t;if((0,Ku.default)(t))return t!==0;throw new We.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,Yt.default)(t)))}function $G(e){if(typeof e!="boolean")throw new We.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,Yt.default)(e)));return e}var xT=new os.GraphQLScalarType({name:"Boolean",description:"The `Boolean` scalar type represents `true` or `false`.",serialize:GG,parseValue:$G,parseLiteral:function(t){if(t.kind!==Ln.Kind.BOOLEAN)throw new We.GraphQLError("Boolean cannot represent a non boolean value: ".concat((0,is.print)(t)),t);return t.value}});lt.GraphQLBoolean=xT;function BG(e){var t=ss(e);if(typeof t=="string")return t;if((0,Hu.default)(t))return String(t);throw new We.GraphQLError("ID cannot represent value: ".concat((0,Yt.default)(e)))}function KG(e){if(typeof e=="string")return e;if((0,Hu.default)(e))return e.toString();throw new We.GraphQLError("ID cannot represent value: ".concat((0,Yt.default)(e)))}var NT=new os.GraphQLScalarType({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:BG,parseValue:KG,parseLiteral:function(t){if(t.kind!==Ln.Kind.STRING&&t.kind!==Ln.Kind.INT)throw new We.GraphQLError("ID cannot represent a non-string and non-integer value: "+(0,is.print)(t),t);return t.value}});lt.GraphQLID=NT;var RT=Object.freeze([AT,wT,OT,xT,NT]);lt.specifiedScalarTypes=RT;function HG(e){return RT.some(function(t){var r=t.name;return e.name===r})}});var cs=y(of=>{"use strict";p();Object.defineProperty(of,"__esModule",{value:!0});of.astFromValue=us;var QG=Di(ef()),WG=Di(bt()),CT=Di(se()),zG=Di(et()),YG=Di(ar()),JG=Di($u()),Mt=Ee(),XG=pr(),as=ie();function Di(e){return e&&e.__esModule?e:{default:e}}function us(e,t){if((0,as.isNonNullType)(t)){var r=us(e,t.ofType);return r?.kind===Mt.Kind.NULL?null:r}if(e===null)return{kind:Mt.Kind.NULL};if(e===void 0)return null;if((0,as.isListType)(t)){var n=t.ofType,i=(0,JG.default)(e);if(i!=null){for(var o=[],s=0;s<i.length;s++){var a=i[s],u=us(a,n);u!=null&&o.push(u)}return{kind:Mt.Kind.LIST,values:o}}return us(e,n)}if((0,as.isInputObjectType)(t)){if(!(0,YG.default)(e))return null;for(var c=[],l=0,d=(0,WG.default)(t.getFields());l<d.length;l++){var f=d[l],h=us(e[f.name],f.type);h&&c.push({kind:Mt.Kind.OBJECT_FIELD,name:{kind:Mt.Kind.NAME,value:f.name},value:h})}return{kind:Mt.Kind.OBJECT,fields:c}}if((0,as.isLeafType)(t)){var g=t.serialize(e);if(g==null)return null;if(typeof g=="boolean")return{kind:Mt.Kind.BOOLEAN,value:g};if(typeof g=="number"&&(0,QG.default)(g)){var v=String(g);return PT.test(v)?{kind:Mt.Kind.INT,value:v}:{kind:Mt.Kind.FLOAT,value:v}}if(typeof g=="string")return(0,as.isEnumType)(t)?{kind:Mt.Kind.ENUM,value:g}:t===XG.GraphQLID&&PT.test(g)?{kind:Mt.Kind.INT,value:g}:{kind:Mt.Kind.STRING,value:g};throw new TypeError("Cannot convert value to AST: ".concat((0,CT.default)(g),"."))}(0,zG.default)(0,"Unexpected input type: "+(0,CT.default)(t))}var PT=/^-?(?:0|[1-9][0-9]*)$/});var qt=y(ye=>{"use strict";p();Object.defineProperty(ye,"__esModule",{value:!0});ye.isIntrospectionType=s1;ye.introspectionTypes=ye.TypeNameMetaFieldDef=ye.TypeMetaFieldDef=ye.SchemaMetaFieldDef=ye.__TypeKind=ye.TypeKind=ye.__EnumValue=ye.__InputValue=ye.__Field=ye.__Type=ye.__DirectiveLocation=ye.__Directive=ye.__Schema=void 0;var sf=af(bt()),ZG=af(se()),e1=af(et()),t1=mt(),$e=Ti(),r1=cs(),_e=pr(),q=ie();function af(e){return e&&e.__esModule?e:{default:e}}var uf=new q.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:function(){return{description:{type:_e.GraphQLString,resolve:function(r){return r.description}},types:{description:"A list of all types supported by this server.",type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(Ft))),resolve:function(r){return(0,sf.default)(r.getTypeMap())}},queryType:{description:"The type that query operations will be rooted at.",type:new q.GraphQLNonNull(Ft),resolve:function(r){return r.getQueryType()}},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:Ft,resolve:function(r){return r.getMutationType()}},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:Ft,resolve:function(r){return r.getSubscriptionType()}},directives:{description:"A list of all directives supported by this server.",type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(cf))),resolve:function(r){return r.getDirectives()}}}}});ye.__Schema=uf;var cf=new q.GraphQLObjectType({name:"__Directive",description:`A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.
|
|
72
72
|
|
|
73
|
-
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:function(){return{name:{type:new q.GraphQLNonNull(_e.GraphQLString),resolve:function(r){return r.name}},description:{type:_e.GraphQLString,resolve:function(r){return r.description}},isRepeatable:{type:new q.GraphQLNonNull(_e.GraphQLBoolean),resolve:function(r){return r.isRepeatable}},locations:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(af))),resolve:function(r){return r.locations}},args:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(cs))),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;return i?r.args:r.args.filter(function(o){return o.deprecationReason==null})}}}}});ye.__Directive=sf;var af=new q.GraphQLEnumType({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:Be.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:Be.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:Be.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:Be.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:Be.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:Be.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:Be.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:Be.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:Be.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:Be.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:Be.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:Be.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:Be.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:Be.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:Be.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:Be.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:Be.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:Be.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:Be.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});ye.__DirectiveLocation=af;var Ft=new q.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:new q.GraphQLNonNull(lf),resolve:function(r){if((0,q.isScalarType)(r))return tt.SCALAR;if((0,q.isObjectType)(r))return tt.OBJECT;if((0,q.isInterfaceType)(r))return tt.INTERFACE;if((0,q.isUnionType)(r))return tt.UNION;if((0,q.isEnumType)(r))return tt.ENUM;if((0,q.isInputObjectType)(r))return tt.INPUT_OBJECT;if((0,q.isListType)(r))return tt.LIST;if((0,q.isNonNullType)(r))return tt.NON_NULL;(0,HG.default)(0,'Unexpected type: "'.concat((0,KG.default)(r),'".'))}},name:{type:_e.GraphQLString,resolve:function(r){return r.name!==void 0?r.name:void 0}},description:{type:_e.GraphQLString,resolve:function(r){return r.description!==void 0?r.description:void 0}},specifiedByUrl:{type:_e.GraphQLString,resolve:function(r){return r.specifiedByUrl!==void 0?r.specifiedByUrl:void 0}},fields:{type:new q.GraphQLList(new q.GraphQLNonNull(uf)),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isObjectType)(r)||(0,q.isInterfaceType)(r)){var o=(0,rf.default)(r.getFields());return i?o:o.filter(function(s){return s.deprecationReason==null})}}},interfaces:{type:new q.GraphQLList(new q.GraphQLNonNull(Ft)),resolve:function(r){if((0,q.isObjectType)(r)||(0,q.isInterfaceType)(r))return r.getInterfaces()}},possibleTypes:{type:new q.GraphQLList(new q.GraphQLNonNull(Ft)),resolve:function(r,n,i,o){var s=o.schema;if((0,q.isAbstractType)(r))return s.getPossibleTypes(r)}},enumValues:{type:new q.GraphQLList(new q.GraphQLNonNull(cf)),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isEnumType)(r)){var o=r.getValues();return i?o:o.filter(function(s){return s.deprecationReason==null})}}},inputFields:{type:new q.GraphQLList(new q.GraphQLNonNull(cs)),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isInputObjectType)(r)){var o=(0,rf.default)(r.getFields());return i?o:o.filter(function(s){return s.deprecationReason==null})}}},ofType:{type:Ft,resolve:function(r){return r.ofType!==void 0?r.ofType:void 0}}}}});ye.__Type=Ft;var uf=new q.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:new q.GraphQLNonNull(_e.GraphQLString),resolve:function(r){return r.name}},description:{type:_e.GraphQLString,resolve:function(r){return r.description}},args:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(cs))),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;return i?r.args:r.args.filter(function(o){return o.deprecationReason==null})}},type:{type:new q.GraphQLNonNull(Ft),resolve:function(r){return r.type}},isDeprecated:{type:new q.GraphQLNonNull(_e.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:_e.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ye.__Field=uf;var cs=new q.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:new q.GraphQLNonNull(_e.GraphQLString),resolve:function(r){return r.name}},description:{type:_e.GraphQLString,resolve:function(r){return r.description}},type:{type:new q.GraphQLNonNull(Ft),resolve:function(r){return r.type}},defaultValue:{type:_e.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(r){var n=r.type,i=r.defaultValue,o=(0,WG.astFromValue)(i,n);return o?(0,QG.print)(o):null}},isDeprecated:{type:new q.GraphQLNonNull(_e.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:_e.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ye.__InputValue=cs;var cf=new q.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new q.GraphQLNonNull(_e.GraphQLString),resolve:function(r){return r.name}},description:{type:_e.GraphQLString,resolve:function(r){return r.description}},isDeprecated:{type:new q.GraphQLNonNull(_e.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:_e.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ye.__EnumValue=cf;var tt=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"});ye.TypeKind=tt;var lf=new q.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:tt.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:tt.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:tt.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:tt.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:tt.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:tt.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:tt.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:tt.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});ye.__TypeKind=lf;var zG={name:"__schema",type:new q.GraphQLNonNull(of),description:"Access the current type schema of this server.",args:[],resolve:function(t,r,n,i){var o=i.schema;return o},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};ye.SchemaMetaFieldDef=zG;var YG={name:"__type",type:Ft,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new q.GraphQLNonNull(_e.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(t,r,n,i){var o=r.name,s=i.schema;return s.getType(o)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};ye.TypeMetaFieldDef=YG;var JG={name:"__typename",type:new q.GraphQLNonNull(_e.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:function(t,r,n,i){var o=i.parentType;return o.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};ye.TypeNameMetaFieldDef=JG;var xT=Object.freeze([of,sf,af,Ft,uf,cs,cf,lf]);ye.introspectionTypes=xT;function XG(e){return xT.some(function(t){var r=t.name;return e.name===r})}});var gt=y($e=>{"use strict";p();Object.defineProperty($e,"__esModule",{value:!0});$e.isDirective=CT;$e.assertDirective=s1;$e.isSpecifiedDirective=a1;$e.specifiedDirectives=$e.GraphQLSpecifiedByDirective=$e.GraphQLDeprecatedDirective=$e.DEFAULT_DEPRECATION_REASON=$e.GraphQLSkipDirective=$e.GraphQLIncludeDirective=$e.GraphQLDirective=void 0;var ZG=Ln(Ai()),e1=ur(),t1=Ln(se()),NT=Ln(Ru()),pf=Ln(jt()),r1=Ln(Ko()),n1=Ln(ar()),i1=Ln(hu()),Jt=Si(),Hu=pr(),Qu=ie();function Ln(e){return e&&e.__esModule?e:{default:e}}function RT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o1(e,t,r){return t&&RT(e.prototype,t),r&&RT(e,r),e}function CT(e){return(0,r1.default)(e,kn)}function s1(e){if(!CT(e))throw new Error("Expected ".concat((0,t1.default)(e)," to be a GraphQL directive."));return e}var kn=(function(){function e(r){var n,i;this.name=r.name,this.description=r.description,this.locations=r.locations,this.isRepeatable=(n=r.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=r.extensions&&(0,NT.default)(r.extensions),this.astNode=r.astNode,r.name||(0,pf.default)(0,"Directive must be named."),Array.isArray(r.locations)||(0,pf.default)(0,"@".concat(r.name," locations must be an Array."));var o=(i=r.args)!==null&&i!==void 0?i:{};(0,n1.default)(o)&&!Array.isArray(o)||(0,pf.default)(0,"@".concat(r.name," args must be an object with argument names as keys.")),this.args=(0,ZG.default)(o).map(function(s){var a=s[0],u=s[1];return{name:a,description:u.description,type:u.type,defaultValue:u.defaultValue,deprecationReason:u.deprecationReason,extensions:u.extensions&&(0,NT.default)(u.extensions),astNode:u.astNode}})}var t=e.prototype;return t.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:(0,Qu.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},t.toString=function(){return"@"+this.name},t.toJSON=function(){return this.toString()},o1(e,[{key:e1.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLDirective"}}]),e})();$e.GraphQLDirective=kn;(0,i1.default)(kn);var PT=new kn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[Jt.DirectiveLocation.FIELD,Jt.DirectiveLocation.FRAGMENT_SPREAD,Jt.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Qu.GraphQLNonNull(Hu.GraphQLBoolean),description:"Included when true."}}});$e.GraphQLIncludeDirective=PT;var DT=new kn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[Jt.DirectiveLocation.FIELD,Jt.DirectiveLocation.FRAGMENT_SPREAD,Jt.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new Qu.GraphQLNonNull(Hu.GraphQLBoolean),description:"Skipped when true."}}});$e.GraphQLSkipDirective=DT;var LT="No longer supported";$e.DEFAULT_DEPRECATION_REASON=LT;var kT=new kn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[Jt.DirectiveLocation.FIELD_DEFINITION,Jt.DirectiveLocation.ARGUMENT_DEFINITION,Jt.DirectiveLocation.INPUT_FIELD_DEFINITION,Jt.DirectiveLocation.ENUM_VALUE],args:{reason:{type:Hu.GraphQLString,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:LT}}});$e.GraphQLDeprecatedDirective=kT;var jT=new kn({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[Jt.DirectiveLocation.SCALAR],args:{url:{type:new Qu.GraphQLNonNull(Hu.GraphQLString),description:"The URL that specifies the behaviour of this scalar."}}});$e.GraphQLSpecifiedByDirective=jT;var MT=Object.freeze([PT,DT,kT,jT]);$e.specifiedDirectives=MT;function a1(e){return MT.some(function(t){var r=t.name;return r===e.name})}});var jn=y(Di=>{"use strict";p();Object.defineProperty(Di,"__esModule",{value:!0});Di.isSchema=UT;Di.assertSchema=g1;Di.GraphQLSchema=void 0;var u1=tn(wi()),c1=tn(Yd()),df=tn(bt()),l1=ur(),ff=tn(se()),p1=tn(Ru()),Wu=tn(jt()),d1=tn(Ko()),f1=tn(ar()),h1=qt(),FT=gt(),Xt=ie();function tn(e){return e&&e.__esModule?e:{default:e}}function qT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m1(e,t,r){return t&&qT(e.prototype,t),r&&qT(e,r),e}function UT(e){return(0,d1.default)(e,VT)}function g1(e){if(!UT(e))throw new Error("Expected ".concat((0,ff.default)(e)," to be a GraphQL schema."));return e}var VT=(function(){function e(r){var n;this.__validationErrors=r.assumeValid===!0?[]:void 0,(0,f1.default)(r)||(0,Wu.default)(0,"Must provide configuration object."),!r.types||Array.isArray(r.types)||(0,Wu.default)(0,'"types" must be Array if provided but got: '.concat((0,ff.default)(r.types),".")),!r.directives||Array.isArray(r.directives)||(0,Wu.default)(0,'"directives" must be Array if provided but got: '+"".concat((0,ff.default)(r.directives),".")),this.description=r.description,this.extensions=r.extensions&&(0,p1.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=r.extensionASTNodes,this._queryType=r.query,this._mutationType=r.mutation,this._subscriptionType=r.subscription,this._directives=(n=r.directives)!==null&&n!==void 0?n:FT.specifiedDirectives;var i=new Set(r.types);if(r.types!=null)for(var o=0,s=r.types;o<s.length;o++){var a=s[o];i.delete(a),Zt(a,i)}this._queryType!=null&&Zt(this._queryType,i),this._mutationType!=null&&Zt(this._mutationType,i),this._subscriptionType!=null&&Zt(this._subscriptionType,i);for(var u=0,c=this._directives;u<c.length;u++){var l=c[u];if((0,FT.isDirective)(l))for(var d=0,f=l.args;d<f.length;d++){var h=f[d];Zt(h.type,i)}}Zt(h1.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var g=0,v=(0,c1.default)(i);g<v.length;g++){var _=v[g];if(_!=null){var S=_.name;if(S||(0,Wu.default)(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[S]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(S,'".'));if(this._typeMap[S]=_,(0,Xt.isInterfaceType)(_))for(var b=0,A=_.getInterfaces();b<A.length;b++){var w=A[b];if((0,Xt.isInterfaceType)(w)){var T=this._implementationsMap[w.name];T===void 0&&(T=this._implementationsMap[w.name]={objects:[],interfaces:[]}),T.interfaces.push(_)}}else if((0,Xt.isObjectType)(_))for(var x=0,U=_.getInterfaces();x<U.length;x++){var N=U[x];if((0,Xt.isInterfaceType)(N)){var te=this._implementationsMap[N.name];te===void 0&&(te=this._implementationsMap[N.name]={objects:[],interfaces:[]}),te.objects.push(_)}}}}}var t=e.prototype;return t.getQueryType=function(){return this._queryType},t.getMutationType=function(){return this._mutationType},t.getSubscriptionType=function(){return this._subscriptionType},t.getTypeMap=function(){return this._typeMap},t.getType=function(n){return this.getTypeMap()[n]},t.getPossibleTypes=function(n){return(0,Xt.isUnionType)(n)?n.getTypes():this.getImplementations(n).objects},t.getImplementations=function(n){var i=this._implementationsMap[n.name];return i??{objects:[],interfaces:[]}},t.isPossibleType=function(n,i){return this.isSubType(n,i)},t.isSubType=function(n,i){var o=this._subTypeMap[n.name];if(o===void 0){if(o=Object.create(null),(0,Xt.isUnionType)(n))for(var s=0,a=n.getTypes();s<a.length;s++){var u=a[s];o[u.name]=!0}else{for(var c=this.getImplementations(n),l=0,d=c.objects;l<d.length;l++){var f=d[l];o[f.name]=!0}for(var h=0,g=c.interfaces;h<g.length;h++){var v=g[h];o[v.name]=!0}}this._subTypeMap[n.name]=o}return o[i.name]!==void 0},t.getDirectives=function(){return this._directives},t.getDirective=function(n){return(0,u1.default)(this.getDirectives(),function(i){return i.name===n})},t.toConfig=function(){var n;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:(0,df.default)(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[],assumeValid:this.__validationErrors!==void 0}},m1(e,[{key:l1.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLSchema"}}]),e})();Di.GraphQLSchema=VT;function Zt(e,t){var r=(0,Xt.getNamedType)(e);if(!t.has(r)){if(t.add(r),(0,Xt.isUnionType)(r))for(var n=0,i=r.getTypes();n<i.length;n++){var o=i[n];Zt(o,t)}else if((0,Xt.isObjectType)(r)||(0,Xt.isInterfaceType)(r)){for(var s=0,a=r.getInterfaces();s<a.length;s++){var u=a[s];Zt(u,t)}for(var c=0,l=(0,df.default)(r.getFields());c<l.length;c++){var d=l[c];Zt(d.type,t);for(var f=0,h=d.args;f<h.length;f++){var g=h[f];Zt(g.type,t)}}}else if((0,Xt.isInputObjectType)(r))for(var v=0,_=(0,df.default)(r.getFields());v<_.length;v++){var S=_[v];Zt(S.type,t)}}return t}});var ds=y(zu=>{"use strict";p();Object.defineProperty(zu,"__esModule",{value:!0});zu.validateSchema=WT;zu.assertValidSchema=S1;var GT=mf(wi()),ps=mf(bt()),it=mf(se()),y1=K(),v1=zo(),E1=Id(),BT=rs(),_1=jn(),b1=qt(),QT=gt(),je=ie();function mf(e){return e&&e.__esModule?e:{default:e}}function WT(e){if((0,_1.assertSchema)(e),e.__validationErrors)return e.__validationErrors;var t=new T1(e);I1(t),O1(t),w1(t);var r=t.getErrors();return e.__validationErrors=r,r}function S1(e){var t=WT(e);if(t.length!==0)throw new Error(t.map(function(r){return r.message}).join(`
|
|
73
|
+
In some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.`,fields:function(){return{name:{type:new q.GraphQLNonNull(_e.GraphQLString),resolve:function(r){return r.name}},description:{type:_e.GraphQLString,resolve:function(r){return r.description}},isRepeatable:{type:new q.GraphQLNonNull(_e.GraphQLBoolean),resolve:function(r){return r.isRepeatable}},locations:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(lf))),resolve:function(r){return r.locations}},args:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(ls))),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;return i?r.args:r.args.filter(function(o){return o.deprecationReason==null})}}}}});ye.__Directive=cf;var lf=new q.GraphQLEnumType({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:$e.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:$e.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:$e.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:$e.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:$e.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:$e.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:$e.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:$e.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:$e.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:$e.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:$e.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:$e.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:$e.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:$e.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:$e.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:$e.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:$e.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:$e.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:$e.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});ye.__DirectiveLocation=lf;var Ft=new q.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByUrl`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:function(){return{kind:{type:new q.GraphQLNonNull(ff),resolve:function(r){if((0,q.isScalarType)(r))return tt.SCALAR;if((0,q.isObjectType)(r))return tt.OBJECT;if((0,q.isInterfaceType)(r))return tt.INTERFACE;if((0,q.isUnionType)(r))return tt.UNION;if((0,q.isEnumType)(r))return tt.ENUM;if((0,q.isInputObjectType)(r))return tt.INPUT_OBJECT;if((0,q.isListType)(r))return tt.LIST;if((0,q.isNonNullType)(r))return tt.NON_NULL;(0,e1.default)(0,'Unexpected type: "'.concat((0,ZG.default)(r),'".'))}},name:{type:_e.GraphQLString,resolve:function(r){return r.name!==void 0?r.name:void 0}},description:{type:_e.GraphQLString,resolve:function(r){return r.description!==void 0?r.description:void 0}},specifiedByUrl:{type:_e.GraphQLString,resolve:function(r){return r.specifiedByUrl!==void 0?r.specifiedByUrl:void 0}},fields:{type:new q.GraphQLList(new q.GraphQLNonNull(pf)),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isObjectType)(r)||(0,q.isInterfaceType)(r)){var o=(0,sf.default)(r.getFields());return i?o:o.filter(function(s){return s.deprecationReason==null})}}},interfaces:{type:new q.GraphQLList(new q.GraphQLNonNull(Ft)),resolve:function(r){if((0,q.isObjectType)(r)||(0,q.isInterfaceType)(r))return r.getInterfaces()}},possibleTypes:{type:new q.GraphQLList(new q.GraphQLNonNull(Ft)),resolve:function(r,n,i,o){var s=o.schema;if((0,q.isAbstractType)(r))return s.getPossibleTypes(r)}},enumValues:{type:new q.GraphQLList(new q.GraphQLNonNull(df)),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isEnumType)(r)){var o=r.getValues();return i?o:o.filter(function(s){return s.deprecationReason==null})}}},inputFields:{type:new q.GraphQLList(new q.GraphQLNonNull(ls)),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;if((0,q.isInputObjectType)(r)){var o=(0,sf.default)(r.getFields());return i?o:o.filter(function(s){return s.deprecationReason==null})}}},ofType:{type:Ft,resolve:function(r){return r.ofType!==void 0?r.ofType:void 0}}}}});ye.__Type=Ft;var pf=new q.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:function(){return{name:{type:new q.GraphQLNonNull(_e.GraphQLString),resolve:function(r){return r.name}},description:{type:_e.GraphQLString,resolve:function(r){return r.description}},args:{type:new q.GraphQLNonNull(new q.GraphQLList(new q.GraphQLNonNull(ls))),args:{includeDeprecated:{type:_e.GraphQLBoolean,defaultValue:!1}},resolve:function(r,n){var i=n.includeDeprecated;return i?r.args:r.args.filter(function(o){return o.deprecationReason==null})}},type:{type:new q.GraphQLNonNull(Ft),resolve:function(r){return r.type}},isDeprecated:{type:new q.GraphQLNonNull(_e.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:_e.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ye.__Field=pf;var ls=new q.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:function(){return{name:{type:new q.GraphQLNonNull(_e.GraphQLString),resolve:function(r){return r.name}},description:{type:_e.GraphQLString,resolve:function(r){return r.description}},type:{type:new q.GraphQLNonNull(Ft),resolve:function(r){return r.type}},defaultValue:{type:_e.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve:function(r){var n=r.type,i=r.defaultValue,o=(0,r1.astFromValue)(i,n);return o?(0,t1.print)(o):null}},isDeprecated:{type:new q.GraphQLNonNull(_e.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:_e.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ye.__InputValue=ls;var df=new q.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:function(){return{name:{type:new q.GraphQLNonNull(_e.GraphQLString),resolve:function(r){return r.name}},description:{type:_e.GraphQLString,resolve:function(r){return r.description}},isDeprecated:{type:new q.GraphQLNonNull(_e.GraphQLBoolean),resolve:function(r){return r.deprecationReason!=null}},deprecationReason:{type:_e.GraphQLString,resolve:function(r){return r.deprecationReason}}}}});ye.__EnumValue=df;var tt=Object.freeze({SCALAR:"SCALAR",OBJECT:"OBJECT",INTERFACE:"INTERFACE",UNION:"UNION",ENUM:"ENUM",INPUT_OBJECT:"INPUT_OBJECT",LIST:"LIST",NON_NULL:"NON_NULL"});ye.TypeKind=tt;var ff=new q.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:tt.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:tt.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:tt.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:tt.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:tt.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:tt.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:tt.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:tt.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});ye.__TypeKind=ff;var n1={name:"__schema",type:new q.GraphQLNonNull(uf),description:"Access the current type schema of this server.",args:[],resolve:function(t,r,n,i){var o=i.schema;return o},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};ye.SchemaMetaFieldDef=n1;var i1={name:"__type",type:Ft,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new q.GraphQLNonNull(_e.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:void 0,astNode:void 0}],resolve:function(t,r,n,i){var o=r.name,s=i.schema;return s.getType(o)},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};ye.TypeMetaFieldDef=i1;var o1={name:"__typename",type:new q.GraphQLNonNull(_e.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:function(t,r,n,i){var o=i.parentType;return o.name},isDeprecated:!1,deprecationReason:void 0,extensions:void 0,astNode:void 0};ye.TypeNameMetaFieldDef=o1;var DT=Object.freeze([uf,cf,lf,Ft,pf,ls,df,ff]);ye.introspectionTypes=DT;function s1(e){return DT.some(function(t){var r=t.name;return e.name===r})}});var gt=y(Be=>{"use strict";p();Object.defineProperty(Be,"__esModule",{value:!0});Be.isDirective=jT;Be.assertDirective=h1;Be.isSpecifiedDirective=m1;Be.specifiedDirectives=Be.GraphQLSpecifiedByDirective=Be.GraphQLDeprecatedDirective=Be.DEFAULT_DEPRECATION_REASON=Be.GraphQLSkipDirective=Be.GraphQLIncludeDirective=Be.GraphQLDirective=void 0;var a1=kn(xi()),u1=ur(),c1=kn(se()),LT=kn(Pu()),hf=kn(jt()),l1=kn(Ho()),p1=kn(ar()),d1=kn(gu()),Jt=Ti(),Wu=pr(),zu=ie();function kn(e){return e&&e.__esModule?e:{default:e}}function kT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f1(e,t,r){return t&&kT(e.prototype,t),r&&kT(e,r),e}function jT(e){return(0,l1.default)(e,jn)}function h1(e){if(!jT(e))throw new Error("Expected ".concat((0,c1.default)(e)," to be a GraphQL directive."));return e}var jn=(function(){function e(r){var n,i;this.name=r.name,this.description=r.description,this.locations=r.locations,this.isRepeatable=(n=r.isRepeatable)!==null&&n!==void 0?n:!1,this.extensions=r.extensions&&(0,LT.default)(r.extensions),this.astNode=r.astNode,r.name||(0,hf.default)(0,"Directive must be named."),Array.isArray(r.locations)||(0,hf.default)(0,"@".concat(r.name," locations must be an Array."));var o=(i=r.args)!==null&&i!==void 0?i:{};(0,p1.default)(o)&&!Array.isArray(o)||(0,hf.default)(0,"@".concat(r.name," args must be an object with argument names as keys.")),this.args=(0,a1.default)(o).map(function(s){var a=s[0],u=s[1];return{name:a,description:u.description,type:u.type,defaultValue:u.defaultValue,deprecationReason:u.deprecationReason,extensions:u.extensions&&(0,LT.default)(u.extensions),astNode:u.astNode}})}var t=e.prototype;return t.toConfig=function(){return{name:this.name,description:this.description,locations:this.locations,args:(0,zu.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}},t.toString=function(){return"@"+this.name},t.toJSON=function(){return this.toString()},f1(e,[{key:u1.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLDirective"}}]),e})();Be.GraphQLDirective=jn;(0,d1.default)(jn);var MT=new jn({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[Jt.DirectiveLocation.FIELD,Jt.DirectiveLocation.FRAGMENT_SPREAD,Jt.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new zu.GraphQLNonNull(Wu.GraphQLBoolean),description:"Included when true."}}});Be.GraphQLIncludeDirective=MT;var FT=new jn({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[Jt.DirectiveLocation.FIELD,Jt.DirectiveLocation.FRAGMENT_SPREAD,Jt.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new zu.GraphQLNonNull(Wu.GraphQLBoolean),description:"Skipped when true."}}});Be.GraphQLSkipDirective=FT;var qT="No longer supported";Be.DEFAULT_DEPRECATION_REASON=qT;var UT=new jn({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[Jt.DirectiveLocation.FIELD_DEFINITION,Jt.DirectiveLocation.ARGUMENT_DEFINITION,Jt.DirectiveLocation.INPUT_FIELD_DEFINITION,Jt.DirectiveLocation.ENUM_VALUE],args:{reason:{type:Wu.GraphQLString,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:qT}}});Be.GraphQLDeprecatedDirective=UT;var VT=new jn({name:"specifiedBy",description:"Exposes a URL that specifies the behaviour of this scalar.",locations:[Jt.DirectiveLocation.SCALAR],args:{url:{type:new zu.GraphQLNonNull(Wu.GraphQLString),description:"The URL that specifies the behaviour of this scalar."}}});Be.GraphQLSpecifiedByDirective=VT;var GT=Object.freeze([MT,FT,UT,VT]);Be.specifiedDirectives=GT;function m1(e){return GT.some(function(t){var r=t.name;return r===e.name})}});var Mn=y(Li=>{"use strict";p();Object.defineProperty(Li,"__esModule",{value:!0});Li.isSchema=KT;Li.assertSchema=I1;Li.GraphQLSchema=void 0;var g1=tn(Ai()),y1=tn(Zd()),mf=tn(bt()),v1=ur(),gf=tn(se()),E1=tn(Pu()),Yu=tn(jt()),_1=tn(Ho()),b1=tn(ar()),S1=qt(),$T=gt(),Xt=ie();function tn(e){return e&&e.__esModule?e:{default:e}}function BT(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function T1(e,t,r){return t&&BT(e.prototype,t),r&&BT(e,r),e}function KT(e){return(0,_1.default)(e,HT)}function I1(e){if(!KT(e))throw new Error("Expected ".concat((0,gf.default)(e)," to be a GraphQL schema."));return e}var HT=(function(){function e(r){var n;this.__validationErrors=r.assumeValid===!0?[]:void 0,(0,b1.default)(r)||(0,Yu.default)(0,"Must provide configuration object."),!r.types||Array.isArray(r.types)||(0,Yu.default)(0,'"types" must be Array if provided but got: '.concat((0,gf.default)(r.types),".")),!r.directives||Array.isArray(r.directives)||(0,Yu.default)(0,'"directives" must be Array if provided but got: '+"".concat((0,gf.default)(r.directives),".")),this.description=r.description,this.extensions=r.extensions&&(0,E1.default)(r.extensions),this.astNode=r.astNode,this.extensionASTNodes=r.extensionASTNodes,this._queryType=r.query,this._mutationType=r.mutation,this._subscriptionType=r.subscription,this._directives=(n=r.directives)!==null&&n!==void 0?n:$T.specifiedDirectives;var i=new Set(r.types);if(r.types!=null)for(var o=0,s=r.types;o<s.length;o++){var a=s[o];i.delete(a),Zt(a,i)}this._queryType!=null&&Zt(this._queryType,i),this._mutationType!=null&&Zt(this._mutationType,i),this._subscriptionType!=null&&Zt(this._subscriptionType,i);for(var u=0,c=this._directives;u<c.length;u++){var l=c[u];if((0,$T.isDirective)(l))for(var d=0,f=l.args;d<f.length;d++){var h=f[d];Zt(h.type,i)}}Zt(S1.__Schema,i),this._typeMap=Object.create(null),this._subTypeMap=Object.create(null),this._implementationsMap=Object.create(null);for(var g=0,v=(0,y1.default)(i);g<v.length;g++){var _=v[g];if(_!=null){var S=_.name;if(S||(0,Yu.default)(0,"One of the provided types for building the Schema is missing a name."),this._typeMap[S]!==void 0)throw new Error('Schema must contain uniquely named types but contains multiple types named "'.concat(S,'".'));if(this._typeMap[S]=_,(0,Xt.isInterfaceType)(_))for(var b=0,A=_.getInterfaces();b<A.length;b++){var O=A[b];if((0,Xt.isInterfaceType)(O)){var T=this._implementationsMap[O.name];T===void 0&&(T=this._implementationsMap[O.name]={objects:[],interfaces:[]}),T.interfaces.push(_)}}else if((0,Xt.isObjectType)(_))for(var x=0,U=_.getInterfaces();x<U.length;x++){var N=U[x];if((0,Xt.isInterfaceType)(N)){var te=this._implementationsMap[N.name];te===void 0&&(te=this._implementationsMap[N.name]={objects:[],interfaces:[]}),te.objects.push(_)}}}}}var t=e.prototype;return t.getQueryType=function(){return this._queryType},t.getMutationType=function(){return this._mutationType},t.getSubscriptionType=function(){return this._subscriptionType},t.getTypeMap=function(){return this._typeMap},t.getType=function(n){return this.getTypeMap()[n]},t.getPossibleTypes=function(n){return(0,Xt.isUnionType)(n)?n.getTypes():this.getImplementations(n).objects},t.getImplementations=function(n){var i=this._implementationsMap[n.name];return i??{objects:[],interfaces:[]}},t.isPossibleType=function(n,i){return this.isSubType(n,i)},t.isSubType=function(n,i){var o=this._subTypeMap[n.name];if(o===void 0){if(o=Object.create(null),(0,Xt.isUnionType)(n))for(var s=0,a=n.getTypes();s<a.length;s++){var u=a[s];o[u.name]=!0}else{for(var c=this.getImplementations(n),l=0,d=c.objects;l<d.length;l++){var f=d[l];o[f.name]=!0}for(var h=0,g=c.interfaces;h<g.length;h++){var v=g[h];o[v.name]=!0}}this._subTypeMap[n.name]=o}return o[i.name]!==void 0},t.getDirectives=function(){return this._directives},t.getDirective=function(n){return(0,g1.default)(this.getDirectives(),function(i){return i.name===n})},t.toConfig=function(){var n;return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:(0,mf.default)(this.getTypeMap()),directives:this.getDirectives().slice(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:(n=this.extensionASTNodes)!==null&&n!==void 0?n:[],assumeValid:this.__validationErrors!==void 0}},T1(e,[{key:v1.SYMBOL_TO_STRING_TAG,get:function(){return"GraphQLSchema"}}]),e})();Li.GraphQLSchema=HT;function Zt(e,t){var r=(0,Xt.getNamedType)(e);if(!t.has(r)){if(t.add(r),(0,Xt.isUnionType)(r))for(var n=0,i=r.getTypes();n<i.length;n++){var o=i[n];Zt(o,t)}else if((0,Xt.isObjectType)(r)||(0,Xt.isInterfaceType)(r)){for(var s=0,a=r.getInterfaces();s<a.length;s++){var u=a[s];Zt(u,t)}for(var c=0,l=(0,mf.default)(r.getFields());c<l.length;c++){var d=l[c];Zt(d.type,t);for(var f=0,h=d.args;f<h.length;f++){var g=h[f];Zt(g.type,t)}}}else if((0,Xt.isInputObjectType)(r))for(var v=0,_=(0,mf.default)(r.getFields());v<_.length;v++){var S=_[v];Zt(S.type,t)}}return t}});var fs=y(Ju=>{"use strict";p();Object.defineProperty(Ju,"__esModule",{value:!0});Ju.validateSchema=ZT;Ju.assertValidSchema=R1;var QT=vf(Ai()),ds=vf(bt()),it=vf(se()),w1=K(),O1=Yo(),A1=Ad(),WT=ns(),x1=Mn(),N1=qt(),XT=gt(),je=ie();function vf(e){return e&&e.__esModule?e:{default:e}}function ZT(e){if((0,x1.assertSchema)(e),e.__validationErrors)return e.__validationErrors;var t=new C1(e);P1(t),D1(t),L1(t);var r=t.getErrors();return e.__validationErrors=r,r}function R1(e){var t=ZT(e);if(t.length!==0)throw new Error(t.map(function(r){return r.message}).join(`
|
|
74
74
|
|
|
75
|
-
`))}var T1=(function(){function e(r){this._errors=[],this.schema=r}var t=e.prototype;return t.reportError=function(n,i){var o=Array.isArray(i)?i.filter(Boolean):i;this.addError(new y1.GraphQLError(n,o))},t.addError=function(n){this._errors.push(n)},t.getErrors=function(){return this._errors},e})();function I1(e){var t=e.schema,r=t.getQueryType();if(!r)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,je.isObjectType)(r)){var n;e.reportError("Query root type must be Object type, it cannot be ".concat((0,it.default)(r),"."),(n=hf(t,"query"))!==null&&n!==void 0?n:r.astNode)}var i=t.getMutationType();if(i&&!(0,je.isObjectType)(i)){var o;e.reportError("Mutation root type must be Object type if provided, it cannot be "+"".concat((0,it.default)(i),"."),(o=hf(t,"mutation"))!==null&&o!==void 0?o:i.astNode)}var s=t.getSubscriptionType();if(s&&!(0,je.isObjectType)(s)){var a;e.reportError("Subscription root type must be Object type if provided, it cannot be "+"".concat((0,it.default)(s),"."),(a=hf(t,"subscription"))!==null&&a!==void 0?a:s.astNode)}}function hf(e,t){for(var r=gf(e,function(o){return o.operationTypes}),n=0;n<r.length;n++){var i=r[n];if(i.operation===t)return i.type}}function O1(e){for(var t=0,r=e.schema.getDirectives();t<r.length;t++){var n=r[t];if(!(0,QT.isDirective)(n)){e.reportError("Expected directive but got: ".concat((0,it.default)(n),"."),n?.astNode);continue}Mn(e,n);for(var i=0,o=n.args;i<o.length;i++){var s=o[i];if(Mn(e,s),(0,je.isInputType)(s.type)||e.reportError("The type of @".concat(n.name,"(").concat(s.name,":) must be Input Type ")+"but got: ".concat((0,it.default)(s.type),"."),s.astNode),(0,je.isRequiredArgument)(s)&&s.deprecationReason!=null){var a;e.reportError("Required argument @".concat(n.name,"(").concat(s.name,":) cannot be deprecated."),[yf(s.astNode),(a=s.astNode)===null||a===void 0?void 0:a.type])}}}}function Mn(e,t){var r=(0,E1.isValidNameError)(t.name);r&&e.addError((0,v1.locatedError)(r,t.astNode))}function w1(e){for(var t=P1(e),r=e.schema.getTypeMap(),n=0,i=(0,ps.default)(r);n<i.length;n++){var o=i[n];if(!(0,je.isNamedType)(o)){e.reportError("Expected GraphQL named type but got: ".concat((0,it.default)(o),"."),o.astNode);continue}(0,b1.isIntrospectionType)(o)||Mn(e,o),(0,je.isObjectType)(o)||(0,je.isInterfaceType)(o)?($T(e,o),KT(e,o)):(0,je.isUnionType)(o)?N1(e,o):(0,je.isEnumType)(o)?R1(e,o):(0,je.isInputObjectType)(o)&&(C1(e,o),t(o))}}function $T(e,t){var r=(0,ps.default)(t.getFields());r.length===0&&e.reportError("Type ".concat(t.name," must define one or more fields."),Li(t));for(var n=0;n<r.length;n++){var i=r[n];if(Mn(e,i),!(0,je.isOutputType)(i.type)){var o;e.reportError("The type of ".concat(t.name,".").concat(i.name," must be Output Type ")+"but got: ".concat((0,it.default)(i.type),"."),(o=i.astNode)===null||o===void 0?void 0:o.type)}for(var s=0,a=i.args;s<a.length;s++){var u=a[s],c=u.name;if(Mn(e,u),!(0,je.isInputType)(u.type)){var l;e.reportError("The type of ".concat(t.name,".").concat(i.name,"(").concat(c,":) must be Input ")+"Type but got: ".concat((0,it.default)(u.type),"."),(l=u.astNode)===null||l===void 0?void 0:l.type)}if((0,je.isRequiredArgument)(u)&&u.deprecationReason!=null){var d;e.reportError("Required argument ".concat(t.name,".").concat(i.name,"(").concat(c,":) cannot be deprecated."),[yf(u.astNode),(d=u.astNode)===null||d===void 0?void 0:d.type])}}}}function KT(e,t){for(var r=Object.create(null),n=0,i=t.getInterfaces();n<i.length;n++){var o=i[n];if(!(0,je.isInterfaceType)(o)){e.reportError("Type ".concat((0,it.default)(t)," must only implement Interface types, ")+"it cannot implement ".concat((0,it.default)(o),"."),ls(t,o));continue}if(t===o){e.reportError("Type ".concat(t.name," cannot implement itself because it would create a circular reference."),ls(t,o));continue}if(r[o.name]){e.reportError("Type ".concat(t.name," can only implement ").concat(o.name," once."),ls(t,o));continue}r[o.name]=!0,x1(e,t,o),A1(e,t,o)}}function A1(e,t,r){for(var n=t.getFields(),i=0,o=(0,ps.default)(r.getFields());i<o.length;i++){var s=o[i],a=s.name,u=n[a];if(!u){e.reportError("Interface field ".concat(r.name,".").concat(a," expected but ").concat(t.name," does not provide it."),[s.astNode].concat(Li(t)));continue}if(!(0,BT.isTypeSubTypeOf)(e.schema,u.type,s.type)){var c,l;e.reportError("Interface field ".concat(r.name,".").concat(a," expects type ")+"".concat((0,it.default)(s.type)," but ").concat(t.name,".").concat(a," ")+"is type ".concat((0,it.default)(u.type),"."),[(c=s.astNode)===null||c===void 0?void 0:c.type,(l=u.astNode)===null||l===void 0?void 0:l.type])}for(var d=function(A,w){var T=w[A],x=T.name,U=(0,GT.default)(u.args,function(pe){return pe.name===x});if(!U)return e.reportError("Interface field argument ".concat(r.name,".").concat(a,"(").concat(x,":) expected but ").concat(t.name,".").concat(a," does not provide it."),[T.astNode,u.astNode]),"continue";if(!(0,BT.isEqualType)(T.type,U.type)){var N,te;e.reportError("Interface field argument ".concat(r.name,".").concat(a,"(").concat(x,":) ")+"expects type ".concat((0,it.default)(T.type)," but ")+"".concat(t.name,".").concat(a,"(").concat(x,":) is type ")+"".concat((0,it.default)(U.type),"."),[(N=T.astNode)===null||N===void 0?void 0:N.type,(te=U.astNode)===null||te===void 0?void 0:te.type])}},f=0,h=s.args;f<h.length;f++)var g=d(f,h);for(var v=function(A,w){var T=w[A],x=T.name,U=(0,GT.default)(s.args,function(N){return N.name===x});!U&&(0,je.isRequiredArgument)(T)&&e.reportError("Object field ".concat(t.name,".").concat(a," includes required argument ").concat(x," that is missing from the Interface field ").concat(r.name,".").concat(a,"."),[T.astNode,s.astNode])},_=0,S=u.args;_<S.length;_++)v(_,S)}}function x1(e,t,r){for(var n=t.getInterfaces(),i=0,o=r.getInterfaces();i<o.length;i++){var s=o[i];n.indexOf(s)===-1&&e.reportError(s===t?"Type ".concat(t.name," cannot implement ").concat(r.name," because it would create a circular reference."):"Type ".concat(t.name," must implement ").concat(s.name," because it is implemented by ").concat(r.name,"."),[].concat(ls(r,s),ls(t,r)))}}function N1(e,t){var r=t.getTypes();r.length===0&&e.reportError("Union type ".concat(t.name," must define one or more member types."),Li(t));for(var n=Object.create(null),i=0;i<r.length;i++){var o=r[i];if(n[o.name]){e.reportError("Union type ".concat(t.name," can only include type ").concat(o.name," once."),HT(t,o.name));continue}n[o.name]=!0,(0,je.isObjectType)(o)||e.reportError("Union type ".concat(t.name," can only include Object types, ")+"it cannot include ".concat((0,it.default)(o),"."),HT(t,String(o)))}}function R1(e,t){var r=t.getValues();r.length===0&&e.reportError("Enum type ".concat(t.name," must define one or more values."),Li(t));for(var n=0;n<r.length;n++){var i=r[n],o=i.name;Mn(e,i),(o==="true"||o==="false"||o==="null")&&e.reportError("Enum type ".concat(t.name," cannot include value: ").concat(o,"."),i.astNode)}}function C1(e,t){var r=(0,ps.default)(t.getFields());r.length===0&&e.reportError("Input Object type ".concat(t.name," must define one or more fields."),Li(t));for(var n=0;n<r.length;n++){var i=r[n];if(Mn(e,i),!(0,je.isInputType)(i.type)){var o;e.reportError("The type of ".concat(t.name,".").concat(i.name," must be Input Type ")+"but got: ".concat((0,it.default)(i.type),"."),(o=i.astNode)===null||o===void 0?void 0:o.type)}if((0,je.isRequiredInputField)(i)&&i.deprecationReason!=null){var s;e.reportError("Required input field ".concat(t.name,".").concat(i.name," cannot be deprecated."),[yf(i.astNode),(s=i.astNode)===null||s===void 0?void 0:s.type])}}}function P1(e){var t=Object.create(null),r=[],n=Object.create(null);return i;function i(o){if(!t[o.name]){t[o.name]=!0,n[o.name]=r.length;for(var s=(0,ps.default)(o.getFields()),a=0;a<s.length;a++){var u=s[a];if((0,je.isNonNullType)(u.type)&&(0,je.isInputObjectType)(u.type.ofType)){var c=u.type.ofType,l=n[c.name];if(r.push(u),l===void 0)i(c);else{var d=r.slice(l),f=d.map(function(h){return h.name}).join(".");e.reportError('Cannot reference Input Object "'.concat(c.name,'" within itself through a series of non-null fields: "').concat(f,'".'),d.map(function(h){return h.astNode}))}r.pop()}}n[o.name]=void 0}}}function Li(e){var t=e.astNode,r=e.extensionASTNodes;return t?r?[t].concat(r):[t]:r??[]}function gf(e,t){for(var r=[],n=0,i=Li(e);n<i.length;n++){var o,s=i[n];r=r.concat((o=t(s))!==null&&o!==void 0?o:[])}return r}function ls(e,t){return gf(e,function(r){return r.interfaces}).filter(function(r){return r.name.value===t.name})}function HT(e,t){return gf(e,function(r){return r.types}).filter(function(r){return r.name.value===t})}function yf(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(function(r){return r.name.value===QT.GraphQLDeprecatedDirective.name})}});var dr=y(_f=>{"use strict";p();Object.defineProperty(_f,"__esModule",{value:!0});_f.typeFromAST=Ef;var D1=YT(se()),L1=YT(et()),vf=Ee(),zT=ie();function YT(e){return e&&e.__esModule?e:{default:e}}function Ef(e,t){var r;if(t.kind===vf.Kind.LIST_TYPE)return r=Ef(e,t.type),r&&new zT.GraphQLList(r);if(t.kind===vf.Kind.NON_NULL_TYPE)return r=Ef(e,t.type),r&&new zT.GraphQLNonNull(r);if(t.kind===vf.Kind.NAMED_TYPE)return e.getType(t.name.value);(0,L1.default)(0,"Unexpected type node: "+(0,D1.default)(t))}});var Yu=y(fs=>{"use strict";p();Object.defineProperty(fs,"__esModule",{value:!0});fs.visitWithTypeInfo=U1;fs.TypeInfo=void 0;var k1=M1(wi()),Pe=Ee(),j1=_i(),JT=Kr(),De=ie(),ki=qt(),XT=dr();function M1(e){return e&&e.__esModule?e:{default:e}}var F1=(function(){function e(r,n,i){this._schema=r,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??q1,i&&((0,De.isInputType)(i)&&this._inputTypeStack.push(i),(0,De.isCompositeType)(i)&&this._parentTypeStack.push(i),(0,De.isOutputType)(i)&&this._typeStack.push(i))}var t=e.prototype;return t.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},t.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},t.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},t.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},t.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},t.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},t.getDirective=function(){return this._directive},t.getArgument=function(){return this._argument},t.getEnumValue=function(){return this._enumValue},t.enter=function(n){var i=this._schema;switch(n.kind){case Pe.Kind.SELECTION_SET:{var o=(0,De.getNamedType)(this.getType());this._parentTypeStack.push((0,De.isCompositeType)(o)?o:void 0);break}case Pe.Kind.FIELD:{var s=this.getParentType(),a,u;s&&(a=this._getFieldDef(i,s,n),a&&(u=a.type)),this._fieldDefStack.push(a),this._typeStack.push((0,De.isOutputType)(u)?u:void 0);break}case Pe.Kind.DIRECTIVE:this._directive=i.getDirective(n.name.value);break;case Pe.Kind.OPERATION_DEFINITION:{var c;switch(n.operation){case"query":c=i.getQueryType();break;case"mutation":c=i.getMutationType();break;case"subscription":c=i.getSubscriptionType();break}this._typeStack.push((0,De.isObjectType)(c)?c:void 0);break}case Pe.Kind.INLINE_FRAGMENT:case Pe.Kind.FRAGMENT_DEFINITION:{var l=n.typeCondition,d=l?(0,XT.typeFromAST)(i,l):(0,De.getNamedType)(this.getType());this._typeStack.push((0,De.isOutputType)(d)?d:void 0);break}case Pe.Kind.VARIABLE_DEFINITION:{var f=(0,XT.typeFromAST)(i,n.type);this._inputTypeStack.push((0,De.isInputType)(f)?f:void 0);break}case Pe.Kind.ARGUMENT:{var h,g,v,_=(h=this.getDirective())!==null&&h!==void 0?h:this.getFieldDef();_&&(g=(0,k1.default)(_.args,function(N){return N.name===n.name.value}),g&&(v=g.type)),this._argument=g,this._defaultValueStack.push(g?g.defaultValue:void 0),this._inputTypeStack.push((0,De.isInputType)(v)?v:void 0);break}case Pe.Kind.LIST:{var S=(0,De.getNullableType)(this.getInputType()),b=(0,De.isListType)(S)?S.ofType:S;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,De.isInputType)(b)?b:void 0);break}case Pe.Kind.OBJECT_FIELD:{var A=(0,De.getNamedType)(this.getInputType()),w,T;(0,De.isInputObjectType)(A)&&(T=A.getFields()[n.name.value],T&&(w=T.type)),this._defaultValueStack.push(T?T.defaultValue:void 0),this._inputTypeStack.push((0,De.isInputType)(w)?w:void 0);break}case Pe.Kind.ENUM:{var x=(0,De.getNamedType)(this.getInputType()),U;(0,De.isEnumType)(x)&&(U=x.getValue(n.value)),this._enumValue=U;break}}},t.leave=function(n){switch(n.kind){case Pe.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case Pe.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Pe.Kind.DIRECTIVE:this._directive=null;break;case Pe.Kind.OPERATION_DEFINITION:case Pe.Kind.INLINE_FRAGMENT:case Pe.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Pe.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Pe.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Pe.Kind.LIST:case Pe.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Pe.Kind.ENUM:this._enumValue=null;break}},e})();fs.TypeInfo=F1;function q1(e,t,r){var n=r.name.value;if(n===ki.SchemaMetaFieldDef.name&&e.getQueryType()===t)return ki.SchemaMetaFieldDef;if(n===ki.TypeMetaFieldDef.name&&e.getQueryType()===t)return ki.TypeMetaFieldDef;if(n===ki.TypeNameMetaFieldDef.name&&(0,De.isCompositeType)(t))return ki.TypeNameMetaFieldDef;if((0,De.isObjectType)(t)||(0,De.isInterfaceType)(t))return t.getFields()[n]}function U1(e,t){return{enter:function(n){e.enter(n);var i=(0,JT.getVisitFn)(t,n.kind,!1);if(i){var o=i.apply(t,arguments);return o!==void 0&&(e.leave(n),(0,j1.isNode)(o)&&e.enter(o)),o}},leave:function(n){var i=(0,JT.getVisitFn)(t,n.kind,!0),o;return i&&(o=i.apply(t,arguments)),e.leave(n),o}}}});var Fn=y(er=>{"use strict";p();Object.defineProperty(er,"__esModule",{value:!0});er.isDefinitionNode=V1;er.isExecutableDefinitionNode=ZT;er.isSelectionNode=G1;er.isValueNode=B1;er.isTypeNode=$1;er.isTypeSystemDefinitionNode=eI;er.isTypeDefinitionNode=tI;er.isTypeSystemExtensionNode=rI;er.isTypeExtensionNode=nI;var ae=Ee();function V1(e){return ZT(e)||eI(e)||rI(e)}function ZT(e){return e.kind===ae.Kind.OPERATION_DEFINITION||e.kind===ae.Kind.FRAGMENT_DEFINITION}function G1(e){return e.kind===ae.Kind.FIELD||e.kind===ae.Kind.FRAGMENT_SPREAD||e.kind===ae.Kind.INLINE_FRAGMENT}function B1(e){return e.kind===ae.Kind.VARIABLE||e.kind===ae.Kind.INT||e.kind===ae.Kind.FLOAT||e.kind===ae.Kind.STRING||e.kind===ae.Kind.BOOLEAN||e.kind===ae.Kind.NULL||e.kind===ae.Kind.ENUM||e.kind===ae.Kind.LIST||e.kind===ae.Kind.OBJECT}function $1(e){return e.kind===ae.Kind.NAMED_TYPE||e.kind===ae.Kind.LIST_TYPE||e.kind===ae.Kind.NON_NULL_TYPE}function eI(e){return e.kind===ae.Kind.SCHEMA_DEFINITION||tI(e)||e.kind===ae.Kind.DIRECTIVE_DEFINITION}function tI(e){return e.kind===ae.Kind.SCALAR_TYPE_DEFINITION||e.kind===ae.Kind.OBJECT_TYPE_DEFINITION||e.kind===ae.Kind.INTERFACE_TYPE_DEFINITION||e.kind===ae.Kind.UNION_TYPE_DEFINITION||e.kind===ae.Kind.ENUM_TYPE_DEFINITION||e.kind===ae.Kind.INPUT_OBJECT_TYPE_DEFINITION}function rI(e){return e.kind===ae.Kind.SCHEMA_EXTENSION||nI(e)}function nI(e){return e.kind===ae.Kind.SCALAR_TYPE_EXTENSION||e.kind===ae.Kind.OBJECT_TYPE_EXTENSION||e.kind===ae.Kind.INTERFACE_TYPE_EXTENSION||e.kind===ae.Kind.UNION_TYPE_EXTENSION||e.kind===ae.Kind.ENUM_TYPE_EXTENSION||e.kind===ae.Kind.INPUT_OBJECT_TYPE_EXTENSION}});var Sf=y(bf=>{"use strict";p();Object.defineProperty(bf,"__esModule",{value:!0});bf.ExecutableDefinitionsRule=Q1;var K1=K(),iI=Ee(),H1=Fn();function Q1(e){return{Document:function(r){for(var n=0,i=r.definitions;n<i.length;n++){var o=i[n];if(!(0,H1.isExecutableDefinitionNode)(o)){var s=o.kind===iI.Kind.SCHEMA_DEFINITION||o.kind===iI.Kind.SCHEMA_EXTENSION?"schema":'"'+o.name.value+'"';e.reportError(new K1.GraphQLError("The ".concat(s," definition is not executable."),o))}}return!1}}}});var If=y(Tf=>{"use strict";p();Object.defineProperty(Tf,"__esModule",{value:!0});Tf.UniqueOperationNamesRule=z1;var W1=K();function z1(e){var t=Object.create(null);return{OperationDefinition:function(n){var i=n.name;return i&&(t[i.value]?e.reportError(new W1.GraphQLError('There can be only one operation named "'.concat(i.value,'".'),[t[i.value],i])):t[i.value]=i),!1},FragmentDefinition:function(){return!1}}}});var wf=y(Of=>{"use strict";p();Object.defineProperty(Of,"__esModule",{value:!0});Of.LoneAnonymousOperationRule=X1;var Y1=K(),J1=Ee();function X1(e){var t=0;return{Document:function(n){t=n.definitions.filter(function(i){return i.kind===J1.Kind.OPERATION_DEFINITION}).length},OperationDefinition:function(n){!n.name&&t>1&&e.reportError(new Y1.GraphQLError("This anonymous operation must be the only defined operation.",n))}}}});var xf=y(Af=>{"use strict";p();Object.defineProperty(Af,"__esModule",{value:!0});Af.SingleFieldSubscriptionsRule=eB;var Z1=K();function eB(e){return{OperationDefinition:function(r){r.operation==="subscription"&&r.selectionSet.selections.length!==1&&e.reportError(new Z1.GraphQLError(r.name?'Subscription "'.concat(r.name.value,'" must select only one top level field.'):"Anonymous Subscription must select only one top level field.",r.selectionSet.selections.slice(1)))}}}});var Cf=y(Rf=>{"use strict";p();Object.defineProperty(Rf,"__esModule",{value:!0});Rf.KnownTypeNamesRule=sB;var tB=oI(Qr()),rB=oI(Wr()),nB=K(),Nf=Fn(),iB=pr(),oB=qt();function oI(e){return e&&e.__esModule?e:{default:e}}function sB(e){for(var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null),i=0,o=e.getDocument().definitions;i<o.length;i++){var s=o[i];(0,Nf.isTypeDefinitionNode)(s)&&(n[s.name.value]=!0)}var a=Object.keys(r).concat(Object.keys(n));return{NamedType:function(c,l,d,f,h){var g=c.name.value;if(!r[g]&&!n[g]){var v,_=(v=h[2])!==null&&v!==void 0?v:d,S=_!=null&&uB(_);if(S&&aB(g))return;var b=(0,rB.default)(g,S?sI.concat(a):a);e.reportError(new nB.GraphQLError('Unknown type "'.concat(g,'".')+(0,tB.default)(b),c))}}}}var sI=[].concat(iB.specifiedScalarTypes,oB.introspectionTypes).map(function(e){return e.name});function aB(e){return sI.indexOf(e)!==-1}function uB(e){return!Array.isArray(e)&&((0,Nf.isTypeSystemDefinitionNode)(e)||(0,Nf.isTypeSystemExtensionNode)(e))}});var Df=y(Pf=>{"use strict";p();Object.defineProperty(Pf,"__esModule",{value:!0});Pf.FragmentsOnCompositeTypesRule=cB;var aI=K(),uI=mt(),cI=ie(),lI=dr();function cB(e){return{InlineFragment:function(r){var n=r.typeCondition;if(n){var i=(0,lI.typeFromAST)(e.getSchema(),n);if(i&&!(0,cI.isCompositeType)(i)){var o=(0,uI.print)(n);e.reportError(new aI.GraphQLError('Fragment cannot condition on non composite type "'.concat(o,'".'),n))}}},FragmentDefinition:function(r){var n=(0,lI.typeFromAST)(e.getSchema(),r.typeCondition);if(n&&!(0,cI.isCompositeType)(n)){var i=(0,uI.print)(r.typeCondition);e.reportError(new aI.GraphQLError('Fragment "'.concat(r.name.value,'" cannot condition on non composite type "').concat(i,'".'),r.typeCondition))}}}}});var kf=y(Lf=>{"use strict";p();Object.defineProperty(Lf,"__esModule",{value:!0});Lf.VariablesAreInputTypesRule=hB;var lB=K(),pB=mt(),dB=ie(),fB=dr();function hB(e){return{VariableDefinition:function(r){var n=(0,fB.typeFromAST)(e.getSchema(),r.type);if(n&&!(0,dB.isInputType)(n)){var i=r.variable.name.value,o=(0,pB.print)(r.type);e.reportError(new lB.GraphQLError('Variable "$'.concat(i,'" cannot be non-input type "').concat(o,'".'),r.type))}}}}});var Mf=y(jf=>{"use strict";p();Object.defineProperty(jf,"__esModule",{value:!0});jf.ScalarLeafsRule=gB;var pI=mB(se()),dI=K(),fI=ie();function mB(e){return e&&e.__esModule?e:{default:e}}function gB(e){return{Field:function(r){var n=e.getType(),i=r.selectionSet;if(n){if((0,fI.isLeafType)((0,fI.getNamedType)(n))){if(i){var o=r.name.value,s=(0,pI.default)(n);e.reportError(new dI.GraphQLError('Field "'.concat(o,'" must not have a selection since type "').concat(s,'" has no subfields.'),i))}}else if(!i){var a=r.name.value,u=(0,pI.default)(n);e.reportError(new dI.GraphQLError('Field "'.concat(a,'" of type "').concat(u,'" must have a selection of subfields. Did you mean "').concat(a,' { ... }"?'),r))}}}}}});var qf=y(Ff=>{"use strict";p();Object.defineProperty(Ff,"__esModule",{value:!0});Ff.FieldsOnCorrectTypeRule=bB;var yB=Ju(Yd()),hI=Ju(Qr()),vB=Ju(Wr()),EB=Ju(Jo()),_B=K(),hs=ie();function Ju(e){return e&&e.__esModule?e:{default:e}}function bB(e){return{Field:function(r){var n=e.getParentType();if(n){var i=e.getFieldDef();if(!i){var o=e.getSchema(),s=r.name.value,a=(0,hI.default)("to use an inline fragment on",SB(o,n,s));a===""&&(a=(0,hI.default)(TB(n,s))),e.reportError(new _B.GraphQLError('Cannot query field "'.concat(s,'" on type "').concat(n.name,'".')+a,r))}}}}}function SB(e,t,r){if(!(0,hs.isAbstractType)(t))return[];for(var n=new Set,i=Object.create(null),o=0,s=e.getPossibleTypes(t);o<s.length;o++){var a=s[o];if(a.getFields()[r]){n.add(a),i[a.name]=1;for(var u=0,c=a.getInterfaces();u<c.length;u++){var l,d=c[u];d.getFields()[r]&&(n.add(d),i[d.name]=((l=i[d.name])!==null&&l!==void 0?l:0)+1)}}}return(0,yB.default)(n).sort(function(f,h){var g=i[h.name]-i[f.name];return g!==0?g:(0,hs.isInterfaceType)(f)&&e.isSubType(f,h)?-1:(0,hs.isInterfaceType)(h)&&e.isSubType(h,f)?1:(0,EB.default)(f.name,h.name)}).map(function(f){return f.name})}function TB(e,t){if((0,hs.isObjectType)(e)||(0,hs.isInterfaceType)(e)){var r=Object.keys(e.getFields());return(0,vB.default)(t,r)}return[]}});var Vf=y(Uf=>{"use strict";p();Object.defineProperty(Uf,"__esModule",{value:!0});Uf.UniqueFragmentNamesRule=OB;var IB=K();function OB(e){var t=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(n){var i=n.name.value;return t[i]?e.reportError(new IB.GraphQLError('There can be only one fragment named "'.concat(i,'".'),[t[i],n.name])):t[i]=n.name,!1}}}});var Bf=y(Gf=>{"use strict";p();Object.defineProperty(Gf,"__esModule",{value:!0});Gf.KnownFragmentNamesRule=AB;var wB=K();function AB(e){return{FragmentSpread:function(r){var n=r.name.value,i=e.getFragment(n);i||e.reportError(new wB.GraphQLError('Unknown fragment "'.concat(n,'".'),r.name))}}}});var Kf=y($f=>{"use strict";p();Object.defineProperty($f,"__esModule",{value:!0});$f.NoUnusedFragmentsRule=NB;var xB=K();function NB(e){var t=[],r=[];return{OperationDefinition:function(i){return t.push(i),!1},FragmentDefinition:function(i){return r.push(i),!1},Document:{leave:function(){for(var i=Object.create(null),o=0;o<t.length;o++)for(var s=t[o],a=0,u=e.getRecursivelyReferencedFragments(s);a<u.length;a++){var c=u[a];i[c.name.value]=!0}for(var l=0;l<r.length;l++){var d=r[l],f=d.name.value;i[f]!==!0&&e.reportError(new xB.GraphQLError('Fragment "'.concat(f,'" is never used.'),d))}}}}}});var Wf=y(Qf=>{"use strict";p();Object.defineProperty(Qf,"__esModule",{value:!0});Qf.PossibleFragmentSpreadsRule=PB;var Xu=CB(se()),mI=K(),Hf=ie(),RB=dr(),gI=rs();function CB(e){return e&&e.__esModule?e:{default:e}}function PB(e){return{InlineFragment:function(r){var n=e.getType(),i=e.getParentType();if((0,Hf.isCompositeType)(n)&&(0,Hf.isCompositeType)(i)&&!(0,gI.doTypesOverlap)(e.getSchema(),n,i)){var o=(0,Xu.default)(i),s=(0,Xu.default)(n);e.reportError(new mI.GraphQLError('Fragment cannot be spread here as objects of type "'.concat(o,'" can never be of type "').concat(s,'".'),r))}},FragmentSpread:function(r){var n=r.name.value,i=DB(e,n),o=e.getParentType();if(i&&o&&!(0,gI.doTypesOverlap)(e.getSchema(),i,o)){var s=(0,Xu.default)(o),a=(0,Xu.default)(i);e.reportError(new mI.GraphQLError('Fragment "'.concat(n,'" cannot be spread here as objects of type "').concat(s,'" can never be of type "').concat(a,'".'),r))}}}}function DB(e,t){var r=e.getFragment(t);if(r){var n=(0,RB.typeFromAST)(e.getSchema(),r.typeCondition);if((0,Hf.isCompositeType)(n))return n}}});var Yf=y(zf=>{"use strict";p();Object.defineProperty(zf,"__esModule",{value:!0});zf.NoFragmentCyclesRule=kB;var LB=K();function kB(e){var t=Object.create(null),r=[],n=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(s){return i(s),!1}};function i(o){if(!t[o.name.value]){var s=o.name.value;t[s]=!0;var a=e.getFragmentSpreads(o.selectionSet);if(a.length!==0){n[s]=r.length;for(var u=0;u<a.length;u++){var c=a[u],l=c.name.value,d=n[l];if(r.push(c),d===void 0){var f=e.getFragment(l);f&&i(f)}else{var h=r.slice(d),g=h.slice(0,-1).map(function(v){return'"'+v.name.value+'"'}).join(", ");e.reportError(new LB.GraphQLError('Cannot spread fragment "'.concat(l,'" within itself')+(g!==""?" via ".concat(g,"."):"."),h))}r.pop()}n[s]=void 0}}}}});var Xf=y(Jf=>{"use strict";p();Object.defineProperty(Jf,"__esModule",{value:!0});Jf.UniqueVariableNamesRule=MB;var jB=K();function MB(e){var t=Object.create(null);return{OperationDefinition:function(){t=Object.create(null)},VariableDefinition:function(n){var i=n.variable.name.value;t[i]?e.reportError(new jB.GraphQLError('There can be only one variable named "$'.concat(i,'".'),[t[i],n.variable.name])):t[i]=n.variable.name}}}});var eh=y(Zf=>{"use strict";p();Object.defineProperty(Zf,"__esModule",{value:!0});Zf.NoUndefinedVariablesRule=qB;var FB=K();function qB(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),o=0;o<i.length;o++){var s=i[o],a=s.node,u=a.name.value;t[u]!==!0&&e.reportError(new FB.GraphQLError(n.name?'Variable "$'.concat(u,'" is not defined by operation "').concat(n.name.value,'".'):'Variable "$'.concat(u,'" is not defined.'),[a,n]))}}},VariableDefinition:function(n){t[n.variable.name.value]=!0}}}});var rh=y(th=>{"use strict";p();Object.defineProperty(th,"__esModule",{value:!0});th.NoUnusedVariablesRule=VB;var UB=K();function VB(e){var t=[];return{OperationDefinition:{enter:function(){t=[]},leave:function(n){for(var i=Object.create(null),o=e.getRecursiveVariableUsages(n),s=0;s<o.length;s++){var a=o[s],u=a.node;i[u.name.value]=!0}for(var c=0,l=t;c<l.length;c++){var d=l[c],f=d.variable.name.value;i[f]!==!0&&e.reportError(new UB.GraphQLError(n.name?'Variable "$'.concat(f,'" is never used in operation "').concat(n.name.value,'".'):'Variable "$'.concat(f,'" is never used.'),d))}}},VariableDefinition:function(n){t.push(n)}}}});var ih=y(nh=>{"use strict";p();Object.defineProperty(nh,"__esModule",{value:!0});nh.KnownDirectivesRule=$B;var GB=EI(se()),vI=EI(et()),yI=K(),Oe=Ee(),Ke=Si(),BB=gt();function EI(e){return e&&e.__esModule?e:{default:e}}function $B(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():BB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=o.locations}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];u.kind===Oe.Kind.DIRECTIVE_DEFINITION&&(t[u.name.value]=u.locations.map(function(c){return c.value}))}return{Directive:function(l,d,f,h,g){var v=l.name.value,_=t[v];if(!_){e.reportError(new yI.GraphQLError('Unknown directive "@'.concat(v,'".'),l));return}var S=KB(g);S&&_.indexOf(S)===-1&&e.reportError(new yI.GraphQLError('Directive "@'.concat(v,'" may not be used on ').concat(S,"."),l))}}}function KB(e){var t=e[e.length-1];switch(!Array.isArray(t)||(0,vI.default)(0),t.kind){case Oe.Kind.OPERATION_DEFINITION:return HB(t.operation);case Oe.Kind.FIELD:return Ke.DirectiveLocation.FIELD;case Oe.Kind.FRAGMENT_SPREAD:return Ke.DirectiveLocation.FRAGMENT_SPREAD;case Oe.Kind.INLINE_FRAGMENT:return Ke.DirectiveLocation.INLINE_FRAGMENT;case Oe.Kind.FRAGMENT_DEFINITION:return Ke.DirectiveLocation.FRAGMENT_DEFINITION;case Oe.Kind.VARIABLE_DEFINITION:return Ke.DirectiveLocation.VARIABLE_DEFINITION;case Oe.Kind.SCHEMA_DEFINITION:case Oe.Kind.SCHEMA_EXTENSION:return Ke.DirectiveLocation.SCHEMA;case Oe.Kind.SCALAR_TYPE_DEFINITION:case Oe.Kind.SCALAR_TYPE_EXTENSION:return Ke.DirectiveLocation.SCALAR;case Oe.Kind.OBJECT_TYPE_DEFINITION:case Oe.Kind.OBJECT_TYPE_EXTENSION:return Ke.DirectiveLocation.OBJECT;case Oe.Kind.FIELD_DEFINITION:return Ke.DirectiveLocation.FIELD_DEFINITION;case Oe.Kind.INTERFACE_TYPE_DEFINITION:case Oe.Kind.INTERFACE_TYPE_EXTENSION:return Ke.DirectiveLocation.INTERFACE;case Oe.Kind.UNION_TYPE_DEFINITION:case Oe.Kind.UNION_TYPE_EXTENSION:return Ke.DirectiveLocation.UNION;case Oe.Kind.ENUM_TYPE_DEFINITION:case Oe.Kind.ENUM_TYPE_EXTENSION:return Ke.DirectiveLocation.ENUM;case Oe.Kind.ENUM_VALUE_DEFINITION:return Ke.DirectiveLocation.ENUM_VALUE;case Oe.Kind.INPUT_OBJECT_TYPE_DEFINITION:case Oe.Kind.INPUT_OBJECT_TYPE_EXTENSION:return Ke.DirectiveLocation.INPUT_OBJECT;case Oe.Kind.INPUT_VALUE_DEFINITION:{var r=e[e.length-3];return r.kind===Oe.Kind.INPUT_OBJECT_TYPE_DEFINITION?Ke.DirectiveLocation.INPUT_FIELD_DEFINITION:Ke.DirectiveLocation.ARGUMENT_DEFINITION}}}function HB(e){switch(e){case"query":return Ke.DirectiveLocation.QUERY;case"mutation":return Ke.DirectiveLocation.MUTATION;case"subscription":return Ke.DirectiveLocation.SUBSCRIPTION}(0,vI.default)(0,"Unexpected operation: "+(0,GB.default)(e))}});var ah=y(sh=>{"use strict";p();Object.defineProperty(sh,"__esModule",{value:!0});sh.UniqueDirectivesPerLocationRule=zB;var QB=K(),oh=Ee(),_I=Fn(),WB=gt();function zB(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():WB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=!o.isRepeatable}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];u.kind===oh.Kind.DIRECTIVE_DEFINITION&&(t[u.name.value]=!u.repeatable)}var c=Object.create(null),l=Object.create(null);return{enter:function(f){if(f.directives!=null){var h;if(f.kind===oh.Kind.SCHEMA_DEFINITION||f.kind===oh.Kind.SCHEMA_EXTENSION)h=c;else if((0,_I.isTypeDefinitionNode)(f)||(0,_I.isTypeExtensionNode)(f)){var g=f.name.value;h=l[g],h===void 0&&(l[g]=h=Object.create(null))}else h=Object.create(null);for(var v=0,_=f.directives;v<_.length;v++){var S=_[v],b=S.name.value;t[b]&&(h[b]?e.reportError(new QB.GraphQLError('The directive "@'.concat(b,'" can only be used once at this location.'),[h[b],S])):h[b]=S)}}}}}});var uh=y(Zu=>{"use strict";p();Object.defineProperty(Zu,"__esModule",{value:!0});Zu.KnownArgumentNamesRule=ZB;Zu.KnownArgumentNamesOnDirectivesRule=AI;var TI=wI(Qr()),II=wI(Wr()),OI=K(),YB=Ee(),JB=gt();function wI(e){return e&&e.__esModule?e:{default:e}}function bI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function SI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bI(Object(r),!0).forEach(function(n){XB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function XB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZB(e){return SI(SI({},AI(e)),{},{Argument:function(r){var n=e.getArgument(),i=e.getFieldDef(),o=e.getParentType();if(!n&&i&&o){var s=r.name.value,a=i.args.map(function(c){return c.name}),u=(0,II.default)(s,a);e.reportError(new OI.GraphQLError('Unknown argument "'.concat(s,'" on field "').concat(o.name,".").concat(i.name,'".')+(0,TI.default)(u),r))}}})}function AI(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():JB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=o.args.map(function(d){return d.name})}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];if(u.kind===YB.Kind.DIRECTIVE_DEFINITION){var c,l=(c=u.arguments)!==null&&c!==void 0?c:[];t[u.name.value]=l.map(function(d){return d.name.value})}}return{Directive:function(f){var h=f.name.value,g=t[h];if(f.arguments&&g)for(var v=0,_=f.arguments;v<_.length;v++){var S=_[v],b=S.name.value;if(g.indexOf(b)===-1){var A=(0,II.default)(b,g);e.reportError(new OI.GraphQLError('Unknown argument "'.concat(b,'" on directive "@').concat(h,'".')+(0,TI.default)(A),S))}}return!1}}}});var lh=y(ch=>{"use strict";p();Object.defineProperty(ch,"__esModule",{value:!0});ch.UniqueArgumentNamesRule=t$;var e$=K();function t$(e){var t=Object.create(null);return{Field:function(){t=Object.create(null)},Directive:function(){t=Object.create(null)},Argument:function(n){var i=n.name.value;return t[i]?e.reportError(new e$.GraphQLError('There can be only one argument named "'.concat(i,'".'),[t[i],n.name])):t[i]=n.name,!1}}}});var dh=y(ph=>{"use strict";p();Object.defineProperty(ph,"__esModule",{value:!0});ph.ValuesOfCorrectTypeRule=s$;var r$=gs(bt()),n$=gs(Hr()),ms=gs(se()),i$=gs(Qr()),o$=gs(Wr()),Un=K(),ec=mt(),fr=ie();function gs(e){return e&&e.__esModule?e:{default:e}}function s$(e){return{ListValue:function(r){var n=(0,fr.getNullableType)(e.getParentInputType());if(!(0,fr.isListType)(n))return qn(e,r),!1},ObjectValue:function(r){var n=(0,fr.getNamedType)(e.getInputType());if(!(0,fr.isInputObjectType)(n))return qn(e,r),!1;for(var i=(0,n$.default)(r.fields,function(l){return l.name.value}),o=0,s=(0,r$.default)(n.getFields());o<s.length;o++){var a=s[o],u=i[a.name];if(!u&&(0,fr.isRequiredInputField)(a)){var c=(0,ms.default)(a.type);e.reportError(new Un.GraphQLError('Field "'.concat(n.name,".").concat(a.name,'" of required type "').concat(c,'" was not provided.'),r))}}},ObjectField:function(r){var n=(0,fr.getNamedType)(e.getParentInputType()),i=e.getInputType();if(!i&&(0,fr.isInputObjectType)(n)){var o=(0,o$.default)(r.name.value,Object.keys(n.getFields()));e.reportError(new Un.GraphQLError('Field "'.concat(r.name.value,'" is not defined by type "').concat(n.name,'".')+(0,i$.default)(o),r))}},NullValue:function(r){var n=e.getInputType();(0,fr.isNonNullType)(n)&&e.reportError(new Un.GraphQLError('Expected value of type "'.concat((0,ms.default)(n),'", found ').concat((0,ec.print)(r),"."),r))},EnumValue:function(r){return qn(e,r)},IntValue:function(r){return qn(e,r)},FloatValue:function(r){return qn(e,r)},StringValue:function(r){return qn(e,r)},BooleanValue:function(r){return qn(e,r)}}}function qn(e,t){var r=e.getInputType();if(r){var n=(0,fr.getNamedType)(r);if(!(0,fr.isLeafType)(n)){var i=(0,ms.default)(r);e.reportError(new Un.GraphQLError('Expected value of type "'.concat(i,'", found ').concat((0,ec.print)(t),"."),t));return}try{var o=n.parseLiteral(t,void 0);if(o===void 0){var s=(0,ms.default)(r);e.reportError(new Un.GraphQLError('Expected value of type "'.concat(s,'", found ').concat((0,ec.print)(t),"."),t))}}catch(u){var a=(0,ms.default)(r);u instanceof Un.GraphQLError?e.reportError(u):e.reportError(new Un.GraphQLError('Expected value of type "'.concat(a,'", found ').concat((0,ec.print)(t),"; ")+u.message,t,void 0,void 0,void 0,u))}}}});var hh=y(rc=>{"use strict";p();Object.defineProperty(rc,"__esModule",{value:!0});rc.ProvidedRequiredArgumentsRule=l$;rc.ProvidedRequiredArgumentsOnDirectivesRule=LI;var RI=DI(se()),tc=DI(Hr()),CI=K(),PI=Ee(),a$=mt(),u$=gt(),fh=ie();function DI(e){return e&&e.__esModule?e:{default:e}}function xI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function NI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xI(Object(r),!0).forEach(function(n){c$(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function c$(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function l$(e){return NI(NI({},LI(e)),{},{Field:{leave:function(r){var n,i=e.getFieldDef();if(!i)return!1;for(var o=(n=r.arguments)!==null&&n!==void 0?n:[],s=(0,tc.default)(o,function(f){return f.name.value}),a=0,u=i.args;a<u.length;a++){var c=u[a],l=s[c.name];if(!l&&(0,fh.isRequiredArgument)(c)){var d=(0,RI.default)(c.type);e.reportError(new CI.GraphQLError('Field "'.concat(i.name,'" argument "').concat(c.name,'" of type "').concat(d,'" is required, but it was not provided.'),r))}}}}})}function LI(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():u$.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=(0,tc.default)(o.args.filter(fh.isRequiredArgument),function(d){return d.name})}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];if(u.kind===PI.Kind.DIRECTIVE_DEFINITION){var c,l=(c=u.arguments)!==null&&c!==void 0?c:[];t[u.name.value]=(0,tc.default)(l.filter(p$),function(d){return d.name.value})}}return{Directive:{leave:function(f){var h=f.name.value,g=t[h];if(g)for(var v,_=(v=f.arguments)!==null&&v!==void 0?v:[],S=(0,tc.default)(_,function(U){return U.name.value}),b=0,A=Object.keys(g);b<A.length;b++){var w=A[b];if(!S[w]){var T=g[w].type,x=(0,fh.isType)(T)?(0,RI.default)(T):(0,a$.print)(T);e.reportError(new CI.GraphQLError('Directive "@'.concat(h,'" argument "').concat(w,'" of type "').concat(x,'" is required, but it was not provided.'),f))}}}}}}function p$(e){return e.type.kind===PI.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var gh=y(mh=>{"use strict";p();Object.defineProperty(mh,"__esModule",{value:!0});mh.VariablesInAllowedPositionRule=g$;var kI=m$(se()),d$=K(),f$=Ee(),jI=ie(),h$=dr(),MI=rs();function m$(e){return e&&e.__esModule?e:{default:e}}function g$(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),o=0;o<i.length;o++){var s=i[o],a=s.node,u=s.type,c=s.defaultValue,l=a.name.value,d=t[l];if(d&&u){var f=e.getSchema(),h=(0,h$.typeFromAST)(f,d.type);if(h&&!y$(f,h,d.defaultValue,u,c)){var g=(0,kI.default)(h),v=(0,kI.default)(u);e.reportError(new d$.GraphQLError('Variable "$'.concat(l,'" of type "').concat(g,'" used in position expecting type "').concat(v,'".'),[d,a]))}}}}},VariableDefinition:function(n){t[n.variable.name.value]=n}}}function y$(e,t,r,n,i){if((0,jI.isNonNullType)(n)&&!(0,jI.isNonNullType)(t)){var o=r!=null&&r.kind!==f$.Kind.NULL,s=i!==void 0;if(!o&&!s)return!1;var a=n.ofType;return(0,MI.isTypeSubTypeOf)(e,t,a)}return(0,MI.isTypeSubTypeOf)(e,t,n)}});var Th=y(Sh=>{"use strict";p();Object.defineProperty(Sh,"__esModule",{value:!0});Sh.OverlappingFieldsCanBeMergedRule=b$;var v$=_h(wi()),E$=_h(Ai()),FI=_h(se()),_$=K(),yh=Ee(),qI=mt(),yt=ie(),UI=dr();function _h(e){return e&&e.__esModule?e:{default:e}}function VI(e){return Array.isArray(e)?e.map(function(t){var r=t[0],n=t[1];return'subfields "'.concat(r,'" conflict because ')+VI(n)}).join(" and "):e}function b$(e){var t=new x$,r=new Map;return{SelectionSet:function(i){for(var o=S$(e,r,t,e.getParentType(),i),s=0;s<o.length;s++){var a=o[s],u=a[0],c=u[0],l=u[1],d=a[1],f=a[2],h=VI(l);e.reportError(new _$.GraphQLError('Fields "'.concat(c,'" conflict because ').concat(h,". Use different aliases on the fields to fetch both if this was intentional."),d.concat(f)))}}}}function S$(e,t,r,n,i){var o=[],s=oc(e,t,n,i),a=s[0],u=s[1];if(I$(e,o,t,r,a),u.length!==0)for(var c=0;c<u.length;c++){nc(e,o,t,r,!1,a,u[c]);for(var l=c+1;l<u.length;l++)ic(e,o,t,r,!1,u[c],u[l])}return o}function nc(e,t,r,n,i,o,s){var a=e.getFragment(s);if(a){var u=Eh(e,r,a),c=u[0],l=u[1];if(o!==c){bh(e,t,r,n,i,o,c);for(var d=0;d<l.length;d++){var f=l[d];n.has(f,s,i)||(n.add(f,s,i),nc(e,t,r,n,i,o,l[d]))}}}}function ic(e,t,r,n,i,o,s){if(o!==s&&!n.has(o,s,i)){n.add(o,s,i);var a=e.getFragment(o),u=e.getFragment(s);if(!(!a||!u)){var c=Eh(e,r,a),l=c[0],d=c[1],f=Eh(e,r,u),h=f[0],g=f[1];bh(e,t,r,n,i,l,h);for(var v=0;v<g.length;v++)ic(e,t,r,n,i,o,g[v]);for(var _=0;_<d.length;_++)ic(e,t,r,n,i,d[_],s)}}}function T$(e,t,r,n,i,o,s,a){var u=[],c=oc(e,t,i,o),l=c[0],d=c[1],f=oc(e,t,s,a),h=f[0],g=f[1];if(bh(e,u,t,r,n,l,h),g.length!==0)for(var v=0;v<g.length;v++)nc(e,u,t,r,n,l,g[v]);if(d.length!==0)for(var _=0;_<d.length;_++)nc(e,u,t,r,n,h,d[_]);for(var S=0;S<d.length;S++)for(var b=0;b<g.length;b++)ic(e,u,t,r,n,d[S],g[b]);return u}function I$(e,t,r,n,i){for(var o=0,s=(0,E$.default)(i);o<s.length;o++){var a=s[o],u=a[0],c=a[1];if(c.length>1)for(var l=0;l<c.length;l++)for(var d=l+1;d<c.length;d++){var f=GI(e,r,n,!1,u,c[l],c[d]);f&&t.push(f)}}}function bh(e,t,r,n,i,o,s){for(var a=0,u=Object.keys(o);a<u.length;a++){var c=u[a],l=s[c];if(l)for(var d=o[c],f=0;f<d.length;f++)for(var h=0;h<l.length;h++){var g=GI(e,r,n,i,c,d[f],l[h]);g&&t.push(g)}}}function GI(e,t,r,n,i,o,s){var a=o[0],u=o[1],c=o[2],l=s[0],d=s[1],f=s[2],h=n||a!==l&&(0,yt.isObjectType)(a)&&(0,yt.isObjectType)(l);if(!h){var g,v,_=u.name.value,S=d.name.value;if(_!==S)return[[i,'"'.concat(_,'" and "').concat(S,'" are different fields')],[u],[d]];var b=(g=u.arguments)!==null&&g!==void 0?g:[],A=(v=d.arguments)!==null&&v!==void 0?v:[];if(!O$(b,A))return[[i,"they have differing arguments"],[u],[d]]}var w=c?.type,T=f?.type;if(w&&T&&vh(w,T))return[[i,'they return conflicting types "'.concat((0,FI.default)(w),'" and "').concat((0,FI.default)(T),'"')],[u],[d]];var x=u.selectionSet,U=d.selectionSet;if(x&&U){var N=T$(e,t,r,h,(0,yt.getNamedType)(w),x,(0,yt.getNamedType)(T),U);return A$(N,i,u,d)}}function O$(e,t){return e.length!==t.length?!1:e.every(function(r){var n=(0,v$.default)(t,function(i){return i.name.value===r.name.value});return n?w$(r.value,n.value):!1})}function w$(e,t){return(0,qI.print)(e)===(0,qI.print)(t)}function vh(e,t){return(0,yt.isListType)(e)?(0,yt.isListType)(t)?vh(e.ofType,t.ofType):!0:(0,yt.isListType)(t)?!0:(0,yt.isNonNullType)(e)?(0,yt.isNonNullType)(t)?vh(e.ofType,t.ofType):!0:(0,yt.isNonNullType)(t)?!0:(0,yt.isLeafType)(e)||(0,yt.isLeafType)(t)?e!==t:!1}function oc(e,t,r,n){var i=t.get(n);if(!i){var o=Object.create(null),s=Object.create(null);BI(e,r,n,o,s),i=[o,Object.keys(s)],t.set(n,i)}return i}function Eh(e,t,r){var n=t.get(r.selectionSet);if(n)return n;var i=(0,UI.typeFromAST)(e.getSchema(),r.typeCondition);return oc(e,t,i,r.selectionSet)}function BI(e,t,r,n,i){for(var o=0,s=r.selections;o<s.length;o++){var a=s[o];switch(a.kind){case yh.Kind.FIELD:{var u=a.name.value,c=void 0;((0,yt.isObjectType)(t)||(0,yt.isInterfaceType)(t))&&(c=t.getFields()[u]);var l=a.alias?a.alias.value:u;n[l]||(n[l]=[]),n[l].push([t,a,c]);break}case yh.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case yh.Kind.INLINE_FRAGMENT:{var d=a.typeCondition,f=d?(0,UI.typeFromAST)(e.getSchema(),d):t;BI(e,f,a.selectionSet,n,i);break}}}}function A$(e,t,r,n){if(e.length>0)return[[t,e.map(function(i){var o=i[0];return o})],e.reduce(function(i,o){var s=o[1];return i.concat(s)},[r]),e.reduce(function(i,o){var s=o[2];return i.concat(s)},[n])]}var x$=(function(){function e(){this._data=Object.create(null)}var t=e.prototype;return t.has=function(n,i,o){var s=this._data[n],a=s&&s[i];return a===void 0?!1:o===!1?a===!1:!0},t.add=function(n,i,o){this._pairSetAdd(n,i,o),this._pairSetAdd(i,n,o)},t._pairSetAdd=function(n,i,o){var s=this._data[n];s||(s=Object.create(null),this._data[n]=s),s[i]=o},e})()});var Oh=y(Ih=>{"use strict";p();Object.defineProperty(Ih,"__esModule",{value:!0});Ih.UniqueInputFieldNamesRule=R$;var N$=K();function R$(e){var t=[],r=Object.create(null);return{ObjectValue:{enter:function(){t.push(r),r=Object.create(null)},leave:function(){r=t.pop()}},ObjectField:function(i){var o=i.name.value;r[o]?e.reportError(new N$.GraphQLError('There can be only one input field named "'.concat(o,'".'),[r[o],i.name])):r[o]=i.name}}}});var Ah=y(wh=>{"use strict";p();Object.defineProperty(wh,"__esModule",{value:!0});wh.MaxIntrospectionDepthRule=D$;var C$=K(),$I=Ee(),P$=3;function D$(e){function t(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Object.create(null),i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(r.kind===$I.Kind.FRAGMENT_SPREAD){var o=r.name.value;if(n[o]===!0)return!1;var s=e.getFragment(o);if(!s)return!1;try{return n[o]=!0,t(s,n,i)}finally{n[o]=null}}if(r.kind===$I.Kind.FIELD&&(r.name.value==="fields"||r.name.value==="interfaces"||r.name.value==="possibleTypes"||r.name.value==="inputFields")&&(i++,i>=P$))return!0;if("selectionSet"in r&&r.selectionSet)for(var a=0,u=r.selectionSet.selections;a<u.length;a++){var c=u[a];if(t(c,n,i))return!0}return!1}return{Field:function(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new C$.GraphQLError("Maximum introspection depth exceeded",[n])),!1}}}});var Nh=y(xh=>{"use strict";p();Object.defineProperty(xh,"__esModule",{value:!0});xh.LoneSchemaDefinitionRule=L$;var KI=K();function L$(e){var t,r,n,i=e.getSchema(),o=(t=(r=(n=i?.astNode)!==null&&n!==void 0?n:i?.getQueryType())!==null&&r!==void 0?r:i?.getMutationType())!==null&&t!==void 0?t:i?.getSubscriptionType(),s=0;return{SchemaDefinition:function(u){if(o){e.reportError(new KI.GraphQLError("Cannot define a new schema within a schema extension.",u));return}s>0&&e.reportError(new KI.GraphQLError("Must provide only one schema definition.",u)),++s}}}});var Ch=y(Rh=>{"use strict";p();Object.defineProperty(Rh,"__esModule",{value:!0});Rh.UniqueOperationTypesRule=k$;var HI=K();function k$(e){var t=e.getSchema(),r=Object.create(null),n=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(o){for(var s,a=(s=o.operationTypes)!==null&&s!==void 0?s:[],u=0;u<a.length;u++){var c=a[u],l=c.operation,d=r[l];n[l]?e.reportError(new HI.GraphQLError("Type for ".concat(l," already defined in the schema. It cannot be redefined."),c)):d?e.reportError(new HI.GraphQLError("There can be only one ".concat(l," type in schema."),[d,c])):r[l]=c}return!1}}});var Dh=y(Ph=>{"use strict";p();Object.defineProperty(Ph,"__esModule",{value:!0});Ph.UniqueTypeNamesRule=j$;var QI=K();function j$(e){var t=Object.create(null),r=e.getSchema();return{ScalarTypeDefinition:n,ObjectTypeDefinition:n,InterfaceTypeDefinition:n,UnionTypeDefinition:n,EnumTypeDefinition:n,InputObjectTypeDefinition:n};function n(i){var o=i.name.value;if(r!=null&&r.getType(o)){e.reportError(new QI.GraphQLError('Type "'.concat(o,'" already exists in the schema. It cannot also be defined in this type definition.'),i.name));return}return t[o]?e.reportError(new QI.GraphQLError('There can be only one type named "'.concat(o,'".'),[t[o],i.name])):t[o]=i.name,!1}}});var kh=y(Lh=>{"use strict";p();Object.defineProperty(Lh,"__esModule",{value:!0});Lh.UniqueEnumValueNamesRule=F$;var WI=K(),M$=ie();function F$(e){var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(o){var s,a=o.name.value;n[a]||(n[a]=Object.create(null));for(var u=(s=o.values)!==null&&s!==void 0?s:[],c=n[a],l=0;l<u.length;l++){var d=u[l],f=d.name.value,h=r[a];(0,M$.isEnumType)(h)&&h.getValue(f)?e.reportError(new WI.GraphQLError('Enum value "'.concat(a,".").concat(f,'" already exists in the schema. It cannot also be defined in this type extension.'),d.name)):c[f]?e.reportError(new WI.GraphQLError('Enum value "'.concat(a,".").concat(f,'" can only be defined once.'),[c[f],d.name])):c[f]=d.name}return!1}}});var Fh=y(Mh=>{"use strict";p();Object.defineProperty(Mh,"__esModule",{value:!0});Mh.UniqueFieldDefinitionNamesRule=q$;var zI=K(),jh=ie();function q$(e){var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(o){var s,a=o.name.value;n[a]||(n[a]=Object.create(null));for(var u=(s=o.fields)!==null&&s!==void 0?s:[],c=n[a],l=0;l<u.length;l++){var d=u[l],f=d.name.value;U$(r[a],f)?e.reportError(new zI.GraphQLError('Field "'.concat(a,".").concat(f,'" already exists in the schema. It cannot also be defined in this type extension.'),d.name)):c[f]?e.reportError(new zI.GraphQLError('Field "'.concat(a,".").concat(f,'" can only be defined once.'),[c[f],d.name])):c[f]=d.name}return!1}}function U$(e,t){return(0,jh.isObjectType)(e)||(0,jh.isInterfaceType)(e)||(0,jh.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var Uh=y(qh=>{"use strict";p();Object.defineProperty(qh,"__esModule",{value:!0});qh.UniqueDirectiveNamesRule=V$;var YI=K();function V$(e){var t=Object.create(null),r=e.getSchema();return{DirectiveDefinition:function(i){var o=i.name.value;if(r!=null&&r.getDirective(o)){e.reportError(new YI.GraphQLError('Directive "@'.concat(o,'" already exists in the schema. It cannot be redefined.'),i.name));return}return t[o]?e.reportError(new YI.GraphQLError('There can be only one directive named "@'.concat(o,'".'),[t[o],i.name])):t[o]=i.name,!1}}}});var Gh=y(Vh=>{"use strict";p();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.PossibleTypeExtensionsRule=K$;var XI=sc(se()),ZI=sc(et()),G$=sc(Qr()),B$=sc(Wr()),JI=K(),Ae=Ee(),$$=Fn(),ji=ie(),rn;function sc(e){return e&&e.__esModule?e:{default:e}}function Mi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function K$(e){for(var t=e.getSchema(),r=Object.create(null),n=0,i=e.getDocument().definitions;n<i.length;n++){var o=i[n];(0,$$.isTypeDefinitionNode)(o)&&(r[o.name.value]=o)}return{ScalarTypeExtension:s,ObjectTypeExtension:s,InterfaceTypeExtension:s,UnionTypeExtension:s,EnumTypeExtension:s,InputObjectTypeExtension:s};function s(a){var u=a.name.value,c=r[u],l=t?.getType(u),d;if(c?d=H$[c.kind]:l&&(d=Q$(l)),d){if(d!==a.kind){var f=W$(a.kind);e.reportError(new JI.GraphQLError("Cannot extend non-".concat(f,' type "').concat(u,'".'),c?[c,a]:a))}}else{var h=Object.keys(r);t&&(h=h.concat(Object.keys(t.getTypeMap())));var g=(0,B$.default)(u,h);e.reportError(new JI.GraphQLError('Cannot extend type "'.concat(u,'" because it is not defined.')+(0,G$.default)(g),a.name))}}}var H$=(rn={},Mi(rn,Ae.Kind.SCALAR_TYPE_DEFINITION,Ae.Kind.SCALAR_TYPE_EXTENSION),Mi(rn,Ae.Kind.OBJECT_TYPE_DEFINITION,Ae.Kind.OBJECT_TYPE_EXTENSION),Mi(rn,Ae.Kind.INTERFACE_TYPE_DEFINITION,Ae.Kind.INTERFACE_TYPE_EXTENSION),Mi(rn,Ae.Kind.UNION_TYPE_DEFINITION,Ae.Kind.UNION_TYPE_EXTENSION),Mi(rn,Ae.Kind.ENUM_TYPE_DEFINITION,Ae.Kind.ENUM_TYPE_EXTENSION),Mi(rn,Ae.Kind.INPUT_OBJECT_TYPE_DEFINITION,Ae.Kind.INPUT_OBJECT_TYPE_EXTENSION),rn);function Q$(e){if((0,ji.isScalarType)(e))return Ae.Kind.SCALAR_TYPE_EXTENSION;if((0,ji.isObjectType)(e))return Ae.Kind.OBJECT_TYPE_EXTENSION;if((0,ji.isInterfaceType)(e))return Ae.Kind.INTERFACE_TYPE_EXTENSION;if((0,ji.isUnionType)(e))return Ae.Kind.UNION_TYPE_EXTENSION;if((0,ji.isEnumType)(e))return Ae.Kind.ENUM_TYPE_EXTENSION;if((0,ji.isInputObjectType)(e))return Ae.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,ZI.default)(0,"Unexpected type: "+(0,XI.default)(e))}function W$(e){switch(e){case Ae.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case Ae.Kind.OBJECT_TYPE_EXTENSION:return"object";case Ae.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case Ae.Kind.UNION_TYPE_EXTENSION:return"union";case Ae.Kind.ENUM_TYPE_EXTENSION:return"enum";case Ae.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object"}(0,ZI.default)(0,"Unexpected kind: "+(0,XI.default)(e))}});var Bh=y(nn=>{"use strict";p();Object.defineProperty(nn,"__esModule",{value:!0});nn.specifiedSDLRules=nn.specifiedRules=nn.recommendedRules=void 0;var z$=Sf(),Y$=If(),J$=wf(),X$=xf(),eO=Cf(),Z$=Df(),eK=kf(),tK=Mf(),rK=qf(),nK=Vf(),iK=Bf(),oK=Kf(),sK=Wf(),aK=Yf(),uK=Xf(),cK=eh(),lK=rh(),tO=ih(),rO=ah(),nO=uh(),iO=lh(),pK=dh(),oO=hh(),dK=gh(),fK=Th(),sO=Oh(),hK=Ah(),mK=Nh(),gK=Ch(),yK=Dh(),vK=kh(),EK=Fh(),_K=Uh(),bK=Gh(),aO=Object.freeze([hK.MaxIntrospectionDepthRule]);nn.recommendedRules=aO;var SK=Object.freeze([z$.ExecutableDefinitionsRule,Y$.UniqueOperationNamesRule,J$.LoneAnonymousOperationRule,X$.SingleFieldSubscriptionsRule,eO.KnownTypeNamesRule,Z$.FragmentsOnCompositeTypesRule,eK.VariablesAreInputTypesRule,tK.ScalarLeafsRule,rK.FieldsOnCorrectTypeRule,nK.UniqueFragmentNamesRule,iK.KnownFragmentNamesRule,oK.NoUnusedFragmentsRule,sK.PossibleFragmentSpreadsRule,aK.NoFragmentCyclesRule,uK.UniqueVariableNamesRule,cK.NoUndefinedVariablesRule,lK.NoUnusedVariablesRule,tO.KnownDirectivesRule,rO.UniqueDirectivesPerLocationRule,nO.KnownArgumentNamesRule,iO.UniqueArgumentNamesRule,pK.ValuesOfCorrectTypeRule,oO.ProvidedRequiredArgumentsRule,dK.VariablesInAllowedPositionRule,fK.OverlappingFieldsCanBeMergedRule,sO.UniqueInputFieldNamesRule].concat(aO));nn.specifiedRules=SK;var TK=Object.freeze([mK.LoneSchemaDefinitionRule,gK.UniqueOperationTypesRule,yK.UniqueTypeNamesRule,vK.UniqueEnumValueNamesRule,EK.UniqueFieldDefinitionNamesRule,_K.UniqueDirectiveNamesRule,eO.KnownTypeNamesRule,tO.KnownDirectivesRule,rO.UniqueDirectivesPerLocationRule,bK.PossibleTypeExtensionsRule,nO.KnownArgumentNamesOnDirectivesRule,iO.UniqueArgumentNamesRule,sO.UniqueInputFieldNamesRule,oO.ProvidedRequiredArgumentsOnDirectivesRule]);nn.specifiedSDLRules=TK});var Kh=y(on=>{"use strict";p();Object.defineProperty(on,"__esModule",{value:!0});on.ValidationContext=on.SDLValidationContext=on.ASTValidationContext=void 0;var uO=Ee(),IK=Kr(),cO=Yu();function lO(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var $h=(function(){function e(r,n){this._ast=r,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}var t=e.prototype;return t.reportError=function(n){this._onError(n)},t.getDocument=function(){return this._ast},t.getFragment=function(n){var i=this._fragments;return i||(this._fragments=i=this.getDocument().definitions.reduce(function(o,s){return s.kind===uO.Kind.FRAGMENT_DEFINITION&&(o[s.name.value]=s),o},Object.create(null))),i[n]},t.getFragmentSpreads=function(n){var i=this._fragmentSpreads.get(n);if(!i){i=[];for(var o=[n];o.length!==0;)for(var s=o.pop(),a=0,u=s.selections;a<u.length;a++){var c=u[a];c.kind===uO.Kind.FRAGMENT_SPREAD?i.push(c):c.selectionSet&&o.push(c.selectionSet)}this._fragmentSpreads.set(n,i)}return i},t.getRecursivelyReferencedFragments=function(n){var i=this._recursivelyReferencedFragments.get(n);if(!i){i=[];for(var o=Object.create(null),s=[n.selectionSet];s.length!==0;)for(var a=s.pop(),u=0,c=this.getFragmentSpreads(a);u<c.length;u++){var l=c[u],d=l.name.value;if(o[d]!==!0){o[d]=!0;var f=this.getFragment(d);f&&(i.push(f),s.push(f.selectionSet))}}this._recursivelyReferencedFragments.set(n,i)}return i},e})();on.ASTValidationContext=$h;var OK=(function(e){lO(t,e);function t(n,i,o){var s;return s=e.call(this,n,o)||this,s._schema=i,s}var r=t.prototype;return r.getSchema=function(){return this._schema},t})($h);on.SDLValidationContext=OK;var wK=(function(e){lO(t,e);function t(n,i,o,s){var a;return a=e.call(this,i,s)||this,a._schema=n,a._typeInfo=o,a._variableUsages=new Map,a._recursiveVariableUsages=new Map,a}var r=t.prototype;return r.getSchema=function(){return this._schema},r.getVariableUsages=function(i){var o=this._variableUsages.get(i);if(!o){var s=[],a=new cO.TypeInfo(this._schema);(0,IK.visit)(i,(0,cO.visitWithTypeInfo)(a,{VariableDefinition:function(){return!1},Variable:function(c){s.push({node:c,type:a.getInputType(),defaultValue:a.getDefaultValue()})}})),o=s,this._variableUsages.set(i,o)}return o},r.getRecursiveVariableUsages=function(i){var o=this._recursiveVariableUsages.get(i);if(!o){o=this.getVariableUsages(i);for(var s=0,a=this.getRecursivelyReferencedFragments(i);s<a.length;s++){var u=a[s];o=o.concat(this.getVariableUsages(u))}this._recursiveVariableUsages.set(i,o)}return o},r.getType=function(){return this._typeInfo.getType()},r.getParentType=function(){return this._typeInfo.getParentType()},r.getInputType=function(){return this._typeInfo.getInputType()},r.getParentInputType=function(){return this._typeInfo.getParentInputType()},r.getFieldDef=function(){return this._typeInfo.getFieldDef()},r.getDirective=function(){return this._typeInfo.getDirective()},r.getArgument=function(){return this._typeInfo.getArgument()},r.getEnumValue=function(){return this._typeInfo.getEnumValue()},t})($h);on.ValidationContext=wK});var qi=y(Fi=>{"use strict";p();Object.defineProperty(Fi,"__esModule",{value:!0});Fi.validate=CK;Fi.validateSDL=Hh;Fi.assertValidSDL=PK;Fi.assertValidSDLExtension=DK;var AK=RK(jt()),xK=K(),ac=Kr(),NK=ds(),pO=Yu(),dO=Bh(),fO=Kh();function RK(e){return e&&e.__esModule?e:{default:e}}function CK(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:dO.specifiedRules,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new pO.TypeInfo(e),i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{maxErrors:void 0};t||(0,AK.default)(0,"Must provide document."),(0,NK.assertValidSchema)(e);var o=Object.freeze({}),s=[],a=new fO.ValidationContext(e,t,n,function(c){if(i.maxErrors!=null&&s.length>=i.maxErrors)throw s.push(new xK.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),o;s.push(c)}),u=(0,ac.visitInParallel)(r.map(function(c){return c(a)}));try{(0,ac.visit)(t,(0,pO.visitWithTypeInfo)(n,u))}catch(c){if(c!==o)throw c}return s}function Hh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:dO.specifiedSDLRules,n=[],i=new fO.SDLValidationContext(e,t,function(s){n.push(s)}),o=r.map(function(s){return s(i)});return(0,ac.visit)(e,(0,ac.visitInParallel)(o)),n}function PK(e){var t=Hh(e);if(t.length!==0)throw new Error(t.map(function(r){return r.message}).join(`
|
|
75
|
+
`))}var C1=(function(){function e(r){this._errors=[],this.schema=r}var t=e.prototype;return t.reportError=function(n,i){var o=Array.isArray(i)?i.filter(Boolean):i;this.addError(new w1.GraphQLError(n,o))},t.addError=function(n){this._errors.push(n)},t.getErrors=function(){return this._errors},e})();function P1(e){var t=e.schema,r=t.getQueryType();if(!r)e.reportError("Query root type must be provided.",t.astNode);else if(!(0,je.isObjectType)(r)){var n;e.reportError("Query root type must be Object type, it cannot be ".concat((0,it.default)(r),"."),(n=yf(t,"query"))!==null&&n!==void 0?n:r.astNode)}var i=t.getMutationType();if(i&&!(0,je.isObjectType)(i)){var o;e.reportError("Mutation root type must be Object type if provided, it cannot be "+"".concat((0,it.default)(i),"."),(o=yf(t,"mutation"))!==null&&o!==void 0?o:i.astNode)}var s=t.getSubscriptionType();if(s&&!(0,je.isObjectType)(s)){var a;e.reportError("Subscription root type must be Object type if provided, it cannot be "+"".concat((0,it.default)(s),"."),(a=yf(t,"subscription"))!==null&&a!==void 0?a:s.astNode)}}function yf(e,t){for(var r=Ef(e,function(o){return o.operationTypes}),n=0;n<r.length;n++){var i=r[n];if(i.operation===t)return i.type}}function D1(e){for(var t=0,r=e.schema.getDirectives();t<r.length;t++){var n=r[t];if(!(0,XT.isDirective)(n)){e.reportError("Expected directive but got: ".concat((0,it.default)(n),"."),n?.astNode);continue}Fn(e,n);for(var i=0,o=n.args;i<o.length;i++){var s=o[i];if(Fn(e,s),(0,je.isInputType)(s.type)||e.reportError("The type of @".concat(n.name,"(").concat(s.name,":) must be Input Type ")+"but got: ".concat((0,it.default)(s.type),"."),s.astNode),(0,je.isRequiredArgument)(s)&&s.deprecationReason!=null){var a;e.reportError("Required argument @".concat(n.name,"(").concat(s.name,":) cannot be deprecated."),[_f(s.astNode),(a=s.astNode)===null||a===void 0?void 0:a.type])}}}}function Fn(e,t){var r=(0,A1.isValidNameError)(t.name);r&&e.addError((0,O1.locatedError)(r,t.astNode))}function L1(e){for(var t=U1(e),r=e.schema.getTypeMap(),n=0,i=(0,ds.default)(r);n<i.length;n++){var o=i[n];if(!(0,je.isNamedType)(o)){e.reportError("Expected GraphQL named type but got: ".concat((0,it.default)(o),"."),o.astNode);continue}(0,N1.isIntrospectionType)(o)||Fn(e,o),(0,je.isObjectType)(o)||(0,je.isInterfaceType)(o)?(zT(e,o),YT(e,o)):(0,je.isUnionType)(o)?M1(e,o):(0,je.isEnumType)(o)?F1(e,o):(0,je.isInputObjectType)(o)&&(q1(e,o),t(o))}}function zT(e,t){var r=(0,ds.default)(t.getFields());r.length===0&&e.reportError("Type ".concat(t.name," must define one or more fields."),ki(t));for(var n=0;n<r.length;n++){var i=r[n];if(Fn(e,i),!(0,je.isOutputType)(i.type)){var o;e.reportError("The type of ".concat(t.name,".").concat(i.name," must be Output Type ")+"but got: ".concat((0,it.default)(i.type),"."),(o=i.astNode)===null||o===void 0?void 0:o.type)}for(var s=0,a=i.args;s<a.length;s++){var u=a[s],c=u.name;if(Fn(e,u),!(0,je.isInputType)(u.type)){var l;e.reportError("The type of ".concat(t.name,".").concat(i.name,"(").concat(c,":) must be Input ")+"Type but got: ".concat((0,it.default)(u.type),"."),(l=u.astNode)===null||l===void 0?void 0:l.type)}if((0,je.isRequiredArgument)(u)&&u.deprecationReason!=null){var d;e.reportError("Required argument ".concat(t.name,".").concat(i.name,"(").concat(c,":) cannot be deprecated."),[_f(u.astNode),(d=u.astNode)===null||d===void 0?void 0:d.type])}}}}function YT(e,t){for(var r=Object.create(null),n=0,i=t.getInterfaces();n<i.length;n++){var o=i[n];if(!(0,je.isInterfaceType)(o)){e.reportError("Type ".concat((0,it.default)(t)," must only implement Interface types, ")+"it cannot implement ".concat((0,it.default)(o),"."),ps(t,o));continue}if(t===o){e.reportError("Type ".concat(t.name," cannot implement itself because it would create a circular reference."),ps(t,o));continue}if(r[o.name]){e.reportError("Type ".concat(t.name," can only implement ").concat(o.name," once."),ps(t,o));continue}r[o.name]=!0,j1(e,t,o),k1(e,t,o)}}function k1(e,t,r){for(var n=t.getFields(),i=0,o=(0,ds.default)(r.getFields());i<o.length;i++){var s=o[i],a=s.name,u=n[a];if(!u){e.reportError("Interface field ".concat(r.name,".").concat(a," expected but ").concat(t.name," does not provide it."),[s.astNode].concat(ki(t)));continue}if(!(0,WT.isTypeSubTypeOf)(e.schema,u.type,s.type)){var c,l;e.reportError("Interface field ".concat(r.name,".").concat(a," expects type ")+"".concat((0,it.default)(s.type)," but ").concat(t.name,".").concat(a," ")+"is type ".concat((0,it.default)(u.type),"."),[(c=s.astNode)===null||c===void 0?void 0:c.type,(l=u.astNode)===null||l===void 0?void 0:l.type])}for(var d=function(A,O){var T=O[A],x=T.name,U=(0,QT.default)(u.args,function(pe){return pe.name===x});if(!U)return e.reportError("Interface field argument ".concat(r.name,".").concat(a,"(").concat(x,":) expected but ").concat(t.name,".").concat(a," does not provide it."),[T.astNode,u.astNode]),"continue";if(!(0,WT.isEqualType)(T.type,U.type)){var N,te;e.reportError("Interface field argument ".concat(r.name,".").concat(a,"(").concat(x,":) ")+"expects type ".concat((0,it.default)(T.type)," but ")+"".concat(t.name,".").concat(a,"(").concat(x,":) is type ")+"".concat((0,it.default)(U.type),"."),[(N=T.astNode)===null||N===void 0?void 0:N.type,(te=U.astNode)===null||te===void 0?void 0:te.type])}},f=0,h=s.args;f<h.length;f++)var g=d(f,h);for(var v=function(A,O){var T=O[A],x=T.name,U=(0,QT.default)(s.args,function(N){return N.name===x});!U&&(0,je.isRequiredArgument)(T)&&e.reportError("Object field ".concat(t.name,".").concat(a," includes required argument ").concat(x," that is missing from the Interface field ").concat(r.name,".").concat(a,"."),[T.astNode,s.astNode])},_=0,S=u.args;_<S.length;_++)v(_,S)}}function j1(e,t,r){for(var n=t.getInterfaces(),i=0,o=r.getInterfaces();i<o.length;i++){var s=o[i];n.indexOf(s)===-1&&e.reportError(s===t?"Type ".concat(t.name," cannot implement ").concat(r.name," because it would create a circular reference."):"Type ".concat(t.name," must implement ").concat(s.name," because it is implemented by ").concat(r.name,"."),[].concat(ps(r,s),ps(t,r)))}}function M1(e,t){var r=t.getTypes();r.length===0&&e.reportError("Union type ".concat(t.name," must define one or more member types."),ki(t));for(var n=Object.create(null),i=0;i<r.length;i++){var o=r[i];if(n[o.name]){e.reportError("Union type ".concat(t.name," can only include type ").concat(o.name," once."),JT(t,o.name));continue}n[o.name]=!0,(0,je.isObjectType)(o)||e.reportError("Union type ".concat(t.name," can only include Object types, ")+"it cannot include ".concat((0,it.default)(o),"."),JT(t,String(o)))}}function F1(e,t){var r=t.getValues();r.length===0&&e.reportError("Enum type ".concat(t.name," must define one or more values."),ki(t));for(var n=0;n<r.length;n++){var i=r[n],o=i.name;Fn(e,i),(o==="true"||o==="false"||o==="null")&&e.reportError("Enum type ".concat(t.name," cannot include value: ").concat(o,"."),i.astNode)}}function q1(e,t){var r=(0,ds.default)(t.getFields());r.length===0&&e.reportError("Input Object type ".concat(t.name," must define one or more fields."),ki(t));for(var n=0;n<r.length;n++){var i=r[n];if(Fn(e,i),!(0,je.isInputType)(i.type)){var o;e.reportError("The type of ".concat(t.name,".").concat(i.name," must be Input Type ")+"but got: ".concat((0,it.default)(i.type),"."),(o=i.astNode)===null||o===void 0?void 0:o.type)}if((0,je.isRequiredInputField)(i)&&i.deprecationReason!=null){var s;e.reportError("Required input field ".concat(t.name,".").concat(i.name," cannot be deprecated."),[_f(i.astNode),(s=i.astNode)===null||s===void 0?void 0:s.type])}}}function U1(e){var t=Object.create(null),r=[],n=Object.create(null);return i;function i(o){if(!t[o.name]){t[o.name]=!0,n[o.name]=r.length;for(var s=(0,ds.default)(o.getFields()),a=0;a<s.length;a++){var u=s[a];if((0,je.isNonNullType)(u.type)&&(0,je.isInputObjectType)(u.type.ofType)){var c=u.type.ofType,l=n[c.name];if(r.push(u),l===void 0)i(c);else{var d=r.slice(l),f=d.map(function(h){return h.name}).join(".");e.reportError('Cannot reference Input Object "'.concat(c.name,'" within itself through a series of non-null fields: "').concat(f,'".'),d.map(function(h){return h.astNode}))}r.pop()}}n[o.name]=void 0}}}function ki(e){var t=e.astNode,r=e.extensionASTNodes;return t?r?[t].concat(r):[t]:r??[]}function Ef(e,t){for(var r=[],n=0,i=ki(e);n<i.length;n++){var o,s=i[n];r=r.concat((o=t(s))!==null&&o!==void 0?o:[])}return r}function ps(e,t){return Ef(e,function(r){return r.interfaces}).filter(function(r){return r.name.value===t.name})}function JT(e,t){return Ef(e,function(r){return r.types}).filter(function(r){return r.name.value===t})}function _f(e){var t;return e==null||(t=e.directives)===null||t===void 0?void 0:t.find(function(r){return r.name.value===XT.GraphQLDeprecatedDirective.name})}});var dr=y(Tf=>{"use strict";p();Object.defineProperty(Tf,"__esModule",{value:!0});Tf.typeFromAST=Sf;var V1=tI(se()),G1=tI(et()),bf=Ee(),eI=ie();function tI(e){return e&&e.__esModule?e:{default:e}}function Sf(e,t){var r;if(t.kind===bf.Kind.LIST_TYPE)return r=Sf(e,t.type),r&&new eI.GraphQLList(r);if(t.kind===bf.Kind.NON_NULL_TYPE)return r=Sf(e,t.type),r&&new eI.GraphQLNonNull(r);if(t.kind===bf.Kind.NAMED_TYPE)return e.getType(t.name.value);(0,G1.default)(0,"Unexpected type node: "+(0,V1.default)(t))}});var Xu=y(hs=>{"use strict";p();Object.defineProperty(hs,"__esModule",{value:!0});hs.visitWithTypeInfo=W1;hs.TypeInfo=void 0;var $1=K1(Ai()),Pe=Ee(),B1=bi(),rI=Kr(),De=ie(),ji=qt(),nI=dr();function K1(e){return e&&e.__esModule?e:{default:e}}var H1=(function(){function e(r,n,i){this._schema=r,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=n??Q1,i&&((0,De.isInputType)(i)&&this._inputTypeStack.push(i),(0,De.isCompositeType)(i)&&this._parentTypeStack.push(i),(0,De.isOutputType)(i)&&this._typeStack.push(i))}var t=e.prototype;return t.getType=function(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]},t.getParentType=function(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]},t.getInputType=function(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]},t.getParentInputType=function(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]},t.getFieldDef=function(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]},t.getDefaultValue=function(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]},t.getDirective=function(){return this._directive},t.getArgument=function(){return this._argument},t.getEnumValue=function(){return this._enumValue},t.enter=function(n){var i=this._schema;switch(n.kind){case Pe.Kind.SELECTION_SET:{var o=(0,De.getNamedType)(this.getType());this._parentTypeStack.push((0,De.isCompositeType)(o)?o:void 0);break}case Pe.Kind.FIELD:{var s=this.getParentType(),a,u;s&&(a=this._getFieldDef(i,s,n),a&&(u=a.type)),this._fieldDefStack.push(a),this._typeStack.push((0,De.isOutputType)(u)?u:void 0);break}case Pe.Kind.DIRECTIVE:this._directive=i.getDirective(n.name.value);break;case Pe.Kind.OPERATION_DEFINITION:{var c;switch(n.operation){case"query":c=i.getQueryType();break;case"mutation":c=i.getMutationType();break;case"subscription":c=i.getSubscriptionType();break}this._typeStack.push((0,De.isObjectType)(c)?c:void 0);break}case Pe.Kind.INLINE_FRAGMENT:case Pe.Kind.FRAGMENT_DEFINITION:{var l=n.typeCondition,d=l?(0,nI.typeFromAST)(i,l):(0,De.getNamedType)(this.getType());this._typeStack.push((0,De.isOutputType)(d)?d:void 0);break}case Pe.Kind.VARIABLE_DEFINITION:{var f=(0,nI.typeFromAST)(i,n.type);this._inputTypeStack.push((0,De.isInputType)(f)?f:void 0);break}case Pe.Kind.ARGUMENT:{var h,g,v,_=(h=this.getDirective())!==null&&h!==void 0?h:this.getFieldDef();_&&(g=(0,$1.default)(_.args,function(N){return N.name===n.name.value}),g&&(v=g.type)),this._argument=g,this._defaultValueStack.push(g?g.defaultValue:void 0),this._inputTypeStack.push((0,De.isInputType)(v)?v:void 0);break}case Pe.Kind.LIST:{var S=(0,De.getNullableType)(this.getInputType()),b=(0,De.isListType)(S)?S.ofType:S;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,De.isInputType)(b)?b:void 0);break}case Pe.Kind.OBJECT_FIELD:{var A=(0,De.getNamedType)(this.getInputType()),O,T;(0,De.isInputObjectType)(A)&&(T=A.getFields()[n.name.value],T&&(O=T.type)),this._defaultValueStack.push(T?T.defaultValue:void 0),this._inputTypeStack.push((0,De.isInputType)(O)?O:void 0);break}case Pe.Kind.ENUM:{var x=(0,De.getNamedType)(this.getInputType()),U;(0,De.isEnumType)(x)&&(U=x.getValue(n.value)),this._enumValue=U;break}}},t.leave=function(n){switch(n.kind){case Pe.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case Pe.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case Pe.Kind.DIRECTIVE:this._directive=null;break;case Pe.Kind.OPERATION_DEFINITION:case Pe.Kind.INLINE_FRAGMENT:case Pe.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case Pe.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case Pe.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Pe.Kind.LIST:case Pe.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case Pe.Kind.ENUM:this._enumValue=null;break}},e})();hs.TypeInfo=H1;function Q1(e,t,r){var n=r.name.value;if(n===ji.SchemaMetaFieldDef.name&&e.getQueryType()===t)return ji.SchemaMetaFieldDef;if(n===ji.TypeMetaFieldDef.name&&e.getQueryType()===t)return ji.TypeMetaFieldDef;if(n===ji.TypeNameMetaFieldDef.name&&(0,De.isCompositeType)(t))return ji.TypeNameMetaFieldDef;if((0,De.isObjectType)(t)||(0,De.isInterfaceType)(t))return t.getFields()[n]}function W1(e,t){return{enter:function(n){e.enter(n);var i=(0,rI.getVisitFn)(t,n.kind,!1);if(i){var o=i.apply(t,arguments);return o!==void 0&&(e.leave(n),(0,B1.isNode)(o)&&e.enter(o)),o}},leave:function(n){var i=(0,rI.getVisitFn)(t,n.kind,!0),o;return i&&(o=i.apply(t,arguments)),e.leave(n),o}}}});var qn=y(er=>{"use strict";p();Object.defineProperty(er,"__esModule",{value:!0});er.isDefinitionNode=z1;er.isExecutableDefinitionNode=iI;er.isSelectionNode=Y1;er.isValueNode=J1;er.isTypeNode=X1;er.isTypeSystemDefinitionNode=oI;er.isTypeDefinitionNode=sI;er.isTypeSystemExtensionNode=aI;er.isTypeExtensionNode=uI;var ae=Ee();function z1(e){return iI(e)||oI(e)||aI(e)}function iI(e){return e.kind===ae.Kind.OPERATION_DEFINITION||e.kind===ae.Kind.FRAGMENT_DEFINITION}function Y1(e){return e.kind===ae.Kind.FIELD||e.kind===ae.Kind.FRAGMENT_SPREAD||e.kind===ae.Kind.INLINE_FRAGMENT}function J1(e){return e.kind===ae.Kind.VARIABLE||e.kind===ae.Kind.INT||e.kind===ae.Kind.FLOAT||e.kind===ae.Kind.STRING||e.kind===ae.Kind.BOOLEAN||e.kind===ae.Kind.NULL||e.kind===ae.Kind.ENUM||e.kind===ae.Kind.LIST||e.kind===ae.Kind.OBJECT}function X1(e){return e.kind===ae.Kind.NAMED_TYPE||e.kind===ae.Kind.LIST_TYPE||e.kind===ae.Kind.NON_NULL_TYPE}function oI(e){return e.kind===ae.Kind.SCHEMA_DEFINITION||sI(e)||e.kind===ae.Kind.DIRECTIVE_DEFINITION}function sI(e){return e.kind===ae.Kind.SCALAR_TYPE_DEFINITION||e.kind===ae.Kind.OBJECT_TYPE_DEFINITION||e.kind===ae.Kind.INTERFACE_TYPE_DEFINITION||e.kind===ae.Kind.UNION_TYPE_DEFINITION||e.kind===ae.Kind.ENUM_TYPE_DEFINITION||e.kind===ae.Kind.INPUT_OBJECT_TYPE_DEFINITION}function aI(e){return e.kind===ae.Kind.SCHEMA_EXTENSION||uI(e)}function uI(e){return e.kind===ae.Kind.SCALAR_TYPE_EXTENSION||e.kind===ae.Kind.OBJECT_TYPE_EXTENSION||e.kind===ae.Kind.INTERFACE_TYPE_EXTENSION||e.kind===ae.Kind.UNION_TYPE_EXTENSION||e.kind===ae.Kind.ENUM_TYPE_EXTENSION||e.kind===ae.Kind.INPUT_OBJECT_TYPE_EXTENSION}});var wf=y(If=>{"use strict";p();Object.defineProperty(If,"__esModule",{value:!0});If.ExecutableDefinitionsRule=t$;var Z1=K(),cI=Ee(),e$=qn();function t$(e){return{Document:function(r){for(var n=0,i=r.definitions;n<i.length;n++){var o=i[n];if(!(0,e$.isExecutableDefinitionNode)(o)){var s=o.kind===cI.Kind.SCHEMA_DEFINITION||o.kind===cI.Kind.SCHEMA_EXTENSION?"schema":'"'+o.name.value+'"';e.reportError(new Z1.GraphQLError("The ".concat(s," definition is not executable."),o))}}return!1}}}});var Af=y(Of=>{"use strict";p();Object.defineProperty(Of,"__esModule",{value:!0});Of.UniqueOperationNamesRule=n$;var r$=K();function n$(e){var t=Object.create(null);return{OperationDefinition:function(n){var i=n.name;return i&&(t[i.value]?e.reportError(new r$.GraphQLError('There can be only one operation named "'.concat(i.value,'".'),[t[i.value],i])):t[i.value]=i),!1},FragmentDefinition:function(){return!1}}}});var Nf=y(xf=>{"use strict";p();Object.defineProperty(xf,"__esModule",{value:!0});xf.LoneAnonymousOperationRule=s$;var i$=K(),o$=Ee();function s$(e){var t=0;return{Document:function(n){t=n.definitions.filter(function(i){return i.kind===o$.Kind.OPERATION_DEFINITION}).length},OperationDefinition:function(n){!n.name&&t>1&&e.reportError(new i$.GraphQLError("This anonymous operation must be the only defined operation.",n))}}}});var Cf=y(Rf=>{"use strict";p();Object.defineProperty(Rf,"__esModule",{value:!0});Rf.SingleFieldSubscriptionsRule=u$;var a$=K();function u$(e){return{OperationDefinition:function(r){r.operation==="subscription"&&r.selectionSet.selections.length!==1&&e.reportError(new a$.GraphQLError(r.name?'Subscription "'.concat(r.name.value,'" must select only one top level field.'):"Anonymous Subscription must select only one top level field.",r.selectionSet.selections.slice(1)))}}}});var Lf=y(Df=>{"use strict";p();Object.defineProperty(Df,"__esModule",{value:!0});Df.KnownTypeNamesRule=h$;var c$=lI(Qr()),l$=lI(Wr()),p$=K(),Pf=qn(),d$=pr(),f$=qt();function lI(e){return e&&e.__esModule?e:{default:e}}function h$(e){for(var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null),i=0,o=e.getDocument().definitions;i<o.length;i++){var s=o[i];(0,Pf.isTypeDefinitionNode)(s)&&(n[s.name.value]=!0)}var a=Object.keys(r).concat(Object.keys(n));return{NamedType:function(c,l,d,f,h){var g=c.name.value;if(!r[g]&&!n[g]){var v,_=(v=h[2])!==null&&v!==void 0?v:d,S=_!=null&&g$(_);if(S&&m$(g))return;var b=(0,l$.default)(g,S?pI.concat(a):a);e.reportError(new p$.GraphQLError('Unknown type "'.concat(g,'".')+(0,c$.default)(b),c))}}}}var pI=[].concat(d$.specifiedScalarTypes,f$.introspectionTypes).map(function(e){return e.name});function m$(e){return pI.indexOf(e)!==-1}function g$(e){return!Array.isArray(e)&&((0,Pf.isTypeSystemDefinitionNode)(e)||(0,Pf.isTypeSystemExtensionNode)(e))}});var jf=y(kf=>{"use strict";p();Object.defineProperty(kf,"__esModule",{value:!0});kf.FragmentsOnCompositeTypesRule=y$;var dI=K(),fI=mt(),hI=ie(),mI=dr();function y$(e){return{InlineFragment:function(r){var n=r.typeCondition;if(n){var i=(0,mI.typeFromAST)(e.getSchema(),n);if(i&&!(0,hI.isCompositeType)(i)){var o=(0,fI.print)(n);e.reportError(new dI.GraphQLError('Fragment cannot condition on non composite type "'.concat(o,'".'),n))}}},FragmentDefinition:function(r){var n=(0,mI.typeFromAST)(e.getSchema(),r.typeCondition);if(n&&!(0,hI.isCompositeType)(n)){var i=(0,fI.print)(r.typeCondition);e.reportError(new dI.GraphQLError('Fragment "'.concat(r.name.value,'" cannot condition on non composite type "').concat(i,'".'),r.typeCondition))}}}}});var Ff=y(Mf=>{"use strict";p();Object.defineProperty(Mf,"__esModule",{value:!0});Mf.VariablesAreInputTypesRule=S$;var v$=K(),E$=mt(),_$=ie(),b$=dr();function S$(e){return{VariableDefinition:function(r){var n=(0,b$.typeFromAST)(e.getSchema(),r.type);if(n&&!(0,_$.isInputType)(n)){var i=r.variable.name.value,o=(0,E$.print)(r.type);e.reportError(new v$.GraphQLError('Variable "$'.concat(i,'" cannot be non-input type "').concat(o,'".'),r.type))}}}}});var Uf=y(qf=>{"use strict";p();Object.defineProperty(qf,"__esModule",{value:!0});qf.ScalarLeafsRule=I$;var gI=T$(se()),yI=K(),vI=ie();function T$(e){return e&&e.__esModule?e:{default:e}}function I$(e){return{Field:function(r){var n=e.getType(),i=r.selectionSet;if(n){if((0,vI.isLeafType)((0,vI.getNamedType)(n))){if(i){var o=r.name.value,s=(0,gI.default)(n);e.reportError(new yI.GraphQLError('Field "'.concat(o,'" must not have a selection since type "').concat(s,'" has no subfields.'),i))}}else if(!i){var a=r.name.value,u=(0,gI.default)(n);e.reportError(new yI.GraphQLError('Field "'.concat(a,'" of type "').concat(u,'" must have a selection of subfields. Did you mean "').concat(a,' { ... }"?'),r))}}}}}});var Gf=y(Vf=>{"use strict";p();Object.defineProperty(Vf,"__esModule",{value:!0});Vf.FieldsOnCorrectTypeRule=N$;var w$=Zu(Zd()),EI=Zu(Qr()),O$=Zu(Wr()),A$=Zu(Xo()),x$=K(),ms=ie();function Zu(e){return e&&e.__esModule?e:{default:e}}function N$(e){return{Field:function(r){var n=e.getParentType();if(n){var i=e.getFieldDef();if(!i){var o=e.getSchema(),s=r.name.value,a=(0,EI.default)("to use an inline fragment on",R$(o,n,s));a===""&&(a=(0,EI.default)(C$(n,s))),e.reportError(new x$.GraphQLError('Cannot query field "'.concat(s,'" on type "').concat(n.name,'".')+a,r))}}}}}function R$(e,t,r){if(!(0,ms.isAbstractType)(t))return[];for(var n=new Set,i=Object.create(null),o=0,s=e.getPossibleTypes(t);o<s.length;o++){var a=s[o];if(a.getFields()[r]){n.add(a),i[a.name]=1;for(var u=0,c=a.getInterfaces();u<c.length;u++){var l,d=c[u];d.getFields()[r]&&(n.add(d),i[d.name]=((l=i[d.name])!==null&&l!==void 0?l:0)+1)}}}return(0,w$.default)(n).sort(function(f,h){var g=i[h.name]-i[f.name];return g!==0?g:(0,ms.isInterfaceType)(f)&&e.isSubType(f,h)?-1:(0,ms.isInterfaceType)(h)&&e.isSubType(h,f)?1:(0,A$.default)(f.name,h.name)}).map(function(f){return f.name})}function C$(e,t){if((0,ms.isObjectType)(e)||(0,ms.isInterfaceType)(e)){var r=Object.keys(e.getFields());return(0,O$.default)(t,r)}return[]}});var Bf=y($f=>{"use strict";p();Object.defineProperty($f,"__esModule",{value:!0});$f.UniqueFragmentNamesRule=D$;var P$=K();function D$(e){var t=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(n){var i=n.name.value;return t[i]?e.reportError(new P$.GraphQLError('There can be only one fragment named "'.concat(i,'".'),[t[i],n.name])):t[i]=n.name,!1}}}});var Hf=y(Kf=>{"use strict";p();Object.defineProperty(Kf,"__esModule",{value:!0});Kf.KnownFragmentNamesRule=k$;var L$=K();function k$(e){return{FragmentSpread:function(r){var n=r.name.value,i=e.getFragment(n);i||e.reportError(new L$.GraphQLError('Unknown fragment "'.concat(n,'".'),r.name))}}}});var Wf=y(Qf=>{"use strict";p();Object.defineProperty(Qf,"__esModule",{value:!0});Qf.NoUnusedFragmentsRule=M$;var j$=K();function M$(e){var t=[],r=[];return{OperationDefinition:function(i){return t.push(i),!1},FragmentDefinition:function(i){return r.push(i),!1},Document:{leave:function(){for(var i=Object.create(null),o=0;o<t.length;o++)for(var s=t[o],a=0,u=e.getRecursivelyReferencedFragments(s);a<u.length;a++){var c=u[a];i[c.name.value]=!0}for(var l=0;l<r.length;l++){var d=r[l],f=d.name.value;i[f]!==!0&&e.reportError(new j$.GraphQLError('Fragment "'.concat(f,'" is never used.'),d))}}}}}});var Jf=y(Yf=>{"use strict";p();Object.defineProperty(Yf,"__esModule",{value:!0});Yf.PossibleFragmentSpreadsRule=U$;var ec=q$(se()),_I=K(),zf=ie(),F$=dr(),bI=ns();function q$(e){return e&&e.__esModule?e:{default:e}}function U$(e){return{InlineFragment:function(r){var n=e.getType(),i=e.getParentType();if((0,zf.isCompositeType)(n)&&(0,zf.isCompositeType)(i)&&!(0,bI.doTypesOverlap)(e.getSchema(),n,i)){var o=(0,ec.default)(i),s=(0,ec.default)(n);e.reportError(new _I.GraphQLError('Fragment cannot be spread here as objects of type "'.concat(o,'" can never be of type "').concat(s,'".'),r))}},FragmentSpread:function(r){var n=r.name.value,i=V$(e,n),o=e.getParentType();if(i&&o&&!(0,bI.doTypesOverlap)(e.getSchema(),i,o)){var s=(0,ec.default)(o),a=(0,ec.default)(i);e.reportError(new _I.GraphQLError('Fragment "'.concat(n,'" cannot be spread here as objects of type "').concat(s,'" can never be of type "').concat(a,'".'),r))}}}}function V$(e,t){var r=e.getFragment(t);if(r){var n=(0,F$.typeFromAST)(e.getSchema(),r.typeCondition);if((0,zf.isCompositeType)(n))return n}}});var Zf=y(Xf=>{"use strict";p();Object.defineProperty(Xf,"__esModule",{value:!0});Xf.NoFragmentCyclesRule=$$;var G$=K();function $$(e){var t=Object.create(null),r=[],n=Object.create(null);return{OperationDefinition:function(){return!1},FragmentDefinition:function(s){return i(s),!1}};function i(o){if(!t[o.name.value]){var s=o.name.value;t[s]=!0;var a=e.getFragmentSpreads(o.selectionSet);if(a.length!==0){n[s]=r.length;for(var u=0;u<a.length;u++){var c=a[u],l=c.name.value,d=n[l];if(r.push(c),d===void 0){var f=e.getFragment(l);f&&i(f)}else{var h=r.slice(d),g=h.slice(0,-1).map(function(v){return'"'+v.name.value+'"'}).join(", ");e.reportError(new G$.GraphQLError('Cannot spread fragment "'.concat(l,'" within itself')+(g!==""?" via ".concat(g,"."):"."),h))}r.pop()}n[s]=void 0}}}}});var th=y(eh=>{"use strict";p();Object.defineProperty(eh,"__esModule",{value:!0});eh.UniqueVariableNamesRule=K$;var B$=K();function K$(e){var t=Object.create(null);return{OperationDefinition:function(){t=Object.create(null)},VariableDefinition:function(n){var i=n.variable.name.value;t[i]?e.reportError(new B$.GraphQLError('There can be only one variable named "$'.concat(i,'".'),[t[i],n.variable.name])):t[i]=n.variable.name}}}});var nh=y(rh=>{"use strict";p();Object.defineProperty(rh,"__esModule",{value:!0});rh.NoUndefinedVariablesRule=Q$;var H$=K();function Q$(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),o=0;o<i.length;o++){var s=i[o],a=s.node,u=a.name.value;t[u]!==!0&&e.reportError(new H$.GraphQLError(n.name?'Variable "$'.concat(u,'" is not defined by operation "').concat(n.name.value,'".'):'Variable "$'.concat(u,'" is not defined.'),[a,n]))}}},VariableDefinition:function(n){t[n.variable.name.value]=!0}}}});var oh=y(ih=>{"use strict";p();Object.defineProperty(ih,"__esModule",{value:!0});ih.NoUnusedVariablesRule=z$;var W$=K();function z$(e){var t=[];return{OperationDefinition:{enter:function(){t=[]},leave:function(n){for(var i=Object.create(null),o=e.getRecursiveVariableUsages(n),s=0;s<o.length;s++){var a=o[s],u=a.node;i[u.name.value]=!0}for(var c=0,l=t;c<l.length;c++){var d=l[c],f=d.variable.name.value;i[f]!==!0&&e.reportError(new W$.GraphQLError(n.name?'Variable "$'.concat(f,'" is never used in operation "').concat(n.name.value,'".'):'Variable "$'.concat(f,'" is never used.'),d))}}},VariableDefinition:function(n){t.push(n)}}}});var ah=y(sh=>{"use strict";p();Object.defineProperty(sh,"__esModule",{value:!0});sh.KnownDirectivesRule=X$;var Y$=II(se()),TI=II(et()),SI=K(),we=Ee(),Ke=Ti(),J$=gt();function II(e){return e&&e.__esModule?e:{default:e}}function X$(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():J$.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=o.locations}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];u.kind===we.Kind.DIRECTIVE_DEFINITION&&(t[u.name.value]=u.locations.map(function(c){return c.value}))}return{Directive:function(l,d,f,h,g){var v=l.name.value,_=t[v];if(!_){e.reportError(new SI.GraphQLError('Unknown directive "@'.concat(v,'".'),l));return}var S=Z$(g);S&&_.indexOf(S)===-1&&e.reportError(new SI.GraphQLError('Directive "@'.concat(v,'" may not be used on ').concat(S,"."),l))}}}function Z$(e){var t=e[e.length-1];switch(!Array.isArray(t)||(0,TI.default)(0),t.kind){case we.Kind.OPERATION_DEFINITION:return eB(t.operation);case we.Kind.FIELD:return Ke.DirectiveLocation.FIELD;case we.Kind.FRAGMENT_SPREAD:return Ke.DirectiveLocation.FRAGMENT_SPREAD;case we.Kind.INLINE_FRAGMENT:return Ke.DirectiveLocation.INLINE_FRAGMENT;case we.Kind.FRAGMENT_DEFINITION:return Ke.DirectiveLocation.FRAGMENT_DEFINITION;case we.Kind.VARIABLE_DEFINITION:return Ke.DirectiveLocation.VARIABLE_DEFINITION;case we.Kind.SCHEMA_DEFINITION:case we.Kind.SCHEMA_EXTENSION:return Ke.DirectiveLocation.SCHEMA;case we.Kind.SCALAR_TYPE_DEFINITION:case we.Kind.SCALAR_TYPE_EXTENSION:return Ke.DirectiveLocation.SCALAR;case we.Kind.OBJECT_TYPE_DEFINITION:case we.Kind.OBJECT_TYPE_EXTENSION:return Ke.DirectiveLocation.OBJECT;case we.Kind.FIELD_DEFINITION:return Ke.DirectiveLocation.FIELD_DEFINITION;case we.Kind.INTERFACE_TYPE_DEFINITION:case we.Kind.INTERFACE_TYPE_EXTENSION:return Ke.DirectiveLocation.INTERFACE;case we.Kind.UNION_TYPE_DEFINITION:case we.Kind.UNION_TYPE_EXTENSION:return Ke.DirectiveLocation.UNION;case we.Kind.ENUM_TYPE_DEFINITION:case we.Kind.ENUM_TYPE_EXTENSION:return Ke.DirectiveLocation.ENUM;case we.Kind.ENUM_VALUE_DEFINITION:return Ke.DirectiveLocation.ENUM_VALUE;case we.Kind.INPUT_OBJECT_TYPE_DEFINITION:case we.Kind.INPUT_OBJECT_TYPE_EXTENSION:return Ke.DirectiveLocation.INPUT_OBJECT;case we.Kind.INPUT_VALUE_DEFINITION:{var r=e[e.length-3];return r.kind===we.Kind.INPUT_OBJECT_TYPE_DEFINITION?Ke.DirectiveLocation.INPUT_FIELD_DEFINITION:Ke.DirectiveLocation.ARGUMENT_DEFINITION}}}function eB(e){switch(e){case"query":return Ke.DirectiveLocation.QUERY;case"mutation":return Ke.DirectiveLocation.MUTATION;case"subscription":return Ke.DirectiveLocation.SUBSCRIPTION}(0,TI.default)(0,"Unexpected operation: "+(0,Y$.default)(e))}});var lh=y(ch=>{"use strict";p();Object.defineProperty(ch,"__esModule",{value:!0});ch.UniqueDirectivesPerLocationRule=nB;var tB=K(),uh=Ee(),wI=qn(),rB=gt();function nB(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():rB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=!o.isRepeatable}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];u.kind===uh.Kind.DIRECTIVE_DEFINITION&&(t[u.name.value]=!u.repeatable)}var c=Object.create(null),l=Object.create(null);return{enter:function(f){if(f.directives!=null){var h;if(f.kind===uh.Kind.SCHEMA_DEFINITION||f.kind===uh.Kind.SCHEMA_EXTENSION)h=c;else if((0,wI.isTypeDefinitionNode)(f)||(0,wI.isTypeExtensionNode)(f)){var g=f.name.value;h=l[g],h===void 0&&(l[g]=h=Object.create(null))}else h=Object.create(null);for(var v=0,_=f.directives;v<_.length;v++){var S=_[v],b=S.name.value;t[b]&&(h[b]?e.reportError(new tB.GraphQLError('The directive "@'.concat(b,'" can only be used once at this location.'),[h[b],S])):h[b]=S)}}}}}});var ph=y(tc=>{"use strict";p();Object.defineProperty(tc,"__esModule",{value:!0});tc.KnownArgumentNamesRule=aB;tc.KnownArgumentNamesOnDirectivesRule=PI;var xI=CI(Qr()),NI=CI(Wr()),RI=K(),iB=Ee(),oB=gt();function CI(e){return e&&e.__esModule?e:{default:e}}function OI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function AI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?OI(Object(r),!0).forEach(function(n){sB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aB(e){return AI(AI({},PI(e)),{},{Argument:function(r){var n=e.getArgument(),i=e.getFieldDef(),o=e.getParentType();if(!n&&i&&o){var s=r.name.value,a=i.args.map(function(c){return c.name}),u=(0,NI.default)(s,a);e.reportError(new RI.GraphQLError('Unknown argument "'.concat(s,'" on field "').concat(o.name,".").concat(i.name,'".')+(0,xI.default)(u),r))}}})}function PI(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():oB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=o.args.map(function(d){return d.name})}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];if(u.kind===iB.Kind.DIRECTIVE_DEFINITION){var c,l=(c=u.arguments)!==null&&c!==void 0?c:[];t[u.name.value]=l.map(function(d){return d.name.value})}}return{Directive:function(f){var h=f.name.value,g=t[h];if(f.arguments&&g)for(var v=0,_=f.arguments;v<_.length;v++){var S=_[v],b=S.name.value;if(g.indexOf(b)===-1){var A=(0,NI.default)(b,g);e.reportError(new RI.GraphQLError('Unknown argument "'.concat(b,'" on directive "@').concat(h,'".')+(0,xI.default)(A),S))}}return!1}}}});var fh=y(dh=>{"use strict";p();Object.defineProperty(dh,"__esModule",{value:!0});dh.UniqueArgumentNamesRule=cB;var uB=K();function cB(e){var t=Object.create(null);return{Field:function(){t=Object.create(null)},Directive:function(){t=Object.create(null)},Argument:function(n){var i=n.name.value;return t[i]?e.reportError(new uB.GraphQLError('There can be only one argument named "'.concat(i,'".'),[t[i],n.name])):t[i]=n.name,!1}}}});var mh=y(hh=>{"use strict";p();Object.defineProperty(hh,"__esModule",{value:!0});hh.ValuesOfCorrectTypeRule=hB;var lB=ys(bt()),pB=ys(Hr()),gs=ys(se()),dB=ys(Qr()),fB=ys(Wr()),Vn=K(),rc=mt(),fr=ie();function ys(e){return e&&e.__esModule?e:{default:e}}function hB(e){return{ListValue:function(r){var n=(0,fr.getNullableType)(e.getParentInputType());if(!(0,fr.isListType)(n))return Un(e,r),!1},ObjectValue:function(r){var n=(0,fr.getNamedType)(e.getInputType());if(!(0,fr.isInputObjectType)(n))return Un(e,r),!1;for(var i=(0,pB.default)(r.fields,function(l){return l.name.value}),o=0,s=(0,lB.default)(n.getFields());o<s.length;o++){var a=s[o],u=i[a.name];if(!u&&(0,fr.isRequiredInputField)(a)){var c=(0,gs.default)(a.type);e.reportError(new Vn.GraphQLError('Field "'.concat(n.name,".").concat(a.name,'" of required type "').concat(c,'" was not provided.'),r))}}},ObjectField:function(r){var n=(0,fr.getNamedType)(e.getParentInputType()),i=e.getInputType();if(!i&&(0,fr.isInputObjectType)(n)){var o=(0,fB.default)(r.name.value,Object.keys(n.getFields()));e.reportError(new Vn.GraphQLError('Field "'.concat(r.name.value,'" is not defined by type "').concat(n.name,'".')+(0,dB.default)(o),r))}},NullValue:function(r){var n=e.getInputType();(0,fr.isNonNullType)(n)&&e.reportError(new Vn.GraphQLError('Expected value of type "'.concat((0,gs.default)(n),'", found ').concat((0,rc.print)(r),"."),r))},EnumValue:function(r){return Un(e,r)},IntValue:function(r){return Un(e,r)},FloatValue:function(r){return Un(e,r)},StringValue:function(r){return Un(e,r)},BooleanValue:function(r){return Un(e,r)}}}function Un(e,t){var r=e.getInputType();if(r){var n=(0,fr.getNamedType)(r);if(!(0,fr.isLeafType)(n)){var i=(0,gs.default)(r);e.reportError(new Vn.GraphQLError('Expected value of type "'.concat(i,'", found ').concat((0,rc.print)(t),"."),t));return}try{var o=n.parseLiteral(t,void 0);if(o===void 0){var s=(0,gs.default)(r);e.reportError(new Vn.GraphQLError('Expected value of type "'.concat(s,'", found ').concat((0,rc.print)(t),"."),t))}}catch(u){var a=(0,gs.default)(r);u instanceof Vn.GraphQLError?e.reportError(u):e.reportError(new Vn.GraphQLError('Expected value of type "'.concat(a,'", found ').concat((0,rc.print)(t),"; ")+u.message,t,void 0,void 0,void 0,u))}}}});var yh=y(ic=>{"use strict";p();Object.defineProperty(ic,"__esModule",{value:!0});ic.ProvidedRequiredArgumentsRule=vB;ic.ProvidedRequiredArgumentsOnDirectivesRule=qI;var kI=FI(se()),nc=FI(Hr()),jI=K(),MI=Ee(),mB=mt(),gB=gt(),gh=ie();function FI(e){return e&&e.__esModule?e:{default:e}}function DI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function LI(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DI(Object(r),!0).forEach(function(n){yB(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DI(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yB(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vB(e){return LI(LI({},qI(e)),{},{Field:{leave:function(r){var n,i=e.getFieldDef();if(!i)return!1;for(var o=(n=r.arguments)!==null&&n!==void 0?n:[],s=(0,nc.default)(o,function(f){return f.name.value}),a=0,u=i.args;a<u.length;a++){var c=u[a],l=s[c.name];if(!l&&(0,gh.isRequiredArgument)(c)){var d=(0,kI.default)(c.type);e.reportError(new jI.GraphQLError('Field "'.concat(i.name,'" argument "').concat(c.name,'" of type "').concat(d,'" is required, but it was not provided.'),r))}}}}})}function qI(e){for(var t=Object.create(null),r=e.getSchema(),n=r?r.getDirectives():gB.specifiedDirectives,i=0;i<n.length;i++){var o=n[i];t[o.name]=(0,nc.default)(o.args.filter(gh.isRequiredArgument),function(d){return d.name})}for(var s=e.getDocument().definitions,a=0;a<s.length;a++){var u=s[a];if(u.kind===MI.Kind.DIRECTIVE_DEFINITION){var c,l=(c=u.arguments)!==null&&c!==void 0?c:[];t[u.name.value]=(0,nc.default)(l.filter(EB),function(d){return d.name.value})}}return{Directive:{leave:function(f){var h=f.name.value,g=t[h];if(g)for(var v,_=(v=f.arguments)!==null&&v!==void 0?v:[],S=(0,nc.default)(_,function(U){return U.name.value}),b=0,A=Object.keys(g);b<A.length;b++){var O=A[b];if(!S[O]){var T=g[O].type,x=(0,gh.isType)(T)?(0,kI.default)(T):(0,mB.print)(T);e.reportError(new jI.GraphQLError('Directive "@'.concat(h,'" argument "').concat(O,'" of type "').concat(x,'" is required, but it was not provided.'),f))}}}}}}function EB(e){return e.type.kind===MI.Kind.NON_NULL_TYPE&&e.defaultValue==null}});var Eh=y(vh=>{"use strict";p();Object.defineProperty(vh,"__esModule",{value:!0});vh.VariablesInAllowedPositionRule=IB;var UI=TB(se()),_B=K(),bB=Ee(),VI=ie(),SB=dr(),GI=ns();function TB(e){return e&&e.__esModule?e:{default:e}}function IB(e){var t=Object.create(null);return{OperationDefinition:{enter:function(){t=Object.create(null)},leave:function(n){for(var i=e.getRecursiveVariableUsages(n),o=0;o<i.length;o++){var s=i[o],a=s.node,u=s.type,c=s.defaultValue,l=a.name.value,d=t[l];if(d&&u){var f=e.getSchema(),h=(0,SB.typeFromAST)(f,d.type);if(h&&!wB(f,h,d.defaultValue,u,c)){var g=(0,UI.default)(h),v=(0,UI.default)(u);e.reportError(new _B.GraphQLError('Variable "$'.concat(l,'" of type "').concat(g,'" used in position expecting type "').concat(v,'".'),[d,a]))}}}}},VariableDefinition:function(n){t[n.variable.name.value]=n}}}function wB(e,t,r,n,i){if((0,VI.isNonNullType)(n)&&!(0,VI.isNonNullType)(t)){var o=r!=null&&r.kind!==bB.Kind.NULL,s=i!==void 0;if(!o&&!s)return!1;var a=n.ofType;return(0,GI.isTypeSubTypeOf)(e,t,a)}return(0,GI.isTypeSubTypeOf)(e,t,n)}});var Oh=y(wh=>{"use strict";p();Object.defineProperty(wh,"__esModule",{value:!0});wh.OverlappingFieldsCanBeMergedRule=NB;var OB=Th(Ai()),AB=Th(xi()),$I=Th(se()),xB=K(),_h=Ee(),BI=mt(),yt=ie(),KI=dr();function Th(e){return e&&e.__esModule?e:{default:e}}function HI(e){return Array.isArray(e)?e.map(function(t){var r=t[0],n=t[1];return'subfields "'.concat(r,'" conflict because ')+HI(n)}).join(" and "):e}function NB(e){var t=new jB,r=new Map;return{SelectionSet:function(i){for(var o=RB(e,r,t,e.getParentType(),i),s=0;s<o.length;s++){var a=o[s],u=a[0],c=u[0],l=u[1],d=a[1],f=a[2],h=HI(l);e.reportError(new xB.GraphQLError('Fields "'.concat(c,'" conflict because ').concat(h,". Use different aliases on the fields to fetch both if this was intentional."),d.concat(f)))}}}}function RB(e,t,r,n,i){var o=[],s=ac(e,t,n,i),a=s[0],u=s[1];if(PB(e,o,t,r,a),u.length!==0)for(var c=0;c<u.length;c++){oc(e,o,t,r,!1,a,u[c]);for(var l=c+1;l<u.length;l++)sc(e,o,t,r,!1,u[c],u[l])}return o}function oc(e,t,r,n,i,o,s){var a=e.getFragment(s);if(a){var u=Sh(e,r,a),c=u[0],l=u[1];if(o!==c){Ih(e,t,r,n,i,o,c);for(var d=0;d<l.length;d++){var f=l[d];n.has(f,s,i)||(n.add(f,s,i),oc(e,t,r,n,i,o,l[d]))}}}}function sc(e,t,r,n,i,o,s){if(o!==s&&!n.has(o,s,i)){n.add(o,s,i);var a=e.getFragment(o),u=e.getFragment(s);if(!(!a||!u)){var c=Sh(e,r,a),l=c[0],d=c[1],f=Sh(e,r,u),h=f[0],g=f[1];Ih(e,t,r,n,i,l,h);for(var v=0;v<g.length;v++)sc(e,t,r,n,i,o,g[v]);for(var _=0;_<d.length;_++)sc(e,t,r,n,i,d[_],s)}}}function CB(e,t,r,n,i,o,s,a){var u=[],c=ac(e,t,i,o),l=c[0],d=c[1],f=ac(e,t,s,a),h=f[0],g=f[1];if(Ih(e,u,t,r,n,l,h),g.length!==0)for(var v=0;v<g.length;v++)oc(e,u,t,r,n,l,g[v]);if(d.length!==0)for(var _=0;_<d.length;_++)oc(e,u,t,r,n,h,d[_]);for(var S=0;S<d.length;S++)for(var b=0;b<g.length;b++)sc(e,u,t,r,n,d[S],g[b]);return u}function PB(e,t,r,n,i){for(var o=0,s=(0,AB.default)(i);o<s.length;o++){var a=s[o],u=a[0],c=a[1];if(c.length>1)for(var l=0;l<c.length;l++)for(var d=l+1;d<c.length;d++){var f=QI(e,r,n,!1,u,c[l],c[d]);f&&t.push(f)}}}function Ih(e,t,r,n,i,o,s){for(var a=0,u=Object.keys(o);a<u.length;a++){var c=u[a],l=s[c];if(l)for(var d=o[c],f=0;f<d.length;f++)for(var h=0;h<l.length;h++){var g=QI(e,r,n,i,c,d[f],l[h]);g&&t.push(g)}}}function QI(e,t,r,n,i,o,s){var a=o[0],u=o[1],c=o[2],l=s[0],d=s[1],f=s[2],h=n||a!==l&&(0,yt.isObjectType)(a)&&(0,yt.isObjectType)(l);if(!h){var g,v,_=u.name.value,S=d.name.value;if(_!==S)return[[i,'"'.concat(_,'" and "').concat(S,'" are different fields')],[u],[d]];var b=(g=u.arguments)!==null&&g!==void 0?g:[],A=(v=d.arguments)!==null&&v!==void 0?v:[];if(!DB(b,A))return[[i,"they have differing arguments"],[u],[d]]}var O=c?.type,T=f?.type;if(O&&T&&bh(O,T))return[[i,'they return conflicting types "'.concat((0,$I.default)(O),'" and "').concat((0,$I.default)(T),'"')],[u],[d]];var x=u.selectionSet,U=d.selectionSet;if(x&&U){var N=CB(e,t,r,h,(0,yt.getNamedType)(O),x,(0,yt.getNamedType)(T),U);return kB(N,i,u,d)}}function DB(e,t){return e.length!==t.length?!1:e.every(function(r){var n=(0,OB.default)(t,function(i){return i.name.value===r.name.value});return n?LB(r.value,n.value):!1})}function LB(e,t){return(0,BI.print)(e)===(0,BI.print)(t)}function bh(e,t){return(0,yt.isListType)(e)?(0,yt.isListType)(t)?bh(e.ofType,t.ofType):!0:(0,yt.isListType)(t)?!0:(0,yt.isNonNullType)(e)?(0,yt.isNonNullType)(t)?bh(e.ofType,t.ofType):!0:(0,yt.isNonNullType)(t)?!0:(0,yt.isLeafType)(e)||(0,yt.isLeafType)(t)?e!==t:!1}function ac(e,t,r,n){var i=t.get(n);if(!i){var o=Object.create(null),s=Object.create(null);WI(e,r,n,o,s),i=[o,Object.keys(s)],t.set(n,i)}return i}function Sh(e,t,r){var n=t.get(r.selectionSet);if(n)return n;var i=(0,KI.typeFromAST)(e.getSchema(),r.typeCondition);return ac(e,t,i,r.selectionSet)}function WI(e,t,r,n,i){for(var o=0,s=r.selections;o<s.length;o++){var a=s[o];switch(a.kind){case _h.Kind.FIELD:{var u=a.name.value,c=void 0;((0,yt.isObjectType)(t)||(0,yt.isInterfaceType)(t))&&(c=t.getFields()[u]);var l=a.alias?a.alias.value:u;n[l]||(n[l]=[]),n[l].push([t,a,c]);break}case _h.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case _h.Kind.INLINE_FRAGMENT:{var d=a.typeCondition,f=d?(0,KI.typeFromAST)(e.getSchema(),d):t;WI(e,f,a.selectionSet,n,i);break}}}}function kB(e,t,r,n){if(e.length>0)return[[t,e.map(function(i){var o=i[0];return o})],e.reduce(function(i,o){var s=o[1];return i.concat(s)},[r]),e.reduce(function(i,o){var s=o[2];return i.concat(s)},[n])]}var jB=(function(){function e(){this._data=Object.create(null)}var t=e.prototype;return t.has=function(n,i,o){var s=this._data[n],a=s&&s[i];return a===void 0?!1:o===!1?a===!1:!0},t.add=function(n,i,o){this._pairSetAdd(n,i,o),this._pairSetAdd(i,n,o)},t._pairSetAdd=function(n,i,o){var s=this._data[n];s||(s=Object.create(null),this._data[n]=s),s[i]=o},e})()});var xh=y(Ah=>{"use strict";p();Object.defineProperty(Ah,"__esModule",{value:!0});Ah.UniqueInputFieldNamesRule=FB;var MB=K();function FB(e){var t=[],r=Object.create(null);return{ObjectValue:{enter:function(){t.push(r),r=Object.create(null)},leave:function(){r=t.pop()}},ObjectField:function(i){var o=i.name.value;r[o]?e.reportError(new MB.GraphQLError('There can be only one input field named "'.concat(o,'".'),[r[o],i.name])):r[o]=i.name}}}});var Rh=y(Nh=>{"use strict";p();Object.defineProperty(Nh,"__esModule",{value:!0});Nh.MaxIntrospectionDepthRule=VB;var qB=K(),zI=Ee(),UB=3;function VB(e){function t(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Object.create(null),i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(r.kind===zI.Kind.FRAGMENT_SPREAD){var o=r.name.value;if(n[o]===!0)return!1;var s=e.getFragment(o);if(!s)return!1;try{return n[o]=!0,t(s,n,i)}finally{n[o]=null}}if(r.kind===zI.Kind.FIELD&&(r.name.value==="fields"||r.name.value==="interfaces"||r.name.value==="possibleTypes"||r.name.value==="inputFields")&&(i++,i>=UB))return!0;if("selectionSet"in r&&r.selectionSet)for(var a=0,u=r.selectionSet.selections;a<u.length;a++){var c=u[a];if(t(c,n,i))return!0}return!1}return{Field:function(n){if((n.name.value==="__schema"||n.name.value==="__type")&&t(n))return e.reportError(new qB.GraphQLError("Maximum introspection depth exceeded",[n])),!1}}}});var Ph=y(Ch=>{"use strict";p();Object.defineProperty(Ch,"__esModule",{value:!0});Ch.LoneSchemaDefinitionRule=GB;var YI=K();function GB(e){var t,r,n,i=e.getSchema(),o=(t=(r=(n=i?.astNode)!==null&&n!==void 0?n:i?.getQueryType())!==null&&r!==void 0?r:i?.getMutationType())!==null&&t!==void 0?t:i?.getSubscriptionType(),s=0;return{SchemaDefinition:function(u){if(o){e.reportError(new YI.GraphQLError("Cannot define a new schema within a schema extension.",u));return}s>0&&e.reportError(new YI.GraphQLError("Must provide only one schema definition.",u)),++s}}}});var Lh=y(Dh=>{"use strict";p();Object.defineProperty(Dh,"__esModule",{value:!0});Dh.UniqueOperationTypesRule=$B;var JI=K();function $B(e){var t=e.getSchema(),r=Object.create(null),n=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:i,SchemaExtension:i};function i(o){for(var s,a=(s=o.operationTypes)!==null&&s!==void 0?s:[],u=0;u<a.length;u++){var c=a[u],l=c.operation,d=r[l];n[l]?e.reportError(new JI.GraphQLError("Type for ".concat(l," already defined in the schema. It cannot be redefined."),c)):d?e.reportError(new JI.GraphQLError("There can be only one ".concat(l," type in schema."),[d,c])):r[l]=c}return!1}}});var jh=y(kh=>{"use strict";p();Object.defineProperty(kh,"__esModule",{value:!0});kh.UniqueTypeNamesRule=BB;var XI=K();function BB(e){var t=Object.create(null),r=e.getSchema();return{ScalarTypeDefinition:n,ObjectTypeDefinition:n,InterfaceTypeDefinition:n,UnionTypeDefinition:n,EnumTypeDefinition:n,InputObjectTypeDefinition:n};function n(i){var o=i.name.value;if(r!=null&&r.getType(o)){e.reportError(new XI.GraphQLError('Type "'.concat(o,'" already exists in the schema. It cannot also be defined in this type definition.'),i.name));return}return t[o]?e.reportError(new XI.GraphQLError('There can be only one type named "'.concat(o,'".'),[t[o],i.name])):t[o]=i.name,!1}}});var Fh=y(Mh=>{"use strict";p();Object.defineProperty(Mh,"__esModule",{value:!0});Mh.UniqueEnumValueNamesRule=HB;var ZI=K(),KB=ie();function HB(e){var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{EnumTypeDefinition:i,EnumTypeExtension:i};function i(o){var s,a=o.name.value;n[a]||(n[a]=Object.create(null));for(var u=(s=o.values)!==null&&s!==void 0?s:[],c=n[a],l=0;l<u.length;l++){var d=u[l],f=d.name.value,h=r[a];(0,KB.isEnumType)(h)&&h.getValue(f)?e.reportError(new ZI.GraphQLError('Enum value "'.concat(a,".").concat(f,'" already exists in the schema. It cannot also be defined in this type extension.'),d.name)):c[f]?e.reportError(new ZI.GraphQLError('Enum value "'.concat(a,".").concat(f,'" can only be defined once.'),[c[f],d.name])):c[f]=d.name}return!1}}});var Vh=y(Uh=>{"use strict";p();Object.defineProperty(Uh,"__esModule",{value:!0});Uh.UniqueFieldDefinitionNamesRule=QB;var ew=K(),qh=ie();function QB(e){var t=e.getSchema(),r=t?t.getTypeMap():Object.create(null),n=Object.create(null);return{InputObjectTypeDefinition:i,InputObjectTypeExtension:i,InterfaceTypeDefinition:i,InterfaceTypeExtension:i,ObjectTypeDefinition:i,ObjectTypeExtension:i};function i(o){var s,a=o.name.value;n[a]||(n[a]=Object.create(null));for(var u=(s=o.fields)!==null&&s!==void 0?s:[],c=n[a],l=0;l<u.length;l++){var d=u[l],f=d.name.value;WB(r[a],f)?e.reportError(new ew.GraphQLError('Field "'.concat(a,".").concat(f,'" already exists in the schema. It cannot also be defined in this type extension.'),d.name)):c[f]?e.reportError(new ew.GraphQLError('Field "'.concat(a,".").concat(f,'" can only be defined once.'),[c[f],d.name])):c[f]=d.name}return!1}}function WB(e,t){return(0,qh.isObjectType)(e)||(0,qh.isInterfaceType)(e)||(0,qh.isInputObjectType)(e)?e.getFields()[t]!=null:!1}});var $h=y(Gh=>{"use strict";p();Object.defineProperty(Gh,"__esModule",{value:!0});Gh.UniqueDirectiveNamesRule=zB;var tw=K();function zB(e){var t=Object.create(null),r=e.getSchema();return{DirectiveDefinition:function(i){var o=i.name.value;if(r!=null&&r.getDirective(o)){e.reportError(new tw.GraphQLError('Directive "@'.concat(o,'" already exists in the schema. It cannot be redefined.'),i.name));return}return t[o]?e.reportError(new tw.GraphQLError('There can be only one directive named "@'.concat(o,'".'),[t[o],i.name])):t[o]=i.name,!1}}}});var Kh=y(Bh=>{"use strict";p();Object.defineProperty(Bh,"__esModule",{value:!0});Bh.PossibleTypeExtensionsRule=ZB;var nw=uc(se()),iw=uc(et()),YB=uc(Qr()),JB=uc(Wr()),rw=K(),Ae=Ee(),XB=qn(),Mi=ie(),rn;function uc(e){return e&&e.__esModule?e:{default:e}}function Fi(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZB(e){for(var t=e.getSchema(),r=Object.create(null),n=0,i=e.getDocument().definitions;n<i.length;n++){var o=i[n];(0,XB.isTypeDefinitionNode)(o)&&(r[o.name.value]=o)}return{ScalarTypeExtension:s,ObjectTypeExtension:s,InterfaceTypeExtension:s,UnionTypeExtension:s,EnumTypeExtension:s,InputObjectTypeExtension:s};function s(a){var u=a.name.value,c=r[u],l=t?.getType(u),d;if(c?d=eK[c.kind]:l&&(d=tK(l)),d){if(d!==a.kind){var f=rK(a.kind);e.reportError(new rw.GraphQLError("Cannot extend non-".concat(f,' type "').concat(u,'".'),c?[c,a]:a))}}else{var h=Object.keys(r);t&&(h=h.concat(Object.keys(t.getTypeMap())));var g=(0,JB.default)(u,h);e.reportError(new rw.GraphQLError('Cannot extend type "'.concat(u,'" because it is not defined.')+(0,YB.default)(g),a.name))}}}var eK=(rn={},Fi(rn,Ae.Kind.SCALAR_TYPE_DEFINITION,Ae.Kind.SCALAR_TYPE_EXTENSION),Fi(rn,Ae.Kind.OBJECT_TYPE_DEFINITION,Ae.Kind.OBJECT_TYPE_EXTENSION),Fi(rn,Ae.Kind.INTERFACE_TYPE_DEFINITION,Ae.Kind.INTERFACE_TYPE_EXTENSION),Fi(rn,Ae.Kind.UNION_TYPE_DEFINITION,Ae.Kind.UNION_TYPE_EXTENSION),Fi(rn,Ae.Kind.ENUM_TYPE_DEFINITION,Ae.Kind.ENUM_TYPE_EXTENSION),Fi(rn,Ae.Kind.INPUT_OBJECT_TYPE_DEFINITION,Ae.Kind.INPUT_OBJECT_TYPE_EXTENSION),rn);function tK(e){if((0,Mi.isScalarType)(e))return Ae.Kind.SCALAR_TYPE_EXTENSION;if((0,Mi.isObjectType)(e))return Ae.Kind.OBJECT_TYPE_EXTENSION;if((0,Mi.isInterfaceType)(e))return Ae.Kind.INTERFACE_TYPE_EXTENSION;if((0,Mi.isUnionType)(e))return Ae.Kind.UNION_TYPE_EXTENSION;if((0,Mi.isEnumType)(e))return Ae.Kind.ENUM_TYPE_EXTENSION;if((0,Mi.isInputObjectType)(e))return Ae.Kind.INPUT_OBJECT_TYPE_EXTENSION;(0,iw.default)(0,"Unexpected type: "+(0,nw.default)(e))}function rK(e){switch(e){case Ae.Kind.SCALAR_TYPE_EXTENSION:return"scalar";case Ae.Kind.OBJECT_TYPE_EXTENSION:return"object";case Ae.Kind.INTERFACE_TYPE_EXTENSION:return"interface";case Ae.Kind.UNION_TYPE_EXTENSION:return"union";case Ae.Kind.ENUM_TYPE_EXTENSION:return"enum";case Ae.Kind.INPUT_OBJECT_TYPE_EXTENSION:return"input object"}(0,iw.default)(0,"Unexpected kind: "+(0,nw.default)(e))}});var Hh=y(nn=>{"use strict";p();Object.defineProperty(nn,"__esModule",{value:!0});nn.specifiedSDLRules=nn.specifiedRules=nn.recommendedRules=void 0;var nK=wf(),iK=Af(),oK=Nf(),sK=Cf(),ow=Lf(),aK=jf(),uK=Ff(),cK=Uf(),lK=Gf(),pK=Bf(),dK=Hf(),fK=Wf(),hK=Jf(),mK=Zf(),gK=th(),yK=nh(),vK=oh(),sw=ah(),aw=lh(),uw=ph(),cw=fh(),EK=mh(),lw=yh(),_K=Eh(),bK=Oh(),pw=xh(),SK=Rh(),TK=Ph(),IK=Lh(),wK=jh(),OK=Fh(),AK=Vh(),xK=$h(),NK=Kh(),dw=Object.freeze([SK.MaxIntrospectionDepthRule]);nn.recommendedRules=dw;var RK=Object.freeze([nK.ExecutableDefinitionsRule,iK.UniqueOperationNamesRule,oK.LoneAnonymousOperationRule,sK.SingleFieldSubscriptionsRule,ow.KnownTypeNamesRule,aK.FragmentsOnCompositeTypesRule,uK.VariablesAreInputTypesRule,cK.ScalarLeafsRule,lK.FieldsOnCorrectTypeRule,pK.UniqueFragmentNamesRule,dK.KnownFragmentNamesRule,fK.NoUnusedFragmentsRule,hK.PossibleFragmentSpreadsRule,mK.NoFragmentCyclesRule,gK.UniqueVariableNamesRule,yK.NoUndefinedVariablesRule,vK.NoUnusedVariablesRule,sw.KnownDirectivesRule,aw.UniqueDirectivesPerLocationRule,uw.KnownArgumentNamesRule,cw.UniqueArgumentNamesRule,EK.ValuesOfCorrectTypeRule,lw.ProvidedRequiredArgumentsRule,_K.VariablesInAllowedPositionRule,bK.OverlappingFieldsCanBeMergedRule,pw.UniqueInputFieldNamesRule].concat(dw));nn.specifiedRules=RK;var CK=Object.freeze([TK.LoneSchemaDefinitionRule,IK.UniqueOperationTypesRule,wK.UniqueTypeNamesRule,OK.UniqueEnumValueNamesRule,AK.UniqueFieldDefinitionNamesRule,xK.UniqueDirectiveNamesRule,ow.KnownTypeNamesRule,sw.KnownDirectivesRule,aw.UniqueDirectivesPerLocationRule,NK.PossibleTypeExtensionsRule,uw.KnownArgumentNamesOnDirectivesRule,cw.UniqueArgumentNamesRule,pw.UniqueInputFieldNamesRule,lw.ProvidedRequiredArgumentsOnDirectivesRule]);nn.specifiedSDLRules=CK});var Wh=y(on=>{"use strict";p();Object.defineProperty(on,"__esModule",{value:!0});on.ValidationContext=on.SDLValidationContext=on.ASTValidationContext=void 0;var fw=Ee(),PK=Kr(),hw=Xu();function mw(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Qh=(function(){function e(r,n){this._ast=r,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}var t=e.prototype;return t.reportError=function(n){this._onError(n)},t.getDocument=function(){return this._ast},t.getFragment=function(n){var i=this._fragments;return i||(this._fragments=i=this.getDocument().definitions.reduce(function(o,s){return s.kind===fw.Kind.FRAGMENT_DEFINITION&&(o[s.name.value]=s),o},Object.create(null))),i[n]},t.getFragmentSpreads=function(n){var i=this._fragmentSpreads.get(n);if(!i){i=[];for(var o=[n];o.length!==0;)for(var s=o.pop(),a=0,u=s.selections;a<u.length;a++){var c=u[a];c.kind===fw.Kind.FRAGMENT_SPREAD?i.push(c):c.selectionSet&&o.push(c.selectionSet)}this._fragmentSpreads.set(n,i)}return i},t.getRecursivelyReferencedFragments=function(n){var i=this._recursivelyReferencedFragments.get(n);if(!i){i=[];for(var o=Object.create(null),s=[n.selectionSet];s.length!==0;)for(var a=s.pop(),u=0,c=this.getFragmentSpreads(a);u<c.length;u++){var l=c[u],d=l.name.value;if(o[d]!==!0){o[d]=!0;var f=this.getFragment(d);f&&(i.push(f),s.push(f.selectionSet))}}this._recursivelyReferencedFragments.set(n,i)}return i},e})();on.ASTValidationContext=Qh;var DK=(function(e){mw(t,e);function t(n,i,o){var s;return s=e.call(this,n,o)||this,s._schema=i,s}var r=t.prototype;return r.getSchema=function(){return this._schema},t})(Qh);on.SDLValidationContext=DK;var LK=(function(e){mw(t,e);function t(n,i,o,s){var a;return a=e.call(this,i,s)||this,a._schema=n,a._typeInfo=o,a._variableUsages=new Map,a._recursiveVariableUsages=new Map,a}var r=t.prototype;return r.getSchema=function(){return this._schema},r.getVariableUsages=function(i){var o=this._variableUsages.get(i);if(!o){var s=[],a=new hw.TypeInfo(this._schema);(0,PK.visit)(i,(0,hw.visitWithTypeInfo)(a,{VariableDefinition:function(){return!1},Variable:function(c){s.push({node:c,type:a.getInputType(),defaultValue:a.getDefaultValue()})}})),o=s,this._variableUsages.set(i,o)}return o},r.getRecursiveVariableUsages=function(i){var o=this._recursiveVariableUsages.get(i);if(!o){o=this.getVariableUsages(i);for(var s=0,a=this.getRecursivelyReferencedFragments(i);s<a.length;s++){var u=a[s];o=o.concat(this.getVariableUsages(u))}this._recursiveVariableUsages.set(i,o)}return o},r.getType=function(){return this._typeInfo.getType()},r.getParentType=function(){return this._typeInfo.getParentType()},r.getInputType=function(){return this._typeInfo.getInputType()},r.getParentInputType=function(){return this._typeInfo.getParentInputType()},r.getFieldDef=function(){return this._typeInfo.getFieldDef()},r.getDirective=function(){return this._typeInfo.getDirective()},r.getArgument=function(){return this._typeInfo.getArgument()},r.getEnumValue=function(){return this._typeInfo.getEnumValue()},t})(Qh);on.ValidationContext=LK});var Ui=y(qi=>{"use strict";p();Object.defineProperty(qi,"__esModule",{value:!0});qi.validate=qK;qi.validateSDL=zh;qi.assertValidSDL=UK;qi.assertValidSDLExtension=VK;var kK=FK(jt()),jK=K(),cc=Kr(),MK=fs(),gw=Xu(),yw=Hh(),vw=Wh();function FK(e){return e&&e.__esModule?e:{default:e}}function qK(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:yw.specifiedRules,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new gw.TypeInfo(e),i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{maxErrors:void 0};t||(0,kK.default)(0,"Must provide document."),(0,MK.assertValidSchema)(e);var o=Object.freeze({}),s=[],a=new vw.ValidationContext(e,t,n,function(c){if(i.maxErrors!=null&&s.length>=i.maxErrors)throw s.push(new jK.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),o;s.push(c)}),u=(0,cc.visitInParallel)(r.map(function(c){return c(a)}));try{(0,cc.visit)(t,(0,gw.visitWithTypeInfo)(n,u))}catch(c){if(c!==o)throw c}return s}function zh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:yw.specifiedSDLRules,n=[],i=new vw.SDLValidationContext(e,t,function(s){n.push(s)}),o=r.map(function(s){return s(i)});return(0,cc.visit)(e,(0,cc.visitInParallel)(o)),n}function UK(e){var t=zh(e);if(t.length!==0)throw new Error(t.map(function(r){return r.message}).join(`
|
|
76
76
|
|
|
77
|
-
`))}function
|
|
77
|
+
`))}function VK(e,t){var r=zh(e,t);if(r.length!==0)throw new Error(r.map(function(n){return n.message}).join(`
|
|
78
78
|
|
|
79
|
-
`))}});var hO=y(Qh=>{"use strict";p();Object.defineProperty(Qh,"__esModule",{value:!0});Qh.default=LK;function LK(e){var t;return function(n,i,o){t||(t=new WeakMap);var s=t.get(n),a;if(s){if(a=s.get(i),a){var u=a.get(o);if(u!==void 0)return u}}else s=new WeakMap,t.set(n,s);a||(a=new WeakMap,s.set(i,a));var c=e(n,i,o);return a.set(o,c),c}}});var mO=y(Wh=>{"use strict";p();Object.defineProperty(Wh,"__esModule",{value:!0});Wh.default=MK;var kK=jK(iu());function jK(e){return e&&e.__esModule?e:{default:e}}function MK(e,t,r){return e.reduce(function(n,i){return(0,kK.default)(n)?n.then(function(o){return t(o,i)}):t(n,i)},r)}});var gO=y(zh=>{"use strict";p();Object.defineProperty(zh,"__esModule",{value:!0});zh.default=FK;function FK(e){var t=Object.keys(e),r=t.map(function(n){return e[n]});return Promise.all(r).then(function(n){return n.reduce(function(i,o,s){return i[t[s]]=o,i},Object.create(null))})}});var ys=y(uc=>{"use strict";p();Object.defineProperty(uc,"__esModule",{value:!0});uc.addPath=qK;uc.pathToArray=UK;function qK(e,t,r){return{prev:e,key:t,typename:r}}function UK(e){for(var t=[],r=e;r;)t.push(r.key),r=r.prev;return t.reverse()}});var lc=y(Yh=>{"use strict";p();Object.defineProperty(Yh,"__esModule",{value:!0});Yh.getOperationRootType=VK;var cc=K();function VK(e,t){if(t.operation==="query"){var r=e.getQueryType();if(!r)throw new cc.GraphQLError("Schema does not define the required query root type.",t);return r}if(t.operation==="mutation"){var n=e.getMutationType();if(!n)throw new cc.GraphQLError("Schema is not configured for mutations.",t);return n}if(t.operation==="subscription"){var i=e.getSubscriptionType();if(!i)throw new cc.GraphQLError("Schema is not configured for subscriptions.",t);return i}throw new cc.GraphQLError("Can only have query, mutation and subscription operations.",t)}});var Xh=y(Jh=>{"use strict";p();Object.defineProperty(Jh,"__esModule",{value:!0});Jh.default=GK;function GK(e){return e.map(function(t){return typeof t=="number"?"["+t.toString()+"]":"."+t}).join("")}});var Es=y(Zh=>{"use strict";p();Object.defineProperty(Zh,"__esModule",{value:!0});Zh.valueFromAST=vs;var BK=pc(bt()),$K=pc(Hr()),KK=pc(se()),HK=pc(et()),Ui=Ee(),Vn=ie();function pc(e){return e&&e.__esModule?e:{default:e}}function vs(e,t,r){if(e){if(e.kind===Ui.Kind.VARIABLE){var n=e.name.value;if(r==null||r[n]===void 0)return;var i=r[n];return i===null&&(0,Vn.isNonNullType)(t)?void 0:i}if((0,Vn.isNonNullType)(t))return e.kind===Ui.Kind.NULL?void 0:vs(e,t.ofType,r);if(e.kind===Ui.Kind.NULL)return null;if((0,Vn.isListType)(t)){var o=t.ofType;if(e.kind===Ui.Kind.LIST){for(var s=[],a=0,u=e.values;a<u.length;a++){var c=u[a];if(yO(c,r)){if((0,Vn.isNonNullType)(o))return;s.push(null)}else{var l=vs(c,o,r);if(l===void 0)return;s.push(l)}}return s}var d=vs(e,o,r);return d===void 0?void 0:[d]}if((0,Vn.isInputObjectType)(t)){if(e.kind!==Ui.Kind.OBJECT)return;for(var f=Object.create(null),h=(0,$K.default)(e.fields,function(w){return w.name.value}),g=0,v=(0,BK.default)(t.getFields());g<v.length;g++){var _=v[g],S=h[_.name];if(!S||yO(S.value,r)){if(_.defaultValue!==void 0)f[_.name]=_.defaultValue;else if((0,Vn.isNonNullType)(_.type))return;continue}var b=vs(S.value,_.type,r);if(b===void 0)return;f[_.name]=b}return f}if((0,Vn.isLeafType)(t)){var A;try{A=t.parseLiteral(e,r)}catch{return}return A===void 0?void 0:A}(0,HK.default)(0,"Unexpected input type: "+(0,KK.default)(t))}}function yO(e,t){return e.kind===Ui.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var tm=y(em=>{"use strict";p();Object.defineProperty(em,"__esModule",{value:!0});em.coerceInputValue=rH;var QK=sn(bt()),dc=sn(se()),WK=sn(et()),zK=sn(Qr()),YK=sn(ar()),JK=sn(Vu()),XK=sn(Wr()),ZK=sn(Xh()),Ir=ys(),Gn=K(),_s=ie();function sn(e){return e&&e.__esModule?e:{default:e}}function vO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function eH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?vO(Object(r),!0).forEach(function(n){tH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):vO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rH(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nH;return bs(e,t,r)}function nH(e,t,r){var n="Invalid value "+(0,dc.default)(t);throw e.length>0&&(n+=' at "value'.concat((0,ZK.default)(e),'"')),r.message=n+": "+r.message,r}function bs(e,t,r,n){if((0,_s.isNonNullType)(t)){if(e!=null)return bs(e,t.ofType,r,n);r((0,Ir.pathToArray)(n),e,new Gn.GraphQLError('Expected non-nullable type "'.concat((0,dc.default)(t),'" not to be null.')));return}if(e==null)return null;if((0,_s.isListType)(t)){var i=t.ofType,o=(0,JK.default)(e,function(b,A){var w=(0,Ir.addPath)(n,A,void 0);return bs(b,i,r,w)});return o??[bs(e,i,r,n)]}if((0,_s.isInputObjectType)(t)){if(!(0,YK.default)(e)){r((0,Ir.pathToArray)(n),e,new Gn.GraphQLError('Expected type "'.concat(t.name,'" to be an object.')));return}for(var s=Object.create(null),a=t.getFields(),u=0,c=(0,QK.default)(a);u<c.length;u++){var l=c[u],d=e[l.name];if(d===void 0){if(l.defaultValue!==void 0)s[l.name]=l.defaultValue;else if((0,_s.isNonNullType)(l.type)){var f=(0,dc.default)(l.type);r((0,Ir.pathToArray)(n),e,new Gn.GraphQLError('Field "'.concat(l.name,'" of required type "').concat(f,'" was not provided.')))}continue}s[l.name]=bs(d,l.type,r,(0,Ir.addPath)(n,l.name,t.name))}for(var h=0,g=Object.keys(e);h<g.length;h++){var v=g[h];if(!a[v]){var _=(0,XK.default)(v,Object.keys(t.getFields()));r((0,Ir.pathToArray)(n),e,new Gn.GraphQLError('Field "'.concat(v,'" is not defined by type "').concat(t.name,'".')+(0,zK.default)(_)))}}return eH({},s)}if((0,_s.isLeafType)(t)){var S;try{S=t.parseValue(e)}catch(b){b instanceof Gn.GraphQLError?r((0,Ir.pathToArray)(n),e,b):r((0,Ir.pathToArray)(n),e,new Gn.GraphQLError('Expected type "'.concat(t.name,'". ')+b.message,void 0,void 0,void 0,void 0,b));return}return S===void 0&&r((0,Ir.pathToArray)(n),e,new Gn.GraphQLError('Expected type "'.concat(t.name,'".'))),S}(0,WK.default)(0,"Unexpected input type: "+(0,dc.default)(t))}});var Ts=y(Ss=>{"use strict";p();Object.defineProperty(Ss,"__esModule",{value:!0});Ss.getVariableValues=lH;Ss.getArgumentValues=IO;Ss.getDirectiveValues=dH;var iH=fc(wi()),oH=fc(Hr()),Vi=fc(se()),sH=fc(Xh()),Or=K(),EO=Ee(),bO=mt(),Gi=ie(),aH=dr(),SO=Es(),uH=tm();function fc(e){return e&&e.__esModule?e:{default:e}}function _O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function TO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_O(Object(r),!0).forEach(function(n){cH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_O(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lH(e,t,r,n){var i=[],o=n?.maxErrors;try{var s=pH(e,t,r,function(a){if(o!=null&&i.length>=o)throw new Or.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:s}}catch(a){i.push(a)}return{errors:i}}function pH(e,t,r,n){for(var i=Object.create(null),o=function(c){var l=t[c],d=l.variable.name.value,f=(0,aH.typeFromAST)(e,l.type);if(!(0,Gi.isInputType)(f)){var h=(0,bO.print)(l.type);return n(new Or.GraphQLError('Variable "$'.concat(d,'" expected value of type "').concat(h,'" which cannot be used as an input type.'),l.type)),"continue"}if(!OO(r,d)){if(l.defaultValue)i[d]=(0,SO.valueFromAST)(l.defaultValue,f);else if((0,Gi.isNonNullType)(f)){var g=(0,Vi.default)(f);n(new Or.GraphQLError('Variable "$'.concat(d,'" of required type "').concat(g,'" was not provided.'),l))}return"continue"}var v=r[d];if(v===null&&(0,Gi.isNonNullType)(f)){var _=(0,Vi.default)(f);return n(new Or.GraphQLError('Variable "$'.concat(d,'" of non-null type "').concat(_,'" must not be null.'),l)),"continue"}i[d]=(0,uH.coerceInputValue)(v,f,function(S,b,A){var w='Variable "$'.concat(d,'" got invalid value ')+(0,Vi.default)(b);S.length>0&&(w+=' at "'.concat(d).concat((0,sH.default)(S),'"')),n(new Or.GraphQLError(w+"; "+A.message,l,void 0,void 0,void 0,A.originalError))})},s=0;s<t.length;s++)var a=o(s);return TO({},i)}function IO(e,t,r){for(var n,i=Object.create(null),o=(n=t.arguments)!==null&&n!==void 0?n:[],s=(0,oH.default)(o,function(S){return S.name.value}),a=0,u=e.args;a<u.length;a++){var c=u[a],l=c.name,d=c.type,f=s[l];if(!f){if(c.defaultValue!==void 0)i[l]=c.defaultValue;else if((0,Gi.isNonNullType)(d))throw new Or.GraphQLError('Argument "'.concat(l,'" of required type "').concat((0,Vi.default)(d),'" ')+"was not provided.",t);continue}var h=f.value,g=h.kind===EO.Kind.NULL;if(h.kind===EO.Kind.VARIABLE){var v=h.name.value;if(r==null||!OO(r,v)){if(c.defaultValue!==void 0)i[l]=c.defaultValue;else if((0,Gi.isNonNullType)(d))throw new Or.GraphQLError('Argument "'.concat(l,'" of required type "').concat((0,Vi.default)(d),'" ')+'was provided the variable "$'.concat(v,'" which was not provided a runtime value.'),h);continue}g=r[v]==null}if(g&&(0,Gi.isNonNullType)(d))throw new Or.GraphQLError('Argument "'.concat(l,'" of non-null type "').concat((0,Vi.default)(d),'" ')+"must not be null.",h);var _=(0,SO.valueFromAST)(h,d,r);if(_===void 0)throw new Or.GraphQLError('Argument "'.concat(l,'" has invalid value ').concat((0,bO.print)(h),"."),h);i[l]=_}return TO({},i)}function dH(e,t,r){var n=t.directives&&(0,iH.default)(t.directives,function(i){return i.name.value===e.name});if(n)return IO(e,n,r)}function OO(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var As=y(Tt=>{"use strict";p();Object.defineProperty(Tt,"__esModule",{value:!0});Tt.execute=_H;Tt.executeSync=bH;Tt.assertValidExecutionArguments=LO;Tt.buildExecutionContext=kO;Tt.collectFields=Os;Tt.buildResolveInfo=FO;Tt.getFieldDef=VO;Tt.defaultFieldResolver=Tt.defaultTypeResolver=void 0;var $i=Ar(se()),fH=Ar(hO()),hH=Ar(et()),wO=Ar(jt()),Ut=Ar(iu()),om=Ar(ar()),mH=Ar(Vu()),gH=Ar(mO()),AO=Ar(gO()),Bn=ys(),hr=K(),hc=zo(),Is=Ee(),yH=ds(),Bi=qt(),xO=gt(),wr=ie(),vH=dr(),EH=lc(),mc=Ts();function Ar(e){return e&&e.__esModule?e:{default:e}}function _H(e,t,r,n,i,o,s,a){return arguments.length===1?nm(e):nm({schema:e,document:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a})}function bH(e){var t=nm(e);if((0,Ut.default)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function nm(e){var t=e.schema,r=e.document,n=e.rootValue,i=e.contextValue,o=e.variableValues,s=e.operationName,a=e.fieldResolver,u=e.typeResolver;LO(t,r,o);var c=kO(t,r,n,i,o,s,a,u);if(Array.isArray(c))return{errors:c};var l=SH(c,c.operation,n);return DO(c,l)}function DO(e,t){return(0,Ut.default)(t)?t.then(function(r){return DO(e,r)}):e.errors.length===0?{data:t}:{errors:e.errors,data:t}}function LO(e,t,r){t||(0,wO.default)(0,"Must provide document."),(0,yH.assertValidSchema)(e),r==null||(0,om.default)(r)||(0,wO.default)(0,"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 kO(e,t,r,n,i,o,s,a){for(var u,c,l,d=Object.create(null),f=0,h=t.definitions;f<h.length;f++){var g=h[f];switch(g.kind){case Is.Kind.OPERATION_DEFINITION:if(o==null){if(l!==void 0)return[new hr.GraphQLError("Must provide operation name if query contains multiple operations.")];l=g}else((u=g.name)===null||u===void 0?void 0:u.value)===o&&(l=g);break;case Is.Kind.FRAGMENT_DEFINITION:d[g.name.value]=g;break}}if(!l)return o!=null?[new hr.GraphQLError('Unknown operation named "'.concat(o,'".'))]:[new hr.GraphQLError("Must provide an operation.")];var v=(c=l.variableDefinitions)!==null&&c!==void 0?c:[],_=(0,mc.getVariableValues)(e,v,i??{},{maxErrors:50});return _.errors?_.errors:{schema:e,fragments:d,rootValue:r,contextValue:n,operation:l,variableValues:_.coerced,fieldResolver:s??UO,typeResolver:a??qO,errors:[]}}function SH(e,t,r){var n=(0,EH.getOperationRootType)(e.schema,t),i=Os(e,n,t.selectionSet,Object.create(null),Object.create(null)),o=void 0;try{var s=t.operation==="mutation"?TH(e,n,r,o,i):jO(e,n,r,o,i);return(0,Ut.default)(s)?s.then(void 0,function(a){return e.errors.push(a),Promise.resolve(null)}):s}catch(a){return e.errors.push(a),null}}function TH(e,t,r,n,i){return(0,gH.default)(Object.keys(i),function(o,s){var a=i[s],u=(0,Bn.addPath)(n,s,t.name),c=MO(e,t,r,a,u);return c===void 0?o:(0,Ut.default)(c)?c.then(function(l){return o[s]=l,o}):(o[s]=c,o)},Object.create(null))}function jO(e,t,r,n,i){var o=Object.create(null),s=!1;try{for(var a=0,u=Object.keys(i);a<u.length;a++){var c=u[a],l=i[c],d=(0,Bn.addPath)(n,c,t.name),f=MO(e,t,r,l,d);f!==void 0&&(o[c]=f,(0,Ut.default)(f)&&(s=!0))}}catch(h){if(s)return(0,AO.default)(o).finally(function(){throw h});throw h}return s?(0,AO.default)(o):o}function Os(e,t,r,n,i){for(var o=0,s=r.selections;o<s.length;o++){var a=s[o];switch(a.kind){case Is.Kind.FIELD:{if(!rm(e,a))continue;var u=IH(a);n[u]||(n[u]=[]),n[u].push(a);break}case Is.Kind.INLINE_FRAGMENT:{if(!rm(e,a)||!NO(e,a,t))continue;Os(e,t,a.selectionSet,n,i);break}case Is.Kind.FRAGMENT_SPREAD:{var c=a.name.value;if(i[c]||!rm(e,a))continue;i[c]=!0;var l=e.fragments[c];if(!l||!NO(e,l,t))continue;Os(e,t,l.selectionSet,n,i);break}}}return n}function rm(e,t){var r=(0,mc.getDirectiveValues)(xO.GraphQLSkipDirective,t,e.variableValues);if(r?.if===!0)return!1;var n=(0,mc.getDirectiveValues)(xO.GraphQLIncludeDirective,t,e.variableValues);return n?.if!==!1}function NO(e,t,r){var n=t.typeCondition;if(!n)return!0;var i=(0,vH.typeFromAST)(e.schema,n);return i===r?!0:(0,wr.isAbstractType)(i)?e.schema.isSubType(i,r):!1}function IH(e){return e.alias?e.alias.value:e.name.value}function MO(e,t,r,n,i){var o,s=n[0],a=s.name.value,u=VO(e.schema,t,a);if(u){var c=u.type,l=(o=u.resolve)!==null&&o!==void 0?o:e.fieldResolver,d=FO(e,u,n,t,i);try{var f=(0,mc.getArgumentValues)(u,n[0],e.variableValues),h=e.contextValue,g=l(r,f,h,d),v;return(0,Ut.default)(g)?v=g.then(function(S){return ws(e,c,n,d,i,S)}):v=ws(e,c,n,d,i,g),(0,Ut.default)(v)?v.then(void 0,function(S){var b=(0,hc.locatedError)(S,n,(0,Bn.pathToArray)(i));return gc(b,c,e)}):v}catch(S){var _=(0,hc.locatedError)(S,n,(0,Bn.pathToArray)(i));return gc(_,c,e)}}}function FO(e,t,r,n,i){return{fieldName:t.name,fieldNodes:r,returnType:t.type,parentType:n,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function gc(e,t,r){if((0,wr.isNonNullType)(t))throw e;return r.errors.push(e),null}function ws(e,t,r,n,i,o){if(o instanceof Error)throw o;if((0,wr.isNonNullType)(t)){var s=ws(e,t.ofType,r,n,i,o);if(s===null)throw new Error("Cannot return null for non-nullable field ".concat(n.parentType.name,".").concat(n.fieldName,"."));return s}if(o==null)return null;if((0,wr.isListType)(t))return OH(e,t,r,n,i,o);if((0,wr.isLeafType)(t))return wH(t,o);if((0,wr.isAbstractType)(t))return AH(e,t,r,n,i,o);if((0,wr.isObjectType)(t))return im(e,t,r,n,i,o);(0,hH.default)(0,"Cannot complete value of unexpected output type: "+(0,$i.default)(t))}function OH(e,t,r,n,i,o){var s=t.ofType,a=!1,u=(0,mH.default)(o,function(c,l){var d=(0,Bn.addPath)(i,l,void 0);try{var f;return(0,Ut.default)(c)?f=c.then(function(g){return ws(e,s,r,n,d,g)}):f=ws(e,s,r,n,d,c),(0,Ut.default)(f)?(a=!0,f.then(void 0,function(g){var v=(0,hc.locatedError)(g,r,(0,Bn.pathToArray)(d));return gc(v,s,e)})):f}catch(g){var h=(0,hc.locatedError)(g,r,(0,Bn.pathToArray)(d));return gc(h,s,e)}});if(u==null)throw new hr.GraphQLError('Expected Iterable, but did not find one for field "'.concat(n.parentType.name,".").concat(n.fieldName,'".'));return a?Promise.all(u):u}function wH(e,t){var r=e.serialize(t);if(r===void 0)throw new Error('Expected a value of type "'.concat((0,$i.default)(e),'" but ')+"received: ".concat((0,$i.default)(t)));return r}function AH(e,t,r,n,i,o){var s,a=(s=t.resolveType)!==null&&s!==void 0?s:e.typeResolver,u=e.contextValue,c=a(o,u,n,t);return(0,Ut.default)(c)?c.then(function(l){return im(e,RO(l,e,t,r,n,o),r,n,i,o)}):im(e,RO(c,e,t,r,n,o),r,n,i,o)}function RO(e,t,r,n,i,o){if(e==null)throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" must resolve to an Object type at runtime for field "').concat(i.parentType.name,".").concat(i.fieldName,'". Either the "').concat(r.name,'" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.'),n);var s=(0,wr.isNamedType)(e)?e.name:e;if(typeof s!="string")throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" must resolve to an Object type at runtime for field "').concat(i.parentType.name,".").concat(i.fieldName,'" with ')+"value ".concat((0,$i.default)(o),', received "').concat((0,$i.default)(e),'".'));var a=t.schema.getType(s);if(a==null)throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" was resolve to a type "').concat(s,'" that does not exist inside schema.'),n);if(!(0,wr.isObjectType)(a))throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" was resolve to a non-object type "').concat(s,'".'),n);if(!t.schema.isSubType(r,a))throw new hr.GraphQLError('Runtime Object type "'.concat(a.name,'" is not a possible type for "').concat(r.name,'".'),n);return a}function im(e,t,r,n,i,o){if(t.isTypeOf){var s=t.isTypeOf(o,e.contextValue,n);if((0,Ut.default)(s))return s.then(function(a){if(!a)throw CO(t,o,r);return PO(e,t,r,i,o)});if(!s)throw CO(t,o,r)}return PO(e,t,r,i,o)}function CO(e,t,r){return new hr.GraphQLError('Expected value of type "'.concat(e.name,'" but got: ').concat((0,$i.default)(t),"."),r)}function PO(e,t,r,n,i){var o=xH(e,t,r);return jO(e,t,i,n,o)}var xH=(0,fH.default)(NH);function NH(e,t,r){for(var n=Object.create(null),i=Object.create(null),o=0;o<r.length;o++){var s=r[o];s.selectionSet&&(n=Os(e,t,s.selectionSet,n,i))}return n}var qO=function(t,r,n,i){if((0,om.default)(t)&&typeof t.__typename=="string")return t.__typename;for(var o=n.schema.getPossibleTypes(i),s=[],a=0;a<o.length;a++){var u=o[a];if(u.isTypeOf){var c=u.isTypeOf(t,r,n);if((0,Ut.default)(c))s[a]=c;else if(c)return u.name}}if(s.length)return Promise.all(s).then(function(l){for(var d=0;d<l.length;d++)if(l[d])return o[d].name})};Tt.defaultTypeResolver=qO;var UO=function(t,r,n,i){if((0,om.default)(t)||typeof t=="function"){var o=t[i.fieldName];return typeof o=="function"?t[i.fieldName](r,n,i):o}};Tt.defaultFieldResolver=UO;function VO(e,t,r){return r===Bi.SchemaMetaFieldDef.name&&e.getQueryType()===t?Bi.SchemaMetaFieldDef:r===Bi.TypeMetaFieldDef.name&&e.getQueryType()===t?Bi.TypeMetaFieldDef:r===Bi.TypeNameMetaFieldDef.name?Bi.TypeNameMetaFieldDef:t.getFields()[r]}});var GO=y(vc=>{"use strict";p();Object.defineProperty(vc,"__esModule",{value:!0});vc.graphql=jH;vc.graphqlSync=MH;var RH=kH(iu()),CH=Ii(),PH=qi(),DH=ds(),LH=As();function kH(e){return e&&e.__esModule?e:{default:e}}function jH(e,t,r,n,i,o,s,a){var u=arguments;return new Promise(function(c){return c(u.length===1?yc(e):yc({schema:e,source:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a}))})}function MH(e,t,r,n,i,o,s,a){var u=arguments.length===1?yc(e):yc({schema:e,source:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a});if((0,RH.default)(u))throw new Error("GraphQL execution failed to complete synchronously.");return u}function yc(e){var t=e.schema,r=e.source,n=e.rootValue,i=e.contextValue,o=e.variableValues,s=e.operationName,a=e.fieldResolver,u=e.typeResolver,c=(0,DH.validateSchema)(t);if(c.length>0)return{errors:c};var l;try{l=(0,CH.parse)(r)}catch(f){return{errors:[f]}}var d=(0,PH.validate)(t,l);return d.length>0?{errors:d}:(0,LH.execute)({schema:t,document:l,rootValue:n,contextValue:i,variableValues:o,operationName:s,fieldResolver:a,typeResolver:u})}});var $O=y(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});Object.defineProperty(R,"isSchema",{enumerable:!0,get:function(){return sm.isSchema}});Object.defineProperty(R,"assertSchema",{enumerable:!0,get:function(){return sm.assertSchema}});Object.defineProperty(R,"GraphQLSchema",{enumerable:!0,get:function(){return sm.GraphQLSchema}});Object.defineProperty(R,"isType",{enumerable:!0,get:function(){return W.isType}});Object.defineProperty(R,"isScalarType",{enumerable:!0,get:function(){return W.isScalarType}});Object.defineProperty(R,"isObjectType",{enumerable:!0,get:function(){return W.isObjectType}});Object.defineProperty(R,"isInterfaceType",{enumerable:!0,get:function(){return W.isInterfaceType}});Object.defineProperty(R,"isUnionType",{enumerable:!0,get:function(){return W.isUnionType}});Object.defineProperty(R,"isEnumType",{enumerable:!0,get:function(){return W.isEnumType}});Object.defineProperty(R,"isInputObjectType",{enumerable:!0,get:function(){return W.isInputObjectType}});Object.defineProperty(R,"isListType",{enumerable:!0,get:function(){return W.isListType}});Object.defineProperty(R,"isNonNullType",{enumerable:!0,get:function(){return W.isNonNullType}});Object.defineProperty(R,"isInputType",{enumerable:!0,get:function(){return W.isInputType}});Object.defineProperty(R,"isOutputType",{enumerable:!0,get:function(){return W.isOutputType}});Object.defineProperty(R,"isLeafType",{enumerable:!0,get:function(){return W.isLeafType}});Object.defineProperty(R,"isCompositeType",{enumerable:!0,get:function(){return W.isCompositeType}});Object.defineProperty(R,"isAbstractType",{enumerable:!0,get:function(){return W.isAbstractType}});Object.defineProperty(R,"isWrappingType",{enumerable:!0,get:function(){return W.isWrappingType}});Object.defineProperty(R,"isNullableType",{enumerable:!0,get:function(){return W.isNullableType}});Object.defineProperty(R,"isNamedType",{enumerable:!0,get:function(){return W.isNamedType}});Object.defineProperty(R,"isRequiredArgument",{enumerable:!0,get:function(){return W.isRequiredArgument}});Object.defineProperty(R,"isRequiredInputField",{enumerable:!0,get:function(){return W.isRequiredInputField}});Object.defineProperty(R,"assertType",{enumerable:!0,get:function(){return W.assertType}});Object.defineProperty(R,"assertScalarType",{enumerable:!0,get:function(){return W.assertScalarType}});Object.defineProperty(R,"assertObjectType",{enumerable:!0,get:function(){return W.assertObjectType}});Object.defineProperty(R,"assertInterfaceType",{enumerable:!0,get:function(){return W.assertInterfaceType}});Object.defineProperty(R,"assertUnionType",{enumerable:!0,get:function(){return W.assertUnionType}});Object.defineProperty(R,"assertEnumType",{enumerable:!0,get:function(){return W.assertEnumType}});Object.defineProperty(R,"assertInputObjectType",{enumerable:!0,get:function(){return W.assertInputObjectType}});Object.defineProperty(R,"assertListType",{enumerable:!0,get:function(){return W.assertListType}});Object.defineProperty(R,"assertNonNullType",{enumerable:!0,get:function(){return W.assertNonNullType}});Object.defineProperty(R,"assertInputType",{enumerable:!0,get:function(){return W.assertInputType}});Object.defineProperty(R,"assertOutputType",{enumerable:!0,get:function(){return W.assertOutputType}});Object.defineProperty(R,"assertLeafType",{enumerable:!0,get:function(){return W.assertLeafType}});Object.defineProperty(R,"assertCompositeType",{enumerable:!0,get:function(){return W.assertCompositeType}});Object.defineProperty(R,"assertAbstractType",{enumerable:!0,get:function(){return W.assertAbstractType}});Object.defineProperty(R,"assertWrappingType",{enumerable:!0,get:function(){return W.assertWrappingType}});Object.defineProperty(R,"assertNullableType",{enumerable:!0,get:function(){return W.assertNullableType}});Object.defineProperty(R,"assertNamedType",{enumerable:!0,get:function(){return W.assertNamedType}});Object.defineProperty(R,"getNullableType",{enumerable:!0,get:function(){return W.getNullableType}});Object.defineProperty(R,"getNamedType",{enumerable:!0,get:function(){return W.getNamedType}});Object.defineProperty(R,"GraphQLScalarType",{enumerable:!0,get:function(){return W.GraphQLScalarType}});Object.defineProperty(R,"GraphQLObjectType",{enumerable:!0,get:function(){return W.GraphQLObjectType}});Object.defineProperty(R,"GraphQLInterfaceType",{enumerable:!0,get:function(){return W.GraphQLInterfaceType}});Object.defineProperty(R,"GraphQLUnionType",{enumerable:!0,get:function(){return W.GraphQLUnionType}});Object.defineProperty(R,"GraphQLEnumType",{enumerable:!0,get:function(){return W.GraphQLEnumType}});Object.defineProperty(R,"GraphQLInputObjectType",{enumerable:!0,get:function(){return W.GraphQLInputObjectType}});Object.defineProperty(R,"GraphQLList",{enumerable:!0,get:function(){return W.GraphQLList}});Object.defineProperty(R,"GraphQLNonNull",{enumerable:!0,get:function(){return W.GraphQLNonNull}});Object.defineProperty(R,"isDirective",{enumerable:!0,get:function(){return mr.isDirective}});Object.defineProperty(R,"assertDirective",{enumerable:!0,get:function(){return mr.assertDirective}});Object.defineProperty(R,"GraphQLDirective",{enumerable:!0,get:function(){return mr.GraphQLDirective}});Object.defineProperty(R,"isSpecifiedDirective",{enumerable:!0,get:function(){return mr.isSpecifiedDirective}});Object.defineProperty(R,"specifiedDirectives",{enumerable:!0,get:function(){return mr.specifiedDirectives}});Object.defineProperty(R,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return mr.GraphQLIncludeDirective}});Object.defineProperty(R,"GraphQLSkipDirective",{enumerable:!0,get:function(){return mr.GraphQLSkipDirective}});Object.defineProperty(R,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return mr.GraphQLDeprecatedDirective}});Object.defineProperty(R,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return mr.GraphQLSpecifiedByDirective}});Object.defineProperty(R,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return mr.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(R,"isSpecifiedScalarType",{enumerable:!0,get:function(){return $n.isSpecifiedScalarType}});Object.defineProperty(R,"specifiedScalarTypes",{enumerable:!0,get:function(){return $n.specifiedScalarTypes}});Object.defineProperty(R,"GraphQLInt",{enumerable:!0,get:function(){return $n.GraphQLInt}});Object.defineProperty(R,"GraphQLFloat",{enumerable:!0,get:function(){return $n.GraphQLFloat}});Object.defineProperty(R,"GraphQLString",{enumerable:!0,get:function(){return $n.GraphQLString}});Object.defineProperty(R,"GraphQLBoolean",{enumerable:!0,get:function(){return $n.GraphQLBoolean}});Object.defineProperty(R,"GraphQLID",{enumerable:!0,get:function(){return $n.GraphQLID}});Object.defineProperty(R,"isIntrospectionType",{enumerable:!0,get:function(){return vt.isIntrospectionType}});Object.defineProperty(R,"introspectionTypes",{enumerable:!0,get:function(){return vt.introspectionTypes}});Object.defineProperty(R,"__Schema",{enumerable:!0,get:function(){return vt.__Schema}});Object.defineProperty(R,"__Directive",{enumerable:!0,get:function(){return vt.__Directive}});Object.defineProperty(R,"__DirectiveLocation",{enumerable:!0,get:function(){return vt.__DirectiveLocation}});Object.defineProperty(R,"__Type",{enumerable:!0,get:function(){return vt.__Type}});Object.defineProperty(R,"__Field",{enumerable:!0,get:function(){return vt.__Field}});Object.defineProperty(R,"__InputValue",{enumerable:!0,get:function(){return vt.__InputValue}});Object.defineProperty(R,"__EnumValue",{enumerable:!0,get:function(){return vt.__EnumValue}});Object.defineProperty(R,"__TypeKind",{enumerable:!0,get:function(){return vt.__TypeKind}});Object.defineProperty(R,"TypeKind",{enumerable:!0,get:function(){return vt.TypeKind}});Object.defineProperty(R,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return vt.SchemaMetaFieldDef}});Object.defineProperty(R,"TypeMetaFieldDef",{enumerable:!0,get:function(){return vt.TypeMetaFieldDef}});Object.defineProperty(R,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return vt.TypeNameMetaFieldDef}});Object.defineProperty(R,"validateSchema",{enumerable:!0,get:function(){return BO.validateSchema}});Object.defineProperty(R,"assertValidSchema",{enumerable:!0,get:function(){return BO.assertValidSchema}});var sm=jn(),W=ie(),mr=gt(),$n=pr(),vt=qt(),BO=ds()});var QO=y(ve=>{"use strict";p();Object.defineProperty(ve,"__esModule",{value:!0});Object.defineProperty(ve,"Source",{enumerable:!0,get:function(){return FH.Source}});Object.defineProperty(ve,"getLocation",{enumerable:!0,get:function(){return qH.getLocation}});Object.defineProperty(ve,"printLocation",{enumerable:!0,get:function(){return KO.printLocation}});Object.defineProperty(ve,"printSourceLocation",{enumerable:!0,get:function(){return KO.printSourceLocation}});Object.defineProperty(ve,"Kind",{enumerable:!0,get:function(){return UH.Kind}});Object.defineProperty(ve,"TokenKind",{enumerable:!0,get:function(){return VH.TokenKind}});Object.defineProperty(ve,"Lexer",{enumerable:!0,get:function(){return GH.Lexer}});Object.defineProperty(ve,"parse",{enumerable:!0,get:function(){return am.parse}});Object.defineProperty(ve,"parseValue",{enumerable:!0,get:function(){return am.parseValue}});Object.defineProperty(ve,"parseType",{enumerable:!0,get:function(){return am.parseType}});Object.defineProperty(ve,"print",{enumerable:!0,get:function(){return BH.print}});Object.defineProperty(ve,"visit",{enumerable:!0,get:function(){return Ec.visit}});Object.defineProperty(ve,"visitInParallel",{enumerable:!0,get:function(){return Ec.visitInParallel}});Object.defineProperty(ve,"getVisitFn",{enumerable:!0,get:function(){return Ec.getVisitFn}});Object.defineProperty(ve,"BREAK",{enumerable:!0,get:function(){return Ec.BREAK}});Object.defineProperty(ve,"Location",{enumerable:!0,get:function(){return HO.Location}});Object.defineProperty(ve,"Token",{enumerable:!0,get:function(){return HO.Token}});Object.defineProperty(ve,"isDefinitionNode",{enumerable:!0,get:function(){return xr.isDefinitionNode}});Object.defineProperty(ve,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return xr.isExecutableDefinitionNode}});Object.defineProperty(ve,"isSelectionNode",{enumerable:!0,get:function(){return xr.isSelectionNode}});Object.defineProperty(ve,"isValueNode",{enumerable:!0,get:function(){return xr.isValueNode}});Object.defineProperty(ve,"isTypeNode",{enumerable:!0,get:function(){return xr.isTypeNode}});Object.defineProperty(ve,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return xr.isTypeSystemDefinitionNode}});Object.defineProperty(ve,"isTypeDefinitionNode",{enumerable:!0,get:function(){return xr.isTypeDefinitionNode}});Object.defineProperty(ve,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return xr.isTypeSystemExtensionNode}});Object.defineProperty(ve,"isTypeExtensionNode",{enumerable:!0,get:function(){return xr.isTypeExtensionNode}});Object.defineProperty(ve,"DirectiveLocation",{enumerable:!0,get:function(){return $H.DirectiveLocation}});var FH=_u(),qH=su(),KO=pd(),UH=Ee(),VH=bi(),GH=Tu(),am=Ii(),BH=mt(),Ec=Kr(),HO=_i(),xr=Fn(),$H=Si()});var WO=y(an=>{"use strict";p();Object.defineProperty(an,"__esModule",{value:!0});Object.defineProperty(an,"responsePathAsArray",{enumerable:!0,get:function(){return KH.pathToArray}});Object.defineProperty(an,"execute",{enumerable:!0,get:function(){return _c.execute}});Object.defineProperty(an,"executeSync",{enumerable:!0,get:function(){return _c.executeSync}});Object.defineProperty(an,"defaultFieldResolver",{enumerable:!0,get:function(){return _c.defaultFieldResolver}});Object.defineProperty(an,"defaultTypeResolver",{enumerable:!0,get:function(){return _c.defaultTypeResolver}});Object.defineProperty(an,"getDirectiveValues",{enumerable:!0,get:function(){return HH.getDirectiveValues}});var KH=ys(),_c=As(),HH=Ts()});var zO=y(um=>{"use strict";p();Object.defineProperty(um,"__esModule",{value:!0});um.default=WH;var QH=ur();function WH(e){return typeof e?.[QH.SYMBOL_ASYNC_ITERATOR]=="function"}});var ZO=y(cm=>{"use strict";p();Object.defineProperty(cm,"__esModule",{value:!0});cm.default=YH;var YO=ur();function zH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YH(e,t,r){var n=e[YO.SYMBOL_ASYNC_ITERATOR],i=n.call(e),o,s;typeof i.return=="function"&&(o=i.return,s=function(d){var f=function(){return Promise.reject(d)};return o.call(i).then(f,f)});function a(l){return l.done?l:JO(l.value,t).then(XO,s)}var u;if(r){var c=r;u=function(d){return JO(d,c).then(XO,s)}}return zH({next:function(){return i.next().then(a,u)},return:function(){return o?o.call(i).then(a,u):Promise.resolve({value:void 0,done:!0})},throw:function(d){return typeof i.throw=="function"?i.throw(d).then(a,u):Promise.reject(d).catch(s)}},YO.SYMBOL_ASYNC_ITERATOR,function(){return this})}function JO(e,t){return new Promise(function(r){return r(t(e))})}function XO(e){return{value:e,done:!1}}});var sw=y(bc=>{"use strict";p();Object.defineProperty(bc,"__esModule",{value:!0});bc.subscribe=tQ;bc.createSourceEventStream=ow;var JH=pm(se()),rw=pm(zO()),lm=ys(),nw=K(),ew=zo(),XH=Ts(),Ki=As(),ZH=lc(),eQ=pm(ZO());function pm(e){return e&&e.__esModule?e:{default:e}}function tQ(e,t,r,n,i,o,s,a){return arguments.length===1?tw(e):tw({schema:e,document:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,subscribeFieldResolver:a})}function iw(e){if(e instanceof nw.GraphQLError)return{errors:[e]};throw e}function tw(e){var t=e.schema,r=e.document,n=e.rootValue,i=e.contextValue,o=e.variableValues,s=e.operationName,a=e.fieldResolver,u=e.subscribeFieldResolver,c=ow(t,r,n,i,o,s,u),l=function(f){return(0,Ki.execute)({schema:t,document:r,rootValue:f,contextValue:i,variableValues:o,operationName:s,fieldResolver:a})};return c.then(function(d){return(0,rw.default)(d)?(0,eQ.default)(d,l,iw):d})}function ow(e,t,r,n,i,o,s){return(0,Ki.assertValidExecutionArguments)(e,t,i),new Promise(function(a){var u=(0,Ki.buildExecutionContext)(e,t,r,n,i,o,s);a(Array.isArray(u)?{errors:u}:rQ(u))}).catch(iw)}function rQ(e){var t=e.schema,r=e.operation,n=e.variableValues,i=e.rootValue,o=(0,ZH.getOperationRootType)(t,r),s=(0,Ki.collectFields)(e,o,r.selectionSet,Object.create(null),Object.create(null)),a=Object.keys(s),u=a[0],c=s[u],l=c[0],d=l.name.value,f=(0,Ki.getFieldDef)(t,o,d);if(!f)throw new nw.GraphQLError('The subscription field "'.concat(d,'" is not defined.'),c);var h=(0,lm.addPath)(void 0,u,o.name),g=(0,Ki.buildResolveInfo)(e,f,c,o,h);return new Promise(function(v){var _,S=(0,XH.getArgumentValues)(f,c[0],n),b=e.contextValue,A=(_=f.subscribe)!==null&&_!==void 0?_:e.fieldResolver;v(A(i,S,b,g))}).then(function(v){if(v instanceof Error)throw(0,ew.locatedError)(v,c,(0,lm.pathToArray)(h));if(!(0,rw.default)(v))throw new Error("Subscription field must return Async Iterable. "+"Received: ".concat((0,JH.default)(v),"."));return v},function(v){throw(0,ew.locatedError)(v,c,(0,lm.pathToArray)(h))})}});var uw=y(Sc=>{"use strict";p();Object.defineProperty(Sc,"__esModule",{value:!0});Object.defineProperty(Sc,"subscribe",{enumerable:!0,get:function(){return aw.subscribe}});Object.defineProperty(Sc,"createSourceEventStream",{enumerable:!0,get:function(){return aw.createSourceEventStream}});var aw=sw()});var mm=y(hm=>{"use strict";p();Object.defineProperty(hm,"__esModule",{value:!0});hm.NoDeprecatedCustomRule=iQ;var dm=nQ(et()),xs=K(),fm=ie();function nQ(e){return e&&e.__esModule?e:{default:e}}function iQ(e){return{Field:function(r){var n=e.getFieldDef(),i=n?.deprecationReason;if(n&&i!=null){var o=e.getParentType();o!=null||(0,dm.default)(0),e.reportError(new xs.GraphQLError("The field ".concat(o.name,".").concat(n.name," is deprecated. ").concat(i),r))}},Argument:function(r){var n=e.getArgument(),i=n?.deprecationReason;if(n&&i!=null){var o=e.getDirective();if(o!=null)e.reportError(new xs.GraphQLError('Directive "@'.concat(o.name,'" argument "').concat(n.name,'" is deprecated. ').concat(i),r));else{var s=e.getParentType(),a=e.getFieldDef();s!=null&&a!=null||(0,dm.default)(0),e.reportError(new xs.GraphQLError('Field "'.concat(s.name,".").concat(a.name,'" argument "').concat(n.name,'" is deprecated. ').concat(i),r))}}},ObjectField:function(r){var n=(0,fm.getNamedType)(e.getParentInputType());if((0,fm.isInputObjectType)(n)){var i=n.getFields()[r.name.value],o=i?.deprecationReason;o!=null&&e.reportError(new xs.GraphQLError("The input field ".concat(n.name,".").concat(i.name," is deprecated. ").concat(o),r))}},EnumValue:function(r){var n=e.getEnumValue(),i=n?.deprecationReason;if(n&&i!=null){var o=(0,fm.getNamedType)(e.getInputType());o!=null||(0,dm.default)(0),e.reportError(new xs.GraphQLError('The enum value "'.concat(o.name,".").concat(n.name,'" is deprecated. ').concat(i),r))}}}}});var cw=y(gm=>{"use strict";p();Object.defineProperty(gm,"__esModule",{value:!0});gm.NoSchemaIntrospectionCustomRule=uQ;var oQ=K(),sQ=ie(),aQ=qt();function uQ(e){return{Field:function(r){var n=(0,sQ.getNamedType)(e.getType());n&&(0,aQ.isIntrospectionType)(n)&&e.reportError(new oQ.GraphQLError('GraphQL introspection has been disabled, but the requested query contained the field "'.concat(r.name.value,'".'),r))}}}});var pw=y(Y=>{"use strict";p();Object.defineProperty(Y,"__esModule",{value:!0});Object.defineProperty(Y,"validate",{enumerable:!0,get:function(){return cQ.validate}});Object.defineProperty(Y,"ValidationContext",{enumerable:!0,get:function(){return lQ.ValidationContext}});Object.defineProperty(Y,"specifiedRules",{enumerable:!0,get:function(){return lw.specifiedRules}});Object.defineProperty(Y,"recommendedRules",{enumerable:!0,get:function(){return lw.recommendedRules}});Object.defineProperty(Y,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return pQ.ExecutableDefinitionsRule}});Object.defineProperty(Y,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return dQ.FieldsOnCorrectTypeRule}});Object.defineProperty(Y,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return fQ.FragmentsOnCompositeTypesRule}});Object.defineProperty(Y,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return hQ.KnownArgumentNamesRule}});Object.defineProperty(Y,"KnownDirectivesRule",{enumerable:!0,get:function(){return mQ.KnownDirectivesRule}});Object.defineProperty(Y,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return gQ.KnownFragmentNamesRule}});Object.defineProperty(Y,"KnownTypeNamesRule",{enumerable:!0,get:function(){return yQ.KnownTypeNamesRule}});Object.defineProperty(Y,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return vQ.LoneAnonymousOperationRule}});Object.defineProperty(Y,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return EQ.NoFragmentCyclesRule}});Object.defineProperty(Y,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return _Q.NoUndefinedVariablesRule}});Object.defineProperty(Y,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return bQ.NoUnusedFragmentsRule}});Object.defineProperty(Y,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return SQ.NoUnusedVariablesRule}});Object.defineProperty(Y,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return TQ.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(Y,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return IQ.PossibleFragmentSpreadsRule}});Object.defineProperty(Y,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return OQ.ProvidedRequiredArgumentsRule}});Object.defineProperty(Y,"ScalarLeafsRule",{enumerable:!0,get:function(){return wQ.ScalarLeafsRule}});Object.defineProperty(Y,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return AQ.SingleFieldSubscriptionsRule}});Object.defineProperty(Y,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return xQ.UniqueArgumentNamesRule}});Object.defineProperty(Y,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return NQ.UniqueDirectivesPerLocationRule}});Object.defineProperty(Y,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return RQ.UniqueFragmentNamesRule}});Object.defineProperty(Y,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return CQ.UniqueInputFieldNamesRule}});Object.defineProperty(Y,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return PQ.UniqueOperationNamesRule}});Object.defineProperty(Y,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return DQ.UniqueVariableNamesRule}});Object.defineProperty(Y,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return LQ.ValuesOfCorrectTypeRule}});Object.defineProperty(Y,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return kQ.VariablesAreInputTypesRule}});Object.defineProperty(Y,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return jQ.VariablesInAllowedPositionRule}});Object.defineProperty(Y,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return MQ.MaxIntrospectionDepthRule}});Object.defineProperty(Y,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return FQ.LoneSchemaDefinitionRule}});Object.defineProperty(Y,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return qQ.UniqueOperationTypesRule}});Object.defineProperty(Y,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return UQ.UniqueTypeNamesRule}});Object.defineProperty(Y,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return VQ.UniqueEnumValueNamesRule}});Object.defineProperty(Y,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return GQ.UniqueFieldDefinitionNamesRule}});Object.defineProperty(Y,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return BQ.UniqueDirectiveNamesRule}});Object.defineProperty(Y,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return $Q.PossibleTypeExtensionsRule}});Object.defineProperty(Y,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return KQ.NoDeprecatedCustomRule}});Object.defineProperty(Y,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return HQ.NoSchemaIntrospectionCustomRule}});var cQ=qi(),lQ=Kh(),lw=Bh(),pQ=Sf(),dQ=qf(),fQ=Df(),hQ=uh(),mQ=ih(),gQ=Bf(),yQ=Cf(),vQ=wf(),EQ=Yf(),_Q=eh(),bQ=Kf(),SQ=rh(),TQ=Th(),IQ=Wf(),OQ=hh(),wQ=Mf(),AQ=xf(),xQ=lh(),NQ=ah(),RQ=Vf(),CQ=Oh(),PQ=If(),DQ=Xf(),LQ=dh(),kQ=kf(),jQ=gh(),MQ=Ah(),FQ=Nh(),qQ=Ch(),UQ=Dh(),VQ=kh(),GQ=Fh(),BQ=Uh(),$Q=Gh(),KQ=mm(),HQ=cw()});var dw=y(ym=>{"use strict";p();Object.defineProperty(ym,"__esModule",{value:!0});Object.defineProperty(ym,"formatError",{enumerable:!0,get:function(){return QQ.formatError}});var QQ=K()});var hw=y(Kn=>{"use strict";p();Object.defineProperty(Kn,"__esModule",{value:!0});Object.defineProperty(Kn,"GraphQLError",{enumerable:!0,get:function(){return fw.GraphQLError}});Object.defineProperty(Kn,"printError",{enumerable:!0,get:function(){return fw.printError}});Object.defineProperty(Kn,"syntaxError",{enumerable:!0,get:function(){return WQ.syntaxError}});Object.defineProperty(Kn,"locatedError",{enumerable:!0,get:function(){return zQ.locatedError}});Object.defineProperty(Kn,"formatError",{enumerable:!0,get:function(){return YQ.formatError}});var fw=K(),WQ=pu(),zQ=zo(),YQ=dw()});var Em=y(vm=>{"use strict";p();Object.defineProperty(vm,"__esModule",{value:!0});vm.getIntrospectionQuery=ZQ;function mw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function JQ(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mw(Object(r),!0).forEach(function(n){XQ(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function XQ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ZQ(e){var t=JQ({descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1},e),r=t.descriptions?"description":"",n=t.specifiedByUrl?"specifiedByUrl":"",i=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?r:"";function s(a){return t.inputValueDeprecation?a:""}return`
|
|
79
|
+
`))}});var Ew=y(Yh=>{"use strict";p();Object.defineProperty(Yh,"__esModule",{value:!0});Yh.default=GK;function GK(e){var t;return function(n,i,o){t||(t=new WeakMap);var s=t.get(n),a;if(s){if(a=s.get(i),a){var u=a.get(o);if(u!==void 0)return u}}else s=new WeakMap,t.set(n,s);a||(a=new WeakMap,s.set(i,a));var c=e(n,i,o);return a.set(o,c),c}}});var _w=y(Jh=>{"use strict";p();Object.defineProperty(Jh,"__esModule",{value:!0});Jh.default=KK;var $K=BK(su());function BK(e){return e&&e.__esModule?e:{default:e}}function KK(e,t,r){return e.reduce(function(n,i){return(0,$K.default)(n)?n.then(function(o){return t(o,i)}):t(n,i)},r)}});var bw=y(Xh=>{"use strict";p();Object.defineProperty(Xh,"__esModule",{value:!0});Xh.default=HK;function HK(e){var t=Object.keys(e),r=t.map(function(n){return e[n]});return Promise.all(r).then(function(n){return n.reduce(function(i,o,s){return i[t[s]]=o,i},Object.create(null))})}});var vs=y(lc=>{"use strict";p();Object.defineProperty(lc,"__esModule",{value:!0});lc.addPath=QK;lc.pathToArray=WK;function QK(e,t,r){return{prev:e,key:t,typename:r}}function WK(e){for(var t=[],r=e;r;)t.push(r.key),r=r.prev;return t.reverse()}});var dc=y(Zh=>{"use strict";p();Object.defineProperty(Zh,"__esModule",{value:!0});Zh.getOperationRootType=zK;var pc=K();function zK(e,t){if(t.operation==="query"){var r=e.getQueryType();if(!r)throw new pc.GraphQLError("Schema does not define the required query root type.",t);return r}if(t.operation==="mutation"){var n=e.getMutationType();if(!n)throw new pc.GraphQLError("Schema is not configured for mutations.",t);return n}if(t.operation==="subscription"){var i=e.getSubscriptionType();if(!i)throw new pc.GraphQLError("Schema is not configured for subscriptions.",t);return i}throw new pc.GraphQLError("Can only have query, mutation and subscription operations.",t)}});var tm=y(em=>{"use strict";p();Object.defineProperty(em,"__esModule",{value:!0});em.default=YK;function YK(e){return e.map(function(t){return typeof t=="number"?"["+t.toString()+"]":"."+t}).join("")}});var _s=y(rm=>{"use strict";p();Object.defineProperty(rm,"__esModule",{value:!0});rm.valueFromAST=Es;var JK=fc(bt()),XK=fc(Hr()),ZK=fc(se()),eH=fc(et()),Vi=Ee(),Gn=ie();function fc(e){return e&&e.__esModule?e:{default:e}}function Es(e,t,r){if(e){if(e.kind===Vi.Kind.VARIABLE){var n=e.name.value;if(r==null||r[n]===void 0)return;var i=r[n];return i===null&&(0,Gn.isNonNullType)(t)?void 0:i}if((0,Gn.isNonNullType)(t))return e.kind===Vi.Kind.NULL?void 0:Es(e,t.ofType,r);if(e.kind===Vi.Kind.NULL)return null;if((0,Gn.isListType)(t)){var o=t.ofType;if(e.kind===Vi.Kind.LIST){for(var s=[],a=0,u=e.values;a<u.length;a++){var c=u[a];if(Sw(c,r)){if((0,Gn.isNonNullType)(o))return;s.push(null)}else{var l=Es(c,o,r);if(l===void 0)return;s.push(l)}}return s}var d=Es(e,o,r);return d===void 0?void 0:[d]}if((0,Gn.isInputObjectType)(t)){if(e.kind!==Vi.Kind.OBJECT)return;for(var f=Object.create(null),h=(0,XK.default)(e.fields,function(O){return O.name.value}),g=0,v=(0,JK.default)(t.getFields());g<v.length;g++){var _=v[g],S=h[_.name];if(!S||Sw(S.value,r)){if(_.defaultValue!==void 0)f[_.name]=_.defaultValue;else if((0,Gn.isNonNullType)(_.type))return;continue}var b=Es(S.value,_.type,r);if(b===void 0)return;f[_.name]=b}return f}if((0,Gn.isLeafType)(t)){var A;try{A=t.parseLiteral(e,r)}catch{return}return A===void 0?void 0:A}(0,eH.default)(0,"Unexpected input type: "+(0,ZK.default)(t))}}function Sw(e,t){return e.kind===Vi.Kind.VARIABLE&&(t==null||t[e.name.value]===void 0)}});var im=y(nm=>{"use strict";p();Object.defineProperty(nm,"__esModule",{value:!0});nm.coerceInputValue=lH;var tH=sn(bt()),hc=sn(se()),rH=sn(et()),nH=sn(Qr()),iH=sn(ar()),oH=sn($u()),sH=sn(Wr()),aH=sn(tm()),Ir=vs(),$n=K(),bs=ie();function sn(e){return e&&e.__esModule?e:{default:e}}function Tw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function uH(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Tw(Object(r),!0).forEach(function(n){cH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function cH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lH(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:pH;return Ss(e,t,r)}function pH(e,t,r){var n="Invalid value "+(0,hc.default)(t);throw e.length>0&&(n+=' at "value'.concat((0,aH.default)(e),'"')),r.message=n+": "+r.message,r}function Ss(e,t,r,n){if((0,bs.isNonNullType)(t)){if(e!=null)return Ss(e,t.ofType,r,n);r((0,Ir.pathToArray)(n),e,new $n.GraphQLError('Expected non-nullable type "'.concat((0,hc.default)(t),'" not to be null.')));return}if(e==null)return null;if((0,bs.isListType)(t)){var i=t.ofType,o=(0,oH.default)(e,function(b,A){var O=(0,Ir.addPath)(n,A,void 0);return Ss(b,i,r,O)});return o??[Ss(e,i,r,n)]}if((0,bs.isInputObjectType)(t)){if(!(0,iH.default)(e)){r((0,Ir.pathToArray)(n),e,new $n.GraphQLError('Expected type "'.concat(t.name,'" to be an object.')));return}for(var s=Object.create(null),a=t.getFields(),u=0,c=(0,tH.default)(a);u<c.length;u++){var l=c[u],d=e[l.name];if(d===void 0){if(l.defaultValue!==void 0)s[l.name]=l.defaultValue;else if((0,bs.isNonNullType)(l.type)){var f=(0,hc.default)(l.type);r((0,Ir.pathToArray)(n),e,new $n.GraphQLError('Field "'.concat(l.name,'" of required type "').concat(f,'" was not provided.')))}continue}s[l.name]=Ss(d,l.type,r,(0,Ir.addPath)(n,l.name,t.name))}for(var h=0,g=Object.keys(e);h<g.length;h++){var v=g[h];if(!a[v]){var _=(0,sH.default)(v,Object.keys(t.getFields()));r((0,Ir.pathToArray)(n),e,new $n.GraphQLError('Field "'.concat(v,'" is not defined by type "').concat(t.name,'".')+(0,nH.default)(_)))}}return uH({},s)}if((0,bs.isLeafType)(t)){var S;try{S=t.parseValue(e)}catch(b){b instanceof $n.GraphQLError?r((0,Ir.pathToArray)(n),e,b):r((0,Ir.pathToArray)(n),e,new $n.GraphQLError('Expected type "'.concat(t.name,'". ')+b.message,void 0,void 0,void 0,void 0,b));return}return S===void 0&&r((0,Ir.pathToArray)(n),e,new $n.GraphQLError('Expected type "'.concat(t.name,'".'))),S}(0,rH.default)(0,"Unexpected input type: "+(0,hc.default)(t))}});var Is=y(Ts=>{"use strict";p();Object.defineProperty(Ts,"__esModule",{value:!0});Ts.getVariableValues=vH;Ts.getArgumentValues=Nw;Ts.getDirectiveValues=_H;var dH=mc(Ai()),fH=mc(Hr()),Gi=mc(se()),hH=mc(tm()),wr=K(),Iw=Ee(),Ow=mt(),$i=ie(),mH=dr(),Aw=_s(),gH=im();function mc(e){return e&&e.__esModule?e:{default:e}}function ww(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xw(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ww(Object(r),!0).forEach(function(n){yH(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ww(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function yH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vH(e,t,r,n){var i=[],o=n?.maxErrors;try{var s=EH(e,t,r,function(a){if(o!=null&&i.length>=o)throw new wr.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");i.push(a)});if(i.length===0)return{coerced:s}}catch(a){i.push(a)}return{errors:i}}function EH(e,t,r,n){for(var i=Object.create(null),o=function(c){var l=t[c],d=l.variable.name.value,f=(0,mH.typeFromAST)(e,l.type);if(!(0,$i.isInputType)(f)){var h=(0,Ow.print)(l.type);return n(new wr.GraphQLError('Variable "$'.concat(d,'" expected value of type "').concat(h,'" which cannot be used as an input type.'),l.type)),"continue"}if(!Rw(r,d)){if(l.defaultValue)i[d]=(0,Aw.valueFromAST)(l.defaultValue,f);else if((0,$i.isNonNullType)(f)){var g=(0,Gi.default)(f);n(new wr.GraphQLError('Variable "$'.concat(d,'" of required type "').concat(g,'" was not provided.'),l))}return"continue"}var v=r[d];if(v===null&&(0,$i.isNonNullType)(f)){var _=(0,Gi.default)(f);return n(new wr.GraphQLError('Variable "$'.concat(d,'" of non-null type "').concat(_,'" must not be null.'),l)),"continue"}i[d]=(0,gH.coerceInputValue)(v,f,function(S,b,A){var O='Variable "$'.concat(d,'" got invalid value ')+(0,Gi.default)(b);S.length>0&&(O+=' at "'.concat(d).concat((0,hH.default)(S),'"')),n(new wr.GraphQLError(O+"; "+A.message,l,void 0,void 0,void 0,A.originalError))})},s=0;s<t.length;s++)var a=o(s);return xw({},i)}function Nw(e,t,r){for(var n,i=Object.create(null),o=(n=t.arguments)!==null&&n!==void 0?n:[],s=(0,fH.default)(o,function(S){return S.name.value}),a=0,u=e.args;a<u.length;a++){var c=u[a],l=c.name,d=c.type,f=s[l];if(!f){if(c.defaultValue!==void 0)i[l]=c.defaultValue;else if((0,$i.isNonNullType)(d))throw new wr.GraphQLError('Argument "'.concat(l,'" of required type "').concat((0,Gi.default)(d),'" ')+"was not provided.",t);continue}var h=f.value,g=h.kind===Iw.Kind.NULL;if(h.kind===Iw.Kind.VARIABLE){var v=h.name.value;if(r==null||!Rw(r,v)){if(c.defaultValue!==void 0)i[l]=c.defaultValue;else if((0,$i.isNonNullType)(d))throw new wr.GraphQLError('Argument "'.concat(l,'" of required type "').concat((0,Gi.default)(d),'" ')+'was provided the variable "$'.concat(v,'" which was not provided a runtime value.'),h);continue}g=r[v]==null}if(g&&(0,$i.isNonNullType)(d))throw new wr.GraphQLError('Argument "'.concat(l,'" of non-null type "').concat((0,Gi.default)(d),'" ')+"must not be null.",h);var _=(0,Aw.valueFromAST)(h,d,r);if(_===void 0)throw new wr.GraphQLError('Argument "'.concat(l,'" has invalid value ').concat((0,Ow.print)(h),"."),h);i[l]=_}return xw({},i)}function _H(e,t,r){var n=t.directives&&(0,dH.default)(t.directives,function(i){return i.name.value===e.name});if(n)return Nw(e,n,r)}function Rw(e,t){return Object.prototype.hasOwnProperty.call(e,t)}});var xs=y(Tt=>{"use strict";p();Object.defineProperty(Tt,"__esModule",{value:!0});Tt.execute=xH;Tt.executeSync=NH;Tt.assertValidExecutionArguments=qw;Tt.buildExecutionContext=Uw;Tt.collectFields=Os;Tt.buildResolveInfo=$w;Tt.getFieldDef=Hw;Tt.defaultFieldResolver=Tt.defaultTypeResolver=void 0;var Ki=Ar(se()),bH=Ar(Ew()),SH=Ar(et()),Cw=Ar(jt()),Ut=Ar(su()),um=Ar(ar()),TH=Ar($u()),IH=Ar(_w()),Pw=Ar(bw()),Bn=vs(),hr=K(),gc=Yo(),ws=Ee(),wH=fs(),Bi=qt(),Dw=gt(),Or=ie(),OH=dr(),AH=dc(),yc=Is();function Ar(e){return e&&e.__esModule?e:{default:e}}function xH(e,t,r,n,i,o,s,a){return arguments.length===1?sm(e):sm({schema:e,document:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a})}function NH(e){var t=sm(e);if((0,Ut.default)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t}function sm(e){var t=e.schema,r=e.document,n=e.rootValue,i=e.contextValue,o=e.variableValues,s=e.operationName,a=e.fieldResolver,u=e.typeResolver;qw(t,r,o);var c=Uw(t,r,n,i,o,s,a,u);if(Array.isArray(c))return{errors:c};var l=RH(c,c.operation,n);return Fw(c,l)}function Fw(e,t){return(0,Ut.default)(t)?t.then(function(r){return Fw(e,r)}):e.errors.length===0?{data:t}:{errors:e.errors,data:t}}function qw(e,t,r){t||(0,Cw.default)(0,"Must provide document."),(0,wH.assertValidSchema)(e),r==null||(0,um.default)(r)||(0,Cw.default)(0,"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 Uw(e,t,r,n,i,o,s,a){for(var u,c,l,d=Object.create(null),f=0,h=t.definitions;f<h.length;f++){var g=h[f];switch(g.kind){case ws.Kind.OPERATION_DEFINITION:if(o==null){if(l!==void 0)return[new hr.GraphQLError("Must provide operation name if query contains multiple operations.")];l=g}else((u=g.name)===null||u===void 0?void 0:u.value)===o&&(l=g);break;case ws.Kind.FRAGMENT_DEFINITION:d[g.name.value]=g;break}}if(!l)return o!=null?[new hr.GraphQLError('Unknown operation named "'.concat(o,'".'))]:[new hr.GraphQLError("Must provide an operation.")];var v=(c=l.variableDefinitions)!==null&&c!==void 0?c:[],_=(0,yc.getVariableValues)(e,v,i??{},{maxErrors:50});return _.errors?_.errors:{schema:e,fragments:d,rootValue:r,contextValue:n,operation:l,variableValues:_.coerced,fieldResolver:s??Kw,typeResolver:a??Bw,errors:[]}}function RH(e,t,r){var n=(0,AH.getOperationRootType)(e.schema,t),i=Os(e,n,t.selectionSet,Object.create(null),Object.create(null)),o=void 0;try{var s=t.operation==="mutation"?CH(e,n,r,o,i):Vw(e,n,r,o,i);return(0,Ut.default)(s)?s.then(void 0,function(a){return e.errors.push(a),Promise.resolve(null)}):s}catch(a){return e.errors.push(a),null}}function CH(e,t,r,n,i){return(0,IH.default)(Object.keys(i),function(o,s){var a=i[s],u=(0,Bn.addPath)(n,s,t.name),c=Gw(e,t,r,a,u);return c===void 0?o:(0,Ut.default)(c)?c.then(function(l){return o[s]=l,o}):(o[s]=c,o)},Object.create(null))}function Vw(e,t,r,n,i){var o=Object.create(null),s=!1;try{for(var a=0,u=Object.keys(i);a<u.length;a++){var c=u[a],l=i[c],d=(0,Bn.addPath)(n,c,t.name),f=Gw(e,t,r,l,d);f!==void 0&&(o[c]=f,(0,Ut.default)(f)&&(s=!0))}}catch(h){if(s)return(0,Pw.default)(o).finally(function(){throw h});throw h}return s?(0,Pw.default)(o):o}function Os(e,t,r,n,i){for(var o=0,s=r.selections;o<s.length;o++){var a=s[o];switch(a.kind){case ws.Kind.FIELD:{if(!om(e,a))continue;var u=PH(a);n[u]||(n[u]=[]),n[u].push(a);break}case ws.Kind.INLINE_FRAGMENT:{if(!om(e,a)||!Lw(e,a,t))continue;Os(e,t,a.selectionSet,n,i);break}case ws.Kind.FRAGMENT_SPREAD:{var c=a.name.value;if(i[c]||!om(e,a))continue;i[c]=!0;var l=e.fragments[c];if(!l||!Lw(e,l,t))continue;Os(e,t,l.selectionSet,n,i);break}}}return n}function om(e,t){var r=(0,yc.getDirectiveValues)(Dw.GraphQLSkipDirective,t,e.variableValues);if(r?.if===!0)return!1;var n=(0,yc.getDirectiveValues)(Dw.GraphQLIncludeDirective,t,e.variableValues);return n?.if!==!1}function Lw(e,t,r){var n=t.typeCondition;if(!n)return!0;var i=(0,OH.typeFromAST)(e.schema,n);return i===r?!0:(0,Or.isAbstractType)(i)?e.schema.isSubType(i,r):!1}function PH(e){return e.alias?e.alias.value:e.name.value}function Gw(e,t,r,n,i){var o,s=n[0],a=s.name.value,u=Hw(e.schema,t,a);if(u){var c=u.type,l=(o=u.resolve)!==null&&o!==void 0?o:e.fieldResolver,d=$w(e,u,n,t,i);try{var f=(0,yc.getArgumentValues)(u,n[0],e.variableValues),h=e.contextValue,g=l(r,f,h,d),v;return(0,Ut.default)(g)?v=g.then(function(S){return As(e,c,n,d,i,S)}):v=As(e,c,n,d,i,g),(0,Ut.default)(v)?v.then(void 0,function(S){var b=(0,gc.locatedError)(S,n,(0,Bn.pathToArray)(i));return vc(b,c,e)}):v}catch(S){var _=(0,gc.locatedError)(S,n,(0,Bn.pathToArray)(i));return vc(_,c,e)}}}function $w(e,t,r,n,i){return{fieldName:t.name,fieldNodes:r,returnType:t.type,parentType:n,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function vc(e,t,r){if((0,Or.isNonNullType)(t))throw e;return r.errors.push(e),null}function As(e,t,r,n,i,o){if(o instanceof Error)throw o;if((0,Or.isNonNullType)(t)){var s=As(e,t.ofType,r,n,i,o);if(s===null)throw new Error("Cannot return null for non-nullable field ".concat(n.parentType.name,".").concat(n.fieldName,"."));return s}if(o==null)return null;if((0,Or.isListType)(t))return DH(e,t,r,n,i,o);if((0,Or.isLeafType)(t))return LH(t,o);if((0,Or.isAbstractType)(t))return kH(e,t,r,n,i,o);if((0,Or.isObjectType)(t))return am(e,t,r,n,i,o);(0,SH.default)(0,"Cannot complete value of unexpected output type: "+(0,Ki.default)(t))}function DH(e,t,r,n,i,o){var s=t.ofType,a=!1,u=(0,TH.default)(o,function(c,l){var d=(0,Bn.addPath)(i,l,void 0);try{var f;return(0,Ut.default)(c)?f=c.then(function(g){return As(e,s,r,n,d,g)}):f=As(e,s,r,n,d,c),(0,Ut.default)(f)?(a=!0,f.then(void 0,function(g){var v=(0,gc.locatedError)(g,r,(0,Bn.pathToArray)(d));return vc(v,s,e)})):f}catch(g){var h=(0,gc.locatedError)(g,r,(0,Bn.pathToArray)(d));return vc(h,s,e)}});if(u==null)throw new hr.GraphQLError('Expected Iterable, but did not find one for field "'.concat(n.parentType.name,".").concat(n.fieldName,'".'));return a?Promise.all(u):u}function LH(e,t){var r=e.serialize(t);if(r===void 0)throw new Error('Expected a value of type "'.concat((0,Ki.default)(e),'" but ')+"received: ".concat((0,Ki.default)(t)));return r}function kH(e,t,r,n,i,o){var s,a=(s=t.resolveType)!==null&&s!==void 0?s:e.typeResolver,u=e.contextValue,c=a(o,u,n,t);return(0,Ut.default)(c)?c.then(function(l){return am(e,kw(l,e,t,r,n,o),r,n,i,o)}):am(e,kw(c,e,t,r,n,o),r,n,i,o)}function kw(e,t,r,n,i,o){if(e==null)throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" must resolve to an Object type at runtime for field "').concat(i.parentType.name,".").concat(i.fieldName,'". Either the "').concat(r.name,'" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.'),n);var s=(0,Or.isNamedType)(e)?e.name:e;if(typeof s!="string")throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" must resolve to an Object type at runtime for field "').concat(i.parentType.name,".").concat(i.fieldName,'" with ')+"value ".concat((0,Ki.default)(o),', received "').concat((0,Ki.default)(e),'".'));var a=t.schema.getType(s);if(a==null)throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" was resolve to a type "').concat(s,'" that does not exist inside schema.'),n);if(!(0,Or.isObjectType)(a))throw new hr.GraphQLError('Abstract type "'.concat(r.name,'" was resolve to a non-object type "').concat(s,'".'),n);if(!t.schema.isSubType(r,a))throw new hr.GraphQLError('Runtime Object type "'.concat(a.name,'" is not a possible type for "').concat(r.name,'".'),n);return a}function am(e,t,r,n,i,o){if(t.isTypeOf){var s=t.isTypeOf(o,e.contextValue,n);if((0,Ut.default)(s))return s.then(function(a){if(!a)throw jw(t,o,r);return Mw(e,t,r,i,o)});if(!s)throw jw(t,o,r)}return Mw(e,t,r,i,o)}function jw(e,t,r){return new hr.GraphQLError('Expected value of type "'.concat(e.name,'" but got: ').concat((0,Ki.default)(t),"."),r)}function Mw(e,t,r,n,i){var o=jH(e,t,r);return Vw(e,t,i,n,o)}var jH=(0,bH.default)(MH);function MH(e,t,r){for(var n=Object.create(null),i=Object.create(null),o=0;o<r.length;o++){var s=r[o];s.selectionSet&&(n=Os(e,t,s.selectionSet,n,i))}return n}var Bw=function(t,r,n,i){if((0,um.default)(t)&&typeof t.__typename=="string")return t.__typename;for(var o=n.schema.getPossibleTypes(i),s=[],a=0;a<o.length;a++){var u=o[a];if(u.isTypeOf){var c=u.isTypeOf(t,r,n);if((0,Ut.default)(c))s[a]=c;else if(c)return u.name}}if(s.length)return Promise.all(s).then(function(l){for(var d=0;d<l.length;d++)if(l[d])return o[d].name})};Tt.defaultTypeResolver=Bw;var Kw=function(t,r,n,i){if((0,um.default)(t)||typeof t=="function"){var o=t[i.fieldName];return typeof o=="function"?t[i.fieldName](r,n,i):o}};Tt.defaultFieldResolver=Kw;function Hw(e,t,r){return r===Bi.SchemaMetaFieldDef.name&&e.getQueryType()===t?Bi.SchemaMetaFieldDef:r===Bi.TypeMetaFieldDef.name&&e.getQueryType()===t?Bi.TypeMetaFieldDef:r===Bi.TypeNameMetaFieldDef.name?Bi.TypeNameMetaFieldDef:t.getFields()[r]}});var Qw=y(_c=>{"use strict";p();Object.defineProperty(_c,"__esModule",{value:!0});_c.graphql=BH;_c.graphqlSync=KH;var FH=$H(su()),qH=wi(),UH=Ui(),VH=fs(),GH=xs();function $H(e){return e&&e.__esModule?e:{default:e}}function BH(e,t,r,n,i,o,s,a){var u=arguments;return new Promise(function(c){return c(u.length===1?Ec(e):Ec({schema:e,source:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a}))})}function KH(e,t,r,n,i,o,s,a){var u=arguments.length===1?Ec(e):Ec({schema:e,source:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,typeResolver:a});if((0,FH.default)(u))throw new Error("GraphQL execution failed to complete synchronously.");return u}function Ec(e){var t=e.schema,r=e.source,n=e.rootValue,i=e.contextValue,o=e.variableValues,s=e.operationName,a=e.fieldResolver,u=e.typeResolver,c=(0,VH.validateSchema)(t);if(c.length>0)return{errors:c};var l;try{l=(0,qH.parse)(r)}catch(f){return{errors:[f]}}var d=(0,UH.validate)(t,l);return d.length>0?{errors:d}:(0,GH.execute)({schema:t,document:l,rootValue:n,contextValue:i,variableValues:o,operationName:s,fieldResolver:a,typeResolver:u})}});var zw=y(R=>{"use strict";p();Object.defineProperty(R,"__esModule",{value:!0});Object.defineProperty(R,"isSchema",{enumerable:!0,get:function(){return cm.isSchema}});Object.defineProperty(R,"assertSchema",{enumerable:!0,get:function(){return cm.assertSchema}});Object.defineProperty(R,"GraphQLSchema",{enumerable:!0,get:function(){return cm.GraphQLSchema}});Object.defineProperty(R,"isType",{enumerable:!0,get:function(){return W.isType}});Object.defineProperty(R,"isScalarType",{enumerable:!0,get:function(){return W.isScalarType}});Object.defineProperty(R,"isObjectType",{enumerable:!0,get:function(){return W.isObjectType}});Object.defineProperty(R,"isInterfaceType",{enumerable:!0,get:function(){return W.isInterfaceType}});Object.defineProperty(R,"isUnionType",{enumerable:!0,get:function(){return W.isUnionType}});Object.defineProperty(R,"isEnumType",{enumerable:!0,get:function(){return W.isEnumType}});Object.defineProperty(R,"isInputObjectType",{enumerable:!0,get:function(){return W.isInputObjectType}});Object.defineProperty(R,"isListType",{enumerable:!0,get:function(){return W.isListType}});Object.defineProperty(R,"isNonNullType",{enumerable:!0,get:function(){return W.isNonNullType}});Object.defineProperty(R,"isInputType",{enumerable:!0,get:function(){return W.isInputType}});Object.defineProperty(R,"isOutputType",{enumerable:!0,get:function(){return W.isOutputType}});Object.defineProperty(R,"isLeafType",{enumerable:!0,get:function(){return W.isLeafType}});Object.defineProperty(R,"isCompositeType",{enumerable:!0,get:function(){return W.isCompositeType}});Object.defineProperty(R,"isAbstractType",{enumerable:!0,get:function(){return W.isAbstractType}});Object.defineProperty(R,"isWrappingType",{enumerable:!0,get:function(){return W.isWrappingType}});Object.defineProperty(R,"isNullableType",{enumerable:!0,get:function(){return W.isNullableType}});Object.defineProperty(R,"isNamedType",{enumerable:!0,get:function(){return W.isNamedType}});Object.defineProperty(R,"isRequiredArgument",{enumerable:!0,get:function(){return W.isRequiredArgument}});Object.defineProperty(R,"isRequiredInputField",{enumerable:!0,get:function(){return W.isRequiredInputField}});Object.defineProperty(R,"assertType",{enumerable:!0,get:function(){return W.assertType}});Object.defineProperty(R,"assertScalarType",{enumerable:!0,get:function(){return W.assertScalarType}});Object.defineProperty(R,"assertObjectType",{enumerable:!0,get:function(){return W.assertObjectType}});Object.defineProperty(R,"assertInterfaceType",{enumerable:!0,get:function(){return W.assertInterfaceType}});Object.defineProperty(R,"assertUnionType",{enumerable:!0,get:function(){return W.assertUnionType}});Object.defineProperty(R,"assertEnumType",{enumerable:!0,get:function(){return W.assertEnumType}});Object.defineProperty(R,"assertInputObjectType",{enumerable:!0,get:function(){return W.assertInputObjectType}});Object.defineProperty(R,"assertListType",{enumerable:!0,get:function(){return W.assertListType}});Object.defineProperty(R,"assertNonNullType",{enumerable:!0,get:function(){return W.assertNonNullType}});Object.defineProperty(R,"assertInputType",{enumerable:!0,get:function(){return W.assertInputType}});Object.defineProperty(R,"assertOutputType",{enumerable:!0,get:function(){return W.assertOutputType}});Object.defineProperty(R,"assertLeafType",{enumerable:!0,get:function(){return W.assertLeafType}});Object.defineProperty(R,"assertCompositeType",{enumerable:!0,get:function(){return W.assertCompositeType}});Object.defineProperty(R,"assertAbstractType",{enumerable:!0,get:function(){return W.assertAbstractType}});Object.defineProperty(R,"assertWrappingType",{enumerable:!0,get:function(){return W.assertWrappingType}});Object.defineProperty(R,"assertNullableType",{enumerable:!0,get:function(){return W.assertNullableType}});Object.defineProperty(R,"assertNamedType",{enumerable:!0,get:function(){return W.assertNamedType}});Object.defineProperty(R,"getNullableType",{enumerable:!0,get:function(){return W.getNullableType}});Object.defineProperty(R,"getNamedType",{enumerable:!0,get:function(){return W.getNamedType}});Object.defineProperty(R,"GraphQLScalarType",{enumerable:!0,get:function(){return W.GraphQLScalarType}});Object.defineProperty(R,"GraphQLObjectType",{enumerable:!0,get:function(){return W.GraphQLObjectType}});Object.defineProperty(R,"GraphQLInterfaceType",{enumerable:!0,get:function(){return W.GraphQLInterfaceType}});Object.defineProperty(R,"GraphQLUnionType",{enumerable:!0,get:function(){return W.GraphQLUnionType}});Object.defineProperty(R,"GraphQLEnumType",{enumerable:!0,get:function(){return W.GraphQLEnumType}});Object.defineProperty(R,"GraphQLInputObjectType",{enumerable:!0,get:function(){return W.GraphQLInputObjectType}});Object.defineProperty(R,"GraphQLList",{enumerable:!0,get:function(){return W.GraphQLList}});Object.defineProperty(R,"GraphQLNonNull",{enumerable:!0,get:function(){return W.GraphQLNonNull}});Object.defineProperty(R,"isDirective",{enumerable:!0,get:function(){return mr.isDirective}});Object.defineProperty(R,"assertDirective",{enumerable:!0,get:function(){return mr.assertDirective}});Object.defineProperty(R,"GraphQLDirective",{enumerable:!0,get:function(){return mr.GraphQLDirective}});Object.defineProperty(R,"isSpecifiedDirective",{enumerable:!0,get:function(){return mr.isSpecifiedDirective}});Object.defineProperty(R,"specifiedDirectives",{enumerable:!0,get:function(){return mr.specifiedDirectives}});Object.defineProperty(R,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return mr.GraphQLIncludeDirective}});Object.defineProperty(R,"GraphQLSkipDirective",{enumerable:!0,get:function(){return mr.GraphQLSkipDirective}});Object.defineProperty(R,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return mr.GraphQLDeprecatedDirective}});Object.defineProperty(R,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return mr.GraphQLSpecifiedByDirective}});Object.defineProperty(R,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return mr.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(R,"isSpecifiedScalarType",{enumerable:!0,get:function(){return Kn.isSpecifiedScalarType}});Object.defineProperty(R,"specifiedScalarTypes",{enumerable:!0,get:function(){return Kn.specifiedScalarTypes}});Object.defineProperty(R,"GraphQLInt",{enumerable:!0,get:function(){return Kn.GraphQLInt}});Object.defineProperty(R,"GraphQLFloat",{enumerable:!0,get:function(){return Kn.GraphQLFloat}});Object.defineProperty(R,"GraphQLString",{enumerable:!0,get:function(){return Kn.GraphQLString}});Object.defineProperty(R,"GraphQLBoolean",{enumerable:!0,get:function(){return Kn.GraphQLBoolean}});Object.defineProperty(R,"GraphQLID",{enumerable:!0,get:function(){return Kn.GraphQLID}});Object.defineProperty(R,"isIntrospectionType",{enumerable:!0,get:function(){return vt.isIntrospectionType}});Object.defineProperty(R,"introspectionTypes",{enumerable:!0,get:function(){return vt.introspectionTypes}});Object.defineProperty(R,"__Schema",{enumerable:!0,get:function(){return vt.__Schema}});Object.defineProperty(R,"__Directive",{enumerable:!0,get:function(){return vt.__Directive}});Object.defineProperty(R,"__DirectiveLocation",{enumerable:!0,get:function(){return vt.__DirectiveLocation}});Object.defineProperty(R,"__Type",{enumerable:!0,get:function(){return vt.__Type}});Object.defineProperty(R,"__Field",{enumerable:!0,get:function(){return vt.__Field}});Object.defineProperty(R,"__InputValue",{enumerable:!0,get:function(){return vt.__InputValue}});Object.defineProperty(R,"__EnumValue",{enumerable:!0,get:function(){return vt.__EnumValue}});Object.defineProperty(R,"__TypeKind",{enumerable:!0,get:function(){return vt.__TypeKind}});Object.defineProperty(R,"TypeKind",{enumerable:!0,get:function(){return vt.TypeKind}});Object.defineProperty(R,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return vt.SchemaMetaFieldDef}});Object.defineProperty(R,"TypeMetaFieldDef",{enumerable:!0,get:function(){return vt.TypeMetaFieldDef}});Object.defineProperty(R,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return vt.TypeNameMetaFieldDef}});Object.defineProperty(R,"validateSchema",{enumerable:!0,get:function(){return Ww.validateSchema}});Object.defineProperty(R,"assertValidSchema",{enumerable:!0,get:function(){return Ww.assertValidSchema}});var cm=Mn(),W=ie(),mr=gt(),Kn=pr(),vt=qt(),Ww=fs()});var Xw=y(ve=>{"use strict";p();Object.defineProperty(ve,"__esModule",{value:!0});Object.defineProperty(ve,"Source",{enumerable:!0,get:function(){return HH.Source}});Object.defineProperty(ve,"getLocation",{enumerable:!0,get:function(){return QH.getLocation}});Object.defineProperty(ve,"printLocation",{enumerable:!0,get:function(){return Yw.printLocation}});Object.defineProperty(ve,"printSourceLocation",{enumerable:!0,get:function(){return Yw.printSourceLocation}});Object.defineProperty(ve,"Kind",{enumerable:!0,get:function(){return WH.Kind}});Object.defineProperty(ve,"TokenKind",{enumerable:!0,get:function(){return zH.TokenKind}});Object.defineProperty(ve,"Lexer",{enumerable:!0,get:function(){return YH.Lexer}});Object.defineProperty(ve,"parse",{enumerable:!0,get:function(){return lm.parse}});Object.defineProperty(ve,"parseValue",{enumerable:!0,get:function(){return lm.parseValue}});Object.defineProperty(ve,"parseType",{enumerable:!0,get:function(){return lm.parseType}});Object.defineProperty(ve,"print",{enumerable:!0,get:function(){return JH.print}});Object.defineProperty(ve,"visit",{enumerable:!0,get:function(){return bc.visit}});Object.defineProperty(ve,"visitInParallel",{enumerable:!0,get:function(){return bc.visitInParallel}});Object.defineProperty(ve,"getVisitFn",{enumerable:!0,get:function(){return bc.getVisitFn}});Object.defineProperty(ve,"BREAK",{enumerable:!0,get:function(){return bc.BREAK}});Object.defineProperty(ve,"Location",{enumerable:!0,get:function(){return Jw.Location}});Object.defineProperty(ve,"Token",{enumerable:!0,get:function(){return Jw.Token}});Object.defineProperty(ve,"isDefinitionNode",{enumerable:!0,get:function(){return xr.isDefinitionNode}});Object.defineProperty(ve,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return xr.isExecutableDefinitionNode}});Object.defineProperty(ve,"isSelectionNode",{enumerable:!0,get:function(){return xr.isSelectionNode}});Object.defineProperty(ve,"isValueNode",{enumerable:!0,get:function(){return xr.isValueNode}});Object.defineProperty(ve,"isTypeNode",{enumerable:!0,get:function(){return xr.isTypeNode}});Object.defineProperty(ve,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return xr.isTypeSystemDefinitionNode}});Object.defineProperty(ve,"isTypeDefinitionNode",{enumerable:!0,get:function(){return xr.isTypeDefinitionNode}});Object.defineProperty(ve,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return xr.isTypeSystemExtensionNode}});Object.defineProperty(ve,"isTypeExtensionNode",{enumerable:!0,get:function(){return xr.isTypeExtensionNode}});Object.defineProperty(ve,"DirectiveLocation",{enumerable:!0,get:function(){return XH.DirectiveLocation}});var HH=Su(),QH=uu(),Yw=hd(),WH=Ee(),zH=Si(),YH=wu(),lm=wi(),JH=mt(),bc=Kr(),Jw=bi(),xr=qn(),XH=Ti()});var Zw=y(an=>{"use strict";p();Object.defineProperty(an,"__esModule",{value:!0});Object.defineProperty(an,"responsePathAsArray",{enumerable:!0,get:function(){return ZH.pathToArray}});Object.defineProperty(an,"execute",{enumerable:!0,get:function(){return Sc.execute}});Object.defineProperty(an,"executeSync",{enumerable:!0,get:function(){return Sc.executeSync}});Object.defineProperty(an,"defaultFieldResolver",{enumerable:!0,get:function(){return Sc.defaultFieldResolver}});Object.defineProperty(an,"defaultTypeResolver",{enumerable:!0,get:function(){return Sc.defaultTypeResolver}});Object.defineProperty(an,"getDirectiveValues",{enumerable:!0,get:function(){return eQ.getDirectiveValues}});var ZH=vs(),Sc=xs(),eQ=Is()});var eO=y(pm=>{"use strict";p();Object.defineProperty(pm,"__esModule",{value:!0});pm.default=rQ;var tQ=ur();function rQ(e){return typeof e?.[tQ.SYMBOL_ASYNC_ITERATOR]=="function"}});var iO=y(dm=>{"use strict";p();Object.defineProperty(dm,"__esModule",{value:!0});dm.default=iQ;var tO=ur();function nQ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function iQ(e,t,r){var n=e[tO.SYMBOL_ASYNC_ITERATOR],i=n.call(e),o,s;typeof i.return=="function"&&(o=i.return,s=function(d){var f=function(){return Promise.reject(d)};return o.call(i).then(f,f)});function a(l){return l.done?l:rO(l.value,t).then(nO,s)}var u;if(r){var c=r;u=function(d){return rO(d,c).then(nO,s)}}return nQ({next:function(){return i.next().then(a,u)},return:function(){return o?o.call(i).then(a,u):Promise.resolve({value:void 0,done:!0})},throw:function(d){return typeof i.throw=="function"?i.throw(d).then(a,u):Promise.reject(d).catch(s)}},tO.SYMBOL_ASYNC_ITERATOR,function(){return this})}function rO(e,t){return new Promise(function(r){return r(t(e))})}function nO(e){return{value:e,done:!1}}});var pO=y(Tc=>{"use strict";p();Object.defineProperty(Tc,"__esModule",{value:!0});Tc.subscribe=cQ;Tc.createSourceEventStream=lO;var oQ=hm(se()),aO=hm(eO()),fm=vs(),uO=K(),oO=Yo(),sQ=Is(),Hi=xs(),aQ=dc(),uQ=hm(iO());function hm(e){return e&&e.__esModule?e:{default:e}}function cQ(e,t,r,n,i,o,s,a){return arguments.length===1?sO(e):sO({schema:e,document:t,rootValue:r,contextValue:n,variableValues:i,operationName:o,fieldResolver:s,subscribeFieldResolver:a})}function cO(e){if(e instanceof uO.GraphQLError)return{errors:[e]};throw e}function sO(e){var t=e.schema,r=e.document,n=e.rootValue,i=e.contextValue,o=e.variableValues,s=e.operationName,a=e.fieldResolver,u=e.subscribeFieldResolver,c=lO(t,r,n,i,o,s,u),l=function(f){return(0,Hi.execute)({schema:t,document:r,rootValue:f,contextValue:i,variableValues:o,operationName:s,fieldResolver:a})};return c.then(function(d){return(0,aO.default)(d)?(0,uQ.default)(d,l,cO):d})}function lO(e,t,r,n,i,o,s){return(0,Hi.assertValidExecutionArguments)(e,t,i),new Promise(function(a){var u=(0,Hi.buildExecutionContext)(e,t,r,n,i,o,s);a(Array.isArray(u)?{errors:u}:lQ(u))}).catch(cO)}function lQ(e){var t=e.schema,r=e.operation,n=e.variableValues,i=e.rootValue,o=(0,aQ.getOperationRootType)(t,r),s=(0,Hi.collectFields)(e,o,r.selectionSet,Object.create(null),Object.create(null)),a=Object.keys(s),u=a[0],c=s[u],l=c[0],d=l.name.value,f=(0,Hi.getFieldDef)(t,o,d);if(!f)throw new uO.GraphQLError('The subscription field "'.concat(d,'" is not defined.'),c);var h=(0,fm.addPath)(void 0,u,o.name),g=(0,Hi.buildResolveInfo)(e,f,c,o,h);return new Promise(function(v){var _,S=(0,sQ.getArgumentValues)(f,c[0],n),b=e.contextValue,A=(_=f.subscribe)!==null&&_!==void 0?_:e.fieldResolver;v(A(i,S,b,g))}).then(function(v){if(v instanceof Error)throw(0,oO.locatedError)(v,c,(0,fm.pathToArray)(h));if(!(0,aO.default)(v))throw new Error("Subscription field must return Async Iterable. "+"Received: ".concat((0,oQ.default)(v),"."));return v},function(v){throw(0,oO.locatedError)(v,c,(0,fm.pathToArray)(h))})}});var fO=y(Ic=>{"use strict";p();Object.defineProperty(Ic,"__esModule",{value:!0});Object.defineProperty(Ic,"subscribe",{enumerable:!0,get:function(){return dO.subscribe}});Object.defineProperty(Ic,"createSourceEventStream",{enumerable:!0,get:function(){return dO.createSourceEventStream}});var dO=pO()});var vm=y(ym=>{"use strict";p();Object.defineProperty(ym,"__esModule",{value:!0});ym.NoDeprecatedCustomRule=dQ;var mm=pQ(et()),Ns=K(),gm=ie();function pQ(e){return e&&e.__esModule?e:{default:e}}function dQ(e){return{Field:function(r){var n=e.getFieldDef(),i=n?.deprecationReason;if(n&&i!=null){var o=e.getParentType();o!=null||(0,mm.default)(0),e.reportError(new Ns.GraphQLError("The field ".concat(o.name,".").concat(n.name," is deprecated. ").concat(i),r))}},Argument:function(r){var n=e.getArgument(),i=n?.deprecationReason;if(n&&i!=null){var o=e.getDirective();if(o!=null)e.reportError(new Ns.GraphQLError('Directive "@'.concat(o.name,'" argument "').concat(n.name,'" is deprecated. ').concat(i),r));else{var s=e.getParentType(),a=e.getFieldDef();s!=null&&a!=null||(0,mm.default)(0),e.reportError(new Ns.GraphQLError('Field "'.concat(s.name,".").concat(a.name,'" argument "').concat(n.name,'" is deprecated. ').concat(i),r))}}},ObjectField:function(r){var n=(0,gm.getNamedType)(e.getParentInputType());if((0,gm.isInputObjectType)(n)){var i=n.getFields()[r.name.value],o=i?.deprecationReason;o!=null&&e.reportError(new Ns.GraphQLError("The input field ".concat(n.name,".").concat(i.name," is deprecated. ").concat(o),r))}},EnumValue:function(r){var n=e.getEnumValue(),i=n?.deprecationReason;if(n&&i!=null){var o=(0,gm.getNamedType)(e.getInputType());o!=null||(0,mm.default)(0),e.reportError(new Ns.GraphQLError('The enum value "'.concat(o.name,".").concat(n.name,'" is deprecated. ').concat(i),r))}}}}});var hO=y(Em=>{"use strict";p();Object.defineProperty(Em,"__esModule",{value:!0});Em.NoSchemaIntrospectionCustomRule=gQ;var fQ=K(),hQ=ie(),mQ=qt();function gQ(e){return{Field:function(r){var n=(0,hQ.getNamedType)(e.getType());n&&(0,mQ.isIntrospectionType)(n)&&e.reportError(new fQ.GraphQLError('GraphQL introspection has been disabled, but the requested query contained the field "'.concat(r.name.value,'".'),r))}}}});var gO=y(J=>{"use strict";p();Object.defineProperty(J,"__esModule",{value:!0});Object.defineProperty(J,"validate",{enumerable:!0,get:function(){return yQ.validate}});Object.defineProperty(J,"ValidationContext",{enumerable:!0,get:function(){return vQ.ValidationContext}});Object.defineProperty(J,"specifiedRules",{enumerable:!0,get:function(){return mO.specifiedRules}});Object.defineProperty(J,"recommendedRules",{enumerable:!0,get:function(){return mO.recommendedRules}});Object.defineProperty(J,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return EQ.ExecutableDefinitionsRule}});Object.defineProperty(J,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return _Q.FieldsOnCorrectTypeRule}});Object.defineProperty(J,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return bQ.FragmentsOnCompositeTypesRule}});Object.defineProperty(J,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return SQ.KnownArgumentNamesRule}});Object.defineProperty(J,"KnownDirectivesRule",{enumerable:!0,get:function(){return TQ.KnownDirectivesRule}});Object.defineProperty(J,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return IQ.KnownFragmentNamesRule}});Object.defineProperty(J,"KnownTypeNamesRule",{enumerable:!0,get:function(){return wQ.KnownTypeNamesRule}});Object.defineProperty(J,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return OQ.LoneAnonymousOperationRule}});Object.defineProperty(J,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return AQ.NoFragmentCyclesRule}});Object.defineProperty(J,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return xQ.NoUndefinedVariablesRule}});Object.defineProperty(J,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return NQ.NoUnusedFragmentsRule}});Object.defineProperty(J,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return RQ.NoUnusedVariablesRule}});Object.defineProperty(J,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return CQ.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(J,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return PQ.PossibleFragmentSpreadsRule}});Object.defineProperty(J,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return DQ.ProvidedRequiredArgumentsRule}});Object.defineProperty(J,"ScalarLeafsRule",{enumerable:!0,get:function(){return LQ.ScalarLeafsRule}});Object.defineProperty(J,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return kQ.SingleFieldSubscriptionsRule}});Object.defineProperty(J,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return jQ.UniqueArgumentNamesRule}});Object.defineProperty(J,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return MQ.UniqueDirectivesPerLocationRule}});Object.defineProperty(J,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return FQ.UniqueFragmentNamesRule}});Object.defineProperty(J,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return qQ.UniqueInputFieldNamesRule}});Object.defineProperty(J,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return UQ.UniqueOperationNamesRule}});Object.defineProperty(J,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return VQ.UniqueVariableNamesRule}});Object.defineProperty(J,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return GQ.ValuesOfCorrectTypeRule}});Object.defineProperty(J,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return $Q.VariablesAreInputTypesRule}});Object.defineProperty(J,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return BQ.VariablesInAllowedPositionRule}});Object.defineProperty(J,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return KQ.MaxIntrospectionDepthRule}});Object.defineProperty(J,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return HQ.LoneSchemaDefinitionRule}});Object.defineProperty(J,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return QQ.UniqueOperationTypesRule}});Object.defineProperty(J,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return WQ.UniqueTypeNamesRule}});Object.defineProperty(J,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return zQ.UniqueEnumValueNamesRule}});Object.defineProperty(J,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return YQ.UniqueFieldDefinitionNamesRule}});Object.defineProperty(J,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return JQ.UniqueDirectiveNamesRule}});Object.defineProperty(J,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return XQ.PossibleTypeExtensionsRule}});Object.defineProperty(J,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return ZQ.NoDeprecatedCustomRule}});Object.defineProperty(J,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return eW.NoSchemaIntrospectionCustomRule}});var yQ=Ui(),vQ=Wh(),mO=Hh(),EQ=wf(),_Q=Gf(),bQ=jf(),SQ=ph(),TQ=ah(),IQ=Hf(),wQ=Lf(),OQ=Nf(),AQ=Zf(),xQ=nh(),NQ=Wf(),RQ=oh(),CQ=Oh(),PQ=Jf(),DQ=yh(),LQ=Uf(),kQ=Cf(),jQ=fh(),MQ=lh(),FQ=Bf(),qQ=xh(),UQ=Af(),VQ=th(),GQ=mh(),$Q=Ff(),BQ=Eh(),KQ=Rh(),HQ=Ph(),QQ=Lh(),WQ=jh(),zQ=Fh(),YQ=Vh(),JQ=$h(),XQ=Kh(),ZQ=vm(),eW=hO()});var yO=y(_m=>{"use strict";p();Object.defineProperty(_m,"__esModule",{value:!0});Object.defineProperty(_m,"formatError",{enumerable:!0,get:function(){return tW.formatError}});var tW=K()});var EO=y(Hn=>{"use strict";p();Object.defineProperty(Hn,"__esModule",{value:!0});Object.defineProperty(Hn,"GraphQLError",{enumerable:!0,get:function(){return vO.GraphQLError}});Object.defineProperty(Hn,"printError",{enumerable:!0,get:function(){return vO.printError}});Object.defineProperty(Hn,"syntaxError",{enumerable:!0,get:function(){return rW.syntaxError}});Object.defineProperty(Hn,"locatedError",{enumerable:!0,get:function(){return nW.locatedError}});Object.defineProperty(Hn,"formatError",{enumerable:!0,get:function(){return iW.formatError}});var vO=K(),rW=fu(),nW=Yo(),iW=yO()});var Sm=y(bm=>{"use strict";p();Object.defineProperty(bm,"__esModule",{value:!0});bm.getIntrospectionQuery=aW;function _O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function oW(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_O(Object(r),!0).forEach(function(n){sW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_O(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function sW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aW(e){var t=oW({descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1},e),r=t.descriptions?"description":"",n=t.specifiedByUrl?"specifiedByUrl":"",i=t.directiveIsRepeatable?"isRepeatable":"",o=t.schemaDescription?r:"";function s(a){return t.inputValueDeprecation?a:""}return`
|
|
80
80
|
query IntrospectionQuery {
|
|
81
81
|
__schema {
|
|
82
82
|
`.concat(o,`
|
|
@@ -173,68 +173,68 @@ In some cases, you need to provide options to alter GraphQL's execution behavior
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
|
-
`)}});var bm=y(_m=>{"use strict";p();Object.defineProperty(_m,"__esModule",{value:!0});_m.getOperationAST=tW;var eW=Ee();function tW(e,t){for(var r=null,n=0,i=e.definitions;n<i.length;n++){var o=i[n];if(o.kind===eW.Kind.OPERATION_DEFINITION){var s;if(t==null){if(r)return null;r=o}else if(((s=o.name)===null||s===void 0?void 0:s.value)===t)return o}}return r}});var yw=y(Sm=>{"use strict";p();Object.defineProperty(Sm,"__esModule",{value:!0});Sm.introspectionFromSchema=cW;var rW=sW(et()),nW=Ii(),iW=As(),oW=Em();function sW(e){return e&&e.__esModule?e:{default:e}}function gw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function aW(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gw(Object(r),!0).forEach(function(n){uW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gw(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cW(e,t){var r=aW({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0},t),n=(0,nW.parse)((0,oW.getIntrospectionQuery)(r)),i=(0,iW.executeSync)({schema:e,document:n});return!i.errors&&i.data||(0,rW.default)(0),i.data}});var Ew=y(Tm=>{"use strict";p();Object.defineProperty(Tm,"__esModule",{value:!0});Tm.buildClientSchema=yW;var lW=Ns(bt()),It=Ns(se()),pW=Ns(jt()),Tc=Ns(Yo()),vw=Ns(ar()),dW=Ii(),fW=jn(),hW=gt(),mW=pr(),gr=qt(),Ot=ie(),gW=Es();function Ns(e){return e&&e.__esModule?e:{default:e}}function yW(e,t){(0,vw.default)(e)&&(0,vw.default)(e.__schema)||(0,pW.default)(0,'Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: '.concat((0,It.default)(e),"."));for(var r=e.__schema,n=(0,Tc.default)(r.types,function(I){return I.name},function(I){return v(I)}),i=0,o=[].concat(mW.specifiedScalarTypes,gr.introspectionTypes);i<o.length;i++){var s=o[i];n[s.name]&&(n[s.name]=s)}var a=r.queryType?h(r.queryType):null,u=r.mutationType?h(r.mutationType):null,c=r.subscriptionType?h(r.subscriptionType):null,l=r.directives?r.directives.map(ge):[];return new fW.GraphQLSchema({description:r.description,query:a,mutation:u,subscription:c,types:(0,lW.default)(n),directives:l,assumeValid:t?.assumeValid});function d(I){if(I.kind===gr.TypeKind.LIST){var ee=I.ofType;if(!ee)throw new Error("Decorated type deeper than introspection query.");return new Ot.GraphQLList(d(ee))}if(I.kind===gr.TypeKind.NON_NULL){var Re=I.ofType;if(!Re)throw new Error("Decorated type deeper than introspection query.");var vn=d(Re);return new Ot.GraphQLNonNull((0,Ot.assertNullableType)(vn))}return f(I)}function f(I){var ee=I.name;if(!ee)throw new Error("Unknown type reference: ".concat((0,It.default)(I),"."));var Re=n[ee];if(!Re)throw new Error("Invalid or incomplete schema, unknown type: ".concat(ee,". Ensure that a full introspection query is used in order to build a client schema."));return Re}function h(I){return(0,Ot.assertObjectType)(f(I))}function g(I){return(0,Ot.assertInterfaceType)(f(I))}function v(I){if(I!=null&&I.name!=null&&I.kind!=null)switch(I.kind){case gr.TypeKind.SCALAR:return _(I);case gr.TypeKind.OBJECT:return b(I);case gr.TypeKind.INTERFACE:return A(I);case gr.TypeKind.UNION:return w(I);case gr.TypeKind.ENUM:return T(I);case gr.TypeKind.INPUT_OBJECT:return x(I)}var ee=(0,It.default)(I);throw new Error("Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ".concat(ee,"."))}function _(I){return new Ot.GraphQLScalarType({name:I.name,description:I.description,specifiedByUrl:I.specifiedByUrl})}function S(I){if(I.interfaces===null&&I.kind===gr.TypeKind.INTERFACE)return[];if(!I.interfaces){var ee=(0,It.default)(I);throw new Error("Introspection result missing interfaces: ".concat(ee,"."))}return I.interfaces.map(g)}function b(I){return new Ot.GraphQLObjectType({name:I.name,description:I.description,interfaces:function(){return S(I)},fields:function(){return U(I)}})}function A(I){return new Ot.GraphQLInterfaceType({name:I.name,description:I.description,interfaces:function(){return S(I)},fields:function(){return U(I)}})}function w(I){if(!I.possibleTypes){var ee=(0,It.default)(I);throw new Error("Introspection result missing possibleTypes: ".concat(ee,"."))}return new Ot.GraphQLUnionType({name:I.name,description:I.description,types:function(){return I.possibleTypes.map(h)}})}function T(I){if(!I.enumValues){var ee=(0,It.default)(I);throw new Error("Introspection result missing enumValues: ".concat(ee,"."))}return new Ot.GraphQLEnumType({name:I.name,description:I.description,values:(0,Tc.default)(I.enumValues,function(Re){return Re.name},function(Re){return{description:Re.description,deprecationReason:Re.deprecationReason}})})}function x(I){if(!I.inputFields){var ee=(0,It.default)(I);throw new Error("Introspection result missing inputFields: ".concat(ee,"."))}return new Ot.GraphQLInputObjectType({name:I.name,description:I.description,fields:function(){return te(I.inputFields)}})}function U(I){if(!I.fields)throw new Error("Introspection result missing fields: ".concat((0,It.default)(I),"."));return(0,Tc.default)(I.fields,function(ee){return ee.name},N)}function N(I){var ee=d(I.type);if(!(0,Ot.isOutputType)(ee)){var Re=(0,It.default)(ee);throw new Error("Introspection must provide output type for fields, but received: ".concat(Re,"."))}if(!I.args){var vn=(0,It.default)(I);throw new Error("Introspection result missing field args: ".concat(vn,"."))}return{description:I.description,deprecationReason:I.deprecationReason,type:ee,args:te(I.args)}}function te(I){return(0,Tc.default)(I,function(ee){return ee.name},pe)}function pe(I){var ee=d(I.type);if(!(0,Ot.isInputType)(ee)){var Re=(0,It.default)(ee);throw new Error("Introspection must provide input type for arguments, but received: ".concat(Re,"."))}var vn=I.defaultValue!=null?(0,gW.valueFromAST)((0,dW.parseValue)(I.defaultValue),ee):void 0;return{description:I.description,type:ee,defaultValue:vn,deprecationReason:I.deprecationReason}}function ge(I){if(!I.args){var ee=(0,It.default)(I);throw new Error("Introspection result missing directive args: ".concat(ee,"."))}if(!I.locations){var Re=(0,It.default)(I);throw new Error("Introspection result missing directive locations: ".concat(Re,"."))}return new hW.GraphQLDirective({name:I.name,description:I.description,isRepeatable:I.isRepeatable,locations:I.locations.slice(),args:te(I.args)})}}});var Im=y(Cs=>{"use strict";p();Object.defineProperty(Cs,"__esModule",{value:!0});Cs.extendSchema=OW;Cs.extendSchemaImpl=Cw;Cs.getDescription=Hn;var vW=Hi(bt()),EW=Hi(Hr()),_w=Hi(se()),Rs=Hi(Ad()),bw=Hi(et()),_W=Hi(jt()),Vt=Ee(),bW=bi(),SW=Ti(),Sw=Fn(),TW=qi(),xw=Ts(),Tw=jn(),Nw=pr(),Rw=qt(),Oc=gt(),xe=ie(),Iw=Es();function Hi(e){return e&&e.__esModule?e:{default:e}}function Ow(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ow(Object(r),!0).forEach(function(n){IW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ow(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function IW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function OW(e,t,r){(0,Tw.assertSchema)(e),t!=null&&t.kind===Vt.Kind.DOCUMENT||(0,_W.default)(0,"Must provide valid Document AST."),r?.assumeValid!==!0&&r?.assumeValidSDL!==!0&&(0,TW.assertValidSDLExtension)(t,e);var n=e.toConfig(),i=Cw(n,t,r);return n===i?e:new Tw.GraphQLSchema(i)}function Cw(e,t,r){for(var n,i,o,s,a=[],u=Object.create(null),c=[],l,d=[],f=0,h=t.definitions;f<h.length;f++){var g=h[f];if(g.kind===Vt.Kind.SCHEMA_DEFINITION)l=g;else if(g.kind===Vt.Kind.SCHEMA_EXTENSION)d.push(g);else if((0,Sw.isTypeDefinitionNode)(g))a.push(g);else if((0,Sw.isTypeExtensionNode)(g)){var v=g.name.value,_=u[v];u[v]=_?_.concat([g]):[g]}else g.kind===Vt.Kind.DIRECTIVE_DEFINITION&&c.push(g)}if(Object.keys(u).length===0&&a.length===0&&c.length===0&&d.length===0&&l==null)return e;for(var S=Object.create(null),b=0,A=e.types;b<A.length;b++){var w=A[b];S[w.name]=ee(w)}for(var T=0;T<a.length;T++){var x,U=a[T],N=U.name.value;S[N]=(x=ww[N])!==null&&x!==void 0?x:ZP(U)}var te=ue(ue({query:e.query&&ge(e.query),mutation:e.mutation&&ge(e.mutation),subscription:e.subscription&&ge(e.subscription)},l&&ev([l])),ev(d));return ue(ue({description:(n=l)===null||n===void 0||(i=n.description)===null||i===void 0?void 0:i.value},te),{},{types:(0,vW.default)(S),directives:[].concat(e.directives.map(I),c.map(XP)),extensions:void 0,astNode:(o=l)!==null&&o!==void 0?o:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(d),assumeValid:(s=r?.assumeValid)!==null&&s!==void 0?s:!1});function pe(O){return(0,xe.isListType)(O)?new xe.GraphQLList(pe(O.ofType)):(0,xe.isNonNullType)(O)?new xe.GraphQLNonNull(pe(O.ofType)):ge(O)}function ge(O){return S[O.name]}function I(O){var G=O.toConfig();return new Oc.GraphQLDirective(ue(ue({},G),{},{args:(0,Rs.default)(G.args,Zy)}))}function ee(O){if((0,Rw.isIntrospectionType)(O)||(0,Nw.isSpecifiedScalarType)(O))return O;if((0,xe.isScalarType)(O))return WP(O);if((0,xe.isObjectType)(O))return zP(O);if((0,xe.isInterfaceType)(O))return YP(O);if((0,xe.isUnionType)(O))return JP(O);if((0,xe.isEnumType)(O))return vn(O);if((0,xe.isInputObjectType)(O))return Re(O);(0,bw.default)(0,"Unexpected type: "+(0,_w.default)(O))}function Re(O){var G,L=O.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[];return new xe.GraphQLInputObjectType(ue(ue({},L),{},{fields:function(){return ue(ue({},(0,Rs.default)(L.fields,function(fe){return ue(ue({},fe),{},{type:pe(fe.type)})})),rv(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function vn(O){var G,L=O.toConfig(),V=(G=u[O.name])!==null&&G!==void 0?G:[];return new xe.GraphQLEnumType(ue(ue({},L),{},{values:ue(ue({},L.values),nv(V)),extensionASTNodes:L.extensionASTNodes.concat(V)}))}function WP(O){for(var G,L=O.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[],re=L.specifiedByUrl,fe=0;fe<V.length;fe++){var he,me=V[fe];re=(he=Aw(me))!==null&&he!==void 0?he:re}return new xe.GraphQLScalarType(ue(ue({},L),{},{specifiedByUrl:re,extensionASTNodes:L.extensionASTNodes.concat(V)}))}function zP(O){var G,L=O.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[];return new xe.GraphQLObjectType(ue(ue({},L),{},{interfaces:function(){return[].concat(O.getInterfaces().map(ge),ba(V))},fields:function(){return ue(ue({},(0,Rs.default)(L.fields,Xy)),_a(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function YP(O){var G,L=O.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[];return new xe.GraphQLInterfaceType(ue(ue({},L),{},{interfaces:function(){return[].concat(O.getInterfaces().map(ge),ba(V))},fields:function(){return ue(ue({},(0,Rs.default)(L.fields,Xy)),_a(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function JP(O){var G,L=O.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[];return new xe.GraphQLUnionType(ue(ue({},L),{},{types:function(){return[].concat(O.getTypes().map(ge),iv(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function Xy(O){return ue(ue({},O),{},{type:pe(O.type),args:(0,Rs.default)(O.args,Zy)})}function Zy(O){return ue(ue({},O),{},{type:pe(O.type)})}function ev(O){for(var G={},L=0;L<O.length;L++)for(var V,re=O[L],fe=(V=re.operationTypes)!==null&&V!==void 0?V:[],he=0;he<fe.length;he++){var me=fe[he];G[me.operation]=Ea(me.type)}return G}function Ea(O){var G,L=O.name.value,V=(G=ww[L])!==null&&G!==void 0?G:S[L];if(V===void 0)throw new Error('Unknown type: "'.concat(L,'".'));return V}function Oo(O){return O.kind===Vt.Kind.LIST_TYPE?new xe.GraphQLList(Oo(O.type)):O.kind===Vt.Kind.NON_NULL_TYPE?new xe.GraphQLNonNull(Oo(O.type)):Ea(O)}function XP(O){var G=O.locations.map(function(L){var V=L.value;return V});return new Oc.GraphQLDirective({name:O.name.value,description:Hn(O,r),locations:G,isRepeatable:O.repeatable,args:tv(O.arguments),astNode:O})}function _a(O){for(var G=Object.create(null),L=0;L<O.length;L++)for(var V,re=O[L],fe=(V=re.fields)!==null&&V!==void 0?V:[],he=0;he<fe.length;he++){var me=fe[he];G[me.name.value]={type:Oo(me.type),description:Hn(me,r),args:tv(me.arguments),deprecationReason:Ic(me),astNode:me}}return G}function tv(O){for(var G=O??[],L=Object.create(null),V=0;V<G.length;V++){var re=G[V],fe=Oo(re.type);L[re.name.value]={type:fe,description:Hn(re,r),defaultValue:(0,Iw.valueFromAST)(re.defaultValue,fe),deprecationReason:Ic(re),astNode:re}}return L}function rv(O){for(var G=Object.create(null),L=0;L<O.length;L++)for(var V,re=O[L],fe=(V=re.fields)!==null&&V!==void 0?V:[],he=0;he<fe.length;he++){var me=fe[he],wo=Oo(me.type);G[me.name.value]={type:wo,description:Hn(me,r),defaultValue:(0,Iw.valueFromAST)(me.defaultValue,wo),deprecationReason:Ic(me),astNode:me}}return G}function nv(O){for(var G=Object.create(null),L=0;L<O.length;L++)for(var V,re=O[L],fe=(V=re.values)!==null&&V!==void 0?V:[],he=0;he<fe.length;he++){var me=fe[he];G[me.name.value]={description:Hn(me,r),deprecationReason:Ic(me),astNode:me}}return G}function ba(O){for(var G=[],L=0;L<O.length;L++)for(var V,re=O[L],fe=(V=re.interfaces)!==null&&V!==void 0?V:[],he=0;he<fe.length;he++){var me=fe[he];G.push(Ea(me))}return G}function iv(O){for(var G=[],L=0;L<O.length;L++)for(var V,re=O[L],fe=(V=re.types)!==null&&V!==void 0?V:[],he=0;he<fe.length;he++){var me=fe[he];G.push(Ea(me))}return G}function ZP(O){var G,L=O.name.value,V=Hn(O,r),re=(G=u[L])!==null&&G!==void 0?G:[];switch(O.kind){case Vt.Kind.OBJECT_TYPE_DEFINITION:{var fe=re,he=[O].concat(fe);return new xe.GraphQLObjectType({name:L,description:V,interfaces:function(){return ba(he)},fields:function(){return _a(he)},astNode:O,extensionASTNodes:fe})}case Vt.Kind.INTERFACE_TYPE_DEFINITION:{var me=re,wo=[O].concat(me);return new xe.GraphQLInterfaceType({name:L,description:V,interfaces:function(){return ba(wo)},fields:function(){return _a(wo)},astNode:O,extensionASTNodes:me})}case Vt.Kind.ENUM_TYPE_DEFINITION:{var ov=re,eD=[O].concat(ov);return new xe.GraphQLEnumType({name:L,description:V,values:nv(eD),astNode:O,extensionASTNodes:ov})}case Vt.Kind.UNION_TYPE_DEFINITION:{var sv=re,tD=[O].concat(sv);return new xe.GraphQLUnionType({name:L,description:V,types:function(){return iv(tD)},astNode:O,extensionASTNodes:sv})}case Vt.Kind.SCALAR_TYPE_DEFINITION:{var rD=re;return new xe.GraphQLScalarType({name:L,description:V,specifiedByUrl:Aw(O),astNode:O,extensionASTNodes:rD})}case Vt.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var av=re,nD=[O].concat(av);return new xe.GraphQLInputObjectType({name:L,description:V,fields:function(){return rv(nD)},astNode:O,extensionASTNodes:av})}}(0,bw.default)(0,"Unexpected type definition node: "+(0,_w.default)(O))}}var ww=(0,EW.default)(Nw.specifiedScalarTypes.concat(Rw.introspectionTypes),function(e){return e.name});function Ic(e){var t=(0,xw.getDirectiveValues)(Oc.GraphQLDeprecatedDirective,e);return t?.reason}function Aw(e){var t=(0,xw.getDirectiveValues)(Oc.GraphQLSpecifiedByDirective,e);return t?.url}function Hn(e,t){if(e.description)return e.description.value;if(t?.commentDescriptions===!0){var r=wW(e);if(r!==void 0)return(0,SW.dedentBlockStringValue)(`
|
|
177
|
-
`+r)}}function
|
|
178
|
-
`):void 0}}});var
|
|
176
|
+
`)}});var Im=y(Tm=>{"use strict";p();Object.defineProperty(Tm,"__esModule",{value:!0});Tm.getOperationAST=cW;var uW=Ee();function cW(e,t){for(var r=null,n=0,i=e.definitions;n<i.length;n++){var o=i[n];if(o.kind===uW.Kind.OPERATION_DEFINITION){var s;if(t==null){if(r)return null;r=o}else if(((s=o.name)===null||s===void 0?void 0:s.value)===t)return o}}return r}});var SO=y(wm=>{"use strict";p();Object.defineProperty(wm,"__esModule",{value:!0});wm.introspectionFromSchema=yW;var lW=hW(et()),pW=wi(),dW=xs(),fW=Sm();function hW(e){return e&&e.__esModule?e:{default:e}}function bO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function mW(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?bO(Object(r),!0).forEach(function(n){gW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):bO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yW(e,t){var r=mW({specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0},t),n=(0,pW.parse)((0,fW.getIntrospectionQuery)(r)),i=(0,dW.executeSync)({schema:e,document:n});return!i.errors&&i.data||(0,lW.default)(0),i.data}});var IO=y(Om=>{"use strict";p();Object.defineProperty(Om,"__esModule",{value:!0});Om.buildClientSchema=wW;var vW=Rs(bt()),It=Rs(se()),EW=Rs(jt()),wc=Rs(Jo()),TO=Rs(ar()),_W=wi(),bW=Mn(),SW=gt(),TW=pr(),gr=qt(),wt=ie(),IW=_s();function Rs(e){return e&&e.__esModule?e:{default:e}}function wW(e,t){(0,TO.default)(e)&&(0,TO.default)(e.__schema)||(0,EW.default)(0,'Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: '.concat((0,It.default)(e),"."));for(var r=e.__schema,n=(0,wc.default)(r.types,function(I){return I.name},function(I){return v(I)}),i=0,o=[].concat(TW.specifiedScalarTypes,gr.introspectionTypes);i<o.length;i++){var s=o[i];n[s.name]&&(n[s.name]=s)}var a=r.queryType?h(r.queryType):null,u=r.mutationType?h(r.mutationType):null,c=r.subscriptionType?h(r.subscriptionType):null,l=r.directives?r.directives.map(ge):[];return new bW.GraphQLSchema({description:r.description,query:a,mutation:u,subscription:c,types:(0,vW.default)(n),directives:l,assumeValid:t?.assumeValid});function d(I){if(I.kind===gr.TypeKind.LIST){var ee=I.ofType;if(!ee)throw new Error("Decorated type deeper than introspection query.");return new wt.GraphQLList(d(ee))}if(I.kind===gr.TypeKind.NON_NULL){var Re=I.ofType;if(!Re)throw new Error("Decorated type deeper than introspection query.");var En=d(Re);return new wt.GraphQLNonNull((0,wt.assertNullableType)(En))}return f(I)}function f(I){var ee=I.name;if(!ee)throw new Error("Unknown type reference: ".concat((0,It.default)(I),"."));var Re=n[ee];if(!Re)throw new Error("Invalid or incomplete schema, unknown type: ".concat(ee,". Ensure that a full introspection query is used in order to build a client schema."));return Re}function h(I){return(0,wt.assertObjectType)(f(I))}function g(I){return(0,wt.assertInterfaceType)(f(I))}function v(I){if(I!=null&&I.name!=null&&I.kind!=null)switch(I.kind){case gr.TypeKind.SCALAR:return _(I);case gr.TypeKind.OBJECT:return b(I);case gr.TypeKind.INTERFACE:return A(I);case gr.TypeKind.UNION:return O(I);case gr.TypeKind.ENUM:return T(I);case gr.TypeKind.INPUT_OBJECT:return x(I)}var ee=(0,It.default)(I);throw new Error("Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ".concat(ee,"."))}function _(I){return new wt.GraphQLScalarType({name:I.name,description:I.description,specifiedByUrl:I.specifiedByUrl})}function S(I){if(I.interfaces===null&&I.kind===gr.TypeKind.INTERFACE)return[];if(!I.interfaces){var ee=(0,It.default)(I);throw new Error("Introspection result missing interfaces: ".concat(ee,"."))}return I.interfaces.map(g)}function b(I){return new wt.GraphQLObjectType({name:I.name,description:I.description,interfaces:function(){return S(I)},fields:function(){return U(I)}})}function A(I){return new wt.GraphQLInterfaceType({name:I.name,description:I.description,interfaces:function(){return S(I)},fields:function(){return U(I)}})}function O(I){if(!I.possibleTypes){var ee=(0,It.default)(I);throw new Error("Introspection result missing possibleTypes: ".concat(ee,"."))}return new wt.GraphQLUnionType({name:I.name,description:I.description,types:function(){return I.possibleTypes.map(h)}})}function T(I){if(!I.enumValues){var ee=(0,It.default)(I);throw new Error("Introspection result missing enumValues: ".concat(ee,"."))}return new wt.GraphQLEnumType({name:I.name,description:I.description,values:(0,wc.default)(I.enumValues,function(Re){return Re.name},function(Re){return{description:Re.description,deprecationReason:Re.deprecationReason}})})}function x(I){if(!I.inputFields){var ee=(0,It.default)(I);throw new Error("Introspection result missing inputFields: ".concat(ee,"."))}return new wt.GraphQLInputObjectType({name:I.name,description:I.description,fields:function(){return te(I.inputFields)}})}function U(I){if(!I.fields)throw new Error("Introspection result missing fields: ".concat((0,It.default)(I),"."));return(0,wc.default)(I.fields,function(ee){return ee.name},N)}function N(I){var ee=d(I.type);if(!(0,wt.isOutputType)(ee)){var Re=(0,It.default)(ee);throw new Error("Introspection must provide output type for fields, but received: ".concat(Re,"."))}if(!I.args){var En=(0,It.default)(I);throw new Error("Introspection result missing field args: ".concat(En,"."))}return{description:I.description,deprecationReason:I.deprecationReason,type:ee,args:te(I.args)}}function te(I){return(0,wc.default)(I,function(ee){return ee.name},pe)}function pe(I){var ee=d(I.type);if(!(0,wt.isInputType)(ee)){var Re=(0,It.default)(ee);throw new Error("Introspection must provide input type for arguments, but received: ".concat(Re,"."))}var En=I.defaultValue!=null?(0,IW.valueFromAST)((0,_W.parseValue)(I.defaultValue),ee):void 0;return{description:I.description,type:ee,defaultValue:En,deprecationReason:I.deprecationReason}}function ge(I){if(!I.args){var ee=(0,It.default)(I);throw new Error("Introspection result missing directive args: ".concat(ee,"."))}if(!I.locations){var Re=(0,It.default)(I);throw new Error("Introspection result missing directive locations: ".concat(Re,"."))}return new SW.GraphQLDirective({name:I.name,description:I.description,isRepeatable:I.isRepeatable,locations:I.locations.slice(),args:te(I.args)})}}});var Am=y(Ps=>{"use strict";p();Object.defineProperty(Ps,"__esModule",{value:!0});Ps.extendSchema=DW;Ps.extendSchemaImpl=jO;Ps.getDescription=Qn;var OW=Qi(bt()),AW=Qi(Hr()),wO=Qi(se()),Cs=Qi(Rd()),OO=Qi(et()),xW=Qi(jt()),Vt=Ee(),NW=Si(),RW=Ii(),AO=qn(),CW=Ui(),DO=Is(),xO=Mn(),LO=pr(),kO=qt(),Ac=gt(),xe=ie(),NO=_s();function Qi(e){return e&&e.__esModule?e:{default:e}}function RO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?RO(Object(r),!0).forEach(function(n){PW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):RO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function DW(e,t,r){(0,xO.assertSchema)(e),t!=null&&t.kind===Vt.Kind.DOCUMENT||(0,xW.default)(0,"Must provide valid Document AST."),r?.assumeValid!==!0&&r?.assumeValidSDL!==!0&&(0,CW.assertValidSDLExtension)(t,e);var n=e.toConfig(),i=jO(n,t,r);return n===i?e:new xO.GraphQLSchema(i)}function jO(e,t,r){for(var n,i,o,s,a=[],u=Object.create(null),c=[],l,d=[],f=0,h=t.definitions;f<h.length;f++){var g=h[f];if(g.kind===Vt.Kind.SCHEMA_DEFINITION)l=g;else if(g.kind===Vt.Kind.SCHEMA_EXTENSION)d.push(g);else if((0,AO.isTypeDefinitionNode)(g))a.push(g);else if((0,AO.isTypeExtensionNode)(g)){var v=g.name.value,_=u[v];u[v]=_?_.concat([g]):[g]}else g.kind===Vt.Kind.DIRECTIVE_DEFINITION&&c.push(g)}if(Object.keys(u).length===0&&a.length===0&&c.length===0&&d.length===0&&l==null)return e;for(var S=Object.create(null),b=0,A=e.types;b<A.length;b++){var O=A[b];S[O.name]=ee(O)}for(var T=0;T<a.length;T++){var x,U=a[T],N=U.name.value;S[N]=(x=CO[N])!==null&&x!==void 0?x:aD(U)}var te=ue(ue({query:e.query&&ge(e.query),mutation:e.mutation&&ge(e.mutation),subscription:e.subscription&&ge(e.subscription)},l&&ov([l])),ov(d));return ue(ue({description:(n=l)===null||n===void 0||(i=n.description)===null||i===void 0?void 0:i.value},te),{},{types:(0,OW.default)(S),directives:[].concat(e.directives.map(I),c.map(sD)),extensions:void 0,astNode:(o=l)!==null&&o!==void 0?o:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(d),assumeValid:(s=r?.assumeValid)!==null&&s!==void 0?s:!1});function pe(w){return(0,xe.isListType)(w)?new xe.GraphQLList(pe(w.ofType)):(0,xe.isNonNullType)(w)?new xe.GraphQLNonNull(pe(w.ofType)):ge(w)}function ge(w){return S[w.name]}function I(w){var G=w.toConfig();return new Ac.GraphQLDirective(ue(ue({},G),{},{args:(0,Cs.default)(G.args,iv)}))}function ee(w){if((0,kO.isIntrospectionType)(w)||(0,LO.isSpecifiedScalarType)(w))return w;if((0,xe.isScalarType)(w))return rD(w);if((0,xe.isObjectType)(w))return nD(w);if((0,xe.isInterfaceType)(w))return iD(w);if((0,xe.isUnionType)(w))return oD(w);if((0,xe.isEnumType)(w))return En(w);if((0,xe.isInputObjectType)(w))return Re(w);(0,OO.default)(0,"Unexpected type: "+(0,wO.default)(w))}function Re(w){var G,L=w.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[];return new xe.GraphQLInputObjectType(ue(ue({},L),{},{fields:function(){return ue(ue({},(0,Cs.default)(L.fields,function(fe){return ue(ue({},fe),{},{type:pe(fe.type)})})),av(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function En(w){var G,L=w.toConfig(),V=(G=u[w.name])!==null&&G!==void 0?G:[];return new xe.GraphQLEnumType(ue(ue({},L),{},{values:ue(ue({},L.values),uv(V)),extensionASTNodes:L.extensionASTNodes.concat(V)}))}function rD(w){for(var G,L=w.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[],re=L.specifiedByUrl,fe=0;fe<V.length;fe++){var he,me=V[fe];re=(he=PO(me))!==null&&he!==void 0?he:re}return new xe.GraphQLScalarType(ue(ue({},L),{},{specifiedByUrl:re,extensionASTNodes:L.extensionASTNodes.concat(V)}))}function nD(w){var G,L=w.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[];return new xe.GraphQLObjectType(ue(ue({},L),{},{interfaces:function(){return[].concat(w.getInterfaces().map(ge),Ta(V))},fields:function(){return ue(ue({},(0,Cs.default)(L.fields,nv)),Sa(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function iD(w){var G,L=w.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[];return new xe.GraphQLInterfaceType(ue(ue({},L),{},{interfaces:function(){return[].concat(w.getInterfaces().map(ge),Ta(V))},fields:function(){return ue(ue({},(0,Cs.default)(L.fields,nv)),Sa(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function oD(w){var G,L=w.toConfig(),V=(G=u[L.name])!==null&&G!==void 0?G:[];return new xe.GraphQLUnionType(ue(ue({},L),{},{types:function(){return[].concat(w.getTypes().map(ge),cv(V))},extensionASTNodes:L.extensionASTNodes.concat(V)}))}function nv(w){return ue(ue({},w),{},{type:pe(w.type),args:(0,Cs.default)(w.args,iv)})}function iv(w){return ue(ue({},w),{},{type:pe(w.type)})}function ov(w){for(var G={},L=0;L<w.length;L++)for(var V,re=w[L],fe=(V=re.operationTypes)!==null&&V!==void 0?V:[],he=0;he<fe.length;he++){var me=fe[he];G[me.operation]=ba(me.type)}return G}function ba(w){var G,L=w.name.value,V=(G=CO[L])!==null&&G!==void 0?G:S[L];if(V===void 0)throw new Error('Unknown type: "'.concat(L,'".'));return V}function Oo(w){return w.kind===Vt.Kind.LIST_TYPE?new xe.GraphQLList(Oo(w.type)):w.kind===Vt.Kind.NON_NULL_TYPE?new xe.GraphQLNonNull(Oo(w.type)):ba(w)}function sD(w){var G=w.locations.map(function(L){var V=L.value;return V});return new Ac.GraphQLDirective({name:w.name.value,description:Qn(w,r),locations:G,isRepeatable:w.repeatable,args:sv(w.arguments),astNode:w})}function Sa(w){for(var G=Object.create(null),L=0;L<w.length;L++)for(var V,re=w[L],fe=(V=re.fields)!==null&&V!==void 0?V:[],he=0;he<fe.length;he++){var me=fe[he];G[me.name.value]={type:Oo(me.type),description:Qn(me,r),args:sv(me.arguments),deprecationReason:Oc(me),astNode:me}}return G}function sv(w){for(var G=w??[],L=Object.create(null),V=0;V<G.length;V++){var re=G[V],fe=Oo(re.type);L[re.name.value]={type:fe,description:Qn(re,r),defaultValue:(0,NO.valueFromAST)(re.defaultValue,fe),deprecationReason:Oc(re),astNode:re}}return L}function av(w){for(var G=Object.create(null),L=0;L<w.length;L++)for(var V,re=w[L],fe=(V=re.fields)!==null&&V!==void 0?V:[],he=0;he<fe.length;he++){var me=fe[he],Ao=Oo(me.type);G[me.name.value]={type:Ao,description:Qn(me,r),defaultValue:(0,NO.valueFromAST)(me.defaultValue,Ao),deprecationReason:Oc(me),astNode:me}}return G}function uv(w){for(var G=Object.create(null),L=0;L<w.length;L++)for(var V,re=w[L],fe=(V=re.values)!==null&&V!==void 0?V:[],he=0;he<fe.length;he++){var me=fe[he];G[me.name.value]={description:Qn(me,r),deprecationReason:Oc(me),astNode:me}}return G}function Ta(w){for(var G=[],L=0;L<w.length;L++)for(var V,re=w[L],fe=(V=re.interfaces)!==null&&V!==void 0?V:[],he=0;he<fe.length;he++){var me=fe[he];G.push(ba(me))}return G}function cv(w){for(var G=[],L=0;L<w.length;L++)for(var V,re=w[L],fe=(V=re.types)!==null&&V!==void 0?V:[],he=0;he<fe.length;he++){var me=fe[he];G.push(ba(me))}return G}function aD(w){var G,L=w.name.value,V=Qn(w,r),re=(G=u[L])!==null&&G!==void 0?G:[];switch(w.kind){case Vt.Kind.OBJECT_TYPE_DEFINITION:{var fe=re,he=[w].concat(fe);return new xe.GraphQLObjectType({name:L,description:V,interfaces:function(){return Ta(he)},fields:function(){return Sa(he)},astNode:w,extensionASTNodes:fe})}case Vt.Kind.INTERFACE_TYPE_DEFINITION:{var me=re,Ao=[w].concat(me);return new xe.GraphQLInterfaceType({name:L,description:V,interfaces:function(){return Ta(Ao)},fields:function(){return Sa(Ao)},astNode:w,extensionASTNodes:me})}case Vt.Kind.ENUM_TYPE_DEFINITION:{var lv=re,uD=[w].concat(lv);return new xe.GraphQLEnumType({name:L,description:V,values:uv(uD),astNode:w,extensionASTNodes:lv})}case Vt.Kind.UNION_TYPE_DEFINITION:{var pv=re,cD=[w].concat(pv);return new xe.GraphQLUnionType({name:L,description:V,types:function(){return cv(cD)},astNode:w,extensionASTNodes:pv})}case Vt.Kind.SCALAR_TYPE_DEFINITION:{var lD=re;return new xe.GraphQLScalarType({name:L,description:V,specifiedByUrl:PO(w),astNode:w,extensionASTNodes:lD})}case Vt.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var dv=re,pD=[w].concat(dv);return new xe.GraphQLInputObjectType({name:L,description:V,fields:function(){return av(pD)},astNode:w,extensionASTNodes:dv})}}(0,OO.default)(0,"Unexpected type definition node: "+(0,wO.default)(w))}}var CO=(0,AW.default)(LO.specifiedScalarTypes.concat(kO.introspectionTypes),function(e){return e.name});function Oc(e){var t=(0,DO.getDirectiveValues)(Ac.GraphQLDeprecatedDirective,e);return t?.reason}function PO(e){var t=(0,DO.getDirectiveValues)(Ac.GraphQLSpecifiedByDirective,e);return t?.url}function Qn(e,t){if(e.description)return e.description.value;if(t?.commentDescriptions===!0){var r=LW(e);if(r!==void 0)return(0,RW.dedentBlockStringValue)(`
|
|
177
|
+
`+r)}}function LW(e){var t=e.loc;if(t){for(var r=[],n=t.startToken.prev;n!=null&&n.kind===NW.TokenKind.COMMENT&&n.next&&n.prev&&n.line+1===n.next.line&&n.line!==n.prev.line;){var i=String(n.value);r.push(i),n=n.prev}return r.length>0?r.reverse().join(`
|
|
178
|
+
`):void 0}}});var qO=y(xc=>{"use strict";p();Object.defineProperty(xc,"__esModule",{value:!0});xc.buildASTSchema=FO;xc.buildSchema=GW;var kW=VW(jt()),jW=Ee(),MW=wi(),FW=Ui(),qW=Mn(),MO=gt(),UW=Am();function VW(e){return e&&e.__esModule?e:{default:e}}function FO(e,t){e!=null&&e.kind===jW.Kind.DOCUMENT||(0,kW.default)(0,"Must provide valid Document AST."),t?.assumeValid!==!0&&t?.assumeValidSDL!==!0&&(0,FW.assertValidSDL)(e);var r={description:void 0,types:[],directives:[],extensions:void 0,extensionASTNodes:[],assumeValid:!1},n=(0,UW.extendSchemaImpl)(r,e,t);if(n.astNode==null)for(var i=0,o=n.types;i<o.length;i++){var s=o[i];switch(s.name){case"Query":n.query=s;break;case"Mutation":n.mutation=s;break;case"Subscription":n.subscription=s;break}}for(var a=n.directives,u=function(d){var f=MO.specifiedDirectives[d];a.every(function(h){return h.name!==f.name})&&a.push(f)},c=0;c<MO.specifiedDirectives.length;c++)u(c);return new qW.GraphQLSchema(n)}function GW(e,t){var r=(0,MW.parse)(e,{noLocation:t?.noLocation,allowLegacySDLEmptyFields:t?.allowLegacySDLEmptyFields,allowLegacySDLImplementsInterfaces:t?.allowLegacySDLImplementsInterfaces,experimentalFragmentVariables:t?.experimentalFragmentVariables});return FO(r,{commentDescriptions:t?.commentDescriptions,assumeValidSDL:t?.assumeValidSDL,assumeValid:t?.assumeValid})}});var VO=y(Rm=>{"use strict";p();Object.defineProperty(Rm,"__esModule",{value:!0});Rm.lexicographicSortSchema=XW;var $W=Ds(bt()),BW=Ds(se()),KW=Ds(et()),HW=Ds(Jo()),QW=Ds(Xo()),WW=Mn(),zW=gt(),YW=qt(),pt=ie();function Ds(e){return e&&e.__esModule?e:{default:e}}function UO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ue(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?UO(Object(r),!0).forEach(function(n){JW(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):UO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function JW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XW(e){var t=e.toConfig(),r=(0,HW.default)(xm(t.types),function(f){return f.name},d);return new WW.GraphQLSchema(Ue(Ue({},t),{},{types:(0,$W.default)(r),directives:xm(t.directives).map(s),query:o(t.query),mutation:o(t.mutation),subscription:o(t.subscription)}));function n(f){return(0,pt.isListType)(f)?new pt.GraphQLList(n(f.ofType)):(0,pt.isNonNullType)(f)?new pt.GraphQLNonNull(n(f.ofType)):i(f)}function i(f){return r[f.name]}function o(f){return f&&i(f)}function s(f){var h=f.toConfig();return new zW.GraphQLDirective(Ue(Ue({},h),{},{locations:Nm(h.locations,function(g){return g}),args:a(h.args)}))}function a(f){return Nc(f,function(h){return Ue(Ue({},h),{},{type:n(h.type)})})}function u(f){return Nc(f,function(h){return Ue(Ue({},h),{},{type:n(h.type),args:a(h.args)})})}function c(f){return Nc(f,function(h){return Ue(Ue({},h),{},{type:n(h.type)})})}function l(f){return xm(f).map(i)}function d(f){if((0,pt.isScalarType)(f)||(0,YW.isIntrospectionType)(f))return f;if((0,pt.isObjectType)(f)){var h=f.toConfig();return new pt.GraphQLObjectType(Ue(Ue({},h),{},{interfaces:function(){return l(h.interfaces)},fields:function(){return u(h.fields)}}))}if((0,pt.isInterfaceType)(f)){var g=f.toConfig();return new pt.GraphQLInterfaceType(Ue(Ue({},g),{},{interfaces:function(){return l(g.interfaces)},fields:function(){return u(g.fields)}}))}if((0,pt.isUnionType)(f)){var v=f.toConfig();return new pt.GraphQLUnionType(Ue(Ue({},v),{},{types:function(){return l(v.types)}}))}if((0,pt.isEnumType)(f)){var _=f.toConfig();return new pt.GraphQLEnumType(Ue(Ue({},_),{},{values:Nc(_.values)}))}if((0,pt.isInputObjectType)(f)){var S=f.toConfig();return new pt.GraphQLInputObjectType(Ue(Ue({},S),{},{fields:function(){return c(S.fields)}}))}(0,KW.default)(0,"Unexpected type: "+(0,BW.default)(f))}}function Nc(e,t){for(var r=Object.create(null),n=Nm(Object.keys(e),function(a){return a}),i=0;i<n.length;i++){var o=n[i],s=e[o];r[o]=t?t(s):s}return r}function xm(e){return Nm(e,function(t){return t.name})}function Nm(e,t){return e.slice().sort(function(r,n){var i=t(r),o=t(n);return(0,QW.default)(i,o)})}});var zO=y(Ls=>{"use strict";p();Object.defineProperty(Ls,"__esModule",{value:!0});Ls.printSchema=tz;Ls.printIntrospectionSchema=rz;Ls.printType=KO;var Pm=Mm(bt()),ZW=Mm(se()),GO=Mm(et()),Dm=mt(),ez=Ii(),$O=qt(),Lm=pr(),km=gt(),Wi=ie(),jm=cs();function Mm(e){return e&&e.__esModule?e:{default:e}}function tz(e,t){return BO(e,function(r){return!(0,km.isSpecifiedDirective)(r)},nz,t)}function rz(e,t){return BO(e,km.isSpecifiedDirective,$O.isIntrospectionType,t)}function nz(e){return!(0,Lm.isSpecifiedScalarType)(e)&&!(0,$O.isIntrospectionType)(e)}function BO(e,t,r,n){var i=e.getDirectives().filter(t),o=(0,Pm.default)(e.getTypeMap()).filter(r);return[iz(e)].concat(i.map(function(s){return dz(s,n)}),o.map(function(s){return KO(s,n)})).filter(Boolean).join(`
|
|
179
179
|
|
|
180
180
|
`)+`
|
|
181
|
-
`}function
|
|
181
|
+
`}function iz(e){if(!(e.description==null&&oz(e))){var t=[],r=e.getQueryType();r&&t.push(" query: ".concat(r.name));var n=e.getMutationType();n&&t.push(" mutation: ".concat(n.name));var i=e.getSubscriptionType();return i&&t.push(" subscription: ".concat(i.name)),Gt({},e)+`schema {
|
|
182
182
|
`.concat(t.join(`
|
|
183
183
|
`),`
|
|
184
|
-
}`)}}function
|
|
184
|
+
}`)}}function oz(e){var t=e.getQueryType();if(t&&t.name!=="Query")return!1;var r=e.getMutationType();if(r&&r.name!=="Mutation")return!1;var n=e.getSubscriptionType();return!(n&&n.name!=="Subscription")}function KO(e,t){if((0,Wi.isScalarType)(e))return sz(e,t);if((0,Wi.isObjectType)(e))return az(e,t);if((0,Wi.isInterfaceType)(e))return uz(e,t);if((0,Wi.isUnionType)(e))return cz(e,t);if((0,Wi.isEnumType)(e))return lz(e,t);if((0,Wi.isInputObjectType)(e))return pz(e,t);(0,GO.default)(0,"Unexpected type: "+(0,ZW.default)(e))}function sz(e,t){return Gt(t,e)+"scalar ".concat(e.name)+fz(e)}function HO(e){var t=e.getInterfaces();return t.length?" implements "+t.map(function(r){return r.name}).join(" & "):""}function az(e,t){return Gt(t,e)+"type ".concat(e.name)+HO(e)+QO(t,e)}function uz(e,t){return Gt(t,e)+"interface ".concat(e.name)+HO(e)+QO(t,e)}function cz(e,t){var r=e.getTypes(),n=r.length?" = "+r.join(" | "):"";return Gt(t,e)+"union "+e.name+n}function lz(e,t){var r=e.getValues().map(function(n,i){return Gt(t,n," ",!i)+" "+n.name+qm(n.deprecationReason)});return Gt(t,e)+"enum ".concat(e.name)+Fm(r)}function pz(e,t){var r=(0,Pm.default)(e.getFields()).map(function(n,i){return Gt(t,n," ",!i)+" "+Cm(n)});return Gt(t,e)+"input ".concat(e.name)+Fm(r)}function QO(e,t){var r=(0,Pm.default)(t.getFields()).map(function(n,i){return Gt(e,n," ",!i)+" "+n.name+WO(e,n.args," ")+": "+String(n.type)+qm(n.deprecationReason)});return Fm(r)}function Fm(e){return e.length!==0?` {
|
|
185
185
|
`+e.join(`
|
|
186
186
|
`)+`
|
|
187
|
-
}`:""}function
|
|
188
|
-
`+t.map(function(n,i){return Gt(e,n," "+r,!i)+" "+r+
|
|
187
|
+
}`:""}function WO(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return t.length===0?"":t.every(function(n){return!n.description})?"("+t.map(Cm).join(", ")+")":`(
|
|
188
|
+
`+t.map(function(n,i){return Gt(e,n," "+r,!i)+" "+r+Cm(n)}).join(`
|
|
189
189
|
`)+`
|
|
190
|
-
`+r+")"}function
|
|
190
|
+
`+r+")"}function Cm(e){var t=(0,jm.astFromValue)(e.defaultValue,e.type),r=e.name+": "+String(e.type);return t&&(r+=" = ".concat((0,Dm.print)(t))),r+qm(e.deprecationReason)}function dz(e,t){return Gt(t,e)+"directive @"+e.name+WO(t,e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}function qm(e){if(e==null)return"";var t=(0,jm.astFromValue)(e,Lm.GraphQLString);return t&&e!==km.DEFAULT_DEPRECATION_REASON?" @deprecated(reason: "+(0,Dm.print)(t)+")":" @deprecated"}function fz(e){if(e.specifiedByUrl==null)return"";var t=e.specifiedByUrl,r=(0,jm.astFromValue)(t,Lm.GraphQLString);return r||(0,GO.default)(0,"Unexpected null value returned from `astFromValue` for specifiedByUrl")," @specifiedBy(url: "+(0,Dm.print)(r)+")"}function Gt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=t.description;if(i==null)return"";if(e?.commentDescriptions===!0)return hz(i,r,n);var o=i.length>70,s=(0,ez.printBlockString)(i,"",o),a=r&&!n?`
|
|
191
191
|
`+r:r;return a+s.replace(/\n/g,`
|
|
192
192
|
`+r)+`
|
|
193
|
-
`}function
|
|
193
|
+
`}function hz(e,t,r){var n=t&&!r?`
|
|
194
194
|
`:"",i=e.split(`
|
|
195
195
|
`).map(function(o){return t+(o!==""?"# "+o:"#")}).join(`
|
|
196
196
|
`);return n+i+`
|
|
197
|
-
`}});var
|
|
197
|
+
`}});var YO=y(Um=>{"use strict";p();Object.defineProperty(Um,"__esModule",{value:!0});Um.concatAST=mz;function mz(e){for(var t=[],r=0;r<e.length;r++){var n=e[r];t=t.concat(n.definitions)}return{kind:"Document",definitions:t}}});var ZO=y(Vm=>{"use strict";p();Object.defineProperty(Vm,"__esModule",{value:!0});Vm.separateOperations=yz;var Rc=Ee(),gz=Kr();function yz(e){for(var t=[],r=Object.create(null),n=0,i=e.definitions;n<i.length;n++){var o=i[n];switch(o.kind){case Rc.Kind.OPERATION_DEFINITION:t.push(o);break;case Rc.Kind.FRAGMENT_DEFINITION:r[o.name.value]=JO(o.selectionSet);break}}for(var s=Object.create(null),a=function(l){for(var d=t[l],f=new Set,h=0,g=JO(d.selectionSet);h<g.length;h++){var v=g[h];XO(f,r,v)}var _=d.name?d.name.value:"";s[_]={kind:Rc.Kind.DOCUMENT,definitions:e.definitions.filter(function(S){return S===d||S.kind===Rc.Kind.FRAGMENT_DEFINITION&&f.has(S.name.value)})}},u=0;u<t.length;u++)a(u);return s}function XO(e,t,r){if(!e.has(r)){e.add(r);var n=t[r];if(n!==void 0)for(var i=0;i<n.length;i++){var o=n[i];XO(e,t,o)}}}function JO(e){var t=[];return(0,gz.visit)(e,{FragmentSpread:function(n){t.push(n.name.value)}}),t}});var n0=y($m=>{"use strict";p();Object.defineProperty($m,"__esModule",{value:!0});$m.stripIgnoredCharacters=vz;var e0=Su(),Gm=Si(),t0=wu(),r0=Ii();function vz(e){for(var t=(0,e0.isSource)(e)?e:new e0.Source(e),r=t.body,n=new t0.Lexer(t),i="",o=!1;n.advance().kind!==Gm.TokenKind.EOF;){var s=n.token,a=s.kind,u=!(0,t0.isPunctuatorTokenKind)(s.kind);o&&(u||s.kind===Gm.TokenKind.SPREAD)&&(i+=" ");var c=r.slice(s.start,s.end);a===Gm.TokenKind.BLOCK_STRING?i+=Ez(c):i+=c,o=u}return i}function Ez(e){var t=e.slice(3,-3),r=(0,r0.dedentBlockStringValue)(t);(0,r0.getBlockStringIndentation)(r)>0&&(r=`
|
|
198
198
|
`+r);var n=r[r.length-1],i=n==='"'&&r.slice(-4)!=='\\"""';return(i||n==="\\")&&(r+=`
|
|
199
|
-
`),'"""'+r+'"""'}});var u0=y(un=>{"use strict";p();Object.defineProperty(un,"__esModule",{value:!0});un.findBreakingChanges=Ez;un.findDangerousChanges=_z;un.DangerousChangeType=un.BreakingChangeType=void 0;var Wi=js(bt()),Zw=js(Hr()),dz=js(se()),s0=js(et()),fz=js(Jo()),hz=mt(),mz=Kr(),gz=pr(),ce=ie(),yz=us();function js(e){return e&&e.__esModule?e:{default:e}}function e0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function t0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?e0(Object(r),!0).forEach(function(n){vz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):e0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ue=Object.freeze({TYPE_REMOVED:"TYPE_REMOVED",TYPE_CHANGED_KIND:"TYPE_CHANGED_KIND",TYPE_REMOVED_FROM_UNION:"TYPE_REMOVED_FROM_UNION",VALUE_REMOVED_FROM_ENUM:"VALUE_REMOVED_FROM_ENUM",REQUIRED_INPUT_FIELD_ADDED:"REQUIRED_INPUT_FIELD_ADDED",IMPLEMENTED_INTERFACE_REMOVED:"IMPLEMENTED_INTERFACE_REMOVED",FIELD_REMOVED:"FIELD_REMOVED",FIELD_CHANGED_KIND:"FIELD_CHANGED_KIND",REQUIRED_ARG_ADDED:"REQUIRED_ARG_ADDED",ARG_REMOVED:"ARG_REMOVED",ARG_CHANGED_KIND:"ARG_CHANGED_KIND",DIRECTIVE_REMOVED:"DIRECTIVE_REMOVED",DIRECTIVE_ARG_REMOVED:"DIRECTIVE_ARG_REMOVED",REQUIRED_DIRECTIVE_ARG_ADDED:"REQUIRED_DIRECTIVE_ARG_ADDED",DIRECTIVE_REPEATABLE_REMOVED:"DIRECTIVE_REPEATABLE_REMOVED",DIRECTIVE_LOCATION_REMOVED:"DIRECTIVE_LOCATION_REMOVED"});un.BreakingChangeType=Ue;var Nr=Object.freeze({VALUE_ADDED_TO_ENUM:"VALUE_ADDED_TO_ENUM",TYPE_ADDED_TO_UNION:"TYPE_ADDED_TO_UNION",OPTIONAL_INPUT_FIELD_ADDED:"OPTIONAL_INPUT_FIELD_ADDED",OPTIONAL_ARG_ADDED:"OPTIONAL_ARG_ADDED",IMPLEMENTED_INTERFACE_ADDED:"IMPLEMENTED_INTERFACE_ADDED",ARG_DEFAULT_VALUE_CHANGE:"ARG_DEFAULT_VALUE_CHANGE"});un.DangerousChangeType=Nr;function Ez(e,t){var r=a0(e,t).filter(function(n){return n.type in Ue});return r}function _z(e,t){var r=a0(e,t).filter(function(n){return n.type in Nr});return r}function a0(e,t){return[].concat(Sz(e,t),bz(e,t))}function bz(e,t){for(var r=[],n=Rr(e.getDirectives(),t.getDirectives()),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ue.DIRECTIVE_REMOVED,description:"".concat(s.name," was removed.")})}for(var a=0,u=n.persisted;a<u.length;a++){for(var c=u[a],l=c[0],d=c[1],f=Rr(l.args,d.args),h=0,g=f.added;h<g.length;h++){var v=g[h];(0,ce.isRequiredArgument)(v)&&r.push({type:Ue.REQUIRED_DIRECTIVE_ARG_ADDED,description:"A required arg ".concat(v.name," on directive ").concat(l.name," was added.")})}for(var _=0,S=f.removed;_<S.length;_++){var b=S[_];r.push({type:Ue.DIRECTIVE_ARG_REMOVED,description:"".concat(b.name," was removed from ").concat(l.name,".")})}l.isRepeatable&&!d.isRepeatable&&r.push({type:Ue.DIRECTIVE_REPEATABLE_REMOVED,description:"Repeatable flag was removed from ".concat(l.name,".")});for(var A=0,w=l.locations;A<w.length;A++){var T=w[A];d.locations.indexOf(T)===-1&&r.push({type:Ue.DIRECTIVE_LOCATION_REMOVED,description:"".concat(T," was removed from ").concat(l.name,".")})}}return r}function Sz(e,t){for(var r=[],n=Rr((0,Wi.default)(e.getTypeMap()),(0,Wi.default)(t.getTypeMap())),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ue.TYPE_REMOVED,description:(0,gz.isSpecifiedScalarType)(s)?"Standard scalar ".concat(s.name," was removed because it is not referenced anymore."):"".concat(s.name," was removed.")})}for(var a=0,u=n.persisted;a<u.length;a++){var c=u[a],l=c[0],d=c[1];(0,ce.isEnumType)(l)&&(0,ce.isEnumType)(d)?r.push.apply(r,Oz(l,d)):(0,ce.isUnionType)(l)&&(0,ce.isUnionType)(d)?r.push.apply(r,Iz(l,d)):(0,ce.isInputObjectType)(l)&&(0,ce.isInputObjectType)(d)?r.push.apply(r,Tz(l,d)):(0,ce.isObjectType)(l)&&(0,ce.isObjectType)(d)||(0,ce.isInterfaceType)(l)&&(0,ce.isInterfaceType)(d)?r.push.apply(r,n0(l,d).concat(r0(l,d))):l.constructor!==d.constructor&&r.push({type:Ue.TYPE_CHANGED_KIND,description:"".concat(l.name," changed from ")+"".concat(i0(l)," to ").concat(i0(d),".")})}return r}function Tz(e,t){for(var r=[],n=Rr((0,Wi.default)(e.getFields()),(0,Wi.default)(t.getFields())),i=0,o=n.added;i<o.length;i++){var s=o[i];(0,ce.isRequiredInputField)(s)?r.push({type:Ue.REQUIRED_INPUT_FIELD_ADDED,description:"A required field ".concat(s.name," on input type ").concat(e.name," was added.")}):r.push({type:Nr.OPTIONAL_INPUT_FIELD_ADDED,description:"An optional field ".concat(s.name," on input type ").concat(e.name," was added.")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ue.FIELD_REMOVED,description:"".concat(e.name,".").concat(c.name," was removed.")})}for(var l=0,d=n.persisted;l<d.length;l++){var f=d[l],h=f[0],g=f[1],v=ks(h.type,g.type);v||r.push({type:Ue.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(h.name," changed type from ")+"".concat(String(h.type)," to ").concat(String(g.type),".")})}return r}function Iz(e,t){for(var r=[],n=Rr(e.getTypes(),t.getTypes()),i=0,o=n.added;i<o.length;i++){var s=o[i];r.push({type:Nr.TYPE_ADDED_TO_UNION,description:"".concat(s.name," was added to union type ").concat(e.name,".")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ue.TYPE_REMOVED_FROM_UNION,description:"".concat(c.name," was removed from union type ").concat(e.name,".")})}return r}function Oz(e,t){for(var r=[],n=Rr(e.getValues(),t.getValues()),i=0,o=n.added;i<o.length;i++){var s=o[i];r.push({type:Nr.VALUE_ADDED_TO_ENUM,description:"".concat(s.name," was added to enum type ").concat(e.name,".")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ue.VALUE_REMOVED_FROM_ENUM,description:"".concat(c.name," was removed from enum type ").concat(e.name,".")})}return r}function r0(e,t){for(var r=[],n=Rr(e.getInterfaces(),t.getInterfaces()),i=0,o=n.added;i<o.length;i++){var s=o[i];r.push({type:Nr.IMPLEMENTED_INTERFACE_ADDED,description:"".concat(s.name," added to interfaces implemented by ").concat(e.name,".")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ue.IMPLEMENTED_INTERFACE_REMOVED,description:"".concat(e.name," no longer implements interface ").concat(c.name,".")})}return r}function n0(e,t){for(var r=[],n=Rr((0,Wi.default)(e.getFields()),(0,Wi.default)(t.getFields())),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ue.FIELD_REMOVED,description:"".concat(e.name,".").concat(s.name," was removed.")})}for(var a=0,u=n.persisted;a<u.length;a++){var c=u[a],l=c[0],d=c[1];r.push.apply(r,wz(e,l,d));var f=Ls(l.type,d.type);f||r.push({type:Ue.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(l.name," changed type from ")+"".concat(String(l.type)," to ").concat(String(d.type),".")})}return r}function wz(e,t,r){for(var n=[],i=Rr(t.args,r.args),o=0,s=i.removed;o<s.length;o++){var a=s[o];n.push({type:Ue.ARG_REMOVED,description:"".concat(e.name,".").concat(t.name," arg ").concat(a.name," was removed.")})}for(var u=0,c=i.persisted;u<c.length;u++){var l=c[u],d=l[0],f=l[1],h=ks(d.type,f.type);if(!h)n.push({type:Ue.ARG_CHANGED_KIND,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," has changed type from ")+"".concat(String(d.type)," to ").concat(String(f.type),".")});else if(d.defaultValue!==void 0)if(f.defaultValue===void 0)n.push({type:Nr.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," defaultValue was removed.")});else{var g=o0(d.defaultValue,d.type),v=o0(f.defaultValue,f.type);g!==v&&n.push({type:Nr.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," has changed defaultValue from ").concat(g," to ").concat(v,".")})}}for(var _=0,S=i.added;_<S.length;_++){var b=S[_];(0,ce.isRequiredArgument)(b)?n.push({type:Ue.REQUIRED_ARG_ADDED,description:"A required arg ".concat(b.name," on ").concat(e.name,".").concat(t.name," was added.")}):n.push({type:Nr.OPTIONAL_ARG_ADDED,description:"An optional arg ".concat(b.name," on ").concat(e.name,".").concat(t.name," was added.")})}return n}function Ls(e,t){return(0,ce.isListType)(e)?(0,ce.isListType)(t)&&Ls(e.ofType,t.ofType)||(0,ce.isNonNullType)(t)&&Ls(e,t.ofType):(0,ce.isNonNullType)(e)?(0,ce.isNonNullType)(t)&&Ls(e.ofType,t.ofType):(0,ce.isNamedType)(t)&&e.name===t.name||(0,ce.isNonNullType)(t)&&Ls(e,t.ofType)}function ks(e,t){return(0,ce.isListType)(e)?(0,ce.isListType)(t)&&ks(e.ofType,t.ofType):(0,ce.isNonNullType)(e)?(0,ce.isNonNullType)(t)&&ks(e.ofType,t.ofType)||!(0,ce.isNonNullType)(t)&&ks(e.ofType,t):(0,ce.isNamedType)(t)&&e.name===t.name}function i0(e){if((0,ce.isScalarType)(e))return"a Scalar type";if((0,ce.isObjectType)(e))return"an Object type";if((0,ce.isInterfaceType)(e))return"an Interface type";if((0,ce.isUnionType)(e))return"a Union type";if((0,ce.isEnumType)(e))return"an Enum type";if((0,ce.isInputObjectType)(e))return"an Input type";(0,s0.default)(0,"Unexpected type: "+(0,dz.default)(e))}function o0(e,t){var r=(0,yz.astFromValue)(e,t);r!=null||(0,s0.default)(0);var n=(0,mz.visit)(r,{ObjectValue:function(o){var s=[].concat(o.fields);return s.sort(function(a,u){return(0,fz.default)(a.name.value,u.name.value)}),t0(t0({},o),{},{fields:s})}});return(0,hz.print)(n)}function Rr(e,t){for(var r=[],n=[],i=[],o=(0,Zw.default)(e,function(f){var h=f.name;return h}),s=(0,Zw.default)(t,function(f){var h=f.name;return h}),a=0;a<e.length;a++){var u=e[a],c=s[u.name];c===void 0?n.push(u):i.push([u,c])}for(var l=0;l<t.length;l++){var d=t[l];o[d.name]===void 0&&r.push(d)}return{added:r,persisted:i,removed:n}}});var c0=y(Vm=>{"use strict";p();Object.defineProperty(Vm,"__esModule",{value:!0});Vm.findDeprecatedUsages=Nz;var Az=qi(),xz=mm();function Nz(e,t){return(0,Az.validate)(e,t,[xz.NoDeprecatedCustomRule])}});var h0=y(ne=>{"use strict";p();Object.defineProperty(ne,"__esModule",{value:!0});Object.defineProperty(ne,"getIntrospectionQuery",{enumerable:!0,get:function(){return Rz.getIntrospectionQuery}});Object.defineProperty(ne,"getOperationAST",{enumerable:!0,get:function(){return Cz.getOperationAST}});Object.defineProperty(ne,"getOperationRootType",{enumerable:!0,get:function(){return Pz.getOperationRootType}});Object.defineProperty(ne,"introspectionFromSchema",{enumerable:!0,get:function(){return Dz.introspectionFromSchema}});Object.defineProperty(ne,"buildClientSchema",{enumerable:!0,get:function(){return Lz.buildClientSchema}});Object.defineProperty(ne,"buildASTSchema",{enumerable:!0,get:function(){return l0.buildASTSchema}});Object.defineProperty(ne,"buildSchema",{enumerable:!0,get:function(){return l0.buildSchema}});Object.defineProperty(ne,"extendSchema",{enumerable:!0,get:function(){return p0.extendSchema}});Object.defineProperty(ne,"getDescription",{enumerable:!0,get:function(){return p0.getDescription}});Object.defineProperty(ne,"lexicographicSortSchema",{enumerable:!0,get:function(){return kz.lexicographicSortSchema}});Object.defineProperty(ne,"printSchema",{enumerable:!0,get:function(){return Gm.printSchema}});Object.defineProperty(ne,"printType",{enumerable:!0,get:function(){return Gm.printType}});Object.defineProperty(ne,"printIntrospectionSchema",{enumerable:!0,get:function(){return Gm.printIntrospectionSchema}});Object.defineProperty(ne,"typeFromAST",{enumerable:!0,get:function(){return jz.typeFromAST}});Object.defineProperty(ne,"valueFromAST",{enumerable:!0,get:function(){return Mz.valueFromAST}});Object.defineProperty(ne,"valueFromASTUntyped",{enumerable:!0,get:function(){return Fz.valueFromASTUntyped}});Object.defineProperty(ne,"astFromValue",{enumerable:!0,get:function(){return qz.astFromValue}});Object.defineProperty(ne,"TypeInfo",{enumerable:!0,get:function(){return d0.TypeInfo}});Object.defineProperty(ne,"visitWithTypeInfo",{enumerable:!0,get:function(){return d0.visitWithTypeInfo}});Object.defineProperty(ne,"coerceInputValue",{enumerable:!0,get:function(){return Uz.coerceInputValue}});Object.defineProperty(ne,"concatAST",{enumerable:!0,get:function(){return Vz.concatAST}});Object.defineProperty(ne,"separateOperations",{enumerable:!0,get:function(){return Gz.separateOperations}});Object.defineProperty(ne,"stripIgnoredCharacters",{enumerable:!0,get:function(){return Bz.stripIgnoredCharacters}});Object.defineProperty(ne,"isEqualType",{enumerable:!0,get:function(){return Bm.isEqualType}});Object.defineProperty(ne,"isTypeSubTypeOf",{enumerable:!0,get:function(){return Bm.isTypeSubTypeOf}});Object.defineProperty(ne,"doTypesOverlap",{enumerable:!0,get:function(){return Bm.doTypesOverlap}});Object.defineProperty(ne,"assertValidName",{enumerable:!0,get:function(){return f0.assertValidName}});Object.defineProperty(ne,"isValidNameError",{enumerable:!0,get:function(){return f0.isValidNameError}});Object.defineProperty(ne,"BreakingChangeType",{enumerable:!0,get:function(){return Nc.BreakingChangeType}});Object.defineProperty(ne,"DangerousChangeType",{enumerable:!0,get:function(){return Nc.DangerousChangeType}});Object.defineProperty(ne,"findBreakingChanges",{enumerable:!0,get:function(){return Nc.findBreakingChanges}});Object.defineProperty(ne,"findDangerousChanges",{enumerable:!0,get:function(){return Nc.findDangerousChanges}});Object.defineProperty(ne,"findDeprecatedUsages",{enumerable:!0,get:function(){return $z.findDeprecatedUsages}});var Rz=Em(),Cz=bm(),Pz=lc(),Dz=yw(),Lz=Ew(),l0=Lw(),p0=Im(),kz=jw(),Gm=$w(),jz=dr(),Mz=Es(),Fz=qd(),qz=us(),d0=Yu(),Uz=tm(),Vz=Kw(),Gz=Ww(),Bz=Xw(),Bm=rs(),f0=Id(),Nc=u0(),$z=c0()});var Qn=y(E=>{"use strict";p();Object.defineProperty(E,"__esModule",{value:!0});Object.defineProperty(E,"version",{enumerable:!0,get:function(){return m0.version}});Object.defineProperty(E,"versionInfo",{enumerable:!0,get:function(){return m0.versionInfo}});Object.defineProperty(E,"graphql",{enumerable:!0,get:function(){return g0.graphql}});Object.defineProperty(E,"graphqlSync",{enumerable:!0,get:function(){return g0.graphqlSync}});Object.defineProperty(E,"GraphQLSchema",{enumerable:!0,get:function(){return P.GraphQLSchema}});Object.defineProperty(E,"GraphQLDirective",{enumerable:!0,get:function(){return P.GraphQLDirective}});Object.defineProperty(E,"GraphQLScalarType",{enumerable:!0,get:function(){return P.GraphQLScalarType}});Object.defineProperty(E,"GraphQLObjectType",{enumerable:!0,get:function(){return P.GraphQLObjectType}});Object.defineProperty(E,"GraphQLInterfaceType",{enumerable:!0,get:function(){return P.GraphQLInterfaceType}});Object.defineProperty(E,"GraphQLUnionType",{enumerable:!0,get:function(){return P.GraphQLUnionType}});Object.defineProperty(E,"GraphQLEnumType",{enumerable:!0,get:function(){return P.GraphQLEnumType}});Object.defineProperty(E,"GraphQLInputObjectType",{enumerable:!0,get:function(){return P.GraphQLInputObjectType}});Object.defineProperty(E,"GraphQLList",{enumerable:!0,get:function(){return P.GraphQLList}});Object.defineProperty(E,"GraphQLNonNull",{enumerable:!0,get:function(){return P.GraphQLNonNull}});Object.defineProperty(E,"specifiedScalarTypes",{enumerable:!0,get:function(){return P.specifiedScalarTypes}});Object.defineProperty(E,"GraphQLInt",{enumerable:!0,get:function(){return P.GraphQLInt}});Object.defineProperty(E,"GraphQLFloat",{enumerable:!0,get:function(){return P.GraphQLFloat}});Object.defineProperty(E,"GraphQLString",{enumerable:!0,get:function(){return P.GraphQLString}});Object.defineProperty(E,"GraphQLBoolean",{enumerable:!0,get:function(){return P.GraphQLBoolean}});Object.defineProperty(E,"GraphQLID",{enumerable:!0,get:function(){return P.GraphQLID}});Object.defineProperty(E,"specifiedDirectives",{enumerable:!0,get:function(){return P.specifiedDirectives}});Object.defineProperty(E,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return P.GraphQLIncludeDirective}});Object.defineProperty(E,"GraphQLSkipDirective",{enumerable:!0,get:function(){return P.GraphQLSkipDirective}});Object.defineProperty(E,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return P.GraphQLDeprecatedDirective}});Object.defineProperty(E,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return P.GraphQLSpecifiedByDirective}});Object.defineProperty(E,"TypeKind",{enumerable:!0,get:function(){return P.TypeKind}});Object.defineProperty(E,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return P.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(E,"introspectionTypes",{enumerable:!0,get:function(){return P.introspectionTypes}});Object.defineProperty(E,"__Schema",{enumerable:!0,get:function(){return P.__Schema}});Object.defineProperty(E,"__Directive",{enumerable:!0,get:function(){return P.__Directive}});Object.defineProperty(E,"__DirectiveLocation",{enumerable:!0,get:function(){return P.__DirectiveLocation}});Object.defineProperty(E,"__Type",{enumerable:!0,get:function(){return P.__Type}});Object.defineProperty(E,"__Field",{enumerable:!0,get:function(){return P.__Field}});Object.defineProperty(E,"__InputValue",{enumerable:!0,get:function(){return P.__InputValue}});Object.defineProperty(E,"__EnumValue",{enumerable:!0,get:function(){return P.__EnumValue}});Object.defineProperty(E,"__TypeKind",{enumerable:!0,get:function(){return P.__TypeKind}});Object.defineProperty(E,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return P.SchemaMetaFieldDef}});Object.defineProperty(E,"TypeMetaFieldDef",{enumerable:!0,get:function(){return P.TypeMetaFieldDef}});Object.defineProperty(E,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return P.TypeNameMetaFieldDef}});Object.defineProperty(E,"isSchema",{enumerable:!0,get:function(){return P.isSchema}});Object.defineProperty(E,"isDirective",{enumerable:!0,get:function(){return P.isDirective}});Object.defineProperty(E,"isType",{enumerable:!0,get:function(){return P.isType}});Object.defineProperty(E,"isScalarType",{enumerable:!0,get:function(){return P.isScalarType}});Object.defineProperty(E,"isObjectType",{enumerable:!0,get:function(){return P.isObjectType}});Object.defineProperty(E,"isInterfaceType",{enumerable:!0,get:function(){return P.isInterfaceType}});Object.defineProperty(E,"isUnionType",{enumerable:!0,get:function(){return P.isUnionType}});Object.defineProperty(E,"isEnumType",{enumerable:!0,get:function(){return P.isEnumType}});Object.defineProperty(E,"isInputObjectType",{enumerable:!0,get:function(){return P.isInputObjectType}});Object.defineProperty(E,"isListType",{enumerable:!0,get:function(){return P.isListType}});Object.defineProperty(E,"isNonNullType",{enumerable:!0,get:function(){return P.isNonNullType}});Object.defineProperty(E,"isInputType",{enumerable:!0,get:function(){return P.isInputType}});Object.defineProperty(E,"isOutputType",{enumerable:!0,get:function(){return P.isOutputType}});Object.defineProperty(E,"isLeafType",{enumerable:!0,get:function(){return P.isLeafType}});Object.defineProperty(E,"isCompositeType",{enumerable:!0,get:function(){return P.isCompositeType}});Object.defineProperty(E,"isAbstractType",{enumerable:!0,get:function(){return P.isAbstractType}});Object.defineProperty(E,"isWrappingType",{enumerable:!0,get:function(){return P.isWrappingType}});Object.defineProperty(E,"isNullableType",{enumerable:!0,get:function(){return P.isNullableType}});Object.defineProperty(E,"isNamedType",{enumerable:!0,get:function(){return P.isNamedType}});Object.defineProperty(E,"isRequiredArgument",{enumerable:!0,get:function(){return P.isRequiredArgument}});Object.defineProperty(E,"isRequiredInputField",{enumerable:!0,get:function(){return P.isRequiredInputField}});Object.defineProperty(E,"isSpecifiedScalarType",{enumerable:!0,get:function(){return P.isSpecifiedScalarType}});Object.defineProperty(E,"isIntrospectionType",{enumerable:!0,get:function(){return P.isIntrospectionType}});Object.defineProperty(E,"isSpecifiedDirective",{enumerable:!0,get:function(){return P.isSpecifiedDirective}});Object.defineProperty(E,"assertSchema",{enumerable:!0,get:function(){return P.assertSchema}});Object.defineProperty(E,"assertDirective",{enumerable:!0,get:function(){return P.assertDirective}});Object.defineProperty(E,"assertType",{enumerable:!0,get:function(){return P.assertType}});Object.defineProperty(E,"assertScalarType",{enumerable:!0,get:function(){return P.assertScalarType}});Object.defineProperty(E,"assertObjectType",{enumerable:!0,get:function(){return P.assertObjectType}});Object.defineProperty(E,"assertInterfaceType",{enumerable:!0,get:function(){return P.assertInterfaceType}});Object.defineProperty(E,"assertUnionType",{enumerable:!0,get:function(){return P.assertUnionType}});Object.defineProperty(E,"assertEnumType",{enumerable:!0,get:function(){return P.assertEnumType}});Object.defineProperty(E,"assertInputObjectType",{enumerable:!0,get:function(){return P.assertInputObjectType}});Object.defineProperty(E,"assertListType",{enumerable:!0,get:function(){return P.assertListType}});Object.defineProperty(E,"assertNonNullType",{enumerable:!0,get:function(){return P.assertNonNullType}});Object.defineProperty(E,"assertInputType",{enumerable:!0,get:function(){return P.assertInputType}});Object.defineProperty(E,"assertOutputType",{enumerable:!0,get:function(){return P.assertOutputType}});Object.defineProperty(E,"assertLeafType",{enumerable:!0,get:function(){return P.assertLeafType}});Object.defineProperty(E,"assertCompositeType",{enumerable:!0,get:function(){return P.assertCompositeType}});Object.defineProperty(E,"assertAbstractType",{enumerable:!0,get:function(){return P.assertAbstractType}});Object.defineProperty(E,"assertWrappingType",{enumerable:!0,get:function(){return P.assertWrappingType}});Object.defineProperty(E,"assertNullableType",{enumerable:!0,get:function(){return P.assertNullableType}});Object.defineProperty(E,"assertNamedType",{enumerable:!0,get:function(){return P.assertNamedType}});Object.defineProperty(E,"getNullableType",{enumerable:!0,get:function(){return P.getNullableType}});Object.defineProperty(E,"getNamedType",{enumerable:!0,get:function(){return P.getNamedType}});Object.defineProperty(E,"validateSchema",{enumerable:!0,get:function(){return P.validateSchema}});Object.defineProperty(E,"assertValidSchema",{enumerable:!0,get:function(){return P.assertValidSchema}});Object.defineProperty(E,"Token",{enumerable:!0,get:function(){return be.Token}});Object.defineProperty(E,"Source",{enumerable:!0,get:function(){return be.Source}});Object.defineProperty(E,"Location",{enumerable:!0,get:function(){return be.Location}});Object.defineProperty(E,"getLocation",{enumerable:!0,get:function(){return be.getLocation}});Object.defineProperty(E,"printLocation",{enumerable:!0,get:function(){return be.printLocation}});Object.defineProperty(E,"printSourceLocation",{enumerable:!0,get:function(){return be.printSourceLocation}});Object.defineProperty(E,"Lexer",{enumerable:!0,get:function(){return be.Lexer}});Object.defineProperty(E,"TokenKind",{enumerable:!0,get:function(){return be.TokenKind}});Object.defineProperty(E,"parse",{enumerable:!0,get:function(){return be.parse}});Object.defineProperty(E,"parseValue",{enumerable:!0,get:function(){return be.parseValue}});Object.defineProperty(E,"parseType",{enumerable:!0,get:function(){return be.parseType}});Object.defineProperty(E,"print",{enumerable:!0,get:function(){return be.print}});Object.defineProperty(E,"visit",{enumerable:!0,get:function(){return be.visit}});Object.defineProperty(E,"visitInParallel",{enumerable:!0,get:function(){return be.visitInParallel}});Object.defineProperty(E,"getVisitFn",{enumerable:!0,get:function(){return be.getVisitFn}});Object.defineProperty(E,"BREAK",{enumerable:!0,get:function(){return be.BREAK}});Object.defineProperty(E,"Kind",{enumerable:!0,get:function(){return be.Kind}});Object.defineProperty(E,"DirectiveLocation",{enumerable:!0,get:function(){return be.DirectiveLocation}});Object.defineProperty(E,"isDefinitionNode",{enumerable:!0,get:function(){return be.isDefinitionNode}});Object.defineProperty(E,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return be.isExecutableDefinitionNode}});Object.defineProperty(E,"isSelectionNode",{enumerable:!0,get:function(){return be.isSelectionNode}});Object.defineProperty(E,"isValueNode",{enumerable:!0,get:function(){return be.isValueNode}});Object.defineProperty(E,"isTypeNode",{enumerable:!0,get:function(){return be.isTypeNode}});Object.defineProperty(E,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return be.isTypeSystemDefinitionNode}});Object.defineProperty(E,"isTypeDefinitionNode",{enumerable:!0,get:function(){return be.isTypeDefinitionNode}});Object.defineProperty(E,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return be.isTypeSystemExtensionNode}});Object.defineProperty(E,"isTypeExtensionNode",{enumerable:!0,get:function(){return be.isTypeExtensionNode}});Object.defineProperty(E,"execute",{enumerable:!0,get:function(){return zi.execute}});Object.defineProperty(E,"executeSync",{enumerable:!0,get:function(){return zi.executeSync}});Object.defineProperty(E,"defaultFieldResolver",{enumerable:!0,get:function(){return zi.defaultFieldResolver}});Object.defineProperty(E,"defaultTypeResolver",{enumerable:!0,get:function(){return zi.defaultTypeResolver}});Object.defineProperty(E,"responsePathAsArray",{enumerable:!0,get:function(){return zi.responsePathAsArray}});Object.defineProperty(E,"getDirectiveValues",{enumerable:!0,get:function(){return zi.getDirectiveValues}});Object.defineProperty(E,"subscribe",{enumerable:!0,get:function(){return y0.subscribe}});Object.defineProperty(E,"createSourceEventStream",{enumerable:!0,get:function(){return y0.createSourceEventStream}});Object.defineProperty(E,"validate",{enumerable:!0,get:function(){return J.validate}});Object.defineProperty(E,"ValidationContext",{enumerable:!0,get:function(){return J.ValidationContext}});Object.defineProperty(E,"specifiedRules",{enumerable:!0,get:function(){return J.specifiedRules}});Object.defineProperty(E,"recommendedRules",{enumerable:!0,get:function(){return J.recommendedRules}});Object.defineProperty(E,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return J.ExecutableDefinitionsRule}});Object.defineProperty(E,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return J.FieldsOnCorrectTypeRule}});Object.defineProperty(E,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return J.FragmentsOnCompositeTypesRule}});Object.defineProperty(E,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return J.KnownArgumentNamesRule}});Object.defineProperty(E,"KnownDirectivesRule",{enumerable:!0,get:function(){return J.KnownDirectivesRule}});Object.defineProperty(E,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return J.KnownFragmentNamesRule}});Object.defineProperty(E,"KnownTypeNamesRule",{enumerable:!0,get:function(){return J.KnownTypeNamesRule}});Object.defineProperty(E,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return J.LoneAnonymousOperationRule}});Object.defineProperty(E,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return J.NoFragmentCyclesRule}});Object.defineProperty(E,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return J.NoUndefinedVariablesRule}});Object.defineProperty(E,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return J.NoUnusedFragmentsRule}});Object.defineProperty(E,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return J.NoUnusedVariablesRule}});Object.defineProperty(E,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return J.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(E,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return J.PossibleFragmentSpreadsRule}});Object.defineProperty(E,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return J.ProvidedRequiredArgumentsRule}});Object.defineProperty(E,"ScalarLeafsRule",{enumerable:!0,get:function(){return J.ScalarLeafsRule}});Object.defineProperty(E,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return J.SingleFieldSubscriptionsRule}});Object.defineProperty(E,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return J.UniqueArgumentNamesRule}});Object.defineProperty(E,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return J.UniqueDirectivesPerLocationRule}});Object.defineProperty(E,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return J.UniqueFragmentNamesRule}});Object.defineProperty(E,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return J.UniqueInputFieldNamesRule}});Object.defineProperty(E,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return J.UniqueOperationNamesRule}});Object.defineProperty(E,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return J.UniqueVariableNamesRule}});Object.defineProperty(E,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return J.ValuesOfCorrectTypeRule}});Object.defineProperty(E,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return J.VariablesAreInputTypesRule}});Object.defineProperty(E,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return J.VariablesInAllowedPositionRule}});Object.defineProperty(E,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return J.MaxIntrospectionDepthRule}});Object.defineProperty(E,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return J.LoneSchemaDefinitionRule}});Object.defineProperty(E,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return J.UniqueOperationTypesRule}});Object.defineProperty(E,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return J.UniqueTypeNamesRule}});Object.defineProperty(E,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return J.UniqueEnumValueNamesRule}});Object.defineProperty(E,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return J.UniqueFieldDefinitionNamesRule}});Object.defineProperty(E,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return J.UniqueDirectiveNamesRule}});Object.defineProperty(E,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return J.PossibleTypeExtensionsRule}});Object.defineProperty(E,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return J.NoDeprecatedCustomRule}});Object.defineProperty(E,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return J.NoSchemaIntrospectionCustomRule}});Object.defineProperty(E,"GraphQLError",{enumerable:!0,get:function(){return Ms.GraphQLError}});Object.defineProperty(E,"syntaxError",{enumerable:!0,get:function(){return Ms.syntaxError}});Object.defineProperty(E,"locatedError",{enumerable:!0,get:function(){return Ms.locatedError}});Object.defineProperty(E,"printError",{enumerable:!0,get:function(){return Ms.printError}});Object.defineProperty(E,"formatError",{enumerable:!0,get:function(){return Ms.formatError}});Object.defineProperty(E,"getIntrospectionQuery",{enumerable:!0,get:function(){return oe.getIntrospectionQuery}});Object.defineProperty(E,"getOperationAST",{enumerable:!0,get:function(){return oe.getOperationAST}});Object.defineProperty(E,"getOperationRootType",{enumerable:!0,get:function(){return oe.getOperationRootType}});Object.defineProperty(E,"introspectionFromSchema",{enumerable:!0,get:function(){return oe.introspectionFromSchema}});Object.defineProperty(E,"buildClientSchema",{enumerable:!0,get:function(){return oe.buildClientSchema}});Object.defineProperty(E,"buildASTSchema",{enumerable:!0,get:function(){return oe.buildASTSchema}});Object.defineProperty(E,"buildSchema",{enumerable:!0,get:function(){return oe.buildSchema}});Object.defineProperty(E,"getDescription",{enumerable:!0,get:function(){return oe.getDescription}});Object.defineProperty(E,"extendSchema",{enumerable:!0,get:function(){return oe.extendSchema}});Object.defineProperty(E,"lexicographicSortSchema",{enumerable:!0,get:function(){return oe.lexicographicSortSchema}});Object.defineProperty(E,"printSchema",{enumerable:!0,get:function(){return oe.printSchema}});Object.defineProperty(E,"printType",{enumerable:!0,get:function(){return oe.printType}});Object.defineProperty(E,"printIntrospectionSchema",{enumerable:!0,get:function(){return oe.printIntrospectionSchema}});Object.defineProperty(E,"typeFromAST",{enumerable:!0,get:function(){return oe.typeFromAST}});Object.defineProperty(E,"valueFromAST",{enumerable:!0,get:function(){return oe.valueFromAST}});Object.defineProperty(E,"valueFromASTUntyped",{enumerable:!0,get:function(){return oe.valueFromASTUntyped}});Object.defineProperty(E,"astFromValue",{enumerable:!0,get:function(){return oe.astFromValue}});Object.defineProperty(E,"TypeInfo",{enumerable:!0,get:function(){return oe.TypeInfo}});Object.defineProperty(E,"visitWithTypeInfo",{enumerable:!0,get:function(){return oe.visitWithTypeInfo}});Object.defineProperty(E,"coerceInputValue",{enumerable:!0,get:function(){return oe.coerceInputValue}});Object.defineProperty(E,"concatAST",{enumerable:!0,get:function(){return oe.concatAST}});Object.defineProperty(E,"separateOperations",{enumerable:!0,get:function(){return oe.separateOperations}});Object.defineProperty(E,"stripIgnoredCharacters",{enumerable:!0,get:function(){return oe.stripIgnoredCharacters}});Object.defineProperty(E,"isEqualType",{enumerable:!0,get:function(){return oe.isEqualType}});Object.defineProperty(E,"isTypeSubTypeOf",{enumerable:!0,get:function(){return oe.isTypeSubTypeOf}});Object.defineProperty(E,"doTypesOverlap",{enumerable:!0,get:function(){return oe.doTypesOverlap}});Object.defineProperty(E,"assertValidName",{enumerable:!0,get:function(){return oe.assertValidName}});Object.defineProperty(E,"isValidNameError",{enumerable:!0,get:function(){return oe.isValidNameError}});Object.defineProperty(E,"BreakingChangeType",{enumerable:!0,get:function(){return oe.BreakingChangeType}});Object.defineProperty(E,"DangerousChangeType",{enumerable:!0,get:function(){return oe.DangerousChangeType}});Object.defineProperty(E,"findBreakingChanges",{enumerable:!0,get:function(){return oe.findBreakingChanges}});Object.defineProperty(E,"findDangerousChanges",{enumerable:!0,get:function(){return oe.findDangerousChanges}});Object.defineProperty(E,"findDeprecatedUsages",{enumerable:!0,get:function(){return oe.findDeprecatedUsages}});var m0=TS(),g0=GO(),P=$O(),be=QO(),zi=WO(),y0=uw(),J=pw(),Ms=hw(),oe=h0()});var P0=y((Yoe,Cr)=>{p();var Wm=M("fs"),Lc=M("path"),Jz=M("os"),Xz=M("crypto"),A0=["\u25C8 encrypted .env [www.dotenvx.com]","\u25C8 secrets for agents [www.dotenvx.com]","\u2301 auth for agents [www.vestauth.com]","\u2318 custom filepath { path: '/custom/path/.env' }","\u2318 enable debugging { debug: true }","\u2318 override existing { override: true }","\u2318 suppress logs { quiet: true }","\u2318 multiple files { path: ['.env.local', '.env'] }"];function Zz(){return A0[Math.floor(Math.random()*A0.length)]}function Yi(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function eY(){return process.stdout.isTTY}function tY(e){return eY()?`\x1B[2m${e}\x1B[0m`:e}var rY=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function nY(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|
200
|
-
`);let n;for(;(n=
|
|
201
|
-
`),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function iY(e){e=e||{};let t=C0(e);e.path=t;let r=He.configDotenv(e);if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=R0(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),u=sY(r,a);o=He.decrypt(u.ciphertext,u.key);break}catch(a){if(s+1>=i)throw a}return He.parse(o)}function oY(e){console.error(`\u26A0 ${e}`)}function Us(e){console.log(`\u2506 ${e}`)}function N0(e){console.log(`\u25C7 ${e}`)}function R0(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function sY(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let u=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw u.code="INVALID_DOTENV_KEY",u}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function C0(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)Wm.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=Lc.resolve(process.cwd(),".env.vault");return Wm.existsSync(t)?t:null}function x0(e){return e[0]==="~"?Lc.join(Jz.homedir(),e.slice(1)):e}function aY(e){let t=Yi(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=Yi(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&N0("loading env from encrypted .env.vault");let n=He._parseVault(e),i=process.env;return e&&e.processEnv!=null&&(i=e.processEnv),He.populate(i,n,e),{parsed:n}}function uY(e){let t=Lc.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let i=Yi(n.DOTENV_CONFIG_DEBUG||e&&e.debug),o=Yi(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:i&&Us("no encoding is specified (UTF-8 is used by default)");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[x0(e.path)];else{s=[];for(let l of e.path)s.push(x0(l))}let a,u={};for(let l of s)try{let d=He.parse(Wm.readFileSync(l,{encoding:r}));He.populate(u,d,e)}catch(d){i&&Us(`failed to load ${l} ${d.message}`),a=d}let c=He.populate(n,u,e);if(i=Yi(n.DOTENV_CONFIG_DEBUG||i),o=Yi(n.DOTENV_CONFIG_QUIET||o),i||!o){let l=Object.keys(c).length,d=[];for(let f of s)try{let h=Lc.relative(process.cwd(),f);d.push(h)}catch(h){i&&Us(`failed to load ${f} ${h.message}`),a=h}N0(`injected env (${l}) from ${d.join(",")} ${tY(`// tip: ${Zz()}`)}`)}return a?{parsed:u,error:a}:{parsed:u}}function cY(e){if(R0(e).length===0)return He.configDotenv(e);let t=C0(e);return t?He._configVault(e):(oY(`you set DOTENV_KEY but you are missing a .env.vault file at ${t}`),He.configDotenv(e))}function lY(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=Xz.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,u=s.message==="Invalid key length",c=s.message==="Unsupported state or unable to authenticate data";if(a||u){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(c){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw s}}function pY(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override),o={};if(typeof t!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(e,s)?(i===!0&&(e[s]=t[s],o[s]=t[s]),n&&Us(i===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):(e[s]=t[s],o[s]=t[s]);return o}var He={configDotenv:uY,_configVault:aY,_parseVault:iY,config:cY,decrypt:lY,parse:nY,populate:pY};Cr.exports.configDotenv=He.configDotenv;Cr.exports._configVault=He._configVault;Cr.exports._parseVault=He._parseVault;Cr.exports.config=He.config;Cr.exports.decrypt=He.decrypt;Cr.exports.parse=He.parse;Cr.exports.populate=He.populate;Cr.exports=He});var IA=y((hse,TA)=>{p();TA.exports=Xi;function Xi(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Xi.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-r:e+r}return Math.min(e,this.max)|0};Xi.prototype.reset=function(){this.attempts=0};Xi.prototype.setMin=function(e){this.ms=e};Xi.prototype.setMax=function(e){this.max=e};Xi.prototype.setJitter=function(e){this.jitter=e}});var wA=y((gse,Jm)=>{"use strict";p();var yY=Object.prototype.hasOwnProperty,dt="~";function Vs(){}Object.create&&(Vs.prototype=Object.create(null),new Vs().__proto__||(dt=!1));function vY(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function OA(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new vY(r,n||e,i),s=dt?dt+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function Fc(e,t){--e._eventsCount===0?e._events=new Vs:delete e._events[t]}function ot(){this._events=new Vs,this._eventsCount=0}ot.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)yY.call(r,n)&&t.push(dt?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};ot.prototype.listeners=function(t){var r=dt?dt+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s};ot.prototype.listenerCount=function(t){var r=dt?dt+t:t,n=this._events[r];return n?n.fn?1:n.length:0};ot.prototype.emit=function(t,r,n,i,o,s){var a=dt?dt+t:t;if(!this._events[a])return!1;var u=this._events[a],c=arguments.length,l,d;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,r),!0;case 3:return u.fn.call(u.context,r,n),!0;case 4:return u.fn.call(u.context,r,n,i),!0;case 5:return u.fn.call(u.context,r,n,i,o),!0;case 6:return u.fn.call(u.context,r,n,i,o,s),!0}for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];u.fn.apply(u.context,l)}else{var f=u.length,h;for(d=0;d<f;d++)switch(u[d].once&&this.removeListener(t,u[d].fn,void 0,!0),c){case 1:u[d].fn.call(u[d].context);break;case 2:u[d].fn.call(u[d].context,r);break;case 3:u[d].fn.call(u[d].context,r,n);break;case 4:u[d].fn.call(u[d].context,r,n,i);break;default:if(!l)for(h=1,l=new Array(c-1);h<c;h++)l[h-1]=arguments[h];u[d].fn.apply(u[d].context,l)}}return!0};ot.prototype.on=function(t,r,n){return OA(this,t,r,n,!1)};ot.prototype.once=function(t,r,n){return OA(this,t,r,n,!0)};ot.prototype.removeListener=function(t,r,n,i){var o=dt?dt+t:t;if(!this._events[o])return this;if(!r)return Fc(this,o),this;var s=this._events[o];if(s.fn)s.fn===r&&(!i||s.once)&&(!n||s.context===n)&&Fc(this,o);else{for(var a=0,u=[],c=s.length;a<c;a++)(s[a].fn!==r||i&&!s[a].once||n&&s[a].context!==n)&&u.push(s[a]);u.length?this._events[o]=u.length===1?u[0]:u:Fc(this,o)}return this};ot.prototype.removeAllListeners=function(t){var r;return t?(r=dt?dt+t:t,this._events[r]&&Fc(this,r)):(this._events=new Vs,this._eventsCount=0),this};ot.prototype.off=ot.prototype.removeListener;ot.prototype.addListener=ot.prototype.on;ot.prefixed=dt;ot.EventEmitter=ot;typeof Jm<"u"&&(Jm.exports=ot)});var AA=y(Xm=>{"use strict";p();Object.defineProperty(Xm,"__esModule",{value:!0});function EY(e){return typeof e=="string"}Xm.default=EY});var eg=y(Zm=>{"use strict";p();Object.defineProperty(Zm,"__esModule",{value:!0});function _Y(e){return e!==null&&typeof e=="object"}Zm.default=_Y});var xA=y(tg=>{"use strict";p();Object.defineProperty(tg,"__esModule",{value:!0});tg.default=bY;function bY(e){var t,r=e.Symbol;return typeof r=="function"?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}});var NA=y((ng,rg)=>{"use strict";p();Object.defineProperty(ng,"__esModule",{value:!0});var SY=xA(),TY=IY(SY);function IY(e){return e&&e.__esModule?e:{default:e}}var Zi;typeof self<"u"?Zi=self:typeof window<"u"?Zi=window:typeof global<"u"?Zi=global:typeof rg<"u"?Zi=rg:Zi=Function("return this")();var OY=(0,TY.default)(Zi);ng.default=OY});var qc=y(eo=>{"use strict";p();Object.defineProperty(eo,"__esModule",{value:!0});eo.GRAPHQL_SUBSCRIPTIONS=eo.GRAPHQL_WS=void 0;var wY="graphql-ws";eo.GRAPHQL_WS=wY;var AY="graphql-subscriptions";eo.GRAPHQL_SUBSCRIPTIONS=AY});var RA=y(to=>{"use strict";p();Object.defineProperty(to,"__esModule",{value:!0});to.WS_TIMEOUT=to.MIN_WS_TIMEOUT=void 0;var xY=1e3;to.MIN_WS_TIMEOUT=xY;var NY=3e4;to.WS_TIMEOUT=NY});var Gs=y(ig=>{"use strict";p();Object.defineProperty(ig,"__esModule",{value:!0});var RY=(function(){function e(){throw new Error("Static Class")}return e.GQL_CONNECTION_INIT="connection_init",e.GQL_CONNECTION_ACK="connection_ack",e.GQL_CONNECTION_ERROR="connection_error",e.GQL_CONNECTION_KEEP_ALIVE="ka",e.GQL_CONNECTION_TERMINATE="connection_terminate",e.GQL_START="start",e.GQL_DATA="data",e.GQL_ERROR="error",e.GQL_COMPLETE="complete",e.GQL_STOP="stop",e.SUBSCRIPTION_START="subscription_start",e.SUBSCRIPTION_DATA="subscription_data",e.SUBSCRIPTION_SUCCESS="subscription_success",e.SUBSCRIPTION_FAIL="subscription_fail",e.SUBSCRIPTION_END="subscription_end",e.INIT="init",e.INIT_SUCCESS="init_success",e.INIT_FAIL="init_fail",e.KEEP_ALIVE="keepalive",e})();ig.default=RY});var jA=y(Bt=>{"use strict";p();var ro=Bt&&Bt.__assign||function(){return ro=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ro.apply(this,arguments)},CY=Bt&&Bt.__awaiter||function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(d){s(d)}}function u(l){try{c(n.throw(l))}catch(d){s(d)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(e,t||[])).next())})},PY=Bt&&Bt.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},CA=Bt&&Bt.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty(Bt,"__esModule",{value:!0});Bt.SubscriptionClient=void 0;var PA=typeof global<"u"?global:typeof window<"u"?window:{},DY=PA.WebSocket||PA.MozWebSocket,DA=IA(),LY=wA(),LA=AA(),kY=eg(),jY=mt(),MY=bm(),FY=NA(),qY=qc(),kA=RA(),ft=Gs(),UY=(function(){function e(t,r,n,i){var o=r||{},s=o.connectionCallback,a=s===void 0?void 0:s,u=o.connectionParams,c=u===void 0?{}:u,l=o.minTimeout,d=l===void 0?kA.MIN_WS_TIMEOUT:l,f=o.timeout,h=f===void 0?kA.WS_TIMEOUT:f,g=o.reconnect,v=g===void 0?!1:g,_=o.reconnectionAttempts,S=_===void 0?1/0:_,b=o.lazy,A=b===void 0?!1:b,w=o.inactivityTimeout,T=w===void 0?0:w,x=o.wsOptionArguments,U=x===void 0?[]:x;if(this.wsImpl=n||DY,!this.wsImpl)throw new Error("Unable to find native implementation, or alternative implementation for WebSocket!");this.wsProtocols=i||qY.GRAPHQL_WS,this.connectionCallback=a,this.url=t,this.operations={},this.nextOperationId=0,this.minWsTimeout=d,this.wsTimeout=h,this.unsentMessagesQueue=[],this.reconnect=v,this.reconnecting=!1,this.reconnectionAttempts=S,this.lazy=!!A,this.inactivityTimeout=T,this.closedByUser=!1,this.backoff=new DA({jitter:.5}),this.eventEmitter=new LY.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(c),this.wsOptionArguments=U,this.lazy||this.connect()}return Object.defineProperty(e.prototype,"status",{get:function(){return this.client===null?this.wsImpl.CLOSED:this.client.readyState},enumerable:!1,configurable:!0}),e.prototype.close=function(t,r){t===void 0&&(t=!0),r===void 0&&(r=!0),this.clearInactivityTimeout(),this.client!==null&&(this.closedByUser=r,t&&(this.clearCheckConnectionInterval(),this.clearMaxConnectTimeout(),this.clearTryReconnectTimeout(),this.unsubscribeAll(),this.sendMessage(void 0,ft.default.GQL_CONNECTION_TERMINATE,null)),this.client.close(),this.client.onopen=null,this.client.onclose=null,this.client.onerror=null,this.client.onmessage=null,this.client=null,this.eventEmitter.emit("disconnected"),t||this.tryReconnect())},e.prototype.request=function(t){var r,n=this.getObserver.bind(this),i=this.executeOperation.bind(this),o=this.unsubscribe.bind(this),s;return this.clearInactivityTimeout(),r={},r[FY.default]=function(){return this},r.subscribe=function(a,u,c){var l=n(a,u,c);return s=i(t,function(d,f){d===null&&f===null?l.complete&&l.complete():d?l.error&&l.error(d[0]):l.next&&l.next(f)}),{unsubscribe:function(){s&&(o(s),s=null)}}},r},e.prototype.on=function(t,r,n){var i=this.eventEmitter.on(t,r,n);return function(){i.off(t,r,n)}},e.prototype.onConnected=function(t,r){return this.on("connected",t,r)},e.prototype.onConnecting=function(t,r){return this.on("connecting",t,r)},e.prototype.onDisconnected=function(t,r){return this.on("disconnected",t,r)},e.prototype.onReconnected=function(t,r){return this.on("reconnected",t,r)},e.prototype.onReconnecting=function(t,r){return this.on("reconnecting",t,r)},e.prototype.onError=function(t,r){return this.on("error",t,r)},e.prototype.unsubscribeAll=function(){var t=this;Object.keys(this.operations).forEach(function(r){t.unsubscribe(r)})},e.prototype.applyMiddlewares=function(t){var r=this;return new Promise(function(n,i){var o=function(s,a){var u=function(c){if(c)i(c);else if(s.length>0){var l=s.shift();l&&l.applyMiddleware.apply(a,[t,u])}else n(t)};u()};o(CA([],r.middlewares,!0),r)})},e.prototype.use=function(t){var r=this;return t.map(function(n){if(typeof n.applyMiddleware=="function")r.middlewares.push(n);else throw new Error("Middleware must implement the applyMiddleware function.")}),this},e.prototype.getConnectionParams=function(t){return function(){return new Promise(function(r,n){if(typeof t=="function")try{return r(t.call(null))}catch(i){return n(i)}r(t)})}},e.prototype.executeOperation=function(t,r){var n=this;this.client===null&&this.connect();var i=this.generateOperationId();return this.operations[i]={options:t,handler:r},this.applyMiddlewares(t).then(function(o){n.checkOperationOptions(o,r),n.operations[i]&&(n.operations[i]={options:o,handler:r},n.sendMessage(i,ft.default.GQL_START,o))}).catch(function(o){n.unsubscribe(i),r(n.formatErrors(o))}),i},e.prototype.getObserver=function(t,r,n){return typeof t=="function"?{next:function(i){return t(i)},error:function(i){return r&&r(i)},complete:function(){return n&&n()}}:t},e.prototype.createMaxConnectTimeGenerator=function(){var t=this.minWsTimeout,r=this.wsTimeout;return new DA({min:t,max:r,factor:1.2})},e.prototype.clearCheckConnectionInterval=function(){this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnectionIntervalId=null)},e.prototype.clearMaxConnectTimeout=function(){this.maxConnectTimeoutId&&(clearTimeout(this.maxConnectTimeoutId),this.maxConnectTimeoutId=null)},e.prototype.clearTryReconnectTimeout=function(){this.tryReconnectTimeoutId&&(clearTimeout(this.tryReconnectTimeoutId),this.tryReconnectTimeoutId=null)},e.prototype.clearInactivityTimeout=function(){this.inactivityTimeoutId&&(clearTimeout(this.inactivityTimeoutId),this.inactivityTimeoutId=null)},e.prototype.setInactivityTimeout=function(){var t=this;this.inactivityTimeout>0&&Object.keys(this.operations).length===0&&(this.inactivityTimeoutId=setTimeout(function(){Object.keys(t.operations).length===0&&t.close()},this.inactivityTimeout))},e.prototype.checkOperationOptions=function(t,r){var n=t.query,i=t.variables,o=t.operationName;if(!n)throw new Error("Must provide a query.");if(!r)throw new Error("Must provide an handler.");if(!(0,LA.default)(n)&&!(0,MY.getOperationAST)(n,o)||o&&!(0,LA.default)(o)||i&&!(0,kY.default)(i))throw new Error("Incorrect option types. query must be a string or a document,`operationName` must be a string, and `variables` must be an object.")},e.prototype.buildMessage=function(t,r,n){var i=n&&n.query?ro(ro({},n),{query:typeof n.query=="string"?n.query:(0,jY.print)(n.query)}):n;return{id:t,type:r,payload:i}},e.prototype.formatErrors=function(t){return Array.isArray(t)?t:t&&t.errors?this.formatErrors(t.errors):t&&t.message?[t]:[{name:"FormatedError",message:"Unknown error",originalError:t}]},e.prototype.sendMessage=function(t,r,n){this.sendMessageRaw(this.buildMessage(t,r,n))},e.prototype.sendMessageRaw=function(t){switch(this.status){case this.wsImpl.OPEN:var r=JSON.stringify(t);try{JSON.parse(r)}catch{this.eventEmitter.emit("error",new Error("Message must be JSON-serializable. Got: "+t))}this.client.send(r);break;case this.wsImpl.CONNECTING:this.unsentMessagesQueue.push(t);break;default:this.reconnecting||this.eventEmitter.emit("error",new Error("A message was not sent because socket is not connected, is closing or is already closed. Message was: "+JSON.stringify(t)))}},e.prototype.generateOperationId=function(){return String(++this.nextOperationId)},e.prototype.tryReconnect=function(){var t=this;if(!(!this.reconnect||this.backoff.attempts>=this.reconnectionAttempts)){this.reconnecting||(Object.keys(this.operations).forEach(function(n){t.unsentMessagesQueue.push(t.buildMessage(n,ft.default.GQL_START,t.operations[n].options))}),this.reconnecting=!0),this.clearTryReconnectTimeout();var r=this.backoff.duration();this.tryReconnectTimeoutId=setTimeout(function(){t.connect()},r)}},e.prototype.flushUnsentMessagesQueue=function(){var t=this;this.unsentMessagesQueue.forEach(function(r){t.sendMessageRaw(r)}),this.unsentMessagesQueue=[]},e.prototype.checkConnection=function(){if(this.wasKeepAliveReceived){this.wasKeepAliveReceived=!1;return}this.reconnecting||this.close(!1,!0)},e.prototype.checkMaxConnectTimeout=function(){var t=this;this.clearMaxConnectTimeout(),this.maxConnectTimeoutId=setTimeout(function(){t.status!==t.wsImpl.OPEN&&(t.reconnecting=!0,t.close(!1,!0))},this.maxConnectTimeGenerator.duration())},e.prototype.connect=function(){var t,r=this;this.client=new((t=this.wsImpl).bind.apply(t,CA([void 0,this.url,this.wsProtocols],this.wsOptionArguments,!1))),this.checkMaxConnectTimeout(),this.client.onopen=function(){return CY(r,void 0,void 0,function(){var n,i;return PY(this,function(o){switch(o.label){case 0:if(this.status!==this.wsImpl.OPEN)return[3,4];this.clearMaxConnectTimeout(),this.closedByUser=!1,this.eventEmitter.emit(this.reconnecting?"reconnecting":"connecting"),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.connectionParams()];case 2:return n=o.sent(),this.sendMessage(void 0,ft.default.GQL_CONNECTION_INIT,n),this.flushUnsentMessagesQueue(),[3,4];case 3:return i=o.sent(),this.sendMessage(void 0,ft.default.GQL_CONNECTION_ERROR,i),this.flushUnsentMessagesQueue(),[3,4];case 4:return[2]}})})},this.client.onclose=function(){r.closedByUser||r.close(!1,!1)},this.client.onerror=function(n){r.eventEmitter.emit("error",n)},this.client.onmessage=function(n){var i=n.data;r.processReceivedData(i)}},e.prototype.processReceivedData=function(t){var r,n;try{r=JSON.parse(t),n=r.id}catch{throw new Error("Message must be JSON-parseable. Got: "+t)}if([ft.default.GQL_DATA,ft.default.GQL_COMPLETE,ft.default.GQL_ERROR].indexOf(r.type)!==-1&&!this.operations[n]){this.unsubscribe(n);return}switch(r.type){case ft.default.GQL_CONNECTION_ERROR:this.connectionCallback&&this.connectionCallback(r.payload);break;case ft.default.GQL_CONNECTION_ACK:this.eventEmitter.emit(this.reconnecting?"reconnected":"connected",r.payload),this.reconnecting=!1,this.backoff.reset(),this.maxConnectTimeGenerator.reset(),this.connectionCallback&&this.connectionCallback();break;case ft.default.GQL_COMPLETE:var i=this.operations[n].handler;delete this.operations[n],i.call(this,null,null);break;case ft.default.GQL_ERROR:this.operations[n].handler(this.formatErrors(r.payload),null),delete this.operations[n];break;case ft.default.GQL_DATA:var o=r.payload.errors?ro(ro({},r.payload),{errors:this.formatErrors(r.payload.errors)}):r.payload;this.operations[n].handler(null,o);break;case ft.default.GQL_CONNECTION_KEEP_ALIVE:var s=typeof this.wasKeepAliveReceived>"u";this.wasKeepAliveReceived=!0,s&&this.checkConnection(),this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnection()),this.checkConnectionIntervalId=setInterval(this.checkConnection.bind(this),this.wsTimeout);break;default:throw new Error("Invalid message type!")}},e.prototype.unsubscribe=function(t){this.operations[t]&&(delete this.operations[t],this.setInactivityTimeout(),this.sendMessage(t,ft.default.GQL_STOP,void 0))},e})();Bt.SubscriptionClient=UY});var zn=y((Dse,MA)=>{"use strict";p();MA.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}});var Bs=y((kse,og)=>{"use strict";p();var{EMPTY_BUFFER:VY}=zn();function FA(e,t){if(e.length===0)return VY;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let i=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return n<t?r.slice(0,n):r}function qA(e,t,r,n,i){for(let o=0;o<i;o++)r[n+o]=e[o]^t[o&3]}function UA(e,t){let r=e.length;for(let n=0;n<r;n++)e[n]^=t[n&3]}function VA(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function Uc(e){if(Uc.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=Buffer.from(e):ArrayBuffer.isView(e)?t=Buffer.from(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Uc.readOnly=!1),t}try{let e=M("bufferutil"),t=e.BufferUtil||e;og.exports={concat:FA,mask(r,n,i,o,s){s<48?qA(r,n,i,o,s):t.mask(r,n,i,o,s)},toArrayBuffer:VA,toBuffer:Uc,unmask(r,n){r.length<32?UA(r,n):t.unmask(r,n)}}}catch{og.exports={concat:FA,mask:qA,toArrayBuffer:VA,toBuffer:Uc,unmask:UA}}});var $A=y((Mse,BA)=>{"use strict";p();var GA=Symbol("kDone"),sg=Symbol("kRun"),ag=class{constructor(t){this[GA]=()=>{this.pending--,this[sg]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[sg]()}[sg](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[GA])}}};BA.exports=ag});var Hs=y((qse,WA)=>{"use strict";p();var $s=M("zlib"),KA=Bs(),GY=$A(),{kStatusCode:HA,NOOP:BY}=zn(),$Y=Buffer.from([0,0,255,255]),Bc=Symbol("permessage-deflate"),Pr=Symbol("total-length"),Ks=Symbol("callback"),cn=Symbol("buffers"),Gc=Symbol("error"),Vc,ug=class{constructor(t,r,n){if(this._maxPayload=n|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!Vc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Vc=new GY(i)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Ks];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),t}decompress(t,r,n){Vc.add(i=>{this._decompress(t,r,(o,s)=>{i(),n(o,s)})})}compress(t,r,n){Vc.add(i=>{this._compress(t,r,(o,s)=>{i(),n(o,s)})})}_decompress(t,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?$s.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=$s.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Bc]=this,this._inflate[Pr]=0,this._inflate[cn]=[],this._inflate.on("error",HY),this._inflate.on("data",QA)}this._inflate[Ks]=n,this._inflate.write(t),r&&this._inflate.write($Y),this._inflate.flush(()=>{let o=this._inflate[Gc];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=KA.concat(this._inflate[cn],this._inflate[Pr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Pr]=0,this._inflate[cn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,s)})}_compress(t,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?$s.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=$s.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Pr]=0,this._deflate[cn]=[],this._deflate.on("error",BY),this._deflate.on("data",KY)}this._deflate[Ks]=n,this._deflate.write(t),this._deflate.flush($s.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=KA.concat(this._deflate[cn],this._deflate[Pr]);r&&(o=o.slice(0,o.length-4)),this._deflate[Ks]=null,this._deflate[Pr]=0,this._deflate[cn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};WA.exports=ug;function KY(e){this[cn].push(e),this[Pr]+=e.length}function QA(e){if(this[Pr]+=e.length,this[Bc]._maxPayload<1||this[Pr]<=this[Bc]._maxPayload){this[cn].push(e);return}this[Gc]=new RangeError("Max payload size exceeded"),this[Gc].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Gc][HA]=1009,this.removeListener("data",QA),this.reset()}function HY(e){this[Bc]._inflate=null,e[HA]=1007,this[Ks](e)}});var lg=y((Vse,cg)=>{"use strict";p();function zA(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function YA(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}try{let e=M("utf-8-validate");typeof e=="object"&&(e=e.Validation.isValidUTF8),cg.exports={isValidStatusCode:zA,isValidUTF8(t){return t.length<150?YA(t):e(t)}}}catch{cg.exports={isValidStatusCode:zA,isValidUTF8:YA}}});var hg=y((Bse,rx)=>{"use strict";p();var{Writable:QY}=M("stream"),JA=Hs(),{BINARY_TYPES:WY,EMPTY_BUFFER:zY,kStatusCode:YY,kWebSocket:JY}=zn(),{concat:pg,toArrayBuffer:XY,unmask:ZY}=Bs(),{isValidStatusCode:eJ,isValidUTF8:XA}=lg(),Qs=0,ZA=1,ex=2,tx=3,dg=4,tJ=5,fg=class extends QY{constructor(t,r,n,i,o,s){super(),this._binaryType=t||WY[0],this[JY]=void 0,this._extensions=r||{},this._isServer=!!n,this._maxBufferedChunks=o|0,this._maxFragments=s|0,this._maxPayload=i|0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=Qs,this._loop=!1}_write(t,r,n){if(this._opcode===8&&this._state==Qs)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks)return n(Le(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=n.slice(t),n.slice(0,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],i=r.length-t;t>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),i),this._buffers[0]=n.slice(t)),t-=n.length}while(t>0);return r}startLoop(t){let r;this._loop=!0;do switch(this._state){case Qs:r=this.getInfo();break;case ZA:r=this.getPayloadLength16();break;case ex:r=this.getPayloadLength64();break;case tx:this.getMask();break;case dg:r=this.getData(t);break;default:this._loop=!1;return}while(this._loop);t(r)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0)return this._loop=!1,Le(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");let r=(t[0]&64)===64;if(r&&!this._extensions[JA.extensionName])return this._loop=!1,Le(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(r)return this._loop=!1,Le(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,Le(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,Le(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,Le(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(r)return this._loop=!1,Le(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,Le(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,Le(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked)return this._loop=!1,Le(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,Le(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=ZA;else if(this._payloadLength===127)this._state=ex;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),r=t.readUInt32BE(0);return r>Math.pow(2,21)-1?(this._loop=!1,Le(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=r*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,Le(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=tx:this._state=dg}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=dg}getData(t){let r=zY;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&ZY(r,this._mask)}if(this._opcode>7)return this.controlMessage(r);if(this._compressed){this._state=tJ,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments)return this._loop=!1,Le(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");this._messageLength=this._totalPayloadLength,this._fragments.push(r)}return this.dataMessage()}decompress(t,r){this._extensions[JA.extensionName].decompress(t,this._fin,(i,o)=>{if(i)return r(i);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return r(Le(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));if(this._maxFragments>0&&this._fragments.length>=this._maxFragments)return r(Le(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));this._fragments.push(o)}let s=this.dataMessage();if(s)return r(s);this.startLoop(r)})}dataMessage(){if(this._fin){let t=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=pg(r,t):this._binaryType==="arraybuffer"?n=XY(pg(r,t)):n=r,this.emit("message",n)}else{let n=pg(r,t);if(!XA(n))return this._loop=!1,Le(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",n.toString())}}this._state=Qs}controlMessage(t){if(this._opcode===8)if(this._loop=!1,t.length===0)this.emit("conclude",1005,""),this.end();else{if(t.length===1)return Le(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{let r=t.readUInt16BE(0);if(!eJ(r))return Le(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let n=t.slice(2);if(!XA(n))return Le(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",r,n.toString()),this.end()}}else this._opcode===9?this.emit("ping",t):this.emit("pong",t);this._state=Qs}};rx.exports=fg;function Le(e,t,r,n,i){let o=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,Le),o.code=i,o[YY]=n,o}});var gg=y((Qse,ox)=>{"use strict";p();var Kse=M("net"),Hse=M("tls"),{randomFillSync:rJ}=M("crypto"),nx=Hs(),{EMPTY_BUFFER:nJ}=zn(),{isValidStatusCode:iJ}=lg(),{mask:ix,toBuffer:Dr}=Bs(),Yn=Buffer.alloc(4),mg=class e{constructor(t,r){this._extensions=r||{},this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,r){let n=r.mask&&r.readOnly,i=r.mask?6:2,o=t.length;t.length>=65536?(i+=8,o=127):t.length>125&&(i+=2,o=126);let s=Buffer.allocUnsafe(n?t.length+i:i);return s[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(s[0]|=64),s[1]=o,o===126?s.writeUInt16BE(t.length,2):o===127&&(s.writeUInt32BE(0,2),s.writeUInt32BE(t.length,6)),r.mask?(rJ(Yn,0,4),s[1]|=128,s[i-4]=Yn[0],s[i-3]=Yn[1],s[i-2]=Yn[2],s[i-1]=Yn[3],n?(ix(t,Yn,s,i,t.length),[s]):(ix(t,Yn,t,0,t.length),[s,t])):[s,t]}close(t,r,n,i){let o;if(t===void 0)o=nJ;else{if(typeof t!="number"||!iJ(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||r==="")o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let s=Buffer.byteLength(r);if(s>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+s),o.writeUInt16BE(t,0),o.write(r,2)}}this._deflating?this.enqueue([this.doClose,o,n,i]):this.doClose(o,n,i)}doClose(t,r,n){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:8,mask:r,readOnly:!1}),n)}ping(t,r,n){let i=Dr(t);if(i.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,i,r,Dr.readOnly,n]):this.doPing(i,r,Dr.readOnly,n)}doPing(t,r,n,i){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:9,mask:r,readOnly:n}),i)}pong(t,r,n){let i=Dr(t);if(i.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,i,r,Dr.readOnly,n]):this.doPong(i,r,Dr.readOnly,n)}doPong(t,r,n,i){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:10,mask:r,readOnly:n}),i)}send(t,r,n){let i=Dr(t),o=this._extensions[nx.extensionName],s=r.binary?2:1,a=r.compress;if(this._firstFragment?(this._firstFragment=!1,a&&o&&(a=i.length>=o._threshold),this._compress=a):(a=!1,s=0),r.fin&&(this._firstFragment=!0),o){let u={fin:r.fin,rsv1:a,opcode:s,mask:r.mask,readOnly:Dr.readOnly};this._deflating?this.enqueue([this.dispatch,i,this._compress,u,n]):this.dispatch(i,this._compress,u,n)}else this.sendFrame(e.frame(i,{fin:r.fin,rsv1:!1,opcode:s,mask:r.mask,readOnly:Dr.readOnly}),n)}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let o=this._extensions[nx.extensionName];this._bufferedBytes+=t.length,this._deflating=!0,o.compress(t,n.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");typeof i=="function"&&i(u);for(let c=0;c<this._queue.length;c++){let l=this._queue[c][4];typeof l=="function"&&l(u)}return}this._bufferedBytes-=t.length,this._deflating=!1,n.readOnly=!1,this.sendFrame(e.frame(a,n),i),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[1].length,Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[1].length,this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};ox.exports=mg});var ax=y((zse,sx)=>{"use strict";p();var no=class{constructor(t,r){this.target=r,this.type=t}},yg=class extends no{constructor(t,r){super("message",r),this.data=t}},vg=class extends no{constructor(t,r,n){super("close",n),this.wasClean=n._closeFrameReceived&&n._closeFrameSent,this.reason=r,this.code=t}},Eg=class extends no{constructor(t){super("open",t)}},_g=class extends no{constructor(t,r){super("error",r),this.message=t.message,this.error=t}},oJ={addEventListener(e,t,r){if(typeof t!="function")return;function n(u){t.call(this,new yg(u,this))}function i(u,c){t.call(this,new vg(u,c,this))}function o(u){t.call(this,new _g(u,this))}function s(){t.call(this,new Eg(this))}let a=r&&r.once?"once":"on";e==="message"?(n._listener=t,this[a](e,n)):e==="close"?(i._listener=t,this[a](e,i)):e==="error"?(o._listener=t,this[a](e,o)):e==="open"?(s._listener=t,this[a](e,s)):this[a](e,t)},removeEventListener(e,t){let r=this.listeners(e);for(let n=0;n<r.length;n++)(r[n]===t||r[n]._listener===t)&&this.removeListener(e,r[n])}};sx.exports=oJ});var bg=y((Jse,ux)=>{"use strict";p();var Ws=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function vr(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function sJ(e){let t=Object.create(null);if(e===void 0||e==="")return t;let r=Object.create(null),n=!1,i=!1,o=!1,s,a,u=-1,c=-1,l=0;for(;l<e.length;l++){let f=e.charCodeAt(l);if(s===void 0)if(c===-1&&Ws[f]===1)u===-1&&(u=l);else if(f===32||f===9)c===-1&&u!==-1&&(c=l);else if(f===59||f===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1&&(c=l);let h=e.slice(u,c);f===44?(vr(t,h,r),r=Object.create(null)):s=h,u=c=-1}else throw new SyntaxError(`Unexpected character at index ${l}`);else if(a===void 0)if(c===-1&&Ws[f]===1)u===-1&&(u=l);else if(f===32||f===9)c===-1&&u!==-1&&(c=l);else if(f===59||f===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1&&(c=l),vr(r,e.slice(u,c),!0),f===44&&(vr(t,s,r),r=Object.create(null),s=void 0),u=c=-1}else if(f===61&&u!==-1&&c===-1)a=e.slice(u,l),u=c=-1;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(i){if(Ws[f]!==1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1?u=l:n||(n=!0),i=!1}else if(o)if(Ws[f]===1)u===-1&&(u=l);else if(f===34&&u!==-1)o=!1,c=l;else if(f===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(f===34&&e.charCodeAt(l-1)===61)o=!0;else if(c===-1&&Ws[f]===1)u===-1&&(u=l);else if(u!==-1&&(f===32||f===9))c===-1&&(c=l);else if(f===59||f===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1&&(c=l);let h=e.slice(u,c);n&&(h=h.replace(/\\/g,""),n=!1),vr(r,a,h),f===44&&(vr(t,s,r),r=Object.create(null),s=void 0),a=void 0,u=c=-1}else throw new SyntaxError(`Unexpected character at index ${l}`)}if(u===-1||o)throw new SyntaxError("Unexpected end of input");c===-1&&(c=l);let d=e.slice(u,c);return s===void 0?vr(t,d,r):(a===void 0?vr(r,d,!0):n?vr(r,a,d.replace(/\\/g,"")):vr(r,a,d),vr(t,s,r)),t}function aJ(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(i=>{let o=n[i];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?i:`${i}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}ux.exports={format:aJ,parse:sJ}});var Ag=y((eae,vx)=>{"use strict";p();var uJ=M("events"),cJ=M("https"),lJ=M("http"),px=M("net"),pJ=M("tls"),{randomBytes:dJ,createHash:fJ}=M("crypto"),{Readable:Zse}=M("stream"),{URL:Sg}=M("url"),ln=Hs(),hJ=hg(),mJ=gg(),{BINARY_TYPES:cx,EMPTY_BUFFER:Tg,GUID:gJ,kStatusCode:yJ,kWebSocket:st,NOOP:dx}=zn(),{addEventListener:vJ,removeEventListener:EJ}=ax(),{format:_J,parse:bJ}=bg(),{toBuffer:SJ}=Bs(),Lr=["CONNECTING","OPEN","CLOSING","CLOSED"],Ig=[8,13],TJ=30*1e3,Me=class e extends uJ{constructor(t,r,n){super(),this._binaryType=cx[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._extensions={},this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(r)?r=r.join(", "):typeof r=="object"&&r!==null&&(n=r,r=void 0),fx(this,t,r,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(t){cx.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get onclose(){}set onclose(t){}get onerror(){}set onerror(t){}get onopen(){}set onopen(t){}get onmessage(){}set onmessage(t){}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,n,i,o){let s=new hJ(this.binaryType,this._extensions,this._isServer,n,i,o);this._sender=new mJ(t,this._extensions),this._receiver=s,this._socket=t,s[st]=this,t[st]=this,s.on("conclude",wJ),s.on("drain",AJ),s.on("error",xJ),s.on("message",NJ),s.on("ping",RJ),s.on("pong",CJ),t.setTimeout(0),t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",mx),t.on("data",$c),t.on("end",gx),t.on("error",yx),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[ln.extensionName]&&this._extensions[ln.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING)return wt(this,this._req,"WebSocket was closed before the connection was established");if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),TJ)}}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){wg(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Tg,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){wg(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Tg,r,n)}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){wg(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[ln.extensionName]||(i.compress=!1),this._sender.send(t||Tg,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING)return wt(this,this._req,"WebSocket was closed before the connection was established");this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Me,"CONNECTING",{enumerable:!0,value:Lr.indexOf("CONNECTING")});Object.defineProperty(Me.prototype,"CONNECTING",{enumerable:!0,value:Lr.indexOf("CONNECTING")});Object.defineProperty(Me,"OPEN",{enumerable:!0,value:Lr.indexOf("OPEN")});Object.defineProperty(Me.prototype,"OPEN",{enumerable:!0,value:Lr.indexOf("OPEN")});Object.defineProperty(Me,"CLOSING",{enumerable:!0,value:Lr.indexOf("CLOSING")});Object.defineProperty(Me.prototype,"CLOSING",{enumerable:!0,value:Lr.indexOf("CLOSING")});Object.defineProperty(Me,"CLOSED",{enumerable:!0,value:Lr.indexOf("CLOSED")});Object.defineProperty(Me.prototype,"CLOSED",{enumerable:!0,value:Lr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Me.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Me.prototype,`on${e}`,{enumerable:!0,get(){let t=this.listeners(e);for(let r=0;r<t.length;r++)if(t[r]._listener)return t[r]._listener},set(t){let r=this.listeners(e);for(let n=0;n<r.length;n++)r[n]._listener&&this.removeListener(e,r[n]);this.addEventListener(e,t)}})});Me.prototype.addEventListener=vJ;Me.prototype.removeEventListener=EJ;vx.exports=Me;function fx(e,t,r,n){let i={protocolVersion:Ig[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!Ig.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Ig.join(", ")})`);let o;t instanceof Sg?(o=t,e._url=t.href):(o=new Sg(t),e._url=t);let s=o.protocol==="ws+unix:";if(!o.host&&(!s||!o.pathname)){let h=new Error(`Invalid URL: ${e.url}`);if(e._redirects===0)throw h;Og(e,h);return}let a=o.protocol==="wss:"||o.protocol==="https:",u=a?443:80,c=dJ(16).toString("base64"),l=a?cJ.get:lJ.get,d;if(i.createConnection=a?OJ:IJ,i.defaultPort=i.defaultPort||u,i.port=o.port||u,i.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,i.headers={"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":c,Connection:"Upgrade",Upgrade:"websocket",...i.headers},i.path=o.pathname+o.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(d=new ln(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=_J({[ln.extensionName]:d.offer()})),r&&(i.headers["Sec-WebSocket-Protocol"]=r),i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(o.username||o.password)&&(i.auth=`${o.username}:${o.password}`),s){let h=i.path.split(":");i.socketPath=h[0],i.path=h[1]}if(i.followRedirects){if(e._redirects===0){e._originalUnixSocket=s,e._originalSecure=a,e._originalHostOrSocketPath=s?i.socketPath:o.host;let h=n&&n.headers;if(n={...n,headers:{}},h)for(let[g,v]of Object.entries(h))n.headers[g.toLowerCase()]=v}else{let h=s?e._originalUnixSocket?i.socketPath===e._originalHostOrSocketPath:!1:e._originalUnixSocket?!1:o.host===e._originalHostOrSocketPath;(!h||e._originalSecure&&!a)&&(delete i.headers.authorization,delete i.headers.cookie,h||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64"))}let f=e._req=l(i);i.timeout&&f.on("timeout",()=>{wt(e,f,"Opening handshake has timed out")}),f.on("error",h=>{f===null||f.aborted||(f=e._req=null,Og(e,h))}),f.on("response",h=>{let g=h.headers.location,v=h.statusCode;if(g&&i.followRedirects&&v>=300&&v<400){if(++e._redirects>i.maxRedirects){wt(e,f,"Maximum redirects exceeded");return}f.abort();let _;try{_=new Sg(g,t)}catch(S){Og(e,S);return}fx(e,_,r,n)}else e.emit("unexpected-response",f,h)||wt(e,f,`Unexpected server response: ${h.statusCode}`)}),f.on("upgrade",(h,g,v)=>{if(e.emit("upgrade",h),e.readyState!==Me.CONNECTING)return;f=e._req=null;let _=h.headers.upgrade;if(_===void 0||_.toLowerCase()!=="websocket"){wt(e,g,"Invalid Upgrade header");return}let S=fJ("sha1").update(c+gJ).digest("base64");if(h.headers["sec-websocket-accept"]!==S){wt(e,g,"Invalid Sec-WebSocket-Accept header");return}let b=h.headers["sec-websocket-protocol"],A=(r||"").split(/, */),w;if(!r&&b?w="Server sent a subprotocol but none was requested":r&&!b?w="Server sent no subprotocol":b&&!A.includes(b)&&(w="Server sent an invalid subprotocol"),w){wt(e,g,w);return}b&&(e._protocol=b);let T=h.headers["sec-websocket-extensions"];if(T!==void 0){if(!d){wt(e,g,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let x;try{x=bJ(T)}catch{wt(e,g,"Invalid Sec-WebSocket-Extensions header");return}let U=Object.keys(x);if(U.length){if(U.length!==1||U[0]!==ln.extensionName){wt(e,g,"Server indicated an extension that was not requested");return}try{d.accept(x[ln.extensionName])}catch{wt(e,g,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[ln.extensionName]=d}}e.setSocket(g,v,i.maxPayload,i.maxBufferedChunks,i.maxFragments)})}function Og(e,t){e._readyState=Me.CLOSING,e.emit("error",t),e.emitClose()}function IJ(e){return e.path=e.socketPath,px.connect(e)}function OJ(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=px.isIP(e.host)?"":e.host),pJ.connect(e)}function wt(e,t,r){e._readyState=Me.CLOSING;let n=new Error(r);Error.captureStackTrace(n,wt),t.setHeader?(t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),t.once("abort",e.emitClose.bind(e)),e.emit("error",n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function wg(e,t,r){if(t){let n=SJ(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${Lr[e.readyState]})`);r(n)}}function wJ(e,t){let r=this[st];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[st]!==void 0&&(r._socket.removeListener("data",$c),process.nextTick(hx,r._socket),e===1005?r.close():r.close(e,t))}function AJ(){this[st]._socket.resume()}function xJ(e){let t=this[st];t._socket[st]!==void 0&&(t._socket.removeListener("data",$c),process.nextTick(hx,t._socket),t.close(e[yJ])),t.emit("error",e)}function lx(){this[st].emitClose()}function NJ(e){this[st].emit("message",e)}function RJ(e){let t=this[st];t.pong(e,!t._isServer,dx),t.emit("ping",e)}function CJ(e){this[st].emit("pong",e)}function hx(e){e.resume()}function mx(){let e=this[st];this.removeListener("close",mx),this.removeListener("data",$c),this.removeListener("end",gx),e._readyState=Me.CLOSING;let t;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null&&e._receiver.write(t),e._receiver.end(),this[st]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",lx),e._receiver.on("finish",lx))}function $c(e){this[st]._receiver.write(e)||this.pause()}function gx(){let e=this[st];e._readyState=Me.CLOSING,e._receiver.end(),this.end()}function yx(){let e=this[st];this.removeListener("error",yx),this.on("error",dx),e&&(e._readyState=Me.CLOSING,this.destroy())}});var Sx=y((rae,bx)=>{"use strict";p();var{Duplex:PJ}=M("stream");function Ex(e){e.emit("close")}function DJ(){!this.destroyed&&this._writableState.finished&&this.destroy()}function _x(e){this.removeListener("error",_x),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function LJ(e,t){let r=!0,n=!0;function i(){r&&e._socket.resume()}e.readyState===e.CONNECTING?e.once("open",function(){e._receiver.removeAllListeners("drain"),e._receiver.on("drain",i)}):(e._receiver.removeAllListeners("drain"),e._receiver.on("drain",i));let o=new PJ({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(a){o.push(a)||(r=!1,e._socket.pause())}),e.once("error",function(a){o.destroyed||(n=!1,o.destroy(a))}),e.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(s,a){if(e.readyState===e.CLOSED){a(s),process.nextTick(Ex,o);return}let u=!1;e.once("error",function(l){u=!0,a(l)}),e.once("close",function(){u||a(s),process.nextTick(Ex,o)}),n&&e.terminate()},o._final=function(s){if(e.readyState===e.CONNECTING){e.once("open",function(){o._final(s)});return}e._socket!==null&&(e._socket._writableState.finished?(s(),o._readableState.endEmitted&&o.destroy()):(e._socket.once("finish",function(){s()}),e.close()))},o._read=function(){(e.readyState===e.OPEN||e.readyState===e.CLOSING)&&!r&&(r=!0,e._receiver._writableState.needDrain||e._socket.resume())},o._write=function(s,a,u){if(e.readyState===e.CONNECTING){e.once("open",function(){o._write(s,a,u)});return}e.send(s,u)},o.on("end",DJ),o.on("error",_x),o}bx.exports=LJ});var Ax=y((aae,wx)=>{"use strict";p();var kJ=M("events"),Kc=M("http"),iae=M("https"),oae=M("net"),sae=M("tls"),{createHash:jJ}=M("crypto"),Jn=Hs(),MJ=Ag(),{format:FJ,parse:qJ}=bg(),{GUID:UJ,kWebSocket:VJ}=zn(),GJ=/^[+/0-9A-Za-z]{22}==$/,Tx=0,Ix=1,Ox=2,Ng=class extends kJ{constructor(t,r){if(super(),t={maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Kc.createServer((n,i)=>{let o=Kc.STATUS_CODES[426];i.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),i.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=BJ(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,o,s)=>{this.handleUpgrade(i,o,s,n)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set),this.options=t,this._state=Tx}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(t&&this.once("close",t),this._state===Ox){process.nextTick(xg,this);return}if(this._state===Ix)return;if(this._state=Ix,this.clients)for(let n of this.clients)n.terminate();let r=this._server;if(r&&(this._removeListeners(),this._removeListeners=this._server=null,this.options.port!=null)){r.close(xg.bind(void 0,this));return}process.nextTick(xg,this)}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,i){r.on("error",Rg);let o=t.headers["sec-websocket-key"]!==void 0?t.headers["sec-websocket-key"].trim():!1,s=t.headers.upgrade,a=+t.headers["sec-websocket-version"],u={};if(t.method!=="GET"||s===void 0||s.toLowerCase()!=="websocket"||!o||!GJ.test(o)||a!==8&&a!==13||!this.shouldHandle(t))return zs(r,400);if(this.options.perMessageDeflate){let c=new Jn(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let l=qJ(t.headers["sec-websocket-extensions"]);l[Jn.extensionName]&&(c.accept(l[Jn.extensionName]),u[Jn.extensionName]=c)}catch{return zs(r,400)}}if(this.options.verifyClient){let c={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(c,(l,d,f,h)=>{if(!l)return zs(r,d||401,f,h);this.completeUpgrade(o,u,t,r,n,i)});return}if(!this.options.verifyClient(c))return zs(r,401)}this.completeUpgrade(o,u,t,r,n,i)}completeUpgrade(t,r,n,i,o,s){if(!i.readable||!i.writable)return i.destroy();if(i[VJ])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Tx)return zs(i,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${jJ("sha1").update(t+UJ).digest("base64")}`],c=new MJ(null),l=n.headers["sec-websocket-protocol"];if(l&&(l=l.split(",").map($J),this.options.handleProtocols?l=this.options.handleProtocols(l,n):l=l[0],l&&(u.push(`Sec-WebSocket-Protocol: ${l}`),c._protocol=l)),r[Jn.extensionName]){let d=r[Jn.extensionName].params,f=FJ({[Jn.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${f}`),c._extensions=r}this.emit("headers",u,n),i.write(u.concat(`\r
|
|
199
|
+
`),'"""'+r+'"""'}});var f0=y(un=>{"use strict";p();Object.defineProperty(un,"__esModule",{value:!0});un.findBreakingChanges=Az;un.findDangerousChanges=xz;un.DangerousChangeType=un.BreakingChangeType=void 0;var zi=Ms(bt()),i0=Ms(Hr()),_z=Ms(se()),p0=Ms(et()),bz=Ms(Xo()),Sz=mt(),Tz=Kr(),Iz=pr(),ce=ie(),wz=cs();function Ms(e){return e&&e.__esModule?e:{default:e}}function o0(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function s0(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?o0(Object(r),!0).forEach(function(n){Oz(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o0(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Oz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ve=Object.freeze({TYPE_REMOVED:"TYPE_REMOVED",TYPE_CHANGED_KIND:"TYPE_CHANGED_KIND",TYPE_REMOVED_FROM_UNION:"TYPE_REMOVED_FROM_UNION",VALUE_REMOVED_FROM_ENUM:"VALUE_REMOVED_FROM_ENUM",REQUIRED_INPUT_FIELD_ADDED:"REQUIRED_INPUT_FIELD_ADDED",IMPLEMENTED_INTERFACE_REMOVED:"IMPLEMENTED_INTERFACE_REMOVED",FIELD_REMOVED:"FIELD_REMOVED",FIELD_CHANGED_KIND:"FIELD_CHANGED_KIND",REQUIRED_ARG_ADDED:"REQUIRED_ARG_ADDED",ARG_REMOVED:"ARG_REMOVED",ARG_CHANGED_KIND:"ARG_CHANGED_KIND",DIRECTIVE_REMOVED:"DIRECTIVE_REMOVED",DIRECTIVE_ARG_REMOVED:"DIRECTIVE_ARG_REMOVED",REQUIRED_DIRECTIVE_ARG_ADDED:"REQUIRED_DIRECTIVE_ARG_ADDED",DIRECTIVE_REPEATABLE_REMOVED:"DIRECTIVE_REPEATABLE_REMOVED",DIRECTIVE_LOCATION_REMOVED:"DIRECTIVE_LOCATION_REMOVED"});un.BreakingChangeType=Ve;var Nr=Object.freeze({VALUE_ADDED_TO_ENUM:"VALUE_ADDED_TO_ENUM",TYPE_ADDED_TO_UNION:"TYPE_ADDED_TO_UNION",OPTIONAL_INPUT_FIELD_ADDED:"OPTIONAL_INPUT_FIELD_ADDED",OPTIONAL_ARG_ADDED:"OPTIONAL_ARG_ADDED",IMPLEMENTED_INTERFACE_ADDED:"IMPLEMENTED_INTERFACE_ADDED",ARG_DEFAULT_VALUE_CHANGE:"ARG_DEFAULT_VALUE_CHANGE"});un.DangerousChangeType=Nr;function Az(e,t){var r=d0(e,t).filter(function(n){return n.type in Ve});return r}function xz(e,t){var r=d0(e,t).filter(function(n){return n.type in Nr});return r}function d0(e,t){return[].concat(Rz(e,t),Nz(e,t))}function Nz(e,t){for(var r=[],n=Rr(e.getDirectives(),t.getDirectives()),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ve.DIRECTIVE_REMOVED,description:"".concat(s.name," was removed.")})}for(var a=0,u=n.persisted;a<u.length;a++){for(var c=u[a],l=c[0],d=c[1],f=Rr(l.args,d.args),h=0,g=f.added;h<g.length;h++){var v=g[h];(0,ce.isRequiredArgument)(v)&&r.push({type:Ve.REQUIRED_DIRECTIVE_ARG_ADDED,description:"A required arg ".concat(v.name," on directive ").concat(l.name," was added.")})}for(var _=0,S=f.removed;_<S.length;_++){var b=S[_];r.push({type:Ve.DIRECTIVE_ARG_REMOVED,description:"".concat(b.name," was removed from ").concat(l.name,".")})}l.isRepeatable&&!d.isRepeatable&&r.push({type:Ve.DIRECTIVE_REPEATABLE_REMOVED,description:"Repeatable flag was removed from ".concat(l.name,".")});for(var A=0,O=l.locations;A<O.length;A++){var T=O[A];d.locations.indexOf(T)===-1&&r.push({type:Ve.DIRECTIVE_LOCATION_REMOVED,description:"".concat(T," was removed from ").concat(l.name,".")})}}return r}function Rz(e,t){for(var r=[],n=Rr((0,zi.default)(e.getTypeMap()),(0,zi.default)(t.getTypeMap())),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ve.TYPE_REMOVED,description:(0,Iz.isSpecifiedScalarType)(s)?"Standard scalar ".concat(s.name," was removed because it is not referenced anymore."):"".concat(s.name," was removed.")})}for(var a=0,u=n.persisted;a<u.length;a++){var c=u[a],l=c[0],d=c[1];(0,ce.isEnumType)(l)&&(0,ce.isEnumType)(d)?r.push.apply(r,Dz(l,d)):(0,ce.isUnionType)(l)&&(0,ce.isUnionType)(d)?r.push.apply(r,Pz(l,d)):(0,ce.isInputObjectType)(l)&&(0,ce.isInputObjectType)(d)?r.push.apply(r,Cz(l,d)):(0,ce.isObjectType)(l)&&(0,ce.isObjectType)(d)||(0,ce.isInterfaceType)(l)&&(0,ce.isInterfaceType)(d)?r.push.apply(r,u0(l,d).concat(a0(l,d))):l.constructor!==d.constructor&&r.push({type:Ve.TYPE_CHANGED_KIND,description:"".concat(l.name," changed from ")+"".concat(c0(l)," to ").concat(c0(d),".")})}return r}function Cz(e,t){for(var r=[],n=Rr((0,zi.default)(e.getFields()),(0,zi.default)(t.getFields())),i=0,o=n.added;i<o.length;i++){var s=o[i];(0,ce.isRequiredInputField)(s)?r.push({type:Ve.REQUIRED_INPUT_FIELD_ADDED,description:"A required field ".concat(s.name," on input type ").concat(e.name," was added.")}):r.push({type:Nr.OPTIONAL_INPUT_FIELD_ADDED,description:"An optional field ".concat(s.name," on input type ").concat(e.name," was added.")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ve.FIELD_REMOVED,description:"".concat(e.name,".").concat(c.name," was removed.")})}for(var l=0,d=n.persisted;l<d.length;l++){var f=d[l],h=f[0],g=f[1],v=js(h.type,g.type);v||r.push({type:Ve.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(h.name," changed type from ")+"".concat(String(h.type)," to ").concat(String(g.type),".")})}return r}function Pz(e,t){for(var r=[],n=Rr(e.getTypes(),t.getTypes()),i=0,o=n.added;i<o.length;i++){var s=o[i];r.push({type:Nr.TYPE_ADDED_TO_UNION,description:"".concat(s.name," was added to union type ").concat(e.name,".")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ve.TYPE_REMOVED_FROM_UNION,description:"".concat(c.name," was removed from union type ").concat(e.name,".")})}return r}function Dz(e,t){for(var r=[],n=Rr(e.getValues(),t.getValues()),i=0,o=n.added;i<o.length;i++){var s=o[i];r.push({type:Nr.VALUE_ADDED_TO_ENUM,description:"".concat(s.name," was added to enum type ").concat(e.name,".")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ve.VALUE_REMOVED_FROM_ENUM,description:"".concat(c.name," was removed from enum type ").concat(e.name,".")})}return r}function a0(e,t){for(var r=[],n=Rr(e.getInterfaces(),t.getInterfaces()),i=0,o=n.added;i<o.length;i++){var s=o[i];r.push({type:Nr.IMPLEMENTED_INTERFACE_ADDED,description:"".concat(s.name," added to interfaces implemented by ").concat(e.name,".")})}for(var a=0,u=n.removed;a<u.length;a++){var c=u[a];r.push({type:Ve.IMPLEMENTED_INTERFACE_REMOVED,description:"".concat(e.name," no longer implements interface ").concat(c.name,".")})}return r}function u0(e,t){for(var r=[],n=Rr((0,zi.default)(e.getFields()),(0,zi.default)(t.getFields())),i=0,o=n.removed;i<o.length;i++){var s=o[i];r.push({type:Ve.FIELD_REMOVED,description:"".concat(e.name,".").concat(s.name," was removed.")})}for(var a=0,u=n.persisted;a<u.length;a++){var c=u[a],l=c[0],d=c[1];r.push.apply(r,Lz(e,l,d));var f=ks(l.type,d.type);f||r.push({type:Ve.FIELD_CHANGED_KIND,description:"".concat(e.name,".").concat(l.name," changed type from ")+"".concat(String(l.type)," to ").concat(String(d.type),".")})}return r}function Lz(e,t,r){for(var n=[],i=Rr(t.args,r.args),o=0,s=i.removed;o<s.length;o++){var a=s[o];n.push({type:Ve.ARG_REMOVED,description:"".concat(e.name,".").concat(t.name," arg ").concat(a.name," was removed.")})}for(var u=0,c=i.persisted;u<c.length;u++){var l=c[u],d=l[0],f=l[1],h=js(d.type,f.type);if(!h)n.push({type:Ve.ARG_CHANGED_KIND,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," has changed type from ")+"".concat(String(d.type)," to ").concat(String(f.type),".")});else if(d.defaultValue!==void 0)if(f.defaultValue===void 0)n.push({type:Nr.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," defaultValue was removed.")});else{var g=l0(d.defaultValue,d.type),v=l0(f.defaultValue,f.type);g!==v&&n.push({type:Nr.ARG_DEFAULT_VALUE_CHANGE,description:"".concat(e.name,".").concat(t.name," arg ").concat(d.name," has changed defaultValue from ").concat(g," to ").concat(v,".")})}}for(var _=0,S=i.added;_<S.length;_++){var b=S[_];(0,ce.isRequiredArgument)(b)?n.push({type:Ve.REQUIRED_ARG_ADDED,description:"A required arg ".concat(b.name," on ").concat(e.name,".").concat(t.name," was added.")}):n.push({type:Nr.OPTIONAL_ARG_ADDED,description:"An optional arg ".concat(b.name," on ").concat(e.name,".").concat(t.name," was added.")})}return n}function ks(e,t){return(0,ce.isListType)(e)?(0,ce.isListType)(t)&&ks(e.ofType,t.ofType)||(0,ce.isNonNullType)(t)&&ks(e,t.ofType):(0,ce.isNonNullType)(e)?(0,ce.isNonNullType)(t)&&ks(e.ofType,t.ofType):(0,ce.isNamedType)(t)&&e.name===t.name||(0,ce.isNonNullType)(t)&&ks(e,t.ofType)}function js(e,t){return(0,ce.isListType)(e)?(0,ce.isListType)(t)&&js(e.ofType,t.ofType):(0,ce.isNonNullType)(e)?(0,ce.isNonNullType)(t)&&js(e.ofType,t.ofType)||!(0,ce.isNonNullType)(t)&&js(e.ofType,t):(0,ce.isNamedType)(t)&&e.name===t.name}function c0(e){if((0,ce.isScalarType)(e))return"a Scalar type";if((0,ce.isObjectType)(e))return"an Object type";if((0,ce.isInterfaceType)(e))return"an Interface type";if((0,ce.isUnionType)(e))return"a Union type";if((0,ce.isEnumType)(e))return"an Enum type";if((0,ce.isInputObjectType)(e))return"an Input type";(0,p0.default)(0,"Unexpected type: "+(0,_z.default)(e))}function l0(e,t){var r=(0,wz.astFromValue)(e,t);r!=null||(0,p0.default)(0);var n=(0,Tz.visit)(r,{ObjectValue:function(o){var s=[].concat(o.fields);return s.sort(function(a,u){return(0,bz.default)(a.name.value,u.name.value)}),s0(s0({},o),{},{fields:s})}});return(0,Sz.print)(n)}function Rr(e,t){for(var r=[],n=[],i=[],o=(0,i0.default)(e,function(f){var h=f.name;return h}),s=(0,i0.default)(t,function(f){var h=f.name;return h}),a=0;a<e.length;a++){var u=e[a],c=s[u.name];c===void 0?n.push(u):i.push([u,c])}for(var l=0;l<t.length;l++){var d=t[l];o[d.name]===void 0&&r.push(d)}return{added:r,persisted:i,removed:n}}});var h0=y(Bm=>{"use strict";p();Object.defineProperty(Bm,"__esModule",{value:!0});Bm.findDeprecatedUsages=Mz;var kz=Ui(),jz=vm();function Mz(e,t){return(0,kz.validate)(e,t,[jz.NoDeprecatedCustomRule])}});var E0=y(ne=>{"use strict";p();Object.defineProperty(ne,"__esModule",{value:!0});Object.defineProperty(ne,"getIntrospectionQuery",{enumerable:!0,get:function(){return Fz.getIntrospectionQuery}});Object.defineProperty(ne,"getOperationAST",{enumerable:!0,get:function(){return qz.getOperationAST}});Object.defineProperty(ne,"getOperationRootType",{enumerable:!0,get:function(){return Uz.getOperationRootType}});Object.defineProperty(ne,"introspectionFromSchema",{enumerable:!0,get:function(){return Vz.introspectionFromSchema}});Object.defineProperty(ne,"buildClientSchema",{enumerable:!0,get:function(){return Gz.buildClientSchema}});Object.defineProperty(ne,"buildASTSchema",{enumerable:!0,get:function(){return m0.buildASTSchema}});Object.defineProperty(ne,"buildSchema",{enumerable:!0,get:function(){return m0.buildSchema}});Object.defineProperty(ne,"extendSchema",{enumerable:!0,get:function(){return g0.extendSchema}});Object.defineProperty(ne,"getDescription",{enumerable:!0,get:function(){return g0.getDescription}});Object.defineProperty(ne,"lexicographicSortSchema",{enumerable:!0,get:function(){return $z.lexicographicSortSchema}});Object.defineProperty(ne,"printSchema",{enumerable:!0,get:function(){return Km.printSchema}});Object.defineProperty(ne,"printType",{enumerable:!0,get:function(){return Km.printType}});Object.defineProperty(ne,"printIntrospectionSchema",{enumerable:!0,get:function(){return Km.printIntrospectionSchema}});Object.defineProperty(ne,"typeFromAST",{enumerable:!0,get:function(){return Bz.typeFromAST}});Object.defineProperty(ne,"valueFromAST",{enumerable:!0,get:function(){return Kz.valueFromAST}});Object.defineProperty(ne,"valueFromASTUntyped",{enumerable:!0,get:function(){return Hz.valueFromASTUntyped}});Object.defineProperty(ne,"astFromValue",{enumerable:!0,get:function(){return Qz.astFromValue}});Object.defineProperty(ne,"TypeInfo",{enumerable:!0,get:function(){return y0.TypeInfo}});Object.defineProperty(ne,"visitWithTypeInfo",{enumerable:!0,get:function(){return y0.visitWithTypeInfo}});Object.defineProperty(ne,"coerceInputValue",{enumerable:!0,get:function(){return Wz.coerceInputValue}});Object.defineProperty(ne,"concatAST",{enumerable:!0,get:function(){return zz.concatAST}});Object.defineProperty(ne,"separateOperations",{enumerable:!0,get:function(){return Yz.separateOperations}});Object.defineProperty(ne,"stripIgnoredCharacters",{enumerable:!0,get:function(){return Jz.stripIgnoredCharacters}});Object.defineProperty(ne,"isEqualType",{enumerable:!0,get:function(){return Hm.isEqualType}});Object.defineProperty(ne,"isTypeSubTypeOf",{enumerable:!0,get:function(){return Hm.isTypeSubTypeOf}});Object.defineProperty(ne,"doTypesOverlap",{enumerable:!0,get:function(){return Hm.doTypesOverlap}});Object.defineProperty(ne,"assertValidName",{enumerable:!0,get:function(){return v0.assertValidName}});Object.defineProperty(ne,"isValidNameError",{enumerable:!0,get:function(){return v0.isValidNameError}});Object.defineProperty(ne,"BreakingChangeType",{enumerable:!0,get:function(){return Cc.BreakingChangeType}});Object.defineProperty(ne,"DangerousChangeType",{enumerable:!0,get:function(){return Cc.DangerousChangeType}});Object.defineProperty(ne,"findBreakingChanges",{enumerable:!0,get:function(){return Cc.findBreakingChanges}});Object.defineProperty(ne,"findDangerousChanges",{enumerable:!0,get:function(){return Cc.findDangerousChanges}});Object.defineProperty(ne,"findDeprecatedUsages",{enumerable:!0,get:function(){return Xz.findDeprecatedUsages}});var Fz=Sm(),qz=Im(),Uz=dc(),Vz=SO(),Gz=IO(),m0=qO(),g0=Am(),$z=VO(),Km=zO(),Bz=dr(),Kz=_s(),Hz=Gd(),Qz=cs(),y0=Xu(),Wz=im(),zz=YO(),Yz=ZO(),Jz=n0(),Hm=ns(),v0=Ad(),Cc=f0(),Xz=h0()});var cn=y(E=>{"use strict";p();Object.defineProperty(E,"__esModule",{value:!0});Object.defineProperty(E,"version",{enumerable:!0,get:function(){return _0.version}});Object.defineProperty(E,"versionInfo",{enumerable:!0,get:function(){return _0.versionInfo}});Object.defineProperty(E,"graphql",{enumerable:!0,get:function(){return b0.graphql}});Object.defineProperty(E,"graphqlSync",{enumerable:!0,get:function(){return b0.graphqlSync}});Object.defineProperty(E,"GraphQLSchema",{enumerable:!0,get:function(){return P.GraphQLSchema}});Object.defineProperty(E,"GraphQLDirective",{enumerable:!0,get:function(){return P.GraphQLDirective}});Object.defineProperty(E,"GraphQLScalarType",{enumerable:!0,get:function(){return P.GraphQLScalarType}});Object.defineProperty(E,"GraphQLObjectType",{enumerable:!0,get:function(){return P.GraphQLObjectType}});Object.defineProperty(E,"GraphQLInterfaceType",{enumerable:!0,get:function(){return P.GraphQLInterfaceType}});Object.defineProperty(E,"GraphQLUnionType",{enumerable:!0,get:function(){return P.GraphQLUnionType}});Object.defineProperty(E,"GraphQLEnumType",{enumerable:!0,get:function(){return P.GraphQLEnumType}});Object.defineProperty(E,"GraphQLInputObjectType",{enumerable:!0,get:function(){return P.GraphQLInputObjectType}});Object.defineProperty(E,"GraphQLList",{enumerable:!0,get:function(){return P.GraphQLList}});Object.defineProperty(E,"GraphQLNonNull",{enumerable:!0,get:function(){return P.GraphQLNonNull}});Object.defineProperty(E,"specifiedScalarTypes",{enumerable:!0,get:function(){return P.specifiedScalarTypes}});Object.defineProperty(E,"GraphQLInt",{enumerable:!0,get:function(){return P.GraphQLInt}});Object.defineProperty(E,"GraphQLFloat",{enumerable:!0,get:function(){return P.GraphQLFloat}});Object.defineProperty(E,"GraphQLString",{enumerable:!0,get:function(){return P.GraphQLString}});Object.defineProperty(E,"GraphQLBoolean",{enumerable:!0,get:function(){return P.GraphQLBoolean}});Object.defineProperty(E,"GraphQLID",{enumerable:!0,get:function(){return P.GraphQLID}});Object.defineProperty(E,"specifiedDirectives",{enumerable:!0,get:function(){return P.specifiedDirectives}});Object.defineProperty(E,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return P.GraphQLIncludeDirective}});Object.defineProperty(E,"GraphQLSkipDirective",{enumerable:!0,get:function(){return P.GraphQLSkipDirective}});Object.defineProperty(E,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return P.GraphQLDeprecatedDirective}});Object.defineProperty(E,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return P.GraphQLSpecifiedByDirective}});Object.defineProperty(E,"TypeKind",{enumerable:!0,get:function(){return P.TypeKind}});Object.defineProperty(E,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return P.DEFAULT_DEPRECATION_REASON}});Object.defineProperty(E,"introspectionTypes",{enumerable:!0,get:function(){return P.introspectionTypes}});Object.defineProperty(E,"__Schema",{enumerable:!0,get:function(){return P.__Schema}});Object.defineProperty(E,"__Directive",{enumerable:!0,get:function(){return P.__Directive}});Object.defineProperty(E,"__DirectiveLocation",{enumerable:!0,get:function(){return P.__DirectiveLocation}});Object.defineProperty(E,"__Type",{enumerable:!0,get:function(){return P.__Type}});Object.defineProperty(E,"__Field",{enumerable:!0,get:function(){return P.__Field}});Object.defineProperty(E,"__InputValue",{enumerable:!0,get:function(){return P.__InputValue}});Object.defineProperty(E,"__EnumValue",{enumerable:!0,get:function(){return P.__EnumValue}});Object.defineProperty(E,"__TypeKind",{enumerable:!0,get:function(){return P.__TypeKind}});Object.defineProperty(E,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return P.SchemaMetaFieldDef}});Object.defineProperty(E,"TypeMetaFieldDef",{enumerable:!0,get:function(){return P.TypeMetaFieldDef}});Object.defineProperty(E,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return P.TypeNameMetaFieldDef}});Object.defineProperty(E,"isSchema",{enumerable:!0,get:function(){return P.isSchema}});Object.defineProperty(E,"isDirective",{enumerable:!0,get:function(){return P.isDirective}});Object.defineProperty(E,"isType",{enumerable:!0,get:function(){return P.isType}});Object.defineProperty(E,"isScalarType",{enumerable:!0,get:function(){return P.isScalarType}});Object.defineProperty(E,"isObjectType",{enumerable:!0,get:function(){return P.isObjectType}});Object.defineProperty(E,"isInterfaceType",{enumerable:!0,get:function(){return P.isInterfaceType}});Object.defineProperty(E,"isUnionType",{enumerable:!0,get:function(){return P.isUnionType}});Object.defineProperty(E,"isEnumType",{enumerable:!0,get:function(){return P.isEnumType}});Object.defineProperty(E,"isInputObjectType",{enumerable:!0,get:function(){return P.isInputObjectType}});Object.defineProperty(E,"isListType",{enumerable:!0,get:function(){return P.isListType}});Object.defineProperty(E,"isNonNullType",{enumerable:!0,get:function(){return P.isNonNullType}});Object.defineProperty(E,"isInputType",{enumerable:!0,get:function(){return P.isInputType}});Object.defineProperty(E,"isOutputType",{enumerable:!0,get:function(){return P.isOutputType}});Object.defineProperty(E,"isLeafType",{enumerable:!0,get:function(){return P.isLeafType}});Object.defineProperty(E,"isCompositeType",{enumerable:!0,get:function(){return P.isCompositeType}});Object.defineProperty(E,"isAbstractType",{enumerable:!0,get:function(){return P.isAbstractType}});Object.defineProperty(E,"isWrappingType",{enumerable:!0,get:function(){return P.isWrappingType}});Object.defineProperty(E,"isNullableType",{enumerable:!0,get:function(){return P.isNullableType}});Object.defineProperty(E,"isNamedType",{enumerable:!0,get:function(){return P.isNamedType}});Object.defineProperty(E,"isRequiredArgument",{enumerable:!0,get:function(){return P.isRequiredArgument}});Object.defineProperty(E,"isRequiredInputField",{enumerable:!0,get:function(){return P.isRequiredInputField}});Object.defineProperty(E,"isSpecifiedScalarType",{enumerable:!0,get:function(){return P.isSpecifiedScalarType}});Object.defineProperty(E,"isIntrospectionType",{enumerable:!0,get:function(){return P.isIntrospectionType}});Object.defineProperty(E,"isSpecifiedDirective",{enumerable:!0,get:function(){return P.isSpecifiedDirective}});Object.defineProperty(E,"assertSchema",{enumerable:!0,get:function(){return P.assertSchema}});Object.defineProperty(E,"assertDirective",{enumerable:!0,get:function(){return P.assertDirective}});Object.defineProperty(E,"assertType",{enumerable:!0,get:function(){return P.assertType}});Object.defineProperty(E,"assertScalarType",{enumerable:!0,get:function(){return P.assertScalarType}});Object.defineProperty(E,"assertObjectType",{enumerable:!0,get:function(){return P.assertObjectType}});Object.defineProperty(E,"assertInterfaceType",{enumerable:!0,get:function(){return P.assertInterfaceType}});Object.defineProperty(E,"assertUnionType",{enumerable:!0,get:function(){return P.assertUnionType}});Object.defineProperty(E,"assertEnumType",{enumerable:!0,get:function(){return P.assertEnumType}});Object.defineProperty(E,"assertInputObjectType",{enumerable:!0,get:function(){return P.assertInputObjectType}});Object.defineProperty(E,"assertListType",{enumerable:!0,get:function(){return P.assertListType}});Object.defineProperty(E,"assertNonNullType",{enumerable:!0,get:function(){return P.assertNonNullType}});Object.defineProperty(E,"assertInputType",{enumerable:!0,get:function(){return P.assertInputType}});Object.defineProperty(E,"assertOutputType",{enumerable:!0,get:function(){return P.assertOutputType}});Object.defineProperty(E,"assertLeafType",{enumerable:!0,get:function(){return P.assertLeafType}});Object.defineProperty(E,"assertCompositeType",{enumerable:!0,get:function(){return P.assertCompositeType}});Object.defineProperty(E,"assertAbstractType",{enumerable:!0,get:function(){return P.assertAbstractType}});Object.defineProperty(E,"assertWrappingType",{enumerable:!0,get:function(){return P.assertWrappingType}});Object.defineProperty(E,"assertNullableType",{enumerable:!0,get:function(){return P.assertNullableType}});Object.defineProperty(E,"assertNamedType",{enumerable:!0,get:function(){return P.assertNamedType}});Object.defineProperty(E,"getNullableType",{enumerable:!0,get:function(){return P.getNullableType}});Object.defineProperty(E,"getNamedType",{enumerable:!0,get:function(){return P.getNamedType}});Object.defineProperty(E,"validateSchema",{enumerable:!0,get:function(){return P.validateSchema}});Object.defineProperty(E,"assertValidSchema",{enumerable:!0,get:function(){return P.assertValidSchema}});Object.defineProperty(E,"Token",{enumerable:!0,get:function(){return be.Token}});Object.defineProperty(E,"Source",{enumerable:!0,get:function(){return be.Source}});Object.defineProperty(E,"Location",{enumerable:!0,get:function(){return be.Location}});Object.defineProperty(E,"getLocation",{enumerable:!0,get:function(){return be.getLocation}});Object.defineProperty(E,"printLocation",{enumerable:!0,get:function(){return be.printLocation}});Object.defineProperty(E,"printSourceLocation",{enumerable:!0,get:function(){return be.printSourceLocation}});Object.defineProperty(E,"Lexer",{enumerable:!0,get:function(){return be.Lexer}});Object.defineProperty(E,"TokenKind",{enumerable:!0,get:function(){return be.TokenKind}});Object.defineProperty(E,"parse",{enumerable:!0,get:function(){return be.parse}});Object.defineProperty(E,"parseValue",{enumerable:!0,get:function(){return be.parseValue}});Object.defineProperty(E,"parseType",{enumerable:!0,get:function(){return be.parseType}});Object.defineProperty(E,"print",{enumerable:!0,get:function(){return be.print}});Object.defineProperty(E,"visit",{enumerable:!0,get:function(){return be.visit}});Object.defineProperty(E,"visitInParallel",{enumerable:!0,get:function(){return be.visitInParallel}});Object.defineProperty(E,"getVisitFn",{enumerable:!0,get:function(){return be.getVisitFn}});Object.defineProperty(E,"BREAK",{enumerable:!0,get:function(){return be.BREAK}});Object.defineProperty(E,"Kind",{enumerable:!0,get:function(){return be.Kind}});Object.defineProperty(E,"DirectiveLocation",{enumerable:!0,get:function(){return be.DirectiveLocation}});Object.defineProperty(E,"isDefinitionNode",{enumerable:!0,get:function(){return be.isDefinitionNode}});Object.defineProperty(E,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return be.isExecutableDefinitionNode}});Object.defineProperty(E,"isSelectionNode",{enumerable:!0,get:function(){return be.isSelectionNode}});Object.defineProperty(E,"isValueNode",{enumerable:!0,get:function(){return be.isValueNode}});Object.defineProperty(E,"isTypeNode",{enumerable:!0,get:function(){return be.isTypeNode}});Object.defineProperty(E,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return be.isTypeSystemDefinitionNode}});Object.defineProperty(E,"isTypeDefinitionNode",{enumerable:!0,get:function(){return be.isTypeDefinitionNode}});Object.defineProperty(E,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return be.isTypeSystemExtensionNode}});Object.defineProperty(E,"isTypeExtensionNode",{enumerable:!0,get:function(){return be.isTypeExtensionNode}});Object.defineProperty(E,"execute",{enumerable:!0,get:function(){return Yi.execute}});Object.defineProperty(E,"executeSync",{enumerable:!0,get:function(){return Yi.executeSync}});Object.defineProperty(E,"defaultFieldResolver",{enumerable:!0,get:function(){return Yi.defaultFieldResolver}});Object.defineProperty(E,"defaultTypeResolver",{enumerable:!0,get:function(){return Yi.defaultTypeResolver}});Object.defineProperty(E,"responsePathAsArray",{enumerable:!0,get:function(){return Yi.responsePathAsArray}});Object.defineProperty(E,"getDirectiveValues",{enumerable:!0,get:function(){return Yi.getDirectiveValues}});Object.defineProperty(E,"subscribe",{enumerable:!0,get:function(){return S0.subscribe}});Object.defineProperty(E,"createSourceEventStream",{enumerable:!0,get:function(){return S0.createSourceEventStream}});Object.defineProperty(E,"validate",{enumerable:!0,get:function(){return X.validate}});Object.defineProperty(E,"ValidationContext",{enumerable:!0,get:function(){return X.ValidationContext}});Object.defineProperty(E,"specifiedRules",{enumerable:!0,get:function(){return X.specifiedRules}});Object.defineProperty(E,"recommendedRules",{enumerable:!0,get:function(){return X.recommendedRules}});Object.defineProperty(E,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return X.ExecutableDefinitionsRule}});Object.defineProperty(E,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return X.FieldsOnCorrectTypeRule}});Object.defineProperty(E,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return X.FragmentsOnCompositeTypesRule}});Object.defineProperty(E,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return X.KnownArgumentNamesRule}});Object.defineProperty(E,"KnownDirectivesRule",{enumerable:!0,get:function(){return X.KnownDirectivesRule}});Object.defineProperty(E,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return X.KnownFragmentNamesRule}});Object.defineProperty(E,"KnownTypeNamesRule",{enumerable:!0,get:function(){return X.KnownTypeNamesRule}});Object.defineProperty(E,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return X.LoneAnonymousOperationRule}});Object.defineProperty(E,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return X.NoFragmentCyclesRule}});Object.defineProperty(E,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return X.NoUndefinedVariablesRule}});Object.defineProperty(E,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return X.NoUnusedFragmentsRule}});Object.defineProperty(E,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return X.NoUnusedVariablesRule}});Object.defineProperty(E,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return X.OverlappingFieldsCanBeMergedRule}});Object.defineProperty(E,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return X.PossibleFragmentSpreadsRule}});Object.defineProperty(E,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return X.ProvidedRequiredArgumentsRule}});Object.defineProperty(E,"ScalarLeafsRule",{enumerable:!0,get:function(){return X.ScalarLeafsRule}});Object.defineProperty(E,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return X.SingleFieldSubscriptionsRule}});Object.defineProperty(E,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return X.UniqueArgumentNamesRule}});Object.defineProperty(E,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return X.UniqueDirectivesPerLocationRule}});Object.defineProperty(E,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return X.UniqueFragmentNamesRule}});Object.defineProperty(E,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return X.UniqueInputFieldNamesRule}});Object.defineProperty(E,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return X.UniqueOperationNamesRule}});Object.defineProperty(E,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return X.UniqueVariableNamesRule}});Object.defineProperty(E,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return X.ValuesOfCorrectTypeRule}});Object.defineProperty(E,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return X.VariablesAreInputTypesRule}});Object.defineProperty(E,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return X.VariablesInAllowedPositionRule}});Object.defineProperty(E,"MaxIntrospectionDepthRule",{enumerable:!0,get:function(){return X.MaxIntrospectionDepthRule}});Object.defineProperty(E,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return X.LoneSchemaDefinitionRule}});Object.defineProperty(E,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return X.UniqueOperationTypesRule}});Object.defineProperty(E,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return X.UniqueTypeNamesRule}});Object.defineProperty(E,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return X.UniqueEnumValueNamesRule}});Object.defineProperty(E,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return X.UniqueFieldDefinitionNamesRule}});Object.defineProperty(E,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return X.UniqueDirectiveNamesRule}});Object.defineProperty(E,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return X.PossibleTypeExtensionsRule}});Object.defineProperty(E,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return X.NoDeprecatedCustomRule}});Object.defineProperty(E,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return X.NoSchemaIntrospectionCustomRule}});Object.defineProperty(E,"GraphQLError",{enumerable:!0,get:function(){return Fs.GraphQLError}});Object.defineProperty(E,"syntaxError",{enumerable:!0,get:function(){return Fs.syntaxError}});Object.defineProperty(E,"locatedError",{enumerable:!0,get:function(){return Fs.locatedError}});Object.defineProperty(E,"printError",{enumerable:!0,get:function(){return Fs.printError}});Object.defineProperty(E,"formatError",{enumerable:!0,get:function(){return Fs.formatError}});Object.defineProperty(E,"getIntrospectionQuery",{enumerable:!0,get:function(){return oe.getIntrospectionQuery}});Object.defineProperty(E,"getOperationAST",{enumerable:!0,get:function(){return oe.getOperationAST}});Object.defineProperty(E,"getOperationRootType",{enumerable:!0,get:function(){return oe.getOperationRootType}});Object.defineProperty(E,"introspectionFromSchema",{enumerable:!0,get:function(){return oe.introspectionFromSchema}});Object.defineProperty(E,"buildClientSchema",{enumerable:!0,get:function(){return oe.buildClientSchema}});Object.defineProperty(E,"buildASTSchema",{enumerable:!0,get:function(){return oe.buildASTSchema}});Object.defineProperty(E,"buildSchema",{enumerable:!0,get:function(){return oe.buildSchema}});Object.defineProperty(E,"getDescription",{enumerable:!0,get:function(){return oe.getDescription}});Object.defineProperty(E,"extendSchema",{enumerable:!0,get:function(){return oe.extendSchema}});Object.defineProperty(E,"lexicographicSortSchema",{enumerable:!0,get:function(){return oe.lexicographicSortSchema}});Object.defineProperty(E,"printSchema",{enumerable:!0,get:function(){return oe.printSchema}});Object.defineProperty(E,"printType",{enumerable:!0,get:function(){return oe.printType}});Object.defineProperty(E,"printIntrospectionSchema",{enumerable:!0,get:function(){return oe.printIntrospectionSchema}});Object.defineProperty(E,"typeFromAST",{enumerable:!0,get:function(){return oe.typeFromAST}});Object.defineProperty(E,"valueFromAST",{enumerable:!0,get:function(){return oe.valueFromAST}});Object.defineProperty(E,"valueFromASTUntyped",{enumerable:!0,get:function(){return oe.valueFromASTUntyped}});Object.defineProperty(E,"astFromValue",{enumerable:!0,get:function(){return oe.astFromValue}});Object.defineProperty(E,"TypeInfo",{enumerable:!0,get:function(){return oe.TypeInfo}});Object.defineProperty(E,"visitWithTypeInfo",{enumerable:!0,get:function(){return oe.visitWithTypeInfo}});Object.defineProperty(E,"coerceInputValue",{enumerable:!0,get:function(){return oe.coerceInputValue}});Object.defineProperty(E,"concatAST",{enumerable:!0,get:function(){return oe.concatAST}});Object.defineProperty(E,"separateOperations",{enumerable:!0,get:function(){return oe.separateOperations}});Object.defineProperty(E,"stripIgnoredCharacters",{enumerable:!0,get:function(){return oe.stripIgnoredCharacters}});Object.defineProperty(E,"isEqualType",{enumerable:!0,get:function(){return oe.isEqualType}});Object.defineProperty(E,"isTypeSubTypeOf",{enumerable:!0,get:function(){return oe.isTypeSubTypeOf}});Object.defineProperty(E,"doTypesOverlap",{enumerable:!0,get:function(){return oe.doTypesOverlap}});Object.defineProperty(E,"assertValidName",{enumerable:!0,get:function(){return oe.assertValidName}});Object.defineProperty(E,"isValidNameError",{enumerable:!0,get:function(){return oe.isValidNameError}});Object.defineProperty(E,"BreakingChangeType",{enumerable:!0,get:function(){return oe.BreakingChangeType}});Object.defineProperty(E,"DangerousChangeType",{enumerable:!0,get:function(){return oe.DangerousChangeType}});Object.defineProperty(E,"findBreakingChanges",{enumerable:!0,get:function(){return oe.findBreakingChanges}});Object.defineProperty(E,"findDangerousChanges",{enumerable:!0,get:function(){return oe.findDangerousChanges}});Object.defineProperty(E,"findDeprecatedUsages",{enumerable:!0,get:function(){return oe.findDeprecatedUsages}});var _0=xS(),b0=Qw(),P=zw(),be=Xw(),Yi=Zw(),S0=fO(),X=gO(),Fs=EO(),oe=E0()});var M0=y((ose,Cr)=>{p();var Jm=M("fs"),jc=M("path"),oY=M("os"),sY=M("crypto"),P0=["\u25C8 encrypted .env [www.dotenvx.com]","\u25C8 secrets for agents [www.dotenvx.com]","\u2301 auth for agents [www.vestauth.com]","\u2318 custom filepath { path: '/custom/path/.env' }","\u2318 enable debugging { debug: true }","\u2318 override existing { override: true }","\u2318 suppress logs { quiet: true }","\u2318 multiple files { path: ['.env.local', '.env'] }"];function aY(){return P0[Math.floor(Math.random()*P0.length)]}function Ji(e){return typeof e=="string"?!["false","0","no","off",""].includes(e.toLowerCase()):!!e}function uY(){return process.stdout.isTTY}function cY(e){return uY()?`\x1B[2m${e}\x1B[0m`:e}var lY=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function pY(e){let t={},r=e.toString();r=r.replace(/\r\n?/mg,`
|
|
200
|
+
`);let n;for(;(n=lY.exec(r))!=null;){let i=n[1],o=n[2]||"";o=o.trim();let s=o[0];o=o.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),s==='"'&&(o=o.replace(/\\n/g,`
|
|
201
|
+
`),o=o.replace(/\\r/g,"\r")),t[i]=o}return t}function dY(e){e=e||{};let t=j0(e);e.path=t;let r=He.configDotenv(e);if(!r.parsed){let s=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw s.code="MISSING_DATA",s}let n=k0(e).split(","),i=n.length,o;for(let s=0;s<i;s++)try{let a=n[s].trim(),u=hY(r,a);o=He.decrypt(u.ciphertext,u.key);break}catch(a){if(s+1>=i)throw a}return He.parse(o)}function fY(e){console.error(`\u26A0 ${e}`)}function Vs(e){console.log(`\u2506 ${e}`)}function L0(e){console.log(`\u25C7 ${e}`)}function k0(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0?process.env.DOTENV_KEY:""}function hY(e,t){let r;try{r=new URL(t)}catch(a){if(a.code==="ERR_INVALID_URL"){let u=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw u.code="INVALID_DOTENV_KEY",u}throw a}let n=r.password;if(!n){let a=new Error("INVALID_DOTENV_KEY: Missing key part");throw a.code="INVALID_DOTENV_KEY",a}let i=r.searchParams.get("environment");if(!i){let a=new Error("INVALID_DOTENV_KEY: Missing environment part");throw a.code="INVALID_DOTENV_KEY",a}let o=`DOTENV_VAULT_${i.toUpperCase()}`,s=e.parsed[o];if(!s){let a=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${o} in your .env.vault file.`);throw a.code="NOT_FOUND_DOTENV_ENVIRONMENT",a}return{ciphertext:s,key:n}}function j0(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(let r of e.path)Jm.existsSync(r)&&(t=r.endsWith(".vault")?r:`${r}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=jc.resolve(process.cwd(),".env.vault");return Jm.existsSync(t)?t:null}function D0(e){return e[0]==="~"?jc.join(oY.homedir(),e.slice(1)):e}function mY(e){let t=Ji(process.env.DOTENV_CONFIG_DEBUG||e&&e.debug),r=Ji(process.env.DOTENV_CONFIG_QUIET||e&&e.quiet);(t||!r)&&L0("loading env from encrypted .env.vault");let n=He._parseVault(e),i=process.env;return e&&e.processEnv!=null&&(i=e.processEnv),He.populate(i,n,e),{parsed:n}}function gY(e){let t=jc.resolve(process.cwd(),".env"),r="utf8",n=process.env;e&&e.processEnv!=null&&(n=e.processEnv);let i=Ji(n.DOTENV_CONFIG_DEBUG||e&&e.debug),o=Ji(n.DOTENV_CONFIG_QUIET||e&&e.quiet);e&&e.encoding?r=e.encoding:i&&Vs("no encoding is specified (UTF-8 is used by default)");let s=[t];if(e&&e.path)if(!Array.isArray(e.path))s=[D0(e.path)];else{s=[];for(let l of e.path)s.push(D0(l))}let a,u={};for(let l of s)try{let d=He.parse(Jm.readFileSync(l,{encoding:r}));He.populate(u,d,e)}catch(d){i&&Vs(`failed to load ${l} ${d.message}`),a=d}let c=He.populate(n,u,e);if(i=Ji(n.DOTENV_CONFIG_DEBUG||i),o=Ji(n.DOTENV_CONFIG_QUIET||o),i||!o){let l=Object.keys(c).length,d=[];for(let f of s)try{let h=jc.relative(process.cwd(),f);d.push(h)}catch(h){i&&Vs(`failed to load ${f} ${h.message}`),a=h}L0(`injected env (${l}) from ${d.join(",")} ${cY(`// tip: ${aY()}`)}`)}return a?{parsed:u,error:a}:{parsed:u}}function yY(e){if(k0(e).length===0)return He.configDotenv(e);let t=j0(e);return t?He._configVault(e):(fY(`you set DOTENV_KEY but you are missing a .env.vault file at ${t}`),He.configDotenv(e))}function vY(e,t){let r=Buffer.from(t.slice(-64),"hex"),n=Buffer.from(e,"base64"),i=n.subarray(0,12),o=n.subarray(-16);n=n.subarray(12,-16);try{let s=sY.createDecipheriv("aes-256-gcm",r,i);return s.setAuthTag(o),`${s.update(n)}${s.final()}`}catch(s){let a=s instanceof RangeError,u=s.message==="Invalid key length",c=s.message==="Unsupported state or unable to authenticate data";if(a||u){let l=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw l.code="INVALID_DOTENV_KEY",l}else if(c){let l=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw l.code="DECRYPTION_FAILED",l}else throw s}}function EY(e,t,r={}){let n=!!(r&&r.debug),i=!!(r&&r.override),o={};if(typeof t!="object"){let s=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw s.code="OBJECT_REQUIRED",s}for(let s of Object.keys(t))Object.prototype.hasOwnProperty.call(e,s)?(i===!0&&(e[s]=t[s],o[s]=t[s]),n&&Vs(i===!0?`"${s}" is already defined and WAS overwritten`:`"${s}" is already defined and was NOT overwritten`)):(e[s]=t[s],o[s]=t[s]);return o}var He={configDotenv:gY,_configVault:mY,_parseVault:dY,config:yY,decrypt:vY,parse:pY,populate:EY};Cr.exports.configDotenv=He.configDotenv;Cr.exports._configVault=He._configVault;Cr.exports._parseVault=He._parseVault;Cr.exports.config=He.config;Cr.exports.decrypt=He.decrypt;Cr.exports.parse=He.parse;Cr.exports.populate=He.populate;Cr.exports=He});var NA=y((Tse,xA)=>{p();xA.exports=Zi;function Zi(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Zi.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),r=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-r:e+r}return Math.min(e,this.max)|0};Zi.prototype.reset=function(){this.attempts=0};Zi.prototype.setMin=function(e){this.ms=e};Zi.prototype.setMax=function(e){this.max=e};Zi.prototype.setJitter=function(e){this.jitter=e}});var CA=y((wse,eg)=>{"use strict";p();var wY=Object.prototype.hasOwnProperty,dt="~";function Gs(){}Object.create&&(Gs.prototype=Object.create(null),new Gs().__proto__||(dt=!1));function OY(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function RA(e,t,r,n,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var o=new OY(r,n||e,i),s=dt?dt+t:t;return e._events[s]?e._events[s].fn?e._events[s]=[e._events[s],o]:e._events[s].push(o):(e._events[s]=o,e._eventsCount++),e}function Uc(e,t){--e._eventsCount===0?e._events=new Gs:delete e._events[t]}function ot(){this._events=new Gs,this._eventsCount=0}ot.prototype.eventNames=function(){var t=[],r,n;if(this._eventsCount===0)return t;for(n in r=this._events)wY.call(r,n)&&t.push(dt?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(r)):t};ot.prototype.listeners=function(t){var r=dt?dt+t:t,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i<o;i++)s[i]=n[i].fn;return s};ot.prototype.listenerCount=function(t){var r=dt?dt+t:t,n=this._events[r];return n?n.fn?1:n.length:0};ot.prototype.emit=function(t,r,n,i,o,s){var a=dt?dt+t:t;if(!this._events[a])return!1;var u=this._events[a],c=arguments.length,l,d;if(u.fn){switch(u.once&&this.removeListener(t,u.fn,void 0,!0),c){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,r),!0;case 3:return u.fn.call(u.context,r,n),!0;case 4:return u.fn.call(u.context,r,n,i),!0;case 5:return u.fn.call(u.context,r,n,i,o),!0;case 6:return u.fn.call(u.context,r,n,i,o,s),!0}for(d=1,l=new Array(c-1);d<c;d++)l[d-1]=arguments[d];u.fn.apply(u.context,l)}else{var f=u.length,h;for(d=0;d<f;d++)switch(u[d].once&&this.removeListener(t,u[d].fn,void 0,!0),c){case 1:u[d].fn.call(u[d].context);break;case 2:u[d].fn.call(u[d].context,r);break;case 3:u[d].fn.call(u[d].context,r,n);break;case 4:u[d].fn.call(u[d].context,r,n,i);break;default:if(!l)for(h=1,l=new Array(c-1);h<c;h++)l[h-1]=arguments[h];u[d].fn.apply(u[d].context,l)}}return!0};ot.prototype.on=function(t,r,n){return RA(this,t,r,n,!1)};ot.prototype.once=function(t,r,n){return RA(this,t,r,n,!0)};ot.prototype.removeListener=function(t,r,n,i){var o=dt?dt+t:t;if(!this._events[o])return this;if(!r)return Uc(this,o),this;var s=this._events[o];if(s.fn)s.fn===r&&(!i||s.once)&&(!n||s.context===n)&&Uc(this,o);else{for(var a=0,u=[],c=s.length;a<c;a++)(s[a].fn!==r||i&&!s[a].once||n&&s[a].context!==n)&&u.push(s[a]);u.length?this._events[o]=u.length===1?u[0]:u:Uc(this,o)}return this};ot.prototype.removeAllListeners=function(t){var r;return t?(r=dt?dt+t:t,this._events[r]&&Uc(this,r)):(this._events=new Gs,this._eventsCount=0),this};ot.prototype.off=ot.prototype.removeListener;ot.prototype.addListener=ot.prototype.on;ot.prefixed=dt;ot.EventEmitter=ot;typeof eg<"u"&&(eg.exports=ot)});var PA=y(tg=>{"use strict";p();Object.defineProperty(tg,"__esModule",{value:!0});function AY(e){return typeof e=="string"}tg.default=AY});var ng=y(rg=>{"use strict";p();Object.defineProperty(rg,"__esModule",{value:!0});function xY(e){return e!==null&&typeof e=="object"}rg.default=xY});var DA=y(ig=>{"use strict";p();Object.defineProperty(ig,"__esModule",{value:!0});ig.default=NY;function NY(e){var t,r=e.Symbol;return typeof r=="function"?r.observable?t=r.observable:(t=r("observable"),r.observable=t):t="@@observable",t}});var LA=y((sg,og)=>{"use strict";p();Object.defineProperty(sg,"__esModule",{value:!0});var RY=DA(),CY=PY(RY);function PY(e){return e&&e.__esModule?e:{default:e}}var eo;typeof self<"u"?eo=self:typeof window<"u"?eo=window:typeof global<"u"?eo=global:typeof og<"u"?eo=og:eo=Function("return this")();var DY=(0,CY.default)(eo);sg.default=DY});var Vc=y(to=>{"use strict";p();Object.defineProperty(to,"__esModule",{value:!0});to.GRAPHQL_SUBSCRIPTIONS=to.GRAPHQL_WS=void 0;var LY="graphql-ws";to.GRAPHQL_WS=LY;var kY="graphql-subscriptions";to.GRAPHQL_SUBSCRIPTIONS=kY});var kA=y(ro=>{"use strict";p();Object.defineProperty(ro,"__esModule",{value:!0});ro.WS_TIMEOUT=ro.MIN_WS_TIMEOUT=void 0;var jY=1e3;ro.MIN_WS_TIMEOUT=jY;var MY=3e4;ro.WS_TIMEOUT=MY});var $s=y(ag=>{"use strict";p();Object.defineProperty(ag,"__esModule",{value:!0});var FY=(function(){function e(){throw new Error("Static Class")}return e.GQL_CONNECTION_INIT="connection_init",e.GQL_CONNECTION_ACK="connection_ack",e.GQL_CONNECTION_ERROR="connection_error",e.GQL_CONNECTION_KEEP_ALIVE="ka",e.GQL_CONNECTION_TERMINATE="connection_terminate",e.GQL_START="start",e.GQL_DATA="data",e.GQL_ERROR="error",e.GQL_COMPLETE="complete",e.GQL_STOP="stop",e.SUBSCRIPTION_START="subscription_start",e.SUBSCRIPTION_DATA="subscription_data",e.SUBSCRIPTION_SUCCESS="subscription_success",e.SUBSCRIPTION_FAIL="subscription_fail",e.SUBSCRIPTION_END="subscription_end",e.INIT="init",e.INIT_SUCCESS="init_success",e.INIT_FAIL="init_fail",e.KEEP_ALIVE="keepalive",e})();ag.default=FY});var VA=y($t=>{"use strict";p();var no=$t&&$t.__assign||function(){return no=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},no.apply(this,arguments)},qY=$t&&$t.__awaiter||function(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(d){s(d)}}function u(l){try{c(n.throw(l))}catch(d){s(d)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(e,t||[])).next())})},UY=$t&&$t.__generator||function(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},jA=$t&&$t.__spreadArray||function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))};Object.defineProperty($t,"__esModule",{value:!0});$t.SubscriptionClient=void 0;var MA=typeof global<"u"?global:typeof window<"u"?window:{},VY=MA.WebSocket||MA.MozWebSocket,FA=NA(),GY=CA(),qA=PA(),$Y=ng(),BY=mt(),KY=Im(),HY=LA(),QY=Vc(),UA=kA(),ft=$s(),WY=(function(){function e(t,r,n,i){var o=r||{},s=o.connectionCallback,a=s===void 0?void 0:s,u=o.connectionParams,c=u===void 0?{}:u,l=o.minTimeout,d=l===void 0?UA.MIN_WS_TIMEOUT:l,f=o.timeout,h=f===void 0?UA.WS_TIMEOUT:f,g=o.reconnect,v=g===void 0?!1:g,_=o.reconnectionAttempts,S=_===void 0?1/0:_,b=o.lazy,A=b===void 0?!1:b,O=o.inactivityTimeout,T=O===void 0?0:O,x=o.wsOptionArguments,U=x===void 0?[]:x;if(this.wsImpl=n||VY,!this.wsImpl)throw new Error("Unable to find native implementation, or alternative implementation for WebSocket!");this.wsProtocols=i||QY.GRAPHQL_WS,this.connectionCallback=a,this.url=t,this.operations={},this.nextOperationId=0,this.minWsTimeout=d,this.wsTimeout=h,this.unsentMessagesQueue=[],this.reconnect=v,this.reconnecting=!1,this.reconnectionAttempts=S,this.lazy=!!A,this.inactivityTimeout=T,this.closedByUser=!1,this.backoff=new FA({jitter:.5}),this.eventEmitter=new GY.EventEmitter,this.middlewares=[],this.client=null,this.maxConnectTimeGenerator=this.createMaxConnectTimeGenerator(),this.connectionParams=this.getConnectionParams(c),this.wsOptionArguments=U,this.lazy||this.connect()}return Object.defineProperty(e.prototype,"status",{get:function(){return this.client===null?this.wsImpl.CLOSED:this.client.readyState},enumerable:!1,configurable:!0}),e.prototype.close=function(t,r){t===void 0&&(t=!0),r===void 0&&(r=!0),this.clearInactivityTimeout(),this.client!==null&&(this.closedByUser=r,t&&(this.clearCheckConnectionInterval(),this.clearMaxConnectTimeout(),this.clearTryReconnectTimeout(),this.unsubscribeAll(),this.sendMessage(void 0,ft.default.GQL_CONNECTION_TERMINATE,null)),this.client.close(),this.client.onopen=null,this.client.onclose=null,this.client.onerror=null,this.client.onmessage=null,this.client=null,this.eventEmitter.emit("disconnected"),t||this.tryReconnect())},e.prototype.request=function(t){var r,n=this.getObserver.bind(this),i=this.executeOperation.bind(this),o=this.unsubscribe.bind(this),s;return this.clearInactivityTimeout(),r={},r[HY.default]=function(){return this},r.subscribe=function(a,u,c){var l=n(a,u,c);return s=i(t,function(d,f){d===null&&f===null?l.complete&&l.complete():d?l.error&&l.error(d[0]):l.next&&l.next(f)}),{unsubscribe:function(){s&&(o(s),s=null)}}},r},e.prototype.on=function(t,r,n){var i=this.eventEmitter.on(t,r,n);return function(){i.off(t,r,n)}},e.prototype.onConnected=function(t,r){return this.on("connected",t,r)},e.prototype.onConnecting=function(t,r){return this.on("connecting",t,r)},e.prototype.onDisconnected=function(t,r){return this.on("disconnected",t,r)},e.prototype.onReconnected=function(t,r){return this.on("reconnected",t,r)},e.prototype.onReconnecting=function(t,r){return this.on("reconnecting",t,r)},e.prototype.onError=function(t,r){return this.on("error",t,r)},e.prototype.unsubscribeAll=function(){var t=this;Object.keys(this.operations).forEach(function(r){t.unsubscribe(r)})},e.prototype.applyMiddlewares=function(t){var r=this;return new Promise(function(n,i){var o=function(s,a){var u=function(c){if(c)i(c);else if(s.length>0){var l=s.shift();l&&l.applyMiddleware.apply(a,[t,u])}else n(t)};u()};o(jA([],r.middlewares,!0),r)})},e.prototype.use=function(t){var r=this;return t.map(function(n){if(typeof n.applyMiddleware=="function")r.middlewares.push(n);else throw new Error("Middleware must implement the applyMiddleware function.")}),this},e.prototype.getConnectionParams=function(t){return function(){return new Promise(function(r,n){if(typeof t=="function")try{return r(t.call(null))}catch(i){return n(i)}r(t)})}},e.prototype.executeOperation=function(t,r){var n=this;this.client===null&&this.connect();var i=this.generateOperationId();return this.operations[i]={options:t,handler:r},this.applyMiddlewares(t).then(function(o){n.checkOperationOptions(o,r),n.operations[i]&&(n.operations[i]={options:o,handler:r},n.sendMessage(i,ft.default.GQL_START,o))}).catch(function(o){n.unsubscribe(i),r(n.formatErrors(o))}),i},e.prototype.getObserver=function(t,r,n){return typeof t=="function"?{next:function(i){return t(i)},error:function(i){return r&&r(i)},complete:function(){return n&&n()}}:t},e.prototype.createMaxConnectTimeGenerator=function(){var t=this.minWsTimeout,r=this.wsTimeout;return new FA({min:t,max:r,factor:1.2})},e.prototype.clearCheckConnectionInterval=function(){this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnectionIntervalId=null)},e.prototype.clearMaxConnectTimeout=function(){this.maxConnectTimeoutId&&(clearTimeout(this.maxConnectTimeoutId),this.maxConnectTimeoutId=null)},e.prototype.clearTryReconnectTimeout=function(){this.tryReconnectTimeoutId&&(clearTimeout(this.tryReconnectTimeoutId),this.tryReconnectTimeoutId=null)},e.prototype.clearInactivityTimeout=function(){this.inactivityTimeoutId&&(clearTimeout(this.inactivityTimeoutId),this.inactivityTimeoutId=null)},e.prototype.setInactivityTimeout=function(){var t=this;this.inactivityTimeout>0&&Object.keys(this.operations).length===0&&(this.inactivityTimeoutId=setTimeout(function(){Object.keys(t.operations).length===0&&t.close()},this.inactivityTimeout))},e.prototype.checkOperationOptions=function(t,r){var n=t.query,i=t.variables,o=t.operationName;if(!n)throw new Error("Must provide a query.");if(!r)throw new Error("Must provide an handler.");if(!(0,qA.default)(n)&&!(0,KY.getOperationAST)(n,o)||o&&!(0,qA.default)(o)||i&&!(0,$Y.default)(i))throw new Error("Incorrect option types. query must be a string or a document,`operationName` must be a string, and `variables` must be an object.")},e.prototype.buildMessage=function(t,r,n){var i=n&&n.query?no(no({},n),{query:typeof n.query=="string"?n.query:(0,BY.print)(n.query)}):n;return{id:t,type:r,payload:i}},e.prototype.formatErrors=function(t){return Array.isArray(t)?t:t&&t.errors?this.formatErrors(t.errors):t&&t.message?[t]:[{name:"FormatedError",message:"Unknown error",originalError:t}]},e.prototype.sendMessage=function(t,r,n){this.sendMessageRaw(this.buildMessage(t,r,n))},e.prototype.sendMessageRaw=function(t){switch(this.status){case this.wsImpl.OPEN:var r=JSON.stringify(t);try{JSON.parse(r)}catch{this.eventEmitter.emit("error",new Error("Message must be JSON-serializable. Got: "+t))}this.client.send(r);break;case this.wsImpl.CONNECTING:this.unsentMessagesQueue.push(t);break;default:this.reconnecting||this.eventEmitter.emit("error",new Error("A message was not sent because socket is not connected, is closing or is already closed. Message was: "+JSON.stringify(t)))}},e.prototype.generateOperationId=function(){return String(++this.nextOperationId)},e.prototype.tryReconnect=function(){var t=this;if(!(!this.reconnect||this.backoff.attempts>=this.reconnectionAttempts)){this.reconnecting||(Object.keys(this.operations).forEach(function(n){t.unsentMessagesQueue.push(t.buildMessage(n,ft.default.GQL_START,t.operations[n].options))}),this.reconnecting=!0),this.clearTryReconnectTimeout();var r=this.backoff.duration();this.tryReconnectTimeoutId=setTimeout(function(){t.connect()},r)}},e.prototype.flushUnsentMessagesQueue=function(){var t=this;this.unsentMessagesQueue.forEach(function(r){t.sendMessageRaw(r)}),this.unsentMessagesQueue=[]},e.prototype.checkConnection=function(){if(this.wasKeepAliveReceived){this.wasKeepAliveReceived=!1;return}this.reconnecting||this.close(!1,!0)},e.prototype.checkMaxConnectTimeout=function(){var t=this;this.clearMaxConnectTimeout(),this.maxConnectTimeoutId=setTimeout(function(){t.status!==t.wsImpl.OPEN&&(t.reconnecting=!0,t.close(!1,!0))},this.maxConnectTimeGenerator.duration())},e.prototype.connect=function(){var t,r=this;this.client=new((t=this.wsImpl).bind.apply(t,jA([void 0,this.url,this.wsProtocols],this.wsOptionArguments,!1))),this.checkMaxConnectTimeout(),this.client.onopen=function(){return qY(r,void 0,void 0,function(){var n,i;return UY(this,function(o){switch(o.label){case 0:if(this.status!==this.wsImpl.OPEN)return[3,4];this.clearMaxConnectTimeout(),this.closedByUser=!1,this.eventEmitter.emit(this.reconnecting?"reconnecting":"connecting"),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.connectionParams()];case 2:return n=o.sent(),this.sendMessage(void 0,ft.default.GQL_CONNECTION_INIT,n),this.flushUnsentMessagesQueue(),[3,4];case 3:return i=o.sent(),this.sendMessage(void 0,ft.default.GQL_CONNECTION_ERROR,i),this.flushUnsentMessagesQueue(),[3,4];case 4:return[2]}})})},this.client.onclose=function(){r.closedByUser||r.close(!1,!1)},this.client.onerror=function(n){r.eventEmitter.emit("error",n)},this.client.onmessage=function(n){var i=n.data;r.processReceivedData(i)}},e.prototype.processReceivedData=function(t){var r,n;try{r=JSON.parse(t),n=r.id}catch{throw new Error("Message must be JSON-parseable. Got: "+t)}if([ft.default.GQL_DATA,ft.default.GQL_COMPLETE,ft.default.GQL_ERROR].indexOf(r.type)!==-1&&!this.operations[n]){this.unsubscribe(n);return}switch(r.type){case ft.default.GQL_CONNECTION_ERROR:this.connectionCallback&&this.connectionCallback(r.payload);break;case ft.default.GQL_CONNECTION_ACK:this.eventEmitter.emit(this.reconnecting?"reconnected":"connected",r.payload),this.reconnecting=!1,this.backoff.reset(),this.maxConnectTimeGenerator.reset(),this.connectionCallback&&this.connectionCallback();break;case ft.default.GQL_COMPLETE:var i=this.operations[n].handler;delete this.operations[n],i.call(this,null,null);break;case ft.default.GQL_ERROR:this.operations[n].handler(this.formatErrors(r.payload),null),delete this.operations[n];break;case ft.default.GQL_DATA:var o=r.payload.errors?no(no({},r.payload),{errors:this.formatErrors(r.payload.errors)}):r.payload;this.operations[n].handler(null,o);break;case ft.default.GQL_CONNECTION_KEEP_ALIVE:var s=typeof this.wasKeepAliveReceived>"u";this.wasKeepAliveReceived=!0,s&&this.checkConnection(),this.checkConnectionIntervalId&&(clearInterval(this.checkConnectionIntervalId),this.checkConnection()),this.checkConnectionIntervalId=setInterval(this.checkConnection.bind(this),this.wsTimeout);break;default:throw new Error("Invalid message type!")}},e.prototype.unsubscribe=function(t){this.operations[t]&&(delete this.operations[t],this.setInactivityTimeout(),this.sendMessage(t,ft.default.GQL_STOP,void 0))},e})();$t.SubscriptionClient=WY});var zn=y((Gse,GA)=>{"use strict";p();GA.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),EMPTY_BUFFER:Buffer.alloc(0),NOOP:()=>{}}});var Bs=y((Bse,ug)=>{"use strict";p();var{EMPTY_BUFFER:zY}=zn();function $A(e,t){if(e.length===0)return zY;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let i=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return n<t?r.slice(0,n):r}function BA(e,t,r,n,i){for(let o=0;o<i;o++)r[n+o]=e[o]^t[o&3]}function KA(e,t){let r=e.length;for(let n=0;n<r;n++)e[n]^=t[n&3]}function HA(e){return e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}function Gc(e){if(Gc.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=Buffer.from(e):ArrayBuffer.isView(e)?t=Buffer.from(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Gc.readOnly=!1),t}try{let e=M("bufferutil"),t=e.BufferUtil||e;ug.exports={concat:$A,mask(r,n,i,o,s){s<48?BA(r,n,i,o,s):t.mask(r,n,i,o,s)},toArrayBuffer:HA,toBuffer:Gc,unmask(r,n){r.length<32?KA(r,n):t.unmask(r,n)}}}catch{ug.exports={concat:$A,mask:BA,toArrayBuffer:HA,toBuffer:Gc,unmask:KA}}});var zA=y((Hse,WA)=>{"use strict";p();var QA=Symbol("kDone"),cg=Symbol("kRun"),lg=class{constructor(t){this[QA]=()=>{this.pending--,this[cg]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[cg]()}[cg](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[QA])}}};WA.exports=lg});var Qs=y((Wse,ZA)=>{"use strict";p();var Ks=M("zlib"),YA=Bs(),YY=zA(),{kStatusCode:JA,NOOP:JY}=zn(),XY=Buffer.from([0,0,255,255]),Kc=Symbol("permessage-deflate"),Pr=Symbol("total-length"),Hs=Symbol("callback"),ln=Symbol("buffers"),Bc=Symbol("error"),$c,pg=class{constructor(t,r,n){if(this._maxPayload=n|0,this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!$c){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;$c=new YY(i)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[Hs];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),t}decompress(t,r,n){$c.add(i=>{this._decompress(t,r,(o,s)=>{i(),n(o,s)})})}compress(t,r,n){$c.add(i=>{this._compress(t,r,(o,s)=>{i(),n(o,s)})})}_decompress(t,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?Ks.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Ks.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Kc]=this,this._inflate[Pr]=0,this._inflate[ln]=[],this._inflate.on("error",eJ),this._inflate.on("data",XA)}this._inflate[Hs]=n,this._inflate.write(t),r&&this._inflate.write(XY),this._inflate.flush(()=>{let o=this._inflate[Bc];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=YA.concat(this._inflate[ln],this._inflate[Pr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[Pr]=0,this._inflate[ln]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,s)})}_compress(t,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?Ks.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Ks.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[Pr]=0,this._deflate[ln]=[],this._deflate.on("error",JY),this._deflate.on("data",ZY)}this._deflate[Hs]=n,this._deflate.write(t),this._deflate.flush(Ks.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=YA.concat(this._deflate[ln],this._deflate[Pr]);r&&(o=o.slice(0,o.length-4)),this._deflate[Hs]=null,this._deflate[Pr]=0,this._deflate[ln]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};ZA.exports=pg;function ZY(e){this[ln].push(e),this[Pr]+=e.length}function XA(e){if(this[Pr]+=e.length,this[Kc]._maxPayload<1||this[Pr]<=this[Kc]._maxPayload){this[ln].push(e);return}this[Bc]=new RangeError("Max payload size exceeded"),this[Bc].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Bc][JA]=1009,this.removeListener("data",XA),this.reset()}function eJ(e){this[Kc]._inflate=null,e[JA]=1007,this[Hs](e)}});var fg=y((Yse,dg)=>{"use strict";p();function ex(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function tx(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}try{let e=M("utf-8-validate");typeof e=="object"&&(e=e.Validation.isValidUTF8),dg.exports={isValidStatusCode:ex,isValidUTF8(t){return t.length<150?tx(t):e(t)}}}catch{dg.exports={isValidStatusCode:ex,isValidUTF8:tx}}});var yg=y((Xse,ax)=>{"use strict";p();var{Writable:tJ}=M("stream"),rx=Qs(),{BINARY_TYPES:rJ,EMPTY_BUFFER:nJ,kStatusCode:iJ,kWebSocket:oJ}=zn(),{concat:hg,toArrayBuffer:sJ,unmask:aJ}=Bs(),{isValidStatusCode:uJ,isValidUTF8:nx}=fg(),Ws=0,ix=1,ox=2,sx=3,mg=4,cJ=5,gg=class extends tJ{constructor(t,r,n,i,o,s){super(),this._binaryType=t||rJ[0],this[oJ]=void 0,this._extensions=r||{},this._isServer=!!n,this._maxBufferedChunks=o|0,this._maxFragments=s|0,this._maxPayload=i|0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=Ws,this._loop=!1}_write(t,r,n){if(this._opcode===8&&this._state==Ws)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks)return n(Le(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=n.slice(t),n.slice(0,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],i=r.length-t;t>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),i),this._buffers[0]=n.slice(t)),t-=n.length}while(t>0);return r}startLoop(t){let r;this._loop=!0;do switch(this._state){case Ws:r=this.getInfo();break;case ix:r=this.getPayloadLength16();break;case ox:r=this.getPayloadLength64();break;case sx:this.getMask();break;case mg:r=this.getData(t);break;default:this._loop=!1;return}while(this._loop);t(r)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0)return this._loop=!1,Le(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");let r=(t[0]&64)===64;if(r&&!this._extensions[rx.extensionName])return this._loop=!1,Le(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(r)return this._loop=!1,Le(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,Le(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,Le(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,Le(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(r)return this._loop=!1,Le(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125)return this._loop=!1,Le(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,Le(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked)return this._loop=!1,Le(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,Le(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=ix;else if(this._payloadLength===127)this._state=ox;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),r=t.readUInt32BE(0);return r>Math.pow(2,21)-1?(this._loop=!1,Le(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=r*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,Le(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=sx:this._state=mg}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=mg}getData(t){let r=nJ;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&aJ(r,this._mask)}if(this._opcode>7)return this.controlMessage(r);if(this._compressed){this._state=cJ,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments)return this._loop=!1,Le(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");this._messageLength=this._totalPayloadLength,this._fragments.push(r)}return this.dataMessage()}decompress(t,r){this._extensions[rx.extensionName].decompress(t,this._fin,(i,o)=>{if(i)return r(i);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return r(Le(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));if(this._maxFragments>0&&this._fragments.length>=this._maxFragments)return r(Le(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));this._fragments.push(o)}let s=this.dataMessage();if(s)return r(s);this.startLoop(r)})}dataMessage(){if(this._fin){let t=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=hg(r,t):this._binaryType==="arraybuffer"?n=sJ(hg(r,t)):n=r,this.emit("message",n)}else{let n=hg(r,t);if(!nx(n))return this._loop=!1,Le(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",n.toString())}}this._state=Ws}controlMessage(t){if(this._opcode===8)if(this._loop=!1,t.length===0)this.emit("conclude",1005,""),this.end();else{if(t.length===1)return Le(RangeError,"invalid payload length 1",!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");{let r=t.readUInt16BE(0);if(!uJ(r))return Le(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");let n=t.slice(2);if(!nx(n))return Le(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",r,n.toString()),this.end()}}else this._opcode===9?this.emit("ping",t):this.emit("pong",t);this._state=Ws}};ax.exports=gg;function Le(e,t,r,n,i){let o=new e(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,Le),o.code=i,o[iJ]=n,o}});var Eg=y((rae,lx)=>{"use strict";p();var eae=M("net"),tae=M("tls"),{randomFillSync:lJ}=M("crypto"),ux=Qs(),{EMPTY_BUFFER:pJ}=zn(),{isValidStatusCode:dJ}=fg(),{mask:cx,toBuffer:Dr}=Bs(),Yn=Buffer.alloc(4),vg=class e{constructor(t,r){this._extensions=r||{},this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,r){let n=r.mask&&r.readOnly,i=r.mask?6:2,o=t.length;t.length>=65536?(i+=8,o=127):t.length>125&&(i+=2,o=126);let s=Buffer.allocUnsafe(n?t.length+i:i);return s[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(s[0]|=64),s[1]=o,o===126?s.writeUInt16BE(t.length,2):o===127&&(s.writeUInt32BE(0,2),s.writeUInt32BE(t.length,6)),r.mask?(lJ(Yn,0,4),s[1]|=128,s[i-4]=Yn[0],s[i-3]=Yn[1],s[i-2]=Yn[2],s[i-1]=Yn[3],n?(cx(t,Yn,s,i,t.length),[s]):(cx(t,Yn,t,0,t.length),[s,t])):[s,t]}close(t,r,n,i){let o;if(t===void 0)o=pJ;else{if(typeof t!="number"||!dJ(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||r==="")o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let s=Buffer.byteLength(r);if(s>123)throw new RangeError("The message must not be greater than 123 bytes");o=Buffer.allocUnsafe(2+s),o.writeUInt16BE(t,0),o.write(r,2)}}this._deflating?this.enqueue([this.doClose,o,n,i]):this.doClose(o,n,i)}doClose(t,r,n){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:8,mask:r,readOnly:!1}),n)}ping(t,r,n){let i=Dr(t);if(i.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPing,i,r,Dr.readOnly,n]):this.doPing(i,r,Dr.readOnly,n)}doPing(t,r,n,i){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:9,mask:r,readOnly:n}),i)}pong(t,r,n){let i=Dr(t);if(i.length>125)throw new RangeError("The data size must not be greater than 125 bytes");this._deflating?this.enqueue([this.doPong,i,r,Dr.readOnly,n]):this.doPong(i,r,Dr.readOnly,n)}doPong(t,r,n,i){this.sendFrame(e.frame(t,{fin:!0,rsv1:!1,opcode:10,mask:r,readOnly:n}),i)}send(t,r,n){let i=Dr(t),o=this._extensions[ux.extensionName],s=r.binary?2:1,a=r.compress;if(this._firstFragment?(this._firstFragment=!1,a&&o&&(a=i.length>=o._threshold),this._compress=a):(a=!1,s=0),r.fin&&(this._firstFragment=!0),o){let u={fin:r.fin,rsv1:a,opcode:s,mask:r.mask,readOnly:Dr.readOnly};this._deflating?this.enqueue([this.dispatch,i,this._compress,u,n]):this.dispatch(i,this._compress,u,n)}else this.sendFrame(e.frame(i,{fin:r.fin,rsv1:!1,opcode:s,mask:r.mask,readOnly:Dr.readOnly}),n)}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let o=this._extensions[ux.extensionName];this._bufferedBytes+=t.length,this._deflating=!0,o.compress(t,n.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");typeof i=="function"&&i(u);for(let c=0;c<this._queue.length;c++){let l=this._queue[c][4];typeof l=="function"&&l(u)}return}this._bufferedBytes-=t.length,this._deflating=!1,n.readOnly=!1,this.sendFrame(e.frame(a,n),i),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[1].length,Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[1].length,this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};lx.exports=vg});var dx=y((iae,px)=>{"use strict";p();var io=class{constructor(t,r){this.target=r,this.type=t}},_g=class extends io{constructor(t,r){super("message",r),this.data=t}},bg=class extends io{constructor(t,r,n){super("close",n),this.wasClean=n._closeFrameReceived&&n._closeFrameSent,this.reason=r,this.code=t}},Sg=class extends io{constructor(t){super("open",t)}},Tg=class extends io{constructor(t,r){super("error",r),this.message=t.message,this.error=t}},fJ={addEventListener(e,t,r){if(typeof t!="function")return;function n(u){t.call(this,new _g(u,this))}function i(u,c){t.call(this,new bg(u,c,this))}function o(u){t.call(this,new Tg(u,this))}function s(){t.call(this,new Sg(this))}let a=r&&r.once?"once":"on";e==="message"?(n._listener=t,this[a](e,n)):e==="close"?(i._listener=t,this[a](e,i)):e==="error"?(o._listener=t,this[a](e,o)):e==="open"?(s._listener=t,this[a](e,s)):this[a](e,t)},removeEventListener(e,t){let r=this.listeners(e);for(let n=0;n<r.length;n++)(r[n]===t||r[n]._listener===t)&&this.removeListener(e,r[n])}};px.exports=fJ});var Ig=y((sae,fx)=>{"use strict";p();var zs=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function vr(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function hJ(e){let t=Object.create(null);if(e===void 0||e==="")return t;let r=Object.create(null),n=!1,i=!1,o=!1,s,a,u=-1,c=-1,l=0;for(;l<e.length;l++){let f=e.charCodeAt(l);if(s===void 0)if(c===-1&&zs[f]===1)u===-1&&(u=l);else if(f===32||f===9)c===-1&&u!==-1&&(c=l);else if(f===59||f===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1&&(c=l);let h=e.slice(u,c);f===44?(vr(t,h,r),r=Object.create(null)):s=h,u=c=-1}else throw new SyntaxError(`Unexpected character at index ${l}`);else if(a===void 0)if(c===-1&&zs[f]===1)u===-1&&(u=l);else if(f===32||f===9)c===-1&&u!==-1&&(c=l);else if(f===59||f===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1&&(c=l),vr(r,e.slice(u,c),!0),f===44&&(vr(t,s,r),r=Object.create(null),s=void 0),u=c=-1}else if(f===61&&u!==-1&&c===-1)a=e.slice(u,l),u=c=-1;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(i){if(zs[f]!==1)throw new SyntaxError(`Unexpected character at index ${l}`);u===-1?u=l:n||(n=!0),i=!1}else if(o)if(zs[f]===1)u===-1&&(u=l);else if(f===34&&u!==-1)o=!1,c=l;else if(f===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${l}`);else if(f===34&&e.charCodeAt(l-1)===61)o=!0;else if(c===-1&&zs[f]===1)u===-1&&(u=l);else if(u!==-1&&(f===32||f===9))c===-1&&(c=l);else if(f===59||f===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${l}`);c===-1&&(c=l);let h=e.slice(u,c);n&&(h=h.replace(/\\/g,""),n=!1),vr(r,a,h),f===44&&(vr(t,s,r),r=Object.create(null),s=void 0),a=void 0,u=c=-1}else throw new SyntaxError(`Unexpected character at index ${l}`)}if(u===-1||o)throw new SyntaxError("Unexpected end of input");c===-1&&(c=l);let d=e.slice(u,c);return s===void 0?vr(t,d,r):(a===void 0?vr(r,d,!0):n?vr(r,a,d.replace(/\\/g,"")):vr(r,a,d),vr(t,s,r)),t}function mJ(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(i=>{let o=n[i];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?i:`${i}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}fx.exports={format:mJ,parse:hJ}});var Rg=y((cae,Tx)=>{"use strict";p();var gJ=M("events"),yJ=M("https"),vJ=M("http"),gx=M("net"),EJ=M("tls"),{randomBytes:_J,createHash:bJ}=M("crypto"),{Readable:uae}=M("stream"),{URL:wg}=M("url"),pn=Qs(),SJ=yg(),TJ=Eg(),{BINARY_TYPES:hx,EMPTY_BUFFER:Og,GUID:IJ,kStatusCode:wJ,kWebSocket:st,NOOP:yx}=zn(),{addEventListener:OJ,removeEventListener:AJ}=dx(),{format:xJ,parse:NJ}=Ig(),{toBuffer:RJ}=Bs(),Lr=["CONNECTING","OPEN","CLOSING","CLOSED"],Ag=[8,13],CJ=30*1e3,Me=class e extends gJ{constructor(t,r,n){super(),this._binaryType=hx[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage="",this._closeTimer=null,this._extensions={},this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,Array.isArray(r)?r=r.join(", "):typeof r=="object"&&r!==null&&(n=r,r=void 0),vx(this,t,r,n)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(t){hx.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get onclose(){}set onclose(t){}get onerror(){}set onerror(t){}get onopen(){}set onopen(t){}get onmessage(){}set onmessage(t){}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,n,i,o){let s=new SJ(this.binaryType,this._extensions,this._isServer,n,i,o);this._sender=new TJ(t,this._extensions),this._receiver=s,this._socket=t,s[st]=this,t[st]=this,s.on("conclude",LJ),s.on("drain",kJ),s.on("error",jJ),s.on("message",MJ),s.on("ping",FJ),s.on("pong",qJ),t.setTimeout(0),t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",_x),t.on("data",Hc),t.on("end",bx),t.on("error",Sx),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[pn.extensionName]&&this._extensions[pn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING)return Ot(this,this._req,"WebSocket was closed before the connection was established");if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),CJ)}}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Ng(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||Og,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Ng(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||Og,r,n)}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){Ng(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[pn.extensionName]||(i.compress=!1),this._sender.send(t||Og,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING)return Ot(this,this._req,"WebSocket was closed before the connection was established");this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Me,"CONNECTING",{enumerable:!0,value:Lr.indexOf("CONNECTING")});Object.defineProperty(Me.prototype,"CONNECTING",{enumerable:!0,value:Lr.indexOf("CONNECTING")});Object.defineProperty(Me,"OPEN",{enumerable:!0,value:Lr.indexOf("OPEN")});Object.defineProperty(Me.prototype,"OPEN",{enumerable:!0,value:Lr.indexOf("OPEN")});Object.defineProperty(Me,"CLOSING",{enumerable:!0,value:Lr.indexOf("CLOSING")});Object.defineProperty(Me.prototype,"CLOSING",{enumerable:!0,value:Lr.indexOf("CLOSING")});Object.defineProperty(Me,"CLOSED",{enumerable:!0,value:Lr.indexOf("CLOSED")});Object.defineProperty(Me.prototype,"CLOSED",{enumerable:!0,value:Lr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Me.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Me.prototype,`on${e}`,{enumerable:!0,get(){let t=this.listeners(e);for(let r=0;r<t.length;r++)if(t[r]._listener)return t[r]._listener},set(t){let r=this.listeners(e);for(let n=0;n<r.length;n++)r[n]._listener&&this.removeListener(e,r[n]);this.addEventListener(e,t)}})});Me.prototype.addEventListener=OJ;Me.prototype.removeEventListener=AJ;Tx.exports=Me;function vx(e,t,r,n){let i={protocolVersion:Ag[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:void 0,host:void 0,path:void 0,port:void 0};if(!Ag.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Ag.join(", ")})`);let o;t instanceof wg?(o=t,e._url=t.href):(o=new wg(t),e._url=t);let s=o.protocol==="ws+unix:";if(!o.host&&(!s||!o.pathname)){let h=new Error(`Invalid URL: ${e.url}`);if(e._redirects===0)throw h;xg(e,h);return}let a=o.protocol==="wss:"||o.protocol==="https:",u=a?443:80,c=_J(16).toString("base64"),l=a?yJ.get:vJ.get,d;if(i.createConnection=a?DJ:PJ,i.defaultPort=i.defaultPort||u,i.port=o.port||u,i.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,i.headers={"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":c,Connection:"Upgrade",Upgrade:"websocket",...i.headers},i.path=o.pathname+o.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(d=new pn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=xJ({[pn.extensionName]:d.offer()})),r&&(i.headers["Sec-WebSocket-Protocol"]=r),i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(o.username||o.password)&&(i.auth=`${o.username}:${o.password}`),s){let h=i.path.split(":");i.socketPath=h[0],i.path=h[1]}if(i.followRedirects){if(e._redirects===0){e._originalUnixSocket=s,e._originalSecure=a,e._originalHostOrSocketPath=s?i.socketPath:o.host;let h=n&&n.headers;if(n={...n,headers:{}},h)for(let[g,v]of Object.entries(h))n.headers[g.toLowerCase()]=v}else{let h=s?e._originalUnixSocket?i.socketPath===e._originalHostOrSocketPath:!1:e._originalUnixSocket?!1:o.host===e._originalHostOrSocketPath;(!h||e._originalSecure&&!a)&&(delete i.headers.authorization,delete i.headers.cookie,h||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64"))}let f=e._req=l(i);i.timeout&&f.on("timeout",()=>{Ot(e,f,"Opening handshake has timed out")}),f.on("error",h=>{f===null||f.aborted||(f=e._req=null,xg(e,h))}),f.on("response",h=>{let g=h.headers.location,v=h.statusCode;if(g&&i.followRedirects&&v>=300&&v<400){if(++e._redirects>i.maxRedirects){Ot(e,f,"Maximum redirects exceeded");return}f.abort();let _;try{_=new wg(g,t)}catch(S){xg(e,S);return}vx(e,_,r,n)}else e.emit("unexpected-response",f,h)||Ot(e,f,`Unexpected server response: ${h.statusCode}`)}),f.on("upgrade",(h,g,v)=>{if(e.emit("upgrade",h),e.readyState!==Me.CONNECTING)return;f=e._req=null;let _=h.headers.upgrade;if(_===void 0||_.toLowerCase()!=="websocket"){Ot(e,g,"Invalid Upgrade header");return}let S=bJ("sha1").update(c+IJ).digest("base64");if(h.headers["sec-websocket-accept"]!==S){Ot(e,g,"Invalid Sec-WebSocket-Accept header");return}let b=h.headers["sec-websocket-protocol"],A=(r||"").split(/, */),O;if(!r&&b?O="Server sent a subprotocol but none was requested":r&&!b?O="Server sent no subprotocol":b&&!A.includes(b)&&(O="Server sent an invalid subprotocol"),O){Ot(e,g,O);return}b&&(e._protocol=b);let T=h.headers["sec-websocket-extensions"];if(T!==void 0){if(!d){Ot(e,g,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let x;try{x=NJ(T)}catch{Ot(e,g,"Invalid Sec-WebSocket-Extensions header");return}let U=Object.keys(x);if(U.length){if(U.length!==1||U[0]!==pn.extensionName){Ot(e,g,"Server indicated an extension that was not requested");return}try{d.accept(x[pn.extensionName])}catch{Ot(e,g,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[pn.extensionName]=d}}e.setSocket(g,v,i.maxPayload,i.maxBufferedChunks,i.maxFragments)})}function xg(e,t){e._readyState=Me.CLOSING,e.emit("error",t),e.emitClose()}function PJ(e){return e.path=e.socketPath,gx.connect(e)}function DJ(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=gx.isIP(e.host)?"":e.host),EJ.connect(e)}function Ot(e,t,r){e._readyState=Me.CLOSING;let n=new Error(r);Error.captureStackTrace(n,Ot),t.setHeader?(t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),t.once("abort",e.emitClose.bind(e)),e.emit("error",n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function Ng(e,t,r){if(t){let n=RJ(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${Lr[e.readyState]})`);r(n)}}function LJ(e,t){let r=this[st];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[st]!==void 0&&(r._socket.removeListener("data",Hc),process.nextTick(Ex,r._socket),e===1005?r.close():r.close(e,t))}function kJ(){this[st]._socket.resume()}function jJ(e){let t=this[st];t._socket[st]!==void 0&&(t._socket.removeListener("data",Hc),process.nextTick(Ex,t._socket),t.close(e[wJ])),t.emit("error",e)}function mx(){this[st].emitClose()}function MJ(e){this[st].emit("message",e)}function FJ(e){let t=this[st];t.pong(e,!t._isServer,yx),t.emit("ping",e)}function qJ(e){this[st].emit("pong",e)}function Ex(e){e.resume()}function _x(){let e=this[st];this.removeListener("close",_x),this.removeListener("data",Hc),this.removeListener("end",bx),e._readyState=Me.CLOSING;let t;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(t=e._socket.read())!==null&&e._receiver.write(t),e._receiver.end(),this[st]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",mx),e._receiver.on("finish",mx))}function Hc(e){this[st]._receiver.write(e)||this.pause()}function bx(){let e=this[st];e._readyState=Me.CLOSING,e._receiver.end(),this.end()}function Sx(){let e=this[st];this.removeListener("error",Sx),this.on("error",yx),e&&(e._readyState=Me.CLOSING,this.destroy())}});var Ax=y((pae,Ox)=>{"use strict";p();var{Duplex:UJ}=M("stream");function Ix(e){e.emit("close")}function VJ(){!this.destroyed&&this._writableState.finished&&this.destroy()}function wx(e){this.removeListener("error",wx),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function GJ(e,t){let r=!0,n=!0;function i(){r&&e._socket.resume()}e.readyState===e.CONNECTING?e.once("open",function(){e._receiver.removeAllListeners("drain"),e._receiver.on("drain",i)}):(e._receiver.removeAllListeners("drain"),e._receiver.on("drain",i));let o=new UJ({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(a){o.push(a)||(r=!1,e._socket.pause())}),e.once("error",function(a){o.destroyed||(n=!1,o.destroy(a))}),e.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(s,a){if(e.readyState===e.CLOSED){a(s),process.nextTick(Ix,o);return}let u=!1;e.once("error",function(l){u=!0,a(l)}),e.once("close",function(){u||a(s),process.nextTick(Ix,o)}),n&&e.terminate()},o._final=function(s){if(e.readyState===e.CONNECTING){e.once("open",function(){o._final(s)});return}e._socket!==null&&(e._socket._writableState.finished?(s(),o._readableState.endEmitted&&o.destroy()):(e._socket.once("finish",function(){s()}),e.close()))},o._read=function(){(e.readyState===e.OPEN||e.readyState===e.CLOSING)&&!r&&(r=!0,e._receiver._writableState.needDrain||e._socket.resume())},o._write=function(s,a,u){if(e.readyState===e.CONNECTING){e.once("open",function(){o._write(s,a,u)});return}e.send(s,u)},o.on("end",VJ),o.on("error",wx),o}Ox.exports=GJ});var Px=y((gae,Cx)=>{"use strict";p();var $J=M("events"),Qc=M("http"),fae=M("https"),hae=M("net"),mae=M("tls"),{createHash:BJ}=M("crypto"),Jn=Qs(),KJ=Rg(),{format:HJ,parse:QJ}=Ig(),{GUID:WJ,kWebSocket:zJ}=zn(),YJ=/^[+/0-9A-Za-z]{22}==$/,xx=0,Nx=1,Rx=2,Pg=class extends $J{constructor(t,r){if(super(),t={maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Qc.createServer((n,i)=>{let o=Qc.STATUS_CODES[426];i.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),i.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=JJ(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,o,s)=>{this.handleUpgrade(i,o,s,n)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set),this.options=t,this._state=xx}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(t&&this.once("close",t),this._state===Rx){process.nextTick(Cg,this);return}if(this._state===Nx)return;if(this._state=Nx,this.clients)for(let n of this.clients)n.terminate();let r=this._server;if(r&&(this._removeListeners(),this._removeListeners=this._server=null,this.options.port!=null)){r.close(Cg.bind(void 0,this));return}process.nextTick(Cg,this)}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,i){r.on("error",Dg);let o=t.headers["sec-websocket-key"]!==void 0?t.headers["sec-websocket-key"].trim():!1,s=t.headers.upgrade,a=+t.headers["sec-websocket-version"],u={};if(t.method!=="GET"||s===void 0||s.toLowerCase()!=="websocket"||!o||!YJ.test(o)||a!==8&&a!==13||!this.shouldHandle(t))return Ys(r,400);if(this.options.perMessageDeflate){let c=new Jn(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let l=QJ(t.headers["sec-websocket-extensions"]);l[Jn.extensionName]&&(c.accept(l[Jn.extensionName]),u[Jn.extensionName]=c)}catch{return Ys(r,400)}}if(this.options.verifyClient){let c={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(c,(l,d,f,h)=>{if(!l)return Ys(r,d||401,f,h);this.completeUpgrade(o,u,t,r,n,i)});return}if(!this.options.verifyClient(c))return Ys(r,401)}this.completeUpgrade(o,u,t,r,n,i)}completeUpgrade(t,r,n,i,o,s){if(!i.readable||!i.writable)return i.destroy();if(i[zJ])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>xx)return Ys(i,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${BJ("sha1").update(t+WJ).digest("base64")}`],c=new KJ(null),l=n.headers["sec-websocket-protocol"];if(l&&(l=l.split(",").map(XJ),this.options.handleProtocols?l=this.options.handleProtocols(l,n):l=l[0],l&&(u.push(`Sec-WebSocket-Protocol: ${l}`),c._protocol=l)),r[Jn.extensionName]){let d=r[Jn.extensionName].params,f=HJ({[Jn.extensionName]:[d]});u.push(`Sec-WebSocket-Extensions: ${f}`),c._extensions=r}this.emit("headers",u,n),i.write(u.concat(`\r
|
|
202
202
|
`).join(`\r
|
|
203
|
-
`)),i.removeListener("error",
|
|
203
|
+
`)),i.removeListener("error",Dg),c.setSocket(i,o,this.options.maxPayload,this.options.maxBufferedChunks,this.options.maxFragments),this.clients&&(this.clients.add(c),c.on("close",()=>this.clients.delete(c))),s(c,n)}};Cx.exports=Pg;function JJ(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function Cg(e){e._state=Rx,e.emit("close")}function Dg(){this.destroy()}function Ys(e,t,r,n){e.writable&&(r=r||Qc.STATUS_CODES[t],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...n},e.write(`HTTP/1.1 ${t} ${Qc.STATUS_CODES[t]}\r
|
|
204
204
|
`+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
|
|
205
205
|
`)+`\r
|
|
206
206
|
\r
|
|
207
|
-
`+r)),e.removeListener("error",Rg),e.destroy()}function $J(e){return e.trim()}});var Nx=y((cae,xx)=>{"use strict";p();var Ys=Ag();Ys.createWebSocketStream=Sx();Ys.Server=Ax();Ys.Receiver=hg();Ys.Sender=gg();xx.exports=Ys});var Fg=y(ht=>{"use strict";p();ht.isIterable=Rx;ht.isArrayLike=Qc;ht.isCollection=HJ;ht.getIterator=Dg;ht.getIteratorMethod=Lg;ht.createIterator=Cx;ht.forEach=QJ;ht.isAsyncIterable=zJ;ht.getAsyncIterator=Px;ht.getAsyncIteratorMethod=jg;ht.createAsyncIterator=Dx;ht.forAwaitEach=YJ;var Hc=typeof Symbol=="function"?Symbol:void 0,Cg=Hc&&Hc.iterator,KJ=ht.$$iterator=Cg||"@@iterator";function Rx(e){return!!Lg(e)}function Qc(e){var t=e!=null&&e.length;return typeof t=="number"&&t>=0&&t%1===0}function HJ(e){return Object(e)===e&&(Qc(e)||Rx(e))}function Dg(e){var t=Lg(e);if(t)return t.call(e)}function Lg(e){if(e!=null){var t=Cg&&e[Cg]||e["@@iterator"];if(typeof t=="function")return t}}function Cx(e){if(e!=null){var t=Dg(e);if(t)return t;if(Qc(e))return new kg(e)}}function kg(e){this._o=e,this._i=0}kg.prototype[KJ]=function(){return this};kg.prototype.next=function(){return this._o===void 0||this._i>=this._o.length?(this._o=void 0,{value:void 0,done:!0}):{value:this._o[this._i++],done:!1}};function QJ(e,t,r){if(e!=null){if(typeof e.forEach=="function")return e.forEach(t,r);var n=0,i=Dg(e);if(i){for(var o;!(o=i.next()).done;)if(t.call(r,o.value,n++,e),n>9999999)throw new TypeError("Near-infinite iteration.")}else if(Qc(e))for(;n<e.length;n++)e.hasOwnProperty(n)&&t.call(r,e[n],n,e)}}var Pg=Hc&&Hc.asyncIterator,WJ=ht.$$asyncIterator=Pg||"@@asyncIterator";function zJ(e){return!!jg(e)}function Px(e){var t=jg(e);if(t)return t.call(e)}function jg(e){if(e!=null){var t=Pg&&e[Pg]||e["@@asyncIterator"];if(typeof t=="function")return t}}function Dx(e){if(e!=null){var t=Px(e);if(t)return t;var r=Cx(e);if(r)return new Js(r)}}function Js(e){this._i=e}Js.prototype[WJ]=function(){return this};Js.prototype.next=function(e){return Mg(this._i,"next",e)};Js.prototype.return=function(e){return this._i.return?Mg(this._i,"return",e):Promise.resolve({value:e,done:!0})};Js.prototype.throw=function(e){return this._i.throw?Mg(this._i,"throw",e):Promise.reject(e)};function Mg(e,t,r){var n;return new Promise(function(i){n=e[t](r),i(n.value)}).then(function(i){return{value:i,done:n.done}})}function YJ(e,t,r){var n=Dx(e);if(n){var i=0;return new Promise(function(o,s){function a(){return n.next().then(function(u){return u.done?o():Promise.resolve(t.call(r,u.value,i++,e)).then(a).catch(s),null}).catch(s),null}a()})}}});var Lx=y(Wc=>{"use strict";p();Object.defineProperty(Wc,"__esModule",{value:!0});Wc.createEmptyIterable=void 0;var JJ=Fg(),XJ=function(){var e;return e={next:function(){return Promise.resolve({value:void 0,done:!0})},return:function(){return Promise.resolve({value:void 0,done:!0})},throw:function(t){return Promise.reject(t)}},e[JJ.$$asyncIterator]=function(){return this},e};Wc.createEmptyIterable=XJ});var kx=y(zc=>{"use strict";p();Object.defineProperty(zc,"__esModule",{value:!0});zc.isASubscriptionOperation=void 0;var ZJ=Qn(),e2=function(e,t){var r=(0,ZJ.getOperationAST)(e,t);return!!r&&r.operation==="subscription"};zc.isASubscriptionOperation=e2});var jx=y(io=>{"use strict";p();var Et=io&&io.__assign||function(){return Et=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Et.apply(this,arguments)};Object.defineProperty(io,"__esModule",{value:!0});io.parseLegacyProtocolMessage=void 0;var at=Gs(),t2=function(e,t){var r=t;switch(t.type){case at.default.INIT:e.isLegacy=!0,r=Et(Et({},t),{type:at.default.GQL_CONNECTION_INIT});break;case at.default.SUBSCRIPTION_START:r={id:t.id,type:at.default.GQL_START,payload:{query:t.query,operationName:t.operationName,variables:t.variables}};break;case at.default.SUBSCRIPTION_END:r=Et(Et({},t),{type:at.default.GQL_STOP});break;case at.default.GQL_CONNECTION_ACK:e.isLegacy&&(r=Et(Et({},t),{type:at.default.INIT_SUCCESS}));break;case at.default.GQL_CONNECTION_ERROR:e.isLegacy&&(r=Et(Et({},t),{type:at.default.INIT_FAIL,payload:t.payload.message?{error:t.payload.message}:t.payload}));break;case at.default.GQL_ERROR:e.isLegacy&&(r=Et(Et({},t),{type:at.default.SUBSCRIPTION_FAIL}));break;case at.default.GQL_DATA:e.isLegacy&&(r=Et(Et({},t),{type:at.default.SUBSCRIPTION_DATA}));break;case at.default.GQL_COMPLETE:e.isLegacy&&(r=null);break;case at.default.SUBSCRIPTION_SUCCESS:e.isLegacy||(r=null);break;default:break}return r};io.parseLegacyProtocolMessage=t2});var qx=y(Yc=>{"use strict";p();Object.defineProperty(Yc,"__esModule",{value:!0});Yc.SubscriptionServer=void 0;var qg=Nx(),rt=Gs(),Mx=qc(),r2=eg(),Ug=Qn(),n2=Lx(),Vg=Fg(),i2=kx(),Fx=jx(),o2=function(e){return e.on},s2=(function(){function e(t,r){var n=this,i=t.onOperation,o=t.onOperationComplete,s=t.onConnect,a=t.onDisconnect,u=t.keepAlive;this.specifiedRules=t.validationRules||Ug.specifiedRules,this.loadExecutor(t),this.onOperation=i,this.onOperationComplete=o,this.onConnect=s,this.onDisconnect=a,this.keepAlive=u,o2(r)?this.wsServer=r:this.wsServer=new qg.Server(r||{});var c=(function(l,d){if(l.upgradeReq=d,l.protocol===void 0||l.protocol.indexOf(Mx.GRAPHQL_WS)===-1&&l.protocol.indexOf(Mx.GRAPHQL_SUBSCRIPTIONS)===-1){l.close(1002);return}var f=Object.create(null);f.initPromise=Promise.resolve(!0),f.isLegacy=!1,f.socket=l,f.request=d,f.operations={};var h=function(g){g&&(n.sendError(f,"",{message:g.message?g.message:g},rt.default.GQL_CONNECTION_ERROR),setTimeout(function(){f.socket.close(1011)},10)),n.onClose(f),n.onDisconnect&&n.onDisconnect(l,f)};l.on("error",h),l.on("close",h),l.on("message",n.onMessage(f))});this.wsServer.on("connection",c),this.closeHandler=function(){n.wsServer.removeListener("connection",c),n.wsServer.close()}}return e.create=function(t,r){return new e(t,r)},Object.defineProperty(e.prototype,"server",{get:function(){return this.wsServer},enumerable:!1,configurable:!0}),e.prototype.close=function(){this.closeHandler()},e.prototype.loadExecutor=function(t){var r=t.execute,n=t.subscribe,i=t.schema,o=t.rootValue;if(!r)throw new Error("Must provide `execute` for websocket server constructor.");this.schema=i,this.rootValue=o,this.execute=r,this.subscribe=n},e.prototype.unsubscribe=function(t,r){t.operations&&t.operations[r]&&(t.operations[r].return&&t.operations[r].return(),delete t.operations[r],this.onOperationComplete&&this.onOperationComplete(t.socket,r))},e.prototype.onClose=function(t){var r=this;Object.keys(t.operations).forEach(function(n){r.unsubscribe(t,n)})},e.prototype.onMessage=function(t){var r=this;return function(n){var i;try{i=(0,Fx.parseLegacyProtocolMessage)(t,JSON.parse(n))}catch(s){r.sendError(t,null,{message:s.message},rt.default.GQL_CONNECTION_ERROR);return}var o=i.id;switch(i.type){case rt.default.GQL_CONNECTION_INIT:r.onConnect&&(t.initPromise=new Promise(function(s,a){try{s(r.onConnect(i.payload,t.socket,t))}catch(u){a(u)}})),t.initPromise.then(function(s){if(s===!1)throw new Error("Prohibited connection!");if(r.sendMessage(t,void 0,rt.default.GQL_CONNECTION_ACK,void 0),r.keepAlive){r.sendKeepAlive(t);var a=setInterval(function(){t.socket.readyState===qg.OPEN?r.sendKeepAlive(t):clearInterval(a)},r.keepAlive)}}).catch(function(s){r.sendError(t,o,{message:s.message},rt.default.GQL_CONNECTION_ERROR),setTimeout(function(){t.socket.close(1011)},10)});break;case rt.default.GQL_CONNECTION_TERMINATE:t.socket.close();break;case rt.default.GQL_START:t.initPromise.then(function(s){t.operations&&t.operations[o]&&r.unsubscribe(t,o);var a={query:i.payload.query,variables:i.payload.variables,operationName:i.payload.operationName,context:(0,r2.default)(s)?Object.assign(Object.create(Object.getPrototypeOf(s)),s):{},formatResponse:void 0,formatError:void 0,callback:void 0,schema:r.schema},u=Promise.resolve(a);if(t.operations[o]=(0,n2.createEmptyIterable)(),r.onOperation){var c=i;u=Promise.resolve(r.onOperation(c,a,t.socket))}return u.then(function(l){if(typeof l!="object"){var d="Invalid params returned from onOperation! return values must be an object!";throw r.sendError(t,o,{message:d}),new Error(d)}if(!l.schema){var d="Missing schema information. The GraphQL schema should be provided either statically in the `SubscriptionServer` constructor or as a property on the object returned from onOperation!";throw r.sendError(t,o,{message:d}),new Error(d)}var f=typeof a.query!="string"?a.query:(0,Ug.parse)(a.query),h,g=(0,Ug.validate)(l.schema,f,r.specifiedRules);if(g.length>0)h=Promise.resolve({errors:g});else{var v=r.execute;r.subscribe&&(0,i2.isASubscriptionOperation)(f,l.operationName)&&(v=r.subscribe),h=Promise.resolve(v({schema:l.schema,document:f,rootValue:r.rootValue,contextValue:l.context,variableValues:l.variables,operationName:l.operationName}))}return h.then(function(_){return{executionIterable:(0,Vg.isAsyncIterable)(_)?_:(0,Vg.createAsyncIterator)([_]),params:l}})}).then(function(l){var d=l.executionIterable,f=l.params;return(0,Vg.forAwaitEach)(d,function(h){var g=h;if(f.formatResponse)try{g=f.formatResponse(h,f)}catch(v){console.error("Error in formatResponse function:",v)}r.sendMessage(t,o,rt.default.GQL_DATA,g)}).then(function(){r.sendMessage(t,o,rt.default.GQL_COMPLETE,null)}).catch(function(h){var g=h;if(f.formatError)try{g=f.formatError(h,f)}catch(v){console.error("Error in formatError function: ",v)}Object.keys(g).length===0&&(g={name:g.name,message:g.message}),r.sendError(t,o,g)}),d}).then(function(l){t.operations[o]=l}).then(function(){r.sendMessage(t,o,rt.default.SUBSCRIPTION_SUCCESS,void 0)}).catch(function(l){l.errors?r.sendMessage(t,o,rt.default.GQL_DATA,{errors:l.errors}):r.sendError(t,o,{message:l.message}),r.unsubscribe(t,o)})}).catch(function(s){r.sendError(t,o,{message:s.message}),r.unsubscribe(t,o)});break;case rt.default.GQL_STOP:r.unsubscribe(t,o);break;default:r.sendError(t,o,{message:"Invalid message type!"})}}},e.prototype.sendKeepAlive=function(t){t.isLegacy?this.sendMessage(t,void 0,rt.default.KEEP_ALIVE,void 0):this.sendMessage(t,void 0,rt.default.GQL_CONNECTION_KEEP_ALIVE,void 0)},e.prototype.sendMessage=function(t,r,n,i){var o=(0,Fx.parseLegacyProtocolMessage)(t,{type:n,id:r,payload:i});o&&t.socket.readyState===qg.OPEN&&t.socket.send(JSON.stringify(o))},e.prototype.sendError=function(t,r,n,i){var o=i||rt.default.GQL_ERROR;if([rt.default.GQL_CONNECTION_ERROR,rt.default.GQL_ERROR].indexOf(o)===-1)throw new Error("overrideDefaultErrorType should be one of the allowed error messages GQL_CONNECTION_ERROR or GQL_ERROR");this.sendMessage(t,r,o,n)},e})();Yc.SubscriptionServer=s2});var Ux=y(tr=>{"use strict";p();var a2=tr&&tr.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Gg=tr&&tr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&a2(t,e,r)};Object.defineProperty(tr,"__esModule",{value:!0});tr.MessageTypes=void 0;Gg(jA(),tr);Gg(qx(),tr);var u2=Gs();Object.defineProperty(tr,"MessageTypes",{enumerable:!0,get:function(){return u2.default}});Gg(qc(),tr)});var kr=y((Tae,Bx)=>{"use strict";p();var Vx=["nodebuffer","arraybuffer","fragments"],Gx=typeof Blob<"u";Gx&&Vx.push("blob");Bx.exports={BINARY_TYPES:Vx,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Gx,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Xs=y((Oae,Jc)=>{"use strict";p();var{EMPTY_BUFFER:c2}=kr(),Bg=Buffer[Symbol.species];function l2(e,t){if(e.length===0)return c2;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let i=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return n<t?new Bg(r.buffer,r.byteOffset,n):r}function $x(e,t,r,n,i){for(let o=0;o<i;o++)r[n+o]=e[o]^t[o&3]}function Kx(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function p2(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function $g(e){if($g.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Bg(e):ArrayBuffer.isView(e)?t=new Bg(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),$g.readOnly=!1),t}Jc.exports={concat:l2,mask:$x,toArrayBuffer:p2,toBuffer:$g,unmask:Kx};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=M("bufferutil");Jc.exports.mask=function(t,r,n,i,o){o<48?$x(t,r,n,i,o):e.mask(t,r,n,i,o)},Jc.exports.unmask=function(t,r){t.length<32?Kx(t,r):e.unmask(t,r)}}catch{}});var Wx=y((Aae,Qx)=>{"use strict";p();var Hx=Symbol("kDone"),Kg=Symbol("kRun"),Hg=class{constructor(t){this[Hx]=()=>{this.pending--,this[Kg]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Kg]()}[Kg](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Hx])}}};Qx.exports=Hg});var ao=y((Nae,Xx)=>{"use strict";p();var Zs=M("zlib"),zx=Xs(),d2=Wx(),{kStatusCode:Yx}=kr(),f2=Buffer[Symbol.species],h2=Buffer.from([0,0,255,255]),Zc=Symbol("permessage-deflate"),jr=Symbol("total-length"),oo=Symbol("callback"),pn=Symbol("buffers"),so=Symbol("error"),Xc,Qg=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!Xc){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Xc=new d2(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[oo];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),t}decompress(t,r,n){Xc.add(i=>{this._decompress(t,r,(o,s)=>{i(),n(o,s)})})}compress(t,r,n){Xc.add(i=>{this._compress(t,r,(o,s)=>{i(),n(o,s)})})}_decompress(t,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?Zs.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=Zs.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[Zc]=this,this._inflate[jr]=0,this._inflate[pn]=[],this._inflate.on("error",g2),this._inflate.on("data",Jx)}this._inflate[oo]=n,this._inflate.write(t),r&&this._inflate.write(h2),this._inflate.flush(()=>{let o=this._inflate[so];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=zx.concat(this._inflate[pn],this._inflate[jr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[jr]=0,this._inflate[pn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,s)})}_compress(t,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?Zs.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=Zs.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[jr]=0,this._deflate[pn]=[],this._deflate.on("data",m2)}this._deflate[oo]=n,this._deflate.write(t),this._deflate.flush(Zs.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=zx.concat(this._deflate[pn],this._deflate[jr]);r&&(o=new f2(o.buffer,o.byteOffset,o.length-4)),this._deflate[oo]=null,this._deflate[jr]=0,this._deflate[pn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};Xx.exports=Qg;function m2(e){this[pn].push(e),this[jr]+=e.length}function Jx(e){if(this[jr]+=e.length,this[Zc]._maxPayload<1||this[jr]<=this[Zc]._maxPayload){this[pn].push(e);return}this[so]=new RangeError("Max payload size exceeded"),this[so].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[so][Yx]=1009,this.removeListener("data",Jx),this.reset()}function g2(e){if(this[Zc]._inflate=null,this[so]){this[oo](this[so]);return}e[Yx]=1007,this[oo](e)}});var uo=y((Cae,el)=>{"use strict";p();var{isUtf8:Zx}=M("buffer"),{hasBlob:y2}=kr(),v2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function E2(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function Wg(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function _2(e){return y2&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}el.exports={isBlob:_2,isValidStatusCode:E2,isValidUTF8:Wg,tokenChars:v2};if(Zx)el.exports.isValidUTF8=function(e){return e.length<24?Wg(e):Zx(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=M("utf-8-validate");el.exports.isValidUTF8=function(t){return t.length<32?Wg(t):e(t)}}catch{}});var Zg=y((Dae,sN)=>{"use strict";p();var{Writable:b2}=M("stream"),eN=ao(),{BINARY_TYPES:S2,EMPTY_BUFFER:tN,kStatusCode:T2,kWebSocket:I2}=kr(),{concat:zg,toArrayBuffer:O2,unmask:w2}=Xs(),{isValidStatusCode:A2,isValidUTF8:rN}=uo(),tl=Buffer[Symbol.species],$t=0,nN=1,iN=2,oN=3,Yg=4,Jg=5,rl=6,Xg=class extends b2{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||S2[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[I2]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=$t}_write(t,r,n){if(this._opcode===8&&this._state==$t)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){n(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new tl(n.buffer,n.byteOffset+t,n.length-t),new tl(n.buffer,n.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],i=r.length-t;t>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),i),this._buffers[0]=new tl(n.buffer,n.byteOffset+t,n.length-t)),t-=n.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case $t:this.getInfo(t);break;case nN:this.getPayloadLength16(t);break;case iN:this.getPayloadLength64(t);break;case oN:this.getMask();break;case Yg:this.getData(t);break;case Jg:case rl:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(i);return}let n=(r[0]&64)===64;if(n&&!this._extensions[eN.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(i);return}this._payloadLength===126?this._state=nN:this._payloadLength===127?this._state=iN:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),n=r.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(i);return}this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=oN:this._state=Yg}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Yg}getData(t){let r=tN;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&w2(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=Jg,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let n=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(n);return}this._messageLength=this._totalPayloadLength,this._fragments.push(r)}this.dataMessage(t)}decompress(t,r){this._extensions[eN.extensionName].decompress(t,this._fin,(i,o)=>{if(i)return r(i);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(s);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let s=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");r(s);return}this._fragments.push(o)}this.dataMessage(r),this._state===$t&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=$t;return}let r=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=zg(n,r):this._binaryType==="arraybuffer"?i=O2(zg(n,r)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=$t):(this._state=rl,setImmediate(()=>{this.emit("message",i,!0),this._state=$t,this.startLoop(t)}))}else{let i=zg(n,r);if(!this._skipUTF8Validation&&!rN(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._state===Jg||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=$t):(this._state=rl,setImmediate(()=>{this.emit("message",i,!1),this._state=$t,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,tN),this.end();else{let n=t.readUInt16BE(0);if(!A2(n)){let o=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let i=new tl(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!rN(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(o);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=$t;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=$t):(this._state=rl,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=$t,this.startLoop(r)}))}createError(t,r,n,i,o){this._loop=!1,this._errored=!0;let s=new t(n?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=o,s[T2]=i,s}};sN.exports=Xg});var ry=y((jae,cN)=>{"use strict";p();var{Duplex:kae}=M("stream"),{randomFillSync:x2}=M("crypto"),{types:{isUint8Array:N2}}=M("util"),aN=ao(),{EMPTY_BUFFER:R2,kWebSocket:C2,NOOP:P2}=kr(),{isBlob:co,isValidStatusCode:D2}=uo(),{mask:uN,toBuffer:Xn}=Xs(),Kt=Symbol("kByteLength"),L2=Buffer.alloc(4),nl=8*1024,Zn,lo=nl,rr=0,k2=1,j2=2,ey=class e{constructor(t,r,n){this._extensions=r||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=rr,this.onerror=P2,this[C2]=void 0}static frame(t,r){let n,i=!1,o=2,s=!1;r.mask&&(n=r.maskBuffer||L2,r.generateMask?r.generateMask(n):(lo===nl&&(Zn===void 0&&(Zn=Buffer.alloc(nl)),x2(Zn,0,nl),lo=0),n[0]=Zn[lo++],n[1]=Zn[lo++],n[2]=Zn[lo++],n[3]=Zn[lo++]),s=(n[0]|n[1]|n[2]|n[3])===0,o=6);let a;typeof t=="string"?(!r.mask||s)&&r[Kt]!==void 0?a=r[Kt]:(t=Buffer.from(t),a=t.length):(a=t.length,i=r.mask&&r.readOnly&&!s);let u=a;a>=65536?(o+=8,u=127):a>125&&(o+=2,u=126);let c=Buffer.allocUnsafe(i?a+o:o);return c[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(c[0]|=64),c[1]=u,u===126?c.writeUInt16BE(a,2):u===127&&(c[2]=c[3]=0,c.writeUIntBE(a,4,6)),r.mask?(c[1]|=128,c[o-4]=n[0],c[o-3]=n[1],c[o-2]=n[2],c[o-1]=n[3],s?[c,t]:i?(uN(t,n,c,o,a),[c]):(uN(t,n,t,0,a),[c,t])):[c,t]}close(t,r,n,i){let o;if(t===void 0)o=R2;else{if(typeof t!="number"||!D2(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(o=Buffer.allocUnsafe(2+a),o.writeUInt16BE(t,0),typeof r=="string")o.write(r,2);else if(N2(r))o.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[Kt]:o.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==rr?this.enqueue([this.dispatch,o,!1,s,i]):this.sendFrame(e.frame(o,s),i)}ping(t,r,n){let i,o;if(typeof t=="string"?(i=Buffer.byteLength(t),o=!1):co(t)?(i=t.size,o=!1):(t=Xn(t),i=t.length,o=Xn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Kt]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};co(t)?this._state!==rr?this.enqueue([this.getBlobData,t,!1,s,n]):this.getBlobData(t,!1,s,n):this._state!==rr?this.enqueue([this.dispatch,t,!1,s,n]):this.sendFrame(e.frame(t,s),n)}pong(t,r,n){let i,o;if(typeof t=="string"?(i=Buffer.byteLength(t),o=!1):co(t)?(i=t.size,o=!1):(t=Xn(t),i=t.length,o=Xn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Kt]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};co(t)?this._state!==rr?this.enqueue([this.getBlobData,t,!1,s,n]):this.getBlobData(t,!1,s,n):this._state!==rr?this.enqueue([this.dispatch,t,!1,s,n]):this.sendFrame(e.frame(t,s),n)}send(t,r,n){let i=this._extensions[aN.extensionName],o=r.binary?2:1,s=r.compress,a,u;typeof t=="string"?(a=Buffer.byteLength(t),u=!1):co(t)?(a=t.size,u=!1):(t=Xn(t),a=t.length,u=Xn.readOnly),this._firstFragment?(this._firstFragment=!1,s&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=i._threshold),this._compress=s):(s=!1,o=0),r.fin&&(this._firstFragment=!0);let c={[Kt]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:u,rsv1:s};co(t)?this._state!==rr?this.enqueue([this.getBlobData,t,this._compress,c,n]):this.getBlobData(t,this._compress,c,n):this._state!==rr?this.enqueue([this.dispatch,t,this._compress,c,n]):this.dispatch(t,this._compress,c,n)}getBlobData(t,r,n,i){this._bufferedBytes+=n[Kt],this._state=j2,t.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(ty,this,a,i);return}this._bufferedBytes-=n[Kt];let s=Xn(o);r?this.dispatch(s,r,n,i):(this._state=rr,this.sendFrame(e.frame(s,n),i),this.dequeue())}).catch(o=>{process.nextTick(M2,this,o,i)})}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let o=this._extensions[aN.extensionName];this._bufferedBytes+=n[Kt],this._state=k2,o.compress(t,n.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");ty(this,u,i);return}this._bufferedBytes-=n[Kt],this._state=rr,n.readOnly=!1,this.sendFrame(e.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===rr&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Kt],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Kt],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};cN.exports=ey;function ty(e,t,r){typeof r=="function"&&r(t);for(let n=0;n<e._queue.length;n++){let i=e._queue[n],o=i[i.length-1];typeof o=="function"&&o(t)}}function M2(e,t,r){ty(e,t,r),e.onerror(t)}});var vN=y((Fae,yN)=>{"use strict";p();var{kForOnEventAttribute:ea,kListener:ny}=kr(),lN=Symbol("kCode"),pN=Symbol("kData"),dN=Symbol("kError"),fN=Symbol("kMessage"),hN=Symbol("kReason"),po=Symbol("kTarget"),mN=Symbol("kType"),gN=Symbol("kWasClean"),Mr=class{constructor(t){this[po]=null,this[mN]=t}get target(){return this[po]}get type(){return this[mN]}};Object.defineProperty(Mr.prototype,"target",{enumerable:!0});Object.defineProperty(Mr.prototype,"type",{enumerable:!0});var ei=class extends Mr{constructor(t,r={}){super(t),this[lN]=r.code===void 0?0:r.code,this[hN]=r.reason===void 0?"":r.reason,this[gN]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[lN]}get reason(){return this[hN]}get wasClean(){return this[gN]}};Object.defineProperty(ei.prototype,"code",{enumerable:!0});Object.defineProperty(ei.prototype,"reason",{enumerable:!0});Object.defineProperty(ei.prototype,"wasClean",{enumerable:!0});var fo=class extends Mr{constructor(t,r={}){super(t),this[dN]=r.error===void 0?null:r.error,this[fN]=r.message===void 0?"":r.message}get error(){return this[dN]}get message(){return this[fN]}};Object.defineProperty(fo.prototype,"error",{enumerable:!0});Object.defineProperty(fo.prototype,"message",{enumerable:!0});var ta=class extends Mr{constructor(t,r={}){super(t),this[pN]=r.data===void 0?null:r.data}get data(){return this[pN]}};Object.defineProperty(ta.prototype,"data",{enumerable:!0});var F2={addEventListener(e,t,r={}){for(let i of this.listeners(e))if(!r[ea]&&i[ny]===t&&!i[ea])return;let n;if(e==="message")n=function(o,s){let a=new ta("message",{data:s?o:o.toString()});a[po]=this,il(t,this,a)};else if(e==="close")n=function(o,s){let a=new ei("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[po]=this,il(t,this,a)};else if(e==="error")n=function(o){let s=new fo("error",{error:o,message:o.message});s[po]=this,il(t,this,s)};else if(e==="open")n=function(){let o=new Mr("open");o[po]=this,il(t,this,o)};else return;n[ea]=!!r[ea],n[ny]=t,r.once?this.once(e,n):this.on(e,n)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[ny]===t&&!r[ea]){this.removeListener(e,r);break}}};yN.exports={CloseEvent:ei,ErrorEvent:fo,Event:Mr,EventTarget:F2,MessageEvent:ta};function il(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var ol=y((Uae,EN)=>{"use strict";p();var{tokenChars:ra}=uo();function Er(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function q2(e){let t=Object.create(null),r=Object.create(null),n=!1,i=!1,o=!1,s,a,u=-1,c=-1,l=-1,d=0;for(;d<e.length;d++)if(c=e.charCodeAt(d),s===void 0)if(l===-1&&ra[c]===1)u===-1&&(u=d);else if(d!==0&&(c===32||c===9))l===-1&&u!==-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let h=e.slice(u,l);c===44?(Er(t,h,r),r=Object.create(null)):s=h,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);else if(a===void 0)if(l===-1&&ra[c]===1)u===-1&&(u=d);else if(c===32||c===9)l===-1&&u!==-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d),Er(r,e.slice(u,l),!0),c===44&&(Er(t,s,r),r=Object.create(null),s=void 0),u=l=-1}else if(c===61&&u!==-1&&l===-1)a=e.slice(u,d),u=l=-1;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(i){if(ra[c]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);u===-1?u=d:n||(n=!0),i=!1}else if(o)if(ra[c]===1)u===-1&&(u=d);else if(c===34&&u!==-1)o=!1,l=d;else if(c===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(c===34&&e.charCodeAt(d-1)===61)o=!0;else if(l===-1&&ra[c]===1)u===-1&&(u=d);else if(u!==-1&&(c===32||c===9))l===-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let h=e.slice(u,l);n&&(h=h.replace(/\\/g,""),n=!1),Er(r,a,h),c===44&&(Er(t,s,r),r=Object.create(null),s=void 0),a=void 0,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);if(u===-1||o||c===32||c===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=d);let f=e.slice(u,l);return s===void 0?Er(t,f,r):(a===void 0?Er(r,f,!0):n?Er(r,a,f.replace(/\\/g,"")):Er(r,a,f),Er(t,s,r)),t}function U2(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(i=>{let o=n[i];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?i:`${i}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}EN.exports={format:U2,parse:q2}});var cl=y(($ae,CN)=>{"use strict";p();var V2=M("events"),G2=M("https"),B2=M("http"),SN=M("net"),$2=M("tls"),{randomBytes:K2,createHash:H2}=M("crypto"),{Duplex:Gae,Readable:Bae}=M("stream"),{URL:iy}=M("url"),dn=ao(),Q2=Zg(),W2=ry(),{isBlob:z2}=uo(),{BINARY_TYPES:_N,CLOSE_TIMEOUT:Y2,EMPTY_BUFFER:sl,GUID:J2,kForOnEventAttribute:oy,kListener:X2,kStatusCode:Z2,kWebSocket:ze,NOOP:TN}=kr(),{EventTarget:{addEventListener:e4,removeEventListener:t4}}=vN(),{format:r4,parse:n4}=ol(),{toBuffer:i4}=Xs(),IN=Symbol("kAborted"),sy=[8,13],Fr=["CONNECTING","OPEN","CLOSING","CLOSED"],o4=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Ne=class e extends V2{constructor(t,r,n){super(),this._binaryType=_N[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=sl,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(n=r,r=[]):r=[r]),ON(this,t,r,n)):(this._autoPong=n.autoPong,this._closeTimeout=n.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){_N.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,n){let i=new Q2({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),o=new W2(t,this._extensions,n.generateMask);this._receiver=i,this._sender=o,this._socket=t,i[ze]=this,o[ze]=this,t[ze]=this,i.on("conclude",u4),i.on("drain",c4),i.on("error",l4),i.on("message",p4),i.on("ping",d4),i.on("pong",f4),o.onerror=h4,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",xN),t.on("data",ul),t.on("end",NN),t.on("error",RN),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[dn.extensionName]&&this._extensions[dn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){At(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),AN(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){ay(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||sl,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){ay(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||sl,r,n)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){ay(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[dn.extensionName]||(i.compress=!1),this._sender.send(t||sl,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){At(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Ne,"CONNECTING",{enumerable:!0,value:Fr.indexOf("CONNECTING")});Object.defineProperty(Ne.prototype,"CONNECTING",{enumerable:!0,value:Fr.indexOf("CONNECTING")});Object.defineProperty(Ne,"OPEN",{enumerable:!0,value:Fr.indexOf("OPEN")});Object.defineProperty(Ne.prototype,"OPEN",{enumerable:!0,value:Fr.indexOf("OPEN")});Object.defineProperty(Ne,"CLOSING",{enumerable:!0,value:Fr.indexOf("CLOSING")});Object.defineProperty(Ne.prototype,"CLOSING",{enumerable:!0,value:Fr.indexOf("CLOSING")});Object.defineProperty(Ne,"CLOSED",{enumerable:!0,value:Fr.indexOf("CLOSED")});Object.defineProperty(Ne.prototype,"CLOSED",{enumerable:!0,value:Fr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Ne.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Ne.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[oy])return t[X2];return null},set(t){for(let r of this.listeners(e))if(r[oy]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[oy]:!0})}})});Ne.prototype.addEventListener=e4;Ne.prototype.removeEventListener=t4;CN.exports=Ne;function ON(e,t,r,n){let i={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:Y2,protocolVersion:sy[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=i.autoPong,e._closeTimeout=i.closeTimeout,!sy.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${sy.join(", ")})`);let o;if(t instanceof iy)o=t;else try{o=new iy(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),e._url=o.href;let s=o.protocol==="wss:",a=o.protocol==="ws+unix:",u;if(o.protocol!=="ws:"&&!s&&!a?u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!o.pathname?u="The URL's pathname is empty":o.hash&&(u="The URL contains a fragment identifier"),u){let v=new SyntaxError(u);if(e._redirects===0)throw v;al(e,v);return}let c=s?443:80,l=K2(16).toString("base64"),d=s?G2.request:B2.request,f=new Set,h;if(i.createConnection=i.createConnection||(s?a4:s4),i.defaultPort=i.defaultPort||c,i.port=o.port||c,i.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},i.path=o.pathname+o.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(h=new dn({...i.perMessageDeflate,isServer:!1,maxPayload:i.maxPayload}),i.headers["Sec-WebSocket-Extensions"]=r4({[dn.extensionName]:h.offer()})),r.length){for(let v of r){if(typeof v!="string"||!o4.test(v)||f.has(v))throw new SyntaxError("An invalid or duplicated subprotocol was specified");f.add(v)}i.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(o.username||o.password)&&(i.auth=`${o.username}:${o.password}`),a){let v=i.path.split(":");i.socketPath=v[0],i.path=v[1]}let g;if(i.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=s,e._originalHostOrSocketPath=a?i.socketPath:o.host;let v=n&&n.headers;if(n={...n,headers:{}},v)for(let[_,S]of Object.entries(v))n.headers[_.toLowerCase()]=S}else if(e.listenerCount("redirect")===0){let v=a?e._originalIpc?i.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:o.host===e._originalHostOrSocketPath;(!v||e._originalSecure&&!s)&&(delete i.headers.authorization,delete i.headers.cookie,v||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),g=e._req=d(i),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=d(i);i.timeout&&g.on("timeout",()=>{At(e,g,"Opening handshake has timed out")}),g.on("error",v=>{g===null||g[IN]||(g=e._req=null,al(e,v))}),g.on("response",v=>{let _=v.headers.location,S=v.statusCode;if(_&&i.followRedirects&&S>=300&&S<400){if(++e._redirects>i.maxRedirects){At(e,g,"Maximum redirects exceeded");return}g.abort();let b;try{b=new iy(_,t)}catch{let w=new SyntaxError(`Invalid URL: ${_}`);al(e,w);return}ON(e,b,r,n)}else e.emit("unexpected-response",g,v)||At(e,g,`Unexpected server response: ${v.statusCode}`)}),g.on("upgrade",(v,_,S)=>{if(e.emit("upgrade",v),e.readyState!==Ne.CONNECTING)return;g=e._req=null;let b=v.headers.upgrade;if(b===void 0||b.toLowerCase()!=="websocket"){At(e,_,"Invalid Upgrade header");return}let A=H2("sha1").update(l+J2).digest("base64");if(v.headers["sec-websocket-accept"]!==A){At(e,_,"Invalid Sec-WebSocket-Accept header");return}let w=v.headers["sec-websocket-protocol"],T;if(w!==void 0?f.size?f.has(w)||(T="Server sent an invalid subprotocol"):T="Server sent a subprotocol but none was requested":f.size&&(T="Server sent no subprotocol"),T){At(e,_,T);return}w&&(e._protocol=w);let x=v.headers["sec-websocket-extensions"];if(x!==void 0){if(!h){At(e,_,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let U;try{U=n4(x)}catch{At(e,_,"Invalid Sec-WebSocket-Extensions header");return}let N=Object.keys(U);if(N.length!==1||N[0]!==dn.extensionName){At(e,_,"Server indicated an extension that was not requested");return}try{h.accept(U[dn.extensionName])}catch{At(e,_,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[dn.extensionName]=h}e.setSocket(_,S,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(g,e):g.end()}function al(e,t){e._readyState=Ne.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function s4(e){return e.path=e.socketPath,SN.connect(e)}function a4(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=SN.isIP(e.host)?"":e.host),$2.connect(e)}function At(e,t,r){e._readyState=Ne.CLOSING;let n=new Error(r);Error.captureStackTrace(n,At),t.setHeader?(t[IN]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(al,e,n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function ay(e,t,r){if(t){let n=z2(t)?t.size:i4(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${Fr[e.readyState]})`);process.nextTick(r,n)}}function u4(e,t){let r=this[ze];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[ze]!==void 0&&(r._socket.removeListener("data",ul),process.nextTick(wN,r._socket),e===1005?r.close():r.close(e,t))}function c4(){let e=this[ze];e.isPaused||e._socket.resume()}function l4(e){let t=this[ze];t._socket[ze]!==void 0&&(t._socket.removeListener("data",ul),process.nextTick(wN,t._socket),t.close(e[Z2])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function bN(){this[ze].emitClose()}function p4(e,t){this[ze].emit("message",e,t)}function d4(e){let t=this[ze];t._autoPong&&t.pong(e,!this._isServer,TN),t.emit("ping",e)}function f4(e){this[ze].emit("pong",e)}function wN(e){e.resume()}function h4(e){let t=this[ze];t.readyState!==Ne.CLOSED&&(t.readyState===Ne.OPEN&&(t._readyState=Ne.CLOSING,AN(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function AN(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function xN(){let e=this[ze];if(this.removeListener("close",xN),this.removeListener("data",ul),this.removeListener("end",NN),e._readyState=Ne.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[ze]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",bN),e._receiver.on("finish",bN))}function ul(e){this[ze]._receiver.write(e)||this.pause()}function NN(){let e=this[ze];e._readyState=Ne.CLOSING,e._receiver.end(),this.end()}function RN(){let e=this[ze];this.removeListener("error",RN),this.on("error",TN),e&&(e._readyState=Ne.CLOSING,this.destroy())}});var kN=y((Qae,LN)=>{"use strict";p();var Hae=cl(),{Duplex:m4}=M("stream");function PN(e){e.emit("close")}function g4(){!this.destroyed&&this._writableState.finished&&this.destroy()}function DN(e){this.removeListener("error",DN),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function y4(e,t){let r=!0,n=new m4({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(o,s){let a=!s&&n._readableState.objectMode?o.toString():o;n.push(a)||e.pause()}),e.once("error",function(o){n.destroyed||(r=!1,n.destroy(o))}),e.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,o){if(e.readyState===e.CLOSED){o(i),process.nextTick(PN,n);return}let s=!1;e.once("error",function(u){s=!0,o(u)}),e.once("close",function(){s||o(i),process.nextTick(PN,n)}),r&&e.terminate()},n._final=function(i){if(e.readyState===e.CONNECTING){e.once("open",function(){n._final(i)});return}e._socket!==null&&(e._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(e._socket.once("finish",function(){i()}),e.close()))},n._read=function(){e.isPaused&&e.resume()},n._write=function(i,o,s){if(e.readyState===e.CONNECTING){e.once("open",function(){n._write(i,o,s)});return}e.send(i,s)},n.on("end",g4),n.on("error",DN),n}LN.exports=y4});var uy=y((zae,jN)=>{"use strict";p();var{tokenChars:v4}=uo();function E4(e){let t=new Set,r=-1,n=-1,i=0;for(i;i<e.length;i++){let s=e.charCodeAt(i);if(n===-1&&v4[s]===1)r===-1&&(r=i);else if(i!==0&&(s===32||s===9))n===-1&&r!==-1&&(n=i);else if(s===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=e.slice(r,n);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);t.add(a),r=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(r===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let o=e.slice(r,i);if(t.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}jN.exports={parse:E4}});var BN=y((Xae,GN)=>{"use strict";p();var _4=M("events"),ll=M("http"),{Duplex:Jae}=M("stream"),{createHash:b4}=M("crypto"),MN=ol(),ti=ao(),S4=uy(),T4=cl(),{CLOSE_TIMEOUT:I4,GUID:O4,kWebSocket:w4}=kr(),A4=/^[+/0-9A-Za-z]{22}==$/,FN=0,qN=1,VN=2,cy=class extends _4{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:I4,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:T4,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=ll.createServer((n,i)=>{let o=ll.STATUS_CODES[426];i.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),i.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=x4(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,o,s)=>{this.handleUpgrade(i,o,s,n)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=FN}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===VN){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(na,this);return}if(t&&this.once("close",t),this._state!==qN)if(this._state=qN,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(na,this):process.nextTick(na,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{na(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,i){r.on("error",UN);let o=t.headers["sec-websocket-key"],s=t.headers.upgrade,a=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ri(this,t,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){ri(this,t,r,400,"Invalid Upgrade header");return}if(o===void 0||!A4.test(o)){ri(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){ri(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){ia(r,400);return}let u=t.headers["sec-websocket-protocol"],c=new Set;if(u!==void 0)try{c=S4.parse(u)}catch{ri(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let l=t.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&l!==void 0){let f=new ti({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let h=MN.parse(l);h[ti.extensionName]&&(f.accept(h[ti.extensionName]),d[ti.extensionName]=f)}catch{ri(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(h,g,v,_)=>{if(!h)return ia(r,g||401,v,_);this.completeUpgrade(d,o,c,t,r,n,i)});return}if(!this.options.verifyClient(f))return ia(r,401)}this.completeUpgrade(d,o,c,t,r,n,i)}completeUpgrade(t,r,n,i,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[w4])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>FN)return ia(o,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${b4("sha1").update(r+O4).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(n.size){let d=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;d&&(c.push(`Sec-WebSocket-Protocol: ${d}`),l._protocol=d)}if(t[ti.extensionName]){let d=t[ti.extensionName].params,f=MN.format({[ti.extensionName]:[d]});c.push(`Sec-WebSocket-Extensions: ${f}`),l._extensions=t}this.emit("headers",c,i),o.write(c.concat(`\r
|
|
207
|
+
`+r)),e.removeListener("error",Dg),e.destroy()}function XJ(e){return e.trim()}});var Lx=y((vae,Dx)=>{"use strict";p();var Js=Rg();Js.createWebSocketStream=Ax();Js.Server=Px();Js.Receiver=yg();Js.Sender=Eg();Dx.exports=Js});var Vg=y(ht=>{"use strict";p();ht.isIterable=kx;ht.isArrayLike=zc;ht.isCollection=e2;ht.getIterator=jg;ht.getIteratorMethod=Mg;ht.createIterator=jx;ht.forEach=t2;ht.isAsyncIterable=n2;ht.getAsyncIterator=Mx;ht.getAsyncIteratorMethod=qg;ht.createAsyncIterator=Fx;ht.forAwaitEach=i2;var Wc=typeof Symbol=="function"?Symbol:void 0,Lg=Wc&&Wc.iterator,ZJ=ht.$$iterator=Lg||"@@iterator";function kx(e){return!!Mg(e)}function zc(e){var t=e!=null&&e.length;return typeof t=="number"&&t>=0&&t%1===0}function e2(e){return Object(e)===e&&(zc(e)||kx(e))}function jg(e){var t=Mg(e);if(t)return t.call(e)}function Mg(e){if(e!=null){var t=Lg&&e[Lg]||e["@@iterator"];if(typeof t=="function")return t}}function jx(e){if(e!=null){var t=jg(e);if(t)return t;if(zc(e))return new Fg(e)}}function Fg(e){this._o=e,this._i=0}Fg.prototype[ZJ]=function(){return this};Fg.prototype.next=function(){return this._o===void 0||this._i>=this._o.length?(this._o=void 0,{value:void 0,done:!0}):{value:this._o[this._i++],done:!1}};function t2(e,t,r){if(e!=null){if(typeof e.forEach=="function")return e.forEach(t,r);var n=0,i=jg(e);if(i){for(var o;!(o=i.next()).done;)if(t.call(r,o.value,n++,e),n>9999999)throw new TypeError("Near-infinite iteration.")}else if(zc(e))for(;n<e.length;n++)e.hasOwnProperty(n)&&t.call(r,e[n],n,e)}}var kg=Wc&&Wc.asyncIterator,r2=ht.$$asyncIterator=kg||"@@asyncIterator";function n2(e){return!!qg(e)}function Mx(e){var t=qg(e);if(t)return t.call(e)}function qg(e){if(e!=null){var t=kg&&e[kg]||e["@@asyncIterator"];if(typeof t=="function")return t}}function Fx(e){if(e!=null){var t=Mx(e);if(t)return t;var r=jx(e);if(r)return new Xs(r)}}function Xs(e){this._i=e}Xs.prototype[r2]=function(){return this};Xs.prototype.next=function(e){return Ug(this._i,"next",e)};Xs.prototype.return=function(e){return this._i.return?Ug(this._i,"return",e):Promise.resolve({value:e,done:!0})};Xs.prototype.throw=function(e){return this._i.throw?Ug(this._i,"throw",e):Promise.reject(e)};function Ug(e,t,r){var n;return new Promise(function(i){n=e[t](r),i(n.value)}).then(function(i){return{value:i,done:n.done}})}function i2(e,t,r){var n=Fx(e);if(n){var i=0;return new Promise(function(o,s){function a(){return n.next().then(function(u){return u.done?o():Promise.resolve(t.call(r,u.value,i++,e)).then(a).catch(s),null}).catch(s),null}a()})}}});var qx=y(Yc=>{"use strict";p();Object.defineProperty(Yc,"__esModule",{value:!0});Yc.createEmptyIterable=void 0;var o2=Vg(),s2=function(){var e;return e={next:function(){return Promise.resolve({value:void 0,done:!0})},return:function(){return Promise.resolve({value:void 0,done:!0})},throw:function(t){return Promise.reject(t)}},e[o2.$$asyncIterator]=function(){return this},e};Yc.createEmptyIterable=s2});var Ux=y(Jc=>{"use strict";p();Object.defineProperty(Jc,"__esModule",{value:!0});Jc.isASubscriptionOperation=void 0;var a2=cn(),u2=function(e,t){var r=(0,a2.getOperationAST)(e,t);return!!r&&r.operation==="subscription"};Jc.isASubscriptionOperation=u2});var Vx=y(oo=>{"use strict";p();var Et=oo&&oo.__assign||function(){return Et=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Et.apply(this,arguments)};Object.defineProperty(oo,"__esModule",{value:!0});oo.parseLegacyProtocolMessage=void 0;var at=$s(),c2=function(e,t){var r=t;switch(t.type){case at.default.INIT:e.isLegacy=!0,r=Et(Et({},t),{type:at.default.GQL_CONNECTION_INIT});break;case at.default.SUBSCRIPTION_START:r={id:t.id,type:at.default.GQL_START,payload:{query:t.query,operationName:t.operationName,variables:t.variables}};break;case at.default.SUBSCRIPTION_END:r=Et(Et({},t),{type:at.default.GQL_STOP});break;case at.default.GQL_CONNECTION_ACK:e.isLegacy&&(r=Et(Et({},t),{type:at.default.INIT_SUCCESS}));break;case at.default.GQL_CONNECTION_ERROR:e.isLegacy&&(r=Et(Et({},t),{type:at.default.INIT_FAIL,payload:t.payload.message?{error:t.payload.message}:t.payload}));break;case at.default.GQL_ERROR:e.isLegacy&&(r=Et(Et({},t),{type:at.default.SUBSCRIPTION_FAIL}));break;case at.default.GQL_DATA:e.isLegacy&&(r=Et(Et({},t),{type:at.default.SUBSCRIPTION_DATA}));break;case at.default.GQL_COMPLETE:e.isLegacy&&(r=null);break;case at.default.SUBSCRIPTION_SUCCESS:e.isLegacy||(r=null);break;default:break}return r};oo.parseLegacyProtocolMessage=c2});var Bx=y(Xc=>{"use strict";p();Object.defineProperty(Xc,"__esModule",{value:!0});Xc.SubscriptionServer=void 0;var Gg=Lx(),rt=$s(),Gx=Vc(),l2=ng(),$g=cn(),p2=qx(),Bg=Vg(),d2=Ux(),$x=Vx(),f2=function(e){return e.on},h2=(function(){function e(t,r){var n=this,i=t.onOperation,o=t.onOperationComplete,s=t.onConnect,a=t.onDisconnect,u=t.keepAlive;this.specifiedRules=t.validationRules||$g.specifiedRules,this.loadExecutor(t),this.onOperation=i,this.onOperationComplete=o,this.onConnect=s,this.onDisconnect=a,this.keepAlive=u,f2(r)?this.wsServer=r:this.wsServer=new Gg.Server(r||{});var c=(function(l,d){if(l.upgradeReq=d,l.protocol===void 0||l.protocol.indexOf(Gx.GRAPHQL_WS)===-1&&l.protocol.indexOf(Gx.GRAPHQL_SUBSCRIPTIONS)===-1){l.close(1002);return}var f=Object.create(null);f.initPromise=Promise.resolve(!0),f.isLegacy=!1,f.socket=l,f.request=d,f.operations={};var h=function(g){g&&(n.sendError(f,"",{message:g.message?g.message:g},rt.default.GQL_CONNECTION_ERROR),setTimeout(function(){f.socket.close(1011)},10)),n.onClose(f),n.onDisconnect&&n.onDisconnect(l,f)};l.on("error",h),l.on("close",h),l.on("message",n.onMessage(f))});this.wsServer.on("connection",c),this.closeHandler=function(){n.wsServer.removeListener("connection",c),n.wsServer.close()}}return e.create=function(t,r){return new e(t,r)},Object.defineProperty(e.prototype,"server",{get:function(){return this.wsServer},enumerable:!1,configurable:!0}),e.prototype.close=function(){this.closeHandler()},e.prototype.loadExecutor=function(t){var r=t.execute,n=t.subscribe,i=t.schema,o=t.rootValue;if(!r)throw new Error("Must provide `execute` for websocket server constructor.");this.schema=i,this.rootValue=o,this.execute=r,this.subscribe=n},e.prototype.unsubscribe=function(t,r){t.operations&&t.operations[r]&&(t.operations[r].return&&t.operations[r].return(),delete t.operations[r],this.onOperationComplete&&this.onOperationComplete(t.socket,r))},e.prototype.onClose=function(t){var r=this;Object.keys(t.operations).forEach(function(n){r.unsubscribe(t,n)})},e.prototype.onMessage=function(t){var r=this;return function(n){var i;try{i=(0,$x.parseLegacyProtocolMessage)(t,JSON.parse(n))}catch(s){r.sendError(t,null,{message:s.message},rt.default.GQL_CONNECTION_ERROR);return}var o=i.id;switch(i.type){case rt.default.GQL_CONNECTION_INIT:r.onConnect&&(t.initPromise=new Promise(function(s,a){try{s(r.onConnect(i.payload,t.socket,t))}catch(u){a(u)}})),t.initPromise.then(function(s){if(s===!1)throw new Error("Prohibited connection!");if(r.sendMessage(t,void 0,rt.default.GQL_CONNECTION_ACK,void 0),r.keepAlive){r.sendKeepAlive(t);var a=setInterval(function(){t.socket.readyState===Gg.OPEN?r.sendKeepAlive(t):clearInterval(a)},r.keepAlive)}}).catch(function(s){r.sendError(t,o,{message:s.message},rt.default.GQL_CONNECTION_ERROR),setTimeout(function(){t.socket.close(1011)},10)});break;case rt.default.GQL_CONNECTION_TERMINATE:t.socket.close();break;case rt.default.GQL_START:t.initPromise.then(function(s){t.operations&&t.operations[o]&&r.unsubscribe(t,o);var a={query:i.payload.query,variables:i.payload.variables,operationName:i.payload.operationName,context:(0,l2.default)(s)?Object.assign(Object.create(Object.getPrototypeOf(s)),s):{},formatResponse:void 0,formatError:void 0,callback:void 0,schema:r.schema},u=Promise.resolve(a);if(t.operations[o]=(0,p2.createEmptyIterable)(),r.onOperation){var c=i;u=Promise.resolve(r.onOperation(c,a,t.socket))}return u.then(function(l){if(typeof l!="object"){var d="Invalid params returned from onOperation! return values must be an object!";throw r.sendError(t,o,{message:d}),new Error(d)}if(!l.schema){var d="Missing schema information. The GraphQL schema should be provided either statically in the `SubscriptionServer` constructor or as a property on the object returned from onOperation!";throw r.sendError(t,o,{message:d}),new Error(d)}var f=typeof a.query!="string"?a.query:(0,$g.parse)(a.query),h,g=(0,$g.validate)(l.schema,f,r.specifiedRules);if(g.length>0)h=Promise.resolve({errors:g});else{var v=r.execute;r.subscribe&&(0,d2.isASubscriptionOperation)(f,l.operationName)&&(v=r.subscribe),h=Promise.resolve(v({schema:l.schema,document:f,rootValue:r.rootValue,contextValue:l.context,variableValues:l.variables,operationName:l.operationName}))}return h.then(function(_){return{executionIterable:(0,Bg.isAsyncIterable)(_)?_:(0,Bg.createAsyncIterator)([_]),params:l}})}).then(function(l){var d=l.executionIterable,f=l.params;return(0,Bg.forAwaitEach)(d,function(h){var g=h;if(f.formatResponse)try{g=f.formatResponse(h,f)}catch(v){console.error("Error in formatResponse function:",v)}r.sendMessage(t,o,rt.default.GQL_DATA,g)}).then(function(){r.sendMessage(t,o,rt.default.GQL_COMPLETE,null)}).catch(function(h){var g=h;if(f.formatError)try{g=f.formatError(h,f)}catch(v){console.error("Error in formatError function: ",v)}Object.keys(g).length===0&&(g={name:g.name,message:g.message}),r.sendError(t,o,g)}),d}).then(function(l){t.operations[o]=l}).then(function(){r.sendMessage(t,o,rt.default.SUBSCRIPTION_SUCCESS,void 0)}).catch(function(l){l.errors?r.sendMessage(t,o,rt.default.GQL_DATA,{errors:l.errors}):r.sendError(t,o,{message:l.message}),r.unsubscribe(t,o)})}).catch(function(s){r.sendError(t,o,{message:s.message}),r.unsubscribe(t,o)});break;case rt.default.GQL_STOP:r.unsubscribe(t,o);break;default:r.sendError(t,o,{message:"Invalid message type!"})}}},e.prototype.sendKeepAlive=function(t){t.isLegacy?this.sendMessage(t,void 0,rt.default.KEEP_ALIVE,void 0):this.sendMessage(t,void 0,rt.default.GQL_CONNECTION_KEEP_ALIVE,void 0)},e.prototype.sendMessage=function(t,r,n,i){var o=(0,$x.parseLegacyProtocolMessage)(t,{type:n,id:r,payload:i});o&&t.socket.readyState===Gg.OPEN&&t.socket.send(JSON.stringify(o))},e.prototype.sendError=function(t,r,n,i){var o=i||rt.default.GQL_ERROR;if([rt.default.GQL_CONNECTION_ERROR,rt.default.GQL_ERROR].indexOf(o)===-1)throw new Error("overrideDefaultErrorType should be one of the allowed error messages GQL_CONNECTION_ERROR or GQL_ERROR");this.sendMessage(t,r,o,n)},e})();Xc.SubscriptionServer=h2});var Kx=y(tr=>{"use strict";p();var m2=tr&&tr.__createBinding||(Object.create?(function(e,t,r,n){n===void 0&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}):(function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]})),Kg=tr&&tr.__exportStar||function(e,t){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r)&&m2(t,e,r)};Object.defineProperty(tr,"__esModule",{value:!0});tr.MessageTypes=void 0;Kg(VA(),tr);Kg(Bx(),tr);var g2=$s();Object.defineProperty(tr,"MessageTypes",{enumerable:!0,get:function(){return g2.default}});Kg(Vc(),tr)});var kr=y((Pae,Wx)=>{"use strict";p();var Hx=["nodebuffer","arraybuffer","fragments"],Qx=typeof Blob<"u";Qx&&Hx.push("blob");Wx.exports={BINARY_TYPES:Hx,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Qx,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Zs=y((Lae,Zc)=>{"use strict";p();var{EMPTY_BUFFER:y2}=kr(),Hg=Buffer[Symbol.species];function v2(e,t){if(e.length===0)return y2;if(e.length===1)return e[0];let r=Buffer.allocUnsafe(t),n=0;for(let i=0;i<e.length;i++){let o=e[i];r.set(o,n),n+=o.length}return n<t?new Hg(r.buffer,r.byteOffset,n):r}function zx(e,t,r,n,i){for(let o=0;o<i;o++)r[n+o]=e[o]^t[o&3]}function Yx(e,t){for(let r=0;r<e.length;r++)e[r]^=t[r&3]}function E2(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function Qg(e){if(Qg.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Hg(e):ArrayBuffer.isView(e)?t=new Hg(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Qg.readOnly=!1),t}Zc.exports={concat:v2,mask:zx,toArrayBuffer:E2,toBuffer:Qg,unmask:Yx};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=M("bufferutil");Zc.exports.mask=function(t,r,n,i,o){o<48?zx(t,r,n,i,o):e.mask(t,r,n,i,o)},Zc.exports.unmask=function(t,r){t.length<32?Yx(t,r):e.unmask(t,r)}}catch{}});var Zx=y((jae,Xx)=>{"use strict";p();var Jx=Symbol("kDone"),Wg=Symbol("kRun"),zg=class{constructor(t){this[Jx]=()=>{this.pending--,this[Wg]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Wg]()}[Wg](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Jx])}}};Xx.exports=zg});var uo=y((Fae,nN)=>{"use strict";p();var ea=M("zlib"),eN=Zs(),_2=Zx(),{kStatusCode:tN}=kr(),b2=Buffer[Symbol.species],S2=Buffer.from([0,0,255,255]),tl=Symbol("permessage-deflate"),jr=Symbol("total-length"),so=Symbol("callback"),dn=Symbol("buffers"),ao=Symbol("error"),el,Yg=class{constructor(t){if(this._options=t||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!el){let r=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;el=new _2(r)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[so];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,n=t.find(i=>!(r.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>i.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!i.client_max_window_bits));if(!n)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(n.server_no_context_takeover=!0),r.clientNoContextTakeover&&(n.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(n.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?n.client_max_window_bits=r.clientMaxWindowBits:(n.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(t){let r=t[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(t){return t.forEach(r=>{Object.keys(r).forEach(n=>{let i=r[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=o}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);r[n]=i})}),t}decompress(t,r,n){el.add(i=>{this._decompress(t,r,(o,s)=>{i(),n(o,s)})})}compress(t,r,n){el.add(i=>{this._compress(t,r,(o,s)=>{i(),n(o,s)})})}_decompress(t,r,n){let i=this._isServer?"client":"server";if(!this._inflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?ea.Z_DEFAULT_WINDOWBITS:this.params[o];this._inflate=ea.createInflateRaw({...this._options.zlibInflateOptions,windowBits:s}),this._inflate[tl]=this,this._inflate[jr]=0,this._inflate[dn]=[],this._inflate.on("error",I2),this._inflate.on("data",rN)}this._inflate[so]=n,this._inflate.write(t),r&&this._inflate.write(S2),this._inflate.flush(()=>{let o=this._inflate[ao];if(o){this._inflate.close(),this._inflate=null,n(o);return}let s=eN.concat(this._inflate[dn],this._inflate[jr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[jr]=0,this._inflate[dn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,s)})}_compress(t,r,n){let i=this._isServer?"server":"client";if(!this._deflate){let o=`${i}_max_window_bits`,s=typeof this.params[o]!="number"?ea.Z_DEFAULT_WINDOWBITS:this.params[o];this._deflate=ea.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:s}),this._deflate[jr]=0,this._deflate[dn]=[],this._deflate.on("data",T2)}this._deflate[so]=n,this._deflate.write(t),this._deflate.flush(ea.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let o=eN.concat(this._deflate[dn],this._deflate[jr]);r&&(o=new b2(o.buffer,o.byteOffset,o.length-4)),this._deflate[so]=null,this._deflate[jr]=0,this._deflate[dn]=[],r&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,o)})}};nN.exports=Yg;function T2(e){this[dn].push(e),this[jr]+=e.length}function rN(e){if(this[jr]+=e.length,this[tl]._maxPayload<1||this[jr]<=this[tl]._maxPayload){this[dn].push(e);return}this[ao]=new RangeError("Max payload size exceeded"),this[ao].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ao][tN]=1009,this.removeListener("data",rN),this.reset()}function I2(e){if(this[tl]._inflate=null,this[ao]){this[so](this[ao]);return}e[tN]=1007,this[so](e)}});var co=y((Uae,rl)=>{"use strict";p();var{isUtf8:iN}=M("buffer"),{hasBlob:w2}=kr(),O2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function A2(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function Jg(e){let t=e.length,r=0;for(;r<t;)if((e[r]&128)===0)r++;else if((e[r]&224)===192){if(r+1===t||(e[r+1]&192)!==128||(e[r]&254)===192)return!1;r+=2}else if((e[r]&240)===224){if(r+2>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||e[r]===224&&(e[r+1]&224)===128||e[r]===237&&(e[r+1]&224)===160)return!1;r+=3}else if((e[r]&248)===240){if(r+3>=t||(e[r+1]&192)!==128||(e[r+2]&192)!==128||(e[r+3]&192)!==128||e[r]===240&&(e[r+1]&240)===128||e[r]===244&&e[r+1]>143||e[r]>244)return!1;r+=4}else return!1;return!0}function x2(e){return w2&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}rl.exports={isBlob:x2,isValidStatusCode:A2,isValidUTF8:Jg,tokenChars:O2};if(iN)rl.exports.isValidUTF8=function(e){return e.length<24?Jg(e):iN(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=M("utf-8-validate");rl.exports.isValidUTF8=function(t){return t.length<32?Jg(t):e(t)}}catch{}});var ry=y((Gae,pN)=>{"use strict";p();var{Writable:N2}=M("stream"),oN=uo(),{BINARY_TYPES:R2,EMPTY_BUFFER:sN,kStatusCode:C2,kWebSocket:P2}=kr(),{concat:Xg,toArrayBuffer:D2,unmask:L2}=Zs(),{isValidStatusCode:k2,isValidUTF8:aN}=co(),nl=Buffer[Symbol.species],Bt=0,uN=1,cN=2,lN=3,Zg=4,ey=5,il=6,ty=class extends N2{constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||R2[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[P2]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=Bt}_write(t,r,n){if(this._opcode===8&&this._state==Bt)return n();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){n(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(n)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let n=this._buffers[0];return this._buffers[0]=new nl(n.buffer,n.byteOffset+t,n.length-t),new nl(n.buffer,n.byteOffset,t)}let r=Buffer.allocUnsafe(t);do{let n=this._buffers[0],i=r.length-t;t>=n.length?r.set(this._buffers.shift(),i):(r.set(new Uint8Array(n.buffer,n.byteOffset,t),i),this._buffers[0]=new nl(n.buffer,n.byteOffset+t,n.length-t)),t-=n.length}while(t>0);return r}startLoop(t){this._loop=!0;do switch(this._state){case Bt:this.getInfo(t);break;case uN:this.getPayloadLength16(t);break;case cN:this.getPayloadLength64(t);break;case lN:this.getMask();break;case Zg:this.getData(t);break;case ey:case il:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(i);return}let n=(r[0]&64)===64;if(n&&!this._extensions[oN.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(i);return}this._payloadLength===126?this._state=uN:this._payloadLength===127?this._state=cN:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),n=r.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(i);return}this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(r);return}this._masked?this._state=lN:this._state=Zg}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Zg}getData(t){let r=sN;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&L2(r,this._mask)}if(this._opcode>7){this.controlMessage(r,t);return}if(this._compressed){this._state=ey,this.decompress(r,t);return}if(r.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let n=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(n);return}this._messageLength=this._totalPayloadLength,this._fragments.push(r)}this.dataMessage(t)}decompress(t,r){this._extensions[oN.extensionName].decompress(t,this._fin,(i,o)=>{if(i)return r(i);if(o.length){if(this._messageLength+=o.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let s=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(s);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let s=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");r(s);return}this._fragments.push(o)}this.dataMessage(r),this._state===Bt&&this.startLoop(r)})}dataMessage(t){if(!this._fin){this._state=Bt;return}let r=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=Xg(n,r):this._binaryType==="arraybuffer"?i=D2(Xg(n,r)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=Bt):(this._state=il,setImmediate(()=>{this.emit("message",i,!0),this._state=Bt,this.startLoop(t)}))}else{let i=Xg(n,r);if(!this._skipUTF8Validation&&!aN(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(o);return}this._state===ey||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=Bt):(this._state=il,setImmediate(()=>{this.emit("message",i,!1),this._state=Bt,this.startLoop(t)}))}}controlMessage(t,r){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,sN),this.end();else{let n=t.readUInt16BE(0);if(!k2(n)){let o=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(o);return}let i=new nl(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!aN(i)){let o=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(o);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=Bt;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=Bt):(this._state=il,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=Bt,this.startLoop(r)}))}createError(t,r,n,i,o){this._loop=!1,this._errored=!0;let s=new t(n?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=o,s[C2]=i,s}};pN.exports=ty});var oy=y((Kae,hN)=>{"use strict";p();var{Duplex:Bae}=M("stream"),{randomFillSync:j2}=M("crypto"),{types:{isUint8Array:M2}}=M("util"),dN=uo(),{EMPTY_BUFFER:F2,kWebSocket:q2,NOOP:U2}=kr(),{isBlob:lo,isValidStatusCode:V2}=co(),{mask:fN,toBuffer:Xn}=Zs(),Kt=Symbol("kByteLength"),G2=Buffer.alloc(4),ol=8*1024,Zn,po=ol,rr=0,$2=1,B2=2,ny=class e{constructor(t,r,n){this._extensions=r||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=rr,this.onerror=U2,this[q2]=void 0}static frame(t,r){let n,i=!1,o=2,s=!1;r.mask&&(n=r.maskBuffer||G2,r.generateMask?r.generateMask(n):(po===ol&&(Zn===void 0&&(Zn=Buffer.alloc(ol)),j2(Zn,0,ol),po=0),n[0]=Zn[po++],n[1]=Zn[po++],n[2]=Zn[po++],n[3]=Zn[po++]),s=(n[0]|n[1]|n[2]|n[3])===0,o=6);let a;typeof t=="string"?(!r.mask||s)&&r[Kt]!==void 0?a=r[Kt]:(t=Buffer.from(t),a=t.length):(a=t.length,i=r.mask&&r.readOnly&&!s);let u=a;a>=65536?(o+=8,u=127):a>125&&(o+=2,u=126);let c=Buffer.allocUnsafe(i?a+o:o);return c[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(c[0]|=64),c[1]=u,u===126?c.writeUInt16BE(a,2):u===127&&(c[2]=c[3]=0,c.writeUIntBE(a,4,6)),r.mask?(c[1]|=128,c[o-4]=n[0],c[o-3]=n[1],c[o-2]=n[2],c[o-1]=n[3],s?[c,t]:i?(fN(t,n,c,o,a),[c]):(fN(t,n,t,0,a),[c,t])):[c,t]}close(t,r,n,i){let o;if(t===void 0)o=F2;else{if(typeof t!="number"||!V2(t))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)o=Buffer.allocUnsafe(2),o.writeUInt16BE(t,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");if(o=Buffer.allocUnsafe(2+a),o.writeUInt16BE(t,0),typeof r=="string")o.write(r,2);else if(M2(r))o.set(r,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let s={[Kt]:o.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==rr?this.enqueue([this.dispatch,o,!1,s,i]):this.sendFrame(e.frame(o,s),i)}ping(t,r,n){let i,o;if(typeof t=="string"?(i=Buffer.byteLength(t),o=!1):lo(t)?(i=t.size,o=!1):(t=Xn(t),i=t.length,o=Xn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Kt]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};lo(t)?this._state!==rr?this.enqueue([this.getBlobData,t,!1,s,n]):this.getBlobData(t,!1,s,n):this._state!==rr?this.enqueue([this.dispatch,t,!1,s,n]):this.sendFrame(e.frame(t,s),n)}pong(t,r,n){let i,o;if(typeof t=="string"?(i=Buffer.byteLength(t),o=!1):lo(t)?(i=t.size,o=!1):(t=Xn(t),i=t.length,o=Xn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let s={[Kt]:i,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};lo(t)?this._state!==rr?this.enqueue([this.getBlobData,t,!1,s,n]):this.getBlobData(t,!1,s,n):this._state!==rr?this.enqueue([this.dispatch,t,!1,s,n]):this.sendFrame(e.frame(t,s),n)}send(t,r,n){let i=this._extensions[dN.extensionName],o=r.binary?2:1,s=r.compress,a,u;typeof t=="string"?(a=Buffer.byteLength(t),u=!1):lo(t)?(a=t.size,u=!1):(t=Xn(t),a=t.length,u=Xn.readOnly),this._firstFragment?(this._firstFragment=!1,s&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(s=a>=i._threshold),this._compress=s):(s=!1,o=0),r.fin&&(this._firstFragment=!0);let c={[Kt]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:o,readOnly:u,rsv1:s};lo(t)?this._state!==rr?this.enqueue([this.getBlobData,t,this._compress,c,n]):this.getBlobData(t,this._compress,c,n):this._state!==rr?this.enqueue([this.dispatch,t,this._compress,c,n]):this.dispatch(t,this._compress,c,n)}getBlobData(t,r,n,i){this._bufferedBytes+=n[Kt],this._state=B2,t.arrayBuffer().then(o=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(iy,this,a,i);return}this._bufferedBytes-=n[Kt];let s=Xn(o);r?this.dispatch(s,r,n,i):(this._state=rr,this.sendFrame(e.frame(s,n),i),this.dequeue())}).catch(o=>{process.nextTick(K2,this,o,i)})}dispatch(t,r,n,i){if(!r){this.sendFrame(e.frame(t,n),i);return}let o=this._extensions[dN.extensionName];this._bufferedBytes+=n[Kt],this._state=$2,o.compress(t,n.fin,(s,a)=>{if(this._socket.destroyed){let u=new Error("The socket was closed while data was being compressed");iy(this,u,i);return}this._bufferedBytes-=n[Kt],this._state=rr,n.readOnly=!1,this.sendFrame(e.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===rr&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Kt],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Kt],this._queue.push(t)}sendFrame(t,r){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}};hN.exports=ny;function iy(e,t,r){typeof r=="function"&&r(t);for(let n=0;n<e._queue.length;n++){let i=e._queue[n],o=i[i.length-1];typeof o=="function"&&o(t)}}function K2(e,t,r){iy(e,t,r),e.onerror(t)}});var TN=y((Qae,SN)=>{"use strict";p();var{kForOnEventAttribute:ta,kListener:sy}=kr(),mN=Symbol("kCode"),gN=Symbol("kData"),yN=Symbol("kError"),vN=Symbol("kMessage"),EN=Symbol("kReason"),fo=Symbol("kTarget"),_N=Symbol("kType"),bN=Symbol("kWasClean"),Mr=class{constructor(t){this[fo]=null,this[_N]=t}get target(){return this[fo]}get type(){return this[_N]}};Object.defineProperty(Mr.prototype,"target",{enumerable:!0});Object.defineProperty(Mr.prototype,"type",{enumerable:!0});var ei=class extends Mr{constructor(t,r={}){super(t),this[mN]=r.code===void 0?0:r.code,this[EN]=r.reason===void 0?"":r.reason,this[bN]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[mN]}get reason(){return this[EN]}get wasClean(){return this[bN]}};Object.defineProperty(ei.prototype,"code",{enumerable:!0});Object.defineProperty(ei.prototype,"reason",{enumerable:!0});Object.defineProperty(ei.prototype,"wasClean",{enumerable:!0});var ho=class extends Mr{constructor(t,r={}){super(t),this[yN]=r.error===void 0?null:r.error,this[vN]=r.message===void 0?"":r.message}get error(){return this[yN]}get message(){return this[vN]}};Object.defineProperty(ho.prototype,"error",{enumerable:!0});Object.defineProperty(ho.prototype,"message",{enumerable:!0});var ra=class extends Mr{constructor(t,r={}){super(t),this[gN]=r.data===void 0?null:r.data}get data(){return this[gN]}};Object.defineProperty(ra.prototype,"data",{enumerable:!0});var H2={addEventListener(e,t,r={}){for(let i of this.listeners(e))if(!r[ta]&&i[sy]===t&&!i[ta])return;let n;if(e==="message")n=function(o,s){let a=new ra("message",{data:s?o:o.toString()});a[fo]=this,sl(t,this,a)};else if(e==="close")n=function(o,s){let a=new ei("close",{code:o,reason:s.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[fo]=this,sl(t,this,a)};else if(e==="error")n=function(o){let s=new ho("error",{error:o,message:o.message});s[fo]=this,sl(t,this,s)};else if(e==="open")n=function(){let o=new Mr("open");o[fo]=this,sl(t,this,o)};else return;n[ta]=!!r[ta],n[sy]=t,r.once?this.once(e,n):this.on(e,n)},removeEventListener(e,t){for(let r of this.listeners(e))if(r[sy]===t&&!r[ta]){this.removeListener(e,r);break}}};SN.exports={CloseEvent:ei,ErrorEvent:ho,Event:Mr,EventTarget:H2,MessageEvent:ra};function sl(e,t,r){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,r):e.call(t,r)}});var al=y((zae,IN)=>{"use strict";p();var{tokenChars:na}=co();function Er(e,t,r){e[t]===void 0?e[t]=[r]:e[t].push(r)}function Q2(e){let t=Object.create(null),r=Object.create(null),n=!1,i=!1,o=!1,s,a,u=-1,c=-1,l=-1,d=0;for(;d<e.length;d++)if(c=e.charCodeAt(d),s===void 0)if(l===-1&&na[c]===1)u===-1&&(u=d);else if(d!==0&&(c===32||c===9))l===-1&&u!==-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let h=e.slice(u,l);c===44?(Er(t,h,r),r=Object.create(null)):s=h,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);else if(a===void 0)if(l===-1&&na[c]===1)u===-1&&(u=d);else if(c===32||c===9)l===-1&&u!==-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d),Er(r,e.slice(u,l),!0),c===44&&(Er(t,s,r),r=Object.create(null),s=void 0),u=l=-1}else if(c===61&&u!==-1&&l===-1)a=e.slice(u,d),u=l=-1;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(i){if(na[c]!==1)throw new SyntaxError(`Unexpected character at index ${d}`);u===-1?u=d:n||(n=!0),i=!1}else if(o)if(na[c]===1)u===-1&&(u=d);else if(c===34&&u!==-1)o=!1,l=d;else if(c===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${d}`);else if(c===34&&e.charCodeAt(d-1)===61)o=!0;else if(l===-1&&na[c]===1)u===-1&&(u=d);else if(u!==-1&&(c===32||c===9))l===-1&&(l=d);else if(c===59||c===44){if(u===-1)throw new SyntaxError(`Unexpected character at index ${d}`);l===-1&&(l=d);let h=e.slice(u,l);n&&(h=h.replace(/\\/g,""),n=!1),Er(r,a,h),c===44&&(Er(t,s,r),r=Object.create(null),s=void 0),a=void 0,u=l=-1}else throw new SyntaxError(`Unexpected character at index ${d}`);if(u===-1||o||c===32||c===9)throw new SyntaxError("Unexpected end of input");l===-1&&(l=d);let f=e.slice(u,l);return s===void 0?Er(t,f,r):(a===void 0?Er(r,f,!0):n?Er(r,a,f.replace(/\\/g,"")):Er(r,a,f),Er(t,s,r)),t}function W2(e){return Object.keys(e).map(t=>{let r=e[t];return Array.isArray(r)||(r=[r]),r.map(n=>[t].concat(Object.keys(n).map(i=>{let o=n[i];return Array.isArray(o)||(o=[o]),o.map(s=>s===!0?i:`${i}=${s}`).join("; ")})).join("; ")).join(", ")}).join(", ")}IN.exports={format:W2,parse:Q2}});var pl=y((Zae,jN)=>{"use strict";p();var z2=M("events"),Y2=M("https"),J2=M("http"),AN=M("net"),X2=M("tls"),{randomBytes:Z2,createHash:e4}=M("crypto"),{Duplex:Jae,Readable:Xae}=M("stream"),{URL:ay}=M("url"),fn=uo(),t4=ry(),r4=oy(),{isBlob:n4}=co(),{BINARY_TYPES:wN,CLOSE_TIMEOUT:i4,EMPTY_BUFFER:ul,GUID:o4,kForOnEventAttribute:uy,kListener:s4,kStatusCode:a4,kWebSocket:ze,NOOP:xN}=kr(),{EventTarget:{addEventListener:u4,removeEventListener:c4}}=TN(),{format:l4,parse:p4}=al(),{toBuffer:d4}=Zs(),NN=Symbol("kAborted"),cy=[8,13],Fr=["CONNECTING","OPEN","CLOSING","CLOSED"],f4=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Ne=class e extends z2{constructor(t,r,n){super(),this._binaryType=wN[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ul,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(n=r,r=[]):r=[r]),RN(this,t,r,n)):(this._autoPong=n.autoPong,this._closeTimeout=n.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){wN.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,n){let i=new t4({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:n.maxBufferedChunks,maxFragments:n.maxFragments,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),o=new r4(t,this._extensions,n.generateMask);this._receiver=i,this._sender=o,this._socket=t,i[ze]=this,o[ze]=this,t[ze]=this,i.on("conclude",g4),i.on("drain",y4),i.on("error",v4),i.on("message",E4),i.on("ping",_4),i.on("pong",b4),o.onerror=S4,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",DN),t.on("data",ll),t.on("end",LN),t.on("error",kN),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[fn.extensionName]&&this._extensions[fn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){At(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,r,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),PN(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){ly(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.ping(t||ul,r,n)}pong(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(n=t,t=r=void 0):typeof r=="function"&&(n=r,r=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){ly(this,t,n);return}r===void 0&&(r=!this._isServer),this._sender.pong(t||ul,r,n)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,n){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(n=r,r={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){ly(this,t,n);return}let i={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[fn.extensionName]||(i.compress=!1),this._sender.send(t||ul,i,n)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){At(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(Ne,"CONNECTING",{enumerable:!0,value:Fr.indexOf("CONNECTING")});Object.defineProperty(Ne.prototype,"CONNECTING",{enumerable:!0,value:Fr.indexOf("CONNECTING")});Object.defineProperty(Ne,"OPEN",{enumerable:!0,value:Fr.indexOf("OPEN")});Object.defineProperty(Ne.prototype,"OPEN",{enumerable:!0,value:Fr.indexOf("OPEN")});Object.defineProperty(Ne,"CLOSING",{enumerable:!0,value:Fr.indexOf("CLOSING")});Object.defineProperty(Ne.prototype,"CLOSING",{enumerable:!0,value:Fr.indexOf("CLOSING")});Object.defineProperty(Ne,"CLOSED",{enumerable:!0,value:Fr.indexOf("CLOSED")});Object.defineProperty(Ne.prototype,"CLOSED",{enumerable:!0,value:Fr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(Ne.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(Ne.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[uy])return t[s4];return null},set(t){for(let r of this.listeners(e))if(r[uy]){this.removeListener(e,r);break}typeof t=="function"&&this.addEventListener(e,t,{[uy]:!0})}})});Ne.prototype.addEventListener=u4;Ne.prototype.removeEventListener=c4;jN.exports=Ne;function RN(e,t,r,n){let i={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:i4,protocolVersion:cy[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=i.autoPong,e._closeTimeout=i.closeTimeout,!cy.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${cy.join(", ")})`);let o;if(t instanceof ay)o=t;else try{o=new ay(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}o.protocol==="http:"?o.protocol="ws:":o.protocol==="https:"&&(o.protocol="wss:"),e._url=o.href;let s=o.protocol==="wss:",a=o.protocol==="ws+unix:",u;if(o.protocol!=="ws:"&&!s&&!a?u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!o.pathname?u="The URL's pathname is empty":o.hash&&(u="The URL contains a fragment identifier"),u){let v=new SyntaxError(u);if(e._redirects===0)throw v;cl(e,v);return}let c=s?443:80,l=Z2(16).toString("base64"),d=s?Y2.request:J2.request,f=new Set,h;if(i.createConnection=i.createConnection||(s?m4:h4),i.defaultPort=i.defaultPort||c,i.port=o.port||c,i.host=o.hostname.startsWith("[")?o.hostname.slice(1,-1):o.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":l,Connection:"Upgrade",Upgrade:"websocket"},i.path=o.pathname+o.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(h=new fn({...i.perMessageDeflate,isServer:!1,maxPayload:i.maxPayload}),i.headers["Sec-WebSocket-Extensions"]=l4({[fn.extensionName]:h.offer()})),r.length){for(let v of r){if(typeof v!="string"||!f4.test(v)||f.has(v))throw new SyntaxError("An invalid or duplicated subprotocol was specified");f.add(v)}i.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(o.username||o.password)&&(i.auth=`${o.username}:${o.password}`),a){let v=i.path.split(":");i.socketPath=v[0],i.path=v[1]}let g;if(i.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=s,e._originalHostOrSocketPath=a?i.socketPath:o.host;let v=n&&n.headers;if(n={...n,headers:{}},v)for(let[_,S]of Object.entries(v))n.headers[_.toLowerCase()]=S}else if(e.listenerCount("redirect")===0){let v=a?e._originalIpc?i.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:o.host===e._originalHostOrSocketPath;(!v||e._originalSecure&&!s)&&(delete i.headers.authorization,delete i.headers.cookie,v||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),g=e._req=d(i),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=d(i);i.timeout&&g.on("timeout",()=>{At(e,g,"Opening handshake has timed out")}),g.on("error",v=>{g===null||g[NN]||(g=e._req=null,cl(e,v))}),g.on("response",v=>{let _=v.headers.location,S=v.statusCode;if(_&&i.followRedirects&&S>=300&&S<400){if(++e._redirects>i.maxRedirects){At(e,g,"Maximum redirects exceeded");return}g.abort();let b;try{b=new ay(_,t)}catch{let O=new SyntaxError(`Invalid URL: ${_}`);cl(e,O);return}RN(e,b,r,n)}else e.emit("unexpected-response",g,v)||At(e,g,`Unexpected server response: ${v.statusCode}`)}),g.on("upgrade",(v,_,S)=>{if(e.emit("upgrade",v),e.readyState!==Ne.CONNECTING)return;g=e._req=null;let b=v.headers.upgrade;if(b===void 0||b.toLowerCase()!=="websocket"){At(e,_,"Invalid Upgrade header");return}let A=e4("sha1").update(l+o4).digest("base64");if(v.headers["sec-websocket-accept"]!==A){At(e,_,"Invalid Sec-WebSocket-Accept header");return}let O=v.headers["sec-websocket-protocol"],T;if(O!==void 0?f.size?f.has(O)||(T="Server sent an invalid subprotocol"):T="Server sent a subprotocol but none was requested":f.size&&(T="Server sent no subprotocol"),T){At(e,_,T);return}O&&(e._protocol=O);let x=v.headers["sec-websocket-extensions"];if(x!==void 0){if(!h){At(e,_,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let U;try{U=p4(x)}catch{At(e,_,"Invalid Sec-WebSocket-Extensions header");return}let N=Object.keys(U);if(N.length!==1||N[0]!==fn.extensionName){At(e,_,"Server indicated an extension that was not requested");return}try{h.accept(U[fn.extensionName])}catch{At(e,_,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[fn.extensionName]=h}e.setSocket(_,S,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxBufferedChunks:i.maxBufferedChunks,maxFragments:i.maxFragments,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(g,e):g.end()}function cl(e,t){e._readyState=Ne.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}function h4(e){return e.path=e.socketPath,AN.connect(e)}function m4(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=AN.isIP(e.host)?"":e.host),X2.connect(e)}function At(e,t,r){e._readyState=Ne.CLOSING;let n=new Error(r);Error.captureStackTrace(n,At),t.setHeader?(t[NN]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(cl,e,n)):(t.destroy(n),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function ly(e,t,r){if(t){let n=n4(t)?t.size:d4(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(r){let n=new Error(`WebSocket is not open: readyState ${e.readyState} (${Fr[e.readyState]})`);process.nextTick(r,n)}}function g4(e,t){let r=this[ze];r._closeFrameReceived=!0,r._closeMessage=t,r._closeCode=e,r._socket[ze]!==void 0&&(r._socket.removeListener("data",ll),process.nextTick(CN,r._socket),e===1005?r.close():r.close(e,t))}function y4(){let e=this[ze];e.isPaused||e._socket.resume()}function v4(e){let t=this[ze];t._socket[ze]!==void 0&&(t._socket.removeListener("data",ll),process.nextTick(CN,t._socket),t.close(e[a4])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}function ON(){this[ze].emitClose()}function E4(e,t){this[ze].emit("message",e,t)}function _4(e){let t=this[ze];t._autoPong&&t.pong(e,!this._isServer,xN),t.emit("ping",e)}function b4(e){this[ze].emit("pong",e)}function CN(e){e.resume()}function S4(e){let t=this[ze];t.readyState!==Ne.CLOSED&&(t.readyState===Ne.OPEN&&(t._readyState=Ne.CLOSING,PN(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}function PN(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}function DN(){let e=this[ze];if(this.removeListener("close",DN),this.removeListener("data",ll),this.removeListener("end",LN),e._readyState=Ne.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[ze]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",ON),e._receiver.on("finish",ON))}function ll(e){this[ze]._receiver.write(e)||this.pause()}function LN(){let e=this[ze];e._readyState=Ne.CLOSING,e._receiver.end(),this.end()}function kN(){let e=this[ze];this.removeListener("error",kN),this.on("error",xN),e&&(e._readyState=Ne.CLOSING,this.destroy())}});var UN=y((rue,qN)=>{"use strict";p();var tue=pl(),{Duplex:T4}=M("stream");function MN(e){e.emit("close")}function I4(){!this.destroyed&&this._writableState.finished&&this.destroy()}function FN(e){this.removeListener("error",FN),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function w4(e,t){let r=!0,n=new T4({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(o,s){let a=!s&&n._readableState.objectMode?o.toString():o;n.push(a)||e.pause()}),e.once("error",function(o){n.destroyed||(r=!1,n.destroy(o))}),e.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,o){if(e.readyState===e.CLOSED){o(i),process.nextTick(MN,n);return}let s=!1;e.once("error",function(u){s=!0,o(u)}),e.once("close",function(){s||o(i),process.nextTick(MN,n)}),r&&e.terminate()},n._final=function(i){if(e.readyState===e.CONNECTING){e.once("open",function(){n._final(i)});return}e._socket!==null&&(e._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(e._socket.once("finish",function(){i()}),e.close()))},n._read=function(){e.isPaused&&e.resume()},n._write=function(i,o,s){if(e.readyState===e.CONNECTING){e.once("open",function(){n._write(i,o,s)});return}e.send(i,s)},n.on("end",I4),n.on("error",FN),n}qN.exports=w4});var py=y((iue,VN)=>{"use strict";p();var{tokenChars:O4}=co();function A4(e){let t=new Set,r=-1,n=-1,i=0;for(i;i<e.length;i++){let s=e.charCodeAt(i);if(n===-1&&O4[s]===1)r===-1&&(r=i);else if(i!==0&&(s===32||s===9))n===-1&&r!==-1&&(n=i);else if(s===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=e.slice(r,n);if(t.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);t.add(a),r=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(r===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let o=e.slice(r,i);if(t.has(o))throw new SyntaxError(`The "${o}" subprotocol is duplicated`);return t.add(o),t}VN.exports={parse:A4}});var WN=y((aue,QN)=>{"use strict";p();var x4=M("events"),dl=M("http"),{Duplex:sue}=M("stream"),{createHash:N4}=M("crypto"),GN=al(),ti=uo(),R4=py(),C4=pl(),{CLOSE_TIMEOUT:P4,GUID:D4,kWebSocket:L4}=kr(),k4=/^[+/0-9A-Za-z]{22}==$/,$N=0,BN=1,HN=2,dy=class extends x4{constructor(t,r){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:P4,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:C4,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=dl.createServer((n,i)=>{let o=dl.STATUS_CODES[426];i.writeHead(426,{"Content-Length":o.length,"Content-Type":"text/plain"}),i.end(o)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=j4(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,o,s)=>{this.handleUpgrade(i,o,s,n)}})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=$N}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===HN){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(ia,this);return}if(t&&this.once("close",t),this._state!==BN)if(this._state=BN,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(ia,this):process.nextTick(ia,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{ia(this)})}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((r!==-1?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,n,i){r.on("error",KN);let o=t.headers["sec-websocket-key"],s=t.headers.upgrade,a=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ri(this,t,r,405,"Invalid HTTP method");return}if(s===void 0||s.toLowerCase()!=="websocket"){ri(this,t,r,400,"Invalid Upgrade header");return}if(o===void 0||!k4.test(o)){ri(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){ri(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){oa(r,400);return}let u=t.headers["sec-websocket-protocol"],c=new Set;if(u!==void 0)try{c=R4.parse(u)}catch{ri(this,t,r,400,"Invalid Sec-WebSocket-Protocol header");return}let l=t.headers["sec-websocket-extensions"],d={};if(this.options.perMessageDeflate&&l!==void 0){let f=new ti({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let h=GN.parse(l);h[ti.extensionName]&&(f.accept(h[ti.extensionName]),d[ti.extensionName]=f)}catch{ri(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let f={origin:t.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(f,(h,g,v,_)=>{if(!h)return oa(r,g||401,v,_);this.completeUpgrade(d,o,c,t,r,n,i)});return}if(!this.options.verifyClient(f))return oa(r,401)}this.completeUpgrade(d,o,c,t,r,n,i)}completeUpgrade(t,r,n,i,o,s,a){if(!o.readable||!o.writable)return o.destroy();if(o[L4])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>$N)return oa(o,503);let c=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${N4("sha1").update(r+D4).digest("base64")}`],l=new this.options.WebSocket(null,void 0,this.options);if(n.size){let d=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;d&&(c.push(`Sec-WebSocket-Protocol: ${d}`),l._protocol=d)}if(t[ti.extensionName]){let d=t[ti.extensionName].params,f=GN.format({[ti.extensionName]:[d]});c.push(`Sec-WebSocket-Extensions: ${f}`),l._extensions=t}this.emit("headers",c,i),o.write(c.concat(`\r
|
|
208
208
|
`).join(`\r
|
|
209
|
-
`)),o.removeListener("error",
|
|
209
|
+
`)),o.removeListener("error",KN),l.setSocket(o,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(l),l.on("close",()=>{this.clients.delete(l),this._shouldEmitClose&&!this.clients.size&&process.nextTick(ia,this)})),a(l,i)}};QN.exports=dy;function j4(e,t){for(let r of Object.keys(t))e.on(r,t[r]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function ia(e){e._state=HN,e.emit("close")}function KN(){this.destroy()}function oa(e,t,r,n){r=r||dl.STATUS_CODES[t],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...n},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${dl.STATUS_CODES[t]}\r
|
|
210
210
|
`+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
|
|
211
211
|
`)+`\r
|
|
212
212
|
\r
|
|
213
|
-
`+r)}function ri(e,t,r,n,i,o){if(e.listenerCount("wsClientError")){let s=new Error(i);Error.captureStackTrace(s,ri),e.emit("wsClientError",s,r,t)}else
|
|
213
|
+
`+r)}function ri(e,t,r,n,i,o){if(e.listenerCount("wsClientError")){let s=new Error(i);Error.captureStackTrace(s,ri),e.emit("wsClientError",s,r,t)}else oa(r,n,i,o)}});p();import{spawn as jX}from"child_process";import{randomUUID as MX}from"crypto";import{closeSync as FX,openSync as qX}from"fs";import{promises as UX}from"fs";import XP from"path";p();var Bv=qe($v(),1),{program:dZ,createCommand:fZ,createArgument:hZ,createOption:mZ,CommanderError:gZ,InvalidArgumentError:vp,InvalidOptionArgumentError:yZ,Command:Kv,Argument:vZ,Option:EZ,Help:_Z}=Bv.default;p();p();var TS=qe(Vo(),1);import{promises as $r}from"fs";import Vq from"os";import In from"path";import{randomUUID as Gq}from"crypto";var br=class{workspaceRoot;mcpConfigDir;credentialsPath;configPath;projectContextPath;globalConfigDir=In.join(Vq.homedir(),`.${Y}`);globalCredentialsPath=In.join(this.globalConfigDir,"credentials.json");constructor(t){this.setWorkspaceRoot(t)}setWorkspaceRoot(t){this.workspaceRoot=t,this.mcpConfigDir=In.join(t,`.${Y}`),this.credentialsPath=In.join(this.mcpConfigDir,"credentials.json"),this.configPath=In.join(this.mcpConfigDir,"config.json"),this.projectContextPath=In.join(this.mcpConfigDir,"project-context.json")}async ensureInitialized(){await $r.mkdir(this.mcpConfigDir,{recursive:!0});let t=In.join(this.mcpConfigDir,".gitignore"),r="*";try{await $r.writeFile(t,r,{flag:"wx"})}catch(n){if(n.code!=="EEXIST")throw n}}tempPathFor(t){return`${t}.${process.pid}.${Gq()}.tmp`}async atomicWrite(t,r,n){let i=this.tempPathFor(t);await $r.writeFile(i,JSON.stringify(r,null,2),n!==void 0?{mode:n}:void 0),await $r.rename(i,t)}async readJsonFile(t){try{let r=await $r.readFile(t,"utf8");return JSON.parse(r)}catch(r){if(r.code==="ENOENT")return null;throw r}}async unlinkIfExists(t){try{await $r.unlink(t)}catch(r){if(r.code!=="ENOENT")throw r}}async fileExists(t){try{return await $r.access(t),!0}catch{return!1}}async saveCredentials(t){if(!t.access_token||t.access_token.trim()==="")throw new Error("Invalid credentials: access_token is required");let r={access_token:t.access_token,token_type:t.token_type||"Bearer",savedAt:new Date().toISOString()};if(!this.validateCredentials(r))throw new Error("Invalid credentials: JWT token validation failed");await this.fileExists(this.credentialsPath)?(await this.ensureInitialized(),await this.atomicWrite(this.credentialsPath,r,384)):(await $r.mkdir(this.globalConfigDir,{recursive:!0}),await this.atomicWrite(this.globalCredentialsPath,r,384)),C.info("[CredentialStore] Credentials saved successfully")}async loadCredentials(){let t=await this.readJsonFile(this.credentialsPath);if(t){if(this.validateCredentials(t))return t;C.error("[CredentialStore] Workspace credentials are invalid or expired")}let r=await this.readJsonFile(this.globalCredentialsPath);if(r){if(this.validateCredentials(r))return r;C.error("[CredentialStore] Global credentials are invalid or expired")}return null}validateCredentials(t){if(!t||!t.access_token)return C.error("[CredentialStore] Missing access token"),!1;if(t.token_type!=="Bearer")return C.error("[CredentialStore] Invalid token type:",t.token_type),!1;try{let r=TS.default.decode(t.access_token,{complete:!0});if(!r||typeof r=="string")return C.error("[CredentialStore] Failed to decode JWT token"),!1;let n=r.payload;if(n.exp){let i=n.exp*1e3,o=Date.now();if(o>=i)return C.error("[CredentialStore] JWT token has expired"),!1;let s=Math.floor((i-o)/1e3/60);C.debug(`[CredentialStore] Token valid for ${s} more minutes`)}else console.warn("[CredentialStore] JWT token does not have expiration field");return n.iss&&C.debug(`[CredentialStore] Token issued by: ${n.iss}`),n.sub&&C.debug(`[CredentialStore] Token subject: ${n.sub}`),!0}catch(r){return C.error("[CredentialStore] Error validating JWT token:",r.message),!1}}async deleteCredentials(){await this.unlinkIfExists(this.credentialsPath),await this.unlinkIfExists(this.globalCredentialsPath),C.info("[CredentialStore] Credentials deleted")}async areCredentialsValid(){return await this.loadCredentials()!==null}async saveConfig(t){await this.ensureInitialized(),await this.atomicWrite(this.configPath,t)}async loadConfig(){return this.readJsonFile(this.configPath)}async saveProjectContext(t,r){await this.ensureInitialized();let n={projectExId:t,appExId:r,lastUsed:new Date().toISOString()};await this.atomicWrite(this.projectContextPath,n)}async loadProjectContext(){let t=await this.readJsonFile(this.projectContextPath);return t&&{...t,appExId:t.appExId??null}}async deleteProjectContext(){await this.unlinkIfExists(this.projectContextPath)}getWorkspaceRoot(){return this.workspaceRoot}getMcpConfigDir(){return this.mcpConfigDir}};p();var q0=qe(Vo(),1);p();p();var wn=class e extends Error{response;request;constructor(t,r){let n=`${e.extractMessage(t)}: ${JSON.stringify({response:t,request:r})}`;super(n),Object.setPrototypeOf(this,e.prototype),this.response=t,this.request=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)}static extractMessage(t){return t.errors?.[0]?.message??`GraphQL Error (Code: ${String(t.status)})`}};p();p();p();var ud=e=>e.toUpperCase(),iu=e=>typeof e=="function"?e():e,cd=(e,t)=>e.map((r,n)=>[r,t[n]]),On=e=>{let t={};return e instanceof Headers?t=$q(e):Array.isArray(e)?e.forEach(([r,n])=>{r&&n!==void 0&&(t[r]=n)}):e&&(t=e),t},$q=e=>{let t={};return e.forEach((r,n)=>{t[n]=r}),t},wS=e=>{try{let t=e();return Bq(t)?t.catch(r=>IS(r)):t}catch(t){return IS(t)}},IS=e=>e instanceof Error?e:new Error(String(e)),Bq=e=>typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"&&"catch"in e&&typeof e.catch=="function"&&"finally"in e&&typeof e.finally=="function",ou=e=>{throw new Error(`Unhandled case: ${String(e)}`)},Go=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);p();var OS=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0};p();var AS=(e,t,r)=>e.query?e:{query:e,variables:t,requestHeaders:r,signal:void 0};p();p();var w0=qe(cn(),1);p();var Qm="Accept",Pc="Content-Type",qs="application/json",Dc="application/graphql-response+json";var Wm=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),O0=e=>{let t=e.toLowerCase();return t.includes(Dc)||t.includes(qs)},zm=e=>{try{if(Array.isArray(e))return{_tag:"Batch",executionResults:e.map(T0)};if(Go(e))return{_tag:"Single",executionResult:T0(e)};throw new Error(`Invalid execution result: result is not object or array.
|
|
214
214
|
Got:
|
|
215
|
-
${String(e)}`)}catch(t){return t}},
|
|
215
|
+
${String(e)}`)}catch(t){return t}},T0=e=>{if(typeof e!="object"||e===null)throw new Error("Invalid execution result: result is not object");let t,r,n;if("errors"in e){if(!Go(e.errors)&&!Array.isArray(e.errors))throw new Error("Invalid execution result: errors is not plain object OR array");t=e.errors}if("data"in e){if(!Go(e.data)&&e.data!==null)throw new Error("Invalid execution result: data is not plain object");r=e.data}if("extensions"in e){if(!Go(e.extensions))throw new Error("Invalid execution result: extensions is not plain object");n=e.extensions}return{data:r,errors:t,extensions:n}},A0=e=>e._tag==="Batch"?e.executionResults.some(I0):I0(e.executionResult),I0=e=>Array.isArray(e.errors)?e.errors.length>0:!!e.errors,Ym=e=>typeof e=="object"&&e!==null&&"kind"in e&&e.kind===w0.Kind.OPERATION_DEFINITION;var x0=qe(cn(),1),N0=qe(cn(),1),Zz=e=>{let t,r=e.definitions.filter(Ym);return r.length===1&&(t=r[0].name?.value),t},eY=e=>{let t=!1,r=e.definitions.filter(Ym);return r.length===1&&(t=r[0].operation==="mutation"),t},Us=(e,t)=>{let r=typeof e=="string"||"kind"in e?e:String(e),n=typeof r=="string"?r:(0,N0.print)(r),i=!1,o;if(t)return{expression:n,isMutation:i,operationName:o};let s=wS(()=>typeof r=="string"?(0,x0.parse)(r):r);return s instanceof Error?{expression:n,isMutation:i,operationName:o}:(o=Zz(s),i=eY(s),{expression:n,operationName:o,isMutation:i})};p();p();var Lc=JSON;var kc=async e=>{let t={...e,method:e.request._tag==="Single"?e.request.document.isMutation?"POST":ud(e.method??"post"):e.request.hasMutations?"POST":ud(e.method??"post"),fetchOptions:{...e.fetchOptions,errorPolicy:e.fetchOptions.errorPolicy??"none"}},n=await rY(t.method)(t),i=await n.text(),o;try{o=tY(i,n.headers.get(Pc),e.fetchOptions.jsonSerializer??Lc)}catch(a){o=a}let s={status:n.status,headers:n.headers,body:i};if(!n.ok){if(o instanceof Error)return new wn({...s},{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables});let a=o._tag==="Batch"?{...o.executionResults,...s}:{...o.executionResult,...s};return new wn(a,{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables})}if(o instanceof Error)throw o;if(A0(o)&&t.fetchOptions.errorPolicy==="none"){let a=o._tag==="Batch"?{...o.executionResults,...s}:{...o.executionResult,...s};return new wn(a,{query:e.request._tag==="Single"?e.request.document.expression:e.request.query,variables:e.request.variables})}switch(o._tag){case"Single":return{...s,...R0(t)(o.executionResult)};case"Batch":return{...s,data:o.executionResults.map(R0(t))};default:ou(o)}},R0=e=>t=>({extensions:t.extensions,data:t.data,errors:e.fetchOptions.errorPolicy==="all"?t.errors:void 0}),tY=(e,t,r)=>t&&O0(t)?zm(r.parse(e)):zm(e),rY=e=>async t=>{let r=new Headers(t.headers),n=null,i;r.has(Qm)||r.set(Qm,[Dc,qs].join(", ")),e==="POST"?(i=(t.fetchOptions.jsonSerializer??Lc).stringify(nY(t)),typeof i=="string"&&!r.has(Pc)&&r.set(Pc,qs)):n=iY(t);let o={method:e,headers:r,body:i,...t.fetchOptions},s=new URL(t.url),a=o;if(t.middleware){let c=await Promise.resolve(t.middleware({...o,url:t.url,operationName:t.request._tag==="Single"?t.request.document.operationName:void 0,variables:t.request.variables})),{url:l,...d}=c;s=new URL(l),a=d}return n&&n.forEach((c,l)=>{s.searchParams.append(l,c)}),await(t.fetch??fetch)(s,a)},nY=e=>{switch(e.request._tag){case"Single":return{query:e.request.document.expression,variables:e.request.variables,operationName:e.request.document.operationName};case"Batch":return cd(e.request.query,e.request.variables??[]).map(([t,r])=>({query:t,variables:r}));default:throw ou(e.request)}},iY=e=>{let t=e.fetchOptions.jsonSerializer??Lc,r=new URLSearchParams;switch(e.request._tag){case"Single":return r.append("query",Wm(e.request.document.expression)),e.request.variables&&r.append("variables",t.stringify(e.request.variables)),e.request.document.operationName&&r.append("operationName",e.request.document.operationName),r;case"Batch":{let n=e.request.variables?.map(s=>t.stringify(s))??[],i=e.request.query.map(Wm),o=cd(i,n).map(([s,a])=>({query:s,variables:a}));return r.append("query",t.stringify(o)),r}default:throw ou(e.request)}};var Ze=class{url;requestConfig;constructor(t,r={}){this.url=t,this.requestConfig=r}rawRequest=async(...t)=>{let[r,n,i]=t,o=AS(r,n,i),{headers:s,fetch:a=globalThis.fetch,method:u="POST",requestMiddleware:c,responseMiddleware:l,excludeOperationName:d,...f}=this.requestConfig,{url:h}=this;o.signal!==void 0&&(f.signal=o.signal);let g=Us(o.query,d),v=await kc({url:h,request:{_tag:"Single",document:g,variables:o.variables},headers:{...On(iu(s)),...On(o.requestHeaders)},fetch:a,method:u,fetchOptions:f,middleware:c});if(l&&await l(v,{operationName:g.operationName,variables:n,url:this.url}),v instanceof Error)throw v;return v};async request(t,...r){let[n,i]=r,o=C0(t,n,i),{headers:s,fetch:a=globalThis.fetch,method:u="POST",requestMiddleware:c,responseMiddleware:l,excludeOperationName:d,...f}=this.requestConfig,{url:h}=this;o.signal!==void 0&&(f.signal=o.signal);let g=Us(o.document,d),v=await kc({url:h,request:{_tag:"Single",document:g,variables:o.variables},headers:{...On(iu(s)),...On(o.requestHeaders)},fetch:a,method:u,fetchOptions:f,middleware:c});if(l&&await l(v,{operationName:g.operationName,variables:o.variables,url:this.url}),v instanceof Error)throw v;return v.data}async batchRequests(t,r){let n=OS(t,r),{headers:i,excludeOperationName:o,...s}=this.requestConfig;n.signal!==void 0&&(s.signal=n.signal);let a=n.documents.map(({document:f})=>Us(f,o)),u=a.map(({expression:f})=>f),c=a.some(({isMutation:f})=>f),l=n.documents.map(({variables:f})=>f),d=await kc({url:this.url,request:{_tag:"Batch",operationName:void 0,query:u,hasMutations:c,variables:l},headers:{...On(iu(i)),...On(n.requestHeaders)},fetch:this.requestConfig.fetch??globalThis.fetch,method:this.requestConfig.method||"POST",fetchOptions:s,middleware:this.requestConfig.requestMiddleware});if(this.requestConfig.responseMiddleware&&await this.requestConfig.responseMiddleware(d,{operationName:void 0,variables:l,url:this.url}),d instanceof Error)throw d;return d.data}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,r){let{headers:n}=this.requestConfig;return n?n[t]=r:this.requestConfig.headers={[t]:r},this}setEndpoint(t){return this.url=t,this}};var C0=(e,t,r)=>e.document?e:{document:e,variables:t,requestHeaders:r,signal:void 0};p();var B=(e,...t)=>e.reduce((r,n,i)=>`${r}${n}${i in t?String(t[i]):""}`,"");p();var F0=qe(M0(),1);(0,F0.config)({quiet:!0});async function yr(e){let t=await e.loadConfig();if(!t){let r=Rt();t={authEndpoint:r.authEndpoint,apiBaseUrl:r.apiBaseUrl,callbackPort:process.env.LOCAL_CALLBACK_PORT?parseInt(process.env.LOCAL_CALLBACK_PORT,10):8088}}return t}var _Y=.25,bY=300*1e3,SY=3600*1e3,TY="query { refreshToken { accessToken } }",Xi=class{store;lastRefreshAt=Date.now();constructor(t){this.store=t}async getValidToken(){let t=await this.store.loadCredentials();if(!t)throw new Error(Ia);return await this.refreshIfDue(t.access_token)??t.access_token}async refreshIfNeeded(){try{let t=await this.store.loadCredentials();if(!t)return;await this.refreshIfDue(t.access_token)}catch(t){C.debug(`[TokenManager] background refresh check failed: ${t.message}`)}}async refreshIfDue(t){if(!this.isDue(t))return null;try{let r=await yr(this.store),o=(await new Ze(`${r.apiBaseUrl}/api/graphql`,{headers:{Authorization:`Bearer ${t}`}}).request(TY)).refreshToken?.accessToken;return o?(await this.store.saveCredentials({access_token:o,token_type:"Bearer"}),this.lastRefreshAt=Date.now(),C.info("[TokenManager] Access token refreshed"),o):(C.debug("[TokenManager] refreshToken returned no accessToken - keeping current token"),null)}catch(r){return C.debug(`[TokenManager] Token refresh failed - keeping current token: ${r.message}`),null}}isDue(t){try{let r=q0.default.decode(t,{complete:!0});if(!r||typeof r=="string")return!1;let n=r.payload;if(!n.exp)return!1;let i=Date.now(),o=n.exp*1e3-i;if(o<=0)return!1;let s=n.iat!=null?(n.exp-n.iat)*1e3*_Y:bY;if(o<s)return!0;let a=n.iat!=null?n.iat*1e3:this.lastRefreshAt;return i-a>=SY}catch{return!1}}};p();import{EventEmitter as N5}from"events";p();import{randomUUID as ca}from"crypto";p();p();var U0=B`
|
|
216
216
|
query TabBarIcons {
|
|
217
217
|
getTabBarIcons {
|
|
218
218
|
exId
|
|
219
219
|
url
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
|
-
`,
|
|
222
|
+
`,V0=B`
|
|
223
223
|
fragment SchemaCrdtPatch on SchemaCrdtPatch {
|
|
224
224
|
exId
|
|
225
225
|
createdAt
|
|
226
226
|
content
|
|
227
227
|
patchBase64
|
|
228
228
|
}
|
|
229
|
-
`,
|
|
229
|
+
`,Xm=B`
|
|
230
230
|
fragment SchemaCrdtPatches on SchemaCrdtPatches {
|
|
231
231
|
lastPatchExId
|
|
232
232
|
patches {
|
|
233
233
|
...SchemaCrdtPatch
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
${
|
|
237
|
-
`,
|
|
236
|
+
${V0}
|
|
237
|
+
`,Mc=B`
|
|
238
238
|
query FuzzySearchProjectName(
|
|
239
239
|
$projectName: String!
|
|
240
240
|
$paginator: ConnectionPaginatorInput
|
|
@@ -259,17 +259,14 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
-
`,Wn
|
|
262
|
+
`,Wn=B`
|
|
263
263
|
query FetchAppDetailByExId(
|
|
264
264
|
$projectExId: String!
|
|
265
265
|
$appExId: String
|
|
266
266
|
$appVersionExId: String
|
|
267
267
|
) {
|
|
268
|
-
#
|
|
269
|
-
|
|
270
|
-
# migrates the project schema on read (ZED_VERSION_MISSING otherwise). The
|
|
271
|
-
# alias keeps the response key stable so generated types stay valid.
|
|
272
|
-
fetchAppDetailByExId: fetchAppDetailByExIdWithoutReconcile(
|
|
268
|
+
# Not WithoutReconcile: the backend migrates the schema up to our X-ZED-VERSION first.
|
|
269
|
+
fetchAppDetailByExId(
|
|
273
270
|
projectExId: $projectExId
|
|
274
271
|
appExId: $appExId
|
|
275
272
|
appVersionExId: $appVersionExId
|
|
@@ -474,8 +471,8 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
474
471
|
wechatBetaAppId
|
|
475
472
|
}
|
|
476
473
|
|
|
477
|
-
${
|
|
478
|
-
`,
|
|
474
|
+
${Xm}
|
|
475
|
+
`,IY=B`
|
|
479
476
|
fragment OrganizationForAgent on Organization {
|
|
480
477
|
exId
|
|
481
478
|
displayName
|
|
@@ -492,7 +489,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
492
489
|
}
|
|
493
490
|
}
|
|
494
491
|
}
|
|
495
|
-
`,
|
|
492
|
+
`,Fc=B`
|
|
496
493
|
query FetchCurrentUserInfoForAgent {
|
|
497
494
|
user {
|
|
498
495
|
exId
|
|
@@ -517,7 +514,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
517
514
|
}
|
|
518
515
|
}
|
|
519
516
|
}
|
|
520
|
-
`,
|
|
517
|
+
`,G0=B`
|
|
521
518
|
query FetchAccountProfileForAgent {
|
|
522
519
|
user {
|
|
523
520
|
exId
|
|
@@ -534,27 +531,27 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
534
531
|
}
|
|
535
532
|
}
|
|
536
533
|
|
|
537
|
-
${
|
|
538
|
-
|
|
534
|
+
${IY}
|
|
535
|
+
`,$0=B`
|
|
539
536
|
mutation CreateMultiClientProjectForAgent(
|
|
540
537
|
$createProjectDetail: CreateProjectInputInput!
|
|
541
538
|
) {
|
|
542
539
|
createMultiClientProjectAsync(createProjectDetail: $createProjectDetail)
|
|
543
540
|
}
|
|
544
|
-
`,
|
|
541
|
+
`,B0=B`
|
|
545
542
|
query GetFeaturesForAgent($projectExId: String) {
|
|
546
543
|
features(projectExId: $projectExId) {
|
|
547
544
|
featureName
|
|
548
545
|
enabled
|
|
549
546
|
}
|
|
550
547
|
}
|
|
551
|
-
`,
|
|
548
|
+
`,K0=B`
|
|
552
549
|
mutation RenameProjectForAgent($projectExId: String!, $projectName: String!) {
|
|
553
550
|
renameProject(projectExId: $projectExId, projectName: $projectName) {
|
|
554
551
|
projectName
|
|
555
552
|
}
|
|
556
553
|
}
|
|
557
|
-
`,
|
|
554
|
+
`,H0=B`
|
|
558
555
|
mutation RenameAppForAgent(
|
|
559
556
|
$projectExId: String!
|
|
560
557
|
$appExId: String!
|
|
@@ -564,18 +561,18 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
564
561
|
name
|
|
565
562
|
}
|
|
566
563
|
}
|
|
567
|
-
`,
|
|
564
|
+
`,Q0=B`
|
|
568
565
|
mutation DeleteProjectForAgent($projectExId: String!) {
|
|
569
566
|
deleteProject(projectExId: $projectExId)
|
|
570
567
|
}
|
|
571
|
-
`,
|
|
568
|
+
`,W0=B`
|
|
572
569
|
mutation ResetProjectForAgent(
|
|
573
570
|
$projectExId: String!
|
|
574
571
|
$languageType: LanguageType!
|
|
575
572
|
) {
|
|
576
573
|
resetProject(projectExId: $projectExId, languageType: $languageType)
|
|
577
574
|
}
|
|
578
|
-
|
|
575
|
+
`,z0=B`
|
|
579
576
|
query FetchProjectRuntimeAdminAccess(
|
|
580
577
|
$projectExId: String!
|
|
581
578
|
$appVersionExId: String
|
|
@@ -592,7 +589,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
592
589
|
}
|
|
593
590
|
}
|
|
594
591
|
}
|
|
595
|
-
`,
|
|
592
|
+
`,Y0=B`
|
|
596
593
|
query FetchCrdtSchemaBySchemaExId($schemaExId: String!) {
|
|
597
594
|
crdtSchemaBySchemaExId(schemaExId: $schemaExId) {
|
|
598
595
|
crdtModelUrl
|
|
@@ -601,8 +598,8 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
601
598
|
}
|
|
602
599
|
}
|
|
603
600
|
}
|
|
604
|
-
${
|
|
605
|
-
`,
|
|
601
|
+
${Xm}
|
|
602
|
+
`,J0=B`
|
|
606
603
|
query SchemaCrdtPatchInputFields {
|
|
607
604
|
__type(name: "SchemaCrdtPatchCreationDtoInput") {
|
|
608
605
|
inputFields {
|
|
@@ -610,7 +607,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
610
607
|
}
|
|
611
608
|
}
|
|
612
609
|
}
|
|
613
|
-
`,
|
|
610
|
+
`,X0=B`
|
|
614
611
|
mutation BatchCreateSchemaCrdtPatch(
|
|
615
612
|
$projectExId: String!
|
|
616
613
|
$appExId: String
|
|
@@ -626,8 +623,8 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
626
623
|
...SchemaCrdtPatch
|
|
627
624
|
}
|
|
628
625
|
}
|
|
629
|
-
${
|
|
630
|
-
`,
|
|
626
|
+
${V0}
|
|
627
|
+
`,Zm=B`
|
|
631
628
|
mutation SaveSchema(
|
|
632
629
|
$projectExId: String!
|
|
633
630
|
$appExId: String
|
|
@@ -639,7 +636,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
639
636
|
versionExId: $versionExId
|
|
640
637
|
)
|
|
641
638
|
}
|
|
642
|
-
`,
|
|
639
|
+
`,Z0=B`
|
|
643
640
|
subscription OnNewCrdtPatchV2(
|
|
644
641
|
$projectExId: String!
|
|
645
642
|
$appExId: String
|
|
@@ -656,8 +653,8 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
656
653
|
...SchemaCrdtPatches
|
|
657
654
|
}
|
|
658
655
|
}
|
|
659
|
-
${
|
|
660
|
-
`,
|
|
656
|
+
${Xm}
|
|
657
|
+
`,eA=B`
|
|
661
658
|
subscription OnSchemaUploadV3(
|
|
662
659
|
$projectExId: String!
|
|
663
660
|
$appExId: String
|
|
@@ -679,7 +676,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
679
676
|
}
|
|
680
677
|
}
|
|
681
678
|
}
|
|
682
|
-
`,
|
|
679
|
+
`,tA=B`
|
|
683
680
|
mutation DeployV2ForAgent(
|
|
684
681
|
$schemaExId: String!
|
|
685
682
|
$projectExId: String!
|
|
@@ -693,7 +690,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
693
690
|
buildTarget: $buildTarget
|
|
694
691
|
)
|
|
695
692
|
}
|
|
696
|
-
`,
|
|
693
|
+
`,rA=B`
|
|
697
694
|
mutation ValidateAndDeploySupportServiceForAgent(
|
|
698
695
|
$schemaExId: String!
|
|
699
696
|
$projectExId: String!
|
|
@@ -707,7 +704,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
707
704
|
appExId
|
|
708
705
|
}
|
|
709
706
|
}
|
|
710
|
-
`,
|
|
707
|
+
`,nA=B`
|
|
711
708
|
query ResourceUsageAndBurstInfoForAgent(
|
|
712
709
|
$projectExId: String!
|
|
713
710
|
$nonRealTimeDisplayedResourceTypes: [ResourceType]
|
|
@@ -727,11 +724,11 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
727
724
|
visitTimesSupportedByComputingPower
|
|
728
725
|
}
|
|
729
726
|
}
|
|
730
|
-
`,
|
|
727
|
+
`,iA=B`
|
|
731
728
|
mutation RefreshAllProjectResourcesForAgent($projectExId: String!) {
|
|
732
729
|
refreshAllProjectResources(projectExId: $projectExId)
|
|
733
730
|
}
|
|
734
|
-
`,
|
|
731
|
+
`,oA=B`
|
|
735
732
|
query MonthlyResourceUsageHistoryForAgent(
|
|
736
733
|
$projectExId: String!
|
|
737
734
|
$resourceType: ResourceType!
|
|
@@ -741,7 +738,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
741
738
|
resourceType: $resourceType
|
|
742
739
|
)
|
|
743
740
|
}
|
|
744
|
-
`,
|
|
741
|
+
`,sA=B`
|
|
745
742
|
query DailyResourceUsageHistoryForAgent(
|
|
746
743
|
$projectExId: String!
|
|
747
744
|
$resourceType: ResourceType!
|
|
@@ -751,7 +748,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
751
748
|
resourceType: $resourceType
|
|
752
749
|
)
|
|
753
750
|
}
|
|
754
|
-
`,
|
|
751
|
+
`,aA=B`
|
|
755
752
|
query ActiveSingleTenantResourceInfoForAgent($projectExId: String!) {
|
|
756
753
|
findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch(
|
|
757
754
|
projectExId: $projectExId
|
|
@@ -761,7 +758,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
761
758
|
resourceType
|
|
762
759
|
}
|
|
763
760
|
}
|
|
764
|
-
`,
|
|
761
|
+
`,uA=B`
|
|
765
762
|
query ProjectPlanAndCapabilityForAgentQuery(
|
|
766
763
|
$projectExId: String!
|
|
767
764
|
$appExId: String
|
|
@@ -808,7 +805,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
808
805
|
projectPlanType
|
|
809
806
|
}
|
|
810
807
|
}
|
|
811
|
-
`,
|
|
808
|
+
`,yse=B`
|
|
812
809
|
query ProjectRpsStatsForAgent($projectExId: String!) {
|
|
813
810
|
project(projectExId: $projectExId) {
|
|
814
811
|
rpsStatsInLast30Days {
|
|
@@ -817,14 +814,14 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
817
814
|
}
|
|
818
815
|
}
|
|
819
816
|
}
|
|
820
|
-
`,
|
|
817
|
+
`,cA=B`
|
|
821
818
|
query SupportedCustomModelDescriptor {
|
|
822
819
|
supportedCustomModelDescriptor {
|
|
823
820
|
chatModelDescriptors
|
|
824
821
|
embeddingModelDescriptors
|
|
825
822
|
}
|
|
826
823
|
}
|
|
827
|
-
`,
|
|
824
|
+
`,qc=B`
|
|
828
825
|
query ProjectMetadataForAgent($projectExId: String!, $appExId: String) {
|
|
829
826
|
fetchAppDetailByExId: fetchAppDetailByExIdWithoutReconcile(
|
|
830
827
|
projectExId: $projectExId
|
|
@@ -944,7 +941,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
944
941
|
projectPlanType
|
|
945
942
|
}
|
|
946
943
|
}
|
|
947
|
-
`,
|
|
944
|
+
`,lA=B`
|
|
948
945
|
mutation CreateStaticSiteDeploymentForAgent(
|
|
949
946
|
$projectExId: String!
|
|
950
947
|
$appExId: String
|
|
@@ -965,7 +962,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
965
962
|
totalBytes
|
|
966
963
|
}
|
|
967
964
|
}
|
|
968
|
-
`,
|
|
965
|
+
`,pA=B`
|
|
969
966
|
mutation GetStaticSiteUploadUrlsForAgent(
|
|
970
967
|
$projectExId: String!
|
|
971
968
|
$appExId: String
|
|
@@ -993,7 +990,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
993
990
|
totalCount
|
|
994
991
|
}
|
|
995
992
|
}
|
|
996
|
-
`,
|
|
993
|
+
`,dA=B`
|
|
997
994
|
mutation CompleteStaticSiteDeploymentForAgent(
|
|
998
995
|
$projectExId: String!
|
|
999
996
|
$appExId: String
|
|
@@ -1014,7 +1011,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1014
1011
|
previousDeploymentExId
|
|
1015
1012
|
}
|
|
1016
1013
|
}
|
|
1017
|
-
`,
|
|
1014
|
+
`,fA=B`
|
|
1018
1015
|
mutation AbortStaticSiteDeploymentForAgent(
|
|
1019
1016
|
$projectExId: String!
|
|
1020
1017
|
$appExId: String
|
|
@@ -1030,7 +1027,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1030
1027
|
target
|
|
1031
1028
|
}
|
|
1032
1029
|
}
|
|
1033
|
-
`,
|
|
1030
|
+
`,hA=B`
|
|
1034
1031
|
query GetStaticSiteStatusForAgent(
|
|
1035
1032
|
$projectExId: String!
|
|
1036
1033
|
$appExId: String
|
|
@@ -1067,7 +1064,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1067
1064
|
activatedAt
|
|
1068
1065
|
}
|
|
1069
1066
|
}
|
|
1070
|
-
`,
|
|
1067
|
+
`,mA=B`
|
|
1071
1068
|
mutation StartAgentSession(
|
|
1072
1069
|
$projectExId: String!
|
|
1073
1070
|
$client: String!
|
|
@@ -1083,7 +1080,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1083
1080
|
agent: $agent
|
|
1084
1081
|
)
|
|
1085
1082
|
}
|
|
1086
|
-
`,
|
|
1083
|
+
`,gA=B`
|
|
1087
1084
|
mutation SaveSecretForAgent(
|
|
1088
1085
|
$projectExId: String!
|
|
1089
1086
|
$schemaExId: String!
|
|
@@ -1097,7 +1094,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1097
1094
|
secretKey
|
|
1098
1095
|
}
|
|
1099
1096
|
}
|
|
1100
|
-
`,
|
|
1097
|
+
`,yA=B`
|
|
1101
1098
|
mutation CreateWechatSourceCodeDeploymentForAgent(
|
|
1102
1099
|
$projectExId: String!
|
|
1103
1100
|
$appExId: String
|
|
@@ -1114,7 +1111,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1114
1111
|
totalBytes
|
|
1115
1112
|
}
|
|
1116
1113
|
}
|
|
1117
|
-
`,
|
|
1114
|
+
`,vA=B`
|
|
1118
1115
|
mutation GetWechatSourceCodeUploadUrlsForAgent(
|
|
1119
1116
|
$projectExId: String!
|
|
1120
1117
|
$appExId: String
|
|
@@ -1142,7 +1139,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1142
1139
|
totalCount
|
|
1143
1140
|
}
|
|
1144
1141
|
}
|
|
1145
|
-
`,
|
|
1142
|
+
`,EA=B`
|
|
1146
1143
|
mutation CompleteWechatSourceCodeUploadForAgent(
|
|
1147
1144
|
$projectExId: String!
|
|
1148
1145
|
$appExId: String
|
|
@@ -1162,7 +1159,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1162
1159
|
deploymentRecordExId
|
|
1163
1160
|
}
|
|
1164
1161
|
}
|
|
1165
|
-
`,
|
|
1162
|
+
`,_A=B`
|
|
1166
1163
|
mutation AbortWechatSourceCodeDeploymentForAgent(
|
|
1167
1164
|
$projectExId: String!
|
|
1168
1165
|
$appExId: String
|
|
@@ -1177,7 +1174,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1177
1174
|
status
|
|
1178
1175
|
}
|
|
1179
1176
|
}
|
|
1180
|
-
`,
|
|
1177
|
+
`,bA=B`
|
|
1181
1178
|
query GetWechatSourceCodeStatusForAgent(
|
|
1182
1179
|
$projectExId: String!
|
|
1183
1180
|
$appExId: String
|
|
@@ -1211,7 +1208,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1211
1208
|
deploymentRecordExId
|
|
1212
1209
|
}
|
|
1213
1210
|
}
|
|
1214
|
-
`,
|
|
1211
|
+
`,SA=B`
|
|
1215
1212
|
query GetWechatSourceCodeDeploymentForAgent(
|
|
1216
1213
|
$projectExId: String!
|
|
1217
1214
|
$appExId: String
|
|
@@ -1231,7 +1228,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1231
1228
|
deploymentRecordExId
|
|
1232
1229
|
}
|
|
1233
1230
|
}
|
|
1234
|
-
`,
|
|
1231
|
+
`,TA=B`
|
|
1235
1232
|
query GetWechatTrialVersionForAgent($projectExId: String!) {
|
|
1236
1233
|
project(projectExId: $projectExId) {
|
|
1237
1234
|
exId
|
|
@@ -1240,7 +1237,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1240
1237
|
wechatMiniAppQRCodeBase64
|
|
1241
1238
|
}
|
|
1242
1239
|
}
|
|
1243
|
-
`,
|
|
1240
|
+
`,IA=B`
|
|
1244
1241
|
query GetWechatTrialVersionMetaForAgent($projectExId: String!) {
|
|
1245
1242
|
project(projectExId: $projectExId) {
|
|
1246
1243
|
exId
|
|
@@ -1248,7 +1245,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1248
1245
|
wechatMiniAppPreviewTime
|
|
1249
1246
|
}
|
|
1250
1247
|
}
|
|
1251
|
-
`,
|
|
1248
|
+
`,wA=B`
|
|
1252
1249
|
query SupportServicePipelineStatusForAgent($projectExId: String!) {
|
|
1253
1250
|
project(projectExId: $projectExId) {
|
|
1254
1251
|
lastAllPipelinePlatformStatus {
|
|
@@ -1258,14 +1255,14 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1258
1255
|
}
|
|
1259
1256
|
}
|
|
1260
1257
|
}
|
|
1261
|
-
`,
|
|
1258
|
+
`,OA=B`
|
|
1262
1259
|
query DeployedServerSchemaForAgent($projectExId: String!) {
|
|
1263
1260
|
project(projectExId: $projectExId) {
|
|
1264
1261
|
exId
|
|
1265
1262
|
lastDeployedServerSchema
|
|
1266
1263
|
}
|
|
1267
1264
|
}
|
|
1268
|
-
`;p();var
|
|
1265
|
+
`;p();var AA=B`
|
|
1269
1266
|
query FetchLogsByPaginator(
|
|
1270
1267
|
$queryCreation: QueryCreationInputType
|
|
1271
1268
|
$paginator: PaginatorType
|
|
@@ -1282,7 +1279,7 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1282
1279
|
}
|
|
1283
1280
|
}
|
|
1284
1281
|
}
|
|
1285
|
-
`;p();var ml=Ge(Qn(),1);import{randomUUID as U4}from"crypto";var sR=Ge(Ux(),1);p();var N4=Ge(kN(),1),R4=Ge(ol(),1),C4=Ge(ao(),1),P4=Ge(Zg(),1),D4=Ge(ry(),1),L4=Ge(uy(),1),$N=Ge(cl(),1),k4=Ge(BN(),1);var KN=$N.default;p();var HN=100*1024*1024,pl=class{current=Promise.resolve();async run(t){let r=this.current,n=()=>{};this.current=new Promise(i=>{n=i}),await r;try{return await t()}finally{n()}}},ly=async e=>{let t=await fetch(e);if(!t.ok)throw new Error(`Failed to download CRDT model: ${t.status} ${t.statusText}`);let r=t.body?.getReader();if(!r)throw new Error("Failed to read CRDT model response body");let n=[],i=0;for(;;){let{done:a,value:u}=await r.read();if(a)break;if(i+=u.length,i>HN)throw new Error(`CRDT model is larger than ${HN} bytes`);n.push(u)}let o=new Uint8Array(i),s=0;for(let a of n)o.set(a,s),s+=a.length;return o},oa=async(e,t)=>{try{return await t()}catch(r){return C.warn(`Optional runtime package unavailable: ${e}`,r.message),null}},QN=null,xt=async()=>(QN??=oa("@functorz/ztype",()=>import("./ztype-G7EMRCO5.js")).then(e=>(e?.default??e)?.com?.functorz?.ztype??null),QN),WN=null,XN=async()=>(WN??=oa("@functorz/ztype",()=>import("./ztype-G7EMRCO5.js")).then(e=>(e?.default??e)?.kotlin?.collections??null),WN),zN=null,ZN=async()=>(zN??=xt().then(e=>e?.typesystem?.schema?.SCHEMA_VERSION??null),zN),YN=null,sa=async()=>(YN??=oa("@functorz/crdt-helper",()=>import("./index.cjs-ERRJ7ONN.js")).then(e=>e?.Crdt??e?.default?.Crdt??null),YN),JN=null,py=async()=>(JN??=oa("json-joy/lib/json-crdt-patch/index.js",()=>import("./json-crdt-patch-3KSX2FWP.js")).then(e=>e??oa("json-joy/lib/json-crdt/index.js",()=>import("./json-crdt-DOM7HQ5E.js"))).then(e=>e?.Patch??e?.default?.Patch??null),JN),aa=e=>e?.lastUploadedSchema??null,dy=e=>[e?.project?.lastDeployedServerSchemaExId,e?.lastDeployedServerSchemaExId,e?.project?.latestDeployedServerSchema?.exId,e?.latestDeployedServerSchema?.exId].find(r=>typeof r=="string"&&r.length>0)??null,eR=e=>e==null?e:structuredClone(e),fy=(e,t)=>e?.appExId?e.appExId:t?.name??"",hy=(e,t)=>{let r=e?.typesystem?.schema?.ClientType;if(r)return t==="WECHAT_MINI_PROGRAM"?r.WECHAT_MINI_PROGRAM??r.WECHAT??r.WEB:t==="MOBILE"?r.MOBILE??r.WEB:r.WEB},ho=e=>{let t=e?.typesystem?.schema?.Product?.[_n];if(!t)throw new Error(`ztype runtime has no Product enum member for ${_n}`);return t},tR=e=>{let t=e?.typesystem?.schema?.Locale?.EN;if(!t)throw new Error("ztype runtime has no Locale enum member for EN");return t},j4=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return String(e)}},dl=e=>({componentId:e?.componentId??null,message:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("EN"):e?.message??String(e),zhMessage:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("ZH"):void 0,platform:e?.platform??null,isBackendError:!!e?.isBackendError,fullPath:j4(e?.fullPath??[])}),fl=e=>e.stableErrors.concat(e.betaErrors).filter(t=>!!t.isBackendError),rR=e=>fl(e).length,nR=(e,t)=>{if(t.__typename==="DiffItem"){let r=t.pathComponents?.at(-1)?.key??"";if(t.operation==="delete"){delete e[r];return}e[r]=structuredClone(t.newValue);return}if(t.__typename==="ArrayDiffItem"){let r=t.pathComponents?.at(-1)?.index??-1;if(!Array.isArray(e)||r<0)throw new Error("Invalid array diff target");if(t.operation==="delete"){e.splice(r,1);return}if(t.operation==="insert"){e.splice(r,0,structuredClone(t.newValue));return}e[r]=structuredClone(t.newValue)}};p();var iR=Ge(Uo(),1);import{createRequire as M4}from"module";var F4=M4(import.meta.url);var hl=e=>{if(qr){if(e==="@functorz/ztype")return qr.ztype;if(e==="@functorz/crdt-helper")return qr.crdtHelper;if(e==="json-joy")return qr.jsonJoy}try{let t=F4(`${e}/package.json`);return t.ztypeBuild??t.version??"unknown"}catch{return"unavailable"}},q4=async()=>{if(qr)return{ztypeVersion:qr.ztype,ztypeSchemaVersion:qr.ztypeSchemaVersion};try{let e=await xt();return{ztypeVersion:hl("@functorz/ztype"),ztypeSchemaVersion:e?.ZTypeSystem?.getSchemaVersion?.()??"unknown"}}catch{return{ztypeVersion:hl("@functorz/ztype"),ztypeSchemaVersion:"unavailable"}}};async function my(){let e=uv(),t=await q4();return{agentVersion:e.version??"0.0.0",nodeMajor:process.versions.node.split(".")[0],platform:process.platform,arch:process.arch,ztypeVersion:t.ztypeVersion,ztypeSchemaVersion:t.ztypeSchemaVersion,crdtHelperVersion:hl("@functorz/crdt-helper"),jsonJoyVersion:hl("json-joy")}}async function mo(e,t){let[r,n,i]=await Promise.all([my(),yr(e),e.loadCredentials()]),o=i?iR.default.decode(i.access_token):null,s=typeof o=="object"&&o!==null?String(o.sub??o.exId??o.id??"authenticated"):"anonymous";return{...r,product:X,apiBaseUrl:n.apiBaseUrl,authUserId:s,workspaceRoot:e.getWorkspaceRoot(),startupFlags:[...t].sort()}}function oR(e,t){return JSON.stringify(e)===JSON.stringify(t)}p();var ni=async(e,t)=>{let n=(await e.request(Mc,{projectExId:t,appExId:null})).fetchAppDetailByExId;return((n?.__typename==="Project"?n.appList:null)??[]).filter(o=>o.appExId!=null)},go=e=>e.length===1?e[0].appExId:null;var yy=U4(),aR=`${X}/${En()}`,V4=e=>{if(!e)return e;if(Array.isArray(e))return e.map(([r,n])=>[r,String(r).toLowerCase()==="authorization"?"Bearer <redacted>":n]);if(typeof e=="object"&&"forEach"in e&&typeof e.forEach=="function"){let r={};return e.forEach((n,i)=>{r[i]=i.toLowerCase()==="authorization"?"Bearer <redacted>":String(n)}),r}let t={};for(let[r,n]of Object.entries(e))t[r]=r.toLowerCase()==="authorization"?"Bearer <redacted>":String(n);return t};function vy(e){if(!Array.isArray(e)||e.length===0)return null;let t=e.map(r=>{let n=r,i=typeof n.operation=="string"?n.operation:null,o=typeof n.errorType=="string"?n.errorType:typeof n.extensions?.classification=="string"?n.extensions.classification:null,s=typeof n.message=="string"?n.message:null;return!s&&!i&&!o?null:`${i?`${i}: `:""}${s??"GraphQL error"}${o?` (${o})`:""}`}).filter(r=>!!r);return t.length>0?t.join("; "):null}var G4=e=>{if(typeof e=="string")return e;if(e instanceof Uint8Array)return Buffer.from(e).toString("utf8");try{return String(e)}catch{return"<unserializable body>"}},B4=new Set(["ECONNRESET","EPIPE","UND_ERR_SOCKET"]),$4=e=>{let t=e?.cause?.code;return typeof t=="string"&&B4.has(t)},K4=e=>{if(typeof e!="string")return!1;try{let{query:t,operationName:r}=JSON.parse(e);return typeof t!="string"?!1:(0,ml.getOperationAST)((0,ml.parse)(t),typeof r=="string"?r:void 0)?.operation==="query"}catch{return!1}},yo=async(e,t)=>{let r=Wl();C.debug(`[HTTP] Request URL: ${e.toString()}`),t?.headers&&C.debug(`[HTTP] Request Headers: ${JSON.stringify(V4(t.headers))}`),r&&t?.body!=null&&C.debug(`[GQL] Request Body: ${G4(t.body)}`);let n=await fetch(e,t).catch(o=>{if(!$4(o)||!K4(t?.body))throw o;return C.info(`[HTTP] Connection reset; resending the query to ${e.toString()}`),fetch(e,t)}),i=null;try{i=await n.clone().text()}catch(o){C.debug(`[GQL] Response read failed: ${String(o)}`)}if(r&&C.debug(`[GQL] Response ${n.status}: ${i??"<read failed>"}`),i&&i.includes('"errors"')){let o=null;try{o=JSON.parse(i).errors}catch{o=null}let s=vy(o);s&&C.warn(`[GQL] ${n.status} errors: ${s}`)}return n};async function Ey(e,t){let r=await e.getValidToken(),n=await yr(t),i={Authorization:`Bearer ${r}`,"User-Locale":"en_US","X-SESSION-ID":yy,"X-Client":aR},o=await ZN();return o&&(i["X-ZED-VERSION"]=o),process.env.REACT_APP_VERSION&&(i["X-REACT-APP-VERSION"]=process.env.REACT_APP_VERSION),new Ze(`${n.apiBaseUrl}/api/graphql`,{headers:i,fetch:yo})}var gy=class extends KN{constructor(...t){super(...t),this.on("error",r=>C.debug(`[SUB] socket error: ${r.message}`))}};async function uR(e,t){let r=await e.getValidToken(),i=`${(await yr(t)).apiBaseUrl.replace(/^http:/,"ws:").replace(/^https:/,"wss:")}/api/graphql-subscription`;return async(o,s,a)=>{let u=Wl(),c={authToken:r,"X-SESSION-ID":yy,"X-Client":aR};C.debug(`[SUB] connecting ${i} params=${JSON.stringify({...c,authToken:"Bearer <redacted>"})}`);let l=new sR.SubscriptionClient(i,{lazy:!0,reconnect:!0,minTimeout:3e3,connectionParams:c},gy);l.onConnected(()=>C.debug("[SUB] connected")),l.onReconnected(()=>C.debug("[SUB] reconnected")),l.onDisconnected(()=>C.debug("[SUB] disconnected")),l.onError(h=>C.debug(`[SUB] error ${h?.message??String(h)}`));let f=[{name:"onNewCrdtPatchV2",query:W0,variables:{projectExId:o.projectExId,appExId:o.appExId??null,versionExId:o.appVersionExId??null,latestPatchExIdInClient:s}},{name:"onSchemaUploadV3",query:z0,variables:{projectExId:o.projectExId,appExId:o.appExId??null,appVersionExId:o.appVersionExId??null}}].map(h=>(C.debug(`[SUB] subscribe ${h.name} vars=${JSON.stringify(h.variables)}`),l.request({query:h.query,variables:h.variables}).subscribe({next:g=>{u&&C.debug(`[SUB] ${h.name} event: ${JSON.stringify(g)}`),a()},error:g=>{C.warn("Schema subscription event failed",String(g)),a()}})));return{unsubscribe(){for(let h of f)h.unsubscribe();l.close(!1,!1)}}}}async function cR(e,t,r){let n=await e.loadProjectContext();if(t.projectExId)return n?.projectExId!==t.projectExId&&await e.saveProjectContext(t.projectExId,r?go(await ni(r,t.projectExId)):null),t.projectExId;if(!n?.projectExId)throw new Error("No projectExId provided and no current project is set");return n.projectExId}async function _y(e,t,r,n){try{await e.request(lA,{projectExId:t,client:X,clientVersion:En(),sessionId:n??yy,agent:r??null}),C.debug(`[agent-session] started for project ${t}`)}catch(i){C.debug(`[agent-session] skipped: ${String(i)}`)}}p();p();p();import{createHash as H4}from"crypto";var Q4=e=>!!(e&&typeof e=="object"&&!Array.isArray(e)),by=e=>{if(Array.isArray(e))return e.map(r=>r===void 0?null:by(r));if(!Q4(e))return e;let t={};for(let r of Object.keys(e).sort()){let n=e[r];n!==void 0&&(t[r]=by(n))}return t},W4=e=>JSON.stringify(by(e)),z4=e=>H4("sha256").update(W4(e)).digest("hex"),lR=e=>({projectExId:e.projectExId,appExId:e.appExId??null,appVersionExId:e.appVersionExId??null,schemaExId:e.schemaExId??null,lastPatchExId:e.lastPatchExId??null,snapshotHash:z4(e.snapshot),deployedSchemaExId:e.deployedSchemaExId??null,checkedAt:e.checkedAt??new Date().toISOString()}),pR=(e,t)=>!e||!t?e!==t:e.schemaExId!==t.schemaExId||e.lastPatchExId!==t.lastPatchExId||e.snapshotHash!==t.snapshotHash||e.deployedSchemaExId!==t.deployedSchemaExId,gl=e=>e.changes.length>0;var dR=null,Y4=()=>(dR??=xt().then(e=>{let t=e?.typesystem?.schema?.diff?.computeSemanticSchemaChanges;return typeof t=="function"?t:null}),dR),J4=async(e,t)=>{let r=await Y4();return r?r(e,t):{changes:[]}},Sy=(e,t)=>J4(JSON.stringify(e),JSON.stringify(t));p();var X4="Functorz";function fR(e,t,r,n){let i=e?.typesystem?.settings,o=e?.typesystem?.schema,s=t?.KtList,a=t?.KtMap;if(!i?.ExtraContext||!o?.CustomChatModelDescriptor||!o?.AIModelDescriptors||!s||!a)return C.warn("ztype ExtraContext symbols missing; schema graph will be built without custom models"),null;try{let{ExtraContext:u}=i,{AIModelDescriptors:c,CustomChatModelDescriptor:l,CustomEmbeddingModelDescriptor:d,ModelCustomParamDescriptor:f,CustomModelParam:h,CustomChatCompletionFeatures:g,Identifier:v,MediaOutputCardinality:_}=o,S=N=>a.fromJsMap(new Map(Object.entries(N??{}))),b=N=>typeof N=="string"?N==="single"?_.SINGLE:N==="multiple"?_.MULTIPLE:_.NONE:typeof N=="boolean"&&N?_.MULTIPLE:_.NONE,A=N=>new f(N.name,S(N.displayName),N.type,S(N.description)),w=N=>new h(A(N.serverUrl),A(N.apiToken),s.fromJsArray((N.extensionParams??[]).map(te=>new f(te.name,S(te.displayName),te.type,S(te.displayName))))),T=N=>N.provider===X4&&N.customModelIdentifier?new v(N.customModelIdentifier.id,N.customModelIdentifier.namespace):null,x=(r?.chatModelDescriptors??[]).map(N=>new l(N.provider,N.name,w(N.paramToConfigure),N.delisted,new g(N.features.streamResponse,N.features.multiModal,N.features.imageInput??!1,!1,N.features.videoInput??!1,N.features.imageMessageInput??!1,!1,N.features.videoMessageInput??!1,N.features.tools,N.features.reasoningContent,N.features.imageOutput,N.features.videoOutput,b(N.features.imageOutput),b(N.features.videoOutput),null,N.features.structuredOutput),T(N))),U=(r?.embeddingModelDescriptors??[]).map(N=>new d(N.provider,N.name,w(N.paramToConfigure),T(N),N.delisted));return new u(new c(s.fromJsArray(x),s.fromJsArray(U)),a.fromJsMap(new Map),n)}catch(u){return C.warn("ztype ExtraContext construction failed; schema graph will be built without custom models",u.message),null}}p();var fn=class extends Error{constructor(r,n){super(r);this.diagnostics=n;this.name="ZtypeValidationError"}};p();function yl(e,t,r,n=null){let i=hy(e,r?.appType);return e.api.ZTypeCoreApi.genZTypeApiContext(t,ho(e),i,fy(r,i),tR(e),n)}function hR(e,t){return fy(t,hy(e,t?.appType))}p();var hn=e=>e==null,Ty=(e,t)=>{if(hn(e)&&hn(t)||e===t)return!0;if(hn(e)||hn(t)||typeof e!="object"||typeof t!="object")return!1;let r=e,n=t,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let o of i)if(!Ty(r[o],n[o]))return!1;return!0};var Iy=e=>{let t=new Set;for(let r of e)if(t.add(r.pathComponents.map(n=>n.index!==void 0?`[${n.index}]`:`.${n.key}`).join("").replace(/^\./,"")),t.size>=20)break;return[...t]},mR=e=>{if(e.__typename==="DiffItem")switch(e.operation){case"add":return{__typename:"DiffItem",oldValue:e.newValue,newValue:null,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"DiffItem",oldValue:null,newValue:e.oldValue,operation:"add",pathComponents:e.pathComponents};case"update":return{__typename:"DiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}else switch(e.operation){case"insert":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:null,previousValue:e.previousValue,nextValue:e.nextValue,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"ArrayDiffItem",oldValue:null,newValue:e.oldValue,previousValue:e.previousValue,nextValue:e.nextValue,operation:"insert",pathComponents:e.pathComponents};case"update":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}throw new Error(`Cannot reverse diff item: ${JSON.stringify(e)}`)},Z4=e=>e.key??e.index??"",e5=(e,t)=>{let r=e;for(let n of t){if(r===null||typeof r!="object")return;r=r[n]}return r},t5=(e,t)=>{if(t.__typename!=="DiffItem")return null;let r=t.pathComponents.at(-1)?.key;if(r===void 0)return null;let n=Ty(e[r],t.oldValue);switch(t.operation){case"add":e[r]=t.newValue;break;case"update":if(!n)return null;e[r]=t.newValue;break;case"delete":if(!Object.prototype.hasOwnProperty.call(e,r)||!n)return null;delete e[r];break;default:return null}return t},r5=(e,t)=>{if(t.__typename!=="ArrayDiffItem")return null;let r=t.pathComponents.at(-1)?.index;if(r===void 0||r>e.length)return null;let n=()=>Ty(e[r],t.oldValue);switch(t.operation){case"insert":e.splice(r,0,t.newValue);break;case"delete":if(!n())return null;e.splice(r,1);break;case"update":if(!n())return null;e.splice(r,1,t.newValue);break;default:return null}return t},gR=(e,t)=>{let r=e,n=new WeakSet,i=s=>{if(r===null||typeof r!="object")return r;n.has(r)||(r=Array.isArray(r)?[...r]:{...r},n.add(r));let a=r;for(let u of s){let c=a[u];if(c!==null&&typeof c=="object"){if(!n.has(c)){let l=Array.isArray(c)?[...c]:{...c};n.add(l),a[u]=l}a=a[u]}else a=c}return a},o=[];for(let s of t)try{let u=s.pathComponents.map(Z4).slice(0,-1);if(hn(e5(r,u)))continue;let c=i(u);if(Array.isArray(c)){let l=r5(c,s);l&&o.push(l)}else if(c!==null&&typeof c=="object"){let l=t5(c,s);l&&o.push(l)}}catch{continue}return o};p();var n5=3e4,vl=class{constructor(t){this.options=t}timer=null;subscriptionHandle=null;running=!1;isActive(){return this.timer!==null||this.subscriptionHandle!==null}start(){this.timer||this.subscriptionHandle||!this.options.subscriptionFactory||this.options.subscriptionFactory(this.options.sessionKey,this.options.getLastPatchExId(),()=>{this.run()}).then(t=>{this.subscriptionHandle=t}).catch(t=>{C.warn("Schema subscription failed; falling back to polling",t.message)}).finally(()=>{this.schedulePoll()})}dispose(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.subscriptionHandle?.unsubscribe(),this.subscriptionHandle=null}schedulePoll(){!this.options.subscriptionFactory||this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.run().finally(()=>this.schedulePoll())},n5),this.timer.unref())}async run(){if(!this.running){this.running=!0;try{await this.options.refresh()}finally{this.running=!1}}}};p();var yR=(e,t)=>{let r=new WeakMap,n=s=>{let a=r.get(s);return a||(a=Array.isArray(s)?[...s]:{...s},r.set(s,a)),a},i=new WeakMap,o=n(e);for(let s of t){let a=(s?.pathComponents??[]).slice(0,-1),u=e,c=o;for(let l of a){let d=l.key??l.index??"",f=u[d];if(f===null||typeof f!="object")break;if(Array.isArray(f)){let h=i.get(f);h||(h=structuredClone(f),i.set(f,h)),c[d]=h;break}c[d]=n(f),u=f,c=c[d]}}return o};p();p();var o5=new Set(["WEB","WECHAT_MINI_PROGRAM","MOBILE"]),vo=e=>o5.has(e?.appType??""),ER=(e,t)=>{if(!t)return e;let r=t.model.view();return{...e,server:r?.server??null}},El=e=>e?.pathComponents?.[0]?.key==="server",_R=e=>e?.pathComponents?.[0]?.key==="clients",bR=e=>e?.appType==="BACKEND_ONLY",vR=e=>typeof e=="string"&&e.length>0?e:null,Oy=(e,t)=>{let r=e.serverDoc;if(r){let i=vR(r.schemaExId);return i?{ok:!0,appExId:null,schemaExId:i}:{ok:!1,error:"the backend app document has no schemaExId"}}if(e.serverDocRequired===!0)return{ok:!1,error:"this client app's server lives in the backend app's document, which did not load, so there is nothing to sync; retry, or run project sync-backend without appExId"};let n=vR(e.schemaExId);return n?{ok:!0,appExId:t,schemaExId:n}:{ok:!1,error:"the session has no schemaExId"}};p();var wy=null,SR=async e=>(wy??=e.request(H0).then(t=>(t.__type?.inputFields??[]).some(r=>r.name==="origin")).catch(()=>(wy=null,!1)),await wy?{origin:"MCP"}:{});p();function TR(e,t){let r=new Set;for(let n of e){let i=n&&typeof n=="object"?n.name:void 0;if(typeof i!="string")continue;let o=gv[i];o!==void 0&&!t.includes(o)&&r.add(i)}return[...r]}function IR(e){return`${e.join(", ")} ${e.length===1?"is":"are"} not available to this project yet: the feature is still being rolled out and has not been opened to this account or project. Nothing was applied. Do not retry or work around it; tell the user it is not available to them yet.`}var Ay=300*1e3,s5=100,a5=50,u5=["dataModel","types"];function c5(e){let t=e.server;if(!t||typeof t!="object"||Array.isArray(t))return e;let r={};for(let i of u5){let o=t[i];o!==void 0&&(r[i]=o)}let n={};return e.version!==void 0&&(n.version=e.version),n.server=r,n}function l5(e){if(typeof e!="string")return e;let t=e.trim();if(!/^[[{]|^(true|false|null|-?\d)/.test(t))return e;try{return JSON.parse(t)}catch{return e}}function p5(e){if(typeof e!="string")return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;let r={};for(let[n,i]of Object.entries(t))r[n]=l5(i);return r}function d5(e){let t=new Set;return e.map(r=>{if(!r||typeof r!="object")return r;let n=r,i=typeof n.toolCallId=="string"&&n.toolCallId?n.toolCallId:null;if(i!==null&&t.has(i))throw new Error(`Duplicate toolCallId: ${i}`);let o=i??ua();return t.add(o),i===o?n:{...n,toolCallId:o}})}function f5(e,t){if(!e)return;let r=new Map(Object.entries(e)),n=t.map((i,o)=>{if(!r.has(i))throw new Error(`Missing ztype response for tool call ${o}`);let s=r.get(i);return r.delete(i),s});if(r.size>0)throw new Error(`Unexpected ztype responses: ${[...r.keys()].join(", ")}`);return n}function h5(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?Object.values(t).find(n=>typeof n=="string")??t:t):[]}function m5(e){let t=e??{},r=t.data??{},n={},i=p5(r.responseByToolCallId??t.responseByToolCallId);i&&Object.keys(i).length>0&&(n.responses=i);let o=r.schemaDiff??t.schemaDiff;o&&(n.schemaDiff=o);let s=h5(t.errors??r.errors);return s.length>0&&(n.errors=s),n}function g5(e){let t=e??{},r=t.data?.updatedReadState;if(r!=null)return r;if(typeof t.updatedReadStateJson=="string")try{return JSON.parse(t.updatedReadStateJson)}catch{return}}function y5(e){return(e??{}).data?.touchesComponents===!0}function v5(e,t){let r=e??{};if(r.isSuccess!==!1)return{};let n={},i=typeof r.failedToolCallId=="string"?t.indexOf(r.failedToolCallId):-1;i>=0&&(n.failedIndex=i),typeof r.errorCode=="string"&&(n.errorCode=r.errorCode),r.failedBeforeExecution===!0&&(n.failedBeforeExecution=!0);let o=Array.isArray(r.detailKeys)?r.detailKeys:[],s=Array.isArray(r.detailValues)?r.detailValues:[];if(o.length>0&&o.length===s.length){let a={};o.forEach((u,c)=>{typeof u=="string"&&typeof s[c]=="string"&&(a[u]=s[c])}),Object.keys(a).length>0&&(n.errorDetails=a)}return n}async function E5(e){let r=(await xt())?.application?.schemaops?.SchemaOpsErrorCode?.DEPENDENCY_CONFLICT?.name,i=(e.diagnostics?.stableErrors??[]).map(o=>{let s=o??{};return[s.componentId,s.message].filter(a=>typeof a=="string"&&a!=="").join(": ")}).filter(o=>o!=="");return{applied:{applied:!1,reason:"ztype validation interrupted the batch"},errors:i.length>0?i:[e.message],...typeof r=="string"?{errorCode:r}:{},errorDetails:{dependents:i.join("; ")},ztypeDiagnostics:e.diagnostics}}function _5(e){return e?e.available===!1||(e.stableErrors?.length??0)>0||(e.betaErrors?.length??0)>0:!1}var ca=class e{constructor(t,r,n,i){this.client=t;this.sessionKey=r;this.onSchemaEvent=i;this.key=e.stringifyKey(r),this.watcher=new vl({sessionKey:r,subscriptionFactory:n,getLastPatchExId:()=>this.lastPatchExId,refresh:()=>this.runWatchRefresh()})}crdtBinary=null;model=null;serverDoc=null;schemaGraph=null;extraContext=null;extraContextLoaded=!1;enabledProjectFeatureNames=[];appDetail=null;snapshot=null;schemaExId=null;lastPatchExId=null;appliedPatchExIds=new Set;staleReason="not loaded";lastError=null;lastZtypeDiagnostics=null;diagnosedFor=null;lastRevision=null;events=[];undoStack=[];redoStack=[];projectCapabilitiesCache;watcher;loadedAt=0;lastUsedAt=Date.now();mutex=new pl;key;static stringifyKey(t){return[t.projectExId,t.appExId??"",t.appVersionExId??""].join(":")}isExpired(t=Date.now()){return t-this.lastUsedAt>Ay}currentView(){if(!this.model)throw new Error("CRDT model not loaded");return ER(this.model.view(),this.serverDoc)}lastPatchExIds(){return[this.lastPatchExId,this.serverDoc?.lastPatchExId??null].filter(t=>typeof t=="string")}serverSchemaExId(){return vo(this.appDetail)?this.serverDoc?.schemaExId??null:this.schemaExId}status(){return{key:this.key,projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null,appVersionExId:this.sessionKey.appVersionExId??null,schemaExId:this.schemaExId,lastPatchExId:this.lastPatchExId,serverDocRequired:vo(this.appDetail),serverDoc:this.serverDoc?{schemaExId:this.serverDoc.schemaExId,lastPatchExId:this.serverDoc.lastPatchExId}:null,loadedAt:this.loadedAt?new Date(this.loadedAt).toISOString():null,lastUsedAt:new Date(this.lastUsedAt).toISOString(),staleReason:this.staleReason,lastError:this.lastError,schemaRevision:this.lastRevision,ztypeDiagnostics:this.lastZtypeDiagnostics,crdtBinaryBytes:this.crdtBinary?.byteLength??null,hasCrdtModel:this.model!==null,hasZtypeGraph:this.schemaGraph!==null,schemaEventCount:this.events.length,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,watcherActive:this.watcher.isActive()}}state(){return{...this.status(),latestEvent:this.events.at(-1)??null}}listEvents(t,r=100){if(!t)return this.events.slice(-r);let n=this.events.findIndex(i=>i.id===t);return(n>=0?this.events.slice(n+1):this.events).slice(-r)}async checkRemoteAndSync(){return this.mutex.run(async()=>this.withErrorState(async()=>this.checkRemoteAndSyncLocked("remote")))}async load(t=!1){return this.mutex.run(async()=>this.withErrorState(()=>this.loadLocked(t)))}async sync(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),!this.schemaExId)return this.loadLocked();let t=await this.client.request(K0,{schemaExId:this.schemaExId}),r=t.crdtSchemaBySchemaExId?.crdtPatches?.patches??[];return await this.applyNetworkPatches(r),await this.syncServerDocLocked(),this.model&&(this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics()),this.lastPatchExId=t.crdtSchemaBySchemaExId?.crdtPatches?.lastPatchExId??this.lastPatchExId,this.updateRevision(),this.status()}))}getSnapshot(t=!1){if(this.touch(),this.model?.view&&(this.snapshot=this.currentView()),!this.snapshot)throw new Error("Project schema is not loaded");return t?this.snapshot:c5(this.snapshot)}dataModel(){let t=this.getSnapshot().server;return!t||typeof t!="object"?null:t.dataModel??null}async save(){return this.mutex.run(async()=>this.withErrorState(async()=>{this.touch();let t=await this.currentZtypeDiagnostics(),r=await this.client.request(Ym,{projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null,versionExId:this.sessionKey.appVersionExId??null});if(this.schemaExId=r.saveSchema,this.serverDoc){let n=await this.client.request(Ym,{projectExId:this.sessionKey.projectExId,appExId:null,versionExId:null});this.serverDoc.schemaExId=n.saveSchema}return this.updateRevision(),{...this.status(),ztypeDiagnostics:t}}))}async validate(){return this.mutex.run(async()=>this.withErrorState(async()=>(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.currentZtypeDiagnostics())))}async fetchProjectCapabilities(){try{let r=(await this.client.request(nA,{projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null})).fetchAppDetailByExId;if(!r)return null;let n="project"in r?r.project:r,i={};for(let o of n.capabilities??[])!o?.capability||!o.limit||(i[o.capability]=o.limit.unlimited?{unlimited:!0}:{unlimited:!1,amount:o.limit.amount??0});return Object.keys(i).length===0?null:i}catch(t){return C.warn("Could not load project capabilities for the schemaops gate",t.message),null}}async resolveProjectCapabilities(){if(this.projectCapabilitiesCache!==void 0)return this.projectCapabilitiesCache;let t=await this.fetchProjectCapabilities();return t!==null&&(this.projectCapabilitiesCache=t),t}async ztypeToolCalls(t,r=!1,n=null,i=!1,o=null){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),!this.schemaGraph)throw new Error("ztype runtime is unavailable; install @functorz/ztype in this package");let s=await xt(),a=s?.api;if(!a?.ZTypeCoreApi||!a?.ZTypeSchemaOpsApi)throw new Error("ztype SchemaOps API is unavailable");let u=o??await this.resolveProjectCapabilities(),c=u===null?this.schemaGraph:a.ZTypeCoreApi.withProjectCapabilities(this.schemaGraph,u),l=yl(s,c,this.appDetail,await this.getExtraContext(s)),d=TR(t,this.enabledProjectFeatureNames);if(d.length)throw new Error(IR(d));let f=d5(t),h=f.map(x=>x&&typeof x=="object"?x.toolCallId:void 0).filter(x=>typeof x=="string"),g=this.withProjectFeatures(a.ZTypeCoreApi,()=>a.ZTypeSchemaOpsApi.toolCalls(l,f,n??null)),v=m5(g),_=v5(g,h),S=s?.application?.schemaops?.SchemaOpsErrorCode?.CAPABILITY_LIMITED?.name;S!==void 0&&_.errorCode===S&&(this.projectCapabilitiesCache=void 0);let b=v.schemaDiff,A=f5(v.responses,h),w={},T=g5(g);if(T!=null&&(w.updatedReadState=T),A&&(w.responses=A),v.errors&&(w.errors=v.errors,Object.assign(w,_),w.applied={applied:!1,reason:"batch rejected by ztype"}),b&&r&&(w.schemaDiff=b),b)try{w.applied=await this.applySchemaDiffLocked(b,{skipValidation:i}),y5(g)&&(w.touchesComponents=!0)}catch(x){if(!(x instanceof fn))throw x;let U=await E5(x);return Object.assign(w,U,{errors:[...Array.isArray(w.errors)?w.errors:[],...U.errors]}),w}return await this.attachValidationErrorIfAny(w),w}))}async attachValidationErrorIfAny(t){let r=await this.currentZtypeDiagnostics();_5(r)&&(t.ztypeDiagnostics=r)}async undo(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.undoStack.length===0)return{...this.status(),undone:!1,reason:"nothing to undo"};let t=this.undoStack[this.undoStack.length-1],r=t.dataSource.map(mR).reverse(),n=await this.applyReversibleLocked(r);return n?(this.undoStack.pop(),this.redoStack.push(t),{...n,undone:!0,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,reverted:t.semanticChanges??void 0,revertedPaths:Iy(t.dataSource)}):{...this.status(),undone:!1,reason:"schema diverged since this change; undo no longer applies cleanly"}}))}async redo(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.redoStack.length===0)return{...this.status(),redone:!1,reason:"nothing to redo"};let t=this.redoStack[this.redoStack.length-1],r=await this.applyReversibleLocked(t.dataSource);return r?(this.redoStack.pop(),this.undoStack.push(t),{...r,redone:!0,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,reapplied:t.semanticChanges??void 0,reappliedPaths:Iy(t.dataSource)}):{...this.status(),redone:!1,reason:"schema diverged since this change; redo no longer applies cleanly"}}))}async applyReversibleLocked(t){if(!this.model)throw new Error("CRDT model not loaded");let r=this.currentView(),n=gR(r,t);if(n.length!==t.length)return null;let i=n.filter(o=>!(o.__typename==="DiffItem"&&hn(o.oldValue)&&hn(o.newValue)));return i.length===0?null:this.applySchemaDiffLocked({id:ua(),dataSource:i},{recordUndo:!1})}async recordUndoEntry(t,r,n){let i=await sa();if(!i?.generateDiff)return;let o=[];i.generateDiff({before:t,after:r,prefix:[],result:o}),o.length!==0&&(this.undoStack.push({id:ua(),dataSource:o,semanticChanges:n}),this.undoStack.length>a5&&this.undoStack.shift(),this.redoStack=[])}async loadLocked(t=!1){if(this.touch(),this.model&&!t&&!this.staleReason)return this.status();let n=(await this.client.request(Wn,this.sessionKey)).fetchAppDetailByExId;if(!n)throw new Error(`Project not found: ${this.sessionKey.projectExId}`);let i=aa(n);if(!i?.crdtModelUrl||!i.exId)throw new Error("Project has no uploaded CRDT schema");let o=await ly(i.crdtModelUrl);return this.crdtBinary=o,this.appliedPatchExIds.clear(),this.lastPatchExId=null,this.serverDoc=null,this.undoStack=[],this.redoStack=[],this.projectCapabilitiesCache=void 0,this.appDetail=n,await this.initializeRuntime(o,i.crdtPatches?.patches??[],n),this.schemaExId=i.exId,this.lastPatchExId=i.crdtPatches?.lastPatchExId??null,this.loadedAt=Date.now(),this.model&&this.schemaGraph?this.staleReason=!this.serverDoc&&vo(n)?"backend app document unavailable":null:this.model&&!this.schemaGraph&&(this.staleReason="ztype runtime unavailable"),this.updateRevision(),this.watcher.start(),this.status()}async applySchemaDiffLocked(t,r={}){if(Array.isArray(t.dataSource)&&t.dataSource.length===0)return{...this.status(),applied:!1,reason:"empty schema diff"};if(!this.serverDoc&&vo(this.appDetail)&&(t.dataSource??[]).some(El))throw new Error("This client app's server lives in the backend app's document, which is not loaded; refusing to write server changes into the client document. Run schema load again.");if(bR(this.appDetail)&&(t.dataSource??[]).some(_R))throw new Error("This session is on the project's own document, which holds the project's backend and no client, so pages and components written here would belong to nothing and never render. Pin the client they belong to with set_current_project (appExId), or pass appExId on this call; take it from `project metadata` -> apps[]. A project with no client app has nowhere to hold them at all.");let i=(r.recordUndo??process.env.MOMEN_MCP_UNDO!=="0")&&this.snapshot?yR(this.snapshot,t.dataSource??[]):null,o=this.currentRevision(),s=await xt(),a=s?.api?.ZTypeCoreApi,u=await sa();if(!a||!u?.executeCrdtNodeUpdateAndTransformDiff||!u.generateDiff)throw new Error("CRDT/ztype write runtime is unavailable");let c=yl(s,this.schemaGraph,this.appDetail,await this.getExtraContext(s)),l=this.withProjectFeatures(a,()=>a.batchUpdateSchemaGraph(c,[t]));if(l?.interruptErrors?.length>0){let g={available:!0,stableErrors:[...l.interruptErrors].map(dl),betaErrors:[]};if(r.skipValidation!==!0)throw new fn("ztype validation interrupted schema update",g)}if(!this.model)throw new Error("CRDT model not loaded");C.debug(`[Session] applying schemaDiff dataSource: ${JSON.stringify(t.dataSource).slice(0,4e3)}`);try{await this.uploadByDoc(u,t.dataSource??[],this.model)}catch(g){C.error(`[Session] CRDT apply/upload failed; reloading session to discard the diverged graph: ${g.message}`);let{undoStack:v,redoStack:_}=this;try{await this.loadLocked(!0),this.undoStack=v,this.redoStack=_}catch(S){C.error(`[Session] reload after the failed write failed too; unloading the session so the next command loads it again: ${S.message}`),this.model=null,this.snapshot=null,this.schemaGraph=null,this.schemaExId=null,this.diagnosedFor=null,this.staleReason="a write failed and the reload after it failed too"}throw g}this.schemaGraph=l.updatedGraph,this.snapshot=this.currentView();let d=await this.refreshZtypeDiagnostics(),f=this.updateRevision(),h=i&&o&&i.server!==this.snapshot.server?await Sy({version:i.version,server:i.server},{version:this.snapshot.version,server:this.snapshot.server}):null;return h&&gl(h)&&o&&f&&this.appendSchemaEvent("local",o,f,h),i&&await this.recordUndoEntry(i,this.snapshot,h&&gl(h)?h:null).catch(g=>C.warn(`[Session] the write landed but its undo entry could not be recorded: ${g.message}`)),{...this.status(),ztypeDiagnostics:d,backendErrorCount:rR(d),_schema:h&&gl(h)?{change:h}:void 0}}async uploadByDoc(t,r,n){let i=this.serverDoc,o=i?r.filter(El):[],s=i?r.filter(u=>!El(u)):r,a=i&&o.length>0&&s.length>0?eR(i.model.view()):null;if(i&&o.length>0)for(let u of await this.uploadDocPatch(t,o,i.model,null,i.schemaExId))i.appliedPatchExIds.add(u.exId),i.lastPatchExId=u.exId;if(s.length!==0)try{for(let u of await this.uploadDocPatch(t,s,n,this.sessionKey.appExId??null,this.schemaExId))this.appliedPatchExIds.add(u.exId),this.lastPatchExId=u.exId}catch(u){if(i&&a){let c=[];t.generateDiff({before:i.model.view(),after:a,prefix:[],result:c}),c.length>0&&await this.uploadDocPatch(t,c,i.model,null,i.schemaExId).catch(l=>{throw new Error(`The server half of this change was saved to the backend app's document, but the client half failed (${u.message}) and reverting the server half failed too (${l.message}). Those server changes are live without their client counterparts: read the schema again before retrying, or the retry applies them a second time.`)})}throw u}}async uploadDocPatch(t,r,n,i,o){let s=t.executeCrdtNodeUpdateAndTransformDiff(r,n,this.snapshot,nR),a=ua(),u=await SR(this.client);return(await this.client.request(Q0,{projectExId:this.sessionKey.projectExId,appExId:i,schemaExId:o,patches:[{content:{id:a,dataSource:s.diffsFromCrdt},patchBase64:s.patchBase64,uuid:a,...u}]})).batchCreateSchemaCrdtPatch??[]}async checkRemoteAndSyncLocked(t){if(!this.model||!this.schemaExId||!this.snapshot)return await this.loadLocked(),null;let r=this.currentRevision();if(!r)return null;let n={version:this.snapshot.version,server:this.snapshot.server},o=(await this.client.request(Wn,this.sessionKey)).fetchAppDetailByExId,s=aa(o);if(!s?.exId)return null;let a=s.crdtPatches?.lastPatchExId??null,u=s.exId,c=dy(o);if(!await this.syncServerDocLocked()&&u===this.schemaExId&&a===this.lastPatchExId&&c===this.lastRevision?.deployedSchemaExId)return this.appDetail=o??this.appDetail,this.updateRevision(),null;u!==this.schemaExId||!s.crdtModelUrl?await this.loadLocked(!0):(this.appDetail=o??this.appDetail,await this.applyNetworkPatches(s.crdtPatches?.patches??[]),this.model&&(this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics()),this.lastPatchExId=a,this.updateRevision());let d=this.currentRevision();if(!d||!pR(r,d))return null;let f=await Sy(n,{version:this.snapshot?.version,server:this.snapshot?.server});return this.appendSchemaEvent(t==="watch"?"remote":t,r,d,f),{type:"SCHEMA_STALE",message:"Project schema changed since this session last used it; session was refreshed before executing the command.",projectExId:this.sessionKey.projectExId,fromRevision:r,toRevision:d,semanticChanges:f,detectedAt:new Date().toISOString()}}currentRevision(){return this.lastRevision??this.updateRevision()}updateRevision(){return!this.snapshot&&!this.crdtBinary?(this.lastRevision=null,null):(this.lastRevision=lR({projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??this.appDetail?.appExId??null,appVersionExId:this.sessionKey.appVersionExId??null,schemaExId:this.schemaExId,lastPatchExId:this.lastPatchExId,snapshot:this.snapshot??{binaryBytes:this.crdtBinary?.byteLength??null},deployedSchemaExId:dy(this.appDetail)}),this.lastRevision)}appendSchemaEvent(t,r,n,i){let o={id:ua(),type:"SCHEMA_CHANGED",source:t,projectExId:this.sessionKey.projectExId,fromRevision:r,toRevision:n,semanticChanges:i,detectedAt:new Date().toISOString()};this.events.push(o),this.events=this.events.slice(-s5),this.onSchemaEvent?.(o)}async runWatchRefresh(){let t=this.lastUsedAt;try{await this.mutex.run(async()=>{await this.withErrorState(async()=>this.checkRemoteAndSyncLocked("watch"))})}catch(r){C.warn("Schema watch refresh failed",r.message)}finally{this.lastUsedAt=t}}dispose(){this.watcher.dispose()}async initializeRuntime(t,r,n){let i=await sa();if(!i?.initModelByBinary){this.model=null,this.snapshot={binaryBytes:t.length,patches:r},this.schemaGraph=null,this.diagnosedFor=null,this.appDetail=n,this.staleReason="CRDT runtime unavailable";return}this.model=i.initModelByBinary(t),await this.applyNetworkPatches(r),this.model&&(vo(n)&&(this.serverDoc=await this.loadServerDoc(i).catch(o=>(C.warn("Backend app document unavailable; loading this client app's own document alone",o.message),null))),this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics())}async applyNetworkPatches(t){let r=t.filter(i=>!!(i?.exId&&!this.appliedPatchExIds.has(i.exId)));if(!this.model||r.length===0)return;let n=await py();if(!n?.fromBinary)throw new Error("json-joy Patch runtime is unavailable");this.model.applyBatch(r.map(i=>n.fromBinary(Buffer.from(i.patchBase64,"base64"))));for(let i of r)this.appliedPatchExIds.add(i.exId),this.lastPatchExId=i.exId;this.snapshot=this.currentView()}async loadServerDoc(t){let r=await this.client.request(Wn,{projectExId:this.sessionKey.projectExId}),n=aa(r.fetchAppDetailByExId);if(!n?.crdtModelUrl||!n.exId||!t.initModelByBinary)throw new Error("Could not load the backend app's document this client app's server half lives in");let i={model:t.initModelByBinary(await ly(n.crdtModelUrl)),schemaExId:n.exId,lastPatchExId:null,appliedPatchExIds:new Set};return await this.applyServerPatches(i,n.crdtPatches?.patches??[]),i.lastPatchExId=n.crdtPatches?.lastPatchExId??i.lastPatchExId,i}async applyServerPatches(t,r){let n=r.filter(o=>!!(o?.exId&&!t.appliedPatchExIds.has(o.exId)));if(n.length===0)return!1;let i=await py();if(!i?.fromBinary)throw new Error("json-joy Patch runtime is unavailable");t.model.applyBatch(n.map(o=>i.fromBinary(Buffer.from(o.patchBase64,"base64"))));for(let o of n)t.appliedPatchExIds.add(o.exId),t.lastPatchExId=o.exId;return!0}async syncServerDocLocked(){let t=this.serverDoc;if(!t)return!1;let r=await this.client.request(Wn,{projectExId:this.sessionKey.projectExId}),n=aa(r.fetchAppDetailByExId);if(!n?.exId)return!1;let i=n.crdtPatches?.lastPatchExId??null;return n.exId===t.schemaExId&&i===t.lastPatchExId?!1:n.exId!==t.schemaExId?(this.serverDoc=await this.loadServerDoc(await sa()),!0):(await this.applyServerPatches(t,n.crdtPatches?.patches??[]),t.lastPatchExId=i,!0)}async resolveZtypeGraph(){let t=await xt(),r=t?.api;if(!r?.ZTypeCoreApi||!this.snapshot){this.schemaGraph=null,this.diagnosedFor=null,this.staleReason="ztype runtime unavailable";return}let n=r.ZTypeCoreApi.parseZSchemaFromJsObject(this.snapshot),i=await this.getExtraContext(t);this.schemaGraph=this.withProjectFeatures(r.ZTypeCoreApi,()=>r.ZTypeCoreApi.resolveZSchemaToSchemaGraph(n,i))}withProjectFeatures(t,r){return t.withEnabledFeatures(this.enabledProjectFeatureNames,r)}async getExtraContext(t){if(this.extraContextLoaded)return this.extraContext;this.extraContextLoaded=!0;try{let[r,n,i]=await Promise.all([XN(),this.client.request(iA).then(o=>o.supportedCustomModelDescriptor??null).catch(o=>(C.warn("extraContext: model descriptors unavailable",o.message),null)),this.client.request(q0,{projectExId:this.sessionKey.projectExId}).then(o=>(o.features??[]).filter(s=>s.enabled).map(s=>s.featureName)).catch(o=>(C.warn("extraContext: project features unavailable; ztype runs with every feature off",o.message),[]))]);this.enabledProjectFeatureNames=i,this.extraContext=fR(t,r,n,ho(t))}catch(r){C.warn("extraContext build failed; resolving schema without it",r.message),this.extraContext=null}return this.extraContext}diagnosticsInputs(){return{graph:this.schemaGraph,target:`${this.appDetail?.appType??""}:${this.appDetail?.appExId??""}`,extraContext:this.extraContext,featureNames:this.enabledProjectFeatureNames}}async currentZtypeDiagnostics(){let t=this.diagnosedFor,r=this.diagnosticsInputs();return this.lastZtypeDiagnostics&&t&&Object.keys(r).every(n=>t[n]===r[n])?this.lastZtypeDiagnostics:this.refreshZtypeDiagnostics()}async refreshZtypeDiagnostics(){if(this.diagnosedFor=null,this.lastZtypeDiagnostics=null,!this.schemaGraph||!this.appDetail)return this.lastZtypeDiagnostics={available:!1,stableErrors:[],betaErrors:[],error:this.staleReason??"ztype schema graph is not loaded"},this.lastZtypeDiagnostics;let t=await xt(),r=t?.api;if(!r?.ZTypeCoreApi||!r?.ZTypeValidationApi)return this.lastZtypeDiagnostics={available:!1,stableErrors:[],betaErrors:[],error:"ztype validation API is unavailable"},this.lastZtypeDiagnostics;let n=yl(t,this.schemaGraph,this.appDetail,await this.getExtraContext(t)),i=this.withProjectFeatures(r.ZTypeCoreApi,()=>r.ZTypeValidationApi.validateSchemaGraph(n,hR(t,this.appDetail)));return this.lastZtypeDiagnostics={available:!0,stableErrors:[...i?.errors??i?.stableErrors??[]].map(dl),betaErrors:[...i?.warnings??i?.betaErrors??[]].map(dl)},this.diagnosedFor=this.diagnosticsInputs(),this.lastZtypeDiagnostics}touch(){this.lastUsedAt=Date.now()}async withErrorState(t){try{let r=await t();return this.lastError=null,r}catch(r){throw this.lastError=r instanceof Error?r.message:String(r),r}}};var _l=class{constructor(t,r){this.clientFactory=t;this.subscriptionFactory=r}sessions=new Map;emitter=new b5;clear(){for(let t of this.sessions.values())t.dispose();this.sessions.clear()}sweep(){let t=Date.now();for(let[r,n]of this.sessions.entries())n.isExpired(t)&&(n.dispose(),this.sessions.delete(r))}status(){return this.sweep(),{projectSessionIdleTtlMs:Ay,sessions:[...this.sessions.values()].map(t=>t.status())}}async load(t,r=!1){return(await this.getSession(t)).load(r)}async sync(t){return(await this.getSession(t)).sync()}async snapshot(t,r=!1){return(await this.getSession(t)).getSnapshot(r)}async dataModel(t){return(await this.getSession(t)).dataModel()}async save(t){return(await this.getSession(t)).save()}async validate(t){return(await this.getSession(t)).validate()}async ztypeToolCalls(t,r,n=!1,i=null,o=!1,s=null){return(await this.getSession(t)).ztypeToolCalls(r,n,i,o,s)}async serverSchemaExId(t){let r=await this.getSession(t);return await r.load(!1),r.serverSchemaExId()}async lastPatchExIds(t){let r=await this.getSession(t);return await r.load(!1),await r.checkRemoteAndSync(),r.lastPatchExIds()}async undo(t){return(await this.getSession(t)).undo()}async redo(t){return(await this.getSession(t)).redo()}async checkRemoteAndSync(t){return(await this.getSession(t)).checkRemoteAndSync()}schemaState(t){this.sweep();let r=[...this.sessions.values()].filter(n=>!t||n.status().projectExId===t);return{projectExId:t??null,sessions:r.map(n=>n.state())}}schemaEvents(t,r,n=100){this.sweep();let i=[...this.sessions.values()].filter(o=>!t||o.status().projectExId===t);return{projectExId:t??null,events:i.flatMap(o=>o.listEvents(r,n))}}async getSession(t){this.sweep();let r=ca.stringifyKey(t),n=this.sessions.get(r);if(n)return n;let i=new ca(await this.clientFactory(),t,this.subscriptionFactory,o=>{this.emitter.emit("schemaChanged",o)});return this.sessions.set(r,i),i}};function nr(e,t){return{projectExId:e,appExId:t.appExId??null,appVersionExId:t.appVersionExId??null}}p();var OR=e=>e??{},H=e=>typeof e=="string"&&e.length>0?e:void 0,le=e=>typeof e=="string"&&e.length>0?e:null,Ve=(e,t=!1)=>typeof e=="boolean"?e:t,Ye=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,ii=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0,Fe=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},oi=(e,t)=>{let r=H(e);if(!r)throw new Error(`${t} is required`);return r},Nt=(e,t)=>{if(!t)return e;if(e&&typeof e=="object"&&!Array.isArray(e)){let r=e,n=Fe(r._schema);return{...r,_schema:{...n,warning:t}}}return{result:e,_schema:{warning:t}}},S5=e=>new Promise(t=>{setTimeout(t,e)}),bl=e=>{let t=e?.name;if(typeof t!="string"||t.length===0)return null;let r=typeof e?.type=="string"?e.type:"";return/IMAGE|VIDEO|FILE/.test(r)?r.includes("LIST")?`${t}_ids`:`${t}_id`:t},wR=(e,t)=>{let n=e?.tableMetadata?.find(i=>i?.name===t)?.columnMetadata?.map(i=>bl(i))?.filter(i=>i!==null);return n?.length?n.slice(0,20):["id"]},T5=/token|secret|password|privatekey|merchantkey|mchkey|apikey/i,xy=e=>{if(Array.isArray(e))return e.map(xy);if(!e||typeof e!="object")return e;let t={};for(let[r,n]of Object.entries(e))t[r]=T5.test(r)?"<redacted>":xy(n);return t},Ny=(e,t)=>Ve(t.includeSecrets,!1)?e:xy(e),Ry=async(e,t,r)=>{let n={projectExId:H(t.projectExId),appExId:le(t.appExId),appVersionExId:le(t.appVersionExId)},i="appExId"in t,o=await cR(e,n,r);if(!i){let s=await e.loadProjectContext();n.appExId=s?.projectExId===o?s.appExId??null:null}if(n.appExId!==null&&n.appExId===o)throw new Error(`appExId was given the project exId (${o}). appExId names a client app inside the project, never the project itself: pass appExId: null to address the project's own document (its backend alone), or take an app exId from \`project metadata\` -> apps[] whose appExId is non-null.`);return{...n,projectExId:o}},AR=async(e,t)=>{let r=H(t.organizationExId),n=H(t.projectSpaceType);if(r&&n)return{organizationExId:r,projectSpaceType:n};let o=(await e.request(jc))?.user,s=o?.currentOrganization??o?.organization??o?.organizations?.[0]??o?.joinedOrganizations?.[0];if(!s?.exId)throw new Error("No default organization found; pass organizationExId and projectSpaceType");return{organizationExId:r??s.exId,projectSpaceType:n??"PERSONAL"}},I5=async(e,t)=>((await e.request(kc,{projectName:t,paginator:{first:20}}))?.fuzzySearchProjectName?.edges??[]).find(o=>o?.node?.projectName===t)?.node??null,xR=async(e,t,r)=>{let n=Date.now()+r;for(;Date.now()<n;){let i=await I5(e,t);if(i)return i;await S5(2e3)}return null},NR=(e,t,r,n=!0)=>{if(H(t.confirmProjectExId)!==e&&!(n&&Ve(t.force,!1)))throw new Error(`${r} is destructive; pass confirmProjectExId=${e}`+(n?" or force=true":""))},O5=e=>e.replace(/\/api\/graphql-v2(\/?)$/,"/api/graphql-admin$1"),Eo=async(e,t)=>{let n=(await e.request($0,{projectExId:t.projectExId,appVersionExId:t.appVersionExId}))?.fetchAppDetailByExIdWithoutReconcile,i=n?.__typename==="Project"?n:null;if(!i?.adminToken)throw new Error(`Runtime commands need the project admin token, which only project editors get; none was returned for project ${t.projectExId}`);let o=i.zeroUrl??Rt().zeroApiUrlTemplate.replace("{projectExId}",t.projectExId),s={authorization:`Bearer ${i.adminToken}`};return{adminToken:i.adminToken,zeroUrl:o,dataClient:new Ze(o,{headers:s,fetch:yo}),adminClient:new Ze(i.adminZeroUrl??O5(o),{headers:s,fetch:yo})}};p();p();import{promises as w5}from"fs";import A5 from"path";var x5=async(e,t)=>{let r=H(e.cwd);if(!r)throw new Error("cwd is required");let n=A5.resolve(r);if(!(await w5.stat(n)).isDirectory())throw new Error(`Path is not a directory: ${n}`);return t.credentialStore.setWorkspaceRoot(n),t.schemaManager.clear(),t.ok({cwd:n},`Current working directory set to ${n}`)},RR={"workspace.set":x5};p();var MR=Ge(Uo(),1);p();import{createServer as CR}from"http";import N5 from"open";var la=class{config;constructor(t){this.config=t}async findAvailablePort(t){let r=t||this.config.callbackPort||8088;return new Promise((n,i)=>{let o=CR();o.on("error",s=>{s.code==="EADDRINUSE"?n(this.findAvailablePort(r+1)):i(s)}),o.listen(r,()=>{let s=o.address(),a=typeof s=="object"&&s!==null?s.port:r;o.close(()=>n(a))})})}async authenticate(){let t=await this.findAvailablePort(),r=`http://localhost:${t}/callback`;C.info(`[JwtAuth] Using callback URL: ${r}`),C.info("[JwtAuth] Opening browser for authentication...");let n=await new Promise((i,o)=>{let s=null,a=!1,u=CR(async(c,l)=>{if(!c.url)return;let d=new URL(c.url,`http://localhost:${t}`);if(d.pathname==="/callback"){C.info(`[JwtAuth] Callback received: ${c.url}`);let f=d.searchParams.get("token");if(!f||f.trim()===""){C.info("[JwtAuth] No token parameter found in callback URL"),C.info("[JwtAuth] Available parameters:",Array.from(d.searchParams.keys()).join(", "));let g=this.errorPage("No authentication token received");l.writeHead(400,{"Content-Type":"text/html"}),l.end(g),a||(a=!0,s&&clearTimeout(s),u.close(),o(new Error("No token parameter in callback")));return}C.info(`[JwtAuth] Token received (length: ${f.length} chars)`);let h=this.successPage();l.writeHead(200,{"Content-Type":"text/html"}),l.end(h),setTimeout(()=>{a||(a=!0,s&&clearTimeout(s),u.close(),i(f))},1e3)}});u.on("error",c=>{a||(a=!0,s&&clearTimeout(s),o(c))}),u.listen(t,async()=>{let c=new URL(this.config.authEndpoint);c.searchParams.set("redirect_uri",r),C.info(`[JwtAuth] Opening: ${c.toString()}`);try{await N5(c.toString())}catch{C.info("[JwtAuth] Could not open browser automatically"),C.info("[JwtAuth] Please open this URL manually:"),C.info(c.toString())}}),s=setTimeout(()=>{a||(a=!0,u.close(),o(new Error("Authentication timeout - no response after 5 minutes")))},3e5)});return C.info("[JwtAuth] JWT token received successfully"),{access_token:n,token_type:"Bearer"}}renderPage(t){let r=t.autoClose?`
|
|
1282
|
+
`;p();var yl=qe(cn(),1);import{randomUUID as W4}from"crypto";var pR=qe(Kx(),1);p();var M4=qe(UN(),1),F4=qe(al(),1),q4=qe(uo(),1),U4=qe(ry(),1),V4=qe(oy(),1),G4=qe(py(),1),zN=qe(pl(),1),$4=qe(WN(),1);var YN=zN.default;p();var JN=100*1024*1024,fl=class{current=Promise.resolve();async run(t){let r=this.current,n=()=>{};this.current=new Promise(i=>{n=i}),await r;try{return await t()}finally{n()}}},fy=async e=>{let t=await fetch(e);if(!t.ok)throw new Error(`Failed to download CRDT model: ${t.status} ${t.statusText}`);let r=t.body?.getReader();if(!r)throw new Error("Failed to read CRDT model response body");let n=[],i=0;for(;;){let{done:a,value:u}=await r.read();if(a)break;if(i+=u.length,i>JN)throw new Error(`CRDT model is larger than ${JN} bytes`);n.push(u)}let o=new Uint8Array(i),s=0;for(let a of n)o.set(a,s),s+=a.length;return o},sa=async(e,t)=>{try{return await t()}catch(r){return C.warn(`Optional runtime package unavailable: ${e}`,r.message),null}},XN=null,xt=async()=>(XN??=sa("@functorz/ztype",()=>import("./ztype-3UJE3G55.js")).then(e=>(e?.default??e)?.com?.functorz?.ztype??null),XN),ZN=null,nR=async()=>(ZN??=sa("@functorz/ztype",()=>import("./ztype-3UJE3G55.js")).then(e=>(e?.default??e)?.kotlin?.collections??null),ZN),eR=null,iR=async()=>(eR??=xt().then(e=>e?.typesystem?.schema?.SCHEMA_VERSION??null),eR),tR=null,aa=async()=>(tR??=sa("@functorz/crdt-helper",()=>import("./index.cjs-Q3J34ILP.js")).then(e=>e?.Crdt??e?.default?.Crdt??null),tR),rR=null,hy=async()=>(rR??=sa("json-joy/lib/json-crdt-patch/index.js",()=>import("./json-crdt-patch-24M3UY2O.js")).then(e=>e??sa("json-joy/lib/json-crdt/index.js",()=>import("./json-crdt-QFFJIYYD.js"))).then(e=>e?.Patch??e?.default?.Patch??null),rR),ua=e=>e?.lastUploadedSchema??null,my=e=>[e?.project?.lastDeployedServerSchemaExId,e?.lastDeployedServerSchemaExId,e?.project?.latestDeployedServerSchema?.exId,e?.latestDeployedServerSchema?.exId].find(r=>typeof r=="string"&&r.length>0)??null,oR=e=>e==null?e:structuredClone(e),gy=(e,t)=>e?.appExId?e.appExId:t?.name??"",yy=(e,t)=>{let r=e?.typesystem?.schema?.ClientType;if(r)return t==="WECHAT_MINI_PROGRAM"?r.WECHAT_MINI_PROGRAM??r.WECHAT??r.WEB:t==="MOBILE"?r.MOBILE??r.WEB:r.WEB},mo=e=>{let t=e?.typesystem?.schema?.Product?.[bn];if(!t)throw new Error(`ztype runtime has no Product enum member for ${bn}`);return t},sR=e=>{let t=e?.typesystem?.schema?.Locale?.EN;if(!t)throw new Error("ztype runtime has no Locale enum member for EN");return t},B4=e=>{try{return JSON.parse(JSON.stringify(e))}catch{return String(e)}},hl=e=>({componentId:e?.componentId??null,message:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("EN"):e?.message??String(e),zhMessage:typeof e?.getLocalizedErrorMessage=="function"?e.getLocalizedErrorMessage("ZH"):void 0,platform:e?.platform??null,isBackendError:!!e?.isBackendError,fullPath:B4(e?.fullPath??[])}),ml=e=>e.stableErrors.concat(e.betaErrors).filter(t=>!!t.isBackendError),aR=e=>ml(e).length,uR=(e,t)=>{if(t.__typename==="DiffItem"){let r=t.pathComponents?.at(-1)?.key??"";if(t.operation==="delete"){delete e[r];return}e[r]=structuredClone(t.newValue);return}if(t.__typename==="ArrayDiffItem"){let r=t.pathComponents?.at(-1)?.index??-1;if(!Array.isArray(e)||r<0)throw new Error("Invalid array diff target");if(t.operation==="delete"){e.splice(r,1);return}if(t.operation==="insert"){e.splice(r,0,structuredClone(t.newValue));return}e[r]=structuredClone(t.newValue)}};p();var cR=qe(Vo(),1);import{createRequire as K4}from"module";var H4=K4(import.meta.url);var gl=e=>{if(qr){if(e==="@functorz/ztype")return qr.ztype;if(e==="@functorz/crdt-helper")return qr.crdtHelper;if(e==="json-joy")return qr.jsonJoy}try{let t=H4(`${e}/package.json`);return t.ztypeBuild??t.version??"unknown"}catch{return"unavailable"}},Q4=async()=>{if(qr)return{ztypeVersion:qr.ztype,ztypeSchemaVersion:qr.ztypeSchemaVersion};try{let e=await xt();return{ztypeVersion:gl("@functorz/ztype"),ztypeSchemaVersion:e?.ZTypeSystem?.getSchemaVersion?.()??"unknown"}}catch{return{ztypeVersion:gl("@functorz/ztype"),ztypeSchemaVersion:"unavailable"}}};async function vy(){let e=fv(),t=await Q4();return{agentVersion:e.version??"0.0.0",nodeMajor:process.versions.node.split(".")[0],platform:process.platform,arch:process.arch,ztypeVersion:t.ztypeVersion,ztypeSchemaVersion:t.ztypeSchemaVersion,crdtHelperVersion:gl("@functorz/crdt-helper"),jsonJoyVersion:gl("json-joy")}}async function go(e,t){let[r,n,i]=await Promise.all([vy(),yr(e),e.loadCredentials()]),o=i?cR.default.decode(i.access_token):null,s=typeof o=="object"&&o!==null?String(o.sub??o.exId??o.id??"authenticated"):"anonymous";return{...r,product:Y,apiBaseUrl:n.apiBaseUrl,authUserId:s,workspaceRoot:e.getWorkspaceRoot(),startupFlags:[...t].sort()}}function lR(e,t){return JSON.stringify(e)===JSON.stringify(t)}p();var ni=async(e,t)=>{let n=(await e.request(qc,{projectExId:t,appExId:null})).fetchAppDetailByExId;return((n?.__typename==="Project"?n.appList:null)??[]).filter(o=>o.appExId!=null)},yo=e=>e.length===1?e[0].appExId:null;var _y=W4(),dR=`${Y}/${_n()}`,z4=e=>{if(!e)return e;if(Array.isArray(e))return e.map(([r,n])=>[r,String(r).toLowerCase()==="authorization"?"Bearer <redacted>":n]);if(typeof e=="object"&&"forEach"in e&&typeof e.forEach=="function"){let r={};return e.forEach((n,i)=>{r[i]=i.toLowerCase()==="authorization"?"Bearer <redacted>":String(n)}),r}let t={};for(let[r,n]of Object.entries(e))t[r]=r.toLowerCase()==="authorization"?"Bearer <redacted>":String(n);return t},vl=(e,t)=>{let r=e?.response?.errors;return Array.isArray(r)&&r.some(n=>n?.errorType===t)};function by(e){if(!Array.isArray(e)||e.length===0)return null;let t=e.map(r=>{let n=r,i=typeof n.operation=="string"?n.operation:null,o=typeof n.errorType=="string"?n.errorType:typeof n.extensions?.classification=="string"?n.extensions.classification:null,s=typeof n.message=="string"?n.message:null;return!s&&!i&&!o?null:`${i?`${i}: `:""}${s??"GraphQL error"}${o?` (${o})`:""}`}).filter(r=>!!r);return t.length>0?t.join("; "):null}var Y4=e=>{if(typeof e=="string")return e;if(e instanceof Uint8Array)return Buffer.from(e).toString("utf8");try{return String(e)}catch{return"<unserializable body>"}},J4=new Set(["ECONNRESET","EPIPE","UND_ERR_SOCKET"]),X4=e=>{let t=e?.cause?.code;return typeof t=="string"&&J4.has(t)},Z4=e=>{if(typeof e!="string")return!1;try{let{query:t,operationName:r}=JSON.parse(e);return typeof t!="string"?!1:(0,yl.getOperationAST)((0,yl.parse)(t),typeof r=="string"?r:void 0)?.operation==="query"}catch{return!1}},vo=async(e,t)=>{let r=Jl();C.debug(`[HTTP] Request URL: ${e.toString()}`),t?.headers&&C.debug(`[HTTP] Request Headers: ${JSON.stringify(z4(t.headers))}`),r&&t?.body!=null&&C.debug(`[GQL] Request Body: ${Y4(t.body)}`);let n=await fetch(e,t).catch(o=>{if(!X4(o)||!Z4(t?.body))throw o;return C.info(`[HTTP] Connection reset; resending the query to ${e.toString()}`),fetch(e,t)}),i=null;try{i=await n.clone().text()}catch(o){C.debug(`[GQL] Response read failed: ${String(o)}`)}if(r&&C.debug(`[GQL] Response ${n.status}: ${i??"<read failed>"}`),i&&i.includes('"errors"')){let o=null;try{o=JSON.parse(i).errors}catch{o=null}let s=by(o);s&&C.warn(`[GQL] ${n.status} errors: ${s}`)}return n};async function Sy(e,t){let r=await yr(t),n={"User-Locale":"en_US","X-SESSION-ID":_y,"X-Client":dR},i=await iR();return i&&(n["X-ZED-VERSION"]=i),process.env.REACT_APP_VERSION&&(n["X-REACT-APP-VERSION"]=process.env.REACT_APP_VERSION),new Ze(`${r.apiBaseUrl}/api/graphql`,{headers:n,fetch:vo,requestMiddleware:async o=>{let s=new Headers(o.headers);return s.set("Authorization",`Bearer ${await e.getValidToken()}`),{...o,headers:s}}})}var Ey=class extends YN{constructor(...t){super(...t),this.on("error",r=>C.debug(`[SUB] socket error: ${r.message}`))}};async function fR(e,t){let n=`${(await yr(t)).apiBaseUrl.replace(/^http:/,"ws:").replace(/^https:/,"wss:")}/api/graphql-subscription`;return async(i,o,s)=>{let a=Jl(),u={"X-SESSION-ID":_y,"X-Client":dR};C.debug(`[SUB] connecting ${n} params=${JSON.stringify(u)}`);let c=new pR.SubscriptionClient(n,{lazy:!0,reconnect:!0,minTimeout:3e3,connectionParams:async()=>({...u,authToken:await e.getValidToken()})},Ey);c.onConnected(()=>C.debug("[SUB] connected")),c.onReconnected(()=>C.debug("[SUB] reconnected")),c.onDisconnected(()=>C.debug("[SUB] disconnected")),c.onError(f=>C.debug(`[SUB] error ${f?.message??String(f)}`));let d=[{name:"onNewCrdtPatchV2",query:Z0,variables:{projectExId:i.projectExId,appExId:i.appExId??null,versionExId:i.appVersionExId??null,latestPatchExIdInClient:o}},{name:"onSchemaUploadV3",query:eA,variables:{projectExId:i.projectExId,appExId:i.appExId??null,appVersionExId:i.appVersionExId??null}}].map(f=>(C.debug(`[SUB] subscribe ${f.name} vars=${JSON.stringify(f.variables)}`),c.request({query:f.query,variables:f.variables}).subscribe({next:h=>{a&&C.debug(`[SUB] ${f.name} event: ${JSON.stringify(h)}`),s()},error:h=>{C.warn("Schema subscription event failed",String(h)),s()}})));return{unsubscribe(){for(let f of d)f.unsubscribe();c.close(!1,!1)}}}}async function hR(e,t,r){let n=await e.loadProjectContext();if(t.projectExId)return n?.projectExId!==t.projectExId&&await e.saveProjectContext(t.projectExId,r?yo(await ni(r,t.projectExId)):null),t.projectExId;if(!n?.projectExId)throw new Error("No projectExId provided and no current project is set");return n.projectExId}async function Ty(e,t,r,n){try{await e.request(mA,{projectExId:t,client:Y,clientVersion:_n(),sessionId:n??_y,agent:r??null}),C.debug(`[agent-session] started for project ${t}`)}catch(i){C.debug(`[agent-session] skipped: ${String(i)}`)}}p();p();p();import{createHash as e5}from"crypto";var t5=e=>!!(e&&typeof e=="object"&&!Array.isArray(e)),Iy=e=>{if(Array.isArray(e))return e.map(r=>r===void 0?null:Iy(r));if(!t5(e))return e;let t={};for(let r of Object.keys(e).sort()){let n=e[r];n!==void 0&&(t[r]=Iy(n))}return t},r5=e=>JSON.stringify(Iy(e)),n5=e=>e5("sha256").update(r5(e)).digest("hex"),mR=e=>({projectExId:e.projectExId,appExId:e.appExId??null,appVersionExId:e.appVersionExId??null,schemaExId:e.schemaExId??null,lastPatchExId:e.lastPatchExId??null,snapshotHash:n5(e.snapshot),deployedSchemaExId:e.deployedSchemaExId??null,checkedAt:e.checkedAt??new Date().toISOString()}),gR=(e,t)=>!e||!t?e!==t:e.schemaExId!==t.schemaExId||e.lastPatchExId!==t.lastPatchExId||e.snapshotHash!==t.snapshotHash||e.deployedSchemaExId!==t.deployedSchemaExId,El=e=>e.changes.length>0;var yR=null,i5=()=>(yR??=xt().then(e=>{let t=e?.typesystem?.schema?.diff?.computeSemanticSchemaChanges;return typeof t=="function"?t:null}),yR),o5=async(e,t)=>{let r=await i5();return r?r(e,t):{changes:[]}},wy=(e,t)=>o5(JSON.stringify(e),JSON.stringify(t));p();var s5="Functorz";function vR(e,t,r,n){let i=e?.typesystem?.settings,o=e?.typesystem?.schema,s=t?.KtList,a=t?.KtMap;if(!i?.ExtraContext||!o?.CustomChatModelDescriptor||!o?.AIModelDescriptors||!s||!a)return C.warn("ztype ExtraContext symbols missing; schema graph will be built without custom models"),null;try{let{ExtraContext:u}=i,{AIModelDescriptors:c,CustomChatModelDescriptor:l,CustomEmbeddingModelDescriptor:d,ModelCustomParamDescriptor:f,CustomModelParam:h,CustomChatCompletionFeatures:g,Identifier:v,MediaOutputCardinality:_}=o,S=N=>a.fromJsMap(new Map(Object.entries(N??{}))),b=N=>typeof N=="string"?N==="single"?_.SINGLE:N==="multiple"?_.MULTIPLE:_.NONE:typeof N=="boolean"&&N?_.MULTIPLE:_.NONE,A=N=>new f(N.name,S(N.displayName),N.type,S(N.description)),O=N=>new h(A(N.serverUrl),A(N.apiToken),s.fromJsArray((N.extensionParams??[]).map(te=>new f(te.name,S(te.displayName),te.type,S(te.displayName))))),T=N=>N.provider===s5&&N.customModelIdentifier?new v(N.customModelIdentifier.id,N.customModelIdentifier.namespace):null,x=(r?.chatModelDescriptors??[]).map(N=>new l(N.provider,N.name,O(N.paramToConfigure),N.delisted,new g(N.features.streamResponse,N.features.multiModal,N.features.imageInput??!1,!1,N.features.videoInput??!1,N.features.imageMessageInput??!1,!1,N.features.videoMessageInput??!1,N.features.tools,N.features.reasoningContent,N.features.imageOutput,N.features.videoOutput,b(N.features.imageOutput),b(N.features.videoOutput),null,N.features.structuredOutput),T(N))),U=(r?.embeddingModelDescriptors??[]).map(N=>new d(N.provider,N.name,O(N.paramToConfigure),T(N),N.delisted));return new u(new c(s.fromJsArray(x),s.fromJsArray(U)),a.fromJsMap(new Map),n)}catch(u){return C.warn("ztype ExtraContext construction failed; schema graph will be built without custom models",u.message),null}}p();var hn=class extends Error{constructor(r,n){super(r);this.diagnostics=n;this.name="ZtypeValidationError"}};p();function _l(e,t,r,n=null){let i=yy(e,r?.appType);return e.api.ZTypeCoreApi.genZTypeApiContext(t,mo(e),i,gy(r,i),sR(e),n)}function ER(e,t){return gy(t,yy(e,t?.appType))}p();var mn=e=>e==null,Oy=(e,t)=>{if(mn(e)&&mn(t)||e===t)return!0;if(mn(e)||mn(t)||typeof e!="object"||typeof t!="object")return!1;let r=e,n=t,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let o of i)if(!Oy(r[o],n[o]))return!1;return!0};var Ay=e=>{let t=new Set;for(let r of e)if(t.add(r.pathComponents.map(n=>n.index!==void 0?`[${n.index}]`:`.${n.key}`).join("").replace(/^\./,"")),t.size>=20)break;return[...t]},_R=e=>{if(e.__typename==="DiffItem")switch(e.operation){case"add":return{__typename:"DiffItem",oldValue:e.newValue,newValue:null,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"DiffItem",oldValue:null,newValue:e.oldValue,operation:"add",pathComponents:e.pathComponents};case"update":return{__typename:"DiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}else switch(e.operation){case"insert":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:null,previousValue:e.previousValue,nextValue:e.nextValue,operation:"delete",pathComponents:e.pathComponents};case"delete":return{__typename:"ArrayDiffItem",oldValue:null,newValue:e.oldValue,previousValue:e.previousValue,nextValue:e.nextValue,operation:"insert",pathComponents:e.pathComponents};case"update":return{__typename:"ArrayDiffItem",oldValue:e.newValue,newValue:e.oldValue,operation:"update",pathComponents:e.pathComponents}}throw new Error(`Cannot reverse diff item: ${JSON.stringify(e)}`)},a5=e=>e.key??e.index??"",u5=(e,t)=>{let r=e;for(let n of t){if(r===null||typeof r!="object")return;r=r[n]}return r},c5=(e,t)=>{if(t.__typename!=="DiffItem")return null;let r=t.pathComponents.at(-1)?.key;if(r===void 0)return null;let n=Oy(e[r],t.oldValue);switch(t.operation){case"add":e[r]=t.newValue;break;case"update":if(!n)return null;e[r]=t.newValue;break;case"delete":if(!Object.prototype.hasOwnProperty.call(e,r)||!n)return null;delete e[r];break;default:return null}return t},l5=(e,t)=>{if(t.__typename!=="ArrayDiffItem")return null;let r=t.pathComponents.at(-1)?.index;if(r===void 0||r>e.length)return null;let n=()=>Oy(e[r],t.oldValue);switch(t.operation){case"insert":e.splice(r,0,t.newValue);break;case"delete":if(!n())return null;e.splice(r,1);break;case"update":if(!n())return null;e.splice(r,1,t.newValue);break;default:return null}return t},bR=(e,t)=>{let r=e,n=new WeakSet,i=s=>{if(r===null||typeof r!="object")return r;n.has(r)||(r=Array.isArray(r)?[...r]:{...r},n.add(r));let a=r;for(let u of s){let c=a[u];if(c!==null&&typeof c=="object"){if(!n.has(c)){let l=Array.isArray(c)?[...c]:{...c};n.add(l),a[u]=l}a=a[u]}else a=c}return a},o=[];for(let s of t)try{let u=s.pathComponents.map(a5).slice(0,-1);if(mn(u5(r,u)))continue;let c=i(u);if(Array.isArray(c)){let l=l5(c,s);l&&o.push(l)}else if(c!==null&&typeof c=="object"){let l=c5(c,s);l&&o.push(l)}}catch{continue}return o};p();var p5=3e4,bl=class{constructor(t){this.options=t}timer=null;subscriptionHandle=null;running=!1;isActive(){return this.timer!==null||this.subscriptionHandle!==null}start(){this.timer||this.subscriptionHandle||!this.options.subscriptionFactory||this.options.subscriptionFactory(this.options.sessionKey,this.options.getLastPatchExId(),()=>{this.run()}).then(t=>{this.subscriptionHandle=t}).catch(t=>{C.warn("Schema subscription failed; falling back to polling",t.message)}).finally(()=>{this.schedulePoll()})}dispose(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.subscriptionHandle?.unsubscribe(),this.subscriptionHandle=null}schedulePoll(){!this.options.subscriptionFactory||this.timer||(this.timer=setTimeout(()=>{this.timer=null,this.run().finally(()=>this.schedulePoll())},p5),this.timer.unref())}async run(){if(!this.running){this.running=!0;try{await this.options.refresh()}finally{this.running=!1}}}};p();var SR=(e,t)=>{let r=new WeakMap,n=s=>{let a=r.get(s);return a||(a=Array.isArray(s)?[...s]:{...s},r.set(s,a)),a},i=new WeakMap,o=n(e);for(let s of t){let a=(s?.pathComponents??[]).slice(0,-1),u=e,c=o;for(let l of a){let d=l.key??l.index??"",f=u[d];if(f===null||typeof f!="object")break;if(Array.isArray(f)){let h=i.get(f);h||(h=structuredClone(f),i.set(f,h)),c[d]=h;break}c[d]=n(f),u=f,c=c[d]}}return o};p();p();var f5=new Set(["WEB","WECHAT_MINI_PROGRAM","MOBILE"]),Eo=e=>f5.has(e?.appType??""),IR=(e,t)=>{if(!t)return e;let r=t.model.view();return{...e,server:r?.server??null}},Sl=e=>e?.pathComponents?.[0]?.key==="server",wR=e=>e?.pathComponents?.[0]?.key==="clients",OR=e=>e?.appType==="BACKEND_ONLY",TR=e=>typeof e=="string"&&e.length>0?e:null,xy=(e,t)=>{let r=e.serverDoc;if(r){let i=TR(r.schemaExId);return i?{ok:!0,appExId:null,schemaExId:i}:{ok:!1,error:"the backend app document has no schemaExId"}}if(e.serverDocRequired===!0)return{ok:!1,error:"this client app's server lives in the backend app's document, which did not load, so there is nothing to sync; retry, or run project sync-backend without appExId"};let n=TR(e.schemaExId);return n?{ok:!0,appExId:t,schemaExId:n}:{ok:!1,error:"the session has no schemaExId"}};p();var Ny=null,AR=async e=>(Ny??=e.request(J0).then(t=>(t.__type?.inputFields??[]).some(r=>r.name==="origin")).catch(()=>(Ny=null,!1)),await Ny?{origin:"MCP"}:{});p();function xR(e,t){let r=new Set;for(let n of e){let i=n&&typeof n=="object"?n.name:void 0;if(typeof i!="string")continue;let o=bv[i];o!==void 0&&!t.includes(o)&&r.add(i)}return[...r]}function NR(e){return`${e.join(", ")} ${e.length===1?"is":"are"} not available to this project yet: the feature is still being rolled out and has not been opened to this account or project. Nothing was applied. Do not retry or work around it; tell the user it is not available to them yet.`}var Ry=300*1e3,h5=100,m5=50,g5=["dataModel","types"];function y5(e){let t=e.server;if(!t||typeof t!="object"||Array.isArray(t))return e;let r={};for(let i of g5){let o=t[i];o!==void 0&&(r[i]=o)}let n={};return e.version!==void 0&&(n.version=e.version),n.server=r,n}function v5(e){if(typeof e!="string")return e;let t=e.trim();if(!/^[[{]|^(true|false|null|-?\d)/.test(t))return e;try{return JSON.parse(t)}catch{return e}}function E5(e){if(typeof e!="string")return null;let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!="object")return null;let r={};for(let[n,i]of Object.entries(t))r[n]=v5(i);return r}function _5(e){let t=new Set;return e.map(r=>{if(!r||typeof r!="object")return r;let n=r,i=typeof n.toolCallId=="string"&&n.toolCallId?n.toolCallId:null;if(i!==null&&t.has(i))throw new Error(`Duplicate toolCallId: ${i}`);let o=i??ca();return t.add(o),i===o?n:{...n,toolCallId:o}})}function b5(e,t){if(!e)return;let r=new Map(Object.entries(e)),n=t.map((i,o)=>{if(!r.has(i))throw new Error(`Missing ztype response for tool call ${o}`);let s=r.get(i);return r.delete(i),s});if(r.size>0)throw new Error(`Unexpected ztype responses: ${[...r.keys()].join(", ")}`);return n}function S5(e){return Array.isArray(e)?e.map(t=>t&&typeof t=="object"?Object.values(t).find(n=>typeof n=="string")??t:t):[]}function T5(e){let t=e??{},r=t.data??{},n={},i=E5(r.responseByToolCallId??t.responseByToolCallId);i&&Object.keys(i).length>0&&(n.responses=i);let o=r.schemaDiff??t.schemaDiff;o&&(n.schemaDiff=o);let s=S5(t.errors??r.errors);return s.length>0&&(n.errors=s),n}function I5(e){let t=e??{},r=t.data?.updatedReadState;if(r!=null)return r;if(typeof t.updatedReadStateJson=="string")try{return JSON.parse(t.updatedReadStateJson)}catch{return}}function w5(e){return(e??{}).data?.touchesComponents===!0}function O5(e,t){let r=e??{};if(r.isSuccess!==!1)return{};let n={},i=typeof r.failedToolCallId=="string"?t.indexOf(r.failedToolCallId):-1;i>=0&&(n.failedIndex=i),typeof r.errorCode=="string"&&(n.errorCode=r.errorCode),r.failedBeforeExecution===!0&&(n.failedBeforeExecution=!0);let o=Array.isArray(r.detailKeys)?r.detailKeys:[],s=Array.isArray(r.detailValues)?r.detailValues:[];if(o.length>0&&o.length===s.length){let a={};o.forEach((u,c)=>{typeof u=="string"&&typeof s[c]=="string"&&(a[u]=s[c])}),Object.keys(a).length>0&&(n.errorDetails=a)}return n}async function A5(e){let r=(await xt())?.application?.schemaops?.SchemaOpsErrorCode?.DEPENDENCY_CONFLICT?.name,i=(e.diagnostics?.stableErrors??[]).map(o=>{let s=o??{};return[s.componentId,s.message].filter(a=>typeof a=="string"&&a!=="").join(": ")}).filter(o=>o!=="");return{applied:{applied:!1,reason:"ztype validation interrupted the batch"},errors:i.length>0?i:[e.message],...typeof r=="string"?{errorCode:r}:{},errorDetails:{dependents:i.join("; ")},ztypeDiagnostics:e.diagnostics}}function x5(e){return e?e.available===!1||(e.stableErrors?.length??0)>0||(e.betaErrors?.length??0)>0:!1}var la=class e{constructor(t,r,n,i){this.client=t;this.sessionKey=r;this.onSchemaEvent=i;this.key=e.stringifyKey(r),this.watcher=new bl({sessionKey:r,subscriptionFactory:n,getLastPatchExId:()=>this.lastPatchExId,refresh:()=>this.runWatchRefresh()})}crdtBinary=null;model=null;serverDoc=null;schemaGraph=null;extraContext=null;extraContextLoaded=!1;enabledProjectFeatureNames=[];appDetail=null;snapshot=null;schemaExId=null;lastPatchExId=null;appliedPatchExIds=new Set;staleReason="not loaded";lastError=null;lastZtypeDiagnostics=null;diagnosedFor=null;lastRevision=null;events=[];undoStack=[];redoStack=[];projectCapabilitiesCache;watcher;loadedAt=0;lastUsedAt=Date.now();mutex=new fl;key;static stringifyKey(t){return[t.projectExId,t.appExId??"",t.appVersionExId??""].join(":")}isExpired(t=Date.now()){return t-this.lastUsedAt>Ry}currentView(){if(!this.model)throw new Error("CRDT model not loaded");return IR(this.model.view(),this.serverDoc)}lastPatchExIds(){return[this.lastPatchExId,this.serverDoc?.lastPatchExId??null].filter(t=>typeof t=="string")}serverSchemaExId(){return Eo(this.appDetail)?this.serverDoc?.schemaExId??null:this.schemaExId}status(){return{key:this.key,projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null,appVersionExId:this.sessionKey.appVersionExId??null,schemaExId:this.schemaExId,lastPatchExId:this.lastPatchExId,serverDocRequired:Eo(this.appDetail),serverDoc:this.serverDoc?{schemaExId:this.serverDoc.schemaExId,lastPatchExId:this.serverDoc.lastPatchExId}:null,loadedAt:this.loadedAt?new Date(this.loadedAt).toISOString():null,lastUsedAt:new Date(this.lastUsedAt).toISOString(),staleReason:this.staleReason,lastError:this.lastError,schemaRevision:this.lastRevision,ztypeDiagnostics:this.lastZtypeDiagnostics,crdtBinaryBytes:this.crdtBinary?.byteLength??null,hasCrdtModel:this.model!==null,hasZtypeGraph:this.schemaGraph!==null,schemaEventCount:this.events.length,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,watcherActive:this.watcher.isActive()}}state(){return{...this.status(),latestEvent:this.events.at(-1)??null}}listEvents(t,r=100){if(!t)return this.events.slice(-r);let n=this.events.findIndex(i=>i.id===t);return(n>=0?this.events.slice(n+1):this.events).slice(-r)}async checkRemoteAndSync(){return this.mutex.run(async()=>this.withErrorState(async()=>this.checkRemoteAndSyncLocked("remote")))}async load(t=!1){return this.mutex.run(async()=>this.withErrorState(()=>this.loadLocked(t)))}async sync(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),!this.schemaExId)return this.loadLocked();let t=await this.client.request(Y0,{schemaExId:this.schemaExId}),r=t.crdtSchemaBySchemaExId?.crdtPatches?.patches??[];return await this.applyNetworkPatches(r),await this.syncServerDocLocked(),this.model&&(this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics()),this.lastPatchExId=t.crdtSchemaBySchemaExId?.crdtPatches?.lastPatchExId??this.lastPatchExId,this.updateRevision(),this.status()}))}getSnapshot(t=!1){if(this.touch(),this.model?.view&&(this.snapshot=this.currentView()),!this.snapshot)throw new Error("Project schema is not loaded");return t?this.snapshot:y5(this.snapshot)}dataModel(){let t=this.getSnapshot().server;return!t||typeof t!="object"?null:t.dataModel??null}async save(){return this.mutex.run(async()=>this.withErrorState(async()=>{this.touch();let t=await this.currentZtypeDiagnostics(),r=await this.client.request(Zm,{projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null,versionExId:this.sessionKey.appVersionExId??null});if(this.schemaExId=r.saveSchema,this.serverDoc){let n=await this.client.request(Zm,{projectExId:this.sessionKey.projectExId,appExId:null,versionExId:null});this.serverDoc.schemaExId=n.saveSchema}return this.updateRevision(),{...this.status(),ztypeDiagnostics:t}}))}async validate(){return this.mutex.run(async()=>this.withErrorState(async()=>(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.currentZtypeDiagnostics())))}async fetchProjectCapabilities(){try{let r=(await this.client.request(uA,{projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??null})).fetchAppDetailByExId;if(!r)return null;let n="project"in r?r.project:r,i={};for(let o of n.capabilities??[])!o?.capability||!o.limit||(i[o.capability]=o.limit.unlimited?{unlimited:!0}:{unlimited:!1,amount:o.limit.amount??0});return Object.keys(i).length===0?null:i}catch(t){return C.warn("Could not load project capabilities for the schemaops gate",t.message),null}}async resolveProjectCapabilities(){if(this.projectCapabilitiesCache!==void 0)return this.projectCapabilitiesCache;let t=await this.fetchProjectCapabilities();return t!==null&&(this.projectCapabilitiesCache=t),t}async ztypeToolCalls(t,r=!1,n=null,i=!1,o=null){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),!this.schemaGraph)throw new Error("ztype runtime is unavailable; install @functorz/ztype in this package");let s=await xt(),a=s?.api;if(!a?.ZTypeCoreApi||!a?.ZTypeSchemaOpsApi)throw new Error("ztype SchemaOps API is unavailable");let u=o??await this.resolveProjectCapabilities(),c=u===null?this.schemaGraph:a.ZTypeCoreApi.withProjectCapabilities(this.schemaGraph,u),l=_l(s,c,this.appDetail,await this.getExtraContext(s)),d=xR(t,this.enabledProjectFeatureNames);if(d.length)throw new Error(NR(d));let f=_5(t),h=f.map(x=>x&&typeof x=="object"?x.toolCallId:void 0).filter(x=>typeof x=="string"),g=this.withProjectFeatures(a.ZTypeCoreApi,()=>a.ZTypeSchemaOpsApi.toolCalls(l,f,n??null)),v=T5(g),_=O5(g,h),S=s?.application?.schemaops?.SchemaOpsErrorCode?.CAPABILITY_LIMITED?.name;S!==void 0&&_.errorCode===S&&(this.projectCapabilitiesCache=void 0);let b=v.schemaDiff,A=b5(v.responses,h),O={},T=I5(g);if(T!=null&&(O.updatedReadState=T),A&&(O.responses=A),v.errors&&(O.errors=v.errors,Object.assign(O,_),O.applied={applied:!1,reason:"batch rejected by ztype"}),b&&r&&(O.schemaDiff=b),b)try{O.applied=await this.applySchemaDiffLocked(b,{skipValidation:i}),w5(g)&&(O.touchesComponents=!0)}catch(x){if(!(x instanceof hn))throw x;let U=await A5(x);return Object.assign(O,U,{errors:[...Array.isArray(O.errors)?O.errors:[],...U.errors]}),O}return await this.attachValidationErrorIfAny(O),O}))}async attachValidationErrorIfAny(t){let r=await this.currentZtypeDiagnostics();x5(r)&&(t.ztypeDiagnostics=r)}async undo(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.undoStack.length===0)return{...this.status(),undone:!1,reason:"nothing to undo"};let t=this.undoStack[this.undoStack.length-1],r=t.dataSource.map(_R).reverse(),n=await this.applyReversibleLocked(r);return n?(this.undoStack.pop(),this.redoStack.push(t),{...n,undone:!0,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,reverted:t.semanticChanges??void 0,revertedPaths:Ay(t.dataSource)}):{...this.status(),undone:!1,reason:"schema diverged since this change; undo no longer applies cleanly"}}))}async redo(){return this.mutex.run(async()=>this.withErrorState(async()=>{if(this.touch(),(!this.model||!this.schemaGraph||!this.appDetail)&&await this.loadLocked(),this.redoStack.length===0)return{...this.status(),redone:!1,reason:"nothing to redo"};let t=this.redoStack[this.redoStack.length-1],r=await this.applyReversibleLocked(t.dataSource);return r?(this.redoStack.pop(),this.undoStack.push(t),{...r,redone:!0,undoDepth:this.undoStack.length,redoDepth:this.redoStack.length,reapplied:t.semanticChanges??void 0,reappliedPaths:Ay(t.dataSource)}):{...this.status(),redone:!1,reason:"schema diverged since this change; redo no longer applies cleanly"}}))}async applyReversibleLocked(t){if(!this.model)throw new Error("CRDT model not loaded");let r=this.currentView(),n=bR(r,t);if(n.length!==t.length)return null;let i=n.filter(o=>!(o.__typename==="DiffItem"&&mn(o.oldValue)&&mn(o.newValue)));return i.length===0?null:this.applySchemaDiffLocked({id:ca(),dataSource:i},{recordUndo:!1})}async recordUndoEntry(t,r,n){let i=await aa();if(!i?.generateDiff)return;let o=[];i.generateDiff({before:t,after:r,prefix:[],result:o}),o.length!==0&&(this.undoStack.push({id:ca(),dataSource:o,semanticChanges:n}),this.undoStack.length>m5&&this.undoStack.shift(),this.redoStack=[])}async loadLocked(t=!1){if(this.touch(),this.model&&!t&&!this.staleReason)return this.status();let n=(await this.client.request(Wn,this.sessionKey)).fetchAppDetailByExId;if(!n)throw new Error(`Project not found: ${this.sessionKey.projectExId}`);let i=ua(n);if(!i?.crdtModelUrl||!i.exId)throw new Error("Project has no uploaded CRDT schema");let o=await fy(i.crdtModelUrl);return this.crdtBinary=o,this.appliedPatchExIds.clear(),this.lastPatchExId=null,this.serverDoc=null,this.undoStack=[],this.redoStack=[],this.projectCapabilitiesCache=void 0,this.appDetail=n,await this.initializeRuntime(o,i.crdtPatches?.patches??[],n),this.schemaExId=i.exId,this.lastPatchExId=i.crdtPatches?.lastPatchExId??null,this.loadedAt=Date.now(),this.model&&this.schemaGraph?this.staleReason=!this.serverDoc&&Eo(n)?"backend app document unavailable":null:this.model&&!this.schemaGraph&&(this.staleReason="ztype runtime unavailable"),this.updateRevision(),this.watcher.start(),this.status()}async applySchemaDiffLocked(t,r={}){if(Array.isArray(t.dataSource)&&t.dataSource.length===0)return{...this.status(),applied:!1,reason:"empty schema diff"};if(!this.serverDoc&&Eo(this.appDetail)&&(t.dataSource??[]).some(Sl))throw new Error("This client app's server lives in the backend app's document, which is not loaded; refusing to write server changes into the client document. Run schema load again.");if(OR(this.appDetail)&&(t.dataSource??[]).some(wR))throw new Error("This session is on the project's own document, which holds the project's backend and no client, so pages and components written here would belong to nothing and never render. Pin the client they belong to with set_current_project (appExId), or pass appExId on this call; take it from `project metadata` -> apps[]. A project with no client app has nowhere to hold them at all.");let i=(r.recordUndo??process.env.MOMEN_MCP_UNDO!=="0")&&this.snapshot?SR(this.snapshot,t.dataSource??[]):null,o=this.currentRevision(),s=await xt(),a=s?.api?.ZTypeCoreApi,u=await aa();if(!a||!u?.executeCrdtNodeUpdateAndTransformDiff||!u.generateDiff)throw new Error("CRDT/ztype write runtime is unavailable");let c=_l(s,this.schemaGraph,this.appDetail,await this.getExtraContext(s)),l=this.withProjectFeatures(a,()=>a.batchUpdateSchemaGraph(c,[t]));if(l?.interruptErrors?.length>0){let g={available:!0,stableErrors:[...l.interruptErrors].map(hl),betaErrors:[]};if(r.skipValidation!==!0)throw new hn("ztype validation interrupted schema update",g)}if(!this.model)throw new Error("CRDT model not loaded");C.debug(`[Session] applying schemaDiff dataSource: ${JSON.stringify(t.dataSource).slice(0,4e3)}`);try{await this.uploadByDoc(u,t.dataSource??[],this.model)}catch(g){C.error(`[Session] CRDT apply/upload failed; reloading session to discard the diverged graph: ${g.message}`);let{undoStack:v,redoStack:_}=this;try{await this.loadLocked(!0),this.undoStack=v,this.redoStack=_}catch(S){C.error(`[Session] reload after the failed write failed too; unloading the session so the next command loads it again: ${S.message}`),this.model=null,this.snapshot=null,this.schemaGraph=null,this.schemaExId=null,this.diagnosedFor=null,this.staleReason="a write failed and the reload after it failed too"}throw g}this.schemaGraph=l.updatedGraph,this.snapshot=this.currentView();let d=await this.refreshZtypeDiagnostics(),f=this.updateRevision(),h=i&&o&&i.server!==this.snapshot.server?await wy({version:i.version,server:i.server},{version:this.snapshot.version,server:this.snapshot.server}):null;return h&&El(h)&&o&&f&&this.appendSchemaEvent("local",o,f,h),i&&await this.recordUndoEntry(i,this.snapshot,h&&El(h)?h:null).catch(g=>C.warn(`[Session] the write landed but its undo entry could not be recorded: ${g.message}`)),{...this.status(),ztypeDiagnostics:d,backendErrorCount:aR(d),_schema:h&&El(h)?{change:h}:void 0}}async uploadByDoc(t,r,n){let i=this.serverDoc,o=i?r.filter(Sl):[],s=i?r.filter(u=>!Sl(u)):r,a=i&&o.length>0&&s.length>0?oR(i.model.view()):null;if(i&&o.length>0)for(let u of await this.uploadDocPatch(t,o,i.model,null,i.schemaExId))i.appliedPatchExIds.add(u.exId),i.lastPatchExId=u.exId;if(s.length!==0)try{for(let u of await this.uploadDocPatch(t,s,n,this.sessionKey.appExId??null,this.schemaExId))this.appliedPatchExIds.add(u.exId),this.lastPatchExId=u.exId}catch(u){if(i&&a){let c=[];t.generateDiff({before:i.model.view(),after:a,prefix:[],result:c}),c.length>0&&await this.uploadDocPatch(t,c,i.model,null,i.schemaExId).catch(l=>{throw new Error(`The server half of this change was saved to the backend app's document, but the client half failed (${u.message}) and reverting the server half failed too (${l.message}). Those server changes are live without their client counterparts: read the schema again before retrying, or the retry applies them a second time.`)})}throw u}}async uploadDocPatch(t,r,n,i,o){let s=t.executeCrdtNodeUpdateAndTransformDiff(r,n,this.snapshot,uR),a=ca(),u=await AR(this.client);return(await this.client.request(X0,{projectExId:this.sessionKey.projectExId,appExId:i,schemaExId:o,patches:[{content:{id:a,dataSource:s.diffsFromCrdt},patchBase64:s.patchBase64,uuid:a,...u}]})).batchCreateSchemaCrdtPatch??[]}async checkRemoteAndSyncLocked(t){if(!this.model||!this.schemaExId||!this.snapshot)return await this.loadLocked(),null;let r=this.currentRevision();if(!r)return null;let n={version:this.snapshot.version,server:this.snapshot.server},o=(await this.client.request(Wn,this.sessionKey)).fetchAppDetailByExId,s=ua(o);if(!s?.exId)return null;let a=s.crdtPatches?.lastPatchExId??null,u=s.exId,c=my(o);if(!await this.syncServerDocLocked()&&u===this.schemaExId&&a===this.lastPatchExId&&c===this.lastRevision?.deployedSchemaExId)return this.appDetail=o??this.appDetail,this.updateRevision(),null;u!==this.schemaExId||!s.crdtModelUrl?await this.loadLocked(!0):(this.appDetail=o??this.appDetail,await this.applyNetworkPatches(s.crdtPatches?.patches??[]),this.model&&(this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics()),this.lastPatchExId=a,this.updateRevision());let d=this.currentRevision();if(!d||!gR(r,d))return null;let f=await wy(n,{version:this.snapshot?.version,server:this.snapshot?.server});return this.appendSchemaEvent(t==="watch"?"remote":t,r,d,f),{type:"SCHEMA_STALE",message:"Project schema changed since this session last used it; session was refreshed before executing the command.",projectExId:this.sessionKey.projectExId,fromRevision:r,toRevision:d,semanticChanges:f,detectedAt:new Date().toISOString()}}currentRevision(){return this.lastRevision??this.updateRevision()}updateRevision(){return!this.snapshot&&!this.crdtBinary?(this.lastRevision=null,null):(this.lastRevision=mR({projectExId:this.sessionKey.projectExId,appExId:this.sessionKey.appExId??this.appDetail?.appExId??null,appVersionExId:this.sessionKey.appVersionExId??null,schemaExId:this.schemaExId,lastPatchExId:this.lastPatchExId,snapshot:this.snapshot??{binaryBytes:this.crdtBinary?.byteLength??null},deployedSchemaExId:my(this.appDetail)}),this.lastRevision)}appendSchemaEvent(t,r,n,i){let o={id:ca(),type:"SCHEMA_CHANGED",source:t,projectExId:this.sessionKey.projectExId,fromRevision:r,toRevision:n,semanticChanges:i,detectedAt:new Date().toISOString()};this.events.push(o),this.events=this.events.slice(-h5),this.onSchemaEvent?.(o)}async runWatchRefresh(){let t=this.lastUsedAt;try{await this.mutex.run(async()=>{await this.withErrorState(async()=>this.checkRemoteAndSyncLocked("watch"))})}catch(r){C.warn("Schema watch refresh failed",r.message)}finally{this.lastUsedAt=t}}dispose(){this.watcher.dispose()}async initializeRuntime(t,r,n){let i=await aa();if(!i?.initModelByBinary){this.model=null,this.snapshot={binaryBytes:t.length,patches:r},this.schemaGraph=null,this.diagnosedFor=null,this.appDetail=n,this.staleReason="CRDT runtime unavailable";return}this.model=i.initModelByBinary(t),await this.applyNetworkPatches(r),this.model&&(Eo(n)&&(this.serverDoc=await this.loadServerDoc(i).catch(o=>{if(vl(o,"CLIENT_VERSION_TOO_OLD"))throw this.staleReason="backend app document unavailable",o;return C.warn("Backend app document unavailable; loading this client app's own document alone",o.message),null})),this.snapshot=this.currentView(),await this.resolveZtypeGraph(),await this.refreshZtypeDiagnostics())}async applyNetworkPatches(t){let r=t.filter(i=>!!(i?.exId&&!this.appliedPatchExIds.has(i.exId)));if(!this.model||r.length===0)return;let n=await hy();if(!n?.fromBinary)throw new Error("json-joy Patch runtime is unavailable");this.model.applyBatch(r.map(i=>n.fromBinary(Buffer.from(i.patchBase64,"base64"))));for(let i of r)this.appliedPatchExIds.add(i.exId),this.lastPatchExId=i.exId;this.snapshot=this.currentView()}async loadServerDoc(t){let r=await this.client.request(Wn,{projectExId:this.sessionKey.projectExId}),n=ua(r.fetchAppDetailByExId);if(!n?.crdtModelUrl||!n.exId||!t.initModelByBinary)throw new Error("Could not load the backend app's document this client app's server half lives in");let i={model:t.initModelByBinary(await fy(n.crdtModelUrl)),schemaExId:n.exId,lastPatchExId:null,appliedPatchExIds:new Set};return await this.applyServerPatches(i,n.crdtPatches?.patches??[]),i.lastPatchExId=n.crdtPatches?.lastPatchExId??i.lastPatchExId,i}async applyServerPatches(t,r){let n=r.filter(o=>!!(o?.exId&&!t.appliedPatchExIds.has(o.exId)));if(n.length===0)return!1;let i=await hy();if(!i?.fromBinary)throw new Error("json-joy Patch runtime is unavailable");t.model.applyBatch(n.map(o=>i.fromBinary(Buffer.from(o.patchBase64,"base64"))));for(let o of n)t.appliedPatchExIds.add(o.exId),t.lastPatchExId=o.exId;return!0}async syncServerDocLocked(){let t=this.serverDoc;if(!t)return!1;let r=await this.client.request(Wn,{projectExId:this.sessionKey.projectExId}),n=ua(r.fetchAppDetailByExId);if(!n?.exId)return!1;let i=n.crdtPatches?.lastPatchExId??null;return n.exId===t.schemaExId&&i===t.lastPatchExId?!1:n.exId!==t.schemaExId?(this.serverDoc=await this.loadServerDoc(await aa()),!0):(await this.applyServerPatches(t,n.crdtPatches?.patches??[]),t.lastPatchExId=i,!0)}async resolveZtypeGraph(){let t=await xt(),r=t?.api;if(!r?.ZTypeCoreApi||!this.snapshot){this.schemaGraph=null,this.diagnosedFor=null,this.staleReason="ztype runtime unavailable";return}let n=r.ZTypeCoreApi.parseZSchemaFromJsObject(this.snapshot),i=await this.getExtraContext(t);this.schemaGraph=this.withProjectFeatures(r.ZTypeCoreApi,()=>r.ZTypeCoreApi.resolveZSchemaToSchemaGraph(n,i))}withProjectFeatures(t,r){return t.withEnabledFeatures(this.enabledProjectFeatureNames,r)}async getExtraContext(t){if(this.extraContextLoaded)return this.extraContext;this.extraContextLoaded=!0;try{let[r,n,i]=await Promise.all([nR(),this.client.request(cA).then(o=>o.supportedCustomModelDescriptor??null).catch(o=>(C.warn("extraContext: model descriptors unavailable",o.message),null)),this.client.request(B0,{projectExId:this.sessionKey.projectExId}).then(o=>(o.features??[]).filter(s=>s.enabled).map(s=>s.featureName)).catch(o=>(C.warn("extraContext: project features unavailable; ztype runs with every feature off",o.message),[]))]);this.enabledProjectFeatureNames=i,this.extraContext=vR(t,r,n,mo(t))}catch(r){C.warn("extraContext build failed; resolving schema without it",r.message),this.extraContext=null}return this.extraContext}diagnosticsInputs(){return{graph:this.schemaGraph,target:`${this.appDetail?.appType??""}:${this.appDetail?.appExId??""}`,extraContext:this.extraContext,featureNames:this.enabledProjectFeatureNames}}async currentZtypeDiagnostics(){let t=this.diagnosedFor,r=this.diagnosticsInputs();return this.lastZtypeDiagnostics&&t&&Object.keys(r).every(n=>t[n]===r[n])?this.lastZtypeDiagnostics:this.refreshZtypeDiagnostics()}async refreshZtypeDiagnostics(){if(this.diagnosedFor=null,this.lastZtypeDiagnostics=null,!this.schemaGraph||!this.appDetail)return this.lastZtypeDiagnostics={available:!1,stableErrors:[],betaErrors:[],error:this.staleReason??"ztype schema graph is not loaded"},this.lastZtypeDiagnostics;let t=await xt(),r=t?.api;if(!r?.ZTypeCoreApi||!r?.ZTypeValidationApi)return this.lastZtypeDiagnostics={available:!1,stableErrors:[],betaErrors:[],error:"ztype validation API is unavailable"},this.lastZtypeDiagnostics;let n=_l(t,this.schemaGraph,this.appDetail,await this.getExtraContext(t)),i=this.withProjectFeatures(r.ZTypeCoreApi,()=>r.ZTypeValidationApi.validateSchemaGraph(n,ER(t,this.appDetail)));return this.lastZtypeDiagnostics={available:!0,stableErrors:[...i?.errors??i?.stableErrors??[]].map(hl),betaErrors:[...i?.warnings??i?.betaErrors??[]].map(hl)},this.diagnosedFor=this.diagnosticsInputs(),this.lastZtypeDiagnostics}touch(){this.lastUsedAt=Date.now()}async withErrorState(t){try{let r=await t();return this.lastError=null,r}catch(r){throw this.lastError=r instanceof Error?r.message:String(r),r}}};var Tl=class{constructor(t,r){this.clientFactory=t;this.subscriptionFactory=r}sessions=new Map;emitter=new N5;clear(){for(let t of this.sessions.values())t.dispose();this.sessions.clear()}sweep(){let t=Date.now();for(let[r,n]of this.sessions.entries())n.isExpired(t)&&(n.dispose(),this.sessions.delete(r))}status(){return this.sweep(),{projectSessionIdleTtlMs:Ry,sessions:[...this.sessions.values()].map(t=>t.status())}}async load(t,r=!1){return(await this.getSession(t)).load(r)}async sync(t){return(await this.getSession(t)).sync()}async snapshot(t,r=!1){return(await this.getSession(t)).getSnapshot(r)}async dataModel(t){return(await this.getSession(t)).dataModel()}async save(t){return(await this.getSession(t)).save()}async validate(t){return(await this.getSession(t)).validate()}async ztypeToolCalls(t,r,n=!1,i=null,o=!1,s=null){return(await this.getSession(t)).ztypeToolCalls(r,n,i,o,s)}async serverSchemaExId(t){let r=await this.getSession(t);return await r.load(!1),r.serverSchemaExId()}async lastPatchExIds(t){let r=await this.getSession(t);return await r.load(!1),await r.checkRemoteAndSync(),r.lastPatchExIds()}async undo(t){return(await this.getSession(t)).undo()}async redo(t){return(await this.getSession(t)).redo()}async checkRemoteAndSync(t){return(await this.getSession(t)).checkRemoteAndSync()}schemaState(t){this.sweep();let r=[...this.sessions.values()].filter(n=>!t||n.status().projectExId===t);return{projectExId:t??null,sessions:r.map(n=>n.state())}}schemaEvents(t,r,n=100){this.sweep();let i=[...this.sessions.values()].filter(o=>!t||o.status().projectExId===t);return{projectExId:t??null,events:i.flatMap(o=>o.listEvents(r,n))}}async getSession(t){this.sweep();let r=la.stringifyKey(t),n=this.sessions.get(r);if(n)return n;let i=new la(await this.clientFactory(),t,this.subscriptionFactory,o=>{this.emitter.emit("schemaChanged",o)});return this.sessions.set(r,i),i}};function nr(e,t){return{projectExId:e,appExId:t.appExId??null,appVersionExId:t.appVersionExId??null}}p();var RR=e=>e??{},H=e=>typeof e=="string"&&e.length>0?e:void 0,le=e=>typeof e=="string"&&e.length>0?e:null,Ge=(e,t=!1)=>typeof e=="boolean"?e:t,Ye=(e,t)=>typeof e=="number"&&Number.isFinite(e)?e:t,ii=e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?e:void 0,Fe=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},oi=(e,t)=>{let r=H(e);if(!r)throw new Error(`${t} is required`);return r},Nt=(e,t)=>{if(!t)return e;if(e&&typeof e=="object"&&!Array.isArray(e)){let r=e,n=Fe(r._schema);return{...r,_schema:{...n,warning:t}}}return{result:e,_schema:{warning:t}}},R5=e=>new Promise(t=>{setTimeout(t,e)}),Il=e=>{let t=e?.name;if(typeof t!="string"||t.length===0)return null;let r=typeof e?.type=="string"?e.type:"";return/IMAGE|VIDEO|FILE/.test(r)?r.includes("LIST")?`${t}_ids`:`${t}_id`:t},CR=(e,t)=>{let n=e?.tableMetadata?.find(i=>i?.name===t)?.columnMetadata?.map(i=>Il(i))?.filter(i=>i!==null);return n?.length?n.slice(0,20):["id"]},C5=/token|secret|password|privatekey|merchantkey|mchkey|apikey/i,Cy=e=>{if(Array.isArray(e))return e.map(Cy);if(!e||typeof e!="object")return e;let t={};for(let[r,n]of Object.entries(e))t[r]=C5.test(r)?"<redacted>":Cy(n);return t},Py=(e,t)=>Ge(t.includeSecrets,!1)?e:Cy(e),Dy=async(e,t,r)=>{let n={projectExId:H(t.projectExId),appExId:le(t.appExId),appVersionExId:le(t.appVersionExId)},i="appExId"in t,o=await hR(e,n,r);if(!i){let s=await e.loadProjectContext();n.appExId=s?.projectExId===o?s.appExId??null:null}if(n.appExId!==null&&n.appExId===o)throw new Error(`appExId was given the project exId (${o}). appExId names a client app inside the project, never the project itself: pass appExId: null to address the project's own document (its backend alone), or take an app exId from \`project metadata\` -> apps[] whose appExId is non-null.`);return{...n,projectExId:o}},PR=async(e,t)=>{let r=H(t.organizationExId),n=H(t.projectSpaceType);if(r&&n)return{organizationExId:r,projectSpaceType:n};let o=(await e.request(Fc))?.user,s=o?.currentOrganization??o?.organization??o?.organizations?.[0]??o?.joinedOrganizations?.[0];if(!s?.exId)throw new Error("No default organization found; pass organizationExId and projectSpaceType");return{organizationExId:r??s.exId,projectSpaceType:n??"PERSONAL"}},P5=async(e,t)=>((await e.request(Mc,{projectName:t,paginator:{first:20}}))?.fuzzySearchProjectName?.edges??[]).find(o=>o?.node?.projectName===t)?.node??null,DR=async(e,t,r)=>{let n=Date.now()+r;for(;Date.now()<n;){let i=await P5(e,t);if(i)return i;await R5(2e3)}return null},LR=(e,t,r,n=!0)=>{if(H(t.confirmProjectExId)!==e&&!(n&&Ge(t.force,!1)))throw new Error(`${r} is destructive; pass confirmProjectExId=${e}`+(n?" or force=true":""))},D5=e=>e.replace(/\/api\/graphql-v2(\/?)$/,"/api/graphql-admin$1"),_o=async(e,t)=>{let n=(await e.request(z0,{projectExId:t.projectExId,appVersionExId:t.appVersionExId}))?.fetchAppDetailByExIdWithoutReconcile,i=n?.__typename==="Project"?n:null;if(!i?.adminToken)throw new Error(`Runtime commands need the project admin token, which only project editors get; none was returned for project ${t.projectExId}`);let o=i.zeroUrl??Rt().zeroApiUrlTemplate.replace("{projectExId}",t.projectExId),s={authorization:`Bearer ${i.adminToken}`};return{adminToken:i.adminToken,zeroUrl:o,dataClient:new Ze(o,{headers:s,fetch:vo}),adminClient:new Ze(i.adminZeroUrl??D5(o),{headers:s,fetch:vo})}};p();p();import{promises as L5}from"fs";import k5 from"path";var j5=async(e,t)=>{let r=H(e.cwd);if(!r)throw new Error("cwd is required");let n=k5.resolve(r);if(!(await L5.stat(n)).isDirectory())throw new Error(`Path is not a directory: ${n}`);return t.credentialStore.setWorkspaceRoot(n),t.schemaManager.clear(),t.ok({cwd:n},`Current working directory set to ${n}`)},kR={"workspace.set":j5};p();var GR=qe(Vo(),1);p();import{createServer as jR}from"http";import M5 from"open";var pa=class{config;constructor(t){this.config=t}async findAvailablePort(t){let r=t||this.config.callbackPort||8088;return new Promise((n,i)=>{let o=jR();o.on("error",s=>{s.code==="EADDRINUSE"?n(this.findAvailablePort(r+1)):i(s)}),o.listen(r,()=>{let s=o.address(),a=typeof s=="object"&&s!==null?s.port:r;o.close(()=>n(a))})})}async authenticate(){let t=await this.findAvailablePort(),r=`http://localhost:${t}/callback`;C.info(`[JwtAuth] Using callback URL: ${r}`),C.info("[JwtAuth] Opening browser for authentication...");let n=await new Promise((i,o)=>{let s=null,a=!1,u=jR(async(c,l)=>{if(!c.url)return;let d=new URL(c.url,`http://localhost:${t}`);if(d.pathname==="/callback"){C.info(`[JwtAuth] Callback received: ${c.url}`);let f=d.searchParams.get("token");if(!f||f.trim()===""){C.info("[JwtAuth] No token parameter found in callback URL"),C.info("[JwtAuth] Available parameters:",Array.from(d.searchParams.keys()).join(", "));let g=this.errorPage("No authentication token received");l.writeHead(400,{"Content-Type":"text/html"}),l.end(g),a||(a=!0,s&&clearTimeout(s),u.close(),o(new Error("No token parameter in callback")));return}C.info(`[JwtAuth] Token received (length: ${f.length} chars)`);let h=this.successPage();l.writeHead(200,{"Content-Type":"text/html"}),l.end(h),setTimeout(()=>{a||(a=!0,s&&clearTimeout(s),u.close(),i(f))},1e3)}});u.on("error",c=>{a||(a=!0,s&&clearTimeout(s),o(c))}),u.listen(t,async()=>{let c=new URL(this.config.authEndpoint);c.searchParams.set("redirect_uri",r),C.info(`[JwtAuth] Opening: ${c.toString()}`);try{await M5(c.toString())}catch{C.info("[JwtAuth] Could not open browser automatically"),C.info("[JwtAuth] Please open this URL manually:"),C.info(c.toString())}}),s=setTimeout(()=>{a||(a=!0,u.close(),o(new Error("Authentication timeout - no response after 5 minutes")))},3e5)});return C.info("[JwtAuth] JWT token received successfully"),{access_token:n,token_type:"Bearer"}}renderPage(t){let r=t.autoClose?`
|
|
1286
1283
|
<script>
|
|
1287
1284
|
setTimeout(() => {
|
|
1288
1285
|
window.close();
|
|
@@ -1335,78 +1332,78 @@ ${String(e)}`)}catch(t){return t}},v0=e=>{if(typeof e!="object"||e===null)throw
|
|
|
1335
1332
|
<p style="margin-top: 1rem; font-size: 0.9em; opacity: 0.8;">${t.footer}</p>
|
|
1336
1333
|
</div>${r}
|
|
1337
1334
|
</body>
|
|
1338
|
-
</html>`}successPage(){return this.renderPage({title:"Token Received",gradient:"#667eea 0%, #764ba2 100%",headingColor:"#333",icon:"\u2713",heading:"Token Received",body:"MCP server authenticated successfully.",footer:"You can close this window.",autoClose:!0})}errorPage(t){return this.renderPage({title:"Authentication Error",gradient:"#f093fb 0%, #f5576c 100%",headingColor:"#d93025",icon:"\u26A0\uFE0F",heading:"Authentication Error",body:t,footer:"Please try again."})}};p();var Qe=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},
|
|
1335
|
+
</html>`}successPage(){return this.renderPage({title:"Token Received",gradient:"#667eea 0%, #764ba2 100%",headingColor:"#333",icon:"\u2713",heading:"Token Received",body:"MCP server authenticated successfully.",footer:"You can close this window.",autoClose:!0})}errorPage(t){return this.renderPage({title:"Authentication Error",gradient:"#f093fb 0%, #f5576c 100%",headingColor:"#d93025",icon:"\u26A0\uFE0F",heading:"Authentication Error",body:t,footer:"Please try again."})}};p();var Qe=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},da=e=>Array.isArray(e)?e:[];function MR(e){let t={};for(let r of da(e)){let n=Qe(r),i=n.capability;if(typeof i!="string")continue;let o=Qe(n.limit);t[i]=o.unlimited?"unlimited":o.amount??0}return t}function wl(e,t){if(Array.isArray(e))return e.map(r=>wl(r,t));if(e&&typeof e=="object"){let r={};for(let[n,i]of Object.entries(e))t.has(n)||(r[n]=wl(i,t));return r}return e}var FR=new Set(["crdtPatches","crdtModelUrl","latestDeployedServerSchema","additional"]);function qR(e){let t=Qe(e),r=Qe(t.fetchAppDetailByExId),n=Qe(r.project),i=v=>r[v]??n[v],o=Qe(i("projectConfig")),s=Qe(r.config).customDomain??Qe(o.webConfig).customDomain??i("webFreeProdDomain")??null,a=r.__typename==="Project",u=i("lastDeployedServerSchemaExId")??null,c=Qe(r.lastUploadedSchema).exId??null,l=a?{deployedSchemaExId:u,uploadedSchemaExId:c,hasUndeployedChanges:c!=null&&c!==u,deploymentEnvs:da(i("deploymentEnvConfigs")).map(v=>Qe(v).userDeploymentEnvironment).filter(v=>v!=null)}:{},d=da(i("appList")).map(v=>{let _=Qe(v);return{appExId:_.appExId,appType:_.appType,name:_.name,published:_.hasPublished??!1,expired:_.isExpired??!1}}),f=Qe(i("projectPlan")),h=Qe(Qe(t.project).rpsStatsInLast30Days),g={projectExId:r.projectExId??n.exId??null,projectName:i("projectName")??null,appType:r.appType??null,supportedPlatforms:o.supportedPlatforms??null,createdAt:i("createdAt")??null,updatedAt:i("updatedAt")??null,published:i("hasPublished")??!1,expired:i("isExpired")??!1,webDomain:s,...l,integrations:{stripe:o.stripePayConfig!=null,alipay:o.aliPayConfig!=null,wechatPay:o.wechatPayConfig!=null,wechatApp:o.wechatAppConfig!=null,sms:o.aliyunSmsConfig!=null,email:o.emailConfig!=null},plan:{type:f.projectPlanType??null,expireAt:f.expireAt??null,highestPurchased:i("highestPurchasedProjectPlanType")??null},capabilities:MR(i("capabilities")),rpsLast30Days:{exceededDays:h.exceededNumOfDays??0,exceededTotal:h.exceededTotal??0}};return d.length>0&&(g.apps=d),g}function UR(e){let t=Qe(e),r={};for(let n of da(t.projectResourceUsageInfo)){let i=Qe(n),o=i.resourceType;typeof o=="string"&&(r[o]={used:i.usedAmount??0,available:i.availableAmountWithNoExhaustionBurst??null,status:i.resourceUsageStatus??null,unlimited:i.unlimited??!1})}return{resources:r,unitComputingPower:t.unitComputingPower??null,visitTimesSupportedByComputingPower:t.visitTimesSupportedByComputingPower??null}}function VR(e){let t=Qe(Qe(e).user),r=da(t.joinedOrganizations).map(n=>{let i=Qe(n);return{exId:i.exId,displayName:i.displayName,ownerName:i.ownerName,planType:i.planType,planExpireAt:i.planExpireAt,permissionEnabled:i.permissionEnabled,permissionRoleLimit:i.permissionRoleLimit,capabilities:MR(i.capabilities)}});return{exId:t.exId,email:t.email,phoneNumber:t.phoneNumber,username:t.username,displayName:t.displayName,availableTechnicalSupportHours:t.availableTechnicalSupportHours,daysSinceRegistration:t.daysSinceRegistration,involvedProjectCount:t.involvedProjectCount,organizations:r}}async function Ly(e){let t=await e.loadCredentials();if(!t)return null;let r=GR.default.decode(t.access_token),n=r&&typeof r=="object"?r:null;return{tokenType:t.token_type,savedAt:t.savedAt,jwt:n?{sub:n.sub,roles:n.roles,iat:n.iat,exp:n.exp}:r}}var F5=async(e,t)=>{let r=await yr(t.credentialStore),n=await new pa(r).authenticate();return await t.credentialStore.saveCredentials(n),t.ok(await Ly(t.credentialStore),"Authenticated")},q5=async(e,t)=>{await t.credentialStore.deleteCredentials();let r=await yr(t.credentialStore),n=await new pa(r).authenticate();return await t.credentialStore.saveCredentials(n),t.ok(await Ly(t.credentialStore),"Authenticated")},U5=async(e,t)=>(await t.credentialStore.deleteCredentials(),await t.credentialStore.deleteProjectContext(),t.schemaManager.clear(),t.ok(void 0,"Logged out")),V5=async(e,t)=>{let r=await Ly(t.credentialStore);return r?t.ok(r):t.fail(new Error(Ia))},G5=async(e,t)=>t.ok(VR(await t.client.request(G0))),$R={"auth.login":F5,"auth.reauth":q5,"auth.logout":U5,"auth.whoami":V5,"account.profile":G5};p();p();import{spawn as $5}from"child_process";var BR=18e4,Al=Math.floor(BR/1e3),B5=BR+5e3,KR=()=>(process.env.MCP_HITL??"").trim().toLowerCase()==="off";function gn(e,t){return new Promise(r=>{let n="",i="",o=!1,s=$5(e,t,{stdio:["ignore","pipe","pipe"]}),a=setTimeout(()=>{o||(s.kill("SIGKILL"),o=!0,r({code:null,stdout:n,stderr:i,timedOut:!0}))},B5);a.unref(),s.stdout?.on("data",u=>{n+=u.toString()}),s.stderr?.on("data",u=>{i+=u.toString()}),s.on("error",u=>{o||(o=!0,clearTimeout(a),r({code:null,stdout:n,stderr:i,spawnError:u}))}),s.on("close",u=>{o||(o=!0,clearTimeout(a),r({code:u,stdout:n,stderr:i}))})})}async function K5(e,t){let n=["on run argv","set pid to item 1 of argv","set verb to item 2 of argv",'set msg to "This will " & verb & " project " & pid & "." & return & "This action is IRREVERSIBLE." & return & return & "Type the project id to confirm:"',"try",`set dlg to display dialog msg with title "Human approval required" default answer "" buttons {"Cancel", "Confirm"} default button "Cancel" cancel button "Cancel" with icon caution giving up after ${Al}`,"on error number -128",'return "__CANCELLED__"',"end try",'if (gave up of dlg) then return "__CANCELLED__"',"return text returned of dlg","end run"].flatMap(s=>["-e",s]);n.push(e,t);let i=await gn("osascript",n);if(i.spawnError)return"unavailable";if(i.timedOut)return"denied";if(i.code!==0)return"unavailable";let o=i.stdout.trim();return o==="__CANCELLED__"?"denied":o===e?"approved":"denied"}async function H5(e,t){if(!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)return"unavailable";let r=`This will ${t} project ${e}.
|
|
1339
1336
|
This action is IRREVERSIBLE.
|
|
1340
1337
|
|
|
1341
|
-
Type the project id to confirm:`,n=await
|
|
1338
|
+
Type the project id to confirm:`,n=await gn("zenity",["--entry","--title=Human approval required",`--text=${r}`,`--timeout=${Al}`]);if(!n.spawnError)return n.timedOut?"denied":n.code===0&&n.stdout.trim()===e?"approved":"denied";let i=await gn("kdialog",["--title","Human approval required","--inputbox",r,""]);return i.spawnError?"unavailable":i.timedOut?"denied":i.code===0&&i.stdout.trim()===e?"approved":"denied"}async function Q5(e,t){let r=`This will ${t} project ${e}. This action is IRREVERSIBLE.
|
|
1342
1339
|
|
|
1343
|
-
Type the project id to confirm:`,i=`Add-Type -AssemblyName Microsoft.VisualBasic;$r=[Microsoft.VisualBasic.Interaction]::InputBox('${(s=>s.replace(/'/g,"''"))(r)}','Human approval required','');Write-Output $r`,o=await mn("powershell",["-NoProfile","-NonInteractive","-Command",i]);return o.spawnError?"unavailable":o.timedOut?"denied":o.code!==0?"unavailable":o.stdout.trim()===e?"approved":"denied"}async function U5(e,t){switch(process.platform){case"darwin":return M5(e,t);case"linux":return F5(e,t);case"win32":return q5(e,t);default:return"unavailable"}}async function da(e,t,r,n={}){if(UR()){NR(e,t,r,n.allowForce??!0);return}let i=await U5(e,r);if(i==="approved"){zl("notice",`Human approved ${r} of project ${e}`);return}throw i==="unavailable"?new Error(`${r} requires human approval via a GUI dialog, but no dialog could be shown on this host (headless/SSH/CI). Set MCP_HITL=off to bypass with the confirmProjectExId/force text gate.`):new Error(`${r} was not approved: the confirmation dialog was cancelled or the project id was not entered correctly.`)}var Tl=e=>e.replace(/\r?\n$/,"");async function V5(e){let r=["on run argv","set lbl to item 1 of argv",'set msg to "Enter the value for secret " & quote & lbl & quote & ":"',"try",`set dlg to display dialog msg with title "Set secret value" default answer "" with hidden answer buttons {"Cancel", "Save"} default button "Save" cancel button "Cancel" with icon note giving up after ${Il}`,"on error number -128",'return "__CANCELLED__"',"end try",'if (gave up of dlg) then return "__CANCELLED__"',"return text returned of dlg","end run"].flatMap(o=>["-e",o]);r.push(e);let n=await mn("osascript",r);if(n.spawnError||n.code!==0)return{ok:!1,reason:"unavailable"};if(n.timedOut)return{ok:!1,reason:"cancelled"};let i=Tl(n.stdout);return i==="__CANCELLED__"?{ok:!1,reason:"cancelled"}:{ok:!0,value:i}}async function G5(e){if(!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)return{ok:!1,reason:"unavailable"};let t=`Enter the value for secret "${e}":`,r=await mn("zenity",["--entry","--hide-text","--title=Set secret value",`--text=${t}`,`--timeout=${Il}`]);if(!r.spawnError)return r.timedOut?{ok:!1,reason:"cancelled"}:r.code===0?{ok:!0,value:Tl(r.stdout)}:{ok:!1,reason:"cancelled"};let n=await mn("kdialog",["--title","Set secret value","--password",t]);return n.spawnError?{ok:!1,reason:"unavailable"}:n.timedOut?{ok:!1,reason:"cancelled"}:n.code===0?{ok:!0,value:Tl(n.stdout)}:{ok:!1,reason:"cancelled"}}async function B5(e){let t=s=>s.replace(/'/g,"''"),r=`Enter the value for secret "${e}":`,n=["Add-Type -AssemblyName System.Windows.Forms;","Add-Type -AssemblyName System.Drawing;","$f=New-Object System.Windows.Forms.Form;$f.Text='Set secret value';$f.Width=440;$f.Height=180;$f.StartPosition='CenterScreen';$f.TopMost=$true;",`$l=New-Object System.Windows.Forms.Label;$l.Text='${t(r)}';$l.AutoSize=$true;$l.Top=15;$l.Left=15;$f.Controls.Add($l);`,"$t=New-Object System.Windows.Forms.TextBox;$t.UseSystemPasswordChar=$true;$t.Width=400;$t.Top=45;$t.Left=15;$f.Controls.Add($t);","$ok=New-Object System.Windows.Forms.Button;$ok.Text='Save';$ok.Top=90;$ok.Left=235;$ok.DialogResult=[System.Windows.Forms.DialogResult]::OK;$f.Controls.Add($ok);$f.AcceptButton=$ok;","$cn=New-Object System.Windows.Forms.Button;$cn.Text='Cancel';$cn.Top=90;$cn.Left=325;$cn.DialogResult=[System.Windows.Forms.DialogResult]::Cancel;$f.Controls.Add($cn);$f.CancelButton=$cn;",'$r=$f.ShowDialog();if($r -eq [System.Windows.Forms.DialogResult]::OK){Write-Output $t.Text}else{Write-Output "__CANCELLED__"}'].join(""),i=await mn("powershell",["-NoProfile","-NonInteractive","-STA","-Command",n]);if(i.spawnError||i.code!==0)return{ok:!1,reason:"unavailable"};if(i.timedOut)return{ok:!1,reason:"cancelled"};let o=Tl(i.stdout);return o==="__CANCELLED__"?{ok:!1,reason:"cancelled"}:{ok:!0,value:o}}async function VR(e){if(UR())throw new Error("Setting a secret value needs a native GUI dialog so the value stays off the tool call, but MCP_HITL=off. Run without MCP_HITL=off on a machine with a desktop session.");let t;switch(process.platform){case"darwin":t=await V5(e);break;case"linux":t=await G5(e);break;case"win32":t=await B5(e);break;default:t={ok:!1,reason:"unavailable"}}if(t.ok){if(!t.value)throw new Error("No secret value was entered.");return zl("notice",`Human entered a value for secret "${e}"`),t.value}throw t.reason==="unavailable"?new Error("Setting a secret value requires a native GUI dialog, but none could be shown on this host (headless/SSH/CI)."):new Error("Setting the secret value was cancelled.")}var GR=async(e,t)=>{let n=(await t.client.request(kc,{projectName:H(e.projectName)??"",paginator:{after:le(e.cursor),first:Ye(e.limit,20)}})).fuzzySearchProjectName,i=(n?.edges??[]).map(a=>a?.node).filter(a=>a!=null).map(a=>({exId:a.exId,projectName:a.projectName,updatedAt:a.updatedAt,hasPublished:a.hasPublished,webProdDomain:a.webProdDomain})),o=n?.pageInfo,s=o?.hasNextPage?o.endCursor?.value??null:null;return t.ok({projects:i,nextCursor:s})},BR=()=>_n==="ZION",$5=["WEB","WECHAT_MINI_PROGRAM","MOBILE","BACKEND_ONLY"],K5={WEB:"Web",WECHAT_MINI_PROGRAM:"WeChat mini program",MOBILE:"App"},H5="WEB, WECHAT_MINI_PROGRAM and MOBILE each create a client this project hosts \u2014 build its pages as component trees with these tools, or deploy your own build to a WEB client; BACKEND_ONLY creates no client, for a front end hosted elsewhere that calls the project's auto-generated GraphQL API",Q5=e=>{let t=H(e.appType);if(t==="WECHAT_MINI_PROGRAM"&&!BR())throw new Error("appType WECHAT_MINI_PROGRAM is a Zion-only client type and cannot be created here");let r=$5.filter(n=>n!=="WECHAT_MINI_PROGRAM"||BR());if(!t||!r.some(n=>n===t))throw new Error(`appType is required and must be one of ${r.join(", ")} \u2014 ${H5}.`);return t},W5=(e,t)=>({appName:H(e.appName)??K5[t],appType:t,source:{type:"BLANK"}}),z5=async(e,t)=>{let r=H(e.projectName)??H(e.name);if(!r)throw new Error("projectName is required");let n=Q5(e),i=await AR(t.client,e),s=(await t.client.request(F0,{createProjectDetail:{explicitBuiltInClientApp:!0,projectName:r,organizationExId:i.organizationExId,projectSpaceType:i.projectSpaceType,category:le(e.category),source:{type:"BLANK"},...n!=="BACKEND_ONLY"&&{builtInClientApp:W5(e,n)}}})).createMultiClientProjectAsync;if(!s)throw new Error("Project creation failed: taskId is missing");let u=Ve(e.wait,!0)?await xR(t.client,r,Ye(e.timeoutMs,12e4)):null,c=null;if(u?.exId){let l=String(u.exId);n!=="BACKEND_ONLY"&&(c=(await ni(t.client,l))[0]??null),await t.credentialStore.saveProjectContext(l,c?.appExId??null),await _y(t.client,l,t.codingAgent,t.hostSessionId)}return t.ok({taskId:s,project:u,builtInApp:c,projectSpace:i})},Y5=async(e,t)=>{let r=H(e.projectExId);if(!r)throw new Error("projectExId is required");let n=H(e.appExId),i=e.appExId===null,o=n||i?[]:await ni(t.client,r);if(o.length>1)throw new Error(`Project ${r} has ${o.length} client apps, so the current client cannot be resolved: ${o.map(a=>`${a.appExId} (${a.appType})`).join(", ")}. Pages and components belong to one client, so call this again with appExId set to the one to work on, or with appExId: null to address the project's backend document alone. The current project is left as it was.`);let s=n??go(o);return await t.credentialStore.saveProjectContext(r,s),await _y(t.client,r,t.codingAgent,t.hostSessionId),t.ok({projectExId:r,appExId:s},s?`Current project set to ${r}, current client ${s}`:`Current project set to ${r} (no client; calls address its backend document)`)},J5=async(e,t)=>t.ok(await t.credentialStore.loadProjectContext()),X5=async(e,t)=>{let r=await t.getProjectLevelArgs(e),n=await t.client.request(Wn,r);return t.ok(Ny(Sl(n,DR),e))},Z5=async(e,t)=>{let r=await t.getProjectLevelArgs(e),n=await t.client.request(Mc,r);return Ve(e.raw,!1)?t.ok(Ny(n,e)):t.ok(LR(n))},e3=async(e,t)=>{let r=await t.getProjectArgs(e),n=H(e.projectName)??H(e.name);if(!n)throw new Error("projectName is required");return t.ok(await t.client.request(U0,{projectExId:r.projectExId,projectName:n}))},t3=async(e,t)=>{let r=await t.getProjectArgs(e),n=H(e.appExId),i=H(e.appName)??H(e.name);if(!n)throw new Error("appExId is required");if(!i)throw new Error("appName is required");return t.ok(await t.client.request(V0,{projectExId:r.projectExId,appExId:n,appName:i}))},r3=async(e,t)=>{let r=await t.getProjectArgs(e);await da(r.projectExId,e,"delete");let n=await t.client.request(G0,{projectExId:r.projectExId});return(await t.credentialStore.loadProjectContext())?.projectExId===r.projectExId&&await t.credentialStore.deleteProjectContext(),t.schemaManager.clear(),t.ok(n)},n3=async(e,t)=>{let r=await t.getProjectArgs(e);await da(r.projectExId,e,"reset");let n=H(e.languageType)??"EN";return t.ok(await t.client.request(B0,{projectExId:r.projectExId,languageType:n}))},i3=async(e,t)=>{let r=await t.getProjectArgs(e);Ve(e.refresh,!1)&&await t.client.request(Z0,{projectExId:r.projectExId});let n=H(e.resourceType),[i,o,s,a]=await Promise.all([t.client.request(X0,{projectExId:r.projectExId,nonRealTimeDisplayedResourceTypes:ii(e.nonRealTimeDisplayedResourceTypes)}),t.client.request(rA,{projectExId:r.projectExId}).catch(l=>({error:l instanceof Error?l.message:String(l)})),n?t.client.request(eA,{projectExId:r.projectExId,resourceType:n}):Promise.resolve(null),n?t.client.request(tA,{projectExId:r.projectExId,resourceType:n}):Promise.resolve(null)]),u=o&&"findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch"in o?o.findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch:null,c={usage:kR(i.resourceUsageAndBurstInfo)};return u&&u.length>0&&(c.singleTenant=u),s?.monthlyResourceUsageHistory!=null&&(c.monthly=s.monthlyResourceUsageHistory),a?.dailyResourceUsageHistory!=null&&(c.daily=a.dailyResourceUsageHistory),t.ok(c)},$R={"projects.search":GR,"projects.list":GR,"project.create":z5,"project.set_current":Y5,"project.get_current":J5,"project.detail":X5,"project.metadata":Z5,"project.rename":e3,"project.rename_app":t3,"project.delete":r3,"project.reset":n3,"project.resources":i3};p();async function Ol(e,t){let r=await t.checkSchema(e),n=await t.getProjectArgs(e);return{warning:r,projectArgs:n,sArgs:nr(n.projectExId,n)}}var _o=e=>async(t,r)=>{let{warning:n,sArgs:i}=await Ol(t,r);return r.ok(Nt(await e(r.schemaManager,i),n))},o3=_o((e,t)=>e.load(t)),s3=_o((e,t)=>e.load(t,!0)),a3=async(e,t)=>{let r=H(e.projectExId)?await t.checkSchema(e):null;return t.ok(Nt(t.schemaManager.status(),r))},u3=async(e,t)=>t.ok(t.schemaManager.schemaState(H(e.projectExId))),c3=async(e,t)=>t.ok(t.schemaManager.schemaEvents(H(e.projectExId),le(e.afterEventId),Ye(e.limit,100))),l3=_o((e,t)=>e.sync(t)),p3=async(e,t)=>{let{warning:r,sArgs:n}=await Ol(e,t),i=await t.schemaManager.snapshot(n,Ve(e.full,!1));return t.ok(Nt(i,r))},d3=_o((e,t)=>e.validate(t)),f3=_o((e,t)=>e.undo(t)),h3=_o((e,t)=>e.redo(t)),Py=async(e,t)=>{let{warning:r,projectArgs:n,sArgs:i}=await Ol(e,t),o=await t.schemaManager.load(i),s=Oy(o,n.appExId??null);if(!s.ok)return{ok:!1,error:s.error,data:Nt({status:o},r)};let a=await t.schemaManager.validate(i),u=fl(a);if(u.length>0&&!Ve(e.allowValidationErrors,!1))return{ok:!1,error:"ztype backend validation errors block backend sync",data:Nt({ztypeDiagnostics:a,backendErrors:u},r)};let c=await t.schemaManager.save(i),l=Oy(c,n.appExId??null);if(!l.ok)throw new Error(`schema.save: ${l.error}`);let d=c.serverDoc??null,f=l.schemaExId,h=l.appExId,g=Ve(e.validateMultiClient,!1)&&!!d,v=Ve(e.validateMultiClient,!1)&&!d?await t.client.request(J0,{projectExId:n.projectExId,appExId:h,schemaExId:f}):await t.client.request(Y0,{projectExId:n.projectExId,appExId:h,schemaExId:f,buildTarget:H(e.buildTarget)??"SUPPORT_SERVICE"});return t.ok(Nt({saved:c,deploy:v,ztypeDiagnostics:a,...g?{multiClientValidationSkipped:!0}:{}},r))},m3=async(e,t)=>{let{warning:r,sArgs:n}=await Ol(e,t),i=Array.isArray(e.toolCalls)?e.toolCalls:[];if(i.length===0)throw new Error("toolCalls must be a non-empty array");let o=Ve(e.verbose,!1),s=await t.schemaManager.ztypeToolCalls(n,i,o,e.readState??null,Ve(e.force,!1),e.projectCapabilities??null);return t.ok(Nt(s,r))},KR={"schema.load":o3,"schema.reload":s3,"schema.status":a3,"schema.state":u3,"schema.events":c3,"schema.sync":l3,"schema.snapshot":p3,"schema.validate":d3,"project.sync_backend":Py,"schema.ztype_tool_calls":m3,"schema.undo":f3,"schema.redo":h3};p();p();var Ht=e=>Array.isArray(e)?e:[],Ly=e=>Fe(Fe(e).server),g3=e=>{for(let t of e){let r=Fe(t);if(r.type==="FLOW_END"&&r.removable!==!0)return le(r.uniqueId)}return null},HR=(e,t)=>{let n=Ht(Ly(e).actionFlows).find(s=>Fe(s).uniqueId===t);if(!n)throw new Error(`No action flow with id ${t}. Check the id with project.inspect.`);let i=Fe(n),o=g3(Ht(i.allNodes));if(!o)throw new Error(`Action flow ${t} has no terminal end node, so it cannot be debugged.`);return{definition:i,endNodeId:o,displayName:le(i.displayName),isAsync:i.isAsync===!0}},ky=50,y3=e=>{for(let t=0;t<e.length-1;t++)if(e[t].key==="componentById")return le(e[t+1].key);return null},QR=(e,t=ky)=>{let r=Fe(e);if(r.available===!1)return{count:0,errors:[],unavailable:!0};let n=[...Ht(r.stableErrors),...Ht(r.betaErrors)].map(Fe),i=n.slice(0,t).map(s=>{let a=Ht(s.fullPath).map(Fe),u={message:le(s.message)??"",path:a},c=le(s.platform);c&&(u.platform=c);let l=y3(a)??le(s.componentId);return l&&(u.componentId=l),u}),o={count:n.length,errors:i};return n.length>i.length&&(o.truncated=!0),o},v3=e=>{let t=Fe(e);if(!(e===void 0||t.available===!1))return Ht(t.stableErrors).length+Ht(t.betaErrors).length},WR=(e,t,r,n)=>{let i=v3(Fe(t).ztypeDiagnostics),o=e?n===null?{status:"IN_PROGRESS",message:"The backend sync has not finished yet. Call sync_backend again to keep waiting for it."}:n==="FINISHED"?{status:"SYNCED",message:"The backend is synced: the saved schema is live on the project runtime."}:{status:"FAILED",message:"The backend sync failed. Inspect the project errors and the DEPLOYMENT logs for the cause, fix it, and sync again."}:{status:"FAILED",message:r??"The backend sync was refused and reported no reason."};return i!==void 0&&(o.projectErrorCount=i),o},E3=e=>{let t=new Map;for(let r of Ht(e.actionFlows)){let n=Fe(r),i=le(n.uniqueId),o=le(n.displayName);i&&o&&t.set(i,o)}return t},_3=e=>{let t=new Map;for(let r of Ht(Fe(e.dataModel).tables)){let n=Fe(r),i=le(n.uniqueId)??le(n.id),o=le(n.name);i&&o&&t.set(i,o)}return t},zR=e=>{let t=Ly(e),r=E3(t),n=_3(t),i=Ht(t.triggerConfigurations).map(s=>{let a=Fe(s),u=le(a.tableId);return{triggerId:le(a.uniqueId),displayName:le(a.displayName),enabled:a.enabled===!0,tableName:u?n.get(u)??null:null,operation:le(Fe(a.trigger).dbOperationType),flowNames:Ht(a.actions).map(c=>le(Fe(c).actionFlowUniqueId)).filter(c=>!!c).map(c=>r.get(c)).filter(c=>!!c)}}),o=Ht(t.scheduledJobConfigurations).map(s=>{let a=Fe(s),u=le(Fe(a.action).actionFlowUniqueId);return{triggerId:le(a.uniqueId),name:le(a.name),enabled:a.enabled!==!1,cron:le(a.cron),flowName:u?r.get(u)??null:null}});return{dbTriggers:i,scheduledTriggers:o}},b3=["dataModel","actionFlows","callbackConfigurations","scheduledJobConfigurations","triggerConfigurations","apiWorkSpaces","zAiConfigs","roleConfigs","authenticationConfig","secretConfigs"],Dy=(e,t)=>{if(e===t)return!0;if(e==null)return t==null;if(t==null)return!1;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((r,n)=>Dy(r,t[n]));if(typeof e=="object"&&typeof t=="object"){let r=e,n=t,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let o of i)if(!Dy(r[o],n[o]))return!1;return!0}return!1},YR=(e,t)=>{if(t==null)return{hasPendingChanges:!1,changedAreas:[],known:!1};let r=Ly(e),n=Fe(t),i=b3.filter(o=>!Dy(r[o],n[o]));return{hasPendingChanges:i.length>0,changedAreas:[...i],known:!0}};p();import{execSync as S3}from"node:child_process";import{createRequire as T3}from"node:module";import I3 from"node:path";var JR=18e4,O3=15e3,w3=3e4,XR=["--js-flags=--max-old-space-size=1024","--renderer-process-limit=1"],A3=async()=>{try{return await import("playwright")}catch{let e=S3("npm root -g").toString().trim();return T3(I3.join(e,"noop.js"))("playwright")}},jy=class{browser=null;context=null;page=null;loadedFor=null;loadedWithPatches=new Set;queue=Promise.resolve();run(t,r){let n=this.queue.then(()=>this.runNow(t,r));return this.queue=n.catch(()=>{}),n}async close(){await this.browser?.close().catch(()=>{}),this.browser=null,this.context=null,this.page=null,this.loadedFor=null}async runNow(t,r){let n=await this.pageFor(t,r);if(!await n.evaluate(()=>globalThis.__ZION_AGENT_CANVAS__.isInSync()).catch(()=>!1))n=await this.load(t,r);else for(let o of r.lastPatchExIds)if(!this.loadedWithPatches.has(o)&&!await this.waitForPatch(n,o)){n=await this.load(t,r);break}return r.pageId&&(await n.evaluate(({pageId:o,breakpoint:s})=>globalThis.__ZION_AGENT_CANVAS__.focus(o,s),{pageId:r.pageId,breakpoint:r.breakpoint}),await n.waitForFunction(({pageId:o,breakpoint:s})=>globalThis.__ZION_AGENT_CANVAS__.isFocused(o,s),{pageId:r.pageId,breakpoint:r.breakpoint},{timeout:w3})),n.evaluate(({rpc:o,args:s,sessionExId:a})=>globalThis.__ZION_AGENT_CANVAS__.dispatch(o,s,a),{rpc:r.rpc,args:r.args,sessionExId:r.sessionExId})}async pageFor(t,r){let n=`${t.projectExId}/${t.appExId}`;return this.page&&!this.page.isClosed()&&this.browser?.isConnected()&&this.loadedFor===n?this.page:this.load(t,r)}async waitForPatch(t,r){try{return await t.waitForFunction(n=>globalThis.__ZION_AGENT_CANVAS__.hasAppliedPatch(n),r,{timeout:O3}),!0}catch{return!1}}async load(t,r){let n=Rt().editorBaseUrl;if(!this.browser?.isConnected()||!this.context){await this.close();let{chromium:o}=await A3(),s=process.env.EDITOR_HOST_RESOLVER_RULES;this.browser=await o.launch({headless:!0,args:s?[...XR,`--host-resolver-rules=${s}`]:XR}),this.context=await this.browser.newContext({viewport:{width:1280,height:800}})}await this.context.addCookies([{name:"loggedInUserStorageKey",value:encodeURIComponent(JSON.stringify({exId:t.user.exId,username:t.user.username,token:t.token,roleNames:[],registeredWithInLastMinute:!1})),url:n}]),(!this.page||this.page.isClosed())&&(this.page=await this.context.newPage());let i=new URLSearchParams({mode:"AGENT_CANVAS",leftSideTab:"page"});return r.pageId&&i.set("componentId",r.pageId),r.breakpoint&&i.set("breakpoint",r.breakpoint),this.loadedWithPatches=new Set(r.lastPatchExIds),this.loadedFor=null,await this.page.goto(`${n}/multi-client/tool/${t.projectExId}/${t.appExId}/design?${i}`,{waitUntil:"domcontentloaded",timeout:JR}),await this.page.waitForFunction(()=>!!globalThis.__ZION_AGENT_CANVAS__&&!!globalThis.document.querySelector("#canvas-viewport [data-meta-id]"),void 0,{timeout:JR}),this.loadedFor=`${t.projectExId}/${t.appExId}`,this.page}},ZR=new jy;var wl=async(e,t)=>{let r=await t.getProjectArgs(e),n=nr(r.projectExId,r);return await t.schemaManager.load(n),{projectArgs:r,sArgs:n,snapshot:await t.schemaManager.snapshot(n,!0)}},x3=async(e,t)=>{let r=H(e.flowId);if(!r)return t.fail(new Error("Provide a 'flowId'."));let{snapshot:n}=await wl(e,t);return t.ok(HR(n,r))},N3=async(e,t)=>{let{snapshot:r}=await wl(e,t);return t.ok(zR(r))},R3=async(e,t)=>{let{projectArgs:r,snapshot:n}=await wl(e,t),i=await t.client.request(bA,{projectExId:r.projectExId});return t.ok(YR(n,i?.project?.lastDeployedServerSchema??null))},C3=async(e,t)=>{let{sArgs:r}=await wl(e,t);return t.ok(QR(await t.schemaManager.validate(r),Ye(e.limit,ky)))},P3=9e4,D3=2e3,eC=async(e,t)=>(await e.client.request(_A,{projectExId:t})).project?.lastAllPipelinePlatformStatus.find(n=>n.buildTarget==="SUPPORT_SERVICE")??null,L3=async(e,t,r,n)=>{for(;;){let i=await eC(e,t);if(i&&i.status!=="DEPLOYING"&&n(i))return i.status;if(Date.now()>=r)return null;await new Promise(o=>setTimeout(o,D3))}},k3=async(e,t)=>{let r=Date.now()+P3,{projectExId:n}=await t.getProjectArgs(e),i=await eC(t,n),o=i?.status==="DEPLOYING",s=o?t.ok():await Py(e,t),a=s.ok?await L3(t,n,r,u=>o||u.startedAt!==i?.startedAt):null;return t.ok(WR(s.ok,s.data,s.error??null,a))},j3=async(e,t)=>{if(e.appExId)return e.appExId;let r=await ni(t.client,e.projectExId);if(r.length===0)throw new Error("The project has no client app, so there is no canvas to render.");let n=go(r);if(!n)throw new Error(`Pass appExId: the project has ${r.length} client apps (${r.map(i=>i.appExId).join(", ")}), so the canvas to render is ambiguous.`);return n},tC=async(e,t,r,n)=>{let i=await n.getProjectArgs(r),o=nr(i.projectExId,i),s=await j3(i,n),a=await n.client.request(jc);if(!a?.user?.exId)throw new Error("Could not resolve the signed-in account to render the canvas as.");return ZR.run({projectExId:i.projectExId,appExId:s,token:await n.tokenManager.getValidToken(),user:{exId:a.user.exId,username:a.user.username??null}},{rpc:e,args:t,sessionExId:H(r.sessionExId)??"",pageId:H(r.pageId)??null,breakpoint:H(r.breakpoint)??null,lastPatchExIds:await n.schemaManager.lastPatchExIds(o)})},M3=["pageId","componentId","mode","breakpoint","maxWidth","limit"],rC=e=>Object.fromEntries(M3.filter(t=>e[t]!==void 0).map(t=>[t,e[t]])),F3=async(e,t)=>t.ok(await tC("editor.getClippedComponents",rC(e),e,t)),q3=async(e,t)=>H(e.sessionExId)?t.ok(await tC("editor.captureCanvas",rC(e),e,t)):t.fail(new Error("Provide 'sessionExId': the capture is stored as that agent session's media.")),nC={"bridge.flow_definition":x3,"bridge.trigger_bindings":N3,"bridge.deploy_status":R3,"bridge.project_errors":C3,"bridge.sync_backend":k3,"bridge.clipped_components":F3,"bridge.capture_canvas":q3};p();p();var U3=/Subselection required for type '(FZ_\w+)' of field '([^'/]+\/)?([^']+)'/,V3=/Unknown field argument '(where|limit|offset|order_by)'/,G3=/Field '([^']+)' in type '([^']+)' is undefined/,B3=/field name '([^']+)' that is not defined for input object type '(\w+)'/,$3=(e,t)=>{let r=Array.from({length:t.length+1},(n,i)=>i);for(let n=1;n<=e.length;n+=1){let i=[n];for(let o=1;o<=t.length;o+=1)i[o]=Math.min(r[o]+1,i[o-1]+1,r[o-1]+(e[n-1]===t[o-1]?0:1));r=i}return r[t.length]},oC=(e,t)=>{let r=Math.max(2,Math.ceil(t.length/2));return e.map(n=>({name:n,score:$3(n.toLowerCase(),t.toLowerCase())})).filter(n=>n.score<=r).sort((n,i)=>n.score-i.score).slice(0,3).map(n=>n.name)},K3=e=>(e?.tableMetadata??[]).flatMap(t=>[t?.name,t?.displayName].filter(r=>typeof r=="string"&&r.length>0)),Al=(e,t)=>(e?.tableMetadata??[]).find(r=>r?.name===t),iC=(e,t)=>{let r=t?.columnMetadata??[],n=r.find(o=>o?.displayName===e&&o?.name);if(n){let o=bl(n)??n.name;return`'${e}' is a column DISPLAY name, which the runtime never accepts \u2014 pass '${o}'.`}if(r.some(o=>o?.name===e))return`'${e}' is in the project schema but not in the deployed backend. Run 'project sync-backend', then retry.`;let i=oC(r.flatMap(o=>[o?.name,o?.displayName]).filter(o=>typeof o=="string"&&o.length>0),e);return i.length>0?`No column '${e}'. Closest: ${i.join(", ")}.`:`No column '${e}' on this table.`},H3=(e,t,r)=>{let n=U3.exec(e);if(n){let c=n[3];return`'${c}' is a media column \u2014 the runtime takes the asset id as '${c}_id', the only form it filters, sorts or writes. Read the asset's url or metadata with runtime graphql instead: ${c} { id url }.`}if(V3.test(e))return`'${t}' exists in the runtime but is not a table collection \u2014 it takes no where/limit/order_by. Query it with runtime graphql instead.`;let i=B3.exec(e);if(i)return iC(i[1],Al(r,t));let o=G3.exec(e);if(!o)return null;let[,s,a]=o;if(a!=="Query"&&a!=="Mutation")return iC(s,Al(r,t));if(Al(r,t))return`'${t}' is in the project schema but not in the deployed backend. Run 'project sync-backend', then retry \u2014 every runtime call hits the deployed app, never the draft.`;let u=oC(K3(r),t);return u.length>0?`No table '${t}' in the project schema. Closest: ${u.join(", ")}.`:`No table '${t}' in the project schema \u2014 'schema snapshot' lists the ones there are.`},sC=(e,t,r)=>{let n=e instanceof Error?e.message:String(e),i=H3(n,t,r);return i?e instanceof Error?(e.runtimeDiagnosis=i,e):new Error(`${n}
|
|
1344
|
-
${i}`):e},
|
|
1345
|
-
`)},
|
|
1340
|
+
Type the project id to confirm:`,i=`Add-Type -AssemblyName Microsoft.VisualBasic;$r=[Microsoft.VisualBasic.Interaction]::InputBox('${(s=>s.replace(/'/g,"''"))(r)}','Human approval required','');Write-Output $r`,o=await gn("powershell",["-NoProfile","-NonInteractive","-Command",i]);return o.spawnError?"unavailable":o.timedOut?"denied":o.code!==0?"unavailable":o.stdout.trim()===e?"approved":"denied"}async function W5(e,t){switch(process.platform){case"darwin":return K5(e,t);case"linux":return H5(e,t);case"win32":return Q5(e,t);default:return"unavailable"}}async function fa(e,t,r,n={}){if(KR()){LR(e,t,r,n.allowForce??!0);return}let i=await W5(e,r);if(i==="approved"){Xl("notice",`Human approved ${r} of project ${e}`);return}throw i==="unavailable"?new Error(`${r} requires human approval via a GUI dialog, but no dialog could be shown on this host (headless/SSH/CI). Set MCP_HITL=off to bypass with the confirmProjectExId/force text gate.`):new Error(`${r} was not approved: the confirmation dialog was cancelled or the project id was not entered correctly.`)}var Ol=e=>e.replace(/\r?\n$/,"");async function z5(e){let r=["on run argv","set lbl to item 1 of argv",'set msg to "Enter the value for secret " & quote & lbl & quote & ":"',"try",`set dlg to display dialog msg with title "Set secret value" default answer "" with hidden answer buttons {"Cancel", "Save"} default button "Save" cancel button "Cancel" with icon note giving up after ${Al}`,"on error number -128",'return "__CANCELLED__"',"end try",'if (gave up of dlg) then return "__CANCELLED__"',"return text returned of dlg","end run"].flatMap(o=>["-e",o]);r.push(e);let n=await gn("osascript",r);if(n.spawnError||n.code!==0)return{ok:!1,reason:"unavailable"};if(n.timedOut)return{ok:!1,reason:"cancelled"};let i=Ol(n.stdout);return i==="__CANCELLED__"?{ok:!1,reason:"cancelled"}:{ok:!0,value:i}}async function Y5(e){if(!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY)return{ok:!1,reason:"unavailable"};let t=`Enter the value for secret "${e}":`,r=await gn("zenity",["--entry","--hide-text","--title=Set secret value",`--text=${t}`,`--timeout=${Al}`]);if(!r.spawnError)return r.timedOut?{ok:!1,reason:"cancelled"}:r.code===0?{ok:!0,value:Ol(r.stdout)}:{ok:!1,reason:"cancelled"};let n=await gn("kdialog",["--title","Set secret value","--password",t]);return n.spawnError?{ok:!1,reason:"unavailable"}:n.timedOut?{ok:!1,reason:"cancelled"}:n.code===0?{ok:!0,value:Ol(n.stdout)}:{ok:!1,reason:"cancelled"}}async function J5(e){let t=s=>s.replace(/'/g,"''"),r=`Enter the value for secret "${e}":`,n=["Add-Type -AssemblyName System.Windows.Forms;","Add-Type -AssemblyName System.Drawing;","$f=New-Object System.Windows.Forms.Form;$f.Text='Set secret value';$f.Width=440;$f.Height=180;$f.StartPosition='CenterScreen';$f.TopMost=$true;",`$l=New-Object System.Windows.Forms.Label;$l.Text='${t(r)}';$l.AutoSize=$true;$l.Top=15;$l.Left=15;$f.Controls.Add($l);`,"$t=New-Object System.Windows.Forms.TextBox;$t.UseSystemPasswordChar=$true;$t.Width=400;$t.Top=45;$t.Left=15;$f.Controls.Add($t);","$ok=New-Object System.Windows.Forms.Button;$ok.Text='Save';$ok.Top=90;$ok.Left=235;$ok.DialogResult=[System.Windows.Forms.DialogResult]::OK;$f.Controls.Add($ok);$f.AcceptButton=$ok;","$cn=New-Object System.Windows.Forms.Button;$cn.Text='Cancel';$cn.Top=90;$cn.Left=325;$cn.DialogResult=[System.Windows.Forms.DialogResult]::Cancel;$f.Controls.Add($cn);$f.CancelButton=$cn;",'$r=$f.ShowDialog();if($r -eq [System.Windows.Forms.DialogResult]::OK){Write-Output $t.Text}else{Write-Output "__CANCELLED__"}'].join(""),i=await gn("powershell",["-NoProfile","-NonInteractive","-STA","-Command",n]);if(i.spawnError||i.code!==0)return{ok:!1,reason:"unavailable"};if(i.timedOut)return{ok:!1,reason:"cancelled"};let o=Ol(i.stdout);return o==="__CANCELLED__"?{ok:!1,reason:"cancelled"}:{ok:!0,value:o}}async function HR(e){if(KR())throw new Error("Setting a secret value needs a native GUI dialog so the value stays off the tool call, but MCP_HITL=off. Run without MCP_HITL=off on a machine with a desktop session.");let t;switch(process.platform){case"darwin":t=await z5(e);break;case"linux":t=await Y5(e);break;case"win32":t=await J5(e);break;default:t={ok:!1,reason:"unavailable"}}if(t.ok){if(!t.value)throw new Error("No secret value was entered.");return Xl("notice",`Human entered a value for secret "${e}"`),t.value}throw t.reason==="unavailable"?new Error("Setting a secret value requires a native GUI dialog, but none could be shown on this host (headless/SSH/CI)."):new Error("Setting the secret value was cancelled.")}var QR=async(e,t)=>{let n=(await t.client.request(Mc,{projectName:H(e.projectName)??"",paginator:{after:le(e.cursor),first:Ye(e.limit,20)}})).fuzzySearchProjectName,i=(n?.edges??[]).map(a=>a?.node).filter(a=>a!=null).map(a=>({exId:a.exId,projectName:a.projectName,updatedAt:a.updatedAt,hasPublished:a.hasPublished,webProdDomain:a.webProdDomain})),o=n?.pageInfo,s=o?.hasNextPage?o.endCursor?.value??null:null;return t.ok({projects:i,nextCursor:s})},WR=()=>bn==="ZION",X5=["WEB","WECHAT_MINI_PROGRAM","MOBILE","BACKEND_ONLY"],Z5={WEB:"Web",WECHAT_MINI_PROGRAM:"WeChat mini program",MOBILE:"App"},e3="WEB, WECHAT_MINI_PROGRAM and MOBILE each create a client this project hosts \u2014 build its pages as component trees with these tools, or deploy your own build to a WEB client; BACKEND_ONLY creates no client, for a front end hosted elsewhere that calls the project's auto-generated GraphQL API",t3=e=>{let t=H(e.appType);if(t==="WECHAT_MINI_PROGRAM"&&!WR())throw new Error("appType WECHAT_MINI_PROGRAM is a Zion-only client type and cannot be created here");let r=X5.filter(n=>n!=="WECHAT_MINI_PROGRAM"||WR());if(!t||!r.some(n=>n===t))throw new Error(`appType is required and must be one of ${r.join(", ")} \u2014 ${e3}.`);return t},r3=(e,t)=>({appName:H(e.appName)??Z5[t],appType:t,source:{type:"BLANK"}}),n3=async(e,t)=>{let r=H(e.projectName)??H(e.name);if(!r)throw new Error("projectName is required");let n=t3(e),i=await PR(t.client,e),s=(await t.client.request($0,{createProjectDetail:{explicitBuiltInClientApp:!0,projectName:r,organizationExId:i.organizationExId,projectSpaceType:i.projectSpaceType,category:le(e.category),source:{type:"BLANK"},...n!=="BACKEND_ONLY"&&{builtInClientApp:r3(e,n)}}})).createMultiClientProjectAsync;if(!s)throw new Error("Project creation failed: taskId is missing");let u=Ge(e.wait,!0)?await DR(t.client,r,Ye(e.timeoutMs,12e4)):null,c=null;if(u?.exId){let l=String(u.exId);n!=="BACKEND_ONLY"&&(c=(await ni(t.client,l))[0]??null),await t.credentialStore.saveProjectContext(l,c?.appExId??null),await Ty(t.client,l,t.codingAgent,t.hostSessionId)}return t.ok({taskId:s,project:u,builtInApp:c,projectSpace:i})},i3=async(e,t)=>{let r=H(e.projectExId);if(!r)throw new Error("projectExId is required");let n=H(e.appExId),i=e.appExId===null,o=n||i?[]:await ni(t.client,r);if(o.length>1)throw new Error(`Project ${r} has ${o.length} client apps, so the current client cannot be resolved: ${o.map(a=>`${a.appExId} (${a.appType})`).join(", ")}. Pages and components belong to one client, so call this again with appExId set to the one to work on, or with appExId: null to address the project's backend document alone. The current project is left as it was.`);let s=n??yo(o);return await t.credentialStore.saveProjectContext(r,s),await Ty(t.client,r,t.codingAgent,t.hostSessionId),t.ok({projectExId:r,appExId:s},s?`Current project set to ${r}, current client ${s}`:`Current project set to ${r} (no client; calls address its backend document)`)},o3=async(e,t)=>t.ok(await t.credentialStore.loadProjectContext()),s3=async(e,t)=>{let r=await t.getProjectLevelArgs(e),n=await t.client.request(Wn,r);return t.ok(Py(wl(n,FR),e))},a3=async(e,t)=>{let r=await t.getProjectLevelArgs(e),n=await t.client.request(qc,r);return Ge(e.raw,!1)?t.ok(Py(n,e)):t.ok(qR(n))},u3=async(e,t)=>{let r=await t.getProjectArgs(e),n=H(e.projectName)??H(e.name);if(!n)throw new Error("projectName is required");return t.ok(await t.client.request(K0,{projectExId:r.projectExId,projectName:n}))},c3=async(e,t)=>{let r=await t.getProjectArgs(e),n=H(e.appExId),i=H(e.appName)??H(e.name);if(!n)throw new Error("appExId is required");if(!i)throw new Error("appName is required");return t.ok(await t.client.request(H0,{projectExId:r.projectExId,appExId:n,appName:i}))},l3=async(e,t)=>{let r=await t.getProjectArgs(e);await fa(r.projectExId,e,"delete");let n=await t.client.request(Q0,{projectExId:r.projectExId});return(await t.credentialStore.loadProjectContext())?.projectExId===r.projectExId&&await t.credentialStore.deleteProjectContext(),t.schemaManager.clear(),t.ok(n)},p3=async(e,t)=>{let r=await t.getProjectArgs(e);await fa(r.projectExId,e,"reset");let n=H(e.languageType)??"EN";return t.ok(await t.client.request(W0,{projectExId:r.projectExId,languageType:n}))},d3=async(e,t)=>{let r=await t.getProjectArgs(e);Ge(e.refresh,!1)&&await t.client.request(iA,{projectExId:r.projectExId});let n=H(e.resourceType),[i,o,s,a]=await Promise.all([t.client.request(nA,{projectExId:r.projectExId,nonRealTimeDisplayedResourceTypes:ii(e.nonRealTimeDisplayedResourceTypes)}),t.client.request(aA,{projectExId:r.projectExId}).catch(l=>({error:l instanceof Error?l.message:String(l)})),n?t.client.request(oA,{projectExId:r.projectExId,resourceType:n}):Promise.resolve(null),n?t.client.request(sA,{projectExId:r.projectExId,resourceType:n}):Promise.resolve(null)]),u=o&&"findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch"in o?o.findActiveSingleTenantResourceInfoAndThrowOnExpireTimeMismatch:null,c={usage:UR(i.resourceUsageAndBurstInfo)};return u&&u.length>0&&(c.singleTenant=u),s?.monthlyResourceUsageHistory!=null&&(c.monthly=s.monthlyResourceUsageHistory),a?.dailyResourceUsageHistory!=null&&(c.daily=a.dailyResourceUsageHistory),t.ok(c)},zR={"projects.search":QR,"projects.list":QR,"project.create":n3,"project.set_current":i3,"project.get_current":o3,"project.detail":s3,"project.metadata":a3,"project.rename":u3,"project.rename_app":c3,"project.delete":l3,"project.reset":p3,"project.resources":d3};p();async function xl(e,t){let r=await t.checkSchema(e),n=await t.getProjectArgs(e);return{warning:r,projectArgs:n,sArgs:nr(n.projectExId,n)}}var bo=e=>async(t,r)=>{let{warning:n,sArgs:i}=await xl(t,r);return r.ok(Nt(await e(r.schemaManager,i),n))},f3=bo((e,t)=>e.load(t)),h3=bo((e,t)=>e.load(t,!0)),m3=async(e,t)=>{let r=H(e.projectExId)?await t.checkSchema(e):null;return t.ok(Nt(t.schemaManager.status(),r))},g3=async(e,t)=>t.ok(t.schemaManager.schemaState(H(e.projectExId))),y3=async(e,t)=>t.ok(t.schemaManager.schemaEvents(H(e.projectExId),le(e.afterEventId),Ye(e.limit,100))),v3=bo((e,t)=>e.sync(t)),E3=async(e,t)=>{let{warning:r,sArgs:n}=await xl(e,t),i=await t.schemaManager.snapshot(n,Ge(e.full,!1));return t.ok(Nt(i,r))},_3=bo((e,t)=>e.validate(t)),b3=bo((e,t)=>e.undo(t)),S3=bo((e,t)=>e.redo(t)),ky=async(e,t)=>{let{warning:r,projectArgs:n,sArgs:i}=await xl(e,t),o=await t.schemaManager.load(i),s=xy(o,n.appExId??null);if(!s.ok)return{ok:!1,error:s.error,data:Nt({status:o},r)};let a=await t.schemaManager.validate(i),u=ml(a);if(u.length>0&&!Ge(e.allowValidationErrors,!1))return{ok:!1,error:"ztype backend validation errors block backend sync",data:Nt({ztypeDiagnostics:a,backendErrors:u},r)};let c=await t.schemaManager.save(i),l=xy(c,n.appExId??null);if(!l.ok)throw new Error(`schema.save: ${l.error}`);let d=c.serverDoc??null,f=l.schemaExId,h=l.appExId,g=Ge(e.validateMultiClient,!1)&&!!d,v=Ge(e.validateMultiClient,!1)&&!d?await t.client.request(rA,{projectExId:n.projectExId,appExId:h,schemaExId:f}):await t.client.request(tA,{projectExId:n.projectExId,appExId:h,schemaExId:f,buildTarget:H(e.buildTarget)??"SUPPORT_SERVICE"});return t.ok(Nt({saved:c,deploy:v,ztypeDiagnostics:a,...g?{multiClientValidationSkipped:!0}:{}},r))},T3=async(e,t)=>{let{warning:r,sArgs:n}=await xl(e,t),i=Array.isArray(e.toolCalls)?e.toolCalls:[];if(i.length===0)throw new Error("toolCalls must be a non-empty array");let o=Ge(e.verbose,!1),s=await t.schemaManager.ztypeToolCalls(n,i,o,e.readState??null,Ge(e.force,!1),e.projectCapabilities??null);return t.ok(Nt(s,r))},YR={"schema.load":f3,"schema.reload":h3,"schema.status":m3,"schema.state":g3,"schema.events":y3,"schema.sync":v3,"schema.snapshot":E3,"schema.validate":_3,"project.sync_backend":ky,"schema.ztype_tool_calls":T3,"schema.undo":b3,"schema.redo":S3};p();p();var Ht=e=>Array.isArray(e)?e:[],My=e=>Fe(Fe(e).server),I3=e=>{for(let t of e){let r=Fe(t);if(r.type==="FLOW_END"&&r.removable!==!0)return le(r.uniqueId)}return null},JR=(e,t)=>{let n=Ht(My(e).actionFlows).find(s=>Fe(s).uniqueId===t);if(!n)throw new Error(`No action flow with id ${t}. Check the id with project.inspect.`);let i=Fe(n),o=I3(Ht(i.allNodes));if(!o)throw new Error(`Action flow ${t} has no terminal end node, so it cannot be debugged.`);return{definition:i,endNodeId:o,displayName:le(i.displayName),isAsync:i.isAsync===!0}},Fy=50,w3=e=>{for(let t=0;t<e.length-1;t++)if(e[t].key==="componentById")return le(e[t+1].key);return null},XR=(e,t=Fy)=>{let r=Fe(e);if(r.available===!1)return{count:0,errors:[],unavailable:!0};let n=[...Ht(r.stableErrors),...Ht(r.betaErrors)].map(Fe),i=n.slice(0,t).map(s=>{let a=Ht(s.fullPath).map(Fe),u={message:le(s.message)??"",path:a},c=le(s.platform);c&&(u.platform=c);let l=w3(a)??le(s.componentId);return l&&(u.componentId=l),u}),o={count:n.length,errors:i};return n.length>i.length&&(o.truncated=!0),o},O3=e=>{let t=Fe(e);if(!(e===void 0||t.available===!1))return Ht(t.stableErrors).length+Ht(t.betaErrors).length},ZR=(e,t,r,n)=>{let i=O3(Fe(t).ztypeDiagnostics),o=e?n===null?{status:"IN_PROGRESS",message:"The backend sync has not finished yet. Call sync_backend again to keep waiting for it."}:n==="FINISHED"?{status:"SYNCED",message:"The backend is synced: the saved schema is live on the project runtime."}:{status:"FAILED",message:"The backend sync failed. Inspect the project errors and the DEPLOYMENT logs for the cause, fix it, and sync again."}:{status:"FAILED",message:r??"The backend sync was refused and reported no reason."};return i!==void 0&&(o.projectErrorCount=i),o},A3=e=>{let t=new Map;for(let r of Ht(e.actionFlows)){let n=Fe(r),i=le(n.uniqueId),o=le(n.displayName);i&&o&&t.set(i,o)}return t},x3=e=>{let t=new Map;for(let r of Ht(Fe(e.dataModel).tables)){let n=Fe(r),i=le(n.uniqueId)??le(n.id),o=le(n.name);i&&o&&t.set(i,o)}return t},eC=e=>{let t=My(e),r=A3(t),n=x3(t),i=Ht(t.triggerConfigurations).map(s=>{let a=Fe(s),u=le(a.tableId);return{triggerId:le(a.uniqueId),displayName:le(a.displayName),enabled:a.enabled===!0,tableName:u?n.get(u)??null:null,operation:le(Fe(a.trigger).dbOperationType),flowNames:Ht(a.actions).map(c=>le(Fe(c).actionFlowUniqueId)).filter(c=>!!c).map(c=>r.get(c)).filter(c=>!!c)}}),o=Ht(t.scheduledJobConfigurations).map(s=>{let a=Fe(s),u=le(Fe(a.action).actionFlowUniqueId);return{triggerId:le(a.uniqueId),name:le(a.name),enabled:a.enabled!==!1,cron:le(a.cron),flowName:u?r.get(u)??null:null}});return{dbTriggers:i,scheduledTriggers:o}},N3=["dataModel","actionFlows","callbackConfigurations","scheduledJobConfigurations","triggerConfigurations","apiWorkSpaces","zAiConfigs","roleConfigs","authenticationConfig","secretConfigs"],jy=(e,t)=>{if(e===t)return!0;if(e==null)return t==null;if(t==null)return!1;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((r,n)=>jy(r,t[n]));if(typeof e=="object"&&typeof t=="object"){let r=e,n=t,i=new Set([...Object.keys(r),...Object.keys(n)]);for(let o of i)if(!jy(r[o],n[o]))return!1;return!0}return!1},tC=(e,t)=>{if(t==null)return{hasPendingChanges:!1,changedAreas:[],known:!1};let r=My(e),n=Fe(t),i=N3.filter(o=>!jy(r[o],n[o]));return{hasPendingChanges:i.length>0,changedAreas:[...i],known:!0}};p();import{execSync as R3}from"node:child_process";import{createRequire as C3}from"node:module";import P3 from"node:path";var Vy=1e5,D3=15e3,L3=3e4,rC=["--js-flags=--max-old-space-size=1024","--renderer-process-limit=1"],ha=e=>Math.max(1,e-Date.now()),qy=(e,t)=>{let r;return Promise.race([e,new Promise((n,i)=>{r=setTimeout(()=>i(new Error(`The canvas did not answer within ${Vy/1e3}s.`)),ha(t))})]).finally(()=>clearTimeout(r))},k3=async()=>{try{return await import("playwright")}catch{let e=R3("npm root -g").toString().trim();return C3(P3.join(e,"noop.js"))("playwright")}},Uy=class{constructor(t=k3){this.playwright=t}browser=null;context=null;page=null;loadedFor=null;loadedWithPatches=new Set;queue=Promise.resolve();run(t,r){let n=this.queue.then(()=>this.runNow(t,r).catch(async i=>{throw await this.discard(this.page),i}));return this.queue=n.catch(()=>{}),n}async discard(t){t&&(this.page===t&&(this.page=null,this.loadedFor=null),await t.close().catch(()=>{}))}async close(){await this.browser?.close().catch(()=>{}),this.browser=null,this.context=null,this.page=null,this.loadedFor=null}async runNow(t,r){let n=await this.pageFor(t,r);if(!await qy(n.evaluate(()=>globalThis.__ZION_AGENT_CANVAS__.isInSync()),r.deadline).catch(()=>!1))n=await this.load(t,r);else for(let o of r.lastPatchExIds)if(!this.loadedWithPatches.has(o)&&!await this.waitForPatch(n,o,r.deadline)){n=await this.load(t,r);break}return r.pageId&&(await qy(n.evaluate(({pageId:o,breakpoint:s})=>globalThis.__ZION_AGENT_CANVAS__.focus(o,s),{pageId:r.pageId,breakpoint:r.breakpoint}),r.deadline),await n.waitForFunction(({pageId:o,breakpoint:s})=>globalThis.__ZION_AGENT_CANVAS__.isFocused(o,s),{pageId:r.pageId,breakpoint:r.breakpoint},{timeout:Math.min(L3,ha(r.deadline))})),qy(n.evaluate(({rpc:o,args:s,sessionExId:a})=>globalThis.__ZION_AGENT_CANVAS__.dispatch(o,s,a),{rpc:r.rpc,args:r.args,sessionExId:r.sessionExId}),r.deadline)}async pageFor(t,r){let n=`${t.projectExId}/${t.appExId}`;return this.page&&!this.page.isClosed()&&this.browser?.isConnected()&&this.loadedFor===n?this.page:this.load(t,r)}async waitForPatch(t,r,n){try{return await t.waitForFunction(i=>globalThis.__ZION_AGENT_CANVAS__.hasAppliedPatch(i),r,{timeout:Math.min(D3,ha(n))}),!0}catch{return!1}}async load(t,r){let n=Rt().editorBaseUrl;if(!this.browser?.isConnected()||!this.context){await this.close();let{chromium:s}=await this.playwright(),a=process.env.EDITOR_HOST_RESOLVER_RULES;this.browser=await s.launch({headless:!0,args:a?[...rC,`--host-resolver-rules=${a}`]:rC}),this.context=await this.browser.newContext({viewport:{width:1280,height:800}})}if(await this.context.addCookies([{name:"loggedInUserStorageKey",value:encodeURIComponent(JSON.stringify({exId:t.user.exId,username:t.user.username,token:t.token,roleNames:[],registeredWithInLastMinute:!1})),url:n}]),!this.page||this.page.isClosed()){let s=await this.context.newPage();s.on("crash",()=>void this.discard(s)),this.page=s}let i=this.page,o=new URLSearchParams({mode:"AGENT_CANVAS",leftSideTab:"page"});return r.pageId&&o.set("componentId",r.pageId),r.breakpoint&&o.set("breakpoint",r.breakpoint),this.loadedWithPatches=new Set(r.lastPatchExIds),this.loadedFor=null,await i.goto(`${n}/multi-client/tool/${t.projectExId}/${t.appExId}/design?${o}`,{waitUntil:"domcontentloaded",timeout:ha(r.deadline)}),await i.waitForFunction(()=>!!globalThis.__ZION_AGENT_CANVAS__&&!!globalThis.document.querySelector("#canvas-viewport [data-meta-id]"),void 0,{timeout:ha(r.deadline)}),this.loadedFor=`${t.projectExId}/${t.appExId}`,i}},nC=new Uy;var Nl=async(e,t)=>{let r=await t.getProjectArgs(e),n=nr(r.projectExId,r);return await t.schemaManager.load(n),{projectArgs:r,sArgs:n,snapshot:await t.schemaManager.snapshot(n,!0)}},j3=async(e,t)=>{let r=H(e.flowId);if(!r)return t.fail(new Error("Provide a 'flowId'."));let{snapshot:n}=await Nl(e,t);return t.ok(JR(n,r))},M3=async(e,t)=>{let{snapshot:r}=await Nl(e,t);return t.ok(eC(r))},F3=async(e,t)=>{let{projectArgs:r,snapshot:n}=await Nl(e,t),i=await t.client.request(OA,{projectExId:r.projectExId});return t.ok(tC(n,i?.project?.lastDeployedServerSchema??null))},q3=async(e,t)=>{let{sArgs:r}=await Nl(e,t);return t.ok(XR(await t.schemaManager.validate(r),Ye(e.limit,Fy)))},U3=9e4,V3=2e3,iC=async(e,t)=>(await e.client.request(wA,{projectExId:t})).project?.lastAllPipelinePlatformStatus.find(n=>n.buildTarget==="SUPPORT_SERVICE")??null,G3=async(e,t,r,n)=>{for(;;){let i=await iC(e,t);if(i&&i.status!=="DEPLOYING"&&n(i))return i.status;if(Date.now()>=r)return null;await new Promise(o=>setTimeout(o,V3))}},$3=async(e,t)=>{let r=Date.now()+U3,{projectExId:n}=await t.getProjectArgs(e),i=await iC(t,n),o=i?.status==="DEPLOYING",s=o?t.ok():await ky(e,t),a=s.ok?await G3(t,n,r,u=>o||u.startedAt!==i?.startedAt):null;return t.ok(ZR(s.ok,s.data,s.error??null,a))},B3=async(e,t)=>{if(e.appExId)return e.appExId;let r=await ni(t.client,e.projectExId);if(r.length===0)throw new Error("The project has no client app, so there is no canvas to render.");let n=yo(r);if(!n)throw new Error(`Pass appExId: the project has ${r.length} client apps (${r.map(i=>i.appExId).join(", ")}), so the canvas to render is ambiguous.`);return n},oC=async(e,t,r,n)=>{let i=Date.now()+Vy,o=await n.getProjectArgs(r),s=nr(o.projectExId,o),a=await B3(o,n),u=await n.client.request(Fc);if(!u?.user?.exId)throw new Error("Could not resolve the signed-in account to render the canvas as.");return nC.run({projectExId:o.projectExId,appExId:a,token:await n.tokenManager.getValidToken(),user:{exId:u.user.exId,username:u.user.username??null}},{rpc:e,args:t,sessionExId:H(r.sessionExId)??"",pageId:H(r.pageId)??null,breakpoint:H(r.breakpoint)??null,lastPatchExIds:await n.schemaManager.lastPatchExIds(s),deadline:i})},K3=["pageId","componentId","mode","breakpoint","maxWidth","limit"],sC=e=>Object.fromEntries(K3.filter(t=>e[t]!==void 0).map(t=>[t,e[t]])),H3=async(e,t)=>t.ok(await oC("editor.getClippedComponents",sC(e),e,t)),Q3=async(e,t)=>H(e.sessionExId)?t.ok(await oC("editor.captureCanvas",sC(e),e,t)):t.fail(new Error("Provide 'sessionExId': the capture is stored as that agent session's media.")),aC={"bridge.flow_definition":j3,"bridge.trigger_bindings":M3,"bridge.deploy_status":F3,"bridge.project_errors":q3,"bridge.sync_backend":$3,"bridge.clipped_components":H3,"bridge.capture_canvas":Q3};p();p();var W3=/Subselection required for type '(FZ_\w+)' of field '([^'/]+\/)?([^']+)'/,z3=/Unknown field argument '(where|limit|offset|order_by)'/,Y3=/Field '([^']+)' in type '([^']+)' is undefined/,J3=/field name '([^']+)' that is not defined for input object type '(\w+)'/,X3=(e,t)=>{let r=Array.from({length:t.length+1},(n,i)=>i);for(let n=1;n<=e.length;n+=1){let i=[n];for(let o=1;o<=t.length;o+=1)i[o]=Math.min(r[o]+1,i[o-1]+1,r[o-1]+(e[n-1]===t[o-1]?0:1));r=i}return r[t.length]},cC=(e,t)=>{let r=Math.max(2,Math.ceil(t.length/2));return e.map(n=>({name:n,score:X3(n.toLowerCase(),t.toLowerCase())})).filter(n=>n.score<=r).sort((n,i)=>n.score-i.score).slice(0,3).map(n=>n.name)},Z3=e=>(e?.tableMetadata??[]).flatMap(t=>[t?.name,t?.displayName].filter(r=>typeof r=="string"&&r.length>0)),Rl=(e,t)=>(e?.tableMetadata??[]).find(r=>r?.name===t),uC=(e,t)=>{let r=t?.columnMetadata??[],n=r.find(o=>o?.displayName===e&&o?.name);if(n){let o=Il(n)??n.name;return`'${e}' is a column DISPLAY name, which the runtime never accepts \u2014 pass '${o}'.`}if(r.some(o=>o?.name===e))return`'${e}' is in the project schema but not in the deployed backend. Run 'project sync-backend', then retry.`;let i=cC(r.flatMap(o=>[o?.name,o?.displayName]).filter(o=>typeof o=="string"&&o.length>0),e);return i.length>0?`No column '${e}'. Closest: ${i.join(", ")}.`:`No column '${e}' on this table.`},e8=(e,t,r)=>{let n=W3.exec(e);if(n){let c=n[3];return`'${c}' is a media column \u2014 the runtime takes the asset id as '${c}_id', the only form it filters, sorts or writes. Read the asset's url or metadata with runtime graphql instead: ${c} { id url }.`}if(z3.test(e))return`'${t}' exists in the runtime but is not a table collection \u2014 it takes no where/limit/order_by. Query it with runtime graphql instead.`;let i=J3.exec(e);if(i)return uC(i[1],Rl(r,t));let o=Y3.exec(e);if(!o)return null;let[,s,a]=o;if(a!=="Query"&&a!=="Mutation")return uC(s,Rl(r,t));if(Rl(r,t))return`'${t}' is in the project schema but not in the deployed backend. Run 'project sync-backend', then retry \u2014 every runtime call hits the deployed app, never the draft.`;let u=cC(Z3(r),t);return u.length>0?`No table '${t}' in the project schema. Closest: ${u.join(", ")}.`:`No table '${t}' in the project schema \u2014 'schema snapshot' lists the ones there are.`},lC=(e,t,r)=>{let n=e instanceof Error?e.message:String(e),i=e8(n,t,r);return i?e instanceof Error?(e.runtimeDiagnosis=i,e):new Error(`${n}
|
|
1341
|
+
${i}`):e},pC=(e,t,r)=>{let n=e?.tableMetadata??[];if(!n.some(o=>o?.name===t)){let o=n.find(s=>s?.displayName===t&&s?.name);if(o?.name)throw new Error(`'${t}' is a table DISPLAY name, which the runtime never accepts \u2014 pass '${o.name}'.`)}let i=Rl(e,t)?.columnMetadata??[];for(let o of r??[]){let s=i.find(u=>u?.name===o)??i.find(u=>u?.displayName===o),a=s?Il(s):null;if(!(!s||!a||a===o))throw new Error(s.name===o?`'${o}' is a media column \u2014 pass '${a}', the asset id, which is the only form the runtime filters, sorts or writes. For the asset's url or metadata, select subfields with runtime graphql: ${o} { id url }.`:`'${o}' is a column DISPLAY name, which the runtime never accepts \u2014 pass '${a}'.`)}};p();p();var t8=/^[A-Za-z_][A-Za-z0-9_]*$/,yn=(e,t)=>{if(!t8.test(e))throw new Error(`${t} must be a GraphQL identifier`)},Gy=(e,t)=>{for(let r of e)yn(r,t)},Cl=(e,t)=>{if(e.length===0)throw new Error("at least one field must be selected");return Gy(e,"fields"),e.map(r=>`${t}${r}`).join(`
|
|
1342
|
+
`)},dC=(e,t)=>(yn(e,"table"),`query AgentQuery($where: ${e}_bool_exp, $limit: Int, $offset: Int, $order_by: [${e}_order_by!]) {
|
|
1346
1343
|
${e}(where: $where, limit: $limit, offset: $offset, order_by: $order_by) {
|
|
1347
|
-
${
|
|
1344
|
+
${Cl(t," ")}
|
|
1348
1345
|
}
|
|
1349
|
-
}`),
|
|
1346
|
+
}`),fC=e=>(yn(e,"table"),`query AgentAggregate($where: ${e}_bool_exp) {
|
|
1350
1347
|
${e}_aggregate(where: $where) {
|
|
1351
1348
|
aggregate {
|
|
1352
1349
|
count
|
|
1353
1350
|
}
|
|
1354
1351
|
}
|
|
1355
|
-
}`),
|
|
1352
|
+
}`),hC=(e,t)=>(yn(e,"table"),`mutation AgentInsert($objects: [${e}_insert_input!]!) {
|
|
1356
1353
|
insert_${e}(objects: $objects) {
|
|
1357
1354
|
affected_rows
|
|
1358
1355
|
returning {
|
|
1359
|
-
${
|
|
1356
|
+
${Cl(t," ")}
|
|
1360
1357
|
}
|
|
1361
1358
|
}
|
|
1362
|
-
}`),
|
|
1359
|
+
}`),mC=(e,t)=>(yn(e,"table"),`mutation AgentUpdate($where: ${e}_bool_exp!, $set: ${e}_set_input!) {
|
|
1363
1360
|
update_${e}(where: $where, _set: $set) {
|
|
1364
1361
|
affected_rows
|
|
1365
1362
|
returning {
|
|
1366
|
-
${
|
|
1363
|
+
${Cl(t," ")}
|
|
1367
1364
|
}
|
|
1368
1365
|
}
|
|
1369
|
-
}`),
|
|
1366
|
+
}`),gC=(e,t)=>(yn(e,"table"),`mutation AgentDelete($where: ${e}_bool_exp!) {
|
|
1370
1367
|
delete_${e}(where: $where) {
|
|
1371
1368
|
affected_rows
|
|
1372
1369
|
returning {
|
|
1373
|
-
${
|
|
1370
|
+
${Cl(t," ")}
|
|
1374
1371
|
}
|
|
1375
1372
|
}
|
|
1376
|
-
}`),
|
|
1373
|
+
}`),yC=()=>`mutation AgentRunCode($jsCode: String!, $args: JsonObject, $updateDb: Boolean!) {
|
|
1377
1374
|
fz_debug_action_code(jsCode: $jsCode, args: $args, updateDb: $updateDb)
|
|
1378
|
-
}`;var W3=20,z3=200,Y3=20,Fy="id",qy=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},yC=e=>Array.isArray(e)?e:[],J3=(e,t)=>typeof e=="boolean"?e:e==null?t:String(e).toLowerCase()==="true",hC=(e,t)=>typeof e=="number"&&Number.isFinite(e)?Math.trunc(e):t,mC=(e,t)=>{let r=e[t];if(typeof r!="string"||r.trim()==="")throw new Error(`'${t}' is required.`);return r},gC=(e,t,r)=>{let n=qy(e.where);if(Object.keys(n).length>0)return n;if(e[r]===!0)return{};throw new Error(`'where' is required and must not be empty \u2014 this ${t} runs against the live app and there is no change-everything option.`)},Nl=(e,t)=>{let r=yC(e.fields).filter(n=>typeof n=="string"&&n.trim()!=="");return r.length>0?(My(r,"fields"),r):t.length>0?t.slice(0,Y3):[Fy]},X3=e=>e.includes(Fy)?e:[Fy,...e],Uy=(e,t,r=[])=>{if(e==="runtime.run_code")return{document:fC(),variables:{jsCode:mC(t,"jsCode"),args:qy(t.args),updateDb:J3(t.updateDb,!1)},rootField:"fz_debug_action_code"};let n=mC(t,"tableName");switch(gn(n,"tableName"),e){case"runtime.query":return{document:uC(n,Nl(t,r)),variables:{where:t.where??{},limit:Math.min(hC(t.limit,W3),z3),offset:hC(t.offset,0),order_by:t.orderBy??null},rootField:n};case"runtime.aggregate":return{document:cC(n),variables:{where:t.where??{}},rootField:`${n}_aggregate`};case"runtime.insert":{let i=yC(t.objects);if(i.length===0)throw new Error("'objects' must contain at least one row to insert.");if(i.some(o=>!o||typeof o!="object"||Array.isArray(o)))throw new Error("every entry in 'objects' must be an object of column values.");return{document:lC(n,X3(Nl(t,r))),variables:{objects:i},rootField:`insert_${n}`}}case"runtime.update":{let i=gC(t,"update","allowUpdateAll"),o=qy(t.set);if(Object.keys(o).length===0)throw new Error("'set' must contain at least one column to change.");return{document:pC(n,Nl(t,r)),variables:{where:i,set:o},rootField:`update_${n}`}}case"runtime.delete":return{document:dC(n,Nl(t,r)),variables:{where:gC(t,"delete","allowDeleteAll")},rootField:`delete_${n}`};default:throw new Error(`'${e}' is not a planned runtime operation.`)}},vC=e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;let t=Object.keys(e);return t.length===1?e[t[0]]:e};async function fa(e,t,r,n){let i=await r.checkSchema(t),o=await r.getProjectArgs(t),s=oi(t.tableName,"tableName"),[a,u]=await Promise.all([r.schemaManager.dataModel(nr(o.projectExId,o)),Eo(r.client,o)]);aC(a,s,ii(t.fields));let c=Uy(e,{...t,tableName:s},wR(a,s)),l;try{l=await u.dataClient.request(c.document,c.variables)}catch(d){throw sC(d,s,a)}return r.ok(Nt(n?vC(l):l,i))}var Z3=async(e,t)=>{let r=await t.checkSchema(e),n=await t.getProjectArgs(e),i=oi(e.query,"query"),s=await(await Eo(t.client,n)).dataClient.request(i,e.variables??{});return t.ok(Nt(s,r))},e8=async(e,t)=>fa("runtime.query",e,t,!1),t8=async(e,t)=>fa("runtime.aggregate",e,t,!1),r8=async(e,t)=>fa("runtime.insert",e,t,!0),n8=async(e,t)=>fa("runtime.update",e,t,!0),i8=async(e,t)=>fa("runtime.delete",e,t,!0),o8=async(e,t)=>{let r=await t.getProjectArgs(e),n=Uy("runtime.run_code",e),o=await(await Eo(t.client,r)).adminClient.request(n.document,n.variables);return t.ok({keptWrites:n.variables.updateDb===!0,result:o?.fz_debug_action_code})},EC={"runtime.graphql":Z3,"runtime.run_code":o8,"runtime.query":e8,"runtime.aggregate":t8,"runtime.insert":r8,"runtime.update":n8,"runtime.delete":i8};p();var s8=["GATEWAY","ACTION_FLOW","ACTION_FLOW_NODE","ACTION_FLOW_CONTEXT_LOG","DEPLOYMENT","TPA","TRIGGER","SQL_GENERATION","GQL","ZAI"],a8=["INFO","WARNING","ERROR"],u8=50,c8=100,_C=5,bC=e=>`${e.toISOString().slice(0,19)}Z`,l8=e=>{if(!e)return new Date;let t=new Date(e);return Number.isNaN(t.getTime())?new Date:t},SC=(e,t)=>{if(!e)return;let r=e.map(n=>n.toUpperCase()).filter(n=>t.includes(n));return r.length>0?r:void 0},p8=async(e,t)=>{let r=await t.getProjectArgs(e),{adminToken:n}=await Eo(t.client,r),i=l8(H(e.requestCreatedAt)),o={start:bC(new Date(i.getTime()-_C*6e4)),end:bC(new Date(i.getTime()+_C*6e4)),desc:!0},s=SC(ii(e.types),s8);s&&(o.type=s);let a=SC(ii(e.levels),a8);a&&(o.level=a);let u=H(e.customQueryCondition);u&&(o.customQueryCondition=u);let c=Math.min(c8,Ye(e.limit,u8)),l=Rt().logApiUrlTemplate.replace("{projectExId}",r.projectExId),h=((await new Ze(l,{headers:{authorization:`Bearer ${n}`},fetch:yo}).request(SA,{queryCreation:o,paginator:{first:c}}))?.fetchLogsByPaginator?.edges??[]).map(g=>g?.node).filter(g=>!!g);return t.ok({entries:h})},TC={"logs.search":p8};p();p();var d8=async()=>(await import("./corpus-73N3F2LB.js")).DOCS_CORPUS,f8=3,IC=null,h8=e=>{let t=new Map;for(let r of e)t.set(r.path,r);for(let r of e)for(let n of r.aliases??[])t.has(n)||t.set(n,r);return t},m8=e=>{let t=e.map(r=>{let n=Yl(r.content),i=Yl(r.title);for(let o=0;o<f8;o+=1)n.push(...i);return{ref:r,tokens:n}});return{index:yv(t),byPath:h8(e)}},OC=async()=>(IC??=m8(await d8()),IC),wC=async(e,t=10)=>{let{index:r}=await OC();return vv(r,e).filter(n=>n.score>0).sort((n,i)=>i.score-n.score).slice(0,Math.max(1,t)).map(n=>({path:n.ref.path,title:n.ref.title,url:n.ref.url}))},g8=e=>{let t=e.trim().replace(/\.mdx$/,"").replace(/^\/+/,"/").replace(/\/+$/,"");return t===""||t==="/"?"/":t.startsWith("/")?t:`/${t}`},AC=async e=>(await OC()).byPath.get(g8(e))??null;var y8=async(e,t)=>{let r=H(e.query);if(!r)throw new Error("query is required");let n=Ye(e.limit,10);return t.ok({results:await wC(r,n)})},v8=async(e,t)=>{let r=H(e.path);if(!r)throw new Error("path is required");let n=await AC(r);if(!n)throw new Error(`No doc page found for path: ${r}`);return t.ok(n)},xC={"docs.search":y8,"docs.get_page":v8};p();var E8=async(e,t)=>{let r=H(e.query);if(!r)throw new Error("query is required");let n=e.variables&&typeof e.variables=="object"?e.variables:{};return t.ok(await t.client.request(r,n))},NC={"platform.graphql":E8};p();var _8=async(e,t)=>{let r=await xt(),n=r?.api?.ZTypePredefinedApi;if(!n)return t.fail(new Error("ztype predefined template API is unavailable"));let o=n.getActionFlowTemplates(ho(r)).map(s=>({templateCodeId:s.preDefinedCodeId,displayName:s.displayName,group:s.directory,async:s.async,inputs:s.input,outputs:s.output}));return t.ok({templates:o})},RC={"actionflow.list_node_templates":_8};p();var b8=e=>{if(!e)return null;let t=e.split("?")[0]?.split("/").pop();if(!t)return null;let r=t.replace(/\.[a-z0-9]+$/i,"");return r.length>0?r:null},S8=async(e,t)=>{let n=(await t.client.request(k0)).getTabBarIcons.flatMap(i=>i?[{name:b8(i.url),exId:i.exId}]:[]);return t.ok({icons:n,note:n.length===0?"This deployment ships no preset tab-bar icons; upload one in the editor and use its exId.":"A name ending in _selected is the pressed-state partner of the icon with the same prefix; for the plain icons use the same exId for both states."})},CC={"component.tab_bar_icons":S8};p();p();function T8(e){let t;try{t=new URL(e)}catch{throw new Error(`Unsupported or malformed URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error(`Only http/https URLs are allowed: ${e}`);return t}async function I8(e,t){let r=e.body?.getReader();if(!r)throw new Error(`Empty response body from ${t}`);let n=[],i=0;for(;;){let{done:o,value:s}=await r.read();if(o)break;if(i+=s.byteLength,i>10485760)throw await r.cancel(),new Error("Response exceeds size limit of 10485760 bytes");n.push(s)}return Buffer.concat(n).toString("utf8")}async function PC(e){let t=e;for(let r=0;r<=5;r++){let n=T8(t),i=await fetch(n,{redirect:"manual",signal:AbortSignal.timeout(2e4),headers:{Accept:"application/json, application/yaml, text/yaml, text/html, */*","User-Agent":"Momen-Agent-TpaImport"}});if(i.status>=300&&i.status<400){let o=i.headers.get("location");if(await i.body?.cancel(),!o)throw new Error(`Redirect without Location from ${t}`);t=new URL(o,n).toString();continue}if(!i.ok)throw await i.body?.cancel(),new Error(`HTTP ${i.status} fetching ${t}`);return{finalUrl:n.toString(),contentType:i.headers.get("content-type"),body:await I8(i,t)}}throw new Error(`Too many redirects fetching ${e}`)}p();var O8=/(?:href|src|url)\s*[=:]\s*["']?([^"'\s>)]+)/gi,w8=/<(script|style|noscript|svg|iframe|canvas|template|nav|footer|aside)\b[\s\S]*?<\/\1\s*>/gi,A8=new Set(["css","js","png","jpg","jpeg","gif","svg","ico","woff","woff2","ttf","webp","mp4","zip","pdf"]);function DC(e,t){if(e&&e.toLowerCase().includes("html"))return!0;let r=t.trimStart();return r.startsWith("<")&&!r.startsWith("<?xml")}function LC(e){let t=e.length>4e3?e.slice(0,4e3):e;return t.includes('"openapi"')||t.includes('"swagger"')||/(^|\n)\s*openapi\s*:/.test(t)||/(^|\n)\s*swagger\s*:/.test(t)}function kC(e,t){try{return new URL(t,e).toString()}catch{return t.startsWith("http")?t:null}}var x8=/^https?:\/\/app\.swaggerhub\.com\/apis(?:-docs)?\/([^/?#]+)\/([^/?#]+)\/([^/?#]+)/i;function N8(e){let t=e.match(x8);return t?`https://api.swaggerhub.com/apis/${t[1]}/${t[2]}/${t[3]}`:null}function jC(e,t){let r=[],n=i=>{i&&r.length<20&&!r.includes(i)&&r.push(i)};for(let i of e.matchAll(O8)){if(r.length>=20)break;let o=i[1],s=o.toLowerCase();if(!(s.includes("openapi")||s.includes("swagger")||(s.endsWith(".json")||s.endsWith(".yaml")||s.endsWith(".yml"))&&s.includes("api")))continue;let u=kC(t,o);n(u&&N8(u)),n(u)}return r}function MC(e,t){let r=[],n;try{n=new URL(t).host}catch{return r}for(let i of e.matchAll(/<a\b[^>]*href\s*=\s*["']([^"'#]+)[^"']*["']/gi)){if(r.length>=40)break;let o;try{o=new URL(i[1],t)}catch{continue}if(o.host!==n)continue;o.hash="";let s=o.toString(),a=o.pathname.toLowerCase(),u=a.slice(a.lastIndexOf(".")+1);A8.has(u)||s===t||r.includes(s)||r.push(s)}return r}var R8={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",copy:"\xA9"};function Vy(e){return e.replace(/&#x([0-9a-f]+);/gi,(t,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&#(\d+);/g,(t,r)=>String.fromCodePoint(parseInt(r,10))).replace(/&([a-z]+);/gi,(t,r)=>R8[r.toLowerCase()]??t)}var ha=e=>e.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();function FC(e,t){let r=e.replace(/<!--[\s\S]*?-->/g,"").replace(w8,"");return r=r.replace(/<pre\b[^>]*>([\s\S]*?)<\/pre\s*>/gi,(n,i)=>`
|
|
1375
|
+
}`;var r8=20,n8=200,i8=20,$y="id",By=e=>e&&typeof e=="object"&&!Array.isArray(e)?e:{},bC=e=>Array.isArray(e)?e:[],o8=(e,t)=>typeof e=="boolean"?e:e==null?t:String(e).toLowerCase()==="true",vC=(e,t)=>typeof e=="number"&&Number.isFinite(e)?Math.trunc(e):t,EC=(e,t)=>{let r=e[t];if(typeof r!="string"||r.trim()==="")throw new Error(`'${t}' is required.`);return r},_C=(e,t,r)=>{let n=By(e.where);if(Object.keys(n).length>0)return n;if(e[r]===!0)return{};throw new Error(`'where' is required and must not be empty \u2014 this ${t} runs against the live app and there is no change-everything option.`)},Pl=(e,t)=>{let r=bC(e.fields).filter(n=>typeof n=="string"&&n.trim()!=="");return r.length>0?(Gy(r,"fields"),r):t.length>0?t.slice(0,i8):[$y]},s8=e=>e.includes($y)?e:[$y,...e],Ky=(e,t,r=[])=>{if(e==="runtime.run_code")return{document:yC(),variables:{jsCode:EC(t,"jsCode"),args:By(t.args),updateDb:o8(t.updateDb,!1)},rootField:"fz_debug_action_code"};let n=EC(t,"tableName");switch(yn(n,"tableName"),e){case"runtime.query":return{document:dC(n,Pl(t,r)),variables:{where:t.where??{},limit:Math.min(vC(t.limit,r8),n8),offset:vC(t.offset,0),order_by:t.orderBy??null},rootField:n};case"runtime.aggregate":return{document:fC(n),variables:{where:t.where??{}},rootField:`${n}_aggregate`};case"runtime.insert":{let i=bC(t.objects);if(i.length===0)throw new Error("'objects' must contain at least one row to insert.");if(i.some(o=>!o||typeof o!="object"||Array.isArray(o)))throw new Error("every entry in 'objects' must be an object of column values.");return{document:hC(n,s8(Pl(t,r))),variables:{objects:i},rootField:`insert_${n}`}}case"runtime.update":{let i=_C(t,"update","allowUpdateAll"),o=By(t.set);if(Object.keys(o).length===0)throw new Error("'set' must contain at least one column to change.");return{document:mC(n,Pl(t,r)),variables:{where:i,set:o},rootField:`update_${n}`}}case"runtime.delete":return{document:gC(n,Pl(t,r)),variables:{where:_C(t,"delete","allowDeleteAll")},rootField:`delete_${n}`};default:throw new Error(`'${e}' is not a planned runtime operation.`)}},SC=e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;let t=Object.keys(e);return t.length===1?e[t[0]]:e};async function ma(e,t,r,n){let i=await r.checkSchema(t),o=await r.getProjectArgs(t),s=oi(t.tableName,"tableName"),[a,u]=await Promise.all([r.schemaManager.dataModel(nr(o.projectExId,o)),_o(r.client,o)]);pC(a,s,ii(t.fields));let c=Ky(e,{...t,tableName:s},CR(a,s)),l;try{l=await u.dataClient.request(c.document,c.variables)}catch(d){throw lC(d,s,a)}return r.ok(Nt(n?SC(l):l,i))}var a8=async(e,t)=>{let r=await t.checkSchema(e),n=await t.getProjectArgs(e),i=oi(e.query,"query"),s=await(await _o(t.client,n)).dataClient.request(i,e.variables??{});return t.ok(Nt(s,r))},u8=async(e,t)=>ma("runtime.query",e,t,!1),c8=async(e,t)=>ma("runtime.aggregate",e,t,!1),l8=async(e,t)=>ma("runtime.insert",e,t,!0),p8=async(e,t)=>ma("runtime.update",e,t,!0),d8=async(e,t)=>ma("runtime.delete",e,t,!0),f8=async(e,t)=>{let r=await t.getProjectArgs(e),n=Ky("runtime.run_code",e),o=await(await _o(t.client,r)).adminClient.request(n.document,n.variables);return t.ok({keptWrites:n.variables.updateDb===!0,result:o?.fz_debug_action_code})},TC={"runtime.graphql":a8,"runtime.run_code":f8,"runtime.query":u8,"runtime.aggregate":c8,"runtime.insert":l8,"runtime.update":p8,"runtime.delete":d8};p();var h8=["GATEWAY","ACTION_FLOW","ACTION_FLOW_NODE","ACTION_FLOW_CONTEXT_LOG","DEPLOYMENT","TPA","TRIGGER","SQL_GENERATION","GQL","ZAI"],m8=["INFO","WARNING","ERROR"],g8=50,y8=100,IC=5,wC=e=>`${e.toISOString().slice(0,19)}Z`,v8=e=>{if(!e)return new Date;let t=new Date(e);return Number.isNaN(t.getTime())?new Date:t},OC=(e,t)=>{if(!e)return;let r=e.map(n=>n.toUpperCase()).filter(n=>t.includes(n));return r.length>0?r:void 0},E8=async(e,t)=>{let r=await t.getProjectArgs(e),{adminToken:n}=await _o(t.client,r),i=v8(H(e.requestCreatedAt)),o={start:wC(new Date(i.getTime()-IC*6e4)),end:wC(new Date(i.getTime()+IC*6e4)),desc:!0},s=OC(ii(e.types),h8);s&&(o.type=s);let a=OC(ii(e.levels),m8);a&&(o.level=a);let u=H(e.customQueryCondition);u&&(o.customQueryCondition=u);let c=Math.min(y8,Ye(e.limit,g8)),l=Rt().logApiUrlTemplate.replace("{projectExId}",r.projectExId),h=((await new Ze(l,{headers:{authorization:`Bearer ${n}`},fetch:vo}).request(AA,{queryCreation:o,paginator:{first:c}}))?.fetchLogsByPaginator?.edges??[]).map(g=>g?.node).filter(g=>!!g);return t.ok({entries:h})},AC={"logs.search":E8};p();p();var _8=async()=>(await import("./corpus-7ZWN7347.js")).DOCS_CORPUS,b8=3,xC=null,S8=e=>{let t=new Map;for(let r of e)t.set(r.path,r);for(let r of e)for(let n of r.aliases??[])t.has(n)||t.set(n,r);return t},T8=e=>{let t=e.map(r=>{let n=Zl(r.content),i=Zl(r.title);for(let o=0;o<b8;o+=1)n.push(...i);return{ref:r,tokens:n}});return{index:Sv(t),byPath:S8(e)}},NC=async()=>(xC??=T8(await _8()),xC),RC=async(e,t=10)=>{let{index:r}=await NC();return Tv(r,e).filter(n=>n.score>0).sort((n,i)=>i.score-n.score).slice(0,Math.max(1,t)).map(n=>({path:n.ref.path,title:n.ref.title,url:n.ref.url}))},I8=e=>{let t=e.trim().replace(/\.mdx$/,"").replace(/^\/+/,"/").replace(/\/+$/,"");return t===""||t==="/"?"/":t.startsWith("/")?t:`/${t}`},CC=async e=>(await NC()).byPath.get(I8(e))??null;var w8=async(e,t)=>{let r=H(e.query);if(!r)throw new Error("query is required");let n=Ye(e.limit,10);return t.ok({results:await RC(r,n)})},O8=async(e,t)=>{let r=H(e.path);if(!r)throw new Error("path is required");let n=await CC(r);if(!n)throw new Error(`No doc page found for path: ${r}`);return t.ok(n)},PC={"docs.search":w8,"docs.get_page":O8};p();var si=qe(cn(),1);var DC=["saveSchema","deployV2","validateSchemaIdIsLatest","addCodeComponentToProject","changeProjectCodeComponentVersion"],LC=(e,t)=>e.selections.flatMap(r=>{if(r.kind===si.Kind.FIELD)return[r.name.value];let n=r.kind===si.Kind.INLINE_FRAGMENT?r.selectionSet:t.get(r.name.value)?.selectionSet;return n?LC(n,t):[]}),A8=e=>{let t=(0,si.parse)(e),r=new Map;for(let i of t.definitions)i.kind===si.Kind.FRAGMENT_DEFINITION&&r.set(i.name.value,i);let n=new Set;for(let i of t.definitions)if(i.kind===si.Kind.OPERATION_DEFINITION&&i.operation!=="query")for(let o of LC(i.selectionSet,r))DC.includes(o)||n.add(o);return[...n]},x8=async(e,t)=>{let r=H(e.query);if(!r)throw new Error("query is required");let n=A8(r);if(n.length>0)throw new Error(`platform_graphql refused ${n.join(", ")}: queries pass through unchanged, but mutations are refused except the allow list for client builds and code component versions (${DC.join(", ")}). Make schema changes through ztype_tool_calls (CLI: schema tool-call), which validates each change before it is written.`);let i=e.variables&&typeof e.variables=="object"?e.variables:{};return t.ok(await t.client.request(r,i))},kC={"platform.graphql":x8};p();var N8=async(e,t)=>{let r=await xt(),n=r?.api?.ZTypePredefinedApi;if(!n)return t.fail(new Error("ztype predefined template API is unavailable"));let o=n.getActionFlowTemplates(mo(r)).map(s=>({templateCodeId:s.preDefinedCodeId,displayName:s.displayName,group:s.directory,async:s.async,inputs:s.input,outputs:s.output}));return t.ok({templates:o})},jC={"actionflow.list_node_templates":N8};p();var R8=e=>{if(!e)return null;let t=e.split("?")[0]?.split("/").pop();if(!t)return null;let r=t.replace(/\.[a-z0-9]+$/i,"");return r.length>0?r:null},C8=async(e,t)=>{let n=(await t.client.request(U0)).getTabBarIcons.flatMap(i=>i?[{name:R8(i.url),exId:i.exId}]:[]);return t.ok({icons:n,note:n.length===0?"This deployment ships no preset tab-bar icons; upload one in the editor and use its exId.":"A name ending in _selected is the pressed-state partner of the icon with the same prefix; for the plain icons use the same exId for both states."})},MC={"component.tab_bar_icons":C8};p();p();function P8(e){let t;try{t=new URL(e)}catch{throw new Error(`Unsupported or malformed URL: ${e}`)}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new Error(`Only http/https URLs are allowed: ${e}`);return t}async function D8(e,t){let r=e.body?.getReader();if(!r)throw new Error(`Empty response body from ${t}`);let n=[],i=0;for(;;){let{done:o,value:s}=await r.read();if(o)break;if(i+=s.byteLength,i>10485760)throw await r.cancel(),new Error("Response exceeds size limit of 10485760 bytes");n.push(s)}return Buffer.concat(n).toString("utf8")}async function FC(e){let t=e;for(let r=0;r<=5;r++){let n=P8(t),i=await fetch(n,{redirect:"manual",signal:AbortSignal.timeout(2e4),headers:{Accept:"application/json, application/yaml, text/yaml, text/html, */*","User-Agent":"Momen-Agent-TpaImport"}});if(i.status>=300&&i.status<400){let o=i.headers.get("location");if(await i.body?.cancel(),!o)throw new Error(`Redirect without Location from ${t}`);t=new URL(o,n).toString();continue}if(!i.ok)throw await i.body?.cancel(),new Error(`HTTP ${i.status} fetching ${t}`);return{finalUrl:n.toString(),contentType:i.headers.get("content-type"),body:await D8(i,t)}}throw new Error(`Too many redirects fetching ${e}`)}p();var L8=/(?:href|src|url)\s*[=:]\s*["']?([^"'\s>)]+)/gi,k8=/<(script|style|noscript|svg|iframe|canvas|template|nav|footer|aside)\b[\s\S]*?<\/\1\s*>/gi,j8=new Set(["css","js","png","jpg","jpeg","gif","svg","ico","woff","woff2","ttf","webp","mp4","zip","pdf"]);function qC(e,t){if(e&&e.toLowerCase().includes("html"))return!0;let r=t.trimStart();return r.startsWith("<")&&!r.startsWith("<?xml")}function UC(e){let t=e.length>4e3?e.slice(0,4e3):e;return t.includes('"openapi"')||t.includes('"swagger"')||/(^|\n)\s*openapi\s*:/.test(t)||/(^|\n)\s*swagger\s*:/.test(t)}function VC(e,t){try{return new URL(t,e).toString()}catch{return t.startsWith("http")?t:null}}var M8=/^https?:\/\/app\.swaggerhub\.com\/apis(?:-docs)?\/([^/?#]+)\/([^/?#]+)\/([^/?#]+)/i;function F8(e){let t=e.match(M8);return t?`https://api.swaggerhub.com/apis/${t[1]}/${t[2]}/${t[3]}`:null}function GC(e,t){let r=[],n=i=>{i&&r.length<20&&!r.includes(i)&&r.push(i)};for(let i of e.matchAll(L8)){if(r.length>=20)break;let o=i[1],s=o.toLowerCase();if(!(s.includes("openapi")||s.includes("swagger")||(s.endsWith(".json")||s.endsWith(".yaml")||s.endsWith(".yml"))&&s.includes("api")))continue;let u=VC(t,o);n(u&&F8(u)),n(u)}return r}function $C(e,t){let r=[],n;try{n=new URL(t).host}catch{return r}for(let i of e.matchAll(/<a\b[^>]*href\s*=\s*["']([^"'#]+)[^"']*["']/gi)){if(r.length>=40)break;let o;try{o=new URL(i[1],t)}catch{continue}if(o.host!==n)continue;o.hash="";let s=o.toString(),a=o.pathname.toLowerCase(),u=a.slice(a.lastIndexOf(".")+1);j8.has(u)||s===t||r.includes(s)||r.push(s)}return r}var q8={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ",mdash:"\u2014",ndash:"\u2013",hellip:"\u2026",copy:"\xA9"};function Hy(e){return e.replace(/&#x([0-9a-f]+);/gi,(t,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&#(\d+);/g,(t,r)=>String.fromCodePoint(parseInt(r,10))).replace(/&([a-z]+);/gi,(t,r)=>q8[r.toLowerCase()]??t)}var ga=e=>e.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim();function BC(e,t){let r=e.replace(/<!--[\s\S]*?-->/g,"").replace(k8,"");return r=r.replace(/<pre\b[^>]*>([\s\S]*?)<\/pre\s*>/gi,(n,i)=>`
|
|
1379
1376
|
\`\`\`
|
|
1380
|
-
${
|
|
1377
|
+
${Hy(U8(i))}
|
|
1381
1378
|
\`\`\`
|
|
1382
|
-
`),r=r.replace(/<code\b[^>]*>([\s\S]*?)<\/code\s*>/gi,(n,i)=>`\`${
|
|
1379
|
+
`),r=r.replace(/<code\b[^>]*>([\s\S]*?)<\/code\s*>/gi,(n,i)=>`\`${Hy(ga(i))}\``),r=r.replace(/<a\b[^>]*href\s*=\s*["']([^"']+)["'][^>]*>([\s\S]*?)<\/a\s*>/gi,(n,i,o)=>{let s=ga(o);if(!s)return"";let a=VC(t,i);return a?`[${s}](${a})`:s}),r=r.replace(/<h([1-6])\b[^>]*>([\s\S]*?)<\/h\1\s*>/gi,(n,i,o)=>`
|
|
1383
1380
|
|
|
1384
|
-
${"#".repeat(Number(i))} ${
|
|
1381
|
+
${"#".repeat(Number(i))} ${ga(o)}
|
|
1385
1382
|
|
|
1386
|
-
`),r=r.replace(/<t[hd]\b[^>]*>([\s\S]*?)<\/t[hd]\s*>/gi,(n,i)=>` ${
|
|
1383
|
+
`),r=r.replace(/<t[hd]\b[^>]*>([\s\S]*?)<\/t[hd]\s*>/gi,(n,i)=>` ${ga(i)} |`).replace(/<tr\b[^>]*>/gi,`
|
|
1387
1384
|
|`).replace(/<\/tr\s*>/gi,""),r=r.replace(/<li\b[^>]*>/gi,`
|
|
1388
1385
|
- `).replace(/<br\s*\/?>/gi,`
|
|
1389
1386
|
`).replace(/<\/(p|div|section|article|ul|ol|table|thead|tbody|dl|blockquote)\s*>/gi,`
|
|
1390
1387
|
|
|
1391
|
-
`).replace(/<(strong|b)\b[^>]*>([\s\S]*?)<\/\1\s*>/gi,(n,i,o)=>`**${
|
|
1388
|
+
`).replace(/<(strong|b)\b[^>]*>([\s\S]*?)<\/\1\s*>/gi,(n,i,o)=>`**${ga(o)}**`),r=Hy(r.replace(/<[^>]+>/g," ")),r.replace(/[^\S\n]+\n/g,`
|
|
1392
1389
|
`).replace(/[ \t]{3,}/g," ").replace(/\n{3,}/g,`
|
|
1393
1390
|
|
|
1394
|
-
`).trim()}var C8=e=>e.replace(/<[^>]+>/g,"");var UC=15,D8=3600*1e3,qC=new Map;function L8(e){let t=Date.now(),r=qC.get(e),n=r&&t-r.startedAt<D8?r:{used:0,startedAt:t};return n.used+=1,qC.set(e,n),UC-n.used}var k8=async(e,t)=>{let r=H(e.url);if(!r||r.trim()==="")throw new Error("Provide a 'url' to fetch.");let n=L8(t.credentialStore.getWorkspaceRoot());if(n<0)throw new Error(`fetch budget exhausted (${UC} per session) \u2014 build the endpoints from what you have already read.`);let i=await PC(r),o=DC(i.contentType,i.body),s=o?jC(i.body,i.finalUrl):[],a=o?MC(i.body,i.finalUrl):[],u=o?FC(i.body,i.finalUrl):i.body,c=Math.max(0,Math.min(Ye(e.offset,0),u.length)),l=u.slice(c,c+2e4);return t.ok({finalUrl:i.finalUrl,contentType:i.contentType,looksLikeSpec:LC(i.body),specLinks:s,pageLinks:a,truncated:c+l.length<u.length,totalLength:u.length,fetchesRemaining:n,content:l})},VC={"web.fetch_doc":k8};p();var j8=async(e,t)=>{let r=le(e.secretId),n=le(e.displayName),i=le(e.description);if(!!r==!!n)return t.fail("Provide exactly one of secretId (set an existing secret) or displayName (create a new one).");let o=await t.checkSchema(e),s=await t.getProjectArgs(e),a=nr(s.projectExId,s),u=await t.schemaManager.serverSchemaExId(a);if(!u)throw new Error("A secret value is stored under the project's backend document, which this session could not load \u2014 `schema status` reports why in staleReason.");let c=await VR(n??r),d=(await t.client.request(pA,{projectExId:s.projectExId,schemaExId:u,secretValue:c})).saveSecret?.secretKey;if(!d)throw new Error("saveSecret did not return a secretKey.");let f=r?{name:"UPDATE_SECRET_CONFIG",args:{secretId:r,secretKey:d}}:{name:"ADD_SECRET_CONFIGS",args:{items:[{displayName:n,secretKey:d,...i?{description:i}:{}}]}},h=await t.schemaManager.ztypeToolCalls(a,[f],!1);return t.ok(Nt({status:"SAVED",applied:h},o))},GC={"secret.save_value":j8};p();p();p();import{createHash as M8}from"node:crypto";import Rl from"node:fs/promises";import Cl from"node:path";var ir=class extends Error{},F8=1024,q8=255,U8=e=>{let t=e.slice(e.lastIndexOf("/")+1),r=t.lastIndexOf(".");return r<=0||r===t.length-1?null:t.slice(r+1).toLowerCase()},BC=(e,t)=>Cl.relative(e,t).split(Cl.sep).join("/").normalize("NFC"),V8=e=>{if(e.length>F8||e.startsWith("/")||e.endsWith("/")||e.includes("\\")||e.includes("//")||e.includes(":"))throw new ir(`Invalid asset path: ${e}`);for(let t of e.split("/"))if(t===""||t==="."||t===".."||t.length>q8)throw new ir(`Invalid asset path: ${e}`);for(let t of e){let r=t.charCodeAt(0);if(r<32||r===127)throw new ir(`Invalid asset path: ${e}`)}},G8=async e=>{let t=M8("md5"),r=await Rl.open(e,"r");try{let n=r.createReadStream();for await(let i of n)t.update(i)}finally{await r.close()}return t.digest("base64")},$C=async(e,t,r,n)=>{let i=await Rl.readdir(t,{withFileTypes:!0}),o=[],s=[];for(let a of i){let u=Cl.join(t,a.name),c=n&&a.name.startsWith(".");if(a.isDirectory()){if(c||r.has(a.name)){s.push(`${BC(e,u)}/`);continue}let l=await $C(e,u,r,n);o.push(...l.files),s.push(...l.prunedDirectories)}else a.isFile()&&!c&&o.push(u)}return{files:o,prunedDirectories:s}};async function Pl(e,t,r={}){let n=Cl.resolve(e);if(!(await Rl.stat(n).catch(()=>null))?.isDirectory())throw new ir(`Not a directory: ${n}`);let o=r.maxFileSizeBytes??t.maxFileSizeBytes,s=t.reservedFiles??new Set,a=await $C(n,n,t.ignoredDirectories??new Set,t.ignoreHidden??!1),u=a.files.sort(),c=[],l=[...a.prunedDirectories.sort()],d=[],f=0;for(let h of u){let g=BC(n,h);if(s.has(g)){d.push(g);continue}let v=U8(g);if(v===null||!t.allowedExtensions.has(v)){l.push(g);continue}V8(g);let{size:_}=await Rl.stat(h);if(_>o)throw new ir(`${g} is ${_} bytes, over the ${o}-byte per-file limit`);c.push({path:g,absolutePath:h,md5Base64:await G8(h),sizeBytes:_}),f+=_}if(c.length===0)throw new ir(`No uploadable files found under ${n}`);if(!c.some(h=>h.path===t.entryFile))throw new ir(`${n} has no ${t.entryFile} at its root \u2014 a ${t.label} deployment must have one. ${t.entryHint}`);if(t.maxFileCount!==void 0&&c.length>t.maxFileCount)throw new ir(`${n} holds ${c.length} uploadable files, over the ${t.maxFileCount}-file limit`);if(t.maxTotalBytes!==void 0&&f>t.maxTotalBytes)throw new ir(`${n} totals ${f} bytes, over the ${t.maxTotalBytes}-byte package limit`);return{files:c,totalBytes:f,skipped:l,reserved:d}}var B8=new Set(["html","htm","js","mjs","cjs","css","map","json","webmanifest","txt","xml","csv","wasm","pdf","svg","png","jpg","jpeg","gif","webp","avif","ico","bmp","woff","woff2","ttf","otf","eot","mp4","webm","mp3","wav","ogg"]),$8="index.html",K8=2*1024*1024*1024,H8={label:"static site",entryFile:$8,entryHint:"Point --dir at the build output directory (e.g. ./dist), not the project root.",allowedExtensions:B8,maxFileSizeBytes:K8};function KC(e,t={}){return Pl(e,H8,t)}p();import Q8 from"node:fs/promises";var W8=12e4,z8=1e3/(1024*1024),HC=3,Y8=500,J8=256*1024*1024,X8=e=>new Promise(t=>setTimeout(t,e)),Z8=e=>e>=500||e===429,e6=async(e,t,r)=>{let n=AbortSignal.timeout(Math.ceil(W8+t.byteLength*z8)),i=await fetch(e.uploadUrl,{method:"PUT",headers:e.headers,body:t,signal:r?AbortSignal.any([r,n]):n});if(!i.ok){let o=await i.text().catch(()=>""),s=new Error(`PUT ${e.path} failed with ${i.status}${o?`: ${o.slice(0,300)}`:""}`);throw Z8(i.status)||Object.assign(s,{fatal:!0}),s}await i.body?.cancel()},t6=async(e,t,r)=>{let n=await Q8.readFile(t),i;for(let o=1;o<=HC;o+=1)try{await e6(e,n,r);return}catch(s){if(i=s,r?.aborted||s.fatal||o===HC)break;await X8(Y8*2**(o-1))}throw i},Gy=class{constructor(t){this.limit=t}inFlight=0;waiters=[];async acquire(t){for(;this.inFlight>0&&this.inFlight+t>this.limit;)await new Promise(r=>this.waiters.push(r));this.inFlight+=t}release(t){this.inFlight-=t;let r=this.waiters;this.waiters=[];for(let n of r)n()}};async function Dl(e,t,r,n){let i=[],o=[],s=new Gy(J8),a=0,u=async()=>{for(;;){if(n?.aborted)return;let l=a;if(a+=1,l>=e.length)return;let d=e[l],f=t(d.path);if(!f){o.push({path:d.path,error:"no local file matches this manifest path"});continue}await s.acquire(f.sizeBytes);try{await t6(d,f.absolutePath,n),i.push(d.path)}catch(h){o.push({path:d.path,error:h instanceof Error?h.message:String(h)})}finally{s.release(f.sizeBytes)}}},c=Math.max(1,Math.min(r,e.length));return await Promise.all(Array.from({length:c},()=>u())),{uploaded:i,failures:o}}var r6=8,n6=32,QC=200,i6=6,o6=6e4,s6=3,WC=e=>{let t=(H(e.target)??"BETA").toUpperCase();if(t!=="BETA"&&t!=="PROD")throw new Error(`target must be BETA or PROD, got ${t}`);return t},By=async(e,t)=>{let r=await t.getProjectArgs(e),n=r.appExId??null;if(!n)throw new Error("site commands act on a client app, and this call resolved to the project itself. Pin one with set_current_project (appExId), or pass appExId here; take it from `project metadata` -> apps[], the entry whose appType is WEB. A project with no client app has no site domain and cannot host a static site.");return{projectExId:r.projectExId,appExId:n,target:WC(e)}},$y=(e,t)=>t.client.request(cA,e),zC=(e,t,r)=>r.client.request(uA,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t}),YC=async(e,t,r,n)=>(await n.client.request(aA,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t,dryRun:r})).completeStaticSiteDeployment,JC=async(e,t,r,n,i)=>{let o=await i.client.request(sA,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t,offset:n?null:r,limit:n?null:QC,paths:n}),s=(o.staticSiteUploadUrls.items??[]).filter(u=>u!==null),a=s.map(u=>Date.parse(String(u.expiresAt??""))).filter(u=>Number.isFinite(u));return{targets:s.map(u=>({path:u.path??"",uploadUrl:u.uploadUrl??"",headers:u.headers??{}})),nextOffset:o.staticSiteUploadUrls.nextOffset??null,expiresAt:a.length?Math.min(...a):null}},a6=e=>e!==null&&e-o6<=Date.now(),u6=async(e,t,r,n,i,o)=>{let s=[],a=[],u=r;for(let c=1;;c+=1){let l=await Dl(u.targets,h=>n.get(h),i,o.signal);s.push(...l.uploaded);let f=a6(u.expiresAt)&&c<s6&&!o.signal?.aborted?l.failures.filter(h=>n.has(h.path)):[];if(a.push(...l.failures.filter(h=>!f.includes(h))),f.length===0)return{uploaded:s,failures:a};u=await JC(e,t,null,f.map(h=>h.path),o)}},c6=async(e,t,r,n,i,o)=>{let s=[],a=[],u=i?null:0,c=i?[...i]:null;for(;;){o.signal?.throwIfAborted();let l=c?.splice(0,QC)??null;if(l&&l.length===0)break;let d=await JC(e,t,l?null:u,l,o),f=await u6(e,t,d,r,n,o);if(s.push(...f.uploaded),a.push(...f.failures),l)continue;let h=d.nextOffset;if(h!==null&&u!==null&&h<=u)throw new Error(`upload url pagination stalled at offset ${u} (server returned ${h})`);if(u=h,u===null)break}return{uploaded:s,failures:a}},l6=(e,t)=>{if(e.length!==t.length)return!1;let r=new Map(t.map(n=>[n.path??"",n.md5Base64??""]));return e.every(n=>r.get(n.path)===n.md5Base64)},p6=async(e,t,r,n)=>{let o=(await $y(e,n)).inProgressStaticSiteDeployment;if(o){if(!r&&l6(t,o.manifest))return{deploymentExId:o.exId,resumed:!0,resumedStatus:o.status};await zC(e,o.exId,n)}return{deploymentExId:(await n.client.request(oA,{projectExId:e.projectExId,appExId:e.appExId,target:e.target,files:t.map(a=>({path:a.path,md5Base64:a.md5Base64,sizeBytes:a.sizeBytes}))})).createStaticSiteDeployment.exId,resumed:!1,resumedStatus:null}},XC=e=>{let t=(e.missingPaths??[]).filter(r=>typeof r=="string");return e.missingCount>t.length?null:t},d6=async(e,t,r,n)=>r!=="UPLOADING"?null:XC(await YC(e,t,!0,n)),f6=async(e,t)=>{let r=oi(e.dir,"dir"),n=Ve(e.dryRun,!1),i=Ve(e.force,!1),o=WC(e),s=Math.max(1,Math.min(Ye(e.concurrency,r6),n6)),a=await KC(r);if(n)return t.ok({dryRun:!0,target:o,fileCount:a.files.length,totalBytes:a.totalBytes,skipped:a.skipped,files:a.files.map(A=>({path:A.path,sizeBytes:A.sizeBytes}))});let u=await By(e,t);u.target==="PROD"&&await da(u.projectExId,e,"deploy to production",{allowForce:!1});let c=new Map(a.files.map(A=>[A.path,A])),{deploymentExId:l,resumed:d,resumedStatus:f}=await p6(u,a.files,i,t),h=d?await d6(u,l,f,t):null,g=new Set,v=[],_=null,S=Number.POSITIVE_INFINITY,b=0;for(let A=1;A<=i6;A+=1){b=A;let w=await c6(u,l,c,s,h,t);for(let T of w.uploaded)g.add(T);if(v=w.failures,_=await YC(u,l,!1,t),!_.incomplete||_.missingCount>=S||(S=_.missingCount,h=XC(_),h?.length===0))break}return!_||_.incomplete?t.fail(new Error(`deployment ${l} is still missing ${_?.missingCount??"?"} file(s) after ${b} upload pass(es): ${(_?.missingPaths??[]).slice(0,10).join(", ")}${v.length?`; upload errors: ${v[0].error}`:""}. Re-run to resume, or pass force=true to start over.`)):t.ok({deploymentExId:l,target:u.target,resumed:d,fileCount:a.files.length,totalBytes:a.totalBytes,uploaded:g.size,skipped:a.skipped,siteUrl:_.siteUrl,previousDeploymentExId:_.previousDeploymentExId,...v.length?{uploadRetries:v}:{}})},h6=async(e,t)=>{let r=await By(e,t),n=await $y(r,t);return t.ok({target:r.target,inProgress:n.inProgressStaticSiteDeployment?{deploymentExId:n.inProgressStaticSiteDeployment.exId,status:n.inProgressStaticSiteDeployment.status,fileCount:n.inProgressStaticSiteDeployment.fileCount,totalBytes:n.inProgressStaticSiteDeployment.totalBytes,createdAt:n.inProgressStaticSiteDeployment.createdAt}:null,active:n.activeStaticSiteDeployment?{deploymentExId:n.activeStaticSiteDeployment.exId,siteUrl:n.activeStaticSiteDeployment.siteUrl,fileCount:n.activeStaticSiteDeployment.fileCount,totalBytes:n.activeStaticSiteDeployment.totalBytes,activatedAt:n.activeStaticSiteDeployment.activatedAt}:null})},m6=async(e,t)=>{let r=await By(e,t),i=H(e.deploymentExId)??(await $y(r,t)).inProgressStaticSiteDeployment?.exId;if(!i)return t.ok({target:r.target,aborted:null},"no in-progress deployment to abort");let o=await zC(r,i,t);return t.ok({deploymentExId:i,target:r.target,status:o.abortStaticSiteDeployment.status})},ZC={"site.deploy":f6,"site.status":h6,"site.abort":m6};p();import rP from"node:fs/promises";import nP from"node:path";p();var g6=new Set(["js","ts","json","wxml","wxss","wxs","png","jpg","jpeg","gif","svg","webp","ico","ttf","otf","woff","woff2","mp3","mp4","wasm","cer","txt"]),y6=new Set(["project.config.json","project.private.config.json"]),v6=new Set(["node_modules"]),E6="app.json",_6=5e3,eP=20*1024*1024,b6={label:"WeChat mini program source",entryFile:E6,entryHint:"Point --dir at the mini program root (the directory holding app.js / app.json / app.wxss).",allowedExtensions:g6,ignoredDirectories:v6,ignoreHidden:!0,reservedFiles:y6,maxFileSizeBytes:eP,maxFileCount:_6,maxTotalBytes:eP};function tP(e,t={}){return Pl(e,b6,t)}var S6=8,T6=32,iP=200,I6=6,O6=6e4,w6=3,A6=900,x6=5e3,oP="wechat-trial-qrcode.jpg",Ll=async(e,t)=>{let r=await t.getProjectArgs(e),n=r.appExId??null;if(!n)throw new Error("wechat commands act on a mini program app, and this call resolved to the project itself. Pin one with set_current_project (appExId), or pass appExId here; take it from `project metadata` -> apps[], the entry whose appType is WECHAT_MINI_PROGRAM. A project without that client app has no mini program to upload.");return{projectExId:r.projectExId,appExId:n}},Ky=(e,t)=>t.client.request(gA,e),sP=(e,t,r)=>r.client.request(mA,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t}),aP=async(e,t,r,n)=>(await n.client.request(hA,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t,dryRun:r})).completeWechatSourceCodeUpload,uP=async(e,t,r,n,i)=>{let o=await i.client.request(fA,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t,offset:n?null:r,limit:n?null:iP,paths:n}),s=(o.wechatSourceCodeUploadUrls.items??[]).filter(u=>u!==null),a=s.map(u=>Date.parse(String(u.expiresAt??""))).filter(u=>Number.isFinite(u));return{targets:s.map(u=>({path:u.path??"",uploadUrl:u.uploadUrl??"",headers:u.headers??{}})),nextOffset:o.wechatSourceCodeUploadUrls.nextOffset??null,expiresAt:a.length?Math.min(...a):null}},N6=e=>e!==null&&e-O6<=Date.now(),R6=async(e,t,r,n,i,o)=>{let s=[],a=[],u=r;for(let c=1;;c+=1){let l=await Dl(u.targets,h=>n.get(h),i,o.signal);s.push(...l.uploaded);let f=N6(u.expiresAt)&&c<w6&&!o.signal?.aborted?l.failures.filter(h=>n.has(h.path)):[];if(a.push(...l.failures.filter(h=>!f.includes(h))),f.length===0)return{uploaded:s,failures:a};u=await uP(e,t,null,f.map(h=>h.path),o)}},C6=async(e,t,r,n,i,o)=>{let s=[],a=[],u=i?null:0,c=i?[...i]:null;for(;;){o.signal?.throwIfAborted();let l=c?.splice(0,iP)??null;if(l&&l.length===0)break;let d=await uP(e,t,l?null:u,l,o),f=await R6(e,t,d,r,n,o);if(s.push(...f.uploaded),a.push(...f.failures),l)continue;let h=d.nextOffset;if(h!==null&&u!==null&&h<=u)throw new Error(`upload url pagination stalled at offset ${u} (server returned ${h})`);if(u=h,u===null)break}return{uploaded:s,failures:a}},P6=(e,t)=>{if(e.length!==t.length)return!1;let r=new Map(t.map(n=>[n.path??"",n.md5Base64??""]));return e.every(n=>r.get(n.path)===n.md5Base64)},D6=async(e,t,r,n)=>{let i=await Ky(e,n),o=i.buildingWechatSourceCodeDeployment;if(o)throw new Error(`deployment ${o.exId} is already BUILDING (started ${o.buildStartedAt}) \u2014 a build cannot be aborted and blocks the next upload. Wait for it to finish, then re-run.`);let s=i.inProgressWechatSourceCodeDeployment;if(s){if(!r&&P6(t,s.manifest))return{deploymentExId:s.exId,resumed:!0,resumedStatus:s.status};await sP(e,s.exId,n)}return{deploymentExId:(await n.client.request(dA,{projectExId:e.projectExId,appExId:e.appExId,files:t.map(u=>({path:u.path,md5Base64:u.md5Base64,sizeBytes:u.sizeBytes}))})).createWechatSourceCodeDeployment.exId,resumed:!1,resumedStatus:null}},cP=e=>{let t=(e.missingPaths??[]).filter(r=>typeof r=="string");return e.missingCount>t.length?null:t},L6=async(e,t,r,n)=>r!=="UPLOADING"?null:cP(await aP(e,t,!0,n)),k6=async(e,t,r)=>(await r.client.request(yA,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t})).wechatSourceCodeDeployment,lP=async(e,t)=>(await t.client.request(vA,{projectExId:e.projectExId})).project,j6=async(e,t)=>(await t.client.request(EA,{projectExId:e.projectExId})).project,M6=(e,t)=>new Promise((r,n)=>{let i=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e),o=()=>{clearTimeout(i),n(t?.reason??new Error("aborted"))};if(t?.aborted){o();return}t?.addEventListener("abort",o,{once:!0})}),pP=async(e,t)=>{let r=nP.resolve(t),n=Buffer.from(e,"base64");return await rP.mkdir(nP.dirname(r),{recursive:!0}),await rP.writeFile(r,n),{qrCodePath:r,qrCodeBytes:n.length}},F6=async(e,t,r,n)=>{let i=Date.now(),o=i+r*1e3;for(;;){n.signal?.throwIfAborted();let a=(await k6(e,t,n))?.status??null,u=Math.round((Date.now()-i)/1e3);if(a!=="BUILDING"&&a!=="UPLOADING")return{status:a,timedOut:!1,waitedSeconds:u};if(Date.now()>=o)return{status:a,timedOut:!0,waitedSeconds:u};await M6(Math.min(x6,Math.max(0,o-Date.now())),n.signal)}},q6=async(e,t)=>{let r=oi(e.dir,"dir"),n=Ve(e.dryRun,!1),i=Ve(e.force,!1),o=Ve(e.wait,!0),s=Math.max(0,Ye(e.timeoutSeconds,A6)),a=H(e.qrOut)??oP,u=Math.max(1,Math.min(Ye(e.concurrency,S6),T6)),c=await tP(r);if(n)return t.ok({dryRun:!0,fileCount:c.files.length,totalBytes:c.totalBytes,skipped:c.skipped,serverManaged:c.reserved,files:c.files.map(pe=>({path:pe.path,sizeBytes:pe.sizeBytes}))});let l=await Ll(e,t),d=new Map(c.files.map(pe=>[pe.path,pe])),{deploymentExId:f,resumed:h,resumedStatus:g}=await D6(l,c.files,i,t),v=h?await L6(l,f,g,t):null,_=new Set,S=[],b=null,A=Number.POSITIVE_INFINITY,w=0;for(let pe=1;pe<=I6;pe+=1){w=pe;let ge=await C6(l,f,d,u,v,t);for(let I of ge.uploaded)_.add(I);if(S=ge.failures,b=await aP(l,f,!1,t),!b.incomplete||b.missingCount>=A||(A=b.missingCount,v=cP(b),v?.length===0))break}if(!b||b.incomplete)return t.fail(new Error(`deployment ${f} is still missing ${b?.missingCount??"?"} file(s) after ${w} upload pass(es): ${(b?.missingPaths??[]).slice(0,10).join(", ")}${S.length?`; upload errors: ${S[0].error}`:""}. Re-run to resume, or pass force=true to start over.`));let T={deploymentExId:f,resumed:h,fileCount:c.files.length,totalBytes:c.totalBytes,uploaded:_.size,skipped:c.skipped,serverManaged:c.reserved,deploymentRecordExId:b.deploymentRecordExId,...S.length?{uploadRetries:S}:{}};if(!o)return t.ok({...T,status:b.status,waited:!1});let x=await F6(l,f,s,t);if(x.timedOut)return t.ok({...T,status:x.status,waited:!0,timedOut:!0,waitedSeconds:x.waitedSeconds},`build is still running after ${x.waitedSeconds}s \u2014 poll \`wechat status\` for the trial version`);if(x.status!=="SUCCEEDED")return t.fail(new Error(`deployment ${f} ended in ${x.status} after ${x.waitedSeconds}s. The upload landed but the WeChat build did not succeed; check the deployment record ${b.deploymentRecordExId??"(none)"} for the failure.`));let U=await lP(l,t),N=U?.wechatMiniAppQRCodeBase64??null,te=N?await pP(N,a):null;return t.ok({...T,status:x.status,waited:!0,waitedSeconds:x.waitedSeconds,trialVersion:U?.wechatMiniAppPreviewVersion??null,trialVersionCommittedAt:U?.wechatMiniAppPreviewTime??null,...te??{qrCodePath:null}})},U6=async(e,t)=>{let r=await Ll(e,t),n=await Ky(r,t),i=await j6(r,t);return t.ok({trial:{version:i?.wechatMiniAppPreviewVersion??null,committedAt:i?.wechatMiniAppPreviewTime??null},inProgress:n.inProgressWechatSourceCodeDeployment?{deploymentExId:n.inProgressWechatSourceCodeDeployment.exId,status:n.inProgressWechatSourceCodeDeployment.status,fileCount:n.inProgressWechatSourceCodeDeployment.fileCount,totalBytes:n.inProgressWechatSourceCodeDeployment.totalBytes,createdAt:n.inProgressWechatSourceCodeDeployment.createdAt,lastUploadUrlIssuedAt:n.inProgressWechatSourceCodeDeployment.lastUploadUrlIssuedAt}:null,building:n.buildingWechatSourceCodeDeployment?{deploymentExId:n.buildingWechatSourceCodeDeployment.exId,status:n.buildingWechatSourceCodeDeployment.status,fileCount:n.buildingWechatSourceCodeDeployment.fileCount,totalBytes:n.buildingWechatSourceCodeDeployment.totalBytes,buildStartedAt:n.buildingWechatSourceCodeDeployment.buildStartedAt,deploymentRecordExId:n.buildingWechatSourceCodeDeployment.deploymentRecordExId}:null})},V6=async(e,t)=>{let r=await Ll(e,t),i=H(e.deploymentExId)??(await Ky(r,t)).inProgressWechatSourceCodeDeployment?.exId;if(!i)return t.ok({aborted:null},"no in-progress upload to abort");let o=await sP(r,i,t);return t.ok({deploymentExId:i,status:o.abortWechatSourceCodeDeployment.status})},G6=async(e,t)=>{let r=await Ll(e,t),n=H(e.out)??oP,i=await lP(r,t),o=i?.wechatMiniAppQRCodeBase64??null;if(!o)return t.fail(new Error("no trial version QR code is available for this project yet \u2014 run `wechat deploy` and let the build finish first."));let s=await pP(o,n);return t.ok({...s,trialVersion:i?.wechatMiniAppPreviewVersion??null,trialVersionCommittedAt:i?.wechatMiniAppPreviewTime??null})},dP={"wechat.deploy":q6,"wechat.status":U6,"wechat.abort":V6,"wechat.qrcode":G6};p();var fP={...RR,...FR,...$R,...KR,...nC,...EC,...TC,...xC,...NC,...RC,...CC,...VC,...GC,...ZC,...dP};p();p();var B6=new Map([["claude-code","Claude Code"],["codex-mcp-client","Codex"]]);function hP(e){let t=typeof e?.name=="string"?e.name:"",r=typeof e?.title=="string"?e.title:"";return B6.get(t)??(r||t||"the coding agent")}function kl(e="the coding agent"){return`quit ${e} completely and open it again (starting a new chat in the same window may keep the old tools)`}function si(e,t,r){let n=`${X} ${e.current} is older than the minimum supported version ${e.minSupported} (latest ${e.latest})`,i=t?`, and upgrading it automatically failed: ${t}`:"";return`${n}${i}. Calls to the backend keep failing until it is upgraded, so stop retrying and tell the user, in their language: update the ${cv} plugin from the plugin marketplace (or run \`npm i -g ${X}@latest\` if ${X} was installed with npm), then ${kl(r)} so it starts the new version.`}function mP(e,t){return`${X} is upgrading itself from ${e} to ${t} in the background because the backend no longer supports ${e}. Nothing is broken and the user does not need to do anything: retry this call in about a minute.`}function gP(e,t,r){return`Note: ${X} upgraded itself from ${e} to ${t} during this session and ran this call on ${t}, but ${r} did not reload its tool list, so tools added in ${t} are not visible to you. Tell the user once, in their language, that ${X} was upgraded and that to use the new version's tools they should ${kl(r)}. Then carry on with their request; everything that worked before still works.`}function yP(e,t,r,n){let i=kl(r);return n.upgradedFrom&&n.toolListReloaded?`${X} has no tool ${e}. ${X} upgraded itself from ${n.upgradedFrom} to ${t} during this session and ${r} has already reloaded its tool list, so ${e} was from the old list: use the tools you have now instead. The user does not need to restart anything.`:n.upgradedFrom?`${X} has no tool ${e}. ${X} upgraded itself from ${n.upgradedFrom} to ${t} during this session, so your tool list is still the ${n.upgradedFrom} one. Tell the user, in their language, to ${i} so you get the current tools, then try again.`:`${X} ${t} has no tool ${e}. Use only the tools in your current tool list; if that list was loaded from another ${X} version, tell the user, in their language, to ${i}, then try again.`}function vP(e,t,r,n){return n?`${X} upgraded itself from ${e} to ${t} during this session and ${r} has already reloaded its tool list, so check this tool's current arguments and try again.`:`${X} upgraded itself from ${e} to ${t} during this session, so this tool's arguments may have changed since your tool list was loaded. If the error does not make sense against your tool list, tell the user, in their language, to ${kl(r)}.`}var $6=$`
|
|
1391
|
+
`).trim()}var U8=e=>e.replace(/<[^>]+>/g,"");var HC=15,G8=3600*1e3,KC=new Map;function $8(e){let t=Date.now(),r=KC.get(e),n=r&&t-r.startedAt<G8?r:{used:0,startedAt:t};return n.used+=1,KC.set(e,n),HC-n.used}var B8=async(e,t)=>{let r=H(e.url);if(!r||r.trim()==="")throw new Error("Provide a 'url' to fetch.");let n=$8(t.credentialStore.getWorkspaceRoot());if(n<0)throw new Error(`fetch budget exhausted (${HC} per session) \u2014 build the endpoints from what you have already read.`);let i=await FC(r),o=qC(i.contentType,i.body),s=o?GC(i.body,i.finalUrl):[],a=o?$C(i.body,i.finalUrl):[],u=o?BC(i.body,i.finalUrl):i.body,c=Math.max(0,Math.min(Ye(e.offset,0),u.length)),l=u.slice(c,c+2e4);return t.ok({finalUrl:i.finalUrl,contentType:i.contentType,looksLikeSpec:UC(i.body),specLinks:s,pageLinks:a,truncated:c+l.length<u.length,totalLength:u.length,fetchesRemaining:n,content:l})},QC={"web.fetch_doc":B8};p();var K8=async(e,t)=>{let r=le(e.secretId),n=le(e.displayName),i=le(e.description);if(!!r==!!n)return t.fail("Provide exactly one of secretId (set an existing secret) or displayName (create a new one).");let o=await t.checkSchema(e),s=await t.getProjectArgs(e),a=nr(s.projectExId,s),u=await t.schemaManager.serverSchemaExId(a);if(!u)throw new Error("A secret value is stored under the project's backend document, which this session could not load \u2014 `schema status` reports why in staleReason.");let c=await HR(n??r),d=(await t.client.request(gA,{projectExId:s.projectExId,schemaExId:u,secretValue:c})).saveSecret?.secretKey;if(!d)throw new Error("saveSecret did not return a secretKey.");let f=r?{name:"UPDATE_SECRET_CONFIG",args:{secretId:r,secretKey:d}}:{name:"ADD_SECRET_CONFIGS",args:{items:[{displayName:n,secretKey:d,...i?{description:i}:{}}]}},h=await t.schemaManager.ztypeToolCalls(a,[f],!1);return t.ok(Nt({status:"SAVED",applied:h},o))},WC={"secret.save_value":K8};p();p();p();import{createHash as H8}from"node:crypto";import Dl from"node:fs/promises";import Ll from"node:path";var ir=class extends Error{},Q8=1024,W8=255,z8=e=>{let t=e.slice(e.lastIndexOf("/")+1),r=t.lastIndexOf(".");return r<=0||r===t.length-1?null:t.slice(r+1).toLowerCase()},zC=(e,t)=>Ll.relative(e,t).split(Ll.sep).join("/").normalize("NFC"),Y8=e=>{if(e.length>Q8||e.startsWith("/")||e.endsWith("/")||e.includes("\\")||e.includes("//")||e.includes(":"))throw new ir(`Invalid asset path: ${e}`);for(let t of e.split("/"))if(t===""||t==="."||t===".."||t.length>W8)throw new ir(`Invalid asset path: ${e}`);for(let t of e){let r=t.charCodeAt(0);if(r<32||r===127)throw new ir(`Invalid asset path: ${e}`)}},J8=async e=>{let t=H8("md5"),r=await Dl.open(e,"r");try{let n=r.createReadStream();for await(let i of n)t.update(i)}finally{await r.close()}return t.digest("base64")},YC=async(e,t,r,n)=>{let i=await Dl.readdir(t,{withFileTypes:!0}),o=[],s=[];for(let a of i){let u=Ll.join(t,a.name),c=n&&a.name.startsWith(".");if(a.isDirectory()){if(c||r.has(a.name)){s.push(`${zC(e,u)}/`);continue}let l=await YC(e,u,r,n);o.push(...l.files),s.push(...l.prunedDirectories)}else a.isFile()&&!c&&o.push(u)}return{files:o,prunedDirectories:s}};async function kl(e,t,r={}){let n=Ll.resolve(e);if(!(await Dl.stat(n).catch(()=>null))?.isDirectory())throw new ir(`Not a directory: ${n}`);let o=r.maxFileSizeBytes??t.maxFileSizeBytes,s=t.reservedFiles??new Set,a=await YC(n,n,t.ignoredDirectories??new Set,t.ignoreHidden??!1),u=a.files.sort(),c=[],l=[...a.prunedDirectories.sort()],d=[],f=0;for(let h of u){let g=zC(n,h);if(s.has(g)){d.push(g);continue}let v=z8(g);if(v===null||!t.allowedExtensions.has(v)){l.push(g);continue}Y8(g);let{size:_}=await Dl.stat(h);if(_>o)throw new ir(`${g} is ${_} bytes, over the ${o}-byte per-file limit`);c.push({path:g,absolutePath:h,md5Base64:await J8(h),sizeBytes:_}),f+=_}if(c.length===0)throw new ir(`No uploadable files found under ${n}`);if(!c.some(h=>h.path===t.entryFile))throw new ir(`${n} has no ${t.entryFile} at its root \u2014 a ${t.label} deployment must have one. ${t.entryHint}`);if(t.maxFileCount!==void 0&&c.length>t.maxFileCount)throw new ir(`${n} holds ${c.length} uploadable files, over the ${t.maxFileCount}-file limit`);if(t.maxTotalBytes!==void 0&&f>t.maxTotalBytes)throw new ir(`${n} totals ${f} bytes, over the ${t.maxTotalBytes}-byte package limit`);return{files:c,totalBytes:f,skipped:l,reserved:d}}var X8=new Set(["html","htm","js","mjs","cjs","css","map","json","webmanifest","txt","xml","csv","wasm","pdf","svg","png","jpg","jpeg","gif","webp","avif","ico","bmp","woff","woff2","ttf","otf","eot","mp4","webm","mp3","wav","ogg"]),Z8="index.html",e6=2*1024*1024*1024,t6={label:"static site",entryFile:Z8,entryHint:"Point --dir at the build output directory (e.g. ./dist), not the project root.",allowedExtensions:X8,maxFileSizeBytes:e6};function JC(e,t={}){return kl(e,t6,t)}p();import r6 from"node:fs/promises";var n6=12e4,i6=1e3/(1024*1024),XC=3,o6=500,s6=256*1024*1024,a6=e=>new Promise(t=>setTimeout(t,e)),u6=e=>e>=500||e===429,c6=async(e,t,r)=>{let n=AbortSignal.timeout(Math.ceil(n6+t.byteLength*i6)),i=await fetch(e.uploadUrl,{method:"PUT",headers:e.headers,body:t,signal:r?AbortSignal.any([r,n]):n});if(!i.ok){let o=await i.text().catch(()=>""),s=new Error(`PUT ${e.path} failed with ${i.status}${o?`: ${o.slice(0,300)}`:""}`);throw u6(i.status)||Object.assign(s,{fatal:!0}),s}await i.body?.cancel()},l6=async(e,t,r)=>{let n=await r6.readFile(t),i;for(let o=1;o<=XC;o+=1)try{await c6(e,n,r);return}catch(s){if(i=s,r?.aborted||s.fatal||o===XC)break;await a6(o6*2**(o-1))}throw i},Qy=class{constructor(t){this.limit=t}inFlight=0;waiters=[];async acquire(t){for(;this.inFlight>0&&this.inFlight+t>this.limit;)await new Promise(r=>this.waiters.push(r));this.inFlight+=t}release(t){this.inFlight-=t;let r=this.waiters;this.waiters=[];for(let n of r)n()}};async function jl(e,t,r,n){let i=[],o=[],s=new Qy(s6),a=0,u=async()=>{for(;;){if(n?.aborted)return;let l=a;if(a+=1,l>=e.length)return;let d=e[l],f=t(d.path);if(!f){o.push({path:d.path,error:"no local file matches this manifest path"});continue}await s.acquire(f.sizeBytes);try{await l6(d,f.absolutePath,n),i.push(d.path)}catch(h){o.push({path:d.path,error:h instanceof Error?h.message:String(h)})}finally{s.release(f.sizeBytes)}}},c=Math.max(1,Math.min(r,e.length));return await Promise.all(Array.from({length:c},()=>u())),{uploaded:i,failures:o}}var p6=8,d6=32,ZC=200,f6=6,h6=6e4,m6=3,eP=e=>{let t=(H(e.target)??"BETA").toUpperCase();if(t!=="BETA"&&t!=="PROD")throw new Error(`target must be BETA or PROD, got ${t}`);return t},Wy=async(e,t)=>{let r=await t.getProjectArgs(e),n=r.appExId??null;if(!n)throw new Error("site commands act on a client app, and this call resolved to the project itself. Pin one with set_current_project (appExId), or pass appExId here; take it from `project metadata` -> apps[], the entry whose appType is WEB. A project with no client app has no site domain and cannot host a static site.");return{projectExId:r.projectExId,appExId:n,target:eP(e)}},zy=(e,t)=>t.client.request(hA,e),tP=(e,t,r)=>r.client.request(fA,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t}),rP=async(e,t,r,n)=>(await n.client.request(dA,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t,dryRun:r})).completeStaticSiteDeployment,nP=async(e,t,r,n,i)=>{let o=await i.client.request(pA,{projectExId:e.projectExId,appExId:e.appExId,staticSiteDeploymentExId:t,offset:n?null:r,limit:n?null:ZC,paths:n}),s=(o.staticSiteUploadUrls.items??[]).filter(u=>u!==null),a=s.map(u=>Date.parse(String(u.expiresAt??""))).filter(u=>Number.isFinite(u));return{targets:s.map(u=>({path:u.path??"",uploadUrl:u.uploadUrl??"",headers:u.headers??{}})),nextOffset:o.staticSiteUploadUrls.nextOffset??null,expiresAt:a.length?Math.min(...a):null}},g6=e=>e!==null&&e-h6<=Date.now(),y6=async(e,t,r,n,i,o)=>{let s=[],a=[],u=r;for(let c=1;;c+=1){let l=await jl(u.targets,h=>n.get(h),i,o.signal);s.push(...l.uploaded);let f=g6(u.expiresAt)&&c<m6&&!o.signal?.aborted?l.failures.filter(h=>n.has(h.path)):[];if(a.push(...l.failures.filter(h=>!f.includes(h))),f.length===0)return{uploaded:s,failures:a};u=await nP(e,t,null,f.map(h=>h.path),o)}},v6=async(e,t,r,n,i,o)=>{let s=[],a=[],u=i?null:0,c=i?[...i]:null;for(;;){o.signal?.throwIfAborted();let l=c?.splice(0,ZC)??null;if(l&&l.length===0)break;let d=await nP(e,t,l?null:u,l,o),f=await y6(e,t,d,r,n,o);if(s.push(...f.uploaded),a.push(...f.failures),l)continue;let h=d.nextOffset;if(h!==null&&u!==null&&h<=u)throw new Error(`upload url pagination stalled at offset ${u} (server returned ${h})`);if(u=h,u===null)break}return{uploaded:s,failures:a}},E6=(e,t)=>{if(e.length!==t.length)return!1;let r=new Map(t.map(n=>[n.path??"",n.md5Base64??""]));return e.every(n=>r.get(n.path)===n.md5Base64)},_6=async(e,t,r,n)=>{let o=(await zy(e,n)).inProgressStaticSiteDeployment;if(o){if(!r&&E6(t,o.manifest))return{deploymentExId:o.exId,resumed:!0,resumedStatus:o.status};await tP(e,o.exId,n)}return{deploymentExId:(await n.client.request(lA,{projectExId:e.projectExId,appExId:e.appExId,target:e.target,files:t.map(a=>({path:a.path,md5Base64:a.md5Base64,sizeBytes:a.sizeBytes}))})).createStaticSiteDeployment.exId,resumed:!1,resumedStatus:null}},iP=e=>{let t=(e.missingPaths??[]).filter(r=>typeof r=="string");return e.missingCount>t.length?null:t},b6=async(e,t,r,n)=>r!=="UPLOADING"?null:iP(await rP(e,t,!0,n)),S6=async(e,t)=>{let r=oi(e.dir,"dir"),n=Ge(e.dryRun,!1),i=Ge(e.force,!1),o=eP(e),s=Math.max(1,Math.min(Ye(e.concurrency,p6),d6)),a=await JC(r);if(n)return t.ok({dryRun:!0,target:o,fileCount:a.files.length,totalBytes:a.totalBytes,skipped:a.skipped,files:a.files.map(A=>({path:A.path,sizeBytes:A.sizeBytes}))});let u=await Wy(e,t);u.target==="PROD"&&await fa(u.projectExId,e,"deploy to production",{allowForce:!1});let c=new Map(a.files.map(A=>[A.path,A])),{deploymentExId:l,resumed:d,resumedStatus:f}=await _6(u,a.files,i,t),h=d?await b6(u,l,f,t):null,g=new Set,v=[],_=null,S=Number.POSITIVE_INFINITY,b=0;for(let A=1;A<=f6;A+=1){b=A;let O=await v6(u,l,c,s,h,t);for(let T of O.uploaded)g.add(T);if(v=O.failures,_=await rP(u,l,!1,t),!_.incomplete||_.missingCount>=S||(S=_.missingCount,h=iP(_),h?.length===0))break}return!_||_.incomplete?t.fail(new Error(`deployment ${l} is still missing ${_?.missingCount??"?"} file(s) after ${b} upload pass(es): ${(_?.missingPaths??[]).slice(0,10).join(", ")}${v.length?`; upload errors: ${v[0].error}`:""}. Re-run to resume, or pass force=true to start over.`)):t.ok({deploymentExId:l,target:u.target,resumed:d,fileCount:a.files.length,totalBytes:a.totalBytes,uploaded:g.size,skipped:a.skipped,siteUrl:_.siteUrl,previousDeploymentExId:_.previousDeploymentExId,...v.length?{uploadRetries:v}:{}})},T6=async(e,t)=>{let r=await Wy(e,t),n=await zy(r,t);return t.ok({target:r.target,inProgress:n.inProgressStaticSiteDeployment?{deploymentExId:n.inProgressStaticSiteDeployment.exId,status:n.inProgressStaticSiteDeployment.status,fileCount:n.inProgressStaticSiteDeployment.fileCount,totalBytes:n.inProgressStaticSiteDeployment.totalBytes,createdAt:n.inProgressStaticSiteDeployment.createdAt}:null,active:n.activeStaticSiteDeployment?{deploymentExId:n.activeStaticSiteDeployment.exId,siteUrl:n.activeStaticSiteDeployment.siteUrl,fileCount:n.activeStaticSiteDeployment.fileCount,totalBytes:n.activeStaticSiteDeployment.totalBytes,activatedAt:n.activeStaticSiteDeployment.activatedAt}:null})},I6=async(e,t)=>{let r=await Wy(e,t),i=H(e.deploymentExId)??(await zy(r,t)).inProgressStaticSiteDeployment?.exId;if(!i)return t.ok({target:r.target,aborted:null},"no in-progress deployment to abort");let o=await tP(r,i,t);return t.ok({deploymentExId:i,target:r.target,status:o.abortStaticSiteDeployment.status})},oP={"site.deploy":S6,"site.status":T6,"site.abort":I6};p();import uP from"node:fs/promises";import cP from"node:path";p();var w6=new Set(["js","ts","json","wxml","wxss","wxs","png","jpg","jpeg","gif","svg","webp","ico","ttf","otf","woff","woff2","mp3","mp4","wasm","cer","txt"]),O6=new Set(["project.config.json","project.private.config.json"]),A6=new Set(["node_modules"]),x6="app.json",N6=5e3,sP=20*1024*1024,R6={label:"WeChat mini program source",entryFile:x6,entryHint:"Point --dir at the mini program root (the directory holding app.js / app.json / app.wxss).",allowedExtensions:w6,ignoredDirectories:A6,ignoreHidden:!0,reservedFiles:O6,maxFileSizeBytes:sP,maxFileCount:N6,maxTotalBytes:sP};function aP(e,t={}){return kl(e,R6,t)}var C6=8,P6=32,lP=200,D6=6,L6=6e4,k6=3,j6=900,M6=5e3,pP="wechat-trial-qrcode.jpg",Ml=async(e,t)=>{let r=await t.getProjectArgs(e),n=r.appExId??null;if(!n)throw new Error("wechat commands act on a mini program app, and this call resolved to the project itself. Pin one with set_current_project (appExId), or pass appExId here; take it from `project metadata` -> apps[], the entry whose appType is WECHAT_MINI_PROGRAM. A project without that client app has no mini program to upload.");return{projectExId:r.projectExId,appExId:n}},Yy=(e,t)=>t.client.request(bA,e),dP=(e,t,r)=>r.client.request(_A,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t}),fP=async(e,t,r,n)=>(await n.client.request(EA,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t,dryRun:r})).completeWechatSourceCodeUpload,hP=async(e,t,r,n,i)=>{let o=await i.client.request(vA,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t,offset:n?null:r,limit:n?null:lP,paths:n}),s=(o.wechatSourceCodeUploadUrls.items??[]).filter(u=>u!==null),a=s.map(u=>Date.parse(String(u.expiresAt??""))).filter(u=>Number.isFinite(u));return{targets:s.map(u=>({path:u.path??"",uploadUrl:u.uploadUrl??"",headers:u.headers??{}})),nextOffset:o.wechatSourceCodeUploadUrls.nextOffset??null,expiresAt:a.length?Math.min(...a):null}},F6=e=>e!==null&&e-L6<=Date.now(),q6=async(e,t,r,n,i,o)=>{let s=[],a=[],u=r;for(let c=1;;c+=1){let l=await jl(u.targets,h=>n.get(h),i,o.signal);s.push(...l.uploaded);let f=F6(u.expiresAt)&&c<k6&&!o.signal?.aborted?l.failures.filter(h=>n.has(h.path)):[];if(a.push(...l.failures.filter(h=>!f.includes(h))),f.length===0)return{uploaded:s,failures:a};u=await hP(e,t,null,f.map(h=>h.path),o)}},U6=async(e,t,r,n,i,o)=>{let s=[],a=[],u=i?null:0,c=i?[...i]:null;for(;;){o.signal?.throwIfAborted();let l=c?.splice(0,lP)??null;if(l&&l.length===0)break;let d=await hP(e,t,l?null:u,l,o),f=await q6(e,t,d,r,n,o);if(s.push(...f.uploaded),a.push(...f.failures),l)continue;let h=d.nextOffset;if(h!==null&&u!==null&&h<=u)throw new Error(`upload url pagination stalled at offset ${u} (server returned ${h})`);if(u=h,u===null)break}return{uploaded:s,failures:a}},V6=(e,t)=>{if(e.length!==t.length)return!1;let r=new Map(t.map(n=>[n.path??"",n.md5Base64??""]));return e.every(n=>r.get(n.path)===n.md5Base64)},G6=async(e,t,r,n)=>{let i=await Yy(e,n),o=i.buildingWechatSourceCodeDeployment;if(o)throw new Error(`deployment ${o.exId} is already BUILDING (started ${o.buildStartedAt}) \u2014 a build cannot be aborted and blocks the next upload. Wait for it to finish, then re-run.`);let s=i.inProgressWechatSourceCodeDeployment;if(s){if(!r&&V6(t,s.manifest))return{deploymentExId:s.exId,resumed:!0,resumedStatus:s.status};await dP(e,s.exId,n)}return{deploymentExId:(await n.client.request(yA,{projectExId:e.projectExId,appExId:e.appExId,files:t.map(u=>({path:u.path,md5Base64:u.md5Base64,sizeBytes:u.sizeBytes}))})).createWechatSourceCodeDeployment.exId,resumed:!1,resumedStatus:null}},mP=e=>{let t=(e.missingPaths??[]).filter(r=>typeof r=="string");return e.missingCount>t.length?null:t},$6=async(e,t,r,n)=>r!=="UPLOADING"?null:mP(await fP(e,t,!0,n)),B6=async(e,t,r)=>(await r.client.request(SA,{projectExId:e.projectExId,appExId:e.appExId,wechatSourceCodeDeploymentExId:t})).wechatSourceCodeDeployment,gP=async(e,t)=>(await t.client.request(TA,{projectExId:e.projectExId})).project,K6=async(e,t)=>(await t.client.request(IA,{projectExId:e.projectExId})).project,H6=(e,t)=>new Promise((r,n)=>{let i=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e),o=()=>{clearTimeout(i),n(t?.reason??new Error("aborted"))};if(t?.aborted){o();return}t?.addEventListener("abort",o,{once:!0})}),yP=async(e,t)=>{let r=cP.resolve(t),n=Buffer.from(e,"base64");return await uP.mkdir(cP.dirname(r),{recursive:!0}),await uP.writeFile(r,n),{qrCodePath:r,qrCodeBytes:n.length}},Q6=async(e,t,r,n)=>{let i=Date.now(),o=i+r*1e3;for(;;){n.signal?.throwIfAborted();let a=(await B6(e,t,n))?.status??null,u=Math.round((Date.now()-i)/1e3);if(a!=="BUILDING"&&a!=="UPLOADING")return{status:a,timedOut:!1,waitedSeconds:u};if(Date.now()>=o)return{status:a,timedOut:!0,waitedSeconds:u};await H6(Math.min(M6,Math.max(0,o-Date.now())),n.signal)}},W6=async(e,t)=>{let r=oi(e.dir,"dir"),n=Ge(e.dryRun,!1),i=Ge(e.force,!1),o=Ge(e.wait,!0),s=Math.max(0,Ye(e.timeoutSeconds,j6)),a=H(e.qrOut)??pP,u=Math.max(1,Math.min(Ye(e.concurrency,C6),P6)),c=await aP(r);if(n)return t.ok({dryRun:!0,fileCount:c.files.length,totalBytes:c.totalBytes,skipped:c.skipped,serverManaged:c.reserved,files:c.files.map(pe=>({path:pe.path,sizeBytes:pe.sizeBytes}))});let l=await Ml(e,t),d=new Map(c.files.map(pe=>[pe.path,pe])),{deploymentExId:f,resumed:h,resumedStatus:g}=await G6(l,c.files,i,t),v=h?await $6(l,f,g,t):null,_=new Set,S=[],b=null,A=Number.POSITIVE_INFINITY,O=0;for(let pe=1;pe<=D6;pe+=1){O=pe;let ge=await U6(l,f,d,u,v,t);for(let I of ge.uploaded)_.add(I);if(S=ge.failures,b=await fP(l,f,!1,t),!b.incomplete||b.missingCount>=A||(A=b.missingCount,v=mP(b),v?.length===0))break}if(!b||b.incomplete)return t.fail(new Error(`deployment ${f} is still missing ${b?.missingCount??"?"} file(s) after ${O} upload pass(es): ${(b?.missingPaths??[]).slice(0,10).join(", ")}${S.length?`; upload errors: ${S[0].error}`:""}. Re-run to resume, or pass force=true to start over.`));let T={deploymentExId:f,resumed:h,fileCount:c.files.length,totalBytes:c.totalBytes,uploaded:_.size,skipped:c.skipped,serverManaged:c.reserved,deploymentRecordExId:b.deploymentRecordExId,...S.length?{uploadRetries:S}:{}};if(!o)return t.ok({...T,status:b.status,waited:!1});let x=await Q6(l,f,s,t);if(x.timedOut)return t.ok({...T,status:x.status,waited:!0,timedOut:!0,waitedSeconds:x.waitedSeconds},`build is still running after ${x.waitedSeconds}s \u2014 poll \`wechat status\` for the trial version`);if(x.status!=="SUCCEEDED")return t.fail(new Error(`deployment ${f} ended in ${x.status} after ${x.waitedSeconds}s. The upload landed but the WeChat build did not succeed; check the deployment record ${b.deploymentRecordExId??"(none)"} for the failure.`));let U=await gP(l,t),N=U?.wechatMiniAppQRCodeBase64??null,te=N?await yP(N,a):null;return t.ok({...T,status:x.status,waited:!0,waitedSeconds:x.waitedSeconds,trialVersion:U?.wechatMiniAppPreviewVersion??null,trialVersionCommittedAt:U?.wechatMiniAppPreviewTime??null,...te??{qrCodePath:null}})},z6=async(e,t)=>{let r=await Ml(e,t),n=await Yy(r,t),i=await K6(r,t);return t.ok({trial:{version:i?.wechatMiniAppPreviewVersion??null,committedAt:i?.wechatMiniAppPreviewTime??null},inProgress:n.inProgressWechatSourceCodeDeployment?{deploymentExId:n.inProgressWechatSourceCodeDeployment.exId,status:n.inProgressWechatSourceCodeDeployment.status,fileCount:n.inProgressWechatSourceCodeDeployment.fileCount,totalBytes:n.inProgressWechatSourceCodeDeployment.totalBytes,createdAt:n.inProgressWechatSourceCodeDeployment.createdAt,lastUploadUrlIssuedAt:n.inProgressWechatSourceCodeDeployment.lastUploadUrlIssuedAt}:null,building:n.buildingWechatSourceCodeDeployment?{deploymentExId:n.buildingWechatSourceCodeDeployment.exId,status:n.buildingWechatSourceCodeDeployment.status,fileCount:n.buildingWechatSourceCodeDeployment.fileCount,totalBytes:n.buildingWechatSourceCodeDeployment.totalBytes,buildStartedAt:n.buildingWechatSourceCodeDeployment.buildStartedAt,deploymentRecordExId:n.buildingWechatSourceCodeDeployment.deploymentRecordExId}:null})},Y6=async(e,t)=>{let r=await Ml(e,t),i=H(e.deploymentExId)??(await Yy(r,t)).inProgressWechatSourceCodeDeployment?.exId;if(!i)return t.ok({aborted:null},"no in-progress upload to abort");let o=await dP(r,i,t);return t.ok({deploymentExId:i,status:o.abortWechatSourceCodeDeployment.status})},J6=async(e,t)=>{let r=await Ml(e,t),n=H(e.out)??pP,i=await gP(r,t),o=i?.wechatMiniAppQRCodeBase64??null;if(!o)return t.fail(new Error("no trial version QR code is available for this project yet \u2014 run `wechat deploy` and let the build finish first."));let s=await yP(o,n);return t.ok({...s,trialVersion:i?.wechatMiniAppPreviewVersion??null,trialVersionCommittedAt:i?.wechatMiniAppPreviewTime??null})},vP={"wechat.deploy":W6,"wechat.status":z6,"wechat.abort":Y6,"wechat.qrcode":J6};p();var EP={...kR,...$R,...zR,...YR,...aC,...TC,...AC,...PC,...kC,...jC,...MC,...QC,...WC,...oP,...vP};p();p();var X6=new Map([["claude-code","Claude Code"],["codex-mcp-client","Codex"]]);function _P(e){let t=typeof e?.name=="string"?e.name:"",r=typeof e?.title=="string"?e.title:"";return X6.get(t)??(r||t||"the coding agent")}function Fl(e="the coding agent"){return`quit ${e} completely and open it again (starting a new chat in the same window may keep the old tools)`}function ai(e,t,r){let n=`${Y} ${e.current} is older than the minimum supported version ${e.minSupported} (latest ${e.latest})`,i=t?`, and upgrading it automatically failed: ${t}`:"";return`${n}${i}. Calls to the backend keep failing until it is upgraded, so stop retrying and tell the user, in their language: update the ${hv} plugin from the plugin marketplace (or run \`npm i -g ${Y}@latest\` if ${Y} was installed with npm), then ${Fl(r)} so it starts the new version.`}function bP(e){return`This project's schema was saved by a newer editor than ${Y} ${e} can read, and no ${Y} release that can read it has been published yet, so updating or restarting will not help for now, and neither will retrying. Stop and tell the user, in their language, that this project cannot be edited through ${Y} until a newer release comes out; they can keep working on it in the editor meanwhile.`}function SP(e,t){return`${Y} is upgrading itself from ${e} to ${t} in the background because the backend no longer supports ${e}. Nothing is broken and the user does not need to do anything: retry this call in about a minute.`}function TP(e,t,r){return`Note: ${Y} upgraded itself from ${e} to ${t} during this session and ran this call on ${t}, but ${r} did not reload its tool list, so tools added in ${t} are not visible to you. Tell the user once, in their language, that ${Y} was upgraded and that to use the new version's tools they should ${Fl(r)}. Then carry on with their request; everything that worked before still works.`}function IP(e,t,r,n){let i=Fl(r);return n.upgradedFrom&&n.toolListReloaded?`${Y} has no tool ${e}. ${Y} upgraded itself from ${n.upgradedFrom} to ${t} during this session and ${r} has already reloaded its tool list, so ${e} was from the old list: use the tools you have now instead. The user does not need to restart anything.`:n.upgradedFrom?`${Y} has no tool ${e}. ${Y} upgraded itself from ${n.upgradedFrom} to ${t} during this session, so your tool list is still the ${n.upgradedFrom} one. Tell the user, in their language, to ${i} so you get the current tools, then try again.`:`${Y} ${t} has no tool ${e}. Use only the tools in your current tool list; if that list was loaded from another ${Y} version, tell the user, in their language, to ${i}, then try again.`}function wP(e,t,r,n){return n?`${Y} upgraded itself from ${e} to ${t} during this session and ${r} has already reloaded its tool list, so check this tool's current arguments and try again.`:`${Y} upgraded itself from ${e} to ${t} during this session, so this tool's arguments may have changed since your tool list was loaded. If the error does not make sense against your tool list, tell the user, in their language, to ${Fl(r)}.`}var Z6=B`
|
|
1395
1392
|
query SupportedMcpVersion {
|
|
1396
1393
|
supportedMcpVersion {
|
|
1397
1394
|
latest
|
|
1398
1395
|
minSupported
|
|
1399
1396
|
}
|
|
1400
1397
|
}
|
|
1401
|
-
`,
|
|
1402
|
-
${o}`:i}function
|
|
1403
|
-
`);if(i<0)return;let o=r.slice(0,i);r=r.slice(i+1),o.trim()!==""&&e(o)}}};var
|
|
1404
|
-
`)}),c.on("data",
|
|
1405
|
-
`)}),d.on("data",
|
|
1398
|
+
`,eX=3600*1e3,tX=3600*1e3;function OP(e={}){let t=e.check??ya,r=e.now??Date.now,n=e.ttlMs??eX,i=e.unknownTtlMs??tX,o=null,s=null;return{async check(){return o&&r()<o.expiresAt?o.result:s||(s=t().then(a=>(o={result:a,expiresAt:r()+(a.status==="unknown"?i:n)},a)).finally(()=>{s=null}),s)},invalidate(){o=null}}}function rX(e){let t=e instanceof Error?e.message:String(e);return/supportedMcpVersion|Cannot query field|Validation error|undefined/i.test(t)?"backend does not advertise a supported version":"backend version check unavailable"}async function ya(){let{agentVersion:e}=await vy();try{let t=Rt(),r=new Ze(`${t.apiBaseUrl}/api/graphql`,{headers:{"User-Locale":"en_US"}}),{supportedMcpVersion:n}=await r.request(Z6),{latest:i,minSupported:o}=n;return{status:ci(e,o)<0?"outdated":"ok",current:e,latest:i,minSupported:o}}catch(t){return C.debug(`[version-check] skipped: ${String(t)}`),{status:"unknown",current:e,reason:rX(t)}}}function ql(e){return e.status==="outdated"?ai(e):e.status==="ok"?`${Y} ${e.current} meets the backend minimum ${e.minSupported} (latest ${e.latest}).`:`${Y} ${e.current}: ${e.reason}; skipping compatibility check.`}var nX=new Set(["docs.search","docs.get_page","auth.login","auth.reauth","auth.logout","auth.whoami","workspace.set"]),iX=e=>new Proxy({},{get(){throw new Error(`${e} is a local-only command and has no authenticated client`)}}),AP=e=>({ok:!1,error:ql(e),data:{upgrade:e}});function oX(e){let t=e.cause,r=t?.code;if(typeof r!="string")return null;let n=typeof t?.message=="string"?t.message:"";return n?n.includes(r)?n:`${r}: ${n}`:r}function sX(e){if(!(e instanceof Error))return String(e);let t=by(e.response?.errors),r=e.message||String(e),n=oX(e),i=t||(n?`${r} (${n})`:r),o=e.runtimeDiagnosis;return typeof o=="string"?`${i}
|
|
1399
|
+
${o}`:i}function Ul(e,t={}){let r=new br(e),n=new Xi(r),i=new Tl(()=>Sy(n,r),t.watchSchemaChanges?async(...c)=>(await fR(n,r))(...c):void 0),o=OP({check:t.checkMcpVersion}),s=(c,l)=>({ok:!0,data:c,message:l}),a=c=>(c instanceof Error&&c.stack&&C.debug(`[AgentApp] command failed: ${c.stack}`),{ok:!1,error:sX(c),data:c instanceof hn?{ztypeDiagnostics:c.diagnostics}:void 0});return{execute:async(c,l)=>{let d=RR(c.args),f=nX.has(c.name);try{if(!f){let T=await o.check();if(T.status==="outdated")return AP(T)}let h=EP[c.name];if(!h)throw new Error(`Unknown command: ${c.name}`);let g=f?iX(c.name):await Sy(n,r),v=null,_=f?void 0:g,S=async T=>(v??=await Dy(r,T,_),v),b=async T=>Dy(r,{appExId:null,...T},_),A=async T=>{let x=await S(T);return i.checkRemoteAndSync(nr(x.projectExId,x))},O={credentialStore:r,tokenManager:n,schemaManager:i,client:g,signal:l,codingAgent:c.agent,hostSessionId:c.sessionId,getProjectArgs:S,getProjectLevelArgs:b,checkSchema:A,ok:s,fail:a};return await h(d,O)}catch(h){if(!vl(h,"CLIENT_VERSION_TOO_OLD"))return a(h);o.invalidate();let g=await o.check();return g.status==="outdated"?AP(g):a(new Error(bP(g.current)))}},schemaManager:i,setWorkspaceRoot(c){r.setWorkspaceRoot(c),i.clear()},stop(){i.clear()}}}p();import Vl from"net";p();import{StringDecoder as aX}from"string_decoder";var va=e=>{let t=new aX("utf8"),r="";return n=>{for(r+=t.write(n);;){let i=r.indexOf(`
|
|
1400
|
+
`);if(i<0)return;let o=r.slice(0,i);r=r.slice(i+1),o.trim()!==""&&e(o)}}};var uX=600*1e3;async function _t(e,t,r){let{socketPath:n,token:i}=e,o=`${Date.now()}-${Math.random().toString(16).slice(2)}`,s={id:o,token:i,command:t};return new Promise((a,u)=>{let c=n.startsWith("tcp://")?Vl.createConnection(NP(n)):Vl.createConnection(n),l=setTimeout(()=>{c.destroy(),u(new Error(`Timed out waiting for daemon response to ${t.name}`))},uX),d=()=>{r&&r.removeEventListener("abort",f)},f=()=>{clearTimeout(l),c.destroy(),u(new Error(`Request aborted: ${t.name}`))};if(r){if(r.aborted){f();return}r.addEventListener("abort",f)}c.on("connect",()=>{c.write(`${JSON.stringify(s)}
|
|
1401
|
+
`)}),c.on("data",va(h=>{clearTimeout(l),d(),c.end();try{let g=JSON.parse(h);if(g.id!==o){u(new Error("Daemon response id mismatch"));return}a(g.result)}catch(g){u(g)}})),c.on("error",h=>{clearTimeout(l),d(),u(h)})})}function xP(e,t,r){let{socketPath:n,token:i}=e,o=null,s=!1,a=null,u=()=>{if(s)return;o=n.startsWith("tcp://")?Vl.createConnection(NP(n)):Vl.createConnection(n);let c=`sub-${Date.now()}-${Math.random().toString(16).slice(2)}`,l={id:c,token:i,command:{name:"schema.subscribe"}},d=o;d.on("connect",()=>{d.write(`${JSON.stringify(l)}
|
|
1402
|
+
`)}),d.on("data",va(f=>{if(!d.destroyed)try{let h=JSON.parse(f);if(h.id===c)return;h.event==="schemaChanged"&&t(h.data)}catch(h){C.warn(`Failed to parse daemon event, destroying socket to force reconnect. Line: ${f}`,h),d.destroy()}})),o.on("error",f=>{s||r(f)}),o.on("close",()=>{o=null,s||(a=setTimeout(u,2e3))})};return u(),{unsubscribe(){s=!0,a&&clearTimeout(a),o&&o.end()}}}function NP(e){let t=new URL(e),r=Number.parseInt(t.port,10);if(!t.hostname||!Number.isInteger(r))throw new Error(`Invalid daemon TCP endpoint: ${e}`);return{host:t.hostname,port:r}}p();import{createHash as cX,randomUUID as RP}from"crypto";import{promises as So,rmSync as lX}from"fs";import To from"path";var pX="registry.json",vn=class{constructor(t){this.workspaceRoot=t;this.root=To.join(t,`.${Y}`,"daemon"),this.logRoot=To.join(this.root,"logs"),this.socketRoot=To.join(this.root,"sockets"),this.registryPath=To.join(this.root,pX)}root;logRoot;socketRoot;registryPath;async ensure(){await So.mkdir(this.root,{recursive:!0,mode:448}),await So.mkdir(this.logRoot,{recursive:!0,mode:448}),await So.mkdir(this.socketRoot,{recursive:!0,mode:448})}async list(){await this.ensure();try{let t=await So.readFile(this.registryPath,"utf8"),r=JSON.parse(t),n=r.filter(i=>this.isProcessAlive(i.pid));if(n.length!==r.length){for(let i of r)this.isProcessAlive(i.pid)||this.unlinkSocket(i.socketPath);await this.write(n)}return n}catch(t){if(t.code==="ENOENT")return[];throw t}}async findCompatible(t){return(await this.list()).find(n=>lR(t,n.compatibility)&&this.isProcessAlive(n.pid))??null}async upsert(t){let r=(await this.list()).filter(n=>n.uid!==t.uid);r.push(t),await this.write(r)}async remove(t){let r=await this.list();for(let n of r)n.pid===t&&this.unlinkSocket(n.socketPath);await this.write(r.filter(n=>n.pid!==t))}createRecord(t){let r=RP(),n=cX("sha256").update(`${this.workspaceRoot}:${r}`).digest("hex").slice(0,16),i=new Date().toISOString();return{uid:r,pid:process.pid,socketPath:this.chooseSocketPath(n),token:RP(),logPath:To.join(this.logRoot,`${n}.log`),status:"idle",startedAt:i,lastBusyAt:i,compatibility:t}}chooseSocketPath(t){if(process.platform==="win32")return"tcp://127.0.0.1:0";let r=To.join(this.socketRoot,`${t}.sock`);return r.length<=100?r:"tcp://127.0.0.1:0"}unlinkSocket(t){if(!t.startsWith("tcp://"))try{lX(t,{force:!0})}catch{}}async write(t){await this.ensure();let r=`${this.registryPath}.tmp`;await So.writeFile(r,JSON.stringify(t,null,2),{mode:384}),await So.rename(r,this.registryPath)}isProcessAlive(t){try{return process.kill(t,0),!0}catch{return!1}}};p();import{chmodSync as dX}from"fs";import fX from"net";var Gl=10800*1e3;async function CP(e){let t=e.idleTimeoutMs??Gl,r=new vn(e.workspaceRoot),n=new br(e.workspaceRoot),i=new Xi(n),o=await go(n,e.startupFlags??[]),s=r.createRecord(o),a=Ul(e.workspaceRoot,{watchSchemaChanges:!0}),u=new Set;a.schemaManager.emitter.on("schemaChanged",T=>{let x=JSON.stringify({event:"schemaChanged",data:T})+`
|
|
1406
1403
|
`;for(let U of u)try{U.write(x)}catch{u.delete(U)}});let c=new Map,l=0,d=!1,f=Date.now(),h=null,g=()=>{f=Date.now()},v=(T,x)=>`${JSON.stringify({id:T,result:x})}
|
|
1407
|
-
`,_=async()=>{s.compatibility=await
|
|
1408
|
-
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),
|
|
1409
|
-
`}var
|
|
1404
|
+
`,_=async()=>{s.compatibility=await go(n,e.startupFlags??[]),await r.upsert(s)},S=async T=>{switch(T.command.name){case"daemon.ping":return{ok:!0,data:{pid:process.pid,record:s,pins:c.size}};case"daemon.pin":{let x=typeof T.command.args?.token=="string"?T.command.args.token:`${Date.now()}-${Math.random()}`;return c.set(x,{token:x,lastSeenAt:Date.now()}),{ok:!0,data:{token:x}}}case"daemon.heartbeat":{let x=T.command.args?.token;return typeof x=="string"&&c.has(x)&&c.set(x,{token:x,lastSeenAt:Date.now()}),{ok:!0}}case"daemon.unpin":{let x=T.command.args?.token;return typeof x=="string"&&c.delete(x),{ok:!0}}case"daemon.stop":return d=!0,setTimeout(()=>A(0),25),{ok:!0,message:"Stopping daemon"};default:return null}},b=()=>{let T=Date.now();for(let[x,U]of c.entries())T-U.lastSeenAt>t&&c.delete(x)},A=async T=>{h&&h.close(),a.stop(),await r.remove(process.pid).catch(()=>{}),process.exit(T)};setInterval(()=>{b(),a.schemaManager.sweep(),d||i.refreshIfNeeded(),!(d||l>0||c.size>0)&&Date.now()-f>t&&(C.info("Daemon idle timeout reached; shutting down"),A(0))},3e4).unref(),h=fX.createServer(T=>{let x=!1,U=new Map;T.on("close",()=>{u.delete(T);for(let te of U.values())te.abort();U.clear()}),T.on("error",()=>{u.delete(T);for(let te of U.values())te.abort();U.clear()});let N=te=>{(async()=>{l+=1,g();let pe="unknown";try{let ge=JSON.parse(te);if(pe=ge.id,ge.token!==s.token){T.write(v(ge.id,{ok:!1,error:"Unauthorized: invalid or missing daemon token"}));return}if(ge.command.name==="schema.subscribe"){x=!0,u.add(T),T.write(v(ge.id,{ok:!0,message:"Subscribed to schema events"}));return}let I=new AbortController;U.set(ge.id,I);let Re=await S(ge)??await a.execute(ge.command,I.signal);Re.ok&&(ge.command.name==="auth.login"||ge.command.name==="auth.reauth"||ge.command.name==="auth.logout")&&await _(),T.write(v(ge.id,Re))}catch(ge){let I=pe!=="unknown"?pe:hX(te);T.write(v(I,{ok:!1,error:ge instanceof Error?ge.message:String(ge)}))}finally{l-=1,g(),pe!=="unknown"&&U.delete(pe),x||T.end()}})()};T.on("data",va(N))}),await r.ensure(),await new Promise((T,x)=>{if(h?.once("error",x),s.socketPath.startsWith("tcp://")){h?.listen(0,"127.0.0.1",()=>{let N=h?.address();if(!N||typeof N=="string"){x(new Error("Daemon TCP listener did not expose a port"));return}s.socketPath=`tcp://127.0.0.1:${N.port}`,T()});return}let U=s.socketPath;h?.listen(U,()=>{try{dX(U,384)}catch{}T()})}),await r.upsert(s),C.info(`Daemon listening on ${s.socketPath}`),_v(),process.on("SIGINT",()=>void A(0)),process.on("SIGTERM",()=>void A(0))}function hX(e){try{return JSON.parse(e).id??"unknown"}catch{return"unknown"}}p();p();import PP from"node:process";p();var Io=class{append(t){this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t}readMessage(){if(!this._buffer)return null;let t=this._buffer.indexOf(`
|
|
1405
|
+
`);if(t===-1)return null;let r=this._buffer.toString("utf8",0,t).replace(/\r$/,"");return this._buffer=this._buffer.subarray(t+1),mX(r)}clear(){this._buffer=void 0}};function mX(e){return Iv.parse(JSON.parse(e))}function $l(e){return JSON.stringify(e)+`
|
|
1406
|
+
`}var Bl=class{constructor(t=PP.stdin,r=PP.stdout){this._stdin=t,this._stdout=r,this._readBuffer=new Io,this._started=!1,this._ondata=n=>{this._readBuffer.append(n),this.processReadBuffer()},this._onerror=n=>{this.onerror?.(n)}}async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=!0,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror)}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t)}catch(t){this.onerror?.(t)}}async close(){this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.()}send(t){return new Promise(r=>{let n=$l(t);this._stdout.write(n)?r():this._stdout.once("drain",r)})}};import{spawn as NX}from"child_process";import UP from"path";import{randomUUID as RX}from"crypto";p();function DP(){let{productName:e}=Rv();return`# ${e} MCP \u2014 no-code platform (visual UI + PostgreSQL + actionflows)
|
|
1410
1407
|
Two modes. **Builder**: edit the data model, bindings, action flows, request filters, UI, third-party APIs, project lifecycle, deploys, and data with tools. **Consultant**: for what tools can't change (permission config, payment setup, formula columns), diagnose and guide the user through the editor.
|
|
1411
1408
|
|
|
1412
1409
|
## Session
|
|
@@ -1421,13 +1418,13 @@ Schema editing: one tool per capability, each {op, args} where op is a schema To
|
|
|
1421
1418
|
Permission config, payment module/credentials, and formula COLUMNS are editor-only. (Formula data BINDINGS via schema_create_binding op=FORMULA are fine \u2014 different thing.)
|
|
1422
1419
|
|
|
1423
1420
|
## Always
|
|
1424
|
-
Ask when ambiguous. Ground every call in what you retrieved \u2014 never fabricate table/column/enum/component names; verify names before any query/mutation. Before deleting tables/columns/relations/enums, list what's removed and warn of data loss. Data-model/permission/actionflow changes take effect only after sync_backend. Done = VALIDATE clean, synced, each changed actionflow without external calls debug-run once, and what the user asked for actually exercised. Reply in the user's language.`}p();import{randomUUID as
|
|
1425
|
-
`);let o;try{o=await r.installFirst(
|
|
1426
|
-
${t}`}};let r=e.result;return r?.content?{jsonrpc:"2.0",id:e.id,result:{...r,content:[...r.content,{type:"text",text:t}]}}:e}function Hy(e,t){return e.method==="tools/call"?{jsonrpc:"2.0",id:e.id,result:{content:[{type:"text",text:t}],isError:!0}}:{jsonrpc:"2.0",id:e.id,error:{code:-32603,message:t}}}var Qy=class{seen=!1;waiters=new Set;reset(){this.seen=!1}mark(){this.seen=!0;for(let t of this.waiters)t();this.waiters.clear()}waitFor(t){return this.seen||t<=0?Promise.resolve(this.seen):new Promise(r=>{let n=()=>{clearTimeout(i),r(!0)},i=setTimeout(()=>{this.waiters.delete(n),r(!1)},t);this.waiters.add(n)})}};function EX(e,t){return new Promise(r=>{let n=setTimeout(()=>r({kind:"TIMEOUT"}),t);e.then(i=>{clearTimeout(n),r({kind:"DONE",value:i})},i=>{clearTimeout(n),r({kind:"FAILED",reason:i instanceof Error?i.message:String(i)})})})}var Wy=class{constructor(t,r,n,i){this.version=t;this.child=r;this.toHost=n;r.stdout.on("data",a=>{for(this.buffer.append(a);;){let u;try{u=this.buffer.readMessage()}catch(c){C.warn(`[upgrade] unreadable message from new version: ${String(c)}`);continue}if(!u)break;this.route(u)}}),r.stdin.on("error",()=>{});let o=!1,s=(a,u)=>{if(!o){o=!0;for(let c of this.waiters.values())c({jsonrpc:"2.0",id:"",error:{code:-32603,message:u}});this.waiters.clear(),this.closed||Promise.allSettled([...this.inflight]).then(()=>i(a))}};r.on("error",a=>s(1,`it could not start: ${a.message}`)),r.on("exit",a=>s(a??1,`it exited with ${a}`))}buffer=new To;intercepts=new Map;inflight=new Set;waiters=new Map;sequence=0;closed=!1;send(t,r){r&&"id"in t&&t.id!==void 0&&this.intercepts.set(t.id,r),this.closed||this.child.stdin.write(Ul(t))}async initialize(t,r,n){let i=await this.request(t.method,{...t.params,...r?{protocolVersion:r}:{}});if(i.error)throw new Error(`the new version did not initialize: ${i.error.message}`);let o=i.result?.protocolVersion;if(r&&o!==r)throw new Error(`the new version speaks MCP ${String(o)}, but this session uses ${r}`);this.send({jsonrpc:"2.0",method:"notifications/initialized"});for(let s of n)await this.request(s.method,s.params).catch(()=>{})}close(){this.closed||(this.closed=!0,this.child.stdin.end())}request(t,r){this.sequence+=1;let n=`handover-${this.sequence}`;return new Promise((i,o)=>{let s=setTimeout(()=>{this.waiters.delete(n),o(new Error(`the new version did not answer ${t}`))},cX);this.waiters.set(n,a=>{clearTimeout(s),i(a)}),this.send({jsonrpc:"2.0",id:n,method:t,params:r})})}route(t){if(CP(t)){let r=typeof t.id=="string"?this.waiters.get(t.id):void 0;if(r){this.waiters.delete(t.id),r(t);return}let n=this.intercepts.get(t.id);if(n){this.intercepts.delete(t.id);let i=n(t).then(o=>this.toHost(o));this.inflight.add(i),i.finally(()=>this.inflight.delete(i));return}}this.toHost(t)}};var $l=_n.toLowerCase(),DP=e=>`${$l}://project/${encodeURIComponent(e)}/schema-state`,LP=e=>`${$l}://project/${encodeURIComponent(e)}/schema-events`,kP=e=>Array.isArray(e)?String(e[0]??""):String(e??"");async function zy(e){let t=PP.resolve(e),r=await va(t),n=jP(),i=async()=>{await _t(r,{name:"daemon.pin",args:{token:n}})},o=async()=>{await _t(r,{name:"daemon.unpin",args:{token:n}}).catch(()=>{})};await i();let s=setInterval(()=>{_t(r,{name:"daemon.heartbeat",args:{token:n}}).catch(()=>{})},6e4);s.unref();let a=new Sv({name:X,version:"1.0.0"},{instructions:OP(),capabilities:{tools:{},prompts:{},resources:{subscribe:!0}}});fv(a);let u=new Set;a.server.setRequestHandler(_v,b=>(u.add(b.params.uri),{})),a.server.setRequestHandler(bv,b=>(u.delete(b.params.uri),{}));let c=process.env.MCP_HOST_SESSION_ID||bX(),l=async(b,A)=>{if(b.agent??=a.server.getClientVersion()?.name,b.sessionId??=c,b.name==="workspace.set"&&typeof b.args?.cwd=="string"){let w=PP.resolve(b.args.cwd);if(b.args.cwd=w,w!==t){let T=r;r=await va(w),t=w,await _t(T,{name:"daemon.unpin",args:{token:n}},A).catch(()=>{}),await i()}}return _t(r,b,A)},d=new xo,f=new Bl({inner:new Vl,currentVersion:En(),upgradedFrom:process.env.MCP_UPGRADED_FROM||void 0,canUpgrade:b=>No()&&Io(b)!==null,prepare:b=>d.installFirst(ya(b)),launch:b=>_X(process.execPath,[d.binPath(b),"mcp","--cwd",t],{stdio:["pipe","pipe","inherit"],env:{...process.env,MCP_HOST_SESSION_ID:c,MCP_UPGRADED_FROM:En()}}),onRelayActive:()=>{clearInterval(s),v.unsubscribe(),o()},onRelayExit:b=>process.exit(b)});Iv(a,f.wrapSender(l)),wv(a,f.wrapSender(l));let h=async()=>{let b=await _t(r,{name:"schema.status"});if(!b.ok)return[];let w=b.data?.sessions;return Array.isArray(w)?[...new Set(w.map(T=>T?.projectExId).filter(T=>typeof T=="string"))]:[]};a.registerResource("project-schema-state",new Jl(`${$l}://project/{projectExId}/schema-state`,{list:async()=>({resources:(await h()).map(b=>({uri:DP(b),name:`schema-state-${b}`,title:`Schema state ${b}`,description:"Current in-memory schema revision and stale/change notification state.",mimeType:"application/json"}))})}),{title:"Project Schema State",description:"Current in-memory schema revision and stale/change notification state.",mimeType:"application/json"},async(b,A)=>{let w=kP(A.projectExId),T=await _t(r,{name:"schema.state",args:{projectExId:w}});return{contents:[{uri:b.href,mimeType:"application/json",text:JSON.stringify(T.ok?T.data:T,null,2)}]}}),a.registerResource("project-schema-events",new Jl(`${$l}://project/{projectExId}/schema-events`,{list:async()=>({resources:(await h()).map(b=>({uri:LP(b),name:`schema-events-${b}`,title:`Schema events ${b}`,description:"Recent semantic schema-change events observed by the daemon.",mimeType:"application/json"}))})}),{title:"Project Schema Events",description:"Recent semantic schema-change events observed by the daemon.",mimeType:"application/json"},async(b,A)=>{let w=kP(A.projectExId),T=await _t(r,{name:"schema.events",args:{projectExId:w}});return{contents:[{uri:b.href,mimeType:"application/json",text:JSON.stringify(T.ok?T.data:T,null,2)}]}}),await a.connect(f),process.env.MCP_UPGRADED_FROM||AP(ma,d).catch(b=>{C.warn(`[upgrade] prefetch failed: ${String(b)}`)});let g=new Set,v=_P(r,async b=>{if(!b?.id||g.has(b.id))return;g.add(b.id);let A=String(b.projectExId??"");if(!A)return;let w=DP(A),T=LP(A),x=[u.has(w)?a.server.sendResourceUpdated({uri:w}):Promise.resolve(),u.has(T)?a.server.sendResourceUpdated({uri:T}):Promise.resolve()];await Promise.all([...x,a.sendLoggingMessage({level:"notice",logger:X,data:{message:"Project schema changed",projectExId:A,event:b}})])},b=>{C.warn("Daemon subscription error",b.message)}),_=!1,S=async()=>{_||(_=!0,clearInterval(s),v.unsubscribe(),await o(),await a.close())};process.on("SIGINT",()=>{S().finally(()=>process.exit(0))}),process.on("SIGTERM",()=>{S().finally(()=>process.exit(0))}),process.stdin.on("end",()=>{S().finally(()=>process.exit(0))}),process.stdin.on("close",()=>{S().finally(()=>process.exit(0))}),process.on("exit",()=>{clearInterval(s),v.unsubscribe()})}p();var SX=/^-?\d+(\.\d+)?$/;function TX(e){return e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")}function IX(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(SX.test(e))return Number(e);if(TX(e))try{return JSON.parse(e)}catch{return e}return e}function MP(e){let t=Number(e);if(Number.isNaN(t))throw new mp("expected a number");return t}function Yy(e){try{return JSON.parse(e)}catch{throw new mp("expected valid JSON")}}function FP(e){if(typeof e!="string")return{};try{let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function OX(e){let t={};for(let r=0;r<e.length;r++){let n=e[r];if(!n.startsWith("--"))continue;let i=n.slice(2),o,s=i.indexOf("=");if(s!==-1)o=i.slice(s+1),i=i.slice(0,s);else{let a=e[r+1];a!==void 0&&!a.startsWith("--")&&(o=a,r+=1)}o===void 0?i.startsWith("no-")?t[i.slice(3)]=!1:t[i]=!0:t[i]=IX(o)}return t}function qP(e,t,r){let n=FP(e.args);return Object.assign(n,OX(t)),r&&(n.subcommand=r),n}function UP(e,t){let r=FP(t.args),n=e.opts();for(let i of e.options){let o=i.attributeName();e.getOptionValueSource(o)==="cli"&&(r[o]=n[o])}return r}p();function wX(e){let t=e,r=!1;for(;;)if(t instanceof Ct.ZodOptional)r=!0,t=t.unwrap();else if(t instanceof Ct.ZodNullable)t=t.unwrap();else if(t instanceof Ct.ZodDefault)t=t.removeDefault();else break;return{base:t,optional:r}}function VP(e,t){for(let[r,n]of Object.entries(t)){let{base:i,optional:o}=wX(n),s=o?"":"required",a=`${s} JSON`.trim();i instanceof Ct.ZodBoolean?(e.option(`--${r}`,s),e.option(`--no-${r}`)):i instanceof Ct.ZodNumber?e.option(`--${r} <value>`,s,MP):i instanceof Ct.ZodArray?i.element instanceof Ct.ZodString?e.option(`--${r} <values...>`,s):e.option(`--${r} <json>`,a,Yy):i instanceof Ct.ZodRecord||i instanceof Ct.ZodObject||i instanceof Ct.ZodAny||i instanceof Ct.ZodUnknown?e.option(`--${r} <json>`,a,Yy):e.option(`--${r} <value>`,s)}}var Jy=["default"],KP=[];function ai(e){return typeof e.cwd=="string"?$P.resolve(e.cwd):process.env.WORKSPACE_ROOT||process.cwd()}function Kl(e){return e.pretty===void 0?!0:!e.pretty}async function HP(e,t,r){let n={name:e,args:t},i=ai(r),o=r.daemon===!1?await UX(n,i):await qX(n,i),s=Gl(o);if(s){let a=await wP(s,KP);if(a.kind==="RERAN"){dv(a.status);return}a.kind==="FAILED"&&(o={...o,error:si(s,a.reason)})}Hl(o,Kl(r)),o.ok||(process.exitCode=1)}async function PX(e){let t=await va(ai(e));Hl({ok:!0,data:QP(t),message:"Daemon started"},Kl(e))}async function DX(e){await TP({workspaceRoot:ai(e),idleTimeoutMs:VX(process.env.ZED_AGENT_DAEMON_IDLE_TTL)??ql,startupFlags:Jy})}async function LX(e){let r=await new yn(ai(e)).list();Hl({ok:!0,data:r.map(QP)},Kl(e))}async function kX(e){let t=ai(e),r=new yn(t),n=new br(t),i=await mo(n,Jy),o=await r.list(),s=[];for(let a of o)if(JSON.stringify(a.compatibility)===JSON.stringify(i))try{await _t(a,{name:"daemon.stop"}),s.push(a.pid)}catch{await r.remove(a.pid)}Hl({ok:!0,data:{stopped:s}},Kl(e))}function GP(e,t){return e.commands.find(r=>r.name()===t)}function BP(e,t,r,n,i){let o=e;for(let u=0;u<t.length-1;u+=1)o=GP(o,t[u])??o.command(t[u]);let s=t[t.length-1];if(GP(o,s))return;let a=o.command(s).description(r);i&&VP(a,i),a.action(async(u,c)=>{let l=c.optsWithGlobals();await HP(n,UP(c,l),l)})}function jX(e,t,r,n){BP(e,r.path.split(" "),t.description,t.command,n),r.alias&&BP(e,r.alias.split(" "),t.description,t.command,n)}function MX(){let e=Rt(),t=Object.keys(lv).join(", ");return["","Backend environment:",` Active: ${e.name} (select with ZION_ENV / MCP_ENV; known: ${t})`,` API: ${e.apiBaseUrl}`,` Auth: ${e.authEndpoint}`," Override any endpoint individually with BACKEND_API_BASE,"," BACKEND_AUTH_ENDPOINT, ZERO_API_URL_TEMPLATE, LOG_API_URL_TEMPLATE.","","Upgrades:"," When the backend stops supporting this version, the newer release is installed",` into ~/.${X}/versions and the call continues on it; later starts run it directly.`," MCP_AUTO_UPGRADE=0 turns this off and only reports the required upgrade.","","Logs:",` File: ${hv()}`,` Level: ${process.env.MCP_LOG_LEVEL??"info"} (set MCP_LOG_LEVEL; debug, or verbose)`," Verbose: MCP_LOG_LEVEL=verbose (or MCP_LOG_GQL=1) logs full GraphQL bodies + subscription events"," Rotation: 50 MB x 5 files; data older than 1 day is truncated"," Override: MCP_LOG_DIR, MCP_LOG_MAX_BYTES, MCP_LOG_MAX_FILES,"," MCP_LOG_MAX_AGE_DAYS (0 disables), MCP_LOG_FILE=off"].join(`
|
|
1427
|
-
`)}function
|
|
1428
|
-
`),i.status==="outdated"&&(process.exitCode=1)}),t.command("tool-surface",{hidden:!0}).description("Print the MCP tools, prompts and CLI verbs this version exposes, as JSON").action(async()=>{let{collectToolSurface:i}=await import("./surface-
|
|
1429
|
-
`)});let r=t.command("daemon").description("Daemon control"),n=[["start","Start daemon",
|
|
1421
|
+
Ask when ambiguous. Ground every call in what you retrieved \u2014 never fabricate table/column/enum/component names; verify names before any query/mutation. Before deleting tables/columns/relations/enums, list what's removed and warn of data loss. Data-model/permission/actionflow changes take effect only after sync_backend. Done = VALIDATE clean, synced, each changed actionflow without external calls debug-run once, and what the user asked for actually exercised. Reply in the user's language.`}p();import{randomUUID as gX}from"crypto";p();function Kl(e){if(e.ok||typeof e.data!="object"||e.data===null)return null;let t=e.data.upgrade;return t?.status!=="outdated"||typeof t.current!="string"||typeof t.latest!="string"||typeof t.minSupported!="string"?null:t}function Ea(e){let t=Yl(e.minSupported)?e.minSupported:e.current;return[...new Set([e.latest,e.minSupported])].filter(Yl).filter(r=>ci(r,e.current)>0&&ci(r,t)>=0).sort((r,n)=>ci(n,r))}function wo(e){return Ea(e)[0]??null}async function LP(e,t,r=new No,n){let i=wo(e);if(!i||!Ro(n))return{kind:"UNAVAILABLE"};process.stderr.write(`[${Y}] ${e.current} is no longer supported by the backend; upgrading to ${i}...
|
|
1422
|
+
`);let o;try{o=await r.installFirst(Ea(e))}catch(s){return{kind:"FAILED",reason:s instanceof Error?s.message:String(s)}}return{kind:"RERAN",status:await gv(r,o,t)}}async function kP(e,t=new No,r){if(!Ro(r))return;let n=await e();n.status==="outdated"&&wo(n)&&await t.installFirst(Ea(n))}var jP=`__MCP_UPGRADE_HANDOVER_${gX()}__`,yX=4e4,vX=3e4,EX=600*1e3,_X=2e3,bX=`${Y} upgraded itself from`,SX=/^(MCP error -?\d+: )?Tool \S+ not found/,TX=/^(MCP error -?\d+: )?Input validation error/,IX=new Set(["logging/setLevel","resources/subscribe","resources/unsubscribe"]),wX=["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed"],MP=e=>"method"in e&&"id"in e,qP=e=>"id"in e&&!("method"in e),Hl=class{constructor(t){this.options=t}onmessage;onclose;onerror;pending=new Map;initializeRequest=null;negotiatedProtocol=null;logLevelRequest=null;subscriptions=new Map;upgrade=null;relay=null;toolsRelisted=new Xy;startedAt=Date.now();upgradeNoted=!1;async start(){let{inner:t}=this.options;t.onmessage=(r,n)=>this.fromHost(r,n),t.onclose=()=>this.onclose?.(),t.onerror=r=>this.onerror?.(r),await t.start()}async close(){this.relay?.close(),await this.options.inner.close()}setProtocolVersion(t){this.options.inner.setProtocolVersion?.(t)}async send(t,r){if(qP(t)){let n=this.pending.get(t.id);if(this.pending.delete(t.id),n&&this.upgrade&&JSON.stringify(t).includes(jP)){this.handOver(n);return}if(n?.method==="initialize"){let i=t.result?.protocolVersion;this.negotiatedProtocol=typeof i=="string"?i:null}n&&(t=await this.withToolHint(n,t))}await this.options.inner.send(t,r)}wrapSender(t){return async(r,n)=>{let i=await t(r,n),o=Kl(i);return!o||!this.options.canUpgrade(o)?i:(this.requestUpgrade(o),{ok:!1,error:jP})}}fromHost(t,r){if(MP(t)&&t.method==="tools/list"&&this.toolsRelisted.mark(),this.relay){this.relay.send(t);return}MP(t)&&(this.remember(t),this.pending.set(t.id,t)),this.onmessage?.(t,r)}remember(t){if(t.method==="initialize")this.initializeRequest=t;else if(t.method==="logging/setLevel")this.logLevelRequest=t;else if(IX.has(t.method)){let r=String(t.params?.uri??"");t.method==="resources/subscribe"?this.subscriptions.set(r,t):this.subscriptions.delete(r)}}requestUpgrade(t){let r=this.upgrade;if(r?.kind==="RUNNING"||r?.kind==="FAILED"&&Date.now()-r.at<EX)return;let n=this.performUpgrade(t);this.upgrade={kind:"RUNNING",version:t,target:n},n.catch(i=>{let o=i instanceof Error?i.message:String(i);C.warn(`[upgrade] handover failed: ${o}`),this.upgrade={kind:"FAILED",version:t,reason:o,at:Date.now()}})}async performUpgrade(t){let r=this.initializeRequest;if(!r)throw new Error("the MCP client never initialized this server");let n=await this.options.prepare(t),i=new Zy(n,this.options.launch(n),o=>this.options.inner.send(o),o=>{this.relay===i&&this.options.onRelayExit?.(o)});try{await i.initialize(r,this.negotiatedProtocol,[...this.logLevelRequest?[this.logLevelRequest]:[],...this.subscriptions.values()])}catch(o){throw i.close(),o}this.relay=i,this.toolsRelisted.reset();for(let o of wX)await this.options.inner.send({jsonrpc:"2.0",method:o});return C.info(`[upgrade] handed this session over to ${n} (was ${this.options.currentVersion})`),this.options.onRelayActive?.(),i}async handOver(t){let r=this.upgrade;if(!r){await this.options.inner.send(Jy(t,"internal error: upgrade was not requested"));return}if(r.kind==="FAILED"){await this.options.inner.send(Jy(t,ai(r.version,r.reason,this.host())));return}let n=await xX(r.target,this.options.waitMs??yX);if(n.kind==="DONE"){let o=this.options.currentVersion,s=n.value.version;n.value.send(t,async a=>{let u=await this.toolsRelisted.waitFor(this.reloadGraceMs()),c=this.upgradeNoted;return this.upgradeNoted=!0,u||c||JSON.stringify(a).includes(bX)?a:FP(a,TP(o,s,this.host()))});return}let i=n.kind==="TIMEOUT"?SP(r.version.current,wo(r.version)??r.version.latest):ai(r.version,n.reason,this.host());await this.options.inner.send(Jy(t,i))}reloadGraceMs(){return this.options.toolReloadGraceMs??_X}async hostRelistedTools(){let t=this.startedAt+2*this.reloadGraceMs()-Date.now();return this.toolsRelisted.waitFor(Math.max(0,t))}host(){let t=this.initializeRequest?.params?.clientInfo;return _P(t)}async withToolHint(t,r){if(t.method!=="tools/call")return r;let n=OX(r);if(n===null)return r;let{upgradedFrom:i,currentVersion:o}=this.options;return SX.test(n)?AX(r,IP(String(t.params?.name??""),o,this.host(),{upgradedFrom:i,toolListReloaded:i?await this.hostRelistedTools():!1})):i&&TX.test(n)?FP(r,wP(i,o,this.host(),await this.hostRelistedTools())):r}};function OX(e){let t=e.result,r=t?.content?.[0];return t?.isError&&r?.type==="text"&&typeof r.text=="string"?r.text:null}function AX(e,t){return{jsonrpc:"2.0",id:e.id,result:{content:[{type:"text",text:t}],isError:!0}}}function FP(e,t){if(e.error)return{jsonrpc:"2.0",id:e.id,error:{...e.error,message:`${e.error.message}
|
|
1423
|
+
${t}`}};let r=e.result;return r?.content?{jsonrpc:"2.0",id:e.id,result:{...r,content:[...r.content,{type:"text",text:t}]}}:e}function Jy(e,t){return e.method==="tools/call"?{jsonrpc:"2.0",id:e.id,result:{content:[{type:"text",text:t}],isError:!0}}:{jsonrpc:"2.0",id:e.id,error:{code:-32603,message:t}}}var Xy=class{seen=!1;waiters=new Set;reset(){this.seen=!1}mark(){this.seen=!0;for(let t of this.waiters)t();this.waiters.clear()}waitFor(t){return this.seen||t<=0?Promise.resolve(this.seen):new Promise(r=>{let n=()=>{clearTimeout(i),r(!0)},i=setTimeout(()=>{this.waiters.delete(n),r(!1)},t);this.waiters.add(n)})}};function xX(e,t){return new Promise(r=>{let n=setTimeout(()=>r({kind:"TIMEOUT"}),t);e.then(i=>{clearTimeout(n),r({kind:"DONE",value:i})},i=>{clearTimeout(n),r({kind:"FAILED",reason:i instanceof Error?i.message:String(i)})})})}var Zy=class{constructor(t,r,n,i){this.version=t;this.child=r;this.toHost=n;r.stdout.on("data",a=>{for(this.buffer.append(a);;){let u;try{u=this.buffer.readMessage()}catch(c){C.warn(`[upgrade] unreadable message from new version: ${String(c)}`);continue}if(!u)break;this.route(u)}}),r.stdin.on("error",()=>{});let o=!1,s=(a,u)=>{if(!o){o=!0;for(let c of this.waiters.values())c({jsonrpc:"2.0",id:"",error:{code:-32603,message:u}});this.waiters.clear(),this.closed||Promise.allSettled([...this.inflight]).then(()=>i(a))}};r.on("error",a=>s(1,`it could not start: ${a.message}`)),r.on("exit",a=>s(a??1,`it exited with ${a}`))}buffer=new Io;intercepts=new Map;inflight=new Set;waiters=new Map;sequence=0;closed=!1;send(t,r){r&&"id"in t&&t.id!==void 0&&this.intercepts.set(t.id,r),this.closed||this.child.stdin.write($l(t))}async initialize(t,r,n){let i=await this.request(t.method,{...t.params,...r?{protocolVersion:r}:{}});if(i.error)throw new Error(`the new version did not initialize: ${i.error.message}`);let o=i.result?.protocolVersion;if(r&&o!==r)throw new Error(`the new version speaks MCP ${String(o)}, but this session uses ${r}`);this.send({jsonrpc:"2.0",method:"notifications/initialized"});for(let s of n)await this.request(s.method,s.params).catch(()=>{})}close(){this.closed||(this.closed=!0,this.child.stdin.end())}request(t,r){this.sequence+=1;let n=`handover-${this.sequence}`;return new Promise((i,o)=>{let s=setTimeout(()=>{this.waiters.delete(n),o(new Error(`the new version did not answer ${t}`))},vX);this.waiters.set(n,a=>{clearTimeout(s),i(a)}),this.send({jsonrpc:"2.0",id:n,method:t,params:r})})}route(t){if(qP(t)){let r=typeof t.id=="string"?this.waiters.get(t.id):void 0;if(r){this.waiters.delete(t.id),r(t);return}let n=this.intercepts.get(t.id);if(n){this.intercepts.delete(t.id);let i=n(t).then(o=>this.toHost(o));this.inflight.add(i),i.finally(()=>this.inflight.delete(i));return}}this.toHost(t)}};var Ql=bn.toLowerCase(),VP=e=>`${Ql}://project/${encodeURIComponent(e)}/schema-state`,GP=e=>`${Ql}://project/${encodeURIComponent(e)}/schema-events`,$P=e=>Array.isArray(e)?String(e[0]??""):String(e??"");async function ev(e){let t=UP.resolve(e),r=await _a(t),n=BP(),i=async()=>{await _t(r,{name:"daemon.pin",args:{token:n}})},o=async()=>{await _t(r,{name:"daemon.unpin",args:{token:n}}).catch(()=>{})};await i();let s=setInterval(()=>{_t(r,{name:"daemon.heartbeat",args:{token:n}}).catch(()=>{})},6e4);s.unref();let a=new Av({name:Y,version:"1.0.0"},{instructions:DP(),capabilities:{tools:{},prompts:{},resources:{subscribe:!0}}});vv(a);let u=new Set;a.server.setRequestHandler(wv,b=>(u.add(b.params.uri),{})),a.server.setRequestHandler(Ov,b=>(u.delete(b.params.uri),{}));let c=process.env.MCP_HOST_SESSION_ID||RX(),l=async(b,A)=>{if(b.agent??=a.server.getClientVersion()?.name,b.sessionId??=c,b.name==="workspace.set"&&typeof b.args?.cwd=="string"){let O=UP.resolve(b.args.cwd);if(b.args.cwd=O,O!==t){let T=r;r=await _a(O),t=O,await _t(T,{name:"daemon.unpin",args:{token:n}},A).catch(()=>{}),await i()}}return _t(r,b,A)},d=new No,f=new Hl({inner:new Bl,currentVersion:_n(),upgradedFrom:process.env.MCP_UPGRADED_FROM||void 0,canUpgrade:b=>Ro()&&wo(b)!==null,prepare:b=>d.installFirst(Ea(b)),launch:b=>NX(process.execPath,[d.binPath(b),"mcp","--cwd",t],{stdio:["pipe","pipe","inherit"],env:{...process.env,MCP_HOST_SESSION_ID:c,MCP_UPGRADED_FROM:_n()}}),onRelayActive:()=>{clearInterval(s),v.unsubscribe(),o()},onRelayExit:b=>process.exit(b)});Nv(a,f.wrapSender(l)),Cv(a,f.wrapSender(l));let h=async()=>{let b=await _t(r,{name:"schema.status"});if(!b.ok)return[];let O=b.data?.sessions;return Array.isArray(O)?[...new Set(O.map(T=>T?.projectExId).filter(T=>typeof T=="string"))]:[]};a.registerResource("project-schema-state",new ep(`${Ql}://project/{projectExId}/schema-state`,{list:async()=>({resources:(await h()).map(b=>({uri:VP(b),name:`schema-state-${b}`,title:`Schema state ${b}`,description:"Current in-memory schema revision and stale/change notification state.",mimeType:"application/json"}))})}),{title:"Project Schema State",description:"Current in-memory schema revision and stale/change notification state.",mimeType:"application/json"},async(b,A)=>{let O=$P(A.projectExId),T=await _t(r,{name:"schema.state",args:{projectExId:O}});return{contents:[{uri:b.href,mimeType:"application/json",text:JSON.stringify(T.ok?T.data:T,null,2)}]}}),a.registerResource("project-schema-events",new ep(`${Ql}://project/{projectExId}/schema-events`,{list:async()=>({resources:(await h()).map(b=>({uri:GP(b),name:`schema-events-${b}`,title:`Schema events ${b}`,description:"Recent semantic schema-change events observed by the daemon.",mimeType:"application/json"}))})}),{title:"Project Schema Events",description:"Recent semantic schema-change events observed by the daemon.",mimeType:"application/json"},async(b,A)=>{let O=$P(A.projectExId),T=await _t(r,{name:"schema.events",args:{projectExId:O}});return{contents:[{uri:b.href,mimeType:"application/json",text:JSON.stringify(T.ok?T.data:T,null,2)}]}}),await a.connect(f),process.env.MCP_UPGRADED_FROM||kP(ya,d).catch(b=>{C.warn(`[upgrade] prefetch failed: ${String(b)}`)});let g=new Set,v=xP(r,async b=>{if(!b?.id||g.has(b.id))return;g.add(b.id);let A=String(b.projectExId??"");if(!A)return;let O=VP(A),T=GP(A),x=[u.has(O)?a.server.sendResourceUpdated({uri:O}):Promise.resolve(),u.has(T)?a.server.sendResourceUpdated({uri:T}):Promise.resolve()];await Promise.all([...x,a.sendLoggingMessage({level:"notice",logger:Y,data:{message:"Project schema changed",projectExId:A,event:b}})])},b=>{C.warn("Daemon subscription error",b.message)}),_=!1,S=async()=>{_||(_=!0,clearInterval(s),v.unsubscribe(),await o(),await a.close())};process.on("SIGINT",()=>{S().finally(()=>process.exit(0))}),process.on("SIGTERM",()=>{S().finally(()=>process.exit(0))}),process.stdin.on("end",()=>{S().finally(()=>process.exit(0))}),process.stdin.on("close",()=>{S().finally(()=>process.exit(0))}),process.on("exit",()=>{clearInterval(s),v.unsubscribe()})}p();var CX=/^-?\d+(\.\d+)?$/;function PX(e){return e.startsWith("{")&&e.endsWith("}")||e.startsWith("[")&&e.endsWith("]")}function DX(e){if(e==="true")return!0;if(e==="false")return!1;if(e==="null")return null;if(CX.test(e))return Number(e);if(PX(e))try{return JSON.parse(e)}catch{return e}return e}function KP(e){let t=Number(e);if(Number.isNaN(t))throw new vp("expected a number");return t}function tv(e){try{return JSON.parse(e)}catch{throw new vp("expected valid JSON")}}function HP(e){if(typeof e!="string")return{};try{let t=JSON.parse(e);return t&&typeof t=="object"?t:{}}catch{return{}}}function LX(e){let t={};for(let r=0;r<e.length;r++){let n=e[r];if(!n.startsWith("--"))continue;let i=n.slice(2),o,s=i.indexOf("=");if(s!==-1)o=i.slice(s+1),i=i.slice(0,s);else{let a=e[r+1];a!==void 0&&!a.startsWith("--")&&(o=a,r+=1)}o===void 0?i.startsWith("no-")?t[i.slice(3)]=!1:t[i]=!0:t[i]=DX(o)}return t}function QP(e,t,r){let n=HP(e.args);return Object.assign(n,LX(t)),r&&(n.subcommand=r),n}function WP(e,t){let r=HP(t.args),n=e.opts();for(let i of e.options){let o=i.attributeName();e.getOptionValueSource(o)==="cli"&&(r[o]=n[o])}return r}p();function kX(e){let t=e,r=!1;for(;;)if(t instanceof Ct.ZodOptional)r=!0,t=t.unwrap();else if(t instanceof Ct.ZodNullable)t=t.unwrap();else if(t instanceof Ct.ZodDefault)t=t.removeDefault();else break;return{base:t,optional:r}}function zP(e,t){for(let[r,n]of Object.entries(t)){let{base:i,optional:o}=kX(n),s=o?"":"required",a=`${s} JSON`.trim();i instanceof Ct.ZodBoolean?(e.option(`--${r}`,s),e.option(`--no-${r}`)):i instanceof Ct.ZodNumber?e.option(`--${r} <value>`,s,KP):i instanceof Ct.ZodArray?i.element instanceof Ct.ZodString?e.option(`--${r} <values...>`,s):e.option(`--${r} <json>`,a,tv):i instanceof Ct.ZodRecord||i instanceof Ct.ZodObject||i instanceof Ct.ZodAny||i instanceof Ct.ZodUnknown?e.option(`--${r} <json>`,a,tv):e.option(`--${r} <value>`,s)}}var rv=["default"],ZP=[];function ui(e){return typeof e.cwd=="string"?XP.resolve(e.cwd):process.env.WORKSPACE_ROOT||process.cwd()}function Wl(e){return e.pretty===void 0?!0:!e.pretty}async function eD(e,t,r){let n={name:e,args:t},i=ui(r),o=r.daemon===!1?await zX(n,i):await WX(n,i),s=Kl(o);if(s){let a=await LP(s,ZP);if(a.kind==="RERAN"){yv(a.status);return}a.kind==="FAILED"&&(o={...o,error:ai(s,a.reason)})}zl(o,Wl(r)),o.ok||(process.exitCode=1)}async function VX(e){let t=await _a(ui(e));zl({ok:!0,data:tD(t),message:"Daemon started"},Wl(e))}async function GX(e){await CP({workspaceRoot:ui(e),idleTimeoutMs:YX(process.env.ZED_AGENT_DAEMON_IDLE_TTL)??Gl,startupFlags:rv})}async function $X(e){let r=await new vn(ui(e)).list();zl({ok:!0,data:r.map(tD)},Wl(e))}async function BX(e){let t=ui(e),r=new vn(t),n=new br(t),i=await go(n,rv),o=await r.list(),s=[];for(let a of o)if(JSON.stringify(a.compatibility)===JSON.stringify(i))try{await _t(a,{name:"daemon.stop"}),s.push(a.pid)}catch{await r.remove(a.pid)}zl({ok:!0,data:{stopped:s}},Wl(e))}function YP(e,t){return e.commands.find(r=>r.name()===t)}function JP(e,t,r,n,i){let o=e;for(let u=0;u<t.length-1;u+=1)o=YP(o,t[u])??o.command(t[u]);let s=t[t.length-1];if(YP(o,s))return;let a=o.command(s).description(r);i&&zP(a,i),a.action(async(u,c)=>{let l=c.optsWithGlobals();await eD(n,WP(c,l),l)})}function KX(e,t,r,n){JP(e,r.path.split(" "),t.description,t.command,n),r.alias&&JP(e,r.alias.split(" "),t.description,t.command,n)}function HX(){let e=Rt(),t=Object.keys(mv).join(", ");return["","Backend environment:",` Active: ${e.name} (select with ZION_ENV / MCP_ENV; known: ${t})`,` API: ${e.apiBaseUrl}`,` Auth: ${e.authEndpoint}`," Override any endpoint individually with BACKEND_API_BASE,"," BACKEND_AUTH_ENDPOINT, ZERO_API_URL_TEMPLATE, LOG_API_URL_TEMPLATE.","","Upgrades:"," When the backend stops supporting this version, the newer release is installed",` into ~/.${Y}/versions and the call continues on it; later starts run it directly.`," MCP_AUTO_UPGRADE=0 turns this off and only reports the required upgrade.","","Logs:",` File: ${Ev()}`,` Level: ${process.env.MCP_LOG_LEVEL??"info"} (set MCP_LOG_LEVEL; debug, or verbose)`," Verbose: MCP_LOG_LEVEL=verbose (or MCP_LOG_GQL=1) logs full GraphQL bodies + subscription events"," Rotation: 50 MB x 5 files; data older than 1 day is truncated"," Override: MCP_LOG_DIR, MCP_LOG_MAX_BYTES, MCP_LOG_MAX_FILES,"," MCP_LOG_MAX_AGE_DAYS (0 disables), MCP_LOG_FILE=off"].join(`
|
|
1424
|
+
`)}function QX(e){return e instanceof Error&&"code"in e&&typeof e.code=="string"&&e.code.startsWith("commander.")}async function yme(e=process.argv.slice(2)){ZP=e;let t=new Kv;t.name(Y).allowUnknownOption(!0).allowExcessArguments(!0).exitOverride(),t.option("--no-daemon","Run command one-shot without starting or using daemon"),t.option("--cwd <dir>","Workspace root for product config and daemon registry"),t.option("--pretty","Human-oriented output"),t.option("--args <json>","Pass arguments as JSON string"),t.command("mcp").description("Run MCP Bridge").allowUnknownOption(!0).action(async(i,o)=>{await ev(ui(o.optsWithGlobals()))}),t.command("version-check").description("Compare this CLI against the backend-advertised minimum supported version").action(async()=>{let i=await ya();process.stdout.write(`${ql(i)}
|
|
1425
|
+
`),i.status==="outdated"&&(process.exitCode=1)}),t.command("tool-surface",{hidden:!0}).description("Print the MCP tools, prompts and CLI verbs this version exposes, as JSON").action(async()=>{let{collectToolSurface:i}=await import("./surface-DTE36JY5.js");process.stdout.write(`${JSON.stringify(await i(),null,2)}
|
|
1426
|
+
`)});let r=t.command("daemon").description("Daemon control"),n=[["start","Start daemon",VX],["foreground","Run daemon in foreground",GX],["status","Get daemon status",$X],["stop","Stop daemon",BX]];for(let[i,o,s]of n)r.command(i).description(o).action(async(a,u)=>{await s(u.optsWithGlobals())});for(let i of xv){if(!i.cli)continue;let o=i.cli,s=i.tool?.inputSchema;KX(t,i,o,s)}t.argument("[parts...]","Custom agent command or MCP Bridge").action(async(i,o,s)=>{let a=s.optsWithGlobals();if(!i||i.length===0){await ev(ui(a));return}let u=[],c=[],l=!1;for(let d of i)!l&&d.startsWith("--")&&(l=!0),(l?c:u).push(d);await eD(u[0],QP(a,c,u[1]),a)}),t.addHelpText("afterAll",HX);try{await t.parseAsync(["node",Y,...e])}catch(i){if(QX(i)){i.code==="commander.help"||i.code==="commander.helpDisplayed"||i.code==="commander.version"||(process.exitCode=1);return}throw i}}async function WX(e,t){let r=await _a(t);return _t(r,e)}async function zX(e,t){let r=Ul(t);try{return await r.execute(e)}finally{r.stop()}}async function _a(e){let t=new vn(e),r=new br(e),n=await go(r,rv),i=await t.findCompatible(n);if(i)try{if((await _t(i,{name:"daemon.ping"})).ok)return i}catch{await t.remove(i.pid)}let o=t.createRecord(n);await t.ensure(),await UX.mkdir(XP.dirname(o.logPath),{recursive:!0});let s=qX(o.logPath,"a"),a=jX(process.execPath,[process.argv[1],"daemon","foreground"],{cwd:e,detached:!0,env:{...process.env,WORKSPACE_ROOT:e,ZED_AGENT_DAEMON_IDLE_TTL:process.env.ZED_AGENT_DAEMON_IDLE_TTL??String(Gl)},stdio:["ignore",s,s]});FX(s),a.unref();let u=Date.now()+1e4,c=null;for(;Date.now()<u;){await JX(200);let l=await t.findCompatible(n);if(l)try{if((await _t(l,{name:"daemon.ping"})).ok)return l}catch(d){c=d}}throw new Error(`Failed to start daemon${c?`: ${c.message}`:""}`)}function tD(e){let{token:t,...r}=e;return r}function zl(e,t){if(t){let r=e.ok?e.data??(e.message!==void 0?{message:e.message}:{}):{error:e.error,...e.data!==void 0?{data:e.data}:{}};process.stdout.write(`${JSON.stringify(r,null,2)}
|
|
1430
1427
|
`);return}e.message&&process.stdout.write(`${e.message}
|
|
1431
1428
|
`),e.data!==void 0&&process.stdout.write(`${JSON.stringify(e.data,null,2)}
|
|
1432
1429
|
`),e.error&&process.stderr.write(`${e.error}
|
|
1433
|
-
`)}function
|
|
1430
|
+
`)}function YX(e){if(!e)return null;if(/^\d+$/.test(e))return Number(e);let t=e.match(/^(\d+)(ms|s|m|h)$/);if(!t)return null;let r=Number(t[1]),n=t[2];return n==="ms"?r:n==="s"?r*1e3:n==="m"?r*6e4:r*60*6e4}function BP(){return MX()}var JX=e=>new Promise(t=>{setTimeout(t,e)});export{BP as createMcpPinToken,_a as ensureDaemon,yme as runCli};
|